@feedmepos/mf-report 5.22.14-beta.2 → 5.22.15-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 (30) hide show
  1. package/dist/{App-Cwppqefm.js → App-BQhR0gXI.js} +5 -5
  2. package/dist/{BaseDialog.vue_vue_type_script_setup_true_lang-CcKWqqNP.js → BaseDialog.vue_vue_type_script_setup_true_lang-CoJrINGt.js} +1890 -1838
  3. package/dist/{DateRangeSelect.vue_vue_type_script_setup_true_lang-CryPHoYr.js → DateRangeSelect.vue_vue_type_script_setup_true_lang-HVO_Z_aB.js} +7 -7
  4. package/dist/{Default.vue_vue_type_script_setup_true_lang-DU3zkEF1.js → Default.vue_vue_type_script_setup_true_lang-B0td3xNS.js} +2 -2
  5. package/dist/{FilterSelector.vue_vue_type_script_setup_true_lang-CyW-5xr4.js → FilterSelector.vue_vue_type_script_setup_true_lang-DB7d9t3_.js} +6 -6
  6. package/dist/{InsightView-DAnaBH3D.js → InsightView-CitbD8mF.js} +6 -6
  7. package/dist/{Integration-DiNs52W5.js → Integration-DjnNmveS.js} +6 -7
  8. package/dist/{Integrations-BvgLRF5N.js → Integrations-BKYeENnK.js} +6 -7
  9. package/dist/{Layout-BAYV4nCo.js → Layout-5TdGrp8j.js} +1 -1
  10. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-BZphMQGv.js → MenuTab.vue_vue_type_script_setup_true_lang-DkiUvM56.js} +5 -5
  11. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-DSTG-gQ3.js → NavigationTab.vue_vue_type_script_setup_true_lang-CifNNsqR.js} +3120 -3095
  12. package/dist/{NoData.vue_vue_type_script_setup_true_lang-zS79GrjC.js → NoData.vue_vue_type_script_setup_true_lang-Uei_Jstp.js} +1 -1
  13. package/dist/{OverviewView-CvRMdLbB.js → OverviewView-DZoL2KUz.js} +5 -5
  14. package/dist/{Report-C6445626.js → Report-D_9Db2Pa.js} +216 -187
  15. package/dist/{ReportEditor-Cy8f2WFu.js → ReportEditor-VGOkYidh.js} +65 -65
  16. package/dist/{ReportView-D-T3b10U.js → ReportView-B9PQlaFs.js} +22 -22
  17. package/dist/{SelectComponent.vue_vue_type_script_setup_true_lang-CYDZzbCU.js → SelectComponent.vue_vue_type_script_setup_true_lang-UhEjUKRz.js} +1 -1
  18. package/dist/{Setting-DBzyuCx-.js → Setting-BpStivU1.js} +5 -5
  19. package/dist/{TileEditor-CWYE5X71.js → TileEditor-CYwZNqhl.js} +110 -110
  20. package/dist/{TransitionFade-DwQjFIYA.js → TransitionFade-Cmxee7D0.js} +6 -6
  21. package/dist/{app-BRv3iLF1.js → app-BXEgzj0c.js} +11 -11
  22. package/dist/app.js +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/useReportPermission-B_CqU5GP.js +63 -0
  25. package/dist/useRestaurantPermission-DIlTzfKA.js +64 -0
  26. package/dist/{vue-i18n-ComGWqEb.js → vue-i18n-mTXrqqL9.js} +4477 -3241
  27. package/package.json +2 -2
  28. package/dist/access-Dw5cDt65-C2c0R9q4.js +0 -1238
  29. package/dist/useReportPermission-CDWkdi6R.js +0 -60
  30. package/dist/useRestaurantPermission-CjG_t7dK.js +0 -65
@@ -1,89 +1,98 @@
1
- import { defineComponent as Ie, ref as j, watch as me, computed as b, h as v, withModifiers as Re, resolveComponent as x, createBlock as G, openBlock as A, withCtx as m, createVNode as i, createElementVNode as C, unref as e, normalizeStyle as $e, normalizeClass as _, withDirectives as H, createElementBlock as De, Fragment as Fe, renderList as Oe, toDisplayString as J, createTextVNode as Le, vShow as Q } from "vue";
2
- import { storeToRefs as pe } from "pinia";
3
- import { a as Ne, u as Pe } from "./BaseDialog.vue_vue_type_script_setup_true_lang-CcKWqqNP.js";
4
- import { _ as Ve } from "./Default.vue_vue_type_script_setup_true_lang-DU3zkEF1.js";
5
- import { u as Ae } from "./message-dialog-UoMWOnil.js";
6
- import { b as de, e as Je } from "./vue-i18n-ComGWqEb.js";
7
- import { useSnackbar as ze, useBreakpoints as Be, components as Te, FmButtonColorThemeVariant as Ue } from "@feedmepos/ui-library";
8
- import { _ as Ee } from "./NoData.vue_vue_type_script_setup_true_lang-zS79GrjC.js";
9
- import { useRouter as Ke, useRoute as Me, onBeforeRouteLeave as Ye } from "vue-router";
10
- import { useI18n as qe } from "@feedmepos/mf-common";
1
+ import { defineComponent as $e, ref as j, watch as pe, computed as b, h as p, withModifiers as De, resolveComponent as k, createBlock as G, openBlock as A, withCtx as m, createVNode as c, createElementVNode as w, unref as e, normalizeStyle as Ie, normalizeClass as x, withDirectives as H, createElementBlock as Fe, Fragment as Oe, renderList as Pe, toDisplayString as J, createTextVNode as Le, vShow as Q } from "vue";
2
+ import { storeToRefs as de } from "pinia";
3
+ import { a as Ne, u as Ve } from "./BaseDialog.vue_vue_type_script_setup_true_lang-CoJrINGt.js";
4
+ import { _ as Ae } from "./Default.vue_vue_type_script_setup_true_lang-B0td3xNS.js";
5
+ import { u as Je } from "./message-dialog-UoMWOnil.js";
6
+ import { b as fe, e as ze } from "./vue-i18n-mTXrqqL9.js";
7
+ import { useSnackbar as Be, useBreakpoints as Te, components as Ue, FmButtonColorThemeVariant as Ee } from "@feedmepos/ui-library";
8
+ import { _ as Ke } from "./NoData.vue_vue_type_script_setup_true_lang-Uei_Jstp.js";
9
+ import { useRouter as Me, useRoute as Ye, onBeforeRouteLeave as qe } from "vue-router";
10
+ import { useI18n as je } from "@feedmepos/mf-common";
11
11
  import { r as W } from "./i18n-CI_sQ5d_.js";
12
- import { u as je } from "./useReportPermission-CDWkdi6R.js";
13
- const Ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, He = { class: "w-[343px]" }, Qe = { class: "fm-typo-en-body-md-600" }, ut = /* @__PURE__ */ Ie({
12
+ import { u as Ge } from "./useReportPermission-B_CqU5GP.js";
13
+ const He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe = { class: "w-[343px]" }, We = { class: "fm-typo-en-body-md-600" }, mt = /* @__PURE__ */ $e({
14
14
  __name: "Report",
15
- setup(We) {
16
- const { t: a, te: z } = qe(), X = Ke(), Z = Me(), p = Ne(), fe = Pe(), { business: ve } = pe(de()), {
17
- reports: d,
15
+ setup(Xe) {
16
+ const { t: a, te: z } = je(), X = Me(), Z = Ye(), d = Ne(), ve = Ve(), { business: ge } = de(fe()), {
17
+ reports: f,
18
18
  overviewReport: B,
19
- categories: $,
20
- pinReport: D,
19
+ categories: D,
20
+ pinReport: I,
21
21
  isOpenAddReportDialog: ye,
22
22
  scrollPositionY: ee,
23
23
  customReportQuota: F,
24
24
  canCreateCustomReport: te
25
- } = pe(p), { promptMessage: oe } = Ae(), { promptLoader: T } = Je(), c = ze(), { breakpoints: u } = Be(), { canUpdate: ae, canDuplicate: ge, canDelete: ne, canCreateReport: be } = je(), h = j();
26
- Ye(() => {
27
- h.value && (ee.value = h.value.$el.children[0].scrollTop);
28
- }), me(h, () => {
29
- h.value && setTimeout(() => {
30
- h.value.$el.children[0].scrollTop = ee.value;
25
+ } = de(d), { promptMessage: oe } = Je(), { promptLoader: T } = ze(), i = Be(), { breakpoints: u } = Te(), { canRead: ae, canUpdate: re, canDuplicate: be, canDelete: ne, canCreateReport: we } = Ge(), C = j();
26
+ qe(() => {
27
+ C.value && (ee.value = C.value.$el.children[0].scrollTop);
28
+ }), pe(C, () => {
29
+ C.value && setTimeout(() => {
30
+ C.value.$el.children[0].scrollTop = ee.value;
31
31
  }, 200);
32
32
  });
33
- const U = b(() => D.value && d.value ? d.value.filter((o) => {
33
+ const U = b(() => I.value && f.value ? f.value.filter((o) => {
34
34
  var t;
35
- return (t = D.value) == null ? void 0 : t.includes(o.id);
35
+ return (t = I.value) == null ? void 0 : t.includes(o.id);
36
36
  }) : []);
37
- me(
38
- [() => ve.value],
37
+ pe(
38
+ [() => ge.value],
39
39
  () => {
40
- p.refreshPinReport();
40
+ d.refreshPinReport();
41
41
  },
42
42
  { immediate: !0 }
43
43
  );
44
- const re = b(() => U.value.length > 0 ? d.value.filter(
44
+ const se = b(() => U.value.length > 0 ? f.value.filter(
45
45
  (o) => U.value.findIndex((t) => t.id === o.id) === -1
46
- ) : d.value), { FmButton: Ce, FmMenu: E, FmMenuItem: S, FmIcon: K, FmChip: M } = Te, se = b(() => [
46
+ ) : f.value), { FmButton: Ce, FmMenu: E, FmMenuItem: h, FmIcon: K, FmChip: M } = Ue, le = b(() => [
47
47
  { value: void 0, label: "All" },
48
- ...$.value.map((o) => ({
48
+ ...D.value.map((o) => ({
49
49
  value: o.id,
50
50
  label: o.name
51
51
  }))
52
- ]), O = j(se.value[0]), Y = j(""), k = b(() => re.value.length === 0 || $.value.length === 0 ? [] : [
52
+ ]), O = j(le.value[0]), Y = j(""), R = b(() => se.value.length === 0 || D.value.length === 0 ? [] : [
53
53
  ...U.value.map((t) => {
54
- const n = $.value.find((l) => l.id === t.category);
54
+ const r = D.value.find((l) => l.id === t.category);
55
55
  return {
56
56
  name: W(a, z, t.name, "other"),
57
- categoryId: (n == null ? void 0 : n.id) ?? "",
58
- category: n != null && n.name ? a(`report.category.${n.name}`) : a("report.common.uncategorized"),
57
+ categoryId: (r == null ? void 0 : r.id) ?? "",
58
+ category: r != null && r.name ? a(`report.category.${r.name}`) : a("report.common.uncategorized"),
59
59
  reportId: t.id,
60
60
  editable: t.editable,
61
61
  description: t.description || "",
62
62
  pin: !0,
63
- canUpdate: ae(t)
63
+ canUpdate: re(t),
64
+ canRead: ae(t)
64
65
  };
65
66
  }),
66
- ...re.value.map((t) => {
67
- const n = $.value.find((l) => l.id === t.category);
67
+ ...se.value.map((t) => {
68
+ const r = D.value.find((l) => l.id === t.category);
68
69
  return {
69
70
  name: W(a, z, t.name, "other"),
70
- categoryId: (n == null ? void 0 : n.id) ?? "",
71
- category: n != null && n.name ? a(`report.category.${n.name}`) : a("report.common.uncategorized"),
71
+ categoryId: (r == null ? void 0 : r.id) ?? "",
72
+ category: r != null && r.name ? a(`report.category.${r.name}`) : a("report.common.uncategorized"),
72
73
  reportId: t.id,
73
74
  editable: t.editable,
74
75
  description: t.description || "",
75
76
  pin: !1,
76
- canUpdate: ae(t)
77
+ canUpdate: re(t),
78
+ canRead: ae(t)
77
79
  };
78
80
  })
79
81
  ].filter((t) => O.value.value && t.categoryId !== O.value.value ? !1 : `${(t == null ? void 0 : t.name) || ""}${(t == null ? void 0 : t.description) || ""}`.toLowerCase().indexOf(Y.value.toLowerCase()) !== -1)), he = b(
80
- () => k.value.map((o) => `${o.name}${o.category}`).toString()
81
- ), Se = b(() => [
82
+ () => R.value.map((o) => `${o.name}${o.category}`).toString()
83
+ ), Re = b(() => [
82
84
  {
83
85
  accessorKey: "name",
84
86
  header: a("report.common.name"),
85
87
  enableSorting: !1,
86
- cell: (o) => o.getValue()
88
+ cell: (o) => {
89
+ const t = o.row.original;
90
+ return p(
91
+ "span",
92
+ { class: t.canRead ? "" : "opacity-40 cursor-not-allowed" },
93
+ o.getValue()
94
+ );
95
+ }
87
96
  },
88
97
  {
89
98
  accessorKey: "category",
@@ -92,10 +101,11 @@ const Ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, He
92
101
  meta: {
93
102
  width: "100px"
94
103
  },
95
- cell: (o) => v(
104
+ cell: (o) => p(
96
105
  M,
97
106
  {
98
- class: `${o.getValue() !== a("report.common.uncategorized") ? "bg-fm-color-system-info-100 text-fm-color-typo-info" : "text-fm-color-typo-secondary"} fm-typo-en-body-sm-600`,
107
+ // grey out chip text when user cannot read report
108
+ 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`,
99
109
  compact: !0
100
110
  },
101
111
  { default: () => o.getValue() }
@@ -105,7 +115,14 @@ const Ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, He
105
115
  accessorKey: "description",
106
116
  header: a("report.common.description"),
107
117
  enableSorting: !1,
108
- cell: (o) => o.getValue()
118
+ cell: (o) => {
119
+ const t = o.row.original;
120
+ return p(
121
+ "span",
122
+ { class: t.canRead ? "" : "opacity-40 cursor-not-allowed" },
123
+ o.getValue()
124
+ );
125
+ }
109
126
  },
110
127
  {
111
128
  accessorKey: "",
@@ -115,23 +132,23 @@ const Ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, He
115
132
  width: "80px"
116
133
  },
117
134
  cell: (o) => {
118
- var y;
119
- const t = o.row.original, n = t.reportId, l = d.value.find((s) => s.id === n), q = n === ((y = B.value) == null ? void 0 : y.id), w = !1, R = l ? ge(l) : !1, V = l ? ne(l) : !1, r = [
135
+ var g;
136
+ const t = o.row.original, r = t.reportId, l = f.value.find((s) => s.id === r), q = r === ((g = B.value) == null ? void 0 : g.id), S = !t.canRead, $ = l ? be(l) : !1, V = l ? ne(l) : !1, n = [
120
137
  {
121
138
  label: a("report.common.duplicate"),
122
139
  onClick: () => {
123
- l && R ? ce(l) : R || c.open({
140
+ l && $ ? ue(l) : $ || i.open({
124
141
  message: a("report.messages.noPermissionDuplicateReport"),
125
142
  type: "error"
126
143
  });
127
144
  },
128
145
  variant: "",
129
- disabled: !R
146
+ disabled: !$
130
147
  },
131
148
  {
132
149
  label: a(q ? "report.common.unsetAsOverview" : "report.common.setAsOverview"),
133
150
  onClick: async () => {
134
- l && le(l);
151
+ l && ie(l);
135
152
  },
136
153
  variant: "",
137
154
  disabled: !1
@@ -139,7 +156,7 @@ const Ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, He
139
156
  {
140
157
  label: a("report.common.remove"),
141
158
  onClick: () => {
142
- l && (V ? ie(l) : c.open({
159
+ l && (V ? ce(l) : i.open({
143
160
  message: a("report.messages.noPermissionDeleteReport"),
144
161
  type: "error"
145
162
  }));
@@ -148,28 +165,28 @@ const Ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, He
148
165
  disabled: !t.editable || !V
149
166
  }
150
167
  ];
151
- return v(
168
+ return p(
152
169
  "div",
153
170
  {
154
171
  class: `flex ${u.value.lg || u.value.md ? "justify-end" : ""} items-center`
155
172
  },
156
173
  {
157
174
  default: () => [
158
- v(
175
+ p(
159
176
  "button",
160
177
  {
161
- disabled: w,
162
- title: void 0,
163
- onClick: Re(() => {
164
- l && ue(l);
178
+ disabled: S,
179
+ title: S ? a("report.messages.noPermission") : void 0,
180
+ onClick: De(() => {
181
+ l && me(l);
165
182
  }, ["stop"]),
166
183
  class: `text-fm-color-neutral-gray-400 ${t.pin ? "" : "show-pin"} hover:bg-fm-color-opacity-sm rounded-lg flex items-center justify-center`,
167
- disabled: w,
168
- title: void 0
184
+ disabled: S,
185
+ title: S ? a("report.messages.noPermission") : void 0
169
186
  },
170
187
  {
171
188
  default: () => [
172
- v(
189
+ p(
173
190
  K,
174
191
  {
175
192
  name: "keep",
@@ -182,18 +199,17 @@ const Ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, He
182
199
  ]
183
200
  }
184
201
  ),
185
- v(
202
+ p(
186
203
  E,
187
204
  {
188
205
  stopClickPropagation: !0,
189
206
  shift: !0,
190
- disabled: w,
191
- title: void 0
207
+ disabled: !1
192
208
  },
193
209
  {
194
- default: () => r.map(
195
- (s) => v(
196
- S,
210
+ default: () => n.map(
211
+ (s) => p(
212
+ h,
197
213
  {
198
214
  onClick: s.disabled ? {} : s.onClick,
199
215
  label: s.label,
@@ -201,19 +217,18 @@ const Ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, He
201
217
  disabled: s.disabled
202
218
  },
203
219
  {
204
- label: () => v("p", s.label)
220
+ label: () => p("p", s.label)
205
221
  }
206
222
  )
207
223
  ),
208
- "menu-button": () => v(
224
+ "menu-button": () => p(
209
225
  Ce,
210
226
  {
211
227
  variant: "tertiary",
212
228
  size: "md",
213
229
  icon: "more_vert",
214
- iconColor: Ue.NeutralGray400,
215
- disabled: w,
216
- title: void 0
230
+ iconColor: Ee.NeutralGray400,
231
+ disabled: !1
217
232
  },
218
233
  {}
219
234
  )
@@ -225,21 +240,21 @@ const Ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, He
225
240
  }
226
241
  }
227
242
  ]);
228
- async function le(o) {
243
+ async function ie(o) {
229
244
  await T(async () => {
230
245
  var t;
231
246
  try {
232
- const n = o.id === ((t = B.value) == null ? void 0 : t.id);
233
- await p.updateDefaultReport(n ? null : o.id), c.open({
234
- message: `Successfully ${n ? "unset" : "set"} ${o.name} as Overview`,
247
+ const r = o.id === ((t = B.value) == null ? void 0 : t.id);
248
+ await d.updateDefaultReport(r ? null : o.id), i.open({
249
+ message: `Successfully ${r ? "unset" : "set"} ${o.name} as Overview`,
235
250
  type: "success"
236
251
  });
237
- } catch (n) {
238
- c.open({ message: JSON.stringify(n), type: "error" });
252
+ } catch (r) {
253
+ i.open({ message: JSON.stringify(r), type: "error" });
239
254
  }
240
255
  });
241
256
  }
242
- async function ke(o) {
257
+ async function Se(o) {
243
258
  if (await oe({
244
259
  title: a("report.common.duplicate"),
245
260
  message: a("report.messages.confirmAction", {
@@ -247,22 +262,22 @@ const Ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, He
247
262
  name: o.name
248
263
  })
249
264
  })) {
250
- const n = JSON.parse(JSON.stringify(o));
251
- n.editable = !0, n.id = "", n.name = `${n.name} ${a("report.common.duplicate")}`, T(async () => {
265
+ const r = JSON.parse(JSON.stringify(o));
266
+ r.editable = !0, r.id = "", r.name = `${r.name} ${a("report.common.duplicate")}`, r.isDefault = !1, T(async () => {
252
267
  try {
253
- await p.createOrUpdateReport(n), c.open({
254
- message: `${a("report.messages.duplicateSuccess", { name: n.name })}`,
268
+ await d.createOrUpdateReport(r), i.open({
269
+ message: `${a("report.messages.duplicateSuccess", { name: r.name })}`,
255
270
  type: "success"
256
271
  });
257
272
  } catch (l) {
258
- c.open({ message: JSON.stringify(l), type: "error" });
273
+ i.open({ message: JSON.stringify(l), type: "error" });
259
274
  }
260
275
  });
261
276
  }
262
277
  }
263
- async function ie(o) {
278
+ async function ce(o) {
264
279
  if (!ne(o)) {
265
- c.open({
280
+ i.open({
266
281
  message: a("report.messages.noPermissionDeleteReport"),
267
282
  type: "error"
268
283
  });
@@ -273,29 +288,29 @@ const Ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, He
273
288
  message: a("report.messages.confirmDelete", { name: o.name })
274
289
  }) && T(async () => {
275
290
  try {
276
- await p.removeReport(o), c.open({
291
+ await d.removeReport(o), i.open({
277
292
  message: a("report.messages.deleteSuccess", { name: o.name }),
278
293
  type: "success"
279
294
  });
280
- } catch (n) {
281
- c.open({ message: JSON.stringify(n), type: "error" });
295
+ } catch (r) {
296
+ i.open({ message: JSON.stringify(r), type: "error" });
282
297
  }
283
298
  });
284
299
  }
285
- async function ce(o) {
300
+ async function ue(o) {
286
301
  if (te.value)
287
- await ke(o);
302
+ await Se(o);
288
303
  else {
289
304
  let t = `Your current plan only support up to ${F.value} custom reports.`;
290
- F.value === 0 && (t = "Your current plan does not support custom report."), c.open({
305
+ F.value === 0 && (t = "Your current plan does not support custom report."), i.open({
291
306
  message: t,
292
307
  type: "error"
293
308
  });
294
309
  }
295
310
  }
296
- function we() {
297
- if (!be.value) {
298
- c.open({
311
+ function ke() {
312
+ if (!we.value) {
313
+ i.open({
299
314
  message: a("report.messages.noPermission"),
300
315
  type: "error"
301
316
  });
@@ -305,31 +320,31 @@ const Ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, He
305
320
  ye.value = !0;
306
321
  else {
307
322
  let o = `Your current plan only support up to ${F.value} custom reports.`;
308
- F.value === 0 && (o = "Your current plan does not support custom report."), c.open({
323
+ F.value === 0 && (o = "Your current plan does not support custom report."), i.open({
309
324
  message: o,
310
325
  type: "error"
311
326
  });
312
327
  }
313
328
  }
314
- function ue(o) {
329
+ function me(o) {
315
330
  const t = W(a, z, o.name, "other") ?? "";
316
- D.value && D.value.includes(o.id) ? (c.open({
331
+ I.value && I.value.includes(o.id) ? (i.open({
317
332
  message: `${a("report.common.unpin")} ${t} ${a("report.common.successful")}`,
318
333
  type: "success"
319
- }), p.clearPinReport(o.id)) : (c.open({
334
+ }), d.clearPinReport(o.id)) : (i.open({
320
335
  message: `${a("report.common.pin")} ${t} ${a("report.common.successful")}`,
321
336
  type: "success"
322
- }), p.cachePinReport(o));
337
+ }), d.cachePinReport(o));
323
338
  }
324
339
  function xe(o) {
325
340
  O.value = o;
326
341
  }
327
- const { selectedLocationIds: I, dateRange: L, compareDateRange: N, timeRange: f, locations: _e } = de(), P = b(() => I.length === _e.length);
342
+ const { selectedLocationIds: _, dateRange: P, compareDateRange: L, timeRange: v, locations: _e } = fe(), N = b(() => _.length === _e.length);
328
343
  return (o, t) => {
329
- const n = x("FmPageHead"), l = x("FmSearch"), q = x("FmForm"), w = x("FmListItem"), R = x("FmList"), V = x("FmTable");
330
- return A(), G(Ve, null, {
344
+ const r = k("FmPageHead"), l = k("FmSearch"), q = k("FmForm"), S = k("FmListItem"), $ = k("FmList"), V = k("FmTable");
345
+ return A(), G(Ae, null, {
331
346
  default: m(() => [
332
- i(n, {
347
+ c(r, {
333
348
  title: e(a)("report.common.report", 1),
334
349
  class: "h-[68px]",
335
350
  actions: [
@@ -340,46 +355,46 @@ const Ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, He
340
355
  prependIcon: "add"
341
356
  }
342
357
  ],
343
- "onClick:action": t[0] || (t[0] = (r) => we())
358
+ "onClick:action": t[0] || (t[0] = (n) => ke())
344
359
  }, null, 8, ["title", "actions"]),
345
- C("div", {
346
- class: _(`overflow-y-hidden flex flex-col gap-8 ${e(u).sm || e(u).xs ? "mb-20" : ""}`),
347
- style: $e({ height: `calc(100% - ${e(u).lg || e(u).md ? 72 : 64}px)` })
360
+ w("div", {
361
+ class: x(`overflow-y-hidden flex flex-col gap-8 ${e(u).sm || e(u).xs ? "mb-20" : ""}`),
362
+ style: Ie({ height: `calc(100% - ${e(u).lg || e(u).md ? 72 : 64}px)` })
348
363
  }, [
349
- i(q, {
350
- class: _(`flex items-center gap-2 ${e(u).sm || e(u).xs ? "px-3" : "px-24"}`)
364
+ c(q, {
365
+ class: x(`flex items-center gap-2 ${e(u).sm || e(u).xs ? "px-3" : "px-24"}`)
351
366
  }, {
352
367
  default: m(() => [
353
- i(e(E), null, {
368
+ c(e(E), null, {
354
369
  "menu-button": m(() => [
355
- i(e(M), { class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-400" }, {
370
+ c(e(M), { class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-400" }, {
356
371
  default: m(() => [
357
- C("p", null, J(e(a)(`report.category.${O.value.label}`)), 1),
358
- i(e(K), { name: "expand_more" })
372
+ w("p", null, J(e(a)(`report.category.${O.value.label}`)), 1),
373
+ c(e(K), { name: "expand_more" })
359
374
  ]),
360
375
  _: 1
361
376
  })
362
377
  ]),
363
378
  default: m(() => [
364
- (A(!0), De(Fe, null, Oe(se.value, (r, y) => (A(), G(e(S), {
365
- key: y,
366
- label: e(a)(`report.category.${r.label}`),
367
- onClick: () => xe(r)
379
+ (A(!0), Fe(Oe, null, Pe(le.value, (n, g) => (A(), G(e(h), {
380
+ key: g,
381
+ label: e(a)(`report.category.${n.label}`),
382
+ onClick: () => xe(n)
368
383
  }, null, 8, ["label", "onClick"]))), 128))
369
384
  ]),
370
385
  _: 1
371
386
  }),
372
- C("div", {
373
- class: _(`flex ${e(u).sm || e(u).xs ? "justify-center items-center" : ""}`)
387
+ w("div", {
388
+ class: x(`flex ${e(u).sm || e(u).xs ? "justify-center items-center" : ""}`)
374
389
  }, [
375
- C("p", Ge, J(e(a)("report.common.results", { count: k.value.length })), 1)
390
+ w("p", He, J(e(a)("report.common.results", { count: R.value.length })), 1)
376
391
  ], 2),
377
- t[3] || (t[3] = C("div", { class: "grow" }, null, -1)),
378
- C("div", He, [
379
- i(l, {
392
+ t[3] || (t[3] = w("div", { class: "grow" }, null, -1)),
393
+ w("div", Qe, [
394
+ c(l, {
380
395
  modelValue: Y.value,
381
- "onUpdate:modelValue": t[1] || (t[1] = (r) => Y.value = r),
382
- class: _(`${e(u).lg || e(u).md ? "grow" : ""}`)
396
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => Y.value = n),
397
+ class: x(`${e(u).lg || e(u).md ? "grow" : ""}`)
383
398
  }, null, 8, ["modelValue", "class"])
384
399
  ])
385
400
  ]),
@@ -388,120 +403,134 @@ const Ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, He
388
403
  H((A(), G(V, {
389
404
  key: he.value,
390
405
  ref_key: "table",
391
- ref: h,
392
- class: _([e(u).sm || e(u).xs ? "px-0" : "px-24", "report-table"]),
406
+ ref: C,
407
+ class: x([e(u).sm || e(u).xs ? "px-0" : "px-24", "report-table"]),
393
408
  style: { height: "calc(100% - 40px)" },
394
- "column-defs": Se.value,
395
- "row-data": k.value,
396
- "page-size": k.value.length,
409
+ "column-defs": Re.value,
410
+ "row-data": R.value,
411
+ "page-size": R.value.length,
397
412
  "hide-footer": !0,
398
413
  "row-class-name": "row",
399
- onRowClick: t[2] || (t[2] = (r) => {
400
- e(fe).suppressReportRouteSync = !0, e(p).updateCurrentReportId(r.original.reportId), e(X).push({
414
+ onRowClick: t[2] || (t[2] = (n) => {
415
+ if (!n.original.canRead) {
416
+ e(i).open({
417
+ message: e(a)("report.messages.noPermission"),
418
+ type: "error"
419
+ });
420
+ return;
421
+ }
422
+ e(ve).suppressReportRouteSync = !0, e(d).updateCurrentReportId(n.original.reportId), e(X).push({
401
423
  name: "reportView",
402
424
  query: {
403
425
  ...e(Z).query,
404
- reportId: r.original.reportId,
405
- startDate: e(L).startDate,
406
- endDate: e(L).endDate,
407
- compareStartDate: e(N).startDate,
408
- compareEndDate: e(N).endDate,
409
- timeStart: e(f).start ? JSON.stringify(e(f).start) : null,
410
- timeEnd: e(f).end ? JSON.stringify(e(f).end) : null,
411
- isAllLocation: P.value.toString(),
412
- locationIds: P.value ? void 0 : e(I) ? JSON.stringify(e(I)) : void 0
426
+ reportId: n.original.reportId,
427
+ startDate: e(P).startDate,
428
+ endDate: e(P).endDate,
429
+ compareStartDate: e(L).startDate,
430
+ compareEndDate: e(L).endDate,
431
+ timeStart: e(v).start ? JSON.stringify(e(v).start) : null,
432
+ timeEnd: e(v).end ? JSON.stringify(e(v).end) : null,
433
+ isAllLocation: N.value.toString(),
434
+ locationIds: N.value ? void 0 : e(_) ? JSON.stringify(e(_)) : void 0
413
435
  }
414
436
  });
415
437
  })
416
438
  }, {
417
- "list-row": m(({ original: r }) => [
418
- i(R, {
439
+ "list-row": m(({ original: n }) => [
440
+ c($, {
419
441
  onClick: () => {
420
- r.reportId && (e(p).updateCurrentReportId(r.reportId), e(X).push({
442
+ if (!n.canRead) {
443
+ e(i).open({
444
+ message: e(a)("report.messages.noPermission"),
445
+ type: "error"
446
+ });
447
+ return;
448
+ }
449
+ n.reportId && (e(d).updateCurrentReportId(n.reportId), e(X).push({
421
450
  name: "reportView",
422
451
  query: {
423
452
  ...e(Z).query,
424
- reportId: r.reportId,
425
- startDate: e(L).startDate,
426
- endDate: e(L).endDate,
427
- compareStartDate: e(N).startDate,
428
- compareEndDate: e(N).endDate,
429
- timeStart: e(f).start ? JSON.stringify(e(f).start) : null,
430
- timeEnd: e(f).end ? JSON.stringify(e(f).end) : null,
431
- isAllLocation: P.value.toString(),
432
- locationIds: P.value ? void 0 : e(I) ? JSON.stringify(e(I)) : void 0
453
+ reportId: n.reportId,
454
+ startDate: e(P).startDate,
455
+ endDate: e(P).endDate,
456
+ compareStartDate: e(L).startDate,
457
+ compareEndDate: e(L).endDate,
458
+ timeStart: e(v).start ? JSON.stringify(e(v).start) : null,
459
+ timeEnd: e(v).end ? JSON.stringify(e(v).end) : null,
460
+ isAllLocation: N.value.toString(),
461
+ locationIds: N.value ? void 0 : e(_) ? JSON.stringify(e(_)) : void 0
433
462
  }
434
463
  }));
435
464
  }
436
465
  }, {
437
466
  default: m(() => [
438
- i(w, {
467
+ c(S, {
439
468
  tag: "label",
440
- label: r.name,
469
+ label: n.name,
441
470
  clickable: ""
442
471
  }, {
443
472
  append: m(() => [
444
- i(e(M), {
445
- class: _(
446
- r.category !== "Uncategorized" ? "bg-fm-color-system-info-100 text-fm-color-typo-info" : "text-fm-color-typo-secondary"
473
+ c(e(M), {
474
+ class: x(
475
+ n.category !== "Uncategorized" ? "bg-fm-color-system-info-100 text-fm-color-typo-info" : "text-fm-color-typo-secondary"
447
476
  ),
448
477
  compact: !0
449
478
  }, {
450
479
  default: m(() => [
451
- C("p", Qe, J(r.category), 1)
480
+ w("p", We, J(n.category), 1)
452
481
  ]),
453
482
  _: 2
454
483
  }, 1032, ["class"]),
455
- i(e(E), {
484
+ c(e(E), {
456
485
  placement: "left",
457
486
  "stop-click-propagation": !0
458
487
  }, {
459
488
  "menu-button": m(() => [
460
- i(e(K), {
489
+ c(e(K), {
461
490
  name: "more_vert",
462
491
  class: "btn-color"
463
492
  })
464
493
  ]),
465
494
  default: m(() => {
466
- var y;
495
+ var g;
467
496
  return [
468
- i(e(S), {
469
- label: r.pin ? "Unpin" : "Pin",
497
+ c(e(h), {
498
+ label: n.pin ? "Unpin" : "Pin",
470
499
  onClick: () => {
471
- const s = e(d).find(
472
- (g) => g.id === r.reportId
500
+ const s = e(f).find(
501
+ (y) => y.id === n.reportId
473
502
  );
474
- s && ue(s);
503
+ s && me(s);
475
504
  }
476
505
  }, null, 8, ["label", "onClick"]),
477
- i(e(S), {
506
+ c(e(h), {
478
507
  label: e(a)("report.common.duplicate"),
479
508
  onClick: () => {
480
- const s = e(d).find(
481
- (g) => g.id === r.reportId
509
+ const s = e(f).find(
510
+ (y) => y.id === n.reportId
482
511
  );
483
- s && ce(s);
512
+ s && ue(s);
484
513
  }
485
514
  }, null, 8, ["label", "onClick"]),
486
- i(e(S), {
515
+ c(e(h), {
487
516
  label: e(a)(
488
- r.reportId === ((y = e(B)) == null ? void 0 : y.id) ? "report.common.unsetAsOverview" : "report.common.setAsOverview"
517
+ n.reportId === ((g = e(B)) == null ? void 0 : g.id) ? "report.common.unsetAsOverview" : "report.common.setAsOverview"
489
518
  ),
490
519
  onClick: () => {
491
- const s = e(d).find(
492
- (g) => g.id === r.reportId
520
+ const s = e(f).find(
521
+ (y) => y.id === n.reportId
493
522
  );
494
- s && le(s);
523
+ s && ie(s);
495
524
  }
496
525
  }, null, 8, ["label", "onClick"]),
497
- H(i(e(S), {
526
+ H(c(e(h), {
498
527
  label: e(a)("report.common.delete"),
499
528
  class: "text-fm-color-typo-error",
500
529
  onClick: () => {
501
- const s = e(d).find(
502
- (g) => g.id === r.reportId
530
+ const s = e(f).find(
531
+ (y) => y.id === n.reportId
503
532
  );
504
- s && ie(s);
533
+ s && ce(s);
505
534
  }
506
535
  }, {
507
536
  label: m(() => [
@@ -509,7 +538,7 @@ const Ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, He
509
538
  ]),
510
539
  _: 2
511
540
  }, 1032, ["label", "onClick"]), [
512
- [Q, r.editable]
541
+ [Q, n.editable]
513
542
  ])
514
543
  ];
515
544
  }),
@@ -524,10 +553,10 @@ const Ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, He
524
553
  ]),
525
554
  _: 1
526
555
  }, 8, ["class", "column-defs", "row-data", "page-size"])), [
527
- [Q, k.value.length > 0]
556
+ [Q, R.value.length > 0]
528
557
  ]),
529
- H(i(Ee, null, null, 512), [
530
- [Q, k.value.length === 0]
558
+ H(c(Ke, null, null, 512), [
559
+ [Q, R.value.length === 0]
531
560
  ])
532
561
  ], 6)
533
562
  ]),
@@ -537,5 +566,5 @@ const Ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, He
537
566
  }
538
567
  });
539
568
  export {
540
- ut as default
569
+ mt as default
541
570
  };