@feedmepos/mf-hrm-portal 1.1.3-dev → 1.1.4-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.
@@ -1,22 +1,24 @@
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
- import { useI18n as me, useCoreStore as ie, baseClientInstance as xe, RestaurantSelector as Fe } from "@feedmepos/mf-common";
1
+ import { defineComponent as se, ref as x, resolveComponent as h, createBlock as M, openBlock as v, withCtx as z, createElementVNode as r, renderSlot as de, createCommentVNode as Q, withModifiers as Pe, nextTick as $e, 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
+ import { useI18n as me, useCoreStore as ie, baseClientInstance as Fe, RestaurantSelector as xe } from "@feedmepos/mf-common";
3
3
  import { useBreakpoints as Ne, useSnackbar as Re, useDialog as Te, components as Ve } from "@feedmepos/ui-library";
4
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
- import { _ as We } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
5
+ import { _ as Ke } from "./app-DKuRvdeB.js";
6
+ import { _ as qe } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
7
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";
8
+ import { u as Ge } from "./useLoading-FywoIKYV.js";
9
+ import { g as Ue, m as De, u as Oe, n as we, o as We, p as Je, t as ue, q as Qe } from "./index-DEH1isVF.js";
10
+ import { FullPortalPermissions as Xe } from "@feedmepos/hrm-permission";
11
+ import { mapToLegacyPermission as Ye, mergePermissionSet as ve } from "@feedmepos/hrm-permission/utils";
12
+ import { u as Ae } from "./useAppStore-BJZiy3Q1.js";
11
13
  /* empty css */
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";
14
+ import { _ as Ze, a as He } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CRJCyyrg.js";
15
+ import { u as es } from "./team-D9GxbwvB.js";
14
16
  const ss = /* @__PURE__ */ se({
15
17
  __name: "BottomSheetMenu",
16
18
  setup(t) {
17
- const p = F(!1);
19
+ const p = x(!1);
18
20
  async function e() {
19
- await Pe(), p.value = !p.value;
21
+ await $e(), p.value = !p.value;
20
22
  }
21
23
  return (_, u) => {
22
24
  const A = h("FmButton"), k = h("FmBottomSheet");
@@ -32,7 +34,7 @@ const ss = /* @__PURE__ */ se({
32
34
  key: 0,
33
35
  icon: "more_vert",
34
36
  variant: "tertiary",
35
- onClick: $e(e, ["stop"])
37
+ onClick: Pe(e, ["stop"])
36
38
  })),
37
39
  de(_.$slots, "button")
38
40
  ]),
@@ -79,7 +81,7 @@ const ss = /* @__PURE__ */ se({
79
81
  ]);
80
82
  };
81
83
  }
82
- }), ls = /* @__PURE__ */ se({
84
+ }), os = /* @__PURE__ */ se({
83
85
  __name: "ResponsiveContextMenu",
84
86
  props: {
85
87
  items: {}
@@ -139,7 +141,7 @@ const ss = /* @__PURE__ */ se({
139
141
  }
140
142
  });
141
143
  var ne = /* @__PURE__ */ ((t) => (t.Update = "Update", t.Remove = "Remove", t))(ne || {});
142
- const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-center gap-16" }, rs = { class: "space-y-4 min-w-0 flex-1" }, is = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, ms = { class: "fm-typo-en-body-lg-600 truncate" }, us = { class: "w-full flex gap-16 items-center" }, cs = { class: "flex-1 flex flex-col gap-4 min-w-0" }, ds = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, ps = { class: "fm-typo-en-body-lg-600 truncate" }, fs = { class: "flex-1 flex flex-col gap-4 min-w-0" }, vs = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, bs = { class: "fm-typo-en-body-lg-600 truncate" }, ys = /* @__PURE__ */ se({
144
+ const ls = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-center gap-16" }, rs = { class: "space-y-4 min-w-0 flex-1" }, is = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, ms = { class: "fm-typo-en-body-lg-600 truncate" }, us = { class: "w-full flex gap-16 items-center" }, cs = { class: "flex-1 flex flex-col gap-4 min-w-0" }, ds = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, ps = { class: "fm-typo-en-body-lg-600 truncate" }, fs = { class: "flex-1 flex flex-col gap-4 min-w-0" }, vs = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, bs = { class: "fm-typo-en-body-lg-600 truncate" }, ys = /* @__PURE__ */ se({
143
145
  __name: "MemberInfo",
144
146
  props: {
145
147
  data: {}
@@ -148,7 +150,7 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
148
150
  const { t: p } = me();
149
151
  return (e, _) => {
150
152
  const u = h("FmAvatar");
151
- return v(), K("div", os, [
153
+ return v(), K("div", ls, [
152
154
  r("div", ns, [
153
155
  i(u, {
154
156
  size: "xl",
@@ -177,24 +179,24 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
177
179
  var e;
178
180
  const { currentBusiness: p } = ie();
179
181
  return Ue(
180
- await xe("/").get(`/user/b/${(e = p.value) == null ? void 0 : e._id}/phone/${t}`)
182
+ await Fe("/").get(`/user/b/${(e = p.value) == null ? void 0 : e._id}/phone/${t}`)
181
183
  );
182
184
  },
183
185
  async readPermissionUserByEmail(t) {
184
186
  var e;
185
187
  const { currentBusiness: p } = ie();
186
188
  return Ue(
187
- await xe("/").get(`/user/b/${(e = p.value) == null ? void 0 : e._id}/email/${t}`)
189
+ await Fe("/").get(`/user/b/${(e = p.value) == null ? void 0 : e._id}/email/${t}`)
188
190
  );
189
191
  }
190
192
  }, _s = { class: "flex flex-col gap-24 w-full" }, hs = {
191
193
  key: 0,
192
194
  class: "flex flex-col gap-8"
193
- }, gs = { class: "user-info-icon user-info-icon--lg" }, xs = { class: "flex-1 overflow-hidden" }, Fs = { class: "profile-displayName" }, Vs = { class: "profile-email" }, Ss = { class: "profile-phone" }, Us = { key: 2 }, ws = /* @__PURE__ */ se({
195
+ }, gs = { class: "user-info-icon user-info-icon--lg" }, Fs = { class: "flex-1 overflow-hidden" }, xs = { class: "profile-displayName" }, Vs = { class: "profile-email" }, Ss = { class: "profile-phone" }, Us = { key: 2 }, ws = /* @__PURE__ */ se({
194
196
  __name: "PortalUserSearcher",
195
197
  emits: ["invite"],
196
198
  setup(t, { emit: p }) {
197
- const e = p, { t: _ } = me(), u = Re(), A = ie(), k = F("phone"), y = F(""), m = F(""), b = F();
199
+ const e = p, { t: _ } = me(), u = Re(), A = ie(), k = x("phone"), y = x(""), m = x(""), b = x();
198
200
  async function C() {
199
201
  if (!y.value && !m.value) {
200
202
  u.open({
@@ -210,12 +212,12 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
210
212
  }), b.value = g;
211
213
  }
212
214
  const N = I(() => {
213
- var x;
214
- let g = ((x = b.value) == null ? void 0 : x.displayName) ?? "";
215
+ var F;
216
+ let g = ((F = b.value) == null ? void 0 : F.displayName) ?? "";
215
217
  g || (g = "Feed Me");
216
218
  const [V, E] = g.split(" ");
217
219
  return E ? `${V[0]}${E[0]}` : V.slice(0, 2);
218
- }), R = F(!1);
220
+ }), R = x(!1);
219
221
  function te(g) {
220
222
  e("invite", g), R.value = !0;
221
223
  }
@@ -223,23 +225,23 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
223
225
  R.value = !1;
224
226
  }
225
227
  return (g, V) => {
226
- var $, q, G;
227
- const E = h("FmRadio"), x = h("FmPhoneNumber"), a = h("FmTextField"), o = h("FmRadioGroup"), S = h("FmButton");
228
+ var P, q, G;
229
+ const E = h("FmRadio"), F = h("FmPhoneNumber"), a = h("FmTextField"), l = h("FmRadioGroup"), S = h("FmButton");
228
230
  return v(), K("div", _s, [
229
231
  R.value ? Q("", !0) : (v(), K("div", hs, [
230
- i(o, {
232
+ i(l, {
231
233
  modelValue: k.value,
232
- "onUpdate:modelValue": V[2] || (V[2] = (P) => k.value = P)
234
+ "onUpdate:modelValue": V[2] || (V[2] = ($) => k.value = $)
233
235
  }, {
234
236
  default: z(() => [
235
237
  i(E, {
236
238
  value: "phone",
237
239
  label: n(_)("team.memberForm.searchUser.phoneNumber")
238
240
  }, null, 8, ["label"]),
239
- k.value === "phone" ? (v(), M(x, {
241
+ k.value === "phone" ? (v(), M(F, {
240
242
  key: 0,
241
243
  modelValue: y.value,
242
- "onUpdate:modelValue": V[0] || (V[0] = (P) => y.value = P),
244
+ "onUpdate:modelValue": V[0] || (V[0] = ($) => y.value = $),
243
245
  "extra-country-codes": n(A).enabledCountries.value,
244
246
  class: "ml-8"
245
247
  }, null, 8, ["modelValue", "extra-country-codes"])) : Q("", !0),
@@ -250,7 +252,7 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
250
252
  k.value === "email" ? (v(), M(a, {
251
253
  key: 1,
252
254
  modelValue: m.value,
253
- "onUpdate:modelValue": V[1] || (V[1] = (P) => m.value = P),
255
+ "onUpdate:modelValue": V[1] || (V[1] = ($) => m.value = $),
254
256
  placeholder: n(_)("team.memberForm.searchUser.emailPlaceholder"),
255
257
  class: "ml-8"
256
258
  }, null, 8, ["modelValue", "placeholder"])) : Q("", !0)
@@ -266,11 +268,11 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
266
268
  b.value ? (v(), K("div", {
267
269
  key: 1,
268
270
  class: "profile-menu--profile cursor-pointer hover:bg-fm-color-opacity-sm",
269
- onClick: V[3] || (V[3] = (P) => te(b.value))
271
+ onClick: V[3] || (V[3] = ($) => te(b.value))
270
272
  }, [
271
273
  r("div", gs, O(N.value), 1),
272
- r("div", xs, [
273
- r("p", Fs, O(($ = b.value) == null ? void 0 : $.displayName), 1),
274
+ r("div", Fs, [
275
+ r("p", xs, O((P = b.value) == null ? void 0 : P.displayName), 1),
274
276
  r("p", Vs, O((q = b.value) == null ? void 0 : q.email), 1),
275
277
  r("p", Ss, O((G = b.value) == null ? void 0 : G.phoneNumber), 1)
276
278
  ])
@@ -285,7 +287,7 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
285
287
  ]);
286
288
  };
287
289
  }
288
- }), ks = /* @__PURE__ */ ze(ws, [["__scopeId", "data-v-c2c7ed35"]]), $s = { class: "flex flex-col gap-40" }, Ps = { class: "flex items-center" }, Is = { class: "flex-1 flex flex-col" }, Ms = { class: "fm-typo-en-title-sm-600" }, Cs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ns = { class: "flex flex-row gap-16" }, Rs = { class: "flex flex-col gap-8" }, Bs = { class: "fm-typo-en-body-lg-400" }, Ds = { class: "p-16 fm-corner-radius-lg border border-fm-color-neutral-gray-200" }, ce = 4, Os = /* @__PURE__ */ se({
290
+ }), ks = /* @__PURE__ */ ze(ws, [["__scopeId", "data-v-c2c7ed35"]]), Ps = { class: "flex flex-col gap-40" }, $s = { class: "flex items-center" }, Is = { class: "flex-1 flex flex-col" }, Ms = { class: "fm-typo-en-title-sm-600" }, Cs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ns = { class: "flex flex-row gap-16" }, Rs = { class: "flex flex-col gap-8" }, Bs = { class: "fm-typo-en-body-lg-400" }, Ds = { class: "p-16 fm-corner-radius-lg border border-fm-color-neutral-gray-200" }, ce = 4, Os = /* @__PURE__ */ se({
289
291
  __name: "TeamMemberMasterUser",
290
292
  props: {
291
293
  modelValue: {
@@ -311,30 +313,30 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
311
313
  },
312
314
  emits: ["update:model-value"],
313
315
  setup(t, { emit: p }) {
314
- const e = t, _ = p, { t: u } = me(), { searchKey: A, filter: k } = Be(""), y = F(!0), m = F([]), b = I(() => {
316
+ const e = t, _ = p, { t: u } = me(), { searchKey: A, filter: k } = Be(""), y = x(!0), m = x([]), b = I(() => {
315
317
  const a = {};
316
- return e.roles.forEach((o) => {
317
- a[o.value] = o.label;
318
+ return e.roles.forEach((l) => {
319
+ a[l.value] = l.label;
318
320
  }), a;
319
321
  }), C = I(() => {
320
- var o;
322
+ var l;
321
323
  const a = {};
322
- return (o = e.modelValue) == null || o.roles.forEach((S) => {
324
+ return (l = e.modelValue) == null || l.roles.forEach((S) => {
323
325
  a[S.restaurantId] = S.roleId;
324
326
  }), a;
325
327
  }), N = I(() => e.restaurants.filter((a) => k([a.profile.name, a.profile.code, te(a._id)])).map((a) => ({
326
328
  label: `${a.profile.code ? a.profile.code + "-" : ""}${a.profile.name}`,
327
329
  value: a._id,
328
330
  slot: `checkbox-${a._id}-bottom`,
329
- disable: e.roles.filter((o) => !o.disabled).length === 0,
331
+ disable: e.roles.filter((l) => !l.disabled).length === 0,
330
332
  roleOptions: e.roles
331
333
  }))), R = I(() => {
332
- const a = e.roles.find((o) => !o.disabled);
334
+ const a = e.roles.find((l) => !l.disabled);
333
335
  return a ? a.value : null;
334
336
  });
335
337
  function te(a) {
336
- const o = C.value[a] ?? "";
337
- return b.value[o] || "";
338
+ const l = C.value[a] ?? "";
339
+ return b.value[l] || "";
338
340
  }
339
341
  function ae(a) {
340
342
  a ? e.modelValue || _("update:model-value", {
@@ -344,37 +346,37 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
344
346
  passcode: e.fallbackPasscode || ""
345
347
  }) : _("update:model-value", void 0);
346
348
  }
347
- function g(a, o) {
348
- if (!e.modelValue || a === "passcode" && e.modelValue.passcode === o)
349
+ function g(a, l) {
350
+ if (!e.modelValue || a === "passcode" && e.modelValue.passcode === l)
349
351
  return;
350
352
  const S = De(e.modelValue);
351
- S[a] = o, _("update:model-value", S);
353
+ S[a] = l, _("update:model-value", S);
352
354
  }
353
355
  function V(a) {
354
356
  g(
355
357
  "roles",
356
- a.map((o) => {
357
- var q, G, P;
358
- const S = (G = (q = N.value.find((W) => W.value === o)) == null ? void 0 : q.roleOptions.find((W) => !W.disabled)) == null ? void 0 : G.value, $ = (P = e.modelValue) == null ? void 0 : P.roles.find((W) => W.restaurantId === o);
358
+ a.map((l) => {
359
+ var q, G, $;
360
+ const S = (G = (q = N.value.find((W) => W.value === l)) == null ? void 0 : q.roleOptions.find((W) => !W.disabled)) == null ? void 0 : G.value, P = ($ = e.modelValue) == null ? void 0 : $.roles.find((W) => W.restaurantId === l);
359
361
  return {
360
- restaurantId: o,
361
- roleId: ($ == null ? void 0 : $.roleId) || S
362
+ restaurantId: l,
363
+ roleId: (P == null ? void 0 : P.roleId) || S
362
364
  };
363
365
  })
364
366
  );
365
367
  }
366
- function E(a, o) {
368
+ function E(a, l) {
367
369
  g("roles", [
368
370
  ...e.modelValue.roles.filter(
369
371
  (S) => S.restaurantId !== a
370
372
  ),
371
373
  {
372
374
  restaurantId: a,
373
- roleId: o
375
+ roleId: l
374
376
  }
375
377
  ]);
376
378
  }
377
- function x() {
379
+ function F() {
378
380
  y.value && (y.value = !1, m.value = [], g("passcode", ""));
379
381
  }
380
382
  return Ce(
@@ -386,10 +388,10 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
386
388
  a && a.length === ce ? (m.value = a.split(""), y.value = !0) : (m.value = [], y.value = !1);
387
389
  },
388
390
  { immediate: !0 }
389
- ), (a, o) => {
390
- const S = h("FmSwitch"), $ = h("FmTextField"), q = h("FmPinField"), G = h("FmFormGroup"), P = h("FmSearch"), W = h("FmSelect");
391
- return v(), K("div", $s, [
392
- r("div", Ps, [
391
+ ), (a, l) => {
392
+ const S = h("FmSwitch"), P = h("FmTextField"), q = h("FmPinField"), G = h("FmFormGroup"), $ = h("FmSearch"), W = h("FmSelect");
393
+ return v(), K("div", Ps, [
394
+ r("div", $s, [
393
395
  r("div", Is, [
394
396
  r("div", Ms, O(n(u)("team.memberForm.masterUser.title")), 1),
395
397
  r("div", Cs, O(n(u)("team.memberForm.masterUser.sublabel")), 1)
@@ -404,24 +406,24 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
404
406
  ]),
405
407
  t.modelValue ? (v(), K(re, { key: 0 }, [
406
408
  r("div", Ns, [
407
- i($, {
409
+ i(P, {
408
410
  "model-value": t.modelValue.code,
409
411
  label: n(u)("team.memberForm.masterUser.code"),
410
- "onUpdate:modelValue": o[0] || (o[0] = (f) => g("code", f))
412
+ "onUpdate:modelValue": l[0] || (l[0] = (f) => g("code", f))
411
413
  }, null, 8, ["model-value", "label"]),
412
- i($, {
414
+ i(P, {
413
415
  "model-value": t.modelValue.name,
414
416
  class: "w-full",
415
417
  label: n(u)("team.memberForm.masterUser.name"),
416
418
  rules: [(f) => !!f || n(u)("team.memberForm.masterUser.nameEmptyError")],
417
- "onUpdate:modelValue": o[1] || (o[1] = (f) => g("name", f))
419
+ "onUpdate:modelValue": l[1] || (l[1] = (f) => g("name", f))
418
420
  }, null, 8, ["model-value", "label", "rules"])
419
421
  ]),
420
422
  r("div", Rs, [
421
423
  r("div", Bs, O(n(u)("team.memberForm.masterUser.passcode")), 1),
422
424
  i(G, {
423
425
  modelValue: m.value,
424
- "onUpdate:modelValue": o[4] || (o[4] = (f) => m.value = f),
426
+ "onUpdate:modelValue": l[4] || (l[4] = (f) => m.value = f),
425
427
  rules: [
426
428
  (f) => (f == null ? void 0 : f.filter((c) => !!c).length) !== ce ? n(u)("team.memberForm.masterUser.passcodeRequired") : !0
427
429
  ]
@@ -430,20 +432,20 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
430
432
  (v(), M(q, {
431
433
  key: `pin-field-${y.value}`,
432
434
  modelValue: m.value,
433
- "onUpdate:modelValue": o[2] || (o[2] = (f) => m.value = f),
435
+ "onUpdate:modelValue": l[2] || (l[2] = (f) => m.value = f),
434
436
  length: ce,
435
437
  masked: y.value,
436
- onComplete: o[3] || (o[3] = (f) => g("passcode", f)),
437
- onFocus: x
438
+ onComplete: l[3] || (l[3] = (f) => g("passcode", f)),
439
+ onFocus: F
438
440
  }, null, 8, ["modelValue", "masked"]))
439
441
  ]),
440
442
  _: 1
441
443
  }, 8, ["modelValue", "rules"])
442
444
  ]),
443
445
  r("div", Ds, [
444
- i(P, {
446
+ i($, {
445
447
  modelValue: n(A),
446
- "onUpdate:modelValue": o[5] || (o[5] = (f) => fe(A) ? A.value = f : null),
448
+ "onUpdate:modelValue": l[5] || (l[5] = (f) => fe(A) ? A.value = f : null),
447
449
  placeholder: n(u)("team.memberForm.posRole.placeholder"),
448
450
  class: "mb-16"
449
451
  }, null, 8, ["modelValue", "placeholder"]),
@@ -487,13 +489,13 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
487
489
  }
488
490
  },
489
491
  setup(t, { expose: p }) {
490
- var P, W, f;
491
- const e = t, { t: _ } = me(), u = F(), A = Oe(), k = I(
492
+ var $, W, f;
493
+ const e = t, { t: _ } = me(), u = x(), A = Oe(), k = I(
492
494
  () => A.permissionSets.value.map((c) => ({
493
495
  label: c.name,
494
496
  value: c.id
495
497
  }))
496
- ), y = F(((P = e.initialValue) == null ? void 0 : P.permissionSetIds) || []), m = F((W = e.initialValue) == null ? void 0 : W.posUser), b = F(
498
+ ), y = x((($ = e.initialValue) == null ? void 0 : $.permissionSetIds) || []), m = x((W = e.initialValue) == null ? void 0 : W.posUser), b = x(
497
499
  ((f = e.initialValue) == null ? void 0 : f.permissions) || []
498
500
  ), { restaurants: C } = ie(), N = Ae().roles, R = I(() => we(b.value)), te = I(() => {
499
501
  const c = R.value;
@@ -512,40 +514,40 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
512
514
  m.value = S(m.value, c);
513
515
  }
514
516
  function V() {
515
- const c = ve(x.value).map(
517
+ const c = ve(F.value).map(
516
518
  ({ setNames: B, ...j }) => j
517
519
  );
518
- return Qe(c, b.value);
520
+ return We(c, b.value);
519
521
  }
520
522
  function E() {
521
- var c, d, B, j, D, X, ee, le, H, L;
523
+ var c, d, B, j, D, X, ee, oe, H, L;
522
524
  return {
523
525
  email: ((c = u.value) == null ? void 0 : c.email) ?? void 0,
524
526
  phoneNumber: ((d = u.value) == null ? void 0 : d.phoneNumber) ?? void 0,
525
527
  customPermissions: V(),
526
528
  // Deprecated: keep for backward compatibility, will be removed in the future
527
- permissions: b.value.map((oe) => ({
528
- ...oe,
529
- subject: Ke(oe.subject)
529
+ permissions: b.value.map((le) => ({
530
+ ...le,
531
+ subject: Ye(le.subject)
530
532
  })),
531
533
  permissionSetIds: y.value,
532
534
  name: ((B = u.value) == null ? void 0 : B.displayName) || ((j = e.initialValue) == null ? void 0 : j.name) || "",
533
535
  posUser: m.value ? {
534
536
  ...m.value,
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) || "",
537
+ 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) || ((oe = u.value) == null ? void 0 : oe.displayName) || "",
536
538
  code: m.value.code || ((L = (H = e.initialValue) == null ? void 0 : H.posUser) == null ? void 0 : L.code) || "",
537
539
  passcode: m.value.passcode,
538
- roles: m.value.roles.filter((oe) => !!oe.roleId)
540
+ roles: m.value.roles.filter((le) => !!le.roleId)
539
541
  } : void 0
540
542
  };
541
543
  }
542
- const x = I(
544
+ const F = I(
543
545
  () => A.permissionSets.value.filter(
544
546
  (c) => y.value.includes(c.id)
545
547
  )
546
- ), a = F();
547
- function o() {
548
- b.value = ve(x.value).map(
548
+ ), a = x();
549
+ function l() {
550
+ b.value = ve(F.value).map(
549
551
  ({ setNames: c, ...d }) => d
550
552
  );
551
553
  }
@@ -556,10 +558,10 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
556
558
  const j = De(c);
557
559
  return j.roles = j.roles.reduce((D, X) => (B.includes(X.roleId) && D.push(X), D), []), j;
558
560
  }
559
- async function $() {
560
- await Pe(), a.value && a.value.$el.scrollIntoView({ behavior: "smooth", block: "start" });
561
+ async function P() {
562
+ await $e(), a.value && a.value.$el.scrollIntoView({ behavior: "smooth", block: "start" });
561
563
  }
562
- const q = F();
564
+ const q = x();
563
565
  async function G() {
564
566
  return (await q.value.validateInputsWithoutSubmit()).length ? null : E();
565
567
  }
@@ -574,7 +576,7 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
574
576
  class: "mx-4"
575
577
  }, {
576
578
  default: z(() => {
577
- var D, X, ee, le, H;
579
+ var D, X, ee, oe, H;
578
580
  return [
579
581
  r("div", As, [
580
582
  r("div", Ls, [
@@ -591,7 +593,7 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
591
593
  modelValue: y.value,
592
594
  "onUpdate:modelValue": [
593
595
  d[1] || (d[1] = (L) => y.value = L),
594
- o
596
+ l
595
597
  ],
596
598
  multiselect: "",
597
599
  searchable: "",
@@ -604,7 +606,7 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
604
606
  key: 0,
605
607
  modelValue: b.value,
606
608
  "onUpdate:modelValue": d[2] || (d[2] = (L) => b.value = L),
607
- "inherit-permissions": x.value,
609
+ "inherit-permissions": F.value,
608
610
  onPermissionChanged: g
609
611
  }, null, 8, ["modelValue", "inherit-permissions"])),
610
612
  i(Os, {
@@ -613,10 +615,10 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
613
615
  modelValue: m.value,
614
616
  "onUpdate:modelValue": [
615
617
  d[3] || (d[3] = (L) => m.value = L),
616
- $
618
+ P
617
619
  ],
618
620
  "fallback-name": ((X = t.initialValue) == null ? void 0 : X.name) || ((ee = u.value) == null ? void 0 : ee.displayName) || "",
619
- "fallback-passcode": (H = (le = t.initialValue) == null ? void 0 : le.posUser) == null ? void 0 : H.passcode,
621
+ "fallback-passcode": (H = (oe = t.initialValue) == null ? void 0 : oe.posUser) == null ? void 0 : H.passcode,
620
622
  roles: te.value,
621
623
  restaurants: n(C)
622
624
  }, null, 8, ["modelValue", "fallback-name", "fallback-passcode", "roles", "restaurants"])
@@ -646,16 +648,16 @@ const os = { class: "w-full flex flex-col gap-16" }, ns = { class: "flex items-c
646
648
  var J = /* @__PURE__ */ function(t) {
647
649
  return t[t.ADD = 0] = "ADD", t[t.UPDATE = 1] = "UPDATE", t[t.CLOSED = 2] = "CLOSED", t;
648
650
  }(J || {});
649
- const it = /* @__PURE__ */ se({
651
+ const ut = /* @__PURE__ */ se({
650
652
  __name: "TeamMemberList",
651
653
  setup(t, {
652
654
  expose: p
653
655
  }) {
654
656
  const {
655
657
  t: e
656
- } = me(), _ = ie(), u = Ae(), A = Re(), k = Je(A), y = Oe(), m = Xe(), b = es(), C = F(!0), N = ({
658
+ } = me(), _ = ie(), u = Ae(), A = Re(), k = Ge(A), y = Oe(), m = Je(), b = es(), C = x(!0), N = ({
657
659
  member: s,
658
- className: l = ""
660
+ className: o = ""
659
661
  }) => {
660
662
  const w = {
661
663
  label: e("common.update"),
@@ -665,8 +667,8 @@ const it = /* @__PURE__ */ se({
665
667
  onClick: () => V(ne.Remove, s),
666
668
  itemClass: "text-fm-color-typo-error"
667
669
  }, Z = s.doc.isOwner ? [w] : [w, Y];
668
- return i(ls, {
669
- class: l,
670
+ return i(os, {
671
+ class: o,
670
672
  items: Z
671
673
  }, null);
672
674
  }, R = (s) => s.doc.isOwner ? e("team.labels.businessOwner") : s.restaurants.join(", "), te = [{
@@ -682,15 +684,15 @@ const it = /* @__PURE__ */ se({
682
684
  header: () => e("team.table.columns.restaurant"),
683
685
  enableSorting: !1,
684
686
  cell(s) {
685
- const l = s.row.original;
686
- return R(l);
687
+ const o = s.row.original;
688
+ return R(o);
687
689
  }
688
690
  }, {
689
691
  accessorKey: "assignedRoles",
690
692
  header: () => e("team.table.columns.assignedRoles"),
691
693
  enableSorting: !1,
692
694
  cell(s) {
693
- const l = s.row.original, w = m.getPermissionAssignmentByUserId(l.id), Y = (w == null ? void 0 : w.permissionSetIds) || l.doc.permissionSetIds || [];
695
+ const o = s.row.original, w = m.getPermissionAssignmentByUserId(o.id), Y = (w == null ? void 0 : w.permissionSetIds) || o.doc.permissionSetIds || [];
694
696
  return y.permissionSets.value.filter((T) => Y.includes(T.id)).map((T) => T.name).join(", ");
695
697
  }
696
698
  }, {
@@ -698,8 +700,8 @@ const it = /* @__PURE__ */ se({
698
700
  header: () => e("team.table.columns.permission"),
699
701
  enableSorting: !1,
700
702
  cell(s) {
701
- const l = s.row.original;
702
- return ae(l);
703
+ const o = s.row.original;
704
+ return ae(o);
703
705
  },
704
706
  meta: {
705
707
  width: "200px"
@@ -711,9 +713,9 @@ const it = /* @__PURE__ */ se({
711
713
  headerContentClass: "-mx-16"
712
714
  },
713
715
  cell(s) {
714
- const l = s.row.original;
716
+ const o = s.row.original;
715
717
  return N({
716
- member: l,
718
+ member: o,
717
719
  className: "flex justify-end w-full"
718
720
  });
719
721
  },
@@ -722,7 +724,7 @@ const it = /* @__PURE__ */ se({
722
724
  function ae(s) {
723
725
  if (s.doc.isOwner)
724
726
  return e("team.labels.businessOwner");
725
- const l = i(Ve.FmTooltip, {
727
+ const o = i(Ve.FmTooltip, {
726
728
  variant: "plain",
727
729
  placement: "top"
728
730
  }, {
@@ -736,11 +738,11 @@ const it = /* @__PURE__ */ se({
736
738
  class: "flex flex-row items-center gap-8"
737
739
  }, [i("span", null, [e("team.labels.allowed", {
738
740
  count: s.permissionLabels.length
739
- })]), s.permissionLabels.length > 0 && l]);
741
+ })]), s.permissionLabels.length > 0 && o]);
740
742
  }
741
743
  function g(s) {
742
744
  var U, ye, _e, he;
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(({
745
+ const o = m.getPermissionAssignmentByUserId(s.id), w = (o == null ? void 0 : o.customPermissions) || s.permissions || [], Y = (o == null ? void 0 : o.permissionSetIds) || [], Z = y.permissionSets.value.filter((ge) => Y.includes(ge.id)), T = Qe(ve(Z).map(({
744
746
  setNames: ge,
745
747
  setId: Js,
746
748
  ...Ee
@@ -761,28 +763,28 @@ const it = /* @__PURE__ */ se({
761
763
  } : void 0
762
764
  };
763
765
  }
764
- const V = (s, l) => {
766
+ const V = (s, o) => {
765
767
  if (s == ne.Update) {
766
- const w = g(l);
767
- $.value = w, x.value = J.UPDATE;
768
+ const w = g(o);
769
+ P.value = w, F.value = J.UPDATE;
768
770
  }
769
- s == ne.Remove && W(l);
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();
771
+ s == ne.Remove && W(o);
772
+ }, E = Te(), F = x(J.CLOSED), a = I(() => F.value !== J.CLOSED), l = I(() => F.value === J.ADD ? e("common.add") : e("common.update")), S = I(() => F.value === J.ADD ? e("team.actions.addMember") : e("team.actions.updateMember")), P = x();
771
773
  function q(s) {
772
- s || (x.value = J.CLOSED);
774
+ s || (F.value = J.CLOSED);
773
775
  }
774
776
  function G() {
775
- x.value = J.CLOSED;
777
+ F.value = J.CLOSED;
776
778
  }
777
779
  const {
778
- breakpoints: P
780
+ breakpoints: $
779
781
  } = Ne(), W = (s) => {
780
782
  E.open({
781
783
  title: e("team.actions.removeMember"),
782
784
  message: e("team.removeMember.confirmationMessage", {
783
785
  memberName: s.name
784
786
  }),
785
- minWidth: P.value.lg ? 588 : 0,
787
+ minWidth: $.value.lg ? 588 : 0,
786
788
  primaryActions: {
787
789
  text: "Remove",
788
790
  close: !1,
@@ -802,8 +804,8 @@ const it = /* @__PURE__ */ se({
802
804
  }), E.close();
803
805
  });
804
806
  }, f = () => {
805
- $.value = null, x.value = J.ADD;
806
- }, c = I(() => b.members), d = F(), B = F(), j = I(() => Object.values(qe).map((s) => ({
807
+ P.value = null, F.value = J.ADD;
808
+ }, c = I(() => b.members), d = x(), B = x(), j = I(() => Object.values(Xe).map((s) => ({
807
809
  label: s.label,
808
810
  value: s.subject
809
811
  }))), {
@@ -811,10 +813,10 @@ const it = /* @__PURE__ */ se({
811
813
  filter: X
812
814
  } = Be(""), ee = I(() => c.value.filter((s) => {
813
815
  var Z;
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));
815
- return l && Y && X([s.name, s.phoneNumber, R(s)]);
816
+ const o = !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));
817
+ return o && Y && X([s.name, s.phoneNumber, R(s)]);
816
818
  }));
817
- async function le() {
819
+ async function oe() {
818
820
  await u.readRoles();
819
821
  }
820
822
  async function H() {
@@ -825,21 +827,21 @@ const it = /* @__PURE__ */ se({
825
827
  C.value = !1;
826
828
  }
827
829
  }
828
- const L = F();
829
- async function oe() {
830
+ const L = x();
831
+ async function le() {
830
832
  if (!L.value) return;
831
833
  const s = await L.value.validate();
832
834
  if (!s) return;
833
- const l = x.value === J.ADD;
835
+ const o = F.value === J.ADD;
834
836
  await k.minor(async () => {
835
- await (l ? ue.createTeamMember(s) : ue.updateTeamMember($.value.id, s)), G(), await be(), await H();
837
+ await (o ? ue.createTeamMember(s) : ue.updateTeamMember(P.value.id, s)), G(), await be(), await H();
836
838
  }, {
837
- successMessage: l ? e("team.addMember.successMessage", {
839
+ successMessage: o ? e("team.addMember.successMessage", {
838
840
  memberName: s.name
839
841
  }) : e("team.updateMember.successMessage", {
840
842
  memberName: s.name
841
843
  })
842
- }), x.value = J.CLOSED;
844
+ }), F.value = J.CLOSED;
843
845
  }
844
846
  async function Le() {
845
847
  await y.readPermissionSets();
@@ -849,23 +851,23 @@ const it = /* @__PURE__ */ se({
849
851
  }
850
852
  return Ce(_.currentBusiness, async () => {
851
853
  var s;
852
- (s = _.currentBusiness.value) != null && s._id && (await Le(), await be(), H(), le());
854
+ (s = _.currentBusiness.value) != null && s._id && (await Le(), await be(), H(), oe());
853
855
  }, {
854
856
  immediate: !0
855
857
  }), p({
856
858
  create: f
857
- }), (s, l) => {
859
+ }), (s, o) => {
858
860
  const w = h("FmSearch"), Y = h("FmTable"), Z = h("FmButton"), T = h("FmSideSheet");
859
- return v(), K(re, null, [r("div", js, [r("div", Ts, [r("div", zs, [r("div", Ks, [i(n(Fe), {
861
+ return v(), K(re, null, [r("div", js, [r("div", Ts, [r("div", zs, [r("div", Ks, [i(n(xe), {
860
862
  modelValue: d.value,
861
- "onUpdate:modelValue": l[0] || (l[0] = (U) => d.value = U),
863
+ "onUpdate:modelValue": o[0] || (o[0] = (U) => d.value = U),
862
864
  "managable-only": !1,
863
865
  multiple: "",
864
866
  variant: "dark",
865
867
  class: "!w-auto"
866
868
  }, null, 8, ["modelValue"]), i(Se, {
867
869
  modelValue: B.value,
868
- "onUpdate:modelValue": l[1] || (l[1] = (U) => B.value = U),
870
+ "onUpdate:modelValue": o[1] || (o[1] = (U) => B.value = U),
869
871
  multiple: "",
870
872
  variant: "dark",
871
873
  items: j.value,
@@ -873,36 +875,36 @@ const it = /* @__PURE__ */ se({
873
875
  placeholder: n(e)("team.filter.permission_placeholder")
874
876
  }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), i(w, {
875
877
  modelValue: n(D),
876
- "onUpdate:modelValue": l[2] || (l[2] = (U) => fe(D) ? D.value = U : null),
878
+ "onUpdate:modelValue": o[2] || (o[2] = (U) => fe(D) ? D.value = U : null),
877
879
  class: "w-[320px] xs:w-full xs:mt-8",
878
880
  autofocus: "",
879
881
  placeholder: n(e)("team.search.placeholder")
880
882
  }, null, 8, ["modelValue", "placeholder"])]), r("div", qs, [i(w, {
881
883
  modelValue: n(D),
882
- "onUpdate:modelValue": l[3] || (l[3] = (U) => fe(D) ? D.value = U : null),
884
+ "onUpdate:modelValue": o[3] || (o[3] = (U) => fe(D) ? D.value = U : null),
883
885
  class: "w-[320px] xs:w-full xs:mt-8",
884
886
  autofocus: "",
885
887
  placeholder: n(e)("team.search.placeholder")
886
- }, null, 8, ["modelValue", "placeholder"]), r("div", Gs, [i(n(Fe), {
888
+ }, null, 8, ["modelValue", "placeholder"]), r("div", Gs, [i(n(xe), {
887
889
  modelValue: d.value,
888
- "onUpdate:modelValue": l[4] || (l[4] = (U) => d.value = U),
890
+ "onUpdate:modelValue": o[4] || (o[4] = (U) => d.value = U),
889
891
  "managable-only": !1,
890
892
  multiple: "",
891
893
  variant: "dark",
892
894
  class: "!w-auto"
893
895
  }, null, 8, ["modelValue"]), i(Se, {
894
896
  modelValue: B.value,
895
- "onUpdate:modelValue": l[5] || (l[5] = (U) => B.value = U),
897
+ "onUpdate:modelValue": o[5] || (o[5] = (U) => B.value = U),
896
898
  multiple: "",
897
899
  variant: "dark",
898
900
  items: j.value,
899
901
  "selected-prefix": n(e)("team.filter.selected_permission_prefix"),
900
902
  placeholder: n(e)("team.filter.permission_placeholder")
901
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), c.value.length === 0 && !C.value ? (v(), M(n(We), {
903
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), c.value.length === 0 && !C.value ? (v(), M(n(qe), {
902
904
  key: 0,
903
905
  title: n(e)("team.emptyState.title"),
904
906
  subtitle: n(e)("team.emptyState.description")
905
- }, null, 8, ["title", "subtitle"])) : (v(), M(Ge, {
907
+ }, null, 8, ["title", "subtitle"])) : (v(), M(Ke, {
906
908
  key: 1
907
909
  }, {
908
910
  default: z(() => [i(Y, {
@@ -912,7 +914,7 @@ const it = /* @__PURE__ */ se({
912
914
  loading: C.value,
913
915
  "pin-header-row": "",
914
916
  "hide-footer": "",
915
- onRowClick: l[6] || (l[6] = (U) => V(n(ne).Update, U.original))
917
+ onRowClick: o[6] || (o[6] = (U) => V(n(ne).Update, U.original))
916
918
  }, null, 8, ["row-data", "page-size", "loading"])]),
917
919
  _: 1
918
920
  }))])]), i(T, {
@@ -920,13 +922,13 @@ const it = /* @__PURE__ */ se({
920
922
  "model-value": a.value,
921
923
  "max-width": 560,
922
924
  "dismiss-away": "",
923
- "onUpdate:modelValue": l[7] || (l[7] = (U) => q(U))
925
+ "onUpdate:modelValue": o[7] || (o[7] = (U) => q(U))
924
926
  }, {
925
927
  "side-sheet-footer": z(() => [r("div", Ws, [i(Z, {
926
- label: o.value,
928
+ label: l.value,
927
929
  size: "md",
928
930
  variant: "primary",
929
- onClick: $e(oe, ["prevent"])
931
+ onClick: Pe(le, ["prevent"])
930
932
  }, null, 8, ["label"]), i(Z, {
931
933
  label: n(e)("common.cancel"),
932
934
  size: "md",
@@ -936,7 +938,7 @@ const it = /* @__PURE__ */ se({
936
938
  default: z(() => [i(Es, {
937
939
  ref_key: "memberForm",
938
940
  ref: L,
939
- initialValue: $.value,
941
+ initialValue: P.value,
940
942
  class: "gap-8"
941
943
  }, null, 8, ["initialValue"])]),
942
944
  _: 1
@@ -945,5 +947,5 @@ const it = /* @__PURE__ */ se({
945
947
  }
946
948
  });
947
949
  export {
948
- it as default
950
+ ut as default
949
951
  };