@feedmepos/mf-menu 0.32.50-dev.1 → 0.32.52-dev

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 (77) hide show
  1. package/dist/{App-fvdXsBmD.js → App-COGal-TD.js} +497 -506
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-DH4-Olmt.js → ApplyProduct.vue_vue_type_script_setup_true_lang-DzisSpvQ.js} +3 -3
  3. package/dist/{ApplyProductDialog.vue_vue_type_script_setup_true_lang-DzROC59N.js → ApplyProductDialog.vue_vue_type_script_setup_true_lang-eqJDqaPZ.js} +2 -2
  4. package/dist/{Catalog-jkEr63nT.js → Catalog-BJ8-NdAC.js} +8 -9
  5. package/dist/{Category-DrwaNYcu.js → Category-BkU2y10v.js} +5 -5
  6. package/dist/{Category-B_gO4xPF.js → Category-CFaPOouQ.js} +4 -4
  7. package/dist/{CookingGuide-C33Z5hUV.js → CookingGuide-BDDCmfeL.js} +5 -5
  8. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-Be7Z3I_Q.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-BcJYQo_p.js} +1 -1
  9. package/dist/{Group-BugcY3vS.js → Group-DBrJ4Rin.js} +1 -1
  10. package/dist/{Group-B5T6WfRm.js → Group-Sk7Qd6G3.js} +4 -4
  11. package/dist/{Group.vue_vue_type_script_setup_true_lang-BAIexmig.js → Group.vue_vue_type_script_setup_true_lang-BWpIG76a.js} +7 -7
  12. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BOQahWyN.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-DzeAE7Oj.js} +5 -5
  13. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-YS1YynNn.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-DWScWkMg.js} +10 -10
  14. package/dist/{Ingredient-DJVD7ZRE.js → Ingredient-CA0qoRc1.js} +4 -4
  15. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-CXFhzaMf.js → InventoryBinding.vue_vue_type_script_setup_true_lang-BzLcfi4f.js} +2 -2
  16. package/dist/{LinkProductSideSheet-CzpnAdjg.js → LinkProductSideSheet-TTj7qiWm.js} +3 -3
  17. package/dist/{MenuSetting-CkzrUn-g.js → MenuSetting-DwfE7v0B.js} +9 -9
  18. package/dist/{OrderPacing-E25vzd0i.js → OrderPacing-cT1Vs3OD.js} +6 -6
  19. package/dist/{PageLayout.vue_vue_type_script_setup_true_lang-BFxSjqqP.js → PageLayout.vue_vue_type_script_setup_true_lang-BVmHMvKD.js} +2 -2
  20. package/dist/{PrintRoute-D_E6EFdK.js → PrintRoute-D8pc6M31.js} +5 -5
  21. package/dist/{Product-B65o3iNI.js → Product-CW1oQzS-.js} +1 -1
  22. package/dist/{Product.vue_vue_type_script_setup_true_lang-DPzs_gu_.js → Product.vue_vue_type_script_setup_true_lang-lqXctN9S.js} +12 -12
  23. package/dist/{ProductInternalTools-CK-PGnNo.js → ProductInternalTools-DAIu8IhO.js} +6 -6
  24. package/dist/{Products-Dg1hvUwW.js → Products-nVL6Qsuw.js} +131 -128
  25. package/dist/Publish-DHEzIG_J.js +1434 -0
  26. package/dist/{Recipe-DIF_OoVX.js → Recipe-BLcLaekI.js} +5 -5
  27. package/dist/{RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-845QukTh.js → RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-BCHurASV.js} +1 -1
  28. package/dist/{RuleView.vue_vue_type_script_setup_true_lang-DjKbPdjk.js → RuleView.vue_vue_type_script_setup_true_lang-Dwi3pOl9.js} +2 -2
  29. package/dist/{Scheduler-Cp16XDHA.js → Scheduler-C4e5hO7Z.js} +4 -4
  30. package/dist/{ServingSequence-HG1Uq8jR.js → ServingSequence-C12Ny_nR.js} +4 -4
  31. package/dist/{Setting-BjmlJwG0.js → Setting-BscTehhJ.js} +5 -5
  32. package/dist/{Subcategory-COSfYpK6.js → Subcategory-C5FGoPot.js} +6 -6
  33. package/dist/{Takeaway-xH6lMjQI.js → Takeaway-CDSKNUhc.js} +1 -1
  34. package/dist/{Takeaway-8UTX6xY6.js → Takeaway-Dr6WQVE1.js} +5 -5
  35. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-DEnn6Uhy.js → Takeaway.vue_vue_type_script_setup_true_lang-C6eREsQp.js} +5 -5
  36. package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-C12J-MHi.js → Thumbnail.vue_vue_type_script_setup_true_lang-CkETUziX.js} +4 -4
  37. package/dist/{TranslationFieldSection.vue_vue_type_script_setup_true_lang-CyAvat5t.js → TranslationFieldSection.vue_vue_type_script_setup_true_lang-CcD-TGhd.js} +1 -1
  38. package/dist/{TranslationSideSheet.vue_vue_type_script_setup_true_lang-DUfRksjD.js → TranslationSideSheet.vue_vue_type_script_setup_true_lang-DccUYmCx.js} +2 -2
  39. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-C8RYs2oh.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-D1ov0odP.js} +937 -940
  40. package/dist/{Unit-B0LxjfWX.js → Unit-U3pz6pPm.js} +3 -3
  41. package/dist/{Variant-CPBzZOv3.js → Variant-D-nC4Dy6.js} +26 -30
  42. package/dist/{_id_-CM7JtSii.js → _id_-DHI7NeZ5.js} +10 -10
  43. package/dist/{app-DtexRwSb.js → app-Brq8nN4D.js} +1 -1
  44. package/dist/{app-yVJIrlSz.js → app-dIGG83GF.js} +185 -185
  45. package/dist/app.js +1 -1
  46. package/dist/apps/mf-menu/src/app.d.ts +7 -0
  47. package/dist/apps/mf-menu/src/components/member_price/MemberPriceToolTip.vue.d.ts +2 -0
  48. package/dist/apps/mf-menu/src/helper/setting/catalogSetting.d.ts +2 -1
  49. package/dist/apps/mf-menu/src/manager/menu/memberPricing.d.ts +4 -1
  50. package/dist/apps/mf-menu/src/stores/menu.d.ts +1 -1
  51. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  52. package/dist/assets/{linked-status-CbCxRkaM.js → linked-status-C-sgTOx9.js} +2 -2
  53. package/dist/assets/{menu-export-BrLAkWSp.js → menu-export-Nt98HUsd.js} +4 -4
  54. package/dist/assets/{override-menu-BrLa8Jm9.js → override-menu-Ako9Ghu_.js} +2 -2
  55. package/dist/assets/{validate-menu-CsSkhovY.js → validate-menu-CVJ4sdGa.js} +2 -2
  56. package/dist/{catalog-vPinxddm.js → catalog-BDfp-HKs.js} +1 -1
  57. package/dist/{catalogSetting-h7qqtQIw.js → catalogSetting-BjZWlJux.js} +26 -14
  58. package/dist/{currency-CcNf-QTk.js → currency-BMM0v_C-.js} +1 -1
  59. package/dist/{dayjs.min-Cocgeu87.js → dayjs.min-qRo56ggi.js} +2 -2
  60. package/dist/{index-H48-bCoT.js → index-Dnr_KMtS.js} +25 -25
  61. package/dist/{index-CCBv0ODD.js → index-DwsAtSPy.js} +4 -4
  62. package/dist/{index.vue_vue_type_script_setup_true_lang-BUccfB8b.js → index.vue_vue_type_script_setup_true_lang-BLHrxcy_.js} +4638 -4642
  63. package/dist/{item-BsZG_f4A.js → item-hYgXuH-R.js} +1178 -1177
  64. package/dist/{jszip.min-BnMXGnPr.js → jszip.min-BqsNpcIL.js} +3 -3
  65. package/dist/memberPricing-CXI5GqbJ.js +107 -0
  66. package/dist/{menu-Bw4tAzfN.js → menu-Okh_Q4gK.js} +1 -1
  67. package/dist/{menuV2-DI1Os0Vq.js → menuV2-DbTc7yw0.js} +26 -26
  68. package/dist/mf-menu.css +1 -1
  69. package/dist/{order_pacing-EeEkEnwJ.js → order_pacing-CBkQIrp3.js} +5 -5
  70. package/dist/{priceTier-BkoZvNui.js → priceTier-BxWXhfDh.js} +1 -1
  71. package/dist/{rules-Ou7rW1c3.js → rules-CsoPQCO5.js} +3 -3
  72. package/dist/{scheduler-DXQsrkEf.js → scheduler-BfvHQAuo.js} +4 -4
  73. package/dist/{toExcel-Dngn6umb.js → toExcel-DZMykkCy.js} +2 -2
  74. package/dist/{unit-BQ4FpCT5.js → unit-ro6UkV3c.js} +2 -2
  75. package/package.json +1 -1
  76. package/dist/Publish-DOZPb_5N.js +0 -1417
  77. package/dist/memberPricing-OCuDHRxA.js +0 -89
@@ -1,38 +1,38 @@
1
- import { ref as te, computed as O, getCurrentInstance as _n, render as hn, defineComponent as me, resolveComponent as H, createElementBlock as Z, openBlock as V, createBlock as oe, normalizeClass as we, createElementVNode as N, createVNode as c, unref as e, withCtx as B, toDisplayString as ve, mergeModels as Xt, useModel as Qt, createCommentVNode as ee, onMounted as Xe, resolveDirective as Jt, Fragment as Te, renderList as Ue, createTextVNode as wn, withDirectives as rt, renderSlot as Ge, h as ke, watch as Ve, nextTick as gt, vShow as Zt, withModifiers as Qe, createSlots as kn, onBeforeUnmount as Ot, watchEffect as Cn, onUnmounted as In, normalizeStyle as mt, mergeProps as xn, normalizeProps as Tn, guardReactiveProps as Sn, Teleport as En, Transition as Fn, withKeys as $n } from "vue";
2
- import { g as Vn, o as Pn, _ as Dn, a as On, f as Un, b as Mn, c as en, n as tn, I as An, S as Rn, d as Ut, e as Nn, C as Ln, h as Mt, i as At, j as Rt, k as nn, l as Et, m as on, p as Gn, q as Bn, F as Kn, M as rn, r as zn, s as jn, t as an, v as jt, w as ln, x as Yn, P as qn, y as Wn, z as sn, u as Hn, A as Xn, T as qe, B as Qn } from "./item-BsZG_f4A.js";
3
- import { a as Jn, b as Zn, d as eo, _ as to, T as no } from "./app-yVJIrlSz.js";
4
- import { z as Ce, J as Ee, K as xe, B as at, M as oo, N as ro, O as ao, u as vt, P as Nt, Q as lo, y as Ze, R as _e, A as Ke, T as io, U as ct, G as he, V as so, H as Fe, W as _t, X as un, Y as uo, Z as co, $ as mo, a0 as ht, a1 as Yt, a2 as po, a3 as fo } from "./index.vue_vue_type_script_setup_true_lang-BUccfB8b.js";
1
+ import { ref as te, computed as O, getCurrentInstance as _n, render as hn, defineComponent as me, resolveComponent as H, createElementBlock as Z, openBlock as V, createBlock as oe, normalizeClass as we, createElementVNode as N, createVNode as d, unref as e, withCtx as B, toDisplayString as ve, mergeModels as Xt, useModel as Qt, createCommentVNode as ee, onMounted as Xe, resolveDirective as Jt, Fragment as Te, renderList as Ue, createTextVNode as wn, withDirectives as rt, renderSlot as Ge, h as ke, watch as Ve, nextTick as gt, vShow as Zt, withModifiers as Qe, createSlots as kn, onBeforeUnmount as Ot, watchEffect as Cn, onUnmounted as In, normalizeStyle as mt, mergeProps as xn, normalizeProps as Tn, guardReactiveProps as Sn, Teleport as En, Transition as Fn, withKeys as $n } from "vue";
2
+ import { g as Vn, o as Pn, _ as Dn, a as On, f as Un, b as Mn, c as en, n as tn, I as An, S as Rn, d as Ut, e as Nn, C as Ln, h as Mt, i as At, j as Rt, k as nn, l as Et, m as on, p as Gn, q as Bn, F as Kn, M as rn, r as zn, s as jn, t as an, v as jt, w as ln, x as Yn, P as qn, y as Wn, z as sn, u as Hn, A as Xn, T as qe, B as Qn } from "./item-hYgXuH-R.js";
3
+ import { a as Jn, b as Zn, d as eo, _ as to, T as no } from "./app-dIGG83GF.js";
4
+ import { z as Ce, J as Ee, K as xe, B as at, M as oo, N as ro, O as ao, u as vt, P as Nt, Q as lo, y as Ze, R as _e, A as Ke, T as io, U as ct, G as he, V as so, H as Fe, W as _t, X as un, Y as uo, Z as co, $ as mo, a0 as ht, a1 as Yt, a2 as po, a3 as fo } from "./index.vue_vue_type_script_setup_true_lang-BLHrxcy_.js";
5
5
  import { useI18n as ye, useCoreStore as lt, CustomAttributesForm as dn } from "@feedmepos/mf-common";
6
6
  import { useDialog as ze, useDialogChild as Lt, useSnackbar as je, FmButtonColorThemeVariant as De, components as Ie, FmButtonVariant as Oe, useBreakpoints as go } from "@feedmepos/ui-library";
7
7
  import { u as Gt } from "./discardConfirm-BHni0LNu.js";
8
8
  import { defineStore as vo } from "pinia";
9
- import { _ as Pe, a as bo } from "./RuleView.vue_vue_type_script_setup_true_lang-DjKbPdjk.js";
10
- import { u as be, g as cn, m as yo } from "./menuV2-DI1Os0Vq.js";
9
+ import { _ as Pe, a as bo } from "./RuleView.vue_vue_type_script_setup_true_lang-Dwi3pOl9.js";
10
+ import { u as be, g as cn, m as yo } from "./menuV2-DbTc7yw0.js";
11
11
  import { s as Ft, _ as _o } from "./index-CisutoS9.js";
12
12
  import { useAppStore as mn, RemyButton as pn } from "@feedmepos/mf-remy-panel";
13
13
  import { _ as Ne } from "./FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js";
14
14
  import { c as ho } from "./createComponentProgrammatically-Bt2rn1IQ.js";
15
- import { _ as wo, a as ko, u as Co } from "./Thumbnail.vue_vue_type_script_setup_true_lang-C12J-MHi.js";
15
+ import { _ as wo, a as ko, u as Co } from "./Thumbnail.vue_vue_type_script_setup_true_lang-CkETUziX.js";
16
16
  import { _ as tt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
17
17
  import { _ as $t } from "./tooltip-B5BiPMx9.js";
18
18
  import { g as it } from "./translation-fNx6yEpy.js";
19
- import { _ as Je, T as Io, l as xo } from "./index-H48-bCoT.js";
20
- import { L as Vt } from "./LinkProductSideSheet-CzpnAdjg.js";
19
+ import { _ as Je, T as Io, l as xo } from "./index-Dnr_KMtS.js";
20
+ import { L as Vt } from "./LinkProductSideSheet-TTj7qiWm.js";
21
21
  import { u as To } from "./search-BAPEUu1R.js";
22
22
  import { c as Bt } from "./check-C9mY6LiX.js";
23
- import { f as Be } from "./currency-CcNf-QTk.js";
24
- import { u as Kt } from "./memberPricing-OCuDHRxA.js";
23
+ import { f as Be } from "./currency-BMM0v_C-.js";
24
+ import { u as Kt } from "./memberPricing-CXI5GqbJ.js";
25
25
  import { c as So } from "./string-DpfFixWH.js";
26
26
  import { useInventoryStore as Eo, InventoryBindingSummary as Fo } from "@feedmepos/mf-inventory-portal";
27
- import { u as $o } from "./priceTier-BkoZvNui.js";
27
+ import { u as $o } from "./priceTier-BxWXhfDh.js";
28
28
  import { d as zt } from "./vuedraggable-CK8z7qA8.js";
29
- import { _ as Vo } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-DH4-Olmt.js";
29
+ import { _ as Vo } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-DzisSpvQ.js";
30
30
  import "./app-5fxKLAzS.js";
31
31
  /* empty css */
32
32
  import { c as pt } from "./object-DVUNCr7w.js";
33
33
  import { _ as Po } from "./TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js";
34
34
  import { _ as qt } from "./MenuSelector.vue_vue_type_script_setup_true_lang-K6Z0QJBl.js";
35
- import { _ as Do } from "./RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-845QukTh.js";
35
+ import { _ as Do } from "./RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-BCHurASV.js";
36
36
  var et = /* @__PURE__ */ ((u) => (u.PRIMARY = "primary", u.PLAIN = "plain", u))(et || {}), Ae = /* @__PURE__ */ ((u) => (u.CATEGORY = "view_list", u.ITEM = "fastfood", u.VARIANT = "lunch_dining", u.GROUP = "database", u.FOLDER = "folder", u))(Ae || {});
37
37
  function wt(u, a) {
38
38
  return u <= 0 ? null : { label: a };
@@ -67,27 +67,27 @@ function Uo(u, a) {
67
67
  t.add(_.parent.id), _ = _.parent;
68
68
  }
69
69
  function p(r, _) {
70
- var C, f;
70
+ var I, f;
71
71
  if (_.length === 0 || !r)
72
72
  return r;
73
73
  const E = [
74
74
  r.label.toLowerCase(),
75
- (C = r.rightLabel) == null ? void 0 : C.label.toLowerCase(),
75
+ (I = r.rightLabel) == null ? void 0 : I.label.toLowerCase(),
76
76
  ...((f = r.chips) == null ? void 0 : f.map((n) => n.label.toLowerCase())) ?? []
77
77
  ].join(" "), m = _[0].query.every((n) => E.includes(n.toLowerCase()));
78
78
  m && _.slice(1).length === 0 && o(r);
79
- const b = m ? {
79
+ const g = m ? {
80
80
  ...r,
81
81
  highlightedStrings: _[0].query
82
82
  } : r;
83
83
  if (r.children && r.children.length > 0) {
84
84
  const n = r.children.map((S) => p(S, m ? _.slice(1) : _)).filter((S) => !!S);
85
85
  return n.length > 0 ? {
86
- ...b,
86
+ ...g,
87
87
  children: n
88
88
  } : null;
89
89
  }
90
- return m && _.slice(1).length === 0 ? b : null;
90
+ return m && _.slice(1).length === 0 ? g : null;
91
91
  }
92
92
  return {
93
93
  // @ts-ignore
@@ -154,7 +154,7 @@ const bt = vo("mf-menu-tree", () => {
154
154
  async function m() {
155
155
  o.value = [];
156
156
  }
157
- function b() {
157
+ function g() {
158
158
  const f = [];
159
159
  function n(S) {
160
160
  f.push(S.id);
@@ -166,7 +166,7 @@ const bt = vo("mf-menu-tree", () => {
166
166
  o.value = f;
167
167
  }
168
168
  const h = te(/* @__PURE__ */ new Map());
169
- function C(f) {
169
+ function I(f) {
170
170
  return h.value.get(f);
171
171
  }
172
172
  return {
@@ -179,8 +179,8 @@ const bt = vo("mf-menu-tree", () => {
179
179
  setSelectedNodeByItemId: E,
180
180
  setExpandedNodeIds: _,
181
181
  collapseAllNodes: m,
182
- expandAllNodes: b,
183
- getNodeById: C
182
+ expandAllNodes: g,
183
+ getNodeById: I
184
184
  };
185
185
  });
186
186
  let st = null, We = null, He = null;
@@ -188,56 +188,56 @@ function fn() {
188
188
  return We && (clearTimeout(We), We = null), He ? (He(), He = null, !0) : !1;
189
189
  }
190
190
  function Lo(u, a, t) {
191
- function p(b) {
191
+ function p(g) {
192
192
  if (!u.value) return !1;
193
193
  const h = u.value.validate();
194
194
  if (h != null && h.length && h.length > 0)
195
195
  return !1;
196
- const C = b;
197
- return r(C), st = { ...C }, We && clearTimeout(We), He = () => {
196
+ const I = g;
197
+ return r(I), st = { ...I }, We && clearTimeout(We), He = () => {
198
198
  st && (_(st), st = null), We = null;
199
199
  }, We = setTimeout(() => {
200
200
  He && He(), He = null;
201
201
  }, 1e3), !0;
202
202
  }
203
- function r(b) {
204
- b.inventoryBindings ?? (b.inventoryBindings = []), b.inventoryBindings.length === 0 && (b.inventoryBindings = null);
203
+ function r(g) {
204
+ g.inventoryBindings ?? (g.inventoryBindings = []), g.inventoryBindings.length === 0 && (g.inventoryBindings = null);
205
205
  }
206
- function _(b) {
207
- return !a.state.currentCatalogId && !a.state.currentSchedulerId ? (E(b), !0) : m(b);
206
+ function _(g) {
207
+ return !a.state.currentCatalogId && !a.state.currentSchedulerId ? (E(g), !0) : m(g);
208
208
  }
209
- function E(b) {
209
+ function E(g) {
210
210
  a.updateMenu({
211
211
  module: xe.enum.item,
212
212
  operation: Ee.F_OPERATION_TYPE.update,
213
- data: b
213
+ data: g
214
214
  });
215
215
  }
216
- function m(b) {
216
+ function m(g) {
217
217
  const h = Vn(
218
- [b],
218
+ [g],
219
219
  a.state.menu,
220
220
  a.state.currentCatalogId,
221
221
  a.state.currentSchedulerId
222
222
  );
223
223
  if (a.state.currentCatalogId) {
224
- const C = h.modules.catalog.find(
224
+ const I = h.modules.catalog.find(
225
225
  (f) => f._id === a.state.currentCatalogId
226
226
  );
227
227
  return a.updateMenu({
228
228
  module: xe.enum.catalog,
229
229
  operation: Ee.F_OPERATION_TYPE.update,
230
- data: C
230
+ data: I
231
231
  }), !0;
232
232
  }
233
233
  if (a.state.currentSchedulerId) {
234
- const C = h.modules.scheduler.find(
234
+ const I = h.modules.scheduler.find(
235
235
  (f) => f._id === a.state.currentSchedulerId
236
236
  );
237
237
  return a.updateMenu({
238
238
  module: xe.enum.scheduler,
239
239
  operation: Ee.F_OPERATION_TYPE.update,
240
- data: C
240
+ data: I
241
241
  }), !0;
242
242
  }
243
243
  return !1;
@@ -270,8 +270,8 @@ function Bo({
270
270
  if (!a && t)
271
271
  return (_ = (r = u.modules.scheduler.find((m) => m._id === t)) == null ? void 0 : r.items) == null ? void 0 : _.filter((m) => m._id === o);
272
272
  {
273
- const m = u.modules.catalog.find((h) => h._id === a), b = m == null ? void 0 : m.override.scheduler[t];
274
- return (E = b == null ? void 0 : b.items) == null ? void 0 : E.filter((h) => h._id === o);
273
+ const m = u.modules.catalog.find((h) => h._id === a), g = m == null ? void 0 : m.override.scheduler[t];
274
+ return (E = g == null ? void 0 : g.items) == null ? void 0 : E.filter((h) => h._id === o);
275
275
  }
276
276
  }
277
277
  function Ko(u, a, t, o) {
@@ -305,9 +305,9 @@ function ft(u, a) {
305
305
  const yt = () => {
306
306
  const { t: u } = ye(), a = ze(), t = be(), o = _n();
307
307
  function p() {
308
- var h, C, f;
308
+ var h, I, f;
309
309
  if (!o) throw new Error("No current instance found");
310
- const { container: m, vNode: b } = ho(
310
+ const { container: m, vNode: g } = ho(
311
311
  On,
312
312
  o,
313
313
  {
@@ -321,7 +321,7 @@ const yt = () => {
321
321
  }
322
322
  }
323
323
  );
324
- (f = (C = (h = b.component) == null ? void 0 : h.exposed) == null ? void 0 : C.trigger) == null || f.call(C);
324
+ (f = (I = (h = g.component) == null ? void 0 : h.exposed) == null ? void 0 : I.trigger) == null || f.call(I);
325
325
  }
326
326
  function r(m) {
327
327
  a.open({
@@ -339,14 +339,14 @@ const yt = () => {
339
339
  text: u("menu.common.actions.cancel"),
340
340
  close: !0
341
341
  }
342
- }).onPrimary(async (b) => {
343
- b != null && b.name && (t.updateMenu({
342
+ }).onPrimary(async (g) => {
343
+ g != null && g.name && (t.updateMenu({
344
344
  module: xe.enum.category,
345
345
  operation: Ee.F_OPERATION_TYPE.update,
346
346
  data: {
347
347
  ...m,
348
- name: b.name,
349
- ...b.name_locale && { name_locale: b.name_locale }
348
+ name: g.name,
349
+ ...g.name_locale && { name_locale: g.name_locale }
350
350
  }
351
351
  }), a.close());
352
352
  });
@@ -389,37 +389,37 @@ const yt = () => {
389
389
  __name: "ImageUploadDialog",
390
390
  setup(u) {
391
391
  const { t: a } = ye(), t = te(), o = te(!1);
392
- async function p([b]) {
393
- if (!b) return;
392
+ async function p([g]) {
393
+ if (!g) return;
394
394
  o.value = !0;
395
395
  const h = new FileReader();
396
396
  h.onload = () => {
397
- const C = new Image();
398
- C.src = h.result, C.onload = () => {
399
- const f = Mn(C, 1.3333333333333333);
397
+ const I = new Image();
398
+ I.src = h.result, I.onload = () => {
399
+ const f = Mn(I, 1.3333333333333333);
400
400
  t.value = f, o.value = !1;
401
- }, C.onerror = () => {
401
+ }, I.onerror = () => {
402
402
  o.value = !1;
403
403
  };
404
- }, h.readAsDataURL(b);
404
+ }, h.readAsDataURL(g);
405
405
  }
406
- const r = (b) => {
407
- p([b]);
406
+ const r = (g) => {
407
+ p([g]);
408
408
  }, { emitData: _ } = Lt();
409
- async function E(b) {
410
- const { canvas: h } = b, C = h.toDataURL("image/jpeg", 0.75), f = await (await fetch(C)).blob(), n = new File([f], "img.jpeg", { type: "image/jpeg" });
409
+ async function E(g) {
410
+ const { canvas: h } = g, I = h.toDataURL("image/jpeg", 0.75), f = await (await fetch(I)).blob(), n = new File([f], "img.jpeg", { type: "image/jpeg" });
411
411
  _(n);
412
412
  }
413
413
  function m() {
414
414
  t.value = void 0, _(null);
415
415
  }
416
- return (b, h) => {
417
- const C = H("fm-icon"), f = H("fm-drop-field");
416
+ return (g, h) => {
417
+ const I = H("fm-icon"), f = H("fm-drop-field");
418
418
  return V(), Z("div", jo, [
419
419
  t.value ? (V(), Z("div", Yo, [
420
420
  N("div", qo, [
421
421
  N("div", Wo, [
422
- c(e(Un), {
422
+ d(e(Un), {
423
423
  class: "cropper",
424
424
  src: t.value,
425
425
  "stencil-props": {
@@ -444,7 +444,7 @@ const yt = () => {
444
444
  type: "button",
445
445
  onClick: m
446
446
  }, [
447
- c(C, { name: "close" })
447
+ d(I, { name: "close" })
448
448
  ])
449
449
  ])
450
450
  ])) : (V(), oe(f, {
@@ -505,7 +505,7 @@ const Jo = {
505
505
  }).onPrimary(() => {
506
506
  r();
507
507
  });
508
- }, E = je(), m = at(E), b = () => {
508
+ }, E = je(), m = at(E), g = () => {
509
509
  p.open({
510
510
  title: "Upload image",
511
511
  message: "Please upload an image for your product.",
@@ -524,8 +524,8 @@ const Jo = {
524
524
  throw new Error("No image selected");
525
525
  if (!t.itemId)
526
526
  throw new Error("Item ID is required when uploading image");
527
- const C = oo(t.itemId);
528
- await ro.update(C, h, Qo.firebase.storageBucket), o.value = ao(C);
527
+ const I = oo(t.itemId);
528
+ await ro.update(I, h, Qo.firebase.storageBucket), o.value = ao(I);
529
529
  }, {
530
530
  message: "Uploading image...",
531
531
  successMessage: "Image uploaded successfully",
@@ -533,7 +533,7 @@ const Jo = {
533
533
  });
534
534
  });
535
535
  };
536
- return (h, C) => {
536
+ return (h, I) => {
537
537
  const f = H("FmButton"), n = H("FmFormGroup");
538
538
  return V(), oe(n, {
539
539
  tag: "div",
@@ -543,19 +543,19 @@ const Jo = {
543
543
  }, {
544
544
  default: B(() => [N("div", {
545
545
  class: we(`relative container ${h.disabled ? "cursor-not-allowed" : ""}`)
546
- }, [c(wo, {
546
+ }, [d(wo, {
547
547
  size: {
548
548
  width: 200,
549
549
  height: 150
550
550
  },
551
551
  src: o.value,
552
552
  alt: "Product image"
553
- }, null, 8, ["src"]), h.disabled ? ee("", !0) : (V(), Z("div", Jo, [N("div", Zo, [c(f, {
553
+ }, null, 8, ["src"]), h.disabled ? ee("", !0) : (V(), Z("div", Jo, [N("div", Zo, [d(f, {
554
554
  icon: o.value ? "edit" : "add",
555
555
  variant: "secondary",
556
556
  "text-color": e(De).NeutralGray400,
557
557
  class: "bg-white",
558
- onClick: b
558
+ onClick: g
559
559
  }, null, 8, ["icon", "text-color"]), o.value ? (V(), oe(f, {
560
560
  key: 0,
561
561
  icon: "delete",
@@ -627,18 +627,18 @@ const yr = /* @__PURE__ */ me({
627
627
  }) {
628
628
  const t = u, o = vt(), p = be(), r = yt(), {
629
629
  checkMenuIsLoading: _
630
- } = Nt(at(je())), E = lt(), m = a, b = O(() => p.rules.item), h = O(() => p.categorizedItems), C = O(() => {
631
- const I = h.value.map((G) => ({
630
+ } = Nt(at(je())), E = lt(), m = a, g = O(() => p.rules.item), h = O(() => p.categorizedItems), I = O(() => {
631
+ const C = h.value.map((G) => ({
632
632
  label: G.name,
633
633
  value: G.id
634
634
  }));
635
- return t.isAddon ? I : I.filter((G) => !!G.value);
636
- }), f = O(() => b.value.addon), n = O(() => !C.value.find((I) => !!I.value)), S = O(() => lo(t.form.category ? t.form : t.fallback) || []), D = O(() => S.value.reduce((I, G) => (I[G._id] = G, I), {})), z = O({
635
+ return t.isAddon ? C : C.filter((G) => !!G.value);
636
+ }), f = O(() => g.value.addon), n = O(() => !I.value.find((C) => !!C.value)), S = O(() => lo(t.form.category ? t.form : t.fallback) || []), D = O(() => S.value.reduce((C, G) => (C[G._id] = G, C), {})), z = O({
637
637
  get() {
638
- return S.value.map((I) => I._id);
638
+ return S.value.map((C) => C._id);
639
639
  },
640
- set(I = []) {
641
- const [G, ...j] = I.map((X) => {
640
+ set(C = []) {
641
+ const [G, ...q] = C.map((X) => {
642
642
  const se = D.value[X];
643
643
  return se || {
644
644
  _id: X,
@@ -649,67 +649,67 @@ const yr = /* @__PURE__ */ me({
649
649
  m("update:form", "category", null), m("update:form", "additionalCategories", []);
650
650
  return;
651
651
  }
652
- m("update:form", "category", G._id), m("update:form", "additionalCategories", j);
652
+ m("update:form", "category", G._id), m("update:form", "additionalCategories", q);
653
653
  }
654
654
  }), F = te(), $ = ({
655
- multiple: I = !0
656
- } = {}) => t.isAddon ? null : c(Ln, {
655
+ multiple: C = !0
656
+ } = {}) => t.isAddon ? null : d(Ln, {
657
657
  ref: F,
658
- disabled: !b.value.category || _(),
659
- items: C.value,
658
+ disabled: !g.value.category || _(),
659
+ items: I.value,
660
660
  modelValue: z.value,
661
661
  "onUpdate:model-value": (G) => z.value = G,
662
662
  placeholder: l("menu.product.form.detail.category.placeholder"),
663
- multiple: I
663
+ multiple: C
664
664
  }, {
665
- "append-menu": () => c("button", {
665
+ "append-menu": () => d("button", {
666
666
  class: "flex items-center py-8 px-16 space-x-8",
667
667
  type: "button",
668
668
  onClick: () => {
669
669
  var G;
670
670
  (G = F.value) == null || G.hideMenu(), r.create();
671
671
  }
672
- }, [c(Ie.FmIcon, {
672
+ }, [d(Ie.FmIcon, {
673
673
  color: "primary",
674
674
  name: "add",
675
675
  size: "md"
676
- }, null), c("p", {
676
+ }, null), d("p", {
677
677
  class: "fm-typo-en-body-lg-600 text-fm-color-primary"
678
678
  }, [l("menu.product.form.detail.category.add_new")])])
679
679
  });
680
680
  Xe(async () => {
681
- !n.value && t.form.category === void 0 && t.isCreate && g(Re.PRODUCT);
681
+ !n.value && t.form.category === void 0 && t.isCreate && b(Re.PRODUCT);
682
682
  });
683
683
  const T = O(() => {
684
684
  var G;
685
- const I = t.form.name || ((G = t.fallback) == null ? void 0 : G.name);
686
- return I ? p.items.filter((j) => !!j.category && j._id !== t.form._id && j.name === I).length : 0;
685
+ const C = t.form.name || ((G = t.fallback) == null ? void 0 : G.name);
686
+ return C ? p.items.filter((q) => !!q.category && q._id !== t.form._id && q.name === C).length : 0;
687
687
  }), P = O(() => {
688
688
  var se, ce, fe;
689
689
  if (!o.state.featureFlags.uniqueProductCode) return 0;
690
690
  const G = t.form.code || ((se = t.fallback) == null ? void 0 : se.code);
691
691
  if (!G) return 0;
692
- let j = p.itemCodeMap.get(G) || 0;
692
+ let q = p.itemCodeMap.get(G) || 0;
693
693
  const X = p.items.find((pe) => pe._id === t.form._id);
694
- return (X == null ? void 0 : X.code) === G && (j -= 1), (fe = (ce = X == null ? void 0 : X.variant) == null ? void 0 : ce.variantCombinations) == null || fe.forEach((pe) => {
695
- pe.code === G && (j -= 1);
696
- }), j;
697
- }), d = O(() => t.isAddon ? Re.ADD_ON : Re.PRODUCT);
698
- function g(I) {
699
- var j, X, se;
700
- if (d.value === I) return;
701
- const G = I == Re.ADD_ON;
702
- m("update:form", "category", t.isOverride ? G ? "" : ((j = t.fallback) == null ? void 0 : j.category) ?? ((X = C.value.find((ce) => !!ce.value)) == null ? void 0 : X.value) : G ? null : (se = C.value.find((ce) => !!ce.value)) == null ? void 0 : se.value), G && (m("update:form", "additionalCategories", []), m("update:form", "subCategories", []));
694
+ return (X == null ? void 0 : X.code) === G && (q -= 1), (fe = (ce = X == null ? void 0 : X.variant) == null ? void 0 : ce.variantCombinations) == null || fe.forEach((pe) => {
695
+ pe.code === G && (q -= 1);
696
+ }), q;
697
+ }), c = O(() => t.isAddon ? Re.ADD_ON : Re.PRODUCT);
698
+ function b(C) {
699
+ var q, X, se;
700
+ if (c.value === C) return;
701
+ const G = C == Re.ADD_ON;
702
+ m("update:form", "category", t.isOverride ? G ? "" : ((q = t.fallback) == null ? void 0 : q.category) ?? ((X = I.value.find((ce) => !!ce.value)) == null ? void 0 : X.value) : G ? null : (se = I.value.find((ce) => !!ce.value)) == null ? void 0 : se.value), G && (m("update:form", "additionalCategories", []), m("update:form", "subCategories", []));
703
703
  }
704
704
  const M = mn();
705
- en("apply-description", (I) => {
706
- m("update:form", "description", I || "");
705
+ en("apply-description", (C) => {
706
+ m("update:form", "description", C || "");
707
707
  });
708
708
  async function k() {
709
709
  if (!t.form.name) {
710
- const I = document.getElementById("product-name");
711
- if (I) {
712
- I.focus();
710
+ const C = document.getElementById("product-name");
711
+ if (C) {
712
+ C.focus();
713
713
  return;
714
714
  } else
715
715
  return;
@@ -721,179 +721,183 @@ const yr = /* @__PURE__ */ me({
721
721
  command: "suggestDescription"
722
722
  });
723
723
  }
724
- const y = O(() => p.subcategories), v = O(() => y.value.map((I) => ({
725
- label: I.name,
726
- value: I._id
724
+ const y = O(() => p.subcategories), v = O(() => y.value.map((C) => ({
725
+ label: C.name,
726
+ value: C._id
727
727
  }))), i = O({
728
728
  get() {
729
729
  return t.form.subCategories || [];
730
730
  },
731
- set(I) {
732
- m("update:form", "subCategories", I);
731
+ set(C) {
732
+ m("update:form", "subCategories", C);
733
733
  }
734
734
  }), w = O(() => t.isOverride ? t.form.minimumOrderQuantity ?? null : t.form.minimumOrderQuantity ?? 0);
735
- function x(I) {
736
- m("update:form", "minimumOrderQuantity", t.isOverride ? I : I ?? 0);
735
+ function x(C) {
736
+ m("update:form", "minimumOrderQuantity", t.isOverride ? C : C ?? 0);
737
737
  }
738
738
  const {
739
739
  t: l
740
- } = ye(), R = te(!1), Y = te("name"), q = O(() => {
740
+ } = ye(), R = te(!1), j = te("name"), Y = O(() => {
741
741
  var se, ce;
742
- const I = [], G = "en-US", j = t.form.name_locale, X = j == null ? void 0 : j[G];
743
- return (t.form.name || (se = t.fallback) != null && se.name) && !X && I.push({
742
+ const C = [], G = "en-US", q = t.form.name_locale, X = q == null ? void 0 : q[G];
743
+ return (t.form.name || (se = t.fallback) != null && se.name) && !X && C.push({
744
744
  locale: G,
745
745
  name: t.form.name || ((ce = t.fallback) == null ? void 0 : ce.name) || "",
746
746
  localeDisplay: it(G)
747
- }), j && Object.entries(j).filter(([fe, pe]) => pe && pe.trim()).sort(([fe], [pe]) => fe.localeCompare(pe)).forEach(([fe, pe]) => {
748
- I.push({
747
+ }), q && Object.entries(q).filter(([fe, pe]) => pe && pe.trim()).sort(([fe], [pe]) => fe.localeCompare(pe)).forEach(([fe, pe]) => {
748
+ C.push({
749
749
  locale: fe,
750
750
  name: pe,
751
751
  localeDisplay: it(fe)
752
752
  });
753
- }), I;
754
- }), le = O(() => {
753
+ }), C;
754
+ }), ie = O(() => {
755
755
  var se, ce;
756
- const I = [], G = "en-US", j = t.form.description_locale, X = j == null ? void 0 : j[G];
757
- return (t.form.description || (se = t.fallback) != null && se.description) && !X && I.push({
756
+ const C = [], G = "en-US", q = t.form.description_locale, X = q == null ? void 0 : q[G];
757
+ return (t.form.description || (se = t.fallback) != null && se.description) && !X && C.push({
758
758
  locale: G,
759
759
  name: t.form.description || ((ce = t.fallback) == null ? void 0 : ce.description) || "",
760
760
  localeDisplay: it(G)
761
- }), j && Object.entries(j).filter(([fe, pe]) => pe && pe.trim()).sort(([fe], [pe]) => fe.localeCompare(pe)).forEach(([fe, pe]) => {
762
- I.push({
761
+ }), q && Object.entries(q).filter(([fe, pe]) => pe && pe.trim()).sort(([fe], [pe]) => fe.localeCompare(pe)).forEach(([fe, pe]) => {
762
+ C.push({
763
763
  locale: fe,
764
764
  name: pe,
765
765
  localeDisplay: it(fe)
766
766
  });
767
- }), I;
767
+ }), C;
768
768
  });
769
769
  function de() {
770
- Y.value = "name", R.value = !0;
770
+ j.value = "name", R.value = !0;
771
771
  }
772
772
  function A() {
773
- Y.value = "description", R.value = !0;
773
+ j.value = "description", R.value = !0;
774
774
  }
775
- function s(I) {
776
- m("update:form", "name", I);
775
+ function s(C) {
776
+ m("update:form", "name", C);
777
777
  }
778
- function U(I) {
779
- m("update:form", "description", I);
778
+ function U(C) {
779
+ m("update:form", "description", C);
780
780
  }
781
- function ne(I) {
782
- m("update:form", "name_locale", I);
781
+ function ne(C) {
782
+ m("update:form", "name_locale", C);
783
783
  }
784
- function W(I) {
785
- m("update:form", "description_locale", I);
784
+ function W(C) {
785
+ m("update:form", "description_locale", C);
786
786
  }
787
787
  const J = O(() => {
788
- var I;
789
- return !!t.form.name || !!((I = t.fallback) != null && I.name);
788
+ var C;
789
+ return !!t.form.name || !!((C = t.fallback) != null && C.name);
790
790
  });
791
- return (I, G) => {
791
+ return (C, G) => {
792
792
  var ue, re;
793
- const j = H("fm-text-field"), X = H("fm-button"), se = H("FmTooltip"), ce = H("fm-textarea"), fe = H("fm-radio"), pe = H("FmSnackbar"), Me = H("FmButton"), Le = H("fm-radio-group"), K = H("FmFormGroup"), L = H("fm-stepper-field"), ae = Jt("tooltip");
794
- return V(), Z(Te, null, [c(Pe, {
793
+ const q = H("fm-text-field"), X = H("fm-button"), se = H("FmTooltip"), ce = H("fm-textarea"), fe = H("fm-radio"), pe = H("FmSnackbar"), Me = H("FmButton"), Le = H("fm-radio-group"), K = H("FmFormGroup"), L = H("fm-stepper-field"), ae = Jt("tooltip");
794
+ return V(), Z(Te, null, [d(Pe, {
795
795
  title: e(l)("menu.product.form.detail.title")
796
796
  }, {
797
797
  default: B(() => {
798
798
  var ge, Q, Ye, nt;
799
- return [N("div", nr, [N("div", or, [N("div", rr, [N("div", ar, [c(j, {
800
- "model-value": I.form.code,
801
- placeholder: ((ge = I.fallback) == null ? void 0 : ge.code) || e(l)("menu.product.form.detail.fields.code.placeholder"),
799
+ return [N("div", nr, [N("div", or, [N("div", rr, [N("div", ar, [d(q, {
800
+ "model-value": C.form.code,
801
+ placeholder: ((ge = C.fallback) == null ? void 0 : ge.code) || e(l)("menu.product.form.detail.fields.code.placeholder"),
802
802
  label: e(l)("menu.product.form.detail.fields.code.label"),
803
- rules: [(ie) => P.value === 0 || e(l)("menu.product.form.detail.fields.code.duplicate_warning", {
803
+ rules: [(le) => P.value === 0 || e(l)("menu.product.form.detail.fields.code.duplicate_warning", {
804
804
  count: P.value
805
805
  })],
806
- "onUpdate:modelValue": G[0] || (G[0] = (ie) => m("update:form", "code", e(tn)(ie, I.isOverride)))
807
- }, null, 8, ["model-value", "placeholder", "label", "rules"])]), N("div", lr, [c(j, {
806
+ "onUpdate:modelValue": G[0] || (G[0] = (le) => m("update:form", "code", e(tn)(le, C.isOverride)))
807
+ }, null, 8, ["model-value", "placeholder", "label", "rules"])]), N("div", lr, [d(q, {
808
808
  id: "product-name",
809
- disabled: !b.value.name,
809
+ disabled: !g.value.name,
810
810
  "helper-text": T.value > 0 ? e(l)("menu.product.form.detail.fields.name.duplicate_warning", {
811
811
  count: T.value
812
812
  }) : void 0,
813
- "model-value": I.form.name,
814
- placeholder: (Q = I.fallback) == null ? void 0 : Q.name,
815
- rules: b.value.name ? [(ie) => !!ie || e(l)("menu.product.form.detail.fields.name.required")] : void 0,
813
+ "model-value": C.form.name,
814
+ placeholder: (Q = C.fallback) == null ? void 0 : Q.name,
815
+ rules: g.value.name ? [(le) => !!le || e(l)("menu.product.form.detail.fields.name.required")] : void 0,
816
816
  "label-mark": "required",
817
817
  label: e(l)("menu.product.form.detail.fields.name.label"),
818
- "onUpdate:modelValue": G[1] || (G[1] = (ie) => m("update:form", "name", ie))
818
+ "onUpdate:modelValue": G[1] || (G[1] = (le) => m("update:form", "name", le))
819
819
  }, {
820
- append: B(() => [c(se, {
820
+ append: B(() => [d(se, {
821
821
  variant: "plain",
822
822
  placement: "top",
823
823
  "z-index": 999
824
824
  }, {
825
- content: B(() => [N("div", ir, [(V(!0), Z(Te, null, Ue(q.value, (ie) => (V(), Z("div", {
826
- key: ie.locale
827
- }, ve(ie.name) + " (" + ve(ie.localeDisplay) + ") ", 1))), 128))])]),
828
- default: B(() => [c(X, {
825
+ content: B(() => [N("div", ir, [(V(!0), Z(Te, null, Ue(Y.value, (le) => (V(), Z("div", {
826
+ key: le.locale
827
+ }, ve(le.name) + " (" + ve(le.localeDisplay) + ") ", 1))), 128))])]),
828
+ default: B(() => [d(X, {
829
829
  variant: "tertiary",
830
830
  icon: "g_translate",
831
831
  onClick: de,
832
- disabled: !J.value
832
+ disabled: !J.value || !g.value.name
833
833
  }, null, 8, ["disabled"])]),
834
834
  _: 1
835
835
  })]),
836
836
  _: 1
837
- }, 8, ["disabled", "helper-text", "model-value", "placeholder", "rules", "label"])])]), N("div", sr, [c(ce, {
838
- disabled: !b.value.description,
839
- "model-value": I.form.description || "",
840
- placeholder: ((Ye = I.fallback) == null ? void 0 : Ye.description) || e(l)("menu.product.form.detail.fields.description.placeholder"),
841
- "onUpdate:modelValue": G[2] || (G[2] = (ie) => m("update:form", "description", ie.trim())),
837
+ }, 8, ["disabled", "helper-text", "model-value", "placeholder", "rules", "label"])])]), N("div", sr, [d(ce, {
838
+ disabled: !g.value.description,
839
+ "model-value": C.form.description || "",
840
+ placeholder: ((Ye = C.fallback) == null ? void 0 : Ye.description) || e(l)("menu.product.form.detail.fields.description.placeholder"),
841
+ "onUpdate:modelValue": G[2] || (G[2] = (le) => m("update:form", "description", le.trim())),
842
842
  class: "description"
843
843
  }, {
844
844
  label: B(() => [N("p", ur, [wn(ve(e(l)("menu.product.form.detail.fields.description.label")) + " ", 1), N("span", dr, ve(e(l)("menu.product.form.detail.fields.description.optional")), 1)])]),
845
845
  _: 1
846
- }, 8, ["disabled", "model-value", "placeholder"]), N("div", cr, [c(se, {
846
+ }, 8, ["disabled", "model-value", "placeholder"]), N("div", cr, [d(se, {
847
847
  variant: "plain",
848
848
  placement: "top",
849
849
  "z-index": 999
850
850
  }, {
851
- content: B(() => [N("div", mr, [(V(!0), Z(Te, null, Ue(le.value, (ie) => (V(), Z("div", {
852
- key: ie.locale
853
- }, ve(ie.name) + " (" + ve(ie.localeDisplay) + ") ", 1))), 128))])]),
854
- default: B(() => [rt(c(X, {
855
- variant: "tertiary",
856
- icon: "g_translate",
857
- class: "cursor-pointer",
858
- onClick: A
859
- }, null, 512), [[ae, e($t)("Translate description")]])]),
851
+ content: B(() => [N("div", mr, [(V(!0), Z(Te, null, Ue(ie.value, (le) => (V(), Z("div", {
852
+ key: le.locale
853
+ }, ve(le.name) + " (" + ve(le.localeDisplay) + ") ", 1))), 128))])]),
854
+ default: B(() => {
855
+ var le;
856
+ return [rt(d(X, {
857
+ variant: "tertiary",
858
+ icon: "g_translate",
859
+ class: "cursor-pointer",
860
+ disabled: !(C.form.description || (le = C.fallback) != null && le.description) || !g.value.description,
861
+ onClick: A
862
+ }, null, 8, ["disabled"]), [[ae, e($t)("Translate description")]])];
863
+ }),
860
864
  _: 1
861
- }), rt(c(e(pn), {
865
+ }), rt(d(e(pn), {
862
866
  class: "cursor-pointer",
863
867
  onClick: k
864
- }, null, 512), [[ae, e($t)("Suggest description")]])])])]), c(tr, {
865
- disabled: !b.value.thumbnail,
866
- "item-id": I.form._id || "",
867
- "model-value": I.form.thumbnail || ((nt = I.fallback) == null ? void 0 : nt.thumbnail) || null,
868
- "onUpdate:modelValue": G[3] || (G[3] = (ie) => m("update:form", "thumbnail", ie))
869
- }, null, 8, ["disabled", "item-id", "model-value"])]), c(Ne, {
868
+ }, null, 512), [[ae, e($t)("Suggest description")]])])])]), d(tr, {
869
+ disabled: !g.value.thumbnail,
870
+ "item-id": C.form._id || "",
871
+ "model-value": C.form.thumbnail || ((nt = C.fallback) == null ? void 0 : nt.thumbnail) || null,
872
+ "onUpdate:modelValue": G[3] || (G[3] = (le) => m("update:form", "thumbnail", le))
873
+ }, null, 8, ["disabled", "item-id", "model-value"])]), d(Ne, {
870
874
  label: e(p).isV4 ? e(l)("menu.product.form.detail.category.label") : e(l)("menu.product.form.detail.category.label_singular")
871
875
  }, {
872
876
  default: B(() => [f.value ? (V(), oe(Le, {
873
877
  key: 0,
874
- disabled: !b.value.category,
875
- "model-value": I.isAddon ? Re.ADD_ON : Re.PRODUCT,
876
- "onUpdate:modelValue": G[4] || (G[4] = (ie) => g(ie))
878
+ disabled: !g.value.category,
879
+ "model-value": C.isAddon ? Re.ADD_ON : Re.PRODUCT,
880
+ "onUpdate:modelValue": G[4] || (G[4] = (le) => b(le))
877
881
  }, {
878
- default: B(() => [N("div", pr, [N("div", fr, [c(fe, {
882
+ default: B(() => [N("div", pr, [N("div", fr, [d(fe, {
879
883
  disabled: n.value,
880
884
  value: Re.PRODUCT,
881
885
  label: e(l)("menu.product.form.detail.category.options.product.label"),
882
886
  sublabel: e(l)("menu.product.form.detail.category.options.product.sublabel")
883
- }, null, 8, ["disabled", "value", "label", "sublabel"]), c(An, null, {
887
+ }, null, 8, ["disabled", "value", "label", "sublabel"]), d(An, null, {
884
888
  default: B(() => [e(p).isV4 ? (V(), oe($, {
885
889
  key: 0
886
890
  })) : ee("", !0)]),
887
891
  _: 1
888
- })]), n.value ? (V(), Z("div", gr, [c(pe, {
892
+ })]), n.value ? (V(), Z("div", gr, [d(pe, {
889
893
  title: e(l)("menu.product.form.detail.category.add_first"),
890
894
  variant: "info"
891
- }, null, 8, ["title"]), c(Me, {
895
+ }, null, 8, ["title"]), d(Me, {
892
896
  label: e(l)("menu.common.actions.add"),
893
897
  "prepend-icon": "add",
894
898
  variant: "secondary",
895
899
  onClick: e(r).create
896
- }, null, 8, ["label", "onClick"])])) : ee("", !0), c(fe, {
900
+ }, null, 8, ["label", "onClick"])])) : ee("", !0), d(fe, {
897
901
  value: Re.ADD_ON,
898
902
  disabled: !1,
899
903
  label: e(l)("menu.product.form.detail.category.options.addon.label"),
@@ -902,62 +906,62 @@ const yr = /* @__PURE__ */ me({
902
906
  _: 1
903
907
  }, 8, ["disabled", "model-value"])) : ee("", !0), e(p).isV4 ? ee("", !0) : (V(), oe(K, {
904
908
  key: 1,
905
- "model-value": I.form.category,
906
- rules: [(ie) => !ie && !I.isOverride ? "Category is required" : !0]
909
+ "model-value": C.form.category,
910
+ rules: [(le) => !le && !C.isOverride ? "Category is required" : !0]
907
911
  }, {
908
- default: B(() => [c($, {
912
+ default: B(() => [d($, {
909
913
  multiple: !1
910
914
  })]),
911
915
  _: 1
912
916
  }, 8, ["model-value", "rules"]))]),
913
917
  _: 1
914
- }, 8, ["label"]), e(p).isV4 && !I.isAddon ? (V(), oe(Ne, {
918
+ }, 8, ["label"]), e(p).isV4 && !C.isAddon ? (V(), oe(Ne, {
915
919
  key: 0,
916
920
  label: e(l)("menu.product.form.detail.path.label")
917
921
  }, {
918
- default: B(() => [N("div", vr, [c(Rn, {
922
+ default: B(() => [N("div", vr, [d(Rn, {
919
923
  modelValue: i.value,
920
- "onUpdate:modelValue": G[5] || (G[5] = (ie) => i.value = ie),
924
+ "onUpdate:modelValue": G[5] || (G[5] = (le) => i.value = le),
921
925
  items: v.value,
922
926
  placeholder: e(l)("menu.product.form.detail.path.placeholder"),
923
- disabled: !b.value.category,
927
+ disabled: !g.value.category,
924
928
  "is-local-only": !0
925
929
  }, null, 8, ["modelValue", "items", "placeholder", "disabled"])])]),
926
930
  _: 1
927
- }, 8, ["label"])) : ee("", !0), e(p).isV4 ? (V(), Z("div", br, [c(L, {
931
+ }, 8, ["label"])) : ee("", !0), e(p).isV4 ? (V(), Z("div", br, [d(L, {
928
932
  label: "Shelf Life (mins)",
929
- "model-value": I.form.shelfLife ?? null,
930
- rules: [(ie) => ie == null || ie > 0 || e(l)("menu.common.validation.min_value", {
933
+ "model-value": C.form.shelfLife ?? null,
934
+ rules: [(le) => le == null || le > 0 || e(l)("menu.common.validation.min_value", {
931
935
  value: 1
932
936
  })],
933
- "onUpdate:modelValue": G[6] || (G[6] = (ie) => {
934
- (ie == null || ie > 0) && m("update:form", "shelfLife", ie);
937
+ "onUpdate:modelValue": G[6] || (G[6] = (le) => {
938
+ (le == null || le > 0) && m("update:form", "shelfLife", le);
935
939
  })
936
- }, null, 8, ["model-value", "rules"]), c(L, {
940
+ }, null, 8, ["model-value", "rules"]), d(L, {
937
941
  label: e(l)("menu.product.form.detail.fields.minimum_order_quantity.label"),
938
942
  "model-value": w.value,
939
943
  min: 0,
940
944
  step: 1,
941
945
  "onUpdate:modelValue": x
942
- }, null, 8, ["label", "model-value"])])) : ee("", !0), c(Ut, {
943
- disabled: !b.value.orderFrom,
944
- "model-value": I.form.orderFrom,
945
- "order-from-none": b.value.orderFromNone,
946
- required: b.value.orderFrom,
946
+ }, null, 8, ["label", "model-value"])])) : ee("", !0), d(Ut, {
947
+ disabled: !g.value.orderFrom,
948
+ "model-value": C.form.orderFrom,
949
+ "order-from-none": g.value.orderFromNone,
950
+ required: g.value.orderFrom,
947
951
  "default-label": e(l)("menu.product.form.detail.order_from.default"),
948
952
  label: e(l)("menu.product.form.detail.order_from.label"),
949
- "onUpdate:modelValue": G[7] || (G[7] = (ie) => ie && m("update:form", "orderFrom", ie))
953
+ "onUpdate:modelValue": G[7] || (G[7] = (le) => le && m("update:form", "orderFrom", le))
950
954
  }, null, 8, ["disabled", "model-value", "order-from-none", "required", "default-label", "label"])];
951
955
  }),
952
956
  _: 1
953
- }, 8, ["title"]), c(Nn, {
957
+ }, 8, ["title"]), d(Nn, {
954
958
  modelValue: R.value,
955
959
  "onUpdate:modelValue": G[8] || (G[8] = (ge) => R.value = ge),
956
- "product-name": I.form.name || ((ue = I.fallback) == null ? void 0 : ue.name) || "",
957
- "product-name-locale": I.form.name_locale,
958
- "product-description": I.form.description || ((re = I.fallback) == null ? void 0 : re.description),
959
- "product-description-locale": I.form.description_locale,
960
- "initial-section": Y.value,
960
+ "product-name": C.form.name || ((ue = C.fallback) == null ? void 0 : ue.name) || "",
961
+ "product-name-locale": C.form.name_locale,
962
+ "product-description": C.form.description || ((re = C.fallback) == null ? void 0 : re.description),
963
+ "product-description-locale": C.form.description_locale,
964
+ "initial-section": j.value,
961
965
  "onUpdate:name": s,
962
966
  "onUpdate:description": U,
963
967
  "onUpdate:nameLocale": ne,
@@ -965,23 +969,23 @@ const yr = /* @__PURE__ */ me({
965
969
  }, null, 8, ["modelValue", "product-name", "product-name-locale", "product-description", "product-description-locale", "initial-section"])], 64);
966
970
  };
967
971
  }
968
- }), _r = /* @__PURE__ */ tt(yr, [["__scopeId", "data-v-6e07b5bc"]]), hr = /* @__PURE__ */ me({
972
+ }), _r = /* @__PURE__ */ tt(yr, [["__scopeId", "data-v-6d6f69aa"]]), hr = /* @__PURE__ */ me({
969
973
  __name: "AddForm",
970
974
  setup(u) {
971
975
  const a = be(), t = O(() => a.rules.group), o = O(() => !!a.state.currentCatalogId || !!a.state.currentSchedulerId), p = O(() => {
972
- const m = !a.state.currentSchedulerId, b = a.rules.group.type, h = a.version === Ze.enum.v3, C = a.rules.item.orderFromActiveOnly, f = a.rules.item.bindToVariant;
976
+ const m = !a.state.currentSchedulerId, g = a.rules.group.type, h = a.version === Ze.enum.v3, I = a.rules.item.orderFromActiveOnly, f = a.rules.item.bindToVariant;
973
977
  return function(S) {
974
978
  return {
975
979
  link: (D) => !o.value && (!D || f),
976
980
  name: (D) => !o.value && !D,
977
981
  isDefault: (D) => !o.value,
978
- type: b && !S._id && !o.value,
982
+ type: g && !S._id && !o.value,
979
983
  price: S.type !== _e.enum.DYNAMIC,
980
984
  priceEdit: !0,
981
985
  priceTier: a.isV4,
982
986
  inventory: m ? h ? !o.value && S.type === _e.enum.NORMAL : !o.value : !1,
983
987
  orderFrom: (D) => m ? h ? S.type === _e.enum.DYNAMIC ? o.value : !!o.value == !D : o.value : !1,
984
- orderFromActiveOnly: C,
988
+ orderFromActiveOnly: I,
985
989
  showOrderFrom: m ? h ? o.value ? !0 : S.type === _e.enum.PRODUCT : o.value : !1,
986
990
  bindToVariant: f,
987
991
  isOverride: o.value,
@@ -996,13 +1000,13 @@ const yr = /* @__PURE__ */ me({
996
1000
  position: a.groups.length - 1,
997
1001
  itemsLinked: []
998
1002
  }), _ = te(r()), { t: E } = ye();
999
- return (m, b) => t.value.create ? (V(), oe(e(Dr), {
1003
+ return (m, g) => t.value.create ? (V(), oe(e(Dr), {
1000
1004
  key: 0,
1001
1005
  "categorized-items": e(a).categorizedItems,
1002
1006
  config: p.value,
1003
1007
  group: _.value,
1004
- "onUpdate:group": b[0] || (b[0] = (h) => _.value = h),
1005
- "onStatus:show": b[1] || (b[1] = (h) => {
1008
+ "onUpdate:group": g[0] || (g[0] = (h) => _.value = h),
1009
+ "onStatus:show": g[1] || (g[1] = (h) => {
1006
1010
  h || (_.value = r());
1007
1011
  }),
1008
1012
  action: "add",
@@ -1036,7 +1040,7 @@ const yr = /* @__PURE__ */ me({
1036
1040
  setup(u, {
1037
1041
  emit: a
1038
1042
  }) {
1039
- const t = u, o = a, p = lt(), r = be(), _ = O(() => Ce.Country.getCountry(p.currentCountry.value)), E = te(!1), m = O(() => t.config.isV4 || t.group.type === _e.enum.PRODUCT), b = O(() => m.value), h = O(() => m.value), C = O(() => Object.values(t.group.items).flatMap((A) => [{
1043
+ const t = u, o = a, p = lt(), r = be(), _ = O(() => Ce.Country.getCountry(p.currentCountry.value)), E = te(!1), m = O(() => t.config.isV4 || t.group.type === _e.enum.PRODUCT), g = O(() => m.value), h = O(() => m.value), I = O(() => Object.values(t.group.items).flatMap((A) => [{
1040
1044
  _id: A._id,
1041
1045
  combinationKey: void 0
1042
1046
  }, ...(A.items ?? []).map((s) => ({
@@ -1058,10 +1062,10 @@ const yr = /* @__PURE__ */ me({
1058
1062
  var s;
1059
1063
  return A == null ? "" : (s = io()[A]) == null ? void 0 : s.label;
1060
1064
  }, T = O(() => Object.values(S.value)), P = te({}), {
1061
- t: d
1062
- } = ye(), g = Kt(), M = te([{
1065
+ t: c
1066
+ } = ye(), b = Kt(), M = te([{
1063
1067
  accessorKey: "isDefault",
1064
- header: () => d("menu.group.option.is_default"),
1068
+ header: () => c("menu.group.option.is_default"),
1065
1069
  enableSorting: !1,
1066
1070
  size: 35,
1067
1071
  cell: (A) => {
@@ -1069,41 +1073,41 @@ const yr = /* @__PURE__ */ me({
1069
1073
  if ((J = (W = A.row.original) == null ? void 0 : W.items) != null && J.length)
1070
1074
  return null;
1071
1075
  const s = A.row.depth > 0, U = A.row.original, ne = !!A.getValue();
1072
- return c(Ie.FmCheckbox, {
1076
+ return d(Ie.FmCheckbox, {
1073
1077
  value: "default",
1074
1078
  modelValue: ne,
1075
1079
  disabled: !D(U.combinationKey).isDefault,
1076
- "onUpdate:modelValue": (I) => {
1080
+ "onUpdate:modelValue": (C) => {
1077
1081
  var G;
1078
1082
  if (s) {
1079
- const j = (G = A.row.getParentRow()) == null ? void 0 : G.original;
1080
- if (!j) return;
1081
- w(j._id, U.combinationKey ?? "", "isDefault", I);
1083
+ const q = (G = A.row.getParentRow()) == null ? void 0 : G.original;
1084
+ if (!q) return;
1085
+ w(q._id, U.combinationKey ?? "", "isDefault", C);
1082
1086
  } else
1083
- i(U._id, "isDefault", I);
1087
+ i(U._id, "isDefault", C);
1084
1088
  }
1085
1089
  }, null);
1086
1090
  }
1087
1091
  }, {
1088
1092
  accessorKey: "code",
1089
- header: () => d("menu.group.option.code"),
1093
+ header: () => c("menu.group.option.code"),
1090
1094
  enableSorting: !1,
1091
1095
  size: 100,
1092
1096
  cell: (A) => {
1093
1097
  const s = A.getValue();
1094
- return c(Ie.FmTooltip, {
1098
+ return d(Ie.FmTooltip, {
1095
1099
  class: "flex",
1096
1100
  content: s,
1097
1101
  zIndex: 110
1098
1102
  }, {
1099
- default: () => [c("div", {
1103
+ default: () => [d("div", {
1100
1104
  class: "break-all max-w-[100px]"
1101
1105
  }, [s])]
1102
1106
  });
1103
1107
  }
1104
1108
  }, {
1105
1109
  accessorKey: "name",
1106
- header: () => d("menu.group.option.product_title"),
1110
+ header: () => c("menu.group.option.product_title"),
1107
1111
  enableSorting: !1,
1108
1112
  cell: (A) => {
1109
1113
  var J;
@@ -1112,21 +1116,21 @@ const yr = /* @__PURE__ */ me({
1112
1116
  modelValue: s,
1113
1117
  placeholder: W ?? "",
1114
1118
  disabled: !D(U.combinationKey).name,
1115
- rules: W ? void 0 : [(I) => ((I == null ? void 0 : I.length) ?? 0) > 0 || d("menu.group.option.product_title_required")],
1116
- "onUpdate:modelValue": (I) => {
1119
+ rules: W ? void 0 : [(C) => ((C == null ? void 0 : C.length) ?? 0) > 0 || c("menu.group.option.product_title_required")],
1120
+ "onUpdate:modelValue": (C) => {
1117
1121
  var G;
1118
1122
  if (ne) {
1119
- const j = (G = A.row.getParentRow()) == null ? void 0 : G.original;
1120
- if (!j) return;
1121
- w(j._id, U.combinationKey ?? "", "name", I || null);
1123
+ const q = (G = A.row.getParentRow()) == null ? void 0 : G.original;
1124
+ if (!q) return;
1125
+ w(q._id, U.combinationKey ?? "", "name", C || null);
1122
1126
  } else
1123
- i(U._id, "name", I || null);
1127
+ i(U._id, "name", C || null);
1124
1128
  },
1125
1129
  class: "min-w-[300px]"
1126
1130
  }, {
1127
1131
  append: () => {
1128
- var I, G;
1129
- return (G = (I = A.row.original) == null ? void 0 : I.items) != null && G.length ? ke(Ie.FmIcon, {
1132
+ var C, G;
1133
+ return (G = (C = A.row.original) == null ? void 0 : C.items) != null && G.length ? ke(Ie.FmIcon, {
1130
1134
  name: "keyboard_arrow_up",
1131
1135
  onClick: A.row.getToggleExpandedHandler(),
1132
1136
  class: ["cursor-pointer", "transition-transform", A.row.getIsExpanded() ? "transform rotate-180" : ""],
@@ -1140,23 +1144,23 @@ const yr = /* @__PURE__ */ me({
1140
1144
  enableSorting: !1,
1141
1145
  header: () => {
1142
1146
  var A;
1143
- return d("menu.group.option.price", {
1147
+ return c("menu.group.option.price", {
1144
1148
  symbol: (A = _.value) == null ? void 0 : A.currency.symbol
1145
1149
  });
1146
1150
  },
1147
1151
  size: 400,
1148
1152
  cell: (A) => {
1149
- const s = A.getValue(), U = A.row.original, ne = !D(null).priceEdit || U.orderFrom === ct.enum.NONE, W = U.fallbackPrice, J = A.row.depth > 0, I = U.price_variant ?? Object.fromEntries(Object.entries(g.memberPricings.value ?? {}).map(([j, X]) => [X.key, null])), G = Object.values(I).every((j) => j === null);
1150
- return c("div", {
1153
+ const s = A.getValue(), U = A.row.original, ne = !D(null).priceEdit || U.orderFrom === ct.enum.NONE, W = U.fallbackPrice, J = A.row.depth > 0, C = b.getMemberPricingPriceVariant(U.price_variant), G = Object.values(C).every((q) => q === null);
1154
+ return d("div", {
1151
1155
  class: "flex items-center gap-8"
1152
- }, [c(Je, {
1156
+ }, [d(Je, {
1153
1157
  disable: ne,
1154
1158
  placeholder: W ? Be(W) : void 0,
1155
1159
  modelValue: s,
1156
1160
  required: !W && !ne,
1157
1161
  nullable: !!W,
1158
1162
  min: z.value ? void 0 : 0,
1159
- "onUpdate:model-value": (j) => {
1163
+ "onUpdate:model-value": (q) => {
1160
1164
  var X;
1161
1165
  if (J) {
1162
1166
  const se = (X = A.row.getParentRow()) == null ? void 0 : X.original;
@@ -1166,27 +1170,27 @@ const yr = /* @__PURE__ */ me({
1166
1170
  U.combinationKey ?? "",
1167
1171
  // @ts-ignore
1168
1172
  "price",
1169
- j
1173
+ q
1170
1174
  );
1171
1175
  } else
1172
- i(U._id, "price", j);
1176
+ i(U._id, "price", q);
1173
1177
  },
1174
1178
  showCurrency: !1,
1175
1179
  class: "min-w-[88px]"
1176
- }, null), D(null).priceTier && c("div", {
1180
+ }, null), D(null).priceTier && d("div", {
1177
1181
  class: "flex items-center gap-4"
1178
- }, [c(Mt, {
1179
- title: d("menu.product.form.member_price.configure.title"),
1182
+ }, [d(Mt, {
1183
+ title: c("menu.product.form.member_price.configure.title"),
1180
1184
  currentConfig: "",
1181
- priceVariants: I,
1185
+ priceVariants: C,
1182
1186
  showRemy: !1,
1183
1187
  basePrice: s,
1184
1188
  basePriceFallback: W ? Be(W) : void 0,
1185
- "onUpdate:value": (j) => {
1189
+ "onUpdate:value": (q) => {
1186
1190
  var se;
1187
1191
  const X = {
1188
- price: j.basePrice,
1189
- price_variant: At(j.priceVariants)
1192
+ price: q.basePrice,
1193
+ price_variant: At(q.priceVariants)
1190
1194
  };
1191
1195
  if (J) {
1192
1196
  const ce = (se = A.row.getParentRow()) == null ? void 0 : se.original;
@@ -1197,25 +1201,26 @@ const yr = /* @__PURE__ */ me({
1197
1201
  }
1198
1202
  }, {
1199
1203
  default: ({
1200
- trigger: j
1201
- }) => c(Ie.FmButton, {
1204
+ trigger: q
1205
+ }) => d(Ie.FmButton, {
1202
1206
  variant: Oe.Plain,
1203
- label: d("menu.product.form.member_price.configure.title"),
1204
- onClick: () => j()
1207
+ label: c("menu.product.form.member_price.configure.title"),
1208
+ onClick: () => q()
1205
1209
  }, {
1206
- default: () => c("span", {
1210
+ default: () => d("span", {
1207
1211
  class: "underline line-clamp-2 break-all"
1208
- }, [G ? d("menu.product.form.member_price.configure.title") : d("menu.product.form.member_price.configure.title_with_tier", {
1209
- num: Object.values(I).filter((X) => X !== null).length
1212
+ }, [G ? c("menu.product.form.member_price.configure.title") : c("menu.product.form.member_price.configure.title_with_tier", {
1213
+ num: Object.values(C).filter((X) => X !== null).length
1210
1214
  })])
1211
1215
  })
1212
- }), c(Rt, {
1213
- priceVariants: I
1216
+ }), d(Rt, {
1217
+ priceVariants: C,
1218
+ placement: "left"
1214
1219
  }, null)])]);
1215
1220
  }
1216
1221
  }, {
1217
1222
  accessorKey: "orderFrom",
1218
- header: () => d("menu.common.labels.order_from"),
1223
+ header: () => c("menu.common.labels.order_from"),
1219
1224
  size: 100,
1220
1225
  enableSorting: !1,
1221
1226
  cell: (A) => {
@@ -1223,13 +1228,13 @@ const yr = /* @__PURE__ */ me({
1223
1228
  return ke(Ut, {
1224
1229
  modelValue: s,
1225
1230
  fallback: ne,
1226
- disable: !D(U.combinationKey).orderFrom,
1231
+ disable: D(U.combinationKey).orderFrom,
1227
1232
  required: !0,
1228
1233
  editActiveOnly: D(U.combinationKey).orderFromActiveOnly,
1229
1234
  "onUpdate:modelValue": (J) => {
1230
- var I;
1235
+ var C;
1231
1236
  if (W) {
1232
- const G = (I = A.row.getParentRow()) == null ? void 0 : I.original;
1237
+ const G = (C = A.row.getParentRow()) == null ? void 0 : C.original;
1233
1238
  if (!G) return;
1234
1239
  w(
1235
1240
  G._id,
@@ -1255,9 +1260,9 @@ const yr = /* @__PURE__ */ me({
1255
1260
  size: 80,
1256
1261
  cell: (A) => {
1257
1262
  const s = A.row.original, U = A.row.depth > 0;
1258
- return c("div", {
1263
+ return d("div", {
1259
1264
  class: "flex items-center justify-end"
1260
- }, [D(null).priceTier && c(nn, {
1265
+ }, [D(null).priceTier && d(nn, {
1261
1266
  menuStore: r,
1262
1267
  priceTiers: s.priceTiers,
1263
1268
  "onUpdate:priceTiers": (ne) => {
@@ -1275,7 +1280,7 @@ const yr = /* @__PURE__ */ me({
1275
1280
  } else
1276
1281
  i(s._id, "priceTiers", ne);
1277
1282
  }
1278
- }, null), D(s.combinationKey).inventory && c(Et, {
1283
+ }, null), D(s.combinationKey).inventory && d(Et, {
1279
1284
  title: "Inventory",
1280
1285
  initialValue: s.inventoryBindings ?? [],
1281
1286
  name: s.name ?? s.fallbackName ?? "",
@@ -1298,13 +1303,13 @@ const yr = /* @__PURE__ */ me({
1298
1303
  }, {
1299
1304
  default: ({
1300
1305
  trigger: ne
1301
- }) => c(H("fm-tooltip"), {
1306
+ }) => d(H("fm-tooltip"), {
1302
1307
  content: "Inventory",
1303
1308
  zIndex: 110
1304
1309
  }, {
1305
1310
  default: () => {
1306
1311
  var W;
1307
- return [c(H("fm-button"), {
1312
+ return [d(H("fm-button"), {
1308
1313
  variant: Oe.Tertiary,
1309
1314
  prependIcon: "inventory_2",
1310
1315
  overwriteIconOutline: (W = s.inventoryBindings) != null && W.length ? "filled" : "outline",
@@ -1313,7 +1318,7 @@ const yr = /* @__PURE__ */ me({
1313
1318
  }, null)];
1314
1319
  }
1315
1320
  })
1316
- }), D(s.combinationKey).link && c(H("fm-button"), {
1321
+ }), D(s.combinationKey).link && d(H("fm-button"), {
1317
1322
  variant: Oe.Tertiary,
1318
1323
  prependIcon: "delete",
1319
1324
  textColor: De.NeutralGray400,
@@ -1369,17 +1374,17 @@ const yr = /* @__PURE__ */ me({
1369
1374
  });
1370
1375
  }
1371
1376
  function w(A, s, U, ne) {
1372
- var G, j;
1377
+ var G, q;
1373
1378
  const W = he(t.group), J = (G = W.items[A].items) == null ? void 0 : G.findIndex((X) => X.combinationKey === s);
1374
1379
  if (!Bt.isSet(J)) return;
1375
- let I = (j = W.items[A].items) == null ? void 0 : j[J];
1376
- I && (typeof U == "object" && U !== null ? I = {
1377
- ...I,
1380
+ let C = (q = W.items[A].items) == null ? void 0 : q[J];
1381
+ C && (typeof U == "object" && U !== null ? C = {
1382
+ ...C,
1378
1383
  ...U
1379
- } : I = {
1380
- ...I,
1384
+ } : C = {
1385
+ ...C,
1381
1386
  [U]: ne
1382
- }, W.items[A].items[J] = I, o("update:group", W));
1387
+ }, W.items[A].items[J] = C, o("update:group", W));
1383
1388
  }
1384
1389
  function x(A) {
1385
1390
  const s = he(t.group);
@@ -1406,28 +1411,28 @@ const yr = /* @__PURE__ */ me({
1406
1411
  };
1407
1412
  })
1408
1413
  }, o("update:unmap-group", s);
1409
- }, Y = (A) => A.items;
1410
- function q(A) {
1414
+ }, j = (A) => A.items;
1415
+ function Y(A) {
1411
1416
  const s = he(t.group);
1412
1417
  s.items = A.reduce((U, ne) => ({
1413
1418
  ...U,
1414
1419
  [ne._id]: ne
1415
1420
  }), {}), o("update:group", s);
1416
1421
  }
1417
- const le = go(), de = O(() => le.breakpoints.value.xs);
1422
+ const ie = go(), de = O(() => ie.breakpoints.value.xs);
1418
1423
  return (A, s) => {
1419
1424
  const U = H("fm-button"), ne = H("fm-table");
1420
1425
  return V(), oe(Pe, {
1421
- title: e(d)("menu.group.option.title")
1426
+ title: e(c)("menu.group.option.title")
1422
1427
  }, {
1423
1428
  "append-title": B(() => [A.config.link() ? (V(), Z(Te, {
1424
1429
  key: 0
1425
- }, [b.value ? (V(), Z("div", wr, [c(Vt, {
1430
+ }, [g.value ? (V(), Z("div", wr, [d(Vt, {
1426
1431
  "categorized-items": A.categorizedItems,
1427
- "initial-value": C.value,
1432
+ "initial-value": I.value,
1428
1433
  "show-variant": A.config.bindToVariant,
1429
- "select-variant": "",
1430
- title: e(d)("menu.group.option.link_products"),
1434
+ "select-variant": !1,
1435
+ title: e(c)("menu.group.option.link_products"),
1431
1436
  "is-local-only": !0,
1432
1437
  onSubmit: s[0] || (s[0] = ({
1433
1438
  items: W
@@ -1435,36 +1440,36 @@ const yr = /* @__PURE__ */ me({
1435
1440
  }, {
1436
1441
  default: B(({
1437
1442
  trigger: W
1438
- }) => [c(U, {
1443
+ }) => [d(U, {
1439
1444
  "text-color": e(De).ColorPrimary,
1440
1445
  "border-color": e(De).ColorPrimary,
1441
1446
  variant: "secondary",
1442
- label: e(d)("menu.group.option.link_products"),
1447
+ label: e(c)("menu.group.option.link_products"),
1443
1448
  "prepend-icon": "link",
1444
1449
  onClick: W
1445
1450
  }, null, 8, ["text-color", "border-color", "label", "onClick"])]),
1446
1451
  _: 1
1447
- }, 8, ["categorized-items", "initial-value", "show-variant", "title"])])) : (V(), Z("div", kr, [c(U, {
1452
+ }, 8, ["categorized-items", "initial-value", "show-variant", "title"])])) : (V(), Z("div", kr, [d(U, {
1448
1453
  "text-color": e(De).ColorPrimary,
1449
1454
  "border-color": e(De).ColorPrimary,
1450
1455
  variant: "secondary",
1451
- label: e(d)("menu.group.option.add_option"),
1456
+ label: e(c)("menu.group.option.add_option"),
1452
1457
  "prepend-icon": "add",
1453
1458
  onClick: v
1454
1459
  }, null, 8, ["text-color", "border-color", "label"])]))], 64)) : ee("", !0)]),
1455
- default: B(() => [N("div", Cr, [N("div", Ir, [c(ne, {
1460
+ default: B(() => [N("div", Cr, [N("div", Ir, [d(ne, {
1456
1461
  "column-defs": M.value,
1457
1462
  "column-visibility": y.value,
1458
1463
  draggable: !de.value && D(null).name,
1459
1464
  "expanded-state": E.value ? {} : P.value,
1460
- "get-sub-row": Y,
1465
+ "get-sub-row": j,
1461
1466
  "page-size": 999,
1462
1467
  "row-data": T.value,
1463
1468
  "search-value": e(f),
1464
1469
  "shrink-at": !1,
1465
1470
  "hide-footer": "",
1466
1471
  "onUpdate:expandedState": s[1] || (s[1] = (W) => P.value = W),
1467
- onDndChanged: s[2] || (s[2] = (W) => q(W)),
1472
+ onDndChanged: s[2] || (s[2] = (W) => Y(W)),
1468
1473
  "onUpdate:dragging": s[3] || (s[3] = (W) => E.value = W)
1469
1474
  }, null, 8, ["column-defs", "column-visibility", "draggable", "expanded-state", "row-data", "search-value"])])])]),
1470
1475
  _: 1
@@ -1487,7 +1492,7 @@ const yr = /* @__PURE__ */ me({
1487
1492
  emits: ["update:group", "submit:group", "status:show"],
1488
1493
  setup(u, { expose: a, emit: t }) {
1489
1494
  let o = u;
1490
- const p = t, r = be(), _ = lt(), E = ze(), m = Nt(at(je())), { countDefaultItems: b, validateGroupItems: h, minMaxValidationRules: C } = Gn(
1495
+ const p = t, r = be(), _ = lt(), E = ze(), m = Nt(at(je())), { countDefaultItems: g, validateGroupItems: h, minMaxValidationRules: I } = Gn(
1491
1496
  () => o.group
1492
1497
  ), f = te(!1), n = te(!1), S = (l) => {
1493
1498
  Bt.isBoolean(l) ? n.value = l : n.value = !n.value;
@@ -1529,21 +1534,21 @@ const yr = /* @__PURE__ */ me({
1529
1534
  }
1530
1535
  }).onPrimary(R) : R();
1531
1536
  }
1532
- function d(l) {
1537
+ function c(l) {
1533
1538
  return new rn(r, m.updateMenu, E).mapGroups(
1534
1539
  [l],
1535
1540
  D.value.isOverride
1536
1541
  )[0];
1537
1542
  }
1538
- const g = te(Fe.clone(o.group)), M = Gt(
1539
- () => !Fe.isEqual(o.group, g.value),
1543
+ const b = te(Fe.clone(o.group)), M = Gt(
1544
+ () => !Fe.isEqual(o.group, b.value),
1540
1545
  () => {
1541
1546
  n.value = !1;
1542
1547
  }
1543
1548
  ), k = O(() => o.action === "add" ? x("common.add") : x("common.update"));
1544
1549
  async function y() {
1545
1550
  if (o.action === "add") {
1546
- const { group: l, linkItems: R } = zn(o.group), Y = {
1551
+ const { group: l, linkItems: R } = zn(o.group), j = {
1547
1552
  module: xe.enum.group,
1548
1553
  operation: Ee.F_OPERATION_TYPE.create,
1549
1554
  data: l,
@@ -1555,14 +1560,14 @@ const yr = /* @__PURE__ */ me({
1555
1560
  }
1556
1561
  ]
1557
1562
  };
1558
- await r.updateMenu(Y), p("submit:group", o.group);
1563
+ await r.updateMenu(j), p("submit:group", o.group);
1559
1564
  } else o.action === "update" && p("submit:group", o.group);
1560
1565
  S(!1);
1561
1566
  }
1562
1567
  Ve(
1563
1568
  () => n.value,
1564
1569
  async (l) => {
1565
- p("status:show", l), l && (await gt(), g.value = Fe.clone(o.group));
1570
+ p("status:show", l), l && (await gt(), b.value = Fe.clone(o.group));
1566
1571
  }
1567
1572
  );
1568
1573
  const v = O(() => {
@@ -1571,9 +1576,9 @@ const yr = /* @__PURE__ */ me({
1571
1576
  }), i = O(() => {
1572
1577
  const l = {};
1573
1578
  return r.state.menu.modules.group.forEach((R) => {
1574
- var Y;
1575
- for (const [q, le] of Object.entries(R.customAttributes || {}))
1576
- typeof le == "string" && le && !((Y = l[q]) != null && Y.includes(le)) && (l[q] = [...l[q] || [], le]);
1579
+ var j;
1580
+ for (const [Y, ie] of Object.entries(R.customAttributes || {}))
1581
+ typeof ie == "string" && ie && !((j = l[Y]) != null && j.includes(ie)) && (l[Y] = [...l[Y] || [], ie]);
1577
1582
  }), l;
1578
1583
  }), w = (l) => {
1579
1584
  o.group && T({
@@ -1587,10 +1592,10 @@ const yr = /* @__PURE__ */ me({
1587
1592
  });
1588
1593
  const { t: x } = ye();
1589
1594
  return (l, R) => {
1590
- const Y = H("fm-text-field"), q = H("fm-stepper-field"), le = H("FmFormGroup"), de = H("fm-radio"), A = H("fm-radio-group"), s = H("fm-switch"), U = H("FormSection"), ne = H("fm-button"), W = H("fm-side-sheet");
1595
+ const j = H("fm-text-field"), Y = H("fm-stepper-field"), ie = H("FmFormGroup"), de = H("fm-radio"), A = H("fm-radio-group"), s = H("fm-switch"), U = H("FormSection"), ne = H("fm-button"), W = H("fm-side-sheet");
1591
1596
  return V(), Z(Te, null, [
1592
1597
  Ge(l.$slots, "default", { trigger: S }),
1593
- c(W, {
1598
+ d(W, {
1594
1599
  id: "group-form",
1595
1600
  modelValue: n.value,
1596
1601
  "onUpdate:modelValue": R[8] || (R[8] = (J) => n.value = J),
@@ -1607,14 +1612,14 @@ const yr = /* @__PURE__ */ me({
1607
1612
  ]),
1608
1613
  "side-sheet-footer": B(() => [
1609
1614
  N("div", Er, [
1610
- c(ne, {
1615
+ d(ne, {
1611
1616
  label: e(So)(k.value),
1612
1617
  loading: f.value,
1613
1618
  size: "lg",
1614
1619
  type: "submit",
1615
1620
  variant: "primary"
1616
1621
  }, null, 8, ["label", "loading"]),
1617
- c(ne, {
1622
+ d(ne, {
1618
1623
  label: e(x)("menu.common.actions.cancel"),
1619
1624
  size: "lg",
1620
1625
  variant: "tertiary",
@@ -1625,10 +1630,10 @@ const yr = /* @__PURE__ */ me({
1625
1630
  default: B(() => [
1626
1631
  l.group ? (V(), Z("div", Sr, [
1627
1632
  Ge(l.$slots, "variant-section"),
1628
- c(bo, null, {
1633
+ d(bo, null, {
1629
1634
  default: B(() => [
1630
1635
  N("div", null, [
1631
- c(Y, {
1636
+ d(j, {
1632
1637
  modelValue: l.group.name,
1633
1638
  "onUpdate:modelValue": R[0] || (R[0] = (J) => l.group.name = J),
1634
1639
  disabled: F("name"),
@@ -1639,14 +1644,14 @@ const yr = /* @__PURE__ */ me({
1639
1644
  label: e(x)("menu.common.labels.group_name")
1640
1645
  }, null, 8, ["modelValue", "disabled", "rules", "label"])
1641
1646
  ]),
1642
- c(le, {
1647
+ d(ie, {
1643
1648
  "model-value": l.group,
1644
- rules: e(C)
1649
+ rules: e(I)
1645
1650
  }, {
1646
1651
  default: B(() => [
1647
- c(Kn, null, {
1652
+ d(Kn, null, {
1648
1653
  default: B(() => [
1649
- c(q, {
1654
+ d(Y, {
1650
1655
  modelValue: l.group.min,
1651
1656
  "onUpdate:modelValue": R[1] || (R[1] = (J) => l.group.min = J),
1652
1657
  disabled: F("min"),
@@ -1654,7 +1659,7 @@ const yr = /* @__PURE__ */ me({
1654
1659
  class: "flex-1",
1655
1660
  label: e(x)("menu.common.labels.min_select")
1656
1661
  }, null, 8, ["modelValue", "disabled", "label"]),
1657
- c(q, {
1662
+ d(Y, {
1658
1663
  modelValue: l.group.max,
1659
1664
  "onUpdate:modelValue": R[2] || (R[2] = (J) => l.group.max = J),
1660
1665
  disabled: F("max"),
@@ -1673,7 +1678,7 @@ const yr = /* @__PURE__ */ me({
1673
1678
  label: e(x)("menu.common.labels.group_type")
1674
1679
  }, {
1675
1680
  default: B(() => [
1676
- c(A, {
1681
+ d(A, {
1677
1682
  disabled: F("type"),
1678
1683
  "model-value": l.group.type,
1679
1684
  "onUpdate:modelValue": R[3] || (R[3] = (J) => P(J))
@@ -1690,11 +1695,11 @@ const yr = /* @__PURE__ */ me({
1690
1695
  ]),
1691
1696
  _: 1
1692
1697
  }, 8, ["label"])) : ee("", !0),
1693
- c(Ne, {
1698
+ d(Ne, {
1694
1699
  label: e(x)("menu.common.labels.configuration")
1695
1700
  }, {
1696
1701
  default: B(() => [
1697
- c(s, {
1702
+ d(s, {
1698
1703
  modelValue: l.group.stackable,
1699
1704
  "onUpdate:modelValue": R[4] || (R[4] = (J) => l.group.stackable = J),
1700
1705
  disabled: F("stackable"),
@@ -1711,7 +1716,7 @@ const yr = /* @__PURE__ */ me({
1711
1716
  "sub-title": e(x)("menu.group.form.tagging.subtitle")
1712
1717
  }, {
1713
1718
  default: B(() => [
1714
- c(e(dn), {
1719
+ d(e(dn), {
1715
1720
  entity: "group",
1716
1721
  "model-value": l.group.customAttributes || {},
1717
1722
  "onUpdate:modelValue": w,
@@ -1723,23 +1728,23 @@ const yr = /* @__PURE__ */ me({
1723
1728
  ]),
1724
1729
  _: 1
1725
1730
  }),
1726
- c(le, {
1731
+ d(ie, {
1727
1732
  tag: "div",
1728
1733
  modelValue: l.group,
1729
1734
  rules: [e(h)],
1730
1735
  "helper-text": e(x)("menu.common.validation.default_items_tip", {
1731
- count: e(b)(l.group),
1736
+ count: e(g)(l.group),
1732
1737
  max: l.group.max
1733
1738
  })
1734
1739
  }, {
1735
1740
  default: B(() => [
1736
- c(xr, {
1741
+ d(xr, {
1737
1742
  "allow-refund-inventory": l.allowRefundInventory ?? !1,
1738
1743
  "categorized-items": l.categorizedItems,
1739
1744
  config: D.value,
1740
1745
  group: l.group,
1741
1746
  "onUpdate:group": R[5] || (R[5] = (J) => T(J)),
1742
- "onUpdate:unmapGroup": R[6] || (R[6] = (J) => T(d(J)))
1747
+ "onUpdate:unmapGroup": R[6] || (R[6] = (J) => T(c(J)))
1743
1748
  }, null, 8, ["allow-refund-inventory", "categorized-items", "config", "group"])
1744
1749
  ]),
1745
1750
  _: 1
@@ -1760,27 +1765,27 @@ const yr = /* @__PURE__ */ me({
1760
1765
  },
1761
1766
  emits: ["update:combinations"],
1762
1767
  setup(u, { expose: a, emit: t }) {
1763
- var P, d;
1764
- const o = u, p = t, r = be(), _ = ze(), E = Nt(at(je())), m = te([]), b = te(o.combinations[0].combinationKey || ""), h = O(
1765
- () => m.value.findIndex((g) => g.combinationKey == b.value)
1766
- ), C = O(
1767
- () => o.combinations.map((g) => ({
1768
- label: o.fullCombinations[g.combinationKey || ""],
1769
- value: g.combinationKey || ""
1768
+ var P, c;
1769
+ const o = u, p = t, r = be(), _ = ze(), E = Nt(at(je())), m = te([]), g = te(o.combinations[0].combinationKey || ""), h = O(
1770
+ () => m.value.findIndex((b) => b.combinationKey == g.value)
1771
+ ), I = O(
1772
+ () => o.combinations.map((b) => ({
1773
+ label: o.fullCombinations[b.combinationKey || ""],
1774
+ value: b.combinationKey || ""
1770
1775
  }))
1771
1776
  ), f = O(() => {
1772
1777
  var i, w;
1773
1778
  if (!F.value) return null;
1774
- const g = ((w = (i = m.value[h.value]) == null ? void 0 : i.groups) == null ? void 0 : w.find((x) => x._id === o.groupId)) || {
1779
+ const b = ((w = (i = m.value[h.value]) == null ? void 0 : i.groups) == null ? void 0 : w.find((x) => x._id === o.groupId)) || {
1775
1780
  _id: o.groupId,
1776
1781
  groupKey: ""
1777
- }, k = r.state.menu.modules.group.find((x) => x._id === o.groupId), y = Object.entries({ ...g, items: void 0 }).filter(([, x]) => !!x), v = {
1782
+ }, k = r.state.menu.modules.group.find((x) => x._id === o.groupId), y = Object.entries({ ...b, items: void 0 }).filter(([, x]) => !!x), v = {
1778
1783
  ...k,
1779
1784
  ...Object.fromEntries(y),
1780
1785
  items: k.items.map((x) => {
1781
1786
  var R;
1782
- const l = (R = g.items) == null ? void 0 : R.find(
1783
- (Y) => Y._id == x._id && Y.combinationKey == x.combinationKey
1787
+ const l = (R = b.items) == null ? void 0 : R.find(
1788
+ (j) => j._id == x._id && j.combinationKey == x.combinationKey
1784
1789
  );
1785
1790
  return {
1786
1791
  ...x,
@@ -1793,22 +1798,22 @@ const yr = /* @__PURE__ */ me({
1793
1798
  };
1794
1799
  return new rn(r, E.updateMenu, _).mapGroups([v], !0)[0];
1795
1800
  });
1796
- function n(g) {
1801
+ function n(b) {
1797
1802
  var v, i;
1798
1803
  const M = (v = m.value[h.value].groups) == null ? void 0 : v.findIndex(
1799
1804
  (w) => w._id === o.groupId
1800
- ), k = he(m.value), y = { ...on(g), _id: o.groupId, groupKey: "" };
1805
+ ), k = he(m.value), y = { ...on(b), _id: o.groupId, groupKey: "" };
1801
1806
  (M ?? -1) < 0 ? k[h.value] = {
1802
1807
  ...k[h.value],
1803
1808
  groups: [...((i = k[h.value]) == null ? void 0 : i.groups) || [], y]
1804
1809
  } : k[h.value].groups[M] = y, m.value = k;
1805
1810
  }
1806
- function S(g) {
1807
- const M = C.value.length;
1811
+ function S(b) {
1812
+ const M = I.value.length;
1808
1813
  let k = h.value;
1809
- g === "left" ? k = k === 0 ? M - 1 : k - 1 : k = k === M - 1 ? 0 : k + 1, b.value = C.value[k].value;
1814
+ b === "left" ? k = k === 0 ? M - 1 : k - 1 : k = k === M - 1 ? 0 : k + 1, g.value = I.value[k].value;
1810
1815
  }
1811
- function D(g) {
1816
+ function D(b) {
1812
1817
  return {
1813
1818
  isV4: r.version === Ze.enum.v4,
1814
1819
  isDefault: (M) => !0,
@@ -1828,7 +1833,7 @@ const yr = /* @__PURE__ */ me({
1828
1833
  };
1829
1834
  }
1830
1835
  function z() {
1831
- const g = m.value.map((M) => {
1836
+ const b = m.value.map((M) => {
1832
1837
  var k;
1833
1838
  return {
1834
1839
  ...M,
@@ -1837,22 +1842,22 @@ const yr = /* @__PURE__ */ me({
1837
1842
  }))
1838
1843
  };
1839
1844
  });
1840
- p("update:combinations", g);
1845
+ p("update:combinations", b);
1841
1846
  }
1842
1847
  const F = te(!1);
1843
1848
  Ve(
1844
1849
  () => F.value,
1845
- (g) => {
1846
- g && (m.value = he(o.combinations), b.value = o.combinations[0].combinationKey || "");
1850
+ (b) => {
1851
+ b && (m.value = he(o.combinations), g.value = o.combinations[0].combinationKey || "");
1847
1852
  }
1848
1853
  );
1849
1854
  const $ = te();
1850
1855
  a({
1851
1856
  show: (P = $.value) == null ? void 0 : P.show,
1852
- trigger: (d = $.value) == null ? void 0 : d.trigger
1857
+ trigger: (c = $.value) == null ? void 0 : c.trigger
1853
1858
  });
1854
1859
  const { t: T } = ye();
1855
- return (g, M) => {
1860
+ return (b, M) => {
1856
1861
  const k = H("fm-select"), y = H("fm-button"), v = H("fm-card");
1857
1862
  return V(), oe(vn, {
1858
1863
  ref_key: "baseFormRef",
@@ -1868,10 +1873,10 @@ const yr = /* @__PURE__ */ me({
1868
1873
  "onStatus:show": M[5] || (M[5] = (i) => F.value = i)
1869
1874
  }, {
1870
1875
  default: B(({ trigger: i }) => [
1871
- Ge(g.$slots, "default", { trigger: i })
1876
+ Ge(b.$slots, "default", { trigger: i })
1872
1877
  ]),
1873
1878
  "variant-section": B(() => [
1874
- b.value ? (V(), oe(v, {
1879
+ g.value ? (V(), oe(v, {
1875
1880
  key: 0,
1876
1881
  class: "p-16 bg-fm-color-neutral-gray-100 space-y-24",
1877
1882
  variant: "outlined"
@@ -1879,20 +1884,20 @@ const yr = /* @__PURE__ */ me({
1879
1884
  default: B(() => [
1880
1885
  N("p", Fr, ve(e(T)("menu.group.option.variant")), 1),
1881
1886
  N("div", $r, [
1882
- c(k, {
1883
- modelValue: b.value,
1884
- "onUpdate:modelValue": M[0] || (M[0] = (i) => b.value = i),
1885
- items: C.value,
1887
+ d(k, {
1888
+ modelValue: g.value,
1889
+ "onUpdate:modelValue": M[0] || (M[0] = (i) => g.value = i),
1890
+ items: I.value,
1886
1891
  class: "flex-1"
1887
1892
  }, null, 8, ["modelValue", "items"]),
1888
1893
  N("div", Vr, [
1889
- c(y, {
1894
+ d(y, {
1890
1895
  variant: e(Oe).Tertiary,
1891
1896
  "prepend-icon": "keyboard_arrow_left",
1892
1897
  size: "lg",
1893
1898
  onClick: M[1] || (M[1] = (i) => S("left"))
1894
1899
  }, null, 8, ["variant"]),
1895
- c(y, {
1900
+ d(y, {
1896
1901
  variant: e(Oe).Tertiary,
1897
1902
  "prepend-icon": "keyboard_arrow_right",
1898
1903
  size: "lg",
@@ -1924,32 +1929,32 @@ const yr = /* @__PURE__ */ me({
1924
1929
  function m(z) {
1925
1930
  return he(z ?? []).sort(($, T) => $.position - T.position);
1926
1931
  }
1927
- const b = O(() => m(E.value).reduce((z, F) => (z[F._id] = {
1932
+ const g = O(() => m(E.value).reduce((z, F) => (z[F._id] = {
1928
1933
  name: F.name,
1929
1934
  type: an(r.items, F.items)
1930
1935
  }, z), {})), h = O(() => [
1931
- ...Object.entries(b.value).map(([z, { name: F, type: $ }]) => ({
1936
+ ...Object.entries(g.value).map(([z, { name: F, type: $ }]) => ({
1932
1937
  label: `${F} ${_.value.type ? `(${Ft($)})` : ""}`.trim(),
1933
1938
  value: z
1934
1939
  }))
1935
- ]), C = O(() => !!r.state.currentCatalogId || !!r.state.currentSchedulerId);
1940
+ ]), I = O(() => !!r.state.currentCatalogId || !!r.state.currentSchedulerId);
1936
1941
  O(() => {
1937
1942
  const z = !r.state.currentSchedulerId, F = r.rules.group.type, $ = r.version == Ze.enum.v3, T = r.rules.item.orderFromActiveOnly, P = r.rules.item.bindToVariant;
1938
- return function(g) {
1943
+ return function(b) {
1939
1944
  return {
1940
- isDefault: (M) => !C.value && !M,
1941
- link: (M) => !C.value && (!M || P),
1942
- name: (M) => !C.value && !M,
1943
- type: F && !g._id && !C.value,
1944
- price: g.type != _e.enum.DYNAMIC,
1945
+ isDefault: (M) => !I.value && !M,
1946
+ link: (M) => !I.value && (!M || P),
1947
+ name: (M) => !I.value && !M,
1948
+ type: F && !b._id && !I.value,
1949
+ price: b.type != _e.enum.DYNAMIC,
1945
1950
  priceEdit: !0,
1946
1951
  priceTier: r.isV4,
1947
- inventory: z ? $ ? !C.value && g.type == _e.enum.NORMAL : !C.value : !1,
1948
- orderFrom: (M) => z ? $ ? g.type == _e.enum.DYNAMIC ? C.value : !!C.value == !M : C.value : !1,
1952
+ inventory: z ? $ ? !I.value && b.type == _e.enum.NORMAL : !I.value : !1,
1953
+ orderFrom: (M) => z ? $ ? b.type == _e.enum.DYNAMIC ? I.value : !!I.value == !M : I.value : !1,
1949
1954
  orderFromActiveOnly: T,
1950
- showOrderFrom: z ? $ ? C.value ? !0 : g.type == _e.enum.PRODUCT : C.value : !1,
1955
+ showOrderFrom: z ? $ ? I.value ? !0 : b.type == _e.enum.PRODUCT : I.value : !1,
1951
1956
  bindToVariant: P,
1952
- isOverride: C.value,
1957
+ isOverride: I.value,
1953
1958
  isItemGroup: !1,
1954
1959
  isV4: !$
1955
1960
  };
@@ -1968,53 +1973,53 @@ const yr = /* @__PURE__ */ me({
1968
1973
  const $ = H("FmSearch"), T = H("FmCheckbox"), P = H("FmButton");
1969
1974
  return h.value.length > 0 ? (V(), Z("div", Ur, [
1970
1975
  N("div", null, [
1971
- c($, {
1976
+ d($, {
1972
1977
  autofocus: "",
1973
1978
  modelValue: n.value,
1974
- "onUpdate:modelValue": F[0] || (F[0] = (d) => n.value = d),
1979
+ "onUpdate:modelValue": F[0] || (F[0] = (c) => n.value = c),
1975
1980
  placeholder: e(S)("menu.common.labels.search_groups")
1976
1981
  }, null, 8, ["modelValue", "placeholder"])
1977
1982
  ]),
1978
1983
  N("div", Mr, [
1979
1984
  N("div", null, [
1980
- (V(!0), Z(Te, null, Ue(h.value, (d) => (V(), Z("div", {
1981
- key: d.value
1985
+ (V(!0), Z(Te, null, Ue(h.value, (c) => (V(), Z("div", {
1986
+ key: c.value
1982
1987
  }, [
1983
- rt(c(T, {
1988
+ rt(d(T, {
1984
1989
  modelValue: f.value,
1985
1990
  "onUpdate:modelValue": [
1986
- F[1] || (F[1] = (g) => f.value = g),
1987
- F[2] || (F[2] = (g) => e(o)(f.value))
1991
+ F[1] || (F[1] = (b) => f.value = b),
1992
+ F[2] || (F[2] = (b) => e(o)(f.value))
1988
1993
  ],
1989
- label: d.label,
1990
- value: d.value
1994
+ label: c.label,
1995
+ value: c.value
1991
1996
  }, null, 8, ["modelValue", "label", "value"]), [
1992
- [Zt, d.label.toLowerCase().includes(n.value.toLowerCase())]
1997
+ [Zt, c.label.toLowerCase().includes(n.value.toLowerCase())]
1993
1998
  ])
1994
1999
  ]))), 128))
1995
2000
  ])
1996
2001
  ]),
1997
2002
  N("div", Ar, [
1998
- c(e(Ht), null, {
1999
- default: B(({ trigger: d }) => [
2000
- c(P, {
2003
+ d(e(Ht), null, {
2004
+ default: B(({ trigger: c }) => [
2005
+ d(P, {
2001
2006
  label: e(S)("menu.common.actions.add_group"),
2002
2007
  variant: "tertiary",
2003
2008
  "text-color": "primary",
2004
- onClick: (g) => d()
2009
+ onClick: (b) => c()
2005
2010
  }, null, 8, ["label", "onClick"])
2006
2011
  ]),
2007
2012
  _: 1
2008
2013
  }),
2009
2014
  N("div", Rr, [
2010
- c(P, {
2015
+ d(P, {
2011
2016
  label: e(S)("menu.common.actions.cancel"),
2012
2017
  variant: "tertiary",
2013
- onClick: F[3] || (F[3] = (d) => e(t).close())
2018
+ onClick: F[3] || (F[3] = (c) => e(t).close())
2014
2019
  }, null, 8, ["label"]),
2015
- c(P, {
2020
+ d(P, {
2016
2021
  label: e(S)("menu.common.actions.confirm"),
2017
- onClick: F[4] || (F[4] = (d) => D())
2022
+ onClick: F[4] || (F[4] = (c) => D())
2018
2023
  }, null, 8, ["label"])
2019
2024
  ])
2020
2025
  ])
@@ -2023,12 +2028,12 @@ const yr = /* @__PURE__ */ me({
2023
2028
  N("p", Gr, ve(e(S)("menu.common.empty.no_group.title")), 1),
2024
2029
  N("p", Br, ve(e(S)("menu.common.empty.no_group.subtitle")), 1)
2025
2030
  ]),
2026
- c(e(Ht), null, {
2027
- default: B(({ trigger: d }) => [
2028
- c(P, {
2031
+ d(e(Ht), null, {
2032
+ default: B(({ trigger: c }) => [
2033
+ d(P, {
2029
2034
  label: e(S)("menu.common.actions.add_group"),
2030
2035
  icon: "add",
2031
- onClick: (g) => d()
2036
+ onClick: (b) => c()
2032
2037
  }, null, 8, ["label", "onClick"])
2033
2038
  ]),
2034
2039
  _: 1
@@ -2055,7 +2060,7 @@ const yr = /* @__PURE__ */ me({
2055
2060
  }) {
2056
2061
  const t = u, o = be(), p = ze(), {
2057
2062
  t: r
2058
- } = ye(), _ = a, E = O(() => o.rules.group), m = O(() => o.rules.item), b = O(() => o.groups);
2063
+ } = ye(), _ = a, E = O(() => o.rules.group), m = O(() => o.rules.item), g = O(() => o.groups);
2059
2064
  function h(v, i) {
2060
2065
  return he(i ?? []).map((x) => {
2061
2066
  const l = v.find((R) => R._id === x._id);
@@ -2066,26 +2071,26 @@ const yr = /* @__PURE__ */ me({
2066
2071
  };
2067
2072
  });
2068
2073
  }
2069
- const C = O(() => {
2074
+ const I = O(() => {
2070
2075
  var i;
2071
- return [...f(h(b.value, t.form.groups || ((i = t.fallback) == null ? void 0 : i.groups) || [])).map((w) => w._id)];
2076
+ return [...f(h(g.value, t.form.groups || ((i = t.fallback) == null ? void 0 : i.groups) || [])).map((w) => w._id)];
2072
2077
  });
2073
2078
  function f(v) {
2074
2079
  return he(v ?? []).sort((w, x) => w.position - x.position);
2075
2080
  }
2076
2081
  function n(v) {
2077
- const i = b.value.find((l) => l._id === v);
2082
+ const i = g.value.find((l) => l._id === v);
2078
2083
  if (!i)
2079
2084
  return [];
2080
2085
  const w = [];
2081
2086
  return i.items.forEach((l) => {
2082
2087
  if (l.combinationKey)
2083
2088
  return;
2084
- const R = o.items.find((q) => q._id === l._id), Y = i.items.filter((q) => q._id === l._id && q.combinationKey).length;
2089
+ const R = o.items.find((Y) => Y._id === l._id), j = i.items.filter((Y) => Y._id === l._id && Y.combinationKey).length;
2085
2090
  w.push({
2086
2091
  code: l.code || (R == null ? void 0 : R.code),
2087
2092
  name: l.name || (R == null ? void 0 : R.name),
2088
- variantCount: Y
2093
+ variantCount: j
2089
2094
  });
2090
2095
  }), w.map((l) => {
2091
2096
  const R = [(l == null ? void 0 : l.code) || "", (l == null ? void 0 : l.name) || ""].join(" ").trim();
@@ -2094,7 +2099,7 @@ const yr = /* @__PURE__ */ me({
2094
2099
  })})` : R;
2095
2100
  });
2096
2101
  }
2097
- const S = O(() => f(b.value).reduce((v, i) => (v[i._id] = {
2102
+ const S = O(() => f(g.value).reduce((v, i) => (v[i._id] = {
2098
2103
  name: i.name,
2099
2104
  type: an(o.items, i.items)
2100
2105
  }, v), {})), D = O(() => [...Object.entries(S.value).map(([v, {
@@ -2128,20 +2133,20 @@ const yr = /* @__PURE__ */ me({
2128
2133
  size: 200,
2129
2134
  cell: (v) => {
2130
2135
  const i = v.row.original._id, x = n(i).join(", ");
2131
- return c(Ie.FmTooltip, {
2136
+ return d(Ie.FmTooltip, {
2132
2137
  "z-index": 51,
2133
2138
  class: "flex",
2134
2139
  variant: "rich",
2135
2140
  placement: "top"
2136
2141
  }, {
2137
- default: () => c("div", {
2142
+ default: () => d("div", {
2138
2143
  class: "line-clamp-2 break-all"
2139
2144
  }, [x]),
2140
- content: () => c("div", {
2145
+ content: () => d("div", {
2141
2146
  class: "py-12 px-16 space-y-12"
2142
- }, [c("p", {
2147
+ }, [d("p", {
2143
2148
  class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-600"
2144
- }, [r("menu.group.list.columns.products")]), c("div", {
2149
+ }, [r("menu.group.list.columns.products")]), d("div", {
2145
2150
  class: "flex flex-wrap gap-8"
2146
2151
  }, [x])])
2147
2152
  });
@@ -2164,7 +2169,7 @@ const yr = /* @__PURE__ */ me({
2164
2169
  }, ["stop", "prevent"])
2165
2170
  }), ke(Or, {
2166
2171
  // variant items
2167
- combinations: g.value ?? [],
2172
+ combinations: b.value ?? [],
2168
2173
  // combinationKey: varaintName
2169
2174
  fullCombinations: t.fullCombinations,
2170
2175
  groupId: i,
@@ -2190,7 +2195,7 @@ const yr = /* @__PURE__ */ me({
2190
2195
  title: r("menu.product.form.group.add"),
2191
2196
  contentComponent: Kr,
2192
2197
  contentComponentProps: {
2193
- groupIds: C.value
2198
+ groupIds: I.value
2194
2199
  }
2195
2200
  }).onPrimary((v) => {
2196
2201
  T(v);
@@ -2199,7 +2204,7 @@ const yr = /* @__PURE__ */ me({
2199
2204
  function T(v) {
2200
2205
  const i = v.reduce((w, x) => {
2201
2206
  var R;
2202
- const l = ((R = t.form.groups) == null ? void 0 : R.find((Y) => Y._id === x)) || {
2207
+ const l = ((R = t.form.groups) == null ? void 0 : R.find((j) => j._id === x)) || {
2203
2208
  _id: x,
2204
2209
  groupKey: ""
2205
2210
  };
@@ -2217,18 +2222,18 @@ const yr = /* @__PURE__ */ me({
2217
2222
  const i = he(t.form.groups);
2218
2223
  i.splice(i.findIndex((R) => R._id === v), 1);
2219
2224
  for (const R of ((w = t.form.variant) == null ? void 0 : w.variantCombinations) || [])
2220
- (l = R.groups) == null || l.splice((x = R.groups) == null ? void 0 : x.findIndex((Y) => Y._id === v), 1);
2225
+ (l = R.groups) == null || l.splice((x = R.groups) == null ? void 0 : x.findIndex((j) => j._id === v), 1);
2221
2226
  _("replace:form", jt(o, {
2222
2227
  ...t.form,
2223
2228
  groups: i
2224
2229
  }));
2225
2230
  }
2226
- const d = O(() => {
2231
+ const c = O(() => {
2227
2232
  var v;
2228
2233
  return !!((v = t.form.variant) != null && v.variantGroupIds.length);
2229
- }), g = O(() => {
2234
+ }), b = O(() => {
2230
2235
  var v;
2231
- return d.value ? (v = t.form.variant) == null ? void 0 : v.variantCombinations : [{
2236
+ return c.value ? (v = t.form.variant) == null ? void 0 : v.variantCombinations : [{
2232
2237
  _id: t.form._id,
2233
2238
  combinationKey: "",
2234
2239
  groups: t.form.groups || []
@@ -2249,13 +2254,13 @@ const yr = /* @__PURE__ */ me({
2249
2254
  return !1;
2250
2255
  }
2251
2256
  }
2252
- Ve(() => b.value.length, () => T([...C.value, b.value[b.value.length - 1]._id]));
2257
+ Ve(() => g.value.length, () => T([...I.value, g.value[g.value.length - 1]._id]));
2253
2258
  const k = (v) => {
2254
2259
  var i;
2255
2260
  return (i = D.value.find((w) => w.value === v)) == null ? void 0 : i.label;
2256
2261
  }, y = (v) => {
2257
2262
  var i;
2258
- d.value ? _("update:form", "variant", {
2263
+ c.value ? _("update:form", "variant", {
2259
2264
  variantGroupIds: ((i = t.form.variant) == null ? void 0 : i.variantGroupIds) || [],
2260
2265
  variantCombinations: v
2261
2266
  }) : _("update:form", "groups", v[0].groups || []);
@@ -2267,24 +2272,24 @@ const yr = /* @__PURE__ */ me({
2267
2272
  "sub-title": e(r)("menu.product.form.group.subtitle"),
2268
2273
  id: e($e).GROUP
2269
2274
  }, {
2270
- "append-title": B(() => [c(w, {
2275
+ "append-title": B(() => [d(w, {
2271
2276
  class: "flex-shrink-0",
2272
2277
  label: e(r)("menu.product.form.group.add"),
2273
2278
  "prepend-icon": "add",
2274
2279
  variant: "secondary",
2275
2280
  onClick: $
2276
2281
  }, null, 8, ["label"])]),
2277
- default: B(() => [c(ln, null, {
2282
+ default: B(() => [d(ln, null, {
2278
2283
  default: B(() => {
2279
2284
  var l;
2280
- return [((l = C.value) == null ? void 0 : l.length) > 0 ? (V(), oe(x, {
2285
+ return [((l = I.value) == null ? void 0 : l.length) > 0 ? (V(), oe(x, {
2281
2286
  key: 0,
2282
2287
  "column-defs": z.value,
2283
2288
  "column-visibility": F.value,
2284
- "row-data": C.value.map((R) => ({
2289
+ "row-data": I.value.map((R) => ({
2285
2290
  _id: R
2286
2291
  })),
2287
- "page-size": C.value.length,
2292
+ "page-size": I.value.length,
2288
2293
  "hide-footer": "",
2289
2294
  "pin-header-row": "",
2290
2295
  "shrink-at": !1
@@ -2319,19 +2324,19 @@ const yr = /* @__PURE__ */ me({
2319
2324
  }) {
2320
2325
  const {
2321
2326
  t
2322
- } = ye(), o = u, p = a, r = be(), _ = O(() => r.rules.item), E = O(() => _.value.inventory), m = O(() => r.state.menu.lowStockThreshold), b = O(() => o.form.lowStockThreshold), h = O(() => m.value != null ? String(m.value) : t("menu.inventory.threshold.not_set"));
2323
- function C(T) {
2327
+ } = ye(), o = u, p = a, r = be(), _ = O(() => r.rules.item), E = O(() => _.value.inventory), m = O(() => r.state.menu.lowStockThreshold), g = O(() => o.form.lowStockThreshold), h = O(() => m.value != null ? String(m.value) : t("menu.inventory.threshold.not_set"));
2328
+ function I(T) {
2324
2329
  const P = Fe.clone(o.form);
2325
2330
  P.lowStockThreshold = T === null ? void 0 : T, p("replace:form", P);
2326
2331
  }
2327
- function f(T, P, d, g) {
2332
+ function f(T, P, c, b) {
2328
2333
  return !P || P && P.length === 0 ? [{
2329
2334
  _id: "",
2330
- name: d || "",
2335
+ name: c || "",
2331
2336
  binding: T || []
2332
2337
  }] : P.map((M) => ({
2333
2338
  _id: M.combinationKey || "",
2334
- name: cn(M.combinationKey || "", g),
2339
+ name: cn(M.combinationKey || "", b),
2335
2340
  binding: M.inventoryBindings || []
2336
2341
  }));
2337
2342
  }
@@ -2344,25 +2349,25 @@ const yr = /* @__PURE__ */ me({
2344
2349
  });
2345
2350
  function D(T, P) {
2346
2351
  var k, y;
2347
- let d = Fe.clone(o.form);
2348
- const g = d.variant;
2349
- if ((((k = g == null ? void 0 : g.variantCombinations) == null ? void 0 : k.length) ?? 0) > 0 && g) {
2350
- const v = g.variantCombinations.findIndex((w) => w.combinationKey === T);
2352
+ let c = Fe.clone(o.form);
2353
+ const b = c.variant;
2354
+ if ((((k = b == null ? void 0 : b.variantCombinations) == null ? void 0 : k.length) ?? 0) > 0 && b) {
2355
+ const v = b.variantCombinations.findIndex((w) => w.combinationKey === T);
2351
2356
  if (v < 0) return;
2352
- const i = Fe.clone(g.variantCombinations);
2353
- i[v].inventoryBindings = P, d = {
2354
- ...d,
2357
+ const i = Fe.clone(b.variantCombinations);
2358
+ i[v].inventoryBindings = P, c = {
2359
+ ...c,
2355
2360
  variant: {
2356
- variantGroupIds: ((y = d.variant) == null ? void 0 : y.variantGroupIds) || [],
2361
+ variantGroupIds: ((y = c.variant) == null ? void 0 : y.variantGroupIds) || [],
2357
2362
  variantCombinations: i
2358
2363
  }
2359
2364
  };
2360
2365
  } else
2361
- d = {
2362
- ...d,
2366
+ c = {
2367
+ ...c,
2363
2368
  inventoryBindings: P
2364
2369
  };
2365
- p("replace:form", d);
2370
+ p("replace:form", c);
2366
2371
  }
2367
2372
  te([{
2368
2373
  accessorKey: "name",
@@ -2394,25 +2399,25 @@ const yr = /* @__PURE__ */ me({
2394
2399
  enableSorting: !1,
2395
2400
  cell: (T) => {
2396
2401
  const P = T.row.original;
2397
- return E.value ? c("div", {
2402
+ return E.value ? d("div", {
2398
2403
  class: "flex items-center justify-end"
2399
- }, [c(Et, {
2404
+ }, [d(Et, {
2400
2405
  name: P.name,
2401
2406
  initialValue: P.bindings ?? [],
2402
2407
  title: t("menu.inventory.dialog.title", {
2403
2408
  name: n.value
2404
2409
  }),
2405
- "onUpdate:inventory": (d) => {
2406
- D(P.key, d);
2410
+ "onUpdate:inventory": (c) => {
2411
+ D(P.key, c);
2407
2412
  }
2408
2413
  }, {
2409
2414
  default: ({
2410
- trigger: d
2411
- }) => c(H("fm-button"), {
2415
+ trigger: c
2416
+ }) => d(H("fm-button"), {
2412
2417
  variant: Oe.Tertiary,
2413
2418
  prependIcon: "edit",
2414
2419
  textColor: De.NeutralGray400,
2415
- onClick: d
2420
+ onClick: c
2416
2421
  }, null)
2417
2422
  })]) : null;
2418
2423
  }
@@ -2428,26 +2433,26 @@ const yr = /* @__PURE__ */ me({
2428
2433
  return Xe(() => {
2429
2434
  $.readInventory();
2430
2435
  }), (T, P) => {
2431
- const d = H("FmStepperField");
2432
- return V(), Z(Te, null, [c(Pe, {
2436
+ const c = H("FmStepperField");
2437
+ return V(), Z(Te, null, [d(Pe, {
2433
2438
  title: e(t)("menu.inventory.title"),
2434
2439
  subTitle: e(t)("menu.inventory.subtitle")
2435
2440
  }, {
2436
- default: B(() => [N("div", jr, [N("div", Yr, [(V(!0), Z(Te, null, Ue(S.value, (g) => (V(), oe(e(Et), {
2437
- key: g._id,
2441
+ default: B(() => [N("div", jr, [N("div", Yr, [(V(!0), Z(Te, null, Ue(S.value, (b) => (V(), oe(e(Et), {
2442
+ key: b._id,
2438
2443
  ref_for: !0,
2439
2444
  ref_key: "inventoryManagerForms",
2440
2445
  ref: z,
2441
2446
  title: e(t)("menu.inventory.dialog.title", {
2442
2447
  name: n.value
2443
2448
  }),
2444
- name: g.name || "",
2445
- bindingKey: g._id,
2446
- initialValue: g.binding ?? [],
2449
+ name: b.name || "",
2450
+ bindingKey: b._id,
2451
+ initialValue: b.binding ?? [],
2447
2452
  "onUpdate:inventory": (M) => {
2448
- D(g._id, M);
2453
+ D(b._id, M);
2449
2454
  }
2450
- }, null, 8, ["title", "name", "bindingKey", "initialValue", "onUpdate:inventory"]))), 128)), c(e(Fo), {
2455
+ }, null, 8, ["title", "name", "bindingKey", "initialValue", "onUpdate:inventory"]))), 128)), d(e(Fo), {
2451
2456
  "row-data": S.value,
2452
2457
  onRowClick: F
2453
2458
  }, null, 8, ["row-data"])])])]),
@@ -2456,17 +2461,17 @@ const yr = /* @__PURE__ */ me({
2456
2461
  key: 0
2457
2462
  }, [P[0] || (P[0] = N("div", {
2458
2463
  class: "w-full h-[2px] bg-fm-color-neutral-gray-100"
2459
- }, null, -1)), c(Pe, {
2464
+ }, null, -1)), d(Pe, {
2460
2465
  title: e(t)("menu.inventory.threshold.title"),
2461
2466
  "sub-title": e(t)("menu.inventory.threshold.subtitle")
2462
2467
  }, {
2463
- default: B(() => [c(d, {
2464
- "model-value": b.value ?? null,
2468
+ default: B(() => [d(c, {
2469
+ "model-value": g.value ?? null,
2465
2470
  step: 1,
2466
2471
  placeholder: h.value,
2467
- rules: [(g) => g === null || Number.isInteger(g) || e(t)("menu.inventory.threshold.must_be_integer")],
2472
+ rules: [(b) => b === null || Number.isInteger(b) || e(t)("menu.inventory.threshold.must_be_integer")],
2468
2473
  "helper-text": e(t)("menu.inventory.threshold.helper_text"),
2469
- "onUpdate:modelValue": C
2474
+ "onUpdate:modelValue": I
2470
2475
  }, null, 8, ["model-value", "placeholder", "rules", "helper-text"])]),
2471
2476
  _: 1
2472
2477
  }, 8, ["title", "sub-title"])], 64)) : ee("", !0)], 64);
@@ -2499,29 +2504,29 @@ const yr = /* @__PURE__ */ me({
2499
2504
  setup(u, { emit: a }) {
2500
2505
  const t = u, o = lt(), p = be(), { t: r } = ye(), _ = a, E = O(() => p.rules.item), m = O(() => {
2501
2506
  var M, k;
2502
- const d = t.isOverride ? ((M = t.fallback) == null ? void 0 : M.unit) ?? ((k = t.fallback) == null ? void 0 : k.perXUnit) : void 0, g = t.form.unit ?? t.form.perXUnit ?? d;
2503
- return g != null;
2504
- }), b = (d) => {
2505
- _("update:form", "unit", d ? "" : void 0), _("update:form", "perXUnit", d ? 0 : void 0);
2507
+ const c = t.isOverride ? ((M = t.fallback) == null ? void 0 : M.unit) ?? ((k = t.fallback) == null ? void 0 : k.perXUnit) : void 0, b = t.form.unit ?? t.form.perXUnit ?? c;
2508
+ return b != null;
2509
+ }), g = (c) => {
2510
+ _("update:form", "unit", c ? "" : void 0), _("update:form", "perXUnit", c ? 0 : void 0);
2506
2511
  }, h = O(() => {
2507
- const d = p.isV4;
2508
- return _t.setCoreStore(o).taxSetting(d);
2509
- }), C = O(() => {
2510
- var d;
2512
+ const c = p.isV4;
2513
+ return _t.setCoreStore(o).taxSetting(c);
2514
+ }), I = O(() => {
2515
+ var c;
2511
2516
  return _t.getSelectedTax(
2512
2517
  t.form.taxes,
2513
- (d = t.fallback) == null ? void 0 : d.taxes,
2518
+ (c = t.fallback) == null ? void 0 : c.taxes,
2514
2519
  h.value.countryTaxOptions
2515
2520
  );
2516
2521
  });
2517
- function f(d) {
2518
- const g = d.replace(/[^0-9.]/g, "");
2519
- if (!d) return !1;
2520
- _("update:form", "perXUnit", parseFloat(g));
2522
+ function f(c) {
2523
+ const b = c.replace(/[^0-9.]/g, "");
2524
+ if (!c) return !1;
2525
+ _("update:form", "perXUnit", parseFloat(b));
2521
2526
  }
2522
- function n(d) {
2523
- if (!d && t.form.perXUnit) {
2524
- const [g, M] = t.form.perXUnit.toString().split(".");
2527
+ function n(c) {
2528
+ if (!c && t.form.perXUnit) {
2529
+ const [b, M] = t.form.perXUnit.toString().split(".");
2525
2530
  if (M && M.length > 4) {
2526
2531
  const y = (typeof t.form.perXUnit == "string" ? parseFloat(t.form.perXUnit) : t.form.perXUnit).toFixed(4);
2527
2532
  _("update:form", "perXUnit", parseFloat(y));
@@ -2529,40 +2534,32 @@ const yr = /* @__PURE__ */ me({
2529
2534
  }
2530
2535
  }
2531
2536
  const S = mn();
2532
- en("apply-pricing", (d) => {
2533
- _("update:form", "price", Ce.Dinero.fromNumber({ number: d }).toObject());
2537
+ en("apply-pricing", (c) => {
2538
+ _("update:form", "price", Ce.Dinero.fromNumber({ number: c }).toObject());
2534
2539
  });
2535
2540
  async function D() {
2536
- const d = t.form.name || "";
2537
- if (!d) {
2538
- const g = document.getElementById("product-name");
2539
- if (g) {
2540
- g.focus();
2541
+ const c = t.form.name || "";
2542
+ if (!c) {
2543
+ const b = document.getElementById("product-name");
2544
+ if (b) {
2545
+ b.focus();
2541
2546
  return;
2542
2547
  } else
2543
2548
  return;
2544
2549
  }
2545
2550
  o.pushDataLayer({ event: "menu_catalog_item_price_remy_suggest_pricing" }), S.activate({
2546
- prompt: `Suggest a price for ${d}`,
2551
+ prompt: `Suggest a price for ${c}`,
2547
2552
  command: "suggestPrice"
2548
2553
  });
2549
2554
  }
2550
2555
  const z = $o(p), F = O(() => {
2551
- var d, g;
2552
- return ((d = p.currentCatalog) == null ? void 0 : d.priceTierRules) ?? ((g = p.currentCatalog) == null ? void 0 : g.usePriceTiers) ?? [];
2553
- }), $ = Kt(), T = O(() => {
2554
- const d = t.form.price_variant;
2555
- return d && Object.keys(d).length > 0 ? d : Object.fromEntries(
2556
- Object.entries($.memberPricings.value ?? {}).map(([g, M]) => [
2557
- M.key,
2558
- null
2559
- ])
2560
- );
2561
- });
2562
- function P(d, g) {
2563
- _("update:form", "price_variant", At(d));
2556
+ var c, b;
2557
+ return ((c = p.currentCatalog) == null ? void 0 : c.priceTierRules) ?? ((b = p.currentCatalog) == null ? void 0 : b.usePriceTiers) ?? [];
2558
+ }), $ = Kt(), T = O(() => $.getMemberPricingPriceVariant(t.form.price_variant));
2559
+ function P(c, b) {
2560
+ _("update:form", "price_variant", At(c));
2564
2561
  }
2565
- return (d, g) => {
2562
+ return (c, b) => {
2566
2563
  const M = H("fm-select"), k = H("FmButton"), y = H("fm-checkbox"), v = H("fm-text-field"), i = Jt("tooltip");
2567
2564
  return V(), oe(Pe, {
2568
2565
  title: e(r)("menu.product.form.price.title")
@@ -2574,21 +2571,21 @@ const yr = /* @__PURE__ */ me({
2574
2571
  id: e($e).PRICE,
2575
2572
  class: we(["flex space-x-16", "xs:flex-col xs:space-x-0 xs:space-y-16"])
2576
2573
  }, [
2577
- c(Je, {
2574
+ d(Je, {
2578
2575
  disable: F.value.length > 0 && e(p).currentCatalog && !e(p).currentScheduler,
2579
2576
  min: 0,
2580
- "model-value": d.form.price || null,
2581
- placeholder: (w = d.fallback) != null && w.price ? e(Be)(d.fallback.price, !1) : void 0,
2577
+ "model-value": c.form.price || null,
2578
+ placeholder: (w = c.fallback) != null && w.price ? e(Be)(c.fallback.price, !1) : void 0,
2582
2579
  rules: [
2583
2580
  E.value.price ? (l) => !!l || e(r)("menu.product.form.price.fields.selling_price.required") : void 0
2584
2581
  ].filter(e(Bt).isSet),
2585
2582
  class: "w-[258px] xs:w-full",
2586
2583
  label: e(r)("menu.product.form.price.fields.selling_price.label"),
2587
2584
  "show-currency": "",
2588
- "onUpdate:modelValue": g[0] || (g[0] = (l) => l && _("update:form", "price", l))
2585
+ "onUpdate:modelValue": b[0] || (b[0] = (l) => l && _("update:form", "price", l))
2589
2586
  }, {
2590
2587
  append: B(() => [
2591
- rt(c(e(pn), {
2588
+ rt(d(e(pn), {
2592
2589
  "pure-styling": "",
2593
2590
  class: "shrink-0 scale-75",
2594
2591
  onClick: D
@@ -2598,17 +2595,17 @@ const yr = /* @__PURE__ */ me({
2598
2595
  ]),
2599
2596
  _: 1
2600
2597
  }, 8, ["disable", "model-value", "placeholder", "rules", "label"]),
2601
- c(M, {
2598
+ d(M, {
2602
2599
  disabled: !E.value.tax || !h.value.systemCode,
2603
2600
  items: h.value.countryTaxOptions,
2604
2601
  label: h.value.systemCode ? e(r)("menu.product.form.price.fields.tax.label_with_code", {
2605
2602
  code: h.value.systemCode
2606
2603
  }) : e(r)("menu.product.form.price.fields.tax.label"),
2607
- "model-value": C.value,
2604
+ "model-value": I.value,
2608
2605
  placeholder: "--",
2609
2606
  class: "flex-1",
2610
2607
  "shift-menu": "",
2611
- "onUpdate:modelValue": g[1] || (g[1] = (l) => _("update:form", "taxes", [e(_t).decodeTax(l)]))
2608
+ "onUpdate:modelValue": b[1] || (b[1] = (l) => _("update:form", "taxes", [e(_t).decodeTax(l)]))
2612
2609
  }, null, 8, ["disabled", "items", "label", "model-value"])
2613
2610
  ], 8, Wr),
2614
2611
  e(p).isV4 ? (V(), Z("div", Hr, [
@@ -2617,19 +2614,19 @@ const yr = /* @__PURE__ */ me({
2617
2614
  N("p", Jr, ve(e(r)("menu.product.form.member_price.description")), 1)
2618
2615
  ]),
2619
2616
  N("div", Zr, [
2620
- c(Mt, {
2617
+ d(Mt, {
2621
2618
  title: e(r)("menu.product.form.member_price.configure.title"),
2622
2619
  currentConfig: "Main Pricing",
2623
- "product-name": d.form.name,
2624
- "base-price": d.form.price,
2625
- "base-price-fallback": (x = d.fallback) != null && x.price ? e(Be)(d.fallback.price, !1) : void 0,
2620
+ "product-name": c.form.name,
2621
+ "base-price": c.form.price,
2622
+ "base-price-fallback": (x = c.fallback) != null && x.price ? e(Be)(c.fallback.price, !1) : void 0,
2626
2623
  "price-variants": T.value,
2627
2624
  "show-remy": !0,
2628
- "onUpdate:basePrice": g[2] || (g[2] = (l) => _("update:form", "price", l)),
2629
- "onUpdate:priceVariants": g[3] || (g[3] = (l) => P(l))
2625
+ "onUpdate:basePrice": b[2] || (b[2] = (l) => _("update:form", "price", l)),
2626
+ "onUpdate:priceVariants": b[3] || (b[3] = (l) => P(l))
2630
2627
  }, {
2631
2628
  default: B(({ trigger: l }) => [
2632
- c(k, {
2629
+ d(k, {
2633
2630
  variant: e(Oe).Secondary,
2634
2631
  label: e(r)("menu.product.form.member_price.configure.title"),
2635
2632
  onClick: (R) => l()
@@ -2637,16 +2634,16 @@ const yr = /* @__PURE__ */ me({
2637
2634
  ]),
2638
2635
  _: 1
2639
2636
  }, 8, ["title", "product-name", "base-price", "base-price-fallback", "price-variants"]),
2640
- c(Rt, { "price-variants": T.value }, null, 8, ["price-variants"])
2637
+ d(Rt, { "price-variants": T.value }, null, 8, ["price-variants"])
2641
2638
  ])
2642
2639
  ])) : ee("", !0),
2643
- !d.isOverride && e(p).isV4 ? (V(), oe(Ne, {
2640
+ !c.isOverride && e(p).isV4 ? (V(), oe(Ne, {
2644
2641
  key: 1,
2645
2642
  label: e(r)("menu.price_tier.price_group"),
2646
2643
  description: e(r)("menu.price_tier.description")
2647
2644
  }, {
2648
2645
  append: B(() => [
2649
- c(k, {
2646
+ d(k, {
2650
2647
  label: e(r)("menu.price_tier.add_price_group"),
2651
2648
  icon: "add",
2652
2649
  variant: "secondary",
@@ -2656,50 +2653,50 @@ const yr = /* @__PURE__ */ me({
2656
2653
  default: B(() => {
2657
2654
  var l;
2658
2655
  return [
2659
- d.isOverride ? ee("", !0) : (V(), oe(Yn, {
2656
+ c.isOverride ? ee("", !0) : (V(), oe(Yn, {
2660
2657
  key: 0,
2661
2658
  "price-tiers": e(z).priceTiers.value,
2662
- "model-value": d.form.priceTiers || ((l = d.fallback) == null ? void 0 : l.priceTiers) || {},
2659
+ "model-value": c.form.priceTiers || ((l = c.fallback) == null ? void 0 : l.priceTiers) || {},
2663
2660
  "allow-negative-price": !1,
2664
- "onUpdate:modelValue": g[4] || (g[4] = (R) => _("update:form", "priceTiers", R))
2661
+ "onUpdate:modelValue": b[4] || (b[4] = (R) => _("update:form", "priceTiers", R))
2665
2662
  }, null, 8, ["price-tiers", "model-value"]))
2666
2663
  ];
2667
2664
  }),
2668
2665
  _: 1
2669
2666
  }, 8, ["label", "description"])) : ee("", !0),
2670
- c(Ne, {
2667
+ d(Ne, {
2671
2668
  label: e(r)("menu.product.form.price.settings.title")
2672
2669
  }, {
2673
2670
  default: B(() => {
2674
- var l, R, Y;
2671
+ var l, R, j;
2675
2672
  return [
2676
2673
  N("div", ea, [
2677
- c(y, {
2678
- disabled: !E.value.openPrice || d.isAddon,
2679
- "model-value": d.form.openPrice ?? ((l = d.fallback) == null ? void 0 : l.openPrice) ?? !1,
2680
- value: d.form.openPrice,
2674
+ d(y, {
2675
+ disabled: !E.value.openPrice || c.isAddon,
2676
+ "model-value": c.form.openPrice ?? ((l = c.fallback) == null ? void 0 : l.openPrice) ?? !1,
2677
+ value: c.form.openPrice,
2681
2678
  label: e(r)("menu.product.form.price.settings.open_price.label"),
2682
2679
  sublabel: e(r)("menu.product.form.price.settings.open_price.sublabel"),
2683
- "onUpdate:modelValue": g[5] || (g[5] = (q) => _("update:form", "openPrice", q))
2680
+ "onUpdate:modelValue": b[5] || (b[5] = (Y) => _("update:form", "openPrice", Y))
2684
2681
  }, null, 8, ["disabled", "model-value", "value", "label", "sublabel"]),
2685
2682
  N("div", ta, [
2686
- c(y, {
2687
- disabled: !E.value.unit || d.isAddon,
2683
+ d(y, {
2684
+ disabled: !E.value.unit || c.isAddon,
2688
2685
  "model-value": m.value,
2689
2686
  value: m.value,
2690
2687
  label: e(r)("menu.product.form.price.settings.sell_by_unit.label"),
2691
2688
  sublabel: e(r)("menu.product.form.price.settings.sell_by_unit.sublabel"),
2692
- "onUpdate:modelValue": b
2689
+ "onUpdate:modelValue": g
2693
2690
  }, null, 8, ["disabled", "model-value", "value", "label", "sublabel"]),
2694
2691
  m.value ? (V(), Z("div", na, [
2695
2692
  N("p", oa, ve(e(r)("menu.product.form.price.settings.sell_by_unit.per_unit.label")), 1),
2696
2693
  N("div", ra, [
2697
- c(v, {
2694
+ d(v, {
2698
2695
  disabled: !E.value.unit,
2699
- "model-value": d.form.perXUnit || ((R = d.fallback) == null ? void 0 : R.perXUnit) || null,
2696
+ "model-value": c.form.perXUnit || ((R = c.fallback) == null ? void 0 : R.perXUnit) || null,
2700
2697
  rules: [
2701
- (q) => !!q || e(r)("menu.product.form.price.settings.sell_by_unit.per_unit.required"),
2702
- (q) => !q || q > 0 || e(r)("menu.product.form.price.settings.sell_by_unit.per_unit.min")
2698
+ (Y) => !!Y || e(r)("menu.product.form.price.settings.sell_by_unit.per_unit.required"),
2699
+ (Y) => !Y || Y > 0 || e(r)("menu.product.form.price.settings.sell_by_unit.per_unit.min")
2703
2700
  ],
2704
2701
  inputmode: "numeric",
2705
2702
  placeholder: e(r)("menu.product.form.price.settings.sell_by_unit.per_unit.placeholder"),
@@ -2709,56 +2706,56 @@ const yr = /* @__PURE__ */ me({
2709
2706
  }, null, 8, ["disabled", "model-value", "rules", "placeholder"])
2710
2707
  ]),
2711
2708
  N("div", aa, [
2712
- c(v, {
2709
+ d(v, {
2713
2710
  disabled: !E.value.unit,
2714
- "model-value": d.form.unit || ((Y = d.fallback) == null ? void 0 : Y.unit) || null,
2711
+ "model-value": c.form.unit || ((j = c.fallback) == null ? void 0 : j.unit) || null,
2715
2712
  rules: [
2716
- (q) => !!q || e(r)("menu.product.form.price.settings.sell_by_unit.unit.required")
2713
+ (Y) => !!Y || e(r)("menu.product.form.price.settings.sell_by_unit.unit.required")
2717
2714
  ],
2718
2715
  placeholder: e(r)("menu.product.form.price.settings.sell_by_unit.unit.placeholder"),
2719
- "onUpdate:modelValue": g[6] || (g[6] = (q) => _("update:form", "unit", q))
2716
+ "onUpdate:modelValue": b[6] || (b[6] = (Y) => _("update:form", "unit", Y))
2720
2717
  }, null, 8, ["disabled", "model-value", "rules", "placeholder"])
2721
2718
  ])
2722
2719
  ])) : ee("", !0)
2723
2720
  ]),
2724
2721
  E.value.costing ? (V(), Z("div", la, [
2725
- c(y, {
2726
- "model-value": !!d.form.costing,
2727
- value: !!d.form.costing,
2722
+ d(y, {
2723
+ "model-value": !!c.form.costing,
2724
+ value: !!c.form.costing,
2728
2725
  label: e(r)("menu.product.form.price.settings.track_costing.label"),
2729
- "onUpdate:modelValue": g[7] || (g[7] = (q) => _("update:form", "costing", q ? e(Ce.Dinero).zero().toObject() : void 0))
2726
+ "onUpdate:modelValue": b[7] || (b[7] = (Y) => _("update:form", "costing", Y ? e(Ce.Dinero).zero().toObject() : void 0))
2730
2727
  }, null, 8, ["model-value", "value", "label"]),
2731
- d.form.costing ? (V(), Z("div", ia, [
2728
+ c.form.costing ? (V(), Z("div", ia, [
2732
2729
  N("div", sa, [
2733
- c(Je, {
2730
+ d(Je, {
2734
2731
  class: "w-full",
2735
2732
  min: 0,
2736
- "model-value": d.form.costing || null,
2733
+ "model-value": c.form.costing || null,
2737
2734
  nullable: "",
2738
2735
  "show-currency": "",
2739
- "onUpdate:modelValue": g[8] || (g[8] = (q) => _("update:form", "costing", q ?? e(Ce.Dinero).zero().toObject()))
2736
+ "onUpdate:modelValue": b[8] || (b[8] = (Y) => _("update:form", "costing", Y ?? e(Ce.Dinero).zero().toObject()))
2740
2737
  }, null, 8, ["model-value"])
2741
2738
  ])
2742
2739
  ])) : ee("", !0)
2743
2740
  ])) : ee("", !0),
2744
2741
  E.value.minPrice ? (V(), Z("div", ua, [
2745
- c(y, {
2746
- disabled: !E.value.minPrice || d.isAddon,
2747
- "model-value": !!d.form.minPrice,
2748
- value: !!d.form.minPrice,
2742
+ d(y, {
2743
+ disabled: !E.value.minPrice || c.isAddon,
2744
+ "model-value": !!c.form.minPrice,
2745
+ value: !!c.form.minPrice,
2749
2746
  label: e(r)("menu.product.form.price.settings.min_price.label"),
2750
- "onUpdate:modelValue": g[9] || (g[9] = (q) => _("update:form", "minPrice", q ? e(Ce.Dinero).zero().toObject() : void 0))
2747
+ "onUpdate:modelValue": b[9] || (b[9] = (Y) => _("update:form", "minPrice", Y ? e(Ce.Dinero).zero().toObject() : void 0))
2751
2748
  }, null, 8, ["disabled", "model-value", "value", "label"]),
2752
2749
  N("div", da, [
2753
2750
  N("div", ca, [
2754
- d.form.minPrice ? (V(), oe(Je, {
2751
+ c.form.minPrice ? (V(), oe(Je, {
2755
2752
  key: 0,
2756
- max: e(Ce.Dinero).fromFdoDinero(d.form.price).toUnit(),
2753
+ max: e(Ce.Dinero).fromFdoDinero(c.form.price).toUnit(),
2757
2754
  min: 0,
2758
- "model-value": d.form.minPrice || null,
2755
+ "model-value": c.form.minPrice || null,
2759
2756
  class: "flex-1",
2760
2757
  "show-currency": "",
2761
- "onUpdate:modelValue": g[10] || (g[10] = (q) => _("update:form", "minPrice", q ?? e(Ce.Dinero).zero().toObject()))
2758
+ "onUpdate:modelValue": b[10] || (b[10] = (Y) => _("update:form", "minPrice", Y ?? e(Ce.Dinero).zero().toObject()))
2762
2759
  }, null, 8, ["max", "model-value"])) : ee("", !0)
2763
2760
  ])
2764
2761
  ])
@@ -2793,16 +2790,16 @@ const yr = /* @__PURE__ */ me({
2793
2790
  toRoot: !1
2794
2791
  };
2795
2792
  }
2796
- const E = O(() => o.rules.item), m = O(() => o.printDepartments), b = O(() => {
2793
+ const E = O(() => o.rules.item), m = O(() => o.printDepartments), g = O(() => {
2797
2794
  var F;
2798
2795
  return ((F = t.form.print) == null ? void 0 : F.sequential) ?? !1;
2799
2796
  }), h = O(() => {
2800
2797
  var F;
2801
- return b.value ? m.value.reduce(
2798
+ return g.value ? m.value.reduce(
2802
2799
  ($, { _id: T }) => ($.includes(T) || ($ = [...$, T]), $),
2803
2800
  [...((F = t.form.print) == null ? void 0 : F.department) ?? []]
2804
2801
  ) : m.value.map(({ _id: $ }) => $);
2805
- }), C = O(() => m.value.reduce((F, $) => (F[$._id] = $.name, F), {}));
2802
+ }), I = O(() => m.value.reduce((F, $) => (F[$._id] = $.name, F), {}));
2806
2803
  function f(F) {
2807
2804
  r("update:form", "print", {
2808
2805
  ..._(),
@@ -2828,9 +2825,9 @@ const yr = /* @__PURE__ */ me({
2828
2825
  });
2829
2826
  }
2830
2827
  function D(F, $) {
2831
- var P, d;
2832
- let T = [...((d = (P = t.form) == null ? void 0 : P.print) == null ? void 0 : d.department) ?? []];
2833
- $ && !T.includes(F) ? T = [...T, F] : $ || (T = T.filter((g) => g !== F)), r("update:form", "print", {
2828
+ var P, c;
2829
+ let T = [...((c = (P = t.form) == null ? void 0 : P.print) == null ? void 0 : c.department) ?? []];
2830
+ $ && !T.includes(F) ? T = [...T, F] : $ || (T = T.filter((b) => b !== F)), r("update:form", "print", {
2834
2831
  ..._(),
2835
2832
  ...t.form.print,
2836
2833
  department: T
@@ -2852,7 +2849,7 @@ const yr = /* @__PURE__ */ me({
2852
2849
  () => m.value.length,
2853
2850
  () => D(m.value[m.value.length - 1]._id, !0)
2854
2851
  ), (F, $) => {
2855
- const T = H("fm-switch"), P = H("fm-radio"), d = H("fm-radio-group"), g = H("fm-button"), M = H("fm-checkbox");
2852
+ const T = H("fm-switch"), P = H("fm-radio"), c = H("fm-radio-group"), b = H("fm-button"), M = H("fm-checkbox");
2856
2853
  return V(), oe(Pe, {
2857
2854
  title: e(p)("menu.product.form.print.title")
2858
2855
  }, {
@@ -2866,7 +2863,7 @@ const yr = /* @__PURE__ */ me({
2866
2863
  default: B(() => {
2867
2864
  var y;
2868
2865
  return [
2869
- c(T, {
2866
+ d(T, {
2870
2867
  "model-value": !((y = F.form.print) != null && y.toRoot),
2871
2868
  label: e(p)("menu.product.form.print.config.group_parent.label"),
2872
2869
  "label-placement": "right",
@@ -2877,7 +2874,7 @@ const yr = /* @__PURE__ */ me({
2877
2874
  }),
2878
2875
  _: 1
2879
2876
  }, 8, ["label"])) : ee("", !0),
2880
- c(d, {
2877
+ d(c, {
2881
2878
  label: e(p)("menu.product.form.print.kds.label"),
2882
2879
  "model-value": ((k = F.form.print) == null ? void 0 : k.sequential) ?? !1,
2883
2880
  "onUpdate:modelValue": $[1] || ($[1] = (y) => n(y))
@@ -2894,7 +2891,7 @@ const yr = /* @__PURE__ */ me({
2894
2891
  ]),
2895
2892
  _: 1
2896
2893
  }, 8, ["label", "model-value"]),
2897
- c(Ne, {
2894
+ d(Ne, {
2898
2895
  label: e(p)("menu.product.form.print.routes.label")
2899
2896
  }, {
2900
2897
  default: B(() => [
@@ -2911,7 +2908,7 @@ const yr = /* @__PURE__ */ me({
2911
2908
  return [
2912
2909
  N("div", fa, [
2913
2910
  N("div", ga, [
2914
- b.value ? (V(), oe(g, {
2911
+ g.value ? (V(), oe(b, {
2915
2912
  key: 0,
2916
2913
  disabled: !((i = (v = t.form.print) == null ? void 0 : v.department) != null && i.includes(y)),
2917
2914
  class: "handle",
@@ -2921,10 +2918,10 @@ const yr = /* @__PURE__ */ me({
2921
2918
  }, ["stop"]))
2922
2919
  }, null, 8, ["disabled"])) : ee("", !0)
2923
2920
  ]),
2924
- c(M, {
2921
+ d(M, {
2925
2922
  id: y,
2926
2923
  "data-checked": (x = (w = t.form.print) == null ? void 0 : w.department) == null ? void 0 : x.includes(y),
2927
- label: C.value[y],
2924
+ label: I.value[y],
2928
2925
  "model-value": (((l = t.form.print) == null ? void 0 : l.department) ?? []).includes(y),
2929
2926
  value: y,
2930
2927
  class: "flex-1",
@@ -2935,10 +2932,10 @@ const yr = /* @__PURE__ */ me({
2935
2932
  }),
2936
2933
  _: 1
2937
2934
  }, 8, ["item-key", "model-value"])) : ee("", !0),
2938
- c(e(qn), { "apply-product": !1 }, {
2935
+ d(e(qn), { "apply-product": !1 }, {
2939
2936
  default: B(({ trigger: y }) => [
2940
2937
  N("div", va, [
2941
- c(g, {
2938
+ d(b, {
2942
2939
  variant: e(Oe).Secondary,
2943
2940
  label: e(p)("menu.product.form.print.routes.add"),
2944
2941
  "prepend-icon": "add",
@@ -2979,15 +2976,15 @@ const yr = /* @__PURE__ */ me({
2979
2976
  } = ye(), _ = a, {
2980
2977
  hasVariant: E,
2981
2978
  takeaways: m
2982
- } = Wn(t, _, p), b = O(() => [t.isOverride ? {
2979
+ } = Wn(t, _, p), g = O(() => [t.isOverride ? {
2983
2980
  label: r("menu.product.form.takeaway.options.follows_main"),
2984
2981
  value: null
2985
2982
  } : {
2986
2983
  label: r("menu.product.form.takeaway.options.no_preset"),
2987
2984
  value: null
2988
- }, ...o.takeaways.map((C) => ({
2989
- label: C.name,
2990
- value: C._id
2985
+ }, ...o.takeaways.map((I) => ({
2986
+ label: I.name,
2987
+ value: I._id
2991
2988
  }))]), h = te([{
2992
2989
  accessorKey: "name",
2993
2990
  enableSorting: !1,
@@ -2996,8 +2993,8 @@ const yr = /* @__PURE__ */ me({
2996
2993
  accessorKey: "takeaway",
2997
2994
  enableSorting: !1,
2998
2995
  header: () => r("menu.product.form.takeaway.columns.takeaway"),
2999
- cell: (C) => {
3000
- const f = C.getValue(), n = C.row.original;
2996
+ cell: (I) => {
2997
+ const f = I.getValue(), n = I.row.original;
3001
2998
  return ke(Io, {
3002
2999
  action: "add",
3003
3000
  applyProduct: !1,
@@ -3016,7 +3013,7 @@ const yr = /* @__PURE__ */ me({
3016
3013
  }) => ke(Ie.FmSelect, {
3017
3014
  modelValue: f || null,
3018
3015
  menuZIndex: 103,
3019
- items: b.value,
3016
+ items: g.value,
3020
3017
  shiftMenu: !0,
3021
3018
  "onUpdate:modelValue": (D) => {
3022
3019
  n.onUpdate(D || "");
@@ -3037,13 +3034,13 @@ const yr = /* @__PURE__ */ me({
3037
3034
  });
3038
3035
  }
3039
3036
  }]);
3040
- return (C, f) => {
3037
+ return (I, f) => {
3041
3038
  const n = H("fm-table");
3042
3039
  return V(), oe(Pe, {
3043
3040
  title: e(r)("menu.product.form.takeaway.title"),
3044
3041
  "sub-title": e(r)("menu.product.form.takeaway.subtitle")
3045
3042
  }, {
3046
- default: B(() => [c(n, {
3043
+ default: B(() => [d(n, {
3047
3044
  columnDefs: h.value,
3048
3045
  "page-size": e(m).length,
3049
3046
  "row-data": e(m),
@@ -3069,7 +3066,7 @@ const yr = /* @__PURE__ */ me({
3069
3066
  }, 100);
3070
3067
  }, r = be(), { t: _ } = ye(), E = O(
3071
3068
  () => t.initialValue ? _("menu.variant.form.title.edit") : _("menu.variant.form.title.add")
3072
- ), m = O(() => t.initialValue ? "Update" : "Add"), b = () => {
3069
+ ), m = O(() => t.initialValue ? "Update" : "Add"), g = () => {
3073
3070
  if (t.initialValue) {
3074
3071
  const P = he(t.initialValue);
3075
3072
  return P.options.push({
@@ -3078,13 +3075,13 @@ const yr = /* @__PURE__ */ me({
3078
3075
  }), P;
3079
3076
  } else
3080
3077
  return { ...Ke.generator.initMenuV4VariantGroup(), usedBy: [] };
3081
- }, h = te(b()), C = te(!1), f = te(!1);
3078
+ }, h = te(g()), I = te(!1), f = te(!1);
3082
3079
  function n(P) {
3083
3080
  h.value.options = P;
3084
3081
  }
3085
- function S(P, d) {
3086
- const g = he(h.value.options), M = g.findIndex((k) => k._id == P);
3087
- g[M].name = d, h.value.options = g, M === h.value.options.length - 1 && D();
3082
+ function S(P, c) {
3083
+ const b = he(h.value.options), M = b.findIndex((k) => k._id == P);
3084
+ b[M].name = c, h.value.options = b, M === h.value.options.length - 1 && D();
3088
3085
  }
3089
3086
  function D() {
3090
3087
  const P = he(h.value.options);
@@ -3097,8 +3094,8 @@ const yr = /* @__PURE__ */ me({
3097
3094
  ];
3098
3095
  }
3099
3096
  function z(P) {
3100
- const d = he(h.value.options);
3101
- h.value.options = d.filter((g) => g._id !== P);
3097
+ const c = he(h.value.options);
3098
+ h.value.options = c.filter((b) => b._id !== P);
3102
3099
  }
3103
3100
  Ve(
3104
3101
  () => h.value.options,
@@ -3110,13 +3107,13 @@ const yr = /* @__PURE__ */ me({
3110
3107
  }
3111
3108
  );
3112
3109
  function F(P) {
3113
- const d = P.draggedContext.futureIndex, g = P.relatedContext.list;
3114
- return d !== g.length - 1;
3110
+ const c = P.draggedContext.futureIndex, b = P.relatedContext.list;
3111
+ return c !== b.length - 1;
3115
3112
  }
3116
3113
  const $ = Gt(
3117
3114
  () => {
3118
3115
  if (t.initialValue) {
3119
- const P = h.value.options.filter((d) => !!d.name.trim());
3116
+ const P = h.value.options.filter((c) => !!c.name.trim());
3120
3117
  return !Fe.isEqual({ ...h.value, options: P }, t.initialValue);
3121
3118
  } else
3122
3119
  return !!(h.value.options.length > 1 || h.value.name.trim());
@@ -3126,9 +3123,9 @@ const yr = /* @__PURE__ */ me({
3126
3123
  }
3127
3124
  ), T = async () => {
3128
3125
  try {
3129
- C.value = !0;
3126
+ I.value = !0;
3130
3127
  const P = he(h.value);
3131
- P.options = P.options.filter((d) => !!d.name.trim()), t.initialValue ? await r.updateMenu({
3128
+ P.options = P.options.filter((c) => !!c.name.trim()), t.initialValue ? await r.updateMenu({
3132
3129
  module: xe.enum.variant,
3133
3130
  operation: Ee.F_OPERATION_TYPE.update,
3134
3131
  data: P
@@ -3138,22 +3135,22 @@ const yr = /* @__PURE__ */ me({
3138
3135
  data: P
3139
3136
  }), p();
3140
3137
  } finally {
3141
- C.value = !1;
3138
+ I.value = !1;
3142
3139
  }
3143
3140
  };
3144
3141
  return Ve(
3145
3142
  () => f.value,
3146
3143
  (P) => {
3147
- P ? h.value = b() : p();
3144
+ P ? h.value = g() : p();
3148
3145
  }
3149
3146
  ), Xe(() => {
3150
3147
  f.value = !0;
3151
- }), (P, d) => {
3152
- const g = H("fm-text-field"), M = H("fm-icon"), k = H("fm-button"), y = H("fm-side-sheet");
3148
+ }), (P, c) => {
3149
+ const b = H("fm-text-field"), M = H("fm-icon"), k = H("fm-button"), y = H("fm-side-sheet");
3153
3150
  return V(), oe(y, {
3154
3151
  id: "variant-form",
3155
3152
  modelValue: f.value,
3156
- "onUpdate:modelValue": d[2] || (d[2] = (v) => f.value = v),
3153
+ "onUpdate:modelValue": c[2] || (c[2] = (v) => f.value = v),
3157
3154
  "is-container": e(Ie).FmForm,
3158
3155
  "is-container-props": {
3159
3156
  onValidationSuccess: T,
@@ -3167,18 +3164,18 @@ const yr = /* @__PURE__ */ me({
3167
3164
  ]),
3168
3165
  "side-sheet-footer": B(() => [
3169
3166
  N("div", Ia, [
3170
- c(k, {
3167
+ d(k, {
3171
3168
  label: m.value,
3172
- loading: C.value,
3169
+ loading: I.value,
3173
3170
  size: "lg",
3174
3171
  type: "submit",
3175
3172
  variant: "primary"
3176
3173
  }, null, 8, ["label", "loading"]),
3177
- c(k, {
3174
+ d(k, {
3178
3175
  label: e(_)("menu.common.actions.cancel"),
3179
3176
  size: "lg",
3180
3177
  variant: "tertiary",
3181
- onClick: d[1] || (d[1] = () => f.value = !1)
3178
+ onClick: c[1] || (c[1] = () => f.value = !1)
3182
3179
  }, null, 8, ["label"])
3183
3180
  ])
3184
3181
  ]),
@@ -3186,25 +3183,25 @@ const yr = /* @__PURE__ */ me({
3186
3183
  var v;
3187
3184
  return [
3188
3185
  N("div", ha, [
3189
- c(Pe, {
3186
+ d(Pe, {
3190
3187
  title: e(_)("menu.variant.form.detail")
3191
3188
  }, {
3192
3189
  default: B(() => [
3193
- c(g, {
3190
+ d(b, {
3194
3191
  autofocus: "",
3195
3192
  label: e(_)("menu.variant.form.name.label"),
3196
3193
  "helper-text": e(_)("menu.variant.form.name.helper"),
3197
3194
  modelValue: h.value.name,
3198
- "onUpdate:modelValue": d[0] || (d[0] = (i) => h.value.name = i),
3195
+ "onUpdate:modelValue": c[0] || (c[0] = (i) => h.value.name = i),
3199
3196
  rules: [(i) => !!i || e(_)("menu.variant.form.name.required")],
3200
3197
  placeholder: e(_)("menu.variant.form.name.placeholder")
3201
3198
  }, null, 8, ["label", "helper-text", "modelValue", "rules", "placeholder"]),
3202
- c(Ne, {
3199
+ d(Ne, {
3203
3200
  label: e(_)("menu.variant.form.options.title")
3204
3201
  }, {
3205
3202
  default: B(() => [
3206
3203
  N("div", null, [
3207
- c(e(zt), {
3204
+ d(e(zt), {
3208
3205
  "model-value": h.value.options,
3209
3206
  move: F,
3210
3207
  class: "space-y-16",
@@ -3224,7 +3221,7 @@ const yr = /* @__PURE__ */ me({
3224
3221
  name: "drag_handle"
3225
3222
  })) : w > 0 ? (V(), Z("div", ka)) : ee("", !0),
3226
3223
  N("div", Ca, [
3227
- c(g, {
3224
+ d(b, {
3228
3225
  "model-value": i.name,
3229
3226
  rules: [
3230
3227
  () => !!h.value.options.length || e(_)("menu.variant.form.options.min_required"),
@@ -3237,7 +3234,7 @@ const yr = /* @__PURE__ */ me({
3237
3234
  w !== h.value.options.length - 1 ? {
3238
3235
  name: "append",
3239
3236
  fn: B(() => [
3240
- c(M, {
3237
+ d(M, {
3241
3238
  name: "close",
3242
3239
  onClick: (x) => z(i._id)
3243
3240
  }, null, 8, ["onClick"])
@@ -3302,17 +3299,17 @@ const Sa = {
3302
3299
  label: f.name,
3303
3300
  value: f._id,
3304
3301
  disabled: !1
3305
- }))), m = te(he(_.selectedVariants)), b = te(""), { createVariant: h } = Ta(), C = () => {
3302
+ }))), m = te(he(_.selectedVariants)), g = te(""), { createVariant: h } = Ta(), I = () => {
3306
3303
  t(m.value), o("primary"), a.close();
3307
3304
  };
3308
3305
  return (f, n) => {
3309
3306
  const S = H("FmSearch"), D = H("FmCheckbox"), z = H("FmButton");
3310
3307
  return E.value.length > 0 ? (V(), Z("div", Sa, [
3311
3308
  N("div", null, [
3312
- c(S, {
3309
+ d(S, {
3313
3310
  autofocus: "",
3314
- modelValue: b.value,
3315
- "onUpdate:modelValue": n[0] || (n[0] = (F) => b.value = F),
3311
+ modelValue: g.value,
3312
+ "onUpdate:modelValue": n[0] || (n[0] = (F) => g.value = F),
3316
3313
  placeholder: e(r)("menu.common.labels.search_variants")
3317
3314
  }, null, 8, ["modelValue", "placeholder"])
3318
3315
  ]),
@@ -3321,7 +3318,7 @@ const Sa = {
3321
3318
  (V(!0), Z(Te, null, Ue(E.value, (F) => (V(), Z("div", {
3322
3319
  key: F.value
3323
3320
  }, [
3324
- rt(c(D, {
3321
+ rt(d(D, {
3325
3322
  modelValue: m.value,
3326
3323
  "onUpdate:modelValue": [
3327
3324
  n[1] || (n[1] = ($) => m.value = $),
@@ -3330,7 +3327,7 @@ const Sa = {
3330
3327
  label: F.label,
3331
3328
  value: F.value
3332
3329
  }, null, 8, ["modelValue", "label", "value"]), [
3333
- [Zt, F.label.toLowerCase().includes(b.value.toLowerCase())]
3330
+ [Zt, F.label.toLowerCase().includes(g.value.toLowerCase())]
3334
3331
  ])
3335
3332
  ]))), 128))
3336
3333
  ])
@@ -3344,14 +3341,14 @@ const Sa = {
3344
3341
  onClick: n[3] || (n[3] = (F) => e(h)())
3345
3342
  }, null, 8, ["label"])) : ee("", !0),
3346
3343
  N("div", $a, [
3347
- c(z, {
3344
+ d(z, {
3348
3345
  label: e(r)("menu.common.actions.cancel"),
3349
3346
  variant: "tertiary",
3350
3347
  onClick: n[4] || (n[4] = (F) => e(a).close())
3351
3348
  }, null, 8, ["label"]),
3352
- c(z, {
3349
+ d(z, {
3353
3350
  label: e(r)("menu.common.actions.confirm"),
3354
- onClick: n[5] || (n[5] = (F) => C())
3351
+ onClick: n[5] || (n[5] = (F) => I())
3355
3352
  }, null, 8, ["label"])
3356
3353
  ])
3357
3354
  ])
@@ -3360,7 +3357,7 @@ const Sa = {
3360
3357
  N("p", Da, ve(e(r)("menu.common.empty.no_variant.title")), 1),
3361
3358
  N("p", Oa, ve(e(r)("menu.common.empty.no_variant.subtitle")), 1)
3362
3359
  ]),
3363
- c(z, {
3360
+ d(z, {
3364
3361
  label: e(r)("menu.variant.add"),
3365
3362
  icon: "add",
3366
3363
  onClick: n[6] || (n[6] = (F) => e(h)())
@@ -3395,7 +3392,7 @@ const Sa = {
3395
3392
  }) {
3396
3393
  const t = u, o = vt(), p = be(), r = Hn(), _ = je(), E = ze(), {
3397
3394
  t: m
3398
- } = ye(), b = O(() => p.rules.item), h = O(() => b.value.minPrice && !!t.form.minPrice), C = O(() => !p.state.currentCatalogId), f = O(() => p.variants.reduce((i, w) => (i[w._id] = w, i), {})), n = a;
3395
+ } = ye(), g = O(() => p.rules.item), h = O(() => g.value.minPrice && !!t.form.minPrice), I = O(() => !p.state.currentCatalogId), f = O(() => p.variants.reduce((i, w) => (i[w._id] = w, i), {})), n = a;
3399
3396
  function S(i) {
3400
3397
  const w = Fe.clone(t.form);
3401
3398
  for (const {
@@ -3432,26 +3429,26 @@ const Sa = {
3432
3429
  });
3433
3430
  }
3434
3431
  function F(i) {
3435
- var q, le;
3436
- const w = ((q = t.form.variant) == null ? void 0 : q.variantGroupIds) || [], x = (le = t.form.variant) == null ? void 0 : le.variantCombinations, Y = i.split(/(?=variant)/g).map((de) => de.replace(/\/*$/, "")).filter((de) => w.some((A) => de.includes(A))).join("/");
3437
- return x == null ? void 0 : x.find((de) => de.combinationKey === Y);
3432
+ var Y, ie;
3433
+ const w = ((Y = t.form.variant) == null ? void 0 : Y.variantGroupIds) || [], x = (ie = t.form.variant) == null ? void 0 : ie.variantCombinations, j = i.split(/(?=variant)/g).map((de) => de.replace(/\/*$/, "")).filter((de) => w.some((A) => de.includes(A))).join("/");
3434
+ return x == null ? void 0 : x.find((de) => de.combinationKey === j);
3438
3435
  }
3439
3436
  const $ = (i) => {
3440
3437
  P(i);
3441
3438
  }, T = O(() => {
3442
3439
  var w;
3443
3440
  return (((w = t.form.variant) == null ? void 0 : w.variantCombinations) || []).map((x) => {
3444
- var R, Y;
3445
- const l = (Y = (R = t.fallback) == null ? void 0 : R.variant) == null ? void 0 : Y.variantCombinations.find(({
3446
- combinationKey: q
3447
- }) => q === x.combinationKey);
3441
+ var R, j;
3442
+ const l = (j = (R = t.fallback) == null ? void 0 : R.variant) == null ? void 0 : j.variantCombinations.find(({
3443
+ combinationKey: Y
3444
+ }) => Y === x.combinationKey);
3448
3445
  return {
3449
3446
  ...x,
3450
3447
  fallback: {
3451
3448
  ...l,
3452
3449
  _id: x._id,
3453
3450
  combinationKey: x.combinationKey,
3454
- price: C.value ? t.form.price ?? (l == null ? void 0 : l.price) : x.price ?? (l == null ? void 0 : l.price),
3451
+ price: I.value ? t.form.price ?? (l == null ? void 0 : l.price) : x.price ?? (l == null ? void 0 : l.price),
3455
3452
  priceTiers: t.form.priceTiers,
3456
3453
  minPrice: t.form.minPrice ?? (l == null ? void 0 : l.minPrice)
3457
3454
  }
@@ -3460,20 +3457,20 @@ const Sa = {
3460
3457
  });
3461
3458
  function P(i, w = (x) => x) {
3462
3459
  var R;
3463
- const x = i.filter((Y) => !!Y);
3460
+ const x = i.filter((j) => !!j);
3464
3461
  let l;
3465
3462
  if (x.length) {
3466
- const Y = x.map((le) => p.variants.find((de) => de._id === le)), q = Ke.fullVariantCombination(Y).map(({
3467
- combinationKey: le
3463
+ const j = x.map((ie) => p.variants.find((de) => de._id === ie)), Y = Ke.fullVariantCombination(j).map(({
3464
+ combinationKey: ie
3468
3465
  }) => {
3469
3466
  var A;
3470
- const de = (A = t.form.variant) == null ? void 0 : A.variantCombinations.find((s) => s.combinationKey === le);
3467
+ const de = (A = t.form.variant) == null ? void 0 : A.variantCombinations.find((s) => s.combinationKey === ie);
3471
3468
  return w(de || {
3472
3469
  _id: t.form._id,
3473
- combinationKey: le
3470
+ combinationKey: ie
3474
3471
  });
3475
3472
  });
3476
- if (q.length > 100) {
3473
+ if (Y.length > 100) {
3477
3474
  _.open({
3478
3475
  type: "error",
3479
3476
  message: "'Combinations of variant should not be more than 100'"
@@ -3484,35 +3481,35 @@ const Sa = {
3484
3481
  ...t.form,
3485
3482
  variant: {
3486
3483
  variantGroupIds: x,
3487
- variantCombinations: q
3484
+ variantCombinations: Y
3488
3485
  },
3489
3486
  inventoryBindings: null,
3490
3487
  takeawayUsed: null
3491
3488
  };
3492
3489
  } else {
3493
- const Y = (R = t.form.variant) == null ? void 0 : R.variantCombinations.map((le) => le.takeawayUsed), q = [...new Set(Y)];
3490
+ const j = (R = t.form.variant) == null ? void 0 : R.variantCombinations.map((ie) => ie.takeawayUsed), Y = [...new Set(j)];
3494
3491
  S([{
3495
3492
  key: "variant",
3496
3493
  value: void 0
3497
3494
  }, {
3498
3495
  key: "takeawayUsed",
3499
- value: q.length === 1 ? q[0] : null
3496
+ value: Y.length === 1 ? Y[0] : null
3500
3497
  }]), l = {
3501
3498
  ...t.form,
3502
3499
  variant: void 0,
3503
- takeawayUsed: q.length === 1 ? q[0] : null
3500
+ takeawayUsed: Y.length === 1 ? Y[0] : null
3504
3501
  };
3505
3502
  }
3506
3503
  n("replace:form", r.initDynamicGroupItem(l));
3507
3504
  }
3508
- async function d(i, w, x) {
3505
+ async function c(i, w, x) {
3509
3506
  const l = Fe.clone(t.form);
3510
3507
  l.variant.variantCombinations[i][w] = x, S([{
3511
3508
  key: "variant",
3512
3509
  value: l.variant
3513
3510
  }]);
3514
3511
  }
3515
- const g = O(() => {
3512
+ const b = O(() => {
3516
3513
  var i, w;
3517
3514
  return ((i = p.currentCatalog) == null ? void 0 : i.priceTierRules) ?? ((w = p.currentCatalog) == null ? void 0 : w.usePriceTiers) ?? [];
3518
3515
  }), M = Kt(), k = O(() => [{
@@ -3525,26 +3522,26 @@ const Sa = {
3525
3522
  header: () => m("menu.product.form.variant.columns.code"),
3526
3523
  enableSorting: !1,
3527
3524
  cell: (i) => {
3528
- var q, le;
3529
- const w = i.getValue(), x = i.row.original, R = ((q = x.fallback) == null ? void 0 : q.code) ?? t.form.code ?? ((le = t.fallback) == null ? void 0 : le.code), Y = o.state.featureFlags.uniqueProductCode;
3525
+ var Y, ie;
3526
+ const w = i.getValue(), x = i.row.original, R = ((Y = x.fallback) == null ? void 0 : Y.code) ?? t.form.code ?? ((ie = t.fallback) == null ? void 0 : ie.code), j = o.state.featureFlags.uniqueProductCode;
3530
3527
  return ke(Ie.FmTextField, {
3531
3528
  modelValue: w,
3532
3529
  placeholder: R || m("menu.product.form.variant.placeholders.no_code"),
3533
3530
  rules: [(de) => {
3534
3531
  const A = de, s = O(() => {
3535
3532
  var ne;
3536
- if (!Y || !A) return 0;
3533
+ if (!j || !A) return 0;
3537
3534
  let U = p.itemCodeMap.get(A) || 0;
3538
3535
  return x.code === A && U > 0 && (U -= 1), A === R && (U += 1), (ne = t.form.variant) == null || ne.variantCombinations.forEach((W) => {
3539
3536
  W.combinationKey !== x.combinationKey && W.code === A && (U += 1);
3540
3537
  }), U;
3541
3538
  });
3542
- return Y && s.value > 0 ? m("menu.product.form.detail.fields.code.duplicate_warning", {
3539
+ return j && s.value > 0 ? m("menu.product.form.detail.fields.code.duplicate_warning", {
3543
3540
  count: s.value
3544
3541
  }) : !0;
3545
3542
  }],
3546
3543
  "onUpdate:modelValue": (de) => {
3547
- d(i.row.index, "code", tn(de, !0));
3544
+ c(i.row.index, "code", tn(de, !0));
3548
3545
  }
3549
3546
  });
3550
3547
  }
@@ -3553,16 +3550,16 @@ const Sa = {
3553
3550
  header: () => m("menu.product.form.variant.columns.order_from"),
3554
3551
  enableSorting: !1,
3555
3552
  cell: (i) => {
3556
- var R, Y;
3553
+ var R, j;
3557
3554
  const w = i.getValue(), l = (R = i.row.original.fallback) == null ? void 0 : R.orderFrom;
3558
3555
  return ke(Ut, {
3559
3556
  modelValue: w ?? null,
3560
- fallback: t.form.orderFrom ?? l ?? ((Y = t.fallback) == null ? void 0 : Y.orderFrom),
3561
- disable: !b.value.orderFrom,
3562
- required: b.value.orderFrom && b.value.orderFromActiveOnly,
3563
- editActiveOnly: b.value.orderFromActiveOnly || !1,
3564
- "onUpdate:modelValue": (q) => {
3565
- d(i.row.index, "orderFrom", q);
3557
+ fallback: t.form.orderFrom ?? l ?? ((j = t.fallback) == null ? void 0 : j.orderFrom),
3558
+ disable: !g.value.orderFrom,
3559
+ required: g.value.orderFrom && g.value.orderFromActiveOnly,
3560
+ editActiveOnly: g.value.orderFromActiveOnly || !1,
3561
+ "onUpdate:modelValue": (Y) => {
3562
+ c(i.row.index, "orderFrom", Y);
3566
3563
  },
3567
3564
  label: "",
3568
3565
  defaultLabel: "Follow general"
@@ -3573,59 +3570,59 @@ const Sa = {
3573
3570
  header: () => m("menu.product.form.variant.columns.price"),
3574
3571
  enableSorting: !1,
3575
3572
  cell: (i) => {
3576
- var le, de, A;
3577
- const w = i.getValue(), x = i.row.original, R = ((le = x.fallback) == null ? void 0 : le.price) ?? t.form.price ?? ((de = t.fallback) == null ? void 0 : de.price), Y = x.price_variant ?? Object.fromEntries(Object.entries(M.memberPricings.value ?? {}).map(([s, U]) => [U.key, null])), q = Object.values(Y).every((s) => s === null);
3578
- return c("div", {
3573
+ var ie, de, A;
3574
+ const w = i.getValue(), x = i.row.original, R = ((ie = x.fallback) == null ? void 0 : ie.price) ?? t.form.price ?? ((de = t.fallback) == null ? void 0 : de.price), j = M.getMemberPricingPriceVariant(x.price_variant), Y = Object.values(j).every((s) => s === null);
3575
+ return d("div", {
3579
3576
  id: ft($e.VARIANT, x.combinationKey ?? ""),
3580
3577
  class: "flex items-center gap-8"
3581
- }, [c(Je, {
3582
- disable: g.value.length > 0 && p.currentCatalog && !p.currentScheduler,
3578
+ }, [d(Je, {
3579
+ disable: b.value.length > 0 && p.currentCatalog && !p.currentScheduler,
3583
3580
  placeholder: R ? Be(R) : void 0,
3584
3581
  modelValue: w,
3585
3582
  min: 0,
3586
3583
  "onUpdate:model-value": (s) => {
3587
- d(i.row.index, "price", s);
3584
+ c(i.row.index, "price", s);
3588
3585
  },
3589
3586
  nullable: !0,
3590
3587
  showCurrency: !1
3591
- }, null), p.isV4 && c("div", {
3588
+ }, null), p.isV4 && d("div", {
3592
3589
  class: "flex items-center gap-8"
3593
- }, [c(Mt, {
3590
+ }, [d(Mt, {
3594
3591
  title: m("menu.product.form.member_price.configure.title"),
3595
3592
  currentConfig: "",
3596
- priceVariants: Y,
3593
+ priceVariants: j,
3597
3594
  showRemy: !1,
3598
3595
  basePrice: w,
3599
3596
  basePriceFallback: R ? Be(R) : void 0,
3600
3597
  "onUpdate:basePrice": (s) => {
3601
- d(i.row.index, "price", s);
3598
+ c(i.row.index, "price", s);
3602
3599
  },
3603
3600
  "onUpdate:priceVariants": (s) => {
3604
- d(i.row.index, "price_variant", At(s));
3601
+ c(i.row.index, "price_variant", At(s));
3605
3602
  }
3606
3603
  }, {
3607
3604
  default: ({
3608
3605
  trigger: s
3609
- }) => c(Ie.FmButton, {
3606
+ }) => d(Ie.FmButton, {
3610
3607
  variant: Oe.Plain,
3611
3608
  label: m("menu.product.form.member_price.configure.title"),
3612
3609
  onClick: () => s()
3613
3610
  }, {
3614
- default: () => c("span", {
3611
+ default: () => d("span", {
3615
3612
  class: "underline line-clamp-2 break-all"
3616
- }, [q ? m("menu.product.form.member_price.configure.title") : m("menu.product.form.member_price.configure.title_with_tier", {
3617
- num: Object.values(Y).filter((U) => U !== null).length
3613
+ }, [Y ? m("menu.product.form.member_price.configure.title") : m("menu.product.form.member_price.configure.title_with_tier", {
3614
+ num: Object.values(j).filter((U) => U !== null).length
3618
3615
  })])
3619
3616
  })
3620
- }), c(Rt, {
3621
- priceVariants: Y
3622
- }, null)]), p.isV4 && !t.isOverride && c(nn, {
3617
+ }), d(Rt, {
3618
+ priceVariants: j
3619
+ }, null)]), p.isV4 && !t.isOverride && d(nn, {
3623
3620
  "menu-store": p,
3624
3621
  "price-tiers": x.priceTiers,
3625
3622
  "price-tiers-variant": x.priceTiers_variant,
3626
3623
  fallback: (A = x.fallback) == null ? void 0 : A.priceTiers,
3627
3624
  "onUpdate:value": (s) => {
3628
- d(i.row.index, "priceTiers", s.priceTiers), d(i.row.index, "priceTiers_variant", Xn(s.priceTiersVariant));
3625
+ c(i.row.index, "priceTiers", s.priceTiers), c(i.row.index, "priceTiers_variant", Xn(s.priceTiersVariant));
3629
3626
  }
3630
3627
  }, null)]);
3631
3628
  }
@@ -3634,14 +3631,14 @@ const Sa = {
3634
3631
  header: () => m("menu.product.form.variant.columns.min_price"),
3635
3632
  enableSorting: !1,
3636
3633
  cell: (i) => {
3637
- var Y, q, le;
3638
- const w = i.getValue(), x = i.row.original, R = ((Y = x.fallback) == null ? void 0 : Y.minPrice) ?? t.form.minPrice ?? ((q = t.fallback) == null ? void 0 : q.minPrice);
3634
+ var j, Y, ie;
3635
+ const w = i.getValue(), x = i.row.original, R = ((j = x.fallback) == null ? void 0 : j.minPrice) ?? t.form.minPrice ?? ((Y = t.fallback) == null ? void 0 : Y.minPrice);
3639
3636
  return ke(Je, {
3640
3637
  placeholder: R ? Be(R) : void 0,
3641
3638
  modelValue: w,
3642
- max: Ce.Dinero.fromFdoDinero(x.price ?? ((le = x.fallback) == null ? void 0 : le.price) ?? Ce.Dinero.zero().toObject()).toUnit(),
3639
+ max: Ce.Dinero.fromFdoDinero(x.price ?? ((ie = x.fallback) == null ? void 0 : ie.price) ?? Ce.Dinero.zero().toObject()).toUnit(),
3643
3640
  "onUpdate:modelValue": (de) => {
3644
- d(i.row.index, "minPrice", de);
3641
+ c(i.row.index, "minPrice", de);
3645
3642
  },
3646
3643
  nullable: !0,
3647
3644
  showCurrency: !1
@@ -3656,7 +3653,7 @@ const Sa = {
3656
3653
  }) : !0;
3657
3654
  }
3658
3655
  return (i, w) => {
3659
- const x = H("fm-button"), l = H("fm-icon"), R = H("FmFormGroup"), Y = H("fm-table");
3656
+ const x = H("fm-button"), l = H("fm-icon"), R = H("FmFormGroup"), j = H("fm-table");
3660
3657
  return V(), oe(Pe, {
3661
3658
  id: e($e).VARIANT,
3662
3659
  title: e(m)("menu.product.form.variant.title"),
@@ -3670,15 +3667,15 @@ const Sa = {
3670
3667
  onClick: z
3671
3668
  }, null, 8, ["label"])) : ee("", !0)]),
3672
3669
  default: B(() => {
3673
- var q;
3674
- return [N("div", Ma, [c(R, {
3675
- "model-value": (q = i.form.variant) == null ? void 0 : q.variantGroupIds,
3670
+ var Y;
3671
+ return [N("div", Ma, [d(R, {
3672
+ "model-value": (Y = i.form.variant) == null ? void 0 : Y.variantGroupIds,
3676
3673
  rules: [v]
3677
3674
  }, {
3678
3675
  default: B(() => {
3679
- var le;
3680
- return [c(e(zt), {
3681
- "model-value": ((le = i.form.variant) == null ? void 0 : le.variantGroupIds) ?? [],
3676
+ var ie;
3677
+ return [d(e(zt), {
3678
+ "model-value": ((ie = i.form.variant) == null ? void 0 : ie.variantGroupIds) ?? [],
3682
3679
  class: "space-y-16",
3683
3680
  group: "variants",
3684
3681
  handle: ".handle",
@@ -3689,11 +3686,11 @@ const Sa = {
3689
3686
  element: de
3690
3687
  }) => {
3691
3688
  var A;
3692
- return [N("div", Aa, [c(x, {
3689
+ return [N("div", Aa, [d(x, {
3693
3690
  variant: e(Oe).Tertiary,
3694
3691
  class: "handle",
3695
3692
  "prepend-icon": "drag_handle"
3696
- }, null, 8, ["variant"]), N("div", Ra, [N("p", Na, ve((A = f.value[de]) == null ? void 0 : A.name), 1), c(l, {
3693
+ }, null, 8, ["variant"]), N("div", Ra, [N("p", Na, ve((A = f.value[de]) == null ? void 0 : A.name), 1), d(l, {
3697
3694
  class: "cursor-pointer",
3698
3695
  name: "close",
3699
3696
  onClick: Qe((s) => {
@@ -3706,8 +3703,8 @@ const Sa = {
3706
3703
  }, 8, ["model-value"])];
3707
3704
  }),
3708
3705
  _: 1
3709
- }, 8, ["model-value", "rules"]), c(ln, null, {
3710
- default: B(() => [T.value.length ? (V(), oe(Y, {
3706
+ }, 8, ["model-value", "rules"]), d(ln, null, {
3707
+ default: B(() => [T.value.length ? (V(), oe(j, {
3711
3708
  key: 0,
3712
3709
  class: "w-full",
3713
3710
  "column-defs": k.value,
@@ -3760,7 +3757,7 @@ const Sa = {
3760
3757
  emits: ["update:editingState"],
3761
3758
  setup(u, { expose: a, emit: t }) {
3762
3759
  var ce, fe, pe, Me, Le;
3763
- const o = u, p = t, r = lt(), _ = be(), { t: E } = ye(), m = bt(), b = O(() => {
3760
+ const o = u, p = t, r = lt(), _ = be(), { t: E } = ye(), m = bt(), g = O(() => {
3764
3761
  var ue, re;
3765
3762
  const K = (ue = o.initialForm) != null && ue._id ? m.getNodeById((re = o.initialForm) == null ? void 0 : re._id) : null;
3766
3763
  if (!K)
@@ -3776,9 +3773,9 @@ const Sa = {
3776
3773
  }), h = te(null);
3777
3774
  Xe(() => {
3778
3775
  var K;
3779
- (K = h.value) == null || K.setSelectedItemIndex(b.value.length - 1);
3776
+ (K = h.value) == null || K.setSelectedItemIndex(g.value.length - 1);
3780
3777
  });
3781
- const C = O(() => _.rules.item), f = te(), n = te(
3778
+ const I = O(() => _.rules.item), f = te(), n = te(
3782
3779
  o.initialForm ? he(o.initialForm) : {
3783
3780
  ...Ke.generator.initMenuV4Item(),
3784
3781
  category: o.categoryId
@@ -3811,10 +3808,10 @@ const Sa = {
3811
3808
  ), T = O(() => {
3812
3809
  var K;
3813
3810
  return $.value ? n.value.category == "" || n.value.category == null && ((K = f.value) == null ? void 0 : K.category) == null : gn(o.menu) && n.value.category == null;
3814
- }), P = O(() => r.itemAttributeSettings.value.length > 0 && !$.value), d = te(
3811
+ }), P = O(() => r.itemAttributeSettings.value.length > 0 && !$.value), c = te(
3815
3812
  n.value.category != null || !!n.value.code || !!n.value.orderFrom
3816
3813
  );
3817
- function g(K) {
3814
+ function b(K) {
3818
3815
  K || (n.value = {
3819
3816
  ...n.value,
3820
3817
  name: void 0,
@@ -3893,11 +3890,11 @@ const Sa = {
3893
3890
  }
3894
3891
  }, s());
3895
3892
  }
3896
- const Y = te(!!n.value.print);
3897
- function q(K) {
3893
+ const j = te(!!n.value.print);
3894
+ function Y(K) {
3898
3895
  K || (n.value = { ...n.value, print: void 0 }, s());
3899
3896
  }
3900
- const le = te(
3897
+ const ie = te(
3901
3898
  !!((Me = n.value.groups) != null && Me.length) != null || (((Le = n.value.variant) == null ? void 0 : Le.variantCombinations) || []).some((K) => {
3902
3899
  var L;
3903
3900
  return !!((L = K.groups) != null && L.length);
@@ -3964,7 +3961,7 @@ const Sa = {
3964
3961
  function J() {
3965
3962
  return n.value;
3966
3963
  }
3967
- async function I(K, L = !1) {
3964
+ async function C(K, L = !1) {
3968
3965
  const ae = document.getElementById(K);
3969
3966
  if (ae) {
3970
3967
  if (ae.scrollIntoView({ behavior: "smooth" }), L) {
@@ -3977,12 +3974,12 @@ const Sa = {
3977
3974
  console.warn(`Element with id ${K} not found`);
3978
3975
  }
3979
3976
  function G(K) {
3980
- K.type === "general" ? I($e.GENERAL) : K.type === "price" ? I($e.PRICE, !0) : K.type === "variant" ? I(ft($e.VARIANT, K.id), !0) : K.type === "group" && I(ft($e.GROUP, K.id), !0);
3977
+ K.type === "general" ? C($e.GENERAL) : K.type === "price" ? C($e.PRICE, !0) : K.type === "variant" ? C(ft($e.VARIANT, K.id), !0) : K.type === "group" && C(ft($e.GROUP, K.id), !0);
3981
3978
  }
3982
3979
  Cn(() => {
3983
3980
  o.focused && G(o.focused);
3984
3981
  });
3985
- function j(K) {
3982
+ function q(K) {
3986
3983
  var L;
3987
3984
  D("serveDelay", {
3988
3985
  enabled: K,
@@ -4002,7 +3999,7 @@ const Sa = {
4002
3999
  }
4003
4000
  function se(K) {
4004
4001
  var Ye, nt;
4005
- const L = ((Ye = n.value.serveDelay) == null ? void 0 : Ye.enabled) ?? !1, ue = (((nt = n.value.serveDelay) == null ? void 0 : nt.overriders) ?? []).filter((ie) => K.includes(ie.id)), re = new Set(ue.map((ie) => ie.id)), Q = K.filter((ie) => !re.has(ie)).map((ie) => ({ id: ie }));
4002
+ const L = ((Ye = n.value.serveDelay) == null ? void 0 : Ye.enabled) ?? !1, ue = (((nt = n.value.serveDelay) == null ? void 0 : nt.overriders) ?? []).filter((le) => K.includes(le.id)), re = new Set(ue.map((le) => le.id)), Q = K.filter((le) => !re.has(le)).map((le) => ({ id: le }));
4006
4003
  D("serveDelay", {
4007
4004
  enabled: L,
4008
4005
  overriders: [...ue, ...Q]
@@ -4024,17 +4021,17 @@ const Sa = {
4024
4021
  default: B(() => {
4025
4022
  var re, ge;
4026
4023
  return [
4027
- c(ae, {
4024
+ d(ae, {
4028
4025
  ref_key: "breadCrumbRef",
4029
4026
  ref: h,
4030
- items: b.value
4027
+ items: g.value
4031
4028
  }, null, 8, ["items"]),
4032
- c(_o, { "menu-store": e(_) }, null, 8, ["menu-store"]),
4033
- c(qe, {
4034
- toggle: d.value,
4029
+ d(_o, { "menu-store": e(_) }, null, 8, ["menu-store"]),
4030
+ d(qe, {
4031
+ toggle: c.value,
4035
4032
  "onUpdate:toggle": [
4036
- L[0] || (L[0] = (Q) => d.value = Q),
4037
- L[1] || (L[1] = (Q) => g(Q))
4033
+ L[0] || (L[0] = (Q) => c.value = Q),
4034
+ L[1] || (L[1] = (Q) => b(Q))
4038
4035
  ],
4039
4036
  disabled: !$.value,
4040
4037
  description: e(E)("menu.product.form.sections.general.description"),
@@ -4043,7 +4040,7 @@ const Sa = {
4043
4040
  default: B(() => {
4044
4041
  var Q;
4045
4042
  return [
4046
- c(_r, {
4043
+ d(_r, {
4047
4044
  fallback: f.value,
4048
4045
  form: n.value,
4049
4046
  "is-addon": T.value,
@@ -4062,7 +4059,7 @@ const Sa = {
4062
4059
  "sub-title": e(E)("menu.product.form.sections.tagging.subtitle")
4063
4060
  }, {
4064
4061
  default: B(() => [
4065
- c(e(dn), {
4062
+ d(e(dn), {
4066
4063
  entity: "item",
4067
4064
  "model-value": n.value.customAttributes || {},
4068
4065
  "onUpdate:modelValue": L[2] || (L[2] = (Q) => D("customAttributes", Q)),
@@ -4072,7 +4069,7 @@ const Sa = {
4072
4069
  _: 1
4073
4070
  }, 8, ["title", "sub-title"])) : ee("", !0),
4074
4071
  P.value ? (V(), Z("div", Ba)) : ee("", !0),
4075
- c(qe, {
4072
+ d(qe, {
4076
4073
  toggle: k.value,
4077
4074
  "onUpdate:toggle": [
4078
4075
  L[3] || (L[3] = (Q) => k.value = Q),
@@ -4083,7 +4080,7 @@ const Sa = {
4083
4080
  title: e(E)("menu.product.form.sections.price.title")
4084
4081
  }, {
4085
4082
  default: B(() => [
4086
- c(ma, {
4083
+ d(ma, {
4087
4084
  fallback: f.value,
4088
4085
  form: n.value,
4089
4086
  "is-addon": T.value,
@@ -4093,20 +4090,20 @@ const Sa = {
4093
4090
  ]),
4094
4091
  _: 1
4095
4092
  }, 8, ["toggle", "disabled", "description", "title"]),
4096
- C.value.print && !$.value ? (V(), Z("div", Ka)) : ee("", !0),
4097
- C.value.print ? (V(), oe(qe, {
4093
+ I.value.print && !$.value ? (V(), Z("div", Ka)) : ee("", !0),
4094
+ I.value.print ? (V(), oe(qe, {
4098
4095
  key: 4,
4099
- toggle: Y.value,
4096
+ toggle: j.value,
4100
4097
  "onUpdate:toggle": [
4101
- L[6] || (L[6] = (Q) => Y.value = Q),
4102
- L[7] || (L[7] = (Q) => q(Q))
4098
+ L[6] || (L[6] = (Q) => j.value = Q),
4099
+ L[7] || (L[7] = (Q) => Y(Q))
4103
4100
  ],
4104
4101
  description: "Use a different print setting",
4105
4102
  disabled: "",
4106
4103
  title: "Update print"
4107
4104
  }, {
4108
4105
  default: B(() => [
4109
- c(ba, {
4106
+ d(ba, {
4110
4107
  fallback: f.value,
4111
4108
  form: n.value,
4112
4109
  "full-combinations": S.value,
@@ -4119,7 +4116,7 @@ const Sa = {
4119
4116
  _: 1
4120
4117
  }, 8, ["toggle"])) : ee("", !0),
4121
4118
  $.value ? ee("", !0) : (V(), Z("div", za)),
4122
- c(qe, {
4119
+ d(qe, {
4123
4120
  toggle: v.value,
4124
4121
  "onUpdate:toggle": [
4125
4122
  L[9] || (L[9] = (Q) => v.value = Q),
@@ -4130,7 +4127,7 @@ const Sa = {
4130
4127
  title: e(E)("menu.product.form.sections.variant.title")
4131
4128
  }, {
4132
4129
  default: B(() => [
4133
- c(La, {
4130
+ d(La, {
4134
4131
  fallback: f.value,
4135
4132
  form: n.value,
4136
4133
  "full-combinations": S.value,
@@ -4142,12 +4139,12 @@ const Sa = {
4142
4139
  ]),
4143
4140
  _: 1
4144
4141
  }, 8, ["toggle", "disabled", "description", "title"]),
4145
- C.value.group && !$.value ? (V(), Z("div", ja)) : ee("", !0),
4146
- C.value.group ? (V(), oe(qe, {
4142
+ I.value.group && !$.value ? (V(), Z("div", ja)) : ee("", !0),
4143
+ I.value.group ? (V(), oe(qe, {
4147
4144
  key: 7,
4148
- toggle: le.value,
4145
+ toggle: ie.value,
4149
4146
  "onUpdate:toggle": [
4150
- L[12] || (L[12] = (Q) => le.value = Q),
4147
+ L[12] || (L[12] = (Q) => ie.value = Q),
4151
4148
  L[13] || (L[13] = (Q) => de(Q))
4152
4149
  ],
4153
4150
  disabled: !$.value,
@@ -4155,7 +4152,7 @@ const Sa = {
4155
4152
  title: "Update group"
4156
4153
  }, {
4157
4154
  default: B(() => [
4158
- c(zr, {
4155
+ d(zr, {
4159
4156
  fallback: f.value,
4160
4157
  form: n.value,
4161
4158
  "full-combinations": S.value,
@@ -4167,8 +4164,8 @@ const Sa = {
4167
4164
  ]),
4168
4165
  _: 1
4169
4166
  }, 8, ["toggle", "disabled"])) : ee("", !0),
4170
- C.value.inventory && !$.value ? (V(), Z("div", Ya)) : ee("", !0),
4171
- C.value.inventory ? (V(), oe(qe, {
4167
+ I.value.inventory && !$.value ? (V(), Z("div", Ya)) : ee("", !0),
4168
+ I.value.inventory ? (V(), oe(qe, {
4172
4169
  key: 9,
4173
4170
  toggle: w.value,
4174
4171
  "onUpdate:toggle": [
@@ -4180,7 +4177,7 @@ const Sa = {
4180
4177
  title: e(E)("menu.product.form.sections.inventory.title")
4181
4178
  }, {
4182
4179
  default: B(() => [
4183
- c(qr, {
4180
+ d(qr, {
4184
4181
  fallback: f.value,
4185
4182
  form: n.value,
4186
4183
  "full-combinations": S.value,
@@ -4192,8 +4189,8 @@ const Sa = {
4192
4189
  ]),
4193
4190
  _: 1
4194
4191
  }, 8, ["toggle", "disabled", "description", "title"])) : ee("", !0),
4195
- C.value.takeaway(n.value.category ?? ((re = f.value) == null ? void 0 : re.category)) && !$.value ? (V(), Z("div", qa)) : ee("", !0),
4196
- C.value.takeaway(n.value.category ?? ((ge = f.value) == null ? void 0 : ge.category)) ? (V(), oe(qe, {
4192
+ I.value.takeaway(n.value.category ?? ((re = f.value) == null ? void 0 : re.category)) && !$.value ? (V(), Z("div", qa)) : ee("", !0),
4193
+ I.value.takeaway(n.value.category ?? ((ge = f.value) == null ? void 0 : ge.category)) ? (V(), oe(qe, {
4197
4194
  key: 11,
4198
4195
  toggle: l.value,
4199
4196
  "onUpdate:toggle": [
@@ -4205,7 +4202,7 @@ const Sa = {
4205
4202
  title: e(E)("menu.product.form.sections.takeaway.title")
4206
4203
  }, {
4207
4204
  default: B(() => [
4208
- c(ya, {
4205
+ d(ya, {
4209
4206
  fallback: f.value,
4210
4207
  form: n.value,
4211
4208
  "full-combinations": S.value,
@@ -4217,13 +4214,13 @@ const Sa = {
4217
4214
  ]),
4218
4215
  _: 1
4219
4216
  }, 8, ["toggle", "disabled", "description", "title"])) : ee("", !0),
4220
- C.value.serveDelay && !$.value ? (V(), Z("div", Wa)) : ee("", !0),
4221
- C.value.serveDelay ? (V(), oe(Qn, {
4217
+ I.value.serveDelay && !$.value ? (V(), Z("div", Wa)) : ee("", !0),
4218
+ I.value.serveDelay ? (V(), oe(Qn, {
4222
4219
  key: 13,
4223
4220
  form: n.value,
4224
4221
  "onUpdate:linkedOrderPacing": L[20] || (L[20] = (Q) => se(Q)),
4225
4222
  "onUpdate:defaultPreset": L[21] || (L[21] = (Q) => X(Q)),
4226
- "onUpdate:enabled": L[22] || (L[22] = (Q) => j(Q))
4223
+ "onUpdate:enabled": L[22] || (L[22] = (Q) => q(Q))
4227
4224
  }, null, 8, ["form"])) : ee("", !0)
4228
4225
  ];
4229
4226
  }),
@@ -4234,20 +4231,20 @@ const Sa = {
4234
4231
  });
4235
4232
  function Xa(u) {
4236
4233
  const { storageKey: a, defaultWidth: t, minWidth: o, maxWidth: p } = u, r = Jn(a, t), _ = te(!1), E = te(null);
4237
- function m(C) {
4238
- C.preventDefault(), _.value = !0, document.addEventListener("mousemove", b), document.addEventListener("mouseup", h), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
4234
+ function m(I) {
4235
+ I.preventDefault(), _.value = !0, document.addEventListener("mousemove", g), document.addEventListener("mouseup", h), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
4239
4236
  }
4240
- function b(C) {
4237
+ function g(I) {
4241
4238
  if (_.value && E.value) {
4242
- const f = E.value.getBoundingClientRect(), n = C.clientX - f.left;
4239
+ const f = E.value.getBoundingClientRect(), n = I.clientX - f.left;
4243
4240
  n >= o && n <= p && (r.value = n);
4244
4241
  }
4245
4242
  }
4246
4243
  function h() {
4247
- _.value = !1, document.removeEventListener("mousemove", b), document.removeEventListener("mouseup", h), document.body.style.cursor = "", document.body.style.userSelect = "";
4244
+ _.value = !1, document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", h), document.body.style.cursor = "", document.body.style.userSelect = "";
4248
4245
  }
4249
4246
  return In(() => {
4250
- document.removeEventListener("mousemove", b), document.removeEventListener("mouseup", h);
4247
+ document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", h);
4251
4248
  }), {
4252
4249
  panelWidth: r,
4253
4250
  isDragging: _,
@@ -4316,7 +4313,7 @@ function ll(u, a, t) {
4316
4313
  function bn() {
4317
4314
  const u = be(), a = je();
4318
4315
  async function t(E, m = "New product") {
4319
- const b = {
4316
+ const g = {
4320
4317
  ...Ke.generator.initMenuV4Item(),
4321
4318
  category: E,
4322
4319
  name: m
@@ -4324,7 +4321,7 @@ function bn() {
4324
4321
  await u.updateMenu({
4325
4322
  module: xe.enum.item,
4326
4323
  operation: Ee.F_OPERATION_TYPE.create,
4327
- data: b
4324
+ data: g
4328
4325
  }), a.open({
4329
4326
  type: "success",
4330
4327
  title: `Product ${m} created`
@@ -4344,8 +4341,8 @@ function bn() {
4344
4341
  data: E
4345
4342
  });
4346
4343
  }
4347
- async function r(E, m, b, h) {
4348
- let C = pt(m);
4344
+ async function r(E, m, g, h) {
4345
+ let I = pt(m);
4349
4346
  const f = /* @__PURE__ */ new Map(), n = pt(u.state.menu);
4350
4347
  for (const D of n.modules.item)
4351
4348
  f.set(D._id, D);
@@ -4367,14 +4364,14 @@ function bn() {
4367
4364
  Object.assign(F, T);
4368
4365
  }
4369
4366
  } else if (D.type === "subCategory")
4370
- C = ll(C, [...b, D.id], {
4367
+ I = ll(I, [...g, D.id], {
4371
4368
  position: z
4372
4369
  });
4373
4370
  else
4374
4371
  throw new Error("Invalid item type");
4375
4372
  });
4376
4373
  const S = n.modules.category.find((D) => D._id === (m == null ? void 0 : m._id) || null);
4377
- S && (S.subCategoryMeta = C.subCategoryMeta), u.setMenu(n);
4374
+ S && (S.subCategoryMeta = I.subCategoryMeta), u.setMenu(n);
4378
4375
  }
4379
4376
  async function _(E, m) {
4380
4377
  await u.updateMenu({
@@ -4426,20 +4423,20 @@ function il() {
4426
4423
  if (!(P != null && P.subCategories) || !P.subCategories.length)
4427
4424
  ($ = D.children) == null || $.push(T);
4428
4425
  else {
4429
- let d = D.children, g = "";
4426
+ let c = D.children, b = "";
4430
4427
  for (const M of P.subCategories || []) {
4431
- g += M;
4432
- const k = d.find(
4428
+ b += M;
4429
+ const k = c.find(
4433
4430
  (y) => {
4434
4431
  var v, i;
4435
4432
  return ((v = y.meta) == null ? void 0 : v.nodeType) === "subCategory" && ((i = y.meta) == null ? void 0 : i.rawId) === M;
4436
4433
  }
4437
4434
  );
4438
4435
  if (k)
4439
- k.children = k.children || [], d = k.children;
4436
+ k.children = k.children || [], c = k.children;
4440
4437
  else {
4441
4438
  const y = {
4442
- id: `category-${S.label}-sub-category-${g}`,
4439
+ id: `category-${S.label}-sub-category-${b}`,
4443
4440
  label: r(M),
4444
4441
  icon: Ae.CATEGORY,
4445
4442
  children: [],
@@ -4449,10 +4446,10 @@ function il() {
4449
4446
  rawId: M
4450
4447
  }
4451
4448
  };
4452
- d.push(y), d = y.children;
4449
+ c.push(y), c = y.children;
4453
4450
  }
4454
4451
  }
4455
- d.push(T);
4452
+ c.push(T);
4456
4453
  }
4457
4454
  }
4458
4455
  return D;
@@ -4464,7 +4461,7 @@ function il() {
4464
4461
  throw new Error("Node is not a sub category");
4465
4462
  return 0;
4466
4463
  }
4467
- function b(n) {
4464
+ function g(n) {
4468
4465
  var D;
4469
4466
  let S = n;
4470
4467
  for (; S; ) {
@@ -4478,26 +4475,26 @@ function il() {
4478
4475
  var z, F, $, T;
4479
4476
  if (!n.children)
4480
4477
  return n;
4481
- const S = ((F = (z = b(n)) == null ? void 0 : z.meta) == null ? void 0 : F.rawId) ?? null, D = po(S);
4478
+ const S = ((F = (z = g(n)) == null ? void 0 : z.meta) == null ? void 0 : F.rawId) ?? null, D = po(S);
4482
4479
  return (($ = n.meta) == null ? void 0 : $.nodeType) === "category" || ((T = n.meta) == null ? void 0 : T.nodeType) === "subCategory" ? (n.children = ht(
4483
4480
  n.children,
4484
4481
  (P) => P.label,
4485
4482
  (P) => {
4486
- var d, g;
4487
- if (((d = P.meta) == null ? void 0 : d.nodeType) === "subCategory")
4483
+ var c, b;
4484
+ if (((c = P.meta) == null ? void 0 : c.nodeType) === "subCategory")
4488
4485
  return m(P);
4489
- if (((g = P.meta) == null ? void 0 : g.nodeType) === "item")
4486
+ if (((b = P.meta) == null ? void 0 : b.nodeType) === "item")
4490
4487
  return D(P.meta.rawObject);
4491
4488
  throw new Error("Should not have other node type in category");
4492
4489
  }
4493
4490
  ), { ...n, children: n.children.map(h) }) : n;
4494
4491
  }
4495
- function C(n) {
4492
+ function I(n) {
4496
4493
  return n.map(h);
4497
4494
  }
4498
4495
  async function f({ eventEmitter: n }) {
4499
- var q, le, de, A;
4500
- const S = a.state.menu, D = !a.state.currentCatalogId, z = !a.state.currentSchedulerId, F = (((le = (q = a.currentCatalog) == null ? void 0 : q.linkItemRules) == null ? void 0 : le.length) ?? 0) > 0, $ = ko(), T = a.mergedMenu;
4496
+ var Y, ie, de, A;
4497
+ const S = a.state.menu, D = !a.state.currentCatalogId, z = !a.state.currentSchedulerId, F = (((ie = (Y = a.currentCatalog) == null ? void 0 : Y.linkItemRules) == null ? void 0 : ie.length) ?? 0) > 0, $ = ko(), T = a.mergedMenu;
4501
4498
  ut.clear(), dt.clear();
4502
4499
  for (const s of S.modules.item)
4503
4500
  ut.set(s._id, s);
@@ -4514,37 +4511,37 @@ function il() {
4514
4511
  }
4515
4512
  };
4516
4513
  }
4517
- function d(s, U, ne) {
4514
+ function c(s, U, ne) {
4518
4515
  var J;
4519
4516
  const W = T.modules.group.find(
4520
- (I) => I._id === ne._id
4517
+ (C) => C._id === ne._id
4521
4518
  );
4522
4519
  if (!W)
4523
4520
  throw new Error(`Item ${s._id} has unknown group ${ne._id}`);
4524
- return (J = W.items) == null ? void 0 : J.map((I, G) => {
4521
+ return (J = W.items) == null ? void 0 : J.map((C, G) => {
4525
4522
  var ae, ue;
4526
- const j = !!I.combinationKey, X = (ae = ne.items) == null ? void 0 : ae.find(
4527
- (re) => re._id === I._id && re.combinationKey === I.combinationKey
4523
+ const q = !!C.combinationKey, X = (ae = ne.items) == null ? void 0 : ae.find(
4524
+ (re) => re._id === C._id && re.combinationKey === C.combinationKey
4528
4525
  ), se = (ue = ne.items) == null ? void 0 : ue.find(
4529
- (re) => re._id === I._id && !re.combinationKey
4526
+ (re) => re._id === C._id && !re.combinationKey
4530
4527
  );
4531
4528
  function ce() {
4532
4529
  var re;
4533
- if (j && (X != null && X.price))
4530
+ if (q && (X != null && X.price))
4534
4531
  return {
4535
4532
  price: X.price,
4536
4533
  overrided: !0
4537
4534
  };
4538
- if (!j && (se != null && se.price))
4535
+ if (!q && (se != null && se.price))
4539
4536
  return {
4540
4537
  price: se.price,
4541
4538
  overrided: !0
4542
4539
  };
4543
- if (I.price)
4544
- return { price: I.price, overrided: !1 };
4545
- if (!I.price) {
4540
+ if (C.price)
4541
+ return { price: C.price, overrided: !1 };
4542
+ if (!C.price) {
4546
4543
  const ge = (re = W == null ? void 0 : W.items) == null ? void 0 : re.find(
4547
- (Q) => Q._id === I._id && !Q.combinationKey
4544
+ (Q) => Q._id === C._id && !Q.combinationKey
4548
4545
  );
4549
4546
  if (ge != null && ge.price)
4550
4547
  return { price: ge.price, overrided: !1 };
@@ -4553,22 +4550,22 @@ function il() {
4553
4550
  }
4554
4551
  function fe() {
4555
4552
  var ge, Q;
4556
- if (I.code)
4557
- return I.code;
4558
- const re = ut.get(I._id);
4553
+ if (C.code)
4554
+ return C.code;
4555
+ const re = ut.get(C._id);
4559
4556
  if (re)
4560
- return j ? (Q = (ge = re.variant) == null ? void 0 : ge.variantCombinations.find(
4561
- (Ye) => Ye.combinationKey === I.combinationKey
4557
+ return q ? (Q = (ge = re.variant) == null ? void 0 : ge.variantCombinations.find(
4558
+ (Ye) => Ye.combinationKey === C.combinationKey
4562
4559
  )) == null ? void 0 : Q.code : re.code;
4563
4560
  }
4564
4561
  function pe() {
4565
- if (I.name)
4566
- return I.name;
4567
- const re = T.modules.item.find((ge) => ge._id === I._id);
4562
+ if (C.name)
4563
+ return C.name;
4564
+ const re = T.modules.item.find((ge) => ge._id === C._id);
4568
4565
  return re ? re.name : u("menu.tree_editor.labels.unknown");
4569
4566
  }
4570
4567
  function Me() {
4571
- const re = (X == null ? void 0 : X.orderFrom) || I.orderFrom;
4568
+ const re = (X == null ? void 0 : X.orderFrom) || C.orderFrom;
4572
4569
  return re ? kt(re) : null;
4573
4570
  }
4574
4571
  const { price: Le, overrided: K } = ce(), L = {
@@ -4576,50 +4573,50 @@ function il() {
4576
4573
  variant: K ? et.PRIMARY : et.PLAIN
4577
4574
  };
4578
4575
  return {
4579
- id: `item-${s._id}-variant-${U == null ? void 0 : U.combinationKey}-group-${ne._id}-${I._id}-${I.combinationKey}-${G}`,
4580
- icon: I.combinationKey ? Ae.VARIANT : Ae.ITEM,
4576
+ id: `item-${s._id}-variant-${U == null ? void 0 : U.combinationKey}-group-${ne._id}-${C._id}-${C.combinationKey}-${G}`,
4577
+ icon: C.combinationKey ? Ae.VARIANT : Ae.ITEM,
4581
4578
  label: Wt(pe(), fe()),
4582
4579
  rightLabel: L,
4583
4580
  chips: Me() ? [Me()] : void 0
4584
4581
  };
4585
4582
  });
4586
4583
  }
4587
- function g(s, U) {
4588
- const ne = (j) => U ? `item-${s._id}-variant-${U.combinationKey}-group-${j}` : `item-${s._id}-group-${j}`, W = [];
4584
+ function b(s, U) {
4585
+ const ne = (q) => U ? `item-${s._id}-variant-${U.combinationKey}-group-${q}` : `item-${s._id}-group-${q}`, W = [];
4589
4586
  function J() {
4590
4587
  var X;
4591
- const j = [];
4588
+ const q = [];
4592
4589
  if (U)
4593
4590
  for (const se of s.groups || []) {
4594
4591
  const ce = (X = U.groups) == null ? void 0 : X.find((fe) => fe._id === se._id);
4595
- ce ? j.push(ce) : j.push(se);
4592
+ ce ? q.push(ce) : q.push(se);
4596
4593
  }
4597
4594
  else
4598
- j.push(...s.groups || []);
4599
- return j;
4595
+ q.push(...s.groups || []);
4596
+ return q;
4600
4597
  }
4601
- const I = J(), G = ht(
4602
- I.map((j) => {
4603
- const X = dt.get(j._id);
4604
- return { ...j, position: X == null ? void 0 : X.position, name: (X == null ? void 0 : X.name) || "" };
4598
+ const C = J(), G = ht(
4599
+ C.map((q) => {
4600
+ const X = dt.get(q._id);
4601
+ return { ...q, position: X == null ? void 0 : X.position, name: (X == null ? void 0 : X.name) || "" };
4605
4602
  }),
4606
- (j) => j.name
4603
+ (q) => q.name
4607
4604
  );
4608
4605
  if (G)
4609
- for (const j of G) {
4610
- const X = dt.get(j._id);
4606
+ for (const q of G) {
4607
+ const X = dt.get(q._id);
4611
4608
  if (!X)
4612
- throw new Error(`Item ${s._id} has unknown group ${j._id}`);
4609
+ throw new Error(`Item ${s._id} has unknown group ${q._id}`);
4613
4610
  W.push({
4614
4611
  id: ne(X._id),
4615
4612
  icon: Ae.GROUP,
4616
4613
  label: X.name,
4617
- children: d(s, U, j),
4614
+ children: c(s, U, q),
4618
4615
  onClick: () => {
4619
4616
  n({
4620
4617
  type: Se.SELECT_GROUP,
4621
4618
  itemId: s._id,
4622
- groupId: j._id
4619
+ groupId: q._id
4623
4620
  });
4624
4621
  }
4625
4622
  });
@@ -4627,26 +4624,26 @@ function il() {
4627
4624
  return W;
4628
4625
  }
4629
4626
  function M(s, U) {
4630
- return g(s, U);
4627
+ return b(s, U);
4631
4628
  }
4632
4629
  function k(s) {
4633
4630
  var J;
4634
4631
  const U = [], ne = s.groups && s.groups.length > 0, W = ((J = s.variant) == null ? void 0 : J.variantGroupIds) && s.variant.variantGroupIds.length > 0;
4635
4632
  if (ne && !W) {
4636
- const I = g(s);
4637
- U.push(...I);
4633
+ const C = b(s);
4634
+ U.push(...C);
4638
4635
  }
4639
4636
  if (W) {
4640
- const I = (X, se) => `item-${X}-variant-${se}`, G = un(
4637
+ const C = (X, se) => `item-${X}-variant-${se}`, G = un(
4641
4638
  S.modules.variant,
4642
4639
  s.variant.variantGroupIds
4643
- ), j = s.variant.variantCombinations.map(
4640
+ ), q = s.variant.variantCombinations.map(
4644
4641
  (X) => {
4645
4642
  const se = kt(
4646
4643
  X.orderFrom || s.orderFrom
4647
4644
  ), ce = Ct([], se);
4648
4645
  return {
4649
- id: I(s._id, X.combinationKey),
4646
+ id: C(s._id, X.combinationKey),
4650
4647
  icon: Ae.VARIANT,
4651
4648
  label: Wt(
4652
4649
  Go(G, X.combinationKey),
@@ -4665,7 +4662,7 @@ function il() {
4665
4662
  };
4666
4663
  }
4667
4664
  );
4668
- U.push(...j);
4665
+ U.push(...q);
4669
4666
  }
4670
4667
  return U;
4671
4668
  }
@@ -4696,7 +4693,7 @@ function il() {
4696
4693
  showOnHover: !0,
4697
4694
  tooltip: u("menu.tree_editor.actions.link_category_to_catalog"),
4698
4695
  onClick: () => {
4699
- const ne = a.state.menu.modules.item.filter((W) => Yt(W).some(({ _id: I }) => I === s._id));
4696
+ const ne = a.state.menu.modules.item.filter((W) => Yt(W).some(({ _id: C }) => C === s._id));
4700
4697
  $.addProduct(ne.map((W) => W._id));
4701
4698
  }
4702
4699
  }), {
@@ -4745,14 +4742,14 @@ function il() {
4745
4742
  const l = (s, U) => `item-${U ?? "addon"}-${s}`;
4746
4743
  for (const s of T.modules.item)
4747
4744
  Yt(s).forEach(({ _id: ne }) => {
4748
- var J, I, G, j, X, se, ce, fe;
4745
+ var J, C, G, q, X, se, ce, fe;
4749
4746
  const W = ne ? v.find((pe) => pe.id === y(ne)) : x;
4750
4747
  if (W) {
4751
4748
  const pe = wt(
4752
4749
  ((J = s.groups) == null ? void 0 : J.length) ?? 0,
4753
- u("menu.tree_editor.labels.groups", { count: (I = s.groups) == null ? void 0 : I.length })
4750
+ u("menu.tree_editor.labels.groups", { count: (C = s.groups) == null ? void 0 : C.length })
4754
4751
  ), Me = wt(
4755
- ((j = (G = s.variant) == null ? void 0 : G.variantCombinations) == null ? void 0 : j.length) ?? 0,
4752
+ ((q = (G = s.variant) == null ? void 0 : G.variantCombinations) == null ? void 0 : q.length) ?? 0,
4756
4753
  u("menu.tree_editor.labels.variants", {
4757
4754
  count: (se = (X = s.variant) == null ? void 0 : X.variantCombinations) == null ? void 0 : se.length
4758
4755
  })
@@ -4832,7 +4829,7 @@ function il() {
4832
4829
  }
4833
4830
  const R = E(v);
4834
4831
  return _(R), {
4835
- tree: C(R)
4832
+ tree: I(R)
4836
4833
  };
4837
4834
  }
4838
4835
  return {
@@ -4869,7 +4866,7 @@ function sl() {
4869
4866
  }
4870
4867
  throw new Error("Node not inside a category, something is wrong");
4871
4868
  }
4872
- function b(k) {
4869
+ function g(k) {
4873
4870
  const y = [];
4874
4871
  let v = k;
4875
4872
  for (; v; )
@@ -4891,7 +4888,7 @@ function sl() {
4891
4888
  throw new Error("Node is not an item or sub-category");
4892
4889
  }) : [];
4893
4890
  }
4894
- function C(k, y) {
4891
+ function I(k, y) {
4895
4892
  return r(y);
4896
4893
  }
4897
4894
  function f(k, y, v, i, w) {
@@ -4918,31 +4915,31 @@ function sl() {
4918
4915
  const x = S(k), l = S(y);
4919
4916
  return (x == null ? void 0 : x.id) === (l == null ? void 0 : l.id) ? !0 : !((x == null ? void 0 : x.id) !== (l == null ? void 0 : l.id) && n(l).some(
4920
4917
  (R) => {
4921
- var Y, q;
4922
- return ((Y = R.meta) == null ? void 0 : Y.rawId) === ((q = k.meta) == null ? void 0 : q.rawId);
4918
+ var j, Y;
4919
+ return ((j = R.meta) == null ? void 0 : j.rawId) === ((Y = k.meta) == null ? void 0 : Y.rawId);
4923
4920
  }
4924
4921
  ));
4925
4922
  }
4926
4923
  return r(y) && i && y.id !== i.id && v === "inside" ? !n(y).some((l) => {
4927
- var R, Y;
4928
- return ((R = l.meta) == null ? void 0 : R.rawId) === ((Y = k.meta) == null ? void 0 : Y.rawId);
4924
+ var R, j;
4925
+ return ((R = l.meta) == null ? void 0 : R.rawId) === ((j = k.meta) == null ? void 0 : j.rawId);
4929
4926
  }) : !!(_(y) && (w == null ? void 0 : w.id) !== (i == null ? void 0 : i.id) || E(y));
4930
4927
  }
4931
4928
  const z = (k, y, v) => {
4932
4929
  const i = o.getNodeById(k), w = o.getNodeById(y), x = i == null ? void 0 : i.parent, l = w == null ? void 0 : w.parent;
4933
- return !i || !w ? !1 : r(i) ? C(i, w) : E(i) ? f(i, w, v, x, l) : _(i) ? D(i, w, v, x, l) : !1;
4930
+ return !i || !w ? !1 : r(i) ? I(i, w) : E(i) ? f(i, w, v, x, l) : _(i) ? D(i, w, v, x, l) : !1;
4934
4931
  };
4935
4932
  async function F(k, y, v) {
4936
- if (!C(k, y)) {
4933
+ if (!I(k, y)) {
4937
4934
  p("Can't drag category here");
4938
4935
  return;
4939
4936
  }
4940
- const i = o.treeNodes, w = i.findIndex((Y) => Y.id === k.id);
4941
- let x = i.findIndex((Y) => Y.id === y.id);
4937
+ const i = o.treeNodes, w = i.findIndex((j) => j.id === k.id);
4938
+ let x = i.findIndex((j) => j.id === y.id);
4942
4939
  v === "after" && x++;
4943
- const l = i.map((Y) => {
4944
- var q;
4945
- return (q = Y.meta) == null ? void 0 : q.rawId;
4940
+ const l = i.map((j) => {
4941
+ var Y;
4942
+ return (Y = j.meta) == null ? void 0 : Y.rawId;
4946
4943
  }).filter(Boolean), R = It(l, w, x);
4947
4944
  await t.rearrange(R);
4948
4945
  }
@@ -4967,21 +4964,21 @@ function sl() {
4967
4964
  throw new Error("Invalid target node for item drop");
4968
4965
  }
4969
4966
  async function T(k, y, v, i) {
4970
- var Y;
4971
- const w = h(y), x = ((Y = y.children) == null ? void 0 : Y.findIndex((q) => q.id === k.id)) ?? -1;
4967
+ var j;
4968
+ const w = h(y), x = ((j = y.children) == null ? void 0 : j.findIndex((Y) => Y.id === k.id)) ?? -1;
4972
4969
  if (x === -1) throw new Error("Source index not found");
4973
- const l = It(w, x, v), R = b(y);
4970
+ const l = It(w, x, v), R = g(y);
4974
4971
  await a.rearrangeWithSubCategory(l, i, R);
4975
4972
  }
4976
4973
  async function P(k, y, v, i) {
4977
- var Y;
4974
+ var j;
4978
4975
  const w = h(y);
4979
4976
  w.splice(v, 0, {
4980
4977
  type: "item",
4981
4978
  id: k.meta.rawId
4982
4979
  });
4983
- const x = b(y);
4984
- if (((Y = k.meta) == null ? void 0 : Y.nodeType) !== ot.ITEM)
4980
+ const x = g(y);
4981
+ if (((j = k.meta) == null ? void 0 : j.nodeType) !== ot.ITEM)
4985
4982
  throw new Error("Expected dragged node to be an item");
4986
4983
  const l = pt(k.meta.rawObject);
4987
4984
  l.category = i._id, l.subCategories = x;
@@ -4993,7 +4990,7 @@ function sl() {
4993
4990
  R
4994
4991
  );
4995
4992
  }
4996
- async function d(k, y, v) {
4993
+ async function c(k, y, v) {
4997
4994
  var i;
4998
4995
  try {
4999
4996
  if (!D(k, y, v, k.parent, y.parent)) {
@@ -5016,7 +5013,7 @@ function sl() {
5016
5013
  p(w.message || "Failed to move item");
5017
5014
  }
5018
5015
  }
5019
- async function g(k, y, v) {
5016
+ async function b(k, y, v) {
5020
5017
  if (!f(
5021
5018
  k,
5022
5019
  y,
@@ -5030,17 +5027,17 @@ function sl() {
5030
5027
  const i = k.parent;
5031
5028
  if (!i || !i.children)
5032
5029
  throw new Error("Parent node not found or has no children");
5033
- const w = h(i), x = i.children.findIndex((le) => le.id === k.id);
5034
- let l = i.children.findIndex((le) => le.id === y.id);
5030
+ const w = h(i), x = i.children.findIndex((ie) => ie.id === k.id);
5031
+ let l = i.children.findIndex((ie) => ie.id === y.id);
5035
5032
  if (x === -1 || l === -1)
5036
5033
  throw new Error("Source or target index not found");
5037
5034
  v === "after" && l++;
5038
- const R = It(w, x, l), Y = m(i), q = b(i);
5039
- await a.rearrangeWithSubCategory(R, Y, q);
5035
+ const R = It(w, x, l), j = m(i), Y = g(i);
5036
+ await a.rearrangeWithSubCategory(R, j, Y);
5040
5037
  }
5041
5038
  async function M(k) {
5042
5039
  const y = o.getNodeById(k.draggedNodeId), v = o.getNodeById(k.targetNodeId);
5043
- !y || !v || (r(y) ? await F(y, v, k.dragPosition) : _(y) ? await d(y, v, k.dragPosition) : E(y) ? await g(y, v, k.dragPosition) : p("Unsupported drag operation"));
5040
+ !y || !v || (r(y) ? await F(y, v, k.dragPosition) : _(y) ? await c(y, v, k.dragPosition) : E(y) ? await b(y, v, k.dragPosition) : p("Unsupported drag operation"));
5044
5041
  }
5045
5042
  return {
5046
5043
  isCategoryNode: r,
@@ -5063,7 +5060,7 @@ const Pt = /* @__PURE__ */ me({
5063
5060
  return V(), Z("div", {
5064
5061
  class: we(`p-4 relative flex items-center justify-center ${a.visible ? "" : "invisible"}`)
5065
5062
  }, [
5066
- c(p, {
5063
+ d(p, {
5067
5064
  name: a.name,
5068
5065
  size: "sm",
5069
5066
  outline: "",
@@ -5090,7 +5087,7 @@ const Pt = /* @__PURE__ */ me({
5090
5087
  "z-index": 50
5091
5088
  }, {
5092
5089
  default: B(() => [
5093
- c(Pt, {
5090
+ d(Pt, {
5094
5091
  name: a.name,
5095
5092
  visible: a.visible,
5096
5093
  onClick: a.onClick
@@ -5107,58 +5104,58 @@ const Pt = /* @__PURE__ */ me({
5107
5104
  }
5108
5105
  }), yn = 300;
5109
5106
  function ul(u) {
5110
- const { itemHeight: a, emit: t, getFlattenedItems: o, getContainerRef: p, canDropFn: r } = u, _ = te(!1), E = te(null), m = te(null), b = te(null), h = te(0), C = te({ x: 0, y: 0 }), f = te(/* @__PURE__ */ new Map());
5107
+ const { itemHeight: a, emit: t, getFlattenedItems: o, getContainerRef: p, canDropFn: r } = u, _ = te(!1), E = te(null), m = te(null), g = te(null), h = te(0), I = te({ x: 0, y: 0 }), f = te(/* @__PURE__ */ new Map());
5111
5108
  function n(F, $) {
5112
- $.button === 0 && (C.value = { x: $.clientX, y: $.clientY }, E.value = F, h.value = $.clientY, f.value = No(o()), setTimeout(() => {
5113
- E.value === F && (_.value = !0, C.value = { x: $.clientX, y: $.clientY }, t("updateDragState", F, null, null), document.addEventListener("mousemove", S), document.addEventListener("mouseup", D));
5109
+ $.button === 0 && (I.value = { x: $.clientX, y: $.clientY }, E.value = F, h.value = $.clientY, f.value = No(o()), setTimeout(() => {
5110
+ E.value === F && (_.value = !0, I.value = { x: $.clientX, y: $.clientY }, t("updateDragState", F, null, null), document.addEventListener("mousemove", S), document.addEventListener("mouseup", D));
5114
5111
  }, yn));
5115
5112
  }
5116
5113
  function S(F) {
5117
5114
  var k;
5118
5115
  if (!_.value || !E.value) return;
5119
5116
  requestAnimationFrame(() => {
5120
- C.value = { x: F.clientX, y: F.clientY };
5117
+ I.value = { x: F.clientX, y: F.clientY };
5121
5118
  });
5122
5119
  const $ = p();
5123
5120
  if (!$) return;
5124
- const T = $.getBoundingClientRect(), P = F.clientY - T.top + $.scrollTop, d = Math.floor(P / a), g = o();
5125
- if (d >= 0 && d < g.length) {
5126
- const v = g[d].id;
5121
+ const T = $.getBoundingClientRect(), P = F.clientY - T.top + $.scrollTop, c = Math.floor(P / a), b = o();
5122
+ if (c >= 0 && c < b.length) {
5123
+ const v = b[c].id;
5127
5124
  if (v === E.value) {
5128
- m.value = null, b.value = null, t("updateDragState", E.value, null, null);
5125
+ m.value = null, g.value = null, t("updateDragState", E.value, null, null);
5129
5126
  return;
5130
5127
  }
5131
5128
  m.value = v;
5132
5129
  const i = (k = document.getElementById(`tree-node-${v}`)) == null ? void 0 : k.getBoundingClientRect();
5133
5130
  if (i) {
5134
5131
  const w = F.clientY - i.top;
5135
- w < i.height / 3 ? b.value = "before" : w > i.height * 2 / 3 ? b.value = "after" : b.value = "inside";
5132
+ w < i.height / 3 ? g.value = "before" : w > i.height * 2 / 3 ? g.value = "after" : g.value = "inside";
5136
5133
  }
5137
- if (r && b.value && !r(E.value, v, b.value)) {
5138
- m.value = null, b.value = null, t("updateDragState", E.value, null, null);
5134
+ if (r && g.value && !r(E.value, v, g.value)) {
5135
+ m.value = null, g.value = null, t("updateDragState", E.value, null, null);
5139
5136
  return;
5140
5137
  }
5141
- t("updateDragState", E.value, m.value, b.value);
5138
+ t("updateDragState", E.value, m.value, g.value);
5142
5139
  }
5143
5140
  const M = 50;
5144
5141
  F.clientY - T.top < M ? $.scrollTop -= 10 : T.bottom - F.clientY < M && ($.scrollTop += 10);
5145
5142
  }
5146
5143
  function D() {
5147
- document.removeEventListener("mousemove", S), document.removeEventListener("mouseup", D), _.value && E.value && m.value && b.value && t("nodeDragDrop", {
5144
+ document.removeEventListener("mousemove", S), document.removeEventListener("mouseup", D), _.value && E.value && m.value && g.value && t("nodeDragDrop", {
5148
5145
  draggedNodeId: E.value,
5149
5146
  targetNodeId: m.value,
5150
- dragPosition: b.value
5151
- }), _.value = !1, t("updateDragState", null, null, null), E.value = null, m.value = null, b.value = null, f.value.clear();
5147
+ dragPosition: g.value
5148
+ }), _.value = !1, t("updateDragState", null, null, null), E.value = null, m.value = null, g.value = null, f.value.clear();
5152
5149
  }
5153
5150
  function z() {
5154
- document.removeEventListener("mousemove", S), document.removeEventListener("mouseup", D), _.value = !1, t("updateDragState", null, null, null), E.value = null, m.value = null, b.value = null, f.value.clear();
5151
+ document.removeEventListener("mousemove", S), document.removeEventListener("mouseup", D), _.value = !1, t("updateDragState", null, null, null), E.value = null, m.value = null, g.value = null, f.value.clear();
5155
5152
  }
5156
5153
  return {
5157
5154
  isDragging: _,
5158
5155
  draggedNodeId: E,
5159
5156
  dropTargetNodeId: m,
5160
- dropPosition: b,
5161
- mousePosition: C,
5157
+ dropPosition: g,
5158
+ mousePosition: I,
5162
5159
  onDragStart: n,
5163
5160
  cancelDrag: z
5164
5161
  };
@@ -5257,9 +5254,9 @@ const cl = { key: 0 }, ml = ["innerHTML"], pl = /* @__PURE__ */ me({
5257
5254
  emit: a
5258
5255
  }) {
5259
5256
  const t = u, o = O(() => t.expanded ? "expand_more" : "chevron_right"), p = O(() => t.node.disabled ? "text-fm-color-neutral-gray-200" : ""), r = O(() => t.node.disabled ? "cursor-not-allowed" : t.node.onClick ? "cursor-pointer" : ""), _ = O(() => t.selected ? "bg-fm-color-system-warning-100" : t.dropTarget && t.dropPosition === "inside" ? "bg-fm-color-primary-50" : ""), E = O(() => t.selected ? "text-fm-color-primary" : ""), m = a, {
5260
- onMouseDown: b,
5257
+ onMouseDown: g,
5261
5258
  onMouseMove: h,
5262
- onMouseUp: C
5259
+ onMouseUp: I
5263
5260
  } = dl((f) => {
5264
5261
  var n;
5265
5262
  (n = t.node) != null && n.draggable && m("dragStart", f);
@@ -5279,20 +5276,20 @@ const cl = { key: 0 }, ml = ["innerHTML"], pl = /* @__PURE__ */ me({
5279
5276
  f.node.disabled || (P = (T = f.node).onClick) == null || P.call(T);
5280
5277
  }, ["stop"])),
5281
5278
  onMousedown: n[3] || (n[3] = //@ts-ignore
5282
- (...T) => e(b) && e(b)(...T)),
5279
+ (...T) => e(g) && e(g)(...T)),
5283
5280
  onMousemove: n[4] || (n[4] = //@ts-ignore
5284
5281
  (...T) => e(h) && e(h)(...T)),
5285
5282
  onMouseup: n[5] || (n[5] = //@ts-ignore
5286
- (...T) => e(C) && e(C)(...T)),
5283
+ (...T) => e(I) && e(I)(...T)),
5287
5284
  onMouseleave: n[6] || (n[6] = //@ts-ignore
5288
- (...T) => e(C) && e(C)(...T))
5285
+ (...T) => e(I) && e(I)(...T))
5289
5286
  }, [N("div", fl, [N("div", gl, [(z = f.node) != null && z.draggable && !f.node.disabled ? (V(), oe(S, {
5290
5287
  key: 0,
5291
5288
  name: "drag_indicator",
5292
5289
  size: "sm",
5293
5290
  outline: "",
5294
5291
  class: "text-fm-color-neutral-gray-400 drag-handle flex-shrink-0"
5295
- })) : ee("", !0), c(Pt, {
5292
+ })) : ee("", !0), d(Pt, {
5296
5293
  name: o.value,
5297
5294
  visible: t.expandable,
5298
5295
  onClick: n[0] || (n[0] = Qe(() => {
@@ -5304,18 +5301,18 @@ const cl = { key: 0 }, ml = ["innerHTML"], pl = /* @__PURE__ */ me({
5304
5301
  outline: "",
5305
5302
  name: f.node.icon,
5306
5303
  class: "text-fm-color-neutral-gray-400 flex-shrink-0"
5307
- }, null, 8, ["name"])) : ee("", !0), N("div", vl, [c(D, {
5304
+ }, null, 8, ["name"])) : ee("", !0), N("div", vl, [d(D, {
5308
5305
  content: f.node.label,
5309
5306
  variant: "rich",
5310
5307
  placement: "top",
5311
5308
  "z-index": 50
5312
5309
  }, {
5313
- content: B(() => [N("div", bl, [c(xt, {
5310
+ content: B(() => [N("div", bl, [d(xt, {
5314
5311
  class: we(`${E.value} block`),
5315
5312
  text: f.node.label,
5316
5313
  highlightedStrings: f.highlightedStrings
5317
5314
  }, null, 8, ["class", "text", "highlightedStrings"])])]),
5318
- default: B(() => [c(xt, {
5315
+ default: B(() => [d(xt, {
5319
5316
  class: we(`${E.value} truncate block fm-typo-en-body-md-400`),
5320
5317
  text: f.node.label,
5321
5318
  highlightedStrings: f.highlightedStrings
@@ -5333,16 +5330,16 @@ const cl = { key: 0 }, ml = ["innerHTML"], pl = /* @__PURE__ */ me({
5333
5330
  tooltip: T.tooltip,
5334
5331
  visible: !0,
5335
5332
  onClick: (P) => {
5336
- var d;
5337
- return (d = T.onClick) == null ? void 0 : d.call(T);
5333
+ var c;
5334
+ return (c = T.onClick) == null ? void 0 : c.call(T);
5338
5335
  }
5339
- }, null, 8, ["name", "tooltip", "onClick"]))), 128))]), c(xt, {
5336
+ }, null, 8, ["name", "tooltip", "onClick"]))), 128))]), d(xt, {
5340
5337
  class: we(["fm-typo-en-body-md-400", ((F = f.node.rightLabel) == null ? void 0 : F.variant) === e(et).PRIMARY ? "text-fm-color-primary" : "text-fm-color-typo-secondary"]),
5341
5338
  text: ($ = f.node.rightLabel) == null ? void 0 : $.label,
5342
5339
  highlightedStrings: f.highlightedStrings,
5343
5340
  onClick: n[1] || (n[1] = Qe((T) => {
5344
- var P, d;
5345
- return (d = (P = f.node.rightLabel) == null ? void 0 : P.onClick) == null ? void 0 : d.call(P);
5341
+ var P, c;
5342
+ return (c = (P = f.node.rightLabel) == null ? void 0 : P.onClick) == null ? void 0 : c.call(P);
5346
5343
  }, ["stop"]))
5347
5344
  }, null, 8, ["class", "text", "highlightedStrings"])]), f.dropTarget && f.dropPosition === "before" ? (V(), Z("div", wl)) : ee("", !0), f.dropTarget && f.dropPosition === "after" ? (V(), Z("div", kl)) : ee("", !0), f.dropTarget && f.dropPosition === "inside" ? (V(), Z("div", Cl)) : ee("", !0)], 34);
5348
5345
  };
@@ -5370,42 +5367,42 @@ const cl = { key: 0 }, ml = ["innerHTML"], pl = /* @__PURE__ */ me({
5370
5367
  const {
5371
5368
  t: o
5372
5369
  } = ye(), p = u, r = t;
5373
- function _(g) {
5370
+ function _(b) {
5374
5371
  const M = p.expandedNodeIds;
5375
- M != null && M.includes(g) ? r("updateExpandedNodeIds", M.filter((k) => k !== g)) : r("updateExpandedNodeIds", [...M || [], g]);
5372
+ M != null && M.includes(b) ? r("updateExpandedNodeIds", M.filter((k) => k !== b)) : r("updateExpandedNodeIds", [...M || [], b]);
5376
5373
  }
5377
5374
  const E = O(() => new Set(p.expandedNodeIds)), m = O(() => {
5378
- const g = [];
5375
+ const b = [];
5379
5376
  function M(k, y = 0) {
5380
5377
  if (k)
5381
5378
  for (const v of k)
5382
- g.push({
5379
+ b.push({
5383
5380
  id: v.id,
5384
5381
  level: y,
5385
5382
  node: v
5386
5383
  }), E.value.has(v.id) && v.children && v.children.length > 0 && M(v.children, y + 1);
5387
5384
  }
5388
- return M(p.nodes), g;
5385
+ return M(p.nodes), b;
5389
5386
  });
5390
5387
  te(null);
5391
5388
  const {
5392
- list: b,
5389
+ list: g,
5393
5390
  scrollTo: h,
5394
- containerProps: C,
5391
+ containerProps: I,
5395
5392
  wrapperProps: f
5396
5393
  } = Zn(m, {
5397
5394
  itemHeight: Tt,
5398
5395
  overscan: 10
5399
5396
  });
5400
- Ve(() => m.value.length, async (g) => {
5401
- const M = C.ref.value;
5402
- M && g * Tt < M.scrollTop && (await gt(), h(0));
5397
+ Ve(() => m.value.length, async (b) => {
5398
+ const M = I.ref.value;
5399
+ M && b * Tt < M.scrollTop && (await gt(), h(0));
5403
5400
  });
5404
5401
  function n() {
5405
5402
  h(0);
5406
5403
  }
5407
- function S(g) {
5408
- const M = m.value.findIndex((k) => k.id === g);
5404
+ function S(b) {
5405
+ const M = m.value.findIndex((k) => k.id === b);
5409
5406
  M !== -1 && h(M);
5410
5407
  }
5411
5408
  const {
@@ -5415,26 +5412,26 @@ const cl = { key: 0 }, ml = ["innerHTML"], pl = /* @__PURE__ */ me({
5415
5412
  dropPosition: $,
5416
5413
  mousePosition: T,
5417
5414
  onDragStart: P,
5418
- cancelDrag: d
5415
+ cancelDrag: c
5419
5416
  } = ul({
5420
5417
  itemHeight: Tt,
5421
- emit: (g, ...M) => {
5422
- g === "updateDragState" ? r("updateDragState", ...M) : g === "nodeDragDrop" && r("nodeDragDrop", M[0]);
5418
+ emit: (b, ...M) => {
5419
+ b === "updateDragState" ? r("updateDragState", ...M) : b === "nodeDragDrop" && r("nodeDragDrop", M[0]);
5423
5420
  },
5424
5421
  getFlattenedItems: () => m.value,
5425
- getContainerRef: () => C.ref.value,
5422
+ getContainerRef: () => I.ref.value,
5426
5423
  canDropFn: p.canDropFn
5427
5424
  });
5428
5425
  return a({
5429
5426
  scrollToTop: n,
5430
5427
  scrollToNode: S,
5431
- cancelDrag: d
5432
- }), (g, M) => {
5428
+ cancelDrag: c
5429
+ }), (b, M) => {
5433
5430
  var y;
5434
5431
  const k = H("FmIcon");
5435
5432
  return V(), Z("div", xn({
5436
5433
  class: "tree-container"
5437
- }, e(C)), [N("div", Tn(Sn(e(f))), [(V(!0), Z(Te, null, Ue(e(b), ({
5434
+ }, e(I)), [N("div", Tn(Sn(e(f))), [(V(!0), Z(Te, null, Ue(e(g), ({
5438
5435
  data: v
5439
5436
  }) => {
5440
5437
  var i;
@@ -5473,7 +5470,7 @@ const cl = { key: 0 }, ml = ["innerHTML"], pl = /* @__PURE__ */ me({
5473
5470
  transform: "translate3d(0,0,0)"
5474
5471
  // Force hardware acceleration
5475
5472
  })
5476
- }, [N("div", Tl, [c(k, {
5473
+ }, [N("div", Tl, [d(k, {
5477
5474
  name: "drag_indicator"
5478
5475
  }), N("span", null, ve((y = m.value.find((v) => v.id === e(z))) == null ? void 0 : y.node.label), 1)])], 4)) : ee("", !0), m.value.length === 0 ? (V(), Z("div", Sl, ve(e(o)("menu.tree_editor.labels.no_items")), 1)) : ee("", !0)], 16);
5479
5476
  };
@@ -5520,24 +5517,24 @@ const cl = { key: 0 }, ml = ["innerHTML"], pl = /* @__PURE__ */ me({
5520
5517
  const t = u, o = a, p = bt(), r = be(), _ = yt(), {
5521
5518
  canDropFn: E,
5522
5519
  handleNodeDragDrop: m
5523
- } = sl(), b = O(() => t.filterState.searchKey), h = eo(b, 300), {
5524
- generateTreeFromMenu: C
5520
+ } = sl(), g = O(() => t.filterState.searchKey), h = eo(g, 300), {
5521
+ generateTreeFromMenu: I
5525
5522
  } = il();
5526
5523
  async function f() {
5527
- return await C({
5524
+ return await I({
5528
5525
  filterState: t.filterState,
5529
- eventEmitter: (d) => {
5530
- o("tree-event", d);
5526
+ eventEmitter: (c) => {
5527
+ o("tree-event", c);
5531
5528
  }
5532
5529
  });
5533
5530
  }
5534
5531
  Ve([() => t.overridedMenu, () => h.value], async () => {
5535
- const d = await f();
5532
+ const c = await f();
5536
5533
  if (t.filterState.searchKey) {
5537
- const g = Ao(d.tree, t.filterState.searchKey);
5538
- p.setTreeNodes(g.subTree), p.setExpandedNodeIds(g.shouldExpandNodeIds);
5534
+ const b = Ao(c.tree, t.filterState.searchKey);
5535
+ p.setTreeNodes(b.subTree), p.setExpandedNodeIds(b.shouldExpandNodeIds);
5539
5536
  } else
5540
- p.setTreeNodes(d.tree);
5537
+ p.setTreeNodes(c.tree);
5541
5538
  });
5542
5539
  const {
5543
5540
  t: n
@@ -5550,11 +5547,11 @@ const cl = { key: 0 }, ml = ["innerHTML"], pl = /* @__PURE__ */ me({
5550
5547
  schedulerManager: T,
5551
5548
  noScheduler: P
5552
5549
  } = Co(!0);
5553
- return (d, g) => (V(), Z("div", Pl, [N("div", Dl, [e(r).rules.category.create ? (V(), oe(St, {
5550
+ return (c, b) => (V(), Z("div", Pl, [N("div", Dl, [e(r).rules.category.create ? (V(), oe(St, {
5554
5551
  key: 0,
5555
5552
  label: e(n)("menu.tree_editor.actions.add_category"),
5556
5553
  icon: "add",
5557
- onClick: g[0] || (g[0] = (M) => e(_).create())
5554
+ onClick: b[0] || (b[0] = (M) => e(_).create())
5558
5555
  }, null, 8, ["label"])) : ee("", !0), e(r).state.currentCatalogId && !e(r).state.currentSchedulerId ? (V(), oe(Vt, {
5559
5556
  key: 1,
5560
5557
  "categorized-items": e($).linkableItems.value,
@@ -5569,7 +5566,7 @@ const cl = { key: 0 }, ml = ["innerHTML"], pl = /* @__PURE__ */ me({
5569
5566
  }, {
5570
5567
  default: B(({
5571
5568
  trigger: M
5572
- }) => [c(St, {
5569
+ }) => [d(St, {
5573
5570
  label: e(n)("menu.catalog.edit.link_product"),
5574
5571
  icon: "link",
5575
5572
  onClick: M
@@ -5589,30 +5586,30 @@ const cl = { key: 0 }, ml = ["innerHTML"], pl = /* @__PURE__ */ me({
5589
5586
  }, {
5590
5587
  default: B(({
5591
5588
  trigger: M
5592
- }) => [c(St, {
5589
+ }) => [d(St, {
5593
5590
  label: e(n)("menu.catalog.edit.apply_scheduler"),
5594
5591
  icon: "link",
5595
5592
  onClick: M
5596
5593
  }, null, 8, ["label", "onClick"])]),
5597
5594
  _: 1
5598
- }, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"])) : ee("", !0), N("div", Ol, [c(Dt, {
5595
+ }, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"])) : ee("", !0), N("div", Ol, [d(Dt, {
5599
5596
  name: "expand_all",
5600
5597
  tooltip: e(n)("menu.tree_editor.actions.expand_all"),
5601
5598
  visible: !0,
5602
- onClick: g[1] || (g[1] = (M) => e(p).expandAllNodes())
5603
- }, null, 8, ["tooltip"]), c(Dt, {
5599
+ onClick: b[1] || (b[1] = (M) => e(p).expandAllNodes())
5600
+ }, null, 8, ["tooltip"]), d(Dt, {
5604
5601
  name: "collapse_all",
5605
5602
  tooltip: e(n)("menu.tree_editor.actions.collapse_all"),
5606
5603
  visible: !0,
5607
- onClick: g[2] || (g[2] = (M) => e(p).collapseAllNodes())
5608
- }, null, 8, ["tooltip"])])]), c(to, null, {
5609
- default: B(() => [c(Fl, {
5604
+ onClick: b[2] || (b[2] = (M) => e(p).collapseAllNodes())
5605
+ }, null, 8, ["tooltip"])])]), d(to, null, {
5606
+ default: B(() => [d(Fl, {
5610
5607
  nodes: e(p).treeNodes,
5611
5608
  selectedNodeId: e(p).selectedNodeId,
5612
5609
  expandedNodeIds: e(p).expandedNodeIds,
5613
5610
  canDropFn: e(E),
5614
- onUpdateExpandedNodeIds: g[3] || (g[3] = (M) => e(p).setExpandedNodeIds(M)),
5615
- onNodeDragDrop: g[4] || (g[4] = (M) => e(m)(M))
5611
+ onUpdateExpandedNodeIds: b[3] || (b[3] = (M) => e(p).setExpandedNodeIds(M)),
5612
+ onNodeDragDrop: b[4] || (b[4] = (M) => e(m)(M))
5616
5613
  }, null, 8, ["nodes", "selectedNodeId", "expandedNodeIds", "canDropFn"])]),
5617
5614
  _: 1
5618
5615
  })]));
@@ -5632,35 +5629,35 @@ const cl = { key: 0 }, ml = ["innerHTML"], pl = /* @__PURE__ */ me({
5632
5629
  label: a("menu.tree_editor.labels.main_catalog"),
5633
5630
  value: null
5634
5631
  },
5635
- ...t.menu.modules.catalog.map((C) => ({
5636
- label: C.name,
5637
- value: C._id
5632
+ ...t.menu.modules.catalog.map((I) => ({
5633
+ label: I.name,
5634
+ value: I._id
5638
5635
  }))
5639
5636
  ]), _ = O(() => {
5640
5637
  var n;
5641
- const C = a("menu.common.labels.catalog"), f = ((n = r.value.find((S) => S.value === p.value.catalogId)) == null ? void 0 : n.label) || a("menu.tree_editor.labels.main_catalog");
5642
- return `${C}: ${f}`;
5638
+ const I = a("menu.common.labels.catalog"), f = ((n = r.value.find((S) => S.value === p.value.catalogId)) == null ? void 0 : n.label) || a("menu.tree_editor.labels.main_catalog");
5639
+ return `${I}: ${f}`;
5643
5640
  }), E = O(() => {
5644
5641
  var n;
5645
- const C = a("menu.common.labels.scheduler"), f = ((n = b.value.find((S) => S.value === p.value.schedulerId)) == null ? void 0 : n.label) || a("menu.tree_editor.labels.all_time");
5646
- return `${C}: ${f}`;
5647
- }), m = O(() => o.isV4), b = O(() => [
5642
+ const I = a("menu.common.labels.scheduler"), f = ((n = g.value.find((S) => S.value === p.value.schedulerId)) == null ? void 0 : n.label) || a("menu.tree_editor.labels.all_time");
5643
+ return `${I}: ${f}`;
5644
+ }), m = O(() => o.isV4), g = O(() => [
5648
5645
  {
5649
5646
  label: a("menu.tree_editor.labels.all_time"),
5650
5647
  value: ""
5651
5648
  },
5652
- ...t.menu.modules.scheduler.map((C) => ({
5653
- label: C.name,
5654
- value: C._id
5649
+ ...t.menu.modules.scheduler.map((I) => ({
5650
+ label: I.name,
5651
+ value: I._id
5655
5652
  }))
5656
5653
  ]), h = O(() => {
5657
- var C, f;
5658
- return (f = (C = o.currentCatalog) == null ? void 0 : C.linkItemRules) == null ? void 0 : f.length;
5654
+ var I, f;
5655
+ return (f = (I = o.currentCatalog) == null ? void 0 : I.linkItemRules) == null ? void 0 : f.length;
5659
5656
  });
5660
- return (C, f) => {
5657
+ return (I, f) => {
5661
5658
  const n = H("FmSearch");
5662
5659
  return V(), Z("div", Ml, [
5663
- c(qt, {
5660
+ d(qt, {
5664
5661
  "model-value": p.value.catalogId || "",
5665
5662
  items: r.value,
5666
5663
  placeholder: e(a)("menu.tree_editor.labels.main_catalog"),
@@ -5671,7 +5668,7 @@ const cl = { key: 0 }, ml = ["innerHTML"], pl = /* @__PURE__ */ me({
5671
5668
  m.value ? (V(), oe(qt, {
5672
5669
  key: 0,
5673
5670
  "model-value": p.value.schedulerId || "",
5674
- items: b.value,
5671
+ items: g.value,
5675
5672
  placeholder: e(a)("menu.tree_editor.labels.all_time"),
5676
5673
  "search-placeholder": e(a)("common.search"),
5677
5674
  "custom-label": E.value,
@@ -5684,7 +5681,7 @@ const cl = { key: 0 }, ml = ["innerHTML"], pl = /* @__PURE__ */ me({
5684
5681
  fullWidth: !0
5685
5682
  }, null, 8, ["current-restaurant-attr-params"])) : ee("", !0),
5686
5683
  f[4] || (f[4] = N("div", { class: "h-[1px] bg-fm-color-neutral-gray-100" }, null, -1)),
5687
- c(n, {
5684
+ d(n, {
5688
5685
  "model-value": p.value.searchKey || "",
5689
5686
  "onUpdate:modelValue": f[3] || (f[3] = (S) => p.value.searchKey = S),
5690
5687
  placeholder: e(a)("common.search")
@@ -5715,14 +5712,14 @@ const cl = { key: 0 }, ml = ["innerHTML"], pl = /* @__PURE__ */ me({
5715
5712
  const E = H("FmCircularProgress");
5716
5713
  return V(), Z("div", Rl, [
5717
5714
  N("div", Nl, [
5718
- c(Al, {
5715
+ d(Al, {
5719
5716
  menu: r.menu,
5720
5717
  modelValue: o.value,
5721
5718
  "onUpdate:modelValue": _[0] || (_[0] = (m) => o.value = m)
5722
5719
  }, null, 8, ["menu", "modelValue"])
5723
5720
  ]),
5724
5721
  N("div", Ll, [
5725
- c(Ul, {
5722
+ d(Ul, {
5726
5723
  menu: r.menu,
5727
5724
  "overrided-menu": r.overridedMenu,
5728
5725
  "filter-state": o.value,
@@ -5731,7 +5728,7 @@ const cl = { key: 0 }, ml = ["innerHTML"], pl = /* @__PURE__ */ me({
5731
5728
  ]),
5732
5729
  r.loading ? (V(), Z("div", Gl, [
5733
5730
  N("div", Bl, [
5734
- c(E, { size: "lg" })
5731
+ d(E, { size: "lg" })
5735
5732
  ])
5736
5733
  ])) : ee("", !0)
5737
5734
  ]);
@@ -5749,8 +5746,8 @@ const cl = { key: 0 }, ml = ["innerHTML"], pl = /* @__PURE__ */ me({
5749
5746
  }), Ot(() => {
5750
5747
  o.$dispose(), p.setExpandedNodeIds([]), p.setSelectedNodeId(null);
5751
5748
  });
5752
- const r = te(null), { currentItemId: _, initialForm: E, itemFormKey: m } = zo(o), { saveItemFormEditingStateDebounced: b } = Lo(r, o), h = te(null);
5753
- async function C(n) {
5749
+ const r = te(null), { currentItemId: _, initialForm: E, itemFormKey: m } = zo(o), { saveItemFormEditingStateDebounced: g } = Lo(r, o), h = te(null);
5750
+ async function I(n) {
5754
5751
  if (n.type === Se.SELECT_ITEM || n.type === Se.SELECT_PRICE || n.type === Se.SELECT_GROUP || n.type === Se.SELECT_VARIANT) {
5755
5752
  if (!f(n.itemId))
5756
5753
  return;
@@ -5780,11 +5777,11 @@ const cl = { key: 0 }, ml = ["innerHTML"], pl = /* @__PURE__ */ me({
5780
5777
  }
5781
5778
  return (n, S) => (V(), oe(al, null, {
5782
5779
  "left-panel": B(() => [
5783
- c(Kl, {
5780
+ d(Kl, {
5784
5781
  menu: n.menu,
5785
5782
  "overrided-menu": e(o).mergedMenu,
5786
5783
  loading: e(o).workerIsComputing,
5787
- onTreeEvent: C
5784
+ onTreeEvent: I
5788
5785
  }, null, 8, ["menu", "overrided-menu", "loading"])
5789
5786
  ]),
5790
5787
  "right-panel": B(() => [
@@ -5798,7 +5795,7 @@ const cl = { key: 0 }, ml = ["innerHTML"], pl = /* @__PURE__ */ me({
5798
5795
  "merged-menu": e(o).mergedMenu,
5799
5796
  "category-id": null,
5800
5797
  focused: h.value,
5801
- "onUpdate:editingState": e(b)
5798
+ "onUpdate:editingState": e(g)
5802
5799
  }, null, 8, ["initial-form", "menu", "merged-menu", "focused", "onUpdate:editingState"])) : (V(), Z("div", jl, [
5803
5800
  N("div", Yl, ve(e(a)("menu.tree_editor.labels.please_select_a_product_to_edit")), 1)
5804
5801
  ]))
@@ -5826,13 +5823,13 @@ const cl = { key: 0 }, ml = ["innerHTML"], pl = /* @__PURE__ */ me({
5826
5823
  setup(u, { emit: a }) {
5827
5824
  const t = u, o = je(), { minor: p } = at(o), { t: r } = ye(), _ = a, E = () => {
5828
5825
  _("update:show", !1);
5829
- }, m = vt(), b = be();
5830
- b.selectCatalog(null), b.selectScheduler(null);
5831
- const h = te(!1), C = () => {
5826
+ }, m = vt(), g = be();
5827
+ g.selectCatalog(null), g.selectScheduler(null);
5828
+ const h = te(!1), I = () => {
5832
5829
  p(
5833
5830
  async () => {
5834
5831
  fn(), await gt();
5835
- const n = b.state.menu, S = fo(n);
5832
+ const n = g.state.menu, S = fo(n);
5836
5833
  await m.updateMenuSetting(S), await m.importMenu(S), E();
5837
5834
  },
5838
5835
  {
@@ -5842,7 +5839,7 @@ const cl = { key: 0 }, ml = ["innerHTML"], pl = /* @__PURE__ */ me({
5842
5839
  }
5843
5840
  );
5844
5841
  }, f = Gt(
5845
- () => !Fe.isEqual(t.menu.modules, b.state.menu.modules),
5842
+ () => !Fe.isEqual(t.menu.modules, g.state.menu.modules),
5846
5843
  () => {
5847
5844
  E();
5848
5845
  }
@@ -5850,38 +5847,38 @@ const cl = { key: 0 }, ml = ["innerHTML"], pl = /* @__PURE__ */ me({
5850
5847
  return (n, S) => {
5851
5848
  const D = H("fm-button"), z = H("fm-form");
5852
5849
  return V(), oe(En, { to: "body" }, [
5853
- c(Fn, { name: "fade" }, {
5850
+ d(Fn, { name: "fade" }, {
5854
5851
  default: B(() => [
5855
- c(z, {
5852
+ d(z, {
5856
5853
  "blame-form-child-on-validation-failed": "",
5857
5854
  class: we(["fixed inset-0", "flex flex-col", "w-screen h-dvh", "bg-fm-color-neutral-white"]),
5858
5855
  style: mt({ zIndex: n.zIndex }),
5859
5856
  tabindex: "-1",
5860
- onValidationSuccess: C,
5857
+ onValidationSuccess: I,
5861
5858
  onKeyup: $n(e(f), ["esc"])
5862
5859
  }, {
5863
5860
  default: B(() => [
5864
5861
  N("div", Wl, [
5865
5862
  N("p", Hl, ve(e(r)("menu.tree_editor.title")), 1),
5866
5863
  N("div", Xl, [
5867
- c(D, {
5864
+ d(D, {
5868
5865
  icon: "undo",
5869
- disabled: !e(b).canUndoHistory,
5866
+ disabled: !e(g).canUndoHistory,
5870
5867
  variant: "tertiary",
5871
- onClick: e(b).undoHistory
5868
+ onClick: e(g).undoHistory
5872
5869
  }, null, 8, ["disabled", "onClick"]),
5873
- c(D, {
5870
+ d(D, {
5874
5871
  icon: "redo",
5875
- disabled: !e(b).canRedoHistory,
5872
+ disabled: !e(g).canRedoHistory,
5876
5873
  variant: "tertiary",
5877
- onClick: e(b).redoHistory
5874
+ onClick: e(g).redoHistory
5878
5875
  }, null, 8, ["disabled", "onClick"]),
5879
- c(D, {
5876
+ d(D, {
5880
5877
  label: e(r)("common.cancel"),
5881
5878
  variant: "tertiary",
5882
5879
  onClick: e(f)
5883
5880
  }, null, 8, ["label", "onClick"]),
5884
- c(D, {
5881
+ d(D, {
5885
5882
  label: e(r)("common.save"),
5886
5883
  type: "submit",
5887
5884
  variant: "primary",
@@ -5890,7 +5887,7 @@ const cl = { key: 0 }, ml = ["innerHTML"], pl = /* @__PURE__ */ me({
5890
5887
  ])
5891
5888
  ]),
5892
5889
  N("div", Ql, [
5893
- c(ql, { menu: n.menu }, null, 8, ["menu"])
5890
+ d(ql, { menu: n.menu }, null, 8, ["menu"])
5894
5891
  ])
5895
5892
  ]),
5896
5893
  _: 1