@feedmepos/mf-menu 0.32.63-dev.1 → 0.32.63-dev.3
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-DhfTGlgM.js → App-DHxlR--3.js} +6 -6
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-C5-8qdJK.js → ApplyProduct.vue_vue_type_script_setup_true_lang-6noIwjis.js} +3 -3
- package/dist/{ApplyProductDialog.vue_vue_type_script_setup_true_lang-CXm-0H18.js → ApplyProductDialog.vue_vue_type_script_setup_true_lang-CMI2Nh0n.js} +3 -3
- package/dist/{Catalog-WuZJfM6l.js → Catalog-B-S0gygH.js} +22 -22
- package/dist/{Category-BeIo7XWY.js → Category-DGDddfLx.js} +4 -4
- package/dist/{Category-D-cQQCPS.js → Category-DOhNama9.js} +4 -4
- package/dist/{CookingGuide-B-yvD9ZA.js → CookingGuide-CUR57F4P.js} +29 -29
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-2_yzXoa4.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-bIONGM6k.js} +1 -1
- package/dist/{Group-CY8lUzQG.js → Group-BsGJ0omP.js} +1 -1
- package/dist/{Group-13i5igrS.js → Group-z-0jQPCd.js} +3 -3
- package/dist/{Group.vue_vue_type_script_setup_true_lang-DZhxy0tb.js → Group.vue_vue_type_script_setup_true_lang-bBWkJ2Hx.js} +7 -7
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-CWqv-oUd.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BbqcH4sM.js} +19 -19
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-DTs4Vpdi.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-CVGilzd0.js} +4210 -4210
- package/dist/{Ingredient-vrUOW6gk.js → Ingredient-D38IVDXK.js} +4 -4
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-xcVjRjqD.js → InventoryBinding.vue_vue_type_script_setup_true_lang-CKmyz9CP.js} +2 -2
- package/dist/{LinkProductSideSheet-DMbJG6wf.js → LinkProductSideSheet-DsBA_o9g.js} +4 -4
- package/dist/{MenuSetting-Di2xwm00.js → MenuSetting-D-tln58o.js} +7 -7
- package/dist/{OrderPacing-CCe-IcGO.js → OrderPacing-BdCEHKD9.js} +7 -7
- package/dist/{PrintRoute-CcfObcHY.js → PrintRoute-DKFMqyeI.js} +10 -10
- package/dist/{Product-ChUVnMgG.js → Product-Dzo4ljes.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-C9Qp50hL.js → Product.vue_vue_type_script_setup_true_lang-BtE2aiwU.js} +58 -58
- package/dist/{ProductInternalTools-D9HXhgo5.js → ProductInternalTools-Z6XR4zko.js} +14 -14
- package/dist/{Products-Bly2ktEC.js → Products-CCo675Ee.js} +63 -63
- package/dist/{Publish-C8ubb8Qf.js → Publish-tixV8Of1.js} +107 -107
- package/dist/{Recipe-BpMRLsyO.js → Recipe-V9kzxmlf.js} +5 -5
- package/dist/{RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-BD5OCDRn.js → RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-DBhAzVz3.js} +1 -1
- package/dist/{RuleView.vue_vue_type_script_setup_true_lang-Ba3djmX1.js → RuleView.vue_vue_type_script_setup_true_lang-D9DqmAVY.js} +3 -3
- package/dist/{Scheduler-CiB4b2Fn.js → Scheduler-0UpDGQKJ.js} +17 -17
- package/dist/{ServingSequence-BlcyW-dv.js → ServingSequence-CutiXht7.js} +3 -3
- package/dist/{Setting-DqkL6YYU.js → Setting-jyYmoDiq.js} +5 -5
- package/dist/{Subcategory-B4Jg_wtT.js → Subcategory-CQSKOLjU.js} +10 -10
- package/dist/{Takeaway-5G3f7jWT.js → Takeaway-CQ0m09TB.js} +1 -1
- package/dist/{Takeaway-5rFPYYNA.js → Takeaway-DeCthkOI.js} +4 -4
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-CVsOhg_E.js → Takeaway.vue_vue_type_script_setup_true_lang-FHE6oQ0d.js} +7 -7
- package/dist/{TranslationFieldSection.vue_vue_type_script_setup_true_lang-CPqxA6JD.js → TranslationFieldSection.vue_vue_type_script_setup_true_lang-D9Ga3fOj.js} +1 -1
- package/dist/{TranslationSideSheet.vue_vue_type_script_setup_true_lang-yrNuTD-3.js → TranslationSideSheet.vue_vue_type_script_setup_true_lang-Bz32rpvX.js} +2 -2
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DCPGAyOm.js +5858 -0
- package/dist/{Unit-CAkdmQLg.js → Unit-_XiPfauV.js} +2 -2
- package/dist/{Variant-BbLQqbAK.js → Variant-DfdMywhn.js} +6 -6
- package/dist/{_id_-Dzacr40I.js → _id_-Yj5av4B4.js} +12 -12
- package/dist/{app-4yWs09Fr.js → app-BcGgfvbE.js} +102 -102
- package/dist/{app-Deov1985.js → app-CqdVluGs.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/api/media.d.ts +10 -3
- package/dist/apps/mf-menu/src/app.d.ts +60 -10
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/productImages.d.ts +67 -21
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/image/ManageImageDrawer.vue.d.ts +33 -3
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/image/ProductImageField.vue.d.ts +31 -1
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/image/RegenerateImageDialog.vue.d.ts +10 -0
- package/dist/apps/mf-menu/src/helper/menuImport.d.ts +22 -0
- package/dist/apps/mf-menu/src/manager/menu/itemOverrider.d.ts +17 -0
- package/dist/apps/mf-menu/src/stores/manager/item.d.ts +0 -1
- package/dist/apps/mf-menu/src/views/Catalog/Edit/AddProductPopup/ProductDetail.vue.d.ts +9 -3
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-B2WLhKkV.js → linked-status-DdDQXL8Y.js} +3 -3
- package/dist/assets/{menu-export-Dcw5a_dN.js → menu-export-CK5bJyLT.js} +4 -4
- package/dist/assets/{override-menu-cBe2aMY6.js → override-menu-CHL7Bynw.js} +3 -3
- package/dist/assets/{validate-menu-BM-5GK85.js → validate-menu-g2fslPcE.js} +2 -2
- package/dist/{catalog-DKygS2Cs.js → catalog-B_yk-l1-.js} +1 -1
- package/dist/{catalogSetting-Bn2TplvM.js → catalogSetting-Dl7uIiJm.js} +1 -1
- package/dist/{currency-DXgNHtK8.js → currency-BpjSDqef.js} +1 -1
- package/dist/dayjs.min-CVH5LqOA.js +7 -0
- package/dist/{discardConfirm-DZwzKO-Q.js → discardConfirm-fCmrAVO1.js} +1 -1
- package/dist/{index-K-MBqJJo.js → index-CD_omf3p.js} +1 -1
- package/dist/{index-B48KLyqg.js → index-Cru6sUb6.js} +5 -5
- package/dist/{index-BEocaqRK.js → index-LYc0WKDO.js} +6 -6
- package/dist/{index.vue_vue_type_script_setup_true_lang-Nl505vPi.js → index.vue_vue_type_script_setup_true_lang-qgDBinUn.js} +7932 -7868
- package/dist/{item-Da3ArD-G.js → item-EPxRgVm0.js} +4904 -4654
- package/dist/{jszip.min-Cc2eR4Cq.js → jszip.min-CNgWv4I3.js} +52 -52
- package/dist/{linkProducts-GNuUxFEE.js → linkProducts-DvQ0oP1V.js} +6 -6
- package/dist/{memberPricing-T-jr7tn1.js → memberPricing-deWSH2K0.js} +1 -1
- package/dist/{menu-DSDRAil-.js → menu-DKJ7olgK.js} +1 -1
- package/dist/{menuV2-fTlJdjxi.js → menuV2-CB3eZiiP.js} +318 -313
- package/dist/mf-menu.css +1 -1
- package/dist/{order_pacing-Dgo1fySS.js → order_pacing-DvP19Nxa.js} +5 -5
- package/dist/{priceTier-aT_gIfrN.js → priceTier-DyxDcoSh.js} +1 -1
- package/dist/{rules-Cx2hkV20.js → rules-GmuBnHtU.js} +3 -3
- package/dist/{scheduler-Bd-q7yF8.js → scheduler-BWAzMbPl.js} +28 -28
- package/dist/{toExcel-qfjR83qT.js → toExcel-BMOGsD6n.js} +2 -2
- package/dist/{unit-n1T9grbM.js → unit-BCREKGn9.js} +24 -24
- package/package.json +1 -1
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-T71R68sq.js +0 -5836
- package/dist/dayjs.min-DpX65tgj.js +0 -7
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
var Le = Object.defineProperty;
|
|
2
2
|
var We = (e, t, n) => t in e ? Le(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var ne = (e, t, n) => We(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { l as ae } from "./discardConfirm-
|
|
4
|
+
import { l as ae } from "./discardConfirm-fCmrAVO1.js";
|
|
5
5
|
import { defineStore as qe } from "pinia";
|
|
6
|
-
import { shallowRef as
|
|
7
|
-
import {
|
|
6
|
+
import { shallowRef as j, ref as H, computed as S, shallowReactive as ze, effectScope as He, watch as Be } from "vue";
|
|
7
|
+
import { d as C, f as ue, m as T, k as ie, aj as re, g as B, O as x, c as W, s as V, X as oe, ak as Ge, al as Je, a as Ye, Q as Qe, am as Xe, an as Ze, M as et } from "./index.vue_vue_type_script_setup_true_lang-qgDBinUn.js";
|
|
8
8
|
import { useCoreStore as se } from "@feedmepos/mf-common";
|
|
9
9
|
import { useSnackbar as tt } from "@feedmepos/ui-library";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var s;
|
|
10
|
+
function nt(e) {
|
|
11
|
+
var s, r, u;
|
|
13
12
|
const t = C(e), n = (s = t.variant) == null ? void 0 : s.variantCombinations;
|
|
13
|
+
if (t.images !== void 0) {
|
|
14
|
+
const c = ((r = t.images) == null ? void 0 : r.find((a) => a.isDefault)) ?? ((u = t.images) == null ? void 0 : u[0]);
|
|
15
|
+
t.image = (c == null ? void 0 : c._id) ?? null;
|
|
16
|
+
}
|
|
14
17
|
return delete t.variant, delete t.thumbnail, delete t.images, [t, ...n || []];
|
|
15
18
|
}
|
|
19
|
+
const rt = "/assets/linked-status-DdDQXL8Y.js", ot = "/assets/override-menu-CHL7Bynw.js";
|
|
16
20
|
function st(e, t, n, s) {
|
|
17
|
-
const
|
|
21
|
+
const r = C(t), u = n ? r.modules.catalog.find((f) => f._id === n) : null, c = s ? r.modules.scheduler.find((f) => f._id === s) : null, a = u ? C(u) : void 0, d = n ? r.modules.catalog.filter((f) => f._id !== n) : [], l = c ? C(c) : void 0, g = e.reduce((f, v) => (f[v._id] = nt(v), f), {});
|
|
18
22
|
function y(f = []) {
|
|
19
|
-
const v = e.map((
|
|
23
|
+
const v = e.map((p) => p._id);
|
|
20
24
|
return [
|
|
21
|
-
...f.filter((
|
|
22
|
-
...Object.values(g).flatMap((
|
|
25
|
+
...f.filter((p) => !v.includes(p._id)),
|
|
26
|
+
...Object.values(g).flatMap((p) => p)
|
|
23
27
|
];
|
|
24
28
|
}
|
|
25
29
|
return a && s ? (a.override.scheduler = {
|
|
@@ -27,47 +31,47 @@ function st(e, t, n, s) {
|
|
|
27
31
|
[s]: {
|
|
28
32
|
...a.override.scheduler[s],
|
|
29
33
|
_id: s,
|
|
30
|
-
items: y(
|
|
34
|
+
items: y(l == null ? void 0 : l.items).map((f) => ({
|
|
31
35
|
...f,
|
|
32
36
|
orderFrom: ie.enum.ALL
|
|
33
37
|
}))
|
|
34
38
|
}
|
|
35
|
-
},
|
|
39
|
+
}, r.modules.catalog = [...d, a], r) : a ? (a.override.items = {
|
|
36
40
|
...a.override.items,
|
|
37
41
|
...g
|
|
38
|
-
},
|
|
39
|
-
...
|
|
40
|
-
|
|
41
|
-
],
|
|
42
|
+
}, r.modules.catalog = [...d, a], r) : l ? (l.items = y(l.items), r.modules.scheduler = [
|
|
43
|
+
...r.modules.scheduler.filter((f) => f._id !== s),
|
|
44
|
+
l
|
|
45
|
+
], r) : {
|
|
42
46
|
...re(),
|
|
43
47
|
modules: {
|
|
44
48
|
...re().modules,
|
|
45
|
-
catalog:
|
|
46
|
-
item:
|
|
47
|
-
group:
|
|
48
|
-
scheduler:
|
|
49
|
+
catalog: r.modules.catalog,
|
|
50
|
+
item: r.modules.item,
|
|
51
|
+
group: r.modules.group,
|
|
52
|
+
scheduler: r.modules.scheduler
|
|
49
53
|
},
|
|
50
|
-
_id:
|
|
54
|
+
_id: r._id
|
|
51
55
|
};
|
|
52
56
|
}
|
|
53
57
|
function F(e, t, n) {
|
|
54
58
|
var u;
|
|
55
59
|
if (n >= 3) return e;
|
|
56
|
-
const s = t.modules.item.find((
|
|
60
|
+
const s = t.modules.item.find((c) => c._id === e._id);
|
|
57
61
|
if (!s)
|
|
58
62
|
throw new Error(`_insertItemOverriders - Item not found - ${e._id}`);
|
|
59
|
-
const
|
|
60
|
-
var
|
|
61
|
-
const a = (
|
|
63
|
+
const r = (u = s.groups) == null ? void 0 : u.map((c) => {
|
|
64
|
+
var l, g, y;
|
|
65
|
+
const a = (l = e == null ? void 0 : e.groups) == null ? void 0 : l.find((f) => f._id === c._id);
|
|
62
66
|
let d;
|
|
63
|
-
return a ? d = ((g =
|
|
64
|
-
var
|
|
65
|
-
const v = (
|
|
67
|
+
return a ? d = ((g = c.items) == null ? void 0 : g.map((f) => {
|
|
68
|
+
var p;
|
|
69
|
+
const v = (p = a.items) == null ? void 0 : p.find(
|
|
66
70
|
(b) => b._id === f._id && b.combinationKey === f.combinationKey
|
|
67
71
|
);
|
|
68
72
|
return F(v || f, t, n + 1);
|
|
69
|
-
})) ?? [] : d = ((y =
|
|
70
|
-
...
|
|
73
|
+
})) ?? [] : d = ((y = c.items) == null ? void 0 : y.map((f) => F(f, t, n + 1))) ?? [], {
|
|
74
|
+
...c,
|
|
71
75
|
items: d
|
|
72
76
|
};
|
|
73
77
|
});
|
|
@@ -76,18 +80,18 @@ function F(e, t, n) {
|
|
|
76
80
|
name: e.name || s.name,
|
|
77
81
|
code: e.code || s.code,
|
|
78
82
|
combinationKey: e.combinationKey,
|
|
79
|
-
groups:
|
|
83
|
+
groups: r
|
|
80
84
|
};
|
|
81
85
|
}
|
|
82
86
|
function at(e, t) {
|
|
83
87
|
const n = e.groups.map((u) => {
|
|
84
|
-
const
|
|
88
|
+
const c = t.modules.group.find((d) => d._id === u._id), a = ((c == null ? void 0 : c.items) || []).map((d) => {
|
|
85
89
|
var y;
|
|
86
|
-
const
|
|
90
|
+
const l = (y = u.items) == null ? void 0 : y.find(
|
|
87
91
|
(f) => f._id === d._id && f.combinationKey === d.combinationKey
|
|
88
92
|
);
|
|
89
|
-
if (
|
|
90
|
-
return F(
|
|
93
|
+
if (l)
|
|
94
|
+
return F(l, t, 1);
|
|
91
95
|
const g = {
|
|
92
96
|
...T.generator.initMenuV4ItemOverrider(),
|
|
93
97
|
_id: d._id,
|
|
@@ -96,92 +100,92 @@ function at(e, t) {
|
|
|
96
100
|
return F(g, t, 1);
|
|
97
101
|
});
|
|
98
102
|
return { ...u, items: a };
|
|
99
|
-
}), s = e.variant ? e.variant.variantCombinations.map((u) => F(u, t, 1)) : [],
|
|
103
|
+
}), s = e.variant ? e.variant.variantCombinations.map((u) => F(u, t, 1)) : [], r = {
|
|
100
104
|
...T.generator.initMenuV4ItemOverrider(),
|
|
101
105
|
_id: e._id,
|
|
102
106
|
name: e.name,
|
|
103
107
|
code: e.code,
|
|
104
108
|
groups: n
|
|
105
109
|
};
|
|
106
|
-
return [...s,
|
|
110
|
+
return [...s, r];
|
|
107
111
|
}
|
|
108
112
|
function G(e, t) {
|
|
109
113
|
var s;
|
|
110
114
|
if (!t)
|
|
111
115
|
return e;
|
|
112
116
|
const n = { ...e, code: t.code };
|
|
113
|
-
return n.groups = (s = n.groups) == null ? void 0 : s.map((
|
|
114
|
-
var
|
|
115
|
-
const u = (
|
|
116
|
-
return
|
|
117
|
+
return n.groups = (s = n.groups) == null ? void 0 : s.map((r) => {
|
|
118
|
+
var c, a;
|
|
119
|
+
const u = (c = t.groups) == null ? void 0 : c.find((d) => d._id === r._id);
|
|
120
|
+
return r.items = (a = r.items) == null ? void 0 : a.map((d) => {
|
|
117
121
|
var g;
|
|
118
|
-
const
|
|
122
|
+
const l = (g = u == null ? void 0 : u.items) == null ? void 0 : g.find(
|
|
119
123
|
(y) => y._id === d._id && y.combinationKey === d.combinationKey
|
|
120
124
|
);
|
|
121
|
-
return G(d,
|
|
122
|
-
}),
|
|
125
|
+
return G(d, l);
|
|
126
|
+
}), r;
|
|
123
127
|
}), n;
|
|
124
128
|
}
|
|
125
129
|
function ut(e, t) {
|
|
126
130
|
const n = e.items[t._id];
|
|
127
131
|
t.variant && (t.variant = {
|
|
128
132
|
...t.variant,
|
|
129
|
-
variantCombinations: t.variant.variantCombinations.map((
|
|
133
|
+
variantCombinations: t.variant.variantCombinations.map((r) => {
|
|
130
134
|
const u = n.find(
|
|
131
|
-
(
|
|
135
|
+
(c) => c._id === r._id && c.combinationKey === r.combinationKey
|
|
132
136
|
);
|
|
133
137
|
if (!u)
|
|
134
|
-
throw new Error(`Item overrider not found - ${
|
|
135
|
-
return G(u,
|
|
138
|
+
throw new Error(`Item overrider not found - ${r._id} - ${r.combinationKey}`);
|
|
139
|
+
return G(u, r);
|
|
136
140
|
})
|
|
137
141
|
});
|
|
138
|
-
const s = n.find((
|
|
142
|
+
const s = n.find((r) => !r.combinationKey);
|
|
139
143
|
if (!s)
|
|
140
144
|
throw new Error(`Base item overrider not found - ${t._id}`);
|
|
141
|
-
return t.groups = (s.groups || []).map((
|
|
142
|
-
var
|
|
143
|
-
const u = t.groups.find((a) => a._id ===
|
|
144
|
-
return
|
|
145
|
-
var
|
|
146
|
-
const d = (
|
|
145
|
+
return t.groups = (s.groups || []).map((r) => {
|
|
146
|
+
var c;
|
|
147
|
+
const u = t.groups.find((a) => a._id === r._id);
|
|
148
|
+
return r.items = (c = r.items) == null ? void 0 : c.map((a) => {
|
|
149
|
+
var l;
|
|
150
|
+
const d = (l = u == null ? void 0 : u.items) == null ? void 0 : l.find(
|
|
147
151
|
(g) => g._id === a._id && g.combinationKey === a.combinationKey
|
|
148
152
|
);
|
|
149
153
|
return G(a, d);
|
|
150
|
-
}),
|
|
154
|
+
}), r;
|
|
151
155
|
}), {
|
|
152
156
|
...t,
|
|
153
157
|
price: (s == null ? void 0 : s.price) || t.price
|
|
154
158
|
};
|
|
155
159
|
}
|
|
156
|
-
async function
|
|
157
|
-
const
|
|
160
|
+
async function Vt(e, t, n, s, r, u = !0) {
|
|
161
|
+
const c = C(n), a = u ? st(t, c, s, r) : c, d = t.reduce((y, f) => (y[f._id] = a.modules.item.find((v) => v._id === f._id), y), {}), l = t.reduce((y, f) => {
|
|
158
162
|
const v = f._id;
|
|
159
163
|
return y[v] = at(d[v], e), y;
|
|
160
164
|
}, {}), g = T.getFallbackPrices({
|
|
161
165
|
rawMenu: a,
|
|
162
|
-
items:
|
|
166
|
+
items: l,
|
|
163
167
|
catalogId: s || void 0,
|
|
164
|
-
schedulerId:
|
|
168
|
+
schedulerId: r
|
|
165
169
|
});
|
|
166
170
|
return t.map((y) => {
|
|
167
171
|
const f = y._id, v = d[f];
|
|
168
172
|
return {
|
|
169
173
|
...ut(g, v),
|
|
170
|
-
category: s ||
|
|
174
|
+
category: s || r ? v == null ? void 0 : v.category : null
|
|
171
175
|
};
|
|
172
176
|
});
|
|
173
177
|
}
|
|
174
178
|
function Tt(e, t) {
|
|
175
179
|
if (e.length === 0) return "";
|
|
176
180
|
const n = e == null ? void 0 : e.split("variant");
|
|
177
|
-
return ((n == null ? void 0 : n.reduce((
|
|
181
|
+
return ((n == null ? void 0 : n.reduce((r, u) => {
|
|
178
182
|
if (u && u.length > 0) {
|
|
179
|
-
const
|
|
180
|
-
({ _id: g }) => g ===
|
|
183
|
+
const c = `variant${u.split("/")[0]}`, a = u.split("/")[1], l = t.find(
|
|
184
|
+
({ _id: g }) => g === c
|
|
181
185
|
).options.find(({ _id: g }) => g === a);
|
|
182
|
-
|
|
186
|
+
r.push(((l == null ? void 0 : l.name) || "").trim());
|
|
183
187
|
}
|
|
184
|
-
return
|
|
188
|
+
return r;
|
|
185
189
|
}, [])) || []).join(" / ");
|
|
186
190
|
}
|
|
187
191
|
const q = /* @__PURE__ */ new Map();
|
|
@@ -190,7 +194,7 @@ async function Kt(e, t) {
|
|
|
190
194
|
if (q.has(n))
|
|
191
195
|
return q.get(n);
|
|
192
196
|
const s = await ue(
|
|
193
|
-
|
|
197
|
+
rt,
|
|
194
198
|
JSON.stringify({
|
|
195
199
|
menu: e,
|
|
196
200
|
itemId: t
|
|
@@ -199,7 +203,7 @@ async function Kt(e, t) {
|
|
|
199
203
|
return q.set(n, s), s;
|
|
200
204
|
}
|
|
201
205
|
async function ce(e, t, n) {
|
|
202
|
-
return await ue(
|
|
206
|
+
return await ue(ot, {
|
|
203
207
|
menu: e,
|
|
204
208
|
catalogId: t,
|
|
205
209
|
schedulerId: n
|
|
@@ -210,34 +214,34 @@ async function it(e, t, n) {
|
|
|
210
214
|
const s = `${e._id}-${e.updatedAt}-${t || "null"}-${n || "null"}`;
|
|
211
215
|
if (z.has(s))
|
|
212
216
|
return z.get(s);
|
|
213
|
-
const
|
|
214
|
-
return z.set(s,
|
|
217
|
+
const r = await ce(e, t, n);
|
|
218
|
+
return z.set(s, r), r;
|
|
215
219
|
}
|
|
216
220
|
async function Pt(e, t, n) {
|
|
217
|
-
var
|
|
218
|
-
const s = await it(e, t, null),
|
|
221
|
+
var c, a;
|
|
222
|
+
const s = await it(e, t, null), r = [], u = (d, l) => {
|
|
219
223
|
const g = C(d);
|
|
220
|
-
for (const y in
|
|
221
|
-
|
|
224
|
+
for (const y in l)
|
|
225
|
+
l[y] && (g[y] = l[y]);
|
|
222
226
|
return g;
|
|
223
227
|
};
|
|
224
228
|
for (const d of s.modules.group) {
|
|
225
|
-
const
|
|
226
|
-
if (
|
|
227
|
-
const y = (a = d.items) == null ? void 0 : a.filter((v) => v._id === n && v.combinationKey), f = [
|
|
229
|
+
const l = (c = d.items) == null ? void 0 : c.find((y) => y._id === n && !y.combinationKey), g = e.modules.item.find((y) => y._id === n);
|
|
230
|
+
if (l) {
|
|
231
|
+
const y = (a = d.items) == null ? void 0 : a.filter((v) => v._id === n && v.combinationKey), f = [l, ...y].map((v) => {
|
|
228
232
|
var M, I;
|
|
229
|
-
const
|
|
233
|
+
const p = v.combinationKey ? (I = (M = g == null ? void 0 : g.variant) == null ? void 0 : M.variantCombinations) == null ? void 0 : I.find(
|
|
230
234
|
(k) => k.combinationKey === v.combinationKey
|
|
231
|
-
) : g, b =
|
|
235
|
+
) : g, b = p && g ? u(g, p) : v;
|
|
232
236
|
return u(b, v);
|
|
233
237
|
});
|
|
234
|
-
|
|
238
|
+
r.push({
|
|
235
239
|
group: d,
|
|
236
240
|
items: f
|
|
237
241
|
});
|
|
238
242
|
}
|
|
239
243
|
}
|
|
240
|
-
return
|
|
244
|
+
return r;
|
|
241
245
|
}
|
|
242
246
|
const w = 0, K = 3;
|
|
243
247
|
function ct(e) {
|
|
@@ -284,81 +288,81 @@ function P(e, t) {
|
|
|
284
288
|
if (E(e) && E(t)) {
|
|
285
289
|
const n = Object.keys(e), s = Object.keys(t);
|
|
286
290
|
if (n.length !== s.length) return !1;
|
|
287
|
-
for (const
|
|
288
|
-
if (!Object.prototype.hasOwnProperty.call(t,
|
|
291
|
+
for (const r of n)
|
|
292
|
+
if (!Object.prototype.hasOwnProperty.call(t, r) || !P(e[r], t[r])) return !1;
|
|
289
293
|
return !0;
|
|
290
294
|
}
|
|
291
295
|
return !1;
|
|
292
296
|
}
|
|
293
297
|
function lt(e, t, n) {
|
|
294
|
-
const s = e.length,
|
|
295
|
-
for (let d = 0; d <
|
|
296
|
-
const
|
|
297
|
-
u.has(
|
|
298
|
+
const s = e.length, r = t.length, u = /* @__PURE__ */ new Map();
|
|
299
|
+
for (let d = 0; d < r; d++) {
|
|
300
|
+
const l = n ? n(t[d]) : JSON.stringify(t[d]);
|
|
301
|
+
u.has(l) || u.set(l, []), u.get(l).push(d);
|
|
298
302
|
}
|
|
299
|
-
const
|
|
303
|
+
const c = [], a = /* @__PURE__ */ new Set();
|
|
300
304
|
for (let d = 0; d < s; d++) {
|
|
301
|
-
const
|
|
305
|
+
const l = e[d], g = n ? n(l) : JSON.stringify(l), y = u.get(g);
|
|
302
306
|
if (y) {
|
|
303
307
|
for (const f of y)
|
|
304
|
-
if (!a.has(f) && P(
|
|
305
|
-
|
|
308
|
+
if (!a.has(f) && P(l, t[f])) {
|
|
309
|
+
c.push({ leftIndex: d, rightIndex: f }), a.add(f);
|
|
306
310
|
break;
|
|
307
311
|
}
|
|
308
312
|
}
|
|
309
313
|
}
|
|
310
|
-
return
|
|
314
|
+
return c;
|
|
311
315
|
}
|
|
312
316
|
function dt(e, t, n) {
|
|
313
317
|
var f, v;
|
|
314
318
|
if (P(e, t)) return;
|
|
315
|
-
const s = { _t: "a" },
|
|
316
|
-
let a =
|
|
317
|
-
if (!
|
|
318
|
-
const
|
|
319
|
-
if (
|
|
319
|
+
const s = { _t: "a" }, r = ((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, c = n == null ? void 0 : n.objectHash;
|
|
320
|
+
let a = r ? lt(e, t, c) : [];
|
|
321
|
+
if (!c && e.length === t.length && e.length > 0 && a.length < e.length) {
|
|
322
|
+
const p = E(e[0]) || Array.isArray(e[0]), b = a.length > 0;
|
|
323
|
+
if (p || b) {
|
|
320
324
|
a = [];
|
|
321
325
|
for (let M = 0; M < e.length; M++)
|
|
322
326
|
a.push({ leftIndex: M, rightIndex: M });
|
|
323
327
|
}
|
|
324
328
|
}
|
|
325
|
-
new Set(a.map((
|
|
326
|
-
const d = new Set(a.map((
|
|
327
|
-
for (const
|
|
328
|
-
|
|
329
|
-
for (let
|
|
330
|
-
const b =
|
|
329
|
+
new Set(a.map((p) => p.leftIndex));
|
|
330
|
+
const d = new Set(a.map((p) => p.rightIndex)), l = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
|
|
331
|
+
for (const p of a)
|
|
332
|
+
l.set(p.leftIndex, p.rightIndex), g.set(p.rightIndex, p.leftIndex);
|
|
333
|
+
for (let p = 0; p < e.length; p++) {
|
|
334
|
+
const b = l.get(p);
|
|
331
335
|
if (b !== void 0) {
|
|
332
|
-
const M = J(e[
|
|
333
|
-
if (M !== void 0 && (s[b] = M),
|
|
334
|
-
const I = `_${
|
|
336
|
+
const M = J(e[p], t[b], n);
|
|
337
|
+
if (M !== void 0 && (s[b] = M), r && b !== p) {
|
|
338
|
+
const I = `_${p}`, k = u ? [e[p], b, K] : ["", b, K];
|
|
335
339
|
s[I] = k;
|
|
336
340
|
}
|
|
337
341
|
} else {
|
|
338
|
-
const M = `_${
|
|
339
|
-
s[M] = [e[
|
|
342
|
+
const M = `_${p}`;
|
|
343
|
+
s[M] = [e[p], w, w];
|
|
340
344
|
}
|
|
341
345
|
}
|
|
342
|
-
for (let
|
|
343
|
-
d.has(
|
|
346
|
+
for (let p = 0; p < t.length; p++)
|
|
347
|
+
d.has(p) || (s[p] = [t[p]]);
|
|
344
348
|
const y = Object.keys(s);
|
|
345
349
|
if (!(y.length === 1 && y[0] === "_t"))
|
|
346
350
|
return s;
|
|
347
351
|
}
|
|
348
352
|
function mt(e, t, n) {
|
|
349
353
|
if (P(e, t)) return;
|
|
350
|
-
const s = {},
|
|
351
|
-
for (const a of
|
|
354
|
+
const s = {}, r = Object.keys(e), u = Object.keys(t), c = /* @__PURE__ */ new Set([...r, ...u]);
|
|
355
|
+
for (const a of c) {
|
|
352
356
|
if (n != null && n.propertyFilter && !n.propertyFilter(a, { left: e, right: t }))
|
|
353
357
|
continue;
|
|
354
|
-
const d = Object.prototype.hasOwnProperty.call(e, a),
|
|
355
|
-
if (d &&
|
|
358
|
+
const d = Object.prototype.hasOwnProperty.call(e, a), l = Object.prototype.hasOwnProperty.call(t, a);
|
|
359
|
+
if (d && l) {
|
|
356
360
|
const g = J(e[a], t[a], n);
|
|
357
361
|
g !== void 0 && (s[a] = g);
|
|
358
|
-
} else if (d && !
|
|
362
|
+
} else if (d && !l) {
|
|
359
363
|
const g = n != null && n.omitRemovedValues ? 0 : e[a];
|
|
360
364
|
s[a] = [g, w, w];
|
|
361
|
-
} else !d &&
|
|
365
|
+
} else !d && l && (s[a] = [t[a]]);
|
|
362
366
|
}
|
|
363
367
|
return Object.keys(s).length > 0 ? s : void 0;
|
|
364
368
|
}
|
|
@@ -376,43 +380,43 @@ function J(e, t, n) {
|
|
|
376
380
|
return dt(e, t, n);
|
|
377
381
|
if (E(e) && E(t))
|
|
378
382
|
return mt(e, t, n);
|
|
379
|
-
const u = n != null && n.cloneDiffValues ? O(e) : e,
|
|
380
|
-
return [$(u), $(
|
|
383
|
+
const u = n != null && n.cloneDiffValues ? O(e) : e, c = n != null && n.cloneDiffValues ? O(t) : t;
|
|
384
|
+
return [$(u), $(c)];
|
|
381
385
|
}
|
|
382
386
|
function ft(e, t, n) {
|
|
383
387
|
return J(e, t, n);
|
|
384
388
|
}
|
|
385
389
|
function vt(e, t, n) {
|
|
386
|
-
const s = /* @__PURE__ */ new Set(),
|
|
390
|
+
const s = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map();
|
|
387
391
|
for (const a in t) {
|
|
388
392
|
if (a === "_t" || !a.startsWith("_")) continue;
|
|
389
|
-
const d = parseInt(a.slice(1)),
|
|
390
|
-
Array.isArray(
|
|
393
|
+
const d = parseInt(a.slice(1)), l = t[a];
|
|
394
|
+
Array.isArray(l) && (l.length === 3 && l[2] === w ? s.add(d) : l.length === 3 && l[2] === K && r.set(d, l[1]));
|
|
391
395
|
}
|
|
392
396
|
const u = [];
|
|
393
|
-
let
|
|
397
|
+
let c = 0;
|
|
394
398
|
for (let a = 0; ; a++) {
|
|
395
|
-
const d = a.toString(),
|
|
396
|
-
if (
|
|
397
|
-
if (Array.isArray(
|
|
398
|
-
u.push(
|
|
399
|
+
const d = a.toString(), l = t[d];
|
|
400
|
+
if (l !== void 0)
|
|
401
|
+
if (Array.isArray(l) && l.length === 1)
|
|
402
|
+
u.push(l[0]);
|
|
399
403
|
else {
|
|
400
|
-
for (;
|
|
401
|
-
|
|
402
|
-
|
|
404
|
+
for (; c < e.length && s.has(c); )
|
|
405
|
+
c++;
|
|
406
|
+
c < e.length && (u.push(Y(e[c], l)), c++);
|
|
403
407
|
}
|
|
404
408
|
else {
|
|
405
409
|
let g = !1;
|
|
406
|
-
for (const [y, f] of
|
|
410
|
+
for (const [y, f] of r.entries())
|
|
407
411
|
if (f === a) {
|
|
408
412
|
u.push(e[y]), g = !0;
|
|
409
413
|
break;
|
|
410
414
|
}
|
|
411
415
|
if (!g) {
|
|
412
|
-
for (;
|
|
413
|
-
|
|
414
|
-
if (
|
|
415
|
-
u.push(e[
|
|
416
|
+
for (; c < e.length && (s.has(c) || r.has(c)); )
|
|
417
|
+
c++;
|
|
418
|
+
if (c < e.length)
|
|
419
|
+
u.push(e[c]), c++;
|
|
416
420
|
else
|
|
417
421
|
break;
|
|
418
422
|
}
|
|
@@ -422,9 +426,9 @@ function vt(e, t, n) {
|
|
|
422
426
|
}
|
|
423
427
|
function yt(e, t, n) {
|
|
424
428
|
const s = { ...e };
|
|
425
|
-
for (const
|
|
426
|
-
const u = t[
|
|
427
|
-
Array.isArray(u) ? u.length === 1 ? s[
|
|
429
|
+
for (const r in t) {
|
|
430
|
+
const u = t[r];
|
|
431
|
+
Array.isArray(u) ? u.length === 1 ? s[r] = u[0] : u.length === 3 && u[2] === w ? delete s[r] : u.length === 2 && (s[r] = u[1]) : s[r] = Y(s[r], u);
|
|
428
432
|
}
|
|
429
433
|
return s;
|
|
430
434
|
}
|
|
@@ -448,35 +452,35 @@ function gt(e) {
|
|
|
448
452
|
for (const n in e)
|
|
449
453
|
if (n !== "_t")
|
|
450
454
|
if (n.startsWith("_")) {
|
|
451
|
-
const s = parseInt(n.slice(1)),
|
|
452
|
-
if (Array.isArray(
|
|
453
|
-
if (
|
|
454
|
-
t[s] = [
|
|
455
|
-
else if (
|
|
456
|
-
const u =
|
|
457
|
-
t[`_${u}`] = [
|
|
455
|
+
const s = parseInt(n.slice(1)), r = e[n];
|
|
456
|
+
if (Array.isArray(r)) {
|
|
457
|
+
if (r.length === 3 && r[2] === w)
|
|
458
|
+
t[s] = [r[0]];
|
|
459
|
+
else if (r.length === 3 && r[2] === K) {
|
|
460
|
+
const u = r[1];
|
|
461
|
+
t[`_${u}`] = [r[0], s, K];
|
|
458
462
|
}
|
|
459
463
|
}
|
|
460
464
|
} else {
|
|
461
|
-
const s = parseInt(n),
|
|
462
|
-
if (Array.isArray(
|
|
463
|
-
t[`_${s}`] = [
|
|
465
|
+
const s = parseInt(n), r = e[n];
|
|
466
|
+
if (Array.isArray(r) && r.length === 1)
|
|
467
|
+
t[`_${s}`] = [r[0], w, w];
|
|
464
468
|
else {
|
|
465
|
-
const u = Q(
|
|
469
|
+
const u = Q(r);
|
|
466
470
|
u !== void 0 && (t[n] = u);
|
|
467
471
|
}
|
|
468
472
|
}
|
|
469
473
|
return t;
|
|
470
474
|
}
|
|
471
|
-
function
|
|
475
|
+
function pt(e) {
|
|
472
476
|
const t = {};
|
|
473
477
|
for (const n in e) {
|
|
474
478
|
const s = e[n];
|
|
475
479
|
if (Array.isArray(s))
|
|
476
480
|
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]]);
|
|
477
481
|
else {
|
|
478
|
-
const
|
|
479
|
-
|
|
482
|
+
const r = Q(s);
|
|
483
|
+
r !== void 0 && (t[n] = r);
|
|
480
484
|
}
|
|
481
485
|
}
|
|
482
486
|
return t;
|
|
@@ -493,13 +497,13 @@ function Q(e) {
|
|
|
493
497
|
if (e.length === 3 && e[2] === K)
|
|
494
498
|
return e;
|
|
495
499
|
}
|
|
496
|
-
return E(e) && e._t === "a" ? gt(e) : E(e) ?
|
|
500
|
+
return E(e) && e._t === "a" ? gt(e) : E(e) ? pt(e) : e;
|
|
497
501
|
}
|
|
498
502
|
}
|
|
499
503
|
function de(e) {
|
|
500
504
|
return Q(e);
|
|
501
505
|
}
|
|
502
|
-
function
|
|
506
|
+
function ht(e, t, n) {
|
|
503
507
|
const s = de(t);
|
|
504
508
|
return le(e, s);
|
|
505
509
|
}
|
|
@@ -518,7 +522,7 @@ class _t {
|
|
|
518
522
|
return de(t);
|
|
519
523
|
}
|
|
520
524
|
unpatch(t, n) {
|
|
521
|
-
return
|
|
525
|
+
return ht(t, n, this.options);
|
|
522
526
|
}
|
|
523
527
|
clone(t) {
|
|
524
528
|
return O(t);
|
|
@@ -537,48 +541,48 @@ function bt({
|
|
|
537
541
|
includeValueOnMove: !1
|
|
538
542
|
},
|
|
539
543
|
cloneDiffValues: !1
|
|
540
|
-
}), n =
|
|
544
|
+
}), n = j(null), s = j([]), r = H(-1), u = j(null), c = S(() => r.value > 0), a = S(() => r.value < s.value.length - 1);
|
|
541
545
|
function d(v) {
|
|
542
546
|
if (n.value === null) {
|
|
543
|
-
n.value = C(v), u.value = C(v), s.value = [{ delta: null }],
|
|
547
|
+
n.value = C(v), u.value = C(v), s.value = [{ delta: null }], r.value = 0;
|
|
544
548
|
return;
|
|
545
549
|
}
|
|
546
|
-
const
|
|
547
|
-
if (
|
|
550
|
+
const p = t.diff(u.value, v);
|
|
551
|
+
if (r.value < s.value.length - 1 && (s.value = s.value.slice(0, r.value + 1)), s.value.push({ delta: p }), r.value++, u.value = C(v), s.value.length > e) {
|
|
548
552
|
const b = s.value[1].delta;
|
|
549
|
-
b && n.value && (n.value = t.patch(C(n.value), b)), s.value.shift(),
|
|
553
|
+
b && n.value && (n.value = t.patch(C(n.value), b)), s.value.shift(), r.value--;
|
|
550
554
|
}
|
|
551
555
|
}
|
|
552
|
-
function
|
|
556
|
+
function l(v) {
|
|
553
557
|
if (!n.value || v < 0 || v >= s.value.length)
|
|
554
558
|
return;
|
|
555
|
-
let
|
|
559
|
+
let p = C(n.value);
|
|
556
560
|
for (let b = 1; b <= v; b++) {
|
|
557
561
|
const M = s.value[b];
|
|
558
|
-
M.delta && (
|
|
562
|
+
M.delta && (p = t.patch(p, M.delta));
|
|
559
563
|
}
|
|
560
|
-
return
|
|
564
|
+
return p;
|
|
561
565
|
}
|
|
562
566
|
function g() {
|
|
563
|
-
if (
|
|
564
|
-
|
|
565
|
-
const v =
|
|
567
|
+
if (c.value) {
|
|
568
|
+
r.value--;
|
|
569
|
+
const v = l(r.value);
|
|
566
570
|
return v && (u.value = C(v)), v;
|
|
567
571
|
}
|
|
568
572
|
}
|
|
569
573
|
function y() {
|
|
570
574
|
if (a.value) {
|
|
571
|
-
|
|
572
|
-
const v =
|
|
575
|
+
r.value++;
|
|
576
|
+
const v = l(r.value);
|
|
573
577
|
return v && (u.value = C(v)), v;
|
|
574
578
|
}
|
|
575
579
|
}
|
|
576
580
|
function f() {
|
|
577
|
-
n.value = null, u.value = null, s.value = [],
|
|
581
|
+
n.value = null, u.value = null, s.value = [], r.value = -1;
|
|
578
582
|
}
|
|
579
583
|
return {
|
|
580
584
|
push: d,
|
|
581
|
-
canUndo:
|
|
585
|
+
canUndo: c,
|
|
582
586
|
canRedo: a,
|
|
583
587
|
undo: g,
|
|
584
588
|
redo: y,
|
|
@@ -587,7 +591,7 @@ function bt({
|
|
|
587
591
|
}
|
|
588
592
|
const Mt = {
|
|
589
593
|
async updateMenuModule(e, t) {
|
|
590
|
-
const n =
|
|
594
|
+
const n = B.RequestRunner.operation(t, e.modules);
|
|
591
595
|
if (n.validateError.length > 0)
|
|
592
596
|
throw new Error(n.validateError.join(`
|
|
593
597
|
`));
|
|
@@ -640,68 +644,68 @@ const $t = qe(
|
|
|
640
644
|
() => {
|
|
641
645
|
const e = ze(wt()), t = se(), n = tt(), s = S(() => e.menu.modules.serveSequence ? x(e.menu.modules.serveSequence, {
|
|
642
646
|
selector: "position"
|
|
643
|
-
}) : []),
|
|
644
|
-
var
|
|
645
|
-
return ((
|
|
646
|
-
}), u = S(() =>
|
|
647
|
-
const
|
|
648
|
-
return x(
|
|
647
|
+
}) : []), r = S(() => {
|
|
648
|
+
var o;
|
|
649
|
+
return ((o = t.currentBusiness.value) == null ? void 0 : o.menuVersion) || W.F_MENU_VERSION.v3;
|
|
650
|
+
}), u = S(() => r.value === W.F_MENU_VERSION.v4), c = S(() => {
|
|
651
|
+
const o = e.menu.modules.catalog;
|
|
652
|
+
return x(o, { selector: "name" });
|
|
649
653
|
}), a = S(() => {
|
|
650
654
|
var i;
|
|
651
|
-
let
|
|
655
|
+
let o = e.menu.modules.catalog.find(
|
|
652
656
|
(m) => m._id === e.currentCatalogId
|
|
653
657
|
);
|
|
654
|
-
return
|
|
655
|
-
catalog:
|
|
658
|
+
return o && ((i = o.linkItemRules) != null && i.length) && (o = T.populateCatalog({
|
|
659
|
+
catalog: o,
|
|
656
660
|
ruleGroupSettings: e.menu.ruleGroupSettings,
|
|
657
661
|
items: e.menu.modules.item,
|
|
658
662
|
...e.currentRestaurantAttrParams ?? {}
|
|
659
|
-
})),
|
|
660
|
-
}), d = S(() => x(y.value.modules.scheduler, { selector: "name" })),
|
|
661
|
-
(
|
|
663
|
+
})), o;
|
|
664
|
+
}), d = S(() => x(y.value.modules.scheduler, { selector: "name" })), l = S(() => e.menu.modules.scheduler.find(
|
|
665
|
+
(o) => o._id === e.currentSchedulerId
|
|
662
666
|
));
|
|
663
|
-
function g(
|
|
664
|
-
e.menu = { ...
|
|
667
|
+
function g(o, i = !0) {
|
|
668
|
+
e.menu = { ...o, _rev: e.menu._rev }, i && D.push(e.menu);
|
|
665
669
|
}
|
|
666
|
-
const y =
|
|
667
|
-
async function
|
|
670
|
+
const y = j(me()), f = H(!1), v = H(1);
|
|
671
|
+
async function p() {
|
|
668
672
|
var m;
|
|
669
673
|
f.value = !0;
|
|
670
|
-
let
|
|
674
|
+
let o = e.menu.modules.catalog;
|
|
671
675
|
if (a.value && ((m = a.value.linkItemRules) != null && m.length)) {
|
|
672
|
-
const
|
|
676
|
+
const h = T.populateCatalog({
|
|
673
677
|
catalog: a.value,
|
|
674
678
|
ruleGroupSettings: e.menu.ruleGroupSettings,
|
|
675
679
|
items: e.menu.modules.item,
|
|
676
680
|
...e.currentRestaurantAttrParams ?? {}
|
|
677
681
|
});
|
|
678
|
-
|
|
682
|
+
o = e.menu.modules.catalog.map((_) => _._id === (h == null ? void 0 : h._id) ? h : _);
|
|
679
683
|
}
|
|
680
684
|
const i = await ce(
|
|
681
685
|
{
|
|
682
686
|
...e.menu,
|
|
683
687
|
modules: {
|
|
684
688
|
...e.menu.modules,
|
|
685
|
-
catalog:
|
|
689
|
+
catalog: o
|
|
686
690
|
}
|
|
687
691
|
},
|
|
688
692
|
e.currentCatalogId,
|
|
689
693
|
e.currentSchedulerId
|
|
690
694
|
);
|
|
691
695
|
if (e.currentSchedulerId != null) {
|
|
692
|
-
const
|
|
696
|
+
const h = e.menu.modules.catalog.find(
|
|
693
697
|
(R) => R._id === e.currentCatalogId
|
|
694
|
-
), _ =
|
|
698
|
+
), _ = h ? h.override.scheduler[e.currentSchedulerId] : e.menu.modules.scheduler.find(
|
|
695
699
|
(R) => R._id === e.currentSchedulerId
|
|
696
700
|
), A = new Set(((_ == null ? void 0 : _.items) || []).map((R) => R._id));
|
|
697
701
|
i.modules.item = i.modules.item.filter((R) => A.has(R._id));
|
|
698
702
|
}
|
|
699
703
|
return y.value = i, f.value = !1, v.value = v.value + 1, i;
|
|
700
704
|
}
|
|
701
|
-
const M = ae.debounce(
|
|
705
|
+
const M = ae.debounce(p, 200);
|
|
702
706
|
let I = null, k = null;
|
|
703
707
|
function X() {
|
|
704
|
-
k && (k(), k = null), I && I.stop(), I =
|
|
708
|
+
k && (k(), k = null), I && I.stop(), I = He(!0), k = I.run(() => Be(
|
|
705
709
|
() => [e.menu, e.currentCatalogId, e.currentSchedulerId],
|
|
706
710
|
() => {
|
|
707
711
|
f.value || M();
|
|
@@ -714,12 +718,12 @@ const $t = qe(
|
|
|
714
718
|
label: "Main",
|
|
715
719
|
value: null
|
|
716
720
|
},
|
|
717
|
-
...
|
|
718
|
-
label:
|
|
719
|
-
value:
|
|
721
|
+
...c.value.map((o) => ({
|
|
722
|
+
label: o.name,
|
|
723
|
+
value: o._id
|
|
720
724
|
}))
|
|
721
725
|
]), Z = S(() => {
|
|
722
|
-
const
|
|
726
|
+
const o = y.value.modules.category;
|
|
723
727
|
return [
|
|
724
728
|
...U.value.item.addon ? [
|
|
725
729
|
{
|
|
@@ -728,36 +732,36 @@ const $t = qe(
|
|
|
728
732
|
position: 0
|
|
729
733
|
}
|
|
730
734
|
] : [],
|
|
731
|
-
...
|
|
735
|
+
...V(o, (i) => i.name)
|
|
732
736
|
];
|
|
733
737
|
}), ve = S(() => {
|
|
734
|
-
const
|
|
735
|
-
return
|
|
738
|
+
const o = y.value.modules.subCategory || [];
|
|
739
|
+
return V(o, (i) => i.name);
|
|
736
740
|
}), ee = S(() => {
|
|
737
741
|
var i;
|
|
738
|
-
let
|
|
742
|
+
let o = y.value.modules.item;
|
|
739
743
|
if (a.value) {
|
|
740
744
|
const m = (i = a.value) == null ? void 0 : i.override.items;
|
|
741
|
-
|
|
745
|
+
o = o.filter((h) => {
|
|
742
746
|
var A;
|
|
743
|
-
const _ = (A = m == null ? void 0 : m[
|
|
747
|
+
const _ = (A = m == null ? void 0 : m[h._id]) == null ? void 0 : A.find(
|
|
744
748
|
(R) => !R.combinationKey
|
|
745
749
|
);
|
|
746
750
|
return (_ == null ? void 0 : _.orderFrom) !== ie.enum.NONE;
|
|
747
751
|
});
|
|
748
752
|
}
|
|
749
|
-
return
|
|
753
|
+
return V(o, (m) => m.code || m.name);
|
|
750
754
|
}), ye = S(() => {
|
|
751
|
-
const
|
|
752
|
-
(
|
|
755
|
+
const o = e.menu.modules.category, i = V(o, (h) => h.name).reduce(
|
|
756
|
+
(h, _, A) => (h[_._id] = A, h),
|
|
753
757
|
{ "": 0 }
|
|
754
758
|
), m = e.menu.modules.item;
|
|
755
|
-
return
|
|
759
|
+
return V(
|
|
756
760
|
m,
|
|
757
|
-
(
|
|
758
|
-
).reduce((
|
|
759
|
-
}), ge = S(() => oe(
|
|
760
|
-
const
|
|
761
|
+
(h) => h.code || h.name
|
|
762
|
+
).reduce((h, _, A) => (h[_._id] = A + i[_.category || ""], h), {});
|
|
763
|
+
}), ge = S(() => oe(N.value, Z.value, ee.value)), pe = S(() => {
|
|
764
|
+
const o = U.value.item.addon ? [
|
|
761
765
|
{
|
|
762
766
|
_id: e.currentCatalogId ? "" : null,
|
|
763
767
|
name: "Addon",
|
|
@@ -767,85 +771,85 @@ const $t = qe(
|
|
|
767
771
|
] : e.menu.modules.category;
|
|
768
772
|
return oe(
|
|
769
773
|
e.menu.modules.variant,
|
|
770
|
-
|
|
774
|
+
o,
|
|
771
775
|
e.menu.modules.item
|
|
772
776
|
);
|
|
773
|
-
}),
|
|
774
|
-
const
|
|
775
|
-
return x(
|
|
777
|
+
}), N = S(() => {
|
|
778
|
+
const o = y.value.modules.variant;
|
|
779
|
+
return x(o, { selector: "name" });
|
|
776
780
|
});
|
|
777
|
-
function
|
|
778
|
-
const i =
|
|
779
|
-
return T.fullVariantCombination(i).reduce((
|
|
781
|
+
function he(o = []) {
|
|
782
|
+
const i = o.map((h) => N.value.find((_) => _._id === h)).filter((h) => !!h);
|
|
783
|
+
return T.fullVariantCombination(i).reduce((h, _) => (h[_.combinationKey] = _.selectionName.join(" / "), h), {});
|
|
780
784
|
}
|
|
781
|
-
const _e = S(() =>
|
|
785
|
+
const _e = S(() => V(y.value.modules.group, (o) => o.name)), Se = S(() => x(y.value.modules.takeaway, { selector: "name" })), be = S(() => x(e.menu.modules.printDepartment || [], {
|
|
782
786
|
selector: "name"
|
|
783
787
|
})), Me = S(() => x(e.menu.modules.unit, { selector: "name" })), we = S(() => x(Ge(e.menu.modules.recipe, e.menu.modules.sku), {
|
|
784
788
|
selector: "name"
|
|
785
789
|
})), Ae = S(() => e.menu.modules.cookingGuide), Ce = S(() => {
|
|
786
|
-
const
|
|
787
|
-
return x(
|
|
790
|
+
const o = Je(e.menu.modules.sku);
|
|
791
|
+
return x(o, { selector: "code" });
|
|
788
792
|
}), Ie = S(() => {
|
|
789
|
-
const
|
|
793
|
+
const o = /* @__PURE__ */ new Map();
|
|
790
794
|
return e.menu.modules.item.forEach((i) => {
|
|
791
|
-
var m,
|
|
792
|
-
i.code &&
|
|
793
|
-
_.code &&
|
|
795
|
+
var m, h;
|
|
796
|
+
i.code && o.set(i.code, (o.get(i.code) || 0) + 1), (h = (m = i.variant) == null ? void 0 : m.variantCombinations) == null || h.forEach((_) => {
|
|
797
|
+
_.code && o.set(_.code, (o.get(_.code) || 0) + 1);
|
|
794
798
|
});
|
|
795
|
-
}),
|
|
799
|
+
}), o;
|
|
796
800
|
}), U = S(() => {
|
|
797
|
-
const
|
|
798
|
-
create:
|
|
799
|
-
edit:
|
|
800
|
-
delete:
|
|
801
|
+
const o = !e.currentCatalogId, i = r.value === W.F_MENU_VERSION.v4, m = !e.currentSchedulerId, h = {
|
|
802
|
+
create: o && m,
|
|
803
|
+
edit: o && m,
|
|
804
|
+
delete: o && m
|
|
801
805
|
};
|
|
802
806
|
return {
|
|
803
807
|
item: {
|
|
804
|
-
...
|
|
808
|
+
...h,
|
|
805
809
|
edit: i || m,
|
|
806
|
-
sort: i &&
|
|
810
|
+
sort: i && o && m,
|
|
807
811
|
addon: i,
|
|
808
812
|
code: m,
|
|
809
|
-
name:
|
|
810
|
-
description:
|
|
813
|
+
name: o && m,
|
|
814
|
+
description: o && m,
|
|
811
815
|
category: m,
|
|
812
|
-
thumbnail:
|
|
813
|
-
images:
|
|
814
|
-
orderFrom: (i ||
|
|
815
|
-
orderFromNone:
|
|
816
|
+
thumbnail: o && m,
|
|
817
|
+
images: o && m,
|
|
818
|
+
orderFrom: (i || o) && m,
|
|
819
|
+
orderFromNone: o,
|
|
816
820
|
orderFromActiveOnly: !i,
|
|
817
|
-
openPrice:
|
|
818
|
-
unit:
|
|
819
|
-
price:
|
|
820
|
-
editPrice:
|
|
821
|
+
openPrice: o && m,
|
|
822
|
+
unit: o && m,
|
|
823
|
+
price: o,
|
|
824
|
+
editPrice: o,
|
|
821
825
|
minPrice: i && m,
|
|
822
|
-
costing: i &&
|
|
823
|
-
tax:
|
|
824
|
-
variant:
|
|
826
|
+
costing: i && o && m,
|
|
827
|
+
tax: o && m,
|
|
828
|
+
variant: o && m,
|
|
825
829
|
maxVariant: i ? 4 : 2,
|
|
826
|
-
group:
|
|
830
|
+
group: o && m,
|
|
827
831
|
overrideProductGroup: i && m,
|
|
828
|
-
inventory: (i ||
|
|
832
|
+
inventory: (i || o) && m,
|
|
829
833
|
bindToVariant: i,
|
|
830
|
-
print:
|
|
834
|
+
print: o && m,
|
|
831
835
|
toRoot: i && m,
|
|
832
|
-
takeaway: (_) => !!_ && (i ||
|
|
833
|
-
serveDelay: i &&
|
|
836
|
+
takeaway: (_) => !!_ && (i || o) && m,
|
|
837
|
+
serveDelay: i && o && m,
|
|
834
838
|
multiScheduler: i,
|
|
835
839
|
canRearrange: i,
|
|
836
840
|
printConfig: i,
|
|
837
841
|
takeawayConfig: i
|
|
838
842
|
},
|
|
839
843
|
category: {
|
|
840
|
-
...
|
|
841
|
-
sort:
|
|
844
|
+
...h,
|
|
845
|
+
sort: o,
|
|
842
846
|
overrideSequence: i
|
|
843
847
|
},
|
|
844
848
|
group: {
|
|
845
|
-
...
|
|
849
|
+
...h,
|
|
846
850
|
edit: i || m,
|
|
847
|
-
sort:
|
|
848
|
-
applyProduct:
|
|
851
|
+
sort: o,
|
|
852
|
+
applyProduct: o,
|
|
849
853
|
showAppliedProduct: m,
|
|
850
854
|
type: !i,
|
|
851
855
|
insertRawItems: !i,
|
|
@@ -856,32 +860,32 @@ const $t = qe(
|
|
|
856
860
|
override: i
|
|
857
861
|
},
|
|
858
862
|
takeaway: {
|
|
859
|
-
...
|
|
860
|
-
edit: (i ||
|
|
861
|
-
name:
|
|
863
|
+
...h,
|
|
864
|
+
edit: (i || o) && m,
|
|
865
|
+
name: o
|
|
862
866
|
},
|
|
863
867
|
catalog: {
|
|
864
|
-
name: !
|
|
868
|
+
name: !o,
|
|
865
869
|
defaultOrderFrom: i,
|
|
866
870
|
markup: i
|
|
867
871
|
}
|
|
868
872
|
};
|
|
869
873
|
});
|
|
870
|
-
function L(
|
|
871
|
-
return `${
|
|
874
|
+
function L(o) {
|
|
875
|
+
return `${o.systemCode}/${o.taxCode}`;
|
|
872
876
|
}
|
|
873
|
-
function ke(
|
|
874
|
-
const [i, m] =
|
|
877
|
+
function ke(o) {
|
|
878
|
+
const [i, m] = o.split("/");
|
|
875
879
|
return { systemCode: i, taxCode: m };
|
|
876
880
|
}
|
|
877
|
-
function Ee(
|
|
878
|
-
return (
|
|
881
|
+
function Ee(o, i, m) {
|
|
882
|
+
return (o ?? i ?? []).map((h) => L(h)).find((h) => m.some((_) => _.value === h));
|
|
879
883
|
}
|
|
880
884
|
const Re = S(() => {
|
|
881
|
-
var
|
|
882
|
-
const
|
|
885
|
+
var h;
|
|
886
|
+
const o = ["SV5", "SV10"], i = Ye.Country.getCountryFlattenTaxes(
|
|
883
887
|
se().currentCountry.value
|
|
884
|
-
), m = i.filter((_) => u.value || !
|
|
888
|
+
), m = i.filter((_) => u.value || !o.includes(_.taxCode)).map((_) => ({
|
|
885
889
|
label: `${_.name} (${Qe(_.rate)}%)`,
|
|
886
890
|
value: L(_),
|
|
887
891
|
meta: {
|
|
@@ -889,47 +893,47 @@ const $t = qe(
|
|
|
889
893
|
}
|
|
890
894
|
}));
|
|
891
895
|
return m.sort((_, A) => _.label.localeCompare(A.label, void 0, { numeric: !0 })), {
|
|
892
|
-
systemCode: (
|
|
896
|
+
systemCode: (h = i[0]) == null ? void 0 : h.systemCode,
|
|
893
897
|
countryTaxOptions: m
|
|
894
898
|
};
|
|
895
899
|
}), xe = async () => {
|
|
896
|
-
const
|
|
897
|
-
e.menu =
|
|
900
|
+
const o = await et.readMenu();
|
|
901
|
+
e.menu = o ?? e.menu, te(null);
|
|
898
902
|
}, Oe = async () => {
|
|
899
903
|
if (t.isRestaurantLevelMenu.value) {
|
|
900
904
|
e.restaurants = [];
|
|
901
905
|
return;
|
|
902
906
|
}
|
|
903
|
-
const { fetchAllRestaurants:
|
|
904
|
-
await
|
|
907
|
+
const { fetchAllRestaurants: o } = Ze();
|
|
908
|
+
await o({
|
|
905
909
|
onBatchEnd: (i) => {
|
|
906
910
|
e.restaurants = i;
|
|
907
911
|
}
|
|
908
912
|
});
|
|
909
|
-
}, te = (
|
|
910
|
-
e.currentCatalogId =
|
|
911
|
-
},
|
|
912
|
-
e.currentSchedulerId =
|
|
913
|
-
},
|
|
914
|
-
e.currentCategoryIds =
|
|
915
|
-
}, Te = (
|
|
916
|
-
e.currentRestaurantAttrParams =
|
|
917
|
-
}, Ke = async (
|
|
918
|
-
const m = Array.isArray(
|
|
913
|
+
}, te = (o) => {
|
|
914
|
+
e.currentCatalogId = o;
|
|
915
|
+
}, De = (o) => {
|
|
916
|
+
e.currentSchedulerId = o;
|
|
917
|
+
}, Ve = (o) => {
|
|
918
|
+
e.currentCategoryIds = o;
|
|
919
|
+
}, Te = (o) => {
|
|
920
|
+
e.currentRestaurantAttrParams = o;
|
|
921
|
+
}, Ke = async (o, i) => {
|
|
922
|
+
const m = Array.isArray(o) ? o : [o];
|
|
919
923
|
if (!m.length) return;
|
|
920
|
-
const
|
|
924
|
+
const h = m.map((_) => ({
|
|
921
925
|
..._,
|
|
922
926
|
_id: e.menu._id,
|
|
923
927
|
_rev: e.menu._rev
|
|
924
928
|
}));
|
|
925
929
|
try {
|
|
926
|
-
if (i ||
|
|
927
|
-
(A) => [
|
|
930
|
+
if (i || h.some(
|
|
931
|
+
(A) => [B.F_OPERATION_TYPE.delete, B.F_OPERATION_TYPE.deleteMany].includes(A.operation)
|
|
928
932
|
)) {
|
|
929
|
-
const A = await Xe(
|
|
933
|
+
const A = await Xe(h, e.menu.modules);
|
|
930
934
|
if (A !== !0) throw new Error(A);
|
|
931
935
|
}
|
|
932
|
-
const _ = await Mt.updateMenuModule(e.menu,
|
|
936
|
+
const _ = await Mt.updateMenuModule(e.menu, h);
|
|
933
937
|
return g(_.menu), _;
|
|
934
938
|
} catch (_) {
|
|
935
939
|
n.open({
|
|
@@ -938,22 +942,22 @@ const $t = qe(
|
|
|
938
942
|
message: _
|
|
939
943
|
});
|
|
940
944
|
}
|
|
941
|
-
}, Pe = async (
|
|
945
|
+
}, Pe = async (o) => {
|
|
942
946
|
const i = {
|
|
943
947
|
...e.menu,
|
|
944
|
-
masterCatalogSetting:
|
|
945
|
-
lowStockThreshold:
|
|
946
|
-
priceTierSettings:
|
|
948
|
+
masterCatalogSetting: o.masterCatalogSetting,
|
|
949
|
+
lowStockThreshold: o.lowStockThreshold,
|
|
950
|
+
priceTierSettings: o.priceTierSettings
|
|
947
951
|
};
|
|
948
952
|
return g(i), i;
|
|
949
|
-
},
|
|
950
|
-
const
|
|
951
|
-
|
|
952
|
-
},
|
|
953
|
-
const
|
|
954
|
-
|
|
953
|
+
}, D = bt({ maxHistorySize: 50 }), $e = S(() => D.canUndo.value), Fe = S(() => D.canRedo.value), je = () => {
|
|
954
|
+
const o = D.undo();
|
|
955
|
+
o && g(o, !1);
|
|
956
|
+
}, Ne = () => {
|
|
957
|
+
const o = D.redo();
|
|
958
|
+
o && g(o, !1);
|
|
955
959
|
}, Ue = () => {
|
|
956
|
-
|
|
960
|
+
D.clear();
|
|
957
961
|
};
|
|
958
962
|
return {
|
|
959
963
|
state: e,
|
|
@@ -963,13 +967,13 @@ const $t = qe(
|
|
|
963
967
|
// async computed state
|
|
964
968
|
mergedMenu: y,
|
|
965
969
|
// Computed
|
|
966
|
-
version:
|
|
970
|
+
version: r,
|
|
967
971
|
isV4: u,
|
|
968
972
|
serveSequence: s,
|
|
969
|
-
catalogs:
|
|
973
|
+
catalogs: c,
|
|
970
974
|
currentCatalog: a,
|
|
971
975
|
schedulers: d,
|
|
972
|
-
currentScheduler:
|
|
976
|
+
currentScheduler: l,
|
|
973
977
|
catalogOptions: fe,
|
|
974
978
|
categories: Z,
|
|
975
979
|
subcategories: ve,
|
|
@@ -977,8 +981,8 @@ const $t = qe(
|
|
|
977
981
|
sortedItems: ye,
|
|
978
982
|
itemCodeMap: Ie,
|
|
979
983
|
categorizedItems: ge,
|
|
980
|
-
categorizedRawMenuItems:
|
|
981
|
-
variants:
|
|
984
|
+
categorizedRawMenuItems: pe,
|
|
985
|
+
variants: N,
|
|
982
986
|
groups: _e,
|
|
983
987
|
takeaways: Se,
|
|
984
988
|
printDepartments: be,
|
|
@@ -993,22 +997,22 @@ const $t = qe(
|
|
|
993
997
|
readMenu: xe,
|
|
994
998
|
readRestaurants: Oe,
|
|
995
999
|
selectCatalog: te,
|
|
996
|
-
selectScheduler:
|
|
997
|
-
selectCategory:
|
|
1000
|
+
selectScheduler: De,
|
|
1001
|
+
selectCategory: Ve,
|
|
998
1002
|
setRestaurantAttrParams: Te,
|
|
999
1003
|
updateMenu: Ke,
|
|
1000
1004
|
updateMenuSetting: Pe,
|
|
1001
|
-
computeMergedMenu:
|
|
1005
|
+
computeMergedMenu: p,
|
|
1002
1006
|
// helper
|
|
1003
1007
|
encodeTax: L,
|
|
1004
1008
|
decodeTax: ke,
|
|
1005
1009
|
getSelectedTax: Ee,
|
|
1006
|
-
mapVariant:
|
|
1010
|
+
mapVariant: he,
|
|
1007
1011
|
// history
|
|
1008
1012
|
canUndoHistory: $e,
|
|
1009
1013
|
canRedoHistory: Fe,
|
|
1010
|
-
undoHistory:
|
|
1011
|
-
redoHistory:
|
|
1014
|
+
undoHistory: je,
|
|
1015
|
+
redoHistory: Ne,
|
|
1012
1016
|
// cleanup
|
|
1013
1017
|
$dispose: () => {
|
|
1014
1018
|
M.cancel(), k && (k(), k = null), I && (I.stop(), I = null), Ue();
|
|
@@ -1023,7 +1027,8 @@ export {
|
|
|
1023
1027
|
Kt as a,
|
|
1024
1028
|
Pt as f,
|
|
1025
1029
|
Tt as g,
|
|
1026
|
-
|
|
1030
|
+
nt as i,
|
|
1031
|
+
Vt as m,
|
|
1027
1032
|
it as o,
|
|
1028
1033
|
$t as u
|
|
1029
1034
|
};
|