@feedmepos/mf-report 5.18.1-beta.0 → 5.18.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.
@@ -0,0 +1,157 @@
1
+ import { defineComponent as x, resolveComponent as C, createBlock as T, openBlock as d, unref as s, isRef as Z, withCtx as b, createElementVNode as q, createVNode as $, toDisplayString as V, createTextVNode as M, onMounted as z, watch as g, ref as J, computed as D, onBeforeMount as ee, onBeforeUnmount as te, createElementBlock as w, Fragment as oe } from "vue";
2
+ import { detectLocale as y, useCoreStore as k } from "@feedmepos/mf-common";
3
+ import { u as re, d as F, a as se, b as ae, c as ne, e as ue, f as le, s as ie, g as ce } from "./vue-i18n-CTLGxUiF.js";
4
+ import { storeToRefs as I } from "pinia";
5
+ import { u as de, a as me, b as ve } from "./BaseDialog.vue_vue_type_script_setup_true_lang-BrHd550j.js";
6
+ import { _ as fe, u as pe } from "./NavigationTab.vue_vue_type_script_setup_true_lang-4v9iLIA2.js";
7
+ import { u as O } from "./message-dialog-UoMWOnil.js";
8
+ import { useRoute as ge, useRouter as ye } from "vue-router";
9
+ const he = { class: "fm-typo-en-body-md-400 text-ellipsis overflow-hidden" }, Se = /* @__PURE__ */ x({
10
+ __name: "Dialog",
11
+ setup(m) {
12
+ const { t } = re(), n = O(), { isOpened: a, message: i, title: c } = I(O());
13
+ return (v, l) => {
14
+ const f = C("FmButton"), h = C("FmDialog");
15
+ return d(), T(h, {
16
+ modelValue: s(a),
17
+ "onUpdate:modelValue": l[0] || (l[0] = (S) => Z(a) ? a.value = S : null),
18
+ overlay: "",
19
+ "close-button": !1
20
+ }, {
21
+ "dialog-header": b(() => [
22
+ M(V(s(c)), 1)
23
+ ]),
24
+ default: b(() => [
25
+ q("p", he, V(s(i)), 1)
26
+ ]),
27
+ "dialog-footer": b(() => [
28
+ l[1] || (l[1] = q("div", { class: "grow" }, null, -1)),
29
+ $(f, {
30
+ label: s(t)("report.common.cancel"),
31
+ variant: "tertiary",
32
+ onClick: s(n).dismiss
33
+ }, null, 8, ["label", "onClick"]),
34
+ $(f, {
35
+ label: s(t)("report.common.confirm"),
36
+ onClick: s(n).confirm
37
+ }, null, 8, ["label", "onClick"])
38
+ ]),
39
+ _: 1
40
+ }, 8, ["modelValue"]);
41
+ };
42
+ }
43
+ }), U = J(y());
44
+ function _e() {
45
+ const m = (t) => {
46
+ switch (U.value = t, t) {
47
+ case "zh-CN":
48
+ F.locale("zh-cn");
49
+ break;
50
+ default:
51
+ F.locale("en");
52
+ break;
53
+ }
54
+ };
55
+ return z(() => {
56
+ m(y());
57
+ }), g(() => y(), m, { deep: !0, immediate: !0 }), {
58
+ currentLocale: U
59
+ };
60
+ }
61
+ F.locale(y() === "zh-CN" ? "zh-cn" : "en");
62
+ const be = ["src"], we = ["src"], Le = /* @__PURE__ */ x({
63
+ __name: "App",
64
+ setup(m) {
65
+ const { businessId: t, token: n, country: a } = I(se()), { sessionUser: i, currentBusiness: c, currentCountry: v, registerSidebarComponent: l } = k(), { getRestaurantAndWarehouse: f, getBusinessSetting: h } = ae(), { getFeatureFlags: S } = ne(), { version: u } = I(de()), { getSettings: j } = ue(), { promptLoader: A } = le(), r = ge(), W = ye(), G = D(() => `https://portal-v1.feedmedev.cc/b/${t.value}/report/CLOSE_UP?showHeader=false&country=${a.value.toUpperCase()}&menuOption=business-report&token=${n.value}&v2=true&reportV5Button=true`), K = D(() => `https://report-v4.feedmedev.cc?businessId=${t.value}&country=${a.value}&token=${n.value}&reportV3Button=true`);
66
+ g(
67
+ [() => c.value, () => i.value, () => v.value],
68
+ () => {
69
+ var e, p;
70
+ const o = ((e = c.value) == null ? void 0 : e.id) ?? "";
71
+ c.value && i.value && v.value ? (ie(a.value), t.value !== o && (t.value = o), n.value = ((p = i.value) == null ? void 0 : p.token) ?? "", a.value = v.value ?? "", r.query.businessId !== t.value && W.replace({
72
+ name: r.name,
73
+ params: r.params,
74
+ query: { ...r.query, businessId: t.value }
75
+ })) : r.query.businessId && t.value !== r.query.businessId && (t.value = String(r.query.businessId));
76
+ },
77
+ { immediate: !0 }
78
+ );
79
+ function B(o) {
80
+ if (typeof o.data == "string")
81
+ try {
82
+ const e = JSON.parse(o.data);
83
+ (e == null ? void 0 : e.token) !== "" && (e == null ? void 0 : e.token) !== void 0 && (n.value = e.token);
84
+ } catch (e) {
85
+ console.error(e);
86
+ }
87
+ }
88
+ function R(o) {
89
+ if (typeof o.data == "string")
90
+ try {
91
+ const e = JSON.parse(o.data);
92
+ (e == null ? void 0 : e.v5) === !0 ? u.value = _.value : (e == null ? void 0 : e.v3) === !0 && (u.value = "v3");
93
+ } catch (e) {
94
+ console.error(e);
95
+ }
96
+ }
97
+ g(u, () => {
98
+ ["v3", "v4"].includes(u.value) ? k().hideSidebarToggle(!0) : k().hideSidebarToggle(!1);
99
+ }), ee(() => {
100
+ l(fe);
101
+ }), z(() => {
102
+ console.log("5.18.2-beta.0", !0), window.addEventListener("message", B), window.addEventListener("message", R);
103
+ });
104
+ const E = me(), L = pe();
105
+ te(() => {
106
+ window.removeEventListener("message", B), window.removeEventListener("message", R), E.$dispose(), L.$dispose();
107
+ });
108
+ const { getReports: P, getOverviewReport: H, getReportConfig: N } = E, { getSchema: Q } = ve(), { fetchSchedules: X } = L, { init: Y } = ce(), _ = J("v5");
109
+ return g(
110
+ () => t.value,
111
+ () => {
112
+ t.value !== "" && A(async () => {
113
+ await Y({
114
+ apiKey: "MaGoXrEWuEJNpWgKTqseee",
115
+ url: "https://flag.feedme.farm/api/v1/",
116
+ enableAnalytics: !1,
117
+ cacheFlags: !1
118
+ });
119
+ const o = await N();
120
+ _.value = o.version, u.value = _.value, await Promise.all([
121
+ S(),
122
+ N(),
123
+ H(),
124
+ P(),
125
+ Q(),
126
+ X(),
127
+ h(),
128
+ f(
129
+ r.query.locationIds ? JSON.parse(r.query.locationIds) : null
130
+ ),
131
+ j()
132
+ ]);
133
+ });
134
+ },
135
+ {
136
+ immediate: !0
137
+ }
138
+ ), _e(), (o, e) => {
139
+ const p = C("router-view");
140
+ return d(), w(oe, null, [
141
+ $(Se),
142
+ s(u) === "v3" ? (d(), w("iframe", {
143
+ key: 0,
144
+ class: "bg-white h-full w-full",
145
+ src: G.value
146
+ }, null, 8, be)) : s(u) === "v4" ? (d(), w("iframe", {
147
+ key: 1,
148
+ class: "bg-white h-full w-full",
149
+ src: K.value
150
+ }, null, 8, we)) : (d(), T(p, { key: 2 }))
151
+ ], 64);
152
+ };
153
+ }
154
+ });
155
+ export {
156
+ Le as default
157
+ };
package/dist/app.js CHANGED
@@ -5028,7 +5028,7 @@ const u = {
5028
5028
  "zh-CN": m,
5029
5029
  "th-TH": c,
5030
5030
  "zh-Hant": p
5031
- }, h = e(() => import("./App-BnUGnhPB.js"));
5031
+ }, h = e(() => import("./App-Cts_hjbs.js"));
5032
5032
  export {
5033
5033
  h as FmApp,
5034
5034
  u as i18nMessages,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-report",
3
- "version": "5.18.1-beta.0",
3
+ "version": "5.18.2-beta.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -1,152 +0,0 @@
1
- import { defineComponent as x, resolveComponent as b, createBlock as T, openBlock as c, unref as r, isRef as Y, withCtx as S, createElementVNode as V, createVNode as k, toDisplayString as D, createTextVNode as Z, onMounted as z, watch as f, ref as J, computed as I, onBeforeMount as M, onBeforeUnmount as ee, createElementBlock as y, Fragment as te } from "vue";
2
- import { detectLocale as p, useCoreStore as w } from "@feedmepos/mf-common";
3
- import { u as oe, d as C, a as re, b as ae, c as ne, e as se, f as le, s as ue, g as ie } from "./vue-i18n-CTLGxUiF.js";
4
- import { storeToRefs as $ } from "pinia";
5
- import { u as ce, a as me, b as de } from "./BaseDialog.vue_vue_type_script_setup_true_lang-BrHd550j.js";
6
- import { _ as ve, u as fe } from "./NavigationTab.vue_vue_type_script_setup_true_lang-4v9iLIA2.js";
7
- import { u as O } from "./message-dialog-UoMWOnil.js";
8
- import { useRoute as pe } from "vue-router";
9
- const ge = { class: "fm-typo-en-body-md-400 text-ellipsis overflow-hidden" }, he = /* @__PURE__ */ x({
10
- __name: "Dialog",
11
- setup(m) {
12
- const { t } = oe(), n = O(), { isOpened: a, message: u, title: i } = $(O());
13
- return (d, l) => {
14
- const v = b("FmButton"), g = b("FmDialog");
15
- return c(), T(g, {
16
- modelValue: r(a),
17
- "onUpdate:modelValue": l[0] || (l[0] = (h) => Y(a) ? a.value = h : null),
18
- overlay: "",
19
- "close-button": !1
20
- }, {
21
- "dialog-header": S(() => [
22
- Z(D(r(i)), 1)
23
- ]),
24
- default: S(() => [
25
- V("p", ge, D(r(u)), 1)
26
- ]),
27
- "dialog-footer": S(() => [
28
- l[1] || (l[1] = V("div", { class: "grow" }, null, -1)),
29
- k(v, {
30
- label: r(t)("report.common.cancel"),
31
- variant: "tertiary",
32
- onClick: r(n).dismiss
33
- }, null, 8, ["label", "onClick"]),
34
- k(v, {
35
- label: r(t)("report.common.confirm"),
36
- onClick: r(n).confirm
37
- }, null, 8, ["label", "onClick"])
38
- ]),
39
- _: 1
40
- }, 8, ["modelValue"]);
41
- };
42
- }
43
- }), U = J(p());
44
- function _e() {
45
- const m = (t) => {
46
- switch (U.value = t, t) {
47
- case "zh-CN":
48
- C.locale("zh-cn");
49
- break;
50
- default:
51
- C.locale("en");
52
- break;
53
- }
54
- };
55
- return z(() => {
56
- m(p());
57
- }), f(() => p(), m, { deep: !0, immediate: !0 }), {
58
- currentLocale: U
59
- };
60
- }
61
- C.locale(p() === "zh-CN" ? "zh-cn" : "en");
62
- const Se = ["src"], ye = ["src"], Le = /* @__PURE__ */ x({
63
- __name: "App",
64
- setup(m) {
65
- const { businessId: t, token: n, country: a } = $(re()), { sessionUser: u, currentBusiness: i, currentCountry: d, registerSidebarComponent: l } = w(), { getRestaurantAndWarehouse: v, getBusinessSetting: g } = ae(), { getFeatureFlags: h } = ne(), { version: s } = $(ce()), { getSettings: j } = se(), { promptLoader: q } = le(), F = pe(), A = I(() => `https://portal-v1.feedmedev.cc/b/${t.value}/report/CLOSE_UP?showHeader=false&country=${a.value.toUpperCase()}&menuOption=business-report&token=${n.value}&v2=true&reportV5Button=true`), W = I(() => `https://report-v4.feedmedev.cc?businessId=${t.value}&country=${a.value}&token=${n.value}&reportV3Button=true`);
66
- f(
67
- [() => i.value, () => u.value, () => d.value],
68
- () => {
69
- var o, e;
70
- i.value && u.value && d.value && (ue(a.value), t.value = ((o = i.value) == null ? void 0 : o.id) ?? "", n.value = ((e = u.value) == null ? void 0 : e.token) ?? "", a.value = d.value ?? "");
71
- },
72
- { immediate: !0 }
73
- );
74
- function B(o) {
75
- if (typeof o.data == "string")
76
- try {
77
- const e = JSON.parse(o.data);
78
- (e == null ? void 0 : e.token) !== "" && (e == null ? void 0 : e.token) !== void 0 && (n.value = e.token);
79
- } catch (e) {
80
- console.error(e);
81
- }
82
- }
83
- function E(o) {
84
- if (typeof o.data == "string")
85
- try {
86
- const e = JSON.parse(o.data);
87
- (e == null ? void 0 : e.v5) === !0 ? s.value = _.value : (e == null ? void 0 : e.v3) === !0 && (s.value = "v3");
88
- } catch (e) {
89
- console.error(e);
90
- }
91
- }
92
- f(s, () => {
93
- ["v3", "v4"].includes(s.value) ? w().hideSidebarToggle(!0) : w().hideSidebarToggle(!1);
94
- }), M(() => {
95
- l(ve);
96
- }), z(() => {
97
- console.log("5.18.1-beta.0", !0), window.addEventListener("message", B), window.addEventListener("message", E);
98
- });
99
- const L = me(), N = fe();
100
- ee(() => {
101
- window.removeEventListener("message", B), window.removeEventListener("message", E), L.$dispose(), N.$dispose();
102
- });
103
- const { getReports: G, getOverviewReport: K, getReportConfig: R } = L, { getSchema: P } = de(), { fetchSchedules: H } = N, { init: Q } = ie(), _ = J("v5");
104
- return f(
105
- () => t.value,
106
- () => {
107
- t.value !== "" && q(async () => {
108
- await Q({
109
- apiKey: "MaGoXrEWuEJNpWgKTqseee",
110
- url: "https://flag.feedme.farm/api/v1/",
111
- enableAnalytics: !1,
112
- cacheFlags: !1
113
- });
114
- const o = await R();
115
- _.value = o.version, s.value = _.value, await Promise.all([
116
- h(),
117
- R(),
118
- K(),
119
- G(),
120
- P(),
121
- H(),
122
- g(),
123
- v(
124
- F.query.locationIds ? JSON.parse(F.query.locationIds) : null
125
- ),
126
- j()
127
- ]);
128
- });
129
- },
130
- {
131
- immediate: !0
132
- }
133
- ), _e(), (o, e) => {
134
- const X = b("router-view");
135
- return c(), y(te, null, [
136
- k(he),
137
- r(s) === "v3" ? (c(), y("iframe", {
138
- key: 0,
139
- class: "bg-white h-full w-full",
140
- src: A.value
141
- }, null, 8, Se)) : r(s) === "v4" ? (c(), y("iframe", {
142
- key: 1,
143
- class: "bg-white h-full w-full",
144
- src: W.value
145
- }, null, 8, ye)) : (c(), T(X, { key: 2 }))
146
- ], 64);
147
- };
148
- }
149
- });
150
- export {
151
- Le as default
152
- };