@feedmepos/mf-hrm-portal 2.3.2-dev.2 → 2.3.2-dev.3
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-sHnINTik.js → ApprovalCodeList-D3U4nvlF.js} +15 -14
- package/dist/{AuditLogList-C9C2emU9.js → AuditLogList-qGCW7tf0.js} +13 -13
- package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-B0VcRYUg.js +438 -0
- package/dist/EmployeeList-Bd73xDCX.js +776 -0
- package/dist/FormItem.vue_vue_type_script_setup_true_lang-cLEnrtC6.js +45 -0
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +49 -0
- package/dist/{GrantUserList-LWpqhl-5.js → GrantUserList-C71pal0N.js} +16 -15
- package/dist/{Main-PBJjfzBg.js → Main-BWJPyEU1.js} +5 -5
- package/dist/{Main-BWKb-QIE.js → Main-CCdTWngg.js} +11 -11
- package/dist/Main-DGf0bQvy.js +96 -0
- package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js +243 -0
- package/dist/{PermissionSetList-D2qZVlF4.js → PermissionSetList-BS-oBunI.js} +46 -45
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CkOAT-oX.js +4167 -0
- package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DQcgZ0nF.js +35 -0
- package/dist/RoleList-B_7UnVNb.js +740 -0
- package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-Cs0rhCa3.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-BXihM4sl.js} +1 -1
- package/dist/{ScheduleGeneralPage-C4J6jYtG.js → ScheduleGeneralPage-DpNvWNGs.js} +2 -2
- package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-3UqO6uPu.js → ScheduleModal.vue_vue_type_script_setup_true_lang-DIYLOF9N.js} +186 -187
- package/dist/{SchedulePage-ICzggri0.js → SchedulePage-QW-cYvu2.js} +13 -13
- package/dist/{SchedulePositionPage-BshUCd_C.js → SchedulePositionPage-BtFfVo2N.js} +3 -3
- package/dist/{SelectFilter-D9T0nFvG.js → SelectFilter-BXeVKgHN.js} +1 -1
- package/dist/TeamMemberList-DoisBYnk.js +1154 -0
- package/dist/{TimesheetList-nxhr0EWj.js → TimesheetList-D-bESKe5.js} +9 -9
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-BLqgALLe.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-D0zAVqCa.js} +3 -3
- package/dist/{app-n6d4AmtP.js → app-D-MUq9Ab.js} +3429 -6368
- package/dist/app.js +3 -3
- package/dist/{approval-code-1j1OoXt1.js → approval-code-BXUiojPH.js} +1 -1
- package/dist/{dayjs.min-DdNivv4b.js → dayjs.min-BZ1pM-6M.js} +34 -34
- package/dist/{employee-BlfleiCU.js → employee-HQEU8fjb.js} +47 -48
- package/dist/{grant-user-BmTyexk3.js → grant-user-CBJ3gEgW.js} +1 -1
- package/dist/{iteration-y_jodvfN.js → iteration-ogxW2-Tv.js} +1 -1
- package/dist/{lodash-B2eWEGH4.js → lodash-Def4gaas.js} +1 -1
- package/dist/restaurant-D2mfKHaH.js +1880 -0
- package/dist/{role-DfZi7Ssk.js → role-JDoDFVd9.js} +4 -5
- package/dist/{rule-ChmhcGgA.js → rule-DPtqlnz-.js} +100 -105
- package/dist/src/components/CollapsibleWrapper.vue.d.ts +3 -11
- package/dist/src/helpers/string.d.ts +1 -10
- package/dist/src/router/shared.d.ts +1 -3
- package/dist/src/stores/restaurant.d.ts +7 -7
- package/dist/src/stores/team.d.ts +0 -30
- package/dist/src/types/team.d.ts +1 -17
- package/dist/src/views/hr/locales/index.d.ts +4 -24
- package/dist/src/views/hr/role/RoleForm.vue.d.ts +2 -29
- package/dist/src/views/scheduling/composables/useScheduleOnboardingAvailability.d.ts +1 -1
- package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +1 -1
- package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -1
- package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +1 -1
- package/dist/src/views/team/components/BasePermission.vue.d.ts +0 -11
- package/dist/src/views/team/components/ConditionPermission.vue.d.ts +0 -11
- package/dist/src/views/team/components/PortalPermissionEditor.vue.d.ts +0 -21
- package/dist/src/views/team/components/PosRolePermission.vue.d.ts +0 -11
- package/dist/src/views/team/locales/index.d.ts +0 -716
- package/dist/src/views/team/member/AddMemberForm.vue.d.ts +3 -48
- package/dist/src/views/team/{components/MemberStatusBadge.vue.d.ts → member/MemberInfo.vue.d.ts} +2 -2
- package/dist/src/views/team/member/TeamMemberList.vue.d.ts +0 -1
- package/dist/string-VNuQNweN.js +15 -0
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-BPARQyvJ.js → useAppStore-DZCdxlCd.js} +1 -1
- package/dist/{useLoading-iPESFb6R.js → useLoading-Nygx2zn8.js} +1 -1
- package/dist/{useReportPermissions-By-BoJZb.js → useReportPermissions-CxV7Dz1B.js} +5 -5
- package/package.json +2 -2
- package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BbsPesWY.js +0 -459
- package/dist/EmployeeList-D4oy5hXz.js +0 -896
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-Cl053Tg1.js +0 -90
- package/dist/Main-CVGiOYpC.js +0 -101
- package/dist/MyPosProfile-BQCBFMFw.js +0 -301
- package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-TXPEqa46.js +0 -126
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-ZSREAS1r.js +0 -4243
- package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DRGTxOMW.js +0 -1831
- package/dist/RoleForm.vue_vue_type_script_setup_true_lang-DFDTw0lj.js +0 -547
- package/dist/RoleList-DG0crFzW.js +0 -274
- package/dist/TeamMemberList-C970Iqlj.js +0 -2086
- package/dist/member-grant-CzZUdO_s.js +0 -55
- package/dist/restaurant-Dl6yx37M.js +0 -51
- package/dist/src/api/my-pos-profile/index.d.ts +0 -5
- package/dist/src/api/sso-provider/index.d.ts +0 -5
- package/dist/src/api/staff-invite/index.d.ts +0 -16
- package/dist/src/components/form/SegmentedTabs.vue.d.ts +0 -23
- package/dist/src/composables/useMenuAccess.d.ts +0 -56
- package/dist/src/composables/useSsoProviders.d.ts +0 -19
- package/dist/src/composables/useStaffInviteProviders.d.ts +0 -8
- package/dist/src/helpers/member-grant.d.ts +0 -36
- package/dist/src/helpers/my-pos-profile.d.ts +0 -37
- package/dist/src/helpers/pos-assignment-rows.d.ts +0 -28
- package/dist/src/helpers/staff-invite.d.ts +0 -54
- package/dist/src/router/menu-access-guard.d.ts +0 -17
- package/dist/src/types/my-pos-profile.d.ts +0 -25
- package/dist/src/types/sso-provider.d.ts +0 -10
- package/dist/src/types/staff-invite.d.ts +0 -100
- package/dist/src/views/my-pos-profile/MyPosProfile.vue.d.ts +0 -2
- package/dist/src/views/my-pos-profile/components/PasscodeChangedDialog.vue.d.ts +0 -4
- package/dist/src/views/my-pos-profile/locales/index.d.ts +0 -200
- package/dist/src/views/team/components/MemberGrantFields.vue.d.ts +0 -51
- package/dist/src/views/team/components/PosAssignmentRows.vue.d.ts +0 -44
- package/dist/src/views/team/member/ExistingMemberNotice.vue.d.ts +0 -11
- package/dist/src/views/team/member/MemberDetailsCard.vue.d.ts +0 -35
- package/dist/src/views/team/member/MemberHeaderCard.vue.d.ts +0 -19
- package/dist/string-DZQ1uNjn.js +0 -22
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { onMounted as Re, onBeforeUnmount as $e, ref as S, reactive as T, shallowRef as Ae, watch as Be, computed as Y, defineComponent as xe, createElementBlock as M, openBlock as C, renderSlot as Xe, useAttrs as
|
|
1
|
+
import { onMounted as Re, onBeforeUnmount as $e, ref as S, reactive as T, shallowRef as Ae, watch as Be, computed as Y, defineComponent as xe, createElementBlock as M, openBlock as C, renderSlot as Xe, useAttrs as ha, nextTick as ke, normalizeClass as pe, createElementVNode as x, createBlock as pa, mergeProps as va, toDisplayString as z, Teleport as ga, createCommentVNode as G, withDirectives as Da, unref as Ee, vModelText as wa, Fragment as be, renderList as Ha, createTextVNode as Aa, withModifiers as Ea, normalizeStyle as ba } from "vue";
|
|
2
2
|
import { useRoute as Pa, useRouter as Sa } from "vue-router";
|
|
3
3
|
import { useCoreStore as Je, useI18n as ka } from "@feedmepos/mf-common";
|
|
4
|
-
import { u as Ca } from "./restaurant-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
function io(e) {
|
|
4
|
+
import { g, b as h, u as Ca } from "./restaurant-D2mfKHaH.js";
|
|
5
|
+
import { E as Ce, u as Ze } from "./employee-HQEU8fjb.js";
|
|
6
|
+
import { t as Fe, q as Ma } from "./rule-DPtqlnz-.js";
|
|
7
|
+
function so(e) {
|
|
9
8
|
let a = null;
|
|
10
9
|
function t() {
|
|
11
10
|
if (!a) return;
|
|
@@ -41,7 +40,7 @@ function Oa(e) {
|
|
|
41
40
|
const a = (Me(e) % 1440 + 1440) % 1440, t = Math.floor(a / 60), n = a % 60, o = t < 12 ? "am" : "pm", i = t % 12 || 12;
|
|
42
41
|
return n ? `${i}:${String(n).padStart(2, "0")}${o}` : `${i}${o}`;
|
|
43
42
|
}
|
|
44
|
-
function
|
|
43
|
+
function io(e) {
|
|
45
44
|
return Oa(Na(e % 1440));
|
|
46
45
|
}
|
|
47
46
|
function ea(e) {
|
|
@@ -53,36 +52,36 @@ function ea(e) {
|
|
|
53
52
|
return d < 0 && (d += 24 * 60), t + d;
|
|
54
53
|
}, 0) : Math.max(0, e && !Array.isArray(e) ? e.breakMins ?? 0 : 0);
|
|
55
54
|
}
|
|
56
|
-
function
|
|
55
|
+
function ro(e, a) {
|
|
57
56
|
var o;
|
|
58
57
|
const t = a ?? qe(e.start, e.end), n = (o = e.breaks) != null && o.length ? e.breaks.reduce((i, u) => i + (u.breakPayType === "UNPAID" ? ea([u]) : 0), 0) : Math.max(0, e.breakMins ?? 0);
|
|
59
58
|
return Math.max(0, t - Math.min(t, n));
|
|
60
59
|
}
|
|
61
|
-
function
|
|
60
|
+
function lo(e) {
|
|
62
61
|
const a = Math.max(0, Math.round(e ?? 0));
|
|
63
62
|
return a ? [{ type: "DURATION", minutes: a, breakPayType: "UNPAID" }] : [];
|
|
64
63
|
}
|
|
65
|
-
const ne = 500, Ia = 10, _e = 6,
|
|
64
|
+
const ne = 500, Ia = 10, _e = 6, uo = 1500, aa = 1e6, w = {
|
|
66
65
|
async completeOnboarding(e, a) {
|
|
67
66
|
return g(
|
|
68
|
-
await
|
|
67
|
+
await h(`restaurants/${e}/schedules`).post("onboarding", a)
|
|
69
68
|
);
|
|
70
69
|
},
|
|
71
70
|
async listEmployeeProfiles(e) {
|
|
72
71
|
return g(
|
|
73
|
-
await
|
|
72
|
+
await h("schedules").get("employees", {
|
|
74
73
|
params: e != null && e.length ? { ids: e.join(",") } : void 0
|
|
75
74
|
})
|
|
76
75
|
);
|
|
77
76
|
},
|
|
78
77
|
async listEmployeeConfigs(e) {
|
|
79
78
|
return g(
|
|
80
|
-
await
|
|
79
|
+
await h(`restaurants/${e}/schedules`).get("employee-configs")
|
|
81
80
|
);
|
|
82
81
|
},
|
|
83
82
|
async saveEmployeeConfigs(e, a) {
|
|
84
83
|
return g(
|
|
85
|
-
await
|
|
84
|
+
await h(`restaurants/${e}/schedules`).post(
|
|
86
85
|
"employee-configs/reorder",
|
|
87
86
|
a
|
|
88
87
|
)
|
|
@@ -90,17 +89,17 @@ const ne = 500, Ia = 10, _e = 6, co = 1500, aa = 1e6, w = {
|
|
|
90
89
|
},
|
|
91
90
|
async getSettings(e) {
|
|
92
91
|
return g(
|
|
93
|
-
await
|
|
92
|
+
await h(`restaurants/${e}/schedules`).get("settings")
|
|
94
93
|
);
|
|
95
94
|
},
|
|
96
95
|
async saveSettings(e, a) {
|
|
97
96
|
return g(
|
|
98
|
-
await
|
|
97
|
+
await h(`restaurants/${e}/schedules`).post("settings", a)
|
|
99
98
|
);
|
|
100
99
|
},
|
|
101
100
|
async generateAutoSchedule(e, a) {
|
|
102
101
|
return g(
|
|
103
|
-
await
|
|
102
|
+
await h(`restaurants/${e}/schedules`).post(
|
|
104
103
|
"auto-schedule/generate",
|
|
105
104
|
a
|
|
106
105
|
)
|
|
@@ -108,14 +107,14 @@ const ne = 500, Ia = 10, _e = 6, co = 1500, aa = 1e6, w = {
|
|
|
108
107
|
},
|
|
109
108
|
async getAutoScheduleCapabilities(e) {
|
|
110
109
|
return g(
|
|
111
|
-
await
|
|
110
|
+
await h(`restaurants/${e}/schedules`).get(
|
|
112
111
|
"auto-schedule/capabilities"
|
|
113
112
|
)
|
|
114
113
|
);
|
|
115
114
|
},
|
|
116
115
|
async applyAutoSchedule(e, a) {
|
|
117
116
|
return g(
|
|
118
|
-
await
|
|
117
|
+
await h(`restaurants/${e}/schedules`).post(
|
|
119
118
|
"auto-schedule/apply",
|
|
120
119
|
a
|
|
121
120
|
)
|
|
@@ -124,58 +123,58 @@ const ne = 500, Ia = 10, _e = 6, co = 1500, aa = 1e6, w = {
|
|
|
124
123
|
/** One outlet's whole board over `[from, to]` (inclusive, 'YYYY-MM-DD'). */
|
|
125
124
|
async readBoard(e, a, t) {
|
|
126
125
|
return g(
|
|
127
|
-
await
|
|
126
|
+
await h(`restaurants/${e}/schedules`).get("board", {
|
|
128
127
|
params: { from: a, to: t }
|
|
129
128
|
})
|
|
130
129
|
);
|
|
131
130
|
},
|
|
132
131
|
async createTimeOff(e, a) {
|
|
133
132
|
return g(
|
|
134
|
-
await
|
|
133
|
+
await h(`restaurants/${e}/schedules`).post("time-off", a)
|
|
135
134
|
);
|
|
136
135
|
},
|
|
137
136
|
async updateTimeOffStatus(e, a, t) {
|
|
138
137
|
return g(
|
|
139
|
-
await
|
|
138
|
+
await h(`restaurants/${e}/schedules`).post(
|
|
140
139
|
`time-off/${a}/status`,
|
|
141
140
|
t
|
|
142
141
|
)
|
|
143
142
|
);
|
|
144
143
|
},
|
|
145
144
|
async deleteTimeOff(e, a) {
|
|
146
|
-
await
|
|
145
|
+
await h(`restaurants/${e}/schedules`).delete(`time-off/${a}`);
|
|
147
146
|
},
|
|
148
147
|
/** Creates or updates the employee's shared business-level scheduling profile. */
|
|
149
148
|
async createEmployeeProfile(e, a) {
|
|
150
|
-
return g(await
|
|
149
|
+
return g(await h("schedules").post("employees", a));
|
|
151
150
|
},
|
|
152
151
|
/** Edits the employee's shared business-level scheduling profile. */
|
|
153
152
|
async updateEmployeeProfile(e, a, t) {
|
|
154
153
|
return g(
|
|
155
|
-
await
|
|
154
|
+
await h("schedules").post("employees", { employeeId: a, ...t })
|
|
156
155
|
);
|
|
157
156
|
},
|
|
158
157
|
async validatePosAccess(e) {
|
|
159
|
-
await
|
|
158
|
+
await h("schedules").post("employees/validate-pos-access", e);
|
|
160
159
|
},
|
|
161
160
|
/** Positions are shared across the business. */
|
|
162
161
|
async createPosition(e) {
|
|
163
|
-
return g(await
|
|
162
|
+
return g(await h("schedules").post("positions", e));
|
|
164
163
|
},
|
|
165
164
|
async updatePosition(e, a) {
|
|
166
|
-
return g(await
|
|
165
|
+
return g(await h("schedules").post(`positions/${e}`, a));
|
|
167
166
|
},
|
|
168
167
|
/** Deleting one position is `deletePositions` with a single-id array — the backend's
|
|
169
168
|
* `DELETE positions/:id` route is gone; this is now `DELETE positions?ids=`. */
|
|
170
169
|
async deletePosition(e) {
|
|
171
|
-
await
|
|
170
|
+
await h("schedules").delete("positions", {
|
|
172
171
|
params: { ids: e }
|
|
173
172
|
});
|
|
174
173
|
},
|
|
175
174
|
/** Creates one flat demand interval. */
|
|
176
175
|
async createDemand(e, a) {
|
|
177
176
|
return g(
|
|
178
|
-
await
|
|
177
|
+
await h(`restaurants/${e}/schedules`).post("demands", a)
|
|
179
178
|
);
|
|
180
179
|
},
|
|
181
180
|
/** Deletes a batch of demands in one request — e.g. `saveDemand` replacing a whole
|
|
@@ -183,7 +182,7 @@ const ne = 500, Ia = 10, _e = 6, co = 1500, aa = 1e6, w = {
|
|
|
183
182
|
* array. */
|
|
184
183
|
async deleteDemands(e, a) {
|
|
185
184
|
return g(
|
|
186
|
-
await
|
|
185
|
+
await h(`restaurants/${e}/schedules`).delete("demands", {
|
|
187
186
|
params: { ids: a.join(",") }
|
|
188
187
|
})
|
|
189
188
|
);
|
|
@@ -191,7 +190,7 @@ const ne = 500, Ia = 10, _e = 6, co = 1500, aa = 1e6, w = {
|
|
|
191
190
|
/** Atomically replaces one date/weekday's flattened demand rows. */
|
|
192
191
|
async replaceDemands(e, a) {
|
|
193
192
|
return g(
|
|
194
|
-
await
|
|
193
|
+
await h(`restaurants/${e}/schedules`).post(
|
|
195
194
|
"demands/replace",
|
|
196
195
|
a
|
|
197
196
|
)
|
|
@@ -200,7 +199,7 @@ const ne = 500, Ia = 10, _e = 6, co = 1500, aa = 1e6, w = {
|
|
|
200
199
|
/** Atomically replaces several date/weekday demand generations. */
|
|
201
200
|
async bulkReplaceDemands(e, a) {
|
|
202
201
|
return g(
|
|
203
|
-
await
|
|
202
|
+
await h(`restaurants/${e}/schedules`).post(
|
|
204
203
|
"demands/bulk-replace",
|
|
205
204
|
a
|
|
206
205
|
)
|
|
@@ -209,7 +208,7 @@ const ne = 500, Ia = 10, _e = 6, co = 1500, aa = 1e6, w = {
|
|
|
209
208
|
/** Replaces one date's note/holiday-mark. All three fields back to empty/false clears it. */
|
|
210
209
|
async saveScheduleDay(e, a, t) {
|
|
211
210
|
return g(
|
|
212
|
-
await
|
|
211
|
+
await h(`restaurants/${e}/schedules`).post(
|
|
213
212
|
`days/${a}`,
|
|
214
213
|
t
|
|
215
214
|
)
|
|
@@ -218,12 +217,12 @@ const ne = 500, Ia = 10, _e = 6, co = 1500, aa = 1e6, w = {
|
|
|
218
217
|
/** A one-off shift assignment. */
|
|
219
218
|
async createAssignment(e, a) {
|
|
220
219
|
return g(
|
|
221
|
-
await
|
|
220
|
+
await h(`restaurants/${e}/schedules`).post("assignments", a)
|
|
222
221
|
);
|
|
223
222
|
},
|
|
224
223
|
async updateAssignment(e, a, t) {
|
|
225
224
|
return g(
|
|
226
|
-
await
|
|
225
|
+
await h(`restaurants/${e}/schedules`).patch(
|
|
227
226
|
`assignments/${a}`,
|
|
228
227
|
t
|
|
229
228
|
)
|
|
@@ -232,7 +231,7 @@ const ne = 500, Ia = 10, _e = 6, co = 1500, aa = 1e6, w = {
|
|
|
232
231
|
/** Atomically applies assignment updates, creates, and deletes used by moves and swaps. */
|
|
233
232
|
async bulkSaveAssignments(e, a) {
|
|
234
233
|
return g(
|
|
235
|
-
await
|
|
234
|
+
await h(`restaurants/${e}/schedules`).post(
|
|
236
235
|
"assignments/bulk",
|
|
237
236
|
a
|
|
238
237
|
)
|
|
@@ -241,13 +240,13 @@ const ne = 500, Ia = 10, _e = 6, co = 1500, aa = 1e6, w = {
|
|
|
241
240
|
/** Replaces demand and/or assignments in one backend transaction. */
|
|
242
241
|
async copySchedule(e, a) {
|
|
243
242
|
return g(
|
|
244
|
-
await
|
|
243
|
+
await h(`restaurants/${e}/schedules`).post("copy", a)
|
|
245
244
|
);
|
|
246
245
|
},
|
|
247
246
|
/** Clears demand and/or assignments in one backend transaction. */
|
|
248
247
|
async clearSchedule(e, a) {
|
|
249
248
|
return g(
|
|
250
|
-
await
|
|
249
|
+
await h(`restaurants/${e}/schedules`).post("clear", a)
|
|
251
250
|
);
|
|
252
251
|
},
|
|
253
252
|
/** Deletes a batch of assignments in one request — e.g. a shift split into several segments
|
|
@@ -255,7 +254,7 @@ const ne = 500, Ia = 10, _e = 6, co = 1500, aa = 1e6, w = {
|
|
|
255
254
|
* array. */
|
|
256
255
|
async deleteAssignments(e, a) {
|
|
257
256
|
return g(
|
|
258
|
-
await
|
|
257
|
+
await h(`restaurants/${e}/schedules`).delete("assignments", {
|
|
259
258
|
params: { ids: a.join(",") }
|
|
260
259
|
})
|
|
261
260
|
);
|
|
@@ -263,7 +262,7 @@ const ne = 500, Ia = 10, _e = 6, co = 1500, aa = 1e6, w = {
|
|
|
263
262
|
/** Removes all assignments for an employee from the inclusive removal date onward. */
|
|
264
263
|
async deleteEmployeeFutureAssignments(e, a, t) {
|
|
265
264
|
return g(
|
|
266
|
-
await
|
|
265
|
+
await h(`restaurants/${e}/schedules`).delete(
|
|
267
266
|
"assignments/employee-future",
|
|
268
267
|
{ params: { employeeId: a, from: t } }
|
|
269
268
|
)
|
|
@@ -273,7 +272,7 @@ const ne = 500, Ia = 10, _e = 6, co = 1500, aa = 1e6, w = {
|
|
|
273
272
|
* every DRAFT shift on the board to PUBLISHED at once. */
|
|
274
273
|
async bulkUpdateAssignmentStatus(e, a) {
|
|
275
274
|
return g(
|
|
276
|
-
await
|
|
275
|
+
await h(`restaurants/${e}/schedules`).patch(
|
|
277
276
|
"assignments/bulk-status",
|
|
278
277
|
a
|
|
279
278
|
)
|
|
@@ -345,13 +344,13 @@ const ne = 500, Ia = 10, _e = 6, co = 1500, aa = 1e6, w = {
|
|
|
345
344
|
businessEmployees: Pe,
|
|
346
345
|
positions: Ta,
|
|
347
346
|
positionRecords: W,
|
|
348
|
-
rolePositions:
|
|
347
|
+
rolePositions: co,
|
|
349
348
|
outlet: Ra,
|
|
350
349
|
locationOptions: Ke,
|
|
351
350
|
locationLabelById: se,
|
|
352
|
-
compensationGroupMeta:
|
|
353
|
-
existingStaff:
|
|
354
|
-
shiftTemplates:
|
|
351
|
+
compensationGroupMeta: mo,
|
|
352
|
+
existingStaff: yo,
|
|
353
|
+
shiftTemplates: fo,
|
|
355
354
|
rules: N
|
|
356
355
|
} = ta;
|
|
357
356
|
function $a() {
|
|
@@ -384,18 +383,18 @@ function ho(e, a = /* @__PURE__ */ new Date()) {
|
|
|
384
383
|
const t = ie(Le(a), e * Ne);
|
|
385
384
|
return Array.from({ length: Ne }, (n, o) => ie(t, o));
|
|
386
385
|
}
|
|
387
|
-
function
|
|
386
|
+
function po(e, a) {
|
|
388
387
|
const t = (i) => Date.UTC(i.getFullYear(), i.getMonth(), i.getDate()), n = t(Le(e)), o = t(Le(a));
|
|
389
388
|
return Math.trunc((o - n) / (Ne * 24 * 60 * 60 * 1e3));
|
|
390
389
|
}
|
|
391
390
|
const oa = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"];
|
|
392
|
-
function
|
|
391
|
+
function vo(e) {
|
|
393
392
|
return `scheduling.days.short.${oa[(e % 7 + 7) % 7]}`;
|
|
394
393
|
}
|
|
395
|
-
function
|
|
394
|
+
function go(e) {
|
|
396
395
|
return `scheduling.days.long.${oa[(e % 7 + 7) % 7]}`;
|
|
397
396
|
}
|
|
398
|
-
function
|
|
397
|
+
function Do(e, a = "en-US") {
|
|
399
398
|
return !e || e.startsWith("en") ? a : e.startsWith("th") ? "th-TH-u-ca-gregory" : e;
|
|
400
399
|
}
|
|
401
400
|
const j = Ba, xa = {
|
|
@@ -405,7 +404,7 @@ const j = Ba, xa = {
|
|
|
405
404
|
loadFailed: "Could not load the schedule"
|
|
406
405
|
};
|
|
407
406
|
let Oe = null;
|
|
408
|
-
function
|
|
407
|
+
function wo(e) {
|
|
409
408
|
Oe = e;
|
|
410
409
|
}
|
|
411
410
|
function A(e) {
|
|
@@ -441,7 +440,7 @@ async function Fa(e) {
|
|
|
441
440
|
const t = await w.saveEmployeeConfigs(a, { configs: e });
|
|
442
441
|
V.value = t, J.value += 1;
|
|
443
442
|
}
|
|
444
|
-
async function
|
|
443
|
+
async function Ho(e) {
|
|
445
444
|
const a = m.value;
|
|
446
445
|
if (!a) throw new Error(A("noOutlet"));
|
|
447
446
|
const t = await w.saveSettings(a, e);
|
|
@@ -459,7 +458,7 @@ async function _a(e, a) {
|
|
|
459
458
|
) + 100 : null);
|
|
460
459
|
await Fa([{ employeeId: e, enabled: a, displayOrder: n }]);
|
|
461
460
|
}
|
|
462
|
-
async function
|
|
461
|
+
async function Ao(e, a = j(/* @__PURE__ */ new Date())) {
|
|
463
462
|
const t = m.value;
|
|
464
463
|
if (!t) throw new Error(A("noOutlet"));
|
|
465
464
|
await w.deleteEmployeeFutureAssignments(t, e, a), r.value && (r.value = {
|
|
@@ -492,24 +491,24 @@ async function Ua(e, a) {
|
|
|
492
491
|
previousRoles: o
|
|
493
492
|
}), await X(!0);
|
|
494
493
|
}
|
|
495
|
-
async function
|
|
494
|
+
async function Eo(e, a, t = "", n = !0) {
|
|
496
495
|
const o = [...new Set(a.filter(Boolean))];
|
|
497
496
|
o.length && (await Ua(e, (i) => [
|
|
498
497
|
...i.filter((u) => !o.includes(u.restaurantId)),
|
|
499
498
|
...o.map((u) => ({ restaurantId: u, roleId: t }))
|
|
500
499
|
]), n && m.value && o.includes(m.value) && await _a(e, !0), await Te());
|
|
501
500
|
}
|
|
502
|
-
async function
|
|
503
|
-
const n = Ze(), o = (t == null ? void 0 : t._id) === e ? t : (await X(!0)).find((
|
|
501
|
+
async function bo(e, a, t) {
|
|
502
|
+
const n = Ze(), o = (t == null ? void 0 : t._id) === e ? t : (await X(!0)).find((p) => p._id === e);
|
|
504
503
|
if (!o) throw new Error(A("employeeNotFound"));
|
|
505
|
-
const i = (
|
|
504
|
+
const i = (p) => p.slice().sort((H, $) => H.restaurantId.localeCompare($.restaurantId)).map((H) => `${H.restaurantId}:${H.roleId}`).join("|"), u = i(o.restaurantRole) !== i(a.roles), s = o.name !== a.name || o.passcode !== a.passcode || o.isMasterUser !== a.masterUser || a.masterUser && (o.code ?? "") !== a.masterCode;
|
|
506
505
|
if (!u && !s) return;
|
|
507
|
-
const d = o.restaurantRole.map((
|
|
508
|
-
restaurantId:
|
|
509
|
-
roleId:
|
|
510
|
-
})), D = o.isMasterUser ? (await Fe.readTeamMembers()).find((
|
|
506
|
+
const d = o.restaurantRole.map((p) => ({
|
|
507
|
+
restaurantId: p.restaurantId,
|
|
508
|
+
roleId: p.roleId
|
|
509
|
+
})), D = o.isMasterUser ? (await Fe.readTeamMembers()).find((p) => p.doc.posUserId === e) : void 0;
|
|
511
510
|
if (D) {
|
|
512
|
-
const
|
|
511
|
+
const p = Ma(), H = p.getPermissionAssignmentByUserId(D.id) ?? await p.readPermissionAssignmentByUserId(D.id), $ = a.masterUser ? {
|
|
513
512
|
code: a.masterCode,
|
|
514
513
|
name: a.name,
|
|
515
514
|
passcode: a.passcode,
|
|
@@ -524,12 +523,12 @@ async function Po(e, a, t) {
|
|
|
524
523
|
return;
|
|
525
524
|
}
|
|
526
525
|
if (a.masterUser) {
|
|
527
|
-
const
|
|
526
|
+
const p = {
|
|
528
527
|
user: { name: a.name, passcode: a.passcode, code: a.masterCode },
|
|
529
528
|
roles: a.roles,
|
|
530
529
|
previousRoles: d
|
|
531
530
|
};
|
|
532
|
-
o.isMasterUser ? await n.updateMasterEmployee(e,
|
|
531
|
+
o.isMasterUser ? await n.updateMasterEmployee(e, p) : await n.migrateToMasterUser(e, p);
|
|
533
532
|
} else
|
|
534
533
|
o.isMasterUser ? await n.updateMasterEmployee(e, {
|
|
535
534
|
user: { name: o.name, passcode: o.passcode, code: o.code ?? "" },
|
|
@@ -591,18 +590,18 @@ async function za(e) {
|
|
|
591
590
|
ie(e, 7 * _e)
|
|
592
591
|
);
|
|
593
592
|
}
|
|
594
|
-
async function
|
|
593
|
+
async function Po() {
|
|
595
594
|
!Z || !q || await ia(/* @__PURE__ */ new Date(`${Z}T00:00:00`), /* @__PURE__ */ new Date(`${q}T00:00:00`));
|
|
596
595
|
}
|
|
597
|
-
async function
|
|
596
|
+
async function So(e) {
|
|
598
597
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
599
598
|
const a = await w.createEmployeeProfile(m.value, e);
|
|
600
599
|
r.value && (r.value.employees.push(a), J.value += 1);
|
|
601
600
|
}
|
|
602
|
-
async function
|
|
601
|
+
async function ko(e) {
|
|
603
602
|
await w.validatePosAccess(e);
|
|
604
603
|
}
|
|
605
|
-
async function
|
|
604
|
+
async function Co(e, a) {
|
|
606
605
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
607
606
|
const t = await w.updateEmployeeProfile(m.value, e, a);
|
|
608
607
|
if (r.value) {
|
|
@@ -613,11 +612,11 @@ async function Mo(e, a) {
|
|
|
613
612
|
});
|
|
614
613
|
}
|
|
615
614
|
}
|
|
616
|
-
async function
|
|
615
|
+
async function Mo(e) {
|
|
617
616
|
const a = await w.createPosition(e);
|
|
618
617
|
r.value && (r.value = { ...r.value, positions: [...r.value.positions, a] });
|
|
619
618
|
}
|
|
620
|
-
async function
|
|
619
|
+
async function No(e, a) {
|
|
621
620
|
const t = await w.updatePosition(e, a);
|
|
622
621
|
if (r.value) {
|
|
623
622
|
const n = r.value.positions.find((i) => i.id === e), o = (i) => i.positionId === e || !i.positionId && i.positionName === (n == null ? void 0 : n.name);
|
|
@@ -634,13 +633,13 @@ async function Lo(e, a) {
|
|
|
634
633
|
};
|
|
635
634
|
}
|
|
636
635
|
}
|
|
637
|
-
async function
|
|
636
|
+
async function Lo(e) {
|
|
638
637
|
await w.deletePosition(e), r.value && (r.value = {
|
|
639
638
|
...r.value,
|
|
640
639
|
positions: r.value.positions.filter((a) => a.id !== e)
|
|
641
640
|
});
|
|
642
641
|
}
|
|
643
|
-
async function
|
|
642
|
+
async function Oo(e, a) {
|
|
644
643
|
var o;
|
|
645
644
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
646
645
|
const t = (o = r.value) == null ? void 0 : o.days.find((i) => i.date === e), n = await w.saveScheduleDay(m.value, e, {
|
|
@@ -672,7 +671,7 @@ function Va(e) {
|
|
|
672
671
|
demands: a
|
|
673
672
|
};
|
|
674
673
|
}
|
|
675
|
-
async function
|
|
674
|
+
async function Io(e) {
|
|
676
675
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
677
676
|
if (!e.length) return;
|
|
678
677
|
const a = e.map(Va), t = e.length === 1 ? await w.replaceDemands(m.value, a[0]) : await w.bulkReplaceDemands(m.value, { replacements: a });
|
|
@@ -682,19 +681,19 @@ async function To(e) {
|
|
|
682
681
|
}
|
|
683
682
|
sa();
|
|
684
683
|
}
|
|
685
|
-
async function
|
|
684
|
+
async function To(e) {
|
|
686
685
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
687
686
|
return w.generateAutoSchedule(m.value, e);
|
|
688
687
|
}
|
|
689
|
-
async function
|
|
688
|
+
async function Ro() {
|
|
690
689
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
691
690
|
return w.getAutoScheduleCapabilities(m.value);
|
|
692
691
|
}
|
|
693
|
-
async function
|
|
692
|
+
async function $o(e) {
|
|
694
693
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
695
694
|
return w.applyAutoSchedule(m.value, e);
|
|
696
695
|
}
|
|
697
|
-
async function
|
|
696
|
+
async function Bo(e) {
|
|
698
697
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
699
698
|
const a = await w.bulkSaveAssignments(m.value, e);
|
|
700
699
|
if (r.value) {
|
|
@@ -705,11 +704,11 @@ async function xo(e) {
|
|
|
705
704
|
}
|
|
706
705
|
return sa(), a;
|
|
707
706
|
}
|
|
708
|
-
async function
|
|
707
|
+
async function xo(e) {
|
|
709
708
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
710
709
|
return w.copySchedule(m.value, e);
|
|
711
710
|
}
|
|
712
|
-
async function
|
|
711
|
+
async function Yo(e) {
|
|
713
712
|
var t;
|
|
714
713
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
715
714
|
const a = await w.clearSchedule(m.value, e);
|
|
@@ -728,7 +727,7 @@ async function Fo(e) {
|
|
|
728
727
|
}
|
|
729
728
|
return a;
|
|
730
729
|
}
|
|
731
|
-
async function
|
|
730
|
+
async function Fo(e) {
|
|
732
731
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
733
732
|
if (e.length && (await w.deleteAssignments(m.value, e), r.value)) {
|
|
734
733
|
const a = new Set(e);
|
|
@@ -738,12 +737,12 @@ async function _o(e) {
|
|
|
738
737
|
};
|
|
739
738
|
}
|
|
740
739
|
}
|
|
741
|
-
async function
|
|
740
|
+
async function _o(e) {
|
|
742
741
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
743
742
|
const a = await w.createTimeOff(m.value, e);
|
|
744
743
|
return r.value && (r.value = { ...r.value, timeOff: [...r.value.timeOff, a] }), a;
|
|
745
744
|
}
|
|
746
|
-
async function
|
|
745
|
+
async function Uo(e, a) {
|
|
747
746
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
748
747
|
const t = await w.updateTimeOffStatus(m.value, e, a);
|
|
749
748
|
return t && r.value && (r.value = {
|
|
@@ -751,14 +750,14 @@ async function Wo(e, a) {
|
|
|
751
750
|
timeOff: r.value.timeOff.map((n) => n.id === e ? t : n)
|
|
752
751
|
}), t;
|
|
753
752
|
}
|
|
754
|
-
async function
|
|
753
|
+
async function Wo(e) {
|
|
755
754
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
756
755
|
await w.deleteTimeOff(m.value, e), r.value && (r.value = {
|
|
757
756
|
...r.value,
|
|
758
757
|
timeOff: r.value.timeOff.filter((a) => a.id !== e)
|
|
759
758
|
});
|
|
760
759
|
}
|
|
761
|
-
async function
|
|
760
|
+
async function Ko(e) {
|
|
762
761
|
if (!m.value) throw new Error(A("noOutlet"));
|
|
763
762
|
const a = await w.bulkUpdateAssignmentStatus(m.value, e);
|
|
764
763
|
if (r.value && a.length) {
|
|
@@ -1007,7 +1006,7 @@ const ja = "AE", Ga = "Asia/Dubai", Qa = {
|
|
|
1007
1006
|
day: 25,
|
|
1008
1007
|
name: "Christmas Day"
|
|
1009
1008
|
}
|
|
1010
|
-
],
|
|
1009
|
+
], ht = {
|
|
1011
1010
|
2026: {
|
|
1012
1011
|
"2026-01-01": "New Year's Day",
|
|
1013
1012
|
"2026-01-16": "Isra Mi'raj",
|
|
@@ -1047,14 +1046,14 @@ const ja = "AE", Ga = "Asia/Dubai", Qa = {
|
|
|
1047
1046
|
"2027-12-25": "Christmas Day",
|
|
1048
1047
|
"2027-12-26": "Isra Mi'raj"
|
|
1049
1048
|
}
|
|
1050
|
-
},
|
|
1049
|
+
}, pt = {
|
|
1051
1050
|
countryCode: ut,
|
|
1052
1051
|
timezone: dt,
|
|
1053
1052
|
payRate: ct,
|
|
1054
1053
|
overtime: mt,
|
|
1055
1054
|
workingHours: yt,
|
|
1056
1055
|
recurringPublicHolidays: ft,
|
|
1057
|
-
publicHolidays:
|
|
1056
|
+
publicHolidays: ht
|
|
1058
1057
|
}, vt = "MO", gt = "Asia/Macau", Dt = {
|
|
1059
1058
|
NORMAL: {
|
|
1060
1059
|
overtime: 1.5
|
|
@@ -1715,7 +1714,7 @@ const ja = "AE", Ga = "Asia/Dubai", Qa = {
|
|
|
1715
1714
|
recurringPublicHolidays: un,
|
|
1716
1715
|
publicHolidays: dn,
|
|
1717
1716
|
holidayNames: cn
|
|
1718
|
-
}, yn = "VN", fn = "Asia/Ho_Chi_Minh",
|
|
1717
|
+
}, yn = "VN", fn = "Asia/Ho_Chi_Minh", hn = {
|
|
1719
1718
|
NORMAL: {
|
|
1720
1719
|
overtime: 1.5
|
|
1721
1720
|
},
|
|
@@ -1727,7 +1726,7 @@ const ja = "AE", Ga = "Asia/Dubai", Qa = {
|
|
|
1727
1726
|
regular: 2,
|
|
1728
1727
|
overtime: 3
|
|
1729
1728
|
}
|
|
1730
|
-
},
|
|
1729
|
+
}, pn = {
|
|
1731
1730
|
maxHoursPerMonth: 40
|
|
1732
1731
|
}, vn = {
|
|
1733
1732
|
fullTime: {
|
|
@@ -1790,12 +1789,12 @@ const ja = "AE", Ga = "Asia/Dubai", Qa = {
|
|
|
1790
1789
|
}, wn = {
|
|
1791
1790
|
countryCode: yn,
|
|
1792
1791
|
timezone: fn,
|
|
1793
|
-
payRate:
|
|
1794
|
-
overtime:
|
|
1792
|
+
payRate: hn,
|
|
1793
|
+
overtime: pn,
|
|
1795
1794
|
workingHours: vn,
|
|
1796
1795
|
recurringPublicHolidays: gn,
|
|
1797
1796
|
publicHolidays: Dn
|
|
1798
|
-
}, je = { AE: et, BN: lt, ID:
|
|
1797
|
+
}, je = { AE: et, BN: lt, ID: pt, MO: bt, MV: Ot, MY: Ft, PK: Gt, SG: tn, TH: mn, VN: wn };
|
|
1799
1798
|
function Hn(e) {
|
|
1800
1799
|
if (typeof e == "string") return e.toUpperCase();
|
|
1801
1800
|
if (e && typeof e == "object" && "code" in e) {
|
|
@@ -1807,7 +1806,7 @@ function Hn(e) {
|
|
|
1807
1806
|
function An(e) {
|
|
1808
1807
|
return je[Hn(e)] ?? je.MY;
|
|
1809
1808
|
}
|
|
1810
|
-
function
|
|
1809
|
+
function zo(e, a, t) {
|
|
1811
1810
|
var o, i;
|
|
1812
1811
|
const n = En(e, a);
|
|
1813
1812
|
return !n || !t ? n : ((i = (o = e.holidayNames) == null ? void 0 : o[t.slice(0, 2).toLowerCase()]) == null ? void 0 : i[n]) ?? n;
|
|
@@ -1819,7 +1818,7 @@ function En(e, a) {
|
|
|
1819
1818
|
const n = Number(a.slice(5, 7)), o = Number(a.slice(8, 10));
|
|
1820
1819
|
return ((u = e.recurringPublicHolidays.find((s) => s.month === n && s.day === o)) == null ? void 0 : u.name) ?? null;
|
|
1821
1820
|
}
|
|
1822
|
-
const bn = Je(), ra = "unassigned",
|
|
1821
|
+
const bn = Je(), ra = "unassigned", Vo = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], jo = "All Stations", Go = [{ id: ra, label: "Assigned", roles: [], system: !0 }], Ge = [
|
|
1823
1822
|
"#903E1F",
|
|
1824
1823
|
"#5F090A",
|
|
1825
1824
|
"#0A5384",
|
|
@@ -1834,7 +1833,7 @@ function Pn(e) {
|
|
|
1834
1833
|
const a = e.trim().toLocaleLowerCase();
|
|
1835
1834
|
return (t = W.find((n) => n.name.toLocaleLowerCase() === a)) == null ? void 0 : t.id;
|
|
1836
1835
|
}
|
|
1837
|
-
function
|
|
1836
|
+
function Qo(e, a) {
|
|
1838
1837
|
if (e)
|
|
1839
1838
|
return { positionId: a ?? Pn(e), positionName: e };
|
|
1840
1839
|
}
|
|
@@ -1843,22 +1842,22 @@ function re(e, a = W) {
|
|
|
1843
1842
|
if (e)
|
|
1844
1843
|
return (e.positionId && ((t = a.find((n) => n.id === e.positionId)) == null ? void 0 : t.name)) ?? e.positionName;
|
|
1845
1844
|
}
|
|
1846
|
-
function
|
|
1845
|
+
function Xo(e, a = W) {
|
|
1847
1846
|
var t, n;
|
|
1848
1847
|
if (e)
|
|
1849
1848
|
return e.positionId ? (t = a.find((o) => o.id === e.positionId)) == null ? void 0 : t.name : (n = a.find((o) => o.name.toLocaleLowerCase() === e.positionName.toLocaleLowerCase())) == null ? void 0 : n.name;
|
|
1850
1849
|
}
|
|
1851
|
-
function
|
|
1850
|
+
function Jo(e, a) {
|
|
1852
1851
|
return a ? !W.some((t) => t.id === a) : !!e && !W.some((t) => t.name.toLocaleLowerCase() === e.toLocaleLowerCase());
|
|
1853
1852
|
}
|
|
1854
|
-
const
|
|
1853
|
+
const Zo = [1, 1, 1, 1, 1, 1, 1];
|
|
1855
1854
|
function ue(e) {
|
|
1856
1855
|
return (e + 6) % 7;
|
|
1857
1856
|
}
|
|
1858
|
-
function
|
|
1857
|
+
function qo(e) {
|
|
1859
1858
|
return (e + 1) % 7;
|
|
1860
1859
|
}
|
|
1861
|
-
function
|
|
1860
|
+
function he(e, a) {
|
|
1862
1861
|
e.splice(0, e.length, ...a);
|
|
1863
1862
|
}
|
|
1864
1863
|
function Sn(e, a) {
|
|
@@ -1870,7 +1869,7 @@ function kn(e) {
|
|
|
1870
1869
|
return a.length ? (a[0][0] + (((t = a[1]) == null ? void 0 : t[0]) ?? "")).toUpperCase() : "??";
|
|
1871
1870
|
}
|
|
1872
1871
|
const la = /* @__PURE__ */ new Map(), Se = /* @__PURE__ */ new Map();
|
|
1873
|
-
function
|
|
1872
|
+
function es(e) {
|
|
1874
1873
|
return la.get(e);
|
|
1875
1874
|
}
|
|
1876
1875
|
function Cn(e) {
|
|
@@ -1879,16 +1878,16 @@ function Cn(e) {
|
|
|
1879
1878
|
const t = aa + Se.size + 1;
|
|
1880
1879
|
return Se.set(e, t), la.set(t, e), t;
|
|
1881
1880
|
}
|
|
1882
|
-
function
|
|
1881
|
+
function as(e) {
|
|
1883
1882
|
return e.sourceId || String(e.id);
|
|
1884
1883
|
}
|
|
1885
1884
|
function Mn(e) {
|
|
1886
|
-
Ra.name = (e == null ? void 0 : e.outlet.name) ?? "",
|
|
1885
|
+
Ra.name = (e == null ? void 0 : e.outlet.name) ?? "", he(Ta, (e == null ? void 0 : e.positions.map((s) => s.name)) ?? []), he(W, (e == null ? void 0 : e.positions) ?? []);
|
|
1887
1886
|
const a = (e == null ? void 0 : e.restaurantProfile.operatingHours) ?? [], t = Array.from({ length: 7 }, () => []);
|
|
1888
1887
|
for (const s of a) t[ue(s.dayOfWeek)] = s.closed ? [] : s.hours;
|
|
1889
|
-
|
|
1888
|
+
he(N.dayHours, t);
|
|
1890
1889
|
const n = a.filter((s) => !s.closed).flatMap((s) => s.hours);
|
|
1891
|
-
N.openFrom = n.length ? n.map((s) => s.start).reduce((s, d) => d < s ? d : s) : "00:00", N.openTo = n.length ? n.map((s) => s.end).reduce((s, d) => d > s ? d : s) : "24:00",
|
|
1890
|
+
N.openFrom = n.length ? n.map((s) => s.start).reduce((s, d) => d < s ? d : s) : "00:00", N.openTo = n.length ? n.map((s) => s.end).reduce((s, d) => d > s ? d : s) : "24:00", he(
|
|
1892
1891
|
N.closedWeekdays,
|
|
1893
1892
|
a.filter((s) => s.closed).map((s) => ue(s.dayOfWeek)).sort((s, d) => s - d)
|
|
1894
1893
|
);
|
|
@@ -1985,7 +1984,7 @@ function xn(e) {
|
|
|
1985
1984
|
const t = (na.value[e] ?? ((n = le.value.find((o) => o._id === e)) == null ? void 0 : n.restaurantRole.map((o) => o.restaurantId)) ?? []).map((o) => se[o]).filter((o) => !!o);
|
|
1986
1985
|
return t.length ? Bn([...new Set(t)]) : void 0;
|
|
1987
1986
|
}
|
|
1988
|
-
function
|
|
1987
|
+
function ts(e = []) {
|
|
1989
1988
|
const a = r.value;
|
|
1990
1989
|
if (!a) return [];
|
|
1991
1990
|
const t = new Map(a.employees.map((s) => [s.employeeId, s])), n = new Map(
|
|
@@ -2004,7 +2003,7 @@ function ns(e = []) {
|
|
|
2004
2003
|
code: void 0,
|
|
2005
2004
|
passcode: "",
|
|
2006
2005
|
isMasterUser: !1
|
|
2007
|
-
}, D = we(s),
|
|
2006
|
+
}, D = we(s), p = Cn(s.employeeId), H = new Set(W.map((v) => v.id)), $ = new Set(W.map((v) => v.name.toLocaleLowerCase())), F = (v) => v.positionId ? H.has(v.positionId) : $.has(v.positionName.toLocaleLowerCase()), B = re(s.primaryPosition), f = !!s.primaryPosition && F(s.primaryPosition), b = s.secondaryPositions.filter(F).map((v) => re(v)).filter((v) => !!v), _ = B ? f ? [B, ...b] : [] : b, I = [
|
|
2008
2007
|
...B && !f ? [B] : [],
|
|
2009
2008
|
...s.secondaryPositions.filter((v) => !F(v)).map((v) => re(v)).filter((v) => !!v)
|
|
2010
2009
|
], de = _[0] ?? "", K = e.map((v) => {
|
|
@@ -2021,7 +2020,7 @@ function ns(e = []) {
|
|
|
2021
2020
|
return { from: (E == null ? void 0 : E.start) ?? "", to: (E == null ? void 0 : E.end) ?? "" };
|
|
2022
2021
|
});
|
|
2023
2022
|
return {
|
|
2024
|
-
id:
|
|
2023
|
+
id: p,
|
|
2025
2024
|
sourceId: s.employeeId,
|
|
2026
2025
|
// Employee page edits update the POS employee name. Use that as the display
|
|
2027
2026
|
// source so Scheduling reflects those changes after its roster refresh.
|
|
@@ -2035,7 +2034,7 @@ function ns(e = []) {
|
|
|
2035
2034
|
employmentType: s.employmentType,
|
|
2036
2035
|
role: de,
|
|
2037
2036
|
initials: kn(d.name),
|
|
2038
|
-
color: Ge[(
|
|
2037
|
+
color: Ge[(p - aa - 1) % Ge.length],
|
|
2039
2038
|
// Gross hours actually rostered this week — the figure the cost rail multiplies by
|
|
2040
2039
|
// the rate. Contracted hours are a separate question, answered by RULES.contract.
|
|
2041
2040
|
// Rounded to one decimal — `hoursBetween` divides by 60, so an unrounded sum reads
|
|
@@ -2075,10 +2074,10 @@ function ns(e = []) {
|
|
|
2075
2074
|
};
|
|
2076
2075
|
});
|
|
2077
2076
|
}
|
|
2078
|
-
function
|
|
2077
|
+
function ns() {
|
|
2079
2078
|
return [];
|
|
2080
2079
|
}
|
|
2081
|
-
function
|
|
2080
|
+
function os() {
|
|
2082
2081
|
var n, o;
|
|
2083
2082
|
const e = r.value, a = {}, t = {};
|
|
2084
2083
|
for (const i of (e == null ? void 0 : e.demands) ?? []) {
|
|
@@ -2093,7 +2092,7 @@ function ss() {
|
|
|
2093
2092
|
}
|
|
2094
2093
|
return { byDate: a, byWeekday: t };
|
|
2095
2094
|
}
|
|
2096
|
-
function
|
|
2095
|
+
function ss() {
|
|
2097
2096
|
const e = Je(), { restaurants: a, readRestaurants: t } = Ca(), n = Pa(), o = Sa(), i = S(!1);
|
|
2098
2097
|
let u = () => !0;
|
|
2099
2098
|
const s = Y(
|
|
@@ -2105,7 +2104,7 @@ function is() {
|
|
|
2105
2104
|
var f;
|
|
2106
2105
|
return ((f = e.currentRestaurant.value) == null ? void 0 : f._id) ?? "";
|
|
2107
2106
|
});
|
|
2108
|
-
async function
|
|
2107
|
+
async function p(f, b) {
|
|
2109
2108
|
return f !== m.value && !await u(f) || !ze(f) ? !1 : (localStorage.setItem(d(), f), n.query.restaurantId !== f && o.replace({ query: { ...n.query, restaurantId: f } }), await Promise.all([Ie(f), za(b)]), !0);
|
|
2110
2109
|
}
|
|
2111
2110
|
function H(f) {
|
|
@@ -2122,9 +2121,9 @@ function is() {
|
|
|
2122
2121
|
const f = await F();
|
|
2123
2122
|
return f && await Ie(f), f;
|
|
2124
2123
|
}
|
|
2125
|
-
return { options: s, ready: i, outletId: m, resolve: B, resolveOutlet: F, switchTo:
|
|
2124
|
+
return { options: s, ready: i, outletId: m, resolve: B, resolveOutlet: F, switchTo: p, setBeforeSwitch: H };
|
|
2126
2125
|
}
|
|
2127
|
-
const Yn = ["data-hierarchy", "data-size", "data-icon"],
|
|
2126
|
+
const Yn = ["data-hierarchy", "data-size", "data-icon"], is = /* @__PURE__ */ xe({
|
|
2128
2127
|
__name: "ScheduleButton",
|
|
2129
2128
|
props: {
|
|
2130
2129
|
hierarchy: { default: "primary" },
|
|
@@ -2157,7 +2156,7 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], rs = /* @__PURE__ */ xe
|
|
|
2157
2156
|
}, Qn = ["aria-selected", "onClick"], Xn = {
|
|
2158
2157
|
key: 0,
|
|
2159
2158
|
class: "fx-opt-text"
|
|
2160
|
-
}, Jn = { key: 0 },
|
|
2159
|
+
}, Jn = { key: 0 }, rs = /* @__PURE__ */ xe({
|
|
2161
2160
|
inheritAttrs: !1,
|
|
2162
2161
|
__name: "ScheduleSelect",
|
|
2163
2162
|
props: {
|
|
@@ -2175,7 +2174,7 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], rs = /* @__PURE__ */ xe
|
|
|
2175
2174
|
},
|
|
2176
2175
|
emits: ["update:modelValue", "toggle"],
|
|
2177
2176
|
setup(e, { emit: a }) {
|
|
2178
|
-
const { t } = ka(), n = e, o = a, i =
|
|
2177
|
+
const { t } = ka(), n = e, o = a, i = ha(), u = Y(() => i.class ?? ""), s = S(!1), d = S(!1), D = S(null), p = S(null), H = S(null), $ = Y(() => n.teleport !== !1 && d.value);
|
|
2179
2178
|
Re(() => {
|
|
2180
2179
|
d.value = typeof document < "u" && !!document.body;
|
|
2181
2180
|
});
|
|
@@ -2203,7 +2202,7 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], rs = /* @__PURE__ */ xe
|
|
|
2203
2202
|
return l;
|
|
2204
2203
|
}), K = 5, L = 8;
|
|
2205
2204
|
function ee() {
|
|
2206
|
-
const l = H.value, y =
|
|
2205
|
+
const l = H.value, y = p.value;
|
|
2207
2206
|
if (!l || !y) return;
|
|
2208
2207
|
const c = y.getBoundingClientRect(), O = window.innerWidth || document.documentElement.clientWidth, R = window.innerHeight || document.documentElement.clientHeight;
|
|
2209
2208
|
l.style.minWidth = `${Math.round(c.width)}px`, l.style.maxWidth = `${Math.max(180, Math.round(O - L * 2))}px`;
|
|
@@ -2223,7 +2222,7 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], rs = /* @__PURE__ */ xe
|
|
|
2223
2222
|
function me(l) {
|
|
2224
2223
|
const y = H.value, c = l.target;
|
|
2225
2224
|
if (y && c && c !== document && y.contains(c)) return;
|
|
2226
|
-
const O =
|
|
2225
|
+
const O = p.value;
|
|
2227
2226
|
if (!O) return;
|
|
2228
2227
|
const R = O.getBoundingClientRect(), ae = window.innerHeight || document.documentElement.clientHeight;
|
|
2229
2228
|
if (R.bottom < 0 || R.top > ae) {
|
|
@@ -2251,7 +2250,7 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], rs = /* @__PURE__ */ xe
|
|
|
2251
2250
|
function U(l) {
|
|
2252
2251
|
var y;
|
|
2253
2252
|
if (l.key === "Escape")
|
|
2254
|
-
l.preventDefault(), P(), (y =
|
|
2253
|
+
l.preventDefault(), P(), (y = p.value) == null || y.focus();
|
|
2255
2254
|
else if (l.key === "Enter") {
|
|
2256
2255
|
l.preventDefault();
|
|
2257
2256
|
const c = I.value.find((O) => !O.disabled);
|
|
@@ -2288,7 +2287,7 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], rs = /* @__PURE__ */ xe
|
|
|
2288
2287
|
var y;
|
|
2289
2288
|
if (l.key === "Escape") {
|
|
2290
2289
|
if (!s.value) return;
|
|
2291
|
-
l.preventDefault(), P(), (y =
|
|
2290
|
+
l.preventDefault(), P(), (y = p.value) == null || y.focus();
|
|
2292
2291
|
return;
|
|
2293
2292
|
}
|
|
2294
2293
|
if (l.key === "Enter" || l.key === " ") {
|
|
@@ -2300,11 +2299,11 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], rs = /* @__PURE__ */ xe
|
|
|
2300
2299
|
return $e(k), (l, y) => (C(), M("div", {
|
|
2301
2300
|
ref_key: "rootEl",
|
|
2302
2301
|
ref: D,
|
|
2303
|
-
class:
|
|
2302
|
+
class: pe(["fx-sel", u.value])
|
|
2304
2303
|
}, [
|
|
2305
2304
|
x("button", va({
|
|
2306
2305
|
ref_key: "btnEl",
|
|
2307
|
-
ref:
|
|
2306
|
+
ref: p
|
|
2308
2307
|
}, l.$attrs, {
|
|
2309
2308
|
type: "button",
|
|
2310
2309
|
class: ["sch-input fx-btn", { "is-open": s.value }],
|
|
@@ -2316,7 +2315,7 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], rs = /* @__PURE__ */ xe
|
|
|
2316
2315
|
}), [
|
|
2317
2316
|
x("span", _n, z(F.value), 1)
|
|
2318
2317
|
], 16, Fn),
|
|
2319
|
-
(C(),
|
|
2318
|
+
(C(), pa(ga, {
|
|
2320
2319
|
to: "body",
|
|
2321
2320
|
disabled: !$.value
|
|
2322
2321
|
}, [
|
|
@@ -2325,7 +2324,7 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], rs = /* @__PURE__ */ xe
|
|
|
2325
2324
|
key: 0,
|
|
2326
2325
|
ref_key: "popEl",
|
|
2327
2326
|
ref: H,
|
|
2328
|
-
class:
|
|
2327
|
+
class: pe(["fx-pop", { "fx-pop-rich": f.value }]),
|
|
2329
2328
|
role: "listbox",
|
|
2330
2329
|
"aria-multiselectable": e.multiple || void 0,
|
|
2331
2330
|
style: { visibility: "hidden" }
|
|
@@ -2353,7 +2352,7 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], rs = /* @__PURE__ */ xe
|
|
|
2353
2352
|
}, [
|
|
2354
2353
|
"heading" in c ? (C(), M("div", Gn, z(c.heading), 1)) : (C(), M("div", {
|
|
2355
2354
|
key: 1,
|
|
2356
|
-
class:
|
|
2355
|
+
class: pe(["fx-opt", {
|
|
2357
2356
|
"is-on": B(c.option),
|
|
2358
2357
|
"is-off": c.option.disabled,
|
|
2359
2358
|
"is-new": c.option.command
|
|
@@ -2394,7 +2393,7 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], rs = /* @__PURE__ */ xe
|
|
|
2394
2393
|
], 8, ["disabled"]))
|
|
2395
2394
|
], 2));
|
|
2396
2395
|
}
|
|
2397
|
-
}), Zn = ["id", "aria-labelledby", "aria-label"], Qe = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',
|
|
2396
|
+
}), Zn = ["id", "aria-labelledby", "aria-label"], Qe = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])', ls = /* @__PURE__ */ xe({
|
|
2398
2397
|
__name: "ScheduleModal",
|
|
2399
2398
|
props: {
|
|
2400
2399
|
open: { type: Boolean },
|
|
@@ -2423,8 +2422,8 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], rs = /* @__PURE__ */ xe
|
|
|
2423
2422
|
if (d.key !== "Tab" || !o.value) return;
|
|
2424
2423
|
const D = Array.from(o.value.querySelectorAll(Qe));
|
|
2425
2424
|
if (!D.length) return;
|
|
2426
|
-
const
|
|
2427
|
-
d.shiftKey && document.activeElement ===
|
|
2425
|
+
const p = D[0], H = D[D.length - 1];
|
|
2426
|
+
d.shiftKey && document.activeElement === p ? (d.preventDefault(), H.focus()) : !d.shiftKey && document.activeElement === H && (d.preventDefault(), p.focus());
|
|
2428
2427
|
}
|
|
2429
2428
|
return Be(
|
|
2430
2429
|
() => t.open,
|
|
@@ -2437,13 +2436,13 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], rs = /* @__PURE__ */ xe
|
|
|
2437
2436
|
}), (d, D) => e.open ? (C(), M("div", {
|
|
2438
2437
|
key: 0,
|
|
2439
2438
|
class: "modal-overlay open",
|
|
2440
|
-
onClick: D[0] || (D[0] = Ea((
|
|
2439
|
+
onClick: D[0] || (D[0] = Ea((p) => n("close"), ["self"]))
|
|
2441
2440
|
}, [
|
|
2442
2441
|
x("div", {
|
|
2443
2442
|
id: e.id,
|
|
2444
2443
|
ref_key: "panel",
|
|
2445
2444
|
ref: o,
|
|
2446
|
-
class:
|
|
2445
|
+
class: pe(["schedule-modal-panel", e.panelClass]),
|
|
2447
2446
|
style: ba(e.panelStyle),
|
|
2448
2447
|
role: "dialog",
|
|
2449
2448
|
"aria-modal": "true",
|
|
@@ -2457,101 +2456,101 @@ const Yn = ["data-hierarchy", "data-size", "data-icon"], rs = /* @__PURE__ */ xe
|
|
|
2457
2456
|
}
|
|
2458
2457
|
});
|
|
2459
2458
|
export {
|
|
2460
|
-
|
|
2461
|
-
|
|
2459
|
+
yo as $,
|
|
2460
|
+
jo as A,
|
|
2462
2461
|
Pn as B,
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2462
|
+
mo as C,
|
|
2463
|
+
uo as D,
|
|
2464
|
+
as as E,
|
|
2465
|
+
ro as F,
|
|
2467
2466
|
qe as G,
|
|
2468
2467
|
Me as H,
|
|
2469
2468
|
Oa as I,
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2469
|
+
fo as J,
|
|
2470
|
+
Co as K,
|
|
2471
|
+
Jo as L,
|
|
2473
2472
|
Na as M,
|
|
2474
|
-
|
|
2475
|
-
|
|
2473
|
+
Wo as N,
|
|
2474
|
+
Uo as O,
|
|
2476
2475
|
Ta as P,
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2476
|
+
_o as Q,
|
|
2477
|
+
co as R,
|
|
2478
|
+
Go as S,
|
|
2480
2479
|
ge as T,
|
|
2481
2480
|
ra as U,
|
|
2482
|
-
|
|
2483
|
-
|
|
2481
|
+
Ho as V,
|
|
2482
|
+
Vo as W,
|
|
2484
2483
|
V as X,
|
|
2485
2484
|
Fa as Y,
|
|
2486
2485
|
Ke as Z,
|
|
2487
|
-
|
|
2488
|
-
|
|
2486
|
+
qo as _,
|
|
2487
|
+
ts as a,
|
|
2489
2488
|
Bn as a0,
|
|
2490
2489
|
w as a1,
|
|
2491
2490
|
ue as a2,
|
|
2492
2491
|
re as a3,
|
|
2493
2492
|
se as a4,
|
|
2494
|
-
|
|
2495
|
-
|
|
2493
|
+
bo as a5,
|
|
2494
|
+
So as a6,
|
|
2496
2495
|
Te as a7,
|
|
2497
2496
|
X as a8,
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2497
|
+
Eo as a9,
|
|
2498
|
+
so as aA,
|
|
2499
|
+
ss as aB,
|
|
2500
|
+
wo as aC,
|
|
2501
|
+
Lo as aD,
|
|
2502
|
+
Mo as aE,
|
|
2504
2503
|
le as aF,
|
|
2505
|
-
|
|
2504
|
+
No as aG,
|
|
2506
2505
|
_a as aa,
|
|
2507
|
-
|
|
2506
|
+
ko as ab,
|
|
2508
2507
|
j as ac,
|
|
2509
2508
|
Cn as ad,
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2509
|
+
$o as ae,
|
|
2510
|
+
To as af,
|
|
2511
|
+
Ro as ag,
|
|
2512
|
+
Zo as ah,
|
|
2514
2513
|
za as ai,
|
|
2515
|
-
|
|
2514
|
+
xo as aj,
|
|
2516
2515
|
Ra as ak,
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2516
|
+
io as al,
|
|
2517
|
+
Io as am,
|
|
2518
|
+
go as an,
|
|
2520
2519
|
Ue as ao,
|
|
2521
|
-
|
|
2520
|
+
os as ap,
|
|
2522
2521
|
We as aq,
|
|
2523
2522
|
ve as ar,
|
|
2524
2523
|
Ie as as,
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2524
|
+
Yo as at,
|
|
2525
|
+
Ao as au,
|
|
2526
|
+
is as av,
|
|
2528
2527
|
oa as aw,
|
|
2529
|
-
|
|
2530
|
-
|
|
2528
|
+
rs as ax,
|
|
2529
|
+
ls as ay,
|
|
2531
2530
|
W as az,
|
|
2532
2531
|
N as b,
|
|
2533
|
-
|
|
2532
|
+
ns as c,
|
|
2534
2533
|
J as d,
|
|
2535
|
-
|
|
2536
|
-
|
|
2534
|
+
Qo as e,
|
|
2535
|
+
lo as f,
|
|
2537
2536
|
An as g,
|
|
2538
|
-
|
|
2537
|
+
zo as h,
|
|
2539
2538
|
Ba as i,
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2539
|
+
Oo as j,
|
|
2540
|
+
es as k,
|
|
2541
|
+
Bo as l,
|
|
2542
|
+
Fo as m,
|
|
2543
|
+
Ko as n,
|
|
2545
2544
|
m as o,
|
|
2546
2545
|
r as p,
|
|
2547
|
-
|
|
2548
|
-
|
|
2546
|
+
Do as q,
|
|
2547
|
+
Po as r,
|
|
2549
2548
|
La as s,
|
|
2550
2549
|
Le as t,
|
|
2551
|
-
|
|
2550
|
+
po as u,
|
|
2552
2551
|
ie as v,
|
|
2553
2552
|
ho as w,
|
|
2554
2553
|
Ne as x,
|
|
2555
|
-
|
|
2556
|
-
|
|
2554
|
+
Xo as y,
|
|
2555
|
+
vo as z
|
|
2557
2556
|
};
|