@burdenoff/microfe-support 2026.819.1 → 2026.819.3

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