@feedmepos/mf-hrm-portal 2.3.0-dev.3 → 2.3.0-dev.5

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 (46) hide show
  1. package/dist/{ApprovalCodeList-SjyWZghY.js → ApprovalCodeList-DIqLkR-n.js} +2 -2
  2. package/dist/{AuditLogList-aTI3QeO0.js → AuditLogList-DOrq5WAM.js} +3 -3
  3. package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang--JTV7non.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-DtIAcKaZ.js} +2 -2
  4. package/dist/{EmployeeList-D2Q_2ZE0.js → EmployeeList-BcommHHe.js} +4 -4
  5. package/dist/{GrantUserList-6YXLPuHR.js → GrantUserList-zYXWPBy8.js} +3 -3
  6. package/dist/{Main-B-a6F9g8.js → Main-BbLYXl-C.js} +5 -5
  7. package/dist/{Main-dSqOeBRJ.js → Main-D1Rc3l1L.js} +9 -9
  8. package/dist/{Main-CFIWlIaC.js → Main-D8Uz1Mlf.js} +2 -2
  9. package/dist/{PermissionSetList-DxkaPCMs.js → PermissionSetList-DB27fd5Q.js} +5 -5
  10. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DnKckKZ0.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DtVJW54V.js} +881 -881
  11. package/dist/{RoleList-DQZ_w5uM.js → RoleList-DqH-J2Di.js} +7 -7
  12. package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-Dr6QruG6.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-Dk5KTJmM.js} +1 -1
  13. package/dist/{ScheduleGeneralPage-CvskrXcV.js → ScheduleGeneralPage-C6fHvARq.js} +6 -6
  14. package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-C4On5sVD.js → ScheduleModal.vue_vue_type_script_setup_true_lang-B-rR81nv.js} +689 -641
  15. package/dist/SchedulePage-CqpoSfUn.js +18373 -0
  16. package/dist/{SchedulePositionPage-BGrZBU3g.js → SchedulePositionPage-NMdwzGfm.js} +12 -12
  17. package/dist/{TeamMemberList-BiTHVJwE.js → TeamMemberList-CX0qHVRT.js} +6 -6
  18. package/dist/{TimesheetList-CUkYacGW.js → TimesheetList-DUK2sUEN.js} +5 -5
  19. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-B1Y587O-.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-m8Ml-b47.js} +2 -2
  20. package/dist/{app-CAKCDrbJ.js → app-CLTLqZhG.js} +8 -8
  21. package/dist/app.js +1 -1
  22. package/dist/{dayjs.min-CZ8QYRoc.js → dayjs.min-BFtQINpX.js} +1 -1
  23. package/dist/{employee-D56eWEFe.js → employee-CWjZhmcu.js} +3 -3
  24. package/dist/{iteration-BVJdyLNq.js → iteration-NQ4DY9De.js} +1 -1
  25. package/dist/{lodash-BcIRkQPW.js → lodash-OAOy_WpD.js} +1 -1
  26. package/dist/{role-B-eZDaBX.js → role-DSSFv8cl.js} +1 -1
  27. package/dist/{rule-D6AIfx8b.js → rule-DY7yg9_a.js} +2 -2
  28. package/dist/src/api/schedule/index.d.ts +6 -2
  29. package/dist/src/composables/useMessage.d.ts +8 -2
  30. package/dist/src/types/schedule.d.ts +1 -1
  31. package/dist/src/views/scheduling/components/ScheduleAutoScheduleDetailsModal.vue.d.ts +6 -0
  32. package/dist/src/views/scheduling/components/SchedulePublishShareArt.vue.d.ts +2 -0
  33. package/dist/src/views/scheduling/composables/auto-schedule-mapping.d.ts +33 -0
  34. package/dist/src/views/scheduling/composables/remyPrompt.d.ts +13 -0
  35. package/dist/src/views/scheduling/composables/useRemyAppStore.d.ts +10 -0
  36. package/dist/src/views/scheduling/composables/useScheduleAutoSchedule.d.ts +114 -4
  37. package/dist/src/views/scheduling/composables/useScheduleDemandSheet.d.ts +1 -5
  38. package/dist/src/views/scheduling/schedule-state.d.ts +106 -106
  39. package/dist/src/views/scheduling/schedule-store.d.ts +5 -2
  40. package/dist/src/views/scheduling/types.d.ts +3 -0
  41. package/dist/style.css +1 -1
  42. package/dist/tsconfig.app.tsbuildinfo +1 -1
  43. package/dist/{useReportPermissions-DHA0jrIr.js → useReportPermissions-BRs-yhSQ.js} +3 -3
  44. package/package.json +2 -1
  45. package/dist/SchedulePage-CW-K836l.js +0 -18248
  46. package/dist/src/views/scheduling/composables/scheduleAutoSolver.d.ts +0 -23
@@ -1,9 +1,9 @@
1
- import { onMounted as He, onBeforeUnmount as we, ref as D, reactive as O, shallowRef as de, watch as Ee, computed as Y, defineComponent as Ae, createElementBlock as C, openBlock as N, renderSlot as Ye, useAttrs as sa, nextTick as fe, normalizeClass as oe, createElementVNode as _, createBlock as ra, mergeProps as la, toDisplayString as F, Teleport as ua, createCommentVNode as U, withDirectives as da, vModelText as ca, Fragment as ce, renderList as ya, createTextVNode as ma, withModifiers as fa, normalizeStyle as pa } from "vue";
1
+ import { onMounted as He, onBeforeUnmount as Ae, ref as w, reactive as O, shallowRef as ce, watch as Ee, computed as P, defineComponent as be, createElementBlock as k, openBlock as b, renderSlot as Ye, useAttrs as ia, nextTick as pe, normalizeClass as se, createElementVNode as _, createBlock as ra, mergeProps as la, toDisplayString as F, Teleport as ua, createCommentVNode as U, withDirectives as da, vModelText as ca, Fragment as ye, renderList as ya, createTextVNode as ma, withModifiers as fa, normalizeStyle as pa } from "vue";
2
2
  import { useRoute as ha, useRouter as va } from "vue-router";
3
3
  import { useCoreStore as Be } from "@feedmepos/mf-common";
4
- import { g as v, b as h, u as Da } from "./restaurant-D7PEQjPY.js";
5
- import { E as pe, u as ga } from "./employee-D56eWEFe.js";
6
- function Fn(e) {
4
+ import { g as h, b as p, u as Da } from "./restaurant-D7PEQjPY.js";
5
+ import { E as he, u as ga } from "./employee-CWjZhmcu.js";
6
+ function Wn(e) {
7
7
  let a = null;
8
8
  function t() {
9
9
  if (!a) return;
@@ -14,168 +14,192 @@ function Fn(e) {
14
14
  He(() => {
15
15
  var n;
16
16
  a = ((n = e.value) == null ? void 0 : n.closest(".sch-page")) ?? null, t(), window.addEventListener("resize", t);
17
- }), we(() => {
17
+ }), Ae(() => {
18
18
  window.removeEventListener("resize", t), a && (a.style.height = "");
19
19
  });
20
20
  }
21
- function he(e) {
21
+ function ve(e) {
22
22
  const [a, t] = String(e || "0:0").split(":").map(Number);
23
23
  return (Number.isFinite(a) ? a : 0) * 60 + (Number.isFinite(t) ? t : 0);
24
24
  }
25
- function Ha(e) {
25
+ function wa(e) {
26
26
  const a = Math.max(0, Math.min(1439, Math.round(e)));
27
27
  return `${String(Math.floor(a / 60)).padStart(2, "0")}:${String(a % 60).padStart(2, "0")}`;
28
28
  }
29
- function wa(e, a) {
30
- const t = he(e);
31
- let n = he(a);
29
+ function Ha(e, a) {
30
+ const t = ve(e);
31
+ let n = ve(a);
32
32
  return n <= t && (n += 1440), [t, n];
33
33
  }
34
34
  function _e(e, a) {
35
- const [t, n] = wa(e, a);
35
+ const [t, n] = Ha(e, a);
36
36
  return Math.max(0, n - t);
37
37
  }
38
- function Ea(e) {
39
- const a = (he(e) % 1440 + 1440) % 1440, t = Math.floor(a / 60), n = a % 60, s = t < 12 ? "am" : "pm", o = t % 12 || 12;
40
- return n ? `${o}:${String(n).padStart(2, "0")}${s}` : `${o}${s}`;
38
+ function Aa(e) {
39
+ const a = (ve(e) % 1440 + 1440) % 1440, t = Math.floor(a / 60), n = a % 60, r = t < 12 ? "am" : "pm", o = t % 12 || 12;
40
+ return n ? `${o}:${String(n).padStart(2, "0")}${r}` : `${o}${r}`;
41
41
  }
42
- function Un(e) {
43
- return Ea(Ha(e % 1440));
42
+ function zn(e) {
43
+ return Aa(wa(e % 1440));
44
44
  }
45
45
  function xe(e) {
46
46
  const a = Array.isArray(e) ? e : e == null ? void 0 : e.breaks;
47
47
  return a != null && a.length ? a.reduce((t, n) => {
48
48
  if (n.type === "DURATION") return t + n.minutes;
49
- const [s, o] = n.startTime.split(":").map(Number), [r, i] = n.endTime.split(":").map(Number);
50
- let y = r * 60 + i - (s * 60 + o);
51
- return y < 0 && (y += 24 * 60), t + y;
49
+ const [r, o] = n.startTime.split(":").map(Number), [s, i] = n.endTime.split(":").map(Number);
50
+ let m = s * 60 + i - (r * 60 + o);
51
+ return m < 0 && (m += 24 * 60), t + m;
52
52
  }, 0) : Math.max(0, e && !Array.isArray(e) ? e.breakMins ?? 0 : 0);
53
53
  }
54
- function Wn(e, a) {
55
- var s;
56
- const t = a ?? _e(e.start, e.end), n = (s = e.breaks) != null && s.length ? e.breaks.reduce((o, r) => o + (r.breakPayType === "UNPAID" ? xe([r]) : 0), 0) : Math.max(0, e.breakMins ?? 0);
54
+ function Vn(e, a) {
55
+ var r;
56
+ const t = a ?? _e(e.start, e.end), n = (r = e.breaks) != null && r.length ? e.breaks.reduce((o, s) => o + (s.breakPayType === "UNPAID" ? xe([s]) : 0), 0) : Math.max(0, e.breakMins ?? 0);
57
57
  return Math.max(0, t - Math.min(t, n));
58
58
  }
59
- function zn(e) {
59
+ function Kn(e) {
60
60
  const a = Math.max(0, Math.round(e ?? 0));
61
61
  return a ? [{ type: "DURATION", minutes: a, breakPayType: "UNPAID" }] : [];
62
62
  }
63
- const Q = 500, Aa = 10, ke = 6, Vn = 1500, Fe = 1e6, g = {
63
+ const q = 500, Ea = 10, Me = 6, Gn = 1500, Fe = 1e6, D = {
64
64
  async listEmployeeProfiles(e) {
65
- return v(
66
- await h("schedules").get("employees", {
65
+ return h(
66
+ await p("schedules").get("employees", {
67
67
  params: e != null && e.length ? { ids: e.join(",") } : void 0
68
68
  })
69
69
  );
70
70
  },
71
71
  async listEmployeeConfigs(e) {
72
- return v(
73
- await h(`restaurants/${e}/schedules`).get("employee-configs")
72
+ return h(
73
+ await p(`restaurants/${e}/schedules`).get("employee-configs")
74
74
  );
75
75
  },
76
76
  async saveEmployeeConfigs(e, a) {
77
- return v(
78
- await h(`restaurants/${e}/schedules`).post(
77
+ return h(
78
+ await p(`restaurants/${e}/schedules`).post(
79
79
  "employee-configs/reorder",
80
80
  a
81
81
  )
82
82
  );
83
83
  },
84
84
  async getSettings(e) {
85
- return v(
86
- await h(`restaurants/${e}/schedules`).get("settings")
85
+ return h(
86
+ await p(`restaurants/${e}/schedules`).get("settings")
87
87
  );
88
88
  },
89
89
  async saveSettings(e, a) {
90
- return v(
91
- await h(`restaurants/${e}/schedules`).post("settings", a)
90
+ return h(
91
+ await p(`restaurants/${e}/schedules`).post("settings", a)
92
92
  );
93
93
  },
94
94
  async generateAutoSchedule(e, a) {
95
- return v(
96
- await h(`restaurants/${e}/schedules`).post(
95
+ return h(
96
+ await p(`restaurants/${e}/schedules`).post(
97
97
  "auto-schedule/generate",
98
98
  a
99
99
  )
100
100
  );
101
101
  },
102
+ async getAutoScheduleCapabilities(e) {
103
+ return h(
104
+ await p(`restaurants/${e}/schedules`).get(
105
+ "auto-schedule/capabilities"
106
+ )
107
+ );
108
+ },
109
+ async applyAutoSchedule(e, a) {
110
+ return h(
111
+ await p(`restaurants/${e}/schedules`).post(
112
+ "auto-schedule/apply",
113
+ a
114
+ )
115
+ );
116
+ },
102
117
  /** One outlet's whole board over `[from, to]` (inclusive, 'YYYY-MM-DD'). */
103
118
  async readBoard(e, a, t) {
104
- return v(
105
- await h(`restaurants/${e}/schedules`).get("board", {
119
+ return h(
120
+ await p(`restaurants/${e}/schedules`).get("board", {
106
121
  params: { from: a, to: t }
107
122
  })
108
123
  );
109
124
  },
110
125
  async createTimeOff(e, a) {
111
- return v(
112
- await h(`restaurants/${e}/schedules`).post("time-off", a)
126
+ return h(
127
+ await p(`restaurants/${e}/schedules`).post("time-off", a)
113
128
  );
114
129
  },
115
130
  async updateTimeOffStatus(e, a, t) {
116
- return v(
117
- await h(`restaurants/${e}/schedules`).post(
131
+ return h(
132
+ await p(`restaurants/${e}/schedules`).post(
118
133
  `time-off/${a}/status`,
119
134
  t
120
135
  )
121
136
  );
122
137
  },
123
138
  async deleteTimeOff(e, a) {
124
- await h(`restaurants/${e}/schedules`).delete(`time-off/${a}`);
139
+ await p(`restaurants/${e}/schedules`).delete(`time-off/${a}`);
125
140
  },
126
141
  /** Creates or updates the employee's shared business-level scheduling profile. */
127
142
  async createEmployeeProfile(e, a) {
128
- return v(await h("schedules").post("employees", a));
143
+ return h(await p("schedules").post("employees", a));
129
144
  },
130
145
  /** Edits the employee's shared business-level scheduling profile. */
131
146
  async updateEmployeeProfile(e, a, t) {
132
- return v(
133
- await h("schedules").post("employees", { employeeId: a, ...t })
147
+ return h(
148
+ await p("schedules").post("employees", { employeeId: a, ...t })
134
149
  );
135
150
  },
136
151
  /** Positions are shared across the business. */
137
152
  async createPosition(e) {
138
- return v(await h("schedules").post("positions", e));
153
+ return h(await p("schedules").post("positions", e));
139
154
  },
140
155
  async updatePosition(e, a) {
141
- return v(await h("schedules").post(`positions/${e}`, a));
156
+ return h(await p("schedules").post(`positions/${e}`, a));
142
157
  },
143
158
  /** Deleting one position is `deletePositions` with a single-id array — the backend's
144
159
  * `DELETE positions/:id` route is gone; this is now `DELETE positions?ids=`. */
145
160
  async deletePosition(e) {
146
- await h("schedules").delete("positions", {
161
+ await p("schedules").delete("positions", {
147
162
  params: { ids: e }
148
163
  });
149
164
  },
150
165
  /** Creates one flat demand interval. */
151
166
  async createDemand(e, a) {
152
- return v(
153
- await h(`restaurants/${e}/schedules`).post("demands", a)
167
+ return h(
168
+ await p(`restaurants/${e}/schedules`).post("demands", a)
154
169
  );
155
170
  },
156
171
  /** Deletes a batch of demands in one request — e.g. `saveDemand` replacing a whole
157
172
  * day/weekday's demand rows wholesale. Deleting one demand is just this with a single-id
158
173
  * array. */
159
174
  async deleteDemands(e, a) {
160
- return v(
161
- await h(`restaurants/${e}/schedules`).delete("demands", {
175
+ return h(
176
+ await p(`restaurants/${e}/schedules`).delete("demands", {
162
177
  params: { ids: a.join(",") }
163
178
  })
164
179
  );
165
180
  },
166
181
  /** Atomically replaces one date/weekday's flattened demand rows. */
167
182
  async replaceDemands(e, a) {
168
- return v(
169
- await h(`restaurants/${e}/schedules`).post(
183
+ return h(
184
+ await p(`restaurants/${e}/schedules`).post(
170
185
  "demands/replace",
171
186
  a
172
187
  )
173
188
  );
174
189
  },
190
+ /** Atomically replaces several date/weekday demand generations. */
191
+ async bulkReplaceDemands(e, a) {
192
+ return h(
193
+ await p(`restaurants/${e}/schedules`).post(
194
+ "demands/bulk-replace",
195
+ a
196
+ )
197
+ );
198
+ },
175
199
  /** Replaces one date's note/holiday-mark. All three fields back to empty/false clears it. */
176
200
  async saveScheduleDay(e, a, t) {
177
- return v(
178
- await h(`restaurants/${e}/schedules`).post(
201
+ return h(
202
+ await p(`restaurants/${e}/schedules`).post(
179
203
  `days/${a}`,
180
204
  t
181
205
  )
@@ -183,13 +207,13 @@ const Q = 500, Aa = 10, ke = 6, Vn = 1500, Fe = 1e6, g = {
183
207
  },
184
208
  /** A one-off shift assignment. */
185
209
  async createAssignment(e, a) {
186
- return v(
187
- await h(`restaurants/${e}/schedules`).post("assignments", a)
210
+ return h(
211
+ await p(`restaurants/${e}/schedules`).post("assignments", a)
188
212
  );
189
213
  },
190
214
  async updateAssignment(e, a, t) {
191
- return v(
192
- await h(`restaurants/${e}/schedules`).patch(
215
+ return h(
216
+ await p(`restaurants/${e}/schedules`).patch(
193
217
  `assignments/${a}`,
194
218
  t
195
219
  )
@@ -197,8 +221,8 @@ const Q = 500, Aa = 10, ke = 6, Vn = 1500, Fe = 1e6, g = {
197
221
  },
198
222
  /** Atomically applies assignment updates, creates, and deletes used by moves and swaps. */
199
223
  async bulkSaveAssignments(e, a) {
200
- return v(
201
- await h(`restaurants/${e}/schedules`).post(
224
+ return h(
225
+ await p(`restaurants/${e}/schedules`).post(
202
226
  "assignments/bulk",
203
227
  a
204
228
  )
@@ -208,8 +232,8 @@ const Q = 500, Aa = 10, ke = 6, Vn = 1500, Fe = 1e6, g = {
208
232
  * getting replaced wholesale. Deleting one assignment is just this with a single-id
209
233
  * array. */
210
234
  async deleteAssignments(e, a) {
211
- return v(
212
- await h(`restaurants/${e}/schedules`).delete("assignments", {
235
+ return h(
236
+ await p(`restaurants/${e}/schedules`).delete("assignments", {
213
237
  params: { ids: a.join(",") }
214
238
  })
215
239
  );
@@ -217,25 +241,25 @@ const Q = 500, Aa = 10, ke = 6, Vn = 1500, Fe = 1e6, g = {
217
241
  /** Flips a batch of assignments to one status in a single request — e.g. Publish sending
218
242
  * every DRAFT shift on the board to PUBLISHED at once. */
219
243
  async bulkUpdateAssignmentStatus(e, a) {
220
- return v(
221
- await h(`restaurants/${e}/schedules`).patch(
244
+ return h(
245
+ await p(`restaurants/${e}/schedules`).patch(
222
246
  "assignments/bulk-status",
223
247
  a
224
248
  )
225
249
  );
226
250
  }
227
251
  }, Ue = {
228
- payload: de(null),
229
- loading: D(!1),
230
- rosterLoading: D(!1),
231
- loadError: D(null),
232
- scheduleSetupCompleted: D(!1),
233
- dataVersion: D(0),
234
- outletId: D(""),
235
- restaurantEmployees: D([]),
236
- employeeConfigs: D([]),
237
- employeeOutletIds: de({}),
238
- businessEmployees: de([]),
252
+ payload: ce(null),
253
+ loading: w(!1),
254
+ rosterLoading: w(!1),
255
+ loadError: w(null),
256
+ scheduleSetupCompleted: w(!1),
257
+ dataVersion: w(0),
258
+ outletId: w(""),
259
+ restaurantEmployees: w([]),
260
+ employeeConfigs: w([]),
261
+ employeeOutletIds: ce({}),
262
+ businessEmployees: ce([]),
239
263
  positions: O([]),
240
264
  positionRecords: O([]),
241
265
  rolePositions: O({}),
@@ -275,27 +299,27 @@ const Q = 500, Aa = 10, ke = 6, Vn = 1500, Fe = 1e6, g = {
275
299
  }, {
276
300
  payload: d,
277
301
  loading: Se,
278
- rosterLoading: Le,
302
+ rosterLoading: Oe,
279
303
  loadError: ie,
280
304
  scheduleSetupCompleted: We,
281
305
  dataVersion: z,
282
- outletId: m,
283
- restaurantEmployees: se,
306
+ outletId: y,
307
+ restaurantEmployees: re,
284
308
  employeeConfigs: x,
285
309
  employeeOutletIds: ze,
286
- businessEmployees: ye,
310
+ businessEmployees: me,
287
311
  positions: ba,
288
312
  positionRecords: Ve,
289
- rolePositions: Kn,
313
+ rolePositions: jn,
290
314
  outlet: Na,
291
- locationOptions: Oe,
292
- locationLabelById: X,
293
- compensationGroupMeta: Gn,
294
- existingStaff: jn,
295
- shiftTemplates: Qn,
296
- rules: T
315
+ locationOptions: Le,
316
+ locationLabelById: J,
317
+ compensationGroupMeta: Qn,
318
+ existingStaff: qn,
319
+ shiftTemplates: Xn,
320
+ rules: I
297
321
  } = Ue;
298
- function Ca() {
322
+ function ka() {
299
323
  const e = Ue.rules;
300
324
  Object.keys(e.coverage).forEach((a) => delete e.coverage[a]), e.openFrom = "00:00", e.openTo = "24:00", e.dayHours.splice(0, e.dayHours.length, ...Array.from({ length: 7 }, () => [])), Object.assign(e.payRate.NORMAL, { overtime: 1.5 }), Object.assign(e.payRate.REST_DAY, { regular: 1, overtime: 2 }), Object.assign(e.payRate.PUBLIC_HOLIDAY, { regular: 2, overtime: 3 }), e.otAfterDaily = 0, e.salesForecast = 0, e.closedWeekdays.splice(0, e.closedWeekdays.length), e.labourTarget = 0, e.budgetFromSales = !1, e.budget = 0, e.otCapHours = 0, e.otBudget = 0, Object.assign(e.notify, {
301
325
  waConnected: !1,
@@ -304,76 +328,76 @@ function Ca() {
304
328
  defaults: { wa: !1, push: !1, email: !1 }
305
329
  });
306
330
  }
307
- const ve = 7;
308
- function Ma(e) {
331
+ const De = 7;
332
+ function Ca(e) {
309
333
  const a = e.getFullYear(), t = String(e.getMonth() + 1).padStart(2, "0"), n = String(e.getDate()).padStart(2, "0");
310
334
  return `${a}-${t}-${n}`;
311
335
  }
312
- function J(e, a) {
336
+ function Z(e, a) {
313
337
  const t = new Date(e);
314
338
  return t.setDate(t.getDate() + a), t;
315
339
  }
316
- function De(e) {
340
+ function ge(e) {
317
341
  const a = new Date(e);
318
342
  return a.setHours(0, 0, 0, 0), a.setDate(a.getDate() - (a.getDay() + 6) % 7), a;
319
343
  }
320
- function qn(e, a = /* @__PURE__ */ new Date()) {
321
- const t = J(De(a), e * ve);
322
- return Array.from({ length: ve }, (n, s) => J(t, s));
344
+ function Jn(e, a = /* @__PURE__ */ new Date()) {
345
+ const t = Z(ge(a), e * De);
346
+ return Array.from({ length: De }, (n, r) => Z(t, r));
323
347
  }
324
- function Xn(e, a) {
325
- const t = (o) => Date.UTC(o.getFullYear(), o.getMonth(), o.getDate()), n = t(De(e)), s = t(De(a));
326
- return Math.trunc((s - n) / (ve * 24 * 60 * 60 * 1e3));
348
+ function Zn(e, a) {
349
+ const t = (o) => Date.UTC(o.getFullYear(), o.getMonth(), o.getDate()), n = t(ge(e)), r = t(ge(a));
350
+ return Math.trunc((r - n) / (De * 24 * 60 * 60 * 1e3));
327
351
  }
328
- const Z = Ma;
329
- let V = null, K = null, W = null, q = 0, re = null;
352
+ const ee = Ca;
353
+ let V = null, K = null, W = null, X = 0, le = null;
330
354
  function Re(e) {
331
- return e === m.value ? !1 : (Ca(), m.value = e, d.value = null, V = null, K = null, ie.value = null, re = null, We.value = !1, se.value = [], x.value = [], W = null, q += 1, z.value += 1, !0);
355
+ return e === y.value ? !1 : (ka(), y.value = e, d.value = null, V = null, K = null, ie.value = null, le = null, We.value = !1, re.value = [], x.value = [], W = null, X += 1, z.value += 1, !0);
332
356
  }
333
- async function ge(e) {
334
- if (!(!e || re === e)) {
335
- Le.value = !0;
357
+ async function we(e) {
358
+ if (!(!e || le === e)) {
359
+ Oe.value = !0;
336
360
  try {
337
- await ka(e);
361
+ await Ma(e);
338
362
  } finally {
339
- Le.value = !1;
363
+ Oe.value = !1;
340
364
  }
341
365
  }
342
366
  }
343
- async function ka(e) {
344
- const a = await pe.readEmployeesPage({
345
- limit: Q,
367
+ async function Ma(e) {
368
+ const a = await he.readEmployeesPage({
369
+ limit: q,
346
370
  offset: 0,
347
371
  restaurantIds: [e]
348
372
  });
349
- e === m.value && (se.value = a.items, x.value = await g.listEmployeeConfigs(e), re = e, z.value += 1, Ra().then((t) => {
350
- e === m.value && (ze.value = t, z.value += 1);
373
+ e === y.value && (re.value = a.items, x.value = await D.listEmployeeConfigs(e), le = e, z.value += 1, Ra().then((t) => {
374
+ e === y.value && (ze.value = t, z.value += 1);
351
375
  }));
352
376
  }
353
377
  async function Sa(e) {
354
- const a = m.value;
378
+ const a = y.value;
355
379
  if (!a || !e.length) return;
356
- const t = await g.saveEmployeeConfigs(a, { configs: e });
380
+ const t = await D.saveEmployeeConfigs(a, { configs: e });
357
381
  x.value = t, z.value += 1;
358
382
  }
359
- async function La(e, a) {
360
- const t = x.value.find((s) => s.employeeId === e), n = (t == null ? void 0 : t.displayOrder) ?? (a && x.value.some((s) => s.displayOrder !== null) ? Math.max(
383
+ async function Oa(e, a) {
384
+ const t = x.value.find((r) => r.employeeId === e), n = (t == null ? void 0 : t.displayOrder) ?? (a && x.value.some((r) => r.displayOrder !== null) ? Math.max(
361
385
  0,
362
- ...x.value.filter((s) => s.displayOrder !== null).map((s) => s.displayOrder)
386
+ ...x.value.filter((r) => r.displayOrder !== null).map((r) => r.displayOrder)
363
387
  ) + 100 : null);
364
388
  await Sa([{ employeeId: e, enabled: a, displayOrder: n }]);
365
389
  }
366
390
  async function Ke() {
367
- const e = m.value;
368
- e && (re = null, await ge(e));
391
+ const e = y.value;
392
+ e && (le = null, await we(e));
369
393
  }
370
394
  async function Ge(e, a) {
371
395
  const t = ga(), n = (await je(!0)).find((i) => i._id === e);
372
396
  if (!n) throw new Error("Could not find this employee");
373
- const s = n.restaurantRole.map((i) => ({
397
+ const r = n.restaurantRole.map((i) => ({
374
398
  restaurantId: i.restaurantId,
375
399
  roleId: i.roleId
376
- })), o = a(s);
400
+ })), o = a(r);
377
401
  if (!o.length)
378
402
  throw new Error(
379
403
  "An employee must keep at least 1 location, otherwise they are deleted. To delete them, use the Employee page."
@@ -381,36 +405,36 @@ async function Ge(e, a) {
381
405
  (n.isMasterUser ? "master" : "user") === "master" ? await t.updateMasterEmployee(e, {
382
406
  user: { name: n.name, passcode: n.passcode, code: n.code ?? "" },
383
407
  roles: o,
384
- previousRoles: s
408
+ previousRoles: r
385
409
  }) : await t.updateEmployee(e, {
386
410
  user: { name: n.name, passcode: n.passcode },
387
411
  roles: o,
388
- previousRoles: s
412
+ previousRoles: r
389
413
  });
390
414
  }
391
- async function Jn(e, a, t = "") {
415
+ async function eo(e, a, t = "") {
392
416
  const n = [...new Set(a.filter(Boolean))];
393
- n.length && (await Ge(e, (s) => [
394
- ...s.filter((o) => !n.includes(o.restaurantId)),
417
+ n.length && (await Ge(e, (r) => [
418
+ ...r.filter((o) => !n.includes(o.restaurantId)),
395
419
  ...n.map((o) => ({ restaurantId: o, roleId: t }))
396
- ]), m.value && n.includes(m.value) && await La(e, !0), await Ke());
420
+ ]), y.value && n.includes(y.value) && await Oa(e, !0), await Ke());
397
421
  }
398
- async function Zn(e, a) {
422
+ async function ao(e, a) {
399
423
  const t = new Set(a);
400
- t.size && (await Ge(e, (n) => n.filter((s) => !t.has(s.restaurantId))), await Ke());
424
+ t.size && (await Ge(e, (n) => n.filter((r) => !t.has(r.restaurantId))), await Ke());
401
425
  }
402
- let j = null;
403
- async function Oa() {
404
- const e = await pe.readEmployeesPage({
405
- limit: Q,
426
+ let Q = null;
427
+ async function La() {
428
+ const e = await he.readEmployeesPage({
429
+ limit: q,
406
430
  offset: 0,
407
431
  includeEmptyPasscode: !0
408
- }), a = Math.min(Aa, Math.ceil(e.total / Q)), t = await Promise.all(
432
+ }), a = Math.min(Ea, Math.ceil(e.total / q)), t = await Promise.all(
409
433
  Array.from(
410
434
  { length: Math.max(0, a - 1) },
411
- (n, s) => pe.readEmployeesPage({
412
- limit: Q,
413
- offset: (s + 1) * Q,
435
+ (n, r) => he.readEmployeesPage({
436
+ limit: q,
437
+ offset: (r + 1) * q,
414
438
  includeEmptyPasscode: !0
415
439
  })
416
440
  )
@@ -419,13 +443,13 @@ async function Oa() {
419
443
  }
420
444
  function je(e = !1) {
421
445
  if (!e) {
422
- if (j) return j;
423
- if (ye.value.length) return Promise.resolve(ye.value);
446
+ if (Q) return Q;
447
+ if (me.value.length) return Promise.resolve(me.value);
424
448
  }
425
- const a = Oa().then((t) => (ye.value = t, t)).finally(() => {
426
- j === a && (j = null);
449
+ const a = La().then((t) => (me.value = t, t)).finally(() => {
450
+ Q === a && (Q = null);
427
451
  });
428
- return j = a, a;
452
+ return Q = a, a;
429
453
  }
430
454
  async function Ra() {
431
455
  const e = {};
@@ -442,97 +466,104 @@ function Ie(e, a) {
442
466
  return V !== null && K !== null && V <= e && K >= a;
443
467
  }
444
468
  async function Ia(e) {
445
- const a = Z(e), t = Z(J(e, 6));
469
+ const a = ee(e), t = ee(Z(e, 6));
446
470
  Ie(a, t) || W && (await W, Ie(a, t)) || await Qe(
447
- J(e, -7 * ke),
448
- J(e, 7 * ke)
471
+ Z(e, -7 * Me),
472
+ Z(e, 7 * Me)
449
473
  );
450
474
  }
451
- async function eo() {
475
+ async function to() {
452
476
  !V || !K || await Qe(/* @__PURE__ */ new Date(`${V}T00:00:00`), /* @__PURE__ */ new Date(`${K}T00:00:00`));
453
477
  }
454
- async function ao(e) {
455
- if (!m.value) throw new Error("No outlet selected");
456
- const a = await g.createEmployeeProfile(m.value, e);
478
+ async function no(e) {
479
+ if (!y.value) throw new Error("No outlet selected");
480
+ const a = await D.createEmployeeProfile(y.value, e);
457
481
  d.value && (d.value.employees.push(a), z.value += 1);
458
482
  }
459
- async function to(e, a) {
460
- if (!m.value) throw new Error("No outlet selected");
461
- const t = await g.updateEmployeeProfile(m.value, e, a);
483
+ async function oo(e, a) {
484
+ if (!y.value) throw new Error("No outlet selected");
485
+ const t = await D.updateEmployeeProfile(y.value, e, a);
462
486
  if (d.value) {
463
- const n = d.value.employees.findIndex((s) => s.employeeId === e);
487
+ const n = d.value.employees.findIndex((r) => r.employeeId === e);
464
488
  n > -1 && (d.value = {
465
489
  ...d.value,
466
- employees: d.value.employees.map((s, o) => o === n ? t : s)
490
+ employees: d.value.employees.map((r, o) => o === n ? t : r)
467
491
  });
468
492
  }
469
493
  }
470
- async function no(e) {
471
- const a = await g.createPosition(e);
494
+ async function so(e) {
495
+ const a = await D.createPosition(e);
472
496
  d.value && (d.value = { ...d.value, positions: [...d.value.positions, a] });
473
497
  }
474
- async function oo(e, a) {
475
- const t = await g.updatePosition(e, a);
498
+ async function io(e, a) {
499
+ const t = await D.updatePosition(e, a);
476
500
  d.value && (d.value = {
477
501
  ...d.value,
478
502
  positions: d.value.positions.map((n) => n.id === e ? t : n)
479
503
  });
480
504
  }
481
- async function io(e) {
482
- await g.deletePosition(e), d.value && (d.value = {
505
+ async function ro(e) {
506
+ await D.deletePosition(e), d.value && (d.value = {
483
507
  ...d.value,
484
508
  positions: d.value.positions.filter((a) => a.id !== e)
485
509
  });
486
510
  }
487
- async function so(e, a) {
488
- var s;
489
- if (!m.value) throw new Error("No outlet selected");
490
- const t = (s = d.value) == null ? void 0 : s.days.find((o) => o.date === e), n = await g.saveScheduleDay(m.value, e, {
511
+ async function lo(e, a) {
512
+ var r;
513
+ if (!y.value) throw new Error("No outlet selected");
514
+ const t = (r = d.value) == null ? void 0 : r.days.find((o) => o.date === e), n = await D.saveScheduleDay(y.value, e, {
491
515
  ...a,
492
516
  expectedUpdatedAt: a.expectedUpdatedAt ?? (t == null ? void 0 : t.updatedAt)
493
517
  });
494
518
  if (d.value) {
495
- const o = d.value.days.filter((r) => r.date !== e);
519
+ const o = d.value.days.filter((s) => s.date !== e);
496
520
  n && o.push(n), d.value = { ...d.value, days: o };
497
521
  }
498
522
  }
499
- async function ro(e) {
500
- var s;
501
- if (!m.value) throw new Error("No outlet selected");
502
- const a = (((s = d.value) == null ? void 0 : s.demands) ?? []).filter(
503
- (o) => e.date ? o.date === e.date : o.dayOfWeek === e.dayOfWeek
504
- ), t = e.periods.flatMap((o) => {
505
- const r = (o.roles ?? []).filter((f) => f.positionName && f.headcount > 0), i = r.reduce((f, H) => f + H.headcount, 0), y = {
523
+ async function uo(e) {
524
+ await $a([e]);
525
+ }
526
+ function Ta(e) {
527
+ const a = e.periods.flatMap((t) => {
528
+ const n = (t.roles ?? []).filter((s) => s.positionName && s.headcount > 0), r = n.reduce((s, i) => s + i.headcount, 0), o = {
506
529
  ...e.date ? { date: e.date } : { dayOfWeek: e.dayOfWeek },
507
- startTime: o.startTime,
508
- endTime: o.endTime
530
+ startTime: t.startTime,
531
+ endTime: t.endTime
509
532
  };
510
533
  return [
511
- ...r.map((f) => ({
512
- ...y,
513
- headcount: f.headcount,
514
- position: { positionId: f.positionId, positionName: f.positionName }
534
+ ...n.map((s) => ({
535
+ ...o,
536
+ headcount: s.headcount,
537
+ position: { positionId: s.positionId, positionName: s.positionName }
515
538
  })),
516
- ...o.headcount > i ? [{ ...y, headcount: o.headcount - i }] : []
539
+ ...t.headcount > r ? [{ ...o, headcount: t.headcount - r }] : []
517
540
  ];
518
- }), n = await g.replaceDemands(m.value, {
519
- ...e.date ? { date: e.date } : { dayOfWeek: e.dayOfWeek },
520
- demands: t
521
541
  });
542
+ return {
543
+ ...e.date ? { date: e.date } : { dayOfWeek: e.dayOfWeek },
544
+ demands: a
545
+ };
546
+ }
547
+ async function $a(e) {
548
+ if (!y.value) throw new Error("No outlet selected");
549
+ if (!e.length) return;
550
+ const a = e.map(Ta), t = e.length === 1 ? await D.replaceDemands(y.value, a[0]) : await D.bulkReplaceDemands(y.value, { replacements: a });
522
551
  if (d.value) {
523
- const o = d.value.demands.filter((r) => !a.some((i) => i.id === r.id));
524
- d.value = { ...d.value, demands: [...o, ...n] };
552
+ const n = e.map((o) => ({ date: o.date, dayOfWeek: o.dayOfWeek })), r = d.value.demands.filter(
553
+ (o) => !n.some((s) => s.date ? o.date === s.date : o.dayOfWeek === s.dayOfWeek)
554
+ );
555
+ d.value = { ...d.value, demands: [...r, ...t] };
525
556
  }
526
557
  }
527
- async function lo(e, a) {
528
- if (!m.value) throw new Error("No outlet selected");
558
+ async function co(e, a) {
559
+ if (!y.value) throw new Error("No outlet selected");
529
560
  const t = d.value;
530
561
  if (!t || t.demands.some((o) => o.date === a)) return 0;
531
562
  const n = t.demands.filter((o) => o.date === e);
532
563
  if (!n.length) return 0;
533
- const s = await Promise.all(
564
+ const r = await Promise.all(
534
565
  n.map(
535
- (o) => g.createDemand(m.value, {
566
+ (o) => D.createDemand(y.value, {
536
567
  date: a,
537
568
  startTime: o.startTime,
538
569
  endTime: o.endTime,
@@ -546,68 +577,80 @@ async function lo(e, a) {
546
577
  })
547
578
  )
548
579
  );
549
- return d.value && (d.value = { ...d.value, demands: [...d.value.demands, ...s] }), s.length;
580
+ return d.value && (d.value = { ...d.value, demands: [...d.value.demands, ...r] }), r.length;
550
581
  }
551
- async function uo(e) {
552
- if (!m.value) throw new Error("No outlet selected");
553
- return g.bulkSaveAssignments(m.value, e);
582
+ async function yo(e) {
583
+ if (!y.value) throw new Error("No outlet selected");
584
+ return D.generateAutoSchedule(y.value, e);
554
585
  }
555
- async function co(e) {
556
- if (!m.value) throw new Error("No outlet selected");
557
- e.length && await g.deleteAssignments(m.value, e);
586
+ async function mo() {
587
+ if (!y.value) throw new Error("No outlet selected");
588
+ return D.getAutoScheduleCapabilities(y.value);
558
589
  }
559
- async function yo(e) {
560
- if (!m.value) throw new Error("No outlet selected");
561
- const a = await g.createTimeOff(m.value, e);
590
+ async function fo(e) {
591
+ if (!y.value) throw new Error("No outlet selected");
592
+ return D.applyAutoSchedule(y.value, e);
593
+ }
594
+ async function po(e) {
595
+ if (!y.value) throw new Error("No outlet selected");
596
+ return D.bulkSaveAssignments(y.value, e);
597
+ }
598
+ async function ho(e) {
599
+ if (!y.value) throw new Error("No outlet selected");
600
+ e.length && await D.deleteAssignments(y.value, e);
601
+ }
602
+ async function vo(e) {
603
+ if (!y.value) throw new Error("No outlet selected");
604
+ const a = await D.createTimeOff(y.value, e);
562
605
  return d.value && (d.value = { ...d.value, timeOff: [...d.value.timeOff, a] }), a;
563
606
  }
564
- async function mo(e, a) {
565
- if (!m.value) throw new Error("No outlet selected");
566
- const t = await g.updateTimeOffStatus(m.value, e, a);
607
+ async function Do(e, a) {
608
+ if (!y.value) throw new Error("No outlet selected");
609
+ const t = await D.updateTimeOffStatus(y.value, e, a);
567
610
  return t && d.value && (d.value = {
568
611
  ...d.value,
569
612
  timeOff: d.value.timeOff.map((n) => n.id === e ? t : n)
570
613
  }), t;
571
614
  }
572
- async function fo(e) {
573
- if (!m.value) throw new Error("No outlet selected");
574
- await g.deleteTimeOff(m.value, e), d.value && (d.value = {
615
+ async function go(e) {
616
+ if (!y.value) throw new Error("No outlet selected");
617
+ await D.deleteTimeOff(y.value, e), d.value && (d.value = {
575
618
  ...d.value,
576
619
  timeOff: d.value.timeOff.filter((a) => a.id !== e)
577
620
  });
578
621
  }
579
- async function po(e) {
580
- if (!m.value) throw new Error("No outlet selected");
581
- return g.bulkUpdateAssignmentStatus(m.value, e);
622
+ async function wo(e) {
623
+ if (!y.value) throw new Error("No outlet selected");
624
+ return D.bulkUpdateAssignmentStatus(y.value, e);
582
625
  }
583
626
  async function Qe(e, a) {
584
- const t = m.value;
627
+ const t = y.value;
585
628
  if (!t) {
586
629
  ie.value = "No outlet selected";
587
630
  return;
588
631
  }
589
- const n = Z(e), s = Z(a), o = ++q;
632
+ const n = ee(e), r = ee(a), o = ++X;
590
633
  Se.value = !0, ie.value = null;
591
- const r = (async () => {
634
+ const s = (async () => {
592
635
  try {
593
- const i = await g.readBoard(t, n, s);
594
- if (m.value !== t || o !== q) return;
595
- d.value = i, We.value = i.settings.setupCompleted, V = n, K = s, z.value += 1;
636
+ const i = await D.readBoard(t, n, r);
637
+ if (y.value !== t || o !== X) return;
638
+ d.value = i, We.value = i.settings.setupCompleted, V = n, K = r, z.value += 1;
596
639
  } catch (i) {
597
- if (m.value !== t || o !== q) return;
640
+ if (y.value !== t || o !== X) return;
598
641
  ie.value = i instanceof Error ? i.message : "Could not load the schedule";
599
642
  } finally {
600
- m.value === t && o === q && (Se.value = !1);
643
+ y.value === t && o === X && (Se.value = !1);
601
644
  }
602
645
  })();
603
- W = r;
646
+ W = s;
604
647
  try {
605
- await r;
648
+ await s;
606
649
  } finally {
607
- W === r && (W = null);
650
+ W === s && (W = null);
608
651
  }
609
652
  }
610
- const Ta = "AE", $a = "Asia/Dubai", Pa = {
653
+ const Pa = "AE", Ya = "Asia/Dubai", Ba = {
611
654
  NORMAL: {
612
655
  overtime: 1.25
613
656
  },
@@ -619,13 +662,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
619
662
  regular: 2.5,
620
663
  overtime: 1.5
621
664
  }
622
- }, Ya = {
665
+ }, _a = {
623
666
  maxMonthlyHours: null,
624
667
  afterDailyHours: 2
625
- }, Ba = {
668
+ }, xa = {
626
669
  standardWeeklyHours: 48,
627
670
  maxDailyHours: 8
628
- }, _a = [
671
+ }, Fa = [
629
672
  {
630
673
  month: 1,
631
674
  day: 1,
@@ -641,7 +684,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
641
684
  day: 3,
642
685
  name: "UAE National Day Holiday"
643
686
  }
644
- ], xa = {
687
+ ], Ua = {
645
688
  2026: {
646
689
  "2026-01-01": "Gregorian New Year",
647
690
  "2026-03-20": "Eid Al-Fitr Holiday",
@@ -671,15 +714,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
671
714
  "2027-12-02": "UAE National Day",
672
715
  "2027-12-03": "UAE National Day Holiday"
673
716
  }
674
- }, Fa = {
675
- countryCode: Ta,
676
- timezone: $a,
677
- payRate: Pa,
678
- overtime: Ya,
679
- workingHours: Ba,
680
- recurringPublicHolidays: _a,
681
- publicHolidays: xa
682
- }, Ua = "BN", Wa = "Asia/Brunei", za = {
717
+ }, Wa = {
718
+ countryCode: Pa,
719
+ timezone: Ya,
720
+ payRate: Ba,
721
+ overtime: _a,
722
+ workingHours: xa,
723
+ recurringPublicHolidays: Fa,
724
+ publicHolidays: Ua
725
+ }, za = "BN", Va = "Asia/Brunei", Ka = {
683
726
  NORMAL: {
684
727
  overtime: 1.5
685
728
  },
@@ -691,13 +734,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
691
734
  regular: 2,
692
735
  overtime: 3
693
736
  }
694
- }, Va = {
737
+ }, Ga = {
695
738
  maxMonthlyHours: 72,
696
739
  afterDailyHours: null
697
- }, Ka = {
740
+ }, ja = {
698
741
  standardWeeklyHours: 44,
699
742
  maxDailyHours: 8
700
- }, Ga = [
743
+ }, Qa = [
701
744
  {
702
745
  month: 1,
703
746
  day: 1,
@@ -723,7 +766,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
723
766
  day: 25,
724
767
  name: "Christmas Day"
725
768
  }
726
- ], ja = {
769
+ ], qa = {
727
770
  2026: {
728
771
  "2026-01-01": "New Year's Day",
729
772
  "2026-02-17": "Chinese New Year",
@@ -753,15 +796,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
753
796
  "2027-08-15": "Prophet Muhammad's Birthday",
754
797
  "2027-12-25": "Christmas Day"
755
798
  }
756
- }, Qa = {
757
- countryCode: Ua,
758
- timezone: Wa,
759
- payRate: za,
760
- overtime: Va,
761
- workingHours: Ka,
762
- recurringPublicHolidays: Ga,
763
- publicHolidays: ja
764
- }, qa = "ID", Xa = "Asia/Jakarta", Ja = {
799
+ }, Xa = {
800
+ countryCode: za,
801
+ timezone: Va,
802
+ payRate: Ka,
803
+ overtime: Ga,
804
+ workingHours: ja,
805
+ recurringPublicHolidays: Qa,
806
+ publicHolidays: qa
807
+ }, Ja = "ID", Za = "Asia/Jakarta", et = {
765
808
  NORMAL: {
766
809
  overtime: 1.5
767
810
  },
@@ -773,13 +816,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
773
816
  regular: 2,
774
817
  overtime: 2
775
818
  }
776
- }, Za = {
819
+ }, at = {
777
820
  maxMonthlyHours: 72,
778
821
  afterDailyHours: 3
779
- }, et = {
822
+ }, tt = {
780
823
  standardWeeklyHours: 40,
781
824
  maxDailyHours: 8
782
- }, at = [
825
+ }, nt = [
783
826
  {
784
827
  month: 1,
785
828
  day: 1,
@@ -800,7 +843,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
800
843
  day: 25,
801
844
  name: "Christmas Day"
802
845
  }
803
- ], tt = {
846
+ ], ot = {
804
847
  2026: {
805
848
  "2026-01-01": "New Year's Day",
806
849
  "2026-01-16": "Isra Mi'raj",
@@ -840,15 +883,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
840
883
  "2027-12-25": "Christmas Day",
841
884
  "2027-12-26": "Isra Mi'raj"
842
885
  }
843
- }, nt = {
844
- countryCode: qa,
845
- timezone: Xa,
846
- payRate: Ja,
847
- overtime: Za,
848
- workingHours: et,
849
- recurringPublicHolidays: at,
850
- publicHolidays: tt
851
- }, ot = "MO", it = "Asia/Macau", st = {
886
+ }, st = {
887
+ countryCode: Ja,
888
+ timezone: Za,
889
+ payRate: et,
890
+ overtime: at,
891
+ workingHours: tt,
892
+ recurringPublicHolidays: nt,
893
+ publicHolidays: ot
894
+ }, it = "MO", rt = "Asia/Macau", lt = {
852
895
  NORMAL: {
853
896
  overtime: 1.5
854
897
  },
@@ -860,13 +903,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
860
903
  regular: 2,
861
904
  overtime: 3
862
905
  }
863
- }, rt = {
906
+ }, ut = {
864
907
  maxMonthlyHours: null,
865
908
  afterDailyHours: null
866
- }, lt = {
909
+ }, dt = {
867
910
  standardWeeklyHours: 48,
868
911
  maxDailyHours: 8
869
- }, ut = [
912
+ }, ct = [
870
913
  {
871
914
  month: 1,
872
915
  day: 1,
@@ -892,7 +935,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
892
935
  day: 25,
893
936
  name: "Christmas Day"
894
937
  }
895
- ], dt = {
938
+ ], yt = {
896
939
  2026: {
897
940
  "2026-01-01": "New Year's Day",
898
941
  "2026-02-17": "Lunar New Year's Day",
@@ -949,15 +992,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
949
992
  "2027-12-25": "Christmas Day",
950
993
  "2027-12-27": "Compensatory rest day"
951
994
  }
952
- }, ct = {
953
- countryCode: ot,
954
- timezone: it,
955
- payRate: st,
956
- overtime: rt,
957
- workingHours: lt,
958
- recurringPublicHolidays: ut,
959
- publicHolidays: dt
960
- }, yt = "MV", mt = "Indian/Maldives", ft = {
995
+ }, mt = {
996
+ countryCode: it,
997
+ timezone: rt,
998
+ payRate: lt,
999
+ overtime: ut,
1000
+ workingHours: dt,
1001
+ recurringPublicHolidays: ct,
1002
+ publicHolidays: yt
1003
+ }, ft = "MV", pt = "Indian/Maldives", ht = {
961
1004
  NORMAL: {
962
1005
  overtime: 1.5
963
1006
  },
@@ -969,13 +1012,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
969
1012
  regular: 2,
970
1013
  overtime: 3
971
1014
  }
972
- }, pt = {
1015
+ }, vt = {
973
1016
  maxMonthlyHours: null,
974
1017
  afterDailyHours: null
975
- }, ht = {
1018
+ }, Dt = {
976
1019
  standardWeeklyHours: 48,
977
1020
  maxDailyHours: 8
978
- }, vt = [
1021
+ }, gt = [
979
1022
  {
980
1023
  month: 1,
981
1024
  day: 1,
@@ -1001,7 +1044,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1001
1044
  day: 11,
1002
1045
  name: "Republic Day"
1003
1046
  }
1004
- ], Dt = {
1047
+ ], wt = {
1005
1048
  2026: {
1006
1049
  "2026-01-01": "New Year's Day",
1007
1050
  "2026-03-20": "Eid al-Fitr Holiday",
@@ -1039,15 +1082,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1039
1082
  "2027-11-03": "Victory Day",
1040
1083
  "2027-11-11": "Republic Day"
1041
1084
  }
1042
- }, gt = {
1043
- countryCode: yt,
1044
- timezone: mt,
1045
- payRate: ft,
1046
- overtime: pt,
1047
- workingHours: ht,
1048
- recurringPublicHolidays: vt,
1049
- publicHolidays: Dt
1050
- }, Ht = "MY", wt = "Asia/Kuala_Lumpur", Et = {
1085
+ }, Ht = {
1086
+ countryCode: ft,
1087
+ timezone: pt,
1088
+ payRate: ht,
1089
+ overtime: vt,
1090
+ workingHours: Dt,
1091
+ recurringPublicHolidays: gt,
1092
+ publicHolidays: wt
1093
+ }, At = "MY", Et = "Asia/Kuala_Lumpur", bt = {
1051
1094
  NORMAL: {
1052
1095
  overtime: 1.5
1053
1096
  },
@@ -1059,13 +1102,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1059
1102
  regular: 2,
1060
1103
  overtime: 3
1061
1104
  }
1062
- }, At = {
1105
+ }, Nt = {
1063
1106
  maxMonthlyHours: 104,
1064
1107
  afterDailyHours: null
1065
- }, bt = {
1108
+ }, kt = {
1066
1109
  standardWeeklyHours: 45,
1067
1110
  maxDailyHours: 8
1068
- }, Nt = [
1111
+ }, Ct = [
1069
1112
  {
1070
1113
  month: 1,
1071
1114
  day: 1,
@@ -1091,7 +1134,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1091
1134
  day: 25,
1092
1135
  name: "Christmas Day"
1093
1136
  }
1094
- ], Ct = {
1137
+ ], Mt = {
1095
1138
  2026: {
1096
1139
  "2026-01-01": "New Year's Day",
1097
1140
  "2026-02-17": "Chinese New Year",
@@ -1129,15 +1172,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1129
1172
  "2027-10-28": "Deepavali",
1130
1173
  "2027-12-25": "Christmas Day"
1131
1174
  }
1132
- }, Mt = {
1133
- countryCode: Ht,
1134
- timezone: wt,
1135
- payRate: Et,
1136
- overtime: At,
1137
- workingHours: bt,
1138
- recurringPublicHolidays: Nt,
1139
- publicHolidays: Ct
1140
- }, kt = "PK", St = "Asia/Karachi", Lt = {
1175
+ }, St = {
1176
+ countryCode: At,
1177
+ timezone: Et,
1178
+ payRate: bt,
1179
+ overtime: Nt,
1180
+ workingHours: kt,
1181
+ recurringPublicHolidays: Ct,
1182
+ publicHolidays: Mt
1183
+ }, Ot = "PK", Lt = "Asia/Karachi", Rt = {
1141
1184
  NORMAL: {
1142
1185
  overtime: 1.5
1143
1186
  },
@@ -1149,13 +1192,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1149
1192
  regular: 2,
1150
1193
  overtime: 3
1151
1194
  }
1152
- }, Ot = {
1195
+ }, It = {
1153
1196
  maxMonthlyHours: null,
1154
1197
  afterDailyHours: null
1155
- }, Rt = {
1198
+ }, Tt = {
1156
1199
  standardWeeklyHours: 48,
1157
1200
  maxDailyHours: 9
1158
- }, It = [
1201
+ }, $t = [
1159
1202
  {
1160
1203
  month: 1,
1161
1204
  day: 1,
@@ -1186,7 +1229,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1186
1229
  day: 25,
1187
1230
  name: "Quaid-e-Azam Day and Christmas Day"
1188
1231
  }
1189
- ], Tt = {
1232
+ ], Pt = {
1190
1233
  2026: {
1191
1234
  "2026-01-01": "New Year's Day",
1192
1235
  "2026-02-05": "Kashmir Day",
@@ -1211,15 +1254,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1211
1254
  "2027-08-15": "Eid Milad-un-Nabi",
1212
1255
  "2027-12-25": "Quaid-e-Azam Day and Christmas Day"
1213
1256
  }
1214
- }, $t = {
1215
- countryCode: kt,
1216
- timezone: St,
1217
- payRate: Lt,
1218
- overtime: Ot,
1219
- workingHours: Rt,
1220
- recurringPublicHolidays: It,
1221
- publicHolidays: Tt
1222
- }, Pt = "SG", Yt = "Asia/Singapore", Bt = {
1257
+ }, Yt = {
1258
+ countryCode: Ot,
1259
+ timezone: Lt,
1260
+ payRate: Rt,
1261
+ overtime: It,
1262
+ workingHours: Tt,
1263
+ recurringPublicHolidays: $t,
1264
+ publicHolidays: Pt
1265
+ }, Bt = "SG", _t = "Asia/Singapore", xt = {
1223
1266
  NORMAL: {
1224
1267
  overtime: 1.5
1225
1268
  },
@@ -1231,13 +1274,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1231
1274
  regular: 2,
1232
1275
  overtime: 1.5
1233
1276
  }
1234
- }, _t = {
1277
+ }, Ft = {
1235
1278
  maxMonthlyHours: 72,
1236
1279
  afterDailyHours: null
1237
- }, xt = {
1280
+ }, Ut = {
1238
1281
  standardWeeklyHours: 44,
1239
1282
  maxDailyHours: 12
1240
- }, Ft = [
1283
+ }, Wt = [
1241
1284
  {
1242
1285
  month: 1,
1243
1286
  day: 1,
@@ -1258,7 +1301,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1258
1301
  day: 25,
1259
1302
  name: "Christmas Day"
1260
1303
  }
1261
- ], Ut = {
1304
+ ], zt = {
1262
1305
  2026: {
1263
1306
  "2026-01-01": "New Year's Day",
1264
1307
  "2026-02-17": "Chinese New Year's Day",
@@ -1289,15 +1332,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1289
1332
  "2027-10-28": "Deepavali",
1290
1333
  "2027-12-25": "Christmas Day"
1291
1334
  }
1292
- }, Wt = {
1293
- countryCode: Pt,
1294
- timezone: Yt,
1295
- payRate: Bt,
1296
- overtime: _t,
1297
- workingHours: xt,
1298
- recurringPublicHolidays: Ft,
1299
- publicHolidays: Ut
1300
- }, zt = "TH", Vt = "Asia/Bangkok", Kt = {
1335
+ }, Vt = {
1336
+ countryCode: Bt,
1337
+ timezone: _t,
1338
+ payRate: xt,
1339
+ overtime: Ft,
1340
+ workingHours: Ut,
1341
+ recurringPublicHolidays: Wt,
1342
+ publicHolidays: zt
1343
+ }, Kt = "TH", Gt = "Asia/Bangkok", jt = {
1301
1344
  NORMAL: {
1302
1345
  overtime: 1.5
1303
1346
  },
@@ -1309,13 +1352,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1309
1352
  regular: 2,
1310
1353
  overtime: 3
1311
1354
  }
1312
- }, Gt = {
1355
+ }, Qt = {
1313
1356
  maxMonthlyHours: 36,
1314
1357
  afterDailyHours: null
1315
- }, jt = {
1358
+ }, qt = {
1316
1359
  standardWeeklyHours: 48,
1317
1360
  maxDailyHours: 8
1318
- }, Qt = [
1361
+ }, Xt = [
1319
1362
  {
1320
1363
  month: 1,
1321
1364
  day: 1,
@@ -1361,7 +1404,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1361
1404
  day: 31,
1362
1405
  name: "New Year's Eve"
1363
1406
  }
1364
- ], qt = {
1407
+ ], Jt = {
1365
1408
  2026: {
1366
1409
  "2026-01-01": "New Year's Day",
1367
1410
  "2026-03-03": "Makha Bucha Day",
@@ -1401,15 +1444,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1401
1444
  "2027-12-10": "Constitution Day",
1402
1445
  "2027-12-31": "New Year's Eve"
1403
1446
  }
1404
- }, Xt = {
1405
- countryCode: zt,
1406
- timezone: Vt,
1407
- payRate: Kt,
1408
- overtime: Gt,
1409
- workingHours: jt,
1410
- recurringPublicHolidays: Qt,
1411
- publicHolidays: qt
1412
- }, Jt = "VN", Zt = "Asia/Ho_Chi_Minh", en = {
1447
+ }, Zt = {
1448
+ countryCode: Kt,
1449
+ timezone: Gt,
1450
+ payRate: jt,
1451
+ overtime: Qt,
1452
+ workingHours: qt,
1453
+ recurringPublicHolidays: Xt,
1454
+ publicHolidays: Jt
1455
+ }, en = "VN", an = "Asia/Ho_Chi_Minh", tn = {
1413
1456
  NORMAL: {
1414
1457
  overtime: 1.5
1415
1458
  },
@@ -1421,13 +1464,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1421
1464
  regular: 2,
1422
1465
  overtime: 3
1423
1466
  }
1424
- }, an = {
1467
+ }, nn = {
1425
1468
  maxMonthlyHours: 40,
1426
1469
  afterDailyHours: null
1427
- }, tn = {
1470
+ }, on = {
1428
1471
  standardWeeklyHours: 48,
1429
1472
  maxDailyHours: 8
1430
- }, nn = [
1473
+ }, sn = [
1431
1474
  {
1432
1475
  month: 1,
1433
1476
  day: 1,
@@ -1448,7 +1491,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1448
1491
  day: 2,
1449
1492
  name: "National Day"
1450
1493
  }
1451
- ], on = {
1494
+ ], rn = {
1452
1495
  2026: {
1453
1496
  "2026-01-01": "New Year's Day",
1454
1497
  "2026-02-16": "Tet Holiday",
@@ -1476,16 +1519,16 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1476
1519
  "2027-09-02": "National Day",
1477
1520
  "2027-09-03": "National Day Holiday"
1478
1521
  }
1479
- }, sn = {
1480
- countryCode: Jt,
1481
- timezone: Zt,
1482
- payRate: en,
1483
- overtime: an,
1484
- workingHours: tn,
1485
- recurringPublicHolidays: nn,
1486
- publicHolidays: on
1487
- }, Te = { AE: Fa, BN: Qa, ID: nt, MO: ct, MV: gt, MY: Mt, PK: $t, SG: Wt, TH: Xt, VN: sn };
1488
- function rn(e) {
1522
+ }, ln = {
1523
+ countryCode: en,
1524
+ timezone: an,
1525
+ payRate: tn,
1526
+ overtime: nn,
1527
+ workingHours: on,
1528
+ recurringPublicHolidays: sn,
1529
+ publicHolidays: rn
1530
+ }, Te = { AE: Wa, BN: Xa, ID: st, MO: mt, MV: Ht, MY: St, PK: Yt, SG: Vt, TH: Zt, VN: ln };
1531
+ function un(e) {
1489
1532
  if (typeof e == "string") return e.toUpperCase();
1490
1533
  if (e && typeof e == "object" && "code" in e) {
1491
1534
  const a = e.code;
@@ -1493,17 +1536,17 @@ function rn(e) {
1493
1536
  }
1494
1537
  return "MY";
1495
1538
  }
1496
- function ln(e) {
1497
- return Te[rn(e)] ?? Te.MY;
1539
+ function dn(e) {
1540
+ return Te[un(e)] ?? Te.MY;
1498
1541
  }
1499
- function ho(e, a) {
1500
- var o, r;
1542
+ function Ho(e, a) {
1543
+ var o, s;
1501
1544
  const t = (o = e.publicHolidays[a.slice(0, 4)]) == null ? void 0 : o[a];
1502
1545
  if (t) return t;
1503
- const n = Number(a.slice(5, 7)), s = Number(a.slice(8, 10));
1504
- return ((r = e.recurringPublicHolidays.find((i) => i.month === n && i.day === s)) == null ? void 0 : r.name) ?? null;
1546
+ const n = Number(a.slice(5, 7)), r = Number(a.slice(8, 10));
1547
+ return ((s = e.recurringPublicHolidays.find((i) => i.month === n && i.day === r)) == null ? void 0 : s.name) ?? null;
1505
1548
  }
1506
- const un = Be(), qe = "unassigned", vo = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], Do = "All Stations", go = [
1549
+ const cn = Be(), qe = "unassigned", Ao = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], Eo = "All Stations", bo = [
1507
1550
  { id: qe, label: "Assigned", roles: [], system: !0 }
1508
1551
  ], $e = [
1509
1552
  "#903E1F",
@@ -1515,74 +1558,74 @@ const un = Be(), qe = "unassigned", vo = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sa
1515
1558
  "#0F5C5C",
1516
1559
  "#6E2142"
1517
1560
  ];
1518
- function dn(e) {
1561
+ function yn(e) {
1519
1562
  var a;
1520
1563
  return (a = Ve.find((t) => t.name === e)) == null ? void 0 : a.id;
1521
1564
  }
1522
- function Ho(e) {
1565
+ function No(e) {
1523
1566
  if (e)
1524
- return { positionId: dn(e), positionName: e };
1567
+ return { positionId: yn(e), positionName: e };
1525
1568
  }
1526
- const wo = [1, 1, 1, 1, 1, 1, 1];
1527
- function ee(e) {
1569
+ const ko = [1, 1, 1, 1, 1, 1, 1];
1570
+ function ae(e) {
1528
1571
  return (e + 6) % 7;
1529
1572
  }
1530
- function Eo(e) {
1573
+ function Co(e) {
1531
1574
  return (e + 1) % 7;
1532
1575
  }
1533
- function ne(e, a) {
1576
+ function oe(e, a) {
1534
1577
  e.splice(0, e.length, ...a);
1535
1578
  }
1536
- function cn(e, a) {
1579
+ function mn(e, a) {
1537
1580
  return _e(e, a) / 60;
1538
1581
  }
1539
- function yn(e) {
1582
+ function fn(e) {
1540
1583
  var t;
1541
1584
  const a = e.trim().split(/\s+/).filter(Boolean);
1542
1585
  return a.length ? (a[0][0] + (((t = a[1]) == null ? void 0 : t[0]) ?? "")).toUpperCase() : "??";
1543
1586
  }
1544
- const Xe = /* @__PURE__ */ new Map(), me = /* @__PURE__ */ new Map();
1545
- function Ao(e) {
1587
+ const Xe = /* @__PURE__ */ new Map(), fe = /* @__PURE__ */ new Map();
1588
+ function Mo(e) {
1546
1589
  return Xe.get(e);
1547
1590
  }
1548
- function mn(e) {
1549
- const a = me.get(e);
1591
+ function pn(e) {
1592
+ const a = fe.get(e);
1550
1593
  if (a !== void 0) return a;
1551
- const t = Fe + me.size + 1;
1552
- return me.set(e, t), Xe.set(t, e), t;
1594
+ const t = Fe + fe.size + 1;
1595
+ return fe.set(e, t), Xe.set(t, e), t;
1553
1596
  }
1554
- function bo(e) {
1597
+ function So(e) {
1555
1598
  return e.sourceId || String(e.id);
1556
1599
  }
1557
- function fn(e) {
1558
- Na.name = (e == null ? void 0 : e.outlet.name) ?? "", ne(ba, (e == null ? void 0 : e.positions.map((r) => r.name)) ?? []), ne(Ve, (e == null ? void 0 : e.positions) ?? []);
1600
+ function hn(e) {
1601
+ Na.name = (e == null ? void 0 : e.outlet.name) ?? "", oe(ba, (e == null ? void 0 : e.positions.map((s) => s.name)) ?? []), oe(Ve, (e == null ? void 0 : e.positions) ?? []);
1559
1602
  const a = (e == null ? void 0 : e.restaurantProfile.operatingHours) ?? [], t = Array.from({ length: 7 }, () => []);
1560
- for (const r of a) t[ee(r.dayOfWeek)] = r.closed ? [] : r.hours;
1561
- ne(T.dayHours, t);
1562
- const n = a.filter((r) => !r.closed).flatMap((r) => r.hours);
1563
- T.openFrom = n.length ? n.map((r) => r.start).reduce((r, i) => i < r ? i : r) : "00:00", T.openTo = n.length ? n.map((r) => r.end).reduce((r, i) => i > r ? i : r) : "24:00", ne(
1564
- T.closedWeekdays,
1565
- a.filter((r) => r.closed).map((r) => ee(r.dayOfWeek)).sort((r, i) => r - i)
1603
+ for (const s of a) t[ae(s.dayOfWeek)] = s.closed ? [] : s.hours;
1604
+ oe(I.dayHours, t);
1605
+ const n = a.filter((s) => !s.closed).flatMap((s) => s.hours);
1606
+ I.openFrom = n.length ? n.map((s) => s.start).reduce((s, i) => i < s ? i : s) : "00:00", I.openTo = n.length ? n.map((s) => s.end).reduce((s, i) => i > s ? i : s) : "24:00", oe(
1607
+ I.closedWeekdays,
1608
+ a.filter((s) => s.closed).map((s) => ae(s.dayOfWeek)).sort((s, i) => s - i)
1566
1609
  );
1567
- const s = ln(un.currentCountry.value), o = (e == null ? void 0 : e.settings.payRate) ?? s.payRate;
1568
- T.otCapHours = (e == null ? void 0 : e.settings.overtime.maxMonthlyHours) ?? s.overtime.maxMonthlyHours ?? 0, T.payRate.NORMAL.overtime = o.NORMAL.overtime, T.payRate.REST_DAY.regular = o.REST_DAY.regular, T.payRate.REST_DAY.overtime = o.REST_DAY.overtime, T.payRate.PUBLIC_HOLIDAY.regular = o.PUBLIC_HOLIDAY.regular, T.payRate.PUBLIC_HOLIDAY.overtime = o.PUBLIC_HOLIDAY.overtime;
1610
+ const r = dn(cn.currentCountry.value), o = (e == null ? void 0 : e.settings.payRate) ?? r.payRate;
1611
+ I.otCapHours = (e == null ? void 0 : e.settings.overtime.maxMonthlyHours) ?? r.overtime.maxMonthlyHours ?? 0, I.payRate.NORMAL.overtime = o.NORMAL.overtime, I.payRate.REST_DAY.regular = o.REST_DAY.regular, I.payRate.REST_DAY.overtime = o.REST_DAY.overtime, I.payRate.PUBLIC_HOLIDAY.regular = o.PUBLIC_HOLIDAY.regular, I.payRate.PUBLIC_HOLIDAY.overtime = o.PUBLIC_HOLIDAY.overtime;
1569
1612
  }
1570
- Ee(d, fn, { immediate: !0 });
1571
- function pn(e) {
1613
+ Ee(d, hn, { immediate: !0 });
1614
+ function vn(e) {
1572
1615
  return e.reduce(
1573
1616
  (a, t) => t.employmentType === "FULLTIME" ? Math.max(a, t.workingHour) : a,
1574
1617
  0
1575
1618
  );
1576
1619
  }
1577
- function hn(e, a) {
1620
+ function Dn(e, a) {
1578
1621
  if (e.wage.type === "HOURLY") return e.wage.amount;
1579
1622
  const t = e.workingHour || a;
1580
1623
  return t ? e.wage.amount / (t * (52 / 12)) : 0;
1581
1624
  }
1582
- function vn(e, a) {
1625
+ function gn(e, a) {
1583
1626
  return e.employmentType === "FULLTIME" ? 100 : !a || !e.workingHour ? 0 : Math.min(99, Math.round(e.workingHour / a * 100));
1584
1627
  }
1585
- function Dn(e) {
1628
+ function wn(e) {
1586
1629
  var a;
1587
1630
  return {
1588
1631
  start: e.startTime,
@@ -1603,10 +1646,10 @@ function Dn(e) {
1603
1646
  updatedAt: e.updatedAt
1604
1647
  };
1605
1648
  }
1606
- function gn(e) {
1649
+ function Hn(e) {
1607
1650
  return e.type === "OFF_DAY" ? "Off day" : e.leaveType === "MEDICAL" ? "Medical Leave" : e.leaveType === "EMERGENCY" ? "Emergency Leave" : e.leaveType === "UNPAID" ? "Unpaid Leave" : "Annual Leave";
1608
1651
  }
1609
- function Hn(e, a) {
1652
+ function An(e, a) {
1610
1653
  if (a < e.startDate || a > e.endDate) return null;
1611
1654
  const n = e.startDate === e.endDate || a === e.startDate ? e.startPart : a === e.endDate ? e.endPart : "FULL_DAY";
1612
1655
  return {
@@ -1614,12 +1657,12 @@ function Hn(e, a) {
1614
1657
  type: e.type,
1615
1658
  leaveType: e.leaveType ?? void 0,
1616
1659
  timeOff: e.status === "PENDING" ? "pending" : "approved",
1617
- reason: gn(e),
1660
+ reason: Hn(e),
1618
1661
  half: n !== "FULL_DAY",
1619
1662
  halfPart: n === "FULL_DAY" ? void 0 : n
1620
1663
  };
1621
1664
  }
1622
- function wn(e) {
1665
+ function En(e) {
1623
1666
  return {
1624
1667
  employeeId: e._id,
1625
1668
  name: e.name,
@@ -1631,122 +1674,122 @@ function wn(e) {
1631
1674
  availability: []
1632
1675
  };
1633
1676
  }
1634
- function En(e) {
1635
- const a = X[m.value];
1677
+ function bn(e) {
1678
+ const a = J[y.value];
1636
1679
  return !a || !e.includes(a) ? e : [a, ...e.filter((t) => t !== a)];
1637
1680
  }
1638
- function An(e) {
1681
+ function Nn(e) {
1639
1682
  var n;
1640
- const t = (ze.value[e] ?? ((n = se.value.find((s) => s._id === e)) == null ? void 0 : n.restaurantRole.map((s) => s.restaurantId)) ?? []).map((s) => X[s]).filter((s) => !!s);
1641
- return t.length ? En([...new Set(t)]) : void 0;
1683
+ const t = (ze.value[e] ?? ((n = re.value.find((r) => r._id === e)) == null ? void 0 : n.restaurantRole.map((r) => r.restaurantId)) ?? []).map((r) => J[r]).filter((r) => !!r);
1684
+ return t.length ? bn([...new Set(t)]) : void 0;
1642
1685
  }
1643
- function No(e = []) {
1686
+ function Oo(e = []) {
1644
1687
  const a = d.value;
1645
1688
  if (!a) return [];
1646
- const t = new Map(a.employees.map((i) => [i.employeeId, i])), n = new Map(x.value.map((i) => [i.employeeId, i])), s = se.value.filter((i) => {
1647
- var y;
1648
- return ((y = n.get(i._id)) == null ? void 0 : y.enabled) !== !1;
1649
- }).map((i) => t.get(i._id) ?? wn(i)), o = pn(s), r = /* @__PURE__ */ new Map();
1689
+ const t = new Map(a.employees.map((i) => [i.employeeId, i])), n = new Map(x.value.map((i) => [i.employeeId, i])), r = re.value.filter((i) => {
1690
+ var m;
1691
+ return ((m = n.get(i._id)) == null ? void 0 : m.enabled) !== !1;
1692
+ }).map((i) => t.get(i._id) ?? En(i)), o = vn(r), s = /* @__PURE__ */ new Map();
1650
1693
  for (const i of a.assignments) {
1651
- const y = `${i.employeeId}|${i.date}`, f = r.get(y);
1652
- f ? f.push(i) : r.set(y, [i]);
1694
+ const m = `${i.employeeId}|${i.date}`, v = s.get(m);
1695
+ v ? v.push(i) : s.set(m, [i]);
1653
1696
  }
1654
- return s.map((i) => {
1655
- var S, P;
1656
- const y = mn(i.employeeId), f = ((S = i.primaryPosition) == null ? void 0 : S.positionName) ?? "", H = [
1657
- (P = i.primaryPosition) == null ? void 0 : P.positionName,
1658
- ...i.secondaryPositions.map((L) => L.positionName)
1659
- ].filter((L) => !!L), $ = e.map((L) => {
1660
- const A = Z(L), w = (a.timeOff ?? []).filter((E) => E.employeeId === i.employeeId).map((E) => Hn(E, A)).find((E) => E !== null);
1661
- if (w) return w;
1662
- const b = (r.get(`${i.employeeId}|${A}`) ?? []).filter((E) => E.startTime && E.endTime).map((E) => Dn(E)).sort((E, ae) => E.start.localeCompare(ae.start));
1663
- return b.length ? b.length === 1 ? b[0] : b : null;
1664
- }), p = Array.from(
1697
+ return r.map((i) => {
1698
+ var $, G;
1699
+ const m = pn(i.employeeId), v = (($ = i.primaryPosition) == null ? void 0 : $.positionName) ?? "", N = [
1700
+ (G = i.primaryPosition) == null ? void 0 : G.positionName,
1701
+ ...i.secondaryPositions.map((S) => S.positionName)
1702
+ ].filter((S) => !!S), T = e.map((S) => {
1703
+ const A = ee(S), g = (a.timeOff ?? []).filter((E) => E.employeeId === i.employeeId).map((E) => An(E, A)).find((E) => E !== null);
1704
+ if (g) return g;
1705
+ const Y = (s.get(`${i.employeeId}|${A}`) ?? []).filter((E) => E.startTime && E.endTime).map((E) => wn(E)).sort((E, te) => E.start.localeCompare(te.start));
1706
+ return Y.length ? Y.length === 1 ? Y[0] : Y : null;
1707
+ }), f = i.availability.length > 0, C = Array.from(
1665
1708
  { length: 7 },
1666
- (L, A) => i.availability.some((w) => ee(w.dayOfWeek) === A)
1667
- ), M = Array.from({ length: 7 }, (L, A) => {
1668
- const w = i.availability.find((R) => ee(R.dayOfWeek) === A);
1669
- return { from: (w == null ? void 0 : w.start) ?? "", to: (w == null ? void 0 : w.end) ?? "" };
1709
+ (S, A) => f ? i.availability.some((g) => ae(g.dayOfWeek) === A) : !0
1710
+ ), L = Array.from({ length: 7 }, (S, A) => {
1711
+ const g = i.availability.find((H) => ae(H.dayOfWeek) === A);
1712
+ return { from: (g == null ? void 0 : g.start) ?? "", to: (g == null ? void 0 : g.end) ?? "" };
1670
1713
  });
1671
1714
  return {
1672
- id: y,
1715
+ id: m,
1673
1716
  sourceId: i.employeeId,
1674
1717
  name: i.name,
1675
1718
  employmentType: i.employmentType,
1676
- role: f,
1677
- initials: yn(i.name),
1678
- color: $e[(y - Fe - 1) % $e.length],
1719
+ role: v,
1720
+ initials: fn(i.name),
1721
+ color: $e[(m - Fe - 1) % $e.length],
1679
1722
  // Gross hours actually rostered this week — the figure the cost rail multiplies by
1680
1723
  // the rate. Contracted hours are a separate question, answered by RULES.contract.
1681
1724
  // Rounded to one decimal — `hoursBetween` divides by 60, so an unrounded sum reads
1682
1725
  // as a long, meaningless float (e.g. 31.983333333333334) everywhere this is shown
1683
1726
  // verbatim, matching the rounding `employeeLoadOf`'s own hours figure already uses.
1684
1727
  weekHours: Math.round(
1685
- $.reduce(
1686
- (L, A) => L + (Array.isArray(A) ? A : A && "start" in A ? [A] : []).reduce(
1687
- (w, R) => w + cn(R.start, R.end),
1728
+ T.reduce(
1729
+ (S, A) => S + (Array.isArray(A) ? A : A && "start" in A ? [A] : []).reduce(
1730
+ (g, H) => g + mn(H.start, H.end),
1688
1731
  0
1689
1732
  ),
1690
1733
  0
1691
1734
  ) * 10
1692
1735
  ) / 10,
1693
- pct: vn(i, o),
1736
+ pct: gn(i, o),
1694
1737
  contractHours: i.workingHour || void 0,
1695
1738
  // Every outlet the POS says this person works at, not just this one — the Add / Edit form
1696
1739
  // shows them, and saving keeps them.
1697
- locations: An(i.employeeId),
1698
- rate: hn(i, o),
1699
- positions: H,
1700
- shifts: $,
1740
+ locations: Nn(i.employeeId),
1741
+ rate: Dn(i, o),
1742
+ positions: N,
1743
+ shifts: T,
1701
1744
  // Remarks live in their own collection in the older scheduling design and are not
1702
1745
  // part of this board's payload yet.
1703
1746
  remarks: [],
1704
1747
  section: qe,
1705
1748
  payBasis: i.wage.type === "HOURLY" ? "hourly" : "monthly",
1706
1749
  payAmount: i.wage.amount,
1707
- availDays: p,
1708
- availHours: M
1750
+ availDays: C,
1751
+ availHours: L
1709
1752
  };
1710
1753
  });
1711
1754
  }
1712
- function Co() {
1755
+ function Lo() {
1713
1756
  return [];
1714
1757
  }
1715
- function Mo() {
1716
- var n, s;
1758
+ function Ro() {
1759
+ var n, r;
1717
1760
  const e = d.value, a = {}, t = {};
1718
1761
  for (const o of (e == null ? void 0 : e.demands) ?? []) {
1719
- const r = o.date ? a[n = o.date] ?? (a[n] = []) : o.dayOfWeek !== null ? t[s = ee(o.dayOfWeek)] ?? (t[s] = []) : null;
1720
- if (!r) continue;
1721
- let i = r.find((y) => y.from === o.startTime && y.to === o.endTime);
1722
- i || (i = { from: o.startTime, to: o.endTime, n: 0, roles: [] }, r.push(i)), i.n += o.headcount, o.position && i.roles.push({ position: o.position.positionName, n: o.headcount });
1762
+ const s = o.date ? a[n = o.date] ?? (a[n] = []) : o.dayOfWeek !== null ? t[r = ae(o.dayOfWeek)] ?? (t[r] = []) : null;
1763
+ if (!s) continue;
1764
+ let i = s.find((m) => m.from === o.startTime && m.to === o.endTime);
1765
+ i || (i = { from: o.startTime, to: o.endTime, n: 0, roles: [] }, s.push(i)), i.n += o.headcount, o.position && i.roles.push({ position: o.position.positionName, n: o.headcount });
1723
1766
  }
1724
1767
  return { byDate: a, byWeekday: t };
1725
1768
  }
1726
- function ko() {
1727
- const e = Be(), { restaurants: a, readRestaurants: t } = Da(), n = ha(), s = va(), o = D(!1), r = Y(
1728
- () => [...a.value].map((p) => ({ value: p._id, label: p.profile.name })).sort((p, M) => p.label.localeCompare(M.label))
1729
- ), i = Y(() => {
1730
- var p;
1731
- return ((p = e.currentRestaurant.value) == null ? void 0 : p._id) ?? "";
1769
+ function Io() {
1770
+ const e = Be(), { restaurants: a, readRestaurants: t } = Da(), n = ha(), r = va(), o = w(!1), s = P(
1771
+ () => [...a.value].map((f) => ({ value: f._id, label: f.profile.name })).sort((f, C) => f.label.localeCompare(C.label))
1772
+ ), i = P(() => {
1773
+ var f;
1774
+ return ((f = e.currentRestaurant.value) == null ? void 0 : f._id) ?? "";
1732
1775
  });
1733
- async function y(p, M) {
1734
- return Re(p) ? (n.query.restaurantId !== p && s.replace({ query: { ...n.query, restaurantId: p } }), await Promise.all([ge(p), Ia(M)]), !0) : !1;
1776
+ async function m(f, C) {
1777
+ return Re(f) ? (n.query.restaurantId !== f && r.replace({ query: { ...n.query, restaurantId: f } }), await Promise.all([we(f), Ia(C)]), !0) : !1;
1735
1778
  }
1736
- const f = (p) => !!p && r.value.some((M) => M.value === p);
1737
- async function H() {
1738
- var M;
1739
- await t(), Oe.splice(0, Oe.length, ...r.value.map((S) => S.label)), Object.keys(X).forEach((S) => delete X[S]), r.value.forEach((S) => X[S.value] = S.label);
1740
- const p = f(m.value) ? m.value : f(i.value) ? i.value : ((M = r.value[0]) == null ? void 0 : M.value) ?? "";
1741
- return p && Re(p), o.value = !0, p;
1779
+ const v = (f) => !!f && s.value.some((C) => C.value === f);
1780
+ async function N() {
1781
+ var C;
1782
+ await t(), Le.splice(0, Le.length, ...s.value.map((L) => L.label)), Object.keys(J).forEach((L) => delete J[L]), s.value.forEach((L) => J[L.value] = L.label);
1783
+ const f = v(y.value) ? y.value : v(i.value) ? i.value : ((C = s.value[0]) == null ? void 0 : C.value) ?? "";
1784
+ return f && Re(f), o.value = !0, f;
1742
1785
  }
1743
- async function $() {
1744
- const p = await H();
1745
- return p && await ge(p), p;
1786
+ async function T() {
1787
+ const f = await N();
1788
+ return f && await we(f), f;
1746
1789
  }
1747
- return { options: r, ready: o, outletId: m, resolve: $, resolveOutlet: H, switchTo: y };
1790
+ return { options: s, ready: o, outletId: y, resolve: T, resolveOutlet: N, switchTo: m };
1748
1791
  }
1749
- const bn = ["data-hierarchy", "data-size", "data-icon"], So = /* @__PURE__ */ Ae({
1792
+ const kn = ["data-hierarchy", "data-size", "data-icon"], To = /* @__PURE__ */ be({
1750
1793
  __name: "ScheduleButton",
1751
1794
  props: {
1752
1795
  hierarchy: { default: "primary" },
@@ -1754,7 +1797,7 @@ const bn = ["data-hierarchy", "data-size", "data-icon"], So = /* @__PURE__ */ Ae
1754
1797
  iconOnly: { type: Boolean, default: !1 }
1755
1798
  },
1756
1799
  setup(e) {
1757
- return (a, t) => (N(), C("button", {
1800
+ return (a, t) => (b(), k("button", {
1758
1801
  type: "button",
1759
1802
  class: "sch-button",
1760
1803
  "data-hierarchy": e.hierarchy,
@@ -1762,24 +1805,24 @@ const bn = ["data-hierarchy", "data-size", "data-icon"], So = /* @__PURE__ */ Ae
1762
1805
  "data-icon": e.iconOnly ? "only" : void 0
1763
1806
  }, [
1764
1807
  Ye(a.$slots, "default")
1765
- ], 8, bn));
1808
+ ], 8, kn));
1766
1809
  }
1767
- }), Nn = ["disabled", "aria-expanded"], Cn = { class: "sch" }, Mn = ["aria-multiselectable"], kn = {
1810
+ }), Cn = ["disabled", "aria-expanded"], Mn = { class: "sch" }, Sn = ["aria-multiselectable"], On = {
1768
1811
  key: 0,
1769
1812
  class: "fx-pop-head"
1770
- }, Sn = {
1813
+ }, Ln = {
1771
1814
  key: 1,
1772
1815
  class: "fx-pop-search"
1773
- }, Ln = {
1816
+ }, Rn = {
1774
1817
  key: 2,
1775
1818
  class: "fx-opt is-off"
1776
- }, On = {
1819
+ }, In = {
1777
1820
  key: 0,
1778
1821
  class: "fx-grp"
1779
- }, Rn = ["aria-selected", "onClick"], In = {
1822
+ }, Tn = ["aria-selected", "onClick"], $n = {
1780
1823
  key: 0,
1781
1824
  class: "fx-opt-text"
1782
- }, Tn = { key: 0 }, Lo = /* @__PURE__ */ Ae({
1825
+ }, Pn = { key: 0 }, $o = /* @__PURE__ */ be({
1783
1826
  inheritAttrs: !1,
1784
1827
  __name: "ScheduleSelect",
1785
1828
  props: {
@@ -1795,11 +1838,11 @@ const bn = ["data-hierarchy", "data-size", "data-icon"], So = /* @__PURE__ */ Ae
1795
1838
  },
1796
1839
  emits: ["update:modelValue", "toggle"],
1797
1840
  setup(e, { emit: a }) {
1798
- const t = e, n = a, s = sa(), o = Y(() => s.class ?? ""), r = D(!1), i = D(!1), y = D(null), f = D(null), H = D(null), $ = Y(() => t.teleport !== !1 && i.value);
1841
+ const t = e, n = a, r = ia(), o = P(() => r.class ?? ""), s = w(!1), i = w(!1), m = w(null), v = w(null), N = w(null), T = P(() => t.teleport !== !1 && i.value);
1799
1842
  He(() => {
1800
1843
  i.value = typeof document < "u" && !!document.body;
1801
1844
  });
1802
- const p = Y(() => {
1845
+ const f = P(() => {
1803
1846
  var l, c;
1804
1847
  if (t.multiple) {
1805
1848
  const u = ((l = t.selected) == null ? void 0 : l.length) ?? 0;
@@ -1807,80 +1850,80 @@ const bn = ["data-hierarchy", "data-size", "data-icon"], So = /* @__PURE__ */ Ae
1807
1850
  }
1808
1851
  return ((c = t.options.find((u) => u.value === t.modelValue)) == null ? void 0 : c.label) ?? "";
1809
1852
  });
1810
- function M(l) {
1853
+ function C(l) {
1811
1854
  var c;
1812
1855
  return t.multiple ? !!((c = t.selected) != null && c.includes(l.value)) : l.value === t.modelValue;
1813
1856
  }
1814
- const S = Y(() => !!t.menuTitle || t.options.some((l) => l.hint)), P = D(""), L = D(null), A = Y(() => {
1815
- const l = P.value.trim().toLowerCase();
1857
+ const L = P(() => !!t.menuTitle || t.options.some((l) => l.hint)), $ = w(""), G = w(null), S = P(() => {
1858
+ const l = $.value.trim().toLowerCase();
1816
1859
  return !t.searchable || !l ? t.options : t.options.filter((c) => `${c.label} ${c.hint ?? ""}`.toLowerCase().includes(l));
1817
- }), w = Y(() => {
1860
+ }), A = P(() => {
1818
1861
  const l = [];
1819
1862
  let c;
1820
- for (const u of A.value)
1863
+ for (const u of S.value)
1821
1864
  u.group !== c && (c = u.group, c && l.push({ heading: c })), l.push({ option: u });
1822
1865
  return l;
1823
- }), R = 5, b = 8;
1824
- function E() {
1825
- const l = H.value, c = f.value;
1866
+ }), g = 5, H = 8;
1867
+ function Y() {
1868
+ const l = N.value, c = v.value;
1826
1869
  if (!l || !c) return;
1827
- const u = c.getBoundingClientRect(), k = window.innerWidth || document.documentElement.clientWidth, I = window.innerHeight || document.documentElement.clientHeight;
1828
- l.style.minWidth = `${Math.round(u.width)}px`, l.style.maxWidth = `${Math.max(180, Math.round(k - b * 2))}px`;
1829
- const G = I - u.bottom - R - b, na = u.top - R - b;
1830
- l.style.maxHeight = `${Math.max(120, Math.min(320, Math.max(G, na)))}px`;
1831
- const te = l.offsetHeight, oa = l.offsetWidth;
1832
- let ue = u.bottom + R;
1833
- ue + te > I - b && (ue = u.top - R - te >= b ? u.top - R - te : Math.max(b, I - te - b));
1834
- const ia = Math.min(Math.max(b, u.left), Math.max(b, k - oa - b));
1835
- l.style.top = `${Math.round(ue)}px`, l.style.left = `${Math.round(ia)}px`, l.style.visibility = "visible";
1870
+ const u = c.getBoundingClientRect(), M = window.innerWidth || document.documentElement.clientWidth, R = window.innerHeight || document.documentElement.clientHeight;
1871
+ l.style.minWidth = `${Math.round(u.width)}px`, l.style.maxWidth = `${Math.max(180, Math.round(M - H * 2))}px`;
1872
+ const j = R - u.bottom - g - H, na = u.top - g - H;
1873
+ l.style.maxHeight = `${Math.max(120, Math.min(320, Math.max(j, na)))}px`;
1874
+ const ne = l.offsetHeight, oa = l.offsetWidth;
1875
+ let de = u.bottom + g;
1876
+ de + ne > R - H && (de = u.top - g - ne >= H ? u.top - g - ne : Math.max(H, R - ne - H));
1877
+ const sa = Math.min(Math.max(H, u.left), Math.max(H, M - oa - H));
1878
+ l.style.top = `${Math.round(de)}px`, l.style.left = `${Math.round(sa)}px`, l.style.visibility = "visible";
1836
1879
  }
1837
- function ae(l) {
1838
- var u, k;
1880
+ function E(l) {
1881
+ var u, M;
1839
1882
  const c = l.target;
1840
- c && ((u = y.value) != null && u.contains(c) || (k = H.value) != null && k.contains(c)) || B();
1883
+ c && ((u = m.value) != null && u.contains(c) || (M = N.value) != null && M.contains(c)) || B();
1841
1884
  }
1842
- function be(l) {
1843
- const c = H.value, u = l.target;
1885
+ function te(l) {
1886
+ const c = N.value, u = l.target;
1844
1887
  if (c && u && u !== document && c.contains(u)) return;
1845
- const k = f.value;
1846
- if (!k) return;
1847
- const I = k.getBoundingClientRect(), G = window.innerHeight || document.documentElement.clientHeight;
1848
- if (I.bottom < 0 || I.top > G) {
1888
+ const M = v.value;
1889
+ if (!M) return;
1890
+ const R = M.getBoundingClientRect(), j = window.innerHeight || document.documentElement.clientHeight;
1891
+ if (R.bottom < 0 || R.top > j) {
1849
1892
  B();
1850
1893
  return;
1851
1894
  }
1852
- E();
1895
+ Y();
1853
1896
  }
1854
1897
  function Je() {
1855
- document.addEventListener("click", ae), document.addEventListener("scroll", be, !0), window.addEventListener("resize", B);
1898
+ document.addEventListener("click", E), document.addEventListener("scroll", te, !0), window.addEventListener("resize", B);
1856
1899
  }
1857
1900
  function Ne() {
1858
- document.removeEventListener("click", ae), document.removeEventListener("scroll", be, !0), window.removeEventListener("resize", B);
1901
+ document.removeEventListener("click", E), document.removeEventListener("scroll", te, !0), window.removeEventListener("resize", B);
1859
1902
  }
1860
- async function le() {
1903
+ async function ue() {
1861
1904
  var l, c, u;
1862
- t.disabled || r.value || (P.value = "", r.value = !0, await fe(), E(), (l = L.value) == null || l.focus(), (u = (c = H.value) == null ? void 0 : c.querySelector(".fx-opt.is-on")) == null || u.scrollIntoView({ block: "nearest" }), Je());
1905
+ t.disabled || s.value || ($.value = "", s.value = !0, await pe(), Y(), (l = G.value) == null || l.focus(), (u = (c = N.value) == null ? void 0 : c.querySelector(".fx-opt.is-on")) == null || u.scrollIntoView({ block: "nearest" }), Je());
1863
1906
  }
1864
1907
  function B() {
1865
- r.value && (r.value = !1, P.value = "", Ne());
1908
+ s.value && (s.value = !1, $.value = "", Ne());
1866
1909
  }
1867
- Ee(P, async () => {
1868
- r.value && (await fe(), E());
1910
+ Ee($, async () => {
1911
+ s.value && (await pe(), Y());
1869
1912
  });
1870
1913
  function Ze(l) {
1871
1914
  var c;
1872
1915
  if (l.key === "Escape")
1873
- l.preventDefault(), B(), (c = f.value) == null || c.focus();
1916
+ l.preventDefault(), B(), (c = v.value) == null || c.focus();
1874
1917
  else if (l.key === "Enter") {
1875
1918
  l.preventDefault();
1876
- const u = A.value.find((k) => !k.disabled);
1877
- u && Me(u);
1919
+ const u = S.value.find((M) => !M.disabled);
1920
+ u && Ce(u);
1878
1921
  }
1879
1922
  }
1880
- function Ce() {
1881
- r.value ? B() : le();
1923
+ function ke() {
1924
+ s.value ? B() : ue();
1882
1925
  }
1883
- function Me(l) {
1926
+ function Ce(l) {
1884
1927
  if (!l.disabled) {
1885
1928
  if (t.multiple && !l.command) {
1886
1929
  n("toggle", l.value);
@@ -1893,66 +1936,66 @@ const bn = ["data-hierarchy", "data-size", "data-icon"], So = /* @__PURE__ */ Ae
1893
1936
  l.value !== t.modelValue && n("update:modelValue", l.value);
1894
1937
  }
1895
1938
  }
1896
- const ea = Y(() => t.options.filter((l) => !l.disabled));
1939
+ const ea = P(() => t.options.filter((l) => !l.disabled));
1897
1940
  function aa(l) {
1898
1941
  const c = ea.value;
1899
1942
  if (t.multiple || !c.length) {
1900
- le();
1943
+ ue();
1901
1944
  return;
1902
1945
  }
1903
- const u = c.findIndex((G) => G.value === t.modelValue), k = l === "Home" ? 0 : l === "End" ? c.length - 1 : l === "ArrowDown" ? Math.min(c.length - 1, (u < 0 ? -1 : u) + 1) : Math.max(0, (u < 0 ? 1 : u) - 1), I = c[k];
1904
- I && I.value !== t.modelValue ? n("update:modelValue", I.value) : le();
1946
+ const u = c.findIndex((j) => j.value === t.modelValue), M = l === "Home" ? 0 : l === "End" ? c.length - 1 : l === "ArrowDown" ? Math.min(c.length - 1, (u < 0 ? -1 : u) + 1) : Math.max(0, (u < 0 ? 1 : u) - 1), R = c[M];
1947
+ R && R.value !== t.modelValue ? n("update:modelValue", R.value) : ue();
1905
1948
  }
1906
1949
  function ta(l) {
1907
1950
  var c;
1908
1951
  if (l.key === "Escape") {
1909
- if (!r.value) return;
1910
- l.preventDefault(), B(), (c = f.value) == null || c.focus();
1952
+ if (!s.value) return;
1953
+ l.preventDefault(), B(), (c = v.value) == null || c.focus();
1911
1954
  return;
1912
1955
  }
1913
1956
  if (l.key === "Enter" || l.key === " ") {
1914
- l.preventDefault(), Ce();
1957
+ l.preventDefault(), ke();
1915
1958
  return;
1916
1959
  }
1917
1960
  l.key !== "ArrowDown" && l.key !== "ArrowUp" && l.key !== "Home" && l.key !== "End" || (l.preventDefault(), aa(l.key));
1918
1961
  }
1919
- return we(Ne), (l, c) => (N(), C("div", {
1962
+ return Ae(Ne), (l, c) => (b(), k("div", {
1920
1963
  ref_key: "rootEl",
1921
- ref: y,
1922
- class: oe(["fx-sel", o.value])
1964
+ ref: m,
1965
+ class: se(["fx-sel", o.value])
1923
1966
  }, [
1924
1967
  _("button", la({
1925
1968
  ref_key: "btnEl",
1926
- ref: f
1969
+ ref: v
1927
1970
  }, l.$attrs, {
1928
1971
  type: "button",
1929
- class: ["sch-input fx-btn", { "is-open": r.value }],
1972
+ class: ["sch-input fx-btn", { "is-open": s.value }],
1930
1973
  disabled: e.disabled,
1931
1974
  "aria-haspopup": "listbox",
1932
- "aria-expanded": r.value,
1933
- onClick: c[0] || (c[0] = (u) => Ce()),
1975
+ "aria-expanded": s.value,
1976
+ onClick: c[0] || (c[0] = (u) => ke()),
1934
1977
  onKeydown: ta
1935
- }), F(p.value), 17, Nn),
1936
- (N(), ra(ua, {
1978
+ }), F(f.value), 17, Cn),
1979
+ (b(), ra(ua, {
1937
1980
  to: "body",
1938
- disabled: !$.value
1981
+ disabled: !T.value
1939
1982
  }, [
1940
- _("div", Cn, [
1941
- r.value ? (N(), C("div", {
1983
+ _("div", Mn, [
1984
+ s.value ? (b(), k("div", {
1942
1985
  key: 0,
1943
1986
  ref_key: "popEl",
1944
- ref: H,
1945
- class: oe(["fx-pop", { "fx-pop-rich": S.value }]),
1987
+ ref: N,
1988
+ class: se(["fx-pop", { "fx-pop-rich": L.value }]),
1946
1989
  role: "listbox",
1947
1990
  "aria-multiselectable": e.multiple || void 0,
1948
1991
  style: { visibility: "hidden" }
1949
1992
  }, [
1950
- e.menuTitle ? (N(), C("div", kn, F(e.menuTitle), 1)) : U("", !0),
1951
- e.searchable ? (N(), C("div", Sn, [
1993
+ e.menuTitle ? (b(), k("div", On, F(e.menuTitle), 1)) : U("", !0),
1994
+ e.searchable ? (b(), k("div", Ln, [
1952
1995
  da(_("input", {
1953
1996
  ref_key: "searchEl",
1954
- ref: L,
1955
- "onUpdate:modelValue": c[1] || (c[1] = (u) => P.value = u),
1997
+ ref: G,
1998
+ "onUpdate:modelValue": c[1] || (c[1] = (u) => $.value = u),
1956
1999
  class: "sch-input fx-pop-q",
1957
2000
  type: "search",
1958
2001
  placeholder: "Search",
@@ -1961,23 +2004,23 @@ const bn = ["data-hierarchy", "data-size", "data-icon"], So = /* @__PURE__ */ Ae
1961
2004
  "aria-label": "Search",
1962
2005
  onKeydown: Ze
1963
2006
  }, null, 544), [
1964
- [ca, P.value]
2007
+ [ca, $.value]
1965
2008
  ])
1966
2009
  ])) : U("", !0),
1967
- e.searchable && !w.value.length ? (N(), C("div", Ln, "No matches")) : U("", !0),
1968
- (N(!0), C(ce, null, ya(w.value, (u) => (N(), C(ce, {
2010
+ e.searchable && !A.value.length ? (b(), k("div", Rn, "No matches")) : U("", !0),
2011
+ (b(!0), k(ye, null, ya(A.value, (u) => (b(), k(ye, {
1969
2012
  key: "heading" in u ? `heading:${u.heading}` : `option:${u.option.value}`
1970
2013
  }, [
1971
- "heading" in u ? (N(), C("div", On, F(u.heading), 1)) : (N(), C("div", {
2014
+ "heading" in u ? (b(), k("div", In, F(u.heading), 1)) : (b(), k("div", {
1972
2015
  key: 1,
1973
- class: oe(["fx-opt", {
1974
- "is-on": M(u.option),
2016
+ class: se(["fx-opt", {
2017
+ "is-on": C(u.option),
1975
2018
  "is-off": u.option.disabled,
1976
2019
  "is-new": u.option.command
1977
2020
  }]),
1978
2021
  role: "option",
1979
- "aria-selected": M(u.option),
1980
- onClick: (k) => Me(u.option)
2022
+ "aria-selected": C(u.option),
2023
+ onClick: (M) => Ce(u.option)
1981
2024
  }, [
1982
2025
  c[2] || (c[2] = _("span", {
1983
2026
  class: "fx-tick",
@@ -1998,20 +2041,20 @@ const bn = ["data-hierarchy", "data-size", "data-icon"], So = /* @__PURE__ */ Ae
1998
2041
  })
1999
2042
  ])
2000
2043
  ], -1)),
2001
- S.value ? (N(), C("span", In, [
2044
+ L.value ? (b(), k("span", $n, [
2002
2045
  _("b", null, F(u.option.label), 1),
2003
- u.option.hint ? (N(), C("small", Tn, F(u.option.hint), 1)) : U("", !0)
2004
- ])) : (N(), C(ce, { key: 1 }, [
2046
+ u.option.hint ? (b(), k("small", Pn, F(u.option.hint), 1)) : U("", !0)
2047
+ ])) : (b(), k(ye, { key: 1 }, [
2005
2048
  ma(F(u.option.label), 1)
2006
2049
  ], 64))
2007
- ], 10, Rn))
2050
+ ], 10, Tn))
2008
2051
  ], 64))), 128))
2009
- ], 10, Mn)) : U("", !0)
2052
+ ], 10, Sn)) : U("", !0)
2010
2053
  ])
2011
2054
  ], 8, ["disabled"]))
2012
2055
  ], 2));
2013
2056
  }
2014
- }), $n = ["id", "aria-labelledby", "aria-label"], Pe = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])', Oo = /* @__PURE__ */ Ae({
2057
+ }), Yn = ["id", "aria-labelledby", "aria-label"], Pe = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])', Po = /* @__PURE__ */ be({
2015
2058
  __name: "ScheduleModal",
2016
2059
  props: {
2017
2060
  open: { type: Boolean },
@@ -2023,44 +2066,44 @@ const bn = ["data-hierarchy", "data-size", "data-icon"], So = /* @__PURE__ */ Ae
2023
2066
  },
2024
2067
  emits: ["close"],
2025
2068
  setup(e, { emit: a }) {
2026
- const t = e, n = a, s = D(null);
2069
+ const t = e, n = a, r = w(null);
2027
2070
  let o = null;
2028
- function r() {
2029
- fe(() => {
2030
- const y = s.value;
2031
- y && (y.querySelector(Pe) ?? y).focus();
2071
+ function s() {
2072
+ pe(() => {
2073
+ const m = r.value;
2074
+ m && (m.querySelector(Pe) ?? m).focus();
2032
2075
  });
2033
2076
  }
2034
- function i(y) {
2077
+ function i(m) {
2035
2078
  if (!t.open) return;
2036
- if (y.key === "Escape") {
2037
- y.preventDefault(), n("close");
2079
+ if (m.key === "Escape") {
2080
+ m.preventDefault(), n("close");
2038
2081
  return;
2039
2082
  }
2040
- if (y.key !== "Tab" || !s.value) return;
2041
- const f = Array.from(s.value.querySelectorAll(Pe));
2042
- if (!f.length) return;
2043
- const H = f[0], $ = f[f.length - 1];
2044
- y.shiftKey && document.activeElement === H ? (y.preventDefault(), $.focus()) : !y.shiftKey && document.activeElement === $ && (y.preventDefault(), H.focus());
2083
+ if (m.key !== "Tab" || !r.value) return;
2084
+ const v = Array.from(r.value.querySelectorAll(Pe));
2085
+ if (!v.length) return;
2086
+ const N = v[0], T = v[v.length - 1];
2087
+ m.shiftKey && document.activeElement === N ? (m.preventDefault(), T.focus()) : !m.shiftKey && document.activeElement === T && (m.preventDefault(), N.focus());
2045
2088
  }
2046
2089
  return Ee(
2047
2090
  () => t.open,
2048
- (y) => {
2049
- y ? (o = document.activeElement instanceof HTMLElement ? document.activeElement : null, r()) : (o == null || o.focus(), o = null);
2091
+ (m) => {
2092
+ m ? (o = document.activeElement instanceof HTMLElement ? document.activeElement : null, s()) : (o == null || o.focus(), o = null);
2050
2093
  },
2051
2094
  { immediate: !0 }
2052
- ), He(() => document.addEventListener("keydown", i)), we(() => {
2095
+ ), He(() => document.addEventListener("keydown", i)), Ae(() => {
2053
2096
  document.removeEventListener("keydown", i), o = null;
2054
- }), (y, f) => e.open ? (N(), C("div", {
2097
+ }), (m, v) => e.open ? (b(), k("div", {
2055
2098
  key: 0,
2056
2099
  class: "modal-overlay open",
2057
- onClick: f[0] || (f[0] = fa((H) => n("close"), ["self"]))
2100
+ onClick: v[0] || (v[0] = fa((N) => n("close"), ["self"]))
2058
2101
  }, [
2059
2102
  _("div", {
2060
2103
  id: e.id,
2061
2104
  ref_key: "panel",
2062
- ref: s,
2063
- class: oe(["schedule-modal-panel", e.panelClass]),
2105
+ ref: r,
2106
+ class: se(["schedule-modal-panel", e.panelClass]),
2064
2107
  style: pa(e.panelStyle),
2065
2108
  role: "dialog",
2066
2109
  "aria-modal": "true",
@@ -2068,90 +2111,95 @@ const bn = ["data-hierarchy", "data-size", "data-icon"], So = /* @__PURE__ */ Ae
2068
2111
  "aria-label": e.label,
2069
2112
  tabindex: "-1"
2070
2113
  }, [
2071
- Ye(y.$slots, "default")
2072
- ], 14, $n)
2114
+ Ye(m.$slots, "default")
2115
+ ], 14, Yn)
2073
2116
  ])) : U("", !0);
2074
2117
  }
2075
2118
  });
2076
2119
  export {
2077
- ao as $,
2078
- Do as A,
2079
- Ea as B,
2080
- Gn as C,
2081
- Qn as D,
2082
- to as E,
2083
- Ha as F,
2084
- fo as G,
2085
- mo as H,
2086
- yo as I,
2120
+ no as $,
2121
+ Eo as A,
2122
+ Aa as B,
2123
+ Qn as C,
2124
+ Xn as D,
2125
+ oo as E,
2126
+ wa as F,
2127
+ go as G,
2128
+ Do as H,
2129
+ vo as I,
2087
2130
  We as J,
2088
- g as K,
2131
+ D as K,
2089
2132
  x as L,
2090
2133
  Sa as M,
2091
- Oe as N,
2092
- Eo as O,
2134
+ Le as N,
2135
+ Co as O,
2093
2136
  ba as P,
2094
- jn as Q,
2095
- Kn as R,
2096
- go as S,
2097
- ee as T,
2137
+ qn as Q,
2138
+ jn as R,
2139
+ bo as S,
2140
+ ae as T,
2098
2141
  qe as U,
2099
- En as V,
2100
- vo as W,
2142
+ bn as V,
2143
+ Ao as W,
2101
2144
  je as X,
2102
- X as Y,
2103
- Jn as Z,
2104
- Zn as _,
2105
- No as a,
2145
+ J as Y,
2146
+ eo as Z,
2147
+ ao as _,
2148
+ Oo as a,
2106
2149
  Ke as a0,
2107
- wa as a1,
2108
- wo as a2,
2109
- Ia as a3,
2110
- lo as a4,
2111
- Z as a5,
2112
- Na as a6,
2113
- Un as a7,
2114
- ro as a8,
2115
- dn as a9,
2116
- Se as aa,
2117
- Le as ab,
2118
- ie as ac,
2119
- ge as ad,
2120
- Mo as ae,
2121
- La as af,
2122
- So as ag,
2123
- Lo as ah,
2124
- Oo as ai,
2125
- Fn as aj,
2126
- ko as ak,
2127
- Ve as al,
2128
- io as am,
2129
- no as an,
2130
- se as ao,
2131
- oo as ap,
2132
- T as b,
2133
- Co as c,
2150
+ pn as a1,
2151
+ ee as a2,
2152
+ fo as a3,
2153
+ yo as a4,
2154
+ mo as a5,
2155
+ ko as a6,
2156
+ Ia as a7,
2157
+ co as a8,
2158
+ Na as a9,
2159
+ Ha as aa,
2160
+ zn as ab,
2161
+ $a as ac,
2162
+ uo as ad,
2163
+ yn as ae,
2164
+ Se as af,
2165
+ Oe as ag,
2166
+ ie as ah,
2167
+ we as ai,
2168
+ Ro as aj,
2169
+ Oa as ak,
2170
+ To as al,
2171
+ $o as am,
2172
+ Po as an,
2173
+ Wn as ao,
2174
+ Io as ap,
2175
+ Ve as aq,
2176
+ ro as ar,
2177
+ so as as,
2178
+ re as at,
2179
+ io as au,
2180
+ I as b,
2181
+ Lo as c,
2134
2182
  z as d,
2135
- zn as e,
2183
+ Kn as e,
2136
2184
  d as f,
2137
- ln as g,
2138
- ho as h,
2139
- Ma as i,
2140
- Ao as j,
2141
- uo as k,
2142
- co as l,
2143
- po as m,
2144
- De as n,
2145
- m as o,
2146
- Ho as p,
2147
- Xn as q,
2148
- eo as r,
2149
- so as s,
2150
- ve as t,
2151
- Vn as u,
2152
- bo as v,
2153
- qn as w,
2154
- Wn as x,
2185
+ dn as g,
2186
+ Ho as h,
2187
+ Ca as i,
2188
+ Mo as j,
2189
+ po as k,
2190
+ ho as l,
2191
+ wo as m,
2192
+ ge as n,
2193
+ y as o,
2194
+ No as p,
2195
+ Zn as q,
2196
+ to as r,
2197
+ lo as s,
2198
+ De as t,
2199
+ Gn as u,
2200
+ So as v,
2201
+ Jn as w,
2202
+ Vn as x,
2155
2203
  _e as y,
2156
- he as z
2204
+ ve as z
2157
2205
  };