@feedmepos/mf-inventory-portal 0.0.22-dev.10 → 0.0.22-dev.12

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 (34) hide show
  1. package/dist/{ApprovalView-FwJEAzkU.js → ApprovalView-Cjeqabxg.js} +26 -26
  2. package/dist/{BindingsDialog-DFLnNDpl.js → BindingsDialog-DYf9izzO.js} +1 -1
  3. package/dist/{BindingsPicker-Dsd2wQUR.js → BindingsPicker--GhOF5Zy.js} +7 -7
  4. package/dist/{BindingsTable-CTvUEEjT.js → BindingsTable-DFGX1bO_.js} +1 -1
  5. package/dist/{ClosingTemplateView-CPbDZmei.js → ClosingTemplateView-D0ZehXOT.js} +90 -89
  6. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-MW-Ni07p.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CzXWOCCv.js} +8 -8
  7. package/dist/{IngredientsView-C07TvvCQ.js → IngredientsView-D-M4VjtX.js} +3 -3
  8. package/dist/{IntegrationView-BAnrTgio.js → IntegrationView-D29NyKuw.js} +2 -2
  9. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-YAjDfJ_v.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DMzUk8cN.js} +1 -1
  10. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CvzA5XrI.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CrYQR5oS.js} +1 -1
  11. package/dist/{PurchaseOrderPrintPreview-FiOxyAL2.js → PurchaseOrderPrintPreview-BmzWBQYf.js} +1 -1
  12. package/dist/{ReceiveRequestView-BTZ_99LY.js → ReceiveRequestView-D5uhgByr.js} +20 -20
  13. package/dist/{RecipeView-BTRlXuIp.js → RecipeView-CREeE1nK.js} +3 -3
  14. package/dist/{StockView-B50nZjP-.js → StockView-jAGaTT7q.js} +586 -568
  15. package/dist/{SupplierView-CYEdoZ7g.js → SupplierView-BjkhByNr.js} +3 -3
  16. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CMMMgbwA.js → TransferDetails.vue_vue_type_script_setup_true_lang-CInXmMf_.js} +4 -4
  17. package/dist/{TransferDialog.vue_vue_type_script_setup_true_lang-BKmp6Emq.js → TransferDialog.vue_vue_type_script_setup_true_lang-CLiLhIMS.js} +56 -56
  18. package/dist/{TransferTemplateView-DJYoQWDE.js → TransferTemplateView-CUqEsRJ6.js} +347 -362
  19. package/dist/{UnitView-Cg9lop9G.js → UnitView-BrlpQn3T.js} +4 -4
  20. package/dist/{WarehouseView-DQKq_W8l.js → WarehouseView-CbTTIdv9.js} +15 -15
  21. package/dist/{app-CRbOk4dN.js → app-BDzV3RNp.js} +1932 -1886
  22. package/dist/app.js +1 -1
  23. package/dist/{decimal-BrFW4i9P.js → decimal-CRTw2PGO.js} +1 -1
  24. package/dist/{defineDeepModel-Dihj57Tu.js → defineDeepModel-BoSSw2c6.js} +4 -4
  25. package/dist/{format-time-from-id-CAMmsTAi.js → format-time-from-id-CxoHtJa5.js} +1 -1
  26. package/dist/helper/rules.d.ts +1 -0
  27. package/dist/{id-to-date-CLOPCZAL.js → id-to-date-CJbxtIFh.js} +1 -1
  28. package/dist/{purchase-order-transaction-type-C6B_s24N.js → purchase-order-transaction-type-0nZnCUE7.js} +38 -38
  29. package/dist/{supplier-CQ57ob8j.js → supplier-BA6jJGNv.js} +1 -1
  30. package/dist/tsconfig.app.tsbuildinfo +1 -1
  31. package/dist/{use-template-enabled-locations-2-D5I1uMwS.js → use-template-enabled-locations-2-Di0NHn-g.js} +1 -1
  32. package/dist/{xlsx-WWSZpgZu.js → xlsx-BEDKASqP.js} +1 -1
  33. package/dist/{xlsx.util-DjCdSP8D.js → xlsx.util-MTUBPx67.js} +2 -2
  34. package/package.json +1 -1
@@ -1,68 +1,68 @@
1
- import { ref as H, defineComponent as re, computed as U, resolveComponent as M, openBlock as B, createBlock as O, withCtx as D, createElementVNode as n, normalizeClass as he, toDisplayString as b, createVNode as x, createElementBlock as L, Fragment as ne, renderList as ae, unref as v, h as ye, watch as ge, isRef as Ue, createCommentVNode as te, reactive as it, onMounted as Je, normalizeStyle as Qe, createTextVNode as ve, Teleport as ut, normalizeProps as we, mergeProps as Be } from "vue";
2
- import { i as ct, u as dt, _ as mt, a as pt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-MW-Ni07p.js";
3
- import { n as Xe, j as ue, o as vt, c as Pe, p as ft, u as Te, q as Oe, r as De, a as ie, k as yt, t as be, m as Me, A as _t, M as kt, l as fe, s as ht, v as ee, w as gt, x as ze, R as bt, y as xt, z as St, B as Ze, D as W, E as $t, f as et, G as je, H as wt, d as Ye, b as Bt, J as Ft, K as At, C as Fe, L as Vt, N as Ct, O as Dt, P as Mt } from "./app-CRbOk4dN.js";
1
+ import { ref as H, defineComponent as re, computed as U, resolveComponent as M, openBlock as B, createBlock as O, withCtx as D, createElementVNode as n, normalizeClass as he, toDisplayString as x, createVNode as S, createElementBlock as L, Fragment as ne, renderList as ae, unref as v, h as ye, watch as ge, isRef as Pe, createCommentVNode as te, reactive as it, onMounted as Je, normalizeStyle as Qe, createTextVNode as ve, Teleport as ut, normalizeProps as Be, mergeProps as Fe } from "vue";
2
+ import { i as ct, u as dt, _ as mt, a as pt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CzXWOCCv.js";
3
+ import { n as Xe, j as ue, u as $e, o as vt, p as ft, c as Te, q as yt, r as Oe, s as Me, a as ie, k as _t, t as be, m as je, A as kt, M as ht, l as fe, v as gt, w as ee, x as bt, y as ze, R as xt, z as St, B as $t, D as Ze, E as W, G as wt, f as et, H as Ie, J as Bt, d as Ye, b as Ft, K as At, L as Vt, C as Ae, N as Ct, O as Dt, P as Mt, Q as jt } from "./app-BDzV3RNp.js";
4
4
  import { useCoreStore as tt, useI18n as le } from "@feedmepos/mf-common";
5
- import { useSnackbar as de, useDialog as nt, useProxiedModel as Re, useBreakpoints as jt } from "@feedmepos/ui-library";
6
- import { c as It, _ as Ut, F as Ke } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
7
- import { g as xe } from "./decimal-BrFW4i9P.js";
8
- import { e as Pt, i as ot } from "./id-to-date-CLOPCZAL.js";
9
- import { _ as Ie, S as Ae, g as st } from "./StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js";
10
- import { _ as Tt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
11
- import { u as at, _ as Ge } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-CvzA5XrI.js";
12
- import { defineStore as Rt } from "pinia";
13
- import { _ as Ht } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-YAjDfJ_v.js";
14
- import { E as Et } from "./empty-placeholder-wf6-BWE8.js";
15
- const $e = Xe((c, d) => {
16
- const r = ue(), s = tt(), S = de();
17
- return d.onError(async (l) => {
18
- l.name === "SvcForbiddenError" && (S == null || S.open({
5
+ import { useSnackbar as de, useDialog as nt, useProxiedModel as Re, useBreakpoints as It } from "@feedmepos/ui-library";
6
+ import { c as Ut, _ as Pt, F as Ke } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
7
+ import { g as xe } from "./decimal-CRTw2PGO.js";
8
+ import { e as Tt, i as ot } from "./id-to-date-CJbxtIFh.js";
9
+ import { _ as Ue, S as Ve, g as st } from "./StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js";
10
+ import { _ as Rt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
11
+ import { u as at, _ as Ge } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-CrYQR5oS.js";
12
+ import { defineStore as Ht } from "pinia";
13
+ import { _ as Et } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DMzUk8cN.js";
14
+ import { E as Lt } from "./empty-placeholder-wf6-BWE8.js";
15
+ const we = Xe((d, u) => {
16
+ const r = ue(), s = tt(), k = de();
17
+ return u.onError(async (l) => {
18
+ l.name === "SvcForbiddenError" && (k == null || k.open({
19
19
  title: l.title,
20
20
  message: l.message,
21
21
  type: "error"
22
22
  }));
23
23
  }), {
24
24
  async readStockBalance() {
25
- const l = r.currentLocationDBName, a = `${c.inventoryBackendUrl}/${l}/stock-balance`;
26
- return await d.get(a);
25
+ const l = r.currentLocationDBName, a = `${d.inventoryBackendUrl}/${l}/stock-balance`;
26
+ return await u.get(a);
27
27
  },
28
28
  async readSkuBalance() {
29
- var g;
30
- const l = r.currentLocationDBName, a = `${c.inventoryBackendUrl}/${l}/sku/balance`;
31
- return (((g = s.currentBusiness.value) == null ? void 0 : g.menuVersion) ?? "") === "v3" ? await d.get(a) : await d.get(`${a}?useInventoryDoc=true`);
29
+ var b;
30
+ const l = r.currentLocationDBName, a = `${d.inventoryBackendUrl}/${l}/sku/balance`;
31
+ return (((b = s.currentBusiness.value) == null ? void 0 : b.menuVersion) ?? "") === "v3" ? await u.get(a) : await u.get(`${a}?useInventoryDoc=true`);
32
32
  },
33
33
  async readSingleAdjustment(l) {
34
- const a = r.currentLocationDBName, i = `${c.inventoryBackendUrl}/${a}/adjustment`;
35
- return await d.get(`${i}?adjustmentId=${l}`);
34
+ const a = r.currentLocationDBName, i = `${d.inventoryBackendUrl}/${a}/adjustment`;
35
+ return await u.get(`${i}?adjustmentId=${l}`);
36
36
  },
37
37
  async readStockAdjustment(l, a, i) {
38
- const g = r.currentLocationDBName, k = `${c.inventoryBackendUrl}/${g}/sku`;
39
- return await d.get(`${k}?skuId=${l}&start=${a}&end=${i}`);
38
+ const b = r.currentLocationDBName, h = `${d.inventoryBackendUrl}/${b}/sku`;
39
+ return await u.get(`${h}?skuId=${l}&start=${a}&end=${i}`);
40
40
  },
41
41
  async convertSku(l) {
42
- var k;
43
- const a = r.currentLocationDBName, i = `${c.inventoryBackendUrl}/${a}/sku/convert`;
44
- return (((k = s.currentBusiness.value) == null ? void 0 : k.menuVersion) ?? "") === "v3" ? await d.post(i, l) : await d.post(`${i}?useInventoryDoc=true`, l);
42
+ var h;
43
+ const a = r.currentLocationDBName, i = `${d.inventoryBackendUrl}/${a}/sku/convert`;
44
+ return (((h = s.currentBusiness.value) == null ? void 0 : h.menuVersion) ?? "") === "v3" ? await u.post(i, l) : await u.post(`${i}?useInventoryDoc=true`, l);
45
45
  },
46
46
  async adjustSku(l) {
47
- var k;
48
- const a = r.currentLocationDBName, i = `${c.inventoryBackendUrl}/${a}/sku/adjust`;
49
- return (((k = s.currentBusiness.value) == null ? void 0 : k.menuVersion) ?? "") === "v3" ? await d.post(i, l) : await d.post(`${i}?useInventoryDoc=true`, l);
47
+ var h;
48
+ const a = r.currentLocationDBName, i = `${d.inventoryBackendUrl}/${a}/sku/adjust`;
49
+ return (((h = s.currentBusiness.value) == null ? void 0 : h.menuVersion) ?? "") === "v3" ? await u.post(i, l) : await u.post(`${i}?useInventoryDoc=true`, l);
50
50
  },
51
51
  recalculation: {
52
52
  getRecalculateAbility() {
53
- var g;
54
- const a = `business_${(g = s.currentBusiness.value) == null ? void 0 : g._id}`, i = `${c.inventoryBackendUrl}/${a}/stock/operations/recalculate`;
55
- return d.get(i);
53
+ var b;
54
+ const a = `business_${(b = s.currentBusiness.value) == null ? void 0 : b._id}`, i = `${d.inventoryBackendUrl}/${a}/stock/operations/recalculate`;
55
+ return u.get(i);
56
56
  },
57
57
  startRecalculateTask() {
58
- var g;
59
- const a = `business_${(g = s.currentBusiness.value) == null ? void 0 : g._id}`, i = `${c.inventoryBackendUrl}/${a}/stock/operations/recalculate?refundFromPreviousAdjustment=true`;
60
- return d.post(i);
58
+ var b;
59
+ const a = `business_${(b = s.currentBusiness.value) == null ? void 0 : b._id}`, i = `${d.inventoryBackendUrl}/${a}/stock/operations/recalculate?refundFromPreviousAdjustment=true`;
60
+ return u.post(i);
61
61
  }
62
62
  }
63
63
  };
64
64
  });
65
- function Lt() {
65
+ function Nt() {
66
66
  return {
67
67
  stockBalance: {
68
68
  _id: "",
@@ -71,40 +71,58 @@ function Lt() {
71
71
  productBalance: []
72
72
  };
73
73
  }
74
- const _e = H(Lt()), He = () => {
75
- const c = $e();
74
+ const _e = H(Nt()), He = () => {
75
+ const d = we();
76
76
  return {
77
77
  // state
78
78
  get stockBalance() {
79
79
  return _e.value.stockBalance;
80
80
  },
81
- set stockBalance(d) {
82
- _e.value.stockBalance = d;
81
+ set stockBalance(u) {
82
+ _e.value.stockBalance = u;
83
83
  },
84
84
  get productBalance() {
85
85
  return _e.value.productBalance;
86
86
  },
87
- set productBalance(d) {
88
- _e.value.productBalance = d;
87
+ set productBalance(u) {
88
+ _e.value.productBalance = u;
89
89
  },
90
90
  // actions
91
91
  async readStockBalance() {
92
- this.stockBalance = await c.readStockBalance();
92
+ this.stockBalance = await d.readStockBalance();
93
93
  },
94
94
  async readProductBalance() {
95
- this.productBalance = await c.readSkuBalance();
95
+ this.productBalance = [];
96
+ const u = $e(), r = vt({
97
+ recipes: u.recipes,
98
+ skus: u.skus,
99
+ inventoryBindingMapping: {},
100
+ stockBalance: this.stockBalance
101
+ // silent: true
102
+ });
103
+ function s(k, l) {
104
+ return Object.prototype.hasOwnProperty.call(k, l);
105
+ }
106
+ for (const k in r.convertCountdown)
107
+ if (s(r.convertCountdown, k)) {
108
+ const l = r.convertCountdown[k];
109
+ this.productBalance.push({
110
+ id: k,
111
+ count: l
112
+ });
113
+ }
96
114
  }
97
115
  };
98
116
  };
99
- var ke = /* @__PURE__ */ ((c) => (c.History = "History", c.Convert = "Convert", c.Adjust = "Adjust", c))(ke || {});
100
- const Nt = [
117
+ var ke = /* @__PURE__ */ ((d) => (d.History = "History", d.Convert = "Convert", d.Adjust = "Adjust", d))(ke || {});
118
+ const Ot = [
101
119
  {
102
120
  translationKey: "inventory.stock.action.history",
103
121
  color: "text-neutral-700",
104
122
  value: "History"
105
123
  /* History */
106
124
  }
107
- ], Ot = [
125
+ ], zt = [
108
126
  {
109
127
  translationKey: "inventory.stock.action.history",
110
128
  color: "text-neutral-700",
@@ -124,16 +142,16 @@ const Nt = [
124
142
  /* Adjust */
125
143
  }
126
144
  ];
127
- async function zt(c) {
145
+ async function Yt(d) {
128
146
  const r = `${(ue().currentLocation.name || "").replace(
129
147
  / /g,
130
148
  "_"
131
- )}_${vt().format("DD_MM_YYYY_HHmm")}.xlsx`;
132
- await Pt(
149
+ )}_${ft().format("DD_MM_YYYY_HHmm")}.xlsx`;
150
+ await Tt(
133
151
  [
134
152
  {
135
153
  name: "stock",
136
- data: c,
154
+ data: d,
137
155
  columns: [
138
156
  {
139
157
  name: "Code",
@@ -146,16 +164,16 @@ async function zt(c) {
146
164
  {
147
165
  name: "Balance",
148
166
  selector: (s) => {
149
- const S = Se(s, s.unit);
150
- return S.type === "unit" ? xe(s.balance, s.unit, null, !1) : xe(s.balance, s.unit, S.measurement, !1);
167
+ const k = Se(s, s.unit);
168
+ return k.type === "unit" ? xe(s.balance, s.unit, null, !1) : xe(s.balance, s.unit, k.measurement, !1);
151
169
  }
152
170
  },
153
171
  {
154
172
  name: "Unit",
155
173
  selector: (s) => {
156
174
  var l;
157
- const S = Se(s, s.unit);
158
- return S.type === "unit" ? s.unit.abbrev : ((l = s.unit.measurements.find((a) => a.id === S.measurement)) == null ? void 0 : l.abbrev) || "";
175
+ const k = Se(s, s.unit);
176
+ return k.type === "unit" ? s.unit.abbrev : ((l = s.unit.measurements.find((a) => a.id === k.measurement)) == null ? void 0 : l.abbrev) || "";
159
177
  }
160
178
  }
161
179
  ]
@@ -164,23 +182,23 @@ async function zt(c) {
164
182
  r
165
183
  );
166
184
  }
167
- function Se(c, d) {
168
- const r = localStorage.getItem(`uom:${c._id}`);
169
- return r ? r === d._id ? {
185
+ function Se(d, u) {
186
+ const r = localStorage.getItem(`uom:${d._id}`);
187
+ return r ? r === u._id ? {
170
188
  type: "unit"
171
- } : d.measurements.find((s) => s.id === r) ? {
189
+ } : u.measurements.find((s) => s.id === r) ? {
172
190
  type: "measurement",
173
191
  measurement: r
174
192
  } : {
175
193
  type: "unit"
176
- } : c.trackingMeasurement && d.measurements.find((s) => s.id === c.trackingMeasurement) ? {
194
+ } : d.trackingMeasurement && u.measurements.find((s) => s.id === d.trackingMeasurement) ? {
177
195
  type: "measurement",
178
- measurement: c.trackingMeasurement
196
+ measurement: d.trackingMeasurement
179
197
  } : {
180
198
  type: "unit"
181
199
  };
182
200
  }
183
- const Yt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ re({
201
+ const Kt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ re({
184
202
  __name: "UnitDisplayControl",
185
203
  props: {
186
204
  unit: {},
@@ -188,102 +206,102 @@ const Yt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ r
188
206
  amount: {},
189
207
  defaultTrackingMeasurement: {}
190
208
  },
191
- setup(c) {
192
- function d(k) {
193
- return `uom:${k._id}`;
209
+ setup(d) {
210
+ function u(h) {
211
+ return `uom:${h._id}`;
194
212
  }
195
- function r(k) {
196
- const u = d(s.sku);
197
- k ? localStorage.setItem(u, k) : localStorage.setItem(u, s.unit._id), S.value = Se(s.sku, s.unit);
213
+ function r(h) {
214
+ const c = u(s.sku);
215
+ h ? localStorage.setItem(c, h) : localStorage.setItem(c, s.unit._id), k.value = Se(s.sku, s.unit);
198
216
  }
199
- const s = c, S = H(Se(s.sku, s.unit)), l = U(() => {
200
- const { measurements: k } = s.unit;
217
+ const s = d, k = H(Se(s.sku, s.unit)), l = U(() => {
218
+ const { measurements: h } = s.unit;
201
219
  return [
202
220
  {
203
221
  label: `${xe(s.amount, s.unit)}`,
204
222
  value: null
205
223
  },
206
- ...k.map(({ id: u }) => ({
207
- label: `${xe(s.amount, s.unit, u)}`,
208
- value: u
224
+ ...h.map(({ id: c }) => ({
225
+ label: `${xe(s.amount, s.unit, c)}`,
226
+ value: c
209
227
  }))
210
228
  ];
211
229
  });
212
- function a({ value: k }) {
213
- return v(S).type === "unit" ? k === null : k === v(S).measurement;
230
+ function a({ value: h }) {
231
+ return v(k).type === "unit" ? h === null : h === v(k).measurement;
214
232
  }
215
233
  const i = U(
216
234
  () => {
217
- var k;
218
- return ((k = l.value.find((u) => a(u))) == null ? void 0 : k.label) ?? "";
235
+ var h;
236
+ return ((h = l.value.find((c) => a(c))) == null ? void 0 : h.label) ?? "";
219
237
  }
220
- ), g = H(!1);
221
- return (k, u) => {
222
- const o = M("FmIcon"), $ = M("FmMenuItem"), F = M("FmMenu");
238
+ ), b = H(!1);
239
+ return (h, c) => {
240
+ const o = M("FmIcon"), w = M("FmMenuItem"), F = M("FmMenu");
223
241
  return B(), O(F, {
224
242
  "stop-click-propagation": "",
225
- onMenuChanged: u[0] || (u[0] = (h) => g.value = h)
243
+ onMenuChanged: c[0] || (c[0] = (g) => b.value = g)
226
244
  }, {
227
245
  "menu-button": D(() => [
228
246
  n("button", {
229
247
  type: "button",
230
248
  class: he([
231
249
  "w-full text-left flex items-center gap-8 cursor-pointer fm-corner-radius-sm px-8 py-4 border bg-white",
232
- g.value ? "border-fm-color-primary" : "border-fm-color-neutral-gray-100"
250
+ b.value ? "border-fm-color-primary" : "border-fm-color-neutral-gray-100"
233
251
  ])
234
252
  }, [
235
- n("div", Yt, b(i.value), 1),
236
- x(o, {
253
+ n("div", Kt, x(i.value), 1),
254
+ S(o, {
237
255
  class: "text-fm-color-neutral-gray-400",
238
256
  name: "expand_more"
239
257
  })
240
258
  ], 2)
241
259
  ]),
242
260
  default: D(() => [
243
- (B(!0), L(ne, null, ae(l.value, (h) => (B(), O($, {
244
- key: h.value ?? 0,
245
- label: h.label,
246
- "model-value": a(h),
247
- onClick: (p) => r(h.value)
261
+ (B(!0), L(ne, null, ae(l.value, (g) => (B(), O(w, {
262
+ key: g.value ?? 0,
263
+ label: g.label,
264
+ "model-value": a(g),
265
+ onClick: (p) => r(g.value)
248
266
  }, null, 8, ["label", "model-value", "onClick"]))), 128))
249
267
  ]),
250
268
  _: 1
251
269
  });
252
270
  };
253
271
  }
254
- }), Kt = { class: "whitespace-nowrap" }, Gt = /* @__PURE__ */ re({
272
+ }), Gt = { class: "whitespace-nowrap" }, qt = /* @__PURE__ */ re({
255
273
  __name: "StockHeaderPreview",
256
- setup(c) {
257
- const { t: d } = le();
258
- return (r, s) => (B(), O(Tt, null, {
274
+ setup(d) {
275
+ const { t: u } = le();
276
+ return (r, s) => (B(), O(Rt, null, {
259
277
  default: D(() => [
260
- n("div", Kt, b(v(d)("inventory.stock.prediction.daysRemaining")), 1)
278
+ n("div", Gt, x(v(u)("inventory.stock.prediction.daysRemaining")), 1)
261
279
  ]),
262
280
  _: 1
263
281
  }));
264
282
  }
265
- }), lt = Rt("stockActions", () => {
266
- const c = H(!1), d = ue(), r = He(), s = at(), S = de(), l = nt(), { t: a } = le();
283
+ }), lt = Ht("stockActions", () => {
284
+ const d = H(!1), u = ue(), r = He(), s = at(), k = de(), l = nt(), { t: a } = le();
267
285
  async function i() {
268
- if (d._currentLocation) {
269
- c.value = !0;
286
+ if (u._currentLocation) {
287
+ d.value = !0;
270
288
  try {
271
289
  await r.readStockBalance(), await r.readProductBalance(), await s.readStockEstimateBalance();
272
290
  } catch {
273
- S.open({
291
+ k.open({
274
292
  title: a("inventory.stock.error.title"),
275
293
  message: a("inventory.stock.error.message"),
276
294
  type: "error"
277
295
  });
278
296
  } finally {
279
- c.value = !1;
297
+ d.value = !1;
280
298
  }
281
299
  }
282
300
  }
283
- const g = H();
284
- async function k(p) {
285
- var w, C, P;
286
- if (!!!((C = (w = p.convert) == null ? void 0 : w.inventoryBindings) != null && C.length)) {
301
+ const b = H();
302
+ async function h(p) {
303
+ var $, C, P;
304
+ if (!!!((C = ($ = p.convert) == null ? void 0 : $.inventoryBindings) != null && C.length)) {
287
305
  l.open({
288
306
  title: a("inventory.stock.error.convert.title"),
289
307
  message: a("inventory.stock.error.convert.message")
@@ -295,47 +313,47 @@ const Yt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ r
295
313
  sku: p,
296
314
  show: !0,
297
315
  "onUpdate:show"(T) {
298
- g.value.show = T;
316
+ b.value.show = T;
299
317
  },
300
318
  onSubmitted() {
301
319
  i();
302
320
  }
303
321
  };
304
- g.value = V;
322
+ b.value = V;
305
323
  }
306
- const u = H();
324
+ const c = H();
307
325
  async function o(p) {
308
326
  const j = {
309
327
  stock: p,
310
328
  show: !0,
311
329
  "onUpdate:show"(E) {
312
- u.value.show = E;
330
+ c.value.show = E;
313
331
  },
314
332
  onSubmitted() {
315
333
  i();
316
334
  }
317
335
  };
318
- u.value = j;
336
+ c.value = j;
319
337
  }
320
- const $ = H();
338
+ const w = H();
321
339
  async function F(p) {
322
340
  const j = {
323
341
  sku: p,
324
342
  show: !0,
325
343
  "onUpdate:show"(E) {
326
- $.value.show = E;
344
+ w.value.show = E;
327
345
  }
328
346
  };
329
- $.value = j;
347
+ w.value = j;
330
348
  }
331
- function h(p, j) {
332
- const E = Pe(j);
349
+ function g(p, j) {
350
+ const E = Te(j);
333
351
  switch (p) {
334
352
  case ke.History:
335
353
  F(E);
336
354
  return;
337
355
  case ke.Convert:
338
- k(E);
356
+ h(E);
339
357
  return;
340
358
  case ke.Adjust:
341
359
  o(E);
@@ -344,15 +362,15 @@ const Yt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ r
344
362
  }
345
363
  return {
346
364
  fetchStockBalance: i,
347
- onActionMenu: h,
348
- stockHistoryProps: $,
365
+ onActionMenu: g,
366
+ stockHistoryProps: w,
349
367
  showSkuHistory: F,
350
- convertSkuDialogProps: g,
351
- adjustSkuDialogProps: u
368
+ convertSkuDialogProps: b,
369
+ adjustSkuDialogProps: c
352
370
  };
353
371
  });
354
- function qt() {
355
- const c = ue(), d = lt(), { t: r } = le();
372
+ function Wt() {
373
+ const d = ue(), u = lt(), { t: r } = le();
356
374
  return {
357
375
  columnDefs: [
358
376
  {
@@ -370,8 +388,8 @@ function qt() {
370
388
  {
371
389
  id: "UOM",
372
390
  header: () => r("inventory.stock.balance"),
373
- cell(S) {
374
- const l = S.row.original, a = {
391
+ cell(k) {
392
+ const l = k.row.original, a = {
375
393
  unit: l.unit,
376
394
  sku: l,
377
395
  amount: l.balance,
@@ -384,31 +402,31 @@ function qt() {
384
402
  {
385
403
  accessorKey: "day",
386
404
  id: "expireDate",
387
- header: () => ye(Gt),
405
+ header: () => ye(qt),
388
406
  enableSorting: !0,
389
407
  sortUndefined: "last",
390
- cell(S) {
391
- var u, o;
392
- const l = S.row.original.day, a = (u = S.row.original.thresholds) == null ? void 0 : u.low, i = (o = S.row.original.thresholds) == null ? void 0 : o.mid;
408
+ cell(k) {
409
+ var c, o;
410
+ const l = k.row.original.day, a = (c = k.row.original.thresholds) == null ? void 0 : c.low, i = (o = k.row.original.thresholds) == null ? void 0 : o.mid;
393
411
  if (typeof l != "number" || typeof a != "number" || typeof i != "number")
394
- return ye(Ie, {
412
+ return ye(Ue, {
395
413
  days: l
396
414
  });
397
- const g = l <= a ? Ae.low : l <= i ? Ae.mid : Ae.high;
398
- return ye(Ie, {
415
+ const b = l <= a ? Ve.low : l <= i ? Ve.mid : Ve.high;
416
+ return ye(Ue, {
399
417
  days: l,
400
- level: g
418
+ level: b
401
419
  });
402
420
  },
403
421
  size: 200
404
422
  },
405
423
  {
406
424
  id: "action",
407
- cell(S) {
425
+ cell(k) {
408
426
  var l;
409
- return It(
410
- ((l = c._currentLocation) == null ? void 0 : l.type) === "restaurant" ? Nt : Ot,
411
- (a) => d.onActionMenu(a, S.row.original)
427
+ return Ut(
428
+ ((l = d._currentLocation) == null ? void 0 : l.type) === "restaurant" ? Ot : zt,
429
+ (a) => u.onActionMenu(a, k.row.original)
412
430
  );
413
431
  },
414
432
  enableSorting: !1,
@@ -421,44 +439,44 @@ function qt() {
421
439
  ]
422
440
  };
423
441
  }
424
- const Wt = {
442
+ const Jt = {
425
443
  context: null,
426
444
  error: null,
427
- isRequired(c = "This field is required") {
428
- return `${this.context ?? ""}`.length === 0 && (this.error = c), this;
445
+ isRequired(d = "This field is required") {
446
+ return `${this.context ?? ""}`.length === 0 && (this.error = d), this;
429
447
  },
430
- isString(c = "Must be a valid string") {
431
- return this.error ? this : (typeof this.context != "string" && (this.error ?? (this.error = c)), this);
448
+ isString(d = "Must be a valid string") {
449
+ return this.error ? this : (typeof this.context != "string" && (this.error ?? (this.error = d)), this);
432
450
  },
433
451
  toInt() {
434
452
  return this.error ? this : (this.context = +this.context, this);
435
453
  },
436
- isInteger(c = "Must be an integer") {
437
- return this.error ? this : (this.toInt(), isNaN(this.context) && (this.error = c), this);
454
+ isInteger(d = "Must be an integer") {
455
+ return this.error ? this : (this.toInt(), isNaN(this.context) && (this.error = d), this);
438
456
  },
439
- min(c, d) {
457
+ min(d, u) {
440
458
  if (this.error) return this;
441
459
  try {
442
- typeof this.context == "number" ? +this.context < c && (this.error = d ?? `Must be at least ${c}`) : Object.prototype.hasOwnProperty.call(this.context, "length") ? +this.context.length < c && (this.error = d ?? `Must be at least ${c}`) : this.error = "Length cannot be determined";
460
+ typeof this.context == "number" ? +this.context < d && (this.error = u ?? `Must be at least ${d}`) : Object.prototype.hasOwnProperty.call(this.context, "length") ? +this.context.length < d && (this.error = u ?? `Must be at least ${d}`) : this.error = "Length cannot be determined";
443
461
  } catch {
444
462
  this.error = "Length cannot be determined";
445
463
  }
446
464
  return this;
447
465
  },
448
- max(c, d) {
466
+ max(d, u) {
449
467
  if (this.error) return this;
450
468
  try {
451
- typeof this.context == "number" ? +this.context > c && (this.error = d ?? `Must be at most ${c}`) : "length" in this.context ? +this.context.length > c && (this.error = d ?? `Must be at most ${c}`) : this.error = "Length cannot be determined";
469
+ typeof this.context == "number" ? +this.context > d && (this.error = u ?? `Must be at most ${d}`) : "length" in this.context ? +this.context.length > d && (this.error = u ?? `Must be at most ${d}`) : this.error = "Length cannot be determined";
452
470
  } catch {
453
471
  this.error = "Length cannot be determined";
454
472
  }
455
473
  return this;
456
474
  }
457
475
  };
458
- function qe(c) {
459
- return { ...Wt, context: c };
476
+ function qe(d) {
477
+ return { ...Jt, context: d };
460
478
  }
461
- const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-800" }, Xt = { class: "flex flex-col gap-24 w-full" }, Zt = { class: "flex flex-col gap-8" }, en = { class: "fm-typo-en-body-lg-600" }, tn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary flex-grow" }, nn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-error" }, on = { class: "flex flex-col p-16 gap-8" }, sn = { class: "flex flex-col gap-4" }, an = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 border-b py-12 px-16" }, rn = { class: "grid grid-cols-[auto_100px_100px_48px] xs:grid-cols-[auto_80px_120px_48px] gap-8 px-8 items-center" }, ln = { class: "xs:col-span-3" }, un = { class: "flex gap-8" }, cn = /* @__PURE__ */ re({
479
+ const Qt = { class: "flex items-center" }, Xt = { class: "fm-typo-en-title-md-800" }, Zt = { class: "flex flex-col gap-24 w-full" }, en = { class: "flex flex-col gap-8" }, tn = { class: "fm-typo-en-body-lg-600" }, nn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary flex-grow" }, on = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-error" }, sn = { class: "flex flex-col p-16 gap-8" }, an = { class: "flex flex-col gap-4" }, rn = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 border-b py-12 px-16" }, ln = { class: "grid grid-cols-[auto_100px_100px_48px] xs:grid-cols-[auto_80px_120px_48px] gap-8 px-8 items-center" }, un = { class: "xs:col-span-3" }, cn = { class: "flex gap-8" }, dn = /* @__PURE__ */ re({
462
480
  __name: "ConvertSkuDialog",
463
481
  props: {
464
482
  sku: {},
@@ -466,27 +484,27 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
466
484
  show: { type: Boolean }
467
485
  },
468
486
  emits: ["update:show", "submitted"],
469
- setup(c, { expose: d, emit: r }) {
470
- const s = c, S = r, l = ft(), a = Te(), i = $e(), g = de(), { t: k } = le(), u = H(0), o = H(null), $ = U(() => a.skus), F = U(
487
+ setup(d, { expose: u, emit: r }) {
488
+ const s = d, k = r, l = yt(), a = $e(), i = we(), b = de(), { t: h } = le(), c = H(0), o = H(null), w = U(() => a.skus), F = U(
471
489
  () => {
472
490
  var t, e;
473
491
  return (((e = (t = s.sku) == null ? void 0 : t.convert) == null ? void 0 : e.inventoryBindings) ?? []).filter(
474
492
  (f) => f.type === Oe.enum.SKU
475
493
  );
476
494
  }
477
- ), h = U({
495
+ ), g = U({
478
496
  get() {
479
497
  return !!o.value;
480
498
  },
481
499
  set(t) {
482
- t ? o.value = Pe(F.value) : (o.value = null, u.value = Math.min(u.value, s.maxCount ?? 0));
500
+ t ? o.value = Te(F.value) : (o.value = null, c.value = Math.min(c.value, s.maxCount ?? 0));
483
501
  }
484
502
  }), p = H(!1);
485
503
  ge([() => s.show], ([t]) => {
486
- t && (u.value = 0);
504
+ t && (c.value = 0);
487
505
  });
488
506
  function j() {
489
- Q(s.sku, be(u.value), o.value);
507
+ Q(s.sku, be(c.value), o.value);
490
508
  }
491
509
  function E(t) {
492
510
  if (o.value)
@@ -499,10 +517,10 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
499
517
  const e = (y = s.sku.convert) != null && y.measurement ? s.sku.unit.measurements.find((A) => {
500
518
  var z;
501
519
  return A.id === ((z = s.sku.convert) == null ? void 0 : z.measurement);
502
- }) ?? null : null, f = De(s.sku.unit, e), m = ht(+t);
520
+ }) ?? null : null, f = Me(s.sku.unit, e), m = gt(+t);
503
521
  return qe(m).isInteger().max(f).error ? "Precision cannot be more than " + f : !0;
504
522
  }
505
- const w = U(
523
+ const $ = U(
506
524
  () => {
507
525
  var t, e;
508
526
  return (t = s.sku.convert) != null && t.measurement ? (e = s.sku.unit.measurements.find((f) => {
@@ -518,10 +536,10 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
518
536
  const A = a.skus.find((pe) => pe._id === y.id), z = ((Z = y.measurement) == null ? void 0 : Z.abbrev) ?? ((q = A == null ? void 0 : A.unit) == null ? void 0 : q.abbrev), X = (se = s.sku.convert) != null && se.measurement ? s.sku.unit.measurements.find((pe) => {
519
537
  var Ne;
520
538
  return pe.id === ((Ne = s.sku.convert) == null ? void 0 : Ne.measurement);
521
- }) ?? null : null, me = De(s.sku.unit, X), I = V(`${u.value}`) === !0 ? ie(
522
- yt(
539
+ }) ?? null : null, me = Me(s.sku.unit, X), I = V(`${c.value}`) === !0 ? ie(
540
+ _t(
523
541
  y.amount,
524
- be(+u.value, me)
542
+ be(+c.value, me)
525
543
  ),
526
544
  !1
527
545
  ) : "0", G = (Le = (Ee = o.value) == null ? void 0 : Ee.find((pe) => pe.id === (A == null ? void 0 : A._id))) == null ? void 0 : Le.amount, J = G ? ie(G, !1) : null;
@@ -532,7 +550,7 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
532
550
  };
533
551
  });
534
552
  }), P = H();
535
- d({
553
+ u({
536
554
  validateInputs: () => {
537
555
  var t, e;
538
556
  (e = (t = P.value) == null ? void 0 : t.validateInputs) == null || e.call(t);
@@ -565,9 +583,9 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
565
583
  }))
566
584
  }
567
585
  ]
568
- }), S("update:show", !1), S("submitted");
586
+ }), k("update:show", !1), k("submitted");
569
587
  } catch (m) {
570
- g.open({
588
+ b.open({
571
589
  title: "Something went wrong",
572
590
  message: `Cannot convert ${t.name}. Please try again.`,
573
591
  type: "error"
@@ -582,7 +600,7 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
582
600
  e.length > 0 && isFinite(m) ? _ = f.map((y) => (y.id !== t || (y.amount = fe(m)), y)) : _ = f.map((y) => (y.id !== t || (y.amount = { amount: 0, precision: 0 }), y)), o.value = _;
583
601
  }
584
602
  function N(t) {
585
- const e = $.value.find((f) => f._id === t);
603
+ const e = w.value.find((f) => f._id === t);
586
604
  return e ? st(e.unit, !0) : [];
587
605
  }
588
606
  function R(t, e) {
@@ -597,7 +615,7 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
597
615
  if (e === null)
598
616
  m = f.map((_) => (_.id !== t || (_.measurement = null), _)) ?? [];
599
617
  else {
600
- const _ = $.value.find((y) => y._id === t);
618
+ const _ = w.value.find((y) => y._id === t);
601
619
  m = f.map((y) => {
602
620
  var A, z;
603
621
  return y.id !== t || (y.measurement = (z = (A = _ == null ? void 0 : _.unit) == null ? void 0 : A.measurements) == null ? void 0 : z.find((X) => X.id === e)), y;
@@ -623,97 +641,97 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
623
641
  return ge(
624
642
  () => s.show,
625
643
  (t) => {
626
- t || (o.value = null, u.value = 0);
644
+ t || (o.value = null, c.value = 0);
627
645
  }
628
646
  ), (t, e) => {
629
647
  const f = M("FmTextField"), m = M("FmForm"), _ = M("FmCard"), y = M("FmSwitch"), A = M("FmFormGroup"), z = M("FmSelect"), X = M("FmButton"), me = M("FmSideSheet");
630
648
  return B(), O(me, {
631
649
  "dismiss-away": "",
632
650
  modelValue: v(T),
633
- "onUpdate:modelValue": e[3] || (e[3] = (I) => Ue(T) ? T.value = I : null),
651
+ "onUpdate:modelValue": e[3] || (e[3] = (I) => Pe(T) ? T.value = I : null),
634
652
  "max-width": 500
635
653
  }, {
636
654
  "side-sheet-header": D(() => [
637
- n("div", Jt, [
638
- n("div", Qt, b(v(k)("inventory.stock.convert.title", { name: t.sku.name })), 1)
655
+ n("div", Qt, [
656
+ n("div", Xt, x(v(h)("inventory.stock.convert.title", { name: t.sku.name })), 1)
639
657
  ])
640
658
  ]),
641
659
  default: D(() => [
642
- n("div", Xt, [
643
- x(m, {
660
+ n("div", Zt, [
661
+ S(m, {
644
662
  ref_key: "formRef",
645
663
  ref: P,
646
664
  onValidationSuccess: j
647
665
  }, {
648
666
  default: D(() => [
649
- x(f, {
667
+ S(f, {
650
668
  disabled: p.value,
651
- "model-value": u.value,
652
- "onUpdate:modelValue": e[0] || (e[0] = (I) => u.value = I),
653
- label: v(k)("inventory.stock.convert.amount"),
654
- rules: [E, V, v(Me)(0)],
655
- "append-text": w.value,
656
- "helper-text": o.value ? void 0 : `Max ${t.maxCount} ${w.value}`
669
+ "model-value": c.value,
670
+ "onUpdate:modelValue": e[0] || (e[0] = (I) => c.value = I),
671
+ label: v(h)("inventory.stock.convert.amount"),
672
+ rules: [E, V, v(je)(0)],
673
+ "append-text": $.value,
674
+ "helper-text": o.value ? void 0 : `Max ${t.maxCount} ${$.value}`
657
675
  }, null, 8, ["disabled", "model-value", "label", "rules", "append-text", "helper-text"])
658
676
  ]),
659
677
  _: 1
660
678
  }, 512),
661
- x(_, {
679
+ S(_, {
662
680
  variant: "outlined",
663
681
  class: "p-16"
664
682
  }, {
665
683
  default: D(() => [
666
- n("div", Zt, [
667
- n("div", en, b(v(k)("inventory.stock.convert.deductionSummary")), 1),
684
+ n("div", en, [
685
+ n("div", tn, x(v(h)("inventory.stock.convert.deductionSummary")), 1),
668
686
  (B(!0), L(ne, null, ae(C.value, (I) => {
669
687
  var G, J;
670
688
  return B(), L("div", {
671
689
  key: (G = I.sku) == null ? void 0 : G._id,
672
690
  class: "flex items-center"
673
691
  }, [
674
- n("div", tn, b((J = I.sku) == null ? void 0 : J.name), 1),
675
- n("div", nn, " -" + b(I.convertAmount) + " " + b(I.abbrev), 1)
692
+ n("div", nn, x((J = I.sku) == null ? void 0 : J.name), 1),
693
+ n("div", on, " -" + x(I.convertAmount) + " " + x(I.abbrev), 1)
676
694
  ]);
677
695
  }), 128))
678
696
  ])
679
697
  ]),
680
698
  _: 1
681
699
  }),
682
- x(_, { variant: "outlined" }, {
700
+ S(_, { variant: "outlined" }, {
683
701
  default: D(() => [
684
- n("div", on, [
685
- x(y, {
702
+ n("div", sn, [
703
+ S(y, {
686
704
  value: "",
687
- modelValue: h.value,
688
- "onUpdate:modelValue": e[1] || (e[1] = (I) => h.value = I),
689
- label: v(k)("inventory.stock.convert.overrideDeduction"),
705
+ modelValue: g.value,
706
+ "onUpdate:modelValue": e[1] || (e[1] = (I) => g.value = I),
707
+ label: v(h)("inventory.stock.convert.overrideDeduction"),
690
708
  "label-placement": "right"
691
709
  }, null, 8, ["modelValue", "label"]),
692
- h.value ? (B(), L(ne, { key: 0 }, [
693
- x(A, {
710
+ g.value ? (B(), L(ne, { key: 0 }, [
711
+ S(A, {
694
712
  modelValue: o.value,
695
- rules: [v(_t)(1, "Must have at least one ingredient binding")]
713
+ rules: [v(kt)(1, "Must have at least one ingredient binding")]
696
714
  }, null, 8, ["modelValue", "rules"]),
697
- n("div", sn, [
698
- n("div", an, b(v(k)("inventory.stock.convert.ingredients")), 1),
715
+ n("div", an, [
716
+ n("div", rn, x(v(h)("inventory.stock.convert.ingredients")), 1),
699
717
  (B(!0), L(ne, null, ae(o.value, (I) => (B(), O(A, {
700
718
  key: I.id,
701
719
  disabled: p.value,
702
720
  modelValue: +v(ie)(I.amount ?? { amount: 1, precision: 0 }),
703
721
  rules: [
704
- v(kt)(
705
- $.value.find((G) => G._id === I.id).unit,
722
+ v(ht)(
723
+ w.value.find((G) => G._id === I.id).unit,
706
724
  I.measurement
707
725
  ),
708
- v(Me)(0)
726
+ v(je)(0)
709
727
  ]
710
728
  }, {
711
729
  default: D(({ invalid: G }) => {
712
730
  var J, Z, q;
713
731
  return [
714
- n("div", rn, [
715
- n("div", ln, b((J = $.value.find((se) => se._id === I.id)) == null ? void 0 : J.name), 1),
716
- x(f, {
732
+ n("div", ln, [
733
+ n("div", un, x((J = w.value.find((se) => se._id === I.id)) == null ? void 0 : J.name), 1),
734
+ S(f, {
717
735
  class: "xs:col-span-2",
718
736
  disabled: p.value,
719
737
  modelValue: +v(ie)(
@@ -722,7 +740,7 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
722
740
  "onUpdate:modelValue": (se) => Y(I.id, se, o.value ?? []),
723
741
  invalid: G
724
742
  }, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"]),
725
- x(z, {
743
+ S(z, {
726
744
  disabled: p.value,
727
745
  class: "translate-y-[2px]",
728
746
  items: N(I.id),
@@ -733,7 +751,7 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
733
751
  "helper-text": D(() => e[4] || (e[4] = [])),
734
752
  _: 2
735
753
  }, 1032, ["disabled", "items", "model-value", "onUpdate:modelValue", "invalid"]),
736
- x(X, {
754
+ S(X, {
737
755
  disabled: p.value,
738
756
  type: "button",
739
757
  variant: "tertiary",
@@ -747,9 +765,9 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
747
765
  }, 1032, ["disabled", "modelValue", "rules"]))), 128))
748
766
  ]),
749
767
  n("div", null, [
750
- x(X, {
768
+ S(X, {
751
769
  icon: "link",
752
- label: v(k)("inventory.stock.convert.linkIngredient"),
770
+ label: v(h)("inventory.stock.convert.linkIngredient"),
753
771
  variant: "plain",
754
772
  onClick: oe
755
773
  }, null, 8, ["label"])
@@ -762,10 +780,10 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
762
780
  ])
763
781
  ]),
764
782
  "side-sheet-footer": D(() => [
765
- n("div", un, [
766
- x(X, {
783
+ n("div", cn, [
784
+ S(X, {
767
785
  loading: p.value,
768
- label: v(k)("inventory.stock.convert.convertButton"),
786
+ label: v(h)("inventory.stock.convert.convertButton"),
769
787
  onClick: e[2] || (e[2] = (I) => {
770
788
  var G, J;
771
789
  return (J = (G = P.value) == null ? void 0 : G.validateInputs) == null ? void 0 : J.call(G);
@@ -778,25 +796,25 @@ const Jt = { class: "flex items-center" }, Qt = { class: "fm-typo-en-title-md-80
778
796
  };
779
797
  }
780
798
  });
781
- function Ve(c, d) {
782
- const r = be(c, d);
799
+ function Ce(d, u) {
800
+ const r = be(d, u);
783
801
  return { ...r, amount: -r.amount };
784
802
  }
785
- function We(c, d) {
786
- return be(Math.abs(c), d);
803
+ function We(d, u) {
804
+ return be(Math.abs(d), u);
787
805
  }
788
- const Ce = {
806
+ const De = {
789
807
  [ee.enum.DAMAGE]: {
790
808
  label: "Waste",
791
- toAdjustmentAmount: Ve
809
+ toAdjustmentAmount: Ce
792
810
  },
793
811
  [ee.enum.THEFT]: {
794
812
  label: "Theft",
795
- toAdjustmentAmount: Ve
813
+ toAdjustmentAmount: Ce
796
814
  },
797
815
  [ee.enum.LOSE]: {
798
816
  label: "Lose",
799
- toAdjustmentAmount: Ve
817
+ toAdjustmentAmount: Ce
800
818
  },
801
819
  [ee.enum.EXTRA]: {
802
820
  label: "Extra",
@@ -806,120 +824,120 @@ const Ce = {
806
824
  label: "Purchase",
807
825
  toAdjustmentAmount: We
808
826
  }
809
- }, dn = { class: "col-span-2 flex" }, mn = { class: "fm-typo-en-body-lg-600 flex-1" }, pn = /* @__PURE__ */ re({
827
+ }, mn = { class: "col-span-2 flex" }, pn = { class: "fm-typo-en-body-lg-600 flex-1" }, vn = /* @__PURE__ */ re({
810
828
  __name: "AdjustedItemForm",
811
829
  props: {
812
830
  modelValue: {},
813
831
  disabled: { type: Boolean }
814
832
  },
815
833
  emits: ["update:modelValue", "click:delete"],
816
- setup(c, { emit: d }) {
817
- const r = c, s = d, S = U(
818
- () => Object.keys(Ce).map((u) => ({
819
- label: gt(u),
820
- value: u
834
+ setup(d, { emit: u }) {
835
+ const r = d, s = u, k = U(
836
+ () => Object.keys(De).map((c) => ({
837
+ label: bt(c),
838
+ value: c
821
839
  }))
822
840
  ), l = U(() => st(r.modelValue.doc.unit, !0)), a = U({
823
841
  get() {
824
842
  return r.modelValue.type ?? ee.enum.PURCHASE;
825
843
  },
826
- set(u) {
844
+ set(c) {
827
845
  const o = {
828
846
  ...r.modelValue
829
847
  };
830
- o.type = u;
831
- const $ = ze(r.modelValue.amount);
832
- o.amount = Ce[o.type].toAdjustmentAmount(
833
- +ie($),
834
- $.precision
848
+ o.type = c;
849
+ const w = ze(r.modelValue.amount);
850
+ o.amount = De[o.type].toAdjustmentAmount(
851
+ +ie(w),
852
+ w.precision
835
853
  ), s("update:modelValue", o);
836
854
  }
837
855
  }), i = U({
838
856
  get() {
839
- const u = ze(r.modelValue.amount);
840
- return +ie(u);
857
+ const c = ze(r.modelValue.amount);
858
+ return +ie(c);
841
859
  },
842
- set(u) {
860
+ set(c) {
843
861
  const o = {
844
862
  ...r.modelValue
845
- }, $ = fe(u);
846
- o.amount = Ce[a.value].toAdjustmentAmount(
847
- u,
848
- $.precision
863
+ }, w = fe(c);
864
+ o.amount = De[a.value].toAdjustmentAmount(
865
+ c,
866
+ w.precision
849
867
  ), s("update:modelValue", o);
850
868
  }
851
- }), g = U({
869
+ }), b = U({
852
870
  get() {
853
- var u;
854
- return ((u = r.modelValue.measurement) == null ? void 0 : u.id) ?? null;
871
+ var c;
872
+ return ((c = r.modelValue.measurement) == null ? void 0 : c.id) ?? null;
855
873
  },
856
- set(u) {
857
- var $, F;
874
+ set(c) {
875
+ var w, F;
858
876
  const o = {
859
877
  ...r.modelValue
860
878
  };
861
- o.measurement = ((F = ($ = r.modelValue.doc.unit) == null ? void 0 : $.measurements) == null ? void 0 : F.find((h) => h.id === u)) ?? null, s("update:modelValue", o);
879
+ o.measurement = ((F = (w = r.modelValue.doc.unit) == null ? void 0 : w.measurements) == null ? void 0 : F.find((g) => g.id === c)) ?? null, s("update:modelValue", o);
862
880
  }
863
- }), k = U({
881
+ }), h = U({
864
882
  get() {
865
883
  return r.modelValue.remark ?? "";
866
884
  },
867
- set(u) {
885
+ set(c) {
868
886
  const o = {
869
887
  ...r.modelValue
870
888
  };
871
- o.remark = u, s("update:modelValue", o);
889
+ o.remark = c, s("update:modelValue", o);
872
890
  }
873
891
  });
874
- return (u, o) => {
875
- const $ = M("FmButton"), F = M("FmSelect"), h = M("FmTextarea"), p = M("FmCard");
892
+ return (c, o) => {
893
+ const w = M("FmButton"), F = M("FmSelect"), g = M("FmTextarea"), p = M("FmCard");
876
894
  return B(), O(p, {
877
895
  variant: "outlined",
878
896
  class: "grid grid-cols-2 gap-8 p-16"
879
897
  }, {
880
898
  default: D(() => [
881
- n("div", dn, [
882
- n("div", mn, b(u.modelValue.doc.name), 1),
883
- x($, {
899
+ n("div", mn, [
900
+ n("div", pn, x(c.modelValue.doc.name), 1),
901
+ S(w, {
884
902
  variant: "tertiary",
885
903
  "prepend-icon": "delete",
886
904
  onClick: o[0] || (o[0] = (j) => s("click:delete"))
887
905
  })
888
906
  ]),
889
- x(F, {
890
- disabled: u.disabled,
907
+ S(F, {
908
+ disabled: c.disabled,
891
909
  class: "col-span-2",
892
910
  label: "Type",
893
- items: S.value,
911
+ items: k.value,
894
912
  modelValue: a.value,
895
913
  "onUpdate:modelValue": o[1] || (o[1] = (j) => a.value = j),
896
- rules: [v(bt)()],
914
+ rules: [v(xt)()],
897
915
  "label-mark": "required"
898
916
  }, null, 8, ["disabled", "items", "modelValue", "rules"]),
899
- x(Ht, {
900
- disabled: u.disabled,
917
+ S(Et, {
918
+ disabled: c.disabled,
901
919
  label: "Amount",
902
920
  step: +v(ie)({
903
921
  amount: 1,
904
- precision: v(De)(u.modelValue.doc.unit, u.modelValue.measurement)
922
+ precision: v(Me)(c.modelValue.doc.unit, c.modelValue.measurement)
905
923
  }),
906
924
  modelValue: i.value,
907
925
  "onUpdate:modelValue": o[2] || (o[2] = (j) => i.value = j),
908
- rules: [v(Me)(0)]
926
+ rules: [v(je)(0)]
909
927
  }, null, 8, ["disabled", "step", "modelValue", "rules"]),
910
- x(F, {
911
- disabled: u.disabled,
928
+ S(F, {
929
+ disabled: c.disabled,
912
930
  label: "Unit",
913
931
  items: l.value,
914
- modelValue: g.value,
915
- "onUpdate:modelValue": o[3] || (o[3] = (j) => g.value = j)
932
+ modelValue: b.value,
933
+ "onUpdate:modelValue": o[3] || (o[3] = (j) => b.value = j)
916
934
  }, null, 8, ["disabled", "items", "modelValue"]),
917
- x(h, {
935
+ S(g, {
918
936
  class: "col-span-2",
919
- disabled: u.disabled,
937
+ disabled: c.disabled,
920
938
  label: "Remark",
921
- modelValue: k.value,
922
- "onUpdate:modelValue": o[4] || (o[4] = (j) => k.value = j),
939
+ modelValue: h.value,
940
+ "onUpdate:modelValue": o[4] || (o[4] = (j) => h.value = j),
923
941
  "label-mark": "optional"
924
942
  }, null, 8, ["disabled", "modelValue"])
925
943
  ]),
@@ -927,34 +945,34 @@ const Ce = {
927
945
  });
928
946
  };
929
947
  }
930
- }), vn = { class: "flex items-center" }, fn = { class: "fm-typo-en-title-md-800" }, yn = { class: "flex items-center" }, _n = { class: "fm-typo-en-title-sm-800 flex-1" }, kn = { class: "flex gap-8" }, hn = /* @__PURE__ */ re({
948
+ }), fn = { class: "flex items-center" }, yn = { class: "fm-typo-en-title-md-800" }, _n = { class: "flex items-center" }, kn = { class: "fm-typo-en-title-sm-800 flex-1" }, hn = { class: "flex gap-8" }, gn = /* @__PURE__ */ re({
931
949
  __name: "AdjustSkuDialog",
932
950
  props: {
933
951
  stock: {},
934
952
  show: { type: Boolean }
935
953
  },
936
954
  emits: ["update:show", "submitted"],
937
- setup(c, { expose: d, emit: r }) {
938
- const s = c, S = r, l = Te(), a = nt(), i = $e(), g = de(), k = H(!1), { t: u } = le();
955
+ setup(d, { expose: u, emit: r }) {
956
+ const s = d, k = r, l = $e(), a = nt(), i = we(), b = de(), h = H(!1), { t: c } = le();
939
957
  function o() {
940
- p(Pe(h));
958
+ p(Te(g));
941
959
  }
942
- const $ = H();
943
- d({
960
+ const w = H();
961
+ u({
944
962
  validateInputs: () => {
945
- var V, w;
946
- (w = (V = $.value) == null ? void 0 : V.validateInputs) == null || w.call(V);
963
+ var V, $;
964
+ ($ = (V = w.value) == null ? void 0 : V.validateInputs) == null || $.call(V);
947
965
  },
948
966
  resetInputsValidation: () => {
949
- var V, w;
950
- (w = (V = $.value) == null ? void 0 : V.resetInputsValidation) == null || w.call(V);
967
+ var V, $;
968
+ ($ = (V = w.value) == null ? void 0 : V.resetInputsValidation) == null || $.call(V);
951
969
  },
952
970
  resetInputs: () => {
953
- var V, w;
954
- (w = (V = $.value) == null ? void 0 : V.resetInputs) == null || w.call(V);
971
+ var V, $;
972
+ ($ = (V = w.value) == null ? void 0 : V.resetInputs) == null || $.call(V);
955
973
  }
956
974
  });
957
- const F = Re(s, "show"), h = it({
975
+ const F = Re(s, "show"), g = it({
958
976
  remark: "",
959
977
  adjustments: [
960
978
  {
@@ -968,7 +986,7 @@ const Ce = {
968
986
  ]
969
987
  });
970
988
  ge([() => s.show], ([V]) => {
971
- V && (h.remark = "", h.adjustments = [
989
+ V && (g.remark = "", g.adjustments = [
972
990
  {
973
991
  id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
974
992
  type: ee.enum.PURCHASE,
@@ -980,27 +998,27 @@ const Ce = {
980
998
  ]);
981
999
  });
982
1000
  async function p(V) {
983
- k.value = !0;
1001
+ h.value = !0;
984
1002
  try {
985
1003
  await i.adjustSku({
986
1004
  remark: V.remark,
987
- adjustments: V.adjustments.map(({ doc: w, remark: C, type: P, amount: T, measurement: Q }) => ({
988
- id: w._id,
1005
+ adjustments: V.adjustments.map(({ doc: $, remark: C, type: P, amount: T, measurement: Q }) => ({
1006
+ id: $._id,
989
1007
  amount: T,
990
1008
  measurement: Q,
991
1009
  remark: C,
992
- doc: w,
1010
+ doc: $,
993
1011
  type: P
994
1012
  }))
995
- }), S("update:show", !1), S("submitted");
996
- } catch (w) {
997
- g.open({
998
- title: u("inventory.stock.adjust.error.title"),
999
- message: u("inventory.stock.adjust.error.message"),
1013
+ }), k("update:show", !1), k("submitted");
1014
+ } catch ($) {
1015
+ b.open({
1016
+ title: c("inventory.stock.adjust.error.title"),
1017
+ message: c("inventory.stock.adjust.error.message"),
1000
1018
  type: "error"
1001
- }), console.log("error on adjust ingredients", V, w);
1019
+ }), console.log("error on adjust ingredients", V, $);
1002
1020
  } finally {
1003
- k.value = !1;
1021
+ h.value = !1;
1004
1022
  }
1005
1023
  }
1006
1024
  function j() {
@@ -1008,13 +1026,13 @@ const Ce = {
1008
1026
  label: C.name,
1009
1027
  sublabel: C.code,
1010
1028
  value: C._id
1011
- })), w = V.filter((C) => h.adjustments.find((P) => P.doc._id === C.value)).map((C) => C.value);
1029
+ })), $ = V.filter((C) => g.adjustments.find((P) => P.doc._id === C.value)).map((C) => C.value);
1012
1030
  a.open({
1013
1031
  title: "Select ingredients",
1014
- contentComponent: xt,
1032
+ contentComponent: St,
1015
1033
  contentComponentProps: {
1016
1034
  items: V,
1017
- modelValue: w
1035
+ modelValue: $
1018
1036
  },
1019
1037
  overlay: !0,
1020
1038
  closeButton: !0,
@@ -1029,8 +1047,8 @@ const Ce = {
1029
1047
  variant: "tertiary"
1030
1048
  }
1031
1049
  }).onPrimary((C) => {
1032
- h.adjustments = C.map(
1033
- (P) => h.adjustments.find((T) => T.doc._id === P) ?? {
1050
+ g.adjustments = C.map(
1051
+ (P) => g.adjustments.find((T) => T.doc._id === P) ?? {
1034
1052
  id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
1035
1053
  type: ee.enum.PURCHASE,
1036
1054
  doc: l.skus.find((T) => T._id === P),
@@ -1042,47 +1060,47 @@ const Ce = {
1042
1060
  });
1043
1061
  }
1044
1062
  function E(V) {
1045
- h.adjustments.splice(V, 1);
1063
+ g.adjustments.splice(V, 1);
1046
1064
  }
1047
- return (V, w) => {
1065
+ return (V, $) => {
1048
1066
  const C = M("FmTextarea"), P = M("FmButton"), T = M("FmForm"), Q = M("FmSideSheet");
1049
1067
  return B(), O(Q, {
1050
1068
  modelValue: v(F),
1051
- "onUpdate:modelValue": w[2] || (w[2] = (Y) => Ue(F) ? F.value = Y : null),
1069
+ "onUpdate:modelValue": $[2] || ($[2] = (Y) => Pe(F) ? F.value = Y : null),
1052
1070
  "dismiss-away": "",
1053
1071
  "max-width": 500
1054
1072
  }, {
1055
1073
  "side-sheet-header": D(() => [
1056
- n("div", vn, [
1057
- n("div", fn, b(v(u)("inventory.stock.adjust.title")), 1)
1074
+ n("div", fn, [
1075
+ n("div", yn, x(v(c)("inventory.stock.adjust.title")), 1)
1058
1076
  ])
1059
1077
  ]),
1060
1078
  default: D(() => [
1061
- x(T, {
1079
+ S(T, {
1062
1080
  class: "w-full flex flex-col gap-12",
1063
1081
  ref_key: "formRef",
1064
- ref: $,
1082
+ ref: w,
1065
1083
  onValidationSuccess: o
1066
1084
  }, {
1067
1085
  default: D(() => [
1068
- x(C, {
1069
- label: v(u)("inventory.stock.adjust.remark"),
1070
- modelValue: h.remark,
1071
- "onUpdate:modelValue": w[0] || (w[0] = (Y) => h.remark = Y)
1086
+ S(C, {
1087
+ label: v(c)("inventory.stock.adjust.remark"),
1088
+ modelValue: g.remark,
1089
+ "onUpdate:modelValue": $[0] || ($[0] = (Y) => g.remark = Y)
1072
1090
  }, null, 8, ["label", "modelValue"]),
1073
- n("div", yn, [
1074
- n("div", _n, b(v(u)("inventory.stock.adjust.adjustedItems")), 1),
1075
- x(P, {
1091
+ n("div", _n, [
1092
+ n("div", kn, x(v(c)("inventory.stock.adjust.adjustedItems")), 1),
1093
+ S(P, {
1076
1094
  "prepend-icon": "add",
1077
1095
  variant: "tertiary",
1078
1096
  size: "md",
1079
1097
  onClick: j
1080
1098
  })
1081
1099
  ]),
1082
- (B(!0), L(ne, null, ae(h.adjustments, (Y, N) => (B(), O(pn, {
1100
+ (B(!0), L(ne, null, ae(g.adjustments, (Y, N) => (B(), O(vn, {
1083
1101
  key: Y.id,
1084
- modelValue: h.adjustments[N],
1085
- "onUpdate:modelValue": (R) => h.adjustments[N] = R,
1102
+ modelValue: g.adjustments[N],
1103
+ "onUpdate:modelValue": (R) => g.adjustments[N] = R,
1086
1104
  "onClick:delete": (R) => E(N)
1087
1105
  }, null, 8, ["modelValue", "onUpdate:modelValue", "onClick:delete"]))), 128))
1088
1106
  ]),
@@ -1090,13 +1108,13 @@ const Ce = {
1090
1108
  }, 512)
1091
1109
  ]),
1092
1110
  "side-sheet-footer": D(() => [
1093
- n("div", kn, [
1094
- x(P, {
1095
- label: v(u)("inventory.stock.adjust.adjustButton"),
1096
- loading: k.value,
1097
- onClick: w[1] || (w[1] = (Y) => {
1111
+ n("div", hn, [
1112
+ S(P, {
1113
+ label: v(c)("inventory.stock.adjust.adjustButton"),
1114
+ loading: h.value,
1115
+ onClick: $[1] || ($[1] = (Y) => {
1098
1116
  var N, R;
1099
- return (R = (N = $.value) == null ? void 0 : N.validateInputs) == null ? void 0 : R.call(N);
1117
+ return (R = (N = w.value) == null ? void 0 : N.validateInputs) == null ? void 0 : R.call(N);
1100
1118
  })
1101
1119
  }, null, 8, ["label", "loading"])
1102
1120
  ])
@@ -1105,77 +1123,77 @@ const Ce = {
1105
1123
  }, 8, ["modelValue"]);
1106
1124
  };
1107
1125
  }
1108
- }), gn = Xe((c, d) => ({
1126
+ }), bn = Xe((d, u) => ({
1109
1127
  // TODO: remove once latest inventory backend has been push
1110
- async findBillsByBusinessId(r, s, S) {
1111
- const l = `${c.businessesBackendUrl}/${r}/reports/find-many`, a = {
1128
+ async findBillsByBusinessId(r, s, k) {
1129
+ const l = `${d.businessesBackendUrl}/${r}/reports/find-many`, a = {
1112
1130
  // type: TYPE.bill,
1113
1131
  type: "bill",
1114
1132
  restaurantIds: s,
1115
- ids: S
1133
+ ids: k
1116
1134
  };
1117
- return await d.post(l, a);
1135
+ return await u.post(l, a);
1118
1136
  },
1119
1137
  async findBillsById(r) {
1120
- const S = ue().currentLocationDBName, l = `${c.inventoryBackendUrl}/${S}/bill/search`, a = {
1138
+ const k = ue().currentLocationDBName, l = `${d.inventoryBackendUrl}/${k}/bill/search`, a = {
1121
1139
  ids: r
1122
1140
  };
1123
- return await d.post(l, a);
1141
+ return await u.post(l, a);
1124
1142
  }
1125
- })), bn = { class: "p-16" }, xn = { class: "fm-typo-en-body-md-600 flex-grow" }, Sn = { class: "flex-grow text-fm-color-typo-secondary" }, $n = {
1143
+ })), xn = { class: "p-16" }, Sn = { class: "fm-typo-en-body-md-600 flex-grow" }, $n = { class: "flex-grow text-fm-color-typo-secondary" }, wn = {
1126
1144
  key: 0,
1127
1145
  class: "my-5"
1128
- }, wn = { class: "text-neutral-400" }, Bn = { class: "flex-grow" }, Fn = { class: "flex gap-1" }, An = { class: "flex flex-col gap-1" }, Vn = {
1146
+ }, Bn = { class: "text-neutral-400" }, Fn = { class: "flex-grow" }, An = { class: "flex gap-1" }, Vn = { class: "flex flex-col gap-1" }, Cn = {
1129
1147
  key: 1,
1130
1148
  class: "t-system text-fsecondary"
1131
- }, Cn = {
1149
+ }, Dn = {
1132
1150
  key: 0,
1133
1151
  class: "shrink-0 text-fm-color-typo-secondary"
1134
- }, Dn = /* @__PURE__ */ re({
1152
+ }, Mn = /* @__PURE__ */ re({
1135
1153
  __name: "StockRecordCard",
1136
1154
  props: {
1137
1155
  record: {},
1138
1156
  sku: {},
1139
1157
  bills: { default: () => [] }
1140
1158
  },
1141
- setup(c) {
1142
- const d = c, r = H(!1), s = H(), S = H(null), l = U(() => S.value === null ? "unset" : r.value ? `${S.value}px` : "0px");
1159
+ setup(d) {
1160
+ const u = d, r = H(!1), s = H(), k = H(null), l = U(() => k.value === null ? "unset" : r.value ? `${k.value}px` : "0px");
1143
1161
  Je(() => {
1144
- var k;
1145
- S.value = ((k = s.value) == null ? void 0 : k.scrollHeight) || 0;
1162
+ var h;
1163
+ k.value = ((h = s.value) == null ? void 0 : h.scrollHeight) || 0;
1146
1164
  });
1147
1165
  const a = U(() => {
1148
- var h;
1149
- const k = d.record.adjustments, u = d.sku, o = {}, F = k.flatMap((p) => {
1166
+ var g;
1167
+ const h = u.record.adjustments, c = u.sku, o = {}, F = h.flatMap((p) => {
1150
1168
  var j;
1151
- return ((j = p.skus) == null ? void 0 : j.filter((E) => E.sku._id === u._id)) ?? [];
1169
+ return ((j = p.skus) == null ? void 0 : j.filter((E) => E.sku._id === c._id)) ?? [];
1152
1170
  }).flatMap((p) => p.amounts);
1153
1171
  for (const p of F) {
1154
- const j = p.measurement ? St(p.measurement.conversion, p.amount) : p.amount;
1155
- o[h = p.type] ?? (o[h] = { amount: 0, precision: 0 }), o[p.type] = Ze(j, o[p.type]);
1172
+ const j = p.measurement ? $t(p.measurement.conversion, p.amount) : p.amount;
1173
+ o[g = p.type] ?? (o[g] = { amount: 0, precision: 0 }), o[p.type] = Ze(j, o[p.type]);
1156
1174
  }
1157
1175
  return Object.entries(o).reduce(
1158
1176
  (p, [j, E]) => (p[j] = /// comment, because without it formatter makes code uglier
1159
1177
  `${W.toFormatString({
1160
1178
  value: E,
1161
1179
  precision: 4
1162
- })} ${u.unit.abbrev}`, p),
1180
+ })} ${c.unit.abbrev}`, p),
1163
1181
  {}
1164
1182
  );
1165
- }), { t: i } = le(), g = U(() => d.record.adjustmentsByTime.map(({ date: k, adjustments: u }) => ({
1166
- time: $t(new Date(k)),
1167
- adjustments: u.flatMap(
1183
+ }), { t: i } = le(), b = U(() => u.record.adjustmentsByTime.map(({ date: h, adjustments: c }) => ({
1184
+ time: wt(new Date(h)),
1185
+ adjustments: c.flatMap(
1168
1186
  (o) => {
1169
- var $, F;
1170
- return ((F = ($ = o.skus) == null ? void 0 : $.map) == null ? void 0 : F.call($, (h) => ({
1171
- ...h,
1187
+ var w, F;
1188
+ return ((F = (w = o.skus) == null ? void 0 : w.map) == null ? void 0 : F.call(w, (g) => ({
1189
+ ...g,
1172
1190
  ref: o.ref,
1173
1191
  backdateFrom: o.effectiveAt != null ? ot(o._id) : null
1174
1192
  }))) ?? [];
1175
1193
  }
1176
1194
  ).flatMap((o) => {
1177
- var h;
1178
- const $ = (h = d.bills.find((p) => p._id === o.ref)) == null ? void 0 : h.seqNumber, F = $ ? i("inventory.stock.record.bill", [$]) : "";
1195
+ var g;
1196
+ const w = (g = u.bills.find((p) => p._id === o.ref)) == null ? void 0 : g.seqNumber, F = w ? i("inventory.stock.record.bill", [w]) : "";
1179
1197
  return o.amounts.map((p) => {
1180
1198
  var j;
1181
1199
  return {
@@ -1188,35 +1206,35 @@ const Ce = {
1188
1206
  });
1189
1207
  })
1190
1208
  })));
1191
- return (k, u) => {
1192
- const o = M("FmIcon"), $ = M("FmTooltip"), F = M("FmCard");
1209
+ return (h, c) => {
1210
+ const o = M("FmIcon"), w = M("FmTooltip"), F = M("FmCard");
1193
1211
  return B(), O(F, { variant: "outlined" }, {
1194
1212
  default: D(() => [
1195
- n("div", bn, [
1213
+ n("div", xn, [
1196
1214
  n("div", {
1197
1215
  class: "flex items-center cursor-pointer mb-1",
1198
- onClick: u[0] || (u[0] = (h) => r.value = !r.value)
1216
+ onClick: c[0] || (c[0] = (g) => r.value = !r.value)
1199
1217
  }, [
1200
- n("div", xn, b(k.record.date), 1),
1201
- x(o, {
1218
+ n("div", Sn, x(h.record.date), 1),
1219
+ S(o, {
1202
1220
  name: r.value ? "expand_more" : "expand_less",
1203
1221
  color: "#777777",
1204
1222
  size: "md"
1205
1223
  }, null, 8, ["name"])
1206
1224
  ]),
1207
- (B(!0), L(ne, null, ae(a.value, (h, p) => (B(), L("div", {
1225
+ (B(!0), L(ne, null, ae(a.value, (g, p) => (B(), L("div", {
1208
1226
  key: p,
1209
1227
  class: "flex flex-row py-1",
1210
1228
  style: { "font-size": "0.8rem" }
1211
1229
  }, [
1212
- n("div", Sn, b(v(i)(`inventory.inventoryAdjustment.type.${p}`)), 1),
1230
+ n("div", $n, x(v(i)(`inventory.inventoryAdjustment.type.${p}`)), 1),
1213
1231
  n("div", {
1214
1232
  class: he({
1215
- "text-fm-color-typo-error": h.startsWith("-"),
1216
- "text-fm-color-typo-success": !h.startsWith("-"),
1233
+ "text-fm-color-typo-error": g.startsWith("-"),
1234
+ "text-fm-color-typo-success": !g.startsWith("-"),
1217
1235
  "ml-auto": !0
1218
1236
  })
1219
- }, b(h), 3)
1237
+ }, x(g), 3)
1220
1238
  ]))), 128)),
1221
1239
  n("div", {
1222
1240
  ref_key: "detailRef",
@@ -1228,30 +1246,30 @@ const Ce = {
1228
1246
  transition: "max-height 0.2s ease-out"
1229
1247
  })
1230
1248
  }, [
1231
- g.value.length ? (B(), L("hr", $n)) : te("", !0),
1232
- (B(!0), L(ne, null, ae(g.value, (h) => (B(), L("div", {
1233
- key: h.time,
1249
+ b.value.length ? (B(), L("hr", wn)) : te("", !0),
1250
+ (B(!0), L(ne, null, ae(b.value, (g) => (B(), L("div", {
1251
+ key: g.time,
1234
1252
  class: "flex gap-1 w-full"
1235
1253
  }, [
1236
- n("div", wn, b(h.time), 1),
1237
- n("div", Bn, [
1238
- (B(!0), L(ne, null, ae(h.adjustments, (p) => (B(), L("div", {
1254
+ n("div", Bn, x(g.time), 1),
1255
+ n("div", Fn, [
1256
+ (B(!0), L(ne, null, ae(g.adjustments, (p) => (B(), L("div", {
1239
1257
  key: p.name,
1240
1258
  class: "flex gap-1"
1241
1259
  }, [
1242
- n("div", Fn, [
1243
- ve(b(v(i)(`inventory.inventoryAdjustment.type.${p.name}`)) + " ", 1),
1244
- p.backdateFrom ? (B(), O($, {
1260
+ n("div", An, [
1261
+ ve(x(v(i)(`inventory.inventoryAdjustment.type.${p.name}`)) + " ", 1),
1262
+ p.backdateFrom ? (B(), O(w, {
1245
1263
  key: 0,
1246
1264
  variant: "plain",
1247
1265
  placement: "top",
1248
1266
  "z-index": 50
1249
1267
  }, {
1250
1268
  content: D(() => [
1251
- n("div", An, b(v(i)("inventory.stock.record.backdate", [v(et)(new Date(p.backdateFrom))])), 1)
1269
+ n("div", Vn, x(v(i)("inventory.stock.record.backdate", [v(et)(new Date(p.backdateFrom))])), 1)
1252
1270
  ]),
1253
1271
  default: D(() => [
1254
- x(o, {
1272
+ S(o, {
1255
1273
  name: "info",
1256
1274
  size: "sm",
1257
1275
  color: "primary"
@@ -1259,7 +1277,7 @@ const Ce = {
1259
1277
  ]),
1260
1278
  _: 2
1261
1279
  }, 1024)) : te("", !0),
1262
- p.remark ? (B(), L("span", Vn, " # " + b(p.remark), 1)) : te("", !0)
1280
+ p.remark ? (B(), L("span", Cn, " # " + x(p.remark), 1)) : te("", !0)
1263
1281
  ]),
1264
1282
  n("div", {
1265
1283
  class: he({
@@ -1267,8 +1285,8 @@ const Ce = {
1267
1285
  "text-fm-color-typo-success": !p.amount.startsWith("-"),
1268
1286
  "ml-auto": !0
1269
1287
  })
1270
- }, b(p.amount), 3),
1271
- p.cost ? (B(), L("div", Cn, " (" + b(v(je)(p.cost, !1, p.cost.precision)) + ") ", 1)) : te("", !0)
1288
+ }, x(p.amount), 3),
1289
+ p.cost ? (B(), L("div", Dn, " (" + x(v(Ie)(p.cost, !1, p.cost.precision)) + ") ", 1)) : te("", !0)
1272
1290
  ]))), 128))
1273
1291
  ])
1274
1292
  ]))), 128))
@@ -1280,111 +1298,111 @@ const Ce = {
1280
1298
  };
1281
1299
  }
1282
1300
  });
1283
- function Mn(c, d) {
1301
+ function jn(d, u) {
1284
1302
  var l;
1285
1303
  const r = Object.keys(ee.enum).reduce(
1286
1304
  (a, i) => (a[i] = { amount: 0, precision: 0 }, a),
1287
1305
  {}
1288
1306
  );
1289
- if (!d)
1307
+ if (!u)
1290
1308
  return Object.entries(r).reduce(
1291
1309
  (a, [i]) => (a[i] = W.fromNumber(0), a),
1292
1310
  {}
1293
1311
  );
1294
- const S = c.flatMap((a) => {
1312
+ const k = d.flatMap((a) => {
1295
1313
  var i;
1296
- return ((i = a.skus) == null ? void 0 : i.filter((g) => g.sku._id === d._id)) ?? [];
1314
+ return ((i = a.skus) == null ? void 0 : i.filter((b) => b.sku._id === u._id)) ?? [];
1297
1315
  }).flatMap((a) => a.amounts);
1298
- for (const a of S) {
1316
+ for (const a of k) {
1299
1317
  const i = a.measurement ? W.multiply([a.measurement.conversion, a.amount]) : a.amount;
1300
1318
  r[l = a.type] ?? (r[l] = { amount: 0, precision: 0 }), r[a.type] = W.add([i, r[a.type]]);
1301
1319
  }
1302
1320
  return Object.entries(r).reduce(
1303
- (a, [i, g]) => {
1304
- const k = {
1305
- ...g,
1306
- amount: Math.abs(g.amount)
1321
+ (a, [i, b]) => {
1322
+ const h = {
1323
+ ...b,
1324
+ amount: Math.abs(b.amount)
1307
1325
  };
1308
1326
  return a[i] = /// comment, because without it formatter makes code uglier
1309
1327
  `${W.toFormatString({
1310
- value: k,
1328
+ value: h,
1311
1329
  precision: 4
1312
- })} ${d.unit.abbrev}`, a;
1330
+ })} ${u.unit.abbrev}`, a;
1313
1331
  },
1314
1332
  {}
1315
1333
  );
1316
1334
  }
1317
- function jn(c, d) {
1318
- if (!d)
1335
+ function In(d, u) {
1336
+ if (!u)
1319
1337
  return null;
1320
1338
  let r = null;
1321
- const S = c.flatMap((l) => {
1339
+ const k = d.flatMap((l) => {
1322
1340
  var a;
1323
- return ((a = l.skus) == null ? void 0 : a.filter((i) => i.sku._id === d._id)) ?? [];
1341
+ return ((a = l.skus) == null ? void 0 : a.filter((i) => i.sku._id === u._id)) ?? [];
1324
1342
  }).flatMap((l) => {
1325
1343
  var a;
1326
1344
  return !l.history || ((a = l.history) == null ? void 0 : a.length) === 0 ? [] : l.history[0];
1327
1345
  });
1328
- for (const l of S) {
1346
+ for (const l of k) {
1329
1347
  const a = l.amounts;
1330
1348
  for (const i of a) {
1331
1349
  if (i.type !== ee.Enum.SALES)
1332
1350
  continue;
1333
- const g = i.measurement ? W.multiply([i.measurement.conversion, i.amount]) : i.amount;
1334
- r ?? (r = W.fromNumber(0)), r = W.add([r, g]);
1351
+ const b = i.measurement ? W.multiply([i.measurement.conversion, i.amount]) : i.amount;
1352
+ r ?? (r = W.fromNumber(0)), r = W.add([r, b]);
1335
1353
  }
1336
1354
  }
1337
1355
  return r != null ? (r.amount = Math.abs(r.amount), `${W.toFormatString({
1338
1356
  value: r,
1339
1357
  precision: 4
1340
- })} ${d.unit.abbrev}`) : null;
1358
+ })} ${u.unit.abbrev}`) : null;
1341
1359
  }
1342
- const In = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Un = { class: "flex-1 line-clamp-2" }, Pn = { class: "flex flex-col gap-32 w-full h-full" }, Tn = { class: "flex items-center relative gap-4" }, Rn = { class: "flex-1" }, Hn = {
1360
+ const Un = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Pn = { class: "flex-1 line-clamp-2" }, Tn = { class: "flex flex-col gap-32 w-full h-full" }, Rn = { class: "flex items-center relative gap-4" }, Hn = { class: "flex-1" }, En = {
1343
1361
  key: 0,
1344
1362
  class: "flex-1 flex flex-col items-center gap-16"
1345
- }, En = { class: "fm-typo-en-body-lg-400 translate-x-4" }, Ln = {
1363
+ }, Ln = { class: "fm-typo-en-body-lg-400 translate-x-4" }, Nn = {
1346
1364
  key: 1,
1347
1365
  class: "flex flex-col gap-12"
1348
- }, Nn = { class: "pb-16" }, On = { class: "fm-typo-cn-body-lg-600" }, zn = {
1366
+ }, On = { class: "pb-16" }, zn = { class: "fm-typo-cn-body-lg-600" }, Yn = {
1349
1367
  class: "grid gap-12 fm-typo-en-body-md-400",
1350
1368
  style: { "grid-template-columns": "auto auto auto", "grid-auto-rows": "1fr" }
1351
- }, Yn = { class: "flex flex-col gap-1" }, Kn = { class: "text-fm-color-typo-secondary" }, Gn = { class: "font-bold" }, qn = { class: "flex flex-col gap-1" }, Wn = { class: "text-fm-color-typo-secondary flex" }, Jn = { class: "font-bold" }, Qn = { class: "flex flex-col gap-1" }, Xn = { class: "text-fm-color-typo-secondary" }, Zn = { class: "font-bold" }, eo = { class: "flex flex-col gap-1" }, to = { class: "text-fm-color-typo-secondary" }, no = { class: "font-bold" }, oo = { class: "flex flex-col gap-1" }, so = { class: "text-fm-color-typo-secondary" }, ao = { class: "font-bold" }, ro = { class: "flex flex-col gap-1" }, lo = { class: "text-fm-color-typo-secondary" }, io = { class: "font-bold" }, uo = { class: "flex flex-col gap-1" }, co = { class: "text-fm-color-typo-secondary" }, mo = { class: "font-bold" }, po = { class: "flex flex-col gap-1" }, vo = { class: "text-fm-color-typo-secondary" }, fo = { class: "font-bold" }, yo = { class: "flex flex-col gap-1" }, _o = { class: "text-fm-color-typo-secondary" }, ko = { class: "font-bold" }, ho = {
1369
+ }, Kn = { class: "flex flex-col gap-1" }, Gn = { class: "text-fm-color-typo-secondary" }, qn = { class: "font-bold" }, Wn = { class: "flex flex-col gap-1" }, Jn = { class: "text-fm-color-typo-secondary flex" }, Qn = { class: "font-bold" }, Xn = { class: "flex flex-col gap-1" }, Zn = { class: "text-fm-color-typo-secondary" }, eo = { class: "font-bold" }, to = { class: "flex flex-col gap-1" }, no = { class: "text-fm-color-typo-secondary" }, oo = { class: "font-bold" }, so = { class: "flex flex-col gap-1" }, ao = { class: "text-fm-color-typo-secondary" }, ro = { class: "font-bold" }, lo = { class: "flex flex-col gap-1" }, io = { class: "text-fm-color-typo-secondary" }, uo = { class: "font-bold" }, co = { class: "flex flex-col gap-1" }, mo = { class: "text-fm-color-typo-secondary" }, po = { class: "font-bold" }, vo = { class: "flex flex-col gap-1" }, fo = { class: "text-fm-color-typo-secondary" }, yo = { class: "font-bold" }, _o = { class: "flex flex-col gap-1" }, ko = { class: "text-fm-color-typo-secondary" }, ho = { class: "font-bold" }, go = {
1352
1370
  key: 0,
1353
1371
  class: "flex flex-col gap-8"
1354
- }, go = { class: "flex" }, bo = { class: "flex-1 flex flex-col gap-1" }, xo = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, So = { class: "font-bold" }, $o = { class: "flex-1 flex flex-col gap-1" }, wo = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, Bo = { class: "flex flex-col gap-1" }, Fo = { class: "font-bold" }, Ao = {
1372
+ }, bo = { class: "flex" }, xo = { class: "flex-1 flex flex-col gap-1" }, So = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, $o = { class: "font-bold" }, wo = { class: "flex-1 flex flex-col gap-1" }, Bo = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, Fo = { class: "flex flex-col gap-1" }, Ao = { class: "font-bold" }, Vo = {
1355
1373
  key: 2,
1356
1374
  class: "flex-1 flex flex-col items-center gap-8"
1357
- }, Vo = ["src"], Co = { class: "font-bold text-lg" }, Do = { class: "text-xs text-neutral-400 text-center" }, Mo = /* @__PURE__ */ re({
1375
+ }, Co = ["src"], Do = { class: "font-bold text-lg" }, Mo = { class: "text-xs text-neutral-400 text-center" }, jo = /* @__PURE__ */ re({
1358
1376
  __name: "StockHistory",
1359
1377
  props: {
1360
1378
  sku: {},
1361
1379
  show: { type: Boolean }
1362
1380
  },
1363
1381
  emits: ["update:show"],
1364
- setup(c) {
1365
- const d = tt(), r = He(), s = $e(), S = gn(), l = ue(), a = Bt(), { t: i } = le(), g = c, k = H(!1), u = de(), o = H(ct(0));
1366
- async function $() {
1367
- k.value = !0;
1382
+ setup(d) {
1383
+ const u = tt(), r = He(), s = we(), k = bn(), l = ue(), a = Ft(), { t: i } = le(), b = d, h = H(!1), c = de(), o = H(ct(0));
1384
+ async function w() {
1385
+ h.value = !0;
1368
1386
  try {
1369
1387
  await V(), await r.readStockBalance();
1370
1388
  } catch (t) {
1371
- u.open({
1389
+ c.open({
1372
1390
  title: "Something went wrong",
1373
1391
  message: "Cannot fetch stock history. Please try again.",
1374
1392
  type: "error"
1375
- }), console.log("failed at fetching item adjustment history", g.sku, o, t);
1393
+ }), console.log("failed at fetching item adjustment history", b.sku, o, t);
1376
1394
  } finally {
1377
- k.value = !1;
1395
+ h.value = !1;
1378
1396
  }
1379
1397
  }
1380
1398
  Je(() => {
1381
- $();
1382
- }), ge([() => o.value, () => g.sku], () => {
1383
- $();
1399
+ w();
1400
+ }), ge([() => o.value, () => b.sku], () => {
1401
+ w();
1384
1402
  });
1385
- const F = H([]), h = H([]), p = H(new Array());
1403
+ const F = H([]), g = H([]), p = H(new Array());
1386
1404
  function j(t, e) {
1387
- return e === "day" ? Dt(t) : et(t);
1405
+ return e === "day" ? Mt(t) : et(t);
1388
1406
  }
1389
1407
  function E(t, e) {
1390
1408
  const f = t.reduce(
@@ -1404,41 +1422,41 @@ const In = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Un = {
1404
1422
  }
1405
1423
  async function V() {
1406
1424
  let t = await s.readStockAdjustment(
1407
- g.sku._id,
1408
- Ft(new Date(o.value.startDate)).toISOString(),
1409
- At(new Date(o.value.endDate)).toISOString()
1425
+ b.sku._id,
1426
+ At(new Date(o.value.startDate)).toISOString(),
1427
+ Vt(new Date(o.value.endDate)).toISOString()
1410
1428
  );
1411
1429
  F.value = t;
1412
1430
  const e = t.filter(({ ref: f }) => f == null ? void 0 : f.startsWith("bill_")).map(({ ref: f }) => f);
1413
- await w(e), h.value = E(t, "day").map(({ date: f, adjustments: m }) => ({
1431
+ await $(e), g.value = E(t, "day").map(({ date: f, adjustments: m }) => ({
1414
1432
  date: f,
1415
1433
  adjustments: m,
1416
1434
  adjustmentsByTime: E(m, "minute")
1417
1435
  }));
1418
1436
  }
1419
- async function w(t) {
1420
- t.length && (p.value = await S.findBillsById(t).catch((e) => {
1437
+ async function $(t) {
1438
+ t.length && (p.value = await k.findBillsById(t).catch((e) => {
1421
1439
  var _;
1422
1440
  console.error("Error on using latest bill API, retrying using legacy api", e);
1423
- const f = ((_ = d.currentBusiness.value) == null ? void 0 : _._id) ?? "", m = l.currentLocation.doc._id;
1424
- return S.findBillsByBusinessId(f, [m], t);
1441
+ const f = ((_ = u.currentBusiness.value) == null ? void 0 : _._id) ?? "", m = l.currentLocation.doc._id;
1442
+ return k.findBillsByBusinessId(f, [m], t);
1425
1443
  }));
1426
1444
  }
1427
1445
  const C = U(() => {
1428
- const t = F.value, e = g.sku;
1429
- return Mn(t, e);
1430
- }), P = U(() => {
1431
- const t = F.value, e = g.sku;
1446
+ const t = F.value, e = b.sku;
1432
1447
  return jn(t, e);
1448
+ }), P = U(() => {
1449
+ const t = F.value, e = b.sku;
1450
+ return In(t, e);
1433
1451
  }), T = U(() => {
1434
1452
  const t = [...F.value].computeFirst((f) => {
1435
1453
  var _, y;
1436
- const m = (y = (_ = f.skus) == null ? void 0 : _.find) == null ? void 0 : y.call(_, (A) => A.sku._id === g.sku._id);
1454
+ const m = (y = (_ = f.skus) == null ? void 0 : _.find) == null ? void 0 : y.call(_, (A) => A.sku._id === b.sku._id);
1437
1455
  return m == null ? void 0 : m.fromBalance;
1438
1456
  }) ?? {
1439
1457
  amount: 0,
1440
1458
  precision: 0
1441
- }, e = g.sku;
1459
+ }, e = b.sku;
1442
1460
  return e ? `${W.toFormatString({
1443
1461
  value: t,
1444
1462
  precision: 4
@@ -1446,21 +1464,21 @@ const In = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Un = {
1446
1464
  }), Q = U(() => {
1447
1465
  const t = [...F.value].reverse().computeFirst((f) => {
1448
1466
  var _, y;
1449
- const m = (y = (_ = f.skus) == null ? void 0 : _.find) == null ? void 0 : y.call(_, (A) => A.sku._id === g.sku._id);
1467
+ const m = (y = (_ = f.skus) == null ? void 0 : _.find) == null ? void 0 : y.call(_, (A) => A.sku._id === b.sku._id);
1450
1468
  return m == null ? void 0 : m.toBalance;
1451
1469
  }) ?? {
1452
1470
  amount: 0,
1453
1471
  precision: 0
1454
- }, e = g.sku;
1472
+ }, e = b.sku;
1455
1473
  return e ? `${W.toFormatString({ value: t, precision: 4 })} ${e.unit.abbrev}` : "";
1456
1474
  });
1457
1475
  function Y(t) {
1458
1476
  switch (t) {
1459
- case Fe.MY:
1477
+ case Ae.MY:
1460
1478
  return "MYR";
1461
- case Fe.SG:
1479
+ case Ae.SG:
1462
1480
  return "SGD";
1463
- case Fe.ID:
1481
+ case Ae.ID:
1464
1482
  return "IDR";
1465
1483
  default:
1466
1484
  return "MYR";
@@ -1476,7 +1494,7 @@ const In = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Un = {
1476
1494
  const y = _.cost;
1477
1495
  if (!y) return m;
1478
1496
  const A = {
1479
- ...wt(m, Math.max(m.precision, y.precision)),
1497
+ ...Bt(m, Math.max(m.precision, y.precision)),
1480
1498
  currency: y.currency
1481
1499
  };
1482
1500
  return {
@@ -1487,13 +1505,13 @@ const In = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Un = {
1487
1505
  {
1488
1506
  amount: 0,
1489
1507
  precision: 0,
1490
- currency: Y(((f = d.currentCountry) == null ? void 0 : f.value) ?? Ye)
1508
+ currency: Y(((f = u.currentCountry) == null ? void 0 : f.value) ?? Ye)
1491
1509
  }
1492
1510
  );
1493
- return je(e, !1, e.precision);
1511
+ return Ie(e, !1, e.precision);
1494
1512
  });
1495
1513
  function R() {
1496
- const { startDate: t, endDate: e } = Vt(o.value);
1514
+ const { startDate: t, endDate: e } = Ct(o.value);
1497
1515
  t !== null && e !== null && (o.value = {
1498
1516
  startDate: t,
1499
1517
  endDate: e
@@ -1503,7 +1521,7 @@ const In = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Un = {
1503
1521
  var f;
1504
1522
  const t = [...F.value].reverse().computeFirst((m) => {
1505
1523
  var y, A;
1506
- const _ = (A = (y = m.skus) == null ? void 0 : y.find) == null ? void 0 : A.call(y, (z) => z.sku._id === g.sku._id);
1524
+ const _ = (A = (y = m.skus) == null ? void 0 : y.find) == null ? void 0 : A.call(y, (z) => z.sku._id === b.sku._id);
1507
1525
  return _ == null ? void 0 : _.toCostBalances;
1508
1526
  });
1509
1527
  return t ? {
@@ -1511,30 +1529,30 @@ const In = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Un = {
1511
1529
  amount: 0,
1512
1530
  precision: 0
1513
1531
  }),
1514
- currency: Y(((f = d.currentCountry) == null ? void 0 : f.value) ?? Ye)
1532
+ currency: Y(((f = u.currentCountry) == null ? void 0 : f.value) ?? Ye)
1515
1533
  } : "No data";
1516
1534
  });
1517
1535
  function ce() {
1518
- const { startDate: t, endDate: e } = Ct(o.value);
1536
+ const { startDate: t, endDate: e } = Dt(o.value);
1519
1537
  t !== null && e !== null && (o.value = {
1520
1538
  startDate: t,
1521
1539
  endDate: e
1522
1540
  });
1523
1541
  }
1524
- const oe = Re(g, "show");
1542
+ const oe = Re(b, "show");
1525
1543
  return (t, e) => {
1526
1544
  const f = M("FmButton"), m = M("FmField"), _ = M("FmDateRangePicker"), y = M("FmSpacer"), A = M("FmCircularProgress"), z = M("FmIcon"), X = M("FmTooltip"), me = M("FmMenuDivider"), I = M("FmCardSection"), G = M("FmCard"), J = M("FmSideSheet");
1527
1545
  return B(), O(J, {
1528
1546
  "dismiss-away": "",
1529
1547
  modelValue: v(oe),
1530
- "onUpdate:modelValue": e[4] || (e[4] = (Z) => Ue(oe) ? oe.value = Z : null),
1548
+ "onUpdate:modelValue": e[4] || (e[4] = (Z) => Pe(oe) ? oe.value = Z : null),
1531
1549
  "close-button": !1,
1532
1550
  "max-width": 560
1533
1551
  }, {
1534
1552
  "side-sheet-header": D(() => [
1535
- n("div", In, [
1536
- n("div", Un, b(v(i)("inventory.stock.history.title", [t.sku.name])), 1),
1537
- x(f, {
1553
+ n("div", Un, [
1554
+ n("div", Pn, x(v(i)("inventory.stock.history.title", [t.sku.name])), 1),
1555
+ S(f, {
1538
1556
  variant: "tertiary",
1539
1557
  "prepend-icon": "close",
1540
1558
  onClick: e[0] || (e[0] = (Z) => oe.value = !1)
@@ -1544,10 +1562,10 @@ const In = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Un = {
1544
1562
  default: D(() => {
1545
1563
  var Z;
1546
1564
  return [
1547
- n("div", Pn, [
1548
- n("div", Tn, [
1549
- n("div", Rn, [
1550
- x(_, {
1565
+ n("div", Tn, [
1566
+ n("div", Rn, [
1567
+ n("div", Hn, [
1568
+ S(_, {
1551
1569
  modelValue: o.value,
1552
1570
  "onUpdate:modelValue": e[1] || (e[1] = (q) => o.value = q),
1553
1571
  "show-predefined-range": "",
@@ -1556,12 +1574,12 @@ const In = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Un = {
1556
1574
  "z-index": 50
1557
1575
  }, {
1558
1576
  "trigger-button": D(({ opened: q }) => [
1559
- x(m, {
1577
+ S(m, {
1560
1578
  "prepend-icon": "calendar_month",
1561
1579
  focused: q
1562
1580
  }, {
1563
1581
  default: D(() => [
1564
- ve(b(o.value.startDate) + " - " + b(o.value.endDate), 1)
1582
+ ve(x(o.value.startDate) + " - " + x(o.value.endDate), 1)
1565
1583
  ]),
1566
1584
  _: 2
1567
1585
  }, 1032, ["focused"])
@@ -1569,39 +1587,39 @@ const In = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Un = {
1569
1587
  _: 1
1570
1588
  }, 8, ["modelValue"])
1571
1589
  ]),
1572
- x(f, {
1590
+ S(f, {
1573
1591
  variant: "tertiary",
1574
1592
  onClick: e[2] || (e[2] = (q) => R()),
1575
1593
  "prepend-icon": "navigate_before"
1576
1594
  }),
1577
- x(f, {
1595
+ S(f, {
1578
1596
  variant: "tertiary",
1579
1597
  onClick: e[3] || (e[3] = (q) => ce()),
1580
1598
  "prepend-icon": "navigate_next"
1581
1599
  })
1582
1600
  ]),
1583
- k.value ? (B(), L("div", Hn, [
1584
- x(y),
1585
- x(A, { size: "xl" }),
1586
- n("div", En, b(v(i)("inventory.stock.history.loading")), 1),
1587
- x(y),
1588
- x(y)
1589
- ])) : h.value && ((Z = h.value) == null ? void 0 : Z.length) > 0 ? (B(), L("div", Ln, [
1590
- x(G, { variant: "outlined" }, {
1601
+ h.value ? (B(), L("div", En, [
1602
+ S(y),
1603
+ S(A, { size: "xl" }),
1604
+ n("div", Ln, x(v(i)("inventory.stock.history.loading")), 1),
1605
+ S(y),
1606
+ S(y)
1607
+ ])) : g.value && ((Z = g.value) == null ? void 0 : Z.length) > 0 ? (B(), L("div", Nn, [
1608
+ S(G, { variant: "outlined" }, {
1591
1609
  default: D(() => [
1592
- x(I, { class: "flex flex-col gap-4" }, {
1610
+ S(I, { class: "flex flex-col gap-4" }, {
1593
1611
  default: D(() => [
1594
- n("div", Nn, [
1595
- n("div", On, b(v(i)("inventory.stock.history.summary.title")), 1)
1612
+ n("div", On, [
1613
+ n("div", zn, x(v(i)("inventory.stock.history.summary.title")), 1)
1596
1614
  ]),
1597
- n("div", zn, [
1598
- n("div", Yn, [
1599
- n("div", Kn, b(v(i)("inventory.stock.history.summary.totalPurchase")), 1),
1600
- n("div", Gn, b(C.value.PURCHASE), 1)
1615
+ n("div", Yn, [
1616
+ n("div", Kn, [
1617
+ n("div", Gn, x(v(i)("inventory.stock.history.summary.totalPurchase")), 1),
1618
+ n("div", qn, x(C.value.PURCHASE), 1)
1601
1619
  ]),
1602
- n("div", qn, [
1603
- n("div", Wn, [
1604
- ve(b(v(i)("inventory.stock.history.summary.totalSales")) + "  ", 1),
1620
+ n("div", Wn, [
1621
+ n("div", Jn, [
1622
+ ve(x(v(i)("inventory.stock.history.summary.totalSales")) + "  ", 1),
1605
1623
  P.value != null ? (B(), O(X, {
1606
1624
  key: 0,
1607
1625
  variant: "plain",
@@ -1610,7 +1628,7 @@ const In = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Un = {
1610
1628
  "z-index": 50
1611
1629
  }, {
1612
1630
  default: D(() => [
1613
- x(z, {
1631
+ S(z, {
1614
1632
  name: "warning",
1615
1633
  size: "sm"
1616
1634
  })
@@ -1618,53 +1636,53 @@ const In = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Un = {
1618
1636
  _: 1
1619
1637
  }, 8, ["content"])) : te("", !0)
1620
1638
  ]),
1621
- n("div", Jn, b(C.value.SALES), 1)
1639
+ n("div", Qn, x(C.value.SALES), 1)
1622
1640
  ]),
1623
- n("div", Qn, [
1624
- n("div", Xn, b(v(i)("inventory.stock.history.summary.totalLose")), 1),
1625
- n("div", Zn, b(C.value.LOSE), 1)
1641
+ n("div", Xn, [
1642
+ n("div", Zn, x(v(i)("inventory.stock.history.summary.totalLose")), 1),
1643
+ n("div", eo, x(C.value.LOSE), 1)
1626
1644
  ]),
1627
- n("div", eo, [
1628
- n("div", to, b(v(i)("inventory.stock.history.summary.totalRequest")), 1),
1629
- n("div", no, b(C.value.REQUEST), 1)
1645
+ n("div", to, [
1646
+ n("div", no, x(v(i)("inventory.stock.history.summary.totalRequest")), 1),
1647
+ n("div", oo, x(C.value.REQUEST), 1)
1630
1648
  ]),
1631
- n("div", oo, [
1632
- n("div", so, b(v(i)("inventory.stock.history.summary.totalReceive")), 1),
1633
- n("div", ao, b(C.value.RECEIVE), 1)
1649
+ n("div", so, [
1650
+ n("div", ao, x(v(i)("inventory.stock.history.summary.totalReceive")), 1),
1651
+ n("div", ro, x(C.value.RECEIVE), 1)
1634
1652
  ]),
1635
- n("div", ro, [
1636
- n("div", lo, b(v(i)("inventory.stock.history.summary.totalConvert")), 1),
1637
- n("div", io, b(C.value.CONVERT), 1)
1653
+ n("div", lo, [
1654
+ n("div", io, x(v(i)("inventory.stock.history.summary.totalConvert")), 1),
1655
+ n("div", uo, x(C.value.CONVERT), 1)
1638
1656
  ]),
1639
- n("div", uo, [
1640
- n("div", co, b(v(i)("inventory.stock.history.summary.totalDamage")), 1),
1641
- n("div", mo, b(C.value.DAMAGE), 1)
1657
+ n("div", co, [
1658
+ n("div", mo, x(v(i)("inventory.stock.history.summary.totalDamage")), 1),
1659
+ n("div", po, x(C.value.DAMAGE), 1)
1642
1660
  ]),
1643
- n("div", po, [
1644
- n("div", vo, b(v(i)("inventory.stock.history.summary.openingBalance")), 1),
1645
- n("div", fo, b(T.value), 1)
1661
+ n("div", vo, [
1662
+ n("div", fo, x(v(i)("inventory.stock.history.summary.openingBalance")), 1),
1663
+ n("div", yo, x(T.value), 1)
1646
1664
  ]),
1647
- n("div", yo, [
1648
- n("div", _o, b(v(i)("inventory.stock.history.summary.lastStockBalance")), 1),
1649
- n("div", ko, b(Q.value), 1)
1665
+ n("div", _o, [
1666
+ n("div", ko, x(v(i)("inventory.stock.history.summary.lastStockBalance")), 1),
1667
+ n("div", ho, x(Q.value), 1)
1650
1668
  ])
1651
1669
  ]),
1652
- v(a).enableTotalCost ? (B(), L("div", ho, [
1653
- x(me, { class: "w-full" }),
1654
- n("div", go, [
1655
- n("div", bo, [
1656
- x(Ge, { "z-index": 50 }, {
1670
+ v(a).enableTotalCost ? (B(), L("div", go, [
1671
+ S(me, { class: "w-full" }),
1672
+ n("div", bo, [
1673
+ n("div", xo, [
1674
+ S(Ge, { "z-index": 50 }, {
1657
1675
  default: D(() => [
1658
- n("div", xo, [
1659
- ve(b(v(i)("inventory.stock.history.estimatedValue")) + " ", 1),
1660
- x(X, {
1676
+ n("div", So, [
1677
+ ve(x(v(i)("inventory.stock.history.estimatedValue")) + " ", 1),
1678
+ S(X, {
1661
1679
  variant: "plain",
1662
1680
  placement: "top",
1663
1681
  content: v(i)("inventory.stock.history.estimatedValueTooltip"),
1664
1682
  "z-index": 50
1665
1683
  }, {
1666
1684
  default: D(() => [
1667
- x(z, {
1685
+ S(z, {
1668
1686
  name: "help",
1669
1687
  size: "sm"
1670
1688
  })
@@ -1675,23 +1693,23 @@ const In = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Un = {
1675
1693
  ]),
1676
1694
  _: 1
1677
1695
  }),
1678
- n("div", So, b(typeof K.value != "string" ? v(je)(K.value, !1, K.value.precision) : K.value), 1)
1696
+ n("div", $o, x(typeof K.value != "string" ? v(Ie)(K.value, !1, K.value.precision) : K.value), 1)
1679
1697
  ]),
1680
- n("div", $o, [
1681
- x(Ge, { "z-index": 50 }, {
1698
+ n("div", wo, [
1699
+ S(Ge, { "z-index": 50 }, {
1682
1700
  default: D(() => [
1683
- n("div", wo, [
1684
- ve(b(v(i)("inventory.stock.history.costSold")) + " ", 1),
1685
- x(X, {
1701
+ n("div", Bo, [
1702
+ ve(x(v(i)("inventory.stock.history.costSold")) + " ", 1),
1703
+ S(X, {
1686
1704
  variant: "plain",
1687
1705
  placement: "top",
1688
1706
  "z-index": 50
1689
1707
  }, {
1690
1708
  content: D(() => [
1691
- n("div", Bo, b(v(i)("inventory.stock.history.costSoldTooltip")), 1)
1709
+ n("div", Fo, x(v(i)("inventory.stock.history.costSoldTooltip")), 1)
1692
1710
  ]),
1693
1711
  default: D(() => [
1694
- x(z, {
1712
+ S(z, {
1695
1713
  name: "help",
1696
1714
  size: "sm"
1697
1715
  })
@@ -1702,7 +1720,7 @@ const In = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Un = {
1702
1720
  ]),
1703
1721
  _: 1
1704
1722
  }),
1705
- n("div", Fo, b(N.value), 1)
1723
+ n("div", Ao, x(N.value), 1)
1706
1724
  ])
1707
1725
  ])
1708
1726
  ])) : te("", !0)
@@ -1713,28 +1731,28 @@ const In = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Un = {
1713
1731
  _: 1
1714
1732
  }),
1715
1733
  e[5] || (e[5] = n("div", null, null, -1)),
1716
- (B(!0), L(ne, null, ae(h.value, (q) => (B(), L(ne, {
1734
+ (B(!0), L(ne, null, ae(g.value, (q) => (B(), L(ne, {
1717
1735
  key: q.date
1718
1736
  }, [
1719
- t.sku ? (B(), O(Dn, {
1737
+ t.sku ? (B(), O(Mn, {
1720
1738
  key: 0,
1721
1739
  record: q,
1722
1740
  sku: t.sku,
1723
1741
  bills: p.value
1724
1742
  }, null, 8, ["record", "sku", "bills"])) : te("", !0)
1725
1743
  ], 64))), 128))
1726
- ])) : (B(), L("div", Ao, [
1727
- x(y),
1744
+ ])) : (B(), L("div", Vo, [
1745
+ S(y),
1728
1746
  n("div", null, [
1729
1747
  n("img", {
1730
- src: v(Et),
1748
+ src: v(Lt),
1731
1749
  alt: "List is empty"
1732
- }, null, 8, Vo)
1750
+ }, null, 8, Co)
1733
1751
  ]),
1734
- n("div", Co, b(v(i)("inventory.stock.history.noRecords")), 1),
1735
- n("div", Do, b(v(i)("inventory.stock.history.changeDateRange")), 1),
1736
- x(y),
1737
- x(y)
1752
+ n("div", Do, x(v(i)("inventory.stock.history.noRecords")), 1),
1753
+ n("div", Mo, x(v(i)("inventory.stock.history.changeDateRange")), 1),
1754
+ S(y),
1755
+ S(y)
1738
1756
  ]))
1739
1757
  ])
1740
1758
  ];
@@ -1743,62 +1761,62 @@ const In = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Un = {
1743
1761
  }, 8, ["modelValue"]);
1744
1762
  };
1745
1763
  }
1746
- }), jo = { class: "flex flex-col gap-8" }, Io = { class: "flex flex-col" }, Uo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Po = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, Qo = /* @__PURE__ */ re({
1764
+ }), Io = { class: "flex flex-col gap-8" }, Uo = { class: "flex flex-col" }, Po = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, To = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, Xo = /* @__PURE__ */ re({
1747
1765
  __name: "StockView",
1748
- setup(c) {
1749
- const { t: d } = le(), r = Te(), s = ue(), S = He(), l = lt(), a = at(), { columnDefs: i } = qt();
1750
- s.watchLocation(u);
1751
- const g = H(!1), k = de();
1752
- async function u() {
1766
+ setup(d) {
1767
+ const { t: u } = le(), r = $e(), s = ue(), k = He(), l = lt(), a = at(), { columnDefs: i } = Wt();
1768
+ s.watchLocation(c);
1769
+ const b = H(!1), h = de();
1770
+ async function c() {
1753
1771
  if (s._currentLocation) {
1754
- g.value = !0;
1772
+ b.value = !0;
1755
1773
  try {
1756
- await S.readStockBalance(), await S.readProductBalance(), await a.readStockEstimateBalance();
1757
- } catch {
1758
- k.open({
1759
- title: d("inventory.stock.error.title"),
1760
- message: d("inventory.stock.error.message"),
1774
+ await k.readStockBalance(), await k.readProductBalance(), await a.readStockEstimateBalance();
1775
+ } catch ($) {
1776
+ h.open({
1777
+ title: u("inventory.stock.error.title"),
1778
+ message: u("inventory.stock.error.message"),
1761
1779
  type: "error"
1762
- });
1780
+ }), console.error("error on fetch stock balance", $);
1763
1781
  } finally {
1764
- g.value = !1;
1782
+ b.value = !1;
1765
1783
  }
1766
1784
  }
1767
1785
  }
1768
1786
  const o = U(
1769
- () => r.skus.map((w) => {
1787
+ () => r.skus.map(($) => {
1770
1788
  var Y, N, R;
1771
- const C = w.trackingMeasurement;
1772
- let P = (N = (Y = S.stockBalance.skus) == null ? void 0 : Y.find(
1773
- (K) => K.id === w._id
1789
+ const C = $.trackingMeasurement;
1790
+ let P = (N = (Y = k.stockBalance.skus) == null ? void 0 : Y.find(
1791
+ (K) => K.id === $._id
1774
1792
  )) == null ? void 0 : N.balance, T = a.inventoryForecast.skus.find(
1775
- (K) => K.id === w._id
1793
+ (K) => K.id === $._id
1776
1794
  );
1777
1795
  return {
1778
- ...w,
1796
+ ...$,
1779
1797
  balance: P ?? {
1780
1798
  amount: 0,
1781
1799
  precision: 0
1782
1800
  },
1783
1801
  day: (T == null ? void 0 : T.depletionDays) ?? void 0,
1784
- trackingUnitAbbrev: C ? ((R = w.unit.measurements.find((K) => K.id === C)) == null ? void 0 : R.abbrev) ?? "" : w.unit.abbrev
1802
+ trackingUnitAbbrev: C ? ((R = $.unit.measurements.find((K) => K.id === C)) == null ? void 0 : R.abbrev) ?? "" : $.unit.abbrev
1785
1803
  };
1786
1804
  })
1787
- ), $ = H(""), { breakpoints: F } = jt(), h = U(() => F.value.xs || F.value.sm), p = U(() => h.value ? 10 : 20), j = dt(), E = U(
1805
+ ), w = H(""), { breakpoints: F } = It(), g = U(() => F.value.xs || F.value.sm), p = U(() => g.value ? 10 : 20), j = dt(), E = U(
1788
1806
  () => {
1789
- var w;
1790
- return ((w = s._currentLocation) == null ? void 0 : w.type) === Mt.restaurant;
1807
+ var $;
1808
+ return (($ = s._currentLocation) == null ? void 0 : $.type) === jt.restaurant;
1791
1809
  }
1792
1810
  ), V = U(() => {
1793
- const w = [
1794
- { icon: "ios_share", onClick: () => zt(o.value) }
1811
+ const $ = [
1812
+ { icon: "ios_share", onClick: () => Yt(o.value) }
1795
1813
  ];
1796
- return E.value ? [{ icon: "refresh", onClick: u }, ...w] : w;
1814
+ return E.value ? [{ icon: "refresh", onClick: c }, ...$] : $;
1797
1815
  });
1798
- return (w, C) => {
1816
+ return ($, C) => {
1799
1817
  const P = M("FmTable");
1800
1818
  return B(), O(mt, {
1801
- title: v(d)("inventory.stock.title")
1819
+ title: v(u)("inventory.stock.title")
1802
1820
  }, {
1803
1821
  default: D(() => {
1804
1822
  var T, Q, Y, N;
@@ -1807,58 +1825,58 @@ const In = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Un = {
1807
1825
  class: he([
1808
1826
  "flex flex-col gap-8 max-h-full",
1809
1827
  {
1810
- "p-0": h.value,
1811
- "px-24 ": !h.value
1828
+ "p-0": g.value,
1829
+ "px-24 ": !g.value
1812
1830
  }
1813
1831
  ])
1814
1832
  }, [
1815
- x(pt, {
1833
+ S(pt, {
1816
1834
  searchable: "",
1817
1835
  "change-location": "",
1818
- search: $.value,
1819
- "onUpdate:search": C[0] || (C[0] = (R) => $.value = R),
1836
+ search: w.value,
1837
+ "onUpdate:search": C[0] || (C[0] = (R) => w.value = R),
1820
1838
  actions: V.value
1821
1839
  }, null, 8, ["search", "actions"]),
1822
1840
  (B(), O(P, {
1823
1841
  style: Qe(v(j).tableHeight),
1824
1842
  "column-defs": v(i),
1825
1843
  "row-data": o.value,
1826
- "search-value": $.value,
1827
- loading: g.value || !v(s)._currentLocation,
1844
+ "search-value": w.value,
1845
+ loading: b.value || !v(s)._currentLocation,
1828
1846
  key: (T = v(s)._currentLocation) == null ? void 0 : T.dbName,
1829
1847
  onRowClick: C[1] || (C[1] = (R) => v(l).showSkuHistory(R.original)),
1830
1848
  "page-size": p.value
1831
1849
  }, {
1832
1850
  "list-row": D((R) => [
1833
- x(Ut, {
1851
+ S(Pt, {
1834
1852
  row: R,
1835
1853
  onRowClick: v(l).showSkuHistory
1836
1854
  }, {
1837
1855
  default: D((K) => {
1838
1856
  var ce, oe, t, e, f, m, _, y, A, z;
1839
1857
  return [
1840
- n("div", jo, [
1841
- n("div", Io, [
1842
- n("div", Uo, [
1843
- x(v(Ke), {
1858
+ n("div", Io, [
1859
+ n("div", Uo, [
1860
+ n("div", Po, [
1861
+ S(v(Ke), {
1844
1862
  render: (t = (oe = (ce = K.code) == null ? void 0 : ce.column) == null ? void 0 : oe.columnDef) == null ? void 0 : t.cell,
1845
1863
  props: (f = (e = K.code) == null ? void 0 : e.getContext) == null ? void 0 : f.call(e)
1846
1864
  }, null, 8, ["render", "props"])
1847
1865
  ]),
1848
- n("div", Po, [
1849
- x(v(Ke), {
1866
+ n("div", To, [
1867
+ S(v(Ke), {
1850
1868
  render: (y = (_ = (m = K.name) == null ? void 0 : m.column) == null ? void 0 : _.columnDef) == null ? void 0 : y.cell,
1851
1869
  props: (z = (A = K.name) == null ? void 0 : A.getContext) == null ? void 0 : z.call(A)
1852
1870
  }, null, 8, ["render", "props"])
1853
1871
  ])
1854
1872
  ]),
1855
1873
  n("div", null, [
1856
- x(Ie, {
1874
+ S(Ue, {
1857
1875
  days: R.original.day
1858
1876
  }, null, 8, ["days"])
1859
1877
  ]),
1860
1878
  n("div", null, [
1861
- x(rt, {
1879
+ S(rt, {
1862
1880
  class: "xs:w-[160px]",
1863
1881
  unit: R.original.unit,
1864
1882
  sku: R.original,
@@ -1876,9 +1894,9 @@ const In = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Un = {
1876
1894
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
1877
1895
  ], 2),
1878
1896
  (B(), O(ut, { to: "body" }, [
1879
- (Q = v(l).stockHistoryProps) != null && Q.sku ? (B(), O(Mo, we(Be({ key: 0 }, v(l).stockHistoryProps)), null, 16)) : te("", !0),
1880
- (Y = v(l).convertSkuDialogProps) != null && Y.sku ? (B(), O(cn, we(Be({ key: 1 }, v(l).convertSkuDialogProps)), null, 16)) : te("", !0),
1881
- (N = v(l).adjustSkuDialogProps) != null && N.stock ? (B(), O(hn, we(Be({ key: 2 }, v(l).adjustSkuDialogProps)), null, 16)) : te("", !0)
1897
+ (Q = v(l).stockHistoryProps) != null && Q.sku ? (B(), O(jo, Be(Fe({ key: 0 }, v(l).stockHistoryProps)), null, 16)) : te("", !0),
1898
+ (Y = v(l).convertSkuDialogProps) != null && Y.sku ? (B(), O(dn, Be(Fe({ key: 1 }, v(l).convertSkuDialogProps)), null, 16)) : te("", !0),
1899
+ (N = v(l).adjustSkuDialogProps) != null && N.stock ? (B(), O(gn, Be(Fe({ key: 2 }, v(l).adjustSkuDialogProps)), null, 16)) : te("", !0)
1882
1900
  ]))
1883
1901
  ];
1884
1902
  }),
@@ -1888,5 +1906,5 @@ const In = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Un = {
1888
1906
  }
1889
1907
  });
1890
1908
  export {
1891
- Qo as default
1909
+ Xo as default
1892
1910
  };