@feedmepos/mf-report 5.22.1-remy.2 → 5.22.2-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 (42) hide show
  1. package/dist/App-kSo0wWAu.js +264 -0
  2. package/dist/BaseDialog.vue_vue_type_script_setup_true_lang-DZ2s2sZN.js +20812 -0
  3. package/dist/{DateRangeSelect.vue_vue_type_script_setup_true_lang-DMnXUzDy.js → DateRangeSelect.vue_vue_type_script_setup_true_lang-Bar8cWAx.js} +89 -86
  4. package/dist/{Default.vue_vue_type_script_setup_true_lang-Da4Qj31I.js → Default.vue_vue_type_script_setup_true_lang-UHSJTVZA.js} +12 -13
  5. package/dist/FilterSelector.vue_vue_type_script_setup_true_lang-DWR6vEwp.js +4312 -0
  6. package/dist/InsightView-lue87iV-.js +662 -0
  7. package/dist/{Integration-F1OWPe2v.js → Integration-BUoZ0Xs-.js} +2689 -2172
  8. package/dist/{Integrations-6h3Ynyhx.js → Integrations-hOdl7u8Q.js} +27 -28
  9. package/dist/{Layout-D4Hl2RVc.js → Layout-B1BdaSQI.js} +1 -1
  10. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-BpSxzEVb.js → MenuTab.vue_vue_type_script_setup_true_lang-Cum4Ci7x.js} +15 -14
  11. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-DCSjuXmi.js → NavigationTab.vue_vue_type_script_setup_true_lang-DfWkcOX3.js} +9924 -9855
  12. package/dist/{NoData.vue_vue_type_script_setup_true_lang-CW6oZEnc.js → NoData.vue_vue_type_script_setup_true_lang-CU_i5sWL.js} +1 -1
  13. package/dist/{OverviewView-BAhRRNeA.js → OverviewView-DeRBmy8G.js} +17 -17
  14. package/dist/Report-CF_I43Sz.js +506 -0
  15. package/dist/ReportEditor-BPwcWi6o.js +1103 -0
  16. package/dist/ReportView-CIfUeKWA.js +250 -0
  17. package/dist/{SelectComponent.vue_vue_type_script_setup_true_lang-CiT09OeD.js → SelectComponent.vue_vue_type_script_setup_true_lang-0_S2mHgK.js} +3 -3
  18. package/dist/{Setting-cnuWE3wM.js → Setting-Bjjpa5fl.js} +16 -16
  19. package/dist/TileEditor-C2uPP95l.js +3611 -0
  20. package/dist/TransitionFade-Dj9hkaPu.js +2376 -0
  21. package/dist/app-X_xk82jB.js +6525 -0
  22. package/dist/app.js +2 -3
  23. package/dist/assets/formatChartData.worker-50q7LVBw.js +171 -0
  24. package/dist/assets/processTableData.worker-DrSBAOPU.js +171 -0
  25. package/dist/{InsightView-D_V8GCdN.js → chart-DDDh8zNk.js} +1824 -2481
  26. package/dist/i18n-CI_sQ5d_.js +76 -0
  27. package/dist/style.css +1 -1
  28. package/dist/vue-i18n-CVW4Kgfw.js +6018 -0
  29. package/package.json +4 -5
  30. package/dist/App-DllSHrhi.js +0 -234
  31. package/dist/BaseDialog.vue_vue_type_script_setup_true_lang-BqaTjSqX.js +0 -315
  32. package/dist/FilterSelector.vue_vue_type_script_setup_true_lang-CrDNlz99.js +0 -2438
  33. package/dist/Report-MYVRo7SL.js +0 -487
  34. package/dist/ReportEditor-DgVHv5lv.js +0 -1077
  35. package/dist/ReportView-CI-bWx1T.js +0 -194
  36. package/dist/TileEditor-BydbDg_b.js +0 -2767
  37. package/dist/TransitionFade-D0ozPmOn.js +0 -2367
  38. package/dist/app-lLf0I618.js +0 -28808
  39. package/dist/assets/formatChartData.worker-B_urmW55.js +0 -134
  40. package/dist/assets/processTableData.worker-B_-FBESg.js +0 -134
  41. package/dist/i18n-DQxDgiLO.js +0 -11
  42. package/dist/vue-i18n-CQAzKJVO.js +0 -2711
@@ -0,0 +1,264 @@
1
+ import { defineComponent as se, resolveComponent as j, createBlock as ie, openBlock as R, unref as c, isRef as be, withCtx as U, createElementVNode as M, createVNode as V, toDisplayString as ee, createTextVNode as we, onMounted as ue, watch as q, ref as N, computed as te, onBeforeMount as Ee, onBeforeUnmount as Ce, createElementBlock as z, Fragment as ke } from "vue";
2
+ import { detectLocale as T, useCoreStore as Q } from "@feedmepos/mf-common";
3
+ import { u as Ae, a as Ne, b as ne, c as Te, d as Be, e as Fe, f as $e, s as xe } from "./vue-i18n-CVW4Kgfw.js";
4
+ import { storeToRefs as L } from "pinia";
5
+ import { u as re, a as Je, b as Ue } from "./BaseDialog.vue_vue_type_script_setup_true_lang-DZ2s2sZN.js";
6
+ import { u as ze, _ as Qe } from "./NavigationTab.vue_vue_type_script_setup_true_lang-DfWkcOX3.js";
7
+ import { u as oe } from "./message-dialog-UoMWOnil.js";
8
+ import { d as u } from "./app-X_xk82jB.js";
9
+ import { useRoute as je, useRouter as Ve } from "vue-router";
10
+ const We = { class: "fm-typo-en-body-md-400 text-ellipsis overflow-hidden" }, Pe = /* @__PURE__ */ se({
11
+ __name: "Dialog",
12
+ setup(_) {
13
+ const { t: i } = Ae(), d = oe(), { isOpened: l, message: v, title: S } = L(oe());
14
+ return (D, p) => {
15
+ const O = j("FmButton"), B = j("FmDialog");
16
+ return R(), ie(B, {
17
+ modelValue: c(l),
18
+ "onUpdate:modelValue": p[0] || (p[0] = (F) => be(l) ? l.value = F : null),
19
+ overlay: "",
20
+ "close-button": !1
21
+ }, {
22
+ "dialog-header": U(() => [
23
+ we(ee(c(S)), 1)
24
+ ]),
25
+ default: U(() => [
26
+ M("p", We, ee(c(v)), 1)
27
+ ]),
28
+ "dialog-footer": U(() => [
29
+ p[1] || (p[1] = M("div", { class: "grow" }, null, -1)),
30
+ V(O, {
31
+ label: c(i)("report.common.cancel"),
32
+ variant: "tertiary",
33
+ onClick: c(d).dismiss
34
+ }, null, 8, ["label", "onClick"]),
35
+ V(O, {
36
+ label: c(i)("report.common.confirm"),
37
+ onClick: c(d).confirm
38
+ }, null, 8, ["label", "onClick"])
39
+ ]),
40
+ _: 1
41
+ }, 8, ["modelValue"]);
42
+ };
43
+ }
44
+ }), ae = N(T());
45
+ function Ge() {
46
+ const _ = (i) => {
47
+ switch (ae.value = i, i) {
48
+ case "zh-CN":
49
+ u.locale("zh-cn");
50
+ break;
51
+ default:
52
+ u.locale("en");
53
+ break;
54
+ }
55
+ };
56
+ return ue(() => {
57
+ _(T());
58
+ }), q(() => T(), _, { deep: !0, immediate: !0 }), {
59
+ currentLocale: ae
60
+ };
61
+ }
62
+ u.locale(T() === "zh-CN" ? "zh-cn" : "en");
63
+ const Ke = ["src"], He = ["src"], ut = /* @__PURE__ */ se({
64
+ __name: "App",
65
+ setup(_) {
66
+ const { businessId: i, token: d, country: l } = L(Ne()), { sessionUser: v, currentBusiness: S, currentCountry: D, registerSidebarComponent: p } = Q(), { getRestaurantAndWarehouse: O, getBusinessSetting: B, beginBusinessLoad: F, completeBusinessLoad: ce } = ne(), { getFeatureFlags: de } = Te(), { version: f } = L(re()), { getSettings: le } = Be(), { promptLoader: fe } = Fe(), n = je(), W = Ve(), h = Je(), P = ze(), r = ne(), me = re(), { suppressReportRouteSync: b } = L(me), { getReports: pe, getOverviewReport: ge, getReportConfig: G, currentReportId: K } = h, { currentReportId: ye, reports: ve } = L(h), { getSchema: Se } = Ue(), { fetchSchedules: De } = P, { init: he } = $e(), $ = N("v5"), w = N(!1), E = N(!0), Ie = te(() => `https://portal-v1.feedmedev.cc/b/${i.value}/report/CLOSE_UP?showHeader=false&country=${l.value.toUpperCase()}&menuOption=business-report&token=${d.value}&v2=true&reportV5Button=true`), Re = te(() => `https://report-v4.feedmedev.cc?businessId=${i.value}&country=${l.value}&token=${d.value}&reportV3Button=true`);
67
+ q(
68
+ [() => S.value, () => v.value, () => D.value],
69
+ () => {
70
+ var t, a;
71
+ const e = ((t = S.value) == null ? void 0 : t.id) ?? "";
72
+ S.value && v.value && D.value && (xe(D.value), i.value !== e && (i.value = e), d.value = ((a = v.value) == null ? void 0 : a.token) ?? "", l.value = D.value ?? "");
73
+ },
74
+ { immediate: !0 }
75
+ );
76
+ function H(e) {
77
+ if (typeof e.data == "string")
78
+ try {
79
+ const t = JSON.parse(e.data);
80
+ (t == null ? void 0 : t.token) !== "" && (t == null ? void 0 : t.token) !== void 0 && (d.value = t.token);
81
+ } catch (t) {
82
+ console.error(t);
83
+ }
84
+ }
85
+ function X(e) {
86
+ if (typeof e.data == "string")
87
+ try {
88
+ const t = JSON.parse(e.data);
89
+ (t == null ? void 0 : t.v5) === !0 ? f.value = $.value : (t == null ? void 0 : t.v3) === !0 && (f.value = "v3");
90
+ } catch (t) {
91
+ console.error(t);
92
+ }
93
+ }
94
+ q(f, () => {
95
+ ["v3", "v4"].includes(f.value) ? Q().hideSidebarToggle(!0) : Q().hideSidebarToggle(!1);
96
+ }), Ee(() => {
97
+ p(Qe);
98
+ }), ue(() => {
99
+ console.log("5.22.2-beta.0", !0), window.addEventListener("message", H), window.addEventListener("message", X);
100
+ }), Ce(() => {
101
+ window.removeEventListener("message", H), window.removeEventListener("message", X), h.$dispose(), P.$dispose();
102
+ });
103
+ function qe(e) {
104
+ try {
105
+ return decodeURIComponent(e);
106
+ } catch {
107
+ return e;
108
+ }
109
+ }
110
+ function C(e) {
111
+ if (typeof e != "string" || e.length === 0) return;
112
+ const t = e.includes("%") ? [e, qe(e)] : [e];
113
+ for (const a of t)
114
+ try {
115
+ const s = JSON.parse(a);
116
+ if (typeof s == "string")
117
+ try {
118
+ return JSON.parse(s);
119
+ } catch {
120
+ return s;
121
+ }
122
+ return s;
123
+ } catch {
124
+ }
125
+ }
126
+ function Y(e) {
127
+ if (!e || typeof e != "object") return !1;
128
+ const t = e;
129
+ return typeof t.hour == "number" && typeof t.minute == "number";
130
+ }
131
+ function Le() {
132
+ const e = n.query.startDate ? u(n.query.startDate).startOf("day").toISOString() : void 0, t = n.query.endDate ? u(n.query.endDate).endOf("day").toISOString() : void 0, a = typeof n.query.timeStart == "string", s = typeof n.query.timeEnd == "string", m = C(n.query.timeStart), I = C(n.query.timeEnd), k = Y(m) ? m : null, A = Y(I) ? I : null, x = n.query.compareStartDate ? u(n.query.compareStartDate).startOf("day").toISOString() : void 0, J = n.query.compareEndDate ? u(n.query.compareEndDate).endOf("day").toISOString() : void 0, Z = n.query.isAllLocation === "true" || n.query.isAllLocation === void 0;
133
+ let g = [];
134
+ if (Z)
135
+ g = r.selectedLocationIds;
136
+ else {
137
+ const o = C(n.query.locationIds);
138
+ g = Array.isArray(o) ? o : [];
139
+ }
140
+ let y = n.query.reportId || K;
141
+ if (ve.value.find((o) => o.id === y) || (y = K), y && y !== h.currentReportId && h.updateCurrentReportId(y), e || t) {
142
+ const o = r.dateRange;
143
+ (o.startDate !== e || o.endDate !== t) && r.setDateRange({ startDate: e, endDate: t });
144
+ }
145
+ if (a || s) {
146
+ const o = r.timeRange;
147
+ (o.start !== k || o.end !== A) && r.setTimeRange({ start: k, end: A });
148
+ }
149
+ if (x || J) {
150
+ const o = r.compareDateRange;
151
+ (o.startDate !== x || o.endDate !== J) && r.setCompareDateRange({
152
+ startDate: x,
153
+ endDate: J
154
+ });
155
+ }
156
+ if (!Z && Array.isArray(g)) {
157
+ const o = r.selectedLocationIds;
158
+ o.length === g.length && o.every((_e, Oe) => _e === g[Oe]) || r.setSelectedLocationIds(g);
159
+ }
160
+ return {
161
+ // TODO: this returned value can used for getBusinessSetting
162
+ reportId: y,
163
+ startDate: n.query.startDate,
164
+ endDate: n.query.endDate,
165
+ timeStart: n.query.timeStart,
166
+ timeEnd: n.query.timeEnd,
167
+ compareStartDate: n.query.compareStartDate,
168
+ compareEndDate: n.query.compareEndDate,
169
+ locationIds: typeof n.query.locationIds == "string" ? n.query.locationIds : void 0,
170
+ isAllLocation: n.query.isAllLocation
171
+ };
172
+ }
173
+ return q(
174
+ () => i.value,
175
+ async (e, t) => {
176
+ e !== "" && (w.value = !1, F(e), (!E.value || t !== void 0) && (r.setSelectedLocationIds([]), W.replace({
177
+ name: n.name,
178
+ params: n.params,
179
+ query: {
180
+ ...n.query,
181
+ locationIds: void 0,
182
+ isAllLocation: "true"
183
+ }
184
+ })), b.value !== void 0 && (b.value = !0), await fe(async () => {
185
+ await he({
186
+ apiKey: "MaGoXrEWuEJNpWgKTqseee",
187
+ url: "https://flag.feedme.farm/api/v1/",
188
+ enableAnalytics: !1,
189
+ cacheFlags: !1
190
+ });
191
+ const a = await G();
192
+ $.value = a.version, f.value = $.value, await Promise.all([
193
+ de(),
194
+ G(),
195
+ ge(),
196
+ pe(),
197
+ Se(),
198
+ De(),
199
+ O(
200
+ (() => {
201
+ const s = C(n.query.locationIds);
202
+ return Array.isArray(s) ? s : void 0;
203
+ })()
204
+ ),
205
+ le()
206
+ ]), await B(), Le(), ce(e);
207
+ }), w.value = !0, E.value && (E.value = !1));
208
+ },
209
+ {
210
+ immediate: !0
211
+ }
212
+ ), q(
213
+ () => (w.value, {
214
+ reportId: ye.value,
215
+ selectedLocationIds: r.selectedLocationIds,
216
+ dateRange: r.dateRange,
217
+ timeRange: r.timeRange,
218
+ compareDateRange: r.compareDateRange
219
+ }),
220
+ (e) => {
221
+ if (!w.value || !e.reportId || E.value) return;
222
+ if (b.value) {
223
+ b.value = !1;
224
+ return;
225
+ }
226
+ const t = e.selectedLocationIds, a = e.dateRange, s = e.timeRange, m = e.compareDateRange, I = {
227
+ ...n.query,
228
+ reportId: e.reportId,
229
+ startDate: a.startDate ? u(a.startDate).startOf("day").toISOString() : void 0,
230
+ endDate: a.endDate ? u(a.endDate).endOf("day").toISOString() : void 0,
231
+ compareStartDate: m.startDate ? u(m.startDate).startOf("day").toISOString() : void 0,
232
+ compareEndDate: m.endDate ? u(m.endDate).endOf("day").toISOString() : void 0,
233
+ timeStart: s.start ? JSON.stringify(s.start) : void 0,
234
+ timeEnd: s.end ? JSON.stringify(s.end) : void 0,
235
+ locationIds: t.length === r.locations.length ? void 0 : t.length > 0 ? JSON.stringify(t) : void 0,
236
+ isAllLocation: String(t.length === r.locations.length)
237
+ }, k = JSON.stringify(n.query), A = JSON.stringify(I);
238
+ k !== A && W.replace({
239
+ name: n.name,
240
+ params: n.params,
241
+ query: I
242
+ });
243
+ },
244
+ { deep: !0 }
245
+ ), Ge(), (e, t) => {
246
+ const a = j("router-view");
247
+ return R(), z(ke, null, [
248
+ V(Pe),
249
+ c(f) === "v3" ? (R(), z("iframe", {
250
+ key: 0,
251
+ class: "bg-white h-full w-full",
252
+ src: Ie.value
253
+ }, null, 8, Ke)) : c(f) === "v4" ? (R(), z("iframe", {
254
+ key: 1,
255
+ class: "bg-white h-full w-full",
256
+ src: Re.value
257
+ }, null, 8, He)) : (R(), ie(a, { key: 2 }))
258
+ ], 64);
259
+ };
260
+ }
261
+ });
262
+ export {
263
+ ut as default
264
+ };