@feedmepos/mf-inventory-portal 0.0.25-dev.4 → 0.0.25-dev.42

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 (112) hide show
  1. package/dist/{App-DavuRdR4.js → App-BgLyTa3Z.js} +35 -34
  2. package/dist/ApprovalView-UC31qsPD.js +143 -0
  3. package/dist/{BindingsDialog-Ckbhr9x3.js → BindingsDialog-h9el4EvX.js} +6 -6
  4. package/dist/{BindingsPicker-B63gIPVJ.js → BindingsPicker-Cw5AT6xO.js} +8 -8
  5. package/dist/{BindingsTable-5w7_8JzF.js → BindingsTable-Boj3hZup.js} +6 -6
  6. package/dist/ClosingDraftView-DOH7FmkH.js +1348 -0
  7. package/dist/ClosingTemplateView-CG7qArA8.js +1859 -0
  8. package/dist/FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js +34 -0
  9. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-k1J8dWcK.js +211 -0
  10. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-M5pWGm8D.js → FmUnitInput.vue_vue_type_script_setup_true_lang-C5qp_p1A.js} +52 -52
  11. package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-DBYsiV9t.js +51 -0
  12. package/dist/{IngredientGroupView-D_1gJl4X.js → IngredientGroupView-CWEw3I3i.js} +14 -14
  13. package/dist/{IngredientsView-Xzt0_AP8.js → IngredientsView-B6EDjPTe.js} +577 -551
  14. package/dist/{IntegrationView-BcF7Qhvw.js → IntegrationView-DiSoM1K8.js} +660 -623
  15. package/dist/{InventoryBindingForm-Cm49VDtA.js → InventoryBindingForm-nKWx-EUW.js} +1 -1
  16. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-EJ0U2gdF.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BMMD4hwX.js} +96 -96
  17. package/dist/{InventoryBindingSummary-D821YZ-3.js → InventoryBindingSummary-CQnCjIY4.js} +1 -1
  18. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D6jGlkOx.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Cr8DwdOC.js} +1 -1
  19. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-TMYgOcbh.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DnZI3Gfj.js} +15 -15
  20. package/dist/PublishView-DvHW27pI.js +222 -0
  21. package/dist/{PurchaseOrderPrintPreview-DiCTMEY4.js → PurchaseOrderPrintPreview-DSTbRKyh.js} +1 -1
  22. package/dist/ReceiveRequestView-BKRHqSU-.js +2577 -0
  23. package/dist/{RecipeView-k5yiAPop.js → RecipeView-CFTrf0YF.js} +47 -46
  24. package/dist/{index-DhAsCP14.js → StockView-CAPLd29m.js} +3564 -1764
  25. package/dist/{SupplierView-De4_YCtR.js → SupplierView-C_CrS9FM.js} +446 -457
  26. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-BWuWB95v.js +1564 -0
  27. package/dist/TransferTemplateView-BaJaiaO9.js +1526 -0
  28. package/dist/{UnitView-DouWNXFf.js → UnitView-DY9nZs1y.js} +14 -14
  29. package/dist/{WarehouseView-RQN-XBeO.js → WarehouseView-CAFxl8K4.js} +332 -314
  30. package/dist/api/closing-draft.d.ts +1 -0
  31. package/dist/api/inventory.d.ts +9 -6
  32. package/dist/api/netsuite.d.ts +21 -4
  33. package/dist/api/purchase-order.d.ts +6 -1
  34. package/dist/api/stock.d.ts +1 -0
  35. package/dist/{app-Bmmin1VX.js → app-Jh5wwLsF.js} +28968 -28906
  36. package/dist/app.js +1 -1
  37. package/dist/components/FmAutocompleteTextField.vue.d.ts +31 -0
  38. package/dist/components/FmCustomAttribute.vue.d.ts +3 -8
  39. package/dist/components/FmLockableField.vue.d.ts +3 -0
  40. package/dist/components/FmMultiselectDialog.d.ts +23 -0
  41. package/dist/components/FmMultiselectDialog.vue.d.ts +20 -3
  42. package/dist/components/FmMultiselectDialogProps.d.ts +2 -0
  43. package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +1 -1
  44. package/dist/components/shell/inventory/binding-ui.vue.d.ts +1 -1
  45. package/dist/{decimal-CZhBTty7.js → decimal-0_acpDRy.js} +1 -1
  46. package/dist/feature-CqX_LtOl.js +1007 -0
  47. package/dist/{format-unit-display-CijRcRSo.js → format-unit-display-CYPC8_oX.js} +335 -328
  48. package/dist/helper/country.d.ts +1 -0
  49. package/dist/helper/fuzzy.d.ts +10 -0
  50. package/dist/index-QcOk4LDU.js +35546 -0
  51. package/dist/{stock-D5lxPBQG.js → stock-BpWEKDoQ.js} +29 -25
  52. package/dist/stores/feature.d.ts +4 -5
  53. package/dist/stores/helper/generate-backend-urls.d.ts +0 -1
  54. package/dist/stores/integration/netsuite.d.ts +21 -4
  55. package/dist/stores/inventory.d.ts +135 -8
  56. package/dist/stores/location.d.ts +100 -0
  57. package/dist/stores/warehouse.d.ts +1 -0
  58. package/dist/style.css +1 -1
  59. package/dist/{supplier-BU1WhNTR.js → supplier-By3gzRHW.js} +1 -1
  60. package/dist/tsconfig.app.tsbuildinfo +1 -1
  61. package/dist/use-ingredient-select-dialog-hkbfGnB9.js +51 -0
  62. package/dist/{use-inventory-binding-dialog-ZneYylve.js → use-inventory-binding-dialog-BFG04MUx.js} +1 -1
  63. package/dist/views/adjustment-template/wastage-template/actions.d.ts +24 -0
  64. package/dist/views/adjustment-template/wastage-template/table.d.ts +24 -0
  65. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +8 -4
  66. package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +4 -1
  67. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +48 -24
  68. package/dist/views/closing-draft/helpers/export-draft.helper.d.ts +1 -1
  69. package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +1 -1
  70. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +36 -12
  71. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +36 -12
  72. package/dist/views/dev/components/AutocompleteTextField.vue.d.ts +2 -0
  73. package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +3 -3
  74. package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +2 -2
  75. package/dist/views/ingredients/composables/use-ingredient-select-dialog.d.ts +16 -0
  76. package/dist/views/ingredients/composables/use-ingredient-table.d.ts +1 -1
  77. package/dist/views/receive-request/components/netsuite/NetSuiteProps.d.ts +2 -0
  78. package/dist/views/receive-request/components/transfer-details/TransferDetailsProps.d.ts +4 -1
  79. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +411 -17
  80. package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +6 -2
  81. package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +382 -2
  82. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +6 -3
  83. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +822 -29
  84. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +650 -48
  85. package/dist/views/receive-request/import/XilnexImportDialog.vue.d.ts +22 -0
  86. package/dist/views/receive-request/import/XilnexImportForm.vue.d.ts +17 -0
  87. package/dist/views/receive-request/import/XilnexResult.vue.d.ts +17 -0
  88. package/dist/views/receive-request/import/export.d.ts +12 -0
  89. package/dist/views/receive-request/import/props.d.ts +7 -0
  90. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +4 -2
  91. package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +220 -0
  92. package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations-2.d.ts +8 -0
  93. package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations.d.ts +1 -0
  94. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +9 -4
  95. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +60 -12
  96. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +60 -12
  97. package/dist/views/transfer-template/composables/useTransferTemplateHelper.d.ts +305 -0
  98. package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +2 -0
  99. package/dist/{vue-i18n-BQNx5sCM.js → vue-i18n-D57Xfcpf.js} +226 -226
  100. package/package.json +3 -3
  101. package/dist/ApprovalView-DjDzZmVI.js +0 -138
  102. package/dist/ClosingDraftView-BwV3uiYC.js +0 -1225
  103. package/dist/ClosingTemplateView-vaAj0Y-0.js +0 -1819
  104. package/dist/FmCustomAttribute.vue_vue_type_script_setup_true_lang-Dy1BXu1R.js +0 -142
  105. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DZ_Q-3lU.js +0 -286
  106. package/dist/PublishView-CYdu5jl4.js +0 -192
  107. package/dist/ReceiveRequestView-DGqs1rpr.js +0 -1876
  108. package/dist/StockView-DX0RjayP.js +0 -1817
  109. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DhdMwHAA.js +0 -1327
  110. package/dist/TransferTemplateView-DEwJaqYB.js +0 -1284
  111. package/dist/components/FmCustomAttribute2.vue.d.ts +0 -18
  112. package/dist/index-DbE8p73U.js +0 -29202
@@ -1,63 +1,65 @@
1
- import { ref as j, defineComponent as oe, computed as S, resolveComponent as C, openBlock as f, createBlock as B, withCtx as V, createVNode as p, unref as m, createElementBlock as T, Fragment as Q, createElementVNode as d, createCommentVNode as Y, renderSlot as ve, createTextVNode as Ie, toDisplayString as D, normalizeClass as te, onMounted as et, watch as He, renderList as ue, isRef as Re, createSlots as Ye, normalizeStyle as tt, Teleport as Ae, normalizeProps as nt, guardReactiveProps as ot } from "vue";
2
- import { a as le, e as K, f as je, S as lt, h as at, D as Te, i as fe, A as ge, b as Me, j as Oe, k as be, t as qe, l as ce, m as xe, U as rt, n as st, M as it, o as De, c as Ge, C as ke, p as Pe, q as We, r as ut, s as Ke, v as dt, w as mt, I as ct, x as pt, y as vt, u as ft, z as yt, _ as gt, B as bt, E as ht, G as Be } from "./app-Bmmin1VX.js";
3
- import { useDialog as Ze, useSnackbar as he, useProxiedModel as Ne, useDialogChild as _t, useBreakpoints as xt } from "@feedmepos/ui-library";
4
- import { i as kt, _ as Vt } from "./is-linked-ingredient-error-fJ2TJb3z.js";
5
- import { useI18n as ae, useCoreStore as pe } from "@feedmepos/mf-common";
6
- import { defineStore as St, storeToRefs as Ct } from "pinia";
7
- import { g as wt, _ as Ve, S as Se } from "./StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js";
8
- import { _ as Ft } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-EJ0U2gdF.js";
9
- import { _ as Ce, a as It } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-Dy1BXu1R.js";
10
- import { _ as we } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
1
+ import { ref as q, defineComponent as te, computed as S, resolveComponent as C, openBlock as f, createBlock as B, withCtx as V, createVNode as c, unref as d, createElementBlock as T, Fragment as X, createElementVNode as m, createCommentVNode as j, renderSlot as ce, createTextVNode as Me, toDisplayString as A, normalizeClass as ee, onMounted as at, watch as Ye, renderList as re, isRef as De, createSlots as Ge, normalizeStyle as rt, Teleport as Pe, normalizeProps as st, guardReactiveProps as it } from "vue";
2
+ import { a as ne, d as K, e as We, S as dt, f as ut, D as Be, h as be, A as _e, b as Ie, i as Ke, j as xe, t as Ze, k as ve, l as Ve, U as mt, m as ct, M as pt, n as Ne, o as ze, p as Le, q as Je, r as vt, s as Qe, v as ft, w as yt, I as gt, x as bt, y as ht, u as _t, z as xt, _ as kt, B as Vt, C as St, E as He } from "./app-Jh5wwLsF.js";
3
+ import { useDialog as Xe, useSnackbar as ke, useProxiedModel as Oe, useDialogChild as Ct, useBreakpoints as wt } from "@feedmepos/ui-library";
4
+ import { i as Ft, _ as Mt } from "./is-linked-ingredient-error-fJ2TJb3z.js";
5
+ import { useI18n as oe, useCoreStore as fe } from "@feedmepos/mf-common";
6
+ import { defineStore as It, storeToRefs as $t } from "pinia";
7
+ import { g as Et, _ as Se, S as Ce } from "./StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js";
8
+ import { _ as Ut } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-BMMD4hwX.js";
9
+ import { _ as we } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-DBYsiV9t.js";
10
+ import { u as et } from "./feature-CqX_LtOl.js";
11
+ import { _ as he } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
12
+ import { _ as Rt } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js";
11
13
  import "./array-hChJVZLE.js";
12
- const Fe = St("ingredientForm", function() {
13
- const o = Ze(), y = he(), s = le(), n = j(!1), { t: l } = ae(), i = j();
14
+ const Fe = It("ingredientForm", function() {
15
+ const o = Xe(), y = ke(), r = ne(), n = q(!1), { t: l } = oe(), i = q();
14
16
  function a() {
15
17
  const b = {
16
18
  unit: {},
17
19
  mode: K.CREATE,
18
20
  show: !0,
19
- "onUpdate:show"(r) {
20
- i.value.show = r;
21
+ "onUpdate:show"(s) {
22
+ i.value.show = s;
21
23
  }
22
24
  };
23
25
  i.value = b;
24
26
  }
25
27
  async function h(b) {
26
- const r = {
27
- unit: je(b),
28
+ const s = {
29
+ unit: We(b),
28
30
  mode: K.UPDATE,
29
31
  show: !0,
30
- "onUpdate:show"(_) {
31
- i.value.show = _;
32
+ "onUpdate:show"(x) {
33
+ i.value.show = x;
32
34
  }
33
35
  };
34
- i.value = r;
36
+ i.value = s;
35
37
  }
36
38
  async function k(b) {
37
39
  n.value = !0;
38
40
  try {
39
- await s.deleteSku(b), y.open({
41
+ await r.deleteSku(b), y.open({
40
42
  title: "Success",
41
43
  message: `Deleted ${b.name}`,
42
44
  type: "success"
43
45
  });
44
- } catch (r) {
45
- r instanceof lt && kt(r) ? o.open({
46
+ } catch (s) {
47
+ s instanceof dt && Ft(s) ? o.open({
46
48
  title: "Cannot delete ingredient",
47
- contentComponent: Vt,
49
+ contentComponent: Mt,
48
50
  contentComponentProps: {
49
51
  subject: (b == null ? void 0 : b.name) ?? "",
50
- items: r.errorResponse.message
52
+ items: s.errorResponse.message
51
53
  },
52
54
  secondaryActions: {
53
55
  text: "Close",
54
56
  close: !0
55
57
  }
56
- }) : console.log("unable to delete ingredient", r), y.open({
58
+ }) : console.log("unable to delete ingredient", s), y.open({
57
59
  title: `Cannot delete ${b.name}`,
58
60
  message: "Please try again.",
59
61
  type: "error"
60
- }), console.error("failed to delete ingredient", r);
62
+ }), console.error("failed to delete ingredient", s);
61
63
  } finally {
62
64
  n.value = !1;
63
65
  }
@@ -86,15 +88,15 @@ const Fe = St("ingredientForm", function() {
86
88
  ingredientViewLoading: n
87
89
  };
88
90
  });
89
- function Mt() {
90
- const { updateIngredient: u, deleteIngredient: o } = Fe(), { t: y } = ae();
91
- async function s(l, i) {
92
- const a = je(i);
93
- if (l === fe.Edit) {
91
+ function Tt() {
92
+ const { updateIngredient: u, deleteIngredient: o } = Fe(), { t: y } = oe();
93
+ async function r(l, i) {
94
+ const a = We(i);
95
+ if (l === be.Edit) {
94
96
  await u(a);
95
97
  return;
96
98
  }
97
- if (l === fe.Delete) {
99
+ if (l === be.Delete) {
98
100
  await o(a);
99
101
  return;
100
102
  }
@@ -134,10 +136,10 @@ function Mt() {
134
136
  id: "action",
135
137
  header: "",
136
138
  cell(l) {
137
- return at(
138
- [Te[fe.Edit], Te[fe.Delete]],
139
+ return ut(
140
+ [Be[be.Edit], Be[be.Delete]],
139
141
  (i) => {
140
- s(i, l.row.original);
142
+ r(i, l.row.original);
141
143
  }
142
144
  );
143
145
  },
@@ -150,7 +152,7 @@ function Mt() {
150
152
  }
151
153
  ] };
152
154
  }
153
- const $t = /* @__PURE__ */ oe({
155
+ const At = /* @__PURE__ */ te({
154
156
  __name: "ConvertForm",
155
157
  props: {
156
158
  modelValue: {},
@@ -160,37 +162,37 @@ const $t = /* @__PURE__ */ oe({
160
162
  },
161
163
  emits: ["update:modelValue"],
162
164
  setup(u, { emit: o }) {
163
- const y = u, s = S(() => {
164
- var r;
165
- return (r = y.rootValue) == null ? void 0 : r.unit;
165
+ const y = u, r = S(() => {
166
+ var s;
167
+ return (s = y.rootValue) == null ? void 0 : s.unit;
166
168
  }), n = S(() => {
167
- var r;
168
- return (r = y.rootValue) == null ? void 0 : r._id;
169
- }), l = o, { t: i } = ae(), a = S({
169
+ var s;
170
+ return (s = y.rootValue) == null ? void 0 : s._id;
171
+ }), l = o, { t: i } = oe(), a = S({
170
172
  get() {
171
173
  return !!y.modelValue;
172
174
  },
173
- set(r) {
174
- r ? l("update:modelValue", {
175
+ set(s) {
176
+ s ? l("update:modelValue", {
175
177
  measurement: null,
176
178
  inventoryBindings: []
177
179
  }) : l("update:modelValue", null);
178
180
  }
179
- }), h = S(() => wt(s.value));
180
- function k(r) {
181
- const _ = y.modelValue ?? {};
182
- _.measurement = r ? `${r}` : null, l("update:modelValue", _);
181
+ }), h = S(() => Et(r.value));
182
+ function k(s) {
183
+ const x = y.modelValue ?? {};
184
+ x.measurement = s ? `${s}` : null, l("update:modelValue", x);
183
185
  }
184
- function g(r) {
185
- const _ = y.modelValue ?? {};
186
- _.inventoryBindings = r, l("update:modelValue", _);
186
+ function g(s) {
187
+ const x = y.modelValue ?? {};
188
+ x.inventoryBindings = s, l("update:modelValue", x);
187
189
  }
188
190
  const b = S(() => {
189
191
  if (!y.modelValue) return null;
190
- const r = y.modelValue;
191
- return r.measurement ? h.value.find((_) => _.value === r.measurement) ?? null : h.value.find((_) => _.value === null) ?? null;
192
+ const s = y.modelValue;
193
+ return s.measurement ? h.value.find((x) => x.value === s.measurement) ?? null : h.value.find((x) => x.value === null) ?? null;
192
194
  });
193
- return (r, _) => {
195
+ return (s, x) => {
194
196
  const U = C("FmSwitch"), I = C("FmSelect"), N = C("FmCard");
195
197
  return f(), B(N, {
196
198
  variant: "outlined",
@@ -199,34 +201,34 @@ const $t = /* @__PURE__ */ oe({
199
201
  default: V(() => {
200
202
  var w, v;
201
203
  return [
202
- p(U, {
204
+ c(U, {
203
205
  value: "",
204
206
  "model-value": a.value,
205
- "onUpdate:modelValue": _[0] || (_[0] = (R) => a.value = R),
206
- label: m(i)("inventory.ingredient.convertible.title"),
207
- sublabel: m(i)("inventory.ingredient.convertible.subtitle"),
207
+ "onUpdate:modelValue": x[0] || (x[0] = (R) => a.value = R),
208
+ label: d(i)("inventory.ingredient.convertible.title"),
209
+ sublabel: d(i)("inventory.ingredient.convertible.subtitle"),
208
210
  labelPlacement: "right",
209
- disabled: r.readonly
211
+ disabled: s.readonly
210
212
  }, null, 8, ["model-value", "label", "sublabel", "disabled"]),
211
- a.value ? (f(), T(Q, { key: 0 }, [
212
- d("div", null, [
213
- p(I, {
214
- label: m(i)("inventory.ingredient.convertible.convertTo"),
213
+ a.value ? (f(), T(X, { key: 0 }, [
214
+ m("div", null, [
215
+ c(I, {
216
+ label: d(i)("inventory.ingredient.convertible.convertTo"),
215
217
  modelValue: (w = b.value) == null ? void 0 : w.value,
216
218
  "onUpdate:modelValue": k,
217
219
  items: h.value,
218
- disabled: r.readonly
220
+ disabled: s.readonly
219
221
  }, null, 8, ["label", "modelValue", "items", "disabled"])
220
222
  ]),
221
- p(Ft, {
223
+ c(Ut, {
222
224
  id: n.value,
223
- "model-value": ((v = r.modelValue) == null ? void 0 : v.inventoryBindings) ?? [],
225
+ "model-value": ((v = s.modelValue) == null ? void 0 : v.inventoryBindings) ?? [],
224
226
  "onUpdate:modelValue": g,
225
227
  "exclude-binding-id": n.value,
226
- rules: [m(ge)(1)],
227
- readonly: r.readonly
228
+ rules: [d(_e)(1)],
229
+ readonly: s.readonly
228
230
  }, null, 8, ["id", "model-value", "exclude-binding-id", "rules", "readonly"])
229
- ], 64)) : Y("", !0)
231
+ ], 64)) : j("", !0)
230
232
  ];
231
233
  }),
232
234
  _: 1
@@ -234,21 +236,22 @@ const $t = /* @__PURE__ */ oe({
234
236
  };
235
237
  }
236
238
  });
237
- function ie() {
239
+ function ae() {
238
240
  return {
239
241
  low: 6,
240
242
  mid: 14
241
243
  };
242
244
  }
243
- const Et = {
245
+ const Dt = {
244
246
  key: 0,
245
247
  class: "flex flex-col gap-4"
246
- }, ye = /* @__PURE__ */ oe({
248
+ }, pe = /* @__PURE__ */ te({
247
249
  __name: "FmLockableField",
248
250
  props: {
249
251
  locked: { type: Boolean },
250
252
  disabled: { type: Boolean },
251
253
  label: {},
254
+ helperText: {},
252
255
  modelValue: {},
253
256
  tooltipMessage: {},
254
257
  tooltipPlacement: {},
@@ -256,16 +259,16 @@ const Et = {
256
259
  },
257
260
  setup(u) {
258
261
  return (o, y) => {
259
- const s = C("FmLabel"), n = C("FmIcon"), l = C("FmTooltip"), i = C("FmField");
260
- return o.locked ? (f(), T("div", Et, [
261
- ve(o.$slots, "label", {}, () => [
262
- p(s, {
262
+ const r = C("FmLabel"), n = C("FmIcon"), l = C("FmTooltip"), i = C("FmField");
263
+ return o.locked ? (f(), T("div", Dt, [
264
+ ce(o.$slots, "label", {}, () => [
265
+ c(r, {
263
266
  label: o.label,
264
267
  disabled: o.disabled
265
268
  }, null, 8, ["label", "disabled"])
266
269
  ]),
267
- ve(o.$slots, "field", {}, () => [
268
- p(i, { disabled: o.disabled }, {
270
+ ce(o.$slots, "field", {}, () => [
271
+ c(i, { disabled: o.disabled }, {
269
272
  prepend: V(() => [
270
273
  o.tooltipMessage ? (f(), B(l, {
271
274
  key: 0,
@@ -273,10 +276,10 @@ const Et = {
273
276
  "z-index": o.tooltipZIndex
274
277
  }, {
275
278
  content: V(() => [
276
- Ie(D(o.tooltipMessage), 1)
279
+ Me(A(o.tooltipMessage), 1)
277
280
  ]),
278
281
  default: V(() => [
279
- p(n, {
282
+ c(n, {
280
283
  name: "lock",
281
284
  color: "neutral-gray-400"
282
285
  })
@@ -289,25 +292,33 @@ const Et = {
289
292
  }))
290
293
  ]),
291
294
  default: V(() => [
292
- ve(o.$slots, "modelValue", {}, () => [
293
- d("div", {
294
- class: te([
295
+ ce(o.$slots, "modelValue", {}, () => [
296
+ m("div", {
297
+ class: ee([
295
298
  o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary",
296
299
  "line-clamp-1 text-ellipsis break-all"
297
300
  ])
298
- }, D(o.modelValue), 3)
301
+ }, A(o.modelValue), 3)
299
302
  ])
300
303
  ]),
301
304
  _: 3
302
305
  }, 8, ["disabled"])
306
+ ]),
307
+ ce(o.$slots, "helper-text", {}, () => [
308
+ m("div", {
309
+ class: ee([
310
+ "fm-typo-en-body-sm-400 line-clamp-1",
311
+ o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
312
+ ])
313
+ }, A(o.helperText), 3)
303
314
  ])
304
- ])) : ve(o.$slots, "default", { key: 1 });
315
+ ])) : ce(o.$slots, "default", { key: 1 });
305
316
  };
306
317
  }
307
- }), Ut = { class: "flex gap-8" }, Rt = { class: "flex-1" }, At = { class: "flex-1" }, Tt = { class: "text-fm-color-typo-secondary" }, Dt = { class: "text-fm-color-typo-secondary whitespace-nowrap" }, Pt = {
308
- key: 2,
318
+ }), Pt = { class: "flex gap-8" }, Bt = { class: "flex-1" }, Nt = { class: "flex-1" }, zt = { class: "text-fm-color-typo-secondary" }, Lt = { class: "text-fm-color-typo-secondary whitespace-nowrap" }, Ht = {
319
+ key: 3,
309
320
  class: "border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
310
- }, Bt = { class: "flex flex-col gap-12" }, Nt = { class: "flex flex-col gap-4" }, Lt = { class: "fm-typo-en-title-sm-600" }, zt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ht = { class: "flex flex-col gap-4" }, Yt = { class: "flex fm-corner-radius-md border-1 border-fm-color-neutral-gray-200" }, jt = { class: "flex-1 p-12 flex flex-col gap-8" }, Ot = { class: "mx-auto" }, qt = { class: "flex flex-col" }, Gt = { class: "fm-typo-en-body-sm-600 translate-y-4" }, Wt = { class: "flex-1 p-12 flex flex-col gap-8" }, Kt = { class: "mx-auto" }, Zt = { class: "flex flex-col" }, Jt = { class: "fm-typo-en-body-sm-600 translate-y-4" }, Qt = { class: "flex-1 p-12 flex flex-col gap-8" }, Xt = { class: "mx-auto" }, en = { class: "flex flex-col" }, tn = { class: "fm-typo-en-body-sm-600 translate-y-4" }, nn = /* @__PURE__ */ oe({
321
+ }, Ot = { class: "flex flex-col gap-12" }, jt = { class: "flex flex-col gap-4" }, qt = { class: "fm-typo-en-title-sm-600" }, Yt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Gt = { class: "flex flex-col gap-4" }, Wt = { class: "flex fm-corner-radius-md border-1 border-fm-color-neutral-gray-200" }, Kt = { class: "flex-1 p-12 flex flex-col gap-8" }, Zt = { class: "mx-auto" }, Jt = { class: "flex flex-col" }, Qt = { class: "fm-typo-en-body-sm-600 translate-y-4" }, Xt = { class: "flex-1 p-12 flex flex-col gap-8" }, en = { class: "mx-auto" }, tn = { class: "flex flex-col" }, nn = { class: "fm-typo-en-body-sm-600 translate-y-4" }, on = { class: "flex-1 p-12 flex flex-col gap-8" }, ln = { class: "mx-auto" }, an = { class: "flex flex-col" }, rn = { class: "fm-typo-en-body-sm-600 translate-y-4" }, sn = /* @__PURE__ */ te({
311
322
  __name: "IngredientForm",
312
323
  props: {
313
324
  mode: {},
@@ -316,24 +327,24 @@ const Et = {
316
327
  },
317
328
  emits: ["update:modelValue", "click:submit"],
318
329
  setup(u, { expose: o, emit: y }) {
319
- var me;
320
- const { t: s } = ae(), n = u, l = y, i = le(), a = pe(), h = Ge(), k = Me(), g = S(() => k.isEnabled);
330
+ var ue;
331
+ const { t: r } = oe(), n = u, l = y, i = ne(), a = fe(), h = et(), k = Ie(), g = S(() => k.isEnabled);
321
332
  function b(t) {
322
333
  if (t.length === 0) return;
323
- const e = t[0], c = n.modelValue ?? {
324
- unit: i.units.find((x) => x)
334
+ const e = t[0], p = n.modelValue ?? {
335
+ unit: i.units.find((_) => _)
325
336
  };
326
- c.unit || (c.unit = e, l("update:modelValue", c));
337
+ p.unit || (p.unit = e, l("update:modelValue", p));
327
338
  }
328
- et(() => {
339
+ at(() => {
329
340
  b(i.units);
330
- }), He([() => i.units], ([t]) => {
341
+ }), Ye([() => i.units], ([t]) => {
331
342
  b(t);
332
343
  });
333
- function r() {
344
+ function s() {
334
345
  l("click:submit");
335
346
  }
336
- const _ = S({
347
+ const x = S({
337
348
  get() {
338
349
  var t;
339
350
  return ((t = n.modelValue) == null ? void 0 : t.code) ?? "";
@@ -357,12 +368,12 @@ const Et = {
357
368
  }
358
369
  }), I = S({
359
370
  get() {
360
- var e, c;
361
- const t = (c = (e = n.modelValue) == null ? void 0 : e.defaultCost) == null ? void 0 : c.costPerUnit;
362
- return t ? +Oe(t) : 0;
371
+ var e, p;
372
+ const t = (p = (e = n.modelValue) == null ? void 0 : e.defaultCost) == null ? void 0 : p.costPerUnit;
373
+ return t ? +Ke(t) : 0;
363
374
  },
364
375
  set(t) {
365
- var c, x, E, F;
376
+ var p, _, E, F;
366
377
  const e = n.modelValue ? {
367
378
  ...n.modelValue
368
379
  } : {};
@@ -370,67 +381,67 @@ const Et = {
370
381
  costPerUnit: {
371
382
  amount: 0,
372
383
  precision: 2,
373
- currency: ((c = be(a.currentCountry.value)) == null ? void 0 : c.currency) ?? "MYR"
384
+ currency: ((p = xe(a.currentCountry.value)) == null ? void 0 : p.currency) ?? "MYR"
374
385
  },
375
- measurement: (F = (E = (x = n.modelValue) == null ? void 0 : x.unit) == null ? void 0 : E.measurements) == null ? void 0 : F.find(
376
- (G) => {
377
- var H;
378
- return G.id === ((H = n.modelValue) == null ? void 0 : H.trackingMeasurement);
386
+ measurement: (F = (E = (_ = n.modelValue) == null ? void 0 : _.unit) == null ? void 0 : E.measurements) == null ? void 0 : F.find(
387
+ (O) => {
388
+ var G;
389
+ return O.id === ((G = n.modelValue) == null ? void 0 : G.trackingMeasurement);
379
390
  }
380
391
  )
381
392
  }), e.defaultCost.costPerUnit = {
382
393
  ...e.defaultCost.costPerUnit,
383
- ...qe(+t, 4)
394
+ ...Ze(+t, 4)
384
395
  }, l("update:modelValue", e);
385
396
  }
386
397
  }), N = S(() => {
387
- var e, c, x;
398
+ var e, p, _;
388
399
  const t = ((e = n.modelValue) == null ? void 0 : e.unit) ?? i.units.find((E) => E);
389
400
  return t ? {
390
401
  _id: t._id,
391
- measurement: (c = n.modelValue) == null ? void 0 : c.trackingMeasurement,
392
- name: ((x = t.measurements.find((E) => {
402
+ measurement: (p = n.modelValue) == null ? void 0 : p.trackingMeasurement,
403
+ name: ((_ = t.measurements.find((E) => {
393
404
  var F;
394
405
  return E.id === ((F = n.modelValue) == null ? void 0 : F.trackingMeasurement);
395
- })) == null ? void 0 : x.name) ?? t.name
406
+ })) == null ? void 0 : _.name) ?? t.name
396
407
  } : null;
397
408
  }), w = S(
398
- () => i.units.flatMap(({ name: t, _id: e, abbrev: c, measurements: x }) => [
409
+ () => i.units.flatMap(({ name: t, _id: e, abbrev: p, measurements: _ }) => [
399
410
  {
400
411
  label: `${t}`,
401
412
  value: null,
402
413
  displayAsSection: !0
403
414
  },
404
415
  {
405
- label: `${t} (${c})`,
416
+ label: `${t} (${p})`,
406
417
  value: { _id: e },
407
418
  displayAsSection: !1
408
419
  },
409
- ...x.map(({ id: E, name: F, abbrev: G }) => ({
410
- label: `${F} (${G})`,
420
+ ..._.map(({ id: E, name: F, abbrev: O }) => ({
421
+ label: `${F} (${O})`,
411
422
  value: { _id: e, measurement: E },
412
423
  displayAsSection: !1
413
424
  }))
414
425
  ])
415
426
  );
416
427
  function v(t) {
417
- var e, c, x, E, F;
418
- return ((c = (e = n.modelValue) == null ? void 0 : e.unit) == null ? void 0 : c._id) === ((x = t.value) == null ? void 0 : x._id) && ((E = n.modelValue) == null ? void 0 : E.trackingMeasurement) === ((F = t.value) == null ? void 0 : F.measurement);
428
+ var e, p, _, E, F;
429
+ return ((p = (e = n.modelValue) == null ? void 0 : e.unit) == null ? void 0 : p._id) === ((_ = t.value) == null ? void 0 : _._id) && ((E = n.modelValue) == null ? void 0 : E.trackingMeasurement) === ((F = t.value) == null ? void 0 : F.measurement);
419
430
  }
420
431
  function R(t) {
421
- var G, H;
432
+ var O, G;
422
433
  if (!t) return;
423
- const { _id: e, measurement: c } = t, x = c || void 0, E = i.units.find((ee) => ee._id === e);
434
+ const { _id: e, measurement: p } = t, _ = p || void 0, E = i.units.find((me) => me._id === e);
424
435
  if (!E)
425
436
  return;
426
437
  const F = n.modelValue ?? {};
427
- F.unit = E, F.trackingMeasurement = x, F.convert && (F.convert.measurement = x || null), h.enableTotalCost && (F.defaultCost = {
428
- measurement: E.measurements.find((ee) => ee.id === x),
438
+ F.unit = E, F.trackingMeasurement = _, F.convert && (F.convert.measurement = _ || null), h.enableTotalCost && (F.defaultCost = {
439
+ measurement: E.measurements.find((me) => me.id === _),
429
440
  costPerUnit: {
430
- ...((G = F.defaultCost) == null ? void 0 : G.costPerUnit) ?? {
441
+ ...((O = F.defaultCost) == null ? void 0 : O.costPerUnit) ?? {
431
442
  amount: 0,
432
443
  precision: 2,
433
- currency: ((H = be(a.currentCountry.value)) == null ? void 0 : H.currency) ?? "MYR"
444
+ currency: ((G = xe(a.currentCountry.value)) == null ? void 0 : G.currency) ?? "MYR"
434
445
  }
435
446
  }
436
447
  }), l("update:modelValue", F);
@@ -446,13 +457,12 @@ const Et = {
446
457
  } : {};
447
458
  t ? e.convert = t : e.convert = null, l("update:modelValue", e);
448
459
  }
449
- });
450
- S(() => ce.options.filter(
451
- (t) => t === ce.enum.FIFO || t === ce.enum.WAVG
460
+ }), Z = S(() => ve.options.filter(
461
+ (t) => t === ve.enum.FIFO || t === ve.enum.WAVG
452
462
  ).map((t) => ({
453
- label: s(`inventory.ingredient.valuationMethod.${t}`),
463
+ label: r(`inventory.ingredient.valuationMethod.${t}`),
454
464
  value: t
455
- }))), S({
465
+ }))), L = S({
456
466
  get() {
457
467
  var t;
458
468
  return ((t = n.modelValue) == null ? void 0 : t.valuation) ?? "WAVG";
@@ -463,8 +473,7 @@ const Et = {
463
473
  } : {};
464
474
  e.valuation = t, l("update:modelValue", e);
465
475
  }
466
- });
467
- const Z = S({
476
+ }), Y = S({
468
477
  get() {
469
478
  var t;
470
479
  return ((t = n.modelValue) == null ? void 0 : t.customAttributes) ?? {};
@@ -475,155 +484,143 @@ const Et = {
475
484
  } : {};
476
485
  e.customAttributes = t, l("update:modelValue", e);
477
486
  }
478
- }), L = j();
487
+ }), H = q();
479
488
  o({
480
489
  validateInputs: () => {
481
490
  var t, e;
482
- (e = (t = L.value) == null ? void 0 : t.validateInputs) == null || e.call(t);
491
+ (e = (t = H.value) == null ? void 0 : t.validateInputs) == null || e.call(t);
483
492
  },
484
493
  resetInputsValidation: () => {
485
494
  var t, e;
486
- (e = (t = L.value) == null ? void 0 : t.resetInputsValidation) == null || e.call(t);
495
+ (e = (t = H.value) == null ? void 0 : t.resetInputsValidation) == null || e.call(t);
487
496
  },
488
497
  resetInputs: () => {
489
498
  var t, e;
490
- (e = (t = L.value) == null ? void 0 : t.resetInputs) == null || e.call(t);
499
+ (e = (t = H.value) == null ? void 0 : t.resetInputs) == null || e.call(t);
491
500
  }
492
501
  });
493
- const z = j(!1), q = S(
502
+ const Q = q(!1), se = S(
494
503
  () => {
495
- var t, e, c;
496
- return (t = n.modelValue) != null && t._id ? ((c = i.menu.bindedBySkuId[(e = n.modelValue) == null ? void 0 : e._id]) == null ? void 0 : c.filter(
497
- (x) => x.from === "INGREDIENT"
504
+ var t, e, p;
505
+ return (t = n.modelValue) != null && t._id ? ((p = i.menu.bindedBySkuId[(e = n.modelValue) == null ? void 0 : e._id]) == null ? void 0 : p.filter(
506
+ (_) => _.from === "INGREDIENT"
498
507
  )) ?? [] : [];
499
508
  }
500
- ), ne = S(
509
+ ), ye = S(
501
510
  () => {
502
- var t, e, c;
503
- return (t = n.modelValue) != null && t._id ? ((c = i.menu.bindedBySkuId[(e = n.modelValue) == null ? void 0 : e._id]) == null ? void 0 : c.filter(
504
- (x) => x.from === "RECIPE"
511
+ var t, e, p;
512
+ return (t = n.modelValue) != null && t._id ? ((p = i.menu.bindedBySkuId[(e = n.modelValue) == null ? void 0 : e._id]) == null ? void 0 : p.filter(
513
+ (_) => _.from === "RECIPE"
505
514
  )) ?? [] : [];
506
515
  }
507
- ), de = S(
516
+ ), D = S(
508
517
  () => {
509
- var t, e, c;
510
- return (t = n.modelValue) != null && t._id ? ((c = i.menu.bindedBySkuId[(e = n.modelValue) == null ? void 0 : e._id]) == null ? void 0 : c.filter((x) => x.from === "MENU")) ?? [] : [];
518
+ var t, e, p;
519
+ return (t = n.modelValue) != null && t._id ? ((p = i.menu.bindedBySkuId[(e = n.modelValue) == null ? void 0 : e._id]) == null ? void 0 : p.filter((_) => _.from === "MENU")) ?? [] : [];
511
520
  }
512
- ), _e = S(
521
+ ), $ = S(
513
522
  () => i.skus.map((t) => ({ label: t.name, value: t.code }))
514
- ), P = j((me = n.modelValue) == null ? void 0 : me.code);
515
- function $(t) {
516
- var c;
523
+ ), ie = q((ue = n.modelValue) == null ? void 0 : ue.code);
524
+ function le(t) {
525
+ var p;
517
526
  const e = t.el;
518
- e && ((c = e.querySelector("[x-should-scroll-into=true]")) == null || c.scrollIntoView());
519
- }
520
- function re(t) {
521
- switch (t) {
522
- case ke.MY:
523
- return "MYR";
524
- case ke.SG:
525
- return "SGD";
526
- case ke.ID:
527
- return "IDR";
528
- default:
529
- return "MYR";
530
- }
527
+ e && ((p = e.querySelector("[x-should-scroll-into=true]")) == null || p.scrollIntoView());
531
528
  }
532
- const se = S(
529
+ const de = S(
533
530
  () => {
534
- var t, e, c, x, E, F;
535
- return ((x = (c = (e = (t = n.modelValue) == null ? void 0 : t.unit) == null ? void 0 : e.measurements) == null ? void 0 : c.find(
536
- (G) => {
537
- var H;
538
- return G.id === ((H = n.modelValue) == null ? void 0 : H.trackingMeasurement);
531
+ var t, e, p, _, E, F;
532
+ return ((_ = (p = (e = (t = n.modelValue) == null ? void 0 : t.unit) == null ? void 0 : e.measurements) == null ? void 0 : p.find(
533
+ (O) => {
534
+ var G;
535
+ return O.id === ((G = n.modelValue) == null ? void 0 : G.trackingMeasurement);
539
536
  }
540
- )) == null ? void 0 : x.abbrev) ?? ((F = (E = n.modelValue) == null ? void 0 : E.unit) == null ? void 0 : F.abbrev);
537
+ )) == null ? void 0 : _.abbrev) ?? ((F = (E = n.modelValue) == null ? void 0 : E.unit) == null ? void 0 : F.abbrev);
541
538
  }
542
- ), X = S({
539
+ ), P = S({
543
540
  get() {
544
541
  var t, e;
545
- return ((e = (t = n.modelValue) == null ? void 0 : t.thresholds) == null ? void 0 : e.low) ?? ie().low;
542
+ return ((e = (t = n.modelValue) == null ? void 0 : t.thresholds) == null ? void 0 : e.low) ?? ae().low;
546
543
  },
547
544
  set(t) {
548
- var x;
549
- const e = ((x = n.modelValue) == null ? void 0 : x.thresholds) ?? ie();
545
+ var _;
546
+ const e = ((_ = n.modelValue) == null ? void 0 : _.thresholds) ?? ae();
550
547
  e.low = t;
551
- const c = n.modelValue ? {
548
+ const p = n.modelValue ? {
552
549
  ...n.modelValue
553
550
  } : {};
554
- c.thresholds = e, l("update:modelValue", c);
551
+ p.thresholds = e, l("update:modelValue", p);
555
552
  }
556
- }), A = S({
553
+ }), z = S({
557
554
  get() {
558
555
  var t, e;
559
- return ((e = (t = n.modelValue) == null ? void 0 : t.thresholds) == null ? void 0 : e.mid) ?? ie().mid;
556
+ return ((e = (t = n.modelValue) == null ? void 0 : t.thresholds) == null ? void 0 : e.mid) ?? ae().mid;
560
557
  },
561
558
  set(t) {
562
- var x;
563
- const e = ((x = n.modelValue) == null ? void 0 : x.thresholds) ?? ie();
559
+ var _;
560
+ const e = ((_ = n.modelValue) == null ? void 0 : _.thresholds) ?? ae();
564
561
  e.mid = t;
565
- const c = n.modelValue ? {
562
+ const p = n.modelValue ? {
566
563
  ...n.modelValue
567
564
  } : {};
568
- c.thresholds = e, l("update:modelValue", c);
565
+ p.thresholds = e, l("update:modelValue", p);
569
566
  }
570
567
  });
571
- function O() {
568
+ function ge() {
572
569
  return function(e) {
573
570
  return typeof (e == null ? void 0 : e.low) != "number" || typeof (e == null ? void 0 : e.mid) != "number" ? "Required" : e.low >= e.mid ? "Days for red indicator should be less than yellow indicator." : !0;
574
571
  };
575
572
  }
576
573
  return (t, e) => {
577
- const c = C("FmTextField"), x = C("FmLabel"), E = C("FmField"), F = C("FmMenuHeader"), G = C("FmMenuDivider"), H = C("FmMenuItem"), ee = C("FmMenu"), $e = C("FmFormGroup"), Qe = C("FmSwitch"), Ee = C("FmStepperField"), Xe = C("FmForm");
578
- return f(), B(Xe, {
574
+ const p = C("FmTextField"), _ = C("FmLabel"), E = C("FmField"), F = C("FmMenuHeader"), O = C("FmMenuDivider"), G = C("FmMenuItem"), me = C("FmMenu"), $e = C("FmFormGroup"), nt = C("FmSelect"), ot = C("FmSwitch"), Ee = C("FmStepperField"), lt = C("FmForm");
575
+ return f(), B(lt, {
579
576
  disabled: t.disabled,
580
577
  ref_key: "formRef",
581
- ref: L,
578
+ ref: H,
582
579
  class: "flex flex-col gap-32",
583
- onValidationSuccess: r
580
+ onValidationSuccess: s
584
581
  }, {
585
582
  default: V(() => {
586
- var Ue;
583
+ var Ue, Re, Te, Ae;
587
584
  return [
588
- d("div", Ut, [
589
- d("div", Rt, [
590
- p(ye, {
585
+ m("div", Pt, [
586
+ m("div", Bt, [
587
+ c(pe, {
591
588
  "tooltip-message": "This field is managed by NetSuite",
592
589
  "tooltip-z-index": 50,
593
- label: m(s)("inventory.ingredient.code"),
594
- "model-value": _.value,
595
- "onUpdate:modelValue": e[1] || (e[1] = (M) => _.value = M),
590
+ label: d(r)("inventory.ingredient.code"),
591
+ "model-value": x.value,
592
+ "onUpdate:modelValue": e[1] || (e[1] = (M) => x.value = M),
596
593
  locked: g.value,
597
594
  disabled: t.disabled
598
595
  }, {
599
596
  default: V(() => [
600
- p(c, {
601
- label: m(s)("inventory.ingredient.code"),
602
- "model-value": _.value,
603
- "onUpdate:modelValue": e[0] || (e[0] = (M) => _.value = M),
604
- rules: [m(xe)(), m(rt)(_e.value, P.value)],
597
+ c(p, {
598
+ label: d(r)("inventory.ingredient.code"),
599
+ "model-value": x.value,
600
+ "onUpdate:modelValue": e[0] || (e[0] = (M) => x.value = M),
601
+ rules: [d(Ve)(), d(mt)($.value, ie.value)],
605
602
  "label-mark": "required"
606
603
  }, null, 8, ["label", "model-value", "rules"])
607
604
  ]),
608
605
  _: 1
609
606
  }, 8, ["label", "model-value", "locked", "disabled"])
610
607
  ]),
611
- d("div", At, [
612
- p(ye, {
608
+ m("div", Nt, [
609
+ c(pe, {
613
610
  "tooltip-message": "This field is managed by NetSuite",
614
611
  "tooltip-z-index": 50,
615
- label: m(s)("inventory.ingredient.name"),
612
+ label: d(r)("inventory.ingredient.name"),
616
613
  "model-value": U.value,
617
614
  "onUpdate:modelValue": e[3] || (e[3] = (M) => U.value = M),
618
615
  locked: g.value,
619
616
  disabled: t.disabled
620
617
  }, {
621
618
  default: V(() => [
622
- p(c, {
623
- label: m(s)("inventory.ingredient.name"),
619
+ c(p, {
620
+ label: d(r)("inventory.ingredient.name"),
624
621
  "model-value": U.value,
625
622
  "onUpdate:modelValue": e[2] || (e[2] = (M) => U.value = M),
626
- rules: [m(xe)()],
623
+ rules: [d(Ve)()],
627
624
  "label-mark": "required"
628
625
  }, null, 8, ["label", "model-value", "rules"])
629
626
  ]),
@@ -631,30 +628,31 @@ const Et = {
631
628
  }, 8, ["label", "model-value", "locked", "disabled"])
632
629
  ])
633
630
  ]),
634
- p(ye, {
631
+ c(pe, {
635
632
  "tooltip-message": "This field is managed by NetSuite",
636
633
  "tooltip-z-index": 50,
637
- label: m(s)("inventory.ingredient.unit"),
638
- "model-value": (Ue = N.value) == null ? void 0 : Ue.name,
634
+ label: d(r)("inventory.ingredient.unit"),
635
+ "helper-text": (Ue = t.modelValue) != null && Ue.trackingMeasurement ? `Base unit: ${(Te = (Re = t.modelValue) == null ? void 0 : Re.unit) == null ? void 0 : Te.name}` : void 0,
636
+ "model-value": (Ae = N.value) == null ? void 0 : Ae.name,
639
637
  locked: g.value,
640
638
  disabled: t.disabled
641
639
  }, {
642
640
  default: V(() => [
643
- p($e, {
641
+ c($e, {
644
642
  "model-value": N.value,
645
- rules: [m(xe)()],
643
+ rules: [d(Ve)()],
646
644
  "label-mark": "required"
647
645
  }, {
648
646
  label: V(() => [
649
- p(x, {
650
- label: m(s)("inventory.ingredient.unit")
647
+ c(_, {
648
+ label: d(r)("inventory.ingredient.unit")
651
649
  }, null, 8, ["label"])
652
650
  ]),
653
651
  default: V(({ invalid: M }) => [
654
- p(ee, null, {
652
+ c(me, null, {
655
653
  "menu-button": V(() => [
656
- p(E, {
657
- class: te([
654
+ c(E, {
655
+ class: ee([
658
656
  "fm-typo-en-body-lg-400",
659
657
  {
660
658
  "text-fm-color-typo-primary": !t.disabled,
@@ -667,30 +665,30 @@ const Et = {
667
665
  default: V(() => {
668
666
  var W;
669
667
  return [
670
- Ie(D((W = N.value) == null ? void 0 : W.name), 1)
668
+ Me(A((W = N.value) == null ? void 0 : W.name), 1)
671
669
  ];
672
670
  }),
673
671
  _: 2
674
672
  }, 1032, ["class", "invalid"])
675
673
  ]),
676
674
  default: V(() => [
677
- d("div", {
675
+ m("div", {
678
676
  class: "overflow-x-hidden overflow-y-auto max-h-[300px]",
679
- onVnodeMounted: $
677
+ onVnodeMounted: le
680
678
  }, [
681
- (f(!0), T(Q, null, ue(w.value, (W) => (f(), T(Q, {
679
+ (f(!0), T(X, null, re(w.value, (W) => (f(), T(X, {
682
680
  key: W.label
683
681
  }, [
684
- W.displayAsSection ? (f(), T(Q, { key: 0 }, [
685
- p(F, {
682
+ W.displayAsSection ? (f(), T(X, { key: 0 }, [
683
+ c(F, {
686
684
  label: W.label
687
685
  }, null, 8, ["label"]),
688
- p(G)
689
- ], 64)) : (f(), B(H, {
686
+ c(O)
687
+ ], 64)) : (f(), B(G, {
690
688
  key: 1,
691
689
  label: W.label,
692
690
  "model-value": v(W),
693
- onClick: (Bn) => R(W.value),
691
+ onClick: (On) => R(W.value),
694
692
  "x-should-scroll-into": `${v(W)}`
695
693
  }, null, 8, ["label", "model-value", "onClick", "x-should-scroll-into"]))
696
694
  ], 64))), 128))
@@ -703,37 +701,65 @@ const Et = {
703
701
  }, 8, ["model-value", "rules"])
704
702
  ]),
705
703
  _: 1
706
- }, 8, ["label", "model-value", "locked", "disabled"]),
707
- m(h).enableTotalCost ? (f(), B(ye, {
704
+ }, 8, ["label", "helper-text", "model-value", "locked", "disabled"]),
705
+ d(h).enableTotalCost ? (f(), B(pe, {
708
706
  key: 0,
709
707
  "tooltip-message": "This field is managed by NetSuite",
710
708
  "tooltip-z-index": 50,
711
- "model-value": `${m(st)()} ${I.value}`,
709
+ label: d(r)("inventory.ingredient.valuationMethod.title"),
710
+ "model-value": d(r)("inventory.ingredient.valuationMethod." + L.value),
712
711
  locked: g.value,
713
712
  disabled: t.disabled
714
713
  }, {
715
714
  label: V(() => [
716
- p(we, { "z-index": 50 }, {
715
+ c(he, { "z-index": 50 }, {
717
716
  default: V(() => [
718
- p(x, {
719
- label: m(s)("inventory.ingredient.pricePerUnit")
717
+ c(_, {
718
+ label: d(r)("inventory.ingredient.valuationMethod.title")
720
719
  }, null, 8, ["label"])
721
720
  ]),
722
721
  _: 1
723
722
  })
724
723
  ]),
725
724
  default: V(() => [
726
- m(h).enableTotalCost ? (f(), B(c, {
727
- key: 0,
725
+ c(nt, {
726
+ class: "col-span-2",
727
+ "model-value": L.value,
728
+ "onUpdate:modelValue": e[4] || (e[4] = (M) => L.value = M),
729
+ items: Z.value
730
+ }, null, 8, ["model-value", "items"])
731
+ ]),
732
+ _: 1
733
+ }, 8, ["label", "model-value", "locked", "disabled"])) : j("", !0),
734
+ d(h).enableTotalCost ? (f(), B(pe, {
735
+ key: 1,
736
+ "tooltip-message": "This field is managed by NetSuite",
737
+ "tooltip-z-index": 50,
738
+ "model-value": `${d(ct)()} ${I.value}`,
739
+ locked: g.value,
740
+ disabled: t.disabled
741
+ }, {
742
+ label: V(() => [
743
+ c(he, { "z-index": 50 }, {
744
+ default: V(() => [
745
+ c(_, {
746
+ label: d(r)("inventory.ingredient.pricePerUnit")
747
+ }, null, 8, ["label"])
748
+ ]),
749
+ _: 1
750
+ })
751
+ ]),
752
+ default: V(() => [
753
+ c(p, {
728
754
  "model-value": I.value,
729
- "onUpdate:modelValue": e[4] || (e[4] = (M) => I.value = M),
730
- rules: [m(ge)(0), m(it)(4)]
755
+ "onUpdate:modelValue": e[5] || (e[5] = (M) => I.value = M),
756
+ rules: [d(_e)(0), d(pt)(4)]
731
757
  }, {
732
758
  label: V(() => [
733
- p(we, { "z-index": 50 }, {
759
+ c(he, { "z-index": 50 }, {
734
760
  default: V(() => [
735
- p(x, {
736
- label: m(s)("inventory.ingredient.pricePerUnit")
761
+ c(_, {
762
+ label: d(r)("inventory.ingredient.pricePerUnit")
737
763
  }, null, 8, ["label"])
738
764
  ]),
739
765
  _: 1
@@ -742,81 +768,81 @@ const Et = {
742
768
  prepend: V(() => {
743
769
  var M, W;
744
770
  return [
745
- d("div", Tt, D(re(((M = m(a).currentCountry) == null ? void 0 : M.value) ?? m(De)) === "MYR" ? "RM" : re(((W = m(a).currentCountry) == null ? void 0 : W.value) ?? m(De))), 1)
771
+ m("div", zt, A(d(Ne)(((M = d(a).currentCountry) == null ? void 0 : M.value) ?? d(ze)) === "MYR" ? "RM" : d(Ne)(((W = d(a).currentCountry) == null ? void 0 : W.value) ?? d(ze))), 1)
746
772
  ];
747
773
  }),
748
774
  append: V(() => [
749
- d("div", Dt, " / " + D(se.value), 1)
775
+ m("div", Lt, " / " + A(de.value), 1)
750
776
  ]),
751
777
  _: 1
752
- }, 8, ["model-value", "rules"])) : Y("", !0)
778
+ }, 8, ["model-value", "rules"])
753
779
  ]),
754
780
  _: 1
755
- }, 8, ["model-value", "locked", "disabled"])) : Y("", !0),
756
- !g.value || J.value ? (f(), B($t, {
757
- key: 1,
781
+ }, 8, ["model-value", "locked", "disabled"])) : j("", !0),
782
+ !g.value || J.value ? (f(), B(At, {
783
+ key: 2,
758
784
  "model-value": J.value,
759
- "onUpdate:modelValue": e[5] || (e[5] = (M) => J.value = M),
785
+ "onUpdate:modelValue": e[6] || (e[6] = (M) => J.value = M),
760
786
  "root-value": t.modelValue,
761
787
  readonly: g.value
762
- }, null, 8, ["model-value", "root-value", "readonly"])) : Y("", !0),
763
- t.mode !== m(K).CREATE ? (f(), T("div", Pt, [
764
- d("div", null, [
765
- p(Qe, {
766
- label: m(s)("inventory.ingredient.bindedItems.title"),
767
- modelValue: z.value,
768
- "onUpdate:modelValue": e[6] || (e[6] = (M) => z.value = M),
788
+ }, null, 8, ["model-value", "root-value", "readonly"])) : j("", !0),
789
+ t.mode !== d(K).CREATE ? (f(), T("div", Ht, [
790
+ m("div", null, [
791
+ c(ot, {
792
+ label: d(r)("inventory.ingredient.bindedItems.title"),
793
+ modelValue: Q.value,
794
+ "onUpdate:modelValue": e[7] || (e[7] = (M) => Q.value = M),
769
795
  "label-placement": "right"
770
796
  }, null, 8, ["label", "modelValue"])
771
797
  ]),
772
- z.value && q.value.length ? (f(), B(Ce, {
798
+ Q.value && se.value.length ? (f(), B(we, {
773
799
  key: 0,
774
- name: m(s)("inventory.ingredient.bindedItems.ingredient"),
775
- bindings: q.value
776
- }, null, 8, ["name", "bindings"])) : Y("", !0),
777
- z.value && ne.value.length ? (f(), B(Ce, {
800
+ name: d(r)("inventory.ingredient.bindedItems.ingredient"),
801
+ bindings: se.value
802
+ }, null, 8, ["name", "bindings"])) : j("", !0),
803
+ Q.value && ye.value.length ? (f(), B(we, {
778
804
  key: 1,
779
- name: m(s)("inventory.ingredient.bindedItems.recipe"),
780
- bindings: ne.value
781
- }, null, 8, ["name", "bindings"])) : Y("", !0),
782
- z.value && de.value.length ? (f(), B(Ce, {
805
+ name: d(r)("inventory.ingredient.bindedItems.recipe"),
806
+ bindings: ye.value
807
+ }, null, 8, ["name", "bindings"])) : j("", !0),
808
+ Q.value && D.value.length ? (f(), B(we, {
783
809
  key: 2,
784
- name: m(s)("inventory.ingredient.bindedItems.menu"),
785
- bindings: de.value
786
- }, null, 8, ["name", "bindings"])) : Y("", !0)
787
- ])) : Y("", !0),
788
- d("div", Bt, [
789
- d("div", Nt, [
790
- p(we, null, {
810
+ name: d(r)("inventory.ingredient.bindedItems.menu"),
811
+ bindings: D.value
812
+ }, null, 8, ["name", "bindings"])) : j("", !0)
813
+ ])) : j("", !0),
814
+ m("div", Ot, [
815
+ m("div", jt, [
816
+ c(he, null, {
791
817
  default: V(() => [
792
- d("div", Lt, D(m(s)("inventory.ingredient.threshold.title")), 1)
818
+ m("div", qt, A(d(r)("inventory.ingredient.threshold.title")), 1)
793
819
  ]),
794
820
  _: 1
795
821
  }),
796
- d("div", zt, D(m(s)("inventory.ingredient.threshold.subtitle")), 1)
822
+ m("div", Yt, A(d(r)("inventory.ingredient.threshold.subtitle")), 1)
797
823
  ]),
798
- d("div", Ht, [
799
- p($e, {
800
- "model-value": { low: X.value, mid: A.value },
801
- rules: [O()]
824
+ m("div", Gt, [
825
+ c($e, {
826
+ "model-value": { low: P.value, mid: z.value },
827
+ rules: [ge()]
802
828
  }, null, 8, ["model-value", "rules"]),
803
- d("div", Yt, [
804
- d("div", jt, [
805
- d("div", Ot, [
806
- p(Ve, {
807
- days: X.value,
808
- level: m(Se).low
829
+ m("div", Wt, [
830
+ m("div", Kt, [
831
+ m("div", Zt, [
832
+ c(Se, {
833
+ days: P.value,
834
+ level: d(Ce).low
809
835
  }, null, 8, ["days", "level"])
810
836
  ]),
811
- d("div", qt, [
812
- d("div", Gt, D(m(s)("inventory.ingredient.threshold.whenRemaining")), 1),
813
- p(Ee, {
814
- modelValue: X.value,
815
- "onUpdate:modelValue": e[7] || (e[7] = (M) => X.value = M),
816
- rules: [m(ge)(0)]
837
+ m("div", Jt, [
838
+ m("div", Qt, A(d(r)("inventory.ingredient.threshold.whenRemaining")), 1),
839
+ c(Ee, {
840
+ modelValue: P.value,
841
+ "onUpdate:modelValue": e[8] || (e[8] = (M) => P.value = M),
842
+ rules: [d(_e)(0)]
817
843
  }, {
818
- append: V(() => e[10] || (e[10] = [
819
- d("div", {
844
+ append: V(() => e[11] || (e[11] = [
845
+ m("div", {
820
846
  class: "text-fm-color-typo-secondary",
821
847
  style: { "padding-right": "32px" }
822
848
  }, "days", -1)
@@ -825,31 +851,31 @@ const Et = {
825
851
  }, 8, ["modelValue", "rules"])
826
852
  ])
827
853
  ]),
828
- e[12] || (e[12] = d("div", {
854
+ e[13] || (e[13] = m("div", {
829
855
  class: "h-full bg-fm-color-neutral-gray-200 relative",
830
856
  style: { width: "1px" }
831
857
  }, [
832
- d("div", {
858
+ m("div", {
833
859
  class: "absolute bg-white",
834
860
  style: { transform: "translate(-50%, -50%)", left: "50%", top: "24px" }
835
861
  }, " < ")
836
862
  ], -1)),
837
- d("div", Wt, [
838
- d("div", Kt, [
839
- p(Ve, {
840
- days: A.value,
841
- level: m(Se).mid
863
+ m("div", Xt, [
864
+ m("div", en, [
865
+ c(Se, {
866
+ days: z.value,
867
+ level: d(Ce).mid
842
868
  }, null, 8, ["days", "level"])
843
869
  ]),
844
- d("div", Zt, [
845
- d("div", Jt, D(m(s)("inventory.ingredient.threshold.whenRemaining")), 1),
846
- p(Ee, {
847
- modelValue: A.value,
848
- "onUpdate:modelValue": e[8] || (e[8] = (M) => A.value = M),
849
- rules: [m(ge)(0)]
870
+ m("div", tn, [
871
+ m("div", nn, A(d(r)("inventory.ingredient.threshold.whenRemaining")), 1),
872
+ c(Ee, {
873
+ modelValue: z.value,
874
+ "onUpdate:modelValue": e[9] || (e[9] = (M) => z.value = M),
875
+ rules: [d(_e)(0)]
850
876
  }, {
851
- append: V(() => e[11] || (e[11] = [
852
- d("div", {
877
+ append: V(() => e[12] || (e[12] = [
878
+ m("div", {
853
879
  class: "text-fm-color-typo-secondary",
854
880
  style: { "padding-right": "32px" }
855
881
  }, "days", -1)
@@ -858,34 +884,34 @@ const Et = {
858
884
  }, 8, ["modelValue", "rules"])
859
885
  ])
860
886
  ]),
861
- e[13] || (e[13] = d("div", {
887
+ e[14] || (e[14] = m("div", {
862
888
  class: "h-full bg-fm-color-neutral-gray-200 relative",
863
889
  style: { width: "1px" }
864
890
  }, [
865
- d("div", {
891
+ m("div", {
866
892
  class: "absolute bg-white",
867
893
  style: { transform: "translate(-50%, -50%)", left: "50%", top: "24px" }
868
894
  }, " < ")
869
895
  ], -1)),
870
- d("div", Qt, [
871
- d("div", Xt, [
872
- p(Ve, {
873
- days: A.value + 1,
874
- level: m(Se).high
896
+ m("div", on, [
897
+ m("div", ln, [
898
+ c(Se, {
899
+ days: z.value + 1,
900
+ level: d(Ce).high
875
901
  }, null, 8, ["days", "level"])
876
902
  ]),
877
- d("div", en, [
878
- d("div", tn, D(m(s)("inventory.ingredient.threshold.stockIsStaple")), 1)
903
+ m("div", an, [
904
+ m("div", rn, A(d(r)("inventory.ingredient.threshold.stockIsStaple")), 1)
879
905
  ])
880
906
  ])
881
907
  ])
882
908
  ])
883
909
  ]),
884
- d("div", null, [
885
- p(It, {
910
+ m("div", null, [
911
+ c(Rt, {
886
912
  entity: "inventorySku",
887
- modelValue: Z.value,
888
- "onUpdate:modelValue": e[9] || (e[9] = (M) => Z.value = M)
913
+ modelValue: Y.value,
914
+ "onUpdate:modelValue": e[10] || (e[10] = (M) => Y.value = M)
889
915
  }, null, 8, ["modelValue"])
890
916
  ])
891
917
  ];
@@ -894,10 +920,10 @@ const Et = {
894
920
  }, 8, ["disabled"]);
895
921
  };
896
922
  }
897
- }), on = { class: "flex flex-col gap-32" }, ln = {
923
+ }), dn = { class: "flex flex-col gap-32" }, un = {
898
924
  key: 0,
899
925
  class: "flex flex-col gap-12"
900
- }, an = { class: "flex flex-col gap-4" }, rn = { class: "flex-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, sn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, un = { class: "flex gap-4" }, dn = /* @__PURE__ */ oe({
926
+ }, mn = { class: "flex flex-col gap-4" }, cn = { class: "flex-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, pn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, vn = { class: "flex gap-4" }, fn = /* @__PURE__ */ te({
901
927
  __name: "IngredientDialog",
902
928
  props: {
903
929
  show: { type: Boolean },
@@ -906,10 +932,10 @@ const Et = {
906
932
  },
907
933
  emits: ["update:show"],
908
934
  setup(u) {
909
- const o = u, y = le(), s = Me(), n = he(), { t: l } = ae(), i = Ne(o, "show"), a = Ne(o, "unit"), h = S(
935
+ const o = u, y = ne(), r = Ie(), n = ke(), { t: l } = oe(), i = Oe(o, "show"), a = Oe(o, "unit"), h = S(
910
936
  () => {
911
937
  var v;
912
- return s.isEnabled && s.netSuiteItemBySkuId.has((v = o.unit) == null ? void 0 : v._id);
938
+ return r.isEnabled && r.netSuiteItemBySkuId.has((v = o.unit) == null ? void 0 : v._id);
913
939
  }
914
940
  ), k = S(() => {
915
941
  switch (o.mode) {
@@ -931,9 +957,9 @@ const Et = {
931
957
  return l("common.add");
932
958
  }
933
959
  return "";
934
- }), b = j(), r = j(!1);
935
- async function _() {
936
- r.value = !0;
960
+ }), b = q(), s = q(!1);
961
+ async function x() {
962
+ s.value = !0;
937
963
  try {
938
964
  await y.createSku(a.value), i.value = !1, n.open({
939
965
  title: l("inventory.common.success"),
@@ -941,31 +967,31 @@ const Et = {
941
967
  type: "success"
942
968
  });
943
969
  } catch (v) {
944
- v instanceof Pe || n.open({
970
+ v instanceof Le || n.open({
945
971
  title: l("inventory.ingredient.create.error.title"),
946
972
  message: l("inventory.ingredient.create.error.message"),
947
973
  type: "error"
948
974
  });
949
975
  } finally {
950
- r.value = !1;
976
+ s.value = !1;
951
977
  }
952
978
  }
953
979
  async function U() {
954
- r.value = !0;
980
+ s.value = !0;
955
981
  try {
956
- await y.updateSku(a.value), r.value = !1, i.value = !1, n.open({
982
+ await y.updateSku(a.value), s.value = !1, i.value = !1, n.open({
957
983
  title: l("inventory.common.success"),
958
984
  message: l("inventory.ingredient.update.success", { name: a.value.name }),
959
985
  type: "success"
960
986
  });
961
987
  } catch (v) {
962
- v instanceof Pe || n.open({
988
+ v instanceof Le || n.open({
963
989
  title: l("inventory.ingredient.update.error.title"),
964
990
  message: l("inventory.ingredient.update.error.message"),
965
991
  type: "error"
966
992
  });
967
993
  } finally {
968
- r.value = !1;
994
+ s.value = !1;
969
995
  }
970
996
  }
971
997
  function I() {
@@ -979,82 +1005,82 @@ const Et = {
979
1005
  case K.UPDATE:
980
1006
  return U();
981
1007
  case K.CREATE:
982
- return _();
1008
+ return x();
983
1009
  }
984
1010
  }
985
1011
  const w = S(() => {
986
1012
  var J, Z;
987
- if (!s.isEnabled || !((J = o.unit) != null && J._id)) return null;
988
- const v = (Z = s.netSuiteItemBySkuId.get(o.unit._id)) == null ? void 0 : Z[0];
989
- return v ? s.state.setting.childItems.filter(
1013
+ if (!r.isEnabled || !((J = o.unit) != null && J._id)) return null;
1014
+ const v = (Z = r.netSuiteItemBySkuId.get(o.unit._id)) == null ? void 0 : Z[0];
1015
+ return v ? r.state.setting.childItems.filter(
990
1016
  (L) => L.parentNetSuiteId === v.netSuiteId
991
1017
  ).map((L) => {
992
- var q;
993
- const z = (q = s.measurementByNetsuiteId.get(L.unitOfMeasureId)) == null ? void 0 : q[0];
994
- return z ? {
1018
+ var H;
1019
+ const Y = (H = r.measurementByNetsuiteId.get(L.unitOfMeasureId)) == null ? void 0 : H[0];
1020
+ return Y ? {
995
1021
  externalId: L.externalId,
996
- ...z
1022
+ ...Y
997
1023
  } : null;
998
1024
  }).filter((L) => L).map((L) => L) : null;
999
1025
  });
1000
1026
  return (v, R) => {
1001
1027
  const J = C("FmChip"), Z = C("FmButton"), L = C("FmSideSheet");
1002
1028
  return f(), B(L, {
1003
- "model-value": m(i),
1004
- "onUpdate:modelValue": R[3] || (R[3] = (z) => Re(i) ? i.value = z : null),
1029
+ "model-value": d(i),
1030
+ "onUpdate:modelValue": R[3] || (R[3] = (Y) => De(i) ? i.value = Y : null),
1005
1031
  header: k.value,
1006
1032
  "close-button": "",
1007
1033
  "dismiss-away": "",
1008
1034
  "max-width": 500
1009
1035
  }, {
1010
1036
  "side-sheet-footer": V(() => [
1011
- d("div", un, [
1012
- p(Z, {
1013
- loading: r.value,
1037
+ m("div", vn, [
1038
+ c(Z, {
1039
+ loading: s.value,
1014
1040
  label: g.value,
1015
1041
  onClick: I
1016
1042
  }, null, 8, ["loading", "label"]),
1017
- p(Z, {
1018
- disabled: r.value,
1019
- label: m(l)("common.close"),
1043
+ c(Z, {
1044
+ disabled: s.value,
1045
+ label: d(l)("common.close"),
1020
1046
  variant: "tertiary",
1021
- onClick: R[2] || (R[2] = (z) => i.value = !1)
1047
+ onClick: R[2] || (R[2] = (Y) => i.value = !1)
1022
1048
  }, null, 8, ["disabled", "label"])
1023
1049
  ])
1024
1050
  ]),
1025
1051
  default: V(() => {
1026
- var z;
1052
+ var Y;
1027
1053
  return [
1028
- d("div", on, [
1029
- d("div", null, [
1054
+ m("div", dn, [
1055
+ m("div", null, [
1030
1056
  h.value ? (f(), B(J, {
1031
1057
  key: 0,
1032
1058
  label: "Netsuite",
1033
1059
  compact: ""
1034
- })) : Y("", !0)
1060
+ })) : j("", !0)
1035
1061
  ]),
1036
- p(nn, {
1062
+ c(sn, {
1037
1063
  class: "w-full",
1038
1064
  ref_key: "hasValidationExpose",
1039
1065
  ref: b,
1040
- modelValue: m(a),
1041
- "onUpdate:modelValue": R[0] || (R[0] = (q) => Re(a) ? a.value = q : null),
1066
+ modelValue: d(a),
1067
+ "onUpdate:modelValue": R[0] || (R[0] = (H) => De(a) ? a.value = H : null),
1042
1068
  mode: v.mode,
1043
- disabled: r.value,
1044
- "onClick:submit": R[1] || (R[1] = (q) => N())
1069
+ disabled: s.value,
1070
+ "onClick:submit": R[1] || (R[1] = (H) => N())
1045
1071
  }, null, 8, ["modelValue", "mode", "disabled"]),
1046
- (z = w.value) != null && z.length ? (f(), T("div", ln, [
1047
- R[4] || (R[4] = d("div", { class: "fm-typo-en-title-sm-600" }, D("NetSuite info"), -1)),
1048
- d("div", an, [
1049
- (f(!0), T(Q, null, ue(w.value, (q, ne) => (f(), T("div", {
1050
- key: ne,
1072
+ (Y = w.value) != null && Y.length ? (f(), T("div", un, [
1073
+ R[4] || (R[4] = m("div", { class: "fm-typo-en-title-sm-600" }, A("NetSuite info"), -1)),
1074
+ m("div", mn, [
1075
+ (f(!0), T(X, null, re(w.value, (H, Q) => (f(), T("div", {
1076
+ key: Q,
1051
1077
  class: "flex items-center"
1052
1078
  }, [
1053
- d("div", rn, D(q.externalId), 1),
1054
- d("div", sn, D(q.abbrev), 1)
1079
+ m("div", cn, A(H.externalId), 1),
1080
+ m("div", pn, A(H.abbrev), 1)
1055
1081
  ]))), 128))
1056
1082
  ])
1057
- ])) : Y("", !0)
1083
+ ])) : j("", !0)
1058
1084
  ])
1059
1085
  ];
1060
1086
  }),
@@ -1063,37 +1089,37 @@ const Et = {
1063
1089
  };
1064
1090
  }
1065
1091
  });
1066
- function* mn(u) {
1092
+ function* yn(u) {
1067
1093
  for (; ; )
1068
1094
  yield u[Math.floor(Math.random() * u.length)];
1069
1095
  }
1070
- function cn(u = 4, o = mn("qwertyuiopasdfghjklzxcvbnm".split(""))) {
1096
+ function gn(u = 4, o = yn("qwertyuiopasdfghjklzxcvbnm".split(""))) {
1071
1097
  return Array.from({ length: u }).map(() => o.next().value).join("");
1072
1098
  }
1073
- function pn() {
1074
- return `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${cn()}`;
1099
+ function bn() {
1100
+ return `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${gn()}`;
1075
1101
  }
1076
- const vn = {
1102
+ const hn = {
1077
1103
  _id: "",
1078
1104
  name: "",
1079
1105
  abbrev: "",
1080
1106
  precision: 0,
1081
1107
  measurements: []
1082
1108
  };
1083
- function fn(u) {
1084
- var y, s, n, l, i;
1109
+ function _n(u) {
1110
+ var y, r, n, l, i;
1085
1111
  return {
1086
1112
  code: u.code,
1087
1113
  name: u.name,
1088
1114
  unit: ((y = u.unit.measurements.find((a) => a.id === u.trackingMeasurement)) == null ? void 0 : y.abbrev) ?? u.unit.abbrev,
1089
1115
  baseUnit: u.unit.abbrev,
1090
1116
  valuationMethod: u.valuation ?? "WAVG",
1091
- pricePerUnit: (s = u.defaultCost) != null && s.costPerUnit ? +Oe((n = u.defaultCost) == null ? void 0 : n.costPerUnit) : 0,
1092
- thresholdLow: ((l = u.thresholds) == null ? void 0 : l.low) ?? ie().low,
1093
- thresholdMid: ((i = u.thresholds) == null ? void 0 : i.mid) ?? ie().mid
1117
+ pricePerUnit: (r = u.defaultCost) != null && r.costPerUnit ? +Ke((n = u.defaultCost) == null ? void 0 : n.costPerUnit) : 0,
1118
+ thresholdLow: ((l = u.thresholds) == null ? void 0 : l.low) ?? ae().low,
1119
+ thresholdMid: ((i = u.thresholds) == null ? void 0 : i.mid) ?? ae().mid
1094
1120
  };
1095
1121
  }
1096
- function Je() {
1122
+ function tt() {
1097
1123
  var n;
1098
1124
  const u = [
1099
1125
  {
@@ -1112,7 +1138,7 @@ function Je() {
1112
1138
  id: "baseUnit",
1113
1139
  name: "Base unit"
1114
1140
  }
1115
- ], o = Ge(), y = pe(), s = be(y.currentCountry.value);
1141
+ ], o = et(), y = fe(), r = xe(y.currentCountry.value);
1116
1142
  return o.enableTotalCost && u.push(
1117
1143
  {
1118
1144
  id: "valuationMethod",
@@ -1120,7 +1146,7 @@ function Je() {
1120
1146
  },
1121
1147
  {
1122
1148
  id: "pricePerUnit",
1123
- name: `Price per unit (${s == null ? void 0 : s.currency})`
1149
+ name: `Price per unit (${r == null ? void 0 : r.currency})`
1124
1150
  }
1125
1151
  ), ((n = y.currentBusiness.value) == null ? void 0 : n.menuVersion) === "v4" && u.push(
1126
1152
  {
@@ -1133,59 +1159,59 @@ function Je() {
1133
1159
  }
1134
1160
  ), u;
1135
1161
  }
1136
- function yn() {
1137
- const o = le().skus.map(fn), s = pe().currentBusiness.value, n = Je(), l = [
1138
- ["Business name:", s == null ? void 0 : s.name],
1139
- ["Business ID:", s == null ? void 0 : s._id],
1140
- ["Menu version", s == null ? void 0 : s.menuVersion],
1162
+ function xn() {
1163
+ const o = ne().skus.map(_n), r = fe().currentBusiness.value, n = tt(), l = [
1164
+ ["Business name:", r == null ? void 0 : r.name],
1165
+ ["Business ID:", r == null ? void 0 : r._id],
1166
+ ["Menu version", r == null ? void 0 : r.menuVersion],
1141
1167
  [],
1142
1168
  n.map((k) => k.name),
1143
1169
  ...o.map((k) => n.map((g) => k[g.id]))
1144
- ], i = n.map((k) => `system:${k.id}`), a = We(l, i), h = `${s == null ? void 0 : s.name} ingredients (${ut(/* @__PURE__ */ new Date())}).xlsx`;
1145
- return Ke(a, h), h;
1170
+ ], i = n.map((k) => `system:${k.id}`), a = Je(l, i), h = `${r == null ? void 0 : r.name} ingredients (${vt(/* @__PURE__ */ new Date())}).xlsx`;
1171
+ return Qe(a, h), h;
1146
1172
  }
1147
- function gn() {
1148
- const o = pe().currentBusiness.value, y = Je(), s = [
1173
+ function kn() {
1174
+ const o = fe().currentBusiness.value, y = tt(), r = [
1149
1175
  ["Business name:", o == null ? void 0 : o.name],
1150
1176
  ["Business ID:", o == null ? void 0 : o._id],
1151
1177
  ["Menu version", o == null ? void 0 : o.menuVersion],
1152
1178
  [],
1153
1179
  y.map((a) => a.name)
1154
- ], n = y.map((a) => `system:${a.id}`), l = We(s, n), i = "FeedMe ingredients template.xlsx";
1155
- return Ke(l, i), i;
1180
+ ], n = y.map((a) => `system:${a.id}`), l = Je(r, n), i = "FeedMe ingredients template.xlsx";
1181
+ return Qe(l, i), i;
1156
1182
  }
1157
- function bn(u) {
1183
+ function Vn(u) {
1158
1184
  const [
1159
1185
  o,
1160
1186
  y,
1161
- s,
1187
+ r,
1162
1188
  n,
1163
1189
  l,
1164
1190
  i,
1165
1191
  ...a
1166
- ] = mt(u);
1167
- if (!o || !o.length || o.some((r) => r.length && !r.startsWith("system:")))
1192
+ ] = yt(u);
1193
+ if (!o || !o.length || o.some((s) => s.length && !s.startsWith("system:")))
1168
1194
  throw new Error("Missing meta header. Excel file does not come from the template.");
1169
- const h = o.map((r) => r.split(":")[1]), g = ["code", "name", "unit", "baseUnit"].filter((r) => !h.includes(r));
1195
+ const h = o.map((s) => s.split(":")[1]), g = ["code", "name", "unit", "baseUnit"].filter((s) => !h.includes(s));
1170
1196
  if (g.length)
1171
1197
  throw new Error(
1172
1198
  `Missing meta headers (${g.join()}). Excel file does not come from the template.`
1173
1199
  );
1174
- return a.map((r, _) => {
1200
+ return a.map((s, x) => {
1175
1201
  const U = {};
1176
1202
  for (const I in h) {
1177
1203
  const N = h[I];
1178
- Object.assign(U, { [N]: r[I] });
1204
+ Object.assign(U, { [N]: s[I] });
1179
1205
  }
1180
1206
  return {
1181
- index: _,
1207
+ index: x,
1182
1208
  data: U
1183
1209
  };
1184
1210
  });
1185
1211
  }
1186
- function Le(u, o, y) {
1212
+ function je(u, o, y) {
1187
1213
  var w;
1188
- const n = le().units, l = new Array(), i = y.filter((v) => v.data.code === u.code);
1214
+ const n = ne().units, l = new Array(), i = y.filter((v) => v.data.code === u.code);
1189
1215
  i.length > 1 && l.push(
1190
1216
  `Code ${u.code} is already used in row ${i.map((v) => v.index + 6).join()}.`
1191
1217
  );
@@ -1196,44 +1222,44 @@ function Le(u, o, y) {
1196
1222
  const v = `Cannot find unit conversion for ${u.baseUnit} with symbol ${u.unit || "[empty]"}.`;
1197
1223
  l.push(v);
1198
1224
  }
1199
- const k = ce.options.find(
1225
+ const k = ve.options.find(
1200
1226
  (v) => v === u.valuationMethod
1201
1227
  );
1202
1228
  u.valuationMethod && !k && l.push(
1203
- `Expected valuation method to be one of ${ce.options.join()} but got ${u.valuationMethod} instead.`
1229
+ `Expected valuation method to be one of ${ve.options.join()} but got ${u.valuationMethod} instead.`
1204
1230
  );
1205
- const b = pe().currentCountry.value, r = (v) => `${v}`.length && ct()(v) === !0, _ = r(`${u.pricePerUnit}`) === !0 ? {
1231
+ const b = fe().currentCountry.value, s = (v) => `${v}`.length && gt()(v) === !0, x = s(`${u.pricePerUnit}`) === !0 ? {
1206
1232
  costPerUnit: {
1207
- ...qe(Number(u.pricePerUnit) || 0),
1208
- currency: ((w = be(b)) == null ? void 0 : w.currency) ?? "MYR"
1233
+ ...Ze(Number(u.pricePerUnit) || 0),
1234
+ currency: ((w = xe(b)) == null ? void 0 : w.currency) ?? "MYR"
1209
1235
  },
1210
1236
  measurement: h
1211
- } : void 0, U = r(`${u.thresholdLow}`) && r(`${u.thresholdMid}`) ? {
1237
+ } : void 0, U = s(`${u.thresholdLow}`) && s(`${u.thresholdMid}`) ? {
1212
1238
  low: Number(u.thresholdLow) || 0,
1213
1239
  mid: Number(u.thresholdMid) || 0
1214
1240
  } : void 0;
1215
1241
  return {
1216
1242
  type: "create",
1217
1243
  sku: {
1218
- _id: pn(),
1244
+ _id: bn(),
1219
1245
  code: u.code,
1220
1246
  name: u.name,
1221
- unit: a ?? n.find((v) => v) ?? vn,
1247
+ unit: a ?? n.find((v) => v) ?? hn,
1222
1248
  trackingMeasurement: h == null ? void 0 : h.id,
1223
1249
  valuation: k,
1224
- defaultCost: _,
1250
+ defaultCost: x,
1225
1251
  thresholds: U
1226
1252
  },
1227
1253
  errors: l,
1228
1254
  excelRowNumber: o + 6
1229
1255
  };
1230
1256
  }
1231
- function hn(u) {
1257
+ function Sn(u) {
1232
1258
  try {
1233
- const o = bn(u).filter((k) => k.data.code), s = le().skus, n = dt(s, "code"), l = o.filter((k) => !n[k.data.code]), i = o.filter((k) => n[k.data.code]), a = l.map(
1234
- (k) => Le(k.data, k.index, o)
1259
+ const o = Vn(u).filter((k) => k.data.code), r = ne().skus, n = ft(r, "code"), l = o.filter((k) => !n[k.data.code]), i = o.filter((k) => n[k.data.code]), a = l.map(
1260
+ (k) => je(k.data, k.index, o)
1235
1261
  ), h = i.map((k) => {
1236
- const g = Le(k.data, k.index, o), b = n[k.data.code];
1262
+ const g = je(k.data, k.index, o), b = n[k.data.code];
1237
1263
  return {
1238
1264
  ...g,
1239
1265
  type: "update",
@@ -1265,10 +1291,10 @@ function hn(u) {
1265
1291
  };
1266
1292
  }
1267
1293
  }
1268
- const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-col" }, kn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, Vn = {
1294
+ const Cn = { class: "flex items-center gap-12 pl-8" }, wn = { class: "flex flex-col" }, Fn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, Mn = {
1269
1295
  key: 0,
1270
1296
  class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
1271
- }, Sn = { key: 0 }, ze = /* @__PURE__ */ oe({
1297
+ }, In = { key: 0 }, qe = /* @__PURE__ */ te({
1272
1298
  __name: "ImportIngredientItem",
1273
1299
  props: {
1274
1300
  type: {},
@@ -1278,28 +1304,28 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1278
1304
  },
1279
1305
  setup(u) {
1280
1306
  return (o, y) => {
1281
- const s = C("FmIcon"), n = C("FmTooltip");
1282
- return f(), T("div", _n, [
1283
- y[0] || (y[0] = d("div", null, "•", -1)),
1284
- d("div", xn, [
1285
- d("div", kn, [
1286
- d("div", {
1287
- class: te({
1307
+ const r = C("FmIcon"), n = C("FmTooltip");
1308
+ return f(), T("div", Cn, [
1309
+ y[0] || (y[0] = m("div", null, "•", -1)),
1310
+ m("div", wn, [
1311
+ m("div", Fn, [
1312
+ m("div", {
1313
+ class: ee({
1288
1314
  "text-fm-color-system-error-300": o.errors.length
1289
1315
  })
1290
1316
  }, [
1291
- Ie(D(o.name) + " ", 1),
1292
- o.type === "create" ? (f(), T("span", Vn, "(new)")) : Y("", !0)
1317
+ Me(A(o.name) + " ", 1),
1318
+ o.type === "create" ? (f(), T("span", Mn, "(new)")) : j("", !0)
1293
1319
  ], 2),
1294
- o.errors.length ? (f(), T("div", Sn, [
1295
- p(n, { "z-index": 50 }, {
1320
+ o.errors.length ? (f(), T("div", In, [
1321
+ c(n, { "z-index": 50 }, {
1296
1322
  content: V(() => [
1297
- d("ol", null, [
1298
- (f(!0), T(Q, null, ue(o.errors, (l, i) => (f(), T("li", { key: i }, D(l), 1))), 128))
1323
+ m("ol", null, [
1324
+ (f(!0), T(X, null, re(o.errors, (l, i) => (f(), T("li", { key: i }, A(l), 1))), 128))
1299
1325
  ])
1300
1326
  ]),
1301
1327
  default: V(() => [
1302
- p(s, {
1328
+ c(r, {
1303
1329
  name: "error",
1304
1330
  size: "sm",
1305
1331
  color: "system-error-300"
@@ -1307,52 +1333,52 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1307
1333
  ]),
1308
1334
  _: 1
1309
1335
  })
1310
- ])) : Y("", !0)
1336
+ ])) : j("", !0)
1311
1337
  ]),
1312
- d("div", {
1313
- class: te([
1338
+ m("div", {
1339
+ class: ee([
1314
1340
  "fm-typo-en-body-sm-400",
1315
1341
  {
1316
1342
  "text-fm-color-system-error-200": o.errors.length,
1317
1343
  "text-fm-color-typo-secondary": !o.errors.length
1318
1344
  }
1319
1345
  ])
1320
- }, D(o.code), 3)
1346
+ }, A(o.code), 3)
1321
1347
  ])
1322
1348
  ]);
1323
1349
  };
1324
1350
  }
1325
- }), Cn = { class: "flex flex-col gap-24" }, wn = { class: "fm-typo-en-body-md-400" }, Fn = { class: "flex flex-col gap-8" }, In = { class: "line-clamp-2 text-ellipsis break-all" }, Mn = {
1351
+ }), $n = { class: "flex flex-col gap-24" }, En = { class: "fm-typo-en-body-md-400" }, Un = { class: "flex flex-col gap-8" }, Rn = { class: "line-clamp-2 text-ellipsis break-all" }, Tn = {
1326
1352
  key: 2,
1327
1353
  class: "shrink-0"
1328
- }, $n = {
1354
+ }, An = {
1329
1355
  key: 0,
1330
1356
  class: "flex flex-col"
1331
- }, En = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, Un = {
1357
+ }, Dn = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, Pn = {
1332
1358
  key: 0,
1333
1359
  class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
1334
- }, Rn = { class: "fm-typo-en-body-lg-600" }, An = /* @__PURE__ */ oe({
1360
+ }, Bn = { class: "fm-typo-en-body-lg-600" }, Nn = /* @__PURE__ */ te({
1335
1361
  __name: "ImportIngredients",
1336
1362
  setup(u) {
1337
- const o = j(null), y = _t(), s = he(), n = j(!1), l = j(new Array()), i = j([]), a = j([]), h = S(
1338
- () => !!l.value.length || i.value.some((r) => r.errors.length) || a.value.some((r) => r.errors.length)
1363
+ const o = q(null), y = Ct(), r = ke(), n = q(!1), l = q(new Array()), i = q([]), a = q([]), h = S(
1364
+ () => !!l.value.length || i.value.some((s) => s.errors.length) || a.value.some((s) => s.errors.length)
1339
1365
  ), k = S(
1340
1366
  () => !!i.value.length || !!a.value.length
1341
- ), { t: g } = ae();
1342
- async function b(r) {
1367
+ ), { t: g } = oe();
1368
+ async function b(s) {
1343
1369
  l.value = [], i.value = [], a.value = [];
1344
1370
  try {
1345
1371
  n.value = !0;
1346
- const [_] = await Promise.all([
1347
- vt(r),
1372
+ const [x] = await Promise.all([
1373
+ ht(s),
1348
1374
  // fake buffer
1349
1375
  new Promise((N) => setTimeout(N, 1e3))
1350
- ]), U = _.SheetNames.find((N) => N);
1376
+ ]), U = x.SheetNames.find((N) => N);
1351
1377
  if (!U) {
1352
1378
  l.value.push(g("inventory.ingredient.import.fileError.noSheet"));
1353
1379
  return;
1354
1380
  }
1355
- const I = hn(_.Sheets[U]);
1381
+ const I = Sn(x.Sheets[U]);
1356
1382
  if (I.invalidExcel) {
1357
1383
  l.value.push(I.invalidExcelMessage ?? g("inventory.ingredient.import.fileError.invalidExcel"));
1358
1384
  return;
@@ -1362,41 +1388,41 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1362
1388
  return;
1363
1389
  }
1364
1390
  y.emitData(I);
1365
- } catch (_) {
1366
- s.open({
1391
+ } catch (x) {
1392
+ r.open({
1367
1393
  title: g("inventory.ingredient.import.fileError.unableToRead"),
1368
- message: _ == null ? void 0 : _.message,
1394
+ message: x == null ? void 0 : x.message,
1369
1395
  type: "error"
1370
- }), console.error("Error in reading file", _);
1396
+ }), console.error("Error in reading file", x);
1371
1397
  } finally {
1372
- l.value.length && s.open({
1398
+ l.value.length && r.open({
1373
1399
  title: g("inventory.ingredient.import.fileError.invalidExcel"),
1374
1400
  type: "error"
1375
1401
  }), n.value = !1;
1376
1402
  }
1377
1403
  }
1378
- return He(o, (r) => {
1379
- r && b(r);
1380
- }), (r, _) => {
1404
+ return Ye(o, (s) => {
1405
+ s && b(s);
1406
+ }), (s, x) => {
1381
1407
  const U = C("FmCircularProgress"), I = C("FmIcon"), N = C("FmButton");
1382
- return f(), T("div", Cn, [
1383
- d("div", wn, D(m(g)("inventory.ingredient.import.uploadDescription")), 1),
1384
- p(pt, {
1385
- class: te({
1408
+ return f(), T("div", $n, [
1409
+ m("div", En, A(d(g)("inventory.ingredient.import.uploadDescription")), 1),
1410
+ c(bt, {
1411
+ class: ee({
1386
1412
  "w-full": !0,
1387
1413
  "h-[200px]": !o.value
1388
1414
  }),
1389
1415
  accept: ".xlsx",
1390
- onFileUpload: _[0] || (_[0] = (w) => o.value = w),
1391
- label: m(g)("inventory.ingredient.import.uploadTemplate"),
1392
- "button-label": m(g)("inventory.ingredient.import.selectFile")
1393
- }, Ye({ _: 2 }, [
1416
+ onFileUpload: x[0] || (x[0] = (w) => o.value = w),
1417
+ label: d(g)("inventory.ingredient.import.uploadTemplate"),
1418
+ "button-label": d(g)("inventory.ingredient.import.selectFile")
1419
+ }, Ge({ _: 2 }, [
1394
1420
  o.value ? {
1395
1421
  name: "default",
1396
1422
  fn: V(({ openFileDialog: w }) => [
1397
- d("div", Fn, [
1398
- d("div", {
1399
- class: te([
1423
+ m("div", Un, [
1424
+ m("div", {
1425
+ class: ee([
1400
1426
  "fm-corner-radius-md p-16 flex items-center gap-16",
1401
1427
  {
1402
1428
  "border border-fm-color-neutral-gray-100": n.value,
@@ -1415,8 +1441,8 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1415
1441
  outline: "",
1416
1442
  color: h.value ? "system-error-300" : void 0
1417
1443
  }, null, 8, ["name", "color"])),
1418
- d("div", {
1419
- class: te([
1444
+ m("div", {
1445
+ class: ee([
1420
1446
  "fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center",
1421
1447
  {
1422
1448
  "text-fm-color-typo-disabled": n.value,
@@ -1424,70 +1450,70 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1424
1450
  }
1425
1451
  ])
1426
1452
  }, [
1427
- d("div", In, D(o.value.name), 1)
1453
+ m("div", Rn, A(o.value.name), 1)
1428
1454
  ], 2),
1429
- n.value ? Y("", !0) : (f(), T("div", Mn, [
1430
- p(N, {
1431
- label: m(g)("inventory.ingredient.import.replaceFile"),
1455
+ n.value ? j("", !0) : (f(), T("div", Tn, [
1456
+ c(N, {
1457
+ label: d(g)("inventory.ingredient.import.replaceFile"),
1432
1458
  variant: h.value ? "destructive" : "secondary",
1433
1459
  "prepend-icon": h.value ? void 0 : "autorenew",
1434
1460
  onClick: w
1435
1461
  }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
1436
1462
  ]))
1437
1463
  ], 2),
1438
- l.value.length ? (f(), T("div", $n, [
1439
- (f(!0), T(Q, null, ue(l.value, (v, R) => (f(), T("div", {
1464
+ l.value.length ? (f(), T("div", An, [
1465
+ (f(!0), T(X, null, re(l.value, (v, R) => (f(), T("div", {
1440
1466
  key: R,
1441
1467
  class: "flex gap-8 items-center"
1442
1468
  }, [
1443
- p(I, {
1469
+ c(I, {
1444
1470
  name: "error",
1445
1471
  size: "sm",
1446
1472
  color: "system-error-300"
1447
1473
  }),
1448
- d("div", En, D(v), 1)
1474
+ m("div", Dn, A(v), 1)
1449
1475
  ]))), 128))
1450
- ])) : Y("", !0)
1476
+ ])) : j("", !0)
1451
1477
  ])
1452
1478
  ]),
1453
1479
  key: "0"
1454
1480
  } : void 0
1455
1481
  ]), 1032, ["class", "label", "button-label"]),
1456
- k.value ? (f(), T("div", Un, [
1457
- d("div", Rn, D(m(g)("inventory.ingredient.import.summary")), 1),
1458
- (f(!0), T(Q, null, ue(i.value, (w) => (f(), B(ze, {
1482
+ k.value ? (f(), T("div", Pn, [
1483
+ m("div", Bn, A(d(g)("inventory.ingredient.import.summary")), 1),
1484
+ (f(!0), T(X, null, re(i.value, (w) => (f(), B(qe, {
1459
1485
  key: w.sku._id,
1460
1486
  code: w.sku.code,
1461
1487
  name: w.sku.name,
1462
1488
  errors: w.errors,
1463
1489
  type: "create"
1464
1490
  }, null, 8, ["code", "name", "errors"]))), 128)),
1465
- (f(!0), T(Q, null, ue(a.value, (w) => (f(), B(ze, {
1491
+ (f(!0), T(X, null, re(a.value, (w) => (f(), B(qe, {
1466
1492
  key: w.sku._id,
1467
1493
  code: w.sku.code,
1468
1494
  name: w.sku.name,
1469
1495
  errors: w.errors,
1470
1496
  type: "update"
1471
1497
  }, null, 8, ["code", "name", "errors"]))), 128))
1472
- ])) : Y("", !0)
1498
+ ])) : j("", !0)
1473
1499
  ]);
1474
1500
  };
1475
1501
  }
1476
- }), Tn = { class: "flex flex-col py-8" }, Dn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Zn = /* @__PURE__ */ oe({
1502
+ }), zn = { class: "flex flex-col py-8" }, Ln = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Hn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, oo = /* @__PURE__ */ te({
1477
1503
  __name: "IngredientsView",
1478
1504
  setup(u) {
1479
- const o = le(), y = S(() => o.skus), s = ft(), n = Ze(), l = he(), i = Me(), { t: a } = ae(), { createIngredient: h, updateIngredient: k } = Fe(), { ingredientDialogProps: g, ingredientViewLoading: b } = Ct(Fe()), { columnDefs: r } = Mt();
1480
- function _(P) {
1481
- switch (P) {
1505
+ const o = ne(), y = S(() => o.skus), r = _t(), n = Xe(), l = ke(), i = Ie(), { t: a } = oe(), { createIngredient: h, updateIngredient: k } = Fe(), { ingredientDialogProps: g, ingredientViewLoading: b } = $t(Fe()), { columnDefs: s } = Tt();
1506
+ function x(D) {
1507
+ switch (D) {
1482
1508
  case "add":
1483
1509
  return i.isEnabled ? void 0 : h();
1484
1510
  case "import":
1485
- return de();
1511
+ return se();
1486
1512
  case "export":
1487
- return ne();
1513
+ return Q();
1488
1514
  }
1489
1515
  }
1490
- const U = j(""), I = j(!1), N = S(() => I.value || b.value), { breakpoints: w } = xt(), v = S(() => w.value.xs || w.value.sm), R = S(() => v.value ? 10 : 20), J = yt(), Z = j(!1), L = [
1516
+ const U = q(""), I = q(!1), N = S(() => I.value || b.value), { breakpoints: w } = wt(), v = S(() => w.value.xs || w.value.sm), R = S(() => v.value ? 10 : 20), J = xt(), Z = q(!1), L = [
1491
1517
  {
1492
1518
  value: "import",
1493
1519
  label: a("common.import")
@@ -1497,15 +1523,15 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1497
1523
  label: a("common.export")
1498
1524
  }
1499
1525
  ];
1500
- function z(P) {
1501
- switch (Z.value = !1, P) {
1526
+ function Y(D) {
1527
+ switch (Z.value = !1, D) {
1502
1528
  case "import":
1503
- return de();
1529
+ return se();
1504
1530
  case "export":
1505
- return ne();
1531
+ return Q();
1506
1532
  }
1507
1533
  }
1508
- const q = S(() => [
1534
+ const H = S(() => [
1509
1535
  ...i.isEnabled ? [] : [
1510
1536
  {
1511
1537
  label: a("inventory.ingredient.create.title"),
@@ -1517,18 +1543,18 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1517
1543
  ],
1518
1544
  { label: a("common.export"), value: "export" }
1519
1545
  ]);
1520
- function ne() {
1521
- const P = yn();
1546
+ function Q() {
1547
+ const D = xn();
1522
1548
  l.open({
1523
1549
  title: a("inventory.ingredient.export.success"),
1524
- message: a("inventory.ingredient.export.filename", [P]),
1550
+ message: a("inventory.ingredient.export.filename", [D]),
1525
1551
  type: "success"
1526
1552
  });
1527
1553
  }
1528
- function de() {
1554
+ function se() {
1529
1555
  n.open({
1530
1556
  title: a("inventory.ingredient.import.title"),
1531
- contentComponent: An,
1557
+ contentComponent: Nn,
1532
1558
  overlay: !0,
1533
1559
  closeButton: !0,
1534
1560
  primaryActions: {
@@ -1544,15 +1570,15 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1544
1570
  close: !1,
1545
1571
  variant: "plain"
1546
1572
  }
1547
- }).onPrimary((P) => {
1548
- if (!P) {
1573
+ }).onPrimary((D) => {
1574
+ if (!D) {
1549
1575
  l.open({
1550
1576
  title: a("inventory.ingredient.import.error.noData"),
1551
1577
  type: "error"
1552
1578
  });
1553
1579
  return;
1554
1580
  }
1555
- if (!P.importCreateResult.length && !P.importUpdateResult.length) {
1581
+ if (!D.importCreateResult.length && !D.importUpdateResult.length) {
1556
1582
  l.open({
1557
1583
  title: a("inventory.ingredient.import.error.invalidContent"),
1558
1584
  message: a("inventory.ingredient.import.error.noImportData"),
@@ -1560,7 +1586,7 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1560
1586
  });
1561
1587
  return;
1562
1588
  }
1563
- if (P.importCreateResult.some(($) => $.errors.length) || P.importUpdateResult.some(($) => $.errors.length)) {
1589
+ if (D.importCreateResult.some(($) => $.errors.length) || D.importUpdateResult.some(($) => $.errors.length)) {
1564
1590
  l.open({
1565
1591
  title: a("inventory.ingredient.import.error.invalidContent"),
1566
1592
  message: a("inventory.ingredient.import.error.hasErrors"),
@@ -1568,29 +1594,29 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1568
1594
  });
1569
1595
  return;
1570
1596
  }
1571
- n.close(), _e(P);
1572
- }).onTertiary(gn);
1597
+ n.close(), ye(D);
1598
+ }).onTertiary(kn);
1573
1599
  }
1574
- async function _e(P) {
1600
+ async function ye(D) {
1575
1601
  I.value = !0;
1576
1602
  try {
1577
1603
  const $ = [
1578
- ...P.importCreateResult.map(({ sku: A }) => ({ type: "create", sku: A })),
1579
- ...P.importUpdateResult.map(({ sku: A }) => ({ type: "update", sku: A }))
1580
- ], re = 100;
1581
- let se = 0;
1582
- const X = () => {
1583
- se += re, l.open({
1604
+ ...D.importCreateResult.map(({ sku: P }) => ({ type: "create", sku: P })),
1605
+ ...D.importUpdateResult.map(({ sku: P }) => ({ type: "update", sku: P }))
1606
+ ], ie = 100;
1607
+ let le = 0;
1608
+ const de = () => {
1609
+ le += ie, l.open({
1584
1610
  title: a("inventory.ingredient.import.progress", [
1585
- Math.min(se, $.length),
1611
+ Math.min(le, $.length),
1586
1612
  $.length
1587
1613
  ])
1588
1614
  });
1589
1615
  };
1590
- for (const A of $.chunk(100))
1591
- X(), await o.importSkus({
1592
- create: A.filter((O) => O.type === "create").map((O) => O.sku),
1593
- update: A.filter((O) => O.type === "update").map((O) => O.sku)
1616
+ for (const P of $.chunk(100))
1617
+ de(), await o.importSkus({
1618
+ create: P.filter((z) => z.type === "create").map((z) => z.sku),
1619
+ update: P.filter((z) => z.type === "update").map((z) => z.sku)
1594
1620
  });
1595
1621
  l.open({
1596
1622
  title: a("inventory.ingredient.import.success"),
@@ -1601,21 +1627,21 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1601
1627
  title: a("inventory.ingredient.import.error.failed"),
1602
1628
  message: a("inventory.ingredient.import.error.systemMessage", [$ == null ? void 0 : $.message]),
1603
1629
  type: "error"
1604
- }), console.error("Error in importing skus", P, $);
1630
+ }), console.error("Error in importing skus", D, $);
1605
1631
  } finally {
1606
1632
  I.value = !1;
1607
1633
  }
1608
1634
  }
1609
- return (P, $) => {
1610
- const re = C("FmTable"), se = C("FmCollapsibleTabs"), X = C("FmBottomSheet");
1611
- return f(), B(gt, {
1612
- title: m(a)("inventory.ingredient.title"),
1613
- actions: q.value,
1614
- "onClick:action": _
1635
+ return (D, $) => {
1636
+ const ie = C("FmTable"), le = C("FmCollapsibleTabs"), de = C("FmBottomSheet");
1637
+ return f(), B(kt, {
1638
+ title: d(a)("inventory.ingredient.title"),
1639
+ actions: H.value,
1640
+ "onClick:action": x
1615
1641
  }, {
1616
1642
  default: V(() => [
1617
- d("div", {
1618
- class: te([
1643
+ m("div", {
1644
+ class: ee([
1619
1645
  "flex flex-col gap-8 max-h-full",
1620
1646
  {
1621
1647
  "p-0": v.value,
@@ -1623,40 +1649,40 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1623
1649
  }
1624
1650
  ])
1625
1651
  }, [
1626
- p(bt, {
1652
+ c(Vt, {
1627
1653
  searchable: "",
1628
1654
  search: U.value,
1629
- "onUpdate:search": $[0] || ($[0] = (A) => U.value = A)
1655
+ "onUpdate:search": $[0] || ($[0] = (P) => U.value = P)
1630
1656
  }, null, 8, ["search"]),
1631
- p(re, {
1632
- style: tt(m(J).tableHeight),
1633
- "column-defs": m(r),
1657
+ c(ie, {
1658
+ style: rt(d(J).tableHeight),
1659
+ "column-defs": d(s),
1634
1660
  "row-data": y.value,
1635
1661
  "search-value": U.value,
1636
- loading: !m(s)._currentLocation || N.value,
1662
+ loading: !d(r)._currentLocation || N.value,
1637
1663
  "loading-text": "Loading",
1638
- onRowClick: $[1] || ($[1] = (A) => m(k)(A.original)),
1664
+ onRowClick: $[1] || ($[1] = (P) => d(k)(P.original)),
1639
1665
  "page-size": R.value
1640
1666
  }, {
1641
- "list-row": V((A) => [
1642
- p(ht, {
1643
- row: A,
1644
- onRowClick: m(k)
1645
- }, Ye({
1646
- default: V((O) => {
1647
- var me, t, e, c, x, E, F, G, H, ee;
1667
+ "list-row": V((P) => [
1668
+ c(St, {
1669
+ row: P,
1670
+ onRowClick: d(k)
1671
+ }, Ge({
1672
+ default: V((z) => {
1673
+ var ge, ue, t, e, p, _, E, F, O, G;
1648
1674
  return [
1649
- d("div", Tn, [
1650
- d("div", Dn, [
1651
- p(m(Be), {
1652
- render: (e = (t = (me = O.code) == null ? void 0 : me.column) == null ? void 0 : t.columnDef) == null ? void 0 : e.cell,
1653
- props: (x = (c = O.code) == null ? void 0 : c.getContext) == null ? void 0 : x.call(c)
1675
+ m("div", zn, [
1676
+ m("div", Ln, [
1677
+ c(d(He), {
1678
+ render: (t = (ue = (ge = z.code) == null ? void 0 : ge.column) == null ? void 0 : ue.columnDef) == null ? void 0 : t.cell,
1679
+ props: (p = (e = z.code) == null ? void 0 : e.getContext) == null ? void 0 : p.call(e)
1654
1680
  }, null, 8, ["render", "props"])
1655
1681
  ]),
1656
- d("div", Pn, [
1657
- p(m(Be), {
1658
- render: (G = (F = (E = O.name) == null ? void 0 : E.column) == null ? void 0 : F.columnDef) == null ? void 0 : G.cell,
1659
- props: (ee = (H = O.name) == null ? void 0 : H.getContext) == null ? void 0 : ee.call(H)
1682
+ m("div", Hn, [
1683
+ c(d(He), {
1684
+ render: (F = (E = (_ = z.name) == null ? void 0 : _.column) == null ? void 0 : E.columnDef) == null ? void 0 : F.cell,
1685
+ props: (G = (O = z.name) == null ? void 0 : O.getContext) == null ? void 0 : G.call(O)
1660
1686
  }, null, 8, ["render", "props"])
1661
1687
  ])
1662
1688
  ])
@@ -1667,7 +1693,7 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1667
1693
  I.value ? {
1668
1694
  name: "loading-text",
1669
1695
  fn: V(() => [
1670
- d("div", null, D(m(a)("inventory.ingredient.table.importing")), 1)
1696
+ m("div", null, A(d(a)("inventory.ingredient.table.importing")), 1)
1671
1697
  ]),
1672
1698
  key: "0"
1673
1699
  } : void 0
@@ -1676,20 +1702,20 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1676
1702
  _: 1
1677
1703
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
1678
1704
  ], 2),
1679
- (f(), B(Ae, { to: "body" }, [
1680
- p(dn, nt(ot(m(g))), null, 16)
1705
+ (f(), B(Pe, { to: "body" }, [
1706
+ c(fn, st(it(d(g))), null, 16)
1681
1707
  ])),
1682
- (f(), B(Ae, { to: "body" }, [
1683
- p(X, {
1708
+ (f(), B(Pe, { to: "body" }, [
1709
+ c(de, {
1684
1710
  "dismiss-away": "",
1685
1711
  modelValue: Z.value,
1686
- "onUpdate:modelValue": $[3] || ($[3] = (A) => Z.value = A)
1712
+ "onUpdate:modelValue": $[3] || ($[3] = (P) => Z.value = P)
1687
1713
  }, {
1688
1714
  default: V(() => [
1689
- p(se, {
1715
+ c(le, {
1690
1716
  class: "pb-8",
1691
1717
  items: L,
1692
- "onUpdate:modelValue": $[2] || ($[2] = (A) => z(A))
1718
+ "onUpdate:modelValue": $[2] || ($[2] = (P) => Y(P))
1693
1719
  })
1694
1720
  ]),
1695
1721
  _: 1
@@ -1702,5 +1728,5 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1702
1728
  }
1703
1729
  });
1704
1730
  export {
1705
- Zn as default
1731
+ oo as default
1706
1732
  };