@feedmepos/mf-menu 0.32.63-dev.3 → 0.32.63

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 (68) hide show
  1. package/dist/{App-DHxlR--3.js → App-BBbO4JIS.js} +8 -8
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-6noIwjis.js → ApplyProduct.vue_vue_type_script_setup_true_lang-CbxSzHxq.js} +3 -3
  3. package/dist/{ApplyProductDialog.vue_vue_type_script_setup_true_lang-CMI2Nh0n.js → ApplyProductDialog.vue_vue_type_script_setup_true_lang-7WuKnUmN.js} +3 -3
  4. package/dist/{Catalog-B-S0gygH.js → Catalog-BmegfFgh.js} +6 -6
  5. package/dist/{Category-DOhNama9.js → Category-C7Ue-fUU.js} +4 -4
  6. package/dist/{Category-DGDddfLx.js → Category-Ddyf3rse.js} +4 -4
  7. package/dist/{CookingGuide-CUR57F4P.js → CookingGuide-CLgt2sOm.js} +5 -5
  8. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-bIONGM6k.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-COeFm_ww.js} +1 -1
  9. package/dist/{Group-BsGJ0omP.js → Group-CRKR1Ykj.js} +1 -1
  10. package/dist/{Group-z-0jQPCd.js → Group-CYPqL4lj.js} +3 -3
  11. package/dist/{Group.vue_vue_type_script_setup_true_lang-bBWkJ2Hx.js → Group.vue_vue_type_script_setup_true_lang-NuuNUptx.js} +7 -7
  12. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BbqcH4sM.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-B3C6VTGC.js} +5 -5
  13. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-CVGilzd0.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-VtcRq2HL.js} +2697 -2697
  14. package/dist/{Ingredient-D38IVDXK.js → Ingredient-DRf6aqJJ.js} +4 -4
  15. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-CKmyz9CP.js → InventoryBinding.vue_vue_type_script_setup_true_lang-Bybxf9pl.js} +2 -2
  16. package/dist/{LinkProductSideSheet-DsBA_o9g.js → LinkProductSideSheet-HDmjKJSh.js} +4 -4
  17. package/dist/{MenuSetting-D-tln58o.js → MenuSetting-BGbL4Z6H.js} +7 -7
  18. package/dist/{OrderPacing-BdCEHKD9.js → OrderPacing-DF_HE2Cg.js} +5 -5
  19. package/dist/{PrintRoute-DKFMqyeI.js → PrintRoute-CnXWRLaD.js} +5 -5
  20. package/dist/{Product-Dzo4ljes.js → Product-Iyo2jhYY.js} +1 -1
  21. package/dist/{Product.vue_vue_type_script_setup_true_lang-BtE2aiwU.js → Product.vue_vue_type_script_setup_true_lang-HVRVPZqe.js} +13 -13
  22. package/dist/{ProductInternalTools-Z6XR4zko.js → ProductInternalTools-BInH19jg.js} +7 -7
  23. package/dist/{Products-CCo675Ee.js → Products-BIhb7G8B.js} +33 -33
  24. package/dist/{Publish-tixV8Of1.js → Publish-CKmI_Dm1.js} +4 -4
  25. package/dist/{Recipe-V9kzxmlf.js → Recipe-BoVvW9JJ.js} +5 -5
  26. package/dist/{RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-DBhAzVz3.js → RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-wMFM8TLf.js} +1 -1
  27. package/dist/{RuleView.vue_vue_type_script_setup_true_lang-D9DqmAVY.js → RuleView.vue_vue_type_script_setup_true_lang-BxYsaZfB.js} +462 -462
  28. package/dist/{Scheduler-0UpDGQKJ.js → Scheduler-QZtG4Vyg.js} +3 -3
  29. package/dist/{ServingSequence-CutiXht7.js → ServingSequence-BsCeJ9tY.js} +3 -3
  30. package/dist/{Setting-jyYmoDiq.js → Setting-C4zVAUUs.js} +5 -5
  31. package/dist/{Subcategory-CQSKOLjU.js → Subcategory-Cqj_0Zcf.js} +6 -6
  32. package/dist/{Takeaway-CQ0m09TB.js → Takeaway-Bg_Ulvvu.js} +1 -1
  33. package/dist/{Takeaway-DeCthkOI.js → Takeaway-hlLosEp5.js} +4 -4
  34. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-FHE6oQ0d.js → Takeaway.vue_vue_type_script_setup_true_lang-VokixlT7.js} +5 -5
  35. package/dist/{TranslationFieldSection.vue_vue_type_script_setup_true_lang-D9Ga3fOj.js → TranslationFieldSection.vue_vue_type_script_setup_true_lang-Cqt2GuoP.js} +1 -1
  36. package/dist/{TranslationSideSheet.vue_vue_type_script_setup_true_lang-Bz32rpvX.js → TranslationSideSheet.vue_vue_type_script_setup_true_lang-D-gqJRTs.js} +2 -2
  37. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DCPGAyOm.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BgfluI5H.js} +605 -603
  38. package/dist/{Unit-_XiPfauV.js → Unit-DcXSwJZn.js} +2 -2
  39. package/dist/{Variant-DfdMywhn.js → Variant-B0gnJndI.js} +3 -3
  40. package/dist/{_id_-Yj5av4B4.js → _id_-Do06Eogr.js} +9 -9
  41. package/dist/{app-CqdVluGs.js → app-CoLRt3Jh.js} +1 -1
  42. package/dist/{app-BcGgfvbE.js → app-b2SIk1B-.js} +32 -32
  43. package/dist/app.js +1 -1
  44. package/dist/assets/{linked-status-DdDQXL8Y.js → linked-status-D83s5iw2.js} +4 -4
  45. package/dist/assets/{menu-export-CK5bJyLT.js → menu-export-CTANUT4c.js} +6 -6
  46. package/dist/assets/{override-menu-CHL7Bynw.js → override-menu-BU4SgNGf.js} +4 -4
  47. package/dist/assets/{validate-menu-g2fslPcE.js → validate-menu-C5Oth47D.js} +3 -3
  48. package/dist/{catalog-B_yk-l1-.js → catalog-D7j4_Q_e.js} +1 -1
  49. package/dist/{catalogSetting-Dl7uIiJm.js → catalogSetting-g3y-LVDw.js} +1 -1
  50. package/dist/{currency-BpjSDqef.js → currency-tR7w0ukg.js} +1 -1
  51. package/dist/{dayjs.min-CVH5LqOA.js → dayjs.min-D1MKpV8B.js} +2 -2
  52. package/dist/{discardConfirm-fCmrAVO1.js → discardConfirm-BaKm8467.js} +1 -1
  53. package/dist/{index-Cru6sUb6.js → index-CQkYxKQd.js} +5 -5
  54. package/dist/{index-LYc0WKDO.js → index-LnI6_0IZ.js} +6 -6
  55. package/dist/{index.vue_vue_type_script_setup_true_lang-qgDBinUn.js → index.vue_vue_type_script_setup_true_lang-P7O7STU9.js} +440 -440
  56. package/dist/{item-EPxRgVm0.js → item-43Eu4ZXr.js} +674 -673
  57. package/dist/{jszip.min-CNgWv4I3.js → jszip.min-B_t4VNZS.js} +529 -529
  58. package/dist/{linkProducts-DvQ0oP1V.js → linkProducts-8GEwo-Eo.js} +4 -4
  59. package/dist/{memberPricing-deWSH2K0.js → memberPricing-DNqHrCnd.js} +1 -1
  60. package/dist/{menu-DKJ7olgK.js → menu-CjpQrL-3.js} +1 -1
  61. package/dist/{menuV2-CB3eZiiP.js → menuV2-CiFcZLoW.js} +27 -27
  62. package/dist/{order_pacing-DvP19Nxa.js → order_pacing-DXKwdyi5.js} +5 -5
  63. package/dist/{priceTier-DyxDcoSh.js → priceTier-BVEITapN.js} +1 -1
  64. package/dist/{rules-GmuBnHtU.js → rules-BEYt9OD5.js} +3 -3
  65. package/dist/{scheduler-BWAzMbPl.js → scheduler-7EG7twK8.js} +5 -5
  66. package/dist/{toExcel-BMOGsD6n.js → toExcel-VC6zCquB.js} +2 -2
  67. package/dist/{unit-BCREKGn9.js → unit-C2SwnTZh.js} +3 -3
  68. package/package.json +1 -1
@@ -1,38 +1,38 @@
1
1
  import { defineStore as Ni } from "pinia";
2
2
  import { defineComponent as fe, resolveComponent as M, createElementBlock as W, createBlock as Q, openBlock as _, createElementVNode as C, createVNode as h, toDisplayString as oe, Fragment as ve, renderList as Ie, h as Ue, ref as H, computed as E, watch as Se, unref as m, renderSlot as Oe, withCtx as F, createCommentVNode as ee, Transition as ar, normalizeClass as Ve, resolveDynamicComponent as Cn, withDirectives as Xe, vShow as Pn, mergeProps as Bi, withModifiers as ct, onBeforeUnmount as Li, resolveDirective as Ht, onMounted as Wt, onUnmounted as Eo, createTextVNode as Sn, getCurrentInstance as Oo, render as xn, useSlots as rr, markRaw as sr, mergeModels as Xo, useModel as lr, isVNode as ur, nextTick as ji, normalizeProps as cr, guardReactiveProps as dr, normalizeStyle as mr } from "vue";
3
- import { V as pr, W as fr, g as Ne, h as Be, k as Pe, T as hr, X as gr, s as Wi, d as Ce, m as at, j as Te, a as Ye, n as vr, u as De, b as st, i as pt, Y as br, Z as yr, $ as Gi, a0 as _n, a1 as Zo, a2 as Gn, a3 as Et, a4 as _r, a5 as wr, a6 as Qo, a7 as kr, a8 as Cr, a9 as Jo, aa as Sr, ab as xr, ac as Ar, ad as ei, ae as ti, t as Hi, af as Tr, F as At, x as ni, r as Rr, o as Ir, l as Er, I as Hn, ag as Or, Q as Dr, w as oi, v as $r, ah as Pr } from "./index.vue_vue_type_script_setup_true_lang-qgDBinUn.js";
3
+ import { V as pr, W as fr, g as Ne, h as Be, k as Pe, T as hr, X as gr, s as Wi, d as Ce, m as at, j as Te, a as Ye, n as vr, u as De, b as st, i as pt, Y as br, Z as yr, $ as Gi, a0 as _n, a1 as Zo, a2 as Gn, a3 as Et, a4 as _r, a5 as wr, a6 as Qo, a7 as kr, a8 as Cr, a9 as Jo, aa as Sr, ab as xr, ac as Ar, ad as ei, ae as ti, t as Hi, af as Tr, F as At, x as ni, r as Rr, o as Ir, l as Er, I as Hn, ag as Or, Q as Dr, w as oi, v as $r, ah as Pr } from "./index.vue_vue_type_script_setup_true_lang-P7O7STU9.js";
4
4
  import { useI18n as ge, useCoreStore as zt, CustomAttributesForm as Ki } from "@feedmepos/mf-common";
5
5
  import { useDialog as tt, useSnackbar as Qe, useDialogChild as Nt, FmButtonVariant as ze, components as Ee, FmButtonColorThemeVariant as nt, useBreakpoints as qi } from "@feedmepos/ui-library";
6
- import { C as gt } from "./catalog-B_yk-l1-.js";
7
- import { g as co, a as Vr, m as Fr, i as Mr } from "./menuV2-CB3eZiiP.js";
6
+ import { C as gt } from "./catalog-D7j4_Q_e.js";
7
+ import { g as co, a as Vr, m as Fr, i as Mr } from "./menuV2-CiFcZLoW.js";
8
8
  import { c as Yi } from "./createComponentProgrammatically-Bt2rn1IQ.js";
9
9
  import { a as ii, _ as Vt } from "./tooltip-B5BiPMx9.js";
10
- import { H as Ur, L as zr } from "./LinkProductSideSheet-DsBA_o9g.js";
11
- import { _ as Ke, u as Nr, a as Br } from "./RuleView.vue_vue_type_script_setup_true_lang-D9DqmAVY.js";
10
+ import { H as Ur, L as zr } from "./LinkProductSideSheet-HDmjKJSh.js";
11
+ import { _ as Ke, u as Nr, a as Br } from "./RuleView.vue_vue_type_script_setup_true_lang-BxYsaZfB.js";
12
12
  import { a as Gt, s as mo, F as Lr, _ as jr } from "./index-CD_omf3p.js";
13
- import { e as Wr } from "./app-BcGgfvbE.js";
14
- import { l as $e, u as Xt } from "./discardConfirm-fCmrAVO1.js";
13
+ import { e as Wr } from "./app-b2SIk1B-.js";
14
+ import { l as $e, u as Xt } from "./discardConfirm-BaKm8467.js";
15
15
  import { _ as Tt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
16
16
  import { useAppStore as cn, RemyButton as An } from "@feedmepos/mf-remy-panel";
17
17
  import { _ as yt } from "./FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js";
18
- import { u as Gr, r as Hr } from "./rules-GmuBnHtU.js";
19
- import { _ as Xi, a as Tn, b as Rn, c as In } from "./TranslationFieldSection.vue_vue_type_script_setup_true_lang-D9Ga3fOj.js";
18
+ import { u as Gr, r as Hr } from "./rules-BEYt9OD5.js";
19
+ import { _ as Xi, a as Tn, b as Rn, c as In } from "./TranslationFieldSection.vue_vue_type_script_setup_true_lang-Cqt2GuoP.js";
20
20
  import { a as po, g as Ct } from "./translation-fNx6yEpy.js";
21
21
  import { c as En } from "./object-DVUNCr7w.js";
22
- import { _ as Do } from "./TranslationSideSheet.vue_vue_type_script_setup_true_lang-Bz32rpvX.js";
23
- import { u as Kr } from "./menu-DKJ7olgK.js";
22
+ import { _ as Do } from "./TranslationSideSheet.vue_vue_type_script_setup_true_lang-D-gqJRTs.js";
23
+ import { u as Kr } from "./menu-CjpQrL-3.js";
24
24
  import { c as Bt } from "./check-C9mY6LiX.js";
25
- import { _ as bt, l as fo, T as qr } from "./index-LYc0WKDO.js";
25
+ import { _ as bt, l as fo, T as qr } from "./index-LnI6_0IZ.js";
26
26
  import { useInventoryStore as Zi, InventoryBindingForm as Yr, InventoryBindingSummary as Xr } from "@feedmepos/mf-inventory-portal";
27
- import { f as rt } from "./currency-BpjSDqef.js";
28
- import { u as Vn } from "./memberPricing-deWSH2K0.js";
29
- import { u as Qi } from "./priceTier-DyxDcoSh.js";
27
+ import { f as rt } from "./currency-tR7w0ukg.js";
28
+ import { u as Vn } from "./memberPricing-DNqHrCnd.js";
29
+ import { u as Qi } from "./priceTier-BVEITapN.js";
30
30
  import { u as Zr } from "./search-BAPEUu1R.js";
31
31
  import { c as Qr } from "./string-DpfFixWH.js";
32
32
  import { d as Ji } from "./RuleConditionSelector.vue_vue_type_style_index_0_lang-CK8z7qA8.js";
33
- import { _ as Jr } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-6noIwjis.js";
34
- import { u as es, a as ts } from "./order_pacing-DvP19Nxa.js";
35
- import { V as ai } from "./index-Cru6sUb6.js";
33
+ import { _ as Jr } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-CbxSzHxq.js";
34
+ import { u as es, a as ts } from "./order_pacing-DXKwdyi5.js";
35
+ import { V as ai } from "./index-CQkYxKQd.js";
36
36
  var Kn, mn, qn = 0, Yn = 0;
37
37
  function ns(e, t, n) {
38
38
  var o = 0, i = new Array(16);
@@ -425,16 +425,16 @@ class ta {
425
425
  const i = this.menuStore.state.menu.modules.item, a = this.menuStore.state.menu.modules.group, r = this.menuStore.items, l = this.menuStore.rules.group.linkAddonName;
426
426
  function s(u, d) {
427
427
  const c = u.items.reduce((f, g) => {
428
- var $, N, B, k;
429
- const w = i.find((V) => g._id === V._id);
428
+ var P, N, B, k;
429
+ const w = i.find((O) => g._id === O._id);
430
430
  if (!w && n) return f;
431
431
  const y = g.combinationKey ? {
432
- ...($ = w == null ? void 0 : w.variant) == null ? void 0 : $.variantCombinations.find(
433
- (V) => V.combinationKey === g.combinationKey
432
+ ...(P = w == null ? void 0 : w.variant) == null ? void 0 : P.variantCombinations.find(
433
+ (O) => O.combinationKey === g.combinationKey
434
434
  ),
435
435
  name: vr(De().variants, ((N = w == null ? void 0 : w.variant) == null ? void 0 : N.variantGroupIds) || [])[g.combinationKey]
436
- } : w, b = (B = a.find((V) => V._id === u._id)) == null ? void 0 : B.items.find((V) => V._id === g._id && V.combinationKey === g.combinationKey), R = !n && !g.combinationKey, A = (k = d.find(
437
- (V) => V._id == g._id && V.combinationKey == g.combinationKey
436
+ } : w, b = (B = a.find((O) => O._id === u._id)) == null ? void 0 : B.items.find((O) => O._id === g._id && O.combinationKey === g.combinationKey), R = !n && !g.combinationKey, A = (k = d.find(
437
+ (O) => O._id == g._id && O.combinationKey == g.combinationKey
438
438
  )) == null ? void 0 : k.price, L = l ? null : y == null ? void 0 : y.name, I = g.name || (b == null ? void 0 : b.name) || L || null, T = (y == null ? void 0 : y.name) || null, x = g.name_locale ?? (b == null ? void 0 : b.name_locale) ?? (y == null ? void 0 : y.name_locale) ?? null, U = {
439
439
  ...g,
440
440
  name: I,
@@ -1355,7 +1355,7 @@ const zs = /* @__PURE__ */ Tt(Fs, [["render", Us]]), Ns = { class: "flex flex-co
1355
1355
  },
1356
1356
  { immediate: !0 }
1357
1357
  ), (R, A) => {
1358
- const L = M("FmIcon"), I = M("FmField"), T = M("FmMenuItem"), x = M("FmMenu"), U = M("FmFormGroup"), $ = M("FmChipGroup");
1358
+ const L = M("FmIcon"), I = M("FmField"), T = M("FmMenuItem"), x = M("FmMenu"), U = M("FmFormGroup"), P = M("FmChipGroup");
1359
1359
  return _(), W("div", ol, [
1360
1360
  h(U, {
1361
1361
  "model-value": R.modelValue,
@@ -1426,7 +1426,7 @@ const zs = /* @__PURE__ */ Tt(Fs, [["render", Us]]), Ns = { class: "flex flex-co
1426
1426
  _: 1
1427
1427
  }, 8, ["model-value", "disabled", "focused", "helper-state", "helper-text", "rules"]),
1428
1428
  R.shouldShowChips && d.value.length > 0 ? (_(), W("div", rl, [
1429
- h($, {
1429
+ h(P, {
1430
1430
  disabled: R.disabled,
1431
1431
  items: d.value.map((N) => ({ label: N.label })),
1432
1432
  removable: "",
@@ -3062,16 +3062,16 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
3062
3062
  };
3063
3063
  function I(v, S) {
3064
3064
  if (!c.value || S !== "active") return null;
3065
- const P = Zo(c.value.url, v), q = b.value[v];
3066
- return q ? `${P}&t=${q}` : P;
3065
+ const V = Zo(c.value.url, v), q = b.value[v];
3066
+ return q ? `${V}&t=${q}` : V;
3067
3067
  }
3068
3068
  const T = H(!1), x = H(null), U = E(() => {
3069
3069
  if (!c.value) return null;
3070
3070
  const v = x.value;
3071
3071
  if (!v) return c.value.url;
3072
- const S = Zo(c.value.url, v), P = b.value[v];
3073
- return P ? `${S}&t=${P}` : S;
3074
- }), $ = E(
3072
+ const S = Zo(c.value.url, v), V = b.value[v];
3073
+ return V ? `${S}&t=${V}` : S;
3074
+ }), P = E(
3075
3075
  () => x.value ? Gn(x.value) : i("menu.product_image.manage.original")
3076
3076
  );
3077
3077
  function N(v) {
@@ -3079,8 +3079,8 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
3079
3079
  }
3080
3080
  function B(v) {
3081
3081
  const S = /* @__PURE__ */ new Set();
3082
- for (const P of v)
3083
- for (const q of P.images ?? [])
3082
+ for (const V of v)
3083
+ for (const q of V.images ?? [])
3084
3084
  for (const re of Object.keys(q.imageSet ?? {}))
3085
3085
  Et.includes(re) || S.add(re);
3086
3086
  return S;
@@ -3088,14 +3088,14 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
3088
3088
  const k = E(() => {
3089
3089
  var S;
3090
3090
  const v = B(n.menuItems ?? []);
3091
- for (const P of Object.keys(((S = c.value) == null ? void 0 : S.imageSet) ?? {}))
3092
- Et.includes(P) || v.add(P);
3091
+ for (const V of Object.keys(((S = c.value) == null ? void 0 : S.imageSet) ?? {}))
3092
+ Et.includes(V) || v.add(V);
3093
3093
  return [...v];
3094
- }), V = E(() => {
3095
- var P;
3096
- const v = Object.keys(((P = c.value) == null ? void 0 : P.imageSet) ?? {});
3094
+ }), O = E(() => {
3095
+ var V;
3096
+ const v = Object.keys(((V = c.value) == null ? void 0 : V.imageSet) ?? {});
3097
3097
  return [...Et.filter((q) => v.includes(q)), ...k.value].map((q) => {
3098
- var D;
3098
+ var $;
3099
3099
  const re = R.value[q] ? "pending" : f.value[q];
3100
3100
  return {
3101
3101
  ratio: q,
@@ -3106,7 +3106,7 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
3106
3106
  url: I(q, re),
3107
3107
  // A union-only ratio this image has never carried cannot be removed here: the ✕
3108
3108
  // deletes this image's own variant, so it only renders for ratios the image has.
3109
- removable: !Et.includes(q) && q in (((D = c.value) == null ? void 0 : D.imageSet) ?? {})
3109
+ removable: !Et.includes(q) && q in ((($ = c.value) == null ? void 0 : $.imageSet) ?? {})
3110
3110
  };
3111
3111
  });
3112
3112
  }), z = E(
@@ -3115,7 +3115,7 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
3115
3115
  return !(v in (((S = c.value) == null ? void 0 : S.imageSet) ?? {}));
3116
3116
  })
3117
3117
  );
3118
- function X() {
3118
+ function Z() {
3119
3119
  A && clearTimeout(A), A = null;
3120
3120
  }
3121
3121
  async function ne() {
@@ -3123,33 +3123,34 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
3123
3123
  try {
3124
3124
  const S = await _r.listImages([n.itemId]);
3125
3125
  if (!n.modelValue) return;
3126
- const P = S.find((O) => {
3126
+ const V = S.find((D) => {
3127
3127
  var K;
3128
- return O.imageId === ((K = c.value) == null ? void 0 : K._id);
3128
+ return D.imageId === ((K = c.value) == null ? void 0 : K._id);
3129
3129
  }), q = f.value;
3130
3130
  f.value = Object.fromEntries(
3131
- ((P == null ? void 0 : P.variants) ?? []).map((O) => [O.aspectRatio, O.status])
3131
+ ((V == null ? void 0 : V.variants) ?? []).map((D) => [D.aspectRatio, D.status])
3132
3132
  ), g.value = !0;
3133
- const re = Date.now(), D = { ...R.value };
3134
- Object.entries(D).forEach(([O, K]) => {
3135
- !(f.value[O] === "active" && q[O] !== "active") && re < K || (delete D[O], b.value = { ...b.value, [O]: re });
3136
- }), R.value = D;
3133
+ const re = Date.now(), $ = { ...R.value };
3134
+ Object.entries($).forEach(([D, K]) => {
3135
+ const X = f.value[D] === "active" && q[D] !== "active", le = f.value[D] === "failed";
3136
+ !X && !le && re < K || (delete $[D], b.value = { ...b.value, [D]: re });
3137
+ }), R.value = $;
3137
3138
  } catch {
3138
3139
  return;
3139
3140
  }
3140
- X(), (Object.values(f.value).some((S) => S === "pending") || Object.keys(R.value).length > 0) && n.modelValue && (A = setTimeout(ne, 5e3));
3141
+ Z(), (Object.values(f.value).some((S) => S === "pending") || Object.keys(R.value).length > 0) && n.modelValue && (A = setTimeout(ne, 5e3));
3141
3142
  }
3142
3143
  Se(
3143
3144
  () => [n.modelValue, n.image],
3144
3145
  ([v, S]) => {
3145
3146
  if (!v) {
3146
- X(), T.value = !1;
3147
+ Z(), T.value = !1;
3147
3148
  return;
3148
3149
  }
3149
3150
  c.value = S ? { ...S, imageSet: { ...S.imageSet } } : null, p.value = c.value ? { ...c.value, imageSet: { ...c.value.imageSet } } : null, f.value = {}, g.value = !1, w.value = {}, b.value = {}, R.value = {}, y.value = null, ne();
3150
3151
  },
3151
3152
  { immediate: !0 }
3152
- ), Li(X);
3153
+ ), Li(Z);
3153
3154
  async function j(v) {
3154
3155
  if (!(!c.value || !v.length))
3155
3156
  try {
@@ -3190,8 +3191,8 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
3190
3191
  y.value = v;
3191
3192
  try {
3192
3193
  await S();
3193
- } catch (P) {
3194
- r.open({ message: `${P}`, type: "error" });
3194
+ } catch (V) {
3195
+ r.open({ message: `${V}`, type: "error" });
3195
3196
  } finally {
3196
3197
  y.value = null;
3197
3198
  }
@@ -3205,20 +3206,20 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
3205
3206
  contentComponentProps: { ratio: v.ratio },
3206
3207
  primaryActions: { text: i("menu.common.actions.confirm"), close: !0 },
3207
3208
  secondaryActions: { text: i("menu.common.actions.cancel"), close: !0 }
3208
- }).onPrimary((P) => {
3209
- if (!P) {
3209
+ }).onPrimary((V) => {
3210
+ if (!V) {
3210
3211
  r.open({ message: i("menu.product_image.replace.no_file"), type: "error" });
3211
3212
  return;
3212
3213
  }
3213
3214
  me(v.ratio, async () => {
3214
- c.value = await kr(n.itemId, S, v.ratio, P);
3215
+ c.value = await kr(n.itemId, S, v.ratio, V);
3215
3216
  const q = { ...w.value };
3216
3217
  delete q[v.ratio], w.value = q, b.value = { ...b.value, [v.ratio]: Date.now() }, r.open({ message: i("menu.product_image.replace.done"), type: "success" }), ne();
3217
3218
  });
3218
3219
  });
3219
3220
  }
3220
3221
  function te(v) {
3221
- var P;
3222
+ var V;
3222
3223
  if (n.coverOnly || !c.value) return;
3223
3224
  const S = c.value;
3224
3225
  if (w.value[v.ratio] === !0 || g.value && !f.value[v.ratio]) {
@@ -3243,7 +3244,7 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
3243
3244
  ratioLabel: v.label,
3244
3245
  // A ratio holding a custom image must never be re-derived from the original —
3245
3246
  // that would silently discard the merchant's own photo.
3246
- canRegenerateFromOrigin: !((P = S.imageSet) != null && P[v.ratio])
3247
+ canRegenerateFromOrigin: !((V = S.imageSet) != null && V[v.ratio])
3247
3248
  },
3248
3249
  primaryActions: { text: i("menu.product_image.regenerate.action"), close: !0 },
3249
3250
  secondaryActions: { text: i("menu.common.actions.cancel"), close: !0 }
@@ -3260,8 +3261,8 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
3260
3261
  q,
3261
3262
  re
3262
3263
  );
3263
- const D = { ...w.value };
3264
- delete D[v.ratio], w.value = D, R.value = {
3264
+ const $ = { ...w.value };
3265
+ delete $[v.ratio], w.value = $, R.value = {
3265
3266
  ...R.value,
3266
3267
  [v.ratio]: Date.now() + yi
3267
3268
  }, r.open({ message: i("menu.product_image.regenerate.queued"), type: "success" }), ne();
@@ -3272,8 +3273,8 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
3272
3273
  function ce(v) {
3273
3274
  if (n.coverOnly || !c.value) return;
3274
3275
  if (w.value[v]) {
3275
- const P = { ...c.value.imageSet };
3276
- delete P[v], c.value = { ...c.value, imageSet: P };
3276
+ const V = { ...c.value.imageSet };
3277
+ delete V[v], c.value = { ...c.value, imageSet: V };
3277
3278
  const q = { ...w.value };
3278
3279
  delete q[v], w.value = q;
3279
3280
  return;
@@ -3289,10 +3290,10 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
3289
3290
  }).onPrimary(async () => {
3290
3291
  try {
3291
3292
  c.value = await wr(n.itemId, S, v);
3292
- const P = { ...f.value };
3293
- delete P[v], f.value = P;
3294
- } catch (P) {
3295
- r.open({ message: `${P}`, type: "error" });
3293
+ const V = { ...f.value };
3294
+ delete V[v], f.value = V;
3295
+ } catch (V) {
3296
+ r.open({ message: `${V}`, type: "error" });
3296
3297
  }
3297
3298
  });
3298
3299
  }
@@ -3303,11 +3304,11 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
3303
3304
  c.value && !$e.isEqual(c.value, p.value) && o("update:image", c.value), u.value = !1;
3304
3305
  }
3305
3306
  return (v, S) => {
3306
- const P = M("fm-button"), q = M("fm-chip"), re = M("fm-switch"), D = M("fm-dialog"), O = M("fm-side-sheet"), K = Ht("tooltip");
3307
- return _(), Q(O, {
3307
+ const V = M("fm-button"), q = M("fm-chip"), re = M("fm-switch"), $ = M("fm-dialog"), D = M("fm-side-sheet"), K = Ht("tooltip");
3308
+ return _(), Q(D, {
3308
3309
  id: "manage-product-image",
3309
3310
  modelValue: u.value,
3310
- "onUpdate:modelValue": S[4] || (S[4] = (Z) => u.value = Z),
3311
+ "onUpdate:modelValue": S[4] || (S[4] = (X) => u.value = X),
3311
3312
  "close-button": "",
3312
3313
  "max-width": 860
3313
3314
  }, {
@@ -3316,18 +3317,18 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
3316
3317
  ]),
3317
3318
  "side-sheet-footer": F(() => [
3318
3319
  C("div", Du, [
3319
- h(P, {
3320
+ h(V, {
3320
3321
  disabled: v.disabled,
3321
3322
  label: m(i)("menu.common.actions.update"),
3322
3323
  size: "lg",
3323
3324
  variant: "primary",
3324
3325
  onClick: G
3325
3326
  }, null, 8, ["disabled", "label"]),
3326
- h(P, {
3327
+ h(V, {
3327
3328
  label: m(i)("menu.common.actions.cancel"),
3328
3329
  size: "lg",
3329
3330
  variant: "tertiary",
3330
- onClick: S[1] || (S[1] = (Z) => u.value = !1)
3331
+ onClick: S[1] || (S[1] = (X) => u.value = !1)
3331
3332
  }, null, 8, ["label"])
3332
3333
  ])
3333
3334
  ]),
@@ -3348,14 +3349,14 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
3348
3349
  C("p", fu, oe(m(i)("menu.product_image.manage.aspect_ratio")), 1),
3349
3350
  C("p", hu, oe(m(i)("menu.product_image.manage.aspect_ratio_hint")), 1)
3350
3351
  ]),
3351
- z.value.length ? (_(), Q(P, {
3352
+ z.value.length ? (_(), Q(V, {
3352
3353
  key: 0,
3353
3354
  disabled: d.value,
3354
3355
  label: m(i)("menu.product_image.manage.generate_all"),
3355
3356
  variant: m(ze).Secondary,
3356
3357
  onClick: ie
3357
3358
  }, null, 8, ["disabled", "label", "variant"])) : ee("", !0),
3358
- h(P, {
3359
+ h(V, {
3359
3360
  disabled: d.value,
3360
3361
  label: m(i)("menu.product_image.manage.add_format"),
3361
3362
  "prepend-icon": "add",
@@ -3368,7 +3369,7 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
3368
3369
  Xe((_(), W("button", {
3369
3370
  class: "block shrink-0 cursor-pointer overflow-hidden rounded-md",
3370
3371
  type: "button",
3371
- onClick: S[0] || (S[0] = (Z) => N(null))
3372
+ onClick: S[0] || (S[0] = (X) => N(null))
3372
3373
  }, [
3373
3374
  h(Gt, {
3374
3375
  alt: "Original",
@@ -3384,72 +3385,72 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
3384
3385
  C("p", yu, oe(m(i)("menu.product_image.manage.custom_sizing")), 1)
3385
3386
  ])
3386
3387
  ]),
3387
- (_(!0), W(ve, null, Ie(V.value, (Z) => (_(), W("div", {
3388
- key: Z.ratio,
3388
+ (_(!0), W(ve, null, Ie(O.value, (X) => (_(), W("div", {
3389
+ key: X.ratio,
3389
3390
  class: "flex items-center gap-16 py-12"
3390
3391
  }, [
3391
3392
  Xe((_(), W("button", {
3392
3393
  type: "button",
3393
- disabled: !Z.url,
3394
+ disabled: !X.url,
3394
3395
  class: "block shrink-0 cursor-pointer overflow-hidden rounded-md disabled:cursor-default disabled:opacity-40",
3395
- onClick: (le) => Z.url && N(Z.ratio)
3396
+ onClick: (le) => X.url && N(X.ratio)
3396
3397
  }, [
3397
3398
  h(Gt, {
3398
- alt: Z.label,
3399
+ alt: X.label,
3399
3400
  crossorigin: !1,
3400
3401
  size: { width: 80, height: 80 },
3401
- src: Z.url
3402
+ src: X.url
3402
3403
  }, null, 8, ["alt", "src"])
3403
3404
  ], 8, _u)), [
3404
3405
  [K, m(i)("menu.product_image.preview.title")]
3405
3406
  ]),
3406
3407
  C("div", wu, [
3407
3408
  C("div", ku, [
3408
- C("p", Cu, oe(Z.label), 1),
3409
- Z.required ? (_(), Q(q, {
3409
+ C("p", Cu, oe(X.label), 1),
3410
+ X.required ? (_(), Q(q, {
3410
3411
  key: 0,
3411
3412
  color: "negative",
3412
3413
  label: m(i)("menu.product_image.manage.required"),
3413
3414
  size: "sm"
3414
3415
  }, null, 8, ["label"])) : ee("", !0),
3415
- Z.status === "pending" ? (_(), Q(q, {
3416
+ X.status === "pending" ? (_(), Q(q, {
3416
3417
  key: 1,
3417
3418
  color: "warning",
3418
3419
  label: m(i)("menu.product_image.status.pending"),
3419
3420
  size: "sm"
3420
- }, null, 8, ["label"])) : Z.status === "failed" ? (_(), Q(q, {
3421
+ }, null, 8, ["label"])) : X.status === "failed" ? (_(), Q(q, {
3421
3422
  key: 2,
3422
3423
  color: "negative",
3423
3424
  label: m(i)("menu.product_image.status.failed"),
3424
3425
  size: "sm"
3425
3426
  }, null, 8, ["label"])) : ee("", !0)
3426
3427
  ]),
3427
- Z.purpose ? (_(), W("p", Su, oe(m(i)(`menu.product_image.purpose.${Z.purpose}`)), 1)) : ee("", !0),
3428
- !Z.required && !Z.url ? (_(), W("p", xu, oe(m(i)("menu.product_image.manage.custom_image_hint")), 1)) : ee("", !0)
3428
+ X.purpose ? (_(), W("p", Su, oe(m(i)(`menu.product_image.purpose.${X.purpose}`)), 1)) : ee("", !0),
3429
+ !X.required && !X.url ? (_(), W("p", xu, oe(m(i)("menu.product_image.manage.custom_image_hint")), 1)) : ee("", !0)
3429
3430
  ]),
3430
3431
  C("div", Au, [
3431
- Xe(h(P, {
3432
- disabled: d.value || y.value !== null || Z.status === "pending",
3432
+ Xe(h(V, {
3433
+ disabled: d.value || y.value !== null || X.status === "pending",
3433
3434
  icon: "image",
3434
3435
  variant: m(ze).Tertiary,
3435
- onClick: (le) => pe(Z)
3436
+ onClick: (le) => pe(X)
3436
3437
  }, null, 8, ["disabled", "variant", "onClick"]), [
3437
3438
  [K, m(i)("menu.product_image.replace.action")]
3438
3439
  ]),
3439
- Xe(h(P, {
3440
- disabled: d.value || y.value !== null || Z.status === "pending",
3440
+ Xe(h(V, {
3441
+ disabled: d.value || y.value !== null || X.status === "pending",
3441
3442
  icon: "autorenew",
3442
3443
  variant: m(ze).Tertiary,
3443
- onClick: (le) => te(Z)
3444
+ onClick: (le) => te(X)
3444
3445
  }, null, 8, ["disabled", "variant", "onClick"]), [
3445
3446
  [K, m(i)("menu.product_image.regenerate.action")]
3446
3447
  ]),
3447
- Z.removable ? (_(), Q(P, {
3448
+ X.removable ? (_(), Q(V, {
3448
3449
  key: 0,
3449
- disabled: d.value || y.value !== null || Z.status === "pending",
3450
+ disabled: d.value || y.value !== null || X.status === "pending",
3450
3451
  icon: "close",
3451
3452
  variant: m(ze).Tertiary,
3452
- onClick: (le) => ce(Z.ratio)
3453
+ onClick: (le) => ce(X.ratio)
3453
3454
  }, null, 8, ["disabled", "variant", "onClick"])) : ee("", !0)
3454
3455
  ])
3455
3456
  ]))), 128))
@@ -3470,20 +3471,20 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
3470
3471
  ])
3471
3472
  ])
3472
3473
  ])) : ee("", !0),
3473
- h(D, {
3474
+ h($, {
3474
3475
  modelValue: T.value,
3475
- "onUpdate:modelValue": S[2] || (S[2] = (Z) => T.value = Z),
3476
+ "onUpdate:modelValue": S[2] || (S[2] = (X) => T.value = X),
3476
3477
  "max-width": 560,
3477
- "onOn:clickedAway": S[3] || (S[3] = (Z) => T.value = !1)
3478
+ "onOn:clickedAway": S[3] || (S[3] = (X) => T.value = !1)
3478
3479
  }, {
3479
3480
  "dialog-header": F(() => [
3480
- C("p", $u, oe($.value), 1)
3481
+ C("p", $u, oe(P.value), 1)
3481
3482
  ]),
3482
3483
  default: F(() => [
3483
3484
  C("div", Pu, [
3484
3485
  U.value ? (_(), W("img", {
3485
3486
  key: 0,
3486
- alt: $.value,
3487
+ alt: P.value,
3487
3488
  src: U.value,
3488
3489
  class: "max-h-full max-w-full object-contain"
3489
3490
  }, null, 8, Vu)) : ee("", !0)
@@ -3604,7 +3605,7 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
3604
3605
  function U(G) {
3605
3606
  return f.value && p.value === G._id;
3606
3607
  }
3607
- function $(G) {
3608
+ function P(G) {
3608
3609
  return G._id === Jo;
3609
3610
  }
3610
3611
  const N = Gi.join(",");
@@ -3617,7 +3618,7 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
3617
3618
  type: "error"
3618
3619
  });
3619
3620
  }
3620
- async function V(G) {
3621
+ async function O(G) {
3621
3622
  const v = await Ta(G.url, {
3622
3623
  withTimestamp: !0,
3623
3624
  filename: "product-image"
@@ -3631,8 +3632,8 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
3631
3632
  if (!(n.disabled || n.coverOnly || R.value)) {
3632
3633
  R.value = !0;
3633
3634
  try {
3634
- const S = await v, P = _n(S);
3635
- if (P) throw new Error(i(`menu.product_image.error.${P}`));
3635
+ const S = await v, V = _n(S);
3636
+ if (V) throw new Error(i(`menu.product_image.error.${V}`));
3636
3637
  const q = await xr(S);
3637
3638
  b.value = G, Sa(y), g.activate({ imageData: q, command: "modifyImage" });
3638
3639
  } catch (S) {
@@ -3642,10 +3643,10 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
3642
3643
  }
3643
3644
  }
3644
3645
  }
3645
- function X(G) {
3646
+ function Z(G) {
3646
3647
  z(
3647
- $(G) ? { type: "legacy" } : { type: "image", imageId: G._id },
3648
- V(G)
3648
+ P(G) ? { type: "legacy" } : { type: "image", imageId: G._id },
3649
+ O(G)
3649
3650
  );
3650
3651
  }
3651
3652
  function ne(G) {
@@ -3659,15 +3660,15 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
3659
3660
  } catch {
3660
3661
  throw new Error(i("menu.product_image.error.unreadable"));
3661
3662
  }
3662
- const P = _n(S);
3663
- if (P) throw new Error(i(`menu.product_image.error.${P}`));
3663
+ const V = _n(S);
3664
+ if (V) throw new Error(i(`menu.product_image.error.${V}`));
3664
3665
  if (G.type === "staged") {
3665
- const K = I.value.find((Z) => Z._id === G.imageId);
3666
+ const K = I.value.find((X) => X._id === G.imageId);
3666
3667
  if (!K) return;
3667
3668
  URL.revokeObjectURL(K.previewUrl), o(
3668
3669
  "update:staged",
3669
3670
  I.value.map(
3670
- (Z) => Z._id === G.imageId ? { ...Z, file: S, previewUrl: URL.createObjectURL(S) } : Z
3671
+ (X) => X._id === G.imageId ? { ...X, file: S, previewUrl: URL.createObjectURL(S) } : X
3671
3672
  )
3672
3673
  );
3673
3674
  return;
@@ -3687,8 +3688,8 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
3687
3688
  }
3688
3689
  );
3689
3690
  if (!re) return;
3690
- const D = { ...re, isDefault: (q == null ? void 0 : q.isDefault) ?? !0 }, O = q ? A.value.map((K) => K._id === q._id ? D : K) : [D];
3691
- o("update:modelValue", O);
3691
+ const $ = { ...re, isDefault: (q == null ? void 0 : q.isDefault) ?? !0 }, D = q ? A.value.map((K) => K._id === q._id ? $ : K) : [$];
3692
+ o("update:modelValue", D);
3692
3693
  } catch (S) {
3693
3694
  k(S);
3694
3695
  }
@@ -3699,8 +3700,8 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
3699
3700
  });
3700
3701
  async function ie(G) {
3701
3702
  if (n.disabled || n.coverOnly || !G.length) return;
3702
- const v = G.filter((P) => {
3703
- const q = _n(P);
3703
+ const v = G.filter((V) => {
3704
+ const q = _n(V);
3704
3705
  return q && r.open({ message: i(`menu.product_image.error.${q}`), type: "error" }), !q;
3705
3706
  });
3706
3707
  if (!v.length) return;
@@ -3710,32 +3711,32 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
3710
3711
  r.open({ message: i("menu.product_image.error.no_item"), type: "error" });
3711
3712
  return;
3712
3713
  }
3713
- const P = [...I.value];
3714
- v.forEach((q) => P.push(Ar(q, S && !P.length))), o("update:staged", P);
3714
+ const V = [...I.value];
3715
+ v.forEach((q) => V.push(Ar(q, S && !V.length))), o("update:staged", V);
3715
3716
  return;
3716
3717
  }
3717
3718
  await l.minor(
3718
3719
  async () => {
3719
- let P = [...A.value];
3720
+ let V = [...A.value];
3720
3721
  const q = [];
3721
3722
  try {
3722
3723
  for (const re of v) {
3723
- const D = await ei(n.itemId, re, {
3724
+ const $ = await ei(n.itemId, re, {
3724
3725
  aspectRatios: ti(u.value),
3725
3726
  unreadableMessage: i("menu.product_image.error.unreadable")
3726
3727
  });
3727
- q.push({ itemId: n.itemId, imageId: D._id }), P = [...P, { ...D, isDefault: P.length === 0 }];
3728
+ q.push({ itemId: n.itemId, imageId: $._id }), V = [...V, { ...$, isDefault: V.length === 0 }];
3728
3729
  }
3729
3730
  } catch (re) {
3730
3731
  if (q.length)
3731
3732
  try {
3732
3733
  await Hi(q);
3733
- } catch (D) {
3734
- console.error("Failed to clean up partially uploaded product images", D);
3734
+ } catch ($) {
3735
+ console.error("Failed to clean up partially uploaded product images", $);
3735
3736
  }
3736
3737
  throw re;
3737
3738
  }
3738
- o("update:modelValue", P);
3739
+ o("update:modelValue", V);
3739
3740
  },
3740
3741
  {
3741
3742
  message: i("menu.product_image.uploading"),
@@ -3764,8 +3765,8 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
3764
3765
  }
3765
3766
  function pe(G) {
3766
3767
  me(async () => {
3767
- if ($(G)) {
3768
- const S = A.value.filter((P) => P._id !== G._id);
3768
+ if (P(G)) {
3769
+ const S = A.value.filter((V) => V._id !== G._id);
3769
3770
  o("update:modelValue", S);
3770
3771
  return;
3771
3772
  }
@@ -3781,20 +3782,20 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
3781
3782
  });
3782
3783
  }
3783
3784
  function ce(G) {
3784
- $(G) || (p.value = G._id, f.value = !0);
3785
+ P(G) || (p.value = G._id, f.value = !0);
3785
3786
  }
3786
3787
  function be(G) {
3787
3788
  let v = A.value.map((S) => S._id === G._id ? G : S);
3788
3789
  if (G.isDefault)
3789
3790
  v = Sr(v, G._id, !0);
3790
3791
  else if (!n.coverOnly && v.length && !v.some((S) => S.isDefault)) {
3791
- const S = v.find((P) => P._id !== G._id) ?? v[0];
3792
- v = v.map((P) => P._id === S._id ? { ...P, isDefault: !0 } : P);
3792
+ const S = v.find((V) => V._id !== G._id) ?? v[0];
3793
+ v = v.map((V) => V._id === S._id ? { ...V, isDefault: !0 } : V);
3793
3794
  }
3794
3795
  o("update:modelValue", v);
3795
3796
  }
3796
3797
  return (G, v) => {
3797
- const S = M("fm-icon"), P = M("fm-button"), q = M("fm-chip"), re = M("FmFormGroup"), D = Ht("tooltip");
3798
+ const S = M("fm-icon"), V = M("fm-button"), q = M("fm-chip"), re = M("FmFormGroup"), $ = Ht("tooltip");
3798
3799
  return _(), Q(re, {
3799
3800
  tag: "div",
3800
3801
  label: m(i)("menu.common.labels.product_image"),
@@ -3811,8 +3812,8 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
3811
3812
  c.value ? "border-fm-color-primary" : "border-fm-color-neutral-gray-300",
3812
3813
  G.disabled || G.coverOnly ? "opacity-50 cursor-not-allowed" : ""
3813
3814
  ]),
3814
- onDragleave: v[1] || (v[1] = ct((O) => c.value = !1, ["prevent"])),
3815
- onDragover: v[2] || (v[2] = ct((O) => c.value = !G.disabled && !G.coverOnly, ["prevent"])),
3815
+ onDragleave: v[1] || (v[1] = ct((D) => c.value = !1, ["prevent"])),
3816
+ onDragover: v[2] || (v[2] = ct((D) => c.value = !G.disabled && !G.coverOnly, ["prevent"])),
3816
3817
  onDrop: ct(Y, ["prevent"])
3817
3818
  }, [
3818
3819
  h(S, {
@@ -3821,11 +3822,11 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
3821
3822
  outline: ""
3822
3823
  }),
3823
3824
  C("p", Bu, oe(m(i)("menu.product_image.drop_hint")), 1),
3824
- h(P, {
3825
+ h(V, {
3825
3826
  disabled: G.disabled || G.coverOnly,
3826
3827
  label: m(i)("menu.product_image.add_file"),
3827
3828
  variant: "secondary",
3828
- onClick: v[0] || (v[0] = (O) => {
3829
+ onClick: v[0] || (v[0] = (D) => {
3829
3830
  var K;
3830
3831
  return (K = d.value) == null ? void 0 : K.click();
3831
3832
  })
@@ -3840,42 +3841,42 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
3840
3841
  onChange: se
3841
3842
  }, null, 40, Lu)
3842
3843
  ], 34),
3843
- (_(!0), W(ve, null, Ie(L.value, (O) => Xe((_(), W("div", {
3844
- key: O._id,
3844
+ (_(!0), W(ve, null, Ie(L.value, (D) => Xe((_(), W("div", {
3845
+ key: D._id,
3845
3846
  class: "product-image-tile relative aspect-square"
3846
3847
  }, [
3847
- $(O) ? (_(), W("div", ju, [
3848
+ P(D) ? (_(), W("div", ju, [
3848
3849
  h(Gt, {
3849
3850
  alt: m(i)("menu.common.labels.product_image"),
3850
3851
  "class-name": "w-full h-full",
3851
3852
  size: { width: 180, height: 180 },
3852
- src: O.url
3853
+ src: D.url
3853
3854
  }, null, 8, ["alt", "src"])
3854
3855
  ])) : (_(), W("button", {
3855
3856
  key: 1,
3856
3857
  class: Ve([
3857
3858
  "block w-full h-full rounded-md overflow-hidden",
3858
- U(O) ? "ring-2 ring-fm-color-primary" : ""
3859
+ U(D) ? "ring-2 ring-fm-color-primary" : ""
3859
3860
  ]),
3860
3861
  disabled: G.disabled,
3861
3862
  type: "button",
3862
- onClick: (K) => ce(O)
3863
+ onClick: (K) => ce(D)
3863
3864
  }, [
3864
3865
  h(Gt, {
3865
3866
  alt: m(i)("menu.common.labels.product_image"),
3866
3867
  "class-name": "w-full h-full",
3867
3868
  size: { width: 180, height: 180 },
3868
- src: O.url
3869
+ src: D.url
3869
3870
  }, null, 8, ["alt", "src"])
3870
3871
  ], 10, Wu)),
3871
3872
  C("div", Gu, [
3872
- O.isDefault ? (_(), Q(q, {
3873
+ D.isDefault ? (_(), Q(q, {
3873
3874
  key: 0,
3874
3875
  label: m(i)("menu.product_image.cover_badge")
3875
3876
  }, null, 8, ["label"])) : ee("", !0),
3876
- u.value && !$(O) ? (_(), Q(q, {
3877
+ u.value && !P(D) ? (_(), Q(q, {
3877
3878
  key: 1,
3878
- label: `${B(O)}`,
3879
+ label: `${B(D)}`,
3879
3880
  "right-icon": "resize"
3880
3881
  }, null, 8, ["label"])) : ee("", !0)
3881
3882
  ]),
@@ -3885,7 +3886,7 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
3885
3886
  title: m(i)("menu.remy.title"),
3886
3887
  class: "absolute bottom-8 right-8 rounded-full bg-fm-color-neutral-white w-32 h-32 flex items-center justify-center shadow-sm",
3887
3888
  type: "button",
3888
- onClick: ct((K) => X(O), ["stop"])
3889
+ onClick: ct((K) => Z(D), ["stop"])
3889
3890
  }, [
3890
3891
  h(S, {
3891
3892
  name: "auto_awesome",
@@ -3896,7 +3897,7 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
3896
3897
  key: 3,
3897
3898
  class: "absolute -top-8 -right-8 rounded-full bg-fm-color-neutral-black w-24 h-24 flex items-center justify-center",
3898
3899
  type: "button",
3899
- onClick: (K) => pe(O)
3900
+ onClick: (K) => pe(D)
3900
3901
  }, [
3901
3902
  h(S, {
3902
3903
  color: "neutral-white",
@@ -3906,12 +3907,12 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
3906
3907
  ], 8, Ku)) : ee("", !0)
3907
3908
  ])), [
3908
3909
  [
3909
- D,
3910
- u.value && $(O) ? m(Vt)(m(i)("menu.product_image.legacy_hint")) : void 0
3910
+ $,
3911
+ u.value && P(D) ? m(Vt)(m(i)("menu.product_image.legacy_hint")) : void 0
3911
3912
  ]
3912
3913
  ])), 128)),
3913
- (_(!0), W(ve, null, Ie(I.value, (O) => Xe((_(), W("div", {
3914
- key: O._id,
3914
+ (_(!0), W(ve, null, Ie(I.value, (D) => Xe((_(), W("div", {
3915
+ key: D._id,
3915
3916
  class: "product-image-tile relative aspect-square"
3916
3917
  }, [
3917
3918
  C("div", qu, [
@@ -3920,11 +3921,11 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
3920
3921
  "class-name": "w-full h-full",
3921
3922
  crossorigin: !1,
3922
3923
  size: { width: 180, height: 180 },
3923
- src: O.previewUrl
3924
+ src: D.previewUrl
3924
3925
  }, null, 8, ["alt", "src"])
3925
3926
  ]),
3926
3927
  C("div", Yu, [
3927
- O.isDefault ? (_(), Q(q, {
3928
+ D.isDefault ? (_(), Q(q, {
3928
3929
  key: 0,
3929
3930
  label: m(i)("menu.product_image.cover_badge")
3930
3931
  }, null, 8, ["label"])) : ee("", !0)
@@ -3935,7 +3936,7 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
3935
3936
  title: m(i)("menu.remy.title"),
3936
3937
  class: "absolute bottom-8 right-8 rounded-full bg-fm-color-neutral-white w-32 h-32 flex items-center justify-center shadow-sm",
3937
3938
  type: "button",
3938
- onClick: ct((K) => ne(O), ["stop"])
3939
+ onClick: ct((K) => ne(D), ["stop"])
3939
3940
  }, [
3940
3941
  h(S, {
3941
3942
  name: "auto_awesome",
@@ -3946,7 +3947,7 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
3946
3947
  key: 1,
3947
3948
  class: "absolute -top-8 -right-8 rounded-full bg-fm-color-neutral-black w-24 h-24 flex items-center justify-center",
3948
3949
  type: "button",
3949
- onClick: (K) => te(O)
3950
+ onClick: (K) => te(D)
3950
3951
  }, [
3951
3952
  h(S, {
3952
3953
  color: "neutral-white",
@@ -3955,12 +3956,12 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
3955
3956
  })
3956
3957
  ], 8, Zu)) : ee("", !0)
3957
3958
  ])), [
3958
- [D, m(Vt)(m(i)("menu.product_image.staged_hint"))]
3959
+ [$, m(Vt)(m(i)("menu.product_image.staged_hint"))]
3959
3960
  ])), 128))
3960
3961
  ]),
3961
3962
  h(Fu, {
3962
3963
  modelValue: f.value,
3963
- "onUpdate:modelValue": v[3] || (v[3] = (O) => f.value = O),
3964
+ "onUpdate:modelValue": v[3] || (v[3] = (D) => f.value = D),
3964
3965
  "can-clear-cover": G.coverOnly || A.value.length > 1,
3965
3966
  "cover-only": G.coverOnly,
3966
3967
  disabled: G.disabled,
@@ -4000,8 +4001,8 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
4000
4001
  setup(e, { emit: t }) {
4001
4002
  const n = e, o = t, { t: i } = ge(), a = H([]), r = H([]), l = H(""), s = H(""), u = H(""), d = H(""), c = H(!0), p = H(!1);
4002
4003
  function f() {
4003
- const x = n.productNameLocale || {}, U = n.productDescriptionLocale || {}, $ = /* @__PURE__ */ new Set([...Object.keys(x), ...Object.keys(U)]);
4004
- return $.size === 0 ? [] : Array.from($).map((N) => ({
4004
+ const x = n.productNameLocale || {}, U = n.productDescriptionLocale || {}, P = /* @__PURE__ */ new Set([...Object.keys(x), ...Object.keys(U)]);
4005
+ return P.size === 0 ? [] : Array.from(P).map((N) => ({
4005
4006
  localeCode: N,
4006
4007
  localeName: po(N),
4007
4008
  nameValue: x[N] || "",
@@ -4023,7 +4024,7 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
4023
4024
  );
4024
4025
  const g = E(() => a.value.map((x) => x.localeCode));
4025
4026
  function w(x) {
4026
- const U = new Set(g.value), $ = new Set(x);
4027
+ const U = new Set(g.value), P = new Set(x);
4027
4028
  for (const N of x)
4028
4029
  U.has(N) || a.value.push({
4029
4030
  localeCode: N,
@@ -4031,18 +4032,18 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
4031
4032
  nameValue: "",
4032
4033
  descriptionValue: ""
4033
4034
  });
4034
- a.value = a.value.filter((N) => $.has(N.localeCode));
4035
+ a.value = a.value.filter((N) => P.has(N.localeCode));
4035
4036
  }
4036
4037
  function y() {
4037
- const x = !$e.isEqual(a.value, r.value), U = l.value !== u.value, $ = s.value !== d.value;
4038
- return x || U || $;
4038
+ const x = !$e.isEqual(a.value, r.value), U = l.value !== u.value, P = s.value !== d.value;
4039
+ return x || U || P;
4039
4040
  }
4040
4041
  function b() {
4041
4042
  o("update:name", l.value.trim()), o("update:description", s.value.trim());
4042
4043
  const x = a.value.filter((B) => B.nameValue.trim()), U = x.length === 0 ? void 0 : x.reduce(
4043
4044
  (B, k) => (B[k.localeCode] = k.nameValue.trim(), B),
4044
4045
  {}
4045
- ), $ = a.value.filter((B) => B.descriptionValue.trim()), N = $.length === 0 ? void 0 : $.reduce(
4046
+ ), P = a.value.filter((B) => B.descriptionValue.trim()), N = P.length === 0 ? void 0 : P.reduce(
4046
4047
  (B, k) => (B[k.localeCode] = k.descriptionValue.trim(), B),
4047
4048
  {}
4048
4049
  );
@@ -4062,7 +4063,7 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
4062
4063
  p.value = !p.value;
4063
4064
  }
4064
4065
  return (x, U) => {
4065
- const $ = M("FmIcon"), N = M("fm-button"), B = M("fm-dialog");
4066
+ const P = M("FmIcon"), N = M("fm-button"), B = M("fm-dialog");
4066
4067
  return _(), Q(B, {
4067
4068
  modelValue: L.value,
4068
4069
  "onUpdate:modelValue": U[2] || (U[2] = (k) => L.value = k),
@@ -4100,7 +4101,7 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
4100
4101
  class: "flex items-center gap-16 cursor-pointer",
4101
4102
  onClick: I
4102
4103
  }, [
4103
- h($, {
4104
+ h(P, {
4104
4105
  name: c.value ? "keyboard_arrow_down" : "keyboard_arrow_right"
4105
4106
  }, null, 8, ["name"]),
4106
4107
  C("p", oc, oe(m(i)("menu.product.translation.product_name")), 1)
@@ -4121,7 +4122,7 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
4121
4122
  key: k.localeCode,
4122
4123
  "locale-code": k.localeCode,
4123
4124
  modelValue: k.nameValue,
4124
- "onUpdate:modelValue": (V) => k.nameValue = V,
4125
+ "onUpdate:modelValue": (O) => k.nameValue = O,
4125
4126
  placeholder: m(i)("menu.product.translation.placeholder")
4126
4127
  }, null, 8, ["locale-code", "modelValue", "onUpdate:modelValue", "placeholder"]))), 128))
4127
4128
  ])) : ee("", !0)
@@ -4132,7 +4133,7 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
4132
4133
  class: "flex items-center gap-16 cursor-pointer",
4133
4134
  onClick: T
4134
4135
  }, [
4135
- h($, {
4136
+ h(P, {
4136
4137
  name: p.value ? "keyboard_arrow_down" : "keyboard_arrow_right"
4137
4138
  }, null, 8, ["name"]),
4138
4139
  C("p", sc, [
@@ -4157,7 +4158,7 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
4157
4158
  key: k.localeCode,
4158
4159
  "locale-code": k.localeCode,
4159
4160
  modelValue: k.descriptionValue,
4160
- "onUpdate:modelValue": (V) => k.descriptionValue = V,
4161
+ "onUpdate:modelValue": (O) => k.descriptionValue = O,
4161
4162
  placeholder: m(i)("menu.product.translation.placeholder"),
4162
4163
  "input-type": "textarea"
4163
4164
  }, null, 8, ["locale-code", "modelValue", "onUpdate:modelValue", "placeholder"]))), 128))
@@ -7349,7 +7350,7 @@ const Mi = {
7349
7350
  await dp(o);
7350
7351
  }
7351
7352
  };
7352
- var Ui = { firebase: { storageBucket: "image.feedmedev.cc" } };
7353
+ var Ui = { firebase: { storageBucket: "image.feedme.cc" } };
7353
7354
  const hp = {
7354
7355
  class: "fm-typo-en-title-md-600"
7355
7356
  }, gp = {
@@ -7429,7 +7430,7 @@ const hp = {
7429
7430
  R.value || await l.update(j._id);
7430
7431
  }
7431
7432
  const U = E(() => r.version === At.enum.v4);
7432
- async function $(j) {
7433
+ async function P(j) {
7433
7434
  const ie = Ss(j, b.value.id);
7434
7435
  await l.updateMany(ie);
7435
7436
  }
@@ -7448,13 +7449,13 @@ const hp = {
7448
7449
  });
7449
7450
  }), j;
7450
7451
  });
7451
- function V(j) {
7452
+ function O(j) {
7452
7453
  f.value = j;
7453
7454
  }
7454
7455
  function z(j) {
7455
7456
  b.value.name = j;
7456
7457
  }
7457
- const X = Xt(() => {
7458
+ const Z = Xt(() => {
7458
7459
  if (R.value)
7459
7460
  return !!b.value.name || !!(f.value && Object.keys(f.value).length > 0);
7460
7461
  const j = r.categories.find((te) => te._id === b.value.id), ie = b.value.name !== (j == null ? void 0 : j.name), se = (j == null ? void 0 : j.name_locale) || {}, Y = f.value || {}, me = JSON.stringify(se) !== JSON.stringify(Y), pe = !!g.value || g.value === null && !!(j != null && j.thumbnail);
@@ -7531,7 +7532,7 @@ const hp = {
7531
7532
  blameFormChildOnValidationFailed: !0
7532
7533
  },
7533
7534
  "max-width": 560,
7534
- "onOn:clickedAway": m(X)
7535
+ "onOn:clickedAway": m(Z)
7535
7536
  }, {
7536
7537
  "side-sheet-header": F(() => [C("p", hp, oe(R.value ? m(u)("menu.category.manager.dialog.add.title") : m(u)("menu.category.title")), 1)]),
7537
7538
  "side-sheet-footer": F(() => [C("div", Cp, [y.value ? ee("", !0) : (_(), Q(se, {
@@ -7627,7 +7628,7 @@ const hp = {
7627
7628
  "shrink-at": !1,
7628
7629
  "hide-footer": "",
7629
7630
  "pin-header-row": "",
7630
- onDndChanged: $,
7631
+ onDndChanged: P,
7631
7632
  onRowClick: ie[5] || (ie[5] = (G) => x(G.original))
7632
7633
  }, null, 8, ["draggable", "page-size", "row-data", "search-value"])])]),
7633
7634
  _: 1
@@ -7640,7 +7641,7 @@ const hp = {
7640
7641
  name: b.value.name,
7641
7642
  "name-locale": f.value,
7642
7643
  "onUpdate:name": z,
7643
- "onUpdate:nameLocale": V
7644
+ "onUpdate:nameLocale": O
7644
7645
  }, null, 8, ["modelValue", "title", "name", "name-locale"])], 64);
7645
7646
  };
7646
7647
  }
@@ -7879,60 +7880,60 @@ const Lp = /* @__PURE__ */ fe({
7879
7880
  checkMenuIsLoading: d
7880
7881
  } = pt(st(Qe())), c = t, p = E(() => o.rules.item), f = E(() => !!o.state.currentCatalogId && !o.state.currentSchedulerId), g = E(() => {
7881
7882
  var K;
7882
- const D = n.form.images ?? ((K = n.fallback) == null ? void 0 : K.images), O = n.form.image;
7883
- return !D || !O || !D.some((Z) => Z._id === O) ? D : D.map((Z) => ({
7884
- ...Z,
7885
- isDefault: Z._id === O
7883
+ const $ = n.form.images ?? ((K = n.fallback) == null ? void 0 : K.images), D = n.form.image;
7884
+ return !$ || !D || !$.some((X) => X._id === D) ? $ : $.map((X) => ({
7885
+ ...X,
7886
+ isDefault: X._id === D
7886
7887
  }));
7887
7888
  });
7888
- function w(D) {
7889
- var O;
7890
- f.value ? c("update:form", "image", ((O = D.find((K) => K.isDefault)) == null ? void 0 : O._id) ?? null) : c("update:form", "images", D), c("update:form", "thumbnail", Rr({
7891
- images: D,
7889
+ function w($) {
7890
+ var D;
7891
+ f.value ? c("update:form", "image", ((D = $.find((K) => K.isDefault)) == null ? void 0 : D._id) ?? null) : c("update:form", "images", $), c("update:form", "thumbnail", Rr({
7892
+ images: $,
7892
7893
  thumbnail: n.form.thumbnail ?? null
7893
7894
  }));
7894
7895
  }
7895
7896
  const y = E(() => o.categorizedItems), b = E(() => {
7896
- const D = y.value.map((O) => ({
7897
- label: O.name,
7898
- value: O.id
7897
+ const $ = y.value.map((D) => ({
7898
+ label: D.name,
7899
+ value: D.id
7899
7900
  }));
7900
- return n.isAddon ? D : D.filter((O) => !!O.value);
7901
- }), R = E(() => p.value.addon), A = E(() => !b.value.find((D) => !!D.value)), L = E(() => Ft(n.form.category ? n.form : n.fallback) || []), I = E(() => L.value.reduce((D, O) => (D[O._id] = O, D), {})), T = E({
7901
+ return n.isAddon ? $ : $.filter((D) => !!D.value);
7902
+ }), R = E(() => p.value.addon), A = E(() => !b.value.find(($) => !!$.value)), L = E(() => Ft(n.form.category ? n.form : n.fallback) || []), I = E(() => L.value.reduce(($, D) => ($[D._id] = D, $), {})), T = E({
7902
7903
  get() {
7903
- return L.value.map((D) => D._id);
7904
+ return L.value.map(($) => $._id);
7904
7905
  },
7905
- set(D = []) {
7906
- const [O, ...K] = D.map((Z) => {
7907
- const le = I.value[Z];
7906
+ set($ = []) {
7907
+ const [D, ...K] = $.map((X) => {
7908
+ const le = I.value[X];
7908
7909
  return le || {
7909
- _id: Z,
7910
+ _id: X,
7910
7911
  position: null
7911
7912
  };
7912
7913
  });
7913
- if (!O) {
7914
+ if (!D) {
7914
7915
  c("update:form", "category", null), c("update:form", "additionalCategories", []);
7915
7916
  return;
7916
7917
  }
7917
- c("update:form", "category", O._id), c("update:form", "additionalCategories", K);
7918
+ c("update:form", "category", D._id), c("update:form", "additionalCategories", K);
7918
7919
  }
7919
7920
  }), x = H(), U = ({
7920
- multiple: D = !0
7921
+ multiple: $ = !0
7921
7922
  } = {}) => n.isAddon ? null : h(Ws, {
7922
7923
  ref: x,
7923
7924
  disabled: !p.value.category || n.isAddon || d(),
7924
7925
  items: b.value,
7925
7926
  modelValue: T.value,
7926
- "onUpdate:model-value": (O) => T.value = O,
7927
+ "onUpdate:model-value": (D) => T.value = D,
7927
7928
  placeholder: Y("menu.product.form.detail.category.placeholder"),
7928
- multiple: D
7929
+ multiple: $
7929
7930
  }, {
7930
7931
  "append-menu": () => h("button", {
7931
7932
  class: "flex items-center py-8 px-16 space-x-8",
7932
7933
  type: "button",
7933
7934
  onClick: () => {
7934
- var O;
7935
- (O = x.value) == null || O.hideMenu(), u.create();
7935
+ var D;
7936
+ (D = x.value) == null || D.hideMenu(), u.create();
7936
7937
  }
7937
7938
  }, [h(Ee.FmIcon, {
7938
7939
  color: "primary",
@@ -7945,90 +7946,90 @@ const Lp = /* @__PURE__ */ fe({
7945
7946
  Wt(async () => {
7946
7947
  !A.value && n.form.category === void 0 && n.isCreate && z($t.PRODUCT);
7947
7948
  });
7948
- const $ = E(() => {
7949
- var O;
7950
- const D = n.form.name || ((O = n.fallback) == null ? void 0 : O.name);
7951
- return D ? o.items.filter((K) => !!K.category && K._id !== n.form._id && K.name === D).length : 0;
7949
+ const P = E(() => {
7950
+ var D;
7951
+ const $ = n.form.name || ((D = n.fallback) == null ? void 0 : D.name);
7952
+ return $ ? o.items.filter((K) => !!K.category && K._id !== n.form._id && K.name === $).length : 0;
7952
7953
  }), N = E(() => {
7953
- var O;
7954
- const D = n.form.name2 || ((O = n.fallback) == null ? void 0 : O.name2);
7955
- return D ? o.items.filter((K) => !!K.category && K._id !== n.form._id && K.name2 === D).length : 0;
7954
+ var D;
7955
+ const $ = n.form.name2 || ((D = n.fallback) == null ? void 0 : D.name2);
7956
+ return $ ? o.items.filter((K) => !!K.category && K._id !== n.form._id && K.name2 === $).length : 0;
7956
7957
  }), B = E(() => o.state.featureFlags.uniqueProductCode), k = E(() => {
7957
- var Z, le, Ae;
7958
- const D = n.form.code || ((Z = n.fallback) == null ? void 0 : Z.code);
7959
- if (!D) return 0;
7960
- let O = o.itemCodeMap.get(D) || 0;
7958
+ var X, le, Ae;
7959
+ const $ = n.form.code || ((X = n.fallback) == null ? void 0 : X.code);
7960
+ if (!$) return 0;
7961
+ let D = o.itemCodeMap.get($) || 0;
7961
7962
  const K = o.items.find((xe) => xe._id === n.form._id);
7962
- return (K == null ? void 0 : K.code) === D && (O -= 1), (Ae = (le = K == null ? void 0 : K.variant) == null ? void 0 : le.variantCombinations) == null || Ae.forEach((xe) => {
7963
- xe.code === D && (O -= 1);
7964
- }), O;
7965
- }), V = E(() => n.isAddon ? $t.ADD_ON : $t.PRODUCT);
7966
- function z(D) {
7967
- var K, Z, le;
7968
- if (V.value === D) return;
7969
- const O = D == $t.ADD_ON;
7970
- c("update:form", "category", n.isOverride ? O ? "" : ((K = n.fallback) == null ? void 0 : K.category) ?? ((Z = b.value.find((Ae) => !!Ae.value)) == null ? void 0 : Z.value) : O ? null : (le = b.value.find((Ae) => !!Ae.value)) == null ? void 0 : le.value), O && (c("update:form", "additionalCategories", []), c("update:form", "subCategories", []));
7971
- }
7972
- const X = cn();
7973
- Nn("apply-description", (D) => {
7974
- c("update:form", "description", D || "");
7963
+ return (K == null ? void 0 : K.code) === $ && (D -= 1), (Ae = (le = K == null ? void 0 : K.variant) == null ? void 0 : le.variantCombinations) == null || Ae.forEach((xe) => {
7964
+ xe.code === $ && (D -= 1);
7965
+ }), D;
7966
+ }), O = E(() => n.isAddon ? $t.ADD_ON : $t.PRODUCT);
7967
+ function z($) {
7968
+ var K, X, le;
7969
+ if (O.value === $) return;
7970
+ const D = $ == $t.ADD_ON;
7971
+ c("update:form", "category", n.isOverride ? D ? "" : ((K = n.fallback) == null ? void 0 : K.category) ?? ((X = b.value.find((Ae) => !!Ae.value)) == null ? void 0 : X.value) : D ? null : (le = b.value.find((Ae) => !!Ae.value)) == null ? void 0 : le.value), D && (c("update:form", "additionalCategories", []), c("update:form", "subCategories", []));
7972
+ }
7973
+ const Z = cn();
7974
+ Nn("apply-description", ($) => {
7975
+ c("update:form", "description", $ || "");
7975
7976
  });
7976
7977
  async function ne() {
7977
7978
  if (!n.form.name) {
7978
- const D = document.getElementById("product-name");
7979
- if (D) {
7980
- D.focus();
7979
+ const $ = document.getElementById("product-name");
7980
+ if ($) {
7981
+ $.focus();
7981
7982
  return;
7982
7983
  } else
7983
7984
  return;
7984
7985
  }
7985
7986
  i.pushDataLayer({
7986
7987
  event: "menu_catalog_item_general_remy_suggest_description"
7987
- }), X.activate({
7988
+ }), Z.activate({
7988
7989
  prompt: `Suggest a menu description for ${n.form.name}`,
7989
7990
  command: "suggestDescription"
7990
7991
  });
7991
7992
  }
7992
- const j = E(() => o.subcategories), ie = E(() => j.value.map((D) => ({
7993
- label: D.name,
7994
- value: D._id
7993
+ const j = E(() => o.subcategories), ie = E(() => j.value.map(($) => ({
7994
+ label: $.name,
7995
+ value: $._id
7995
7996
  }))), se = E({
7996
7997
  get() {
7997
7998
  return n.form.subCategories || [];
7998
7999
  },
7999
- set(D) {
8000
- c("update:form", "subCategories", D);
8000
+ set($) {
8001
+ c("update:form", "subCategories", $);
8001
8002
  }
8002
8003
  }), {
8003
8004
  t: Y
8004
8005
  } = ge(), me = H(!1), pe = H("name"), te = E(() => {
8005
8006
  var le, Ae;
8006
- const D = [], O = "en-US", K = n.form.name_locale, Z = K == null ? void 0 : K[O];
8007
- return (n.form.name || (le = n.fallback) != null && le.name) && !Z && D.push({
8008
- locale: O,
8007
+ const $ = [], D = "en-US", K = n.form.name_locale, X = K == null ? void 0 : K[D];
8008
+ return (n.form.name || (le = n.fallback) != null && le.name) && !X && $.push({
8009
+ locale: D,
8009
8010
  name: n.form.name || ((Ae = n.fallback) == null ? void 0 : Ae.name) || "",
8010
- localeDisplay: Ct(O)
8011
+ localeDisplay: Ct(D)
8011
8012
  }), K && Object.entries(K).filter(([xe, je]) => je && je.trim()).sort(([xe], [je]) => xe.localeCompare(je)).forEach(([xe, je]) => {
8012
- D.push({
8013
+ $.push({
8013
8014
  locale: xe,
8014
8015
  name: je,
8015
8016
  localeDisplay: Ct(xe)
8016
8017
  });
8017
- }), D;
8018
+ }), $;
8018
8019
  }), ce = E(() => {
8019
8020
  var le, Ae;
8020
- const D = [], O = "en-US", K = n.form.description_locale, Z = K == null ? void 0 : K[O];
8021
- return (n.form.description || (le = n.fallback) != null && le.description) && !Z && D.push({
8022
- locale: O,
8021
+ const $ = [], D = "en-US", K = n.form.description_locale, X = K == null ? void 0 : K[D];
8022
+ return (n.form.description || (le = n.fallback) != null && le.description) && !X && $.push({
8023
+ locale: D,
8023
8024
  name: n.form.description || ((Ae = n.fallback) == null ? void 0 : Ae.description) || "",
8024
- localeDisplay: Ct(O)
8025
+ localeDisplay: Ct(D)
8025
8026
  }), K && Object.entries(K).filter(([xe, je]) => je && je.trim()).sort(([xe], [je]) => xe.localeCompare(je)).forEach(([xe, je]) => {
8026
- D.push({
8027
+ $.push({
8027
8028
  locale: xe,
8028
8029
  name: je,
8029
8030
  localeDisplay: Ct(xe)
8030
8031
  });
8031
- }), D;
8032
+ }), $;
8032
8033
  });
8033
8034
  function be() {
8034
8035
  pe.value = "name", me.value = !0;
@@ -8036,33 +8037,33 @@ const Lp = /* @__PURE__ */ fe({
8036
8037
  function G() {
8037
8038
  pe.value = "description", me.value = !0;
8038
8039
  }
8039
- function v(D) {
8040
- c("update:form", "name", D);
8040
+ function v($) {
8041
+ c("update:form", "name", $);
8041
8042
  }
8042
- function S(D) {
8043
- c("update:form", "description", D);
8043
+ function S($) {
8044
+ c("update:form", "description", $);
8044
8045
  }
8045
- function P(D) {
8046
- c("update:form", "name_locale", D);
8046
+ function V($) {
8047
+ c("update:form", "name_locale", $);
8047
8048
  }
8048
- function q(D) {
8049
- c("update:form", "description_locale", D);
8049
+ function q($) {
8050
+ c("update:form", "description_locale", $);
8050
8051
  }
8051
8052
  const re = E(() => {
8052
- var D;
8053
- return !!n.form.name || !!((D = n.fallback) != null && D.name);
8053
+ var $;
8054
+ return !!n.form.name || !!(($ = n.fallback) != null && $.name);
8054
8055
  });
8055
- return (D, O) => {
8056
+ return ($, D) => {
8056
8057
  var Rt, Je;
8057
- const K = M("fm-text-field"), Z = M("fm-button"), le = M("FmTooltip"), Ae = M("fm-textarea"), xe = M("fm-radio"), je = M("FmSnackbar"), ae = M("FmButton"), J = M("fm-radio-group"), ye = M("FmFormGroup"), ke = M("FmStepperField"), ue = Ht("tooltip");
8058
+ const K = M("fm-text-field"), X = M("fm-button"), le = M("FmTooltip"), Ae = M("fm-textarea"), xe = M("fm-radio"), je = M("FmSnackbar"), ae = M("FmButton"), J = M("fm-radio-group"), ye = M("FmFormGroup"), ke = M("FmStepperField"), ue = Ht("tooltip");
8058
8059
  return _(), W(ve, null, [h(Ke, {
8059
8060
  title: m(Y)("menu.product.form.detail.title")
8060
8061
  }, {
8061
8062
  default: F(() => {
8062
8063
  var It, Qt, Lt, Jt, Yo;
8063
8064
  return [C("div", Tp, [C("div", Rp, [C("div", Ip, [h(K, {
8064
- "model-value": D.form.code,
8065
- placeholder: ((It = D.fallback) == null ? void 0 : It.code) || m(Y)("menu.product.form.detail.fields.code.placeholder"),
8065
+ "model-value": $.form.code,
8066
+ placeholder: ((It = $.fallback) == null ? void 0 : It.code) || m(Y)("menu.product.form.detail.fields.code.placeholder"),
8066
8067
  "helper-text": !B.value && k.value > 0 ? m(Y)("menu.product.form.detail.fields.code.duplicate_hint", {
8067
8068
  count: k.value
8068
8069
  }) : void 0,
@@ -8070,20 +8071,20 @@ const Lp = /* @__PURE__ */ fe({
8070
8071
  rules: [(he) => !B.value || k.value === 0 || m(Y)("menu.product.form.detail.fields.code.duplicate_warning", {
8071
8072
  count: k.value
8072
8073
  })],
8073
- "onUpdate:modelValue": O[0] || (O[0] = (he) => c("update:form", "code", m(Ro)(he, D.isOverride)))
8074
+ "onUpdate:modelValue": D[0] || (D[0] = (he) => c("update:form", "code", m(Ro)(he, $.isOverride)))
8074
8075
  }, null, 8, ["model-value", "placeholder", "helper-text", "label", "rules"])]), C("div", Ep, [h(K, {
8075
8076
  id: "product-name",
8076
8077
  disabled: !p.value.name,
8077
- "helper-text": $.value > 0 ? m(Y)("menu.product.form.detail.fields.name.duplicate_warning", {
8078
- count: $.value
8078
+ "helper-text": P.value > 0 ? m(Y)("menu.product.form.detail.fields.name.duplicate_warning", {
8079
+ count: P.value
8079
8080
  }) : void 0,
8080
- "model-value": D.form.name,
8081
- placeholder: (Qt = D.fallback) == null ? void 0 : Qt.name,
8081
+ "model-value": $.form.name,
8082
+ placeholder: (Qt = $.fallback) == null ? void 0 : Qt.name,
8082
8083
  rules: p.value.name ? [(he) => !!he || m(Y)("menu.product.form.detail.fields.name.required")] : void 0,
8083
8084
  "label-mark": "required",
8084
8085
  autofocus: "",
8085
8086
  label: m(Y)("menu.product.form.detail.fields.name.label"),
8086
- "onUpdate:modelValue": O[1] || (O[1] = (he) => c("update:form", "name", he))
8087
+ "onUpdate:modelValue": D[1] || (D[1] = (he) => c("update:form", "name", he))
8087
8088
  }, {
8088
8089
  append: F(() => [h(le, {
8089
8090
  variant: "plain",
@@ -8093,7 +8094,7 @@ const Lp = /* @__PURE__ */ fe({
8093
8094
  content: F(() => [C("div", Op, [(_(!0), W(ve, null, Ie(te.value, (he) => (_(), W("div", {
8094
8095
  key: he.locale
8095
8096
  }, oe(he.name) + " (" + oe(he.localeDisplay) + ") ", 1))), 128))])]),
8096
- default: F(() => [h(Z, {
8097
+ default: F(() => [h(X, {
8097
8098
  variant: "tertiary",
8098
8099
  icon: "g_translate",
8099
8100
  onClick: be,
@@ -8108,15 +8109,15 @@ const Lp = /* @__PURE__ */ fe({
8108
8109
  "helper-text": N.value > 0 ? m(Y)("menu.product.form.detail.fields.name2.duplicate_warning", {
8109
8110
  count: N.value
8110
8111
  }) : void 0,
8111
- "model-value": D.form.name2,
8112
- placeholder: ((Lt = D.fallback) == null ? void 0 : Lt.name2) || m(Y)("menu.product.form.detail.fields.name2.placeholder"),
8112
+ "model-value": $.form.name2,
8113
+ placeholder: ((Lt = $.fallback) == null ? void 0 : Lt.name2) || m(Y)("menu.product.form.detail.fields.name2.placeholder"),
8113
8114
  label: m(Y)("menu.product.form.detail.fields.name2.label"),
8114
- "onUpdate:modelValue": O[2] || (O[2] = (he) => c("update:form", "name2", m(Ro)(he, D.isOverride)))
8115
+ "onUpdate:modelValue": D[2] || (D[2] = (he) => c("update:form", "name2", m(Ro)(he, $.isOverride)))
8115
8116
  }, null, 8, ["disabled", "helper-text", "model-value", "placeholder", "label"]), C("div", Dp, [h(Ae, {
8116
8117
  disabled: !p.value.description,
8117
- "model-value": D.form.description || void 0,
8118
- placeholder: ((Jt = D.fallback) == null ? void 0 : Jt.description) || m(Y)("menu.product.form.detail.fields.description.placeholder"),
8119
- "onUpdate:modelValue": O[3] || (O[3] = (he) => c("update:form", "description", he.trim())),
8118
+ "model-value": $.form.description || void 0,
8119
+ placeholder: ((Jt = $.fallback) == null ? void 0 : Jt.description) || m(Y)("menu.product.form.detail.fields.description.placeholder"),
8120
+ "onUpdate:modelValue": D[3] || (D[3] = (he) => c("update:form", "description", he.trim())),
8120
8121
  class: "description"
8121
8122
  }, {
8122
8123
  label: F(() => [C("p", $p, [Sn(oe(m(Y)("menu.product.form.detail.fields.description.label")) + " ", 1), C("span", Pp, oe(m(Y)("menu.product.form.detail.fields.description.optional")), 1)])]),
@@ -8131,11 +8132,11 @@ const Lp = /* @__PURE__ */ fe({
8131
8132
  }, oe(he.name) + " (" + oe(he.localeDisplay) + ") ", 1))), 128))])]),
8132
8133
  default: F(() => {
8133
8134
  var he;
8134
- return [Xe(h(Z, {
8135
+ return [Xe(h(X, {
8135
8136
  variant: "tertiary",
8136
8137
  icon: "g_translate",
8137
8138
  class: "cursor-pointer",
8138
- disabled: !(D.form.description || (he = D.fallback) != null && he.description) || !p.value.description,
8139
+ disabled: !($.form.description || (he = $.fallback) != null && he.description) || !p.value.description,
8139
8140
  onClick: G
8140
8141
  }, null, 8, ["disabled"]), [[ue, m(Vt)("Translate description")]])];
8141
8142
  }),
@@ -8146,21 +8147,21 @@ const Lp = /* @__PURE__ */ fe({
8146
8147
  }, null, 512), [[ue, m(Vt)("Suggest description")]])])]), h(Ju, {
8147
8148
  "cover-only": f.value,
8148
8149
  disabled: !p.value.images && !f.value,
8149
- "item-id": D.form._id || "",
8150
- "legacy-thumbnail": D.form.thumbnail ?? ((Yo = D.fallback) == null ? void 0 : Yo.thumbnail) ?? null,
8150
+ "item-id": $.form._id || "",
8151
+ "legacy-thumbnail": $.form.thumbnail ?? ((Yo = $.fallback) == null ? void 0 : Yo.thumbnail) ?? null,
8151
8152
  "menu-items": m(o).state.menu.modules.item,
8152
8153
  "model-value": g.value,
8153
- staged: D.staged,
8154
+ staged: $.staged,
8154
8155
  "onUpdate:modelValue": w,
8155
- "onUpdate:staged": O[4] || (O[4] = (he) => c("update:staged", he))
8156
+ "onUpdate:staged": D[4] || (D[4] = (he) => c("update:staged", he))
8156
8157
  }, null, 8, ["cover-only", "disabled", "item-id", "legacy-thumbnail", "menu-items", "model-value", "staged"])]), h(yt, {
8157
8158
  label: m(o).isV4 ? m(Y)("menu.product.form.detail.category.label") : m(Y)("menu.product.form.detail.category.label_singular")
8158
8159
  }, {
8159
8160
  default: F(() => [R.value ? (_(), Q(J, {
8160
8161
  key: 0,
8161
8162
  disabled: !p.value.category,
8162
- "model-value": V.value,
8163
- "onUpdate:modelValue": O[5] || (O[5] = (he) => z(he))
8163
+ "model-value": O.value,
8164
+ "onUpdate:modelValue": D[5] || (D[5] = (he) => z(he))
8164
8165
  }, {
8165
8166
  default: F(() => [C("div", Mp, [C("div", Up, [h(xe, {
8166
8167
  disabled: A.value || !p.value.category,
@@ -8188,9 +8189,9 @@ const Lp = /* @__PURE__ */ fe({
8188
8189
  _: 1
8189
8190
  }, 8, ["disabled", "model-value"])) : ee("", !0), m(o).isV4 ? ee("", !0) : (_(), Q(ye, {
8190
8191
  key: 1,
8191
- "model-value": D.form.category,
8192
- rules: [(he) => !he && !D.isOverride ? "Category is required" : !0],
8193
- "onUpdate:modelValue": O[6] || (O[6] = (he) => c("update:form", "category", he))
8192
+ "model-value": $.form.category,
8193
+ rules: [(he) => !he && !$.isOverride ? "Category is required" : !0],
8194
+ "onUpdate:modelValue": D[6] || (D[6] = (he) => c("update:form", "category", he))
8194
8195
  }, {
8195
8196
  default: F(() => [h(U, {
8196
8197
  multiple: !1
@@ -8198,53 +8199,53 @@ const Lp = /* @__PURE__ */ fe({
8198
8199
  _: 1
8199
8200
  }, 8, ["model-value", "rules"]))]),
8200
8201
  _: 1
8201
- }, 8, ["label"]), m(o).isV4 && !D.isAddon ? (_(), Q(yt, {
8202
+ }, 8, ["label"]), m(o).isV4 && !$.isAddon ? (_(), Q(yt, {
8202
8203
  key: 0,
8203
8204
  label: m(Y)("menu.product.form.detail.path.label")
8204
8205
  }, {
8205
8206
  default: F(() => [C("div", Np, [h(ll, {
8206
8207
  modelValue: se.value,
8207
- "onUpdate:modelValue": O[7] || (O[7] = (he) => se.value = he),
8208
+ "onUpdate:modelValue": D[7] || (D[7] = (he) => se.value = he),
8208
8209
  items: ie.value,
8209
8210
  placeholder: m(Y)("menu.product.form.detail.path.placeholder"),
8210
8211
  disabled: !p.value.category,
8211
8212
  "is-local-only": !1
8212
8213
  }, null, 8, ["modelValue", "items", "placeholder", "disabled"])])]),
8213
8214
  _: 1
8214
- }, 8, ["label"])) : ee("", !0), m(o).isV4 && !D.isOverride ? (_(), W("div", Bp, [h(ke, {
8215
+ }, 8, ["label"])) : ee("", !0), m(o).isV4 && !$.isOverride ? (_(), W("div", Bp, [h(ke, {
8215
8216
  label: m(Y)("menu.product.form.detail.fields.shelf_life.label"),
8216
- "model-value": D.form.shelfLife ?? null,
8217
+ "model-value": $.form.shelfLife ?? null,
8217
8218
  rules: [(he) => he == null || he > 0 || m(Y)("menu.common.validation.min_value", {
8218
8219
  value: 1
8219
8220
  })],
8220
- "onUpdate:modelValue": O[8] || (O[8] = (he) => {
8221
+ "onUpdate:modelValue": D[8] || (D[8] = (he) => {
8221
8222
  (he == null || he > 0) && c("update:form", "shelfLife", he);
8222
8223
  })
8223
8224
  }, null, 8, ["label", "model-value", "rules"]), h(nl, {
8224
- form: D.form,
8225
- "onUpdate:orderQuantity": O[9] || (O[9] = (he) => c("update:form", "orderQuantity", he))
8225
+ form: $.form,
8226
+ "onUpdate:orderQuantity": D[9] || (D[9] = (he) => c("update:form", "orderQuantity", he))
8226
8227
  }, null, 8, ["form"])])) : ee("", !0), h($o, {
8227
8228
  disabled: !p.value.orderFrom,
8228
- "model-value": D.form.orderFrom,
8229
+ "model-value": $.form.orderFrom,
8229
8230
  "order-from-none": p.value.orderFromNone,
8230
8231
  required: p.value.orderFrom,
8231
8232
  "default-label": m(Y)("menu.product.form.detail.order_from.default"),
8232
8233
  label: m(Y)("menu.product.form.detail.order_from.label"),
8233
- "onUpdate:modelValue": O[10] || (O[10] = (he) => he && c("update:form", "orderFrom", he))
8234
+ "onUpdate:modelValue": D[10] || (D[10] = (he) => he && c("update:form", "orderFrom", he))
8234
8235
  }, null, 8, ["disabled", "model-value", "order-from-none", "required", "default-label", "label"])];
8235
8236
  }),
8236
8237
  _: 1
8237
8238
  }, 8, ["title"]), h(mc, {
8238
8239
  modelValue: me.value,
8239
- "onUpdate:modelValue": O[11] || (O[11] = (It) => me.value = It),
8240
- "product-name": D.form.name || ((Rt = D.fallback) == null ? void 0 : Rt.name) || "",
8241
- "product-name-locale": D.form.name_locale,
8242
- "product-description": D.form.description || ((Je = D.fallback) == null ? void 0 : Je.description),
8243
- "product-description-locale": D.form.description_locale,
8240
+ "onUpdate:modelValue": D[11] || (D[11] = (It) => me.value = It),
8241
+ "product-name": $.form.name || ((Rt = $.fallback) == null ? void 0 : Rt.name) || "",
8242
+ "product-name-locale": $.form.name_locale,
8243
+ "product-description": $.form.description || ((Je = $.fallback) == null ? void 0 : Je.description),
8244
+ "product-description-locale": $.form.description_locale,
8244
8245
  "initial-section": pe.value,
8245
8246
  "onUpdate:name": v,
8246
8247
  "onUpdate:description": S,
8247
- "onUpdate:nameLocale": P,
8248
+ "onUpdate:nameLocale": V,
8248
8249
  "onUpdate:descriptionLocale": q
8249
8250
  }, null, 8, ["modelValue", "product-name", "product-name-locale", "product-description", "product-description-locale", "initial-section"])], 64);
8250
8251
  };
@@ -8347,12 +8348,12 @@ const Qp = /* @__PURE__ */ Tt(Yp, [["render", Zp]]), Jp = { class: "fm-typo-en-t
8347
8348
  }), T.size === 0 && n.group.name_locale && Object.keys(n.group.name_locale).forEach((N) => T.add(N));
8348
8349
  const x = Array.from(T);
8349
8350
  l.value = x;
8350
- const U = {}, $ = {};
8351
+ const U = {}, P = {};
8351
8352
  Object.values(n.group.items).forEach((N) => {
8352
8353
  U[N._id] = {}, N.name_locale && Object.entries(N.name_locale).forEach(([B, k]) => {
8353
8354
  U[N._id][B] = k;
8354
- }), $[N._id] = N.name || N.fallbackName || "";
8355
- }), u.value = U, c.value = $;
8355
+ }), P[N._id] = N.name || N.fallbackName || "";
8356
+ }), u.value = U, c.value = P;
8356
8357
  }
8357
8358
  Se(
8358
8359
  () => [n.modelValue, n.group],
@@ -8363,13 +8364,13 @@ const Qp = /* @__PURE__ */ Tt(Yp, [["render", Zp]]), Jp = { class: "fm-typo-en-t
8363
8364
  );
8364
8365
  function y(T) {
8365
8366
  const x = new Set(l.value), U = new Set(T);
8366
- for (const $ of T)
8367
- x.has($) || Object.keys(u.value).forEach((N) => {
8368
- u.value[N][$] || (u.value[N][$] = "");
8367
+ for (const P of T)
8368
+ x.has(P) || Object.keys(u.value).forEach((N) => {
8369
+ u.value[N][P] || (u.value[N][P] = "");
8369
8370
  });
8370
- for (const $ of x)
8371
- U.has($) || Object.keys(u.value).forEach((N) => {
8372
- delete u.value[N][$];
8371
+ for (const P of x)
8372
+ U.has(P) || Object.keys(u.value).forEach((N) => {
8373
+ delete u.value[N][P];
8373
8374
  });
8374
8375
  l.value = T;
8375
8376
  }
@@ -8381,10 +8382,10 @@ const Qp = /* @__PURE__ */ Tt(Yp, [["render", Zp]]), Jp = { class: "fm-typo-en-t
8381
8382
  Object.keys(T.items).forEach((x) => {
8382
8383
  const U = c.value[x];
8383
8384
  U !== void 0 && (T.items[x].name = U || null);
8384
- const $ = u.value[x];
8385
- if ($ && Object.keys($).length > 0) {
8385
+ const P = u.value[x];
8386
+ if (P && Object.keys(P).length > 0) {
8386
8387
  const N = {};
8387
- Object.entries($).forEach(([B, k]) => {
8388
+ Object.entries(P).forEach(([B, k]) => {
8388
8389
  k && k.trim() && (N[B] = k.trim());
8389
8390
  }), Object.keys(N).length > 0 ? T.items[x].name_locale = N : delete T.items[x].name_locale;
8390
8391
  } else
@@ -8399,7 +8400,7 @@ const Qp = /* @__PURE__ */ Tt(Yp, [["render", Zp]]), Jp = { class: "fm-typo-en-t
8399
8400
  set: (T) => o("update:modelValue", T)
8400
8401
  });
8401
8402
  return (T, x) => {
8402
- const U = M("FmIcon"), $ = M("fm-button"), N = M("fm-side-sheet");
8403
+ const U = M("FmIcon"), P = M("fm-button"), N = M("fm-side-sheet");
8403
8404
  return _(), Q(N, {
8404
8405
  modelValue: I.value,
8405
8406
  "onUpdate:modelValue": x[2] || (x[2] = (B) => I.value = B),
@@ -8411,13 +8412,13 @@ const Qp = /* @__PURE__ */ Tt(Yp, [["render", Zp]]), Jp = { class: "fm-typo-en-t
8411
8412
  ]),
8412
8413
  "side-sheet-footer": F(() => [
8413
8414
  C("div", mf, [
8414
- h($, {
8415
+ h(P, {
8415
8416
  label: m(i)("common.save"),
8416
8417
  size: "lg",
8417
8418
  variant: "primary",
8418
8419
  onClick: R
8419
8420
  }, null, 8, ["label"]),
8420
- h($, {
8421
+ h(P, {
8421
8422
  label: m(i)("common.cancel"),
8422
8423
  size: "lg",
8423
8424
  variant: "tertiary",
@@ -8496,7 +8497,7 @@ const Qp = /* @__PURE__ */ Tt(Yp, [["render", Zp]]), Jp = { class: "fm-typo-en-t
8496
8497
  key: k,
8497
8498
  "locale-code": k,
8498
8499
  modelValue: u.value[B._id][k],
8499
- "onUpdate:modelValue": (V) => u.value[B._id][k] = V,
8500
+ "onUpdate:modelValue": (O) => u.value[B._id][k] = O,
8500
8501
  placeholder: B.name || B.fallbackName || ""
8501
8502
  }, null, 8, ["locale-code", "modelValue", "onUpdate:modelValue", "placeholder"]))), 128))
8502
8503
  ])) : ee("", !0)
@@ -8529,27 +8530,27 @@ const Qp = /* @__PURE__ */ Tt(Yp, [["render", Zp]]), Jp = { class: "fm-typo-en-t
8529
8530
  value: T.combinationKey || ""
8530
8531
  }))
8531
8532
  ), p = E(() => {
8532
- var k, V;
8533
+ var k, O;
8533
8534
  if (!b.value) return null;
8534
- const T = ((V = (k = s.value[d.value]) == null ? void 0 : k.groups) == null ? void 0 : V.find((z) => z._id === o.groupId)) || {
8535
+ const T = ((O = (k = s.value[d.value]) == null ? void 0 : k.groups) == null ? void 0 : O.find((z) => z._id === o.groupId)) || {
8535
8536
  _id: o.groupId,
8536
8537
  groupKey: ""
8537
- }, U = a.state.menu.modules.group.find((z) => z._id === o.groupId), $ = Object.entries({ ...T, items: void 0 }).filter(([, z]) => !!z), N = {
8538
+ }, U = a.state.menu.modules.group.find((z) => z._id === o.groupId), P = Object.entries({ ...T, items: void 0 }).filter(([, z]) => !!z), N = {
8538
8539
  ...U,
8539
- ...Object.fromEntries($),
8540
+ ...Object.fromEntries(P),
8540
8541
  items: U.items.map((z) => {
8541
8542
  var ne;
8542
- const X = (ne = T.items) == null ? void 0 : ne.find(
8543
+ const Z = (ne = T.items) == null ? void 0 : ne.find(
8543
8544
  (j) => j._id == z._id && j.combinationKey == z.combinationKey
8544
8545
  );
8545
8546
  return {
8546
8547
  ...z,
8547
- ...X ?? {},
8548
- price: (X == null ? void 0 : X.price) || null,
8549
- price_variant: (X == null ? void 0 : X.price_variant) || null,
8550
- priceTiers: (X == null ? void 0 : X.priceTiers) || null,
8551
- priceTiers_variant: (X == null ? void 0 : X.priceTiers_variant) || null,
8552
- inventoryBindings: (X == null ? void 0 : X.inventoryBindings) || null
8548
+ ...Z ?? {},
8549
+ price: (Z == null ? void 0 : Z.price) || null,
8550
+ price_variant: (Z == null ? void 0 : Z.price_variant) || null,
8551
+ priceTiers: (Z == null ? void 0 : Z.priceTiers) || null,
8552
+ priceTiers_variant: (Z == null ? void 0 : Z.priceTiers_variant) || null,
8553
+ inventoryBindings: (Z == null ? void 0 : Z.inventoryBindings) || null
8553
8554
  };
8554
8555
  })
8555
8556
  };
@@ -8562,11 +8563,11 @@ const Qp = /* @__PURE__ */ Tt(Yp, [["render", Zp]]), Jp = { class: "fm-typo-en-t
8562
8563
  var N, B;
8563
8564
  const x = (N = s.value[d.value].groups) == null ? void 0 : N.findIndex(
8564
8565
  (k) => k._id === o.groupId
8565
- ), U = Ce(s.value), $ = { ...On(T), _id: o.groupId, groupKey: "" };
8566
+ ), U = Ce(s.value), P = { ...On(T), _id: o.groupId, groupKey: "" };
8566
8567
  (x ?? -1) < 0 ? U[d.value] = {
8567
8568
  ...U[d.value],
8568
- groups: [...((B = U[d.value]) == null ? void 0 : B.groups) || [], $]
8569
- } : U[d.value].groups[x] = $, s.value = U;
8569
+ groups: [...((B = U[d.value]) == null ? void 0 : B.groups) || [], P]
8570
+ } : U[d.value].groups[x] = P, s.value = U;
8570
8571
  }
8571
8572
  function g(T) {
8572
8573
  const x = c.value.length;
@@ -8597,8 +8598,8 @@ const Qp = /* @__PURE__ */ Tt(Yp, [["render", Zp]]), Jp = { class: "fm-typo-en-t
8597
8598
  var U;
8598
8599
  return {
8599
8600
  ...x,
8600
- groups: (U = x.groups) == null ? void 0 : U.map(($) => ({
8601
- ...as($, w())
8601
+ groups: (U = x.groups) == null ? void 0 : U.map((P) => ({
8602
+ ...as(P, w())
8602
8603
  }))
8603
8604
  };
8604
8605
  });
@@ -8618,7 +8619,7 @@ const Qp = /* @__PURE__ */ Tt(Yp, [["render", Zp]]), Jp = { class: "fm-typo-en-t
8618
8619
  });
8619
8620
  const { t: A } = ge();
8620
8621
  return (T, x) => {
8621
- const U = M("fm-select"), $ = M("fm-button"), N = M("fm-card");
8622
+ const U = M("fm-select"), P = M("fm-button"), N = M("fm-card");
8622
8623
  return _(), Q(or, {
8623
8624
  ref_key: "baseFormRef",
8624
8625
  ref: R,
@@ -8651,13 +8652,13 @@ const Qp = /* @__PURE__ */ Tt(Yp, [["render", Zp]]), Jp = { class: "fm-typo-en-t
8651
8652
  class: "flex-1"
8652
8653
  }, null, 8, ["modelValue", "items"]),
8653
8654
  C("div", gf, [
8654
- h($, {
8655
+ h(P, {
8655
8656
  variant: m(ze).Tertiary,
8656
8657
  "prepend-icon": "keyboard_arrow_left",
8657
8658
  size: "lg",
8658
8659
  onClick: x[1] || (x[1] = (B) => g("left"))
8659
8660
  }, null, 8, ["variant"]),
8660
- h($, {
8661
+ h(P, {
8661
8662
  variant: m(ze).Tertiary,
8662
8663
  "prepend-icon": "keyboard_arrow_right",
8663
8664
  size: "lg",
@@ -9429,7 +9430,7 @@ const ih = /* @__PURE__ */ fe({
9429
9430
  searchKey: f,
9430
9431
  filter: g
9431
9432
  } = Zr(), w = E(() => {
9432
- const v = Object.entries(n.group.items).filter(([, S]) => g([S.code || "", S.name || S.fallbackName, R(S.price ?? S.fallbackPrice), A(S.orderFrom || S.fallbackOrder), ...(S.items || []).map((P) => [P.code || "", P.name || P.fallbackName, R(P.price ?? P.fallbackPrice), A(P.orderFrom || P.fallbackOrder)].join(""))]));
9433
+ const v = Object.entries(n.group.items).filter(([, S]) => g([S.code || "", S.name || S.fallbackName, R(S.price ?? S.fallbackPrice), A(S.orderFrom || S.fallbackOrder), ...(S.items || []).map((V) => [V.code || "", V.name || V.fallbackName, R(V.price ?? V.fallbackPrice), A(V.orderFrom || V.fallbackOrder)].join(""))]));
9433
9434
  return Object.fromEntries(v);
9434
9435
  }), y = (v) => ({
9435
9436
  ...n.config,
@@ -9448,22 +9449,22 @@ const ih = /* @__PURE__ */ fe({
9448
9449
  enableSorting: !1,
9449
9450
  size: 35,
9450
9451
  cell: (v) => {
9451
- var D, O;
9452
- if ((O = (D = v.row.original) == null ? void 0 : D.items) != null && O.length)
9452
+ var $, D;
9453
+ if ((D = ($ = v.row.original) == null ? void 0 : $.items) != null && D.length)
9453
9454
  return null;
9454
- const S = v.row.depth > 0, P = v.row.original, q = !y(P.combinationKey).isDefault || P.orderFrom === Pe.enum.NONE, re = !!v.getValue();
9455
+ const S = v.row.depth > 0, V = v.row.original, q = !y(V.combinationKey).isDefault || V.orderFrom === Pe.enum.NONE, re = !!v.getValue();
9455
9456
  return h(Ee.FmCheckbox, {
9456
9457
  value: "default",
9457
9458
  modelValue: re,
9458
9459
  disabled: q,
9459
9460
  "onUpdate:modelValue": (K) => {
9460
- var Z;
9461
+ var X;
9461
9462
  if (S) {
9462
- const le = (Z = v.row.getParentRow()) == null ? void 0 : Z.original;
9463
+ const le = (X = v.row.getParentRow()) == null ? void 0 : X.original;
9463
9464
  if (!le) return;
9464
- k(le._id, P.combinationKey ?? "", "isDefault", K);
9465
+ k(le._id, V.combinationKey ?? "", "isDefault", K);
9465
9466
  } else
9466
- B(P._id, "isDefault", K);
9467
+ B(V._id, "isDefault", K);
9467
9468
  }
9468
9469
  }, null);
9469
9470
  }
@@ -9499,31 +9500,31 @@ const ih = /* @__PURE__ */ fe({
9499
9500
  })]),
9500
9501
  enableSorting: !1,
9501
9502
  cell: (v) => {
9502
- var O;
9503
- const S = v.getValue(), P = v.row.original, q = !y(P.combinationKey).name || P.orderFrom === Pe.enum.NONE, re = v.row.depth > 0, D = P.combinationKey ? co(P.combinationKey, De().variants) : a.rules.group.linkAddonName ? (O = ne.value[P._id]) == null ? void 0 : O.name : null;
9503
+ var D;
9504
+ const S = v.getValue(), V = v.row.original, q = !y(V.combinationKey).name || V.orderFrom === Pe.enum.NONE, re = v.row.depth > 0, $ = V.combinationKey ? co(V.combinationKey, De().variants) : a.rules.group.linkAddonName ? (D = ne.value[V._id]) == null ? void 0 : D.name : null;
9504
9505
  return Ue("div", Ue(Ee.FmTextField, {
9505
9506
  modelValue: S,
9506
- placeholder: D ?? "",
9507
+ placeholder: $ ?? "",
9507
9508
  disabled: q,
9508
- rules: D ? void 0 : [(K) => ((K == null ? void 0 : K.length) ?? 0) > 0 || T("menu.group.option.product_title_required")],
9509
+ rules: $ ? void 0 : [(K) => ((K == null ? void 0 : K.length) ?? 0) > 0 || T("menu.group.option.product_title_required")],
9509
9510
  "onUpdate:modelValue": (K) => {
9510
- var Z;
9511
+ var X;
9511
9512
  if (re) {
9512
- const le = (Z = v.row.getParentRow()) == null ? void 0 : Z.original;
9513
+ const le = (X = v.row.getParentRow()) == null ? void 0 : X.original;
9513
9514
  if (!le) return;
9514
- k(le._id, P.combinationKey ?? "", "name", K || null);
9515
+ k(le._id, V.combinationKey ?? "", "name", K || null);
9515
9516
  } else
9516
- B(P._id, "name", K || null);
9517
+ B(V._id, "name", K || null);
9517
9518
  },
9518
9519
  class: "min-w-[300px]"
9519
9520
  }, {
9520
9521
  append: () => {
9521
- var K, Z;
9522
- return (Z = (K = v.row.original) == null ? void 0 : K.items) != null && Z.length ? Ue(Ee.FmIcon, {
9522
+ var K, X;
9523
+ return (X = (K = v.row.original) == null ? void 0 : K.items) != null && X.length ? Ue(Ee.FmIcon, {
9523
9524
  name: "keyboard_arrow_up",
9524
9525
  onClick: v.row.getToggleExpandedHandler(),
9525
9526
  class: ["cursor-pointer", "transition-transform", v.row.getIsExpanded() ? "transform rotate-180" : ""],
9526
- color: y(P.combinationKey).name ? void 0 : nt.NeutralGray200
9527
+ color: y(V.combinationKey).name ? void 0 : nt.NeutralGray200
9527
9528
  }) : void 0;
9528
9529
  }
9529
9530
  }));
@@ -9539,7 +9540,7 @@ const ih = /* @__PURE__ */ fe({
9539
9540
  },
9540
9541
  size: 400,
9541
9542
  cell: (v) => {
9542
- const S = v.getValue(), P = v.row.original, q = !y(null).priceEdit || P.orderFrom === Pe.enum.NONE, re = P.fallbackPrice, D = v.row.depth > 0, O = x.getMemberPricingPriceVariant(P.price_variant), K = Object.values(O).every((Z) => Z === null);
9543
+ const S = v.getValue(), V = v.row.original, q = !y(null).priceEdit || V.orderFrom === Pe.enum.NONE, re = V.fallbackPrice, $ = v.row.depth > 0, D = x.getMemberPricingPriceVariant(V.price_variant), K = Object.values(D).every((X) => X === null);
9543
9544
  return h("div", {
9544
9545
  class: "flex items-center gap-8"
9545
9546
  }, [h(bt, {
@@ -9549,20 +9550,20 @@ const ih = /* @__PURE__ */ fe({
9549
9550
  required: !re && !q,
9550
9551
  nullable: !!re,
9551
9552
  min: b.value ? void 0 : 0,
9552
- "onUpdate:model-value": (Z) => {
9553
+ "onUpdate:model-value": (X) => {
9553
9554
  var le;
9554
- if (D) {
9555
+ if ($) {
9555
9556
  const Ae = (le = v.row.getParentRow()) == null ? void 0 : le.original;
9556
9557
  if (!Ae) return;
9557
9558
  k(
9558
9559
  Ae._id,
9559
- P.combinationKey ?? "",
9560
+ V.combinationKey ?? "",
9560
9561
  // @ts-ignore
9561
9562
  "price",
9562
- Z
9563
+ X
9563
9564
  );
9564
9565
  } else
9565
- B(P._id, "price", Z);
9566
+ B(V._id, "price", X);
9566
9567
  },
9567
9568
  showCurrency: !1,
9568
9569
  class: "min-w-[88px]"
@@ -9571,39 +9572,39 @@ const ih = /* @__PURE__ */ fe({
9571
9572
  }, [h(Ln, {
9572
9573
  title: T("menu.product.form.member_price.configure.title"),
9573
9574
  currentConfig: "",
9574
- priceVariants: O,
9575
+ priceVariants: D,
9575
9576
  showRemy: !1,
9576
9577
  basePrice: S,
9577
9578
  basePriceFallback: re ? rt(re) : void 0,
9578
- "onUpdate:value": (Z) => {
9579
+ "onUpdate:value": (X) => {
9579
9580
  var Ae;
9580
9581
  const le = {
9581
- price: Z.basePrice,
9582
- price_variant: qo(Z.priceVariants)
9582
+ price: X.basePrice,
9583
+ price_variant: qo(X.priceVariants)
9583
9584
  };
9584
- if (D) {
9585
+ if ($) {
9585
9586
  const xe = (Ae = v.row.getParentRow()) == null ? void 0 : Ae.original;
9586
9587
  if (!xe) return;
9587
- k(xe._id, P.combinationKey ?? "", le);
9588
+ k(xe._id, V.combinationKey ?? "", le);
9588
9589
  } else
9589
- B(P._id, le);
9590
+ B(V._id, le);
9590
9591
  }
9591
9592
  }, {
9592
9593
  default: ({
9593
- trigger: Z
9594
+ trigger: X
9594
9595
  }) => h(Ee.FmButton, {
9595
9596
  variant: ze.Plain,
9596
9597
  label: T("menu.product.form.member_price.configure.title"),
9597
- onClick: () => Z()
9598
+ onClick: () => X()
9598
9599
  }, {
9599
9600
  default: () => h("span", {
9600
9601
  class: "underline line-clamp-2 break-all"
9601
9602
  }, [K ? T("menu.product.form.member_price.configure.title") : T("menu.product.form.member_price.configure.title_with_tier", {
9602
- num: Object.values(O).filter((le) => le !== null).length
9603
+ num: Object.values(D).filter((le) => le !== null).length
9603
9604
  })])
9604
9605
  })
9605
9606
  }), h(jn, {
9606
- priceVariants: O,
9607
+ priceVariants: D,
9607
9608
  placement: "left"
9608
9609
  }, null)])]);
9609
9610
  }
@@ -9613,27 +9614,27 @@ const ih = /* @__PURE__ */ fe({
9613
9614
  size: 100,
9614
9615
  enableSorting: !1,
9615
9616
  cell: (v) => {
9616
- const S = v.getValue(), P = v.row.original, q = P.fallbackOrder, re = v.row.depth > 0;
9617
+ const S = v.getValue(), V = v.row.original, q = V.fallbackOrder, re = v.row.depth > 0;
9617
9618
  return Ue($o, {
9618
9619
  modelValue: S,
9619
9620
  fallback: q,
9620
- disable: !y(P.combinationKey).orderFrom,
9621
+ disable: !y(V.combinationKey).orderFrom,
9621
9622
  required: !0,
9622
- editActiveOnly: y(P.combinationKey).orderFromActiveOnly,
9623
- "onUpdate:modelValue": (D) => {
9624
- var O;
9623
+ editActiveOnly: y(V.combinationKey).orderFromActiveOnly,
9624
+ "onUpdate:modelValue": ($) => {
9625
+ var D;
9625
9626
  if (re) {
9626
- const K = (O = v.row.getParentRow()) == null ? void 0 : O.original;
9627
+ const K = (D = v.row.getParentRow()) == null ? void 0 : D.original;
9627
9628
  if (!K) return;
9628
9629
  k(
9629
9630
  K._id,
9630
- P.combinationKey ?? "",
9631
+ V.combinationKey ?? "",
9631
9632
  // @ts-ignore
9632
9633
  "orderFrom",
9633
- D
9634
+ $
9634
9635
  );
9635
9636
  } else
9636
- B(P._id, "orderFrom", D);
9637
+ B(V._id, "orderFrom", $);
9637
9638
  },
9638
9639
  label: "",
9639
9640
  menuZIndex: 101
@@ -9648,13 +9649,13 @@ const ih = /* @__PURE__ */ fe({
9648
9649
  // size: rules.value.inventory && rules.value.link ? 80 : 40,
9649
9650
  size: 80,
9650
9651
  cell: (v) => {
9651
- const S = v.row.original, P = S.orderFrom === Pe.enum.NONE, q = v.row.depth > 0, re = se(S), D = (O) => {
9652
+ const S = v.row.original, V = S.orderFrom === Pe.enum.NONE, q = v.row.depth > 0, re = se(S), $ = (D) => {
9652
9653
  const K = h(M("fm-button"), {
9653
9654
  variant: ze.Tertiary,
9654
- disabled: P || !re.length,
9655
+ disabled: V || !re.length,
9655
9656
  prependIcon: "arrow_split",
9656
9657
  textColor: nt.NeutralGray400,
9657
- onClick: O
9658
+ onClick: D
9658
9659
  }, null);
9659
9660
  return h(M("fm-tooltip"), {
9660
9661
  content: T("menu.group.nested.title"),
@@ -9673,15 +9674,15 @@ const ih = /* @__PURE__ */ fe({
9673
9674
  }, [y(null).priceTier && h(nr, {
9674
9675
  priceTiers: S.priceTiers,
9675
9676
  priceTiersVariant: S.priceTiers_variant,
9676
- disabled: P,
9677
- "onUpdate:value": (O) => {
9678
- var Z;
9677
+ disabled: V,
9678
+ "onUpdate:value": (D) => {
9679
+ var X;
9679
9680
  const K = {
9680
- priceTiers: O.priceTiers,
9681
- priceTiers_variant: Ko(O.priceTiersVariant)
9681
+ priceTiers: D.priceTiers,
9682
+ priceTiers_variant: Ko(D.priceTiersVariant)
9682
9683
  };
9683
9684
  if (q) {
9684
- const le = (Z = v.row.getParentRow()) == null ? void 0 : Z.original;
9685
+ const le = (X = v.row.getParentRow()) == null ? void 0 : X.original;
9685
9686
  if (!le) return;
9686
9687
  k(le._id, S.combinationKey ?? "", K);
9687
9688
  } else
@@ -9692,24 +9693,24 @@ const ih = /* @__PURE__ */ fe({
9692
9693
  initialValue: S.inventoryBindings ?? [],
9693
9694
  name: S.name ?? S.fallbackName ?? "",
9694
9695
  allowRefund: n.allowRefundInventory,
9695
- "onUpdate:inventory": (O) => {
9696
+ "onUpdate:inventory": (D) => {
9696
9697
  var K;
9697
9698
  if (q) {
9698
- const Z = (K = v.row.getParentRow()) == null ? void 0 : K.original;
9699
- if (!Z) return;
9699
+ const X = (K = v.row.getParentRow()) == null ? void 0 : K.original;
9700
+ if (!X) return;
9700
9701
  k(
9701
- Z._id,
9702
+ X._id,
9702
9703
  S.combinationKey ?? "",
9703
9704
  // @ts-ignore
9704
9705
  "inventoryBindings",
9705
- O
9706
+ D
9706
9707
  );
9707
9708
  } else
9708
- B(S._id, "inventoryBindings", O);
9709
+ B(S._id, "inventoryBindings", D);
9709
9710
  }
9710
9711
  }, {
9711
9712
  default: ({
9712
- trigger: O
9713
+ trigger: D
9713
9714
  }) => h(M("fm-tooltip"), {
9714
9715
  content: "Inventory",
9715
9716
  zIndex: 110
@@ -9718,25 +9719,25 @@ const ih = /* @__PURE__ */ fe({
9718
9719
  var K;
9719
9720
  return [h(M("fm-button"), {
9720
9721
  variant: ze.Tertiary,
9721
- disabled: P,
9722
+ disabled: V,
9722
9723
  prependIcon: "inventory_2",
9723
9724
  overwriteIconOutline: (K = S.inventoryBindings) != null && K.length ? "filled" : "outline",
9724
9725
  textColor: nt.NeutralGray400,
9725
- onClick: O
9726
+ onClick: D
9726
9727
  }, null)];
9727
9728
  }
9728
9729
  })
9729
- }), re.length === 0 ? D() : h(Ef, {
9730
+ }), re.length === 0 ? $() : h(Ef, {
9730
9731
  itemName: Y(S),
9731
9732
  groups: re,
9732
9733
  allItems: a.state.menu.modules.item,
9733
9734
  maxWidth: 800
9734
9735
  }, {
9735
9736
  default: ({
9736
- trigger: O
9737
- }) => D(O),
9737
+ trigger: D
9738
+ }) => $(D),
9738
9739
  action: ({
9739
- group: O
9740
+ group: D
9740
9741
  }) => h(er, {
9741
9742
  combinations: [{
9742
9743
  _id: S._id,
@@ -9746,17 +9747,17 @@ const ih = /* @__PURE__ */ fe({
9746
9747
  fullCombinations: {
9747
9748
  [S.combinationKey || ""]: S.name || S.fallbackName || ""
9748
9749
  },
9749
- groupId: O._id,
9750
+ groupId: D._id,
9750
9751
  hideVariantSection: !0,
9751
9752
  "onUpdate:combinations": (K) => {
9752
9753
  var le, Ae;
9753
- const Z = ((le = K[0]) == null ? void 0 : le.groups) || [];
9754
+ const X = ((le = K[0]) == null ? void 0 : le.groups) || [];
9754
9755
  if (q) {
9755
9756
  const xe = (Ae = v.row.getParentRow()) == null ? void 0 : Ae.original;
9756
9757
  if (!xe) return;
9757
- k(xe._id, S.combinationKey ?? "", "groups", Z);
9758
+ k(xe._id, S.combinationKey ?? "", "groups", X);
9758
9759
  } else
9759
- B(S._id, "groups", Z);
9760
+ B(S._id, "groups", X);
9760
9761
  }
9761
9762
  }, {
9762
9763
  default: ({
@@ -9774,11 +9775,11 @@ const ih = /* @__PURE__ */ fe({
9774
9775
  textColor: nt.NeutralGray400,
9775
9776
  disabled: q,
9776
9777
  onClick: () => {
9777
- V(S._id);
9778
+ O(S._id);
9778
9779
  }
9779
9780
  }, null)]);
9780
9781
  }
9781
- }]), $ = E(() => ({
9782
+ }]), P = E(() => ({
9782
9783
  code: c.value,
9783
9784
  name: !0,
9784
9785
  price: y(null).price,
@@ -9803,7 +9804,7 @@ const ih = /* @__PURE__ */ fe({
9803
9804
  }
9804
9805
  });
9805
9806
  }
9806
- function B(v, S, P) {
9807
+ function B(v, S, V) {
9807
9808
  const q = n.group.items[v];
9808
9809
  if (!q) return;
9809
9810
  const re = {
@@ -9812,8 +9813,8 @@ const ih = /* @__PURE__ */ fe({
9812
9813
  if (typeof S == "object" && S !== null)
9813
9814
  Object.assign(re, S);
9814
9815
  else {
9815
- const D = S;
9816
- D === "price" ? re.price = !P && !q.fallbackPrice ? Ye.Dinero.zero().toObject() : P : re[D] = P;
9816
+ const $ = S;
9817
+ $ === "price" ? re.price = !V && !q.fallbackPrice ? Ye.Dinero.zero().toObject() : V : re[$] = V;
9817
9818
  }
9818
9819
  o("update:group", {
9819
9820
  ...n.group,
@@ -9823,35 +9824,35 @@ const ih = /* @__PURE__ */ fe({
9823
9824
  }
9824
9825
  });
9825
9826
  }
9826
- function k(v, S, P, q) {
9827
- var K, Z;
9828
- const re = Ce(n.group), D = (K = re.items[v].items) == null ? void 0 : K.findIndex((le) => le.combinationKey === S);
9829
- if (!Bt.isSet(D)) return;
9830
- let O = (Z = re.items[v].items) == null ? void 0 : Z[D];
9831
- O && (typeof P == "object" && P !== null ? O = {
9832
- ...O,
9833
- ...P
9834
- } : O = {
9835
- ...O,
9836
- [P]: q
9837
- }, re.items[v].items[D] = O, o("update:group", re));
9838
- }
9839
- function V(v) {
9827
+ function k(v, S, V, q) {
9828
+ var K, X;
9829
+ const re = Ce(n.group), $ = (K = re.items[v].items) == null ? void 0 : K.findIndex((le) => le.combinationKey === S);
9830
+ if (!Bt.isSet($)) return;
9831
+ let D = (X = re.items[v].items) == null ? void 0 : X[$];
9832
+ D && (typeof V == "object" && V !== null ? D = {
9833
+ ...D,
9834
+ ...V
9835
+ } : D = {
9836
+ ...D,
9837
+ [V]: q
9838
+ }, re.items[v].items[$] = D, o("update:group", re));
9839
+ }
9840
+ function O(v) {
9840
9841
  const S = Ce(n.group);
9841
9842
  delete S.items[v], o("update:group", S);
9842
9843
  }
9843
9844
  function z(v) {
9844
9845
  n.config.isV4 ? o("update:group", v) : o("update:unmap-group", On(v));
9845
9846
  }
9846
- const X = E(() => n.categorizedItems.flatMap((v) => v.items).reduce((v, S) => {
9847
- var P;
9847
+ const Z = E(() => n.categorizedItems.flatMap((v) => v.items).reduce((v, S) => {
9848
+ var V;
9848
9849
  return v[S._id] = {
9849
9850
  price: S.price,
9850
- variants: Er(((P = S.variant) == null ? void 0 : P.variantCombinations) || [], "combinationKey")
9851
+ variants: Er(((V = S.variant) == null ? void 0 : V.variantCombinations) || [], "combinationKey")
9851
9852
  }, v;
9852
9853
  }, {})), ne = E(() => a.state.menu.modules.item.reduce((v, S) => (v[S._id] = S, v), {})), j = E(() => {
9853
9854
  const v = a.state.menu.modules.item, S = a.state.menu.modules.group;
9854
- return Object.values(n.group.items).flatMap((P) => [P, ...P.items ?? []]).reduce((P, q) => (P[ie(q)] = Qf(q, v, S), P), {});
9855
+ return Object.values(n.group.items).flatMap((V) => [V, ...V.items ?? []]).reduce((V, q) => (V[ie(q)] = Qf(q, v, S), V), {});
9855
9856
  });
9856
9857
  function ie(v) {
9857
9858
  return `${v._id}:${v.combinationKey ?? ""}`;
@@ -9860,22 +9861,22 @@ const ih = /* @__PURE__ */ fe({
9860
9861
  return j.value[ie(v)] ?? [];
9861
9862
  }
9862
9863
  function Y(v) {
9863
- var P;
9864
- const S = v.combinationKey ? co(v.combinationKey, a.variants) : (P = ne.value[v._id]) == null ? void 0 : P.name;
9864
+ var V;
9865
+ const S = v.combinationKey ? co(v.combinationKey, a.variants) : (V = ne.value[v._id]) == null ? void 0 : V.name;
9865
9866
  return v.name || v.fallbackName || S || "";
9866
9867
  }
9867
9868
  function me(v) {
9868
- const S = [], P = new Set(v.filter((q) => q.combinationKey).map((q) => `${q._id}:${q.combinationKey}`));
9869
+ const S = [], V = new Set(v.filter((q) => q.combinationKey).map((q) => `${q._id}:${q.combinationKey}`));
9869
9870
  return v.forEach((q) => {
9870
- var O;
9871
+ var D;
9871
9872
  if (q.combinationKey)
9872
9873
  return;
9873
9874
  S.push(q);
9874
9875
  const re = ne.value[q._id];
9875
- if (!re || !re.variant || ((O = re.variant.variantCombinations) == null ? void 0 : O.length) === 0)
9876
+ if (!re || !re.variant || ((D = re.variant.variantCombinations) == null ? void 0 : D.length) === 0)
9876
9877
  return;
9877
9878
  (re.variant.variantCombinations || []).forEach((K) => {
9878
- const Z = `${K._id}:${K.combinationKey}`, le = !P.has(Z);
9879
+ const X = `${K._id}:${K.combinationKey}`, le = !V.has(X);
9879
9880
  S.push({
9880
9881
  _id: K._id,
9881
9882
  combinationKey: K.combinationKey,
@@ -9886,18 +9887,18 @@ const ih = /* @__PURE__ */ fe({
9886
9887
  }
9887
9888
  const pe = async (v) => {
9888
9889
  let S = On(n.group);
9889
- const P = me(v);
9890
+ const V = me(v);
9890
9891
  S = {
9891
9892
  ...S,
9892
- items: P.map((q) => {
9893
- const re = S.items.find((O) => O._id == q._id && O.combinationKey == q.combinationKey);
9893
+ items: V.map((q) => {
9894
+ const re = S.items.find((D) => D._id == q._id && D.combinationKey == q.combinationKey);
9894
9895
  q.orderFrom && re && (re.orderFrom = q.orderFrom);
9895
- const D = X.value[q._id];
9896
+ const $ = Z.value[q._id];
9896
9897
  return re || {
9897
9898
  ...q,
9898
9899
  name: null,
9899
9900
  // By default for linking products, setting null making the item name be determined by fallback name, which is the original item/variant name, and user can still edit the name if needed.
9900
- price: q.combinationKey ? D.variants[q.combinationKey || ""].price : D.price,
9901
+ price: q.combinationKey ? $.variants[q.combinationKey || ""].price : $.price,
9901
9902
  orderFrom: q.orderFrom ?? Pe.enum.ALL
9902
9903
  };
9903
9904
  })
@@ -9905,14 +9906,14 @@ const ih = /* @__PURE__ */ fe({
9905
9906
  }, te = (v) => v.items;
9906
9907
  function ce(v) {
9907
9908
  const S = Ce(n.group);
9908
- S.items = v.reduce((P, q) => ({
9909
- ...P,
9909
+ S.items = v.reduce((V, q) => ({
9910
+ ...V,
9910
9911
  [q._id]: q
9911
9912
  }), {}), o("update:group", S);
9912
9913
  }
9913
9914
  const be = qi(), G = E(() => be.breakpoints.value.xs);
9914
9915
  return (v, S) => {
9915
- const P = M("fm-button"), q = M("fm-table");
9916
+ const V = M("fm-button"), q = M("fm-table");
9916
9917
  return _(), W(ve, null, [h(Ke, {
9917
9918
  title: m(T)("menu.group.option.title"),
9918
9919
  "sub-title": v.config.link() && d.value ? m(T)("menu.group.option.subtitle") : ""
@@ -9931,7 +9932,7 @@ const ih = /* @__PURE__ */ fe({
9931
9932
  }, {
9932
9933
  default: F(({
9933
9934
  trigger: re
9934
- }) => [h(P, {
9935
+ }) => [h(V, {
9935
9936
  "text-color": m(nt).ColorPrimary,
9936
9937
  "border-color": m(nt).ColorPrimary,
9937
9938
  variant: "secondary",
@@ -9940,7 +9941,7 @@ const ih = /* @__PURE__ */ fe({
9940
9941
  onClick: re
9941
9942
  }, null, 8, ["text-color", "border-color", "label", "onClick"])]),
9942
9943
  _: 1
9943
- }, 8, ["categorized-items", "initial-value", "show-variant", "title"])])) : (_(), W("div", eh, [h(P, {
9944
+ }, 8, ["categorized-items", "initial-value", "show-variant", "title"])])) : (_(), W("div", eh, [h(V, {
9944
9945
  "text-color": m(nt).ColorPrimary,
9945
9946
  "border-color": m(nt).ColorPrimary,
9946
9947
  variant: "secondary",
@@ -9950,7 +9951,7 @@ const ih = /* @__PURE__ */ fe({
9950
9951
  }, null, 8, ["text-color", "border-color", "label"])]))], 64)) : ee("", !0)]),
9951
9952
  default: F(() => [C("div", th, [C("div", nh, [h(q, {
9952
9953
  "column-defs": U.value,
9953
- "column-visibility": $.value,
9954
+ "column-visibility": P.value,
9954
9955
  draggable: !G.value && y(null).name,
9955
9956
  "expanded-state": l.value ? {} : I.value,
9956
9957
  "get-sub-row": te,
@@ -10083,7 +10084,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10083
10084
  name: te
10084
10085
  }));
10085
10086
  }
10086
- function $(te) {
10087
+ function P(te) {
10087
10088
  function ce() {
10088
10089
  I({
10089
10090
  ...o.group,
@@ -10115,7 +10116,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10115
10116
  () => {
10116
10117
  g.value = !1;
10117
10118
  }
10118
- ), V = E(() => o.action === "add" ? Y("common.add") : Y("common.update"));
10119
+ ), O = E(() => o.action === "add" ? Y("common.add") : Y("common.update"));
10119
10120
  async function z() {
10120
10121
  var te;
10121
10122
  if (o.action === "add") {
@@ -10180,7 +10181,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10180
10181
  i("status:show", te), te && (await ji(), B.value = $e.clone(o.group));
10181
10182
  }
10182
10183
  );
10183
- const X = E(() => {
10184
+ const Z = E(() => {
10184
10185
  var te;
10185
10186
  return ((te = r.groupAttributeSettings) == null ? void 0 : te.value.length) > 0 && !b.value.isOverride;
10186
10187
  }), ne = E(() => {
@@ -10222,13 +10223,13 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10222
10223
  });
10223
10224
  return (te, ce) => {
10224
10225
  var K;
10225
- const be = M("fm-button"), G = M("FmTooltip"), v = M("fm-text-field"), S = M("fm-stepper-field"), P = M("FmFormGroup"), q = M("fm-radio"), re = M("fm-radio-group"), D = M("fm-switch"), O = M("fm-side-sheet");
10226
+ const be = M("fm-button"), G = M("FmTooltip"), v = M("fm-text-field"), S = M("fm-stepper-field"), V = M("FmFormGroup"), q = M("fm-radio"), re = M("fm-radio-group"), $ = M("fm-switch"), D = M("fm-side-sheet");
10226
10227
  return _(), W(ve, null, [
10227
10228
  Oe(te.$slots, "default", { trigger: y }),
10228
- h(O, {
10229
+ h(D, {
10229
10230
  id: "group-form",
10230
10231
  modelValue: g.value,
10231
- "onUpdate:modelValue": ce[9] || (ce[9] = (Z) => g.value = Z),
10232
+ "onUpdate:modelValue": ce[9] || (ce[9] = (X) => g.value = X),
10232
10233
  "is-container": m(Ee).FmForm,
10233
10234
  "is-container-props": {
10234
10235
  onValidationSuccess: z,
@@ -10243,7 +10244,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10243
10244
  "side-sheet-footer": F(() => [
10244
10245
  C("div", uh, [
10245
10246
  h(be, {
10246
- label: m(Qr)(V.value),
10247
+ label: m(Qr)(O.value),
10247
10248
  loading: f.value,
10248
10249
  size: "lg",
10249
10250
  type: "submit",
@@ -10262,12 +10263,12 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10262
10263
  Oe(te.$slots, "variant-section"),
10263
10264
  h(Br, null, {
10264
10265
  default: F(() => {
10265
- var Z;
10266
+ var X;
10266
10267
  return [
10267
10268
  h(v, {
10268
10269
  modelValue: x.value,
10269
10270
  "onUpdate:modelValue": ce[1] || (ce[1] = (le) => x.value = le),
10270
- placeholder: (Z = B.value) == null ? void 0 : Z.name,
10271
+ placeholder: (X = B.value) == null ? void 0 : X.name,
10271
10272
  disabled: A("name"),
10272
10273
  rules: A("name") ? [] : ie.value,
10273
10274
  autofocus: "",
@@ -10299,7 +10300,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10299
10300
  ]),
10300
10301
  _: 1
10301
10302
  }, 8, ["modelValue", "placeholder", "disabled", "rules", "label"]),
10302
- h(P, {
10303
+ h(V, {
10303
10304
  "model-value": te.group.min + " " + te.group.max,
10304
10305
  rules: m(p)
10305
10306
  }, {
@@ -10336,7 +10337,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10336
10337
  h(re, {
10337
10338
  disabled: A("type"),
10338
10339
  "model-value": te.group.type,
10339
- "onUpdate:modelValue": ce[4] || (ce[4] = (le) => $(le))
10340
+ "onUpdate:modelValue": ce[4] || (ce[4] = (le) => P(le))
10340
10341
  }, {
10341
10342
  default: F(() => [
10342
10343
  (_(!0), W(ve, null, Ie(L.value, (le) => (_(), Q(q, {
@@ -10354,7 +10355,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10354
10355
  label: m(Y)("menu.common.labels.configuration")
10355
10356
  }, {
10356
10357
  default: F(() => [
10357
- h(D, {
10358
+ h($, {
10358
10359
  modelValue: te.group.stackable,
10359
10360
  "onUpdate:modelValue": ce[5] || (ce[5] = (le) => te.group.stackable = le),
10360
10361
  disabled: A("stackable"),
@@ -10365,7 +10366,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10365
10366
  ]),
10366
10367
  _: 1
10367
10368
  }, 8, ["label"]),
10368
- X.value ? (_(), Q(Ke, {
10369
+ Z.value ? (_(), Q(Ke, {
10369
10370
  key: 1,
10370
10371
  title: m(Y)("menu.group.form.tagging.title"),
10371
10372
  "sub-title": m(Y)("menu.group.form.tagging.subtitle")
@@ -10384,7 +10385,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10384
10385
  }),
10385
10386
  _: 1
10386
10387
  }),
10387
- h(P, {
10388
+ h(V, {
10388
10389
  tag: "div",
10389
10390
  modelValue: te.group,
10390
10391
  rules: [m(c)],
@@ -10399,8 +10400,8 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10399
10400
  "categorized-items": te.categorizedItems,
10400
10401
  config: b.value,
10401
10402
  group: te.group,
10402
- "onUpdate:group": ce[6] || (ce[6] = (Z) => I(Z)),
10403
- "onUpdate:unmapGroup": ce[7] || (ce[7] = (Z) => I(N(Z)))
10403
+ "onUpdate:group": ce[6] || (ce[6] = (X) => I(X)),
10404
+ "onUpdate:unmapGroup": ce[7] || (ce[7] = (X) => I(N(X)))
10404
10405
  }, null, 8, ["allow-refund-inventory", "categorized-items", "config", "group"])
10405
10406
  ]),
10406
10407
  _: 1
@@ -10412,7 +10413,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10412
10413
  te.group ? (_(), Q(Do, {
10413
10414
  key: 0,
10414
10415
  modelValue: w.value,
10415
- "onUpdate:modelValue": ce[10] || (ce[10] = (Z) => w.value = Z),
10416
+ "onUpdate:modelValue": ce[10] || (ce[10] = (X) => w.value = X),
10416
10417
  title: m(Y)("menu.group.title"),
10417
10418
  name: x.value ?? ((K = B.value) == null ? void 0 : K.name) ?? "",
10418
10419
  "name-locale": te.group.name_locale,
@@ -10570,32 +10571,32 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10570
10571
  const n = e, o = Qe(), i = De(), a = Wn(), r = tt(), {
10571
10572
  t: l
10572
10573
  } = ge(), s = t, u = E(() => i.rules.group), d = E(() => i.rules.item), c = E(() => i.groups);
10573
- function p(k, V) {
10574
- return Ce(V ?? []).map((X) => {
10575
- const ne = k.find((j) => j._id === X._id);
10574
+ function p(k, O) {
10575
+ return Ce(O ?? []).map((Z) => {
10576
+ const ne = k.find((j) => j._id === Z._id);
10576
10577
  return {
10577
10578
  name: (ne == null ? void 0 : ne.name) ?? "",
10578
- ...X,
10579
+ ...Z,
10579
10580
  position: ne == null ? void 0 : ne.position
10580
10581
  };
10581
10582
  });
10582
10583
  }
10583
10584
  const f = E(() => {
10584
- var V;
10585
- return [...g(p(c.value, n.form.groups || ((V = n.fallback) == null ? void 0 : V.groups) || [])).map((z) => z._id)];
10585
+ var O;
10586
+ return [...g(p(c.value, n.form.groups || ((O = n.fallback) == null ? void 0 : O.groups) || [])).map((z) => z._id)];
10586
10587
  });
10587
10588
  function g(k) {
10588
- return Ce(k ?? []).sort((z, X) => z.position - X.position);
10589
+ return Ce(k ?? []).sort((z, Z) => z.position - Z.position);
10589
10590
  }
10590
10591
  function w(k) {
10591
- const V = c.value.find((ne) => ne._id === k);
10592
- if (!V)
10592
+ const O = c.value.find((ne) => ne._id === k);
10593
+ if (!O)
10593
10594
  return [];
10594
10595
  const z = [];
10595
- return V.items.forEach((ne) => {
10596
+ return O.items.forEach((ne) => {
10596
10597
  if (ne.combinationKey)
10597
10598
  return;
10598
- const j = i.items.find((se) => se._id === ne._id), ie = V.items.filter((se) => se._id === ne._id && se.combinationKey).length;
10599
+ const j = i.items.find((se) => se._id === ne._id), ie = O.items.filter((se) => se._id === ne._id && se.combinationKey).length;
10599
10600
  z.push({
10600
10601
  code: ne.code || (j == null ? void 0 : j.code),
10601
10602
  name: ne.name || (j == null ? void 0 : j.name),
@@ -10608,22 +10609,22 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10608
10609
  })})` : j;
10609
10610
  });
10610
10611
  }
10611
- const y = E(() => g(c.value).reduce((k, V) => (k[V._id] = {
10612
- name: V.name,
10613
- type: Fn(i.items, V.items)
10612
+ const y = E(() => g(c.value).reduce((k, O) => (k[O._id] = {
10613
+ name: O.name,
10614
+ type: Fn(i.items, O.items)
10614
10615
  }, k), {})), b = E(() => [...Object.entries(y.value).map(([k, {
10615
- name: V,
10616
+ name: O,
10616
10617
  type: z
10617
10618
  }]) => ({
10618
- label: `${V} ${u.value.type ? `(${mo(z)})` : ""}`.trim(),
10619
+ label: `${O} ${u.value.type ? `(${mo(z)})` : ""}`.trim(),
10619
10620
  value: k
10620
10621
  }))]), R = E(() => [{
10621
10622
  accessorKey: "name",
10622
10623
  header: () => l("menu.product.form.group.columns.title"),
10623
10624
  enableSorting: !1,
10624
10625
  cell: (k) => {
10625
- const V = k.row.original._id;
10626
- return N(V);
10626
+ const O = k.row.original._id;
10627
+ return N(O);
10627
10628
  }
10628
10629
  }, {
10629
10630
  id: "type",
@@ -10632,8 +10633,8 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10632
10633
  enableSorting: !1,
10633
10634
  cell: (k) => {
10634
10635
  var z;
10635
- const V = k.row.original._id;
10636
- return mo((z = y.value[V]) == null ? void 0 : z.type);
10636
+ const O = k.row.original._id;
10637
+ return mo((z = y.value[O]) == null ? void 0 : z.type);
10637
10638
  }
10638
10639
  }, {
10639
10640
  accessorKey: "items",
@@ -10641,7 +10642,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10641
10642
  enableSorting: !1,
10642
10643
  size: 200,
10643
10644
  cell: (k) => {
10644
- const V = k.row.original._id, X = w(V).join(", ");
10645
+ const O = k.row.original._id, Z = w(O).join(", ");
10645
10646
  return h(Ee.FmTooltip, {
10646
10647
  "z-index": 51,
10647
10648
  class: "flex",
@@ -10650,14 +10651,14 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10650
10651
  }, {
10651
10652
  default: () => h("div", {
10652
10653
  class: "line-clamp-2 break-all"
10653
- }, [X]),
10654
+ }, [Z]),
10654
10655
  content: () => h("div", {
10655
10656
  class: "py-12 px-16 space-y-12"
10656
10657
  }, [h("p", {
10657
10658
  class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-600"
10658
10659
  }, [l("menu.group.list.columns.products")]), h("div", {
10659
10660
  class: "flex flex-wrap gap-8"
10660
- }, [X])])
10661
+ }, [Z])])
10661
10662
  });
10662
10663
  }
10663
10664
  }, {
@@ -10666,7 +10667,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10666
10667
  size: 52,
10667
10668
  enableSorting: !1,
10668
10669
  cell: (k) => {
10669
- const V = k.row.original._id;
10670
+ const O = k.row.original._id;
10670
10671
  return Ue("div", {
10671
10672
  class: "flex justify-end"
10672
10673
  }, [Ue(Ee.FmButton, {
@@ -10674,14 +10675,14 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10674
10675
  variant: "tertiary",
10675
10676
  textColor: "neutral-gray-400",
10676
10677
  onClick: ct(async () => {
10677
- T(V);
10678
+ T(O);
10678
10679
  }, ["stop", "prevent"])
10679
10680
  }), Ue(dh, {
10680
10681
  // variant items
10681
10682
  combinations: U.value ?? [],
10682
10683
  // combinationKey: varaintName
10683
10684
  fullCombinations: n.fullCombinations,
10684
- groupId: V,
10685
+ groupId: O,
10685
10686
  "onUpdate:combinations": B
10686
10687
  }, {
10687
10688
  default: ({
@@ -10689,7 +10690,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10689
10690
  }) => Ue(Ee.FmButton, {
10690
10691
  icon: "edit",
10691
10692
  variant: "tertiary",
10692
- disabled: !$(V),
10693
+ disabled: !P(O),
10693
10694
  textColor: "neutral-gray-400",
10694
10695
  onClick: z
10695
10696
  })
@@ -10706,14 +10707,14 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10706
10707
  groupIds: f.value
10707
10708
  }
10708
10709
  }).onPrimary((k) => {
10709
- var V;
10710
+ var O;
10710
10711
  for (const z of k)
10711
10712
  if (Ps(i.state.menu, z, n.form._id)) {
10712
- const X = (V = y.value[z]) == null ? void 0 : V.name;
10713
+ const Z = (O = y.value[z]) == null ? void 0 : O.name;
10713
10714
  o.open({
10714
10715
  type: "error",
10715
10716
  message: l("menu.product.form.group.circularError", {
10716
- groupName: X,
10717
+ groupName: Z,
10717
10718
  productName: n.form.name
10718
10719
  })
10719
10720
  });
@@ -10723,30 +10724,30 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10723
10724
  });
10724
10725
  }
10725
10726
  function I(k) {
10726
- const V = k.reduce((z, X) => {
10727
+ const O = k.reduce((z, Z) => {
10727
10728
  var j;
10728
- const ne = ((j = n.form.groups) == null ? void 0 : j.find((ie) => ie._id === X)) || {
10729
- _id: X,
10729
+ const ne = ((j = n.form.groups) == null ? void 0 : j.find((ie) => ie._id === Z)) || {
10730
+ _id: Z,
10730
10731
  groupKey: ""
10731
10732
  };
10732
10733
  return z.push(ne), z;
10733
10734
  }, []);
10734
10735
  s("replace:form", a.initDynamicGroupItem({
10735
10736
  ...n.form,
10736
- groups: V
10737
+ groups: O
10737
10738
  }));
10738
10739
  }
10739
10740
  function T(k) {
10740
- var z, X, ne;
10741
+ var z, Z, ne;
10741
10742
  if (!n.form.groups)
10742
10743
  return;
10743
- const V = Ce(n.form.groups);
10744
- V.splice(V.findIndex((j) => j._id === k), 1);
10744
+ const O = Ce(n.form.groups);
10745
+ O.splice(O.findIndex((j) => j._id === k), 1);
10745
10746
  for (const j of ((z = n.form.variant) == null ? void 0 : z.variantCombinations) || [])
10746
- (ne = j.groups) == null || ne.splice((X = j.groups) == null ? void 0 : X.findIndex((ie) => ie._id === k), 1);
10747
+ (ne = j.groups) == null || ne.splice((Z = j.groups) == null ? void 0 : Z.findIndex((ie) => ie._id === k), 1);
10747
10748
  s("replace:form", a.initDynamicGroupItem({
10748
10749
  ...n.form,
10749
- groups: V
10750
+ groups: O
10750
10751
  }));
10751
10752
  }
10752
10753
  const x = E(() => {
@@ -10760,7 +10761,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10760
10761
  groups: n.form.groups || []
10761
10762
  }];
10762
10763
  });
10763
- function $(k) {
10764
+ function P(k) {
10764
10765
  var z;
10765
10766
  if (!k) return !1;
10766
10767
  if (d.value.overrideProductGroup) return !0;
@@ -10777,17 +10778,17 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10777
10778
  }
10778
10779
  Se(() => c.value.length, () => I([...f.value, c.value[c.value.length - 1]._id]));
10779
10780
  const N = (k) => {
10780
- var V;
10781
- return (V = b.value.find((z) => z.value === k)) == null ? void 0 : V.label;
10781
+ var O;
10782
+ return (O = b.value.find((z) => z.value === k)) == null ? void 0 : O.label;
10782
10783
  }, B = (k) => {
10783
- var V;
10784
+ var O;
10784
10785
  x.value ? s("update:form", "variant", {
10785
- variantGroupIds: ((V = n.form.variant) == null ? void 0 : V.variantGroupIds) || [],
10786
+ variantGroupIds: ((O = n.form.variant) == null ? void 0 : O.variantGroupIds) || [],
10786
10787
  variantCombinations: k
10787
10788
  }) : s("update:form", "groups", k[0].groups || []);
10788
10789
  };
10789
- return (k, V) => {
10790
- const z = M("FmButton"), X = M("FmTable");
10790
+ return (k, O) => {
10791
+ const z = M("FmButton"), Z = M("FmTable");
10791
10792
  return _(), Q(Ke, {
10792
10793
  title: m(l)("menu.product.form.group.title"),
10793
10794
  "sub-title": m(l)("menu.product.form.group.subtitle")
@@ -10802,7 +10803,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10802
10803
  default: F(() => [h(Ja, null, {
10803
10804
  default: F(() => {
10804
10805
  var ne;
10805
- return [((ne = f.value) == null ? void 0 : ne.length) > 0 ? (_(), Q(X, {
10806
+ return [((ne = f.value) == null ? void 0 : ne.length) > 0 ? (_(), Q(Z, {
10806
10807
  key: 0,
10807
10808
  "column-defs": R.value,
10808
10809
  "column-visibility": A.value,
@@ -10868,7 +10869,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10868
10869
  return p(o.form.inventoryBindings || [], ((A = o.form.variant) == null ? void 0 : A.variantCombinations) || [], f.value, a.variants);
10869
10870
  });
10870
10871
  function w(A, L) {
10871
- var U, $;
10872
+ var U, P;
10872
10873
  let I = $e.clone(o.form);
10873
10874
  const T = I.variant;
10874
10875
  if ((((U = T == null ? void 0 : T.variantCombinations) == null ? void 0 : U.length) ?? 0) > 0 && T) {
@@ -10878,7 +10879,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
10878
10879
  B[N].inventoryBindings = L, I = {
10879
10880
  ...I,
10880
10881
  variant: {
10881
- variantGroupIds: (($ = I.variant) == null ? void 0 : $.variantGroupIds) || [],
10882
+ variantGroupIds: ((P = I.variant) == null ? void 0 : P.variantGroupIds) || [],
10882
10883
  variantCombinations: B
10883
10884
  }
10884
10885
  };
@@ -11050,8 +11051,8 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
11050
11051
  if (!I && n.form.perXUnit) {
11051
11052
  const [T, x] = n.form.perXUnit.toString().split(".");
11052
11053
  if (x && x.length > 4) {
11053
- const $ = (typeof n.form.perXUnit == "string" ? parseFloat(n.form.perXUnit) : n.form.perXUnit).toFixed(4);
11054
- l("update:form", "perXUnit", parseFloat($));
11054
+ const P = (typeof n.form.perXUnit == "string" ? parseFloat(n.form.perXUnit) : n.form.perXUnit).toFixed(4);
11055
+ l("update:form", "perXUnit", parseFloat(P));
11055
11056
  }
11056
11057
  }
11057
11058
  }
@@ -11082,12 +11083,12 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
11082
11083
  T ? l("update:form", "priceTiers_variant", Ko(I)) : l("update:form", "price_variant", qo(I));
11083
11084
  }
11084
11085
  return (I, T) => {
11085
- const x = M("fm-select"), U = M("FmButton"), $ = M("fm-checkbox"), N = M("fm-text-field"), B = Ht("tooltip");
11086
+ const x = M("fm-select"), U = M("FmButton"), P = M("fm-checkbox"), N = M("fm-text-field"), B = Ht("tooltip");
11086
11087
  return _(), Q(Ke, {
11087
11088
  title: m(r)("menu.product.form.price.title")
11088
11089
  }, {
11089
11090
  default: F(() => {
11090
- var k, V;
11091
+ var k, O;
11091
11092
  return [
11092
11093
  C("div", xh, [
11093
11094
  h(bt, {
@@ -11138,7 +11139,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
11138
11139
  currentConfig: "Main Pricing",
11139
11140
  "product-name": I.form.name,
11140
11141
  "base-price": I.form.price,
11141
- "base-price-fallback": (V = I.fallback) != null && V.price ? m(rt)(I.fallback.price, !1) : void 0,
11142
+ "base-price-fallback": (O = I.fallback) != null && O.price ? m(rt)(I.fallback.price, !1) : void 0,
11142
11143
  "price-variants": A.value,
11143
11144
  "show-remy": !0,
11144
11145
  "onUpdate:basePrice": T[2] || (T[2] = (z) => l("update:form", "price", z)),
@@ -11148,7 +11149,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
11148
11149
  h(U, {
11149
11150
  variant: m(ze).Secondary,
11150
11151
  label: m(r)("menu.product.form.member_price.configure.title"),
11151
- onClick: (X) => z()
11152
+ onClick: (Z) => z()
11152
11153
  }, null, 8, ["variant", "label", "onClick"])
11153
11154
  ]),
11154
11155
  _: 1
@@ -11178,8 +11179,8 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
11178
11179
  "model-value": I.form.priceTiers || ((z = I.fallback) == null ? void 0 : z.priceTiers) || {},
11179
11180
  "allow-negative-price": !1,
11180
11181
  "price-variant": I.form.priceTiers_variant,
11181
- "onUpdate:modelValue": T[4] || (T[4] = (X) => l("update:form", "priceTiers", X)),
11182
- "onUpdate:priceTiersVariant": T[5] || (T[5] = (X) => L(X, !0))
11182
+ "onUpdate:modelValue": T[4] || (T[4] = (Z) => l("update:form", "priceTiers", Z)),
11183
+ "onUpdate:priceTiersVariant": T[5] || (T[5] = (Z) => L(Z, !0))
11183
11184
  }, null, 8, ["price-tiers", "model-value", "price-variant"]))
11184
11185
  ];
11185
11186
  }),
@@ -11189,10 +11190,10 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
11189
11190
  label: m(r)("menu.product.form.price.settings.title")
11190
11191
  }, {
11191
11192
  default: F(() => {
11192
- var z, X, ne;
11193
+ var z, Z, ne;
11193
11194
  return [
11194
11195
  C("div", Oh, [
11195
- h($, {
11196
+ h(P, {
11196
11197
  disabled: !s.value.openPrice || I.isAddon,
11197
11198
  "model-value": I.form.openPrice ?? ((z = I.fallback) == null ? void 0 : z.openPrice) ?? !1,
11198
11199
  value: I.form.openPrice,
@@ -11201,7 +11202,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
11201
11202
  "onUpdate:modelValue": T[6] || (T[6] = (j) => l("update:form", "openPrice", j))
11202
11203
  }, null, 8, ["disabled", "model-value", "value", "label", "sublabel"]),
11203
11204
  C("div", Dh, [
11204
- h($, {
11205
+ h(P, {
11205
11206
  disabled: !s.value.unit || I.isAddon,
11206
11207
  "model-value": u.value,
11207
11208
  value: u.value,
@@ -11214,7 +11215,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
11214
11215
  C("div", Vh, [
11215
11216
  h(N, {
11216
11217
  disabled: !s.value.unit,
11217
- "model-value": I.form.perXUnit || ((X = I.fallback) == null ? void 0 : X.perXUnit) || null,
11218
+ "model-value": I.form.perXUnit || ((Z = I.fallback) == null ? void 0 : Z.perXUnit) || null,
11218
11219
  rules: [
11219
11220
  (j) => !!j || m(r)("menu.product.form.price.settings.sell_by_unit.per_unit.required"),
11220
11221
  (j) => !j || j > 0 || m(r)("menu.product.form.price.settings.sell_by_unit.per_unit.min")
@@ -11240,7 +11241,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
11240
11241
  ])) : ee("", !0)
11241
11242
  ]),
11242
11243
  s.value.costing ? (_(), W("div", Mh, [
11243
- h($, {
11244
+ h(P, {
11244
11245
  "model-value": !!I.form.costing,
11245
11246
  value: !!I.form.costing,
11246
11247
  label: m(r)("menu.product.form.price.settings.track_costing.label"),
@@ -11260,7 +11261,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
11260
11261
  ])) : ee("", !0)
11261
11262
  ])) : ee("", !0),
11262
11263
  s.value.minPrice ? (_(), W("div", Nh, [
11263
- h($, {
11264
+ h(P, {
11264
11265
  disabled: !s.value.minPrice || I.isAddon,
11265
11266
  "model-value": !!I.form.minPrice,
11266
11267
  value: !!I.form.minPrice,
@@ -11493,10 +11494,10 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
11493
11494
  label: m(i)("menu.product.form.print.config.label")
11494
11495
  }, {
11495
11496
  default: F(() => {
11496
- var $;
11497
+ var P;
11497
11498
  return [
11498
11499
  h(A, {
11499
- "model-value": !(($ = b.form.print) != null && $.toRoot),
11500
+ "model-value": !((P = b.form.print) != null && P.toRoot),
11500
11501
  label: m(i)("menu.product.form.print.config.group_parent.label"),
11501
11502
  "label-placement": "right",
11502
11503
  sublabel: m(i)("menu.product.form.print.config.group_parent.sublabel"),
@@ -11509,15 +11510,15 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
11509
11510
  h(I, {
11510
11511
  label: m(i)("menu.product.form.print.kds.label"),
11511
11512
  "model-value": ((U = b.form.print) == null ? void 0 : U.sequential) ?? !1,
11512
- "onUpdate:modelValue": R[1] || (R[1] = ($) => f($))
11513
+ "onUpdate:modelValue": R[1] || (R[1] = (P) => f(P))
11513
11514
  }, {
11514
11515
  default: F(() => [
11515
11516
  C("div", Yh, [
11516
- (_(!0), W(ve, null, Ie(y.value, ($, N) => (_(), Q(L, {
11517
+ (_(!0), W(ve, null, Ie(y.value, (P, N) => (_(), Q(L, {
11517
11518
  key: N,
11518
- label: $.label,
11519
- sublabel: $.description,
11520
- value: $.value
11519
+ label: P.label,
11520
+ sublabel: P.description,
11521
+ value: P.value
11521
11522
  }, null, 8, ["label", "sublabel", "value"]))), 128))
11522
11523
  ])
11523
11524
  ]),
@@ -11529,20 +11530,20 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
11529
11530
  default: F(() => [
11530
11531
  d.value.length ? (_(), Q(m(Ji), {
11531
11532
  key: 0,
11532
- "item-key": ($) => $,
11533
+ "item-key": (P) => P,
11533
11534
  "model-value": d.value,
11534
11535
  handle: ".handle",
11535
- "onUpdate:modelValue": R[3] || (R[3] = ($) => g($)),
11536
+ "onUpdate:modelValue": R[3] || (R[3] = (P) => g(P)),
11536
11537
  class: "space-y-16"
11537
11538
  }, {
11538
- item: F(({ element: $ }) => {
11539
- var N, B, k, V, z;
11539
+ item: F(({ element: P }) => {
11540
+ var N, B, k, O, z;
11540
11541
  return [
11541
11542
  C("div", Xh, [
11542
11543
  C("div", Zh, [
11543
11544
  u.value ? (_(), Q(T, {
11544
11545
  key: 0,
11545
- disabled: !((B = (N = n.form.print) == null ? void 0 : N.department) != null && B.includes($)),
11546
+ disabled: !((B = (N = n.form.print) == null ? void 0 : N.department) != null && B.includes(P)),
11546
11547
  class: "handle",
11547
11548
  "prepend-icon": "drag_handle",
11548
11549
  variant: "tertiary",
@@ -11551,13 +11552,13 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
11551
11552
  }, null, 8, ["disabled"])) : ee("", !0)
11552
11553
  ]),
11553
11554
  h(x, {
11554
- id: $,
11555
- "data-checked": (V = (k = n.form.print) == null ? void 0 : k.department) == null ? void 0 : V.includes($),
11556
- label: c.value[$],
11557
- "model-value": (((z = n.form.print) == null ? void 0 : z.department) ?? []).includes($),
11558
- value: $,
11555
+ id: P,
11556
+ "data-checked": (O = (k = n.form.print) == null ? void 0 : k.department) == null ? void 0 : O.includes(P),
11557
+ label: c.value[P],
11558
+ "model-value": (((z = n.form.print) == null ? void 0 : z.department) ?? []).includes(P),
11559
+ value: P,
11559
11560
  class: "flex-1",
11560
- "onUpdate:modelValue": (X) => w($, X)
11561
+ "onUpdate:modelValue": (Z) => w(P, Z)
11561
11562
  }, null, 8, ["id", "data-checked", "label", "model-value", "value", "onUpdate:modelValue"])
11562
11563
  ])
11563
11564
  ];
@@ -11565,13 +11566,13 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
11565
11566
  _: 1
11566
11567
  }, 8, ["item-key", "model-value"])) : ee("", !0),
11567
11568
  h(m(qh), { "apply-product": !1 }, {
11568
- default: F(({ trigger: $ }) => [
11569
+ default: F(({ trigger: P }) => [
11569
11570
  C("div", Qh, [
11570
11571
  h(T, {
11571
11572
  variant: m(ze).Secondary,
11572
11573
  label: m(i)("menu.product.form.print.routes.add"),
11573
11574
  "prepend-icon": "add",
11574
- onClick: $
11575
+ onClick: P
11575
11576
  }, null, 8, ["variant", "label", "onClick"])
11576
11577
  ])
11577
11578
  ]),
@@ -12093,26 +12094,26 @@ const sg = {
12093
12094
  }) {
12094
12095
  const n = e, o = De(), i = Wn(), a = Qe(), r = tt(), {
12095
12096
  t: l
12096
- } = ge(), s = H(!1), u = E(() => o.rules.item), d = E(() => u.value.minPrice && !!n.form.minPrice), c = E(() => !o.state.currentCatalogId), p = E(() => o.variants.reduce((k, V) => (k[V._id] = V, k), {})), f = t;
12097
+ } = ge(), s = H(!1), u = E(() => o.rules.item), d = E(() => u.value.minPrice && !!n.form.minPrice), c = E(() => !o.state.currentCatalogId), p = E(() => o.variants.reduce((k, O) => (k[O._id] = O, k), {})), f = t;
12097
12098
  function g(k) {
12098
- const V = $e.clone(n.form);
12099
+ const O = $e.clone(n.form);
12099
12100
  for (const {
12100
12101
  key: z,
12101
- value: X
12102
+ value: Z
12102
12103
  } of k)
12103
- V[z] = X;
12104
- f("replace:form", V);
12104
+ O[z] = Z;
12105
+ f("replace:form", O);
12105
12106
  }
12106
12107
  function w(k) {
12107
12108
  var z;
12108
- const V = b(k.combinationKey || "");
12109
+ const O = b(k.combinationKey || "");
12109
12110
  return {
12110
12111
  ...k,
12111
- price: V == null ? void 0 : V.price,
12112
- inventoryBindings: (V == null ? void 0 : V.inventoryBindings) || n.form.inventoryBindings,
12113
- takeawayUsed: (V == null ? void 0 : V.takeawayUsed) || n.form.takeawayUsed,
12114
- groups: (V == null ? void 0 : V.groups) || ((z = n.form.groups) == null ? void 0 : z.map((X) => ({
12115
- ...X,
12112
+ price: O == null ? void 0 : O.price,
12113
+ inventoryBindings: (O == null ? void 0 : O.inventoryBindings) || n.form.inventoryBindings,
12114
+ takeawayUsed: (O == null ? void 0 : O.takeawayUsed) || n.form.takeawayUsed,
12115
+ groups: (O == null ? void 0 : O.groups) || ((z = n.form.groups) == null ? void 0 : z.map((Z) => ({
12116
+ ...Z,
12116
12117
  groupKey: ""
12117
12118
  })))
12118
12119
  };
@@ -12125,49 +12126,49 @@ const sg = {
12125
12126
  contentComponentProps: {
12126
12127
  selectedVariants: ((k = n.form.variant) == null ? void 0 : k.variantGroupIds) ?? []
12127
12128
  }
12128
- }).onPrimary(async (V) => {
12129
- L(V, w);
12129
+ }).onPrimary(async (O) => {
12130
+ L(O, w);
12130
12131
  });
12131
12132
  }
12132
12133
  function b(k) {
12133
12134
  var ie, se;
12134
- const V = ((ie = n.form.variant) == null ? void 0 : ie.variantGroupIds) || [], z = (se = n.form.variant) == null ? void 0 : se.variantCombinations, j = k.split(/(?=variant)/g).map((Y) => Y.replace(/\/*$/, "")).filter((Y) => V.some((me) => Y.includes(me))).join("/");
12135
+ const O = ((ie = n.form.variant) == null ? void 0 : ie.variantGroupIds) || [], z = (se = n.form.variant) == null ? void 0 : se.variantCombinations, j = k.split(/(?=variant)/g).map((Y) => Y.replace(/\/*$/, "")).filter((Y) => O.some((me) => Y.includes(me))).join("/");
12135
12136
  return z == null ? void 0 : z.find((Y) => Y.combinationKey === j);
12136
12137
  }
12137
12138
  const R = (k) => {
12138
12139
  L(k);
12139
12140
  }, A = E(() => {
12140
- var V;
12141
- return (((V = n.form.variant) == null ? void 0 : V.variantCombinations) || []).map((z) => {
12141
+ var O;
12142
+ return (((O = n.form.variant) == null ? void 0 : O.variantCombinations) || []).map((z) => {
12142
12143
  var j, ie;
12143
- const X = (ie = (j = n.fallback) == null ? void 0 : j.variant) == null ? void 0 : ie.variantCombinations.find(({
12144
+ const Z = (ie = (j = n.fallback) == null ? void 0 : j.variant) == null ? void 0 : ie.variantCombinations.find(({
12144
12145
  combinationKey: se
12145
12146
  }) => se === z.combinationKey), ne = x.value ? null : z.price;
12146
12147
  return {
12147
12148
  ...z,
12148
12149
  price: ne,
12149
12150
  fallback: {
12150
- ...X,
12151
+ ...Z,
12151
12152
  _id: z._id,
12152
12153
  combinationKey: z.combinationKey,
12153
- price: c.value ? n.form.price ?? (X == null ? void 0 : X.price) : ne ?? (X == null ? void 0 : X.price),
12154
- minPrice: n.form.minPrice ?? (X == null ? void 0 : X.minPrice),
12154
+ price: c.value ? n.form.price ?? (Z == null ? void 0 : Z.price) : ne ?? (Z == null ? void 0 : Z.price),
12155
+ minPrice: n.form.minPrice ?? (Z == null ? void 0 : Z.minPrice),
12155
12156
  priceTiers: n.form.priceTiers
12156
12157
  }
12157
12158
  };
12158
12159
  });
12159
12160
  });
12160
- function L(k, V = (z) => z) {
12161
+ function L(k, O = (z) => z) {
12161
12162
  var ne;
12162
12163
  const z = k.filter((j) => !!j);
12163
- let X;
12164
+ let Z;
12164
12165
  if (z.length) {
12165
12166
  const j = z.map((se) => o.variants.find((Y) => Y._id === se)), ie = at.fullVariantCombination(j).map(({
12166
12167
  combinationKey: se
12167
12168
  }) => {
12168
12169
  var me;
12169
12170
  const Y = (me = n.form.variant) == null ? void 0 : me.variantCombinations.find((pe) => pe.combinationKey === se);
12170
- return V(Y || {
12171
+ return O(Y || {
12171
12172
  _id: n.form._id,
12172
12173
  combinationKey: se
12173
12174
  });
@@ -12179,7 +12180,7 @@ const sg = {
12179
12180
  });
12180
12181
  return;
12181
12182
  }
12182
- X = {
12183
+ Z = {
12183
12184
  ...n.form,
12184
12185
  variant: {
12185
12186
  variantGroupIds: z,
@@ -12196,25 +12197,25 @@ const sg = {
12196
12197
  }, {
12197
12198
  key: "takeawayUsed",
12198
12199
  value: ie.length === 1 ? ie[0] : null
12199
- }]), X = {
12200
+ }]), Z = {
12200
12201
  ...n.form,
12201
12202
  variant: void 0,
12202
12203
  takeawayUsed: ie.length === 1 ? ie[0] : null
12203
12204
  };
12204
12205
  }
12205
- f("replace:form", i.initDynamicGroupItem(X));
12206
+ f("replace:form", i.initDynamicGroupItem(Z));
12206
12207
  }
12207
- async function I(k, V, z) {
12208
- const X = $e.clone(n.form);
12209
- X.variant.variantCombinations[k][V] = z, g([{
12208
+ async function I(k, O, z) {
12209
+ const Z = $e.clone(n.form);
12210
+ Z.variant.variantCombinations[k][O] = z, g([{
12210
12211
  key: "variant",
12211
- value: X.variant
12212
+ value: Z.variant
12212
12213
  }]);
12213
12214
  }
12214
12215
  const T = E(() => {
12215
- var k, V;
12216
- return ((k = o.currentCatalog) == null ? void 0 : k.priceTierRules) ?? ((V = o.currentCatalog) == null ? void 0 : V.usePriceTiers) ?? [];
12217
- }), x = E(() => T.value.length > 0 && o.currentCatalog && !o.currentScheduler), U = Vn(), $ = E(() => [{
12216
+ var k, O;
12217
+ return ((k = o.currentCatalog) == null ? void 0 : k.priceTierRules) ?? ((O = o.currentCatalog) == null ? void 0 : O.usePriceTiers) ?? [];
12218
+ }), x = E(() => T.value.length > 0 && o.currentCatalog && !o.currentScheduler), U = Vn(), P = E(() => [{
12218
12219
  accessorKey: "combinationKey",
12219
12220
  header: () => l("menu.product.form.variant.columns.variant"),
12220
12221
  enableSorting: !1,
@@ -12225,9 +12226,9 @@ const sg = {
12225
12226
  enableSorting: !1,
12226
12227
  cell: (k) => {
12227
12228
  var j, ie;
12228
- const V = k.getValue(), z = k.row.original, ne = ((j = z.fallback) == null ? void 0 : j.code) ?? n.form.code ?? ((ie = n.fallback) == null ? void 0 : ie.code);
12229
+ const O = k.getValue(), z = k.row.original, ne = ((j = z.fallback) == null ? void 0 : j.code) ?? n.form.code ?? ((ie = n.fallback) == null ? void 0 : ie.code);
12229
12230
  return h(Ee.FmTextField, {
12230
- modelValue: V,
12231
+ modelValue: O,
12231
12232
  placeholder: ne || l("menu.product.form.variant.placeholders.no_code"),
12232
12233
  rules: [(se) => {
12233
12234
  const Y = se, me = E(() => {
@@ -12253,10 +12254,10 @@ const sg = {
12253
12254
  enableSorting: !1,
12254
12255
  cell: (k) => {
12255
12256
  var ne, j;
12256
- const V = k.getValue(), X = (ne = k.row.original.fallback) == null ? void 0 : ne.orderFrom;
12257
+ const O = k.getValue(), Z = (ne = k.row.original.fallback) == null ? void 0 : ne.orderFrom;
12257
12258
  return h($o, {
12258
- modelValue: V,
12259
- fallback: n.form.orderFrom ?? X ?? ((j = n.fallback) == null ? void 0 : j.orderFrom),
12259
+ modelValue: O,
12260
+ fallback: n.form.orderFrom ?? Z ?? ((j = n.fallback) == null ? void 0 : j.orderFrom),
12260
12261
  disable: !u.value.orderFrom,
12261
12262
  required: u.value.orderFrom && u.value.orderFromActiveOnly,
12262
12263
  editActiveOnly: u.value.orderFromActiveOnly || !1,
@@ -12274,13 +12275,13 @@ const sg = {
12274
12275
  enableSorting: !1,
12275
12276
  cell: (k) => {
12276
12277
  var se, Y, me;
12277
- const V = k.getValue(), z = k.row.original, ne = ((se = z.fallback) == null ? void 0 : se.price) ?? n.form.price ?? ((Y = n.fallback) == null ? void 0 : Y.price), j = U.getMemberPricingPriceVariant(z.price_variant), ie = Object.values(j).every((pe) => pe === null);
12278
+ const O = k.getValue(), z = k.row.original, ne = ((se = z.fallback) == null ? void 0 : se.price) ?? n.form.price ?? ((Y = n.fallback) == null ? void 0 : Y.price), j = U.getMemberPricingPriceVariant(z.price_variant), ie = Object.values(j).every((pe) => pe === null);
12278
12279
  return h("div", {
12279
12280
  class: "flex items-center gap-8"
12280
12281
  }, [h(bt, {
12281
12282
  disable: x.value,
12282
12283
  placeholder: ne ? rt(ne) : void 0,
12283
- modelValue: V,
12284
+ modelValue: O,
12284
12285
  min: 0,
12285
12286
  "onUpdate:model-value": (pe) => {
12286
12287
  I(k.row.index, "price", pe);
@@ -12294,7 +12295,7 @@ const sg = {
12294
12295
  currentConfig: "",
12295
12296
  priceVariants: j,
12296
12297
  showRemy: !1,
12297
- basePrice: V,
12298
+ basePrice: O,
12298
12299
  basePriceFallback: ne ? rt(ne) : void 0,
12299
12300
  "onUpdate:basePrice": (pe) => {
12300
12301
  I(k.row.index, "price", pe);
@@ -12333,10 +12334,10 @@ const sg = {
12333
12334
  enableSorting: !1,
12334
12335
  cell: (k) => {
12335
12336
  var j, ie, se;
12336
- const V = k.getValue(), z = k.row.original, ne = ((j = z.fallback) == null ? void 0 : j.minPrice) ?? n.form.minPrice ?? ((ie = n.fallback) == null ? void 0 : ie.minPrice);
12337
+ const O = k.getValue(), z = k.row.original, ne = ((j = z.fallback) == null ? void 0 : j.minPrice) ?? n.form.minPrice ?? ((ie = n.fallback) == null ? void 0 : ie.minPrice);
12337
12338
  return h(bt, {
12338
12339
  placeholder: ne ? rt(ne) : void 0,
12339
- modelValue: V,
12340
+ modelValue: O,
12340
12341
  max: Ye.Dinero.fromFdoDinero(z.price ?? ((se = z.fallback) == null ? void 0 : se.price) ?? Ye.Dinero.zero().toObject()).toUnit(),
12341
12342
  "onUpdate:model-value": (Y) => {
12342
12343
  I(k.row.index, "minPrice", Y);
@@ -12353,8 +12354,8 @@ const sg = {
12353
12354
  max: o.rules.item.maxVariant
12354
12355
  }) : !0;
12355
12356
  }
12356
- return (k, V) => {
12357
- const z = M("fm-button"), X = M("fm-icon"), ne = M("FmFormGroup"), j = M("fm-table");
12357
+ return (k, O) => {
12358
+ const z = M("fm-button"), Z = M("fm-icon"), ne = M("FmFormGroup"), j = M("fm-table");
12358
12359
  return _(), Q(Ke, {
12359
12360
  title: m(l)("menu.product.form.variant.title"),
12360
12361
  "sub-title": m(l)("menu.product.form.variant.subtitle")
@@ -12390,7 +12391,7 @@ const sg = {
12390
12391
  variant: m(ze).Tertiary,
12391
12392
  class: "handle",
12392
12393
  "prepend-icon": "drag_handle"
12393
- }, null, 8, ["variant"]), C("div", _g, [C("p", wg, oe((me = p.value[Y]) == null ? void 0 : me.name), 1), h(X, {
12394
+ }, null, 8, ["variant"]), C("div", _g, [C("p", wg, oe((me = p.value[Y]) == null ? void 0 : me.name), 1), h(Z, {
12394
12395
  class: "cursor-pointer",
12395
12396
  name: "close",
12396
12397
  onClick: ct((pe) => {
@@ -12407,7 +12408,7 @@ const sg = {
12407
12408
  default: F(() => [A.value.length ? (_(), Q(j, {
12408
12409
  key: 0,
12409
12410
  class: "w-full",
12410
- "column-defs": $.value,
12411
+ "column-defs": P.value,
12411
12412
  "column-visibility": N.value,
12412
12413
  "page-size": A.value.length ?? 0,
12413
12414
  "row-data": A.value ?? [],
@@ -12457,7 +12458,7 @@ const sg = {
12457
12458
  },
12458
12459
  emits: ["update:show", "submit:form"],
12459
12460
  setup(e, { emit: t }) {
12460
- var Z, le, Ae, xe, je;
12461
+ var X, le, Ae, xe, je;
12461
12462
  const n = e, o = t, i = De(), a = zt(), { t: r } = ge(), l = E(() => n.action === "add" ? r("menu.product.form.title.add") : r("menu.product.form.title.update")), s = E(() => i.rules.item), u = (ae) => new Promise((J) => setTimeout(J, ae));
12462
12463
  Wt(async () => {
12463
12464
  n.autoShow && (await u(100), c());
@@ -12532,7 +12533,7 @@ const sg = {
12532
12533
  ), ye = i.taxSetting.countryTaxOptions.find((ue) => ue.value === ae);
12533
12534
  return ye ? Dr(ye.meta.rate) : "-";
12534
12535
  }
12535
- const $ = E(() => {
12536
+ const P = E(() => {
12536
12537
  var ae, J, ye, ke, ue, Rt, Je, It, Qt;
12537
12538
  return {
12538
12539
  title: r("menu.product.form.summary.title"),
@@ -12597,7 +12598,7 @@ const sg = {
12597
12598
  for (const [ke, ue] of Object.entries(J.customAttributes || {}))
12598
12599
  typeof ue == "string" && ue && !((ye = ae[ke]) != null && ye.includes(ue)) && (ae[ke] = [...ae[ke] || [], ue]);
12599
12600
  }), ae;
12600
- }), V = H(!!f.value.price || !!f.value.minPrice || !!f.value.costing);
12601
+ }), O = H(!!f.value.price || !!f.value.minPrice || !!f.value.costing);
12601
12602
  function z(ae) {
12602
12603
  ae || (f.value = {
12603
12604
  ...f.value,
@@ -12606,8 +12607,8 @@ const sg = {
12606
12607
  price: void 0
12607
12608
  });
12608
12609
  }
12609
- const X = H(
12610
- (((Z = f.value.variant) == null ? void 0 : Z.variantCombinations) || []).some(
12610
+ const Z = H(
12611
+ (((X = f.value.variant) == null ? void 0 : X.variantCombinations) || []).some(
12611
12612
  (ae) => !!ae.price || !!ae.orderFrom || !!ae.code
12612
12613
  )
12613
12614
  );
@@ -12749,16 +12750,16 @@ const sg = {
12749
12750
  Wt(() => {
12750
12751
  S.isUpdatingItem || (S.isUpdatingItem = !0, S.storedCatalogId = i.state.currentCatalogId, S.storedSchedulerId = i.state.currentSchedulerId);
12751
12752
  });
12752
- function P() {
12753
+ function V() {
12753
12754
  S.isUpdatingItem = !1, i.selectCatalog(S.storedCatalogId), i.selectScheduler(S.storedSchedulerId);
12754
12755
  }
12755
12756
  async function q() {
12756
12757
  await oi(), I.value && [
12757
12758
  [N.value, B],
12758
- [V.value, z]
12759
+ [O.value, z]
12759
12760
  ].forEach(([J, ye]) => {
12760
12761
  J || ye(!1);
12761
- }), o("submit:form", Rs(Ce(f.value)), R.value), c(), P();
12762
+ }), o("submit:form", Rs(Ce(f.value)), R.value), c(), V();
12762
12763
  }
12763
12764
  async function re() {
12764
12765
  var ae;
@@ -12775,9 +12776,9 @@ const sg = {
12775
12776
  console.error("Failed to clean up discarded product images", ye);
12776
12777
  }
12777
12778
  }
12778
- c(), P();
12779
+ c(), V();
12779
12780
  }
12780
- const { isAtMost: D } = qi(), O = H(null), K = Wr(O);
12781
+ const { isAtMost: $ } = qi(), D = H(null), K = Wr(D);
12781
12782
  return (ae, J) => (_(), W(ve, null, [
12782
12783
  Oe(ae.$slots, "trigger", cr(dr({
12783
12784
  trigger: c
@@ -12798,17 +12799,17 @@ const sg = {
12798
12799
  onOnCancel: re
12799
12800
  }, {
12800
12801
  "append-title": F(() => [
12801
- m(D)("sm") ? (_(), Q(ri, {
12802
+ m($)("sm") ? (_(), Q(ri, {
12802
12803
  key: 0,
12803
12804
  variant: "dialog",
12804
- title: $.value.title,
12805
- items: $.value.items
12805
+ title: P.value.title,
12806
+ items: P.value.items
12806
12807
  }, null, 8, ["title", "items"])) : ee("", !0)
12807
12808
  ]),
12808
12809
  default: F(() => {
12809
12810
  var ye, ke;
12810
12811
  return [
12811
- m(D)("sm") ? ee("", !0) : (_(), Q(ri, {
12812
+ m($)("sm") ? ee("", !0) : (_(), Q(ri, {
12812
12813
  key: 0,
12813
12814
  class: "fixed",
12814
12815
  style: mr({
@@ -12816,13 +12817,13 @@ const sg = {
12816
12817
  left: m(K).right + "px"
12817
12818
  }),
12818
12819
  variant: "full",
12819
- title: $.value.title,
12820
- items: $.value.items
12820
+ title: P.value.title,
12821
+ items: P.value.items
12821
12822
  }, null, 8, ["style", "title", "items"])),
12822
12823
  C("div", Cg, [
12823
12824
  C("div", {
12824
12825
  ref_key: "formWrapper",
12825
- ref: O,
12826
+ ref: D,
12826
12827
  class: Ve(["flex-1 py-24 space-y-24", "xs:w-full"])
12827
12828
  }, [
12828
12829
  g.value && (Object.keys(g.value.catalogs || {}).length > 0 || g.value.schedulers.length > 0) ? (_(), Q(hs, {
@@ -12873,9 +12874,9 @@ const sg = {
12873
12874
  }, 8, ["title", "sub-title"])) : ee("", !0),
12874
12875
  x.value ? (_(), W("div", xg)) : ee("", !0),
12875
12876
  h(Ot, {
12876
- toggle: V.value,
12877
+ toggle: O.value,
12877
12878
  "onUpdate:toggle": [
12878
- J[4] || (J[4] = (ue) => V.value = ue),
12879
+ J[4] || (J[4] = (ue) => O.value = ue),
12879
12880
  J[5] || (J[5] = (ue) => z(ue))
12880
12881
  ],
12881
12882
  disabled: !I.value,
@@ -12920,9 +12921,9 @@ const sg = {
12920
12921
  }, 8, ["toggle"])) : ee("", !0),
12921
12922
  I.value ? ee("", !0) : (_(), W("div", Tg)),
12922
12923
  h(Ot, {
12923
- toggle: X.value,
12924
+ toggle: Z.value,
12924
12925
  "onUpdate:toggle": [
12925
- J[10] || (J[10] = (ue) => X.value = ue),
12926
+ J[10] || (J[10] = (ue) => Z.value = ue),
12926
12927
  J[11] || (J[11] = (ue) => ne(ue))
12927
12928
  ],
12928
12929
  disabled: !I.value,
@@ -13133,8 +13134,8 @@ const Wn = Ni("item-manager", () => {
13133
13134
  const { container: U } = Yi($g, a, {
13134
13135
  ...x,
13135
13136
  autoShow: !0,
13136
- "onUpdate:show": async ($) => {
13137
- $ || (xn(null, U), U.remove());
13137
+ "onUpdate:show": async (P) => {
13138
+ P || (xn(null, U), U.remove());
13138
13139
  }
13139
13140
  });
13140
13141
  };
@@ -13143,17 +13144,17 @@ const Wn = Ni("item-manager", () => {
13143
13144
  l({
13144
13145
  action: "add",
13145
13146
  categoryId: x,
13146
- "onSubmit:form": async ($, N) => {
13147
- $.inventoryBindings ?? ($.inventoryBindings = []), $.inventoryBindings.length === 0 && ($.inventoryBindings = null), await U($, Ne.F_OPERATION_TYPE.create, N);
13147
+ "onSubmit:form": async (P, N) => {
13148
+ P.inventoryBindings ?? (P.inventoryBindings = []), P.inventoryBindings.length === 0 && (P.inventoryBindings = null), await U(P, Ne.F_OPERATION_TYPE.create, N);
13148
13149
  }
13149
13150
  });
13150
13151
  }
13151
- async function u(x, U, $) {
13152
+ async function u(x, U, P) {
13152
13153
  l({
13153
13154
  initialForm: Vg(x, U || []),
13154
13155
  action: "update",
13155
13156
  "onSubmit:form": async (N) => {
13156
- N.inventoryBindings ?? (N.inventoryBindings = []), N.inventoryBindings.length === 0 && (N.inventoryBindings = null), await $(
13157
+ N.inventoryBindings ?? (N.inventoryBindings = []), N.inventoryBindings.length === 0 && (N.inventoryBindings = null), await P(
13157
13158
  Pg(
13158
13159
  [N],
13159
13160
  e.state.menu,
@@ -13166,18 +13167,18 @@ const Wn = Ni("item-manager", () => {
13166
13167
  }
13167
13168
  async function d(x) {
13168
13169
  var k;
13169
- const U = e.currentCatalog, $ = e.state.currentSchedulerId, N = U.override.scheduler[$] ?? {}, B = (k = N == null ? void 0 : N.items) == null ? void 0 : k.filter((V) => V._id === x._id);
13170
- await u(x, B, async (V) => {
13171
- const z = V.modules.catalog.find(
13172
- (X) => X._id === U._id
13170
+ const U = e.currentCatalog, P = e.state.currentSchedulerId, N = U.override.scheduler[P] ?? {}, B = (k = N == null ? void 0 : N.items) == null ? void 0 : k.filter((O) => O._id === x._id);
13171
+ await u(x, B, async (O) => {
13172
+ const z = O.modules.catalog.find(
13173
+ (Z) => Z._id === U._id
13173
13174
  );
13174
13175
  await new gt(z, e, i.updateMenu, n).update();
13175
13176
  });
13176
13177
  }
13177
13178
  async function c(x) {
13178
13179
  const U = e.currentCatalog;
13179
- await u(x, U.override.items[x._id], async ($) => {
13180
- const N = $.modules.catalog.find(
13180
+ await u(x, U.override.items[x._id], async (P) => {
13181
+ const N = P.modules.catalog.find(
13181
13182
  (B) => B._id === U._id
13182
13183
  );
13183
13184
  await new gt(N, e, i.updateMenu, n).update();
@@ -13186,8 +13187,8 @@ const Wn = Ni("item-manager", () => {
13186
13187
  async function p(x) {
13187
13188
  const U = e.schedulers.find(
13188
13189
  (N) => N._id === e.state.currentSchedulerId
13189
- ), $ = U.items.filter((N) => N._id === x._id);
13190
- await u(x, $, async (N) => {
13190
+ ), P = U.items.filter((N) => N._id === x._id);
13191
+ await u(x, P, async (N) => {
13191
13192
  const B = N.modules.scheduler.find(
13192
13193
  (k) => k._id === U._id
13193
13194
  );
@@ -13196,36 +13197,36 @@ const Wn = Ni("item-manager", () => {
13196
13197
  }
13197
13198
  async function f(x) {
13198
13199
  var B, k;
13199
- const U = e.state.currentSchedulerId, $ = Ce(e.currentCatalog), N = (k = ((B = $.override.scheduler[U]) == null ? void 0 : B.items) || []) == null ? void 0 : k.reduce((V, z) => {
13200
- if (z.combinationKey) return [...V, z];
13201
- const X = x.find((ne) => ne._id === z._id);
13202
- return X ? [...V, { ...z, price: X.price }] : [...V, z];
13200
+ const U = e.state.currentSchedulerId, P = Ce(e.currentCatalog), N = (k = ((B = P.override.scheduler[U]) == null ? void 0 : B.items) || []) == null ? void 0 : k.reduce((O, z) => {
13201
+ if (z.combinationKey) return [...O, z];
13202
+ const Z = x.find((ne) => ne._id === z._id);
13203
+ return Z ? [...O, { ...z, price: Z.price }] : [...O, z];
13203
13204
  }, []);
13204
- $.override.scheduler = {
13205
- ...$.override.scheduler,
13205
+ P.override.scheduler = {
13206
+ ...P.override.scheduler,
13206
13207
  [U]: {
13207
- ...$.override.scheduler[U],
13208
+ ...P.override.scheduler[U],
13208
13209
  _id: U,
13209
13210
  items: N
13210
13211
  }
13211
- }, await new gt($, e, i.updateMenu, n).update();
13212
+ }, await new gt(P, e, i.updateMenu, n).update();
13212
13213
  }
13213
13214
  async function g(x) {
13214
13215
  var B;
13215
- const U = Ce(e.currentCatalog), $ = (B = Object.entries(U.override.items)) == null ? void 0 : B.reduce(
13216
- (k, [V, z]) => {
13217
- const X = x.find((j) => j._id === V);
13218
- if (!X)
13219
- return k[V] = z, k;
13216
+ const U = Ce(e.currentCatalog), P = (B = Object.entries(U.override.items)) == null ? void 0 : B.reduce(
13217
+ (k, [O, z]) => {
13218
+ const Z = x.find((j) => j._id === O);
13219
+ if (!Z)
13220
+ return k[O] = z, k;
13220
13221
  const ne = z.find((j) => !j.combinationKey);
13221
- return k[V] = [
13222
+ return k[O] = [
13222
13223
  ...z.filter((j) => !!j.combinationKey),
13223
13224
  {
13224
13225
  ...ne,
13225
- code: X.code || void 0,
13226
- name: X.name,
13227
- price: X.price,
13228
- orderFrom: X.orderFrom ?? ne.orderFrom
13226
+ code: Z.code || void 0,
13227
+ name: Z.name,
13228
+ price: Z.price,
13229
+ orderFrom: Z.orderFrom ?? ne.orderFrom
13229
13230
  }
13230
13231
  ], k;
13231
13232
  },
@@ -13236,7 +13237,7 @@ const Wn = Ni("item-manager", () => {
13236
13237
  ...U,
13237
13238
  override: {
13238
13239
  ...U.override,
13239
- items: $
13240
+ items: P
13240
13241
  }
13241
13242
  },
13242
13243
  e,
@@ -13245,15 +13246,15 @@ const Wn = Ni("item-manager", () => {
13245
13246
  ).update();
13246
13247
  }
13247
13248
  async function w(x) {
13248
- const U = Ce(e.currentScheduler), $ = U.items.reduce((N, B) => {
13249
+ const U = Ce(e.currentScheduler), P = U.items.reduce((N, B) => {
13249
13250
  if (B.combinationKey) return [...N, B];
13250
- const k = x.find((V) => V._id === B._id);
13251
+ const k = x.find((O) => O._id === B._id);
13251
13252
  return k ? [...N, { ...B, price: k.price }] : [...N, B];
13252
13253
  }, []);
13253
13254
  await new wn(
13254
13255
  {
13255
13256
  ...U,
13256
- items: $
13257
+ items: P
13257
13258
  },
13258
13259
  e,
13259
13260
  i.updateMenu,
@@ -13261,28 +13262,28 @@ const Wn = Ni("item-manager", () => {
13261
13262
  ).update();
13262
13263
  }
13263
13264
  async function y(x) {
13264
- const U = x.reduce((N, B) => {
13265
- const k = e.items.find((V) => V._id === B._id);
13266
- return k && N.push({
13267
- ...k,
13268
- code: B.code ?? k.code,
13269
- name: B.name || k.name,
13270
- price: B.price ?? k.price,
13271
- orderFrom: B.orderFrom ?? k.orderFrom,
13272
- taxes: B.taxes ?? k.taxes,
13273
- category: B.category === void 0 ? k.category : B.category,
13274
- position: B.position ?? k.position,
13275
- additionalCategories: B.additionalCategories ?? k.additionalCategories,
13276
- subCategories: B.subCategories ?? k.subCategories
13277
- }), N;
13278
- }, []), { updateMenu: $ } = i;
13279
- await $(
13280
- U.map((N) => ({
13265
+ const U = new Map(e.state.menu.modules.item.map((B) => [B._id, B])), P = x.reduce((B, k) => {
13266
+ const O = U.get(k._id);
13267
+ return O && B.push({
13268
+ ...O,
13269
+ code: k.code ?? O.code,
13270
+ name: k.name || O.name,
13271
+ price: k.price ?? O.price,
13272
+ orderFrom: k.orderFrom ?? O.orderFrom,
13273
+ taxes: k.taxes ?? O.taxes,
13274
+ category: k.category === void 0 ? O.category : k.category,
13275
+ position: k.position ?? O.position,
13276
+ additionalCategories: k.additionalCategories ?? O.additionalCategories,
13277
+ subCategories: k.subCategories ?? O.subCategories
13278
+ }), B;
13279
+ }, []), { updateMenu: N } = i;
13280
+ await N(
13281
+ P.map((B) => ({
13281
13282
  module: Be.enum.item,
13282
13283
  operation: Ne.F_OPERATION_TYPE.update,
13283
- data: N
13284
+ data: B
13284
13285
  })),
13285
- `${U.length} products`
13286
+ `${P.length} products`
13286
13287
  );
13287
13288
  }
13288
13289
  function b(x) {
@@ -13290,13 +13291,13 @@ const Wn = Ni("item-manager", () => {
13290
13291
  l({
13291
13292
  initialForm: x,
13292
13293
  action: "update",
13293
- "onSubmit:form": async ($, N) => {
13294
- $.inventoryBindings ?? ($.inventoryBindings = []), $.inventoryBindings.length === 0 && ($.inventoryBindings = null), await U($, Ne.F_OPERATION_TYPE.update, N);
13294
+ "onSubmit:form": async (P, N) => {
13295
+ P.inventoryBindings ?? (P.inventoryBindings = []), P.inventoryBindings.length === 0 && (P.inventoryBindings = null), await U(P, Ne.F_OPERATION_TYPE.update, N);
13295
13296
  }
13296
13297
  });
13297
13298
  }
13298
13299
  async function R(x) {
13299
- const U = e.state.menu.modules.item.find(($) => $._id === x);
13300
+ const U = e.state.menu.modules.item.find((P) => P._id === x);
13300
13301
  e.currentCatalog ? e.state.currentSchedulerId ? await d(U) : await c(U) : e.state.currentSchedulerId ? await p(U) : b(U);
13301
13302
  }
13302
13303
  async function A(x) {
@@ -13306,10 +13307,10 @@ const Wn = Ni("item-manager", () => {
13306
13307
  );
13307
13308
  }
13308
13309
  function L(x) {
13309
- const { updateMenu: U } = i, $ = x.length > 1 ? `${x.length} products` : x[0].name;
13310
+ const { updateMenu: U } = i, P = x.length > 1 ? `${x.length} products` : x[0].name;
13310
13311
  n.open({
13311
13312
  title: r("menu.common.dialog.remove.product.title"),
13312
- message: r("menu.common.dialog.remove.product.message", { name: $ }),
13313
+ message: r("menu.common.dialog.remove.product.message", { name: P }),
13313
13314
  primaryActions: {
13314
13315
  text: r("menu.common.actions.remove"),
13315
13316
  close: !0,
@@ -13326,7 +13327,7 @@ const Wn = Ni("item-manager", () => {
13326
13327
  operation: Ne.F_OPERATION_TYPE.delete,
13327
13328
  data: N
13328
13329
  })),
13329
- $,
13330
+ P,
13330
13331
  !0
13331
13332
  );
13332
13333
  try {