@feedmepos/mf-hrm-portal 2.3.0-dev.25 → 2.3.0-dev.26

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 (42) hide show
  1. package/dist/{ApprovalCodeList-3wBWXPam.js → ApprovalCodeList-BErlk4ha.js} +4 -4
  2. package/dist/{AuditLogList-Dlph1SCP.js → AuditLogList-Chvwt0ar.js} +4 -4
  3. package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-CJW-spxu.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-2u2WyZdb.js} +2 -2
  4. package/dist/{EmployeeList-RAaFG8p6.js → EmployeeList-CGD1h2OK.js} +6 -6
  5. package/dist/{FormItem.vue_vue_type_script_setup_true_lang-BaMXEfJr.js → FormItem.vue_vue_type_script_setup_true_lang-BuGNer42.js} +1 -1
  6. package/dist/{GrantUserList-CxL7ELvs.js → GrantUserList-DzpqTaSY.js} +5 -5
  7. package/dist/{Main-Ccg399Ra.js → Main-CPyn7NFE.js} +5 -5
  8. package/dist/{Main-D19GDYjL.js → Main-DAGEZQlr.js} +2 -2
  9. package/dist/{Main-DQcp3NRa.js → Main-iNdaHQX2.js} +9 -9
  10. package/dist/{PermissionSetList-CdQjM54-.js → PermissionSetList-Db8_PEwm.js} +5 -5
  11. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CzUGRJe4.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BjUf9foK.js} +985 -985
  12. package/dist/{RoleList-DTyp8dcV.js → RoleList-CQi7_guB.js} +7 -7
  13. package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-BOg6mQYF.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-D5wnGhBH.js} +47 -47
  14. package/dist/{ScheduleGeneralPage-Cn_jBdfC.js → ScheduleGeneralPage-Box_itY2.js} +2 -2
  15. package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-BbSv92Ry.js → ScheduleModal.vue_vue_type_script_setup_true_lang-3XOtfHXG.js} +511 -493
  16. package/dist/{SchedulePage-CTAIOE59.js → SchedulePage-D5ech6qY.js} +7318 -7345
  17. package/dist/{SchedulePositionPage-BIXuH4Pk.js → SchedulePositionPage-Df5K6dRn.js} +8 -8
  18. package/dist/{SelectFilter-DvWwcdKo.js → SelectFilter-CnL5hOUi.js} +1 -1
  19. package/dist/{TeamMemberList-CqTvtoGc.js → TeamMemberList-BJDrGXAU.js} +7 -7
  20. package/dist/{TimesheetList-CanJSlhF.js → TimesheetList-DjasY9Ga.js} +6 -6
  21. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-UAdvuPmt.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-BipggXKS.js} +2 -2
  22. package/dist/{app-CTAbM1YW.js → app-6RyACUtu.js} +8 -8
  23. package/dist/app.js +1 -1
  24. package/dist/{dayjs.min-Bv1ruj1a.js → dayjs.min-dR2BNXww.js} +1 -1
  25. package/dist/{employee-D-jow9b7.js → employee-CZII8yO4.js} +3 -3
  26. package/dist/{iteration-KG5GZWLu.js → iteration-BrBn3q_q.js} +1 -1
  27. package/dist/{lodash-BCapmkFh.js → lodash-CiDhR4Jm.js} +1 -1
  28. package/dist/{role-Dx1RfQ1m.js → role-DzoAHzTj.js} +1 -1
  29. package/dist/{rule-D8e9LFze.js → rule-DucHSUev.js} +2 -2
  30. package/dist/src/api/schedule/index.d.ts +5 -0
  31. package/dist/src/views/scheduling/composables/useScheduleAddEmployee.d.ts +17 -0
  32. package/dist/src/views/scheduling/composables/useScheduleAutoSchedule.d.ts +3 -3
  33. package/dist/src/views/scheduling/composables/useScheduleEmployeeCandidates.d.ts +23 -4
  34. package/dist/src/views/scheduling/composables/useScheduleEmployeePersistence.d.ts +2 -0
  35. package/dist/src/views/scheduling/composables/useScheduleOnboardingEmployees.d.ts +1 -1
  36. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +17 -0
  37. package/dist/src/views/scheduling/schedule-state.d.ts +12 -12
  38. package/dist/src/views/scheduling/schedule-store.d.ts +3 -1
  39. package/dist/style.css +1 -1
  40. package/dist/tsconfig.app.tsbuildinfo +1 -1
  41. package/dist/{useReportPermissions-DXiMU0Is.js → useReportPermissions-B0VLybQf.js} +3 -3
  42. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
- import { onMounted as Ie, onBeforeUnmount as Te, ref as E, reactive as I, shallowRef as He, watch as Re, computed as B, defineComponent as Oe, createElementBlock as k, openBlock as b, renderSlot as Ke, useAttrs as da, nextTick as be, normalizeClass as pe, createElementVNode as Y, createBlock as ca, mergeProps as ma, toDisplayString as V, Teleport as ya, createCommentVNode as K, withDirectives as pa, vModelText as fa, Fragment as Ae, renderList as ha, createTextVNode as va, withModifiers as ga, normalizeStyle as Da } from "vue";
1
+ import { onMounted as Ie, onBeforeUnmount as Te, ref as P, reactive as I, shallowRef as He, watch as Re, computed as _, defineComponent as Oe, createElementBlock as k, openBlock as N, renderSlot as Ke, useAttrs as da, nextTick as be, normalizeClass as pe, createElementVNode as B, createBlock as ca, mergeProps as ma, toDisplayString as G, Teleport as ya, createCommentVNode as j, withDirectives as pa, vModelText as fa, Fragment as Ae, renderList as ha, createTextVNode as va, withModifiers as ga, normalizeStyle as Da } from "vue";
2
2
  import { useRoute as wa, useRouter as Ha } from "vue-router";
3
3
  import { useCoreStore as Ge } from "@feedmepos/mf-common";
4
- import { g, b as h, u as Aa } from "./restaurant-D2mfKHaH.js";
5
- import { E as ke, u as je } from "./employee-D-jow9b7.js";
6
- import { t as $e, q as Ea } from "./rule-D8e9LFze.js";
4
+ import { g as D, b as f, u as Aa } from "./restaurant-D2mfKHaH.js";
5
+ import { E as Ne, u as je } from "./employee-CZII8yO4.js";
6
+ import { t as $e, q as Ea } from "./rule-DucHSUev.js";
7
7
  function Qn(e) {
8
8
  let a = null;
9
9
  function t() {
@@ -19,7 +19,7 @@ function Qn(e) {
19
19
  window.removeEventListener("resize", t), a && (a.style.height = "");
20
20
  });
21
21
  }
22
- function Ne(e) {
22
+ function ke(e) {
23
23
  const [a, t] = String(e || "0:0").split(":").map(Number);
24
24
  return (Number.isFinite(a) ? a : 0) * 60 + (Number.isFinite(t) ? t : 0);
25
25
  }
@@ -28,93 +28,93 @@ function Pa(e) {
28
28
  return `${String(Math.floor(a / 60)).padStart(2, "0")}:${String(a % 60).padStart(2, "0")}`;
29
29
  }
30
30
  function ba(e, a) {
31
- const t = Ne(e);
32
- let n = Ne(a);
31
+ const t = ke(e);
32
+ let n = ke(a);
33
33
  return n <= t && (n += 1440), [t, n];
34
34
  }
35
35
  function Qe(e, a) {
36
36
  const [t, n] = ba(e, a);
37
37
  return Math.max(0, n - t);
38
38
  }
39
- function ka(e) {
40
- const a = (Ne(e) % 1440 + 1440) % 1440, t = Math.floor(a / 60), n = a % 60, s = t < 12 ? "am" : "pm", i = t % 12 || 12;
41
- return n ? `${i}:${String(n).padStart(2, "0")}${s}` : `${i}${s}`;
39
+ function Na(e) {
40
+ const a = (ke(e) % 1440 + 1440) % 1440, t = Math.floor(a / 60), n = a % 60, o = t < 12 ? "am" : "pm", i = t % 12 || 12;
41
+ return n ? `${i}:${String(n).padStart(2, "0")}${o}` : `${i}${o}`;
42
42
  }
43
43
  function Xn(e) {
44
- return ka(Pa(e % 1440));
44
+ return Na(Pa(e % 1440));
45
45
  }
46
46
  function Xe(e) {
47
47
  const a = Array.isArray(e) ? e : e == null ? void 0 : e.breaks;
48
48
  return a != null && a.length ? a.reduce((t, n) => {
49
49
  if (n.type === "DURATION") return t + n.minutes;
50
- const [s, i] = n.startTime.split(":").map(Number), [r, o] = n.endTime.split(":").map(Number);
51
- let d = r * 60 + o - (s * 60 + i);
50
+ const [o, i] = n.startTime.split(":").map(Number), [l, s] = n.endTime.split(":").map(Number);
51
+ let d = l * 60 + s - (o * 60 + i);
52
52
  return d < 0 && (d += 24 * 60), t + d;
53
53
  }, 0) : Math.max(0, e && !Array.isArray(e) ? e.breakMins ?? 0 : 0);
54
54
  }
55
55
  function Jn(e, a) {
56
- var s;
57
- const t = a ?? Qe(e.start, e.end), n = (s = e.breaks) != null && s.length ? e.breaks.reduce((i, r) => i + (r.breakPayType === "UNPAID" ? Xe([r]) : 0), 0) : Math.max(0, e.breakMins ?? 0);
56
+ var o;
57
+ const t = a ?? Qe(e.start, e.end), n = (o = e.breaks) != null && o.length ? e.breaks.reduce((i, l) => i + (l.breakPayType === "UNPAID" ? Xe([l]) : 0), 0) : Math.max(0, e.breakMins ?? 0);
58
58
  return Math.max(0, t - Math.min(t, n));
59
59
  }
60
60
  function Zn(e) {
61
61
  const a = Math.max(0, Math.round(e ?? 0));
62
62
  return a ? [{ type: "DURATION", minutes: a, breakPayType: "UNPAID" }] : [];
63
63
  }
64
- const te = 500, Na = 10, xe = 6, qn = 1500, Je = 1e6, H = {
64
+ const te = 500, ka = 10, xe = 6, qn = 1500, Je = 1e6, H = {
65
65
  async completeOnboarding(e, a) {
66
- return g(
67
- await h(`restaurants/${e}/schedules`).post("onboarding", a)
66
+ return D(
67
+ await f(`restaurants/${e}/schedules`).post("onboarding", a)
68
68
  );
69
69
  },
70
70
  async listEmployeeProfiles(e) {
71
- return g(
72
- await h("schedules").get("employees", {
71
+ return D(
72
+ await f("schedules").get("employees", {
73
73
  params: e != null && e.length ? { ids: e.join(",") } : void 0
74
74
  })
75
75
  );
76
76
  },
77
77
  async listEmployeeConfigs(e) {
78
- return g(
79
- await h(`restaurants/${e}/schedules`).get("employee-configs")
78
+ return D(
79
+ await f(`restaurants/${e}/schedules`).get("employee-configs")
80
80
  );
81
81
  },
82
82
  async saveEmployeeConfigs(e, a) {
83
- return g(
84
- await h(`restaurants/${e}/schedules`).post(
83
+ return D(
84
+ await f(`restaurants/${e}/schedules`).post(
85
85
  "employee-configs/reorder",
86
86
  a
87
87
  )
88
88
  );
89
89
  },
90
90
  async getSettings(e) {
91
- return g(
92
- await h(`restaurants/${e}/schedules`).get("settings")
91
+ return D(
92
+ await f(`restaurants/${e}/schedules`).get("settings")
93
93
  );
94
94
  },
95
95
  async saveSettings(e, a) {
96
- return g(
97
- await h(`restaurants/${e}/schedules`).post("settings", a)
96
+ return D(
97
+ await f(`restaurants/${e}/schedules`).post("settings", a)
98
98
  );
99
99
  },
100
100
  async generateAutoSchedule(e, a) {
101
- return g(
102
- await h(`restaurants/${e}/schedules`).post(
101
+ return D(
102
+ await f(`restaurants/${e}/schedules`).post(
103
103
  "auto-schedule/generate",
104
104
  a
105
105
  )
106
106
  );
107
107
  },
108
108
  async getAutoScheduleCapabilities(e) {
109
- return g(
110
- await h(`restaurants/${e}/schedules`).get(
109
+ return D(
110
+ await f(`restaurants/${e}/schedules`).get(
111
111
  "auto-schedule/capabilities"
112
112
  )
113
113
  );
114
114
  },
115
115
  async applyAutoSchedule(e, a) {
116
- return g(
117
- await h(`restaurants/${e}/schedules`).post(
116
+ return D(
117
+ await f(`restaurants/${e}/schedules`).post(
118
118
  "auto-schedule/apply",
119
119
  a
120
120
  )
@@ -122,75 +122,75 @@ const te = 500, Na = 10, xe = 6, qn = 1500, Je = 1e6, H = {
122
122
  },
123
123
  /** One outlet's whole board over `[from, to]` (inclusive, 'YYYY-MM-DD'). */
124
124
  async readBoard(e, a, t) {
125
- return g(
126
- await h(`restaurants/${e}/schedules`).get("board", {
125
+ return D(
126
+ await f(`restaurants/${e}/schedules`).get("board", {
127
127
  params: { from: a, to: t }
128
128
  })
129
129
  );
130
130
  },
131
131
  async createTimeOff(e, a) {
132
- return g(
133
- await h(`restaurants/${e}/schedules`).post("time-off", a)
132
+ return D(
133
+ await f(`restaurants/${e}/schedules`).post("time-off", a)
134
134
  );
135
135
  },
136
136
  async updateTimeOffStatus(e, a, t) {
137
- return g(
138
- await h(`restaurants/${e}/schedules`).post(
137
+ return D(
138
+ await f(`restaurants/${e}/schedules`).post(
139
139
  `time-off/${a}/status`,
140
140
  t
141
141
  )
142
142
  );
143
143
  },
144
144
  async deleteTimeOff(e, a) {
145
- await h(`restaurants/${e}/schedules`).delete(`time-off/${a}`);
145
+ await f(`restaurants/${e}/schedules`).delete(`time-off/${a}`);
146
146
  },
147
147
  /** Creates or updates the employee's shared business-level scheduling profile. */
148
148
  async createEmployeeProfile(e, a) {
149
- return g(await h("schedules").post("employees", a));
149
+ return D(await f("schedules").post("employees", a));
150
150
  },
151
151
  /** Edits the employee's shared business-level scheduling profile. */
152
152
  async updateEmployeeProfile(e, a, t) {
153
- return g(
154
- await h("schedules").post("employees", { employeeId: a, ...t })
153
+ return D(
154
+ await f("schedules").post("employees", { employeeId: a, ...t })
155
155
  );
156
156
  },
157
157
  async validatePosAccess(e) {
158
- await h("schedules").post("employees/validate-pos-access", e);
158
+ await f("schedules").post("employees/validate-pos-access", e);
159
159
  },
160
160
  /** Positions are shared across the business. */
161
161
  async createPosition(e) {
162
- return g(await h("schedules").post("positions", e));
162
+ return D(await f("schedules").post("positions", e));
163
163
  },
164
164
  async updatePosition(e, a) {
165
- return g(await h("schedules").post(`positions/${e}`, a));
165
+ return D(await f("schedules").post(`positions/${e}`, a));
166
166
  },
167
167
  /** Deleting one position is `deletePositions` with a single-id array — the backend's
168
168
  * `DELETE positions/:id` route is gone; this is now `DELETE positions?ids=`. */
169
169
  async deletePosition(e) {
170
- await h("schedules").delete("positions", {
170
+ await f("schedules").delete("positions", {
171
171
  params: { ids: e }
172
172
  });
173
173
  },
174
174
  /** Creates one flat demand interval. */
175
175
  async createDemand(e, a) {
176
- return g(
177
- await h(`restaurants/${e}/schedules`).post("demands", a)
176
+ return D(
177
+ await f(`restaurants/${e}/schedules`).post("demands", a)
178
178
  );
179
179
  },
180
180
  /** Deletes a batch of demands in one request — e.g. `saveDemand` replacing a whole
181
181
  * day/weekday's demand rows wholesale. Deleting one demand is just this with a single-id
182
182
  * array. */
183
183
  async deleteDemands(e, a) {
184
- return g(
185
- await h(`restaurants/${e}/schedules`).delete("demands", {
184
+ return D(
185
+ await f(`restaurants/${e}/schedules`).delete("demands", {
186
186
  params: { ids: a.join(",") }
187
187
  })
188
188
  );
189
189
  },
190
190
  /** Atomically replaces one date/weekday's flattened demand rows. */
191
191
  async replaceDemands(e, a) {
192
- return g(
193
- await h(`restaurants/${e}/schedules`).post(
192
+ return D(
193
+ await f(`restaurants/${e}/schedules`).post(
194
194
  "demands/replace",
195
195
  a
196
196
  )
@@ -198,8 +198,8 @@ const te = 500, Na = 10, xe = 6, qn = 1500, Je = 1e6, H = {
198
198
  },
199
199
  /** Atomically replaces several date/weekday demand generations. */
200
200
  async bulkReplaceDemands(e, a) {
201
- return g(
202
- await h(`restaurants/${e}/schedules`).post(
201
+ return D(
202
+ await f(`restaurants/${e}/schedules`).post(
203
203
  "demands/bulk-replace",
204
204
  a
205
205
  )
@@ -207,8 +207,8 @@ const te = 500, Na = 10, xe = 6, qn = 1500, Je = 1e6, H = {
207
207
  },
208
208
  /** Replaces one date's note/holiday-mark. All three fields back to empty/false clears it. */
209
209
  async saveScheduleDay(e, a, t) {
210
- return g(
211
- await h(`restaurants/${e}/schedules`).post(
210
+ return D(
211
+ await f(`restaurants/${e}/schedules`).post(
212
212
  `days/${a}`,
213
213
  t
214
214
  )
@@ -216,13 +216,13 @@ const te = 500, Na = 10, xe = 6, qn = 1500, Je = 1e6, H = {
216
216
  },
217
217
  /** A one-off shift assignment. */
218
218
  async createAssignment(e, a) {
219
- return g(
220
- await h(`restaurants/${e}/schedules`).post("assignments", a)
219
+ return D(
220
+ await f(`restaurants/${e}/schedules`).post("assignments", a)
221
221
  );
222
222
  },
223
223
  async updateAssignment(e, a, t) {
224
- return g(
225
- await h(`restaurants/${e}/schedules`).patch(
224
+ return D(
225
+ await f(`restaurants/${e}/schedules`).patch(
226
226
  `assignments/${a}`,
227
227
  t
228
228
  )
@@ -230,8 +230,8 @@ const te = 500, Na = 10, xe = 6, qn = 1500, Je = 1e6, H = {
230
230
  },
231
231
  /** Atomically applies assignment updates, creates, and deletes used by moves and swaps. */
232
232
  async bulkSaveAssignments(e, a) {
233
- return g(
234
- await h(`restaurants/${e}/schedules`).post(
233
+ return D(
234
+ await f(`restaurants/${e}/schedules`).post(
235
235
  "assignments/bulk",
236
236
  a
237
237
  )
@@ -239,31 +239,40 @@ const te = 500, Na = 10, xe = 6, qn = 1500, Je = 1e6, H = {
239
239
  },
240
240
  /** Replaces demand and/or assignments in one backend transaction. */
241
241
  async copySchedule(e, a) {
242
- return g(
243
- await h(`restaurants/${e}/schedules`).post("copy", a)
242
+ return D(
243
+ await f(`restaurants/${e}/schedules`).post("copy", a)
244
244
  );
245
245
  },
246
246
  /** Clears demand and/or assignments in one backend transaction. */
247
247
  async clearSchedule(e, a) {
248
- return g(
249
- await h(`restaurants/${e}/schedules`).post("clear", a)
248
+ return D(
249
+ await f(`restaurants/${e}/schedules`).post("clear", a)
250
250
  );
251
251
  },
252
252
  /** Deletes a batch of assignments in one request — e.g. a shift split into several segments
253
253
  * getting replaced wholesale. Deleting one assignment is just this with a single-id
254
254
  * array. */
255
255
  async deleteAssignments(e, a) {
256
- return g(
257
- await h(`restaurants/${e}/schedules`).delete("assignments", {
256
+ return D(
257
+ await f(`restaurants/${e}/schedules`).delete("assignments", {
258
258
  params: { ids: a.join(",") }
259
259
  })
260
260
  );
261
261
  },
262
+ /** Removes all assignments for an employee from the inclusive removal date onward. */
263
+ async deleteEmployeeFutureAssignments(e, a, t) {
264
+ return D(
265
+ await f(`restaurants/${e}/schedules`).delete(
266
+ "assignments/employee-future",
267
+ { params: { employeeId: a, from: t } }
268
+ )
269
+ );
270
+ },
262
271
  /** Flips a batch of assignments to one status in a single request — e.g. Publish sending
263
272
  * every DRAFT shift on the board to PUBLISHED at once. */
264
273
  async bulkUpdateAssignmentStatus(e, a) {
265
- return g(
266
- await h(`restaurants/${e}/schedules`).patch(
274
+ return D(
275
+ await f(`restaurants/${e}/schedules`).patch(
267
276
  "assignments/bulk-status",
268
277
  a
269
278
  )
@@ -271,14 +280,14 @@ const te = 500, Na = 10, xe = 6, qn = 1500, Je = 1e6, H = {
271
280
  }
272
281
  }, Ze = {
273
282
  payload: He(null),
274
- loading: E(!1),
275
- rosterLoading: E(!1),
276
- loadError: E(null),
277
- scheduleSetupCompleted: E(!1),
278
- dataVersion: E(0),
279
- outletId: E(""),
280
- restaurantEmployees: E([]),
281
- employeeConfigs: E([]),
283
+ loading: P(!1),
284
+ rosterLoading: P(!1),
285
+ loadError: P(null),
286
+ scheduleSetupCompleted: P(!1),
287
+ dataVersion: P(0),
288
+ outletId: P(""),
289
+ restaurantEmployees: P([]),
290
+ employeeConfigs: P([]),
282
291
  employeeOutletIds: He({}),
283
292
  businessEmployees: He([]),
284
293
  positions: I([]),
@@ -322,19 +331,19 @@ const te = 500, Na = 10, xe = 6, qn = 1500, Je = 1e6, H = {
322
331
  }
323
332
  })
324
333
  }, {
325
- payload: l,
334
+ payload: r,
326
335
  loading: Ye,
327
336
  rosterLoading: Be,
328
337
  loadError: fe,
329
338
  scheduleSetupCompleted: he,
330
- dataVersion: Q,
339
+ dataVersion: J,
331
340
  outletId: m,
332
341
  restaurantEmployees: re,
333
- employeeConfigs: W,
342
+ employeeConfigs: z,
334
343
  employeeOutletIds: qe,
335
344
  businessEmployees: Ee,
336
345
  positions: Sa,
337
- positionRecords: F,
346
+ positionRecords: U,
338
347
  rolePositions: eo,
339
348
  outlet: Ca,
340
349
  locationOptions: _e,
@@ -342,7 +351,7 @@ const te = 500, Na = 10, xe = 6, qn = 1500, Je = 1e6, H = {
342
351
  compensationGroupMeta: ao,
343
352
  existingStaff: to,
344
353
  shiftTemplates: no,
345
- rules: N
354
+ rules: S
346
355
  } = Ze;
347
356
  function Ma() {
348
357
  const e = Ze.rules;
@@ -372,16 +381,16 @@ function Ce(e) {
372
381
  }
373
382
  function oo(e, a = /* @__PURE__ */ new Date()) {
374
383
  const t = se(Ce(a), e * Se);
375
- return Array.from({ length: Se }, (n, s) => se(t, s));
384
+ return Array.from({ length: Se }, (n, o) => se(t, o));
376
385
  }
377
386
  function so(e, a) {
378
- const t = (i) => Date.UTC(i.getFullYear(), i.getMonth(), i.getDate()), n = t(Ce(e)), s = t(Ce(a));
379
- return Math.trunc((s - n) / (Se * 24 * 60 * 60 * 1e3));
387
+ const t = (i) => Date.UTC(i.getFullYear(), i.getMonth(), i.getDate()), n = t(Ce(e)), o = t(Ce(a));
388
+ return Math.trunc((o - n) / (Se * 24 * 60 * 60 * 1e3));
380
389
  }
381
- const X = La;
382
- let J = null, Z = null, G = null, ne = 0, ve = null;
390
+ const V = La;
391
+ let Z = null, q = null, Q = null, ne = 0, ve = null;
383
392
  function Fe(e) {
384
- return e === m.value ? !1 : (Ma(), m.value = e, l.value = null, J = null, Z = null, fe.value = null, ve = null, he.value = !1, re.value = [], W.value = [], G = null, ne += 1, Q.value += 1, !0);
393
+ return e === m.value ? !1 : (Ma(), m.value = e, r.value = null, Z = null, q = null, fe.value = null, ve = null, he.value = !1, re.value = [], z.value = [], Q = null, ne += 1, J.value += 1, !0);
385
394
  }
386
395
  async function Me(e) {
387
396
  if (!(!e || ve === e)) {
@@ -394,50 +403,60 @@ async function Me(e) {
394
403
  }
395
404
  }
396
405
  async function Ia(e) {
397
- const a = await ke.readEmployeesPage({
406
+ const a = await Ne.readEmployeesPage({
398
407
  limit: te,
399
408
  offset: 0,
400
409
  restaurantIds: [e]
401
410
  });
402
- e === m.value && (re.value = a.items, W.value = await H.listEmployeeConfigs(e), ve = e, Q.value += 1, xa().then((t) => {
403
- e === m.value && (qe.value = t, Q.value += 1);
411
+ e === m.value && (re.value = a.items, z.value = await H.listEmployeeConfigs(e), ve = e, J.value += 1, xa().then((t) => {
412
+ e === m.value && (qe.value = t, J.value += 1);
404
413
  }));
405
414
  }
406
415
  async function Ta(e) {
407
416
  const a = m.value;
408
417
  if (!a || !e.length) return;
409
418
  const t = await H.saveEmployeeConfigs(a, { configs: e });
410
- W.value = t, Q.value += 1;
419
+ z.value = t, J.value += 1;
411
420
  }
412
421
  async function io(e) {
413
422
  const a = m.value;
414
423
  if (!a) throw new Error("No outlet selected");
415
424
  const t = await H.saveSettings(a, e);
416
- return m.value === a && l.value && (l.value = { ...l.value, settings: t }), t;
425
+ return m.value === a && r.value && (r.value = { ...r.value, settings: t }), t;
417
426
  }
418
427
  function ea() {
419
- !he.value && l.value && l.value.demands.length > 0 && l.value.assignments.length > 0 && (he.value = !0);
428
+ !he.value && r.value && r.value.demands.length > 0 && r.value.assignments.length > 0 && (he.value = !0);
420
429
  }
421
430
  async function Ra(e, a) {
422
- const t = W.value.find((s) => s.employeeId === e), n = (t == null ? void 0 : t.displayOrder) ?? (a && W.value.some((s) => s.displayOrder !== null) ? Math.max(
431
+ const t = z.value.find((o) => o.employeeId === e), n = (t == null ? void 0 : t.displayOrder) ?? (z.value.some((o) => o.displayOrder !== null) ? Math.max(
423
432
  0,
424
- ...W.value.filter(
425
- (s) => s.displayOrder !== null
426
- ).map((s) => s.displayOrder)
433
+ ...z.value.filter(
434
+ (o) => o.displayOrder !== null
435
+ ).map((o) => o.displayOrder)
427
436
  ) + 100 : null);
428
437
  await Ta([{ employeeId: e, enabled: a, displayOrder: n }]);
429
438
  }
439
+ async function ro(e, a = V(/* @__PURE__ */ new Date())) {
440
+ const t = m.value;
441
+ if (!t) throw new Error("No outlet selected");
442
+ await H.deleteEmployeeFutureAssignments(t, e, a), r.value && (r.value = {
443
+ ...r.value,
444
+ assignments: r.value.assignments.filter(
445
+ (n) => n.employeeId !== e || n.date < a
446
+ )
447
+ });
448
+ }
430
449
  async function Le() {
431
450
  const e = m.value;
432
451
  e && (ve = null, await Me(e));
433
452
  }
434
453
  async function Oa(e, a) {
435
- const t = je(), n = (await j(!0)).find((o) => o._id === e);
454
+ const t = je(), n = (await X(!0)).find((s) => s._id === e);
436
455
  if (!n) throw new Error("Could not find this employee");
437
- const s = n.restaurantRole.map((o) => ({
438
- restaurantId: o.restaurantId,
439
- roleId: o.roleId
440
- })), i = a(s);
456
+ const o = n.restaurantRole.map((s) => ({
457
+ restaurantId: s.restaurantId,
458
+ roleId: s.roleId
459
+ })), i = a(o);
441
460
  if (!i.length)
442
461
  throw new Error(
443
462
  "An employee must keep at least 1 location, otherwise they are deleted. To delete them, use the Employee page."
@@ -445,84 +464,82 @@ async function Oa(e, a) {
445
464
  (n.isMasterUser ? "master" : "user") === "master" ? await t.updateMasterEmployee(e, {
446
465
  user: { name: n.name, passcode: n.passcode, code: n.code ?? "" },
447
466
  roles: i,
448
- previousRoles: s
467
+ previousRoles: o
449
468
  }) : await t.updateEmployee(e, {
450
469
  user: { name: n.name, passcode: n.passcode },
451
470
  roles: i,
452
- previousRoles: s
453
- }), await j(!0);
454
- }
455
- async function ro(e, a, t = "", n = !0) {
456
- const s = [...new Set(a.filter(Boolean))];
457
- s.length && (await Oa(e, (i) => [
458
- ...i.filter((r) => !s.includes(r.restaurantId)),
459
- ...s.map((r) => ({ restaurantId: r, roleId: t }))
460
- ]), n && m.value && s.includes(m.value) && await Ra(e, !0), await Le());
461
- }
462
- async function lo(e, a) {
463
- const t = je(), n = (await j(!0)).find(
464
- (f) => f._id === e
465
- );
466
- if (!n) throw new Error("Could not find this employee");
467
- const s = (f) => f.slice().sort((D, C) => D.restaurantId.localeCompare(C.restaurantId)).map((D) => `${D.restaurantId}:${D.roleId}`).join("|"), i = s(n.restaurantRole) !== s(a.roles), r = n.name !== a.name || n.passcode !== a.passcode || n.isMasterUser !== a.masterUser || a.masterUser && (n.code ?? "") !== a.masterCode;
468
- if (!i && !r) return;
469
- const o = n.restaurantRole.map((f) => ({
470
- restaurantId: f.restaurantId,
471
- roleId: f.roleId
472
- })), d = n.isMasterUser ? (await $e.readTeamMembers()).find((f) => f.doc.posUserId === e) : void 0;
473
- if (d) {
474
- const f = Ea(), D = f.getPermissionAssignmentByUserId(d.id) ?? await f.readPermissionAssignmentByUserId(d.id), C = a.masterUser ? {
471
+ previousRoles: o
472
+ }), await X(!0);
473
+ }
474
+ async function lo(e, a, t = "", n = !0) {
475
+ const o = [...new Set(a.filter(Boolean))];
476
+ o.length && (await Oa(e, (i) => [
477
+ ...i.filter((l) => !o.includes(l.restaurantId)),
478
+ ...o.map((l) => ({ restaurantId: l, roleId: t }))
479
+ ]), n && m.value && o.includes(m.value) && await Ra(e, !0), await Le());
480
+ }
481
+ async function uo(e, a, t) {
482
+ const n = je(), o = (t == null ? void 0 : t._id) === e ? t : (await X(!0)).find((g) => g._id === e);
483
+ if (!o) throw new Error("Could not find this employee");
484
+ const i = (g) => g.slice().sort((A, O) => A.restaurantId.localeCompare(O.restaurantId)).map((A) => `${A.restaurantId}:${A.roleId}`).join("|"), l = i(o.restaurantRole) !== i(a.roles), s = o.name !== a.name || o.passcode !== a.passcode || o.isMasterUser !== a.masterUser || a.masterUser && (o.code ?? "") !== a.masterCode;
485
+ if (!l && !s) return;
486
+ const d = o.restaurantRole.map((g) => ({
487
+ restaurantId: g.restaurantId,
488
+ roleId: g.roleId
489
+ })), v = o.isMasterUser ? (await $e.readTeamMembers()).find((g) => g.doc.posUserId === e) : void 0;
490
+ if (v) {
491
+ const g = Ea(), A = g.getPermissionAssignmentByUserId(v.id) ?? await g.readPermissionAssignmentByUserId(v.id), O = a.masterUser ? {
475
492
  code: a.masterCode,
476
493
  name: a.name,
477
494
  passcode: a.passcode,
478
495
  roles: a.roles
479
496
  } : null;
480
- await $e.updateTeamMember(d.id, {
481
- permissions: d.permissions,
482
- customPermissions: (D == null ? void 0 : D.customPermissions) ?? d.permissions,
483
- permissionSetIds: (D == null ? void 0 : D.permissionSetIds) ?? d.doc.permissionSetIds ?? [],
484
- posUser: C
485
- }), await j(!0), await Le();
497
+ await $e.updateTeamMember(v.id, {
498
+ permissions: v.permissions,
499
+ customPermissions: (A == null ? void 0 : A.customPermissions) ?? v.permissions,
500
+ permissionSetIds: (A == null ? void 0 : A.permissionSetIds) ?? v.doc.permissionSetIds ?? [],
501
+ posUser: O
502
+ }), await X(!0), await Le();
486
503
  return;
487
504
  }
488
505
  if (a.masterUser) {
489
- const f = {
506
+ const g = {
490
507
  user: { name: a.name, passcode: a.passcode, code: a.masterCode },
491
508
  roles: a.roles,
492
- previousRoles: o
509
+ previousRoles: d
493
510
  };
494
- n.isMasterUser ? await t.updateMasterEmployee(e, f) : await t.migrateToMasterUser(e, f);
511
+ o.isMasterUser ? await n.updateMasterEmployee(e, g) : await n.migrateToMasterUser(e, g);
495
512
  } else
496
- n.isMasterUser ? await t.updateMasterEmployee(e, {
497
- user: { name: n.name, passcode: n.passcode, code: n.code ?? "" },
513
+ o.isMasterUser ? await n.updateMasterEmployee(e, {
514
+ user: { name: o.name, passcode: o.passcode, code: o.code ?? "" },
498
515
  roles: [],
499
- previousRoles: o
500
- }) : await t.updateEmployee(e, {
516
+ previousRoles: d
517
+ }) : await n.updateEmployee(e, {
501
518
  user: { name: a.name, passcode: a.passcode },
502
519
  roles: a.roles,
503
- previousRoles: o
520
+ previousRoles: d
504
521
  });
505
- await j(!0), await Le();
522
+ await X(!0), await Le();
506
523
  }
507
524
  let ae = null;
508
525
  async function $a() {
509
- const e = await ke.readEmployeesPage({
526
+ const e = await Ne.readEmployeesPage({
510
527
  limit: te,
511
528
  offset: 0,
512
529
  includeEmptyPasscode: !0
513
- }), a = Math.min(Na, Math.ceil(e.total / te)), t = await Promise.all(
530
+ }), a = Math.min(ka, Math.ceil(e.total / te)), t = await Promise.all(
514
531
  Array.from(
515
532
  { length: Math.max(0, a - 1) },
516
- (n, s) => ke.readEmployeesPage({
533
+ (n, o) => Ne.readEmployeesPage({
517
534
  limit: te,
518
- offset: (s + 1) * te,
535
+ offset: (o + 1) * te,
519
536
  includeEmptyPasscode: !0
520
537
  })
521
538
  )
522
539
  );
523
540
  return [...e.items, ...t.flatMap((n) => n.items)];
524
541
  }
525
- function j(e = !1) {
542
+ function X(e = !1) {
526
543
  if (!e) {
527
544
  if (ae) return ae;
528
545
  if (Ee.value.length) return Promise.resolve(Ee.value);
@@ -535,7 +552,7 @@ function j(e = !1) {
535
552
  async function xa() {
536
553
  const e = {};
537
554
  try {
538
- (await j()).forEach((a) => {
555
+ (await X()).forEach((a) => {
539
556
  e[a._id] = [...new Set(a.restaurantRole.map((t) => t.restaurantId))];
540
557
  });
541
558
  } catch {
@@ -544,89 +561,89 @@ async function xa() {
544
561
  return e;
545
562
  }
546
563
  function Ue(e, a) {
547
- return J !== null && Z !== null && J <= e && Z >= a;
564
+ return Z !== null && q !== null && Z <= e && q >= a;
548
565
  }
549
566
  async function Ya(e) {
550
- const a = X(e), t = X(se(e, 6));
551
- Ue(a, t) || G && (await G, Ue(a, t)) || await aa(
567
+ const a = V(e), t = V(se(e, 6));
568
+ Ue(a, t) || Q && (await Q, Ue(a, t)) || await aa(
552
569
  se(e, -7 * xe),
553
570
  se(e, 7 * xe)
554
571
  );
555
572
  }
556
- async function uo() {
557
- !J || !Z || await aa(/* @__PURE__ */ new Date(`${J}T00:00:00`), /* @__PURE__ */ new Date(`${Z}T00:00:00`));
573
+ async function co() {
574
+ !Z || !q || await aa(/* @__PURE__ */ new Date(`${Z}T00:00:00`), /* @__PURE__ */ new Date(`${q}T00:00:00`));
558
575
  }
559
- async function co(e) {
576
+ async function mo(e) {
560
577
  if (!m.value) throw new Error("No outlet selected");
561
578
  const a = await H.createEmployeeProfile(m.value, e);
562
- l.value && (l.value.employees.push(a), Q.value += 1);
579
+ r.value && (r.value.employees.push(a), J.value += 1);
563
580
  }
564
- async function mo(e) {
581
+ async function yo(e) {
565
582
  await H.validatePosAccess(e);
566
583
  }
567
- async function yo(e, a) {
584
+ async function po(e, a) {
568
585
  if (!m.value) throw new Error("No outlet selected");
569
586
  const t = await H.updateEmployeeProfile(m.value, e, a);
570
- if (l.value) {
571
- const n = l.value.employees.findIndex((s) => s.employeeId === e);
572
- n > -1 && (l.value = {
573
- ...l.value,
574
- employees: l.value.employees.map((s, i) => i === n ? t : s)
587
+ if (r.value) {
588
+ const n = r.value.employees.findIndex((o) => o.employeeId === e);
589
+ n > -1 && (r.value = {
590
+ ...r.value,
591
+ employees: r.value.employees.map((o, i) => i === n ? t : o)
575
592
  });
576
593
  }
577
594
  }
578
- async function po(e) {
595
+ async function fo(e) {
579
596
  const a = await H.createPosition(e);
580
- l.value && (l.value = { ...l.value, positions: [...l.value.positions, a] });
597
+ r.value && (r.value = { ...r.value, positions: [...r.value.positions, a] });
581
598
  }
582
- async function fo(e, a) {
599
+ async function ho(e, a) {
583
600
  const t = await H.updatePosition(e, a);
584
- if (l.value) {
585
- const n = l.value.positions.find((i) => i.id === e), s = (i) => i.positionId === e || !i.positionId && i.positionName === (n == null ? void 0 : n.name);
586
- l.value = {
587
- ...l.value,
588
- positions: l.value.positions.map((i) => i.id === e ? t : i),
589
- employees: l.value.employees.map((i) => ({
601
+ if (r.value) {
602
+ const n = r.value.positions.find((i) => i.id === e), o = (i) => i.positionId === e || !i.positionId && i.positionName === (n == null ? void 0 : n.name);
603
+ r.value = {
604
+ ...r.value,
605
+ positions: r.value.positions.map((i) => i.id === e ? t : i),
606
+ employees: r.value.employees.map((i) => ({
590
607
  ...i,
591
- primaryPosition: i.primaryPosition && s(i.primaryPosition) ? { ...i.primaryPosition, positionName: t.name } : i.primaryPosition,
608
+ primaryPosition: i.primaryPosition && o(i.primaryPosition) ? { ...i.primaryPosition, positionName: t.name } : i.primaryPosition,
592
609
  secondaryPositions: i.secondaryPositions.map(
593
- (r) => s(r) ? { ...r, positionName: t.name } : r
610
+ (l) => o(l) ? { ...l, positionName: t.name } : l
594
611
  )
595
612
  }))
596
613
  };
597
614
  }
598
615
  }
599
- async function ho(e) {
600
- await H.deletePosition(e), l.value && (l.value = {
601
- ...l.value,
602
- positions: l.value.positions.filter((a) => a.id !== e)
616
+ async function vo(e) {
617
+ await H.deletePosition(e), r.value && (r.value = {
618
+ ...r.value,
619
+ positions: r.value.positions.filter((a) => a.id !== e)
603
620
  });
604
621
  }
605
- async function vo(e, a) {
606
- var s;
622
+ async function go(e, a) {
623
+ var o;
607
624
  if (!m.value) throw new Error("No outlet selected");
608
- const t = (s = l.value) == null ? void 0 : s.days.find((i) => i.date === e), n = await H.saveScheduleDay(m.value, e, {
625
+ const t = (o = r.value) == null ? void 0 : o.days.find((i) => i.date === e), n = await H.saveScheduleDay(m.value, e, {
609
626
  ...a,
610
627
  expectedUpdatedAt: a.expectedUpdatedAt ?? (t == null ? void 0 : t.updatedAt)
611
628
  });
612
- if (l.value) {
613
- const i = l.value.days.filter((r) => r.date !== e);
614
- n && i.push(n), l.value = { ...l.value, days: i };
629
+ if (r.value) {
630
+ const i = r.value.days.filter((l) => l.date !== e);
631
+ n && i.push(n), r.value = { ...r.value, days: i };
615
632
  }
616
633
  }
617
634
  function Ba(e) {
618
635
  const a = e.periods.flatMap((t) => {
619
- const n = (t.roles ?? []).filter((r) => r.positionName && r.headcount > 0), s = n.reduce((r, o) => r + o.headcount, 0), i = {
636
+ const n = (t.roles ?? []).filter((l) => l.positionName && l.headcount > 0), o = n.reduce((l, s) => l + s.headcount, 0), i = {
620
637
  startTime: t.startTime,
621
638
  endTime: t.endTime
622
639
  };
623
640
  return [
624
- ...n.map((r) => ({
641
+ ...n.map((l) => ({
625
642
  ...i,
626
- headcount: r.headcount,
627
- position: { positionId: r.positionId, positionName: r.positionName }
643
+ headcount: l.headcount,
644
+ position: { positionId: l.positionId, positionName: l.positionName }
628
645
  })),
629
- ...t.headcount > s ? [{ ...i, headcount: t.headcount - s }] : []
646
+ ...t.headcount > o ? [{ ...i, headcount: t.headcount - o }] : []
630
647
  ];
631
648
  });
632
649
  return {
@@ -634,100 +651,100 @@ function Ba(e) {
634
651
  demands: a
635
652
  };
636
653
  }
637
- async function go(e) {
654
+ async function Do(e) {
638
655
  if (!m.value) throw new Error("No outlet selected");
639
656
  if (!e.length) return;
640
657
  const a = e.map(Ba), t = e.length === 1 ? await H.replaceDemands(m.value, a[0]) : await H.bulkReplaceDemands(m.value, { replacements: a });
641
- if (l.value) {
642
- const n = new Set(e.map((i) => i.date)), s = l.value.demands.filter((i) => i.date === null || !n.has(i.date));
643
- l.value = { ...l.value, demands: [...s, ...t] };
658
+ if (r.value) {
659
+ const n = new Set(e.map((i) => i.date)), o = r.value.demands.filter((i) => i.date === null || !n.has(i.date));
660
+ r.value = { ...r.value, demands: [...o, ...t] };
644
661
  }
645
662
  ea();
646
663
  }
647
- async function Do(e) {
664
+ async function wo(e) {
648
665
  if (!m.value) throw new Error("No outlet selected");
649
666
  return H.generateAutoSchedule(m.value, e);
650
667
  }
651
- async function wo() {
668
+ async function Ho() {
652
669
  if (!m.value) throw new Error("No outlet selected");
653
670
  return H.getAutoScheduleCapabilities(m.value);
654
671
  }
655
- async function Ho(e) {
672
+ async function Ao(e) {
656
673
  if (!m.value) throw new Error("No outlet selected");
657
674
  return H.applyAutoSchedule(m.value, e);
658
675
  }
659
- async function Ao(e) {
676
+ async function Eo(e) {
660
677
  if (!m.value) throw new Error("No outlet selected");
661
678
  const a = await H.bulkSaveAssignments(m.value, e);
662
- if (l.value) {
679
+ if (r.value) {
663
680
  const t = new Set(e.deleteIds), n = new Map(
664
- l.value.assignments.filter((s) => !t.has(s.id)).map((s) => [s.id, s])
681
+ r.value.assignments.filter((o) => !t.has(o.id)).map((o) => [o.id, o])
665
682
  );
666
- a.updated.forEach((s) => n.set(s.id, s)), a.created.forEach((s) => n.set(s.id, s)), l.value = { ...l.value, assignments: [...n.values()] };
683
+ a.updated.forEach((o) => n.set(o.id, o)), a.created.forEach((o) => n.set(o.id, o)), r.value = { ...r.value, assignments: [...n.values()] };
667
684
  }
668
685
  return ea(), a;
669
686
  }
670
- async function Eo(e) {
687
+ async function Po(e) {
671
688
  if (!m.value) throw new Error("No outlet selected");
672
689
  return H.copySchedule(m.value, e);
673
690
  }
674
- async function Po(e) {
691
+ async function bo(e) {
675
692
  var t;
676
693
  if (!m.value) throw new Error("No outlet selected");
677
694
  const a = await H.clearSchedule(m.value, e);
678
- if (l.value) {
695
+ if (r.value) {
679
696
  const n = new Set(
680
- (((t = e.demand) == null ? void 0 : t.replacements) ?? []).map((r) => r.date)
681
- ), s = new Set(a.deletedAssignmentIds), i = a.demand;
682
- l.value = {
683
- ...l.value,
697
+ (((t = e.demand) == null ? void 0 : t.replacements) ?? []).map((l) => l.date)
698
+ ), o = new Set(a.deletedAssignmentIds), i = a.demand;
699
+ r.value = {
700
+ ...r.value,
684
701
  demands: [
685
- ...l.value.demands.filter((r) => r.date === null || !n.has(r.date)),
702
+ ...r.value.demands.filter((l) => l.date === null || !n.has(l.date)),
686
703
  ...i
687
704
  ],
688
- assignments: l.value.assignments.filter((r) => !s.has(r.id))
705
+ assignments: r.value.assignments.filter((l) => !o.has(l.id))
689
706
  };
690
707
  }
691
708
  return a;
692
709
  }
693
- async function bo(e) {
710
+ async function No(e) {
694
711
  if (!m.value) throw new Error("No outlet selected");
695
- if (e.length && (await H.deleteAssignments(m.value, e), l.value)) {
712
+ if (e.length && (await H.deleteAssignments(m.value, e), r.value)) {
696
713
  const a = new Set(e);
697
- l.value = {
698
- ...l.value,
699
- assignments: l.value.assignments.filter((t) => !a.has(t.id))
714
+ r.value = {
715
+ ...r.value,
716
+ assignments: r.value.assignments.filter((t) => !a.has(t.id))
700
717
  };
701
718
  }
702
719
  }
703
720
  async function ko(e) {
704
721
  if (!m.value) throw new Error("No outlet selected");
705
722
  const a = await H.createTimeOff(m.value, e);
706
- return l.value && (l.value = { ...l.value, timeOff: [...l.value.timeOff, a] }), a;
723
+ return r.value && (r.value = { ...r.value, timeOff: [...r.value.timeOff, a] }), a;
707
724
  }
708
- async function No(e, a) {
725
+ async function So(e, a) {
709
726
  if (!m.value) throw new Error("No outlet selected");
710
727
  const t = await H.updateTimeOffStatus(m.value, e, a);
711
- return t && l.value && (l.value = {
712
- ...l.value,
713
- timeOff: l.value.timeOff.map((n) => n.id === e ? t : n)
728
+ return t && r.value && (r.value = {
729
+ ...r.value,
730
+ timeOff: r.value.timeOff.map((n) => n.id === e ? t : n)
714
731
  }), t;
715
732
  }
716
- async function So(e) {
733
+ async function Co(e) {
717
734
  if (!m.value) throw new Error("No outlet selected");
718
- await H.deleteTimeOff(m.value, e), l.value && (l.value = {
719
- ...l.value,
720
- timeOff: l.value.timeOff.filter((a) => a.id !== e)
735
+ await H.deleteTimeOff(m.value, e), r.value && (r.value = {
736
+ ...r.value,
737
+ timeOff: r.value.timeOff.filter((a) => a.id !== e)
721
738
  });
722
739
  }
723
- async function Co(e) {
740
+ async function Mo(e) {
724
741
  if (!m.value) throw new Error("No outlet selected");
725
742
  const a = await H.bulkUpdateAssignmentStatus(m.value, e);
726
- if (l.value && a.length) {
743
+ if (r.value && a.length) {
727
744
  const t = new Map(a.map((n) => [n.id, n]));
728
- l.value = {
729
- ...l.value,
730
- assignments: l.value.assignments.map(
745
+ r.value = {
746
+ ...r.value,
747
+ assignments: r.value.assignments.map(
731
748
  (n) => t.get(n.id) ?? n
732
749
  )
733
750
  };
@@ -740,25 +757,25 @@ async function aa(e, a) {
740
757
  fe.value = "No outlet selected";
741
758
  return;
742
759
  }
743
- const n = X(e), s = X(a), i = ++ne;
760
+ const n = V(e), o = V(a), i = ++ne;
744
761
  Ye.value = !0, fe.value = null;
745
- const r = (async () => {
762
+ const l = (async () => {
746
763
  try {
747
- const o = await H.readBoard(t, n, s);
764
+ const s = await H.readBoard(t, n, o);
748
765
  if (m.value !== t || i !== ne) return;
749
- l.value = o, he.value = o.settings.setupCompleted, J = n, Z = s, Q.value += 1;
750
- } catch (o) {
766
+ r.value = s, he.value = s.settings.setupCompleted, Z = n, q = o, J.value += 1;
767
+ } catch (s) {
751
768
  if (m.value !== t || i !== ne) return;
752
- fe.value = o instanceof Error ? o.message : "Could not load the schedule";
769
+ fe.value = s instanceof Error ? s.message : "Could not load the schedule";
753
770
  } finally {
754
771
  m.value === t && i === ne && (Ye.value = !1);
755
772
  }
756
773
  })();
757
- G = r;
774
+ Q = l;
758
775
  try {
759
- await r;
776
+ await l;
760
777
  } finally {
761
- G === r && (G = null);
778
+ Q === l && (Q = null);
762
779
  }
763
780
  }
764
781
  const _a = "AE", Fa = "Asia/Dubai", Ua = {
@@ -1226,7 +1243,7 @@ const _a = "AE", Fa = "Asia/Dubai", Ua = {
1226
1243
  workingHours: At,
1227
1244
  recurringPublicHolidays: Et,
1228
1245
  publicHolidays: Pt
1229
- }, kt = "MY", Nt = "Asia/Kuala_Lumpur", St = {
1246
+ }, Nt = "MY", kt = "Asia/Kuala_Lumpur", St = {
1230
1247
  NORMAL: {
1231
1248
  overtime: 1.5
1232
1249
  },
@@ -1314,8 +1331,8 @@ const _a = "AE", Fa = "Asia/Dubai", Ua = {
1314
1331
  "2027-12-25": "Christmas Day"
1315
1332
  }
1316
1333
  }, Tt = {
1317
- countryCode: kt,
1318
- timezone: Nt,
1334
+ countryCode: Nt,
1335
+ timezone: kt,
1319
1336
  payRate: St,
1320
1337
  overtime: Ct,
1321
1338
  workingHours: Mt,
@@ -1700,14 +1717,14 @@ function yn(e) {
1700
1717
  function pn(e) {
1701
1718
  return We[yn(e)] ?? We.MY;
1702
1719
  }
1703
- function Mo(e, a) {
1704
- var i, r;
1720
+ function Lo(e, a) {
1721
+ var i, l;
1705
1722
  const t = (i = e.publicHolidays[a.slice(0, 4)]) == null ? void 0 : i[a];
1706
1723
  if (t) return t;
1707
- const n = Number(a.slice(5, 7)), s = Number(a.slice(8, 10));
1708
- return ((r = e.recurringPublicHolidays.find((o) => o.month === n && o.day === s)) == null ? void 0 : r.name) ?? null;
1724
+ const n = Number(a.slice(5, 7)), o = Number(a.slice(8, 10));
1725
+ return ((l = e.recurringPublicHolidays.find((s) => s.month === n && s.day === o)) == null ? void 0 : l.name) ?? null;
1709
1726
  }
1710
- const fn = Ge(), ta = "unassigned", Lo = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], Io = "All Stations", To = [{ id: ta, label: "Assigned", roles: [], system: !0 }], ze = [
1727
+ const fn = Ge(), ta = "unassigned", Io = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], To = "All Stations", Ro = [{ id: ta, label: "Assigned", roles: [], system: !0 }], ze = [
1711
1728
  "#903E1F",
1712
1729
  "#5F090A",
1713
1730
  "#0A5384",
@@ -1720,30 +1737,30 @@ const fn = Ge(), ta = "unassigned", Lo = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sa
1720
1737
  function hn(e) {
1721
1738
  var t;
1722
1739
  const a = e.trim().toLocaleLowerCase();
1723
- return (t = F.find((n) => n.name.toLocaleLowerCase() === a)) == null ? void 0 : t.id;
1740
+ return (t = U.find((n) => n.name.toLocaleLowerCase() === a)) == null ? void 0 : t.id;
1724
1741
  }
1725
- function Ro(e, a) {
1742
+ function Oo(e, a) {
1726
1743
  if (e)
1727
1744
  return { positionId: a ?? hn(e), positionName: e };
1728
1745
  }
1729
- function ie(e, a = F) {
1746
+ function ie(e, a = U) {
1730
1747
  var t;
1731
1748
  if (e)
1732
1749
  return (e.positionId && ((t = a.find((n) => n.id === e.positionId)) == null ? void 0 : t.name)) ?? e.positionName;
1733
1750
  }
1734
- function Oo(e, a = F) {
1751
+ function $o(e, a = U) {
1735
1752
  var t, n;
1736
1753
  if (e)
1737
- return e.positionId ? (t = a.find((s) => s.id === e.positionId)) == null ? void 0 : t.name : (n = a.find((s) => s.name.toLocaleLowerCase() === e.positionName.toLocaleLowerCase())) == null ? void 0 : n.name;
1754
+ return e.positionId ? (t = a.find((o) => o.id === e.positionId)) == null ? void 0 : t.name : (n = a.find((o) => o.name.toLocaleLowerCase() === e.positionName.toLocaleLowerCase())) == null ? void 0 : n.name;
1738
1755
  }
1739
- function $o(e, a) {
1740
- return a ? !F.some((t) => t.id === a) : !!e && !F.some((t) => t.name.toLocaleLowerCase() === e.toLocaleLowerCase());
1756
+ function xo(e, a) {
1757
+ return a ? !U.some((t) => t.id === a) : !!e && !U.some((t) => t.name.toLocaleLowerCase() === e.toLocaleLowerCase());
1741
1758
  }
1742
- const xo = [1, 1, 1, 1, 1, 1, 1];
1759
+ const Yo = [1, 1, 1, 1, 1, 1, 1];
1743
1760
  function le(e) {
1744
1761
  return (e + 6) % 7;
1745
1762
  }
1746
- function Yo(e) {
1763
+ function Bo(e) {
1747
1764
  return (e + 1) % 7;
1748
1765
  }
1749
1766
  function ye(e, a) {
@@ -1758,7 +1775,7 @@ function gn(e) {
1758
1775
  return a.length ? (a[0][0] + (((t = a[1]) == null ? void 0 : t[0]) ?? "")).toUpperCase() : "??";
1759
1776
  }
1760
1777
  const na = /* @__PURE__ */ new Map(), Pe = /* @__PURE__ */ new Map();
1761
- function Bo(e) {
1778
+ function _o(e) {
1762
1779
  return na.get(e);
1763
1780
  }
1764
1781
  function Dn(e) {
@@ -1767,33 +1784,33 @@ function Dn(e) {
1767
1784
  const t = Je + Pe.size + 1;
1768
1785
  return Pe.set(e, t), na.set(t, e), t;
1769
1786
  }
1770
- function _o(e) {
1787
+ function Fo(e) {
1771
1788
  return e.sourceId || String(e.id);
1772
1789
  }
1773
1790
  function wn(e) {
1774
- Ca.name = (e == null ? void 0 : e.outlet.name) ?? "", ye(Sa, (e == null ? void 0 : e.positions.map((o) => o.name)) ?? []), ye(F, (e == null ? void 0 : e.positions) ?? []);
1791
+ Ca.name = (e == null ? void 0 : e.outlet.name) ?? "", ye(Sa, (e == null ? void 0 : e.positions.map((s) => s.name)) ?? []), ye(U, (e == null ? void 0 : e.positions) ?? []);
1775
1792
  const a = (e == null ? void 0 : e.restaurantProfile.operatingHours) ?? [], t = Array.from({ length: 7 }, () => []);
1776
- for (const o of a) t[le(o.dayOfWeek)] = o.closed ? [] : o.hours;
1777
- ye(N.dayHours, t);
1778
- const n = a.filter((o) => !o.closed).flatMap((o) => o.hours);
1779
- N.openFrom = n.length ? n.map((o) => o.start).reduce((o, d) => d < o ? d : o) : "00:00", N.openTo = n.length ? n.map((o) => o.end).reduce((o, d) => d > o ? d : o) : "24:00", ye(
1780
- N.closedWeekdays,
1781
- a.filter((o) => o.closed).map((o) => le(o.dayOfWeek)).sort((o, d) => o - d)
1793
+ for (const s of a) t[le(s.dayOfWeek)] = s.closed ? [] : s.hours;
1794
+ ye(S.dayHours, t);
1795
+ const n = a.filter((s) => !s.closed).flatMap((s) => s.hours);
1796
+ S.openFrom = n.length ? n.map((s) => s.start).reduce((s, d) => d < s ? d : s) : "00:00", S.openTo = n.length ? n.map((s) => s.end).reduce((s, d) => d > s ? d : s) : "24:00", ye(
1797
+ S.closedWeekdays,
1798
+ a.filter((s) => s.closed).map((s) => le(s.dayOfWeek)).sort((s, d) => s - d)
1782
1799
  );
1783
- const s = pn(fn.currentCountry.value), i = (e == null ? void 0 : e.settings.settingsConfigured) === !0, r = i ? e.settings.payRate : s.payRate;
1784
- N.otCapHours = i ? e.settings.overtime.maxHoursPerMonth : s.overtime.maxHoursPerMonth, N.workingHours = i ? e.settings.workingHours : {
1800
+ const o = pn(fn.currentCountry.value), i = (e == null ? void 0 : e.settings.settingsConfigured) === !0, l = i ? e.settings.payRate : o.payRate;
1801
+ S.otCapHours = i ? e.settings.overtime.maxHoursPerMonth : o.overtime.maxHoursPerMonth, S.workingHours = i ? e.settings.workingHours : {
1785
1802
  minHoursPerDay: null,
1786
- maxHoursPerDay: s.workingHours.fullTime.maxHoursPerDay,
1787
- maxHoursPerWeek: s.workingHours.fullTime.maxHoursPerWeek
1788
- }, N.payRate.NORMAL.overtime = r.NORMAL.overtime, N.payRate.REST_DAY.regular = r.REST_DAY.regular, N.payRate.REST_DAY.overtime = r.REST_DAY.overtime, N.payRate.PUBLIC_HOLIDAY.regular = r.PUBLIC_HOLIDAY.regular, N.payRate.PUBLIC_HOLIDAY.overtime = r.PUBLIC_HOLIDAY.overtime;
1803
+ maxHoursPerDay: o.workingHours.fullTime.maxHoursPerDay,
1804
+ maxHoursPerWeek: o.workingHours.fullTime.maxHoursPerWeek
1805
+ }, S.payRate.NORMAL.overtime = l.NORMAL.overtime, S.payRate.REST_DAY.regular = l.REST_DAY.regular, S.payRate.REST_DAY.overtime = l.REST_DAY.overtime, S.payRate.PUBLIC_HOLIDAY.regular = l.PUBLIC_HOLIDAY.regular, S.payRate.PUBLIC_HOLIDAY.overtime = l.PUBLIC_HOLIDAY.overtime;
1789
1806
  }
1790
- Re(l, wn, { immediate: !0 });
1807
+ Re(r, wn, { immediate: !0 });
1791
1808
  function ge(e) {
1792
1809
  var a, t, n;
1793
1810
  return {
1794
- minHoursPerDay: ((a = e.workingHours) == null ? void 0 : a.minHoursPerDay) ?? N.workingHours.minHoursPerDay,
1795
- maxHoursPerDay: ((t = e.workingHours) == null ? void 0 : t.maxHoursPerDay) ?? N.workingHours.maxHoursPerDay,
1796
- maxHoursPerWeek: ((n = e.workingHours) == null ? void 0 : n.maxHoursPerWeek) ?? N.workingHours.maxHoursPerWeek
1811
+ minHoursPerDay: ((a = e.workingHours) == null ? void 0 : a.minHoursPerDay) ?? S.workingHours.minHoursPerDay,
1812
+ maxHoursPerDay: ((t = e.workingHours) == null ? void 0 : t.maxHoursPerDay) ?? S.workingHours.maxHoursPerDay,
1813
+ maxHoursPerWeek: ((n = e.workingHours) == null ? void 0 : n.maxHoursPerWeek) ?? S.workingHours.maxHoursPerWeek
1797
1814
  };
1798
1815
  }
1799
1816
  function Hn(e) {
@@ -1840,7 +1857,7 @@ function Pn(e) {
1840
1857
  function bn(e) {
1841
1858
  return e.type === "OFF_DAY" ? "Off day" : e.leaveType === "MEDICAL" ? "Medical Leave" : e.leaveType === "EMERGENCY" ? "Emergency Leave" : e.leaveType === "UNPAID" ? "Unpaid Leave" : "Annual Leave";
1842
1859
  }
1843
- function kn(e, a) {
1860
+ function Nn(e, a) {
1844
1861
  if (a < e.startDate || a > e.endDate) return null;
1845
1862
  const n = e.startDate === e.endDate || a === e.startDate ? e.startPart : a === e.endDate ? e.endPart : "FULL_DAY";
1846
1863
  return {
@@ -1853,7 +1870,7 @@ function kn(e, a) {
1853
1870
  halfPart: n === "FULL_DAY" ? void 0 : n
1854
1871
  };
1855
1872
  }
1856
- function Nn(e) {
1873
+ function kn(e) {
1857
1874
  return {
1858
1875
  employeeId: e._id,
1859
1876
  name: e.name,
@@ -1870,47 +1887,47 @@ function Sn(e) {
1870
1887
  }
1871
1888
  function Cn(e) {
1872
1889
  var n;
1873
- const t = (qe.value[e] ?? ((n = re.value.find((s) => s._id === e)) == null ? void 0 : n.restaurantRole.map((s) => s.restaurantId)) ?? []).map((s) => oe[s]).filter((s) => !!s);
1890
+ const t = (qe.value[e] ?? ((n = re.value.find((o) => o._id === e)) == null ? void 0 : n.restaurantRole.map((o) => o.restaurantId)) ?? []).map((o) => oe[o]).filter((o) => !!o);
1874
1891
  return t.length ? Sn([...new Set(t)]) : void 0;
1875
1892
  }
1876
- function Fo(e = []) {
1877
- const a = l.value;
1893
+ function Uo(e = []) {
1894
+ const a = r.value;
1878
1895
  if (!a) return [];
1879
- const t = new Map(a.employees.map((o) => [o.employeeId, o])), n = new Map(
1880
- W.value.map((o) => [o.employeeId, o])
1881
- ), s = re.value.filter((o) => {
1896
+ const t = new Map(a.employees.map((s) => [s.employeeId, s])), n = new Map(
1897
+ z.value.map((s) => [s.employeeId, s])
1898
+ ), o = re.value.filter((s) => {
1882
1899
  var d;
1883
- return ((d = n.get(o._id)) == null ? void 0 : d.enabled) !== !1;
1884
- }).map((o) => t.get(o._id) ?? Nn(o)), i = Hn(s), r = /* @__PURE__ */ new Map();
1885
- for (const o of a.assignments) {
1886
- const d = `${o.employeeId}|${o.date}`, f = r.get(d);
1887
- f ? f.push(o) : r.set(d, [o]);
1888
- }
1889
- return s.map((o) => {
1890
- const d = re.value.find((v) => v._id === o.employeeId) ?? {
1891
- name: o.name,
1900
+ return ((d = n.get(s._id)) == null ? void 0 : d.enabled) !== !1;
1901
+ }).map((s) => t.get(s._id) ?? kn(s)), i = Hn(o), l = /* @__PURE__ */ new Map();
1902
+ for (const s of a.assignments) {
1903
+ const d = `${s.employeeId}|${s.date}`, v = l.get(d);
1904
+ v ? v.push(s) : l.set(d, [s]);
1905
+ }
1906
+ return o.map((s) => {
1907
+ const d = re.value.find((h) => h._id === s.employeeId) ?? {
1908
+ name: s.name,
1892
1909
  code: void 0,
1893
1910
  passcode: "",
1894
1911
  isMasterUser: !1
1895
- }, f = ge(o), D = Dn(o.employeeId), C = new Set(F.map((v) => v.id)), q = new Set(F.map((v) => v.name.toLocaleLowerCase())), O = (v) => v.positionId ? C.has(v.positionId) : q.has(v.positionName.toLocaleLowerCase()), $ = ie(o.primaryPosition), p = !!o.primaryPosition && O(o.primaryPosition), P = o.secondaryPositions.filter(O).map((v) => ie(v)).filter((v) => !!v), _ = $ ? p ? [$, ...P] : [] : P, M = [
1896
- ...$ && !p ? [$] : [],
1897
- ...o.secondaryPositions.filter((v) => !O(v)).map((v) => ie(v)).filter((v) => !!v)
1898
- ], U = _[0] ?? "", L = e.map((v) => {
1899
- const A = X(v);
1900
- return (a.timeOff ?? []).filter((w) => w.employeeId === o.employeeId).map((w) => kn(w, A)).find((w) => w !== null) ?? null;
1901
- }), z = e.map((v) => {
1902
- const A = X(v), T = (r.get(`${o.employeeId}|${A}`) ?? []).filter((x) => x.startTime && x.endTime).map((x) => Pn(x)).sort((x, ce) => x.start.localeCompare(ce.start));
1912
+ }, v = ge(s), g = Dn(s.employeeId), A = new Set(U.map((h) => h.id)), O = new Set(U.map((h) => h.name.toLocaleLowerCase())), $ = (h) => h.positionId ? A.has(h.positionId) : O.has(h.positionName.toLocaleLowerCase()), x = ie(s.primaryPosition), p = !!s.primaryPosition && $(s.primaryPosition), b = s.secondaryPositions.filter($).map((h) => ie(h)).filter((h) => !!h), F = x ? p ? [x, ...b] : [] : b, M = [
1913
+ ...x && !p ? [x] : [],
1914
+ ...s.secondaryPositions.filter((h) => !$(h)).map((h) => ie(h)).filter((h) => !!h)
1915
+ ], W = F[0] ?? "", L = e.map((h) => {
1916
+ const E = V(h);
1917
+ return (a.timeOff ?? []).filter((w) => w.employeeId === s.employeeId).map((w) => Nn(w, E)).find((w) => w !== null) ?? null;
1918
+ }), K = e.map((h) => {
1919
+ const E = V(h), T = (l.get(`${s.employeeId}|${E}`) ?? []).filter((Y) => Y.startTime && Y.endTime).map((Y) => Pn(Y)).sort((Y, ce) => Y.start.localeCompare(ce.start));
1903
1920
  return T.length ? T.length === 1 ? T[0] : T : null;
1904
- }), ue = o.availability.length > 0, de = Array.from(
1921
+ }), ue = s.availability.length > 0, de = Array.from(
1905
1922
  { length: 7 },
1906
- (v, A) => ue ? o.availability.some((w) => le(w.dayOfWeek) === A) : !0
1907
- ), De = Array.from({ length: 7 }, (v, A) => {
1908
- const w = o.availability.find((T) => le(T.dayOfWeek) === A);
1923
+ (h, E) => ue ? s.availability.some((w) => le(w.dayOfWeek) === E) : !0
1924
+ ), De = Array.from({ length: 7 }, (h, E) => {
1925
+ const w = s.availability.find((T) => le(T.dayOfWeek) === E);
1909
1926
  return { from: (w == null ? void 0 : w.start) ?? "", to: (w == null ? void 0 : w.end) ?? "" };
1910
1927
  });
1911
1928
  return {
1912
- id: D,
1913
- sourceId: o.employeeId,
1929
+ id: g,
1930
+ sourceId: s.employeeId,
1914
1931
  // Employee page edits update the POS employee name. Use that as the display
1915
1932
  // source so Scheduling reflects those changes after its roster refresh.
1916
1933
  name: d.name,
@@ -1920,60 +1937,60 @@ function Fo(e = []) {
1920
1937
  passcode: d.passcode || void 0,
1921
1938
  code: d.code,
1922
1939
  masterUser: d.isMasterUser,
1923
- employmentType: o.employmentType,
1924
- role: U,
1940
+ employmentType: s.employmentType,
1941
+ role: W,
1925
1942
  initials: gn(d.name),
1926
- color: ze[(D - Je - 1) % ze.length],
1943
+ color: ze[(g - Je - 1) % ze.length],
1927
1944
  // Gross hours actually rostered this week — the figure the cost rail multiplies by
1928
1945
  // the rate. Contracted hours are a separate question, answered by RULES.contract.
1929
1946
  // Rounded to one decimal — `hoursBetween` divides by 60, so an unrounded sum reads
1930
1947
  // as a long, meaningless float (e.g. 31.983333333333334) everywhere this is shown
1931
1948
  // verbatim, matching the rounding `employeeLoadOf`'s own hours figure already uses.
1932
1949
  weekHours: Math.round(
1933
- z.reduce(
1934
- (v, A) => v + (Array.isArray(A) ? A : A && "start" in A ? [A] : []).reduce(
1950
+ K.reduce(
1951
+ (h, E) => h + (Array.isArray(E) ? E : E && "start" in E ? [E] : []).reduce(
1935
1952
  (w, T) => w + vn(T.start, T.end),
1936
1953
  0
1937
1954
  ),
1938
1955
  0
1939
1956
  ) * 10
1940
1957
  ) / 10,
1941
- pct: En(o, i),
1942
- contractHours: f.maxHoursPerWeek ?? void 0,
1943
- minHoursPerDay: f.minHoursPerDay ?? void 0,
1958
+ pct: En(s, i),
1959
+ contractHours: v.maxHoursPerWeek ?? void 0,
1960
+ minHoursPerDay: v.minHoursPerDay ?? void 0,
1944
1961
  // Keep the persisted override shape here. Consumers that need the effective value use
1945
1962
  // effectiveWorkingHours(), so an inherited null remains distinguishable from an override.
1946
- workingHours: o.workingHours,
1963
+ workingHours: s.workingHours,
1947
1964
  // Every outlet the POS says this person works at, not just this one — the Add / Edit form
1948
1965
  // shows them, and saving keeps them.
1949
- locations: Cn(o.employeeId),
1950
- rate: An(o, i),
1951
- positions: _,
1966
+ locations: Cn(s.employeeId),
1967
+ rate: An(s, i),
1968
+ positions: F,
1952
1969
  archivedPositions: M.length ? M : void 0,
1953
- shifts: z,
1970
+ shifts: K,
1954
1971
  timeOff: L,
1955
1972
  // Remarks live in their own collection in the older scheduling design and are not
1956
1973
  // part of this board's payload yet.
1957
1974
  remarks: [],
1958
1975
  section: ta,
1959
- payBasis: o.wage.type === "HOURLY" ? "hourly" : "monthly",
1960
- payAmount: o.wage.amount,
1976
+ payBasis: s.wage.type === "HOURLY" ? "hourly" : "monthly",
1977
+ payAmount: s.wage.amount,
1961
1978
  availDays: de,
1962
1979
  availHours: De
1963
1980
  };
1964
1981
  });
1965
1982
  }
1966
- function Uo() {
1983
+ function Wo() {
1967
1984
  return [];
1968
1985
  }
1969
- function Wo() {
1970
- var n, s;
1971
- const e = l.value, a = {}, t = {};
1986
+ function zo() {
1987
+ var n, o;
1988
+ const e = r.value, a = {}, t = {};
1972
1989
  for (const i of (e == null ? void 0 : e.demands) ?? []) {
1973
- const r = i.date ? a[n = i.date] ?? (a[n] = []) : i.dayOfWeek !== null ? t[s = le(i.dayOfWeek)] ?? (t[s] = []) : null;
1974
- if (!r) continue;
1975
- let o = r.find((d) => d.from === i.startTime && d.to === i.endTime);
1976
- o || (o = { from: i.startTime, to: i.endTime, n: 0, roles: [] }, r.push(o)), o.n += i.headcount, i.position && o.roles.push({
1990
+ const l = i.date ? a[n = i.date] ?? (a[n] = []) : i.dayOfWeek !== null ? t[o = le(i.dayOfWeek)] ?? (t[o] = []) : null;
1991
+ if (!l) continue;
1992
+ let s = l.find((d) => d.from === i.startTime && d.to === i.endTime);
1993
+ s || (s = { from: i.startTime, to: i.endTime, n: 0, roles: [] }, l.push(s)), s.n += i.headcount, i.position && s.roles.push({
1977
1994
  position: ie(i.position) ?? "",
1978
1995
  positionId: i.position.positionId || void 0,
1979
1996
  n: i.headcount
@@ -1981,38 +1998,38 @@ function Wo() {
1981
1998
  }
1982
1999
  return { byDate: a, byWeekday: t };
1983
2000
  }
1984
- function zo() {
1985
- const e = Ge(), { restaurants: a, readRestaurants: t } = Aa(), n = wa(), s = Ha(), i = E(!1);
1986
- let r = () => !0;
1987
- const o = B(
1988
- () => a.value.filter((p) => p.managable).map((p) => ({ value: p._id, label: p.profile.name })).sort((p, P) => p.label.localeCompare(P.label))
2001
+ function Vo() {
2002
+ const e = Ge(), { restaurants: a, readRestaurants: t } = Aa(), n = wa(), o = Ha(), i = P(!1);
2003
+ let l = () => !0;
2004
+ const s = _(
2005
+ () => a.value.filter((p) => p.managable).map((p) => ({ value: p._id, label: p.profile.name })).sort((p, b) => p.label.localeCompare(b.label))
1989
2006
  ), d = () => {
1990
2007
  var p;
1991
2008
  return `hrm-schedule-outlet:${((p = e.currentBusiness.value) == null ? void 0 : p._id) ?? ""}`;
1992
- }, f = B(() => {
2009
+ }, v = _(() => {
1993
2010
  var p;
1994
2011
  return ((p = e.currentRestaurant.value) == null ? void 0 : p._id) ?? "";
1995
2012
  });
1996
- async function D(p, P) {
1997
- return p !== m.value && !await r(p) || !Fe(p) ? !1 : (localStorage.setItem(d(), p), n.query.restaurantId !== p && s.replace({ query: { ...n.query, restaurantId: p } }), await Promise.all([Me(p), Ya(P)]), !0);
2013
+ async function g(p, b) {
2014
+ return p !== m.value && !await l(p) || !Fe(p) ? !1 : (localStorage.setItem(d(), p), n.query.restaurantId !== p && o.replace({ query: { ...n.query, restaurantId: p } }), await Promise.all([Me(p), Ya(b)]), !0);
1998
2015
  }
1999
- function C(p) {
2000
- r = p;
2001
- }
2002
- const q = (p) => !!p && o.value.some((P) => P.value === p);
2003
- async function O() {
2004
- var _;
2005
- await t(), _e.splice(0, _e.length, ...o.value.map((M) => M.label)), Object.keys(oe).forEach((M) => delete oe[M]), a.value.forEach((M) => oe[M._id] = M.profile.name);
2006
- const p = localStorage.getItem(d()) ?? "", P = [m.value, p, f.value].find(q) ?? ((_ = o.value[0]) == null ? void 0 : _.value) ?? "";
2007
- return P && Fe(P), i.value = !0, P;
2016
+ function A(p) {
2017
+ l = p;
2008
2018
  }
2019
+ const O = (p) => !!p && s.value.some((b) => b.value === p);
2009
2020
  async function $() {
2010
- const p = await O();
2021
+ var F;
2022
+ await t(), _e.splice(0, _e.length, ...s.value.map((M) => M.label)), Object.keys(oe).forEach((M) => delete oe[M]), a.value.forEach((M) => oe[M._id] = M.profile.name);
2023
+ const p = localStorage.getItem(d()) ?? "", b = [m.value, p, v.value].find(O) ?? ((F = s.value[0]) == null ? void 0 : F.value) ?? "";
2024
+ return b && Fe(b), i.value = !0, b;
2025
+ }
2026
+ async function x() {
2027
+ const p = await $();
2011
2028
  return p && await Me(p), p;
2012
2029
  }
2013
- return { options: o, ready: i, outletId: m, resolve: $, resolveOutlet: O, switchTo: D, setBeforeSwitch: C };
2030
+ return { options: s, ready: i, outletId: m, resolve: x, resolveOutlet: $, switchTo: g, setBeforeSwitch: A };
2014
2031
  }
2015
- const Mn = ["data-hierarchy", "data-size", "data-icon"], Vo = /* @__PURE__ */ Oe({
2032
+ const Mn = ["data-hierarchy", "data-size", "data-icon"], Ko = /* @__PURE__ */ Oe({
2016
2033
  __name: "ScheduleButton",
2017
2034
  props: {
2018
2035
  hierarchy: { default: "primary" },
@@ -2020,7 +2037,7 @@ const Mn = ["data-hierarchy", "data-size", "data-icon"], Vo = /* @__PURE__ */ Oe
2020
2037
  iconOnly: { type: Boolean, default: !1 }
2021
2038
  },
2022
2039
  setup(e) {
2023
- return (a, t) => (b(), k("button", {
2040
+ return (a, t) => (N(), k("button", {
2024
2041
  type: "button",
2025
2042
  class: "sch-button",
2026
2043
  "data-hierarchy": e.hierarchy,
@@ -2045,7 +2062,7 @@ const Mn = ["data-hierarchy", "data-size", "data-icon"], Vo = /* @__PURE__ */ Oe
2045
2062
  }, Bn = ["aria-selected", "onClick"], _n = {
2046
2063
  key: 0,
2047
2064
  class: "fx-opt-text"
2048
- }, Fn = { key: 0 }, Ko = /* @__PURE__ */ Oe({
2065
+ }, Fn = { key: 0 }, Go = /* @__PURE__ */ Oe({
2049
2066
  inheritAttrs: !1,
2050
2067
  __name: "ScheduleSelect",
2051
2068
  props: {
@@ -2063,11 +2080,11 @@ const Mn = ["data-hierarchy", "data-size", "data-icon"], Vo = /* @__PURE__ */ Oe
2063
2080
  },
2064
2081
  emits: ["update:modelValue", "toggle"],
2065
2082
  setup(e, { emit: a }) {
2066
- const t = e, n = a, s = da(), i = B(() => s.class ?? ""), r = E(!1), o = E(!1), d = E(null), f = E(null), D = E(null), C = B(() => t.teleport !== !1 && o.value);
2083
+ const t = e, n = a, o = da(), i = _(() => o.class ?? ""), l = P(!1), s = P(!1), d = P(null), v = P(null), g = P(null), A = _(() => t.teleport !== !1 && s.value);
2067
2084
  Ie(() => {
2068
- o.value = typeof document < "u" && !!document.body;
2085
+ s.value = typeof document < "u" && !!document.body;
2069
2086
  });
2070
- const q = B(() => {
2087
+ const O = _(() => {
2071
2088
  var u, y;
2072
2089
  if (t.selectedLabel != null) return t.selectedLabel;
2073
2090
  if (t.multiple) {
@@ -2076,78 +2093,78 @@ const Mn = ["data-hierarchy", "data-size", "data-icon"], Vo = /* @__PURE__ */ Oe
2076
2093
  }
2077
2094
  return ((y = t.options.find((c) => c.value === t.modelValue)) == null ? void 0 : y.label) ?? t.placeholder ?? "";
2078
2095
  });
2079
- function O(u) {
2096
+ function $(u) {
2080
2097
  var y;
2081
2098
  return t.multiple ? !!((y = t.selected) != null && y.includes(u.value)) : t.selectedId != null ? u.id === t.selectedId : u.value === t.modelValue;
2082
2099
  }
2083
- const $ = B(() => !!t.menuTitle || t.options.some((u) => u.hint)), p = E(""), P = E(null), _ = B(() => {
2100
+ const x = _(() => !!t.menuTitle || t.options.some((u) => u.hint)), p = P(""), b = P(null), F = _(() => {
2084
2101
  const u = p.value.trim().toLowerCase();
2085
2102
  return !t.searchable || !u ? t.options : t.options.filter((y) => `${y.label} ${y.hint ?? ""}`.toLowerCase().includes(u));
2086
- }), M = B(() => {
2103
+ }), M = _(() => {
2087
2104
  const u = [];
2088
2105
  let y;
2089
- for (const c of _.value)
2106
+ for (const c of F.value)
2090
2107
  c.group !== y && (y = c.group, y && u.push({ heading: y })), u.push({ option: c });
2091
2108
  return u;
2092
- }), U = 5, L = 8;
2093
- function z() {
2094
- const u = D.value, y = f.value;
2109
+ }), W = 5, L = 8;
2110
+ function K() {
2111
+ const u = g.value, y = v.value;
2095
2112
  if (!u || !y) return;
2096
- const c = y.getBoundingClientRect(), S = window.innerWidth || document.documentElement.clientWidth, R = window.innerHeight || document.documentElement.clientHeight;
2097
- u.style.minWidth = `${Math.round(c.width)}px`, u.style.maxWidth = `${Math.max(180, Math.round(S - L * 2))}px`;
2098
- const ee = R - c.bottom - U - L, ra = c.top - U - L;
2113
+ const c = y.getBoundingClientRect(), C = window.innerWidth || document.documentElement.clientWidth, R = window.innerHeight || document.documentElement.clientHeight;
2114
+ u.style.minWidth = `${Math.round(c.width)}px`, u.style.maxWidth = `${Math.max(180, Math.round(C - L * 2))}px`;
2115
+ const ee = R - c.bottom - W - L, ra = c.top - W - L;
2099
2116
  u.style.maxHeight = `${Math.max(120, Math.min(320, Math.max(ee, ra)))}px`;
2100
2117
  const me = u.offsetHeight, la = u.offsetWidth;
2101
- let we = c.bottom + U;
2102
- we + me > R - L && (we = c.top - U - me >= L ? c.top - U - me : Math.max(L, R - me - L));
2103
- const ua = Math.min(Math.max(L, c.left), Math.max(L, S - la - L));
2118
+ let we = c.bottom + W;
2119
+ we + me > R - L && (we = c.top - W - me >= L ? c.top - W - me : Math.max(L, R - me - L));
2120
+ const ua = Math.min(Math.max(L, c.left), Math.max(L, C - la - L));
2104
2121
  u.style.top = `${Math.round(we)}px`, u.style.left = `${Math.round(ua)}px`, u.style.visibility = "visible";
2105
2122
  }
2106
2123
  function ue(u) {
2107
- var c, S;
2124
+ var c, C;
2108
2125
  const y = u.target;
2109
- y && ((c = d.value) != null && c.contains(y) || (S = D.value) != null && S.contains(y)) || w();
2126
+ y && ((c = d.value) != null && c.contains(y) || (C = g.value) != null && C.contains(y)) || w();
2110
2127
  }
2111
2128
  function de(u) {
2112
- const y = D.value, c = u.target;
2129
+ const y = g.value, c = u.target;
2113
2130
  if (y && c && c !== document && y.contains(c)) return;
2114
- const S = f.value;
2115
- if (!S) return;
2116
- const R = S.getBoundingClientRect(), ee = window.innerHeight || document.documentElement.clientHeight;
2131
+ const C = v.value;
2132
+ if (!C) return;
2133
+ const R = C.getBoundingClientRect(), ee = window.innerHeight || document.documentElement.clientHeight;
2117
2134
  if (R.bottom < 0 || R.top > ee) {
2118
2135
  w();
2119
2136
  return;
2120
2137
  }
2121
- z();
2138
+ K();
2122
2139
  }
2123
2140
  function De() {
2124
2141
  document.addEventListener("click", ue), document.addEventListener("scroll", de, !0), window.addEventListener("resize", w);
2125
2142
  }
2126
- function v() {
2143
+ function h() {
2127
2144
  document.removeEventListener("click", ue), document.removeEventListener("scroll", de, !0), window.removeEventListener("resize", w);
2128
2145
  }
2129
- async function A() {
2146
+ async function E() {
2130
2147
  var u, y, c;
2131
- t.disabled || r.value || (p.value = "", r.value = !0, await be(), z(), (u = P.value) == null || u.focus(), (c = (y = D.value) == null ? void 0 : y.querySelector(".fx-opt.is-on")) == null || c.scrollIntoView({ block: "nearest" }), De());
2148
+ t.disabled || l.value || (p.value = "", l.value = !0, await be(), K(), (u = b.value) == null || u.focus(), (c = (y = g.value) == null ? void 0 : y.querySelector(".fx-opt.is-on")) == null || c.scrollIntoView({ block: "nearest" }), De());
2132
2149
  }
2133
2150
  function w() {
2134
- r.value && (r.value = !1, p.value = "", v());
2151
+ l.value && (l.value = !1, p.value = "", h());
2135
2152
  }
2136
2153
  Re(p, async () => {
2137
- r.value && (await be(), z());
2154
+ l.value && (await be(), K());
2138
2155
  });
2139
2156
  function T(u) {
2140
2157
  var y;
2141
2158
  if (u.key === "Escape")
2142
- u.preventDefault(), w(), (y = f.value) == null || y.focus();
2159
+ u.preventDefault(), w(), (y = v.value) == null || y.focus();
2143
2160
  else if (u.key === "Enter") {
2144
2161
  u.preventDefault();
2145
- const c = _.value.find((S) => !S.disabled);
2162
+ const c = F.value.find((C) => !C.disabled);
2146
2163
  c && ce(c);
2147
2164
  }
2148
2165
  }
2149
- function x() {
2150
- r.value ? w() : A();
2166
+ function Y() {
2167
+ l.value ? w() : E();
2151
2168
  }
2152
2169
  function ce(u) {
2153
2170
  if (!u.disabled) {
@@ -2162,67 +2179,67 @@ const Mn = ["data-hierarchy", "data-size", "data-icon"], Vo = /* @__PURE__ */ Oe
2162
2179
  u.value !== t.modelValue && n("update:modelValue", u.value);
2163
2180
  }
2164
2181
  }
2165
- const oa = B(() => t.options.filter((u) => !u.disabled));
2182
+ const oa = _(() => t.options.filter((u) => !u.disabled));
2166
2183
  function sa(u) {
2167
2184
  const y = oa.value;
2168
2185
  if (t.multiple || !y.length) {
2169
- A();
2186
+ E();
2170
2187
  return;
2171
2188
  }
2172
- const c = y.findIndex((ee) => ee.value === t.modelValue), S = u === "Home" ? 0 : u === "End" ? y.length - 1 : u === "ArrowDown" ? Math.min(y.length - 1, (c < 0 ? -1 : c) + 1) : Math.max(0, (c < 0 ? 1 : c) - 1), R = y[S];
2173
- R && R.value !== t.modelValue ? n("update:modelValue", R.value) : A();
2189
+ const c = y.findIndex((ee) => ee.value === t.modelValue), C = u === "Home" ? 0 : u === "End" ? y.length - 1 : u === "ArrowDown" ? Math.min(y.length - 1, (c < 0 ? -1 : c) + 1) : Math.max(0, (c < 0 ? 1 : c) - 1), R = y[C];
2190
+ R && R.value !== t.modelValue ? n("update:modelValue", R.value) : E();
2174
2191
  }
2175
2192
  function ia(u) {
2176
2193
  var y;
2177
2194
  if (u.key === "Escape") {
2178
- if (!r.value) return;
2179
- u.preventDefault(), w(), (y = f.value) == null || y.focus();
2195
+ if (!l.value) return;
2196
+ u.preventDefault(), w(), (y = v.value) == null || y.focus();
2180
2197
  return;
2181
2198
  }
2182
2199
  if (u.key === "Enter" || u.key === " ") {
2183
- u.preventDefault(), x();
2200
+ u.preventDefault(), Y();
2184
2201
  return;
2185
2202
  }
2186
2203
  u.key !== "ArrowDown" && u.key !== "ArrowUp" && u.key !== "Home" && u.key !== "End" || (u.preventDefault(), sa(u.key));
2187
2204
  }
2188
- return Te(v), (u, y) => (b(), k("div", {
2205
+ return Te(h), (u, y) => (N(), k("div", {
2189
2206
  ref_key: "rootEl",
2190
2207
  ref: d,
2191
2208
  class: pe(["fx-sel", i.value])
2192
2209
  }, [
2193
- Y("button", ma({
2210
+ B("button", ma({
2194
2211
  ref_key: "btnEl",
2195
- ref: f
2212
+ ref: v
2196
2213
  }, u.$attrs, {
2197
2214
  type: "button",
2198
- class: ["sch-input fx-btn", { "is-open": r.value }],
2215
+ class: ["sch-input fx-btn", { "is-open": l.value }],
2199
2216
  disabled: e.disabled,
2200
2217
  "aria-haspopup": "listbox",
2201
- "aria-expanded": r.value,
2202
- onClick: y[0] || (y[0] = (c) => x()),
2218
+ "aria-expanded": l.value,
2219
+ onClick: y[0] || (y[0] = (c) => Y()),
2203
2220
  onKeydown: ia
2204
2221
  }), [
2205
- Y("span", In, V(q.value), 1)
2222
+ B("span", In, G(O.value), 1)
2206
2223
  ], 16, Ln),
2207
- (b(), ca(ya, {
2224
+ (N(), ca(ya, {
2208
2225
  to: "body",
2209
- disabled: !C.value
2226
+ disabled: !A.value
2210
2227
  }, [
2211
- Y("div", Tn, [
2212
- r.value ? (b(), k("div", {
2228
+ B("div", Tn, [
2229
+ l.value ? (N(), k("div", {
2213
2230
  key: 0,
2214
2231
  ref_key: "popEl",
2215
- ref: D,
2216
- class: pe(["fx-pop", { "fx-pop-rich": $.value }]),
2232
+ ref: g,
2233
+ class: pe(["fx-pop", { "fx-pop-rich": x.value }]),
2217
2234
  role: "listbox",
2218
2235
  "aria-multiselectable": e.multiple || void 0,
2219
2236
  style: { visibility: "hidden" }
2220
2237
  }, [
2221
- e.menuTitle ? (b(), k("div", On, V(e.menuTitle), 1)) : K("", !0),
2222
- e.searchable ? (b(), k("div", $n, [
2223
- pa(Y("input", {
2238
+ e.menuTitle ? (N(), k("div", On, G(e.menuTitle), 1)) : j("", !0),
2239
+ e.searchable ? (N(), k("div", $n, [
2240
+ pa(B("input", {
2224
2241
  ref_key: "searchEl",
2225
- ref: P,
2242
+ ref: b,
2226
2243
  "onUpdate:modelValue": y[1] || (y[1] = (c) => p.value = c),
2227
2244
  class: "sch-input fx-pop-q",
2228
2245
  type: "search",
@@ -2234,33 +2251,33 @@ const Mn = ["data-hierarchy", "data-size", "data-icon"], Vo = /* @__PURE__ */ Oe
2234
2251
  }, null, 544), [
2235
2252
  [fa, p.value]
2236
2253
  ])
2237
- ])) : K("", !0),
2238
- e.searchable && !M.value.length ? (b(), k("div", xn, "No matches")) : K("", !0),
2239
- (b(!0), k(Ae, null, ha(M.value, (c) => (b(), k(Ae, {
2254
+ ])) : j("", !0),
2255
+ e.searchable && !M.value.length ? (N(), k("div", xn, "No matches")) : j("", !0),
2256
+ (N(!0), k(Ae, null, ha(M.value, (c) => (N(), k(Ae, {
2240
2257
  key: "heading" in c ? `heading:${c.heading}` : `option:${c.option.value}`
2241
2258
  }, [
2242
- "heading" in c ? (b(), k("div", Yn, V(c.heading), 1)) : (b(), k("div", {
2259
+ "heading" in c ? (N(), k("div", Yn, G(c.heading), 1)) : (N(), k("div", {
2243
2260
  key: 1,
2244
2261
  class: pe(["fx-opt", {
2245
- "is-on": O(c.option),
2262
+ "is-on": $(c.option),
2246
2263
  "is-off": c.option.disabled,
2247
2264
  "is-new": c.option.command
2248
2265
  }]),
2249
2266
  role: "option",
2250
- "aria-selected": O(c.option),
2251
- onClick: (S) => ce(c.option)
2267
+ "aria-selected": $(c.option),
2268
+ onClick: (C) => ce(c.option)
2252
2269
  }, [
2253
- y[2] || (y[2] = Y("span", {
2270
+ y[2] || (y[2] = B("span", {
2254
2271
  class: "fx-tick",
2255
2272
  "aria-hidden": "true"
2256
2273
  }, [
2257
- Y("svg", {
2274
+ B("svg", {
2258
2275
  width: "11",
2259
2276
  height: "11",
2260
2277
  viewBox: "0 0 16 16",
2261
2278
  fill: "none"
2262
2279
  }, [
2263
- Y("path", {
2280
+ B("path", {
2264
2281
  d: "m3.5 8.4 3 3 6-7",
2265
2282
  stroke: "currentColor",
2266
2283
  "stroke-width": "2.2",
@@ -2269,20 +2286,20 @@ const Mn = ["data-hierarchy", "data-size", "data-icon"], Vo = /* @__PURE__ */ Oe
2269
2286
  })
2270
2287
  ])
2271
2288
  ], -1)),
2272
- $.value ? (b(), k("span", _n, [
2273
- Y("b", null, V(c.option.label), 1),
2274
- c.option.hint ? (b(), k("small", Fn, V(c.option.hint), 1)) : K("", !0)
2275
- ])) : (b(), k(Ae, { key: 1 }, [
2276
- va(V(c.option.label), 1)
2289
+ x.value ? (N(), k("span", _n, [
2290
+ B("b", null, G(c.option.label), 1),
2291
+ c.option.hint ? (N(), k("small", Fn, G(c.option.hint), 1)) : j("", !0)
2292
+ ])) : (N(), k(Ae, { key: 1 }, [
2293
+ va(G(c.option.label), 1)
2277
2294
  ], 64))
2278
2295
  ], 10, Bn))
2279
2296
  ], 64))), 128))
2280
- ], 10, Rn)) : K("", !0)
2297
+ ], 10, Rn)) : j("", !0)
2281
2298
  ])
2282
2299
  ], 8, ["disabled"]))
2283
2300
  ], 2));
2284
2301
  }
2285
- }), Un = ["id", "aria-labelledby", "aria-label"], Ve = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])', Go = /* @__PURE__ */ Oe({
2302
+ }), Un = ["id", "aria-labelledby", "aria-label"], Ve = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])', jo = /* @__PURE__ */ Oe({
2286
2303
  __name: "ScheduleModal",
2287
2304
  props: {
2288
2305
  open: { type: Boolean },
@@ -2294,43 +2311,43 @@ const Mn = ["data-hierarchy", "data-size", "data-icon"], Vo = /* @__PURE__ */ Oe
2294
2311
  },
2295
2312
  emits: ["close"],
2296
2313
  setup(e, { emit: a }) {
2297
- const t = e, n = a, s = E(null);
2314
+ const t = e, n = a, o = P(null);
2298
2315
  let i = null;
2299
- function r() {
2316
+ function l() {
2300
2317
  be(() => {
2301
- const d = s.value;
2318
+ const d = o.value;
2302
2319
  d && (d.querySelector(Ve) ?? d).focus();
2303
2320
  });
2304
2321
  }
2305
- function o(d) {
2322
+ function s(d) {
2306
2323
  if (!t.open) return;
2307
2324
  if (d.key === "Escape") {
2308
2325
  d.preventDefault(), n("close");
2309
2326
  return;
2310
2327
  }
2311
- if (d.key !== "Tab" || !s.value) return;
2312
- const f = Array.from(s.value.querySelectorAll(Ve));
2313
- if (!f.length) return;
2314
- const D = f[0], C = f[f.length - 1];
2315
- d.shiftKey && document.activeElement === D ? (d.preventDefault(), C.focus()) : !d.shiftKey && document.activeElement === C && (d.preventDefault(), D.focus());
2328
+ if (d.key !== "Tab" || !o.value) return;
2329
+ const v = Array.from(o.value.querySelectorAll(Ve));
2330
+ if (!v.length) return;
2331
+ const g = v[0], A = v[v.length - 1];
2332
+ d.shiftKey && document.activeElement === g ? (d.preventDefault(), A.focus()) : !d.shiftKey && document.activeElement === A && (d.preventDefault(), g.focus());
2316
2333
  }
2317
2334
  return Re(
2318
2335
  () => t.open,
2319
2336
  (d) => {
2320
- d ? (i = document.activeElement instanceof HTMLElement ? document.activeElement : null, r()) : (i == null || i.focus(), i = null);
2337
+ d ? (i = document.activeElement instanceof HTMLElement ? document.activeElement : null, l()) : (i == null || i.focus(), i = null);
2321
2338
  },
2322
2339
  { immediate: !0 }
2323
- ), Ie(() => document.addEventListener("keydown", o)), Te(() => {
2324
- document.removeEventListener("keydown", o), i = null;
2325
- }), (d, f) => e.open ? (b(), k("div", {
2340
+ ), Ie(() => document.addEventListener("keydown", s)), Te(() => {
2341
+ document.removeEventListener("keydown", s), i = null;
2342
+ }), (d, v) => e.open ? (N(), k("div", {
2326
2343
  key: 0,
2327
2344
  class: "modal-overlay open",
2328
- onClick: f[0] || (f[0] = ga((D) => n("close"), ["self"]))
2345
+ onClick: v[0] || (v[0] = ga((g) => n("close"), ["self"]))
2329
2346
  }, [
2330
- Y("div", {
2347
+ B("div", {
2331
2348
  id: e.id,
2332
2349
  ref_key: "panel",
2333
- ref: s,
2350
+ ref: o,
2334
2351
  class: pe(["schedule-modal-panel", e.panelClass]),
2335
2352
  style: Da(e.panelStyle),
2336
2353
  role: "dialog",
@@ -2341,99 +2358,100 @@ const Mn = ["data-hierarchy", "data-size", "data-icon"], Vo = /* @__PURE__ */ Oe
2341
2358
  }, [
2342
2359
  Ke(d.$slots, "default")
2343
2360
  ], 14, Un)
2344
- ])) : K("", !0);
2361
+ ])) : j("", !0);
2345
2362
  }
2346
2363
  });
2347
2364
  export {
2348
- j as $,
2349
- Io as A,
2365
+ H as $,
2366
+ To as A,
2350
2367
  Jn as B,
2351
2368
  ao as C,
2352
2369
  se as D,
2353
2370
  Qe as E,
2354
- Ne as F,
2355
- ka as G,
2371
+ ke as F,
2372
+ Na as G,
2356
2373
  no as H,
2357
- yo as I,
2358
- $o as J,
2374
+ po as I,
2375
+ xo as J,
2359
2376
  Pa as K,
2360
- So as L,
2361
- No as M,
2377
+ Co as L,
2378
+ So as M,
2362
2379
  ko as N,
2363
2380
  he as O,
2364
2381
  Sa as P,
2365
2382
  io as Q,
2366
2383
  eo as R,
2367
- To as S,
2368
- W as T,
2384
+ Ro as S,
2385
+ z as T,
2369
2386
  ta as U,
2370
2387
  Ta as V,
2371
- Lo as W,
2388
+ Io as W,
2372
2389
  _e as X,
2373
- Yo as Y,
2390
+ Bo as Y,
2374
2391
  to as Z,
2375
2392
  Sn as _,
2376
- Fo as a,
2377
- H as a0,
2378
- le as a1,
2379
- ie as a2,
2380
- oe as a3,
2381
- lo as a4,
2382
- co as a5,
2383
- Le as a6,
2384
- ro as a7,
2393
+ Uo as a,
2394
+ le as a0,
2395
+ ie as a1,
2396
+ oe as a2,
2397
+ uo as a3,
2398
+ mo as a4,
2399
+ Le as a5,
2400
+ X as a6,
2401
+ lo as a7,
2385
2402
  Ra as a8,
2386
- mo as a9,
2387
- fo as aA,
2403
+ yo as a9,
2404
+ re as aA,
2405
+ ho as aB,
2388
2406
  Dn as aa,
2389
- X as ab,
2390
- Ho as ac,
2391
- Do as ad,
2392
- wo as ae,
2393
- xo as af,
2407
+ V as ab,
2408
+ Ao as ac,
2409
+ wo as ad,
2410
+ Ho as ae,
2411
+ Yo as af,
2394
2412
  Ya as ag,
2395
- Eo as ah,
2413
+ Po as ah,
2396
2414
  Ca as ai,
2397
2415
  Xn as aj,
2398
- go as ak,
2416
+ Do as ak,
2399
2417
  Ye as al,
2400
- Wo as am,
2418
+ zo as am,
2401
2419
  Be as an,
2402
2420
  fe as ao,
2403
2421
  Me as ap,
2404
- Po as aq,
2405
- Vo as ar,
2422
+ bo as aq,
2423
+ ro as ar,
2406
2424
  Ko as as,
2407
2425
  Go as at,
2408
- F as au,
2409
- Qn as av,
2410
- zo as aw,
2411
- ho as ax,
2412
- po as ay,
2413
- re as az,
2414
- N as b,
2415
- Uo as c,
2416
- Q as d,
2417
- Ro as e,
2426
+ jo as au,
2427
+ U as av,
2428
+ Qn as aw,
2429
+ Vo as ax,
2430
+ vo as ay,
2431
+ fo as az,
2432
+ S as b,
2433
+ Wo as c,
2434
+ J as d,
2435
+ Oo as e,
2418
2436
  Zn as f,
2419
2437
  pn as g,
2420
- Mo as h,
2438
+ Lo as h,
2421
2439
  La as i,
2422
- vo as j,
2423
- Bo as k,
2424
- Ao as l,
2425
- bo as m,
2426
- Co as n,
2440
+ go as j,
2441
+ _o as k,
2442
+ Eo as l,
2443
+ No as m,
2444
+ Mo as n,
2427
2445
  m as o,
2428
- l as p,
2446
+ r as p,
2429
2447
  Ce as q,
2430
- uo as r,
2448
+ co as r,
2431
2449
  ba as s,
2432
2450
  so as t,
2433
- Oo as u,
2451
+ $o as u,
2434
2452
  Se as v,
2435
2453
  oo as w,
2436
2454
  hn as x,
2437
2455
  qn as y,
2438
- _o as z
2456
+ Fo as z
2439
2457
  };