@feedmepos/mf-inventory-portal 1.5.12-dev.0 → 1.5.13

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 (111) hide show
  1. package/dist/{App-ym7zoIt4.js → App-DqGcS6Gm.js} +4 -4
  2. package/dist/{ApprovalView-DS1cgEM3.js → ApprovalView-BpLssvwC.js} +7 -7
  3. package/dist/{BindingsDialog-pA-lQ0Qx.js → BindingsDialog-Bjca56rZ.js} +2 -2
  4. package/dist/{BindingsPicker-D-lS8rtE.js → BindingsPicker-D3bSjNn3.js} +2 -2
  5. package/dist/{BindingsTable-CCG83TCM.js → BindingsTable-b8uwBXvE.js} +3 -3
  6. package/dist/{ClosingDraftView-BI6RvZMJ.js → ClosingDraftView-DufSupv2.js} +15 -15
  7. package/dist/{ClosingHistoryView-CzSQ7tNH.js → ClosingHistoryView-C3V5brh9.js} +86 -85
  8. package/dist/{ClosingTemplateView-By2oAuyO.js → ClosingTemplateView-B6hpp5B8.js} +14 -14
  9. package/dist/{DefaultView-eHfv7jOS.js → DefaultView-DeN96J1z.js} +2 -2
  10. package/dist/{DeliveryOrderPrintPreview-59gPCEN9.js → DeliveryOrderPrintPreview-EnFKjxtA.js} +2 -2
  11. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DJnbYUPk.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-6M_CG9Xi.js} +2 -2
  12. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BmoeRycM.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-RH37--FG.js} +2 -2
  13. package/dist/{FmMultiselectDialog-y6iFhI-b.js → FmMultiselectDialog-6mShWQom.js} +1 -1
  14. package/dist/{FmMultiselectDialog-BQct_7_1.js → FmMultiselectDialog-CfjwOjv0.js} +2 -2
  15. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-5FB2Q2M7.js → FmUnitInput.vue_vue_type_script_setup_true_lang-ILexyjQI.js} +5 -5
  16. package/dist/{ImportView-CFhTlC6A.js → ImportView-Aksgpj3u.js} +6 -6
  17. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang--lvhU0IL.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BVa8U4y-.js} +1 -1
  18. package/dist/{IngredientGroupView-98vFl0cv.js → IngredientGroupView-BbJFosjR.js} +5 -5
  19. package/dist/{IngredientsView-DOyC-80n.js → IngredientsView-CN933oCR.js} +15 -15
  20. package/dist/{IntegrationExplorerView-yqqhYVKa.js → IntegrationExplorerView-CAjxn-PC.js} +352 -352
  21. package/dist/IntegrationView-w4fp4oT4.js +4586 -0
  22. package/dist/{InventoryBindingForm-TOMIZzTV.js → InventoryBindingForm-EBJ3QGaU.js} +1 -1
  23. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CCwsG2nZ.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CoUtIP_H.js} +5 -5
  24. package/dist/{InventoryBindingSummary-Kq71Npw5.js → InventoryBindingSummary-DqplMp3W.js} +1 -1
  25. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BpqRkOKa.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DtBoicPG.js} +1 -1
  26. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BXQXxebS.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DsYsq73l.js} +1 -1
  27. package/dist/{PublishView-B3iAIUeC.js → PublishView-BJIsXl8d.js} +3 -3
  28. package/dist/{PurchaseOrderPrintPreview-C7BYCDq4.js → PurchaseOrderPrintPreview-C7HgcwTx.js} +2 -2
  29. package/dist/{ReceiveRequestView-C0RZHVVz.js → ReceiveRequestView-BKfE6CFa.js} +26 -26
  30. package/dist/{RecipeView-CGMCm-6C.js → RecipeView-CIcat7Oq.js} +1117 -1104
  31. package/dist/{SettingsView-Dy36ihuC.js → SettingsView-DAg0_Cxw.js} +4 -4
  32. package/dist/{StockView-DG8gGcR6.js → StockView-DkkBhXdb.js} +19 -19
  33. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-7jJ-_TKD.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-B_7-SpUx.js} +1 -1
  34. package/dist/{SupplierView-DkXdKVSS.js → SupplierView-DdBM6_mn.js} +12 -12
  35. package/dist/{SurchargeView-CnQFI8Np.js → SurchargeView-DO7ccJw4.js} +6 -6
  36. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-CjxxSwOw.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-CnmxlHSe.js} +2 -2
  37. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CgxcV8uB.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CsxPLRxW.js} +1 -1
  38. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-P4wynSco.js → TransferDetails.vue_vue_type_script_setup_true_lang-UAe7BwyU.js} +20 -20
  39. package/dist/TransferTemplateView-DwNMWpQG.js +1564 -0
  40. package/dist/{UnitCostHistoryView-lq-q2AHS.js → UnitCostHistoryView-BR_DzquD.js} +4 -4
  41. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-DSlyQqSb.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-1frVLUSk.js} +5 -5
  42. package/dist/{UnitView-d_Imf603.js → UnitView-DHhs6eAM.js} +7 -7
  43. package/dist/{WarehouseView-61nx-AdI.js → WarehouseView-BncF3L-E.js} +5 -5
  44. package/dist/{WastageTemplateView-CjFGIKQo.js → WastageTemplateView-e3ixwHt1.js} +14 -14
  45. package/dist/api/inventory.d.ts +0 -1
  46. package/dist/api/netsuite.d.ts +4 -5
  47. package/dist/api/surcharge.d.ts +0 -1
  48. package/dist/{app-vpgIgmf7.js → app-BM6mngFA.js} +4141 -4438
  49. package/dist/app.d.ts +0 -268
  50. package/dist/app.js +1 -1
  51. package/dist/{closing-template-Dq6tC4Zx.js → closing-template-BD6V7qLl.js} +1 -1
  52. package/dist/{date2-Bdr9V2CH.js → date2-DDlrt2dw.js} +1 -1
  53. package/dist/{dayjs.min-DyMZZmIx.js → dayjs.min-CRtl6lAo.js} +1 -1
  54. package/dist/{decimal-naJvMnG2.js → decimal-C05Zbycy.js} +2 -2
  55. package/dist/{defineDeepModel-33cmeIFu.js → defineDeepModel-B0S3YXv1.js} +1 -1
  56. package/dist/{duplicate-template-DSu6924D.js → duplicate-template-DLoKowb8.js} +1 -1
  57. package/dist/{feature-yi8Tnb7H.js → feature-Hkq4qHGO.js} +2 -2
  58. package/dist/{format-time-from-id-Dq0qIwbK.js → format-time-from-id-BsGskcws.js} +1 -1
  59. package/dist/format-unit-display-Dbb2764O.js +1268 -0
  60. package/dist/{import-export.helper-DDiyb9cx.js → import-export.helper-CwHS2Pr0.js} +6 -6
  61. package/dist/{index-B4vbL-WN.js → index-BosCKut7.js} +1 -1
  62. package/dist/index-C-Z_O_57.js +164 -0
  63. package/dist/{index-Dmrgz0N_.js → index-DOZ0kYer.js} +1 -1
  64. package/dist/{inventory-core-dart.default-DzEwllSu.js → inventory-core-dart.default-DsrlA0VP.js} +1 -1
  65. package/dist/{lz-string-DECQ92Sb.js → lz-string-jug66pQ2.js} +1 -1
  66. package/dist/modules/print-template/api/print-template.d.ts +0 -1
  67. package/dist/{netsuite-CKOqNFIz.js → netsuite-CM1xsb3Q.js} +2 -2
  68. package/dist/{number-CwVsldWr.js → number-B1kR4U7C.js} +3 -3
  69. package/dist/{predefined-templates-7P8LQiMs.js → predefined-templates-B3VXqLxq.js} +1 -1
  70. package/dist/{purchase-order-template-CFGG5iZS.js → purchase-order-template-BZ7ubNPM.js} +1 -1
  71. package/dist/{recalculationUtils-CxUnAgYt.js → recalculationUtils-DT_K_oBV.js} +1 -1
  72. package/dist/{rules-C-5mKwH6.js → rules-DXN5yNM9.js} +2 -2
  73. package/dist/{stock-B_XDv328.js → stock-Cwp99-w7.js} +1 -1
  74. package/dist/stores/api.d.ts +0 -1
  75. package/dist/stores/helper/generate-backend-urls.d.ts +0 -1
  76. package/dist/stores/integration/index.d.ts +1 -4
  77. package/dist/{supplier-BDDyN8pD.js → supplier-CNblYzcC.js} +2 -2
  78. package/dist/{surcharge-9qVO99TB.js → surcharge-DiXkOxK8.js} +1 -1
  79. package/dist/tsconfig.app.tsbuildinfo +1 -1
  80. package/dist/{uom-rules-2xdoSjfc.js → uom-rules-B0cj4nFH.js} +1 -1
  81. package/dist/{use-ingredient-select-dialog-BHgTuz0K.js → use-ingredient-select-dialog-CHqjDEzy.js} +2 -2
  82. package/dist/{use-inventory-binding-dialog-CVpVEZ-n.js → use-inventory-binding-dialog-CqKj6_hT.js} +2 -2
  83. package/dist/use-template-enabled-locations-CZf0oezR.js +146 -0
  84. package/dist/{use-transfer-locations-CMPfQCpO.js → use-transfer-locations-BTRfRrp8.js} +2 -2
  85. package/dist/{useHrmPermission-BfjsEgXe.js → useHrmPermission-CYeY_uQ0.js} +1 -1
  86. package/dist/{useNavigationMenu-DQV4rPXu.js → useNavigationMenu-D2DBZszb.js} +2 -2
  87. package/dist/{useSseClient-DyY87MX7.js → useSseClient-DNe-54JD.js} +3 -3
  88. package/dist/views/recipe/composables/use-recipe-bulk-editor.d.ts +3 -3
  89. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +1 -4
  90. package/dist/{vue-i18n-WjLZbUYJ.js → vue-i18n-CRix8f2i.js} +419 -419
  91. package/dist/{xlsx-BoG4Nhqx.js → xlsx-4npyDw84.js} +398 -398
  92. package/dist/{xlsx.util-BSJ5fdz4.js → xlsx.util-C-DEH9b0.js} +3 -3
  93. package/package.json +4 -4
  94. package/dist/IntegrationView-BR7yLMpk.js +0 -5100
  95. package/dist/TransferTemplateView-D6dO4-GT.js +0 -2327
  96. package/dist/api/codemax.d.ts +0 -11
  97. package/dist/format-unit-display-dtvjecol.js +0 -1432
  98. package/dist/index-B4O6YlPQ.js +0 -257
  99. package/dist/stores/integration/codemax.d.ts +0 -432
  100. package/dist/use-template-enabled-locations-esKf16CY.js +0 -132
  101. package/dist/views/integration/Codemax.vue.d.ts +0 -2
  102. package/dist/views/integration/components/ApplyProductCodemax.vue.d.ts +0 -341
  103. package/dist/views/integration/components/ApplyProductDialogCodemax.vue.d.ts +0 -298
  104. package/dist/views/integration/components/ApplyProductDialogPropsCodemax.d.ts +0 -17
  105. package/dist/views/integration/components/CodemaxDialog.vue.d.ts +0 -519
  106. package/dist/views/transfer-template/components/template-item-bulk-editor/TemplateItemBulkEditorDialog.vue.d.ts +0 -2
  107. package/dist/views/transfer-template/components/template-item-bulk-editor/TemplateItemBulkEditorStep1.vue.d.ts +0 -2
  108. package/dist/views/transfer-template/components/template-item-bulk-editor/TemplateItemBulkEditorStep2.vue.d.ts +0 -8
  109. package/dist/views/transfer-template/components/template-item-bulk-editor/TemplateItemBulkEditorStep3.vue.d.ts +0 -2
  110. package/dist/views/transfer-template/composables/use-template-item-bulk-editor.d.ts +0 -3225
  111. package/dist/views/transfer-template/helpers/template-item-bulk-editor-export.d.ts +0 -9
@@ -1,32 +1,32 @@
1
- import { defineComponent as le, ref as W, onMounted as pt, resolveComponent as G, openBlock as y, createElementBlock as E, Fragment as X, createElementVNode as v, toDisplayString as U, createVNode as h, createCommentVNode as T, computed as A, watch as ue, unref as n, normalizeClass as Ce, withCtx as J, h as de, createBlock as Y, renderList as me, isRef as De, mergeProps as we, createTextVNode as mt, withModifiers as ft, normalizeStyle as vt, Teleport as yt, normalizeProps as bt, guardReactiveProps as gt } from "vue";
2
- import { a as ne, c as Oe, S as _t, F as be, u as tt, t as kt, v as ht, i as Je } from "./app-vpgIgmf7.js";
1
+ import { defineComponent as le, ref as W, onMounted as pt, resolveComponent as G, openBlock as v, createElementBlock as V, Fragment as X, createElementVNode as f, toDisplayString as U, createVNode as x, createCommentVNode as T, computed as R, watch as ue, unref as n, normalizeClass as Ce, withCtx as J, h as de, createBlock as Y, renderList as me, isRef as De, mergeProps as we, createTextVNode as mt, withModifiers as ft, normalizeStyle as vt, Teleport as yt, normalizeProps as bt, guardReactiveProps as gt } from "vue";
2
+ import { a as ne, c as Oe, S as _t, F as be, u as tt, t as kt, v as ht, i as Je } from "./app-BM6mngFA.js";
3
3
  import { useDialog as Le, useSnackbar as je, components as _e, useProxiedModel as Ge, useBreakpoints as xt } from "@feedmepos/ui-library";
4
4
  import { i as $t, _ as It, m as wt } from "./menu-usage-module-D7cxkbEk.js";
5
5
  import { F as se } from "./form-mode.enum-BKiNVH6A.js";
6
- import { _ as nt } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang--lvhU0IL.js";
6
+ import { _ as nt } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-BVa8U4y-.js";
7
7
  import { defineStore as ot, storeToRefs as Et } from "pinia";
8
8
  import { D as He, R as Ve } from "./row-action.enum-DQ9bJ_uv.js";
9
9
  import { c as Vt } from "./component-kqxARxvM.js";
10
- import { a as Q, c as Ke } from "./number-CwVsldWr.js";
10
+ import { a as Q, c as Ke } from "./number-B1kR4U7C.js";
11
11
  import { useI18n as ie, useCoreStore as St } from "@feedmepos/mf-common";
12
12
  import { u as Ct, _ as Bt } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DGlWE5I8.js";
13
- import { b as it, c as qe, I as Ft, A as Ne, U as lt, R as Rt } from "./rules-C-5mKwH6.js";
14
- import { _ as At } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-CCwsG2nZ.js";
15
- import { a as Pe } from "./FmMultiselectDialog-BQct_7_1.js";
16
- import { d as rt } from "./defineDeepModel-33cmeIFu.js";
13
+ import { b as it, c as qe, I as Ft, A as Ne, U as lt, R as Rt } from "./rules-DXN5yNM9.js";
14
+ import { _ as At } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-CoUtIP_H.js";
15
+ import { a as Pe } from "./FmMultiselectDialog-CfjwOjv0.js";
16
+ import { d as rt } from "./defineDeepModel-B0S3YXv1.js";
17
17
  import { L as Tt, P as Ut, D as Pt } from "./app-DiX-EfV6.js";
18
- import { _ as Be, c as Mt, d as Dt, e as ye } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-5FB2Q2M7.js";
19
- import { u as Gt } from "./FmMultiselectDialog-y6iFhI-b.js";
20
- import { u as Nt } from "./vue-i18n-WjLZbUYJ.js";
21
- import { F as zt } from "./inventory-core-dart.default-DzEwllSu.js";
18
+ import { _ as Be, c as Mt, d as Dt, e as ye } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-ILexyjQI.js";
19
+ import { u as Gt } from "./FmMultiselectDialog-6mShWQom.js";
20
+ import { u as Nt } from "./vue-i18n-CRix8f2i.js";
21
+ import { F as zt } from "./inventory-core-dart.default-DsrlA0VP.js";
22
22
  import { _ as Ot } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js";
23
- import { u as We } from "./feature-yi8Tnb7H.js";
24
- import { F as he } from "./decimal-naJvMnG2.js";
25
- import { _ as Fe } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DJnbYUPk.js";
26
- import { b as at, d as st } from "./xlsx.util-BSJ5fdz4.js";
27
- import { f as dt } from "./date2-Bdr9V2CH.js";
23
+ import { u as We } from "./feature-Hkq4qHGO.js";
24
+ import { F as he } from "./decimal-C05Zbycy.js";
25
+ import { _ as Fe } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-6M_CG9Xi.js";
26
+ import { b as at, d as st } from "./xlsx.util-C-DEH9b0.js";
27
+ import { f as dt } from "./date2-DDlrt2dw.js";
28
28
  import { _ as Lt, F as Qe } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js";
29
- import { _ as jt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BmoeRycM.js";
29
+ import { _ as jt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-RH37--FG.js";
30
30
  const Kt = {
31
31
  key: 0,
32
32
  class: "flex flex-col items-center w-full h-full gap-24"
@@ -38,31 +38,31 @@ const Kt = {
38
38
  message: {},
39
39
  bindedItems: {}
40
40
  },
41
- setup(m) {
42
- const d = m, l = W(d.bindedItems || []), t = W(!1);
41
+ setup(p) {
42
+ const d = p, l = W(d.bindedItems || []), t = W(!1);
43
43
  pt(() => {
44
44
  i();
45
45
  });
46
46
  async function i() {
47
- var r, x;
48
- !t.value && ((r = d.data) != null && r._id) && (t.value = !0, l.value = await ne().getAffectedMenu((x = d.data) == null ? void 0 : x._id), t.value = !1);
47
+ var r, $;
48
+ !t.value && ((r = d.data) != null && r._id) && (t.value = !0, l.value = await ne().getAffectedMenu(($ = d.data) == null ? void 0 : $._id), t.value = !1);
49
49
  }
50
- return (r, x) => {
50
+ return (r, $) => {
51
51
  const u = G("FmSpacer"), o = G("FmCircularProgress");
52
- return y(), E(X, null, [
53
- v("p", null, U(r.message), 1),
54
- t.value ? (y(), E("div", Kt, [
55
- h(u),
56
- v("div", null, [
57
- h(o, { size: "xl" })
52
+ return v(), V(X, null, [
53
+ f("p", null, U(r.message), 1),
54
+ t.value ? (v(), V("div", Kt, [
55
+ x(u),
56
+ f("div", null, [
57
+ x(o, { size: "xl" })
58
58
  ]),
59
- x[0] || (x[0] = v("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
60
- h(u)
61
- ])) : (y(), E("div", qt, [
62
- x[2] || (x[2] = v("br", null, null, -1)),
63
- l.value.length > 0 ? (y(), E("div", Wt, [
64
- x[1] || (x[1] = v("p", { class: "fm-typo-en-body-lg-600" }, "Affected menu items:", -1)),
65
- h(nt, {
59
+ $[0] || ($[0] = f("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
60
+ x(u)
61
+ ])) : (v(), V("div", qt, [
62
+ $[2] || ($[2] = f("br", null, null, -1)),
63
+ l.value.length > 0 ? (v(), V("div", Wt, [
64
+ $[1] || ($[1] = f("p", { class: "fm-typo-en-body-lg-600" }, "Affected menu items:", -1)),
65
+ x(nt, {
66
66
  name: "Menu",
67
67
  bindings: l.value
68
68
  }, null, 8, ["bindings"])
@@ -73,27 +73,27 @@ const Kt = {
73
73
  }
74
74
  }), ze = ot("recipeForm", function() {
75
75
  const d = Le(), l = je(), t = ne(), i = W(!1), r = W();
76
- function x() {
76
+ function $() {
77
77
  const a = {
78
78
  recipe: {},
79
79
  mode: se.CREATE,
80
80
  show: !0,
81
- "onUpdate:show"(p) {
82
- r.value.show = p;
81
+ "onUpdate:show"(g) {
82
+ r.value.show = g;
83
83
  }
84
84
  };
85
85
  r.value = a;
86
86
  }
87
87
  async function u(a) {
88
- const p = {
88
+ const g = {
89
89
  recipe: Oe(a),
90
90
  mode: se.UPDATE,
91
91
  show: !0,
92
- "onUpdate:show"($) {
93
- r.value.show = $;
92
+ "onUpdate:show"(h) {
93
+ r.value.show = h;
94
94
  }
95
95
  };
96
- r.value = p;
96
+ r.value = g;
97
97
  }
98
98
  async function o(a) {
99
99
  i.value = !0;
@@ -103,20 +103,20 @@ const Kt = {
103
103
  message: `Deleted ${a.name}`,
104
104
  type: "success"
105
105
  });
106
- } catch (p) {
107
- if (p instanceof _t && $t(p)) {
106
+ } catch (g) {
107
+ if (g instanceof _t && $t(g)) {
108
108
  d.open({
109
109
  title: "Cannot delete recipe",
110
110
  contentComponent: It,
111
111
  contentComponentProps: {
112
112
  subject: (a == null ? void 0 : a.name) ?? "",
113
- items: p.errorResponse.errors.map(($) => {
113
+ items: g.errorResponse.errors.map((h) => {
114
114
  var C;
115
115
  return {
116
116
  chain: [
117
117
  {
118
- itemName: $.name,
119
- moduleKey: (C = $.message) != null && C.startsWith("modules.") ? wt($.message) : $.module
118
+ itemName: h.name,
119
+ moduleKey: (C = h.message) != null && C.startsWith("modules.") ? wt(h.message) : h.module
120
120
  }
121
121
  ]
122
122
  };
@@ -133,7 +133,7 @@ const Kt = {
133
133
  title: `Cannot delete ${a == null ? void 0 : a.name}`,
134
134
  message: "Please try again.",
135
135
  type: "error"
136
- }), console.error("failed to delete recipe", p);
136
+ }), console.error("failed to delete recipe", g);
137
137
  } finally {
138
138
  i.value = !1;
139
139
  }
@@ -160,7 +160,7 @@ const Kt = {
160
160
  }).onPrimary(() => o(a));
161
161
  }
162
162
  return {
163
- createRecipe: x,
163
+ createRecipe: $,
164
164
  updateRecipe: u,
165
165
  deleteRecipe: s,
166
166
  recipeDialogProps: r,
@@ -168,11 +168,11 @@ const Kt = {
168
168
  };
169
169
  });
170
170
  function Jt() {
171
- const { updateRecipe: m, deleteRecipe: d } = ze(), l = ne(), { t } = ie();
171
+ const { updateRecipe: p, deleteRecipe: d } = ze(), l = ne(), { t } = ie();
172
172
  async function i(o, s) {
173
173
  const a = Oe(s);
174
174
  if (o === Ve.Edit) {
175
- await m(a);
175
+ await p(a);
176
176
  return;
177
177
  }
178
178
  if (o === Ve.Delete) {
@@ -181,18 +181,18 @@ function Jt() {
181
181
  }
182
182
  }
183
183
  function r(o, s) {
184
- const a = o.filter((C) => C.type === be.enum.SKU), p = o.filter(
184
+ const a = o.filter((C) => C.type === be.enum.SKU), g = o.filter(
185
185
  (C) => C.type === be.enum.SKU_GROUP
186
- ), $ = o.filter((C) => C.type === be.enum.RECIPE);
186
+ ), h = o.filter((C) => C.type === be.enum.RECIPE);
187
187
  return [
188
188
  ...a.map((C) => ({ ...C, recipeIds: [...s] })),
189
- ...p.map((C) => ({ ...C, isGroup: !0, recipeIds: [...s] })),
190
- ...$.filter((C) => l.recipeById[C.id] && !s.has(C.id)).flatMap(
189
+ ...g.map((C) => ({ ...C, isGroup: !0, recipeIds: [...s] })),
190
+ ...h.filter((C) => l.recipeById[C.id] && !s.has(C.id)).flatMap(
191
191
  (C) => r(l.recipeById[C.id].contains, /* @__PURE__ */ new Set([...s, C.id]))
192
192
  )
193
193
  ];
194
194
  }
195
- const x = [
195
+ const $ = [
196
196
  {
197
197
  accessorKey: "recipe",
198
198
  header: () => t("inventory.recipe.name"),
@@ -226,41 +226,41 @@ function Jt() {
226
226
  const s = ne();
227
227
  return o.map((a) => ({
228
228
  recipe: a.name,
229
- ingredients: r(a.contains, /* @__PURE__ */ new Set([a._id])).map((p) => {
230
- var C, I, f, k, S, b;
231
- if (p.isGroup) {
232
- const e = s.skuGroupById[p.id];
233
- return p.recipeIds.slice(1).length ? `(${(C = s.recipeById[p.recipeIds.at(-1) ?? ""]) == null ? void 0 : C.name}) ${e.name} (x ${Q(p.amount)})` : `${e.name} (x${Q(p.amount)})`;
229
+ ingredients: r(a.contains, /* @__PURE__ */ new Set([a._id])).map((g) => {
230
+ var C, I, m, _, w, y;
231
+ if (g.isGroup) {
232
+ const e = s.skuGroupById[g.id];
233
+ return g.recipeIds.slice(1).length ? `(${(C = s.recipeById[g.recipeIds.at(-1) ?? ""]) == null ? void 0 : C.name}) ${e.name} (x ${Q(g.amount)})` : `${e.name} (x${Q(g.amount)})`;
234
234
  }
235
- const $ = s.skuById[p.id];
236
- return $ ? p.recipeIds.slice(1).length ? `(${(I = s.recipeById[p.recipeIds.at(-1) ?? ""]) == null ? void 0 : I.name}) ${$.name} (${Q(p.amount)}${((f = p.measurement) == null ? void 0 : f.abbrev) ?? ((k = $ == null ? void 0 : $.unit) == null ? void 0 : k.abbrev)})` : `${$.name} (${Q(p.amount)}${((S = p.measurement) == null ? void 0 : S.abbrev) ?? ((b = $ == null ? void 0 : $.unit) == null ? void 0 : b.abbrev)})` : null;
237
- }).filter((p) => p).join(", "),
235
+ const h = s.skuById[g.id];
236
+ return h ? g.recipeIds.slice(1).length ? `(${(I = s.recipeById[g.recipeIds.at(-1) ?? ""]) == null ? void 0 : I.name}) ${h.name} (${Q(g.amount)}${((m = g.measurement) == null ? void 0 : m.abbrev) ?? ((_ = h == null ? void 0 : h.unit) == null ? void 0 : _.abbrev)})` : `${h.name} (${Q(g.amount)}${((w = g.measurement) == null ? void 0 : w.abbrev) ?? ((y = h == null ? void 0 : h.unit) == null ? void 0 : y.abbrev)})` : null;
237
+ }).filter((g) => g).join(", "),
238
238
  original: a
239
239
  }));
240
240
  }
241
- return { columnDefs: x, formatRowData: u };
241
+ return { columnDefs: $, formatRowData: u };
242
242
  }
243
243
  function Ht() {
244
- const m = ne(), d = Le();
245
- async function l(r, x, u, o = []) {
246
- var I, f;
247
- const s = r.filter((k) => k.type === "SKU"), a = r.filter((k) => k.type !== "SKU"), p = /* @__PURE__ */ new Set();
244
+ const p = ne(), d = Le();
245
+ async function l(r, $, u, o = []) {
246
+ var I, m;
247
+ const s = r.filter((_) => _.type === "SKU"), a = r.filter((_) => _.type !== "SKU"), g = /* @__PURE__ */ new Set();
248
248
  if (u)
249
- for (const k of m.skus)
250
- !o.some((b) => b === k._id) && k._id !== u && !((f = (I = k.convert) == null ? void 0 : I.inventoryBindings) != null && f.some((b) => b.id === u)) || p.add(k._id);
251
- const $ = m.skus.map((k) => ({
252
- label: k.name,
253
- sublabel: `${k.code}${p.has(k._id) ? " (Cannot bind, will cause recursive binding)" : ""}`,
254
- value: k,
255
- disabled: p.has(k._id)
256
- })), C = $.filter(
257
- (k) => s.find((S) => S.id === k.value._id) && !p.has(k.value._id)
258
- ).map((k) => k.value);
249
+ for (const _ of p.skus)
250
+ !o.some((y) => y === _._id) && _._id !== u && !((m = (I = _.convert) == null ? void 0 : I.inventoryBindings) != null && m.some((y) => y.id === u)) || g.add(_._id);
251
+ const h = p.skus.map((_) => ({
252
+ label: _.name,
253
+ sublabel: `${_.code}${g.has(_._id) ? " (Cannot bind, will cause recursive binding)" : ""}`,
254
+ value: _,
255
+ disabled: g.has(_._id)
256
+ })), C = h.filter(
257
+ (_) => s.find((w) => w.id === _.value._id) && !g.has(_.value._id)
258
+ ).map((_) => _.value);
259
259
  d.open({
260
260
  title: "Select ingredients",
261
261
  contentComponent: Pe,
262
262
  contentComponentProps: {
263
- items: $,
263
+ items: h,
264
264
  modelValue: C,
265
265
  virtualScroll: !0
266
266
  },
@@ -273,48 +273,48 @@ function Ht() {
273
273
  close: !0,
274
274
  variant: "tertiary"
275
275
  }
276
- }).onPrimary((k) => {
277
- const S = [
276
+ }).onPrimary((_) => {
277
+ const w = [
278
278
  ...a,
279
- ...r.filter((b) => k.find((e) => e._id === b.id)),
280
- ...k.filter((b) => !r.find((e) => e.id === b._id)).map((b) => ({
279
+ ...r.filter((y) => _.find((e) => e._id === y.id)),
280
+ ..._.filter((y) => !r.find((e) => e.id === y._id)).map((y) => ({
281
281
  type: "SKU",
282
- id: b._id,
282
+ id: y._id,
283
283
  amount: {
284
284
  amount: 1,
285
285
  precision: 0
286
286
  }
287
287
  }))
288
288
  ];
289
- x(S);
289
+ $(w);
290
290
  });
291
291
  }
292
- async function t(r, x, u = []) {
292
+ async function t(r, $, u = []) {
293
293
  var C;
294
294
  const o = r.filter((I) => I.type === "RECIPE"), s = r.filter((I) => I.type !== "RECIPE"), a = /* @__PURE__ */ new Set();
295
295
  if (u.length)
296
- for (const I of m.recipes) {
297
- const f = ((C = m.recipeBindingFlattenCache[I._id]) == null ? void 0 : C.inventoryBindings) ?? [], k = f.some(
298
- (e) => e.bindingPaths.some((V) => u.some((c) => c === V.id))
299
- ), S = f.some(
296
+ for (const I of p.recipes) {
297
+ const m = ((C = p.recipeBindingFlattenCache[I._id]) == null ? void 0 : C.inventoryBindings) ?? [], _ = m.some(
298
+ (e) => e.bindingPaths.some((S) => u.some((c) => c === S.id))
299
+ ), w = m.some(
300
300
  (e) => "success" in e && u.includes(e.ingredient._id)
301
301
  );
302
- (u.some((e) => e === I._id) || k || S) && a.add(I._id);
302
+ (u.some((e) => e === I._id) || _ || w) && a.add(I._id);
303
303
  }
304
- const p = m.recipes.filter((I) => !u.includes(I._id)).map((I) => ({
304
+ const g = p.recipes.filter((I) => !u.includes(I._id)).map((I) => ({
305
305
  label: I.name,
306
306
  sublabel: a.has(I._id) ? "(Cannot bind, will cause recursive binding)" : `${I.contains.length} inventory bindings`,
307
307
  value: I,
308
308
  disabled: a.has(I._id)
309
- })), $ = p.filter(
310
- (I) => o.find((f) => f.id === I.value._id) && !a.has(I.value._id)
309
+ })), h = g.filter(
310
+ (I) => o.find((m) => m.id === I.value._id) && !a.has(I.value._id)
311
311
  ).map((I) => I.value);
312
312
  d.open({
313
313
  title: "Select recipes",
314
314
  contentComponent: Pe,
315
315
  contentComponentProps: {
316
- items: p,
317
- modelValue: $,
316
+ items: g,
317
+ modelValue: h,
318
318
  virtualScroll: !0
319
319
  },
320
320
  primaryActions: {
@@ -327,11 +327,11 @@ function Ht() {
327
327
  variant: "tertiary"
328
328
  }
329
329
  }).onPrimary((I) => {
330
- const f = [
331
- ...r.filter((k) => I.find((S) => S._id === k.id)),
332
- ...I.filter((k) => !r.find((S) => S.id === k._id)).map((k) => ({
330
+ const m = [
331
+ ...r.filter((_) => I.find((w) => w._id === _.id)),
332
+ ...I.filter((_) => !r.find((w) => w.id === _._id)).map((_) => ({
333
333
  type: "RECIPE",
334
- id: k._id,
334
+ id: _._id,
335
335
  amount: {
336
336
  amount: 1,
337
337
  precision: 0
@@ -339,20 +339,20 @@ function Ht() {
339
339
  })),
340
340
  ...s
341
341
  ];
342
- x(f);
342
+ $(m);
343
343
  });
344
344
  }
345
- async function i(r, x, u = []) {
346
- const o = r.filter(($) => $.type === "SKU_GROUP"), s = r.filter(($) => $.type !== "SKU_GROUP"), a = m.skuGroups.filter(($) => !u.includes($._id)).map(($) => ({
347
- label: $.name,
348
- value: $
349
- })), p = a.filter(($) => o.find((C) => C.id === $.value._id)).map(($) => $.value);
345
+ async function i(r, $, u = []) {
346
+ const o = r.filter((h) => h.type === "SKU_GROUP"), s = r.filter((h) => h.type !== "SKU_GROUP"), a = p.skuGroups.filter((h) => !u.includes(h._id)).map((h) => ({
347
+ label: h.name,
348
+ value: h
349
+ })), g = a.filter((h) => o.find((C) => C.id === h.value._id)).map((h) => h.value);
350
350
  d.open({
351
351
  title: "Select ingredient group",
352
352
  contentComponent: Pe,
353
353
  contentComponentProps: {
354
354
  items: a,
355
- modelValue: p,
355
+ modelValue: g,
356
356
  virtualScroll: !0
357
357
  },
358
358
  primaryActions: {
@@ -364,10 +364,10 @@ function Ht() {
364
364
  close: !0,
365
365
  variant: "tertiary"
366
366
  }
367
- }).onPrimary(($) => {
367
+ }).onPrimary((h) => {
368
368
  const C = [
369
- ...r.filter((I) => $.find((f) => f._id === I.id)),
370
- ...$.filter((I) => !r.find((f) => f.id === I._id)).map((I) => ({
369
+ ...r.filter((I) => h.find((m) => m._id === I.id)),
370
+ ...h.filter((I) => !r.find((m) => m.id === I._id)).map((I) => ({
371
371
  type: "SKU_GROUP",
372
372
  id: I._id,
373
373
  amount: {
@@ -377,7 +377,7 @@ function Ht() {
377
377
  })),
378
378
  ...s
379
379
  ];
380
- x(C);
380
+ $(C);
381
381
  });
382
382
  }
383
383
  return {
@@ -395,65 +395,78 @@ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re
395
395
  maxCount: {}
396
396
  },
397
397
  emits: ["update:modelValue"],
398
- setup(m, { emit: d }) {
399
- const l = m, t = d, { t: i } = ie(), r = St(), x = tt(), u = A(() => {
400
- var C;
401
- const p = /* @__PURE__ */ new Map(), $ = r.restaurants.value.map((I) => I.customAttributes ?? {});
402
- for (const I of $)
403
- for (const [f, k] of Object.entries(I))
404
- p.has(f) || p.set(f, /* @__PURE__ */ new Set()), k && ((C = p.get(f)) == null || C.add(k));
405
- return p;
406
- }), o = A(() => [
407
- ...[...u.value.entries()].map(([$, C]) => ({
398
+ setup(p, { emit: d }) {
399
+ const l = p, t = d, { t: i } = ie(), r = St(), $ = tt(), u = R(() => {
400
+ var I;
401
+ const h = /* @__PURE__ */ new Map(), C = r.restaurants.value.map((m) => m.customAttributes ?? {});
402
+ for (const m of C)
403
+ for (const [_, w] of Object.entries(m))
404
+ h.has(_) || h.set(_, /* @__PURE__ */ new Set()), w && ((I = h.get(_)) == null || I.add(w));
405
+ return h;
406
+ }), o = R(
407
+ () => r.restaurants.value.filter((h) => {
408
+ var C;
409
+ return (C = h.profile) == null ? void 0 : C.code;
410
+ }).map((h) => ({ value: h.profile.code, label: `${h.profile.name} (${h.profile.code})` }))
411
+ ), s = R(() => [
412
+ ...[...u.value.entries()].map(([C, I]) => ({
408
413
  type: "string",
409
- key: $,
414
+ key: C,
410
415
  entity: "restaurant",
411
- values: [...C]
416
+ values: [...I]
412
417
  })),
413
418
  {
414
419
  type: "string",
415
420
  key: "state",
416
421
  entity: "restaurant",
417
- values: [...new Set(
418
- x.locations.map(($) => $.doc.profile.address.state).filter(Boolean)
419
- )]
420
- }
421
- ]), s = W(null);
422
- let a = null;
422
+ values: [
423
+ ...new Set($.locations.map((C) => C.doc.profile.address.state).filter(Boolean))
424
+ ]
425
+ },
426
+ ...o.value.length > 0 ? [
427
+ {
428
+ type: "string",
429
+ key: "outlet",
430
+ entity: "restaurant",
431
+ options: o.value
432
+ }
433
+ ] : []
434
+ ]), a = W(null);
435
+ let g = null;
423
436
  return ue(
424
437
  () => l.modelValue,
425
- (p) => {
426
- JSON.stringify(p) !== JSON.stringify(a) && (s.value = p ? Tt.build(p) : null);
438
+ (h) => {
439
+ JSON.stringify(h) !== JSON.stringify(g) && (a.value = h ? Tt.build(h) : null);
427
440
  },
428
441
  { immediate: !0 }
429
442
  ), ue(
430
- s,
431
- (p) => {
432
- a = p ? Ut.build(p) : null, t("update:modelValue", a);
443
+ a,
444
+ (h) => {
445
+ g = h ? Ut.build(h) : null, t("update:modelValue", g);
433
446
  },
434
447
  { deep: !0 }
435
- ), (p, $) => {
436
- const C = G("FmLabel"), I = G("FmFormGroup");
437
- return y(), E("div", Qt, [
438
- v("div", Xt, [
439
- h(C, {
448
+ ), (h, C) => {
449
+ const I = G("FmLabel"), m = G("FmFormGroup");
450
+ return v(), V("div", Qt, [
451
+ f("div", Xt, [
452
+ x(I, {
440
453
  label: n(i)("inventory.ingredientGroup.form.rules.title"),
441
- required: p.minCount != null && p.minCount > 0
454
+ required: h.minCount != null && h.minCount > 0
442
455
  }, null, 8, ["label", "required"]),
443
- h(n(Pt), {
444
- modelValue: s.value,
445
- "onUpdate:modelValue": $[0] || ($[0] = (f) => s.value = f),
446
- attributes: o.value
456
+ x(n(Pt), {
457
+ modelValue: a.value,
458
+ "onUpdate:modelValue": C[0] || (C[0] = (_) => a.value = _),
459
+ attributes: s.value
447
460
  }, null, 8, ["modelValue", "attributes"])
448
461
  ]),
449
- h(I, {
450
- "model-value": s.value,
462
+ x(m, {
463
+ "model-value": a.value,
451
464
  rules: [
452
- (f) => {
453
- const k = f ? 1 : 0;
454
- return l.minCount !== void 0 && k < l.minCount ? n(i)("inventory.ingredientGroup.form.rules.validation.minCount", {
465
+ (_) => {
466
+ const w = _ ? 1 : 0;
467
+ return l.minCount !== void 0 && w < l.minCount ? n(i)("inventory.ingredientGroup.form.rules.validation.minCount", {
455
468
  count: l.minCount
456
- }) : l.maxCount !== void 0 && k > l.maxCount ? n(i)("inventory.ingredientGroup.form.rules.validation.maxCount", {
469
+ }) : l.maxCount !== void 0 && w > l.maxCount ? n(i)("inventory.ingredientGroup.form.rules.validation.maxCount", {
457
470
  count: l.maxCount
458
471
  }) : !0;
459
472
  }
@@ -481,8 +494,8 @@ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re
481
494
  showError: { type: Boolean }
482
495
  },
483
496
  emits: ["update:modelValue", "delete", "settings"],
484
- setup(m, { emit: d }) {
485
- const l = d, { t } = ie(), i = rt("modelValue"), r = W(""), x = A(() => +Q(i.amount));
497
+ setup(p, { emit: d }) {
498
+ const l = d, { t } = ie(), i = rt("modelValue"), r = W(""), $ = R(() => +Q(i.amount));
486
499
  ue(
487
500
  () => i.amount,
488
501
  (s) => {
@@ -499,43 +512,43 @@ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re
499
512
  }, 300);
500
513
  }
501
514
  return (s, a) => {
502
- const p = G("FmTooltip"), $ = G("FmTextField"), C = G("FmButton"), I = G("FmIcon"), f = G("FmFormGroup");
503
- return y(), E("div", Zt, [
504
- h(f, {
515
+ const g = G("FmTooltip"), h = G("FmTextField"), C = G("FmButton"), I = G("FmIcon"), m = G("FmFormGroup");
516
+ return v(), V("div", Zt, [
517
+ x(m, {
505
518
  class: Ce(["mb-2"]),
506
519
  disabled: s.disabled,
507
- modelValue: x.value,
520
+ modelValue: $.value,
508
521
  rules: [n(it)(0), n(qe)(-1)]
509
522
  }, {
510
- default: J(({ invalid: k }) => [
511
- v("div", en, [
512
- v("div", tn, [
513
- v("div", nn, [
514
- v("div", on, [
515
- h(p, {
523
+ default: J(({ invalid: _ }) => [
524
+ f("div", en, [
525
+ f("div", tn, [
526
+ f("div", nn, [
527
+ f("div", on, [
528
+ x(g, {
516
529
  zIndex: 51,
517
530
  variant: "plain",
518
531
  placement: "top",
519
532
  content: s.displayName
520
533
  }, {
521
534
  default: J(() => [
522
- v("span", ln, U(s.displayName), 1)
535
+ f("span", ln, U(s.displayName), 1)
523
536
  ]),
524
537
  _: 1
525
538
  }, 8, ["content"])
526
539
  ])
527
540
  ]),
528
- v("div", rn, [
529
- h($, {
541
+ f("div", rn, [
542
+ x(h, {
530
543
  class: "w-full",
531
544
  disabled: s.disabled,
532
545
  modelValue: r.value,
533
- "onUpdate:modelValue": a[0] || (a[0] = (S) => o(S)),
534
- invalid: k
546
+ "onUpdate:modelValue": a[0] || (a[0] = (w) => o(w)),
547
+ invalid: _
535
548
  }, null, 8, ["disabled", "modelValue", "invalid"])
536
549
  ]),
537
- s.readonly ? T("", !0) : (y(), E("div", an, [
538
- h(C, {
550
+ s.readonly ? T("", !0) : (v(), V("div", an, [
551
+ x(C, {
539
552
  disabled: s.disabled,
540
553
  type: "button",
541
554
  variant: "plain",
@@ -545,22 +558,22 @@ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re
545
558
  }, null, 8, ["disabled"])
546
559
  ]))
547
560
  ]),
548
- s.showError ? (y(), E("div", sn, [
549
- h(I, {
561
+ s.showError ? (v(), V("div", sn, [
562
+ x(I, {
550
563
  name: "error",
551
564
  color: "system-error-300",
552
565
  size: "sm"
553
566
  }),
554
- v("div", null, U(n(t)("inventory.inventoryBindings.circularError")), 1)
567
+ f("div", null, U(n(t)("inventory.inventoryBindings.circularError")), 1)
555
568
  ])) : T("", !0)
556
569
  ])
557
570
  ]),
558
571
  _: 1
559
572
  }, 8, ["disabled", "modelValue", "rules"]),
560
- v("div", dn, [
561
- h(Re, {
573
+ f("div", dn, [
574
+ x(Re, {
562
575
  modelValue: n(i).rules,
563
- "onUpdate:modelValue": a[2] || (a[2] = (k) => n(i).rules = k),
576
+ "onUpdate:modelValue": a[2] || (a[2] = (_) => n(i).rules = _),
564
577
  disabled: s.disabled
565
578
  }, null, 8, ["modelValue", "disabled"])
566
579
  ])
@@ -568,8 +581,8 @@ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re
568
581
  };
569
582
  }
570
583
  });
571
- function cn(m) {
572
- const d = Gt(), { t: l } = Nt(), t = ne(), i = A(() => [
584
+ function cn(p) {
585
+ const d = Gt(), { t: l } = Nt(), t = ne(), i = R(() => [
573
586
  {
574
587
  id: "delete",
575
588
  header: "",
@@ -585,9 +598,9 @@ function cn(m) {
585
598
  icon: "delete",
586
599
  variant: "tertiary",
587
600
  size: "md",
588
- disabled: m.disabled ?? !1,
601
+ disabled: p.disabled ?? !1,
589
602
  onClick: () => {
590
- m.bindingAlternatives = m.bindingAlternatives.filter(
603
+ p.bindingAlternatives = p.bindingAlternatives.filter(
591
604
  (s) => s._id !== o._id
592
605
  );
593
606
  }
@@ -661,9 +674,9 @@ function cn(m) {
661
674
  return de(_e.FmSelect, {
662
675
  modelValue: u.row.original.trackingMeasurement ?? null,
663
676
  items: s,
664
- disabled: m.disabled ?? !1,
677
+ disabled: p.disabled ?? !1,
665
678
  "onUpdate:modelValue": (a) => {
666
- m.bindingAlternatives = m.bindingAlternatives.map((p) => p._id === u.row.original._id ? { ...p, trackingMeasurement: a } : p);
679
+ p.bindingAlternatives = p.bindingAlternatives.map((g) => g._id === u.row.original._id ? { ...g, trackingMeasurement: a } : g);
667
680
  }
668
681
  });
669
682
  },
@@ -682,7 +695,7 @@ function cn(m) {
682
695
  Ft(),
683
696
  Ne(1),
684
697
  lt(
685
- m.bindingAlternatives.filter((s) => s._id !== o._id).map((s) => {
698
+ p.bindingAlternatives.filter((s) => s._id !== o._id).map((s) => {
686
699
  const a = t.skuById[s._id];
687
700
  return {
688
701
  label: a == null ? void 0 : a.name,
@@ -693,7 +706,7 @@ function cn(m) {
693
706
  ],
694
707
  "onUpdate:modelValue": (s) => {
695
708
  const a = Number(s);
696
- isNaN(a) || (m.bindingAlternatives = m.bindingAlternatives.map((p) => p._id === u.row.original._id ? { ...p, priority: a } : p));
709
+ isNaN(a) || (p.bindingAlternatives = p.bindingAlternatives.map((g) => g._id === u.row.original._id ? { ...g, priority: a } : g));
697
710
  }
698
711
  });
699
712
  }
@@ -707,9 +720,9 @@ function cn(m) {
707
720
  return o ? de(_e.FmCheckbox, {
708
721
  modelValue: u.row.original.default ?? !1,
709
722
  value: o._id,
710
- disabled: m.disabled ?? !1,
723
+ disabled: p.disabled ?? !1,
711
724
  "onUpdate:modelValue": () => {
712
- m.bindingAlternatives = m.bindingAlternatives.map((s) => s._id === u.row.original._id ? { ...s, default: !0 } : { ...s, default: !1 });
725
+ p.bindingAlternatives = p.bindingAlternatives.map((s) => s._id === u.row.original._id ? { ...s, default: !0 } : { ...s, default: !1 });
713
726
  }
714
727
  }) : null;
715
728
  },
@@ -732,14 +745,14 @@ function cn(m) {
732
745
  icon: "keyboard_arrow_up",
733
746
  variant: "tertiary",
734
747
  size: "md",
735
- disabled: m.disabled ?? !1,
748
+ disabled: p.disabled ?? !1,
736
749
  onClick: () => {
737
- const s = [...m.bindingAlternatives], a = s.findIndex((p) => p._id === o._id);
750
+ const s = [...p.bindingAlternatives], a = s.findIndex((g) => g._id === o._id);
738
751
  if (a > 0) {
739
- const p = s[a - 1];
740
- s[a - 1] = o, s[a] = p;
752
+ const g = s[a - 1];
753
+ s[a - 1] = o, s[a] = g;
741
754
  }
742
- m.bindingAlternatives = [...s];
755
+ p.bindingAlternatives = [...s];
743
756
  }
744
757
  }),
745
758
  de(_e.FmButton, {
@@ -748,14 +761,14 @@ function cn(m) {
748
761
  icon: "keyboard_arrow_down",
749
762
  variant: "tertiary",
750
763
  size: "md",
751
- disabled: m.disabled ?? !1,
764
+ disabled: p.disabled ?? !1,
752
765
  onClick: () => {
753
- const s = [...m.bindingAlternatives], a = s.findIndex((p) => p._id === o._id);
766
+ const s = [...p.bindingAlternatives], a = s.findIndex((g) => g._id === o._id);
754
767
  if (a < s.length - 1) {
755
- const p = s[a + 1];
756
- s[a + 1] = o, s[a] = p;
768
+ const g = s[a + 1];
769
+ s[a + 1] = o, s[a] = g;
757
770
  }
758
- m.bindingAlternatives = [...s];
771
+ p.bindingAlternatives = [...s];
759
772
  }
760
773
  })
761
774
  ]);
@@ -772,26 +785,26 @@ function cn(m) {
772
785
  get columnDefs() {
773
786
  return i.value;
774
787
  },
775
- promptAddIngredient: async (x) => {
788
+ promptAddIngredient: async ($) => {
776
789
  const u = [];
777
790
  for (const a of t.skus)
778
- x.includes(a._id) || u.push({
791
+ $.includes(a._id) || u.push({
779
792
  label: a.name,
780
793
  sublabel: a.code,
781
794
  value: a._id,
782
- disabled: x.includes(a._id)
795
+ disabled: $.includes(a._id)
783
796
  });
784
- const o = (m.bindingAlternatives ?? []).map((a) => a._id), s = await d.multiSelect(u, o, (a) => {
785
- var $, C, I, f, k, S;
786
- const p = ($ = m.bindingAlternatives) == null ? void 0 : $.findIndex((b) => b._id === a);
797
+ const o = (p.bindingAlternatives ?? []).map((a) => a._id), s = await d.multiSelect(u, o, (a) => {
798
+ var h, C, I, m, _, w;
799
+ const g = (h = p.bindingAlternatives) == null ? void 0 : h.findIndex((y) => y._id === a);
787
800
  return {
788
801
  _id: a,
789
- trackingMeasurement: typeof p != "number" || p == -1 ? (C = t.skuById[a]) == null ? void 0 : C.trackingMeasurement : (f = (I = m.bindingAlternatives) == null ? void 0 : I[p]) == null ? void 0 : f.trackingMeasurement,
790
- priority: ((S = (k = m.bindingAlternatives) == null ? void 0 : k[p]) == null ? void 0 : S.priority) ?? m.bindingAlternatives.length,
802
+ trackingMeasurement: typeof g != "number" || g == -1 ? (C = t.skuById[a]) == null ? void 0 : C.trackingMeasurement : (m = (I = p.bindingAlternatives) == null ? void 0 : I[g]) == null ? void 0 : m.trackingMeasurement,
803
+ priority: ((w = (_ = p.bindingAlternatives) == null ? void 0 : _[g]) == null ? void 0 : w.priority) ?? p.bindingAlternatives.length,
791
804
  default: !1
792
805
  };
793
806
  });
794
- m.bindingAlternatives = s ?? m.bindingAlternatives;
807
+ p.bindingAlternatives = s ?? p.bindingAlternatives;
795
808
  },
796
809
  columnVisibility: {
797
810
  delete: !0,
@@ -813,8 +826,8 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
813
826
  filterIngredientIds: {}
814
827
  },
815
828
  emits: ["update:modelValue"],
816
- setup(m, { emit: d }) {
817
- const l = m, t = d, { t: i } = ie(), r = cn({
829
+ setup(p, { emit: d }) {
830
+ const l = p, t = d, { t: i } = ie(), r = cn({
818
831
  get disabled() {
819
832
  return l.disabled ?? !1;
820
833
  },
@@ -824,31 +837,31 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
824
837
  set bindingAlternatives(o) {
825
838
  t("update:modelValue", o);
826
839
  }
827
- }), x = (o) => o && o.some((s) => l.filterIngredientIds.includes(s._id)) ? "Contains invalid ingredient" : !0, u = (o) => o && o.length > 5 ? i("inventory.binding.alternative.maximumExceeded", { max: 5 }) : !0;
840
+ }), $ = (o) => o && o.some((s) => l.filterIngredientIds.includes(s._id)) ? "Contains invalid ingredient" : !0, u = (o) => o && o.length > 5 ? i("inventory.binding.alternative.maximumExceeded", { max: 5 }) : !0;
828
841
  return (o, s) => {
829
842
  var I;
830
- const a = G("FmLabel"), p = G("FmButton"), $ = G("FmFormGroup"), C = G("FmTable");
831
- return y(), E("div", pn, [
832
- v("div", mn, [
833
- v("div", fn, [
834
- h(a, {
843
+ const a = G("FmLabel"), g = G("FmButton"), h = G("FmFormGroup"), C = G("FmTable");
844
+ return v(), V("div", pn, [
845
+ f("div", mn, [
846
+ f("div", fn, [
847
+ x(a, {
835
848
  label: n(i)("inventory.alternatives")
836
849
  }, null, 8, ["label"]),
837
- h(p, {
850
+ x(g, {
838
851
  disabled: o.disabled,
839
852
  "prepend-icon": "link",
840
853
  variant: "primary",
841
854
  class: "border-1 rounded-lg border-fm-color-primary",
842
- onClick: s[0] || (s[0] = (f) => n(r).promptAddIngredient(o.filterIngredientIds)),
855
+ onClick: s[0] || (s[0] = (m) => n(r).promptAddIngredient(o.filterIngredientIds)),
843
856
  size: "md"
844
857
  }, null, 8, ["disabled"])
845
858
  ]),
846
- h($, {
859
+ x(h, {
847
860
  "model-value": o.modelValue,
848
- rules: [x, u]
861
+ rules: [$, u]
849
862
  }, null, 8, ["model-value", "rules"])
850
863
  ]),
851
- h(C, {
864
+ x(C, {
852
865
  "row-data": o.modelValue ?? [],
853
866
  "column-defs": n(r).columnDefs,
854
867
  "page-size": ((I = o.modelValue) == null ? void 0 : I.length) || 0,
@@ -878,12 +891,12 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
878
891
  ableToApplyRules: { type: Boolean }
879
892
  },
880
893
  emits: ["update:modelValue", "delete", "settings"],
881
- setup(m, { emit: d }) {
894
+ setup(p, { emit: d }) {
882
895
  const l = d, { t } = ie(), i = rt("modelValue");
883
896
  function r(u) {
884
897
  u && (i.amount = u.amount, i.measurement = u.measurement);
885
898
  }
886
- function x() {
899
+ function $() {
887
900
  return {
888
901
  modelValue: {
889
902
  amount: i.amount,
@@ -895,25 +908,25 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
895
908
  };
896
909
  }
897
910
  return (u, o) => {
898
- const s = G("FmTooltip"), a = G("FmButton"), p = G("FmFormGroup");
899
- return y(), E("div", vn, [
900
- v("div", yn, [
901
- v("div", bn, [
902
- v("div", gn, [
903
- h(s, {
911
+ const s = G("FmTooltip"), a = G("FmButton"), g = G("FmFormGroup");
912
+ return v(), V("div", vn, [
913
+ f("div", yn, [
914
+ f("div", bn, [
915
+ f("div", gn, [
916
+ x(s, {
904
917
  zIndex: 51,
905
918
  variant: "plain",
906
919
  placement: "top",
907
920
  content: u.displayName
908
921
  }, {
909
922
  default: J(() => [
910
- v("span", _n, U(u.displayName), 1)
923
+ f("span", _n, U(u.displayName), 1)
911
924
  ]),
912
925
  _: 1
913
926
  }, 8, ["content"])
914
927
  ]),
915
- v("div", kn, [
916
- h(Be, {
928
+ f("div", kn, [
929
+ x(Be, {
917
930
  "model-value": { amount: n(i).amount, measurement: n(i).measurement },
918
931
  "onUpdate:modelValue": r,
919
932
  unit: u.unit,
@@ -922,8 +935,8 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
922
935
  disabled: u.readonly
923
936
  }, null, 8, ["model-value", "unit", "disabled"])
924
937
  ]),
925
- u.readonly ? T("", !0) : (y(), E("div", hn, [
926
- h(a, {
938
+ u.readonly ? T("", !0) : (v(), V("div", hn, [
939
+ x(a, {
927
940
  disabled: u.disabled,
928
941
  type: "button",
929
942
  variant: "tertiary",
@@ -932,13 +945,13 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
932
945
  }, null, 8, ["disabled"])
933
946
  ]))
934
947
  ]),
935
- v("div", xn, [
936
- h(p, {
948
+ f("div", xn, [
949
+ x(g, {
937
950
  modelValue: n(i).amount,
938
951
  rules: [n(qe)(0)]
939
952
  }, null, 8, ["modelValue", "rules"]),
940
- h(p, {
941
- modelValue: x(),
953
+ x(g, {
954
+ modelValue: $(),
942
955
  rules: [
943
956
  n(Mt)(),
944
957
  n(Dt)(u.unit),
@@ -946,16 +959,16 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
946
959
  ]
947
960
  }, null, 8, ["modelValue", "rules"])
948
961
  ]),
949
- u.ableToApplyRules ? (y(), Y(Re, {
962
+ u.ableToApplyRules ? (v(), Y(Re, {
950
963
  key: 0,
951
964
  modelValue: n(i).rules,
952
- "onUpdate:modelValue": o[1] || (o[1] = ($) => n(i).rules = $),
965
+ "onUpdate:modelValue": o[1] || (o[1] = (h) => n(i).rules = h),
953
966
  disabled: u.disabled
954
967
  }, null, 8, ["modelValue", "disabled"])) : T("", !0),
955
- u.ableToConfigureAlternative ? (y(), Y(Se, {
968
+ u.ableToConfigureAlternative ? (v(), Y(Se, {
956
969
  key: 1,
957
970
  modelValue: n(i).alternatives,
958
- "onUpdate:modelValue": o[2] || (o[2] = ($) => n(i).alternatives = $),
971
+ "onUpdate:modelValue": o[2] || (o[2] = (h) => n(i).alternatives = h),
959
972
  disabled: u.disabled,
960
973
  filterIngredientIds: [n(i).id]
961
974
  }, null, 8, ["modelValue", "disabled", "filterIngredientIds"])) : T("", !0)
@@ -1017,8 +1030,8 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1017
1030
  enableIngredientGroup: { type: Boolean }
1018
1031
  },
1019
1032
  emits: ["update:modelValue", "click:pick-inventory-bindings"],
1020
- setup(m, { emit: d }) {
1021
- const { t: l } = ie(), t = ne(), i = A(() => t.recipeById), r = A(() => t.skuById), x = A(() => t.skuGroupById), u = m, o = d, s = A(() => kt({
1033
+ setup(p, { emit: d }) {
1034
+ const { t: l } = ie(), t = ne(), i = R(() => t.recipeById), r = R(() => t.skuById), $ = R(() => t.skuGroupById), u = p, o = d, s = R(() => kt({
1022
1035
  parentId: u.id,
1023
1036
  bindings: u.modelValue,
1024
1037
  recipes: t.recipes.map((F) => F._id === u.id ? {
@@ -1032,178 +1045,178 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1032
1045
  }
1033
1046
  } : F),
1034
1047
  skuGroups: t.skuGroups
1035
- }).inventoryBindings.filter((F) => "error" in F && F.error).map((F) => F).filter((F) => F.reason === ht.enum.circularDependency)), a = A(
1036
- () => new Set(s.value.map((g) => {
1048
+ }).inventoryBindings.filter((F) => "error" in F && F.error).map((F) => F).filter((F) => F.reason === ht.enum.circularDependency)), a = R(
1049
+ () => new Set(s.value.map((b) => {
1037
1050
  var B;
1038
- return (B = g.bindingPaths[0]) == null ? void 0 : B.id;
1051
+ return (B = b.bindingPaths[0]) == null ? void 0 : B.id;
1039
1052
  }))
1040
- ), p = A(() => u.modelValue.filter((g) => g.type === "RECIPE")), { promptIngredientsBinding: $, promptRecipesBinding: C, promptIngredientGroupsBinding: I } = Ht();
1041
- async function f() {
1053
+ ), g = R(() => u.modelValue.filter((b) => b.type === "RECIPE")), { promptIngredientsBinding: h, promptRecipesBinding: C, promptIngredientGroupsBinding: I } = Ht();
1054
+ async function m() {
1042
1055
  if (u.iframeMode) {
1043
1056
  o("click:pick-inventory-bindings", "RECIPE");
1044
1057
  return;
1045
1058
  }
1046
1059
  C(
1047
1060
  u.modelValue,
1048
- (g) => o("update:modelValue", g),
1061
+ (b) => o("update:modelValue", b),
1049
1062
  u.id ? [u.id] : []
1050
1063
  );
1051
1064
  }
1052
- const k = A(() => u.modelValue.filter((g) => g.type === "SKU_GROUP"));
1053
- async function S() {
1065
+ const _ = R(() => u.modelValue.filter((b) => b.type === "SKU_GROUP"));
1066
+ async function w() {
1054
1067
  I(
1055
1068
  u.modelValue,
1056
- (g) => o("update:modelValue", g),
1069
+ (b) => o("update:modelValue", b),
1057
1070
  u.id ? [u.id] : []
1058
1071
  );
1059
1072
  }
1060
- function b(g, B, F) {
1061
- const R = +B;
1073
+ function y(b, B, F) {
1074
+ const A = +B;
1062
1075
  let P = F;
1063
- B.length > 0 && isFinite(R) ? P = F.map((K) => (K.id !== g || (K.amount = Ke(R)), K)) : P = F.map((K) => (K.id !== g || (K.amount = { amount: 0, precision: 0 }), K)), o("update:modelValue", P);
1076
+ B.length > 0 && isFinite(A) ? P = F.map((K) => (K.id !== b || (K.amount = Ke(A)), K)) : P = F.map((K) => (K.id !== b || (K.amount = { amount: 0, precision: 0 }), K)), o("update:modelValue", P);
1064
1077
  }
1065
- const e = A(() => u.modelValue.filter((g) => g.type === "SKU") ?? []);
1066
- async function V() {
1078
+ const e = R(() => u.modelValue.filter((b) => b.type === "SKU") ?? []);
1079
+ async function S() {
1067
1080
  if (u.iframeMode) {
1068
1081
  o("click:pick-inventory-bindings", "SKU");
1069
1082
  return;
1070
1083
  }
1071
- $(
1084
+ h(
1072
1085
  u.modelValue,
1073
- (g) => o("update:modelValue", g),
1086
+ (b) => o("update:modelValue", b),
1074
1087
  u.excludeBindingId,
1075
1088
  u.id ? [u.id] : []
1076
1089
  );
1077
1090
  }
1078
- function c(g) {
1079
- const B = u.modelValue.map((F) => F.id === g.id ? g : F);
1091
+ function c(b) {
1092
+ const B = u.modelValue.map((F) => F.id === b.id ? b : F);
1080
1093
  o("update:modelValue", B);
1081
1094
  }
1082
- function _(g) {
1083
- const B = u.modelValue.filter((F) => F.id !== g);
1095
+ function k(b) {
1096
+ const B = u.modelValue.filter((F) => F.id !== b);
1084
1097
  o("update:modelValue", B);
1085
1098
  }
1086
- function N(g) {
1087
- var F, R;
1088
- if (g.type !== be.enum.SKU)
1099
+ function N(b) {
1100
+ var F, A;
1101
+ if (b.type !== be.enum.SKU)
1089
1102
  throw new Error("Non-SKU binding does not have unit");
1090
- if (!((F = r.value[g.id]) == null ? void 0 : F.unit))
1091
- throw new Error(`Cannot find ingredient: ${g.id}`);
1092
- return (R = r.value[g.id]) == null ? void 0 : R.unit;
1103
+ if (!((F = r.value[b.id]) == null ? void 0 : F.unit))
1104
+ throw new Error(`Cannot find ingredient: ${b.id}`);
1105
+ return (A = r.value[b.id]) == null ? void 0 : A.unit;
1093
1106
  }
1094
- function z(g) {
1095
- return !r.value[g.id];
1107
+ function z(b) {
1108
+ return !r.value[b.id];
1096
1109
  }
1097
- return (g, B) => {
1110
+ return (b, B) => {
1098
1111
  var H, ee, O;
1099
- const F = G("FmFormGroup"), R = G("FmButton"), P = G("FmIcon"), K = G("FmTextField");
1100
- return y(), E("div", In, [
1101
- h(F, {
1102
- disabled: g.disabled,
1103
- "model-value": g.modelValue,
1112
+ const F = G("FmFormGroup"), A = G("FmButton"), P = G("FmIcon"), K = G("FmTextField");
1113
+ return v(), V("div", In, [
1114
+ x(F, {
1115
+ disabled: b.disabled,
1116
+ "model-value": b.modelValue,
1104
1117
  rules: [
1105
- ...g.rules,
1118
+ ...b.rules,
1106
1119
  () => s.value.length ? "There is a binding error in your configuration" : !0
1107
1120
  ]
1108
1121
  }, {
1109
1122
  label: J(() => B[4] || (B[4] = [
1110
- v("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Define the inventory bindings for this recipe or ingredient. ", -1)
1123
+ f("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Define the inventory bindings for this recipe or ingredient. ", -1)
1111
1124
  ])),
1112
1125
  _: 1
1113
1126
  }, 8, ["disabled", "model-value", "rules"]),
1114
- ((H = g.recipeBindingConfig) == null ? void 0 : H.enabled) !== !1 ? (y(), E("div", wn, [
1115
- v("div", En, [
1116
- v("div", Vn, U(n(l)("inventory.inventoryBindings.recipe")), 1),
1117
- g.readonly ? T("", !0) : (y(), Y(R, {
1127
+ ((H = b.recipeBindingConfig) == null ? void 0 : H.enabled) !== !1 ? (v(), V("div", wn, [
1128
+ f("div", En, [
1129
+ f("div", Vn, U(n(l)("inventory.inventoryBindings.recipe")), 1),
1130
+ b.readonly ? T("", !0) : (v(), Y(A, {
1118
1131
  key: 0,
1119
1132
  variant: "secondary",
1120
1133
  "text-color": "primary",
1121
1134
  "border-color": "primary",
1122
1135
  label: n(l)("inventory.inventoryBindings.linkRecipe"),
1123
1136
  "prepend-icon": "link",
1124
- onClick: f
1137
+ onClick: m
1125
1138
  }, null, 8, ["label"]))
1126
1139
  ]),
1127
- v("div", Sn, [
1128
- v("div", Cn, [
1129
- v("div", Bn, U(n(l)("inventory.inventoryBindings.recipe")), 1),
1130
- B[5] || (B[5] = v("div", { class: "w-[200px]" }, null, -1)),
1131
- g.recipeBindingConfig.ableToApplyRules ? (y(), E("div", Fn)) : T("", !0),
1132
- g.readonly ? T("", !0) : (y(), E("div", Rn))
1140
+ f("div", Sn, [
1141
+ f("div", Cn, [
1142
+ f("div", Bn, U(n(l)("inventory.inventoryBindings.recipe")), 1),
1143
+ B[5] || (B[5] = f("div", { class: "w-[200px]" }, null, -1)),
1144
+ b.recipeBindingConfig.ableToApplyRules ? (v(), V("div", Fn)) : T("", !0),
1145
+ b.readonly ? T("", !0) : (v(), V("div", Rn))
1133
1146
  ]),
1134
- (y(!0), E(X, null, me(p.value, (M) => {
1147
+ (v(!0), V(X, null, me(g.value, (M) => {
1135
1148
  var L;
1136
- return y(), Y(un, {
1149
+ return v(), Y(un, {
1137
1150
  key: M.id,
1138
1151
  "model-value": M,
1139
1152
  "display-name": (L = i.value[M.id]) == null ? void 0 : L.name,
1140
1153
  "show-error": a.value.has(M.id),
1141
- readonly: g.readonly,
1142
- disabled: g.disabled,
1154
+ readonly: b.readonly,
1155
+ disabled: b.disabled,
1143
1156
  "onUpdate:modelValue": B[0] || (B[0] = (q) => c(q)),
1144
- onDelete: B[1] || (B[1] = (q) => _(q))
1157
+ onDelete: B[1] || (B[1] = (q) => k(q))
1145
1158
  }, null, 8, ["model-value", "display-name", "show-error", "readonly", "disabled"]);
1146
1159
  }), 128))
1147
1160
  ])
1148
1161
  ])) : T("", !0),
1149
- g.enableIngredientGroup ? (y(), E("div", An, [
1150
- v("div", Tn, [
1151
- v("div", Un, U(n(l)("inventory.inventoryBindings.ingredientGroup")), 1),
1152
- g.readonly ? T("", !0) : (y(), Y(R, {
1162
+ b.enableIngredientGroup ? (v(), V("div", An, [
1163
+ f("div", Tn, [
1164
+ f("div", Un, U(n(l)("inventory.inventoryBindings.ingredientGroup")), 1),
1165
+ b.readonly ? T("", !0) : (v(), Y(A, {
1153
1166
  key: 0,
1154
1167
  variant: "secondary",
1155
1168
  "text-color": "primary",
1156
1169
  "border-color": "primary",
1157
1170
  label: n(l)("inventory.inventoryBindings.linkIngredientGroup"),
1158
1171
  "prepend-icon": "link",
1159
- onClick: S
1172
+ onClick: w
1160
1173
  }, null, 8, ["label"]))
1161
1174
  ]),
1162
- v("div", Pn, [
1163
- v("div", Mn, [
1164
- v("div", Dn, U(n(l)("inventory.inventoryBindings.ingredientGroup")), 1),
1165
- B[6] || (B[6] = v("div", { class: "w-[200px]" }, null, -1)),
1166
- B[7] || (B[7] = v("div", { class: "w-[52px]" }, null, -1))
1175
+ f("div", Pn, [
1176
+ f("div", Mn, [
1177
+ f("div", Dn, U(n(l)("inventory.inventoryBindings.ingredientGroup")), 1),
1178
+ B[6] || (B[6] = f("div", { class: "w-[200px]" }, null, -1)),
1179
+ B[7] || (B[7] = f("div", { class: "w-[52px]" }, null, -1))
1167
1180
  ]),
1168
- (y(!0), E(X, null, me(k.value, (M) => (y(), Y(F, {
1181
+ (v(!0), V(X, null, me(_.value, (M) => (v(), Y(F, {
1169
1182
  key: M.id,
1170
- disabled: g.disabled,
1183
+ disabled: b.disabled,
1171
1184
  modelValue: +n(Q)(M.amount ?? { amount: 1, precision: 0 }),
1172
1185
  rules: [n(it)(0), n(qe)(0)]
1173
1186
  }, {
1174
1187
  default: J(({ invalid: L }) => {
1175
1188
  var q;
1176
1189
  return [
1177
- v("div", Gn, [
1178
- a.value.has(M.id) ? (y(), E("div", Nn, [
1179
- h(P, {
1190
+ f("div", Gn, [
1191
+ a.value.has(M.id) ? (v(), V("div", Nn, [
1192
+ x(P, {
1180
1193
  name: "error",
1181
1194
  color: "system-error-300",
1182
1195
  size: "sm"
1183
1196
  }),
1184
- v("div", null, U(n(l)("inventory.inventoryBindings.circularError")), 1)
1197
+ f("div", null, U(n(l)("inventory.inventoryBindings.circularError")), 1)
1185
1198
  ])) : T("", !0),
1186
- v("div", zn, [
1187
- v("div", On, [
1188
- v("div", Ln, U((q = x.value[M.id]) == null ? void 0 : q.name), 1)
1199
+ f("div", zn, [
1200
+ f("div", On, [
1201
+ f("div", Ln, U((q = $.value[M.id]) == null ? void 0 : q.name), 1)
1189
1202
  ]),
1190
- v("div", jn, [
1191
- h(K, {
1203
+ f("div", jn, [
1204
+ x(K, {
1192
1205
  class: "w-full",
1193
- disabled: g.disabled,
1206
+ disabled: b.disabled,
1194
1207
  modelValue: +n(Q)(M.amount ?? { amount: 1, precision: 0 }),
1195
- "onUpdate:modelValue": (oe) => b(M.id, oe, g.modelValue),
1208
+ "onUpdate:modelValue": (oe) => y(M.id, oe, b.modelValue),
1196
1209
  invalid: L
1197
1210
  }, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"])
1198
1211
  ]),
1199
- g.readonly ? T("", !0) : (y(), E("div", Kn, [
1200
- h(R, {
1201
- disabled: g.disabled,
1212
+ b.readonly ? T("", !0) : (v(), V("div", Kn, [
1213
+ x(A, {
1214
+ disabled: b.disabled,
1202
1215
  type: "button",
1203
1216
  variant: "plain",
1204
1217
  icon: "delete",
1205
1218
  "icon-color": "#000000",
1206
- onClick: (oe) => _(M.id)
1219
+ onClick: (oe) => k(M.id)
1207
1220
  }, null, 8, ["disabled", "onClick"])
1208
1221
  ]))
1209
1222
  ])
@@ -1214,64 +1227,64 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1214
1227
  }, 1032, ["disabled", "modelValue", "rules"]))), 128))
1215
1228
  ])
1216
1229
  ])) : T("", !0),
1217
- v("div", qn, [
1218
- v("div", Wn, [
1219
- v("div", Yn, U(n(l)("inventory.inventoryBindings.ingredient")), 1),
1220
- g.readonly ? T("", !0) : (y(), Y(R, {
1230
+ f("div", qn, [
1231
+ f("div", Wn, [
1232
+ f("div", Yn, U(n(l)("inventory.inventoryBindings.ingredient")), 1),
1233
+ b.readonly ? T("", !0) : (v(), Y(A, {
1221
1234
  key: 0,
1222
1235
  variant: "secondary",
1223
1236
  "text-color": "primary",
1224
1237
  "border-color": "primary",
1225
1238
  label: n(l)("inventory.inventoryBindings.linkIngredient"),
1226
1239
  "prepend-icon": "link",
1227
- onClick: V
1240
+ onClick: S
1228
1241
  }, null, 8, ["label"]))
1229
1242
  ]),
1230
- v("div", Jn, [
1231
- v("div", Hn, [
1232
- v("div", Qn, U(n(l)("inventory.inventoryBindings.ingredient")), 1),
1233
- v("div", Xn, U(n(l)("inventory.inventoryBindings.amount")), 1),
1234
- B[8] || (B[8] = v("div", { class: "w-[52px]" }, null, -1)),
1235
- (ee = g.skuBindingConfig) != null && ee.ableToApplyRules || (O = g.skuBindingConfig) != null && O.ableToConfigureAlternative ? (y(), E("div", Zn)) : T("", !0)
1243
+ f("div", Jn, [
1244
+ f("div", Hn, [
1245
+ f("div", Qn, U(n(l)("inventory.inventoryBindings.ingredient")), 1),
1246
+ f("div", Xn, U(n(l)("inventory.inventoryBindings.amount")), 1),
1247
+ B[8] || (B[8] = f("div", { class: "w-[52px]" }, null, -1)),
1248
+ (ee = b.skuBindingConfig) != null && ee.ableToApplyRules || (O = b.skuBindingConfig) != null && O.ableToConfigureAlternative ? (v(), V("div", Zn)) : T("", !0)
1236
1249
  ]),
1237
- (y(!0), E(X, null, me(e.value, (M) => {
1250
+ (v(!0), V(X, null, me(e.value, (M) => {
1238
1251
  var L, q, oe;
1239
- return y(), E(X, {
1252
+ return v(), V(X, {
1240
1253
  key: M.id
1241
1254
  }, [
1242
- z(M) ? (y(), E("div", eo, [
1243
- v("div", to, [
1244
- v("div", no, U(M.id), 1),
1245
- g.readonly ? T("", !0) : (y(), E("div", oo, [
1246
- h(R, {
1247
- disabled: g.disabled,
1255
+ z(M) ? (v(), V("div", eo, [
1256
+ f("div", to, [
1257
+ f("div", no, U(M.id), 1),
1258
+ b.readonly ? T("", !0) : (v(), V("div", oo, [
1259
+ x(A, {
1260
+ disabled: b.disabled,
1248
1261
  type: "button",
1249
1262
  variant: "tertiary",
1250
1263
  icon: "delete",
1251
- onClick: () => _(M.id)
1264
+ onClick: () => k(M.id)
1252
1265
  }, null, 8, ["disabled", "onClick"])
1253
1266
  ]))
1254
1267
  ]),
1255
- v("div", io, [
1256
- h(P, {
1268
+ f("div", io, [
1269
+ x(P, {
1257
1270
  name: "error",
1258
1271
  color: "system-error-300",
1259
1272
  size: "sm"
1260
1273
  }),
1261
- v("div", null, U(n(l)("inventory.inventoryBindings.missingIngredient")), 1)
1274
+ f("div", null, U(n(l)("inventory.inventoryBindings.missingIngredient")), 1)
1262
1275
  ])
1263
- ])) : (y(), Y($n, {
1276
+ ])) : (v(), Y($n, {
1264
1277
  key: 1,
1265
1278
  "model-value": M,
1266
1279
  "display-name": (L = r.value[M.id]) == null ? void 0 : L.name,
1267
1280
  unit: N(M),
1268
1281
  "show-error": a.value.has(M.id),
1269
- "able-to-apply-rules": ((q = g.skuBindingConfig) == null ? void 0 : q.ableToApplyRules) === !0,
1270
- "able-to-configure-alternative": ((oe = g.skuBindingConfig) == null ? void 0 : oe.ableToConfigureAlternative) === !0,
1271
- readonly: g.readonly,
1272
- disabled: g.disabled,
1282
+ "able-to-apply-rules": ((q = b.skuBindingConfig) == null ? void 0 : q.ableToApplyRules) === !0,
1283
+ "able-to-configure-alternative": ((oe = b.skuBindingConfig) == null ? void 0 : oe.ableToConfigureAlternative) === !0,
1284
+ readonly: b.readonly,
1285
+ disabled: b.disabled,
1273
1286
  "onUpdate:modelValue": B[2] || (B[2] = (Z) => c(Z)),
1274
- onDelete: B[3] || (B[3] = (Z) => _(Z))
1287
+ onDelete: B[3] || (B[3] = (Z) => k(Z))
1275
1288
  }, null, 8, ["model-value", "display-name", "unit", "show-error", "able-to-apply-rules", "able-to-configure-alternative", "readonly", "disabled"]))
1276
1289
  ], 64);
1277
1290
  }), 128))
@@ -1297,46 +1310,46 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1297
1310
  disabled: { type: Boolean }
1298
1311
  },
1299
1312
  emits: ["update:modelValue", "click:submit"],
1300
- setup(m, { expose: d, emit: l }) {
1301
- const t = m, i = l, r = We(), { t: x } = ie(), u = A({
1313
+ setup(p, { expose: d, emit: l }) {
1314
+ const t = p, i = l, r = We(), { t: $ } = ie(), u = R({
1302
1315
  get() {
1303
1316
  var c;
1304
1317
  return ((c = t.modelValue) == null ? void 0 : c.name) ?? "";
1305
1318
  },
1306
1319
  set(c) {
1307
- const _ = t.modelValue ?? {};
1308
- _.name = c, i("update:modelValue", _);
1320
+ const k = t.modelValue ?? {};
1321
+ k.name = c, i("update:modelValue", k);
1309
1322
  }
1310
- }), o = A({
1323
+ }), o = R({
1311
1324
  get() {
1312
1325
  var c;
1313
1326
  return ((c = t.modelValue) == null ? void 0 : c.contains) ?? [];
1314
1327
  },
1315
1328
  set(c) {
1316
- const _ = t.modelValue ?? {};
1317
- _.contains = c, i("update:modelValue", _);
1329
+ const k = t.modelValue ?? {};
1330
+ k.contains = c, i("update:modelValue", k);
1318
1331
  }
1319
- }), s = A({
1332
+ }), s = R({
1320
1333
  get() {
1321
1334
  var c;
1322
1335
  return ((c = t.modelValue) == null ? void 0 : c.customAttributes) ?? {};
1323
1336
  },
1324
1337
  set(c) {
1325
- const _ = t.modelValue ? {
1338
+ const k = t.modelValue ? {
1326
1339
  ...t.modelValue
1327
1340
  } : {};
1328
- _.customAttributes = c, i("update:modelValue", _);
1341
+ k.customAttributes = c, i("update:modelValue", k);
1329
1342
  }
1330
- }), a = A({
1343
+ }), a = R({
1331
1344
  get() {
1332
1345
  var c;
1333
1346
  return ((c = t.modelValue) == null ? void 0 : c.version) ?? null;
1334
1347
  },
1335
1348
  set(c) {
1336
- const _ = t.modelValue ? { ...t.modelValue } : {};
1337
- _.version = c, i("update:modelValue", _);
1349
+ const k = t.modelValue ? { ...t.modelValue } : {};
1350
+ k.version = c, i("update:modelValue", k);
1338
1351
  }
1339
- }), p = A({
1352
+ }), g = R({
1340
1353
  get() {
1341
1354
  return a.value === "v2";
1342
1355
  },
@@ -1344,94 +1357,94 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1344
1357
  a.value = c ? "v2" : null;
1345
1358
  }
1346
1359
  });
1347
- function $() {
1360
+ function h() {
1348
1361
  i("click:submit");
1349
1362
  }
1350
1363
  const C = W();
1351
1364
  d({
1352
1365
  validateInputs: () => {
1353
- var c, _;
1354
- (_ = (c = C.value) == null ? void 0 : c.validateInputs) == null || _.call(c);
1366
+ var c, k;
1367
+ (k = (c = C.value) == null ? void 0 : c.validateInputs) == null || k.call(c);
1355
1368
  },
1356
1369
  resetInputsValidation: () => {
1357
- var c, _;
1358
- (_ = (c = C.value) == null ? void 0 : c.resetInputsValidation) == null || _.call(c);
1370
+ var c, k;
1371
+ (k = (c = C.value) == null ? void 0 : c.resetInputsValidation) == null || k.call(c);
1359
1372
  },
1360
1373
  resetInputs: () => {
1361
- var c, _;
1362
- (_ = (c = C.value) == null ? void 0 : c.resetInputs) == null || _.call(c);
1374
+ var c, k;
1375
+ (k = (c = C.value) == null ? void 0 : c.resetInputs) == null || k.call(c);
1363
1376
  }
1364
1377
  });
1365
- const I = ne(), f = W([]), k = W(!1), S = W(!1);
1366
- ue(k, async (c) => {
1367
- b(c);
1378
+ const I = ne(), m = W([]), _ = W(!1), w = W(!1);
1379
+ ue(_, async (c) => {
1380
+ y(c);
1368
1381
  });
1369
- async function b(c) {
1370
- var _, N;
1371
- c && !S.value && ((_ = t.modelValue) != null && _._id) && (S.value = !0, f.value = await I.getAffectedMenu((N = t.modelValue) == null ? void 0 : N._id).delayed(500), S.value = !1);
1382
+ async function y(c) {
1383
+ var k, N;
1384
+ c && !w.value && ((k = t.modelValue) != null && k._id) && (w.value = !0, m.value = await I.getAffectedMenu((N = t.modelValue) == null ? void 0 : N._id).delayed(500), w.value = !1);
1372
1385
  }
1373
- const e = A(
1386
+ const e = R(
1374
1387
  () => I.recipes.map((c) => ({ label: c.name, value: c.name }))
1375
- ), V = A(() => {
1388
+ ), S = R(() => {
1376
1389
  var c;
1377
1390
  return ((c = t.modelValue) == null ? void 0 : c.name) ?? "";
1378
1391
  });
1379
- return (c, _) => {
1380
- const N = G("FmTextField"), z = G("FmSwitch"), g = G("FmCard"), B = G("FmSpacer"), F = G("FmCircularProgress"), R = G("FmForm");
1381
- return y(), Y(R, {
1392
+ return (c, k) => {
1393
+ const N = G("FmTextField"), z = G("FmSwitch"), b = G("FmCard"), B = G("FmSpacer"), F = G("FmCircularProgress"), A = G("FmForm");
1394
+ return v(), Y(A, {
1382
1395
  ref_key: "formRef",
1383
1396
  ref: C,
1384
- onValidationSuccess: $
1397
+ onValidationSuccess: h
1385
1398
  }, {
1386
1399
  default: J(() => [
1387
- v("div", ro, [
1388
- h(N, {
1400
+ f("div", ro, [
1401
+ x(N, {
1389
1402
  disabled: c.disabled,
1390
- label: n(x)("inventory.recipe.name"),
1403
+ label: n($)("inventory.recipe.name"),
1391
1404
  "model-value": u.value,
1392
- "onUpdate:modelValue": _[0] || (_[0] = (P) => u.value = P),
1405
+ "onUpdate:modelValue": k[0] || (k[0] = (P) => u.value = P),
1393
1406
  rules: [
1394
1407
  n(Rt)(),
1395
- n(lt)(e.value, V.value, (P) => `[${P.value}] already exists`)
1408
+ n(lt)(e.value, S.value, (P) => `[${P.value}] already exists`)
1396
1409
  ],
1397
1410
  "label-mark": "required"
1398
1411
  }, null, 8, ["disabled", "label", "model-value", "rules"]),
1399
- n(r).enableRecipeV2 ? (y(), E("div", ao, [
1400
- h(z, {
1401
- modelValue: p.value,
1402
- "onUpdate:modelValue": _[1] || (_[1] = (P) => p.value = P),
1412
+ n(r).enableRecipeV2 ? (v(), V("div", ao, [
1413
+ x(z, {
1414
+ modelValue: g.value,
1415
+ "onUpdate:modelValue": k[1] || (k[1] = (P) => g.value = P),
1403
1416
  value: !0,
1404
- label: n(x)("inventory.recipe.enableRecipeV2"),
1417
+ label: n($)("inventory.recipe.enableRecipeV2"),
1405
1418
  "label-placement": "right",
1406
1419
  disabled: c.disabled,
1407
- sublabel: n(x)("inventory.recipe.recipeV2Warning")
1420
+ sublabel: n($)("inventory.recipe.recipeV2Warning")
1408
1421
  }, null, 8, ["modelValue", "label", "disabled", "sublabel"])
1409
1422
  ])) : T("", !0),
1410
- h(g, {
1423
+ x(b, {
1411
1424
  variant: "outlined",
1412
1425
  class: "p-16"
1413
1426
  }, {
1414
1427
  default: J(() => {
1415
1428
  var P, K;
1416
1429
  return [
1417
- n(r).enableRecipeV2 ? (y(), Y(lo, {
1430
+ n(r).enableRecipeV2 ? (v(), Y(lo, {
1418
1431
  key: 0,
1419
1432
  id: (P = c.modelValue) == null ? void 0 : P._id,
1420
1433
  disabled: c.disabled,
1421
1434
  "model-value": o.value,
1422
- "onUpdate:modelValue": _[2] || (_[2] = (H) => o.value = H),
1435
+ "onUpdate:modelValue": k[2] || (k[2] = (H) => o.value = H),
1423
1436
  rules: [n(Ne)(1)],
1424
1437
  "enable-ingredient-group": n(r).enableIngredientGroup,
1425
- "recipe-binding-config": { enabled: !p.value, ableToApplyRules: p.value },
1438
+ "recipe-binding-config": { enabled: !g.value, ableToApplyRules: g.value },
1426
1439
  "sku-binding-config": {
1427
- ableToConfigureAlternative: p.value
1440
+ ableToConfigureAlternative: g.value
1428
1441
  }
1429
- }, null, 8, ["id", "disabled", "model-value", "rules", "enable-ingredient-group", "recipe-binding-config", "sku-binding-config"])) : (y(), Y(At, {
1442
+ }, null, 8, ["id", "disabled", "model-value", "rules", "enable-ingredient-group", "recipe-binding-config", "sku-binding-config"])) : (v(), Y(At, {
1430
1443
  key: 1,
1431
1444
  id: (K = c.modelValue) == null ? void 0 : K._id,
1432
1445
  disabled: c.disabled,
1433
1446
  "model-value": o.value,
1434
- "onUpdate:modelValue": _[3] || (_[3] = (H) => o.value = H),
1447
+ "onUpdate:modelValue": k[3] || (k[3] = (H) => o.value = H),
1435
1448
  rules: [n(Ne)(1)],
1436
1449
  "enable-ingredient-group": n(r).enableIngredientGroup
1437
1450
  }, null, 8, ["id", "disabled", "model-value", "rules", "enable-ingredient-group"]))
@@ -1440,33 +1453,33 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1440
1453
  _: 1
1441
1454
  })
1442
1455
  ]),
1443
- c.mode !== n(se).CREATE ? (y(), E("div", so, [
1444
- h(z, {
1456
+ c.mode !== n(se).CREATE ? (v(), V("div", so, [
1457
+ x(z, {
1445
1458
  label: "Show binded items",
1446
- modelValue: k.value,
1447
- "onUpdate:modelValue": _[4] || (_[4] = (P) => k.value = P),
1459
+ modelValue: _.value,
1460
+ "onUpdate:modelValue": k[4] || (k[4] = (P) => _.value = P),
1448
1461
  "label-placement": "right",
1449
- disabled: S.value
1462
+ disabled: w.value
1450
1463
  }, null, 8, ["modelValue", "disabled"]),
1451
- S.value ? (y(), E("div", uo, [
1452
- h(B),
1453
- v("div", null, [
1454
- h(F, { size: "xl" })
1464
+ w.value ? (v(), V("div", uo, [
1465
+ x(B),
1466
+ f("div", null, [
1467
+ x(F, { size: "xl" })
1455
1468
  ]),
1456
- _[6] || (_[6] = v("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
1457
- h(B)
1458
- ])) : k.value && f.value.length ? (y(), E("div", co, [
1459
- h(nt, {
1469
+ k[6] || (k[6] = f("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
1470
+ x(B)
1471
+ ])) : _.value && m.value.length ? (v(), V("div", co, [
1472
+ x(nt, {
1460
1473
  name: "Menu",
1461
- bindings: f.value
1474
+ bindings: m.value
1462
1475
  }, null, 8, ["bindings"])
1463
1476
  ])) : T("", !0)
1464
1477
  ])) : T("", !0),
1465
- v("div", po, [
1466
- h(Ot, {
1478
+ f("div", po, [
1479
+ x(Ot, {
1467
1480
  entity: "inventoryRecipe",
1468
1481
  modelValue: s.value,
1469
- "onUpdate:modelValue": _[5] || (_[5] = (P) => s.value = P)
1482
+ "onUpdate:modelValue": k[5] || (k[5] = (P) => s.value = P)
1470
1483
  }, null, 8, ["modelValue"])
1471
1484
  ])
1472
1485
  ]),
@@ -1482,8 +1495,8 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1482
1495
  mode: { default: se.READ }
1483
1496
  },
1484
1497
  emits: ["update:show"],
1485
- setup(m) {
1486
- const d = m, l = ne(), t = je(), { t: i } = ie(), r = Ge(d, "show"), x = Ge(d, "recipe"), u = A(() => {
1498
+ setup(p) {
1499
+ const d = p, l = ne(), t = je(), { t: i } = ie(), r = Ge(d, "show"), $ = Ge(d, "recipe"), u = R(() => {
1487
1500
  switch (d.mode) {
1488
1501
  case se.READ:
1489
1502
  return "";
@@ -1493,7 +1506,7 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1493
1506
  return i("inventory.recipe.create.title");
1494
1507
  }
1495
1508
  return "";
1496
- }), o = A(() => {
1509
+ }), o = R(() => {
1497
1510
  switch (d.mode) {
1498
1511
  case se.READ:
1499
1512
  return "";
@@ -1504,17 +1517,17 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1504
1517
  }
1505
1518
  return "";
1506
1519
  }), s = W(), a = W(!1);
1507
- async function p() {
1520
+ async function g() {
1508
1521
  a.value = !0;
1509
1522
  try {
1510
- const f = Oe(x.value);
1511
- f.precision ?? (f.precision = 0), f.measurements ?? (f.measurements = []), await l.createRecipe(f), r.value = !1, t.open({
1523
+ const m = Oe($.value);
1524
+ m.precision ?? (m.precision = 0), m.measurements ?? (m.measurements = []), await l.createRecipe(m), r.value = !1, t.open({
1512
1525
  title: i("inventory.common.success"),
1513
- message: i("inventory.recipe.create.success", { name: x.value.name }),
1526
+ message: i("inventory.recipe.create.success", { name: $.value.name }),
1514
1527
  type: "success"
1515
1528
  });
1516
- } catch (f) {
1517
- f instanceof Je || t.open({
1529
+ } catch (m) {
1530
+ m instanceof Je || t.open({
1518
1531
  title: i("inventory.recipe.create.error.title"),
1519
1532
  message: i("inventory.recipe.create.error.message"),
1520
1533
  type: "error"
@@ -1523,16 +1536,16 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1523
1536
  a.value = !1;
1524
1537
  }
1525
1538
  }
1526
- async function $() {
1539
+ async function h() {
1527
1540
  a.value = !0;
1528
1541
  try {
1529
- await l.updateRecipe(x.value), r.value = !1, t.open({
1542
+ await l.updateRecipe($.value), r.value = !1, t.open({
1530
1543
  title: i("inventory.common.success"),
1531
- message: i("inventory.recipe.update.success", { name: x.value.name }),
1544
+ message: i("inventory.recipe.update.success", { name: $.value.name }),
1532
1545
  type: "success"
1533
1546
  });
1534
- } catch (f) {
1535
- f instanceof Je || t.open({
1547
+ } catch (m) {
1548
+ m instanceof Je || t.open({
1536
1549
  title: i("inventory.recipe.update.error.title"),
1537
1550
  message: i("inventory.recipe.update.error.message"),
1538
1551
  type: "error"
@@ -1542,54 +1555,54 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1542
1555
  }
1543
1556
  }
1544
1557
  function C() {
1545
- var f, k;
1546
- (k = (f = s.value) == null ? void 0 : f.validateInputs) == null || k.call(f);
1558
+ var m, _;
1559
+ (_ = (m = s.value) == null ? void 0 : m.validateInputs) == null || _.call(m);
1547
1560
  }
1548
1561
  function I() {
1549
1562
  switch (d.mode) {
1550
1563
  case se.READ:
1551
1564
  return;
1552
1565
  case se.UPDATE:
1553
- return $();
1566
+ return h();
1554
1567
  case se.CREATE:
1555
- return p();
1568
+ return g();
1556
1569
  }
1557
1570
  }
1558
- return (f, k) => {
1559
- const S = G("FmButton"), b = G("FmSideSheet");
1560
- return y(), Y(b, {
1571
+ return (m, _) => {
1572
+ const w = G("FmButton"), y = G("FmSideSheet");
1573
+ return v(), Y(y, {
1561
1574
  "model-value": n(r),
1562
- "onUpdate:modelValue": k[3] || (k[3] = (e) => De(r) ? r.value = e : null),
1575
+ "onUpdate:modelValue": _[3] || (_[3] = (e) => De(r) ? r.value = e : null),
1563
1576
  header: u.value,
1564
1577
  "close-button": "",
1565
1578
  "dismiss-away": "",
1566
1579
  "max-width": 800
1567
1580
  }, {
1568
1581
  "side-sheet-footer": J(() => [
1569
- v("div", fo, [
1570
- h(S, {
1582
+ f("div", fo, [
1583
+ x(w, {
1571
1584
  loading: a.value,
1572
1585
  label: o.value,
1573
1586
  onClick: C
1574
1587
  }, null, 8, ["loading", "label"]),
1575
- h(S, {
1588
+ x(w, {
1576
1589
  disabled: a.value,
1577
1590
  label: n(i)("common.close"),
1578
1591
  variant: "tertiary",
1579
- onClick: k[2] || (k[2] = (e) => r.value = !1)
1592
+ onClick: _[2] || (_[2] = (e) => r.value = !1)
1580
1593
  }, null, 8, ["disabled", "label"])
1581
1594
  ])
1582
1595
  ]),
1583
1596
  default: J(() => [
1584
- h(mo, {
1597
+ x(mo, {
1585
1598
  class: "w-full",
1586
1599
  ref_key: "hasValidationExpose",
1587
1600
  ref: s,
1588
- modelValue: n(x),
1589
- "onUpdate:modelValue": k[0] || (k[0] = (e) => De(x) ? x.value = e : null),
1590
- mode: f.mode,
1601
+ modelValue: n($),
1602
+ "onUpdate:modelValue": _[0] || (_[0] = (e) => De($) ? $.value = e : null),
1603
+ mode: m.mode,
1591
1604
  disabled: a.value,
1592
- "onClick:submit": k[1] || (k[1] = (e) => I())
1605
+ "onClick:submit": _[1] || (_[1] = (e) => I())
1593
1606
  }, null, 8, ["modelValue", "mode", "disabled"])
1594
1607
  ]),
1595
1608
  _: 1
@@ -1597,9 +1610,9 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1597
1610
  };
1598
1611
  }
1599
1612
  });
1600
- function ke(m, d, l) {
1613
+ function ke(p, d, l) {
1601
1614
  const t = [];
1602
- for (const i of m)
1615
+ for (const i of p)
1603
1616
  if (i.type === be.enum.SKU)
1604
1617
  t.push({ ...i, recipeIds: [...d] });
1605
1618
  else if (i.type === be.enum.SKU_GROUP)
@@ -1612,16 +1625,16 @@ function ke(m, d, l) {
1612
1625
  }
1613
1626
  return t;
1614
1627
  }
1615
- function yo(m, d) {
1616
- return he.equal(m, d);
1628
+ function yo(p, d) {
1629
+ return he.equal(p, d);
1617
1630
  }
1618
- function Ae(m) {
1619
- if (m == null) return null;
1620
- const d = m.$and, l = m.$or;
1621
- return Array.isArray(d) && d.length === 0 || Array.isArray(l) && l.length === 0 || Object.keys(m).length === 0 ? null : JSON.stringify(m);
1631
+ function Ae(p) {
1632
+ if (p == null) return null;
1633
+ const d = p.$and, l = p.$or;
1634
+ return Array.isArray(d) && d.length === 0 || Array.isArray(l) && l.length === 0 || Object.keys(p).length === 0 ? null : JSON.stringify(p);
1622
1635
  }
1623
- function Te(m) {
1624
- const d = (m ?? []).map((l) => ({
1636
+ function Te(p) {
1637
+ const d = (p ?? []).map((l) => ({
1625
1638
  _id: l._id,
1626
1639
  trackingMeasurement: l.trackingMeasurement ?? null,
1627
1640
  priority: l.priority ?? null,
@@ -1629,28 +1642,28 @@ function Te(m) {
1629
1642
  })).sort((l, t) => l._id.localeCompare(t._id));
1630
1643
  return JSON.stringify(d);
1631
1644
  }
1632
- function Xe(m) {
1633
- return m.measurement ? he.multiplyDecimal(m.amount, m.measurement.conversion) : m.amount;
1645
+ function Xe(p) {
1646
+ return p.measurement ? he.multiplyDecimal(p.amount, p.measurement.conversion) : p.amount;
1634
1647
  }
1635
- function Me(m, d) {
1648
+ function Me(p, d) {
1636
1649
  var i, r;
1637
- if (m.type !== d.type || m.id !== d.id || !yo(Xe(m), Xe(d))) return !1;
1638
- const l = ((i = m.measurement) == null ? void 0 : i.id) ?? null, t = ((r = d.measurement) == null ? void 0 : r.id) ?? null;
1639
- return !(l !== t || Ae(m.rules) !== Ae(d.rules) || Te(m.alternatives) !== Te(d.alternatives));
1650
+ if (p.type !== d.type || p.id !== d.id || !yo(Xe(p), Xe(d))) return !1;
1651
+ const l = ((i = p.measurement) == null ? void 0 : i.id) ?? null, t = ((r = d.measurement) == null ? void 0 : r.id) ?? null;
1652
+ return !(l !== t || Ae(p.rules) !== Ae(d.rules) || Te(p.alternatives) !== Te(d.alternatives));
1640
1653
  }
1641
- function Ze(m, d) {
1642
- return m.type === d.type && m.id === d.id;
1654
+ function Ze(p, d) {
1655
+ return p.type === d.type && p.id === d.id;
1643
1656
  }
1644
- function bo(m, d) {
1657
+ function bo(p, d) {
1645
1658
  const l = [];
1646
- let t = [...m.contains];
1659
+ let t = [...p.contains];
1647
1660
  for (const r of d)
1648
1661
  switch (r.type) {
1649
1662
  case "remove-binding": {
1650
- const x = t.findIndex(
1663
+ const $ = t.findIndex(
1651
1664
  (u) => u.type === r.target.type && u.id === r.target.id
1652
1665
  );
1653
- x === -1 ? l.push({ change: r, outcome: "ignored", reason: "Source binding not found in target" }) : (t = [...t.slice(0, x), ...t.slice(x + 1)], l.push({ change: r, outcome: "applied" }));
1666
+ $ === -1 ? l.push({ change: r, outcome: "ignored", reason: "Source binding not found in target" }) : (t = [...t.slice(0, $), ...t.slice($ + 1)], l.push({ change: r, outcome: "applied" }));
1654
1667
  break;
1655
1668
  }
1656
1669
  case "add-binding": {
@@ -1662,11 +1675,11 @@ function bo(m, d) {
1662
1675
  l.push({ change: r, outcome: "blocked", reason: "A similar but non-exact binding already exists" });
1663
1676
  break;
1664
1677
  }
1665
- if (m.version === "v2" && r.binding.type === "RECIPE") {
1678
+ if (p.version === "v2" && r.binding.type === "RECIPE") {
1666
1679
  l.push({ change: r, outcome: "blocked", reason: "Cannot add RECIPE binding to a V2 recipe" });
1667
1680
  break;
1668
1681
  }
1669
- if (m.version !== "v2" && (r.binding.alternatives ?? []).length > 0) {
1682
+ if (p.version !== "v2" && (r.binding.alternatives ?? []).length > 0) {
1670
1683
  l.push({ change: r, outcome: "blocked", reason: "Cannot add a binding with alternatives to a non-V2 recipe" });
1671
1684
  break;
1672
1685
  }
@@ -1674,18 +1687,18 @@ function bo(m, d) {
1674
1687
  break;
1675
1688
  }
1676
1689
  case "replace-binding": {
1677
- const x = t.findIndex(
1690
+ const $ = t.findIndex(
1678
1691
  (s) => s.type === r.from.type && s.id === r.from.id
1679
- ), u = t.find((s) => Me(s, r.to)), o = t.find((s, a) => a !== x && Ze(s, r.to) && !Me(s, r.to));
1680
- if (x === -1) {
1692
+ ), u = t.find((s) => Me(s, r.to)), o = t.find((s, a) => a !== $ && Ze(s, r.to) && !Me(s, r.to));
1693
+ if ($ === -1) {
1681
1694
  u ? l.push({ change: r, outcome: "already-satisfied", reason: "Target already has exact replacement" }) : l.push({ change: r, outcome: "ignored", reason: "Source binding not found in target" });
1682
1695
  break;
1683
1696
  }
1684
- if (m.version === "v2" && r.to.type === "RECIPE") {
1697
+ if (p.version === "v2" && r.to.type === "RECIPE") {
1685
1698
  l.push({ change: r, outcome: "blocked", reason: "Cannot add RECIPE binding to a V2 recipe" });
1686
1699
  break;
1687
1700
  }
1688
- if (m.version !== "v2" && (r.to.alternatives ?? []).length > 0) {
1701
+ if (p.version !== "v2" && (r.to.alternatives ?? []).length > 0) {
1689
1702
  l.push({ change: r, outcome: "blocked", reason: "Cannot apply a binding with alternatives to a non-V2 recipe" });
1690
1703
  break;
1691
1704
  }
@@ -1693,92 +1706,92 @@ function bo(m, d) {
1693
1706
  l.push({ change: r, outcome: "blocked", reason: "A similar but non-exact replacement binding already exists" });
1694
1707
  break;
1695
1708
  }
1696
- u ? (t = [...t.slice(0, x), ...t.slice(x + 1)], l.push({ change: r, outcome: "applied", reason: "Source removed; replacement already present" })) : (t = [
1697
- ...t.slice(0, x),
1709
+ u ? (t = [...t.slice(0, $), ...t.slice($ + 1)], l.push({ change: r, outcome: "applied", reason: "Source removed; replacement already present" })) : (t = [
1710
+ ...t.slice(0, $),
1698
1711
  r.to,
1699
- ...t.slice(x + 1)
1712
+ ...t.slice($ + 1)
1700
1713
  ], l.push({ change: r, outcome: "applied" }));
1701
1714
  break;
1702
1715
  }
1703
1716
  case "update-binding-rule": {
1704
- const x = t.findIndex(
1717
+ const $ = t.findIndex(
1705
1718
  (a) => a.type === r.target.type && a.id === r.target.id
1706
1719
  );
1707
- if (x === -1) {
1720
+ if ($ === -1) {
1708
1721
  l.push({ change: r, outcome: "ignored", reason: "Binding not found in target" });
1709
1722
  break;
1710
1723
  }
1711
- const u = t[x], o = u.rules ?? null, s = r.rule ?? null;
1724
+ const u = t[$], o = u.rules ?? null, s = r.rule ?? null;
1712
1725
  if (Ae(o) === Ae(s)) {
1713
1726
  l.push({ change: r, outcome: "already-satisfied", reason: "Rule already matches" });
1714
1727
  break;
1715
1728
  }
1716
1729
  t = [
1717
- ...t.slice(0, x),
1730
+ ...t.slice(0, $),
1718
1731
  { ...u, rules: s },
1719
- ...t.slice(x + 1)
1732
+ ...t.slice($ + 1)
1720
1733
  ], l.push({ change: r, outcome: "applied" });
1721
1734
  break;
1722
1735
  }
1723
1736
  case "update-alternatives": {
1724
- if (m.version !== "v2") {
1737
+ if (p.version !== "v2") {
1725
1738
  l.push({ change: r, outcome: "blocked", reason: "Cannot update alternatives on a non-V2 recipe" });
1726
1739
  break;
1727
1740
  }
1728
- const x = t.findIndex(
1741
+ const $ = t.findIndex(
1729
1742
  (a) => a.type === r.target.type && a.id === r.target.id
1730
1743
  );
1731
- if (x === -1) {
1744
+ if ($ === -1) {
1732
1745
  l.push({ change: r, outcome: "ignored", reason: "Binding not found in target" });
1733
1746
  break;
1734
1747
  }
1735
- const u = t[x], o = Te(u.alternatives), s = Te(r.alternatives);
1748
+ const u = t[$], o = Te(u.alternatives), s = Te(r.alternatives);
1736
1749
  if (o === s) {
1737
1750
  l.push({ change: r, outcome: "already-satisfied", reason: "Alternatives already match" });
1738
1751
  break;
1739
1752
  }
1740
1753
  t = [
1741
- ...t.slice(0, x),
1754
+ ...t.slice(0, $),
1742
1755
  { ...u, alternatives: r.alternatives },
1743
- ...t.slice(x + 1)
1756
+ ...t.slice($ + 1)
1744
1757
  ], l.push({ change: r, outcome: "applied" });
1745
1758
  break;
1746
1759
  }
1747
1760
  }
1748
- return { projected: { ...m, contains: t }, results: l };
1761
+ return { projected: { ...p, contains: t }, results: l };
1749
1762
  }
1750
- function et(m) {
1751
- switch (m.type) {
1763
+ function et(p) {
1764
+ switch (p.type) {
1752
1765
  case "add-binding":
1753
- return m.binding.id !== "";
1766
+ return p.binding.id !== "";
1754
1767
  case "remove-binding":
1755
- return m.target.id !== "";
1768
+ return p.target.id !== "";
1756
1769
  case "replace-binding":
1757
- return m.from.id !== "" && m.to.id !== "";
1770
+ return p.from.id !== "" && p.to.id !== "";
1758
1771
  case "update-binding-rule":
1759
- return m.target.id !== "";
1772
+ return p.target.id !== "";
1760
1773
  case "update-alternatives":
1761
- return m.target.id !== "";
1774
+ return p.target.id !== "";
1762
1775
  }
1763
1776
  }
1764
- function go(m) {
1765
- if (m.length === 0) return "no-applicable-changes";
1777
+ function go(p) {
1778
+ if (p.length === 0) return "no-applicable-changes";
1766
1779
  let d = 0, l = 0, t = 0, i = 0;
1767
- for (const r of m)
1780
+ for (const r of p)
1768
1781
  r.outcome === "applied" ? d++ : r.outcome === "blocked" ? l++ : r.outcome === "ignored" ? t++ : r.outcome === "already-satisfied" && i++;
1769
- return l > 0 && d === 0 ? "blocked" : i === m.length ? "already-satisfied" : d > 0 && (t > 0 || l > 0) ? "partially-ignored" : d > 0 ? "will-update" : "no-applicable-changes";
1782
+ return l > 0 && d === 0 ? "blocked" : i === p.length ? "already-satisfied" : d > 0 && (t > 0 || l > 0) ? "partially-ignored" : d > 0 ? "will-update" : "no-applicable-changes";
1770
1783
  }
1771
1784
  let _o = 0;
1772
- function ko(m = null) {
1785
+ function ko(p = null) {
1773
1786
  return {
1774
1787
  id: String(++_o),
1775
- type: m,
1788
+ type: p,
1776
1789
  itemId: null,
1777
1790
  amountModel: ye()
1778
1791
  };
1779
1792
  }
1780
- function ut(m, d, l, t) {
1781
- for (const i of m)
1793
+ function ut(p, d, l, t) {
1794
+ for (const i of p)
1782
1795
  if (i.type === "RECIPE") {
1783
1796
  if (i.id === d) return !0;
1784
1797
  if (!l.has(i.id)) {
@@ -1790,9 +1803,9 @@ function ut(m, d, l, t) {
1790
1803
  return !1;
1791
1804
  }
1792
1805
  const ge = ot("recipeBulkEditor", function() {
1793
- const d = ne(), l = je(), { t } = ie(), i = W(!1), r = W(1), x = W(null), u = W(/* @__PURE__ */ new Set()), o = W([]), s = W({}), a = W(!1), p = W(/* @__PURE__ */ new Map()), $ = W(""), C = W([]), I = A(() => {
1806
+ const d = ne(), l = je(), { t } = ie(), i = W(!1), r = W(1), $ = W(null), u = W(/* @__PURE__ */ new Set()), o = W([]), s = W({}), a = W(!1), g = W(/* @__PURE__ */ new Map()), h = W(""), C = W([]), I = R(() => {
1794
1807
  let O = d.recipes;
1795
- const M = x.value;
1808
+ const M = $.value;
1796
1809
  if (M != null && M.nameSearch) {
1797
1810
  const L = M.nameSearch.trim().toLowerCase();
1798
1811
  L && (O = O.filter((q) => q.name.toLowerCase().includes(L)));
@@ -1828,13 +1841,13 @@ const ge = ot("recipeBulkEditor", function() {
1828
1841
  }
1829
1842
  }
1830
1843
  return O;
1831
- }), f = A(
1844
+ }), m = R(
1832
1845
  () => I.value.filter((O) => !u.value.has(O._id))
1833
- ), k = A(() => f.value.length > 0), S = A(() => {
1846
+ ), _ = R(() => m.value.length > 0), w = R(() => {
1834
1847
  const O = o.value.filter(et);
1835
1848
  if (O.length === 0) {
1836
1849
  const L = {};
1837
- for (const q of f.value)
1850
+ for (const q of m.value)
1838
1851
  L[q._id] = {
1839
1852
  recipeId: q._id,
1840
1853
  recipeName: q.name,
@@ -1847,7 +1860,7 @@ const ge = ot("recipeBulkEditor", function() {
1847
1860
  return L;
1848
1861
  }
1849
1862
  const M = {};
1850
- for (const L of f.value) {
1863
+ for (const L of m.value) {
1851
1864
  const q = JSON.parse(JSON.stringify(L)), { projected: oe, results: Z } = bo(q, O), ae = go(Z);
1852
1865
  let fe = 0, xe = 0, re = 0, ve = 0;
1853
1866
  for (const ce of Z)
@@ -1863,20 +1876,20 @@ const ge = ot("recipeBulkEditor", function() {
1863
1876
  };
1864
1877
  }
1865
1878
  return M;
1866
- }), b = A(() => o.value.some(et) ? Object.values(S.value).some(
1879
+ }), y = R(() => o.value.some(et) ? Object.values(w.value).some(
1867
1880
  (O) => O.status === "will-update" || O.status === "partially-ignored"
1868
1881
  ) : !1);
1869
1882
  function e() {
1870
1883
  c(), i.value = !0;
1871
1884
  }
1872
- function V() {
1885
+ function S() {
1873
1886
  i.value = !1;
1874
1887
  }
1875
1888
  function c() {
1876
- r.value = 1, x.value = null, u.value = /* @__PURE__ */ new Set(), o.value = [], s.value = {}, a.value = !1, p.value = /* @__PURE__ */ new Map(), $.value = "", C.value = [];
1889
+ r.value = 1, $.value = null, u.value = /* @__PURE__ */ new Set(), o.value = [], s.value = {}, a.value = !1, g.value = /* @__PURE__ */ new Map(), h.value = "", C.value = [];
1877
1890
  }
1878
- function _(O) {
1879
- x.value = O;
1891
+ function k(O) {
1892
+ $.value = O;
1880
1893
  }
1881
1894
  function N(O) {
1882
1895
  const M = new Set(u.value);
@@ -1885,7 +1898,7 @@ const ge = ot("recipeBulkEditor", function() {
1885
1898
  function z() {
1886
1899
  u.value = /* @__PURE__ */ new Set();
1887
1900
  }
1888
- function g(O) {
1901
+ function b(O) {
1889
1902
  o.value = [...o.value, O];
1890
1903
  }
1891
1904
  function B(O, M) {
@@ -1895,12 +1908,12 @@ const ge = ot("recipeBulkEditor", function() {
1895
1908
  function F(O) {
1896
1909
  o.value = o.value.filter((M, L) => L !== O);
1897
1910
  }
1898
- function R(O, M) {
1911
+ function A(O, M) {
1899
1912
  const L = [...o.value], [q] = L.splice(O, 1);
1900
1913
  L.splice(M, 0, q), o.value = L;
1901
1914
  }
1902
1915
  function P() {
1903
- s.value = { ...S.value }, r.value = 3;
1916
+ s.value = { ...w.value }, r.value = 3;
1904
1917
  }
1905
1918
  function K() {
1906
1919
  s.value = {}, r.value = 2;
@@ -1912,7 +1925,7 @@ const ge = ot("recipeBulkEditor", function() {
1912
1925
  }
1913
1926
  async function ee() {
1914
1927
  if (!a.value) {
1915
- a.value = !0, p.value = /* @__PURE__ */ new Map();
1928
+ a.value = !0, g.value = /* @__PURE__ */ new Map();
1916
1929
  try {
1917
1930
  const O = H(), M = await d.importRecipes({
1918
1931
  create: [],
@@ -1924,7 +1937,7 @@ const ge = ot("recipeBulkEditor", function() {
1924
1937
  const ae = typeof Z == "string" ? Z : (Z == null ? void 0 : Z.message) ?? t("inventory.recipe.bulkEditor.step3.unknownError");
1925
1938
  q.set(oe._id, ae);
1926
1939
  }
1927
- p.value = q, l.open({
1940
+ g.value = q, l.open({
1928
1941
  title: t("inventory.recipe.bulkEditor.step3.partialErrorTitle"),
1929
1942
  message: t("inventory.recipe.bulkEditor.step3.partialErrorMessage", {
1930
1943
  count: L.length
@@ -1954,31 +1967,31 @@ const ge = ot("recipeBulkEditor", function() {
1954
1967
  // state
1955
1968
  show: i,
1956
1969
  currentStep: r,
1957
- query: x,
1970
+ query: $,
1958
1971
  excludedRecipeIds: u,
1959
1972
  modifications: o,
1960
1973
  entries: s,
1961
1974
  isSaving: a,
1962
- applyErrors: p,
1963
- nameSearch: $,
1975
+ applyErrors: g,
1976
+ nameSearch: h,
1964
1977
  filterRows: C,
1965
1978
  // computed
1966
1979
  matchedRecipes: I,
1967
- selectedRecipes: f,
1968
- livePreviewEntries: S,
1969
- canGoToStep2: k,
1970
- canGoToStep3: b,
1980
+ selectedRecipes: m,
1981
+ livePreviewEntries: w,
1982
+ canGoToStep2: _,
1983
+ canGoToStep3: y,
1971
1984
  // actions
1972
1985
  openDialog: e,
1973
- closeDialog: V,
1986
+ closeDialog: S,
1974
1987
  reset: c,
1975
- updateQuery: _,
1988
+ updateQuery: k,
1976
1989
  removeRecipe: N,
1977
1990
  restoreAllRecipes: z,
1978
- addModification: g,
1991
+ addModification: b,
1979
1992
  updateModification: B,
1980
1993
  removeModification: F,
1981
- reorderModification: R,
1994
+ reorderModification: A,
1982
1995
  goToStep3: P,
1983
1996
  backToStep2: K,
1984
1997
  buildPayload: H,
@@ -2004,192 +2017,192 @@ const ge = ot("recipeBulkEditor", function() {
2004
2017
  class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mt-1 whitespace-normal break-words"
2005
2018
  }, zo = { class: "flex items-center gap-4 mt-2" }, Oo = /* @__PURE__ */ le({
2006
2019
  __name: "RecipeBulkEditorStep1",
2007
- setup(m) {
2008
- const { t: d } = ie(), l = ne(), t = ge(), i = A({
2020
+ setup(p) {
2021
+ const { t: d } = ie(), l = ne(), t = ge(), i = R({
2009
2022
  get: () => t.nameSearch,
2010
- set: (b) => {
2011
- t.nameSearch = b;
2023
+ set: (y) => {
2024
+ t.nameSearch = y;
2012
2025
  }
2013
- }), r = A(() => t.filterRows), x = W({});
2014
- function u(b) {
2015
- return x.value[b] ?? !1;
2016
- }
2017
- function o(b, e) {
2018
- x.value = { ...x.value, [b]: e };
2019
- }
2020
- const s = A(
2021
- () => l.skus.map((b) => ({
2022
- label: b.name,
2023
- sublabel: b.code,
2024
- value: b._id
2026
+ }), r = R(() => t.filterRows), $ = W({});
2027
+ function u(y) {
2028
+ return $.value[y] ?? !1;
2029
+ }
2030
+ function o(y, e) {
2031
+ $.value = { ...$.value, [y]: e };
2032
+ }
2033
+ const s = R(
2034
+ () => l.skus.map((y) => ({
2035
+ label: y.name,
2036
+ sublabel: y.code,
2037
+ value: y._id
2025
2038
  }))
2026
- ), a = A(
2027
- () => l.recipes.map((b) => ({
2028
- label: b.name,
2029
- value: b._id
2039
+ ), a = R(
2040
+ () => l.recipes.map((y) => ({
2041
+ label: y.name,
2042
+ value: y._id
2030
2043
  }))
2031
2044
  );
2032
- function p(b) {
2033
- return b.type !== "ingredient" || !b.itemId ? null : l.skuById[b.itemId] ?? null;
2045
+ function g(y) {
2046
+ return y.type !== "ingredient" || !y.itemId ? null : l.skuById[y.itemId] ?? null;
2034
2047
  }
2035
- function $(b) {
2048
+ function h(y) {
2036
2049
  var e;
2037
- if (!b.type) return d("inventory.recipe.bulkEditor.step1.filter");
2038
- if (b.type === "ingredient") {
2039
- if (!b.itemId) return d("inventory.recipe.bulkEditor.step1.filterTypeIngredient");
2040
- const V = l.skuById[b.itemId];
2041
- if (!V) return d("inventory.recipe.bulkEditor.step1.filterTypeIngredient");
2042
- const { amount: c, measurement: _ } = b.amountModel;
2043
- if (!(c != null && c.amount > 0)) return V.name;
2044
- const z = (_ == null ? void 0 : _.abbrev) ?? ((e = V.unit) == null ? void 0 : e.abbrev) ?? "", g = Q(c);
2045
- return `${V.name} (${g}${z})`;
2050
+ if (!y.type) return d("inventory.recipe.bulkEditor.step1.filter");
2051
+ if (y.type === "ingredient") {
2052
+ if (!y.itemId) return d("inventory.recipe.bulkEditor.step1.filterTypeIngredient");
2053
+ const S = l.skuById[y.itemId];
2054
+ if (!S) return d("inventory.recipe.bulkEditor.step1.filterTypeIngredient");
2055
+ const { amount: c, measurement: k } = y.amountModel;
2056
+ if (!(c != null && c.amount > 0)) return S.name;
2057
+ const z = (k == null ? void 0 : k.abbrev) ?? ((e = S.unit) == null ? void 0 : e.abbrev) ?? "", b = Q(c);
2058
+ return `${S.name} (${b}${z})`;
2046
2059
  }
2047
- if (b.type === "recipe") {
2048
- if (!b.itemId) return d("inventory.recipe.bulkEditor.step1.filterTypeRecipe");
2049
- const V = l.recipeById[b.itemId];
2050
- return V ? V.name : d("inventory.recipe.bulkEditor.step1.filterTypeRecipe");
2060
+ if (y.type === "recipe") {
2061
+ if (!y.itemId) return d("inventory.recipe.bulkEditor.step1.filterTypeRecipe");
2062
+ const S = l.recipeById[y.itemId];
2063
+ return S ? S.name : d("inventory.recipe.bulkEditor.step1.filterTypeRecipe");
2051
2064
  }
2052
2065
  return "";
2053
2066
  }
2054
- function C(b) {
2055
- const e = ko(b);
2067
+ function C(y) {
2068
+ const e = ko(y);
2056
2069
  t.filterRows.push(e), o(e.id, !0);
2057
2070
  }
2058
- function I(b) {
2059
- t.filterRows = t.filterRows.filter((V) => V.id !== b);
2060
- const e = { ...x.value };
2061
- delete e[b], x.value = e;
2071
+ function I(y) {
2072
+ t.filterRows = t.filterRows.filter((S) => S.id !== y);
2073
+ const e = { ...$.value };
2074
+ delete e[y], $.value = e;
2062
2075
  }
2063
- function f(b) {
2064
- b.amountModel = ye(), o(b.id, !0);
2076
+ function m(y) {
2077
+ y.amountModel = ye(), o(y.id, !0);
2065
2078
  }
2066
2079
  ue(
2067
2080
  [i, r],
2068
2081
  () => {
2069
- const b = [];
2082
+ const y = [];
2070
2083
  for (const c of r.value)
2071
2084
  if (!(!c.type || !c.itemId))
2072
2085
  if (c.type === "ingredient") {
2073
- const _ = p(c), { amount: N, measurement: z } = c.amountModel, g = N != null && N.amount > 0;
2086
+ const k = g(c), { amount: N, measurement: z } = c.amountModel, b = N != null && N.amount > 0;
2074
2087
  let B, F;
2075
- _ && g && (B = z ? he.multiplyDecimal(N, z.conversion) : N, F = (z == null ? void 0 : z.id) ?? null), b.push({
2088
+ k && b && (B = z ? he.multiplyDecimal(N, z.conversion) : N, F = (z == null ? void 0 : z.id) ?? null), y.push({
2076
2089
  id: c.id,
2077
2090
  type: "ingredient",
2078
2091
  itemId: c.itemId,
2079
2092
  amount: B ?? null,
2080
2093
  measurementId: F
2081
2094
  });
2082
- } else c.type === "recipe" && b.push({
2095
+ } else c.type === "recipe" && y.push({
2083
2096
  id: c.id,
2084
2097
  type: "recipe",
2085
2098
  itemId: c.itemId
2086
2099
  });
2087
2100
  t.updateQuery({
2088
2101
  nameSearch: i.value,
2089
- filters: b
2102
+ filters: y
2090
2103
  });
2091
- const e = i.value.trim().length > 0, V = b.length > 0;
2092
- !e && !V && t.restoreAllRecipes();
2104
+ const e = i.value.trim().length > 0, S = y.length > 0;
2105
+ !e && !S && t.restoreAllRecipes();
2093
2106
  },
2094
2107
  { deep: !0, immediate: !0 }
2095
2108
  );
2096
- function k(b) {
2097
- var _, N, z, g;
2098
- if (b.isGroup) {
2099
- const B = l.skuGroupById[b.id];
2109
+ function _(y) {
2110
+ var k, N, z, b;
2111
+ if (y.isGroup) {
2112
+ const B = l.skuGroupById[y.id];
2100
2113
  if (!B) return null;
2101
- const F = `x${Q(b.amount)}`;
2102
- return b.recipeIds.slice(1).length ? `(${((_ = l.recipeById[b.recipeIds.at(-1) ?? ""]) == null ? void 0 : _.name) ?? ""}) ${B.name} (${F})` : `${B.name} (${F})`;
2114
+ const F = `x${Q(y.amount)}`;
2115
+ return y.recipeIds.slice(1).length ? `(${((k = l.recipeById[y.recipeIds.at(-1) ?? ""]) == null ? void 0 : k.name) ?? ""}) ${B.name} (${F})` : `${B.name} (${F})`;
2103
2116
  }
2104
- const e = l.skuById[b.id];
2117
+ const e = l.skuById[y.id];
2105
2118
  if (!e) return null;
2106
- const V = ((N = b.measurement) == null ? void 0 : N.abbrev) ?? ((z = e.unit) == null ? void 0 : z.abbrev) ?? "", c = `${Q(b.amount)}${V}`;
2107
- return b.recipeIds.slice(1).length ? `(${((g = l.recipeById[b.recipeIds.at(-1) ?? ""]) == null ? void 0 : g.name) ?? ""}) ${e.name} (${c})` : `${e.name} (${c})`;
2119
+ const S = ((N = y.measurement) == null ? void 0 : N.abbrev) ?? ((z = e.unit) == null ? void 0 : z.abbrev) ?? "", c = `${Q(y.amount)}${S}`;
2120
+ return y.recipeIds.slice(1).length ? `(${((b = l.recipeById[y.recipeIds.at(-1) ?? ""]) == null ? void 0 : b.name) ?? ""}) ${e.name} (${c})` : `${e.name} (${c})`;
2108
2121
  }
2109
- function S(b) {
2110
- return ke(b.contains, /* @__PURE__ */ new Set([b._id]), l.recipeById).map(k).filter((e) => e !== null).join(", ");
2122
+ function w(y) {
2123
+ return ke(y.contains, /* @__PURE__ */ new Set([y._id]), l.recipeById).map(_).filter((e) => e !== null).join(", ");
2111
2124
  }
2112
- return (b, e) => {
2113
- const V = G("FmButton"), c = G("FmSearch"), _ = G("FmSelect"), N = G("FmPopover"), z = G("FmIcon"), g = G("FmMenuItem"), B = G("FmMenu"), F = G("FmChip");
2114
- return y(), E("div", ho, [
2115
- v("div", xo, [
2116
- v("span", $o, U(n(d)("inventory.recipe.bulkEditor.step1.selectedCount", {
2125
+ return (y, e) => {
2126
+ const S = G("FmButton"), c = G("FmSearch"), k = G("FmSelect"), N = G("FmPopover"), z = G("FmIcon"), b = G("FmMenuItem"), B = G("FmMenu"), F = G("FmChip");
2127
+ return v(), V("div", ho, [
2128
+ f("div", xo, [
2129
+ f("span", $o, U(n(d)("inventory.recipe.bulkEditor.step1.selectedCount", {
2117
2130
  count: n(t).selectedRecipes.length
2118
2131
  })), 1),
2119
- n(t).excludedRecipeIds.size > 0 ? (y(), Y(V, {
2132
+ n(t).excludedRecipeIds.size > 0 ? (v(), Y(S, {
2120
2133
  key: 0,
2121
2134
  label: n(d)("inventory.recipe.bulkEditor.step1.restoreAll"),
2122
2135
  variant: "tertiary",
2123
2136
  size: "md",
2124
- onClick: e[0] || (e[0] = (R) => n(t).restoreAllRecipes())
2137
+ onClick: e[0] || (e[0] = (A) => n(t).restoreAllRecipes())
2125
2138
  }, null, 8, ["label"])) : T("", !0)
2126
2139
  ]),
2127
- v("div", Io, [
2128
- h(c, {
2140
+ f("div", Io, [
2141
+ x(c, {
2129
2142
  modelValue: i.value,
2130
- "onUpdate:modelValue": e[1] || (e[1] = (R) => i.value = R),
2143
+ "onUpdate:modelValue": e[1] || (e[1] = (A) => i.value = A),
2131
2144
  placeholder: n(d)("inventory.recipe.bulkEditor.query.nameSearchPlaceholder")
2132
2145
  }, null, 8, ["modelValue", "placeholder"]),
2133
- r.value.length > 0 ? (y(), E("div", wo, [
2134
- (y(!0), E(X, null, me(r.value, (R) => (y(), E("div", {
2135
- key: R.id,
2146
+ r.value.length > 0 ? (v(), V("div", wo, [
2147
+ (v(!0), V(X, null, me(r.value, (A) => (v(), V("div", {
2148
+ key: A.id,
2136
2149
  class: "flex items-center"
2137
2150
  }, [
2138
- h(N, {
2139
- "show-popover": u(R.id),
2151
+ x(N, {
2152
+ "show-popover": u(A.id),
2140
2153
  "exclude-el-from-click-outside": ["fm-menu"],
2141
2154
  placement: "bottom-start",
2142
- onPopoverChanged: (P) => o(R.id, P)
2155
+ onPopoverChanged: (P) => o(A.id, P)
2143
2156
  }, {
2144
2157
  "popover-button": J(() => [
2145
- v("button", Eo, [
2146
- v("span", Vo, U($(R)), 1)
2158
+ f("button", Eo, [
2159
+ f("span", Vo, U(h(A)), 1)
2147
2160
  ])
2148
2161
  ]),
2149
2162
  default: J(() => [
2150
- v("div", So, [
2151
- v("p", Co, U(R.type === "ingredient" ? n(d)("inventory.recipe.bulkEditor.step1.filterTypeIngredient") : n(d)("inventory.recipe.bulkEditor.step1.filterTypeRecipe")), 1),
2152
- R.type === "ingredient" ? (y(), E(X, { key: 0 }, [
2153
- h(_, {
2154
- modelValue: R.itemId,
2155
- "onUpdate:modelValue": [(P) => R.itemId = P, (P) => f(R)],
2163
+ f("div", So, [
2164
+ f("p", Co, U(A.type === "ingredient" ? n(d)("inventory.recipe.bulkEditor.step1.filterTypeIngredient") : n(d)("inventory.recipe.bulkEditor.step1.filterTypeRecipe")), 1),
2165
+ A.type === "ingredient" ? (v(), V(X, { key: 0 }, [
2166
+ x(k, {
2167
+ modelValue: A.itemId,
2168
+ "onUpdate:modelValue": [(P) => A.itemId = P, (P) => m(A)],
2156
2169
  items: s.value,
2157
2170
  placeholder: n(d)("inventory.recipe.bulkEditor.step1.selectIngredient"),
2158
2171
  clearable: ""
2159
2172
  }, {
2160
2173
  "menu-wrapper": J((P) => [
2161
- h(Fe, we({ ref_for: !0 }, P, {
2174
+ x(Fe, we({ ref_for: !0 }, P, {
2162
2175
  items: s.value,
2163
- "model-value": R.itemId
2176
+ "model-value": A.itemId
2164
2177
  }), null, 16, ["items", "model-value"])
2165
2178
  ]),
2166
2179
  _: 2
2167
2180
  }, 1032, ["modelValue", "onUpdate:modelValue", "items", "placeholder"]),
2168
- p(R) ? (y(), E("div", Bo, [
2169
- v("span", Fo, [
2181
+ g(A) ? (v(), V("div", Bo, [
2182
+ f("span", Fo, [
2170
2183
  mt(U(n(d)("inventory.recipe.bulkEditor.step1.amountLabel")) + " ", 1),
2171
- v("span", Ro, U(n(d)("inventory.recipe.bulkEditor.step1.amountOptional")), 1)
2184
+ f("span", Ro, U(n(d)("inventory.recipe.bulkEditor.step1.amountOptional")), 1)
2172
2185
  ]),
2173
- h(Be, {
2174
- modelValue: R.amountModel,
2175
- "onUpdate:modelValue": (P) => R.amountModel = P,
2176
- unit: p(R).unit,
2186
+ x(Be, {
2187
+ modelValue: A.amountModel,
2188
+ "onUpdate:modelValue": (P) => A.amountModel = P,
2189
+ unit: g(A).unit,
2177
2190
  placeholder: n(d)("inventory.recipe.bulkEditor.step1.amountPlaceholder"),
2178
2191
  "convert-amount-on-change-unit": ""
2179
2192
  }, null, 8, ["modelValue", "onUpdate:modelValue", "unit", "placeholder"])
2180
2193
  ])) : T("", !0)
2181
- ], 64)) : R.type === "recipe" ? (y(), Y(_, {
2194
+ ], 64)) : A.type === "recipe" ? (v(), Y(k, {
2182
2195
  key: 1,
2183
- modelValue: R.itemId,
2184
- "onUpdate:modelValue": [(P) => R.itemId = P, (P) => f(R)],
2196
+ modelValue: A.itemId,
2197
+ "onUpdate:modelValue": [(P) => A.itemId = P, (P) => m(A)],
2185
2198
  items: a.value,
2186
2199
  placeholder: n(d)("inventory.recipe.bulkEditor.step1.selectRecipe"),
2187
2200
  clearable: ""
2188
2201
  }, {
2189
2202
  "menu-wrapper": J((P) => [
2190
- h(Fe, we({ ref_for: !0 }, P, {
2203
+ x(Fe, we({ ref_for: !0 }, P, {
2191
2204
  items: a.value,
2192
- "model-value": R.itemId
2205
+ "model-value": A.itemId
2193
2206
  }), null, 16, ["items", "model-value"])
2194
2207
  ]),
2195
2208
  _: 2
@@ -2198,25 +2211,25 @@ const ge = ot("recipeBulkEditor", function() {
2198
2211
  ]),
2199
2212
  _: 2
2200
2213
  }, 1032, ["show-popover", "onPopoverChanged"]),
2201
- v("button", {
2214
+ f("button", {
2202
2215
  type: "button",
2203
2216
  class: "inline-flex items-center justify-center h-[30px] w-[26px] rounded-r-md border border-l-0 border-fm-color-border-default bg-fm-color-surface-secondary hover:bg-fm-color-surface-hover text-fm-color-typo-secondary hover:text-fm-color-typo-primary cursor-pointer transition-colors",
2204
2217
  title: n(d)("inventory.recipe.bulkEditor.step1.removeFilter"),
2205
- onClick: (P) => I(R.id)
2218
+ onClick: (P) => I(A.id)
2206
2219
  }, [
2207
- h(z, {
2220
+ x(z, {
2208
2221
  name: "close",
2209
2222
  size: "sm"
2210
2223
  })
2211
2224
  ], 8, Ao)
2212
2225
  ]))), 128))
2213
2226
  ])) : T("", !0),
2214
- h(B, {
2227
+ x(B, {
2215
2228
  "close-on-click": !0,
2216
2229
  placement: "bottom-start"
2217
2230
  }, {
2218
2231
  "menu-button": J(() => [
2219
- h(V, {
2232
+ x(S, {
2220
2233
  label: n(d)("inventory.recipe.bulkEditor.step1.filter"),
2221
2234
  variant: "secondary",
2222
2235
  size: "md",
@@ -2225,38 +2238,38 @@ const ge = ot("recipeBulkEditor", function() {
2225
2238
  }, null, 8, ["label"])
2226
2239
  ]),
2227
2240
  default: J(() => [
2228
- h(g, {
2241
+ x(b, {
2229
2242
  label: n(d)("inventory.recipe.bulkEditor.step1.filterTypeIngredient"),
2230
2243
  icon: "inventory_2",
2231
- onClick: e[2] || (e[2] = (R) => C("ingredient"))
2244
+ onClick: e[2] || (e[2] = (A) => C("ingredient"))
2232
2245
  }, null, 8, ["label"]),
2233
- h(g, {
2246
+ x(b, {
2234
2247
  label: n(d)("inventory.recipe.bulkEditor.step1.filterTypeRecipe"),
2235
2248
  icon: "restaurant_menu",
2236
- onClick: e[3] || (e[3] = (R) => C("recipe"))
2249
+ onClick: e[3] || (e[3] = (A) => C("recipe"))
2237
2250
  }, null, 8, ["label"])
2238
2251
  ]),
2239
2252
  _: 1
2240
2253
  })
2241
2254
  ]),
2242
- v("div", To, [
2243
- n(t).selectedRecipes.length === 0 ? (y(), E("div", Uo, [
2244
- h(z, {
2255
+ f("div", To, [
2256
+ n(t).selectedRecipes.length === 0 ? (v(), V("div", Uo, [
2257
+ x(z, {
2245
2258
  name: "search_off",
2246
2259
  size: "lg",
2247
2260
  class: "text-fm-color-typo-placeholder"
2248
2261
  }),
2249
- v("p", Po, U(n(d)("inventory.recipe.bulkEditor.query.noResults")), 1)
2250
- ])) : (y(), E("div", Mo, [
2251
- (y(!0), E(X, null, me(n(t).selectedRecipes, (R) => (y(), E("div", {
2252
- key: R._id,
2262
+ f("p", Po, U(n(d)("inventory.recipe.bulkEditor.query.noResults")), 1)
2263
+ ])) : (v(), V("div", Mo, [
2264
+ (v(!0), V(X, null, me(n(t).selectedRecipes, (A) => (v(), V("div", {
2265
+ key: A._id,
2253
2266
  class: "flex items-center gap-12 px-16 py-12 hover:bg-fm-color-surface-hover transition-colors"
2254
2267
  }, [
2255
- v("div", Do, [
2256
- v("div", Go, U(R.name), 1),
2257
- R.contains.length > 0 ? (y(), E("div", No, U(S(R)), 1)) : T("", !0),
2258
- v("div", zo, [
2259
- R.version === "v2" ? (y(), Y(F, {
2268
+ f("div", Do, [
2269
+ f("div", Go, U(A.name), 1),
2270
+ A.contains.length > 0 ? (v(), V("div", No, U(w(A)), 1)) : T("", !0),
2271
+ f("div", zo, [
2272
+ A.version === "v2" ? (v(), Y(F, {
2260
2273
  key: 0,
2261
2274
  size: "sm",
2262
2275
  label: "V2",
@@ -2264,11 +2277,11 @@ const ge = ot("recipeBulkEditor", function() {
2264
2277
  })) : T("", !0)
2265
2278
  ])
2266
2279
  ]),
2267
- h(V, {
2280
+ x(S, {
2268
2281
  variant: "tertiary",
2269
2282
  icon: "do_not_disturb_on",
2270
2283
  title: n(d)("inventory.recipe.bulkEditor.step1.removeRecipeTooltip"),
2271
- onClick: (P) => n(t).removeRecipe(R._id)
2284
+ onClick: (P) => n(t).removeRecipe(A._id)
2272
2285
  }, null, 8, ["title", "onClick"])
2273
2286
  ]))), 128))
2274
2287
  ]))
@@ -2292,21 +2305,21 @@ const ge = ot("recipeBulkEditor", function() {
2292
2305
  livePreviewEntries: {}
2293
2306
  },
2294
2307
  emits: ["update:modelValue"],
2295
- setup(m, { emit: d }) {
2296
- const l = m, t = d, { t: i } = ie(), r = ne(), x = We();
2297
- function u(w) {
2298
- const D = w.type === "replace-binding" ? w.from.type : w.type === "remove-binding" || w.type === "update-binding-rule" || w.type === "update-alternatives" ? w.target.type : w.type === "add-binding" ? w.binding.type : null;
2308
+ setup(p, { emit: d }) {
2309
+ const l = p, t = d, { t: i } = ie(), r = ne(), $ = We();
2310
+ function u(E) {
2311
+ const D = E.type === "replace-binding" ? E.from.type : E.type === "remove-binding" || E.type === "update-binding-rule" || E.type === "update-alternatives" ? E.target.type : E.type === "add-binding" ? E.binding.type : null;
2299
2312
  return D ? D === "RECIPE" ? "recipe" : "ingredient" : null;
2300
2313
  }
2301
- function o(w) {
2302
- return w.type === "update-alternatives" ? !0 : w.type === "add-binding" ? (w.binding.alternatives ?? []).length > 0 : w.type === "replace-binding" ? (w.to.alternatives ?? []).length > 0 : !1;
2314
+ function o(E) {
2315
+ return E.type === "update-alternatives" ? !0 : E.type === "add-binding" ? (E.binding.alternatives ?? []).length > 0 : E.type === "replace-binding" ? (E.to.alternatives ?? []).length > 0 : !1;
2303
2316
  }
2304
- function s(w) {
2305
- switch (w.type) {
2317
+ function s(E) {
2318
+ switch (E.type) {
2306
2319
  case "add-binding":
2307
2320
  return "link";
2308
2321
  case "replace-binding":
2309
- return w.from.id === w.to.id ? "update" : null;
2322
+ return E.from.id === E.to.id ? "update" : null;
2310
2323
  case "remove-binding":
2311
2324
  return "remove";
2312
2325
  case "update-binding-rule":
@@ -2315,79 +2328,79 @@ const ge = ot("recipeBulkEditor", function() {
2315
2328
  return "alts";
2316
2329
  }
2317
2330
  }
2318
- function a(w) {
2319
- return w.type === "replace-binding" ? w.from.id || null : (w.type === "remove-binding" || w.type === "update-binding-rule" || w.type === "update-alternatives") && w.target.id || null;
2331
+ function a(E) {
2332
+ return E.type === "replace-binding" ? E.from.id || null : (E.type === "remove-binding" || E.type === "update-binding-rule" || E.type === "update-alternatives") && E.target.id || null;
2320
2333
  }
2321
- function p(w) {
2322
- return w.type === "add-binding" && w.binding.id || null;
2334
+ function g(E) {
2335
+ return E.type === "add-binding" && E.binding.id || null;
2323
2336
  }
2324
- function $(w) {
2325
- const D = w.type === "replace-binding" ? w.to : w.type === "add-binding" ? w.binding : null;
2337
+ function h(E) {
2338
+ const D = E.type === "replace-binding" ? E.to : E.type === "add-binding" ? E.binding : null;
2326
2339
  return D ? { amount: D.amount, measurement: D.measurement ?? null } : ye();
2327
2340
  }
2328
- function C(w) {
2329
- return w.type === "replace-binding" ? w.to.rules ?? null : w.type === "add-binding" ? w.binding.rules ?? null : null;
2341
+ function C(E) {
2342
+ return E.type === "replace-binding" ? E.to.rules ?? null : E.type === "add-binding" ? E.binding.rules ?? null : null;
2330
2343
  }
2331
- function I(w) {
2332
- return w.type === "update-alternatives" ? w.alternatives ?? [] : w.type === "add-binding" ? w.binding.alternatives ?? [] : [];
2344
+ function I(E) {
2345
+ return E.type === "update-alternatives" ? E.alternatives ?? [] : E.type === "add-binding" ? E.binding.alternatives ?? [] : [];
2333
2346
  }
2334
- const f = W(u(l.modelValue)), k = W(s(l.modelValue)), S = W(o(l.modelValue)), b = W(a(l.modelValue)), e = W(p(l.modelValue)), V = W($(l.modelValue)), c = W(C(l.modelValue)), _ = W(I(l.modelValue)), N = W(
2347
+ const m = W(u(l.modelValue)), _ = W(s(l.modelValue)), w = W(o(l.modelValue)), y = W(a(l.modelValue)), e = W(g(l.modelValue)), S = W(h(l.modelValue)), c = W(C(l.modelValue)), k = W(I(l.modelValue)), N = W(
2335
2348
  (() => {
2336
- const w = $(l.modelValue);
2337
- return w.amount ? Q(w.amount) : "";
2349
+ const E = h(l.modelValue);
2350
+ return E.amount ? Q(E.amount) : "";
2338
2351
  })()
2339
2352
  );
2340
2353
  let z = null;
2341
- function g(w) {
2342
- N.value = w, z && clearTimeout(z), z = setTimeout(() => {
2343
- const D = +w;
2344
- V.value = {
2345
- amount: w.length > 0 && isFinite(D) ? Ke(D) : { amount: 0, precision: 0 },
2354
+ function b(E) {
2355
+ N.value = E, z && clearTimeout(z), z = setTimeout(() => {
2356
+ const D = +E;
2357
+ S.value = {
2358
+ amount: E.length > 0 && isFinite(D) ? Ke(D) : { amount: 0, precision: 0 },
2346
2359
  measurement: null
2347
2360
  };
2348
2361
  }, 300);
2349
2362
  }
2350
- ue(f, () => {
2351
- k.value = null, S.value = !1, b.value = null, e.value = null, V.value = ye(), c.value = null, _.value = [], N.value = "";
2352
- }), ue(k, () => {
2353
- b.value = null, e.value = null, V.value = ye(), c.value = null, _.value = [], N.value = "";
2354
- }), ue(S, (w) => {
2355
- w || (_.value = [], k.value === "alts" && (k.value = null));
2363
+ ue(m, () => {
2364
+ _.value = null, w.value = !1, y.value = null, e.value = null, S.value = ye(), c.value = null, k.value = [], N.value = "";
2365
+ }), ue(_, () => {
2366
+ y.value = null, e.value = null, S.value = ye(), c.value = null, k.value = [], N.value = "";
2367
+ }), ue(w, (E) => {
2368
+ E || (k.value = [], _.value === "alts" && (_.value = null));
2356
2369
  });
2357
- const B = A(() => [
2370
+ const B = R(() => [
2358
2371
  { label: i("inventory.recipe.bulkEditor.step2.fieldIngredient"), value: "ingredient" },
2359
2372
  { label: i("inventory.recipe.bulkEditor.step2.fieldRecipe"), value: "recipe" }
2360
- ]), F = A(() => {
2361
- const w = [
2373
+ ]), F = R(() => {
2374
+ const E = [
2362
2375
  { label: i("inventory.recipe.bulkEditor.step2.actionLink"), value: "link" },
2363
2376
  { label: i("inventory.recipe.bulkEditor.step2.actionUpdate"), value: "update" },
2364
2377
  { label: i("inventory.recipe.bulkEditor.step2.actionRemove"), value: "remove" }
2365
2378
  ];
2366
- return f.value === "ingredient" && S.value && x.enableRecipeV2 && w.push({ label: i("inventory.recipe.bulkEditor.step2.actionAlts"), value: "alts" }), w;
2367
- }), R = A(() => f.value !== null && k.value !== null), P = A(
2368
- () => k.value === "update" || k.value === "remove" || k.value === "alts"
2369
- ), K = A(
2370
- () => k.value === "link"
2371
- ), H = A(
2372
- () => k.value === "update" && b.value !== null
2373
- ), ee = A(
2374
- () => f.value === "ingredient" && S.value && x.enableRecipeV2
2375
- ), O = A(
2376
- () => r.skus.map((w) => ({ label: w.name, sublabel: w.code, value: w._id }))
2377
- ), M = A(
2378
- () => r.recipes.map((w) => ({ label: w.name, value: w._id }))
2379
- ), L = A(() => f.value === "recipe" ? M.value : O.value), q = A(() => f.value === "recipe" ? M.value : O.value), oe = A(() => f.value !== "ingredient" || !e.value ? null : r.skuById[e.value] ?? null), Z = A(() => f.value !== "ingredient" || !b.value ? null : r.skuById[b.value] ?? null), ae = A(() => {
2380
- const w = b.value ?? e.value;
2381
- return w ? [w] : [];
2382
- }), fe = A(() => ee.value ? Object.values(l.livePreviewEntries).filter(
2383
- (w) => w.original.version !== "v2"
2384
- ).length : 0), xe = A(() => Object.values(l.livePreviewEntries).length);
2379
+ return m.value === "ingredient" && w.value && $.enableRecipeV2 && E.push({ label: i("inventory.recipe.bulkEditor.step2.actionAlts"), value: "alts" }), E;
2380
+ }), A = R(() => m.value !== null && _.value !== null), P = R(
2381
+ () => _.value === "update" || _.value === "remove" || _.value === "alts"
2382
+ ), K = R(
2383
+ () => _.value === "link"
2384
+ ), H = R(
2385
+ () => _.value === "update" && y.value !== null
2386
+ ), ee = R(
2387
+ () => m.value === "ingredient" && w.value && $.enableRecipeV2
2388
+ ), O = R(
2389
+ () => r.skus.map((E) => ({ label: E.name, sublabel: E.code, value: E._id }))
2390
+ ), M = R(
2391
+ () => r.recipes.map((E) => ({ label: E.name, value: E._id }))
2392
+ ), L = R(() => m.value === "recipe" ? M.value : O.value), q = R(() => m.value === "recipe" ? M.value : O.value), oe = R(() => m.value !== "ingredient" || !e.value ? null : r.skuById[e.value] ?? null), Z = R(() => m.value !== "ingredient" || !y.value ? null : r.skuById[y.value] ?? null), ae = R(() => {
2393
+ const E = y.value ?? e.value;
2394
+ return E ? [E] : [];
2395
+ }), fe = R(() => ee.value ? Object.values(l.livePreviewEntries).filter(
2396
+ (E) => E.original.version !== "v2"
2397
+ ).length : 0), xe = R(() => Object.values(l.livePreviewEntries).length);
2385
2398
  ue(
2386
- () => [k.value, b.value],
2387
- ([w, D], [te, pe]) => {
2388
- if (w !== "alts" || D === pe) return;
2399
+ () => [_.value, y.value],
2400
+ ([E, D], [te, pe]) => {
2401
+ if (E !== "alts" || D === pe) return;
2389
2402
  if (!D) {
2390
- _.value = [];
2403
+ k.value = [];
2391
2404
  return;
2392
2405
  }
2393
2406
  const $e = Object.values(l.livePreviewEntries).find(
@@ -2395,228 +2408,228 @@ const ge = ot("recipeBulkEditor", function() {
2395
2408
  );
2396
2409
  if ($e) {
2397
2410
  const j = $e.original.contains.find((Ie) => Ie.type === "SKU" && Ie.id === D);
2398
- _.value = j != null && j.alternatives ? [...j.alternatives] : [];
2411
+ k.value = j != null && j.alternatives ? [...j.alternatives] : [];
2399
2412
  } else
2400
- _.value = [];
2413
+ k.value = [];
2401
2414
  }
2402
2415
  );
2403
- const re = A(() => k.value !== "alts" || !b.value ? 0 : Object.values(l.livePreviewEntries).filter(
2404
- (w) => w.original.version === "v2" && w.original.contains.some((D) => D.type === "SKU" && D.id === b.value)
2416
+ const re = R(() => _.value !== "alts" || !y.value ? 0 : Object.values(l.livePreviewEntries).filter(
2417
+ (E) => E.original.version === "v2" && E.original.contains.some((D) => D.type === "SKU" && D.id === y.value)
2405
2418
  ).length);
2406
2419
  function ve() {
2407
- return f.value === "recipe" ? "RECIPE" : "SKU";
2420
+ return m.value === "recipe" ? "RECIPE" : "SKU";
2408
2421
  }
2409
2422
  function ce() {
2410
- const w = ve(), D = ye().amount, te = {
2411
- type: w,
2423
+ const E = ve(), D = ye().amount, te = {
2424
+ type: E,
2412
2425
  id: "",
2413
2426
  amount: D,
2414
2427
  measurement: null,
2415
2428
  rules: null,
2416
2429
  alternatives: []
2417
2430
  };
2418
- switch (k.value) {
2431
+ switch (_.value) {
2419
2432
  case "update":
2420
- return { type: "replace-binding", from: { type: w, id: "" }, to: te };
2433
+ return { type: "replace-binding", from: { type: E, id: "" }, to: te };
2421
2434
  case "remove":
2422
- return { type: "remove-binding", target: { type: w, id: "" } };
2435
+ return { type: "remove-binding", target: { type: E, id: "" } };
2423
2436
  case "alts":
2424
- return { type: "update-alternatives", target: { type: w, id: "" }, alternatives: [] };
2437
+ return { type: "update-alternatives", target: { type: E, id: "" }, alternatives: [] };
2425
2438
  case "link":
2426
2439
  default:
2427
2440
  return { type: "add-binding", binding: te };
2428
2441
  }
2429
2442
  }
2430
2443
  function Ue() {
2431
- return b.value ? { type: ve(), id: b.value } : null;
2444
+ return y.value ? { type: ve(), id: y.value } : null;
2432
2445
  }
2433
- function Ye(w = !1) {
2434
- const D = w ? b.value : e.value;
2446
+ function Ye(E = !1) {
2447
+ const D = E ? y.value : e.value;
2435
2448
  if (!D) return null;
2436
- const { amount: te, measurement: pe } = V.value, Ee = pe ? he.multiplyDecimal(te, pe.conversion) : te;
2449
+ const { amount: te, measurement: pe } = S.value, Ee = pe ? he.multiplyDecimal(te, pe.conversion) : te;
2437
2450
  return {
2438
2451
  type: ve(),
2439
2452
  id: D,
2440
2453
  amount: Ee,
2441
2454
  measurement: pe ?? null,
2442
- rules: f.value === "recipe" ? c.value ?? null : null,
2443
- alternatives: ee.value ? _.value : []
2455
+ rules: m.value === "recipe" ? c.value ?? null : null,
2456
+ alternatives: ee.value ? k.value : []
2444
2457
  };
2445
2458
  }
2446
2459
  function ct() {
2447
- if (!f.value) return;
2448
- if (!k.value) {
2460
+ if (!m.value) return;
2461
+ if (!_.value) {
2449
2462
  t("update:modelValue", ce());
2450
2463
  return;
2451
2464
  }
2452
- const w = Ue(), D = Ye(!1);
2465
+ const E = Ue(), D = Ye(!1);
2453
2466
  let te = null;
2454
- switch (k.value) {
2467
+ switch (_.value) {
2455
2468
  case "link":
2456
2469
  D && (te = { type: "add-binding", binding: D });
2457
2470
  break;
2458
2471
  case "update": {
2459
2472
  const pe = Ye(!0);
2460
- w && pe && (te = { type: "replace-binding", from: w, to: pe });
2473
+ E && pe && (te = { type: "replace-binding", from: E, to: pe });
2461
2474
  break;
2462
2475
  }
2463
2476
  case "remove":
2464
- w && (te = { type: "remove-binding", target: w });
2477
+ E && (te = { type: "remove-binding", target: E });
2465
2478
  break;
2466
2479
  case "alts":
2467
- w && (te = { type: "update-alternatives", target: w, alternatives: _.value });
2480
+ E && (te = { type: "update-alternatives", target: E, alternatives: k.value });
2468
2481
  break;
2469
2482
  }
2470
2483
  t("update:modelValue", te ?? ce());
2471
2484
  }
2472
2485
  return ue(
2473
- [f, k, S, b, e, V, c, _],
2486
+ [m, _, w, y, e, S, c, k],
2474
2487
  () => ct(),
2475
2488
  { deep: !0 }
2476
- ), (w, D) => {
2489
+ ), (E, D) => {
2477
2490
  const te = G("FmSelect"), pe = G("FmSwitch"), Ee = G("FmIcon"), $e = G("FmTextField");
2478
- return y(), E("div", Lo, [
2479
- v("div", jo, [
2480
- v("div", Ko, [
2481
- h(te, {
2482
- modelValue: f.value,
2483
- "onUpdate:modelValue": D[0] || (D[0] = (j) => f.value = j),
2491
+ return v(), V("div", Lo, [
2492
+ f("div", jo, [
2493
+ f("div", Ko, [
2494
+ x(te, {
2495
+ modelValue: m.value,
2496
+ "onUpdate:modelValue": D[0] || (D[0] = (j) => m.value = j),
2484
2497
  items: B.value,
2485
2498
  label: n(i)("inventory.recipe.bulkEditor.step2.sectionField"),
2486
2499
  placeholder: n(i)("inventory.recipe.bulkEditor.step2.sectionField")
2487
2500
  }, null, 8, ["modelValue", "items", "label", "placeholder"])
2488
2501
  ]),
2489
- v("div", qo, [
2490
- h(te, {
2491
- modelValue: k.value,
2492
- "onUpdate:modelValue": D[1] || (D[1] = (j) => k.value = j),
2502
+ f("div", qo, [
2503
+ x(te, {
2504
+ modelValue: _.value,
2505
+ "onUpdate:modelValue": D[1] || (D[1] = (j) => _.value = j),
2493
2506
  items: F.value,
2494
2507
  label: n(i)("inventory.recipe.bulkEditor.step2.sectionAction"),
2495
2508
  placeholder: n(i)("inventory.recipe.bulkEditor.step2.sectionAction")
2496
2509
  }, null, 8, ["modelValue", "items", "label", "placeholder"])
2497
2510
  ])
2498
2511
  ]),
2499
- f.value === "ingredient" && n(x).enableRecipeV2 ? (y(), E("div", Wo, [
2500
- h(pe, {
2501
- modelValue: S.value,
2502
- "onUpdate:modelValue": D[2] || (D[2] = (j) => S.value = j),
2512
+ m.value === "ingredient" && n($).enableRecipeV2 ? (v(), V("div", Wo, [
2513
+ x(pe, {
2514
+ modelValue: w.value,
2515
+ "onUpdate:modelValue": D[2] || (D[2] = (j) => w.value = j),
2503
2516
  label: n(i)("inventory.recipe.bulkEditor.step2.includeAlternativesToggle")
2504
2517
  }, null, 8, ["modelValue", "label"])
2505
2518
  ])) : T("", !0),
2506
- ee.value && fe.value > 0 ? (y(), E("div", Yo, [
2507
- h(Ee, {
2519
+ ee.value && fe.value > 0 ? (v(), V("div", Yo, [
2520
+ x(Ee, {
2508
2521
  name: "warning",
2509
2522
  size: "sm",
2510
2523
  class: "text-fm-color-typo-warning mt-1 shrink-0"
2511
2524
  }),
2512
- v("p", Jo, U(n(i)("inventory.recipe.bulkEditor.step2.v1AlternativesWarning", {
2525
+ f("p", Jo, U(n(i)("inventory.recipe.bulkEditor.step2.v1AlternativesWarning", {
2513
2526
  v1Count: fe.value,
2514
2527
  total: xe.value
2515
2528
  })), 1)
2516
2529
  ])) : T("", !0),
2517
- R.value ? (y(), E("div", Ho, [
2518
- P.value ? (y(), E(X, { key: 0 }, [
2519
- v("p", Qo, U(n(i)("inventory.recipe.bulkEditor.addModification.targetLabel")), 1),
2520
- h(te, {
2521
- modelValue: b.value,
2522
- "onUpdate:modelValue": D[3] || (D[3] = (j) => b.value = j),
2530
+ A.value ? (v(), V("div", Ho, [
2531
+ P.value ? (v(), V(X, { key: 0 }, [
2532
+ f("p", Qo, U(n(i)("inventory.recipe.bulkEditor.addModification.targetLabel")), 1),
2533
+ x(te, {
2534
+ modelValue: y.value,
2535
+ "onUpdate:modelValue": D[3] || (D[3] = (j) => y.value = j),
2523
2536
  items: L.value,
2524
- placeholder: f.value === "recipe" ? n(i)("inventory.recipe.bulkEditor.addModification.recipePlaceholder") : n(i)("inventory.recipe.bulkEditor.addModification.skuPlaceholder"),
2537
+ placeholder: m.value === "recipe" ? n(i)("inventory.recipe.bulkEditor.addModification.recipePlaceholder") : n(i)("inventory.recipe.bulkEditor.addModification.skuPlaceholder"),
2525
2538
  clearable: ""
2526
2539
  }, {
2527
2540
  "menu-wrapper": J((j) => [
2528
- h(Fe, we(j, {
2541
+ x(Fe, we(j, {
2529
2542
  items: L.value,
2530
- "model-value": b.value
2543
+ "model-value": y.value
2531
2544
  }), null, 16, ["items", "model-value"])
2532
2545
  ]),
2533
2546
  _: 1
2534
2547
  }, 8, ["modelValue", "items", "placeholder"]),
2535
- H.value ? (y(), E(X, { key: 0 }, [
2536
- f.value === "ingredient" && Z.value ? (y(), Y(Be, {
2548
+ H.value ? (v(), V(X, { key: 0 }, [
2549
+ m.value === "ingredient" && Z.value ? (v(), Y(Be, {
2537
2550
  key: 0,
2538
- modelValue: V.value,
2539
- "onUpdate:modelValue": D[4] || (D[4] = (j) => V.value = j),
2551
+ modelValue: S.value,
2552
+ "onUpdate:modelValue": D[4] || (D[4] = (j) => S.value = j),
2540
2553
  unit: Z.value.unit,
2541
2554
  placeholder: n(i)("inventory.recipe.bulkEditor.query.amountPlaceholder"),
2542
2555
  "convert-amount-on-change-unit": ""
2543
- }, null, 8, ["modelValue", "unit", "placeholder"])) : f.value === "recipe" ? (y(), Y($e, {
2556
+ }, null, 8, ["modelValue", "unit", "placeholder"])) : m.value === "recipe" ? (v(), Y($e, {
2544
2557
  key: 1,
2545
2558
  "model-value": N.value,
2546
2559
  label: n(i)("inventory.recipe.bulkEditor.addModification.amountLabel"),
2547
2560
  type: "number",
2548
- "onUpdate:modelValue": D[5] || (D[5] = (j) => g(j))
2561
+ "onUpdate:modelValue": D[5] || (D[5] = (j) => b(j))
2549
2562
  }, null, 8, ["model-value", "label"])) : T("", !0),
2550
- f.value === "recipe" ? (y(), E(X, { key: 2 }, [
2551
- v("p", Xo, U(n(i)("inventory.recipe.bulkEditor.addModification.optionalRuleLabel")), 1),
2552
- h(Re, {
2563
+ m.value === "recipe" ? (v(), V(X, { key: 2 }, [
2564
+ f("p", Xo, U(n(i)("inventory.recipe.bulkEditor.addModification.optionalRuleLabel")), 1),
2565
+ x(Re, {
2553
2566
  modelValue: c.value,
2554
2567
  "onUpdate:modelValue": D[6] || (D[6] = (j) => c.value = j)
2555
2568
  }, null, 8, ["modelValue"])
2556
2569
  ], 64)) : T("", !0),
2557
- ee.value ? (y(), E(X, { key: 3 }, [
2558
- v("p", Zo, U(n(i)("inventory.recipe.bulkEditor.addModification.optionalAlternativesLabel")), 1),
2559
- h(Se, {
2560
- modelValue: _.value,
2561
- "onUpdate:modelValue": D[7] || (D[7] = (j) => _.value = j),
2570
+ ee.value ? (v(), V(X, { key: 3 }, [
2571
+ f("p", Zo, U(n(i)("inventory.recipe.bulkEditor.addModification.optionalAlternativesLabel")), 1),
2572
+ x(Se, {
2573
+ modelValue: k.value,
2574
+ "onUpdate:modelValue": D[7] || (D[7] = (j) => k.value = j),
2562
2575
  "filter-ingredient-ids": ae.value
2563
2576
  }, null, 8, ["modelValue", "filter-ingredient-ids"])
2564
2577
  ], 64)) : T("", !0)
2565
2578
  ], 64)) : T("", !0),
2566
- k.value === "alts" && b.value ? (y(), E(X, { key: 1 }, [
2567
- v("p", ei, U(re.value > 0 ? n(i)("inventory.recipe.bulkEditor.addModification.altsOverwriteWarning", { count: re.value }) : n(i)("inventory.recipe.bulkEditor.addModification.altsNotFoundWarning")), 1),
2568
- v("p", ti, U(n(i)("inventory.recipe.bulkEditor.addModification.altsClearNote")), 1),
2569
- h(Se, {
2570
- modelValue: _.value,
2571
- "onUpdate:modelValue": D[8] || (D[8] = (j) => _.value = j),
2579
+ _.value === "alts" && y.value ? (v(), V(X, { key: 1 }, [
2580
+ f("p", ei, U(re.value > 0 ? n(i)("inventory.recipe.bulkEditor.addModification.altsOverwriteWarning", { count: re.value }) : n(i)("inventory.recipe.bulkEditor.addModification.altsNotFoundWarning")), 1),
2581
+ f("p", ti, U(n(i)("inventory.recipe.bulkEditor.addModification.altsClearNote")), 1),
2582
+ x(Se, {
2583
+ modelValue: k.value,
2584
+ "onUpdate:modelValue": D[8] || (D[8] = (j) => k.value = j),
2572
2585
  "filter-ingredient-ids": ae.value
2573
2586
  }, null, 8, ["modelValue", "filter-ingredient-ids"])
2574
2587
  ], 64)) : T("", !0)
2575
2588
  ], 64)) : T("", !0),
2576
- K.value ? (y(), E(X, { key: 1 }, [
2577
- v("p", ni, U(n(i)("inventory.recipe.bulkEditor.addModification.bindingLabel")), 1),
2578
- h(te, {
2589
+ K.value ? (v(), V(X, { key: 1 }, [
2590
+ f("p", ni, U(n(i)("inventory.recipe.bulkEditor.addModification.bindingLabel")), 1),
2591
+ x(te, {
2579
2592
  modelValue: e.value,
2580
2593
  "onUpdate:modelValue": D[9] || (D[9] = (j) => e.value = j),
2581
2594
  items: q.value,
2582
- placeholder: f.value === "recipe" ? n(i)("inventory.recipe.bulkEditor.addModification.recipePlaceholder") : n(i)("inventory.recipe.bulkEditor.addModification.skuPlaceholder"),
2595
+ placeholder: m.value === "recipe" ? n(i)("inventory.recipe.bulkEditor.addModification.recipePlaceholder") : n(i)("inventory.recipe.bulkEditor.addModification.skuPlaceholder"),
2583
2596
  clearable: ""
2584
2597
  }, {
2585
2598
  "menu-wrapper": J((j) => [
2586
- h(Fe, we(j, {
2599
+ x(Fe, we(j, {
2587
2600
  items: q.value,
2588
2601
  "model-value": e.value
2589
2602
  }), null, 16, ["items", "model-value"])
2590
2603
  ]),
2591
2604
  _: 1
2592
2605
  }, 8, ["modelValue", "items", "placeholder"]),
2593
- e.value ? (y(), E(X, { key: 0 }, [
2594
- f.value === "ingredient" && oe.value ? (y(), Y(Be, {
2606
+ e.value ? (v(), V(X, { key: 0 }, [
2607
+ m.value === "ingredient" && oe.value ? (v(), Y(Be, {
2595
2608
  key: 0,
2596
- modelValue: V.value,
2597
- "onUpdate:modelValue": D[10] || (D[10] = (j) => V.value = j),
2609
+ modelValue: S.value,
2610
+ "onUpdate:modelValue": D[10] || (D[10] = (j) => S.value = j),
2598
2611
  unit: oe.value.unit,
2599
2612
  placeholder: n(i)("inventory.recipe.bulkEditor.query.amountPlaceholder"),
2600
2613
  "convert-amount-on-change-unit": ""
2601
- }, null, 8, ["modelValue", "unit", "placeholder"])) : f.value === "recipe" ? (y(), Y($e, {
2614
+ }, null, 8, ["modelValue", "unit", "placeholder"])) : m.value === "recipe" ? (v(), Y($e, {
2602
2615
  key: 1,
2603
2616
  "model-value": N.value,
2604
2617
  label: n(i)("inventory.recipe.bulkEditor.addModification.amountLabel"),
2605
2618
  type: "number",
2606
- "onUpdate:modelValue": D[11] || (D[11] = (j) => g(j))
2619
+ "onUpdate:modelValue": D[11] || (D[11] = (j) => b(j))
2607
2620
  }, null, 8, ["model-value", "label"])) : T("", !0),
2608
- f.value === "recipe" ? (y(), E(X, { key: 2 }, [
2609
- v("p", oi, U(n(i)("inventory.recipe.bulkEditor.addModification.optionalRuleLabel")), 1),
2610
- h(Re, {
2621
+ m.value === "recipe" ? (v(), V(X, { key: 2 }, [
2622
+ f("p", oi, U(n(i)("inventory.recipe.bulkEditor.addModification.optionalRuleLabel")), 1),
2623
+ x(Re, {
2611
2624
  modelValue: c.value,
2612
2625
  "onUpdate:modelValue": D[12] || (D[12] = (j) => c.value = j)
2613
2626
  }, null, 8, ["modelValue"])
2614
2627
  ], 64)) : T("", !0),
2615
- ee.value ? (y(), E(X, { key: 3 }, [
2616
- v("p", ii, U(n(i)("inventory.recipe.bulkEditor.addModification.optionalAlternativesLabel")), 1),
2617
- h(Se, {
2618
- modelValue: _.value,
2619
- "onUpdate:modelValue": D[13] || (D[13] = (j) => _.value = j),
2628
+ ee.value ? (v(), V(X, { key: 3 }, [
2629
+ f("p", ii, U(n(i)("inventory.recipe.bulkEditor.addModification.optionalAlternativesLabel")), 1),
2630
+ x(Se, {
2631
+ modelValue: k.value,
2632
+ "onUpdate:modelValue": D[13] || (D[13] = (j) => k.value = j),
2620
2633
  "filter-ingredient-ids": ae.value
2621
2634
  }, null, 8, ["modelValue", "filter-ingredient-ids"])
2622
2635
  ], 64)) : T("", !0)
@@ -2646,24 +2659,24 @@ const ge = ot("recipeBulkEditor", function() {
2646
2659
  class: "flex flex-col gap-4 pl-8"
2647
2660
  }, ki = { class: "flex-1 fm-typo-en-body-xs-400 text-fm-color-typo-secondary font-mono truncate" }, hi = /* @__PURE__ */ le({
2648
2661
  __name: "LivePreviewTable",
2649
- setup(m) {
2662
+ setup(p) {
2650
2663
  const { t: d } = ie(), l = ge(), t = ne(), i = {
2651
2664
  "will-update": 0,
2652
2665
  "partially-ignored": 1,
2653
2666
  "already-satisfied": 2,
2654
2667
  blocked: 3,
2655
2668
  "no-applicable-changes": 4
2656
- }, r = A(
2669
+ }, r = R(
2657
2670
  () => Object.values(l.livePreviewEntries).sort(
2658
- (e, V) => i[e.status] - i[V.status]
2671
+ (e, S) => i[e.status] - i[S.status]
2659
2672
  )
2660
- ), x = A(
2673
+ ), $ = R(
2661
2674
  () => r.value.filter((e) => e.status === "will-update").length
2662
- ), u = A(
2675
+ ), u = R(
2663
2676
  () => r.value.filter((e) => e.status === "partially-ignored").length
2664
- ), o = A(
2677
+ ), o = R(
2665
2678
  () => r.value.filter((e) => e.status === "already-satisfied").length
2666
- ), s = A(
2679
+ ), s = R(
2667
2680
  () => r.value.filter((e) => e.status === "blocked").length
2668
2681
  );
2669
2682
  function a(e) {
@@ -2682,7 +2695,7 @@ const ge = ot("recipeBulkEditor", function() {
2682
2695
  return "";
2683
2696
  }
2684
2697
  }
2685
- function p(e) {
2698
+ function g(e) {
2686
2699
  switch (e) {
2687
2700
  case "will-update":
2688
2701
  return "success";
@@ -2698,41 +2711,41 @@ const ge = ot("recipeBulkEditor", function() {
2698
2711
  return "neutral";
2699
2712
  }
2700
2713
  }
2701
- function $(e, V) {
2702
- var c, _, N;
2703
- return e === "SKU" ? ((c = t.skuById[V]) == null ? void 0 : c.name) ?? V : e === "SKU_GROUP" ? ((_ = t.skuGroupById[V]) == null ? void 0 : _.name) ?? V : e === "RECIPE" ? ((N = t.recipeById[V]) == null ? void 0 : N.name) ?? V : V;
2714
+ function h(e, S) {
2715
+ var c, k, N;
2716
+ return e === "SKU" ? ((c = t.skuById[S]) == null ? void 0 : c.name) ?? S : e === "SKU_GROUP" ? ((k = t.skuGroupById[S]) == null ? void 0 : k.name) ?? S : e === "RECIPE" ? ((N = t.recipeById[S]) == null ? void 0 : N.name) ?? S : S;
2704
2717
  }
2705
2718
  function C(e) {
2706
- var c, _;
2707
- const V = $(e.type, e.id);
2719
+ var c, k;
2720
+ const S = h(e.type, e.id);
2708
2721
  if (e.type === "SKU") {
2709
- const N = t.skuById[e.id], z = ((c = e.measurement) == null ? void 0 : c.abbrev) ?? ((_ = N == null ? void 0 : N.unit) == null ? void 0 : _.abbrev) ?? "";
2710
- return `${V} (${Q(e.amount)} ${z})`.trim();
2722
+ const N = t.skuById[e.id], z = ((c = e.measurement) == null ? void 0 : c.abbrev) ?? ((k = N == null ? void 0 : N.unit) == null ? void 0 : k.abbrev) ?? "";
2723
+ return `${S} (${Q(e.amount)} ${z})`.trim();
2711
2724
  }
2712
- return e.type === "RECIPE" ? `${V} ×${Q(e.amount)}` : V;
2725
+ return e.type === "RECIPE" ? `${S} ×${Q(e.amount)}` : S;
2713
2726
  }
2714
2727
  function I(e) {
2715
- return $(e.type, e.id);
2728
+ return h(e.type, e.id);
2716
2729
  }
2717
- function f(e, V) {
2718
- const c = V.contains.find((_) => _.type === e.type && _.id === e.id);
2730
+ function m(e, S) {
2731
+ const c = S.contains.find((k) => k.type === e.type && k.id === e.id);
2719
2732
  return c ? C(c) : I(e);
2720
2733
  }
2721
- function k(e, V) {
2734
+ function _(e, S) {
2722
2735
  switch (e.type) {
2723
2736
  case "add-binding":
2724
2737
  return `+ ${C(e.binding)}`;
2725
2738
  case "remove-binding":
2726
2739
  return `− ${I(e.target)}`;
2727
2740
  case "replace-binding":
2728
- return `${f(e.from, V)} → ${C(e.to)}`;
2741
+ return `${m(e.from, S)} → ${C(e.to)}`;
2729
2742
  case "update-binding-rule":
2730
2743
  return `Rule: ${I(e.target)}`;
2731
2744
  case "update-alternatives":
2732
2745
  return `Alternatives: ${I(e.target)}`;
2733
2746
  }
2734
2747
  }
2735
- function S(e) {
2748
+ function w(e) {
2736
2749
  switch (e) {
2737
2750
  case "applied":
2738
2751
  return "success";
@@ -2746,7 +2759,7 @@ const ge = ot("recipeBulkEditor", function() {
2746
2759
  return "neutral";
2747
2760
  }
2748
2761
  }
2749
- function b(e) {
2762
+ function y(e) {
2750
2763
  switch (e) {
2751
2764
  case "applied":
2752
2765
  return d("inventory.recipe.bulkEditor.livePreview.outcomeApplied");
@@ -2760,59 +2773,59 @@ const ge = ot("recipeBulkEditor", function() {
2760
2773
  return e;
2761
2774
  }
2762
2775
  }
2763
- return (e, V) => {
2776
+ return (e, S) => {
2764
2777
  const c = G("FmChip");
2765
- return y(), E("div", ri, [
2766
- v("div", ai, [
2767
- x.value + u.value > 0 ? (y(), E("div", si, [
2768
- h(c, {
2778
+ return v(), V("div", ri, [
2779
+ f("div", ai, [
2780
+ $.value + u.value > 0 ? (v(), V("div", si, [
2781
+ x(c, {
2769
2782
  size: "sm",
2770
- label: String(x.value + u.value),
2783
+ label: String($.value + u.value),
2771
2784
  variant: "success"
2772
2785
  }, null, 8, ["label"]),
2773
- v("span", di, U(n(d)("inventory.recipe.bulkEditor.livePreview.willUpdate")), 1)
2786
+ f("span", di, U(n(d)("inventory.recipe.bulkEditor.livePreview.willUpdate")), 1)
2774
2787
  ])) : T("", !0),
2775
- o.value > 0 ? (y(), E("div", ui, [
2776
- h(c, {
2788
+ o.value > 0 ? (v(), V("div", ui, [
2789
+ x(c, {
2777
2790
  size: "sm",
2778
2791
  label: String(o.value),
2779
2792
  variant: "info"
2780
2793
  }, null, 8, ["label"]),
2781
- v("span", ci, U(n(d)("inventory.recipe.bulkEditor.livePreview.alreadySatisfied")), 1)
2794
+ f("span", ci, U(n(d)("inventory.recipe.bulkEditor.livePreview.alreadySatisfied")), 1)
2782
2795
  ])) : T("", !0),
2783
- s.value > 0 ? (y(), E("div", pi, [
2784
- h(c, {
2796
+ s.value > 0 ? (v(), V("div", pi, [
2797
+ x(c, {
2785
2798
  size: "sm",
2786
2799
  label: String(s.value),
2787
2800
  variant: "critical"
2788
2801
  }, null, 8, ["label"]),
2789
- v("span", mi, U(n(d)("inventory.recipe.bulkEditor.livePreview.blocked")), 1)
2802
+ f("span", mi, U(n(d)("inventory.recipe.bulkEditor.livePreview.blocked")), 1)
2790
2803
  ])) : T("", !0)
2791
2804
  ]),
2792
- v("div", fi, [
2793
- r.value.length === 0 ? (y(), E("div", vi, U(n(d)("inventory.recipe.bulkEditor.livePreview.noRecipes")), 1)) : (y(), E("div", yi, [
2794
- (y(!0), E(X, null, me(r.value, (_) => (y(), E("div", {
2795
- key: _.recipeId,
2805
+ f("div", fi, [
2806
+ r.value.length === 0 ? (v(), V("div", vi, U(n(d)("inventory.recipe.bulkEditor.livePreview.noRecipes")), 1)) : (v(), V("div", yi, [
2807
+ (v(!0), V(X, null, me(r.value, (k) => (v(), V("div", {
2808
+ key: k.recipeId,
2796
2809
  class: "flex flex-col gap-6 px-16 py-10"
2797
2810
  }, [
2798
- v("div", bi, [
2799
- v("span", gi, U(_.recipeName), 1),
2800
- h(c, {
2811
+ f("div", bi, [
2812
+ f("span", gi, U(k.recipeName), 1),
2813
+ x(c, {
2801
2814
  size: "sm",
2802
- label: a(_.status),
2803
- variant: p(_.status)
2815
+ label: a(k.status),
2816
+ variant: g(k.status)
2804
2817
  }, null, 8, ["label", "variant"])
2805
2818
  ]),
2806
- _.changes.length > 0 ? (y(), E("div", _i, [
2807
- (y(!0), E(X, null, me(_.changes, (N, z) => (y(), E("div", {
2819
+ k.changes.length > 0 ? (v(), V("div", _i, [
2820
+ (v(!0), V(X, null, me(k.changes, (N, z) => (v(), V("div", {
2808
2821
  key: z,
2809
2822
  class: "flex items-center gap-8"
2810
2823
  }, [
2811
- v("span", ki, U(k(N.change, _.original)), 1),
2812
- h(c, {
2824
+ f("span", ki, U(_(N.change, k.original)), 1),
2825
+ x(c, {
2813
2826
  size: "sm",
2814
- label: b(N.outcome),
2815
- variant: S(N.outcome)
2827
+ label: y(N.outcome),
2828
+ variant: w(N.outcome)
2816
2829
  }, null, 8, ["label", "variant"])
2817
2830
  ]))), 128))
2818
2831
  ])) : T("", !0)
@@ -2830,7 +2843,7 @@ const ge = ot("recipeBulkEditor", function() {
2830
2843
  class: "flex flex-col items-center justify-center py-40 gap-8 text-center rounded-lg border border-dashed border-fm-color-border-default"
2831
2844
  }, Si = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ci = { class: "flex-1 overflow-y-auto px-16 py-14 flex flex-col gap-12 min-h-0" }, Bi = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary shrink-0" }, Fi = /* @__PURE__ */ le({
2832
2845
  __name: "RecipeBulkEditorStep2",
2833
- setup(m) {
2846
+ setup(p) {
2834
2847
  const { t: d } = ie(), l = ge(), t = W(null);
2835
2848
  ue(
2836
2849
  () => l.modifications.length,
@@ -2843,13 +2856,13 @@ const ge = ot("recipeBulkEditor", function() {
2843
2856
  const a = o.type === "replace-binding" ? o.from.type : o.type === "remove-binding" || o.type === "update-binding-rule" || o.type === "update-alternatives" ? o.target.type : o.type === "add-binding" ? o.binding.type : null;
2844
2857
  return a === "RECIPE" ? d("inventory.recipe.bulkEditor.step2.fieldRecipe") : a === "SKU" || a === "SKU_GROUP" ? d("inventory.recipe.bulkEditor.step2.fieldIngredient") : d("inventory.recipe.bulkEditor.step2.tabLabel", { n: s + 1 });
2845
2858
  }
2846
- const r = A(
2859
+ const r = R(
2847
2860
  () => l.modifications.map((o, s) => ({
2848
2861
  label: i(o, s),
2849
2862
  value: s
2850
2863
  }))
2851
2864
  );
2852
- function x() {
2865
+ function $() {
2853
2866
  const s = {
2854
2867
  type: "add-binding",
2855
2868
  binding: {
@@ -2867,28 +2880,28 @@ const ge = ot("recipeBulkEditor", function() {
2867
2880
  l.removeModification(o);
2868
2881
  }
2869
2882
  return (o, s) => {
2870
- const a = G("FmButton"), p = G("FmTab"), $ = G("FmTabs"), C = G("FmIcon");
2871
- return y(), E("div", xi, [
2872
- v("div", $i, [
2873
- v("div", Ii, [
2874
- v("div", wi, [
2875
- r.value.length > 0 ? (y(), Y($, {
2883
+ const a = G("FmButton"), g = G("FmTab"), h = G("FmTabs"), C = G("FmIcon");
2884
+ return v(), V("div", xi, [
2885
+ f("div", $i, [
2886
+ f("div", Ii, [
2887
+ f("div", wi, [
2888
+ r.value.length > 0 ? (v(), Y(h, {
2876
2889
  key: 0,
2877
2890
  "model-value": t.value,
2878
2891
  items: r.value,
2879
2892
  "onUpdate:modelValue": s[1] || (s[1] = (I) => t.value = I)
2880
2893
  }, {
2881
2894
  default: J((I) => [
2882
- h(p, we(I, {
2895
+ x(g, we(I, {
2883
2896
  "model-value": t.value,
2884
- "onUpdate:modelValue": s[0] || (s[0] = (f) => t.value = f)
2897
+ "onUpdate:modelValue": s[0] || (s[0] = (m) => t.value = m)
2885
2898
  }), {
2886
2899
  append: J(() => [
2887
- h(a, {
2900
+ x(a, {
2888
2901
  variant: "tertiary",
2889
2902
  icon: "close",
2890
2903
  size: "md",
2891
- onClick: ft((f) => u(I.value), ["stop"])
2904
+ onClick: ft((m) => u(I.value), ["stop"])
2892
2905
  }, null, 8, ["onClick"])
2893
2906
  ]),
2894
2907
  _: 2
@@ -2897,24 +2910,24 @@ const ge = ot("recipeBulkEditor", function() {
2897
2910
  _: 1
2898
2911
  }, 8, ["model-value", "items"])) : T("", !0)
2899
2912
  ]),
2900
- h(a, {
2913
+ x(a, {
2901
2914
  label: n(d)("inventory.recipe.bulkEditor.step2.addModification"),
2902
2915
  variant: "secondary",
2903
2916
  size: "md",
2904
2917
  "prepend-icon": "add",
2905
2918
  class: "shrink-0",
2906
- onClick: x
2919
+ onClick: $
2907
2920
  }, null, 8, ["label"])
2908
2921
  ]),
2909
- v("div", Ei, [
2910
- n(l).modifications.length === 0 ? (y(), E("div", Vi, [
2911
- h(C, {
2922
+ f("div", Ei, [
2923
+ n(l).modifications.length === 0 ? (v(), V("div", Vi, [
2924
+ x(C, {
2912
2925
  name: "edit_note",
2913
2926
  size: "lg",
2914
2927
  class: "text-fm-color-typo-placeholder"
2915
2928
  }),
2916
- v("p", Si, U(n(d)("inventory.recipe.bulkEditor.step2.emptyState")), 1)
2917
- ])) : t.value !== null && n(l).modifications[t.value] ? (y(), Y(li, {
2929
+ f("p", Si, U(n(d)("inventory.recipe.bulkEditor.step2.emptyState")), 1)
2930
+ ])) : t.value !== null && n(l).modifications[t.value] ? (v(), Y(li, {
2918
2931
  key: t.value,
2919
2932
  "model-value": n(l).modifications[t.value],
2920
2933
  "live-preview-entries": n(l).livePreviewEntries,
@@ -2922,67 +2935,67 @@ const ge = ot("recipeBulkEditor", function() {
2922
2935
  }, null, 8, ["model-value", "live-preview-entries"])) : T("", !0)
2923
2936
  ])
2924
2937
  ]),
2925
- s[3] || (s[3] = v("div", { class: "border-t border-fm-color-border-default shrink-0" }, null, -1)),
2926
- v("div", Ci, [
2927
- v("span", Bi, U(n(d)("inventory.recipe.bulkEditor.step2.livePreviewTitle")), 1),
2928
- h(hi)
2938
+ s[3] || (s[3] = f("div", { class: "border-t border-fm-color-border-default shrink-0" }, null, -1)),
2939
+ f("div", Ci, [
2940
+ f("span", Bi, U(n(d)("inventory.recipe.bulkEditor.step2.livePreviewTitle")), 1),
2941
+ x(hi)
2929
2942
  ])
2930
2943
  ]);
2931
2944
  };
2932
2945
  }
2933
2946
  });
2934
- function Ri(m) {
2935
- return !m || Object.keys(m).length === 0 ? "" : Object.entries(m).map(([d, l]) => `${d}: ${l}`).join(", ");
2947
+ function Ri(p) {
2948
+ return !p || Object.keys(p).length === 0 ? "" : Object.entries(p).map(([d, l]) => `${d}: ${l}`).join(", ");
2936
2949
  }
2937
2950
  function Ai() {
2938
- const m = ne(), d = ge(), l = m.skuById, t = m.recipeById, i = m.skuGroupById, x = Object.values(d.entries).filter(
2951
+ const p = ne(), d = ge(), l = p.skuById, t = p.recipeById, i = p.skuGroupById, $ = Object.values(d.entries).filter(
2939
2952
  (s) => s.status === "will-update" || s.status === "partially-ignored"
2940
2953
  ).flatMap((s, a) => {
2941
2954
  var C;
2942
- const p = s.projected ?? s.original, $ = Ri(p.customAttributes);
2943
- if ((C = p.contains) != null && C.length) {
2944
- const I = p.contains.filter((S) => S.type === "RECIPE"), f = p.contains.filter((S) => S.type === "SKU"), k = p.contains.filter((S) => S.type === "SKU_GROUP");
2955
+ const g = s.projected ?? s.original, h = Ri(g.customAttributes);
2956
+ if ((C = g.contains) != null && C.length) {
2957
+ const I = g.contains.filter((w) => w.type === "RECIPE"), m = g.contains.filter((w) => w.type === "SKU"), _ = g.contains.filter((w) => w.type === "SKU_GROUP");
2945
2958
  return [
2946
2959
  ...a === 0 ? [] : [["", "", "", "", "", "", ""]],
2947
2960
  ...I.map(
2948
- (S, b) => {
2961
+ (w, y) => {
2949
2962
  var e;
2950
2963
  return [
2951
- b === 0 ? p.name : "",
2964
+ y === 0 ? g.name : "",
2952
2965
  "RECIPE",
2953
2966
  "",
2954
- ((e = t[S.id]) == null ? void 0 : e.name) ?? S.id,
2955
- Q(S.amount),
2967
+ ((e = t[w.id]) == null ? void 0 : e.name) ?? w.id,
2968
+ Q(w.amount),
2956
2969
  "UNIT",
2957
- b === 0 ? $ : ""
2970
+ y === 0 ? h : ""
2958
2971
  ];
2959
2972
  }
2960
2973
  ),
2961
- ...f.map(
2962
- (S, b) => {
2963
- var e, V, c, _;
2974
+ ...m.map(
2975
+ (w, y) => {
2976
+ var e, S, c, k;
2964
2977
  return [
2965
- !I.length && b === 0 ? p.name : "",
2978
+ !I.length && y === 0 ? g.name : "",
2966
2979
  "INGREDIENT",
2967
- ((e = l[S.id]) == null ? void 0 : e.code) ?? "",
2968
- ((V = l[S.id]) == null ? void 0 : V.name) ?? S.id,
2969
- Q(S.amount),
2970
- S.measurement ? S.measurement.abbrev : ((_ = (c = l[S.id]) == null ? void 0 : c.unit) == null ? void 0 : _.abbrev) ?? "",
2971
- !I.length && b === 0 ? $ : ""
2980
+ ((e = l[w.id]) == null ? void 0 : e.code) ?? "",
2981
+ ((S = l[w.id]) == null ? void 0 : S.name) ?? w.id,
2982
+ Q(w.amount),
2983
+ w.measurement ? w.measurement.abbrev : ((k = (c = l[w.id]) == null ? void 0 : c.unit) == null ? void 0 : k.abbrev) ?? "",
2984
+ !I.length && y === 0 ? h : ""
2972
2985
  ];
2973
2986
  }
2974
2987
  ),
2975
- ...k.map(
2976
- (S, b) => {
2977
- var e, V;
2988
+ ..._.map(
2989
+ (w, y) => {
2990
+ var e, S;
2978
2991
  return [
2979
- I.length === 0 && f.length === 0 && b === 0 ? p.name : "",
2992
+ I.length === 0 && m.length === 0 && y === 0 ? g.name : "",
2980
2993
  "SKU_GROUP",
2981
- ((e = i[S.id]) == null ? void 0 : e.ref) ?? "",
2982
- ((V = i[S.id]) == null ? void 0 : V.name) ?? S.id,
2983
- Q(S.amount),
2994
+ ((e = i[w.id]) == null ? void 0 : e.ref) ?? "",
2995
+ ((S = i[w.id]) == null ? void 0 : S.name) ?? w.id,
2996
+ Q(w.amount),
2984
2997
  "UNIT",
2985
- I.length === 0 && f.length === 0 && b === 0 ? $ : ""
2998
+ I.length === 0 && m.length === 0 && y === 0 ? h : ""
2986
2999
  ];
2987
3000
  }
2988
3001
  )
@@ -2990,9 +3003,9 @@ function Ai() {
2990
3003
  }
2991
3004
  return [
2992
3005
  ...a === 0 ? [] : [["", "", "", "", "", "", ""]],
2993
- [p.name, "No bindings", "", "", "", "", $]
3006
+ [g.name, "No bindings", "", "", "", "", h]
2994
3007
  ];
2995
- }), o = at(x, ["Name", "Type", "Code", "Item", "Amount", "Unit", "Custom Attributes"]);
3008
+ }), o = at($, ["Name", "Type", "Code", "Item", "Amount", "Unit", "Custom Attributes"]);
2996
3009
  st(o, `RECIPE_BULK_EDIT_${dt(/* @__PURE__ */ new Date(), "-", "-")}.xlsx`);
2997
3010
  }
2998
3011
  const Ti = { class: "flex flex-col gap-16" }, Ui = { class: "rounded-lg border border-fm-color-border-default bg-fm-color-surface-secondary p-16" }, Pi = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary mb-8" }, Mi = { class: "flex flex-wrap gap-12" }, Di = { class: "flex items-center gap-6" }, Gi = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ni = {
@@ -3024,90 +3037,90 @@ const Ti = { class: "flex flex-col gap-16" }, Ui = { class: "rounded-lg border b
3024
3037
  class: "text-fm-color-typo-placeholder"
3025
3038
  }, rl = /* @__PURE__ */ le({
3026
3039
  __name: "RecipeBulkEditorSummaryStep",
3027
- setup(m) {
3028
- const { t: d } = ie(), l = ne(), t = ge(), i = A(() => Object.values(t.entries)), r = A(
3040
+ setup(p) {
3041
+ const { t: d } = ie(), l = ne(), t = ge(), i = R(() => Object.values(t.entries)), r = R(
3029
3042
  () => i.value.filter((e) => e.status === "will-update").length
3030
- ), x = A(
3043
+ ), $ = R(
3031
3044
  () => i.value.filter((e) => e.status === "partially-ignored").length
3032
- ), u = A(
3045
+ ), u = R(
3033
3046
  () => i.value.filter((e) => e.status === "already-satisfied").length
3034
- ), o = A(
3047
+ ), o = R(
3035
3048
  () => i.value.filter((e) => e.status === "blocked").length
3036
- ), s = A(
3049
+ ), s = R(
3037
3050
  () => i.value.filter((e) => e.status === "no-applicable-changes").length
3038
3051
  ), a = W(/* @__PURE__ */ new Set());
3039
- function p(e) {
3052
+ function g(e) {
3040
3053
  return a.value.has(e);
3041
3054
  }
3042
- function $(e) {
3043
- const V = new Set(a.value);
3044
- V.has(e) ? V.delete(e) : V.add(e), a.value = V;
3055
+ function h(e) {
3056
+ const S = new Set(a.value);
3057
+ S.has(e) ? S.delete(e) : S.add(e), a.value = S;
3045
3058
  }
3046
3059
  function C(e) {
3047
- var _, N, z;
3048
- const V = [], c = ke(e.contains, /* @__PURE__ */ new Set([e._id]), l.recipeById);
3049
- for (let g = 0; g < c.length; g++) {
3050
- const B = c[g], F = B.recipeIds.slice(1).length > 0, R = F ? ((_ = l.recipeById[B.recipeIds.at(-1) ?? ""]) == null ? void 0 : _.name) ?? "" : "";
3060
+ var k, N, z;
3061
+ const S = [], c = ke(e.contains, /* @__PURE__ */ new Set([e._id]), l.recipeById);
3062
+ for (let b = 0; b < c.length; b++) {
3063
+ const B = c[b], F = B.recipeIds.slice(1).length > 0, A = F ? ((k = l.recipeById[B.recipeIds.at(-1) ?? ""]) == null ? void 0 : k.name) ?? "" : "";
3051
3064
  let P;
3052
3065
  if (B.isGroup) {
3053
3066
  const K = l.skuGroupById[B.id];
3054
3067
  if (!K) continue;
3055
3068
  const H = `x${Q(B.amount)}`;
3056
- P = F ? `(${R}) ${K.name} (${H})` : `${K.name} (${H})`;
3069
+ P = F ? `(${A}) ${K.name} (${H})` : `${K.name} (${H})`;
3057
3070
  } else {
3058
3071
  const K = l.skuById[B.id];
3059
3072
  if (!K) continue;
3060
3073
  const H = ((N = B.measurement) == null ? void 0 : N.abbrev) ?? ((z = K.unit) == null ? void 0 : z.abbrev) ?? "", ee = `${Q(B.amount)}${H}`;
3061
- P = F ? `(${R}) ${K.name} (${ee})` : `${K.name} (${ee})`;
3074
+ P = F ? `(${A}) ${K.name} (${ee})` : `${K.name} (${ee})`;
3062
3075
  }
3063
- g > 0 && V.push({ text: ", " }), V.push({ text: P });
3076
+ b > 0 && S.push({ text: ", " }), S.push({ text: P });
3064
3077
  }
3065
- return V;
3078
+ return S;
3066
3079
  }
3067
3080
  function I(e) {
3068
- var g, B, F, R;
3081
+ var b, B, F, A;
3069
3082
  if (e.isGroup) {
3070
3083
  const P = l.skuGroupById[e.id];
3071
3084
  if (!P) return "";
3072
- const K = e.recipeIds.slice(1).length > 0, H = K ? ((g = l.recipeById[e.recipeIds.at(-1) ?? ""]) == null ? void 0 : g.name) ?? "" : "", ee = `x${Q(e.amount)}`;
3085
+ const K = e.recipeIds.slice(1).length > 0, H = K ? ((b = l.recipeById[e.recipeIds.at(-1) ?? ""]) == null ? void 0 : b.name) ?? "" : "", ee = `x${Q(e.amount)}`;
3073
3086
  return K ? `(${H}) ${P.name} (${ee})` : `${P.name} (${ee})`;
3074
3087
  }
3075
- const V = l.skuById[e.id];
3076
- if (!V) return "";
3077
- const c = e.recipeIds.slice(1).length > 0, _ = c ? ((B = l.recipeById[e.recipeIds.at(-1) ?? ""]) == null ? void 0 : B.name) ?? "" : "", N = ((F = e.measurement) == null ? void 0 : F.abbrev) ?? ((R = V.unit) == null ? void 0 : R.abbrev) ?? "", z = `${Q(e.amount)}${N}`;
3078
- return c ? `(${_}) ${V.name} (${z})` : `${V.name} (${z})`;
3088
+ const S = l.skuById[e.id];
3089
+ if (!S) return "";
3090
+ const c = e.recipeIds.slice(1).length > 0, k = c ? ((B = l.recipeById[e.recipeIds.at(-1) ?? ""]) == null ? void 0 : B.name) ?? "" : "", N = ((F = e.measurement) == null ? void 0 : F.abbrev) ?? ((A = S.unit) == null ? void 0 : A.abbrev) ?? "", z = `${Q(e.amount)}${N}`;
3091
+ return c ? `(${k}) ${S.name} (${z})` : `${S.name} (${z})`;
3079
3092
  }
3080
- function f(e) {
3093
+ function m(e) {
3081
3094
  if (!e.projected) return [];
3082
- const V = ke(e.original.contains, /* @__PURE__ */ new Set([e.recipeId]), l.recipeById), c = ke(e.projected.contains, /* @__PURE__ */ new Set([e.recipeId]), l.recipeById), _ = /* @__PURE__ */ new Map();
3083
- for (const F of V) _.set(`${F.type}:${F.id}`, F);
3095
+ const S = ke(e.original.contains, /* @__PURE__ */ new Set([e.recipeId]), l.recipeById), c = ke(e.projected.contains, /* @__PURE__ */ new Set([e.recipeId]), l.recipeById), k = /* @__PURE__ */ new Map();
3096
+ for (const F of S) k.set(`${F.type}:${F.id}`, F);
3084
3097
  const N = /* @__PURE__ */ new Map();
3085
3098
  for (const F of c) N.set(`${F.type}:${F.id}`, F);
3086
3099
  const z = [];
3087
- let g = !0;
3088
- function B(F, R) {
3089
- R && (g || z.push({ kind: "unchanged", text: ", " }), z.push({ kind: F, text: R }), g = !1);
3100
+ let b = !0;
3101
+ function B(F, A) {
3102
+ A && (b || z.push({ kind: "unchanged", text: ", " }), z.push({ kind: F, text: A }), b = !1);
3090
3103
  }
3091
- for (const [F, R] of _) {
3104
+ for (const [F, A] of k) {
3092
3105
  const P = N.get(F);
3093
3106
  if (!P)
3094
- B("removed", I(R));
3107
+ B("removed", I(A));
3095
3108
  else {
3096
- const K = I(R), H = I(P);
3109
+ const K = I(A), H = I(P);
3097
3110
  K === H ? B("unchanged", K) : (B("removed", K), B("added", H));
3098
3111
  }
3099
3112
  }
3100
- for (const [F, R] of N)
3101
- _.has(F) || B("added", I(R));
3113
+ for (const [F, A] of N)
3114
+ k.has(F) || B("added", I(A));
3102
3115
  return z;
3103
3116
  }
3104
- const k = A(() => {
3117
+ const _ = R(() => {
3105
3118
  const e = /* @__PURE__ */ new Map();
3106
- for (const V of i.value)
3107
- e.set(V.recipeId, f(V));
3119
+ for (const S of i.value)
3120
+ e.set(S.recipeId, m(S));
3108
3121
  return e;
3109
3122
  });
3110
- function S(e) {
3123
+ function w(e) {
3111
3124
  switch (e) {
3112
3125
  case "will-update":
3113
3126
  return d("inventory.recipe.bulkEditor.status.willUpdate");
@@ -3123,7 +3136,7 @@ const Ti = { class: "flex flex-col gap-16" }, Ui = { class: "rounded-lg border b
3123
3136
  return "";
3124
3137
  }
3125
3138
  }
3126
- function b(e) {
3139
+ function y(e) {
3127
3140
  switch (e) {
3128
3141
  case "will-update":
3129
3142
  return "success";
@@ -3139,121 +3152,121 @@ const Ti = { class: "flex flex-col gap-16" }, Ui = { class: "rounded-lg border b
3139
3152
  return "neutral";
3140
3153
  }
3141
3154
  }
3142
- return (e, V) => {
3143
- const c = G("FmChip"), _ = G("FmButton"), N = G("FmBanner"), z = G("FmIcon");
3144
- return y(), E("div", Ti, [
3145
- v("div", Ui, [
3146
- v("p", Pi, U(n(d)("inventory.recipe.bulkEditor.summary.title")), 1),
3147
- v("div", Mi, [
3148
- v("div", Di, [
3149
- h(c, {
3155
+ return (e, S) => {
3156
+ const c = G("FmChip"), k = G("FmButton"), N = G("FmBanner"), z = G("FmIcon");
3157
+ return v(), V("div", Ti, [
3158
+ f("div", Ui, [
3159
+ f("p", Pi, U(n(d)("inventory.recipe.bulkEditor.summary.title")), 1),
3160
+ f("div", Mi, [
3161
+ f("div", Di, [
3162
+ x(c, {
3150
3163
  size: "sm",
3151
3164
  label: String(r.value),
3152
3165
  variant: "success"
3153
3166
  }, null, 8, ["label"]),
3154
- v("span", Gi, U(n(d)("inventory.recipe.bulkEditor.summary.countWillUpdate")), 1)
3167
+ f("span", Gi, U(n(d)("inventory.recipe.bulkEditor.summary.countWillUpdate")), 1)
3155
3168
  ]),
3156
- x.value > 0 ? (y(), E("div", Ni, [
3157
- h(c, {
3169
+ $.value > 0 ? (v(), V("div", Ni, [
3170
+ x(c, {
3158
3171
  size: "sm",
3159
- label: String(x.value),
3172
+ label: String($.value),
3160
3173
  variant: "warning"
3161
3174
  }, null, 8, ["label"]),
3162
- v("span", zi, U(n(d)("inventory.recipe.bulkEditor.summary.countPartiallyIgnored")), 1)
3175
+ f("span", zi, U(n(d)("inventory.recipe.bulkEditor.summary.countPartiallyIgnored")), 1)
3163
3176
  ])) : T("", !0),
3164
- u.value > 0 ? (y(), E("div", Oi, [
3165
- h(c, {
3177
+ u.value > 0 ? (v(), V("div", Oi, [
3178
+ x(c, {
3166
3179
  size: "sm",
3167
3180
  label: String(u.value),
3168
3181
  variant: "info"
3169
3182
  }, null, 8, ["label"]),
3170
- v("span", Li, U(n(d)("inventory.recipe.bulkEditor.summary.countAlreadySatisfied")), 1)
3183
+ f("span", Li, U(n(d)("inventory.recipe.bulkEditor.summary.countAlreadySatisfied")), 1)
3171
3184
  ])) : T("", !0),
3172
- o.value > 0 ? (y(), E("div", ji, [
3173
- h(c, {
3185
+ o.value > 0 ? (v(), V("div", ji, [
3186
+ x(c, {
3174
3187
  size: "sm",
3175
3188
  label: String(o.value),
3176
3189
  variant: "critical"
3177
3190
  }, null, 8, ["label"]),
3178
- v("span", Ki, U(n(d)("inventory.recipe.bulkEditor.summary.countBlocked")), 1)
3191
+ f("span", Ki, U(n(d)("inventory.recipe.bulkEditor.summary.countBlocked")), 1)
3179
3192
  ])) : T("", !0),
3180
- s.value > 0 ? (y(), E("div", qi, [
3181
- h(c, {
3193
+ s.value > 0 ? (v(), V("div", qi, [
3194
+ x(c, {
3182
3195
  size: "sm",
3183
3196
  label: String(s.value),
3184
3197
  variant: "neutral"
3185
3198
  }, null, 8, ["label"]),
3186
- v("span", Wi, U(n(d)("inventory.recipe.bulkEditor.summary.countNoChanges")), 1)
3199
+ f("span", Wi, U(n(d)("inventory.recipe.bulkEditor.summary.countNoChanges")), 1)
3187
3200
  ])) : T("", !0)
3188
3201
  ]),
3189
- v("div", Yi, [
3190
- h(_, {
3202
+ f("div", Yi, [
3203
+ x(k, {
3191
3204
  label: n(d)("common.export"),
3192
3205
  variant: "secondary",
3193
3206
  size: "md",
3194
3207
  onClick: n(Ai)
3195
3208
  }, null, 8, ["label", "onClick"])
3196
3209
  ]),
3197
- r.value === 0 && x.value === 0 ? (y(), Y(N, {
3210
+ r.value === 0 && $.value === 0 ? (v(), Y(N, {
3198
3211
  key: 0,
3199
3212
  class: "mt-12",
3200
3213
  type: "warning",
3201
3214
  message: n(d)("inventory.recipe.bulkEditor.summary.nothingToSubmit")
3202
3215
  }, null, 8, ["message"])) : T("", !0)
3203
3216
  ]),
3204
- (y(!0), E(X, null, me(i.value, (g) => (y(), E("div", {
3205
- key: g.recipeId,
3217
+ (v(!0), V(X, null, me(i.value, (b) => (v(), V("div", {
3218
+ key: b.recipeId,
3206
3219
  class: "rounded-lg border border-fm-color-border-default overflow-hidden"
3207
3220
  }, [
3208
- v("button", {
3221
+ f("button", {
3209
3222
  type: "button",
3210
- class: Ce(["w-full flex items-center gap-8 px-12 py-10 bg-fm-color-surface-secondary border-b border-fm-color-border-default text-left cursor-pointer", { "border-b-0": !p(g.recipeId) }]),
3211
- onClick: (B) => $(g.recipeId)
3223
+ class: Ce(["w-full flex items-center gap-8 px-12 py-10 bg-fm-color-surface-secondary border-b border-fm-color-border-default text-left cursor-pointer", { "border-b-0": !g(b.recipeId) }]),
3224
+ onClick: (B) => h(b.recipeId)
3212
3225
  }, [
3213
- h(z, {
3214
- name: p(g.recipeId) ? "expand_less" : "expand_more",
3226
+ x(z, {
3227
+ name: g(b.recipeId) ? "expand_less" : "expand_more",
3215
3228
  size: "sm",
3216
3229
  class: "text-fm-color-typo-secondary flex-shrink-0"
3217
3230
  }, null, 8, ["name"]),
3218
- v("span", Hi, U(g.recipeName), 1),
3219
- g.original.version === "v2" ? (y(), Y(c, {
3231
+ f("span", Hi, U(b.recipeName), 1),
3232
+ b.original.version === "v2" ? (v(), Y(c, {
3220
3233
  key: 0,
3221
3234
  size: "sm",
3222
3235
  label: "V2",
3223
3236
  variant: "info"
3224
3237
  })) : T("", !0),
3225
- h(c, {
3238
+ x(c, {
3226
3239
  size: "sm",
3227
- label: S(g.status),
3228
- variant: b(g.status)
3240
+ label: w(b.status),
3241
+ variant: y(b.status)
3229
3242
  }, null, 8, ["label", "variant"])
3230
3243
  ], 10, Ji),
3231
- p(g.recipeId) ? (y(), E(X, { key: 0 }, [
3232
- n(t).applyErrors.has(g.recipeId) ? (y(), E("div", Qi, [
3233
- h(N, {
3244
+ g(b.recipeId) ? (v(), V(X, { key: 0 }, [
3245
+ n(t).applyErrors.has(b.recipeId) ? (v(), V("div", Qi, [
3246
+ x(N, {
3234
3247
  type: "error",
3235
- message: n(t).applyErrors.get(g.recipeId)
3248
+ message: n(t).applyErrors.get(b.recipeId)
3236
3249
  }, null, 8, ["message"])
3237
3250
  ])) : T("", !0),
3238
- v("div", Xi, [
3239
- g.projected ? (k.value.get(g.recipeId) ?? []).length > 0 ? (y(!0), E(X, { key: 1 }, me(k.value.get(g.recipeId), (B, F) => (y(), E("span", {
3251
+ f("div", Xi, [
3252
+ b.projected ? (_.value.get(b.recipeId) ?? []).length > 0 ? (v(!0), V(X, { key: 1 }, me(_.value.get(b.recipeId), (B, F) => (v(), V("span", {
3240
3253
  key: F,
3241
3254
  class: Ce(["fm-typo-en-body-sm-400", {
3242
3255
  "text-fm-color-typo-secondary": B.kind === "unchanged",
3243
3256
  "line-through text-fm-color-error font-medium": B.kind === "removed",
3244
3257
  "text-fm-color-success font-medium": B.kind === "added"
3245
3258
  }])
3246
- }, U(B.text), 3))), 128)) : (y(), E("span", Zi, U(n(d)("inventory.recipe.bulkEditor.summary.emptyBindings")), 1)) : (y(!0), E(X, { key: 0 }, me(C(g.original), (B, F) => (y(), E("span", {
3259
+ }, U(B.text), 3))), 128)) : (v(), V("span", Zi, U(n(d)("inventory.recipe.bulkEditor.summary.emptyBindings")), 1)) : (v(!0), V(X, { key: 0 }, me(C(b.original), (B, F) => (v(), V("span", {
3247
3260
  key: F,
3248
3261
  class: "fm-typo-en-body-sm-400 text-fm-color-typo-placeholder"
3249
3262
  }, U(B.text), 1))), 128))
3250
3263
  ]),
3251
- v("div", el, [
3252
- g.counts.applied > 0 ? (y(), E("span", tl, U(n(d)("inventory.recipe.bulkEditor.summary.footerApplied", { count: g.counts.applied })), 1)) : T("", !0),
3253
- g.counts.satisfied > 0 ? (y(), E("span", nl, U(n(d)("inventory.recipe.bulkEditor.summary.footerSatisfied", { count: g.counts.satisfied })), 1)) : T("", !0),
3254
- g.counts.ignored > 0 ? (y(), E("span", ol, U(n(d)("inventory.recipe.bulkEditor.summary.footerIgnored", { count: g.counts.ignored })), 1)) : T("", !0),
3255
- g.counts.blocked > 0 ? (y(), E("span", il, U(n(d)("inventory.recipe.bulkEditor.summary.footerBlocked", { count: g.counts.blocked })), 1)) : T("", !0),
3256
- g.counts.applied === 0 && g.counts.satisfied === 0 && g.counts.ignored === 0 && g.counts.blocked === 0 ? (y(), E("span", ll, U(n(d)("inventory.recipe.bulkEditor.summary.noChangesDetail")), 1)) : T("", !0)
3264
+ f("div", el, [
3265
+ b.counts.applied > 0 ? (v(), V("span", tl, U(n(d)("inventory.recipe.bulkEditor.summary.footerApplied", { count: b.counts.applied })), 1)) : T("", !0),
3266
+ b.counts.satisfied > 0 ? (v(), V("span", nl, U(n(d)("inventory.recipe.bulkEditor.summary.footerSatisfied", { count: b.counts.satisfied })), 1)) : T("", !0),
3267
+ b.counts.ignored > 0 ? (v(), V("span", ol, U(n(d)("inventory.recipe.bulkEditor.summary.footerIgnored", { count: b.counts.ignored })), 1)) : T("", !0),
3268
+ b.counts.blocked > 0 ? (v(), V("span", il, U(n(d)("inventory.recipe.bulkEditor.summary.footerBlocked", { count: b.counts.blocked })), 1)) : T("", !0),
3269
+ b.counts.applied === 0 && b.counts.satisfied === 0 && b.counts.ignored === 0 && b.counts.blocked === 0 ? (v(), V("span", ll, U(n(d)("inventory.recipe.bulkEditor.summary.noChangesDetail")), 1)) : T("", !0)
3257
3270
  ])
3258
3271
  ], 64)) : T("", !0)
3259
3272
  ]))), 128))
@@ -3284,22 +3297,22 @@ const Ti = { class: "flex flex-col gap-16" }, Ui = { class: "rounded-lg border b
3284
3297
  show: { type: Boolean }
3285
3298
  },
3286
3299
  emits: ["update:show"],
3287
- setup(m, { emit: d }) {
3288
- const l = m, { t } = ie(), i = ge(), r = Ge(l, "show"), x = Le(), u = A(() => i.currentStep === 1), o = A(() => i.currentStep === 2), s = A(() => i.currentStep === 3);
3300
+ setup(p, { emit: d }) {
3301
+ const l = p, { t } = ie(), i = ge(), r = Ge(l, "show"), $ = Le(), u = R(() => i.currentStep === 1), o = R(() => i.currentStep === 2), s = R(() => i.currentStep === 3);
3289
3302
  function a() {
3290
3303
  i.currentStep = 2;
3291
3304
  }
3292
- function p() {
3305
+ function g() {
3293
3306
  i.currentStep = 1;
3294
3307
  }
3295
- function $() {
3308
+ function h() {
3296
3309
  i.goToStep3();
3297
3310
  }
3298
3311
  function C() {
3299
3312
  i.backToStep2();
3300
3313
  }
3301
3314
  function I() {
3302
- x.open({
3315
+ $.open({
3303
3316
  title: t("inventory.recipe.bulkEditor.step3.confirmTitle"),
3304
3317
  message: t("inventory.recipe.bulkEditor.step3.confirmMessage"),
3305
3318
  primaryActions: {
@@ -3315,16 +3328,16 @@ const Ti = { class: "flex flex-col gap-16" }, Ui = { class: "rounded-lg border b
3315
3328
  await i.confirmAndApply();
3316
3329
  });
3317
3330
  }
3318
- function f() {
3331
+ function m() {
3319
3332
  r.value = !1, i.reset();
3320
3333
  }
3321
- return (k, S) => {
3322
- const b = G("FmChip"), e = G("FmButton"), V = G("FmDialog");
3323
- return y(), Y(V, {
3334
+ return (_, w) => {
3335
+ const y = G("FmChip"), e = G("FmButton"), S = G("FmDialog");
3336
+ return v(), Y(S, {
3324
3337
  modelValue: n(r),
3325
3338
  "onUpdate:modelValue": [
3326
- S[0] || (S[0] = (c) => De(r) ? r.value = c : null),
3327
- S[1] || (S[1] = (c) => {
3339
+ w[0] || (w[0] = (c) => De(r) ? r.value = c : null),
3340
+ w[1] || (w[1] = (c) => {
3328
3341
  c || n(i).reset();
3329
3342
  })
3330
3343
  ],
@@ -3334,9 +3347,9 @@ const Ti = { class: "flex flex-col gap-16" }, Ui = { class: "rounded-lg border b
3334
3347
  "max-height": "98vh"
3335
3348
  }, {
3336
3349
  "dialog-header": J(() => [
3337
- v("div", al, [
3338
- v("span", sl, U(n(t)("inventory.recipe.bulkEditor.title")), 1),
3339
- h(b, {
3350
+ f("div", al, [
3351
+ f("span", sl, U(n(t)("inventory.recipe.bulkEditor.title")), 1),
3352
+ x(y, {
3340
3353
  size: "sm",
3341
3354
  label: n(t)("inventory.recipe.bulkEditor.stepIndicator", { step: n(i).currentStep, total: 3 }),
3342
3355
  variant: "neutral"
@@ -3344,61 +3357,61 @@ const Ti = { class: "flex flex-col gap-16" }, Ui = { class: "rounded-lg border b
3344
3357
  ])
3345
3358
  ]),
3346
3359
  "dialog-footer": J(() => [
3347
- u.value ? (y(), E("div", pl, [
3348
- h(e, {
3360
+ u.value ? (v(), V("div", pl, [
3361
+ x(e, {
3349
3362
  label: n(t)("common.next"),
3350
3363
  disabled: !n(i).canGoToStep2,
3351
3364
  onClick: a
3352
3365
  }, null, 8, ["label", "disabled"]),
3353
- h(e, {
3366
+ x(e, {
3354
3367
  label: n(t)("common.close"),
3355
3368
  variant: "tertiary",
3356
- onClick: f
3369
+ onClick: m
3357
3370
  }, null, 8, ["label"])
3358
- ])) : o.value ? (y(), E("div", ml, [
3359
- h(e, {
3371
+ ])) : o.value ? (v(), V("div", ml, [
3372
+ x(e, {
3360
3373
  label: n(t)("inventory.recipe.bulkEditor.step2.reviewButton"),
3361
3374
  disabled: !n(i).canGoToStep3,
3362
- onClick: $
3375
+ onClick: h
3363
3376
  }, null, 8, ["label", "disabled"]),
3364
- h(e, {
3377
+ x(e, {
3365
3378
  label: n(t)("common.back"),
3366
3379
  variant: "secondary",
3367
- onClick: p
3380
+ onClick: g
3368
3381
  }, null, 8, ["label"]),
3369
- h(e, {
3382
+ x(e, {
3370
3383
  label: n(t)("common.close"),
3371
3384
  variant: "tertiary",
3372
- onClick: f
3385
+ onClick: m
3373
3386
  }, null, 8, ["label"])
3374
- ])) : s.value ? (y(), E("div", fl, [
3375
- h(e, {
3387
+ ])) : s.value ? (v(), V("div", fl, [
3388
+ x(e, {
3376
3389
  label: n(t)("inventory.recipe.bulkEditor.step3.confirmButton"),
3377
3390
  disabled: n(i).isSaving,
3378
3391
  loading: n(i).isSaving,
3379
3392
  onClick: I
3380
3393
  }, null, 8, ["label", "disabled", "loading"]),
3381
- h(e, {
3394
+ x(e, {
3382
3395
  label: n(t)("common.back"),
3383
3396
  variant: "secondary",
3384
3397
  disabled: n(i).isSaving,
3385
3398
  onClick: C
3386
3399
  }, null, 8, ["label", "disabled"]),
3387
- h(e, {
3400
+ x(e, {
3388
3401
  label: n(t)("common.close"),
3389
3402
  variant: "tertiary",
3390
3403
  disabled: n(i).isSaving,
3391
- onClick: f
3404
+ onClick: m
3392
3405
  }, null, 8, ["label", "disabled"])
3393
3406
  ])) : T("", !0)
3394
3407
  ]),
3395
3408
  default: J(() => [
3396
- u.value ? (y(), E("div", dl, [
3397
- h(Oo)
3398
- ])) : o.value ? (y(), E("div", ul, [
3399
- h(Fi)
3400
- ])) : s.value ? (y(), E("div", cl, [
3401
- h(rl)
3409
+ u.value ? (v(), V("div", dl, [
3410
+ x(Oo)
3411
+ ])) : o.value ? (v(), V("div", ul, [
3412
+ x(Fi)
3413
+ ])) : s.value ? (v(), V("div", cl, [
3414
+ x(rl)
3402
3415
  ])) : T("", !0)
3403
3416
  ]),
3404
3417
  _: 1
@@ -3406,56 +3419,56 @@ const Ti = { class: "flex flex-col gap-16" }, Ui = { class: "rounded-lg border b
3406
3419
  };
3407
3420
  }
3408
3421
  });
3409
- function yl(m) {
3410
- return !m || Object.keys(m).length === 0 ? "" : Object.entries(m).map(([d, l]) => `${d}: ${l}`).join(", ");
3422
+ function yl(p) {
3423
+ return !p || Object.keys(p).length === 0 ? "" : Object.entries(p).map(([d, l]) => `${d}: ${l}`).join(", ");
3411
3424
  }
3412
3425
  function bl() {
3413
- const m = ne(), d = m.recipes, l = m.recipeById, t = m.skuById, i = m.skuGroupById, r = d.flatMap((o, s) => {
3414
- var p;
3426
+ const p = ne(), d = p.recipes, l = p.recipeById, t = p.skuById, i = p.skuGroupById, r = d.flatMap((o, s) => {
3427
+ var g;
3415
3428
  const a = yl(o.customAttributes);
3416
- if ((p = o.contains) != null && p.length) {
3417
- const $ = o.contains.filter((f) => f.type === "RECIPE"), C = o.contains.filter((f) => f.type === "SKU"), I = o.contains.filter((f) => f.type === "SKU_GROUP");
3429
+ if ((g = o.contains) != null && g.length) {
3430
+ const h = o.contains.filter((m) => m.type === "RECIPE"), C = o.contains.filter((m) => m.type === "SKU"), I = o.contains.filter((m) => m.type === "SKU_GROUP");
3418
3431
  return [
3419
3432
  ...s === 0 ? [] : [["", "", "", "", "", "", ""]],
3420
- ...$.map(
3421
- (f, k) => {
3422
- var S;
3433
+ ...h.map(
3434
+ (m, _) => {
3435
+ var w;
3423
3436
  return [
3424
- k === 0 ? o.name : "",
3437
+ _ === 0 ? o.name : "",
3425
3438
  "RECIPE",
3426
3439
  "",
3427
- (S = l[f.id]) == null ? void 0 : S.name,
3428
- Q(f.amount),
3440
+ (w = l[m.id]) == null ? void 0 : w.name,
3441
+ Q(m.amount),
3429
3442
  "UNIT",
3430
- k === 0 ? a : ""
3443
+ _ === 0 ? a : ""
3431
3444
  ];
3432
3445
  }
3433
3446
  ),
3434
3447
  ...C.map(
3435
- (f, k) => {
3436
- var S, b, e, V;
3448
+ (m, _) => {
3449
+ var w, y, e, S;
3437
3450
  return [
3438
- !$.length && k === 0 ? o.name : "",
3451
+ !h.length && _ === 0 ? o.name : "",
3439
3452
  "INGREDIENT",
3440
- (S = t[f.id]) == null ? void 0 : S.code,
3441
- (b = t[f.id]) == null ? void 0 : b.name,
3442
- Q(f.amount),
3443
- f.measurement ? f.measurement.abbrev : (V = (e = t[f.id]) == null ? void 0 : e.unit) == null ? void 0 : V.abbrev,
3444
- !$.length && k === 0 ? a : ""
3453
+ (w = t[m.id]) == null ? void 0 : w.code,
3454
+ (y = t[m.id]) == null ? void 0 : y.name,
3455
+ Q(m.amount),
3456
+ m.measurement ? m.measurement.abbrev : (S = (e = t[m.id]) == null ? void 0 : e.unit) == null ? void 0 : S.abbrev,
3457
+ !h.length && _ === 0 ? a : ""
3445
3458
  ];
3446
3459
  }
3447
3460
  ),
3448
3461
  ...I.map(
3449
- (f, k) => {
3450
- var S, b;
3462
+ (m, _) => {
3463
+ var w, y;
3451
3464
  return [
3452
- $.length === 0 && C.length === 0 && k === 0 ? o.name : "",
3465
+ h.length === 0 && C.length === 0 && _ === 0 ? o.name : "",
3453
3466
  "SKU_GROUP",
3454
- ((S = i[f.id]) == null ? void 0 : S.ref) || "",
3455
- (b = i[f.id]) == null ? void 0 : b.name,
3456
- Q(f.amount),
3467
+ ((w = i[m.id]) == null ? void 0 : w.ref) || "",
3468
+ (y = i[m.id]) == null ? void 0 : y.name,
3469
+ Q(m.amount),
3457
3470
  "UNIT",
3458
- $.length === 0 && C.length === 0 && k === 0 ? a : ""
3471
+ h.length === 0 && C.length === 0 && _ === 0 ? a : ""
3459
3472
  ];
3460
3473
  }
3461
3474
  )
@@ -3470,77 +3483,77 @@ function bl() {
3470
3483
  }
3471
3484
  const gl = { class: "flex flex-col py-8" }, _l = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, kl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Hl = /* @__PURE__ */ le({
3472
3485
  __name: "RecipeView",
3473
- setup(m) {
3474
- const d = ne(), l = A(() => d.recipes), t = tt(), { createRecipe: i, updateRecipe: r } = ze(), { recipeDialogProps: x, recipeViewLoading: u } = Et(ze()), { columnDefs: o, formatRowData: s } = Jt(), a = A(() => s(l.value)), p = ge(), $ = We();
3486
+ setup(p) {
3487
+ const d = ne(), l = R(() => d.recipes), t = tt(), { createRecipe: i, updateRecipe: r } = ze(), { recipeDialogProps: $, recipeViewLoading: u } = Et(ze()), { columnDefs: o, formatRowData: s } = Jt(), a = R(() => s(l.value)), g = ge(), h = We();
3475
3488
  W(!1);
3476
3489
  function C(c) {
3477
3490
  if (c === "add")
3478
3491
  return i();
3479
3492
  if (c === "export")
3480
3493
  return bl();
3481
- c === "bulk-edit" && p.openDialog();
3494
+ c === "bulk-edit" && g.openDialog();
3482
3495
  }
3483
- const I = W(""), f = A(() => u.value), { breakpoints: k } = xt(), S = A(() => k.value.xs || k.value.sm), b = A(() => S.value ? 10 : 20), e = Ct(), { t: V } = ie();
3484
- return (c, _) => {
3496
+ const I = W(""), m = R(() => u.value), { breakpoints: _ } = xt(), w = R(() => _.value.xs || _.value.sm), y = R(() => w.value ? 10 : 20), e = Ct(), { t: S } = ie();
3497
+ return (c, k) => {
3485
3498
  const N = G("FmTable");
3486
- return y(), Y(Bt, {
3487
- title: n(V)("inventory.recipe.title"),
3499
+ return v(), Y(Bt, {
3500
+ title: n(S)("inventory.recipe.title"),
3488
3501
  actions: [
3489
3502
  {
3490
- label: n(V)("inventory.recipe.create.title"),
3503
+ label: n(S)("inventory.recipe.create.title"),
3491
3504
  value: "add",
3492
3505
  isPrimary: !0,
3493
3506
  prependIcon: "add"
3494
3507
  },
3495
- ...n($).enableBulkEditRecipes ? [{ label: n(V)("inventory.recipe.bulkEditor.title"), value: "bulk-edit", isPrimary: !1 }] : [],
3496
- { label: n(V)("common.export"), value: "export", isPrimary: !1 }
3508
+ ...n(h).enableBulkEditRecipes ? [{ label: n(S)("inventory.recipe.bulkEditor.title"), value: "bulk-edit", isPrimary: !1 }] : [],
3509
+ { label: n(S)("common.export"), value: "export", isPrimary: !1 }
3497
3510
  ],
3498
3511
  "onClick:action": C
3499
3512
  }, {
3500
3513
  default: J(() => [
3501
- v("div", {
3514
+ f("div", {
3502
3515
  class: Ce([
3503
3516
  "flex flex-col gap-8 max-h-full",
3504
3517
  {
3505
- "p-0": S.value,
3506
- "px-24 ": !S.value
3518
+ "p-0": w.value,
3519
+ "px-24 ": !w.value
3507
3520
  }
3508
3521
  ])
3509
3522
  }, [
3510
- h(jt, {
3523
+ x(jt, {
3511
3524
  searchable: "",
3512
3525
  search: I.value,
3513
- "onUpdate:search": _[0] || (_[0] = (z) => I.value = z)
3526
+ "onUpdate:search": k[0] || (k[0] = (z) => I.value = z)
3514
3527
  }, null, 8, ["search"]),
3515
- (y(), Y(N, {
3528
+ (v(), Y(N, {
3516
3529
  style: vt(n(e).tableHeight),
3517
3530
  "column-defs": n(o),
3518
3531
  "row-data": a.value,
3519
3532
  "search-value": I.value,
3520
- loading: !n(t)._currentLocation || f.value,
3521
- onRowClick: _[1] || (_[1] = (z) => n(r)(z.original.original)),
3533
+ loading: !n(t)._currentLocation || m.value,
3534
+ onRowClick: k[1] || (k[1] = (z) => n(r)(z.original.original)),
3522
3535
  key: l.value.length,
3523
- "page-size": b.value
3536
+ "page-size": y.value
3524
3537
  }, {
3525
3538
  "list-row": J((z) => [
3526
- h(Lt, {
3539
+ x(Lt, {
3527
3540
  row: z,
3528
- onRowClick: (g) => n(r)(g.original)
3541
+ onRowClick: (b) => n(r)(b.original)
3529
3542
  }, {
3530
- default: J((g) => {
3531
- var B, F, R, P, K, H, ee, O, M, L;
3543
+ default: J((b) => {
3544
+ var B, F, A, P, K, H, ee, O, M, L;
3532
3545
  return [
3533
- v("div", gl, [
3534
- v("div", _l, [
3535
- h(n(Qe), {
3536
- render: (R = (F = (B = g.recipe) == null ? void 0 : B.column) == null ? void 0 : F.columnDef) == null ? void 0 : R.cell,
3537
- props: (K = (P = g.recipe) == null ? void 0 : P.getContext) == null ? void 0 : K.call(P)
3546
+ f("div", gl, [
3547
+ f("div", _l, [
3548
+ x(n(Qe), {
3549
+ render: (A = (F = (B = b.recipe) == null ? void 0 : B.column) == null ? void 0 : F.columnDef) == null ? void 0 : A.cell,
3550
+ props: (K = (P = b.recipe) == null ? void 0 : P.getContext) == null ? void 0 : K.call(P)
3538
3551
  }, null, 8, ["render", "props"])
3539
3552
  ]),
3540
- v("div", kl, [
3541
- h(n(Qe), {
3542
- render: (O = (ee = (H = g.ingredients) == null ? void 0 : H.column) == null ? void 0 : ee.columnDef) == null ? void 0 : O.cell,
3543
- props: (L = (M = g.ingredients) == null ? void 0 : M.getContext) == null ? void 0 : L.call(M)
3553
+ f("div", kl, [
3554
+ x(n(Qe), {
3555
+ render: (O = (ee = (H = b.ingredients) == null ? void 0 : H.column) == null ? void 0 : ee.columnDef) == null ? void 0 : O.cell,
3556
+ props: (L = (M = b.ingredients) == null ? void 0 : M.getContext) == null ? void 0 : L.call(M)
3544
3557
  }, null, 8, ["render", "props"])
3545
3558
  ])
3546
3559
  ])
@@ -3552,12 +3565,12 @@ const gl = { class: "flex flex-col py-8" }, _l = { class: "fm-typo-en-body-lg-60
3552
3565
  _: 1
3553
3566
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
3554
3567
  ], 2),
3555
- (y(), Y(yt, { to: "body" }, [
3556
- h(vo, bt(gt(n(x))), null, 16),
3557
- n($).enableBulkEditRecipes ? (y(), Y(vl, {
3568
+ (v(), Y(yt, { to: "body" }, [
3569
+ x(vo, bt(gt(n($))), null, 16),
3570
+ n(h).enableBulkEditRecipes ? (v(), Y(vl, {
3558
3571
  key: 0,
3559
- show: n(p).show,
3560
- "onUpdate:show": _[2] || (_[2] = (z) => n(p).show = z)
3572
+ show: n(g).show,
3573
+ "onUpdate:show": k[2] || (k[2] = (z) => n(g).show = z)
3561
3574
  }, null, 8, ["show"])) : T("", !0)
3562
3575
  ]))
3563
3576
  ]),