@feedmepos/mf-hrm-portal 2.3.0-dev.10 → 2.3.0-dev.12
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-BLA2rhLB.js → ApprovalCodeList--NA0toYU.js} +2 -2
- package/dist/{AuditLogList-DBYdZhZl.js → AuditLogList-B-NaB6OX.js} +3 -3
- package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-CtCEzPbE.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-AEr2bDPY.js} +2 -2
- package/dist/{EmployeeList-CA7DWLmy.js → EmployeeList-idO38m7y.js} +23 -22
- package/dist/{GrantUserList-BYnegeEr.js → GrantUserList-B1S7yDKu.js} +3 -3
- package/dist/{Main-NDK7LUmm.js → Main-D5cWrqP3.js} +9 -9
- package/dist/{Main-Dh-gZSaa.js → Main-cdf9NV8P.js} +2 -2
- package/dist/{Main-BeXx0hAc.js → Main-mcCvBPvJ.js} +5 -5
- package/dist/{PermissionSetList-DDIacDpQ.js → PermissionSetList-3_f6sJpK.js} +17 -16
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-ONMn3v_f.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Cmin3rlY.js} +873 -873
- package/dist/ResponsiveContextMenu.vue_vue_type_script_setup_true_lang-mSJFKo7r.js +132 -0
- package/dist/{RoleList-B30FHIzu.js → RoleList-ByQelhuG.js} +19 -18
- package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-CRRguWTG.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-e4YOu59G.js} +1 -1
- package/dist/{ScheduleGeneralPage-8gEeZbFR.js → ScheduleGeneralPage-TKWgkAoE.js} +130 -128
- package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-TfxTAjO8.js → ScheduleModal.vue_vue_type_script_setup_true_lang-6bTAsmpp.js} +527 -491
- package/dist/SchedulePage-BpvgQYqL.js +17985 -0
- package/dist/{SchedulePositionPage-oGIDGneA.js → SchedulePositionPage-BjvKTHyY.js} +3 -3
- package/dist/{TeamMemberList-Drj6R4Y3.js → TeamMemberList-CJzF0wNK.js} +20 -19
- package/dist/{TimesheetList-CDQfN5LE.js → TimesheetList-CJcSs_B1.js} +5 -5
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-Bx-6hjs7.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-zttvxhi-.js} +2 -2
- package/dist/{app-DWe_4-ct.js → app-DLiYhsK2.js} +8 -8
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-QSwC9dtX.js → dayjs.min-ar-wg1yi.js} +1 -1
- package/dist/{employee-Bb2b3dP6.js → employee-CmUfaF0i.js} +3 -3
- package/dist/{iteration-TDU7bFxZ.js → iteration-uWvyRKkX.js} +1 -1
- package/dist/{lodash-D3Ns5VMN.js → lodash-BzVEbSHJ.js} +1 -1
- package/dist/{role-D57Le_-U.js → role-R2KDFlIY.js} +1 -1
- package/dist/{rule-DzesUEX7.js → rule-C6ELRd3E.js} +2 -2
- package/dist/src/composables/useDiscardConfirm.d.ts +3 -1
- package/dist/src/views/scheduling/components/ScheduleConfirmModal.vue.d.ts +2 -1
- package/dist/src/views/scheduling/composables/useScheduleAddEmployee.d.ts +1 -0
- package/dist/src/views/scheduling/composables/useScheduleAutoSchedule.d.ts +0 -3
- package/dist/src/views/scheduling/composables/useScheduleBoard.d.ts +2 -0
- package/dist/src/views/scheduling/composables/useScheduleDemandSheet.d.ts +7 -0
- package/dist/src/views/scheduling/composables/useScheduleEmployeeCandidates.d.ts +2 -2
- package/dist/src/views/scheduling/composables/useScheduleOnboardingEmployees.d.ts +1 -0
- package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +7 -0
- package/dist/src/views/scheduling/composables/useScheduleOutlet.d.ts +10 -8
- package/dist/src/views/scheduling/composables/useScheduleRoster.d.ts +2 -0
- package/dist/src/views/scheduling/composables/useScheduleShiftActions.d.ts +1 -0
- package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +6 -1
- package/dist/src/views/scheduling/schedule-store.d.ts +13 -0
- package/dist/src/views/scheduling/types.d.ts +2 -0
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/useDiscardConfirm-CzZSPyvh.js +28 -0
- package/dist/{useReportPermissions-Cmuead1K.js → useReportPermissions-B2U347Ey.js} +3 -3
- package/package.json +3 -3
- package/dist/SchedulePage-DQ0VXWWi.js +0 -17832
- package/dist/useDiscardConfirm-DPhEV6v0.js +0 -157
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { onMounted as
|
|
2
|
-
import { useRoute as
|
|
3
|
-
import { useCoreStore as
|
|
4
|
-
import { g as
|
|
5
|
-
import { E as
|
|
1
|
+
import { onMounted as Se, onBeforeUnmount as Le, ref as A, reactive as R, shallowRef as we, watch as Ie, computed as $, defineComponent as Re, createElementBlock as k, openBlock as N, renderSlot as ze, useAttrs as la, nextTick as be, normalizeClass as pe, createElementVNode as Y, createBlock as ua, mergeProps as da, toDisplayString as U, Teleport as ca, createCommentVNode as W, withDirectives as ya, vModelText as ma, Fragment as He, renderList as pa, createTextVNode as fa, withModifiers as ha, normalizeStyle as va } from "vue";
|
|
2
|
+
import { useRoute as ga, useRouter as Da } from "vue-router";
|
|
3
|
+
import { useCoreStore as Ve } from "@feedmepos/mf-common";
|
|
4
|
+
import { g as v, b as f, u as wa } from "./restaurant-BbYRA_IT.js";
|
|
5
|
+
import { E as Pe, u as Ke } from "./employee-CmUfaF0i.js";
|
|
6
6
|
function zn(e) {
|
|
7
7
|
let a = null;
|
|
8
8
|
function t() {
|
|
@@ -11,70 +11,70 @@ function zn(e) {
|
|
|
11
11
|
const n = a.getBoundingClientRect().top;
|
|
12
12
|
a.style.height = `${Math.max(0, window.innerHeight - n)}px`;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
Se(() => {
|
|
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
|
+
}), Le(() => {
|
|
18
18
|
window.removeEventListener("resize", t), a && (a.style.height = "");
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function Ne(e) {
|
|
22
22
|
const [a, t] = String(e || "0:0").split(":").map(Number);
|
|
23
23
|
return (Number.isFinite(a) ? a : 0) * 60 + (Number.isFinite(t) ? t : 0);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function Ha(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
29
|
function Aa(e, a) {
|
|
30
|
-
const t =
|
|
31
|
-
let n =
|
|
30
|
+
const t = Ne(e);
|
|
31
|
+
let n = Ne(a);
|
|
32
32
|
return n <= t && (n += 1440), [t, n];
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function Ge(e, a) {
|
|
35
35
|
const [t, n] = Aa(e, a);
|
|
36
36
|
return Math.max(0, n - t);
|
|
37
37
|
}
|
|
38
38
|
function Ea(e) {
|
|
39
|
-
const a = (
|
|
39
|
+
const a = (Ne(e) % 1440 + 1440) % 1440, t = Math.floor(a / 60), n = a % 60, i = t < 12 ? "am" : "pm", s = t % 12 || 12;
|
|
40
40
|
return n ? `${s}:${String(n).padStart(2, "0")}${i}` : `${s}${i}`;
|
|
41
41
|
}
|
|
42
42
|
function Vn(e) {
|
|
43
|
-
return Ea(
|
|
43
|
+
return Ea(Ha(e % 1440));
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function je(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
49
|
const [i, s] = n.startTime.split(":").map(Number), [l, o] = n.endTime.split(":").map(Number);
|
|
50
|
-
let
|
|
51
|
-
return
|
|
50
|
+
let u = l * 60 + o - (i * 60 + s);
|
|
51
|
+
return u < 0 && (u += 24 * 60), t + u;
|
|
52
52
|
}, 0) : Math.max(0, e && !Array.isArray(e) ? e.breakMins ?? 0 : 0);
|
|
53
53
|
}
|
|
54
54
|
function Kn(e, a) {
|
|
55
55
|
var i;
|
|
56
|
-
const t = a ??
|
|
56
|
+
const t = a ?? Ge(e.start, e.end), n = (i = e.breaks) != null && i.length ? e.breaks.reduce((s, l) => s + (l.breakPayType === "UNPAID" ? je([l]) : 0), 0) : Math.max(0, e.breakMins ?? 0);
|
|
57
57
|
return Math.max(0, t - Math.min(t, n));
|
|
58
58
|
}
|
|
59
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 ae = 500, ba = 10,
|
|
63
|
+
const ae = 500, ba = 10, Te = 6, jn = 1500, Qe = 1e6, w = {
|
|
64
64
|
async listEmployeeProfiles(e) {
|
|
65
|
-
return
|
|
65
|
+
return v(
|
|
66
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
|
-
return
|
|
72
|
+
return v(
|
|
73
73
|
await f(`restaurants/${e}/schedules`).get("employee-configs")
|
|
74
74
|
);
|
|
75
75
|
},
|
|
76
76
|
async saveEmployeeConfigs(e, a) {
|
|
77
|
-
return
|
|
77
|
+
return v(
|
|
78
78
|
await f(`restaurants/${e}/schedules`).post(
|
|
79
79
|
"employee-configs/reorder",
|
|
80
80
|
a
|
|
@@ -82,17 +82,17 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
|
|
|
82
82
|
);
|
|
83
83
|
},
|
|
84
84
|
async getSettings(e) {
|
|
85
|
-
return
|
|
85
|
+
return v(
|
|
86
86
|
await f(`restaurants/${e}/schedules`).get("settings")
|
|
87
87
|
);
|
|
88
88
|
},
|
|
89
89
|
async saveSettings(e, a) {
|
|
90
|
-
return
|
|
90
|
+
return v(
|
|
91
91
|
await f(`restaurants/${e}/schedules`).post("settings", a)
|
|
92
92
|
);
|
|
93
93
|
},
|
|
94
94
|
async generateAutoSchedule(e, a) {
|
|
95
|
-
return
|
|
95
|
+
return v(
|
|
96
96
|
await f(`restaurants/${e}/schedules`).post(
|
|
97
97
|
"auto-schedule/generate",
|
|
98
98
|
a
|
|
@@ -100,14 +100,14 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
|
|
|
100
100
|
);
|
|
101
101
|
},
|
|
102
102
|
async getAutoScheduleCapabilities(e) {
|
|
103
|
-
return
|
|
103
|
+
return v(
|
|
104
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
|
-
return
|
|
110
|
+
return v(
|
|
111
111
|
await f(`restaurants/${e}/schedules`).post(
|
|
112
112
|
"auto-schedule/apply",
|
|
113
113
|
a
|
|
@@ -116,19 +116,19 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
|
|
|
116
116
|
},
|
|
117
117
|
/** One outlet's whole board over `[from, to]` (inclusive, 'YYYY-MM-DD'). */
|
|
118
118
|
async readBoard(e, a, t) {
|
|
119
|
-
return
|
|
119
|
+
return v(
|
|
120
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
|
-
return
|
|
126
|
+
return v(
|
|
127
127
|
await f(`restaurants/${e}/schedules`).post("time-off", a)
|
|
128
128
|
);
|
|
129
129
|
},
|
|
130
130
|
async updateTimeOffStatus(e, a, t) {
|
|
131
|
-
return
|
|
131
|
+
return v(
|
|
132
132
|
await f(`restaurants/${e}/schedules`).post(
|
|
133
133
|
`time-off/${a}/status`,
|
|
134
134
|
t
|
|
@@ -140,11 +140,11 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
|
|
|
140
140
|
},
|
|
141
141
|
/** Creates or updates the employee's shared business-level scheduling profile. */
|
|
142
142
|
async createEmployeeProfile(e, a) {
|
|
143
|
-
return
|
|
143
|
+
return v(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
|
-
return
|
|
147
|
+
return v(
|
|
148
148
|
await f("schedules").post("employees", { employeeId: a, ...t })
|
|
149
149
|
);
|
|
150
150
|
},
|
|
@@ -153,10 +153,10 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
|
|
|
153
153
|
},
|
|
154
154
|
/** Positions are shared across the business. */
|
|
155
155
|
async createPosition(e) {
|
|
156
|
-
return
|
|
156
|
+
return v(await f("schedules").post("positions", e));
|
|
157
157
|
},
|
|
158
158
|
async updatePosition(e, a) {
|
|
159
|
-
return
|
|
159
|
+
return v(await f("schedules").post(`positions/${e}`, a));
|
|
160
160
|
},
|
|
161
161
|
/** Deleting one position is `deletePositions` with a single-id array — the backend's
|
|
162
162
|
* `DELETE positions/:id` route is gone; this is now `DELETE positions?ids=`. */
|
|
@@ -167,7 +167,7 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
|
|
|
167
167
|
},
|
|
168
168
|
/** Creates one flat demand interval. */
|
|
169
169
|
async createDemand(e, a) {
|
|
170
|
-
return
|
|
170
|
+
return v(
|
|
171
171
|
await f(`restaurants/${e}/schedules`).post("demands", a)
|
|
172
172
|
);
|
|
173
173
|
},
|
|
@@ -175,7 +175,7 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
|
|
|
175
175
|
* day/weekday's demand rows wholesale. Deleting one demand is just this with a single-id
|
|
176
176
|
* array. */
|
|
177
177
|
async deleteDemands(e, a) {
|
|
178
|
-
return
|
|
178
|
+
return v(
|
|
179
179
|
await f(`restaurants/${e}/schedules`).delete("demands", {
|
|
180
180
|
params: { ids: a.join(",") }
|
|
181
181
|
})
|
|
@@ -183,7 +183,7 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
|
|
|
183
183
|
},
|
|
184
184
|
/** Atomically replaces one date/weekday's flattened demand rows. */
|
|
185
185
|
async replaceDemands(e, a) {
|
|
186
|
-
return
|
|
186
|
+
return v(
|
|
187
187
|
await f(`restaurants/${e}/schedules`).post(
|
|
188
188
|
"demands/replace",
|
|
189
189
|
a
|
|
@@ -192,7 +192,7 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
|
|
|
192
192
|
},
|
|
193
193
|
/** Atomically replaces several date/weekday demand generations. */
|
|
194
194
|
async bulkReplaceDemands(e, a) {
|
|
195
|
-
return
|
|
195
|
+
return v(
|
|
196
196
|
await f(`restaurants/${e}/schedules`).post(
|
|
197
197
|
"demands/bulk-replace",
|
|
198
198
|
a
|
|
@@ -201,7 +201,7 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
|
|
|
201
201
|
},
|
|
202
202
|
/** Replaces one date's note/holiday-mark. All three fields back to empty/false clears it. */
|
|
203
203
|
async saveScheduleDay(e, a, t) {
|
|
204
|
-
return
|
|
204
|
+
return v(
|
|
205
205
|
await f(`restaurants/${e}/schedules`).post(
|
|
206
206
|
`days/${a}`,
|
|
207
207
|
t
|
|
@@ -210,12 +210,12 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
|
|
|
210
210
|
},
|
|
211
211
|
/** A one-off shift assignment. */
|
|
212
212
|
async createAssignment(e, a) {
|
|
213
|
-
return
|
|
213
|
+
return v(
|
|
214
214
|
await f(`restaurants/${e}/schedules`).post("assignments", a)
|
|
215
215
|
);
|
|
216
216
|
},
|
|
217
217
|
async updateAssignment(e, a, t) {
|
|
218
|
-
return
|
|
218
|
+
return v(
|
|
219
219
|
await f(`restaurants/${e}/schedules`).patch(
|
|
220
220
|
`assignments/${a}`,
|
|
221
221
|
t
|
|
@@ -224,7 +224,7 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
|
|
|
224
224
|
},
|
|
225
225
|
/** Atomically applies assignment updates, creates, and deletes used by moves and swaps. */
|
|
226
226
|
async bulkSaveAssignments(e, a) {
|
|
227
|
-
return
|
|
227
|
+
return v(
|
|
228
228
|
await f(`restaurants/${e}/schedules`).post(
|
|
229
229
|
"assignments/bulk",
|
|
230
230
|
a
|
|
@@ -235,7 +235,7 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
|
|
|
235
235
|
* getting replaced wholesale. Deleting one assignment is just this with a single-id
|
|
236
236
|
* array. */
|
|
237
237
|
async deleteAssignments(e, a) {
|
|
238
|
-
return
|
|
238
|
+
return v(
|
|
239
239
|
await f(`restaurants/${e}/schedules`).delete("assignments", {
|
|
240
240
|
params: { ids: a.join(",") }
|
|
241
241
|
})
|
|
@@ -244,25 +244,25 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
|
|
|
244
244
|
/** Flips a batch of assignments to one status in a single request — e.g. Publish sending
|
|
245
245
|
* every DRAFT shift on the board to PUBLISHED at once. */
|
|
246
246
|
async bulkUpdateAssignmentStatus(e, a) {
|
|
247
|
-
return
|
|
247
|
+
return v(
|
|
248
248
|
await f(`restaurants/${e}/schedules`).patch(
|
|
249
249
|
"assignments/bulk-status",
|
|
250
250
|
a
|
|
251
251
|
)
|
|
252
252
|
);
|
|
253
253
|
}
|
|
254
|
-
},
|
|
255
|
-
payload:
|
|
256
|
-
loading:
|
|
257
|
-
rosterLoading:
|
|
258
|
-
loadError:
|
|
259
|
-
scheduleSetupCompleted:
|
|
260
|
-
dataVersion:
|
|
261
|
-
outletId:
|
|
262
|
-
restaurantEmployees:
|
|
263
|
-
employeeConfigs:
|
|
264
|
-
employeeOutletIds:
|
|
265
|
-
businessEmployees:
|
|
254
|
+
}, Xe = {
|
|
255
|
+
payload: we(null),
|
|
256
|
+
loading: A(!1),
|
|
257
|
+
rosterLoading: A(!1),
|
|
258
|
+
loadError: A(null),
|
|
259
|
+
scheduleSetupCompleted: A(!1),
|
|
260
|
+
dataVersion: A(0),
|
|
261
|
+
outletId: A(""),
|
|
262
|
+
restaurantEmployees: A([]),
|
|
263
|
+
employeeConfigs: A([]),
|
|
264
|
+
employeeOutletIds: we({}),
|
|
265
|
+
businessEmployees: we([]),
|
|
266
266
|
positions: R([]),
|
|
267
267
|
positionRecords: R([]),
|
|
268
268
|
rolePositions: R({}),
|
|
@@ -300,30 +300,30 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
|
|
|
300
300
|
}
|
|
301
301
|
})
|
|
302
302
|
}, {
|
|
303
|
-
payload:
|
|
304
|
-
loading:
|
|
305
|
-
rosterLoading:
|
|
306
|
-
loadError:
|
|
307
|
-
scheduleSetupCompleted:
|
|
303
|
+
payload: c,
|
|
304
|
+
loading: $e,
|
|
305
|
+
rosterLoading: Ye,
|
|
306
|
+
loadError: fe,
|
|
307
|
+
scheduleSetupCompleted: Je,
|
|
308
308
|
dataVersion: V,
|
|
309
|
-
outletId:
|
|
310
|
-
restaurantEmployees:
|
|
311
|
-
employeeConfigs:
|
|
312
|
-
employeeOutletIds:
|
|
313
|
-
businessEmployees:
|
|
309
|
+
outletId: m,
|
|
310
|
+
restaurantEmployees: se,
|
|
311
|
+
employeeConfigs: F,
|
|
312
|
+
employeeOutletIds: Ze,
|
|
313
|
+
businessEmployees: Ae,
|
|
314
314
|
positions: Pa,
|
|
315
315
|
positionRecords: K,
|
|
316
|
-
rolePositions:
|
|
316
|
+
rolePositions: Qn,
|
|
317
317
|
outlet: Na,
|
|
318
|
-
locationOptions:
|
|
318
|
+
locationOptions: xe,
|
|
319
319
|
locationLabelById: ne,
|
|
320
|
-
compensationGroupMeta:
|
|
321
|
-
existingStaff:
|
|
322
|
-
shiftTemplates:
|
|
323
|
-
rules:
|
|
324
|
-
} =
|
|
320
|
+
compensationGroupMeta: Xn,
|
|
321
|
+
existingStaff: Jn,
|
|
322
|
+
shiftTemplates: Zn,
|
|
323
|
+
rules: C
|
|
324
|
+
} = Xe;
|
|
325
325
|
function ka() {
|
|
326
|
-
const e =
|
|
326
|
+
const e = Xe.rules;
|
|
327
327
|
Object.keys(e.coverage).forEach((a) => delete e.coverage[a]), e.openFrom = "00:00", e.openTo = "24:00", e.dayHours.splice(0, e.dayHours.length, ...Array.from({ length: 7 }, () => [])), Object.assign(e.payRate.NORMAL, { overtime: 1.5 }), Object.assign(e.payRate.REST_DAY, { regular: 1, overtime: 2 }), Object.assign(e.payRate.PUBLIC_HOLIDAY, { regular: 2, overtime: 3 }), e.salesForecast = 0, e.closedWeekdays.splice(0, e.closedWeekdays.length), e.labourTarget = 0, e.budgetFromSales = !1, e.budget = 0, e.otCapHours = null, e.workingHours = { minHoursPerDay: null, maxHoursPerDay: 8, maxHoursPerWeek: 45 }, e.otBudget = 0, Object.assign(e.notify, {
|
|
328
328
|
waConnected: !1,
|
|
329
329
|
waNumber: "",
|
|
@@ -331,7 +331,7 @@ function ka() {
|
|
|
331
331
|
defaults: { wa: !1, push: !1, email: !1 }
|
|
332
332
|
});
|
|
333
333
|
}
|
|
334
|
-
const
|
|
334
|
+
const ke = 7;
|
|
335
335
|
function Ca(e) {
|
|
336
336
|
const a = e.getFullYear(), t = String(e.getMonth() + 1).padStart(2, "0"), n = String(e.getDate()).padStart(2, "0");
|
|
337
337
|
return `${a}-${t}-${n}`;
|
|
@@ -340,62 +340,62 @@ function oe(e, a) {
|
|
|
340
340
|
const t = new Date(e);
|
|
341
341
|
return t.setDate(t.getDate() + a), t;
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function Ce(e) {
|
|
344
344
|
const a = new Date(e);
|
|
345
345
|
return a.setHours(0, 0, 0, 0), a.setDate(a.getDate() - (a.getDay() + 6) % 7), a;
|
|
346
346
|
}
|
|
347
|
-
function
|
|
348
|
-
const t = oe(
|
|
349
|
-
return Array.from({ length:
|
|
347
|
+
function qn(e, a = /* @__PURE__ */ new Date()) {
|
|
348
|
+
const t = oe(Ce(a), e * ke);
|
|
349
|
+
return Array.from({ length: ke }, (n, i) => oe(t, i));
|
|
350
350
|
}
|
|
351
351
|
function eo(e, a) {
|
|
352
|
-
const t = (s) => Date.UTC(s.getFullYear(), s.getMonth(), s.getDate()), n = t(
|
|
353
|
-
return Math.trunc((i - n) / (
|
|
352
|
+
const t = (s) => Date.UTC(s.getFullYear(), s.getMonth(), s.getDate()), n = t(Ce(e)), i = t(Ce(a));
|
|
353
|
+
return Math.trunc((i - n) / (ke * 24 * 60 * 60 * 1e3));
|
|
354
354
|
}
|
|
355
|
-
const
|
|
356
|
-
let G = null, j = null, z = null, te = 0,
|
|
357
|
-
function
|
|
358
|
-
return e ===
|
|
355
|
+
const ie = Ca;
|
|
356
|
+
let G = null, j = null, z = null, te = 0, he = null;
|
|
357
|
+
function Be(e) {
|
|
358
|
+
return e === m.value ? !1 : (ka(), m.value = e, c.value = null, G = null, j = null, fe.value = null, he = null, Je.value = !1, se.value = [], F.value = [], z = null, te += 1, V.value += 1, !0);
|
|
359
359
|
}
|
|
360
|
-
async function
|
|
361
|
-
if (!(!e ||
|
|
362
|
-
|
|
360
|
+
async function Me(e) {
|
|
361
|
+
if (!(!e || he === e)) {
|
|
362
|
+
Ye.value = !0;
|
|
363
363
|
try {
|
|
364
364
|
await Ma(e);
|
|
365
365
|
} finally {
|
|
366
|
-
|
|
366
|
+
Ye.value = !1;
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
370
|
async function Ma(e) {
|
|
371
|
-
const a = await
|
|
371
|
+
const a = await Pe.readEmployeesPage({
|
|
372
372
|
limit: ae,
|
|
373
373
|
offset: 0,
|
|
374
374
|
restaurantIds: [e]
|
|
375
375
|
});
|
|
376
|
-
e ===
|
|
377
|
-
e ===
|
|
376
|
+
e === m.value && (se.value = a.items, F.value = await w.listEmployeeConfigs(e), he = e, V.value += 1, Ra().then((t) => {
|
|
377
|
+
e === m.value && (Ze.value = t, V.value += 1);
|
|
378
378
|
}));
|
|
379
379
|
}
|
|
380
380
|
async function Sa(e) {
|
|
381
|
-
const a =
|
|
381
|
+
const a = m.value;
|
|
382
382
|
if (!a || !e.length) return;
|
|
383
|
-
const t = await
|
|
384
|
-
|
|
383
|
+
const t = await w.saveEmployeeConfigs(a, { configs: e });
|
|
384
|
+
F.value = t, V.value += 1;
|
|
385
385
|
}
|
|
386
386
|
async function La(e, a) {
|
|
387
|
-
const t =
|
|
387
|
+
const t = F.value.find((i) => i.employeeId === e), n = (t == null ? void 0 : t.displayOrder) ?? (a && F.value.some((i) => i.displayOrder !== null) ? Math.max(
|
|
388
388
|
0,
|
|
389
|
-
...
|
|
389
|
+
...F.value.filter((i) => i.displayOrder !== null).map((i) => i.displayOrder)
|
|
390
390
|
) + 100 : null);
|
|
391
391
|
await Sa([{ employeeId: e, enabled: a, displayOrder: n }]);
|
|
392
392
|
}
|
|
393
|
-
async function
|
|
394
|
-
const e =
|
|
395
|
-
e && (
|
|
393
|
+
async function Oe() {
|
|
394
|
+
const e = m.value;
|
|
395
|
+
e && (he = null, await Me(e));
|
|
396
396
|
}
|
|
397
|
-
async function
|
|
398
|
-
const t =
|
|
397
|
+
async function qe(e, a) {
|
|
398
|
+
const t = Ke(), n = (await re(!0)).find((o) => o._id === e);
|
|
399
399
|
if (!n) throw new Error("Could not find this employee");
|
|
400
400
|
const i = n.restaurantRole.map((o) => ({
|
|
401
401
|
restaurantId: o.restaurantId,
|
|
@@ -413,37 +413,60 @@ async function Re(e, a) {
|
|
|
413
413
|
user: { name: n.name, passcode: n.passcode },
|
|
414
414
|
roles: s,
|
|
415
415
|
previousRoles: i
|
|
416
|
-
});
|
|
416
|
+
}), await re(!0);
|
|
417
417
|
}
|
|
418
418
|
async function ao(e, a, t = "") {
|
|
419
419
|
const n = [...new Set(a.filter(Boolean))];
|
|
420
|
-
n.length && (await
|
|
420
|
+
n.length && (await qe(e, (i) => [
|
|
421
421
|
...i.filter((s) => !n.includes(s.restaurantId)),
|
|
422
422
|
...n.map((s) => ({ restaurantId: s, roleId: t }))
|
|
423
|
-
]),
|
|
423
|
+
]), m.value && n.includes(m.value) && await La(e, !0), await Oe());
|
|
424
424
|
}
|
|
425
425
|
async function to(e, a) {
|
|
426
|
-
const t = new Set(a);
|
|
427
|
-
t.size && (await Re(e, (n) => n.filter((i) => !t.has(i.restaurantId))), await Ie());
|
|
428
|
-
}
|
|
429
|
-
async function no(e, a) {
|
|
430
426
|
if (!a.length) return;
|
|
431
427
|
const t = new Map(a.map((n) => [n.restaurantId, n.roleId]));
|
|
432
|
-
await
|
|
428
|
+
await qe(e, (n) => [
|
|
433
429
|
...n.filter((i) => !t.has(i.restaurantId)),
|
|
434
430
|
...[...t.entries()].map(([i, s]) => ({ restaurantId: i, roleId: s }))
|
|
435
|
-
]), await
|
|
431
|
+
]), await Oe();
|
|
432
|
+
}
|
|
433
|
+
async function no(e, a) {
|
|
434
|
+
const t = Ke(), n = (await re(!0)).find((u) => u._id === e);
|
|
435
|
+
if (!n) throw new Error("Could not find this employee");
|
|
436
|
+
const i = (u) => u.slice().sort((h, E) => h.restaurantId.localeCompare(E.restaurantId)).map((h) => `${h.restaurantId}:${h.roleId}`).join("|"), s = i(n.restaurantRole) !== i(a.roles), l = n.passcode !== a.passcode || n.isMasterUser !== a.masterUser || a.masterUser && (n.code ?? "") !== a.masterCode;
|
|
437
|
+
if (!s && !l) return;
|
|
438
|
+
const o = n.restaurantRole.map((u) => ({
|
|
439
|
+
restaurantId: u.restaurantId,
|
|
440
|
+
roleId: u.roleId
|
|
441
|
+
}));
|
|
442
|
+
if (a.masterUser) {
|
|
443
|
+
const u = {
|
|
444
|
+
user: { name: a.name, passcode: a.passcode, code: a.masterCode },
|
|
445
|
+
roles: a.roles,
|
|
446
|
+
previousRoles: o
|
|
447
|
+
};
|
|
448
|
+
n.isMasterUser ? await t.updateMasterEmployee(e, u) : await t.migrateToMasterUser(e, u);
|
|
449
|
+
} else {
|
|
450
|
+
if (n.isMasterUser)
|
|
451
|
+
throw new Error("Master users cannot be converted back from this form");
|
|
452
|
+
await t.updateEmployee(e, {
|
|
453
|
+
user: { name: a.name, passcode: a.passcode },
|
|
454
|
+
roles: a.roles,
|
|
455
|
+
previousRoles: o
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
await re(!0), await Oe();
|
|
436
459
|
}
|
|
437
460
|
let ee = null;
|
|
438
461
|
async function Ia() {
|
|
439
|
-
const e = await
|
|
462
|
+
const e = await Pe.readEmployeesPage({
|
|
440
463
|
limit: ae,
|
|
441
464
|
offset: 0,
|
|
442
465
|
includeEmptyPasscode: !0
|
|
443
466
|
}), a = Math.min(ba, Math.ceil(e.total / ae)), t = await Promise.all(
|
|
444
467
|
Array.from(
|
|
445
468
|
{ length: Math.max(0, a - 1) },
|
|
446
|
-
(n, i) =>
|
|
469
|
+
(n, i) => Pe.readEmployeesPage({
|
|
447
470
|
limit: ae,
|
|
448
471
|
offset: (i + 1) * ae,
|
|
449
472
|
includeEmptyPasscode: !0
|
|
@@ -452,12 +475,12 @@ async function Ia() {
|
|
|
452
475
|
);
|
|
453
476
|
return [...e.items, ...t.flatMap((n) => n.items)];
|
|
454
477
|
}
|
|
455
|
-
function
|
|
478
|
+
function re(e = !1) {
|
|
456
479
|
if (!e) {
|
|
457
480
|
if (ee) return ee;
|
|
458
|
-
if (
|
|
481
|
+
if (Ae.value.length) return Promise.resolve(Ae.value);
|
|
459
482
|
}
|
|
460
|
-
const a = Ia().then((t) => (
|
|
483
|
+
const a = Ia().then((t) => (Ae.value = t, t)).finally(() => {
|
|
461
484
|
ee === a && (ee = null);
|
|
462
485
|
});
|
|
463
486
|
return ee = a, a;
|
|
@@ -465,7 +488,7 @@ function Xe(e = !1) {
|
|
|
465
488
|
async function Ra() {
|
|
466
489
|
const e = {};
|
|
467
490
|
try {
|
|
468
|
-
(await
|
|
491
|
+
(await re()).forEach((a) => {
|
|
469
492
|
e[a._id] = [...new Set(a.restaurantRole.map((t) => t.restaurantId))];
|
|
470
493
|
});
|
|
471
494
|
} catch {
|
|
@@ -473,65 +496,65 @@ async function Ra() {
|
|
|
473
496
|
}
|
|
474
497
|
return e;
|
|
475
498
|
}
|
|
476
|
-
function
|
|
499
|
+
function _e(e, a) {
|
|
477
500
|
return G !== null && j !== null && G <= e && j >= a;
|
|
478
501
|
}
|
|
479
502
|
async function Oa(e) {
|
|
480
|
-
const a =
|
|
481
|
-
|
|
482
|
-
oe(e, -7 *
|
|
483
|
-
oe(e, 7 *
|
|
503
|
+
const a = ie(e), t = ie(oe(e, 6));
|
|
504
|
+
_e(a, t) || z && (await z, _e(a, t)) || await ea(
|
|
505
|
+
oe(e, -7 * Te),
|
|
506
|
+
oe(e, 7 * Te)
|
|
484
507
|
);
|
|
485
508
|
}
|
|
486
509
|
async function oo() {
|
|
487
|
-
!G || !j || await
|
|
510
|
+
!G || !j || await ea(/* @__PURE__ */ new Date(`${G}T00:00:00`), /* @__PURE__ */ new Date(`${j}T00:00:00`));
|
|
488
511
|
}
|
|
489
512
|
async function so(e) {
|
|
490
|
-
if (!
|
|
491
|
-
const a = await
|
|
492
|
-
|
|
513
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
514
|
+
const a = await w.createEmployeeProfile(m.value, e);
|
|
515
|
+
c.value && (c.value.employees.push(a), V.value += 1);
|
|
493
516
|
}
|
|
494
517
|
async function io(e) {
|
|
495
|
-
await
|
|
518
|
+
await w.validatePosAccess(e);
|
|
496
519
|
}
|
|
497
520
|
async function ro(e, a) {
|
|
498
|
-
if (!
|
|
499
|
-
const t = await
|
|
500
|
-
if (
|
|
501
|
-
const n =
|
|
502
|
-
n > -1 && (
|
|
503
|
-
...
|
|
504
|
-
employees:
|
|
521
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
522
|
+
const t = await w.updateEmployeeProfile(m.value, e, a);
|
|
523
|
+
if (c.value) {
|
|
524
|
+
const n = c.value.employees.findIndex((i) => i.employeeId === e);
|
|
525
|
+
n > -1 && (c.value = {
|
|
526
|
+
...c.value,
|
|
527
|
+
employees: c.value.employees.map((i, s) => s === n ? t : i)
|
|
505
528
|
});
|
|
506
529
|
}
|
|
507
530
|
}
|
|
508
531
|
async function lo(e) {
|
|
509
|
-
const a = await
|
|
510
|
-
|
|
532
|
+
const a = await w.createPosition(e);
|
|
533
|
+
c.value && (c.value = { ...c.value, positions: [...c.value.positions, a] });
|
|
511
534
|
}
|
|
512
535
|
async function uo(e, a) {
|
|
513
|
-
const t = await
|
|
514
|
-
|
|
515
|
-
...
|
|
516
|
-
positions:
|
|
536
|
+
const t = await w.updatePosition(e, a);
|
|
537
|
+
c.value && (c.value = {
|
|
538
|
+
...c.value,
|
|
539
|
+
positions: c.value.positions.map((n) => n.id === e ? t : n)
|
|
517
540
|
});
|
|
518
541
|
}
|
|
519
542
|
async function co(e) {
|
|
520
|
-
await
|
|
521
|
-
...
|
|
522
|
-
positions:
|
|
543
|
+
await w.deletePosition(e), c.value && (c.value = {
|
|
544
|
+
...c.value,
|
|
545
|
+
positions: c.value.positions.filter((a) => a.id !== e)
|
|
523
546
|
});
|
|
524
547
|
}
|
|
525
548
|
async function yo(e, a) {
|
|
526
549
|
var i;
|
|
527
|
-
if (!
|
|
528
|
-
const t = (i =
|
|
550
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
551
|
+
const t = (i = c.value) == null ? void 0 : i.days.find((s) => s.date === e), n = await w.saveScheduleDay(m.value, e, {
|
|
529
552
|
...a,
|
|
530
553
|
expectedUpdatedAt: a.expectedUpdatedAt ?? (t == null ? void 0 : t.updatedAt)
|
|
531
554
|
});
|
|
532
|
-
if (
|
|
533
|
-
const s =
|
|
534
|
-
n && s.push(n),
|
|
555
|
+
if (c.value) {
|
|
556
|
+
const s = c.value.days.filter((l) => l.date !== e);
|
|
557
|
+
n && s.push(n), c.value = { ...c.value, days: s };
|
|
535
558
|
}
|
|
536
559
|
}
|
|
537
560
|
async function mo(e) {
|
|
@@ -558,23 +581,23 @@ function Ta(e) {
|
|
|
558
581
|
};
|
|
559
582
|
}
|
|
560
583
|
async function $a(e) {
|
|
561
|
-
if (!
|
|
584
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
562
585
|
if (!e.length) return;
|
|
563
|
-
const a = e.map(Ta), t = e.length === 1 ? await
|
|
564
|
-
if (
|
|
565
|
-
const n = new Set(e.map((s) => s.date)), i =
|
|
566
|
-
|
|
586
|
+
const a = e.map(Ta), t = e.length === 1 ? await w.replaceDemands(m.value, a[0]) : await w.bulkReplaceDemands(m.value, { replacements: a });
|
|
587
|
+
if (c.value) {
|
|
588
|
+
const n = new Set(e.map((s) => s.date)), i = c.value.demands.filter((s) => s.date === null || !n.has(s.date));
|
|
589
|
+
c.value = { ...c.value, demands: [...i, ...t] };
|
|
567
590
|
}
|
|
568
591
|
}
|
|
569
592
|
async function po(e, a) {
|
|
570
|
-
if (!
|
|
571
|
-
const t =
|
|
593
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
594
|
+
const t = c.value;
|
|
572
595
|
if (!t || t.demands.some((s) => s.date === a)) return 0;
|
|
573
596
|
const n = t.demands.filter((s) => s.date === e);
|
|
574
597
|
if (!n.length) return 0;
|
|
575
598
|
const i = await Promise.all(
|
|
576
599
|
n.map(
|
|
577
|
-
(s) =>
|
|
600
|
+
(s) => w.createDemand(m.value, {
|
|
578
601
|
date: a,
|
|
579
602
|
startTime: s.startTime,
|
|
580
603
|
endTime: s.endTime,
|
|
@@ -588,70 +611,70 @@ async function po(e, a) {
|
|
|
588
611
|
})
|
|
589
612
|
)
|
|
590
613
|
);
|
|
591
|
-
return
|
|
614
|
+
return c.value && (c.value = { ...c.value, demands: [...c.value.demands, ...i] }), i.length;
|
|
592
615
|
}
|
|
593
616
|
async function fo(e) {
|
|
594
|
-
if (!
|
|
595
|
-
return
|
|
617
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
618
|
+
return w.generateAutoSchedule(m.value, e);
|
|
596
619
|
}
|
|
597
620
|
async function ho() {
|
|
598
|
-
if (!
|
|
599
|
-
return
|
|
621
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
622
|
+
return w.getAutoScheduleCapabilities(m.value);
|
|
600
623
|
}
|
|
601
624
|
async function vo(e) {
|
|
602
|
-
if (!
|
|
603
|
-
return
|
|
604
|
-
}
|
|
605
|
-
async function Do(e) {
|
|
606
|
-
if (!y.value) throw new Error("No outlet selected");
|
|
607
|
-
return D.bulkSaveAssignments(y.value, e);
|
|
625
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
626
|
+
return w.applyAutoSchedule(m.value, e);
|
|
608
627
|
}
|
|
609
628
|
async function go(e) {
|
|
610
|
-
if (!
|
|
611
|
-
|
|
612
|
-
}
|
|
613
|
-
async function
|
|
614
|
-
if (!
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
629
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
630
|
+
return w.bulkSaveAssignments(m.value, e);
|
|
631
|
+
}
|
|
632
|
+
async function Do(e) {
|
|
633
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
634
|
+
e.length && await w.deleteAssignments(m.value, e);
|
|
635
|
+
}
|
|
636
|
+
async function wo(e) {
|
|
637
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
638
|
+
const a = await w.createTimeOff(m.value, e);
|
|
639
|
+
return c.value && (c.value = { ...c.value, timeOff: [...c.value.timeOff, a] }), a;
|
|
640
|
+
}
|
|
641
|
+
async function Ho(e, a) {
|
|
642
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
643
|
+
const t = await w.updateTimeOffStatus(m.value, e, a);
|
|
644
|
+
return t && c.value && (c.value = {
|
|
645
|
+
...c.value,
|
|
646
|
+
timeOff: c.value.timeOff.map((n) => n.id === e ? t : n)
|
|
624
647
|
}), t;
|
|
625
648
|
}
|
|
626
649
|
async function Ao(e) {
|
|
627
|
-
if (!
|
|
628
|
-
await
|
|
629
|
-
...
|
|
630
|
-
timeOff:
|
|
650
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
651
|
+
await w.deleteTimeOff(m.value, e), c.value && (c.value = {
|
|
652
|
+
...c.value,
|
|
653
|
+
timeOff: c.value.timeOff.filter((a) => a.id !== e)
|
|
631
654
|
});
|
|
632
655
|
}
|
|
633
656
|
async function Eo(e) {
|
|
634
|
-
if (!
|
|
635
|
-
return
|
|
657
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
658
|
+
return w.bulkUpdateAssignmentStatus(m.value, e);
|
|
636
659
|
}
|
|
637
|
-
async function
|
|
638
|
-
const t =
|
|
660
|
+
async function ea(e, a) {
|
|
661
|
+
const t = m.value;
|
|
639
662
|
if (!t) {
|
|
640
|
-
|
|
663
|
+
fe.value = "No outlet selected";
|
|
641
664
|
return;
|
|
642
665
|
}
|
|
643
|
-
const n =
|
|
644
|
-
|
|
666
|
+
const n = ie(e), i = ie(a), s = ++te;
|
|
667
|
+
$e.value = !0, fe.value = null;
|
|
645
668
|
const l = (async () => {
|
|
646
669
|
try {
|
|
647
|
-
const o = await
|
|
648
|
-
if (
|
|
649
|
-
|
|
670
|
+
const o = await w.readBoard(t, n, i);
|
|
671
|
+
if (m.value !== t || s !== te) return;
|
|
672
|
+
c.value = o, Je.value = o.settings.setupCompleted, G = n, j = i, V.value += 1;
|
|
650
673
|
} catch (o) {
|
|
651
|
-
if (
|
|
652
|
-
|
|
674
|
+
if (m.value !== t || s !== te) return;
|
|
675
|
+
fe.value = o instanceof Error ? o.message : "Could not load the schedule";
|
|
653
676
|
} finally {
|
|
654
|
-
|
|
677
|
+
m.value === t && s === te && ($e.value = !1);
|
|
655
678
|
}
|
|
656
679
|
})();
|
|
657
680
|
z = l;
|
|
@@ -747,11 +770,11 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
747
770
|
}
|
|
748
771
|
}, ja = {
|
|
749
772
|
maxHoursPerMonth: 72
|
|
750
|
-
},
|
|
773
|
+
}, Qa = {
|
|
751
774
|
minHoursPerDay: null,
|
|
752
775
|
maxHoursPerDay: 8,
|
|
753
776
|
maxHoursPerWeek: 44
|
|
754
|
-
},
|
|
777
|
+
}, Xa = [
|
|
755
778
|
{
|
|
756
779
|
month: 1,
|
|
757
780
|
day: 1,
|
|
@@ -777,7 +800,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
777
800
|
day: 25,
|
|
778
801
|
name: "Christmas Day"
|
|
779
802
|
}
|
|
780
|
-
],
|
|
803
|
+
], Ja = {
|
|
781
804
|
2026: {
|
|
782
805
|
"2026-01-01": "New Year's Day",
|
|
783
806
|
"2026-02-17": "Chinese New Year",
|
|
@@ -807,15 +830,15 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
807
830
|
"2027-08-15": "Prophet Muhammad's Birthday",
|
|
808
831
|
"2027-12-25": "Christmas Day"
|
|
809
832
|
}
|
|
810
|
-
},
|
|
833
|
+
}, Za = {
|
|
811
834
|
countryCode: Va,
|
|
812
835
|
timezone: Ka,
|
|
813
836
|
payRate: Ga,
|
|
814
837
|
overtime: ja,
|
|
815
|
-
workingHours:
|
|
816
|
-
recurringPublicHolidays:
|
|
817
|
-
publicHolidays:
|
|
818
|
-
},
|
|
838
|
+
workingHours: Qa,
|
|
839
|
+
recurringPublicHolidays: Xa,
|
|
840
|
+
publicHolidays: Ja
|
|
841
|
+
}, qa = "ID", et = "Asia/Jakarta", at = {
|
|
819
842
|
NORMAL: {
|
|
820
843
|
overtime: 1.5
|
|
821
844
|
},
|
|
@@ -895,7 +918,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
895
918
|
"2027-12-26": "Isra Mi'raj"
|
|
896
919
|
}
|
|
897
920
|
}, it = {
|
|
898
|
-
countryCode:
|
|
921
|
+
countryCode: qa,
|
|
899
922
|
timezone: et,
|
|
900
923
|
payRate: at,
|
|
901
924
|
overtime: tt,
|
|
@@ -1023,13 +1046,13 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1023
1046
|
regular: 2,
|
|
1024
1047
|
overtime: 3
|
|
1025
1048
|
}
|
|
1026
|
-
}, Dt = {
|
|
1027
|
-
maxHoursPerMonth: null
|
|
1028
1049
|
}, gt = {
|
|
1050
|
+
maxHoursPerMonth: null
|
|
1051
|
+
}, Dt = {
|
|
1029
1052
|
minHoursPerDay: null,
|
|
1030
1053
|
maxHoursPerDay: 8,
|
|
1031
1054
|
maxHoursPerWeek: 48
|
|
1032
|
-
},
|
|
1055
|
+
}, wt = [
|
|
1033
1056
|
{
|
|
1034
1057
|
month: 1,
|
|
1035
1058
|
day: 1,
|
|
@@ -1055,7 +1078,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1055
1078
|
day: 11,
|
|
1056
1079
|
name: "Republic Day"
|
|
1057
1080
|
}
|
|
1058
|
-
],
|
|
1081
|
+
], Ht = {
|
|
1059
1082
|
2026: {
|
|
1060
1083
|
"2026-01-01": "New Year's Day",
|
|
1061
1084
|
"2026-03-20": "Eid al-Fitr Holiday",
|
|
@@ -1097,10 +1120,10 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1097
1120
|
countryCode: ft,
|
|
1098
1121
|
timezone: ht,
|
|
1099
1122
|
payRate: vt,
|
|
1100
|
-
overtime:
|
|
1101
|
-
workingHours:
|
|
1102
|
-
recurringPublicHolidays:
|
|
1103
|
-
publicHolidays:
|
|
1123
|
+
overtime: gt,
|
|
1124
|
+
workingHours: Dt,
|
|
1125
|
+
recurringPublicHolidays: wt,
|
|
1126
|
+
publicHolidays: Ht
|
|
1104
1127
|
}, Et = "MY", bt = "Asia/Kuala_Lumpur", Pt = {
|
|
1105
1128
|
NORMAL: {
|
|
1106
1129
|
overtime: 1.5
|
|
@@ -1351,7 +1374,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1351
1374
|
workingHours: Wt,
|
|
1352
1375
|
recurringPublicHolidays: zt,
|
|
1353
1376
|
publicHolidays: Vt
|
|
1354
|
-
}, Gt = "TH", jt = "Asia/Bangkok",
|
|
1377
|
+
}, Gt = "TH", jt = "Asia/Bangkok", Qt = {
|
|
1355
1378
|
NORMAL: {
|
|
1356
1379
|
overtime: 1.5
|
|
1357
1380
|
},
|
|
@@ -1363,13 +1386,13 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1363
1386
|
regular: 2,
|
|
1364
1387
|
overtime: 3
|
|
1365
1388
|
}
|
|
1366
|
-
}, Qt = {
|
|
1367
|
-
maxHoursPerMonth: 36
|
|
1368
1389
|
}, Xt = {
|
|
1390
|
+
maxHoursPerMonth: 36
|
|
1391
|
+
}, Jt = {
|
|
1369
1392
|
minHoursPerDay: null,
|
|
1370
1393
|
maxHoursPerDay: 8,
|
|
1371
1394
|
maxHoursPerWeek: 48
|
|
1372
|
-
},
|
|
1395
|
+
}, Zt = [
|
|
1373
1396
|
{
|
|
1374
1397
|
month: 1,
|
|
1375
1398
|
day: 1,
|
|
@@ -1415,7 +1438,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1415
1438
|
day: 31,
|
|
1416
1439
|
name: "New Year's Eve"
|
|
1417
1440
|
}
|
|
1418
|
-
],
|
|
1441
|
+
], qt = {
|
|
1419
1442
|
2026: {
|
|
1420
1443
|
"2026-01-01": "New Year's Day",
|
|
1421
1444
|
"2026-03-03": "Makha Bucha Day",
|
|
@@ -1458,11 +1481,11 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1458
1481
|
}, en = {
|
|
1459
1482
|
countryCode: Gt,
|
|
1460
1483
|
timezone: jt,
|
|
1461
|
-
payRate:
|
|
1462
|
-
overtime:
|
|
1463
|
-
workingHours:
|
|
1464
|
-
recurringPublicHolidays:
|
|
1465
|
-
publicHolidays:
|
|
1484
|
+
payRate: Qt,
|
|
1485
|
+
overtime: Xt,
|
|
1486
|
+
workingHours: Jt,
|
|
1487
|
+
recurringPublicHolidays: Zt,
|
|
1488
|
+
publicHolidays: qt
|
|
1466
1489
|
}, an = "VN", tn = "Asia/Ho_Chi_Minh", nn = {
|
|
1467
1490
|
NORMAL: {
|
|
1468
1491
|
overtime: 1.5
|
|
@@ -1538,7 +1561,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1538
1561
|
workingHours: sn,
|
|
1539
1562
|
recurringPublicHolidays: rn,
|
|
1540
1563
|
publicHolidays: ln
|
|
1541
|
-
},
|
|
1564
|
+
}, Fe = { AE: za, BN: Za, ID: it, MO: pt, MV: At, MY: St, PK: xt, SG: Kt, TH: en, VN: un };
|
|
1542
1565
|
function dn(e) {
|
|
1543
1566
|
if (typeof e == "string") return e.toUpperCase();
|
|
1544
1567
|
if (e && typeof e == "object" && "code" in e) {
|
|
@@ -1548,7 +1571,7 @@ function dn(e) {
|
|
|
1548
1571
|
return "MY";
|
|
1549
1572
|
}
|
|
1550
1573
|
function cn(e) {
|
|
1551
|
-
return
|
|
1574
|
+
return Fe[dn(e)] ?? Fe.MY;
|
|
1552
1575
|
}
|
|
1553
1576
|
function bo(e, a) {
|
|
1554
1577
|
var s, l;
|
|
@@ -1557,7 +1580,7 @@ function bo(e, a) {
|
|
|
1557
1580
|
const n = Number(a.slice(5, 7)), i = Number(a.slice(8, 10));
|
|
1558
1581
|
return ((l = e.recurringPublicHolidays.find((o) => o.month === n && o.day === i)) == null ? void 0 : l.name) ?? null;
|
|
1559
1582
|
}
|
|
1560
|
-
const yn =
|
|
1583
|
+
const yn = Ve(), aa = "unassigned", Po = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], No = "All Stations", ko = [{ id: aa, label: "Assigned", roles: [], system: !0 }], Ue = [
|
|
1561
1584
|
"#903E1F",
|
|
1562
1585
|
"#5F090A",
|
|
1563
1586
|
"#0A5384",
|
|
@@ -1580,82 +1603,82 @@ function Mo(e, a) {
|
|
|
1580
1603
|
return a ? !K.some((t) => t.id === a) : !!e && !K.some((t) => t.name.toLocaleLowerCase() === e.toLocaleLowerCase());
|
|
1581
1604
|
}
|
|
1582
1605
|
const So = [1, 1, 1, 1, 1, 1, 1];
|
|
1583
|
-
function
|
|
1606
|
+
function le(e) {
|
|
1584
1607
|
return (e + 6) % 7;
|
|
1585
1608
|
}
|
|
1586
1609
|
function Lo(e) {
|
|
1587
1610
|
return (e + 1) % 7;
|
|
1588
1611
|
}
|
|
1589
|
-
function
|
|
1612
|
+
function me(e, a) {
|
|
1590
1613
|
e.splice(0, e.length, ...a);
|
|
1591
1614
|
}
|
|
1592
1615
|
function pn(e, a) {
|
|
1593
|
-
return
|
|
1616
|
+
return Ge(e, a) / 60;
|
|
1594
1617
|
}
|
|
1595
1618
|
function fn(e) {
|
|
1596
1619
|
var t;
|
|
1597
1620
|
const a = e.trim().split(/\s+/).filter(Boolean);
|
|
1598
1621
|
return a.length ? (a[0][0] + (((t = a[1]) == null ? void 0 : t[0]) ?? "")).toUpperCase() : "??";
|
|
1599
1622
|
}
|
|
1600
|
-
const
|
|
1623
|
+
const ta = /* @__PURE__ */ new Map(), Ee = /* @__PURE__ */ new Map();
|
|
1601
1624
|
function Io(e) {
|
|
1602
|
-
return
|
|
1625
|
+
return ta.get(e);
|
|
1603
1626
|
}
|
|
1604
1627
|
function hn(e) {
|
|
1605
|
-
const a =
|
|
1628
|
+
const a = Ee.get(e);
|
|
1606
1629
|
if (a !== void 0) return a;
|
|
1607
|
-
const t =
|
|
1608
|
-
return
|
|
1630
|
+
const t = Qe + Ee.size + 1;
|
|
1631
|
+
return Ee.set(e, t), ta.set(t, e), t;
|
|
1609
1632
|
}
|
|
1610
1633
|
function Ro(e) {
|
|
1611
1634
|
return e.sourceId || String(e.id);
|
|
1612
1635
|
}
|
|
1613
1636
|
function vn(e) {
|
|
1614
|
-
Na.name = (e == null ? void 0 : e.outlet.name) ?? "",
|
|
1637
|
+
Na.name = (e == null ? void 0 : e.outlet.name) ?? "", me(Pa, (e == null ? void 0 : e.positions.map((o) => o.name)) ?? []), me(K, (e == null ? void 0 : e.positions) ?? []);
|
|
1615
1638
|
const a = (e == null ? void 0 : e.restaurantProfile.operatingHours) ?? [], t = Array.from({ length: 7 }, () => []);
|
|
1616
|
-
for (const o of a) t[
|
|
1617
|
-
|
|
1639
|
+
for (const o of a) t[le(o.dayOfWeek)] = o.closed ? [] : o.hours;
|
|
1640
|
+
me(C.dayHours, t);
|
|
1618
1641
|
const n = a.filter((o) => !o.closed).flatMap((o) => o.hours);
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
a.filter((o) => o.closed).map((o) =>
|
|
1642
|
+
C.openFrom = n.length ? n.map((o) => o.start).reduce((o, u) => u < o ? u : o) : "00:00", C.openTo = n.length ? n.map((o) => o.end).reduce((o, u) => u > o ? u : o) : "24:00", me(
|
|
1643
|
+
C.closedWeekdays,
|
|
1644
|
+
a.filter((o) => o.closed).map((o) => le(o.dayOfWeek)).sort((o, u) => o - u)
|
|
1622
1645
|
);
|
|
1623
1646
|
const i = cn(yn.currentCountry.value), s = (e == null ? void 0 : e.settings.settingsConfigured) === !0, l = s ? e.settings.payRate : i.payRate;
|
|
1624
|
-
|
|
1647
|
+
C.otCapHours = s ? e.settings.overtime.maxHoursPerMonth : i.overtime.maxHoursPerMonth, C.workingHours = s ? e.settings.workingHours : {
|
|
1625
1648
|
minHoursPerDay: null,
|
|
1626
1649
|
maxHoursPerDay: i.workingHours.maxHoursPerDay,
|
|
1627
1650
|
maxHoursPerWeek: i.workingHours.maxHoursPerWeek
|
|
1628
|
-
},
|
|
1651
|
+
}, C.payRate.NORMAL.overtime = l.NORMAL.overtime, C.payRate.REST_DAY.regular = l.REST_DAY.regular, C.payRate.REST_DAY.overtime = l.REST_DAY.overtime, C.payRate.PUBLIC_HOLIDAY.regular = l.PUBLIC_HOLIDAY.regular, C.payRate.PUBLIC_HOLIDAY.overtime = l.PUBLIC_HOLIDAY.overtime;
|
|
1629
1652
|
}
|
|
1630
|
-
|
|
1631
|
-
function
|
|
1653
|
+
Ie(c, vn, { immediate: !0 });
|
|
1654
|
+
function ve(e) {
|
|
1632
1655
|
var a, t, n;
|
|
1633
1656
|
return {
|
|
1634
|
-
minHoursPerDay: ((a = e.workingHours) == null ? void 0 : a.minHoursPerDay) ??
|
|
1635
|
-
maxHoursPerDay: ((t = e.workingHours) == null ? void 0 : t.maxHoursPerDay) ??
|
|
1636
|
-
maxHoursPerWeek: ((n = e.workingHours) == null ? void 0 : n.maxHoursPerWeek) ??
|
|
1657
|
+
minHoursPerDay: ((a = e.workingHours) == null ? void 0 : a.minHoursPerDay) ?? C.workingHours.minHoursPerDay,
|
|
1658
|
+
maxHoursPerDay: ((t = e.workingHours) == null ? void 0 : t.maxHoursPerDay) ?? C.workingHours.maxHoursPerDay,
|
|
1659
|
+
maxHoursPerWeek: ((n = e.workingHours) == null ? void 0 : n.maxHoursPerWeek) ?? C.workingHours.maxHoursPerWeek
|
|
1637
1660
|
};
|
|
1638
1661
|
}
|
|
1639
|
-
function
|
|
1662
|
+
function gn(e) {
|
|
1640
1663
|
return e.reduce(
|
|
1641
1664
|
(a, t) => {
|
|
1642
|
-
const n =
|
|
1665
|
+
const n = ve(t).maxHoursPerWeek;
|
|
1643
1666
|
return t.employmentType === "FULLTIME" && n != null ? Math.max(a, n) : a;
|
|
1644
1667
|
},
|
|
1645
1668
|
0
|
|
1646
1669
|
);
|
|
1647
1670
|
}
|
|
1648
|
-
function
|
|
1671
|
+
function Dn(e, a) {
|
|
1649
1672
|
if (e.wage.type === "HOURLY") return e.wage.amount;
|
|
1650
|
-
const t =
|
|
1673
|
+
const t = ve(e).maxHoursPerWeek ?? a;
|
|
1651
1674
|
return t ? e.wage.amount / (t * (52 / 12)) : 0;
|
|
1652
1675
|
}
|
|
1653
|
-
function
|
|
1676
|
+
function wn(e, a) {
|
|
1654
1677
|
if (e.employmentType === "FULLTIME") return 100;
|
|
1655
|
-
const t =
|
|
1678
|
+
const t = ve(e).maxHoursPerWeek;
|
|
1656
1679
|
return !a || t == null ? 0 : Math.min(99, Math.round(t / a * 100));
|
|
1657
1680
|
}
|
|
1658
|
-
function
|
|
1681
|
+
function Hn(e) {
|
|
1659
1682
|
var a, t;
|
|
1660
1683
|
return {
|
|
1661
1684
|
start: e.startTime,
|
|
@@ -1669,7 +1692,7 @@ function wn(e) {
|
|
|
1669
1692
|
// Mongo distinguishes a draft from a published/confirmed assignment; the board's third
|
|
1670
1693
|
// state ('ot') is a costing outcome, never something stored.
|
|
1671
1694
|
status: e.status === "DRAFT" ? "pending" : "confirmed",
|
|
1672
|
-
breakMins:
|
|
1695
|
+
breakMins: je(e.breaks),
|
|
1673
1696
|
breaks: e.breaks,
|
|
1674
1697
|
// Carried through so an edit updates this same ScheduleShiftAssignments document instead of
|
|
1675
1698
|
// creating a duplicate — see useScheduleBoard's commitShift/persistSlot.
|
|
@@ -1705,87 +1728,97 @@ function bn(e) {
|
|
|
1705
1728
|
};
|
|
1706
1729
|
}
|
|
1707
1730
|
function Pn(e) {
|
|
1708
|
-
const a = ne[
|
|
1731
|
+
const a = ne[m.value];
|
|
1709
1732
|
return !a || !e.includes(a) ? e : [a, ...e.filter((t) => t !== a)];
|
|
1710
1733
|
}
|
|
1711
1734
|
function Nn(e) {
|
|
1712
1735
|
var n;
|
|
1713
|
-
const t = (
|
|
1736
|
+
const t = (Ze.value[e] ?? ((n = se.value.find((i) => i._id === e)) == null ? void 0 : n.restaurantRole.map((i) => i.restaurantId)) ?? []).map((i) => ne[i]).filter((i) => !!i);
|
|
1714
1737
|
return t.length ? Pn([...new Set(t)]) : void 0;
|
|
1715
1738
|
}
|
|
1716
1739
|
function Oo(e = []) {
|
|
1717
|
-
const a =
|
|
1740
|
+
const a = c.value;
|
|
1718
1741
|
if (!a) return [];
|
|
1719
1742
|
const t = new Map(a.employees.map((o) => [o.employeeId, o])), n = new Map(
|
|
1720
|
-
|
|
1721
|
-
), i =
|
|
1722
|
-
var
|
|
1723
|
-
return ((
|
|
1724
|
-
}).map((o) => t.get(o._id) ?? bn(o)), s =
|
|
1743
|
+
F.value.map((o) => [o.employeeId, o])
|
|
1744
|
+
), i = se.value.filter((o) => {
|
|
1745
|
+
var u;
|
|
1746
|
+
return ((u = n.get(o._id)) == null ? void 0 : u.enabled) !== !1;
|
|
1747
|
+
}).map((o) => t.get(o._id) ?? bn(o)), s = gn(i), l = /* @__PURE__ */ new Map();
|
|
1725
1748
|
for (const o of a.assignments) {
|
|
1726
|
-
const
|
|
1727
|
-
|
|
1749
|
+
const u = `${o.employeeId}|${o.date}`, h = l.get(u);
|
|
1750
|
+
h ? h.push(o) : l.set(u, [o]);
|
|
1728
1751
|
}
|
|
1729
1752
|
return i.map((o) => {
|
|
1730
|
-
var
|
|
1731
|
-
const
|
|
1732
|
-
|
|
1753
|
+
var ce;
|
|
1754
|
+
const u = se.value.find((g) => g._id === o.employeeId) ?? {
|
|
1755
|
+
code: void 0,
|
|
1756
|
+
passcode: "",
|
|
1757
|
+
isMasterUser: !1
|
|
1758
|
+
}, h = ve(o), E = hn(o.employeeId), T = new Set(K.map((g) => g.id)), Q = new Set(K.map((g) => g.name.toLocaleLowerCase())), p = (g) => g.positionId ? T.has(g.positionId) : Q.has(g.positionName.toLocaleLowerCase()), H = (ce = o.primaryPosition) == null ? void 0 : ce.positionName, L = !!o.primaryPosition && p(o.primaryPosition), I = o.secondaryPositions.filter(p).map((g) => g.positionName), X = H ? L ? [H, ...I] : [] : I, J = [
|
|
1759
|
+
...H && !L ? [H] : [],
|
|
1733
1760
|
...o.secondaryPositions.filter((g) => !p(g)).map((g) => g.positionName)
|
|
1734
|
-
],
|
|
1735
|
-
const
|
|
1736
|
-
if (
|
|
1737
|
-
const
|
|
1738
|
-
return
|
|
1739
|
-
}),
|
|
1761
|
+
], x = X[0] ?? "", M = e.map((g) => {
|
|
1762
|
+
const b = ie(g), D = (a.timeOff ?? []).filter((P) => P.employeeId === o.employeeId).map((P) => En(P, b)).find((P) => P !== null);
|
|
1763
|
+
if (D) return D;
|
|
1764
|
+
const _ = (l.get(`${o.employeeId}|${b}`) ?? []).filter((P) => P.startTime && P.endTime).map((P) => Hn(P)).sort((P, ge) => P.start.localeCompare(ge.start));
|
|
1765
|
+
return _.length ? _.length === 1 ? _[0] : _ : null;
|
|
1766
|
+
}), Z = o.availability.length > 0, ue = Array.from(
|
|
1740
1767
|
{ length: 7 },
|
|
1741
|
-
(g,
|
|
1742
|
-
),
|
|
1743
|
-
const
|
|
1744
|
-
return { from: (
|
|
1768
|
+
(g, b) => Z ? o.availability.some((D) => le(D.dayOfWeek) === b) : !0
|
|
1769
|
+
), de = Array.from({ length: 7 }, (g, b) => {
|
|
1770
|
+
const D = o.availability.find((B) => le(B.dayOfWeek) === b);
|
|
1771
|
+
return { from: (D == null ? void 0 : D.start) ?? "", to: (D == null ? void 0 : D.end) ?? "" };
|
|
1745
1772
|
});
|
|
1746
1773
|
return {
|
|
1747
|
-
id:
|
|
1774
|
+
id: E,
|
|
1748
1775
|
sourceId: o.employeeId,
|
|
1749
1776
|
name: o.name,
|
|
1777
|
+
// POS access belongs to the POS roster, not the scheduling profile. Keep these
|
|
1778
|
+
// fields on the board employee so the edit form can initialise its access section
|
|
1779
|
+
// from the employee's existing POS account.
|
|
1780
|
+
passcode: u.passcode || void 0,
|
|
1781
|
+
code: u.code,
|
|
1782
|
+
masterUser: u.isMasterUser,
|
|
1750
1783
|
employmentType: o.employmentType,
|
|
1751
|
-
role:
|
|
1784
|
+
role: x,
|
|
1752
1785
|
initials: fn(o.name),
|
|
1753
|
-
color:
|
|
1786
|
+
color: Ue[(E - Qe - 1) % Ue.length],
|
|
1754
1787
|
// Gross hours actually rostered this week — the figure the cost rail multiplies by
|
|
1755
1788
|
// the rate. Contracted hours are a separate question, answered by RULES.contract.
|
|
1756
1789
|
// Rounded to one decimal — `hoursBetween` divides by 60, so an unrounded sum reads
|
|
1757
1790
|
// as a long, meaningless float (e.g. 31.983333333333334) everywhere this is shown
|
|
1758
1791
|
// verbatim, matching the rounding `employeeLoadOf`'s own hours figure already uses.
|
|
1759
1792
|
weekHours: Math.round(
|
|
1760
|
-
|
|
1761
|
-
(g,
|
|
1762
|
-
(
|
|
1793
|
+
M.reduce(
|
|
1794
|
+
(g, b) => g + (Array.isArray(b) ? b : b && "start" in b ? [b] : []).reduce(
|
|
1795
|
+
(D, B) => D + pn(B.start, B.end),
|
|
1763
1796
|
0
|
|
1764
1797
|
),
|
|
1765
1798
|
0
|
|
1766
1799
|
) * 10
|
|
1767
1800
|
) / 10,
|
|
1768
|
-
pct:
|
|
1769
|
-
contractHours:
|
|
1770
|
-
minHoursPerDay:
|
|
1801
|
+
pct: wn(o, s),
|
|
1802
|
+
contractHours: h.maxHoursPerWeek ?? void 0,
|
|
1803
|
+
minHoursPerDay: h.minHoursPerDay ?? void 0,
|
|
1771
1804
|
// Keep the persisted override shape here. Consumers that need the effective value use
|
|
1772
1805
|
// effectiveWorkingHours(), so an inherited null remains distinguishable from an override.
|
|
1773
1806
|
workingHours: o.workingHours,
|
|
1774
1807
|
// Every outlet the POS says this person works at, not just this one — the Add / Edit form
|
|
1775
1808
|
// shows them, and saving keeps them.
|
|
1776
1809
|
locations: Nn(o.employeeId),
|
|
1777
|
-
rate:
|
|
1778
|
-
positions:
|
|
1779
|
-
archivedPositions:
|
|
1780
|
-
shifts:
|
|
1810
|
+
rate: Dn(o, s),
|
|
1811
|
+
positions: X,
|
|
1812
|
+
archivedPositions: J.length ? J : void 0,
|
|
1813
|
+
shifts: M,
|
|
1781
1814
|
// Remarks live in their own collection in the older scheduling design and are not
|
|
1782
1815
|
// part of this board's payload yet.
|
|
1783
1816
|
remarks: [],
|
|
1784
|
-
section:
|
|
1817
|
+
section: aa,
|
|
1785
1818
|
payBasis: o.wage.type === "HOURLY" ? "hourly" : "monthly",
|
|
1786
1819
|
payAmount: o.wage.amount,
|
|
1787
|
-
availDays:
|
|
1788
|
-
availHours:
|
|
1820
|
+
availDays: ue,
|
|
1821
|
+
availHours: de
|
|
1789
1822
|
};
|
|
1790
1823
|
});
|
|
1791
1824
|
}
|
|
@@ -1794,11 +1827,11 @@ function To() {
|
|
|
1794
1827
|
}
|
|
1795
1828
|
function $o() {
|
|
1796
1829
|
var n, i;
|
|
1797
|
-
const e =
|
|
1830
|
+
const e = c.value, a = {}, t = {};
|
|
1798
1831
|
for (const s of (e == null ? void 0 : e.demands) ?? []) {
|
|
1799
|
-
const l = s.date ? a[n = s.date] ?? (a[n] = []) : s.dayOfWeek !== null ? t[i =
|
|
1832
|
+
const l = s.date ? a[n = s.date] ?? (a[n] = []) : s.dayOfWeek !== null ? t[i = le(s.dayOfWeek)] ?? (t[i] = []) : null;
|
|
1800
1833
|
if (!l) continue;
|
|
1801
|
-
let o = l.find((
|
|
1834
|
+
let o = l.find((u) => u.from === s.startTime && u.to === s.endTime);
|
|
1802
1835
|
o || (o = { from: s.startTime, to: s.endTime, n: 0, roles: [] }, l.push(o)), o.n += s.headcount, s.position && o.roles.push({
|
|
1803
1836
|
position: s.position.positionName,
|
|
1804
1837
|
positionId: s.position.positionId || void 0,
|
|
@@ -1808,29 +1841,32 @@ function $o() {
|
|
|
1808
1841
|
return { byDate: a, byWeekday: t };
|
|
1809
1842
|
}
|
|
1810
1843
|
function Yo() {
|
|
1811
|
-
const e =
|
|
1812
|
-
() => [...a.value].map((p) => ({ value: p._id, label: p.profile.name })).sort((p,
|
|
1813
|
-
), o =
|
|
1844
|
+
const e = Ve(), { restaurants: a, readRestaurants: t } = wa(), n = ga(), i = Da(), s = A(!1), l = $(
|
|
1845
|
+
() => [...a.value].map((p) => ({ value: p._id, label: p.profile.name })).sort((p, H) => p.label.localeCompare(H.label))
|
|
1846
|
+
), o = () => {
|
|
1847
|
+
var p;
|
|
1848
|
+
return `hrm-schedule-outlet:${((p = e.currentBusiness.value) == null ? void 0 : p._id) ?? ""}`;
|
|
1849
|
+
}, u = $(() => {
|
|
1814
1850
|
var p;
|
|
1815
1851
|
return ((p = e.currentRestaurant.value) == null ? void 0 : p._id) ?? "";
|
|
1816
1852
|
});
|
|
1817
|
-
async function
|
|
1818
|
-
return
|
|
1853
|
+
async function h(p, H) {
|
|
1854
|
+
return Be(p) ? (localStorage.setItem(o(), p), n.query.restaurantId !== p && i.replace({ query: { ...n.query, restaurantId: p } }), await Promise.all([Me(p), Oa(H)]), !0) : !1;
|
|
1819
1855
|
}
|
|
1820
|
-
const
|
|
1821
|
-
async function
|
|
1822
|
-
var
|
|
1823
|
-
await t(),
|
|
1824
|
-
const p =
|
|
1825
|
-
return
|
|
1856
|
+
const E = (p) => !!p && l.value.some((H) => H.value === p);
|
|
1857
|
+
async function T() {
|
|
1858
|
+
var L;
|
|
1859
|
+
await t(), xe.splice(0, xe.length, ...l.value.map((I) => I.label)), Object.keys(ne).forEach((I) => delete ne[I]), l.value.forEach((I) => ne[I.value] = I.label);
|
|
1860
|
+
const p = localStorage.getItem(o()) ?? "", H = [m.value, p, u.value].find(E) ?? ((L = l.value[0]) == null ? void 0 : L.value) ?? "";
|
|
1861
|
+
return H && Be(H), s.value = !0, H;
|
|
1826
1862
|
}
|
|
1827
|
-
async function
|
|
1828
|
-
const p = await
|
|
1829
|
-
return p && await
|
|
1863
|
+
async function Q() {
|
|
1864
|
+
const p = await T();
|
|
1865
|
+
return p && await Me(p), p;
|
|
1830
1866
|
}
|
|
1831
|
-
return { options: l, ready: s, outletId:
|
|
1867
|
+
return { options: l, ready: s, outletId: m, resolve: Q, resolveOutlet: T, switchTo: h };
|
|
1832
1868
|
}
|
|
1833
|
-
const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */
|
|
1869
|
+
const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Re({
|
|
1834
1870
|
__name: "ScheduleButton",
|
|
1835
1871
|
props: {
|
|
1836
1872
|
hierarchy: { default: "primary" },
|
|
@@ -1838,14 +1874,14 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Le
|
|
|
1838
1874
|
iconOnly: { type: Boolean, default: !1 }
|
|
1839
1875
|
},
|
|
1840
1876
|
setup(e) {
|
|
1841
|
-
return (a, t) => (
|
|
1877
|
+
return (a, t) => (N(), k("button", {
|
|
1842
1878
|
type: "button",
|
|
1843
1879
|
class: "sch-button",
|
|
1844
1880
|
"data-hierarchy": e.hierarchy,
|
|
1845
1881
|
"data-size": e.size,
|
|
1846
1882
|
"data-icon": e.iconOnly ? "only" : void 0
|
|
1847
1883
|
}, [
|
|
1848
|
-
|
|
1884
|
+
ze(a.$slots, "default")
|
|
1849
1885
|
], 8, kn));
|
|
1850
1886
|
}
|
|
1851
1887
|
}), Cn = ["disabled", "aria-expanded"], Mn = { class: "sch" }, Sn = ["aria-multiselectable"], Ln = {
|
|
@@ -1863,7 +1899,7 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Le
|
|
|
1863
1899
|
}, Tn = ["aria-selected", "onClick"], $n = {
|
|
1864
1900
|
key: 0,
|
|
1865
1901
|
class: "fx-opt-text"
|
|
1866
|
-
}, Yn = { key: 0 }, Bo = /* @__PURE__ */
|
|
1902
|
+
}, Yn = { key: 0 }, Bo = /* @__PURE__ */ Re({
|
|
1867
1903
|
inheritAttrs: !1,
|
|
1868
1904
|
__name: "ScheduleSelect",
|
|
1869
1905
|
props: {
|
|
@@ -1881,202 +1917,202 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Le
|
|
|
1881
1917
|
},
|
|
1882
1918
|
emits: ["update:modelValue", "toggle"],
|
|
1883
1919
|
setup(e, { emit: a }) {
|
|
1884
|
-
const t = e, n = a, i =
|
|
1885
|
-
|
|
1920
|
+
const t = e, n = a, i = la(), s = $(() => i.class ?? ""), l = A(!1), o = A(!1), u = A(null), h = A(null), E = A(null), T = $(() => t.teleport !== !1 && o.value);
|
|
1921
|
+
Se(() => {
|
|
1886
1922
|
o.value = typeof document < "u" && !!document.body;
|
|
1887
1923
|
});
|
|
1888
|
-
const
|
|
1889
|
-
var r,
|
|
1924
|
+
const Q = $(() => {
|
|
1925
|
+
var r, y;
|
|
1890
1926
|
if (!t.multiple && t.selectedLabel != null) return t.selectedLabel;
|
|
1891
1927
|
if (t.multiple) {
|
|
1892
|
-
const
|
|
1893
|
-
return
|
|
1928
|
+
const d = ((r = t.selected) == null ? void 0 : r.length) ?? 0;
|
|
1929
|
+
return d ? `${d} selected` : t.placeholder ?? "";
|
|
1894
1930
|
}
|
|
1895
|
-
return ((
|
|
1931
|
+
return ((y = t.options.find((d) => d.value === t.modelValue)) == null ? void 0 : y.label) ?? "";
|
|
1896
1932
|
});
|
|
1897
|
-
function
|
|
1898
|
-
var
|
|
1899
|
-
return t.multiple ? !!((
|
|
1933
|
+
function p(r) {
|
|
1934
|
+
var y;
|
|
1935
|
+
return t.multiple ? !!((y = t.selected) != null && y.includes(r.value)) : t.selectedId != null ? r.id === t.selectedId : r.value === t.modelValue;
|
|
1900
1936
|
}
|
|
1901
|
-
const
|
|
1902
|
-
const r =
|
|
1903
|
-
return !t.searchable || !r ? t.options : t.options.filter((
|
|
1904
|
-
}),
|
|
1937
|
+
const H = $(() => !!t.menuTitle || t.options.some((r) => r.hint)), L = A(""), I = A(null), X = $(() => {
|
|
1938
|
+
const r = L.value.trim().toLowerCase();
|
|
1939
|
+
return !t.searchable || !r ? t.options : t.options.filter((y) => `${y.label} ${y.hint ?? ""}`.toLowerCase().includes(r));
|
|
1940
|
+
}), J = $(() => {
|
|
1905
1941
|
const r = [];
|
|
1906
|
-
let
|
|
1907
|
-
for (const
|
|
1908
|
-
|
|
1942
|
+
let y;
|
|
1943
|
+
for (const d of X.value)
|
|
1944
|
+
d.group !== y && (y = d.group, y && r.push({ heading: y })), r.push({ option: d });
|
|
1909
1945
|
return r;
|
|
1910
|
-
}), x = 5,
|
|
1911
|
-
function
|
|
1912
|
-
const r =
|
|
1913
|
-
if (!r || !
|
|
1914
|
-
const
|
|
1915
|
-
r.style.minWidth = `${Math.round(
|
|
1916
|
-
const
|
|
1917
|
-
r.style.maxHeight = `${Math.max(120, Math.min(320, Math.max(
|
|
1918
|
-
const
|
|
1919
|
-
let
|
|
1920
|
-
|
|
1921
|
-
const
|
|
1922
|
-
r.style.top = `${Math.round(
|
|
1946
|
+
}), x = 5, M = 8;
|
|
1947
|
+
function Z() {
|
|
1948
|
+
const r = E.value, y = h.value;
|
|
1949
|
+
if (!r || !y) return;
|
|
1950
|
+
const d = y.getBoundingClientRect(), S = window.innerWidth || document.documentElement.clientWidth, O = window.innerHeight || document.documentElement.clientHeight;
|
|
1951
|
+
r.style.minWidth = `${Math.round(d.width)}px`, r.style.maxWidth = `${Math.max(180, Math.round(S - M * 2))}px`;
|
|
1952
|
+
const q = O - d.bottom - x - M, sa = d.top - x - M;
|
|
1953
|
+
r.style.maxHeight = `${Math.max(120, Math.min(320, Math.max(q, sa)))}px`;
|
|
1954
|
+
const ye = r.offsetHeight, ia = r.offsetWidth;
|
|
1955
|
+
let De = d.bottom + x;
|
|
1956
|
+
De + ye > O - M && (De = d.top - x - ye >= M ? d.top - x - ye : Math.max(M, O - ye - M));
|
|
1957
|
+
const ra = Math.min(Math.max(M, d.left), Math.max(M, S - ia - M));
|
|
1958
|
+
r.style.top = `${Math.round(De)}px`, r.style.left = `${Math.round(ra)}px`, r.style.visibility = "visible";
|
|
1923
1959
|
}
|
|
1924
|
-
function
|
|
1925
|
-
var
|
|
1926
|
-
const
|
|
1927
|
-
|
|
1960
|
+
function ue(r) {
|
|
1961
|
+
var d, S;
|
|
1962
|
+
const y = r.target;
|
|
1963
|
+
y && ((d = u.value) != null && d.contains(y) || (S = E.value) != null && S.contains(y)) || D();
|
|
1928
1964
|
}
|
|
1929
|
-
function
|
|
1930
|
-
const
|
|
1931
|
-
if (
|
|
1932
|
-
const S =
|
|
1965
|
+
function de(r) {
|
|
1966
|
+
const y = E.value, d = r.target;
|
|
1967
|
+
if (y && d && d !== document && y.contains(d)) return;
|
|
1968
|
+
const S = h.value;
|
|
1933
1969
|
if (!S) return;
|
|
1934
|
-
const O = S.getBoundingClientRect(),
|
|
1935
|
-
if (O.bottom < 0 || O.top >
|
|
1936
|
-
|
|
1970
|
+
const O = S.getBoundingClientRect(), q = window.innerHeight || document.documentElement.clientHeight;
|
|
1971
|
+
if (O.bottom < 0 || O.top > q) {
|
|
1972
|
+
D();
|
|
1937
1973
|
return;
|
|
1938
1974
|
}
|
|
1939
|
-
|
|
1975
|
+
Z();
|
|
1940
1976
|
}
|
|
1941
|
-
function
|
|
1942
|
-
document.addEventListener("click",
|
|
1977
|
+
function ce() {
|
|
1978
|
+
document.addEventListener("click", ue), document.addEventListener("scroll", de, !0), window.addEventListener("resize", D);
|
|
1943
1979
|
}
|
|
1944
|
-
function
|
|
1945
|
-
document.removeEventListener("click",
|
|
1980
|
+
function g() {
|
|
1981
|
+
document.removeEventListener("click", ue), document.removeEventListener("scroll", de, !0), window.removeEventListener("resize", D);
|
|
1946
1982
|
}
|
|
1947
|
-
async function
|
|
1948
|
-
var r,
|
|
1949
|
-
t.disabled || l.value || (
|
|
1983
|
+
async function b() {
|
|
1984
|
+
var r, y, d;
|
|
1985
|
+
t.disabled || l.value || (L.value = "", l.value = !0, await be(), Z(), (r = I.value) == null || r.focus(), (d = (y = E.value) == null ? void 0 : y.querySelector(".fx-opt.is-on")) == null || d.scrollIntoView({ block: "nearest" }), ce());
|
|
1950
1986
|
}
|
|
1951
|
-
function
|
|
1952
|
-
l.value && (l.value = !1,
|
|
1987
|
+
function D() {
|
|
1988
|
+
l.value && (l.value = !1, L.value = "", g());
|
|
1953
1989
|
}
|
|
1954
|
-
|
|
1955
|
-
l.value && (await
|
|
1990
|
+
Ie(L, async () => {
|
|
1991
|
+
l.value && (await be(), Z());
|
|
1956
1992
|
});
|
|
1957
|
-
function
|
|
1958
|
-
var
|
|
1993
|
+
function B(r) {
|
|
1994
|
+
var y;
|
|
1959
1995
|
if (r.key === "Escape")
|
|
1960
|
-
r.preventDefault(),
|
|
1996
|
+
r.preventDefault(), D(), (y = h.value) == null || y.focus();
|
|
1961
1997
|
else if (r.key === "Enter") {
|
|
1962
1998
|
r.preventDefault();
|
|
1963
|
-
const
|
|
1964
|
-
|
|
1999
|
+
const d = X.value.find((S) => !S.disabled);
|
|
2000
|
+
d && P(d);
|
|
1965
2001
|
}
|
|
1966
2002
|
}
|
|
1967
|
-
function
|
|
1968
|
-
l.value ?
|
|
2003
|
+
function _() {
|
|
2004
|
+
l.value ? D() : b();
|
|
1969
2005
|
}
|
|
1970
|
-
function
|
|
2006
|
+
function P(r) {
|
|
1971
2007
|
if (!r.disabled) {
|
|
1972
2008
|
if (t.multiple && !r.command) {
|
|
1973
2009
|
n("toggle", r.value);
|
|
1974
2010
|
return;
|
|
1975
2011
|
}
|
|
1976
|
-
if (
|
|
2012
|
+
if (D(), t.multiple) {
|
|
1977
2013
|
n("update:modelValue", r.value);
|
|
1978
2014
|
return;
|
|
1979
2015
|
}
|
|
1980
2016
|
r.value !== t.modelValue && n("update:modelValue", r.value);
|
|
1981
2017
|
}
|
|
1982
2018
|
}
|
|
1983
|
-
const
|
|
1984
|
-
function
|
|
1985
|
-
const
|
|
1986
|
-
if (t.multiple || !
|
|
1987
|
-
|
|
2019
|
+
const ge = $(() => t.options.filter((r) => !r.disabled));
|
|
2020
|
+
function na(r) {
|
|
2021
|
+
const y = ge.value;
|
|
2022
|
+
if (t.multiple || !y.length) {
|
|
2023
|
+
b();
|
|
1988
2024
|
return;
|
|
1989
2025
|
}
|
|
1990
|
-
const
|
|
1991
|
-
O && O.value !== t.modelValue ? n("update:modelValue", O.value) :
|
|
2026
|
+
const d = y.findIndex((q) => q.value === t.modelValue), S = r === "Home" ? 0 : r === "End" ? y.length - 1 : r === "ArrowDown" ? Math.min(y.length - 1, (d < 0 ? -1 : d) + 1) : Math.max(0, (d < 0 ? 1 : d) - 1), O = y[S];
|
|
2027
|
+
O && O.value !== t.modelValue ? n("update:modelValue", O.value) : b();
|
|
1992
2028
|
}
|
|
1993
|
-
function
|
|
1994
|
-
var
|
|
2029
|
+
function oa(r) {
|
|
2030
|
+
var y;
|
|
1995
2031
|
if (r.key === "Escape") {
|
|
1996
2032
|
if (!l.value) return;
|
|
1997
|
-
r.preventDefault(),
|
|
2033
|
+
r.preventDefault(), D(), (y = h.value) == null || y.focus();
|
|
1998
2034
|
return;
|
|
1999
2035
|
}
|
|
2000
2036
|
if (r.key === "Enter" || r.key === " ") {
|
|
2001
|
-
r.preventDefault(),
|
|
2037
|
+
r.preventDefault(), _();
|
|
2002
2038
|
return;
|
|
2003
2039
|
}
|
|
2004
|
-
r.key !== "ArrowDown" && r.key !== "ArrowUp" && r.key !== "Home" && r.key !== "End" || (r.preventDefault(),
|
|
2040
|
+
r.key !== "ArrowDown" && r.key !== "ArrowUp" && r.key !== "Home" && r.key !== "End" || (r.preventDefault(), na(r.key));
|
|
2005
2041
|
}
|
|
2006
|
-
return
|
|
2042
|
+
return Le(g), (r, y) => (N(), k("div", {
|
|
2007
2043
|
ref_key: "rootEl",
|
|
2008
|
-
ref:
|
|
2009
|
-
class:
|
|
2044
|
+
ref: u,
|
|
2045
|
+
class: pe(["fx-sel", s.value])
|
|
2010
2046
|
}, [
|
|
2011
|
-
|
|
2047
|
+
Y("button", da({
|
|
2012
2048
|
ref_key: "btnEl",
|
|
2013
|
-
ref:
|
|
2049
|
+
ref: h
|
|
2014
2050
|
}, r.$attrs, {
|
|
2015
2051
|
type: "button",
|
|
2016
2052
|
class: ["sch-input fx-btn", { "is-open": l.value }],
|
|
2017
2053
|
disabled: e.disabled,
|
|
2018
2054
|
"aria-haspopup": "listbox",
|
|
2019
2055
|
"aria-expanded": l.value,
|
|
2020
|
-
onClick:
|
|
2021
|
-
onKeydown:
|
|
2022
|
-
}), U(
|
|
2023
|
-
(
|
|
2056
|
+
onClick: y[0] || (y[0] = (d) => _()),
|
|
2057
|
+
onKeydown: oa
|
|
2058
|
+
}), U(Q.value), 17, Cn),
|
|
2059
|
+
(N(), ua(ca, {
|
|
2024
2060
|
to: "body",
|
|
2025
|
-
disabled: !
|
|
2061
|
+
disabled: !T.value
|
|
2026
2062
|
}, [
|
|
2027
|
-
|
|
2028
|
-
l.value ? (
|
|
2063
|
+
Y("div", Mn, [
|
|
2064
|
+
l.value ? (N(), k("div", {
|
|
2029
2065
|
key: 0,
|
|
2030
2066
|
ref_key: "popEl",
|
|
2031
|
-
ref:
|
|
2032
|
-
class:
|
|
2067
|
+
ref: E,
|
|
2068
|
+
class: pe(["fx-pop", { "fx-pop-rich": H.value }]),
|
|
2033
2069
|
role: "listbox",
|
|
2034
2070
|
"aria-multiselectable": e.multiple || void 0,
|
|
2035
2071
|
style: { visibility: "hidden" }
|
|
2036
2072
|
}, [
|
|
2037
|
-
e.menuTitle ? (
|
|
2038
|
-
e.searchable ? (
|
|
2039
|
-
|
|
2073
|
+
e.menuTitle ? (N(), k("div", Ln, U(e.menuTitle), 1)) : W("", !0),
|
|
2074
|
+
e.searchable ? (N(), k("div", In, [
|
|
2075
|
+
ya(Y("input", {
|
|
2040
2076
|
ref_key: "searchEl",
|
|
2041
|
-
ref:
|
|
2042
|
-
"onUpdate:modelValue":
|
|
2077
|
+
ref: I,
|
|
2078
|
+
"onUpdate:modelValue": y[1] || (y[1] = (d) => L.value = d),
|
|
2043
2079
|
class: "sch-input fx-pop-q",
|
|
2044
2080
|
type: "search",
|
|
2045
2081
|
placeholder: "Search",
|
|
2046
2082
|
autocomplete: "off",
|
|
2047
2083
|
spellcheck: "false",
|
|
2048
2084
|
"aria-label": "Search",
|
|
2049
|
-
onKeydown:
|
|
2085
|
+
onKeydown: B
|
|
2050
2086
|
}, null, 544), [
|
|
2051
|
-
[
|
|
2087
|
+
[ma, L.value]
|
|
2052
2088
|
])
|
|
2053
2089
|
])) : W("", !0),
|
|
2054
|
-
e.searchable && !
|
|
2055
|
-
(
|
|
2056
|
-
key: "heading" in
|
|
2090
|
+
e.searchable && !J.value.length ? (N(), k("div", Rn, "No matches")) : W("", !0),
|
|
2091
|
+
(N(!0), k(He, null, pa(J.value, (d) => (N(), k(He, {
|
|
2092
|
+
key: "heading" in d ? `heading:${d.heading}` : `option:${d.option.value}`
|
|
2057
2093
|
}, [
|
|
2058
|
-
"heading" in
|
|
2094
|
+
"heading" in d ? (N(), k("div", On, U(d.heading), 1)) : (N(), k("div", {
|
|
2059
2095
|
key: 1,
|
|
2060
|
-
class:
|
|
2061
|
-
"is-on":
|
|
2062
|
-
"is-off":
|
|
2063
|
-
"is-new":
|
|
2096
|
+
class: pe(["fx-opt", {
|
|
2097
|
+
"is-on": p(d.option),
|
|
2098
|
+
"is-off": d.option.disabled,
|
|
2099
|
+
"is-new": d.option.command
|
|
2064
2100
|
}]),
|
|
2065
2101
|
role: "option",
|
|
2066
|
-
"aria-selected":
|
|
2067
|
-
onClick: (S) =>
|
|
2102
|
+
"aria-selected": p(d.option),
|
|
2103
|
+
onClick: (S) => P(d.option)
|
|
2068
2104
|
}, [
|
|
2069
|
-
|
|
2105
|
+
y[2] || (y[2] = Y("span", {
|
|
2070
2106
|
class: "fx-tick",
|
|
2071
2107
|
"aria-hidden": "true"
|
|
2072
2108
|
}, [
|
|
2073
|
-
|
|
2109
|
+
Y("svg", {
|
|
2074
2110
|
width: "11",
|
|
2075
2111
|
height: "11",
|
|
2076
2112
|
viewBox: "0 0 16 16",
|
|
2077
2113
|
fill: "none"
|
|
2078
2114
|
}, [
|
|
2079
|
-
|
|
2115
|
+
Y("path", {
|
|
2080
2116
|
d: "m3.5 8.4 3 3 6-7",
|
|
2081
2117
|
stroke: "currentColor",
|
|
2082
2118
|
"stroke-width": "2.2",
|
|
@@ -2085,11 +2121,11 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Le
|
|
|
2085
2121
|
})
|
|
2086
2122
|
])
|
|
2087
2123
|
], -1)),
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
])) : (
|
|
2092
|
-
|
|
2124
|
+
H.value ? (N(), k("span", $n, [
|
|
2125
|
+
Y("b", null, U(d.option.label), 1),
|
|
2126
|
+
d.option.hint ? (N(), k("small", Yn, U(d.option.hint), 1)) : W("", !0)
|
|
2127
|
+
])) : (N(), k(He, { key: 1 }, [
|
|
2128
|
+
fa(U(d.option.label), 1)
|
|
2093
2129
|
], 64))
|
|
2094
2130
|
], 10, Tn))
|
|
2095
2131
|
], 64))), 128))
|
|
@@ -2098,7 +2134,7 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Le
|
|
|
2098
2134
|
], 8, ["disabled"]))
|
|
2099
2135
|
], 2));
|
|
2100
2136
|
}
|
|
2101
|
-
}), xn = ["id", "aria-labelledby", "aria-label"],
|
|
2137
|
+
}), xn = ["id", "aria-labelledby", "aria-label"], We = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])', _o = /* @__PURE__ */ Re({
|
|
2102
2138
|
__name: "ScheduleModal",
|
|
2103
2139
|
props: {
|
|
2104
2140
|
open: { type: Boolean },
|
|
@@ -2110,52 +2146,52 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Le
|
|
|
2110
2146
|
},
|
|
2111
2147
|
emits: ["close"],
|
|
2112
2148
|
setup(e, { emit: a }) {
|
|
2113
|
-
const t = e, n = a, i =
|
|
2149
|
+
const t = e, n = a, i = A(null);
|
|
2114
2150
|
let s = null;
|
|
2115
2151
|
function l() {
|
|
2116
|
-
|
|
2117
|
-
const
|
|
2118
|
-
|
|
2152
|
+
be(() => {
|
|
2153
|
+
const u = i.value;
|
|
2154
|
+
u && (u.querySelector(We) ?? u).focus();
|
|
2119
2155
|
});
|
|
2120
2156
|
}
|
|
2121
|
-
function o(
|
|
2157
|
+
function o(u) {
|
|
2122
2158
|
if (!t.open) return;
|
|
2123
|
-
if (
|
|
2124
|
-
|
|
2159
|
+
if (u.key === "Escape") {
|
|
2160
|
+
u.preventDefault(), n("close");
|
|
2125
2161
|
return;
|
|
2126
2162
|
}
|
|
2127
|
-
if (
|
|
2128
|
-
const
|
|
2129
|
-
if (!
|
|
2130
|
-
const
|
|
2131
|
-
|
|
2163
|
+
if (u.key !== "Tab" || !i.value) return;
|
|
2164
|
+
const h = Array.from(i.value.querySelectorAll(We));
|
|
2165
|
+
if (!h.length) return;
|
|
2166
|
+
const E = h[0], T = h[h.length - 1];
|
|
2167
|
+
u.shiftKey && document.activeElement === E ? (u.preventDefault(), T.focus()) : !u.shiftKey && document.activeElement === T && (u.preventDefault(), E.focus());
|
|
2132
2168
|
}
|
|
2133
|
-
return
|
|
2169
|
+
return Ie(
|
|
2134
2170
|
() => t.open,
|
|
2135
|
-
(
|
|
2136
|
-
|
|
2171
|
+
(u) => {
|
|
2172
|
+
u ? (s = document.activeElement instanceof HTMLElement ? document.activeElement : null, l()) : (s == null || s.focus(), s = null);
|
|
2137
2173
|
},
|
|
2138
2174
|
{ immediate: !0 }
|
|
2139
|
-
),
|
|
2175
|
+
), Se(() => document.addEventListener("keydown", o)), Le(() => {
|
|
2140
2176
|
document.removeEventListener("keydown", o), s = null;
|
|
2141
|
-
}), (
|
|
2177
|
+
}), (u, h) => e.open ? (N(), k("div", {
|
|
2142
2178
|
key: 0,
|
|
2143
2179
|
class: "modal-overlay open",
|
|
2144
|
-
onClick:
|
|
2180
|
+
onClick: h[0] || (h[0] = ha((E) => n("close"), ["self"]))
|
|
2145
2181
|
}, [
|
|
2146
|
-
|
|
2182
|
+
Y("div", {
|
|
2147
2183
|
id: e.id,
|
|
2148
2184
|
ref_key: "panel",
|
|
2149
2185
|
ref: i,
|
|
2150
|
-
class:
|
|
2151
|
-
style:
|
|
2186
|
+
class: pe(["schedule-modal-panel", e.panelClass]),
|
|
2187
|
+
style: va(e.panelStyle),
|
|
2152
2188
|
role: "dialog",
|
|
2153
2189
|
"aria-modal": "true",
|
|
2154
2190
|
"aria-labelledby": e.labelledBy,
|
|
2155
2191
|
"aria-label": e.label,
|
|
2156
2192
|
tabindex: "-1"
|
|
2157
2193
|
}, [
|
|
2158
|
-
|
|
2194
|
+
ze(u.$slots, "default")
|
|
2159
2195
|
], 14, xn)
|
|
2160
2196
|
])) : W("", !0);
|
|
2161
2197
|
}
|
|
@@ -2163,40 +2199,40 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Le
|
|
|
2163
2199
|
export {
|
|
2164
2200
|
no as $,
|
|
2165
2201
|
No as A,
|
|
2166
|
-
|
|
2167
|
-
|
|
2202
|
+
Ne as B,
|
|
2203
|
+
Xn as C,
|
|
2168
2204
|
Ea as D,
|
|
2169
|
-
|
|
2205
|
+
Zn as E,
|
|
2170
2206
|
ro as F,
|
|
2171
2207
|
Mo as G,
|
|
2172
|
-
|
|
2208
|
+
Ha as H,
|
|
2173
2209
|
Ao as I,
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2210
|
+
Ho as J,
|
|
2211
|
+
wo as K,
|
|
2212
|
+
Je as L,
|
|
2213
|
+
w as M,
|
|
2214
|
+
F as N,
|
|
2179
2215
|
Sa as O,
|
|
2180
2216
|
Pa as P,
|
|
2181
|
-
|
|
2182
|
-
|
|
2217
|
+
xe as Q,
|
|
2218
|
+
Qn as R,
|
|
2183
2219
|
ko as S,
|
|
2184
2220
|
Lo as T,
|
|
2185
|
-
|
|
2186
|
-
|
|
2221
|
+
aa as U,
|
|
2222
|
+
Jn as V,
|
|
2187
2223
|
Po as W,
|
|
2188
|
-
|
|
2224
|
+
le as X,
|
|
2189
2225
|
Pn as Y,
|
|
2190
|
-
|
|
2226
|
+
re as Z,
|
|
2191
2227
|
ne as _,
|
|
2192
2228
|
Oo as a,
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2229
|
+
so as a0,
|
|
2230
|
+
Oe as a1,
|
|
2231
|
+
to as a2,
|
|
2232
|
+
ao as a3,
|
|
2197
2233
|
io as a4,
|
|
2198
2234
|
hn as a5,
|
|
2199
|
-
|
|
2235
|
+
ie as a6,
|
|
2200
2236
|
vo as a7,
|
|
2201
2237
|
fo as a8,
|
|
2202
2238
|
ho as a9,
|
|
@@ -2206,13 +2242,13 @@ export {
|
|
|
2206
2242
|
Na as ad,
|
|
2207
2243
|
Vn as ae,
|
|
2208
2244
|
$a as af,
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2245
|
+
$e as ag,
|
|
2246
|
+
$o as ah,
|
|
2247
|
+
mn as ai,
|
|
2248
|
+
mo as aj,
|
|
2249
|
+
Ye as ak,
|
|
2250
|
+
fe as al,
|
|
2251
|
+
Me as am,
|
|
2216
2252
|
La as an,
|
|
2217
2253
|
xo as ao,
|
|
2218
2254
|
Bo as ap,
|
|
@@ -2222,31 +2258,31 @@ export {
|
|
|
2222
2258
|
Yo as at,
|
|
2223
2259
|
co as au,
|
|
2224
2260
|
lo as av,
|
|
2225
|
-
|
|
2261
|
+
se as aw,
|
|
2226
2262
|
uo as ax,
|
|
2227
|
-
|
|
2263
|
+
C as b,
|
|
2228
2264
|
To as c,
|
|
2229
2265
|
V as d,
|
|
2230
2266
|
Gn as e,
|
|
2231
|
-
|
|
2267
|
+
c as f,
|
|
2232
2268
|
cn as g,
|
|
2233
2269
|
bo as h,
|
|
2234
2270
|
Ca as i,
|
|
2235
2271
|
yo as j,
|
|
2236
2272
|
Io as k,
|
|
2237
|
-
|
|
2238
|
-
|
|
2273
|
+
go as l,
|
|
2274
|
+
Do as m,
|
|
2239
2275
|
Eo as n,
|
|
2240
|
-
|
|
2276
|
+
m as o,
|
|
2241
2277
|
Co as p,
|
|
2242
|
-
|
|
2278
|
+
Ce as q,
|
|
2243
2279
|
oo as r,
|
|
2244
2280
|
Aa as s,
|
|
2245
2281
|
eo as t,
|
|
2246
|
-
|
|
2282
|
+
ke as u,
|
|
2247
2283
|
jn as v,
|
|
2248
|
-
|
|
2284
|
+
qn as w,
|
|
2249
2285
|
Ro as x,
|
|
2250
2286
|
Kn as y,
|
|
2251
|
-
|
|
2287
|
+
Ge as z
|
|
2252
2288
|
};
|