@feedmepos/mf-report 5.21.39-beta.0 → 5.21.40-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-D57Wm4fK.js +281 -0
  2. package/dist/{BaseDialog.vue_vue_type_script_setup_true_lang-D2TXDVOj.js → BaseDialog.vue_vue_type_script_setup_true_lang-Bp-gX4fR.js} +211 -211
  3. package/dist/{DateRangeSelect.vue_vue_type_script_setup_true_lang-BDoATidT.js → DateRangeSelect.vue_vue_type_script_setup_true_lang-CJppbEh0.js} +2 -2
  4. package/dist/{Default.vue_vue_type_script_setup_true_lang-DaFJdoxZ.js → Default.vue_vue_type_script_setup_true_lang-B4nkCkPn.js} +2 -2
  5. package/dist/FilterSelector.vue_vue_type_script_setup_true_lang-CNeBJJzW.js +2903 -0
  6. package/dist/{InsightView-CHEu_CmU.js → InsightView-SXQiD37j.js} +6 -6
  7. package/dist/{Integration-CItYjFoB.js → Integration-CVW8vCLt.js} +3 -3
  8. package/dist/{Integrations-DWOffOH4.js → Integrations-NIjXmZ1g.js} +3 -3
  9. package/dist/{Layout-Drs6o0OE.js → Layout-D1dQ3u0H.js} +1 -1
  10. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-DzdABO5_.js → MenuTab.vue_vue_type_script_setup_true_lang-D6QwGVIz.js} +14 -13
  11. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-B_zSOuPn.js → NavigationTab.vue_vue_type_script_setup_true_lang-BqEdoznW.js} +5 -5
  12. package/dist/{NoData.vue_vue_type_script_setup_true_lang-DsTTYbp7.js → NoData.vue_vue_type_script_setup_true_lang-oflf_9LD.js} +1 -1
  13. package/dist/{OverviewView-udMSAr7r.js → OverviewView-CMp-wzcf.js} +5 -5
  14. package/dist/{Report-rzRD5nzK.js → Report-F1SZtu_5.js} +4 -4
  15. package/dist/{ReportEditor-DrMgC1kv.js → ReportEditor-ck3bZz_u.js} +6 -6
  16. package/dist/{ReportView-DtW4rlAN.js → ReportView-CihWvVKS.js} +8 -8
  17. package/dist/{SelectComponent.vue_vue_type_script_setup_true_lang-Ba6ktsWW.js → SelectComponent.vue_vue_type_script_setup_true_lang-B37BYpOo.js} +1 -1
  18. package/dist/{Setting-pG9DDDNn.js → Setting-CF5g_ntm.js} +5 -5
  19. package/dist/{TileEditor-Wh2R1JXv.js → TileEditor-DUBQfMht.js} +951 -897
  20. package/dist/{TransitionFade-DheKsv9w.js → TransitionFade-FD0Qbph7.js} +6 -6
  21. package/dist/{app-CXFVEo4M.js → app-TORWi_vq.js} +19 -15
  22. package/dist/app.js +1 -1
  23. package/dist/assets/{formatChartData.worker-DHyKAOan.js → formatChartData.worker-Bf22-3_a.js} +16 -16
  24. package/dist/assets/{processTableData.worker-BAeQAKT3.js → processTableData.worker-GbyPQNAF.js} +21 -21
  25. package/dist/{vue-i18n-BW9ipscO.js → vue-i18n-Cj0-KhdJ.js} +1 -1
  26. package/package.json +2 -2
  27. package/dist/App-C9kh7XpH.js +0 -276
  28. package/dist/FilterSelector.vue_vue_type_script_setup_true_lang-C5kp_IC_.js +0 -2624
@@ -0,0 +1,281 @@
1
+ import { defineComponent as se, resolveComponent as V, createBlock as ie, openBlock as R, unref as d, isRef as Oe, withCtx as z, createElementVNode as M, createVNode as W, toDisplayString as ee, createTextVNode as Ce, onMounted as ue, watch as q, ref as N, computed as te, onBeforeMount as we, onBeforeUnmount as Ee, createElementBlock as Q, Fragment as ke } from "vue";
2
+ import { detectLocale as B, useCoreStore as j } from "@feedmepos/mf-common";
3
+ import { u as Ae, a as Ne, b as ne, c as Be, d as Te, e as Fe, f as $e, s as xe } from "./vue-i18n-Cj0-KhdJ.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-Bp-gX4fR.js";
6
+ import { u as ze, _ as Qe } from "./NavigationTab.vue_vue_type_script_setup_true_lang-BqEdoznW.js";
7
+ import { u as ae } from "./message-dialog-UoMWOnil.js";
8
+ import { d as u } from "./app-TORWi_vq.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(), f = ae(), { isOpened: l, message: S, title: D } = L(ae());
14
+ return (m, y) => {
15
+ const b = V("FmButton"), T = V("FmDialog");
16
+ return R(), ie(T, {
17
+ modelValue: d(l),
18
+ "onUpdate:modelValue": y[0] || (y[0] = (F) => Oe(l) ? l.value = F : null),
19
+ overlay: "",
20
+ "close-button": !1
21
+ }, {
22
+ "dialog-header": z(() => [
23
+ Ce(ee(d(D)), 1)
24
+ ]),
25
+ default: z(() => [
26
+ M("p", We, ee(d(S)), 1)
27
+ ]),
28
+ "dialog-footer": z(() => [
29
+ y[1] || (y[1] = M("div", { class: "grow" }, null, -1)),
30
+ W(b, {
31
+ label: d(i)("report.common.cancel"),
32
+ variant: "tertiary",
33
+ onClick: d(f).dismiss
34
+ }, null, 8, ["label", "onClick"]),
35
+ W(b, {
36
+ label: d(i)("report.common.confirm"),
37
+ onClick: d(f).confirm
38
+ }, null, 8, ["label", "onClick"])
39
+ ]),
40
+ _: 1
41
+ }, 8, ["modelValue"]);
42
+ };
43
+ }
44
+ }), oe = N(B());
45
+ function Ge() {
46
+ const _ = (i) => {
47
+ switch (oe.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
+ _(B());
58
+ }), q(() => B(), _, { deep: !0, immediate: !0 }), {
59
+ currentLocale: oe
60
+ };
61
+ }
62
+ u.locale(B() === "zh-CN" ? "zh-cn" : "en");
63
+ const Ke = ["src"], He = ["src"], ut = /* @__PURE__ */ se({
64
+ __name: "App",
65
+ setup(_) {
66
+ const { businessId: i, token: f, country: l } = L(Ne()), { sessionUser: S, currentBusiness: D, currentCountry: m, registerSidebarComponent: y } = j(), { getRestaurantAndWarehouse: b, getBusinessSetting: T, beginBusinessLoad: F, completeBusinessLoad: ce } = ne(), { getFeatureFlags: de } = Be(), { version: p } = L(re()), { getSettings: le } = Te(), { promptLoader: fe } = Fe(), e = je(), $ = Ve(), h = Je(), P = ze(), r = ne(), me = re(), { suppressReportRouteSync: O } = L(me), { getReports: pe, getOverviewReport: ye, getReportConfig: G, currentReportId: K } = h, { currentReportId: ge, reports: ve } = L(h), { getSchema: Se } = Ue(), { fetchSchedules: De } = P, { init: he } = $e(), x = N("v5"), C = N(!1), w = 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=${f.value}&v2=true&reportV5Button=true`), Re = te(() => `https://report-v4.feedmedev.cc?businessId=${i.value}&country=${l.value}&token=${f.value}&reportV3Button=true`);
67
+ q(
68
+ [() => D.value, () => S.value, () => m.value],
69
+ () => {
70
+ var n, a;
71
+ const t = ((n = D.value) == null ? void 0 : n.id) ?? "";
72
+ if (D.value && S.value && m.value) {
73
+ xe(m.value), i.value !== t && (i.value = t);
74
+ let s = !1;
75
+ if (l.value !== m.value && (s = !0), f.value = ((a = S.value) == null ? void 0 : a.token) ?? "", l.value = m.value ?? "", e.query.businessId !== i.value || s) {
76
+ const c = !w.value && s;
77
+ $.replace({
78
+ name: e.name,
79
+ params: e.params,
80
+ query: {
81
+ ...e.query,
82
+ businessId: i.value,
83
+ country: m.value,
84
+ isAllLocation: c ? "true" : e.query.isAllLocation,
85
+ locationIds: c ? void 0 : e.query.locationIds
86
+ }
87
+ });
88
+ }
89
+ }
90
+ },
91
+ { immediate: !0 }
92
+ );
93
+ function H(t) {
94
+ if (typeof t.data == "string")
95
+ try {
96
+ const n = JSON.parse(t.data);
97
+ (n == null ? void 0 : n.token) !== "" && (n == null ? void 0 : n.token) !== void 0 && (f.value = n.token);
98
+ } catch (n) {
99
+ console.error(n);
100
+ }
101
+ }
102
+ function X(t) {
103
+ if (typeof t.data == "string")
104
+ try {
105
+ const n = JSON.parse(t.data);
106
+ (n == null ? void 0 : n.v5) === !0 ? p.value = x.value : (n == null ? void 0 : n.v3) === !0 && (p.value = "v3");
107
+ } catch (n) {
108
+ console.error(n);
109
+ }
110
+ }
111
+ q(p, () => {
112
+ ["v3", "v4"].includes(p.value) ? j().hideSidebarToggle(!0) : j().hideSidebarToggle(!1);
113
+ }), we(() => {
114
+ y(Qe);
115
+ }), ue(() => {
116
+ console.log("5.21.40-beta.0", !0), window.addEventListener("message", H), window.addEventListener("message", X);
117
+ }), Ee(() => {
118
+ window.removeEventListener("message", H), window.removeEventListener("message", X), h.$dispose(), P.$dispose();
119
+ });
120
+ function qe(t) {
121
+ try {
122
+ return decodeURIComponent(t);
123
+ } catch {
124
+ return t;
125
+ }
126
+ }
127
+ function E(t) {
128
+ if (typeof t != "string" || t.length === 0) return;
129
+ const n = t.includes("%") ? [t, qe(t)] : [t];
130
+ for (const a of n)
131
+ try {
132
+ const s = JSON.parse(a);
133
+ if (typeof s == "string")
134
+ try {
135
+ return JSON.parse(s);
136
+ } catch {
137
+ return s;
138
+ }
139
+ return s;
140
+ } catch {
141
+ }
142
+ }
143
+ function Y(t) {
144
+ if (!t || typeof t != "object") return !1;
145
+ const n = t;
146
+ return typeof n.hour == "number" && typeof n.minute == "number";
147
+ }
148
+ function Le() {
149
+ const t = e.query.startDate ? u(e.query.startDate).startOf("day").toISOString() : void 0, n = e.query.endDate ? u(e.query.endDate).endOf("day").toISOString() : void 0, a = typeof e.query.timeStart == "string", s = typeof e.query.timeEnd == "string", c = E(e.query.timeStart), I = E(e.query.timeEnd), k = Y(c) ? c : null, A = Y(I) ? I : null, J = e.query.compareStartDate ? u(e.query.compareStartDate).startOf("day").toISOString() : void 0, U = e.query.compareEndDate ? u(e.query.compareEndDate).endOf("day").toISOString() : void 0, Z = e.query.isAllLocation === "true" || e.query.isAllLocation === void 0;
150
+ let g = [];
151
+ if (Z)
152
+ g = r.selectedLocationIds;
153
+ else {
154
+ const o = E(e.query.locationIds);
155
+ g = Array.isArray(o) ? o : [];
156
+ }
157
+ let v = e.query.reportId || K;
158
+ if (ve.value.find((o) => o.id === v) || (v = K), v && v !== h.currentReportId && h.updateCurrentReportId(v), t || n) {
159
+ const o = r.dateRange;
160
+ (o.startDate !== t || o.endDate !== n) && r.setDateRange({ startDate: t, endDate: n });
161
+ }
162
+ if (a || s) {
163
+ const o = r.timeRange;
164
+ (o.start !== k || o.end !== A) && r.setTimeRange({ start: k, end: A });
165
+ }
166
+ if (J || U) {
167
+ const o = r.compareDateRange;
168
+ (o.startDate !== J || o.endDate !== U) && r.setCompareDateRange({
169
+ startDate: J,
170
+ endDate: U
171
+ });
172
+ }
173
+ if (!Z && Array.isArray(g)) {
174
+ const o = r.selectedLocationIds;
175
+ o.length === g.length && o.every((_e, be) => _e === g[be]) || r.setSelectedLocationIds(g);
176
+ }
177
+ return {
178
+ // TODO: this returned value can used for getBusinessSetting
179
+ reportId: v,
180
+ startDate: e.query.startDate,
181
+ endDate: e.query.endDate,
182
+ timeStart: e.query.timeStart,
183
+ timeEnd: e.query.timeEnd,
184
+ compareStartDate: e.query.compareStartDate,
185
+ compareEndDate: e.query.compareEndDate,
186
+ locationIds: typeof e.query.locationIds == "string" ? e.query.locationIds : void 0,
187
+ isAllLocation: e.query.isAllLocation
188
+ };
189
+ }
190
+ return q(
191
+ () => i.value,
192
+ async (t) => {
193
+ t !== "" && (C.value = !1, F(t), w.value || (r.setSelectedLocationIds([]), $.replace({
194
+ name: e.name,
195
+ params: e.params,
196
+ query: {
197
+ ...e.query,
198
+ locationIds: void 0,
199
+ isAllLocation: "true"
200
+ }
201
+ })), O.value !== void 0 && (O.value = !0), await fe(async () => {
202
+ await he({
203
+ apiKey: "MaGoXrEWuEJNpWgKTqseee",
204
+ url: "https://flag.feedme.farm/api/v1/",
205
+ enableAnalytics: !1,
206
+ cacheFlags: !1
207
+ });
208
+ const n = await G();
209
+ x.value = n.version, p.value = x.value, await Promise.all([
210
+ de(),
211
+ G(),
212
+ ye(),
213
+ pe(),
214
+ Se(),
215
+ De(),
216
+ b(
217
+ (() => {
218
+ const a = E(e.query.locationIds);
219
+ return Array.isArray(a) ? a : void 0;
220
+ })()
221
+ ),
222
+ le()
223
+ ]), await T(), Le(), ce(t);
224
+ }), C.value = !0, w.value && (w.value = !1));
225
+ },
226
+ {
227
+ immediate: !0
228
+ }
229
+ ), q(
230
+ () => (C.value, {
231
+ reportId: ge.value,
232
+ selectedLocationIds: r.selectedLocationIds,
233
+ dateRange: r.dateRange,
234
+ timeRange: r.timeRange,
235
+ compareDateRange: r.compareDateRange
236
+ }),
237
+ (t) => {
238
+ if (!C.value || !t.reportId) return;
239
+ if (O.value) {
240
+ O.value = !1;
241
+ return;
242
+ }
243
+ const n = t.selectedLocationIds, a = t.dateRange, s = t.timeRange, c = t.compareDateRange, I = {
244
+ ...e.query,
245
+ reportId: t.reportId,
246
+ startDate: a.startDate ? u(a.startDate).startOf("day").toISOString() : void 0,
247
+ endDate: a.endDate ? u(a.endDate).endOf("day").toISOString() : void 0,
248
+ compareStartDate: c.startDate ? u(c.startDate).startOf("day").toISOString() : void 0,
249
+ compareEndDate: c.endDate ? u(c.endDate).endOf("day").toISOString() : void 0,
250
+ timeStart: s.start ? JSON.stringify(s.start) : void 0,
251
+ timeEnd: s.end ? JSON.stringify(s.end) : void 0,
252
+ locationIds: n.length === r.locations.length ? void 0 : n.length > 0 ? JSON.stringify(n) : void 0,
253
+ isAllLocation: String(n.length === r.locations.length)
254
+ }, k = JSON.stringify(e.query), A = JSON.stringify(I);
255
+ k !== A && $.replace({
256
+ name: e.name,
257
+ params: e.params,
258
+ query: I
259
+ });
260
+ },
261
+ { deep: !0 }
262
+ ), Ge(), (t, n) => {
263
+ const a = V("router-view");
264
+ return R(), Q(ke, null, [
265
+ W(Pe),
266
+ d(p) === "v3" ? (R(), Q("iframe", {
267
+ key: 0,
268
+ class: "bg-white h-full w-full",
269
+ src: Ie.value
270
+ }, null, 8, Ke)) : d(p) === "v4" ? (R(), Q("iframe", {
271
+ key: 1,
272
+ class: "bg-white h-full w-full",
273
+ src: Re.value
274
+ }, null, 8, He)) : (R(), ie(a, { key: 2 }))
275
+ ], 64);
276
+ };
277
+ }
278
+ });
279
+ export {
280
+ ut as default
281
+ };