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