@feedmepos/mf-inventory-portal 0.0.24-dev.1 → 0.0.24-dev.3

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 (43) hide show
  1. package/dist/{App-D3sNH2MR.js → App-C8gm6x7Q.js} +1 -1
  2. package/dist/{ApprovalView-DHnRx0hJ.js → ApprovalView-xtUG5yeg.js} +2 -2
  3. package/dist/{BindingsDialog-oTeg2Dai.js → BindingsDialog-II1cNZ8y.js} +2 -2
  4. package/dist/{BindingsPicker-CWdjmMJ3.js → BindingsPicker-7hWtLm42.js} +1 -1
  5. package/dist/{BindingsTable-bKLR1OKX.js → BindingsTable-Bub-L-pM.js} +1 -1
  6. package/dist/{ClosingDraftView-CIQVz7lY.js → ClosingDraftView-C9VKku7E.js} +2 -2
  7. package/dist/{ClosingTemplateView-D5pLzQwU.js → ClosingTemplateView-cmdRLrA3.js} +1 -1
  8. package/dist/{FmCustomAttribute.vue_vue_type_script_setup_true_lang-ClLDcchC.js → FmCustomAttribute.vue_vue_type_script_setup_true_lang-Dk618cmq.js} +1 -1
  9. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BSB7T16f.js +286 -0
  10. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DhpHOaRH.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BcQSDPWo.js} +1 -1
  11. package/dist/{IngredientGroupView-4C437mso.js → IngredientGroupView-YGl-cE0p.js} +1 -1
  12. package/dist/{IngredientsView-DoiGgjre.js → IngredientsView-XxrOFv-u.js} +3 -3
  13. package/dist/{IntegrationView-8ZKE7MAM.js → IntegrationView-Bq-m4-Wh.js} +1 -1
  14. package/dist/{InventoryBindingForm-CcnfliYQ.js → InventoryBindingForm-DFWSf75X.js} +1 -1
  15. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-B_J-6C9x.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-RQ6XxdxU.js} +3 -3
  16. package/dist/{InventoryBindingSummary-CRdHCzNE.js → InventoryBindingSummary-DU6GO2TJ.js} +1 -1
  17. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-B2-TypU0.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-ChpZ0NwL.js} +1 -1
  18. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BuQde75S.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Ba2Uq1H-.js} +1 -1
  19. package/dist/{PublishView-t5gjGmK_.js → PublishView-CBIvo-Qj.js} +2 -2
  20. package/dist/{PurchaseOrderPrintPreview-6i53Y-v1.js → PurchaseOrderPrintPreview-cp_DzuxM.js} +1 -1
  21. package/dist/{ReceiveRequestView-uOeSh0Mr.js → ReceiveRequestView-UIaPylF0.js} +184 -174
  22. package/dist/{RecipeView-BTWywckD.js → RecipeView-voWc35VV.js} +3 -3
  23. package/dist/{StockView-DN2xk8ei.js → StockView-CoigRqM-.js} +7 -7
  24. package/dist/{SupplierView-l0XUg3J4.js → SupplierView-BDpCPZE7.js} +357 -354
  25. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CWMn6fFf.js → TransferDetails.vue_vue_type_script_setup_true_lang-CyovzdZg.js} +3 -3
  26. package/dist/{TransferTemplateView-wDKXpCWZ.js → TransferTemplateView-C2XMghN_.js} +425 -404
  27. package/dist/{UnitView-CUI-k-tS.js → UnitView-BBPJ0vhB.js} +3 -3
  28. package/dist/{WarehouseView-WsI_eG5r.js → WarehouseView-Ck6hBrGf.js} +1 -1
  29. package/dist/{app-DntcWR3_.js → app-ojZQI-KQ.js} +89 -89
  30. package/dist/app.js +1 -1
  31. package/dist/{decimal-DTCTnMwO.js → decimal-xq82Pirk.js} +1 -1
  32. package/dist/{format-unit-display-Hy48Iw5j.js → format-unit-display-ByfsyWBU.js} +438 -437
  33. package/dist/{index-Bv9RYyTZ.js → index-Bi6FnWGy.js} +3 -3
  34. package/dist/{index-D4yJP9I2.js → index-CKEbjSig.js} +1 -1
  35. package/dist/{stock-BsdmfT-b.js → stock-CC4RqQaB.js} +1 -1
  36. package/dist/stores/feature.d.ts +1 -0
  37. package/dist/{supplier-CXhkgC4M.js → supplier-DLXOOcIm.js} +1 -1
  38. package/dist/tsconfig.app.tsbuildinfo +1 -1
  39. package/dist/{use-inventory-binding-dialog-DPMJmBCr.js → use-inventory-binding-dialog-B1zBTsW9.js} +1 -1
  40. package/dist/views/transfer-template/helpers/import-export.helper.d.ts +1 -1
  41. package/dist/{vue-i18n-ByVzHsI7.js → vue-i18n-AeCKtYb7.js} +2 -2
  42. package/package.json +3 -3
  43. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-B_c6Vn6P.js +0 -282
@@ -1,61 +1,61 @@
1
- import { X as Re, a as Q, L as Ie, aa as F, r as Ne, ab as de, s as pe, u as z, j as P, v as Ae, aC as ne, w as fe, t as H, P as q, aB as Oe, au as De, V as Fe, x as Pe, y as Ue, b as ye, e as oe, f as J, R as ae, J as Be, a9 as Me, D as W, i as A, h as Le } from "./app-DntcWR3_.js";
2
- import { useCoreStore as X, useI18n as Z } from "@feedmepos/mf-common";
3
- import { useDialogChild as Qe, useSnackbar as he, useDialog as He, FmButtonVariant as se, components as ie } from "@feedmepos/ui-library";
1
+ import { X as Re, a as Q, L as Ie, aa as F, r as Ae, ab as pe, s as fe, u as z, j as P, v as Ne, aC as oe, w as ye, b as J, t as H, P as q, aB as De, au as Oe, V as Fe, x as Pe, y as Ue, e as ae, f as X, R as se, J as Be, a9 as Me, D as W, i as N, h as Le } from "./app-ojZQI-KQ.js";
2
+ import { useCoreStore as Z, useI18n as ee } from "@feedmepos/mf-common";
3
+ import { useDialogChild as Qe, useSnackbar as he, useDialog as He, FmButtonVariant as ie, components as le } from "@feedmepos/ui-library";
4
4
  import { defineStore as ve } from "pinia";
5
- import { defineComponent as ge, resolveComponent as B, openBlock as T, createElementBlock as w, createElementVNode as $, normalizeClass as M, createTextVNode as qe, toDisplayString as I, unref as R, createCommentVNode as L, createVNode as O, withCtx as Y, Fragment as U, renderList as j, ref as C, onMounted as Ve, computed as le, watch as je, createSlots as ze, createBlock as V, h as G } from "vue";
5
+ import { defineComponent as ge, resolveComponent as B, openBlock as T, createElementBlock as k, createElementVNode as $, normalizeClass as M, createTextVNode as qe, toDisplayString as I, unref as R, createCommentVNode as L, createVNode as D, withCtx as G, Fragment as U, renderList as j, ref as C, onMounted as Ve, computed as ce, watch as je, createSlots as ze, createBlock as V, h as Y } from "vue";
6
6
  import { useRouter as Ke } from "vue-router";
7
- import { u as ee } from "./supplier-CXhkgC4M.js";
7
+ import { u as te } from "./supplier-DLXOOcIm.js";
8
8
  const be = Re((e, t) => {
9
- function a() {
9
+ function s() {
10
10
  var n;
11
- return `business_${((n = X().currentBusiness.value) == null ? void 0 : n._id) ?? ""}`;
11
+ return `business_${((n = Z().currentBusiness.value) == null ? void 0 : n._id) ?? ""}`;
12
12
  }
13
13
  return {
14
14
  async getTemplate(c) {
15
- const o = a(), n = `${e.inventoryBackendUrl}/${o}/purchase-order-template/${c}`;
15
+ const a = s(), n = `${e.inventoryBackendUrl}/${a}/purchase-order-template/${c}`;
16
16
  return t.get(n);
17
17
  },
18
18
  async readTemplates() {
19
- const c = a(), o = `${e.inventoryBackendUrl}/${c}/purchase-order-template`;
20
- return t.get(o);
19
+ const c = s(), a = `${e.inventoryBackendUrl}/${c}/purchase-order-template`;
20
+ return t.get(a);
21
21
  },
22
22
  async createTemplate(c) {
23
- const o = a(), n = `${e.inventoryBackendUrl}/${o}/purchase-order-template`;
23
+ const a = s(), n = `${e.inventoryBackendUrl}/${a}/purchase-order-template`;
24
24
  return t.post(n, c);
25
25
  },
26
26
  async updateTemplate(c) {
27
- const o = a(), n = `${e.inventoryBackendUrl}/${o}/purchase-order-template`;
27
+ const a = s(), n = `${e.inventoryBackendUrl}/${a}/purchase-order-template`;
28
28
  return t.put(n, c);
29
29
  },
30
30
  async deleteTemplate(c) {
31
- const o = a(), n = `${e.inventoryBackendUrl}/${o}/purchase-order-template`;
31
+ const a = s(), n = `${e.inventoryBackendUrl}/${a}/purchase-order-template`;
32
32
  return t.delete(n, { _id: c._id, _rev: c._rev });
33
33
  },
34
34
  async importTemplates(c) {
35
- const o = a(), n = `${e.inventoryBackendUrl}/${o}/purchase-order-template/import`;
35
+ const a = s(), n = `${e.inventoryBackendUrl}/${a}/purchase-order-template/import`;
36
36
  return t.post(n, c);
37
37
  }
38
38
  };
39
39
  });
40
40
  function xe(e) {
41
- const t = Q(), a = e.sku, c = t.skuById[a._id];
42
- if (c.unit._id !== a.unit._id) return !0;
43
- const o = e.measurement;
44
- return o ? !t.unitById[c.unit._id].measurements.find((i) => i.id === o.id) : !1;
41
+ const t = Q(), s = e.sku, c = t.skuById[s._id];
42
+ if (c.unit._id !== s.unit._id) return !0;
43
+ const a = e.measurement;
44
+ return a ? !t.unitById[c.unit._id].measurements.find((o) => o.id === a.id) : !1;
45
45
  }
46
- var E = /* @__PURE__ */ ((e) => (e.PURCHASE = "PURCHASE", e.TRANSFER = "TRANSFER", e))(E || {}), te = /* @__PURE__ */ ((e) => (e.Source = "Source", e.Destination = "Destination", e.Ingredient = "Ingredient", e))(te || {});
47
- const ce = Ie(0);
48
- function Se(e, t) {
49
- var o;
50
- const a = e.sku;
46
+ var E = /* @__PURE__ */ ((e) => (e.PURCHASE = "PURCHASE", e.TRANSFER = "TRANSFER", e))(E || {}), re = /* @__PURE__ */ ((e) => (e.Source = "Source", e.Destination = "Destination", e.Ingredient = "Ingredient", e))(re || {});
47
+ const me = Ie(0);
48
+ function Se(e) {
49
+ var c;
50
+ const t = e.sku;
51
51
  return {
52
- code: a.code,
53
- overrideCode: t,
54
- name: a.name,
55
- unit: ((o = a.unit.measurements.find((n) => n.id === a.trackingMeasurement)) == null ? void 0 : o.abbrev) ?? a.unit.abbrev,
52
+ code: t.code,
53
+ overrideCode: e.code,
54
+ name: t.name,
55
+ unit: ((c = t.unit.measurements.find((a) => a.id === t.trackingMeasurement)) == null ? void 0 : c.abbrev) ?? t.unit.abbrev,
56
56
  defaultQuantity: +P(e.quantity),
57
- minimumQuantity: +P(e.minimumQuantity ?? ce),
58
- maximumQuantity: +P(e.maximumQuantity ?? ce),
57
+ minimumQuantity: +P(e.minimumQuantity ?? me),
58
+ maximumQuantity: +P(e.maximumQuantity ?? me),
59
59
  quantityStep: +P(e.quantityStep)
60
60
  };
61
61
  }
@@ -96,15 +96,15 @@ function Te() {
96
96
  ];
97
97
  }
98
98
  function We(e) {
99
- var i;
100
- const a = X().currentBusiness.value, o = (i = e.map((l) => {
99
+ var o;
100
+ const s = Z().currentBusiness.value, a = (o = e.map((l) => {
101
101
  var x;
102
- const u = l.purchaseOrder.items.map((r) => Se(r)), y = Te(), f = [
102
+ const d = l.purchaseOrder.items.map((r) => Se(r)), h = Te(), y = [
103
103
  ["Template ID", l._id],
104
104
  ["Template name", l.name],
105
- ["Business name", a == null ? void 0 : a.name],
106
- ["Business ID", a == null ? void 0 : a._id],
107
- ["Menu version", a == null ? void 0 : a.menuVersion],
105
+ ["Business name", s == null ? void 0 : s.name],
106
+ ["Business ID", s == null ? void 0 : s._id],
107
+ ["Menu version", s == null ? void 0 : s.menuVersion],
108
108
  [
109
109
  "Purchase/Transfer",
110
110
  typeof l.purchaseOrder.supplier.internal == "string" ? E.TRANSFER : E.PURCHASE
@@ -120,64 +120,61 @@ function We(e) {
120
120
  ["Reference", l.purchaseOrder.ref ?? ""],
121
121
  ["Remark", l.purchaseOrder.remark ?? ""],
122
122
  [],
123
- y.map((r) => r.name),
124
- ...u.map((r) => y.map((S) => r[S.id]))
125
- ], m = y.map((r) => `system:${r.id}`), v = F(f, m);
123
+ h.map((r) => r.name),
124
+ ...d.map((r) => h.map((S) => r[S.id]))
125
+ ], m = h.map((r) => `system:${r.id}`), v = F(y, m);
126
126
  return { name: l.name, sheet: v };
127
127
  }).reduce(
128
- (l, u) => {
129
- var f;
130
- const y = u.name.slice(0, 12);
131
- return (f = l.sheetOccurence)[y] ?? (f[y] = 0), l.sheetOccurence[y] += 1, l.sheets[`${y} (${l.sheetOccurence[y]})`] = u.sheet, l;
128
+ (l, d) => {
129
+ var y;
130
+ const h = d.name.slice(0, 12);
131
+ return (y = l.sheetOccurence)[h] ?? (y[h] = 0), l.sheetOccurence[h] += 1, l.sheets[`${h} (${l.sheetOccurence[h]})`] = d.sheet, l;
132
132
  },
133
133
  {
134
134
  sheets: {},
135
135
  sheetOccurence: {}
136
136
  }
137
- )) == null ? void 0 : i.sheets, n = `${a == null ? void 0 : a.name} transfer templates (${Ne(/* @__PURE__ */ new Date())}).xlsx`, h = de(o);
138
- return pe(h, n), n;
137
+ )) == null ? void 0 : o.sheets, n = `${s == null ? void 0 : s.name} transfer templates (${Ae(/* @__PURE__ */ new Date())}).xlsx`, f = pe(a);
138
+ return fe(f, n), n;
139
139
  }
140
- function Ge() {
141
- const e = X(), t = ee(), a = z(), c = Q(), o = e.currentBusiness.value, n = Se(
142
- {
143
- sku: {
144
- unit: {
145
- _id: "",
146
- name: "Unit",
147
- abbrev: "Unit",
148
- precision: 0,
149
- measurements: []
150
- },
151
- code: "ING001",
140
+ function Ye() {
141
+ const e = Z(), t = te(), s = z(), c = Q(), a = e.currentBusiness.value, n = Se({
142
+ sku: {
143
+ unit: {
152
144
  _id: "",
153
- name: "Sugar"
145
+ name: "Unit",
146
+ abbrev: "Unit",
147
+ precision: 0,
148
+ measurements: []
154
149
  },
155
150
  code: "ING001",
156
- name: "Sugar",
157
- quantity: {
158
- amount: 1,
159
- precision: 0
160
- },
161
- quantityStep: {
162
- amount: 1,
163
- precision: 0
164
- },
165
- minimumQuantity: {
166
- amount: 1,
167
- precision: 0
168
- },
169
- maximumQuantity: {
170
- amount: 1,
171
- precision: 0
172
- }
151
+ _id: "",
152
+ name: "Sugar"
173
153
  },
174
- "ING001 Override"
175
- ), h = Te(), i = [
154
+ code: "ING001 (override optional)",
155
+ name: "Sugar",
156
+ quantity: {
157
+ amount: 1,
158
+ precision: 0
159
+ },
160
+ quantityStep: {
161
+ amount: 1,
162
+ precision: 0
163
+ },
164
+ minimumQuantity: {
165
+ amount: 1,
166
+ precision: 0
167
+ },
168
+ maximumQuantity: {
169
+ amount: 1,
170
+ precision: 0
171
+ }
172
+ }), f = Te(), o = [
176
173
  ["Template ID (leave empty to create new)"],
177
174
  ["Template Name", "New template"],
178
- ["Business name", o == null ? void 0 : o.name],
179
- ["Business ID", o == null ? void 0 : o._id],
180
- ["Menu version", o == null ? void 0 : o.menuVersion],
175
+ ["Business name", a == null ? void 0 : a.name],
176
+ ["Business ID", a == null ? void 0 : a._id],
177
+ ["Menu version", a == null ? void 0 : a.menuVersion],
181
178
  ["Purchase/Transfer", "Purchase"],
182
179
  [
183
180
  "Transfer from",
@@ -192,9 +189,9 @@ function Ge() {
192
189
  ["Reference"],
193
190
  ["Remark"],
194
191
  [],
195
- h.map((r) => r.name),
196
- h.map((r) => n[r.id])
197
- ], l = h.map((r) => `system:${r.id}`), u = F(i, l), y = F(
192
+ f.map((r) => r.name),
193
+ f.map((r) => n[r.id])
194
+ ], l = f.map((r) => `system:${r.id}`), d = F(o, l), h = F(
198
195
  [
199
196
  ...t.businessSuppliers.map((r) => [
200
197
  `${r.name} (${r._id})`,
@@ -206,32 +203,32 @@ function Ge() {
206
203
  r.address.state,
207
204
  r.address.country
208
205
  ]),
209
- ...a.locations.map((r) => {
210
- var S, _, p, s, d, b;
206
+ ...s.locations.map((r) => {
207
+ var S, _, p, i, u, g;
211
208
  return [
212
209
  `${r.name} (${r.dbName})`,
213
210
  "Transfer",
214
211
  (S = r.doc.profile.address) == null ? void 0 : S.line1,
215
212
  (_ = r.doc.profile.address) == null ? void 0 : _.line2,
216
213
  (p = r.doc.profile.address) == null ? void 0 : p.city,
217
- (s = r.doc.profile.address) == null ? void 0 : s.postcode,
218
- (d = r.doc.profile.address) == null ? void 0 : d.state,
219
- (b = r.doc.profile.address) == null ? void 0 : b.country
214
+ (i = r.doc.profile.address) == null ? void 0 : i.postcode,
215
+ (u = r.doc.profile.address) == null ? void 0 : u.state,
216
+ (g = r.doc.profile.address) == null ? void 0 : g.country
220
217
  ];
221
218
  })
222
219
  ],
223
220
  ["Name", "Type", "Line 1", "Line 2", "City", "Postal", "State", "Country"]
224
- ), f = F(
225
- a.locations.map((r) => {
226
- var S, _, p, s, d, b;
221
+ ), y = F(
222
+ s.locations.map((r) => {
223
+ var S, _, p, i, u, g;
227
224
  return [
228
225
  `${r.name} (${r.dbName})`,
229
226
  (S = r.doc.profile.address) == null ? void 0 : S.line1,
230
227
  (_ = r.doc.profile.address) == null ? void 0 : _.line2,
231
228
  (p = r.doc.profile.address) == null ? void 0 : p.city,
232
- (s = r.doc.profile.address) == null ? void 0 : s.postcode,
233
- (d = r.doc.profile.address) == null ? void 0 : d.state,
234
- (b = r.doc.profile.address) == null ? void 0 : b.country
229
+ (i = r.doc.profile.address) == null ? void 0 : i.postcode,
230
+ (u = r.doc.profile.address) == null ? void 0 : u.state,
231
+ (g = r.doc.profile.address) == null ? void 0 : g.country
235
232
  ];
236
233
  }),
237
234
  ["Name", "Line 1", "Line 2", "City", "Postal", "State", "Country"]
@@ -243,32 +240,32 @@ function Ge() {
243
240
  ...r.unit.measurements.map((S) => S.abbrev)
244
241
  ]),
245
242
  ["Code", "Name", "Base unit", "Measurements"]
246
- ), v = de({
247
- Template: u,
248
- Source: y,
249
- Destination: f,
243
+ ), v = pe({
244
+ Template: d,
245
+ Source: h,
246
+ Destination: y,
250
247
  Ingredient: m
251
- }), x = `${o == null ? void 0 : o.name} transfer templates import.xlsx`;
252
- return pe(v, x), x;
248
+ }), x = `${a == null ? void 0 : a.name} transfer templates import.xlsx`;
249
+ return fe(v, x), x;
253
250
  }
254
- function Ye(e, t) {
255
- const a = new Array(), c = /(.*) \(((supplier_|warehouse_|restaurant_).{24,})\)/, n = z().locationByDbName, i = ee().supplierById, l = e.trim(), u = c.exec(l);
256
- if (!u)
257
- return a.push(`Transfer from location value of ${l} cannot be read.`), {
258
- errors: a
251
+ function Ge(e, t) {
252
+ const s = new Array(), c = /(.*) \(((supplier_|warehouse_|restaurant_).{24,})\)/, n = z().locationByDbName, o = te().supplierById, l = e.trim(), d = c.exec(l);
253
+ if (!d)
254
+ return s.push(`Transfer from location value of ${l} cannot be read.`), {
255
+ errors: s
259
256
  };
260
- const y = u[1], f = u[2];
257
+ const h = d[1], y = d[2];
261
258
  let m;
262
- if (f.startsWith("supplier"))
263
- m = i[f], t !== E.PURCHASE && a.push(`Expected transfer type Purchase but found ${t} instead.`);
259
+ if (y.startsWith("supplier"))
260
+ m = o[y], t !== E.PURCHASE && s.push(`Expected transfer type Purchase but found ${t} instead.`);
264
261
  else {
265
- const v = n[f];
262
+ const v = n[y];
266
263
  if (!v)
267
- return a.push(`Location (${y}) of id ${f} is not found.`), {
268
- errors: a
264
+ return s.push(`Location (${h}) of id ${y} is not found.`), {
265
+ errors: s
269
266
  };
270
- y !== v.name && a.push(
271
- `Location id ${f} has non-matching name. Found ${y} but expected ${v.name}`
267
+ h !== v.name && s.push(
268
+ `Location id ${y} has non-matching name. Found ${h} but expected ${v.name}`
272
269
  ), m = {
273
270
  _id: v.doc._id,
274
271
  name: v.name,
@@ -280,7 +277,7 @@ function Ye(e, t) {
280
277
  postcode: "",
281
278
  coordinates: [0, 0]
282
279
  },
283
- internal: f.split("_")[0] === "restaurant" ? ne.enum.restaurant : ne.enum.warehouse,
280
+ internal: y.split("_")[0] === "restaurant" ? oe.enum.restaurant : oe.enum.warehouse,
284
281
  phoneNumber: v.doc.profile.phoneNo ?? "",
285
282
  email: v.doc.profile.email ?? "",
286
283
  _rev: "",
@@ -290,26 +287,26 @@ function Ye(e, t) {
290
287
  }
291
288
  return {
292
289
  from: m,
293
- errors: a
290
+ errors: s
294
291
  };
295
292
  }
296
293
  function Je(e) {
297
294
  if (!e.length || `${e[0]}`.toLocaleLowerCase() === "all")
298
295
  return [];
299
296
  const t = /(.*) \(((warehouse_|restaurant_).{24,})\)/, c = z().locationByDbName;
300
- return e.map((o) => {
301
- const n = new Array(), h = o.trim(), i = t.exec(h);
302
- if (!i)
303
- return n.push(`Enabled location value of ${h} cannot be read.`), {
297
+ return e.map((a) => {
298
+ const n = new Array(), f = a.trim(), o = t.exec(f);
299
+ if (!o)
300
+ return n.push(`Enabled location value of ${f} cannot be read.`), {
304
301
  errors: n
305
302
  };
306
- const l = i[1], u = i[2], y = c[u];
307
- return y ? (l !== y.name && n.push(
308
- `Location id ${u} has non-matching name. Found ${l} but expected ${y.name}`
303
+ const l = o[1], d = o[2], h = c[d];
304
+ return h ? (l !== h.name && n.push(
305
+ `Location id ${d} has non-matching name. Found ${l} but expected ${h.name}`
309
306
  ), {
310
307
  errors: n,
311
- location: y
312
- }) : (n.push(`Location (${l}) of id ${u} is not found.`), {
308
+ location: h
309
+ }) : (n.push(`Location (${l}) of id ${d} is not found.`), {
313
310
  errors: n
314
311
  });
315
312
  });
@@ -317,47 +314,47 @@ function Je(e) {
317
314
  function Xe(e) {
318
315
  const [
319
316
  t,
320
- a,
317
+ s,
321
318
  c,
322
- o,
319
+ a,
323
320
  n,
324
- h,
325
- i,
321
+ f,
322
+ o,
326
323
  l,
327
- u,
328
- y,
329
- f
330
- ] = fe(e);
324
+ d,
325
+ h,
326
+ y
327
+ ] = ye(e);
331
328
  return {
332
- id: `${a[1] ?? ""}`.trim(),
329
+ id: `${s[1] ?? ""}`.trim(),
333
330
  name: `${c[1] ?? ""}`.trim(),
334
- type: `${i[1] ?? ""}`.trim().toLocaleLowerCase() === "transfer" ? E.TRANSFER : E.PURCHASE,
331
+ type: `${o[1] ?? ""}`.trim().toLocaleLowerCase() === "transfer" ? E.TRANSFER : E.PURCHASE,
335
332
  transferFrom: `${l[1] ?? ""}`.trim(),
336
- locations: u.slice(1).map((m) => `${m}`.trim()).filter((m) => m),
337
- reference: `${y[1] ?? ""}`.trim(),
338
- remark: `${f[1] ?? ""}`.trim()
333
+ locations: d.slice(1).map((m) => `${m}`.trim()).filter((m) => m),
334
+ reference: `${h[1] ?? ""}`.trim(),
335
+ remark: `${y[1] ?? ""}`.trim()
339
336
  };
340
337
  }
341
338
  function Ze(e) {
342
339
  const [
343
340
  t,
344
- a,
341
+ s,
345
342
  c,
346
- o,
343
+ a,
347
344
  n,
348
- h,
349
- i,
345
+ f,
346
+ o,
350
347
  l,
351
- u,
348
+ d,
349
+ h,
352
350
  y,
353
- f,
354
351
  m,
355
352
  v,
356
353
  ...x
357
- ] = fe(e);
358
- if (!t || !t.length || t.some((s) => s.length && !s.startsWith("system:")))
354
+ ] = ye(e);
355
+ if (!t || !t.length || t.some((i) => i.length && !i.startsWith("system:")))
359
356
  throw new Error("Missing meta header. Excel file does not come from the template.");
360
- const r = t.map((s) => s.split(":")[1]), _ = [
357
+ const r = t.map((i) => i.split(":")[1]), _ = [
361
358
  "code",
362
359
  "name",
363
360
  "unit",
@@ -365,163 +362,167 @@ function Ze(e) {
365
362
  "minimumQuantity",
366
363
  "maximumQuantity",
367
364
  "quantityStep"
368
- ].filter((s) => !r.includes(s));
365
+ ].filter((i) => !r.includes(i));
369
366
  if (_.length)
370
367
  throw new Error(
371
368
  `Missing meta headers (${_.join()}). Excel file does not come from the template.`
372
369
  );
373
- return x.map((s, d) => {
374
- const b = {};
375
- for (const k in r) {
376
- const g = r[k];
377
- Object.assign(b, { [g]: s[k] });
370
+ return x.map((i, u) => {
371
+ const g = {};
372
+ for (const w in r) {
373
+ const b = r[w];
374
+ Object.assign(g, { [b]: i[w] });
378
375
  }
379
376
  return {
380
- index: d,
381
- data: b
377
+ index: u,
378
+ data: g
382
379
  };
383
380
  });
384
381
  }
385
- function et(e, t, a) {
386
- const o = Q().skuByCode[e.code], n = new Array();
387
- if (!o)
388
- return n.push(`Cannot find ingredient with code (${e.code}) ${e.name}.`), {
382
+ function et(e, t, s) {
383
+ const c = Q(), a = J(), n = c.skuByCode[e.code], f = new Array();
384
+ if (!n)
385
+ return f.push(`Cannot find ingredient with code (${e.code}) ${e.name}.`), {
389
386
  index: t,
390
- errors: n
387
+ errors: f
391
388
  };
392
- if (a.filter((s) => s.data.code === e.code).length > 1)
393
- return n.push(`Ingredient ${e.code} is defined twice.`), {
389
+ if (s.filter((u) => u.data.code === e.code).length > 1)
390
+ return f.push(`Ingredient ${e.code} is defined twice.`), {
394
391
  index: t,
395
- errors: n
392
+ errors: f
396
393
  };
397
- const h = o.unit, i = h == null ? void 0 : h.measurements.find((s) => s.abbrev === e.unit);
398
- if (h.abbrev !== e.unit && !i) {
399
- const s = `Cannot find unit measurement of symbol ${e.unit || "[empty]"} for ingredient (${e.code}) ${e.name}.`;
400
- n.push(s);
401
- const d = {
402
- sku: o,
403
- code: o.code,
404
- name: o.name,
405
- measurement: i,
394
+ const o = n.unit, l = o == null ? void 0 : o.measurements.find((u) => u.abbrev === e.unit);
395
+ if (o.abbrev !== e.unit && !l) {
396
+ const u = `Cannot find unit measurement of symbol ${e.unit || "[empty]"} for ingredient (${e.code}) ${e.name}.`;
397
+ f.push(u);
398
+ const g = {
399
+ sku: n,
400
+ code: e.overrideCode || n.code,
401
+ name: n.name,
402
+ measurement: l,
406
403
  quantity: { amount: 0, precision: 0 },
407
404
  quantityStep: { amount: 0, precision: 0 },
408
405
  minimumQuantity: { amount: 0, precision: 0 },
409
406
  maximumQuantity: { amount: 0, precision: 0 }
410
407
  };
408
+ if (a.isEnabled) {
409
+ const w = a.getItemPKTCode(n);
410
+ w && (g.code = w);
411
+ }
411
412
  return {
412
413
  index: t,
413
- errors: n,
414
- templateItem: d
414
+ errors: f,
415
+ templateItem: g
415
416
  };
416
417
  }
417
- const l = H(
418
+ const d = H(
418
419
  e.quantityStep,
419
- q(h, i)
420
+ q(o, l)
420
421
  );
421
- (Number.isNaN(Number(e.quantityStep)) || Number(e.quantityStep) <= 0) && n.push("Amount step must be more than 0");
422
- const u = Oe(l), y = H(
422
+ (Number.isNaN(Number(e.quantityStep)) || Number(e.quantityStep) <= 0) && f.push("Amount step must be more than 0");
423
+ const h = De(d), y = H(
423
424
  e.minimumQuantity,
424
- q(h, i)
425
- ), f = u(y);
426
- typeof f == "string" && n.push(`Minimum amount: ${f}`);
427
- const m = H(
425
+ q(o, l)
426
+ ), m = h(y);
427
+ typeof m == "string" && f.push(`Minimum amount: ${m}`);
428
+ const v = H(
428
429
  e.maximumQuantity,
429
- q(h, i)
430
- ), v = u(m);
431
- typeof v == "string" && n.push(`Maximum amount: ${v}`), +e.minimumQuantity > +e.maximumQuantity && n.push("Minimum amount must be less than or equal to maximum amount");
432
- const x = De(+e.minimumQuantity, +e.maximumQuantity), r = H(
430
+ q(o, l)
431
+ ), x = h(v);
432
+ typeof x == "string" && f.push(`Maximum amount: ${x}`), +e.minimumQuantity > +e.maximumQuantity && f.push("Minimum amount must be less than or equal to maximum amount");
433
+ const r = Oe(+e.minimumQuantity, +e.maximumQuantity), S = H(
433
434
  e.defaultQuantity,
434
- q(h, i)
435
- ), S = u(r), _ = x(`${e.defaultQuantity}`);
436
- typeof S == "string" && n.push(`Default amount: ${S}`), typeof _ == "string" && n.push(`Default amount: ${_}`);
437
- const p = {
438
- sku: o,
439
- code: e.overrideCode || o.code,
440
- name: e.name || o.name,
441
- measurement: i,
442
- quantity: r,
443
- quantityStep: l,
435
+ q(o, l)
436
+ ), _ = h(S), p = r(`${e.defaultQuantity}`);
437
+ typeof _ == "string" && f.push(`Default amount: ${_}`), typeof p == "string" && f.push(`Default amount: ${p}`);
438
+ const i = {
439
+ sku: n,
440
+ code: e.overrideCode || n.code,
441
+ name: e.name || n.name,
442
+ measurement: l,
443
+ quantity: S,
444
+ quantityStep: d,
444
445
  minimumQuantity: y,
445
- maximumQuantity: m
446
+ maximumQuantity: v
446
447
  };
447
448
  return {
448
449
  index: t,
449
- errors: n,
450
- templateItem: p
450
+ errors: f,
451
+ templateItem: i
451
452
  };
452
453
  }
453
454
  function tt(e) {
454
455
  const t = e.SheetNames.filter(
455
- (n) => !Object.values(te).map(String).includes(n)
456
- ), c = $e().templates, o = Ae(c, "_id");
456
+ (n) => !Object.values(re).map(String).includes(n)
457
+ ), c = $e().templates, a = Ne(c, "_id");
457
458
  try {
458
459
  return t.reduce(
459
- (n, h) => {
460
- var s;
461
- const i = new Array(), l = e.Sheets[h], u = Xe(l), y = Ye(u.transferFrom, u.type);
462
- i.push(...y.errors);
463
- const f = y.from, m = Je(u.locations), v = m.filter((d) => d.location).map((d) => d.location);
464
- i.push(...m.flatMap((d) => d.errors));
465
- const x = Ze(l).filter((d) => d.data.code), r = x.map(
466
- (d, b) => et(d.data, b, x)
460
+ (n, f) => {
461
+ var i;
462
+ const o = new Array(), l = e.Sheets[f], d = Xe(l), h = Ge(d.transferFrom, d.type);
463
+ o.push(...h.errors);
464
+ const y = h.from, m = Je(d.locations), v = m.filter((u) => u.location).map((u) => u.location);
465
+ o.push(...m.flatMap((u) => u.errors));
466
+ const x = Ze(l).filter((u) => u.data.code), r = x.map(
467
+ (u, g) => et(u.data, g, x)
467
468
  );
468
- i.push(
469
+ o.push(
469
470
  ...r.flatMap(
470
- (d) => d.errors.map((b) => `(Excel row ${d.index + 14}) ${b}`)
471
+ (u) => u.errors.map((g) => `(Excel row ${u.index + 14}) ${g}`)
471
472
  )
472
473
  );
473
- const S = r.filter((d) => d.templateItem).map((d) => d.templateItem);
474
- if (u.id) {
475
- const d = o[u.id];
476
- if (!d) {
477
- const k = {
478
- _id: u.id,
474
+ const S = r.filter((u) => u.templateItem).map((u) => u.templateItem);
475
+ if (d.id) {
476
+ const u = a[d.id];
477
+ if (!u) {
478
+ const w = {
479
+ _id: d.id,
479
480
  _rev: "",
480
- name: u.name || `(unnamed from sheet ${h || "<unnamed sheet>"})`,
481
+ name: d.name || `(unnamed from sheet ${f || "<unnamed sheet>"})`,
481
482
  purchaseOrder: rt()
482
483
  };
483
- return i.push(`Template ID ${u.id} is not found.`), n.importUpdateResult.push({
484
+ return o.push(`Template ID ${d.id} is not found.`), n.importUpdateResult.push({
484
485
  type: "update",
485
- original: k,
486
- template: k,
487
- excelSheetName: h,
488
- errors: i
486
+ original: w,
487
+ template: w,
488
+ excelSheetName: f,
489
+ errors: o
489
490
  }), n;
490
491
  }
491
- const b = {
492
+ const g = {
492
493
  type: "update",
493
- original: d,
494
+ original: u,
494
495
  template: {
495
- ...d,
496
- name: u.name,
496
+ ...u,
497
+ name: d.name,
497
498
  locations: v.length ? v : null,
498
499
  purchaseOrder: {
499
- ...d.purchaseOrder,
500
- supplier: f ?? ((s = d.purchaseOrder) == null ? void 0 : s.supplier),
501
- ref: u.reference,
502
- remark: u.remark,
500
+ ...u.purchaseOrder,
501
+ supplier: y ?? ((i = u.purchaseOrder) == null ? void 0 : i.supplier),
502
+ ref: d.reference,
503
+ remark: d.remark,
503
504
  items: S
504
505
  }
505
506
  },
506
- excelSheetName: h,
507
- errors: i
507
+ excelSheetName: f,
508
+ errors: o
508
509
  };
509
- return n.importUpdateResult.push(b), n;
510
+ return n.importUpdateResult.push(g), n;
510
511
  }
511
512
  const p = {
512
513
  type: "create",
513
514
  template: {
514
- name: u.name,
515
+ name: d.name,
515
516
  locations: v,
516
517
  purchaseOrder: {
517
- supplier: f ?? _e(),
518
- ref: u.reference,
519
- remark: u.remark,
518
+ supplier: y ?? _e(),
519
+ ref: d.reference,
520
+ remark: d.remark,
520
521
  items: S
521
522
  }
522
523
  },
523
- excelSheetName: h,
524
- errors: i
524
+ excelSheetName: f,
525
+ errors: o
525
526
  };
526
527
  return n.importCreateResult.push(p), n;
527
528
  },
@@ -565,7 +566,7 @@ function rt() {
565
566
  const nt = { class: "flex items-center gap-12 pl-8" }, ot = { class: "flex flex-col" }, at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, st = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, it = {
566
567
  key: 0,
567
568
  class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
568
- }, lt = { key: 0 }, me = /* @__PURE__ */ ge({
569
+ }, lt = { key: 0 }, ue = /* @__PURE__ */ ge({
569
570
  __name: "TransferTemplateImportItem",
570
571
  props: {
571
572
  type: {},
@@ -576,11 +577,11 @@ const nt = { class: "flex items-center gap-12 pl-8" }, ot = { class: "flex flex-
576
577
  errors: {}
577
578
  },
578
579
  setup(e) {
579
- return (t, a) => {
580
- var n, h, i;
581
- const c = B("FmIcon"), o = B("FmTooltip");
582
- return T(), w("div", nt, [
583
- a[0] || (a[0] = $("div", null, "•", -1)),
580
+ return (t, s) => {
581
+ var n, f, o;
582
+ const c = B("FmIcon"), a = B("FmTooltip");
583
+ return T(), k("div", nt, [
584
+ s[0] || (s[0] = $("div", null, "•", -1)),
584
585
  $("div", ot, [
585
586
  $("div", at, [
586
587
  $("div", {
@@ -590,17 +591,17 @@ const nt = { class: "flex items-center gap-12 pl-8" }, ot = { class: "flex flex-
590
591
  }, [
591
592
  qe(I(t.name) + " ", 1),
592
593
  $("span", st, " (" + I(R(Fe)(`${t.transferType}`)) + ") ", 1),
593
- t.type === "create" ? (T(), w("span", it, "(new)")) : L("", !0)
594
+ t.type === "create" ? (T(), k("span", it, "(new)")) : L("", !0)
594
595
  ], 2),
595
- t.errors.length ? (T(), w("div", lt, [
596
- O(o, { "z-index": 50 }, {
597
- content: Y(() => [
596
+ t.errors.length ? (T(), k("div", lt, [
597
+ D(a, { "z-index": 50 }, {
598
+ content: G(() => [
598
599
  $("ol", null, [
599
- (T(!0), w(U, null, j(t.errors, (l, u) => (T(), w("li", { key: u }, I(l), 1))), 128))
600
+ (T(!0), k(U, null, j(t.errors, (l, d) => (T(), k("li", { key: d }, I(l), 1))), 128))
600
601
  ])
601
602
  ]),
602
- default: Y(() => [
603
- O(c, {
603
+ default: G(() => [
604
+ D(c, {
604
605
  name: "error",
605
606
  size: "sm",
606
607
  color: "system-error-300"
@@ -618,7 +619,7 @@ const nt = { class: "flex items-center gap-12 pl-8" }, ot = { class: "flex flex-
618
619
  "text-fm-color-typo-secondary": !t.errors.length
619
620
  }
620
621
  ])
621
- }, I((n = t.locations) != null && n.length ? `${(h = t.locations) == null ? void 0 : h.length} locations` : "All locations") + ", " + I(`${(i = t.items) == null ? void 0 : i.length} items`), 3)
622
+ }, I((n = t.locations) != null && n.length ? `${(f = t.locations) == null ? void 0 : f.length} locations` : "All locations") + ", " + I(`${(o = t.items) == null ? void 0 : o.length} items`), 3)
622
623
  ])
623
624
  ]);
624
625
  };
@@ -638,11 +639,11 @@ const nt = { class: "flex items-center gap-12 pl-8" }, ot = { class: "flex flex-
638
639
  }, vt = { class: "fm-typo-en-body-lg-600" }, gt = /* @__PURE__ */ ge({
639
640
  __name: "TransferTemplateImport",
640
641
  setup(e) {
641
- const t = C(null), a = Qe(), c = he(), o = C(!1), n = C(!1), h = ee();
642
+ const t = C(null), s = Qe(), c = he(), a = C(!1), n = C(!1), f = te();
642
643
  Ve(async () => {
643
644
  n.value = !0;
644
645
  try {
645
- await h.readSuppliers().delayed(1e3);
646
+ await f.readSuppliers().delayed(1e3);
646
647
  } catch {
647
648
  c.open({
648
649
  title: "Something went wrong.",
@@ -653,38 +654,38 @@ const nt = { class: "flex items-center gap-12 pl-8" }, ot = { class: "flex flex-
653
654
  n.value = !1;
654
655
  }
655
656
  });
656
- const i = C(new Array()), l = C([]), u = C([]), y = le(
657
- () => !!i.value.length || l.value.some((x) => x.errors.length) || u.value.some((x) => x.errors.length)
658
- ), f = le(
659
- () => !!l.value.length || !!u.value.length
660
- ), { t: m } = Z();
657
+ const o = C(new Array()), l = C([]), d = C([]), h = ce(
658
+ () => !!o.value.length || l.value.some((x) => x.errors.length) || d.value.some((x) => x.errors.length)
659
+ ), y = ce(
660
+ () => !!l.value.length || !!d.value.length
661
+ ), { t: m } = ee();
661
662
  async function v(x) {
662
- i.value = [], l.value = [], u.value = [];
663
+ o.value = [], l.value = [], d.value = [];
663
664
  try {
664
- o.value = !0;
665
+ a.value = !0;
665
666
  const [r] = await Promise.all([
666
667
  Ue(x),
667
668
  // fake buffer
668
- new Promise((s) => setTimeout(s, 1e3))
669
+ new Promise((i) => setTimeout(i, 1e3))
669
670
  ]);
670
671
  if (!r.SheetNames.filter(
671
- (s) => !Object.values(te).map(String).includes(s)
672
- ).find((s) => s)) {
673
- i.value.push(m("inventory.ingredient.import.fileError.noSheet"));
672
+ (i) => !Object.values(re).map(String).includes(i)
673
+ ).find((i) => i)) {
674
+ o.value.push(m("inventory.ingredient.import.fileError.noSheet"));
674
675
  return;
675
676
  }
676
677
  const p = tt(r);
677
678
  if (p.invalidExcel) {
678
- i.value.push(
679
+ o.value.push(
679
680
  p.invalidExcelMessage ?? m("inventory.ingredient.import.fileError.invalidExcel")
680
681
  );
681
682
  return;
682
683
  }
683
- if (l.value = p.importCreateResult, u.value = p.importUpdateResult, !l.value.length && !u.value.length) {
684
- i.value.push(m("inventory.ingredient.import.fileError.noData"));
684
+ if (l.value = p.importCreateResult, d.value = p.importUpdateResult, !l.value.length && !d.value.length) {
685
+ o.value.push(m("inventory.ingredient.import.fileError.noData"));
685
686
  return;
686
687
  }
687
- a.emitData(p);
688
+ s.emitData(p);
688
689
  } catch (r) {
689
690
  c.open({
690
691
  title: m("inventory.ingredient.import.fileError.unableToRead"),
@@ -692,92 +693,92 @@ const nt = { class: "flex items-center gap-12 pl-8" }, ot = { class: "flex flex-
692
693
  type: "error"
693
694
  }), console.error("Error in reading file", r);
694
695
  } finally {
695
- i.value.length && c.open({
696
+ o.value.length && c.open({
696
697
  title: m("inventory.ingredient.import.fileError.invalidExcel"),
697
698
  type: "error"
698
- }), o.value = !1;
699
+ }), a.value = !1;
699
700
  }
700
701
  }
701
702
  return je(t, (x) => {
702
703
  x && v(x);
703
704
  }), (x, r) => {
704
705
  const S = B("FmCircularProgress"), _ = B("FmIcon"), p = B("FmButton");
705
- return T(), w("div", ct, [
706
+ return T(), k("div", ct, [
706
707
  r[2] || (r[2] = $("div", { class: "fm-typo-en-body-md-400" }, "Import transfer templates from excel sheets.", -1)),
707
- n.value ? (T(), w("div", mt, [
708
+ n.value ? (T(), k("div", mt, [
708
709
  $("div", null, [
709
- O(S, {
710
+ D(S, {
710
711
  size: "md",
711
712
  color: "neutral-gray-200"
712
713
  })
713
714
  ]),
714
715
  r[1] || (r[1] = $("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Loading...", -1))
715
- ])) : (T(), w(U, { key: 1 }, [
716
- O(Pe, {
716
+ ])) : (T(), k(U, { key: 1 }, [
717
+ D(Pe, {
717
718
  class: M({
718
719
  "w-full": !0,
719
720
  "h-[200px]": !t.value
720
721
  }),
721
722
  accept: ".xlsx",
722
- onFileUpload: r[0] || (r[0] = (s) => t.value = s),
723
+ onFileUpload: r[0] || (r[0] = (i) => t.value = i),
723
724
  label: R(m)("inventory.ingredient.import.uploadTemplate"),
724
725
  "button-label": R(m)("inventory.ingredient.import.selectFile")
725
726
  }, ze({ _: 2 }, [
726
727
  t.value ? {
727
728
  name: "default",
728
- fn: Y(({ openFileDialog: s }) => [
729
+ fn: G(({ openFileDialog: i }) => [
729
730
  $("div", ut, [
730
731
  $("div", {
731
732
  class: M([
732
733
  "fm-corner-radius-md p-16 flex items-center gap-16",
733
734
  {
734
- "border border-fm-color-neutral-gray-100": o.value,
735
- "border border-fm-color-neutral-gray-200": !o.value && !y.value,
736
- "border border-fm-color-system-error-200": y.value
735
+ "border border-fm-color-neutral-gray-100": a.value,
736
+ "border border-fm-color-neutral-gray-200": !a.value && !h.value,
737
+ "border border-fm-color-system-error-200": h.value
737
738
  }
738
739
  ])
739
740
  }, [
740
- o.value ? (T(), V(S, {
741
+ a.value ? (T(), V(S, {
741
742
  key: 0,
742
743
  size: "md",
743
744
  color: "neutral-gray-200"
744
745
  })) : (T(), V(_, {
745
746
  key: 1,
746
- name: y.value ? "error" : "attach_file",
747
+ name: h.value ? "error" : "attach_file",
747
748
  outline: "",
748
- color: y.value ? "system-error-300" : void 0
749
+ color: h.value ? "system-error-300" : void 0
749
750
  }, null, 8, ["name", "color"])),
750
751
  $("div", {
751
752
  class: M([
752
753
  "fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center",
753
754
  {
754
- "text-fm-color-typo-disabled": o.value,
755
- "text-fm-color-typo-primary": !o.value
755
+ "text-fm-color-typo-disabled": a.value,
756
+ "text-fm-color-typo-primary": !a.value
756
757
  }
757
758
  ])
758
759
  }, [
759
760
  $("div", dt, I(t.value.name), 1)
760
761
  ], 2),
761
- o.value ? L("", !0) : (T(), w("div", pt, [
762
- O(p, {
762
+ a.value ? L("", !0) : (T(), k("div", pt, [
763
+ D(p, {
763
764
  label: R(m)("inventory.ingredient.import.replaceFile"),
764
- variant: y.value ? "destructive" : "secondary",
765
- "prepend-icon": y.value ? void 0 : "autorenew",
766
- onClick: s
765
+ variant: h.value ? "destructive" : "secondary",
766
+ "prepend-icon": h.value ? void 0 : "autorenew",
767
+ onClick: i
767
768
  }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
768
769
  ]))
769
770
  ], 2),
770
- i.value.length ? (T(), w("div", ft, [
771
- (T(!0), w(U, null, j(i.value, (d, b) => (T(), w("div", {
772
- key: b,
771
+ o.value.length ? (T(), k("div", ft, [
772
+ (T(!0), k(U, null, j(o.value, (u, g) => (T(), k("div", {
773
+ key: g,
773
774
  class: "flex gap-8 items-center"
774
775
  }, [
775
- O(_, {
776
+ D(_, {
776
777
  name: "error",
777
778
  size: "sm",
778
779
  color: "system-error-300"
779
780
  }),
780
- $("div", yt, I(d), 1)
781
+ $("div", yt, I(u), 1)
781
782
  ]))), 128))
782
783
  ])) : L("", !0)
783
784
  ])
@@ -785,24 +786,24 @@ const nt = { class: "flex items-center gap-12 pl-8" }, ot = { class: "flex flex-
785
786
  key: "0"
786
787
  } : void 0
787
788
  ]), 1032, ["class", "label", "button-label"]),
788
- f.value ? (T(), w("div", ht, [
789
+ y.value ? (T(), k("div", ht, [
789
790
  $("div", vt, I(R(m)("inventory.ingredient.import.summary")), 1),
790
- (T(!0), w(U, null, j(l.value, (s, d) => (T(), V(me, {
791
- key: d,
792
- name: s.template.name,
793
- "transfer-type": typeof s.template.purchaseOrder.supplier.internal == "string" ? R(E).TRANSFER : R(E).PURCHASE,
794
- locations: s.template.locations,
795
- items: s.template.purchaseOrder.items,
796
- errors: s.errors,
791
+ (T(!0), k(U, null, j(l.value, (i, u) => (T(), V(ue, {
792
+ key: u,
793
+ name: i.template.name,
794
+ "transfer-type": typeof i.template.purchaseOrder.supplier.internal == "string" ? R(E).TRANSFER : R(E).PURCHASE,
795
+ locations: i.template.locations,
796
+ items: i.template.purchaseOrder.items,
797
+ errors: i.errors,
797
798
  type: "create"
798
799
  }, null, 8, ["name", "transfer-type", "locations", "items", "errors"]))), 128)),
799
- (T(!0), w(U, null, j(u.value, (s) => (T(), V(me, {
800
- key: s.template._id,
801
- name: s.template.name,
802
- "transfer-type": typeof s.template.purchaseOrder.supplier.internal == "string" ? R(E).TRANSFER : R(E).PURCHASE,
803
- locations: s.template.locations,
804
- items: s.template.purchaseOrder.items,
805
- errors: s.errors,
800
+ (T(!0), k(U, null, j(d.value, (i) => (T(), V(ue, {
801
+ key: i.template._id,
802
+ name: i.template.name,
803
+ "transfer-type": typeof i.template.purchaseOrder.supplier.internal == "string" ? R(E).TRANSFER : R(E).PURCHASE,
804
+ locations: i.template.locations,
805
+ items: i.template.purchaseOrder.items,
806
+ errors: i.errors,
806
807
  type: "update"
807
808
  }, null, 8, ["name", "transfer-type", "locations", "items", "errors"]))), 128))
808
809
  ])) : L("", !0)
@@ -812,49 +813,49 @@ const nt = { class: "flex items-center gap-12 pl-8" }, ot = { class: "flex flex-
812
813
  }
813
814
  });
814
815
  function bt(e) {
815
- var n, h;
816
- const t = ye();
816
+ var n, f;
817
+ const t = J();
817
818
  if (!t.isEnabled) return !0;
818
819
  if (!e.internal) {
819
- const i = t.getNetSuiteVendor(e._id), l = i == null ? void 0 : i.subsidiaryId, u = (n = t.currentVendorSubsidiary(e._id)) == null ? void 0 : n.id;
820
- return l && l == u;
820
+ const o = t.getNetSuiteVendor(e._id), l = o == null ? void 0 : o.subsidiaryId, d = (n = t.currentVendorSubsidiary(e._id)) == null ? void 0 : n.id;
821
+ return l && l == d;
821
822
  }
822
- const a = t.getNetSuiteLocation(`${e.internal}_${e._id}`), c = t.getLocationSubsidiary(a == null ? void 0 : a.netSuiteId).id, o = (h = t.currentLocationSubsidiary()) == null ? void 0 : h.id;
823
- return c && c == o;
823
+ const s = t.getNetSuiteLocation(`${e.internal}_${e._id}`), c = t.getLocationSubsidiary(s == null ? void 0 : s.netSuiteId).id, a = (f = t.currentLocationSubsidiary()) == null ? void 0 : f.id;
824
+ return c && c == a;
824
825
  }
825
826
  const xt = ve("transferTemplateActions", () => {
826
- const e = He(), t = he(), a = z(), c = $e(), o = be(), n = ye(), h = Ke(), { t: i } = Z(), l = C({});
827
- function u() {
827
+ const e = He(), t = he(), s = z(), c = $e(), a = be(), n = J(), f = Ke(), { t: o } = ee(), l = C({});
828
+ function d() {
828
829
  l.value = {
829
- mode: oe.CREATE,
830
+ mode: ae.CREATE,
830
831
  show: !0,
831
832
  "onUpdate:show"(p) {
832
833
  l.value.show = p;
833
834
  }
834
835
  };
835
836
  }
836
- function y(p) {
837
+ function h(p) {
837
838
  l.value = {
838
- mode: oe.UPDATE,
839
+ mode: ae.UPDATE,
839
840
  modelValue: p,
840
841
  show: !0,
841
- "onUpdate:show"(s) {
842
- l.value.show = s;
842
+ "onUpdate:show"(i) {
843
+ l.value.show = i;
843
844
  }
844
845
  };
845
846
  }
846
- function f(p, s, d) {
847
+ function y(p, i, u) {
847
848
  e.open({
848
849
  title: `Confirm deleting template ${p.name}?`,
849
850
  message: "Deleted template can no longer be retrieved",
850
851
  primaryActions: {
851
852
  text: "Delete",
852
- variant: se.Destructive,
853
+ variant: ie.Destructive,
853
854
  close: !0
854
855
  },
855
856
  secondaryActions: {
856
857
  text: "Cancel",
857
- variant: se.Plain,
858
+ variant: ie.Plain,
858
859
  close: !0
859
860
  }
860
861
  }).onPrimary(async () => {
@@ -863,24 +864,24 @@ const xt = ve("transferTemplateActions", () => {
863
864
  type: "info"
864
865
  });
865
866
  try {
866
- s.value = !0;
867
- const [b] = await Promise.allSettled([
868
- o.deleteTemplate(p),
869
- new Promise((k) => setTimeout(k, 1e3))
867
+ i.value = !0;
868
+ const [g] = await Promise.allSettled([
869
+ a.deleteTemplate(p),
870
+ new Promise((w) => setTimeout(w, 1e3))
870
871
  ]);
871
- if (b.status === "rejected") throw b.reason;
872
+ if (g.status === "rejected") throw g.reason;
872
873
  t.open({
873
874
  title: `Deleted ${p.name}`,
874
875
  type: "success"
875
876
  });
876
- } catch (b) {
877
+ } catch (g) {
877
878
  t.open({
878
879
  title: `Unable to delete ${p.name}`,
879
- message: `See error from server: ${b}`,
880
+ message: `See error from server: ${g}`,
880
881
  type: "error"
881
- }), console.error("error on deleting purchase order template", b);
882
+ }), console.error("error on deleting purchase order template", g);
882
883
  } finally {
883
- s.value = !1, d();
884
+ i.value = !1, u();
884
885
  }
885
886
  });
886
887
  }
@@ -889,24 +890,24 @@ const xt = ve("transferTemplateActions", () => {
889
890
  m.value = {
890
891
  template: p,
891
892
  show: !0,
892
- "onUpdate:show"(s) {
893
- m.value.show = s;
893
+ "onUpdate:show"(i) {
894
+ m.value.show = i;
894
895
  },
895
896
  "onAction:edit"() {
896
- m.value.show = !1, y(J(p));
897
+ m.value.show = !1, h(X(p));
897
898
  }
898
899
  };
899
900
  }
900
901
  function x() {
901
- const { promise: p, resolve: s } = Promise.withResolvers(), d = (g) => {
902
- s(g);
903
- }, b = c.templates.filter(
904
- (g) => {
905
- var N;
906
- return (!g.locations || g.locations.find((D) => D.doc._id === a.currentLocation.doc._id)) && ((N = g.purchaseOrder.supplier) == null ? void 0 : N._id) !== a.currentLocation.doc._id;
902
+ const { promise: p, resolve: i } = Promise.withResolvers(), u = (b) => {
903
+ i(b);
904
+ }, g = c.templates.filter(
905
+ (b) => {
906
+ var A;
907
+ return (!b.locations || b.locations.find((O) => O.doc._id === s.currentLocation.doc._id)) && ((A = b.purchaseOrder.supplier) == null ? void 0 : A._id) !== s.currentLocation.doc._id;
907
908
  }
908
909
  );
909
- if (!b.length)
910
+ if (!g.length)
910
911
  return e.open({
911
912
  title: "Select one template",
912
913
  message: "There is no available template in your business. Configure a new template?",
@@ -919,26 +920,26 @@ const xt = ve("transferTemplateActions", () => {
919
920
  close: !0
920
921
  }
921
922
  }).onPrimary(() => {
922
- h.push({ name: ae.TRANSFER_TEMPLATE }), d(void 0);
923
- }).onSecondary(() => d(void 0)).onClose(() => d(void 0)), p;
924
- const k = b.map((g) => {
925
- var re;
926
- const N = !g.purchaseOrder.items.length || g.purchaseOrder.items.some(xe), D = !bt(g.purchaseOrder.supplier), K = g.purchaseOrder.supplier.internal ? n.getNetSuiteLocation(
927
- `${g.purchaseOrder.supplier.internal}_${g.purchaseOrder.supplier._id}`
928
- ) : n.getNetSuiteVendor(g.purchaseOrder.supplier._id), we = D ? `The subsidiary of the request
929
- location is ${(re = n.getLocationSubsidiary(K == null ? void 0 : K.netSuiteId)) == null ? void 0 : re.fullName}.` : void 0, ke = N || D, Ce = N ? "This template is invalid. Update this template." : D ? we : void 0, Ee = `${g.purchaseOrder.supplier.internal ? "Transfer" : "Purchase"} from ${g.purchaseOrder.supplier.name}`;
923
+ f.push({ name: se.TRANSFER_TEMPLATE }), u(void 0);
924
+ }).onSecondary(() => u(void 0)).onClose(() => u(void 0)), p;
925
+ const w = g.map((b) => {
926
+ var ne;
927
+ const A = !b.purchaseOrder.items.length || b.purchaseOrder.items.some(xe), O = !bt(b.purchaseOrder.supplier), K = b.purchaseOrder.supplier.internal ? n.getNetSuiteLocation(
928
+ `${b.purchaseOrder.supplier.internal}_${b.purchaseOrder.supplier._id}`
929
+ ) : n.getNetSuiteVendor(b.purchaseOrder.supplier._id), we = O ? `The subsidiary of the request
930
+ location is ${(ne = n.getLocationSubsidiary(K == null ? void 0 : K.netSuiteId)) == null ? void 0 : ne.fullName}.` : void 0, ke = A || O, Ce = A ? "This template is invalid. Update this template." : O ? we : void 0, Ee = `${b.purchaseOrder.supplier.internal ? "Transfer" : "Purchase"} from ${b.purchaseOrder.supplier.name}`;
930
931
  return {
931
- label: g.name,
932
- value: g._id,
932
+ label: b.name,
933
+ value: b._id,
933
934
  disabled: ke,
934
935
  sublabel: Ce ?? Ee
935
936
  };
936
937
  });
937
- return k.sort((g, N) => +!!g.disabled - +!!N.disabled), e.open({
938
+ return w.sort((b, A) => +!!b.disabled - +!!A.disabled), e.open({
938
939
  title: "Select one template",
939
940
  contentComponent: Be,
940
941
  contentComponentProps: {
941
- items: k,
942
+ items: w,
942
943
  singleSelect: !0
943
944
  },
944
945
  primaryActions: {
@@ -953,87 +954,87 @@ const xt = ve("transferTemplateActions", () => {
953
954
  text: "Templates",
954
955
  close: !0
955
956
  }
956
- }).onPrimary((g) => Array.isArray(g) ? d(g[0]) : null).onSecondary(() => d(void 0)).onTertiary(() => {
957
- h.push({ name: ae.TRANSFER_TEMPLATE }), d(void 0);
958
- }).onClose(() => d(void 0)), p;
957
+ }).onPrimary((b) => Array.isArray(b) ? u(b[0]) : null).onSecondary(() => u(void 0)).onTertiary(() => {
958
+ f.push({ name: se.TRANSFER_TEMPLATE }), u(void 0);
959
+ }).onClose(() => u(void 0)), p;
959
960
  }
960
961
  function r() {
961
962
  e.open({
962
- title: i("inventory.ingredient.import.title"),
963
+ title: o("inventory.ingredient.import.title"),
963
964
  contentComponent: gt,
964
965
  overlay: !0,
965
966
  closeButton: !0,
966
967
  primaryActions: {
967
- text: i("common.import"),
968
+ text: o("common.import"),
968
969
  close: !1
969
970
  },
970
971
  secondaryActions: {
971
- text: i("common.close"),
972
+ text: o("common.close"),
972
973
  close: !0
973
974
  },
974
975
  tertiaryActions: {
975
- text: i("inventory.ingredient.import.actions.downloadTemplate"),
976
+ text: o("inventory.ingredient.import.actions.downloadTemplate"),
976
977
  close: !1,
977
978
  variant: "plain"
978
979
  }
979
980
  }).onPrimary((p) => {
980
981
  if (!p) {
981
982
  t.open({
982
- title: i("inventory.ingredient.import.error.noData"),
983
+ title: o("inventory.ingredient.import.error.noData"),
983
984
  type: "error"
984
985
  });
985
986
  return;
986
987
  }
987
988
  if (!p.importCreateResult.length && !p.importUpdateResult.length) {
988
989
  t.open({
989
- title: i("inventory.ingredient.import.error.invalidContent"),
990
- message: i("inventory.ingredient.import.error.noImportData"),
990
+ title: o("inventory.ingredient.import.error.invalidContent"),
991
+ message: o("inventory.ingredient.import.error.noImportData"),
991
992
  type: "error"
992
993
  });
993
994
  return;
994
995
  }
995
- if (p.importCreateResult.some((s) => s.errors.length) || p.importUpdateResult.some((s) => s.errors.length)) {
996
+ if (p.importCreateResult.some((i) => i.errors.length) || p.importUpdateResult.some((i) => i.errors.length)) {
996
997
  t.open({
997
- title: i("inventory.ingredient.import.error.invalidContent"),
998
- message: i("inventory.ingredient.import.error.hasErrors"),
998
+ title: o("inventory.ingredient.import.error.invalidContent"),
999
+ message: o("inventory.ingredient.import.error.hasErrors"),
999
1000
  type: "error"
1000
1001
  });
1001
1002
  return;
1002
1003
  }
1003
1004
  e.close(), S(p);
1004
- }).onTertiary(Ge);
1005
+ }).onTertiary(Ye);
1005
1006
  }
1006
1007
  async function S(p) {
1007
1008
  try {
1008
- const s = [
1009
+ const i = [
1009
1010
  ...p.importCreateResult.map(
1010
- (g) => g.template
1011
+ (b) => b.template
1011
1012
  ),
1012
1013
  ...p.importUpdateResult.map(
1013
- (g) => g.template
1014
+ (b) => b.template
1014
1015
  )
1015
- ], d = 100;
1016
- let b = 0;
1017
- const k = () => {
1018
- b += d, t.open({
1019
- title: i("inventory.ingredient.import.progress", [
1020
- Math.min(b, s.length),
1021
- s.length
1016
+ ], u = 100;
1017
+ let g = 0;
1018
+ const w = () => {
1019
+ g += u, t.open({
1020
+ title: o("inventory.ingredient.import.progress", [
1021
+ Math.min(g, i.length),
1022
+ i.length
1022
1023
  ])
1023
1024
  });
1024
1025
  };
1025
- for (const g of s.chunk(100))
1026
- k(), await o.importTemplates(g);
1026
+ for (const b of i.chunk(100))
1027
+ w(), await a.importTemplates(b);
1027
1028
  t.open({
1028
- title: i("inventory.ingredient.import.success"),
1029
+ title: o("inventory.ingredient.import.success"),
1029
1030
  type: "success"
1030
1031
  });
1031
- } catch (s) {
1032
+ } catch (i) {
1032
1033
  t.open({
1033
- title: i("inventory.ingredient.import.error.failed"),
1034
- message: i("inventory.ingredient.import.error.systemMessage", [s == null ? void 0 : s.message]),
1034
+ title: o("inventory.ingredient.import.error.failed"),
1035
+ message: o("inventory.ingredient.import.error.systemMessage", [i == null ? void 0 : i.message]),
1035
1036
  type: "error"
1036
- }), console.error("Error in importing skus", p, s);
1037
+ }), console.error("Error in importing skus", p, i);
1037
1038
  } finally {
1038
1039
  c.fetchTemplates();
1039
1040
  }
@@ -1041,16 +1042,16 @@ const xt = ve("transferTemplateActions", () => {
1041
1042
  function _() {
1042
1043
  const p = We(c.templates);
1043
1044
  t.open({
1044
- title: i("inventory.ingredient.export.success"),
1045
- message: i("inventory.ingredient.export.filename", [p]),
1045
+ title: o("inventory.ingredient.export.success"),
1046
+ message: o("inventory.ingredient.export.filename", [p]),
1046
1047
  type: "success"
1047
1048
  });
1048
1049
  }
1049
1050
  return {
1050
- createTemplate: u,
1051
+ createTemplate: d,
1051
1052
  viewTemplate: v,
1052
- updateTemplate: y,
1053
- deleteTemplate: f,
1053
+ updateTemplate: h,
1054
+ deleteTemplate: y,
1054
1055
  getTemplateId: x,
1055
1056
  importTemplates: r,
1056
1057
  exportTemplates: _,
@@ -1058,34 +1059,34 @@ const xt = ve("transferTemplateActions", () => {
1058
1059
  templateDetailsProps: m
1059
1060
  };
1060
1061
  });
1061
- function ue(e) {
1062
- const { skuById: t } = Q(), a = J(e);
1063
- return a.purchaseOrder.items = e.purchaseOrder.items.filter((c) => t[c.sku._id]), a;
1062
+ function de(e) {
1063
+ const { skuById: t } = Q(), s = X(e);
1064
+ return s.purchaseOrder.items = e.purchaseOrder.items.filter((c) => t[c.sku._id]), s;
1064
1065
  }
1065
1066
  const $e = ve(
1066
1067
  "transferTemplateTable",
1067
1068
  function() {
1068
- const { t } = Z(), a = xt(), c = C(!1), o = C(new Array()), n = be(), h = Q();
1069
- async function i() {
1070
- o.value = [], c.value = !0;
1069
+ const { t } = ee(), s = xt(), c = C(!1), a = C(new Array()), n = be(), f = Q();
1070
+ async function o() {
1071
+ a.value = [], c.value = !0;
1071
1072
  try {
1072
- const [f] = await Promise.all([
1073
+ const [y] = await Promise.all([
1073
1074
  n.readTemplates(),
1074
- h.readInventory()
1075
+ f.readInventory()
1075
1076
  ]).delayed(1e3);
1076
- o.value = f.map(ue);
1077
- } catch (f) {
1078
- console.log("Something went wrong when fetching templates:", f);
1077
+ a.value = y.map(de);
1078
+ } catch (y) {
1079
+ console.log("Something went wrong when fetching templates:", y);
1079
1080
  } finally {
1080
1081
  c.value = !1;
1081
1082
  }
1082
1083
  }
1083
- async function l(f) {
1084
- if (!o.value.find((m) => m._id)) {
1084
+ async function l(y) {
1085
+ if (!a.value.find((m) => m._id)) {
1085
1086
  c.value = !0;
1086
1087
  try {
1087
- o.value = [
1088
- await n.getTemplate(f).then(ue).delayed(1e3)
1088
+ a.value = [
1089
+ await n.getTemplate(y).then(de).delayed(1e3)
1089
1090
  ];
1090
1091
  } catch (m) {
1091
1092
  console.log("Something went wrong when fetching templates:", m);
@@ -1094,14 +1095,14 @@ const $e = ve(
1094
1095
  }
1095
1096
  }
1096
1097
  }
1097
- function u(f, m) {
1098
- switch (m = J(m), f) {
1099
- case A.Details:
1100
- return a.viewTemplate(m);
1101
- case A.Edit:
1102
- return a.updateTemplate(m);
1103
- case A.Delete:
1104
- return a.deleteTemplate(m, c, i);
1098
+ function d(y, m) {
1099
+ switch (m = X(m), y) {
1100
+ case N.Details:
1101
+ return s.viewTemplate(m);
1102
+ case N.Edit:
1103
+ return s.updateTemplate(m);
1104
+ case N.Delete:
1105
+ return s.deleteTemplate(m, c, o);
1105
1106
  }
1106
1107
  }
1107
1108
  return {
@@ -1110,8 +1111,8 @@ const $e = ve(
1110
1111
  id: "_id",
1111
1112
  accessorKey: "_id",
1112
1113
  header: () => t("inventory.transfer.table.createdAt"),
1113
- cell(f) {
1114
- return Me(`${f.getValue()}`);
1114
+ cell(y) {
1115
+ return Me(`${y.getValue()}`);
1115
1116
  },
1116
1117
  enableSorting: !0
1117
1118
  },
@@ -1131,18 +1132,18 @@ const $e = ve(
1131
1132
  width: "10rem",
1132
1133
  textAlign: "right"
1133
1134
  },
1134
- cell(f) {
1135
- const m = Number(f.getValue()) || 0, v = f.row.original.purchaseOrder.items.some(xe);
1136
- return m === 0 || v ? G("div", { class: "flex justify-end gap-4 items-center" }, [
1137
- G(
1138
- ie.FmTooltip,
1135
+ cell(y) {
1136
+ const m = Number(y.getValue()) || 0, v = y.row.original.purchaseOrder.items.some(xe);
1137
+ return m === 0 || v ? Y("div", { class: "flex justify-end gap-4 items-center" }, [
1138
+ Y(
1139
+ le.FmTooltip,
1139
1140
  {},
1140
1141
  {
1141
1142
  content() {
1142
1143
  return v ? "The template is invalid due to invalid unit on some of the items. Please update this template." : "The template is invalid due to deleted ingredients. Please update this template.";
1143
1144
  },
1144
1145
  default() {
1145
- return G(ie.FmIcon, {
1146
+ return Y(le.FmIcon, {
1146
1147
  name: "error",
1147
1148
  color: "system-error-300",
1148
1149
  size: "sm"
@@ -1158,9 +1159,9 @@ const $e = ve(
1158
1159
  id: "enabledLocations",
1159
1160
  accessorKey: "purchaseOrder.locations.length",
1160
1161
  header: () => "Enabled outlets",
1161
- cell(f) {
1162
+ cell(y) {
1162
1163
  var v;
1163
- const m = (v = f.row.original.locations) == null ? void 0 : v.length;
1164
+ const m = (v = y.row.original.locations) == null ? void 0 : v.length;
1164
1165
  return m ? `${m}` : "All";
1165
1166
  },
1166
1167
  enableSorting: !1,
@@ -1178,13 +1179,13 @@ const $e = ve(
1178
1179
  },
1179
1180
  {
1180
1181
  id: "action",
1181
- cell(f) {
1182
- const m = f.row.original, v = [
1183
- W[A.Details],
1184
- W[A.Edit],
1185
- W[A.Delete]
1182
+ cell(y) {
1183
+ const m = y.row.original, v = [
1184
+ W[N.Details],
1185
+ W[N.Edit],
1186
+ W[N.Delete]
1186
1187
  ];
1187
- return Le(v, (x) => u(x, m));
1188
+ return Le(v, (x) => d(x, m));
1188
1189
  },
1189
1190
  enableSorting: !1,
1190
1191
  size: 40,
@@ -1194,15 +1195,15 @@ const $e = ve(
1194
1195
  }
1195
1196
  }
1196
1197
  ],
1197
- templates: o,
1198
+ templates: a,
1198
1199
  loading: c,
1199
- fetchTemplates: i,
1200
+ fetchTemplates: o,
1200
1201
  loadTemplate: l
1201
1202
  };
1202
1203
  }
1203
1204
  );
1204
- function Rt(e, t, a) {
1205
- const c = (a == null ? void 0 : a.abbrev) ?? t.abbrev;
1205
+ function Rt(e, t, s) {
1206
+ const c = (s == null ? void 0 : s.abbrev) ?? t.abbrev;
1206
1207
  return `${P(e, !1)} ${c}`;
1207
1208
  }
1208
1209
  export {