@feedmepos/mf-report 5.28.4-beta.2 → 5.28.4-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/{App-CO0rIxWA.js → App-Djjl57h1.js} +4 -4
  2. package/dist/{DateRangeSelect-j_1JPSHY.js → DateRangeSelect-BLMCCQe6.js} +1 -1
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-BTRNbPiK.js → Default.vue_vue_type_script_setup_true_lang-B_2SI6LW.js} +1 -1
  4. package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-D1MP0Koc.js → DynamicWidget.vue_vue_type_script_setup_true_lang-jQ1nPG2W.js} +4 -4
  5. package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-CQgXdnVJ.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-C_9MCXdv.js} +3 -3
  6. package/dist/{InsightView-D3Cq98b1.js → InsightView-K3vQVr7P.js} +5 -5
  7. package/dist/{Integration-D1-45oFB.js → Integration-DlTrxZMm.js} +3 -3
  8. package/dist/{Integrations-OQyPdZh-.js → Integrations-JGAGoCyo.js} +2 -2
  9. package/dist/{Layout-Bbhc8Z8O.js → Layout-D7hDkjS0.js} +1 -1
  10. package/dist/{LocationSelect.vue_vue_type_script_setup_true_lang-Bv4_DVSD.js → LocationSelect.vue_vue_type_script_setup_true_lang-vRpj6FDQ.js} +2 -2
  11. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-DsWBKmfz.js → MenuTab.vue_vue_type_script_setup_true_lang-BQLwZjxv.js} +5 -5
  12. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-CplZ_0DK.js → NavigationTab.vue_vue_type_script_setup_true_lang-B-fFAm9x.js} +5 -5
  13. package/dist/{OverviewView-DAYR_-3O.js → OverviewView-BbyaS0w_.js} +4 -4
  14. package/dist/{Report-4NU9XLHT.js → Report-B2iXUeAj.js} +188 -169
  15. package/dist/{ReportCanvasView-B-meSoDE.js → ReportCanvasView-CqUPNxab.js} +3 -3
  16. package/dist/{ReportEditor-E-LrtdYl.js → ReportEditor-EdMUVHKG.js} +7 -7
  17. package/dist/{ReportView-BOBv-FMc.js → ReportView-DjVEhVEQ.js} +6 -6
  18. package/dist/{ReportViewRoute-B5yL1meP.js → ReportViewRoute-MZCFhrBo.js} +2 -2
  19. package/dist/{Setting-DIUJFKvF.js → Setting-Br_ALEEg.js} +3 -3
  20. package/dist/{Template-BXHt9ILt.js → Template-DQVX1HBw.js} +3 -3
  21. package/dist/{TileEditor-Dfd00DF1.js → TileEditor-O4AspIIL.js} +6 -6
  22. package/dist/{TilePageStack.vue_vue_type_script_setup_true_lang-CcGtQ7-x.js → TilePageStack.vue_vue_type_script_setup_true_lang-C5zloxIx.js} +2 -2
  23. package/dist/{TransitionFade-C0h34wzI.js → TransitionFade-C5MRU6gb.js} +5 -5
  24. package/dist/{app-DCn4N0uO.js → app-DEsnATwZ.js} +12 -12
  25. package/dist/app.js +1 -1
  26. package/dist/{report-Dt0VwwmM.js → report-vndE_X4l.js} +1 -1
  27. package/dist/style.css +1 -1
  28. package/dist/{useRestaurantPermission-BAEw8_HZ.js → useRestaurantPermission-BCn9Dv7A.js} +1 -1
  29. package/package.json +1 -1
@@ -1,59 +1,75 @@
1
- import { defineComponent as Ne, ref as z, watch as be, computed as R, h as f, withModifiers as ge, resolveComponent as k, createBlock as Z, openBlock as J, withCtx as u, createVNode as i, createElementVNode as C, unref as t, normalizeStyle as Ue, normalizeClass as y, withDirectives as Se, createElementBlock as Te, Fragment as Ae, renderList as ze, toDisplayString as _, createTextVNode as Je, vShow as Ce } from "vue";
2
- import { storeToRefs as he } from "pinia";
3
- import { u as Be, s as Ee } from "./report-Dt0VwwmM.js";
4
- import { _ as Ke } from "./Default.vue_vue_type_script_setup_true_lang-BTRNbPiK.js";
5
- import { u as Me } from "./message-dialog-UoMWOnil.js";
6
- import { u as Ye } from "./global-loader-BuxFfehu.js";
7
- import { useSnackbar as qe, useBreakpoints as He, components as je, FmButtonColorThemeVariant as Ge } from "@feedmepos/ui-library";
8
- import { _ as Qe } from "./SelectComponent.vue_vue_type_script_setup_true_lang-DW7Dk7iQ.js";
9
- import { c as We, a as we, h as Xe } from "./app-DCn4N0uO.js";
10
- import { useRouter as Ze, useRoute as et, onBeforeRouteLeave as tt } from "vue-router";
11
- import { useI18n as ot } from "@feedmepos/mf-common";
1
+ import { defineComponent as Ue, ref as M, watch as ge, computed as P, h as d, withModifiers as Se, resolveComponent as x, createBlock as Z, openBlock as z, withCtx as u, createVNode as c, createElementVNode as h, unref as t, normalizeStyle as Te, normalizeClass as v, withDirectives as he, createElementBlock as Ae, Fragment as Me, renderList as ze, toDisplayString as _, createTextVNode as Je, vShow as we } from "vue";
2
+ import { storeToRefs as Re } from "pinia";
3
+ import { u as Be, s as Ke } from "./report-vndE_X4l.js";
4
+ import { _ as Ee } from "./Default.vue_vue_type_script_setup_true_lang-B_2SI6LW.js";
5
+ import { u as Ye } from "./message-dialog-UoMWOnil.js";
6
+ import { u as qe } from "./global-loader-BuxFfehu.js";
7
+ import { useSnackbar as He, useBreakpoints as je, components as Ge, FmButtonColorThemeVariant as Qe } from "@feedmepos/ui-library";
8
+ import { _ as We } from "./SelectComponent.vue_vue_type_script_setup_true_lang-DW7Dk7iQ.js";
9
+ import { c as Xe, a as Pe, h as Ze } from "./app-DEsnATwZ.js";
10
+ import { useRouter as et, useRoute as tt, onBeforeRouteLeave as ot } from "vue-router";
11
+ import { useI18n as at } from "@feedmepos/mf-common";
12
12
  import { r as ee } from "./i18n-DbyciK4x.js";
13
- const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st = { class: "w-[343px]" }, rt = { class: "fm-typo-en-body-md-600" }, St = /* @__PURE__ */ Ne({
13
+ const st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt = { class: "w-[343px]" }, nt = { class: "fm-typo-en-body-md-600" }, ht = /* @__PURE__ */ Ue({
14
14
  __name: "Report",
15
- setup(nt) {
16
- const { t: a, te: B } = ot(), te = Ze(), oe = et(), b = Be(), Re = We(), { business: Ie } = he(we()), {
17
- reports: d,
18
- overviewReport: E,
15
+ setup(lt) {
16
+ const { t: a, te: J } = at(), te = et(), oe = tt(), b = Be(), Ce = Xe(), { business: Ie } = Re(Pe()), {
17
+ reports: m,
18
+ overviewReport: B,
19
19
  categories: $,
20
20
  pinReport: O,
21
- isOpenAddReportDialog: Pe,
21
+ isOpenAddReportDialog: xe,
22
22
  scrollPositionY: ae,
23
23
  customReportQuota: F,
24
24
  canCreateCustomReport: se
25
- } = he(b), { promptMessage: re } = Me(), { promptLoader: K } = Ye(), l = qe(), { breakpoints: p } = He(), { canRead: ne, canUpdate: le, canDuplicate: ie, canDelete: M, canCreateReport: ke } = Xe(), h = z();
26
- tt(() => {
27
- h.value && (ae.value = h.value.$el.children[0].scrollTop);
28
- }), be(h, () => {
29
- h.value && setTimeout(() => {
30
- h.value && (h.value.$el.children[0].scrollTop = ae.value);
25
+ } = Re(b), { promptMessage: re } = Ye(), { promptLoader: K } = qe(), l = He(), { breakpoints: p } = je(), { canRead: ne, canUpdate: le, canDuplicate: ce, canDelete: E, canCreateReport: ke } = Ze(), w = M();
26
+ ot(() => {
27
+ w.value && (ae.value = w.value.$el.children[0].scrollTop);
28
+ }), ge(w, () => {
29
+ w.value && setTimeout(() => {
30
+ w.value && (w.value.$el.children[0].scrollTop = ae.value);
31
31
  }, 200);
32
32
  });
33
- const Y = R(() => O.value && d.value ? d.value.filter((o) => {
33
+ const Y = P(() => O.value && m.value ? m.value.filter((o) => {
34
34
  var e;
35
35
  return (e = O.value) == null ? void 0 : e.includes(o.id);
36
36
  }) : []);
37
- be(
37
+ ge(
38
38
  [() => Ie.value],
39
39
  () => {
40
40
  b.refreshPinReport();
41
41
  },
42
42
  { immediate: !0 }
43
43
  );
44
- const ce = R(() => Y.value.length > 0 ? d.value.filter(
44
+ const ie = P(() => Y.value.length > 0 ? m.value.filter(
45
45
  (o) => Y.value.findIndex((e) => e.id === o.id) === -1
46
- ) : d.value), { FmButton: xe, FmMenu: q, FmMenuItem: w, FmIcon: H, FmChip: j, FmTooltip: De, FmSwitch: pe } = je, v = z(/* @__PURE__ */ new Set()), ue = R(() => [
46
+ ) : m.value), { FmButton: De, FmMenu: q, FmMenuItem: R, FmIcon: H, FmChip: j, FmTooltip: _e, FmSwitch: pe } = Ge, y = M(/* @__PURE__ */ new Set()), de = /* @__PURE__ */ new Set([
47
+ "closeup",
48
+ "dailySales",
49
+ "hourlySales",
50
+ "productSales",
51
+ "discount",
52
+ "addonSales",
53
+ "userProductSales",
54
+ "categorySales",
55
+ "sourceProductSales",
56
+ "slotSales",
57
+ "drawer",
58
+ "counter",
59
+ "timesheet",
60
+ "void_",
61
+ "refund"
62
+ ]), ue = P(() => [
47
63
  { value: void 0, label: "All" },
48
64
  ...$.value.map((o) => ({
49
65
  value: o.id,
50
66
  label: o.name
51
67
  }))
52
- ]), L = z(ue.value[0]), G = z(""), I = R(() => ce.value.length === 0 || $.value.length === 0 ? [] : [
68
+ ]), L = M(ue.value[0]), G = M(""), C = P(() => ie.value.length === 0 || $.value.length === 0 ? [] : [
53
69
  ...Y.value.map((e) => {
54
70
  const r = $.value.find((n) => n.id === e.category);
55
71
  return {
56
- name: ee(a, B, e.name, "other"),
72
+ name: ee(a, J, e.name, "other"),
57
73
  categoryId: (r == null ? void 0 : r.id) ?? "",
58
74
  category: r != null && r.name ? a(`report.category.${r.name}`) : a("report.common.uncategorized"),
59
75
  reportId: e.id,
@@ -63,14 +79,14 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
63
79
  canUpdate: le(e),
64
80
  canRead: ne(e),
65
81
  isSupportPos: !!e.isSupportPos,
66
- isPosSupportConfigurable: e.isPosSupportConfigurable !== !1,
82
+ isMandatoryPosReport: e.isDefault && de.has(e.permissionKey ?? ""),
67
83
  reportType: e.reportType
68
84
  };
69
85
  }),
70
- ...ce.value.map((e) => {
86
+ ...ie.value.map((e) => {
71
87
  const r = $.value.find((n) => n.id === e.category);
72
88
  return {
73
- name: ee(a, B, e.name, "other"),
89
+ name: ee(a, J, e.name, "other"),
74
90
  categoryId: (r == null ? void 0 : r.id) ?? "",
75
91
  category: r != null && r.name ? a(`report.category.${r.name}`) : a("report.common.uncategorized"),
76
92
  reportId: e.id,
@@ -80,20 +96,20 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
80
96
  canUpdate: le(e),
81
97
  canRead: ne(e),
82
98
  isSupportPos: !!e.isSupportPos,
83
- isPosSupportConfigurable: e.isPosSupportConfigurable !== !1,
99
+ isMandatoryPosReport: e.isDefault && de.has(e.permissionKey ?? ""),
84
100
  reportType: e.reportType
85
101
  };
86
102
  })
87
- ].filter((e) => L.value.value && e.categoryId !== L.value.value ? !1 : `${(e == null ? void 0 : e.name) || ""}${(e == null ? void 0 : e.description) || ""}`.toLowerCase().indexOf(G.value.toLowerCase()) !== -1)), _e = R(
88
- () => I.value.map((o) => `${o.name}${o.category}`).toString()
89
- ), $e = R(() => [
103
+ ].filter((e) => L.value.value && e.categoryId !== L.value.value ? !1 : `${(e == null ? void 0 : e.name) || ""}${(e == null ? void 0 : e.description) || ""}`.toLowerCase().indexOf(G.value.toLowerCase()) !== -1)), $e = P(
104
+ () => C.value.map((o) => `${o.name}${o.category}`).toString()
105
+ ), Oe = P(() => [
90
106
  {
91
107
  accessorKey: "name",
92
108
  header: a("report.common.name"),
93
109
  enableSorting: !1,
94
110
  cell: (o) => {
95
111
  const e = o.row.original;
96
- return f(
112
+ return d(
97
113
  "span",
98
114
  { class: e.canRead ? "" : "opacity-40 cursor-not-allowed" },
99
115
  o.getValue()
@@ -107,7 +123,7 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
107
123
  meta: {
108
124
  width: "100px"
109
125
  },
110
- cell: (o) => f(
126
+ cell: (o) => d(
111
127
  j,
112
128
  {
113
129
  // grey out chip text when user cannot read report
@@ -123,7 +139,7 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
123
139
  enableSorting: !1,
124
140
  cell: (o) => {
125
141
  const e = o.row.original;
126
- return f(
142
+ return d(
127
143
  "span",
128
144
  { class: e.canRead ? "" : "opacity-40 cursor-not-allowed" },
129
145
  o.getValue()
@@ -135,11 +151,11 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
135
151
  id: "Action",
136
152
  header: a("report.common.actions"),
137
153
  meta: {
138
- width: "140px"
154
+ width: "130px"
139
155
  },
140
156
  cell: (o) => {
141
- var m;
142
- const e = o.row.original, r = e.reportId, n = d.value.find((g) => g.id === r), X = r === ((m = E.value) == null ? void 0 : m.id), T = !e.canRead, D = n ? ie(n) : !1, A = n ? M(n) : !1, s = !e.canUpdate || !e.isPosSupportConfigurable || v.value.has(r), P = e.isPosSupportConfigurable ? a("reportV5.reportList.posV8Hint") : a("reportV5.reportList.mandatoryPosReportHint"), c = [
157
+ var f;
158
+ const e = o.row.original, r = e.reportId, n = m.value.find((g) => g.id === r), X = r === ((f = B.value) == null ? void 0 : f.id), T = !e.canRead, D = n ? ce(n) : !1, A = n ? E(n) : !1, s = !e.canUpdate || e.isMandatoryPosReport || y.value.has(r), I = e.isMandatoryPosReport ? a("reportV5.reportList.mandatoryPosReportHint") : a("reportV5.reportList.posV8Hint"), i = [
143
159
  {
144
160
  label: a("report.common.duplicate"),
145
161
  onClick: () => {
@@ -154,7 +170,7 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
154
170
  {
155
171
  label: a(X ? "report.common.unsetAsOverview" : "report.common.setAsOverview"),
156
172
  onClick: async () => {
157
- n && de(n);
173
+ n && me(n);
158
174
  },
159
175
  variant: "",
160
176
  disabled: !1
@@ -162,7 +178,7 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
162
178
  {
163
179
  label: a("report.common.remove"),
164
180
  onClick: () => {
165
- n && (A ? fe(n) : l.open({
181
+ n && (A ? ye(n) : l.open({
166
182
  message: a("report.messages.noPermissionDeleteReport"),
167
183
  type: "error"
168
184
  }));
@@ -171,43 +187,46 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
171
187
  disabled: !e.editable || !A
172
188
  }
173
189
  ];
174
- return f(
190
+ return d(
175
191
  "div",
176
192
  {
177
193
  class: `flex ${p.value.lg || p.value.md ? "justify-end" : ""} items-center`
178
194
  },
179
195
  {
180
196
  default: () => [
181
- f(
182
- De,
183
- { content: P, placement: "bottom", zIndex: 2e3 },
197
+ d(
198
+ _e,
199
+ { content: I, placement: "bottom", zIndex: 2e3 },
184
200
  {
185
- default: () => f(pe, {
186
- modelValue: e.isSupportPos,
187
- disabled: s,
188
- "aria-label": a("report.common.showInPOS"),
189
- class: "mr-2 scale-75",
190
- "onUpdate:modelValue": () => {
191
- n && me(n);
192
- },
193
- onClick: ge(() => {
194
- }, ["stop"])
195
- })
201
+ default: () => d("div", { class: "mr-2 flex items-center gap-2" }, [
202
+ d("span", { class: "fm-typo-en-body-sm-400 whitespace-nowrap" }, "POS v8"),
203
+ d(pe, {
204
+ modelValue: e.isSupportPos,
205
+ disabled: s,
206
+ "aria-label": a("report.common.showInPOS"),
207
+ class: "pos-v8-switch",
208
+ "onUpdate:modelValue": () => {
209
+ n && fe(n);
210
+ },
211
+ onClick: Se(() => {
212
+ }, ["stop"])
213
+ })
214
+ ])
196
215
  }
197
216
  ),
198
- f(
217
+ d(
199
218
  "button",
200
219
  {
201
220
  disabled: T,
202
221
  title: T ? a("report.messages.noPermission") : void 0,
203
- onClick: ge(() => {
204
- n && ye(n);
222
+ onClick: Se(() => {
223
+ n && be(n);
205
224
  }, ["stop"]),
206
225
  class: `text-fm-color-neutral-gray-400 ${e.pin ? "" : "show-pin"} hover:bg-fm-color-opacity-sm rounded-lg flex items-center justify-center`
207
226
  },
208
227
  {
209
228
  default: () => [
210
- f(
229
+ d(
211
230
  H,
212
231
  {
213
232
  name: "keep",
@@ -220,7 +239,7 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
220
239
  ]
221
240
  }
222
241
  ),
223
- f(
242
+ d(
224
243
  q,
225
244
  {
226
245
  stopClickPropagation: !0,
@@ -228,9 +247,9 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
228
247
  disabled: !1
229
248
  },
230
249
  {
231
- default: () => c.map(
232
- (g) => f(
233
- w,
250
+ default: () => i.map(
251
+ (g) => d(
252
+ R,
234
253
  {
235
254
  onClick: g.disabled ? {} : g.onClick,
236
255
  label: g.label,
@@ -238,17 +257,17 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
238
257
  disabled: g.disabled
239
258
  },
240
259
  {
241
- label: () => f("p", g.label)
260
+ label: () => d("p", g.label)
242
261
  }
243
262
  )
244
263
  ),
245
- "menu-button": () => f(
246
- xe,
264
+ "menu-button": () => d(
265
+ De,
247
266
  {
248
267
  variant: "tertiary",
249
268
  size: "md",
250
269
  icon: "more_vert",
251
- iconColor: Ge.NeutralGray400,
270
+ iconColor: Qe.NeutralGray400,
252
271
  disabled: !1
253
272
  },
254
273
  {}
@@ -261,11 +280,11 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
261
280
  }
262
281
  }
263
282
  ]);
264
- async function de(o) {
283
+ async function me(o) {
265
284
  await K(async () => {
266
285
  var e;
267
286
  try {
268
- const r = o.id === ((e = E.value) == null ? void 0 : e.id);
287
+ const r = o.id === ((e = B.value) == null ? void 0 : e.id);
269
288
  await b.updateDefaultReport(r ? null : o.id), l.open({
270
289
  message: `Successfully ${r ? "unset" : "set"} ${o.name} as Overview`,
271
290
  type: "success"
@@ -275,24 +294,24 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
275
294
  }
276
295
  });
277
296
  }
278
- async function me(o) {
279
- if (!v.value.has(o.id)) {
280
- v.value = new Set(v.value).add(o.id);
297
+ async function fe(o) {
298
+ if (!y.value.has(o.id)) {
299
+ y.value = new Set(y.value).add(o.id);
281
300
  try {
282
301
  const e = !o.isSupportPos;
283
- await Ee(o.id, e), o.isSupportPos = e;
302
+ await Ke(o.id, e), o.isSupportPos = e;
284
303
  } catch (e) {
285
304
  console.log(e), l.open({
286
305
  message: a("report.messages.failedToAction", { action: a("report.common.update") }),
287
306
  type: "error"
288
307
  });
289
308
  } finally {
290
- const e = new Set(v.value);
291
- e.delete(o.id), v.value = e;
309
+ const e = new Set(y.value);
310
+ e.delete(o.id), y.value = e;
292
311
  }
293
312
  }
294
313
  }
295
- async function Oe(o) {
314
+ async function Fe(o) {
296
315
  if (await re({
297
316
  title: a("report.common.duplicate"),
298
317
  message: a("report.messages.confirmAction", {
@@ -314,15 +333,15 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
314
333
  }
315
334
  }
316
335
  function Q(o) {
317
- const e = d.value.find((r) => r.id === o.reportId);
318
- return !e || !ie(e);
336
+ const e = m.value.find((r) => r.id === o.reportId);
337
+ return !e || !ce(e);
319
338
  }
320
339
  function W(o) {
321
- const e = d.value.find((r) => r.id === o.reportId);
322
- return !o.editable || !e || !M(e);
340
+ const e = m.value.find((r) => r.id === o.reportId);
341
+ return !o.editable || !e || !E(e);
323
342
  }
324
- async function fe(o) {
325
- if (!M(o)) {
343
+ async function ye(o) {
344
+ if (!E(o)) {
326
345
  l.open({
327
346
  message: a("report.messages.noPermissionDeleteReport"),
328
347
  type: "error"
@@ -345,7 +364,7 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
345
364
  }
346
365
  async function ve(o) {
347
366
  if (se.value)
348
- await Oe(o);
367
+ await Fe(o);
349
368
  else {
350
369
  let e = `Your current plan only support up to ${F.value} custom reports.`;
351
370
  F.value === 0 && (e = "Your current plan does not support custom report."), l.open({
@@ -354,7 +373,7 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
354
373
  });
355
374
  }
356
375
  }
357
- function Fe() {
376
+ function Le() {
358
377
  if (!ke.value) {
359
378
  l.open({
360
379
  message: a("report.messages.noPermission"),
@@ -363,7 +382,7 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
363
382
  return;
364
383
  }
365
384
  if (se.value)
366
- Pe.value = !0;
385
+ xe.value = !0;
367
386
  else {
368
387
  let o = `Your current plan only support up to ${F.value} custom reports.`;
369
388
  F.value === 0 && (o = "Your current plan does not support custom report."), l.open({
@@ -372,8 +391,8 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
372
391
  });
373
392
  }
374
393
  }
375
- function ye(o) {
376
- const e = ee(a, B, o.name, "other") ?? "";
394
+ function be(o) {
395
+ const e = ee(a, J, o.name, "other") ?? "";
377
396
  O.value && O.value.includes(o.id) ? (l.open({
378
397
  message: `${a("report.common.unpin")} ${e} ${a("report.common.successful")}`,
379
398
  type: "success"
@@ -382,15 +401,15 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
382
401
  type: "success"
383
402
  }), b.cachePinReport(o));
384
403
  }
385
- function Le(o) {
404
+ function Ve(o) {
386
405
  L.value = o;
387
406
  }
388
- const { selectedLocationIds: x, dateRange: V, compareDateRange: N, timeRange: S, locations: Ve } = we(), U = R(() => x.length === Ve.length);
407
+ const { selectedLocationIds: k, dateRange: V, compareDateRange: N, timeRange: S, locations: Ne } = Pe(), U = P(() => k.length === Ne.length);
389
408
  return (o, e) => {
390
- const r = k("FmPageHead"), n = k("FmSearch"), X = k("FmForm"), T = k("FmListItem"), D = k("FmList"), A = k("FmTable");
391
- return J(), Z(Ke, null, {
409
+ const r = x("FmPageHead"), n = x("FmSearch"), X = x("FmForm"), T = x("FmListItem"), D = x("FmList"), A = x("FmTable");
410
+ return z(), Z(Ee, null, {
392
411
  default: u(() => [
393
- i(r, {
412
+ c(r, {
394
413
  title: t(a)("report.common.report", 1),
395
414
  class: "h-[68px]",
396
415
  actions: [
@@ -401,60 +420,60 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
401
420
  prependIcon: "add"
402
421
  }
403
422
  ],
404
- "onClick:action": e[0] || (e[0] = (s) => Fe())
423
+ "onClick:action": e[0] || (e[0] = (s) => Le())
405
424
  }, null, 8, ["title", "actions"]),
406
- C("div", {
407
- class: y(`overflow-y-hidden flex flex-col gap-8 ${t(p).sm || t(p).xs ? "mb-20" : ""}`),
408
- style: Ue({ height: `calc(100% - ${t(p).lg || t(p).md ? 72 : 64}px)` })
425
+ h("div", {
426
+ class: v(`overflow-y-hidden flex flex-col gap-8 ${t(p).sm || t(p).xs ? "mb-20" : ""}`),
427
+ style: Te({ height: `calc(100% - ${t(p).lg || t(p).md ? 72 : 64}px)` })
409
428
  }, [
410
- i(X, {
411
- class: y(`flex items-center gap-2 ${t(p).sm || t(p).xs ? "px-3" : "px-24"}`)
429
+ c(X, {
430
+ class: v(`flex items-center gap-2 ${t(p).sm || t(p).xs ? "px-3" : "px-24"}`)
412
431
  }, {
413
432
  default: u(() => [
414
- i(t(q), null, {
433
+ c(t(q), null, {
415
434
  "menu-button": u(() => [
416
- i(t(j), { class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-400" }, {
435
+ c(t(j), { class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-400" }, {
417
436
  default: u(() => [
418
- C("p", null, _(t(a)(`report.category.${L.value.label}`)), 1),
419
- i(t(H), { name: "expand_more" })
437
+ h("p", null, _(t(a)(`report.category.${L.value.label}`)), 1),
438
+ c(t(H), { name: "expand_more" })
420
439
  ]),
421
440
  _: 1
422
441
  })
423
442
  ]),
424
443
  default: u(() => [
425
- (J(!0), Te(Ae, null, ze(ue.value, (s, P) => (J(), Z(t(w), {
426
- key: P,
444
+ (z(!0), Ae(Me, null, ze(ue.value, (s, I) => (z(), Z(t(R), {
445
+ key: I,
427
446
  label: t(a)(`report.category.${s.label}`),
428
- onClick: () => Le(s)
447
+ onClick: () => Ve(s)
429
448
  }, null, 8, ["label", "onClick"]))), 128))
430
449
  ]),
431
450
  _: 1
432
451
  }),
433
- C("div", {
434
- class: y(`flex ${t(p).sm || t(p).xs ? "justify-center items-center" : ""}`)
452
+ h("div", {
453
+ class: v(`flex ${t(p).sm || t(p).xs ? "justify-center items-center" : ""}`)
435
454
  }, [
436
- C("p", at, _(t(a)("report.common.results", { count: I.value.length })), 1)
455
+ h("p", st, _(t(a)("report.common.results", { count: C.value.length })), 1)
437
456
  ], 2),
438
- e[3] || (e[3] = C("div", { class: "grow" }, null, -1)),
439
- C("div", st, [
440
- i(n, {
457
+ e[3] || (e[3] = h("div", { class: "grow" }, null, -1)),
458
+ h("div", rt, [
459
+ c(n, {
441
460
  modelValue: G.value,
442
461
  "onUpdate:modelValue": e[1] || (e[1] = (s) => G.value = s),
443
- class: y(`${t(p).lg || t(p).md ? "grow" : ""}`)
462
+ class: v(`${t(p).lg || t(p).md ? "grow" : ""}`)
444
463
  }, null, 8, ["modelValue", "class"])
445
464
  ])
446
465
  ]),
447
466
  _: 1
448
467
  }, 8, ["class"]),
449
- Se((J(), Z(A, {
450
- key: _e.value,
468
+ he((z(), Z(A, {
469
+ key: $e.value,
451
470
  ref_key: "table",
452
- ref: h,
453
- class: y([t(p).sm || t(p).xs ? "px-0" : "px-24", "report-table"]),
471
+ ref: w,
472
+ class: v([t(p).sm || t(p).xs ? "px-0" : "px-24", "report-table"]),
454
473
  style: { height: "calc(100% - 40px)" },
455
- "column-defs": $e.value,
456
- "row-data": I.value,
457
- "page-size": I.value.length,
474
+ "column-defs": Oe.value,
475
+ "row-data": C.value,
476
+ "page-size": C.value.length,
458
477
  "hide-footer": !0,
459
478
  "row-class-name": "row",
460
479
  onRowClick: e[2] || (e[2] = (s) => {
@@ -465,7 +484,7 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
465
484
  });
466
485
  return;
467
486
  }
468
- t(Re).suppressReportRouteSync = !0, t(b).updateCurrentReportId(s.original.reportId), t(te).push({
487
+ t(Ce).suppressReportRouteSync = !0, t(b).updateCurrentReportId(s.original.reportId), t(te).push({
469
488
  name: "reportView",
470
489
  query: {
471
490
  ...t(oe).query,
@@ -477,13 +496,13 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
477
496
  timeStart: t(S).start ? JSON.stringify(t(S).start) : null,
478
497
  timeEnd: t(S).end ? JSON.stringify(t(S).end) : null,
479
498
  isAllLocation: U.value.toString(),
480
- locationIds: U.value ? void 0 : t(x) ? JSON.stringify(t(x)) : void 0
499
+ locationIds: U.value ? void 0 : t(k) ? JSON.stringify(t(k)) : void 0
481
500
  }
482
501
  });
483
502
  })
484
503
  }, {
485
504
  "list-row": u(({ original: s }) => [
486
- i(D, {
505
+ c(D, {
487
506
  onClick: () => {
488
507
  if (!s.canRead) {
489
508
  t(l).open({
@@ -504,54 +523,54 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
504
523
  timeStart: t(S).start ? JSON.stringify(t(S).start) : null,
505
524
  timeEnd: t(S).end ? JSON.stringify(t(S).end) : null,
506
525
  isAllLocation: U.value.toString(),
507
- locationIds: U.value ? void 0 : t(x) ? JSON.stringify(t(x)) : void 0
526
+ locationIds: U.value ? void 0 : t(k) ? JSON.stringify(t(k)) : void 0
508
527
  }
509
528
  }));
510
529
  }
511
530
  }, {
512
531
  default: u(() => [
513
- i(T, {
532
+ c(T, {
514
533
  tag: "label",
515
534
  clickable: ""
516
535
  }, {
517
536
  append: u(() => [
518
- i(t(j), {
519
- class: y(`${s.category !== "Uncategorized" ? "bg-fm-color-system-info-100 text-fm-color-typo-info" : "text-fm-color-typo-secondary"} ${s.canRead ? "" : "opacity-40 cursor-not-allowed"}`),
537
+ c(t(j), {
538
+ class: v(`${s.category !== "Uncategorized" ? "bg-fm-color-system-info-100 text-fm-color-typo-info" : "text-fm-color-typo-secondary"} ${s.canRead ? "" : "opacity-40 cursor-not-allowed"}`),
520
539
  compact: !0
521
540
  }, {
522
541
  default: u(() => [
523
- C("p", rt, _(s.category), 1)
542
+ h("p", nt, _(s.category), 1)
524
543
  ]),
525
544
  _: 2
526
545
  }, 1032, ["class"]),
527
- i(t(q), {
546
+ c(t(q), {
528
547
  placement: "left",
529
548
  "stop-click-propagation": !0
530
549
  }, {
531
550
  "menu-button": u(() => [
532
- i(t(H), {
551
+ c(t(H), {
533
552
  name: "more_vert",
534
553
  class: "btn-color"
535
554
  })
536
555
  ]),
537
556
  default: u(() => {
538
- var P;
557
+ var I;
539
558
  return [
540
- i(t(w), {
559
+ c(t(R), {
541
560
  label: s.pin ? "Unpin" : "Pin",
542
561
  onClick: () => {
543
- const c = t(d).find(
544
- (m) => m.id === s.reportId
562
+ const i = t(m).find(
563
+ (f) => f.id === s.reportId
545
564
  );
546
- c && ye(c);
565
+ i && be(i);
547
566
  }
548
567
  }, null, 8, ["label", "onClick"]),
549
- i(t(w), {
568
+ c(t(R), {
550
569
  label: t(a)("report.common.showInPOS"),
551
- disabled: !s.canUpdate || !s.isPosSupportConfigurable || v.value.has(s.reportId),
552
- "aria-disabled": !s.canUpdate || !s.isPosSupportConfigurable || v.value.has(s.reportId),
553
- class: y(
554
- !s.canUpdate || !s.isPosSupportConfigurable || v.value.has(s.reportId) ? "text-fm-color-typo-disabled" : ""
570
+ disabled: !s.canUpdate || s.isMandatoryPosReport || y.value.has(s.reportId),
571
+ "aria-disabled": !s.canUpdate || s.isMandatoryPosReport || y.value.has(s.reportId),
572
+ class: v(
573
+ !s.canUpdate || s.isMandatoryPosReport || y.value.has(s.reportId) ? "text-fm-color-typo-disabled" : ""
555
574
  ),
556
575
  onClick: () => {
557
576
  if (!s.canUpdate) {
@@ -561,60 +580,60 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
561
580
  });
562
581
  return;
563
582
  }
564
- const c = t(d).find(
565
- (m) => m.id === s.reportId
583
+ const i = t(m).find(
584
+ (f) => f.id === s.reportId
566
585
  );
567
- c && me(c);
586
+ i && fe(i);
568
587
  }
569
588
  }, {
570
589
  append: u(() => [
571
- i(t(pe), {
590
+ c(t(pe), {
572
591
  "model-value": s.isSupportPos,
573
- disabled: !s.canUpdate || !s.isPosSupportConfigurable || v.value.has(s.reportId),
592
+ disabled: !s.canUpdate || s.isMandatoryPosReport || y.value.has(s.reportId),
574
593
  "aria-label": "Show in POS v8",
575
594
  class: "pointer-events-none"
576
595
  }, null, 8, ["model-value", "disabled"])
577
596
  ]),
578
597
  _: 2
579
598
  }, 1032, ["label", "disabled", "aria-disabled", "class", "onClick"]),
580
- i(t(w), {
599
+ c(t(R), {
581
600
  label: t(a)("report.common.duplicate"),
582
601
  disabled: Q(s),
583
- class: y(
602
+ class: v(
584
603
  Q(s) ? "text-fm-color-typo-disabled" : ""
585
604
  ),
586
605
  onClick: () => {
587
- const c = t(d).find(
588
- (m) => m.id === s.reportId
606
+ const i = t(m).find(
607
+ (f) => f.id === s.reportId
589
608
  );
590
- c && !Q(s) ? ve(c) : t(l).open({
609
+ i && !Q(s) ? ve(i) : t(l).open({
591
610
  message: t(a)("report.messages.noPermissionDuplicateReport"),
592
611
  type: "error"
593
612
  });
594
613
  }
595
614
  }, null, 8, ["label", "disabled", "class", "onClick"]),
596
- i(t(w), {
615
+ c(t(R), {
597
616
  label: t(a)(
598
- s.reportId === ((P = t(E)) == null ? void 0 : P.id) ? "report.common.unsetAsOverview" : "report.common.setAsOverview"
617
+ s.reportId === ((I = t(B)) == null ? void 0 : I.id) ? "report.common.unsetAsOverview" : "report.common.setAsOverview"
599
618
  ),
600
619
  onClick: () => {
601
- const c = t(d).find(
602
- (m) => m.id === s.reportId
620
+ const i = t(m).find(
621
+ (f) => f.id === s.reportId
603
622
  );
604
- c && de(c);
623
+ i && me(i);
605
624
  }
606
625
  }, null, 8, ["label", "onClick"]),
607
- i(t(w), {
626
+ c(t(R), {
608
627
  label: t(a)("report.common.delete"),
609
628
  disabled: W(s),
610
- class: y(
629
+ class: v(
611
630
  W(s) ? "text-fm-color-typo-disabled" : "text-fm-color-typo-error"
612
631
  ),
613
632
  onClick: () => {
614
- const c = t(d).find(
615
- (m) => m.id === s.reportId
633
+ const i = t(m).find(
634
+ (f) => f.id === s.reportId
616
635
  );
617
- c && !W(s) && fe(c);
636
+ i && !W(s) && ye(i);
618
637
  }
619
638
  }, {
620
639
  label: u(() => [
@@ -628,8 +647,8 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
628
647
  }, 1024)
629
648
  ]),
630
649
  default: u(() => [
631
- C("span", {
632
- class: y(["fm-typo-en-body-lg-400 line-clamp-1 break-all text-fm-color-typo-primary", s.canRead ? "" : "opacity-40 cursor-not-allowed"])
650
+ h("span", {
651
+ class: v(["fm-typo-en-body-lg-400 line-clamp-1 break-all text-fm-color-typo-primary", s.canRead ? "" : "opacity-40 cursor-not-allowed"])
633
652
  }, _(s.name), 3)
634
653
  ]),
635
654
  _: 2
@@ -640,10 +659,10 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
640
659
  ]),
641
660
  _: 1
642
661
  }, 8, ["class", "column-defs", "row-data", "page-size"])), [
643
- [Ce, I.value.length > 0]
662
+ [we, C.value.length > 0]
644
663
  ]),
645
- Se(i(Qe, null, null, 512), [
646
- [Ce, I.value.length === 0]
664
+ he(c(We, null, null, 512), [
665
+ [we, C.value.length === 0]
647
666
  ])
648
667
  ], 6)
649
668
  ]),
@@ -653,5 +672,5 @@ const at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st
653
672
  }
654
673
  });
655
674
  export {
656
- St as default
675
+ ht as default
657
676
  };