@feedmepos/mf-hrm-portal 2.0.17-dev.5 → 2.0.18-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/{AuditLogList-Dl3Nmf00.js → AuditLogList-CaoW9uYd.js} +5 -5
  2. package/dist/EmployeeList-DcMvF9U5.js +839 -0
  3. package/dist/Main-CleutFvF.js +567 -0
  4. package/dist/{Main-CQ3KwxDY.js → Main-CvW6Vu8N.js} +2055 -2055
  5. package/dist/{Main-w0XUUaBp.js → Main-D7k57uq5.js} +32 -32
  6. package/dist/{PermissionSetList-B8qNOWH6.js → PermissionSetList-CM7kbWkO.js} +6 -6
  7. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-C9VUjAu_.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Ces9YwYB.js} +525 -525
  8. package/dist/{RoleList-DMFJsUZv.js → RoleList-DR3eVJ9f.js} +102 -102
  9. package/dist/TeamMemberList-CZZv4Pu5.js +1038 -0
  10. package/dist/{TimesheetList-Bwp9_xHe.js → TimesheetList-WqqoKPbg.js} +132 -126
  11. package/dist/{app-COJbSNM4.js → app-R5EioPr4.js} +4 -4
  12. package/dist/app.js +1 -1
  13. package/dist/{dayjs.min-CcBi6N-K.js → dayjs.min-CN15Ft3o.js} +1 -1
  14. package/dist/employee-DwQlWLkL.js +204 -0
  15. package/dist/{iteration-JOKbtlLf.js → iteration-UBGGRoxQ.js} +9258 -9213
  16. package/dist/{lodash-D5xlVzib.js → lodash-CC6qHVUo.js} +1 -1
  17. package/dist/{rule-3sXHiW0y.js → rule-B519XbW6.js} +273 -273
  18. package/dist/src/api/restaurant/index.d.ts +5 -0
  19. package/dist/src/composables/useRestaurantMap.d.ts +2 -329
  20. package/dist/src/stores/restaurant.d.ts +181 -0
  21. package/dist/src/stores/role.d.ts +7 -7
  22. package/dist/src/types/restaurant.d.ts +11 -0
  23. package/dist/style.css +1 -1
  24. package/dist/{team-CyNektSD.js → team-BGLhgx5P.js} +1 -1
  25. package/dist/{timesheet-DkD3AysG.js → timesheet-BylrXRfd.js} +2 -2
  26. package/dist/tsconfig.app.tsbuildinfo +1 -1
  27. package/dist/useAppStore-Akl8AoVN.js +171 -0
  28. package/dist/{useLoading-4TNmhm5N.js → useLoading-rbrVwWuj.js} +1 -1
  29. package/dist/{useReportPermissions-CWMFFb8E.js → useReportPermissions-BOEZU86S.js} +3 -3
  30. package/package.json +1 -1
  31. package/dist/EmployeeList-DBd_rVW2.js +0 -831
  32. package/dist/Main-pTgqNncY.js +0 -560
  33. package/dist/TeamMemberList-BLRTfKLz.js +0 -1031
  34. package/dist/employee-xiV0LfnL.js +0 -204
  35. package/dist/useAppStore-CvmsaYSG.js +0 -171
@@ -0,0 +1,567 @@
1
+ import { ref as S, defineComponent as Q, computed as V, watch as ce, resolveComponent as h, createElementBlock as K, openBlock as I, Fragment as J, renderSlot as ge, createVNode as n, unref as s, withCtx as x, createElementVNode as l, toDisplayString as k, createBlock as E, isRef as re, renderList as fe, createCommentVNode as ve, withModifiers as oe, createTextVNode as ne, normalizeClass as _e, h as _ } from "vue";
2
+ import { useI18n as X, useCoreStore as ye } from "@feedmepos/mf-common";
3
+ import { _ as Ue } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
4
+ import { u as Y } from "./useAppStore-Akl8AoVN.js";
5
+ import { g as z, a as he, b as q, u as Z } from "./iteration-UBGGRoxQ.js";
6
+ import { defineStore as xe } from "pinia";
7
+ import { useSnackbar as ie, components as M, useDialog as be, useBreakpoints as we, FmButtonVariant as H } from "@feedmepos/ui-library";
8
+ import { S as D } from "./SelectFilter-DUj7GBtT.js";
9
+ import { _ as ke } from "./app-R5EioPr4.js";
10
+ import { _ as le, H as Ve } from "./FormItem.vue_vue_type_script_setup_true_lang-CoorkndT.js";
11
+ import { _ as Fe } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
12
+ import { u as Ie } from "./useSearch-BAPEUu1R.js";
13
+ import { u as ue } from "./useLoading-rbrVwWuj.js";
14
+ import { _ as Se } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
15
+ const W = {
16
+ async getGrantUsers() {
17
+ return z(await q("grant").get(""));
18
+ },
19
+ async createGrantUser(p) {
20
+ return z(await q("grant").post("", p));
21
+ },
22
+ async revokeGrantUser(p, y) {
23
+ return z(
24
+ await q("grant").patch(`/revoke/${p}`, null, {
25
+ params: { restaurantId: y }
26
+ })
27
+ );
28
+ },
29
+ // Test grant validation
30
+ async validatePasscode(p, y) {
31
+ return z(
32
+ await he().post("", {
33
+ passcode: p,
34
+ restaurantId: y
35
+ })
36
+ );
37
+ }
38
+ }, Ce = xe("grantUser", () => {
39
+ const p = S([]), y = S(!1);
40
+ async function a() {
41
+ y.value = !0;
42
+ try {
43
+ p.value = (await W.getGrantUsers()).sort(
44
+ (u, m) => u.createdAt < m.createdAt ? 1 : -1
45
+ );
46
+ } catch (u) {
47
+ throw console.error("Error reading grant users:", u), u;
48
+ } finally {
49
+ y.value = !1;
50
+ }
51
+ }
52
+ async function U(u) {
53
+ try {
54
+ const m = await W.createGrantUser(u);
55
+ return p.value = [m, ...p.value], m;
56
+ } catch (m) {
57
+ throw console.error("Error creating grant user:", m), m;
58
+ }
59
+ }
60
+ async function b(u, m) {
61
+ try {
62
+ const r = await W.revokeGrantUser(u, m), c = p.value.findIndex((i) => i._id === u);
63
+ c !== -1 && (p.value[c] = r);
64
+ } catch (r) {
65
+ throw console.error("Error revoking grant user:", r), r;
66
+ }
67
+ }
68
+ return {
69
+ grantUsers: p,
70
+ isLoading: y,
71
+ readGrantUsers: a,
72
+ createGrantUser: U,
73
+ revokeGrantUser: b
74
+ };
75
+ }), ee = Ce, Be = { class: "fm-typo-en-title-md-600" }, $e = { class: "space-y-40" }, Ge = { class: "flex gap-8 items-center justify-start" }, Re = /* @__PURE__ */ Q({
76
+ __name: "GrantUserForm",
77
+ setup(p, { expose: y }) {
78
+ const a = ee(), U = Y(), b = Z(), u = ie(), m = ue(u), { t: r } = X(), c = S(!1), i = S({
79
+ name: "",
80
+ restaurantId: "",
81
+ roleId: ""
82
+ }), w = () => {
83
+ i.value = {
84
+ name: "",
85
+ restaurantId: "",
86
+ roleId: ""
87
+ }, c.value = !0;
88
+ }, C = V(() => r("grantUser.form.title")), F = V(() => r("common.create")), G = V(() => b.restaurants.value.map((d) => ({
89
+ label: `${d.profile.code ? d.profile.code + " - " : ""}${d.profile.name}`,
90
+ value: d._id
91
+ }))), R = V(() => i.value.restaurantId ? U.roles.value.filter((d) => d.restaurants.some((g) => g.id === i.value.restaurantId)).map((d) => ({
92
+ label: d.name,
93
+ value: d._id,
94
+ disabled: !d.isUsable
95
+ })) : []);
96
+ ce(
97
+ () => i.value.restaurantId,
98
+ () => {
99
+ i.value.roleId = "";
100
+ }
101
+ );
102
+ async function P() {
103
+ await m.minor(async () => {
104
+ const d = await a.createGrantUser(i.value);
105
+ u.open({
106
+ message: r("grantUser.create.successMessage", {
107
+ passcode: d.passcode
108
+ }),
109
+ type: "success"
110
+ });
111
+ }), c.value = !1;
112
+ }
113
+ return y({
114
+ show: c,
115
+ trigger: w
116
+ }), (d, g) => {
117
+ const T = h("FmTextField"), $ = h("FmSelect"), L = h("fm-button"), N = h("fm-side-sheet");
118
+ return I(), K(J, null, [
119
+ ge(d.$slots, "default", { trigger: w }),
120
+ n(N, {
121
+ id: "grant-user-form",
122
+ modelValue: c.value,
123
+ "onUpdate:modelValue": g[4] || (g[4] = (f) => c.value = f),
124
+ "is-container": s(M).FmForm,
125
+ "is-container-props": {
126
+ onValidationSuccess: P,
127
+ blameFormChildOnValidationFailed: !0
128
+ },
129
+ "max-width": 560
130
+ }, {
131
+ "side-sheet-header": x(() => [
132
+ l("p", Be, k(C.value), 1)
133
+ ]),
134
+ "side-sheet-footer": x(() => [
135
+ l("div", Ge, [
136
+ n(L, {
137
+ label: F.value,
138
+ size: "lg",
139
+ type: "submit",
140
+ variant: "primary"
141
+ }, null, 8, ["label"]),
142
+ n(L, {
143
+ label: s(r)("common.cancel"),
144
+ size: "lg",
145
+ variant: "tertiary",
146
+ onClick: g[3] || (g[3] = () => c.value = !1)
147
+ }, null, 8, ["label"])
148
+ ])
149
+ ]),
150
+ default: x(() => [
151
+ l("div", $e, [
152
+ n(Se, {
153
+ title: s(r)("grantUser.form.section")
154
+ }, {
155
+ default: x(() => [
156
+ n(T, {
157
+ modelValue: i.value.name,
158
+ "onUpdate:modelValue": g[0] || (g[0] = (f) => i.value.name = f),
159
+ label: s(r)("grantUser.form.name"),
160
+ rules: [(f) => !!f || s(r)("grantUser.form.nameRequired")]
161
+ }, null, 8, ["modelValue", "label", "rules"]),
162
+ n(le, {
163
+ label: s(r)("grantUser.form.restaurant")
164
+ }, {
165
+ default: x(() => [
166
+ n($, {
167
+ modelValue: i.value.restaurantId,
168
+ "onUpdate:modelValue": g[1] || (g[1] = (f) => i.value.restaurantId = f),
169
+ items: G.value,
170
+ placeholder: s(r)("grantUser.form.selectRestaurant"),
171
+ rules: [(f) => !!f || s(r)("grantUser.form.restaurantRequired")]
172
+ }, null, 8, ["modelValue", "items", "placeholder", "rules"])
173
+ ]),
174
+ _: 1
175
+ }, 8, ["label"]),
176
+ n(le, {
177
+ label: s(r)("grantUser.form.role")
178
+ }, {
179
+ default: x(() => [
180
+ n($, {
181
+ modelValue: i.value.roleId,
182
+ "onUpdate:modelValue": g[2] || (g[2] = (f) => i.value.roleId = f),
183
+ items: R.value,
184
+ placeholder: s(r)("grantUser.form.selectRole"),
185
+ disabled: !i.value.restaurantId,
186
+ rules: [(f) => !!f || s(r)("grantUser.form.roleRequired")]
187
+ }, null, 8, ["modelValue", "items", "placeholder", "disabled", "rules"])
188
+ ]),
189
+ _: 1
190
+ }, 8, ["label"])
191
+ ]),
192
+ _: 1
193
+ }, 8, ["title"])
194
+ ])
195
+ ]),
196
+ _: 1
197
+ }, 8, ["modelValue", "is-container", "is-container-props"])
198
+ ], 64);
199
+ };
200
+ }
201
+ }), Le = {
202
+ class: "space-y-8"
203
+ }, Ne = {
204
+ class: "xs:hidden flex w-full items-start justify-between"
205
+ }, Ae = {
206
+ class: "flex items-start gap-8"
207
+ }, ze = {
208
+ class: "space-y-4 hidden xs:block"
209
+ }, De = {
210
+ class: "px-16"
211
+ }, Ke = {
212
+ class: "px-16 flex items-start gap-8"
213
+ }, Ee = {
214
+ class: "pb-64 hidden xs:block"
215
+ }, Me = {
216
+ class: "space-y-4"
217
+ }, Pe = {
218
+ class: "flex items-center gap-8"
219
+ }, Te = {
220
+ class: "fm-typo-en-body-lg-600"
221
+ }, Oe = {
222
+ class: "font-mono text-lg font-bold mr-4"
223
+ }, je = {
224
+ class: "text-fm-color-typo-secondary"
225
+ }, qe = {
226
+ class: "text-xs"
227
+ }, He = {
228
+ class: "mt-4 space-y-2"
229
+ }, We = {
230
+ class: "text-xs"
231
+ }, Je = {
232
+ class: "text-xs"
233
+ }, Qe = {
234
+ key: 0,
235
+ class: "flex flex-col gap-4"
236
+ }, Xe = /* @__PURE__ */ Q({
237
+ __name: "GrantUserList",
238
+ setup(p, {
239
+ expose: y
240
+ }) {
241
+ const {
242
+ t: a
243
+ } = X(), U = S(), b = ee(), {
244
+ restaurants: u
245
+ } = Z(), {
246
+ roles: m
247
+ } = Y(), r = V(() => b.grantUsers), {
248
+ searchKey: c,
249
+ filter: i
250
+ } = Ie(), w = V(() => {
251
+ var e;
252
+ return (e = r.value) == null ? void 0 : e.filter((t) => {
253
+ const v = !U.value || U.value.includes(t.restaurantId), O = !B.value || B.value.includes(t.status), A = C.value[t.restaurantId] || "", j = F.value[t.roleId] || "";
254
+ return v && O && i([t.passcode, t.name, A, j, t.grantByName]);
255
+ });
256
+ }), C = V(() => {
257
+ const e = {};
258
+ return u.value.forEach((t) => {
259
+ e[t._id] = t.profile.name;
260
+ }), e;
261
+ }), F = V(() => {
262
+ const e = {};
263
+ return m.value.forEach((t) => {
264
+ e[t._id] = t.name;
265
+ }), e;
266
+ }), G = (e) => {
267
+ switch (e) {
268
+ case "active":
269
+ return "bg-fm-color-system-success-100 text-fm-color-typo-success";
270
+ case "used":
271
+ return "bg-fm-color-typo-tertiary text-fm-color-typo-primary";
272
+ case "revoked":
273
+ return "bg-fm-color-system-error-100 text-fm-color-typo-error";
274
+ default:
275
+ return "bg-fm-color-typo-secondary text-fm-color-typo-primary";
276
+ }
277
+ }, R = (e) => a(`grantUser.status.${e}`), P = [{
278
+ accessorKey: "passcode",
279
+ size: 120,
280
+ maxSize: 120,
281
+ minSize: 120,
282
+ header: () => a("grantUser.columns.passcode"),
283
+ cell(e) {
284
+ const t = e.row.original.passcode;
285
+ return _("div", {
286
+ class: "flex items-center gap-8"
287
+ }, [_(M.FmButton, {
288
+ variant: H.Tertiary,
289
+ textColor: "neutral-gray-400",
290
+ icon: "content_copy",
291
+ onClick: (v) => {
292
+ v.stopPropagation(), se(t);
293
+ }
294
+ }), _("span", {
295
+ class: "font-mono text-lg font-bold"
296
+ }, t)]);
297
+ }
298
+ }, {
299
+ accessorKey: "name",
300
+ header: () => a("grantUser.columns.name")
301
+ }, {
302
+ accessorKey: "restaurantName",
303
+ accessorFn: (e) => C.value[e.restaurantId],
304
+ header: () => a("grantUser.columns.restaurant"),
305
+ meta: {
306
+ width: "250px"
307
+ },
308
+ cell(e) {
309
+ const t = e.row.original.restaurantId, v = C.value[t] || "-";
310
+ return _("div", [_("div", v), _("div", {
311
+ class: "text-fm-color-typo-secondary text-sm"
312
+ }, `${t}`)]);
313
+ }
314
+ }, {
315
+ accessorKey: "roleName",
316
+ accessorFn: (e) => F.value[e.roleId],
317
+ header: () => a("grantUser.columns.role"),
318
+ cell(e) {
319
+ const t = e.row.original.roleId, v = F.value[t] || "-";
320
+ return _("div", v);
321
+ }
322
+ }, {
323
+ accessorKey: "status",
324
+ header: () => a("grantUser.columns.status"),
325
+ meta: {
326
+ maxWidth: "120px"
327
+ },
328
+ cell(e) {
329
+ const t = e.row.original.status;
330
+ return _(M.FmChip, {
331
+ label: R(t),
332
+ class: G(t)
333
+ });
334
+ }
335
+ }, {
336
+ accessorKey: "grantByName",
337
+ header: () => a("grantUser.columns.grantedBy"),
338
+ cell(e) {
339
+ const t = e.row.original.grantById, v = e.row.original.grantByName;
340
+ return _("div", [_("div", v), _("div", {
341
+ class: "text-fm-color-typo-secondary text-sm"
342
+ }, `${t}`)]);
343
+ }
344
+ }, {
345
+ accessorKey: "createdAt",
346
+ header: () => a("grantUser.columns.createdAt"),
347
+ cell(e) {
348
+ const t = e.row.original.createdAt;
349
+ return _("div", new Date(t).toLocaleString());
350
+ }
351
+ }, {
352
+ id: "action",
353
+ size: 180,
354
+ meta: {
355
+ cellClass: "p-16",
356
+ headerContentClass: "-mx-16"
357
+ },
358
+ cell: (e) => {
359
+ const t = e.row.original;
360
+ return t.status !== "active" ? null : _("div", {
361
+ class: "w-full flex justify-end items-center gap-4"
362
+ }, [_(M.FmButton, {
363
+ label: a("grantUser.actions.revoke"),
364
+ variant: H.Secondary,
365
+ onClick: (v) => {
366
+ v.stopPropagation(), N(t);
367
+ }
368
+ })]);
369
+ }
370
+ }], d = ie(), g = be(), T = ue(d), $ = S(), {
371
+ breakpoints: L
372
+ } = we(), N = (e) => {
373
+ g.open({
374
+ title: a("grantUser.revoke.title"),
375
+ message: a("grantUser.revoke.message", {
376
+ name: e.name
377
+ }),
378
+ minWidth: L.value.lg ? 588 : 0,
379
+ primaryActions: {
380
+ text: a("grantUser.actions.revoke"),
381
+ close: !1,
382
+ variant: "destructive"
383
+ },
384
+ secondaryActions: {
385
+ text: a("common.cancel"),
386
+ close: !0
387
+ }
388
+ }).onPrimary(async () => {
389
+ T.minor(async () => {
390
+ await b.revokeGrantUser(e._id, e.restaurantId);
391
+ }, {
392
+ successMessage: a("grantUser.revoke.successMessage", {
393
+ name: e.name
394
+ })
395
+ }), g.close();
396
+ });
397
+ };
398
+ function f() {
399
+ var e;
400
+ (e = $.value) == null || e.trigger();
401
+ }
402
+ const te = V(() => [{
403
+ label: a("grantUser.status.active"),
404
+ value: "active"
405
+ }, {
406
+ label: a("grantUser.status.used"),
407
+ value: "used"
408
+ }, {
409
+ label: a("grantUser.status.revoked"),
410
+ value: "revoked"
411
+ }]), ae = V(() => u.value.map((e) => ({
412
+ label: `${e.profile.code ? `${e.profile.code} - ` : ""}${e.profile.name}`,
413
+ value: e._id
414
+ }))), B = S();
415
+ async function se(e) {
416
+ try {
417
+ await navigator.clipboard.writeText(e), d.open({
418
+ message: a("grantUser.passcode.copied"),
419
+ type: "success"
420
+ });
421
+ } catch (t) {
422
+ d.open({
423
+ message: String(t),
424
+ type: "error"
425
+ });
426
+ }
427
+ }
428
+ return y({
429
+ create: f,
430
+ filteredGrantUsers: w
431
+ }), (e, t) => {
432
+ const v = h("FmSearch"), O = h("FmTable"), A = h("FmButton"), j = h("FmChip"), de = h("FmListItem"), me = h("FmList");
433
+ return I(), K(J, null, [n(Re, {
434
+ ref_key: "grantUserFormRef",
435
+ ref: $,
436
+ class: "gap-8"
437
+ }, null, 512), l("div", Le, [l("div", Ne, [l("div", Ae, [n(D, {
438
+ modelValue: U.value,
439
+ "onUpdate:modelValue": t[0] || (t[0] = (o) => U.value = o),
440
+ multiple: "",
441
+ items: ae.value,
442
+ variant: "dark",
443
+ "selected-prefix": s(a)("grantUser.columns.restaurant"),
444
+ placeholder: s(a)("grantUser.columns.restaurant"),
445
+ class: "!w-auto"
446
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), n(D, {
447
+ modelValue: B.value,
448
+ "onUpdate:modelValue": t[1] || (t[1] = (o) => B.value = o),
449
+ multiple: "",
450
+ variant: "dark",
451
+ items: te.value,
452
+ "selected-prefix": s(a)("grantUser.filter.selected_status_prefix"),
453
+ placeholder: s(a)("grantUser.filter.status_placeholder")
454
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), n(v, {
455
+ modelValue: s(c),
456
+ "onUpdate:modelValue": t[2] || (t[2] = (o) => re(c) ? c.value = o : null),
457
+ autofocus: "",
458
+ class: "pl-4 w-[320px]",
459
+ placeholder: s(a)("grantUser.search.placeholder")
460
+ }, null, 8, ["modelValue", "placeholder"])]), l("div", ze, [l("div", De, [n(v, {
461
+ modelValue: s(c),
462
+ "onUpdate:modelValue": t[3] || (t[3] = (o) => re(c) ? c.value = o : null),
463
+ autofocus: "",
464
+ placeholder: s(a)("grantUser.search.placeholder")
465
+ }, null, 8, ["modelValue", "placeholder"])]), n(Ve), l("div", Ke, [n(D, {
466
+ modelValue: U.value,
467
+ "onUpdate:modelValue": t[4] || (t[4] = (o) => U.value = o),
468
+ multiple: "",
469
+ items: ae.value,
470
+ variant: "dark",
471
+ "selected-prefix": s(a)("grantUser.columns.restaurant"),
472
+ placeholder: s(a)("grantUser.columns.restaurant"),
473
+ class: "!w-auto"
474
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), n(D, {
475
+ modelValue: B.value,
476
+ "onUpdate:modelValue": t[5] || (t[5] = (o) => B.value = o),
477
+ multiple: "",
478
+ items: te.value,
479
+ variant: "dark",
480
+ "selected-prefix": s(a)("grantUser.filter.selected_status_prefix"),
481
+ placeholder: s(a)("grantUser.filter.status_placeholder")
482
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), r.value.length > 0 || s(b).isLoading ? (I(), E(ke, {
483
+ key: 0,
484
+ class: "overflow-auto"
485
+ }, {
486
+ default: x(() => [n(O, {
487
+ class: "xs:hidden",
488
+ "column-defs": P,
489
+ "row-data": w.value,
490
+ "page-size": w.value.length,
491
+ loading: s(b).isLoading,
492
+ virtual: w.value.length > 0,
493
+ "pin-header-row": "",
494
+ "hide-footer": ""
495
+ }, null, 8, ["row-data", "page-size", "loading", "virtual"]), l("div", Ee, [n(me, {
496
+ separator: ""
497
+ }, {
498
+ default: x(() => [(I(!0), K(J, null, fe(w.value, (o) => (I(), E(de, {
499
+ key: o._id,
500
+ class: "py-12 px-16 items-center justify-between"
501
+ }, {
502
+ default: x(() => [l("div", Me, [l("div", Pe, [n(A, {
503
+ variant: "tertiary",
504
+ "text-color": "neutral-gray-400",
505
+ icon: "content_copy",
506
+ onClick: oe((pe) => se(o.passcode), ["stop"])
507
+ }, null, 8, ["onClick"]), l("p", Te, [l("span", Oe, k(o.passcode), 1), ne(" - " + k(o.name), 1)])]), l("div", je, [l("div", null, [ne(k(C.value[o.restaurantId] || "-") + " ", 1), l("div", qe, k(o.restaurantId), 1), l("div", null, k(F.value[o.roleId] || "-"), 1)]), l("div", He, [l("div", We, k(s(a)("grantUser.columns.grantedBy")) + ": " + k(o.grantByName), 1), l("div", Je, k(s(a)("grantUser.columns.createdAt")) + ": " + k(new Date(o.createdAt).toLocaleString()), 1), n(j, {
508
+ label: R(o.status),
509
+ class: _e(G(o.status))
510
+ }, null, 8, ["label", "class"])])])]), o.status === "active" ? (I(), K("div", Qe, [n(A, {
511
+ label: s(a)("grantUser.actions.revoke"),
512
+ variant: s(H).Secondary,
513
+ onClick: oe((pe) => N(o), ["stop"])
514
+ }, null, 8, ["label", "variant", "onClick"])])) : ve("", !0)]),
515
+ _: 2
516
+ }, 1024))), 128))]),
517
+ _: 1
518
+ })])]),
519
+ _: 1
520
+ })) : (I(), E(s(Fe), {
521
+ key: 1,
522
+ title: s(a)("grantUser.noData.title"),
523
+ subtitle: s(a)("grantUser.noData.subtitle")
524
+ }, null, 8, ["title", "subtitle"]))])], 64);
525
+ };
526
+ }
527
+ }), mt = /* @__PURE__ */ Q({
528
+ __name: "Main",
529
+ setup(p) {
530
+ const { readGrantUsers: y } = ee(), { currentBusiness: a } = ye(), { readRoles: U } = Y(), { readRestaurants: b } = Z(), { t: u } = X(), m = S();
531
+ return ce(
532
+ a,
533
+ async () => {
534
+ var r;
535
+ (r = a.value) != null && r._id && await Promise.all([b(), U(), y()]);
536
+ },
537
+ { immediate: !0 }
538
+ ), (r, c) => {
539
+ const i = h("FmSpacer"), w = h("FmButton");
540
+ return I(), E(Ue, {
541
+ heading: s(u)("grantUser.title")
542
+ }, {
543
+ "append-heading": x(() => [
544
+ n(i),
545
+ n(w, {
546
+ "prepend-icon": "add",
547
+ label: s(u)("grantUser.actions.create"),
548
+ onClick: c[0] || (c[0] = (C) => {
549
+ var F;
550
+ return (F = m.value) == null ? void 0 : F.create();
551
+ })
552
+ }, null, 8, ["label"])
553
+ ]),
554
+ default: x(() => [
555
+ n(Xe, {
556
+ ref_key: "grantUserListRef",
557
+ ref: m
558
+ }, null, 512)
559
+ ]),
560
+ _: 1
561
+ }, 8, ["heading"]);
562
+ };
563
+ }
564
+ });
565
+ export {
566
+ mt as default
567
+ };