@feedmepos/mf-report 5.22.12 → 5.22.13-beta.1

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 (30) hide show
  1. package/dist/{App-DDzVhXL7.js → App-pXGWlg3l.js} +40 -40
  2. package/dist/{BaseDialog.vue_vue_type_script_setup_true_lang-BZlvMBPW.js → BaseDialog.vue_vue_type_script_setup_true_lang-CzbeFyTt.js} +3 -3
  3. package/dist/{DateRangeSelect.vue_vue_type_script_setup_true_lang-BM-li0d3.js → DateRangeSelect.vue_vue_type_script_setup_true_lang-B06jDFgJ.js} +2 -2
  4. package/dist/{Default.vue_vue_type_script_setup_true_lang-BuFLfame.js → Default.vue_vue_type_script_setup_true_lang-BTCBYTaC.js} +2 -2
  5. package/dist/{FilterSelector.vue_vue_type_script_setup_true_lang-BoX6fRDT.js → FilterSelector.vue_vue_type_script_setup_true_lang-Ccr5PmzE.js} +6 -6
  6. package/dist/{InsightView-DBmUbSlP.js → InsightView-C0TwLCJv.js} +6 -6
  7. package/dist/{Integration-BDC13WLh.js → Integration-BFEaM0Wz.js} +36 -35
  8. package/dist/{Integrations-C6gWnyhy.js → Integrations-CG-ygqKI.js} +7 -6
  9. package/dist/{Layout-DbHEONpc.js → Layout-D6kcGEx6.js} +1 -1
  10. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-G9CiV2LK.js → MenuTab.vue_vue_type_script_setup_true_lang-D3EZc4Vp.js} +5 -5
  11. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-D9-002wn.js → NavigationTab.vue_vue_type_script_setup_true_lang-CpMCe0cN.js} +1718 -1697
  12. package/dist/{NoData.vue_vue_type_script_setup_true_lang-CdGpZdFx.js → NoData.vue_vue_type_script_setup_true_lang-DdX25Qgn.js} +1 -1
  13. package/dist/{OverviewView-B0dWJYNP.js → OverviewView-ATC5S46N.js} +5 -5
  14. package/dist/{Report-QeJVzX13.js → Report-CVNA4oKn.js} +202 -177
  15. package/dist/ReportEditor-ZXjzIVWj.js +1104 -0
  16. package/dist/ReportView-C0vzCbYY.js +265 -0
  17. package/dist/{SelectComponent.vue_vue_type_script_setup_true_lang-DMMP43KF.js → SelectComponent.vue_vue_type_script_setup_true_lang-BHVPbR3l.js} +1 -1
  18. package/dist/{Setting-Dv-Eo5IX.js → Setting-BfR6T0tE.js} +5 -5
  19. package/dist/{TileEditor-ZqOV5_Le.js → TileEditor-BQDzUwav.js} +8 -8
  20. package/dist/{TransitionFade-CsoI1XtQ.js → TransitionFade-DlAa1-mg.js} +6 -6
  21. package/dist/{useRestaurantPermission-8zTUt56b.js → access-Dw5cDt65-DpLiFTpm.js} +386 -388
  22. package/dist/{app-Du0ALyx7.js → app-tS9-0m0b.js} +56 -36
  23. package/dist/app.js +1 -1
  24. package/dist/style.css +1 -1
  25. package/dist/useReportPermission-DEI1PTJT.js +60 -0
  26. package/dist/useRestaurantPermission-DTzkzgml.js +65 -0
  27. package/dist/{vue-i18n-kHBFKu4C.js → vue-i18n-BxRs360O.js} +7 -7
  28. package/package.json +2 -2
  29. package/dist/ReportEditor-LupGO1_l.js +0 -1103
  30. package/dist/ReportView-BMgXES5v.js +0 -250
@@ -1,9 +1,5 @@
1
- import { computed as je } from "vue";
2
- import { u as Oe } from "./vue-i18n-kHBFKu4C.js";
3
- import { useSnackbar as Re } from "@feedmepos/ui-library";
4
- import { useCoreStore as Te } from "@feedmepos/mf-common";
5
- import { g as we, c as $e } from "./app-Du0ALyx7.js";
6
- var se = { exports: {} };
1
+ import { g as Oe, c as $e } from "./app-tS9-0m0b.js";
2
+ var oe = { exports: {} };
7
3
  (function(e, u) {
8
4
  (function(l, i) {
9
5
  e.exports = i();
@@ -12,35 +8,35 @@ var se = { exports: {} };
12
8
  var i = {};
13
9
  function o(s) {
14
10
  if (i[s]) return i[s].exports;
15
- var p = i[s] = { i: s, l: !1, exports: {} };
16
- return l[s].call(p.exports, p, p.exports, o), p.l = !0, p.exports;
11
+ var f = i[s] = { i: s, l: !1, exports: {} };
12
+ return l[s].call(f.exports, f, f.exports, o), f.l = !0, f.exports;
17
13
  }
18
- return o.m = l, o.c = i, o.d = function(s, p, d) {
19
- o.o(s, p) || Object.defineProperty(s, p, { enumerable: !0, get: d });
14
+ return o.m = l, o.c = i, o.d = function(s, f, v) {
15
+ o.o(s, f) || Object.defineProperty(s, f, { enumerable: !0, get: v });
20
16
  }, o.r = function(s) {
21
17
  typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(s, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(s, "__esModule", { value: !0 });
22
- }, o.t = function(s, p) {
23
- if (1 & p && (s = o(s)), 8 & p || 4 & p && typeof s == "object" && s && s.__esModule) return s;
24
- var d = /* @__PURE__ */ Object.create(null);
25
- if (o.r(d), Object.defineProperty(d, "default", { enumerable: !0, value: s }), 2 & p && typeof s != "string")
26
- for (var j in s)
18
+ }, o.t = function(s, f) {
19
+ if (1 & f && (s = o(s)), 8 & f || 4 & f && typeof s == "object" && s && s.__esModule) return s;
20
+ var v = /* @__PURE__ */ Object.create(null);
21
+ if (o.r(v), Object.defineProperty(v, "default", { enumerable: !0, value: s }), 2 & f && typeof s != "string")
22
+ for (var _ in s)
27
23
  o.d(
28
- d,
29
- j,
30
- (function(O) {
31
- return s[O];
32
- }).bind(null, j)
24
+ v,
25
+ _,
26
+ (function(h) {
27
+ return s[h];
28
+ }).bind(null, _)
33
29
  );
34
- return d;
30
+ return v;
35
31
  }, o.n = function(s) {
36
- var p = s && s.__esModule ? function() {
32
+ var f = s && s.__esModule ? function() {
37
33
  return s.default;
38
34
  } : function() {
39
35
  return s;
40
36
  };
41
- return o.d(p, "a", p), p;
42
- }, o.o = function(s, p) {
43
- return Object.prototype.hasOwnProperty.call(s, p);
37
+ return o.d(f, "a", f), f;
38
+ }, o.o = function(s, f) {
39
+ return Object.prototype.hasOwnProperty.call(s, f);
44
40
  }, o.p = "", o(o.s = 0);
45
41
  }([
46
42
  function(l, i, o) {
@@ -54,7 +50,7 @@ var se = { exports: {} };
54
50
  return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
55
51
  })(t);
56
52
  }
57
- function p(t) {
53
+ function f(t) {
58
54
  var r = "[object " + t + "]";
59
55
  return function(a) {
60
56
  return Object.prototype.toString.call(a) === r;
@@ -63,38 +59,38 @@ var se = { exports: {} };
63
59
  o.r(i), o.d(i, "default", function() {
64
60
  return he;
65
61
  }), o.d(i, "compare", function() {
66
- return ee;
62
+ return Z;
67
63
  }), o.d(i, "comparable", function() {
68
- return z;
64
+ return B;
69
65
  });
70
- var d = p("Array"), j = p("Object"), O = p("Function");
66
+ var v = f("Array"), _ = f("Object"), h = f("Function");
71
67
  function T(t, r) {
72
- return O(t.get) ? t.get(r) : t[r];
68
+ return h(t.get) ? t.get(r) : t[r];
73
69
  }
74
70
  function w(t) {
75
71
  return function(r, a) {
76
- if (!d(a) || !a.length) return t(r, a);
77
- for (var f = 0, y = a.length; f < y; f++)
78
- if (t(r, T(a, f))) return !0;
72
+ if (!v(a) || !a.length) return t(r, a);
73
+ for (var p = 0, y = a.length; p < y; p++)
74
+ if (t(r, T(a, p))) return !0;
79
75
  return !1;
80
76
  };
81
77
  }
82
- function N(t) {
78
+ function I(t) {
83
79
  return function(r, a) {
84
- if (!d(a) || !a.length) return t(r, a);
85
- for (var f = 0, y = a.length; f < y; f++)
86
- if (!t(r, T(a, f))) return !1;
80
+ if (!v(a) || !a.length) return t(r, a);
81
+ for (var p = 0, y = a.length; p < y; p++)
82
+ if (!t(r, T(a, p))) return !1;
87
83
  return !0;
88
84
  };
89
85
  }
90
- function $(t, r, a, f) {
91
- return t.validate(t.options, r, a, f);
86
+ function R(t, r, a, p) {
87
+ return t.validate(t.options, r, a, p);
92
88
  }
93
89
  var S = {
94
90
  $eq: w(function(t, r) {
95
91
  return t(r);
96
92
  }),
97
- $ne: N(function(t, r) {
93
+ $ne: I(function(t, r) {
98
94
  return t(r);
99
95
  }),
100
96
  $gt: w(function(t, r) {
@@ -118,115 +114,115 @@ var se = { exports: {} };
118
114
  $nin: function(t, r) {
119
115
  return t(r);
120
116
  },
121
- $not: function(t, r, a, f) {
122
- return t(r, a, f);
117
+ $not: function(t, r, a, p) {
118
+ return t(r, a, p);
123
119
  },
124
120
  $type: function(t, r) {
125
121
  return t(r);
126
122
  },
127
- $all: function(t, r, a, f) {
128
- return S.$and(t, r, a, f);
123
+ $all: function(t, r, a, p) {
124
+ return S.$and(t, r, a, p);
129
125
  },
130
126
  $size: function(t, r) {
131
127
  return !!r && t === r.length;
132
128
  },
133
- $or: function(t, r, a, f) {
129
+ $or: function(t, r, a, p) {
134
130
  for (var y = 0, m = t.length; y < m; y++)
135
- if ($(T(t, y), r, a, f)) return !0;
131
+ if (R(T(t, y), r, a, p)) return !0;
136
132
  return !1;
137
133
  },
138
- $nor: function(t, r, a, f) {
139
- return !S.$or(t, r, a, f);
134
+ $nor: function(t, r, a, p) {
135
+ return !S.$or(t, r, a, p);
140
136
  },
141
- $and: function(t, r, a, f) {
137
+ $and: function(t, r, a, p) {
142
138
  for (var y = 0, m = t.length; y < m; y++)
143
- if (!$(T(t, y), r, a, f)) return !1;
139
+ if (!R(T(t, y), r, a, p)) return !1;
144
140
  return !0;
145
141
  },
146
142
  $regex: w(function(t, r) {
147
143
  return typeof r == "string" && t.test(r);
148
144
  }),
149
- $where: function(t, r, a, f) {
150
- return t.call(r, r, a, f);
145
+ $where: function(t, r, a, p) {
146
+ return t.call(r, r, a, p);
151
147
  },
152
- $elemMatch: function(t, r, a, f) {
153
- return d(r) ? !!~function(y, m) {
148
+ $elemMatch: function(t, r, a, p) {
149
+ return v(r) ? !!~function(y, m) {
154
150
  for (var b = 0; b < y.length; b++)
155
- if (T(y, b), $(m, T(y, b))) return b;
151
+ if (T(y, b), R(m, T(y, b))) return b;
156
152
  return -1;
157
- }(r, t) : $(t, r, a, f);
153
+ }(r, t) : R(t, r, a, p);
158
154
  },
159
- $exists: function(t, r, a, f) {
160
- return f.hasOwnProperty(a) === t;
155
+ $exists: function(t, r, a, p) {
156
+ return p.hasOwnProperty(a) === t;
161
157
  }
162
158
  }, P = {
163
159
  $eq: function(t, r, a) {
164
- var f = a.comparable, y = a.compare;
160
+ var p = a.comparable, y = a.compare;
165
161
  return t instanceof RegExp ? w(function(m) {
166
162
  return typeof m == "string" && t.test(m);
167
- }) : t instanceof Function ? w(t) : d(t) && !t.length ? w(function(m) {
168
- return d(m) && !m.length;
163
+ }) : t instanceof Function ? w(t) : v(t) && !t.length ? w(function(m) {
164
+ return v(m) && !m.length;
169
165
  }) : w(
170
166
  t === null ? function(m) {
171
167
  return m == null;
172
168
  } : function(m) {
173
- return y(f(m), f(t)) === 0;
169
+ return y(p(m), p(t)) === 0;
174
170
  }
175
171
  );
176
172
  },
177
173
  $gt: function(t, r, a) {
178
- var f = a.comparable, y = a.compare;
174
+ var p = a.comparable, y = a.compare;
179
175
  return function(m) {
180
- return y(f(m), f(t)) > 0;
176
+ return y(p(m), p(t)) > 0;
181
177
  };
182
178
  },
183
179
  $gte: function(t, r, a) {
184
- var f = a.comparable, y = a.compare;
180
+ var p = a.comparable, y = a.compare;
185
181
  return function(m) {
186
- return y(f(m), f(t)) >= 0;
182
+ return y(p(m), p(t)) >= 0;
187
183
  };
188
184
  },
189
185
  $lt: function(t, r, a) {
190
- var f = a.comparable, y = a.compare;
186
+ var p = a.comparable, y = a.compare;
191
187
  return function(m) {
192
- return y(f(m), f(t)) < 0;
188
+ return y(p(m), p(t)) < 0;
193
189
  };
194
190
  },
195
191
  $lte: function(t, r, a) {
196
- var f = a.comparable, y = a.compare;
192
+ var p = a.comparable, y = a.compare;
197
193
  return function(m) {
198
- return y(f(m), f(t)) <= 0;
194
+ return y(p(m), p(t)) <= 0;
199
195
  };
200
196
  },
201
197
  $in: function(t, r, a) {
202
- var f = a.comparable;
198
+ var p = a.comparable;
203
199
  return function(y) {
204
200
  if (!(y instanceof Array)) {
205
- var m = f(y);
201
+ var m = p(y);
206
202
  if (m === y && s(y) === "object") {
207
- for (h = t.length; h--; )
208
- if (String(t[h]) === String(y) && String(y) !== "[object Object]")
203
+ for (g = t.length; g--; )
204
+ if (String(t[g]) === String(y) && String(y) !== "[object Object]")
209
205
  return !0;
210
206
  }
211
207
  if (m === void 0) {
212
- for (h = t.length; h--; ) if (t[h] == null) return !0;
208
+ for (g = t.length; g--; ) if (t[g] == null) return !0;
213
209
  }
214
- for (h = t.length; h--; ) {
215
- var b = $(Z(T(t, h), a), m, h, t);
210
+ for (g = t.length; g--; ) {
211
+ var b = R(Q(T(t, g), a), m, g, t);
216
212
  if (b && String(b) !== "[object Object]" && String(m) !== "[object Object]")
217
213
  return !0;
218
214
  }
219
215
  return !!~t.indexOf(m);
220
216
  }
221
- for (var h = y.length; h--; )
222
- if (~t.indexOf(f(T(y, h)))) return !0;
217
+ for (var g = y.length; g--; )
218
+ if (~t.indexOf(p(T(y, g)))) return !0;
223
219
  return !1;
224
220
  };
225
221
  },
226
222
  $nin: function(t, r, a) {
227
- var f = P.$in(t, r, a);
228
- return function(y, m, b, h) {
229
- return !f(y, m, b, h);
223
+ var p = P.$in(t, r, a);
224
+ return function(y, m, b, g) {
225
+ return !p(y, m, b, g);
230
226
  };
231
227
  },
232
228
  $mod: function(t) {
@@ -235,9 +231,9 @@ var se = { exports: {} };
235
231
  };
236
232
  },
237
233
  $ne: function(t, r, a) {
238
- var f = P.$eq(t, r, a);
239
- return N(function(y, m, b, h) {
240
- return !f(y, m, b, h);
234
+ var p = P.$eq(t, r, a);
235
+ return I(function(y, m, b, g) {
236
+ return !p(y, m, b, g);
241
237
  });
242
238
  },
243
239
  $and: function(t, r, a) {
@@ -253,13 +249,13 @@ var se = { exports: {} };
253
249
  return t.map(F(a));
254
250
  },
255
251
  $not: function(t, r, a) {
256
- var f = F(a)(t);
252
+ var p = F(a)(t);
257
253
  return function(y, m, b) {
258
- return !$(f, y, m, b);
254
+ return !R(p, y, m, b);
259
255
  };
260
256
  },
261
257
  $type: function(t) {
262
- return function(r, a, f) {
258
+ return function(r, a, p) {
263
259
  return r != null && (r instanceof t || r.constructor == t);
264
260
  };
265
261
  },
@@ -282,130 +278,130 @@ var se = { exports: {} };
282
278
  function D(t, r) {
283
279
  return { options: t, validate: r };
284
280
  }
285
- function me(t, r) {
286
- var a = t.keyPath, f = t.child, y = t.query, m = [];
287
- if (function te(E, C, M, ge, B) {
288
- if (M === C.length || E == null)
289
- return void B.push([E, C[M - 1], ge]);
290
- var ne = T(C, M);
291
- if (d(E) && isNaN(Number(ne)))
292
- for (var W = 0, _e = E.length; W < _e; W++) te(T(E, W), C, M, E, B);
293
- else te(T(E, ne), C, M + 1, E, B);
281
+ function be(t, r) {
282
+ var a = t.keyPath, p = t.child, y = t.query, m = [];
283
+ if (function ee(E, M, N, _e, J) {
284
+ if (N === M.length || E == null)
285
+ return void J.push([E, M[N - 1], _e]);
286
+ var te = T(M, N);
287
+ if (v(E) && isNaN(Number(te)))
288
+ for (var W = 0, je = E.length; W < je; W++) ee(T(E, W), M, N, E, J);
289
+ else ee(T(E, te), M, N + 1, E, J);
294
290
  }(r, a, 0, r, m), m.length === 1) {
295
291
  var b = m[0];
296
- return $(f, b[0], b[1], b[2]);
292
+ return R(p, b[0], b[1], b[2]);
297
293
  }
298
- for (var h = y && y.$ne !== void 0, _ = h, k = 0; k < m.length; k++) {
299
- var x = m[k], H = $(f, x[0], x[1], x[2]);
300
- h ? _ &= H : _ |= H;
294
+ for (var g = y && y.$ne !== void 0, O = g, k = 0; k < m.length; k++) {
295
+ var x = m[k], U = R(p, x[0], x[1], x[2]);
296
+ g ? O &= U : O |= U;
301
297
  }
302
- return _;
298
+ return O;
303
299
  }
304
- function be(t, r, a) {
305
- return D({ keyPath: t, child: r, query: a }, me);
300
+ function ge(t, r, a) {
301
+ return D({ keyPath: t, child: r, query: a }, be);
306
302
  }
307
303
  function F(t) {
308
- var r = t.comparable, a = t.expressions, f = function(b) {
309
- var h;
310
- return (!b || !(h = b) || h.constructor !== Object && h.constructor !== Array && h.constructor.toString() !== "function Object() { [native code] }" && h.constructor.toString() !== "function Array() { [native code] }" || h.toJSON) && (b = { $eq: b }), b;
304
+ var r = t.comparable, a = t.expressions, p = function(b) {
305
+ var g;
306
+ return (!b || !(g = b) || g.constructor !== Object && g.constructor !== Array && g.constructor.toString() !== "function Object() { [native code] }" && g.constructor.toString() !== "function Array() { [native code] }" || g.toJSON) && (b = { $eq: b }), b;
311
307
  }, y = function(b) {
312
308
  b = r(b);
313
- var h = [];
314
- for (var _ in b) {
315
- var k = b[_];
316
- if (_ !== "$options") {
317
- var x = S[_] || t && a && a[_];
318
- if (x) P[_] && (k = P[_](k, b, t)), h.push(D(r(k), x));
309
+ var g = [];
310
+ for (var O in b) {
311
+ var k = b[O];
312
+ if (O !== "$options") {
313
+ var x = S[O] || t && a && a[O];
314
+ if (x) P[O] && (k = P[O](k, b, t)), g.push(D(r(k), x));
319
315
  else {
320
- if (_.charCodeAt(0) === 36)
321
- throw new Error("Unknown operation " + _);
322
- var H = _.split(".");
323
- h.push(be(H, m(k), k));
316
+ if (O.charCodeAt(0) === 36)
317
+ throw new Error("Unknown operation " + O);
318
+ var U = O.split(".");
319
+ g.push(ge(U, m(k), k));
324
320
  }
325
321
  }
326
322
  }
327
- return h.length === 1 ? h[0] : D(h, S.$and);
323
+ return g.length === 1 ? g[0] : D(g, S.$and);
328
324
  }, m = function(b) {
329
- return b = f(b), function h(_, k) {
330
- if (!j(_)) return k;
331
- for (var x in _) k.push(x), h(_[x], k);
325
+ return b = p(b), function g(O, k) {
326
+ if (!_(O)) return k;
327
+ for (var x in O) k.push(x), g(O[x], k);
332
328
  return k;
333
- }(b, []).join(",").search(/[$.]/) === -1 ? D(b, U) : y(b);
329
+ }(b, []).join(",").search(/[$.]/) === -1 ? D(b, H) : y(b);
334
330
  };
335
331
  return function(b) {
336
- return y(f(b));
332
+ return y(p(b));
337
333
  };
338
334
  }
339
- function U(t, r) {
335
+ function H(t, r) {
340
336
  if (Object.prototype.toString.call(t) !== Object.prototype.toString.call(r))
341
337
  return !1;
342
- if (j(t)) {
338
+ if (_(t)) {
343
339
  if (Object.keys(t).length !== Object.keys(r).length) return !1;
344
- for (var a in t) if (!U(t[a], r[a])) return !1;
340
+ for (var a in t) if (!H(t[a], r[a])) return !1;
345
341
  return !0;
346
342
  }
347
- if (d(t)) {
343
+ if (v(t)) {
348
344
  if (t.length !== r.length) return !1;
349
- for (var f = 0, y = t.length; f < y; f++)
350
- if (!U(t[f], r[f])) return !1;
345
+ for (var p = 0, y = t.length; p < y; p++)
346
+ if (!H(t[p], r[p])) return !1;
351
347
  return !0;
352
348
  }
353
349
  return t === r;
354
350
  }
355
- function Z(t, r) {
351
+ function Q(t, r) {
356
352
  var a = F(r)(t);
357
353
  return r && r.select && (a = {
358
354
  options: a,
359
- validate: function(f, y, m, b) {
360
- return $(f, y && r.select(y), m, b);
355
+ validate: function(p, y, m, b) {
356
+ return R(p, y && r.select(y), m, b);
361
357
  }
362
358
  }), a;
363
359
  }
364
360
  function he(t, r) {
365
- var a = Z(t, r = Object.assign({ compare: ee, comparable: z }, r));
366
- return function(f, y, m) {
367
- return $(a, f, y, m);
361
+ var a = Q(t, r = Object.assign({ compare: Z, comparable: B }, r));
362
+ return function(p, y, m) {
363
+ return R(a, p, y, m);
368
364
  };
369
365
  }
370
- function ee(t, r) {
371
- if (U(t, r)) return 0;
366
+ function Z(t, r) {
367
+ if (H(t, r)) return 0;
372
368
  if (s(t) === s(r)) {
373
369
  if (t > r) return 1;
374
370
  if (t < r) return -1;
375
371
  }
376
372
  }
377
- function z(t) {
378
- return t instanceof Date ? t.getTime() : d(t) ? t.map(z) : t && typeof t.toJSON == "function" ? t.toJSON() : t;
373
+ function B(t) {
374
+ return t instanceof Date ? t.getTime() : v(t) ? t.map(B) : t && typeof t.toJSON == "function" ? t.toJSON() : t;
379
375
  }
380
376
  }
381
377
  ]);
382
378
  });
383
- })(se);
384
- var ke = se.exports;
385
- const Ae = /* @__PURE__ */ we(ke);
386
- function Se(e, u) {
379
+ })(oe);
380
+ var Te = oe.exports;
381
+ const we = /* @__PURE__ */ Oe(Te);
382
+ function Re(e, u) {
387
383
  for (var l = 0; l < u.length; l++) {
388
384
  var i = u[l];
389
385
  i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i);
390
386
  }
391
387
  }
392
- function Pe(e, u, l) {
393
- return u && Se(e.prototype, u), e;
388
+ function ke(e, u, l) {
389
+ return u && Re(e.prototype, u), e;
394
390
  }
395
- function xe(e, u) {
391
+ function Ae(e, u) {
396
392
  e.prototype = Object.create(u.prototype), e.prototype.constructor = e, e.__proto__ = u;
397
393
  }
398
- function J(e) {
399
- return J = Object.setPrototypeOf ? Object.getPrototypeOf : function(l) {
394
+ function X(e) {
395
+ return X = Object.setPrototypeOf ? Object.getPrototypeOf : function(l) {
400
396
  return l.__proto__ || Object.getPrototypeOf(l);
401
- }, J(e);
397
+ }, X(e);
402
398
  }
403
399
  function q(e, u) {
404
400
  return q = Object.setPrototypeOf || function(i, o) {
405
401
  return i.__proto__ = o, i;
406
402
  }, q(e, u);
407
403
  }
408
- function De() {
404
+ function Se() {
409
405
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
410
406
  if (typeof Proxy == "function") return !0;
411
407
  try {
@@ -416,20 +412,20 @@ function De() {
416
412
  }
417
413
  }
418
414
  function L(e, u, l) {
419
- return De() ? L = Reflect.construct : L = function(o, s, p) {
420
- var d = [null];
421
- d.push.apply(d, s);
422
- var j = Function.bind.apply(o, d), O = new j();
423
- return p && q(O, p.prototype), O;
415
+ return Se() ? L = Reflect.construct : L = function(o, s, f) {
416
+ var v = [null];
417
+ v.push.apply(v, s);
418
+ var _ = Function.bind.apply(o, v), h = new _();
419
+ return f && q(h, f.prototype), h;
424
420
  }, L.apply(null, arguments);
425
421
  }
426
- function Ee(e) {
422
+ function Pe(e) {
427
423
  return Function.toString.call(e).indexOf("[native code]") !== -1;
428
424
  }
429
- function X(e) {
425
+ function z(e) {
430
426
  var u = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
431
- return X = function(i) {
432
- if (i === null || !Ee(i)) return i;
427
+ return z = function(i) {
428
+ if (i === null || !Pe(i)) return i;
433
429
  if (typeof i != "function")
434
430
  throw new TypeError("Super expression must either be null or a function");
435
431
  if (typeof u < "u") {
@@ -437,7 +433,7 @@ function X(e) {
437
433
  u.set(i, o);
438
434
  }
439
435
  function o() {
440
- return L(i, arguments, J(this).constructor);
436
+ return L(i, arguments, X(this).constructor);
441
437
  }
442
438
  return o.prototype = Object.create(i.prototype, {
443
439
  constructor: {
@@ -447,18 +443,18 @@ function X(e) {
447
443
  configurable: !0
448
444
  }
449
445
  }), q(o, i);
450
- }, X(e);
446
+ }, z(e);
451
447
  }
452
- function re(e) {
448
+ function ne(e) {
453
449
  if (e === void 0)
454
450
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
455
451
  return e;
456
452
  }
457
- var ae = function(u) {
453
+ var se = function(u) {
458
454
  return 'Cannot execute "' + u.action + '" on "' + u.subjectName + '"';
459
- }, G = ae, Fe = /* @__PURE__ */ function(e) {
460
- xe(u, e), u.setDefaultMessage = function(o) {
461
- o === null ? G = ae : G = typeof o == "string" ? function() {
455
+ }, G = se, xe = /* @__PURE__ */ function(e) {
456
+ Ae(u, e), u.setDefaultMessage = function(o) {
457
+ o === null ? G = se : G = typeof o == "string" ? function() {
462
458
  return o;
463
459
  } : o;
464
460
  }, u.from = function(o) {
@@ -469,62 +465,62 @@ var ae = function(u) {
469
465
  };
470
466
  function u(i, o) {
471
467
  var s;
472
- return o === void 0 && (o = {}), s = e.call(this, i) || this, s._setMetadata(o), s.message = i || G(re(s)), s._customMessage = null, typeof Error.captureStackTrace == "function" && (s.name = s.constructor.name, Error.captureStackTrace(re(s), s.constructor)), s;
468
+ return o === void 0 && (o = {}), s = e.call(this, i) || this, s._setMetadata(o), s.message = i || G(ne(s)), s._customMessage = null, typeof Error.captureStackTrace == "function" && (s.name = s.constructor.name, Error.captureStackTrace(ne(s), s.constructor)), s;
473
469
  }
474
470
  var l = u.prototype;
475
471
  return l.setMessage = function(o) {
476
472
  return this._customMessage = o, this;
477
- }, l.throwUnlessCan = function(o, s, p) {
473
+ }, l.throwUnlessCan = function(o, s, f) {
478
474
  if (!this.ability)
479
475
  throw new ReferenceError("Cannot throw FordiddenError without respective ability instance");
480
- var d = this.ability.relevantRuleFor(o, s, p);
481
- if (!(d && !d.inverted)) {
476
+ var v = this.ability.relevantRuleFor(o, s, f);
477
+ if (!(v && !v.inverted)) {
482
478
  this._setMetadata({
483
479
  action: o,
484
480
  subject: s,
485
- field: p,
481
+ field: f,
486
482
  subjectName: this.ability.subjectName(s)
487
483
  });
488
- var j = d ? d.reason : "";
489
- throw this.message = this._customMessage || j || G(this), this;
484
+ var _ = v ? v.reason : "";
485
+ throw this.message = this._customMessage || _ || G(this), this;
490
486
  }
491
487
  }, l._setMetadata = function(o) {
492
488
  this.subject = o.subject, this.subjectName = o.subjectName, this.action = o.action, this.field = o.field;
493
489
  }, u;
494
- }(X(Error));
490
+ }(z(Error));
495
491
  function V(e) {
496
492
  return Array.isArray(e) ? e : [e];
497
493
  }
498
- function Ie(e) {
494
+ function De(e) {
499
495
  if (!e || typeof e == "string")
500
496
  return e;
501
497
  var u = typeof e == "object" ? e.constructor : e;
502
498
  return u.modelName || u.name;
503
499
  }
504
- function Ce(e) {
500
+ function Ee(e) {
505
501
  return JSON.parse(JSON.stringify(e));
506
502
  }
507
- var Me = /[-/\\^$+?.()|[\]{}]/g, Ne = /\.?\*+\.?/g, Ue = /\*+/, He = /\./g;
508
- function Ge(e, u, l) {
509
- var i = l[0] === "*" || e[0] === "." && e[e.length - 1] === "." ? "+" : "*", o = e.indexOf("**") === -1 ? "[^.]" : ".", s = e.replace(He, "\\$&").replace(Ue, o + i);
503
+ var Fe = /[-/\\^$+?.()|[\]{}]/g, Ce = /\.?\*+\.?/g, Me = /\*+/, Ne = /\./g;
504
+ function Ie(e, u, l) {
505
+ var i = l[0] === "*" || e[0] === "." && e[e.length - 1] === "." ? "+" : "*", o = e.indexOf("**") === -1 ? "[^.]" : ".", s = e.replace(Ne, "\\$&").replace(Me, o + i);
510
506
  return u + e.length === l.length ? "(?:" + s + ")?" : s;
511
507
  }
512
- function Le(e, u, l) {
508
+ function He(e, u, l) {
513
509
  return e === "." && (l[u - 1] === "*" || l[u + 1] === "*") ? e : "\\" + e;
514
510
  }
515
- function qe(e) {
511
+ function Ue(e) {
516
512
  var u = e.map(function(i) {
517
- return i.replace(Me, Le).replace(Ne, Ge);
513
+ return i.replace(Fe, He).replace(Ce, Ie);
518
514
  }), l = u.length > 1 ? "(?:" + u.join("|") + ")" : u[0];
519
515
  return new RegExp("^" + l + "$");
520
516
  }
521
- var ze = /* @__PURE__ */ function() {
517
+ var Ge = /* @__PURE__ */ function() {
522
518
  function e(l) {
523
519
  this.actions = l.actions || l.action, this.subject = l.subject, this.fields = !l.fields || l.fields.length === 0 ? void 0 : V(l.fields), Object.defineProperty(this, "_fieldsPattern", {
524
520
  writable: !0
525
521
  }), this.inverted = !!l.inverted, this.conditions = l.conditions, Object.defineProperty(this, "_matches", {
526
522
  writable: !0,
527
- value: this.conditions ? Ae(this.conditions) : void 0
523
+ value: this.conditions ? we(this.conditions) : void 0
528
524
  }), this.reason = l.reason;
529
525
  }
530
526
  var u = e.prototype;
@@ -533,33 +529,33 @@ var ze = /* @__PURE__ */ function() {
533
529
  }, u.isRelevantFor = function(i, o) {
534
530
  return this.fields ? o ? this.matchesField(o) : !this.inverted : !0;
535
531
  }, u.matchesField = function(i) {
536
- return typeof this._fieldsPattern > "u" && (this._fieldsPattern = this.fields.join("").indexOf("*") === -1 ? null : qe(this.fields)), this._fieldsPattern === null || i.indexOf("*") !== -1 ? this.fields.indexOf(i) !== -1 : this._fieldsPattern.test(i);
532
+ return typeof this._fieldsPattern > "u" && (this._fieldsPattern = this.fields.join("").indexOf("*") === -1 ? null : Ue(this.fields)), this._fieldsPattern === null || i.indexOf("*") !== -1 ? this.fields.indexOf(i) !== -1 : this._fieldsPattern.test(i);
537
533
  }, e;
538
- }(), A = typeof Symbol < "u" ? Symbol("private") : "__" + Date.now(), ie = {
534
+ }(), A = typeof Symbol < "u" ? Symbol("private") : "__" + Date.now(), re = {
539
535
  crud: ["create", "read", "update", "delete"]
540
536
  };
541
- function oe(e, u) {
537
+ function ie(e, u) {
542
538
  return e === u || Array.isArray(u) && u.indexOf(e) !== -1;
543
539
  }
544
- var Be = /* @__PURE__ */ function() {
540
+ var ae = /* @__PURE__ */ function() {
545
541
  e.addAlias = function(i, o) {
546
- if (i === "manage" || oe("manage", o))
542
+ if (i === "manage" || ie("manage", o))
547
543
  throw new Error('Cannot add alias for "manage" action because it represents any action');
548
- if (oe(i, o))
544
+ if (ie(i, o))
549
545
  throw new Error("Attempt to alias action to itself: " + i + " -> " + o.toString());
550
- return ie[i] = o, this;
546
+ return re[i] = o, this;
551
547
  };
552
548
  function e(l, i) {
553
549
  i === void 0 && (i = {}), Object.defineProperty(this, "subjectName", {
554
- value: i.subjectName || Ie
550
+ value: i.subjectName || De
555
551
  }), this[A] = {
556
- RuleType: i.RuleType || ze,
552
+ RuleType: i.RuleType || Ge,
557
553
  originalRules: l || [],
558
554
  hasPerFieldRules: !1,
559
555
  indexedRules: /* @__PURE__ */ Object.create(null),
560
556
  mergedRules: /* @__PURE__ */ Object.create(null),
561
557
  events: {},
562
- aliases: Ce(ie)
558
+ aliases: Ee(re)
563
559
  }, this.update(l);
564
560
  }
565
561
  var u = e.prototype;
@@ -574,53 +570,53 @@ var Be = /* @__PURE__ */ function() {
574
570
  var s = this.buildIndexFor(i);
575
571
  return process.env.NODE_ENV !== "production" && s.isAllInverted && i.length && console.warn("[casl]: Ability contains only inverted rules. That means user will not be able to do any actions. This will be changed to Error throw in the next major version"), this[A].indexedRules = s.rules, this[A].hasPerFieldRules = s.hasPerFieldRules, this.emit("updated", o), this;
576
572
  }, u.buildIndexFor = function(i) {
577
- for (var o = /* @__PURE__ */ Object.create(null), s = this[A].RuleType, p = !0, d = !1, j = 0; j < i.length; j++) {
578
- var O = new s(i[j]), T = this.expandActions(O.actions), w = V(O.subject), N = i.length - j - 1;
579
- p = !!(p && O.inverted), !d && O.fields && (d = !0);
580
- for (var $ = 0; $ < w.length; $++) {
581
- var S = w[$];
573
+ for (var o = /* @__PURE__ */ Object.create(null), s = this[A].RuleType, f = !0, v = !1, _ = 0; _ < i.length; _++) {
574
+ var h = new s(i[_]), T = this.expandActions(h.actions), w = V(h.subject), I = i.length - _ - 1;
575
+ f = !!(f && h.inverted), !v && h.fields && (v = !0);
576
+ for (var R = 0; R < w.length; R++) {
577
+ var S = w[R];
582
578
  o[S] = o[S] || /* @__PURE__ */ Object.create(null);
583
579
  for (var P = 0; P < T.length; P++) {
584
580
  var D = T[P];
585
- o[S][D] = o[S][D] || /* @__PURE__ */ Object.create(null), o[S][D][N] = O;
581
+ o[S][D] = o[S][D] || /* @__PURE__ */ Object.create(null), o[S][D][I] = h;
586
582
  }
587
583
  }
588
584
  }
589
585
  return {
590
- isAllInverted: p,
591
- hasPerFieldRules: d,
586
+ isAllInverted: f,
587
+ hasPerFieldRules: v,
592
588
  rules: o
593
589
  };
594
590
  }, u.expandActions = function(i) {
595
- for (var o = this[A].aliases, s = V(i), p = 0; p < s.length; ) {
596
- var d = s[p++];
597
- o.hasOwnProperty(d) && (s = s.concat(o[d]));
591
+ for (var o = this[A].aliases, s = V(i), f = 0; f < s.length; ) {
592
+ var v = s[f++];
593
+ o.hasOwnProperty(v) && (s = s.concat(o[v]));
598
594
  }
599
595
  return s;
600
596
  }, u.can = function(i, o, s) {
601
597
  if (s && typeof s != "string")
602
598
  throw new Error("Ability.can expects 3rd parameter to be a string. See https://stalniy.github.io/casl/abilities/2017/07/21/check-abilities.html#checking-fields for details");
603
- var p = this.relevantRuleFor(i, o, s);
604
- return !!p && !p.inverted;
599
+ var f = this.relevantRuleFor(i, o, s);
600
+ return !!f && !f.inverted;
605
601
  }, u.relevantRuleFor = function(i, o, s) {
606
- for (var p = this.rulesFor(i, o, s), d = 0; d < p.length; d++)
607
- if (p[d].matches(o))
608
- return p[d];
602
+ for (var f = this.rulesFor(i, o, s), v = 0; v < f.length; v++)
603
+ if (f[v].matches(o))
604
+ return f[v];
609
605
  return null;
610
606
  }, u.possibleRulesFor = function(i, o) {
611
- var s = this.subjectName(o), p = this[A].mergedRules, d = s + "_" + i;
612
- return p[d] || (p[d] = this.mergeRulesFor(i, s)), p[d];
607
+ var s = this.subjectName(o), f = this[A].mergedRules, v = s + "_" + i;
608
+ return f[v] || (f[v] = this.mergeRulesFor(i, s)), f[v];
613
609
  }, u.mergeRulesFor = function(i, o) {
614
- var s = this[A].indexedRules, p = [o, "all"].reduce(function(d, j) {
615
- var O = s[j];
616
- return O ? Object.assign(d, O[i], O.manage) : d;
610
+ var s = this[A].indexedRules, f = [o, "all"].reduce(function(v, _) {
611
+ var h = s[_];
612
+ return h ? Object.assign(v, h[i], h.manage) : v;
617
613
  }, []);
618
- return p.filter(Boolean);
614
+ return f.filter(Boolean);
619
615
  }, u.rulesFor = function(i, o, s) {
620
- var p = this.possibleRulesFor(i, o);
621
- return this[A].hasPerFieldRules ? p.filter(function(d) {
622
- return d.isRelevantFor(o, s);
623
- }) : p;
616
+ var f = this.possibleRulesFor(i, o);
617
+ return this[A].hasPerFieldRules ? f.filter(function(v) {
618
+ return v.isRelevantFor(o, s);
619
+ }) : f;
624
620
  }, u.cannot = function() {
625
621
  return !this.can.apply(this, arguments);
626
622
  }, u.throwUnlessCan = function() {
@@ -628,77 +624,98 @@ var Be = /* @__PURE__ */ function() {
628
624
  console.warn(`
629
625
  Ability.throwUnlessCan is deprecated and will be removed in 4.x version.
630
626
  Please use "ForbiddenError.from(ability).throwUnlessCan(...)" instead.
631
- `.trim()), (i = Fe.from(this)).throwUnlessCan.apply(i, arguments);
627
+ `.trim()), (i = xe.from(this)).throwUnlessCan.apply(i, arguments);
632
628
  }, u.on = function(i, o) {
633
- var s = this[A].events, p = !0;
629
+ var s = this[A].events, f = !0;
634
630
  return s[i] || (s[i] = []), s[i].push(o), function() {
635
- if (p) {
636
- var d = s[i].indexOf(o);
637
- s[i].splice(d, 1), p = !1;
631
+ if (f) {
632
+ var v = s[i].indexOf(o);
633
+ s[i].splice(v, 1), f = !1;
638
634
  }
639
635
  };
640
636
  }, u.emit = function(i, o) {
641
637
  var s = this[A].events[i];
642
- s && s.slice(0).forEach(function(p) {
643
- return p(o);
638
+ s && s.slice(0).forEach(function(f) {
639
+ return f(o);
644
640
  });
645
- }, Pe(e, [{
641
+ }, ke(e, [{
646
642
  key: "rules",
647
643
  get: function() {
648
644
  return this[A].originalRules;
649
645
  }
650
646
  }]), e;
651
- }(), n = /* @__PURE__ */ ((e) => (e.manage = "manage", e.create = "create", e.read = "read", e.update = "update", e.delete = "delete", e))(n || {}), c = /* @__PURE__ */ ((e) => (e.crm = "business::crm", e.crm_promotion = "business::crm::promotion", e.crm_voucher = "business::crm::voucher", e.crm_membership = "business::crm::membership", e.inventory_stock = "business::inventory::stock", e.inventory_stockBalance = "business::inventory::stockBalance", e.inventory_stockAdjustment = "business::inventory::stockAdjustment", e.inventory_unitCostHistory = "business::inventory::unitCostHistory", e.inventory_wastageTemplate = "business::inventory::wastageTemplate", e.inventory_closingHistory = "business::inventory::closingHistory", e.inventory_closingTemplate = "business::inventory::closingTemplate", e.inventory_closingDraft = "business::inventory::closingDraft", e.inventory_ingredient = "business::inventory::ingredient", e.inventory_ingredientGroup = "business::inventory::ingredientGroup", e.inventory_recipe = "business::inventory::recipe", e.inventory_unit = "business::inventory::unit", e.inventory_purchaseTransfer = "business::inventory::purchaseTransfer", e.inventory_orderDraftApproval = "business::inventory::orderDraftApproval", e.inventory_transferOut = "business::inventory::transferOut", e.inventory_surcharge = "business::inventory::surcharge", e.inventory_orderTemplate = "business::inventory::orderTemplate", e.inventory_supplier = "business::inventory::supplier", e.inventory_warehouse = "business::inventory::warehouse", e.inventory_publish = "business::inventory::publish", e.inventory_import = "business::inventory::import", e.inventory_integration = "business::inventory::integration", e.hrm = "business::hrm", e.hrm_employee = "business::hrm::employee", e.hrm_teamMember = "business::hrm::teamMember", e.hrm_auditLog = "business::hrm::auditLog", e.menu = "business::menu", e.restaurant = "business::restaurant", e.role = "business::role", e.profile = "business::profile", e))(c || {}), g = /* @__PURE__ */ ((e) => (e.profile = "business::profile", e.restaurant = "business::restaurant", e.menu = "business::menu", e.promotion = "business::promotion", e.voucher = "business::voucher", e.membership = "business::membership", e.stock = "business::stock", e.permission = "business::permission", e.role = "business::role", e.wastageTemplate = "business::wastageTemplate", e.closingTemplate = "business::closingTemplate", e.orderTemplate = "business::orderTemplate", e.ingredient = "business::ingredient", e.recipe = "business::recipe", e.unit = "business::unit", e.supplier = "business::supplier", e.warehouse = "business::warehouse", e.publish = "business::publish", e.integration = "business::integration", e.orderDraft = "business::orderDraft", e.unitCostHistory = "business::unitCostHistory", e))(g || {}), Y = /* @__PURE__ */ ((e) => (e.restaurant = "restaurant", e))(Y || {});
652
- g.permission + "", c.hrm_teamMember, g.promotion + "", c.crm_promotion, g.voucher + "", c.crm_voucher, g.membership + "", c.crm_membership, g.stock + "", c.inventory_stock, g.wastageTemplate + "", c.inventory_wastageTemplate, g.closingTemplate + "", c.inventory_closingTemplate, g.orderTemplate + "", c.inventory_orderTemplate, g.ingredient + "", c.inventory_ingredient, g.recipe + "", c.inventory_recipe, g.unit + "", c.inventory_unit, g.supplier + "", c.inventory_supplier, g.warehouse + "", c.inventory_warehouse, g.publish + "", c.inventory_publish, g.integration + "", c.inventory_integration, g.orderDraft + "", c.inventory_orderDraftApproval, g.unitCostHistory + "", c.inventory_unitCostHistory;
647
+ }(), n = /* @__PURE__ */ ((e) => (e.manage = "manage", e.create = "create", e.read = "read", e.update = "update", e.delete = "delete", e))(n || {}), c = /* @__PURE__ */ ((e) => (e.crm = "business::crm", e.crm_promotion = "business::crm::promotion", e.crm_voucher = "business::crm::voucher", e.crm_membership = "business::crm::membership", e.inventory_stock = "business::inventory::stock", e.inventory_stockBalance = "business::inventory::stockBalance", e.inventory_stockAdjustment = "business::inventory::stockAdjustment", e.inventory_unitCostHistory = "business::inventory::unitCostHistory", e.inventory_wastageTemplate = "business::inventory::wastageTemplate", e.inventory_closingHistory = "business::inventory::closingHistory", e.inventory_closingTemplate = "business::inventory::closingTemplate", e.inventory_closingDraft = "business::inventory::closingDraft", e.inventory_ingredient = "business::inventory::ingredient", e.inventory_ingredientGroup = "business::inventory::ingredientGroup", e.inventory_recipe = "business::inventory::recipe", e.inventory_unit = "business::inventory::unit", e.inventory_purchaseTransfer = "business::inventory::purchaseTransfer", e.inventory_orderDraftApproval = "business::inventory::orderDraftApproval", e.inventory_transferOut = "business::inventory::transferOut", e.inventory_surcharge = "business::inventory::surcharge", e.inventory_orderTemplate = "business::inventory::orderTemplate", e.inventory_supplier = "business::inventory::supplier", e.inventory_warehouse = "business::inventory::warehouse", e.inventory_publish = "business::inventory::publish", e.inventory_import = "business::inventory::import", e.inventory_integration = "business::inventory::integration", e.hrm = "business::hrm", e.hrm_employee = "business::hrm::employee", e.hrm_teamMember = "business::hrm::teamMember", e.hrm_auditLog = "business::hrm::auditLog", e.menu = "business::menu", e.restaurant = "business::restaurant", e.role = "business::role", e.profile = "business::profile", e))(c || {}), j = /* @__PURE__ */ ((e) => (e.profile = "business::profile", e.restaurant = "business::restaurant", e.menu = "business::menu", e.promotion = "business::promotion", e.voucher = "business::voucher", e.membership = "business::membership", e.stock = "business::stock", e.permission = "business::permission", e.role = "business::role", e.wastageTemplate = "business::wastageTemplate", e.closingTemplate = "business::closingTemplate", e.orderTemplate = "business::orderTemplate", e.ingredient = "business::ingredient", e.recipe = "business::recipe", e.unit = "business::unit", e.supplier = "business::supplier", e.warehouse = "business::warehouse", e.publish = "business::publish", e.integration = "business::integration", e.orderDraft = "business::orderDraft", e.unitCostHistory = "business::unitCostHistory", e))(j || {}), Le = /* @__PURE__ */ ((e) => (e.restaurant = "restaurant", e))(Le || {});
648
+ const qe = {
649
+ [j.permission]: c.hrm_teamMember,
650
+ [j.promotion]: c.crm_promotion,
651
+ [j.voucher]: c.crm_voucher,
652
+ [j.membership]: c.crm_membership,
653
+ [j.stock]: c.inventory_stock,
654
+ [j.wastageTemplate]: c.inventory_wastageTemplate,
655
+ [j.closingTemplate]: c.inventory_closingTemplate,
656
+ [j.orderTemplate]: c.inventory_orderTemplate,
657
+ [j.ingredient]: c.inventory_ingredient,
658
+ [j.recipe]: c.inventory_recipe,
659
+ [j.unit]: c.inventory_unit,
660
+ [j.supplier]: c.inventory_supplier,
661
+ [j.warehouse]: c.inventory_warehouse,
662
+ [j.publish]: c.inventory_publish,
663
+ [j.integration]: c.inventory_integration,
664
+ [j.orderDraft]: c.inventory_orderDraftApproval,
665
+ [j.unitCostHistory]: c.inventory_unitCostHistory
666
+ };
667
+ function Be(e) {
668
+ return qe[e] ?? e;
669
+ }
653
670
  c.restaurant, n.manage, c.menu, n.manage, c.inventory_stockBalance, n.manage, c.inventory_stockAdjustment, n.manage, c.inventory_unitCostHistory, n.manage, c.inventory_wastageTemplate, n.manage, c.inventory_closingHistory, n.manage, c.inventory_closingTemplate, n.manage, c.inventory_closingDraft, n.manage, c.inventory_ingredient, n.manage, c.inventory_ingredientGroup, n.manage, c.inventory_recipe, n.manage, c.inventory_unit, n.manage, c.inventory_purchaseTransfer, n.manage, c.inventory_orderDraftApproval, n.manage, c.inventory_transferOut, n.manage, c.inventory_surcharge, n.manage, c.inventory_orderTemplate, n.manage, c.inventory_supplier, n.manage, c.inventory_warehouse, n.manage, c.inventory_publish, n.manage, c.inventory_import, n.manage, c.inventory_integration, n.manage, c.crm_promotion, n.manage, c.crm_voucher, n.manage, c.crm_membership, n.manage, c.hrm_teamMember, n.manage, c.hrm_employee, n.manage, c.hrm_auditLog, n.manage;
654
- var v = /* @__PURE__ */ ((e) => (e.inventory = "inventory", e.inventory_stock = "inventory::stock", e.inventory_stockAdjustment = "inventory::stockAdjustment", e.inventory_stockRecalculation = "inventory::stockRecalculation", e.inventory_unitCostHistory = "inventory::unitCostHistory", e.inventory_wastageTemplate = "inventory::wastageTemplate", e.inventory_closing = "inventory::closing", e.inventory_closingDraft = "inventory::closingDraft", e.inventory_closingTemplate = "inventory::closingTemplate", e.inventory_ingredient = "inventory::ingredient", e.inventory_ingredientGroup = "inventory::ingredientGroup", e.inventory_recipe = "inventory::recipe", e.inventory_unit = "inventory::unit", e.inventory_orderTemplate = "inventory::orderTemplate", e.inventory_orderDraft = "inventory::orderDraft", e.inventory_printTemplate = "inventory::printTemplate", e.inventory_purchaseOrder = "inventory::purchaseOrder", e.inventory_transferOutApproval = "inventory::transferOutApproval", e.inventory_adjustmentTemplate = "inventory::adjustmentTemplate", e.inventory_surcharge = "inventory::surcharge", e.inventory_supplier = "inventory::supplier", e.inventory_warehouse = "inventory::warehouse", e.inventory_publish = "inventory::publish", e.inventory_integration = "inventory::integration", e.inventory_deliveryOrder = "inventory::deliveryOrder", e.inventory_shipment = "inventory::shipment", e.inventory_orderDraftApproval = "inventory::orderDraftApproval", e))(v || {});
655
- const R = [
671
+ var d = /* @__PURE__ */ ((e) => (e.inventory = "inventory", e.inventory_stock = "inventory::stock", e.inventory_stockAdjustment = "inventory::stockAdjustment", e.inventory_stockRecalculation = "inventory::stockRecalculation", e.inventory_unitCostHistory = "inventory::unitCostHistory", e.inventory_wastageTemplate = "inventory::wastageTemplate", e.inventory_closing = "inventory::closing", e.inventory_closingDraft = "inventory::closingDraft", e.inventory_closingTemplate = "inventory::closingTemplate", e.inventory_ingredient = "inventory::ingredient", e.inventory_ingredientGroup = "inventory::ingredientGroup", e.inventory_recipe = "inventory::recipe", e.inventory_unit = "inventory::unit", e.inventory_orderTemplate = "inventory::orderTemplate", e.inventory_orderDraft = "inventory::orderDraft", e.inventory_printTemplate = "inventory::printTemplate", e.inventory_purchaseOrder = "inventory::purchaseOrder", e.inventory_transferOutApproval = "inventory::transferOutApproval", e.inventory_adjustmentTemplate = "inventory::adjustmentTemplate", e.inventory_surcharge = "inventory::surcharge", e.inventory_supplier = "inventory::supplier", e.inventory_warehouse = "inventory::warehouse", e.inventory_publish = "inventory::publish", e.inventory_integration = "inventory::integration", e.inventory_deliveryOrder = "inventory::deliveryOrder", e.inventory_shipment = "inventory::shipment", e.inventory_orderDraftApproval = "inventory::orderDraftApproval", e))(d || {});
672
+ const $ = [
656
673
  {
657
674
  label: "Inventory",
658
- subject: v.inventory,
675
+ subject: d.inventory,
659
676
  actions: [n.read]
660
677
  }
661
- ], K = [
662
- ...R,
678
+ ], Y = [
679
+ ...$,
663
680
  {
664
681
  label: "Stock",
665
- subject: v.inventory_stock,
682
+ subject: d.inventory_stock,
666
683
  actions: [n.read, n.create, n.update]
667
684
  },
668
685
  {
669
686
  label: "Stock Adjustment",
670
- subject: v.inventory_stockAdjustment,
687
+ subject: d.inventory_stockAdjustment,
671
688
  actions: [n.read, n.update]
672
689
  },
673
690
  {
674
691
  label: "Stock Recalculation",
675
- subject: v.inventory_stockRecalculation,
692
+ subject: d.inventory_stockRecalculation,
676
693
  actions: [n.update]
677
694
  },
678
695
  {
679
696
  label: "Unit Cost History",
680
- subject: v.inventory_unitCostHistory,
697
+ subject: d.inventory_unitCostHistory,
681
698
  actions: [n.read]
682
699
  }
683
- ], We = [
684
- ...R,
700
+ ], Je = [
701
+ ...$,
685
702
  {
686
703
  label: "Stock Adjustment",
687
- subject: v.inventory_stockAdjustment,
704
+ subject: d.inventory_stockAdjustment,
688
705
  actions: [n.update]
689
706
  }
690
707
  ], ue = [
691
- ...R,
708
+ ...$,
692
709
  {
693
710
  label: "Unit Cost History",
694
- subject: v.inventory_unitCostHistory,
711
+ subject: d.inventory_unitCostHistory,
695
712
  actions: [n.read, n.update]
696
713
  }
697
714
  ], ce = [
698
- ...R,
715
+ ...$,
699
716
  {
700
717
  label: "Wastage Template",
701
- subject: v.inventory_wastageTemplate,
718
+ subject: d.inventory_wastageTemplate,
702
719
  actions: [
703
720
  n.read,
704
721
  n.create,
@@ -708,59 +725,59 @@ const R = [
708
725
  }
709
726
  ];
710
727
  [
711
- ...K,
728
+ ...Y,
712
729
  ...ue,
713
730
  ...ce
714
731
  ];
715
- const Q = [
716
- ...R,
732
+ const K = [
733
+ ...$,
717
734
  {
718
735
  label: "Closing",
719
- subject: v.inventory_closing,
736
+ subject: d.inventory_closing,
720
737
  actions: [n.read, n.create]
721
738
  },
722
739
  {
723
740
  label: "Stock Recalculation",
724
- subject: v.inventory_stockRecalculation,
741
+ subject: d.inventory_stockRecalculation,
725
742
  actions: [n.read, n.update]
726
743
  },
727
744
  {
728
745
  label: "Closing Draft",
729
- subject: v.inventory_closingDraft,
746
+ subject: d.inventory_closingDraft,
730
747
  actions: [n.read]
731
748
  }
732
749
  ], le = [
733
- ...R,
750
+ ...$,
734
751
  {
735
752
  label: "Closing Draft",
736
- subject: v.inventory_closingDraft,
753
+ subject: d.inventory_closingDraft,
737
754
  actions: [n.read, n.create, n.update]
738
755
  },
739
756
  {
740
757
  label: "Closing",
741
- subject: v.inventory_closing,
758
+ subject: d.inventory_closing,
742
759
  actions: [n.read]
743
760
  },
744
761
  {
745
762
  label: "Stock Recalculation",
746
- subject: v.inventory_stockRecalculation,
763
+ subject: d.inventory_stockRecalculation,
747
764
  actions: [n.read, n.update]
748
765
  },
749
766
  {
750
767
  label: "Stock",
751
- subject: v.inventory_stock,
768
+ subject: d.inventory_stock,
752
769
  actions: [n.read]
753
770
  },
754
771
  {
755
772
  label: "Stock Adjustment",
756
- subject: v.inventory_stockAdjustment,
773
+ subject: d.inventory_stockAdjustment,
757
774
  actions: [n.read]
758
775
  }
759
776
  ], pe = [
760
- ...R,
777
+ ...$,
761
778
  {
762
779
  label: "Closing Template",
763
- subject: v.inventory_closingTemplate,
780
+ subject: d.inventory_closingTemplate,
764
781
  actions: [
765
782
  n.read,
766
783
  n.create,
@@ -770,121 +787,121 @@ const Q = [
770
787
  },
771
788
  {
772
789
  label: "Closing",
773
- subject: v.inventory_closing,
790
+ subject: d.inventory_closing,
774
791
  actions: [n.read]
775
792
  }
776
793
  ];
777
794
  [
778
- ...Q,
795
+ ...K,
779
796
  ...le,
780
797
  ...pe
781
798
  ];
782
- const Je = [
799
+ const We = [
783
800
  {
784
801
  label: "Inventory",
785
- subject: v.inventory,
802
+ subject: d.inventory,
786
803
  actions: [n.read, n.update]
787
804
  },
788
805
  {
789
806
  label: "Order Template",
790
- subject: v.inventory_orderTemplate,
807
+ subject: d.inventory_orderTemplate,
791
808
  actions: [n.read, n.update]
792
809
  },
793
810
  {
794
811
  label: "Wastage Template",
795
- subject: v.inventory_wastageTemplate,
812
+ subject: d.inventory_wastageTemplate,
796
813
  actions: [n.read, n.update]
797
814
  },
798
815
  {
799
816
  label: "Closing Template",
800
- subject: v.inventory_closingTemplate,
817
+ subject: d.inventory_closingTemplate,
801
818
  actions: [n.read, n.update]
802
819
  }
803
820
  ], Xe = [
804
821
  {
805
822
  label: "Inventory",
806
- subject: v.inventory,
823
+ subject: d.inventory,
807
824
  actions: [n.read, n.update]
808
825
  }
809
- ], Ve = [
826
+ ], ze = [
810
827
  {
811
828
  label: "Inventory",
812
- subject: v.inventory,
829
+ subject: d.inventory,
813
830
  actions: [n.read, n.update]
814
831
  }
815
- ], Ye = [
832
+ ], Ve = [
816
833
  {
817
834
  label: "Inventory",
818
- subject: v.inventory,
835
+ subject: d.inventory,
819
836
  actions: [n.read, n.update]
820
837
  }
821
838
  ], fe = [
822
839
  {
823
840
  label: "Purchase Order",
824
- subject: v.inventory_purchaseOrder,
841
+ subject: d.inventory_purchaseOrder,
825
842
  actions: [n.read, n.create, n.update]
826
843
  },
827
844
  {
828
845
  label: "Inventory",
829
- subject: v.inventory,
846
+ subject: d.inventory,
830
847
  actions: [n.read, n.create, n.update]
831
848
  },
832
849
  {
833
850
  label: "Closing",
834
- subject: v.inventory_closing,
851
+ subject: d.inventory_closing,
835
852
  actions: [n.read]
836
853
  },
837
854
  {
838
855
  label: "Order Template",
839
- subject: v.inventory_orderTemplate,
856
+ subject: d.inventory_orderTemplate,
840
857
  actions: [n.read]
841
858
  },
842
859
  {
843
860
  label: "Supplier",
844
- subject: v.inventory_supplier,
861
+ subject: d.inventory_supplier,
845
862
  actions: [n.read]
846
863
  },
847
864
  {
848
865
  label: "Surcharge",
849
- subject: v.inventory_surcharge,
866
+ subject: d.inventory_surcharge,
850
867
  actions: [n.read]
851
868
  },
852
869
  {
853
870
  label: "Delivery Order",
854
- subject: v.inventory_deliveryOrder,
871
+ subject: d.inventory_deliveryOrder,
855
872
  actions: [n.read, n.create, n.update]
856
873
  },
857
874
  {
858
875
  label: "Shipment",
859
- subject: v.inventory_shipment,
876
+ subject: d.inventory_shipment,
860
877
  actions: [n.read, n.update]
861
878
  }
862
879
  ], ye = [
863
880
  {
864
881
  label: "Purchase Order",
865
- subject: v.inventory_purchaseOrder,
882
+ subject: d.inventory_purchaseOrder,
866
883
  actions: [n.read, n.update]
867
884
  },
868
885
  {
869
886
  label: "Inventory",
870
- subject: v.inventory,
887
+ subject: d.inventory,
871
888
  actions: [n.read, n.create, n.update]
872
889
  },
873
890
  {
874
891
  label: "Delivery Order",
875
- subject: v.inventory_deliveryOrder,
892
+ subject: d.inventory_deliveryOrder,
876
893
  actions: [n.read, n.create, n.update]
877
894
  },
878
895
  {
879
896
  label: "Shipment",
880
- subject: v.inventory_shipment,
897
+ subject: d.inventory_shipment,
881
898
  actions: [n.read, n.update]
882
899
  }
883
900
  ], ve = [
884
- ...R,
901
+ ...$,
885
902
  {
886
903
  label: "Surcharge",
887
- subject: v.inventory_surcharge,
904
+ subject: d.inventory_surcharge,
888
905
  actions: [
889
906
  n.read,
890
907
  n.create,
@@ -894,14 +911,14 @@ const Je = [
894
911
  },
895
912
  {
896
913
  label: "Supplier",
897
- subject: v.inventory_supplier,
914
+ subject: d.inventory_supplier,
898
915
  actions: [n.read]
899
916
  }
900
917
  ], de = [
901
- ...R,
918
+ ...$,
902
919
  {
903
920
  label: "Order Template",
904
- subject: v.inventory_orderTemplate,
921
+ subject: d.inventory_orderTemplate,
905
922
  actions: [
906
923
  n.read,
907
924
  n.create,
@@ -911,19 +928,19 @@ const Je = [
911
928
  },
912
929
  {
913
930
  label: "Supplier",
914
- subject: v.inventory_supplier,
931
+ subject: d.inventory_supplier,
915
932
  actions: [n.read]
916
933
  },
917
934
  {
918
935
  label: "Shipment",
919
- subject: v.inventory_shipment,
936
+ subject: d.inventory_shipment,
920
937
  actions: [n.read, n.update]
921
938
  }
922
- ], Ke = [
923
- ...R,
939
+ ], Ye = [
940
+ ...$,
924
941
  {
925
942
  label: "Order Draft Approval",
926
- subject: v.inventory_orderDraftApproval,
943
+ subject: d.inventory_orderDraftApproval,
927
944
  actions: [n.update]
928
945
  }
929
946
  ];
@@ -933,11 +950,11 @@ const Je = [
933
950
  ...ve,
934
951
  ...de
935
952
  ];
936
- const Qe = [
937
- ...R,
953
+ const Ke = [
954
+ ...$,
938
955
  {
939
956
  label: "Supplier",
940
- subject: v.inventory_supplier,
957
+ subject: d.inventory_supplier,
941
958
  actions: [
942
959
  n.read,
943
960
  n.create,
@@ -947,14 +964,14 @@ const Qe = [
947
964
  },
948
965
  {
949
966
  label: "Order Template",
950
- subject: v.inventory_orderTemplate,
967
+ subject: d.inventory_orderTemplate,
951
968
  actions: [n.read, n.update]
952
969
  }
953
- ], Ze = [
954
- ...R,
970
+ ], Qe = [
971
+ ...$,
955
972
  {
956
973
  label: "Warehouse",
957
- subject: v.inventory_warehouse,
974
+ subject: d.inventory_warehouse,
958
975
  actions: [
959
976
  n.read,
960
977
  n.create,
@@ -962,42 +979,42 @@ const Qe = [
962
979
  n.delete
963
980
  ]
964
981
  }
965
- ], et = [
982
+ ], Ze = [
966
983
  {
967
984
  label: "Inventory",
968
- subject: v.inventory,
985
+ subject: d.inventory,
969
986
  actions: [n.read, n.update]
970
987
  }
971
- ], tt = [
972
- ...R,
988
+ ], et = [
989
+ ...$,
973
990
  {
974
991
  label: "Inventory",
975
- subject: v.inventory,
992
+ subject: d.inventory,
976
993
  actions: [n.update]
977
994
  }
978
- ], nt = [
979
- ...R,
995
+ ], tt = [
996
+ ...$,
980
997
  {
981
998
  label: "Integration",
982
- subject: v.inventory_integration,
999
+ subject: d.inventory_integration,
983
1000
  actions: [n.read, n.create, n.update]
984
1001
  }
985
1002
  ];
986
1003
  [
987
- ...R,
988
- ...K,
989
- ...Q
1004
+ ...$,
1005
+ ...Y,
1006
+ ...K
990
1007
  ];
991
- const rt = {
1008
+ const nt = {
992
1009
  [`set_${c.inventory_stockBalance}`]: {
993
1010
  key: "sys:inventory:stock_balance",
994
1011
  name: "Stock Balance",
995
- permissions: K
1012
+ permissions: Y
996
1013
  },
997
1014
  [`set_${c.inventory_stockAdjustment}`]: {
998
1015
  key: "sys:inventory:stock_adjustment",
999
1016
  name: "Stock Adjustment",
1000
- permissions: We
1017
+ permissions: Je
1001
1018
  },
1002
1019
  [`set_${c.inventory_unitCostHistory}`]: {
1003
1020
  key: "sys:inventory:unit_cost_history",
@@ -1012,7 +1029,7 @@ const rt = {
1012
1029
  [`set_${c.inventory_closingHistory}`]: {
1013
1030
  key: "sys:inventory:closing_history",
1014
1031
  name: "Closing History",
1015
- permissions: Q
1032
+ permissions: K
1016
1033
  },
1017
1034
  [`set_${c.inventory_closingTemplate}`]: {
1018
1035
  key: "sys:inventory:closing_template",
@@ -1027,7 +1044,7 @@ const rt = {
1027
1044
  [`set_${c.inventory_ingredient}`]: {
1028
1045
  key: "sys:inventory:ingredient",
1029
1046
  name: "Ingredient",
1030
- permissions: Je
1047
+ permissions: We
1031
1048
  },
1032
1049
  [`set_${c.inventory_ingredientGroup}`]: {
1033
1050
  key: "sys:inventory:ingredient_group",
@@ -1037,12 +1054,12 @@ const rt = {
1037
1054
  [`set_${c.inventory_recipe}`]: {
1038
1055
  key: "sys:inventory:recipe",
1039
1056
  name: "Recipe",
1040
- permissions: Ve
1057
+ permissions: ze
1041
1058
  },
1042
1059
  [`set_${c.inventory_unit}`]: {
1043
1060
  key: "sys:inventory:unit",
1044
1061
  name: "Unit",
1045
- permissions: Ye
1062
+ permissions: Ve
1046
1063
  },
1047
1064
  [`set_${c.inventory_purchaseTransfer}`]: {
1048
1065
  key: "sys:inventory:purchase_transfer",
@@ -1052,7 +1069,7 @@ const rt = {
1052
1069
  [`set_${c.inventory_orderDraftApproval}`]: {
1053
1070
  key: "sys:inventory:order_draft_approval",
1054
1071
  name: "Order Draft Approval",
1055
- permissions: Ke
1072
+ permissions: Ye
1056
1073
  },
1057
1074
  [`set_${c.inventory_transferOut}`]: {
1058
1075
  key: "sys:inventory:transfer_out",
@@ -1072,31 +1089,31 @@ const rt = {
1072
1089
  [`set_${c.inventory_supplier}`]: {
1073
1090
  key: "sys:inventory:supplier",
1074
1091
  name: "Supplier",
1075
- permissions: Qe
1092
+ permissions: Ke
1076
1093
  },
1077
1094
  [`set_${c.inventory_warehouse}`]: {
1078
1095
  key: "sys:inventory:warehouse",
1079
1096
  name: "Warehouse",
1080
- permissions: Ze
1097
+ permissions: Qe
1081
1098
  },
1082
1099
  [`set_${c.inventory_publish}`]: {
1083
1100
  key: "sys:inventory:publish",
1084
1101
  name: "Publish",
1085
- permissions: et
1102
+ permissions: Ze
1086
1103
  },
1087
1104
  [`set_${c.inventory_import}`]: {
1088
1105
  key: "sys:inventory:import",
1089
1106
  name: "Import",
1090
- permissions: tt
1107
+ permissions: et
1091
1108
  },
1092
1109
  [`set_${c.inventory_integration}`]: {
1093
1110
  key: "sys:inventory:integration",
1094
1111
  name: "Integration",
1095
- permissions: nt
1112
+ permissions: tt
1096
1113
  }
1097
1114
  };
1098
- var I = /* @__PURE__ */ ((e) => (e.hrm_posRole = "hrm::posRole", e.hrm_portalUsers = "hrm::portalUsers", e))(I || {});
1099
- const it = {
1115
+ var C = /* @__PURE__ */ ((e) => (e.hrm_posRole = "hrm::posRole", e.hrm_portalUsers = "hrm::portalUsers", e))(C || {});
1116
+ const rt = {
1100
1117
  /**
1101
1118
  * Triggered by: hrm_teamMember:manage (portal toggle)
1102
1119
  * Injects: team member list read + pos role read
@@ -1108,7 +1125,7 @@ const it = {
1108
1125
  permissions: [
1109
1126
  {
1110
1127
  label: "Portal Users",
1111
- subject: I.hrm_portalUsers,
1128
+ subject: C.hrm_portalUsers,
1112
1129
  actions: [n.manage]
1113
1130
  },
1114
1131
  {
@@ -1118,7 +1135,7 @@ const it = {
1118
1135
  },
1119
1136
  {
1120
1137
  label: "Pos Role",
1121
- subject: I.hrm_posRole,
1138
+ subject: C.hrm_posRole,
1122
1139
  actions: [n.read]
1123
1140
  }
1124
1141
  ]
@@ -1133,7 +1150,7 @@ const it = {
1133
1150
  permissions: [
1134
1151
  {
1135
1152
  label: "Portal Users",
1136
- subject: I.hrm_portalUsers,
1153
+ subject: C.hrm_portalUsers,
1137
1154
  actions: [n.read]
1138
1155
  },
1139
1156
  {
@@ -1143,7 +1160,7 @@ const it = {
1143
1160
  },
1144
1161
  {
1145
1162
  label: "Pos Role",
1146
- subject: I.hrm_posRole,
1163
+ subject: C.hrm_posRole,
1147
1164
  actions: [n.manage]
1148
1165
  }
1149
1166
  ]
@@ -1160,17 +1177,17 @@ const it = {
1160
1177
  permissions: [
1161
1178
  {
1162
1179
  label: "Portal Users",
1163
- subject: I.hrm_portalUsers,
1180
+ subject: C.hrm_portalUsers,
1164
1181
  actions: [n.read]
1165
1182
  }
1166
1183
  ]
1167
1184
  }
1168
- }, ot = {
1169
- ...rt,
1170
- ...it
1185
+ }, it = {
1186
+ ...nt,
1187
+ ...rt
1171
1188
  };
1172
1189
  Object.values(
1173
- ot
1190
+ it
1174
1191
  ).flatMap((e) => e.permissions ?? []).reduce(
1175
1192
  (e, u) => {
1176
1193
  var l;
@@ -1178,63 +1195,44 @@ Object.values(
1178
1195
  },
1179
1196
  {}
1180
1197
  );
1181
- function st(e) {
1182
- const u = Array.isArray(e) ? e : [];
1183
- return new Be(u);
1184
- }
1185
- function at(e) {
1186
- const { ability: u, action: l, restaurantId: i } = e;
1187
- return i ? u.can(l, {
1188
- constructor: { name: Y.restaurant },
1189
- restaurantId: i
1190
- }) : u.can(l, Y.restaurant);
1198
+ function me(e) {
1199
+ return e.map((u) => ({
1200
+ ...u,
1201
+ subject: Be(u.subject),
1202
+ reason: u.source !== void 0 ? JSON.stringify(u.source) : u.reason
1203
+ }));
1191
1204
  }
1192
- function ut(e) {
1193
- const { integrationRestaurantIds: u, ability: l, action: i } = e;
1194
- if (!Array.isArray(u) || u.length === 0)
1195
- return [];
1196
- const o = [];
1197
- for (const s of u)
1198
- typeof s == "string" && (at({ ability: l, action: i, restaurantId: s }) || o.push(s));
1199
- return o;
1205
+ function ot(e) {
1206
+ return new ae(me(e));
1200
1207
  }
1201
- function ct(e) {
1202
- return ut({
1203
- integrationRestaurantIds: e.integrationRestaurantIds,
1204
- ability: e.ability,
1205
- action: e.action
1206
- }).length > 0;
1207
- }
1208
- function dt() {
1209
- const e = Re(), { t: u } = Oe(), { sessionUser: l } = Te(), i = je(
1210
- () => {
1211
- var p;
1212
- return st((p = l.value) == null ? void 0 : p.permissions);
1208
+ function st(e) {
1209
+ return new ae(me(e), {
1210
+ subjectName(u) {
1211
+ return typeof u != "string" && u.subjectType ? u.subjectType : u;
1213
1212
  }
1213
+ });
1214
+ }
1215
+ function ut(e, u, l) {
1216
+ const i = Array.isArray(e) ? e : [e], o = l !== void 0 ? st(u) : ot(u), s = (h) => l !== void 0 ? { subjectType: h.subject, ...l } : h.subject, f = i.find(
1217
+ (h) => !o.can(h.action, s(h), h.field)
1214
1218
  );
1215
- function o(p) {
1216
- e.open({
1217
- type: "error",
1218
- message: u("report.integration.error.containsUnauthorizedRestaurant", {
1219
- action: u(`report.integration.permissionAction.${p}`)
1220
- })
1221
- });
1222
- }
1223
- function s(p) {
1224
- return ct({
1225
- integrationRestaurantIds: p.integrationRestaurantIds,
1226
- ability: i.value,
1227
- action: p.action
1228
- });
1219
+ if (f) {
1220
+ const h = o.relevantRuleFor(
1221
+ f.action,
1222
+ s(f),
1223
+ f.field
1224
+ );
1225
+ return {
1226
+ granted: !1,
1227
+ decisivePermission: f,
1228
+ decisiveRule: h ?? null
1229
+ };
1229
1230
  }
1230
- return {
1231
- ability: i,
1232
- notifyUnauthorized: o,
1233
- isRestricted: s
1234
- };
1231
+ const v = i[0], _ = o.relevantRuleFor(v.action, s(v), v.field);
1232
+ return { granted: !0, decisivePermission: v, decisiveRule: _ ?? null };
1235
1233
  }
1236
1234
  export {
1237
- n as e,
1238
- ct as h,
1239
- dt as u
1235
+ ut as g,
1236
+ Le as l,
1237
+ n as y
1240
1238
  };