@burdenoff/microfe-support 2026.902.1 → 2026.902.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,32 +1,33 @@
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 o, SelectContent as s, SelectItem as c, SelectTrigger as l, SelectValue as re, Textarea as u } from "../ui.js";
2
- import { BulkEnsureInterviewRoundsDocument as d, BulkRandomizeAndSendAssignmentDocument as f, BulkSendCustomEmailDocument as p, BulkSendRoundMessageDocument as m, NotifyDuplicateApplicantsDocument as h, useGetJobPostingQuery as g } from "../../../generated/global-operations.js";
3
- import { InterviewRoundType as _ } from "../../../generated/global-types.js";
4
- import { nativeNotify as ie } from "../../../utils/nativeBridge.js";
5
- import { RichTextEditor as v } from "./RichTextEditor.js";
6
- import { aggregateBulkCustomEmailResult as y, aggregateCandidateEmailResult as b, aggregateDuplicateNoticeResult as x, aggregateEnsureRoundResult as S, assertCompleteBulkCustomEmailChunkResult as C, assertCompleteCandidateEmailChunkResult as w, assertCompleteEnsureRoundChunkResult as T, createEmptyBulkCustomEmailAggregate as E, createEmptyCandidateEmailAggregate as D, createEmptyDuplicateNoticeAggregate as O, createEmptyEnsureRoundAggregate as k, executeSequentialCandidateChunks as ae, getBulkOperationNotificationSeverity as oe, getCandidateSelectionCount as se, getSelectedCandidateIds as A, hasCandidateEmailType as j, resolveExactCandidateRounds as M } from "../../utils/bulkCandidateOperations.js";
7
- import { BulkCandidateActionGuidance as N } from "./BulkCandidateActionGuidance.js";
8
- import { BulkCustomEmailResultDetails as P, BulkOperationProgress as ce, CandidateEmailResultDetails as F, DuplicateNoticeResultDetails as I, EnsureRoundResultDetails as L, StoppedBulkOperationNotice as le } from "./BulkOperationFeedback.js";
9
- import { useEffect as ue, useMemo as de, useState as R } from "react";
10
- import { AlertCircle as fe, Loader2 as z, Mail as B, Send as V, UserPlus as pe } from "lucide-react";
11
- import { graphqlFetch as H } from "@burdenoff/fe-libs/shared/graphql/fetch";
12
- import { jsx as U, jsxs as W } from "react/jsx-runtime";
13
- import { useApolloClient as me } from "@apollo/client/react";
14
- import { print as G } from "graphql";
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 a, Label as o, Select as s, SelectContent as c, SelectItem as l, SelectTrigger as u, SelectValue as ne, Textarea as d } from "../ui.js";
2
+ import { BulkEnsureInterviewRoundsDocument as f, BulkRandomizeAndSendAssignmentDocument as p, BulkSendCustomEmailDocument as m, BulkSendRoundMessageDocument as h, BulkUpdateApplicationStatusDocument as g, NotifyDuplicateApplicantsDocument as _, useGetJobPostingQuery as v } from "../../../generated/global-operations.js";
3
+ import { InterviewRoundType as y } from "../../../generated/global-types.js";
4
+ import { nativeNotify as re } from "../../../utils/nativeBridge.js";
5
+ import { statusLabels as b, statusOrder as x } from "../../constants/pipeline.js";
6
+ import { RichTextEditor as S } from "./RichTextEditor.js";
7
+ import { aggregateBulkCustomEmailResult as C, aggregateBulkStatusUpdateResult as w, aggregateCandidateEmailResult as T, aggregateDuplicateNoticeResult as E, aggregateEnsureRoundResult as D, assertCompleteBulkCustomEmailChunkResult as O, assertCompleteBulkStatusUpdateChunkResult as k, assertCompleteCandidateEmailChunkResult as A, assertCompleteEnsureRoundChunkResult as j, createEmptyBulkCustomEmailAggregate as M, createEmptyBulkStatusUpdateAggregate as N, createEmptyCandidateEmailAggregate as P, createEmptyDuplicateNoticeAggregate as F, createEmptyEnsureRoundAggregate as I, executeSequentialCandidateChunks as ie, getBulkOperationNotificationSeverity as ae, getCandidateSelectionCount as oe, getSelectedCandidateIds as L, hasCandidateEmailType as R, resolveExactCandidateRounds as z } from "../../utils/bulkCandidateOperations.js";
8
+ import { BulkCandidateActionGuidance as B } from "./BulkCandidateActionGuidance.js";
9
+ import { BulkCustomEmailResultDetails as V, BulkOperationProgress as se, BulkStatusUpdateResultDetails as ce, CandidateEmailResultDetails as le, DuplicateNoticeResultDetails as H, EnsureRoundResultDetails as ue, StoppedBulkOperationNotice as U } from "./BulkOperationFeedback.js";
10
+ import { useEffect as de, useMemo as fe, useState as W } from "react";
11
+ import { AlertCircle as pe, Loader2 as G, Mail as K, Send as me, Tag as q, UserPlus as he } from "lucide-react";
12
+ import { graphqlFetch as ge } from "@burdenoff/fe-libs/shared/graphql/fetch";
13
+ import { jsx as J, jsxs as Y } from "react/jsx-runtime";
14
+ import { useApolloClient as _e } from "@apollo/client/react";
15
+ import { print as ve } from "graphql";
15
16
  //#region src/support/components/careers/BulkCandidateDialogs.tsx
16
- function he(e) {
17
- return e.isAssignmentRound || e.roundType === _.TakeHome;
17
+ function ye(e) {
18
+ return e.isAssignmentRound || e.roundType === y.TakeHome;
18
19
  }
19
- var ge = {
20
+ var be = {
20
21
  message: "ROUND_MESSAGE",
21
22
  assignment: "ASSIGNMENT"
22
23
  };
23
- function _e(e) {
24
+ function xe(e) {
24
25
  return e instanceof Error ? e.message : "The request failed without an error message.";
25
26
  }
26
- async function K(e, t, n) {
27
- let r = await H({
27
+ async function X(e, t, n) {
28
+ let r = await ge({
28
29
  gateway: "global",
29
- query: G(e),
30
+ query: ve(e),
30
31
  variables: t,
31
32
  operationName: n,
32
33
  skipAuthRetry: !0
@@ -35,39 +36,39 @@ async function K(e, t, n) {
35
36
  if (!r.data) throw Error(`${n} returned no data.`);
36
37
  return r.data;
37
38
  }
38
- function ve(e, t) {
39
- let n = A(t);
39
+ function Se(e, t) {
40
+ let n = L(t);
40
41
  return e.filter((e) => n.has(e.id));
41
42
  }
42
- function q({ mode: d, open: p, onClose: h, onOpenAddRound: _, targets: v, selection: y, jobPostingId: x, previewLoading: S, previewError: C }) {
43
- let T = me(), [E, O] = R(""), [k, A] = R(""), [P, I] = R(!1), [L, B] = R(null), [H, G] = R(D), [q, J] = R(null), [ye, Y] = R(!1), [X, be] = R(!1), { data: xe, loading: Se, error: Ce } = g({
43
+ function Ce({ mode: f, open: m, onClose: g, onOpenAddRound: _, targets: y, selection: b, jobPostingId: x, previewLoading: S, previewError: C }) {
44
+ let w = _e(), [E, D] = W(""), [O, k] = W(""), [j, M] = W(!1), [N, F] = W(null), [I, L] = W(P), [V, ce] = W(null), [H, ue] = W(!1), [K, q] = W(!1), { data: ge, loading: ve, error: Ce } = v({
44
45
  variables: { id: x },
45
- skip: !p || !x,
46
+ skip: !m || !x,
46
47
  fetchPolicy: "network-only"
47
48
  });
48
- ue(() => {
49
- p && (O(""), A(""), I(!1), B(null), G(D()), J(null), Y(!1), be(!1));
50
- }, [p, d]);
51
- let we = de(() => ve(v, y), [y, v]), Te = se(y), Ee = we.length === Te, De = xe?.jobPosting?.rounds ?? [], Oe = De.filter((e) => d !== "assignment" || he(e)), ke = De.find((e) => e.id === E), Z = ke ? M(we, ke.id) : {
49
+ de(() => {
50
+ m && (D(""), k(""), M(!1), F(null), L(P()), ce(null), ue(!1), q(!1));
51
+ }, [m, f]);
52
+ let we = fe(() => Se(y, b), [b, y]), Te = oe(b), Ee = we.length === Te, De = ge?.jobPosting?.rounds ?? [], Oe = De.filter((e) => f !== "assignment" || ye(e)), ke = De.find((e) => e.id === E), Z = ke ? z(we, ke.id) : {
52
53
  pairs: [],
53
54
  unresolved: []
54
- }, Ae = Z.unresolved.filter((e) => e.reason === "MISSING").length, je = Z.unresolved.filter((e) => e.reason === "AMBIGUOUS").length, Me = ge[d], Ne = Z.pairs.filter(({ round: e }) => j(e, Me)).length, Pe = Z.pairs.filter(({ round: e }) => P || !j(e, Me)).length, Fe = we.some((e) => e.jobPostingId !== x), Q = C;
55
- !Q && Ce ? Q = "Could not load the posting rounds. Nothing will be sent." : !Q && !S && !Ee ? 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 && E && !Se && !ke ? Q = "The selected round is no longer available. Choose another round." : !Q && je > 0 && (Q = `${je} selected candidate${je === 1 ? " has" : "s have"} multiple concrete rounds for this configuration. Nothing will be sent until the data is corrected.`);
55
+ }, Ae = Z.unresolved.filter((e) => e.reason === "MISSING").length, je = Z.unresolved.filter((e) => e.reason === "AMBIGUOUS").length, Me = be[f], Ne = Z.pairs.filter(({ round: e }) => R(e, Me)).length, Pe = Z.pairs.filter(({ round: e }) => j || !R(e, Me)).length, Fe = we.some((e) => e.jobPostingId !== x), Q = C;
56
+ !Q && Ce ? Q = "Could not load the posting rounds. Nothing will be sent." : !Q && !S && !Ee ? 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 && E && !ve && !ke ? Q = "The selected round is no longer available. Choose another round." : !Q && je > 0 && (Q = `${je} selected candidate${je === 1 ? " has" : "s have"} multiple concrete rounds for this configuration. Nothing will be sent until the data is corrected.`);
56
57
  let Ie = async () => {
57
- if (X || ye || S || Se || Q || !Ee || !ke || Z.pairs.length === 0 || Pe === 0 || d === "message" && !k.trim()) return;
58
- be(!0), Y(!0), J(null), G(D());
59
- let e = await ae({
58
+ if (K || H || S || ve || Q || !Ee || !ke || Z.pairs.length === 0 || Pe === 0 || f === "message" && !O.trim()) return;
59
+ q(!0), ue(!0), ce(null), L(P());
60
+ let e = await ie({
60
61
  items: Z.pairs.map(({ applicationId: e, roundId: t }) => ({
61
62
  applicationId: e,
62
63
  roundId: t
63
64
  })),
64
- initialAggregate: D(),
65
- onProgress: B,
65
+ initialAggregate: P(),
66
+ onProgress: F,
66
67
  executeChunk: async (e) => {
67
- if (d === "assignment") {
68
- let t = (await K(f, { input: {
68
+ if (f === "assignment") {
69
+ let t = (await X(p, { input: {
69
70
  items: [...e],
70
- force: P
71
+ force: j
71
72
  } }, "BulkRandomizeAndSendAssignment")).bulkRandomizeAndSendAssignment;
72
73
  if (!t) throw Error("The assignment request returned no result.");
73
74
  let n = {
@@ -87,12 +88,12 @@ function q({ mode: d, open: p, onClose: h, onOpenAddRound: _, targets: v, select
87
88
  message: e.message
88
89
  }))
89
90
  };
90
- return w(e, n), n;
91
+ return A(e, n), n;
91
92
  }
92
- let t = (await K(m, { input: {
93
+ let t = (await X(h, { input: {
93
94
  items: [...e],
94
- message: k.trim(),
95
- force: P
95
+ message: O.trim(),
96
+ force: j
96
97
  } }, "BulkSendRoundMessage")).bulkSendRoundMessage;
97
98
  if (!t) throw Error("The message request returned no result.");
98
99
  let n = {
@@ -112,80 +113,80 @@ function q({ mode: d, open: p, onClose: h, onOpenAddRound: _, targets: v, select
112
113
  message: e.message
113
114
  }))
114
115
  };
115
- return w(e, n), n;
116
+ return A(e, n), n;
116
117
  },
117
- mergeResult: b
118
+ mergeResult: T
118
119
  });
119
- G(e.aggregate), e.error && J({
120
+ L(e.aggregate), e.error && ce({
120
121
  knownCompleted: e.processedItems.length,
121
122
  ambiguous: e.ambiguousItems.length,
122
123
  notStarted: e.notStartedItems.length,
123
- message: _e(e.error)
124
- }), ie(oe({
124
+ message: xe(e.error)
125
+ }), re(ae({
125
126
  succeeded: e.aggregate.succeeded.length,
126
127
  skipped: e.aggregate.skipped.length,
127
128
  failed: e.aggregate.failed.length,
128
129
  ambiguous: !!e.error
129
- })), be(!1), T.refetchQueries({ include: ["GetJobApplications", "GetJobApplicationInterviewRounds"] }).catch(() => void 0);
130
- }, $ = S || Se;
131
- return /* @__PURE__ */ U(n, {
132
- open: p,
130
+ })), q(!1), w.refetchQueries({ include: ["GetJobApplications", "GetJobApplicationInterviewRounds"] }).catch(() => void 0);
131
+ }, $ = S || ve;
132
+ return /* @__PURE__ */ J(n, {
133
+ open: m,
133
134
  onOpenChange: (e) => {
134
- !e && !X && h();
135
+ !e && !K && g();
135
136
  },
136
- children: /* @__PURE__ */ W(r, {
137
+ children: /* @__PURE__ */ Y(r, {
137
138
  className: "sm:max-w-xl max-h-[90vh] overflow-y-auto",
138
139
  children: [
139
- /* @__PURE__ */ W(te, { children: [/* @__PURE__ */ U(ne, { children: d === "assignment" ? "Assign & Email Random Take-Home" : "Send Message" }), /* @__PURE__ */ U(ee, { children: "Choose one configured round for the candidates in the filtered posting." })] }),
140
- /* @__PURE__ */ U(N, {
141
- action: d,
140
+ /* @__PURE__ */ Y(te, { children: [/* @__PURE__ */ J(a, { children: f === "assignment" ? "Assign & Email Random Take-Home" : "Send Message" }), /* @__PURE__ */ J(ee, { children: "Choose one configured round for the candidates in the filtered posting." })] }),
141
+ /* @__PURE__ */ J(B, {
142
+ action: f,
142
143
  unresolvedCount: Ae
143
144
  }),
144
- ye ? /* @__PURE__ */ W("div", {
145
+ H ? /* @__PURE__ */ Y("div", {
145
146
  className: "space-y-4",
146
147
  children: [
147
- L ? /* @__PURE__ */ U(ce, { progress: L }) : null,
148
- /* @__PURE__ */ U(F, { result: H }),
149
- q ? /* @__PURE__ */ U(le, { details: q }) : null,
150
- /* @__PURE__ */ U(i, { children: /* @__PURE__ */ U(e, {
151
- onClick: h,
152
- disabled: X,
148
+ N ? /* @__PURE__ */ J(se, { progress: N }) : null,
149
+ /* @__PURE__ */ J(le, { result: I }),
150
+ V ? /* @__PURE__ */ J(U, { details: V }) : null,
151
+ /* @__PURE__ */ J(i, { children: /* @__PURE__ */ J(e, {
152
+ onClick: g,
153
+ disabled: K,
153
154
  children: "Done"
154
155
  }) })
155
156
  ]
156
- }) : /* @__PURE__ */ W("div", {
157
+ }) : /* @__PURE__ */ Y("div", {
157
158
  className: "space-y-4",
158
159
  children: [
159
- $ ? /* @__PURE__ */ W("div", {
160
+ $ ? /* @__PURE__ */ Y("div", {
160
161
  className: "flex items-center gap-2 text-sm text-text-secondary",
161
- children: [/* @__PURE__ */ U(z, {
162
+ children: [/* @__PURE__ */ J(G, {
162
163
  size: 14,
163
164
  className: "animate-spin"
164
165
  }), "Refreshing candidates and configured rounds…"]
165
166
  }) : null,
166
- Q ? /* @__PURE__ */ W("div", {
167
+ Q ? /* @__PURE__ */ Y("div", {
167
168
  className: "flex items-start gap-2 text-sm text-status-error-text",
168
169
  role: "alert",
169
- children: [/* @__PURE__ */ U(fe, {
170
+ children: [/* @__PURE__ */ J(pe, {
170
171
  size: 14,
171
172
  className: "mt-0.5 shrink-0"
172
- }), /* @__PURE__ */ U("span", { children: Q })]
173
+ }), /* @__PURE__ */ J("span", { children: Q })]
173
174
  }) : null,
174
- /* @__PURE__ */ W("div", {
175
+ /* @__PURE__ */ Y("div", {
175
176
  className: "space-y-1.5",
176
177
  children: [
177
- /* @__PURE__ */ U(a, {
178
+ /* @__PURE__ */ J(o, {
178
179
  htmlFor: "bulk-round-config",
179
180
  children: "Target round"
180
181
  }),
181
- /* @__PURE__ */ W(o, {
182
+ /* @__PURE__ */ Y(s, {
182
183
  value: E,
183
- onValueChange: O,
184
+ onValueChange: D,
184
185
  disabled: $ || !!Q,
185
- children: [/* @__PURE__ */ U(l, {
186
+ children: [/* @__PURE__ */ J(u, {
186
187
  id: "bulk-round-config",
187
- children: /* @__PURE__ */ U(re, { placeholder: "Select a round" })
188
- }), /* @__PURE__ */ U(s, { children: Oe.map((e) => /* @__PURE__ */ W(c, {
188
+ children: /* @__PURE__ */ J(ne, { placeholder: "Select a round" })
189
+ }), /* @__PURE__ */ J(c, { children: Oe.map((e) => /* @__PURE__ */ Y(l, {
189
190
  value: e.id,
190
191
  children: [
191
192
  "Round ",
@@ -195,35 +196,35 @@ function q({ mode: d, open: p, onClose: h, onOpenAddRound: _, targets: v, select
195
196
  ]
196
197
  }, e.id)) })]
197
198
  }),
198
- Oe.length === 0 && !$ && !Q ? /* @__PURE__ */ U("p", {
199
+ Oe.length === 0 && !$ && !Q ? /* @__PURE__ */ J("p", {
199
200
  className: "text-xs text-status-warning-text",
200
- children: d === "assignment" ? "This posting has no configured assignment round." : "This posting has no configured interview rounds."
201
+ children: f === "assignment" ? "This posting has no configured assignment round." : "This posting has no configured interview rounds."
201
202
  }) : null
202
203
  ]
203
204
  }),
204
- d === "message" ? /* @__PURE__ */ W("div", {
205
+ f === "message" ? /* @__PURE__ */ Y("div", {
205
206
  className: "space-y-1.5",
206
- children: [/* @__PURE__ */ U(a, {
207
+ children: [/* @__PURE__ */ J(o, {
207
208
  htmlFor: "bulk-message",
208
209
  children: "Free-text message"
209
- }), /* @__PURE__ */ U(u, {
210
+ }), /* @__PURE__ */ J(d, {
210
211
  id: "bulk-message",
211
- value: k,
212
- onChange: (e) => A(e.target.value),
212
+ value: O,
213
+ onChange: (e) => k(e.target.value),
213
214
  placeholder: "Write the message sent to each candidate",
214
215
  rows: 5
215
216
  })]
216
217
  }) : null,
217
- E && !$ && !Q ? /* @__PURE__ */ W("div", {
218
+ E && !$ && !Q ? /* @__PURE__ */ Y("div", {
218
219
  className: "space-y-2 rounded-md border border-border-seam bg-bg-sunken/30 p-3 text-xs text-text-secondary",
219
220
  children: [
220
- /* @__PURE__ */ U("p", {
221
+ /* @__PURE__ */ J("p", {
221
222
  className: "font-medium text-text-primary",
222
223
  children: "Preview"
223
224
  }),
224
- /* @__PURE__ */ W("p", { children: [
225
+ /* @__PURE__ */ Y("p", { children: [
225
226
  "Will send to ",
226
- /* @__PURE__ */ U("span", {
227
+ /* @__PURE__ */ J("span", {
227
228
  className: "font-semibold",
228
229
  children: Pe
229
230
  }),
@@ -231,41 +232,41 @@ function q({ mode: d, open: p, onClose: h, onOpenAddRound: _, targets: v, select
231
232
  Pe === 1 ? "" : "s",
232
233
  "."
233
234
  ] }),
234
- Ne > 0 ? /* @__PURE__ */ W("p", { children: [
235
+ Ne > 0 ? /* @__PURE__ */ Y("p", { children: [
235
236
  Ne,
236
237
  " already received this email type",
237
238
  " ",
238
- P ? "(force will send again)" : "(the backend will skip them)",
239
+ j ? "(force will send again)" : "(the backend will skip them)",
239
240
  "."
240
241
  ] }) : null,
241
- Ae > 0 ? /* @__PURE__ */ W(e, {
242
+ Ae > 0 ? /* @__PURE__ */ Y(e, {
242
243
  type: "button",
243
244
  size: "sm",
244
245
  variant: "outline",
245
246
  onClick: _,
246
- children: [/* @__PURE__ */ U(pe, { size: 14 }), "Add Selected to Round"]
247
+ children: [/* @__PURE__ */ J(he, { size: 14 }), "Add Selected to Round"]
247
248
  }) : null,
248
- /* @__PURE__ */ W("label", {
249
+ /* @__PURE__ */ Y("label", {
249
250
  className: "flex cursor-pointer items-start gap-2 pt-1",
250
- children: [/* @__PURE__ */ U(t, {
251
- checked: P,
252
- onCheckedChange: (e) => I(e === !0)
253
- }), /* @__PURE__ */ U("span", { children: "Force resend to candidates with a prior email. Force sends are non-idempotent and are never retried automatically." })]
251
+ children: [/* @__PURE__ */ J(t, {
252
+ checked: j,
253
+ onCheckedChange: (e) => M(e === !0)
254
+ }), /* @__PURE__ */ J("span", { children: "Force resend to candidates with a prior email. Force sends are non-idempotent and are never retried automatically." })]
254
255
  })
255
256
  ]
256
257
  }) : null,
257
- /* @__PURE__ */ W(i, { children: [/* @__PURE__ */ U(e, {
258
+ /* @__PURE__ */ Y(i, { children: [/* @__PURE__ */ J(e, {
258
259
  variant: "outline",
259
- onClick: h,
260
- disabled: X,
260
+ onClick: g,
261
+ disabled: K,
261
262
  children: "Cancel"
262
- }), /* @__PURE__ */ W(e, {
263
+ }), /* @__PURE__ */ Y(e, {
263
264
  onClick: () => void Ie(),
264
- disabled: X || $ || !!Q || !Ee || !E || Z.pairs.length === 0 || Pe === 0 || d === "message" && !k.trim(),
265
- children: [X ? /* @__PURE__ */ U(z, {
265
+ disabled: K || $ || !!Q || !Ee || !E || Z.pairs.length === 0 || Pe === 0 || f === "message" && !O.trim(),
266
+ children: [K ? /* @__PURE__ */ J(G, {
266
267
  size: 16,
267
268
  className: "mr-2 animate-spin"
268
- }) : /* @__PURE__ */ U(V, { size: 16 }), X ? "Sending…" : "Send"]
269
+ }) : /* @__PURE__ */ J(me, { size: 16 }), K ? "Sending…" : "Send"]
269
270
  })] })
270
271
  ]
271
272
  })
@@ -273,28 +274,28 @@ function q({ mode: d, open: p, onClose: h, onOpenAddRound: _, targets: v, select
273
274
  })
274
275
  });
275
276
  }
276
- function J({ open: t, onClose: u, targets: f, selection: p, jobPostingId: m, previewLoading: h, previewError: _ }) {
277
- let v = me(), [y, b] = R(""), [x, C] = R(null), [w, E] = R(k), [D, O] = R(null), [A, j] = R(!1), [M, N] = R(!1), { data: P, loading: F, error: I } = g({
278
- variables: { id: m },
279
- skip: !t || !m,
277
+ function we({ open: t, onClose: d, targets: p, selection: m, jobPostingId: h, previewLoading: g, previewError: _ }) {
278
+ let y = _e(), [b, x] = W(""), [S, C] = W(null), [w, T] = W(I), [E, O] = W(null), [k, A] = W(!1), [M, N] = W(!1), { data: P, loading: F, error: L } = v({
279
+ variables: { id: h },
280
+ skip: !t || !h,
280
281
  fetchPolicy: "network-only"
281
282
  });
282
- ue(() => {
283
- t && (b(""), C(null), E(k()), O(null), j(!1), N(!1));
283
+ de(() => {
284
+ t && (x(""), C(null), T(I()), O(null), A(!1), N(!1));
284
285
  }, [t]);
285
- let B = de(() => ve(f, p), [p, f]), V = se(p), H = B.length === V, G = B.map((e) => e.id), he = B.some((e) => e.jobPostingId !== m), ge = P?.jobPosting?.rounds ?? [], q = ge.find((e) => e.id === y), J = _;
286
- !J && I ? J = "Could not load the posting rounds. Nothing will be changed." : !J && !h && !H ? J = "Some selected candidate details are unavailable. Refresh the selection before adding rounds." : !J && he ? J = "Some selected candidates do not belong to the filtered posting." : !J && y && !F && !q && (J = "The selected round is no longer available. Choose another round.");
287
- let ye = async () => {
288
- if (M || A || h || F || J || !H || !q || G.length === 0) return;
289
- N(!0), j(!0), O(null), E(k());
290
- let e = await ae({
291
- items: G,
292
- initialAggregate: k(),
286
+ let R = fe(() => Se(p, m), [m, p]), z = oe(m), B = R.length === z, V = R.map((e) => e.id), ce = R.some((e) => e.jobPostingId !== h), le = P?.jobPosting?.rounds ?? [], H = le.find((e) => e.id === b), K = _;
287
+ !K && L ? K = "Could not load the posting rounds. Nothing will be changed." : !K && !g && !B ? K = "Some selected candidate details are unavailable. Refresh the selection before adding rounds." : !K && ce ? K = "Some selected candidates do not belong to the filtered posting." : !K && b && !F && !H && (K = "The selected round is no longer available. Choose another round.");
288
+ let me = async () => {
289
+ if (M || k || g || F || K || !B || !H || V.length === 0) return;
290
+ N(!0), A(!0), O(null), T(I());
291
+ let e = await ie({
292
+ items: V,
293
+ initialAggregate: I(),
293
294
  onProgress: C,
294
295
  executeChunk: async (e) => {
295
- let t = (await K(d, { input: {
296
- jobPostingId: m,
297
- roundConfigId: q.id,
296
+ let t = (await X(f, { input: {
297
+ jobPostingId: h,
298
+ roundConfigId: H.id,
298
299
  applicationIds: [...e]
299
300
  } }, "BulkEnsureInterviewRounds")).bulkEnsureInterviewRounds;
300
301
  if (!t) throw Error("The add-to-round request returned no result.");
@@ -313,80 +314,80 @@ function J({ open: t, onClose: u, targets: f, selection: p, jobPostingId: m, pre
313
314
  message: e.message
314
315
  }))
315
316
  };
316
- return T(e, n), n;
317
+ return j(e, n), n;
317
318
  },
318
- mergeResult: S
319
+ mergeResult: D
319
320
  });
320
- E(e.aggregate), e.error && O({
321
+ T(e.aggregate), e.error && O({
321
322
  knownCompleted: e.processedItems.length,
322
323
  ambiguous: e.ambiguousItems.length,
323
324
  notStarted: e.notStartedItems.length,
324
- message: _e(e.error)
325
- }), ie(oe({
325
+ message: xe(e.error)
326
+ }), re(ae({
326
327
  succeeded: e.aggregate.created.length + e.aggregate.alreadyPresent.length,
327
328
  skipped: 0,
328
329
  failed: e.aggregate.failed.length,
329
330
  ambiguous: !!e.error
330
- })), N(!1), v.refetchQueries({ include: ["GetJobApplications", "GetJobApplicationInterviewRounds"] }).catch(() => void 0);
331
- }, Y = h || F;
332
- return /* @__PURE__ */ U(n, {
331
+ })), N(!1), y.refetchQueries({ include: ["GetJobApplications", "GetJobApplicationInterviewRounds"] }).catch(() => void 0);
332
+ }, q = g || F;
333
+ return /* @__PURE__ */ J(n, {
333
334
  open: t,
334
335
  onOpenChange: (e) => {
335
- !e && !M && u();
336
+ !e && !M && d();
336
337
  },
337
- children: /* @__PURE__ */ W(r, {
338
+ children: /* @__PURE__ */ Y(r, {
338
339
  className: "sm:max-w-xl max-h-[90vh] overflow-y-auto",
339
340
  children: [
340
- /* @__PURE__ */ W(te, { children: [/* @__PURE__ */ U(ne, { children: "Add Selected to Round" }), /* @__PURE__ */ U(ee, { children: "Add every selected candidate in this posting to one configured interview round." })] }),
341
- /* @__PURE__ */ U("div", {
341
+ /* @__PURE__ */ Y(te, { children: [/* @__PURE__ */ J(a, { children: "Add Selected to Round" }), /* @__PURE__ */ J(ee, { children: "Add every selected candidate in this posting to one configured interview round." })] }),
342
+ /* @__PURE__ */ J("div", {
342
343
  className: "rounded-md border border-border-seam bg-bg-sunken/30 p-3 text-sm text-text-secondary",
343
344
  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."
344
345
  }),
345
- A ? /* @__PURE__ */ W("div", {
346
+ k ? /* @__PURE__ */ Y("div", {
346
347
  className: "space-y-4",
347
348
  children: [
348
- x ? /* @__PURE__ */ U(ce, { progress: x }) : null,
349
- /* @__PURE__ */ U(L, { result: w }),
350
- D ? /* @__PURE__ */ U(le, { details: D }) : null,
351
- /* @__PURE__ */ U(i, { children: /* @__PURE__ */ U(e, {
352
- onClick: u,
349
+ S ? /* @__PURE__ */ J(se, { progress: S }) : null,
350
+ /* @__PURE__ */ J(ue, { result: w }),
351
+ E ? /* @__PURE__ */ J(U, { details: E }) : null,
352
+ /* @__PURE__ */ J(i, { children: /* @__PURE__ */ J(e, {
353
+ onClick: d,
353
354
  disabled: M,
354
355
  children: "Done"
355
356
  }) })
356
357
  ]
357
- }) : /* @__PURE__ */ W("div", {
358
+ }) : /* @__PURE__ */ Y("div", {
358
359
  className: "space-y-4",
359
360
  children: [
360
- Y ? /* @__PURE__ */ W("div", {
361
+ q ? /* @__PURE__ */ Y("div", {
361
362
  className: "flex items-center gap-2 text-sm text-text-secondary",
362
- children: [/* @__PURE__ */ U(z, {
363
+ children: [/* @__PURE__ */ J(G, {
363
364
  size: 14,
364
365
  className: "animate-spin"
365
366
  }), "Refreshing candidates and configured rounds…"]
366
367
  }) : null,
367
- J ? /* @__PURE__ */ W("div", {
368
+ K ? /* @__PURE__ */ Y("div", {
368
369
  className: "flex items-start gap-2 text-sm text-status-error-text",
369
370
  role: "alert",
370
- children: [/* @__PURE__ */ U(fe, {
371
+ children: [/* @__PURE__ */ J(pe, {
371
372
  size: 14,
372
373
  className: "mt-0.5 shrink-0"
373
- }), /* @__PURE__ */ U("span", { children: J })]
374
+ }), /* @__PURE__ */ J("span", { children: K })]
374
375
  }) : null,
375
- /* @__PURE__ */ W("div", {
376
+ /* @__PURE__ */ Y("div", {
376
377
  className: "space-y-1.5",
377
378
  children: [
378
- /* @__PURE__ */ U(a, {
379
+ /* @__PURE__ */ J(o, {
379
380
  htmlFor: "ensure-round-config",
380
381
  children: "Interview round"
381
382
  }),
382
- /* @__PURE__ */ W(o, {
383
- value: y,
384
- onValueChange: b,
385
- disabled: Y || !!J,
386
- children: [/* @__PURE__ */ U(l, {
383
+ /* @__PURE__ */ Y(s, {
384
+ value: b,
385
+ onValueChange: x,
386
+ disabled: q || !!K,
387
+ children: [/* @__PURE__ */ J(u, {
387
388
  id: "ensure-round-config",
388
- children: /* @__PURE__ */ U(re, { placeholder: "Select a round" })
389
- }), /* @__PURE__ */ U(s, { children: ge.map((e) => /* @__PURE__ */ W(c, {
389
+ children: /* @__PURE__ */ J(ne, { placeholder: "Select a round" })
390
+ }), /* @__PURE__ */ J(c, { children: le.map((e) => /* @__PURE__ */ Y(l, {
390
391
  value: e.id,
391
392
  children: [
392
393
  "Round ",
@@ -396,34 +397,34 @@ function J({ open: t, onClose: u, targets: f, selection: p, jobPostingId: m, pre
396
397
  ]
397
398
  }, e.id)) })]
398
399
  }),
399
- ge.length === 0 && !Y && !J ? /* @__PURE__ */ U("p", {
400
+ le.length === 0 && !q && !K ? /* @__PURE__ */ J("p", {
400
401
  className: "text-xs text-status-warning-text",
401
402
  children: "This posting has no configured interview rounds."
402
403
  }) : null
403
404
  ]
404
405
  }),
405
- /* @__PURE__ */ W("p", {
406
+ /* @__PURE__ */ Y("p", {
406
407
  className: "text-xs text-text-secondary",
407
408
  children: [
408
- V,
409
+ z,
409
410
  " selected candidate",
410
- V === 1 ? "" : "s",
411
+ z === 1 ? "" : "s",
411
412
  " ",
412
413
  "will be checked. Existing target rounds are reported as already present."
413
414
  ]
414
415
  }),
415
- /* @__PURE__ */ W(i, { children: [/* @__PURE__ */ U(e, {
416
+ /* @__PURE__ */ Y(i, { children: [/* @__PURE__ */ J(e, {
416
417
  variant: "outline",
417
- onClick: u,
418
+ onClick: d,
418
419
  disabled: M,
419
420
  children: "Cancel"
420
- }), /* @__PURE__ */ W(e, {
421
- onClick: () => void ye(),
422
- disabled: M || Y || !!J || !H || !y || G.length === 0,
423
- children: [M ? /* @__PURE__ */ U(z, {
421
+ }), /* @__PURE__ */ Y(e, {
422
+ onClick: () => void me(),
423
+ disabled: M || q || !!K || !B || !b || V.length === 0,
424
+ children: [M ? /* @__PURE__ */ J(G, {
424
425
  size: 16,
425
426
  className: "mr-2 animate-spin"
426
- }) : /* @__PURE__ */ U(pe, { size: 16 }), M ? "Adding…" : "Add Selected to Round"]
427
+ }) : /* @__PURE__ */ J(he, { size: 16 }), M ? "Adding…" : "Add Selected to Round"]
427
428
  })] })
428
429
  ]
429
430
  })
@@ -431,22 +432,22 @@ function J({ open: t, onClose: u, targets: f, selection: p, jobPostingId: m, pre
431
432
  })
432
433
  });
433
434
  }
434
- function ye({ open: t, onClose: a, targets: o, selection: s, jobPostingId: c, previewLoading: l, previewError: re }) {
435
- let u = me(), [d, f] = R(null), [p, m] = R(O), [g, _] = R(null), [v, y] = R(!1), [b, S] = R(!1);
436
- ue(() => {
437
- t && (f(null), m(O()), _(null), y(!1), S(!1));
435
+ function Te({ open: t, onClose: o, targets: s, selection: c, jobPostingId: l, previewLoading: u, previewError: ne }) {
436
+ let d = _e(), [f, p] = W(null), [m, h] = W(F), [g, v] = W(null), [y, b] = W(!1), [x, S] = W(!1);
437
+ de(() => {
438
+ t && (p(null), h(F()), v(null), b(!1), S(!1));
438
439
  }, [t]);
439
- let C = de(() => ve(o, s), [s, o]), w = se(s), T = C.length === w, E = C.map((e) => e.id), D = C.some((e) => e.jobPostingId !== c), k = re;
440
- !k && !l && !T ? k = "Some selected candidate details are unavailable. Refresh the selection before notifying." : !k && D && (k = "Some selected candidates do not belong to the filtered posting.");
440
+ let C = fe(() => Se(s, c), [c, s]), w = oe(c), T = C.length === w, D = C.map((e) => e.id), O = C.some((e) => e.jobPostingId !== l), k = ne;
441
+ !k && !u && !T ? k = "Some selected candidate details are unavailable. Refresh the selection before notifying." : !k && O && (k = "Some selected candidates do not belong to the filtered posting.");
441
442
  let A = async () => {
442
- if (b || v || l || k || !T || E.length === 0) return;
443
- S(!0), y(!0), _(null), m(O());
444
- let e = await ae({
445
- items: E,
446
- initialAggregate: O(),
447
- onProgress: f,
443
+ if (x || y || u || k || !T || D.length === 0) return;
444
+ S(!0), b(!0), v(null), h(F());
445
+ let e = await ie({
446
+ items: D,
447
+ initialAggregate: F(),
448
+ onProgress: p,
448
449
  executeChunk: async (e) => {
449
- let t = (await K(h, { input: { applicationIds: [...e] } }, "NotifyDuplicateApplicants")).notifyDuplicateApplicants;
450
+ let t = (await X(_, { input: { applicationIds: [...e] } }, "NotifyDuplicateApplicants")).notifyDuplicateApplicants;
450
451
  if (!t) throw Error("The duplicate-notice request returned no result.");
451
452
  return {
452
453
  succeeded: t.succeeded.map((e) => ({ email: e.email })),
@@ -461,64 +462,64 @@ function ye({ open: t, onClose: a, targets: o, selection: s, jobPostingId: c, pr
461
462
  }))
462
463
  };
463
464
  },
464
- mergeResult: x
465
+ mergeResult: E
465
466
  });
466
- m(e.aggregate), e.error && _({
467
+ h(e.aggregate), e.error && v({
467
468
  knownCompleted: e.processedItems.length,
468
469
  ambiguous: e.ambiguousItems.length,
469
470
  notStarted: e.notStartedItems.length,
470
- message: _e(e.error)
471
- }), ie(oe({
471
+ message: xe(e.error)
472
+ }), re(ae({
472
473
  succeeded: e.aggregate.succeeded.length,
473
474
  skipped: e.aggregate.skipped.length,
474
475
  failed: e.aggregate.failed.length,
475
476
  ambiguous: !!e.error
476
- })), S(!1), u.refetchQueries({ include: ["GetJobApplications"] }).catch(() => void 0);
477
+ })), S(!1), d.refetchQueries({ include: ["GetJobApplications"] }).catch(() => void 0);
477
478
  };
478
- return /* @__PURE__ */ U(n, {
479
+ return /* @__PURE__ */ J(n, {
479
480
  open: t,
480
481
  onOpenChange: (e) => {
481
- !e && !b && a();
482
+ !e && !x && o();
482
483
  },
483
- children: /* @__PURE__ */ W(r, {
484
+ children: /* @__PURE__ */ Y(r, {
484
485
  className: "sm:max-w-xl max-h-[90vh] overflow-y-auto",
485
486
  children: [
486
- /* @__PURE__ */ W(te, { children: [/* @__PURE__ */ U(ne, { children: "Notify Duplicate Applicants" }), /* @__PURE__ */ U(ee, { children: "Let candidates with more than one application know they only need to complete one take-home assignment." })] }),
487
- /* @__PURE__ */ U("div", {
487
+ /* @__PURE__ */ Y(te, { children: [/* @__PURE__ */ J(a, { children: "Notify Duplicate Applicants" }), /* @__PURE__ */ J(ee, { children: "Let candidates with more than one application know they only need to complete one take-home assignment." })] }),
488
+ /* @__PURE__ */ J("div", {
488
489
  className: "rounded-md border border-border-seam bg-bg-sunken/30 p-3 text-sm text-text-secondary",
489
490
  children: "Selected applications are grouped by email address — exactly one notice goes out per unique candidate, even if you select several of their duplicate applications. An email that only appears once among your selection is skipped (it isn't a duplicate), and an email already notified before is skipped automatically."
490
491
  }),
491
- v ? /* @__PURE__ */ W("div", {
492
+ y ? /* @__PURE__ */ Y("div", {
492
493
  className: "space-y-4",
493
494
  children: [
494
- d ? /* @__PURE__ */ U(ce, { progress: d }) : null,
495
- /* @__PURE__ */ U(I, { result: p }),
496
- g ? /* @__PURE__ */ U(le, { details: g }) : null,
497
- /* @__PURE__ */ U(i, { children: /* @__PURE__ */ U(e, {
498
- onClick: a,
499
- disabled: b,
495
+ f ? /* @__PURE__ */ J(se, { progress: f }) : null,
496
+ /* @__PURE__ */ J(H, { result: m }),
497
+ g ? /* @__PURE__ */ J(U, { details: g }) : null,
498
+ /* @__PURE__ */ J(i, { children: /* @__PURE__ */ J(e, {
499
+ onClick: o,
500
+ disabled: x,
500
501
  children: "Done"
501
502
  }) })
502
503
  ]
503
- }) : /* @__PURE__ */ W("div", {
504
+ }) : /* @__PURE__ */ Y("div", {
504
505
  className: "space-y-4",
505
506
  children: [
506
- l ? /* @__PURE__ */ W("div", {
507
+ u ? /* @__PURE__ */ Y("div", {
507
508
  className: "flex items-center gap-2 text-sm text-text-secondary",
508
- children: [/* @__PURE__ */ U(z, {
509
+ children: [/* @__PURE__ */ J(G, {
509
510
  size: 14,
510
511
  className: "animate-spin"
511
512
  }), "Refreshing candidates…"]
512
513
  }) : null,
513
- k ? /* @__PURE__ */ W("div", {
514
+ k ? /* @__PURE__ */ Y("div", {
514
515
  className: "flex items-start gap-2 text-sm text-status-error-text",
515
516
  role: "alert",
516
- children: [/* @__PURE__ */ U(fe, {
517
+ children: [/* @__PURE__ */ J(pe, {
517
518
  size: 14,
518
519
  className: "mt-0.5 shrink-0"
519
- }), /* @__PURE__ */ U("span", { children: k })]
520
+ }), /* @__PURE__ */ J("span", { children: k })]
520
521
  }) : null,
521
- /* @__PURE__ */ W("p", {
522
+ /* @__PURE__ */ Y("p", {
522
523
  className: "text-xs text-text-secondary",
523
524
  children: [
524
525
  w,
@@ -528,18 +529,18 @@ function ye({ open: t, onClose: a, targets: o, selection: s, jobPostingId: c, pr
528
529
  "will be checked and grouped by email."
529
530
  ]
530
531
  }),
531
- /* @__PURE__ */ W(i, { children: [/* @__PURE__ */ U(e, {
532
+ /* @__PURE__ */ Y(i, { children: [/* @__PURE__ */ J(e, {
532
533
  variant: "outline",
533
- onClick: a,
534
- disabled: b,
534
+ onClick: o,
535
+ disabled: x,
535
536
  children: "Cancel"
536
- }), /* @__PURE__ */ W(e, {
537
+ }), /* @__PURE__ */ Y(e, {
537
538
  onClick: () => void A(),
538
- disabled: b || l || !!k || !T || E.length === 0,
539
- children: [b ? /* @__PURE__ */ U(z, {
539
+ disabled: x || u || !!k || !T || D.length === 0,
540
+ children: [x ? /* @__PURE__ */ J(G, {
540
541
  size: 16,
541
542
  className: "mr-2 animate-spin"
542
- }) : /* @__PURE__ */ U(B, { size: 16 }), b ? "Notifying…" : "Notify Duplicate Applicants"]
543
+ }) : /* @__PURE__ */ J(K, { size: 16 }), x ? "Notifying…" : "Notify Duplicate Applicants"]
543
544
  })] })
544
545
  ]
545
546
  })
@@ -547,25 +548,25 @@ function ye({ open: t, onClose: a, targets: o, selection: s, jobPostingId: c, pr
547
548
  })
548
549
  });
549
550
  }
550
- function Y({ open: t, onClose: o, targets: s, selection: c, previewLoading: l, previewError: re }) {
551
- let u = me(), [d, f] = R(""), [m, h] = R(""), [g, _] = R(null), [b, x] = R(E), [S, w] = R(null), [T, D] = R(!1), [O, k] = R(!1);
552
- ue(() => {
553
- t && (f(""), h(""), _(null), x(E()), w(null), D(!1), k(!1));
551
+ function Ee({ open: t, onClose: s, targets: c, selection: l, previewLoading: u, previewError: ne }) {
552
+ let d = _e(), [f, p] = W(""), [h, g] = W(""), [_, v] = W(null), [y, b] = W(M), [x, w] = W(null), [T, E] = W(!1), [D, k] = W(!1);
553
+ de(() => {
554
+ t && (p(""), g(""), v(null), b(M()), w(null), E(!1), k(!1));
554
555
  }, [t]);
555
- let A = de(() => ve(s, c), [c, s]), j = se(c), M = A.length === j, N = A.map((e) => e.id), F = d.trim().length > 0, I = m.trim().length > 0, L = re;
556
- !L && !l && !M && (L = "Some selected candidate details are unavailable. Refresh the selection before sending.");
557
- let V = !O && !T && !l && !L && M && N.length > 0 && F && I, pe = async () => {
558
- if (!V) return;
559
- k(!0), D(!0), w(null), x(E());
560
- let e = await ae({
561
- items: N,
562
- initialAggregate: E(),
563
- onProgress: _,
556
+ let A = fe(() => Se(c, l), [l, c]), j = oe(l), N = A.length === j, P = A.map((e) => e.id), F = f.trim().length > 0, I = h.trim().length > 0, L = ne;
557
+ !L && !u && !N && (L = "Some selected candidate details are unavailable. Refresh the selection before sending.");
558
+ let R = !D && !T && !u && !L && N && P.length > 0 && F && I, z = async () => {
559
+ if (!R) return;
560
+ k(!0), E(!0), w(null), b(M());
561
+ let e = await ie({
562
+ items: P,
563
+ initialAggregate: M(),
564
+ onProgress: v,
564
565
  executeChunk: async (e) => {
565
- let t = (await K(p, { input: {
566
+ let t = (await X(m, { input: {
566
567
  applicationIds: [...e],
567
- subject: d.trim(),
568
- message: m
568
+ subject: f.trim(),
569
+ message: h
569
570
  } }, "BulkSendCustomEmail")).bulkSendCustomEmail;
570
571
  if (!t) throw Error("The bulk email request returned no result.");
571
572
  let n = {
@@ -578,84 +579,84 @@ function Y({ open: t, onClose: o, targets: s, selection: c, previewLoading: l, p
578
579
  message: e.message
579
580
  }))
580
581
  };
581
- return C([...e], n), n;
582
+ return O([...e], n), n;
582
583
  },
583
- mergeResult: y
584
+ mergeResult: C
584
585
  });
585
- x(e.aggregate), e.error && w({
586
+ b(e.aggregate), e.error && w({
586
587
  knownCompleted: e.processedItems.length,
587
588
  ambiguous: e.ambiguousItems.length,
588
589
  notStarted: e.notStartedItems.length,
589
- message: _e(e.error)
590
- }), ie(oe({
590
+ message: xe(e.error)
591
+ }), re(ae({
591
592
  succeeded: e.aggregate.succeeded.length,
592
593
  skipped: 0,
593
594
  failed: e.aggregate.failed.length,
594
595
  ambiguous: !!e.error
595
- })), k(!1), u.refetchQueries({ include: ["GetJobApplications"] }).catch(() => void 0);
596
+ })), k(!1), d.refetchQueries({ include: ["GetJobApplications"] }).catch(() => void 0);
596
597
  };
597
- return /* @__PURE__ */ U(n, {
598
+ return /* @__PURE__ */ J(n, {
598
599
  open: t,
599
600
  onOpenChange: (e) => {
600
- !e && !O && o();
601
+ !e && !D && s();
601
602
  },
602
- children: /* @__PURE__ */ W(r, {
603
+ children: /* @__PURE__ */ Y(r, {
603
604
  className: "sm:max-w-xl max-h-[90vh] overflow-y-auto",
604
- children: [/* @__PURE__ */ W(te, { children: [/* @__PURE__ */ U(ne, { children: "Send Custom Email" }), /* @__PURE__ */ U(ee, { children: "Send the same branded email — your own subject and message — to every selected candidate, regardless of their stage or round. Useful for progress updates or a closing note to candidates who won't move forward." })] }), T ? /* @__PURE__ */ W("div", {
605
+ children: [/* @__PURE__ */ Y(te, { children: [/* @__PURE__ */ J(a, { children: "Send Custom Email" }), /* @__PURE__ */ J(ee, { children: "Send the same branded email — your own subject and message — to every selected candidate, regardless of their stage or round. Useful for progress updates or a closing note to candidates who won't move forward." })] }), T ? /* @__PURE__ */ Y("div", {
605
606
  className: "space-y-4",
606
607
  children: [
607
- g ? /* @__PURE__ */ U(ce, { progress: g }) : null,
608
- /* @__PURE__ */ U(P, { result: b }),
609
- S ? /* @__PURE__ */ U(le, { details: S }) : null,
610
- /* @__PURE__ */ U(i, { children: /* @__PURE__ */ U(e, {
611
- onClick: o,
612
- disabled: O,
608
+ _ ? /* @__PURE__ */ J(se, { progress: _ }) : null,
609
+ /* @__PURE__ */ J(V, { result: y }),
610
+ x ? /* @__PURE__ */ J(U, { details: x }) : null,
611
+ /* @__PURE__ */ J(i, { children: /* @__PURE__ */ J(e, {
612
+ onClick: s,
613
+ disabled: D,
613
614
  children: "Done"
614
615
  }) })
615
616
  ]
616
- }) : /* @__PURE__ */ W("div", {
617
+ }) : /* @__PURE__ */ Y("div", {
617
618
  className: "space-y-4",
618
619
  children: [
619
- l ? /* @__PURE__ */ W("div", {
620
+ u ? /* @__PURE__ */ Y("div", {
620
621
  className: "flex items-center gap-2 text-sm text-text-secondary",
621
- children: [/* @__PURE__ */ U(z, {
622
+ children: [/* @__PURE__ */ J(G, {
622
623
  size: 14,
623
624
  className: "animate-spin"
624
625
  }), "Refreshing candidates…"]
625
626
  }) : null,
626
- L ? /* @__PURE__ */ W("div", {
627
+ L ? /* @__PURE__ */ Y("div", {
627
628
  className: "flex items-start gap-2 text-sm text-status-error-text",
628
629
  role: "alert",
629
- children: [/* @__PURE__ */ U(fe, {
630
+ children: [/* @__PURE__ */ J(pe, {
630
631
  size: 14,
631
632
  className: "mt-0.5 shrink-0"
632
- }), /* @__PURE__ */ U("span", { children: L })]
633
+ }), /* @__PURE__ */ J("span", { children: L })]
633
634
  }) : null,
634
- /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U(a, {
635
+ /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J(o, {
635
636
  htmlFor: "bulk-custom-email-subject",
636
637
  children: "Subject"
637
- }), /* @__PURE__ */ U("input", {
638
+ }), /* @__PURE__ */ J("input", {
638
639
  id: "bulk-custom-email-subject",
639
640
  type: "text",
640
- value: d,
641
- onChange: (e) => f(e.target.value),
641
+ value: f,
642
+ onChange: (e) => p(e.target.value),
642
643
  placeholder: "e.g. An update on your application",
643
644
  className: "mt-1.5 w-full rounded-lg border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/30"
644
645
  })] }),
645
- /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U(a, {
646
+ /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J(o, {
646
647
  htmlFor: "bulk-custom-email-message",
647
648
  children: "Message"
648
- }), /* @__PURE__ */ U("div", {
649
+ }), /* @__PURE__ */ J("div", {
649
650
  className: "mt-1.5",
650
- children: /* @__PURE__ */ U(v, {
651
+ children: /* @__PURE__ */ J(S, {
651
652
  id: "bulk-custom-email-message",
652
- value: m,
653
- onChange: h,
653
+ value: h,
654
+ onChange: g,
654
655
  placeholder: "Type your message… This will be sent as a branded email to every selected candidate.",
655
656
  "aria-required": !0
656
657
  })
657
658
  })] }),
658
- /* @__PURE__ */ W("p", {
659
+ /* @__PURE__ */ Y("p", {
659
660
  className: "text-xs text-text-secondary",
660
661
  children: [
661
662
  j,
@@ -665,18 +666,144 @@ function Y({ open: t, onClose: o, targets: s, selection: c, previewLoading: l, p
665
666
  "will each receive their own copy of this email."
666
667
  ]
667
668
  }),
668
- /* @__PURE__ */ W(i, { children: [/* @__PURE__ */ U(e, {
669
+ /* @__PURE__ */ Y(i, { children: [/* @__PURE__ */ J(e, {
670
+ variant: "outline",
671
+ onClick: s,
672
+ disabled: D,
673
+ children: "Cancel"
674
+ }), /* @__PURE__ */ Y(e, {
675
+ onClick: () => void z(),
676
+ disabled: !R,
677
+ children: [D ? /* @__PURE__ */ J(G, {
678
+ size: 16,
679
+ className: "mr-2 animate-spin"
680
+ }) : /* @__PURE__ */ J(K, { size: 16 }), D ? "Sending…" : "Send Email"]
681
+ })] })
682
+ ]
683
+ })]
684
+ })
685
+ });
686
+ }
687
+ function De({ open: t, onClose: d, targets: f, selection: p, previewLoading: m, previewError: h }) {
688
+ let _ = _e(), [v, y] = W(null), [S, C] = W(null), [T, E] = W(N), [D, O] = W(null), [A, j] = W(!1), [M, P] = W(!1);
689
+ de(() => {
690
+ t && (y(null), C(null), E(N()), O(null), j(!1), P(!1));
691
+ }, [t]);
692
+ let F = fe(() => Se(f, p), [p, f]), I = oe(p), L = F.length === I, R = F.map((e) => e.id), z = h;
693
+ !z && !m && !L && (z = "Some selected candidate details are unavailable. Refresh the selection before updating.");
694
+ let B = !M && !A && !m && !z && L && R.length > 0 && v !== null, V = async () => {
695
+ if (!B || v === null) return;
696
+ P(!0), j(!0), O(null), E(N());
697
+ let e = await ie({
698
+ items: R,
699
+ initialAggregate: N(),
700
+ onProgress: C,
701
+ executeChunk: async (e) => {
702
+ let t = (await X(g, { input: {
703
+ applicationIds: [...e],
704
+ status: v
705
+ } }, "BulkUpdateApplicationStatus")).bulkUpdateApplicationStatus;
706
+ if (!t) throw Error("The bulk status update request returned no result.");
707
+ let n = {
708
+ succeeded: t.succeeded.map((e) => ({
709
+ applicationId: e.id,
710
+ status: e.status
711
+ })),
712
+ failed: t.failed.map((e) => ({
713
+ applicationId: e.applicationId,
714
+ message: e.message
715
+ }))
716
+ };
717
+ return k([...e], n), n;
718
+ },
719
+ mergeResult: w
720
+ });
721
+ E(e.aggregate), e.error && O({
722
+ knownCompleted: e.processedItems.length,
723
+ ambiguous: e.ambiguousItems.length,
724
+ notStarted: e.notStartedItems.length,
725
+ message: xe(e.error)
726
+ }), re(ae({
727
+ succeeded: e.aggregate.succeeded.length,
728
+ skipped: 0,
729
+ failed: e.aggregate.failed.length,
730
+ ambiguous: !!e.error
731
+ })), P(!1), _.refetchQueries({ include: ["GetJobApplications"] }).catch(() => void 0);
732
+ };
733
+ return /* @__PURE__ */ J(n, {
734
+ open: t,
735
+ onOpenChange: (e) => {
736
+ !e && !M && d();
737
+ },
738
+ children: /* @__PURE__ */ Y(r, {
739
+ className: "sm:max-w-md",
740
+ children: [/* @__PURE__ */ Y(te, { children: [/* @__PURE__ */ J(a, { children: "Update Status" }), /* @__PURE__ */ J(ee, { children: "Set the same status on every selected candidate — e.g. mark everyone you just sent a bulk email as \"Email Sent\" so a later send doesn't reach them twice, then move them back to their real stage once you decide the outcome." })] }), A ? /* @__PURE__ */ Y("div", {
741
+ className: "space-y-4",
742
+ children: [
743
+ S ? /* @__PURE__ */ J(se, { progress: S }) : null,
744
+ /* @__PURE__ */ J(ce, { result: T }),
745
+ D ? /* @__PURE__ */ J(U, { details: D }) : null,
746
+ /* @__PURE__ */ J(i, { children: /* @__PURE__ */ J(e, {
747
+ onClick: d,
748
+ disabled: M,
749
+ children: "Done"
750
+ }) })
751
+ ]
752
+ }) : /* @__PURE__ */ Y("div", {
753
+ className: "space-y-4",
754
+ children: [
755
+ m ? /* @__PURE__ */ Y("div", {
756
+ className: "flex items-center gap-2 text-sm text-text-secondary",
757
+ children: [/* @__PURE__ */ J(G, {
758
+ size: 14,
759
+ className: "animate-spin"
760
+ }), "Refreshing candidates…"]
761
+ }) : null,
762
+ z ? /* @__PURE__ */ Y("div", {
763
+ className: "flex items-start gap-2 text-sm text-status-error-text",
764
+ role: "alert",
765
+ children: [/* @__PURE__ */ J(pe, {
766
+ size: 14,
767
+ className: "mt-0.5 shrink-0"
768
+ }), /* @__PURE__ */ J("span", { children: z })]
769
+ }) : null,
770
+ /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J(o, {
771
+ htmlFor: "bulk-status-update-status",
772
+ children: "New status"
773
+ }), /* @__PURE__ */ Y(s, {
774
+ value: v ?? "",
775
+ onValueChange: (e) => y(e),
776
+ children: [/* @__PURE__ */ J(u, {
777
+ id: "bulk-status-update-status",
778
+ className: "mt-1.5",
779
+ children: /* @__PURE__ */ J(ne, { placeholder: "Select a status" })
780
+ }), /* @__PURE__ */ J(c, { children: x.map((e) => /* @__PURE__ */ J(l, {
781
+ value: e,
782
+ children: b[e] || e
783
+ }, e)) })]
784
+ })] }),
785
+ /* @__PURE__ */ Y("p", {
786
+ className: "text-xs text-text-secondary",
787
+ children: [
788
+ I,
789
+ " selected candidate",
790
+ I === 1 ? "" : "s",
791
+ " ",
792
+ "will be moved to this status."
793
+ ]
794
+ }),
795
+ /* @__PURE__ */ Y(i, { children: [/* @__PURE__ */ J(e, {
669
796
  variant: "outline",
670
- onClick: o,
671
- disabled: O,
797
+ onClick: d,
798
+ disabled: M,
672
799
  children: "Cancel"
673
- }), /* @__PURE__ */ W(e, {
674
- onClick: () => void pe(),
675
- disabled: !V,
676
- children: [O ? /* @__PURE__ */ U(z, {
800
+ }), /* @__PURE__ */ Y(e, {
801
+ onClick: () => void V(),
802
+ disabled: !B,
803
+ children: [M ? /* @__PURE__ */ J(G, {
677
804
  size: 16,
678
805
  className: "mr-2 animate-spin"
679
- }) : /* @__PURE__ */ U(B, { size: 16 }), O ? "Sending…" : "Send Email"]
806
+ }) : /* @__PURE__ */ J(q, { size: 16 }), M ? "Updating…" : "Update Status"]
680
807
  })] })
681
808
  ]
682
809
  })]
@@ -684,6 +811,6 @@ function Y({ open: t, onClose: o, targets: s, selection: c, previewLoading: l, p
684
811
  });
685
812
  }
686
813
  //#endregion
687
- export { J as AddSelectedToRoundDialog, q as BulkCandidateSendDialog, Y as BulkCustomEmailDialog, ye as NotifyDuplicateApplicantsDialog, he as isAssignmentRoundConfig };
814
+ export { we as AddSelectedToRoundDialog, Ce as BulkCandidateSendDialog, Ee as BulkCustomEmailDialog, De as BulkStatusUpdateDialog, Te as NotifyDuplicateApplicantsDialog, ye as isAssignmentRoundConfig };
688
815
 
689
816
  //# sourceMappingURL=BulkCandidateDialogs.js.map