@feedmepos/mf-inventory-portal 0.0.25-dev.7 → 0.0.25-dev.8

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 (48) hide show
  1. package/dist/{App-qJehfAde.js → App-CKLQeRNl.js} +1 -1
  2. package/dist/{ApprovalView-BuqKIEPL.js → ApprovalView-BWO2tkbO.js} +6 -6
  3. package/dist/{BindingsDialog-BrF-YAJ2.js → BindingsDialog-C0kTZLOn.js} +9 -9
  4. package/dist/{BindingsPicker-DK41dcoG.js → BindingsPicker-DjcS3uTL.js} +10 -10
  5. package/dist/{BindingsTable-DxlRhKzN.js → BindingsTable-Ctpv958D.js} +10 -10
  6. package/dist/{ClosingDraftView-CpGQMN37.js → ClosingDraftView-CsAPSZPc.js} +2 -2
  7. package/dist/{ClosingTemplateView-4l891KsC.js → ClosingTemplateView-D0HWVhk3.js} +477 -492
  8. package/dist/{FmCustomAttribute.vue_vue_type_script_setup_true_lang-CyHyOhG6.js → FmCustomAttribute.vue_vue_type_script_setup_true_lang-BF0lKP9Y.js} +1 -1
  9. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DJfBmiRt.js +211 -0
  10. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-3LU_3Y8h.js → FmUnitInput.vue_vue_type_script_setup_true_lang-qZ7Kx-KR.js} +1 -1
  11. package/dist/{IngredientGroupView-Bjv9Kih7.js → IngredientGroupView-Dc3glXN3.js} +1 -1
  12. package/dist/{IngredientsView-ChJbe-U_.js → IngredientsView-btzrUQ1-.js} +392 -382
  13. package/dist/{IntegrationView-Cmh47qP7.js → IntegrationView-DO1SF1Ca.js} +660 -623
  14. package/dist/{InventoryBindingForm-GmcCTBqN.js → InventoryBindingForm-_2p-YetL.js} +1 -1
  15. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CQrjMOFh.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-B7ump1tl.js} +5 -5
  16. package/dist/{InventoryBindingSummary-w1pFGR3C.js → InventoryBindingSummary-CEdLu3d9.js} +1 -1
  17. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Cxr2xhRR.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-kLdZ5acK.js} +1 -1
  18. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CzxVUAC8.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Da0gmGST.js} +1 -1
  19. package/dist/{PublishView-pWAEdGLi.js → PublishView-CXTiPWIx.js} +2 -2
  20. package/dist/{PurchaseOrderPrintPreview-CZczBXL2.js → PurchaseOrderPrintPreview-DBviMTyA.js} +1 -1
  21. package/dist/{ReceiveRequestView-tWyQCrIN.js → ReceiveRequestView-Ct1AQDGK.js} +8 -8
  22. package/dist/{RecipeView-Dy1BBW3o.js → RecipeView-C0HiPNvf.js} +3 -3
  23. package/dist/{StockView-B0c0FiPr.js → StockView-BG8jsV_X.js} +7 -7
  24. package/dist/{SupplierView-BUs8xZPq.js → SupplierView-th75_ohq.js} +3 -3
  25. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BA0HIuSW.js → TransferDetails.vue_vue_type_script_setup_true_lang-n7fH8GRs.js} +19 -19
  26. package/dist/{TransferTemplateView-MSbvSo96.js → TransferTemplateView-Dcz6xGR_.js} +443 -460
  27. package/dist/{UnitView-GBK0ovxt.js → UnitView-lnoMsoBN.js} +3 -3
  28. package/dist/{WarehouseView-CXoj99HO.js → WarehouseView-ChXcNnmp.js} +1 -1
  29. package/dist/{app-Du-JrqLm.js → app-B4RHEuan.js} +6283 -6208
  30. package/dist/app.js +1 -1
  31. package/dist/components/FmLockableField.vue.d.ts +3 -0
  32. package/dist/components/FmMultiselectDialog.vue.d.ts +9 -1
  33. package/dist/components/FmMultiselectDialogProps.d.ts +2 -0
  34. package/dist/{decimal-BXePRNLM.js → decimal-BocxWSo6.js} +1 -1
  35. package/dist/{format-unit-display-BdC0fMRb.js → format-unit-display-E_NtfEtV.js} +2 -2
  36. package/dist/helper/fuzzy.d.ts +10 -0
  37. package/dist/{index-irnhqIWw.js → index-B-MhJgPv.js} +3 -3
  38. package/dist/{index-cY9fiIBU.js → index-ro6xANOo.js} +1 -1
  39. package/dist/{stock-CE5Qq59r.js → stock-DpmweZQd.js} +1 -1
  40. package/dist/style.css +1 -1
  41. package/dist/{supplier-Cy-jlD0j.js → supplier--P-eubcS.js} +1 -1
  42. package/dist/tsconfig.app.tsbuildinfo +1 -1
  43. package/dist/use-ingredient-select-dialog-C7WZf5D4.js +52 -0
  44. package/dist/{use-inventory-binding-dialog-nHDQBRL3.js → use-inventory-binding-dialog-DW_kAtLh.js} +1 -1
  45. package/dist/views/ingredients/composables/use-ingredient-select-dialog.d.ts +16 -0
  46. package/dist/{vue-i18n-DIA7c33f.js → vue-i18n-SeWrkOlu.js} +134 -134
  47. package/package.json +3 -3
  48. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DRqpc9k0.js +0 -286
@@ -1,16 +1,16 @@
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-Du-JrqLm.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-CQrjMOFh.js";
9
- import { _ as Ce, a as It } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-CyHyOhG6.js";
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 A, Fragment as Q, createElementVNode as u, createCommentVNode as Y, renderSlot as ce, createTextVNode as Ie, toDisplayString as D, normalizeClass as X, onMounted as ot, watch as Oe, renderList as de, isRef as De, createSlots as qe, normalizeStyle as lt, Teleport as Pe, normalizeProps as at, guardReactiveProps as rt } from "vue";
2
+ import { a as le, e as K, f as Ge, S as st, h as it, D as Be, i as fe, A as ge, b as Me, j as We, k as be, t as Ke, l as pe, m as xe, U as dt, n as ut, M as mt, o as Ne, c as Ze, C as ke, p as Le, q as Je, r as ct, s as Qe, v as pt, w as vt, I as ft, x as yt, y as gt, u as bt, z as ht, _ as _t, B as xt, E as kt, G as ze } from "./app-B4RHEuan.js";
3
+ import { useDialog as Xe, useSnackbar as he, useProxiedModel as He, useDialogChild as Vt, useBreakpoints as St } from "@feedmepos/ui-library";
4
+ import { i as Ct, _ as wt } from "./is-linked-ingredient-error-fJ2TJb3z.js";
5
+ import { useI18n as ae, useCoreStore as ve } from "@feedmepos/mf-common";
6
+ import { defineStore as Ft, storeToRefs as It } from "pinia";
7
+ import { g as Mt, _ as Ve, S as Se } from "./StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js";
8
+ import { _ as $t } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-B7ump1tl.js";
9
+ import { _ as Ce, a as Et } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-BF0lKP9Y.js";
10
10
  import { _ as we } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
11
11
  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();
12
+ const Fe = Ft("ingredientForm", function() {
13
+ const o = Xe(), y = he(), s = le(), n = j(!1), { t: l } = ae(), i = j();
14
14
  function a() {
15
15
  const b = {
16
16
  unit: {},
@@ -24,7 +24,7 @@ const Fe = St("ingredientForm", function() {
24
24
  }
25
25
  async function h(b) {
26
26
  const r = {
27
- unit: je(b),
27
+ unit: Ge(b),
28
28
  mode: K.UPDATE,
29
29
  show: !0,
30
30
  "onUpdate:show"(_) {
@@ -42,9 +42,9 @@ const Fe = St("ingredientForm", function() {
42
42
  type: "success"
43
43
  });
44
44
  } catch (r) {
45
- r instanceof lt && kt(r) ? o.open({
45
+ r instanceof st && Ct(r) ? o.open({
46
46
  title: "Cannot delete ingredient",
47
- contentComponent: Vt,
47
+ contentComponent: wt,
48
48
  contentComponentProps: {
49
49
  subject: (b == null ? void 0 : b.name) ?? "",
50
50
  items: r.errorResponse.message
@@ -86,12 +86,12 @@ const Fe = St("ingredientForm", function() {
86
86
  ingredientViewLoading: n
87
87
  };
88
88
  });
89
- function Mt() {
90
- const { updateIngredient: u, deleteIngredient: o } = Fe(), { t: y } = ae();
89
+ function Ut() {
90
+ const { updateIngredient: d, deleteIngredient: o } = Fe(), { t: y } = ae();
91
91
  async function s(l, i) {
92
- const a = je(i);
92
+ const a = Ge(i);
93
93
  if (l === fe.Edit) {
94
- await u(a);
94
+ await d(a);
95
95
  return;
96
96
  }
97
97
  if (l === fe.Delete) {
@@ -134,8 +134,8 @@ function Mt() {
134
134
  id: "action",
135
135
  header: "",
136
136
  cell(l) {
137
- return at(
138
- [Te[fe.Edit], Te[fe.Delete]],
137
+ return it(
138
+ [Be[fe.Edit], Be[fe.Delete]],
139
139
  (i) => {
140
140
  s(i, l.row.original);
141
141
  }
@@ -150,7 +150,7 @@ function Mt() {
150
150
  }
151
151
  ] };
152
152
  }
153
- const $t = /* @__PURE__ */ oe({
153
+ const Rt = /* @__PURE__ */ oe({
154
154
  __name: "ConvertForm",
155
155
  props: {
156
156
  modelValue: {},
@@ -159,8 +159,8 @@ const $t = /* @__PURE__ */ oe({
159
159
  readonly: { type: Boolean }
160
160
  },
161
161
  emits: ["update:modelValue"],
162
- setup(u, { emit: o }) {
163
- const y = u, s = S(() => {
162
+ setup(d, { emit: o }) {
163
+ const y = d, s = S(() => {
164
164
  var r;
165
165
  return (r = y.rootValue) == null ? void 0 : r.unit;
166
166
  }), n = S(() => {
@@ -176,7 +176,7 @@ const $t = /* @__PURE__ */ oe({
176
176
  inventoryBindings: []
177
177
  }) : l("update:modelValue", null);
178
178
  }
179
- }), h = S(() => wt(s.value));
179
+ }), h = S(() => Mt(s.value));
180
180
  function k(r) {
181
181
  const _ = y.modelValue ?? {};
182
182
  _.measurement = r ? `${r}` : null, l("update:modelValue", _);
@@ -208,8 +208,8 @@ const $t = /* @__PURE__ */ oe({
208
208
  labelPlacement: "right",
209
209
  disabled: r.readonly
210
210
  }, null, 8, ["model-value", "label", "sublabel", "disabled"]),
211
- a.value ? (f(), T(Q, { key: 0 }, [
212
- d("div", null, [
211
+ a.value ? (f(), A(Q, { key: 0 }, [
212
+ u("div", null, [
213
213
  p(I, {
214
214
  label: m(i)("inventory.ingredient.convertible.convertTo"),
215
215
  modelValue: (w = b.value) == null ? void 0 : w.value,
@@ -218,7 +218,7 @@ const $t = /* @__PURE__ */ oe({
218
218
  disabled: r.readonly
219
219
  }, null, 8, ["label", "modelValue", "items", "disabled"])
220
220
  ]),
221
- p(Ft, {
221
+ p($t, {
222
222
  id: n.value,
223
223
  "model-value": ((v = r.modelValue) == null ? void 0 : v.inventoryBindings) ?? [],
224
224
  "onUpdate:modelValue": g,
@@ -240,7 +240,7 @@ function ie() {
240
240
  mid: 14
241
241
  };
242
242
  }
243
- const Et = {
243
+ const Tt = {
244
244
  key: 0,
245
245
  class: "flex flex-col gap-4"
246
246
  }, ye = /* @__PURE__ */ oe({
@@ -249,22 +249,23 @@ const Et = {
249
249
  locked: { type: Boolean },
250
250
  disabled: { type: Boolean },
251
251
  label: {},
252
+ helperText: {},
252
253
  modelValue: {},
253
254
  tooltipMessage: {},
254
255
  tooltipPlacement: {},
255
256
  tooltipZIndex: {}
256
257
  },
257
- setup(u) {
258
+ setup(d) {
258
259
  return (o, y) => {
259
260
  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", {}, () => [
261
+ return o.locked ? (f(), A("div", Tt, [
262
+ ce(o.$slots, "label", {}, () => [
262
263
  p(s, {
263
264
  label: o.label,
264
265
  disabled: o.disabled
265
266
  }, null, 8, ["label", "disabled"])
266
267
  ]),
267
- ve(o.$slots, "field", {}, () => [
268
+ ce(o.$slots, "field", {}, () => [
268
269
  p(i, { disabled: o.disabled }, {
269
270
  prepend: V(() => [
270
271
  o.tooltipMessage ? (f(), B(l, {
@@ -289,9 +290,9 @@ const Et = {
289
290
  }))
290
291
  ]),
291
292
  default: V(() => [
292
- ve(o.$slots, "modelValue", {}, () => [
293
- d("div", {
294
- class: te([
293
+ ce(o.$slots, "modelValue", {}, () => [
294
+ u("div", {
295
+ class: X([
295
296
  o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary",
296
297
  "line-clamp-1 text-ellipsis break-all"
297
298
  ])
@@ -300,14 +301,22 @@ const Et = {
300
301
  ]),
301
302
  _: 3
302
303
  }, 8, ["disabled"])
304
+ ]),
305
+ ce(o.$slots, "helper-text", {}, () => [
306
+ u("div", {
307
+ class: X([
308
+ "fm-typo-en-body-sm-400 line-clamp-1",
309
+ o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
310
+ ])
311
+ }, D(o.helperText), 3)
303
312
  ])
304
- ])) : ve(o.$slots, "default", { key: 1 });
313
+ ])) : ce(o.$slots, "default", { key: 1 });
305
314
  };
306
315
  }
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 = {
316
+ }), At = { class: "flex gap-8" }, Dt = { class: "flex-1" }, Pt = { class: "flex-1" }, Bt = { class: "text-fm-color-typo-secondary" }, Nt = { class: "text-fm-color-typo-secondary whitespace-nowrap" }, Lt = {
308
317
  key: 2,
309
318
  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({
319
+ }, zt = { class: "flex flex-col gap-12" }, Ht = { class: "flex flex-col gap-4" }, Yt = { class: "fm-typo-en-title-sm-600" }, jt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ot = { class: "flex flex-col gap-4" }, qt = { class: "flex fm-corner-radius-md border-1 border-fm-color-neutral-gray-200" }, Gt = { class: "flex-1 p-12 flex flex-col gap-8" }, Wt = { class: "mx-auto" }, Kt = { class: "flex flex-col" }, Zt = { class: "fm-typo-en-body-sm-600 translate-y-4" }, Jt = { class: "flex-1 p-12 flex flex-col gap-8" }, Qt = { class: "mx-auto" }, Xt = { class: "flex flex-col" }, en = { class: "fm-typo-en-body-sm-600 translate-y-4" }, tn = { class: "flex-1 p-12 flex flex-col gap-8" }, nn = { class: "mx-auto" }, on = { class: "flex flex-col" }, ln = { class: "fm-typo-en-body-sm-600 translate-y-4" }, an = /* @__PURE__ */ oe({
311
320
  __name: "IngredientForm",
312
321
  props: {
313
322
  mode: {},
@@ -315,58 +324,58 @@ const Et = {
315
324
  disabled: { type: Boolean }
316
325
  },
317
326
  emits: ["update:modelValue", "click:submit"],
318
- setup(u, { expose: o, emit: y }) {
327
+ setup(d, { expose: o, emit: y }) {
319
328
  var me;
320
- const { t: s } = ae(), n = u, l = y, i = le(), a = pe(), h = Ge(), k = Me(), g = S(() => k.isEnabled);
321
- function b(t) {
322
- if (t.length === 0) return;
323
- const e = t[0], c = n.modelValue ?? {
329
+ const { t: s } = ae(), n = d, l = y, i = le(), a = ve(), h = Ze(), k = Me(), g = S(() => k.isEnabled);
330
+ function b(e) {
331
+ if (e.length === 0) return;
332
+ const t = e[0], c = n.modelValue ?? {
324
333
  unit: i.units.find((x) => x)
325
334
  };
326
- c.unit || (c.unit = e, l("update:modelValue", c));
335
+ c.unit || (c.unit = t, l("update:modelValue", c));
327
336
  }
328
- et(() => {
337
+ ot(() => {
329
338
  b(i.units);
330
- }), He([() => i.units], ([t]) => {
331
- b(t);
339
+ }), Oe([() => i.units], ([e]) => {
340
+ b(e);
332
341
  });
333
342
  function r() {
334
343
  l("click:submit");
335
344
  }
336
345
  const _ = S({
337
346
  get() {
338
- var t;
339
- return ((t = n.modelValue) == null ? void 0 : t.code) ?? "";
347
+ var e;
348
+ return ((e = n.modelValue) == null ? void 0 : e.code) ?? "";
340
349
  },
341
- set(t) {
342
- const e = n.modelValue ? {
350
+ set(e) {
351
+ const t = n.modelValue ? {
343
352
  ...n.modelValue
344
353
  } : {};
345
- e.code = t, l("update:modelValue", e);
354
+ t.code = e, l("update:modelValue", t);
346
355
  }
347
356
  }), U = S({
348
357
  get() {
349
- var t;
350
- return ((t = n.modelValue) == null ? void 0 : t.name) ?? "";
358
+ var e;
359
+ return ((e = n.modelValue) == null ? void 0 : e.name) ?? "";
351
360
  },
352
- set(t) {
353
- const e = n.modelValue ? {
361
+ set(e) {
362
+ const t = n.modelValue ? {
354
363
  ...n.modelValue
355
364
  } : {};
356
- e.name = t, l("update:modelValue", e);
365
+ t.name = e, l("update:modelValue", t);
357
366
  }
358
367
  }), I = S({
359
368
  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;
369
+ var t, c;
370
+ const e = (c = (t = n.modelValue) == null ? void 0 : t.defaultCost) == null ? void 0 : c.costPerUnit;
371
+ return e ? +We(e) : 0;
363
372
  },
364
- set(t) {
373
+ set(e) {
365
374
  var c, x, E, F;
366
- const e = n.modelValue ? {
375
+ const t = n.modelValue ? {
367
376
  ...n.modelValue
368
377
  } : {};
369
- e.defaultCost ?? (e.defaultCost = {
378
+ t.defaultCost ?? (t.defaultCost = {
370
379
  costPerUnit: {
371
380
  amount: 0,
372
381
  precision: 2,
@@ -378,54 +387,54 @@ const Et = {
378
387
  return G.id === ((H = n.modelValue) == null ? void 0 : H.trackingMeasurement);
379
388
  }
380
389
  )
381
- }), e.defaultCost.costPerUnit = {
382
- ...e.defaultCost.costPerUnit,
383
- ...qe(+t, 4)
384
- }, l("update:modelValue", e);
390
+ }), t.defaultCost.costPerUnit = {
391
+ ...t.defaultCost.costPerUnit,
392
+ ...Ke(+e, 4)
393
+ }, l("update:modelValue", t);
385
394
  }
386
395
  }), N = S(() => {
387
- var e, c, x;
388
- const t = ((e = n.modelValue) == null ? void 0 : e.unit) ?? i.units.find((E) => E);
389
- return t ? {
390
- _id: t._id,
396
+ var t, c, x;
397
+ const e = ((t = n.modelValue) == null ? void 0 : t.unit) ?? i.units.find((E) => E);
398
+ return e ? {
399
+ _id: e._id,
391
400
  measurement: (c = n.modelValue) == null ? void 0 : c.trackingMeasurement,
392
- name: ((x = t.measurements.find((E) => {
401
+ name: ((x = e.measurements.find((E) => {
393
402
  var F;
394
403
  return E.id === ((F = n.modelValue) == null ? void 0 : F.trackingMeasurement);
395
- })) == null ? void 0 : x.name) ?? t.name
404
+ })) == null ? void 0 : x.name) ?? e.name
396
405
  } : null;
397
406
  }), w = S(
398
- () => i.units.flatMap(({ name: t, _id: e, abbrev: c, measurements: x }) => [
407
+ () => i.units.flatMap(({ name: e, _id: t, abbrev: c, measurements: x }) => [
399
408
  {
400
- label: `${t}`,
409
+ label: `${e}`,
401
410
  value: null,
402
411
  displayAsSection: !0
403
412
  },
404
413
  {
405
- label: `${t} (${c})`,
406
- value: { _id: e },
414
+ label: `${e} (${c})`,
415
+ value: { _id: t },
407
416
  displayAsSection: !1
408
417
  },
409
418
  ...x.map(({ id: E, name: F, abbrev: G }) => ({
410
419
  label: `${F} (${G})`,
411
- value: { _id: e, measurement: E },
420
+ value: { _id: t, measurement: E },
412
421
  displayAsSection: !1
413
422
  }))
414
423
  ])
415
424
  );
416
- 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);
425
+ function v(e) {
426
+ var t, c, x, E, F;
427
+ return ((c = (t = n.modelValue) == null ? void 0 : t.unit) == null ? void 0 : c._id) === ((x = e.value) == null ? void 0 : x._id) && ((E = n.modelValue) == null ? void 0 : E.trackingMeasurement) === ((F = e.value) == null ? void 0 : F.measurement);
419
428
  }
420
- function R(t) {
429
+ function R(e) {
421
430
  var G, H;
422
- if (!t) return;
423
- const { _id: e, measurement: c } = t, x = c || void 0, E = i.units.find((ee) => ee._id === e);
431
+ if (!e) return;
432
+ const { _id: t, measurement: c } = e, x = c || void 0, E = i.units.find((te) => te._id === t);
424
433
  if (!E)
425
434
  return;
426
435
  const F = n.modelValue ?? {};
427
436
  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),
437
+ measurement: E.measurements.find((te) => te.id === x),
429
438
  costPerUnit: {
430
439
  ...((G = F.defaultCost) == null ? void 0 : G.costPerUnit) ?? {
431
440
  amount: 0,
@@ -437,88 +446,88 @@ const Et = {
437
446
  }
438
447
  const J = S({
439
448
  get() {
440
- var t;
441
- return ((t = n.modelValue) == null ? void 0 : t.convert) ?? null;
449
+ var e;
450
+ return ((e = n.modelValue) == null ? void 0 : e.convert) ?? null;
442
451
  },
443
- set(t) {
444
- const e = n.modelValue ? {
452
+ set(e) {
453
+ const t = n.modelValue ? {
445
454
  ...n.modelValue
446
455
  } : {};
447
- t ? e.convert = t : e.convert = null, l("update:modelValue", e);
456
+ e ? t.convert = e : t.convert = null, l("update:modelValue", t);
448
457
  }
449
458
  });
450
- S(() => ce.options.filter(
451
- (t) => t === ce.enum.FIFO || t === ce.enum.WAVG
452
- ).map((t) => ({
453
- label: s(`inventory.ingredient.valuationMethod.${t}`),
454
- value: t
459
+ S(() => pe.options.filter(
460
+ (e) => e === pe.enum.FIFO || e === pe.enum.WAVG
461
+ ).map((e) => ({
462
+ label: s(`inventory.ingredient.valuationMethod.${e}`),
463
+ value: e
455
464
  }))), S({
456
465
  get() {
457
- var t;
458
- return ((t = n.modelValue) == null ? void 0 : t.valuation) ?? "WAVG";
466
+ var e;
467
+ return ((e = n.modelValue) == null ? void 0 : e.valuation) ?? "WAVG";
459
468
  },
460
- set(t) {
461
- const e = n.modelValue ? {
469
+ set(e) {
470
+ const t = n.modelValue ? {
462
471
  ...n.modelValue
463
472
  } : {};
464
- e.valuation = t, l("update:modelValue", e);
473
+ t.valuation = e, l("update:modelValue", t);
465
474
  }
466
475
  });
467
476
  const Z = S({
468
477
  get() {
469
- var t;
470
- return ((t = n.modelValue) == null ? void 0 : t.customAttributes) ?? {};
478
+ var e;
479
+ return ((e = n.modelValue) == null ? void 0 : e.customAttributes) ?? {};
471
480
  },
472
- set(t) {
473
- const e = n.modelValue ? {
481
+ set(e) {
482
+ const t = n.modelValue ? {
474
483
  ...n.modelValue
475
484
  } : {};
476
- e.customAttributes = t, l("update:modelValue", e);
485
+ t.customAttributes = e, l("update:modelValue", t);
477
486
  }
478
487
  }), L = j();
479
488
  o({
480
489
  validateInputs: () => {
481
- var t, e;
482
- (e = (t = L.value) == null ? void 0 : t.validateInputs) == null || e.call(t);
490
+ var e, t;
491
+ (t = (e = L.value) == null ? void 0 : e.validateInputs) == null || t.call(e);
483
492
  },
484
493
  resetInputsValidation: () => {
485
- var t, e;
486
- (e = (t = L.value) == null ? void 0 : t.resetInputsValidation) == null || e.call(t);
494
+ var e, t;
495
+ (t = (e = L.value) == null ? void 0 : e.resetInputsValidation) == null || t.call(e);
487
496
  },
488
497
  resetInputs: () => {
489
- var t, e;
490
- (e = (t = L.value) == null ? void 0 : t.resetInputs) == null || e.call(t);
498
+ var e, t;
499
+ (t = (e = L.value) == null ? void 0 : e.resetInputs) == null || t.call(e);
491
500
  }
492
501
  });
493
502
  const z = j(!1), q = 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(
504
+ var e, t, c;
505
+ return (e = n.modelValue) != null && e._id ? ((c = i.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : c.filter(
497
506
  (x) => x.from === "INGREDIENT"
498
507
  )) ?? [] : [];
499
508
  }
500
509
  ), ne = 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(
511
+ var e, t, c;
512
+ return (e = n.modelValue) != null && e._id ? ((c = i.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : c.filter(
504
513
  (x) => x.from === "RECIPE"
505
514
  )) ?? [] : [];
506
515
  }
507
- ), de = S(
516
+ ), ue = 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 e, t, c;
519
+ return (e = n.modelValue) != null && e._id ? ((c = i.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : c.filter((x) => x.from === "MENU")) ?? [] : [];
511
520
  }
512
521
  ), _e = S(
513
- () => i.skus.map((t) => ({ label: t.name, value: t.code }))
522
+ () => i.skus.map((e) => ({ label: e.name, value: e.code }))
514
523
  ), P = j((me = n.modelValue) == null ? void 0 : me.code);
515
- function $(t) {
524
+ function $(e) {
516
525
  var c;
517
- const e = t.el;
518
- e && ((c = e.querySelector("[x-should-scroll-into=true]")) == null || c.scrollIntoView());
526
+ const t = e.el;
527
+ t && ((c = t.querySelector("[x-should-scroll-into=true]")) == null || c.scrollIntoView());
519
528
  }
520
- function re(t) {
521
- switch (t) {
529
+ function re(e) {
530
+ switch (e) {
522
531
  case ke.MY:
523
532
  return "MYR";
524
533
  case ke.SG:
@@ -531,98 +540,98 @@ const Et = {
531
540
  }
532
541
  const se = S(
533
542
  () => {
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(
543
+ var e, t, c, x, E, F;
544
+ return ((x = (c = (t = (e = n.modelValue) == null ? void 0 : e.unit) == null ? void 0 : t.measurements) == null ? void 0 : c.find(
536
545
  (G) => {
537
546
  var H;
538
547
  return G.id === ((H = n.modelValue) == null ? void 0 : H.trackingMeasurement);
539
548
  }
540
549
  )) == null ? void 0 : x.abbrev) ?? ((F = (E = n.modelValue) == null ? void 0 : E.unit) == null ? void 0 : F.abbrev);
541
550
  }
542
- ), X = S({
551
+ ), ee = S({
543
552
  get() {
544
- var t, e;
545
- return ((e = (t = n.modelValue) == null ? void 0 : t.thresholds) == null ? void 0 : e.low) ?? ie().low;
553
+ var e, t;
554
+ return ((t = (e = n.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.low) ?? ie().low;
546
555
  },
547
- set(t) {
556
+ set(e) {
548
557
  var x;
549
- const e = ((x = n.modelValue) == null ? void 0 : x.thresholds) ?? ie();
550
- e.low = t;
558
+ const t = ((x = n.modelValue) == null ? void 0 : x.thresholds) ?? ie();
559
+ t.low = e;
551
560
  const c = n.modelValue ? {
552
561
  ...n.modelValue
553
562
  } : {};
554
- c.thresholds = e, l("update:modelValue", c);
563
+ c.thresholds = t, l("update:modelValue", c);
555
564
  }
556
- }), A = S({
565
+ }), T = S({
557
566
  get() {
558
- var t, e;
559
- return ((e = (t = n.modelValue) == null ? void 0 : t.thresholds) == null ? void 0 : e.mid) ?? ie().mid;
567
+ var e, t;
568
+ return ((t = (e = n.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.mid) ?? ie().mid;
560
569
  },
561
- set(t) {
570
+ set(e) {
562
571
  var x;
563
- const e = ((x = n.modelValue) == null ? void 0 : x.thresholds) ?? ie();
564
- e.mid = t;
572
+ const t = ((x = n.modelValue) == null ? void 0 : x.thresholds) ?? ie();
573
+ t.mid = e;
565
574
  const c = n.modelValue ? {
566
575
  ...n.modelValue
567
576
  } : {};
568
- c.thresholds = e, l("update:modelValue", c);
577
+ c.thresholds = t, l("update:modelValue", c);
569
578
  }
570
579
  });
571
580
  function O() {
572
- return function(e) {
573
- 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;
581
+ return function(t) {
582
+ return typeof (t == null ? void 0 : t.low) != "number" || typeof (t == null ? void 0 : t.mid) != "number" ? "Required" : t.low >= t.mid ? "Days for red indicator should be less than yellow indicator." : !0;
574
583
  };
575
584
  }
576
- 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, {
579
- disabled: t.disabled,
585
+ return (e, t) => {
586
+ const c = C("FmTextField"), x = C("FmLabel"), E = C("FmField"), F = C("FmMenuHeader"), G = C("FmMenuDivider"), H = C("FmMenuItem"), te = C("FmMenu"), $e = C("FmFormGroup"), tt = C("FmSwitch"), Ee = C("FmStepperField"), nt = C("FmForm");
587
+ return f(), B(nt, {
588
+ disabled: e.disabled,
580
589
  ref_key: "formRef",
581
590
  ref: L,
582
591
  class: "flex flex-col gap-32",
583
592
  onValidationSuccess: r
584
593
  }, {
585
594
  default: V(() => {
586
- var Ue;
595
+ var Ue, Re, Te, Ae;
587
596
  return [
588
- d("div", Ut, [
589
- d("div", Rt, [
597
+ u("div", At, [
598
+ u("div", Dt, [
590
599
  p(ye, {
591
600
  "tooltip-message": "This field is managed by NetSuite",
592
601
  "tooltip-z-index": 50,
593
602
  label: m(s)("inventory.ingredient.code"),
594
603
  "model-value": _.value,
595
- "onUpdate:modelValue": e[1] || (e[1] = (M) => _.value = M),
604
+ "onUpdate:modelValue": t[1] || (t[1] = (M) => _.value = M),
596
605
  locked: g.value,
597
- disabled: t.disabled
606
+ disabled: e.disabled
598
607
  }, {
599
608
  default: V(() => [
600
609
  p(c, {
601
610
  label: m(s)("inventory.ingredient.code"),
602
611
  "model-value": _.value,
603
- "onUpdate:modelValue": e[0] || (e[0] = (M) => _.value = M),
604
- rules: [m(xe)(), m(rt)(_e.value, P.value)],
612
+ "onUpdate:modelValue": t[0] || (t[0] = (M) => _.value = M),
613
+ rules: [m(xe)(), m(dt)(_e.value, P.value)],
605
614
  "label-mark": "required"
606
615
  }, null, 8, ["label", "model-value", "rules"])
607
616
  ]),
608
617
  _: 1
609
618
  }, 8, ["label", "model-value", "locked", "disabled"])
610
619
  ]),
611
- d("div", At, [
620
+ u("div", Pt, [
612
621
  p(ye, {
613
622
  "tooltip-message": "This field is managed by NetSuite",
614
623
  "tooltip-z-index": 50,
615
624
  label: m(s)("inventory.ingredient.name"),
616
625
  "model-value": U.value,
617
- "onUpdate:modelValue": e[3] || (e[3] = (M) => U.value = M),
626
+ "onUpdate:modelValue": t[3] || (t[3] = (M) => U.value = M),
618
627
  locked: g.value,
619
- disabled: t.disabled
628
+ disabled: e.disabled
620
629
  }, {
621
630
  default: V(() => [
622
631
  p(c, {
623
632
  label: m(s)("inventory.ingredient.name"),
624
633
  "model-value": U.value,
625
- "onUpdate:modelValue": e[2] || (e[2] = (M) => U.value = M),
634
+ "onUpdate:modelValue": t[2] || (t[2] = (M) => U.value = M),
626
635
  rules: [m(xe)()],
627
636
  "label-mark": "required"
628
637
  }, null, 8, ["label", "model-value", "rules"])
@@ -635,9 +644,10 @@ const Et = {
635
644
  "tooltip-message": "This field is managed by NetSuite",
636
645
  "tooltip-z-index": 50,
637
646
  label: m(s)("inventory.ingredient.unit"),
638
- "model-value": (Ue = N.value) == null ? void 0 : Ue.name,
647
+ "helper-text": (Ue = e.modelValue) != null && Ue.trackingMeasurement ? `Base unit: ${(Te = (Re = e.modelValue) == null ? void 0 : Re.unit) == null ? void 0 : Te.name}` : void 0,
648
+ "model-value": (Ae = N.value) == null ? void 0 : Ae.name,
639
649
  locked: g.value,
640
- disabled: t.disabled
650
+ disabled: e.disabled
641
651
  }, {
642
652
  default: V(() => [
643
653
  p($e, {
@@ -651,14 +661,14 @@ const Et = {
651
661
  }, null, 8, ["label"])
652
662
  ]),
653
663
  default: V(({ invalid: M }) => [
654
- p(ee, null, {
664
+ p(te, null, {
655
665
  "menu-button": V(() => [
656
666
  p(E, {
657
- class: te([
667
+ class: X([
658
668
  "fm-typo-en-body-lg-400",
659
669
  {
660
- "text-fm-color-typo-primary": !t.disabled,
661
- "text-fm-color-typo-disabled": t.disabled
670
+ "text-fm-color-typo-primary": !e.disabled,
671
+ "text-fm-color-typo-disabled": e.disabled
662
672
  }
663
673
  ]),
664
674
  invalid: M,
@@ -674,14 +684,14 @@ const Et = {
674
684
  }, 1032, ["class", "invalid"])
675
685
  ]),
676
686
  default: V(() => [
677
- d("div", {
687
+ u("div", {
678
688
  class: "overflow-x-hidden overflow-y-auto max-h-[300px]",
679
689
  onVnodeMounted: $
680
690
  }, [
681
- (f(!0), T(Q, null, ue(w.value, (W) => (f(), T(Q, {
691
+ (f(!0), A(Q, null, de(w.value, (W) => (f(), A(Q, {
682
692
  key: W.label
683
693
  }, [
684
- W.displayAsSection ? (f(), T(Q, { key: 0 }, [
694
+ W.displayAsSection ? (f(), A(Q, { key: 0 }, [
685
695
  p(F, {
686
696
  label: W.label
687
697
  }, null, 8, ["label"]),
@@ -690,7 +700,7 @@ const Et = {
690
700
  key: 1,
691
701
  label: W.label,
692
702
  "model-value": v(W),
693
- onClick: (Bn) => R(W.value),
703
+ onClick: (zn) => R(W.value),
694
704
  "x-should-scroll-into": `${v(W)}`
695
705
  }, null, 8, ["label", "model-value", "onClick", "x-should-scroll-into"]))
696
706
  ], 64))), 128))
@@ -703,14 +713,14 @@ const Et = {
703
713
  }, 8, ["model-value", "rules"])
704
714
  ]),
705
715
  _: 1
706
- }, 8, ["label", "model-value", "locked", "disabled"]),
716
+ }, 8, ["label", "helper-text", "model-value", "locked", "disabled"]),
707
717
  m(h).enableTotalCost ? (f(), B(ye, {
708
718
  key: 0,
709
719
  "tooltip-message": "This field is managed by NetSuite",
710
720
  "tooltip-z-index": 50,
711
- "model-value": `${m(st)()} ${I.value}`,
721
+ "model-value": `${m(ut)()} ${I.value}`,
712
722
  locked: g.value,
713
- disabled: t.disabled
723
+ disabled: e.disabled
714
724
  }, {
715
725
  label: V(() => [
716
726
  p(we, { "z-index": 50 }, {
@@ -726,8 +736,8 @@ const Et = {
726
736
  m(h).enableTotalCost ? (f(), B(c, {
727
737
  key: 0,
728
738
  "model-value": I.value,
729
- "onUpdate:modelValue": e[4] || (e[4] = (M) => I.value = M),
730
- rules: [m(ge)(0), m(it)(4)]
739
+ "onUpdate:modelValue": t[4] || (t[4] = (M) => I.value = M),
740
+ rules: [m(ge)(0), m(mt)(4)]
731
741
  }, {
732
742
  label: V(() => [
733
743
  p(we, { "z-index": 50 }, {
@@ -742,30 +752,30 @@ const Et = {
742
752
  prepend: V(() => {
743
753
  var M, W;
744
754
  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)
755
+ u("div", Bt, D(re(((M = m(a).currentCountry) == null ? void 0 : M.value) ?? m(Ne)) === "MYR" ? "RM" : re(((W = m(a).currentCountry) == null ? void 0 : W.value) ?? m(Ne))), 1)
746
756
  ];
747
757
  }),
748
758
  append: V(() => [
749
- d("div", Dt, " / " + D(se.value), 1)
759
+ u("div", Nt, " / " + D(se.value), 1)
750
760
  ]),
751
761
  _: 1
752
762
  }, 8, ["model-value", "rules"])) : Y("", !0)
753
763
  ]),
754
764
  _: 1
755
765
  }, 8, ["model-value", "locked", "disabled"])) : Y("", !0),
756
- !g.value || J.value ? (f(), B($t, {
766
+ !g.value || J.value ? (f(), B(Rt, {
757
767
  key: 1,
758
768
  "model-value": J.value,
759
- "onUpdate:modelValue": e[5] || (e[5] = (M) => J.value = M),
760
- "root-value": t.modelValue,
769
+ "onUpdate:modelValue": t[5] || (t[5] = (M) => J.value = M),
770
+ "root-value": e.modelValue,
761
771
  readonly: g.value
762
772
  }, 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, {
773
+ e.mode !== m(K).CREATE ? (f(), A("div", Lt, [
774
+ u("div", null, [
775
+ p(tt, {
766
776
  label: m(s)("inventory.ingredient.bindedItems.title"),
767
777
  modelValue: z.value,
768
- "onUpdate:modelValue": e[6] || (e[6] = (M) => z.value = M),
778
+ "onUpdate:modelValue": t[6] || (t[6] = (M) => z.value = M),
769
779
  "label-placement": "right"
770
780
  }, null, 8, ["label", "modelValue"])
771
781
  ]),
@@ -779,44 +789,44 @@ const Et = {
779
789
  name: m(s)("inventory.ingredient.bindedItems.recipe"),
780
790
  bindings: ne.value
781
791
  }, null, 8, ["name", "bindings"])) : Y("", !0),
782
- z.value && de.value.length ? (f(), B(Ce, {
792
+ z.value && ue.value.length ? (f(), B(Ce, {
783
793
  key: 2,
784
794
  name: m(s)("inventory.ingredient.bindedItems.menu"),
785
- bindings: de.value
795
+ bindings: ue.value
786
796
  }, null, 8, ["name", "bindings"])) : Y("", !0)
787
797
  ])) : Y("", !0),
788
- d("div", Bt, [
789
- d("div", Nt, [
798
+ u("div", zt, [
799
+ u("div", Ht, [
790
800
  p(we, null, {
791
801
  default: V(() => [
792
- d("div", Lt, D(m(s)("inventory.ingredient.threshold.title")), 1)
802
+ u("div", Yt, D(m(s)("inventory.ingredient.threshold.title")), 1)
793
803
  ]),
794
804
  _: 1
795
805
  }),
796
- d("div", zt, D(m(s)("inventory.ingredient.threshold.subtitle")), 1)
806
+ u("div", jt, D(m(s)("inventory.ingredient.threshold.subtitle")), 1)
797
807
  ]),
798
- d("div", Ht, [
808
+ u("div", Ot, [
799
809
  p($e, {
800
- "model-value": { low: X.value, mid: A.value },
810
+ "model-value": { low: ee.value, mid: T.value },
801
811
  rules: [O()]
802
812
  }, null, 8, ["model-value", "rules"]),
803
- d("div", Yt, [
804
- d("div", jt, [
805
- d("div", Ot, [
813
+ u("div", qt, [
814
+ u("div", Gt, [
815
+ u("div", Wt, [
806
816
  p(Ve, {
807
- days: X.value,
817
+ days: ee.value,
808
818
  level: m(Se).low
809
819
  }, null, 8, ["days", "level"])
810
820
  ]),
811
- d("div", qt, [
812
- d("div", Gt, D(m(s)("inventory.ingredient.threshold.whenRemaining")), 1),
821
+ u("div", Kt, [
822
+ u("div", Zt, D(m(s)("inventory.ingredient.threshold.whenRemaining")), 1),
813
823
  p(Ee, {
814
- modelValue: X.value,
815
- "onUpdate:modelValue": e[7] || (e[7] = (M) => X.value = M),
824
+ modelValue: ee.value,
825
+ "onUpdate:modelValue": t[7] || (t[7] = (M) => ee.value = M),
816
826
  rules: [m(ge)(0)]
817
827
  }, {
818
- append: V(() => e[10] || (e[10] = [
819
- d("div", {
828
+ append: V(() => t[10] || (t[10] = [
829
+ u("div", {
820
830
  class: "text-fm-color-typo-secondary",
821
831
  style: { "padding-right": "32px" }
822
832
  }, "days", -1)
@@ -825,31 +835,31 @@ const Et = {
825
835
  }, 8, ["modelValue", "rules"])
826
836
  ])
827
837
  ]),
828
- e[12] || (e[12] = d("div", {
838
+ t[12] || (t[12] = u("div", {
829
839
  class: "h-full bg-fm-color-neutral-gray-200 relative",
830
840
  style: { width: "1px" }
831
841
  }, [
832
- d("div", {
842
+ u("div", {
833
843
  class: "absolute bg-white",
834
844
  style: { transform: "translate(-50%, -50%)", left: "50%", top: "24px" }
835
845
  }, " < ")
836
846
  ], -1)),
837
- d("div", Wt, [
838
- d("div", Kt, [
847
+ u("div", Jt, [
848
+ u("div", Qt, [
839
849
  p(Ve, {
840
- days: A.value,
850
+ days: T.value,
841
851
  level: m(Se).mid
842
852
  }, null, 8, ["days", "level"])
843
853
  ]),
844
- d("div", Zt, [
845
- d("div", Jt, D(m(s)("inventory.ingredient.threshold.whenRemaining")), 1),
854
+ u("div", Xt, [
855
+ u("div", en, D(m(s)("inventory.ingredient.threshold.whenRemaining")), 1),
846
856
  p(Ee, {
847
- modelValue: A.value,
848
- "onUpdate:modelValue": e[8] || (e[8] = (M) => A.value = M),
857
+ modelValue: T.value,
858
+ "onUpdate:modelValue": t[8] || (t[8] = (M) => T.value = M),
849
859
  rules: [m(ge)(0)]
850
860
  }, {
851
- append: V(() => e[11] || (e[11] = [
852
- d("div", {
861
+ append: V(() => t[11] || (t[11] = [
862
+ u("div", {
853
863
  class: "text-fm-color-typo-secondary",
854
864
  style: { "padding-right": "32px" }
855
865
  }, "days", -1)
@@ -858,34 +868,34 @@ const Et = {
858
868
  }, 8, ["modelValue", "rules"])
859
869
  ])
860
870
  ]),
861
- e[13] || (e[13] = d("div", {
871
+ t[13] || (t[13] = u("div", {
862
872
  class: "h-full bg-fm-color-neutral-gray-200 relative",
863
873
  style: { width: "1px" }
864
874
  }, [
865
- d("div", {
875
+ u("div", {
866
876
  class: "absolute bg-white",
867
877
  style: { transform: "translate(-50%, -50%)", left: "50%", top: "24px" }
868
878
  }, " < ")
869
879
  ], -1)),
870
- d("div", Qt, [
871
- d("div", Xt, [
880
+ u("div", tn, [
881
+ u("div", nn, [
872
882
  p(Ve, {
873
- days: A.value + 1,
883
+ days: T.value + 1,
874
884
  level: m(Se).high
875
885
  }, null, 8, ["days", "level"])
876
886
  ]),
877
- d("div", en, [
878
- d("div", tn, D(m(s)("inventory.ingredient.threshold.stockIsStaple")), 1)
887
+ u("div", on, [
888
+ u("div", ln, D(m(s)("inventory.ingredient.threshold.stockIsStaple")), 1)
879
889
  ])
880
890
  ])
881
891
  ])
882
892
  ])
883
893
  ]),
884
- d("div", null, [
885
- p(It, {
894
+ u("div", null, [
895
+ p(Et, {
886
896
  entity: "inventorySku",
887
897
  modelValue: Z.value,
888
- "onUpdate:modelValue": e[9] || (e[9] = (M) => Z.value = M)
898
+ "onUpdate:modelValue": t[9] || (t[9] = (M) => Z.value = M)
889
899
  }, null, 8, ["modelValue"])
890
900
  ])
891
901
  ];
@@ -894,10 +904,10 @@ const Et = {
894
904
  }, 8, ["disabled"]);
895
905
  };
896
906
  }
897
- }), on = { class: "flex flex-col gap-32" }, ln = {
907
+ }), rn = { class: "flex flex-col gap-32" }, sn = {
898
908
  key: 0,
899
909
  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({
910
+ }, dn = { class: "flex flex-col gap-4" }, un = { class: "flex-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, mn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, cn = { class: "flex gap-4" }, pn = /* @__PURE__ */ oe({
901
911
  __name: "IngredientDialog",
902
912
  props: {
903
913
  show: { type: Boolean },
@@ -905,8 +915,8 @@ const Et = {
905
915
  mode: { default: K.READ }
906
916
  },
907
917
  emits: ["update:show"],
908
- 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(
918
+ setup(d) {
919
+ const o = d, y = le(), s = Me(), n = he(), { t: l } = ae(), i = He(o, "show"), a = He(o, "unit"), h = S(
910
920
  () => {
911
921
  var v;
912
922
  return s.isEnabled && s.netSuiteItemBySkuId.has((v = o.unit) == null ? void 0 : v._id);
@@ -941,7 +951,7 @@ const Et = {
941
951
  type: "success"
942
952
  });
943
953
  } catch (v) {
944
- v instanceof Pe || n.open({
954
+ v instanceof Le || n.open({
945
955
  title: l("inventory.ingredient.create.error.title"),
946
956
  message: l("inventory.ingredient.create.error.message"),
947
957
  type: "error"
@@ -959,7 +969,7 @@ const Et = {
959
969
  type: "success"
960
970
  });
961
971
  } catch (v) {
962
- v instanceof Pe || n.open({
972
+ v instanceof Le || n.open({
963
973
  title: l("inventory.ingredient.update.error.title"),
964
974
  message: l("inventory.ingredient.update.error.message"),
965
975
  type: "error"
@@ -1001,14 +1011,14 @@ const Et = {
1001
1011
  const J = C("FmChip"), Z = C("FmButton"), L = C("FmSideSheet");
1002
1012
  return f(), B(L, {
1003
1013
  "model-value": m(i),
1004
- "onUpdate:modelValue": R[3] || (R[3] = (z) => Re(i) ? i.value = z : null),
1014
+ "onUpdate:modelValue": R[3] || (R[3] = (z) => De(i) ? i.value = z : null),
1005
1015
  header: k.value,
1006
1016
  "close-button": "",
1007
1017
  "dismiss-away": "",
1008
1018
  "max-width": 500
1009
1019
  }, {
1010
1020
  "side-sheet-footer": V(() => [
1011
- d("div", un, [
1021
+ u("div", cn, [
1012
1022
  p(Z, {
1013
1023
  loading: r.value,
1014
1024
  label: g.value,
@@ -1025,33 +1035,33 @@ const Et = {
1025
1035
  default: V(() => {
1026
1036
  var z;
1027
1037
  return [
1028
- d("div", on, [
1029
- d("div", null, [
1038
+ u("div", rn, [
1039
+ u("div", null, [
1030
1040
  h.value ? (f(), B(J, {
1031
1041
  key: 0,
1032
1042
  label: "Netsuite",
1033
1043
  compact: ""
1034
1044
  })) : Y("", !0)
1035
1045
  ]),
1036
- p(nn, {
1046
+ p(an, {
1037
1047
  class: "w-full",
1038
1048
  ref_key: "hasValidationExpose",
1039
1049
  ref: b,
1040
1050
  modelValue: m(a),
1041
- "onUpdate:modelValue": R[0] || (R[0] = (q) => Re(a) ? a.value = q : null),
1051
+ "onUpdate:modelValue": R[0] || (R[0] = (q) => De(a) ? a.value = q : null),
1042
1052
  mode: v.mode,
1043
1053
  disabled: r.value,
1044
1054
  "onClick:submit": R[1] || (R[1] = (q) => N())
1045
1055
  }, 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", {
1056
+ (z = w.value) != null && z.length ? (f(), A("div", sn, [
1057
+ R[4] || (R[4] = u("div", { class: "fm-typo-en-title-sm-600" }, D("NetSuite info"), -1)),
1058
+ u("div", dn, [
1059
+ (f(!0), A(Q, null, de(w.value, (q, ne) => (f(), A("div", {
1050
1060
  key: ne,
1051
1061
  class: "flex items-center"
1052
1062
  }, [
1053
- d("div", rn, D(q.externalId), 1),
1054
- d("div", sn, D(q.abbrev), 1)
1063
+ u("div", un, D(q.externalId), 1),
1064
+ u("div", mn, D(q.abbrev), 1)
1055
1065
  ]))), 128))
1056
1066
  ])
1057
1067
  ])) : Y("", !0)
@@ -1063,39 +1073,39 @@ const Et = {
1063
1073
  };
1064
1074
  }
1065
1075
  });
1066
- function* mn(u) {
1076
+ function* vn(d) {
1067
1077
  for (; ; )
1068
- yield u[Math.floor(Math.random() * u.length)];
1078
+ yield d[Math.floor(Math.random() * d.length)];
1069
1079
  }
1070
- function cn(u = 4, o = mn("qwertyuiopasdfghjklzxcvbnm".split(""))) {
1071
- return Array.from({ length: u }).map(() => o.next().value).join("");
1080
+ function fn(d = 4, o = vn("qwertyuiopasdfghjklzxcvbnm".split(""))) {
1081
+ return Array.from({ length: d }).map(() => o.next().value).join("");
1072
1082
  }
1073
- function pn() {
1074
- return `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${cn()}`;
1083
+ function yn() {
1084
+ return `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${fn()}`;
1075
1085
  }
1076
- const vn = {
1086
+ const gn = {
1077
1087
  _id: "",
1078
1088
  name: "",
1079
1089
  abbrev: "",
1080
1090
  precision: 0,
1081
1091
  measurements: []
1082
1092
  };
1083
- function fn(u) {
1093
+ function bn(d) {
1084
1094
  var y, s, n, l, i;
1085
1095
  return {
1086
- code: u.code,
1087
- name: u.name,
1088
- unit: ((y = u.unit.measurements.find((a) => a.id === u.trackingMeasurement)) == null ? void 0 : y.abbrev) ?? u.unit.abbrev,
1089
- baseUnit: u.unit.abbrev,
1090
- 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
1096
+ code: d.code,
1097
+ name: d.name,
1098
+ unit: ((y = d.unit.measurements.find((a) => a.id === d.trackingMeasurement)) == null ? void 0 : y.abbrev) ?? d.unit.abbrev,
1099
+ baseUnit: d.unit.abbrev,
1100
+ valuationMethod: d.valuation ?? "WAVG",
1101
+ pricePerUnit: (s = d.defaultCost) != null && s.costPerUnit ? +We((n = d.defaultCost) == null ? void 0 : n.costPerUnit) : 0,
1102
+ thresholdLow: ((l = d.thresholds) == null ? void 0 : l.low) ?? ie().low,
1103
+ thresholdMid: ((i = d.thresholds) == null ? void 0 : i.mid) ?? ie().mid
1094
1104
  };
1095
1105
  }
1096
- function Je() {
1106
+ function et() {
1097
1107
  var n;
1098
- const u = [
1108
+ const d = [
1099
1109
  {
1100
1110
  id: "code",
1101
1111
  name: "Code"
@@ -1112,8 +1122,8 @@ function Je() {
1112
1122
  id: "baseUnit",
1113
1123
  name: "Base unit"
1114
1124
  }
1115
- ], o = Ge(), y = pe(), s = be(y.currentCountry.value);
1116
- return o.enableTotalCost && u.push(
1125
+ ], o = Ze(), y = ve(), s = be(y.currentCountry.value);
1126
+ return o.enableTotalCost && d.push(
1117
1127
  {
1118
1128
  id: "valuationMethod",
1119
1129
  name: "Valuation method"
@@ -1122,7 +1132,7 @@ function Je() {
1122
1132
  id: "pricePerUnit",
1123
1133
  name: `Price per unit (${s == null ? void 0 : s.currency})`
1124
1134
  }
1125
- ), ((n = y.currentBusiness.value) == null ? void 0 : n.menuVersion) === "v4" && u.push(
1135
+ ), ((n = y.currentBusiness.value) == null ? void 0 : n.menuVersion) === "v4" && d.push(
1126
1136
  {
1127
1137
  id: "thresholdLow",
1128
1138
  name: "Show RED when remaining"
@@ -1131,30 +1141,30 @@ function Je() {
1131
1141
  id: "thresholdMid",
1132
1142
  name: "Show YELLOW when remaining"
1133
1143
  }
1134
- ), u;
1144
+ ), d;
1135
1145
  }
1136
- function yn() {
1137
- const o = le().skus.map(fn), s = pe().currentBusiness.value, n = Je(), l = [
1146
+ function hn() {
1147
+ const o = le().skus.map(bn), s = ve().currentBusiness.value, n = et(), l = [
1138
1148
  ["Business name:", s == null ? void 0 : s.name],
1139
1149
  ["Business ID:", s == null ? void 0 : s._id],
1140
1150
  ["Menu version", s == null ? void 0 : s.menuVersion],
1141
1151
  [],
1142
1152
  n.map((k) => k.name),
1143
1153
  ...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;
1154
+ ], i = n.map((k) => `system:${k.id}`), a = Je(l, i), h = `${s == null ? void 0 : s.name} ingredients (${ct(/* @__PURE__ */ new Date())}).xlsx`;
1155
+ return Qe(a, h), h;
1146
1156
  }
1147
- function gn() {
1148
- const o = pe().currentBusiness.value, y = Je(), s = [
1157
+ function _n() {
1158
+ const o = ve().currentBusiness.value, y = et(), s = [
1149
1159
  ["Business name:", o == null ? void 0 : o.name],
1150
1160
  ["Business ID:", o == null ? void 0 : o._id],
1151
1161
  ["Menu version", o == null ? void 0 : o.menuVersion],
1152
1162
  [],
1153
1163
  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;
1164
+ ], n = y.map((a) => `system:${a.id}`), l = Je(s, n), i = "FeedMe ingredients template.xlsx";
1165
+ return Qe(l, i), i;
1156
1166
  }
1157
- function bn(u) {
1167
+ function xn(d) {
1158
1168
  const [
1159
1169
  o,
1160
1170
  y,
@@ -1163,7 +1173,7 @@ function bn(u) {
1163
1173
  l,
1164
1174
  i,
1165
1175
  ...a
1166
- ] = mt(u);
1176
+ ] = vt(d);
1167
1177
  if (!o || !o.length || o.some((r) => r.length && !r.startsWith("system:")))
1168
1178
  throw new Error("Missing meta header. Excel file does not come from the template.");
1169
1179
  const h = o.map((r) => r.split(":")[1]), g = ["code", "name", "unit", "baseUnit"].filter((r) => !h.includes(r));
@@ -1183,42 +1193,42 @@ function bn(u) {
1183
1193
  };
1184
1194
  });
1185
1195
  }
1186
- function Le(u, o, y) {
1196
+ function Ye(d, o, y) {
1187
1197
  var w;
1188
- const n = le().units, l = new Array(), i = y.filter((v) => v.data.code === u.code);
1198
+ const n = le().units, l = new Array(), i = y.filter((v) => v.data.code === d.code);
1189
1199
  i.length > 1 && l.push(
1190
- `Code ${u.code} is already used in row ${i.map((v) => v.index + 6).join()}.`
1200
+ `Code ${d.code} is already used in row ${i.map((v) => v.index + 6).join()}.`
1191
1201
  );
1192
- const a = n.find((v) => v.abbrev === u.baseUnit), h = a == null ? void 0 : a.measurements.find((v) => v.abbrev === u.unit);
1202
+ const a = n.find((v) => v.abbrev === d.baseUnit), h = a == null ? void 0 : a.measurements.find((v) => v.abbrev === d.unit);
1193
1203
  if (!a)
1194
- l.push(`Cannot find base unit of symbol ${u.baseUnit}.`);
1195
- else if (u.baseUnit !== u.unit && !h) {
1196
- const v = `Cannot find unit conversion for ${u.baseUnit} with symbol ${u.unit || "[empty]"}.`;
1204
+ l.push(`Cannot find base unit of symbol ${d.baseUnit}.`);
1205
+ else if (d.baseUnit !== d.unit && !h) {
1206
+ const v = `Cannot find unit conversion for ${d.baseUnit} with symbol ${d.unit || "[empty]"}.`;
1197
1207
  l.push(v);
1198
1208
  }
1199
- const k = ce.options.find(
1200
- (v) => v === u.valuationMethod
1209
+ const k = pe.options.find(
1210
+ (v) => v === d.valuationMethod
1201
1211
  );
1202
- u.valuationMethod && !k && l.push(
1203
- `Expected valuation method to be one of ${ce.options.join()} but got ${u.valuationMethod} instead.`
1212
+ d.valuationMethod && !k && l.push(
1213
+ `Expected valuation method to be one of ${pe.options.join()} but got ${d.valuationMethod} instead.`
1204
1214
  );
1205
- const b = pe().currentCountry.value, r = (v) => `${v}`.length && ct()(v) === !0, _ = r(`${u.pricePerUnit}`) === !0 ? {
1215
+ const b = ve().currentCountry.value, r = (v) => `${v}`.length && ft()(v) === !0, _ = r(`${d.pricePerUnit}`) === !0 ? {
1206
1216
  costPerUnit: {
1207
- ...qe(Number(u.pricePerUnit) || 0),
1217
+ ...Ke(Number(d.pricePerUnit) || 0),
1208
1218
  currency: ((w = be(b)) == null ? void 0 : w.currency) ?? "MYR"
1209
1219
  },
1210
1220
  measurement: h
1211
- } : void 0, U = r(`${u.thresholdLow}`) && r(`${u.thresholdMid}`) ? {
1212
- low: Number(u.thresholdLow) || 0,
1213
- mid: Number(u.thresholdMid) || 0
1221
+ } : void 0, U = r(`${d.thresholdLow}`) && r(`${d.thresholdMid}`) ? {
1222
+ low: Number(d.thresholdLow) || 0,
1223
+ mid: Number(d.thresholdMid) || 0
1214
1224
  } : void 0;
1215
1225
  return {
1216
1226
  type: "create",
1217
1227
  sku: {
1218
- _id: pn(),
1219
- code: u.code,
1220
- name: u.name,
1221
- unit: a ?? n.find((v) => v) ?? vn,
1228
+ _id: yn(),
1229
+ code: d.code,
1230
+ name: d.name,
1231
+ unit: a ?? n.find((v) => v) ?? gn,
1222
1232
  trackingMeasurement: h == null ? void 0 : h.id,
1223
1233
  valuation: k,
1224
1234
  defaultCost: _,
@@ -1228,12 +1238,12 @@ function Le(u, o, y) {
1228
1238
  excelRowNumber: o + 6
1229
1239
  };
1230
1240
  }
1231
- function hn(u) {
1241
+ function kn(d) {
1232
1242
  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)
1243
+ const o = xn(d).filter((k) => k.data.code), s = le().skus, n = pt(s, "code"), l = o.filter((k) => !n[k.data.code]), i = o.filter((k) => n[k.data.code]), a = l.map(
1244
+ (k) => Ye(k.data, k.index, o)
1235
1245
  ), h = i.map((k) => {
1236
- const g = Le(k.data, k.index, o), b = n[k.data.code];
1246
+ const g = Ye(k.data, k.index, o), b = n[k.data.code];
1237
1247
  return {
1238
1248
  ...g,
1239
1249
  type: "update",
@@ -1265,10 +1275,10 @@ function hn(u) {
1265
1275
  };
1266
1276
  }
1267
1277
  }
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 = {
1278
+ const Vn = { class: "flex items-center gap-12 pl-8" }, Sn = { class: "flex flex-col" }, Cn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, wn = {
1269
1279
  key: 0,
1270
1280
  class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
1271
- }, Sn = { key: 0 }, ze = /* @__PURE__ */ oe({
1281
+ }, Fn = { key: 0 }, je = /* @__PURE__ */ oe({
1272
1282
  __name: "ImportIngredientItem",
1273
1283
  props: {
1274
1284
  type: {},
@@ -1276,26 +1286,26 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1276
1286
  name: {},
1277
1287
  errors: {}
1278
1288
  },
1279
- setup(u) {
1289
+ setup(d) {
1280
1290
  return (o, y) => {
1281
1291
  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({
1292
+ return f(), A("div", Vn, [
1293
+ y[0] || (y[0] = u("div", null, "•", -1)),
1294
+ u("div", Sn, [
1295
+ u("div", Cn, [
1296
+ u("div", {
1297
+ class: X({
1288
1298
  "text-fm-color-system-error-300": o.errors.length
1289
1299
  })
1290
1300
  }, [
1291
1301
  Ie(D(o.name) + " ", 1),
1292
- o.type === "create" ? (f(), T("span", Vn, "(new)")) : Y("", !0)
1302
+ o.type === "create" ? (f(), A("span", wn, "(new)")) : Y("", !0)
1293
1303
  ], 2),
1294
- o.errors.length ? (f(), T("div", Sn, [
1304
+ o.errors.length ? (f(), A("div", Fn, [
1295
1305
  p(n, { "z-index": 50 }, {
1296
1306
  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))
1307
+ u("ol", null, [
1308
+ (f(!0), A(Q, null, de(o.errors, (l, i) => (f(), A("li", { key: i }, D(l), 1))), 128))
1299
1309
  ])
1300
1310
  ]),
1301
1311
  default: V(() => [
@@ -1309,8 +1319,8 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1309
1319
  })
1310
1320
  ])) : Y("", !0)
1311
1321
  ]),
1312
- d("div", {
1313
- class: te([
1322
+ u("div", {
1323
+ class: X([
1314
1324
  "fm-typo-en-body-sm-400",
1315
1325
  {
1316
1326
  "text-fm-color-system-error-200": o.errors.length,
@@ -1322,19 +1332,19 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1322
1332
  ]);
1323
1333
  };
1324
1334
  }
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 = {
1335
+ }), In = { class: "flex flex-col gap-24" }, Mn = { class: "fm-typo-en-body-md-400" }, $n = { class: "flex flex-col gap-8" }, En = { class: "line-clamp-2 text-ellipsis break-all" }, Un = {
1326
1336
  key: 2,
1327
1337
  class: "shrink-0"
1328
- }, $n = {
1338
+ }, Rn = {
1329
1339
  key: 0,
1330
1340
  class: "flex flex-col"
1331
- }, En = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, Un = {
1341
+ }, Tn = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, An = {
1332
1342
  key: 0,
1333
1343
  class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
1334
- }, Rn = { class: "fm-typo-en-body-lg-600" }, An = /* @__PURE__ */ oe({
1344
+ }, Dn = { class: "fm-typo-en-body-lg-600" }, Pn = /* @__PURE__ */ oe({
1335
1345
  __name: "ImportIngredients",
1336
- setup(u) {
1337
- const o = j(null), y = _t(), s = he(), n = j(!1), l = j(new Array()), i = j([]), a = j([]), h = S(
1346
+ setup(d) {
1347
+ const o = j(null), y = Vt(), s = he(), n = j(!1), l = j(new Array()), i = j([]), a = j([]), h = S(
1338
1348
  () => !!l.value.length || i.value.some((r) => r.errors.length) || a.value.some((r) => r.errors.length)
1339
1349
  ), k = S(
1340
1350
  () => !!i.value.length || !!a.value.length
@@ -1344,7 +1354,7 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1344
1354
  try {
1345
1355
  n.value = !0;
1346
1356
  const [_] = await Promise.all([
1347
- vt(r),
1357
+ gt(r),
1348
1358
  // fake buffer
1349
1359
  new Promise((N) => setTimeout(N, 1e3))
1350
1360
  ]), U = _.SheetNames.find((N) => N);
@@ -1352,7 +1362,7 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1352
1362
  l.value.push(g("inventory.ingredient.import.fileError.noSheet"));
1353
1363
  return;
1354
1364
  }
1355
- const I = hn(_.Sheets[U]);
1365
+ const I = kn(_.Sheets[U]);
1356
1366
  if (I.invalidExcel) {
1357
1367
  l.value.push(I.invalidExcelMessage ?? g("inventory.ingredient.import.fileError.invalidExcel"));
1358
1368
  return;
@@ -1375,14 +1385,14 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1375
1385
  }), n.value = !1;
1376
1386
  }
1377
1387
  }
1378
- return He(o, (r) => {
1388
+ return Oe(o, (r) => {
1379
1389
  r && b(r);
1380
1390
  }), (r, _) => {
1381
1391
  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({
1392
+ return f(), A("div", In, [
1393
+ u("div", Mn, D(m(g)("inventory.ingredient.import.uploadDescription")), 1),
1394
+ p(yt, {
1395
+ class: X({
1386
1396
  "w-full": !0,
1387
1397
  "h-[200px]": !o.value
1388
1398
  }),
@@ -1390,13 +1400,13 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1390
1400
  onFileUpload: _[0] || (_[0] = (w) => o.value = w),
1391
1401
  label: m(g)("inventory.ingredient.import.uploadTemplate"),
1392
1402
  "button-label": m(g)("inventory.ingredient.import.selectFile")
1393
- }, Ye({ _: 2 }, [
1403
+ }, qe({ _: 2 }, [
1394
1404
  o.value ? {
1395
1405
  name: "default",
1396
1406
  fn: V(({ openFileDialog: w }) => [
1397
- d("div", Fn, [
1398
- d("div", {
1399
- class: te([
1407
+ u("div", $n, [
1408
+ u("div", {
1409
+ class: X([
1400
1410
  "fm-corner-radius-md p-16 flex items-center gap-16",
1401
1411
  {
1402
1412
  "border border-fm-color-neutral-gray-100": n.value,
@@ -1415,8 +1425,8 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1415
1425
  outline: "",
1416
1426
  color: h.value ? "system-error-300" : void 0
1417
1427
  }, null, 8, ["name", "color"])),
1418
- d("div", {
1419
- class: te([
1428
+ u("div", {
1429
+ class: X([
1420
1430
  "fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center",
1421
1431
  {
1422
1432
  "text-fm-color-typo-disabled": n.value,
@@ -1424,9 +1434,9 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1424
1434
  }
1425
1435
  ])
1426
1436
  }, [
1427
- d("div", In, D(o.value.name), 1)
1437
+ u("div", En, D(o.value.name), 1)
1428
1438
  ], 2),
1429
- n.value ? Y("", !0) : (f(), T("div", Mn, [
1439
+ n.value ? Y("", !0) : (f(), A("div", Un, [
1430
1440
  p(N, {
1431
1441
  label: m(g)("inventory.ingredient.import.replaceFile"),
1432
1442
  variant: h.value ? "destructive" : "secondary",
@@ -1435,8 +1445,8 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1435
1445
  }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
1436
1446
  ]))
1437
1447
  ], 2),
1438
- l.value.length ? (f(), T("div", $n, [
1439
- (f(!0), T(Q, null, ue(l.value, (v, R) => (f(), T("div", {
1448
+ l.value.length ? (f(), A("div", Rn, [
1449
+ (f(!0), A(Q, null, de(l.value, (v, R) => (f(), A("div", {
1440
1450
  key: R,
1441
1451
  class: "flex gap-8 items-center"
1442
1452
  }, [
@@ -1445,7 +1455,7 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1445
1455
  size: "sm",
1446
1456
  color: "system-error-300"
1447
1457
  }),
1448
- d("div", En, D(v), 1)
1458
+ u("div", Tn, D(v), 1)
1449
1459
  ]))), 128))
1450
1460
  ])) : Y("", !0)
1451
1461
  ])
@@ -1453,16 +1463,16 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1453
1463
  key: "0"
1454
1464
  } : void 0
1455
1465
  ]), 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, {
1466
+ k.value ? (f(), A("div", An, [
1467
+ u("div", Dn, D(m(g)("inventory.ingredient.import.summary")), 1),
1468
+ (f(!0), A(Q, null, de(i.value, (w) => (f(), B(je, {
1459
1469
  key: w.sku._id,
1460
1470
  code: w.sku.code,
1461
1471
  name: w.sku.name,
1462
1472
  errors: w.errors,
1463
1473
  type: "create"
1464
1474
  }, null, 8, ["code", "name", "errors"]))), 128)),
1465
- (f(!0), T(Q, null, ue(a.value, (w) => (f(), B(ze, {
1475
+ (f(!0), A(Q, null, de(a.value, (w) => (f(), B(je, {
1466
1476
  key: w.sku._id,
1467
1477
  code: w.sku.code,
1468
1478
  name: w.sku.name,
@@ -1473,21 +1483,21 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1473
1483
  ]);
1474
1484
  };
1475
1485
  }
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({
1486
+ }), Bn = { class: "flex flex-col py-8" }, Nn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ln = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Xn = /* @__PURE__ */ oe({
1477
1487
  __name: "IngredientsView",
1478
- 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();
1488
+ setup(d) {
1489
+ const o = le(), y = S(() => o.skus), s = bt(), n = Xe(), l = he(), i = Me(), { t: a } = ae(), { createIngredient: h, updateIngredient: k } = Fe(), { ingredientDialogProps: g, ingredientViewLoading: b } = It(Fe()), { columnDefs: r } = Ut();
1480
1490
  function _(P) {
1481
1491
  switch (P) {
1482
1492
  case "add":
1483
1493
  return i.isEnabled ? void 0 : h();
1484
1494
  case "import":
1485
- return de();
1495
+ return ue();
1486
1496
  case "export":
1487
1497
  return ne();
1488
1498
  }
1489
1499
  }
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 = [
1500
+ const U = j(""), I = j(!1), N = S(() => I.value || b.value), { breakpoints: w } = St(), v = S(() => w.value.xs || w.value.sm), R = S(() => v.value ? 10 : 20), J = ht(), Z = j(!1), L = [
1491
1501
  {
1492
1502
  value: "import",
1493
1503
  label: a("common.import")
@@ -1500,7 +1510,7 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1500
1510
  function z(P) {
1501
1511
  switch (Z.value = !1, P) {
1502
1512
  case "import":
1503
- return de();
1513
+ return ue();
1504
1514
  case "export":
1505
1515
  return ne();
1506
1516
  }
@@ -1518,17 +1528,17 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1518
1528
  { label: a("common.export"), value: "export" }
1519
1529
  ]);
1520
1530
  function ne() {
1521
- const P = yn();
1531
+ const P = hn();
1522
1532
  l.open({
1523
1533
  title: a("inventory.ingredient.export.success"),
1524
1534
  message: a("inventory.ingredient.export.filename", [P]),
1525
1535
  type: "success"
1526
1536
  });
1527
1537
  }
1528
- function de() {
1538
+ function ue() {
1529
1539
  n.open({
1530
1540
  title: a("inventory.ingredient.import.title"),
1531
- contentComponent: An,
1541
+ contentComponent: Pn,
1532
1542
  overlay: !0,
1533
1543
  closeButton: !0,
1534
1544
  primaryActions: {
@@ -1569,17 +1579,17 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1569
1579
  return;
1570
1580
  }
1571
1581
  n.close(), _e(P);
1572
- }).onTertiary(gn);
1582
+ }).onTertiary(_n);
1573
1583
  }
1574
1584
  async function _e(P) {
1575
1585
  I.value = !0;
1576
1586
  try {
1577
1587
  const $ = [
1578
- ...P.importCreateResult.map(({ sku: A }) => ({ type: "create", sku: A })),
1579
- ...P.importUpdateResult.map(({ sku: A }) => ({ type: "update", sku: A }))
1588
+ ...P.importCreateResult.map(({ sku: T }) => ({ type: "create", sku: T })),
1589
+ ...P.importUpdateResult.map(({ sku: T }) => ({ type: "update", sku: T }))
1580
1590
  ], re = 100;
1581
1591
  let se = 0;
1582
- const X = () => {
1592
+ const ee = () => {
1583
1593
  se += re, l.open({
1584
1594
  title: a("inventory.ingredient.import.progress", [
1585
1595
  Math.min(se, $.length),
@@ -1587,10 +1597,10 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1587
1597
  ])
1588
1598
  });
1589
1599
  };
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)
1600
+ for (const T of $.chunk(100))
1601
+ ee(), await o.importSkus({
1602
+ create: T.filter((O) => O.type === "create").map((O) => O.sku),
1603
+ update: T.filter((O) => O.type === "update").map((O) => O.sku)
1594
1604
  });
1595
1605
  l.open({
1596
1606
  title: a("inventory.ingredient.import.success"),
@@ -1607,15 +1617,15 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1607
1617
  }
1608
1618
  }
1609
1619
  return (P, $) => {
1610
- const re = C("FmTable"), se = C("FmCollapsibleTabs"), X = C("FmBottomSheet");
1611
- return f(), B(gt, {
1620
+ const re = C("FmTable"), se = C("FmCollapsibleTabs"), ee = C("FmBottomSheet");
1621
+ return f(), B(_t, {
1612
1622
  title: m(a)("inventory.ingredient.title"),
1613
1623
  actions: q.value,
1614
1624
  "onClick:action": _
1615
1625
  }, {
1616
1626
  default: V(() => [
1617
- d("div", {
1618
- class: te([
1627
+ u("div", {
1628
+ class: X([
1619
1629
  "flex flex-col gap-8 max-h-full",
1620
1630
  {
1621
1631
  "p-0": v.value,
@@ -1623,40 +1633,40 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1623
1633
  }
1624
1634
  ])
1625
1635
  }, [
1626
- p(bt, {
1636
+ p(xt, {
1627
1637
  searchable: "",
1628
1638
  search: U.value,
1629
- "onUpdate:search": $[0] || ($[0] = (A) => U.value = A)
1639
+ "onUpdate:search": $[0] || ($[0] = (T) => U.value = T)
1630
1640
  }, null, 8, ["search"]),
1631
1641
  p(re, {
1632
- style: tt(m(J).tableHeight),
1642
+ style: lt(m(J).tableHeight),
1633
1643
  "column-defs": m(r),
1634
1644
  "row-data": y.value,
1635
1645
  "search-value": U.value,
1636
1646
  loading: !m(s)._currentLocation || N.value,
1637
1647
  "loading-text": "Loading",
1638
- onRowClick: $[1] || ($[1] = (A) => m(k)(A.original)),
1648
+ onRowClick: $[1] || ($[1] = (T) => m(k)(T.original)),
1639
1649
  "page-size": R.value
1640
1650
  }, {
1641
- "list-row": V((A) => [
1642
- p(ht, {
1643
- row: A,
1651
+ "list-row": V((T) => [
1652
+ p(kt, {
1653
+ row: T,
1644
1654
  onRowClick: m(k)
1645
- }, Ye({
1655
+ }, qe({
1646
1656
  default: V((O) => {
1647
- var me, t, e, c, x, E, F, G, H, ee;
1657
+ var me, e, t, c, x, E, F, G, H, te;
1648
1658
  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,
1659
+ u("div", Bn, [
1660
+ u("div", Nn, [
1661
+ p(m(ze), {
1662
+ render: (t = (e = (me = O.code) == null ? void 0 : me.column) == null ? void 0 : e.columnDef) == null ? void 0 : t.cell,
1653
1663
  props: (x = (c = O.code) == null ? void 0 : c.getContext) == null ? void 0 : x.call(c)
1654
1664
  }, null, 8, ["render", "props"])
1655
1665
  ]),
1656
- d("div", Pn, [
1657
- p(m(Be), {
1666
+ u("div", Ln, [
1667
+ p(m(ze), {
1658
1668
  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)
1669
+ props: (te = (H = O.name) == null ? void 0 : H.getContext) == null ? void 0 : te.call(H)
1660
1670
  }, null, 8, ["render", "props"])
1661
1671
  ])
1662
1672
  ])
@@ -1667,7 +1677,7 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1667
1677
  I.value ? {
1668
1678
  name: "loading-text",
1669
1679
  fn: V(() => [
1670
- d("div", null, D(m(a)("inventory.ingredient.table.importing")), 1)
1680
+ u("div", null, D(m(a)("inventory.ingredient.table.importing")), 1)
1671
1681
  ]),
1672
1682
  key: "0"
1673
1683
  } : void 0
@@ -1676,20 +1686,20 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1676
1686
  _: 1
1677
1687
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
1678
1688
  ], 2),
1679
- (f(), B(Ae, { to: "body" }, [
1680
- p(dn, nt(ot(m(g))), null, 16)
1689
+ (f(), B(Pe, { to: "body" }, [
1690
+ p(pn, at(rt(m(g))), null, 16)
1681
1691
  ])),
1682
- (f(), B(Ae, { to: "body" }, [
1683
- p(X, {
1692
+ (f(), B(Pe, { to: "body" }, [
1693
+ p(ee, {
1684
1694
  "dismiss-away": "",
1685
1695
  modelValue: Z.value,
1686
- "onUpdate:modelValue": $[3] || ($[3] = (A) => Z.value = A)
1696
+ "onUpdate:modelValue": $[3] || ($[3] = (T) => Z.value = T)
1687
1697
  }, {
1688
1698
  default: V(() => [
1689
1699
  p(se, {
1690
1700
  class: "pb-8",
1691
1701
  items: L,
1692
- "onUpdate:modelValue": $[2] || ($[2] = (A) => z(A))
1702
+ "onUpdate:modelValue": $[2] || ($[2] = (T) => z(T))
1693
1703
  })
1694
1704
  ]),
1695
1705
  _: 1
@@ -1702,5 +1712,5 @@ const _n = { class: "flex items-center gap-12 pl-8" }, xn = { class: "flex flex-
1702
1712
  }
1703
1713
  });
1704
1714
  export {
1705
- Zn as default
1715
+ Xn as default
1706
1716
  };