@feedmepos/mf-inventory-portal 1.2.51 → 1.2.53-dev.2

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 (104) hide show
  1. package/dist/{App-BJ_vKOR1.js → App-C8X881gs.js} +75 -70
  2. package/dist/{ApprovalView-B_prTTtl.js → ApprovalView-CnwwVO46.js} +34 -34
  3. package/dist/{BindingsDialog-BPuKgJIk.js → BindingsDialog-MM6wv-je.js} +2 -2
  4. package/dist/{BindingsPicker-Dv_cmEil.js → BindingsPicker-C_VV8t8e.js} +2 -2
  5. package/dist/{BindingsTable-BNSfYRfq.js → BindingsTable-CabKT98b.js} +4 -4
  6. package/dist/{ClosingDraftView-C78tcaJ3.js → ClosingDraftView-D3dwGHdG.js} +19 -18
  7. package/dist/{ClosingHistoryView-DY8liEk3.js → ClosingHistoryView-CBMIWL-O.js} +27 -27
  8. package/dist/{ClosingTemplateView-pJXEcrjO.js → ClosingTemplateView-FHCJY1Y1.js} +525 -511
  9. package/dist/{DeliveryOrderPrintPreview-Bu_l-kxu.js → DeliveryOrderPrintPreview-BB4HVWaM.js} +1 -1
  10. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Dq2vcIMB.js +188 -0
  11. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DHe5G3kX.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BSrjl8Vc.js} +12 -12
  12. package/dist/FmMultiselectDialog-D8E2bGwL.js +618 -0
  13. package/dist/{FmMultiselectDialog-C3iCMK5I.js → FmMultiselectDialog-HP5xQpLC.js} +1 -1
  14. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CefvebOx.js → FmUnitInput.vue_vue_type_script_setup_true_lang--yzPFTUH.js} +3 -3
  15. package/dist/{ImportView-JrenRgiI.js → ImportView-DQPKyc1T.js} +7 -7
  16. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CSdxodp6.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DZAOa26T.js} +1 -1
  17. package/dist/{IngredientGroupView-aDFq_ZDh.js → IngredientGroupView-CiR31jQz.js} +108 -107
  18. package/dist/{IngredientsView-DSh3UqDg.js → IngredientsView-Csa1Lifk.js} +126 -125
  19. package/dist/{IntegrationView-KhZ78uxM.js → IntegrationView-DqGXjNPx.js} +80 -80
  20. package/dist/{InventoryBindingForm-DZu0CZYh.js → InventoryBindingForm-kZ6JIgK4.js} +1 -1
  21. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-D-qjPLHS.js +403 -0
  22. package/dist/{InventoryBindingSummary-DZxLhZ_-.js → InventoryBindingSummary-Cn3y7cXX.js} +1 -1
  23. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DAwpZY3n.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-5cpvf_ze.js} +1 -1
  24. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CPDxwz-V.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DW_3XEAx.js} +2 -2
  25. package/dist/{PublishView-CLnQ7NBN.js → PublishView-tvxBQLp2.js} +3 -3
  26. package/dist/{PurchaseOrderPrintPreview-DiBztBma.js → PurchaseOrderPrintPreview-CqSijErx.js} +1 -1
  27. package/dist/ReceiveRequestView-Oq87gJ1d.js +2913 -0
  28. package/dist/{RecipeView-BPIMvoTw.js → RecipeView-c7SNUwhq.js} +83 -82
  29. package/dist/{StockView-CI8MUJay.js → StockView-B3ocNf5D.js} +113 -112
  30. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DEBHEMkh.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Br3p4H5X.js} +1 -1
  31. package/dist/{SupplierView-COihDMNY.js → SupplierView-7UHgW64q.js} +28 -27
  32. package/dist/SurchargeView-CkBBz_W1.js +460 -0
  33. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-D-c0Ayis.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-BxqwBD1A.js} +2 -2
  34. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js +84 -0
  35. package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DZxJDrcN.js +201 -0
  36. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BVuuw11z.js → TransferDetails.vue_vue_type_script_setup_true_lang-BP7PC5FE.js} +15 -15
  37. package/dist/{TransferTemplateView-B2NNfrEq.js → TransferTemplateView-gnib1NSD.js} +82 -81
  38. package/dist/{UnitView-ZsbM07hw.js → UnitView-gccTcBDm.js} +20 -19
  39. package/dist/{WarehouseView-Cd5RFu5v.js → WarehouseView-9Tzk2HFV.js} +21 -20
  40. package/dist/WastageTemplateView-bxDDb0it.js +2383 -0
  41. package/dist/api/adjustment-template.d.ts +1 -0
  42. package/dist/api/closing-template.d.ts +1 -0
  43. package/dist/api/netsuite.d.ts +8 -0
  44. package/dist/api/surcharge.d.ts +31 -0
  45. package/dist/app-DiX-EfV6.js +8167 -0
  46. package/dist/{app-CySQTQxj.js → app-S9HQBEDL.js} +4514 -4410
  47. package/dist/app.d.ts +53 -0
  48. package/dist/app.js +1 -1
  49. package/dist/closing-template-DSppbNBU.js +125 -0
  50. package/dist/component-DpCUABT3.js +82 -0
  51. package/dist/components/FmInventoryTableToolbar.vue.d.ts +8 -0
  52. package/dist/components/FmMultiselectDialogProps.d.ts +5 -0
  53. package/dist/components/TemplatePublishDialog.d.ts +2 -0
  54. package/dist/{date2-BWoUn1K_.js → date2-a0EDY-8z.js} +1 -1
  55. package/dist/{dayjs.min-cMW8olEu.js → dayjs.min-D3uqC-FM.js} +26 -26
  56. package/dist/{decimal-8BRzZQU6.js → decimal-iC0dKSbY.js} +2 -2
  57. package/dist/{defineDeepModel-AsUZ-DyW.js → defineDeepModel-sBbNFqqR.js} +1 -1
  58. package/dist/{duplicate-template-CyHfZR3S.js → duplicate-template-Dwe_h80w.js} +1 -1
  59. package/dist/{feature-Dm0FnWf9.js → feature-12j10xt_.js} +8956 -6221
  60. package/dist/{format-time-from-id-C9lmv5BP.js → format-time-from-id-Dyyvx-ha.js} +1 -1
  61. package/dist/{format-unit-display-BV8pJisO.js → format-unit-display-DstE3kKS.js} +11 -11
  62. package/dist/{import-export.helper-Djxw_H5S.js → import-export.helper-CR8rEBJV.js} +5 -5
  63. package/dist/{index-D6u3kywf.js → index-BbpxRM23.js} +1 -1
  64. package/dist/{index-8hCa5_Gb.js → index-Ca8nKTEy.js} +1 -1
  65. package/dist/{index-DidYtgNc.js → index-CvRrsISb.js} +3 -3
  66. package/dist/{lodash-CW_Ea6mA.js → lodash-BiCqhRt2.js} +1 -1
  67. package/dist/netsuite-B84CfGmT.js +5454 -0
  68. package/dist/{purchase-order-template-BTzjcgrO.js → purchase-order-template-ogVLqXnM.js} +1 -1
  69. package/dist/router/name.d.ts +1 -0
  70. package/dist/{rules-DkVWS5mF.js → rules-C0W8tBAK.js} +9 -9
  71. package/dist/{stock-CHw8pI8V.js → stock-BfY956rP.js} +3 -3
  72. package/dist/{stock-D8hLHgeN.js → stock-Dy08ISna.js} +1 -1
  73. package/dist/stores/feature.d.ts +4 -0
  74. package/dist/stores/integration/netsuite.d.ts +5 -0
  75. package/dist/stores/surcharge.d.ts +18 -0
  76. package/dist/style.css +1 -1
  77. package/dist/{supplier-Dv83IfQr.js → supplier-BGfg_Uzv.js} +2 -2
  78. package/dist/surcharge-DZkc9Zxa.js +71 -0
  79. package/dist/tsconfig.app.tsbuildinfo +1 -1
  80. package/dist/{use-ingredient-select-dialog-CJjd4g-6.js → use-ingredient-select-dialog-fOf-xHgn.js} +2 -2
  81. package/dist/{use-inventory-binding-dialog-D4g79p5S.js → use-inventory-binding-dialog-CF6dmCop.js} +2 -2
  82. package/dist/{use-template-enabled-locations-2-Cg2iqQdq.js → use-template-enabled-locations-2-C9YTP8tP.js} +2 -2
  83. package/dist/views/adjustment-template/wastage-template/actions.d.ts +4 -1
  84. package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +714 -0
  85. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +8 -1
  86. package/dist/views/stock/components/StockRecordCard.vue.d.ts +1 -1
  87. package/dist/views/surcharge/SurchargeView.vue.d.ts +2 -0
  88. package/dist/{vue-i18n-kUcLfpvT.js → vue-i18n-CVvQI1xZ.js} +571 -571
  89. package/dist/{xlsx-BjeMbhDF.js → xlsx-C46Afq2T.js} +1 -1
  90. package/dist/{xlsx.util-9eMlJfd9.js → xlsx.util-iJmlHY2V.js} +1 -1
  91. package/package.json +2 -2
  92. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Dgibb-Fh.js +0 -231
  93. package/dist/FmMultiselectDialog-CDONDKxE.js +0 -598
  94. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-YuCn0irA.js +0 -375
  95. package/dist/ReceiveRequestView-_TOSnDGJ.js +0 -2913
  96. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-cfFHDIwQ.js +0 -162
  97. package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-D8vbPlie.js +0 -155
  98. package/dist/WastageTemplateView-DpikyyZW.js +0 -2327
  99. package/dist/app-uBuHtW8m.js +0 -8127
  100. package/dist/closing-template-DXGjC5AG.js +0 -117
  101. package/dist/cypress/component/receive-request/KDI-15-total-price-currency.cy.d.ts +0 -2
  102. package/dist/netsuite-BEto-z0v.js +0 -5131
  103. package/dist/views/ingredients/helper/calculate-default-cost.d.ts +0 -9
  104. package/dist/views/receive-request/components/transfer-form/TransferForm2.vue.d.ts +0 -22
@@ -1,56 +1,70 @@
1
- import { ref as R, h as P, defineComponent as K, resolveComponent as E, openBlock as $, createElementBlock as D, createElementVNode as _, normalizeClass as q, createTextVNode as ae, toDisplayString as I, unref as u, createCommentVNode as O, createVNode as C, withCtx as V, Fragment as j, renderList as Z, computed as L, watch as Pe, createSlots as Ee, createBlock as N, isRef as Ye, normalizeStyle as Ge, Teleport as Ke, normalizeProps as We, guardReactiveProps as qe, mergeProps as Je } from "vue";
1
+ import { ref as R, h as P, defineComponent as K, resolveComponent as E, openBlock as $, createElementBlock as D, createElementVNode as _, normalizeClass as q, createTextVNode as ae, toDisplayString as I, unref as d, createCommentVNode as O, createVNode as C, withCtx as V, Fragment as j, renderList as Z, computed as L, watch as Pe, createSlots as Ee, createBlock as N, isRef as Ye, normalizeStyle as Ge, Teleport as Ke, normalizeProps as We, guardReactiveProps as qe, mergeProps as Je } from "vue";
2
2
  import { u as Xe, _ as Qe } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
3
3
  import { useI18n as W, useCoreStore as de } from "@feedmepos/mf-common";
4
4
  import { useDialog as pe, useDialogChild as Ze, useSnackbar as ce, FmButtonVariant as oe, components as Y, FmAdvancedSort as et, useProxiedModel as tt, useBreakpoints as nt } from "@feedmepos/ui-library";
5
5
  import { defineStore as Ve, storeToRefs as Ue } from "pinia";
6
6
  import { F as G } from "./form-mode.enum-BKiNVH6A.js";
7
- import { a as me } from "./closing-template-DXGjC5AG.js";
8
- import { u as fe, c as Ne, a as ve, n as ot } from "./app-CySQTQxj.js";
9
- import { t as re, a as ge, d as ye, s as Le, r as st } from "./xlsx.util-9eMlJfd9.js";
7
+ import { a as me } from "./closing-template-DSppbNBU.js";
8
+ import { u as fe, c as Ne, a as ve, n as ot } from "./app-S9HQBEDL.js";
9
+ import { t as re, a as ge, d as ye, s as Le, r as st } from "./xlsx.util-iJmlHY2V.js";
10
10
  import { F as lt } from "./FmDroppableField-J0xUsOTV.js";
11
- import { f as Be, a as le } from "./date2-BWoUn1K_.js";
11
+ import { f as Be, a as le } from "./date2-a0EDY-8z.js";
12
12
  import { D as se, R as z } from "./row-action.enum-BcW_L_nE.js";
13
- import { c as at, F as X, _ as ze } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-cfFHDIwQ.js";
14
- import { f as rt } from "./format-time-from-id-C9lmv5BP.js";
15
- import { _ as it } from "./TemplatePublishDialog.vue_vue_type_script_setup_true_lang-D8vbPlie.js";
16
- import { u as ct } from "./netsuite-BEto-z0v.js";
17
- import { u as mt } from "./duplicate-template-CyHfZR3S.js";
18
- import { _ as ut } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DHe5G3kX.js";
19
- import { R as dt, A as pt } from "./rules-DkVWS5mF.js";
20
- import { u as ft } from "./use-ingredient-select-dialog-CJjd4g-6.js";
21
- import { d as vt } from "./defineDeepModel-AsUZ-DyW.js";
22
- import { u as gt } from "./use-template-enabled-locations-2-Cg2iqQdq.js";
23
- import { _ as yt } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-D-c0Ayis.js";
13
+ import { c as at } from "./component-DpCUABT3.js";
14
+ import { f as rt } from "./format-time-from-id-Dyyvx-ha.js";
15
+ import { _ as it } from "./TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DZxJDrcN.js";
16
+ import { u as ct } from "./netsuite-B84CfGmT.js";
17
+ import { u as mt } from "./duplicate-template-Dwe_h80w.js";
18
+ import { _ as ut } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BSrjl8Vc.js";
19
+ import { R as dt, A as pt } from "./rules-C0W8tBAK.js";
20
+ import { u as ft } from "./use-ingredient-select-dialog-fOf-xHgn.js";
21
+ import { d as vt } from "./defineDeepModel-sBbNFqqR.js";
22
+ import { F as X, _ as ze } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js";
23
+ import { u as gt } from "./use-template-enabled-locations-2-C9YTP8tP.js";
24
+ import { _ as yt } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-BxqwBD1A.js";
24
25
  import { _ as ht } from "./_plugin-vue_export-helper-CHgC5LLL.js";
25
26
  const ue = Ve(
26
27
  "closingTemplateTable",
27
28
  function() {
28
- const { t: r } = W(), l = pe(), d = R({}), t = ie(), n = R({}), f = R(new Array()), b = R(!1), c = fe(), a = me();
29
- function g(s) {
30
- const v = {
31
- title: s.name,
32
- doc: s,
29
+ const { t: r } = W(), a = pe(), u = R({}), t = ie(), n = R({}), p = R(new Array()), b = R(!1), c = fe(), l = me();
30
+ function g(o) {
31
+ const f = {
32
+ title: o.name,
33
+ doc: o,
33
34
  controller: {
34
- publishAll: async (T) => {
35
- const e = T || s.locations, k = await a.publishSingleDoc(
36
- s._id,
35
+ publishAll: async (k) => {
36
+ const e = k || o.locations, T = await l.publishSingleDoc(
37
+ o._id,
37
38
  e == null ? void 0 : e.map((M) => M.dbName)
38
39
  );
39
- return d.value = k.publishedRevByLocation || {}, d.value;
40
+ return u.value = T.publishedRevByLocation || {}, u.value;
40
41
  },
41
- publishAtLocation: async (T) => {
42
- const e = await a.publishSingleDoc(s._id, [T.dbName]);
43
- return d.value = e.publishedRevByLocation || {}, d.value;
42
+ publishAtLocation: async (k) => {
43
+ const e = await l.publishSingleDoc(o._id, [k.dbName]);
44
+ return u.value = e.publishedRevByLocation || {}, u.value;
45
+ },
46
+ unpublishAll: async (k) => {
47
+ const e = k || o.locations, T = await l.unpublishSingleDoc(
48
+ o._id,
49
+ e == null ? void 0 : e.map((M) => M.dbName)
50
+ );
51
+ return u.value = T.publishedRevByLocation || {}, u.value;
52
+ },
53
+ unpublishAtLocation: async (k) => {
54
+ const e = await l.unpublishSingleDoc(o._id, [
55
+ k.dbName
56
+ ]);
57
+ return u.value = e.publishedRevByLocation || {}, u.value;
44
58
  }
45
59
  },
46
- initialPublishedRev: d.value,
60
+ initialPublishedRev: u.value,
47
61
  locations: c.locations,
48
- enabledLocations: s.locations
62
+ enabledLocations: o.locations
49
63
  };
50
- l.open({
64
+ a.open({
51
65
  title: "Publish template",
52
66
  contentComponent: it,
53
- contentComponentProps: v,
67
+ contentComponentProps: f,
54
68
  closeButton: !0,
55
69
  primaryActions: {
56
70
  text: r("common.close"),
@@ -60,50 +74,50 @@ const ue = Ve(
60
74
  });
61
75
  }
62
76
  async function i() {
63
- if (f.value = [], !!c._currentLocation) {
77
+ if (p.value = [], !!c._currentLocation) {
64
78
  b.value = !0;
65
79
  try {
66
- const [s, v, T] = await Promise.all([
67
- a.readTemplates(),
68
- a.getRecentPublishingJob(),
69
- a.getRecentPublishInfo()
80
+ const [o, f, k] = await Promise.all([
81
+ l.readTemplates(),
82
+ l.getRecentPublishingJob(),
83
+ l.getRecentPublishInfo()
70
84
  ]).delayed(1e3);
71
- f.value = s, n.value = v, d.value = T.publishedRevByLocation || {};
72
- } catch (s) {
73
- console.log("Something went wrong when fetching templates:", s);
85
+ p.value = o, n.value = f, u.value = k.publishedRevByLocation || {};
86
+ } catch (o) {
87
+ console.log("Something went wrong when fetching templates:", o);
74
88
  } finally {
75
89
  b.value = !1;
76
90
  }
77
91
  }
78
92
  }
79
- async function h(s) {
80
- if (!f.value.find((v) => v._id) && c._currentLocation) {
93
+ async function h(o) {
94
+ if (!p.value.find((f) => f._id) && c._currentLocation) {
81
95
  b.value = !0;
82
96
  try {
83
- const [v] = await Promise.all([
84
- a.getTemplate(s),
85
- new Promise((T) => setTimeout(T, 1e3))
97
+ const [f] = await Promise.all([
98
+ l.getTemplate(o),
99
+ new Promise((k) => setTimeout(k, 1e3))
86
100
  ]);
87
- f.value = [v];
88
- } catch (v) {
89
- console.log("Something went wrong when fetching templates:", v);
101
+ p.value = [f];
102
+ } catch (f) {
103
+ console.log("Something went wrong when fetching templates:", f);
90
104
  } finally {
91
105
  b.value = !1;
92
106
  }
93
107
  }
94
108
  }
95
- function w(s, v) {
96
- switch (v = Ne(v), s) {
109
+ function w(o, f) {
110
+ switch (f = Ne(f), o) {
97
111
  case z.Details:
98
- return t.viewTemplate(v);
112
+ return t.viewTemplate(f);
99
113
  case z.Edit:
100
- return t.updateTemplate(v);
114
+ return t.updateTemplate(f);
101
115
  case z.Delete:
102
- return t.deleteTemplate(v, b, i);
116
+ return t.deleteTemplate(f, b, i);
103
117
  case z.Publish:
104
- return g(v);
118
+ return g(f);
105
119
  case z.Duplicate:
106
- return t.duplicateTemplate(v, b, i);
120
+ return t.duplicateTemplate(f, b, i);
107
121
  }
108
122
  }
109
123
  return {
@@ -112,8 +126,8 @@ const ue = Ve(
112
126
  id: "_id",
113
127
  accessorKey: "_id",
114
128
  header: () => r("inventory.closing.table.createdAt"),
115
- cell(s) {
116
- return rt(`${s.getValue()}`);
129
+ cell(o) {
130
+ return rt(`${o.getValue()}`);
117
131
  },
118
132
  enableSorting: !0
119
133
  },
@@ -138,10 +152,10 @@ const ue = Ve(
138
152
  id: "enabledLocations",
139
153
  accessorKey: "locations.length",
140
154
  header: () => r("inventory.closing.table.enabledOutlets"),
141
- cell(s) {
142
- var T;
143
- const v = (T = s.row.original.locations) == null ? void 0 : T.length;
144
- return v ? `${v}` : "All";
155
+ cell(o) {
156
+ var k;
157
+ const f = (k = o.row.original.locations) == null ? void 0 : k.length;
158
+ return f ? `${f}` : "All";
145
159
  },
146
160
  enableSorting: !1,
147
161
  meta: {
@@ -160,8 +174,8 @@ const ue = Ve(
160
174
  id: "status",
161
175
  header: () => r("inventory.adjustment.template.table.status"),
162
176
  enableSorting: !1,
163
- cell(s) {
164
- const v = s.row.original, T = v._rev, e = s.row.original.locations || c.locations, M = e.filter((p) => !!(d.value[p.dbName] || []).find((x) => x._id === v._id && x._rev === T)).length === e.length;
177
+ cell(o) {
178
+ const f = o.row.original, k = f._rev, e = o.row.original.locations || c.locations, M = e.filter((v) => !!(u.value[v.dbName] || []).find((x) => x._id === f._id && x._rev === k)).length === e.length;
165
179
  return P(
166
180
  "div",
167
181
  {
@@ -182,14 +196,14 @@ const ue = Ve(
182
196
  },
183
197
  {
184
198
  id: "action",
185
- cell(s) {
186
- const v = s.row.original, T = [
199
+ cell(o) {
200
+ const f = o.row.original, k = [
187
201
  se[z.Edit],
188
202
  se[z.Duplicate],
189
203
  se[z.Delete],
190
204
  se[z.Publish]
191
205
  ];
192
- return at(T, (e) => w(e, v));
206
+ return at(k, (e) => w(e, f));
193
207
  },
194
208
  enableSorting: !1,
195
209
  size: 40,
@@ -200,7 +214,7 @@ const ue = Ve(
200
214
  }
201
215
  ],
202
216
  recentPublish: n,
203
- templates: f,
217
+ templates: p,
204
218
  loading: b,
205
219
  fetchTemplates: i,
206
220
  loadTemplate: h
@@ -209,17 +223,17 @@ const ue = Ve(
209
223
  );
210
224
  var he = /* @__PURE__ */ ((m) => (m.Ingredients = "Ingredients", m))(he || {});
211
225
  function He(m) {
212
- const r = m.sku, l = new Set(m.disabledMeasurements);
226
+ const r = m.sku, a = new Set(m.disabledMeasurements);
213
227
  return [
214
228
  {
215
229
  code: r.code,
216
230
  name: r.name,
217
231
  unit: r.unit.abbrev,
218
- enabled: !l.has(r.unit._id)
232
+ enabled: !a.has(r.unit._id)
219
233
  },
220
234
  ...r.unit.measurements.map((n) => ({
221
235
  unit: n.abbrev,
222
- enabled: !l.has(n.id)
236
+ enabled: !a.has(n.id)
223
237
  }))
224
238
  ];
225
239
  }
@@ -245,45 +259,45 @@ function Oe() {
245
259
  }
246
260
  function bt(m) {
247
261
  var b;
248
- const l = de().currentBusiness.value, t = (b = m.map((c) => {
262
+ const a = de().currentBusiness.value, t = (b = m.map((c) => {
249
263
  var y;
250
- const a = c.items.flatMap(He), g = Oe(), i = [
264
+ const l = c.items.flatMap(He), g = Oe(), i = [
251
265
  ["Template ID", c._id],
252
266
  ["Template name", c.name],
253
- ["Business name", l == null ? void 0 : l.name],
254
- ["Business ID", l == null ? void 0 : l._id],
255
- ["Menu version", l == null ? void 0 : l.menuVersion],
267
+ ["Business name", a == null ? void 0 : a.name],
268
+ ["Business ID", a == null ? void 0 : a._id],
269
+ ["Menu version", a == null ? void 0 : a.menuVersion],
256
270
  [
257
271
  "Locations",
258
- ...(y = c.locations) != null && y.length ? c.locations.map((s) => `${s.name} (${s.dbName})`) : ["All"]
272
+ ...(y = c.locations) != null && y.length ? c.locations.map((o) => `${o.name} (${o.dbName})`) : ["All"]
259
273
  ],
260
274
  ["Reference", c.ref ?? ""],
261
275
  [],
262
- g.map((s) => s.name),
263
- ...a.map((s) => g.map((v) => s[v.id]))
264
- ], h = g.map((s) => `system:${s.id}`), w = re(i, h);
276
+ g.map((o) => o.name),
277
+ ...l.map((o) => g.map((f) => o[f.id]))
278
+ ], h = g.map((o) => `system:${o.id}`), w = re(i, h);
265
279
  return { name: c.name, sheet: w };
266
280
  }).reduce(
267
- (c, a) => {
281
+ (c, l) => {
268
282
  var i;
269
- const g = a.name.slice(0, 12);
270
- return (i = c.sheetOccurence)[g] ?? (i[g] = 0), c.sheetOccurence[g] += 1, c.sheets[`${g} (${c.sheetOccurence[g]})`] = a.sheet, c;
283
+ const g = l.name.slice(0, 12);
284
+ return (i = c.sheetOccurence)[g] ?? (i[g] = 0), c.sheetOccurence[g] += 1, c.sheets[`${g} (${c.sheetOccurence[g]})`] = l.sheet, c;
271
285
  },
272
286
  {
273
287
  sheets: {},
274
288
  sheetOccurence: {}
275
289
  }
276
- )) == null ? void 0 : b.sheets, n = `${l == null ? void 0 : l.name} closing templates (${Be(/* @__PURE__ */ new Date())}).xlsx`, f = ge(t);
277
- return ye(f, n), n;
290
+ )) == null ? void 0 : b.sheets, n = `${a == null ? void 0 : a.name} closing templates (${Be(/* @__PURE__ */ new Date())}).xlsx`, p = ge(t);
291
+ return ye(p, n), n;
278
292
  }
279
293
  function _t(m) {
280
294
  de().currentBusiness.value;
281
- const l = 3, d = (i) => {
295
+ const a = 3, u = (i) => {
282
296
  const h = [], w = i.sku, y = new Set(i.disabledMeasurements || []);
283
297
  y.has(w.unit._id) || h.push(w.unit.abbrev);
284
- for (const s of w.unit.measurements) {
285
- if (h.length >= l) break;
286
- y.has(s.id) || h.push(s.abbrev);
298
+ for (const o of w.unit.measurements) {
299
+ if (h.length >= a) break;
300
+ y.has(o.id) || h.push(o.abbrev);
287
301
  }
288
302
  return h;
289
303
  }, t = ["#", "Code", "Name", "UOM"], n = [
@@ -292,44 +306,44 @@ function _t(m) {
292
306
  [],
293
307
  t,
294
308
  ...m.items.map((i, h) => {
295
- const w = d(i);
309
+ const w = u(i);
296
310
  return [
297
311
  h + 1,
298
312
  // Index starting from 1
299
313
  i.sku.code,
300
314
  i.sku.name,
301
315
  // Add UOM columns (up to MAX_UOM_COLUMNS)
302
- ...Array(l).fill("").map(
303
- (y, s) => w[s] ? `_____ ${w[s]}` : ""
316
+ ...Array(a).fill("").map(
317
+ (y, o) => w[o] ? `_____ ${w[o]}` : ""
304
318
  )
305
319
  ];
306
320
  })
307
- ], f = re(n, t);
308
- if (f["!ref"]) {
321
+ ], p = re(n, t);
322
+ if (p["!ref"]) {
309
323
  const i = {
310
324
  top: { style: "thin", color: { rgb: "000000" } },
311
325
  bottom: { style: "thin", color: { rgb: "000000" } },
312
326
  left: { style: "thin", color: { rgb: "000000" } },
313
327
  right: { style: "thin", color: { rgb: "000000" } }
314
- }, h = 4, w = h + m.items.length, y = t.map((s, v) => String.fromCharCode(65 + v));
315
- for (let s = h; s <= w; s++)
316
- y.forEach((v) => {
317
- const T = `${v}${s}`;
318
- f[T] || (f[T] = { t: "s", v: "" }), f[T].s = {
328
+ }, h = 4, w = h + m.items.length, y = t.map((o, f) => String.fromCharCode(65 + f));
329
+ for (let o = h; o <= w; o++)
330
+ y.forEach((f) => {
331
+ const k = `${f}${o}`;
332
+ p[k] || (p[k] = { t: "s", v: "" }), p[k].s = {
319
333
  border: i
320
334
  };
321
335
  });
322
336
  }
323
- f["!cols"] = [
337
+ p["!cols"] = [
324
338
  { wch: 5 },
325
339
  // Index column - narrow
326
340
  { wch: 15 },
327
341
  // Code column
328
342
  { wch: 30 },
329
343
  // Name column - adjusted for more columns
330
- ...Array.from({ length: l }, () => ({ wch: 15 }))
344
+ ...Array.from({ length: a }, () => ({ wch: 15 }))
331
345
  // UOM columns
332
- ], f["!margins"] = {
346
+ ], p["!margins"] = {
333
347
  left: 0.7,
334
348
  right: 0.7,
335
349
  top: 0.75,
@@ -337,11 +351,11 @@ function _t(m) {
337
351
  header: 0.3,
338
352
  footer: 0.3
339
353
  };
340
- const c = m.name.slice(0, 31), a = ge({ [c]: f }), g = `${m.name} - Closing Template (${Be(/* @__PURE__ */ new Date())}).xlsx`;
341
- return ye(a, g), g;
354
+ const c = m.name.slice(0, 31), l = ge({ [c]: p }), g = `${m.name} - Closing Template (${Be(/* @__PURE__ */ new Date())}).xlsx`;
355
+ return ye(l, g), g;
342
356
  }
343
357
  function xt() {
344
- const m = de(), r = ve(), l = ct(), d = He({
358
+ const m = de(), r = ve(), a = ct(), u = He({
345
359
  sku: {
346
360
  unit: {
347
361
  _id: "",
@@ -354,7 +368,7 @@ function xt() {
354
368
  _id: "",
355
369
  name: "Sugar"
356
370
  }
357
- })[0], t = m.currentBusiness.value, n = Oe(), f = [
371
+ })[0], t = m.currentBusiness.value, n = Oe(), p = [
358
372
  ["Template ID (leave empty to create new)", ""],
359
373
  ["Template Name", "New template"],
360
374
  ["Business name", t == null ? void 0 : t.name],
@@ -368,24 +382,24 @@ function xt() {
368
382
  ["Reference:"],
369
383
  [],
370
384
  n.map((y) => y.name),
371
- n.map((y) => d[y.id])
372
- ], b = n.map((y) => `system:${y.id}`), c = re(f, b), a = l.isEnabled ? l.state.setting.childItems ?? [] : [], g = a.reduce(
373
- (y, s) => {
374
- var M, p;
375
- const v = (M = l.netSuiteItemIdToSkuId.get(s.parentNetSuiteId)) == null ? void 0 : M[0], T = (p = l.netSuiteMeasurementIdToMeasurementId.get(
376
- s.unitOfMeasureId
377
- )) == null ? void 0 : p[0];
378
- if (!s.externalId)
385
+ n.map((y) => u[y.id])
386
+ ], b = n.map((y) => `system:${y.id}`), c = re(p, b), l = a.isEnabled ? a.state.setting.childItems ?? [] : [], g = l.reduce(
387
+ (y, o) => {
388
+ var M, v;
389
+ const f = (M = a.netSuiteItemIdToSkuId.get(o.parentNetSuiteId)) == null ? void 0 : M[0], k = (v = a.netSuiteMeasurementIdToMeasurementId.get(
390
+ o.unitOfMeasureId
391
+ )) == null ? void 0 : v[0];
392
+ if (!o.externalId)
379
393
  return y;
380
- if (!v)
381
- return console.error(`Item ${s.externalId} cannot be mapped to parent FdoInventorySku.`, s), y;
382
- const e = r.skuById[v], k = e.unit.measurements.find((o) => o.id === T);
383
- return k ? (y[s.externalId] = {
394
+ if (!f)
395
+ return console.error(`Item ${o.externalId} cannot be mapped to parent FdoInventorySku.`, o), y;
396
+ const e = r.skuById[f], T = e.unit.measurements.find((s) => s.id === k);
397
+ return T ? (y[o.externalId] = {
384
398
  sku: e,
385
- measurement: k
399
+ measurement: T
386
400
  }, y) : (console.error(
387
- `Item ${s.externalId} found parent FdoInventorySku of ${e.code} ${e.name} but the measurement of netsuite id ${s.unitOfMeasureId} cannot be found.`,
388
- s
401
+ `Item ${o.externalId} found parent FdoInventorySku of ${e.code} ${e.name} but the measurement of netsuite id ${o.unitOfMeasureId} cannot be found.`,
402
+ o
389
403
  ), y);
390
404
  },
391
405
  {}
@@ -393,18 +407,18 @@ function xt() {
393
407
  [
394
408
  ...r.skus.flatMap((y) => [
395
409
  [y.code, y.name, y.unit.abbrev, !0],
396
- ...y.unit.measurements.map((v) => [
410
+ ...y.unit.measurements.map((f) => [
397
411
  "",
398
412
  "",
399
- v.abbrev,
400
- !v.abbrev.toLocaleLowerCase("en-us").includes("inactive")
413
+ f.abbrev,
414
+ !f.abbrev.toLocaleLowerCase("en-us").includes("inactive")
401
415
  ])
402
416
  ]),
403
- ...Object.entries(g).map(([y, { sku: s, measurement: v }]) => [
404
- s.code,
405
- s.name,
406
- v.abbrev,
407
- !v.abbrev.toLocaleLowerCase("en-us").includes("inactive"),
417
+ ...Object.entries(g).map(([y, { sku: o, measurement: f }]) => [
418
+ o.code,
419
+ o.name,
420
+ f.abbrev,
421
+ !f.abbrev.toLocaleLowerCase("en-us").includes("inactive"),
408
422
  y
409
423
  ])
410
424
  ],
@@ -413,7 +427,7 @@ function xt() {
413
427
  "Name",
414
428
  "Units",
415
429
  "Enabled (true/false)",
416
- ...a.length ? ["Netsuite Parent"] : []
430
+ ...l.length ? ["Netsuite Parent"] : []
417
431
  ]
418
432
  ), h = ge({
419
433
  Template: c,
@@ -424,20 +438,20 @@ function xt() {
424
438
  function wt(m) {
425
439
  if (!m.length || `${m[0]}`.toLocaleLowerCase() === "all")
426
440
  return [];
427
- const r = /(.*) \(((warehouse_|restaurant_).{24,})\)/, d = fe().locationByDbName;
441
+ const r = /(.*) \(((warehouse_|restaurant_).{24,})\)/, u = fe().locationByDbName;
428
442
  return m.map((t) => {
429
- const n = new Array(), f = t.trim(), b = r.exec(f);
443
+ const n = new Array(), p = t.trim(), b = r.exec(p);
430
444
  if (!b)
431
- return n.push(`Enabled location value of ${f} cannot be read.`), {
445
+ return n.push(`Enabled location value of ${p} cannot be read.`), {
432
446
  errors: n
433
447
  };
434
- const c = b[1], a = b[2], g = d[a];
448
+ const c = b[1], l = b[2], g = u[l];
435
449
  return g ? (c !== g.name && n.push(
436
- `Location id ${a} has non-matching name. Found ${c} but expected ${g.name}`
450
+ `Location id ${l} has non-matching name. Found ${c} but expected ${g.name}`
437
451
  ), {
438
452
  errors: n,
439
453
  location: g
440
- }) : (n.push(`Location (${c}) of id ${a} is not found.`), {
454
+ }) : (n.push(`Location (${c}) of id ${l} is not found.`), {
441
455
  errors: n
442
456
  });
443
457
  });
@@ -445,94 +459,94 @@ function wt(m) {
445
459
  function kt(m) {
446
460
  const [
447
461
  r,
448
- l,
449
- d,
462
+ a,
463
+ u,
450
464
  t,
451
465
  n,
452
- f,
466
+ p,
453
467
  b,
454
468
  c
455
469
  ] = Le(m);
456
470
  return {
457
- id: `${l[1] ?? ""}`.trim(),
458
- name: `${d[1] ?? ""}`.trim(),
459
- locations: b.slice(1).map((a) => `${a}`.trim()).filter((a) => a),
471
+ id: `${a[1] ?? ""}`.trim(),
472
+ name: `${u[1] ?? ""}`.trim(),
473
+ locations: b.slice(1).map((l) => `${l}`.trim()).filter((l) => l),
460
474
  reference: `${c[1] ?? ""}`.trim()
461
475
  };
462
476
  }
463
477
  function Tt(m) {
464
478
  const [
465
479
  r,
466
- l,
467
- d,
480
+ a,
481
+ u,
468
482
  t,
469
483
  n,
470
- f,
484
+ p,
471
485
  b,
472
486
  c,
473
- a,
487
+ l,
474
488
  g,
475
489
  ...i
476
490
  ] = Le(m);
477
- if (!r || !r.length || r.some((v) => v.length && !v.startsWith("system:")))
491
+ if (!r || !r.length || r.some((f) => f.length && !f.startsWith("system:")))
478
492
  throw new Error("Missing meta header. Excel file does not come from the template.");
479
- const h = r.map((v) => v.split(":")[1]), y = ["code", "name", "unit", "enabled"].filter((v) => !h.includes(v));
493
+ const h = r.map((f) => f.split(":")[1]), y = ["code", "name", "unit", "enabled"].filter((f) => !h.includes(f));
480
494
  if (y.length)
481
495
  throw new Error(
482
496
  `Missing meta headers (${y.join()}). Excel file does not come from the template.`
483
497
  );
484
- return i.map((v, T) => {
498
+ return i.map((f, k) => {
485
499
  const e = {};
486
- for (const k in h) {
487
- const M = h[k];
488
- Object.assign(e, { [M]: v[k] });
500
+ for (const T in h) {
501
+ const M = h[T];
502
+ Object.assign(e, { [M]: f[T] });
489
503
  }
490
504
  return {
491
- index: T,
505
+ index: k,
492
506
  data: e
493
507
  };
494
508
  });
495
509
  }
496
510
  function $t(m) {
497
511
  return m.reduce(
498
- (r, l) => {
512
+ (r, a) => {
499
513
  var n;
500
- const d = l.data, t = l.index;
501
- return d.unit && (d.code ? r.result.push({ parent: l, children: [] }) : r.result.length ? (n = r.result.at(-1)) == null || n.children.push(l) : r.errors.push(`Cannot find parent for row ${t + 9}`)), r;
514
+ const u = a.data, t = a.index;
515
+ return u.unit && (u.code ? r.result.push({ parent: a, children: [] }) : r.result.length ? (n = r.result.at(-1)) == null || n.children.push(a) : r.errors.push(`Cannot find parent for row ${t + 9}`)), r;
502
516
  },
503
517
  { result: new Array(), errors: new Array() }
504
518
  );
505
519
  }
506
520
  function Ct(m) {
507
- const r = m.parent.data, l = new Array(), t = ve().skuByCode[r.code ?? ""];
521
+ const r = m.parent.data, a = new Array(), t = ve().skuByCode[r.code ?? ""];
508
522
  if (!t)
509
- return l.push(`Cannot find ingredient of code ${r.code} ${r.name}`), { errors: l };
523
+ return a.push(`Cannot find ingredient of code ${r.code} ${r.name}`), { errors: a };
510
524
  const n = {
511
525
  sku: t
512
- }, f = /* @__PURE__ */ new Set([t.unit._id, ...t.unit.measurements.map((c) => c.id)]), b = t.unit.measurements.find((c) => c.abbrev === r.unit);
513
- r.unit !== t.unit.abbrev && !b ? l.push(
526
+ }, p = /* @__PURE__ */ new Set([t.unit._id, ...t.unit.measurements.map((c) => c.id)]), b = t.unit.measurements.find((c) => c.abbrev === r.unit);
527
+ r.unit !== t.unit.abbrev && !b ? a.push(
514
528
  `Cannot find measurement unit of ${r.unit} for (${r.code}) ${r.name}.`
515
- ) : (r.enabled === !0 || `${r.enabled}`.toLocaleLowerCase() === "true") && f.delete(t.unit._id);
529
+ ) : (r.enabled === !0 || `${r.enabled}`.toLocaleLowerCase() === "true") && p.delete(t.unit._id);
516
530
  for (const c of m.children) {
517
- const a = c.data, g = a.unit === t.unit.abbrev ? t.unit : void 0, i = t.unit.measurements.find((h) => h.abbrev === a.unit);
531
+ const l = c.data, g = l.unit === t.unit.abbrev ? t.unit : void 0, i = t.unit.measurements.find((h) => h.abbrev === l.unit);
518
532
  if (!i && !g) {
519
- l.push(
520
- `Cannot find measurement unit of ${a.unit} for (${r.code}) ${r.name}.`
533
+ a.push(
534
+ `Cannot find measurement unit of ${l.unit} for (${r.code}) ${r.name}.`
521
535
  );
522
536
  continue;
523
537
  }
524
- (a.enabled === !0 || `${a.enabled}`.toLocaleLowerCase() === "true") && f.delete((i == null ? void 0 : i.id) ?? (g == null ? void 0 : g._id) ?? "");
538
+ (l.enabled === !0 || `${l.enabled}`.toLocaleLowerCase() === "true") && p.delete((i == null ? void 0 : i.id) ?? (g == null ? void 0 : g._id) ?? "");
525
539
  }
526
- return f.has(t.unit._id) && n.sku.unit.measurements.every((c) => f.has(c.id)) && l.push(`Ingredient ${t.code} - ${t.name} must have at least one unit enabled.`), n.disabledMeasurements = [...f], { errors: l, templateItem: n };
540
+ return p.has(t.unit._id) && n.sku.unit.measurements.every((c) => p.has(c.id)) && a.push(`Ingredient ${t.code} - ${t.name} must have at least one unit enabled.`), n.disabledMeasurements = [...p], { errors: a, templateItem: n };
527
541
  }
528
542
  function It(m) {
529
543
  const r = m.SheetNames.filter(
530
544
  (n) => !Object.values(he).map(String).includes(n)
531
- ), d = ue().templates, t = ot(d, "_id");
545
+ ), u = ue().templates, t = ot(u, "_id");
532
546
  try {
533
547
  return r.reduce(
534
- (n, f) => {
535
- const b = new Array(), c = m.Sheets[f], a = kt(c), g = wt(a.locations), i = g.filter((e) => e.location).map((e) => e.location);
548
+ (n, p) => {
549
+ const b = new Array(), c = m.Sheets[p], l = kt(c), g = wt(l.locations), i = g.filter((e) => e.location).map((e) => e.location);
536
550
  b.push(...g.flatMap((e) => e.errors));
537
551
  const h = Tt(c).filter(
538
552
  (e) => e.data.code || e.data.unit
@@ -542,51 +556,51 @@ function It(m) {
542
556
  (e) => Ct(e)
543
557
  );
544
558
  b.push(...y.flatMap((e) => e.errors));
545
- const s = y.filter((e) => e.templateItem).map((e) => e.templateItem);
546
- if (a.id) {
547
- const e = t[a.id];
559
+ const o = y.filter((e) => e.templateItem).map((e) => e.templateItem);
560
+ if (l.id) {
561
+ const e = t[l.id];
548
562
  if (!e) {
549
563
  const M = {
550
- _id: a.id,
564
+ _id: l.id,
551
565
  _rev: "",
552
- name: a.name || `(unnamed from sheet ${f || "<unnamed sheet>"})`,
566
+ name: l.name || `(unnamed from sheet ${p || "<unnamed sheet>"})`,
553
567
  items: []
554
568
  };
555
- return b.push(`Template ID ${a.id} is not found.`), n.importUpdateResult.push({
569
+ return b.push(`Template ID ${l.id} is not found.`), n.importUpdateResult.push({
556
570
  type: "update",
557
571
  original: M,
558
572
  template: M,
559
- excelSheetName: f,
573
+ excelSheetName: p,
560
574
  errors: b
561
575
  }), n;
562
576
  }
563
- const k = {
577
+ const T = {
564
578
  type: "update",
565
579
  original: e,
566
580
  template: {
567
581
  ...e,
568
- name: a.name,
582
+ name: l.name,
569
583
  locations: i.length ? i : null,
570
- ref: a.reference,
571
- items: s
584
+ ref: l.reference,
585
+ items: o
572
586
  },
573
- excelSheetName: f,
587
+ excelSheetName: p,
574
588
  errors: b
575
589
  };
576
- return n.importUpdateResult.push(k), n;
590
+ return n.importUpdateResult.push(T), n;
577
591
  }
578
- const T = {
592
+ const k = {
579
593
  type: "create",
580
594
  template: {
581
- name: a.name,
595
+ name: l.name,
582
596
  locations: i.length ? i : null,
583
- ref: a.reference,
584
- items: s
597
+ ref: l.reference,
598
+ items: o
585
599
  },
586
- excelSheetName: f,
600
+ excelSheetName: p,
587
601
  errors: b
588
602
  };
589
- return n.importCreateResult.push(T), n;
603
+ return n.importCreateResult.push(k), n;
590
604
  },
591
605
  {
592
606
  invalidExcel: !1,
@@ -617,26 +631,26 @@ const St = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
617
631
  },
618
632
  setup(m) {
619
633
  const { t: r } = W();
620
- return (l, d) => {
621
- var f, b, c;
634
+ return (a, u) => {
635
+ var p, b, c;
622
636
  const t = E("FmIcon"), n = E("FmTooltip");
623
637
  return $(), D("div", St, [
624
- d[0] || (d[0] = _("div", null, "•", -1)),
638
+ u[0] || (u[0] = _("div", null, "•", -1)),
625
639
  _("div", Dt, [
626
640
  _("div", Mt, [
627
641
  _("div", {
628
642
  class: q({
629
- "text-fm-color-system-error-300": l.errors.length
643
+ "text-fm-color-system-error-300": a.errors.length
630
644
  })
631
645
  }, [
632
- ae(I(l.name) + " ", 1),
633
- l.type === "create" ? ($(), D("span", Ft, "(" + I(u(r)("inventory.closing.template.import.new")) + ")", 1)) : O("", !0)
646
+ ae(I(a.name) + " ", 1),
647
+ a.type === "create" ? ($(), D("span", Ft, "(" + I(d(r)("inventory.closing.template.import.new")) + ")", 1)) : O("", !0)
634
648
  ], 2),
635
- l.errors.length ? ($(), D("div", Rt, [
649
+ a.errors.length ? ($(), D("div", Rt, [
636
650
  C(n, { "z-index": 50 }, {
637
651
  content: V(() => [
638
652
  _("ol", null, [
639
- ($(!0), D(j, null, Z(l.errors, (a, g) => ($(), D("li", { key: g }, I(a), 1))), 128))
653
+ ($(!0), D(j, null, Z(a.errors, (l, g) => ($(), D("li", { key: g }, I(l), 1))), 128))
640
654
  ])
641
655
  ]),
642
656
  default: V(() => [
@@ -654,11 +668,11 @@ const St = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
654
668
  class: q([
655
669
  "fm-typo-en-body-sm-400",
656
670
  {
657
- "text-fm-color-system-error-200": l.errors.length,
658
- "text-fm-color-typo-secondary": !l.errors.length
671
+ "text-fm-color-system-error-200": a.errors.length,
672
+ "text-fm-color-typo-secondary": !a.errors.length
659
673
  }
660
674
  ])
661
- }, I((f = l.locations) != null && f.length ? u(r)("inventory.closing.template.import.nLocations", { count: (b = l.locations) == null ? void 0 : b.length }) : u(r)("inventory.closing.template.import.allLocations")) + ", " + I(u(r)("inventory.closing.template.import.nItems", { count: (c = l.items) == null ? void 0 : c.length })), 3)
675
+ }, I((p = a.locations) != null && p.length ? d(r)("inventory.closing.template.import.nLocations", { count: (b = a.locations) == null ? void 0 : b.length }) : d(r)("inventory.closing.template.import.allLocations")) + ", " + I(d(r)("inventory.closing.template.import.nItems", { count: (c = a.items) == null ? void 0 : c.length })), 3)
662
676
  ])
663
677
  ]);
664
678
  };
@@ -678,13 +692,13 @@ const St = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
678
692
  }, Ot = { class: "fm-typo-en-body-lg-600" }, jt = /* @__PURE__ */ K({
679
693
  __name: "ClosingTemplateImport",
680
694
  setup(m) {
681
- const r = R(null), l = Ze(), d = ce(), t = R(!1), n = R(!1), f = R(new Array()), b = R([]), c = R([]), a = L(
682
- () => !!f.value.length || b.value.some((w) => w.errors.length) || c.value.some((w) => w.errors.length)
695
+ const r = R(null), a = Ze(), u = ce(), t = R(!1), n = R(!1), p = R(new Array()), b = R([]), c = R([]), l = L(
696
+ () => !!p.value.length || b.value.some((w) => w.errors.length) || c.value.some((w) => w.errors.length)
683
697
  ), g = L(
684
698
  () => !!b.value.length || !!c.value.length
685
699
  ), { t: i } = W();
686
700
  async function h(w) {
687
- f.value = [], b.value = [], c.value = [];
701
+ p.value = [], b.value = [], c.value = [];
688
702
  try {
689
703
  t.value = !0;
690
704
  const [y] = await Promise.all([
@@ -695,29 +709,29 @@ const St = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
695
709
  if (!y.SheetNames.filter(
696
710
  (e) => !Object.values(he).map(String).includes(e)
697
711
  ).find((e) => e)) {
698
- f.value.push(i("inventory.ingredient.import.fileError.noSheet"));
712
+ p.value.push(i("inventory.ingredient.import.fileError.noSheet"));
699
713
  return;
700
714
  }
701
- const T = It(y);
702
- if (T.invalidExcel) {
703
- f.value.push(
704
- T.invalidExcelMessage ?? i("inventory.ingredient.import.fileError.invalidExcel")
715
+ const k = It(y);
716
+ if (k.invalidExcel) {
717
+ p.value.push(
718
+ k.invalidExcelMessage ?? i("inventory.ingredient.import.fileError.invalidExcel")
705
719
  );
706
720
  return;
707
721
  }
708
- if (b.value = T.importCreateResult, c.value = T.importUpdateResult, !b.value.length && !c.value.length) {
709
- f.value.push(i("inventory.ingredient.import.fileError.noData"));
722
+ if (b.value = k.importCreateResult, c.value = k.importUpdateResult, !b.value.length && !c.value.length) {
723
+ p.value.push(i("inventory.ingredient.import.fileError.noData"));
710
724
  return;
711
725
  }
712
- l.emitData(T);
726
+ a.emitData(k);
713
727
  } catch (y) {
714
- d.open({
728
+ u.open({
715
729
  title: i("inventory.ingredient.import.fileError.unableToRead"),
716
730
  message: y == null ? void 0 : y.message,
717
731
  type: "error"
718
732
  }), console.error("Error in reading file", y);
719
733
  } finally {
720
- f.value.length && d.open({
734
+ p.value.length && u.open({
721
735
  title: i("inventory.ingredient.import.fileError.invalidExcel"),
722
736
  type: "error"
723
737
  }), t.value = !1;
@@ -726,17 +740,17 @@ const St = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
726
740
  return Pe(r, (w) => {
727
741
  w && h(w);
728
742
  }), (w, y) => {
729
- const s = E("FmCircularProgress"), v = E("FmIcon"), T = E("FmButton");
743
+ const o = E("FmCircularProgress"), f = E("FmIcon"), k = E("FmButton");
730
744
  return $(), D("div", At, [
731
- _("div", Pt, I(u(i)("inventory.closing.template.import.message")), 1),
745
+ _("div", Pt, I(d(i)("inventory.closing.template.import.message")), 1),
732
746
  n.value ? ($(), D("div", Et, [
733
747
  _("div", null, [
734
- C(s, {
748
+ C(o, {
735
749
  size: "md",
736
750
  color: "neutral-gray-200"
737
751
  })
738
752
  ]),
739
- _("div", Vt, I(u(i)("inventory.formField.loading")), 1)
753
+ _("div", Vt, I(d(i)("inventory.formField.loading")), 1)
740
754
  ])) : ($(), D(j, { key: 1 }, [
741
755
  C(lt, {
742
756
  class: q({
@@ -745,8 +759,8 @@ const St = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
745
759
  }),
746
760
  accept: ".xlsx",
747
761
  onFileUpload: y[0] || (y[0] = (e) => r.value = e),
748
- label: u(i)("inventory.ingredient.import.uploadTemplate"),
749
- "button-label": u(i)("inventory.ingredient.import.selectFile")
762
+ label: d(i)("inventory.ingredient.import.uploadTemplate"),
763
+ "button-label": d(i)("inventory.ingredient.import.selectFile")
750
764
  }, Ee({ _: 2 }, [
751
765
  r.value ? {
752
766
  name: "default",
@@ -757,20 +771,20 @@ const St = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
757
771
  "fm-corner-radius-md p-16 flex items-center gap-16",
758
772
  {
759
773
  "border border-fm-color-neutral-gray-100": t.value,
760
- "border border-fm-color-neutral-gray-200": !t.value && !a.value,
761
- "border border-fm-color-system-error-200": a.value
774
+ "border border-fm-color-neutral-gray-200": !t.value && !l.value,
775
+ "border border-fm-color-system-error-200": l.value
762
776
  }
763
777
  ])
764
778
  }, [
765
- t.value ? ($(), N(s, {
779
+ t.value ? ($(), N(o, {
766
780
  key: 0,
767
781
  size: "md",
768
782
  color: "neutral-gray-200"
769
- })) : ($(), N(v, {
783
+ })) : ($(), N(f, {
770
784
  key: 1,
771
- name: a.value ? "error" : "attach_file",
785
+ name: l.value ? "error" : "attach_file",
772
786
  outline: "",
773
- color: a.value ? "system-error-300" : void 0
787
+ color: l.value ? "system-error-300" : void 0
774
788
  }, null, 8, ["name", "color"])),
775
789
  _("div", {
776
790
  class: q([
@@ -784,25 +798,25 @@ const St = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
784
798
  _("div", Nt, I(r.value.name), 1)
785
799
  ], 2),
786
800
  t.value ? O("", !0) : ($(), D("div", Lt, [
787
- C(T, {
788
- label: u(i)("inventory.ingredient.import.replaceFile"),
789
- variant: a.value ? "destructive" : "secondary",
790
- "prepend-icon": a.value ? void 0 : "autorenew",
801
+ C(k, {
802
+ label: d(i)("inventory.ingredient.import.replaceFile"),
803
+ variant: l.value ? "destructive" : "secondary",
804
+ "prepend-icon": l.value ? void 0 : "autorenew",
791
805
  onClick: e
792
806
  }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
793
807
  ]))
794
808
  ], 2),
795
- f.value.length ? ($(), D("div", Bt, [
796
- ($(!0), D(j, null, Z(f.value, (k, M) => ($(), D("div", {
809
+ p.value.length ? ($(), D("div", Bt, [
810
+ ($(!0), D(j, null, Z(p.value, (T, M) => ($(), D("div", {
797
811
  key: M,
798
812
  class: "flex gap-8 items-center"
799
813
  }, [
800
- C(v, {
814
+ C(f, {
801
815
  name: "error",
802
816
  size: "sm",
803
817
  color: "system-error-300"
804
818
  }),
805
- _("div", zt, I(k), 1)
819
+ _("div", zt, I(T), 1)
806
820
  ]))), 128))
807
821
  ])) : O("", !0)
808
822
  ])
@@ -811,9 +825,9 @@ const St = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
811
825
  } : void 0
812
826
  ]), 1032, ["class", "label", "button-label"]),
813
827
  g.value ? ($(), D("div", Ht, [
814
- _("div", Ot, I(u(i)("inventory.ingredient.import.summary")), 1),
815
- ($(!0), D(j, null, Z(b.value, (e, k) => ($(), N(Ae, {
816
- key: k,
828
+ _("div", Ot, I(d(i)("inventory.ingredient.import.summary")), 1),
829
+ ($(!0), D(j, null, Z(b.value, (e, T) => ($(), N(Ae, {
830
+ key: T,
817
831
  name: e.template.name,
818
832
  locations: e.template.locations,
819
833
  items: e.template.items,
@@ -834,7 +848,7 @@ const St = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
834
848
  };
835
849
  }
836
850
  }), ie = Ve("closingTemplateActions", () => {
837
- const { t: m } = W(), r = pe(), l = ce(), d = me(), t = mt(), n = ue(), { loading: f } = Ue(n), b = R({});
851
+ const { t: m } = W(), r = pe(), a = ce(), u = me(), t = mt(), n = ue(), { loading: p } = Ue(n), b = R({});
838
852
  function c() {
839
853
  b.value = {
840
854
  mode: G.CREATE,
@@ -844,17 +858,17 @@ const St = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
844
858
  }
845
859
  };
846
860
  }
847
- function a(e) {
861
+ function l(e) {
848
862
  b.value = {
849
863
  mode: G.UPDATE,
850
864
  modelValue: e,
851
865
  show: !0,
852
- "onUpdate:show"(k) {
853
- b.value.show = k;
866
+ "onUpdate:show"(T) {
867
+ b.value.show = T;
854
868
  }
855
869
  };
856
870
  }
857
- function g(e, k, M) {
871
+ function g(e, T, M) {
858
872
  r.open({
859
873
  title: `Confirm deleting template ${e.name}?`,
860
874
  message: "Deleted template can no longer be retrieved",
@@ -869,34 +883,34 @@ const St = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
869
883
  close: !0
870
884
  }
871
885
  }).onPrimary(async () => {
872
- l.open({
886
+ a.open({
873
887
  title: `Deleting ${e.name}`,
874
888
  type: "info"
875
889
  });
876
890
  try {
877
- k.value = !0;
878
- const [p] = await Promise.allSettled([
879
- d.deleteTemplate(e),
880
- new Promise((o) => setTimeout(o, 1e3))
891
+ T.value = !0;
892
+ const [v] = await Promise.allSettled([
893
+ u.deleteTemplate(e),
894
+ new Promise((s) => setTimeout(s, 1e3))
881
895
  ]);
882
- if (p.status === "rejected") throw p.reason;
883
- l.open({
884
- title: `Deleted ${e.name}`,
896
+ if (v.status === "rejected") throw v.reason;
897
+ a.open({
898
+ title: `Deleted "${e.name}"`,
885
899
  type: "success"
886
900
  });
887
- } catch (p) {
888
- l.open({
889
- title: `Unable to delete ${e.name}`,
890
- message: `See error from server: ${p}`,
901
+ } catch (v) {
902
+ a.open({
903
+ title: `Unable to delete "${e.name}"`,
904
+ message: v.message,
891
905
  type: "error"
892
- }), console.error("error on deleting closing template", p);
906
+ });
893
907
  } finally {
894
- k.value = !1, M();
908
+ T.value = !1, M();
895
909
  }
896
910
  });
897
911
  }
898
- function i(e, k, M) {
899
- let p;
912
+ function i(e, T, M) {
913
+ let v;
900
914
  r.open({
901
915
  title: `Confirm duplicating template "${e.name}"?`,
902
916
  message: "Duplicated template can be edited after creation",
@@ -913,10 +927,10 @@ const St = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
913
927
  contentComponent: K({
914
928
  props: ["modelValue"],
915
929
  emits: ["update:modelValue"],
916
- setup(o) {
930
+ setup(s) {
917
931
  return () => P(Y.FmTextField, {
918
- modelValue: o.modelValue,
919
- "onUpdate:modelValue": (x) => p = x,
932
+ modelValue: s.modelValue,
933
+ "onUpdate:modelValue": (x) => v = x,
920
934
  label: "New Template Name",
921
935
  size: "md",
922
936
  variant: "primary"
@@ -924,29 +938,29 @@ const St = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
924
938
  }
925
939
  })
926
940
  }).onPrimary(async () => {
927
- l.open({
941
+ a.open({
928
942
  title: `Duplicating "${e.name}"`,
929
943
  type: "info"
930
944
  });
931
945
  try {
932
- k.value = !0;
933
- const [o] = await Promise.allSettled([
934
- t.duplicateClosingTemplate(e._id, p),
946
+ T.value = !0;
947
+ const [s] = await Promise.allSettled([
948
+ t.duplicateClosingTemplate(e._id, v),
935
949
  new Promise((x) => setTimeout(x, 1e3))
936
950
  ]);
937
- if (o.status === "rejected") throw o.reason;
938
- l.open({
951
+ if (s.status === "rejected") throw s.reason;
952
+ a.open({
939
953
  title: `Duplicated "${e.name}"`,
940
954
  type: "success"
941
955
  });
942
- } catch (o) {
943
- l.open({
956
+ } catch (s) {
957
+ a.open({
944
958
  title: `Unable to duplicate "${e.name}"`,
945
- message: `See error from server: ${o}`,
959
+ message: `See error from server: ${s}`,
946
960
  type: "error"
947
- }), console.error("error on duplicating closing template", o);
961
+ }), console.error("error on duplicating closing template", s);
948
962
  } finally {
949
- k.value = !1, M();
963
+ T.value = !1, M();
950
964
  }
951
965
  });
952
966
  }
@@ -955,45 +969,45 @@ const St = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
955
969
  h.value = {
956
970
  template: e,
957
971
  show: !0,
958
- "onUpdate:show"(k) {
959
- h.value.show = k;
972
+ "onUpdate:show"(T) {
973
+ h.value.show = T;
960
974
  },
961
975
  "onAction:edit"() {
962
- h.value.show = !1, a(Ne(e));
976
+ h.value.show = !1, l(Ne(e));
963
977
  }
964
978
  };
965
979
  }
966
980
  function y() {
967
981
  if (!n.templates.length) {
968
- l.open({
982
+ a.open({
969
983
  title: "No data to export",
970
984
  type: "error"
971
985
  });
972
986
  return;
973
987
  }
974
988
  const e = bt(n.templates);
975
- l.open({
989
+ a.open({
976
990
  title: m("inventory.ingredient.export.success"),
977
991
  message: m("inventory.ingredient.export.filename", [e]),
978
992
  type: "success"
979
993
  });
980
994
  }
981
- function s(e) {
995
+ function o(e) {
982
996
  if (!e.items.length) {
983
- l.open({
997
+ a.open({
984
998
  title: "No items in template to export",
985
999
  type: "error"
986
1000
  });
987
1001
  return;
988
1002
  }
989
- const k = _t(e);
990
- l.open({
1003
+ const T = _t(e);
1004
+ a.open({
991
1005
  title: m("inventory.ingredient.export.success"),
992
- message: m("inventory.ingredient.export.filename", [k]),
1006
+ message: m("inventory.ingredient.export.filename", [T]),
993
1007
  type: "success"
994
1008
  });
995
1009
  }
996
- function v() {
1010
+ function f() {
997
1011
  n.loading || r.open({
998
1012
  title: m("inventory.ingredient.import.title"),
999
1013
  contentComponent: jt,
@@ -1014,35 +1028,35 @@ const St = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
1014
1028
  }
1015
1029
  }).onPrimary((e) => {
1016
1030
  if (!e) {
1017
- l.open({
1031
+ a.open({
1018
1032
  title: m("inventory.ingredient.import.error.noData"),
1019
1033
  type: "error"
1020
1034
  });
1021
1035
  return;
1022
1036
  }
1023
1037
  if (!e.importCreateResult.length && !e.importUpdateResult.length) {
1024
- l.open({
1038
+ a.open({
1025
1039
  title: m("inventory.ingredient.import.error.invalidContent"),
1026
1040
  message: m("inventory.ingredient.import.error.noImportData"),
1027
1041
  type: "error"
1028
1042
  });
1029
1043
  return;
1030
1044
  }
1031
- if (e.importCreateResult.some((k) => k.errors.length) || e.importUpdateResult.some((k) => k.errors.length)) {
1032
- l.open({
1045
+ if (e.importCreateResult.some((T) => T.errors.length) || e.importUpdateResult.some((T) => T.errors.length)) {
1046
+ a.open({
1033
1047
  title: m("inventory.ingredient.import.error.invalidContent"),
1034
1048
  message: m("inventory.ingredient.import.error.hasErrors"),
1035
1049
  type: "error"
1036
1050
  });
1037
1051
  return;
1038
1052
  }
1039
- r.close(), T(e);
1053
+ r.close(), k(e);
1040
1054
  }).onTertiary(xt);
1041
1055
  }
1042
- async function T(e) {
1043
- f.value = !0;
1056
+ async function k(e) {
1057
+ p.value = !0;
1044
1058
  try {
1045
- const k = [
1059
+ const T = [
1046
1060
  ...e.importCreateResult.map(
1047
1061
  (x) => x.template
1048
1062
  ),
@@ -1050,40 +1064,40 @@ const St = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
1050
1064
  (x) => x.template
1051
1065
  )
1052
1066
  ], M = 100;
1053
- let p = 0;
1054
- const o = () => {
1055
- p += M, l.open({
1067
+ let v = 0;
1068
+ const s = () => {
1069
+ v += M, a.open({
1056
1070
  title: m("inventory.ingredient.import.progress", [
1057
- Math.min(p, k.length),
1058
- k.length
1071
+ Math.min(v, T.length),
1072
+ T.length
1059
1073
  ])
1060
1074
  });
1061
1075
  };
1062
- for (const x of k.chunk(100))
1063
- o(), await d.importTemplates(x);
1064
- l.open({
1076
+ for (const x of T.chunk(100))
1077
+ s(), await u.importTemplates(x);
1078
+ a.open({
1065
1079
  title: m("inventory.ingredient.import.success"),
1066
1080
  type: "success"
1067
1081
  });
1068
- } catch (k) {
1069
- l.open({
1082
+ } catch (T) {
1083
+ a.open({
1070
1084
  title: m("inventory.ingredient.import.error.failed"),
1071
- message: m("inventory.ingredient.import.error.systemMessage", [k == null ? void 0 : k.message]),
1085
+ message: m("inventory.ingredient.import.error.systemMessage", [T == null ? void 0 : T.message]),
1072
1086
  type: "error"
1073
- }), console.error("Error in importing skus", e, k);
1087
+ }), console.error("Error in importing skus", e, T);
1074
1088
  } finally {
1075
- f.value = !1, n.fetchTemplates();
1089
+ p.value = !1, n.fetchTemplates();
1076
1090
  }
1077
1091
  }
1078
1092
  return {
1079
1093
  createTemplate: c,
1080
1094
  viewTemplate: w,
1081
- updateTemplate: a,
1095
+ updateTemplate: l,
1082
1096
  deleteTemplate: g,
1083
1097
  duplicateTemplate: i,
1084
1098
  exportTemplates: y,
1085
- exportSingleTemplate: s,
1086
- importTemplates: v,
1099
+ exportSingleTemplate: o,
1100
+ importTemplates: f,
1087
1101
  templateDialogProps: b,
1088
1102
  templateDetailsProps: h
1089
1103
  };
@@ -1092,7 +1106,7 @@ var Q = /* @__PURE__ */ ((m) => (m.Name = "Name", m.Unit = "Unit", m.Delete = "D
1092
1106
  function Yt(m) {
1093
1107
  return {
1094
1108
  columnDefs: L(() => {
1095
- const l = m.items.map((t) => t.sku.unit.measurements.length).reduce((t, n) => Math.max(t, n), 0);
1109
+ const a = m.items.map((t) => t.sku.unit.measurements.length).reduce((t, n) => Math.max(t, n), 0);
1096
1110
  return [
1097
1111
  {
1098
1112
  id: "Name",
@@ -1131,14 +1145,14 @@ function Yt(m) {
1131
1145
  minSize: 200,
1132
1146
  maxSize: 400,
1133
1147
  cell(t) {
1134
- var f, b, c;
1148
+ var p, b, c;
1135
1149
  const n = t.row.original;
1136
1150
  return P("div", { class: "flex items-center gap-32" }, [
1137
1151
  P(
1138
1152
  Y.FmFormGroup,
1139
1153
  {
1140
1154
  value: n.sku.unit._id,
1141
- modelValue: !((f = n.disabledMeasurements) != null && f.includes(n.sku.unit._id))
1155
+ modelValue: !((p = n.disabledMeasurements) != null && p.includes(n.sku.unit._id))
1142
1156
  },
1143
1157
  P(
1144
1158
  "div",
@@ -1151,14 +1165,14 @@ function Yt(m) {
1151
1165
  value: n.sku.unit._id,
1152
1166
  modelValue: !((b = n.disabledMeasurements) != null && b.includes(n.sku.unit._id)),
1153
1167
  disabled: m.disabled || !((c = n.disabledMeasurements) != null && c.includes(n.sku.unit._id)) && n.sku.unit.measurements.every(
1154
- (a) => {
1168
+ (l) => {
1155
1169
  var g;
1156
- return (g = n.disabledMeasurements) == null ? void 0 : g.includes(a.id);
1170
+ return (g = n.disabledMeasurements) == null ? void 0 : g.includes(l.id);
1157
1171
  }
1158
1172
  ),
1159
- "onUpdate:modelValue"(a) {
1173
+ "onUpdate:modelValue"(l) {
1160
1174
  var g;
1161
- if (a)
1175
+ if (l)
1162
1176
  m.updateItem({
1163
1177
  ...n,
1164
1178
  disabledMeasurements: (g = n.disabledMeasurements) == null ? void 0 : g.filter(
@@ -1193,8 +1207,8 @@ function Yt(m) {
1193
1207
  ]
1194
1208
  )
1195
1209
  ),
1196
- ...Array.from({ length: Math.max(l, 0) }).map((a, g) => {
1197
- var w, y, s, v;
1210
+ ...Array.from({ length: Math.max(a, 0) }).map((l, g) => {
1211
+ var w, y, o, f;
1198
1212
  const i = t.row.original, h = i.sku.unit.measurements[g];
1199
1213
  return h ? P(
1200
1214
  Y.FmFormGroup,
@@ -1212,24 +1226,24 @@ function Yt(m) {
1212
1226
  P(Y.FmCheckbox, {
1213
1227
  value: h.id,
1214
1228
  modelValue: !((y = i.disabledMeasurements) != null && y.includes(h.id)),
1215
- disabled: m.disabled || !((s = i.disabledMeasurements) != null && s.includes(h.id)) && ((v = i.disabledMeasurements) == null ? void 0 : v.includes(i.sku.unit._id)) && i.sku.unit.measurements.filter((T) => T.id != h.id).every((T) => {
1229
+ disabled: m.disabled || !((o = i.disabledMeasurements) != null && o.includes(h.id)) && ((f = i.disabledMeasurements) == null ? void 0 : f.includes(i.sku.unit._id)) && i.sku.unit.measurements.filter((k) => k.id != h.id).every((k) => {
1216
1230
  var e;
1217
- return (e = i.disabledMeasurements) == null ? void 0 : e.includes(T.id);
1231
+ return (e = i.disabledMeasurements) == null ? void 0 : e.includes(k.id);
1218
1232
  }),
1219
- "onUpdate:modelValue"(T) {
1233
+ "onUpdate:modelValue"(k) {
1220
1234
  var e;
1221
- if (T)
1235
+ if (k)
1222
1236
  m.updateItem({
1223
1237
  ...i,
1224
1238
  disabledMeasurements: (e = i.disabledMeasurements) == null ? void 0 : e.filter(
1225
- (k) => k !== h.id
1239
+ (T) => T !== h.id
1226
1240
  )
1227
1241
  });
1228
1242
  else {
1229
- const k = i.disabledMeasurements ?? [];
1243
+ const T = i.disabledMeasurements ?? [];
1230
1244
  m.updateItem({
1231
1245
  ...i,
1232
- disabledMeasurements: [...k, h.id]
1246
+ disabledMeasurements: [...T, h.id]
1233
1247
  });
1234
1248
  }
1235
1249
  }
@@ -1297,32 +1311,32 @@ const Gt = { class: "flex flex-col gap-16 py-12" }, Kt = { class: "flex" }, Wt =
1297
1311
  row: {}
1298
1312
  },
1299
1313
  setup(m) {
1300
- const r = m, l = L(() => r.row), d = L(
1301
- () => l.value.getVisibleCells().filter((t) => t.column.id !== Q.Name && t.column.id !== Q.Delete)
1314
+ const r = m, a = L(() => r.row), u = L(
1315
+ () => a.value.getVisibleCells().filter((t) => t.column.id !== Q.Name && t.column.id !== Q.Delete)
1302
1316
  );
1303
1317
  return (t, n) => {
1304
- var f, b, c, a, g;
1318
+ var p, b, c, l, g;
1305
1319
  return $(), D("div", Gt, [
1306
1320
  _("div", Kt, [
1307
1321
  _("div", Wt, [
1308
- _("div", qt, I(l.value.original.sku.name), 1),
1309
- _("div", Jt, I(l.value.original.sku.code), 1)
1322
+ _("div", qt, I(a.value.original.sku.name), 1),
1323
+ _("div", Jt, I(a.value.original.sku.code), 1)
1310
1324
  ]),
1311
1325
  _("div", null, [
1312
- C(u(X), {
1313
- render: (c = (b = (f = t.cellByColId[u(Q).Delete]) == null ? void 0 : f.column) == null ? void 0 : b.columnDef) == null ? void 0 : c.cell,
1314
- props: (g = (a = t.cellByColId[u(Q).Delete]) == null ? void 0 : a.getContext) == null ? void 0 : g.call(a)
1326
+ C(d(X), {
1327
+ render: (c = (b = (p = t.cellByColId[d(Q).Delete]) == null ? void 0 : p.column) == null ? void 0 : b.columnDef) == null ? void 0 : c.cell,
1328
+ props: (g = (l = t.cellByColId[d(Q).Delete]) == null ? void 0 : l.getContext) == null ? void 0 : g.call(l)
1315
1329
  }, null, 8, ["render", "props"])
1316
1330
  ])
1317
1331
  ]),
1318
1332
  _("div", Xt, [
1319
1333
  n[0] || (n[0] = _("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, null, -1)),
1320
- ($(!0), D(j, null, Z(d.value, (i) => {
1334
+ ($(!0), D(j, null, Z(u.value, (i) => {
1321
1335
  var h, w, y;
1322
1336
  return $(), D("div", {
1323
1337
  key: i.id
1324
1338
  }, [
1325
- C(u(X), {
1339
+ C(d(X), {
1326
1340
  render: (w = (h = i.column) == null ? void 0 : h.columnDef) == null ? void 0 : w.cell,
1327
1341
  props: (y = i.getContext) == null ? void 0 : y.call(i)
1328
1342
  }, null, 8, ["render", "props"])
@@ -1339,86 +1353,86 @@ const Gt = { class: "flex flex-col gap-16 py-12" }, Kt = { class: "flex" }, Wt =
1339
1353
  disabled: { type: Boolean }
1340
1354
  },
1341
1355
  setup(m, { expose: r }) {
1342
- const l = m, d = vt(), { t } = W(), n = ve(), {
1343
- promptSelectLocations: f,
1356
+ const a = m, u = vt(), { t } = W(), n = ve(), {
1357
+ promptSelectLocations: p,
1344
1358
  columnDefs: b,
1345
1359
  rowData: c
1346
1360
  } = gt({
1347
1361
  getLocations() {
1348
- return d.locations;
1362
+ return u.locations;
1349
1363
  },
1350
- setLocations(p) {
1351
- d.locations = p;
1364
+ setLocations(v) {
1365
+ u.locations = v;
1352
1366
  }
1353
- }), a = R(), g = R(""), i = R(null), h = R(!1), w = [
1367
+ }), l = R(), g = R(""), i = R(null), h = R(!1), w = [
1354
1368
  {
1355
1369
  key: "name",
1356
1370
  label: "Name",
1357
- getter: (p) => {
1358
- var o;
1359
- return (o = p.sku) == null ? void 0 : o.name;
1371
+ getter: (v) => {
1372
+ var s;
1373
+ return (s = v.sku) == null ? void 0 : s.name;
1360
1374
  }
1361
1375
  },
1362
1376
  {
1363
1377
  key: "code",
1364
1378
  label: "Code",
1365
- getter: (p) => {
1366
- var o;
1367
- return (o = p.sku) == null ? void 0 : o.code;
1379
+ getter: (v) => {
1380
+ var s;
1381
+ return (s = v.sku) == null ? void 0 : s.code;
1368
1382
  }
1369
1383
  }
1370
- ], y = R([]), s = L(() => d.items.map((p, o) => ({ item: p, originalIndex: o })).sort((p, o) => {
1371
- const x = p.item.position ?? p.originalIndex, F = o.item.position ?? o.originalIndex;
1384
+ ], y = R([]), o = L(() => u.items.map((v, s) => ({ item: v, originalIndex: s })).sort((v, s) => {
1385
+ const x = v.item.position ?? v.originalIndex, F = s.item.position ?? s.originalIndex;
1372
1386
  return x - F;
1373
- }).map(({ item: p }) => p));
1374
- function v() {
1375
- h.value ? d.items = y.value.map(({ id: p, label: o, ...x }, F) => ({
1387
+ }).map(({ item: v }) => v));
1388
+ function f() {
1389
+ h.value ? u.items = y.value.map(({ id: v, label: s, ...x }, F) => ({
1376
1390
  ...x,
1377
1391
  position: F
1378
- })) : y.value = s.value.map((p) => ({
1379
- ...p,
1380
- id: p.sku._id,
1381
- label: `${p.sku.code} ${p.sku.name}`
1392
+ })) : y.value = o.value.map((v) => ({
1393
+ ...v,
1394
+ id: v.sku._id,
1395
+ label: `${v.sku.code} ${v.sku.name}`
1382
1396
  })), h.value = !h.value;
1383
1397
  }
1384
1398
  r({
1385
1399
  validateInputs: () => {
1386
- var p, o;
1387
- (o = (p = a.value) == null ? void 0 : p.validateInputs) == null || o.call(p);
1400
+ var v, s;
1401
+ (s = (v = l.value) == null ? void 0 : v.validateInputs) == null || s.call(v);
1388
1402
  },
1389
1403
  resetInputsValidation: () => {
1390
- var p, o;
1391
- (o = (p = a.value) == null ? void 0 : p.resetInputsValidation) == null || o.call(p);
1404
+ var v, s;
1405
+ (s = (v = l.value) == null ? void 0 : v.resetInputsValidation) == null || s.call(v);
1392
1406
  },
1393
1407
  resetInputs: () => {
1394
- var p, o;
1395
- (o = (p = a.value) == null ? void 0 : p.resetInputs) == null || o.call(p);
1408
+ var v, s;
1409
+ (s = (v = l.value) == null ? void 0 : v.resetInputs) == null || s.call(v);
1396
1410
  }
1397
1411
  });
1398
- const T = Yt({
1399
- updateItem: (p) => {
1400
- d.items = d.items.map((o) => o.sku._id !== p.sku._id ? o : p);
1412
+ const k = Yt({
1413
+ updateItem: (v) => {
1414
+ u.items = u.items.map((s) => s.sku._id !== v.sku._id ? s : v);
1401
1415
  },
1402
- deleteItem: (p) => {
1403
- d.items = d.items.filter((o) => o.sku._id !== p.sku._id);
1416
+ deleteItem: (v) => {
1417
+ u.items = u.items.filter((s) => s.sku._id !== v.sku._id);
1404
1418
  },
1405
1419
  get items() {
1406
- return s.value;
1420
+ return o.value;
1407
1421
  },
1408
1422
  get disabled() {
1409
- return l.disabled;
1423
+ return a.disabled;
1410
1424
  }
1411
- }), e = L(() => T.columnDefs.value), { promptSelectIngredients: k } = ft();
1425
+ }), e = L(() => k.columnDefs.value), { promptSelectIngredients: T } = ft();
1412
1426
  async function M() {
1413
- const o = n.skus.map((S) => ({
1427
+ const s = n.skus.map((S) => ({
1414
1428
  label: S.name,
1415
1429
  sublabel: S.code,
1416
1430
  value: S
1417
1431
  })).filter((S) => {
1418
1432
  var U;
1419
- return (U = d.items) == null ? void 0 : U.find((H) => H.sku._id === S.value._id);
1420
- }).map((S) => S.value), x = d.items ?? [], F = await k(
1421
- o.map((S) => S._id),
1433
+ return (U = u.items) == null ? void 0 : U.find((H) => H.sku._id === S.value._id);
1434
+ }).map((S) => S.value), x = u.items ?? [], F = await T(
1435
+ s.map((S) => S._id),
1422
1436
  (S) => {
1423
1437
  const U = n.skuById[S], H = x.find((A) => A.sku._id === U._id);
1424
1438
  return H || {
@@ -1426,101 +1440,101 @@ const Gt = { class: "flex flex-col gap-16 py-12" }, Kt = { class: "flex" }, Wt =
1426
1440
  };
1427
1441
  }
1428
1442
  );
1429
- F && (F.sort((S, U) => S.sku.code.localeCompare(U.sku.code)), d.items = F);
1443
+ F && (F.sort((S, U) => S.sku.code.localeCompare(U.sku.code)), u.items = F);
1430
1444
  }
1431
- return (p, o) => {
1445
+ return (v, s) => {
1432
1446
  const x = E("FmTextField"), F = E("FmButton"), S = E("FmTable"), U = E("FmIcon"), H = E("FmFormGroup"), B = E("FmForm");
1433
1447
  return $(), N(B, {
1434
1448
  ref_key: "formRef",
1435
- ref: a,
1449
+ ref: l,
1436
1450
  class: "flex flex-col gap-32",
1437
- disabled: p.disabled
1451
+ disabled: v.disabled
1438
1452
  }, {
1439
1453
  default: V(() => [
1440
1454
  _("div", Zt, [
1441
1455
  _("div", en, [
1442
1456
  C(x, {
1443
- label: u(t)("inventory.closing.form.name"),
1457
+ label: d(t)("inventory.closing.form.name"),
1444
1458
  "label-mark": "required",
1445
- modelValue: u(d).name,
1446
- "onUpdate:modelValue": o[0] || (o[0] = (A) => u(d).name = A),
1447
- rules: [u(dt)()]
1459
+ modelValue: d(u).name,
1460
+ "onUpdate:modelValue": s[0] || (s[0] = (A) => d(u).name = A),
1461
+ rules: [d(dt)()]
1448
1462
  }, null, 8, ["label", "modelValue", "rules"]),
1449
1463
  C(x, {
1450
- label: u(t)("inventory.closing.form.reference"),
1464
+ label: d(t)("inventory.closing.form.reference"),
1451
1465
  "label-mark": "optional",
1452
- modelValue: u(d).ref,
1453
- "onUpdate:modelValue": o[1] || (o[1] = (A) => u(d).ref = A)
1466
+ modelValue: d(u).ref,
1467
+ "onUpdate:modelValue": s[1] || (s[1] = (A) => d(u).ref = A)
1454
1468
  }, null, 8, ["label", "modelValue"])
1455
1469
  ])
1456
1470
  ]),
1457
1471
  _("div", tn, [
1458
1472
  _("div", nn, [
1459
- _("div", on, I(u(t)("inventory.closing.form.locations")), 1),
1473
+ _("div", on, I(d(t)("inventory.closing.form.locations")), 1),
1460
1474
  C(F, {
1461
- disabled: p.disabled,
1462
- label: u(t)("inventory.closing.form.selectLocation"),
1475
+ disabled: v.disabled,
1476
+ label: d(t)("inventory.closing.form.selectLocation"),
1463
1477
  "prepend-icon": "add",
1464
1478
  variant: "plain",
1465
1479
  class: "border-2 rounded-lg border-fm-color-primary",
1466
- onClick: u(f)
1480
+ onClick: d(p)
1467
1481
  }, null, 8, ["disabled", "label", "onClick"])
1468
1482
  ]),
1469
1483
  C(S, {
1470
- "column-defs": u(b),
1471
- "row-data": u(c),
1484
+ "column-defs": d(b),
1485
+ "row-data": d(c),
1472
1486
  "shrink-at": 9999,
1473
- onRowClick: u(f),
1487
+ onRowClick: d(p),
1474
1488
  "hide-footer": ""
1475
1489
  }, null, 8, ["column-defs", "row-data", "onRowClick"])
1476
1490
  ]),
1477
1491
  _("div", sn, [
1478
1492
  _("div", ln, [
1479
- _("div", an, I(u(t)("inventory.closing.form.items.title")), 1),
1493
+ _("div", an, I(d(t)("inventory.closing.form.items.title")), 1),
1480
1494
  _("div", rn, [
1481
- u(d).items.length > 0 ? ($(), N(F, {
1495
+ d(u).items.length > 0 ? ($(), N(F, {
1482
1496
  key: 0,
1483
- disabled: p.disabled,
1484
- label: h.value ? u(t)("inventory.common.done") : u(t)("inventory.common.rearrange"),
1497
+ disabled: v.disabled,
1498
+ label: h.value ? d(t)("inventory.common.done") : d(t)("inventory.common.rearrange"),
1485
1499
  "prepend-icon": h.value ? "check" : "swap_vert",
1486
1500
  variant: h.value ? "primary" : "secondary",
1487
1501
  class: q(["border-2 rounded-lg", h.value ? "" : "border-fm-color-secondary"]),
1488
- onClick: v,
1502
+ onClick: f,
1489
1503
  size: "md"
1490
1504
  }, null, 8, ["disabled", "label", "prepend-icon", "variant", "class"])) : O("", !0),
1491
1505
  h.value ? O("", !0) : ($(), N(F, {
1492
1506
  key: 1,
1493
- disabled: p.disabled,
1494
- label: u(t)("inventory.closing.form.items.addItem"),
1507
+ disabled: v.disabled,
1508
+ label: d(t)("inventory.closing.form.items.addItem"),
1495
1509
  "prepend-icon": "add",
1496
1510
  variant: "plain",
1497
1511
  class: "border-2 rounded-lg border-fm-color-primary",
1498
- onClick: o[2] || (o[2] = (A) => M()),
1512
+ onClick: s[2] || (s[2] = (A) => M()),
1499
1513
  size: "md"
1500
1514
  }, null, 8, ["disabled", "label"]))
1501
1515
  ])
1502
1516
  ]),
1503
1517
  h.value ? ($(), D("div", cn, [
1504
- C(u(et), {
1518
+ C(d(et), {
1505
1519
  modelValue: y.value,
1506
- "onUpdate:modelValue": o[3] || (o[3] = (A) => y.value = A),
1520
+ "onUpdate:modelValue": s[3] || (s[3] = (A) => y.value = A),
1507
1521
  "sort-fields": w,
1508
- "left-column-label": u(t)("inventory.closing.form.items.availableItems"),
1509
- "right-column-label": u(t)("inventory.closing.form.items.organizedGroups"),
1522
+ "left-column-label": d(t)("inventory.closing.form.items.availableItems"),
1523
+ "right-column-label": d(t)("inventory.closing.form.items.organizedGroups"),
1510
1524
  height: "600px"
1511
1525
  }, null, 8, ["modelValue", "left-column-label", "right-column-label"])
1512
1526
  ])) : ($(), D(j, { key: 1 }, [
1513
1527
  C(x, {
1514
- placeholder: u(t)("inventory.formField.filterItems"),
1528
+ placeholder: d(t)("inventory.formField.filterItems"),
1515
1529
  modelValue: g.value,
1516
- "onUpdate:modelValue": o[5] || (o[5] = (A) => g.value = A)
1530
+ "onUpdate:modelValue": s[5] || (s[5] = (A) => g.value = A)
1517
1531
  }, Ee({ _: 2 }, [
1518
1532
  g.value ? {
1519
1533
  name: "append",
1520
1534
  fn: V(() => [
1521
1535
  C(U, {
1522
1536
  name: "close",
1523
- onClick: o[4] || (o[4] = (A) => g.value = ""),
1537
+ onClick: s[4] || (s[4] = (A) => g.value = ""),
1524
1538
  class: "cursor-pointer"
1525
1539
  })
1526
1540
  ]),
@@ -1534,15 +1548,15 @@ const Gt = { class: "flex flex-col gap-16 py-12" }, Kt = { class: "flex" }, Wt =
1534
1548
  ($(), N(S, {
1535
1549
  "search-value": g.value,
1536
1550
  "column-defs": e.value,
1537
- "row-data": s.value,
1538
- key: s.value.map((A) => A.sku._id).join("."),
1539
- "hide-footer": s.value.length <= 10,
1540
- "page-size": Math.min(10, s.value.length)
1551
+ "row-data": o.value,
1552
+ key: o.value.map((A) => A.sku._id).join("."),
1553
+ "hide-footer": o.value.length <= 10,
1554
+ "page-size": Math.min(10, o.value.length)
1541
1555
  }, {
1542
1556
  "list-row": V((A) => [
1543
1557
  ($(), N(ze, {
1544
1558
  row: A,
1545
- key: s.value.map((J) => J.sku._id).join(".")
1559
+ key: o.value.map((J) => J.sku._id).join(".")
1546
1560
  }, {
1547
1561
  default: V((J) => [
1548
1562
  C(Qt, {
@@ -1558,8 +1572,8 @@ const Gt = { class: "flex flex-col gap-16 py-12" }, Kt = { class: "flex" }, Wt =
1558
1572
  ], 512)
1559
1573
  ], 64)),
1560
1574
  C(H, {
1561
- "model-value": u(d).items.length,
1562
- rules: [u(pt)(1)]
1575
+ "model-value": d(u).items.length,
1576
+ rules: [d(pt)(1)]
1563
1577
  }, null, 8, ["model-value", "rules"])
1564
1578
  ])
1565
1579
  ]),
@@ -1575,9 +1589,9 @@ const Gt = { class: "flex flex-col gap-16 py-12" }, Kt = { class: "flex" }, Wt =
1575
1589
  show: { type: Boolean }
1576
1590
  },
1577
1591
  emits: ["update:show", "submitted"],
1578
- setup(m, { expose: r, emit: l }) {
1579
- var p;
1580
- const d = m, t = l, n = me(), f = ie(), b = ce(), { t: c } = W(), a = tt(d, "show");
1592
+ setup(m, { expose: r, emit: a }) {
1593
+ var v;
1594
+ const u = m, t = a, n = me(), p = ie(), b = ce(), { t: c } = W(), l = tt(u, "show");
1581
1595
  function g() {
1582
1596
  return {
1583
1597
  _id: "",
@@ -1585,16 +1599,16 @@ const Gt = { class: "flex flex-col gap-16 py-12" }, Kt = { class: "flex" }, Wt =
1585
1599
  items: []
1586
1600
  };
1587
1601
  }
1588
- const i = R(d.modelValue ?? g()), h = R(((p = d.modelValue) == null ? void 0 : p._id) ?? `${Math.random()}`);
1602
+ const i = R(u.modelValue ?? g()), h = R(((v = u.modelValue) == null ? void 0 : v._id) ?? `${Math.random()}`);
1589
1603
  Pe(
1590
- () => d.show,
1591
- (o) => {
1604
+ () => u.show,
1605
+ (s) => {
1592
1606
  var x;
1593
- o && (i.value = d.modelValue ?? g(), h.value = ((x = d.modelValue) == null ? void 0 : x._id) ?? `${Math.random()}`);
1607
+ s && (i.value = u.modelValue ?? g(), h.value = ((x = u.modelValue) == null ? void 0 : x._id) ?? `${Math.random()}`);
1594
1608
  }
1595
1609
  );
1596
1610
  const w = R(!1), y = L(() => {
1597
- switch (d.mode) {
1611
+ switch (u.mode) {
1598
1612
  case G.READ:
1599
1613
  return "";
1600
1614
  case G.CREATE:
@@ -1603,27 +1617,27 @@ const Gt = { class: "flex flex-col gap-16 py-12" }, Kt = { class: "flex" }, Wt =
1603
1617
  return c("inventory.closing.template.update.title");
1604
1618
  }
1605
1619
  return "";
1606
- }), s = R();
1620
+ }), o = R();
1607
1621
  r({
1608
1622
  validateInputs: () => {
1609
- var o, x;
1610
- (x = (o = s.value) == null ? void 0 : o.validateInputs) == null || x.call(o);
1623
+ var s, x;
1624
+ (x = (s = o.value) == null ? void 0 : s.validateInputs) == null || x.call(s);
1611
1625
  },
1612
1626
  resetInputsValidation: () => {
1613
- var o, x;
1614
- (x = (o = s.value) == null ? void 0 : o.resetInputsValidation) == null || x.call(o);
1627
+ var s, x;
1628
+ (x = (s = o.value) == null ? void 0 : s.resetInputsValidation) == null || x.call(s);
1615
1629
  },
1616
1630
  resetInputs: () => {
1617
- var o, x;
1618
- (x = (o = s.value) == null ? void 0 : o.resetInputs) == null || x.call(o);
1631
+ var s, x;
1632
+ (x = (s = o.value) == null ? void 0 : s.resetInputs) == null || x.call(s);
1619
1633
  }
1620
1634
  });
1621
- async function v() {
1622
- const o = i.value;
1623
- if (o) {
1635
+ async function f() {
1636
+ const s = i.value;
1637
+ if (s) {
1624
1638
  w.value = !0;
1625
1639
  try {
1626
- await n.createTemplate(o), await new Promise((x) => setTimeout(x, 1e3)), b.open({
1640
+ await n.createTemplate(s), await new Promise((x) => setTimeout(x, 1e3)), b.open({
1627
1641
  title: c("inventory.closing.template.create.success"),
1628
1642
  message: c("inventory.closing.template.create.successMessage"),
1629
1643
  type: "success"
@@ -1639,14 +1653,14 @@ const Gt = { class: "flex flex-col gap-16 py-12" }, Kt = { class: "flex" }, Wt =
1639
1653
  }
1640
1654
  }
1641
1655
  }
1642
- async function T() {
1643
- const o = i.value;
1644
- if (o) {
1645
- w.value = !0, delete o.updatedAt;
1656
+ async function k() {
1657
+ const s = i.value;
1658
+ if (s) {
1659
+ w.value = !0, delete s.updatedAt;
1646
1660
  try {
1647
1661
  await n.updateTemplate({
1648
- ...o,
1649
- _rev: o._rev ?? ""
1662
+ ...s,
1663
+ _rev: s._rev ?? ""
1650
1664
  }), await new Promise((x) => setTimeout(x, 1e3)), b.open({
1651
1665
  title: c("inventory.closing.template.update.success"),
1652
1666
  message: c("inventory.closing.template.update.successMessage"),
@@ -1664,25 +1678,25 @@ const Gt = { class: "flex flex-col gap-16 py-12" }, Kt = { class: "flex" }, Wt =
1664
1678
  }
1665
1679
  }
1666
1680
  function e() {
1667
- switch (d.mode) {
1681
+ switch (u.mode) {
1668
1682
  case G.CREATE:
1669
- return v();
1683
+ return f();
1670
1684
  case G.UPDATE:
1671
- return T();
1685
+ return k();
1672
1686
  }
1673
1687
  }
1674
- function k() {
1675
- var o, x;
1676
- (x = (o = s.value) == null ? void 0 : o.validateInputs) == null || x.call(o);
1688
+ function T() {
1689
+ var s, x;
1690
+ (x = (s = o.value) == null ? void 0 : s.validateInputs) == null || x.call(s);
1677
1691
  }
1678
1692
  function M() {
1679
- i.value && f.exportSingleTemplate(i.value);
1693
+ i.value && p.exportSingleTemplate(i.value);
1680
1694
  }
1681
- return (o, x) => {
1695
+ return (s, x) => {
1682
1696
  const F = E("FmMenuDivider"), S = E("FmCard"), U = E("FmButton"), H = E("FmSideSheet");
1683
1697
  return $(), N(H, {
1684
- modelValue: u(a),
1685
- "onUpdate:modelValue": x[2] || (x[2] = (B) => Ye(a) ? a.value = B : null),
1698
+ modelValue: d(l),
1699
+ "onUpdate:modelValue": x[2] || (x[2] = (B) => Ye(l) ? l.value = B : null),
1686
1700
  "dismiss-away": "",
1687
1701
  "close-button": "",
1688
1702
  "max-width": 9999
@@ -1702,15 +1716,15 @@ const Gt = { class: "flex flex-col gap-16 py-12" }, Kt = { class: "flex" }, Wt =
1702
1716
  var B;
1703
1717
  return [
1704
1718
  _("div", pn, [
1705
- _("div", fn, I(u(c)("inventory.transfer.template.details.templateSummary")), 1)
1719
+ _("div", fn, I(d(c)("inventory.transfer.template.details.templateSummary")), 1)
1706
1720
  ]),
1707
1721
  C(F),
1708
1722
  _("div", vn, [
1709
1723
  _("div", gn, [
1710
- _("div", yn, I(u(c)("inventory.transfer.receiveRequest.details.updatedAt")), 1),
1724
+ _("div", yn, I(d(c)("inventory.transfer.receiveRequest.details.updatedAt")), 1),
1711
1725
  _("div", hn, [
1712
1726
  _("div", bn, [
1713
- ae(I(u(le)(i.value.updatedAt)) + " ", 1),
1727
+ ae(I(d(le)(i.value.updatedAt)) + " ", 1),
1714
1728
  (B = i.value.updatedBy) != null && B.name ? ($(), D(j, { key: 0 }, [
1715
1729
  ae(" (" + I(i.value.updatedBy.name) + ") ", 1)
1716
1730
  ], 64)) : O("", !0)
@@ -1728,7 +1742,7 @@ const Gt = { class: "flex flex-col gap-16 py-12" }, Kt = { class: "flex" }, Wt =
1728
1742
  ($(), N(mn, {
1729
1743
  class: "w-full",
1730
1744
  ref_key: "formRef",
1731
- ref: s,
1745
+ ref: o,
1732
1746
  onValidationSuccess: e,
1733
1747
  "model-value": i.value,
1734
1748
  "onUpdate:modelValue": x[0] || (x[0] = (B) => i.value = B),
@@ -1740,21 +1754,21 @@ const Gt = { class: "flex flex-col gap-16 py-12" }, Kt = { class: "flex" }, Wt =
1740
1754
  _("div", _n, [
1741
1755
  C(U, {
1742
1756
  loading: w.value,
1743
- label: u(c)("common.save"),
1744
- onClick: k
1757
+ label: d(c)("common.save"),
1758
+ onClick: T
1745
1759
  }, null, 8, ["loading", "label"]),
1746
- o.mode === u(G).UPDATE ? ($(), N(U, {
1760
+ s.mode === d(G).UPDATE ? ($(), N(U, {
1747
1761
  key: 0,
1748
1762
  disabled: w.value,
1749
1763
  variant: "secondary",
1750
- label: u(c)("inventory.common.export"),
1764
+ label: d(c)("inventory.common.export"),
1751
1765
  "prepend-icon": "download",
1752
1766
  onClick: M
1753
1767
  }, null, 8, ["disabled", "label"])) : O("", !0),
1754
1768
  C(U, {
1755
1769
  disabled: w.value,
1756
1770
  variant: "tertiary",
1757
- label: u(c)("common.close"),
1771
+ label: d(c)("common.close"),
1758
1772
  onClick: x[1] || (x[1] = (B) => t("update:show", !1))
1759
1773
  }, null, 8, ["disabled", "label"])
1760
1774
  ])
@@ -1780,35 +1794,35 @@ const Tn = /* @__PURE__ */ ht(wn, [["render", kn]]), $n = { class: "flex flex-co
1780
1794
  __name: "ClosingTemplatePublish",
1781
1795
  emits: ["close"],
1782
1796
  setup(m, { emit: r }) {
1783
- const l = R(!1), d = ce(), t = me(), n = ue(), { t: f } = W(), b = r;
1797
+ const a = R(!1), u = ce(), t = me(), n = ue(), { t: p } = W(), b = r;
1784
1798
  async function c() {
1785
- l.value = !0;
1799
+ a.value = !0;
1786
1800
  try {
1787
- await t.startNewPublish().delayed(1e3), d.open({
1801
+ await t.startNewPublish().delayed(1e3), u.open({
1788
1802
  title: "Success",
1789
1803
  message: "You may refresh after a while to review publish status",
1790
1804
  type: "success"
1791
1805
  }), i();
1792
1806
  } catch (h) {
1793
- d.open({
1807
+ u.open({
1794
1808
  title: "Something went wrong",
1795
1809
  message: "Please try again",
1796
1810
  type: "error"
1797
1811
  }), console.error("error on creating publish task", h);
1798
1812
  } finally {
1799
- l.value = !1;
1813
+ a.value = !1;
1800
1814
  }
1801
1815
  }
1802
- const a = L(() => n.recentPublish.recentJob), g = L(
1803
- () => n.templates.length && (!a.value || a.value.outlets.length === a.value.completed.length)
1816
+ const l = L(() => n.recentPublish.recentJob), g = L(
1817
+ () => n.templates.length && (!l.value || l.value.outlets.length === l.value.completed.length)
1804
1818
  );
1805
1819
  function i() {
1806
1820
  b("close");
1807
1821
  }
1808
1822
  return (h, w) => {
1809
- const y = E("FmCircularProgress"), s = E("i18n-t"), v = E("FmButton");
1823
+ const y = E("FmCircularProgress"), o = E("i18n-t"), f = E("FmButton");
1810
1824
  return $(), D("div", $n, [
1811
- u(n).templates.length ? l.value ? ($(), D("div", In, [
1825
+ d(n).templates.length ? a.value ? ($(), D("div", In, [
1812
1826
  _("div", null, [
1813
1827
  C(y, {
1814
1828
  size: "md",
@@ -1816,50 +1830,50 @@ const Tn = /* @__PURE__ */ ht(wn, [["render", kn]]), $n = { class: "flex flex-co
1816
1830
  })
1817
1831
  ]),
1818
1832
  _("div", Sn, [
1819
- _("span", null, I(u(f)("inventory.closing.template.publish.publishing")), 1)
1833
+ _("span", null, I(d(p)("inventory.closing.template.publish.publishing")), 1)
1820
1834
  ])
1821
- ])) : a.value ? a.value.outlets.length === a.value.completed.length ? ($(), D("div", Mn, [
1822
- C(s, {
1835
+ ])) : l.value ? l.value.outlets.length === l.value.completed.length ? ($(), D("div", Mn, [
1836
+ C(o, {
1823
1837
  keypath: "inventory.closing.template.publish.recentlyPublishedAt",
1824
1838
  tag: "p"
1825
1839
  }, {
1826
1840
  started: V(() => [
1827
- _("span", Fn, I(u(le)(new Date(a.value.createdAt))), 1)
1841
+ _("span", Fn, I(d(le)(new Date(l.value.createdAt))), 1)
1828
1842
  ]),
1829
1843
  finished: V(() => [
1830
- _("span", Rn, I(u(le)(new Date(a.value.updatedAt))), 1)
1844
+ _("span", Rn, I(d(le)(new Date(l.value.updatedAt))), 1)
1831
1845
  ]),
1832
1846
  _: 1
1833
1847
  }),
1834
- _("p", null, I(u(f)("inventory.closing.template.publish.message")), 1)
1848
+ _("p", null, I(d(p)("inventory.closing.template.publish.message")), 1)
1835
1849
  ])) : ($(), D("div", An, [
1836
- C(s, {
1850
+ C(o, {
1837
1851
  keypath: "inventory.closing.template.publish.stillPublishing",
1838
1852
  tag: "p"
1839
1853
  }, {
1840
1854
  started: V(() => [
1841
- _("span", Pn, I(u(le)(new Date(a.value.createdAt))), 1)
1855
+ _("span", Pn, I(d(le)(new Date(l.value.createdAt))), 1)
1842
1856
  ]),
1843
1857
  progress: V(() => [
1844
- _("span", En, " (" + I(a.value.completed.length) + "/" + I(a.value.outlets.length) + " completed) ", 1)
1858
+ _("span", En, " (" + I(l.value.completed.length) + "/" + I(l.value.outlets.length) + " completed) ", 1)
1845
1859
  ]),
1846
1860
  _: 1
1847
1861
  }),
1848
- ae(" Your recent publishing task is still pending (" + I(a.value.completed.length) + " / " + I(a.value.outlets.length) + "). Please wait until all publishing task has completed. ", 1)
1862
+ ae(" Your recent publishing task is still pending (" + I(l.value.completed.length) + " / " + I(l.value.outlets.length) + "). Please wait until all publishing task has completed. ", 1)
1849
1863
  ])) : ($(), D("div", Dn, [
1850
- _("p", null, I(u(f)("inventory.closing.template.publish.noRecentActivity")), 1),
1851
- _("p", null, I(u(f)("inventory.closing.template.publish.message")), 1)
1864
+ _("p", null, I(d(p)("inventory.closing.template.publish.noRecentActivity")), 1),
1865
+ _("p", null, I(d(p)("inventory.closing.template.publish.message")), 1)
1852
1866
  ])) : ($(), D("div", Cn, [
1853
- _("p", null, I(u(f)("inventory.closing.template.publish.nothingToPublish")), 1)
1867
+ _("p", null, I(d(p)("inventory.closing.template.publish.nothingToPublish")), 1)
1854
1868
  ])),
1855
1869
  _("div", Vn, [
1856
- C(v, {
1870
+ C(f, {
1857
1871
  disabled: !g.value,
1858
- loading: l.value,
1872
+ loading: a.value,
1859
1873
  label: "Publish to all outlets",
1860
1874
  onClick: c
1861
1875
  }, null, 8, ["disabled", "loading"]),
1862
- C(v, {
1876
+ C(f, {
1863
1877
  variant: "tertiary",
1864
1878
  label: "Close",
1865
1879
  onClick: i
@@ -1868,16 +1882,16 @@ const Tn = /* @__PURE__ */ ht(wn, [["render", kn]]), $n = { class: "flex flex-co
1868
1882
  ]);
1869
1883
  };
1870
1884
  }
1871
- }), Nn = { class: "flex-1 flex flex-col gap-8" }, Ln = { class: "flex flex-col" }, Bn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, zn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Hn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, On = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, vo = /* @__PURE__ */ K({
1885
+ }), Nn = { class: "flex-1 flex flex-col gap-8" }, Ln = { class: "flex flex-col" }, Bn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, zn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Hn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, On = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, go = /* @__PURE__ */ K({
1872
1886
  __name: "ClosingTemplateView",
1873
1887
  setup(m) {
1874
- const { t: r } = W(), { createTemplate: l, updateTemplate: d, exportTemplates: t, importTemplates: n } = ie(), { templateDialogProps: f, templateDetailsProps: b } = Ue(ie()), c = fe(), a = pe(), g = ue(), i = Xe(), { breakpoints: h } = nt();
1888
+ const { t: r } = W(), { createTemplate: a, updateTemplate: u, exportTemplates: t, importTemplates: n } = ie(), { templateDialogProps: p, templateDetailsProps: b } = Ue(ie()), c = fe(), l = pe(), g = ue(), i = Xe(), { breakpoints: h } = nt();
1875
1889
  c.watchLocation(g.fetchTemplates);
1876
- const w = L(() => g.loading), y = R(""), s = L(() => h.value.xs || h.value.sm), v = L(() => s.value ? 10 : 20);
1877
- function T(p) {
1878
- switch (p) {
1890
+ const w = L(() => g.loading), y = R(""), o = L(() => h.value.xs || h.value.sm), f = L(() => o.value ? 10 : 20);
1891
+ function k(v) {
1892
+ switch (v) {
1879
1893
  case z.Add:
1880
- return l();
1894
+ return a();
1881
1895
  case "publish":
1882
1896
  return e();
1883
1897
  case "import":
@@ -1889,20 +1903,20 @@ const Tn = /* @__PURE__ */ ht(wn, [["render", kn]]), $n = { class: "flex flex-co
1889
1903
  }
1890
1904
  }
1891
1905
  function e() {
1892
- a.open({
1906
+ l.open({
1893
1907
  title: "Publish closing templates",
1894
1908
  contentComponent: Un,
1895
1909
  contentComponentProps: {
1896
1910
  onClose() {
1897
- a.close();
1911
+ l.close();
1898
1912
  }
1899
1913
  }
1900
1914
  });
1901
1915
  }
1902
- function k(p) {
1903
- return p;
1916
+ function T(v) {
1917
+ return v;
1904
1918
  }
1905
- const M = L(() => s.value ? [
1919
+ const M = L(() => o.value ? [
1906
1920
  {
1907
1921
  label: r("inventory.closing.template.create.title"),
1908
1922
  value: z.Add,
@@ -1957,42 +1971,42 @@ const Tn = /* @__PURE__ */ ht(wn, [["render", kn]]), $n = { class: "flex flex-co
1957
1971
  isPrimary: !1
1958
1972
  }
1959
1973
  ]);
1960
- return (p, o) => {
1974
+ return (v, s) => {
1961
1975
  const x = E("FmTable");
1962
1976
  return $(), D(j, null, [
1963
1977
  C(Qe, {
1964
- title: u(r)("inventory.closing.template.title"),
1978
+ title: d(r)("inventory.closing.template.title"),
1965
1979
  actions: M.value,
1966
- "onClick:action": T
1980
+ "onClick:action": k
1967
1981
  }, {
1968
1982
  default: V(() => [
1969
1983
  _("div", {
1970
1984
  class: q([
1971
1985
  "flex flex-col gap-8 max-h-full",
1972
1986
  {
1973
- "p-0": s.value,
1974
- "px-24 ": !s.value
1987
+ "p-0": o.value,
1988
+ "px-24 ": !o.value
1975
1989
  }
1976
1990
  ])
1977
1991
  }, [
1978
1992
  C(ut, {
1979
1993
  searchable: "",
1980
1994
  search: y.value,
1981
- "onUpdate:search": o[0] || (o[0] = (F) => y.value = F)
1995
+ "onUpdate:search": s[0] || (s[0] = (F) => y.value = F)
1982
1996
  }, null, 8, ["search"]),
1983
1997
  C(x, {
1984
- style: Ge(u(i).tableHeight),
1985
- "column-defs": u(g).columnDefs,
1986
- "row-data": u(g).templates,
1998
+ style: Ge(d(i).tableHeight),
1999
+ "column-defs": d(g).columnDefs,
2000
+ "row-data": d(g).templates,
1987
2001
  "search-value": y.value,
1988
2002
  loading: w.value,
1989
- onRowClick: o[1] || (o[1] = (F) => u(d)(F.original)),
1990
- "page-size": v.value
2003
+ onRowClick: s[1] || (s[1] = (F) => d(u)(F.original)),
2004
+ "page-size": f.value
1991
2005
  }, {
1992
2006
  "list-row": V((F) => [
1993
2007
  C(ze, {
1994
2008
  row: F,
1995
- onRowClick: (S) => u(d)(S)
2009
+ onRowClick: (S) => d(u)(S)
1996
2010
  }, {
1997
2011
  default: V((S) => {
1998
2012
  var U, H, B, A, J, be, _e, xe, ee, we, ke, Te, $e, Ce, Ie, te, Se, De, Me, Fe, ne, Re;
@@ -2000,33 +2014,33 @@ const Tn = /* @__PURE__ */ ht(wn, [["render", kn]]), $n = { class: "flex flex-co
2000
2014
  _("div", Nn, [
2001
2015
  _("div", Ln, [
2002
2016
  _("div", Bn, [
2003
- C(u(X), {
2017
+ C(d(X), {
2004
2018
  render: (B = (H = (U = S._id) == null ? void 0 : U.column) == null ? void 0 : H.columnDef) == null ? void 0 : B.cell,
2005
2019
  props: (J = (A = S._id) == null ? void 0 : A.getContext) == null ? void 0 : J.call(A)
2006
2020
  }, null, 8, ["render", "props"])
2007
2021
  ]),
2008
2022
  _("div", zn, [
2009
- C(u(X), {
2023
+ C(d(X), {
2010
2024
  render: (xe = (_e = (be = S.name) == null ? void 0 : be.column) == null ? void 0 : _e.columnDef) == null ? void 0 : xe.cell,
2011
2025
  props: (we = (ee = S.name) == null ? void 0 : ee.getContext) == null ? void 0 : we.call(ee)
2012
2026
  }, null, 8, ["render", "props"])
2013
2027
  ]),
2014
- _("div", null, I((ke = F.original.locations) != null && ke.length ? u(r)("inventory.closing.table.enabledForN", {
2028
+ _("div", null, I((ke = F.original.locations) != null && ke.length ? d(r)("inventory.closing.table.enabledForN", {
2015
2029
  count: ((Te = F.original.locations) == null ? void 0 : Te.length) ?? 0
2016
- }) : u(r)("inventory.closing.table.enabledForAll")), 1),
2030
+ }) : d(r)("inventory.closing.table.enabledForAll")), 1),
2017
2031
  _("div", Hn, I([
2018
2032
  ...F.original.items.slice(0, 3).map((je) => je.sku.name),
2019
2033
  ...F.original.items.length >= 3 ? [`and ${F.original.items.length - 3} more items`] : []
2020
2034
  ].join(", ")), 1),
2021
2035
  _("div", On, [
2022
- C(u(X), {
2036
+ C(d(X), {
2023
2037
  render: (Ie = (Ce = ($e = S.ref) == null ? void 0 : $e.column) == null ? void 0 : Ce.columnDef) == null ? void 0 : Ie.cell,
2024
2038
  props: (Se = (te = S.ref) == null ? void 0 : te.getContext) == null ? void 0 : Se.call(te)
2025
2039
  }, null, 8, ["render", "props"])
2026
2040
  ])
2027
2041
  ]),
2028
2042
  _("div", null, [
2029
- C(u(X), {
2043
+ C(d(X), {
2030
2044
  render: (Fe = (Me = (De = S.status) == null ? void 0 : De.column) == null ? void 0 : Me.columnDef) == null ? void 0 : Fe.cell,
2031
2045
  props: (Re = (ne = S.status) == null ? void 0 : ne.getContext) == null ? void 0 : Re.call(ne)
2032
2046
  }, null, 8, ["render", "props"])
@@ -2044,9 +2058,9 @@ const Tn = /* @__PURE__ */ ht(wn, [["render", kn]]), $n = { class: "flex flex-co
2044
2058
  _: 1
2045
2059
  }, 8, ["title", "actions"]),
2046
2060
  ($(), N(Ke, { to: "body" }, [
2047
- C(Tn, We(qe(u(b))), null, 16),
2048
- C(xn, Je(u(f), {
2049
- onSubmitted: o[2] || (o[2] = (F) => u(g).fetchTemplates())
2061
+ C(Tn, We(qe(d(b))), null, 16),
2062
+ C(xn, Je(d(p), {
2063
+ onSubmitted: s[2] || (s[2] = (F) => d(g).fetchTemplates())
2050
2064
  }), null, 16)
2051
2065
  ]))
2052
2066
  ], 64);
@@ -2054,5 +2068,5 @@ const Tn = /* @__PURE__ */ ht(wn, [["render", kn]]), $n = { class: "flex flex-co
2054
2068
  }
2055
2069
  });
2056
2070
  export {
2057
- vo as default
2071
+ go as default
2058
2072
  };