@feedmepos/mf-menu 0.32.62 → 0.32.63-dev.1
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.
- package/dist/{App-CE4fZP2_.js → App-DhfTGlgM.js} +467 -462
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-PpYjjdOP.js → ApplyProduct.vue_vue_type_script_setup_true_lang-C5-8qdJK.js} +3 -3
- package/dist/{ApplyProductDialog.vue_vue_type_script_setup_true_lang-C_JKiJRD.js → ApplyProductDialog.vue_vue_type_script_setup_true_lang-CXm-0H18.js} +8 -8
- package/dist/{Catalog-C2MyXkps.js → Catalog-WuZJfM6l.js} +78 -78
- package/dist/{Category-B7Uxbyug.js → Category-BeIo7XWY.js} +20 -20
- package/dist/{Category-BoV0MYQp.js → Category-D-cQQCPS.js} +19 -19
- package/dist/{CookingGuide-Bdyj8XMv.js → CookingGuide-B-yvD9ZA.js} +88 -88
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-EDbgLHTU.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-2_yzXoa4.js} +1 -1
- package/dist/{Group-BuFbi0Z-.js → Group-13i5igrS.js} +5 -5
- package/dist/{Group-DYpxc5ui.js → Group-CY8lUzQG.js} +1 -1
- package/dist/{Group.vue_vue_type_script_setup_true_lang-B5Uw2Rzm.js → Group.vue_vue_type_script_setup_true_lang-DZhxy0tb.js} +95 -94
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-COYg8e7h.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-CWqv-oUd.js} +13 -13
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-YY25YW4B.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-DTs4Vpdi.js} +219 -220
- package/dist/{Ingredient-Ddw06I0B.js → Ingredient-vrUOW6gk.js} +49 -49
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-CsWdL5Lz.js → InventoryBinding.vue_vue_type_script_setup_true_lang-xcVjRjqD.js} +2 -2
- package/dist/{LinkProductSideSheet-COAMZqOM.js → LinkProductSideSheet-DMbJG6wf.js} +8 -8
- package/dist/{MenuSetting--G1_lGoV.js → MenuSetting-Di2xwm00.js} +10 -10
- package/dist/{OrderPacing-DnvLJh5M.js → OrderPacing-CCe-IcGO.js} +28 -28
- package/dist/{PrintRoute-CP-3JGP3.js → PrintRoute-CcfObcHY.js} +27 -27
- package/dist/{Product-D-q15-Qw.js → Product-ChUVnMgG.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-BaOg60Q6.js → Product.vue_vue_type_script_setup_true_lang-C9Qp50hL.js} +153 -152
- package/dist/{ProductInternalTools-wYn0bzml.js → ProductInternalTools-D9HXhgo5.js} +80 -79
- package/dist/{Products-CxEsB-7l.js → Products-Bly2ktEC.js} +75 -74
- package/dist/{Publish-BCljLztW.js → Publish-C8ubb8Qf.js} +113 -113
- package/dist/{Recipe-DgfobgnQ.js → Recipe-BpMRLsyO.js} +32 -32
- package/dist/{RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-BgDVFKRI.js → RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-BD5OCDRn.js} +1 -1
- package/dist/{RuleView.vue_vue_type_script_setup_true_lang-DCbrAMxd.js → RuleView.vue_vue_type_script_setup_true_lang-Ba3djmX1.js} +474 -473
- package/dist/{Scheduler-C-LJs7Gl.js → Scheduler-CiB4b2Fn.js} +9 -9
- package/dist/{ServingSequence-BoaDRfsc.js → ServingSequence-BlcyW-dv.js} +18 -18
- package/dist/{Setting-BfFqBD9u.js → Setting-DqkL6YYU.js} +31 -31
- package/dist/{Subcategory-BsnC9ZSS.js → Subcategory-B4Jg_wtT.js} +43 -43
- package/dist/{Takeaway-PilRifJP.js → Takeaway-5G3f7jWT.js} +1 -1
- package/dist/{Takeaway-dSEAc70g.js → Takeaway-5rFPYYNA.js} +16 -16
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-CgioM0sV.js → Takeaway.vue_vue_type_script_setup_true_lang-CVsOhg_E.js} +23 -23
- package/dist/{TranslationFieldSection.vue_vue_type_script_setup_true_lang-CHf3g1ia.js → TranslationFieldSection.vue_vue_type_script_setup_true_lang-CPqxA6JD.js} +1 -1
- package/dist/{TranslationSideSheet.vue_vue_type_script_setup_true_lang-A43XxqyC.js → TranslationSideSheet.vue_vue_type_script_setup_true_lang-yrNuTD-3.js} +8 -9
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-T71R68sq.js +5836 -0
- package/dist/{Unit-DW1dFJas.js → Unit-CAkdmQLg.js} +2 -2
- package/dist/{Variant-CzLzrt2N.js → Variant-BbLQqbAK.js} +13 -13
- package/dist/{_id_-qfASfKMD.js → _id_-Dzacr40I.js} +13 -13
- package/dist/{app-BB33yKM6.js → app-4yWs09Fr.js} +495 -495
- package/dist/{app-CJnEQz-U.js → app-Deov1985.js} +3 -3
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/api/media.d.ts +161 -0
- package/dist/apps/mf-menu/src/app.d.ts +340 -0
- package/dist/apps/mf-menu/src/components/feature/CategoryManager/CategoriesSelector.vue.d.ts +1 -1
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/productImages.d.ts +150 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/image/CustomDimensionDialog.vue.d.ts +17 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/image/ImageUploadDialog.vue.d.ts +16 -1
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/image/ManageImageDrawer.vue.d.ts +42 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/image/ProductImageField.vue.d.ts +75 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/image/RegenerateImageDialog.vue.d.ts +17 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/item/ProductDetail.vue.d.ts +3 -6
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/store/menuV2.d.ts +1 -1
- package/dist/apps/mf-menu/src/composable/remyImageTarget.d.ts +5 -0
- package/dist/apps/mf-menu/src/helper/menu.d.ts +14 -1
- package/dist/apps/mf-menu/src/stores/menu.d.ts +1 -0
- package/dist/apps/mf-menu/src/types/rule.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/Catalog/Edit/AddProductPopup/Form.vue.d.ts +3 -2
- package/dist/apps/mf-menu/src/views/Catalog/Edit/AddProductPopup/ProductDetail.vue.d.ts +8 -8
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-VaVE9Pyh.js → linked-status-B2WLhKkV.js} +3 -3
- package/dist/assets/{menu-export-DD9Zt6XH.js → menu-export-Dcw5a_dN.js} +3 -3
- package/dist/assets/{override-menu-DZCgrhuF.js → override-menu-cBe2aMY6.js} +3 -3
- package/dist/assets/{validate-menu-BFsQlikL.js → validate-menu-BM-5GK85.js} +2 -2
- package/dist/{catalog-Cvn1ZMGp.js → catalog-DKygS2Cs.js} +6 -6
- package/dist/{catalogSetting-D2bOCGW7.js → catalogSetting-Bn2TplvM.js} +1 -1
- package/dist/currency-DXgNHtK8.js +7 -0
- package/dist/dayjs.min-DpX65tgj.js +7 -0
- package/dist/discardConfirm-DZwzKO-Q.js +3704 -0
- package/dist/{index-B2fxLO4K.js → index-B48KLyqg.js} +61 -61
- package/dist/{index-CizrxT_e.js → index-BEocaqRK.js} +30 -30
- package/dist/index-K-MBqJJo.js +222 -0
- package/dist/{index.vue_vue_type_script_setup_true_lang-gaRM4vfS.js → index.vue_vue_type_script_setup_true_lang-Nl505vPi.js} +44918 -51563
- package/dist/item-Da3ArD-G.js +13213 -0
- package/dist/{jszip.min-BXLegUsz.js → jszip.min-Cc2eR4Cq.js} +119 -119
- package/dist/linkProducts-GNuUxFEE.js +331 -0
- package/dist/{memberPricing-CizI1rUM.js → memberPricing-T-jr7tn1.js} +1 -1
- package/dist/{menu-BCed1YCE.js → menu-DSDRAil-.js} +1 -1
- package/dist/{menuV2-Bo9AHrdr.js → menuV2-fTlJdjxi.js} +162 -160
- package/dist/mf-menu.css +1 -1
- package/dist/{order_pacing-BkfQeNeC.js → order_pacing-Dgo1fySS.js} +17 -17
- package/dist/packages/shared/src/helpers/agentCode.d.ts +9 -0
- package/dist/{priceTier-rjuK-b6U.js → priceTier-aT_gIfrN.js} +3 -3
- package/dist/{rules-DHX_hK6G.js → rules-Cx2hkV20.js} +8 -8
- package/dist/{scheduler-BsfPbtM2.js → scheduler-Bd-q7yF8.js} +62 -62
- package/dist/{toExcel-DJHljg_L.js → toExcel-qfjR83qT.js} +2 -2
- package/dist/{unit-BxTWR1dZ.js → unit-n1T9grbM.js} +64 -64
- package/package.json +3 -3
- package/dist/Thumbnail.vue_vue_type_script_setup_true_lang-DGqao47l.js +0 -399
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DY1umres.js +0 -6058
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/thumbnailUpload.d.ts +0 -6
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/image/ImageUploadForm.vue.d.ts +0 -38
- package/dist/currency-DQDsuXB5.js +0 -7
- package/dist/dayjs.min-CzUkrXIR.js +0 -7
- package/dist/discardConfirm-BHni0LNu.js +0 -28
- package/dist/index-CisutoS9.js +0 -156
- package/dist/item-DOHVD6CN.js +0 -9098
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var ne = (e, t, n) =>
|
|
4
|
-
import {
|
|
5
|
-
import { defineStore as
|
|
6
|
-
import { shallowRef as
|
|
1
|
+
var Le = Object.defineProperty;
|
|
2
|
+
var We = (e, t, n) => t in e ? Le(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var ne = (e, t, n) => We(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { l as ae } from "./discardConfirm-DZwzKO-Q.js";
|
|
5
|
+
import { defineStore as qe } from "pinia";
|
|
6
|
+
import { shallowRef as N, ref as B, computed as S, shallowReactive as ze, effectScope as Be, watch as He } from "vue";
|
|
7
|
+
import { f as ue, d as C, m as T, k as ie, ag as re, g as H, L as x, c as W, s as D, U as oe, ah as Ge, ai as Je, a as Ye, N as Qe, aj as Xe, ak as Ze, J as et } from "./index.vue_vue_type_script_setup_true_lang-Nl505vPi.js";
|
|
7
8
|
import { useCoreStore as se } from "@feedmepos/mf-common";
|
|
8
9
|
import { useSnackbar as tt } from "@feedmepos/ui-library";
|
|
9
|
-
const nt = "/assets/linked-status-
|
|
10
|
+
const nt = "/assets/linked-status-B2WLhKkV.js", rt = "/assets/override-menu-cBe2aMY6.js";
|
|
10
11
|
function ot(e) {
|
|
11
12
|
var s;
|
|
12
13
|
const t = C(e), n = (s = t.variant) == null ? void 0 : s.variantCombinations;
|
|
13
|
-
return delete t.variant, delete t.thumbnail, [t, ...n || []];
|
|
14
|
+
return delete t.variant, delete t.thumbnail, delete t.images, [t, ...n || []];
|
|
14
15
|
}
|
|
15
16
|
function st(e, t, n, s) {
|
|
16
|
-
const o = C(t), u = n ? o.modules.catalog.find((f) => f._id === n) : null, l = s ? o.modules.scheduler.find((f) => f._id === s) : null, a = u ? C(u) : void 0, d = n ? o.modules.catalog.filter((f) => f._id !== n) : [], c = l ? C(l) : void 0,
|
|
17
|
+
const o = C(t), u = n ? o.modules.catalog.find((f) => f._id === n) : null, l = s ? o.modules.scheduler.find((f) => f._id === s) : null, a = u ? C(u) : void 0, d = n ? o.modules.catalog.filter((f) => f._id !== n) : [], c = l ? C(l) : void 0, g = e.reduce((f, v) => (f[v._id] = ot(v), f), {});
|
|
17
18
|
function y(f = []) {
|
|
18
|
-
const v = e.map((
|
|
19
|
+
const v = e.map((h) => h._id);
|
|
19
20
|
return [
|
|
20
|
-
...f.filter((
|
|
21
|
-
...Object.values(
|
|
21
|
+
...f.filter((h) => !v.includes(h._id)),
|
|
22
|
+
...Object.values(g).flatMap((h) => h)
|
|
22
23
|
];
|
|
23
24
|
}
|
|
24
25
|
return a && s ? (a.override.scheduler = {
|
|
@@ -28,12 +29,12 @@ function st(e, t, n, s) {
|
|
|
28
29
|
_id: s,
|
|
29
30
|
items: y(c == null ? void 0 : c.items).map((f) => ({
|
|
30
31
|
...f,
|
|
31
|
-
orderFrom:
|
|
32
|
+
orderFrom: ie.enum.ALL
|
|
32
33
|
}))
|
|
33
34
|
}
|
|
34
35
|
}, o.modules.catalog = [...d, a], o) : a ? (a.override.items = {
|
|
35
36
|
...a.override.items,
|
|
36
|
-
...
|
|
37
|
+
...g
|
|
37
38
|
}, o.modules.catalog = [...d, a], o) : c ? (c.items = y(c.items), o.modules.scheduler = [
|
|
38
39
|
...o.modules.scheduler.filter((f) => f._id !== s),
|
|
39
40
|
c
|
|
@@ -56,12 +57,12 @@ function F(e, t, n) {
|
|
|
56
57
|
if (!s)
|
|
57
58
|
throw new Error(`_insertItemOverriders - Item not found - ${e._id}`);
|
|
58
59
|
const o = (u = s.groups) == null ? void 0 : u.map((l) => {
|
|
59
|
-
var c,
|
|
60
|
+
var c, g, y;
|
|
60
61
|
const a = (c = e == null ? void 0 : e.groups) == null ? void 0 : c.find((f) => f._id === l._id);
|
|
61
62
|
let d;
|
|
62
|
-
return a ? d = ((
|
|
63
|
-
var
|
|
64
|
-
const v = (
|
|
63
|
+
return a ? d = ((g = l.items) == null ? void 0 : g.map((f) => {
|
|
64
|
+
var h;
|
|
65
|
+
const v = (h = a.items) == null ? void 0 : h.find(
|
|
65
66
|
(b) => b._id === f._id && b.combinationKey === f.combinationKey
|
|
66
67
|
);
|
|
67
68
|
return F(v || f, t, n + 1);
|
|
@@ -87,12 +88,12 @@ function at(e, t) {
|
|
|
87
88
|
);
|
|
88
89
|
if (c)
|
|
89
90
|
return F(c, t, 1);
|
|
90
|
-
const
|
|
91
|
+
const g = {
|
|
91
92
|
...T.generator.initMenuV4ItemOverrider(),
|
|
92
93
|
_id: d._id,
|
|
93
94
|
combinationKey: d.combinationKey
|
|
94
95
|
};
|
|
95
|
-
return F(
|
|
96
|
+
return F(g, t, 1);
|
|
96
97
|
});
|
|
97
98
|
return { ...u, items: a };
|
|
98
99
|
}), s = e.variant ? e.variant.variantCombinations.map((u) => F(u, t, 1)) : [], o = {
|
|
@@ -113,8 +114,8 @@ function G(e, t) {
|
|
|
113
114
|
var l, a;
|
|
114
115
|
const u = (l = t.groups) == null ? void 0 : l.find((d) => d._id === o._id);
|
|
115
116
|
return o.items = (a = o.items) == null ? void 0 : a.map((d) => {
|
|
116
|
-
var
|
|
117
|
-
const c = (
|
|
117
|
+
var g;
|
|
118
|
+
const c = (g = u == null ? void 0 : u.items) == null ? void 0 : g.find(
|
|
118
119
|
(y) => y._id === d._id && y.combinationKey === d.combinationKey
|
|
119
120
|
);
|
|
120
121
|
return G(d, c);
|
|
@@ -143,7 +144,7 @@ function ut(e, t) {
|
|
|
143
144
|
return o.items = (l = o.items) == null ? void 0 : l.map((a) => {
|
|
144
145
|
var c;
|
|
145
146
|
const d = (c = u == null ? void 0 : u.items) == null ? void 0 : c.find(
|
|
146
|
-
(
|
|
147
|
+
(g) => g._id === a._id && g.combinationKey === a.combinationKey
|
|
147
148
|
);
|
|
148
149
|
return G(a, d);
|
|
149
150
|
}), o;
|
|
@@ -152,11 +153,11 @@ function ut(e, t) {
|
|
|
152
153
|
price: (s == null ? void 0 : s.price) || t.price
|
|
153
154
|
};
|
|
154
155
|
}
|
|
155
|
-
async function
|
|
156
|
+
async function Dt(e, t, n, s, o, u = !0) {
|
|
156
157
|
const l = C(n), a = u ? st(t, l, s, o) : l, d = t.reduce((y, f) => (y[f._id] = a.modules.item.find((v) => v._id === f._id), y), {}), c = t.reduce((y, f) => {
|
|
157
158
|
const v = f._id;
|
|
158
159
|
return y[v] = at(d[v], e), y;
|
|
159
|
-
}, {}),
|
|
160
|
+
}, {}), g = T.getFallbackPrices({
|
|
160
161
|
rawMenu: a,
|
|
161
162
|
items: c,
|
|
162
163
|
catalogId: s || void 0,
|
|
@@ -165,69 +166,69 @@ async function Vt(e, t, n, s, o, u = !0) {
|
|
|
165
166
|
return t.map((y) => {
|
|
166
167
|
const f = y._id, v = d[f];
|
|
167
168
|
return {
|
|
168
|
-
...ut(
|
|
169
|
+
...ut(g, v),
|
|
169
170
|
category: s || o ? v == null ? void 0 : v.category : null
|
|
170
171
|
};
|
|
171
172
|
});
|
|
172
173
|
}
|
|
173
|
-
function
|
|
174
|
+
function Tt(e, t) {
|
|
174
175
|
if (e.length === 0) return "";
|
|
175
176
|
const n = e == null ? void 0 : e.split("variant");
|
|
176
177
|
return ((n == null ? void 0 : n.reduce((o, u) => {
|
|
177
178
|
if (u && u.length > 0) {
|
|
178
179
|
const l = `variant${u.split("/")[0]}`, a = u.split("/")[1], c = t.find(
|
|
179
|
-
({ _id:
|
|
180
|
-
).options.find(({ _id:
|
|
180
|
+
({ _id: g }) => g === l
|
|
181
|
+
).options.find(({ _id: g }) => g === a);
|
|
181
182
|
o.push(((c == null ? void 0 : c.name) || "").trim());
|
|
182
183
|
}
|
|
183
184
|
return o;
|
|
184
185
|
}, [])) || []).join(" / ");
|
|
185
186
|
}
|
|
186
|
-
const
|
|
187
|
-
async function
|
|
187
|
+
const q = /* @__PURE__ */ new Map();
|
|
188
|
+
async function Kt(e, t) {
|
|
188
189
|
const n = `${e._id}-${e.updatedAt}-${t}`;
|
|
189
|
-
if (
|
|
190
|
-
return
|
|
191
|
-
const s = await
|
|
190
|
+
if (q.has(n))
|
|
191
|
+
return q.get(n);
|
|
192
|
+
const s = await ue(
|
|
192
193
|
nt,
|
|
193
194
|
JSON.stringify({
|
|
194
195
|
menu: e,
|
|
195
196
|
itemId: t
|
|
196
197
|
})
|
|
197
198
|
);
|
|
198
|
-
return
|
|
199
|
+
return q.set(n, s), s;
|
|
199
200
|
}
|
|
200
201
|
async function ce(e, t, n) {
|
|
201
|
-
return await
|
|
202
|
+
return await ue(rt, {
|
|
202
203
|
menu: e,
|
|
203
204
|
catalogId: t,
|
|
204
205
|
schedulerId: n
|
|
205
206
|
});
|
|
206
207
|
}
|
|
207
|
-
const
|
|
208
|
+
const z = /* @__PURE__ */ new Map();
|
|
208
209
|
async function it(e, t, n) {
|
|
209
210
|
const s = `${e._id}-${e.updatedAt}-${t || "null"}-${n || "null"}`;
|
|
210
|
-
if (
|
|
211
|
-
return
|
|
211
|
+
if (z.has(s))
|
|
212
|
+
return z.get(s);
|
|
212
213
|
const o = await ce(e, t, n);
|
|
213
|
-
return
|
|
214
|
+
return z.set(s, o), o;
|
|
214
215
|
}
|
|
215
216
|
async function Pt(e, t, n) {
|
|
216
217
|
var l, a;
|
|
217
218
|
const s = await it(e, t, null), o = [], u = (d, c) => {
|
|
218
|
-
const
|
|
219
|
+
const g = C(d);
|
|
219
220
|
for (const y in c)
|
|
220
|
-
c[y] && (
|
|
221
|
-
return
|
|
221
|
+
c[y] && (g[y] = c[y]);
|
|
222
|
+
return g;
|
|
222
223
|
};
|
|
223
224
|
for (const d of s.modules.group) {
|
|
224
|
-
const c = (l = d.items) == null ? void 0 : l.find((y) => y._id === n && !y.combinationKey),
|
|
225
|
+
const c = (l = d.items) == null ? void 0 : l.find((y) => y._id === n && !y.combinationKey), g = e.modules.item.find((y) => y._id === n);
|
|
225
226
|
if (c) {
|
|
226
227
|
const y = (a = d.items) == null ? void 0 : a.filter((v) => v._id === n && v.combinationKey), f = [c, ...y].map((v) => {
|
|
227
228
|
var M, I;
|
|
228
|
-
const
|
|
229
|
-
(
|
|
230
|
-
) :
|
|
229
|
+
const h = v.combinationKey ? (I = (M = g == null ? void 0 : g.variant) == null ? void 0 : M.variantCombinations) == null ? void 0 : I.find(
|
|
230
|
+
(k) => k.combinationKey === v.combinationKey
|
|
231
|
+
) : g, b = h && g ? u(g, h) : v;
|
|
231
232
|
return u(b, v);
|
|
232
233
|
});
|
|
233
234
|
o.push({
|
|
@@ -238,7 +239,7 @@ async function Pt(e, t, n) {
|
|
|
238
239
|
}
|
|
239
240
|
return o;
|
|
240
241
|
}
|
|
241
|
-
const w = 0,
|
|
242
|
+
const w = 0, K = 3;
|
|
242
243
|
function ct(e) {
|
|
243
244
|
const t = /^\/(.*)\/([gimyu]*)$/.exec(e.toString());
|
|
244
245
|
if (!t)
|
|
@@ -264,10 +265,10 @@ function O(e) {
|
|
|
264
265
|
function $(e) {
|
|
265
266
|
return e instanceof RegExp ? e.toString() : e;
|
|
266
267
|
}
|
|
267
|
-
function
|
|
268
|
+
function E(e) {
|
|
268
269
|
return typeof e == "object" && e !== null && !Array.isArray(e) && !(e instanceof Date) && !(e instanceof RegExp);
|
|
269
270
|
}
|
|
270
|
-
function
|
|
271
|
+
function P(e, t) {
|
|
271
272
|
if (e === t) return !0;
|
|
272
273
|
if (typeof e != typeof t) return !1;
|
|
273
274
|
if (e instanceof Date && t instanceof Date)
|
|
@@ -277,14 +278,14 @@ function K(e, t) {
|
|
|
277
278
|
if (Array.isArray(e) && Array.isArray(t)) {
|
|
278
279
|
if (e.length !== t.length) return !1;
|
|
279
280
|
for (let n = 0; n < e.length; n++)
|
|
280
|
-
if (!
|
|
281
|
+
if (!P(e[n], t[n])) return !1;
|
|
281
282
|
return !0;
|
|
282
283
|
}
|
|
283
|
-
if (
|
|
284
|
+
if (E(e) && E(t)) {
|
|
284
285
|
const n = Object.keys(e), s = Object.keys(t);
|
|
285
286
|
if (n.length !== s.length) return !1;
|
|
286
287
|
for (const o of n)
|
|
287
|
-
if (!Object.prototype.hasOwnProperty.call(t, o) || !
|
|
288
|
+
if (!Object.prototype.hasOwnProperty.call(t, o) || !P(e[o], t[o])) return !1;
|
|
288
289
|
return !0;
|
|
289
290
|
}
|
|
290
291
|
return !1;
|
|
@@ -297,10 +298,10 @@ function lt(e, t, n) {
|
|
|
297
298
|
}
|
|
298
299
|
const l = [], a = /* @__PURE__ */ new Set();
|
|
299
300
|
for (let d = 0; d < s; d++) {
|
|
300
|
-
const c = e[d],
|
|
301
|
+
const c = e[d], g = n ? n(c) : JSON.stringify(c), y = u.get(g);
|
|
301
302
|
if (y) {
|
|
302
303
|
for (const f of y)
|
|
303
|
-
if (!a.has(f) &&
|
|
304
|
+
if (!a.has(f) && P(c, t[f])) {
|
|
304
305
|
l.push({ leftIndex: d, rightIndex: f }), a.add(f);
|
|
305
306
|
break;
|
|
306
307
|
}
|
|
@@ -310,59 +311,59 @@ function lt(e, t, n) {
|
|
|
310
311
|
}
|
|
311
312
|
function dt(e, t, n) {
|
|
312
313
|
var f, v;
|
|
313
|
-
if (
|
|
314
|
+
if (P(e, t)) return;
|
|
314
315
|
const s = { _t: "a" }, o = ((f = n == null ? void 0 : n.arrays) == null ? void 0 : f.detectMove) !== !1, u = ((v = n == null ? void 0 : n.arrays) == null ? void 0 : v.includeValueOnMove) === !0, l = n == null ? void 0 : n.objectHash;
|
|
315
316
|
let a = o ? lt(e, t, l) : [];
|
|
316
317
|
if (!l && e.length === t.length && e.length > 0 && a.length < e.length) {
|
|
317
|
-
const
|
|
318
|
-
if (
|
|
318
|
+
const h = E(e[0]) || Array.isArray(e[0]), b = a.length > 0;
|
|
319
|
+
if (h || b) {
|
|
319
320
|
a = [];
|
|
320
321
|
for (let M = 0; M < e.length; M++)
|
|
321
322
|
a.push({ leftIndex: M, rightIndex: M });
|
|
322
323
|
}
|
|
323
324
|
}
|
|
324
|
-
new Set(a.map((
|
|
325
|
-
const d = new Set(a.map((
|
|
326
|
-
for (const
|
|
327
|
-
c.set(
|
|
328
|
-
for (let
|
|
329
|
-
const b = c.get(
|
|
325
|
+
new Set(a.map((h) => h.leftIndex));
|
|
326
|
+
const d = new Set(a.map((h) => h.rightIndex)), c = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
|
|
327
|
+
for (const h of a)
|
|
328
|
+
c.set(h.leftIndex, h.rightIndex), g.set(h.rightIndex, h.leftIndex);
|
|
329
|
+
for (let h = 0; h < e.length; h++) {
|
|
330
|
+
const b = c.get(h);
|
|
330
331
|
if (b !== void 0) {
|
|
331
|
-
const M = J(e[
|
|
332
|
-
if (M !== void 0 && (s[b] = M), o && b !==
|
|
333
|
-
const I = `_${
|
|
334
|
-
s[I] =
|
|
332
|
+
const M = J(e[h], t[b], n);
|
|
333
|
+
if (M !== void 0 && (s[b] = M), o && b !== h) {
|
|
334
|
+
const I = `_${h}`, k = u ? [e[h], b, K] : ["", b, K];
|
|
335
|
+
s[I] = k;
|
|
335
336
|
}
|
|
336
337
|
} else {
|
|
337
|
-
const M = `_${
|
|
338
|
-
s[M] = [e[
|
|
338
|
+
const M = `_${h}`;
|
|
339
|
+
s[M] = [e[h], w, w];
|
|
339
340
|
}
|
|
340
341
|
}
|
|
341
|
-
for (let
|
|
342
|
-
d.has(
|
|
342
|
+
for (let h = 0; h < t.length; h++)
|
|
343
|
+
d.has(h) || (s[h] = [t[h]]);
|
|
343
344
|
const y = Object.keys(s);
|
|
344
345
|
if (!(y.length === 1 && y[0] === "_t"))
|
|
345
346
|
return s;
|
|
346
347
|
}
|
|
347
348
|
function mt(e, t, n) {
|
|
348
|
-
if (
|
|
349
|
+
if (P(e, t)) return;
|
|
349
350
|
const s = {}, o = Object.keys(e), u = Object.keys(t), l = /* @__PURE__ */ new Set([...o, ...u]);
|
|
350
351
|
for (const a of l) {
|
|
351
352
|
if (n != null && n.propertyFilter && !n.propertyFilter(a, { left: e, right: t }))
|
|
352
353
|
continue;
|
|
353
354
|
const d = Object.prototype.hasOwnProperty.call(e, a), c = Object.prototype.hasOwnProperty.call(t, a);
|
|
354
355
|
if (d && c) {
|
|
355
|
-
const
|
|
356
|
-
|
|
356
|
+
const g = J(e[a], t[a], n);
|
|
357
|
+
g !== void 0 && (s[a] = g);
|
|
357
358
|
} else if (d && !c) {
|
|
358
|
-
const
|
|
359
|
-
s[a] = [
|
|
359
|
+
const g = n != null && n.omitRemovedValues ? 0 : e[a];
|
|
360
|
+
s[a] = [g, w, w];
|
|
360
361
|
} else !d && c && (s[a] = [t[a]]);
|
|
361
362
|
}
|
|
362
363
|
return Object.keys(s).length > 0 ? s : void 0;
|
|
363
364
|
}
|
|
364
365
|
function J(e, t, n) {
|
|
365
|
-
if (
|
|
366
|
+
if (P(e, t)) return;
|
|
366
367
|
if (e === void 0 && t !== void 0) {
|
|
367
368
|
const a = n != null && n.cloneDiffValues ? O(t) : t;
|
|
368
369
|
return [$(a)];
|
|
@@ -373,7 +374,7 @@ function J(e, t, n) {
|
|
|
373
374
|
}
|
|
374
375
|
if (Array.isArray(e) && Array.isArray(t))
|
|
375
376
|
return dt(e, t, n);
|
|
376
|
-
if (
|
|
377
|
+
if (E(e) && E(t))
|
|
377
378
|
return mt(e, t, n);
|
|
378
379
|
const u = n != null && n.cloneDiffValues ? O(e) : e, l = n != null && n.cloneDiffValues ? O(t) : t;
|
|
379
380
|
return [$(u), $(l)];
|
|
@@ -386,7 +387,7 @@ function vt(e, t, n) {
|
|
|
386
387
|
for (const a in t) {
|
|
387
388
|
if (a === "_t" || !a.startsWith("_")) continue;
|
|
388
389
|
const d = parseInt(a.slice(1)), c = t[a];
|
|
389
|
-
Array.isArray(c) && (c.length === 3 && c[2] === w ? s.add(d) : c.length === 3 && c[2] ===
|
|
390
|
+
Array.isArray(c) && (c.length === 3 && c[2] === w ? s.add(d) : c.length === 3 && c[2] === K && o.set(d, c[1]));
|
|
390
391
|
}
|
|
391
392
|
const u = [];
|
|
392
393
|
let l = 0;
|
|
@@ -401,13 +402,13 @@ function vt(e, t, n) {
|
|
|
401
402
|
l < e.length && (u.push(Y(e[l], c)), l++);
|
|
402
403
|
}
|
|
403
404
|
else {
|
|
404
|
-
let
|
|
405
|
+
let g = !1;
|
|
405
406
|
for (const [y, f] of o.entries())
|
|
406
407
|
if (f === a) {
|
|
407
|
-
u.push(e[y]),
|
|
408
|
+
u.push(e[y]), g = !0;
|
|
408
409
|
break;
|
|
409
410
|
}
|
|
410
|
-
if (!
|
|
411
|
+
if (!g) {
|
|
411
412
|
for (; l < e.length && (s.has(l) || o.has(l)); )
|
|
412
413
|
l++;
|
|
413
414
|
if (l < e.length)
|
|
@@ -437,12 +438,12 @@ function Y(e, t, n) {
|
|
|
437
438
|
if (t.length === 3 && t[2] === w)
|
|
438
439
|
return;
|
|
439
440
|
}
|
|
440
|
-
return
|
|
441
|
+
return E(t) && t._t === "a" ? vt(e, t) : E(t) && E(e) ? yt(e, t) : e;
|
|
441
442
|
}
|
|
442
443
|
function le(e, t, n) {
|
|
443
444
|
return Y(e, t);
|
|
444
445
|
}
|
|
445
|
-
function
|
|
446
|
+
function gt(e) {
|
|
446
447
|
const t = { _t: "a" };
|
|
447
448
|
for (const n in e)
|
|
448
449
|
if (n !== "_t")
|
|
@@ -451,9 +452,9 @@ function ht(e) {
|
|
|
451
452
|
if (Array.isArray(o)) {
|
|
452
453
|
if (o.length === 3 && o[2] === w)
|
|
453
454
|
t[s] = [o[0]];
|
|
454
|
-
else if (o.length === 3 && o[2] ===
|
|
455
|
+
else if (o.length === 3 && o[2] === K) {
|
|
455
456
|
const u = o[1];
|
|
456
|
-
t[`_${u}`] = [o[0], s,
|
|
457
|
+
t[`_${u}`] = [o[0], s, K];
|
|
457
458
|
}
|
|
458
459
|
}
|
|
459
460
|
} else {
|
|
@@ -461,26 +462,26 @@ function ht(e) {
|
|
|
461
462
|
if (Array.isArray(o) && o.length === 1)
|
|
462
463
|
t[`_${s}`] = [o[0], w, w];
|
|
463
464
|
else {
|
|
464
|
-
const u =
|
|
465
|
+
const u = Q(o);
|
|
465
466
|
u !== void 0 && (t[n] = u);
|
|
466
467
|
}
|
|
467
468
|
}
|
|
468
469
|
return t;
|
|
469
470
|
}
|
|
470
|
-
function
|
|
471
|
+
function ht(e) {
|
|
471
472
|
const t = {};
|
|
472
473
|
for (const n in e) {
|
|
473
474
|
const s = e[n];
|
|
474
475
|
if (Array.isArray(s))
|
|
475
476
|
s.length === 1 ? t[n] = [s[0], w, w] : s.length === 3 && s[2] === w ? t[n] = [s[0]] : s.length === 2 && (t[n] = [s[1], s[0]]);
|
|
476
477
|
else {
|
|
477
|
-
const o =
|
|
478
|
+
const o = Q(s);
|
|
478
479
|
o !== void 0 && (t[n] = o);
|
|
479
480
|
}
|
|
480
481
|
}
|
|
481
482
|
return t;
|
|
482
483
|
}
|
|
483
|
-
function
|
|
484
|
+
function Q(e) {
|
|
484
485
|
if (e !== void 0) {
|
|
485
486
|
if (Array.isArray(e)) {
|
|
486
487
|
if (e.length === 1)
|
|
@@ -489,14 +490,14 @@ function Z(e) {
|
|
|
489
490
|
return [e[1], e[0]];
|
|
490
491
|
if (e.length === 3 && e[2] === w)
|
|
491
492
|
return [e[0]];
|
|
492
|
-
if (e.length === 3 && e[2] ===
|
|
493
|
+
if (e.length === 3 && e[2] === K)
|
|
493
494
|
return e;
|
|
494
495
|
}
|
|
495
|
-
return
|
|
496
|
+
return E(e) && e._t === "a" ? gt(e) : E(e) ? ht(e) : e;
|
|
496
497
|
}
|
|
497
498
|
}
|
|
498
499
|
function de(e) {
|
|
499
|
-
return
|
|
500
|
+
return Q(e);
|
|
500
501
|
}
|
|
501
502
|
function pt(e, t, n) {
|
|
502
503
|
const s = de(t);
|
|
@@ -536,14 +537,14 @@ function bt({
|
|
|
536
537
|
includeValueOnMove: !1
|
|
537
538
|
},
|
|
538
539
|
cloneDiffValues: !1
|
|
539
|
-
}), n =
|
|
540
|
+
}), n = N(null), s = N([]), o = B(-1), u = N(null), l = S(() => o.value > 0), a = S(() => o.value < s.value.length - 1);
|
|
540
541
|
function d(v) {
|
|
541
542
|
if (n.value === null) {
|
|
542
543
|
n.value = C(v), u.value = C(v), s.value = [{ delta: null }], o.value = 0;
|
|
543
544
|
return;
|
|
544
545
|
}
|
|
545
|
-
const
|
|
546
|
-
if (o.value < s.value.length - 1 && (s.value = s.value.slice(0, o.value + 1)), s.value.push({ delta:
|
|
546
|
+
const h = t.diff(u.value, v);
|
|
547
|
+
if (o.value < s.value.length - 1 && (s.value = s.value.slice(0, o.value + 1)), s.value.push({ delta: h }), o.value++, u.value = C(v), s.value.length > e) {
|
|
547
548
|
const b = s.value[1].delta;
|
|
548
549
|
b && n.value && (n.value = t.patch(C(n.value), b)), s.value.shift(), o.value--;
|
|
549
550
|
}
|
|
@@ -551,14 +552,14 @@ function bt({
|
|
|
551
552
|
function c(v) {
|
|
552
553
|
if (!n.value || v < 0 || v >= s.value.length)
|
|
553
554
|
return;
|
|
554
|
-
let
|
|
555
|
+
let h = C(n.value);
|
|
555
556
|
for (let b = 1; b <= v; b++) {
|
|
556
557
|
const M = s.value[b];
|
|
557
|
-
M.delta && (
|
|
558
|
+
M.delta && (h = t.patch(h, M.delta));
|
|
558
559
|
}
|
|
559
|
-
return
|
|
560
|
+
return h;
|
|
560
561
|
}
|
|
561
|
-
function
|
|
562
|
+
function g() {
|
|
562
563
|
if (l.value) {
|
|
563
564
|
o.value--;
|
|
564
565
|
const v = c(o.value);
|
|
@@ -579,7 +580,7 @@ function bt({
|
|
|
579
580
|
push: d,
|
|
580
581
|
canUndo: l,
|
|
581
582
|
canRedo: a,
|
|
582
|
-
undo:
|
|
583
|
+
undo: g,
|
|
583
584
|
redo: y,
|
|
584
585
|
clear: f
|
|
585
586
|
};
|
|
@@ -595,7 +596,7 @@ const Mt = {
|
|
|
595
596
|
modules: n.result || e.modules,
|
|
596
597
|
_rev: n.id ?? ""
|
|
597
598
|
};
|
|
598
|
-
return
|
|
599
|
+
return ae.cloneDeep({ menu: s, updateId: n.id ?? null });
|
|
599
600
|
}
|
|
600
601
|
};
|
|
601
602
|
function me() {
|
|
@@ -634,15 +635,15 @@ function wt() {
|
|
|
634
635
|
}
|
|
635
636
|
};
|
|
636
637
|
}
|
|
637
|
-
const
|
|
638
|
+
const $t = qe(
|
|
638
639
|
"mf-menu-store-v2",
|
|
639
640
|
() => {
|
|
640
|
-
const e =
|
|
641
|
+
const e = ze(wt()), t = se(), n = tt(), s = S(() => e.menu.modules.serveSequence ? x(e.menu.modules.serveSequence, {
|
|
641
642
|
selector: "position"
|
|
642
643
|
}) : []), o = S(() => {
|
|
643
644
|
var r;
|
|
644
|
-
return ((r = t.currentBusiness.value) == null ? void 0 : r.menuVersion) ||
|
|
645
|
-
}), u = S(() => o.value ===
|
|
645
|
+
return ((r = t.currentBusiness.value) == null ? void 0 : r.menuVersion) || W.F_MENU_VERSION.v3;
|
|
646
|
+
}), u = S(() => o.value === W.F_MENU_VERSION.v4), l = S(() => {
|
|
646
647
|
const r = e.menu.modules.catalog;
|
|
647
648
|
return x(r, { selector: "name" });
|
|
648
649
|
}), a = S(() => {
|
|
@@ -659,11 +660,11 @@ const Kt = Ze(
|
|
|
659
660
|
}), d = S(() => x(y.value.modules.scheduler, { selector: "name" })), c = S(() => e.menu.modules.scheduler.find(
|
|
660
661
|
(r) => r._id === e.currentSchedulerId
|
|
661
662
|
));
|
|
662
|
-
function
|
|
663
|
+
function g(r, i = !0) {
|
|
663
664
|
e.menu = { ...r, _rev: e.menu._rev }, i && V.push(e.menu);
|
|
664
665
|
}
|
|
665
|
-
const y =
|
|
666
|
-
async function
|
|
666
|
+
const y = N(me()), f = B(!1), v = B(1);
|
|
667
|
+
async function h() {
|
|
667
668
|
var m;
|
|
668
669
|
f.value = !0;
|
|
669
670
|
let r = e.menu.modules.catalog;
|
|
@@ -697,17 +698,17 @@ const Kt = Ze(
|
|
|
697
698
|
}
|
|
698
699
|
return y.value = i, f.value = !1, v.value = v.value + 1, i;
|
|
699
700
|
}
|
|
700
|
-
const M =
|
|
701
|
-
let I = null,
|
|
702
|
-
function
|
|
703
|
-
|
|
701
|
+
const M = ae.debounce(h, 200);
|
|
702
|
+
let I = null, k = null;
|
|
703
|
+
function X() {
|
|
704
|
+
k && (k(), k = null), I && I.stop(), I = Be(!0), k = I.run(() => He(
|
|
704
705
|
() => [e.menu, e.currentCatalogId, e.currentSchedulerId],
|
|
705
706
|
() => {
|
|
706
707
|
f.value || M();
|
|
707
708
|
}
|
|
708
709
|
)) || null;
|
|
709
710
|
}
|
|
710
|
-
|
|
711
|
+
X();
|
|
711
712
|
const fe = S(() => [
|
|
712
713
|
{
|
|
713
714
|
label: "Main",
|
|
@@ -717,7 +718,7 @@ const Kt = Ze(
|
|
|
717
718
|
label: r.name,
|
|
718
719
|
value: r._id
|
|
719
720
|
}))
|
|
720
|
-
]),
|
|
721
|
+
]), Z = S(() => {
|
|
721
722
|
const r = y.value.modules.category;
|
|
722
723
|
return [
|
|
723
724
|
...U.value.item.addon ? [
|
|
@@ -742,7 +743,7 @@ const Kt = Ze(
|
|
|
742
743
|
const _ = (A = m == null ? void 0 : m[p._id]) == null ? void 0 : A.find(
|
|
743
744
|
(R) => !R.combinationKey
|
|
744
745
|
);
|
|
745
|
-
return (_ == null ? void 0 : _.orderFrom) !==
|
|
746
|
+
return (_ == null ? void 0 : _.orderFrom) !== ie.enum.NONE;
|
|
746
747
|
});
|
|
747
748
|
}
|
|
748
749
|
return D(r, (m) => m.code || m.name);
|
|
@@ -755,7 +756,7 @@ const Kt = Ze(
|
|
|
755
756
|
m,
|
|
756
757
|
(p) => p.code || p.name
|
|
757
758
|
).reduce((p, _, A) => (p[_._id] = A + i[_.category || ""], p), {});
|
|
758
|
-
}),
|
|
759
|
+
}), ge = S(() => oe(j.value, Z.value, ee.value)), he = S(() => {
|
|
759
760
|
const r = U.value.item.addon ? [
|
|
760
761
|
{
|
|
761
762
|
_id: e.currentCatalogId ? "" : null,
|
|
@@ -769,20 +770,20 @@ const Kt = Ze(
|
|
|
769
770
|
r,
|
|
770
771
|
e.menu.modules.item
|
|
771
772
|
);
|
|
772
|
-
}),
|
|
773
|
+
}), j = S(() => {
|
|
773
774
|
const r = y.value.modules.variant;
|
|
774
775
|
return x(r, { selector: "name" });
|
|
775
776
|
});
|
|
776
777
|
function pe(r = []) {
|
|
777
|
-
const i = r.map((p) =>
|
|
778
|
+
const i = r.map((p) => j.value.find((_) => _._id === p)).filter((p) => !!p);
|
|
778
779
|
return T.fullVariantCombination(i).reduce((p, _) => (p[_.combinationKey] = _.selectionName.join(" / "), p), {});
|
|
779
780
|
}
|
|
780
781
|
const _e = S(() => D(y.value.modules.group, (r) => r.name)), Se = S(() => x(y.value.modules.takeaway, { selector: "name" })), be = S(() => x(e.menu.modules.printDepartment || [], {
|
|
781
782
|
selector: "name"
|
|
782
|
-
})), Me = S(() => x(e.menu.modules.unit, { selector: "name" })), we = S(() => x(
|
|
783
|
+
})), Me = S(() => x(e.menu.modules.unit, { selector: "name" })), we = S(() => x(Ge(e.menu.modules.recipe, e.menu.modules.sku), {
|
|
783
784
|
selector: "name"
|
|
784
785
|
})), Ae = S(() => e.menu.modules.cookingGuide), Ce = S(() => {
|
|
785
|
-
const r =
|
|
786
|
+
const r = Je(e.menu.modules.sku);
|
|
786
787
|
return x(r, { selector: "code" });
|
|
787
788
|
}), Ie = S(() => {
|
|
788
789
|
const r = /* @__PURE__ */ new Map();
|
|
@@ -793,7 +794,7 @@ const Kt = Ze(
|
|
|
793
794
|
});
|
|
794
795
|
}), r;
|
|
795
796
|
}), U = S(() => {
|
|
796
|
-
const r = !e.currentCatalogId, i = o.value ===
|
|
797
|
+
const r = !e.currentCatalogId, i = o.value === W.F_MENU_VERSION.v4, m = !e.currentSchedulerId, p = {
|
|
797
798
|
create: r && m,
|
|
798
799
|
edit: r && m,
|
|
799
800
|
delete: r && m
|
|
@@ -809,6 +810,7 @@ const Kt = Ze(
|
|
|
809
810
|
description: r && m,
|
|
810
811
|
category: m,
|
|
811
812
|
thumbnail: r && m,
|
|
813
|
+
images: r && m,
|
|
812
814
|
orderFrom: (i || r) && m,
|
|
813
815
|
orderFromNone: r,
|
|
814
816
|
orderFromActiveOnly: !i,
|
|
@@ -865,23 +867,23 @@ const Kt = Ze(
|
|
|
865
867
|
}
|
|
866
868
|
};
|
|
867
869
|
});
|
|
868
|
-
function
|
|
870
|
+
function L(r) {
|
|
869
871
|
return `${r.systemCode}/${r.taxCode}`;
|
|
870
872
|
}
|
|
871
|
-
function
|
|
873
|
+
function ke(r) {
|
|
872
874
|
const [i, m] = r.split("/");
|
|
873
875
|
return { systemCode: i, taxCode: m };
|
|
874
876
|
}
|
|
875
|
-
function
|
|
876
|
-
return (r ?? i ?? []).map((p) =>
|
|
877
|
+
function Ee(r, i, m) {
|
|
878
|
+
return (r ?? i ?? []).map((p) => L(p)).find((p) => m.some((_) => _.value === p));
|
|
877
879
|
}
|
|
878
880
|
const Re = S(() => {
|
|
879
881
|
var p;
|
|
880
|
-
const r = ["SV5", "SV10"], i =
|
|
882
|
+
const r = ["SV5", "SV10"], i = Ye.Country.getCountryFlattenTaxes(
|
|
881
883
|
se().currentCountry.value
|
|
882
884
|
), m = i.filter((_) => u.value || !r.includes(_.taxCode)).map((_) => ({
|
|
883
|
-
label: `${_.name} (${
|
|
884
|
-
value:
|
|
885
|
+
label: `${_.name} (${Qe(_.rate)}%)`,
|
|
886
|
+
value: L(_),
|
|
885
887
|
meta: {
|
|
886
888
|
rate: _.rate
|
|
887
889
|
}
|
|
@@ -891,14 +893,14 @@ const Kt = Ze(
|
|
|
891
893
|
countryTaxOptions: m
|
|
892
894
|
};
|
|
893
895
|
}), xe = async () => {
|
|
894
|
-
const r = await
|
|
896
|
+
const r = await et.readMenu();
|
|
895
897
|
e.menu = r ?? e.menu, te(null);
|
|
896
898
|
}, Oe = async () => {
|
|
897
899
|
if (t.isRestaurantLevelMenu.value) {
|
|
898
900
|
e.restaurants = [];
|
|
899
901
|
return;
|
|
900
902
|
}
|
|
901
|
-
const { fetchAllRestaurants: r } =
|
|
903
|
+
const { fetchAllRestaurants: r } = Ze();
|
|
902
904
|
await r({
|
|
903
905
|
onBatchEnd: (i) => {
|
|
904
906
|
e.restaurants = i;
|
|
@@ -912,7 +914,7 @@ const Kt = Ze(
|
|
|
912
914
|
e.currentCategoryIds = r;
|
|
913
915
|
}, Te = (r) => {
|
|
914
916
|
e.currentRestaurantAttrParams = r;
|
|
915
|
-
},
|
|
917
|
+
}, Ke = async (r, i) => {
|
|
916
918
|
const m = Array.isArray(r) ? r : [r];
|
|
917
919
|
if (!m.length) return;
|
|
918
920
|
const p = m.map((_) => ({
|
|
@@ -924,11 +926,11 @@ const Kt = Ze(
|
|
|
924
926
|
if (i || p.some(
|
|
925
927
|
(A) => [H.F_OPERATION_TYPE.delete, H.F_OPERATION_TYPE.deleteMany].includes(A.operation)
|
|
926
928
|
)) {
|
|
927
|
-
const A = await
|
|
929
|
+
const A = await Xe(p, e.menu.modules);
|
|
928
930
|
if (A !== !0) throw new Error(A);
|
|
929
931
|
}
|
|
930
932
|
const _ = await Mt.updateMenuModule(e.menu, p);
|
|
931
|
-
return
|
|
933
|
+
return g(_.menu), _;
|
|
932
934
|
} catch (_) {
|
|
933
935
|
n.open({
|
|
934
936
|
type: "error",
|
|
@@ -936,20 +938,20 @@ const Kt = Ze(
|
|
|
936
938
|
message: _
|
|
937
939
|
});
|
|
938
940
|
}
|
|
939
|
-
},
|
|
941
|
+
}, Pe = async (r) => {
|
|
940
942
|
const i = {
|
|
941
943
|
...e.menu,
|
|
942
944
|
masterCatalogSetting: r.masterCatalogSetting,
|
|
943
945
|
lowStockThreshold: r.lowStockThreshold,
|
|
944
946
|
priceTierSettings: r.priceTierSettings
|
|
945
947
|
};
|
|
946
|
-
return
|
|
947
|
-
}, V = bt({ maxHistorySize: 50 }), $e = S(() => V.canUndo.value), Fe = S(() => V.canRedo.value),
|
|
948
|
+
return g(i), i;
|
|
949
|
+
}, V = bt({ maxHistorySize: 50 }), $e = S(() => V.canUndo.value), Fe = S(() => V.canRedo.value), Ne = () => {
|
|
948
950
|
const r = V.undo();
|
|
949
|
-
r &&
|
|
950
|
-
},
|
|
951
|
+
r && g(r, !1);
|
|
952
|
+
}, je = () => {
|
|
951
953
|
const r = V.redo();
|
|
952
|
-
r &&
|
|
954
|
+
r && g(r, !1);
|
|
953
955
|
}, Ue = () => {
|
|
954
956
|
V.clear();
|
|
955
957
|
};
|
|
@@ -969,14 +971,14 @@ const Kt = Ze(
|
|
|
969
971
|
schedulers: d,
|
|
970
972
|
currentScheduler: c,
|
|
971
973
|
catalogOptions: fe,
|
|
972
|
-
categories:
|
|
974
|
+
categories: Z,
|
|
973
975
|
subcategories: ve,
|
|
974
976
|
items: ee,
|
|
975
977
|
sortedItems: ye,
|
|
976
978
|
itemCodeMap: Ie,
|
|
977
|
-
categorizedItems:
|
|
978
|
-
categorizedRawMenuItems:
|
|
979
|
-
variants:
|
|
979
|
+
categorizedItems: ge,
|
|
980
|
+
categorizedRawMenuItems: he,
|
|
981
|
+
variants: j,
|
|
980
982
|
groups: _e,
|
|
981
983
|
takeaways: Se,
|
|
982
984
|
printDepartments: be,
|
|
@@ -987,41 +989,41 @@ const Kt = Ze(
|
|
|
987
989
|
rules: U,
|
|
988
990
|
taxSetting: Re,
|
|
989
991
|
// Action
|
|
990
|
-
setMenu:
|
|
992
|
+
setMenu: g,
|
|
991
993
|
readMenu: xe,
|
|
992
994
|
readRestaurants: Oe,
|
|
993
995
|
selectCatalog: te,
|
|
994
996
|
selectScheduler: Ve,
|
|
995
997
|
selectCategory: De,
|
|
996
998
|
setRestaurantAttrParams: Te,
|
|
997
|
-
updateMenu:
|
|
998
|
-
updateMenuSetting:
|
|
999
|
-
computeMergedMenu:
|
|
999
|
+
updateMenu: Ke,
|
|
1000
|
+
updateMenuSetting: Pe,
|
|
1001
|
+
computeMergedMenu: h,
|
|
1000
1002
|
// helper
|
|
1001
|
-
encodeTax:
|
|
1002
|
-
decodeTax:
|
|
1003
|
-
getSelectedTax:
|
|
1003
|
+
encodeTax: L,
|
|
1004
|
+
decodeTax: ke,
|
|
1005
|
+
getSelectedTax: Ee,
|
|
1004
1006
|
mapVariant: pe,
|
|
1005
1007
|
// history
|
|
1006
1008
|
canUndoHistory: $e,
|
|
1007
1009
|
canRedoHistory: Fe,
|
|
1008
|
-
undoHistory:
|
|
1009
|
-
redoHistory:
|
|
1010
|
+
undoHistory: Ne,
|
|
1011
|
+
redoHistory: je,
|
|
1010
1012
|
// cleanup
|
|
1011
1013
|
$dispose: () => {
|
|
1012
|
-
M.cancel(),
|
|
1014
|
+
M.cancel(), k && (k(), k = null), I && (I.stop(), I = null), Ue();
|
|
1013
1015
|
},
|
|
1014
1016
|
$reinitialize: () => {
|
|
1015
|
-
|
|
1017
|
+
X();
|
|
1016
1018
|
}
|
|
1017
1019
|
};
|
|
1018
1020
|
}
|
|
1019
1021
|
);
|
|
1020
1022
|
export {
|
|
1021
|
-
|
|
1023
|
+
Kt as a,
|
|
1022
1024
|
Pt as f,
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
+
Tt as g,
|
|
1026
|
+
Dt as m,
|
|
1025
1027
|
it as o,
|
|
1026
|
-
|
|
1028
|
+
$t as u
|
|
1027
1029
|
};
|