@feedmepos/mf-hrm-portal 2.2.2-dev → 2.2.2

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 (50) hide show
  1. package/dist/{ApprovalCodeList-B9O8QzzI.js → ApprovalCodeList-Dpg-lwZA.js} +5 -5
  2. package/dist/AuditLogList-B8lU5FU1.js +1149 -0
  3. package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-C9MYbxum.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-Di-1ZwEW.js} +2 -2
  4. package/dist/{EmployeeList-BFxMwFJq.js → EmployeeList-ByeniR1c.js} +71 -71
  5. package/dist/{GrantUserList-CZtmMRoS.js → GrantUserList-D0YIdpMH.js} +6 -6
  6. package/dist/{Main-on0TXkQt.js → Main-Bg0Najd8.js} +8 -8
  7. package/dist/{Main-B622Z4q4.js → Main-C9-EztWV.js} +11 -11
  8. package/dist/{Main-DD6IthCS.js → Main-CTsTrR0m.js} +5 -5
  9. package/dist/{PermissionSetList-FCX3TBoi.js → PermissionSetList-CqVP3iB8.js} +78 -77
  10. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Cl_YNh0k.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CXNhJDfA.js} +569 -564
  11. package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-XHuHin8t.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-Z-DH7ouY.js} +1 -1
  12. package/dist/RoleList-CQuV9O_f.js +739 -0
  13. package/dist/{TeamMemberList-BAU7Y3jh.js → TeamMemberList-DNitiMN5.js} +312 -313
  14. package/dist/{TimesheetList-DtFBWhma.js → TimesheetList-DYJsjODe.js} +7 -7
  15. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-Tatn3jUv.js → TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-DWKJIq76.js} +3 -3
  16. package/dist/{app-Bbf6hEPt.js → app-BJKd6Faz.js} +521 -817
  17. package/dist/app.js +1 -1
  18. package/dist/{approval-code-jIjkeVEb.js → approval-code-BRClD2HN.js} +1 -1
  19. package/dist/{dayjs.min-BAnGg8q2.js → dayjs.min-D8ClaZcZ.js} +1 -1
  20. package/dist/{employee-DVSD3L51.js → employee-C9VVckRM.js} +4 -4
  21. package/dist/{grant-user-SNiDV22U.js → grant-user-Dhi3ilC_.js} +1 -1
  22. package/dist/{iteration-BTZViJtd.js → iteration-CMXHdaKL.js} +1 -1
  23. package/dist/{lodash-Cgdk4_YL.js → lodash-0-Y1xSyQ.js} +1 -1
  24. package/dist/{restaurant-BTpBmfBV.js → restaurant-DiYb0pCm.js} +2 -2
  25. package/dist/{role-CXVpO6fB.js → role-B-Y4JezP.js} +2 -2
  26. package/dist/{rule-TR3MVo-b.js → rule-raGIIqlH.js} +288 -261
  27. package/dist/src/api/audit-log/index.d.ts +0 -6
  28. package/dist/src/api/user/index.d.ts +2 -2
  29. package/dist/src/composables/useReportPermissions.d.ts +1 -0
  30. package/dist/src/helpers/rule.d.ts +2 -0
  31. package/dist/src/types/audit-log.d.ts +1 -1
  32. package/dist/src/types/role.d.ts +1 -0
  33. package/dist/src/views/audit-log/locales/index.d.ts +0 -300
  34. package/dist/src/views/hr/locales/index.d.ts +12 -8
  35. package/dist/style.css +1 -1
  36. package/dist/tsconfig.app.tsbuildinfo +1 -1
  37. package/dist/{useAppStore-DCwd8GWN.js → useAppStore-BGhlB1_1.js} +1 -1
  38. package/dist/useDebounce-CWb5QR9G.js +28 -0
  39. package/dist/{useLoading-CXzTpIVv.js → useLoading-CvgqVDbF.js} +1 -1
  40. package/dist/useReportPermissions-C5_EivtU.js +82 -0
  41. package/package.json +2 -2
  42. package/dist/AuditLogList-CtFEXKWZ.js +0 -1722
  43. package/dist/RoleList-p_9KHzqF.js +0 -725
  44. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-B4PxNMwq.js +0 -16
  45. package/dist/src/views/audit-log/change-nodes.d.ts +0 -14
  46. package/dist/src/views/audit-log/event-line.d.ts +0 -13
  47. package/dist/src/views/audit-log/operation-status.d.ts +0 -2
  48. package/dist/src/views/audit-log/snapshot-diff.d.ts +0 -11
  49. package/dist/useDebounce-B8ZPVS5C.js +0 -15
  50. package/dist/useReportPermissions-BpAFyO17.js +0 -71
@@ -1,7 +1,7 @@
1
- import { s as W, c as Z, e as h } from "./iteration-BTZViJtd.js";
2
- import { h as O, P as V, e as _, b as F, n as j, d as q } from "./app-Bbf6hEPt.js";
1
+ import { s as W, c as Z, e as h } from "./iteration-CMXHdaKL.js";
2
+ import { h as O, P as V, e as _, b as F, n as j, d as q } from "./app-BJKd6Faz.js";
3
3
  import { s as ee } from "./utils-BZkjJbju.js";
4
- import { g as b, b as v, q as x, u as te } from "./restaurant-BTpBmfBV.js";
4
+ import { g as b, b as v, q as x, u as te } from "./restaurant-DiYb0pCm.js";
5
5
  import { defineStore as z, storeToRefs as K } from "pinia";
6
6
  import { ref as S, computed as U } from "vue";
7
7
  import { useCoreStore as X } from "@feedmepos/mf-common";
@@ -31,7 +31,11 @@ const L = [
31
31
  label: "",
32
32
  subject: "order",
33
33
  actions: ["update"],
34
- conditions: { operation: "void" },
34
+ // 'void_' (not 'void') — POS saves role/ability data straight to CouchDB, and
35
+ // 'void' is a reserved word in the POS Flutter/Dart client, so the identifier
36
+ // POS actually evaluates against (and sends to the approval-code validate
37
+ // endpoint) is already 'void_'. Keep in sync with approval-code-rules.ts.
38
+ conditions: { operation: "void_" },
35
39
  inverted: !1,
36
40
  reason: null
37
41
  },
@@ -327,7 +331,10 @@ const L = [
327
331
  label: "",
328
332
  subject: "report",
329
333
  actions: ["read"],
330
- conditions: { name: "void" },
334
+ // 'void_' (not 'void') to match the report-query service's permissionKey and the
335
+ // value already persisted in CouchDB — 'void' is a reserved word in the POS
336
+ // Flutter/Dart client. See pos-role.service.ts / pos-role.helpers.ts.
337
+ conditions: { name: "void_" },
331
338
  inverted: !1,
332
339
  reason: ""
333
340
  },
@@ -354,14 +361,14 @@ const L = [
354
361
  async create(e) {
355
362
  return b(await v().post(E, e));
356
363
  },
357
- async update(e, s) {
358
- return b(await v().put(`${E}/${e}`, s));
364
+ async update(e, t) {
365
+ return b(await v().put(`${E}/${e}`, t));
359
366
  },
360
367
  async delete(e) {
361
368
  return b(await v().delete(`${E}/${e}`));
362
369
  }
363
370
  }, se = z("permissionSet", () => {
364
- const { currentBusiness: e } = X(), s = S([]), o = S(!1), n = S(null);
371
+ const { currentBusiness: e } = X(), t = S([]), o = S(!1), n = S(null);
365
372
  async function r() {
366
373
  var l;
367
374
  const c = ((l = e.value) == null ? void 0 : l._id) ?? null;
@@ -369,32 +376,32 @@ const L = [
369
376
  try {
370
377
  o.value = !0;
371
378
  const d = await N.read();
372
- s.value = u(d), n.value = c;
379
+ t.value = u(d), n.value = c;
373
380
  } finally {
374
381
  o.value = !1;
375
382
  }
376
383
  }
377
- async function t(c) {
384
+ async function s(c) {
378
385
  const l = await N.create(c);
379
- s.value = u([...s.value, l]);
386
+ t.value = u([...t.value, l]);
380
387
  }
381
- async function i(c, l) {
388
+ async function a(c, l) {
382
389
  const d = await N.update(c, l);
383
- s.value = u(s.value.map((f) => f.id === c ? d : f));
390
+ t.value = u(t.value.map((m) => m.id === c ? d : m));
384
391
  }
385
- async function a(c) {
386
- await N.delete(c), s.value = u(s.value.filter((l) => l.id !== c));
392
+ async function i(c) {
393
+ await N.delete(c), t.value = u(t.value.filter((l) => l.id !== c));
387
394
  }
388
395
  function u(c) {
389
396
  return c.sort((l, d) => l.name.localeCompare(d.name));
390
397
  }
391
398
  return {
392
- permissionSets: s,
399
+ permissionSets: t,
393
400
  isLoading: o,
394
401
  readPermissionSets: r,
395
- createPermissionSet: t,
396
- updatePermissionSet: i,
397
- deletePermissionSet: a
402
+ createPermissionSet: s,
403
+ updatePermissionSet: a,
404
+ deletePermissionSet: i
398
405
  };
399
406
  }), ne = () => {
400
407
  const e = se();
@@ -419,60 +426,60 @@ function k(e) {
419
426
  }
420
427
  function y(e) {
421
428
  return e ? Object.values(e).every(
422
- (s) => s !== null && typeof s == "object" && !Array.isArray(s) && Object.keys(s).length === 1 && Array.isArray(s.$in)
429
+ (t) => t !== null && typeof t == "object" && !Array.isArray(t) && Object.keys(t).length === 1 && Array.isArray(t.$in)
423
430
  ) : !0;
424
431
  }
425
432
  function Q(e) {
426
- const s = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), n = (r, t, i) => {
427
- var a, u;
428
- const c = k(t.conditions);
429
- let l = `${t.subject}::${JSON.stringify([...t.actions].sort())}`;
433
+ const t = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), n = (r, s, a) => {
434
+ var i, u;
435
+ const c = k(s.conditions);
436
+ let l = `${s.subject}::${JSON.stringify([...s.actions].sort())}`;
430
437
  y(c) || (l += `::${JSON.stringify(c)}`);
431
438
  const d = r.get(l);
432
439
  if (!d) {
433
- r.set(l, { ...t, setNames: [i.name], setId: i._id });
440
+ r.set(l, { ...s, setNames: [a.name], setId: a._id });
434
441
  return;
435
442
  }
436
- d.setNames.push(i.name);
437
- const f = k(d.conditions);
438
- if (!f || !c) {
443
+ d.setNames.push(a.name);
444
+ const m = k(d.conditions);
445
+ if (!m || !c) {
439
446
  d.conditions = void 0;
440
447
  return;
441
448
  }
442
- for (const m in c)
443
- (a = f[m]) != null && a.$in && (u = c[m]) != null && u.$in ? f[m].$in = Array.from(
444
- /* @__PURE__ */ new Set([...f[m].$in, ...c[m].$in])
445
- ) : f[m] || (f[m] = c[m]);
446
- d.conditions = JSON.stringify(f);
449
+ for (const f in c)
450
+ (i = m[f]) != null && i.$in && (u = c[f]) != null && u.$in ? m[f].$in = Array.from(
451
+ /* @__PURE__ */ new Set([...m[f].$in, ...c[f].$in])
452
+ ) : m[f] || (m[f] = c[f]);
453
+ d.conditions = JSON.stringify(m);
447
454
  };
448
455
  for (const r of e)
449
- for (const t of r.permissions)
450
- n(t.inverted ? o : s, t, r);
451
- return [...Array.from(s.values()), ...Array.from(o.values())];
456
+ for (const s of r.permissions)
457
+ n(s.inverted ? o : t, s, r);
458
+ return [...Array.from(t.values()), ...Array.from(o.values())];
452
459
  }
453
- function B(e, s) {
454
- return `${e}::${[...s].sort().join(",")}`;
460
+ function B(e, t) {
461
+ return `${e}::${[...t].sort().join(",")}`;
455
462
  }
456
- function G(e, s) {
457
- const o = [...e], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set();
458
- for (const a of e) {
459
- const u = O(a.subject);
460
- n.add(B(u, a.actions)), a.inverted && a.actions.includes("manage") && r.add(`set_${u}`), !a.inverted && a.actions.includes("manage") && t.add(u);
463
+ function G(e, t) {
464
+ const o = [...e], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
465
+ for (const i of e) {
466
+ const u = O(i.subject);
467
+ n.add(B(u, i.actions)), i.inverted && i.actions.includes("manage") && r.add(`set_${u}`), !i.inverted && i.actions.includes("manage") && s.add(u);
461
468
  }
462
- const i = [...e];
463
- for (; i.length > 0; ) {
464
- const a = i.shift(), u = `set_${O(a.subject)}`, c = s[u];
465
- if (!c || r.has(u) || !a.actions.includes("manage") || a.inverted) continue;
469
+ const a = [...e];
470
+ for (; a.length > 0; ) {
471
+ const i = a.shift(), u = `set_${O(i.subject)}`, c = t[u];
472
+ if (!c || r.has(u) || !i.actions.includes("manage") || i.inverted) continue;
466
473
  r.add(u);
467
- const l = oe(a);
468
- a.source && !a.source.trace && (a.source = { ...a.source, trace: l });
474
+ const l = oe(i);
475
+ i.source && !i.source.trace && (i.source = { ...i.source, trace: l });
469
476
  const d = [...l, `${c.name} (system)`];
470
- for (const f of c.permissions ?? []) {
471
- const m = O(f.subject), p = B(m, f.actions);
472
- n.has(p) || t.has(m) || (n.add(p), o.push({
473
- ...f,
477
+ for (const m of c.permissions ?? []) {
478
+ const f = O(m.subject), p = B(f, m.actions);
479
+ n.has(p) || s.has(f) || (n.add(p), o.push({
480
+ ...m,
474
481
  // FdoPermissionRule.fields is string[] | null; RawRule expects string[] | undefined
475
- fields: f.fields ?? void 0,
482
+ fields: m.fields ?? void 0,
476
483
  source: {
477
484
  type: "systemPermissionSet",
478
485
  permissionSetId: c.key,
@@ -481,9 +488,9 @@ function G(e, s) {
481
488
  }
482
489
  }));
483
490
  }
484
- for (const f of c.permissionSets ?? []) {
485
- const m = O(f), p = B(m, ["manage"]), g = {
486
- subject: m,
491
+ for (const m of c.permissionSets ?? []) {
492
+ const f = O(m), p = B(f, ["manage"]), g = {
493
+ subject: f,
487
494
  actions: ["manage"],
488
495
  source: {
489
496
  type: "systemPermissionSet",
@@ -492,16 +499,16 @@ function G(e, s) {
492
499
  trace: d
493
500
  }
494
501
  };
495
- n.has(p) || (n.add(p), o.push(g)), i.push(g);
502
+ n.has(p) || (n.add(p), o.push(g)), a.push(g);
496
503
  }
497
504
  }
498
- return [...o.filter((a) => !a.inverted), ...o.filter((a) => a.inverted)];
505
+ return [...o.filter((i) => !i.inverted), ...o.filter((i) => i.inverted)];
499
506
  }
500
507
  function oe(e) {
501
508
  if (!e.source) return [];
502
- const { type: s, trace: o, permissionSetName: n } = e.source;
509
+ const { type: t, trace: o, permissionSetName: n } = e.source;
503
510
  if (o && o.length > 0) return o;
504
- switch (s) {
511
+ switch (t) {
505
512
  case "permissionSet":
506
513
  return n ? [n] : [];
507
514
  case "custom":
@@ -510,43 +517,43 @@ function oe(e) {
510
517
  return [];
511
518
  }
512
519
  }
513
- function H(e, s, o = /* @__PURE__ */ new Set()) {
520
+ function H(e, t, o = /* @__PURE__ */ new Set()) {
514
521
  var r;
515
522
  const n = [];
516
- for (const t of e) {
517
- if (o.has(t)) continue;
518
- o.add(t);
519
- const i = s.find((a) => a.id === t);
520
- i && (n.push(i), (r = i.permissionSetIds) != null && r.length && n.push(...H(i.permissionSetIds, s, o)));
523
+ for (const s of e) {
524
+ if (o.has(s)) continue;
525
+ o.add(s);
526
+ const a = t.find((i) => i.id === s);
527
+ a && (n.push(a), (r = a.permissionSetIds) != null && r.length && n.push(...H(a.permissionSetIds, t, o)));
521
528
  }
522
529
  return n;
523
530
  }
524
531
  function Ie(e) {
525
- const s = Q(e).map(
526
- ({ setNames: r, setId: t, ...i }) => i
527
- ), o = s.filter((r) => !r.inverted), n = s.filter((r) => r.inverted);
532
+ const t = Q(e).map(
533
+ ({ setNames: r, setId: s, ...a }) => a
534
+ ), o = t.filter((r) => !r.inverted), n = t.filter((r) => r.inverted);
528
535
  return M(o, n);
529
536
  }
530
- function Ae(e, s, o) {
537
+ function Ae(e, t, o) {
531
538
  const n = /* @__PURE__ */ new Map();
532
539
  return e.forEach(
533
- ({ name: r, permissions: t }) => t.forEach(({ conditions: i, actions: a }) => {
540
+ ({ name: r, permissions: s }) => s.forEach(({ conditions: a, actions: i }) => {
534
541
  var c, l;
535
- const u = JSON.parse(i || "{}");
536
- (c = u[s]) != null && c.$in ? (l = u[s]) == null || l.$in.forEach(
542
+ const u = JSON.parse(a || "{}");
543
+ (c = u[t]) != null && c.$in ? (l = u[t]) == null || l.$in.forEach(
537
544
  (d) => (n.get(d) ?? n.set(d, /* @__PURE__ */ new Set()).get(d)).add(r)
538
- ) : a[0] === "manage" && o.forEach((d) => {
545
+ ) : i[0] === "manage" && o.forEach((d) => {
539
546
  (n.get(d) ?? n.set(d, /* @__PURE__ */ new Set()).get(d)).add(r);
540
547
  });
541
548
  })
542
- ), [...n].map(([r, t]) => ({
549
+ ), [...n].map(([r, s]) => ({
543
550
  id: r,
544
- setNames: [...t]
551
+ setNames: [...s]
545
552
  }));
546
553
  }
547
- function Oe(e, s) {
548
- const o = (a, u) => {
549
- const c = { ...a }, l = JSON.parse(c.conditions || "{}");
554
+ function Oe(e, t) {
555
+ const o = (i, u) => {
556
+ const c = { ...i }, l = JSON.parse(c.conditions || "{}");
550
557
  if (u)
551
558
  if (u.length > 0) {
552
559
  const d = Object.keys(l)[0];
@@ -558,45 +565,45 @@ function Oe(e, s) {
558
565
  inverted: !0,
559
566
  ...c.conditions && { conditions: JSON.stringify(l) }
560
567
  };
561
- }, n = new Map(e.map((a) => [a.subject, a])), r = new Map(s.map((a) => [a.subject, a])), t = [], i = /* @__PURE__ */ new Set([...n.keys(), ...r.keys()]);
562
- for (const a of i) {
563
- const u = n.get(a), c = r.get(a);
568
+ }, n = new Map(e.map((i) => [i.subject, i])), r = new Map(t.map((i) => [i.subject, i])), s = [], a = /* @__PURE__ */ new Set([...n.keys(), ...r.keys()]);
569
+ for (const i of a) {
570
+ const u = n.get(i), c = r.get(i);
564
571
  if (u && c) {
565
572
  if (u.conditions && c.conditions) {
566
573
  const l = JSON.parse(u.conditions), d = JSON.parse(c.conditions);
567
574
  if (!y(l) || !y(d)) {
568
- JSON.stringify(l) !== JSON.stringify(d) && t.push(c);
575
+ JSON.stringify(l) !== JSON.stringify(d) && s.push(c);
569
576
  continue;
570
577
  }
571
- const f = Object.keys(l)[0], m = l[f].$in.filter(
572
- (g) => !d[f].$in.includes(g)
578
+ const m = Object.keys(l)[0], f = l[m].$in.filter(
579
+ (g) => !d[m].$in.includes(g)
573
580
  );
574
- m.length > 0 && t.push(o(u, m)), d[f].$in.filter(
575
- (g) => !l[f].$in.includes(g)
576
- ).length > 0 && t.push(c);
581
+ f.length > 0 && s.push(o(u, f)), d[m].$in.filter(
582
+ (g) => !l[m].$in.includes(g)
583
+ ).length > 0 && s.push(c);
577
584
  } else if (!u.conditions && c.conditions)
578
- t.push(c);
585
+ s.push(c);
579
586
  else if (u.conditions && !c.conditions)
580
- y(JSON.parse(u.conditions)) || t.push(c);
587
+ y(JSON.parse(u.conditions)) || s.push(c);
581
588
  else if (!u.conditions && !c.conditions) {
582
- 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));
583
- if (f) {
589
+ 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));
590
+ if (m) {
584
591
  const p = c.actions.filter((g) => !l.has(g));
585
- t.push({
592
+ s.push({
586
593
  ...c,
587
594
  actions: p
588
595
  });
589
596
  }
590
- m.length > 0 && t.push({
597
+ f.length > 0 && s.push({
591
598
  ...u,
592
- actions: m,
599
+ actions: f,
593
600
  inverted: !0
594
601
  });
595
602
  }
596
603
  continue;
597
604
  }
598
605
  if (u) {
599
- t.push(
606
+ s.push(
600
607
  o(
601
608
  u,
602
609
  // If base has conditions, set diffIds to empty array, disallow all access to collection
@@ -606,122 +613,122 @@ function Oe(e, s) {
606
613
  );
607
614
  continue;
608
615
  }
609
- c && t.push(c);
616
+ c && s.push(c);
610
617
  }
611
- return t;
618
+ return s;
612
619
  }
613
620
  function _e(e) {
614
- const s = G(
621
+ const t = G(
615
622
  e,
616
623
  V
617
624
  ), o = new Set(
618
- s.filter((r) => {
619
- var t;
620
- return ((t = r.source) == null ? void 0 : t.type) === "systemPermissionSet" && !r.inverted;
625
+ t.filter((r) => {
626
+ var s;
627
+ return ((s = r.source) == null ? void 0 : s.type) === "systemPermissionSet" && !r.inverted;
621
628
  }).map((r) => r.subject)
622
629
  ), n = new Set(
623
- s.filter(
630
+ t.filter(
624
631
  (r) => {
625
- var t;
626
- return ((t = r.source) == null ? void 0 : t.type) === "systemPermissionSet" && !r.inverted && r.actions.includes("manage");
632
+ var s;
633
+ return ((s = r.source) == null ? void 0 : s.type) === "systemPermissionSet" && !r.inverted && r.actions.includes("manage");
627
634
  }
628
635
  ).map((r) => r.subject)
629
636
  );
630
637
  return e.filter((r) => r.inverted ? !(o.has(r.subject) && !n.has(r.subject)) : !o.has(r.subject));
631
638
  }
632
639
  const re = "business::report::";
633
- function Ee(e, s) {
640
+ function Ee(e, t) {
634
641
  const o = [], n = e.filter((r) => {
635
- const t = r.subject;
636
- return !t.startsWith(re) || s.has(t) ? !0 : (o.push(t), !1);
642
+ const s = r.subject;
643
+ return !s.startsWith(re) || t.has(s) ? !0 : (o.push(s), !1);
637
644
  });
638
645
  return o.length > 0 && console.warn("[filterStalePermissions] dropped stale report permissions:", o), n;
639
646
  }
640
647
  const ie = "business::report::reports::", ae = _.Subject.Business.report_reports_allDefaultReports, ce = _.Subject.Business.report_reports_allCustomReports;
641
- function ue(e, s) {
642
- return e.conditions ? !!s.conditions && e.conditions === s.conditions : !s.conditions;
648
+ function ue(e, t) {
649
+ return e.conditions ? !!t.conditions && e.conditions === t.conditions : !t.conditions;
643
650
  }
644
- function Ne(e, s) {
651
+ function Ne(e, t) {
645
652
  const o = e.find(
646
- (i) => !i.inverted && i.subject === ae
653
+ (a) => !a.inverted && a.subject === ae
647
654
  ), n = e.find(
648
- (i) => !i.inverted && i.subject === ce
655
+ (a) => !a.inverted && a.subject === ce
649
656
  );
650
657
  if (!o && !n) return e;
651
- const r = o ? new Set(o.actions) : null, t = n ? new Set(n.actions) : null;
652
- return e.reduce((i, a) => {
653
- if (a.inverted)
654
- return i.push(a), i;
655
- const u = a.subject;
658
+ const r = o ? new Set(o.actions) : null, s = n ? new Set(n.actions) : null;
659
+ return e.reduce((a, i) => {
660
+ if (i.inverted)
661
+ return a.push(i), a;
662
+ const u = i.subject;
656
663
  if (!u.startsWith(ie))
657
- return i.push(a), i;
658
- const c = s.has(u), l = c ? r : t, d = c ? o : n;
659
- if (!l || !d || !ue(d, a))
660
- return i.push(a), i;
661
- if (l.has("manage")) return i;
662
- const f = a.actions;
663
- if (f.includes("manage"))
664
- return i.push(a), i;
665
- const m = new Set(f);
664
+ return a.push(i), a;
665
+ const c = t.has(u), l = c ? r : s, d = c ? o : n;
666
+ if (!l || !d || !ue(d, i))
667
+ return a.push(i), a;
668
+ if (l.has("manage")) return a;
669
+ const m = i.actions;
670
+ if (m.includes("manage"))
671
+ return a.push(i), a;
672
+ const f = new Set(m);
666
673
  for (const p of l)
667
- m.delete(p);
668
- return m.size === 0 || i.push({ ...a, actions: Array.from(m) }), i;
674
+ f.delete(p);
675
+ return f.size === 0 || a.push({ ...i, actions: Array.from(f) }), a;
669
676
  }, []);
670
677
  }
671
- function M(e, s) {
678
+ function M(e, t) {
672
679
  var n, r;
673
- const o = new Map(e.map((t) => [t.subject, t]));
674
- for (const t of s) {
675
- if (t.inverted) {
676
- const a = o.get(t.subject);
677
- if (t.conditions) {
678
- if (a != null && a.conditions) {
679
- const u = JSON.parse(a.conditions), c = JSON.parse(t.conditions);
680
+ const o = new Map(e.map((s) => [s.subject, s]));
681
+ for (const s of t) {
682
+ if (s.inverted) {
683
+ const i = o.get(s.subject);
684
+ if (s.conditions) {
685
+ if (i != null && i.conditions) {
686
+ const u = JSON.parse(i.conditions), c = JSON.parse(s.conditions);
680
687
  if (!y(u) || !y(c)) {
681
- o.delete(t.subject);
688
+ o.delete(s.subject);
682
689
  continue;
683
690
  }
684
- const l = Object.keys(c)[0], d = ((n = c[l]) == null ? void 0 : n.$in) ?? [], m = (((r = u[l]) == null ? void 0 : r.$in) ?? []).filter((p) => !d.includes(p));
685
- m.length > 0 ? o.set(t.subject, {
686
- ...a,
687
- conditions: JSON.stringify({ [l]: { $in: m } })
688
- }) : o.delete(t.subject);
691
+ const l = Object.keys(c)[0], d = ((n = c[l]) == null ? void 0 : n.$in) ?? [], f = (((r = u[l]) == null ? void 0 : r.$in) ?? []).filter((p) => !d.includes(p));
692
+ f.length > 0 ? o.set(s.subject, {
693
+ ...i,
694
+ conditions: JSON.stringify({ [l]: { $in: f } })
695
+ }) : o.delete(s.subject);
689
696
  } else
690
- o.delete(t.subject);
697
+ o.delete(s.subject);
691
698
  continue;
692
699
  }
693
- if (a) {
694
- const u = new Set(t.actions), c = a.actions.filter((l) => !u.has(l));
695
- c.length > 0 ? o.set(t.subject, { ...a, actions: c }) : o.delete(t.subject);
700
+ if (i) {
701
+ const u = new Set(s.actions), c = i.actions.filter((l) => !u.has(l));
702
+ c.length > 0 ? o.set(s.subject, { ...i, actions: c }) : o.delete(s.subject);
696
703
  continue;
697
704
  }
698
705
  continue;
699
706
  }
700
- if (t.conditions) {
701
- o.set(t.subject, t);
707
+ if (s.conditions) {
708
+ o.set(s.subject, s);
702
709
  continue;
703
710
  }
704
- const i = o.get(t.subject);
705
- if (i != null && i.conditions && !y(JSON.parse(i.conditions))) {
706
- o.set(t.subject, t);
711
+ const a = o.get(s.subject);
712
+ if (a != null && a.conditions && !y(JSON.parse(a.conditions))) {
713
+ o.set(s.subject, s);
707
714
  continue;
708
715
  }
709
- if (i) {
710
- const a = [
716
+ if (a) {
717
+ const i = [
711
718
  .../* @__PURE__ */ new Set([
712
- ...i.actions,
713
- ...t.actions
719
+ ...a.actions,
720
+ ...s.actions
714
721
  ])
715
722
  ];
716
- o.set(t.subject, { ...i, actions: a });
723
+ o.set(s.subject, { ...a, actions: i });
717
724
  } else
718
- o.set(t.subject, t);
725
+ o.set(s.subject, s);
719
726
  }
720
727
  return Array.from(o.values());
721
728
  }
722
- function le(e, s) {
723
- const o = M(e, s), n = new Set(e.map((t) => t.subject)), r = s.filter(
724
- (t) => t.inverted && !n.has(t.subject)
729
+ function le(e, t) {
730
+ const o = M(e, t), n = new Set(e.map((s) => s.subject)), r = t.filter(
731
+ (s) => s.inverted && !n.has(s.subject)
725
732
  );
726
733
  return [...o, ...r];
727
734
  }
@@ -738,64 +745,64 @@ const P = "/permission-assignments", R = {
738
745
  async create(e) {
739
746
  return b(await v().post(P, e));
740
747
  },
741
- async update(e, s) {
742
- return b(await v().put(`${P}/${e}`, s));
748
+ async update(e, t) {
749
+ return b(await v().put(`${P}/${e}`, t));
743
750
  },
744
751
  async delete(e) {
745
752
  return b(await v().delete(`${P}/${e}`));
746
753
  },
747
- async addReportManagePermission(e, s) {
754
+ async addReportManagePermission(e, t) {
748
755
  return b(
749
- await v().post("/my-permissions/report-manage", { permissionKey: e, label: s })
756
+ await v().post("/my-permissions/report-manage", { permissionKey: e, label: t })
750
757
  );
751
758
  }
752
759
  }, de = z("permissionAssignment", () => {
753
760
  const e = S([]);
754
- async function s() {
755
- const a = await R.readAll();
756
- e.value = a;
761
+ async function t() {
762
+ const i = await R.readAll();
763
+ e.value = i;
757
764
  }
758
- async function o(a) {
759
- return await R.readByUserId(a);
765
+ async function o(i) {
766
+ return await R.readByUserId(i);
760
767
  }
761
- async function n(a) {
762
- const u = await R.create(a);
768
+ async function n(i) {
769
+ const u = await R.create(i);
763
770
  e.value = [...e.value, u];
764
771
  }
765
- async function r(a, u) {
766
- const c = await R.update(a, u);
767
- e.value = e.value.map((l) => l.id === a ? c : l);
772
+ async function r(i, u) {
773
+ const c = await R.update(i, u);
774
+ e.value = e.value.map((l) => l.id === i ? c : l);
768
775
  }
769
- async function t(a) {
770
- await R.delete(a), e.value = e.value.filter((u) => u.id !== a);
776
+ async function s(i) {
777
+ await R.delete(i), e.value = e.value.filter((u) => u.id !== i);
771
778
  }
772
- function i(a) {
773
- return e.value.find((u) => u.userId === a);
779
+ function a(i) {
780
+ return e.value.find((u) => u.userId === i);
774
781
  }
775
782
  return {
776
783
  permissionAssignments: e,
777
- readPermissionAssignments: s,
784
+ readPermissionAssignments: t,
778
785
  readPermissionAssignmentByUserId: o,
779
786
  createPermissionAssignment: n,
780
787
  updatePermissionAssignment: r,
781
- deletePermissionAssignment: t,
782
- getPermissionAssignmentByUserId: i
788
+ deletePermissionAssignment: s,
789
+ getPermissionAssignmentByUserId: a
783
790
  };
784
- }), fe = () => {
791
+ }), me = () => {
785
792
  const e = de();
786
793
  return {
787
794
  ...e,
788
795
  ...K(e)
789
796
  };
790
- }, me = {
791
- async fetchReportPermissions(e, s) {
792
- const o = s ? { lang: s } : {};
797
+ }, fe = {
798
+ async fetchReportPermissions(e, t) {
799
+ const o = t ? { lang: t } : {};
793
800
  return b(
794
801
  await x().get(`/report-query/hrm/${e}/reports`, { params: o })
795
802
  );
796
803
  },
797
- async fetchReportPermissionsForPortal(e, s) {
798
- const o = s ? { isSupportPos: !1, lang: s } : { isSupportPos: !1 };
804
+ async fetchReportPermissionsForPortal(e, t) {
805
+ const o = t ? { isSupportPos: !1, lang: t } : { isSupportPos: !1 };
799
806
  return b(
800
807
  await x().get(`/report-query/hrm/${e}/reports`, { params: o })
801
808
  );
@@ -803,9 +810,9 @@ const P = "/permission-assignments", R = {
803
810
  }, C = S([]), T = S(!1), $ = S(!1), I = S(null), D = S(null), J = S(!1);
804
811
  function pe() {
805
812
  const e = X();
806
- async function s() {
807
- var t;
808
- const n = (t = e.currentBusiness.value) == null ? void 0 : t.id;
813
+ async function t() {
814
+ var s;
815
+ const n = (s = e.currentBusiness.value) == null ? void 0 : s.id;
809
816
  if (!n) return;
810
817
  const r = localStorage.getItem("locale");
811
818
  if (I.value !== n && (C.value = [], T.value = !1, $.value = !1, I.value = n, J.value = !1), !(T.value && D.value === r)) {
@@ -815,14 +822,14 @@ function pe() {
815
822
  }
816
823
  $.value = !0;
817
824
  try {
818
- const i = await me.fetchReportPermissionsForPortal(n, r);
825
+ const a = await fe.fetchReportPermissionsForPortal(n, r);
819
826
  if (I.value !== n) return;
820
- C.value = i, T.value = !0, D.value = r;
821
- } catch (i) {
827
+ C.value = a, T.value = !0, D.value = r;
828
+ } catch (a) {
822
829
  if (I.value !== n) return;
823
- console.warn("Failed to fetch custom report permissions:", i), C.value = [];
830
+ console.warn("Failed to fetch custom report permissions:", a), C.value = [];
824
831
  } finally {
825
- I.value === n && ($.value = !1, J.value && (J.value = !1, await s()));
832
+ I.value === n && ($.value = !1, J.value && (J.value = !1, await t()));
826
833
  }
827
834
  }
828
835
  }
@@ -846,25 +853,25 @@ function pe() {
846
853
  }
847
854
  ));
848
855
  return {
849
- fetchCustomReportPermissions: s,
856
+ fetchCustomReportPermissions: t,
850
857
  customReportPermissions: o,
851
858
  isLoading: U(() => $.value),
852
859
  isLoaded: U(() => T.value)
853
860
  };
854
861
  }
855
862
  function A(e) {
856
- const s = ne(), o = fe(), n = te().restaurants, { customReportPermissions: r } = pe(), t = o.getPermissionAssignmentByUserId(e.id), i = H(
857
- (t == null ? void 0 : t.permissionSetIds) ?? [],
858
- s.permissionSets.value
859
- ), a = Q(i).map(
863
+ const t = ne(), o = me(), n = te().restaurants, { customReportPermissions: r } = pe(), s = o.getPermissionAssignmentByUserId(e.id), a = H(
864
+ (s == null ? void 0 : s.permissionSetIds) ?? [],
865
+ t.permissionSets.value
866
+ ), i = Q(a).map(
860
867
  ({ setNames: p, ...g }) => g
861
- ), u = t == null ? void 0 : t.customPermissions, c = u ?? e.permissions.map((p) => ({
868
+ ), u = s == null ? void 0 : s.customPermissions, c = u ?? e.permissions.map((p) => ({
862
869
  ...p,
863
870
  subject: O(p.subject)
864
- })), l = M(a, c), d = G(
865
- le(a, c),
871
+ })), l = M(i, c), d = G(
872
+ le(i, c),
866
873
  V
867
- ).filter((p) => !p.inverted), f = ve(d), m = f ?? n.value.map((p) => p._id);
874
+ ).filter((p) => !p.inverted), m = ve(d), f = m ?? n.value.map((p) => p._id);
868
875
  return {
869
876
  doc: e,
870
877
  id: e.id,
@@ -872,12 +879,12 @@ function A(e) {
872
879
  phoneNumber: e.phoneNumber,
873
880
  email: e.email,
874
881
  restaurants: W(
875
- m.map((p) => {
882
+ f.map((p) => {
876
883
  var g;
877
884
  return ((g = n.value.find((Y) => Y._id === p)) == null ? void 0 : g.profile.name) ?? "";
878
885
  })
879
886
  ),
880
- managableRestaurantIds: f,
887
+ managableRestaurantIds: m,
881
888
  permissionLabels: Se(d, r.value),
882
889
  permissions: l
883
890
  };
@@ -892,7 +899,7 @@ const be = Object.freeze(
892
899
  },
893
900
  async readTeamMembersPage(e) {
894
901
  var o, n, r;
895
- const s = b(
902
+ const t = b(
896
903
  await v().get("/portal-users/paged", {
897
904
  params: {
898
905
  limit: e.limit,
@@ -905,8 +912,8 @@ const be = Object.freeze(
905
912
  })
906
913
  );
907
914
  return {
908
- items: s.items.map(A),
909
- total: s.total
915
+ items: t.items.map(A),
916
+ total: t.total
910
917
  };
911
918
  },
912
919
  async readTeamMember(e) {
@@ -919,33 +926,33 @@ const be = Object.freeze(
919
926
  b(await v().post("/portal-users", e))
920
927
  );
921
928
  },
922
- async updateTeamMember(e, s) {
929
+ async updateTeamMember(e, t) {
923
930
  return A(
924
- b(await v().put(`/portal-users/${e}`, s))
931
+ b(await v().put(`/portal-users/${e}`, t))
925
932
  );
926
933
  },
927
934
  async deleteTeamMember(e) {
928
935
  return b(await v().delete(`/portal-users/${e}`));
929
936
  },
930
937
  async readTeamMemberPosUserIds() {
931
- return b(await v().get("/portal-users")).map((s) => s.posUserId);
938
+ return b(await v().get("/portal-users")).map((t) => t.posUserId);
932
939
  }
933
940
  };
934
- function Te(e, s, o) {
935
- if (e.some((i) => i.subject === "all")) return "All";
941
+ function Te(e, t, o) {
942
+ if (e.some((a) => a.subject === "all")) return "All";
936
943
  const n = (o ?? L).filter(
937
- (i) => i.subject === s
938
- ), r = new Set(n.map((i) => w(i).value)), t = e.filter((i) => i.subject === s).filter((i) => r.has(w(i).value));
939
- return t.length === n.length ? "All" : t.length === 0 ? "-" : `${t.length} permission allow`;
944
+ (a) => a.subject === t
945
+ ), r = new Set(n.map((a) => w(a).value)), s = e.filter((a) => a.subject === t).filter((a) => r.has(w(a).value));
946
+ return s.length === n.length ? "All" : s.length === 0 ? "-" : `${s.length} permission allow`;
940
947
  }
941
948
  function w(e) {
942
- const s = Z(e), o = s.subject;
949
+ const t = Z(e), o = t.subject;
943
950
  return {
944
- ...s,
951
+ ...t,
945
952
  get conditions() {
946
- if (typeof s.conditions != "string") return s.conditions;
953
+ if (typeof t.conditions != "string") return t.conditions;
947
954
  try {
948
- return JSON.parse(s.conditions);
955
+ return JSON.parse(t.conditions);
949
956
  } catch {
950
957
  return;
951
958
  }
@@ -960,72 +967,92 @@ function w(e) {
960
967
  get isReportPermission() {
961
968
  return o === h.F_RULE_SUBJECT.enum.report;
962
969
  },
970
+ /**
971
+ * Order and report rules are only meaningful together with the condition
972
+ * that names them. A rule missing it cannot be rendered or matched against
973
+ * the available permission list, so callers must preserve it verbatim —
974
+ * see `splitRoleFormPermissions`, which routes it to `passthrough`, not
975
+ * `dropped`. Dropping it would silently revoke a grant the portal cannot
976
+ * display (HRM-0027).
977
+ */
978
+ get isResolvable() {
979
+ return this.discriminator !== void 0;
980
+ },
981
+ /**
982
+ * The condition value that identifies this rule, if the subject needs one.
983
+ * An empty condition counts as missing: `{ name: '' }` is a known corrupted
984
+ * shape that used to resolve to the first hardcoded report permission on
985
+ * save (HRM-0027), so it must not look resolvable here either.
986
+ */
987
+ get discriminator() {
988
+ var n, r;
989
+ return this.isOrderOperation ? ((n = this.conditions) == null ? void 0 : n.operation) || void 0 : this.isReportPermission ? ((r = this.conditions) == null ? void 0 : r.name) || void 0 : o.toString();
990
+ },
963
991
  get formatted() {
964
- var r, t;
965
- const n = (i) => i.endsWith("_") ? i.slice(0, i.length - 1) : i;
966
- return this.isOrderOperation ? n(((r = this.conditions) == null ? void 0 : r.operation) ?? "") : this.isReportPermission ? n(((t = this.conditions) == null ? void 0 : t.name) ?? "") : o.toString();
992
+ const n = this.discriminator;
993
+ return n === void 0 ? o.toString() : n.endsWith("_") ? n.slice(0, n.length - 1) : n;
967
994
  },
968
995
  get label() {
969
- return s.label || ee(this.formatted);
996
+ return t.label || ee(this.formatted);
970
997
  },
971
998
  get value() {
972
- var n, r;
973
- return this.isOrderOperation ? `${o}:${(n = this.conditions) == null ? void 0 : n.operation}` : this.isReportPermission ? `${o}:${(r = this.conditions) == null ? void 0 : r.name}` : o.toString();
999
+ const n = this.discriminator;
1000
+ return this.isOrderOperation || this.isReportPermission ? n === void 0 ? o.toString() : `${o}:${n}` : o.toString();
974
1001
  }
975
1002
  };
976
1003
  }
977
1004
  function Je(e) {
978
1005
  var n, r;
979
- const s = e.map((t) => w(t)).find((t) => t.isDiscountOperation);
980
- if (!s) return 100;
981
- const o = Number((r = (n = s.conditions) == null ? void 0 : n.adjustment) == null ? void 0 : r.$lte);
1006
+ const t = e.map((s) => w(s)).find((s) => s.isDiscountOperation);
1007
+ if (!t) return 100;
1008
+ const o = Number((r = (n = t.conditions) == null ? void 0 : n.adjustment) == null ? void 0 : r.$lte);
982
1009
  return Number.isFinite(o) ? parseInt((o * 100).toFixed(0)) : 0;
983
1010
  }
984
1011
  function ve(e) {
985
- const s = e.find(
1012
+ const t = e.find(
986
1013
  (o) => o.subject === _.Subject.Restaurant.restaurant
987
1014
  );
988
- return s ? s.conditions ? JSON.parse(s.conditions).restaurantId.$in : null : [];
1015
+ return t ? t.conditions ? JSON.parse(t.conditions).restaurantId.$in : null : [];
989
1016
  }
990
1017
  function Ue(e) {
991
- return (e == null ? void 0 : e.some((s) => s.subject === "all")) ?? !1;
1018
+ return (e == null ? void 0 : e.some((t) => t.subject === "all")) ?? !1;
992
1019
  }
993
1020
  function Be(e) {
994
- const s = e.find((o) => o.subject === _.Subject.Business.role);
995
- return s ? s.conditions ? JSON.parse(s.conditions).roleId.$in : null : [];
1021
+ const t = e.find((o) => o.subject === _.Subject.Business.role);
1022
+ return t ? t.conditions ? JSON.parse(t.conditions).roleId.$in : null : [];
996
1023
  }
997
1024
  function Le(e) {
998
- const s = w(e);
999
- if (!s.isReportPermission) return;
1000
- const { name: o, ...n } = s.conditions ?? {};
1025
+ const t = w(e);
1026
+ if (!t.isReportPermission) return;
1027
+ const { name: o, ...n } = t.conditions ?? {};
1001
1028
  return Object.keys(n).length > 0 ? n : void 0;
1002
1029
  }
1003
- function Me(e, s, o) {
1030
+ function Me(e, t, o) {
1004
1031
  return e.flatMap((n) => {
1005
1032
  const r = ge(n);
1006
1033
  if (!r) return [];
1007
- const t = r.isReportPermission ? o == null ? void 0 : o.get(n) : void 0;
1034
+ const s = r.isReportPermission ? o == null ? void 0 : o.get(n) : void 0;
1008
1035
  return [
1009
1036
  {
1010
1037
  subject: r.subject,
1011
1038
  actions: r.actions,
1012
1039
  conditions: {
1013
1040
  ...r.conditions,
1014
- ...t ?? {},
1015
- adjustment: r.isDiscountOperation ? { $lte: parseFloat((s / 100).toFixed(2)) } : void 0
1041
+ ...s ?? {},
1042
+ adjustment: r.isDiscountOperation ? { $lte: parseFloat((t / 100).toFixed(2)) } : void 0
1016
1043
  }
1017
1044
  }
1018
1045
  ];
1019
1046
  });
1020
1047
  }
1021
1048
  function ge(e) {
1022
- const s = e.indexOf(":"), o = s === -1 ? e : e.slice(0, s), n = s === -1 ? void 0 : e.slice(s + 1);
1023
- if (s !== -1 && !n) return;
1049
+ const t = e.indexOf(":"), o = t === -1 ? e : e.slice(0, t), n = t === -1 ? void 0 : e.slice(t + 1);
1050
+ if (t !== -1 && !n) return;
1024
1051
  let r;
1025
- return n ? (r = L.find((t) => {
1026
- if (t.subject !== o) return !1;
1027
- const i = typeof t.conditions == "string" ? JSON.parse(t.conditions) : t.conditions;
1028
- return [i == null ? void 0 : i.operation, i == null ? void 0 : i.name].includes(n);
1052
+ return n ? (r = L.find((s) => {
1053
+ if (s.subject !== o) return !1;
1054
+ const a = typeof s.conditions == "string" ? JSON.parse(s.conditions) : s.conditions;
1055
+ return [a == null ? void 0 : a.operation, a == null ? void 0 : a.name].includes(n);
1029
1056
  }), !r && o === h.F_RULE_SUBJECT.enum.report && (r = {
1030
1057
  label: "",
1031
1058
  subject: h.F_RULE_SUBJECT.enum.report,
@@ -1033,9 +1060,9 @@ function ge(e) {
1033
1060
  conditions: { name: n },
1034
1061
  inverted: !1,
1035
1062
  reason: ""
1036
- })) : r = L.find((t) => t.subject === o), r ? w(r) : void 0;
1063
+ })) : r = L.find((s) => s.subject === o), r ? w(r) : void 0;
1037
1064
  }
1038
- function Fe(e, s) {
1065
+ function Fe(e, t) {
1039
1066
  const o = { values: [], passthrough: [], dropped: [] };
1040
1067
  for (const n of e) {
1041
1068
  const r = n == null ? void 0 : n.actions;
@@ -1043,20 +1070,20 @@ function Fe(e, s) {
1043
1070
  o.dropped.push(n);
1044
1071
  continue;
1045
1072
  }
1046
- const t = w(n).value, i = `${h.F_RULE_SUBJECT.enum.report}:`, a = t.startsWith(i) ? t.slice(i.length) : "";
1047
- s.has(t) || a && a !== "undefined" ? o.values.push(t) : o.passthrough.push(n);
1073
+ const s = w(n).value, a = `${h.F_RULE_SUBJECT.enum.report}:`, i = s.startsWith(a) ? s.slice(a.length) : "";
1074
+ t.has(s) || i && i !== "undefined" ? o.values.push(s) : o.passthrough.push(n);
1048
1075
  }
1049
1076
  return o;
1050
1077
  }
1051
- function Se(e, s = []) {
1078
+ function Se(e, t = []) {
1052
1079
  return W(
1053
1080
  e.reduce((o, n) => {
1054
1081
  const r = be.find(
1055
- (t) => t.subject === n.subject && n.actions.includes("manage")
1056
- ) || s.find((t) => t.subject === n.subject);
1082
+ (s) => s.subject === n.subject && n.actions.includes("manage")
1083
+ ) || t.find((s) => s.subject === n.subject);
1057
1084
  if (r) {
1058
- const t = r.subject === _.Subject.Business.inventory_stock ? "Warehouse Management" : r.label;
1059
- o.push(t);
1085
+ const s = r.subject === _.Subject.Business.inventory_stock ? "Warehouse Management" : r.label;
1086
+ o.push(s);
1060
1087
  }
1061
1088
  return o;
1062
1089
  }, [])
@@ -1065,7 +1092,7 @@ function Se(e, s = []) {
1065
1092
  export {
1066
1093
  G as N,
1067
1094
  Q as P,
1068
- me as R,
1095
+ fe as R,
1069
1096
  Le as a,
1070
1097
  Te as b,
1071
1098
  H as c,
@@ -1088,7 +1115,7 @@ export {
1088
1115
  Ce as t,
1089
1116
  ne as u,
1090
1117
  Ne as v,
1091
- fe as w,
1118
+ me as w,
1092
1119
  Se as x,
1093
1120
  Ae as y
1094
1121
  };