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

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