@feedmepos/mf-report 5.28.4-beta.6 → 5.28.5-beta.0

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 (28) hide show
  1. package/dist/{App-c2BxKgqk.js → App-DGKt1n7o.js} +4 -4
  2. package/dist/{DateRangeSelect-BpBpNlAF.js → DateRangeSelect-Y_Nn-osm.js} +1 -1
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-D-Se8EHw.js → Default.vue_vue_type_script_setup_true_lang-BlXGP4t_.js} +1 -1
  4. package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-CUomxbbm.js → DynamicWidget.vue_vue_type_script_setup_true_lang-CEjHfVNa.js} +4 -4
  5. package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-D43rK-ar.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-DAZLziOO.js} +3 -3
  6. package/dist/{InsightView-DPRA524-.js → InsightView-BriTcgPJ.js} +5 -5
  7. package/dist/{Integration-BayS_wae.js → Integration-D5ms6fn1.js} +3 -3
  8. package/dist/{Integrations-6UBvLfz6.js → Integrations-DQvYF26T.js} +2 -2
  9. package/dist/{Layout-CvY-cS3c.js → Layout-BBLVmRJi.js} +1 -1
  10. package/dist/{LocationSelect.vue_vue_type_script_setup_true_lang-CGAnWHiG.js → LocationSelect.vue_vue_type_script_setup_true_lang-S5P6mT78.js} +2 -2
  11. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-DeQo93qA.js → MenuTab.vue_vue_type_script_setup_true_lang-DvwbNmby.js} +5 -5
  12. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-Dl2ZSI8f.js → NavigationTab.vue_vue_type_script_setup_true_lang-BvYT2Izx.js} +5 -5
  13. package/dist/{OverviewView-SxYadRgK.js → OverviewView-CCboDE2n.js} +4 -4
  14. package/dist/{Report-OGP3775t.js → Report-DeLOcjgU.js} +249 -226
  15. package/dist/{ReportCanvasView-5pLCE58u.js → ReportCanvasView-DGwF-pyG.js} +3 -3
  16. package/dist/{ReportEditor-C3r_5wKe.js → ReportEditor-ZoXssGrp.js} +7 -7
  17. package/dist/{ReportView-BeNILR1t.js → ReportView-CPmqBn6n.js} +6 -6
  18. package/dist/{ReportViewRoute-Cw8EbetI.js → ReportViewRoute-Ddd_509O.js} +2 -2
  19. package/dist/{Setting-_scvQJEC.js → Setting-DSnAtGwo.js} +3 -3
  20. package/dist/{Template-CnDYWRaV.js → Template-iqP8PeTT.js} +3 -3
  21. package/dist/{TileEditor-Caal9QVe.js → TileEditor-Dyk5r6FN.js} +6 -6
  22. package/dist/{TilePageStack.vue_vue_type_script_setup_true_lang-4IWIJo_S.js → TilePageStack.vue_vue_type_script_setup_true_lang-CLBcYijT.js} +2 -2
  23. package/dist/{TransitionFade-DSsnM6J9.js → TransitionFade-DUNn6p37.js} +5 -5
  24. package/dist/{app-e8Pud10z.js → app-D_8mXWLj.js} +12 -12
  25. package/dist/app.js +1 -1
  26. package/dist/{report-AhRrPMU6.js → report-C_upEzzb.js} +1 -1
  27. package/dist/{useRestaurantPermission-D2RhNs5d.js → useRestaurantPermission-Qu5NXD3o.js} +1 -1
  28. package/package.json +1 -1
@@ -1,49 +1,49 @@
1
- import { defineComponent as Te, ref as $, watch as Se, computed as R, h as d, withModifiers as we, resolveComponent as I, createBlock as ee, openBlock as z, withCtx as m, createVNode as c, createElementVNode as v, unref as t, normalizeStyle as Ae, normalizeClass as g, withDirectives as he, createElementBlock as ze, Fragment as Je, renderList as Be, toDisplayString as k, createTextVNode as Ke, vShow as Re } from "vue";
2
- import { storeToRefs as xe } from "pinia";
3
- import { u as Ee, s as je } from "./report-AhRrPMU6.js";
4
- import { _ as Ye } from "./Default.vue_vue_type_script_setup_true_lang-D-Se8EHw.js";
5
- import { u as qe } from "./message-dialog-UoMWOnil.js";
6
- import { u as He } from "./global-loader-BuxFfehu.js";
7
- import { useSnackbar as Ge, useBreakpoints as Qe, components as We, FmButtonColorThemeVariant as Xe } from "@feedmepos/ui-library";
8
- import { _ as Ze } from "./SelectComponent.vue_vue_type_script_setup_true_lang-DW7Dk7iQ.js";
9
- import { c as et, a as Pe, h as tt } from "./app-e8Pud10z.js";
10
- import { useRouter as ot, useRoute as at, onBeforeRouteLeave as st } from "vue-router";
11
- import { useI18n as rt } from "@feedmepos/mf-common";
12
- import { r as te } from "./i18n-DbyciK4x.js";
13
- const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt = { class: "w-[343px]" }, ct = { class: "fm-typo-en-body-md-600" }, it = ["tabindex", "aria-disabled", "onClick"], pt = { class: "fm-typo-en-body-md-400 max-w-[240px]" }, Pt = /* @__PURE__ */ Te({
1
+ import { defineComponent as Te, ref as $, watch as Se, computed as R, h as u, withModifiers as Ae, resolveComponent as I, createBlock as ae, openBlock as J, withCtx as f, createVNode as i, createElementVNode as v, unref as t, normalizeStyle as ze, normalizeClass as b, withDirectives as we, createElementBlock as Je, Fragment as Be, renderList as Ke, toDisplayString as k, createTextVNode as Ee, vShow as he } from "vue";
2
+ import { storeToRefs as Re } from "pinia";
3
+ import { u as je, s as Ye } from "./report-C_upEzzb.js";
4
+ import { _ as qe } from "./Default.vue_vue_type_script_setup_true_lang-BlXGP4t_.js";
5
+ import { u as He } from "./message-dialog-UoMWOnil.js";
6
+ import { u as Ge } from "./global-loader-BuxFfehu.js";
7
+ import { useSnackbar as Qe, useBreakpoints as We, components as Xe, FmButtonColorThemeVariant as Ze } from "@feedmepos/ui-library";
8
+ import { _ as et } from "./SelectComponent.vue_vue_type_script_setup_true_lang-DW7Dk7iQ.js";
9
+ import { c as tt, a as Pe, h as ot } from "./app-D_8mXWLj.js";
10
+ import { useRouter as at, useRoute as st, onBeforeRouteLeave as rt } from "vue-router";
11
+ import { useI18n as nt } from "@feedmepos/mf-common";
12
+ import { r as se } from "./i18n-DbyciK4x.js";
13
+ const lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it = { class: "w-[343px]" }, ct = { class: "fm-typo-en-body-md-600" }, pt = ["tabindex", "aria-disabled", "onClick"], dt = { class: "fm-typo-en-body-md-400 max-w-[240px]" }, Ct = /* @__PURE__ */ Te({
14
14
  __name: "Report",
15
- setup(dt) {
16
- const { t: a, te: J } = rt(), oe = ot(), ae = at(), S = Ee(), Ce = et(), { business: Ie } = xe(Pe()), {
17
- reports: f,
18
- overviewReport: B,
15
+ setup(ut) {
16
+ const { t: a, te: B } = nt(), re = at(), ne = st(), S = je(), xe = tt(), { business: Ce } = Re(Pe()), {
17
+ reports: y,
18
+ overviewReport: K,
19
19
  categories: O,
20
20
  pinReport: F,
21
- isOpenAddReportDialog: ke,
22
- scrollPositionY: se,
21
+ isOpenAddReportDialog: Ie,
22
+ scrollPositionY: le,
23
23
  customReportQuota: L,
24
- canCreateCustomReport: re
25
- } = xe(S), { promptMessage: ne } = qe(), { promptLoader: K } = He(), l = Ge(), { breakpoints: p } = Qe(), { canRead: le, canUpdate: ce, canDuplicate: ie, canDelete: E, canCreateReport: _e } = tt(), h = $();
26
- st(() => {
27
- h.value && (se.value = h.value.$el.children[0].scrollTop);
24
+ canCreateCustomReport: ie
25
+ } = Re(S), { promptMessage: ce } = He(), { promptLoader: E } = Ge(), l = Qe(), { breakpoints: d } = We(), { canRead: pe, canUpdate: j, canDuplicate: de, canDelete: Y, canCreateReport: ke } = ot(), h = $();
26
+ rt(() => {
27
+ h.value && (le.value = h.value.$el.children[0].scrollTop);
28
28
  }), Se(h, () => {
29
29
  h.value && setTimeout(() => {
30
- h.value && (h.value.$el.children[0].scrollTop = se.value);
30
+ h.value && (h.value.$el.children[0].scrollTop = le.value);
31
31
  }, 200);
32
32
  });
33
- const j = R(() => F.value && f.value ? f.value.filter((o) => {
33
+ const q = R(() => F.value && y.value ? y.value.filter((o) => {
34
34
  var e;
35
35
  return (e = F.value) == null ? void 0 : e.includes(o.id);
36
36
  }) : []);
37
37
  Se(
38
- [() => Ie.value],
38
+ [() => Ce.value],
39
39
  () => {
40
40
  S.refreshPinReport();
41
41
  },
42
42
  { immediate: !0 }
43
43
  );
44
- const pe = R(() => j.value.length > 0 ? f.value.filter(
45
- (o) => j.value.findIndex((e) => e.id === o.id) === -1
46
- ) : f.value), { FmButton: De, FmMenu: Y, FmMenuItem: x, FmIcon: q, FmChip: H, FmTooltip: $e, FmSwitch: de } = We, b = $(/* @__PURE__ */ new Set()), G = $(/* @__PURE__ */ new Map()), ue = /* @__PURE__ */ new Set([
44
+ const ue = R(() => q.value.length > 0 ? y.value.filter(
45
+ (o) => q.value.findIndex((e) => e.id === o.id) === -1
46
+ ) : y.value), { FmButton: _e, FmMenu: H, FmMenuItem: P, FmIcon: G, FmChip: Q, FmTooltip: De, FmSwitch: me } = Xe, g = $(/* @__PURE__ */ new Set()), W = $(/* @__PURE__ */ new Map()), $e = /* @__PURE__ */ new Set([
47
47
  "closeup",
48
48
  "dailySales",
49
49
  "hourlySales",
@@ -59,49 +59,53 @@ const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt
59
59
  "timesheet",
60
60
  "void_",
61
61
  "refund"
62
- ]), me = R(() => [
62
+ ]), fe = R(() => [
63
63
  { value: void 0, label: "All" },
64
64
  ...O.value.map((o) => ({
65
65
  value: o.id,
66
66
  label: o.name
67
67
  }))
68
- ]), V = $(me.value[0]), Q = $(""), P = R(() => pe.value.length === 0 || O.value.length === 0 ? [] : [
69
- ...j.value.map((e) => {
68
+ ]), M = $(fe.value[0]), X = $("");
69
+ function Z(o) {
70
+ return o.isDefault && $e.has(o.permissionKey ?? "");
71
+ }
72
+ const x = R(() => ue.value.length === 0 || O.value.length === 0 ? [] : [
73
+ ...q.value.map((e) => {
70
74
  const r = O.value.find((n) => n.id === e.category);
71
75
  return {
72
- name: te(a, J, e.name, "other"),
76
+ name: se(a, B, e.name, "other"),
73
77
  categoryId: (r == null ? void 0 : r.id) ?? "",
74
78
  category: r != null && r.name ? a(`report.category.${r.name}`) : a("report.common.uncategorized"),
75
79
  reportId: e.id,
76
80
  editable: e.editable,
77
81
  description: e.description || "",
78
82
  pin: !0,
79
- canUpdate: ce(e),
80
- canRead: le(e),
83
+ canUpdate: j(e),
84
+ canRead: pe(e),
81
85
  isSupportPos: !!e.isSupportPos,
82
- isMandatoryPosReport: e.isDefault && ue.has(e.permissionKey ?? ""),
86
+ isMandatoryPosReport: Z(e),
83
87
  reportType: e.reportType
84
88
  };
85
89
  }),
86
- ...pe.value.map((e) => {
90
+ ...ue.value.map((e) => {
87
91
  const r = O.value.find((n) => n.id === e.category);
88
92
  return {
89
- name: te(a, J, e.name, "other"),
93
+ name: se(a, B, e.name, "other"),
90
94
  categoryId: (r == null ? void 0 : r.id) ?? "",
91
95
  category: r != null && r.name ? a(`report.category.${r.name}`) : a("report.common.uncategorized"),
92
96
  reportId: e.id,
93
97
  editable: e.editable,
94
98
  description: e.description || "",
95
99
  pin: !1,
96
- canUpdate: ce(e),
97
- canRead: le(e),
100
+ canUpdate: j(e),
101
+ canRead: pe(e),
98
102
  isSupportPos: !!e.isSupportPos,
99
- isMandatoryPosReport: e.isDefault && ue.has(e.permissionKey ?? ""),
103
+ isMandatoryPosReport: Z(e),
100
104
  reportType: e.reportType
101
105
  };
102
106
  })
103
- ].filter((e) => V.value.value && e.categoryId !== V.value.value ? !1 : `${(e == null ? void 0 : e.name) || ""}${(e == null ? void 0 : e.description) || ""}`.toLowerCase().indexOf(Q.value.toLowerCase()) !== -1)), Oe = R(
104
- () => P.value.map((o) => `${o.name}${o.category}`).toString()
107
+ ].filter((e) => M.value.value && e.categoryId !== M.value.value ? !1 : `${(e == null ? void 0 : e.name) || ""}${(e == null ? void 0 : e.description) || ""}`.toLowerCase().indexOf(X.value.toLowerCase()) !== -1)), Oe = R(
108
+ () => x.value.map((o) => `${o.name}${o.category}`).toString()
105
109
  ), Fe = R(() => [
106
110
  {
107
111
  accessorKey: "name",
@@ -109,7 +113,7 @@ const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt
109
113
  enableSorting: !1,
110
114
  cell: (o) => {
111
115
  const e = o.row.original;
112
- return d(
116
+ return u(
113
117
  "span",
114
118
  { class: e.canRead ? "" : "opacity-40 cursor-not-allowed" },
115
119
  o.getValue()
@@ -123,8 +127,8 @@ const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt
123
127
  meta: {
124
128
  width: "100px"
125
129
  },
126
- cell: (o) => d(
127
- H,
130
+ cell: (o) => u(
131
+ Q,
128
132
  {
129
133
  // grey out chip text when user cannot read report
130
134
  class: `${o.getValue() !== a("report.common.uncategorized") ? "bg-fm-color-system-info-100 text-fm-color-typo-info" : "text-fm-color-typo-secondary"} ${o.row.original.canRead ? "" : "opacity-40 cursor-not-allowed"} fm-typo-en-body-sm-600`,
@@ -139,7 +143,7 @@ const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt
139
143
  enableSorting: !1,
140
144
  cell: (o) => {
141
145
  const e = o.row.original;
142
- return d(
146
+ return u(
143
147
  "span",
144
148
  { class: e.canRead ? "" : "opacity-40 cursor-not-allowed" },
145
149
  o.getValue()
@@ -154,12 +158,12 @@ const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt
154
158
  width: "130px"
155
159
  },
156
160
  cell: (o) => {
157
- var u;
158
- const e = o.row.original, r = e.reportId, n = f.value.find((y) => y.id === r), Z = r === ((u = B.value) == null ? void 0 : u.id), T = !e.canRead, D = n ? ie(n) : !1, A = n ? E(n) : !1, s = !e.canUpdate || e.isMandatoryPosReport || b.value.has(r), C = e.isMandatoryPosReport ? a("reportV5.reportList.mandatoryPosReportHint") : a("reportV5.reportList.posV8Hint"), i = [
161
+ var m;
162
+ const e = o.row.original, r = e.reportId, n = y.value.find((p) => p.id === r), oe = r === ((m = K.value) == null ? void 0 : m.id), A = !e.canRead, D = n ? de(n) : !1, z = n ? Y(n) : !1, s = !e.canUpdate || e.isMandatoryPosReport || g.value.has(r), C = e.isMandatoryPosReport ? a("reportV5.reportList.mandatoryPosReportHint") : a("reportV5.reportList.posV8Hint"), c = [
159
163
  {
160
164
  label: a("report.common.duplicate"),
161
165
  onClick: () => {
162
- n && D ? be(n) : D || l.open({
166
+ n && D ? ge(n) : D || l.open({
163
167
  message: a("report.messages.noPermissionDuplicateReport"),
164
168
  type: "error"
165
169
  });
@@ -168,9 +172,9 @@ const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt
168
172
  disabled: !D
169
173
  },
170
174
  {
171
- label: a(Z ? "report.common.unsetAsOverview" : "report.common.setAsOverview"),
175
+ label: a(oe ? "report.common.unsetAsOverview" : "report.common.setAsOverview"),
172
176
  onClick: async () => {
173
- n && fe(n);
177
+ n && ye(n);
174
178
  },
175
179
  variant: "",
176
180
  disabled: !1
@@ -178,57 +182,68 @@ const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt
178
182
  {
179
183
  label: a("report.common.remove"),
180
184
  onClick: () => {
181
- n && (A ? ve(n) : l.open({
185
+ n && (z ? ve(n) : l.open({
182
186
  message: a("report.messages.noPermissionDeleteReport"),
183
187
  type: "error"
184
188
  }));
185
189
  },
186
190
  variant: "destructive",
187
- disabled: !e.editable || !A
191
+ disabled: !e.editable || !z
188
192
  }
189
193
  ];
190
- return d(
194
+ return u(
191
195
  "div",
192
196
  {
193
- class: `flex ${p.value.lg || p.value.md ? "justify-end" : ""} items-center`
197
+ class: `flex ${d.value.lg || d.value.md ? "justify-end" : ""} items-center`
194
198
  },
195
199
  {
196
200
  default: () => [
197
- d(
198
- $e,
201
+ u(
202
+ De,
199
203
  { content: C, placement: "bottom", zIndex: 2e3 },
200
204
  {
201
- default: () => d("div", { class: "mr-2 flex items-center" }, [
202
- d("span", { class: "fm-typo-en-body-sm-400 whitespace-nowrap" }, "POS v8"),
203
- d(de, {
204
- modelValue: e.isSupportPos,
205
- disabled: s,
206
- "aria-label": a("report.common.showInPOS"),
207
- class: "pos-v8-switch",
208
- "onUpdate:modelValue": () => {
209
- n && ye(n);
210
- },
211
- onClick: we(() => {
212
- }, ["stop"])
213
- })
214
- ])
205
+ default: () => u(
206
+ "div",
207
+ {
208
+ class: "pos-v8-control mr-2 flex items-center",
209
+ "data-testid": "desktop-pos-v8-toggle",
210
+ onClick: (p) => {
211
+ e.isMandatoryPosReport && (p.stopPropagation(), n && V(n));
212
+ }
213
+ },
214
+ [
215
+ u("span", { class: "fm-typo-en-body-sm-400 whitespace-nowrap" }, "POS v8"),
216
+ u(me, {
217
+ modelValue: e.isSupportPos,
218
+ disabled: s,
219
+ "aria-label": a("report.common.showInPOS"),
220
+ class: "pos-v8-switch",
221
+ "onUpdate:modelValue": () => {
222
+ n && V(n);
223
+ },
224
+ onClick: (p) => {
225
+ p.stopPropagation(), e.isMandatoryPosReport && n && V(n);
226
+ }
227
+ })
228
+ ]
229
+ )
215
230
  }
216
231
  ),
217
- d(
232
+ u(
218
233
  "button",
219
234
  {
220
- disabled: T,
221
- title: T ? a("report.messages.noPermission") : void 0,
235
+ disabled: A,
236
+ title: A ? a("report.messages.noPermission") : void 0,
222
237
  "aria-label": e.pin ? "Unpin" : "Pin",
223
- onClick: we(() => {
224
- n && ge(n);
238
+ onClick: Ae(() => {
239
+ n && be(n);
225
240
  }, ["stop"]),
226
241
  class: "text-fm-color-neutral-gray-400 hover:bg-fm-color-opacity-sm rounded-lg flex items-center justify-center"
227
242
  },
228
243
  {
229
244
  default: () => [
230
- d(
231
- q,
245
+ u(
246
+ G,
232
247
  {
233
248
  name: "keep",
234
249
  class: "px-12 p-8",
@@ -240,35 +255,35 @@ const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt
240
255
  ]
241
256
  }
242
257
  ),
243
- d(
244
- Y,
258
+ u(
259
+ H,
245
260
  {
246
261
  stopClickPropagation: !0,
247
262
  shift: !0,
248
263
  disabled: !1
249
264
  },
250
265
  {
251
- default: () => i.map(
252
- (y) => d(
253
- x,
266
+ default: () => c.map(
267
+ (p) => u(
268
+ P,
254
269
  {
255
- onClick: y.disabled ? {} : y.onClick,
256
- label: y.label,
257
- class: y.disabled ? "text-fm-color-typo-disabled" : y.variant === "destructive" ? "text-fm-color-typo-error" : "",
258
- disabled: y.disabled
270
+ onClick: p.disabled ? {} : p.onClick,
271
+ label: p.label,
272
+ class: p.disabled ? "text-fm-color-typo-disabled" : p.variant === "destructive" ? "text-fm-color-typo-error" : "",
273
+ disabled: p.disabled
259
274
  },
260
275
  {
261
- label: () => d("p", y.label)
276
+ label: () => u("p", p.label)
262
277
  }
263
278
  )
264
279
  ),
265
- "menu-button": () => d(
266
- De,
280
+ "menu-button": () => u(
281
+ _e,
267
282
  {
268
283
  variant: "tertiary",
269
284
  size: "md",
270
285
  icon: "more_vert",
271
- iconColor: Xe.NeutralGray400,
286
+ iconColor: Ze.NeutralGray400,
272
287
  disabled: !1
273
288
  },
274
289
  {}
@@ -281,11 +296,11 @@ const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt
281
296
  }
282
297
  }
283
298
  ]);
284
- async function fe(o) {
285
- await K(async () => {
299
+ async function ye(o) {
300
+ await E(async () => {
286
301
  var e;
287
302
  try {
288
- const r = o.id === ((e = B.value) == null ? void 0 : e.id);
303
+ const r = o.id === ((e = K.value) == null ? void 0 : e.id);
289
304
  await S.updateDefaultReport(r ? null : o.id), l.open({
290
305
  message: `Successfully ${r ? "unset" : "set"} ${o.name} as Overview`,
291
306
  type: "success"
@@ -295,12 +310,26 @@ const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt
295
310
  }
296
311
  });
297
312
  }
298
- async function ye(o) {
299
- if (!b.value.has(o.id)) {
300
- b.value = new Set(b.value).add(o.id);
313
+ async function V(o) {
314
+ if (Z(o)) {
315
+ l.open({
316
+ message: a("reportV5.reportList.cannotConfigureMandatoryReport"),
317
+ type: "error"
318
+ });
319
+ return;
320
+ }
321
+ if (!j(o)) {
322
+ l.open({
323
+ message: a("report.messages.noPermissionUpdateReport"),
324
+ type: "error"
325
+ });
326
+ return;
327
+ }
328
+ if (!g.value.has(o.id)) {
329
+ g.value = new Set(g.value).add(o.id);
301
330
  try {
302
331
  const e = !o.isSupportPos;
303
- await je(o.id, e), o.isSupportPos = e, G.value = new Map(G.value).set(
332
+ await Ye(o.id, e), o.isSupportPos = e, W.value = new Map(W.value).set(
304
333
  o.id,
305
334
  e
306
335
  );
@@ -310,16 +339,16 @@ const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt
310
339
  type: "error"
311
340
  });
312
341
  } finally {
313
- const e = new Set(b.value);
314
- e.delete(o.id), b.value = e;
342
+ const e = new Set(g.value);
343
+ e.delete(o.id), g.value = e;
315
344
  }
316
345
  }
317
346
  }
318
347
  function Le(o, e) {
319
- return G.value.get(o) ?? e;
348
+ return W.value.get(o) ?? e;
320
349
  }
321
- async function Ve(o) {
322
- if (await ne({
350
+ async function Me(o) {
351
+ if (await ce({
323
352
  title: a("report.common.duplicate"),
324
353
  message: a("report.messages.confirmAction", {
325
354
  action: a("report.common.duplicate"),
@@ -327,7 +356,7 @@ const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt
327
356
  })
328
357
  })) {
329
358
  const r = JSON.parse(JSON.stringify(o));
330
- r.editable = !0, r.id = "", r.name = `${r.name} ${a("report.common.duplicate")}`, r.isDefault = !1, K(async () => {
359
+ r.editable = !0, r.id = "", r.name = `${r.name} ${a("report.common.duplicate")}`, r.isDefault = !1, E(async () => {
331
360
  try {
332
361
  await S.createOrUpdateReport(r), l.open({
333
362
  message: `${a("report.messages.duplicateSuccess", { name: r.name })}`,
@@ -339,26 +368,26 @@ const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt
339
368
  });
340
369
  }
341
370
  }
342
- function W(o) {
343
- const e = f.value.find((r) => r.id === o.reportId);
344
- return !e || !ie(e);
371
+ function ee(o) {
372
+ const e = y.value.find((r) => r.id === o.reportId);
373
+ return !e || !de(e);
345
374
  }
346
- function X(o) {
347
- const e = f.value.find((r) => r.id === o.reportId);
348
- return !o.editable || !e || !E(e);
375
+ function te(o) {
376
+ const e = y.value.find((r) => r.id === o.reportId);
377
+ return !o.editable || !e || !Y(e);
349
378
  }
350
379
  async function ve(o) {
351
- if (!E(o)) {
380
+ if (!Y(o)) {
352
381
  l.open({
353
382
  message: a("report.messages.noPermissionDeleteReport"),
354
383
  type: "error"
355
384
  });
356
385
  return;
357
386
  }
358
- await ne({
387
+ await ce({
359
388
  title: a("report.messages.deleteReport"),
360
389
  message: a("report.messages.confirmDelete", { name: o.name })
361
- }) && K(async () => {
390
+ }) && E(async () => {
362
391
  try {
363
392
  await S.removeReport(o), l.open({
364
393
  message: a("report.messages.deleteSuccess", { name: o.name }),
@@ -369,9 +398,9 @@ const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt
369
398
  }
370
399
  });
371
400
  }
372
- async function be(o) {
373
- if (re.value)
374
- await Ve(o);
401
+ async function ge(o) {
402
+ if (ie.value)
403
+ await Me(o);
375
404
  else {
376
405
  let e = `Your current plan only support up to ${L.value} custom reports.`;
377
406
  L.value === 0 && (e = "Your current plan does not support custom report."), l.open({
@@ -380,16 +409,16 @@ const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt
380
409
  });
381
410
  }
382
411
  }
383
- function Ne() {
384
- if (!_e.value) {
412
+ function Ve() {
413
+ if (!ke.value) {
385
414
  l.open({
386
415
  message: a("report.messages.noPermission"),
387
416
  type: "error"
388
417
  });
389
418
  return;
390
419
  }
391
- if (re.value)
392
- ke.value = !0;
420
+ if (ie.value)
421
+ Ie.value = !0;
393
422
  else {
394
423
  let o = `Your current plan only support up to ${L.value} custom reports.`;
395
424
  L.value === 0 && (o = "Your current plan does not support custom report."), l.open({
@@ -398,8 +427,8 @@ const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt
398
427
  });
399
428
  }
400
429
  }
401
- function ge(o) {
402
- const e = te(a, J, o.name, "other") ?? "";
430
+ function be(o) {
431
+ const e = se(a, B, o.name, "other") ?? "";
403
432
  F.value && F.value.includes(o.id) ? (l.open({
404
433
  message: `${a("report.common.unpin")} ${e} ${a("report.common.successful")}`,
405
434
  type: "success"
@@ -408,15 +437,15 @@ const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt
408
437
  type: "success"
409
438
  }), S.cachePinReport(o));
410
439
  }
411
- function Ue(o) {
412
- V.value = o;
440
+ function Ne(o) {
441
+ M.value = o;
413
442
  }
414
- const { selectedLocationIds: _, dateRange: N, compareDateRange: U, timeRange: w, locations: Me } = Pe(), M = R(() => _.length === Me.length);
443
+ const { selectedLocationIds: _, dateRange: N, compareDateRange: U, timeRange: w, locations: Ue } = Pe(), T = R(() => _.length === Ue.length);
415
444
  return (o, e) => {
416
- const r = I("FmPageHead"), n = I("FmSearch"), Z = I("FmForm"), T = I("FmListItem"), D = I("FmList"), A = I("FmTable");
417
- return z(), ee(Ye, null, {
418
- default: m(() => [
419
- c(r, {
445
+ const r = I("FmPageHead"), n = I("FmSearch"), oe = I("FmForm"), A = I("FmListItem"), D = I("FmList"), z = I("FmTable");
446
+ return J(), ae(qe, null, {
447
+ default: f(() => [
448
+ i(r, {
420
449
  title: t(a)("report.common.report", 1),
421
450
  class: "h-[68px]",
422
451
  actions: [
@@ -427,60 +456,60 @@ const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt
427
456
  prependIcon: "add"
428
457
  }
429
458
  ],
430
- "onClick:action": e[0] || (e[0] = (s) => Ne())
459
+ "onClick:action": e[0] || (e[0] = (s) => Ve())
431
460
  }, null, 8, ["title", "actions"]),
432
461
  v("div", {
433
- class: g(`overflow-y-hidden flex flex-col gap-8 ${t(p).sm || t(p).xs ? "mb-20" : ""}`),
434
- style: Ae({ height: `calc(100% - ${t(p).lg || t(p).md ? 72 : 64}px)` })
462
+ class: b(`overflow-y-hidden flex flex-col gap-8 ${t(d).sm || t(d).xs ? "mb-20" : ""}`),
463
+ style: ze({ height: `calc(100% - ${t(d).lg || t(d).md ? 72 : 64}px)` })
435
464
  }, [
436
- c(Z, {
437
- class: g(`flex items-center gap-2 ${t(p).sm || t(p).xs ? "px-3" : "px-24"}`)
465
+ i(oe, {
466
+ class: b(`flex items-center gap-2 ${t(d).sm || t(d).xs ? "px-3" : "px-24"}`)
438
467
  }, {
439
- default: m(() => [
440
- c(t(Y), null, {
441
- "menu-button": m(() => [
442
- c(t(H), { class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-400" }, {
443
- default: m(() => [
444
- v("p", null, k(t(a)(`report.category.${V.value.label}`)), 1),
445
- c(t(q), { name: "expand_more" })
468
+ default: f(() => [
469
+ i(t(H), null, {
470
+ "menu-button": f(() => [
471
+ i(t(Q), { class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-400" }, {
472
+ default: f(() => [
473
+ v("p", null, k(t(a)(`report.category.${M.value.label}`)), 1),
474
+ i(t(G), { name: "expand_more" })
446
475
  ]),
447
476
  _: 1
448
477
  })
449
478
  ]),
450
- default: m(() => [
451
- (z(!0), ze(Je, null, Be(me.value, (s, C) => (z(), ee(t(x), {
479
+ default: f(() => [
480
+ (J(!0), Je(Be, null, Ke(fe.value, (s, C) => (J(), ae(t(P), {
452
481
  key: C,
453
482
  label: t(a)(`report.category.${s.label}`),
454
- onClick: () => Ue(s)
483
+ onClick: () => Ne(s)
455
484
  }, null, 8, ["label", "onClick"]))), 128))
456
485
  ]),
457
486
  _: 1
458
487
  }),
459
488
  v("div", {
460
- class: g(`flex ${t(p).sm || t(p).xs ? "justify-center items-center" : ""}`)
489
+ class: b(`flex ${t(d).sm || t(d).xs ? "justify-center items-center" : ""}`)
461
490
  }, [
462
- v("p", nt, k(t(a)("report.common.results", { count: P.value.length })), 1)
491
+ v("p", lt, k(t(a)("report.common.results", { count: x.value.length })), 1)
463
492
  ], 2),
464
493
  e[3] || (e[3] = v("div", { class: "grow" }, null, -1)),
465
- v("div", lt, [
466
- c(n, {
467
- modelValue: Q.value,
468
- "onUpdate:modelValue": e[1] || (e[1] = (s) => Q.value = s),
469
- class: g(`${t(p).lg || t(p).md ? "grow" : ""}`)
494
+ v("div", it, [
495
+ i(n, {
496
+ modelValue: X.value,
497
+ "onUpdate:modelValue": e[1] || (e[1] = (s) => X.value = s),
498
+ class: b(`${t(d).lg || t(d).md ? "grow" : ""}`)
470
499
  }, null, 8, ["modelValue", "class"])
471
500
  ])
472
501
  ]),
473
502
  _: 1
474
503
  }, 8, ["class"]),
475
- he((z(), ee(A, {
504
+ we((J(), ae(z, {
476
505
  key: Oe.value,
477
506
  ref_key: "table",
478
507
  ref: h,
479
- class: g([t(p).sm || t(p).xs ? "px-0" : "px-24", "report-table"]),
508
+ class: b([t(d).sm || t(d).xs ? "px-0" : "px-24", "report-table"]),
480
509
  style: { height: "calc(100% - 40px)" },
481
510
  "column-defs": Fe.value,
482
- "row-data": P.value,
483
- "page-size": P.value.length,
511
+ "row-data": x.value,
512
+ "page-size": x.value.length,
484
513
  "hide-footer": !0,
485
514
  "row-class-name": "row",
486
515
  onRowClick: e[2] || (e[2] = (s) => {
@@ -491,10 +520,10 @@ const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt
491
520
  });
492
521
  return;
493
522
  }
494
- t(Ce).suppressReportRouteSync = !0, t(S).updateCurrentReportId(s.original.reportId), t(oe).push({
523
+ t(xe).suppressReportRouteSync = !0, t(S).updateCurrentReportId(s.original.reportId), t(re).push({
495
524
  name: "reportView",
496
525
  query: {
497
- ...t(ae).query,
526
+ ...t(ne).query,
498
527
  reportId: s.original.reportId,
499
528
  startDate: t(N).startDate,
500
529
  endDate: t(N).endDate,
@@ -502,14 +531,14 @@ const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt
502
531
  compareEndDate: t(U).endDate,
503
532
  timeStart: t(w).start ? JSON.stringify(t(w).start) : null,
504
533
  timeEnd: t(w).end ? JSON.stringify(t(w).end) : null,
505
- isAllLocation: M.value.toString(),
506
- locationIds: M.value ? void 0 : t(_) ? JSON.stringify(t(_)) : void 0
534
+ isAllLocation: T.value.toString(),
535
+ locationIds: T.value ? void 0 : t(_) ? JSON.stringify(t(_)) : void 0
507
536
  }
508
537
  });
509
538
  })
510
539
  }, {
511
- "list-row": m(({ original: s }) => [
512
- c(D, {
540
+ "list-row": f(({ original: s }) => [
541
+ i(D, {
513
542
  onClick: () => {
514
543
  if (!s.canRead) {
515
544
  t(l).open({
@@ -518,10 +547,10 @@ const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt
518
547
  });
519
548
  return;
520
549
  }
521
- s.reportId && (t(S).updateCurrentReportId(s.reportId), t(oe).push({
550
+ s.reportId && (t(S).updateCurrentReportId(s.reportId), t(re).push({
522
551
  name: "reportView",
523
552
  query: {
524
- ...t(ae).query,
553
+ ...t(ne).query,
525
554
  reportId: s.reportId,
526
555
  startDate: t(N).startDate,
527
556
  endDate: t(N).endDate,
@@ -529,126 +558,120 @@ const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt
529
558
  compareEndDate: t(U).endDate,
530
559
  timeStart: t(w).start ? JSON.stringify(t(w).start) : null,
531
560
  timeEnd: t(w).end ? JSON.stringify(t(w).end) : null,
532
- isAllLocation: M.value.toString(),
533
- locationIds: M.value ? void 0 : t(_) ? JSON.stringify(t(_)) : void 0
561
+ isAllLocation: T.value.toString(),
562
+ locationIds: T.value ? void 0 : t(_) ? JSON.stringify(t(_)) : void 0
534
563
  }
535
564
  }));
536
565
  }
537
566
  }, {
538
- default: m(() => [
539
- c(T, {
567
+ default: f(() => [
568
+ i(A, {
540
569
  tag: "label",
541
570
  clickable: ""
542
571
  }, {
543
- append: m(() => [
544
- c(t(H), {
545
- class: g(`${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"}`),
572
+ append: f(() => [
573
+ i(t(Q), {
574
+ class: b(`${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"}`),
546
575
  compact: !0
547
576
  }, {
548
- default: m(() => [
577
+ default: f(() => [
549
578
  v("p", ct, k(s.category), 1)
550
579
  ]),
551
580
  _: 2
552
581
  }, 1032, ["class"]),
553
- c(t(Y), {
582
+ i(t(H), {
554
583
  placement: "left",
555
584
  "stop-click-propagation": !0
556
585
  }, {
557
- "menu-button": m(() => [
558
- c(t(q), {
586
+ "menu-button": f(() => [
587
+ i(t(G), {
559
588
  name: "more_vert",
560
589
  class: "btn-color"
561
590
  })
562
591
  ]),
563
- default: m(() => {
592
+ default: f(() => {
564
593
  var C;
565
594
  return [
566
- c(t(x), {
595
+ i(t(P), {
567
596
  label: s.pin ? "Unpin" : "Pin",
568
597
  onClick: () => {
569
- const i = t(f).find(
570
- (u) => u.id === s.reportId
598
+ const c = t(y).find(
599
+ (m) => m.id === s.reportId
571
600
  );
572
- i && ge(i);
601
+ c && be(c);
573
602
  }
574
603
  }, null, 8, ["label", "onClick"]),
575
604
  v("div", {
576
605
  role: "menuitem",
577
606
  "data-testid": "mobile-pos-v8-toggle",
578
- tabindex: !s.canUpdate || s.isMandatoryPosReport || b.value.has(s.reportId) ? void 0 : -1,
579
- "aria-disabled": !s.canUpdate || s.isMandatoryPosReport || b.value.has(s.reportId),
580
- class: g(
581
- !s.canUpdate || s.isMandatoryPosReport || b.value.has(s.reportId) ? "flex max-h-[78px] w-full cursor-not-allowed items-center justify-between gap-2 rounded px-3 py-2 pl-12 text-fm-color-typo-disabled" : "flex max-h-[78px] w-full cursor-pointer items-center justify-between gap-2 rounded px-3 py-2 pl-12 hover:bg-fm-color-opacity-sm"
607
+ tabindex: !s.canUpdate || s.isMandatoryPosReport || g.value.has(s.reportId) ? void 0 : -1,
608
+ "aria-disabled": !s.canUpdate || s.isMandatoryPosReport || g.value.has(s.reportId),
609
+ class: b(
610
+ !s.canUpdate || s.isMandatoryPosReport || g.value.has(s.reportId) ? "flex max-h-[78px] w-full cursor-not-allowed items-center justify-between gap-2 rounded px-3 py-2 pl-12 text-fm-color-typo-disabled" : "flex max-h-[78px] w-full cursor-pointer items-center justify-between gap-2 rounded px-3 py-2 pl-12 hover:bg-fm-color-opacity-sm"
582
611
  ),
583
- onClick: (i) => {
584
- if (i.stopPropagation(), !s.canUpdate) {
585
- t(l).open({
586
- message: t(a)("report.messages.noPermissionUpdateReport"),
587
- type: "error"
588
- });
589
- return;
590
- }
591
- const u = t(f).find(
592
- (y) => y.id === s.reportId
612
+ onClick: (c) => {
613
+ c.stopPropagation();
614
+ const m = t(y).find(
615
+ (p) => p.id === s.reportId
593
616
  );
594
- u && ye(u);
617
+ m && V(m);
595
618
  }
596
619
  }, [
597
- v("span", pt, k(t(a)("report.common.showInPOS")), 1),
620
+ v("span", dt, k(t(a)("report.common.showInPOS")), 1),
598
621
  v("span", null, [
599
- c(t(de), {
622
+ i(t(me), {
600
623
  "model-value": Le(
601
624
  s.reportId,
602
625
  s.isSupportPos
603
626
  ),
604
- disabled: !s.canUpdate || s.isMandatoryPosReport || b.value.has(s.reportId),
627
+ disabled: !s.canUpdate || s.isMandatoryPosReport || g.value.has(s.reportId),
605
628
  "aria-label": "Show in POS v8",
606
629
  class: "pointer-events-none"
607
630
  }, null, 8, ["model-value", "disabled"])
608
631
  ])
609
- ], 10, it),
610
- c(t(x), {
632
+ ], 10, pt),
633
+ i(t(P), {
611
634
  label: t(a)("report.common.duplicate"),
612
- disabled: W(s),
613
- class: g(
614
- W(s) ? "text-fm-color-typo-disabled" : ""
635
+ disabled: ee(s),
636
+ class: b(
637
+ ee(s) ? "text-fm-color-typo-disabled" : ""
615
638
  ),
616
639
  onClick: () => {
617
- const i = t(f).find(
618
- (u) => u.id === s.reportId
640
+ const c = t(y).find(
641
+ (m) => m.id === s.reportId
619
642
  );
620
- i && !W(s) ? be(i) : t(l).open({
643
+ c && !ee(s) ? ge(c) : t(l).open({
621
644
  message: t(a)("report.messages.noPermissionDuplicateReport"),
622
645
  type: "error"
623
646
  });
624
647
  }
625
648
  }, null, 8, ["label", "disabled", "class", "onClick"]),
626
- c(t(x), {
649
+ i(t(P), {
627
650
  label: t(a)(
628
- s.reportId === ((C = t(B)) == null ? void 0 : C.id) ? "report.common.unsetAsOverview" : "report.common.setAsOverview"
651
+ s.reportId === ((C = t(K)) == null ? void 0 : C.id) ? "report.common.unsetAsOverview" : "report.common.setAsOverview"
629
652
  ),
630
653
  onClick: () => {
631
- const i = t(f).find(
632
- (u) => u.id === s.reportId
654
+ const c = t(y).find(
655
+ (m) => m.id === s.reportId
633
656
  );
634
- i && fe(i);
657
+ c && ye(c);
635
658
  }
636
659
  }, null, 8, ["label", "onClick"]),
637
- c(t(x), {
660
+ i(t(P), {
638
661
  label: t(a)("report.common.delete"),
639
- disabled: X(s),
640
- class: g(
641
- X(s) ? "text-fm-color-typo-disabled" : "text-fm-color-typo-error"
662
+ disabled: te(s),
663
+ class: b(
664
+ te(s) ? "text-fm-color-typo-disabled" : "text-fm-color-typo-error"
642
665
  ),
643
666
  onClick: () => {
644
- const i = t(f).find(
645
- (u) => u.id === s.reportId
667
+ const c = t(y).find(
668
+ (m) => m.id === s.reportId
646
669
  );
647
- i && !X(s) && ve(i);
670
+ c && !te(s) && ve(c);
648
671
  }
649
672
  }, {
650
- label: m(() => [
651
- Ke(k(t(a)("report.common.delete")), 1)
673
+ label: f(() => [
674
+ Ee(k(t(a)("report.common.delete")), 1)
652
675
  ]),
653
676
  _: 2
654
677
  }, 1032, ["label", "disabled", "class", "onClick"])
@@ -657,9 +680,9 @@ const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt
657
680
  _: 2
658
681
  }, 1024)
659
682
  ]),
660
- default: m(() => [
683
+ default: f(() => [
661
684
  v("span", {
662
- class: g(["fm-typo-en-body-lg-400 line-clamp-1 break-all text-fm-color-typo-primary", s.canRead ? "" : "opacity-40 cursor-not-allowed"])
685
+ class: b(["fm-typo-en-body-lg-400 line-clamp-1 break-all text-fm-color-typo-primary", s.canRead ? "" : "opacity-40 cursor-not-allowed"])
663
686
  }, k(s.name), 3)
664
687
  ]),
665
688
  _: 2
@@ -670,10 +693,10 @@ const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt
670
693
  ]),
671
694
  _: 1
672
695
  }, 8, ["class", "column-defs", "row-data", "page-size"])), [
673
- [Re, P.value.length > 0]
696
+ [he, x.value.length > 0]
674
697
  ]),
675
- he(c(Ze, null, null, 512), [
676
- [Re, P.value.length === 0]
698
+ we(i(et, null, null, 512), [
699
+ [he, x.value.length === 0]
677
700
  ])
678
701
  ], 6)
679
702
  ]),
@@ -683,5 +706,5 @@ const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt
683
706
  }
684
707
  });
685
708
  export {
686
- Pt as default
709
+ Ct as default
687
710
  };