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