@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,56 +1,67 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { jsx as n, jsxs as
|
|
5
|
-
import { useQueryClient as
|
|
6
|
-
import { ArrowRight as
|
|
7
|
-
import { useState as
|
|
8
|
-
import { toast as
|
|
9
|
-
import { useNivaroClient as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
|
|
1
|
+
var pr = Object.defineProperty;
|
|
2
|
+
var fr = (t, e, r) => e in t ? pr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var xt = (t, e, r) => fr(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { jsx as n, jsxs as i, Fragment as _e } from "react/jsx-runtime";
|
|
5
|
+
import { useQueryClient as Je, useQuery as ke, useMutation as Ye } from "@tanstack/react-query";
|
|
6
|
+
import { ArrowRight as Ot, Loader2 as Me, Check as ft, GitBranch as wt, AlertTriangle as ln, ChevronDown as Ge, Send as dn, Users as cn, Undo2 as hr, Minus as gr, UserPlus as br, X as vr, Zap as un, Clock as xr } from "lucide-react";
|
|
7
|
+
import { useState as V, useRef as xe, useEffect as Ee, useMemo as ut, Suspense as mn, useCallback as pn, lazy as wr, Fragment as yr } from "react";
|
|
8
|
+
import { toast as X } from "sonner";
|
|
9
|
+
import { useNivaroClient as je, useItemEditAuth as fn } from "../../context.js";
|
|
10
|
+
import { chainStepText as kr } from "../../lib/approval-progress.js";
|
|
11
|
+
import { get as qe, post as rt, del as _r } from "../../lib/commands.js";
|
|
12
|
+
import { errorToastOptions as hn, toastError as Nr } from "../../lib/error-toast.js";
|
|
13
|
+
import { enteredAtFromHistory as Sr } from "../../lib/in-step.js";
|
|
14
|
+
import { useLiveMoves as gn } from "../../lib/live-moves.js";
|
|
15
|
+
import { useLiveFade as Cr } from "../../lib/live-screen.js";
|
|
16
|
+
import { partnerMoveFailure as bn, partnerMoveReading as vn } from "../../lib/move-failure.js";
|
|
17
|
+
import { OPEN_MOVE_STATE_EVENT as Xt } from "../../lib/move-state.js";
|
|
18
|
+
import { useRecordSignalWhile as xn, useRecordSignalPeers as $r, signalSentence as Tr } from "../../lib/presence-signals.js";
|
|
19
|
+
import { RUN_TRANSITION_EVENT as mt } from "../../lib/run-transition.js";
|
|
20
|
+
import { userErrorMessage as Ie } from "../../lib/safe-error.js";
|
|
21
|
+
import { serverNow as Mr } from "../../lib/server-clock.js";
|
|
22
|
+
import { useTrackTravel as qr, travelPlan as Pr } from "../../lib/track-travel.js";
|
|
23
|
+
import { useStartsOpen as Rr } from "../../lib/use-starts-open.js";
|
|
24
|
+
import { cn as le, titleCase as Fr, toLocalDateString as Ar, formatDateTime as Yt, humanHours as Or } from "../../lib/utils.js";
|
|
25
|
+
import { StepForLine as Dr } from "../InStep.js";
|
|
26
|
+
import { PushReadinessChip as Br } from "../integrations/RecordIntegrationPreview.js";
|
|
27
|
+
import { SendStatusLines as Ur } from "../integrations/SendStatus.js";
|
|
28
|
+
import { useHeaderFold as Er } from "../item-edit/HeaderTools.js";
|
|
29
|
+
import { invalidateRecordInsights as Ve, invalidateRecordData as Xe } from "../item-edit/RecordInsights.js";
|
|
30
|
+
import { UserChip as wn } from "../item-edit/UserChip.js";
|
|
31
|
+
import { OwnerAvatars as Lr } from "../queue/OwnerAvatars.js";
|
|
32
|
+
import { RelativeTime as Dt } from "../RelativeTime.js";
|
|
33
|
+
import { UserAvatar as Ir } from "../UserAvatar.js";
|
|
34
|
+
import { Button as ge } from "../ui/button.js";
|
|
35
|
+
import { DropdownMenu as Nt, DropdownMenuTrigger as St, DropdownMenuContent as Ct, DropdownMenuGroup as Jt, DropdownMenuSeparator as $t, DropdownMenuItem as ot, DropdownMenuLabel as jr } from "../ui/dropdown-menu.js";
|
|
36
|
+
import { Popover as yn, PopoverTrigger as kn, PopoverContent as _n } from "../ui/popover.js";
|
|
37
|
+
import { Skeleton as Ue } from "../ui/skeleton.js";
|
|
38
|
+
import { TooltipProvider as Nn, Tooltip as Tt, TooltipTrigger as Mt, TooltipContent as qt } from "../ui/tooltip.js";
|
|
39
|
+
import { ViewAsPersonButton as yt } from "../ViewAsPersonButton.js";
|
|
40
|
+
import { isAccessRefusal as Sn, deniedToastAction as Cn, WhyOwnersButton as Kr } from "./AccessInsights.js";
|
|
41
|
+
import { AsyncUserPicker as Qr } from "./AsyncUserPicker.js";
|
|
42
|
+
import { runningMovePoll as $n, useRunEnded as Tn, startedInBackground as Mn, pendingOptIn as qn, sameMoveId as Pt, runningMoveTip as Wr, unansweredHoldTip as Pn, RunningMoveNotice as zr, MoveProblemNotice as Hr } from "./BackgroundMove.js";
|
|
43
|
+
import { withBlockedMoves as Rn, BlockedMenuMark as lt, blockedMenuItemProps as dt, isBlockedMove as Fn, BlockedMoveButton as An, blockedGroupTip as On } from "./BlockedMove.js";
|
|
44
|
+
import { BranchLanes as Gr } from "./BranchLanes.js";
|
|
45
|
+
import { landingState as Vr, landingSkipGroups as Xr, joinLabels as Zt } from "./landing-state.js";
|
|
46
|
+
import { distinctAdvisories as Dn, MoveAdvisoryNotice as Bn, REFUSAL_FIX_ACTIONS as Yr, useRecordFixAction as Jr } from "./MoveAdvisory.js";
|
|
47
|
+
import { MoveToStatePanel as Zr } from "./MoveToStatePanel.js";
|
|
48
|
+
import { OWNER_OPENED_HEAD as ea, OwnerOpenedLine as ta } from "./OwnerOpenedLine.js";
|
|
49
|
+
import { SignOffSummaryLines as na, useStepTiming as Un, TimingLegend as ra, timingWords as En, firstTouchText as Ln, waitingFill as aa, workingFill as sa } from "./PipelineInsight.js";
|
|
50
|
+
import { ResubmissionBrief as en } from "./ResubmissionDiff.js";
|
|
51
|
+
import { SlaClockLine as ia } from "./SlaClock.js";
|
|
52
|
+
import { standInIds as oa, StandInReasonLines as la } from "./StandInReason.js";
|
|
53
|
+
import { useUnseenMoveCheck as In, UnseenChangesNotice as jn } from "./unseen-move-check.js";
|
|
54
|
+
const Kn = wr(
|
|
44
55
|
() => import("./TransitionRequirementsDialog.js").then((t) => ({
|
|
45
56
|
default: t.TransitionRequirementsDialog
|
|
46
57
|
}))
|
|
47
58
|
);
|
|
48
|
-
function
|
|
49
|
-
var
|
|
50
|
-
const r = t || "System", a = (
|
|
59
|
+
function Bt(t, e) {
|
|
60
|
+
var s;
|
|
61
|
+
const r = t || "System", a = (s = e.acting_admin) != null && s.name && t ? `${e.acting_admin.name} as ${r}` : r;
|
|
51
62
|
return e.on_behalf_of_name ? `${a}, for ${e.on_behalf_of_name}` : a;
|
|
52
63
|
}
|
|
53
|
-
function
|
|
64
|
+
function da(t) {
|
|
54
65
|
if (t.transition) return null;
|
|
55
66
|
const e = (t.comment ?? "").trim();
|
|
56
67
|
if (!e.startsWith("{")) return null;
|
|
@@ -64,20 +75,20 @@ function Wr(t) {
|
|
|
64
75
|
}
|
|
65
76
|
return null;
|
|
66
77
|
}
|
|
67
|
-
function
|
|
78
|
+
function ct(t) {
|
|
68
79
|
return !(t.first_name || t.last_name || t.user_email);
|
|
69
80
|
}
|
|
70
|
-
function
|
|
81
|
+
function Rt(t) {
|
|
71
82
|
const e = (t.comment ?? "").trim().toLowerCase();
|
|
72
83
|
return t.origin === "import" || e.startsWith("import:") ? "Imported" : t.origin === "integration" ? "By an integration" : /-state-sync$/.test(e) || e.startsWith("legacy-") ? "Synced from another system" : e === "state-merge" || e === "instance-migration" ? "Moved by an admin script" : "Moved automatically";
|
|
73
84
|
}
|
|
74
|
-
function
|
|
85
|
+
function Ft(t) {
|
|
75
86
|
if (t.transition_text) return t.transition_text;
|
|
76
87
|
if (t.transition_label) return `Rule: ${t.transition_label}`;
|
|
77
88
|
const e = (t.comment ?? "").trim(), r = /^auto: (.+)$/i.exec(e);
|
|
78
89
|
return r ? `Rule: ${r[1]}` : /-state-sync$/i.test(e) ? "The state was copied in from the system that owned this record" : /^instance-migration/i.test(e) ? "Moved when the pipeline was reshaped" : /^state-merge/i.test(e) ? "Moved when two states were merged" : null;
|
|
79
90
|
}
|
|
80
|
-
const
|
|
91
|
+
const tn = {
|
|
81
92
|
validation: "the partner refused what we sent",
|
|
82
93
|
not_found: "the partner could not find what we referred to",
|
|
83
94
|
auth: "the partner refused our credentials",
|
|
@@ -85,20 +96,20 @@ const Vt = {
|
|
|
85
96
|
rate_limited: "the partner asked us to slow down",
|
|
86
97
|
unknown: "the partner refused it"
|
|
87
98
|
};
|
|
88
|
-
function
|
|
89
|
-
const e = Math.ceil((new Date(t).getTime() -
|
|
99
|
+
function ca(t) {
|
|
100
|
+
const e = Math.ceil((new Date(t).getTime() - Mr()) / 6e4);
|
|
90
101
|
return !Number.isFinite(e) || e <= 0 ? "on the next check" : e < 60 ? `in ${e} min` : `in ${Math.round(e / 60)}h`;
|
|
91
102
|
}
|
|
92
|
-
function
|
|
103
|
+
function ua({ held: t }) {
|
|
93
104
|
return t.length === 0 ? null : /* @__PURE__ */ n(
|
|
94
105
|
"div",
|
|
95
106
|
{
|
|
96
107
|
className: "space-y-2 border-b border-amber-100 bg-amber-50 px-5 py-3 dark:border-amber-500/20 dark:bg-amber-500/10",
|
|
97
108
|
"data-pipeline-auto-held": !0,
|
|
98
109
|
children: t.map((e) => {
|
|
99
|
-
const r = e.transition_label ?? "An automatic move", a =
|
|
100
|
-
return /* @__PURE__ */
|
|
101
|
-
/* @__PURE__ */
|
|
110
|
+
const r = e.transition_label ?? "An automatic move", a = tn[e.error_class ?? "unknown"] ?? tn.unknown;
|
|
111
|
+
return /* @__PURE__ */ i("div", { className: "text-[12px] text-amber-800 dark:text-amber-300", children: [
|
|
112
|
+
/* @__PURE__ */ i("p", { className: "font-medium", children: [
|
|
102
113
|
"Needs a person: ",
|
|
103
114
|
r,
|
|
104
115
|
" stopped retrying — ",
|
|
@@ -113,8 +124,8 @@ function Hr({ held: t }) {
|
|
|
113
124
|
children: e.error
|
|
114
125
|
}
|
|
115
126
|
),
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
e.retry_at ? `It tries the same push again ${
|
|
127
|
+
/* @__PURE__ */ i("p", { className: "mt-1 text-[11px] text-amber-700 dark:text-amber-400", children: [
|
|
128
|
+
e.retry_at ? `It tries the same push again ${ca(e.retry_at)}. ` : "It will not send the same push again on its own. ",
|
|
118
129
|
"Fix the record so what it sends changes, retry the push, or move the record by hand.",
|
|
119
130
|
e.attempts > 1 ? ` ${e.attempts} attempts so far.` : ""
|
|
120
131
|
] })
|
|
@@ -123,70 +134,70 @@ function Hr({ held: t }) {
|
|
|
123
134
|
}
|
|
124
135
|
);
|
|
125
136
|
}
|
|
126
|
-
function
|
|
137
|
+
function Qn(t) {
|
|
127
138
|
var r;
|
|
128
139
|
const e = t == null ? void 0 : t.response;
|
|
129
140
|
return ((e == null ? void 0 : e.code) ?? ((r = e == null ? void 0 : e.data) == null ? void 0 : r.code)) === "TRANSITION_DUPLICATE";
|
|
130
141
|
}
|
|
131
|
-
function
|
|
142
|
+
function Wn(t) {
|
|
132
143
|
var r;
|
|
133
144
|
const e = t;
|
|
134
145
|
return (e == null ? void 0 : e.status) === 422 && ((r = e.response) == null ? void 0 : r.error) === "TRANSITION_REQUIREMENTS" ? e.response.requirements ?? [] : null;
|
|
135
146
|
}
|
|
136
|
-
function
|
|
147
|
+
function ht(t) {
|
|
137
148
|
var a;
|
|
138
149
|
const e = t == null ? void 0 : t.response, r = (e == null ? void 0 : e.code) ?? ((a = e == null ? void 0 : e.data) == null ? void 0 : a.code);
|
|
139
150
|
return typeof r == "string" ? r : null;
|
|
140
151
|
}
|
|
141
|
-
function
|
|
142
|
-
if (
|
|
152
|
+
function zn(t) {
|
|
153
|
+
if (ht(t) !== "RECORD_LOCKED") return null;
|
|
143
154
|
const e = t == null ? void 0 : t.response, r = e != null && e.data && typeof e.data == "object" ? e.data : e;
|
|
144
155
|
if ((r == null ? void 0 : r.move_anyway) !== !0) return null;
|
|
145
156
|
const a = typeof r.locked_by_name == "string" ? r.locked_by_name : null;
|
|
146
157
|
return { message: typeof r.error == "string" && r.error.trim() ? r.error : `${a ?? "Someone else"} is editing this record right now.`, holder: a };
|
|
147
158
|
}
|
|
148
|
-
function
|
|
149
|
-
var
|
|
150
|
-
const r =
|
|
151
|
-
return !r || !
|
|
159
|
+
function Hn(t, e) {
|
|
160
|
+
var k, f, p;
|
|
161
|
+
const r = ht(t), a = t == null ? void 0 : t.response, s = ((k = a == null ? void 0 : a.fix) == null ? void 0 : k.action) ?? ((p = (f = a == null ? void 0 : a.data) == null ? void 0 : f.fix) == null ? void 0 : p.action), c = typeof s == "string" && s.trim() || (r ? Yr[r] : void 0);
|
|
162
|
+
return !r || !c ? null : { code: r, actionKey: c, transitionId: e.transition_id, comment: e.comment };
|
|
152
163
|
}
|
|
153
|
-
const
|
|
154
|
-
function
|
|
155
|
-
const e =
|
|
156
|
-
|
|
157
|
-
|
|
164
|
+
const ma = 600;
|
|
165
|
+
function Gn(t) {
|
|
166
|
+
const e = Je(), [r, a] = V(!1), s = xe(!0);
|
|
167
|
+
Ee(() => (s.current = !0, () => {
|
|
168
|
+
s.current = !1;
|
|
158
169
|
}), []);
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
const
|
|
170
|
+
const c = xe(t);
|
|
171
|
+
c.current = t;
|
|
172
|
+
const k = pn(async () => {
|
|
162
173
|
a(!0);
|
|
163
174
|
try {
|
|
164
|
-
await e.refetchQueries({ queryKey: [...
|
|
175
|
+
await e.refetchQueries({ queryKey: [...c.current], type: "active" });
|
|
165
176
|
} catch {
|
|
166
177
|
}
|
|
167
|
-
await new Promise((
|
|
178
|
+
await new Promise((f) => setTimeout(f, ma)), s.current && a(!1);
|
|
168
179
|
}, [e]);
|
|
169
|
-
return { settling: r, settle:
|
|
180
|
+
return { settling: r, settle: k };
|
|
170
181
|
}
|
|
171
|
-
const
|
|
172
|
-
class
|
|
182
|
+
const We = 1500, nn = 4e3;
|
|
183
|
+
class pa {
|
|
173
184
|
constructor() {
|
|
174
|
-
|
|
175
|
-
|
|
185
|
+
xt(this, "seen", null);
|
|
186
|
+
xt(this, "fresh", /* @__PURE__ */ new Map());
|
|
176
187
|
}
|
|
177
188
|
/** Feed the ids on offer now. */
|
|
178
189
|
observe(e, r) {
|
|
179
|
-
const a = new Set(e.map((
|
|
190
|
+
const a = new Set(e.map((s) => String(s).toUpperCase()));
|
|
180
191
|
if (this.seen)
|
|
181
|
-
for (const
|
|
182
|
-
this.seen.has(
|
|
183
|
-
for (const
|
|
192
|
+
for (const s of a)
|
|
193
|
+
this.seen.has(s) || this.fresh.set(s, { at: r, hovered: !1, left: !1 });
|
|
194
|
+
for (const s of [...this.fresh.keys()]) a.has(s) || this.fresh.delete(s);
|
|
184
195
|
this.seen = a;
|
|
185
196
|
}
|
|
186
197
|
/** The pointer is on the button. */
|
|
187
198
|
enter(e, r) {
|
|
188
199
|
const a = this.fresh.get(String(e).toUpperCase());
|
|
189
|
-
a && !a.left && r - a.at <
|
|
200
|
+
a && !a.left && r - a.at < We && (a.hovered = !0);
|
|
190
201
|
}
|
|
191
202
|
/** The pointer left the button. */
|
|
192
203
|
leave(e) {
|
|
@@ -196,108 +207,108 @@ class Vr {
|
|
|
196
207
|
/** Still inert (no state change)? */
|
|
197
208
|
inert(e, r) {
|
|
198
209
|
const a = this.fresh.get(String(e).toUpperCase());
|
|
199
|
-
return !a || r - a.at >=
|
|
210
|
+
return !a || r - a.at >= nn ? !1 : r - a.at < We || a.hovered && !a.left;
|
|
200
211
|
}
|
|
201
212
|
/** A press: true = let it through. A press inside the window counts as the pointer being there. */
|
|
202
213
|
press(e, r) {
|
|
203
|
-
const a = String(e).toUpperCase(),
|
|
204
|
-
return
|
|
214
|
+
const a = String(e).toUpperCase(), s = this.fresh.get(a);
|
|
215
|
+
return s ? r - s.at < We ? (s.hovered = !0, s.left = !1, !1) : s.hovered && !s.left && r - s.at < nn ? !1 : (this.fresh.delete(a), !0) : !0;
|
|
205
216
|
}
|
|
206
217
|
/** Inside its time window (drawn dimmed)? */
|
|
207
218
|
timed(e, r) {
|
|
208
219
|
const a = this.fresh.get(String(e).toUpperCase());
|
|
209
|
-
return !!a && r - a.at <
|
|
220
|
+
return !!a && r - a.at < We;
|
|
210
221
|
}
|
|
211
222
|
/** Any button still inside its time window? */
|
|
212
223
|
hasTimed(e) {
|
|
213
|
-
for (const r of this.fresh.values()) if (e - r.at <
|
|
224
|
+
for (const r of this.fresh.values()) if (e - r.at < We) return !0;
|
|
214
225
|
return !1;
|
|
215
226
|
}
|
|
216
227
|
reset() {
|
|
217
228
|
this.seen = null, this.fresh.clear();
|
|
218
229
|
}
|
|
219
230
|
}
|
|
220
|
-
function
|
|
231
|
+
function Vn(t, e) {
|
|
221
232
|
const r = xe(null);
|
|
222
|
-
r.current || (r.current = new
|
|
223
|
-
const a = r.current,
|
|
224
|
-
|
|
225
|
-
const [,
|
|
226
|
-
return
|
|
233
|
+
r.current || (r.current = new pa());
|
|
234
|
+
const a = r.current, s = xe(e);
|
|
235
|
+
s.current !== e && (s.current = e, a.reset());
|
|
236
|
+
const [, c] = V(0), k = t ? t.join(",") : null;
|
|
237
|
+
return ut(() => {
|
|
227
238
|
t && a.observe(t, Date.now());
|
|
228
|
-
}, [a,
|
|
239
|
+
}, [a, k]), Ee(() => {
|
|
229
240
|
if (!a.hasTimed(Date.now())) return;
|
|
230
|
-
const
|
|
231
|
-
return () => clearTimeout(
|
|
232
|
-
}, [a,
|
|
233
|
-
dimmed: (
|
|
234
|
-
press: (
|
|
235
|
-
bind: (
|
|
236
|
-
onPointerEnter: () => a.enter(
|
|
237
|
-
onPointerMove: () => a.enter(
|
|
238
|
-
onPointerLeave: () => a.leave(
|
|
241
|
+
const f = setTimeout(() => c((p) => p + 1), We + 20);
|
|
242
|
+
return () => clearTimeout(f);
|
|
243
|
+
}, [a, k]), {
|
|
244
|
+
dimmed: (f) => a.timed(f, Date.now()),
|
|
245
|
+
press: (f) => a.press(f, Date.now()),
|
|
246
|
+
bind: (f) => ({
|
|
247
|
+
onPointerEnter: () => a.enter(f, Date.now()),
|
|
248
|
+
onPointerMove: () => a.enter(f, Date.now()),
|
|
249
|
+
onPointerLeave: () => a.leave(f)
|
|
239
250
|
})
|
|
240
251
|
};
|
|
241
252
|
}
|
|
242
|
-
function
|
|
253
|
+
function Xn(t, e) {
|
|
243
254
|
return ["approval-brief", t, String(e)];
|
|
244
255
|
}
|
|
245
|
-
function
|
|
256
|
+
function Yn(t, e, r) {
|
|
246
257
|
return t.request(
|
|
247
|
-
|
|
258
|
+
qe(`/pipelines/instance/${e}/${r}/approval-brief`)
|
|
248
259
|
).then((a) => a.data);
|
|
249
260
|
}
|
|
250
|
-
function
|
|
261
|
+
function fa(t) {
|
|
251
262
|
return (t ?? []).filter((e) => e.tone === "warn" || e.tone === "danger");
|
|
252
263
|
}
|
|
253
|
-
function
|
|
264
|
+
function rn(t) {
|
|
254
265
|
return `${(t.label ?? "").trim().toLowerCase()}|${(t.text ?? "").trim().toLowerCase()}`;
|
|
255
266
|
}
|
|
256
|
-
function
|
|
267
|
+
function ha(t) {
|
|
257
268
|
const e = Math.max(0, Math.floor(Number(t) || 0));
|
|
258
269
|
return e === 0 ? "today" : e === 1 ? "1 day ago" : `${e} days ago`;
|
|
259
270
|
}
|
|
260
|
-
function
|
|
261
|
-
const a = (
|
|
262
|
-
if (t === void 0) return { old: null, new:
|
|
263
|
-
if (
|
|
264
|
-
let
|
|
265
|
-
for (;
|
|
266
|
-
const p =
|
|
267
|
-
return { old:
|
|
271
|
+
function ga(t, e, r = 40) {
|
|
272
|
+
const a = (S) => S == null || S === "" ? "" : String(S), s = a(t), c = a(e), k = (S) => S === "" ? "(empty)" : S;
|
|
273
|
+
if (t === void 0) return { old: null, new: kt(k(c), 0, r) };
|
|
274
|
+
if (s.length <= r && c.length <= r) return { old: k(s), new: k(c) };
|
|
275
|
+
let f = 0;
|
|
276
|
+
for (; f < s.length && f < c.length && s[f] === c[f]; ) f++;
|
|
277
|
+
const p = f > r / 2 ? f - Math.floor(r / 3) : 0;
|
|
278
|
+
return { old: kt(k(s), p, r), new: kt(k(c), p, r) };
|
|
268
279
|
}
|
|
269
|
-
function
|
|
270
|
-
const a = Math.min(e, Math.max(0, t.length - r)),
|
|
271
|
-
return `${a > 0 ? "…" : ""}${
|
|
280
|
+
function kt(t, e, r) {
|
|
281
|
+
const a = Math.min(e, Math.max(0, t.length - r)), s = t.slice(a, a + r);
|
|
282
|
+
return `${a > 0 ? "…" : ""}${s}${a + r < t.length ? "…" : ""}`;
|
|
272
283
|
}
|
|
273
|
-
const
|
|
274
|
-
function
|
|
275
|
-
const r =
|
|
276
|
-
return
|
|
284
|
+
const ba = 4e3;
|
|
285
|
+
function Jn(t, e) {
|
|
286
|
+
const r = je(), a = Je();
|
|
287
|
+
return pn(async () => {
|
|
277
288
|
try {
|
|
278
|
-
const
|
|
289
|
+
const s = await Promise.race([
|
|
279
290
|
a.fetchQuery({
|
|
280
|
-
queryKey:
|
|
281
|
-
queryFn: () =>
|
|
291
|
+
queryKey: Xn(t, e),
|
|
292
|
+
queryFn: () => Yn(r, t, e),
|
|
282
293
|
staleTime: 0,
|
|
283
294
|
retry: !1
|
|
284
295
|
}),
|
|
285
|
-
new Promise((
|
|
296
|
+
new Promise((c) => setTimeout(() => c(null), ba))
|
|
286
297
|
]);
|
|
287
|
-
return
|
|
298
|
+
return fa(s == null ? void 0 : s.lines);
|
|
288
299
|
} catch {
|
|
289
300
|
return [];
|
|
290
301
|
}
|
|
291
302
|
}, [r, a, t, e]);
|
|
292
303
|
}
|
|
293
|
-
function
|
|
294
|
-
return t.length === 0 ? null : /* @__PURE__ */
|
|
304
|
+
function Zn({ lines: t }) {
|
|
305
|
+
return t.length === 0 ? null : /* @__PURE__ */ i(
|
|
295
306
|
"div",
|
|
296
307
|
{
|
|
297
308
|
"data-forward-warning": !0,
|
|
298
309
|
className: "rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-[12px] text-amber-800 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200",
|
|
299
310
|
children: [
|
|
300
|
-
t.map((e) => /* @__PURE__ */
|
|
311
|
+
t.map((e) => /* @__PURE__ */ i("p", { children: [
|
|
301
312
|
/* @__PURE__ */ n("span", { className: "font-semibold", children: e.label ? `${e.label}: ` : "" }),
|
|
302
313
|
e.text
|
|
303
314
|
] }, `${e.label}:${e.text}`)),
|
|
@@ -306,22 +317,22 @@ function Qn({ lines: t }) {
|
|
|
306
317
|
}
|
|
307
318
|
);
|
|
308
319
|
}
|
|
309
|
-
function
|
|
320
|
+
function at(t, e, r) {
|
|
310
321
|
if (!r) return !1;
|
|
311
322
|
const a = e.find(
|
|
312
|
-
(
|
|
313
|
-
),
|
|
314
|
-
return !!a && !!
|
|
323
|
+
(c) => String(c.id).toUpperCase() === String(r).toUpperCase()
|
|
324
|
+
), s = e.find((c) => String(c.id).toUpperCase() === String(t.to_state).toUpperCase());
|
|
325
|
+
return !!a && !!s && s.sort < a.sort;
|
|
315
326
|
}
|
|
316
|
-
function
|
|
317
|
-
var
|
|
327
|
+
function Ut(t, e, r) {
|
|
328
|
+
var s;
|
|
318
329
|
if (!t) return !1;
|
|
319
|
-
if ((((
|
|
320
|
-
if (
|
|
321
|
-
const a = e.find((
|
|
330
|
+
if ((((s = t.order_partners) == null ? void 0 : s.length) ?? 0) > 0) return !0;
|
|
331
|
+
if (at(t, e, r)) return !1;
|
|
332
|
+
const a = e.find((c) => String(c.id).toUpperCase() === String(t.to_state).toUpperCase());
|
|
322
333
|
return !!(a != null && a.is_terminal) && !/(^|_)cancel/i.test(String(a.key ?? ""));
|
|
323
334
|
}
|
|
324
|
-
const
|
|
335
|
+
const an = {
|
|
325
336
|
red: "border-red-200 bg-red-50 text-red-800 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300",
|
|
326
337
|
amber: "border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-300",
|
|
327
338
|
yellow: "border-yellow-200 bg-yellow-50 text-yellow-800 dark:border-yellow-500/30 dark:bg-yellow-500/10 dark:text-yellow-300",
|
|
@@ -329,14 +340,14 @@ const Jt = {
|
|
|
329
340
|
blue: "border-sky-200 bg-sky-50 text-sky-800 dark:border-sky-500/30 dark:bg-sky-500/10 dark:text-sky-300",
|
|
330
341
|
purple: "border-violet-200 bg-violet-50 text-violet-800 dark:border-violet-500/30 dark:bg-violet-500/10 dark:text-violet-300"
|
|
331
342
|
};
|
|
332
|
-
function
|
|
333
|
-
return !t || t.length === 0 ? null : /* @__PURE__ */ n(
|
|
343
|
+
function va({ flags: t }) {
|
|
344
|
+
return !t || t.length === 0 ? null : /* @__PURE__ */ n(_e, { children: t.map((e) => /* @__PURE__ */ i(
|
|
334
345
|
"span",
|
|
335
346
|
{
|
|
336
347
|
"data-record-flag": e.name,
|
|
337
|
-
className:
|
|
348
|
+
className: le(
|
|
338
349
|
"inline-flex shrink-0 items-center gap-1 self-center rounded-full border px-2 py-0.5 text-[11px] font-semibold",
|
|
339
|
-
|
|
350
|
+
an[e.color] ?? an.amber
|
|
340
351
|
),
|
|
341
352
|
children: [
|
|
342
353
|
/* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 rounded-full bg-current", "aria-hidden": !0 }),
|
|
@@ -346,131 +357,132 @@ function ea({ flags: t }) {
|
|
|
346
357
|
e.name
|
|
347
358
|
)) });
|
|
348
359
|
}
|
|
349
|
-
function
|
|
360
|
+
function sn(t) {
|
|
350
361
|
return t.replace(/\s+IIP$/i, "");
|
|
351
362
|
}
|
|
352
|
-
function
|
|
363
|
+
function er({
|
|
353
364
|
collection: t,
|
|
354
365
|
item: e,
|
|
355
366
|
tx: r
|
|
356
367
|
}) {
|
|
357
|
-
const a =
|
|
368
|
+
const a = je(), s = (r == null ? void 0 : r.order_partners) ?? [], { data: c } = ke({
|
|
358
369
|
queryKey: ["push-preflight", t, e, "t", (r == null ? void 0 : r.id) ?? ""],
|
|
359
370
|
queryFn: () => a.request(
|
|
360
|
-
|
|
371
|
+
qe(`/integration-preview/${t}/${encodeURIComponent(e)}/preflight`, {
|
|
361
372
|
transition_id: (r == null ? void 0 : r.id) ?? ""
|
|
362
373
|
})
|
|
363
374
|
).then((p) => p.data),
|
|
364
|
-
enabled:
|
|
375
|
+
enabled: s.length > 0 && !!(r != null && r.id),
|
|
365
376
|
staleTime: 2e4
|
|
366
377
|
});
|
|
367
|
-
if (
|
|
368
|
-
const
|
|
369
|
-
return /* @__PURE__ */
|
|
378
|
+
if (s.length === 0) return null;
|
|
379
|
+
const k = c != null && c.pushes ? c.pushes.filter((p) => p.status === "would_push" && s.includes(p.api_name)).map((p) => sn(p.api_name)) : null, f = [...new Set(k ?? s.map(sn))];
|
|
380
|
+
return /* @__PURE__ */ i(
|
|
370
381
|
"p",
|
|
371
382
|
{
|
|
372
383
|
"data-order-send-note": !0,
|
|
373
384
|
className: "flex items-start gap-1.5 rounded-md border border-sky-200 bg-sky-50 px-2.5 py-1.5 text-[12px] text-sky-900 dark:border-sky-500/30 dark:bg-sky-500/10 dark:text-sky-200",
|
|
374
385
|
children: [
|
|
375
|
-
/* @__PURE__ */ n(
|
|
376
|
-
|
|
386
|
+
/* @__PURE__ */ n(dn, { className: "mt-0.5 h-3.5 w-3.5 shrink-0", "aria-hidden": !0 }),
|
|
387
|
+
k && k.length === 0 ? "Nothing is sent to a partner for this record — it only moves the record on." : `This places an order with ${f.join(" or ")}. It cannot be called back from here.`
|
|
377
388
|
]
|
|
378
389
|
}
|
|
379
390
|
);
|
|
380
391
|
}
|
|
381
|
-
function
|
|
392
|
+
function tr(t) {
|
|
382
393
|
return t != null && t.instance ? (t.available_transitions ?? []).some(
|
|
383
394
|
(e) => {
|
|
384
395
|
var r;
|
|
385
|
-
return
|
|
396
|
+
return at(e, t.states ?? [], (r = t.instance) == null ? void 0 : r.current_state);
|
|
386
397
|
}
|
|
387
398
|
) : !1;
|
|
388
399
|
}
|
|
389
|
-
function
|
|
400
|
+
function nr(t, e, r, a) {
|
|
390
401
|
if (!a || a.size === 0) return t;
|
|
391
|
-
const
|
|
402
|
+
const s = new Set([...a.keys()].map((c) => String(c).toUpperCase()));
|
|
392
403
|
return t.filter(
|
|
393
|
-
(
|
|
404
|
+
(c) => !(!c.to_previous && s.has(String(c.to_state).toUpperCase()) && at(c, e, r))
|
|
394
405
|
);
|
|
395
406
|
}
|
|
396
|
-
function
|
|
397
|
-
var p,
|
|
407
|
+
function rr(t, e, r) {
|
|
408
|
+
var p, S, v, M, C, E;
|
|
398
409
|
const a = [...(t == null ? void 0 : t.available_transitions) ?? [], ...(t == null ? void 0 : t.all_transitions) ?? []].find(
|
|
399
|
-
(
|
|
400
|
-
),
|
|
401
|
-
return
|
|
410
|
+
(N) => N.id === e
|
|
411
|
+
), s = r == null ? void 0 : r.data, c = ((p = s == null ? void 0 : s.new_state) == null ? void 0 : p.id) ?? ((S = s == null ? void 0 : s.instance) == null ? void 0 : S.current_state) ?? null, k = ((v = s == null ? void 0 : s.new_state) == null ? void 0 : v.label) ?? (a ? (C = (M = t == null ? void 0 : t.states) == null ? void 0 : M.find((N) => N.id === a.to_state)) == null ? void 0 : C.label : void 0) ?? null, f = ((E = t == null ? void 0 : t.instance) == null ? void 0 : E.current_state) ?? null;
|
|
412
|
+
return f && c && String(f) === String(c) ? "Nothing moved" : a != null && a.label && k ? `${a.label} — now ${k}` : k ? `Moved to ${k}` : a != null && a.label ? `${a.label} done` : "Transition executed";
|
|
402
413
|
}
|
|
403
|
-
const
|
|
404
|
-
function
|
|
414
|
+
const xa = 1200;
|
|
415
|
+
function ar(t) {
|
|
405
416
|
const e = `nvr-move-${Math.random().toString(36).slice(2)}`;
|
|
406
417
|
let r = !1;
|
|
407
418
|
const a = setTimeout(() => {
|
|
408
|
-
r = !0,
|
|
409
|
-
},
|
|
419
|
+
r = !0, X.loading(`${(t == null ? void 0 : t.trim()) || "Moving"}…`, { id: e });
|
|
420
|
+
}, xa);
|
|
410
421
|
return {
|
|
411
422
|
/** Options for the result toast: replaces the loading one when shown. */
|
|
412
423
|
done: () => (clearTimeout(a), r ? { id: e, duration: 7e3 } : {}),
|
|
413
424
|
/** An error toast of its own follows — drop the loading one. */
|
|
414
425
|
fail: () => {
|
|
415
|
-
clearTimeout(a), r &&
|
|
426
|
+
clearTimeout(a), r && X.dismiss(e);
|
|
416
427
|
}
|
|
417
428
|
};
|
|
418
429
|
}
|
|
419
|
-
function
|
|
430
|
+
function pt(t, e, r) {
|
|
420
431
|
for (const a of [
|
|
421
432
|
"pipeline-owners-resolved",
|
|
422
433
|
"pipeline-instance-owners",
|
|
423
|
-
"pipeline-all-owners"
|
|
434
|
+
"pipeline-all-owners",
|
|
435
|
+
ea
|
|
424
436
|
])
|
|
425
437
|
t.invalidateQueries({ queryKey: [a, e, r] });
|
|
426
438
|
}
|
|
427
|
-
function
|
|
428
|
-
var
|
|
439
|
+
function wa(t, e, r) {
|
|
440
|
+
var f;
|
|
429
441
|
if (!e) return null;
|
|
430
|
-
const a = new Map(r.map((p) => [String(p.id).toUpperCase(), p.sort])),
|
|
431
|
-
(p,
|
|
442
|
+
const a = new Map(r.map((p) => [String(p.id).toUpperCase(), p.sort])), s = [...t].sort(
|
|
443
|
+
(p, S) => new Date(S.timestamp).getTime() - new Date(p.timestamp).getTime()
|
|
432
444
|
)[0];
|
|
433
|
-
if (!(
|
|
434
|
-
const
|
|
435
|
-
return
|
|
445
|
+
if (!(s != null && s.from_state) || String(s.to_state).toUpperCase() !== String(e).toUpperCase() || !((f = s.comment) != null && f.trim()) || s.origin && s.origin !== "person") return null;
|
|
446
|
+
const c = a.get(String(s.from_state).toUpperCase()), k = a.get(String(s.to_state).toUpperCase());
|
|
447
|
+
return c == null || k == null || k >= c ? null : s;
|
|
436
448
|
}
|
|
437
|
-
function
|
|
449
|
+
function Te({ className: t }) {
|
|
438
450
|
return /* @__PURE__ */ n(
|
|
439
|
-
|
|
451
|
+
ln,
|
|
440
452
|
{
|
|
441
453
|
"aria-hidden": !0,
|
|
442
454
|
"data-move-blocked-mark": !0,
|
|
443
|
-
className:
|
|
455
|
+
className: le("h-3 w-3 shrink-0 text-amber-600 dark:text-amber-400", t)
|
|
444
456
|
}
|
|
445
457
|
);
|
|
446
458
|
}
|
|
447
|
-
function
|
|
459
|
+
function ze(t, e = "button") {
|
|
448
460
|
return t.advisory ? {
|
|
449
461
|
"data-move-blocked": t.advisory.code,
|
|
450
462
|
"aria-description": t.advisory.message,
|
|
451
463
|
...e === "button" ? { "data-tip": t.advisory.message } : {}
|
|
452
464
|
} : {};
|
|
453
465
|
}
|
|
454
|
-
const
|
|
455
|
-
function
|
|
466
|
+
const sr = "border-amber-300 text-slate-700 dark:border-amber-500/40 dark:text-slate-200";
|
|
467
|
+
function At({
|
|
456
468
|
moves: t,
|
|
457
469
|
nameOf: e
|
|
458
470
|
}) {
|
|
459
|
-
const r =
|
|
460
|
-
return r.map(({ advisory: a, moves:
|
|
461
|
-
/* @__PURE__ */ n(
|
|
462
|
-
/* @__PURE__ */
|
|
471
|
+
const r = Dn(t);
|
|
472
|
+
return r.map(({ advisory: a, moves: s }) => /* @__PURE__ */ i(yr, { children: [
|
|
473
|
+
/* @__PURE__ */ n($t, {}),
|
|
474
|
+
/* @__PURE__ */ i(
|
|
463
475
|
"div",
|
|
464
476
|
{
|
|
465
477
|
"data-move-blocked-note": a.code,
|
|
466
478
|
className: "flex max-w-[280px] items-start gap-2 px-2 py-1.5 text-[11px] leading-snug text-slate-600 dark:text-slate-300",
|
|
467
479
|
children: [
|
|
468
|
-
/* @__PURE__ */ n(
|
|
469
|
-
/* @__PURE__ */
|
|
480
|
+
/* @__PURE__ */ n(Te, { className: "mt-0.5" }),
|
|
481
|
+
/* @__PURE__ */ i("span", { className: "min-w-0", children: [
|
|
470
482
|
a.message,
|
|
471
|
-
r.length > 1 && /* @__PURE__ */
|
|
483
|
+
r.length > 1 && /* @__PURE__ */ i("span", { className: "mt-0.5 block text-amber-800/80 dark:text-amber-300/80", children: [
|
|
472
484
|
"Stops: ",
|
|
473
|
-
[...new Set(
|
|
485
|
+
[...new Set(s.map(e))].join(", ")
|
|
474
486
|
] })
|
|
475
487
|
] })
|
|
476
488
|
]
|
|
@@ -478,105 +490,105 @@ function Mt({
|
|
|
478
490
|
)
|
|
479
491
|
] }, `${a.code}:${a.message}`));
|
|
480
492
|
}
|
|
481
|
-
function
|
|
493
|
+
function ir(t, e, r) {
|
|
482
494
|
const a = String(t.comment_mode ?? "none");
|
|
483
|
-
return a === "optional" || a === "required" ||
|
|
495
|
+
return a === "optional" || a === "required" || Ut(t, e, r);
|
|
484
496
|
}
|
|
485
|
-
function
|
|
497
|
+
function ya({ entry: t }) {
|
|
486
498
|
const e = [t.first_name, t.last_name].filter(Boolean).join(" ") || t.user_email || "Someone";
|
|
487
|
-
return /* @__PURE__ */
|
|
499
|
+
return /* @__PURE__ */ i(
|
|
488
500
|
"div",
|
|
489
501
|
{
|
|
490
502
|
className: "flex items-start gap-2.5 border-t border-amber-200/80 bg-amber-50/70 px-4 py-2.5 dark:border-amber-500/20 dark:bg-amber-500/[0.06]",
|
|
491
503
|
"data-send-back-notice": !0,
|
|
492
504
|
children: [
|
|
493
505
|
/* @__PURE__ */ n(
|
|
494
|
-
|
|
506
|
+
hr,
|
|
495
507
|
{
|
|
496
508
|
"aria-hidden": !0,
|
|
497
509
|
className: "mt-[3px] h-3.5 w-3.5 shrink-0 text-amber-600 dark:text-amber-400"
|
|
498
510
|
}
|
|
499
511
|
),
|
|
500
|
-
/* @__PURE__ */
|
|
512
|
+
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
|
|
501
513
|
/* @__PURE__ */ n("p", { className: "whitespace-pre-line break-words text-[13px] leading-snug text-slate-800 dark:text-slate-100", children: t.comment }),
|
|
502
|
-
/* @__PURE__ */
|
|
514
|
+
/* @__PURE__ */ i("p", { className: "mt-0.5 text-[11.5px] text-amber-800/80 dark:text-amber-300/80", children: [
|
|
503
515
|
"Sent back by ",
|
|
504
|
-
|
|
516
|
+
Bt(e, t),
|
|
505
517
|
" · ",
|
|
506
|
-
|
|
518
|
+
/* @__PURE__ */ n(Dt, { value: t.timestamp })
|
|
507
519
|
] })
|
|
508
520
|
] })
|
|
509
521
|
]
|
|
510
522
|
}
|
|
511
523
|
);
|
|
512
524
|
}
|
|
513
|
-
function
|
|
525
|
+
function or({
|
|
514
526
|
collection: t,
|
|
515
527
|
item: e,
|
|
516
528
|
offer: r,
|
|
517
529
|
onFixed: a,
|
|
518
|
-
onDismiss:
|
|
519
|
-
className:
|
|
520
|
-
style:
|
|
530
|
+
onDismiss: s,
|
|
531
|
+
className: c,
|
|
532
|
+
style: k
|
|
521
533
|
}) {
|
|
522
|
-
const [
|
|
523
|
-
mutationFn: () =>
|
|
534
|
+
const [f, p] = V(""), { action: S, isLoading: v, run: M } = Jr(t, e, r.actionKey), C = Ye({
|
|
535
|
+
mutationFn: () => M(f),
|
|
524
536
|
onSuccess: () => {
|
|
525
|
-
|
|
537
|
+
X.success(`${(S == null ? void 0 : S.label) ?? "Done"} — trying again`), a();
|
|
526
538
|
},
|
|
527
|
-
onError: (
|
|
539
|
+
onError: (N) => Nr(N, `${(S == null ? void 0 : S.label) ?? "The fix"} failed`)
|
|
528
540
|
});
|
|
529
|
-
if (
|
|
530
|
-
const
|
|
531
|
-
return /* @__PURE__ */
|
|
541
|
+
if (v || !S) return null;
|
|
542
|
+
const E = !C.isPending && (!S.require_reason || f.trim().length > 0);
|
|
543
|
+
return /* @__PURE__ */ i(
|
|
532
544
|
"div",
|
|
533
545
|
{
|
|
534
|
-
className:
|
|
546
|
+
className: le(
|
|
535
547
|
"space-y-2 rounded-lg border border-amber-200 bg-amber-50 p-3 dark:border-amber-500/30 dark:bg-amber-950",
|
|
536
|
-
|
|
548
|
+
c
|
|
537
549
|
),
|
|
538
|
-
style:
|
|
550
|
+
style: k,
|
|
539
551
|
"data-refusal-fix": r.code,
|
|
540
552
|
children: [
|
|
541
|
-
/* @__PURE__ */
|
|
553
|
+
/* @__PURE__ */ i("p", { className: "text-[12px] text-amber-950 dark:text-amber-100", children: [
|
|
542
554
|
"You can fix this here: ",
|
|
543
|
-
|
|
555
|
+
S.label,
|
|
544
556
|
", then the move is tried again."
|
|
545
557
|
] }),
|
|
546
|
-
|
|
558
|
+
S.require_reason && /* @__PURE__ */ n(
|
|
547
559
|
"input",
|
|
548
560
|
{
|
|
549
561
|
type: "text",
|
|
550
|
-
value:
|
|
551
|
-
onChange: (
|
|
562
|
+
value: f,
|
|
563
|
+
onChange: (N) => p(N.target.value),
|
|
552
564
|
placeholder: "Reason (required)",
|
|
553
565
|
"aria-label": "Reason",
|
|
554
566
|
className: "w-full rounded-md border border-slate-200 bg-white px-3 py-1.5 text-[13px] placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-nvr-cyan/30 dark:border-border dark:bg-card"
|
|
555
567
|
}
|
|
556
568
|
),
|
|
557
|
-
/* @__PURE__ */
|
|
569
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-end gap-2", children: [
|
|
558
570
|
/* @__PURE__ */ n(
|
|
559
|
-
|
|
571
|
+
ge,
|
|
560
572
|
{
|
|
561
573
|
type: "button",
|
|
562
574
|
size: "sm",
|
|
563
575
|
variant: "ghost",
|
|
564
576
|
className: "h-7 text-[12px]",
|
|
565
|
-
onClick:
|
|
577
|
+
onClick: s,
|
|
566
578
|
children: "Not now"
|
|
567
579
|
}
|
|
568
580
|
),
|
|
569
|
-
/* @__PURE__ */
|
|
570
|
-
|
|
581
|
+
/* @__PURE__ */ i(
|
|
582
|
+
ge,
|
|
571
583
|
{
|
|
572
584
|
type: "button",
|
|
573
585
|
size: "sm",
|
|
574
586
|
className: "h-7 gap-1.5 text-[12px]",
|
|
575
|
-
disabled: !
|
|
576
|
-
onClick: () =>
|
|
587
|
+
disabled: !E,
|
|
588
|
+
onClick: () => C.mutate(),
|
|
577
589
|
children: [
|
|
578
|
-
|
|
579
|
-
|
|
590
|
+
C.isPending && /* @__PURE__ */ n(Me, { className: "h-3 w-3 animate-spin" }),
|
|
591
|
+
S.label,
|
|
580
592
|
", then try again"
|
|
581
593
|
]
|
|
582
594
|
}
|
|
@@ -586,94 +598,106 @@ function Jn({
|
|
|
586
598
|
}
|
|
587
599
|
);
|
|
588
600
|
}
|
|
589
|
-
function
|
|
601
|
+
function ka(t) {
|
|
602
|
+
const e = /^#?([0-9a-f]{6})$/i.exec(String(t ?? "").trim());
|
|
603
|
+
if (!e) return !0;
|
|
604
|
+
const r = Number.parseInt(e[1], 16), [a, s, c] = [r >> 16 & 255, r >> 8 & 255, r & 255];
|
|
605
|
+
return Math.max(a, s, c) - Math.min(a, s, c) < 48;
|
|
606
|
+
}
|
|
607
|
+
function Le({
|
|
590
608
|
label: t,
|
|
591
609
|
color: e,
|
|
592
610
|
small: r
|
|
593
611
|
}) {
|
|
612
|
+
const a = r ? "px-2 py-0.5 text-[11px]" : "px-2.5 py-1 text-[12px]", s = ka(e);
|
|
594
613
|
return /* @__PURE__ */ n(
|
|
595
614
|
"span",
|
|
596
615
|
{
|
|
597
|
-
className:
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
616
|
+
className: le(
|
|
617
|
+
"nvr-state-pulse inline-flex items-center gap-1.5 rounded-full border font-medium transition-colors duration-300",
|
|
618
|
+
a,
|
|
619
|
+
s && "border-slate-300 bg-slate-100 text-slate-700 dark:border-slate-500 dark:bg-slate-700/60 dark:text-slate-100"
|
|
620
|
+
),
|
|
621
|
+
style: s ? void 0 : {
|
|
622
|
+
backgroundColor: `${e}22`,
|
|
623
|
+
color: e,
|
|
624
|
+
borderColor: `${e}44`
|
|
602
625
|
},
|
|
626
|
+
"data-state-badge-tone": s ? "muted" : "colour",
|
|
603
627
|
children: t
|
|
604
628
|
},
|
|
605
629
|
t
|
|
606
630
|
);
|
|
607
631
|
}
|
|
608
|
-
function
|
|
632
|
+
function _t(t) {
|
|
609
633
|
const e = Math.floor(t / 6e4);
|
|
610
|
-
return e < 60 ? `${Math.max(1, e)}m` :
|
|
634
|
+
return e < 60 ? `${Math.max(1, e)}m` : Or(t / 36e5);
|
|
611
635
|
}
|
|
612
|
-
function
|
|
636
|
+
function _a({
|
|
613
637
|
history: t,
|
|
614
638
|
completedAt: e,
|
|
615
639
|
collection: r,
|
|
616
640
|
item: a
|
|
617
641
|
}) {
|
|
618
|
-
const
|
|
642
|
+
const s = Un(
|
|
619
643
|
r ?? "",
|
|
620
644
|
a ?? "",
|
|
621
|
-
|
|
645
|
+
lr(t, e),
|
|
622
646
|
!!r && !!a && t.length > 1
|
|
623
|
-
),
|
|
624
|
-
(
|
|
647
|
+
), c = [...t].sort(
|
|
648
|
+
(v, M) => new Date(v.timestamp).getTime() - new Date(M.timestamp).getTime()
|
|
625
649
|
);
|
|
626
|
-
if (
|
|
627
|
-
const
|
|
628
|
-
const
|
|
650
|
+
if (c.length === 0) return null;
|
|
651
|
+
const k = e ? new Date(e).getTime() : Date.now(), f = c.map((v, M) => {
|
|
652
|
+
const C = new Date(v.timestamp).getTime(), E = M + 1 < c.length ? new Date(c[M + 1].timestamp).getTime() : k;
|
|
629
653
|
return {
|
|
630
|
-
key:
|
|
631
|
-
label:
|
|
632
|
-
color:
|
|
633
|
-
ms: Math.max(0,
|
|
634
|
-
current:
|
|
635
|
-
timing: (
|
|
654
|
+
key: v.id,
|
|
655
|
+
label: v.to_state_label,
|
|
656
|
+
color: v.to_state_color,
|
|
657
|
+
ms: Math.max(0, E - C),
|
|
658
|
+
current: M === c.length - 1 && !e,
|
|
659
|
+
timing: (s == null ? void 0 : s.get(Number(v.id))) ?? null
|
|
636
660
|
};
|
|
637
|
-
}).filter((
|
|
638
|
-
if (
|
|
639
|
-
const p =
|
|
661
|
+
}).filter((v) => v.ms > 0 || v.current);
|
|
662
|
+
if (f.length < 2) return null;
|
|
663
|
+
const p = f.reduce((v, M) => v + M.ms, 0);
|
|
640
664
|
if (p <= 0) return null;
|
|
641
|
-
const
|
|
642
|
-
return /* @__PURE__ */
|
|
643
|
-
/* @__PURE__ */
|
|
665
|
+
const S = f.some((v) => v.timing);
|
|
666
|
+
return /* @__PURE__ */ i("div", { "data-state-timeline": !0, "data-step-timing": S ? "split" : void 0, children: [
|
|
667
|
+
/* @__PURE__ */ i("div", { className: "mb-1 flex items-center justify-between gap-3", children: [
|
|
644
668
|
/* @__PURE__ */ n("p", { className: "text-[10px] font-semibold uppercase tracking-wide text-slate-400 dark:text-slate-500", children: "Time in step" }),
|
|
645
|
-
/* @__PURE__ */
|
|
646
|
-
|
|
647
|
-
/* @__PURE__ */
|
|
648
|
-
|
|
669
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-3 text-[10px] tabular-nums text-slate-400 dark:text-slate-500", children: [
|
|
670
|
+
S && /* @__PURE__ */ n(ra, {}),
|
|
671
|
+
/* @__PURE__ */ i("span", { children: [
|
|
672
|
+
_t(p),
|
|
649
673
|
" total",
|
|
650
674
|
e ? "" : " · so far"
|
|
651
675
|
] })
|
|
652
676
|
] })
|
|
653
677
|
] }),
|
|
654
|
-
/* @__PURE__ */ n("div", { className: "flex h-4 w-full overflow-hidden rounded", children:
|
|
655
|
-
const
|
|
656
|
-
`${
|
|
657
|
-
|
|
658
|
-
|
|
678
|
+
/* @__PURE__ */ n("div", { className: "flex h-4 w-full overflow-hidden rounded", children: f.map((v) => {
|
|
679
|
+
const M = v.ms / p * 100, C = v.timing, E = C ? C.waiting_ms + C.working_ms : 0, N = C && E > 0 ? C.waiting_ms / E * 100 : 0, R = [
|
|
680
|
+
`${v.label} — ${_t(v.ms)}${v.current ? " (current)" : ""}`,
|
|
681
|
+
C ? En(C) : null,
|
|
682
|
+
C ? Ln(C) : null
|
|
659
683
|
].filter(Boolean).join(" · ");
|
|
660
|
-
return /* @__PURE__ */
|
|
684
|
+
return /* @__PURE__ */ i(
|
|
661
685
|
"div",
|
|
662
686
|
{
|
|
663
|
-
"data-tip":
|
|
664
|
-
"data-step-visit":
|
|
687
|
+
"data-tip": R,
|
|
688
|
+
"data-step-visit": v.key,
|
|
665
689
|
className: "relative flex min-w-[8px] items-center overflow-hidden border-r border-white/60 last:border-r-0 dark:border-black/30",
|
|
666
690
|
style: {
|
|
667
|
-
width: `${
|
|
668
|
-
backgroundColor:
|
|
691
|
+
width: `${M}%`,
|
|
692
|
+
backgroundColor: C ? void 0 : v.color ? `${v.color}55` : "rgba(100,116,139,.25)"
|
|
669
693
|
},
|
|
670
694
|
children: [
|
|
671
|
-
|
|
695
|
+
C && /* @__PURE__ */ i("span", { className: "absolute inset-0 flex", "aria-hidden": !0, children: [
|
|
672
696
|
/* @__PURE__ */ n(
|
|
673
697
|
"span",
|
|
674
698
|
{
|
|
675
699
|
className: "h-full",
|
|
676
|
-
style: { width: `${
|
|
700
|
+
style: { width: `${N}%`, background: aa(v.color) },
|
|
677
701
|
"data-step-waiting": !0
|
|
678
702
|
}
|
|
679
703
|
),
|
|
@@ -681,150 +705,156 @@ function aa({
|
|
|
681
705
|
"span",
|
|
682
706
|
{
|
|
683
707
|
className: "h-full flex-1",
|
|
684
|
-
style: { background:
|
|
708
|
+
style: { background: sa(v.color) },
|
|
685
709
|
"data-step-working": !0
|
|
686
710
|
}
|
|
687
711
|
)
|
|
688
712
|
] }),
|
|
689
|
-
|
|
690
|
-
|
|
713
|
+
M >= 14 && /* @__PURE__ */ i("span", { className: "relative truncate px-1.5 text-[9.5px] font-medium leading-none text-slate-700 dark:text-slate-200", children: [
|
|
714
|
+
v.label,
|
|
691
715
|
" · ",
|
|
692
|
-
|
|
716
|
+
_t(v.ms)
|
|
693
717
|
] }),
|
|
694
|
-
|
|
718
|
+
v.current && /* @__PURE__ */ n(
|
|
695
719
|
"span",
|
|
696
720
|
{
|
|
697
721
|
className: "absolute inset-y-0 right-0 w-[2px]",
|
|
698
|
-
style: { backgroundColor:
|
|
722
|
+
style: { backgroundColor: v.color ?? "#64748b" }
|
|
699
723
|
}
|
|
700
724
|
)
|
|
701
725
|
]
|
|
702
726
|
},
|
|
703
|
-
|
|
727
|
+
v.key
|
|
704
728
|
);
|
|
705
729
|
}) })
|
|
706
730
|
] });
|
|
707
731
|
}
|
|
708
|
-
function
|
|
709
|
-
return `${t.reduce((a,
|
|
732
|
+
function lr(t, e) {
|
|
733
|
+
return `${t.reduce((a, s) => Math.max(a, Number(s.id) || 0), 0)}:${t.length}:${e ?? ""}`;
|
|
710
734
|
}
|
|
711
|
-
function
|
|
735
|
+
function Na({
|
|
712
736
|
states: t,
|
|
713
737
|
allTransitions: e,
|
|
714
738
|
availableTransitions: r,
|
|
715
739
|
currentStateId: a,
|
|
716
|
-
history:
|
|
717
|
-
onPathIds:
|
|
718
|
-
skippedStates:
|
|
740
|
+
history: s,
|
|
741
|
+
onPathIds: c,
|
|
742
|
+
skippedStates: k,
|
|
743
|
+
travel: f
|
|
719
744
|
}) {
|
|
720
|
-
var
|
|
721
|
-
const
|
|
722
|
-
|
|
723
|
-
const g =
|
|
745
|
+
var j;
|
|
746
|
+
const p = xe(null);
|
|
747
|
+
Ee(() => {
|
|
748
|
+
const g = p.current;
|
|
724
749
|
if (!g || g.scrollWidth <= g.clientWidth) return;
|
|
725
|
-
const
|
|
726
|
-
if (!
|
|
727
|
-
const
|
|
728
|
-
g.scrollLeft +=
|
|
750
|
+
const D = g.querySelector("[data-track-current]");
|
|
751
|
+
if (!D) return;
|
|
752
|
+
const _ = g.getBoundingClientRect(), F = D.getBoundingClientRect();
|
|
753
|
+
g.scrollLeft += F.left + F.width / 2 - (_.left + _.width / 2);
|
|
729
754
|
}, [a]);
|
|
730
|
-
const
|
|
731
|
-
|
|
732
|
-
const
|
|
733
|
-
|
|
734
|
-
const
|
|
735
|
-
if (
|
|
736
|
-
return t.filter((
|
|
737
|
-
const
|
|
738
|
-
return
|
|
739
|
-
}).sort((
|
|
755
|
+
const S = new Set(s.map((g) => g.to_state)), v = t.find((g) => g.is_initial);
|
|
756
|
+
v && v.id !== a && S.add(v.id);
|
|
757
|
+
const M = (j = s[0]) == null ? void 0 : j.from_state;
|
|
758
|
+
M && M !== a && S.add(M);
|
|
759
|
+
const C = (() => {
|
|
760
|
+
if (c)
|
|
761
|
+
return t.filter((x) => c.has(x.id) || S.has(x.id) || x.id === a).filter((x) => {
|
|
762
|
+
const A = x.stage_visibility ?? "always";
|
|
763
|
+
return A === "hide" ? !1 : A === "hide_unless_active" ? S.has(x.id) || x.id === a : !0;
|
|
764
|
+
}).sort((x, A) => x.sort - A.sort);
|
|
740
765
|
if (e.length === 0) {
|
|
741
|
-
const
|
|
742
|
-
return a &&
|
|
766
|
+
const x = /* @__PURE__ */ new Set([...S]);
|
|
767
|
+
return a && x.add(a), t.filter((A) => x.has(A.id)).sort((A, re) => A.sort - re.sort);
|
|
743
768
|
}
|
|
744
769
|
const g = new Set(
|
|
745
|
-
|
|
746
|
-
),
|
|
747
|
-
for (const
|
|
748
|
-
const
|
|
749
|
-
if (
|
|
750
|
-
const
|
|
751
|
-
|
|
770
|
+
s.filter((x) => x.from_state).map((x) => `${x.from_state}:${x.to_state}`)
|
|
771
|
+
), D = new Set(s.map((x) => x.from_state).filter(Boolean)), _ = e.filter((x) => x.from_state !== null), F = /* @__PURE__ */ new Map();
|
|
772
|
+
for (const x of _) {
|
|
773
|
+
const A = x.from_state;
|
|
774
|
+
if (D.has(A) && !g.has(`${A}:${x.to_state}`)) continue;
|
|
775
|
+
const re = F.get(A) ?? [];
|
|
776
|
+
re.push(x.to_state), F.set(A, re);
|
|
752
777
|
}
|
|
753
778
|
if (a) {
|
|
754
|
-
const
|
|
755
|
-
|
|
756
|
-
.../* @__PURE__ */ new Set([...r.map((
|
|
779
|
+
const x = _.filter((A) => A.from_state === a).map((A) => A.to_state);
|
|
780
|
+
F.set(a, [
|
|
781
|
+
.../* @__PURE__ */ new Set([...r.map((A) => A.to_state), ...x])
|
|
757
782
|
]);
|
|
758
783
|
}
|
|
759
|
-
const
|
|
760
|
-
for (;
|
|
761
|
-
const
|
|
762
|
-
if (
|
|
763
|
-
|
|
764
|
-
for (const
|
|
784
|
+
const $ = /* @__PURE__ */ new Set(), K = t.filter((x) => x.is_initial).map((x) => x.id);
|
|
785
|
+
for (; K.length; ) {
|
|
786
|
+
const x = K.shift();
|
|
787
|
+
if (!$.has(x)) {
|
|
788
|
+
$.add(x);
|
|
789
|
+
for (const A of F.get(x) ?? []) $.has(A) || K.push(A);
|
|
765
790
|
}
|
|
766
791
|
}
|
|
767
|
-
const
|
|
768
|
-
return a &&
|
|
769
|
-
const
|
|
770
|
-
return
|
|
771
|
-
}).sort((
|
|
792
|
+
const T = /* @__PURE__ */ new Set([...$, ...S]);
|
|
793
|
+
return a && T.add(a), t.filter((x) => T.has(x.id)).filter((x) => {
|
|
794
|
+
const A = x.stage_visibility ?? "always";
|
|
795
|
+
return A === "hide" ? !1 : A === "hide_unless_active" ? S.has(x.id) || x.id === a : !0;
|
|
796
|
+
}).sort((x, A) => x.sort - A.sort);
|
|
772
797
|
})();
|
|
773
|
-
if (
|
|
774
|
-
const
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
798
|
+
if (C.length < 2) return null;
|
|
799
|
+
const E = C.findIndex((g) => g.id === a), N = Pr(
|
|
800
|
+
C.map((g) => g.id),
|
|
801
|
+
f ?? null
|
|
802
|
+
), R = new Map(C.map((g, D) => [g.id, D])), ne = new Map(t.map((g) => [g.id, g.label]));
|
|
803
|
+
function ie(g, D) {
|
|
804
|
+
const _ = R.get(g);
|
|
805
|
+
return _ == null ? [] : [...s].filter((F) => {
|
|
806
|
+
if (!F.from_state) return !1;
|
|
807
|
+
const $ = R.get(F.from_state), K = R.get(F.to_state);
|
|
808
|
+
return $ == null || K == null ? !1 : $ === _ && K > _ || K < $ && $ - 1 === _;
|
|
809
|
+
}).sort((F, $) => new Date(F.timestamp).getTime() - new Date($.timestamp).getTime());
|
|
782
810
|
}
|
|
783
|
-
function
|
|
784
|
-
var
|
|
785
|
-
return
|
|
811
|
+
function me(g) {
|
|
812
|
+
var D, _, F, $;
|
|
813
|
+
return ct(g) ? /* @__PURE__ */ n(un, { className: "inline h-2.5 w-2.5", "aria-label": Rt(g) }) : ((((D = g.first_name) == null ? void 0 : D[0]) ?? "") + (((_ = g.last_name) == null ? void 0 : _[0]) ?? "")).toUpperCase() || (($ = (F = g.user_email) == null ? void 0 : F[0]) == null ? void 0 : $.toUpperCase()) || "?";
|
|
786
814
|
}
|
|
787
|
-
function
|
|
788
|
-
return
|
|
815
|
+
function de(g) {
|
|
816
|
+
return Bt([g.first_name, g.last_name].filter(Boolean).join(" ") || g.user_email, g);
|
|
789
817
|
}
|
|
790
|
-
const
|
|
791
|
-
for (const g of [...
|
|
792
|
-
(
|
|
818
|
+
const oe = /* @__PURE__ */ new Map();
|
|
819
|
+
for (const g of [...s].sort(
|
|
820
|
+
(D, _) => new Date(D.timestamp).getTime() - new Date(_.timestamp).getTime()
|
|
793
821
|
)) {
|
|
794
822
|
if (!g.from_state) continue;
|
|
795
|
-
const
|
|
796
|
-
if (!(
|
|
797
|
-
for (let
|
|
798
|
-
const
|
|
799
|
-
!
|
|
823
|
+
const D = R.get(g.from_state), _ = R.get(g.to_state);
|
|
824
|
+
if (!(D == null || _ == null || _ <= D + 1))
|
|
825
|
+
for (let F = D + 1; F < _; F++) {
|
|
826
|
+
const $ = C[F].id;
|
|
827
|
+
!S.has($) && !oe.has($) && oe.set($, g);
|
|
800
828
|
}
|
|
801
829
|
}
|
|
802
|
-
function
|
|
803
|
-
const
|
|
804
|
-
return `Passed over on ${
|
|
830
|
+
function H(g) {
|
|
831
|
+
const D = ne.get(g.from_state ?? "") ?? "the previous step", _ = ne.get(g.to_state) ?? "the next step", F = ct(g) ? "it moved automatically" : `${de(g)} moved it`;
|
|
832
|
+
return `Passed over on ${Yt(g.timestamp)} — ${F} straight from ${D} to ${_}`;
|
|
805
833
|
}
|
|
806
|
-
return /* @__PURE__ */ n(
|
|
807
|
-
const
|
|
808
|
-
return /* @__PURE__ */
|
|
809
|
-
/* @__PURE__ */
|
|
834
|
+
return /* @__PURE__ */ n(Nn, { delayDuration: 200, children: /* @__PURE__ */ n("div", { ref: p, className: "overflow-x-auto pt-1.5 pb-1", "data-state-track": !0, children: /* @__PURE__ */ n("div", { className: "flex w-full items-start", children: C.map((g, D) => {
|
|
835
|
+
const _ = g.id === a, F = S.has(g.id), $ = F && !_ && (E < 0 || D < E), K = F && !_ && !$, T = !F && !_ ? oe.get(g.id) : void 0, x = !F && !_ ? k == null ? void 0 : k.get(g.id) : void 0, A = T || x ? [...T ? [H(T)] : [], ...x ?? []] : void 0, re = A !== void 0, m = g.color ?? "#94a3b8", J = D === C.length - 1, Y = J ? null : C[D + 1], Ne = Y ? ie(g.id, Y.id) : [];
|
|
836
|
+
return /* @__PURE__ */ i("div", { className: "flex flex-1 items-start", children: [
|
|
837
|
+
/* @__PURE__ */ i("div", { className: "flex min-w-[76px] flex-1 flex-col items-center gap-1.5 px-1", children: [
|
|
810
838
|
/* @__PURE__ */ n(
|
|
811
839
|
"div",
|
|
812
840
|
{
|
|
813
|
-
"data-track-current":
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
"data-
|
|
841
|
+
"data-track-current": _ || void 0,
|
|
842
|
+
"data-track-arrive": N && N.arriveIndex === D ? "" : void 0,
|
|
843
|
+
className: `flex h-7 w-7 shrink-0 items-center justify-center rounded-full ${_ || $ ? "nvr-fill-sweep" : ""} ${N && N.arriveIndex === D ? "nvr-track-arrive" : ""}`,
|
|
844
|
+
"data-tip": K ? `Passed before the record was sent back — it needs this step again.${g.description ? ` ${g.description}` : ""}` : g.description || void 0,
|
|
845
|
+
"data-track-again": K || void 0,
|
|
817
846
|
style: {
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
847
|
+
...N && N.arriveIndex === D ? { "--nvr-track-arrive": `${N.arriveDelay}ms` } : null,
|
|
848
|
+
backgroundColor: _ || $ ? m : re ? "transparent" : "#f1f5f9",
|
|
849
|
+
border: _ || $ ? "none" : re ? "1.5px dashed #cbd5e1" : "1.5px solid #e2e8f0",
|
|
850
|
+
boxShadow: _ ? `0 0 0 3px white, 0 0 0 5px ${m}` : void 0
|
|
821
851
|
},
|
|
822
|
-
children:
|
|
852
|
+
children: $ ? /* @__PURE__ */ n(ft, { className: "h-3.5 w-3.5 text-white", strokeWidth: 2.5 }) : _ ? /* @__PURE__ */ n("div", { className: "h-2.5 w-2.5 rounded-full bg-white/80" }) : re ? /* @__PURE__ */ n(gr, { className: "h-3 w-3 text-slate-400", strokeWidth: 2.5 }) : /* @__PURE__ */ n("div", { className: "h-2 w-2 rounded-full bg-slate-300" })
|
|
823
853
|
},
|
|
824
|
-
|
|
854
|
+
`${_ ? "cur" : $ ? "done" : re ? "skip" : "todo"}${N && N.arriveIndex === D ? `:t${f == null ? void 0 : f.n}` : ""}`
|
|
825
855
|
),
|
|
826
|
-
|
|
827
|
-
/* @__PURE__ */ n(
|
|
856
|
+
re ? /* @__PURE__ */ i(Tt, { children: [
|
|
857
|
+
/* @__PURE__ */ n(Mt, { asChild: !0, children: /* @__PURE__ */ n(
|
|
828
858
|
"span",
|
|
829
859
|
{
|
|
830
860
|
className: "w-full cursor-help break-words text-center leading-snug",
|
|
@@ -839,37 +869,49 @@ function sa({
|
|
|
839
869
|
children: g.label
|
|
840
870
|
}
|
|
841
871
|
) }),
|
|
842
|
-
/* @__PURE__ */
|
|
872
|
+
/* @__PURE__ */ i(qt, { className: "max-w-[260px]", children: [
|
|
843
873
|
/* @__PURE__ */ n("p", { className: "text-[11px] font-medium", children: "Skipped for this record" }),
|
|
844
|
-
|
|
874
|
+
A.length > 0 ? /* @__PURE__ */ n("ul", { className: "mt-1 space-y-0.5 text-[11px] opacity-90", children: A.map((U) => /* @__PURE__ */ n("li", { children: U }, U)) }) : /* @__PURE__ */ n("p", { className: "mt-1 text-[11px] opacity-90", children: "Its skip conditions are met." })
|
|
845
875
|
] })
|
|
846
876
|
] }) : /* @__PURE__ */ n(
|
|
847
877
|
"span",
|
|
848
878
|
{
|
|
849
|
-
className:
|
|
879
|
+
className: le(
|
|
850
880
|
"w-full break-words text-center leading-snug",
|
|
851
|
-
!
|
|
881
|
+
!_ && !$ && "text-slate-500 dark:text-slate-400"
|
|
852
882
|
),
|
|
853
883
|
style: {
|
|
854
884
|
fontSize: "11px",
|
|
855
|
-
color:
|
|
856
|
-
fontWeight:
|
|
885
|
+
color: _ ? m : $ ? "#475569" : void 0,
|
|
886
|
+
fontWeight: _ ? 600 : $ ? 500 : 400,
|
|
857
887
|
wordBreak: "break-word"
|
|
858
888
|
},
|
|
859
889
|
children: g.label
|
|
860
890
|
}
|
|
861
891
|
)
|
|
862
892
|
] }),
|
|
863
|
-
!
|
|
893
|
+
!J && /* @__PURE__ */ i("div", { className: "mt-[13px] flex w-10 shrink-0 flex-col items-center gap-1.5", children: [
|
|
864
894
|
(() => {
|
|
865
|
-
const U =
|
|
866
|
-
return /* @__PURE__ */
|
|
895
|
+
const U = $ ? `${m}55` : "#e8ecf0", ae = N == null ? void 0 : N.segments.get(D);
|
|
896
|
+
return /* @__PURE__ */ i("div", { className: "flex w-full shrink-0 items-center", children: [
|
|
867
897
|
/* @__PURE__ */ n(
|
|
868
898
|
"div",
|
|
869
899
|
{
|
|
870
|
-
className:
|
|
871
|
-
|
|
872
|
-
|
|
900
|
+
className: le(
|
|
901
|
+
"h-0.5 flex-1 rounded-l-sm",
|
|
902
|
+
ae != null && "nvr-track-travel"
|
|
903
|
+
),
|
|
904
|
+
"data-track-travel": ae != null ? "" : void 0,
|
|
905
|
+
style: {
|
|
906
|
+
backgroundColor: U,
|
|
907
|
+
...ae != null && N ? {
|
|
908
|
+
"--nvr-track-seg": `${N.seg}ms`,
|
|
909
|
+
animationDelay: `${ae}ms`,
|
|
910
|
+
transformOrigin: N.backward ? "right" : "left"
|
|
911
|
+
} : null
|
|
912
|
+
}
|
|
913
|
+
},
|
|
914
|
+
ae != null ? `t${f == null ? void 0 : f.n}` : "line"
|
|
873
915
|
),
|
|
874
916
|
/* @__PURE__ */ n(
|
|
875
917
|
"div",
|
|
@@ -885,42 +927,42 @@ function sa({
|
|
|
885
927
|
)
|
|
886
928
|
] });
|
|
887
929
|
})(),
|
|
888
|
-
|
|
889
|
-
const
|
|
890
|
-
(
|
|
891
|
-
) > 1 ?
|
|
892
|
-
return /* @__PURE__ */
|
|
893
|
-
/* @__PURE__ */ n(
|
|
894
|
-
/* @__PURE__ */
|
|
930
|
+
Ne.map((U) => {
|
|
931
|
+
const ae = U.from_state !== g.id, Se = Math.abs(
|
|
932
|
+
(R.get(U.to_state) ?? 0) - (R.get(U.from_state ?? "") ?? 0)
|
|
933
|
+
) > 1 ? ne.get(U.to_state) ?? "" : null;
|
|
934
|
+
return /* @__PURE__ */ i(Tt, { children: [
|
|
935
|
+
/* @__PURE__ */ n(Mt, { asChild: !0, children: /* @__PURE__ */ i("div", { className: "flex w-full cursor-default flex-col items-center gap-0.5", children: [
|
|
936
|
+
/* @__PURE__ */ i(
|
|
895
937
|
"span",
|
|
896
938
|
{
|
|
897
939
|
className: "text-center font-mono text-[9px] font-semibold leading-none",
|
|
898
|
-
style: { color:
|
|
940
|
+
style: { color: ae ? "#d97706" : "#475569" },
|
|
899
941
|
children: [
|
|
900
|
-
|
|
901
|
-
|
|
942
|
+
ae && "↩ ",
|
|
943
|
+
me(U)
|
|
902
944
|
]
|
|
903
945
|
}
|
|
904
946
|
),
|
|
905
|
-
/* @__PURE__ */ n("span", { className: "text-[8.5px] leading-none text-slate-400", children:
|
|
947
|
+
/* @__PURE__ */ n("span", { className: "text-[8.5px] leading-none text-slate-400", children: /* @__PURE__ */ n(Dt, { value: U.timestamp }) })
|
|
906
948
|
] }) }),
|
|
907
|
-
/* @__PURE__ */
|
|
908
|
-
|
|
909
|
-
/* @__PURE__ */
|
|
910
|
-
|
|
911
|
-
|
|
949
|
+
/* @__PURE__ */ i(qt, { side: "top", className: "space-y-0.5 text-[12px]", children: [
|
|
950
|
+
ct(U) ? /* @__PURE__ */ i(_e, { children: [
|
|
951
|
+
/* @__PURE__ */ i("p", { className: "font-medium", children: [
|
|
952
|
+
ae ? "↩ Sent back · " : "",
|
|
953
|
+
Rt(U)
|
|
912
954
|
] }),
|
|
913
|
-
|
|
914
|
-
] }) : /* @__PURE__ */
|
|
915
|
-
|
|
955
|
+
Ft(U) && /* @__PURE__ */ n("p", { className: "max-w-[280px] text-muted-foreground", children: Ft(U) })
|
|
956
|
+
] }) : /* @__PURE__ */ i("p", { className: "font-medium", children: [
|
|
957
|
+
ae ? "↩ Sent back by" : "Approved by",
|
|
916
958
|
" ",
|
|
917
|
-
|
|
959
|
+
de(U)
|
|
918
960
|
] }),
|
|
919
|
-
|
|
961
|
+
Se && /* @__PURE__ */ i("p", { className: "text-muted-foreground", children: [
|
|
920
962
|
"→ straight to ",
|
|
921
|
-
|
|
963
|
+
Se
|
|
922
964
|
] }),
|
|
923
|
-
/* @__PURE__ */ n("p", { className: "text-muted-foreground", children:
|
|
965
|
+
/* @__PURE__ */ n("p", { className: "text-muted-foreground", children: Yt(U.timestamp) })
|
|
924
966
|
] })
|
|
925
967
|
] }, U.id);
|
|
926
968
|
})
|
|
@@ -928,75 +970,75 @@ function sa({
|
|
|
928
970
|
] }, g.id);
|
|
929
971
|
}) }) }) });
|
|
930
972
|
}
|
|
931
|
-
function
|
|
973
|
+
function Sa({
|
|
932
974
|
history: t,
|
|
933
975
|
collection: e,
|
|
934
976
|
item: r,
|
|
935
977
|
completedAt: a = null
|
|
936
978
|
}) {
|
|
937
|
-
const
|
|
979
|
+
const s = Un(
|
|
938
980
|
e ?? "",
|
|
939
981
|
r ?? "",
|
|
940
|
-
|
|
982
|
+
lr(t, a),
|
|
941
983
|
!!e && !!r && t.length > 0
|
|
942
984
|
);
|
|
943
|
-
return t.length === 0 ? /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400 italic", children: "No transitions yet." }) : /* @__PURE__ */ n("div", { className: "space-y-3", children: t.map((
|
|
944
|
-
var
|
|
945
|
-
const
|
|
946
|
-
return /* @__PURE__ */
|
|
985
|
+
return t.length === 0 ? /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400 italic", children: "No transitions yet." }) : /* @__PURE__ */ n("div", { className: "space-y-3", children: t.map((c) => {
|
|
986
|
+
var C;
|
|
987
|
+
const k = ct(c), f = k ? Rt(c) : Bt([c.first_name, c.last_name].filter(Boolean).join(" ") || c.user_email, c), p = da(c), S = c.comment && !k && !p ? c.comment : null, v = p ?? (k ? Ft(c) : null), M = (s == null ? void 0 : s.get(Number(c.id))) ?? null;
|
|
988
|
+
return /* @__PURE__ */ i("div", { className: "flex items-start gap-2.5 text-[12px]", children: [
|
|
947
989
|
/* @__PURE__ */ n("div", { className: "mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-slate-200" }),
|
|
948
|
-
/* @__PURE__ */
|
|
949
|
-
/* @__PURE__ */
|
|
950
|
-
|
|
951
|
-
/* @__PURE__ */ n(
|
|
952
|
-
/* @__PURE__ */ n(
|
|
990
|
+
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
991
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-1.5 flex-wrap", children: [
|
|
992
|
+
c.from_state_label ? /* @__PURE__ */ n(Le, { label: c.from_state_label, color: c.from_state_color, small: !0 }) : /* @__PURE__ */ n("span", { className: "text-[11px] text-slate-400 italic", children: "started" }),
|
|
993
|
+
/* @__PURE__ */ n(Ot, { className: "h-3 w-3 shrink-0 text-slate-300" }),
|
|
994
|
+
/* @__PURE__ */ n(Le, { label: c.to_state_label, color: c.to_state_color, small: !0 })
|
|
953
995
|
] }),
|
|
954
|
-
|
|
996
|
+
S && /* @__PURE__ */ i("p", { className: "mt-1 text-slate-500 italic", children: [
|
|
955
997
|
'"',
|
|
956
|
-
|
|
998
|
+
S,
|
|
957
999
|
'"'
|
|
958
1000
|
] }),
|
|
959
|
-
/* @__PURE__ */
|
|
1001
|
+
/* @__PURE__ */ i(
|
|
960
1002
|
"p",
|
|
961
1003
|
{
|
|
962
1004
|
className: "mt-0.5 text-slate-400",
|
|
963
|
-
"data-history-on-behalf":
|
|
964
|
-
"data-history-acting-admin": ((
|
|
1005
|
+
"data-history-on-behalf": c.on_behalf_of_name ? c.on_behalf_of ?? "" : void 0,
|
|
1006
|
+
"data-history-acting-admin": ((C = c.acting_admin) == null ? void 0 : C.id) || void 0,
|
|
965
1007
|
children: [
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
1008
|
+
k && /* @__PURE__ */ n(un, { className: "mr-1 inline h-3 w-3", "aria-hidden": !0 }),
|
|
1009
|
+
f,
|
|
1010
|
+
v ? ` · ${v}` : "",
|
|
969
1011
|
" · ",
|
|
970
|
-
|
|
1012
|
+
/* @__PURE__ */ n(Dt, { value: c.timestamp })
|
|
971
1013
|
]
|
|
972
1014
|
}
|
|
973
1015
|
),
|
|
974
|
-
|
|
1016
|
+
M && /* @__PURE__ */ i(
|
|
975
1017
|
"p",
|
|
976
1018
|
{
|
|
977
1019
|
className: "mt-0.5 flex items-center gap-1 text-[11px] text-slate-500 dark:text-slate-400",
|
|
978
|
-
"data-history-timing":
|
|
979
|
-
"data-tip":
|
|
1020
|
+
"data-history-timing": c.id,
|
|
1021
|
+
"data-tip": Ln(M) ?? void 0,
|
|
980
1022
|
children: [
|
|
981
|
-
/* @__PURE__ */ n(
|
|
1023
|
+
/* @__PURE__ */ n(xr, { className: "h-3 w-3 shrink-0 text-slate-400", "aria-hidden": !0 }),
|
|
982
1024
|
"In ",
|
|
983
|
-
|
|
1025
|
+
c.to_state_label,
|
|
984
1026
|
": ",
|
|
985
|
-
|
|
1027
|
+
En(M)
|
|
986
1028
|
]
|
|
987
1029
|
}
|
|
988
1030
|
)
|
|
989
1031
|
] })
|
|
990
|
-
] },
|
|
1032
|
+
] }, c.id);
|
|
991
1033
|
}) });
|
|
992
1034
|
}
|
|
993
|
-
function
|
|
1035
|
+
function on({
|
|
994
1036
|
userId: t,
|
|
995
1037
|
name: e,
|
|
996
1038
|
email: r,
|
|
997
1039
|
initials: a
|
|
998
1040
|
}) {
|
|
999
|
-
return /* @__PURE__ */ n(
|
|
1041
|
+
return /* @__PURE__ */ n(wn, { userId: t, children: /* @__PURE__ */ i(
|
|
1000
1042
|
"button",
|
|
1001
1043
|
{
|
|
1002
1044
|
type: "button",
|
|
@@ -1004,7 +1046,7 @@ function en({
|
|
|
1004
1046
|
className: "group/owner flex min-w-0 flex-1 items-center gap-2.5 rounded-md text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan",
|
|
1005
1047
|
children: [
|
|
1006
1048
|
/* @__PURE__ */ n(
|
|
1007
|
-
|
|
1049
|
+
Ir,
|
|
1008
1050
|
{
|
|
1009
1051
|
userId: t,
|
|
1010
1052
|
alt: e,
|
|
@@ -1012,7 +1054,7 @@ function en({
|
|
|
1012
1054
|
fallback: /* @__PURE__ */ n("span", { className: "flex h-6 w-6 shrink-0 select-none items-center justify-center rounded-full bg-nvr-cyan/10 text-[10px] font-semibold text-nvr-navy/80 dark:bg-nvr-cyan/15 dark:text-nvr-cyan", children: a })
|
|
1013
1055
|
}
|
|
1014
1056
|
),
|
|
1015
|
-
/* @__PURE__ */
|
|
1057
|
+
/* @__PURE__ */ i("span", { className: "min-w-0 flex-1", children: [
|
|
1016
1058
|
/* @__PURE__ */ n("span", { className: "block truncate text-[12px] font-medium text-slate-700 underline-offset-2 group-hover/owner:underline dark:text-slate-200", children: e }),
|
|
1017
1059
|
/* @__PURE__ */ n("span", { className: "block truncate text-[11px] text-slate-400 dark:text-slate-500", children: r })
|
|
1018
1060
|
] })
|
|
@@ -1020,321 +1062,333 @@ function en({
|
|
|
1020
1062
|
}
|
|
1021
1063
|
) });
|
|
1022
1064
|
}
|
|
1023
|
-
function
|
|
1065
|
+
function Ca({
|
|
1024
1066
|
collection: t,
|
|
1025
1067
|
item: e,
|
|
1026
1068
|
states: r,
|
|
1027
1069
|
currentStateId: a,
|
|
1028
|
-
returned:
|
|
1029
|
-
standInReason:
|
|
1070
|
+
returned: s = !1,
|
|
1071
|
+
standInReason: c = null
|
|
1030
1072
|
}) {
|
|
1031
|
-
var
|
|
1032
|
-
const
|
|
1033
|
-
|
|
1034
|
-
).then((
|
|
1035
|
-
var
|
|
1036
|
-
return
|
|
1037
|
-
}), { data:
|
|
1038
|
-
queryKey:
|
|
1039
|
-
queryFn: () =>
|
|
1040
|
-
}), { data:
|
|
1041
|
-
queryKey:
|
|
1042
|
-
queryFn: () =>
|
|
1043
|
-
var
|
|
1044
|
-
return ((
|
|
1073
|
+
var Ke, Re, pe, Oe, Ce;
|
|
1074
|
+
const k = je(), f = Je(), { isAdmin: p, userId: S } = fn(), [v, M] = V(!1), [C, E] = V(""), [N, R] = V(""), [ne, ie] = V(!1), me = ["pipeline-instance-owners", t, e], de = ["pipeline-owners-can-add", t, e], oe = () => k.request(
|
|
1075
|
+
qe(`/pipelines/instance/${t}/${e}/owners`)
|
|
1076
|
+
).then((d) => {
|
|
1077
|
+
var L;
|
|
1078
|
+
return f.setQueryData(de, ((L = d.meta) == null ? void 0 : L.can_add) ?? null), d;
|
|
1079
|
+
}), { data: H, isLoading: j } = ke({
|
|
1080
|
+
queryKey: me,
|
|
1081
|
+
queryFn: () => oe().then((d) => d.data)
|
|
1082
|
+
}), { data: g } = ke({
|
|
1083
|
+
queryKey: de,
|
|
1084
|
+
queryFn: () => oe().then((d) => {
|
|
1085
|
+
var L;
|
|
1086
|
+
return ((L = d.meta) == null ? void 0 : L.can_add) ?? null;
|
|
1045
1087
|
}),
|
|
1046
|
-
enabled: !
|
|
1088
|
+
enabled: !j,
|
|
1047
1089
|
staleTime: 3e4
|
|
1048
|
-
}),
|
|
1090
|
+
}), D = typeof g == "boolean" ? g : p, { data: _, isLoading: F } = ke({
|
|
1049
1091
|
queryKey: ["pipeline-all-owners", t, e],
|
|
1050
|
-
queryFn: () =>
|
|
1051
|
-
|
|
1052
|
-
).then((
|
|
1092
|
+
queryFn: () => k.request(
|
|
1093
|
+
qe(`/pipelines/instance/${t}/${e}/owners/all`)
|
|
1094
|
+
).then((d) => d.data ?? null),
|
|
1053
1095
|
enabled: !!a,
|
|
1054
1096
|
staleTime: 3e4
|
|
1055
|
-
}),
|
|
1056
|
-
(a ? ((
|
|
1057
|
-
String(
|
|
1058
|
-
|
|
1097
|
+
}), $ = new Set((H ?? []).map((d) => d.user)), K = a ? (((Ke = _ == null ? void 0 : _[a]) == null ? void 0 : Ke.owners) ?? []).filter((d) => !$.has(d.id)) : [], T = new Map(
|
|
1098
|
+
(a ? ((Re = _ == null ? void 0 : _[a]) == null ? void 0 : Re.unavailable) ?? [] : []).map((d) => [
|
|
1099
|
+
String(d.id).toUpperCase(),
|
|
1100
|
+
d
|
|
1059
1101
|
])
|
|
1060
|
-
),
|
|
1102
|
+
), x = K.length + ((H == null ? void 0 : H.length) ?? 0), A = !!((pe = r.find((d) => d.id === a)) != null && pe.is_initial), re = !j && !F, { data: m } = ke({
|
|
1061
1103
|
queryKey: ["pipeline-record-creator", t, e],
|
|
1062
|
-
queryFn: () =>
|
|
1063
|
-
|
|
1064
|
-
).then((
|
|
1065
|
-
enabled:
|
|
1104
|
+
queryFn: () => k.request(
|
|
1105
|
+
qe(`/pipelines/instance/${t}/${e}/creator`)
|
|
1106
|
+
).then((d) => d.data ?? null),
|
|
1107
|
+
enabled: A && re && x === 0,
|
|
1066
1108
|
staleTime: 6e4
|
|
1067
|
-
}),
|
|
1068
|
-
(
|
|
1069
|
-
),
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1109
|
+
}), J = A && x === 0 && (m != null && m.name) ? m : null, Y = r.find((d) => d.id === a), Ne = (H ?? []).some(
|
|
1110
|
+
(d) => !d.state || d.state === a || d.state === (Y == null ? void 0 : Y.key)
|
|
1111
|
+
), U = !!Y && K.length > 0 && K.every((d) => d.queue_only) && !Ne, ae = c && c.state.id.toUpperCase() === String(a).toUpperCase() ? c : null, Se = oa(ae), Z = !!S && [
|
|
1112
|
+
...a ? (((Oe = _ == null ? void 0 : _[a]) == null ? void 0 : Oe.owners) ?? []).map((d) => d.id) : [],
|
|
1113
|
+
...(H ?? []).filter((d) => !d.state || d.state === a || d.state === (Y == null ? void 0 : Y.key)).map((d) => d.user)
|
|
1114
|
+
].some((d) => String(d).toUpperCase() === S.toUpperCase()), Pe = !!a && re && x > 0 && !J && !(Y != null && Y.is_terminal) && !Z, ue = () => {
|
|
1115
|
+
f.invalidateQueries({ queryKey: me }), f.invalidateQueries({ queryKey: ["pipeline-instance", t, e] });
|
|
1116
|
+
}, ce = Ye({
|
|
1117
|
+
mutationFn: () => k.request(
|
|
1118
|
+
rt(`/pipelines/instance/${t}/${e}/owners`, {
|
|
1119
|
+
user: C,
|
|
1120
|
+
state: N || void 0
|
|
1076
1121
|
})
|
|
1077
1122
|
),
|
|
1078
1123
|
onSuccess: () => {
|
|
1079
|
-
|
|
1124
|
+
ue(), E(""), R(""), M(!1), X.success("Owner added");
|
|
1080
1125
|
},
|
|
1081
1126
|
// The server's reason (a 403 says why), not a bare status phrase.
|
|
1082
|
-
onError: (
|
|
1083
|
-
}),
|
|
1084
|
-
mutationFn: (
|
|
1085
|
-
onSuccess: (
|
|
1086
|
-
|
|
1087
|
-
const
|
|
1088
|
-
|
|
1127
|
+
onError: (d) => X.error(Ie(d, "Failed to add owner"))
|
|
1128
|
+
}), ee = Ye({
|
|
1129
|
+
mutationFn: (d) => k.request(_r(`/pipelines/instance-owners/${d.id}`)),
|
|
1130
|
+
onSuccess: (d, L) => {
|
|
1131
|
+
ue();
|
|
1132
|
+
const G = [L.first_name, L.last_name].filter(Boolean).join(" ") || L.email;
|
|
1133
|
+
X.success(`${G} removed as an owner`, {
|
|
1089
1134
|
action: {
|
|
1090
1135
|
label: "Undo",
|
|
1091
|
-
onClick: () => void
|
|
1092
|
-
|
|
1093
|
-
user:
|
|
1094
|
-
state:
|
|
1136
|
+
onClick: () => void k.request(
|
|
1137
|
+
rt(`/pipelines/instance/${t}/${e}/owners`, {
|
|
1138
|
+
user: L.user,
|
|
1139
|
+
state: L.state || void 0
|
|
1095
1140
|
})
|
|
1096
|
-
).then(() =>
|
|
1141
|
+
).then(() => ue()).catch((l) => X.error(Ie(l, "Could not add the owner back")))
|
|
1097
1142
|
}
|
|
1098
1143
|
});
|
|
1099
1144
|
},
|
|
1100
|
-
onError: (
|
|
1101
|
-
}),
|
|
1102
|
-
var
|
|
1103
|
-
const
|
|
1104
|
-
return (`${
|
|
1105
|
-
}, o = (
|
|
1106
|
-
var
|
|
1107
|
-
return
|
|
1145
|
+
onError: (d) => X.error(Ie(d, "Failed to remove owner"))
|
|
1146
|
+
}), ye = (d) => {
|
|
1147
|
+
var l, h;
|
|
1148
|
+
const L = ((l = d.first_name) == null ? void 0 : l[0]) ?? "", G = ((h = d.last_name) == null ? void 0 : h[0]) ?? "";
|
|
1149
|
+
return (`${L}${G}`.trim() || d.email[0] || "?").toUpperCase();
|
|
1150
|
+
}, o = (d) => {
|
|
1151
|
+
var L;
|
|
1152
|
+
return d ? ((L = r.find((G) => G.id === d || G.key === d)) == null ? void 0 : L.label) ?? d : null;
|
|
1108
1153
|
};
|
|
1109
|
-
return /* @__PURE__ */
|
|
1110
|
-
/* @__PURE__ */
|
|
1111
|
-
/* @__PURE__ */
|
|
1112
|
-
/* @__PURE__ */ n(
|
|
1154
|
+
return /* @__PURE__ */ i("div", { children: [
|
|
1155
|
+
/* @__PURE__ */ i("div", { className: "mb-3 flex items-center justify-between", children: [
|
|
1156
|
+
/* @__PURE__ */ i("span", { className: "flex items-center gap-1.5 text-[11px] font-medium text-slate-400", children: [
|
|
1157
|
+
/* @__PURE__ */ n(cn, { className: "h-3.5 w-3.5" }),
|
|
1113
1158
|
"Owners",
|
|
1114
|
-
|
|
1159
|
+
j || F ? /* @__PURE__ */ n("span", { className: "inline-block h-3 w-4 animate-pulse rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : J ? null : /* @__PURE__ */ i("span", { className: "text-slate-300", children: [
|
|
1115
1160
|
"(",
|
|
1116
|
-
|
|
1161
|
+
x,
|
|
1117
1162
|
")"
|
|
1118
1163
|
] })
|
|
1119
1164
|
] }),
|
|
1120
|
-
/* @__PURE__ */
|
|
1121
|
-
a && /* @__PURE__ */ n(
|
|
1122
|
-
!
|
|
1165
|
+
/* @__PURE__ */ i("span", { className: "flex items-center gap-3", children: [
|
|
1166
|
+
a && /* @__PURE__ */ n(Kr, { collection: t, itemId: String(e) }),
|
|
1167
|
+
!v && D && /* @__PURE__ */ i(
|
|
1123
1168
|
"button",
|
|
1124
1169
|
{
|
|
1125
1170
|
type: "button",
|
|
1126
|
-
onClick: () =>
|
|
1171
|
+
onClick: () => M(!0),
|
|
1127
1172
|
className: "flex items-center gap-1 text-[11px] text-slate-400 transition-colors hover:text-nvr-cyan",
|
|
1128
1173
|
children: [
|
|
1129
|
-
/* @__PURE__ */ n(
|
|
1174
|
+
/* @__PURE__ */ n(br, { className: "h-3 w-3" }),
|
|
1130
1175
|
"Add"
|
|
1131
1176
|
]
|
|
1132
1177
|
}
|
|
1133
1178
|
)
|
|
1134
1179
|
] })
|
|
1135
1180
|
] }),
|
|
1136
|
-
|
|
1137
|
-
/* @__PURE__ */ n(
|
|
1181
|
+
j || F ? /* @__PURE__ */ i("div", { className: "flex items-center gap-2 py-1.5 text-[12px] text-slate-400", children: [
|
|
1182
|
+
/* @__PURE__ */ n(Me, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
1138
1183
|
"Resolving owners…"
|
|
1139
|
-
] }) :
|
|
1140
|
-
|
|
1184
|
+
] }) : J ? /* @__PURE__ */ i("p", { className: "text-[12px] text-slate-500 dark:text-muted-foreground", children: [
|
|
1185
|
+
s ? "Back with" : "With",
|
|
1141
1186
|
" ",
|
|
1142
|
-
/* @__PURE__ */ n(
|
|
1187
|
+
/* @__PURE__ */ n(wn, { userId: J.id, children: /* @__PURE__ */ n(
|
|
1143
1188
|
"button",
|
|
1144
1189
|
{
|
|
1145
1190
|
type: "button",
|
|
1146
|
-
"aria-label": `${
|
|
1191
|
+
"aria-label": `${J.name} — profile`,
|
|
1147
1192
|
className: "rounded font-medium text-slate-700 underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan dark:text-foreground",
|
|
1148
|
-
children:
|
|
1193
|
+
children: J.name
|
|
1149
1194
|
}
|
|
1150
1195
|
) }),
|
|
1151
1196
|
/* @__PURE__ */ n(
|
|
1152
|
-
|
|
1197
|
+
yt,
|
|
1153
1198
|
{
|
|
1154
|
-
person: { id: String(
|
|
1199
|
+
person: { id: String(J.id), name: J.name ?? "" },
|
|
1155
1200
|
className: "ml-1 inline-flex align-middle"
|
|
1156
1201
|
}
|
|
1157
1202
|
)
|
|
1158
|
-
] }) :
|
|
1159
|
-
|
|
1160
|
-
var
|
|
1161
|
-
const
|
|
1162
|
-
return /* @__PURE__ */
|
|
1203
|
+
] }) : x === 0 ? /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400", children: "No owners assigned." }) : /* @__PURE__ */ i("div", { className: "space-y-px", children: [
|
|
1204
|
+
K.map((d) => {
|
|
1205
|
+
var l, h;
|
|
1206
|
+
const L = [d.first_name, d.last_name].filter(Boolean).join(" ") || d.email, G = (`${((l = d.first_name) == null ? void 0 : l[0]) ?? ""}${((h = d.last_name) == null ? void 0 : h[0]) ?? ""}`.trim() || d.email[0] || "?").toUpperCase();
|
|
1207
|
+
return /* @__PURE__ */ i(
|
|
1163
1208
|
"div",
|
|
1164
1209
|
{
|
|
1165
1210
|
className: "group/row -mx-2 flex items-center gap-2.5 rounded-md px-2 py-1.5 transition-colors hover:bg-slate-50 dark:hover:bg-white/5",
|
|
1166
1211
|
children: [
|
|
1167
|
-
/* @__PURE__ */ n(
|
|
1212
|
+
/* @__PURE__ */ n(on, { userId: d.id, name: L, email: d.email, initials: G }),
|
|
1168
1213
|
/* @__PURE__ */ n(
|
|
1169
|
-
|
|
1214
|
+
yt,
|
|
1170
1215
|
{
|
|
1171
|
-
person: { id: String(
|
|
1216
|
+
person: { id: String(d.id), name: L, firstName: d.first_name },
|
|
1172
1217
|
className: "opacity-0 focus-visible:opacity-100 group-hover/row:opacity-100 data-[state=open]:opacity-100"
|
|
1173
1218
|
}
|
|
1174
1219
|
),
|
|
1175
1220
|
(() => {
|
|
1176
|
-
const
|
|
1177
|
-
return
|
|
1221
|
+
const w = T.get(String(d.id).toUpperCase());
|
|
1222
|
+
return w ? /* @__PURE__ */ n(
|
|
1178
1223
|
"span",
|
|
1179
1224
|
{
|
|
1180
|
-
"data-owner-unavailable":
|
|
1181
|
-
className:
|
|
1225
|
+
"data-owner-unavailable": w.reason,
|
|
1226
|
+
className: le(
|
|
1182
1227
|
"shrink-0 rounded-full border px-1.5 py-0.5 text-[10px] font-medium",
|
|
1183
|
-
|
|
1228
|
+
w.delegate ? "border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200" : "border-red-200 bg-red-50 text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300"
|
|
1184
1229
|
),
|
|
1185
|
-
"data-tip":
|
|
1186
|
-
children:
|
|
1230
|
+
"data-tip": w.delegate ? `${L} is ${He[w.reason] ?? w.reason} — ${w.delegate.name} covers` : `${L} is ${He[w.reason] ?? w.reason} and can't approve this step`,
|
|
1231
|
+
children: w.delegate ? `${He[w.reason] ?? w.reason} · ${w.delegate.name} covers` : He[w.reason] ?? w.reason
|
|
1187
1232
|
}
|
|
1188
1233
|
) : null;
|
|
1189
1234
|
})(),
|
|
1190
|
-
|
|
1235
|
+
d.queue_only ? /* @__PURE__ */ n(
|
|
1191
1236
|
"span",
|
|
1192
1237
|
{
|
|
1193
1238
|
className: "shrink-0 rounded-full bg-slate-100 px-1.5 py-0.5 text-[10px] font-medium text-slate-500 dark:bg-slate-800 dark:text-slate-400",
|
|
1194
1239
|
"data-tip": "The record is in their queue, but only the step’s owners can move it",
|
|
1195
|
-
children:
|
|
1240
|
+
children: U && Se.has(String(d.id).toUpperCase()) ? "stand-in" : "in their queue"
|
|
1196
1241
|
}
|
|
1197
1242
|
) : /* @__PURE__ */ n("span", { className: "shrink-0 rounded-full bg-nvr-cyan/10 px-1.5 py-0.5 text-[10px] font-medium text-nvr-navy/70 dark:text-nvr-cyan", children: "owner group" })
|
|
1198
1243
|
]
|
|
1199
1244
|
},
|
|
1200
|
-
`group-${
|
|
1245
|
+
`group-${d.id}`
|
|
1201
1246
|
);
|
|
1202
1247
|
}),
|
|
1203
|
-
(
|
|
1248
|
+
(H ?? []).map((d) => /* @__PURE__ */ i(
|
|
1204
1249
|
"div",
|
|
1205
1250
|
{
|
|
1206
1251
|
className: "group -mx-2 flex items-center gap-2.5 rounded-md px-2 py-1.5 transition-colors hover:bg-slate-50 dark:hover:bg-white/5",
|
|
1207
1252
|
children: [
|
|
1208
1253
|
/* @__PURE__ */ n(
|
|
1209
|
-
|
|
1254
|
+
on,
|
|
1210
1255
|
{
|
|
1211
|
-
userId:
|
|
1212
|
-
name: [
|
|
1213
|
-
email:
|
|
1214
|
-
initials:
|
|
1256
|
+
userId: d.user,
|
|
1257
|
+
name: [d.first_name, d.last_name].filter(Boolean).join(" ") || d.email,
|
|
1258
|
+
email: d.email,
|
|
1259
|
+
initials: ye(d)
|
|
1215
1260
|
}
|
|
1216
1261
|
),
|
|
1217
1262
|
/* @__PURE__ */ n(
|
|
1218
|
-
|
|
1263
|
+
yt,
|
|
1219
1264
|
{
|
|
1220
1265
|
person: {
|
|
1221
|
-
id: String(
|
|
1222
|
-
name: [
|
|
1223
|
-
firstName:
|
|
1266
|
+
id: String(d.user),
|
|
1267
|
+
name: [d.first_name, d.last_name].filter(Boolean).join(" ") || d.email,
|
|
1268
|
+
firstName: d.first_name
|
|
1224
1269
|
},
|
|
1225
1270
|
className: "opacity-0 focus-visible:opacity-100 group-hover:opacity-100 data-[state=open]:opacity-100"
|
|
1226
1271
|
}
|
|
1227
1272
|
),
|
|
1228
1273
|
/* @__PURE__ */ n("span", { className: "shrink-0 rounded-full bg-amber-50 px-1.5 py-0.5 text-[10px] font-medium text-amber-700 dark:bg-amber-500/10 dark:text-amber-400", children: "manual" }),
|
|
1229
|
-
/* @__PURE__ */ n("span", { className: "shrink-0 rounded-full bg-slate-100 px-1.5 py-0.5 text-[10px] text-slate-500", children:
|
|
1274
|
+
/* @__PURE__ */ n("span", { className: "shrink-0 rounded-full bg-slate-100 px-1.5 py-0.5 text-[10px] text-slate-500", children: d.state ? o(d.state) : "all states" }),
|
|
1230
1275
|
/* @__PURE__ */ n(
|
|
1231
1276
|
"button",
|
|
1232
1277
|
{
|
|
1233
1278
|
type: "button",
|
|
1234
|
-
"aria-label": `Remove ${[
|
|
1235
|
-
disabled:
|
|
1236
|
-
onClick: () =>
|
|
1279
|
+
"aria-label": `Remove ${[d.first_name, d.last_name].filter(Boolean).join(" ") || d.email} as an owner`,
|
|
1280
|
+
disabled: ee.isPending,
|
|
1281
|
+
onClick: () => ee.mutate(d),
|
|
1237
1282
|
className: "shrink-0 rounded p-0.5 text-slate-300 opacity-0 transition-all hover:text-red-500 focus-visible:opacity-100 group-hover:opacity-100",
|
|
1238
|
-
children: /* @__PURE__ */ n(
|
|
1283
|
+
children: /* @__PURE__ */ n(vr, { className: "h-3 w-3" })
|
|
1239
1284
|
}
|
|
1240
1285
|
)
|
|
1241
1286
|
]
|
|
1242
1287
|
},
|
|
1243
|
-
|
|
1288
|
+
d.id
|
|
1244
1289
|
))
|
|
1245
1290
|
] }),
|
|
1246
|
-
|
|
1291
|
+
U && !j && !F && (ae ? (
|
|
1247
1292
|
// Why nobody is assigned + why this person stands in (Rob 2026-11-14).
|
|
1248
|
-
/* @__PURE__ */ n(
|
|
1249
|
-
) : /* @__PURE__ */
|
|
1293
|
+
/* @__PURE__ */ n(la, { reason: ae, className: "mt-2" })
|
|
1294
|
+
) : /* @__PURE__ */ i(
|
|
1250
1295
|
"p",
|
|
1251
1296
|
{
|
|
1252
1297
|
"data-owners-stand-in": !0,
|
|
1253
1298
|
className: "mt-1.5 text-[11px] leading-snug text-slate-500 dark:text-slate-400",
|
|
1254
1299
|
children: [
|
|
1255
1300
|
"Shown as a stand-in — no one is assigned to ",
|
|
1256
|
-
|
|
1301
|
+
Y == null ? void 0 : Y.label,
|
|
1257
1302
|
"."
|
|
1258
1303
|
]
|
|
1259
1304
|
}
|
|
1260
1305
|
)),
|
|
1261
|
-
|
|
1306
|
+
Pe && a && /* @__PURE__ */ n(
|
|
1307
|
+
ta,
|
|
1308
|
+
{
|
|
1309
|
+
collection: t,
|
|
1310
|
+
item: String(e),
|
|
1311
|
+
stateId: a,
|
|
1312
|
+
className: "mt-2"
|
|
1313
|
+
}
|
|
1314
|
+
),
|
|
1315
|
+
v && /* @__PURE__ */ i("div", { className: "mt-3 space-y-2 rounded-lg border border-slate-200 bg-slate-50 dark:bg-slate-900/30 dark:border-border p-3", children: [
|
|
1262
1316
|
/* @__PURE__ */ n("p", { className: "text-[11px] font-semibold text-slate-500", children: "Add owner" }),
|
|
1263
|
-
/* @__PURE__ */ n(
|
|
1264
|
-
p ? /* @__PURE__ */
|
|
1265
|
-
/* @__PURE__ */ n(
|
|
1317
|
+
/* @__PURE__ */ n(Qr, { value: C, onChange: E }),
|
|
1318
|
+
p ? /* @__PURE__ */ i(yn, { open: ne, onOpenChange: ie, children: [
|
|
1319
|
+
/* @__PURE__ */ n(kn, { asChild: !0, children: /* @__PURE__ */ i(
|
|
1266
1320
|
"button",
|
|
1267
1321
|
{
|
|
1268
1322
|
type: "button",
|
|
1269
1323
|
className: "flex h-8 w-full items-center justify-between rounded-md border border-slate-200 bg-white px-2.5 text-left text-[13px] text-slate-700 transition-colors hover:border-slate-300 dark:border-border dark:bg-transparent dark:text-slate-300",
|
|
1270
1324
|
children: [
|
|
1271
|
-
/* @__PURE__ */ n("span", { className: "truncate", children:
|
|
1272
|
-
/* @__PURE__ */ n(
|
|
1325
|
+
/* @__PURE__ */ n("span", { className: "truncate", children: N ? ((Ce = r.find((d) => d.id === N)) == null ? void 0 : Ce.label) ?? N : "All states" }),
|
|
1326
|
+
/* @__PURE__ */ n(Ge, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
|
|
1273
1327
|
]
|
|
1274
1328
|
}
|
|
1275
1329
|
) }),
|
|
1276
|
-
/* @__PURE__ */ n(
|
|
1277
|
-
var
|
|
1278
|
-
const
|
|
1330
|
+
/* @__PURE__ */ n(_n, { align: "start", sideOffset: 4, className: "w-52 p-1", children: ["", ...r.map((d) => d.id)].map((d) => {
|
|
1331
|
+
var l;
|
|
1332
|
+
const L = d === "" ? "All states" : ((l = r.find((h) => h.id === d)) == null ? void 0 : l.label) ?? d;
|
|
1279
1333
|
return /* @__PURE__ */ n(
|
|
1280
1334
|
"button",
|
|
1281
1335
|
{
|
|
1282
1336
|
type: "button",
|
|
1283
|
-
className:
|
|
1337
|
+
className: le(
|
|
1284
1338
|
"flex w-full rounded px-2.5 py-1.5 text-left text-[13px] transition-colors hover:bg-slate-50 dark:hover:bg-white/5",
|
|
1285
|
-
|
|
1339
|
+
N === d && "font-medium text-slate-800 dark:text-slate-200"
|
|
1286
1340
|
),
|
|
1287
1341
|
onClick: () => {
|
|
1288
|
-
|
|
1342
|
+
R(d), ie(!1);
|
|
1289
1343
|
},
|
|
1290
|
-
children:
|
|
1344
|
+
children: L
|
|
1291
1345
|
},
|
|
1292
|
-
|
|
1346
|
+
d
|
|
1293
1347
|
);
|
|
1294
1348
|
}) })
|
|
1295
1349
|
] }) : /* @__PURE__ */ n("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: "Hands off the current step." }),
|
|
1296
|
-
/* @__PURE__ */
|
|
1350
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-end gap-2 pt-0.5", children: [
|
|
1297
1351
|
/* @__PURE__ */ n(
|
|
1298
|
-
|
|
1352
|
+
ge,
|
|
1299
1353
|
{
|
|
1300
1354
|
type: "button",
|
|
1301
1355
|
size: "sm",
|
|
1302
1356
|
variant: "ghost",
|
|
1303
1357
|
className: "h-7 text-[12px]",
|
|
1304
1358
|
onClick: () => {
|
|
1305
|
-
|
|
1359
|
+
M(!1), E(""), R("");
|
|
1306
1360
|
},
|
|
1307
1361
|
children: "Cancel"
|
|
1308
1362
|
}
|
|
1309
1363
|
),
|
|
1310
1364
|
/* @__PURE__ */ n(
|
|
1311
|
-
|
|
1365
|
+
ge,
|
|
1312
1366
|
{
|
|
1313
1367
|
type: "button",
|
|
1314
1368
|
size: "sm",
|
|
1315
1369
|
className: "h-7 text-[12px]",
|
|
1316
|
-
disabled: !
|
|
1317
|
-
onClick: () =>
|
|
1318
|
-
children:
|
|
1370
|
+
disabled: !C || ce.isPending,
|
|
1371
|
+
onClick: () => ce.mutate(),
|
|
1372
|
+
children: ce.isPending ? /* @__PURE__ */ n(Me, { className: "h-3.5 w-3.5 animate-spin" }) : "Add"
|
|
1319
1373
|
}
|
|
1320
1374
|
)
|
|
1321
1375
|
] })
|
|
1322
1376
|
] })
|
|
1323
1377
|
] });
|
|
1324
1378
|
}
|
|
1325
|
-
function
|
|
1379
|
+
function dr(t, e, r, a) {
|
|
1326
1380
|
if (!t || !(r != null && r.length)) return null;
|
|
1327
|
-
const
|
|
1328
|
-
if (!
|
|
1329
|
-
const
|
|
1330
|
-
return
|
|
1381
|
+
const c = new Map(r.map((p) => [String(p.id).toUpperCase(), p])).get(String(t.to_state).toUpperCase()), k = Number(e == null ? void 0 : e.sort);
|
|
1382
|
+
if (!c || !Number.isFinite(k) || !(Number(c.sort) > k)) return null;
|
|
1383
|
+
const f = Vr(String(t.to_state), r, a);
|
|
1384
|
+
return f && f.skipped.length > 0 ? f : null;
|
|
1331
1385
|
}
|
|
1332
|
-
function
|
|
1386
|
+
function cr({ landing: t }) {
|
|
1333
1387
|
if (!t || t.skipped.length === 0) return null;
|
|
1334
|
-
const e =
|
|
1388
|
+
const e = Xr(t);
|
|
1335
1389
|
if (e.length === 1) {
|
|
1336
1390
|
const r = e[0];
|
|
1337
|
-
return /* @__PURE__ */
|
|
1391
|
+
return /* @__PURE__ */ i(
|
|
1338
1392
|
"p",
|
|
1339
1393
|
{
|
|
1340
1394
|
"data-confirm-skips": !0,
|
|
@@ -1344,7 +1398,7 @@ function tr({ landing: t }) {
|
|
|
1344
1398
|
/* @__PURE__ */ n("span", { className: "font-medium", children: t.state.label }),
|
|
1345
1399
|
" —",
|
|
1346
1400
|
" ",
|
|
1347
|
-
|
|
1401
|
+
Zt(r.labels),
|
|
1348
1402
|
" ",
|
|
1349
1403
|
r.labels.length === 1 ? "is" : "are",
|
|
1350
1404
|
" skipped",
|
|
@@ -1354,126 +1408,159 @@ function tr({ landing: t }) {
|
|
|
1354
1408
|
}
|
|
1355
1409
|
);
|
|
1356
1410
|
}
|
|
1357
|
-
return /* @__PURE__ */
|
|
1411
|
+
return /* @__PURE__ */ i(
|
|
1358
1412
|
"div",
|
|
1359
1413
|
{
|
|
1360
1414
|
"data-confirm-skips": !0,
|
|
1361
1415
|
className: "text-[11.5px] leading-snug text-slate-600 dark:text-slate-300",
|
|
1362
1416
|
children: [
|
|
1363
|
-
/* @__PURE__ */
|
|
1417
|
+
/* @__PURE__ */ i("p", { children: [
|
|
1364
1418
|
"Goes straight to ",
|
|
1365
1419
|
/* @__PURE__ */ n("span", { className: "font-medium", children: t.state.label }),
|
|
1366
1420
|
". Skipped on the way:"
|
|
1367
1421
|
] }),
|
|
1368
|
-
/* @__PURE__ */ n("ul", { className: "mt-0.5 list-disc space-y-0.5 pl-4", children: e.map((r) => /* @__PURE__ */
|
|
1369
|
-
/* @__PURE__ */ n("span", { className: "font-medium", children:
|
|
1422
|
+
/* @__PURE__ */ n("ul", { className: "mt-0.5 list-disc space-y-0.5 pl-4", children: e.map((r) => /* @__PURE__ */ i("li", { children: [
|
|
1423
|
+
/* @__PURE__ */ n("span", { className: "font-medium", children: Zt(r.labels) }),
|
|
1370
1424
|
r.reason ? ` — ${r.reason}` : ""
|
|
1371
1425
|
] }, r.labels.join("|"))) })
|
|
1372
1426
|
]
|
|
1373
1427
|
}
|
|
1374
1428
|
);
|
|
1375
1429
|
}
|
|
1376
|
-
const
|
|
1430
|
+
const He = {
|
|
1377
1431
|
out: "out of office",
|
|
1378
1432
|
suspended: "suspended",
|
|
1379
1433
|
redacted: "redacted"
|
|
1380
1434
|
};
|
|
1381
|
-
function
|
|
1435
|
+
function $a({
|
|
1382
1436
|
collection: t,
|
|
1383
1437
|
item: e,
|
|
1384
1438
|
states: r,
|
|
1385
|
-
currentStateId: a
|
|
1439
|
+
currentStateId: a,
|
|
1440
|
+
history: s
|
|
1386
1441
|
}) {
|
|
1387
|
-
const
|
|
1442
|
+
const c = je(), k = Je(), [f, p] = V(!1), S = xe(a);
|
|
1443
|
+
Ee(() => {
|
|
1444
|
+
S.current !== a && (S.current = a, k.invalidateQueries({ queryKey: ["pipeline-all-owners", t, e] }));
|
|
1445
|
+
}, [a, t, e, k]);
|
|
1446
|
+
const { data: v, isLoading: M, dataUpdatedAt: C } = ke({
|
|
1388
1447
|
queryKey: ["pipeline-all-owners", t, e],
|
|
1389
|
-
queryFn: () =>
|
|
1390
|
-
|
|
1391
|
-
).then((
|
|
1392
|
-
enabled:
|
|
1448
|
+
queryFn: () => c.request(
|
|
1449
|
+
qe(`/pipelines/instance/${t}/${e}/owners/all`)
|
|
1450
|
+
).then((R) => R.data ?? null),
|
|
1451
|
+
enabled: f,
|
|
1393
1452
|
staleTime: 3e4
|
|
1394
|
-
}),
|
|
1395
|
-
var
|
|
1396
|
-
return !v || ((
|
|
1397
|
-
}).sort((
|
|
1398
|
-
return /* @__PURE__ */
|
|
1399
|
-
/* @__PURE__ */ n(
|
|
1453
|
+
}), E = [...r].filter((R) => {
|
|
1454
|
+
var ne;
|
|
1455
|
+
return !v || ((ne = v[R.id]) == null ? void 0 : ne.on_path) !== !1;
|
|
1456
|
+
}).sort((R, ne) => R.sort - ne.sort), N = Cr(`${a ?? ""}:${(s == null ? void 0 : s.length) ?? 0}:${C}`);
|
|
1457
|
+
return /* @__PURE__ */ i(yn, { open: f, onOpenChange: p, children: [
|
|
1458
|
+
/* @__PURE__ */ n(kn, { asChild: !0, children: /* @__PURE__ */ n(
|
|
1400
1459
|
"button",
|
|
1401
1460
|
{
|
|
1402
1461
|
type: "button",
|
|
1403
1462
|
title: "View approval chain",
|
|
1404
1463
|
className: "flex h-6 w-6 items-center justify-center rounded text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-muted dark:hover:text-slate-300",
|
|
1405
|
-
onClick: (
|
|
1406
|
-
children: /* @__PURE__ */ n(
|
|
1464
|
+
onClick: (R) => R.stopPropagation(),
|
|
1465
|
+
children: /* @__PURE__ */ n(cn, { className: "h-3.5 w-3.5" })
|
|
1407
1466
|
}
|
|
1408
1467
|
) }),
|
|
1409
|
-
/* @__PURE__ */
|
|
1410
|
-
/* @__PURE__ */
|
|
1468
|
+
/* @__PURE__ */ i(_n, { align: "end", sideOffset: 6, className: "w-[576px] p-0 overflow-hidden", children: [
|
|
1469
|
+
/* @__PURE__ */ i("div", { className: "border-b border-slate-100 px-4 py-3", children: [
|
|
1411
1470
|
/* @__PURE__ */ n("p", { className: "text-[12px] font-semibold text-slate-700", children: "Approval Chain" }),
|
|
1412
1471
|
/* @__PURE__ */ n("p", { className: "text-[11px] text-slate-400 mt-0.5", children: "Owners per pipeline state" })
|
|
1413
1472
|
] }),
|
|
1414
|
-
/* @__PURE__ */ n("div", { className: "max-h-[504px] overflow-y-auto", children:
|
|
1415
|
-
var
|
|
1416
|
-
const
|
|
1417
|
-
id:
|
|
1418
|
-
name: [
|
|
1419
|
-
})),
|
|
1420
|
-
|
|
1473
|
+
/* @__PURE__ */ n("div", { className: "max-h-[504px] overflow-y-auto", children: M ? /* @__PURE__ */ n("div", { className: "space-y-px p-3", children: [1, 2, 3].map((R) => /* @__PURE__ */ n(Ue, { className: "h-10 w-full" }, R)) }) : v ? /* @__PURE__ */ n("div", { ref: N, className: "divide-y divide-slate-100 dark:divide-border/60", children: E.map((R) => {
|
|
1474
|
+
var g, D, _, F, $, K;
|
|
1475
|
+
const ne = (((g = v[R.id]) == null ? void 0 : g.owners) ?? []).map((T) => ({
|
|
1476
|
+
id: T.id,
|
|
1477
|
+
name: [T.first_name, T.last_name].filter(Boolean).join(" ") || T.email
|
|
1478
|
+
})), ie = kr({
|
|
1479
|
+
stateId: R.id,
|
|
1480
|
+
currentStateId: a,
|
|
1481
|
+
history: s ?? [],
|
|
1482
|
+
// Only people who can act on the step (a queue-only name cannot approve).
|
|
1483
|
+
owners: (((D = v[R.id]) == null ? void 0 : D.owners) ?? []).filter((T) => !T.queue_only).map((T) => [T.first_name, T.last_name].filter(Boolean).join(" ") || T.email)
|
|
1484
|
+
}), me = R.id === a, de = ((_ = v[R.id]) == null ? void 0 : _.skipped) === !0 && !me, oe = (((F = v[R.id]) == null ? void 0 : F.skip_reasons) ?? []).filter(Boolean), H = (($ = v[R.id]) == null ? void 0 : $.unavailable) ?? [], j = ((K = v[R.id]) == null ? void 0 : K.blocked) === !0 && !de;
|
|
1485
|
+
return /* @__PURE__ */ i(
|
|
1421
1486
|
"div",
|
|
1422
1487
|
{
|
|
1423
|
-
className:
|
|
1488
|
+
className: le(
|
|
1424
1489
|
"flex items-center gap-3 px-4 py-2.5",
|
|
1425
1490
|
// Hex-with-alpha rather than bg-nvr-cyan/N — the
|
|
1426
1491
|
// nvr-cyan token is an opaque var() so Tailwind silently
|
|
1427
1492
|
// drops opacity modifiers on it. Kept very light so the
|
|
1428
1493
|
// tint doesn't clash with the state badge's own color.
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1494
|
+
me && "bg-nvr-cyan/[0.06] dark:bg-nvr-cyan/[0.11]",
|
|
1495
|
+
de && "opacity-60",
|
|
1496
|
+
j && "bg-red-50 dark:bg-red-500/10"
|
|
1432
1497
|
),
|
|
1433
|
-
"data-chain-blocked":
|
|
1498
|
+
"data-chain-blocked": j ? "" : void 0,
|
|
1499
|
+
"data-chain-step": ie == null ? void 0 : ie.kind,
|
|
1434
1500
|
children: [
|
|
1435
|
-
/* @__PURE__ */ n(
|
|
1436
|
-
|
|
1501
|
+
/* @__PURE__ */ n("span", { className: "flex w-3.5 shrink-0 justify-center", children: (ie == null ? void 0 : ie.kind) === "done" && /* @__PURE__ */ n(
|
|
1502
|
+
ft,
|
|
1503
|
+
{
|
|
1504
|
+
"aria-label": "Done",
|
|
1505
|
+
className: "h-3.5 w-3.5 text-emerald-600 dark:text-emerald-400",
|
|
1506
|
+
strokeWidth: 2.5
|
|
1507
|
+
}
|
|
1508
|
+
) }),
|
|
1509
|
+
/* @__PURE__ */ i("div", { className: "flex shrink-0 flex-col gap-0.5", children: [
|
|
1510
|
+
/* @__PURE__ */ n(Le, { label: R.label, color: R.color, small: !0 }),
|
|
1511
|
+
ie && !de && /* @__PURE__ */ n(
|
|
1512
|
+
"span",
|
|
1513
|
+
{
|
|
1514
|
+
"data-chain-step-progress": !0,
|
|
1515
|
+
className: le(
|
|
1516
|
+
"max-w-[220px] text-[11px] leading-snug",
|
|
1517
|
+
ie.kind === "waiting" ? "text-sky-700 dark:text-sky-300" : "text-slate-500 dark:text-slate-400"
|
|
1518
|
+
),
|
|
1519
|
+
children: ie.text
|
|
1520
|
+
}
|
|
1521
|
+
)
|
|
1522
|
+
] }),
|
|
1523
|
+
/* @__PURE__ */ n("div", { className: "flex min-w-0 flex-1 flex-wrap items-center gap-x-2 gap-y-0.5", children: de ? (
|
|
1437
1524
|
// Radix tooltip with zero delay — native `title` waits on
|
|
1438
1525
|
// the OS hover timer, and a truncated reason needs its
|
|
1439
1526
|
// full text the moment the cursor lands on it.
|
|
1440
|
-
/* @__PURE__ */ n(
|
|
1441
|
-
/* @__PURE__ */ n(
|
|
1527
|
+
/* @__PURE__ */ n(Nn, { delayDuration: 0, children: /* @__PURE__ */ i(Tt, { children: [
|
|
1528
|
+
/* @__PURE__ */ n(Mt, { asChild: !0, children: /* @__PURE__ */ i("div", { className: "flex min-w-0 flex-1 cursor-default items-center gap-2", children: [
|
|
1442
1529
|
/* @__PURE__ */ n("span", { className: "inline-flex shrink-0 items-center gap-1 rounded-full border border-dashed border-slate-300 px-2 py-0.5 text-[10.5px] font-medium text-slate-400 dark:border-slate-600 dark:text-slate-500", children: "Skipped" }),
|
|
1443
|
-
|
|
1530
|
+
oe.length > 0 && /* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate text-[11px] text-slate-400 dark:text-slate-500", children: oe.join(" · ") })
|
|
1444
1531
|
] }) }),
|
|
1445
|
-
/* @__PURE__ */
|
|
1446
|
-
|
|
1532
|
+
/* @__PURE__ */ i(
|
|
1533
|
+
qt,
|
|
1447
1534
|
{
|
|
1448
1535
|
side: "bottom",
|
|
1449
1536
|
align: "start",
|
|
1450
1537
|
className: "max-w-[420px] space-y-0.5 text-[11.5px] leading-snug",
|
|
1451
1538
|
children: [
|
|
1452
1539
|
/* @__PURE__ */ n("p", { className: "text-slate-500 dark:text-slate-400", children: "The pipeline will pass through this state without stopping:" }),
|
|
1453
|
-
|
|
1540
|
+
oe.length > 0 ? oe.map((T) => /* @__PURE__ */ n("p", { children: T }, T)) : /* @__PURE__ */ n("p", { children: "Skip criteria currently match" })
|
|
1454
1541
|
]
|
|
1455
1542
|
}
|
|
1456
1543
|
)
|
|
1457
1544
|
] }) })
|
|
1458
|
-
) : /* @__PURE__ */
|
|
1459
|
-
/* @__PURE__ */ n(
|
|
1460
|
-
|
|
1545
|
+
) : /* @__PURE__ */ i(_e, { children: [
|
|
1546
|
+
/* @__PURE__ */ n(Lr, { owners: ne, max: 10, emptyLabel: "—" }),
|
|
1547
|
+
H.map((T) => /* @__PURE__ */ i(
|
|
1461
1548
|
"span",
|
|
1462
1549
|
{
|
|
1463
|
-
"data-tip": `${
|
|
1464
|
-
className:
|
|
1550
|
+
"data-tip": `${T.name} is ${He[T.reason] ?? T.reason}${T.delegate ? ` — ${T.delegate.name} covers${T.delegate.expires_at ? ` until ${Ar(T.delegate.expires_at)}` : ""}` : " and nobody is covering"}`,
|
|
1551
|
+
className: le(
|
|
1465
1552
|
"inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10.5px] font-medium",
|
|
1466
|
-
|
|
1553
|
+
T.delegate ? "border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200" : "border-red-200 bg-red-50 text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300"
|
|
1467
1554
|
),
|
|
1468
1555
|
children: [
|
|
1469
|
-
|
|
1470
|
-
|
|
1556
|
+
T.name,
|
|
1557
|
+
T.delegate ? /* @__PURE__ */ i(_e, { children: [
|
|
1471
1558
|
" → ",
|
|
1472
|
-
|
|
1473
|
-
|
|
1559
|
+
T.delegate.name,
|
|
1560
|
+
T.delegate.expires_at && /* @__PURE__ */ i("span", { className: "opacity-70", children: [
|
|
1474
1561
|
", until",
|
|
1475
1562
|
" ",
|
|
1476
|
-
new Date(
|
|
1563
|
+
new Date(T.delegate.expires_at).toLocaleDateString(
|
|
1477
1564
|
void 0,
|
|
1478
1565
|
{
|
|
1479
1566
|
month: "short",
|
|
@@ -1481,257 +1568,273 @@ function la({
|
|
|
1481
1568
|
}
|
|
1482
1569
|
)
|
|
1483
1570
|
] })
|
|
1484
|
-
] }) : /* @__PURE__ */
|
|
1571
|
+
] }) : /* @__PURE__ */ i("span", { className: "opacity-80", children: [
|
|
1485
1572
|
" ",
|
|
1486
1573
|
"· ",
|
|
1487
|
-
|
|
1574
|
+
He[T.reason] ?? T.reason
|
|
1488
1575
|
] })
|
|
1489
1576
|
]
|
|
1490
1577
|
},
|
|
1491
|
-
|
|
1578
|
+
T.id
|
|
1492
1579
|
)),
|
|
1493
|
-
|
|
1580
|
+
j && /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1 rounded-full bg-red-600 px-2 py-0.5 text-[10.5px] font-semibold text-white", children: "No one can act here" })
|
|
1494
1581
|
] }) })
|
|
1495
1582
|
]
|
|
1496
1583
|
},
|
|
1497
|
-
|
|
1584
|
+
R.id
|
|
1498
1585
|
);
|
|
1499
1586
|
}) }) : /* @__PURE__ */ n("p", { className: "px-4 py-3 text-[12px] text-slate-400", children: "No pipeline configured." }) })
|
|
1500
1587
|
] })
|
|
1501
1588
|
] });
|
|
1502
1589
|
}
|
|
1503
|
-
function
|
|
1590
|
+
function $s({
|
|
1504
1591
|
collection: t,
|
|
1505
1592
|
item: e,
|
|
1506
1593
|
defaultExpanded: r,
|
|
1507
1594
|
title: a,
|
|
1508
|
-
showApprovalChain:
|
|
1509
|
-
hideActionsCollapsed:
|
|
1510
|
-
hideActionsExpanded:
|
|
1511
|
-
onBeforeTransition:
|
|
1595
|
+
showApprovalChain: s,
|
|
1596
|
+
hideActionsCollapsed: c,
|
|
1597
|
+
hideActionsExpanded: k,
|
|
1598
|
+
onBeforeTransition: f,
|
|
1512
1599
|
addendumPending: p,
|
|
1513
|
-
addendumView:
|
|
1514
|
-
asRole:
|
|
1515
|
-
asUser:
|
|
1600
|
+
addendumView: S,
|
|
1601
|
+
asRole: v,
|
|
1602
|
+
asUser: M
|
|
1516
1603
|
}) {
|
|
1517
1604
|
return e === "new" ? null : /* @__PURE__ */ n(
|
|
1518
|
-
|
|
1605
|
+
Ta,
|
|
1519
1606
|
{
|
|
1520
1607
|
collection: t,
|
|
1521
1608
|
item: e,
|
|
1522
1609
|
defaultExpanded: r,
|
|
1523
1610
|
title: a,
|
|
1524
|
-
showApprovalChain:
|
|
1525
|
-
hideActionsCollapsed:
|
|
1526
|
-
hideActionsExpanded:
|
|
1527
|
-
onBeforeTransition:
|
|
1611
|
+
showApprovalChain: s,
|
|
1612
|
+
hideActionsCollapsed: c,
|
|
1613
|
+
hideActionsExpanded: k,
|
|
1614
|
+
onBeforeTransition: f,
|
|
1528
1615
|
addendumPending: p,
|
|
1529
|
-
addendumView:
|
|
1530
|
-
asRole:
|
|
1531
|
-
asUser:
|
|
1616
|
+
addendumView: S,
|
|
1617
|
+
asRole: v,
|
|
1618
|
+
asUser: M
|
|
1532
1619
|
},
|
|
1533
1620
|
`${t}:${e}`
|
|
1534
1621
|
);
|
|
1535
1622
|
}
|
|
1536
|
-
function
|
|
1623
|
+
function ur({
|
|
1537
1624
|
collection: t,
|
|
1538
1625
|
item: e,
|
|
1539
1626
|
omitLines: r
|
|
1540
1627
|
}) {
|
|
1541
|
-
const a =
|
|
1542
|
-
queryKey:
|
|
1543
|
-
queryFn: () =>
|
|
1628
|
+
const a = je(), { data: s } = ke({
|
|
1629
|
+
queryKey: Xn(t, e),
|
|
1630
|
+
queryFn: () => Yn(a, t, e),
|
|
1544
1631
|
staleTime: 3e4,
|
|
1545
1632
|
retry: !1
|
|
1546
1633
|
});
|
|
1547
|
-
if (!
|
|
1548
|
-
const
|
|
1549
|
-
return /* @__PURE__ */
|
|
1550
|
-
/* @__PURE__ */
|
|
1551
|
-
|
|
1552
|
-
" ",
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1634
|
+
if (!s) return /* @__PURE__ */ n(en, { collection: t, item: e });
|
|
1635
|
+
const c = s.changed_by_people ?? s.changed_total, k = new Set((r ?? []).map(rn)), f = (s.lines ?? []).filter((p) => !k.has(rn(p)));
|
|
1636
|
+
return /* @__PURE__ */ i(_e, { children: [
|
|
1637
|
+
/* @__PURE__ */ n(en, { collection: t, item: e }),
|
|
1638
|
+
/* @__PURE__ */ i("div", { className: "rounded-md border border-slate-200 bg-white px-3 py-2 text-[11.5px] dark:border-border dark:bg-card", children: [
|
|
1639
|
+
/* @__PURE__ */ i("p", { className: "text-slate-500 dark:text-muted-foreground", children: [
|
|
1640
|
+
/* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-foreground", children: "Since entering this state" }),
|
|
1641
|
+
" ",
|
|
1642
|
+
"(",
|
|
1643
|
+
ha(s.days_in_state),
|
|
1644
|
+
"):",
|
|
1645
|
+
" ",
|
|
1646
|
+
s.changed_total === 0 && s.comments === 0 && s.addendums.count === 0 ? /* @__PURE__ */ n("span", { children: "no changes to this record." }) : /* @__PURE__ */ i(_e, { children: [
|
|
1647
|
+
c > 0 && /* @__PURE__ */ i("span", { children: [
|
|
1648
|
+
c,
|
|
1649
|
+
" field",
|
|
1650
|
+
c === 1 ? "" : "s",
|
|
1651
|
+
" changed",
|
|
1652
|
+
s.edited_by.length > 0 ? ` by ${s.edited_by.join(", ")}` : ""
|
|
1653
|
+
] }),
|
|
1654
|
+
c === 0 && s.changed_total > 0 && s.comments === 0 && s.addendums.count === 0 && /* @__PURE__ */ n("span", { children: "only values the record fills in itself changed." }),
|
|
1655
|
+
s.comments > 0 && /* @__PURE__ */ i("span", { children: [
|
|
1656
|
+
c > 0 ? " · " : "",
|
|
1657
|
+
s.comments,
|
|
1658
|
+
" comment",
|
|
1659
|
+
s.comments === 1 ? "" : "s"
|
|
1660
|
+
] }),
|
|
1661
|
+
s.addendums.count > 0 && /* @__PURE__ */ i("span", { children: [
|
|
1662
|
+
" · ",
|
|
1663
|
+
s.addendums.count,
|
|
1664
|
+
" addendum",
|
|
1665
|
+
s.addendums.count === 1 ? "" : "s",
|
|
1666
|
+
s.addendums.cost_impact !== 0 ? ` (${s.addendums.cost_impact > 0 ? "+" : ""}$${Math.abs(s.addendums.cost_impact).toLocaleString()})` : ""
|
|
1667
|
+
] })
|
|
1578
1668
|
] })
|
|
1579
|
-
] })
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
"p",
|
|
1586
|
-
{
|
|
1587
|
-
"data-brief-change": p.field,
|
|
1588
|
-
className: "text-[11px] text-slate-500 dark:text-muted-foreground",
|
|
1589
|
-
children: [
|
|
1590
|
-
/* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-foreground", children: p.label || xr(p.field) }),
|
|
1591
|
-
p.auto ? /* @__PURE__ */ n("span", { children: " (updated automatically)" }) : null,
|
|
1592
|
-
":",
|
|
1593
|
-
" ",
|
|
1594
|
-
_.old !== null && /* @__PURE__ */ s(Ce, { children: [
|
|
1595
|
-
/* @__PURE__ */ n("span", { className: "text-red-600 line-through dark:text-red-400", children: _.old }),
|
|
1596
|
-
/* @__PURE__ */ n("span", { "aria-hidden": "true", children: " → " }),
|
|
1597
|
-
/* @__PURE__ */ n("span", { className: "sr-only", children: " changed to " })
|
|
1598
|
-
] }),
|
|
1599
|
-
/* @__PURE__ */ n("span", { className: "text-emerald-700 dark:text-emerald-400", children: _.new })
|
|
1600
|
-
]
|
|
1601
|
-
},
|
|
1602
|
-
p.field
|
|
1603
|
-
);
|
|
1604
|
-
}),
|
|
1605
|
-
i.field_changes.length > 5 && /* @__PURE__ */ s("p", { className: "text-[10.5px] text-slate-400", children: [
|
|
1606
|
-
"+",
|
|
1607
|
-
i.field_changes.length - 5,
|
|
1608
|
-
" more — see History for the full trail"
|
|
1609
|
-
] })
|
|
1610
|
-
] }),
|
|
1611
|
-
v.map((p) => /* @__PURE__ */ s(
|
|
1612
|
-
"p",
|
|
1613
|
-
{
|
|
1614
|
-
"data-brief-line": p.label,
|
|
1615
|
-
className: "mt-1 text-slate-500 dark:text-muted-foreground",
|
|
1616
|
-
children: [
|
|
1617
|
-
/* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-foreground", children: p.label }),
|
|
1618
|
-
" ",
|
|
1619
|
-
/* @__PURE__ */ n(
|
|
1620
|
-
"span",
|
|
1669
|
+
] }),
|
|
1670
|
+
s.field_changes.length > 0 && /* @__PURE__ */ i("div", { className: "mt-1 space-y-0.5", children: [
|
|
1671
|
+
s.field_changes.slice(0, 5).map((p) => {
|
|
1672
|
+
const S = ga(p.old, p.new);
|
|
1673
|
+
return /* @__PURE__ */ i(
|
|
1674
|
+
"p",
|
|
1621
1675
|
{
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1676
|
+
"data-brief-change": p.field,
|
|
1677
|
+
className: "text-[11px] text-slate-500 dark:text-muted-foreground",
|
|
1678
|
+
children: [
|
|
1679
|
+
/* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-foreground", children: p.label || Fr(p.field) }),
|
|
1680
|
+
p.auto ? /* @__PURE__ */ n("span", { children: " (updated automatically)" }) : null,
|
|
1681
|
+
":",
|
|
1682
|
+
" ",
|
|
1683
|
+
S.old !== null && /* @__PURE__ */ i(_e, { children: [
|
|
1684
|
+
/* @__PURE__ */ n("span", { className: "text-red-600 line-through dark:text-red-400", children: S.old }),
|
|
1685
|
+
/* @__PURE__ */ n("span", { "aria-hidden": "true", children: " → " }),
|
|
1686
|
+
/* @__PURE__ */ n("span", { className: "sr-only", children: " changed to " })
|
|
1687
|
+
] }),
|
|
1688
|
+
/* @__PURE__ */ n("span", { className: "text-emerald-700 dark:text-emerald-400", children: S.new })
|
|
1689
|
+
]
|
|
1690
|
+
},
|
|
1691
|
+
p.field
|
|
1692
|
+
);
|
|
1693
|
+
}),
|
|
1694
|
+
s.field_changes.length > 5 && /* @__PURE__ */ i("p", { className: "text-[10.5px] text-slate-400", children: [
|
|
1695
|
+
"+",
|
|
1696
|
+
s.field_changes.length - 5,
|
|
1697
|
+
" more — see History for the full trail"
|
|
1698
|
+
] })
|
|
1699
|
+
] }),
|
|
1700
|
+
f.map((p) => /* @__PURE__ */ i(
|
|
1701
|
+
"p",
|
|
1702
|
+
{
|
|
1703
|
+
"data-brief-line": p.label,
|
|
1704
|
+
className: "mt-1 text-slate-500 dark:text-muted-foreground",
|
|
1705
|
+
children: [
|
|
1706
|
+
/* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-foreground", children: p.label }),
|
|
1707
|
+
" ",
|
|
1708
|
+
/* @__PURE__ */ n(
|
|
1709
|
+
"span",
|
|
1710
|
+
{
|
|
1711
|
+
className: p.tone === "danger" ? "text-red-700 dark:text-red-300" : p.tone === "warn" ? "text-amber-700 dark:text-amber-300" : "",
|
|
1712
|
+
children: p.text
|
|
1713
|
+
}
|
|
1714
|
+
)
|
|
1715
|
+
]
|
|
1716
|
+
},
|
|
1717
|
+
`${p.label}:${p.text}`
|
|
1718
|
+
))
|
|
1719
|
+
] })
|
|
1630
1720
|
] });
|
|
1631
1721
|
}
|
|
1632
|
-
function
|
|
1722
|
+
function Ta({
|
|
1633
1723
|
collection: t,
|
|
1634
1724
|
item: e,
|
|
1635
1725
|
defaultExpanded: r,
|
|
1636
1726
|
title: a,
|
|
1637
|
-
showApprovalChain:
|
|
1638
|
-
hideActionsCollapsed:
|
|
1639
|
-
hideActionsExpanded:
|
|
1640
|
-
onBeforeTransition:
|
|
1727
|
+
showApprovalChain: s,
|
|
1728
|
+
hideActionsCollapsed: c,
|
|
1729
|
+
hideActionsExpanded: k,
|
|
1730
|
+
onBeforeTransition: f,
|
|
1641
1731
|
addendumPending: p,
|
|
1642
|
-
addendumView:
|
|
1643
|
-
asRole:
|
|
1644
|
-
asUser:
|
|
1732
|
+
addendumView: S,
|
|
1733
|
+
asRole: v,
|
|
1734
|
+
asUser: M
|
|
1645
1735
|
}) {
|
|
1646
|
-
var
|
|
1647
|
-
const
|
|
1648
|
-
|
|
1649
|
-
if (!
|
|
1650
|
-
const
|
|
1651
|
-
const
|
|
1652
|
-
!
|
|
1736
|
+
var Wt, zt, Ht, Gt;
|
|
1737
|
+
const C = !!v || !!M, E = je(), N = Je(), { isAdmin: R } = fn(), [ne, ie] = V(0), me = xe(null);
|
|
1738
|
+
Ee(() => {
|
|
1739
|
+
if (!R) return;
|
|
1740
|
+
const u = (q) => {
|
|
1741
|
+
const P = q.detail;
|
|
1742
|
+
!P || P.claimed || P.collection !== t || String(P.item) !== String(e) || (P.claimed = !0, F(!0), ie((I) => I + 1), setTimeout(
|
|
1653
1743
|
() => {
|
|
1654
|
-
var
|
|
1655
|
-
return (
|
|
1744
|
+
var I;
|
|
1745
|
+
return (I = me.current) == null ? void 0 : I.scrollIntoView({ block: "center", behavior: "smooth" });
|
|
1656
1746
|
},
|
|
1657
1747
|
80
|
|
1658
1748
|
));
|
|
1659
1749
|
};
|
|
1660
|
-
return window.addEventListener(
|
|
1661
|
-
}, [
|
|
1662
|
-
const [
|
|
1663
|
-
|
|
1664
|
-
const
|
|
1665
|
-
|
|
1666
|
-
onSettled: (
|
|
1667
|
-
if (
|
|
1668
|
-
|
|
1750
|
+
return window.addEventListener(Xt, u), () => window.removeEventListener(Xt, u);
|
|
1751
|
+
}, [R, t, e]);
|
|
1752
|
+
const [de, oe] = V(""), [H, j] = V(null), [g, D] = V(!1), [_, F] = Rr(r, !1), [$, K] = V(null), [T, x] = V(null), [A, re] = V(null), [m, J] = V([]), Y = Jn(t, String(e)), [Ne, U] = V([]), ae = In(t, String(e));
|
|
1753
|
+
xn(t, e, "transition", !!H || !!$), gn(t, e, { hold: !!H || !!$ });
|
|
1754
|
+
const Se = $r(t, e, "transition"), Z = xe(!1), Pe = (u) => {
|
|
1755
|
+
Z.current || C || (Z.current = !0, x(null), G.mutate(u, {
|
|
1756
|
+
onSettled: (q, P) => {
|
|
1757
|
+
if (P) {
|
|
1758
|
+
Z.current = !1;
|
|
1669
1759
|
return;
|
|
1670
1760
|
}
|
|
1671
|
-
|
|
1672
|
-
|
|
1761
|
+
ye().finally(() => {
|
|
1762
|
+
Z.current = !1;
|
|
1673
1763
|
});
|
|
1674
1764
|
}
|
|
1675
1765
|
}));
|
|
1676
|
-
},
|
|
1677
|
-
var
|
|
1678
|
-
if (
|
|
1679
|
-
if (
|
|
1680
|
-
|
|
1766
|
+
}, ue = async (u, q) => {
|
|
1767
|
+
var ve, he;
|
|
1768
|
+
if (Z.current) return;
|
|
1769
|
+
if (C) {
|
|
1770
|
+
X.info(
|
|
1681
1771
|
o != null && o.as_user ? `Previewing as ${o.as_user.name}: moves are not made from a preview.` : "Previewing as a role: moves are not made from a preview."
|
|
1682
1772
|
);
|
|
1683
1773
|
return;
|
|
1684
1774
|
}
|
|
1685
1775
|
if (o != null && o.running_move) return;
|
|
1686
|
-
if (
|
|
1687
|
-
|
|
1776
|
+
if (H === u) {
|
|
1777
|
+
j(null);
|
|
1688
1778
|
return;
|
|
1689
1779
|
}
|
|
1690
|
-
if (!(
|
|
1691
|
-
|
|
1780
|
+
if (!(q != null && q.cleared) && ((o == null ? void 0 : o.available_transitions) ?? []).some((te) => te.id === u && te.advisory)) {
|
|
1781
|
+
j(null), x(null), re(u), N.invalidateQueries({ queryKey: ["pipeline-instance", t, e] });
|
|
1692
1782
|
return;
|
|
1693
1783
|
}
|
|
1694
|
-
if (re(null),
|
|
1695
|
-
|
|
1696
|
-
let
|
|
1784
|
+
if (re(null), f) {
|
|
1785
|
+
Z.current = !0;
|
|
1786
|
+
let te = !1;
|
|
1787
|
+
try {
|
|
1788
|
+
te = await f();
|
|
1789
|
+
} finally {
|
|
1790
|
+
Z.current = !1;
|
|
1791
|
+
}
|
|
1792
|
+
if (!te) return;
|
|
1793
|
+
}
|
|
1794
|
+
{
|
|
1795
|
+
Z.current = !0;
|
|
1796
|
+
let te = [];
|
|
1697
1797
|
try {
|
|
1698
|
-
|
|
1798
|
+
te = await ae.check();
|
|
1699
1799
|
} finally {
|
|
1700
|
-
|
|
1800
|
+
Z.current = !1;
|
|
1801
|
+
}
|
|
1802
|
+
if (U(te), te.length > 0) {
|
|
1803
|
+
J([]), j(u);
|
|
1804
|
+
return;
|
|
1701
1805
|
}
|
|
1702
|
-
if (!ie) return;
|
|
1703
1806
|
}
|
|
1704
|
-
const
|
|
1705
|
-
if (
|
|
1706
|
-
if (
|
|
1707
|
-
|
|
1708
|
-
let
|
|
1807
|
+
const P = (B ?? []).find((te) => te.id === u), I = String((P == null ? void 0 : P.comment_mode) ?? "none"), W = Ut(P, (o == null ? void 0 : o.states) ?? [], (ve = o == null ? void 0 : o.instance) == null ? void 0 : ve.current_state);
|
|
1808
|
+
if (I !== "optional" && I !== "required") {
|
|
1809
|
+
if (P && !at(P, (o == null ? void 0 : o.states) ?? [], (he = o == null ? void 0 : o.instance) == null ? void 0 : he.current_state)) {
|
|
1810
|
+
Z.current = !0;
|
|
1811
|
+
let te = [];
|
|
1709
1812
|
try {
|
|
1710
|
-
|
|
1813
|
+
te = await Y();
|
|
1711
1814
|
} finally {
|
|
1712
|
-
|
|
1815
|
+
Z.current = !1;
|
|
1713
1816
|
}
|
|
1714
|
-
if (
|
|
1715
|
-
|
|
1817
|
+
if (te.length > 0 || W) {
|
|
1818
|
+
J(te), j(u);
|
|
1716
1819
|
return;
|
|
1717
1820
|
}
|
|
1718
1821
|
}
|
|
1719
|
-
if (
|
|
1720
|
-
|
|
1822
|
+
if (W) {
|
|
1823
|
+
J([]), j(u);
|
|
1721
1824
|
return;
|
|
1722
1825
|
}
|
|
1723
|
-
|
|
1826
|
+
Pe({ transition_id: u });
|
|
1724
1827
|
return;
|
|
1725
1828
|
}
|
|
1726
|
-
|
|
1727
|
-
},
|
|
1728
|
-
queryKey:
|
|
1729
|
-
queryFn: () =>
|
|
1730
|
-
|
|
1731
|
-
`/pipelines/instance/${t}/${e}${
|
|
1829
|
+
J([]), j(u);
|
|
1830
|
+
}, ce = M ? ["pipeline-instance", t, e, "as-user", M] : v ? ["pipeline-instance", t, e, v] : ["pipeline-instance", t, e], { settling: ee, settle: ye } = Gn(ce), { data: o, isLoading: Ke } = ke({
|
|
1831
|
+
queryKey: ce,
|
|
1832
|
+
queryFn: () => E.request(
|
|
1833
|
+
qe(
|
|
1834
|
+
`/pipelines/instance/${t}/${e}${M ? `?as_user=${encodeURIComponent(M)}` : v ? `?as_role=${encodeURIComponent(v)}` : ""}`
|
|
1732
1835
|
)
|
|
1733
1836
|
).then(
|
|
1734
|
-
(
|
|
1837
|
+
(u) => u.data ?? {
|
|
1735
1838
|
instance: null,
|
|
1736
1839
|
states: [],
|
|
1737
1840
|
available_transitions: [],
|
|
@@ -1741,624 +1844,654 @@ function da({
|
|
|
1741
1844
|
}
|
|
1742
1845
|
),
|
|
1743
1846
|
staleTime: 1e4,
|
|
1744
|
-
refetchInterval: (
|
|
1847
|
+
refetchInterval: (u) => $n(u.state.data)
|
|
1745
1848
|
});
|
|
1746
|
-
|
|
1747
|
-
|
|
1849
|
+
Tn(!!(o != null && o.running_move), () => {
|
|
1850
|
+
Ve(N, t, String(e)), Xe(N, t, String(e)), pt(N, t, String(e));
|
|
1748
1851
|
});
|
|
1749
|
-
const
|
|
1750
|
-
o ? (o.available_transitions ?? []).map((
|
|
1852
|
+
const Re = Vn(
|
|
1853
|
+
o ? (o.available_transitions ?? []).map((u) => String(u.id)) : null,
|
|
1751
1854
|
`${t}:${e}`
|
|
1752
1855
|
);
|
|
1753
|
-
|
|
1754
|
-
() =>
|
|
1755
|
-
if (
|
|
1756
|
-
const
|
|
1757
|
-
Array.isArray(
|
|
1856
|
+
Ee(
|
|
1857
|
+
() => N.getQueryCache().subscribe((u) => {
|
|
1858
|
+
if (u.type !== "updated" || u.action.type !== "success") return;
|
|
1859
|
+
const q = u.query.queryKey;
|
|
1860
|
+
Array.isArray(q) && q[0] === "item" && q[1] === t && String(q[2]) === e && N.invalidateQueries({ queryKey: ["pipeline-instance", t, e] });
|
|
1758
1861
|
}),
|
|
1759
|
-
[
|
|
1862
|
+
[N, t, e]
|
|
1760
1863
|
);
|
|
1761
|
-
const { data:
|
|
1864
|
+
const { data: pe, isLoading: Oe } = ke({
|
|
1762
1865
|
queryKey: ["pipeline-all-owners", t, e],
|
|
1763
|
-
queryFn: () =>
|
|
1764
|
-
|
|
1765
|
-
).then((
|
|
1866
|
+
queryFn: () => E.request(
|
|
1867
|
+
qe(`/pipelines/instance/${t}/${e}/owners/all`)
|
|
1868
|
+
).then((u) => u.data ?? null),
|
|
1766
1869
|
// Also when a send back is on offer: its target may be a chain step this record skipped.
|
|
1767
1870
|
// And while a move is being confirmed: the panel names where it really lands.
|
|
1768
|
-
enabled: (
|
|
1871
|
+
enabled: (_ || tr(o) || !!H) && !!(o != null && o.instance),
|
|
1769
1872
|
staleTime: 3e4
|
|
1770
|
-
}),
|
|
1771
|
-
if (!
|
|
1772
|
-
const
|
|
1773
|
-
return
|
|
1774
|
-
}, [
|
|
1775
|
-
if (!
|
|
1776
|
-
const
|
|
1777
|
-
for (const [
|
|
1778
|
-
|
|
1779
|
-
return
|
|
1780
|
-
}, [
|
|
1781
|
-
mutationFn: () =>
|
|
1873
|
+
}), Ce = ut(() => {
|
|
1874
|
+
if (!pe) return null;
|
|
1875
|
+
const u = Object.entries(pe);
|
|
1876
|
+
return u.length === 0 || u.every(([, q]) => q.on_path === void 0) ? null : new Set(u.filter(([, q]) => q.on_path !== !1).map(([q]) => q));
|
|
1877
|
+
}, [pe]), d = ut(() => {
|
|
1878
|
+
if (!pe) return null;
|
|
1879
|
+
const u = /* @__PURE__ */ new Map();
|
|
1880
|
+
for (const [q, P] of Object.entries(pe))
|
|
1881
|
+
P.skipped && u.set(q, P.skip_reasons ?? []);
|
|
1882
|
+
return u;
|
|
1883
|
+
}, [pe]), L = Ye({
|
|
1884
|
+
mutationFn: () => E.request(rt(`/pipelines/instance/${t}/${e}/start`, {})),
|
|
1782
1885
|
onSuccess: () => {
|
|
1783
|
-
|
|
1886
|
+
N.invalidateQueries({ queryKey: ce }), X.success("Pipeline started");
|
|
1784
1887
|
},
|
|
1785
|
-
onError: () =>
|
|
1786
|
-
}),
|
|
1888
|
+
onError: () => X.error("Failed to start pipeline")
|
|
1889
|
+
}), G = Ye({
|
|
1787
1890
|
mutationFn: ({
|
|
1788
|
-
transition_id:
|
|
1789
|
-
comment:
|
|
1790
|
-
reviewed:
|
|
1791
|
-
lock_ack:
|
|
1792
|
-
}) =>
|
|
1793
|
-
|
|
1794
|
-
transition_id:
|
|
1795
|
-
comment:
|
|
1796
|
-
...
|
|
1797
|
-
...
|
|
1798
|
-
...
|
|
1891
|
+
transition_id: u,
|
|
1892
|
+
comment: q,
|
|
1893
|
+
reviewed: P,
|
|
1894
|
+
lock_ack: I
|
|
1895
|
+
}) => C ? Promise.reject(new Error("Moves are not made from a preview")) : E.request(
|
|
1896
|
+
rt(`/pipelines/instance/${t}/${e}/transition`, {
|
|
1897
|
+
transition_id: u,
|
|
1898
|
+
comment: q,
|
|
1899
|
+
...P ? { reviewed: !0 } : {},
|
|
1900
|
+
...I ? { lock_ack: !0 } : {},
|
|
1901
|
+
...qn(o == null ? void 0 : o.available_transitions, u)
|
|
1799
1902
|
})
|
|
1800
1903
|
),
|
|
1801
|
-
onMutate: (
|
|
1802
|
-
var
|
|
1904
|
+
onMutate: (u) => {
|
|
1905
|
+
var q;
|
|
1803
1906
|
return {
|
|
1804
|
-
slow:
|
|
1805
|
-
(
|
|
1806
|
-
(
|
|
1807
|
-
)) == null ? void 0 :
|
|
1907
|
+
slow: ar(
|
|
1908
|
+
(q = [...(o == null ? void 0 : o.available_transitions) ?? [], ...(o == null ? void 0 : o.all_transitions) ?? []].find(
|
|
1909
|
+
(P) => P.id === u.transition_id
|
|
1910
|
+
)) == null ? void 0 : q.label
|
|
1808
1911
|
)
|
|
1809
1912
|
};
|
|
1810
1913
|
},
|
|
1811
|
-
onSuccess: (
|
|
1812
|
-
|
|
1813
|
-
const
|
|
1814
|
-
|
|
1815
|
-
`${
|
|
1816
|
-
|
|
1817
|
-
) :
|
|
1914
|
+
onSuccess: (u, q, P) => {
|
|
1915
|
+
N.invalidateQueries({ queryKey: ce }), t === "nivaro_addendums" && N.invalidateQueries({ queryKey: ["addendums"] }), Ve(N, t, String(e)), Xe(N, t, String(e)), pt(N, t, String(e)), x(null), oe(""), j(null), K(null);
|
|
1916
|
+
const I = Mn(u);
|
|
1917
|
+
I ? X.info(
|
|
1918
|
+
`${I.transition_label ?? "The move"} started. You will be told if it does not go through.`,
|
|
1919
|
+
P == null ? void 0 : P.slow.done()
|
|
1920
|
+
) : X.success(rr(o, q.transition_id, u), P == null ? void 0 : P.slow.done());
|
|
1818
1921
|
},
|
|
1819
|
-
onError: (
|
|
1820
|
-
var
|
|
1821
|
-
if (
|
|
1822
|
-
|
|
1922
|
+
onError: (u, q, P) => {
|
|
1923
|
+
var te, Be;
|
|
1924
|
+
if (P == null || P.slow.fail(), Qn(u)) {
|
|
1925
|
+
N.invalidateQueries({ queryKey: ce });
|
|
1823
1926
|
return;
|
|
1824
1927
|
}
|
|
1825
|
-
if (
|
|
1826
|
-
|
|
1928
|
+
if (ht(u) === "TRANSITION_RUNNING") {
|
|
1929
|
+
N.invalidateQueries({ queryKey: ce }), j(null), K(null), X.info(Ie(u, "This move is already running on this record."));
|
|
1827
1930
|
return;
|
|
1828
1931
|
}
|
|
1829
|
-
const
|
|
1830
|
-
if (
|
|
1831
|
-
|
|
1832
|
-
const
|
|
1833
|
-
(
|
|
1834
|
-
)) == null ? void 0 :
|
|
1835
|
-
|
|
1932
|
+
const I = zn(u);
|
|
1933
|
+
if (I) {
|
|
1934
|
+
j(null);
|
|
1935
|
+
const $e = ((te = [...(o == null ? void 0 : o.available_transitions) ?? [], ...(o == null ? void 0 : o.all_transitions) ?? []].find(
|
|
1936
|
+
(it) => it.id === q.transition_id
|
|
1937
|
+
)) == null ? void 0 : te.label) ?? "Move";
|
|
1938
|
+
X.warning(I.message, {
|
|
1836
1939
|
id: `nvr-locked-move:${t}:${String(e)}`,
|
|
1837
1940
|
duration: 2e4,
|
|
1838
1941
|
action: {
|
|
1839
|
-
label: `${
|
|
1840
|
-
onClick: () =>
|
|
1942
|
+
label: `${$e} anyway`,
|
|
1943
|
+
onClick: () => Pe({ ...q, lock_ack: !0 })
|
|
1841
1944
|
},
|
|
1842
1945
|
cancel: { label: "Wait", onClick: () => {
|
|
1843
1946
|
} }
|
|
1844
1947
|
});
|
|
1845
1948
|
return;
|
|
1846
1949
|
}
|
|
1847
|
-
const
|
|
1848
|
-
if (
|
|
1849
|
-
|
|
1850
|
-
payload:
|
|
1851
|
-
transitionId:
|
|
1852
|
-
comment:
|
|
1853
|
-
revision: ((
|
|
1950
|
+
const W = Wn(u);
|
|
1951
|
+
if (W) {
|
|
1952
|
+
K(($e) => ({
|
|
1953
|
+
payload: W,
|
|
1954
|
+
transitionId: q.transition_id,
|
|
1955
|
+
comment: q.comment,
|
|
1956
|
+
revision: (($e == null ? void 0 : $e.revision) ?? 0) + 1
|
|
1854
1957
|
}));
|
|
1855
1958
|
return;
|
|
1856
1959
|
}
|
|
1857
|
-
const
|
|
1858
|
-
|
|
1859
|
-
const
|
|
1860
|
-
|
|
1861
|
-
(
|
|
1862
|
-
(
|
|
1863
|
-
)) == null ? void 0 :
|
|
1960
|
+
const ve = u == null ? void 0 : u.response;
|
|
1961
|
+
x(Hn(u, q));
|
|
1962
|
+
const he = bn(
|
|
1963
|
+
u,
|
|
1964
|
+
(Be = [...(o == null ? void 0 : o.available_transitions) ?? [], ...(o == null ? void 0 : o.all_transitions) ?? []].find(
|
|
1965
|
+
($e) => $e.id === q.transition_id
|
|
1966
|
+
)) == null ? void 0 : Be.label
|
|
1864
1967
|
);
|
|
1865
|
-
|
|
1968
|
+
X.error((he == null ? void 0 : he.title) ?? Ie(u, "Failed to execute transition"), {
|
|
1866
1969
|
duration: 12e3,
|
|
1867
1970
|
// What to do next + Copy details (lib/error-toast.ts); "Why?" below wins the action slot.
|
|
1868
1971
|
// A partner's refusal copies what the toast said and the other system's answer as
|
|
1869
1972
|
// stored, never the generic reading of a 422.
|
|
1870
|
-
...
|
|
1973
|
+
...hn(he ? vn(u, he) : u, {
|
|
1871
1974
|
action: "Transition"
|
|
1872
1975
|
}),
|
|
1873
|
-
...
|
|
1976
|
+
...he ? { description: he.description } : {},
|
|
1874
1977
|
// #1867: a refusal carries "Why?" — the role, owner or access rule
|
|
1875
1978
|
// that stopped it, and who can change it.
|
|
1876
|
-
...
|
|
1877
|
-
action:
|
|
1979
|
+
...Sn(u) ? {
|
|
1980
|
+
action: Cn(E, {
|
|
1878
1981
|
collection: t,
|
|
1879
1982
|
itemId: String(e),
|
|
1880
1983
|
action: "transition",
|
|
1881
|
-
transitionId:
|
|
1984
|
+
transitionId: q.transition_id
|
|
1882
1985
|
})
|
|
1883
1986
|
} : {}
|
|
1884
|
-
}),
|
|
1987
|
+
}), K(null), j(null), Ve(N, t, String(e)), Xe(N, t, String(e)), (ve == null ? void 0 : ve.status) === 409 && N.invalidateQueries({ queryKey: ce });
|
|
1885
1988
|
}
|
|
1886
|
-
}), l = xe(
|
|
1887
|
-
l.current =
|
|
1989
|
+
}), l = xe(ue);
|
|
1990
|
+
l.current = ue;
|
|
1888
1991
|
const h = xe((o == null ? void 0 : o.available_transitions) ?? []);
|
|
1889
|
-
|
|
1890
|
-
const
|
|
1891
|
-
const
|
|
1892
|
-
if (!
|
|
1893
|
-
|
|
1894
|
-
const
|
|
1895
|
-
if (!
|
|
1896
|
-
|
|
1992
|
+
h.current = (o == null ? void 0 : o.available_transitions) ?? [], Ee(() => {
|
|
1993
|
+
const u = (q) => {
|
|
1994
|
+
const P = q.detail;
|
|
1995
|
+
if (!P || P.claimed || C || P.collection !== t || String(P.item) !== String(e)) return;
|
|
1996
|
+
P.claimed = !0;
|
|
1997
|
+
const I = String(P.transition_id).toUpperCase(), W = h.current.find((ve) => String(ve.id).toUpperCase() === I);
|
|
1998
|
+
if (!W) {
|
|
1999
|
+
X.error("That step is not available from where the record is now");
|
|
1897
2000
|
return;
|
|
1898
2001
|
}
|
|
1899
|
-
l.current(
|
|
2002
|
+
l.current(W.id);
|
|
1900
2003
|
};
|
|
1901
|
-
return window.addEventListener(
|
|
1902
|
-
}, [t, e,
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
/* @__PURE__ */ n(
|
|
1907
|
-
/* @__PURE__ */ n(
|
|
2004
|
+
return window.addEventListener(mt, u), () => window.removeEventListener(mt, u);
|
|
2005
|
+
}, [t, e, C]);
|
|
2006
|
+
const w = qr(t, e, ((Wt = o == null ? void 0 : o.instance) == null ? void 0 : Wt.current_state) ?? null);
|
|
2007
|
+
if (Ke)
|
|
2008
|
+
return /* @__PURE__ */ n("div", { className: "overflow-hidden rounded-xl border border-slate-200 bg-white dark:border-border dark:bg-card", children: /* @__PURE__ */ i("div", { className: "flex w-full items-center gap-2.5 px-5 py-3.5", children: [
|
|
2009
|
+
/* @__PURE__ */ n(Ue, { className: "h-3.5 w-3.5 shrink-0 rounded" }),
|
|
2010
|
+
/* @__PURE__ */ n(Ue, { className: "h-4 w-20" }),
|
|
2011
|
+
/* @__PURE__ */ n(Ue, { className: "h-[22px] w-40 rounded-full" }),
|
|
2012
|
+
/* @__PURE__ */ n(Ue, { className: "ml-auto h-3.5 w-3.5 rounded" })
|
|
1908
2013
|
] }) });
|
|
1909
2014
|
if (!(o != null && o.binding)) return null;
|
|
1910
|
-
const { instance:
|
|
1911
|
-
(
|
|
1912
|
-
) : null,
|
|
2015
|
+
const { instance: b, available_transitions: B, history: se, states: z } = o, Q = new Map((z ?? []).map((u) => [u.id, u])), fe = (b == null ? void 0 : b.current_state_obj) ?? null, y = H ? (B ?? []).find((u) => u.id === H) : null, be = y ? Q.get(y.to_state) : null, De = dr(y, fe, z, pe), Ze = (De == null ? void 0 : De.state) ?? be, et = b != null && b.completed_at && B ? B.filter(
|
|
2016
|
+
(u) => u.from_state && String(u.from_state).toUpperCase() === String(b.current_state).toUpperCase()
|
|
2017
|
+
) : null, st = b != null && b.completed_at ? et ?? [] : nr(
|
|
1913
2018
|
B ?? [],
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
),
|
|
1918
|
-
const
|
|
1919
|
-
for (const
|
|
1920
|
-
const
|
|
1921
|
-
|
|
2019
|
+
z ?? [],
|
|
2020
|
+
b == null ? void 0 : b.current_state,
|
|
2021
|
+
d
|
|
2022
|
+
), gt = Rn(st, o.blocked_transitions), bt = gt.length > 0, Et = Dn(st), tt = A ? st.find((u) => u.id === A) : null, Fe = (o == null ? void 0 : o.running_move) ?? null, Ae = Fe ? null : (o == null ? void 0 : o.last_move_problem) ?? null, Lt = Ae ? st.find((u) => Pt(u.id, Ae.transition_id)) : null, It = (u, q = !1) => {
|
|
2023
|
+
const P = /* @__PURE__ */ new Map();
|
|
2024
|
+
for (const I of u) {
|
|
2025
|
+
const W = P.get(I.label) ?? [];
|
|
2026
|
+
W.push(I), P.set(I.label, W);
|
|
1922
2027
|
}
|
|
1923
|
-
return Array.from(
|
|
1924
|
-
var
|
|
1925
|
-
const
|
|
1926
|
-
(
|
|
1927
|
-
var
|
|
1928
|
-
return (((
|
|
2028
|
+
return Array.from(P.entries()).map(([I, W]) => {
|
|
2029
|
+
var $e, it, Vt;
|
|
2030
|
+
const ve = (($e = W[0]) == null ? void 0 : $e.color) ?? null, he = W.some((O) => O.id === H), te = (O) => ve ? O ? { backgroundColor: ve, borderColor: ve } : { borderColor: ve, color: ve } : void 0, Be = [...W].sort(
|
|
2031
|
+
(O, we) => {
|
|
2032
|
+
var Qe, nt;
|
|
2033
|
+
return (((Qe = Q.get(O.to_state)) == null ? void 0 : Qe.sort) ?? 999) - (((nt = Q.get(we.to_state)) == null ? void 0 : nt.sort) ?? 999);
|
|
1929
2034
|
}
|
|
1930
2035
|
);
|
|
1931
|
-
if (
|
|
2036
|
+
if (W.every(Fn))
|
|
1932
2037
|
return /* @__PURE__ */ n(
|
|
1933
|
-
|
|
2038
|
+
An,
|
|
1934
2039
|
{
|
|
1935
|
-
label:
|
|
1936
|
-
small:
|
|
1937
|
-
code: (
|
|
1938
|
-
reason:
|
|
1939
|
-
|
|
1940
|
-
(
|
|
1941
|
-
var
|
|
1942
|
-
return ((
|
|
2040
|
+
label: I,
|
|
2041
|
+
small: q,
|
|
2042
|
+
code: (it = Be[0].blocked) == null ? void 0 : it.code,
|
|
2043
|
+
reason: On(
|
|
2044
|
+
Be,
|
|
2045
|
+
(O) => {
|
|
2046
|
+
var we;
|
|
2047
|
+
return ((we = Q.get(Be[O].to_state)) == null ? void 0 : we.label) ?? Be[O].to_state;
|
|
1943
2048
|
}
|
|
1944
2049
|
)
|
|
1945
2050
|
},
|
|
1946
|
-
|
|
2051
|
+
I
|
|
1947
2052
|
);
|
|
1948
|
-
if (
|
|
1949
|
-
const
|
|
1950
|
-
|
|
2053
|
+
if (W.length === 1) {
|
|
2054
|
+
const O = W[0], we = G.isPending && ((Vt = G.variables) == null ? void 0 : Vt.transition_id) === O.id || Pt(Fe == null ? void 0 : Fe.transition_id, O.id), Qe = Pn(Ae, O.id), nt = /* @__PURE__ */ i(
|
|
2055
|
+
ge,
|
|
1951
2056
|
{
|
|
1952
2057
|
size: "sm",
|
|
1953
|
-
variant:
|
|
1954
|
-
className:
|
|
1955
|
-
|
|
2058
|
+
variant: he && !O.advisory ? "default" : "outline",
|
|
2059
|
+
className: le(
|
|
2060
|
+
q ? "h-7 text-[11px]" : "text-[12px]",
|
|
1956
2061
|
"gap-1.5 data-[fresh=true]:opacity-60",
|
|
1957
|
-
|
|
2062
|
+
O.advisory && sr
|
|
1958
2063
|
),
|
|
1959
|
-
style:
|
|
1960
|
-
disabled:
|
|
1961
|
-
"aria-disabled":
|
|
1962
|
-
"data-fresh":
|
|
1963
|
-
...
|
|
1964
|
-
...
|
|
2064
|
+
style: O.advisory ? void 0 : te(he),
|
|
2065
|
+
disabled: G.isPending || ee || !!Fe || !!Qe,
|
|
2066
|
+
"aria-disabled": Re.dimmed(O.id) || void 0,
|
|
2067
|
+
"data-fresh": Re.dimmed(O.id) || void 0,
|
|
2068
|
+
...Re.bind(O.id),
|
|
2069
|
+
...ze(O),
|
|
1965
2070
|
onClick: () => {
|
|
1966
|
-
|
|
2071
|
+
Re.press(O.id) && ue(O.id);
|
|
1967
2072
|
},
|
|
1968
2073
|
children: [
|
|
1969
|
-
|
|
1970
|
-
|
|
2074
|
+
we ? /* @__PURE__ */ n(Me, { className: "h-3 w-3 animate-spin" }) : O.advisory && /* @__PURE__ */ n(Te, {}),
|
|
2075
|
+
I
|
|
1971
2076
|
]
|
|
1972
2077
|
},
|
|
1973
|
-
|
|
2078
|
+
I
|
|
1974
2079
|
);
|
|
1975
|
-
return
|
|
2080
|
+
return Qe ? /* @__PURE__ */ n("span", { className: "inline-flex", "data-tip": Qe, "data-move-held": !0, children: nt }, I) : nt;
|
|
1976
2081
|
}
|
|
1977
|
-
return /* @__PURE__ */
|
|
1978
|
-
/* @__PURE__ */ n(
|
|
1979
|
-
|
|
2082
|
+
return /* @__PURE__ */ i(Nt, { children: [
|
|
2083
|
+
/* @__PURE__ */ n(St, { asChild: !0, children: /* @__PURE__ */ i(
|
|
2084
|
+
ge,
|
|
1980
2085
|
{
|
|
1981
2086
|
size: "sm",
|
|
1982
|
-
variant:
|
|
1983
|
-
className: `${
|
|
1984
|
-
style:
|
|
1985
|
-
disabled:
|
|
2087
|
+
variant: he ? "default" : "outline",
|
|
2088
|
+
className: `${q ? "h-7 text-[11px]" : "text-[12px]"} gap-1.5`,
|
|
2089
|
+
style: te(he),
|
|
2090
|
+
disabled: G.isPending || ee || !!Fe,
|
|
1986
2091
|
children: [
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
/* @__PURE__ */ n(
|
|
2092
|
+
W.every((O) => O.advisory) && /* @__PURE__ */ n(Te, {}),
|
|
2093
|
+
I,
|
|
2094
|
+
/* @__PURE__ */ n(Ge, { className: "h-3 w-3" })
|
|
1990
2095
|
]
|
|
1991
2096
|
}
|
|
1992
2097
|
) }),
|
|
1993
|
-
/* @__PURE__ */
|
|
1994
|
-
|
|
1995
|
-
var
|
|
1996
|
-
return /* @__PURE__ */
|
|
1997
|
-
|
|
2098
|
+
/* @__PURE__ */ i(Ct, { align: "start", children: [
|
|
2099
|
+
Be.map((O) => {
|
|
2100
|
+
var we;
|
|
2101
|
+
return /* @__PURE__ */ i(
|
|
2102
|
+
ot,
|
|
1998
2103
|
{
|
|
1999
|
-
onSelect: () =>
|
|
2000
|
-
...
|
|
2001
|
-
...
|
|
2104
|
+
onSelect: () => ue(O.id),
|
|
2105
|
+
...ze(O, "menu"),
|
|
2106
|
+
...dt(O),
|
|
2002
2107
|
children: [
|
|
2003
|
-
|
|
2108
|
+
O.color && /* @__PURE__ */ n(
|
|
2004
2109
|
"span",
|
|
2005
2110
|
{
|
|
2006
|
-
className:
|
|
2111
|
+
className: le(
|
|
2007
2112
|
"mr-2 inline-block h-2 w-2 shrink-0 rounded-full",
|
|
2008
|
-
|
|
2113
|
+
O.blocked && "opacity-40"
|
|
2009
2114
|
),
|
|
2010
|
-
style: { backgroundColor:
|
|
2115
|
+
style: { backgroundColor: O.color }
|
|
2011
2116
|
}
|
|
2012
2117
|
),
|
|
2013
|
-
((
|
|
2014
|
-
|
|
2015
|
-
|
|
2118
|
+
((we = Q.get(O.to_state)) == null ? void 0 : we.label) ?? O.to_state,
|
|
2119
|
+
O.advisory && /* @__PURE__ */ n(Te, { className: "ml-auto" }),
|
|
2120
|
+
O.blocked && /* @__PURE__ */ n(lt, {})
|
|
2016
2121
|
]
|
|
2017
2122
|
},
|
|
2018
|
-
|
|
2123
|
+
O.id
|
|
2019
2124
|
);
|
|
2020
2125
|
}),
|
|
2021
2126
|
/* @__PURE__ */ n(
|
|
2022
|
-
|
|
2127
|
+
At,
|
|
2023
2128
|
{
|
|
2024
|
-
moves:
|
|
2025
|
-
nameOf: (
|
|
2026
|
-
var
|
|
2027
|
-
return ((
|
|
2129
|
+
moves: W,
|
|
2130
|
+
nameOf: (O) => {
|
|
2131
|
+
var we;
|
|
2132
|
+
return ((we = Q.get(O.to_state)) == null ? void 0 : we.label) ?? O.to_state;
|
|
2028
2133
|
}
|
|
2029
2134
|
}
|
|
2030
2135
|
)
|
|
2031
2136
|
] })
|
|
2032
|
-
] },
|
|
2137
|
+
] }, I);
|
|
2033
2138
|
});
|
|
2034
|
-
},
|
|
2035
|
-
|
|
2139
|
+
}, vt = T ? /* @__PURE__ */ n(
|
|
2140
|
+
or,
|
|
2036
2141
|
{
|
|
2037
2142
|
collection: t,
|
|
2038
2143
|
item: String(e),
|
|
2039
|
-
offer:
|
|
2040
|
-
onDismiss: () =>
|
|
2041
|
-
onFixed: () =>
|
|
2144
|
+
offer: T,
|
|
2145
|
+
onDismiss: () => x(null),
|
|
2146
|
+
onFixed: () => Pe({ transition_id: T.transitionId, comment: T.comment })
|
|
2042
2147
|
}
|
|
2043
|
-
) : null,
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
{
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2148
|
+
) : null, mr = _ && !k && !!b && bt, jt = (u) => {
|
|
2149
|
+
var q;
|
|
2150
|
+
return /* @__PURE__ */ i(_e, { children: [
|
|
2151
|
+
Et.map(({ advisory: P, moves: I }) => /* @__PURE__ */ n(
|
|
2152
|
+
Bn,
|
|
2153
|
+
{
|
|
2154
|
+
collection: t,
|
|
2155
|
+
item: String(e),
|
|
2156
|
+
advisory: P,
|
|
2157
|
+
armedMove: tt && I.some((W) => W.id === tt.id) ? {
|
|
2158
|
+
id: tt.id,
|
|
2159
|
+
label: tt.label,
|
|
2160
|
+
confirms: ir(tt, z ?? [], b == null ? void 0 : b.current_state)
|
|
2161
|
+
} : null,
|
|
2162
|
+
stops: Et.length > 1 ? [...new Set(I.map((W) => W.label))] : void 0,
|
|
2163
|
+
className: u ? "rounded-lg border border-amber-200/80 px-3 dark:border-amber-500/20" : void 0,
|
|
2164
|
+
onDismiss: () => re(null),
|
|
2165
|
+
onFixed: (W) => {
|
|
2166
|
+
re(null), N.invalidateQueries({ queryKey: ce }), W && ue(W.id, { cleared: !0 });
|
|
2167
|
+
}
|
|
2168
|
+
},
|
|
2169
|
+
`${P.code}:${P.message}`
|
|
2170
|
+
)),
|
|
2171
|
+
Fe && /* @__PURE__ */ n(
|
|
2172
|
+
zr,
|
|
2173
|
+
{
|
|
2174
|
+
run: Fe,
|
|
2175
|
+
className: u ? "rounded-lg border border-sky-200/80 px-3 dark:border-sky-500/20" : void 0
|
|
2060
2176
|
}
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2177
|
+
),
|
|
2178
|
+
Ae && /* @__PURE__ */ n(
|
|
2179
|
+
Hr,
|
|
2180
|
+
{
|
|
2181
|
+
problem: Ae,
|
|
2182
|
+
retryDisabled: G.isPending || ee,
|
|
2183
|
+
onRetry: Lt ? () => void ue(Lt.id) : void 0,
|
|
2184
|
+
className: u ? "rounded-lg border border-amber-200/80 px-3 dark:border-amber-500/20" : void 0
|
|
2185
|
+
}
|
|
2186
|
+
),
|
|
2187
|
+
b && /* @__PURE__ */ n(
|
|
2188
|
+
Ur,
|
|
2189
|
+
{
|
|
2190
|
+
collection: t,
|
|
2191
|
+
item: e,
|
|
2192
|
+
skipIds: ((q = Ae == null ? void 0 : Ae.unanswered) == null ? void 0 : q.submission_id) != null ? [Ae.unanswered.submission_id] : void 0,
|
|
2193
|
+
className: u ? "rounded-lg border px-3" : void 0
|
|
2194
|
+
}
|
|
2195
|
+
)
|
|
2196
|
+
] });
|
|
2197
|
+
}, Kt = wa(se ?? [], b == null ? void 0 : b.current_state, z ?? []), Qt = /* @__PURE__ */ i("div", { className: "space-y-3 rounded-lg border border-slate-200 bg-slate-50 dark:bg-slate-900/30 dark:border-border p-3.5", children: [
|
|
2198
|
+
/* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
2082
2199
|
/* @__PURE__ */ n("span", { className: "text-[11px] font-semibold text-slate-400", children: "Confirming" }),
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
/* @__PURE__ */ n(
|
|
2086
|
-
/* @__PURE__ */ n(
|
|
2087
|
-
/* @__PURE__ */ n(
|
|
2200
|
+
y && /* @__PURE__ */ n("span", { className: "text-[12px] font-medium text-slate-700", children: y.label }),
|
|
2201
|
+
fe && Ze && /* @__PURE__ */ i("div", { className: "ml-auto flex items-center gap-1.5", children: [
|
|
2202
|
+
/* @__PURE__ */ n(Le, { label: fe.label, color: fe.color, small: !0 }),
|
|
2203
|
+
/* @__PURE__ */ n(Ot, { className: "h-3 w-3 shrink-0 text-slate-300" }),
|
|
2204
|
+
/* @__PURE__ */ n(Le, { label: Ze.label, color: Ze.color, small: !0 })
|
|
2088
2205
|
] })
|
|
2089
2206
|
] }),
|
|
2090
|
-
/* @__PURE__ */ n(
|
|
2091
|
-
/* @__PURE__ */ n(
|
|
2092
|
-
/* @__PURE__ */ n(
|
|
2093
|
-
/* @__PURE__ */ n(
|
|
2207
|
+
/* @__PURE__ */ n(cr, { landing: De }),
|
|
2208
|
+
/* @__PURE__ */ n(er, { collection: t, item: String(e), tx: y }),
|
|
2209
|
+
/* @__PURE__ */ n(ur, { collection: t, item: e, omitLines: m }),
|
|
2210
|
+
/* @__PURE__ */ n(Zn, { lines: m }),
|
|
2211
|
+
/* @__PURE__ */ n(jn, { changes: Ne }),
|
|
2094
2212
|
/* @__PURE__ */ n(
|
|
2095
2213
|
"input",
|
|
2096
2214
|
{
|
|
2097
2215
|
type: "text",
|
|
2098
|
-
value:
|
|
2099
|
-
onChange: (
|
|
2100
|
-
placeholder: String((
|
|
2216
|
+
value: de,
|
|
2217
|
+
onChange: (u) => oe(u.target.value),
|
|
2218
|
+
placeholder: String((y == null ? void 0 : y.comment_mode) ?? "") === "required" ? "Add a note (required)" : "Add a comment (optional)",
|
|
2101
2219
|
className: "w-full rounded-md border border-slate-200 bg-white px-3 py-1.5 text-[13px] placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-nvr-cyan/30"
|
|
2102
2220
|
}
|
|
2103
2221
|
),
|
|
2104
|
-
/* @__PURE__ */
|
|
2222
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-end gap-2", children: [
|
|
2105
2223
|
/* @__PURE__ */ n(
|
|
2106
|
-
|
|
2224
|
+
ge,
|
|
2107
2225
|
{
|
|
2108
2226
|
type: "button",
|
|
2109
2227
|
size: "sm",
|
|
2110
2228
|
variant: "ghost",
|
|
2111
2229
|
className: "h-7 text-[12px]",
|
|
2112
|
-
onClick: () =>
|
|
2113
|
-
|
|
2230
|
+
onClick: () => {
|
|
2231
|
+
Ne.length > 0 && ae.review(), j(null);
|
|
2232
|
+
},
|
|
2233
|
+
children: Ne.length > 0 ? "Review" : "Cancel"
|
|
2114
2234
|
}
|
|
2115
2235
|
),
|
|
2116
2236
|
/* @__PURE__ */ n(
|
|
2117
|
-
|
|
2237
|
+
ge,
|
|
2118
2238
|
{
|
|
2119
2239
|
type: "button",
|
|
2120
2240
|
size: "sm",
|
|
2121
2241
|
className: "h-7 gap-1.5 text-[12px]",
|
|
2122
|
-
disabled:
|
|
2123
|
-
onClick: () =>
|
|
2124
|
-
transition_id:
|
|
2125
|
-
comment:
|
|
2242
|
+
disabled: G.isPending || !!Fe || String((y == null ? void 0 : y.comment_mode) ?? "") === "required" && de.trim() === "",
|
|
2243
|
+
onClick: () => Pe({
|
|
2244
|
+
transition_id: H,
|
|
2245
|
+
comment: de.trim() || void 0
|
|
2126
2246
|
}),
|
|
2127
|
-
children:
|
|
2128
|
-
/* @__PURE__ */ n("span", { children:
|
|
2129
|
-
/* @__PURE__ */ n(
|
|
2247
|
+
children: G.isPending ? /* @__PURE__ */ n(Me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ i(_e, { children: [
|
|
2248
|
+
/* @__PURE__ */ n("span", { children: Ne.length > 0 ? "Continue" : m.length > 0 && y ? `${y.label} anyway` : "Confirm" }),
|
|
2249
|
+
/* @__PURE__ */ n(ft, { className: "h-3 w-3" })
|
|
2130
2250
|
] })
|
|
2131
2251
|
}
|
|
2132
2252
|
)
|
|
2133
2253
|
] })
|
|
2134
2254
|
] });
|
|
2135
|
-
return /* @__PURE__ */
|
|
2136
|
-
/* @__PURE__ */
|
|
2255
|
+
return /* @__PURE__ */ i(_e, { children: [
|
|
2256
|
+
/* @__PURE__ */ i(
|
|
2137
2257
|
"div",
|
|
2138
2258
|
{
|
|
2139
|
-
className: `overflow-hidden rounded-xl border bg-white dark:bg-card ${
|
|
2259
|
+
className: `overflow-hidden rounded-xl border bg-white dark:bg-card ${S ? "border-amber-300 dark:border-amber-600/50" : "border-slate-200 dark:border-border"}`,
|
|
2140
2260
|
children: [
|
|
2141
|
-
/* @__PURE__ */
|
|
2261
|
+
/* @__PURE__ */ i(
|
|
2142
2262
|
"div",
|
|
2143
2263
|
{
|
|
2144
2264
|
role: "button",
|
|
2145
2265
|
tabIndex: 0,
|
|
2146
|
-
onClick: () =>
|
|
2147
|
-
onKeyDown: (
|
|
2266
|
+
onClick: () => F((u) => !u),
|
|
2267
|
+
onKeyDown: (u) => (u.key === "Enter" || u.key === " ") && F((q) => !q),
|
|
2148
2268
|
className: "flex w-full cursor-pointer items-center gap-2.5 px-5 py-3.5 transition-colors hover:bg-slate-50/50 dark:hover:bg-white/[0.02]",
|
|
2149
2269
|
children: [
|
|
2150
|
-
/* @__PURE__ */ n(
|
|
2270
|
+
/* @__PURE__ */ n(wt, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
|
|
2151
2271
|
/* @__PURE__ */ n("span", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children: a || "Pipeline" }),
|
|
2152
|
-
/* @__PURE__ */
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2272
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: [
|
|
2273
|
+
S && /* @__PURE__ */ n("span", { className: "flex items-center gap-1 rounded-full border border-amber-200 bg-amber-50 px-2 py-0.5 text-[11px] font-medium text-amber-700 dark:border-amber-500/20 dark:bg-amber-500/10 dark:text-amber-400", children: "Addendum workflow" }),
|
|
2274
|
+
fe && /* @__PURE__ */ n(Le, { label: fe.label, color: fe.color }),
|
|
2275
|
+
fe && !(b != null && b.completed_at) && /* @__PURE__ */ n(
|
|
2276
|
+
Dr,
|
|
2277
|
+
{
|
|
2278
|
+
stepLabel: fe.label,
|
|
2279
|
+
enteredAt: Sr(
|
|
2280
|
+
b == null ? void 0 : b.current_state,
|
|
2281
|
+
se,
|
|
2282
|
+
(b == null ? void 0 : b.started_at) ?? null
|
|
2283
|
+
)
|
|
2284
|
+
}
|
|
2285
|
+
),
|
|
2286
|
+
/* @__PURE__ */ n(va, { flags: o == null ? void 0 : o.flags }),
|
|
2287
|
+
(((zt = o == null ? void 0 : o.auto_held) == null ? void 0 : zt.length) ?? 0) > 0 && /* @__PURE__ */ i(
|
|
2157
2288
|
"span",
|
|
2158
2289
|
{
|
|
2159
2290
|
className: "flex items-center gap-1 rounded-full border border-amber-200 bg-amber-50 px-2 py-0.5 text-[11px] font-medium text-amber-700 dark:border-amber-500/20 dark:bg-amber-500/10 dark:text-amber-400",
|
|
2160
|
-
"data-tip": ((o == null ? void 0 : o.auto_held) ?? []).map((
|
|
2291
|
+
"data-tip": ((o == null ? void 0 : o.auto_held) ?? []).map((u) => `${u.transition_label ?? "Automatic move"}: ${u.error ?? "refused"}`).join(`
|
|
2161
2292
|
`),
|
|
2162
2293
|
"data-pipeline-auto-held-pill": !0,
|
|
2163
2294
|
children: [
|
|
2164
|
-
/* @__PURE__ */ n(
|
|
2295
|
+
/* @__PURE__ */ n(ln, { className: "h-3 w-3 shrink-0" }),
|
|
2165
2296
|
"Needs a person"
|
|
2166
2297
|
]
|
|
2167
2298
|
}
|
|
2168
2299
|
),
|
|
2169
|
-
p && /* @__PURE__ */
|
|
2300
|
+
p && /* @__PURE__ */ i("span", { className: "flex items-center gap-1 rounded-full bg-amber-50 px-2 py-0.5 text-[11px] font-medium text-amber-700 border border-amber-200 dark:bg-amber-500/10 dark:text-amber-400 dark:border-amber-500/20", children: [
|
|
2170
2301
|
/* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400 animate-pulse shrink-0" }),
|
|
2171
2302
|
"Addendum in review"
|
|
2172
2303
|
] }),
|
|
2173
|
-
|
|
2304
|
+
Se.length > 0 && /* @__PURE__ */ i(
|
|
2174
2305
|
"span",
|
|
2175
2306
|
{
|
|
2176
2307
|
className: "flex items-center gap-1 rounded-full border border-sky-200 bg-sky-50 px-2 py-0.5 text-[11px] font-medium text-sky-700 dark:border-sky-500/20 dark:bg-sky-500/10 dark:text-sky-300",
|
|
2177
2308
|
"data-pipeline-approving": !0,
|
|
2178
2309
|
children: [
|
|
2179
2310
|
/* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 shrink-0 animate-pulse rounded-full bg-sky-400" }),
|
|
2180
|
-
|
|
2311
|
+
Tr(Se, "approving")
|
|
2181
2312
|
]
|
|
2182
2313
|
}
|
|
2183
2314
|
)
|
|
2184
2315
|
] }),
|
|
2185
|
-
/* @__PURE__ */
|
|
2186
|
-
!
|
|
2187
|
-
!
|
|
2188
|
-
|
|
2316
|
+
/* @__PURE__ */ i("div", { className: "ml-auto flex items-center gap-2", onClick: (u) => u.stopPropagation(), children: [
|
|
2317
|
+
!_ && bt && !c && /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-1.5", children: It(gt, !0) }),
|
|
2318
|
+
!_ && !b && (o == null ? void 0 : o.binding) && /* @__PURE__ */ i(
|
|
2319
|
+
ge,
|
|
2189
2320
|
{
|
|
2190
2321
|
size: "sm",
|
|
2191
2322
|
variant: "outline",
|
|
2192
2323
|
className: "h-7 gap-1.5 text-[11px]",
|
|
2193
|
-
onClick: (
|
|
2194
|
-
|
|
2324
|
+
onClick: (u) => {
|
|
2325
|
+
u.stopPropagation(), L.mutate();
|
|
2195
2326
|
},
|
|
2196
|
-
disabled:
|
|
2327
|
+
disabled: L.isPending,
|
|
2197
2328
|
children: [
|
|
2198
|
-
|
|
2329
|
+
L.isPending ? /* @__PURE__ */ n(Me, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ n(wt, { className: "h-3 w-3" }),
|
|
2199
2330
|
"Start"
|
|
2200
2331
|
]
|
|
2201
2332
|
}
|
|
2202
2333
|
),
|
|
2203
|
-
|
|
2204
|
-
|
|
2334
|
+
s && ((o == null ? void 0 : o.binding) || (o == null ? void 0 : o.instance)) && /* @__PURE__ */ n(
|
|
2335
|
+
$a,
|
|
2205
2336
|
{
|
|
2206
2337
|
collection: t,
|
|
2207
2338
|
item: e,
|
|
2208
|
-
states:
|
|
2209
|
-
currentStateId: ((
|
|
2339
|
+
states: z ?? [],
|
|
2340
|
+
currentStateId: ((Ht = o == null ? void 0 : o.instance) == null ? void 0 : Ht.current_state) ?? null,
|
|
2341
|
+
history: (o == null ? void 0 : o.history) ?? []
|
|
2210
2342
|
}
|
|
2211
2343
|
)
|
|
2212
2344
|
] }),
|
|
2213
2345
|
/* @__PURE__ */ n(
|
|
2214
|
-
|
|
2346
|
+
Ge,
|
|
2215
2347
|
{
|
|
2216
|
-
className:
|
|
2348
|
+
className: le(
|
|
2217
2349
|
"h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform duration-150",
|
|
2218
|
-
|
|
2350
|
+
_ && "rotate-180"
|
|
2219
2351
|
)
|
|
2220
2352
|
}
|
|
2221
2353
|
)
|
|
2222
2354
|
]
|
|
2223
2355
|
}
|
|
2224
2356
|
),
|
|
2225
|
-
!
|
|
2226
|
-
!
|
|
2227
|
-
!
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
/* @__PURE__ */ n(
|
|
2231
|
-
p && /* @__PURE__ */
|
|
2357
|
+
!mr && jt(!1),
|
|
2358
|
+
!_ && H && /* @__PURE__ */ n("div", { className: "border-t border-slate-100 dark:border-border/60 px-4 py-3", children: Qt }),
|
|
2359
|
+
!_ && vt && /* @__PURE__ */ n("div", { className: "border-t border-slate-100 dark:border-border/60 px-4 py-3", children: vt }),
|
|
2360
|
+
Kt && !(b != null && b.completed_at) && /* @__PURE__ */ n(ya, { entry: Kt }),
|
|
2361
|
+
_ && /* @__PURE__ */ i("div", { className: "border-t border-slate-100 dark:border-border/60", children: [
|
|
2362
|
+
/* @__PURE__ */ n(ua, { held: (o == null ? void 0 : o.auto_held) ?? [] }),
|
|
2363
|
+
p && /* @__PURE__ */ i("div", { className: "flex items-center gap-2 border-b border-amber-100 bg-amber-50 px-5 py-2.5 dark:border-amber-500/20 dark:bg-amber-500/10", children: [
|
|
2232
2364
|
/* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400 shrink-0" }),
|
|
2233
2365
|
/* @__PURE__ */ n("p", { className: "text-[12px] text-amber-700 dark:text-amber-400", children: "An addendum is in review — coordinate transitions carefully." })
|
|
2234
2366
|
] }),
|
|
2235
|
-
|
|
2236
|
-
(
|
|
2237
|
-
|
|
2367
|
+
b ? /* @__PURE__ */ i("div", { className: "divide-y divide-slate-100 dark:divide-border/60", children: [
|
|
2368
|
+
(z ?? []).length > 1 && /* @__PURE__ */ i("div", { className: "space-y-3 px-5 py-4", children: [
|
|
2369
|
+
Oe ? (
|
|
2238
2370
|
// Path pruning arrives with the owners query — rendering
|
|
2239
2371
|
// the UNPRUNED track first meant every state briefly
|
|
2240
2372
|
// showed, then snapped into formation. Hold a same-height
|
|
2241
2373
|
// placeholder until the real shape is known.
|
|
2242
|
-
/* @__PURE__ */
|
|
2243
|
-
[0, 1, 2, 3, 4].map((
|
|
2244
|
-
/* @__PURE__ */ n(
|
|
2245
|
-
|
|
2246
|
-
] },
|
|
2247
|
-
/* @__PURE__ */ n(
|
|
2374
|
+
/* @__PURE__ */ i("div", { className: "flex h-[52px] items-center gap-2", children: [
|
|
2375
|
+
[0, 1, 2, 3, 4].map((u) => /* @__PURE__ */ i("span", { className: "flex items-center gap-2", children: [
|
|
2376
|
+
/* @__PURE__ */ n(Ue, { className: "h-7 w-7 rounded-full" }),
|
|
2377
|
+
u < 4 && /* @__PURE__ */ n(Ue, { className: "h-0.5 w-10" })
|
|
2378
|
+
] }, u)),
|
|
2379
|
+
/* @__PURE__ */ n(Ue, { className: "ml-2 h-3 w-24" })
|
|
2248
2380
|
] })
|
|
2249
2381
|
) : /* @__PURE__ */ n(
|
|
2250
|
-
|
|
2382
|
+
Na,
|
|
2251
2383
|
{
|
|
2252
|
-
states:
|
|
2384
|
+
states: z,
|
|
2253
2385
|
allTransitions: (o == null ? void 0 : o.all_transitions) ?? [],
|
|
2254
2386
|
availableTransitions: B ?? [],
|
|
2255
|
-
currentStateId:
|
|
2256
|
-
history:
|
|
2257
|
-
onPathIds:
|
|
2258
|
-
skippedStates:
|
|
2387
|
+
currentStateId: b.current_state,
|
|
2388
|
+
history: se ?? [],
|
|
2389
|
+
onPathIds: Ce,
|
|
2390
|
+
skippedStates: d,
|
|
2391
|
+
travel: w
|
|
2259
2392
|
}
|
|
2260
2393
|
),
|
|
2261
|
-
(o == null ? void 0 : o.branches) && /* @__PURE__ */ n(
|
|
2394
|
+
(o == null ? void 0 : o.branches) && /* @__PURE__ */ n(Gr, { data: o.branches }),
|
|
2262
2395
|
/* @__PURE__ */ n(
|
|
2263
|
-
|
|
2396
|
+
_a,
|
|
2264
2397
|
{
|
|
2265
|
-
history:
|
|
2266
|
-
completedAt:
|
|
2398
|
+
history: se ?? [],
|
|
2399
|
+
completedAt: b.completed_at,
|
|
2267
2400
|
collection: t,
|
|
2268
2401
|
item: String(e)
|
|
2269
2402
|
}
|
|
2270
2403
|
)
|
|
2271
2404
|
] }),
|
|
2272
|
-
/* @__PURE__ */
|
|
2273
|
-
!
|
|
2274
|
-
!
|
|
2405
|
+
/* @__PURE__ */ i("div", { className: "space-y-3 px-5 py-4", children: [
|
|
2406
|
+
!b.completed_at && /* @__PURE__ */ n(ia, { collection: t, itemId: String(e) }),
|
|
2407
|
+
!b.completed_at && /* @__PURE__ */ n(na, { summaries: o == null ? void 0 : o.sign_offs }),
|
|
2275
2408
|
/* @__PURE__ */ n(
|
|
2276
|
-
|
|
2409
|
+
Ca,
|
|
2277
2410
|
{
|
|
2278
2411
|
collection: t,
|
|
2279
2412
|
item: e,
|
|
2280
|
-
states:
|
|
2281
|
-
currentStateId: ((
|
|
2413
|
+
states: z ?? [],
|
|
2414
|
+
currentStateId: ((Gt = o == null ? void 0 : o.instance) == null ? void 0 : Gt.current_state) ?? null,
|
|
2282
2415
|
returned: ((o == null ? void 0 : o.history) ?? []).some(
|
|
2283
|
-
(
|
|
2284
|
-
var
|
|
2285
|
-
return !!
|
|
2416
|
+
(u) => {
|
|
2417
|
+
var q;
|
|
2418
|
+
return !!u.from_state && u.to_state === ((q = o == null ? void 0 : o.instance) == null ? void 0 : q.current_state);
|
|
2286
2419
|
}
|
|
2287
2420
|
),
|
|
2288
2421
|
standInReason: (o == null ? void 0 : o.stand_in_reason) ?? null
|
|
2289
2422
|
}
|
|
2290
2423
|
)
|
|
2291
2424
|
] }),
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
/* @__PURE__ */ n("div", { className: "flex flex-wrap justify-end gap-2", children:
|
|
2295
|
-
|
|
2296
|
-
|
|
2425
|
+
bt && !k && /* @__PURE__ */ i("div", { className: "space-y-3 px-5 py-4", children: [
|
|
2426
|
+
jt(!0),
|
|
2427
|
+
/* @__PURE__ */ n("div", { className: "flex flex-wrap justify-end gap-2", children: It(gt) }),
|
|
2428
|
+
H && Qt,
|
|
2429
|
+
vt
|
|
2297
2430
|
] }),
|
|
2298
|
-
/* @__PURE__ */
|
|
2299
|
-
/* @__PURE__ */
|
|
2431
|
+
/* @__PURE__ */ i("div", { className: "px-5 py-3", children: [
|
|
2432
|
+
/* @__PURE__ */ i(
|
|
2300
2433
|
"button",
|
|
2301
2434
|
{
|
|
2302
2435
|
type: "button",
|
|
2303
2436
|
className: "flex items-center gap-1.5 text-[12px] text-slate-400 transition-colors hover:text-slate-600",
|
|
2304
|
-
onClick: () =>
|
|
2437
|
+
onClick: () => D((u) => !u),
|
|
2305
2438
|
children: [
|
|
2306
2439
|
/* @__PURE__ */ n(
|
|
2307
|
-
|
|
2440
|
+
Ge,
|
|
2308
2441
|
{
|
|
2309
|
-
className:
|
|
2442
|
+
className: le(
|
|
2310
2443
|
"h-3.5 w-3.5 transition-transform duration-200",
|
|
2311
|
-
|
|
2444
|
+
g && "rotate-180"
|
|
2312
2445
|
)
|
|
2313
2446
|
}
|
|
2314
2447
|
),
|
|
2315
2448
|
"Transition history",
|
|
2316
2449
|
" ",
|
|
2317
|
-
/* @__PURE__ */
|
|
2450
|
+
/* @__PURE__ */ i("span", { className: "tabular-nums", children: [
|
|
2318
2451
|
"(",
|
|
2319
|
-
(
|
|
2452
|
+
(se == null ? void 0 : se.length) ?? 0,
|
|
2320
2453
|
")"
|
|
2321
2454
|
] })
|
|
2322
2455
|
]
|
|
2323
2456
|
}
|
|
2324
2457
|
),
|
|
2325
|
-
|
|
2326
|
-
|
|
2458
|
+
g && /* @__PURE__ */ n("div", { className: "mt-3", children: /* @__PURE__ */ n(
|
|
2459
|
+
Sa,
|
|
2327
2460
|
{
|
|
2328
|
-
history:
|
|
2461
|
+
history: se ?? [],
|
|
2329
2462
|
collection: t,
|
|
2330
2463
|
item: String(e),
|
|
2331
|
-
completedAt:
|
|
2464
|
+
completedAt: b.completed_at
|
|
2332
2465
|
}
|
|
2333
2466
|
) })
|
|
2334
2467
|
] }),
|
|
2335
|
-
|
|
2336
|
-
|
|
2468
|
+
R && (z ?? []).length > 1 && /* @__PURE__ */ n("div", { className: "px-5 py-3", ref: me, children: /* @__PURE__ */ n(
|
|
2469
|
+
Zr,
|
|
2337
2470
|
{
|
|
2338
2471
|
collection: t,
|
|
2339
2472
|
item: e,
|
|
2340
|
-
states:
|
|
2341
|
-
currentStateId:
|
|
2342
|
-
openSignal:
|
|
2473
|
+
states: z ?? [],
|
|
2474
|
+
currentStateId: b.current_state ?? null,
|
|
2475
|
+
openSignal: ne,
|
|
2343
2476
|
onMoved: () => {
|
|
2344
|
-
|
|
2477
|
+
N.invalidateQueries({ queryKey: ce }), N.invalidateQueries({
|
|
2345
2478
|
queryKey: ["pipeline-instance", t, e]
|
|
2346
2479
|
});
|
|
2347
2480
|
}
|
|
2348
2481
|
}
|
|
2349
2482
|
) })
|
|
2350
|
-
] }) : /* @__PURE__ */
|
|
2483
|
+
] }) : /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-4 px-5 py-4", children: [
|
|
2351
2484
|
/* @__PURE__ */ n("p", { className: "text-[13px] text-slate-500", children: "Pipeline not started for this record." }),
|
|
2352
|
-
/* @__PURE__ */
|
|
2353
|
-
|
|
2485
|
+
/* @__PURE__ */ i(
|
|
2486
|
+
ge,
|
|
2354
2487
|
{
|
|
2355
2488
|
size: "sm",
|
|
2356
2489
|
variant: "outline",
|
|
2357
2490
|
className: "shrink-0 gap-1.5 text-[12px]",
|
|
2358
|
-
onClick: () =>
|
|
2359
|
-
disabled:
|
|
2491
|
+
onClick: () => L.mutate(),
|
|
2492
|
+
disabled: L.isPending,
|
|
2360
2493
|
children: [
|
|
2361
|
-
|
|
2494
|
+
L.isPending ? /* @__PURE__ */ n(Me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ n(wt, { className: "h-3.5 w-3.5" }),
|
|
2362
2495
|
"Start Pipeline"
|
|
2363
2496
|
]
|
|
2364
2497
|
}
|
|
@@ -2368,127 +2501,140 @@ function da({
|
|
|
2368
2501
|
]
|
|
2369
2502
|
}
|
|
2370
2503
|
),
|
|
2371
|
-
|
|
2372
|
-
|
|
2504
|
+
$ && /* @__PURE__ */ n(mn, { fallback: null, children: /* @__PURE__ */ n(
|
|
2505
|
+
Kn,
|
|
2373
2506
|
{
|
|
2374
|
-
payload:
|
|
2375
|
-
transitionId:
|
|
2376
|
-
isRetry:
|
|
2507
|
+
payload: $.payload,
|
|
2508
|
+
transitionId: $.transitionId,
|
|
2509
|
+
isRetry: $.revision > 1,
|
|
2377
2510
|
onSubmitted: () => (
|
|
2378
2511
|
// mutateAsync so the dialog can stay busy until the transition
|
|
2379
2512
|
// settles; the mutation's own onError/onSuccess handle the outcome.
|
|
2380
|
-
|
|
2381
|
-
transition_id:
|
|
2382
|
-
comment:
|
|
2513
|
+
G.mutateAsync({
|
|
2514
|
+
transition_id: $.transitionId,
|
|
2515
|
+
comment: $.comment,
|
|
2383
2516
|
reviewed: !0
|
|
2384
2517
|
}).catch(() => {
|
|
2385
2518
|
})
|
|
2386
2519
|
),
|
|
2387
|
-
executing:
|
|
2388
|
-
onClose: () =>
|
|
2520
|
+
executing: G.isPending,
|
|
2521
|
+
onClose: () => K(null)
|
|
2389
2522
|
},
|
|
2390
|
-
|
|
2523
|
+
$.revision
|
|
2391
2524
|
) })
|
|
2392
2525
|
] });
|
|
2393
2526
|
}
|
|
2394
|
-
function
|
|
2527
|
+
function Ts({
|
|
2395
2528
|
collection: t,
|
|
2396
2529
|
item: e,
|
|
2397
2530
|
onBeforeTransition: r,
|
|
2398
2531
|
wrap: a = !0,
|
|
2399
|
-
asRole:
|
|
2400
|
-
asUser:
|
|
2532
|
+
asRole: s,
|
|
2533
|
+
asUser: c
|
|
2401
2534
|
}) {
|
|
2402
2535
|
return e === "new" ? null : /* @__PURE__ */ n(
|
|
2403
|
-
|
|
2536
|
+
Ma,
|
|
2404
2537
|
{
|
|
2405
2538
|
collection: t,
|
|
2406
2539
|
item: e,
|
|
2407
2540
|
onBeforeTransition: r,
|
|
2408
2541
|
wrap: a,
|
|
2409
|
-
asRole:
|
|
2410
|
-
asUser:
|
|
2542
|
+
asRole: s,
|
|
2543
|
+
asUser: c
|
|
2411
2544
|
}
|
|
2412
2545
|
);
|
|
2413
2546
|
}
|
|
2414
|
-
function
|
|
2547
|
+
function Ma({
|
|
2415
2548
|
collection: t,
|
|
2416
2549
|
item: e,
|
|
2417
2550
|
onBeforeTransition: r,
|
|
2418
2551
|
wrap: a = !0,
|
|
2419
|
-
asRole:
|
|
2420
|
-
asUser:
|
|
2552
|
+
asRole: s,
|
|
2553
|
+
asUser: c
|
|
2421
2554
|
}) {
|
|
2422
|
-
const
|
|
2423
|
-
|
|
2424
|
-
const
|
|
2425
|
-
|
|
2426
|
-
onSettled: (h,
|
|
2427
|
-
if (
|
|
2428
|
-
|
|
2555
|
+
const k = !!s || !!c, f = je(), p = Je(), [S, v] = V(""), [M, C] = V(null), [E, N] = V(null), [R, ne] = V(null), [ie, me] = V(null), [de, oe] = V([]), H = Jn(t, String(e)), [j, g] = V([]), D = In(t, String(e));
|
|
2556
|
+
xn(t, e, "transition", !!M || !!E), gn(t, e, { hold: !!M || !!E });
|
|
2557
|
+
const _ = xe(null), F = Er(_, !a), $ = xe(!1), K = (l) => {
|
|
2558
|
+
$.current || k || ($.current = !0, ne(null), U.mutate(l, {
|
|
2559
|
+
onSettled: (h, w) => {
|
|
2560
|
+
if (w) {
|
|
2561
|
+
$.current = !1;
|
|
2429
2562
|
return;
|
|
2430
2563
|
}
|
|
2431
|
-
|
|
2432
|
-
|
|
2564
|
+
re().finally(() => {
|
|
2565
|
+
$.current = !1;
|
|
2433
2566
|
});
|
|
2434
2567
|
}
|
|
2435
2568
|
}));
|
|
2436
|
-
},
|
|
2437
|
-
var
|
|
2438
|
-
if (
|
|
2439
|
-
if (
|
|
2440
|
-
|
|
2441
|
-
|
|
2569
|
+
}, T = async (l, h) => {
|
|
2570
|
+
var se, z;
|
|
2571
|
+
if ($.current) return;
|
|
2572
|
+
if (k) {
|
|
2573
|
+
X.info(
|
|
2574
|
+
m != null && m.as_user ? `Previewing as ${m.as_user.name}: moves are not made from a preview.` : "Previewing as a role: moves are not made from a preview."
|
|
2442
2575
|
);
|
|
2443
2576
|
return;
|
|
2444
2577
|
}
|
|
2445
|
-
if (
|
|
2446
|
-
if (
|
|
2447
|
-
|
|
2578
|
+
if (m != null && m.running_move) return;
|
|
2579
|
+
if (M === l) {
|
|
2580
|
+
C(null);
|
|
2448
2581
|
return;
|
|
2449
2582
|
}
|
|
2450
|
-
if (!(h != null && h.cleared) && ((
|
|
2451
|
-
|
|
2583
|
+
if (!(h != null && h.cleared) && ((m == null ? void 0 : m.available_transitions) ?? []).some((Q) => Q.id === l && Q.advisory)) {
|
|
2584
|
+
C(null), ne(null), me(l), p.invalidateQueries({ queryKey: ["pipeline-instance", t, e] });
|
|
2452
2585
|
return;
|
|
2453
2586
|
}
|
|
2454
|
-
if (
|
|
2455
|
-
|
|
2456
|
-
let
|
|
2587
|
+
if (me(null), r) {
|
|
2588
|
+
$.current = !0;
|
|
2589
|
+
let Q = !1;
|
|
2457
2590
|
try {
|
|
2458
|
-
|
|
2591
|
+
Q = await r();
|
|
2459
2592
|
} finally {
|
|
2460
|
-
|
|
2593
|
+
$.current = !1;
|
|
2461
2594
|
}
|
|
2462
|
-
if (!
|
|
2595
|
+
if (!Q) return;
|
|
2463
2596
|
}
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2597
|
+
{
|
|
2598
|
+
$.current = !0;
|
|
2599
|
+
let Q = [];
|
|
2600
|
+
try {
|
|
2601
|
+
Q = await D.check();
|
|
2602
|
+
} finally {
|
|
2603
|
+
$.current = !1;
|
|
2604
|
+
}
|
|
2605
|
+
if (g(Q), Q.length > 0) {
|
|
2606
|
+
oe([]), C(l);
|
|
2607
|
+
return;
|
|
2608
|
+
}
|
|
2609
|
+
}
|
|
2610
|
+
const w = (Z ?? []).find((Q) => Q.id === l), b = String((w == null ? void 0 : w.comment_mode) ?? "none"), B = Ut(w, (m == null ? void 0 : m.states) ?? [], (se = m == null ? void 0 : m.instance) == null ? void 0 : se.current_state);
|
|
2611
|
+
if (b !== "optional" && b !== "required") {
|
|
2612
|
+
if (w && !at(w, (m == null ? void 0 : m.states) ?? [], (z = m == null ? void 0 : m.instance) == null ? void 0 : z.current_state)) {
|
|
2613
|
+
$.current = !0;
|
|
2614
|
+
let Q = [];
|
|
2469
2615
|
try {
|
|
2470
|
-
|
|
2616
|
+
Q = await H();
|
|
2471
2617
|
} finally {
|
|
2472
|
-
|
|
2618
|
+
$.current = !1;
|
|
2473
2619
|
}
|
|
2474
|
-
if (
|
|
2475
|
-
|
|
2620
|
+
if (Q.length > 0 || B) {
|
|
2621
|
+
oe(Q), C(l);
|
|
2476
2622
|
return;
|
|
2477
2623
|
}
|
|
2478
2624
|
}
|
|
2479
|
-
if (
|
|
2480
|
-
|
|
2625
|
+
if (B) {
|
|
2626
|
+
oe([]), C(l);
|
|
2481
2627
|
return;
|
|
2482
2628
|
}
|
|
2483
|
-
|
|
2629
|
+
K({ transition_id: l });
|
|
2484
2630
|
return;
|
|
2485
2631
|
}
|
|
2486
|
-
|
|
2487
|
-
},
|
|
2488
|
-
queryKey:
|
|
2489
|
-
queryFn: () =>
|
|
2490
|
-
|
|
2491
|
-
`/pipelines/instance/${t}/${e}${
|
|
2632
|
+
oe([]), C(l);
|
|
2633
|
+
}, x = c ? ["pipeline-instance", t, e, "as-user", c] : s ? ["pipeline-instance", t, e, s] : ["pipeline-instance", t, e], { settling: A, settle: re } = Gn(x), { data: m } = ke({
|
|
2634
|
+
queryKey: x,
|
|
2635
|
+
queryFn: () => f.request(
|
|
2636
|
+
qe(
|
|
2637
|
+
`/pipelines/instance/${t}/${e}${c ? `?as_user=${encodeURIComponent(c)}` : s ? `?as_role=${encodeURIComponent(s)}` : ""}`
|
|
2492
2638
|
)
|
|
2493
2639
|
).then(
|
|
2494
2640
|
(l) => l.data ?? {
|
|
@@ -2501,206 +2647,206 @@ function ca({
|
|
|
2501
2647
|
}
|
|
2502
2648
|
),
|
|
2503
2649
|
staleTime: 1e4,
|
|
2504
|
-
refetchInterval: (l) =>
|
|
2650
|
+
refetchInterval: (l) => $n(l.state.data)
|
|
2505
2651
|
});
|
|
2506
|
-
|
|
2507
|
-
|
|
2652
|
+
Tn(!!(m != null && m.running_move), () => {
|
|
2653
|
+
Ve(p, t, String(e)), Xe(p, t, String(e)), pt(p, t, String(e));
|
|
2508
2654
|
});
|
|
2509
|
-
const
|
|
2510
|
-
|
|
2655
|
+
const J = Vn(
|
|
2656
|
+
m ? (m.available_transitions ?? []).map((l) => String(l.id)) : null,
|
|
2511
2657
|
`${t}:${e}`
|
|
2512
|
-
), { data:
|
|
2658
|
+
), { data: Y } = ke({
|
|
2513
2659
|
queryKey: ["pipeline-all-owners", t, e],
|
|
2514
|
-
queryFn: () =>
|
|
2515
|
-
|
|
2660
|
+
queryFn: () => f.request(
|
|
2661
|
+
qe(`/pipelines/instance/${t}/${e}/owners/all`)
|
|
2516
2662
|
).then((l) => l.data ?? null),
|
|
2517
2663
|
// Also while a move is being confirmed: the panel names where it really lands.
|
|
2518
|
-
enabled:
|
|
2664
|
+
enabled: tr(m) || !!M,
|
|
2519
2665
|
staleTime: 3e4
|
|
2520
|
-
}),
|
|
2521
|
-
if (!
|
|
2666
|
+
}), Ne = ut(() => {
|
|
2667
|
+
if (!Y) return null;
|
|
2522
2668
|
const l = /* @__PURE__ */ new Map();
|
|
2523
|
-
for (const [h,
|
|
2524
|
-
|
|
2669
|
+
for (const [h, w] of Object.entries(Y))
|
|
2670
|
+
w.skipped && l.set(h, w.skip_reasons ?? []);
|
|
2525
2671
|
return l;
|
|
2526
|
-
}, [
|
|
2672
|
+
}, [Y]), U = Ye({
|
|
2527
2673
|
mutationFn: ({
|
|
2528
2674
|
transition_id: l,
|
|
2529
2675
|
comment: h,
|
|
2530
|
-
reviewed:
|
|
2531
|
-
lock_ack:
|
|
2532
|
-
}) =>
|
|
2533
|
-
|
|
2676
|
+
reviewed: w,
|
|
2677
|
+
lock_ack: b
|
|
2678
|
+
}) => k ? Promise.reject(new Error("Moves are not made from a preview")) : f.request(
|
|
2679
|
+
rt(`/pipelines/instance/${t}/${e}/transition`, {
|
|
2534
2680
|
transition_id: l,
|
|
2535
2681
|
comment: h,
|
|
2536
|
-
...
|
|
2537
|
-
...
|
|
2538
|
-
...
|
|
2682
|
+
...w ? { reviewed: !0 } : {},
|
|
2683
|
+
...b ? { lock_ack: !0 } : {},
|
|
2684
|
+
...qn(m == null ? void 0 : m.available_transitions, l)
|
|
2539
2685
|
})
|
|
2540
2686
|
),
|
|
2541
2687
|
onMutate: (l) => {
|
|
2542
2688
|
var h;
|
|
2543
2689
|
return {
|
|
2544
|
-
slow:
|
|
2545
|
-
(h = [...(
|
|
2546
|
-
(
|
|
2690
|
+
slow: ar(
|
|
2691
|
+
(h = [...(m == null ? void 0 : m.available_transitions) ?? [], ...(m == null ? void 0 : m.all_transitions) ?? []].find(
|
|
2692
|
+
(w) => w.id === l.transition_id
|
|
2547
2693
|
)) == null ? void 0 : h.label
|
|
2548
2694
|
)
|
|
2549
2695
|
};
|
|
2550
2696
|
},
|
|
2551
|
-
onSuccess: (l, h,
|
|
2552
|
-
p.invalidateQueries({ queryKey:
|
|
2553
|
-
const
|
|
2554
|
-
|
|
2555
|
-
`${
|
|
2556
|
-
|
|
2557
|
-
) :
|
|
2697
|
+
onSuccess: (l, h, w) => {
|
|
2698
|
+
p.invalidateQueries({ queryKey: x }), t === "nivaro_addendums" && p.invalidateQueries({ queryKey: ["addendums"] }), Ve(p, t, String(e)), Xe(p, t, String(e)), pt(p, t, String(e)), ne(null), v(""), C(null), N(null);
|
|
2699
|
+
const b = Mn(l);
|
|
2700
|
+
b ? X.info(
|
|
2701
|
+
`${b.transition_label ?? "The move"} started. You will be told if it does not go through.`,
|
|
2702
|
+
w == null ? void 0 : w.slow.done()
|
|
2703
|
+
) : X.success(rr(m, h.transition_id, l), w == null ? void 0 : w.slow.done());
|
|
2558
2704
|
},
|
|
2559
|
-
onError: (l, h,
|
|
2560
|
-
var
|
|
2561
|
-
if (
|
|
2562
|
-
p.invalidateQueries({ queryKey:
|
|
2705
|
+
onError: (l, h, w) => {
|
|
2706
|
+
var Q, fe;
|
|
2707
|
+
if (w == null || w.slow.fail(), Qn(l)) {
|
|
2708
|
+
p.invalidateQueries({ queryKey: x });
|
|
2563
2709
|
return;
|
|
2564
2710
|
}
|
|
2565
|
-
if (
|
|
2566
|
-
p.invalidateQueries({ queryKey:
|
|
2711
|
+
if (ht(l) === "TRANSITION_RUNNING") {
|
|
2712
|
+
p.invalidateQueries({ queryKey: x }), C(null), N(null), X.info(Ie(l, "This move is already running on this record."));
|
|
2567
2713
|
return;
|
|
2568
2714
|
}
|
|
2569
|
-
const
|
|
2570
|
-
if (
|
|
2571
|
-
|
|
2572
|
-
const
|
|
2573
|
-
(
|
|
2574
|
-
)) == null ? void 0 :
|
|
2575
|
-
|
|
2715
|
+
const b = zn(l);
|
|
2716
|
+
if (b) {
|
|
2717
|
+
C(null);
|
|
2718
|
+
const y = ((Q = [...(m == null ? void 0 : m.available_transitions) ?? [], ...(m == null ? void 0 : m.all_transitions) ?? []].find(
|
|
2719
|
+
(be) => be.id === h.transition_id
|
|
2720
|
+
)) == null ? void 0 : Q.label) ?? "Move";
|
|
2721
|
+
X.warning(b.message, {
|
|
2576
2722
|
id: `nvr-locked-move:${t}:${String(e)}`,
|
|
2577
2723
|
duration: 2e4,
|
|
2578
2724
|
action: {
|
|
2579
|
-
label: `${
|
|
2580
|
-
onClick: () =>
|
|
2725
|
+
label: `${y} anyway`,
|
|
2726
|
+
onClick: () => K({ ...h, lock_ack: !0 })
|
|
2581
2727
|
},
|
|
2582
2728
|
cancel: { label: "Wait", onClick: () => {
|
|
2583
2729
|
} }
|
|
2584
2730
|
});
|
|
2585
2731
|
return;
|
|
2586
2732
|
}
|
|
2587
|
-
const
|
|
2588
|
-
if (
|
|
2589
|
-
|
|
2590
|
-
payload:
|
|
2733
|
+
const B = Wn(l);
|
|
2734
|
+
if (B) {
|
|
2735
|
+
N((y) => ({
|
|
2736
|
+
payload: B,
|
|
2591
2737
|
transitionId: h.transition_id,
|
|
2592
2738
|
comment: h.comment,
|
|
2593
|
-
revision: ((
|
|
2739
|
+
revision: ((y == null ? void 0 : y.revision) ?? 0) + 1
|
|
2594
2740
|
}));
|
|
2595
2741
|
return;
|
|
2596
2742
|
}
|
|
2597
|
-
const
|
|
2598
|
-
|
|
2599
|
-
const
|
|
2743
|
+
const se = l == null ? void 0 : l.response;
|
|
2744
|
+
ne(Hn(l, h));
|
|
2745
|
+
const z = bn(
|
|
2600
2746
|
l,
|
|
2601
|
-
(
|
|
2602
|
-
(
|
|
2603
|
-
)) == null ? void 0 :
|
|
2747
|
+
(fe = [...(m == null ? void 0 : m.available_transitions) ?? [], ...(m == null ? void 0 : m.all_transitions) ?? []].find(
|
|
2748
|
+
(y) => y.id === h.transition_id
|
|
2749
|
+
)) == null ? void 0 : fe.label
|
|
2604
2750
|
);
|
|
2605
|
-
|
|
2751
|
+
X.error((z == null ? void 0 : z.title) ?? Ie(l, "Failed to execute transition"), {
|
|
2606
2752
|
duration: 12e3,
|
|
2607
2753
|
// What to do next + Copy details (lib/error-toast.ts); "Why?" below wins the action slot.
|
|
2608
2754
|
// A partner's refusal copies what the toast said and the other system's answer as
|
|
2609
2755
|
// stored, never the generic reading of a 422.
|
|
2610
|
-
...
|
|
2756
|
+
...hn(z ? vn(l, z) : l, {
|
|
2611
2757
|
action: "Transition"
|
|
2612
2758
|
}),
|
|
2613
|
-
...
|
|
2759
|
+
...z ? { description: z.description } : {},
|
|
2614
2760
|
// #1867: a refusal carries "Why?" — the role, owner or access rule
|
|
2615
2761
|
// that stopped it, and who can change it.
|
|
2616
|
-
...
|
|
2617
|
-
action:
|
|
2762
|
+
...Sn(l) ? {
|
|
2763
|
+
action: Cn(f, {
|
|
2618
2764
|
collection: t,
|
|
2619
2765
|
itemId: String(e),
|
|
2620
2766
|
action: "transition",
|
|
2621
2767
|
transitionId: h.transition_id
|
|
2622
2768
|
})
|
|
2623
2769
|
} : {}
|
|
2624
|
-
}),
|
|
2770
|
+
}), N(null), C(null), Ve(p, t, String(e)), Xe(p, t, String(e)), (se == null ? void 0 : se.status) === 409 && p.invalidateQueries({ queryKey: x });
|
|
2625
2771
|
}
|
|
2626
|
-
}),
|
|
2627
|
-
|
|
2628
|
-
const
|
|
2629
|
-
if (
|
|
2772
|
+
}), ae = xe(T);
|
|
2773
|
+
ae.current = T;
|
|
2774
|
+
const Se = xe((m == null ? void 0 : m.available_transitions) ?? []);
|
|
2775
|
+
if (Se.current = (m == null ? void 0 : m.available_transitions) ?? [], Ee(() => {
|
|
2630
2776
|
const l = (h) => {
|
|
2631
|
-
const
|
|
2632
|
-
if (!
|
|
2633
|
-
|
|
2634
|
-
const
|
|
2635
|
-
if (!
|
|
2636
|
-
|
|
2777
|
+
const w = h.detail;
|
|
2778
|
+
if (!w || w.claimed || k || w.collection !== t || String(w.item) !== String(e)) return;
|
|
2779
|
+
w.claimed = !0;
|
|
2780
|
+
const b = String(w.transition_id).toUpperCase(), B = Se.current.find((se) => String(se.id).toUpperCase() === b);
|
|
2781
|
+
if (!B) {
|
|
2782
|
+
X.error("That step is not available from where the record is now");
|
|
2637
2783
|
return;
|
|
2638
2784
|
}
|
|
2639
|
-
|
|
2785
|
+
ae.current(B.id);
|
|
2640
2786
|
};
|
|
2641
|
-
return window.addEventListener(
|
|
2642
|
-
}, [t, e,
|
|
2643
|
-
const
|
|
2644
|
-
(
|
|
2645
|
-
(l) => !
|
|
2787
|
+
return window.addEventListener(mt, l), () => window.removeEventListener(mt, l);
|
|
2788
|
+
}, [t, e, k]), !(m != null && m.binding) || !(m != null && m.instance)) return null;
|
|
2789
|
+
const Z = nr(
|
|
2790
|
+
(m.available_transitions ?? []).filter(
|
|
2791
|
+
(l) => !m.instance.completed_at || l.from_state && String(l.from_state).toUpperCase() === String(m.instance.current_state).toUpperCase()
|
|
2646
2792
|
),
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
),
|
|
2651
|
-
if (
|
|
2652
|
-
const
|
|
2653
|
-
for (const l of
|
|
2654
|
-
const h =
|
|
2655
|
-
h.push(l),
|
|
2793
|
+
m.states ?? [],
|
|
2794
|
+
m.instance.current_state,
|
|
2795
|
+
m.instance.completed_at ? null : Ne
|
|
2796
|
+
), Pe = Rn(Z, m.blocked_transitions);
|
|
2797
|
+
if (Pe.length === 0) return null;
|
|
2798
|
+
const ue = new Map((m.states ?? []).map((l) => [l.id, l])), ce = m.instance.current_state_obj ?? null, ee = M ? Z.find((l) => l.id === M) : null, ye = ie ? Z.find((l) => l.id === ie) : null, o = m.running_move ?? null, Ke = o ? Wr(o) : void 0, Re = ee ? ue.get(ee.to_state) : null, pe = dr(ee, ce, m.states ?? [], Y), Oe = (pe == null ? void 0 : pe.state) ?? Re, Ce = /* @__PURE__ */ new Map();
|
|
2799
|
+
for (const l of Pe) {
|
|
2800
|
+
const h = Ce.get(l.label) ?? [];
|
|
2801
|
+
h.push(l), Ce.set(l.label, h);
|
|
2656
2802
|
}
|
|
2657
|
-
const
|
|
2658
|
-
(h,
|
|
2659
|
-
var
|
|
2660
|
-
return (((
|
|
2803
|
+
const d = (l) => [...l].sort(
|
|
2804
|
+
(h, w) => {
|
|
2805
|
+
var b, B;
|
|
2806
|
+
return (((b = ue.get(h.to_state)) == null ? void 0 : b.sort) ?? 999) - (((B = ue.get(w.to_state)) == null ? void 0 : B.sort) ?? 999);
|
|
2661
2807
|
}
|
|
2662
|
-
),
|
|
2808
|
+
), L = (l) => {
|
|
2663
2809
|
var h;
|
|
2664
|
-
return ((h =
|
|
2665
|
-
},
|
|
2666
|
-
var
|
|
2667
|
-
const l = (
|
|
2810
|
+
return ((h = ue.get(l.to_state)) == null ? void 0 : h.label) ?? l.to_state;
|
|
2811
|
+
}, G = (() => {
|
|
2812
|
+
var w, b, B;
|
|
2813
|
+
const l = (w = _.current) == null ? void 0 : w.getBoundingClientRect();
|
|
2668
2814
|
if (!l) return 600;
|
|
2669
|
-
const h = (
|
|
2815
|
+
const h = (B = (b = _.current) == null ? void 0 : b.closest('[role="dialog"]')) == null ? void 0 : B.getBoundingClientRect();
|
|
2670
2816
|
return Math.max(260, Math.min(600, l.right - ((h == null ? void 0 : h.left) ?? 0) - 12));
|
|
2671
2817
|
})();
|
|
2672
|
-
return /* @__PURE__ */
|
|
2673
|
-
|
|
2674
|
-
/* @__PURE__ */ n(
|
|
2675
|
-
|
|
2818
|
+
return /* @__PURE__ */ i("div", { ref: _, className: "relative", "data-tip": Ke, children: [
|
|
2819
|
+
F ? /* @__PURE__ */ i(Nt, { children: [
|
|
2820
|
+
/* @__PURE__ */ n(St, { asChild: !0, children: /* @__PURE__ */ i(
|
|
2821
|
+
ge,
|
|
2676
2822
|
{
|
|
2677
2823
|
size: "sm",
|
|
2678
2824
|
variant: "outline",
|
|
2679
2825
|
className: "shrink-0 gap-1.5 text-[12px]",
|
|
2680
|
-
disabled:
|
|
2826
|
+
disabled: U.isPending || A || !!o,
|
|
2681
2827
|
"data-transitions-folded": !0,
|
|
2682
2828
|
children: [
|
|
2683
|
-
|
|
2829
|
+
U.isPending || o ? /* @__PURE__ */ n(Me, { className: "h-3 w-3 animate-spin" }) : Z.length > 0 && Z.every((l) => l.advisory) && /* @__PURE__ */ n(Te, {}),
|
|
2684
2830
|
"Actions",
|
|
2685
|
-
/* @__PURE__ */ n(
|
|
2831
|
+
/* @__PURE__ */ n(Ge, { className: "h-3 w-3" })
|
|
2686
2832
|
]
|
|
2687
2833
|
}
|
|
2688
2834
|
) }),
|
|
2689
|
-
/* @__PURE__ */
|
|
2690
|
-
Array.from(
|
|
2691
|
-
([l, h],
|
|
2692
|
-
|
|
2693
|
-
/* @__PURE__ */
|
|
2694
|
-
|
|
2835
|
+
/* @__PURE__ */ i(Ct, { align: "end", className: "min-w-[200px]", children: [
|
|
2836
|
+
Array.from(Ce.entries()).map(
|
|
2837
|
+
([l, h], w, b) => h.length === 1 ? /* @__PURE__ */ i(Jt, { children: [
|
|
2838
|
+
w > 0 && b[w - 1][1].length > 1 && /* @__PURE__ */ n($t, {}),
|
|
2839
|
+
/* @__PURE__ */ i(
|
|
2840
|
+
ot,
|
|
2695
2841
|
{
|
|
2696
|
-
onSelect: () =>
|
|
2697
|
-
...
|
|
2698
|
-
...
|
|
2842
|
+
onSelect: () => T(h[0].id),
|
|
2843
|
+
...ze(h[0], "menu"),
|
|
2844
|
+
...dt(h[0]),
|
|
2699
2845
|
children: [
|
|
2700
2846
|
h[0].color && /* @__PURE__ */ n(
|
|
2701
2847
|
"span",
|
|
2702
2848
|
{
|
|
2703
|
-
className:
|
|
2849
|
+
className: le(
|
|
2704
2850
|
"mr-2 inline-block h-2 w-2 shrink-0 rounded-full",
|
|
2705
2851
|
h[0].blocked && "opacity-40"
|
|
2706
2852
|
),
|
|
@@ -2708,47 +2854,47 @@ function ca({
|
|
|
2708
2854
|
}
|
|
2709
2855
|
),
|
|
2710
2856
|
l,
|
|
2711
|
-
h[0].advisory && /* @__PURE__ */ n(
|
|
2712
|
-
h[0].blocked && /* @__PURE__ */ n(
|
|
2857
|
+
h[0].advisory && /* @__PURE__ */ n(Te, { className: "ml-auto" }),
|
|
2858
|
+
h[0].blocked && /* @__PURE__ */ n(lt, {})
|
|
2713
2859
|
]
|
|
2714
2860
|
}
|
|
2715
2861
|
)
|
|
2716
|
-
] }, l) : /* @__PURE__ */
|
|
2717
|
-
|
|
2718
|
-
/* @__PURE__ */ n(
|
|
2719
|
-
|
|
2720
|
-
|
|
2862
|
+
] }, l) : /* @__PURE__ */ i(Jt, { children: [
|
|
2863
|
+
w > 0 && /* @__PURE__ */ n($t, {}),
|
|
2864
|
+
/* @__PURE__ */ n(jr, { className: "text-[11px] text-muted-foreground", children: l }),
|
|
2865
|
+
d(h).map((B) => /* @__PURE__ */ i(
|
|
2866
|
+
ot,
|
|
2721
2867
|
{
|
|
2722
|
-
onSelect: () =>
|
|
2723
|
-
...
|
|
2724
|
-
...
|
|
2868
|
+
onSelect: () => T(B.id),
|
|
2869
|
+
...ze(B, "menu"),
|
|
2870
|
+
...dt(B),
|
|
2725
2871
|
children: [
|
|
2726
|
-
|
|
2872
|
+
B.color && /* @__PURE__ */ n(
|
|
2727
2873
|
"span",
|
|
2728
2874
|
{
|
|
2729
|
-
className:
|
|
2875
|
+
className: le(
|
|
2730
2876
|
"mr-2 inline-block h-2 w-2 shrink-0 rounded-full",
|
|
2731
|
-
|
|
2877
|
+
B.blocked && "opacity-40"
|
|
2732
2878
|
),
|
|
2733
|
-
style: { backgroundColor:
|
|
2879
|
+
style: { backgroundColor: B.color }
|
|
2734
2880
|
}
|
|
2735
2881
|
),
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2882
|
+
L(B),
|
|
2883
|
+
B.advisory && /* @__PURE__ */ n(Te, { className: "ml-auto" }),
|
|
2884
|
+
B.blocked && /* @__PURE__ */ n(lt, {})
|
|
2739
2885
|
]
|
|
2740
2886
|
},
|
|
2741
|
-
|
|
2887
|
+
B.id
|
|
2742
2888
|
))
|
|
2743
2889
|
] }, l)
|
|
2744
2890
|
),
|
|
2745
2891
|
/* @__PURE__ */ n(
|
|
2746
|
-
|
|
2892
|
+
At,
|
|
2747
2893
|
{
|
|
2748
|
-
moves:
|
|
2894
|
+
moves: Z,
|
|
2749
2895
|
nameOf: (l) => {
|
|
2750
|
-
var h,
|
|
2751
|
-
return (((h =
|
|
2896
|
+
var h, w;
|
|
2897
|
+
return (((h = Ce.get(l.label)) == null ? void 0 : h.length) ?? 0) > 1 ? ((w = ue.get(l.to_state)) == null ? void 0 : w.label) ?? l.to_state : l.label;
|
|
2752
2898
|
}
|
|
2753
2899
|
}
|
|
2754
2900
|
)
|
|
@@ -2757,113 +2903,113 @@ function ca({
|
|
|
2757
2903
|
"div",
|
|
2758
2904
|
{
|
|
2759
2905
|
className: a ? "flex flex-wrap justify-end gap-2" : "flex shrink-0 items-center justify-end gap-2",
|
|
2760
|
-
children: Array.from(
|
|
2761
|
-
var
|
|
2762
|
-
const
|
|
2763
|
-
var
|
|
2764
|
-
return (((
|
|
2765
|
-
}),
|
|
2766
|
-
if (h.every(
|
|
2767
|
-
const
|
|
2906
|
+
children: Array.from(Ce.entries()).map(([l, h]) => {
|
|
2907
|
+
var z, Q, fe;
|
|
2908
|
+
const w = h.some((y) => {
|
|
2909
|
+
var be;
|
|
2910
|
+
return (((be = y.order_partners) == null ? void 0 : be.length) ?? 0) > 0;
|
|
2911
|
+
}), b = w ? null : ((z = h[0]) == null ? void 0 : z.color) ?? null, B = h.some((y) => y.id === M), se = (y) => b ? y ? { backgroundColor: b, borderColor: b } : { borderColor: b, color: b } : void 0;
|
|
2912
|
+
if (h.every(Fn)) {
|
|
2913
|
+
const y = d(h);
|
|
2768
2914
|
return /* @__PURE__ */ n(
|
|
2769
|
-
|
|
2915
|
+
An,
|
|
2770
2916
|
{
|
|
2771
2917
|
label: l,
|
|
2772
|
-
code: (
|
|
2773
|
-
reason:
|
|
2918
|
+
code: (Q = y[0].blocked) == null ? void 0 : Q.code,
|
|
2919
|
+
reason: On(y, (be) => L(y[be]))
|
|
2774
2920
|
},
|
|
2775
2921
|
l
|
|
2776
2922
|
);
|
|
2777
2923
|
}
|
|
2778
2924
|
if (h.length === 1) {
|
|
2779
|
-
const
|
|
2780
|
-
|
|
2925
|
+
const y = h[0], be = Pt(o == null ? void 0 : o.transition_id, y.id), De = Pn(o ? null : m.last_move_problem, y.id), Ze = U.isPending && ((fe = U.variables) == null ? void 0 : fe.transition_id) === y.id || be, et = /* @__PURE__ */ i(
|
|
2926
|
+
ge,
|
|
2781
2927
|
{
|
|
2782
2928
|
size: "sm",
|
|
2783
|
-
variant:
|
|
2784
|
-
className:
|
|
2929
|
+
variant: B && !y.advisory ? "default" : "outline",
|
|
2930
|
+
className: le(
|
|
2785
2931
|
"gap-1.5 text-[12px] data-[fresh=true]:opacity-60",
|
|
2786
|
-
|
|
2932
|
+
y.advisory && sr
|
|
2787
2933
|
),
|
|
2788
|
-
style:
|
|
2789
|
-
disabled:
|
|
2790
|
-
"data-move-running":
|
|
2791
|
-
"aria-disabled":
|
|
2792
|
-
"data-fresh":
|
|
2793
|
-
...
|
|
2794
|
-
...
|
|
2934
|
+
style: y.advisory ? void 0 : se(B),
|
|
2935
|
+
disabled: U.isPending || A || !!o || !!De,
|
|
2936
|
+
"data-move-running": be || void 0,
|
|
2937
|
+
"aria-disabled": J.dimmed(y.id) || void 0,
|
|
2938
|
+
"data-fresh": J.dimmed(y.id) || void 0,
|
|
2939
|
+
...J.bind(y.id),
|
|
2940
|
+
...ze(y),
|
|
2795
2941
|
onClick: () => {
|
|
2796
|
-
|
|
2942
|
+
J.press(y.id) && T(y.id);
|
|
2797
2943
|
},
|
|
2798
2944
|
children: [
|
|
2799
|
-
|
|
2945
|
+
Ze ? /* @__PURE__ */ n(Me, { className: "h-3 w-3 animate-spin" }) : y.advisory ? /* @__PURE__ */ n(Te, {}) : w && /* @__PURE__ */ n(dn, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
2800
2946
|
l
|
|
2801
2947
|
]
|
|
2802
2948
|
},
|
|
2803
2949
|
l
|
|
2804
2950
|
);
|
|
2805
|
-
return De ? /* @__PURE__ */ n("span", { className: "inline-flex", "data-tip": De, "data-move-held": !0, children:
|
|
2806
|
-
|
|
2951
|
+
return De ? /* @__PURE__ */ n("span", { className: "inline-flex", "data-tip": De, "data-move-held": !0, children: et }, l) : y.pushes && y.pushes > 0 ? /* @__PURE__ */ i("span", { className: "relative inline-flex", children: [
|
|
2952
|
+
et,
|
|
2807
2953
|
/* @__PURE__ */ n(
|
|
2808
|
-
|
|
2954
|
+
Br,
|
|
2809
2955
|
{
|
|
2810
2956
|
collection: t,
|
|
2811
2957
|
itemId: e,
|
|
2812
|
-
transitionId:
|
|
2958
|
+
transitionId: y.id,
|
|
2813
2959
|
label: l,
|
|
2814
2960
|
compact: !0
|
|
2815
2961
|
}
|
|
2816
2962
|
)
|
|
2817
|
-
] }, l) :
|
|
2963
|
+
] }, l) : et;
|
|
2818
2964
|
}
|
|
2819
|
-
return /* @__PURE__ */
|
|
2820
|
-
/* @__PURE__ */ n(
|
|
2821
|
-
|
|
2965
|
+
return /* @__PURE__ */ i(Nt, { children: [
|
|
2966
|
+
/* @__PURE__ */ n(St, { asChild: !0, children: /* @__PURE__ */ i(
|
|
2967
|
+
ge,
|
|
2822
2968
|
{
|
|
2823
2969
|
size: "sm",
|
|
2824
|
-
variant:
|
|
2970
|
+
variant: B ? "default" : "outline",
|
|
2825
2971
|
className: "gap-1.5 text-[12px]",
|
|
2826
|
-
style:
|
|
2827
|
-
disabled:
|
|
2972
|
+
style: se(B),
|
|
2973
|
+
disabled: U.isPending || A || !!o,
|
|
2828
2974
|
children: [
|
|
2829
|
-
h.every((
|
|
2975
|
+
h.every((y) => y.advisory) && /* @__PURE__ */ n(Te, {}),
|
|
2830
2976
|
l,
|
|
2831
|
-
/* @__PURE__ */ n(
|
|
2977
|
+
/* @__PURE__ */ n(Ge, { className: "h-3 w-3" })
|
|
2832
2978
|
]
|
|
2833
2979
|
}
|
|
2834
2980
|
) }),
|
|
2835
|
-
/* @__PURE__ */
|
|
2836
|
-
|
|
2837
|
-
|
|
2981
|
+
/* @__PURE__ */ i(Ct, { align: "start", children: [
|
|
2982
|
+
d(h).map((y) => /* @__PURE__ */ i(
|
|
2983
|
+
ot,
|
|
2838
2984
|
{
|
|
2839
|
-
onSelect: () =>
|
|
2840
|
-
...
|
|
2841
|
-
...
|
|
2985
|
+
onSelect: () => T(y.id),
|
|
2986
|
+
...ze(y, "menu"),
|
|
2987
|
+
...dt(y),
|
|
2842
2988
|
children: [
|
|
2843
|
-
|
|
2989
|
+
y.color && /* @__PURE__ */ n(
|
|
2844
2990
|
"span",
|
|
2845
2991
|
{
|
|
2846
|
-
className:
|
|
2992
|
+
className: le(
|
|
2847
2993
|
"mr-2 inline-block h-2 w-2 shrink-0 rounded-full",
|
|
2848
|
-
|
|
2994
|
+
y.blocked && "opacity-40"
|
|
2849
2995
|
),
|
|
2850
|
-
style: { backgroundColor:
|
|
2996
|
+
style: { backgroundColor: y.color }
|
|
2851
2997
|
}
|
|
2852
2998
|
),
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2999
|
+
L(y),
|
|
3000
|
+
y.advisory && /* @__PURE__ */ n(Te, { className: "ml-auto" }),
|
|
3001
|
+
y.blocked && /* @__PURE__ */ n(lt, {})
|
|
2856
3002
|
]
|
|
2857
3003
|
},
|
|
2858
|
-
|
|
3004
|
+
y.id
|
|
2859
3005
|
)),
|
|
2860
3006
|
/* @__PURE__ */ n(
|
|
2861
|
-
|
|
3007
|
+
At,
|
|
2862
3008
|
{
|
|
2863
3009
|
moves: h,
|
|
2864
|
-
nameOf: (
|
|
2865
|
-
var
|
|
2866
|
-
return ((
|
|
3010
|
+
nameOf: (y) => {
|
|
3011
|
+
var be;
|
|
3012
|
+
return ((be = ue.get(y.to_state)) == null ? void 0 : be.label) ?? y.to_state;
|
|
2867
3013
|
}
|
|
2868
3014
|
}
|
|
2869
3015
|
)
|
|
@@ -2872,61 +3018,64 @@ function ca({
|
|
|
2872
3018
|
})
|
|
2873
3019
|
}
|
|
2874
3020
|
),
|
|
2875
|
-
|
|
3021
|
+
M && /* @__PURE__ */ i(
|
|
2876
3022
|
"div",
|
|
2877
3023
|
{
|
|
2878
3024
|
className: "absolute right-0 top-full z-50 mt-1 space-y-3 rounded-lg border border-slate-200 bg-white shadow-lg dark:bg-card dark:border-border p-3.5",
|
|
2879
|
-
style: { width:
|
|
3025
|
+
style: { width: G },
|
|
2880
3026
|
children: [
|
|
2881
|
-
/* @__PURE__ */
|
|
3027
|
+
/* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
2882
3028
|
/* @__PURE__ */ n("span", { className: "text-[11px] font-semibold text-slate-400", children: "Confirming" }),
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
/* @__PURE__ */ n(
|
|
2886
|
-
/* @__PURE__ */ n(
|
|
2887
|
-
/* @__PURE__ */ n(
|
|
3029
|
+
ee && /* @__PURE__ */ n("span", { className: "text-[12px] font-medium text-slate-700", children: ee.label }),
|
|
3030
|
+
ce && Oe && /* @__PURE__ */ i("div", { className: "ml-auto flex items-center gap-1.5", children: [
|
|
3031
|
+
/* @__PURE__ */ n(Le, { label: ce.label, color: ce.color, small: !0 }),
|
|
3032
|
+
/* @__PURE__ */ n(Ot, { className: "h-3 w-3 shrink-0 text-slate-300" }),
|
|
3033
|
+
/* @__PURE__ */ n(Le, { label: Oe.label, color: Oe.color, small: !0 })
|
|
2888
3034
|
] })
|
|
2889
3035
|
] }),
|
|
2890
|
-
/* @__PURE__ */ n(
|
|
2891
|
-
/* @__PURE__ */ n(
|
|
2892
|
-
/* @__PURE__ */ n(
|
|
2893
|
-
/* @__PURE__ */ n(
|
|
3036
|
+
/* @__PURE__ */ n(cr, { landing: pe }),
|
|
3037
|
+
/* @__PURE__ */ n(er, { collection: t, item: String(e), tx: ee }),
|
|
3038
|
+
/* @__PURE__ */ n(ur, { collection: t, item: e, omitLines: de }),
|
|
3039
|
+
/* @__PURE__ */ n(Zn, { lines: de }),
|
|
3040
|
+
/* @__PURE__ */ n(jn, { changes: j }),
|
|
2894
3041
|
/* @__PURE__ */ n(
|
|
2895
3042
|
"input",
|
|
2896
3043
|
{
|
|
2897
3044
|
type: "text",
|
|
2898
|
-
value:
|
|
2899
|
-
onChange: (l) =>
|
|
2900
|
-
placeholder: String((
|
|
3045
|
+
value: S,
|
|
3046
|
+
onChange: (l) => v(l.target.value),
|
|
3047
|
+
placeholder: String((ee == null ? void 0 : ee.comment_mode) ?? "") === "required" ? "Add a note (required)" : "Add a comment (optional)",
|
|
2901
3048
|
className: "w-full rounded-md border border-slate-200 bg-white px-3 py-1.5 text-[13px] placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-nvr-cyan/30"
|
|
2902
3049
|
}
|
|
2903
3050
|
),
|
|
2904
|
-
/* @__PURE__ */
|
|
3051
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-end gap-2", children: [
|
|
2905
3052
|
/* @__PURE__ */ n(
|
|
2906
|
-
|
|
3053
|
+
ge,
|
|
2907
3054
|
{
|
|
2908
3055
|
type: "button",
|
|
2909
3056
|
size: "sm",
|
|
2910
3057
|
variant: "ghost",
|
|
2911
3058
|
className: "h-7 text-[12px]",
|
|
2912
|
-
onClick: () =>
|
|
2913
|
-
|
|
3059
|
+
onClick: () => {
|
|
3060
|
+
j.length > 0 && D.review(), C(null);
|
|
3061
|
+
},
|
|
3062
|
+
children: j.length > 0 ? "Review" : "Cancel"
|
|
2914
3063
|
}
|
|
2915
3064
|
),
|
|
2916
3065
|
/* @__PURE__ */ n(
|
|
2917
|
-
|
|
3066
|
+
ge,
|
|
2918
3067
|
{
|
|
2919
3068
|
type: "button",
|
|
2920
3069
|
size: "sm",
|
|
2921
3070
|
className: "h-7 gap-1.5 text-[12px]",
|
|
2922
|
-
disabled:
|
|
2923
|
-
onClick: () =>
|
|
2924
|
-
transition_id:
|
|
2925
|
-
comment:
|
|
3071
|
+
disabled: U.isPending || !!o || String((ee == null ? void 0 : ee.comment_mode) ?? "") === "required" && S.trim() === "",
|
|
3072
|
+
onClick: () => K({
|
|
3073
|
+
transition_id: M,
|
|
3074
|
+
comment: S.trim() || void 0
|
|
2926
3075
|
}),
|
|
2927
|
-
children:
|
|
2928
|
-
/* @__PURE__ */ n("span", { children:
|
|
2929
|
-
/* @__PURE__ */ n(
|
|
3076
|
+
children: U.isPending ? /* @__PURE__ */ n(Me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ i(_e, { children: [
|
|
3077
|
+
/* @__PURE__ */ n("span", { children: j.length > 0 ? "Continue" : de.length > 0 && ee ? `${ee.label} anyway` : "Confirm" }),
|
|
3078
|
+
/* @__PURE__ */ n(ft, { className: "h-3 w-3" })
|
|
2930
3079
|
] })
|
|
2931
3080
|
}
|
|
2932
3081
|
)
|
|
@@ -2934,82 +3083,83 @@ function ca({
|
|
|
2934
3083
|
]
|
|
2935
3084
|
}
|
|
2936
3085
|
),
|
|
2937
|
-
(
|
|
2938
|
-
|
|
3086
|
+
(ye == null ? void 0 : ye.advisory) && !M && /* @__PURE__ */ n(
|
|
3087
|
+
Bn,
|
|
2939
3088
|
{
|
|
2940
3089
|
floating: !0,
|
|
2941
3090
|
collection: t,
|
|
2942
3091
|
item: String(e),
|
|
2943
|
-
advisory:
|
|
3092
|
+
advisory: ye.advisory,
|
|
2944
3093
|
armedMove: {
|
|
2945
|
-
id:
|
|
2946
|
-
label:
|
|
2947
|
-
confirms:
|
|
3094
|
+
id: ye.id,
|
|
3095
|
+
label: ye.label,
|
|
3096
|
+
confirms: ir(ye, m.states ?? [], m.instance.current_state)
|
|
2948
3097
|
},
|
|
2949
3098
|
className: "absolute right-0 top-full z-50 mt-1",
|
|
2950
|
-
style: { width:
|
|
2951
|
-
onDismiss: () =>
|
|
3099
|
+
style: { width: G },
|
|
3100
|
+
onDismiss: () => me(null),
|
|
2952
3101
|
onFixed: (l) => {
|
|
2953
|
-
|
|
3102
|
+
me(null), p.invalidateQueries({ queryKey: x }), l && T(l.id, { cleared: !0 });
|
|
2954
3103
|
}
|
|
2955
3104
|
}
|
|
2956
3105
|
),
|
|
2957
|
-
|
|
2958
|
-
|
|
3106
|
+
R && !M && /* @__PURE__ */ n(
|
|
3107
|
+
or,
|
|
2959
3108
|
{
|
|
2960
3109
|
collection: t,
|
|
2961
3110
|
item: String(e),
|
|
2962
|
-
offer:
|
|
3111
|
+
offer: R,
|
|
2963
3112
|
className: "absolute right-0 top-full z-50 mt-1 shadow-lg",
|
|
2964
|
-
style: { width:
|
|
2965
|
-
onDismiss: () =>
|
|
2966
|
-
onFixed: () =>
|
|
3113
|
+
style: { width: G },
|
|
3114
|
+
onDismiss: () => ne(null),
|
|
3115
|
+
onFixed: () => K({ transition_id: R.transitionId, comment: R.comment })
|
|
2967
3116
|
}
|
|
2968
3117
|
),
|
|
2969
|
-
|
|
2970
|
-
|
|
3118
|
+
E && /* @__PURE__ */ n(mn, { fallback: null, children: /* @__PURE__ */ n(
|
|
3119
|
+
Kn,
|
|
2971
3120
|
{
|
|
2972
|
-
payload:
|
|
2973
|
-
transitionId:
|
|
2974
|
-
isRetry:
|
|
3121
|
+
payload: E.payload,
|
|
3122
|
+
transitionId: E.transitionId,
|
|
3123
|
+
isRetry: E.revision > 1,
|
|
2975
3124
|
onSubmitted: () => (
|
|
2976
3125
|
// mutateAsync so the dialog can stay busy until the transition
|
|
2977
3126
|
// settles; the mutation's own onError/onSuccess handle the outcome.
|
|
2978
|
-
|
|
2979
|
-
transition_id:
|
|
2980
|
-
comment:
|
|
3127
|
+
U.mutateAsync({
|
|
3128
|
+
transition_id: E.transitionId,
|
|
3129
|
+
comment: E.comment,
|
|
2981
3130
|
reviewed: !0
|
|
2982
3131
|
}).catch(() => {
|
|
2983
3132
|
})
|
|
2984
3133
|
),
|
|
2985
|
-
executing:
|
|
2986
|
-
onClose: () =>
|
|
3134
|
+
executing: U.isPending,
|
|
3135
|
+
onClose: () => N(null)
|
|
2987
3136
|
},
|
|
2988
|
-
|
|
3137
|
+
E.revision
|
|
2989
3138
|
) })
|
|
2990
3139
|
] });
|
|
2991
3140
|
}
|
|
2992
3141
|
export {
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3142
|
+
We as FRESH_BUTTON_MS,
|
|
3143
|
+
nn as FRESH_HOVER_MAX_MS,
|
|
3144
|
+
pa as FreshButtonGuard,
|
|
3145
|
+
$s as PipelinePanel,
|
|
3146
|
+
Ts as PipelineTransitionButtons,
|
|
3147
|
+
Yr as REFUSAL_FIX_ACTIONS,
|
|
3148
|
+
va as RecordFlagChips,
|
|
3149
|
+
xa as SLOW_MOVE_MS,
|
|
3150
|
+
Ut as asksFirst,
|
|
3151
|
+
ha as briefAgeText,
|
|
3152
|
+
ga as briefDiffPair,
|
|
3153
|
+
rn as briefLineKey,
|
|
3154
|
+
fa as briefWarnings,
|
|
3155
|
+
Qn as isDuplicateTransition,
|
|
3156
|
+
wa as latestSendBack,
|
|
3157
|
+
zn as lockedMoveOffer,
|
|
3158
|
+
ka as muted,
|
|
3159
|
+
ht as refusalCode,
|
|
3160
|
+
Hn as refusalFixFor,
|
|
3161
|
+
ar as slowMoveToast,
|
|
3162
|
+
Wn as transitionRequirementsFromError,
|
|
3163
|
+
rr as transitionToastText,
|
|
3164
|
+
nr as withoutSkippedSendBacks
|
|
3015
3165
|
};
|