@feedmepos/mf-hrm-portal 2.0.20-dev.1 → 2.0.20-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.
Files changed (31) hide show
  1. package/dist/{AuditLogList-Bsj-qg8n.js → AuditLogList-7E8iWQWx.js} +4 -4
  2. package/dist/EmployeeList-DyNW3cUo.js +851 -0
  3. package/dist/{Main-CSMAtoMj.js → Main-BLJyOcEv.js} +184 -176
  4. package/dist/{Main-BGc6kNaR.js → Main-BZjZxFHp.js} +2008 -2001
  5. package/dist/Main-C9lMH4EN.js +90 -0
  6. package/dist/PermissionSetList-BuCp14Os.js +355 -0
  7. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CdWgTjZw.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BQSDnH-Z.js} +675 -661
  8. package/dist/RoleList-L8L1xmJ2.js +564 -0
  9. package/dist/TeamMemberList-DEN9rHqb.js +1124 -0
  10. package/dist/{TimesheetList-tFjvFHqH.js → TimesheetList-D88u0GFn.js} +61 -53
  11. package/dist/{app-CL7rUfL3.js → app-g_SrJtfC.js} +191 -193
  12. package/dist/app.js +1 -1
  13. package/dist/{dayjs.min-ChdFPuFV.js → dayjs.min-BGHzwXCt.js} +1 -1
  14. package/dist/employee-Dep-q_aU.js +200 -0
  15. package/dist/{iteration-BbD0nOgO.js → iteration-Dc-Bz5bA.js} +173 -175
  16. package/dist/{lodash-CDf3aG6G.js → lodash-Cxw1GZ6L.js} +1 -1
  17. package/dist/{rule-BJ-y3Sp8.js → rule-ClRtpdqO.js} +27 -26
  18. package/dist/src/types/team.d.ts +1 -0
  19. package/dist/style.css +1 -1
  20. package/dist/{timesheet-BmV02Rkz.js → timesheet-CZoSvFYT.js} +2 -2
  21. package/dist/tsconfig.app.tsbuildinfo +1 -1
  22. package/dist/{useAppStore-D8QAGZ02.js → useAppStore-CTBRpqmO.js} +36 -38
  23. package/dist/{useLoading-KpcQw0p4.js → useLoading-XvrLj1VM.js} +1 -1
  24. package/dist/{useReportPermissions-CmGJAz_N.js → useReportPermissions-nivbQm9V.js} +3 -3
  25. package/package.json +1 -1
  26. package/dist/EmployeeList-Cy2ayCko.js +0 -824
  27. package/dist/Main-D7bV8EuC.js +0 -86
  28. package/dist/PermissionSetList-CuHhDqWl.js +0 -347
  29. package/dist/RoleList-e0WUqt4Y.js +0 -545
  30. package/dist/TeamMemberList-CpPa1KyV.js +0 -1097
  31. package/dist/employee-kKV7UnHU.js +0 -204
@@ -1,46 +1,46 @@
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";
1
+ import { ref as I, defineComponent as Q, computed as F, watch as ie, resolveComponent as h, createElementBlock as E, openBlock as S, Fragment as J, renderSlot as ge, createVNode as n, unref as r, withCtx as x, createElementVNode as c, toDisplayString as w, createBlock as K, isRef as oe, renderList as fe, createCommentVNode as ve, withModifiers as ne, createTextVNode as le, normalizeClass as _e, h as _ } from "vue";
2
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-D8QAGZ02.js";
5
- import { g as z, a as he, b as q, u as Z } from "./iteration-BbD0nOgO.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";
3
+ import { useSnackbar as Y, components as M, useDialog as Ue, useBreakpoints as he, FmButtonVariant as q } from "@feedmepos/ui-library";
4
+ import { _ as xe } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
5
+ import { u as Z } from "./useAppStore-CTBRpqmO.js";
6
+ import { g as z, a as be, b as H, u as ee } from "./iteration-Dc-Bz5bA.js";
7
+ import { defineStore as ke } from "pinia";
8
8
  import { S as D } from "./SelectFilter-DUj7GBtT.js";
9
- import { _ as ke } from "./app-CL7rUfL3.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-KpcQw0p4.js";
13
- import { _ as Se } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
9
+ import { _ as we } from "./app-g_SrJtfC.js";
10
+ import { _ as ce, u as Fe, H as Ve } from "./FormItem.vue_vue_type_script_setup_true_lang-D3MOFOUI.js";
11
+ import { _ as Se } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
12
+ import { u as ue } from "./useLoading-XvrLj1VM.js";
13
+ import { _ as Ie } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
14
14
  const W = {
15
15
  async getGrantUsers() {
16
- return z(await q("grant").get(""));
16
+ return z(await H("grant").get(""));
17
17
  },
18
- async createGrantUser(p) {
19
- return z(await q("grant").post("", p));
18
+ async createGrantUser(m) {
19
+ return z(await H("grant").post("", m));
20
20
  },
21
- async revokeGrantUser(p, y) {
21
+ async revokeGrantUser(m, y) {
22
22
  return z(
23
- await q("grant").patch(`/revoke/${p}`, null, {
23
+ await H("grant").patch(`/revoke/${m}`, null, {
24
24
  params: { restaurantId: y }
25
25
  })
26
26
  );
27
27
  },
28
28
  // Test grant validation
29
- async validatePasscode(p, y) {
29
+ async validatePasscode(m, y) {
30
30
  return z(
31
- await he().post("", {
32
- passcode: p,
31
+ await be().post("", {
32
+ passcode: m,
33
33
  restaurantId: y
34
34
  })
35
35
  );
36
36
  }
37
- }, Ce = xe("grantUser", () => {
38
- const p = S([]), y = S(!1);
37
+ }, Ce = ke("grantUser", () => {
38
+ const m = I([]), y = I(!1);
39
39
  async function a() {
40
40
  y.value = !0;
41
41
  try {
42
- p.value = (await W.getGrantUsers()).sort(
43
- (u, m) => u.createdAt < m.createdAt ? 1 : -1
42
+ m.value = (await W.getGrantUsers()).sort(
43
+ (u, p) => u.createdAt < p.createdAt ? 1 : -1
44
44
  );
45
45
  } catch (u) {
46
46
  throw console.error("Error reading grant users:", u), u;
@@ -50,77 +50,77 @@ const W = {
50
50
  }
51
51
  async function U(u) {
52
52
  try {
53
- const m = await W.createGrantUser(u);
54
- return p.value = [m, ...p.value], m;
55
- } catch (m) {
56
- throw console.error("Error creating grant user:", m), m;
53
+ const p = await W.createGrantUser(u);
54
+ return m.value = [p, ...m.value], p;
55
+ } catch (p) {
56
+ throw console.error("Error creating grant user:", p), p;
57
57
  }
58
58
  }
59
- async function b(u, m) {
59
+ async function b(u, p) {
60
60
  try {
61
- const r = await W.revokeGrantUser(u, m), c = p.value.findIndex((i) => i._id === u);
62
- c !== -1 && (p.value[c] = r);
63
- } catch (r) {
64
- throw console.error("Error revoking grant user:", r), r;
61
+ const l = await W.revokeGrantUser(u, p), i = m.value.findIndex((s) => s._id === u);
62
+ i !== -1 && (m.value[i] = l);
63
+ } catch (l) {
64
+ throw console.error("Error revoking grant user:", l), l;
65
65
  }
66
66
  }
67
67
  return {
68
- grantUsers: p,
68
+ grantUsers: m,
69
69
  isLoading: y,
70
70
  readGrantUsers: a,
71
71
  createGrantUser: U,
72
72
  revokeGrantUser: b
73
73
  };
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({
74
+ }), te = 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
75
  __name: "GrantUserForm",
76
- 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({
76
+ setup(m, { expose: y }) {
77
+ const a = te(), U = Z(), b = ee(), u = Y(), p = ue(u), { t: l } = X(), i = I(!1), s = I({
78
78
  name: "",
79
79
  restaurantId: "",
80
80
  roleId: ""
81
- }), w = () => {
82
- i.value = {
81
+ }), k = () => {
82
+ s.value = {
83
83
  name: "",
84
84
  restaurantId: "",
85
85
  roleId: ""
86
- }, c.value = !0;
87
- }, C = V(() => r("grantUser.form.title")), F = V(() => r("common.create")), G = V(() => b.restaurants.value.map((d) => ({
86
+ }, i.value = !0;
87
+ }, V = F(() => l("grantUser.form.title")), C = F(() => l("common.create")), B = F(() => b.restaurants.value.map((d) => ({
88
88
  label: `${d.profile.code ? d.profile.code + " - " : ""}${d.profile.name}`,
89
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) => ({
90
+ }))), R = F(() => s.value.restaurantId ? U.roles.value.filter((d) => d.restaurants.some((g) => g.id === s.value.restaurantId)).map((d) => ({
91
91
  label: d.name,
92
92
  value: d._id,
93
93
  disabled: !d.isUsable
94
94
  })) : []);
95
- ce(
96
- () => i.value.restaurantId,
95
+ ie(
96
+ () => s.value.restaurantId,
97
97
  () => {
98
- i.value.roleId = "";
98
+ s.value.roleId = "";
99
99
  }
100
100
  );
101
101
  async function P() {
102
- await m.minor(async () => {
103
- const d = await a.createGrantUser(i.value);
102
+ await p.minor(async () => {
103
+ const d = await a.createGrantUser(s.value);
104
104
  u.open({
105
- message: r("grantUser.create.successMessage", {
105
+ message: l("grantUser.create.successMessage", {
106
106
  passcode: d.passcode
107
107
  }),
108
108
  type: "success"
109
109
  });
110
- }), c.value = !1;
110
+ }), i.value = !1;
111
111
  }
112
112
  return y({
113
- show: c,
114
- trigger: w
113
+ show: i,
114
+ trigger: k
115
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
+ const T = h("FmTextField"), G = h("FmSelect"), L = h("fm-button"), N = h("fm-side-sheet");
117
+ return S(), E(J, null, [
118
+ ge(d.$slots, "default", { trigger: k }),
119
119
  n(N, {
120
120
  id: "grant-user-form",
121
- modelValue: c.value,
122
- "onUpdate:modelValue": g[4] || (g[4] = (f) => c.value = f),
123
- "is-container": s(M).FmForm,
121
+ modelValue: i.value,
122
+ "onUpdate:modelValue": g[4] || (g[4] = (f) => i.value = f),
123
+ "is-container": r(M).FmForm,
124
124
  "is-container-props": {
125
125
  onValidationSuccess: P,
126
126
  blameFormChildOnValidationFailed: !0
@@ -128,61 +128,61 @@ const W = {
128
128
  "max-width": 560
129
129
  }, {
130
130
  "side-sheet-header": x(() => [
131
- l("p", Be, k(C.value), 1)
131
+ c("p", Be, w(V.value), 1)
132
132
  ]),
133
133
  "side-sheet-footer": x(() => [
134
- l("div", Ge, [
134
+ c("div", Ge, [
135
135
  n(L, {
136
- label: F.value,
136
+ label: C.value,
137
137
  size: "lg",
138
138
  type: "submit",
139
139
  variant: "primary"
140
140
  }, null, 8, ["label"]),
141
141
  n(L, {
142
- label: s(r)("common.cancel"),
142
+ label: r(l)("common.cancel"),
143
143
  size: "lg",
144
144
  variant: "tertiary",
145
- onClick: g[3] || (g[3] = () => c.value = !1)
145
+ onClick: g[3] || (g[3] = () => i.value = !1)
146
146
  }, null, 8, ["label"])
147
147
  ])
148
148
  ]),
149
149
  default: x(() => [
150
- l("div", $e, [
151
- n(Se, {
152
- title: s(r)("grantUser.form.section")
150
+ c("div", $e, [
151
+ n(Ie, {
152
+ title: r(l)("grantUser.form.section")
153
153
  }, {
154
154
  default: x(() => [
155
155
  n(T, {
156
- modelValue: i.value.name,
157
- "onUpdate:modelValue": g[0] || (g[0] = (f) => i.value.name = f),
158
- label: s(r)("grantUser.form.name"),
159
- rules: [(f) => !!f || s(r)("grantUser.form.nameRequired")]
156
+ modelValue: s.value.name,
157
+ "onUpdate:modelValue": g[0] || (g[0] = (f) => s.value.name = f),
158
+ label: r(l)("grantUser.form.name"),
159
+ rules: [(f) => !!f || r(l)("grantUser.form.nameRequired")]
160
160
  }, null, 8, ["modelValue", "label", "rules"]),
161
- n(le, {
162
- label: s(r)("grantUser.form.restaurant")
161
+ n(ce, {
162
+ label: r(l)("grantUser.form.restaurant")
163
163
  }, {
164
164
  default: x(() => [
165
- n($, {
166
- modelValue: i.value.restaurantId,
167
- "onUpdate:modelValue": g[1] || (g[1] = (f) => i.value.restaurantId = f),
168
- items: G.value,
169
- placeholder: s(r)("grantUser.form.selectRestaurant"),
170
- rules: [(f) => !!f || s(r)("grantUser.form.restaurantRequired")]
165
+ n(G, {
166
+ modelValue: s.value.restaurantId,
167
+ "onUpdate:modelValue": g[1] || (g[1] = (f) => s.value.restaurantId = f),
168
+ items: B.value,
169
+ placeholder: r(l)("grantUser.form.selectRestaurant"),
170
+ rules: [(f) => !!f || r(l)("grantUser.form.restaurantRequired")]
171
171
  }, null, 8, ["modelValue", "items", "placeholder", "rules"])
172
172
  ]),
173
173
  _: 1
174
174
  }, 8, ["label"]),
175
- n(le, {
176
- label: s(r)("grantUser.form.role")
175
+ n(ce, {
176
+ label: r(l)("grantUser.form.role")
177
177
  }, {
178
178
  default: x(() => [
179
- n($, {
180
- modelValue: i.value.roleId,
181
- "onUpdate:modelValue": g[2] || (g[2] = (f) => i.value.roleId = f),
179
+ n(G, {
180
+ modelValue: s.value.roleId,
181
+ "onUpdate:modelValue": g[2] || (g[2] = (f) => s.value.roleId = f),
182
182
  items: R.value,
183
- placeholder: s(r)("grantUser.form.selectRole"),
184
- disabled: !i.value.restaurantId,
185
- rules: [(f) => !!f || s(r)("grantUser.form.roleRequired")]
183
+ placeholder: r(l)("grantUser.form.selectRole"),
184
+ disabled: !s.value.restaurantId,
185
+ rules: [(f) => !!f || r(l)("grantUser.form.roleRequired")]
186
186
  }, null, 8, ["modelValue", "items", "placeholder", "disabled", "rules"])
187
187
  ]),
188
188
  _: 1
@@ -207,9 +207,9 @@ const W = {
207
207
  class: "space-y-4 hidden xs:block"
208
208
  }, De = {
209
209
  class: "px-16"
210
- }, Ke = {
211
- class: "px-16 flex items-start gap-8"
212
210
  }, Ee = {
211
+ class: "px-16 flex items-start gap-8"
212
+ }, Ke = {
213
213
  class: "pb-64 hidden xs:block"
214
214
  }, Me = {
215
215
  class: "space-y-4"
@@ -234,35 +234,35 @@ const W = {
234
234
  class: "flex flex-col gap-4"
235
235
  }, Xe = /* @__PURE__ */ Q({
236
236
  __name: "GrantUserList",
237
- setup(p, {
237
+ setup(m, {
238
238
  expose: y
239
239
  }) {
240
240
  const {
241
241
  t: a
242
- } = X(), U = S(), b = ee(), {
242
+ } = X(), U = I(), b = te(), {
243
243
  restaurants: u
244
- } = Z(), {
245
- roles: m
246
- } = Y(), r = V(() => b.grantUsers), {
247
- searchKey: c,
248
- filter: i
249
- } = Ve(), w = V(() => {
244
+ } = ee(), {
245
+ roles: p
246
+ } = Z(), l = F(() => b.grantUsers), {
247
+ searchKey: i,
248
+ filter: s
249
+ } = Fe(), k = F(() => {
250
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]);
251
+ return (e = l.value) == null ? void 0 : e.filter((t) => {
252
+ const v = !U.value || U.value.includes(t.restaurantId), O = !$.value || $.value.includes(t.status), A = V.value[t.restaurantId] || "", j = C.value[t.roleId] || "";
253
+ return v && O && s([t.passcode, t.name, A, j, t.grantByName]);
254
254
  });
255
- }), C = V(() => {
255
+ }), V = F(() => {
256
256
  const e = {};
257
257
  return u.value.forEach((t) => {
258
258
  e[t._id] = t.profile.name;
259
259
  }), e;
260
- }), F = V(() => {
260
+ }), C = F(() => {
261
261
  const e = {};
262
- return m.value.forEach((t) => {
262
+ return p.value.forEach((t) => {
263
263
  e[t._id] = t.name;
264
264
  }), e;
265
- }), G = (e) => {
265
+ }), B = (e) => {
266
266
  switch (e) {
267
267
  case "active":
268
268
  return "bg-fm-color-system-success-100 text-fm-color-typo-success";
@@ -284,7 +284,7 @@ const W = {
284
284
  return _("div", {
285
285
  class: "flex items-center gap-8"
286
286
  }, [_(M.FmButton, {
287
- variant: H.Tertiary,
287
+ variant: q.Tertiary,
288
288
  textColor: "neutral-gray-400",
289
289
  icon: "content_copy",
290
290
  onClick: (v) => {
@@ -299,23 +299,23 @@ const W = {
299
299
  header: () => a("grantUser.columns.name")
300
300
  }, {
301
301
  accessorKey: "restaurantName",
302
- accessorFn: (e) => C.value[e.restaurantId],
302
+ accessorFn: (e) => V.value[e.restaurantId],
303
303
  header: () => a("grantUser.columns.restaurant"),
304
304
  meta: {
305
305
  width: "250px"
306
306
  },
307
307
  cell(e) {
308
- const t = e.row.original.restaurantId, v = C.value[t] || "-";
308
+ const t = e.row.original.restaurantId, v = V.value[t] || "-";
309
309
  return _("div", [_("div", v), _("div", {
310
310
  class: "text-fm-color-typo-secondary text-sm"
311
311
  }, `${t}`)]);
312
312
  }
313
313
  }, {
314
314
  accessorKey: "roleName",
315
- accessorFn: (e) => F.value[e.roleId],
315
+ accessorFn: (e) => C.value[e.roleId],
316
316
  header: () => a("grantUser.columns.role"),
317
317
  cell(e) {
318
- const t = e.row.original.roleId, v = F.value[t] || "-";
318
+ const t = e.row.original.roleId, v = C.value[t] || "-";
319
319
  return _("div", v);
320
320
  }
321
321
  }, {
@@ -328,7 +328,7 @@ const W = {
328
328
  const t = e.row.original.status;
329
329
  return _(M.FmChip, {
330
330
  label: R(t),
331
- class: G(t)
331
+ class: B(t)
332
332
  });
333
333
  }
334
334
  }, {
@@ -360,15 +360,15 @@ const W = {
360
360
  class: "w-full flex justify-end items-center gap-4"
361
361
  }, [_(M.FmButton, {
362
362
  label: a("grantUser.actions.revoke"),
363
- variant: H.Secondary,
363
+ variant: q.Secondary,
364
364
  onClick: (v) => {
365
365
  v.stopPropagation(), N(t);
366
366
  }
367
367
  })]);
368
368
  }
369
- }], d = ie(), g = be(), T = ue(d), $ = S(), {
369
+ }], d = Y(), g = Ue(), T = ue(d), G = I(), {
370
370
  breakpoints: L
371
- } = we(), N = (e) => {
371
+ } = he(), N = (e) => {
372
372
  g.open({
373
373
  title: a("grantUser.revoke.title"),
374
374
  message: a("grantUser.revoke.message", {
@@ -396,9 +396,9 @@ const W = {
396
396
  };
397
397
  function f() {
398
398
  var e;
399
- (e = $.value) == null || e.trigger();
399
+ (e = G.value) == null || e.trigger();
400
400
  }
401
- const te = V(() => [{
401
+ const ae = F(() => [{
402
402
  label: a("grantUser.status.active"),
403
403
  value: "active"
404
404
  }, {
@@ -407,10 +407,10 @@ const W = {
407
407
  }, {
408
408
  label: a("grantUser.status.revoked"),
409
409
  value: "revoked"
410
- }]), ae = V(() => u.value.map((e) => ({
410
+ }]), re = F(() => u.value.map((e) => ({
411
411
  label: `${e.profile.code ? `${e.profile.code} - ` : ""}${e.profile.name}`,
412
412
  value: e._id
413
- }))), B = S();
413
+ }))), $ = I();
414
414
  async function se(e) {
415
415
  try {
416
416
  await navigator.clipboard.writeText(e), d.open({
@@ -426,134 +426,142 @@ const W = {
426
426
  }
427
427
  return y({
428
428
  create: f,
429
- filteredGrantUsers: w
429
+ filteredGrantUsers: k
430
430
  }), (e, t) => {
431
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, {
432
+ return S(), E(J, null, [n(Re, {
433
433
  ref_key: "grantUserFormRef",
434
- ref: $,
434
+ ref: G,
435
435
  class: "gap-8"
436
- }, null, 512), l("div", Le, [l("div", Ne, [l("div", Ae, [n(D, {
436
+ }, null, 512), c("div", Le, [c("div", Ne, [c("div", Ae, [n(D, {
437
437
  modelValue: U.value,
438
438
  "onUpdate:modelValue": t[0] || (t[0] = (o) => U.value = o),
439
439
  multiple: "",
440
- items: ae.value,
440
+ items: re.value,
441
441
  variant: "dark",
442
- "selected-prefix": s(a)("grantUser.columns.restaurant"),
443
- placeholder: s(a)("grantUser.columns.restaurant"),
442
+ "selected-prefix": r(a)("grantUser.columns.restaurant"),
443
+ placeholder: r(a)("grantUser.columns.restaurant"),
444
444
  class: "!w-auto"
445
445
  }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), n(D, {
446
- modelValue: B.value,
447
- "onUpdate:modelValue": t[1] || (t[1] = (o) => B.value = o),
446
+ modelValue: $.value,
447
+ "onUpdate:modelValue": t[1] || (t[1] = (o) => $.value = o),
448
448
  multiple: "",
449
449
  variant: "dark",
450
- items: te.value,
451
- "selected-prefix": s(a)("grantUser.filter.selected_status_prefix"),
452
- placeholder: s(a)("grantUser.filter.status_placeholder")
450
+ items: ae.value,
451
+ "selected-prefix": r(a)("grantUser.filter.selected_status_prefix"),
452
+ placeholder: r(a)("grantUser.filter.status_placeholder")
453
453
  }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), n(v, {
454
- modelValue: s(c),
455
- "onUpdate:modelValue": t[2] || (t[2] = (o) => re(c) ? c.value = o : null),
454
+ modelValue: r(i),
455
+ "onUpdate:modelValue": t[2] || (t[2] = (o) => oe(i) ? i.value = o : null),
456
456
  autofocus: "",
457
457
  class: "pl-4 w-[320px]",
458
- placeholder: s(a)("grantUser.search.placeholder")
459
- }, null, 8, ["modelValue", "placeholder"])]), l("div", ze, [l("div", De, [n(v, {
460
- modelValue: s(c),
461
- "onUpdate:modelValue": t[3] || (t[3] = (o) => re(c) ? c.value = o : null),
458
+ placeholder: r(a)("grantUser.search.placeholder")
459
+ }, null, 8, ["modelValue", "placeholder"])]), c("div", ze, [c("div", De, [n(v, {
460
+ modelValue: r(i),
461
+ "onUpdate:modelValue": t[3] || (t[3] = (o) => oe(i) ? i.value = o : null),
462
462
  autofocus: "",
463
- placeholder: s(a)("grantUser.search.placeholder")
464
- }, null, 8, ["modelValue", "placeholder"])]), n(Fe), l("div", Ke, [n(D, {
463
+ placeholder: r(a)("grantUser.search.placeholder")
464
+ }, null, 8, ["modelValue", "placeholder"])]), n(Ve), c("div", Ee, [n(D, {
465
465
  modelValue: U.value,
466
466
  "onUpdate:modelValue": t[4] || (t[4] = (o) => U.value = o),
467
467
  multiple: "",
468
- items: ae.value,
468
+ items: re.value,
469
469
  variant: "dark",
470
- "selected-prefix": s(a)("grantUser.columns.restaurant"),
471
- placeholder: s(a)("grantUser.columns.restaurant"),
470
+ "selected-prefix": r(a)("grantUser.columns.restaurant"),
471
+ placeholder: r(a)("grantUser.columns.restaurant"),
472
472
  class: "!w-auto"
473
473
  }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), n(D, {
474
- modelValue: B.value,
475
- "onUpdate:modelValue": t[5] || (t[5] = (o) => B.value = o),
474
+ modelValue: $.value,
475
+ "onUpdate:modelValue": t[5] || (t[5] = (o) => $.value = o),
476
476
  multiple: "",
477
- items: te.value,
477
+ items: ae.value,
478
478
  variant: "dark",
479
- "selected-prefix": s(a)("grantUser.filter.selected_status_prefix"),
480
- 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, {
479
+ "selected-prefix": r(a)("grantUser.filter.selected_status_prefix"),
480
+ placeholder: r(a)("grantUser.filter.status_placeholder")
481
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), l.value.length > 0 || r(b).isLoading ? (S(), K(we, {
482
482
  key: 0,
483
483
  class: "overflow-auto"
484
484
  }, {
485
485
  default: x(() => [n(O, {
486
486
  class: "xs:hidden",
487
487
  "column-defs": P,
488
- "row-data": w.value,
489
- "page-size": w.value.length,
490
- loading: s(b).isLoading,
491
- virtual: w.value.length > 0,
488
+ "row-data": k.value,
489
+ "page-size": k.value.length,
490
+ loading: r(b).isLoading,
491
+ virtual: k.value.length > 0,
492
492
  "pin-header-row": "",
493
493
  "hide-footer": ""
494
- }, null, 8, ["row-data", "page-size", "loading", "virtual"]), l("div", Ee, [n(me, {
494
+ }, null, 8, ["row-data", "page-size", "loading", "virtual"]), c("div", Ke, [n(me, {
495
495
  separator: ""
496
496
  }, {
497
- default: x(() => [(I(!0), K(J, null, fe(w.value, (o) => (I(), E(de, {
497
+ default: x(() => [(S(!0), E(J, null, fe(k.value, (o) => (S(), K(de, {
498
498
  key: o._id,
499
499
  class: "py-12 px-16 items-center justify-between"
500
500
  }, {
501
- default: x(() => [l("div", Me, [l("div", Pe, [n(A, {
501
+ default: x(() => [c("div", Me, [c("div", Pe, [n(A, {
502
502
  variant: "tertiary",
503
503
  "text-color": "neutral-gray-400",
504
504
  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, {
505
+ onClick: ne((pe) => se(o.passcode), ["stop"])
506
+ }, null, 8, ["onClick"]), c("p", Te, [c("span", Oe, w(o.passcode), 1), le(" - " + w(o.name), 1)])]), c("div", je, [c("div", null, [le(w(V.value[o.restaurantId] || "-") + " ", 1), c("div", qe, w(o.restaurantId), 1), c("div", null, w(C.value[o.roleId] || "-"), 1)]), c("div", He, [c("div", We, w(r(a)("grantUser.columns.grantedBy")) + ": " + w(o.grantByName), 1), c("div", Je, w(r(a)("grantUser.columns.createdAt")) + ": " + w(new Date(o.createdAt).toLocaleString()), 1), n(j, {
507
507
  label: R(o.status),
508
- class: _e(G(o.status))
509
- }, null, 8, ["label", "class"])])])]), o.status === "active" ? (I(), K("div", Qe, [n(A, {
510
- label: s(a)("grantUser.actions.revoke"),
511
- variant: s(H).Secondary,
512
- onClick: oe((pe) => N(o), ["stop"])
508
+ class: _e(B(o.status))
509
+ }, null, 8, ["label", "class"])])])]), o.status === "active" ? (S(), E("div", Qe, [n(A, {
510
+ label: r(a)("grantUser.actions.revoke"),
511
+ variant: r(q).Secondary,
512
+ onClick: ne((pe) => N(o), ["stop"])
513
513
  }, null, 8, ["label", "variant", "onClick"])])) : ve("", !0)]),
514
514
  _: 2
515
515
  }, 1024))), 128))]),
516
516
  _: 1
517
517
  })])]),
518
518
  _: 1
519
- })) : (I(), E(s(Ie), {
519
+ })) : (S(), K(r(Se), {
520
520
  key: 1,
521
- title: s(a)("grantUser.noData.title"),
522
- subtitle: s(a)("grantUser.noData.subtitle")
521
+ title: r(a)("grantUser.noData.title"),
522
+ subtitle: r(a)("grantUser.noData.subtitle")
523
523
  }, null, 8, ["title", "subtitle"]))])], 64);
524
524
  };
525
525
  }
526
526
  }), dt = /* @__PURE__ */ Q({
527
527
  __name: "Main",
528
- setup(p) {
529
- const { readGrantUsers: y } = ee(), { currentBusiness: a } = ye(), { readRoles: U } = Y(), { readRestaurants: b } = Z(), { t: u } = X(), m = S();
530
- return ce(
528
+ setup(m) {
529
+ const { readGrantUsers: y } = te(), { currentBusiness: a } = ye(), { readRoles: U } = Z(), { readRestaurants: b } = ee(), { t: u } = X(), p = Y(), l = I();
530
+ return ie(
531
531
  a,
532
532
  async () => {
533
- var r;
534
- (r = a.value) != null && r._id && await Promise.all([b(), U(), y()]);
533
+ var i;
534
+ if ((i = a.value) != null && i._id)
535
+ try {
536
+ await Promise.all([b(), U(), y()]);
537
+ } catch (s) {
538
+ console.error("Failed to load grant dependencies:", s), p.open({
539
+ message: s instanceof Error ? s.message : String(s),
540
+ type: "error"
541
+ });
542
+ }
535
543
  },
536
544
  { immediate: !0 }
537
- ), (r, c) => {
538
- const i = h("FmSpacer"), w = h("FmButton");
539
- return I(), E(Ue, {
540
- heading: s(u)("grantUser.title")
545
+ ), (i, s) => {
546
+ const k = h("FmSpacer"), V = h("FmButton");
547
+ return S(), K(xe, {
548
+ heading: r(u)("grantUser.title")
541
549
  }, {
542
550
  "append-heading": x(() => [
543
- n(i),
544
- n(w, {
551
+ n(k),
552
+ n(V, {
545
553
  "prepend-icon": "add",
546
- label: s(u)("grantUser.actions.create"),
547
- onClick: c[0] || (c[0] = (C) => {
548
- var F;
549
- return (F = m.value) == null ? void 0 : F.create();
554
+ label: r(u)("grantUser.actions.create"),
555
+ onClick: s[0] || (s[0] = (C) => {
556
+ var B;
557
+ return (B = l.value) == null ? void 0 : B.create();
550
558
  })
551
559
  }, null, 8, ["label"])
552
560
  ]),
553
561
  default: x(() => [
554
562
  n(Xe, {
555
563
  ref_key: "grantUserListRef",
556
- ref: m
564
+ ref: l
557
565
  }, null, 512)
558
566
  ]),
559
567
  _: 1