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

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