@feedmepos/mf-hrm-portal 2.0.18-dev.2 → 2.0.18

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 (60) hide show
  1. package/dist/AuditLogList-CfvB_c7-.js +980 -0
  2. package/dist/EmployeeList-Whx8sBTA.js +736 -0
  3. package/dist/FormSection.vue_vue_type_script_setup_true_lang-BVb8c4YU.js +71 -0
  4. package/dist/HorizontalSplitter-o860F4xM.js +12 -0
  5. package/dist/Main-C_Tm3462.js +85 -0
  6. package/dist/{Main-dqgR1UXY.js → Main-CoGNATjU.js} +175 -181
  7. package/dist/{Main-BbOMNP31.js → Main-D2LWkcaI.js} +761 -758
  8. package/dist/PermissionSetList-RYl82f1k.js +341 -0
  9. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BiImcVpI.js +3480 -0
  10. package/dist/RoleList-D0KdTM9G.js +530 -0
  11. package/dist/TeamMemberList-DDBFCFlj.js +1108 -0
  12. package/dist/{TimesheetList-D29EFj1Q.js → TimesheetList-BzYGHK7n.js} +126 -132
  13. package/dist/{app-SadE2J6-.js → app-BMnTcaqa.js} +1210 -1186
  14. package/dist/app.js +1 -1
  15. package/dist/{dayjs.min-DKCxxK08.js → dayjs.min-CTzjqhN9.js} +1 -1
  16. package/dist/employee-DeAtPDRi.js +204 -0
  17. package/dist/{iteration-QZxp7XeE.js → iteration-L53uoXdY.js} +5762 -5807
  18. package/dist/{lodash-DrksHyHu.js → lodash-t9DlqugD.js} +1 -1
  19. package/dist/{rule-CSsgDC6F.js → rule-BCN5fKAA.js} +265 -263
  20. package/dist/src/api/audit-log/index.d.ts +0 -9
  21. package/dist/src/components/CheckboxInput.vue.d.ts +1 -1
  22. package/dist/src/components/CollapsibleWrapper.vue.d.ts +0 -2
  23. package/dist/src/composables/useBasePermission.d.ts +0 -1
  24. package/dist/src/composables/useRestaurantMap.d.ts +329 -2
  25. package/dist/src/stores/role.d.ts +7 -7
  26. package/dist/src/stores/team.d.ts +6 -6
  27. package/dist/src/types/restaurant.d.ts +0 -11
  28. package/dist/src/types/team.d.ts +1 -1
  29. package/dist/src/views/hr/locales/index.d.ts +0 -16
  30. package/dist/src/views/team/components/BasePermission.vue.d.ts +7 -3
  31. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +2 -2
  32. package/dist/src/views/team/locales/index.d.ts +28 -32
  33. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +3 -5
  34. package/dist/style.css +1 -1
  35. package/dist/{timesheet-sBe_HCZh.js → timesheet-D41pctAm.js} +2 -2
  36. package/dist/tsconfig.app.tsbuildinfo +1 -1
  37. package/dist/useAppStore-fl7zMdUR.js +171 -0
  38. package/dist/useDebounce-B8ZPVS5C.js +15 -0
  39. package/dist/useDiscardConfirm-BHni0LNu.js +28 -0
  40. package/dist/{useLoading-PTqnaz_W.js → useLoading-BbpH9pow.js} +1 -1
  41. package/dist/{useReportPermissions-C3Uzu7vB.js → useReportPermissions-qEea7Dnt.js} +3 -3
  42. package/dist/useSearch-B6WK1LBB.js +15 -0
  43. package/package.json +2 -2
  44. package/dist/AuditLogList-D4E8pss5.js +0 -1037
  45. package/dist/CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js +0 -58
  46. package/dist/EmployeeList-BfJO89pN.js +0 -827
  47. package/dist/FormItem.vue_vue_type_script_setup_true_lang-D3MOFOUI.js +0 -45
  48. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +0 -49
  49. package/dist/Main-XmxzThcC.js +0 -86
  50. package/dist/PermissionSetList-DO0PRS6Z.js +0 -347
  51. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DL4_xvBZ.js +0 -3443
  52. package/dist/RoleList-DB3NfUYF.js +0 -545
  53. package/dist/TeamMemberList-4hEx6L5r.js +0 -1090
  54. package/dist/employee-3KJs872J.js +0 -204
  55. package/dist/src/api/restaurant/index.d.ts +0 -5
  56. package/dist/src/components/Skeleton.vue.d.ts +0 -7
  57. package/dist/src/stores/restaurant.d.ts +0 -181
  58. package/dist/useAppStore-BDADkWuX.js +0 -171
  59. package/dist/useDebounce-CWb5QR9G.js +0 -28
  60. package/dist/useDiscardConfirm-DPhEV6v0.js +0 -157
@@ -1,26 +1,27 @@
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-BDADkWuX.js";
5
- import { g as z, a as he, b as q, u as Z } from "./iteration-QZxp7XeE.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-SadE2J6-.js";
10
- import { _ as le, u as Ve, H as Fe } from "./FormItem.vue_vue_type_script_setup_true_lang-D3MOFOUI.js";
11
- import { _ as Ie } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
12
- import { u as ue } from "./useLoading-PTqnaz_W.js";
13
- import { _ as Se } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
14
- const W = {
1
+ import { ref as S, defineComponent as J, computed as F, watch as ce, resolveComponent as h, createElementBlock as D, openBlock as I, Fragment as W, renderSlot as ge, createVNode as n, unref as s, withCtx as x, createElementVNode as l, toDisplayString as k, createBlock as K, isRef as ae, renderList as fe, createCommentVNode as ve, withModifiers as se, createTextVNode as re, normalizeClass as _e, h as _ } from "vue";
2
+ import { useCoreStore as Q, useI18n as X, RestaurantSelector as oe } from "@feedmepos/mf-common";
3
+ import { _ as ye } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
4
+ import { u as Y } from "./useAppStore-fl7zMdUR.js";
5
+ import { defineStore as Ue } from "pinia";
6
+ import { g as z, a as he, b as O } from "./iteration-L53uoXdY.js";
7
+ import { useSnackbar as ie, components as E, useDialog as xe, useBreakpoints as be, FmButtonVariant as q } from "@feedmepos/ui-library";
8
+ import { S as ne } from "./SelectFilter-DUj7GBtT.js";
9
+ import { _ as we } from "./app-BMnTcaqa.js";
10
+ import { H as ke } from "./HorizontalSplitter-o860F4xM.js";
11
+ import { _ as Ve } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
12
+ import { u as Fe } from "./useSearch-B6WK1LBB.js";
13
+ import { u as ue } from "./useLoading-BbpH9pow.js";
14
+ import { _ as Ie, a as le } from "./FormSection.vue_vue_type_script_setup_true_lang-BVb8c4YU.js";
15
+ const H = {
15
16
  async getGrantUsers() {
16
- return z(await q("grant").get(""));
17
+ return z(await O("grant").get(""));
17
18
  },
18
19
  async createGrantUser(p) {
19
- return z(await q("grant").post("", p));
20
+ return z(await O("grant").post("", p));
20
21
  },
21
22
  async revokeGrantUser(p, y) {
22
23
  return z(
23
- await q("grant").patch(`/revoke/${p}`, null, {
24
+ await O("grant").patch(`/revoke/${p}`, null, {
24
25
  params: { restaurantId: y }
25
26
  })
26
27
  );
@@ -34,31 +35,31 @@ const W = {
34
35
  })
35
36
  );
36
37
  }
37
- }, Ce = xe("grantUser", () => {
38
+ }, Se = Ue("grantUser", () => {
38
39
  const p = S([]), y = S(!1);
39
40
  async function a() {
40
41
  y.value = !0;
41
42
  try {
42
- p.value = (await W.getGrantUsers()).sort(
43
- (u, m) => u.createdAt < m.createdAt ? 1 : -1
43
+ p.value = (await H.getGrantUsers()).sort(
44
+ (d, m) => d.createdAt < m.createdAt ? 1 : -1
44
45
  );
45
- } catch (u) {
46
- throw console.error("Error reading grant users:", u), u;
46
+ } catch (d) {
47
+ throw console.error("Error reading grant users:", d), d;
47
48
  } finally {
48
49
  y.value = !1;
49
50
  }
50
51
  }
51
- async function U(u) {
52
+ async function U(d) {
52
53
  try {
53
- const m = await W.createGrantUser(u);
54
+ const m = await H.createGrantUser(d);
54
55
  return p.value = [m, ...p.value], m;
55
56
  } catch (m) {
56
57
  throw console.error("Error creating grant user:", m), m;
57
58
  }
58
59
  }
59
- async function b(u, m) {
60
+ async function b(d, m) {
60
61
  try {
61
- const r = await W.revokeGrantUser(u, m), c = p.value.findIndex((i) => i._id === u);
62
+ const r = await H.revokeGrantUser(d, m), c = p.value.findIndex((i) => i._id === d);
62
63
  c !== -1 && (p.value[c] = r);
63
64
  } catch (r) {
64
65
  throw console.error("Error revoking grant user:", r), r;
@@ -71,10 +72,10 @@ const W = {
71
72
  createGrantUser: U,
72
73
  revokeGrantUser: b
73
74
  };
74
- }), 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({
75
+ }), Z = Se, Ce = { class: "fm-typo-en-title-md-600" }, Be = { class: "space-y-40" }, $e = { class: "flex gap-8 items-center justify-start" }, Ge = /* @__PURE__ */ J({
75
76
  __name: "GrantUserForm",
76
77
  setup(p, { expose: y }) {
77
- const a = ee(), U = Y(), b = Z(), u = ie(), m = ue(u), { t: r } = X(), c = S(!1), i = S({
78
+ const a = Z(), U = Y(), b = Q(), d = ie(), m = ue(d), { t: r } = X(), c = S(!1), i = S({
78
79
  name: "",
79
80
  restaurantId: "",
80
81
  roleId: ""
@@ -84,13 +85,13 @@ const W = {
84
85
  restaurantId: "",
85
86
  roleId: ""
86
87
  }, c.value = !0;
87
- }, C = V(() => r("grantUser.form.title")), F = V(() => r("common.create")), G = V(() => b.restaurants.value.map((d) => ({
88
- label: `${d.profile.code ? d.profile.code + " - " : ""}${d.profile.name}`,
89
- value: d._id
90
- }))), R = V(() => i.value.restaurantId ? U.roles.value.filter((d) => d.restaurants.some((g) => g.id === i.value.restaurantId)).map((d) => ({
91
- label: d.name,
92
- value: d._id,
93
- disabled: !d.isUsable
88
+ }, C = F(() => r("grantUser.form.title")), V = F(() => r("common.create")), G = F(() => b.restaurants.value.map((u) => ({
89
+ label: `${u.profile.code ? u.profile.code + " - " : ""}${u.profile.name}`,
90
+ value: u._id
91
+ }))), R = F(() => i.value.restaurantId ? U.roles.value.filter((u) => u.restaurants.some((g) => g.id === i.value.restaurantId)).map((u) => ({
92
+ label: u.name,
93
+ value: u._id,
94
+ disabled: !u.isUsable
94
95
  })) : []);
95
96
  ce(
96
97
  () => i.value.restaurantId,
@@ -98,12 +99,12 @@ const W = {
98
99
  i.value.roleId = "";
99
100
  }
100
101
  );
101
- async function P() {
102
+ async function M() {
102
103
  await m.minor(async () => {
103
- const d = await a.createGrantUser(i.value);
104
- u.open({
104
+ const u = await a.createGrantUser(i.value);
105
+ d.open({
105
106
  message: r("grantUser.create.successMessage", {
106
- passcode: d.passcode
107
+ passcode: u.passcode
107
108
  }),
108
109
  type: "success"
109
110
  });
@@ -112,28 +113,28 @@ const W = {
112
113
  return y({
113
114
  show: c,
114
115
  trigger: w
115
- }), (d, g) => {
116
- const T = h("FmTextField"), $ = h("FmSelect"), L = h("fm-button"), N = h("fm-side-sheet");
117
- return I(), K(J, null, [
118
- ge(d.$slots, "default", { trigger: w }),
116
+ }), (u, g) => {
117
+ const P = h("FmTextField"), $ = h("FmSelect"), L = h("fm-button"), N = h("fm-side-sheet");
118
+ return I(), D(W, null, [
119
+ ge(u.$slots, "default", { trigger: w }),
119
120
  n(N, {
120
121
  id: "grant-user-form",
121
122
  modelValue: c.value,
122
123
  "onUpdate:modelValue": g[4] || (g[4] = (f) => c.value = f),
123
- "is-container": s(M).FmForm,
124
+ "is-container": s(E).FmForm,
124
125
  "is-container-props": {
125
- onValidationSuccess: P,
126
+ onValidationSuccess: M,
126
127
  blameFormChildOnValidationFailed: !0
127
128
  },
128
129
  "max-width": 560
129
130
  }, {
130
131
  "side-sheet-header": x(() => [
131
- l("p", Be, k(C.value), 1)
132
+ l("p", Ce, k(C.value), 1)
132
133
  ]),
133
134
  "side-sheet-footer": x(() => [
134
- l("div", Ge, [
135
+ l("div", $e, [
135
136
  n(L, {
136
- label: F.value,
137
+ label: V.value,
137
138
  size: "lg",
138
139
  type: "submit",
139
140
  variant: "primary"
@@ -147,12 +148,12 @@ const W = {
147
148
  ])
148
149
  ]),
149
150
  default: x(() => [
150
- l("div", $e, [
151
- n(Se, {
151
+ l("div", Be, [
152
+ n(Ie, {
152
153
  title: s(r)("grantUser.form.section")
153
154
  }, {
154
155
  default: x(() => [
155
- n(T, {
156
+ n(P, {
156
157
  modelValue: i.value.name,
157
158
  "onUpdate:modelValue": g[0] || (g[0] = (f) => i.value.name = f),
158
159
  label: s(r)("grantUser.form.name"),
@@ -197,73 +198,73 @@ const W = {
197
198
  ], 64);
198
199
  };
199
200
  }
200
- }), Le = {
201
+ }), Re = {
201
202
  class: "space-y-8"
202
- }, Ne = {
203
+ }, Le = {
203
204
  class: "xs:hidden flex w-full items-start justify-between"
204
- }, Ae = {
205
+ }, Ne = {
205
206
  class: "flex items-start gap-8"
206
- }, ze = {
207
+ }, Ae = {
207
208
  class: "space-y-4 hidden xs:block"
208
- }, De = {
209
+ }, ze = {
209
210
  class: "px-16"
210
- }, Ke = {
211
+ }, De = {
211
212
  class: "px-16 flex items-start gap-8"
212
- }, Ee = {
213
+ }, Ke = {
213
214
  class: "pb-64 hidden xs:block"
214
- }, Me = {
215
+ }, Ee = {
215
216
  class: "space-y-4"
216
- }, Pe = {
217
+ }, Me = {
217
218
  class: "flex items-center gap-8"
218
- }, Te = {
219
+ }, Pe = {
219
220
  class: "fm-typo-en-body-lg-600"
220
- }, Oe = {
221
+ }, Te = {
221
222
  class: "font-mono text-lg font-bold mr-4"
222
223
  }, je = {
223
224
  class: "text-fm-color-typo-secondary"
224
- }, qe = {
225
+ }, Oe = {
225
226
  class: "text-xs"
226
- }, He = {
227
+ }, qe = {
227
228
  class: "mt-4 space-y-2"
229
+ }, He = {
230
+ class: "text-xs"
228
231
  }, We = {
229
232
  class: "text-xs"
230
233
  }, Je = {
231
- class: "text-xs"
232
- }, Qe = {
233
234
  key: 0,
234
235
  class: "flex flex-col gap-4"
235
- }, Xe = /* @__PURE__ */ Q({
236
+ }, Qe = /* @__PURE__ */ J({
236
237
  __name: "GrantUserList",
237
238
  setup(p, {
238
239
  expose: y
239
240
  }) {
240
241
  const {
241
242
  t: a
242
- } = X(), U = S(), b = ee(), {
243
- restaurants: u
244
- } = Z(), {
243
+ } = X(), U = S(), b = Z(), {
244
+ restaurants: d
245
+ } = Q(), {
245
246
  roles: m
246
- } = Y(), r = V(() => b.grantUsers), {
247
+ } = Y(), r = F(() => b.grantUsers), {
247
248
  searchKey: c,
248
249
  filter: i
249
- } = Ve(), w = V(() => {
250
- var e;
251
- return (e = r.value) == null ? void 0 : e.filter((t) => {
252
- 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] || "";
253
- return v && O && i([t.passcode, t.name, A, j, t.grantByName]);
250
+ } = Fe(""), w = F(() => {
251
+ var t;
252
+ return (t = r.value) == null ? void 0 : t.filter((e) => {
253
+ const v = !U.value || U.value.includes(e.restaurantId), T = !B.value || B.value.includes(e.status), A = C.value[e.restaurantId] || "", j = V.value[e.roleId] || "";
254
+ return v && T && i([e.passcode, e.name, A, j, e.grantByName]);
254
255
  });
255
- }), C = V(() => {
256
- const e = {};
257
- return u.value.forEach((t) => {
258
- e[t._id] = t.profile.name;
259
- }), e;
260
- }), F = V(() => {
261
- const e = {};
262
- return m.value.forEach((t) => {
263
- e[t._id] = t.name;
264
- }), e;
265
- }), G = (e) => {
266
- switch (e) {
256
+ }), C = F(() => {
257
+ const t = {};
258
+ return d.value.forEach((e) => {
259
+ t[e._id] = e.profile.name;
260
+ }), t;
261
+ }), V = F(() => {
262
+ const t = {};
263
+ return m.value.forEach((e) => {
264
+ t[e._id] = e.name;
265
+ }), t;
266
+ }), G = (t) => {
267
+ switch (t) {
267
268
  case "active":
268
269
  return "bg-fm-color-system-success-100 text-fm-color-typo-success";
269
270
  case "used":
@@ -273,49 +274,49 @@ const W = {
273
274
  default:
274
275
  return "bg-fm-color-typo-secondary text-fm-color-typo-primary";
275
276
  }
276
- }, R = (e) => a(`grantUser.status.${e}`), P = [{
277
+ }, R = (t) => a(`grantUser.status.${t}`), M = [{
277
278
  accessorKey: "passcode",
278
279
  size: 120,
279
280
  maxSize: 120,
280
281
  minSize: 120,
281
282
  header: () => a("grantUser.columns.passcode"),
282
- cell(e) {
283
- const t = e.row.original.passcode;
283
+ cell(t) {
284
+ const e = t.row.original.passcode;
284
285
  return _("div", {
285
286
  class: "flex items-center gap-8"
286
- }, [_(M.FmButton, {
287
- variant: H.Tertiary,
287
+ }, [_(E.FmButton, {
288
+ variant: q.Tertiary,
288
289
  textColor: "neutral-gray-400",
289
290
  icon: "content_copy",
290
291
  onClick: (v) => {
291
- v.stopPropagation(), se(t);
292
+ v.stopPropagation(), te(e);
292
293
  }
293
294
  }), _("span", {
294
295
  class: "font-mono text-lg font-bold"
295
- }, t)]);
296
+ }, e)]);
296
297
  }
297
298
  }, {
298
299
  accessorKey: "name",
299
300
  header: () => a("grantUser.columns.name")
300
301
  }, {
301
302
  accessorKey: "restaurantName",
302
- accessorFn: (e) => C.value[e.restaurantId],
303
+ accessorFn: (t) => C.value[t.restaurantId],
303
304
  header: () => a("grantUser.columns.restaurant"),
304
305
  meta: {
305
306
  width: "250px"
306
307
  },
307
- cell(e) {
308
- const t = e.row.original.restaurantId, v = C.value[t] || "-";
308
+ cell(t) {
309
+ const e = t.row.original.restaurantId, v = C.value[e] || "-";
309
310
  return _("div", [_("div", v), _("div", {
310
311
  class: "text-fm-color-typo-secondary text-sm"
311
- }, `${t}`)]);
312
+ }, `${e}`)]);
312
313
  }
313
314
  }, {
314
315
  accessorKey: "roleName",
315
- accessorFn: (e) => F.value[e.roleId],
316
+ accessorFn: (t) => V.value[t.roleId],
316
317
  header: () => a("grantUser.columns.role"),
317
- cell(e) {
318
- const t = e.row.original.roleId, v = F.value[t] || "-";
318
+ cell(t) {
319
+ const e = t.row.original.roleId, v = V.value[e] || "-";
319
320
  return _("div", v);
320
321
  }
321
322
  }, {
@@ -324,28 +325,28 @@ const W = {
324
325
  meta: {
325
326
  maxWidth: "120px"
326
327
  },
327
- cell(e) {
328
- const t = e.row.original.status;
329
- return _(M.FmChip, {
330
- label: R(t),
331
- class: G(t)
328
+ cell(t) {
329
+ const e = t.row.original.status;
330
+ return _(E.FmChip, {
331
+ label: R(e),
332
+ class: G(e)
332
333
  });
333
334
  }
334
335
  }, {
335
336
  accessorKey: "grantByName",
336
337
  header: () => a("grantUser.columns.grantedBy"),
337
- cell(e) {
338
- const t = e.row.original.grantById, v = e.row.original.grantByName;
338
+ cell(t) {
339
+ const e = t.row.original.grantById, v = t.row.original.grantByName;
339
340
  return _("div", [_("div", v), _("div", {
340
341
  class: "text-fm-color-typo-secondary text-sm"
341
- }, `${t}`)]);
342
+ }, `${e}`)]);
342
343
  }
343
344
  }, {
344
345
  accessorKey: "createdAt",
345
346
  header: () => a("grantUser.columns.createdAt"),
346
- cell(e) {
347
- const t = e.row.original.createdAt;
348
- return _("div", new Date(t).toLocaleString());
347
+ cell(t) {
348
+ const e = t.row.original.createdAt;
349
+ return _("div", new Date(e).toLocaleString());
349
350
  }
350
351
  }, {
351
352
  id: "action",
@@ -354,25 +355,25 @@ const W = {
354
355
  cellClass: "p-16",
355
356
  headerContentClass: "-mx-16"
356
357
  },
357
- cell: (e) => {
358
- const t = e.row.original;
359
- return t.status !== "active" ? null : _("div", {
358
+ cell: (t) => {
359
+ const e = t.row.original;
360
+ return e.status !== "active" ? null : _("div", {
360
361
  class: "w-full flex justify-end items-center gap-4"
361
- }, [_(M.FmButton, {
362
+ }, [_(E.FmButton, {
362
363
  label: a("grantUser.actions.revoke"),
363
- variant: H.Secondary,
364
+ variant: q.Secondary,
364
365
  onClick: (v) => {
365
- v.stopPropagation(), N(t);
366
+ v.stopPropagation(), N(e);
366
367
  }
367
368
  })]);
368
369
  }
369
- }], d = ie(), g = be(), T = ue(d), $ = S(), {
370
+ }], u = ie(), g = xe(), P = ue(u), $ = S(), {
370
371
  breakpoints: L
371
- } = we(), N = (e) => {
372
+ } = be(), N = (t) => {
372
373
  g.open({
373
374
  title: a("grantUser.revoke.title"),
374
375
  message: a("grantUser.revoke.message", {
375
- name: e.name
376
+ name: t.name
376
377
  }),
377
378
  minWidth: L.value.lg ? 588 : 0,
378
379
  primaryActions: {
@@ -385,20 +386,20 @@ const W = {
385
386
  close: !0
386
387
  }
387
388
  }).onPrimary(async () => {
388
- T.minor(async () => {
389
- await b.revokeGrantUser(e._id, e.restaurantId);
389
+ P.minor(async () => {
390
+ await b.revokeGrantUser(t._id, t.restaurantId);
390
391
  }, {
391
392
  successMessage: a("grantUser.revoke.successMessage", {
392
- name: e.name
393
+ name: t.name
393
394
  })
394
395
  }), g.close();
395
396
  });
396
397
  };
397
398
  function f() {
398
- var e;
399
- (e = $.value) == null || e.trigger();
399
+ var t;
400
+ (t = $.value) == null || t.trigger();
400
401
  }
401
- const te = V(() => [{
402
+ const ee = F(() => [{
402
403
  label: a("grantUser.status.active"),
403
404
  value: "active"
404
405
  }, {
@@ -407,19 +408,16 @@ const W = {
407
408
  }, {
408
409
  label: a("grantUser.status.revoked"),
409
410
  value: "revoked"
410
- }]), ae = V(() => u.value.map((e) => ({
411
- label: `${e.profile.code ? `${e.profile.code} - ` : ""}${e.profile.name}`,
412
- value: e._id
413
- }))), B = S();
414
- async function se(e) {
411
+ }]), B = S();
412
+ async function te(t) {
415
413
  try {
416
- await navigator.clipboard.writeText(e), d.open({
414
+ await navigator.clipboard.writeText(t), u.open({
417
415
  message: a("grantUser.passcode.copied"),
418
416
  type: "success"
419
417
  });
420
- } catch (t) {
421
- d.open({
422
- message: String(t),
418
+ } catch (e) {
419
+ u.open({
420
+ message: String(e),
423
421
  type: "error"
424
422
  });
425
423
  }
@@ -427,131 +425,127 @@ const W = {
427
425
  return y({
428
426
  create: f,
429
427
  filteredGrantUsers: w
430
- }), (e, t) => {
431
- const v = h("FmSearch"), O = h("FmTable"), A = h("FmButton"), j = h("FmChip"), de = h("FmListItem"), me = h("FmList");
432
- return I(), K(J, null, [n(Re, {
428
+ }), (t, e) => {
429
+ const v = h("FmSearch"), T = h("FmTable"), A = h("FmButton"), j = h("FmChip"), de = h("FmListItem"), me = h("FmList");
430
+ return I(), D(W, null, [n(Ge, {
433
431
  ref_key: "grantUserFormRef",
434
432
  ref: $,
435
433
  class: "gap-8"
436
- }, null, 512), l("div", Le, [l("div", Ne, [l("div", Ae, [n(D, {
434
+ }, null, 512), l("div", Re, [l("div", Le, [l("div", Ne, [n(s(oe), {
437
435
  modelValue: U.value,
438
- "onUpdate:modelValue": t[0] || (t[0] = (o) => U.value = o),
436
+ "onUpdate:modelValue": e[0] || (e[0] = (o) => U.value = o),
437
+ "managable-only": !1,
439
438
  multiple: "",
440
- items: ae.value,
441
439
  variant: "dark",
442
- "selected-prefix": s(a)("grantUser.columns.restaurant"),
443
- placeholder: s(a)("grantUser.columns.restaurant"),
444
440
  class: "!w-auto"
445
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), n(D, {
441
+ }, null, 8, ["modelValue"]), n(ne, {
446
442
  modelValue: B.value,
447
- "onUpdate:modelValue": t[1] || (t[1] = (o) => B.value = o),
443
+ "onUpdate:modelValue": e[1] || (e[1] = (o) => B.value = o),
448
444
  multiple: "",
449
445
  variant: "dark",
450
- items: te.value,
446
+ items: ee.value,
451
447
  "selected-prefix": s(a)("grantUser.filter.selected_status_prefix"),
452
448
  placeholder: s(a)("grantUser.filter.status_placeholder")
453
449
  }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), n(v, {
454
450
  modelValue: s(c),
455
- "onUpdate:modelValue": t[2] || (t[2] = (o) => re(c) ? c.value = o : null),
451
+ "onUpdate:modelValue": e[2] || (e[2] = (o) => ae(c) ? c.value = o : null),
456
452
  autofocus: "",
457
453
  class: "pl-4 w-[320px]",
458
454
  placeholder: s(a)("grantUser.search.placeholder")
459
- }, null, 8, ["modelValue", "placeholder"])]), l("div", ze, [l("div", De, [n(v, {
455
+ }, null, 8, ["modelValue", "placeholder"])]), l("div", Ae, [l("div", ze, [n(v, {
460
456
  modelValue: s(c),
461
- "onUpdate:modelValue": t[3] || (t[3] = (o) => re(c) ? c.value = o : null),
457
+ "onUpdate:modelValue": e[3] || (e[3] = (o) => ae(c) ? c.value = o : null),
462
458
  autofocus: "",
463
459
  placeholder: s(a)("grantUser.search.placeholder")
464
- }, null, 8, ["modelValue", "placeholder"])]), n(Fe), l("div", Ke, [n(D, {
460
+ }, null, 8, ["modelValue", "placeholder"])]), n(ke), l("div", De, [n(s(oe), {
465
461
  modelValue: U.value,
466
- "onUpdate:modelValue": t[4] || (t[4] = (o) => U.value = o),
462
+ "onUpdate:modelValue": e[4] || (e[4] = (o) => U.value = o),
463
+ "managable-only": !1,
467
464
  multiple: "",
468
- items: ae.value,
469
465
  variant: "dark",
470
- "selected-prefix": s(a)("grantUser.columns.restaurant"),
471
- placeholder: s(a)("grantUser.columns.restaurant"),
472
466
  class: "!w-auto"
473
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), n(D, {
467
+ }, null, 8, ["modelValue"]), n(ne, {
474
468
  modelValue: B.value,
475
- "onUpdate:modelValue": t[5] || (t[5] = (o) => B.value = o),
469
+ "onUpdate:modelValue": e[5] || (e[5] = (o) => B.value = o),
476
470
  multiple: "",
477
- items: te.value,
471
+ items: ee.value,
478
472
  variant: "dark",
479
473
  "selected-prefix": s(a)("grantUser.filter.selected_status_prefix"),
480
474
  placeholder: s(a)("grantUser.filter.status_placeholder")
481
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), r.value.length > 0 || s(b).isLoading ? (I(), E(ke, {
475
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), r.value.length > 0 || s(b).isLoading ? (I(), K(we, {
482
476
  key: 0,
483
477
  class: "overflow-auto"
484
478
  }, {
485
- default: x(() => [n(O, {
479
+ default: x(() => [n(T, {
486
480
  class: "xs:hidden",
487
- "column-defs": P,
481
+ "column-defs": M,
488
482
  "row-data": w.value,
489
483
  "page-size": w.value.length,
490
484
  loading: s(b).isLoading,
491
485
  virtual: w.value.length > 0,
492
486
  "pin-header-row": "",
493
487
  "hide-footer": ""
494
- }, null, 8, ["row-data", "page-size", "loading", "virtual"]), l("div", Ee, [n(me, {
488
+ }, null, 8, ["row-data", "page-size", "loading", "virtual"]), l("div", Ke, [n(me, {
495
489
  separator: ""
496
490
  }, {
497
- default: x(() => [(I(!0), K(J, null, fe(w.value, (o) => (I(), E(de, {
491
+ default: x(() => [(I(!0), D(W, null, fe(w.value, (o) => (I(), K(de, {
498
492
  key: o._id,
499
493
  class: "py-12 px-16 items-center justify-between"
500
494
  }, {
501
- default: x(() => [l("div", Me, [l("div", Pe, [n(A, {
495
+ default: x(() => [l("div", Ee, [l("div", Me, [n(A, {
502
496
  variant: "tertiary",
503
497
  "text-color": "neutral-gray-400",
504
498
  icon: "content_copy",
505
- onClick: oe((pe) => se(o.passcode), ["stop"])
506
- }, 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, {
499
+ onClick: se((pe) => te(o.passcode), ["stop"])
500
+ }, null, 8, ["onClick"]), l("p", Pe, [l("span", Te, k(o.passcode), 1), re(" - " + k(o.name), 1)])]), l("div", je, [l("div", null, [re(k(C.value[o.restaurantId] || "-") + " ", 1), l("div", Oe, k(o.restaurantId), 1), l("div", null, k(V.value[o.roleId] || "-"), 1)]), l("div", qe, [l("div", He, k(s(a)("grantUser.columns.grantedBy")) + ": " + k(o.grantByName), 1), l("div", We, k(s(a)("grantUser.columns.createdAt")) + ": " + k(new Date(o.createdAt).toLocaleString()), 1), n(j, {
507
501
  label: R(o.status),
508
502
  class: _e(G(o.status))
509
- }, null, 8, ["label", "class"])])])]), o.status === "active" ? (I(), K("div", Qe, [n(A, {
503
+ }, null, 8, ["label", "class"])])])]), o.status === "active" ? (I(), D("div", Je, [n(A, {
510
504
  label: s(a)("grantUser.actions.revoke"),
511
- variant: s(H).Secondary,
512
- onClick: oe((pe) => N(o), ["stop"])
505
+ variant: s(q).Secondary,
506
+ onClick: se((pe) => N(o), ["stop"])
513
507
  }, null, 8, ["label", "variant", "onClick"])])) : ve("", !0)]),
514
508
  _: 2
515
509
  }, 1024))), 128))]),
516
510
  _: 1
517
511
  })])]),
518
512
  _: 1
519
- })) : (I(), E(s(Ie), {
513
+ })) : (I(), K(s(Ve), {
520
514
  key: 1,
521
515
  title: s(a)("grantUser.noData.title"),
522
516
  subtitle: s(a)("grantUser.noData.subtitle")
523
517
  }, null, 8, ["title", "subtitle"]))])], 64);
524
518
  };
525
519
  }
526
- }), dt = /* @__PURE__ */ Q({
520
+ }), dt = /* @__PURE__ */ J({
527
521
  __name: "Main",
528
522
  setup(p) {
529
- const { readGrantUsers: y } = ee(), { currentBusiness: a } = ye(), { readRoles: U } = Y(), { readRestaurants: b } = Z(), { t: u } = X(), m = S();
523
+ const { readGrantUsers: y } = Z(), { readRestaurants: a, currentBusiness: U } = Q(), { readRoles: b } = Y(), { t: d } = X(), m = S();
530
524
  return ce(
531
- a,
525
+ U,
532
526
  async () => {
533
527
  var r;
534
- (r = a.value) != null && r._id && await Promise.all([b(), U(), y()]);
528
+ (r = U.value) != null && r._id && await Promise.all([a(), b(), y()]);
535
529
  },
536
530
  { immediate: !0 }
537
531
  ), (r, c) => {
538
532
  const i = h("FmSpacer"), w = h("FmButton");
539
- return I(), E(Ue, {
540
- heading: s(u)("grantUser.title")
533
+ return I(), K(ye, {
534
+ heading: s(d)("grantUser.title")
541
535
  }, {
542
536
  "append-heading": x(() => [
543
537
  n(i),
544
538
  n(w, {
545
539
  "prepend-icon": "add",
546
- label: s(u)("grantUser.actions.create"),
540
+ label: s(d)("grantUser.actions.create"),
547
541
  onClick: c[0] || (c[0] = (C) => {
548
- var F;
549
- return (F = m.value) == null ? void 0 : F.create();
542
+ var V;
543
+ return (V = m.value) == null ? void 0 : V.create();
550
544
  })
551
545
  }, null, 8, ["label"])
552
546
  ]),
553
547
  default: x(() => [
554
- n(Xe, {
548
+ n(Qe, {
555
549
  ref_key: "grantUserListRef",
556
550
  ref: m
557
551
  }, null, 512)