@feedmepos/mf-hrm-portal 2.2.5-dev → 2.2.5-dev.4

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 (160) hide show
  1. package/dist/{ApprovalCodeList-DgcWZ3SZ.js → ApprovalCodeList-D0B_X3Sf.js} +4 -4
  2. package/dist/{AuditLogList-vWKMMGvd.js → AuditLogList-D9anf4YQ.js} +18 -17
  3. package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-DuhXogXK.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-4oENMRO3.js} +2 -2
  4. package/dist/EmployeeList-DREDu3Ou.js +788 -0
  5. package/dist/{FormItem.vue_vue_type_script_setup_true_lang-DPT2FoIc.js → FormItem.vue_vue_type_script_setup_true_lang-CUnlKsxk.js} +1 -1
  6. package/dist/{GrantUserList-BAW0C1bA.js → GrantUserList-CLDshEN9.js} +5 -5
  7. package/dist/{Main-Wr6cTqfM.js → Main-DtMaG42L.js} +2 -2
  8. package/dist/{Main-NzpdRNB3.js → Main-QhQxU593.js} +5 -5
  9. package/dist/{Main-B7Nn8CLQ.js → Main-lqlb8tPw.js} +9 -9
  10. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js +243 -0
  11. package/dist/{PermissionSetList-D6AFOleD.js → PermissionSetList-BK8yBpJJ.js} +22 -21
  12. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Bzq2_BMn.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-uSdvH81B.js} +924 -923
  13. package/dist/{RoleList-BuqpmXn_.js → RoleList-D6AX6BqB.js} +7 -7
  14. package/dist/ScheduleGeneralPage-DAECTCDu.js +242 -0
  15. package/dist/SchedulePage-CdFR7JuO.js +10751 -0
  16. package/dist/SchedulePositionPage-DTtKg0sx.js +220 -0
  17. package/dist/ScheduleSelect.vue_vue_type_script_setup_true_lang-BiuUrr50.js +199 -0
  18. package/dist/SelectFilter-CG13h83-.js +264 -0
  19. package/dist/TeamMemberList-BM5JoR6J.js +1155 -0
  20. package/dist/{TimesheetList-B5FyVyCz.js → TimesheetList-Ch_f_PD5.js} +54 -53
  21. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-C99Jr6Ax.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-CxqxqwyD.js} +2 -2
  22. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  23. package/dist/{app-8samJY5z.js → app-tDHL6k4G.js} +3092 -2499
  24. package/dist/app.js +1 -1
  25. package/dist/{dayjs.min-Ba4X_9nY.js → dayjs.min-B_XWc0Hu.js} +1 -1
  26. package/dist/employee-Bs_2vqBY.js +139 -0
  27. package/dist/index-Cz2b95YF.js +70 -0
  28. package/dist/{iteration-Dhdew1jW.js → index-jxRluZiW.js} +698 -726
  29. package/dist/iteration-CcXrOMQe.js +30 -0
  30. package/dist/{lodash-CJ3mHku0.js → lodash-D5vM3paU.js} +1 -1
  31. package/dist/{role-BViYS7RK.js → role-7ccipEEe.js} +4 -3
  32. package/dist/{rule-Dxt1ZSQS.js → rule-7faruCdz.js} +282 -277
  33. package/dist/src/api/schedule/index.d.ts +44 -0
  34. package/dist/src/components/form/OutletRoleAssignment.vue.d.ts +16 -0
  35. package/dist/src/components/layout/AppSidebar.vue.d.ts +2 -0
  36. package/dist/src/components/layout/PortalShell.vue.d.ts +12 -0
  37. package/dist/src/components/layout/withShell.d.ts +14 -0
  38. package/dist/src/helpers/outlet-role-assignment.d.ts +40 -0
  39. package/dist/src/helpers/rule.d.ts +15 -0
  40. package/dist/src/router/shared.d.ts +4 -1
  41. package/dist/src/types/schedule.d.ts +232 -0
  42. package/dist/src/views/scheduling/ScheduleGeneralPage.vue.d.ts +4 -0
  43. package/dist/src/views/scheduling/SchedulePage.vue.d.ts +4 -0
  44. package/dist/src/views/scheduling/SchedulePositionPage.vue.d.ts +4 -0
  45. package/dist/src/views/scheduling/components/ScheduleAddEmployeeIdentitySection.vue.d.ts +6 -0
  46. package/dist/src/views/scheduling/components/ScheduleAddEmployeeModal.vue.d.ts +6 -0
  47. package/dist/src/views/scheduling/components/ScheduleAddEmployeeModeStep.vue.d.ts +6 -0
  48. package/dist/src/views/scheduling/components/ScheduleAddEmployeePosAccessSection.vue.d.ts +6 -0
  49. package/dist/src/views/scheduling/components/ScheduleAddEmployeePositionsSection.vue.d.ts +6 -0
  50. package/dist/src/views/scheduling/components/ScheduleAddEmployeeSchedulingSection.vue.d.ts +6 -0
  51. package/dist/src/views/scheduling/components/ScheduleAddPickPopover.vue.d.ts +6 -0
  52. package/dist/src/views/scheduling/components/ScheduleAllShiftsRow.vue.d.ts +22 -0
  53. package/dist/src/views/scheduling/components/ScheduleAreaRows.vue.d.ts +34 -0
  54. package/dist/src/views/scheduling/components/ScheduleAssignEmployeePopover.vue.d.ts +6 -0
  55. package/dist/src/views/scheduling/components/ScheduleAutoScheduleModal.vue.d.ts +6 -0
  56. package/dist/src/views/scheduling/components/ScheduleChangeEmployeeModal.vue.d.ts +8 -0
  57. package/dist/src/views/scheduling/components/ScheduleConfirmModal.vue.d.ts +24 -0
  58. package/dist/src/views/scheduling/components/ScheduleCostRail.vue.d.ts +8 -0
  59. package/dist/src/views/scheduling/components/ScheduleDateRangePopover.vue.d.ts +6 -0
  60. package/dist/src/views/scheduling/components/ScheduleDayNotePopover.vue.d.ts +6 -0
  61. package/dist/src/views/scheduling/components/ScheduleDayTimeline.vue.d.ts +12 -0
  62. package/dist/src/views/scheduling/components/ScheduleDemandRow.vue.d.ts +23 -0
  63. package/dist/src/views/scheduling/components/ScheduleDemandSheet.vue.d.ts +10 -0
  64. package/dist/src/views/scheduling/components/ScheduleDotsIcon.vue.d.ts +2 -0
  65. package/dist/src/views/scheduling/components/ScheduleEmployeeDetailPanel.vue.d.ts +12 -0
  66. package/dist/src/views/scheduling/components/ScheduleEmployeeIdentity.vue.d.ts +17 -0
  67. package/dist/src/views/scheduling/components/ScheduleFilterBar.vue.d.ts +18 -0
  68. package/dist/src/views/scheduling/components/ScheduleGapPopover.vue.d.ts +6 -0
  69. package/dist/src/views/scheduling/components/ScheduleGridHeader.vue.d.ts +18 -0
  70. package/dist/src/views/scheduling/components/ScheduleLeaveEditModal.vue.d.ts +6 -0
  71. package/dist/src/views/scheduling/components/ScheduleLegendBar.vue.d.ts +6 -0
  72. package/dist/src/views/scheduling/components/ScheduleOnboardingWelcome.vue.d.ts +12 -0
  73. package/dist/src/views/scheduling/components/ScheduleOnboardingWizard.vue.d.ts +6 -0
  74. package/dist/src/views/scheduling/components/ScheduleOpenShiftCardMenu.vue.d.ts +14 -0
  75. package/dist/src/views/scheduling/components/SchedulePdfPreview.vue.d.ts +6 -0
  76. package/dist/src/views/scheduling/components/SchedulePublishModal.vue.d.ts +8 -0
  77. package/dist/src/views/scheduling/components/ScheduleReviewBar.vue.d.ts +12 -0
  78. package/dist/src/views/scheduling/components/ScheduleSelect.vue.d.ts +24 -0
  79. package/dist/src/views/scheduling/components/ScheduleSelectExistingEmployeeModal.vue.d.ts +6 -0
  80. package/dist/src/views/scheduling/components/ScheduleShiftCardMenu.vue.d.ts +12 -0
  81. package/dist/src/views/scheduling/components/ScheduleShiftCell.vue.d.ts +31 -0
  82. package/dist/src/views/scheduling/components/ScheduleShiftHeadcountEditor.vue.d.ts +6 -0
  83. package/dist/src/views/scheduling/components/ScheduleShiftImpact.vue.d.ts +6 -0
  84. package/dist/src/views/scheduling/components/ScheduleShiftMoreOptions.vue.d.ts +6 -0
  85. package/dist/src/views/scheduling/components/ScheduleShiftPopover.vue.d.ts +14 -0
  86. package/dist/src/views/scheduling/components/ScheduleShiftRepeatDaysRow.vue.d.ts +8 -0
  87. package/dist/src/views/scheduling/components/ScheduleShiftSegmentsEditor.vue.d.ts +8 -0
  88. package/dist/src/views/scheduling/components/ScheduleShiftWhoPicker.vue.d.ts +25 -0
  89. package/dist/src/views/scheduling/components/ScheduleStackPopover.vue.d.ts +14 -0
  90. package/dist/src/views/scheduling/components/ScheduleStaffRail.vue.d.ts +16 -0
  91. package/dist/src/views/scheduling/components/ScheduleStaffRows.vue.d.ts +54 -0
  92. package/dist/src/views/scheduling/components/ScheduleStatsRow.vue.d.ts +12 -0
  93. package/dist/src/views/scheduling/components/ScheduleSwapShiftsModal.vue.d.ts +8 -0
  94. package/dist/src/views/scheduling/components/ScheduleTimePickerPopover.vue.d.ts +6 -0
  95. package/dist/src/views/scheduling/components/ScheduleTopbar.vue.d.ts +22 -0
  96. package/dist/src/views/scheduling/composables/schedule-add-employee-form.d.ts +67 -0
  97. package/dist/src/views/scheduling/composables/schedule-board-helpers.d.ts +38 -0
  98. package/dist/src/views/scheduling/composables/schedule-day-meta.d.ts +29 -0
  99. package/dist/src/views/scheduling/composables/schedule-employee-profile.d.ts +7 -0
  100. package/dist/src/views/scheduling/composables/schedule-shift-time.d.ts +14 -0
  101. package/dist/src/views/scheduling/composables/schedule-week-cache.d.ts +10 -0
  102. package/dist/src/views/scheduling/composables/useScheduleAddEmployee.d.ts +86 -0
  103. package/dist/src/views/scheduling/composables/useScheduleAddPick.d.ts +66 -0
  104. package/dist/src/views/scheduling/composables/useScheduleAllShiftsRow.d.ts +77 -0
  105. package/dist/src/views/scheduling/composables/useScheduleAreaBoard.d.ts +50 -0
  106. package/dist/src/views/scheduling/composables/useScheduleAreaDragDrop.d.ts +18 -0
  107. package/dist/src/views/scheduling/composables/useScheduleAssign.d.ts +113 -0
  108. package/dist/src/views/scheduling/composables/useScheduleAutoSchedule.d.ts +136 -0
  109. package/dist/src/views/scheduling/composables/useScheduleBoard.d.ts +415 -0
  110. package/dist/src/views/scheduling/composables/useScheduleCellState.d.ts +27 -0
  111. package/dist/src/views/scheduling/composables/useScheduleClashDetection.d.ts +18 -0
  112. package/dist/src/views/scheduling/composables/useScheduleCopyWeek.d.ts +17 -0
  113. package/dist/src/views/scheduling/composables/useScheduleCostRail.d.ts +43 -0
  114. package/dist/src/views/scheduling/composables/useScheduleDayNote.d.ts +48 -0
  115. package/dist/src/views/scheduling/composables/useScheduleDayTimeline.d.ts +82 -0
  116. package/dist/src/views/scheduling/composables/useScheduleDemand.d.ts +68 -0
  117. package/dist/src/views/scheduling/composables/useScheduleDemandRow.d.ts +45 -0
  118. package/dist/src/views/scheduling/composables/useScheduleDemandSheet.d.ts +139 -0
  119. package/dist/src/views/scheduling/composables/useScheduleDragDrop.d.ts +22 -0
  120. package/dist/src/views/scheduling/composables/useScheduleEmployeeIdentity.d.ts +32 -0
  121. package/dist/src/views/scheduling/composables/useScheduleEmployeeProfile.d.ts +16 -0
  122. package/dist/src/views/scheduling/composables/useScheduleExport.d.ts +26 -0
  123. package/dist/src/views/scheduling/composables/useScheduleFilterBar.d.ts +14 -0
  124. package/dist/src/views/scheduling/composables/useScheduleGapPopover.d.ts +80 -0
  125. package/dist/src/views/scheduling/composables/useScheduleLeave.d.ts +20 -0
  126. package/dist/src/views/scheduling/composables/useScheduleLegend.d.ts +15 -0
  127. package/dist/src/views/scheduling/composables/useScheduleLegendBar.d.ts +35 -0
  128. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +179 -0
  129. package/dist/src/views/scheduling/composables/useScheduleOpenShiftCard.d.ts +23 -0
  130. package/dist/src/views/scheduling/composables/useScheduleOutlet.d.ts +19 -0
  131. package/dist/src/views/scheduling/composables/useSchedulePositions.d.ts +32 -0
  132. package/dist/src/views/scheduling/composables/useSchedulePublish.d.ts +91 -0
  133. package/dist/src/views/scheduling/composables/useScheduleRangeCalendar.d.ts +18 -0
  134. package/dist/src/views/scheduling/composables/useScheduleRoster.d.ts +183 -0
  135. package/dist/src/views/scheduling/composables/useScheduleSettings.d.ts +54 -0
  136. package/dist/src/views/scheduling/composables/useScheduleSetupBanner.d.ts +18 -0
  137. package/dist/src/views/scheduling/composables/useScheduleShiftActions.d.ts +225 -0
  138. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +174 -0
  139. package/dist/src/views/scheduling/composables/useScheduleStaffRail.d.ts +20 -0
  140. package/dist/src/views/scheduling/composables/useScheduleStatsRow.d.ts +25 -0
  141. package/dist/src/views/scheduling/composables/useScheduleTimePicker.d.ts +44 -0
  142. package/dist/src/views/scheduling/composables/useScheduleTopbar.d.ts +10 -0
  143. package/dist/src/views/scheduling/data.d.ts +105 -0
  144. package/dist/src/views/scheduling/locales/index.d.ts +496 -0
  145. package/dist/src/views/scheduling/schedule-store.d.ts +116 -0
  146. package/dist/src/views/scheduling/types.d.ts +311 -0
  147. package/dist/src/views/team/components/PortalConditionForm.vue.d.ts +2 -2
  148. package/dist/src/views/team/condition-builders/ConditionBuilderForm.vue.d.ts +2 -2
  149. package/dist/src/views/team/member/TeamMemberMasterUser.vue.d.ts +12 -3
  150. package/dist/style.css +1 -1
  151. package/dist/tsconfig.app.tsbuildinfo +1 -1
  152. package/dist/{useReportPermissions-BiyAfGvZ.js → useReportPermissions-FieO4EAD.js} +3 -3
  153. package/dist/useScheduleOutlet-CmIG5dwQ.js +557 -0
  154. package/dist/useSchedulePositions-DPVAgdB2.js +103 -0
  155. package/package.json +1 -1
  156. package/dist/EmployeeList-Cu4RxVQX.js +0 -889
  157. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-BUI0Xsgc.js +0 -85
  158. package/dist/SelectFilter-ATOm0hdn.js +0 -269
  159. package/dist/TeamMemberList-M6HA9BWu.js +0 -1248
  160. package/dist/employee-BcFgm8Rt.js +0 -204
@@ -1,25 +1,26 @@
1
- import { s as W, c as Z, e as y } from "./iteration-Dhdew1jW.js";
2
- import { h as O, d as V, e as _, b as F, n as h, O as q, D as M } from "./app-8samJY5z.js";
3
- import { s as ee } from "./utils-BZkjJbju.js";
4
- import { g, b, q as x, u as te } from "./restaurant-BTpBmfBV.js";
1
+ import { e as y } from "./index-jxRluZiW.js";
2
+ import { e as O, b as W, c as _, v as F, n as h, O as q, D as M } from "./app-tDHL6k4G.js";
3
+ import { s as V, c as ee } from "./iteration-CcXrOMQe.js";
4
+ import { s as se } from "./utils-BZkjJbju.js";
5
+ import { g, b as v, q as x, u as te } from "./restaurant-BTpBmfBV.js";
5
6
  import { defineStore as z, storeToRefs as K } from "pinia";
6
7
  import { ref as S, computed as T } from "vue";
7
8
  import { useCoreStore as X } from "@feedmepos/mf-common";
8
9
  const E = "/permission-sets", N = {
9
10
  async read() {
10
- return g(await b().get(E));
11
+ return g(await v().get(E));
11
12
  },
12
13
  async create(e) {
13
- return g(await b().post(E, e));
14
+ return g(await v().post(E, e));
14
15
  },
15
- async update(e, t) {
16
- return g(await b().put(`${E}/${e}`, t));
16
+ async update(e, s) {
17
+ return g(await v().put(`${E}/${e}`, s));
17
18
  },
18
19
  async delete(e) {
19
- return g(await b().delete(`${E}/${e}`));
20
+ return g(await v().delete(`${E}/${e}`));
20
21
  }
21
- }, se = z("permissionSet", () => {
22
- const { currentBusiness: e } = X(), t = S([]), r = S(!1), n = S(null);
22
+ }, ne = z("permissionSet", () => {
23
+ const { currentBusiness: e } = X(), s = S([]), r = S(!1), n = S(null);
23
24
  async function i() {
24
25
  var l;
25
26
  const c = ((l = e.value) == null ? void 0 : l._id) ?? null;
@@ -27,35 +28,35 @@ const E = "/permission-sets", N = {
27
28
  try {
28
29
  r.value = !0;
29
30
  const d = await N.read();
30
- t.value = u(d), n.value = c;
31
+ s.value = u(d), n.value = c;
31
32
  } finally {
32
33
  r.value = !1;
33
34
  }
34
35
  }
35
- async function s(c) {
36
+ async function t(c) {
36
37
  const l = await N.create(c);
37
- t.value = u([...t.value, l]);
38
+ s.value = u([...s.value, l]);
38
39
  }
39
40
  async function a(c, l) {
40
41
  const d = await N.update(c, l);
41
- t.value = u(t.value.map((m) => m.id === c ? d : m));
42
+ s.value = u(s.value.map((f) => f.id === c ? d : f));
42
43
  }
43
44
  async function o(c) {
44
- await N.delete(c), t.value = u(t.value.filter((l) => l.id !== c));
45
+ await N.delete(c), s.value = u(s.value.filter((l) => l.id !== c));
45
46
  }
46
47
  function u(c) {
47
48
  return c.sort((l, d) => l.name.localeCompare(d.name));
48
49
  }
49
50
  return {
50
- permissionSets: t,
51
+ permissionSets: s,
51
52
  isLoading: r,
52
53
  readPermissionSets: i,
53
- createPermissionSet: s,
54
+ createPermissionSet: t,
54
55
  updatePermissionSet: a,
55
56
  deletePermissionSet: o
56
57
  };
57
- }), ne = () => {
58
- const e = se();
58
+ }), re = () => {
59
+ const e = ne();
59
60
  return {
60
61
  ...e,
61
62
  ...K(e)
@@ -77,60 +78,60 @@ function D(e) {
77
78
  }
78
79
  function j(e) {
79
80
  return e ? Object.values(e).every(
80
- (t) => t !== null && typeof t == "object" && !Array.isArray(t) && Object.keys(t).length === 1 && Array.isArray(t.$in)
81
+ (s) => s !== null && typeof s == "object" && !Array.isArray(s) && Object.keys(s).length === 1 && Array.isArray(s.$in)
81
82
  ) : !0;
82
83
  }
83
84
  function Q(e) {
84
- const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), n = (i, s, a) => {
85
+ const s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), n = (i, t, a) => {
85
86
  var o, u;
86
- const c = D(s.conditions);
87
- let l = `${s.subject}::${JSON.stringify([...s.actions].sort())}`;
87
+ const c = D(t.conditions);
88
+ let l = `${t.subject}::${JSON.stringify([...t.actions].sort())}`;
88
89
  j(c) || (l += `::${JSON.stringify(c)}`);
89
90
  const d = i.get(l);
90
91
  if (!d) {
91
- i.set(l, { ...s, setNames: [a.name], setId: a._id });
92
+ i.set(l, { ...t, setNames: [a.name], setId: a._id });
92
93
  return;
93
94
  }
94
95
  d.setNames.push(a.name);
95
- const m = D(d.conditions);
96
- if (!m || !c) {
96
+ const f = D(d.conditions);
97
+ if (!f || !c) {
97
98
  d.conditions = void 0;
98
99
  return;
99
100
  }
100
- for (const f in c)
101
- (o = m[f]) != null && o.$in && (u = c[f]) != null && u.$in ? m[f].$in = Array.from(
102
- /* @__PURE__ */ new Set([...m[f].$in, ...c[f].$in])
103
- ) : m[f] || (m[f] = c[f]);
104
- d.conditions = JSON.stringify(m);
101
+ for (const m in c)
102
+ (o = f[m]) != null && o.$in && (u = c[m]) != null && u.$in ? f[m].$in = Array.from(
103
+ /* @__PURE__ */ new Set([...f[m].$in, ...c[m].$in])
104
+ ) : f[m] || (f[m] = c[m]);
105
+ d.conditions = JSON.stringify(f);
105
106
  };
106
107
  for (const i of e)
107
- for (const s of i.permissions)
108
- n(s.inverted ? r : t, s, i);
109
- return [...Array.from(t.values()), ...Array.from(r.values())];
108
+ for (const t of i.permissions)
109
+ n(t.inverted ? r : s, t, i);
110
+ return [...Array.from(s.values()), ...Array.from(r.values())];
110
111
  }
111
- function B(e, t) {
112
- return `${e}::${[...t].sort().join(",")}`;
112
+ function B(e, s) {
113
+ return `${e}::${[...s].sort().join(",")}`;
113
114
  }
114
- function G(e, t) {
115
- const r = [...e], n = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
115
+ function G(e, s) {
116
+ const r = [...e], n = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set();
116
117
  for (const o of e) {
117
118
  const u = O(o.subject);
118
- n.add(B(u, o.actions)), o.inverted && o.actions.includes("manage") && i.add(`set_${u}`), !o.inverted && o.actions.includes("manage") && s.add(u);
119
+ n.add(B(u, o.actions)), o.inverted && o.actions.includes("manage") && i.add(`set_${u}`), !o.inverted && o.actions.includes("manage") && t.add(u);
119
120
  }
120
121
  const a = [...e];
121
122
  for (; a.length > 0; ) {
122
- const o = a.shift(), u = `set_${O(o.subject)}`, c = t[u];
123
+ const o = a.shift(), u = `set_${O(o.subject)}`, c = s[u];
123
124
  if (!c || i.has(u) || !o.actions.includes("manage") || o.inverted) continue;
124
125
  i.add(u);
125
- const l = re(o);
126
+ const l = ie(o);
126
127
  o.source && !o.source.trace && (o.source = { ...o.source, trace: l });
127
128
  const d = [...l, `${c.name} (system)`];
128
- for (const m of c.permissions ?? []) {
129
- const f = O(m.subject), p = B(f, m.actions);
130
- n.has(p) || s.has(f) || (n.add(p), r.push({
131
- ...m,
129
+ for (const f of c.permissions ?? []) {
130
+ const m = O(f.subject), p = B(m, f.actions);
131
+ n.has(p) || t.has(m) || (n.add(p), r.push({
132
+ ...f,
132
133
  // FdoPermissionRule.fields is string[] | null; RawRule expects string[] | undefined
133
- fields: m.fields ?? void 0,
134
+ fields: f.fields ?? void 0,
134
135
  source: {
135
136
  type: "systemPermissionSet",
136
137
  permissionSetId: c.key,
@@ -139,9 +140,9 @@ function G(e, t) {
139
140
  }
140
141
  }));
141
142
  }
142
- for (const m of c.permissionSets ?? []) {
143
- const f = O(m), p = B(f, ["manage"]), v = {
144
- subject: f,
143
+ for (const f of c.permissionSets ?? []) {
144
+ const m = O(f), p = B(m, ["manage"]), b = {
145
+ subject: m,
145
146
  actions: ["manage"],
146
147
  source: {
147
148
  type: "systemPermissionSet",
@@ -150,16 +151,16 @@ function G(e, t) {
150
151
  trace: d
151
152
  }
152
153
  };
153
- n.has(p) || (n.add(p), r.push(v)), a.push(v);
154
+ n.has(p) || (n.add(p), r.push(b)), a.push(b);
154
155
  }
155
156
  }
156
157
  return [...r.filter((o) => !o.inverted), ...r.filter((o) => o.inverted)];
157
158
  }
158
- function re(e) {
159
+ function ie(e) {
159
160
  if (!e.source) return [];
160
- const { type: t, trace: r, permissionSetName: n } = e.source;
161
+ const { type: s, trace: r, permissionSetName: n } = e.source;
161
162
  if (r && r.length > 0) return r;
162
- switch (t) {
163
+ switch (s) {
163
164
  case "permissionSet":
164
165
  return n ? [n] : [];
165
166
  case "custom":
@@ -168,41 +169,41 @@ function re(e) {
168
169
  return [];
169
170
  }
170
171
  }
171
- function H(e, t, r = /* @__PURE__ */ new Set()) {
172
+ function H(e, s, r = /* @__PURE__ */ new Set()) {
172
173
  var i;
173
174
  const n = [];
174
- for (const s of e) {
175
- if (r.has(s)) continue;
176
- r.add(s);
177
- const a = t.find((o) => o.id === s);
178
- a && (n.push(a), (i = a.permissionSetIds) != null && i.length && n.push(...H(a.permissionSetIds, t, r)));
175
+ for (const t of e) {
176
+ if (r.has(t)) continue;
177
+ r.add(t);
178
+ const a = s.find((o) => o.id === t);
179
+ a && (n.push(a), (i = a.permissionSetIds) != null && i.length && n.push(...H(a.permissionSetIds, s, r)));
179
180
  }
180
181
  return n;
181
182
  }
182
- function $e(e) {
183
- const t = Q(e).map(
184
- ({ setNames: i, setId: s, ...a }) => a
185
- ), r = t.filter((i) => !i.inverted), n = t.filter((i) => i.inverted);
183
+ function Oe(e) {
184
+ const s = Q(e).map(
185
+ ({ setNames: i, setId: t, ...a }) => a
186
+ ), r = s.filter((i) => !i.inverted), n = s.filter((i) => i.inverted);
186
187
  return L(r, n);
187
188
  }
188
- function Ae(e, t, r) {
189
+ function _e(e, s, r) {
189
190
  const n = /* @__PURE__ */ new Map();
190
191
  return e.forEach(
191
- ({ name: i, permissions: s }) => s.forEach(({ conditions: a, actions: o }) => {
192
+ ({ name: i, permissions: t }) => t.forEach(({ conditions: a, actions: o }) => {
192
193
  var c, l;
193
194
  const u = JSON.parse(a || "{}");
194
- (c = u[t]) != null && c.$in ? (l = u[t]) == null || l.$in.forEach(
195
+ (c = u[s]) != null && c.$in ? (l = u[s]) == null || l.$in.forEach(
195
196
  (d) => (n.get(d) ?? n.set(d, /* @__PURE__ */ new Set()).get(d)).add(i)
196
197
  ) : o[0] === "manage" && r.forEach((d) => {
197
198
  (n.get(d) ?? n.set(d, /* @__PURE__ */ new Set()).get(d)).add(i);
198
199
  });
199
200
  })
200
- ), [...n].map(([i, s]) => ({
201
+ ), [...n].map(([i, t]) => ({
201
202
  id: i,
202
- setNames: [...s]
203
+ setNames: [...t]
203
204
  }));
204
205
  }
205
- function Oe(e, t) {
206
+ function Ee(e, s) {
206
207
  const r = (o, u) => {
207
208
  const c = { ...o }, l = JSON.parse(c.conditions || "{}");
208
209
  if (u)
@@ -216,45 +217,45 @@ function Oe(e, t) {
216
217
  inverted: !0,
217
218
  ...c.conditions && { conditions: JSON.stringify(l) }
218
219
  };
219
- }, n = new Map(e.map((o) => [o.subject, o])), i = new Map(t.map((o) => [o.subject, o])), s = [], a = /* @__PURE__ */ new Set([...n.keys(), ...i.keys()]);
220
+ }, n = new Map(e.map((o) => [o.subject, o])), i = new Map(s.map((o) => [o.subject, o])), t = [], a = /* @__PURE__ */ new Set([...n.keys(), ...i.keys()]);
220
221
  for (const o of a) {
221
222
  const u = n.get(o), c = i.get(o);
222
223
  if (u && c) {
223
224
  if (u.conditions && c.conditions) {
224
225
  const l = JSON.parse(u.conditions), d = JSON.parse(c.conditions);
225
226
  if (!j(l) || !j(d)) {
226
- JSON.stringify(l) !== JSON.stringify(d) && s.push(c);
227
+ JSON.stringify(l) !== JSON.stringify(d) && t.push(c);
227
228
  continue;
228
229
  }
229
- const m = Object.keys(l)[0], f = l[m].$in.filter(
230
- (v) => !d[m].$in.includes(v)
230
+ const f = Object.keys(l)[0], m = l[f].$in.filter(
231
+ (b) => !d[f].$in.includes(b)
231
232
  );
232
- f.length > 0 && s.push(r(u, f)), d[m].$in.filter(
233
- (v) => !l[m].$in.includes(v)
234
- ).length > 0 && s.push(c);
233
+ m.length > 0 && t.push(r(u, m)), d[f].$in.filter(
234
+ (b) => !l[f].$in.includes(b)
235
+ ).length > 0 && t.push(c);
235
236
  } else if (!u.conditions && c.conditions)
236
- s.push(c);
237
+ t.push(c);
237
238
  else if (u.conditions && !c.conditions)
238
- j(JSON.parse(u.conditions)) || s.push(c);
239
+ j(JSON.parse(u.conditions)) || t.push(c);
239
240
  else if (!u.conditions && !c.conditions) {
240
- const l = new Set(u.actions), d = new Set(c.actions), m = c.actions.some((p) => !l.has(p)), f = u.actions.filter((p) => !d.has(p));
241
- if (m) {
242
- const p = c.actions.filter((v) => !l.has(v));
243
- s.push({
241
+ const l = new Set(u.actions), d = new Set(c.actions), f = c.actions.some((p) => !l.has(p)), m = u.actions.filter((p) => !d.has(p));
242
+ if (f) {
243
+ const p = c.actions.filter((b) => !l.has(b));
244
+ t.push({
244
245
  ...c,
245
246
  actions: p
246
247
  });
247
248
  }
248
- f.length > 0 && s.push({
249
+ m.length > 0 && t.push({
249
250
  ...u,
250
- actions: f,
251
+ actions: m,
251
252
  inverted: !0
252
253
  });
253
254
  }
254
255
  continue;
255
256
  }
256
257
  if (u) {
257
- s.push(
258
+ t.push(
258
259
  r(
259
260
  u,
260
261
  // If base has conditions, set diffIds to empty array, disallow all access to collection
@@ -264,223 +265,223 @@ function Oe(e, t) {
264
265
  );
265
266
  continue;
266
267
  }
267
- c && s.push(c);
268
+ c && t.push(c);
268
269
  }
269
- return s;
270
+ return t;
270
271
  }
271
- function _e(e) {
272
- const t = G(
272
+ function Ne(e) {
273
+ const s = G(
273
274
  e,
274
- V
275
+ W
275
276
  ), r = new Set(
276
- t.filter((i) => {
277
- var s;
278
- return ((s = i.source) == null ? void 0 : s.type) === "systemPermissionSet" && !i.inverted;
277
+ s.filter((i) => {
278
+ var t;
279
+ return ((t = i.source) == null ? void 0 : t.type) === "systemPermissionSet" && !i.inverted;
279
280
  }).map((i) => i.subject)
280
281
  ), n = new Set(
281
- t.filter(
282
+ s.filter(
282
283
  (i) => {
283
- var s;
284
- return ((s = i.source) == null ? void 0 : s.type) === "systemPermissionSet" && !i.inverted && i.actions.includes("manage");
284
+ var t;
285
+ return ((t = i.source) == null ? void 0 : t.type) === "systemPermissionSet" && !i.inverted && i.actions.includes("manage");
285
286
  }
286
287
  ).map((i) => i.subject)
287
288
  );
288
289
  return e.filter((i) => i.inverted ? !(r.has(i.subject) && !n.has(i.subject)) : !r.has(i.subject));
289
290
  }
290
- const ie = "business::report::";
291
- function Ee(e, t) {
291
+ const oe = "business::report::";
292
+ function Ue(e, s) {
292
293
  const r = [], n = e.filter((i) => {
293
- const s = i.subject;
294
- return !s.startsWith(ie) || t.has(s) ? !0 : (r.push(s), !1);
294
+ const t = i.subject;
295
+ return !t.startsWith(oe) || s.has(t) ? !0 : (r.push(t), !1);
295
296
  });
296
297
  return r.length > 0 && console.warn("[filterStalePermissions] dropped stale report permissions:", r), n;
297
298
  }
298
- const oe = "business::report::reports::", ae = _.Subject.Business.report_reports_allDefaultReports, ce = _.Subject.Business.report_reports_allCustomReports;
299
- function ue(e, t) {
300
- return e.conditions ? !!t.conditions && e.conditions === t.conditions : !t.conditions;
299
+ const ae = "business::report::reports::", ce = _.Subject.Business.report_reports_allDefaultReports, ue = _.Subject.Business.report_reports_allCustomReports;
300
+ function le(e, s) {
301
+ return e.conditions ? !!s.conditions && e.conditions === s.conditions : !s.conditions;
301
302
  }
302
- function Ne(e, t) {
303
+ function Ce(e, s) {
303
304
  const r = e.find(
304
- (a) => !a.inverted && a.subject === ae
305
- ), n = e.find(
306
305
  (a) => !a.inverted && a.subject === ce
306
+ ), n = e.find(
307
+ (a) => !a.inverted && a.subject === ue
307
308
  );
308
309
  if (!r && !n) return e;
309
- const i = r ? new Set(r.actions) : null, s = n ? new Set(n.actions) : null;
310
+ const i = r ? new Set(r.actions) : null, t = n ? new Set(n.actions) : null;
310
311
  return e.reduce((a, o) => {
311
312
  if (o.inverted)
312
313
  return a.push(o), a;
313
314
  const u = o.subject;
314
- if (!u.startsWith(oe))
315
+ if (!u.startsWith(ae))
315
316
  return a.push(o), a;
316
- const c = t.has(u), l = c ? i : s, d = c ? r : n;
317
- if (!l || !d || !ue(d, o))
317
+ const c = s.has(u), l = c ? i : t, d = c ? r : n;
318
+ if (!l || !d || !le(d, o))
318
319
  return a.push(o), a;
319
320
  if (l.has("manage")) return a;
320
- const m = o.actions;
321
- if (m.includes("manage"))
321
+ const f = o.actions;
322
+ if (f.includes("manage"))
322
323
  return a.push(o), a;
323
- const f = new Set(m);
324
+ const m = new Set(f);
324
325
  for (const p of l)
325
- f.delete(p);
326
- return f.size === 0 || a.push({ ...o, actions: Array.from(f) }), a;
326
+ m.delete(p);
327
+ return m.size === 0 || a.push({ ...o, actions: Array.from(m) }), a;
327
328
  }, []);
328
329
  }
329
- function L(e, t) {
330
+ function L(e, s) {
330
331
  var n, i;
331
- const r = new Map(e.map((s) => [s.subject, s]));
332
- for (const s of t) {
333
- if (s.inverted) {
334
- const o = r.get(s.subject);
335
- if (s.conditions) {
332
+ const r = new Map(e.map((t) => [t.subject, t]));
333
+ for (const t of s) {
334
+ if (t.inverted) {
335
+ const o = r.get(t.subject);
336
+ if (t.conditions) {
336
337
  if (o != null && o.conditions) {
337
- const u = JSON.parse(o.conditions), c = JSON.parse(s.conditions);
338
+ const u = JSON.parse(o.conditions), c = JSON.parse(t.conditions);
338
339
  if (!j(u) || !j(c)) {
339
- r.delete(s.subject);
340
+ r.delete(t.subject);
340
341
  continue;
341
342
  }
342
- const l = Object.keys(c)[0], d = ((n = c[l]) == null ? void 0 : n.$in) ?? [], f = (((i = u[l]) == null ? void 0 : i.$in) ?? []).filter((p) => !d.includes(p));
343
- f.length > 0 ? r.set(s.subject, {
343
+ const l = Object.keys(c)[0], d = ((n = c[l]) == null ? void 0 : n.$in) ?? [], m = (((i = u[l]) == null ? void 0 : i.$in) ?? []).filter((p) => !d.includes(p));
344
+ m.length > 0 ? r.set(t.subject, {
344
345
  ...o,
345
- conditions: JSON.stringify({ [l]: { $in: f } })
346
- }) : r.delete(s.subject);
346
+ conditions: JSON.stringify({ [l]: { $in: m } })
347
+ }) : r.delete(t.subject);
347
348
  } else
348
- r.delete(s.subject);
349
+ r.delete(t.subject);
349
350
  continue;
350
351
  }
351
352
  if (o) {
352
- const u = new Set(s.actions), c = o.actions.filter((l) => !u.has(l));
353
- c.length > 0 ? r.set(s.subject, { ...o, actions: c }) : r.delete(s.subject);
353
+ const u = new Set(t.actions), c = o.actions.filter((l) => !u.has(l));
354
+ c.length > 0 ? r.set(t.subject, { ...o, actions: c }) : r.delete(t.subject);
354
355
  continue;
355
356
  }
356
357
  continue;
357
358
  }
358
- if (s.conditions) {
359
- r.set(s.subject, s);
359
+ if (t.conditions) {
360
+ r.set(t.subject, t);
360
361
  continue;
361
362
  }
362
- const a = r.get(s.subject);
363
+ const a = r.get(t.subject);
363
364
  if (a != null && a.conditions && !j(JSON.parse(a.conditions))) {
364
- r.set(s.subject, s);
365
+ r.set(t.subject, t);
365
366
  continue;
366
367
  }
367
368
  if (a) {
368
369
  const o = [
369
370
  .../* @__PURE__ */ new Set([
370
371
  ...a.actions,
371
- ...s.actions
372
+ ...t.actions
372
373
  ])
373
374
  ];
374
- r.set(s.subject, { ...a, actions: o });
375
+ r.set(t.subject, { ...a, actions: o });
375
376
  } else
376
- r.set(s.subject, s);
377
+ r.set(t.subject, t);
377
378
  }
378
379
  return Array.from(r.values());
379
380
  }
380
- function le(e, t) {
381
- const r = L(e, t), n = new Set(e.map((s) => s.subject)), i = t.filter(
382
- (s) => s.inverted && !n.has(s.subject)
381
+ function de(e, s) {
382
+ const r = L(e, s), n = new Set(e.map((t) => t.subject)), i = s.filter(
383
+ (t) => t.inverted && !n.has(t.subject)
383
384
  );
384
385
  return [...r, ...i];
385
386
  }
386
- const P = "/permission-assignments", R = {
387
+ const P = "/permission-assignments", I = {
387
388
  async readAll() {
388
- return g(await b().get(P));
389
+ return g(await v().get(P));
389
390
  },
390
391
  async readByUserId(e) {
391
- return g(await b().get(`${P}/user/${e}`));
392
+ return g(await v().get(`${P}/user/${e}`));
392
393
  },
393
394
  async readById(e) {
394
- return g(await b().get(`${P}/${e}`));
395
+ return g(await v().get(`${P}/${e}`));
395
396
  },
396
397
  async create(e) {
397
- return g(await b().post(P, e));
398
+ return g(await v().post(P, e));
398
399
  },
399
- async update(e, t) {
400
- return g(await b().put(`${P}/${e}`, t));
400
+ async update(e, s) {
401
+ return g(await v().put(`${P}/${e}`, s));
401
402
  },
402
403
  async delete(e) {
403
- return g(await b().delete(`${P}/${e}`));
404
+ return g(await v().delete(`${P}/${e}`));
404
405
  },
405
- async addReportManagePermission(e, t) {
406
+ async addReportManagePermission(e, s) {
406
407
  return g(
407
- await b().post("/my-permissions/report-manage", { permissionKey: e, label: t })
408
+ await v().post("/my-permissions/report-manage", { permissionKey: e, label: s })
408
409
  );
409
410
  }
410
- }, de = z("permissionAssignment", () => {
411
+ }, fe = z("permissionAssignment", () => {
411
412
  const e = S([]);
412
- async function t() {
413
- const o = await R.readAll();
413
+ async function s() {
414
+ const o = await I.readAll();
414
415
  e.value = o;
415
416
  }
416
417
  async function r(o) {
417
- return await R.readByUserId(o);
418
+ return await I.readByUserId(o);
418
419
  }
419
420
  async function n(o) {
420
- const u = await R.create(o);
421
+ const u = await I.create(o);
421
422
  e.value = [...e.value, u];
422
423
  }
423
424
  async function i(o, u) {
424
- const c = await R.update(o, u);
425
+ const c = await I.update(o, u);
425
426
  e.value = e.value.map((l) => l.id === o ? c : l);
426
427
  }
427
- async function s(o) {
428
- await R.delete(o), e.value = e.value.filter((u) => u.id !== o);
428
+ async function t(o) {
429
+ await I.delete(o), e.value = e.value.filter((u) => u.id !== o);
429
430
  }
430
431
  function a(o) {
431
432
  return e.value.find((u) => u.userId === o);
432
433
  }
433
434
  return {
434
435
  permissionAssignments: e,
435
- readPermissionAssignments: t,
436
+ readPermissionAssignments: s,
436
437
  readPermissionAssignmentByUserId: r,
437
438
  createPermissionAssignment: n,
438
439
  updatePermissionAssignment: i,
439
- deletePermissionAssignment: s,
440
+ deletePermissionAssignment: t,
440
441
  getPermissionAssignmentByUserId: a
441
442
  };
442
443
  }), me = () => {
443
- const e = de();
444
+ const e = fe();
444
445
  return {
445
446
  ...e,
446
447
  ...K(e)
447
448
  };
448
- }, fe = {
449
- async fetchReportPermissions(e, t) {
450
- const r = t ? { lang: t } : {};
449
+ }, pe = {
450
+ async fetchReportPermissions(e, s) {
451
+ const r = s ? { lang: s } : {};
451
452
  return g(
452
453
  await x().get(`/report-query/hrm/${e}/reports`, { params: r })
453
454
  );
454
455
  },
455
- async fetchReportPermissionsForPortal(e, t) {
456
- const r = t ? { isSupportPos: !1, lang: t } : { isSupportPos: !1 };
456
+ async fetchReportPermissionsForPortal(e, s) {
457
+ const r = s ? { isSupportPos: !1, lang: s } : { isSupportPos: !1 };
457
458
  return g(
458
459
  await x().get(`/report-query/hrm/${e}/reports`, { params: r })
459
460
  );
460
461
  }
461
- }, U = S([]), C = S(!1), I = S(!1), $ = S(null), k = S(null), J = S(!1);
462
- function pe() {
462
+ }, U = S([]), C = S(!1), R = S(!1), $ = S(null), k = S(null), J = S(!1);
463
+ function ge() {
463
464
  const e = X();
464
- async function t() {
465
- var s;
466
- const n = (s = e.currentBusiness.value) == null ? void 0 : s.id;
465
+ async function s() {
466
+ var t;
467
+ const n = (t = e.currentBusiness.value) == null ? void 0 : t.id;
467
468
  if (!n) return;
468
469
  const i = localStorage.getItem("locale");
469
- if ($.value !== n && (U.value = [], C.value = !1, I.value = !1, $.value = n, J.value = !1), !(C.value && k.value === i)) {
470
- if (I.value) {
470
+ if ($.value !== n && (U.value = [], C.value = !1, R.value = !1, $.value = n, J.value = !1), !(C.value && k.value === i)) {
471
+ if (R.value) {
471
472
  J.value = !0;
472
473
  return;
473
474
  }
474
- I.value = !0;
475
+ R.value = !0;
475
476
  try {
476
- const a = await fe.fetchReportPermissionsForPortal(n, i);
477
+ const a = await pe.fetchReportPermissionsForPortal(n, i);
477
478
  if ($.value !== n) return;
478
479
  U.value = a, C.value = !0, k.value = i;
479
480
  } catch (a) {
480
481
  if ($.value !== n) return;
481
482
  console.warn("Failed to fetch custom report permissions:", a), U.value = [];
482
483
  } finally {
483
- $.value === n && (I.value = !1, J.value && (J.value = !1, await t()));
484
+ $.value === n && (R.value = !1, J.value && (J.value = !1, await s()));
484
485
  }
485
486
  }
486
487
  }
@@ -504,54 +505,54 @@ function pe() {
504
505
  }
505
506
  ));
506
507
  return {
507
- fetchCustomReportPermissions: t,
508
+ fetchCustomReportPermissions: s,
508
509
  customReportPermissions: r,
509
- isLoading: T(() => I.value),
510
+ isLoading: T(() => R.value),
510
511
  isLoaded: T(() => C.value)
511
512
  };
512
513
  }
513
514
  function A(e) {
514
- const t = ne(), r = me(), n = te().restaurants, { customReportPermissions: i } = pe(), s = r.getPermissionAssignmentByUserId(e.id), a = H(
515
- (s == null ? void 0 : s.permissionSetIds) ?? [],
516
- t.permissionSets.value
515
+ const s = re(), r = me(), n = te().restaurants, { customReportPermissions: i } = ge(), t = r.getPermissionAssignmentByUserId(e.id), a = H(
516
+ (t == null ? void 0 : t.permissionSetIds) ?? [],
517
+ s.permissionSets.value
517
518
  ), o = Q(a).map(
518
- ({ setNames: p, ...v }) => v
519
- ), u = s == null ? void 0 : s.customPermissions, c = u ?? e.permissions.map((p) => ({
519
+ ({ setNames: p, ...b }) => b
520
+ ), u = t == null ? void 0 : t.customPermissions, c = u ?? e.permissions.map((p) => ({
520
521
  ...p,
521
522
  subject: O(p.subject)
522
523
  })), l = L(o, c), d = G(
523
- le(o, c),
524
- V
525
- ).filter((p) => !p.inverted), m = be(d), f = m ?? n.value.map((p) => p._id);
524
+ de(o, c),
525
+ W
526
+ ).filter((p) => !p.inverted), f = Y(d), m = f ?? n.value.map((p) => p._id);
526
527
  return {
527
528
  doc: e,
528
529
  id: e.id,
529
530
  name: e.name && e.name !== e.email && e.name !== e.phoneNumber ? e.name : "-",
530
531
  phoneNumber: e.phoneNumber,
531
532
  email: e.email,
532
- restaurants: W(
533
- f.map((p) => {
534
- var v;
535
- return ((v = n.value.find((Y) => Y._id === p)) == null ? void 0 : v.profile.name) ?? "";
533
+ restaurants: V(
534
+ m.map((p) => {
535
+ var b;
536
+ return ((b = n.value.find((Z) => Z._id === p)) == null ? void 0 : b.profile.name) ?? "";
536
537
  })
537
538
  ),
538
- managableRestaurantIds: m,
539
- permissionLabels: Se(d, i.value),
539
+ managableRestaurantIds: f,
540
+ permissionLabels: he(d, i.value),
540
541
  permissions: l
541
542
  };
542
543
  }
543
- const ge = Object.freeze(
544
+ const ve = Object.freeze(
544
545
  Object.values(q)
545
- ), Ue = {
546
+ ), Je = {
546
547
  async readTeamMembers() {
547
548
  return g(
548
- await b().get("/portal-users")
549
+ await v().get("/portal-users")
549
550
  ).map(A);
550
551
  },
551
552
  async readTeamMembersPage(e) {
552
553
  var r, n, i;
553
- const t = g(
554
- await b().get("/portal-users/paged", {
554
+ const s = g(
555
+ await v().get("/portal-users/paged", {
555
556
  params: {
556
557
  limit: e.limit,
557
558
  offset: e.offset,
@@ -563,55 +564,55 @@ const ge = Object.freeze(
563
564
  })
564
565
  );
565
566
  return {
566
- items: t.items.map(A),
567
- total: t.total
567
+ items: s.items.map(A),
568
+ total: s.total
568
569
  };
569
570
  },
570
571
  async readTeamMember(e) {
571
572
  return A(
572
- g(await b().get(`/portal-users/${e}`))
573
+ g(await v().get(`/portal-users/${e}`))
573
574
  );
574
575
  },
575
576
  async createTeamMember(e) {
576
577
  return A(
577
- g(await b().post("/portal-users", e))
578
+ g(await v().post("/portal-users", e))
578
579
  );
579
580
  },
580
- async updateTeamMember(e, t) {
581
+ async updateTeamMember(e, s) {
581
582
  return A(
582
- g(await b().put(`/portal-users/${e}`, t))
583
+ g(await v().put(`/portal-users/${e}`, s))
583
584
  );
584
585
  },
585
586
  async deleteTeamMember(e) {
586
- return g(await b().delete(`/portal-users/${e}`));
587
+ return g(await v().delete(`/portal-users/${e}`));
587
588
  },
588
589
  async readTeamMemberPosUserIds() {
589
- return g(await b().get("/portal-users")).map((t) => t.posUserId);
590
+ return g(await v().get("/portal-users")).map((s) => s.posUserId);
590
591
  },
591
592
  async generateMasterUserPasscode(e) {
592
593
  return `${g(
593
- await b().post("/portal-users/generate-passcode", {
594
+ await v().post("/portal-users/generate-passcode", {
594
595
  restaurantIds: e.restaurantIds,
595
596
  excludePosUserId: e.excludePosUserId
596
597
  })
597
598
  )}`;
598
599
  }
599
600
  };
600
- function Ce(e, t, r) {
601
+ function Te(e, s, r) {
601
602
  if (e.some((a) => a.subject === "all")) return "All";
602
603
  const n = (r ?? M).filter(
603
- (a) => a.subject === t
604
- ), i = new Set(n.map((a) => w(a).value)), s = e.filter((a) => a.subject === t).filter((a) => i.has(w(a).value));
605
- return s.length === n.length ? "All" : s.length === 0 ? "-" : `${s.length} permission allow`;
604
+ (a) => a.subject === s
605
+ ), i = new Set(n.map((a) => w(a).value)), t = e.filter((a) => a.subject === s).filter((a) => i.has(w(a).value));
606
+ return t.length === n.length ? "All" : t.length === 0 ? "-" : `${t.length} permission allow`;
606
607
  }
607
608
  function w(e) {
608
- const t = Z(e), r = t.subject;
609
+ const s = ee(e), r = s.subject;
609
610
  return {
610
- ...t,
611
+ ...s,
611
612
  get conditions() {
612
- if (typeof t.conditions != "string") return t.conditions;
613
+ if (typeof s.conditions != "string") return s.conditions;
613
614
  try {
614
- return JSON.parse(t.conditions);
615
+ return JSON.parse(s.conditions);
615
616
  } catch {
616
617
  return;
617
618
  }
@@ -652,7 +653,7 @@ function w(e) {
652
653
  return n === void 0 ? r.toString() : n.endsWith("_") ? n.slice(0, n.length - 1) : n;
653
654
  },
654
655
  get label() {
655
- return t.label || ee(this.formatted);
656
+ return s.label || se(this.formatted);
656
657
  },
657
658
  get value() {
658
659
  const n = this.discriminator;
@@ -660,57 +661,60 @@ function w(e) {
660
661
  }
661
662
  };
662
663
  }
663
- function Je(e) {
664
+ function Be(e) {
664
665
  var n, i;
665
- const t = e.map((s) => w(s)).find((s) => s.isDiscountOperation);
666
- if (!t) return 100;
667
- const r = Number((i = (n = t.conditions) == null ? void 0 : n.adjustment) == null ? void 0 : i.$lte);
666
+ const s = e.map((t) => w(t)).find((t) => t.isDiscountOperation);
667
+ if (!s) return 100;
668
+ const r = Number((i = (n = s.conditions) == null ? void 0 : n.adjustment) == null ? void 0 : i.$lte);
668
669
  return Number.isFinite(r) ? parseInt((r * 100).toFixed(0)) : 0;
669
670
  }
670
- function be(e) {
671
- const t = e.find(
671
+ function Y(e) {
672
+ const s = e.find(
672
673
  (r) => r.subject === _.Subject.Restaurant.restaurant
673
674
  );
674
- return t ? t.conditions ? JSON.parse(t.conditions).restaurantId.$in : null : [];
675
+ return s ? s.conditions ? JSON.parse(s.conditions).restaurantId.$in : null : [];
675
676
  }
676
- function Te(e) {
677
- return (e == null ? void 0 : e.some((t) => t.subject === "all")) ?? !1;
677
+ function Me(e, s) {
678
+ return s.isOwner ? { restaurantIds: null, roleIds: null } : { restaurantIds: Y(e), roleIds: be(e) };
678
679
  }
679
- function Be(e) {
680
- const t = e.find((r) => r.subject === _.Subject.Business.role);
681
- return t ? t.conditions ? JSON.parse(t.conditions).roleId.$in : null : [];
680
+ function Le(e) {
681
+ return (e == null ? void 0 : e.some((s) => s.subject === "all")) ?? !1;
682
+ }
683
+ function be(e) {
684
+ const s = e.find((r) => r.subject === _.Subject.Business.role);
685
+ return s ? s.conditions ? JSON.parse(s.conditions).roleId.$in : null : [];
682
686
  }
683
- function Me(e) {
684
- const t = w(e);
685
- if (!t.isReportPermission) return;
686
- const { name: r, ...n } = t.conditions ?? {};
687
+ function Fe(e) {
688
+ const s = w(e);
689
+ if (!s.isReportPermission) return;
690
+ const { name: r, ...n } = s.conditions ?? {};
687
691
  return Object.keys(n).length > 0 ? n : void 0;
688
692
  }
689
- function Le(e, t, r) {
693
+ function xe(e, s, r) {
690
694
  return e.flatMap((n) => {
691
- const i = ve(n);
695
+ const i = Se(n);
692
696
  if (!i) return [];
693
- const s = i.isReportPermission ? r == null ? void 0 : r.get(n) : void 0;
697
+ const t = i.isReportPermission ? r == null ? void 0 : r.get(n) : void 0;
694
698
  return [
695
699
  {
696
700
  subject: i.subject,
697
701
  actions: i.actions,
698
702
  conditions: {
699
703
  ...i.conditions,
700
- ...s ?? {},
701
- adjustment: i.isDiscountOperation ? { $lte: parseFloat((t / 100).toFixed(2)) } : void 0
704
+ ...t ?? {},
705
+ adjustment: i.isDiscountOperation ? { $lte: parseFloat((s / 100).toFixed(2)) } : void 0
702
706
  }
703
707
  }
704
708
  ];
705
709
  });
706
710
  }
707
- function ve(e) {
708
- const t = e.indexOf(":"), r = t === -1 ? e : e.slice(0, t), n = t === -1 ? void 0 : e.slice(t + 1);
709
- if (t !== -1 && !n) return;
711
+ function Se(e) {
712
+ const s = e.indexOf(":"), r = s === -1 ? e : e.slice(0, s), n = s === -1 ? void 0 : e.slice(s + 1);
713
+ if (s !== -1 && !n) return;
710
714
  let i;
711
- return n ? (i = M.find((s) => {
712
- if (s.subject !== r) return !1;
713
- const a = typeof s.conditions == "string" ? JSON.parse(s.conditions) : s.conditions;
715
+ return n ? (i = M.find((t) => {
716
+ if (t.subject !== r) return !1;
717
+ const a = typeof t.conditions == "string" ? JSON.parse(t.conditions) : t.conditions;
714
718
  return [a == null ? void 0 : a.operation, a == null ? void 0 : a.name].includes(n);
715
719
  }), !i && r === y.F_RULE_SUBJECT.enum.report && (i = {
716
720
  label: "",
@@ -719,9 +723,9 @@ function ve(e) {
719
723
  conditions: { name: n },
720
724
  inverted: !1,
721
725
  reason: ""
722
- })) : i = M.find((s) => s.subject === r), i ? w(i) : void 0;
726
+ })) : i = M.find((t) => t.subject === r), i ? w(i) : void 0;
723
727
  }
724
- function Fe(e, t) {
728
+ function De(e, s) {
725
729
  const r = { values: [], passthrough: [], dropped: [] };
726
730
  for (const n of e) {
727
731
  const i = n == null ? void 0 : n.actions;
@@ -729,20 +733,20 @@ function Fe(e, t) {
729
733
  r.dropped.push(n);
730
734
  continue;
731
735
  }
732
- const s = w(n).value, a = `${y.F_RULE_SUBJECT.enum.report}:`, o = s.startsWith(a) ? s.slice(a.length) : "";
733
- t.has(s) || o && o !== "undefined" ? r.values.push(s) : r.passthrough.push(n);
736
+ const t = w(n).value, a = `${y.F_RULE_SUBJECT.enum.report}:`, o = t.startsWith(a) ? t.slice(a.length) : "";
737
+ s.has(t) || o && o !== "undefined" ? r.values.push(t) : r.passthrough.push(n);
734
738
  }
735
739
  return r;
736
740
  }
737
- function Se(e, t = []) {
738
- return W(
741
+ function he(e, s = []) {
742
+ return V(
739
743
  e.reduce((r, n) => {
740
- const i = ge.find(
741
- (s) => s.subject === n.subject && n.actions.includes("manage")
742
- ) || t.find((s) => s.subject === n.subject);
744
+ const i = ve.find(
745
+ (t) => t.subject === n.subject && n.actions.includes("manage")
746
+ ) || s.find((t) => t.subject === n.subject);
743
747
  if (i) {
744
- const s = i.subject === _.Subject.Business.inventory_stock ? "Warehouse Management" : i.label;
745
- r.push(s);
748
+ const t = i.subject === _.Subject.Business.inventory_stock ? "Warehouse Management" : i.label;
749
+ r.push(t);
746
750
  }
747
751
  return r;
748
752
  }, [])
@@ -751,29 +755,30 @@ function Se(e, t = []) {
751
755
  export {
752
756
  G as N,
753
757
  Q as P,
754
- fe as R,
755
- Ce as a,
756
- le as b,
758
+ pe as R,
759
+ Te as a,
760
+ de as b,
757
761
  H as c,
758
- pe as d,
759
- Me as e,
760
- Le as f,
761
- Je as g,
762
- Te as h,
763
- ie as i,
764
- Be as j,
765
- be as k,
766
- _e as l,
767
- $e as m,
768
- Oe as n,
769
- Ee as o,
770
- ge as p,
771
- Ne as q,
762
+ ge as d,
763
+ Fe as e,
764
+ xe as f,
765
+ Be as g,
766
+ Le as h,
767
+ oe as i,
768
+ Me as j,
769
+ Ne as k,
770
+ Ee as l,
771
+ Oe as m,
772
+ Ue as n,
773
+ Ce as o,
774
+ ve as p,
775
+ me as q,
772
776
  w as r,
773
- Fe as s,
774
- Ue as t,
775
- ne as u,
776
- me as v,
777
- Se as w,
778
- Ae as x
777
+ De as s,
778
+ Je as t,
779
+ re as u,
780
+ he as v,
781
+ _e as w,
782
+ Y as x,
783
+ be as y
779
784
  };