@feedmepos/mf-inventory-portal 1.1.2-dev.2 → 1.1.3-dev.1

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 (46) hide show
  1. package/dist/{App-BP1j0Wfm.js → App-cNDvnIR8.js} +1 -1
  2. package/dist/{ApprovalView-DHpMEMs9.js → ApprovalView-DCZBiIEO.js} +2 -2
  3. package/dist/{BindingsDialog-DsJ4ULCX.js → BindingsDialog-D76F8fvx.js} +2 -2
  4. package/dist/{BindingsPicker-C8VsQIVc.js → BindingsPicker-CdpKkspS.js} +1 -1
  5. package/dist/{BindingsTable-Dv7ovYaR.js → BindingsTable-YQvN_pYF.js} +1 -1
  6. package/dist/{ClosingDraftView-m5qcjTQQ.js → ClosingDraftView-CCb0FAzW.js} +2 -2
  7. package/dist/{ClosingTemplateView-3RWSh9GP.js → ClosingTemplateView-9UUUma7y.js} +487 -473
  8. package/dist/{DeliveryOrderPrintPreview-BH060kC1.js → DeliveryOrderPrintPreview-kIAwU5VW.js} +1 -1
  9. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CdeaTsc8.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DR-pjb50.js} +3 -3
  10. package/dist/{FmMultiselectDialog-C-9RO1fp.js → FmMultiselectDialog-C3i332De.js} +1 -1
  11. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-C57WQ2iL.js → FmUnitInput.vue_vue_type_script_setup_true_lang-C4wdN-If.js} +1 -1
  12. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CpWvuh5U.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-B5d73yc2.js} +1 -1
  13. package/dist/{IngredientGroupView-BnPGvMNK.js → IngredientGroupView-BvDH-C9a.js} +2 -2
  14. package/dist/{IngredientsView-e_HgWPoP.js → IngredientsView-CC4_GIOh.js} +4 -4
  15. package/dist/{IntegrationView-DYkTeLDC.js → IntegrationView-3W5NZOEc.js} +4 -4
  16. package/dist/{InventoryBindingForm-CBYmaiJ-.js → InventoryBindingForm-kKVvfrW2.js} +1 -1
  17. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DfNnosnL.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BxiQ_Bol.js} +3 -3
  18. package/dist/{InventoryBindingSummary-DGjY9q0H.js → InventoryBindingSummary-TwWRus0N.js} +1 -1
  19. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Cy0r8-gD.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-C0CFfJnS.js} +1 -1
  20. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CO4-uU7s.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DlCQdwHY.js} +1 -1
  21. package/dist/{PublishView-CtPChk5P.js → PublishView-cRnx8uFn.js} +2 -2
  22. package/dist/{PurchaseOrderPrintPreview-DzivX4_W.js → PurchaseOrderPrintPreview-DeKzCEvp.js} +1 -1
  23. package/dist/{ReceiveRequestView-QCbdf08n.js → ReceiveRequestView-DtaA_-ux.js} +9 -9
  24. package/dist/{RecipeView-D1NTlI0L.js → RecipeView-CJpKAuD-.js} +3 -3
  25. package/dist/{StockView-CdfztIA6.js → StockView-ddbQuRf-.js} +6 -6
  26. package/dist/{SupplierView-CCqxkiW7.js → SupplierView-CUU8z105.js} +648 -646
  27. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CKZam-tm.js → TransferDetails.vue_vue_type_script_setup_true_lang-D5_7PNKj.js} +5 -5
  28. package/dist/{TransferTemplateView-AWGyqDnj.js → TransferTemplateView-B43Gg1Aj.js} +6 -6
  29. package/dist/{UnitView-D49BzCAv.js → UnitView-DQLfzNGX.js} +3 -3
  30. package/dist/{WarehouseView-C5H3zy02.js → WarehouseView-CoNcLEuO.js} +1 -1
  31. package/dist/api/duplicate-template.d.ts +3 -3
  32. package/dist/{app-F90HTHJ6.js → app-BQG51ddI.js} +14268 -13691
  33. package/dist/app.js +1 -1
  34. package/dist/components/FmMultiselectDialogTemporary.vue.d.ts +41 -0
  35. package/dist/{decimal-DMDoO7Rc.js → decimal-B6rJ9w4Z.js} +1 -1
  36. package/dist/{format-unit-display-CyqyV_Q1.js → format-unit-display-CfRJYIG_.js} +216 -202
  37. package/dist/{index-Bq6I3lAV.js → index-B6hmI-pG.js} +1 -1
  38. package/dist/{index-DGNRUhaL.js → index-CqybPlVV.js} +1 -1
  39. package/dist/{stock-D53H7SeD.js → stock-B9dC-FDe.js} +1 -1
  40. package/dist/style.css +1 -1
  41. package/dist/{supplier-CyLpu1Jk.js → supplier-C-gaLIFh.js} +1 -1
  42. package/dist/tsconfig.app.tsbuildinfo +1 -1
  43. package/dist/{use-ingredient-select-dialog-Cp9Z0ZMi.js → use-ingredient-select-dialog-DV9ryvA0.js} +1 -1
  44. package/dist/{use-inventory-binding-dialog-DlFMZOnP.js → use-inventory-binding-dialog-BSQQ21da.js} +1 -1
  45. package/dist/{vue-i18n-CH21Ql15.js → vue-i18n-h2uQnw9N.js} +158 -158
  46. package/package.json +2 -2
@@ -1,9 +1,9 @@
1
- import { ref as M, h as P, defineComponent as j, resolveComponent as R, openBlock as T, createElementBlock as I, createElementVNode as x, normalizeClass as Y, createTextVNode as Fe, toDisplayString as C, unref as h, createCommentVNode as G, createVNode as $, withCtx as A, Fragment as H, renderList as J, computed as E, watch as Pe, createSlots as Re, createBlock as N, isRef as Oe, normalizeStyle as Ye, Teleport as Ke, normalizeProps as Ge, guardReactiveProps as Je, mergeProps as We } from "vue";
2
- import { a3 as qe, u as re, af as Qe, D as oe, i as V, h as Xe, f as Ae, ag as le, s as Ze, ah as Ee, v as Ue, a as ie, b as et, w as tt, x as Ve, y as nt, z as ot, ai as st, e as z, G as O, K as lt, aj as at, m as rt, E as Ne, A as it, ak as ct, al as se, B as mt, _ as ut, C as dt } from "./app-F90HTHJ6.js";
3
- import { useCoreStore as ce, useI18n as B } from "@feedmepos/mf-common";
4
- import { useDialogChild as pt, useSnackbar as ee, useDialog as me, FmButtonVariant as Z, components as L, useProxiedModel as ft, useBreakpoints as vt } from "@feedmepos/ui-library";
1
+ import { ref as F, h as M, defineComponent as L, resolveComponent as R, openBlock as T, createElementBlock as I, createElementVNode as w, normalizeClass as Y, createTextVNode as Fe, toDisplayString as C, unref as h, createCommentVNode as G, createVNode as $, withCtx as A, Fragment as j, renderList as J, computed as E, watch as Pe, createSlots as Re, createBlock as N, isRef as Oe, normalizeStyle as Ye, Teleport as Ke, normalizeProps as Ge, guardReactiveProps as Je, mergeProps as We } from "vue";
2
+ import { a3 as qe, u as re, af as Qe, D as oe, i as V, h as Xe, f as Ae, ag as le, s as Ze, ah as Ee, v as Ue, a as ie, b as et, w as tt, x as Ve, y as nt, z as ot, ai as st, e as H, G as O, K as lt, aj as at, m as rt, E as Ne, A as it, ak as ct, al as se, B as mt, _ as ut, C as dt } from "./app-BQG51ddI.js";
3
+ import { useCoreStore as ce, useI18n as z } from "@feedmepos/mf-common";
4
+ import { useDialogChild as pt, useSnackbar as ee, useDialog as me, FmButtonVariant as Z, components as B, useProxiedModel as ft, useBreakpoints as vt } from "@feedmepos/ui-library";
5
5
  import { defineStore as Be, storeToRefs as Le } from "pinia";
6
- import { u as gt } from "./use-ingredient-select-dialog-Cp9Z0ZMi.js";
6
+ import { u as gt } from "./use-ingredient-select-dialog-DV9ryvA0.js";
7
7
  const te = qe((r, o) => {
8
8
  function n() {
9
9
  var e;
@@ -46,29 +46,29 @@ const te = qe((r, o) => {
46
46
  }), ne = Be(
47
47
  "closingTemplateTable",
48
48
  function() {
49
- const { t: o } = B(), n = ae(), l = M({}), t = M(new Array()), e = M(!1), b = re(), u = te();
50
- async function v() {
49
+ const { t: o } = z(), n = ae(), l = F({}), t = F(new Array()), e = F(!1), b = re(), m = te();
50
+ async function f() {
51
51
  if (t.value = [], !!b._currentLocation) {
52
52
  e.value = !0;
53
53
  try {
54
- const [g, _] = await Promise.all([
55
- u.readTemplates(),
56
- u.getRecentPublishingJob()
54
+ const [v, _] = await Promise.all([
55
+ m.readTemplates(),
56
+ m.getRecentPublishingJob()
57
57
  ]).delayed(1e3);
58
- t.value = g, l.value = _;
59
- } catch (g) {
60
- console.log("Something went wrong when fetching templates:", g);
58
+ t.value = v, l.value = _;
59
+ } catch (v) {
60
+ console.log("Something went wrong when fetching templates:", v);
61
61
  } finally {
62
62
  e.value = !1;
63
63
  }
64
64
  }
65
65
  }
66
- async function a(g) {
66
+ async function a(v) {
67
67
  if (!t.value.find((_) => _._id) && b._currentLocation) {
68
68
  e.value = !0;
69
69
  try {
70
70
  const [_] = await Promise.all([
71
- u.getTemplate(g),
71
+ m.getTemplate(v),
72
72
  new Promise((c) => setTimeout(c, 1e3))
73
73
  ]);
74
74
  t.value = [_];
@@ -79,16 +79,16 @@ const te = qe((r, o) => {
79
79
  }
80
80
  }
81
81
  }
82
- function d(g, _) {
83
- switch (_ = Ae(_), g) {
82
+ function u(v, _) {
83
+ switch (_ = Ae(_), v) {
84
84
  case V.Details:
85
85
  return n.viewTemplate(_);
86
86
  case V.Edit:
87
87
  return n.updateTemplate(_);
88
88
  case V.Delete:
89
- return n.deleteTemplate(_, e, v);
89
+ return n.deleteTemplate(_, e, f);
90
90
  case V.Duplicate:
91
- return n.duplicateTemplate(_, e, v);
91
+ return n.duplicateTemplate(_, e, f);
92
92
  }
93
93
  }
94
94
  return {
@@ -97,8 +97,8 @@ const te = qe((r, o) => {
97
97
  id: "_id",
98
98
  accessorKey: "_id",
99
99
  header: () => o("inventory.closing.table.createdAt"),
100
- cell(g) {
101
- return Qe(`${g.getValue()}`);
100
+ cell(v) {
101
+ return Qe(`${v.getValue()}`);
102
102
  },
103
103
  enableSorting: !0
104
104
  },
@@ -123,9 +123,9 @@ const te = qe((r, o) => {
123
123
  id: "enabledLocations",
124
124
  accessorKey: "locations.length",
125
125
  header: () => o("inventory.closing.table.enabledOutlets"),
126
- cell(g) {
126
+ cell(v) {
127
127
  var c;
128
- const _ = (c = g.row.original.locations) == null ? void 0 : c.length;
128
+ const _ = (c = v.row.original.locations) == null ? void 0 : c.length;
129
129
  return _ ? `${_}` : "All";
130
130
  },
131
131
  enableSorting: !1,
@@ -145,36 +145,36 @@ const te = qe((r, o) => {
145
145
  id: "status",
146
146
  header: () => o("inventory.closing.table.status"),
147
147
  enableSorting: !1,
148
- cell(g) {
149
- var y;
150
- const _ = g.row.original, c = _._rev, i = (y = l.value.publishedRevs) == null ? void 0 : y[_._id], f = c === i;
151
- return P(
148
+ cell(v) {
149
+ var g;
150
+ const _ = v.row.original, c = _._rev, i = (g = l.value.publishedRevs) == null ? void 0 : g[_._id], p = c === i;
151
+ return M(
152
152
  "div",
153
153
  {
154
154
  class: "flex"
155
155
  },
156
- P(
156
+ M(
157
157
  "div",
158
158
  {
159
159
  class: [
160
160
  "fm-status-badge",
161
- f ? "fm-status-badge-success-secondary" : "fm-status-badge-info-secondary"
161
+ p ? "fm-status-badge-success-secondary" : "fm-status-badge-info-secondary"
162
162
  ]
163
163
  },
164
- f ? "Published" : "Unpublished"
164
+ p ? "Published" : "Unpublished"
165
165
  )
166
166
  );
167
167
  }
168
168
  },
169
169
  {
170
170
  id: "action",
171
- cell(g) {
172
- const _ = g.row.original, c = [
171
+ cell(v) {
172
+ const _ = v.row.original, c = [
173
173
  oe[V.Edit],
174
174
  oe[V.Duplicate],
175
175
  oe[V.Delete]
176
176
  ];
177
- return Xe(c, (i) => d(i, _));
177
+ return Xe(c, (i) => u(i, _));
178
178
  },
179
179
  enableSorting: !1,
180
180
  size: 40,
@@ -187,7 +187,7 @@ const te = qe((r, o) => {
187
187
  recentPublish: l,
188
188
  templates: t,
189
189
  loading: e,
190
- fetchTemplates: v,
190
+ fetchTemplates: f,
191
191
  loadTemplate: a
192
192
  };
193
193
  }
@@ -229,36 +229,36 @@ function He() {
229
229
  ];
230
230
  }
231
231
  function yt(r) {
232
- var u;
233
- const n = ce().currentBusiness.value, t = (u = r.map((v) => {
232
+ var m;
233
+ const n = ce().currentBusiness.value, t = (m = r.map((f) => {
234
234
  var c;
235
- const a = v.items.flatMap(ze), d = He(), p = [
236
- ["Template ID", v._id],
237
- ["Template name", v.name],
235
+ const a = f.items.flatMap(ze), u = He(), d = [
236
+ ["Template ID", f._id],
237
+ ["Template name", f.name],
238
238
  ["Business name", n == null ? void 0 : n.name],
239
239
  ["Business ID", n == null ? void 0 : n._id],
240
240
  ["Menu version", n == null ? void 0 : n.menuVersion],
241
241
  [
242
242
  "Locations",
243
- ...(c = v.locations) != null && c.length ? v.locations.map((i) => `${i.name} (${i.dbName})`) : ["All"]
243
+ ...(c = f.locations) != null && c.length ? f.locations.map((i) => `${i.name} (${i.dbName})`) : ["All"]
244
244
  ],
245
- ["Reference", v.ref ?? ""],
245
+ ["Reference", f.ref ?? ""],
246
246
  [],
247
- d.map((i) => i.name),
248
- ...a.map((i) => d.map((f) => i[f.id]))
249
- ], g = d.map((i) => `system:${i.id}`), _ = le(p, g);
250
- return { name: v.name, sheet: _ };
247
+ u.map((i) => i.name),
248
+ ...a.map((i) => u.map((p) => i[p.id]))
249
+ ], v = u.map((i) => `system:${i.id}`), _ = le(d, v);
250
+ return { name: f.name, sheet: _ };
251
251
  }).reduce(
252
- (v, a) => {
253
- var p;
254
- const d = a.name.slice(0, 12);
255
- return (p = v.sheetOccurence)[d] ?? (p[d] = 0), v.sheetOccurence[d] += 1, v.sheets[`${d} (${v.sheetOccurence[d]})`] = a.sheet, v;
252
+ (f, a) => {
253
+ var d;
254
+ const u = a.name.slice(0, 12);
255
+ return (d = f.sheetOccurence)[u] ?? (d[u] = 0), f.sheetOccurence[u] += 1, f.sheets[`${u} (${f.sheetOccurence[u]})`] = a.sheet, f;
256
256
  },
257
257
  {
258
258
  sheets: {},
259
259
  sheetOccurence: {}
260
260
  }
261
- )) == null ? void 0 : u.sheets, e = `${n == null ? void 0 : n.name} closing templates (${Ze(/* @__PURE__ */ new Date())}).xlsx`, b = Ee(t);
261
+ )) == null ? void 0 : m.sheets, e = `${n == null ? void 0 : n.name} closing templates (${Ze(/* @__PURE__ */ new Date())}).xlsx`, b = Ee(t);
262
262
  return Ue(b, e), e;
263
263
  }
264
264
  function ht() {
@@ -290,17 +290,17 @@ function ht() {
290
290
  [],
291
291
  e.map((c) => c.name),
292
292
  e.map((c) => l[c.id])
293
- ], u = e.map((c) => `system:${c.id}`), v = le(b, u), a = n.isEnabled ? n.state.setting.childItems ?? [] : [], d = a.reduce(
293
+ ], m = e.map((c) => `system:${c.id}`), f = le(b, m), a = n.isEnabled ? n.state.setting.childItems ?? [] : [], u = a.reduce(
294
294
  (c, i) => {
295
- var m, w;
296
- const f = (m = n.netSuiteItemIdToSkuId.get(i.parentNetSuiteId)) == null ? void 0 : m[0], y = (w = n.netSuiteMeasurementIdToMeasurementId.get(
295
+ var y, x;
296
+ const p = (y = n.netSuiteItemIdToSkuId.get(i.parentNetSuiteId)) == null ? void 0 : y[0], g = (x = n.netSuiteMeasurementIdToMeasurementId.get(
297
297
  i.unitOfMeasureId
298
- )) == null ? void 0 : w[0];
298
+ )) == null ? void 0 : x[0];
299
299
  if (!i.externalId)
300
300
  return c;
301
- if (!f)
301
+ if (!p)
302
302
  return console.error(`Item ${i.externalId} cannot be mapped to parent FdoInventorySku.`, i), c;
303
- const s = o.skuById[f], k = s.unit.measurements.find((S) => S.id === y);
303
+ const s = o.skuById[p], k = s.unit.measurements.find((S) => S.id === g);
304
304
  return k ? (c[i.externalId] = {
305
305
  sku: s,
306
306
  measurement: k
@@ -310,22 +310,22 @@ function ht() {
310
310
  ), c);
311
311
  },
312
312
  {}
313
- ), p = le(
313
+ ), d = le(
314
314
  [
315
315
  ...o.skus.flatMap((c) => [
316
316
  [c.code, c.name, c.unit.abbrev, !0],
317
- ...c.unit.measurements.map((f) => [
317
+ ...c.unit.measurements.map((p) => [
318
318
  "",
319
319
  "",
320
- f.abbrev,
321
- !f.abbrev.toLocaleLowerCase("en-us").includes("inactive")
320
+ p.abbrev,
321
+ !p.abbrev.toLocaleLowerCase("en-us").includes("inactive")
322
322
  ])
323
323
  ]),
324
- ...Object.entries(d).map(([c, { sku: i, measurement: f }]) => [
324
+ ...Object.entries(u).map(([c, { sku: i, measurement: p }]) => [
325
325
  i.code,
326
326
  i.name,
327
- f.abbrev,
328
- !f.abbrev.toLocaleLowerCase("en-us").includes("inactive"),
327
+ p.abbrev,
328
+ !p.abbrev.toLocaleLowerCase("en-us").includes("inactive"),
329
329
  c
330
330
  ])
331
331
  ],
@@ -336,29 +336,29 @@ function ht() {
336
336
  "Enabled (true/false)",
337
337
  ...a.length ? ["Netsuite Parent"] : []
338
338
  ]
339
- ), g = Ee({
340
- Template: v,
341
- Ingredients: p
339
+ ), v = Ee({
340
+ Template: f,
341
+ Ingredients: d
342
342
  }), _ = `${t == null ? void 0 : t.name} transfer templates import.xlsx`;
343
- return Ue(g, _), _;
343
+ return Ue(v, _), _;
344
344
  }
345
345
  function bt(r) {
346
346
  if (!r.length || `${r[0]}`.toLocaleLowerCase() === "all")
347
347
  return [];
348
348
  const o = /(.*) \(((warehouse_|restaurant_).{24,})\)/, l = re().locationByDbName;
349
349
  return r.map((t) => {
350
- const e = new Array(), b = t.trim(), u = o.exec(b);
351
- if (!u)
350
+ const e = new Array(), b = t.trim(), m = o.exec(b);
351
+ if (!m)
352
352
  return e.push(`Enabled location value of ${b} cannot be read.`), {
353
353
  errors: e
354
354
  };
355
- const v = u[1], a = u[2], d = l[a];
356
- return d ? (v !== d.name && e.push(
357
- `Location id ${a} has non-matching name. Found ${v} but expected ${d.name}`
355
+ const f = m[1], a = m[2], u = l[a];
356
+ return u ? (f !== u.name && e.push(
357
+ `Location id ${a} has non-matching name. Found ${f} but expected ${u.name}`
358
358
  ), {
359
359
  errors: e,
360
- location: d
361
- }) : (e.push(`Location (${v}) of id ${a} is not found.`), {
360
+ location: u
361
+ }) : (e.push(`Location (${f}) of id ${a} is not found.`), {
362
362
  errors: e
363
363
  });
364
364
  });
@@ -371,14 +371,14 @@ function _t(r) {
371
371
  t,
372
372
  e,
373
373
  b,
374
- u,
375
- v
374
+ m,
375
+ f
376
376
  ] = Ve(r);
377
377
  return {
378
378
  id: `${n[1] ?? ""}`.trim(),
379
379
  name: `${l[1] ?? ""}`.trim(),
380
- locations: u.slice(1).map((a) => `${a}`.trim()).filter((a) => a),
381
- reference: `${v[1] ?? ""}`.trim()
380
+ locations: m.slice(1).map((a) => `${a}`.trim()).filter((a) => a),
381
+ reference: `${f[1] ?? ""}`.trim()
382
382
  };
383
383
  }
384
384
  function xt(r) {
@@ -389,27 +389,27 @@ function xt(r) {
389
389
  t,
390
390
  e,
391
391
  b,
392
- u,
393
- v,
392
+ m,
393
+ f,
394
394
  a,
395
- d,
396
- ...p
395
+ u,
396
+ ...d
397
397
  ] = Ve(r);
398
- if (!o || !o.length || o.some((f) => f.length && !f.startsWith("system:")))
398
+ if (!o || !o.length || o.some((p) => p.length && !p.startsWith("system:")))
399
399
  throw new Error("Missing meta header. Excel file does not come from the template.");
400
- const g = o.map((f) => f.split(":")[1]), c = ["code", "name", "unit", "enabled"].filter((f) => !g.includes(f));
400
+ const v = o.map((p) => p.split(":")[1]), c = ["code", "name", "unit", "enabled"].filter((p) => !v.includes(p));
401
401
  if (c.length)
402
402
  throw new Error(
403
403
  `Missing meta headers (${c.join()}). Excel file does not come from the template.`
404
404
  );
405
- return p.map((f, y) => {
405
+ return d.map((p, g) => {
406
406
  const s = {};
407
- for (const k in g) {
408
- const m = g[k];
409
- Object.assign(s, { [m]: f[k] });
407
+ for (const k in v) {
408
+ const y = v[k];
409
+ Object.assign(s, { [y]: p[k] });
410
410
  }
411
411
  return {
412
- index: y,
412
+ index: g,
413
413
  data: s
414
414
  };
415
415
  });
@@ -430,21 +430,21 @@ function kt(r) {
430
430
  return n.push(`Cannot find ingredient of code ${o.code} ${o.name}`), { errors: n };
431
431
  const e = {
432
432
  sku: t
433
- }, b = /* @__PURE__ */ new Set([t.unit._id, ...t.unit.measurements.map((v) => v.id)]), u = t.unit.measurements.find((v) => v.abbrev === o.unit);
434
- o.unit !== t.unit.abbrev && !u ? n.push(
433
+ }, b = /* @__PURE__ */ new Set([t.unit._id, ...t.unit.measurements.map((f) => f.id)]), m = t.unit.measurements.find((f) => f.abbrev === o.unit);
434
+ o.unit !== t.unit.abbrev && !m ? n.push(
435
435
  `Cannot find measurement unit of ${o.unit} for (${o.code}) ${o.name}.`
436
436
  ) : (o.enabled === !0 || `${o.enabled}`.toLocaleLowerCase() === "true") && b.delete(t.unit._id);
437
- for (const v of r.children) {
438
- const a = v.data, d = a.unit === t.unit.abbrev ? t.unit : void 0, p = t.unit.measurements.find((g) => g.abbrev === a.unit);
439
- if (!p && !d) {
437
+ for (const f of r.children) {
438
+ const a = f.data, u = a.unit === t.unit.abbrev ? t.unit : void 0, d = t.unit.measurements.find((v) => v.abbrev === a.unit);
439
+ if (!d && !u) {
440
440
  n.push(
441
441
  `Cannot find measurement unit of ${a.unit} for (${o.code}) ${o.name}.`
442
442
  );
443
443
  continue;
444
444
  }
445
- (a.enabled === !0 || `${a.enabled}`.toLocaleLowerCase() === "true") && b.delete((p == null ? void 0 : p.id) ?? (d == null ? void 0 : d._id) ?? "");
445
+ (a.enabled === !0 || `${a.enabled}`.toLocaleLowerCase() === "true") && b.delete((d == null ? void 0 : d.id) ?? (u == null ? void 0 : u._id) ?? "");
446
446
  }
447
- return b.has(t.unit._id) && e.sku.unit.measurements.every((v) => b.has(v.id)) && n.push(`Ingredient ${t.code} - ${t.name} must have at least one unit enabled.`), e.disabledMeasurements = [...b], { errors: n, templateItem: e };
447
+ return b.has(t.unit._id) && e.sku.unit.measurements.every((f) => b.has(f.id)) && n.push(`Ingredient ${t.code} - ${t.name} must have at least one unit enabled.`), e.disabledMeasurements = [...b], { errors: n, templateItem: e };
448
448
  }
449
449
  function Tt(r) {
450
450
  const o = r.SheetNames.filter(
@@ -453,32 +453,32 @@ function Tt(r) {
453
453
  try {
454
454
  return o.reduce(
455
455
  (e, b) => {
456
- const u = new Array(), v = r.Sheets[b], a = _t(v), d = bt(a.locations), p = d.filter((s) => s.location).map((s) => s.location);
457
- u.push(...d.flatMap((s) => s.errors));
458
- const g = xt(v).filter(
456
+ const m = new Array(), f = r.Sheets[b], a = _t(f), u = bt(a.locations), d = u.filter((s) => s.location).map((s) => s.location);
457
+ m.push(...u.flatMap((s) => s.errors));
458
+ const v = xt(f).filter(
459
459
  (s) => s.data.code || s.data.unit
460
- ), _ = wt(g);
461
- u.push(..._.errors);
460
+ ), _ = wt(v);
461
+ m.push(..._.errors);
462
462
  const c = _.result.map(
463
463
  (s) => kt(s)
464
464
  );
465
- u.push(...c.flatMap((s) => s.errors));
465
+ m.push(...c.flatMap((s) => s.errors));
466
466
  const i = c.filter((s) => s.templateItem).map((s) => s.templateItem);
467
467
  if (a.id) {
468
468
  const s = t[a.id];
469
469
  if (!s) {
470
- const m = {
470
+ const y = {
471
471
  _id: a.id,
472
472
  _rev: "",
473
473
  name: a.name || `(unnamed from sheet ${b || "<unnamed sheet>"})`,
474
474
  items: []
475
475
  };
476
- return u.push(`Template ID ${a.id} is not found.`), e.importUpdateResult.push({
476
+ return m.push(`Template ID ${a.id} is not found.`), e.importUpdateResult.push({
477
477
  type: "update",
478
- original: m,
479
- template: m,
478
+ original: y,
479
+ template: y,
480
480
  excelSheetName: b,
481
- errors: u
481
+ errors: m
482
482
  }), e;
483
483
  }
484
484
  const k = {
@@ -487,27 +487,27 @@ function Tt(r) {
487
487
  template: {
488
488
  ...s,
489
489
  name: a.name,
490
- locations: p.length ? p : null,
490
+ locations: d.length ? d : null,
491
491
  ref: a.reference,
492
492
  items: i
493
493
  },
494
494
  excelSheetName: b,
495
- errors: u
495
+ errors: m
496
496
  };
497
497
  return e.importUpdateResult.push(k), e;
498
498
  }
499
- const y = {
499
+ const g = {
500
500
  type: "create",
501
501
  template: {
502
502
  name: a.name,
503
- locations: p.length ? p : null,
503
+ locations: d.length ? d : null,
504
504
  ref: a.reference,
505
505
  items: i
506
506
  },
507
507
  excelSheetName: b,
508
- errors: u
508
+ errors: m
509
509
  };
510
- return e.importCreateResult.push(y), e;
510
+ return e.importCreateResult.push(g), e;
511
511
  },
512
512
  {
513
513
  invalidExcel: !1,
@@ -527,7 +527,7 @@ function Tt(r) {
527
527
  const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-col" }, It = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, St = {
528
528
  key: 0,
529
529
  class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
530
- }, Dt = { key: 0 }, Me = /* @__PURE__ */ j({
530
+ }, Dt = { key: 0 }, Me = /* @__PURE__ */ L({
531
531
  __name: "ClosingTemplateImportItem",
532
532
  props: {
533
533
  type: {},
@@ -537,15 +537,15 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
537
537
  errors: {}
538
538
  },
539
539
  setup(r) {
540
- const { t: o } = B();
540
+ const { t: o } = z();
541
541
  return (n, l) => {
542
- var b, u, v;
542
+ var b, m, f;
543
543
  const t = R("FmIcon"), e = R("FmTooltip");
544
544
  return T(), I("div", $t, [
545
- l[0] || (l[0] = x("div", null, "•", -1)),
546
- x("div", Ct, [
547
- x("div", It, [
548
- x("div", {
545
+ l[0] || (l[0] = w("div", null, "•", -1)),
546
+ w("div", Ct, [
547
+ w("div", It, [
548
+ w("div", {
549
549
  class: Y({
550
550
  "text-fm-color-system-error-300": n.errors.length
551
551
  })
@@ -556,8 +556,8 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
556
556
  n.errors.length ? (T(), I("div", Dt, [
557
557
  $(e, { "z-index": 50 }, {
558
558
  content: A(() => [
559
- x("ol", null, [
560
- (T(!0), I(H, null, J(n.errors, (a, d) => (T(), I("li", { key: d }, C(a), 1))), 128))
559
+ w("ol", null, [
560
+ (T(!0), I(j, null, J(n.errors, (a, u) => (T(), I("li", { key: u }, C(a), 1))), 128))
561
561
  ])
562
562
  ]),
563
563
  default: A(() => [
@@ -571,7 +571,7 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
571
571
  })
572
572
  ])) : G("", !0)
573
573
  ]),
574
- x("div", {
574
+ w("div", {
575
575
  class: Y([
576
576
  "fm-typo-en-body-sm-400",
577
577
  {
@@ -579,7 +579,7 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
579
579
  "text-fm-color-typo-secondary": !n.errors.length
580
580
  }
581
581
  ])
582
- }, C((b = n.locations) != null && b.length ? h(o)("inventory.closing.template.import.nLocations", { count: (u = n.locations) == null ? void 0 : u.length }) : h(o)("inventory.closing.template.import.allLocations")) + ", " + C(h(o)("inventory.closing.template.import.nItems", { count: (v = n.items) == null ? void 0 : v.length })), 3)
582
+ }, C((b = n.locations) != null && b.length ? h(o)("inventory.closing.template.import.nLocations", { count: (m = n.locations) == null ? void 0 : m.length }) : h(o)("inventory.closing.template.import.allLocations")) + ", " + C(h(o)("inventory.closing.template.import.nItems", { count: (f = n.items) == null ? void 0 : f.length })), 3)
583
583
  ])
584
584
  ]);
585
585
  };
@@ -596,16 +596,16 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
596
596
  }, Nt = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, Bt = {
597
597
  key: 0,
598
598
  class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
599
- }, Lt = { class: "fm-typo-en-body-lg-600" }, zt = /* @__PURE__ */ j({
599
+ }, Lt = { class: "fm-typo-en-body-lg-600" }, zt = /* @__PURE__ */ L({
600
600
  __name: "ClosingTemplateImport",
601
601
  setup(r) {
602
- const o = M(null), n = pt(), l = ee(), t = M(!1), e = M(!1), b = M(new Array()), u = M([]), v = M([]), a = E(
603
- () => !!b.value.length || u.value.some((_) => _.errors.length) || v.value.some((_) => _.errors.length)
604
- ), d = E(
605
- () => !!u.value.length || !!v.value.length
606
- ), { t: p } = B();
607
- async function g(_) {
608
- b.value = [], u.value = [], v.value = [];
602
+ const o = F(null), n = pt(), l = ee(), t = F(!1), e = F(!1), b = F(new Array()), m = F([]), f = F([]), a = E(
603
+ () => !!b.value.length || m.value.some((_) => _.errors.length) || f.value.some((_) => _.errors.length)
604
+ ), u = E(
605
+ () => !!m.value.length || !!f.value.length
606
+ ), { t: d } = z();
607
+ async function v(_) {
608
+ b.value = [], m.value = [], f.value = [];
609
609
  try {
610
610
  t.value = !0;
611
611
  const [c] = await Promise.all([
@@ -616,49 +616,49 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
616
616
  if (!c.SheetNames.filter(
617
617
  (s) => !Object.values(ue).map(String).includes(s)
618
618
  ).find((s) => s)) {
619
- b.value.push(p("inventory.ingredient.import.fileError.noSheet"));
619
+ b.value.push(d("inventory.ingredient.import.fileError.noSheet"));
620
620
  return;
621
621
  }
622
- const y = Tt(c);
623
- if (y.invalidExcel) {
622
+ const g = Tt(c);
623
+ if (g.invalidExcel) {
624
624
  b.value.push(
625
- y.invalidExcelMessage ?? p("inventory.ingredient.import.fileError.invalidExcel")
625
+ g.invalidExcelMessage ?? d("inventory.ingredient.import.fileError.invalidExcel")
626
626
  );
627
627
  return;
628
628
  }
629
- if (u.value = y.importCreateResult, v.value = y.importUpdateResult, !u.value.length && !v.value.length) {
630
- b.value.push(p("inventory.ingredient.import.fileError.noData"));
629
+ if (m.value = g.importCreateResult, f.value = g.importUpdateResult, !m.value.length && !f.value.length) {
630
+ b.value.push(d("inventory.ingredient.import.fileError.noData"));
631
631
  return;
632
632
  }
633
- n.emitData(y);
633
+ n.emitData(g);
634
634
  } catch (c) {
635
635
  l.open({
636
- title: p("inventory.ingredient.import.fileError.unableToRead"),
636
+ title: d("inventory.ingredient.import.fileError.unableToRead"),
637
637
  message: c == null ? void 0 : c.message,
638
638
  type: "error"
639
639
  }), console.error("Error in reading file", c);
640
640
  } finally {
641
641
  b.value.length && l.open({
642
- title: p("inventory.ingredient.import.fileError.invalidExcel"),
642
+ title: d("inventory.ingredient.import.fileError.invalidExcel"),
643
643
  type: "error"
644
644
  }), t.value = !1;
645
645
  }
646
646
  }
647
647
  return Pe(o, (_) => {
648
- _ && g(_);
648
+ _ && v(_);
649
649
  }), (_, c) => {
650
- const i = R("FmCircularProgress"), f = R("FmIcon"), y = R("FmButton");
650
+ const i = R("FmCircularProgress"), p = R("FmIcon"), g = R("FmButton");
651
651
  return T(), I("div", Mt, [
652
- x("div", Ft, C(h(p)("inventory.closing.template.import.message")), 1),
652
+ w("div", Ft, C(h(d)("inventory.closing.template.import.message")), 1),
653
653
  e.value ? (T(), I("div", Pt, [
654
- x("div", null, [
654
+ w("div", null, [
655
655
  $(i, {
656
656
  size: "md",
657
657
  color: "neutral-gray-200"
658
658
  })
659
659
  ]),
660
- x("div", Rt, C(h(p)("inventory.formField.loading")), 1)
661
- ])) : (T(), I(H, { key: 1 }, [
660
+ w("div", Rt, C(h(d)("inventory.formField.loading")), 1)
661
+ ])) : (T(), I(j, { key: 1 }, [
662
662
  $(nt, {
663
663
  class: Y({
664
664
  "w-full": !0,
@@ -666,14 +666,14 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
666
666
  }),
667
667
  accept: ".xlsx",
668
668
  onFileUpload: c[0] || (c[0] = (s) => o.value = s),
669
- label: h(p)("inventory.ingredient.import.uploadTemplate"),
670
- "button-label": h(p)("inventory.ingredient.import.selectFile")
669
+ label: h(d)("inventory.ingredient.import.uploadTemplate"),
670
+ "button-label": h(d)("inventory.ingredient.import.selectFile")
671
671
  }, Re({ _: 2 }, [
672
672
  o.value ? {
673
673
  name: "default",
674
674
  fn: A(({ openFileDialog: s }) => [
675
- x("div", At, [
676
- x("div", {
675
+ w("div", At, [
676
+ w("div", {
677
677
  class: Y([
678
678
  "fm-corner-radius-md p-16 flex items-center gap-16",
679
679
  {
@@ -687,13 +687,13 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
687
687
  key: 0,
688
688
  size: "md",
689
689
  color: "neutral-gray-200"
690
- })) : (T(), N(f, {
690
+ })) : (T(), N(p, {
691
691
  key: 1,
692
692
  name: a.value ? "error" : "attach_file",
693
693
  outline: "",
694
694
  color: a.value ? "system-error-300" : void 0
695
695
  }, null, 8, ["name", "color"])),
696
- x("div", {
696
+ w("div", {
697
697
  class: Y([
698
698
  "fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center",
699
699
  {
@@ -702,11 +702,11 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
702
702
  }
703
703
  ])
704
704
  }, [
705
- x("div", Et, C(o.value.name), 1)
705
+ w("div", Et, C(o.value.name), 1)
706
706
  ], 2),
707
707
  t.value ? G("", !0) : (T(), I("div", Ut, [
708
- $(y, {
709
- label: h(p)("inventory.ingredient.import.replaceFile"),
708
+ $(g, {
709
+ label: h(d)("inventory.ingredient.import.replaceFile"),
710
710
  variant: a.value ? "destructive" : "secondary",
711
711
  "prepend-icon": a.value ? void 0 : "autorenew",
712
712
  onClick: s
@@ -714,16 +714,16 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
714
714
  ]))
715
715
  ], 2),
716
716
  b.value.length ? (T(), I("div", Vt, [
717
- (T(!0), I(H, null, J(b.value, (k, m) => (T(), I("div", {
718
- key: m,
717
+ (T(!0), I(j, null, J(b.value, (k, y) => (T(), I("div", {
718
+ key: y,
719
719
  class: "flex gap-8 items-center"
720
720
  }, [
721
- $(f, {
721
+ $(p, {
722
722
  name: "error",
723
723
  size: "sm",
724
724
  color: "system-error-300"
725
725
  }),
726
- x("div", Nt, C(k), 1)
726
+ w("div", Nt, C(k), 1)
727
727
  ]))), 128))
728
728
  ])) : G("", !0)
729
729
  ])
@@ -731,9 +731,9 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
731
731
  key: "0"
732
732
  } : void 0
733
733
  ]), 1032, ["class", "label", "button-label"]),
734
- d.value ? (T(), I("div", Bt, [
735
- x("div", Lt, C(h(p)("inventory.ingredient.import.summary")), 1),
736
- (T(!0), I(H, null, J(u.value, (s, k) => (T(), N(Me, {
734
+ u.value ? (T(), I("div", Bt, [
735
+ w("div", Lt, C(h(d)("inventory.ingredient.import.summary")), 1),
736
+ (T(!0), I(j, null, J(m.value, (s, k) => (T(), N(Me, {
737
737
  key: k,
738
738
  name: s.template.name,
739
739
  locations: s.template.locations,
@@ -741,7 +741,7 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
741
741
  errors: s.errors,
742
742
  type: "create"
743
743
  }, null, 8, ["name", "locations", "items", "errors"]))), 128)),
744
- (T(!0), I(H, null, J(v.value, (s) => (T(), N(Me, {
744
+ (T(!0), I(j, null, J(f.value, (s) => (T(), N(Me, {
745
745
  key: s.template._id,
746
746
  name: s.template.name,
747
747
  locations: s.template.locations,
@@ -755,29 +755,29 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
755
755
  };
756
756
  }
757
757
  }), ae = Be("closingTemplateActions", () => {
758
- const { t: r } = B(), o = me(), n = ee(), l = te(), t = st(), e = ne(), { loading: b } = Le(e), u = M({});
759
- function v() {
760
- u.value = {
761
- mode: z.CREATE,
758
+ const { t: r } = z(), o = me(), n = ee(), l = te(), t = st(), e = ne(), { loading: b } = Le(e), m = F({});
759
+ function f() {
760
+ m.value = {
761
+ mode: H.CREATE,
762
762
  show: !0,
763
- "onUpdate:show"(y) {
764
- u.value.show = y;
763
+ "onUpdate:show"(g) {
764
+ m.value.show = g;
765
765
  }
766
766
  };
767
767
  }
768
- function a(y) {
769
- u.value = {
770
- mode: z.UPDATE,
771
- modelValue: y,
768
+ function a(g) {
769
+ m.value = {
770
+ mode: H.UPDATE,
771
+ modelValue: g,
772
772
  show: !0,
773
773
  "onUpdate:show"(s) {
774
- u.value.show = s;
774
+ m.value.show = s;
775
775
  }
776
776
  };
777
777
  }
778
- function d(y, s, k) {
778
+ function u(g, s, k) {
779
779
  o.open({
780
- title: `Confirm deleting template ${y.name}?`,
780
+ title: `Confirm deleting template ${g.name}?`,
781
781
  message: "Deleted template can no longer be retrieved",
782
782
  primaryActions: {
783
783
  text: "Delete",
@@ -791,34 +791,35 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
791
791
  }
792
792
  }).onPrimary(async () => {
793
793
  n.open({
794
- title: `Deleting ${y.name}`,
794
+ title: `Deleting ${g.name}`,
795
795
  type: "info"
796
796
  });
797
797
  try {
798
798
  s.value = !0;
799
- const [m] = await Promise.allSettled([
800
- l.deleteTemplate(y),
801
- new Promise((w) => setTimeout(w, 1e3))
799
+ const [y] = await Promise.allSettled([
800
+ l.deleteTemplate(g),
801
+ new Promise((x) => setTimeout(x, 1e3))
802
802
  ]);
803
- if (m.status === "rejected") throw m.reason;
803
+ if (y.status === "rejected") throw y.reason;
804
804
  n.open({
805
- title: `Deleted ${y.name}`,
805
+ title: `Deleted ${g.name}`,
806
806
  type: "success"
807
807
  });
808
- } catch (m) {
808
+ } catch (y) {
809
809
  n.open({
810
- title: `Unable to delete ${y.name}`,
811
- message: `See error from server: ${m}`,
810
+ title: `Unable to delete ${g.name}`,
811
+ message: `See error from server: ${y}`,
812
812
  type: "error"
813
- }), console.error("error on deleting closing template", m);
813
+ }), console.error("error on deleting closing template", y);
814
814
  } finally {
815
815
  s.value = !1, k();
816
816
  }
817
817
  });
818
818
  }
819
- function p(y, s, k) {
819
+ function d(g, s, k) {
820
+ let y;
820
821
  o.open({
821
- title: `Confirm duplicating template "${y.name}"?`,
822
+ title: `Confirm duplicating template "${g.name}"?`,
822
823
  message: "Duplicated template can be edited after creation",
823
824
  primaryActions: {
824
825
  text: "Duplicate",
@@ -829,44 +830,57 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
829
830
  text: "Cancel",
830
831
  variant: Z.Plain,
831
832
  close: !0
832
- }
833
+ },
834
+ contentComponent: L({
835
+ props: ["modelValue"],
836
+ emits: ["update:modelValue"],
837
+ setup(x) {
838
+ return () => M(B.FmTextField, {
839
+ modelValue: x.modelValue,
840
+ "onUpdate:modelValue": (S) => y = S,
841
+ label: "New Template Name",
842
+ size: "md",
843
+ variant: "primary"
844
+ });
845
+ }
846
+ })
833
847
  }).onPrimary(async () => {
834
848
  n.open({
835
- title: `Duplicating "${y.name}"`,
849
+ title: `Duplicating "${g.name}"`,
836
850
  type: "info"
837
851
  });
838
852
  try {
839
853
  s.value = !0;
840
- const [m] = await Promise.allSettled([
841
- t.duplicateClosingTemplate(y._id),
842
- new Promise((w) => setTimeout(w, 1e3))
854
+ const [x] = await Promise.allSettled([
855
+ t.duplicateClosingTemplate(g._id, y),
856
+ new Promise((S) => setTimeout(S, 1e3))
843
857
  ]);
844
- if (m.status === "rejected") throw m.reason;
858
+ if (x.status === "rejected") throw x.reason;
845
859
  n.open({
846
- title: `Duplicated "${y.name}"`,
860
+ title: `Duplicated "${g.name}"`,
847
861
  type: "success"
848
862
  });
849
- } catch (m) {
863
+ } catch (x) {
850
864
  n.open({
851
- title: `Unable to duplicate "${y.name}"`,
852
- message: `See error from server: ${m}`,
865
+ title: `Unable to duplicate "${g.name}"`,
866
+ message: `See error from server: ${x}`,
853
867
  type: "error"
854
- }), console.error("error on duplicating closing template", m);
868
+ }), console.error("error on duplicating closing template", x);
855
869
  } finally {
856
870
  s.value = !1, k();
857
871
  }
858
872
  });
859
873
  }
860
- const g = M({});
861
- function _(y) {
862
- g.value = {
863
- template: y,
874
+ const v = F({});
875
+ function _(g) {
876
+ v.value = {
877
+ template: g,
864
878
  show: !0,
865
879
  "onUpdate:show"(s) {
866
- g.value.show = s;
880
+ v.value.show = s;
867
881
  },
868
882
  "onAction:edit"() {
869
- g.value.show = !1, a(Ae(y));
883
+ v.value.show = !1, a(Ae(g));
870
884
  }
871
885
  };
872
886
  }
@@ -878,10 +892,10 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
878
892
  });
879
893
  return;
880
894
  }
881
- const y = yt(e.templates);
895
+ const g = yt(e.templates);
882
896
  n.open({
883
897
  title: r("inventory.ingredient.export.success"),
884
- message: r("inventory.ingredient.export.filename", [y]),
898
+ message: r("inventory.ingredient.export.filename", [g]),
885
899
  type: "success"
886
900
  });
887
901
  }
@@ -904,15 +918,15 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
904
918
  close: !1,
905
919
  variant: "plain"
906
920
  }
907
- }).onPrimary((y) => {
908
- if (!y) {
921
+ }).onPrimary((g) => {
922
+ if (!g) {
909
923
  n.open({
910
924
  title: r("inventory.ingredient.import.error.noData"),
911
925
  type: "error"
912
926
  });
913
927
  return;
914
928
  }
915
- if (!y.importCreateResult.length && !y.importUpdateResult.length) {
929
+ if (!g.importCreateResult.length && !g.importUpdateResult.length) {
916
930
  n.open({
917
931
  title: r("inventory.ingredient.import.error.invalidContent"),
918
932
  message: r("inventory.ingredient.import.error.noImportData"),
@@ -920,7 +934,7 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
920
934
  });
921
935
  return;
922
936
  }
923
- if (y.importCreateResult.some((s) => s.errors.length) || y.importUpdateResult.some((s) => s.errors.length)) {
937
+ if (g.importCreateResult.some((s) => s.errors.length) || g.importUpdateResult.some((s) => s.errors.length)) {
924
938
  n.open({
925
939
  title: r("inventory.ingredient.import.error.invalidContent"),
926
940
  message: r("inventory.ingredient.import.error.hasErrors"),
@@ -928,31 +942,31 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
928
942
  });
929
943
  return;
930
944
  }
931
- o.close(), f(y);
945
+ o.close(), p(g);
932
946
  }).onTertiary(ht);
933
947
  }
934
- async function f(y) {
948
+ async function p(g) {
935
949
  b.value = !0;
936
950
  try {
937
951
  const s = [
938
- ...y.importCreateResult.map(
952
+ ...g.importCreateResult.map(
939
953
  (S) => S.template
940
954
  ),
941
- ...y.importUpdateResult.map(
955
+ ...g.importUpdateResult.map(
942
956
  (S) => S.template
943
957
  )
944
958
  ], k = 100;
945
- let m = 0;
946
- const w = () => {
947
- m += k, n.open({
959
+ let y = 0;
960
+ const x = () => {
961
+ y += k, n.open({
948
962
  title: r("inventory.ingredient.import.progress", [
949
- Math.min(m, s.length),
963
+ Math.min(y, s.length),
950
964
  s.length
951
965
  ])
952
966
  });
953
967
  };
954
968
  for (const S of s.chunk(100))
955
- w(), await l.importTemplates(S);
969
+ x(), await l.importTemplates(S);
956
970
  n.open({
957
971
  title: r("inventory.ingredient.import.success"),
958
972
  type: "success"
@@ -962,21 +976,21 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
962
976
  title: r("inventory.ingredient.import.error.failed"),
963
977
  message: r("inventory.ingredient.import.error.systemMessage", [s == null ? void 0 : s.message]),
964
978
  type: "error"
965
- }), console.error("Error in importing skus", y, s);
979
+ }), console.error("Error in importing skus", g, s);
966
980
  } finally {
967
981
  b.value = !1, e.fetchTemplates();
968
982
  }
969
983
  }
970
984
  return {
971
- createTemplate: v,
985
+ createTemplate: f,
972
986
  viewTemplate: _,
973
987
  updateTemplate: a,
974
- deleteTemplate: d,
975
- duplicateTemplate: p,
988
+ deleteTemplate: u,
989
+ duplicateTemplate: d,
976
990
  exportTemplates: c,
977
991
  importTemplates: i,
978
- templateDialogProps: u,
979
- templateDetailsProps: g
992
+ templateDialogProps: m,
993
+ templateDetailsProps: v
980
994
  };
981
995
  });
982
996
  var K = /* @__PURE__ */ ((r) => (r.Name = "Name", r.Unit = "Unit", r.Delete = "Delete", r))(K || {});
@@ -994,19 +1008,19 @@ function Ht(r) {
994
1008
  accessorFn: (t) => `${t.sku.name} ${t.sku.code}`,
995
1009
  cell(t) {
996
1010
  const e = t.row.original;
997
- return P(
1011
+ return M(
998
1012
  "div",
999
1013
  {
1000
1014
  class: "flex flex-col",
1001
1015
  style: { minWidth: "400px" }
1002
1016
  },
1003
1017
  [
1004
- P(
1018
+ M(
1005
1019
  "span",
1006
1020
  { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary line-clamp-1" },
1007
1021
  e.sku.name
1008
1022
  ),
1009
- P(
1023
+ M(
1010
1024
  "span",
1011
1025
  { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary line-clamp-1" },
1012
1026
  e.sku.code
@@ -1022,58 +1036,58 @@ function Ht(r) {
1022
1036
  minSize: 200,
1023
1037
  maxSize: 400,
1024
1038
  cell(t) {
1025
- var b, u, v;
1039
+ var b, m, f;
1026
1040
  const e = t.row.original;
1027
- return P("div", { class: "flex items-center gap-32" }, [
1028
- P(
1029
- L.FmFormGroup,
1041
+ return M("div", { class: "flex items-center gap-32" }, [
1042
+ M(
1043
+ B.FmFormGroup,
1030
1044
  {
1031
1045
  value: e.sku.unit._id,
1032
1046
  modelValue: !((b = e.disabledMeasurements) != null && b.includes(e.sku.unit._id))
1033
1047
  },
1034
- P(
1048
+ M(
1035
1049
  "div",
1036
1050
  {
1037
1051
  class: "flex items-center gap-4",
1038
1052
  style: { width: "120px" }
1039
1053
  },
1040
1054
  [
1041
- P(L.FmCheckbox, {
1055
+ M(B.FmCheckbox, {
1042
1056
  value: e.sku.unit._id,
1043
- modelValue: !((u = e.disabledMeasurements) != null && u.includes(e.sku.unit._id)),
1044
- disabled: r.disabled || !((v = e.disabledMeasurements) != null && v.includes(e.sku.unit._id)) && e.sku.unit.measurements.every(
1057
+ modelValue: !((m = e.disabledMeasurements) != null && m.includes(e.sku.unit._id)),
1058
+ disabled: r.disabled || !((f = e.disabledMeasurements) != null && f.includes(e.sku.unit._id)) && e.sku.unit.measurements.every(
1045
1059
  (a) => {
1046
- var d;
1047
- return (d = e.disabledMeasurements) == null ? void 0 : d.includes(a.id);
1060
+ var u;
1061
+ return (u = e.disabledMeasurements) == null ? void 0 : u.includes(a.id);
1048
1062
  }
1049
1063
  ),
1050
1064
  "onUpdate:modelValue"(a) {
1051
- var d;
1065
+ var u;
1052
1066
  if (a)
1053
1067
  r.updateItem({
1054
1068
  ...e,
1055
- disabledMeasurements: (d = e.disabledMeasurements) == null ? void 0 : d.filter(
1056
- (p) => p !== e.sku.unit._id
1069
+ disabledMeasurements: (u = e.disabledMeasurements) == null ? void 0 : u.filter(
1070
+ (d) => d !== e.sku.unit._id
1057
1071
  )
1058
1072
  });
1059
1073
  else {
1060
- const p = e.disabledMeasurements ?? [];
1074
+ const d = e.disabledMeasurements ?? [];
1061
1075
  r.updateItem({
1062
1076
  ...e,
1063
- disabledMeasurements: [...p, e.sku.unit._id]
1077
+ disabledMeasurements: [...d, e.sku.unit._id]
1064
1078
  });
1065
1079
  }
1066
1080
  }
1067
1081
  }),
1068
- P(
1069
- L.FmTooltip,
1082
+ M(
1083
+ B.FmTooltip,
1070
1084
  { zIndex: 51 },
1071
1085
  {
1072
1086
  content() {
1073
1087
  return e.sku.unit.abbrev;
1074
1088
  },
1075
1089
  default() {
1076
- return P(
1090
+ return M(
1077
1091
  "div",
1078
1092
  { class: "line-clamp-2 fm-typo-en-body-lg-400" },
1079
1093
  e.sku.unit.abbrev
@@ -1084,59 +1098,59 @@ function Ht(r) {
1084
1098
  ]
1085
1099
  )
1086
1100
  ),
1087
- ...Array.from({ length: Math.max(n, 0) }).map((a, d) => {
1088
- var _, c, i, f;
1089
- const p = t.row.original, g = p.sku.unit.measurements[d];
1090
- return g ? P(
1091
- L.FmFormGroup,
1101
+ ...Array.from({ length: Math.max(n, 0) }).map((a, u) => {
1102
+ var _, c, i, p;
1103
+ const d = t.row.original, v = d.sku.unit.measurements[u];
1104
+ return v ? M(
1105
+ B.FmFormGroup,
1092
1106
  {
1093
- modelValue: !((_ = p.disabledMeasurements) != null && _.includes(g.id)),
1094
- value: g.id
1107
+ modelValue: !((_ = d.disabledMeasurements) != null && _.includes(v.id)),
1108
+ value: v.id
1095
1109
  },
1096
- P(
1110
+ M(
1097
1111
  "div",
1098
1112
  {
1099
1113
  class: "flex items-center gap-4",
1100
1114
  style: { width: "120px" }
1101
1115
  },
1102
1116
  [
1103
- P(L.FmCheckbox, {
1104
- value: g.id,
1105
- modelValue: !((c = p.disabledMeasurements) != null && c.includes(g.id)),
1106
- disabled: r.disabled || !((i = p.disabledMeasurements) != null && i.includes(g.id)) && ((f = p.disabledMeasurements) == null ? void 0 : f.includes(p.sku.unit._id)) && p.sku.unit.measurements.filter((y) => y.id != g.id).every((y) => {
1117
+ M(B.FmCheckbox, {
1118
+ value: v.id,
1119
+ modelValue: !((c = d.disabledMeasurements) != null && c.includes(v.id)),
1120
+ disabled: r.disabled || !((i = d.disabledMeasurements) != null && i.includes(v.id)) && ((p = d.disabledMeasurements) == null ? void 0 : p.includes(d.sku.unit._id)) && d.sku.unit.measurements.filter((g) => g.id != v.id).every((g) => {
1107
1121
  var s;
1108
- return (s = p.disabledMeasurements) == null ? void 0 : s.includes(y.id);
1122
+ return (s = d.disabledMeasurements) == null ? void 0 : s.includes(g.id);
1109
1123
  }),
1110
- "onUpdate:modelValue"(y) {
1124
+ "onUpdate:modelValue"(g) {
1111
1125
  var s;
1112
- if (y)
1126
+ if (g)
1113
1127
  r.updateItem({
1114
- ...p,
1115
- disabledMeasurements: (s = p.disabledMeasurements) == null ? void 0 : s.filter(
1116
- (k) => k !== g.id
1128
+ ...d,
1129
+ disabledMeasurements: (s = d.disabledMeasurements) == null ? void 0 : s.filter(
1130
+ (k) => k !== v.id
1117
1131
  )
1118
1132
  });
1119
1133
  else {
1120
- const k = p.disabledMeasurements ?? [];
1134
+ const k = d.disabledMeasurements ?? [];
1121
1135
  r.updateItem({
1122
- ...p,
1123
- disabledMeasurements: [...k, g.id]
1136
+ ...d,
1137
+ disabledMeasurements: [...k, v.id]
1124
1138
  });
1125
1139
  }
1126
1140
  }
1127
1141
  }),
1128
- P(
1129
- L.FmTooltip,
1142
+ M(
1143
+ B.FmTooltip,
1130
1144
  { zIndex: 51 },
1131
1145
  {
1132
1146
  content() {
1133
- return g.abbrev;
1147
+ return v.abbrev;
1134
1148
  },
1135
1149
  default() {
1136
- return P(
1150
+ return M(
1137
1151
  "div",
1138
1152
  { class: "line-clamp-2 fm-typo-en-body-lg-400" },
1139
- g.abbrev
1153
+ v.abbrev
1140
1154
  );
1141
1155
  }
1142
1156
  }
@@ -1153,10 +1167,10 @@ function Ht(r) {
1153
1167
  header: "",
1154
1168
  cell(t) {
1155
1169
  const e = t.row.original;
1156
- return P(
1170
+ return M(
1157
1171
  "div",
1158
1172
  { class: "w-full flex justify-end" },
1159
- P(L.FmButton, {
1173
+ M(B.FmButton, {
1160
1174
  class: "delete-button",
1161
1175
  key: e.sku._id,
1162
1176
  type: "button",
@@ -1181,7 +1195,7 @@ function Ht(r) {
1181
1195
  })
1182
1196
  };
1183
1197
  }
1184
- const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt = { class: "flex-1 flex flex-col" }, Kt = { class: "fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, Gt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Jt = { class: "flex flex-col gap-4" }, Wt = /* @__PURE__ */ j({
1198
+ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt = { class: "flex-1 flex flex-col" }, Kt = { class: "fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, Gt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Jt = { class: "flex flex-col gap-4" }, Wt = /* @__PURE__ */ L({
1185
1199
  __name: "ClosingTemplateItem",
1186
1200
  props: {
1187
1201
  cellByColId: {},
@@ -1192,30 +1206,30 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
1192
1206
  () => n.value.getVisibleCells().filter((t) => t.column.id !== K.Name && t.column.id !== K.Delete)
1193
1207
  );
1194
1208
  return (t, e) => {
1195
- var b, u, v, a, d;
1209
+ var b, m, f, a, u;
1196
1210
  return T(), I("div", jt, [
1197
- x("div", Ot, [
1198
- x("div", Yt, [
1199
- x("div", Kt, C(n.value.original.sku.name), 1),
1200
- x("div", Gt, C(n.value.original.sku.code), 1)
1211
+ w("div", Ot, [
1212
+ w("div", Yt, [
1213
+ w("div", Kt, C(n.value.original.sku.name), 1),
1214
+ w("div", Gt, C(n.value.original.sku.code), 1)
1201
1215
  ]),
1202
- x("div", null, [
1216
+ w("div", null, [
1203
1217
  $(h(O), {
1204
- render: (v = (u = (b = t.cellByColId[h(K).Delete]) == null ? void 0 : b.column) == null ? void 0 : u.columnDef) == null ? void 0 : v.cell,
1205
- props: (d = (a = t.cellByColId[h(K).Delete]) == null ? void 0 : a.getContext) == null ? void 0 : d.call(a)
1218
+ render: (f = (m = (b = t.cellByColId[h(K).Delete]) == null ? void 0 : b.column) == null ? void 0 : m.columnDef) == null ? void 0 : f.cell,
1219
+ props: (u = (a = t.cellByColId[h(K).Delete]) == null ? void 0 : a.getContext) == null ? void 0 : u.call(a)
1206
1220
  }, null, 8, ["render", "props"])
1207
1221
  ])
1208
1222
  ]),
1209
- x("div", Jt, [
1210
- e[0] || (e[0] = x("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, null, -1)),
1211
- (T(!0), I(H, null, J(l.value, (p) => {
1212
- var g, _, c;
1223
+ w("div", Jt, [
1224
+ e[0] || (e[0] = w("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, null, -1)),
1225
+ (T(!0), I(j, null, J(l.value, (d) => {
1226
+ var v, _, c;
1213
1227
  return T(), I("div", {
1214
- key: p.id
1228
+ key: d.id
1215
1229
  }, [
1216
1230
  $(h(O), {
1217
- render: (_ = (g = p.column) == null ? void 0 : g.columnDef) == null ? void 0 : _.cell,
1218
- props: (c = p.getContext) == null ? void 0 : c.call(p)
1231
+ render: (_ = (v = d.column) == null ? void 0 : v.columnDef) == null ? void 0 : _.cell,
1232
+ props: (c = d.getContext) == null ? void 0 : c.call(d)
1219
1233
  }, null, 8, ["render", "props"])
1220
1234
  ]);
1221
1235
  }), 128))
@@ -1223,19 +1237,19 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
1223
1237
  ]);
1224
1238
  };
1225
1239
  }
1226
- }), qt = { class: "flex flex-col gap-16" }, Qt = { class: "flex flex-col gap-24" }, Xt = { class: "flex flex-col gap-16" }, Zt = { class: "flex items-center" }, en = { class: "flex-1 fm-typo-en-title-sm-600" }, tn = { class: "flex flex-col gap-16" }, nn = { class: "flex items-center" }, on = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, sn = /* @__PURE__ */ j({
1240
+ }), qt = { class: "flex flex-col gap-16" }, Qt = { class: "flex flex-col gap-24" }, Xt = { class: "flex flex-col gap-16" }, Zt = { class: "flex items-center" }, en = { class: "flex-1 fm-typo-en-title-sm-600" }, tn = { class: "flex flex-col gap-16" }, nn = { class: "flex items-center" }, on = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, sn = /* @__PURE__ */ L({
1227
1241
  __name: "ClosingTemplateForm",
1228
1242
  props: {
1229
1243
  modelValue: {},
1230
1244
  disabled: { type: Boolean }
1231
1245
  },
1232
1246
  setup(r, { expose: o }) {
1233
- const n = r, l = lt(), { t } = B(), e = ie();
1247
+ const n = r, l = lt(), { t } = z(), e = ie();
1234
1248
  me();
1235
1249
  const {
1236
1250
  promptSelectLocations: b,
1237
- columnDefs: u,
1238
- rowData: v
1251
+ columnDefs: m,
1252
+ rowData: f
1239
1253
  } = at({
1240
1254
  getLocations() {
1241
1255
  return l.locations;
@@ -1243,27 +1257,27 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
1243
1257
  setLocations(i) {
1244
1258
  l.locations = i;
1245
1259
  }
1246
- }), a = M(), d = M("");
1260
+ }), a = F(), u = F("");
1247
1261
  o({
1248
1262
  validateInputs: () => {
1249
- var i, f;
1250
- (f = (i = a.value) == null ? void 0 : i.validateInputs) == null || f.call(i);
1263
+ var i, p;
1264
+ (p = (i = a.value) == null ? void 0 : i.validateInputs) == null || p.call(i);
1251
1265
  },
1252
1266
  resetInputsValidation: () => {
1253
- var i, f;
1254
- (f = (i = a.value) == null ? void 0 : i.resetInputsValidation) == null || f.call(i);
1267
+ var i, p;
1268
+ (p = (i = a.value) == null ? void 0 : i.resetInputsValidation) == null || p.call(i);
1255
1269
  },
1256
1270
  resetInputs: () => {
1257
- var i, f;
1258
- (f = (i = a.value) == null ? void 0 : i.resetInputs) == null || f.call(i);
1271
+ var i, p;
1272
+ (p = (i = a.value) == null ? void 0 : i.resetInputs) == null || p.call(i);
1259
1273
  }
1260
1274
  });
1261
- const p = Ht({
1275
+ const d = Ht({
1262
1276
  updateItem: (i) => {
1263
- l.items = l.items.map((f) => f.sku._id !== i.sku._id ? f : i);
1277
+ l.items = l.items.map((p) => p.sku._id !== i.sku._id ? p : i);
1264
1278
  },
1265
1279
  deleteItem: (i) => {
1266
- l.items = l.items.filter((f) => f.sku._id !== i.sku._id);
1280
+ l.items = l.items.filter((p) => p.sku._id !== i.sku._id);
1267
1281
  },
1268
1282
  get items() {
1269
1283
  return l.items;
@@ -1271,28 +1285,28 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
1271
1285
  get disabled() {
1272
1286
  return n.disabled;
1273
1287
  }
1274
- }), g = E(() => p.columnDefs.value), { promptSelectIngredients: _ } = gt();
1288
+ }), v = E(() => d.columnDefs.value), { promptSelectIngredients: _ } = gt();
1275
1289
  async function c() {
1276
- const f = e.skus.map((k) => ({
1290
+ const p = e.skus.map((k) => ({
1277
1291
  label: k.name,
1278
1292
  sublabel: k.code,
1279
1293
  value: k
1280
1294
  })).filter((k) => {
1281
- var m;
1282
- return (m = l.items) == null ? void 0 : m.find((w) => w.sku._id === k.value._id);
1283
- }).map((k) => k.value), y = l.items ?? [], s = await _(
1284
- f.map((k) => k._id),
1295
+ var y;
1296
+ return (y = l.items) == null ? void 0 : y.find((x) => x.sku._id === k.value._id);
1297
+ }).map((k) => k.value), g = l.items ?? [], s = await _(
1298
+ p.map((k) => k._id),
1285
1299
  (k) => {
1286
- const m = e.skuById[k], w = y.find((F) => F.sku._id === m._id);
1287
- return w || {
1288
- sku: m
1300
+ const y = e.skuById[k], x = g.find((P) => P.sku._id === y._id);
1301
+ return x || {
1302
+ sku: y
1289
1303
  };
1290
1304
  }
1291
1305
  );
1292
- s && (s.sort((k, m) => k.sku.code.localeCompare(m.sku.code)), l.items = s);
1306
+ s && (s.sort((k, y) => k.sku.code.localeCompare(y.sku.code)), l.items = s);
1293
1307
  }
1294
- return (i, f) => {
1295
- const y = R("FmTextField"), s = R("FmButton"), k = R("FmTable"), m = R("FmIcon"), w = R("FmFormGroup"), S = R("FmForm");
1308
+ return (i, p) => {
1309
+ const g = R("FmTextField"), s = R("FmButton"), k = R("FmTable"), y = R("FmIcon"), x = R("FmFormGroup"), S = R("FmForm");
1296
1310
  return T(), N(S, {
1297
1311
  ref_key: "formRef",
1298
1312
  ref: a,
@@ -1300,26 +1314,26 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
1300
1314
  disabled: i.disabled
1301
1315
  }, {
1302
1316
  default: A(() => [
1303
- x("div", qt, [
1304
- x("div", Qt, [
1305
- $(y, {
1317
+ w("div", qt, [
1318
+ w("div", Qt, [
1319
+ $(g, {
1306
1320
  label: h(t)("inventory.closing.form.name"),
1307
1321
  "label-mark": "required",
1308
1322
  modelValue: h(l).name,
1309
- "onUpdate:modelValue": f[0] || (f[0] = (F) => h(l).name = F),
1323
+ "onUpdate:modelValue": p[0] || (p[0] = (P) => h(l).name = P),
1310
1324
  rules: [h(rt)()]
1311
1325
  }, null, 8, ["label", "modelValue", "rules"]),
1312
- $(y, {
1326
+ $(g, {
1313
1327
  label: h(t)("inventory.closing.form.reference"),
1314
1328
  "label-mark": "optional",
1315
1329
  modelValue: h(l).ref,
1316
- "onUpdate:modelValue": f[1] || (f[1] = (F) => h(l).ref = F)
1330
+ "onUpdate:modelValue": p[1] || (p[1] = (P) => h(l).ref = P)
1317
1331
  }, null, 8, ["label", "modelValue"])
1318
1332
  ])
1319
1333
  ]),
1320
- x("div", Xt, [
1321
- x("div", Zt, [
1322
- x("div", en, C(h(t)("inventory.closing.form.locations")), 1),
1334
+ w("div", Xt, [
1335
+ w("div", Zt, [
1336
+ w("div", en, C(h(t)("inventory.closing.form.locations")), 1),
1323
1337
  $(s, {
1324
1338
  disabled: i.disabled,
1325
1339
  label: h(t)("inventory.closing.form.selectLocation"),
@@ -1330,37 +1344,37 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
1330
1344
  }, null, 8, ["disabled", "label", "onClick"])
1331
1345
  ]),
1332
1346
  $(k, {
1333
- "column-defs": h(u),
1334
- "row-data": h(v),
1347
+ "column-defs": h(m),
1348
+ "row-data": h(f),
1335
1349
  "shrink-at": 9999,
1336
1350
  onRowClick: h(b),
1337
1351
  "hide-footer": ""
1338
1352
  }, null, 8, ["column-defs", "row-data", "onRowClick"])
1339
1353
  ]),
1340
- x("div", tn, [
1341
- x("div", nn, [
1342
- x("div", on, C(h(t)("inventory.closing.form.items.title")), 1),
1354
+ w("div", tn, [
1355
+ w("div", nn, [
1356
+ w("div", on, C(h(t)("inventory.closing.form.items.title")), 1),
1343
1357
  $(s, {
1344
1358
  disabled: i.disabled,
1345
1359
  label: h(t)("inventory.closing.form.items.addItem"),
1346
1360
  "prepend-icon": "add",
1347
1361
  variant: "plain",
1348
1362
  class: "border-2 rounded-lg border-fm-color-primary",
1349
- onClick: f[2] || (f[2] = (F) => c()),
1363
+ onClick: p[2] || (p[2] = (P) => c()),
1350
1364
  size: "md"
1351
1365
  }, null, 8, ["disabled", "label"])
1352
1366
  ]),
1353
- $(y, {
1367
+ $(g, {
1354
1368
  placeholder: "Filter items",
1355
- modelValue: d.value,
1356
- "onUpdate:modelValue": f[4] || (f[4] = (F) => d.value = F)
1369
+ modelValue: u.value,
1370
+ "onUpdate:modelValue": p[4] || (p[4] = (P) => u.value = P)
1357
1371
  }, Re({ _: 2 }, [
1358
- d.value ? {
1372
+ u.value ? {
1359
1373
  name: "append",
1360
1374
  fn: A(() => [
1361
- $(m, {
1375
+ $(y, {
1362
1376
  name: "close",
1363
- onClick: f[3] || (f[3] = (F) => d.value = ""),
1377
+ onClick: p[3] || (p[3] = (P) => u.value = ""),
1364
1378
  class: "cursor-pointer"
1365
1379
  })
1366
1380
  ]),
@@ -1368,21 +1382,21 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
1368
1382
  } : void 0
1369
1383
  ]), 1032, ["modelValue"]),
1370
1384
  (T(), N(k, {
1371
- "search-value": d.value,
1372
- "column-defs": g.value,
1385
+ "search-value": u.value,
1386
+ "column-defs": v.value,
1373
1387
  "row-data": h(l).items,
1374
- key: h(l).items.map((F) => F.sku._id).join("."),
1388
+ key: h(l).items.map((P) => P.sku._id).join("."),
1375
1389
  "hide-footer": h(l).items.length <= 10,
1376
1390
  "page-size": Math.min(10, h(l).items.length)
1377
1391
  }, {
1378
- "list-row": A((F) => [
1392
+ "list-row": A((P) => [
1379
1393
  (T(), N(Ne, {
1380
- row: F,
1394
+ row: P,
1381
1395
  key: h(l).items.map((D) => D.sku._id).join(".")
1382
1396
  }, {
1383
1397
  default: A((D) => [
1384
1398
  $(Wt, {
1385
- row: F,
1399
+ row: P,
1386
1400
  "cell-by-col-id": D
1387
1401
  }, null, 8, ["row", "cell-by-col-id"])
1388
1402
  ]),
@@ -1391,7 +1405,7 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
1391
1405
  ]),
1392
1406
  _: 1
1393
1407
  }, 8, ["search-value", "column-defs", "row-data", "hide-footer", "page-size"])),
1394
- $(w, {
1408
+ $(x, {
1395
1409
  "model-value": h(l).items.length,
1396
1410
  rules: [h(it)(1)]
1397
1411
  }, null, 8, ["model-value", "rules"])
@@ -1401,7 +1415,7 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
1401
1415
  }, 8, ["disabled"]);
1402
1416
  };
1403
1417
  }
1404
- }), ln = { class: "flex items-center" }, an = { class: "fm-typo-en-title-md-600" }, rn = { class: "flex gap-4" }, cn = /* @__PURE__ */ j({
1418
+ }), ln = { class: "flex items-center" }, an = { class: "fm-typo-en-title-md-600" }, rn = { class: "flex gap-4" }, cn = /* @__PURE__ */ L({
1405
1419
  __name: "ClosingTemplateDialog",
1406
1420
  props: {
1407
1421
  mode: {},
@@ -1411,7 +1425,7 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
1411
1425
  emits: ["update:show", "submitted"],
1412
1426
  setup(r, { expose: o, emit: n }) {
1413
1427
  var k;
1414
- const l = r, t = n, e = te(), b = ee(), { t: u } = B(), v = ft(l, "show");
1428
+ const l = r, t = n, e = te(), b = ee(), { t: m } = z(), f = ft(l, "show");
1415
1429
  function a() {
1416
1430
  return {
1417
1431
  _id: "",
@@ -1419,108 +1433,108 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
1419
1433
  items: []
1420
1434
  };
1421
1435
  }
1422
- const d = M(l.modelValue ?? a()), p = M(((k = l.modelValue) == null ? void 0 : k._id) ?? `${Math.random()}`);
1436
+ const u = F(l.modelValue ?? a()), d = F(((k = l.modelValue) == null ? void 0 : k._id) ?? `${Math.random()}`);
1423
1437
  Pe(
1424
1438
  () => l.show,
1425
- (m) => {
1426
- var w;
1427
- m && (d.value = l.modelValue ?? a(), p.value = ((w = l.modelValue) == null ? void 0 : w._id) ?? `${Math.random()}`);
1439
+ (y) => {
1440
+ var x;
1441
+ y && (u.value = l.modelValue ?? a(), d.value = ((x = l.modelValue) == null ? void 0 : x._id) ?? `${Math.random()}`);
1428
1442
  }
1429
1443
  );
1430
- const g = M(!1), _ = E(() => {
1444
+ const v = F(!1), _ = E(() => {
1431
1445
  switch (l.mode) {
1432
- case z.READ:
1446
+ case H.READ:
1433
1447
  return "";
1434
- case z.CREATE:
1435
- return u("inventory.closing.template.create.title");
1436
- case z.UPDATE:
1437
- return u("inventory.closing.template.update.title");
1448
+ case H.CREATE:
1449
+ return m("inventory.closing.template.create.title");
1450
+ case H.UPDATE:
1451
+ return m("inventory.closing.template.update.title");
1438
1452
  }
1439
1453
  return "";
1440
- }), c = M();
1454
+ }), c = F();
1441
1455
  o({
1442
1456
  validateInputs: () => {
1443
- var m, w;
1444
- (w = (m = c.value) == null ? void 0 : m.validateInputs) == null || w.call(m);
1457
+ var y, x;
1458
+ (x = (y = c.value) == null ? void 0 : y.validateInputs) == null || x.call(y);
1445
1459
  },
1446
1460
  resetInputsValidation: () => {
1447
- var m, w;
1448
- (w = (m = c.value) == null ? void 0 : m.resetInputsValidation) == null || w.call(m);
1461
+ var y, x;
1462
+ (x = (y = c.value) == null ? void 0 : y.resetInputsValidation) == null || x.call(y);
1449
1463
  },
1450
1464
  resetInputs: () => {
1451
- var m, w;
1452
- (w = (m = c.value) == null ? void 0 : m.resetInputs) == null || w.call(m);
1465
+ var y, x;
1466
+ (x = (y = c.value) == null ? void 0 : y.resetInputs) == null || x.call(y);
1453
1467
  }
1454
1468
  });
1455
1469
  async function i() {
1456
- const m = d.value;
1457
- if (m) {
1458
- g.value = !0;
1470
+ const y = u.value;
1471
+ if (y) {
1472
+ v.value = !0;
1459
1473
  try {
1460
- await e.createTemplate(m), await new Promise((w) => setTimeout(w, 1e3)), b.open({
1461
- title: u("inventory.closing.template.create.success"),
1462
- message: u("inventory.closing.template.create.successMessage"),
1474
+ await e.createTemplate(y), await new Promise((x) => setTimeout(x, 1e3)), b.open({
1475
+ title: m("inventory.closing.template.create.success"),
1476
+ message: m("inventory.closing.template.create.successMessage"),
1463
1477
  type: "success"
1464
1478
  }), t("update:show", !1), t("submitted");
1465
- } catch (w) {
1479
+ } catch (x) {
1466
1480
  b.open({
1467
- title: u("inventory.closing.template.create.error"),
1468
- message: u("inventory.closing.template.create.errorMessage"),
1481
+ title: m("inventory.closing.template.create.error"),
1482
+ message: m("inventory.closing.template.create.errorMessage"),
1469
1483
  type: "error"
1470
- }), console.error("Error in creating closing template", w);
1484
+ }), console.error("Error in creating closing template", x);
1471
1485
  } finally {
1472
- g.value = !1;
1486
+ v.value = !1;
1473
1487
  }
1474
1488
  }
1475
1489
  }
1476
- async function f() {
1477
- const m = d.value;
1478
- if (m) {
1479
- g.value = !0;
1490
+ async function p() {
1491
+ const y = u.value;
1492
+ if (y) {
1493
+ v.value = !0;
1480
1494
  try {
1481
1495
  await e.updateTemplate({
1482
- ...m,
1483
- _rev: m._rev ?? ""
1484
- }), await new Promise((w) => setTimeout(w, 1e3)), b.open({
1485
- title: u("inventory.closing.template.update.success"),
1486
- message: u("inventory.closing.template.update.successMessage"),
1496
+ ...y,
1497
+ _rev: y._rev ?? ""
1498
+ }), await new Promise((x) => setTimeout(x, 1e3)), b.open({
1499
+ title: m("inventory.closing.template.update.success"),
1500
+ message: m("inventory.closing.template.update.successMessage"),
1487
1501
  type: "success"
1488
1502
  }), t("update:show", !1), t("submitted");
1489
- } catch (w) {
1503
+ } catch (x) {
1490
1504
  b.open({
1491
- title: u("inventory.closing.template.update.error"),
1492
- message: u("inventory.closing.template.update.errorMessage"),
1505
+ title: m("inventory.closing.template.update.error"),
1506
+ message: m("inventory.closing.template.update.errorMessage"),
1493
1507
  type: "error"
1494
- }), console.error("Error in updating closing template", w);
1508
+ }), console.error("Error in updating closing template", x);
1495
1509
  } finally {
1496
- g.value = !1;
1510
+ v.value = !1;
1497
1511
  }
1498
1512
  }
1499
1513
  }
1500
- function y() {
1514
+ function g() {
1501
1515
  switch (l.mode) {
1502
- case z.CREATE:
1516
+ case H.CREATE:
1503
1517
  return i();
1504
- case z.UPDATE:
1505
- return f();
1518
+ case H.UPDATE:
1519
+ return p();
1506
1520
  }
1507
1521
  }
1508
1522
  function s() {
1509
- var m, w;
1510
- (w = (m = c.value) == null ? void 0 : m.validateInputs) == null || w.call(m);
1523
+ var y, x;
1524
+ (x = (y = c.value) == null ? void 0 : y.validateInputs) == null || x.call(y);
1511
1525
  }
1512
- return (m, w) => {
1513
- const S = R("FmButton"), F = R("FmSideSheet");
1514
- return T(), N(F, {
1515
- modelValue: h(v),
1516
- "onUpdate:modelValue": w[2] || (w[2] = (D) => Oe(v) ? v.value = D : null),
1526
+ return (y, x) => {
1527
+ const S = R("FmButton"), P = R("FmSideSheet");
1528
+ return T(), N(P, {
1529
+ modelValue: h(f),
1530
+ "onUpdate:modelValue": x[2] || (x[2] = (D) => Oe(f) ? f.value = D : null),
1517
1531
  "dismiss-away": "",
1518
1532
  "close-button": "",
1519
1533
  "max-width": 800
1520
1534
  }, {
1521
1535
  "side-sheet-header": A(() => [
1522
- x("div", ln, [
1523
- x("div", an, C(_.value), 1)
1536
+ w("div", ln, [
1537
+ w("div", an, C(_.value), 1)
1524
1538
  ])
1525
1539
  ]),
1526
1540
  default: A(() => [
@@ -1528,25 +1542,25 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
1528
1542
  class: "w-full",
1529
1543
  ref_key: "formRef",
1530
1544
  ref: c,
1531
- onValidationSuccess: y,
1532
- "model-value": d.value,
1533
- "onUpdate:modelValue": w[0] || (w[0] = (D) => d.value = D),
1534
- disabled: g.value,
1535
- key: p.value
1545
+ onValidationSuccess: g,
1546
+ "model-value": u.value,
1547
+ "onUpdate:modelValue": x[0] || (x[0] = (D) => u.value = D),
1548
+ disabled: v.value,
1549
+ key: d.value
1536
1550
  }, null, 8, ["model-value", "disabled"]))
1537
1551
  ]),
1538
1552
  "side-sheet-footer": A(() => [
1539
- x("div", rn, [
1553
+ w("div", rn, [
1540
1554
  $(S, {
1541
- loading: g.value,
1542
- label: h(u)("common.save"),
1555
+ loading: v.value,
1556
+ label: h(m)("common.save"),
1543
1557
  onClick: s
1544
1558
  }, null, 8, ["loading", "label"]),
1545
1559
  $(S, {
1546
- disabled: g.value,
1560
+ disabled: v.value,
1547
1561
  variant: "tertiary",
1548
- label: h(u)("common.close"),
1549
- onClick: w[1] || (w[1] = (D) => t("update:show", !1))
1562
+ label: h(m)("common.close"),
1563
+ onClick: x[1] || (x[1] = (D) => t("update:show", !1))
1550
1564
  }, null, 8, ["disabled", "label"])
1551
1565
  ])
1552
1566
  ]),
@@ -1567,47 +1581,47 @@ const dn = /* @__PURE__ */ ct(mn, [["render", un]]), pn = { class: "flex flex-co
1567
1581
  }, hn = {
1568
1582
  key: 3,
1569
1583
  class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary flex flex-col gap-12"
1570
- }, bn = { class: "fm-typo-en-body-md-600" }, _n = { class: "fm-typo-en-body-md-600" }, xn = { key: 4 }, wn = { class: "fm-typo-en-body-md-600" }, kn = { class: "fm-typo-en-body-md-600" }, Tn = { class: "flex sm:flex-col xs:flex-col justify-end gap-8 w-full mb-16" }, $n = /* @__PURE__ */ j({
1584
+ }, bn = { class: "fm-typo-en-body-md-600" }, _n = { class: "fm-typo-en-body-md-600" }, xn = { key: 4 }, wn = { class: "fm-typo-en-body-md-600" }, kn = { class: "fm-typo-en-body-md-600" }, Tn = { class: "flex sm:flex-col xs:flex-col justify-end gap-8 w-full mb-16" }, $n = /* @__PURE__ */ L({
1571
1585
  __name: "ClosingTemplatePublish",
1572
1586
  emits: ["close"],
1573
1587
  setup(r, { emit: o }) {
1574
- const n = M(!1), l = ee(), t = te(), e = ne(), { t: b } = B(), u = o;
1575
- async function v() {
1588
+ const n = F(!1), l = ee(), t = te(), e = ne(), { t: b } = z(), m = o;
1589
+ async function f() {
1576
1590
  n.value = !0;
1577
1591
  try {
1578
1592
  await t.startNewPublish().delayed(1e3), l.open({
1579
1593
  title: "Success",
1580
1594
  message: "You may refresh after a while to review publish status",
1581
1595
  type: "success"
1582
- }), p();
1583
- } catch (g) {
1596
+ }), d();
1597
+ } catch (v) {
1584
1598
  l.open({
1585
1599
  title: "Something went wrong",
1586
1600
  message: "Please try again",
1587
1601
  type: "error"
1588
- }), console.error("error on creating publish task", g);
1602
+ }), console.error("error on creating publish task", v);
1589
1603
  } finally {
1590
1604
  n.value = !1;
1591
1605
  }
1592
1606
  }
1593
- const a = E(() => e.recentPublish.recentJob), d = E(
1607
+ const a = E(() => e.recentPublish.recentJob), u = E(
1594
1608
  () => e.templates.length && (!a.value || a.value.outlets.length === a.value.completed.length)
1595
1609
  );
1596
- function p() {
1597
- u("close");
1610
+ function d() {
1611
+ m("close");
1598
1612
  }
1599
- return (g, _) => {
1600
- const c = R("FmCircularProgress"), i = R("i18n-t"), f = R("FmButton");
1613
+ return (v, _) => {
1614
+ const c = R("FmCircularProgress"), i = R("i18n-t"), p = R("FmButton");
1601
1615
  return T(), I("div", pn, [
1602
1616
  h(e).templates.length ? n.value ? (T(), I("div", vn, [
1603
- x("div", null, [
1617
+ w("div", null, [
1604
1618
  $(c, {
1605
1619
  size: "md",
1606
1620
  color: "neutral-gray-300"
1607
1621
  })
1608
1622
  ]),
1609
- x("div", gn, [
1610
- x("span", null, C(h(b)("inventory.closing.template.publish.publishing")), 1)
1623
+ w("div", gn, [
1624
+ w("span", null, C(h(b)("inventory.closing.template.publish.publishing")), 1)
1611
1625
  ])
1612
1626
  ])) : a.value ? a.value.outlets.length === a.value.completed.length ? (T(), I("div", hn, [
1613
1627
  $(i, {
@@ -1615,58 +1629,58 @@ const dn = /* @__PURE__ */ ct(mn, [["render", un]]), pn = { class: "flex flex-co
1615
1629
  tag: "p"
1616
1630
  }, {
1617
1631
  started: A(() => [
1618
- x("span", bn, C(h(se)(new Date(a.value.createdAt))), 1)
1632
+ w("span", bn, C(h(se)(new Date(a.value.createdAt))), 1)
1619
1633
  ]),
1620
1634
  finished: A(() => [
1621
- x("span", _n, C(h(se)(new Date(a.value.updatedAt))), 1)
1635
+ w("span", _n, C(h(se)(new Date(a.value.updatedAt))), 1)
1622
1636
  ]),
1623
1637
  _: 1
1624
1638
  }),
1625
- x("p", null, C(h(b)("inventory.closing.template.publish.message")), 1)
1639
+ w("p", null, C(h(b)("inventory.closing.template.publish.message")), 1)
1626
1640
  ])) : (T(), I("div", xn, [
1627
1641
  $(i, {
1628
1642
  keypath: "inventory.closing.template.publish.stillPublishing",
1629
1643
  tag: "p"
1630
1644
  }, {
1631
1645
  started: A(() => [
1632
- x("span", wn, C(h(se)(new Date(a.value.createdAt))), 1)
1646
+ w("span", wn, C(h(se)(new Date(a.value.createdAt))), 1)
1633
1647
  ]),
1634
1648
  progress: A(() => [
1635
- x("span", kn, " (" + C(a.value.completed.length) + "/" + C(a.value.outlets.length) + " completed) ", 1)
1649
+ w("span", kn, " (" + C(a.value.completed.length) + "/" + C(a.value.outlets.length) + " completed) ", 1)
1636
1650
  ]),
1637
1651
  _: 1
1638
1652
  }),
1639
1653
  Fe(" Your recent publishing task is still pending (" + C(a.value.completed.length) + " / " + C(a.value.outlets.length) + "). Please wait until all publishing task has completed. ", 1)
1640
1654
  ])) : (T(), I("div", yn, [
1641
- x("p", null, C(h(b)("inventory.closing.template.publish.noRecentActivity")), 1),
1642
- x("p", null, C(h(b)("inventory.closing.template.publish.message")), 1)
1655
+ w("p", null, C(h(b)("inventory.closing.template.publish.noRecentActivity")), 1),
1656
+ w("p", null, C(h(b)("inventory.closing.template.publish.message")), 1)
1643
1657
  ])) : (T(), I("div", fn, [
1644
- x("p", null, C(h(b)("inventory.closing.template.publish.nothingToPublish")), 1)
1658
+ w("p", null, C(h(b)("inventory.closing.template.publish.nothingToPublish")), 1)
1645
1659
  ])),
1646
- x("div", Tn, [
1647
- $(f, {
1648
- disabled: !d.value,
1660
+ w("div", Tn, [
1661
+ $(p, {
1662
+ disabled: !u.value,
1649
1663
  loading: n.value,
1650
1664
  label: "Publish to all outlets",
1651
- onClick: v
1665
+ onClick: f
1652
1666
  }, null, 8, ["disabled", "loading"]),
1653
- $(f, {
1667
+ $(p, {
1654
1668
  variant: "tertiary",
1655
1669
  label: "Close",
1656
- onClick: p
1670
+ onClick: d
1657
1671
  })
1658
1672
  ])
1659
1673
  ]);
1660
1674
  };
1661
1675
  }
1662
- }), Cn = { class: "flex-1 flex flex-col gap-8" }, In = { class: "flex flex-col" }, Sn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Dn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Mn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Fn = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, Nn = /* @__PURE__ */ j({
1676
+ }), Cn = { class: "flex-1 flex flex-col gap-8" }, In = { class: "flex flex-col" }, Sn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Dn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Mn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Fn = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, Nn = /* @__PURE__ */ L({
1663
1677
  __name: "ClosingTemplateView",
1664
1678
  setup(r) {
1665
- const { t: o } = B(), { createTemplate: n, updateTemplate: l, exportTemplates: t, importTemplates: e } = ae(), { templateDialogProps: b, templateDetailsProps: u } = Le(ae()), v = re(), a = me(), d = ne(), p = mt(), { breakpoints: g } = vt();
1666
- v.watchLocation(d.fetchTemplates);
1667
- const _ = E(() => d.loading), c = M(""), i = E(() => g.value.xs || g.value.sm), f = E(() => i.value ? 10 : 20);
1668
- function y(w) {
1669
- switch (w) {
1679
+ const { t: o } = z(), { createTemplate: n, updateTemplate: l, exportTemplates: t, importTemplates: e } = ae(), { templateDialogProps: b, templateDetailsProps: m } = Le(ae()), f = re(), a = me(), u = ne(), d = mt(), { breakpoints: v } = vt();
1680
+ f.watchLocation(u.fetchTemplates);
1681
+ const _ = E(() => u.loading), c = F(""), i = E(() => v.value.xs || v.value.sm), p = E(() => i.value ? 10 : 20);
1682
+ function g(x) {
1683
+ switch (x) {
1670
1684
  case V.Add:
1671
1685
  return n();
1672
1686
  case "publish":
@@ -1676,7 +1690,7 @@ const dn = /* @__PURE__ */ ct(mn, [["render", un]]), pn = { class: "flex flex-co
1676
1690
  case "export":
1677
1691
  return t();
1678
1692
  case "refresh":
1679
- return d.fetchTemplates();
1693
+ return u.fetchTemplates();
1680
1694
  }
1681
1695
  }
1682
1696
  function s() {
@@ -1690,10 +1704,10 @@ const dn = /* @__PURE__ */ ct(mn, [["render", un]]), pn = { class: "flex flex-co
1690
1704
  }
1691
1705
  });
1692
1706
  }
1693
- function k(w) {
1694
- return w;
1707
+ function k(x) {
1708
+ return x;
1695
1709
  }
1696
- const m = E(() => i.value ? [
1710
+ const y = E(() => i.value ? [
1697
1711
  {
1698
1712
  label: o("inventory.closing.template.create.title"),
1699
1713
  value: V.Add,
@@ -1748,16 +1762,16 @@ const dn = /* @__PURE__ */ ct(mn, [["render", un]]), pn = { class: "flex flex-co
1748
1762
  isPrimary: !1
1749
1763
  }
1750
1764
  ]);
1751
- return (w, S) => {
1752
- const F = R("FmTable");
1753
- return T(), I(H, null, [
1765
+ return (x, S) => {
1766
+ const P = R("FmTable");
1767
+ return T(), I(j, null, [
1754
1768
  $(ut, {
1755
1769
  title: h(o)("inventory.closing.template.title"),
1756
- actions: m.value,
1757
- "onClick:action": y
1770
+ actions: y.value,
1771
+ "onClick:action": g
1758
1772
  }, {
1759
1773
  default: A(() => [
1760
- x("div", {
1774
+ w("div", {
1761
1775
  class: Y([
1762
1776
  "flex flex-col gap-8 max-h-full",
1763
1777
  {
@@ -1771,14 +1785,14 @@ const dn = /* @__PURE__ */ ct(mn, [["render", un]]), pn = { class: "flex flex-co
1771
1785
  search: c.value,
1772
1786
  "onUpdate:search": S[0] || (S[0] = (D) => c.value = D)
1773
1787
  }, null, 8, ["search"]),
1774
- $(F, {
1775
- style: Ye(h(p).tableHeight),
1776
- "column-defs": h(d).columnDefs,
1777
- "row-data": h(d).templates,
1788
+ $(P, {
1789
+ style: Ye(h(d).tableHeight),
1790
+ "column-defs": h(u).columnDefs,
1791
+ "row-data": h(u).templates,
1778
1792
  "search-value": c.value,
1779
1793
  loading: _.value,
1780
1794
  onRowClick: S[1] || (S[1] = (D) => h(l)(D.original)),
1781
- "page-size": f.value
1795
+ "page-size": p.value
1782
1796
  }, {
1783
1797
  "list-row": A((D) => [
1784
1798
  $(Ne, {
@@ -1788,35 +1802,35 @@ const dn = /* @__PURE__ */ ct(mn, [["render", un]]), pn = { class: "flex flex-co
1788
1802
  default: A((U) => {
1789
1803
  var de, pe, fe, W, ve, ge, ye, he, q, be, _e, xe, we, ke, Te, Q, $e, Ce, Ie, Se, X, De;
1790
1804
  return [
1791
- x("div", Cn, [
1792
- x("div", In, [
1793
- x("div", Sn, [
1805
+ w("div", Cn, [
1806
+ w("div", In, [
1807
+ w("div", Sn, [
1794
1808
  $(h(O), {
1795
1809
  render: (fe = (pe = (de = U._id) == null ? void 0 : de.column) == null ? void 0 : pe.columnDef) == null ? void 0 : fe.cell,
1796
1810
  props: (ve = (W = U._id) == null ? void 0 : W.getContext) == null ? void 0 : ve.call(W)
1797
1811
  }, null, 8, ["render", "props"])
1798
1812
  ]),
1799
- x("div", Dn, [
1813
+ w("div", Dn, [
1800
1814
  $(h(O), {
1801
1815
  render: (he = (ye = (ge = U.name) == null ? void 0 : ge.column) == null ? void 0 : ye.columnDef) == null ? void 0 : he.cell,
1802
1816
  props: (be = (q = U.name) == null ? void 0 : q.getContext) == null ? void 0 : be.call(q)
1803
1817
  }, null, 8, ["render", "props"])
1804
1818
  ]),
1805
- x("div", null, C((_e = D.original.locations) != null && _e.length ? h(o)("inventory.closing.table.enabledForN", {
1819
+ w("div", null, C((_e = D.original.locations) != null && _e.length ? h(o)("inventory.closing.table.enabledForN", {
1806
1820
  count: ((xe = D.original.locations) == null ? void 0 : xe.length) ?? 0
1807
1821
  }) : h(o)("inventory.closing.table.enabledForAll")), 1),
1808
- x("div", Mn, C([
1822
+ w("div", Mn, C([
1809
1823
  ...D.original.items.slice(0, 3).map((je) => je.sku.name),
1810
1824
  ...D.original.items.length >= 3 ? [`and ${D.original.items.length - 3} more items`] : []
1811
1825
  ].join(", ")), 1),
1812
- x("div", Fn, [
1826
+ w("div", Fn, [
1813
1827
  $(h(O), {
1814
1828
  render: (Te = (ke = (we = U.ref) == null ? void 0 : we.column) == null ? void 0 : ke.columnDef) == null ? void 0 : Te.cell,
1815
1829
  props: ($e = (Q = U.ref) == null ? void 0 : Q.getContext) == null ? void 0 : $e.call(Q)
1816
1830
  }, null, 8, ["render", "props"])
1817
1831
  ])
1818
1832
  ]),
1819
- x("div", null, [
1833
+ w("div", null, [
1820
1834
  $(h(O), {
1821
1835
  render: (Se = (Ie = (Ce = U.status) == null ? void 0 : Ce.column) == null ? void 0 : Ie.columnDef) == null ? void 0 : Se.cell,
1822
1836
  props: (De = (X = U.status) == null ? void 0 : X.getContext) == null ? void 0 : De.call(X)
@@ -1835,9 +1849,9 @@ const dn = /* @__PURE__ */ ct(mn, [["render", un]]), pn = { class: "flex flex-co
1835
1849
  _: 1
1836
1850
  }, 8, ["title", "actions"]),
1837
1851
  (T(), N(Ke, { to: "body" }, [
1838
- $(dn, Ge(Je(h(u))), null, 16),
1852
+ $(dn, Ge(Je(h(m))), null, 16),
1839
1853
  $(cn, We(h(b), {
1840
- onSubmitted: S[2] || (S[2] = (D) => h(d).fetchTemplates())
1854
+ onSubmitted: S[2] || (S[2] = (D) => h(u).fetchTemplates())
1841
1855
  }), null, 16)
1842
1856
  ]))
1843
1857
  ], 64);