@feedmepos/mf-menu 0.32.63-dev.2 → 0.32.63-dev.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/{App-C1a1LT6q.js → App-D8wf-3gk.js} +6 -6
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-CRZjxBH8.js → ApplyProduct.vue_vue_type_script_setup_true_lang-BBMuf15P.js} +3 -3
  3. package/dist/{ApplyProductDialog.vue_vue_type_script_setup_true_lang-DsicZfqa.js → ApplyProductDialog.vue_vue_type_script_setup_true_lang-CR7AGqfY.js} +3 -3
  4. package/dist/{Catalog-CFH82IzQ.js → Catalog-Dzs2obez.js} +6 -6
  5. package/dist/{Category-DcHgLPzL.js → Category-CF-bfcWZ.js} +4 -4
  6. package/dist/{Category-Bmq8Dyqn.js → Category-CRG_zlyN.js} +4 -4
  7. package/dist/{CookingGuide-g7cIlLFa.js → CookingGuide-CumoLERq.js} +5 -5
  8. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-DGMoRxxQ.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-Cw0LfYWI.js} +1 -1
  9. package/dist/{Group-DQ4S03dQ.js → Group-Bl6IXiL5.js} +1 -1
  10. package/dist/{Group-CFxq6Jwg.js → Group-XPHRRll5.js} +3 -3
  11. package/dist/{Group.vue_vue_type_script_setup_true_lang-Criwjsgq.js → Group.vue_vue_type_script_setup_true_lang-Dp41u-9T.js} +7 -7
  12. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-nnzPpKcA.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-DBim4X7-.js} +5 -5
  13. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-CanCWSih.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-AK0_2AOY.js} +7 -7
  14. package/dist/{Ingredient-BUWk8yVD.js → Ingredient-BBi88auU.js} +4 -4
  15. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-DBMUbP3d.js → InventoryBinding.vue_vue_type_script_setup_true_lang-D8C0do_V.js} +2 -2
  16. package/dist/{LinkProductSideSheet-D_ewAtdl.js → LinkProductSideSheet-BQc-iCkQ.js} +4 -4
  17. package/dist/{MenuSetting-DgaIhn51.js → MenuSetting-FTo1hoSN.js} +7 -7
  18. package/dist/{OrderPacing-CUHfN9Hy.js → OrderPacing-BUcd8nJm.js} +5 -5
  19. package/dist/{PrintRoute-CFxcyI3r.js → PrintRoute-DUnqYpDY.js} +5 -5
  20. package/dist/{Product-ChWP4DlN.js → Product-5jToTVxL.js} +1 -1
  21. package/dist/{Product.vue_vue_type_script_setup_true_lang-Df0hOAaW.js → Product.vue_vue_type_script_setup_true_lang-CvUR3VeZ.js} +13 -13
  22. package/dist/{ProductInternalTools--PMoNgk2.js → ProductInternalTools-DVo8n6WR.js} +6 -6
  23. package/dist/{Products-D3yOg_rD.js → Products-74l_V3s-.js} +40 -40
  24. package/dist/{Publish-C5pI3ARw.js → Publish-C_N7lkj5.js} +4 -4
  25. package/dist/{Recipe-ClV7xDMI.js → Recipe-Ds_84fu9.js} +5 -5
  26. package/dist/{RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-BWZJOF7c.js → RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-B1wtDQ9P.js} +1 -1
  27. package/dist/{RuleView.vue_vue_type_script_setup_true_lang-_lhdiLQO.js → RuleView.vue_vue_type_script_setup_true_lang-ntxQXlpV.js} +188 -188
  28. package/dist/{Scheduler-B4gXNQFu.js → Scheduler--pD1opc1.js} +3 -3
  29. package/dist/{ServingSequence-DQ9LvurM.js → ServingSequence-B3xxkMbp.js} +3 -3
  30. package/dist/{Setting-D659-DYQ.js → Setting-GBA945nB.js} +5 -5
  31. package/dist/{Subcategory-CldSh8My.js → Subcategory-BikyD-je.js} +6 -6
  32. package/dist/{Takeaway-za5OSOvm.js → Takeaway-DqDIobRV.js} +1 -1
  33. package/dist/{Takeaway-B5MvIP-7.js → Takeaway-XPKWPa1W.js} +4 -4
  34. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-BhoK4wib.js → Takeaway.vue_vue_type_script_setup_true_lang-CJG-SwOd.js} +5 -5
  35. package/dist/{TranslationFieldSection.vue_vue_type_script_setup_true_lang-Bl3WgQNK.js → TranslationFieldSection.vue_vue_type_script_setup_true_lang-ogrcEhDA.js} +1 -1
  36. package/dist/{TranslationSideSheet.vue_vue_type_script_setup_true_lang-DkWRL-y_.js → TranslationSideSheet.vue_vue_type_script_setup_true_lang-BZfaB7Vl.js} +2 -2
  37. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-Tox1yfD-.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DaSfi9fx.js} +14 -14
  38. package/dist/{Unit-CMEF528D.js → Unit-yJJmRvha.js} +2 -2
  39. package/dist/{Variant-37cAL8NO.js → Variant-DcCYBJS2.js} +3 -3
  40. package/dist/{_id_-c4e1Ngjk.js → _id_-BpkYdn5i.js} +9 -9
  41. package/dist/{app-Dafn3Z5r.js → app-BMI3O5C9.js} +32 -32
  42. package/dist/{app-Cb9EXiAF.js → app-BzMTHTrI.js} +1 -1
  43. package/dist/app.js +1 -1
  44. package/dist/apps/mf-menu/src/components/feature/TreeEditor/image/ManageImageDrawer.vue.d.ts +18 -2
  45. package/dist/apps/mf-menu/src/components/feature/TreeEditor/image/ProductImageField.vue.d.ts +15 -0
  46. package/dist/apps/mf-menu/src/manager/menu/itemOverrider.d.ts +17 -0
  47. package/dist/apps/mf-menu/src/stores/manager/item.d.ts +0 -1
  48. package/dist/apps/mf-menu/src/views/Catalog/Edit/AddProductPopup/ProductDetail.vue.d.ts +9 -3
  49. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  50. package/dist/assets/{override-menu-C21YmN7u.js → linked-status-C8NLd-zI.js} +4 -4
  51. package/dist/assets/{menu-export-MsUq-m6i.js → menu-export-hXupkCVZ.js} +4 -4
  52. package/dist/assets/{linked-status-Cy7U6MR7.js → override-menu-CwJOJV2k.js} +4 -4
  53. package/dist/assets/{validate-menu-DO2qd1Ls.js → validate-menu-BrXEl7Mi.js} +4 -4
  54. package/dist/{catalog-CZzcvExG.js → catalog-L2sdRcQf.js} +1 -1
  55. package/dist/{catalogSetting-3iBsVbtC.js → catalogSetting-CGSmZhMj.js} +1 -1
  56. package/dist/{currency-C3o78W2S.js → currency-QIXheiUu.js} +1 -1
  57. package/dist/{dayjs.min-rFrrfcXf.js → dayjs.min-CGH3EzsL.js} +2 -2
  58. package/dist/{discardConfirm-DsprInGX.js → discardConfirm-B61hQjlH.js} +1 -1
  59. package/dist/{index-CyeAgLyq.js → index-CUcUva0h.js} +6 -6
  60. package/dist/{index-DSIKxrZZ.js → index-DCSeBwkM.js} +5 -5
  61. package/dist/{index.vue_vue_type_script_setup_true_lang-DKab6bV3.js → index.vue_vue_type_script_setup_true_lang-BVBi4Vvc.js} +6 -6
  62. package/dist/{item-BbwU7bUM.js → item-BMyRZqY8.js} +4416 -4405
  63. package/dist/{jszip.min-B8gSnxra.js → jszip.min-BaD6pNmW.js} +3 -3
  64. package/dist/{linkProducts-DqErRFMk.js → linkProducts-CqH6KCgg.js} +4 -4
  65. package/dist/{memberPricing-BwmMrsfo.js → memberPricing-DNAuPva3.js} +1 -1
  66. package/dist/{menu-umI9Z6Bd.js → menu-BNrZkzpK.js} +1 -1
  67. package/dist/{menuV2-Btcob7OV.js → menuV2-D1bGhwPG.js} +267 -262
  68. package/dist/mf-menu.css +1 -1
  69. package/dist/{order_pacing-ByU4f3cV.js → order_pacing-CmC9xxja.js} +5 -5
  70. package/dist/{priceTier-vHrePqH1.js → priceTier-DZ5JRGkT.js} +1 -1
  71. package/dist/{rules-B4FvBggj.js → rules-B2yeUFyY.js} +3 -3
  72. package/dist/{scheduler-1ZBJNxij.js → scheduler-DVKJQGbT.js} +5 -5
  73. package/dist/{toExcel-C8Nsh1v6.js → toExcel-D8feJ9ZC.js} +2 -2
  74. package/dist/{unit-RNGe0YzY.js → unit-DI5JogzR.js} +3 -3
  75. package/package.json +1 -1
@@ -1,20 +1,24 @@
1
- var We = Object.defineProperty;
2
- var Le = (e, t, n) => t in e ? We(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var ne = (e, t, n) => Le(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { l as ae } from "./discardConfirm-DsprInGX.js";
5
- import { defineStore as qe } from "pinia";
6
- import { shallowRef as N, ref as H, computed as S, shallowReactive as ze, effectScope as He, watch as Be } from "vue";
7
- import { f as ue, d as C, m as T, k as ie, aj as re, g as B, O as x, c as L, s as D, 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-DKab6bV3.js";
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-B61hQjlH.js";
5
+ import { defineStore as ze } from "pinia";
6
+ import { shallowRef as N, ref as H, computed as S, shallowReactive as qe, 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 D, 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-BVBi4Vvc.js";
8
8
  import { useCoreStore as se } from "@feedmepos/mf-common";
9
9
  import { useSnackbar as tt } from "@feedmepos/ui-library";
10
- const nt = "/assets/linked-status-Cy7U6MR7.js", rt = "/assets/override-menu-C21YmN7u.js";
11
- function ot(e) {
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-C8NLd-zI.js", ot = "/assets/override-menu-CwJOJV2k.js";
16
20
  function st(e, t, n, s) {
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), {});
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
23
  const v = e.map((p) => p._id);
20
24
  return [
@@ -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(c == null ? void 0 : c.items).map((f) => ({
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
- }, o.modules.catalog = [...d, a], o) : a ? (a.override.items = {
39
+ }, r.modules.catalog = [...d, a], r) : a ? (a.override.items = {
36
40
  ...a.override.items,
37
41
  ...g
38
- }, o.modules.catalog = [...d, a], o) : c ? (c.items = y(c.items), o.modules.scheduler = [
39
- ...o.modules.scheduler.filter((f) => f._id !== s),
40
- c
41
- ], o) : {
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: o.modules.catalog,
46
- item: o.modules.item,
47
- group: o.modules.group,
48
- scheduler: o.modules.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: o._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((l) => l._id === e._id);
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 o = (u = s.groups) == null ? void 0 : u.map((l) => {
60
- var c, g, y;
61
- const a = (c = e == null ? void 0 : e.groups) == null ? void 0 : c.find((f) => f._id === l._id);
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 = l.items) == null ? void 0 : g.map((f) => {
67
+ return a ? d = ((g = c.items) == null ? void 0 : g.map((f) => {
64
68
  var p;
65
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 = l.items) == null ? void 0 : y.map((f) => F(f, t, n + 1))) ?? [], {
70
- ...l,
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: o
83
+ groups: r
80
84
  };
81
85
  }
82
86
  function at(e, t) {
83
87
  const n = e.groups.map((u) => {
84
- const l = t.modules.group.find((d) => d._id === u._id), a = ((l == null ? void 0 : l.items) || []).map((d) => {
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 c = (y = u.items) == null ? void 0 : y.find(
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 (c)
90
- return F(c, t, 1);
93
+ if (l)
94
+ return F(l, t, 1);
91
95
  const g = {
92
96
  ...T.generator.initMenuV4ItemOverrider(),
93
97
  _id: d._id,
@@ -96,148 +100,148 @@ 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)) : [], o = {
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, o];
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((o) => {
114
- var l, a;
115
- const u = (l = t.groups) == null ? void 0 : l.find((d) => d._id === o._id);
116
- return o.items = (a = o.items) == null ? void 0 : a.map((d) => {
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 c = (g = u == null ? void 0 : u.items) == null ? void 0 : g.find(
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, c);
122
- }), o;
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((o) => {
133
+ variantCombinations: t.variant.variantCombinations.map((r) => {
130
134
  const u = n.find(
131
- (l) => l._id === o._id && l.combinationKey === o.combinationKey
135
+ (c) => c._id === r._id && c.combinationKey === r.combinationKey
132
136
  );
133
137
  if (!u)
134
- throw new Error(`Item overrider not found - ${o._id} - ${o.combinationKey}`);
135
- return G(u, o);
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((o) => !o.combinationKey);
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((o) => {
142
- var l;
143
- const u = t.groups.find((a) => a._id === o._id);
144
- return o.items = (l = o.items) == null ? void 0 : l.map((a) => {
145
- var c;
146
- const d = (c = u == null ? void 0 : u.items) == null ? void 0 : c.find(
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
- }), o;
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 Dt(e, t, n, s, o, u = !0) {
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) => {
160
+ async function Dt(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: c,
166
+ items: l,
163
167
  catalogId: s || void 0,
164
- schedulerId: o
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 || o ? v == null ? void 0 : v.category : null
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((o, u) => {
181
+ return ((n == null ? void 0 : n.reduce((r, u) => {
178
182
  if (u && u.length > 0) {
179
- const l = `variant${u.split("/")[0]}`, a = u.split("/")[1], c = t.find(
180
- ({ _id: g }) => g === l
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
- o.push(((c == null ? void 0 : c.name) || "").trim());
186
+ r.push(((l == null ? void 0 : l.name) || "").trim());
183
187
  }
184
- return o;
188
+ return r;
185
189
  }, [])) || []).join(" / ");
186
190
  }
187
- const q = /* @__PURE__ */ new Map();
191
+ const z = /* @__PURE__ */ new Map();
188
192
  async function Kt(e, t) {
189
193
  const n = `${e._id}-${e.updatedAt}-${t}`;
190
- if (q.has(n))
191
- return q.get(n);
194
+ if (z.has(n))
195
+ return z.get(n);
192
196
  const s = await ue(
193
- nt,
197
+ rt,
194
198
  JSON.stringify({
195
199
  menu: e,
196
200
  itemId: t
197
201
  })
198
202
  );
199
- return q.set(n, s), s;
203
+ return z.set(n, s), s;
200
204
  }
201
205
  async function ce(e, t, n) {
202
- return await ue(rt, {
206
+ return await ue(ot, {
203
207
  menu: e,
204
208
  catalogId: t,
205
209
  schedulerId: n
206
210
  });
207
211
  }
208
- const z = /* @__PURE__ */ new Map();
212
+ const q = /* @__PURE__ */ new Map();
209
213
  async function it(e, t, n) {
210
214
  const s = `${e._id}-${e.updatedAt}-${t || "null"}-${n || "null"}`;
211
- if (z.has(s))
212
- return z.get(s);
213
- const o = await ce(e, t, n);
214
- return z.set(s, o), o;
215
+ if (q.has(s))
216
+ return q.get(s);
217
+ const r = await ce(e, t, n);
218
+ return q.set(s, r), r;
215
219
  }
216
220
  async function Pt(e, t, n) {
217
- var l, a;
218
- const s = await it(e, t, null), o = [], u = (d, c) => {
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 c)
221
- c[y] && (g[y] = c[y]);
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 c = (l = d.items) == null ? void 0 : l.find((y) => y._id === n && !y.combinationKey), g = e.modules.item.find((y) => y._id === n);
226
- if (c) {
227
- const y = (a = d.items) == null ? void 0 : a.filter((v) => v._id === n && v.combinationKey), f = [c, ...y].map((v) => {
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
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
235
  ) : g, b = p && g ? u(g, p) : v;
232
236
  return u(b, v);
233
237
  });
234
- o.push({
238
+ r.push({
235
239
  group: d,
236
240
  items: f
237
241
  });
238
242
  }
239
243
  }
240
- return o;
244
+ return r;
241
245
  }
242
246
  const w = 0, K = 3;
243
247
  function ct(e) {
@@ -284,37 +288,37 @@ 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 o of n)
288
- if (!Object.prototype.hasOwnProperty.call(t, o) || !P(e[o], t[o])) return !1;
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, o = t.length, u = /* @__PURE__ */ new Map();
295
- for (let d = 0; d < o; d++) {
296
- const c = n ? n(t[d]) : JSON.stringify(t[d]);
297
- u.has(c) || u.set(c, []), u.get(c).push(d);
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 l = [], a = /* @__PURE__ */ new Set();
303
+ const c = [], a = /* @__PURE__ */ new Set();
300
304
  for (let d = 0; d < s; d++) {
301
- const c = e[d], g = n ? n(c) : JSON.stringify(c), y = u.get(g);
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(c, t[f])) {
305
- l.push({ leftIndex: d, rightIndex: f }), a.add(f);
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 l;
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" }, 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;
316
- let a = o ? lt(e, t, l) : [];
317
- if (!l && e.length === t.length && e.length > 0 && a.length < e.length) {
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) {
318
322
  const p = E(e[0]) || Array.isArray(e[0]), b = a.length > 0;
319
323
  if (p || b) {
320
324
  a = [];
@@ -323,14 +327,14 @@ function dt(e, t, n) {
323
327
  }
324
328
  }
325
329
  new Set(a.map((p) => p.leftIndex));
326
- const d = new Set(a.map((p) => p.rightIndex)), c = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
330
+ const d = new Set(a.map((p) => p.rightIndex)), l = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
327
331
  for (const p of a)
328
- c.set(p.leftIndex, p.rightIndex), g.set(p.rightIndex, p.leftIndex);
332
+ l.set(p.leftIndex, p.rightIndex), g.set(p.rightIndex, p.leftIndex);
329
333
  for (let p = 0; p < e.length; p++) {
330
- const b = c.get(p);
334
+ const b = l.get(p);
331
335
  if (b !== void 0) {
332
336
  const M = J(e[p], t[b], n);
333
- if (M !== void 0 && (s[b] = M), o && b !== p) {
337
+ if (M !== void 0 && (s[b] = M), r && b !== p) {
334
338
  const I = `_${p}`, k = u ? [e[p], b, K] : ["", b, K];
335
339
  s[I] = k;
336
340
  }
@@ -347,18 +351,18 @@ function dt(e, t, n) {
347
351
  }
348
352
  function mt(e, t, n) {
349
353
  if (P(e, t)) return;
350
- const s = {}, o = Object.keys(e), u = Object.keys(t), l = /* @__PURE__ */ new Set([...o, ...u]);
351
- for (const a of l) {
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), c = Object.prototype.hasOwnProperty.call(t, a);
355
- if (d && c) {
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 && !c) {
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 && c && (s[a] = [t[a]]);
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, l = n != null && n.cloneDiffValues ? O(t) : t;
380
- return [$(u), $(l)];
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(), o = /* @__PURE__ */ new Map();
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)), c = t[a];
390
- Array.isArray(c) && (c.length === 3 && c[2] === w ? s.add(d) : c.length === 3 && c[2] === K && o.set(d, c[1]));
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 l = 0;
397
+ let c = 0;
394
398
  for (let a = 0; ; a++) {
395
- const d = a.toString(), c = t[d];
396
- if (c !== void 0)
397
- if (Array.isArray(c) && c.length === 1)
398
- u.push(c[0]);
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 (; l < e.length && s.has(l); )
401
- l++;
402
- l < e.length && (u.push(Y(e[l], c)), l++);
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 o.entries())
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 (; l < e.length && (s.has(l) || o.has(l)); )
413
- l++;
414
- if (l < e.length)
415
- u.push(e[l]), l++;
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 o in t) {
426
- const u = t[o];
427
- Array.isArray(u) ? u.length === 1 ? s[o] = u[0] : u.length === 3 && u[2] === w ? delete s[o] : u.length === 2 && (s[o] = u[1]) : s[o] = Y(s[o], u);
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,21 +452,21 @@ 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)), o = e[n];
452
- if (Array.isArray(o)) {
453
- if (o.length === 3 && o[2] === w)
454
- t[s] = [o[0]];
455
- else if (o.length === 3 && o[2] === K) {
456
- const u = o[1];
457
- t[`_${u}`] = [o[0], s, K];
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), o = e[n];
462
- if (Array.isArray(o) && o.length === 1)
463
- t[`_${s}`] = [o[0], w, w];
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(o);
469
+ const u = Q(r);
466
470
  u !== void 0 && (t[n] = u);
467
471
  }
468
472
  }
@@ -475,8 +479,8 @@ function pt(e) {
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 o = Q(s);
479
- o !== void 0 && (t[n] = o);
482
+ const r = Q(s);
483
+ r !== void 0 && (t[n] = r);
480
484
  }
481
485
  }
482
486
  return t;
@@ -537,19 +541,19 @@ function bt({
537
541
  includeValueOnMove: !1
538
542
  },
539
543
  cloneDiffValues: !1
540
- }), n = N(null), s = N([]), o = H(-1), u = N(null), l = S(() => o.value > 0), a = S(() => o.value < s.value.length - 1);
544
+ }), n = N(null), s = N([]), r = H(-1), u = N(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 }], o.value = 0;
547
+ n.value = C(v), u.value = C(v), s.value = [{ delta: null }], r.value = 0;
544
548
  return;
545
549
  }
546
550
  const p = 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: p }), o.value++, u.value = C(v), s.value.length > e) {
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(), o.value--;
553
+ b && n.value && (n.value = t.patch(C(n.value), b)), s.value.shift(), r.value--;
550
554
  }
551
555
  }
552
- function c(v) {
556
+ function l(v) {
553
557
  if (!n.value || v < 0 || v >= s.value.length)
554
558
  return;
555
559
  let p = C(n.value);
@@ -560,25 +564,25 @@ function bt({
560
564
  return p;
561
565
  }
562
566
  function g() {
563
- if (l.value) {
564
- o.value--;
565
- const v = c(o.value);
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
- o.value++;
572
- const v = c(o.value);
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 = [], o.value = -1;
581
+ n.value = null, u.value = null, s.value = [], r.value = -1;
578
582
  }
579
583
  return {
580
584
  push: d,
581
- canUndo: l,
585
+ canUndo: c,
582
586
  canRedo: a,
583
587
  undo: g,
584
588
  redo: y,
@@ -635,39 +639,39 @@ function wt() {
635
639
  }
636
640
  };
637
641
  }
638
- const $t = qe(
642
+ const $t = ze(
639
643
  "mf-menu-store-v2",
640
644
  () => {
641
- const e = ze(wt()), t = se(), n = tt(), s = S(() => e.menu.modules.serveSequence ? x(e.menu.modules.serveSequence, {
645
+ const e = qe(wt()), t = se(), n = tt(), s = S(() => e.menu.modules.serveSequence ? x(e.menu.modules.serveSequence, {
642
646
  selector: "position"
643
- }) : []), o = S(() => {
644
- var r;
645
- return ((r = t.currentBusiness.value) == null ? void 0 : r.menuVersion) || L.F_MENU_VERSION.v3;
646
- }), u = S(() => o.value === L.F_MENU_VERSION.v4), l = S(() => {
647
- const r = e.menu.modules.catalog;
648
- return x(r, { selector: "name" });
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 r = e.menu.modules.catalog.find(
655
+ let o = e.menu.modules.catalog.find(
652
656
  (m) => m._id === e.currentCatalogId
653
657
  );
654
- return r && ((i = r.linkItemRules) != null && i.length) && (r = T.populateCatalog({
655
- catalog: r,
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
- })), r;
660
- }), d = S(() => x(y.value.modules.scheduler, { selector: "name" })), c = S(() => e.menu.modules.scheduler.find(
661
- (r) => r._id === e.currentSchedulerId
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(r, i = !0) {
664
- e.menu = { ...r, _rev: e.menu._rev }, i && V.push(e.menu);
667
+ function g(o, i = !0) {
668
+ e.menu = { ...o, _rev: e.menu._rev }, i && V.push(e.menu);
665
669
  }
666
670
  const y = N(me()), f = H(!1), v = H(1);
667
671
  async function p() {
668
672
  var m;
669
673
  f.value = !0;
670
- let r = e.menu.modules.catalog;
674
+ let o = e.menu.modules.catalog;
671
675
  if (a.value && ((m = a.value.linkItemRules) != null && m.length)) {
672
676
  const h = T.populateCatalog({
673
677
  catalog: a.value,
@@ -675,14 +679,14 @@ const $t = qe(
675
679
  items: e.menu.modules.item,
676
680
  ...e.currentRestaurantAttrParams ?? {}
677
681
  });
678
- r = e.menu.modules.catalog.map((_) => _._id === (h == null ? void 0 : h._id) ? h : _);
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: r
689
+ catalog: o
686
690
  }
687
691
  },
688
692
  e.currentCatalogId,
@@ -714,12 +718,12 @@ const $t = qe(
714
718
  label: "Main",
715
719
  value: null
716
720
  },
717
- ...l.value.map((r) => ({
718
- label: r.name,
719
- value: r._id
721
+ ...c.value.map((o) => ({
722
+ label: o.name,
723
+ value: o._id
720
724
  }))
721
725
  ]), Z = S(() => {
722
- const r = y.value.modules.category;
726
+ const o = y.value.modules.category;
723
727
  return [
724
728
  ...U.value.item.addon ? [
725
729
  {
@@ -728,17 +732,17 @@ const $t = qe(
728
732
  position: 0
729
733
  }
730
734
  ] : [],
731
- ...D(r, (i) => i.name)
735
+ ...D(o, (i) => i.name)
732
736
  ];
733
737
  }), ve = S(() => {
734
- const r = y.value.modules.subCategory || [];
735
- return D(r, (i) => i.name);
738
+ const o = y.value.modules.subCategory || [];
739
+ return D(o, (i) => i.name);
736
740
  }), ee = S(() => {
737
741
  var i;
738
- let r = y.value.modules.item;
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
- r = r.filter((h) => {
745
+ o = o.filter((h) => {
742
746
  var A;
743
747
  const _ = (A = m == null ? void 0 : m[h._id]) == null ? void 0 : A.find(
744
748
  (R) => !R.combinationKey
@@ -746,9 +750,9 @@ const $t = qe(
746
750
  return (_ == null ? void 0 : _.orderFrom) !== ie.enum.NONE;
747
751
  });
748
752
  }
749
- return D(r, (m) => m.code || m.name);
753
+ return D(o, (m) => m.code || m.name);
750
754
  }), ye = S(() => {
751
- const r = e.menu.modules.category, i = D(r, (h) => h.name).reduce(
755
+ const o = e.menu.modules.category, i = D(o, (h) => h.name).reduce(
752
756
  (h, _, A) => (h[_._id] = A, h),
753
757
  { "": 0 }
754
758
  ), m = e.menu.modules.item;
@@ -757,7 +761,7 @@ const $t = qe(
757
761
  (h) => h.code || h.name
758
762
  ).reduce((h, _, A) => (h[_._id] = A + i[_.category || ""], h), {});
759
763
  }), ge = S(() => oe(j.value, Z.value, ee.value)), pe = S(() => {
760
- const r = U.value.item.addon ? [
764
+ const o = U.value.item.addon ? [
761
765
  {
762
766
  _id: e.currentCatalogId ? "" : null,
763
767
  name: "Addon",
@@ -767,70 +771,70 @@ const $t = qe(
767
771
  ] : e.menu.modules.category;
768
772
  return oe(
769
773
  e.menu.modules.variant,
770
- r,
774
+ o,
771
775
  e.menu.modules.item
772
776
  );
773
777
  }), j = S(() => {
774
- const r = y.value.modules.variant;
775
- return x(r, { selector: "name" });
778
+ const o = y.value.modules.variant;
779
+ return x(o, { selector: "name" });
776
780
  });
777
- function he(r = []) {
778
- const i = r.map((h) => j.value.find((_) => _._id === h)).filter((h) => !!h);
781
+ function he(o = []) {
782
+ const i = o.map((h) => j.value.find((_) => _._id === h)).filter((h) => !!h);
779
783
  return T.fullVariantCombination(i).reduce((h, _) => (h[_.combinationKey] = _.selectionName.join(" / "), h), {});
780
784
  }
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 || [], {
785
+ const _e = S(() => D(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 r = Je(e.menu.modules.sku);
787
- return x(r, { selector: "code" });
790
+ const o = Je(e.menu.modules.sku);
791
+ return x(o, { selector: "code" });
788
792
  }), Ie = S(() => {
789
- const r = /* @__PURE__ */ new Map();
793
+ const o = /* @__PURE__ */ new Map();
790
794
  return e.menu.modules.item.forEach((i) => {
791
795
  var m, h;
792
- i.code && r.set(i.code, (r.get(i.code) || 0) + 1), (h = (m = i.variant) == null ? void 0 : m.variantCombinations) == null || h.forEach((_) => {
793
- _.code && r.set(_.code, (r.get(_.code) || 0) + 1);
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
- }), r;
799
+ }), o;
796
800
  }), U = S(() => {
797
- const r = !e.currentCatalogId, i = o.value === L.F_MENU_VERSION.v4, m = !e.currentSchedulerId, h = {
798
- create: r && m,
799
- edit: r && m,
800
- delete: r && m
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 && r && m,
810
+ sort: i && o && m,
807
811
  addon: i,
808
812
  code: m,
809
- name: r && m,
810
- description: r && m,
813
+ name: o && m,
814
+ description: o && m,
811
815
  category: m,
812
- thumbnail: r && m,
813
- images: r && m,
814
- orderFrom: (i || r) && m,
815
- orderFromNone: r,
816
+ thumbnail: o && m,
817
+ images: o && m,
818
+ orderFrom: (i || o) && m,
819
+ orderFromNone: o,
816
820
  orderFromActiveOnly: !i,
817
- openPrice: r && m,
818
- unit: r && m,
819
- price: r,
820
- editPrice: r,
821
+ openPrice: o && m,
822
+ unit: o && m,
823
+ price: o,
824
+ editPrice: o,
821
825
  minPrice: i && m,
822
- costing: i && r && m,
823
- tax: r && m,
824
- variant: r && m,
826
+ costing: i && o && m,
827
+ tax: o && m,
828
+ variant: o && m,
825
829
  maxVariant: i ? 4 : 2,
826
- group: r && m,
830
+ group: o && m,
827
831
  overrideProductGroup: i && m,
828
- inventory: (i || r) && m,
832
+ inventory: (i || o) && m,
829
833
  bindToVariant: i,
830
- print: r && m,
834
+ print: o && m,
831
835
  toRoot: i && m,
832
- takeaway: (_) => !!_ && (i || r) && m,
833
- serveDelay: i && r && m,
836
+ takeaway: (_) => !!_ && (i || o) && m,
837
+ serveDelay: i && o && m,
834
838
  multiScheduler: i,
835
839
  canRearrange: i,
836
840
  printConfig: i,
@@ -838,14 +842,14 @@ const $t = qe(
838
842
  },
839
843
  category: {
840
844
  ...h,
841
- sort: r,
845
+ sort: o,
842
846
  overrideSequence: i
843
847
  },
844
848
  group: {
845
849
  ...h,
846
850
  edit: i || m,
847
- sort: r,
848
- applyProduct: r,
851
+ sort: o,
852
+ applyProduct: o,
849
853
  showAppliedProduct: m,
850
854
  type: !i,
851
855
  insertRawItems: !i,
@@ -857,33 +861,33 @@ const $t = qe(
857
861
  },
858
862
  takeaway: {
859
863
  ...h,
860
- edit: (i || r) && m,
861
- name: r
864
+ edit: (i || o) && m,
865
+ name: o
862
866
  },
863
867
  catalog: {
864
- name: !r,
868
+ name: !o,
865
869
  defaultOrderFrom: i,
866
870
  markup: i
867
871
  }
868
872
  };
869
873
  });
870
- function W(r) {
871
- return `${r.systemCode}/${r.taxCode}`;
874
+ function L(o) {
875
+ return `${o.systemCode}/${o.taxCode}`;
872
876
  }
873
- function ke(r) {
874
- const [i, m] = r.split("/");
877
+ function ke(o) {
878
+ const [i, m] = o.split("/");
875
879
  return { systemCode: i, taxCode: m };
876
880
  }
877
- function Ee(r, i, m) {
878
- return (r ?? i ?? []).map((h) => W(h)).find((h) => m.some((_) => _.value === h));
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
885
  var h;
882
- const r = ["SV5", "SV10"], i = Ye.Country.getCountryFlattenTaxes(
886
+ const o = ["SV5", "SV10"], i = Ye.Country.getCountryFlattenTaxes(
883
887
  se().currentCountry.value
884
- ), m = i.filter((_) => u.value || !r.includes(_.taxCode)).map((_) => ({
888
+ ), m = i.filter((_) => u.value || !o.includes(_.taxCode)).map((_) => ({
885
889
  label: `${_.name} (${Qe(_.rate)}%)`,
886
- value: W(_),
890
+ value: L(_),
887
891
  meta: {
888
892
  rate: _.rate
889
893
  }
@@ -893,29 +897,29 @@ const $t = qe(
893
897
  countryTaxOptions: m
894
898
  };
895
899
  }), xe = async () => {
896
- const r = await et.readMenu();
897
- e.menu = r ?? e.menu, te(null);
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: r } = Ze();
904
- await r({
907
+ const { fetchAllRestaurants: o } = Ze();
908
+ await o({
905
909
  onBatchEnd: (i) => {
906
910
  e.restaurants = i;
907
911
  }
908
912
  });
909
- }, te = (r) => {
910
- e.currentCatalogId = r;
911
- }, Ve = (r) => {
912
- e.currentSchedulerId = r;
913
- }, De = (r) => {
914
- e.currentCategoryIds = r;
915
- }, Te = (r) => {
916
- e.currentRestaurantAttrParams = r;
917
- }, Ke = async (r, i) => {
918
- const m = Array.isArray(r) ? r : [r];
913
+ }, te = (o) => {
914
+ e.currentCatalogId = o;
915
+ }, Ve = (o) => {
916
+ e.currentSchedulerId = o;
917
+ }, De = (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
924
  const h = m.map((_) => ({
921
925
  ..._,
@@ -938,20 +942,20 @@ const $t = qe(
938
942
  message: _
939
943
  });
940
944
  }
941
- }, Pe = async (r) => {
945
+ }, Pe = async (o) => {
942
946
  const i = {
943
947
  ...e.menu,
944
- masterCatalogSetting: r.masterCatalogSetting,
945
- lowStockThreshold: r.lowStockThreshold,
946
- priceTierSettings: r.priceTierSettings
948
+ masterCatalogSetting: o.masterCatalogSetting,
949
+ lowStockThreshold: o.lowStockThreshold,
950
+ priceTierSettings: o.priceTierSettings
947
951
  };
948
952
  return g(i), i;
949
953
  }, V = bt({ maxHistorySize: 50 }), $e = S(() => V.canUndo.value), Fe = S(() => V.canRedo.value), Ne = () => {
950
- const r = V.undo();
951
- r && g(r, !1);
954
+ const o = V.undo();
955
+ o && g(o, !1);
952
956
  }, je = () => {
953
- const r = V.redo();
954
- r && g(r, !1);
957
+ const o = V.redo();
958
+ o && g(o, !1);
955
959
  }, Ue = () => {
956
960
  V.clear();
957
961
  };
@@ -963,13 +967,13 @@ const $t = qe(
963
967
  // async computed state
964
968
  mergedMenu: y,
965
969
  // Computed
966
- version: o,
970
+ version: r,
967
971
  isV4: u,
968
972
  serveSequence: s,
969
- catalogs: l,
973
+ catalogs: c,
970
974
  currentCatalog: a,
971
975
  schedulers: d,
972
- currentScheduler: c,
976
+ currentScheduler: l,
973
977
  catalogOptions: fe,
974
978
  categories: Z,
975
979
  subcategories: ve,
@@ -1000,7 +1004,7 @@ const $t = qe(
1000
1004
  updateMenuSetting: Pe,
1001
1005
  computeMergedMenu: p,
1002
1006
  // helper
1003
- encodeTax: W,
1007
+ encodeTax: L,
1004
1008
  decodeTax: ke,
1005
1009
  getSelectedTax: Ee,
1006
1010
  mapVariant: he,
@@ -1023,6 +1027,7 @@ export {
1023
1027
  Kt as a,
1024
1028
  Pt as f,
1025
1029
  Tt as g,
1030
+ nt as i,
1026
1031
  Dt as m,
1027
1032
  it as o,
1028
1033
  $t as u