@feedmepos/mf-inventory-portal 0.0.17-dev.9 → 0.0.18-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 (53) hide show
  1. package/dist/ApprovalView-G-u9nPxH.js +118 -0
  2. package/dist/{BindingsDialog-Dw_DCOTY.js → BindingsDialog-CVeD1mOn.js} +2 -2
  3. package/dist/{BindingsPicker-BRLTF4Qs.js → BindingsPicker-K04aOoGr.js} +2 -2
  4. package/dist/BindingsTable-65aYkpX7.js +147 -0
  5. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DgHp7KgJ.js +268 -0
  6. package/dist/{FmMultiselectDialog.vue_vue_type_script_setup_true_lang-YzVhmNJc.js → FmMultiselectDialog.vue_vue_type_script_setup_true_lang-C5WBLEy3.js} +2 -2
  7. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-Dv01gy7k.js → FmUnitInput.vue_vue_type_script_setup_true_lang-QKFZeZKM.js} +12 -12
  8. package/dist/IngredientsView-6Q2UWsu-.js +1776 -0
  9. package/dist/{IntegrationView-Xnl758CS.js → IntegrationView-ZMPPIopU.js} +260 -266
  10. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CUj9Mnt6.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-C8YTZoBw.js} +6 -6
  11. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CW0h41FP.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-kidodonU.js} +1 -1
  12. package/dist/{PurchaseOrderPrintPreview-DzimxkGt.js → PurchaseOrderPrintPreview-B4uzudnC.js} +1 -1
  13. package/dist/ReceiveRequestView-DuHtLwZN.js +1394 -0
  14. package/dist/{RecipeView-B9NcEw7x.js → RecipeView-CRj0pC9N.js} +182 -190
  15. package/dist/StockView-CQbeZ5pU.js +1862 -0
  16. package/dist/SupplierView-CrfQATQf.js +796 -0
  17. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BSwsz8Xt.js → TransferDetails.vue_vue_type_script_setup_true_lang-CLUo-Tve.js} +21 -20
  18. package/dist/{UnitView-BvbaRHxG.js → UnitView-D1acjiRV.js} +129 -133
  19. package/dist/{WarehouseView-Cf5Bmfhn.js → WarehouseView-DID1G1qK.js} +260 -264
  20. package/dist/app-D1teOEQX.js +66113 -0
  21. package/dist/app.js +1 -1
  22. package/dist/array-AvWd53LI.js +30 -0
  23. package/dist/components/FmInventoryTableToolbar.vue.d.ts +53 -0
  24. package/dist/date2-6Vt_hnAG.js +95 -0
  25. package/dist/dayjs.min-Co7-8-Mb.js +282 -0
  26. package/dist/{decimal-S-jYTEL5.js → decimal-ziY3648r.js} +1 -1
  27. package/dist/extensions/array.d.ts +1 -0
  28. package/dist/{fuzzy-DW00BX8H.js → fuzzy-gvHXFsh0.js} +1 -1
  29. package/dist/{dayjs.min-M4PEyOKN.js → index-Do1KDD1S.js} +3594 -3356
  30. package/dist/{layout-DACHKQ9G.js → layout-BxDEsp4a.js} +1 -1
  31. package/dist/number-Dvvpk3SV.js +97 -0
  32. package/dist/{rules-ldw61cGA.js → rules-CQu9yXsg.js} +16 -15
  33. package/dist/stock-estimate-Wysv30cx.js +122 -0
  34. package/dist/{supplier-DjKC4TaM.js → supplier-BFdAYn3E.js} +1 -1
  35. package/dist/tsconfig.app.tsbuildinfo +1 -1
  36. package/dist/{use-inventory-binding-dialog-D1M09VoX.js → use-inventory-binding-dialog-CuyOzZ5r.js} +2 -2
  37. package/dist/views/ingredients/IngredientsView.vue.d.ts +1 -0
  38. package/dist/{xlsx-BcM9fWkc.js → xlsx-BG4CsaGF.js} +1 -1
  39. package/dist/{xlsx.util-BNXjhkYU.js → xlsx.util-BkVYceD0.js} +2 -2
  40. package/package.json +4 -4
  41. package/dist/ApprovalView-BJ_SGOrx.js +0 -134
  42. package/dist/BindingsTable-BMIkL0Bk.js +0 -121
  43. package/dist/ChangeLocationComponent.vue_vue_type_script_setup_true_lang-D9Qp3jke.js +0 -97
  44. package/dist/IngredientsView-DYFkUsHx.js +0 -1802
  45. package/dist/ReceiveRequestView-C_0jK6GY.js +0 -1435
  46. package/dist/SingleColumnLayout.vue_vue_type_script_setup_true_lang-Dov3Uq2z.js +0 -64
  47. package/dist/StockView-JPw1K8aU.js +0 -1960
  48. package/dist/SupplierView-CiQLFWmQ.js +0 -804
  49. package/dist/app-BbXzmbBO.js +0 -42892
  50. package/dist/components/FmTableToolbar.vue.d.ts +0 -49
  51. package/dist/date2-DFqSdEvG.js +0 -189
  52. package/dist/init-date-range-B_ha80e0.js +0 -21
  53. package/dist/stock-estimate-DOP1qO5w.js +0 -145
@@ -1,13 +1,13 @@
1
- import { ref as D, defineComponent as q, watch as Y, onMounted as oe, onUnmounted as Me, openBlock as T, createElementBlock as B, toRaw as be, reactive as Se, createElementVNode as g, toDisplayString as X, createVNode as k, pushScopeId as Fe, popScopeId as De, resolveComponent as U, unref as C, createSlots as Pe, withCtx as I, createTextVNode as Te, renderSlot as Ee, createBlock as N, createCommentVNode as xe, computed as F, isRef as we, normalizeStyle as Re } from "vue";
2
- import { h as We, k as Ue, l as Le, c as z, m as te, n as ae, o as Ie, _ as Be, f as Ne } from "./app-BbXzmbBO.js";
3
- import { useCoreStore as qe } from "@feedmepos/mf-common";
4
- import { D as Ve, R as Z, F as R } from "./row-action.enum-BwQbURNh.js";
5
- import { c as ze, _ as je, F as J, u as Oe } from "./layout-DACHKQ9G.js";
6
- import { _ as Ge } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-Dov3Uq2z.js";
1
+ import { ref as F, defineComponent as q, watch as Y, onMounted as oe, onUnmounted as $e, openBlock as R, createElementBlock as B, toRaw as ve, reactive as Se, createElementVNode as v, toDisplayString as X, createVNode as k, pushScopeId as Me, popScopeId as De, resolveComponent as L, unref as A, createSlots as Fe, withCtx as I, createTextVNode as Pe, renderSlot as Ee, createBlock as N, createCommentVNode as ke, computed as D, isRef as be, normalizeStyle as Re } from "vue";
2
+ import { h as We, k as Te, l as Ue, c as z, m as te, n as ae, o as Le, _ as Ie, f as Be } from "./app-D1teOEQX.js";
3
+ import { useCoreStore as Ne } from "@feedmepos/mf-common";
4
+ import { D as we, R as Z, F as W } from "./row-action.enum-BwQbURNh.js";
5
+ import { c as qe, _ as ze, F as J, u as je } from "./layout-BxDEsp4a.js";
6
+ import { _ as Oe, a as Ge } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DgHp7KgJ.js";
7
7
  import { useDialogChild as Ke, useDialog as Ce, useSnackbar as le, useProxiedModel as ee, useBreakpoints as He } from "@feedmepos/ui-library";
8
- import { R as L } from "./rules-ldw61cGA.js";
8
+ import { R as U } from "./rules-CQu9yXsg.js";
9
9
  const Q = We((u, c) => {
10
- const p = qe();
10
+ const p = Ne();
11
11
  return {
12
12
  async readWarehouses() {
13
13
  var r;
@@ -36,15 +36,15 @@ function Ze() {
36
36
  warehouses: []
37
37
  };
38
38
  }
39
- const _e = D(Ze());
39
+ const Ve = F(Ze());
40
40
  function Ae() {
41
41
  return {
42
42
  // state
43
43
  get warehouses() {
44
- return _e.value.warehouses;
44
+ return Ve.value.warehouses;
45
45
  },
46
46
  set warehouses(u) {
47
- _e.value.warehouses = u;
47
+ Ve.value.warehouses = u;
48
48
  },
49
49
  // actions
50
50
  async readWarehouses() {
@@ -61,11 +61,11 @@ function Ae() {
61
61
  await Q().deleteWarehouse(u._id);
62
62
  },
63
63
  async init() {
64
- const u = Ue();
64
+ const u = Te();
65
65
  try {
66
66
  await this.readWarehouses();
67
67
  } catch (c) {
68
- throw c instanceof Le || u.error("Error at reading warehouses"), c;
68
+ throw c instanceof Ue || u.error("Error at reading warehouses"), c;
69
69
  }
70
70
  }
71
71
  };
@@ -106,8 +106,8 @@ function Je(u, c) {
106
106
  id: "action",
107
107
  header: "",
108
108
  cell(r) {
109
- return ze(
110
- [Ve[Z.Edit], Ve[Z.Delete]],
109
+ return qe(
110
+ [we[Z.Edit], we[Z.Delete]],
111
111
  (n) => {
112
112
  p(n, r.row.original.original);
113
113
  }
@@ -136,7 +136,7 @@ function Je(u, c) {
136
136
  s == null ? void 0 : s.postcode,
137
137
  s == null ? void 0 : s.state,
138
138
  s == null ? void 0 : s.country
139
- ].map((y) => y == null ? void 0 : y.trim()).filter((y) => y).join(", ");
139
+ ].map((g) => g == null ? void 0 : g.trim()).filter((g) => g).join(", ");
140
140
  }
141
141
  }));
142
142
  }
@@ -171,49 +171,49 @@ const Qe = /* @__PURE__ */ q({
171
171
  const l = u, a = p;
172
172
  c({
173
173
  setCenter: (i) => {
174
- var m, V;
175
- (m = s.value) == null || m.setCenter(i), (V = s.value) == null || V.setZoom(18);
174
+ var m, y;
175
+ (m = s.value) == null || m.setCenter(i), (y = s.value) == null || y.setZoom(18);
176
176
  }
177
177
  });
178
- const { googleMap: r } = ae(), n = D(), s = D(null), A = [];
179
- function y(i) {
178
+ const { googleMap: r } = ae(), n = F(), s = F(null), x = [];
179
+ function g(i) {
180
180
  return {
181
181
  lat: i.latLng.lat(),
182
182
  lng: i.latLng.lng()
183
183
  };
184
184
  }
185
- function w(i, m, V) {
186
- const M = r.maps.event.addListener(i, m, V);
187
- A.push(M);
185
+ function V(i, m, y) {
186
+ const M = r.maps.event.addListener(i, m, y);
187
+ x.push(M);
188
188
  }
189
- const _ = D([]);
190
- function v(i, m, V) {
191
- w(i, m, V);
189
+ const _ = F([]);
190
+ function b(i, m, y) {
191
+ V(i, m, y);
192
192
  }
193
193
  function S(i) {
194
- d(null), _.value = i.map((m, V) => {
194
+ d(null), _.value = i.map((m, y) => {
195
195
  const M = new r.maps.Marker({
196
196
  position: m,
197
197
  draggable: !0
198
198
  });
199
- return v(M, "dragend", (W) => {
200
- a("marker-change", { index: V, position: y(W) });
199
+ return b(M, "dragend", (T) => {
200
+ a("marker-change", { index: y, position: g(T) });
201
201
  }), M;
202
202
  }), d(s.value);
203
203
  }
204
204
  function d(i) {
205
- _.value.map((m) => be(m).setMap(i));
205
+ _.value.map((m) => ve(m).setMap(i));
206
206
  }
207
- const x = D([]);
208
- function $(i, m, V) {
209
- w(i, m, V);
207
+ const C = F([]);
208
+ function $(i, m, y) {
209
+ V(i, m, y);
210
210
  }
211
- function o(i, m, V) {
212
- w(i, m, V);
211
+ function o(i, m, y) {
212
+ V(i, m, y);
213
213
  }
214
214
  function e(i) {
215
- return x.value[i].getPath().getArray().map(({ lat: V, lng: M }) => ({
216
- lat: V(),
215
+ return C.value[i].getPath().getArray().map(({ lat: y, lng: M }) => ({
216
+ lat: y(),
217
217
  lng: M()
218
218
  }));
219
219
  }
@@ -221,15 +221,15 @@ const Qe = /* @__PURE__ */ q({
221
221
  const m = e(i);
222
222
  a("polygon-change", { index: i, path: m });
223
223
  }
224
- function b(i, m) {
225
- const M = e(i).filter((W, O) => O !== m);
224
+ function w(i, m) {
225
+ const M = e(i).filter((T, O) => O !== m);
226
226
  a("polygon-change", { index: i, path: M });
227
227
  }
228
228
  function h(i, m) {
229
- m.vertex !== void 0 ? b(i, m.vertex) : a("polygon-right-click", i);
229
+ m.vertex !== void 0 ? w(i, m.vertex) : a("polygon-right-click", i);
230
230
  }
231
231
  function f(i) {
232
- j(null), x.value = i.map((m, V) => {
232
+ P(null), C.value = i.map((m, y) => {
233
233
  const M = new r.maps.Polygon({
234
234
  paths: m.paths,
235
235
  strokeColor: m.strokeColor,
@@ -237,18 +237,18 @@ const Qe = /* @__PURE__ */ q({
237
237
  fillOpacity: 0.5,
238
238
  editable: l.editable
239
239
  });
240
- return $(M, "contextmenu", (W) => h(V, W)), M.getPaths().forEach((W) => {
241
- o(W, "insert_at", () => t(V)), o(W, "set_at", () => t(V));
240
+ return $(M, "contextmenu", (T) => h(y, T)), M.getPaths().forEach((T) => {
241
+ o(T, "insert_at", () => t(y)), o(T, "set_at", () => t(y));
242
242
  }), M;
243
- }), j(s.value);
243
+ }), P(s.value);
244
244
  }
245
- function j(i) {
246
- x.value.map((m) => be(m).setMap(i));
245
+ function P(i) {
246
+ C.value.map((m) => ve(m).setMap(i));
247
247
  }
248
- function E(i, m, V) {
249
- w(i, m, V);
248
+ function E(i, m, y) {
249
+ V(i, m, y);
250
250
  }
251
- function P() {
251
+ function j() {
252
252
  s.value = new r.maps.Map(n.value, {
253
253
  center: l.center,
254
254
  zoom: l.zoom,
@@ -256,13 +256,13 @@ const Qe = /* @__PURE__ */ q({
256
256
  streetViewControl: !1,
257
257
  draggable: !0,
258
258
  scrollwheel: !0
259
- }), E(s.value, "click", (i) => a("map-click", y(i)));
259
+ }), E(s.value, "click", (i) => a("map-click", g(i)));
260
260
  }
261
261
  return Y(() => l.markers, S, { deep: !0 }), Y(() => l.polygons, f, { deep: !0 }), oe(() => {
262
- !n.value || !r || (P(), S(l.markers), f(l.polygons));
263
- }), Me(() => {
264
- A.forEach((i) => i.remove());
265
- }), (i, m) => (T(), B("div", {
262
+ !n.value || !r || (j(), S(l.markers), f(l.polygons));
263
+ }), $e(() => {
264
+ x.forEach((i) => i.remove());
265
+ }), (i, m) => (R(), B("div", {
266
266
  ref_key: "mapRef",
267
267
  ref: n,
268
268
  class: "map app-map"
@@ -270,46 +270,46 @@ const Qe = /* @__PURE__ */ q({
270
270
  }
271
271
  });
272
272
  var se = { exports: {} };
273
- function $e(u, c = 100, p = {}) {
273
+ function xe(u, c = 100, p = {}) {
274
274
  if (typeof u != "function")
275
275
  throw new TypeError(`Expected the first parameter to be a function, got \`${typeof u}\`.`);
276
276
  if (c < 0)
277
277
  throw new RangeError("`wait` must not be negative.");
278
278
  const { immediate: l } = typeof p == "boolean" ? { immediate: p } : p;
279
- let a, r, n, s, A;
280
- function y() {
279
+ let a, r, n, s, x;
280
+ function g() {
281
281
  const _ = Date.now() - s;
282
282
  if (_ < c && _ >= 0)
283
- n = setTimeout(y, c - _);
283
+ n = setTimeout(g, c - _);
284
284
  else if (n = void 0, !l) {
285
- const v = a, S = r;
286
- a = void 0, r = void 0, A = u.apply(v, S);
285
+ const b = a, S = r;
286
+ a = void 0, r = void 0, x = u.apply(b, S);
287
287
  }
288
288
  }
289
- const w = function(..._) {
289
+ const V = function(..._) {
290
290
  if (a && this !== a)
291
291
  throw new Error("Debounced method called with different contexts.");
292
292
  a = this, r = _, s = Date.now();
293
- const v = l && !n;
294
- if (n || (n = setTimeout(y, c)), v) {
293
+ const b = l && !n;
294
+ if (n || (n = setTimeout(g, c)), b) {
295
295
  const S = a, d = r;
296
- a = void 0, r = void 0, A = u.apply(S, d);
296
+ a = void 0, r = void 0, x = u.apply(S, d);
297
297
  }
298
- return A;
298
+ return x;
299
299
  };
300
- return w.clear = () => {
300
+ return V.clear = () => {
301
301
  n && (clearTimeout(n), n = void 0);
302
- }, w.flush = () => {
302
+ }, V.flush = () => {
303
303
  if (!n)
304
304
  return;
305
- const _ = a, v = r;
306
- a = void 0, r = void 0, A = u.apply(_, v), clearTimeout(n), n = void 0;
307
- }, w;
305
+ const _ = a, b = r;
306
+ a = void 0, r = void 0, x = u.apply(_, b), clearTimeout(n), n = void 0;
307
+ }, V;
308
308
  }
309
- se.exports.debounce = $e;
310
- se.exports = $e;
309
+ se.exports.debounce = xe;
310
+ se.exports = xe;
311
311
  var Xe = se.exports;
312
- const Ye = /* @__PURE__ */ Ie(Xe), ne = (u) => (Fe("data-v-ea67d23a"), u = u(), De(), u), eo = { class: "flex flex-col gap-24" }, oo = { class: "flex flex-col gap-8" }, to = /* @__PURE__ */ ne(() => /* @__PURE__ */ g("span", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Address: ", -1)), ao = { class: "fm-typo-en-body-lg-600" }, lo = /* @__PURE__ */ ne(() => /* @__PURE__ */ g("span", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Longitude: ", -1)), so = { class: "fm-typo-en-body-lg-600" }, no = /* @__PURE__ */ ne(() => /* @__PURE__ */ g("span", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Latitude: ", -1)), ro = { class: "fm-typo-en-body-lg-600" }, uo = /* @__PURE__ */ q({
312
+ const Ye = /* @__PURE__ */ Le(Xe), ne = (u) => (Me("data-v-ea67d23a"), u = u(), De(), u), eo = { class: "flex flex-col gap-24" }, oo = { class: "flex flex-col gap-8" }, to = /* @__PURE__ */ ne(() => /* @__PURE__ */ v("span", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Address: ", -1)), ao = { class: "fm-typo-en-body-lg-600" }, lo = /* @__PURE__ */ ne(() => /* @__PURE__ */ v("span", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Longitude: ", -1)), so = { class: "fm-typo-en-body-lg-600" }, no = /* @__PURE__ */ ne(() => /* @__PURE__ */ v("span", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Latitude: ", -1)), ro = { class: "fm-typo-en-body-lg-600" }, uo = /* @__PURE__ */ q({
313
313
  __name: "CoordinateDialog",
314
314
  props: {
315
315
  address: {
@@ -324,7 +324,7 @@ const Ye = /* @__PURE__ */ Ie(Xe), ne = (u) => (Fe("data-v-ea67d23a"), u = u(),
324
324
  setup(u) {
325
325
  const c = u, p = Ke(), l = ae(), a = Se(
326
326
  z(c.coordinate ? c.coordinate : te.jb)
327
- ), r = D(""), n = Ye(async function() {
327
+ ), r = F(""), n = Ye(async function() {
328
328
  r.value = await l.getFirstMatchingAddress(
329
329
  a.lat,
330
330
  a.lng
@@ -333,39 +333,39 @@ const Ye = /* @__PURE__ */ Ie(Xe), ne = (u) => (Fe("data-v-ea67d23a"), u = u(),
333
333
  oe(() => {
334
334
  p.emitData(z(a)), n();
335
335
  });
336
- function s({ position: y }) {
337
- a.lat = y.lat, a.lng = y.lng, p.emitData(z(a)), n();
336
+ function s({ position: g }) {
337
+ a.lat = g.lat, a.lng = g.lng, p.emitData(z(a)), n();
338
338
  }
339
- const A = D();
340
- return (y, w) => (T(), B("div", eo, [
341
- g("div", oo, [
342
- g("div", null, [
339
+ const x = F();
340
+ return (g, V) => (R(), B("div", eo, [
341
+ v("div", oo, [
342
+ v("div", null, [
343
343
  to,
344
- g("span", ao, X(r.value), 1)
344
+ v("span", ao, X(r.value), 1)
345
345
  ]),
346
- g("div", null, [
346
+ v("div", null, [
347
347
  lo,
348
- g("span", so, X(a.lng), 1)
348
+ v("span", so, X(a.lng), 1)
349
349
  ]),
350
- g("div", null, [
350
+ v("div", null, [
351
351
  no,
352
- g("span", ro, X(a.lat), 1)
352
+ v("span", ro, X(a.lat), 1)
353
353
  ])
354
354
  ]),
355
355
  k(Qe, {
356
356
  ref_key: "gmapRef",
357
- ref: A,
357
+ ref: x,
358
358
  class: "h-[272px] sm:h-[240px] xs:h-[240px]",
359
359
  editable: "",
360
360
  center: a,
361
361
  markers: [a],
362
362
  onMarkerChange: s,
363
- onMapClick: w[0] || (w[0] = (_) => s({ position: _ }))
363
+ onMapClick: V[0] || (V[0] = (_) => s({ position: _ }))
364
364
  }, null, 8, ["center", "markers"])
365
365
  ]));
366
366
  }
367
- }), io = /* @__PURE__ */ Be(uo, [["__scopeId", "data-v-ea67d23a"]]);
368
- function ke([u, c]) {
367
+ }), io = /* @__PURE__ */ Ie(uo, [["__scopeId", "data-v-ea67d23a"]]);
368
+ function _e([u, c]) {
369
369
  return {
370
370
  lat: c,
371
371
  lng: u
@@ -391,14 +391,14 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
391
391
  },
392
392
  emits: ["update:modelValue"],
393
393
  setup(u, { emit: c }) {
394
- const p = u, l = c, a = ae(), r = Ce(), n = le(), s = ee(p, "modelValue"), A = D(!1);
395
- function y(d) {
394
+ const p = u, l = c, a = ae(), r = Ce(), n = le(), s = ee(p, "modelValue"), x = F(!1);
395
+ function g(d) {
396
396
  if (d != null && d[0] && (d != null && d[1]))
397
397
  return `${d[0].toFixed(3)} Long ${d[1].toFixed(3)} Lat`;
398
398
  }
399
- async function w(d) {
399
+ async function V(d) {
400
400
  var e, t;
401
- const x = p.modelValue, $ = !x && ((e = p.address) != null && e.formatted) ? await a.getFirstMatchingCoordinate(p.address.formatted) : null, o = x ? ke(x) : $ ? ke($) : te.jb;
401
+ const C = p.modelValue, $ = !C && ((e = p.address) != null && e.formatted) ? await a.getFirstMatchingCoordinate(p.address.formatted) : null, o = C ? _e(C) : $ ? _e($) : te.jb;
402
402
  r.open({
403
403
  title: p.dialogTitle ?? p.label ?? "Pin location",
404
404
  closeButton: !0,
@@ -418,7 +418,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
418
418
  }).onPrimary(d);
419
419
  }
420
420
  const _ = (d) => l("update:modelValue", d ? co(d) : null);
421
- async function v() {
421
+ async function b() {
422
422
  if (!p.disabled) {
423
423
  if (!a.isGoogleMapReady) {
424
424
  n.open({
@@ -428,41 +428,41 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
428
428
  });
429
429
  return;
430
430
  }
431
- w(_);
431
+ V(_);
432
432
  }
433
433
  }
434
434
  function S() {
435
435
  l("update:modelValue", null);
436
436
  }
437
- return (d, x) => {
438
- const $ = U("FmField"), o = U("FmButton"), e = U("FmFormGroup");
439
- return T(), B("div", po, [
437
+ return (d, C) => {
438
+ const $ = L("FmField"), o = L("FmButton"), e = L("FmFormGroup");
439
+ return R(), B("div", po, [
440
440
  k(e, {
441
441
  class: "flex-1",
442
- "model-value": C(s),
442
+ "model-value": A(s),
443
443
  label: d.label,
444
444
  disabled: d.disabled,
445
445
  required: d.labelMark === "required",
446
446
  optional: d.labelMark === "optional",
447
447
  info: d.labelInfo,
448
448
  rules: d.rules,
449
- focused: A.value,
449
+ focused: x.value,
450
450
  "helper-text": d.helperText,
451
451
  "helper-state": d.helperState,
452
- onClick: x[0] || (x[0] = (t) => v())
453
- }, Pe({
452
+ onClick: C[0] || (C[0] = (t) => b())
453
+ }, Fe({
454
454
  default: I(({ invalid: t }) => [
455
- d.modelValue && d.modelValue[0] && d.modelValue[1] ? (T(), B("div", mo, [
455
+ d.modelValue && d.modelValue[0] && d.modelValue[1] ? (R(), B("div", mo, [
456
456
  k($, {
457
457
  invalid: t,
458
458
  class: "fm-typo-en-body-lg-400"
459
459
  }, {
460
460
  default: I(() => [
461
- Te(X(y(d.modelValue)), 1)
461
+ Pe(X(g(d.modelValue)), 1)
462
462
  ]),
463
463
  _: 2
464
464
  }, 1032, ["invalid"])
465
- ])) : (T(), B("div", fo, [
465
+ ])) : (R(), B("div", fo, [
466
466
  k(o, {
467
467
  label: "Add coordinate",
468
468
  "prepend-icon": "add",
@@ -480,16 +480,16 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
480
480
  key: "0"
481
481
  } : void 0
482
482
  ]), 1032, ["model-value", "label", "disabled", "required", "optional", "info", "rules", "focused", "helper-text", "helper-state"]),
483
- d.modelValue && d.modelValue[0] && d.modelValue[1] ? (T(), N(o, {
483
+ d.modelValue && d.modelValue[0] && d.modelValue[1] ? (R(), N(o, {
484
484
  key: 0,
485
485
  "prepend-icon": "delete",
486
486
  variant: "tertiary",
487
- onClick: x[1] || (x[1] = (t) => S())
488
- })) : xe("", !0)
487
+ onClick: C[1] || (C[1] = (t) => S())
488
+ })) : ke("", !0)
489
489
  ]);
490
490
  };
491
491
  }
492
- }), go = { class: "flex flex-col gap-40" }, yo = { class: "flex flex-col gap-16" }, vo = { class: "flex flex-col gap-8" }, bo = /* @__PURE__ */ g("div", { class: "fm-typo-en-title-sm-800" }, "Address", -1), wo = { class: "grid grid-cols-2 gap-24" }, Vo = { class: "flex flex-col gap-8" }, _o = /* @__PURE__ */ g("div", { class: "fm-typo-en-title-sm-800" }, "Coordinate", -1), ko = { class: "flex flex-col gap-8" }, xo = /* @__PURE__ */ g("div", { class: "fm-typo-en-title-sm-800" }, "Contact", -1), Co = { class: "flex flex-col gap-16" }, Ao = /* @__PURE__ */ q({
492
+ }), go = { class: "flex flex-col gap-40" }, yo = { class: "flex flex-col gap-16" }, vo = { class: "flex flex-col gap-8" }, bo = /* @__PURE__ */ v("div", { class: "fm-typo-en-title-sm-800" }, "Address", -1), wo = { class: "grid grid-cols-2 gap-24" }, Vo = { class: "flex flex-col gap-8" }, _o = /* @__PURE__ */ v("div", { class: "fm-typo-en-title-sm-800" }, "Coordinate", -1), ko = { class: "flex flex-col gap-8" }, Co = /* @__PURE__ */ v("div", { class: "fm-typo-en-title-sm-800" }, "Contact", -1), Ao = { class: "flex flex-col gap-16" }, xo = /* @__PURE__ */ q({
493
493
  __name: "WarehouseForm",
494
494
  props: {
495
495
  modelValue: {},
@@ -497,7 +497,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
497
497
  },
498
498
  emits: ["update:modelValue", "validation-success"],
499
499
  setup(u, { expose: c, emit: p }) {
500
- const l = u, a = p, r = F({
500
+ const l = u, a = p, r = D({
501
501
  get() {
502
502
  var o, e;
503
503
  return ((e = (o = l.modelValue) == null ? void 0 : o.profile) == null ? void 0 : e.name) ?? "";
@@ -506,7 +506,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
506
506
  const e = l.modelValue ?? {};
507
507
  e.profile ?? (e.profile = {}), e.profile.name = o, a("update:modelValue", e);
508
508
  }
509
- }), n = F({
509
+ }), n = D({
510
510
  get() {
511
511
  var o, e;
512
512
  return ((e = (o = l.modelValue) == null ? void 0 : o.profile) == null ? void 0 : e.regNo) ?? "";
@@ -515,7 +515,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
515
515
  const e = l.modelValue ?? {};
516
516
  e.profile ?? (e.profile = {}), e.profile.regNo = o, a("update:modelValue", e);
517
517
  }
518
- }), s = F({
518
+ }), s = D({
519
519
  get() {
520
520
  var o, e, t;
521
521
  return ((t = (e = (o = l.modelValue) == null ? void 0 : o.profile) == null ? void 0 : e.address) == null ? void 0 : t.line1) ?? "";
@@ -525,7 +525,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
525
525
  const e = l.modelValue ?? {};
526
526
  e.profile ?? (e.profile = {}), (t = e.profile).address ?? (t.address = {}), e.profile.address.line1 = o, a("update:modelValue", e);
527
527
  }
528
- }), A = F({
528
+ }), x = D({
529
529
  get() {
530
530
  var o, e, t;
531
531
  return ((t = (e = (o = l.modelValue) == null ? void 0 : o.profile) == null ? void 0 : e.address) == null ? void 0 : t.line2) ?? "";
@@ -535,7 +535,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
535
535
  const e = l.modelValue ?? {};
536
536
  e.profile ?? (e.profile = {}), (t = e.profile).address ?? (t.address = {}), e.profile.address.line2 = o, a("update:modelValue", e);
537
537
  }
538
- }), y = F({
538
+ }), g = D({
539
539
  get() {
540
540
  var o, e, t;
541
541
  return ((t = (e = (o = l.modelValue) == null ? void 0 : o.profile) == null ? void 0 : e.address) == null ? void 0 : t.city) ?? "";
@@ -545,7 +545,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
545
545
  const e = l.modelValue ?? {};
546
546
  e.profile ?? (e.profile = {}), (t = e.profile).address ?? (t.address = {}), e.profile.address.city = o, a("update:modelValue", e);
547
547
  }
548
- }), w = F({
548
+ }), V = D({
549
549
  get() {
550
550
  var o, e, t;
551
551
  return ((t = (e = (o = l.modelValue) == null ? void 0 : o.profile) == null ? void 0 : e.address) == null ? void 0 : t.postcode) ?? "";
@@ -555,7 +555,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
555
555
  const e = l.modelValue ?? {};
556
556
  e.profile ?? (e.profile = {}), (t = e.profile).address ?? (t.address = {}), e.profile.address.postcode = o, a("update:modelValue", e);
557
557
  }
558
- }), _ = F({
558
+ }), _ = D({
559
559
  get() {
560
560
  var o, e, t;
561
561
  return ((t = (e = (o = l.modelValue) == null ? void 0 : o.profile) == null ? void 0 : e.address) == null ? void 0 : t.state) ?? "";
@@ -565,7 +565,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
565
565
  const e = l.modelValue ?? {};
566
566
  e.profile ?? (e.profile = {}), (t = e.profile).address ?? (t.address = {}), e.profile.address.state = o, a("update:modelValue", e);
567
567
  }
568
- }), v = F({
568
+ }), b = D({
569
569
  get() {
570
570
  var o, e, t;
571
571
  return ((t = (e = (o = l.modelValue) == null ? void 0 : o.profile) == null ? void 0 : e.address) == null ? void 0 : t.country) ?? "";
@@ -575,7 +575,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
575
575
  const e = l.modelValue ?? {};
576
576
  e.profile ?? (e.profile = {}), (t = e.profile).address ?? (t.address = {}), e.profile.address.country = o, a("update:modelValue", e);
577
577
  }
578
- }), S = F({
578
+ }), S = D({
579
579
  get() {
580
580
  var o, e, t;
581
581
  return ((t = (e = (o = l.modelValue) == null ? void 0 : o.profile) == null ? void 0 : e.address) == null ? void 0 : t.coordinates) ?? null;
@@ -585,7 +585,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
585
585
  const e = l.modelValue ?? {};
586
586
  e.profile ?? (e.profile = {}), (t = e.profile).address ?? (t.address = {}), e.profile.address.coordinates = o, a("update:modelValue", e);
587
587
  }
588
- }), d = F({
588
+ }), d = D({
589
589
  get() {
590
590
  var o, e;
591
591
  return ((e = (o = l.modelValue) == null ? void 0 : o.profile) == null ? void 0 : e.phoneNo) ?? "";
@@ -594,7 +594,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
594
594
  const e = l.modelValue ?? {};
595
595
  e.profile ?? (e.profile = {}), e.profile.phoneNo = o, a("update:modelValue", e);
596
596
  }
597
- }), x = F({
597
+ }), C = D({
598
598
  get() {
599
599
  var o, e;
600
600
  return ((e = (o = l.modelValue) == null ? void 0 : o.profile) == null ? void 0 : e.email) ?? "";
@@ -603,7 +603,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
603
603
  const e = l.modelValue ?? {};
604
604
  e.profile ?? (e.profile = {}), e.profile.email = o, a("update:modelValue", e);
605
605
  }
606
- }), $ = D();
606
+ }), $ = F();
607
607
  return c({
608
608
  validateInputs: () => {
609
609
  var o, e;
@@ -618,18 +618,18 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
618
618
  (e = (o = $.value) == null ? void 0 : o.resetInputs) == null || e.call(o);
619
619
  }
620
620
  }), (o, e) => {
621
- const t = U("FmTextField"), b = U("FmPhoneNumber"), h = U("FmForm");
622
- return T(), N(h, {
621
+ const t = L("FmTextField"), w = L("FmPhoneNumber"), h = L("FmForm");
622
+ return R(), N(h, {
623
623
  ref_key: "formRef",
624
624
  ref: $,
625
625
  onValidationSuccess: e[11] || (e[11] = (f) => a("validation-success"))
626
626
  }, {
627
627
  default: I(() => [
628
- g("div", go, [
629
- g("div", yo, [
628
+ v("div", go, [
629
+ v("div", yo, [
630
630
  k(t, {
631
631
  disabled: o.disabled,
632
- rules: [C(L)()],
632
+ rules: [A(U)()],
633
633
  "label-mark": "required",
634
634
  label: "Company name",
635
635
  modelValue: r.value,
@@ -637,19 +637,19 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
637
637
  }, null, 8, ["disabled", "rules", "modelValue"]),
638
638
  k(t, {
639
639
  disabled: o.disabled,
640
- rules: [C(L)()],
640
+ rules: [A(U)()],
641
641
  "label-mark": "required",
642
642
  label: "Registration no.",
643
643
  modelValue: n.value,
644
644
  "onUpdate:modelValue": e[1] || (e[1] = (f) => n.value = f)
645
645
  }, null, 8, ["disabled", "rules", "modelValue"])
646
646
  ]),
647
- g("div", vo, [
647
+ v("div", vo, [
648
648
  bo,
649
- g("div", wo, [
649
+ v("div", wo, [
650
650
  k(t, {
651
651
  disabled: o.disabled,
652
- rules: [C(L)()],
652
+ rules: [A(U)()],
653
653
  "label-mark": "required",
654
654
  label: "Line 1",
655
655
  modelValue: s.value,
@@ -659,28 +659,28 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
659
659
  disabled: o.disabled,
660
660
  "label-mark": "optional",
661
661
  label: "Line 2",
662
- modelValue: A.value,
663
- "onUpdate:modelValue": e[3] || (e[3] = (f) => A.value = f)
662
+ modelValue: x.value,
663
+ "onUpdate:modelValue": e[3] || (e[3] = (f) => x.value = f)
664
664
  }, null, 8, ["disabled", "modelValue"]),
665
665
  k(t, {
666
666
  disabled: o.disabled,
667
- rules: [C(L)()],
667
+ rules: [A(U)()],
668
668
  "label-mark": "required",
669
669
  label: "City",
670
- modelValue: y.value,
671
- "onUpdate:modelValue": e[4] || (e[4] = (f) => y.value = f)
670
+ modelValue: g.value,
671
+ "onUpdate:modelValue": e[4] || (e[4] = (f) => g.value = f)
672
672
  }, null, 8, ["disabled", "rules", "modelValue"]),
673
673
  k(t, {
674
674
  disabled: o.disabled,
675
- rules: [C(L)()],
675
+ rules: [A(U)()],
676
676
  "label-mark": "required",
677
677
  label: "Postal code",
678
- modelValue: w.value,
679
- "onUpdate:modelValue": e[5] || (e[5] = (f) => w.value = f)
678
+ modelValue: V.value,
679
+ "onUpdate:modelValue": e[5] || (e[5] = (f) => V.value = f)
680
680
  }, null, 8, ["disabled", "rules", "modelValue"]),
681
681
  k(t, {
682
682
  disabled: o.disabled,
683
- rules: [C(L)()],
683
+ rules: [A(U)()],
684
684
  "label-mark": "required",
685
685
  label: "State",
686
686
  modelValue: _.value,
@@ -688,30 +688,30 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
688
688
  }, null, 8, ["disabled", "rules", "modelValue"]),
689
689
  k(t, {
690
690
  disabled: o.disabled,
691
- rules: [C(L)()],
691
+ rules: [A(U)()],
692
692
  "label-mark": "required",
693
693
  label: "Country",
694
- modelValue: v.value,
695
- "onUpdate:modelValue": e[7] || (e[7] = (f) => v.value = f)
694
+ modelValue: b.value,
695
+ "onUpdate:modelValue": e[7] || (e[7] = (f) => b.value = f)
696
696
  }, null, 8, ["disabled", "rules", "modelValue"])
697
697
  ])
698
698
  ]),
699
- g("div", Vo, [
699
+ v("div", Vo, [
700
700
  _o,
701
701
  k(ho, {
702
702
  disabled: o.disabled,
703
- rules: [C(L)()],
703
+ rules: [A(U)()],
704
704
  "label-mark": "required",
705
705
  modelValue: S.value,
706
706
  "onUpdate:modelValue": e[8] || (e[8] = (f) => S.value = f)
707
707
  }, null, 8, ["disabled", "rules", "modelValue"])
708
708
  ]),
709
- g("div", ko, [
710
- xo,
711
- g("div", Co, [
712
- k(b, {
709
+ v("div", ko, [
710
+ Co,
711
+ v("div", Ao, [
712
+ k(w, {
713
713
  disabled: o.disabled,
714
- rules: [C(L)()],
714
+ rules: [A(U)()],
715
715
  "label-mark": "required",
716
716
  label: "Phone number",
717
717
  modelValue: d.value,
@@ -721,8 +721,8 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
721
721
  disabled: o.disabled,
722
722
  "label-mark": "optional",
723
723
  label: "Email",
724
- modelValue: x.value,
725
- "onUpdate:modelValue": e[10] || (e[10] = (f) => x.value = f)
724
+ modelValue: C.value,
725
+ "onUpdate:modelValue": e[10] || (e[10] = (f) => C.value = f)
726
726
  }, null, 8, ["disabled", "modelValue"])
727
727
  ])
728
728
  ])
@@ -732,7 +732,7 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
732
732
  }, 512);
733
733
  };
734
734
  }
735
- }), $o = { class: "flex gap-4" }, Mo = /* @__PURE__ */ q({
735
+ }), $o = { class: "flex gap-4" }, So = /* @__PURE__ */ q({
736
736
  __name: "WarehouseDialog",
737
737
  props: {
738
738
  mode: {},
@@ -741,72 +741,72 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
741
741
  },
742
742
  emits: ["update:show", "submitted"],
743
743
  setup(u, { expose: c, emit: p }) {
744
- const l = u, a = p, r = D(!1), n = le(), s = Ae(), A = F(() => {
744
+ const l = u, a = p, r = F(!1), n = le(), s = Ae(), x = D(() => {
745
745
  switch (l.mode) {
746
- case R.CREATE:
746
+ case W.CREATE:
747
747
  return "Add warehouse";
748
- case R.READ:
748
+ case W.READ:
749
749
  return "View";
750
- case R.UPDATE:
750
+ case W.UPDATE:
751
751
  return "Edit warehouse";
752
752
  }
753
753
  return "";
754
- }), y = F(() => {
754
+ }), g = D(() => {
755
755
  switch (l.mode) {
756
- case R.READ:
756
+ case W.READ:
757
757
  return "";
758
- case R.UPDATE:
758
+ case W.UPDATE:
759
759
  return "Save";
760
- case R.CREATE:
760
+ case W.CREATE:
761
761
  return "Add";
762
762
  }
763
763
  return "";
764
- }), w = D();
764
+ }), V = F();
765
765
  c({
766
766
  validateInputs: () => {
767
767
  var o, e;
768
- (e = (o = w.value) == null ? void 0 : o.validateInputs) == null || e.call(o);
768
+ (e = (o = V.value) == null ? void 0 : o.validateInputs) == null || e.call(o);
769
769
  },
770
770
  resetInputsValidation: () => {
771
771
  var o, e;
772
- (e = (o = w.value) == null ? void 0 : o.resetInputsValidation) == null || e.call(o);
772
+ (e = (o = V.value) == null ? void 0 : o.resetInputsValidation) == null || e.call(o);
773
773
  },
774
774
  resetInputs: () => {
775
775
  var o, e;
776
- (e = (o = w.value) == null ? void 0 : o.resetInputs) == null || e.call(o);
776
+ (e = (o = V.value) == null ? void 0 : o.resetInputs) == null || e.call(o);
777
777
  }
778
778
  });
779
- const _ = ee(l, "show"), v = ee(l, "warehouse");
779
+ const _ = ee(l, "show"), b = ee(l, "warehouse");
780
780
  function S() {
781
781
  var o, e;
782
- (e = (o = w.value) == null ? void 0 : o.validateInputs) == null || e.call(o);
782
+ (e = (o = V.value) == null ? void 0 : o.validateInputs) == null || e.call(o);
783
783
  }
784
784
  function d() {
785
785
  switch (l.mode) {
786
- case R.READ:
786
+ case W.READ:
787
787
  return;
788
- case R.UPDATE:
788
+ case W.UPDATE:
789
789
  return $();
790
- case R.CREATE:
791
- return x();
790
+ case W.CREATE:
791
+ return C();
792
792
  }
793
793
  }
794
- async function x() {
795
- var o, e, t, b;
794
+ async function C() {
795
+ var o, e, t, w;
796
796
  r.value = !0;
797
797
  try {
798
798
  await Promise.all([
799
- s.createWarehouse(v.value),
799
+ s.createWarehouse(b.value),
800
800
  new Promise((h) => setTimeout(h, 1e3))
801
801
  ]), n.open({
802
802
  title: "Success",
803
- message: `Created ${(e = (o = v.value) == null ? void 0 : o.profile) == null ? void 0 : e.name} warehouse`,
803
+ message: `Created ${(e = (o = b.value) == null ? void 0 : o.profile) == null ? void 0 : e.name} warehouse`,
804
804
  type: "success"
805
805
  }), a("update:show", !1), a("submitted");
806
806
  } catch (h) {
807
807
  n.open({
808
808
  title: "Something went wrong",
809
- message: `Cannot create ${(b = (t = v.value) == null ? void 0 : t.profile) == null ? void 0 : b.name} warehouse. Please try again`,
809
+ message: `Cannot create ${(w = (t = b.value) == null ? void 0 : t.profile) == null ? void 0 : w.name} warehouse. Please try again`,
810
810
  type: "error"
811
811
  }), console.error("cannot create warehouse", h);
812
812
  } finally {
@@ -814,8 +814,8 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
814
814
  }
815
815
  }
816
816
  async function $() {
817
- var o, e, t, b;
818
- if (v.value === null) {
817
+ var o, e, t, w;
818
+ if (b.value === null) {
819
819
  n.open({
820
820
  title: "Something went wrong",
821
821
  message: "Cannot update empty warehouse info",
@@ -826,17 +826,17 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
826
826
  r.value = !0;
827
827
  try {
828
828
  await Promise.all([
829
- s.updateWarehouse(v.value),
829
+ s.updateWarehouse(b.value),
830
830
  new Promise((h) => setTimeout(h, 1e3))
831
831
  ]), n.open({
832
832
  title: "Success",
833
- message: `Updated ${(e = (o = v.value) == null ? void 0 : o.profile) == null ? void 0 : e.name} warehouse`,
833
+ message: `Updated ${(e = (o = b.value) == null ? void 0 : o.profile) == null ? void 0 : e.name} warehouse`,
834
834
  type: "success"
835
835
  }), a("update:show", !1), a("submitted");
836
836
  } catch (h) {
837
837
  n.open({
838
838
  title: "Something went wrong",
839
- message: `Cannot update ${(b = (t = v.value) == null ? void 0 : t.profile) == null ? void 0 : b.name} warehouse. Please try again`,
839
+ message: `Cannot update ${(w = (t = b.value) == null ? void 0 : t.profile) == null ? void 0 : w.name} warehouse. Please try again`,
840
840
  type: "error"
841
841
  }), console.error("cannot update warehouse", h);
842
842
  } finally {
@@ -844,11 +844,11 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
844
844
  }
845
845
  }
846
846
  return (o, e) => {
847
- const t = U("FmButton"), b = U("FmSideSheet");
848
- return T(), N(b, {
849
- header: A.value,
850
- modelValue: C(_),
851
- "onUpdate:modelValue": e[1] || (e[1] = (h) => we(_) ? _.value = h : null),
847
+ const t = L("FmButton"), w = L("FmSideSheet");
848
+ return R(), N(w, {
849
+ header: x.value,
850
+ modelValue: A(_),
851
+ "onUpdate:modelValue": e[1] || (e[1] = (h) => be(_) ? _.value = h : null),
852
852
  "dismiss-away": !r.value,
853
853
  "close-button": "",
854
854
  "max-width": 500
@@ -856,12 +856,12 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
856
856
  default: I(() => {
857
857
  var h;
858
858
  return [
859
- (T(), N(Ao, {
859
+ (R(), N(xo, {
860
860
  class: "w-full",
861
861
  ref_key: "formRef",
862
- ref: w,
863
- modelValue: C(v),
864
- "onUpdate:modelValue": e[0] || (e[0] = (f) => we(v) ? v.value = f : null),
862
+ ref: V,
863
+ modelValue: A(b),
864
+ "onUpdate:modelValue": e[0] || (e[0] = (f) => be(b) ? b.value = f : null),
865
865
  onValidationSuccess: d,
866
866
  key: ((h = o.warehouse) == null ? void 0 : h._id) ?? "",
867
867
  disabled: r.value
@@ -869,10 +869,10 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
869
869
  ];
870
870
  }),
871
871
  "side-sheet-footer": I(() => [
872
- g("div", $o, [
872
+ v("div", $o, [
873
873
  k(t, {
874
874
  loading: r.value,
875
- label: y.value,
875
+ label: g.value,
876
876
  onClick: S
877
877
  }, null, 8, ["loading", "label"])
878
878
  ])
@@ -881,29 +881,29 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
881
881
  }, 8, ["header", "modelValue", "dismiss-away"]);
882
882
  };
883
883
  }
884
- }), So = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 max-h-full" }, Fo = { class: "px-8 flex gap-8 items-center xs:gap-0 xs:flex-col-reverse sm:gap-0 sm:flex-col-reverse" }, Do = { class: "flex-1 w-full" }, Po = { class: "flex flex-col py-8" }, To = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Eo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ro = {
884
+ }), Mo = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 max-h-full" }, Do = { class: "flex flex-col py-8" }, Fo = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Po = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Eo = {
885
885
  key: 0,
886
886
  class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
887
- }, Wo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary line-clamp-3" }, Oo = /* @__PURE__ */ q({
887
+ }, Ro = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary line-clamp-3" }, zo = /* @__PURE__ */ q({
888
888
  __name: "WarehouseView",
889
889
  setup(u) {
890
- const c = Ae(), p = Ne(), l = F(() => c.warehouses), a = Ce(), r = le(), n = D(!1);
890
+ const c = Ae(), p = Be(), l = D(() => c.warehouses), a = Ce(), r = le(), n = F(!1);
891
891
  oe(() => {
892
892
  p._currentLocation && $();
893
893
  }), Y([() => p._currentLocation], () => {
894
894
  p._currentLocation && $();
895
895
  });
896
- const s = D({});
897
- function A() {
898
- s.value.mode = R.CREATE, s.value.warehouse = {}, s.value.show = !0;
896
+ const s = F({});
897
+ function x() {
898
+ s.value.mode = W.CREATE, s.value.warehouse = {}, s.value.show = !0;
899
899
  }
900
- function y(b) {
901
- s.value.mode = R.UPDATE, s.value.warehouse = b, s.value.show = !0;
900
+ function g(w) {
901
+ s.value.mode = W.UPDATE, s.value.warehouse = w, s.value.show = !0;
902
902
  }
903
- async function w(b) {
903
+ async function V(w) {
904
904
  a.open({
905
905
  title: "Delete warehouse?",
906
- message: `Confirm deleting ${b.profile.name}?`,
906
+ message: `Confirm deleting ${w.profile.name}?`,
907
907
  primaryActions: {
908
908
  text: "Delete",
909
909
  close: !0,
@@ -913,41 +913,41 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
913
913
  text: "Cancel",
914
914
  close: !0
915
915
  }
916
- }).onPrimary(() => _(b));
916
+ }).onPrimary(() => _(w));
917
917
  }
918
- async function _(b) {
918
+ async function _(w) {
919
919
  a.open({
920
920
  title: "Deleting warehouse...",
921
921
  closeButton: !1
922
922
  });
923
923
  try {
924
- await c.deleteWarehouse(b), r.open({
924
+ await c.deleteWarehouse(w), r.open({
925
925
  title: "Success",
926
- message: `Deleted ${b.profile.name}.`,
926
+ message: `Deleted ${w.profile.name}.`,
927
927
  type: "success"
928
928
  }), await $(!0);
929
929
  } catch (h) {
930
930
  r.open({
931
931
  title: "Something went wrong",
932
- message: `Cannot delete ${b.profile.name}. Please try again.`,
932
+ message: `Cannot delete ${w.profile.name}. Please try again.`,
933
933
  type: "error"
934
934
  }), console.error("failed to delete warehouse", h);
935
935
  } finally {
936
936
  a.close();
937
937
  }
938
938
  }
939
- const { columnDefs: v, formatRowData: S } = Je(
940
- y,
941
- w
939
+ const { columnDefs: b, formatRowData: S } = Je(
940
+ g,
941
+ V
942
942
  );
943
- function d(b) {
944
- b === "create" && A();
943
+ function d(w) {
944
+ w === "create" && x();
945
945
  }
946
- const x = D("");
947
- async function $(b = !1) {
946
+ const C = F("");
947
+ async function $(w = !1) {
948
948
  n.value = !0;
949
949
  try {
950
- await c.readWarehouses(), b && await p.readLocations();
950
+ await c.readWarehouses(), w && await p.readLocations();
951
951
  } catch {
952
952
  r.open({
953
953
  title: "Cannot fetch warehouse list",
@@ -957,67 +957,63 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
957
957
  n.value = !1;
958
958
  }
959
959
  }
960
- const { breakpoints: o } = He(), e = F(() => o.value.xs || o.value.sm ? 10 : 20), t = Oe();
961
- return (b, h) => {
962
- const f = U("FmTableToolbar"), j = U("FmTable");
963
- return T(), N(Ge, {
960
+ const { breakpoints: o } = He(), e = D(() => o.value.xs || o.value.sm ? 10 : 20), t = je();
961
+ return (w, h) => {
962
+ const f = L("FmTable");
963
+ return R(), N(Oe, {
964
964
  title: "Warehouse",
965
965
  actions: [{ label: "Create warehouse", value: "create", isPrimary: !0, prependIcon: "add" }],
966
966
  "onClick:action": d
967
967
  }, {
968
968
  default: I(() => [
969
- g("div", So, [
970
- g("div", Fo, [
971
- g("div", Do, [
972
- k(f, {
973
- class: "xs:px-8",
974
- searchable: "",
975
- "search-model": x.value,
976
- "onUpdate:searchModel": h[0] || (h[0] = (E) => x.value = E)
977
- }, null, 8, ["search-model"])
978
- ])
979
- ]),
980
- (T(), N(j, {
981
- style: Re(C(t).tableHeight),
982
- "column-defs": C(v),
983
- "row-data": C(S)(l.value),
984
- "search-value": x.value,
985
- loading: !C(p)._currentLocation || n.value,
986
- onRowClick: h[1] || (h[1] = (E) => y(E.original.original)),
969
+ v("div", Mo, [
970
+ k(Ge, {
971
+ searchable: "",
972
+ "change-location": "",
973
+ search: C.value,
974
+ "onUpdate:search": h[0] || (h[0] = (P) => C.value = P)
975
+ }, null, 8, ["search"]),
976
+ (R(), N(f, {
977
+ style: Re(A(t).tableHeight),
978
+ "column-defs": A(b),
979
+ "row-data": A(S)(l.value),
980
+ "search-value": C.value,
981
+ loading: !A(p)._currentLocation || n.value,
982
+ onRowClick: h[1] || (h[1] = (P) => g(P.original.original)),
987
983
  key: l.value.length,
988
984
  "page-size": e.value
989
985
  }, {
990
- "list-row": I((E) => [
991
- k(je, {
992
- row: E,
993
- onRowClick: (P) => y(P.original)
986
+ "list-row": I((P) => [
987
+ k(ze, {
988
+ row: P,
989
+ onRowClick: (E) => g(E.original)
994
990
  }, {
995
- default: I((P) => {
996
- var i, m, V, M, W, O, re, ue, G, de, ie, ce, pe, me, K, fe, he, ge, ye, H, ve;
991
+ default: I((E) => {
992
+ var j, i, m, y, M, T, O, re, G, ue, de, ie, ce, pe, K, me, fe, he, ge, H, ye;
997
993
  return [
998
- g("div", Po, [
999
- g("div", To, [
1000
- k(C(J), {
1001
- render: (V = (m = (i = P.warehouse) == null ? void 0 : i.column) == null ? void 0 : m.columnDef) == null ? void 0 : V.cell,
1002
- props: (W = (M = P.warehouse) == null ? void 0 : M.getContext) == null ? void 0 : W.call(M)
994
+ v("div", Do, [
995
+ v("div", Fo, [
996
+ k(A(J), {
997
+ render: (m = (i = (j = E.warehouse) == null ? void 0 : j.column) == null ? void 0 : i.columnDef) == null ? void 0 : m.cell,
998
+ props: (M = (y = E.warehouse) == null ? void 0 : y.getContext) == null ? void 0 : M.call(y)
1003
999
  }, null, 8, ["render", "props"])
1004
1000
  ]),
1005
- g("div", Eo, [
1006
- k(C(J), {
1007
- render: (ue = (re = (O = P.contact) == null ? void 0 : O.column) == null ? void 0 : re.columnDef) == null ? void 0 : ue.cell,
1008
- props: (de = (G = P.contact) == null ? void 0 : G.getContext) == null ? void 0 : de.call(G)
1001
+ v("div", Po, [
1002
+ k(A(J), {
1003
+ render: (re = (O = (T = E.contact) == null ? void 0 : T.column) == null ? void 0 : O.columnDef) == null ? void 0 : re.cell,
1004
+ props: (ue = (G = E.contact) == null ? void 0 : G.getContext) == null ? void 0 : ue.call(G)
1009
1005
  }, null, 8, ["render", "props"])
1010
1006
  ]),
1011
- (ie = E.original) != null && ie.email ? (T(), B("div", Ro, [
1012
- k(C(J), {
1013
- render: (me = (pe = (ce = P.email) == null ? void 0 : ce.column) == null ? void 0 : pe.columnDef) == null ? void 0 : me.cell,
1014
- props: (fe = (K = P.email) == null ? void 0 : K.getContext) == null ? void 0 : fe.call(K)
1007
+ (de = P.original) != null && de.email ? (R(), B("div", Eo, [
1008
+ k(A(J), {
1009
+ render: (pe = (ce = (ie = E.email) == null ? void 0 : ie.column) == null ? void 0 : ce.columnDef) == null ? void 0 : pe.cell,
1010
+ props: (me = (K = E.email) == null ? void 0 : K.getContext) == null ? void 0 : me.call(K)
1015
1011
  }, null, 8, ["render", "props"])
1016
- ])) : xe("", !0),
1017
- g("div", Wo, [
1018
- k(C(J), {
1019
- render: (ye = (ge = (he = P.address) == null ? void 0 : he.column) == null ? void 0 : ge.columnDef) == null ? void 0 : ye.cell,
1020
- props: (ve = (H = P.address) == null ? void 0 : H.getContext) == null ? void 0 : ve.call(H)
1012
+ ])) : ke("", !0),
1013
+ v("div", Ro, [
1014
+ k(A(J), {
1015
+ render: (ge = (he = (fe = E.address) == null ? void 0 : fe.column) == null ? void 0 : he.columnDef) == null ? void 0 : ge.cell,
1016
+ props: (ye = (H = E.address) == null ? void 0 : H.getContext) == null ? void 0 : ye.call(H)
1021
1017
  }, null, 8, ["render", "props"])
1022
1018
  ])
1023
1019
  ])
@@ -1029,12 +1025,12 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
1029
1025
  _: 1
1030
1026
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
1031
1027
  ]),
1032
- k(Mo, {
1028
+ k(So, {
1033
1029
  show: s.value.show,
1034
- "onUpdate:show": h[2] || (h[2] = (E) => s.value.show = E),
1030
+ "onUpdate:show": h[2] || (h[2] = (P) => s.value.show = P),
1035
1031
  warehouse: s.value.warehouse,
1036
1032
  mode: s.value.mode,
1037
- onSubmitted: h[3] || (h[3] = (E) => $(!0))
1033
+ onSubmitted: h[3] || (h[3] = (P) => $(!0))
1038
1034
  }, null, 8, ["show", "warehouse", "mode"])
1039
1035
  ]),
1040
1036
  _: 1
@@ -1043,5 +1039,5 @@ const po = { class: "flex gap-8 items-center" }, mo = { key: 0 }, fo = { key: 1
1043
1039
  }
1044
1040
  });
1045
1041
  export {
1046
- Oo as default
1042
+ zo as default
1047
1043
  };