@burdenoff/microfe-support 2026.819.1 → 2026.819.2

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.
@@ -1,5 +1,9 @@
1
+ import { type GetJobPostingQuery } from '../../../generated/global-operations';
1
2
  import { type BulkCandidateTarget, type CandidateSelectionState } from '../../utils/bulkCandidateOperations';
3
+ type JobPostingRoundConfig = NonNullable<GetJobPostingQuery['jobPosting']>['rounds'][number];
2
4
  export type BulkCandidateDialogMode = 'message' | 'assignment';
5
+ type AssignmentRoundConfig = Pick<JobPostingRoundConfig, 'isAssignmentRound' | 'roundType'>;
6
+ export declare function isAssignmentRoundConfig(round: AssignmentRoundConfig): boolean;
3
7
  interface SharedDialogProps {
4
8
  open: boolean;
5
9
  onClose: () => void;
@@ -1,27 +1,31 @@
1
1
  import { Button as e, Checkbox as t, Dialog as n, DialogContent as r, DialogDescription as ee, DialogFooter as i, DialogHeader as te, DialogTitle as ne, Label as a, Select as re, SelectContent as ie, SelectItem as ae, SelectTrigger as oe, SelectValue as se, Textarea as o } from "../ui.js";
2
- import { BulkEnsureInterviewRoundsDocument as s, BulkRandomizeAndSendAssignmentDocument as c, BulkSendRoundMessageDocument as l, useGetJobPostingQuery as ce } from "../../../generated/global-operations.js";
3
- import { nativeNotify as le } from "../../../utils/nativeBridge.js";
4
- import { CandidateChunkPreconditionError as u, aggregateCandidateEmailResult as d, aggregateEnsureRoundResult as f, assertCandidateChunkMatchesCurrentScope as ue, assertCandidateEmailChunkMatchesCurrentScope as de, assertCompleteCandidateEmailChunkResult as p, assertCompleteEnsureRoundChunkResult as m, createEmptyCandidateEmailAggregate as h, createEmptyEnsureRoundAggregate as g, executeSequentialCandidateChunks as fe, getBulkOperationNotificationSeverity as pe, getSelectedCandidateIds as _, hasCandidateEmailType as v, resolveExactCandidateRounds as y } from "../../utils/bulkCandidateOperations.js";
5
- import { BulkCandidateActionGuidance as b } from "./BulkCandidateActionGuidance.js";
6
- import { BulkOperationProgress as me, CandidateEmailResultDetails as he, EnsureRoundResultDetails as x, StoppedBulkOperationNotice as ge } from "./BulkOperationFeedback.js";
7
- import { useEffect as _e, useMemo as ve, useState as S } from "react";
8
- import { AlertCircle as ye, Loader2 as C, Send as w, UserPlus as be } from "lucide-react";
9
- import { graphqlFetch as T } from "@burdenoff/fe-libs/shared/graphql/fetch";
10
- import { jsx as E, jsxs as D } from "react/jsx-runtime";
11
- import { useApolloClient as xe } from "@apollo/client/react";
12
- import { print as O } from "graphql";
2
+ import { BulkEnsureInterviewRoundsDocument as s, BulkRandomizeAndSendAssignmentDocument as ce, BulkSendRoundMessageDocument as c, useGetJobPostingQuery as le } from "../../../generated/global-operations.js";
3
+ import { InterviewRoundType as l } from "../../../generated/global-types.js";
4
+ import { nativeNotify as ue } from "../../../utils/nativeBridge.js";
5
+ import { CandidateChunkPreconditionError as u, aggregateCandidateEmailResult as de, aggregateEnsureRoundResult as fe, assertCandidateChunkMatchesCurrentScope as d, assertCandidateEmailChunkMatchesCurrentScope as pe, assertCompleteCandidateEmailChunkResult as f, assertCompleteEnsureRoundChunkResult as p, createEmptyCandidateEmailAggregate as m, createEmptyEnsureRoundAggregate as h, executeSequentialCandidateChunks as me, getBulkOperationNotificationSeverity as he, getCandidateSelectionCount as ge, getSelectedCandidateIds as g, hasCandidateEmailType as _, resolveExactCandidateRounds as v } from "../../utils/bulkCandidateOperations.js";
6
+ import { BulkCandidateActionGuidance as _e } from "./BulkCandidateActionGuidance.js";
7
+ import { BulkOperationProgress as ve, CandidateEmailResultDetails as y, EnsureRoundResultDetails as ye, StoppedBulkOperationNotice as be } from "./BulkOperationFeedback.js";
8
+ import { useEffect as xe, useMemo as Se, useState as b } from "react";
9
+ import { AlertCircle as Ce, Loader2 as x, Send as S, UserPlus as we } from "lucide-react";
10
+ import { graphqlFetch as C } from "@burdenoff/fe-libs/shared/graphql/fetch";
11
+ import { jsx as w, jsxs as T } from "react/jsx-runtime";
12
+ import { useApolloClient as Te } from "@apollo/client/react";
13
+ import { print as E } from "graphql";
13
14
  //#region src/support/components/careers/BulkCandidateDialogs.tsx
14
- var Se = {
15
+ function D(e) {
16
+ return e.isAssignmentRound || e.roundType === l.TakeHome;
17
+ }
18
+ var O = {
15
19
  message: "ROUND_MESSAGE",
16
20
  assignment: "ASSIGNMENT"
17
21
  };
18
- function k(e) {
22
+ function Ee(e) {
19
23
  return e instanceof Error ? e.message : "The request failed without an error message.";
20
24
  }
21
- async function A(e, t, n) {
22
- let r = await T({
25
+ async function k(e, t, n) {
26
+ let r = await C({
23
27
  gateway: "global",
24
- query: O(e),
28
+ query: E(e),
25
29
  variables: t,
26
30
  operationName: n,
27
31
  skipAuthRetry: !0
@@ -30,47 +34,47 @@ async function A(e, t, n) {
30
34
  if (!r.data) throw Error(`${n} returned no data.`);
31
35
  return r.data;
32
36
  }
33
- function Ce(e, t) {
34
- let n = _(t);
37
+ function De(e, t) {
38
+ let n = g(t);
35
39
  return e.filter((e) => n.has(e.id));
36
40
  }
37
- async function we(e, t) {
41
+ async function Oe(e, t) {
38
42
  try {
39
43
  return await e(t);
40
44
  } catch (e) {
41
- throw new u(`Candidate scope revalidation failed before this chunk: ${k(e)}`);
45
+ throw new u(`Candidate scope revalidation failed before this chunk: ${Ee(e)}`);
42
46
  }
43
47
  }
44
- function j({ mode: s, open: u, onClose: f, onOpenAddRound: ue, targets: m, selection: g, jobPostingId: _, previewLoading: x, previewError: T, refreshTargets: O }) {
45
- let j = xe(), [M, N] = S(""), [P, F] = S(""), [I, L] = S(!1), [R, z] = S(null), [B, V] = S(h), [H, U] = S(null), [W, Te] = S(!1), [G, K] = S(!1), { data: Ee, loading: q, error: De } = ce({
46
- variables: { id: _ },
47
- skip: !u || !_,
48
+ function A({ mode: s, open: l, onClose: u, onOpenAddRound: fe, targets: d, selection: p, jobPostingId: h, previewLoading: g, previewError: ye, refreshTargets: C }) {
49
+ let E = Te(), [A, j] = b(""), [M, N] = b(""), [P, F] = b(!1), [I, L] = b(null), [ke, R] = b(m), [z, B] = b(null), [V, H] = b(!1), [U, W] = b(!1), { data: Ae, loading: G, error: je } = le({
50
+ variables: { id: h },
51
+ skip: !l || !h,
48
52
  fetchPolicy: "network-only"
49
53
  });
50
- _e(() => {
51
- u && (N(""), F(""), L(!1), z(null), V(h()), U(null), Te(!1), K(!1));
52
- }, [u, s]);
53
- let Oe = ve(() => Ce(m, g), [g, m]), ke = Ee?.jobPosting?.rounds ?? [], Ae = ke.filter((e) => s !== "assignment" || e.isAssignmentRound), J = ke.find((e) => e.id === M), Y = J ? y(Oe, J.id) : {
54
+ xe(() => {
55
+ l && (j(""), N(""), F(!1), L(null), R(m()), B(null), H(!1), W(!1));
56
+ }, [l, s]);
57
+ let K = Se(() => De(d, p), [p, d]), Me = ge(p), q = K.length === Me, Ne = Ae?.jobPosting?.rounds ?? [], Pe = Ne.filter((e) => s !== "assignment" || D(e)), J = Ne.find((e) => e.id === A), Y = J ? v(K, J.id) : {
54
58
  pairs: [],
55
59
  unresolved: []
56
- }, je = Y.unresolved.filter((e) => e.reason === "MISSING").length, X = Y.unresolved.filter((e) => e.reason === "AMBIGUOUS").length, Me = Se[s], Ne = Y.pairs.filter(({ round: e }) => v(e, Me)).length, Z = Y.pairs.filter(({ round: e }) => I || !v(e, Me)).length, Pe = Oe.some((e) => e.jobPostingId !== _), Q = T;
57
- !Q && De ? Q = "Could not load the posting rounds. Nothing will be sent." : !Q && Pe ? Q = "Some selected candidates do not belong to the filtered posting." : !Q && M && !q && !J ? Q = "The selected round is no longer available. Choose another round." : !Q && X > 0 && (Q = `${X} selected candidate${X === 1 ? " has" : "s have"} multiple concrete rounds for this configuration. Nothing will be sent until the data is corrected.`);
58
- let Fe = async () => {
59
- if (G || W || x || q || Q || !J || Y.pairs.length === 0 || Z === 0 || s === "message" && !P.trim()) return;
60
- K(!0), Te(!0), U(null), V(h());
61
- let e = await fe({
60
+ }, Fe = Y.unresolved.filter((e) => e.reason === "MISSING").length, X = Y.unresolved.filter((e) => e.reason === "AMBIGUOUS").length, Ie = O[s], Le = Y.pairs.filter(({ round: e }) => _(e, Ie)).length, Z = Y.pairs.filter(({ round: e }) => P || !_(e, Ie)).length, Re = K.some((e) => e.jobPostingId !== h), Q = ye;
61
+ !Q && je ? Q = "Could not load the posting rounds. Nothing will be sent." : !Q && !g && !q ? Q = "Some selected candidate details are unavailable. Refresh the selection before sending." : !Q && Re ? Q = "Some selected candidates do not belong to the filtered posting." : !Q && A && !G && !J ? Q = "The selected round is no longer available. Choose another round." : !Q && X > 0 && (Q = `${X} selected candidate${X === 1 ? " has" : "s have"} multiple concrete rounds for this configuration. Nothing will be sent until the data is corrected.`);
62
+ let ze = async () => {
63
+ if (U || V || g || G || Q || !q || !J || Y.pairs.length === 0 || Z === 0 || s === "message" && !M.trim()) return;
64
+ W(!0), H(!0), B(null), R(m());
65
+ let e = await me({
62
66
  items: Y.pairs.map(({ applicationId: e, roundId: t }) => ({
63
67
  applicationId: e,
64
68
  roundId: t
65
69
  })),
66
- initialAggregate: h(),
67
- onProgress: z,
70
+ initialAggregate: m(),
71
+ onProgress: L,
68
72
  executeChunk: async (e) => {
69
- let t = await we(O, e.map((e) => e.applicationId));
70
- if (de(e, t, _, J.id), s === "assignment") {
71
- let t = (await A(c, { input: {
73
+ let t = await Oe(C, e.map((e) => e.applicationId));
74
+ if (pe(e, t, h, J.id), s === "assignment") {
75
+ let t = (await k(ce, { input: {
72
76
  items: [...e],
73
- force: I
77
+ force: P
74
78
  } }, "BulkRandomizeAndSendAssignment")).bulkRandomizeAndSendAssignment;
75
79
  if (!t) throw Error("The assignment request returned no result.");
76
80
  let n = {
@@ -90,12 +94,12 @@ function j({ mode: s, open: u, onClose: f, onOpenAddRound: ue, targets: m, selec
90
94
  message: e.message
91
95
  }))
92
96
  };
93
- return p(e, n), n;
97
+ return f(e, n), n;
94
98
  }
95
- let n = (await A(l, { input: {
99
+ let n = (await k(c, { input: {
96
100
  items: [...e],
97
- message: P.trim(),
98
- force: I
101
+ message: M.trim(),
102
+ force: P
99
103
  } }, "BulkSendRoundMessage")).bulkSendRoundMessage;
100
104
  if (!n) throw Error("The message request returned no result.");
101
105
  let r = {
@@ -115,80 +119,80 @@ function j({ mode: s, open: u, onClose: f, onOpenAddRound: ue, targets: m, selec
115
119
  message: e.message
116
120
  }))
117
121
  };
118
- return p(e, r), r;
122
+ return f(e, r), r;
119
123
  },
120
- mergeResult: d
124
+ mergeResult: de
121
125
  });
122
- V(e.aggregate), e.error && U({
126
+ R(e.aggregate), e.error && B({
123
127
  knownCompleted: e.processedItems.length,
124
128
  ambiguous: e.ambiguousItems.length,
125
129
  notStarted: e.notStartedItems.length,
126
- message: k(e.error)
127
- }), le(pe({
130
+ message: Ee(e.error)
131
+ }), ue(he({
128
132
  succeeded: e.aggregate.succeeded.length,
129
133
  skipped: e.aggregate.skipped.length,
130
134
  failed: e.aggregate.failed.length,
131
135
  ambiguous: !!e.error
132
- })), K(!1), j.refetchQueries({ include: ["GetJobApplications", "GetJobApplicationInterviewRounds"] }).catch(() => void 0);
133
- }, $ = x || q;
134
- return /* @__PURE__ */ E(n, {
135
- open: u,
136
+ })), W(!1), E.refetchQueries({ include: ["GetJobApplications", "GetJobApplicationInterviewRounds"] }).catch(() => void 0);
137
+ }, $ = g || G;
138
+ return /* @__PURE__ */ w(n, {
139
+ open: l,
136
140
  onOpenChange: (e) => {
137
- !e && !G && f();
141
+ !e && !U && u();
138
142
  },
139
- children: /* @__PURE__ */ D(r, {
143
+ children: /* @__PURE__ */ T(r, {
140
144
  className: "sm:max-w-xl max-h-[90vh] overflow-y-auto",
141
145
  children: [
142
- /* @__PURE__ */ D(te, { children: [/* @__PURE__ */ E(ne, { children: s === "assignment" ? "Assign & Email Random Take-Home" : "Send Message" }), /* @__PURE__ */ E(ee, { children: "Choose one configured round for the candidates in the filtered posting." })] }),
143
- /* @__PURE__ */ E(b, {
146
+ /* @__PURE__ */ T(te, { children: [/* @__PURE__ */ w(ne, { children: s === "assignment" ? "Assign & Email Random Take-Home" : "Send Message" }), /* @__PURE__ */ w(ee, { children: "Choose one configured round for the candidates in the filtered posting." })] }),
147
+ /* @__PURE__ */ w(_e, {
144
148
  action: s,
145
- unresolvedCount: je
149
+ unresolvedCount: Fe
146
150
  }),
147
- W ? /* @__PURE__ */ D("div", {
151
+ V ? /* @__PURE__ */ T("div", {
148
152
  className: "space-y-4",
149
153
  children: [
150
- R ? /* @__PURE__ */ E(me, { progress: R }) : null,
151
- /* @__PURE__ */ E(he, { result: B }),
152
- H ? /* @__PURE__ */ E(ge, { details: H }) : null,
153
- /* @__PURE__ */ E(i, { children: /* @__PURE__ */ E(e, {
154
- onClick: f,
155
- disabled: G,
154
+ I ? /* @__PURE__ */ w(ve, { progress: I }) : null,
155
+ /* @__PURE__ */ w(y, { result: ke }),
156
+ z ? /* @__PURE__ */ w(be, { details: z }) : null,
157
+ /* @__PURE__ */ w(i, { children: /* @__PURE__ */ w(e, {
158
+ onClick: u,
159
+ disabled: U,
156
160
  children: "Done"
157
161
  }) })
158
162
  ]
159
- }) : /* @__PURE__ */ D("div", {
163
+ }) : /* @__PURE__ */ T("div", {
160
164
  className: "space-y-4",
161
165
  children: [
162
- $ ? /* @__PURE__ */ D("div", {
166
+ $ ? /* @__PURE__ */ T("div", {
163
167
  className: "flex items-center gap-2 text-sm text-text-secondary",
164
- children: [/* @__PURE__ */ E(C, {
168
+ children: [/* @__PURE__ */ w(x, {
165
169
  size: 14,
166
170
  className: "animate-spin"
167
171
  }), "Refreshing candidates and configured rounds…"]
168
172
  }) : null,
169
- Q ? /* @__PURE__ */ D("div", {
173
+ Q ? /* @__PURE__ */ T("div", {
170
174
  className: "flex items-start gap-2 text-sm text-status-error-text",
171
175
  role: "alert",
172
- children: [/* @__PURE__ */ E(ye, {
176
+ children: [/* @__PURE__ */ w(Ce, {
173
177
  size: 14,
174
178
  className: "mt-0.5 shrink-0"
175
- }), /* @__PURE__ */ E("span", { children: Q })]
179
+ }), /* @__PURE__ */ w("span", { children: Q })]
176
180
  }) : null,
177
- /* @__PURE__ */ D("div", {
181
+ /* @__PURE__ */ T("div", {
178
182
  className: "space-y-1.5",
179
183
  children: [
180
- /* @__PURE__ */ E(a, {
184
+ /* @__PURE__ */ w(a, {
181
185
  htmlFor: "bulk-round-config",
182
186
  children: "Target round"
183
187
  }),
184
- /* @__PURE__ */ D(re, {
185
- value: M,
186
- onValueChange: N,
188
+ /* @__PURE__ */ T(re, {
189
+ value: A,
190
+ onValueChange: j,
187
191
  disabled: $ || !!Q,
188
- children: [/* @__PURE__ */ E(oe, {
192
+ children: [/* @__PURE__ */ w(oe, {
189
193
  id: "bulk-round-config",
190
- children: /* @__PURE__ */ E(se, { placeholder: "Select a round" })
191
- }), /* @__PURE__ */ E(ie, { children: Ae.map((e) => /* @__PURE__ */ D(ae, {
194
+ children: /* @__PURE__ */ w(se, { placeholder: "Select a round" })
195
+ }), /* @__PURE__ */ w(ie, { children: Pe.map((e) => /* @__PURE__ */ T(ae, {
192
196
  value: e.id,
193
197
  children: [
194
198
  "Round ",
@@ -198,35 +202,35 @@ function j({ mode: s, open: u, onClose: f, onOpenAddRound: ue, targets: m, selec
198
202
  ]
199
203
  }, e.id)) })]
200
204
  }),
201
- Ae.length === 0 && !$ && !Q ? /* @__PURE__ */ E("p", {
205
+ Pe.length === 0 && !$ && !Q ? /* @__PURE__ */ w("p", {
202
206
  className: "text-xs text-status-warning-text",
203
207
  children: s === "assignment" ? "This posting has no configured assignment round." : "This posting has no configured interview rounds."
204
208
  }) : null
205
209
  ]
206
210
  }),
207
- s === "message" ? /* @__PURE__ */ D("div", {
211
+ s === "message" ? /* @__PURE__ */ T("div", {
208
212
  className: "space-y-1.5",
209
- children: [/* @__PURE__ */ E(a, {
213
+ children: [/* @__PURE__ */ w(a, {
210
214
  htmlFor: "bulk-message",
211
215
  children: "Free-text message"
212
- }), /* @__PURE__ */ E(o, {
216
+ }), /* @__PURE__ */ w(o, {
213
217
  id: "bulk-message",
214
- value: P,
215
- onChange: (e) => F(e.target.value),
218
+ value: M,
219
+ onChange: (e) => N(e.target.value),
216
220
  placeholder: "Write the message sent to each candidate",
217
221
  rows: 5
218
222
  })]
219
223
  }) : null,
220
- M && !$ && !Q ? /* @__PURE__ */ D("div", {
224
+ A && !$ && !Q ? /* @__PURE__ */ T("div", {
221
225
  className: "space-y-2 rounded-md border border-border-seam bg-bg-sunken/30 p-3 text-xs text-text-secondary",
222
226
  children: [
223
- /* @__PURE__ */ E("p", {
227
+ /* @__PURE__ */ w("p", {
224
228
  className: "font-medium text-text-primary",
225
229
  children: "Preview"
226
230
  }),
227
- /* @__PURE__ */ D("p", { children: [
231
+ /* @__PURE__ */ T("p", { children: [
228
232
  "Will send to ",
229
- /* @__PURE__ */ E("span", {
233
+ /* @__PURE__ */ w("span", {
230
234
  className: "font-semibold",
231
235
  children: Z
232
236
  }),
@@ -234,41 +238,41 @@ function j({ mode: s, open: u, onClose: f, onOpenAddRound: ue, targets: m, selec
234
238
  Z === 1 ? "" : "s",
235
239
  "."
236
240
  ] }),
237
- Ne > 0 ? /* @__PURE__ */ D("p", { children: [
238
- Ne,
241
+ Le > 0 ? /* @__PURE__ */ T("p", { children: [
242
+ Le,
239
243
  " already received this email type",
240
244
  " ",
241
- I ? "(force will send again)" : "(the backend will skip them)",
245
+ P ? "(force will send again)" : "(the backend will skip them)",
242
246
  "."
243
247
  ] }) : null,
244
- je > 0 ? /* @__PURE__ */ D(e, {
248
+ Fe > 0 ? /* @__PURE__ */ T(e, {
245
249
  type: "button",
246
250
  size: "sm",
247
251
  variant: "outline",
248
- onClick: ue,
249
- children: [/* @__PURE__ */ E(be, { size: 14 }), "Add Selected to Round"]
252
+ onClick: fe,
253
+ children: [/* @__PURE__ */ w(we, { size: 14 }), "Add Selected to Round"]
250
254
  }) : null,
251
- /* @__PURE__ */ D("label", {
255
+ /* @__PURE__ */ T("label", {
252
256
  className: "flex cursor-pointer items-start gap-2 pt-1",
253
- children: [/* @__PURE__ */ E(t, {
254
- checked: I,
255
- onCheckedChange: (e) => L(e === !0)
256
- }), /* @__PURE__ */ E("span", { children: "Force resend to candidates with a prior email. Force sends are non-idempotent and are never retried automatically." })]
257
+ children: [/* @__PURE__ */ w(t, {
258
+ checked: P,
259
+ onCheckedChange: (e) => F(e === !0)
260
+ }), /* @__PURE__ */ w("span", { children: "Force resend to candidates with a prior email. Force sends are non-idempotent and are never retried automatically." })]
257
261
  })
258
262
  ]
259
263
  }) : null,
260
- /* @__PURE__ */ D(i, { children: [/* @__PURE__ */ E(e, {
264
+ /* @__PURE__ */ T(i, { children: [/* @__PURE__ */ w(e, {
261
265
  variant: "outline",
262
- onClick: f,
263
- disabled: G,
266
+ onClick: u,
267
+ disabled: U,
264
268
  children: "Cancel"
265
- }), /* @__PURE__ */ D(e, {
266
- onClick: () => void Fe(),
267
- disabled: G || $ || !!Q || !M || Y.pairs.length === 0 || Z === 0 || s === "message" && !P.trim(),
268
- children: [G ? /* @__PURE__ */ E(C, {
269
+ }), /* @__PURE__ */ T(e, {
270
+ onClick: () => void ze(),
271
+ disabled: U || $ || !!Q || !q || !A || Y.pairs.length === 0 || Z === 0 || s === "message" && !M.trim(),
272
+ children: [U ? /* @__PURE__ */ w(x, {
269
273
  size: 16,
270
274
  className: "mr-2 animate-spin"
271
- }) : /* @__PURE__ */ E(w, { size: 16 }), G ? "Sending…" : "Send"]
275
+ }) : /* @__PURE__ */ w(S, { size: 16 }), U ? "Sending…" : "Send"]
272
276
  })] })
273
277
  ]
274
278
  })
@@ -276,30 +280,30 @@ function j({ mode: s, open: u, onClose: f, onOpenAddRound: ue, targets: m, selec
276
280
  })
277
281
  });
278
282
  }
279
- function M({ open: t, onClose: o, targets: c, selection: l, jobPostingId: u, previewLoading: d, previewError: de, refreshTargets: p }) {
280
- let h = xe(), [_, v] = S(""), [y, b] = S(null), [he, w] = S(g), [T, O] = S(null), [Se, j] = S(!1), [M, N] = S(!1), { data: P, loading: F, error: I } = ce({
281
- variables: { id: u },
282
- skip: !t || !u,
283
+ function j({ open: t, onClose: o, targets: ce, selection: c, jobPostingId: l, previewLoading: u, previewError: de, refreshTargets: pe }) {
284
+ let f = Te(), [m, g] = b(""), [_, v] = b(null), [_e, y] = b(h), [S, C] = b(null), [E, D] = b(!1), [O, A] = b(!1), { data: j, loading: M, error: N } = le({
285
+ variables: { id: l },
286
+ skip: !t || !l,
283
287
  fetchPolicy: "network-only"
284
288
  });
285
- _e(() => {
286
- t && (v(""), b(null), w(g()), O(null), j(!1), N(!1));
289
+ xe(() => {
290
+ t && (g(""), v(null), y(h()), C(null), D(!1), A(!1));
287
291
  }, [t]);
288
- let L = ve(() => Ce(c, l), [l, c]), R = L.map((e) => e.id), z = L.some((e) => e.jobPostingId !== u), B = P?.jobPosting?.rounds ?? [], V = B.find((e) => e.id === _), H = de;
289
- !H && I ? H = "Could not load the posting rounds. Nothing will be changed." : !H && z ? H = "Some selected candidates do not belong to the filtered posting." : !H && _ && !F && !V && (H = "The selected round is no longer available. Choose another round.");
290
- let U = async () => {
291
- if (M || Se || d || F || H || !V || R.length === 0) return;
292
- N(!0), j(!0), O(null), w(g());
293
- let e = await fe({
294
- items: R,
295
- initialAggregate: g(),
296
- onProgress: b,
292
+ let P = Se(() => De(ce, c), [c, ce]), F = ge(c), I = P.length === F, L = P.map((e) => e.id), ke = P.some((e) => e.jobPostingId !== l), R = j?.jobPosting?.rounds ?? [], z = R.find((e) => e.id === m), B = de;
293
+ !B && N ? B = "Could not load the posting rounds. Nothing will be changed." : !B && !u && !I ? B = "Some selected candidate details are unavailable. Refresh the selection before adding rounds." : !B && ke ? B = "Some selected candidates do not belong to the filtered posting." : !B && m && !M && !z && (B = "The selected round is no longer available. Choose another round.");
294
+ let V = async () => {
295
+ if (O || E || u || M || B || !I || !z || L.length === 0) return;
296
+ A(!0), D(!0), C(null), y(h());
297
+ let e = await me({
298
+ items: L,
299
+ initialAggregate: h(),
300
+ onProgress: v,
297
301
  executeChunk: async (e) => {
298
- let t = await we(p, e);
299
- ue(e, t, u);
300
- let n = (await A(s, { input: {
301
- jobPostingId: u,
302
- roundConfigId: V.id,
302
+ let t = await Oe(pe, e);
303
+ d(e, t, l);
304
+ let n = (await k(s, { input: {
305
+ jobPostingId: l,
306
+ roundConfigId: z.id,
303
307
  applicationIds: [...e]
304
308
  } }, "BulkEnsureInterviewRounds")).bulkEnsureInterviewRounds;
305
309
  if (!n) throw Error("The add-to-round request returned no result.");
@@ -318,80 +322,80 @@ function M({ open: t, onClose: o, targets: c, selection: l, jobPostingId: u, pre
318
322
  message: e.message
319
323
  }))
320
324
  };
321
- return m(e, r), r;
325
+ return p(e, r), r;
322
326
  },
323
- mergeResult: f
327
+ mergeResult: fe
324
328
  });
325
- w(e.aggregate), e.error && O({
329
+ y(e.aggregate), e.error && C({
326
330
  knownCompleted: e.processedItems.length,
327
331
  ambiguous: e.ambiguousItems.length,
328
332
  notStarted: e.notStartedItems.length,
329
- message: k(e.error)
330
- }), le(pe({
333
+ message: Ee(e.error)
334
+ }), ue(he({
331
335
  succeeded: e.aggregate.created.length + e.aggregate.alreadyPresent.length,
332
336
  skipped: 0,
333
337
  failed: e.aggregate.failed.length,
334
338
  ambiguous: !!e.error
335
- })), N(!1), h.refetchQueries({ include: ["GetJobApplications", "GetJobApplicationInterviewRounds"] }).catch(() => void 0);
336
- }, W = d || F;
337
- return /* @__PURE__ */ E(n, {
339
+ })), A(!1), f.refetchQueries({ include: ["GetJobApplications", "GetJobApplicationInterviewRounds"] }).catch(() => void 0);
340
+ }, H = u || M;
341
+ return /* @__PURE__ */ w(n, {
338
342
  open: t,
339
343
  onOpenChange: (e) => {
340
- !e && !M && o();
344
+ !e && !O && o();
341
345
  },
342
- children: /* @__PURE__ */ D(r, {
346
+ children: /* @__PURE__ */ T(r, {
343
347
  className: "sm:max-w-xl max-h-[90vh] overflow-y-auto",
344
348
  children: [
345
- /* @__PURE__ */ D(te, { children: [/* @__PURE__ */ E(ne, { children: "Add Selected to Round" }), /* @__PURE__ */ E(ee, { children: "Add every selected candidate in this posting to one configured interview round." })] }),
346
- /* @__PURE__ */ E("div", {
349
+ /* @__PURE__ */ T(te, { children: [/* @__PURE__ */ w(ne, { children: "Add Selected to Round" }), /* @__PURE__ */ w(ee, { children: "Add every selected candidate in this posting to one configured interview round." })] }),
350
+ /* @__PURE__ */ w("div", {
347
351
  className: "rounded-md border border-border-seam bg-bg-sunken/30 p-3 text-sm text-text-secondary",
348
352
  children: "Candidates without this concrete round are added with status Scheduled. Existing target rounds are left unchanged, and all prior round history and application status remain unchanged."
349
353
  }),
350
- Se ? /* @__PURE__ */ D("div", {
354
+ E ? /* @__PURE__ */ T("div", {
351
355
  className: "space-y-4",
352
356
  children: [
353
- y ? /* @__PURE__ */ E(me, { progress: y }) : null,
354
- /* @__PURE__ */ E(x, { result: he }),
355
- T ? /* @__PURE__ */ E(ge, { details: T }) : null,
356
- /* @__PURE__ */ E(i, { children: /* @__PURE__ */ E(e, {
357
+ _ ? /* @__PURE__ */ w(ve, { progress: _ }) : null,
358
+ /* @__PURE__ */ w(ye, { result: _e }),
359
+ S ? /* @__PURE__ */ w(be, { details: S }) : null,
360
+ /* @__PURE__ */ w(i, { children: /* @__PURE__ */ w(e, {
357
361
  onClick: o,
358
- disabled: M,
362
+ disabled: O,
359
363
  children: "Done"
360
364
  }) })
361
365
  ]
362
- }) : /* @__PURE__ */ D("div", {
366
+ }) : /* @__PURE__ */ T("div", {
363
367
  className: "space-y-4",
364
368
  children: [
365
- W ? /* @__PURE__ */ D("div", {
369
+ H ? /* @__PURE__ */ T("div", {
366
370
  className: "flex items-center gap-2 text-sm text-text-secondary",
367
- children: [/* @__PURE__ */ E(C, {
371
+ children: [/* @__PURE__ */ w(x, {
368
372
  size: 14,
369
373
  className: "animate-spin"
370
374
  }), "Refreshing candidates and configured rounds…"]
371
375
  }) : null,
372
- H ? /* @__PURE__ */ D("div", {
376
+ B ? /* @__PURE__ */ T("div", {
373
377
  className: "flex items-start gap-2 text-sm text-status-error-text",
374
378
  role: "alert",
375
- children: [/* @__PURE__ */ E(ye, {
379
+ children: [/* @__PURE__ */ w(Ce, {
376
380
  size: 14,
377
381
  className: "mt-0.5 shrink-0"
378
- }), /* @__PURE__ */ E("span", { children: H })]
382
+ }), /* @__PURE__ */ w("span", { children: B })]
379
383
  }) : null,
380
- /* @__PURE__ */ D("div", {
384
+ /* @__PURE__ */ T("div", {
381
385
  className: "space-y-1.5",
382
386
  children: [
383
- /* @__PURE__ */ E(a, {
387
+ /* @__PURE__ */ w(a, {
384
388
  htmlFor: "ensure-round-config",
385
389
  children: "Interview round"
386
390
  }),
387
- /* @__PURE__ */ D(re, {
388
- value: _,
389
- onValueChange: v,
390
- disabled: W || !!H,
391
- children: [/* @__PURE__ */ E(oe, {
391
+ /* @__PURE__ */ T(re, {
392
+ value: m,
393
+ onValueChange: g,
394
+ disabled: H || !!B,
395
+ children: [/* @__PURE__ */ w(oe, {
392
396
  id: "ensure-round-config",
393
- children: /* @__PURE__ */ E(se, { placeholder: "Select a round" })
394
- }), /* @__PURE__ */ E(ie, { children: B.map((e) => /* @__PURE__ */ D(ae, {
397
+ children: /* @__PURE__ */ w(se, { placeholder: "Select a round" })
398
+ }), /* @__PURE__ */ w(ie, { children: R.map((e) => /* @__PURE__ */ T(ae, {
395
399
  value: e.id,
396
400
  children: [
397
401
  "Round ",
@@ -401,33 +405,34 @@ function M({ open: t, onClose: o, targets: c, selection: l, jobPostingId: u, pre
401
405
  ]
402
406
  }, e.id)) })]
403
407
  }),
404
- B.length === 0 && !W && !H ? /* @__PURE__ */ E("p", {
408
+ R.length === 0 && !H && !B ? /* @__PURE__ */ w("p", {
405
409
  className: "text-xs text-status-warning-text",
406
410
  children: "This posting has no configured interview rounds."
407
411
  }) : null
408
412
  ]
409
413
  }),
410
- /* @__PURE__ */ D("p", {
414
+ /* @__PURE__ */ T("p", {
411
415
  className: "text-xs text-text-secondary",
412
416
  children: [
413
- R.length,
417
+ F,
414
418
  " selected candidate",
415
- R.length === 1 ? "" : "s",
416
- " will be checked. Existing target rounds are reported as already present."
419
+ F === 1 ? "" : "s",
420
+ " ",
421
+ "will be checked. Existing target rounds are reported as already present."
417
422
  ]
418
423
  }),
419
- /* @__PURE__ */ D(i, { children: [/* @__PURE__ */ E(e, {
424
+ /* @__PURE__ */ T(i, { children: [/* @__PURE__ */ w(e, {
420
425
  variant: "outline",
421
426
  onClick: o,
422
- disabled: M,
427
+ disabled: O,
423
428
  children: "Cancel"
424
- }), /* @__PURE__ */ D(e, {
425
- onClick: () => void U(),
426
- disabled: M || W || !!H || !_ || R.length === 0,
427
- children: [M ? /* @__PURE__ */ E(C, {
429
+ }), /* @__PURE__ */ T(e, {
430
+ onClick: () => void V(),
431
+ disabled: O || H || !!B || !I || !m || L.length === 0,
432
+ children: [O ? /* @__PURE__ */ w(x, {
428
433
  size: 16,
429
434
  className: "mr-2 animate-spin"
430
- }) : /* @__PURE__ */ E(be, { size: 16 }), M ? "Adding…" : "Add Selected to Round"]
435
+ }) : /* @__PURE__ */ w(we, { size: 16 }), O ? "Adding…" : "Add Selected to Round"]
431
436
  })] })
432
437
  ]
433
438
  })
@@ -436,6 +441,6 @@ function M({ open: t, onClose: o, targets: c, selection: l, jobPostingId: u, pre
436
441
  });
437
442
  }
438
443
  //#endregion
439
- export { M as AddSelectedToRoundDialog, j as BulkCandidateSendDialog };
444
+ export { j as AddSelectedToRoundDialog, A as BulkCandidateSendDialog, D as isAssignmentRoundConfig };
440
445
 
441
446
  //# sourceMappingURL=BulkCandidateDialogs.js.map