@feedmepos/mf-hrm-portal 2.3.0-dev → 2.3.0-dev.11

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