@feedmepos/mf-hrm-portal 1.1.1-dev → 1.1.3-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 (32) hide show
  1. package/dist/AuditLogList-DNQh1rE9.js +316 -0
  2. package/dist/{EmployeeList-CMUbRS7j.js → EmployeeList-zU7fmC4c.js} +9 -8
  3. package/dist/{Main-BbZ-t-pu.js → Main-BqhrqOzx.js} +4 -4
  4. package/dist/{Main-un3v_g6p.js → Main-DGymQNz9.js} +9 -8
  5. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BvjXcknf.js +3050 -0
  6. package/dist/{RoleList-mlTepnhN.js → RoleList-jbZqer7A.js} +5 -5
  7. package/dist/{RolePermissionList-tR-Kmlu7.js → RolePermissionList-Dd8ks5i7.js} +3 -3
  8. package/dist/{useSearch-C6gRA62e.js → SelectFilter-NbXrJ4iH.js} +90 -101
  9. package/dist/{TeamMemberList-BkRQl6x8.js → TeamMemberList-uamoOFIV.js} +40 -39
  10. package/dist/{TimesheetList-i5yaAzhB.js → TimesheetList-hgT9DrHd.js} +21 -20
  11. package/dist/api/team/index.d.ts +4 -1
  12. package/dist/{app-4LaGLcWC.js → app-CcbYGJ22.js} +757 -464
  13. package/dist/app.js +4 -4
  14. package/dist/dayjs.min-CgN1oBQf.js +282 -0
  15. package/dist/employee-khk560IC.js +172 -0
  16. package/dist/{index-BsEM84j5.js → index-D5sdamN5.js} +1154 -1183
  17. package/dist/{lodash-DYaYvsmp.js → lodash-7Am6_Zd3.js} +1 -1
  18. package/dist/{team-eo_yQh1g.js → team-CFyc6tnm.js} +1 -1
  19. package/dist/{timesheet-CfPIK52Q.js → timesheet-DKhEeLe7.js} +12 -12
  20. package/dist/tsconfig.app.tsbuildinfo +1 -1
  21. package/dist/types/audit-log.d.ts +1 -0
  22. package/dist/types/permission.d.ts +1 -5
  23. package/dist/{useAppStore-D0F-tWJO.js → useAppStore-DOSLuH24.js} +1 -1
  24. package/dist/{useLoading-DpbOtToC.js → useLoading-BA-GSZ3R.js} +1 -1
  25. package/dist/useSearch-B6WK1LBB.js +15 -0
  26. package/dist/views/audit-log/locales/index.d.ts +211 -0
  27. package/dist/views/team/components/BasePermission.vue.d.ts +0 -12
  28. package/package.json +2 -2
  29. package/dist/AuditLogList-D62QRWN-.js +0 -232
  30. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CZKBfM_R.js +0 -3119
  31. package/dist/employee-BZTntAR0.js +0 -450
  32. /package/dist/views/{hr/audit-log → audit-log}/AuditLogList.vue.d.ts +0 -0
@@ -1,13 +1,13 @@
1
1
  import { defineComponent as ce, ref as T, computed as _, onMounted as pe, watch as xe, resolveComponent as y, createBlock as C, openBlock as p, unref as t, withCtx as b, createElementVNode as f, createVNode as c, createCommentVNode as re, createElementBlock as L, Fragment as q, renderList as G, toDisplayString as P, h as F, createTextVNode as ne, resolveDynamicComponent as ie, withModifiers as Fe, nextTick as ue } from "vue";
2
- import { e as Ce, a as E, r as K, h as le, f as Re, c as de, d as j } from "./index-BsEM84j5.js";
2
+ import { e as Ce, a as E, r as K, h as le, f as Re, c as de, d as j } from "./index-D5sdamN5.js";
3
3
  import { useI18n as ve, useCoreStore as fe } from "@feedmepos/mf-common";
4
4
  import { useSnackbar as _e, components as W, useDialog as Ve, useBreakpoints as we, FmButtonColorThemeVariant as me, FmButtonVariant as ke } from "@feedmepos/ui-library";
5
- import { _ as Ie } from "./app-4LaGLcWC.js";
5
+ import { _ as Ie } from "./app-CcbYGJ22.js";
6
6
  import { _ as Le } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
7
- import { u as he } from "./useAppStore-D0F-tWJO.js";
7
+ import { u as he } from "./useAppStore-DOSLuH24.js";
8
8
  import { u as Ue, _ as se, a as Se, b as $e } from "./useRestaurantMap-D5BNPLKh.js";
9
- import { l as z } from "./lodash-DYaYvsmp.js";
10
- import { u as Ee } from "./useLoading-DpbOtToC.js";
9
+ import { l as z } from "./lodash-7Am6_Zd3.js";
10
+ import { u as Ee } from "./useLoading-BA-GSZ3R.js";
11
11
  const Te = { class: "fm-typo-en-title-md-600" }, Be = { class: "space-y-40" }, De = { class: "space-y-8" }, Pe = { class: "space-y-8" }, Me = {
12
12
  key: 0,
13
13
  class: "w-50 ml-5 flex flex-row items-start"
@@ -2,9 +2,9 @@ import { defineComponent as I, computed as V, resolveComponent as m, createEleme
2
2
  import { useI18n as N, useCoreStore as K } from "@feedmepos/mf-common";
3
3
  import { useSnackbar as j, useDialog as G, useBreakpoints as O, components as H, FmButtonColorThemeVariant as J, FmButtonVariant as Q } from "@feedmepos/ui-library";
4
4
  import { _ as X } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
5
- import { v as Y, u as z } from "./index-BsEM84j5.js";
6
- import { u as Z } from "./useLoading-DpbOtToC.js";
7
- import { a as ee } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CZKBfM_R.js";
5
+ import { v as Y, u as z } from "./index-D5sdamN5.js";
6
+ import { u as Z } from "./useLoading-BA-GSZ3R.js";
7
+ import { a as ee } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BvjXcknf.js";
8
8
  const oe = { class: "flex flex-row items-center gap-8" }, te = /* @__PURE__ */ I({
9
9
  __name: "PermissionWithTooltip",
10
10
  props: {
@@ -1,30 +1,30 @@
1
- import { ref as F, computed as c, defineComponent as G, watch as J, nextTick as Q, resolveComponent as w, createElementBlock as h, openBlock as i, createElementVNode as A, createVNode as S, renderSlot as V, withCtx as L, createCommentVNode as C, normalizeStyle as W, Fragment as B, createBlock as P, unref as x, renderList as K, normalizeClass as X, toDisplayString as Y, withModifiers as Z } from "vue";
1
+ import { ref as B, computed as c, defineComponent as G, watch as J, nextTick as Q, resolveComponent as w, createElementBlock as f, openBlock as i, createElementVNode as A, createVNode as k, renderSlot as _, withCtx as L, createCommentVNode as S, normalizeStyle as W, Fragment as V, createBlock as P, unref as p, renderList as N, normalizeClass as X, toDisplayString as Y, withModifiers as Z } from "vue";
2
2
  import "@feedmepos/ui-library";
3
3
  /* empty css */
4
- function ee(u, t, v = u) {
5
- const l = F(!0), d = c(() => {
6
- if (!l.value && !t.value)
4
+ function ee(t, u, m = t) {
5
+ const l = B(!0), g = c(() => {
6
+ if (!l.value && !u.value)
7
7
  return !0;
8
- if (t.value && t.value.length > 0) {
9
- const r = v.value.map((o) => o.value);
10
- return t.value.length === r.length && t.value.every((o) => r.includes(o));
8
+ if (u.value && u.value.length > 0) {
9
+ const r = m.value.map((o) => o.value);
10
+ return u.value.length === r.length && u.value.every((o) => r.includes(o));
11
11
  }
12
12
  return !1;
13
13
  }), e = c(() => {
14
- var r, o, b, f;
15
- return !!((r = t.value) != null && r.length && ((o = t.value) == null ? void 0 : o.length) > 0 && ((b = t.value) == null ? void 0 : b.length) < ((f = u.value) == null ? void 0 : f.length));
14
+ var r, o, y, v;
15
+ return !!((r = u.value) != null && r.length && ((o = u.value) == null ? void 0 : o.length) > 0 && ((y = u.value) == null ? void 0 : y.length) < ((v = t.value) == null ? void 0 : v.length));
16
16
  });
17
- return { allCleared: l, allSelected: d, indeterminate: e, toggleAll: () => {
18
- if (d.value) {
19
- t.value = void 0, l.value = !0;
17
+ return { allCleared: l, allSelected: g, indeterminate: e, toggleAll: () => {
18
+ if (g.value) {
19
+ u.value = void 0, l.value = !0;
20
20
  return;
21
21
  }
22
- const r = v.value.map((o) => o.value);
23
- r.length === u.value.length ? (t.value = void 0, l.value = !1) : (t.value = r, l.value = !1);
22
+ const r = m.value.map((o) => o.value);
23
+ r.length === t.value.length ? (u.value = void 0, l.value = !1) : (u.value = r, l.value = !1);
24
24
  }, toggleOption: (r) => {
25
- var b, f, k;
25
+ var y, v, x;
26
26
  let o;
27
- t.value === void 0 && l.value ? o = [r] : t.value === void 0 && !l.value ? o = (b = u.value.map((p) => p.value)) == null ? void 0 : b.filter((p) => p !== r) : (f = t.value) != null && f.includes(r) ? o = (k = t.value) == null ? void 0 : k.filter((p) => p !== r) : o = [...t.value || [], r], o.length === 0 ? (t.value = void 0, l.value = !0) : o.length === u.value.length ? (t.value = void 0, l.value = !1) : t.value = o;
27
+ u.value === void 0 && l.value ? o = [r] : u.value === void 0 && !l.value ? o = (y = t.value.map((b) => b.value)) == null ? void 0 : y.filter((b) => b !== r) : (v = u.value) != null && v.includes(r) ? o = (x = u.value) == null ? void 0 : x.filter((b) => b !== r) : o = [...u.value || [], r], o.length === 0 ? (u.value = void 0, l.value = !0) : o.length === t.value.length ? (u.value = void 0, l.value = !1) : u.value = o;
28
28
  } };
29
29
  }
30
30
  const le = { class: "w-full flex flex-col gap-8" }, ae = { class: "flex items-center gap-8" }, te = { class: "inline-flex items-center" }, ue = { class: "flex flex-col w-[360px] min-h-0 gap-8" }, ne = {
@@ -49,47 +49,47 @@ const le = { class: "w-full flex flex-col gap-8" }, ae = { class: "flex items-ce
49
49
  selectedPrefix: { default: "Selected: " }
50
50
  },
51
51
  emits: ["update:modelValue", "change"],
52
- setup(u, { expose: t, emit: v }) {
53
- const l = u, d = v, e = c({
52
+ setup(t, { expose: u, emit: m }) {
53
+ const l = t, g = m, e = c({
54
54
  get: () => l.modelValue,
55
55
  set: (a) => {
56
- d("update:modelValue", a), d("change", a);
56
+ g("update:modelValue", a), g("change", a);
57
57
  }
58
- }), g = F(""), y = c(() => l.items), r = c(() => {
59
- if (!l.searchable || !g.value.trim()) return y.value;
60
- const a = g.value.toLowerCase();
61
- return y.value.filter((n) => n.label.toLowerCase().includes(a));
58
+ }), C = B(""), h = c(() => l.items), r = c(() => {
59
+ if (!l.searchable || !C.value.trim()) return h.value;
60
+ const a = C.value.toLowerCase();
61
+ return h.value.filter((n) => n.label.toLowerCase().includes(a));
62
62
  }), o = c(() => {
63
63
  if (!e.value || Array.isArray(e.value) && e.value.length === 0)
64
64
  return l.placeholder;
65
65
  if (Array.isArray(e.value) && e.value.length === 1) {
66
- const n = y.value.find((m) => m.value === e.value[0]);
66
+ const n = h.value.find((d) => d.value === e.value[0]);
67
67
  return (n == null ? void 0 : n.label) || l.placeholder;
68
68
  }
69
69
  const a = Array.isArray(e.value) ? e.value.length : 0;
70
70
  return `${l.selectedPrefix}${a}`;
71
- }), b = c(() => {
71
+ }), y = c(() => {
72
72
  if (e.value === void 0 || e.value === null || e.value === "")
73
73
  return l.placeholder;
74
- const a = y.value.find((n) => n.value === e.value);
74
+ const a = h.value.find((n) => n.value === e.value);
75
75
  return (a == null ? void 0 : a.label) || l.placeholder;
76
- }), f = c(
77
- () => l.multiple ? o.value : b.value
78
- ), k = c(() => l.disabled ? "neutral-gray-200" : l.variant === "dark" ? "neutral-black" : "neutral-gray-400"), p = c(() => l.disabled ? "text-fm-color-neutral-gray-200" : l.variant === "dark" ? "text-fm-color-neutral-black" : "text-fm-color-neutral-gray-400"), M = F(void 0), N = new Proxy(M, {
76
+ }), v = c(
77
+ () => l.multiple ? o.value : y.value
78
+ ), x = c(() => l.disabled ? "neutral-gray-200" : l.variant === "dark" ? "neutral-black" : "neutral-gray-400"), b = c(() => l.disabled ? "text-fm-color-neutral-gray-200" : l.variant === "dark" ? "text-fm-color-neutral-black" : "text-fm-color-neutral-gray-400"), M = B(void 0), E = new Proxy(M, {
79
79
  get(a, n) {
80
80
  return n === "value" ? Array.isArray(e.value) ? e.value : e.value === void 0 ? void 0 : [e.value] : M[n];
81
81
  },
82
- set(a, n, m) {
83
- return n === "value" ? (e.value = m, !0) : (M[n] = m, !0);
82
+ set(a, n, d) {
83
+ return n === "value" ? (e.value = d, !0) : (M[n] = d, !0);
84
84
  }
85
- }), { allSelected: $, toggleAll: E, toggleOption: H, indeterminate: D } = ee(
86
- y,
87
- N,
85
+ }), { allSelected: $, toggleAll: D, toggleOption: H, indeterminate: K } = ee(
86
+ h,
87
+ E,
88
88
  r
89
89
  );
90
90
  function O(a) {
91
91
  var n;
92
- l.multiple || (e.value = a, (n = _.value) == null || n.toggleMenu(!1));
92
+ l.multiple || (e.value = a, (n = F.value) == null || n.toggleMenu(!1));
93
93
  }
94
94
  function T(a) {
95
95
  a.stopPropagation(), !l.disabled && (e.value = null);
@@ -99,70 +99,70 @@ const le = { class: "w-full flex flex-col gap-8" }, ae = { class: "flex items-ce
99
99
  async (a) => {
100
100
  if (a && !l.multiple && (e.value === void 0 || e.value === null)) {
101
101
  await Q();
102
- const n = y.value[0];
102
+ const n = h.value[0];
103
103
  n && (e.value = n.value);
104
104
  }
105
105
  },
106
106
  { immediate: !0 }
107
107
  );
108
- const _ = F(null);
109
- return t({
108
+ const F = B(null);
109
+ return u({
110
110
  open: () => {
111
111
  var a;
112
- return (a = _.value) == null ? void 0 : a.toggleMenu(!0);
112
+ return (a = F.value) == null ? void 0 : a.toggleMenu(!0);
113
113
  },
114
114
  close: () => {
115
115
  var a;
116
- return (a = _.value) == null ? void 0 : a.toggleMenu(!1);
116
+ return (a = F.value) == null ? void 0 : a.toggleMenu(!1);
117
117
  }
118
118
  }), (a, n) => {
119
- const m = w("FmIcon"), U = w("FmChip"), j = w("FmSearch"), z = w("FmMenuItem"), q = w("FmMenu");
120
- return i(), h("div", le, [
119
+ const d = w("FmIcon"), U = w("FmChip"), j = w("FmSearch"), z = w("FmMenuItem"), q = w("FmMenu");
120
+ return i(), f("div", le, [
121
121
  A("div", ae, [
122
- S(q, {
122
+ k(q, {
123
123
  ref_key: "menuRef",
124
- ref: _,
124
+ ref: F,
125
125
  "close-on-click": !1,
126
- disabled: u.disabled,
126
+ disabled: t.disabled,
127
127
  "z-index": 50,
128
128
  "selector-for-dismiss-away-event-exclusion": ".fm-dialog, .fm-select__menu__wrapper"
129
129
  }, {
130
130
  "menu-button": L(() => [
131
- V(a.$slots, "menu-button", {}, () => [
131
+ _(a.$slots, "menu-button", {}, () => [
132
132
  A("div", te, [
133
- S(U, { disabled: u.disabled }, {
133
+ k(U, { disabled: t.disabled }, {
134
134
  default: L(() => [
135
- S(m, {
136
- color: k.value,
137
- name: u.chipIcon,
135
+ k(d, {
136
+ color: x.value,
137
+ name: t.chipIcon,
138
138
  outline: "",
139
139
  size: "sm"
140
140
  }, null, 8, ["color", "name"]),
141
- f.value ? (i(), h("div", {
141
+ v.value ? (i(), f("div", {
142
142
  key: 0,
143
143
  class: X([
144
144
  "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap",
145
- p.value
145
+ b.value
146
146
  ])
147
- }, Y(f.value), 3)) : C("", !0),
148
- S(m, {
149
- color: k.value,
147
+ }, Y(v.value), 3)) : S("", !0),
148
+ k(d, {
149
+ color: x.value,
150
150
  name: "keyboard_arrow_down",
151
151
  size: "sm"
152
152
  }, null, 8, ["color"]),
153
- u.clearable && !u.multiple && e.value != null && e.value !== "" && !u.disabled ? (i(), h("button", {
153
+ t.clearable && !t.multiple && e.value != null && e.value !== "" && !t.disabled ? (i(), f("button", {
154
154
  key: 1,
155
155
  class: "ml-4 focus:outline-none",
156
156
  type: "button",
157
157
  "aria-label": "Clear selection",
158
158
  onClick: Z(T, ["stop"])
159
159
  }, [
160
- S(m, {
160
+ k(d, {
161
161
  name: "close",
162
162
  size: "sm",
163
- color: k.value
163
+ color: x.value
164
164
  }, null, 8, ["color"])
165
- ])) : C("", !0)
165
+ ])) : S("", !0)
166
166
  ]),
167
167
  _: 1
168
168
  }, 8, ["disabled"])
@@ -171,34 +171,34 @@ const le = { class: "w-full flex flex-col gap-8" }, ae = { class: "flex items-ce
171
171
  ]),
172
172
  default: L(() => [
173
173
  A("div", ue, [
174
- u.searchable ? (i(), h("div", ne, [
174
+ t.searchable ? (i(), f("div", ne, [
175
175
  A("div", re, [
176
- S(j, {
177
- modelValue: g.value,
178
- "onUpdate:modelValue": n[0] || (n[0] = (s) => g.value = s),
179
- placeholder: u.searchPlaceholder
176
+ k(j, {
177
+ modelValue: C.value,
178
+ "onUpdate:modelValue": n[0] || (n[0] = (s) => C.value = s),
179
+ placeholder: t.searchPlaceholder
180
180
  }, null, 8, ["modelValue", "placeholder"])
181
181
  ])
182
- ])) : C("", !0),
182
+ ])) : S("", !0),
183
183
  A("div", {
184
184
  class: "flex-1 overflow-y-auto min-h-0",
185
- style: W({ maxHeight: typeof u.maxHeight == "number" ? u.maxHeight + "px" : u.maxHeight })
185
+ style: W({ maxHeight: typeof t.maxHeight == "number" ? t.maxHeight + "px" : t.maxHeight })
186
186
  }, [
187
- u.multiple ? (i(), h(B, { key: 0 }, [
188
- u.showSelectAll ? (i(), P(z, {
187
+ t.multiple ? (i(), f(V, { key: 0 }, [
188
+ t.showSelectAll ? (i(), P(z, {
189
189
  key: 0,
190
190
  label: "All",
191
191
  "has-checkbox": "",
192
- "model-value": x($),
193
- indeterminate: x(D),
194
- onClick: x(E)
195
- }, null, 8, ["model-value", "indeterminate", "onClick"])) : C("", !0),
196
- r.value.length ? (i(!0), h(B, { key: 1 }, K(r.value, (s) => {
192
+ "model-value": p($),
193
+ indeterminate: p(K),
194
+ onClick: p(D)
195
+ }, null, 8, ["model-value", "indeterminate", "onClick"])) : S("", !0),
196
+ r.value.length ? (i(!0), f(V, { key: 1 }, N(r.value, (s) => {
197
197
  var I;
198
- return V(a.$slots, "option", {
198
+ return _(a.$slots, "option", {
199
199
  option: s,
200
- selected: x($) || Array.isArray(e.value) && ((I = e.value) == null ? void 0 : I.includes(s.value)),
201
- toggle: () => x(H)(s.value)
200
+ selected: p($) || Array.isArray(e.value) && ((I = e.value) == null ? void 0 : I.includes(s.value)),
201
+ toggle: () => p(H)(s.value)
202
202
  }, () => {
203
203
  var R;
204
204
  return [
@@ -206,14 +206,14 @@ const le = { class: "w-full flex flex-col gap-8" }, ae = { class: "flex items-ce
206
206
  key: s.value,
207
207
  label: s.label,
208
208
  "has-checkbox": "",
209
- "model-value": x($) || Array.isArray(e.value) && ((R = e.value) == null ? void 0 : R.includes(s.value)),
210
- onClick: (ie) => x(H)(s.value)
209
+ "model-value": p($) || Array.isArray(e.value) && ((R = e.value) == null ? void 0 : R.includes(s.value)),
210
+ onClick: (ie) => p(H)(s.value)
211
211
  }, null, 8, ["label", "model-value", "onClick"]))
212
212
  ];
213
213
  }, !0);
214
- }), 256)) : C("", !0)
215
- ], 64)) : (i(), h(B, { key: 1 }, [
216
- r.value.length ? (i(!0), h(B, { key: 0 }, K(r.value, (s) => V(a.$slots, "option", {
214
+ }), 256)) : S("", !0)
215
+ ], 64)) : (i(), f(V, { key: 1 }, [
216
+ r.value.length ? (i(!0), f(V, { key: 0 }, N(r.value, (s) => _(a.$slots, "option", {
217
217
  option: s,
218
218
  selected: e.value === s.value,
219
219
  toggle: () => O(s.value)
@@ -223,36 +223,25 @@ const le = { class: "w-full flex flex-col gap-8" }, ae = { class: "flex items-ce
223
223
  label: s.label,
224
224
  onClick: (I) => O(s.value)
225
225
  }, null, 8, ["label", "onClick"]))
226
- ], !0)), 256)) : C("", !0)
226
+ ], !0)), 256)) : S("", !0)
227
227
  ], 64))
228
228
  ], 4)
229
229
  ])
230
230
  ]),
231
231
  _: 3
232
232
  }, 8, ["disabled"]),
233
- V(a.$slots, "append-right", {}, void 0, !0)
233
+ _(a.$slots, "append-right", {}, void 0, !0)
234
234
  ])
235
235
  ]);
236
236
  };
237
237
  }
238
- }), se = (u, t) => {
239
- const v = u.__vccOpts || u;
240
- for (const [l, d] of t)
241
- v[l] = d;
242
- return v;
243
- }, fe = /* @__PURE__ */ se(oe, [["__scopeId", "data-v-6634d154"]]), me = (u) => {
244
- const t = F(u || "");
245
- function v(e) {
246
- return `${e}`.trim().toLowerCase();
247
- }
248
- const l = c(() => v(t.value));
249
- function d(e) {
250
- return l.value ? e.some((g) => v(g).includes(l.value)) : !0;
251
- }
252
- return { searchKey: t, filter: d };
253
- };
238
+ }), se = (t, u) => {
239
+ const m = t.__vccOpts || t;
240
+ for (const [l, g] of u)
241
+ m[l] = g;
242
+ return m;
243
+ }, fe = /* @__PURE__ */ se(oe, [["__scopeId", "data-v-6634d154"]]);
254
244
  export {
255
245
  fe as S,
256
- se as _,
257
- me as u
246
+ se as _
258
247
  };
@@ -1,15 +1,16 @@
1
1
  import { defineComponent as se, ref as F, resolveComponent as h, createBlock as M, openBlock as v, withCtx as z, createElementVNode as r, renderSlot as de, createCommentVNode as Q, withModifiers as $e, nextTick as Pe, createElementBlock as K, normalizeClass as Ie, createTextVNode as Me, toDisplayString as O, computed as I, Fragment as re, renderList as pe, createVNode as i, unref as n, watch as Ce, isRef as fe, createSlots as je } from "vue";
2
2
  import { useI18n as me, useCoreStore as ie, baseClientInstance as xe, RestaurantSelector as Fe } from "@feedmepos/mf-common";
3
3
  import { useBreakpoints as Ne, useSnackbar as Re, useDialog as Te, components as Ve } from "@feedmepos/ui-library";
4
- import { _ as ze, u as Be, S as Se } from "./useSearch-C6gRA62e.js";
5
- import { s as Ke, t as qe, _ as Ge } from "./app-4LaGLcWC.js";
4
+ import { _ as ze, S as Se } from "./SelectFilter-NbXrJ4iH.js";
5
+ import { s as Ke, o as qe, _ as Ge } from "./app-CcbYGJ22.js";
6
6
  import { _ as We } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
7
- import { u as Je } from "./useLoading-DpbOtToC.js";
8
- import { g as Ue, l as De, u as Oe, m as we, n as ve, o as Qe, p as Xe, t as ue, q as Ye } from "./index-BsEM84j5.js";
9
- import { u as Ae } from "./useAppStore-D0F-tWJO.js";
7
+ import { u as Be } from "./useSearch-B6WK1LBB.js";
8
+ import { u as Je } from "./useLoading-BA-GSZ3R.js";
9
+ import { g as Ue, l as De, u as Oe, m as we, n as ve, o as Qe, p as Xe, t as ue, q as Ye } from "./index-D5sdamN5.js";
10
+ import { u as Ae } from "./useAppStore-DOSLuH24.js";
10
11
  /* empty css */
11
- import { _ as Ze, a as He } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CZKBfM_R.js";
12
- import { u as es } from "./team-eo_yQh1g.js";
12
+ import { _ as Ze, a as He } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BvjXcknf.js";
13
+ import { u as es } from "./team-CFyc6tnm.js";
13
14
  const ss = /* @__PURE__ */ se({
14
15
  __name: "BottomSheetMenu",
15
16
  setup(t) {
@@ -212,8 +213,8 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
212
213
  var x;
213
214
  let g = ((x = b.value) == null ? void 0 : x.displayName) ?? "";
214
215
  g || (g = "Feed Me");
215
- const [V, j] = g.split(" ");
216
- return j ? `${V[0]}${j[0]}` : V.slice(0, 2);
216
+ const [V, E] = g.split(" ");
217
+ return E ? `${V[0]}${E[0]}` : V.slice(0, 2);
217
218
  }), R = F(!1);
218
219
  function te(g) {
219
220
  e("invite", g), R.value = !0;
@@ -223,7 +224,7 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
223
224
  }
224
225
  return (g, V) => {
225
226
  var $, q, G;
226
- const j = h("FmRadio"), x = h("FmPhoneNumber"), a = h("FmTextField"), o = h("FmRadioGroup"), S = h("FmButton");
227
+ const E = h("FmRadio"), x = h("FmPhoneNumber"), a = h("FmTextField"), o = h("FmRadioGroup"), S = h("FmButton");
227
228
  return v(), K("div", _s, [
228
229
  R.value ? Q("", !0) : (v(), K("div", hs, [
229
230
  i(o, {
@@ -231,7 +232,7 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
231
232
  "onUpdate:modelValue": V[2] || (V[2] = (P) => k.value = P)
232
233
  }, {
233
234
  default: z(() => [
234
- i(j, {
235
+ i(E, {
235
236
  value: "phone",
236
237
  label: n(_)("team.memberForm.searchUser.phoneNumber")
237
238
  }, null, 8, ["label"]),
@@ -242,7 +243,7 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
242
243
  "extra-country-codes": n(A).enabledCountries.value,
243
244
  class: "ml-8"
244
245
  }, null, 8, ["modelValue", "extra-country-codes"])) : Q("", !0),
245
- i(j, {
246
+ i(E, {
246
247
  value: "email",
247
248
  label: n(_)("team.memberForm.searchUser.email")
248
249
  }, null, 8, ["label"]),
@@ -362,7 +363,7 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
362
363
  })
363
364
  );
364
365
  }
365
- function j(a, o) {
366
+ function E(a, o) {
366
367
  g("roles", [
367
368
  ...e.modelValue.roles.filter(
368
369
  (S) => S.restaurantId !== a
@@ -462,7 +463,7 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
462
463
  i(W, {
463
464
  "model-value": ((c = t.modelValue.roles.find((d) => d.restaurantId === f.value)) == null ? void 0 : c.roleId) || R.value,
464
465
  items: f.roleOptions,
465
- "onUpdate:modelValue": (d) => j(f.value, d)
466
+ "onUpdate:modelValue": (d) => E(f.value, d)
466
467
  }, null, 8, ["model-value", "items", "onUpdate:modelValue"])
467
468
  ])
468
469
  ];
@@ -512,12 +513,12 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
512
513
  }
513
514
  function V() {
514
515
  const c = ve(x.value).map(
515
- ({ setNames: B, ...T }) => T
516
+ ({ setNames: B, ...j }) => j
516
517
  );
517
518
  return Qe(c, b.value);
518
519
  }
519
- function j() {
520
- var c, d, B, T, D, X, ee, le, H, L;
520
+ function E() {
521
+ var c, d, B, j, D, X, ee, le, H, L;
521
522
  return {
522
523
  email: ((c = u.value) == null ? void 0 : c.email) ?? void 0,
523
524
  phoneNumber: ((d = u.value) == null ? void 0 : d.phoneNumber) ?? void 0,
@@ -528,7 +529,7 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
528
529
  subject: Ke(oe.subject)
529
530
  })),
530
531
  permissionSetIds: y.value,
531
- name: ((B = u.value) == null ? void 0 : B.displayName) || ((T = e.initialValue) == null ? void 0 : T.name) || "",
532
+ name: ((B = u.value) == null ? void 0 : B.displayName) || ((j = e.initialValue) == null ? void 0 : j.name) || "",
532
533
  posUser: m.value ? {
533
534
  ...m.value,
534
535
  name: m.value.name || ((X = (D = e.initialValue) == null ? void 0 : D.posUser) == null ? void 0 : X.name) || ((ee = e.initialValue) == null ? void 0 : ee.name) || ((le = u.value) == null ? void 0 : le.displayName) || "",
@@ -552,22 +553,22 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
552
553
  if (!c) return;
553
554
  const B = we(d);
554
555
  if (!B) return c;
555
- const T = De(c);
556
- return T.roles = T.roles.reduce((D, X) => (B.includes(X.roleId) && D.push(X), D), []), T;
556
+ const j = De(c);
557
+ return j.roles = j.roles.reduce((D, X) => (B.includes(X.roleId) && D.push(X), D), []), j;
557
558
  }
558
559
  async function $() {
559
560
  await Pe(), a.value && a.value.$el.scrollIntoView({ behavior: "smooth", block: "start" });
560
561
  }
561
562
  const q = F();
562
563
  async function G() {
563
- return (await q.value.validateInputsWithoutSubmit()).length ? null : j();
564
+ return (await q.value.validateInputsWithoutSubmit()).length ? null : E();
564
565
  }
565
566
  return p({
566
- readFormData: j,
567
+ readFormData: E,
567
568
  validate: G
568
569
  }), (c, d) => {
569
- const B = h("FmSelect"), T = h("FmForm");
570
- return v(), M(T, {
570
+ const B = h("FmSelect"), j = h("FmForm");
571
+ return v(), M(j, {
571
572
  ref_key: "formRef",
572
573
  ref: q,
573
574
  class: "mx-4"
@@ -645,7 +646,7 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
645
646
  var J = /* @__PURE__ */ function(t) {
646
647
  return t[t.ADD = 0] = "ADD", t[t.UPDATE = 1] = "UPDATE", t[t.CLOSED = 2] = "CLOSED", t;
647
648
  }(J || {});
648
- const rt = /* @__PURE__ */ se({
649
+ const it = /* @__PURE__ */ se({
649
650
  __name: "TeamMemberList",
650
651
  setup(t, {
651
652
  expose: p
@@ -690,7 +691,7 @@ const rt = /* @__PURE__ */ se({
690
691
  enableSorting: !1,
691
692
  cell(s) {
692
693
  const l = s.row.original, w = m.getPermissionAssignmentByUserId(l.id), Y = (w == null ? void 0 : w.permissionSetIds) || l.doc.permissionSetIds || [];
693
- return y.permissionSets.value.filter((E) => Y.includes(E.id)).map((E) => E.name).join(", ");
694
+ return y.permissionSets.value.filter((T) => Y.includes(T.id)).map((T) => T.name).join(", ");
694
695
  }
695
696
  }, {
696
697
  accessorKey: "permission",
@@ -739,18 +740,18 @@ const rt = /* @__PURE__ */ se({
739
740
  }
740
741
  function g(s) {
741
742
  var U, ye, _e, he;
742
- const l = m.getPermissionAssignmentByUserId(s.id), w = (l == null ? void 0 : l.customPermissions) || s.permissions || [], Y = (l == null ? void 0 : l.permissionSetIds) || [], Z = y.permissionSets.value.filter((ge) => Y.includes(ge.id)), E = Ye(ve(Z).map(({
743
+ const l = m.getPermissionAssignmentByUserId(s.id), w = (l == null ? void 0 : l.customPermissions) || s.permissions || [], Y = (l == null ? void 0 : l.permissionSetIds) || [], Z = y.permissionSets.value.filter((ge) => Y.includes(ge.id)), T = Ye(ve(Z).map(({
743
744
  setNames: ge,
744
745
  setId: Js,
745
746
  ...Ee
746
747
  }) => Ee), w);
747
- return console.log("effectivePermissions", E), {
748
+ return {
748
749
  id: s.id,
749
750
  isOwner: s.doc.isOwner,
750
751
  name: s.name,
751
752
  phoneNumber: s.phoneNumber,
752
753
  email: s.email,
753
- permissions: E,
754
+ permissions: T,
754
755
  permissionSetIds: Y,
755
756
  posUser: s.doc.posUser ? {
756
757
  code: ((U = s.doc.posUser) == null ? void 0 : U.code) ?? "",
@@ -766,7 +767,7 @@ const rt = /* @__PURE__ */ se({
766
767
  $.value = w, x.value = J.UPDATE;
767
768
  }
768
769
  s == ne.Remove && W(l);
769
- }, j = Te(), x = F(J.CLOSED), a = I(() => x.value !== J.CLOSED), o = I(() => x.value === J.ADD ? e("common.add") : e("common.update")), S = I(() => x.value === J.ADD ? e("team.actions.addMember") : e("team.actions.updateMember")), $ = F();
770
+ }, E = Te(), x = F(J.CLOSED), a = I(() => x.value !== J.CLOSED), o = I(() => x.value === J.ADD ? e("common.add") : e("common.update")), S = I(() => x.value === J.ADD ? e("team.actions.addMember") : e("team.actions.updateMember")), $ = F();
770
771
  function q(s) {
771
772
  s || (x.value = J.CLOSED);
772
773
  }
@@ -776,7 +777,7 @@ const rt = /* @__PURE__ */ se({
776
777
  const {
777
778
  breakpoints: P
778
779
  } = Ne(), W = (s) => {
779
- j.open({
780
+ E.open({
780
781
  title: e("team.actions.removeMember"),
781
782
  message: e("team.removeMember.confirmationMessage", {
782
783
  memberName: s.name
@@ -798,11 +799,11 @@ const rt = /* @__PURE__ */ se({
798
799
  successMessage: e("team.removeMember.successMessage", {
799
800
  memberName: s.name
800
801
  })
801
- }), j.close();
802
+ }), E.close();
802
803
  });
803
804
  }, f = () => {
804
805
  $.value = null, x.value = J.ADD;
805
- }, c = I(() => b.members), d = F(), B = F(), T = I(() => Object.values(qe).map((s) => ({
806
+ }, c = I(() => b.members), d = F(), B = F(), j = I(() => Object.values(qe).map((s) => ({
806
807
  label: s.label,
807
808
  value: s.subject
808
809
  }))), {
@@ -810,7 +811,7 @@ const rt = /* @__PURE__ */ se({
810
811
  filter: X
811
812
  } = Be(""), ee = I(() => c.value.filter((s) => {
812
813
  var Z;
813
- const l = !d.value || s.managableRestaurantIds.some((E) => d.value.includes(E)), w = ((Z = s.permissions) == null ? void 0 : Z.map((E) => E.subject).flat().filter(Boolean)) || [], Y = !B.value || w.some((E) => B.value.includes(E));
814
+ const l = !d.value || s.managableRestaurantIds.some((T) => d.value.includes(T)), w = ((Z = s.permissions) == null ? void 0 : Z.map((T) => T.subject).flat().filter(Boolean)) || [], Y = !B.value || w.some((T) => B.value.includes(T));
814
815
  return l && Y && X([s.name, s.phoneNumber, R(s)]);
815
816
  }));
816
817
  async function le() {
@@ -854,7 +855,7 @@ const rt = /* @__PURE__ */ se({
854
855
  }), p({
855
856
  create: f
856
857
  }), (s, l) => {
857
- const w = h("FmSearch"), Y = h("FmTable"), Z = h("FmButton"), E = h("FmSideSheet");
858
+ const w = h("FmSearch"), Y = h("FmTable"), Z = h("FmButton"), T = h("FmSideSheet");
858
859
  return v(), K(re, null, [r("div", js, [r("div", Ts, [r("div", zs, [r("div", Ks, [i(n(Fe), {
859
860
  modelValue: d.value,
860
861
  "onUpdate:modelValue": l[0] || (l[0] = (U) => d.value = U),
@@ -867,7 +868,7 @@ const rt = /* @__PURE__ */ se({
867
868
  "onUpdate:modelValue": l[1] || (l[1] = (U) => B.value = U),
868
869
  multiple: "",
869
870
  variant: "dark",
870
- items: T.value,
871
+ items: j.value,
871
872
  "selected-prefix": n(e)("team.filter.selected_permission_prefix"),
872
873
  placeholder: n(e)("team.filter.permission_placeholder")
873
874
  }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), i(w, {
@@ -894,7 +895,7 @@ const rt = /* @__PURE__ */ se({
894
895
  "onUpdate:modelValue": l[5] || (l[5] = (U) => B.value = U),
895
896
  multiple: "",
896
897
  variant: "dark",
897
- items: T.value,
898
+ items: j.value,
898
899
  "selected-prefix": n(e)("team.filter.selected_permission_prefix"),
899
900
  placeholder: n(e)("team.filter.permission_placeholder")
900
901
  }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), c.value.length === 0 && !C.value ? (v(), M(n(We), {
@@ -914,7 +915,7 @@ const rt = /* @__PURE__ */ se({
914
915
  onRowClick: l[6] || (l[6] = (U) => V(n(ne).Update, U.original))
915
916
  }, null, 8, ["row-data", "page-size", "loading"])]),
916
917
  _: 1
917
- }))])]), i(E, {
918
+ }))])]), i(T, {
918
919
  header: S.value,
919
920
  "model-value": a.value,
920
921
  "max-width": 560,
@@ -944,5 +945,5 @@ const rt = /* @__PURE__ */ se({
944
945
  }
945
946
  });
946
947
  export {
947
- rt as default
948
+ it as default
948
949
  };