@feedmepos/mf-hrm-portal 2.3.0-dev.7 → 2.3.0-dev.9

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.
Files changed (88) hide show
  1. package/dist/{ApprovalCodeList-J-NC4Z5M.js → ApprovalCodeList-BDpxEJpC.js} +5 -5
  2. package/dist/{AuditLogList-B1Sb8HDk.js → AuditLogList-Dgwj1gz8.js} +4 -4
  3. package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BlXgJvsO.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BBK2gl7r.js} +2 -2
  4. package/dist/{EmployeeList-DprCwGC9.js → EmployeeList-C8cbVcmY.js} +6 -6
  5. package/dist/{GrantUserList-BWeZAzUC.js → GrantUserList-zul0_Dlm.js} +6 -6
  6. package/dist/{Main-Dna6CkrV.js → Main-5TsFTFpc.js} +8 -8
  7. package/dist/{Main-BZCIlbf3.js → Main-Cjo4FMZZ.js} +5 -5
  8. package/dist/{Main-CGlnX97k.js → Main-DSr9KbjT.js} +11 -11
  9. package/dist/{PermissionSetList-DuJjihft.js → PermissionSetList-CDhiiu37.js} +7 -7
  10. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-RI8tMDoe.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DoK944l0.js} +971 -971
  11. package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-fe-Rdwn4.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-BVz6q3HE.js} +1 -1
  12. package/dist/{RoleList-Jn8EeYqo.js → RoleList-DEbOPQD_.js} +9 -9
  13. package/dist/ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-Cx9jFgBS.js +492 -0
  14. package/dist/ScheduleGeneralPage-B8PWNsc2.js +776 -0
  15. package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-DLpFG65j.js → ScheduleModal.vue_vue_type_script_setup_true_lang-V1sZ_xhO.js} +858 -793
  16. package/dist/SchedulePage-ndLByVBl.js +17785 -0
  17. package/dist/{SchedulePositionPage-B7S3G8gO.js → SchedulePositionPage-Cuv4ydOK.js} +18 -18
  18. package/dist/{TeamMemberList-Bx_I5hO6.js → TeamMemberList-DpCGqHCk.js} +10 -10
  19. package/dist/{TimesheetList-DjDoOqih.js → TimesheetList-B7HAC5zS.js} +7 -7
  20. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-pRgaW5ro.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-BGD6m5M-.js} +3 -3
  21. package/dist/{app-uVAVK4Qd.js → app-Lh0cqgHy.js} +20 -20
  22. package/dist/app.js +1 -1
  23. package/dist/{approval-code-C9DmR4Md.js → approval-code-DHsUgc4K.js} +1 -1
  24. package/dist/{dayjs.min-CdEA8bsz.js → dayjs.min-joq4stsa.js} +1 -1
  25. package/dist/{employee-mq8mZRLE.js → employee-BPmp9c6i.js} +4 -4
  26. package/dist/{grant-user-Bv-pJ9Wt.js → grant-user-qzKHFTro.js} +1 -1
  27. package/dist/{iteration-B5TN8t9O.js → iteration-jvdTHQUx.js} +1 -1
  28. package/dist/{lodash-DxYGKySa.js → lodash-CIAEpr9s.js} +1 -1
  29. package/dist/{restaurant-D7PEQjPY.js → restaurant-BbYRA_IT.js} +4 -3
  30. package/dist/{role-DiyMdYM9.js → role-Dd1TUMhn.js} +2 -2
  31. package/dist/{rule-BGlU-EJ_.js → rule-DmxI7qEY.js} +3 -3
  32. package/dist/src/api/schedule/index.d.ts +4 -1
  33. package/dist/src/types/schedule.d.ts +3 -4
  34. package/dist/src/views/scheduling/components/ScheduleAreaRows.vue.d.ts +0 -8
  35. package/dist/src/views/scheduling/components/ScheduleBoardAreaRows.vue.d.ts +0 -5
  36. package/dist/src/views/scheduling/components/ScheduleBoardEditOverlays.vue.d.ts +0 -2
  37. package/dist/src/views/scheduling/components/ScheduleBoardEmployeeRows.vue.d.ts +0 -7
  38. package/dist/src/views/scheduling/components/ScheduleBoardInteractionOverlays.vue.d.ts +0 -6
  39. package/dist/src/views/scheduling/components/ScheduleContextMenu.vue.d.ts +1 -5
  40. package/dist/src/views/scheduling/components/{ScheduleAssignEmployeePopover.vue.d.ts → ScheduleOnboardingAssignPositionModal.vue.d.ts} +2 -2
  41. package/dist/src/views/scheduling/components/SchedulePublishShareArt.vue.d.ts +2 -0
  42. package/dist/src/views/scheduling/components/ScheduleSelect.vue.d.ts +10 -0
  43. package/dist/src/views/scheduling/components/ScheduleStaffRows.vue.d.ts +0 -10
  44. package/dist/src/views/scheduling/composables/schedule-add-employee-form.d.ts +12 -8
  45. package/dist/src/views/scheduling/composables/useScheduleAddEmployee.d.ts +21 -9
  46. package/dist/src/views/scheduling/composables/useScheduleAreaBoard.d.ts +0 -13
  47. package/dist/src/views/scheduling/composables/useScheduleAreaDragDrop.d.ts +2 -8
  48. package/dist/src/views/scheduling/composables/useScheduleAutoSchedule.d.ts +3 -0
  49. package/dist/src/views/scheduling/composables/useScheduleBoard.d.ts +29 -4
  50. package/dist/src/views/scheduling/composables/useScheduleDayTimeline.d.ts +0 -3
  51. package/dist/src/views/scheduling/composables/useScheduleDemand.d.ts +3 -5
  52. package/dist/src/views/scheduling/composables/useScheduleDemandSheet.d.ts +6 -3
  53. package/dist/src/views/scheduling/composables/useScheduleEmployeeAccess.d.ts +7 -2
  54. package/dist/src/views/scheduling/composables/useScheduleEmployeeAvailability.d.ts +1 -1
  55. package/dist/src/views/scheduling/composables/useScheduleEmployeeCandidates.d.ts +1 -0
  56. package/dist/src/views/scheduling/composables/useScheduleEmployeePersistence.d.ts +4 -0
  57. package/dist/src/views/scheduling/composables/useScheduleEmployeeValidation.d.ts +2 -0
  58. package/dist/src/views/scheduling/composables/useScheduleGapPopover.d.ts +2 -0
  59. package/dist/src/views/scheduling/composables/useScheduleOnboardingEmployees.d.ts +21 -3
  60. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +223 -21
  61. package/dist/src/views/scheduling/composables/useSchedulePageOverlays.d.ts +0 -4
  62. package/dist/src/views/scheduling/composables/useSchedulePositionModal.d.ts +1 -0
  63. package/dist/src/views/scheduling/composables/useSchedulePositions.d.ts +1 -1
  64. package/dist/src/views/scheduling/composables/useSchedulePublish.d.ts +2 -0
  65. package/dist/src/views/scheduling/composables/useScheduleRoster.d.ts +24 -4
  66. package/dist/src/views/scheduling/composables/useScheduleSettings.d.ts +7 -2
  67. package/dist/src/views/scheduling/composables/useScheduleShiftActions.d.ts +12 -2
  68. package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -0
  69. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +15 -3
  70. package/dist/src/views/scheduling/country-rules/index.d.ts +4 -4
  71. package/dist/src/views/scheduling/data.d.ts +5 -1
  72. package/dist/src/views/scheduling/schedule-state.d.ts +76 -12
  73. package/dist/src/views/scheduling/schedule-store.d.ts +13 -5
  74. package/dist/src/views/scheduling/types.d.ts +22 -5
  75. package/dist/style.css +1 -1
  76. package/dist/tsconfig.app.tsbuildinfo +1 -1
  77. package/dist/{useAppStore-d_nHyK5u.js → useAppStore-BoLkvkE2.js} +1 -1
  78. package/dist/{useLoading-JFoghhRz.js → useLoading-Ch1AUYT1.js} +1 -1
  79. package/dist/{useReportPermissions-CV0b4SBk.js → useReportPermissions-DM3GOFCC.js} +3 -3
  80. package/package.json +1 -1
  81. package/dist/ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-CV0DRK1L.js +0 -470
  82. package/dist/ScheduleGeneralPage-DMMqTMQs.js +0 -666
  83. package/dist/SchedulePage-3MWnazgL.js +0 -18251
  84. package/dist/src/views/scheduling/components/ScheduleAllShiftsRow.vue.d.ts +0 -22
  85. package/dist/src/views/scheduling/components/ScheduleStackPopover.vue.d.ts +0 -14
  86. package/dist/src/views/scheduling/composables/useScheduleAllShiftsRow.d.ts +0 -77
  87. package/dist/src/views/scheduling/composables/useScheduleAssign.d.ts +0 -124
  88. package/dist/src/views/scheduling/composables/useScheduleOpenShiftCard.d.ts +0 -23
@@ -0,0 +1,492 @@
1
+ import { ref as h, watch as ke, computed as S, reactive as Ie, nextTick as be, defineComponent as Pe, createBlock as Q, openBlock as I, withCtx as C, createElementVNode as n, createVNode as K, toDisplayString as f, unref as q, createElementBlock as N, withDirectives as ne, withKeys as we, vModelText as se, normalizeClass as oe, createTextVNode as M, createCommentVNode as G, Fragment as ie, renderList as Ne } from "vue";
2
+ import { ar as X, au as $e, av as ue, f as R, aw as pe, ax as Ce, E as W, p as H, aq as Se, ao as O } from "./ScheduleModal.vue_vue_type_script_setup_true_lang-V1sZ_xhO.js";
3
+ import { useI18n as Ee } from "@feedmepos/mf-common";
4
+ function de() {
5
+ return X.map((e) => ({ id: e.id, name: e.name }));
6
+ }
7
+ function la(e = {}) {
8
+ const d = h(de());
9
+ ke(
10
+ () => X.map((v) => `${v.id}:${v.name}`).join(" "),
11
+ () => {
12
+ d.value = de();
13
+ }
14
+ );
15
+ const g = h(!1), a = h(""), t = h(null), u = h(!1), k = h(null);
16
+ function E(v) {
17
+ var y;
18
+ return (((y = R.value) == null ? void 0 : y.employees) ?? []).filter(
19
+ (b) => {
20
+ var P;
21
+ return ((P = b.primaryPosition) == null ? void 0 : P.positionId) === v || b.secondaryPositions.some((j) => j.positionId === v);
22
+ }
23
+ ).length;
24
+ }
25
+ function z(v) {
26
+ return d.value.some((y) => y.name.toLowerCase() === v.toLowerCase());
27
+ }
28
+ function B() {
29
+ g.value = !0, a.value = "", t.value = null, k.value = null;
30
+ }
31
+ function $() {
32
+ g.value = !1, a.value = "";
33
+ }
34
+ async function D() {
35
+ var y, b;
36
+ const v = a.value.trim().slice(0, 40);
37
+ if (!(!v || z(v))) {
38
+ u.value = !0, k.value = null;
39
+ try {
40
+ await ue({ name: v }), g.value = !1, a.value = "", (y = e.notify) == null || y.call(e, "Position added", "success");
41
+ } catch (P) {
42
+ k.value = P instanceof Error ? P.message : "Could not add this position", (b = e.notify) == null || b.call(e, k.value, "error");
43
+ } finally {
44
+ u.value = !1;
45
+ }
46
+ }
47
+ }
48
+ function A(v) {
49
+ t.value = v;
50
+ }
51
+ function p() {
52
+ t.value = null;
53
+ }
54
+ async function L(v) {
55
+ var y, b;
56
+ u.value = !0, k.value = null;
57
+ try {
58
+ await $e(v), t.value = null, (y = e.notify) == null || y.call(e, "Position removed", "success");
59
+ } catch (P) {
60
+ k.value = P instanceof Error ? P.message : "Could not delete this position", (b = e.notify) == null || b.call(e, k.value, "error");
61
+ } finally {
62
+ u.value = !1;
63
+ }
64
+ }
65
+ const J = S(() => d.value.length);
66
+ return {
67
+ positions: d,
68
+ count: J,
69
+ isAdding: g,
70
+ newName: a,
71
+ pendingDeleteId: t,
72
+ saving: u,
73
+ error: k,
74
+ usageCountFor: E,
75
+ startAdd: B,
76
+ cancelAdd: $,
77
+ confirmAdd: D,
78
+ askDelete: A,
79
+ cancelDelete: p,
80
+ confirmDelete: L
81
+ };
82
+ }
83
+ function Ae(e) {
84
+ var g;
85
+ const d = e.trim().split(/\s+/).filter(Boolean);
86
+ return d.length ? (d[0][0] + (((g = d[1]) == null ? void 0 : g[0]) ?? "")).toUpperCase() : "??";
87
+ }
88
+ function ta(e, d = {}) {
89
+ const g = h(!1), a = h(""), t = h(""), u = Ie({}), k = h(!1), E = h(null), z = h(null), B = h(!1), $ = h(null);
90
+ let D = "", A = /* @__PURE__ */ new Set();
91
+ const p = S(() => {
92
+ var m;
93
+ const l = new Map((((m = R.value) == null ? void 0 : m.employees) ?? []).map((r) => [r.employeeId, r]));
94
+ return pe.value.map((r) => {
95
+ var T, c;
96
+ const s = l.get(r._id), x = [
97
+ (T = s == null ? void 0 : s.primaryPosition) == null ? void 0 : T.positionName,
98
+ ...((s == null ? void 0 : s.secondaryPositions) ?? []).map((i) => i.positionName)
99
+ ].filter((i) => !!i), o = [
100
+ (c = s == null ? void 0 : s.primaryPosition) == null ? void 0 : c.positionId,
101
+ ...((s == null ? void 0 : s.secondaryPositions) ?? []).map((i) => i.positionId)
102
+ ].filter((i) => !!i);
103
+ return {
104
+ employeeId: r._id,
105
+ name: r.name,
106
+ initials: Ae(r.name),
107
+ held: x,
108
+ heldPositionIds: o
109
+ };
110
+ });
111
+ }), L = S(() => {
112
+ const l = t.value.trim().toLowerCase();
113
+ return p.value.filter((m) => !l || m.name.toLowerCase().includes(l));
114
+ }), J = S(
115
+ () => p.value.filter((l) => u[l.employeeId]).map((l) => l.employeeId)
116
+ ), v = S(
117
+ () => L.value.length > 0 && L.value.every((l) => u[l.employeeId])
118
+ ), y = S(() => a.value.trim().slice(0, 40)), b = S(
119
+ () => !!y.value && X.some(
120
+ (l) => l.id !== $.value && l.name.toLowerCase() === y.value.toLowerCase()
121
+ )
122
+ ), P = S(() => !!y.value && !b.value && !k.value);
123
+ function j() {
124
+ a.value = "", t.value = "", Object.keys(u).forEach((l) => delete u[l]), E.value = null, B.value = !1, z.value = null, $.value = null, D = "", A = /* @__PURE__ */ new Set();
125
+ }
126
+ function me() {
127
+ j(), g.value = !0;
128
+ }
129
+ function ce(l, m) {
130
+ j(), $.value = l, a.value = m, D = m, A = new Set(
131
+ p.value.filter((r) => r.heldPositionIds.includes(l)).map((r) => r.employeeId)
132
+ ), A.forEach((r) => u[r] = !0), g.value = !0;
133
+ }
134
+ function re() {
135
+ g.value = !1, j();
136
+ }
137
+ function ve(l) {
138
+ u[l] = !u[l];
139
+ }
140
+ function ye() {
141
+ if (v.value) {
142
+ Object.keys(u).forEach((l) => delete u[l]);
143
+ return;
144
+ }
145
+ L.value.forEach((l) => u[l.employeeId] = !0);
146
+ }
147
+ function Y(l, m) {
148
+ const r = !!(l != null && l.primaryPosition), s = ((l == null ? void 0 : l.secondaryPositions) ?? []).map((o) => ({
149
+ positionId: o.positionId,
150
+ positionName: o.positionName
151
+ })), x = r ? [...s, { positionName: m }] : s;
152
+ return {
153
+ ...r ? {} : { primaryPosition: H(m) },
154
+ secondaryPositions: x.map((o) => H(o.positionName, o.positionId)).filter((o) => !!o)
155
+ };
156
+ }
157
+ async function fe() {
158
+ var x;
159
+ const l = y.value;
160
+ await ue({ name: l }), await be(), e == null || e(l);
161
+ const m = p.value.filter((o) => u[o.employeeId]), s = (await Promise.allSettled(
162
+ m.map((o) => {
163
+ var c;
164
+ const T = (c = R.value) == null ? void 0 : c.employees.find((i) => i.employeeId === o.employeeId);
165
+ return W(o.employeeId, {
166
+ employeeName: o.name,
167
+ ...Y(T, l)
168
+ });
169
+ })
170
+ )).filter((o) => o.status === "rejected").length;
171
+ return z.value = { name: l, assigned: m.length - s, failed: s }, (x = d.notify) == null || x.call(
172
+ d,
173
+ s ? `Position added, but ${s} employee assignment${s === 1 ? "" : "s"} failed` : "Position added",
174
+ s ? "error" : "success"
175
+ ), !0;
176
+ }
177
+ async function he(l) {
178
+ var T;
179
+ const m = y.value;
180
+ await Ce(l, { name: m }), e == null || e(m);
181
+ const r = p.value.filter(
182
+ (c) => u[c.employeeId] && !A.has(c.employeeId)
183
+ ), s = p.value.filter(
184
+ (c) => !u[c.employeeId] && A.has(c.employeeId)
185
+ ), o = (await Promise.allSettled([
186
+ ...r.map((c) => {
187
+ var F;
188
+ const i = (F = R.value) == null ? void 0 : F.employees.find((U) => U.employeeId === c.employeeId);
189
+ return W(c.employeeId, {
190
+ employeeName: c.name,
191
+ ...Y(i, m)
192
+ });
193
+ }),
194
+ ...s.map((c) => {
195
+ var ee, ae, le, te;
196
+ const i = (ee = R.value) == null ? void 0 : ee.employees.find((w) => w.employeeId === c.employeeId), F = ((i == null ? void 0 : i.secondaryPositions) ?? []).filter(
197
+ (w) => w.positionId !== l && (w.positionId || w.positionName !== D)
198
+ ), U = ((ae = i == null ? void 0 : i.primaryPosition) == null ? void 0 : ae.positionId) === l || !((le = i == null ? void 0 : i.primaryPosition) != null && le.positionId) && ((te = i == null ? void 0 : i.primaryPosition) == null ? void 0 : te.positionName) === D, V = U ? F.shift() : void 0;
199
+ return W(c.employeeId, {
200
+ employeeName: c.name,
201
+ ...U ? {
202
+ primaryPosition: H(V == null ? void 0 : V.positionName, V == null ? void 0 : V.positionId) ?? null
203
+ } : {},
204
+ secondaryPositions: F.map((w) => H(w.positionName, w.positionId)).filter((w) => !!w)
205
+ });
206
+ })
207
+ ])).filter((c) => c.status === "rejected").length;
208
+ return z.value = { name: m, assigned: Math.max(0, r.length - o), failed: o }, (T = d.notify) == null || T.call(
209
+ d,
210
+ o ? `Position updated, but ${o} employee assignment${o === 1 ? "" : "s"} failed` : "Position updated",
211
+ o ? "error" : "success"
212
+ ), !0;
213
+ }
214
+ async function Z() {
215
+ var l;
216
+ if (!y.value)
217
+ return B.value = !0, !1;
218
+ if (!P.value) return !1;
219
+ k.value = !0, E.value = null;
220
+ try {
221
+ return await ($.value ? he($.value) : fe());
222
+ } catch (m) {
223
+ return E.value = m instanceof Error ? m.message : `Could not ${$.value ? "save" : "add"} this position`, (l = d.notify) == null || l.call(d, E.value, "error"), !1;
224
+ } finally {
225
+ k.value = !1;
226
+ }
227
+ }
228
+ function _() {
229
+ j();
230
+ }
231
+ async function ge() {
232
+ await Z() && _();
233
+ }
234
+ return {
235
+ open: g,
236
+ name: a,
237
+ search: t,
238
+ picks: u,
239
+ saving: k,
240
+ error: E,
241
+ done: z,
242
+ nameError: B,
243
+ people: p,
244
+ visible: L,
245
+ pickedIds: J,
246
+ allPicked: v,
247
+ nameTaken: b,
248
+ canSave: P,
249
+ editingId: $,
250
+ openNew: me,
251
+ openEdit: ce,
252
+ close: re,
253
+ toggle: ve,
254
+ toggleAll: ye,
255
+ save: Z,
256
+ saveAndAnother: ge,
257
+ another: _
258
+ };
259
+ }
260
+ const xe = { class: "am-head" }, Te = {
261
+ id: "schedule-position-title",
262
+ class: "am-title"
263
+ }, Me = { class: "ce-body" }, Oe = { key: 0 }, ze = { class: "ce-field" }, De = {
264
+ class: "ce-field asg-field",
265
+ style: { "margin-bottom": "0" }
266
+ }, Le = { class: "asg-head" }, je = { class: "asg-count" }, Ve = { class: "asg-list" }, Be = ["checked", "onChange"], Fe = { class: "asg-av" }, Ke = { class: "asg-id" }, Re = { class: "asg-nm" }, Ue = { class: "asg-sub" }, qe = { key: 1 }, Ge = {
267
+ key: 0,
268
+ class: "asg-sub",
269
+ style: { padding: "10px" }
270
+ }, He = { key: 1 }, Je = { class: "cg-done" }, Qe = { class: "cg-st-main" }, We = {
271
+ key: 0,
272
+ class: "cg-done-also"
273
+ }, Xe = { class: "am-foot" }, Ye = {
274
+ key: 0,
275
+ class: "am-foot-btns"
276
+ }, Ze = {
277
+ key: 1,
278
+ class: "am-foot-btns"
279
+ }, na = /* @__PURE__ */ Pe({
280
+ __name: "ScheduleAddPositionModal",
281
+ props: {
282
+ modal: {}
283
+ },
284
+ setup(e) {
285
+ const { t: d } = Ee();
286
+ return (g, a) => (I(), Q(Se, {
287
+ open: e.modal.open.value,
288
+ "panel-class": "ce-modal",
289
+ "panel-style": "width: min(480px, 95vw)",
290
+ "labelled-by": "schedule-position-title",
291
+ onClose: a[11] || (a[11] = (t) => e.modal.close())
292
+ }, {
293
+ default: C(() => [
294
+ n("div", xe, [
295
+ n("div", Te, f(e.modal.editingId.value ? q(d)("scheduling.positionModal.editTitle") : q(d)("scheduling.positionModal.addTitle")), 1),
296
+ K(O, {
297
+ hierarchy: "ghost",
298
+ size: "xs",
299
+ "icon-only": "",
300
+ class: "ce-close-x",
301
+ type: "button",
302
+ "aria-label": "Close",
303
+ onClick: a[0] || (a[0] = (t) => e.modal.close())
304
+ }, {
305
+ default: C(() => [...a[12] || (a[12] = [
306
+ n("svg", {
307
+ width: "20",
308
+ height: "20",
309
+ viewBox: "0 0 20 20",
310
+ fill: "none",
311
+ stroke: "currentColor",
312
+ "stroke-width": "1.8",
313
+ "stroke-linecap": "round",
314
+ "aria-hidden": "true"
315
+ }, [
316
+ n("path", { d: "M5.5 5.5l9 9M14.5 5.5l-9 9" })
317
+ ], -1)
318
+ ])]),
319
+ _: 1
320
+ })
321
+ ]),
322
+ n("div", Me, [
323
+ e.modal.done.value ? (I(), N("div", He, [
324
+ n("div", Je, [
325
+ a[16] || (a[16] = n("span", {
326
+ class: "cg-done-tick",
327
+ "aria-hidden": "true"
328
+ }, "✓", -1)),
329
+ n("div", Qe, [
330
+ n("b", null, f(e.modal.done.value.name), 1),
331
+ n("small", null, f(e.modal.editingId.value ? "Position updated" : e.modal.done.value.assigned ? `Added to ${e.modal.done.value.assigned} ${e.modal.done.value.assigned === 1 ? "employee" : "employees"}` : "Position added"), 1)
332
+ ])
333
+ ]),
334
+ e.modal.done.value.failed ? (I(), N("div", We, f(e.modal.done.value.failed) + " " + f(e.modal.done.value.failed === 1 ? "employee" : "employees") + " could not be updated. Add the position to them from their profile. ", 1)) : G("", !0)
335
+ ])) : (I(), N("div", Oe, [
336
+ n("div", ze, [
337
+ a[13] || (a[13] = n("label", {
338
+ class: "ce-label",
339
+ for: "skName"
340
+ }, "Position name", -1)),
341
+ ne(n("input", {
342
+ id: "skName",
343
+ "onUpdate:modelValue": a[1] || (a[1] = (t) => e.modal.name.value = t),
344
+ class: "sch-input ce-input",
345
+ maxlength: "40",
346
+ placeholder: "e.g. FOH, Kitchen, Manager, Cashier…",
347
+ autocomplete: "off",
348
+ onInput: a[2] || (a[2] = (t) => e.modal.nameError.value = !1),
349
+ onKeyup: a[3] || (a[3] = we((t) => e.modal.save(), ["enter"]))
350
+ }, null, 544), [
351
+ [se, e.modal.name.value]
352
+ ]),
353
+ n("div", {
354
+ class: oe(["ce-err", { show: e.modal.nameError.value || e.modal.nameTaken.value }])
355
+ }, f(e.modal.nameTaken.value ? "A position with this name already exists" : "Give the position a name"), 3)
356
+ ]),
357
+ n("div", De, [
358
+ n("div", Le, [
359
+ a[14] || (a[14] = n("span", { class: "asg-lbl" }, "Employees with this position", -1)),
360
+ K(O, {
361
+ hierarchy: "ghost",
362
+ size: "sm",
363
+ class: "ce-add-link asg-all",
364
+ type: "button",
365
+ onClick: a[4] || (a[4] = (t) => e.modal.toggleAll())
366
+ }, {
367
+ default: C(() => [
368
+ M(f(e.modal.allPicked.value ? "Clear all" : "Select all"), 1)
369
+ ]),
370
+ _: 1
371
+ }),
372
+ n("span", je, f(e.modal.pickedIds.value.length) + " selected", 1)
373
+ ]),
374
+ ne(n("input", {
375
+ "onUpdate:modelValue": a[5] || (a[5] = (t) => e.modal.search.value = t),
376
+ class: "sch-input ce-input asg-search",
377
+ placeholder: "Search team…",
378
+ autocomplete: "off"
379
+ }, null, 512), [
380
+ [se, e.modal.search.value]
381
+ ]),
382
+ n("div", Ve, [
383
+ (I(!0), N(ie, null, Ne(e.modal.visible.value, (t) => (I(), N("label", {
384
+ key: t.employeeId,
385
+ class: "asg-row"
386
+ }, [
387
+ n("input", {
388
+ type: "checkbox",
389
+ class: "sch-checkbox asg-check",
390
+ checked: !!e.modal.picks[t.employeeId],
391
+ onChange: (u) => e.modal.toggle(t.employeeId),
392
+ "data-platform": "desktop"
393
+ }, null, 40, Be),
394
+ n("span", Fe, f(t.initials), 1),
395
+ n("span", Ke, [
396
+ n("span", Re, f(t.name), 1),
397
+ n("span", Ue, [
398
+ t.held.length ? (I(), N(ie, { key: 0 }, [
399
+ M(f(t.held.join(", ")), 1)
400
+ ], 64)) : (I(), N("i", qe, "No positions added"))
401
+ ])
402
+ ])
403
+ ]))), 128)),
404
+ e.modal.visible.value.length ? G("", !0) : (I(), N("div", Ge, " No one matches. "))
405
+ ]),
406
+ a[15] || (a[15] = n("div", { class: "ce-hint" }, "Ticked people can work this position.", -1))
407
+ ]),
408
+ n("div", {
409
+ class: oe(["ce-err", { show: !!e.modal.error.value }])
410
+ }, f(e.modal.error.value), 3)
411
+ ]))
412
+ ]),
413
+ n("div", Xe, [
414
+ a[19] || (a[19] = n("div", { class: "am-cost-preview" }, null, -1)),
415
+ e.modal.done.value ? (I(), N("div", Ze, [
416
+ e.modal.editingId.value ? G("", !0) : (I(), Q(O, {
417
+ key: 0,
418
+ hierarchy: "secondary",
419
+ size: "sm",
420
+ class: "am-btn am-btn-sec",
421
+ type: "button",
422
+ onClick: a[9] || (a[9] = (t) => e.modal.another())
423
+ }, {
424
+ default: C(() => [...a[18] || (a[18] = [
425
+ M("Add another", -1)
426
+ ])]),
427
+ _: 1
428
+ })),
429
+ K(O, {
430
+ hierarchy: "primary",
431
+ size: "sm",
432
+ class: "am-btn am-btn-primary",
433
+ type: "button",
434
+ onClick: a[10] || (a[10] = (t) => e.modal.close())
435
+ }, {
436
+ default: C(() => [
437
+ M(f(q(d)("scheduling.common.done")), 1)
438
+ ]),
439
+ _: 1
440
+ })
441
+ ])) : (I(), N("div", Ye, [
442
+ K(O, {
443
+ hierarchy: "secondary",
444
+ size: "sm",
445
+ class: "am-btn am-btn-sec",
446
+ type: "button",
447
+ onClick: a[6] || (a[6] = (t) => e.modal.close())
448
+ }, {
449
+ default: C(() => [
450
+ M(f(q(d)("scheduling.common.cancel")), 1)
451
+ ]),
452
+ _: 1
453
+ }),
454
+ e.modal.editingId.value ? G("", !0) : (I(), Q(O, {
455
+ key: 0,
456
+ hierarchy: "secondary",
457
+ size: "sm",
458
+ class: "am-btn am-btn-sec",
459
+ type: "button",
460
+ disabled: !e.modal.canSave.value,
461
+ onClick: a[7] || (a[7] = (t) => e.modal.saveAndAnother())
462
+ }, {
463
+ default: C(() => [...a[17] || (a[17] = [
464
+ M(" Save & add another ", -1)
465
+ ])]),
466
+ _: 1
467
+ }, 8, ["disabled"])),
468
+ K(O, {
469
+ hierarchy: "primary",
470
+ size: "sm",
471
+ class: "am-btn am-btn-primary",
472
+ type: "button",
473
+ disabled: !e.modal.canSave.value,
474
+ onClick: a[8] || (a[8] = (t) => e.modal.save())
475
+ }, {
476
+ default: C(() => [
477
+ M(f(e.modal.editingId.value ? e.modal.saving.value ? "Saving…" : "Save changes" : e.modal.saving.value ? "Adding…" : "Add position"), 1)
478
+ ]),
479
+ _: 1
480
+ }, 8, ["disabled"])
481
+ ]))
482
+ ])
483
+ ]),
484
+ _: 1
485
+ }, 8, ["open"]));
486
+ }
487
+ });
488
+ export {
489
+ na as _,
490
+ ta as a,
491
+ la as u
492
+ };