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