@feedmepos/mf-inventory-portal 0.0.22-dev.7 → 0.0.22-dev.8

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-B9s4exkr.js → ApprovalView-BNeTV3TV.js} +4 -4
  2. package/dist/{BindingsDialog-uksEDFFX.js → BindingsDialog-pBelBtiH.js} +1 -1
  3. package/dist/{BindingsPicker-B2rQ9kJH.js → BindingsPicker-VHr76FFM.js} +19 -19
  4. package/dist/{BindingsTable-BLN_bAjO.js → BindingsTable-CgIp6DKB.js} +1 -1
  5. package/dist/{ClosingTemplateView-Bi06Gxzo.js → ClosingTemplateView-FleQasJi.js} +34 -34
  6. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CeBoTYGq.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BYfojQsH.js} +1 -1
  7. package/dist/{IngredientsView-DY6yY-Fk.js → IngredientsView-BEW8_MJ0.js} +3 -3
  8. package/dist/{IntegrationView-C74CJ4PS.js → IntegrationView-NnpJ8nYO.js} +2 -2
  9. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BmsbeAvi.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CJMb1aR1.js} +1 -1
  10. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-RoZStI7P.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DWSq3JsJ.js} +1 -1
  11. package/dist/{PurchaseOrderPrintPreview-Dn5CQDnd.js → PurchaseOrderPrintPreview-BZ5uhyRy.js} +1 -1
  12. package/dist/{ReceiveRequestView-BC61WMFL.js → ReceiveRequestView-DN9u5HLn.js} +6 -6
  13. package/dist/{RecipeView-DYbuUEFK.js → RecipeView-DM20cOk3.js} +3 -3
  14. package/dist/{StockView-D_ZzX7yp.js → StockView-LppKR-nM.js} +6 -6
  15. package/dist/{SupplierView-ChewCZKN.js → SupplierView-DHh6MhoI.js} +37 -37
  16. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-KHwccWdi.js +754 -0
  17. package/dist/TransferDialog.vue_vue_type_script_setup_true_lang-2QZK3Iu5.js +1485 -0
  18. package/dist/TransferTemplateView-CUQSQR8U.js +1278 -0
  19. package/dist/{UnitView-Cx1xe3Wg.js → UnitView-D8XJca7H.js} +4 -4
  20. package/dist/{WarehouseView-CQQf0YFc.js → WarehouseView-DTnx3-Fi.js} +2 -2
  21. package/dist/api/inventory.d.ts +1 -0
  22. package/dist/api/netsuite.d.ts +40 -0
  23. package/dist/api/purchase-order-template.d.ts +0 -4
  24. package/dist/{app-emo4vLKK.js → app-Cn0UYdAW.js} +8192 -7963
  25. package/dist/app.d.ts +6 -0
  26. package/dist/app.js +3 -3
  27. package/dist/{decimal-BO9I7LUt.js → decimal-BiLgcnqq.js} +1 -1
  28. package/dist/{defineDeepModel-D06lO_R2.js → defineDeepModel-CXCb8GcR.js} +4 -4
  29. package/dist/{format-time-from-id-HTOA-soi.js → format-time-from-id-5QzQNKlI.js} +1 -1
  30. package/dist/{id-to-date-DAnKDcfC.js → id-to-date-C-LYuoim.js} +1 -1
  31. package/dist/purchase-order-transaction-type-BV80Rx9h.js +676 -0
  32. package/dist/stores/api.d.ts +1 -0
  33. package/dist/stores/helper/core-store-proxy.d.ts +27 -0
  34. package/dist/stores/helper/generate-backend-urls.d.ts +1 -0
  35. package/dist/stores/netsuite.d.ts +49 -0
  36. package/dist/style.css +1 -1
  37. package/dist/{supplier-CBf_J6D6.js → supplier-Bg9MjX_y.js} +1 -1
  38. package/dist/tsconfig.app.tsbuildinfo +1 -1
  39. package/dist/{use-template-enabled-locations-2-Bo3g55rA.js → use-template-enabled-locations-2-CzY-UFrc.js} +1 -1
  40. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +14 -0
  41. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +42 -0
  42. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +42 -0
  43. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +2 -2
  44. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +84 -0
  45. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +28 -986
  46. package/dist/views/transfer-template/helpers/remove-deleted-skus.helper.d.ts +7 -0
  47. package/dist/{xlsx-DX8dk9eD.js → xlsx-BsdfXPiA.js} +1 -1
  48. package/dist/{xlsx.util-BaeMOrlY.js → xlsx.util-B_ynXZ3Q.js} +2 -2
  49. package/package.json +5 -5
  50. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CXmk2PYd.js +0 -740
  51. package/dist/TransferDialog.vue_vue_type_script_setup_true_lang-D9XERa2u.js +0 -1409
  52. package/dist/TransferTemplateView-BIsn4jRY.js +0 -1238
  53. package/dist/purchase-order-transaction-type-73S8OLUt.js +0 -702
@@ -0,0 +1,1485 @@
1
+ import { reactive as Ke, onMounted as Ee, computed as P, h as M, defineComponent as ae, openBlock as F, createElementBlock as $, Fragment as le, renderList as Pe, createElementVNode as i, toDisplayString as A, unref as e, resolveComponent as T, createVNode as g, withCtx as D, createCommentVNode as N, ref as E, createBlock as H, watch as Le, normalizeClass as ne, normalizeStyle as Je, isRef as de } from "vue";
2
+ import { useBreakpoints as Xe, components as ue, FmButtonVariant as Ge, useSnackbar as $e, useDialog as et, useProxiedModel as tt } from "@feedmepos/ui-library";
3
+ import { F as ve } from "./row-action.enum-PMKMRrZR.js";
4
+ import { P as V, d as qe, c as st } from "./purchase-order-transaction-type-BV80Rx9h.js";
5
+ import { a as z, t as ot, a9 as Te, D as nt, b as Ne, R as Ie, a3 as lt, a4 as at, r as rt, a5 as Be, G as He, l as it, A as xe, M as ut, aa as ze, O as Ve, P as je, ab as dt, j as Ae, ac as ct, u as De, ad as pt, ae as mt, af as ft, E as yt, ag as vt, ah as bt, y as _t } from "./app-Cn0UYdAW.js";
6
+ import { _ as We, u as gt } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-DWSq3JsJ.js";
7
+ import { useI18n as pe } from "@feedmepos/mf-common";
8
+ import "vue-router";
9
+ import { u as Se } from "./supplier-Bg9MjX_y.js";
10
+ import { d as kt } from "./defineDeepModel-CXCb8GcR.js";
11
+ import { F as ce, _ as Ct } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
12
+ import { _ as ht } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
13
+ function oe(o, y, u, l) {
14
+ var d, c, k;
15
+ if (l != null && l.manualTotalCost)
16
+ return l == null ? void 0 : l.manualTotalCost;
17
+ const _ = (k = (c = (d = l == null ? void 0 : l.supplier) == null ? void 0 : d.supplyItems) == null ? void 0 : c.find(
18
+ (b) => b.skuId === o._id
19
+ )) == null ? void 0 : k.defaultCost, t = o.defaultCost, n = _ ?? t, x = n == null ? void 0 : n.costPerUnit, p = x ? n != null && n.measurement ? +z(x) / +z(n == null ? void 0 : n.measurement.conversion) : +z(x) : void 0, s = p ? u ? p * +z(u.conversion) : p : void 0, r = s ? +z(y) * s : void 0;
20
+ return r ? {
21
+ ...ot(r ?? 0, 2),
22
+ currency: Te()
23
+ } : {
24
+ amount: 0,
25
+ precision: 0,
26
+ currency: Te()
27
+ };
28
+ }
29
+ var B = /* @__PURE__ */ ((o) => (o.Code = "Code", o.Name = "Name", o.Amount = "Amount", o.Cost = "Cost", o.Delete = "Delete", o))(B || {});
30
+ const wt = () => {
31
+ const { t: o } = pe();
32
+ return M(
33
+ We,
34
+ {
35
+ zIndex: 50,
36
+ class: "whitespace-nowrap"
37
+ },
38
+ o("inventory.transfer.form.items.table.Cost", [ze()])
39
+ );
40
+ };
41
+ function xt(o) {
42
+ const { t: y } = pe(), u = Ke({}), { breakpoints: l } = Xe(), _ = Ne();
43
+ Ee(() => {
44
+ for (const p of o.items) {
45
+ if (!p.totalCost)
46
+ continue;
47
+ const s = oe(p.sku, p.quantity, p.measurement, {
48
+ supplier: o.supplier
49
+ }), r = p.totalCost ?? nt.reset();
50
+ s ? u[p.sku._id] = s.amount !== r.amount || s.precision !== r.precision : u[p.sku._id] = !0;
51
+ }
52
+ });
53
+ function t(p) {
54
+ var r, v, d, c, k, b, S;
55
+ return !!(((v = (r = p.defaultCost) == null ? void 0 : r.costPerUnit) == null ? void 0 : v.amount) ?? ((S = (b = (k = (c = (d = o.supplier) == null ? void 0 : d.supplyItems) == null ? void 0 : c.find((h) => h.skuId === p._id)) == null ? void 0 : k.defaultCost) == null ? void 0 : b.costPerUnit) == null ? void 0 : S.amount));
56
+ }
57
+ const n = [
58
+ {
59
+ id: "Code",
60
+ header: () => y("inventory.transfer.form.items.table.Code"),
61
+ accessorKey: "code",
62
+ size: 96,
63
+ cell(p) {
64
+ const s = p.row.original;
65
+ return M(ue.FmTextField, {
66
+ modelValue: s.code,
67
+ "onUpdate:modelValue": (r) => {
68
+ o.updateItem({
69
+ ...s,
70
+ code: r
71
+ });
72
+ },
73
+ key: s.sku._id,
74
+ rules: [Ie()],
75
+ labelMark: "required"
76
+ });
77
+ },
78
+ enableSorting: !1
79
+ },
80
+ {
81
+ id: "Name",
82
+ header: () => y("inventory.transfer.form.items.table.Name"),
83
+ minSize: 300,
84
+ cell(p) {
85
+ const s = p.row.original;
86
+ return M(ue.FmTextField, {
87
+ modelValue: s.name,
88
+ "onUpdate:modelValue": (r) => {
89
+ o.updateItem({
90
+ ...s,
91
+ name: r
92
+ });
93
+ },
94
+ key: s.sku._id,
95
+ rules: [Ie()],
96
+ labelMark: "required"
97
+ });
98
+ },
99
+ enableSorting: !1
100
+ },
101
+ {
102
+ id: "Amount",
103
+ header: () => y("inventory.transfer.form.items.table.Amount"),
104
+ minSize: 200,
105
+ cell(p) {
106
+ var v, d, c;
107
+ const s = p.row.original, r = (c = (d = (v = o.template) == null ? void 0 : v.purchaseOrder) == null ? void 0 : d.items) == null ? void 0 : c.find(
108
+ (k) => k.sku._id === s.sku._id
109
+ );
110
+ return M(lt, {
111
+ style: {
112
+ flex: "1 1 0%"
113
+ },
114
+ modelValue: {
115
+ amount: s.quantity ?? { amount: 1, precision: 0 },
116
+ measurement: s.measurement ?? null
117
+ },
118
+ key: s.sku._id,
119
+ unit: s.sku.unit,
120
+ "onUpdate:modelValue": (k) => {
121
+ const b = {
122
+ ...s,
123
+ quantity: k.amount,
124
+ measurement: k.measurement
125
+ };
126
+ _.enableTotalCost && (b.totalCost = oe(s.sku, s.quantity, s.measurement, {
127
+ supplier: o.supplier,
128
+ // NOTE: set undefined here if `manualTotalCost[row.sku._id] = false`, so that the function
129
+ // will return the auto calculated default cost instead of the manual total cost
130
+ manualTotalCost: u[s.sku._id] ? b.totalCost : void 0
131
+ })), o.updateItem(b);
132
+ },
133
+ stepperOnly: !!(r != null && r.quantityStep),
134
+ stepper: r == null ? void 0 : r.quantityStep,
135
+ disableUnit: !!r,
136
+ disabled: o.disabled,
137
+ rules: [
138
+ at(
139
+ +z(
140
+ (r == null ? void 0 : r.minimumQuantity) ?? {
141
+ amount: 1,
142
+ precision: rt(s.sku.unit, s.measurement)
143
+ }
144
+ )
145
+ ),
146
+ r != null && r.maximumQuantity ? Be(
147
+ +z(r == null ? void 0 : r.maximumQuantity)
148
+ ) : Be(1 / 0)
149
+ ],
150
+ applyDefaultRules: !0
151
+ });
152
+ },
153
+ enableSorting: !1
154
+ },
155
+ {
156
+ id: "Cost",
157
+ header: wt,
158
+ size: 180,
159
+ cell(p) {
160
+ const s = p.row.original, r = t(s.sku), v = l.value.xs || l.value.sm;
161
+ return !u[s.sku._id] && r ? M(
162
+ "div",
163
+ {
164
+ class: [
165
+ "flex gap-4 fm-typo-en-body-md-400 items-center",
166
+ o.disabled ? "text-fm-color-typo-disabled" : ""
167
+ ],
168
+ key: s.sku._id
169
+ },
170
+ [
171
+ M(ue.FmButton, {
172
+ prependIcon: "edit",
173
+ variant: Ge.Tertiary,
174
+ disabled: o.disabled,
175
+ onClick() {
176
+ o.updateItem({
177
+ ...s,
178
+ totalCost: oe(s.sku, s.quantity, s.measurement, {
179
+ supplier: o.supplier
180
+ })
181
+ }), u[s.sku._id] = !0;
182
+ }
183
+ }),
184
+ M(
185
+ "div",
186
+ {
187
+ class: "flex flex-col"
188
+ },
189
+ [
190
+ M(
191
+ "span",
192
+ v ? He(
193
+ oe(s.sku, s.quantity, s.measurement, {
194
+ supplier: o.supplier
195
+ })
196
+ ) : z(
197
+ oe(s.sku, s.quantity, s.measurement, {
198
+ supplier: o.supplier
199
+ })
200
+ )
201
+ ),
202
+ M(
203
+ "span",
204
+ {
205
+ class: [
206
+ "fm-typo-en-body-sm-400",
207
+ o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-neutral-gray-400"
208
+ ]
209
+ },
210
+ y("inventory.transfer.form.items.autoCalculated")
211
+ )
212
+ ]
213
+ )
214
+ ]
215
+ ) : M(
216
+ ue.FmTextField,
217
+ {
218
+ modelValue: z(s.totalCost ?? { amount: 0, precision: 0 }),
219
+ key: s.sku._id,
220
+ "onUpdate:modelValue": (d) => {
221
+ o.updateItem({
222
+ ...s,
223
+ totalCost: {
224
+ ...it(+d),
225
+ currency: Te()
226
+ }
227
+ });
228
+ },
229
+ rules: [xe(0), ut(2)]
230
+ },
231
+ {
232
+ prepend() {
233
+ return v ? M(
234
+ "div",
235
+ {
236
+ class: [
237
+ "text-fm-typo-en-body-lg-400",
238
+ o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
239
+ ]
240
+ },
241
+ ze()
242
+ ) : null;
243
+ },
244
+ append() {
245
+ return r ? M(ue.FmButton, {
246
+ prependIcon: "close",
247
+ variant: "tertiary",
248
+ disabled: o.disabled,
249
+ onClick() {
250
+ o.updateItem({
251
+ ...s,
252
+ // NOTE: different from PO template, if a default cost is reenabled,
253
+ // the total cost will automatically assigned
254
+ totalCost: oe(s.sku, s.quantity, s.measurement, {
255
+ supplier: o.supplier
256
+ })
257
+ }), u[s.sku._id] = !1;
258
+ }
259
+ }) : null;
260
+ }
261
+ }
262
+ );
263
+ },
264
+ enableSorting: !1
265
+ },
266
+ {
267
+ id: "Delete",
268
+ header: "",
269
+ cell(p) {
270
+ const s = p.row.original;
271
+ return M(ue.FmButton, {
272
+ key: s.sku._id,
273
+ class: "delete-button",
274
+ type: "button",
275
+ icon: "delete",
276
+ variant: "tertiary",
277
+ size: "md",
278
+ disabled: o.disabled,
279
+ onClick: () => {
280
+ o.deleteItem(s);
281
+ }
282
+ });
283
+ },
284
+ enableSorting: !1,
285
+ size: 40,
286
+ meta: {
287
+ cellClass: "",
288
+ headerClass: ""
289
+ }
290
+ }
291
+ ];
292
+ return {
293
+ columnDefs: P(() => _.enableTotalCost && o.transferType === V.PURCHASE ? n : n.filter(
294
+ (p) => p.id !== "Cost"
295
+ /* Cost */
296
+ ))
297
+ };
298
+ }
299
+ const St = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" }, Ft = { class: "fm-typo-en-body-lg-600 xs:fm-typo-en-body-md-600 mr-auto xs:w-full" }, Pt = { class: "w-[450px] xs:w-full flex" }, Tt = { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, It = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ye = /* @__PURE__ */ ae({
300
+ __name: "SupplierPriceHistory",
301
+ props: {
302
+ prices: {}
303
+ },
304
+ setup(o) {
305
+ const y = Se();
306
+ function u(l) {
307
+ return y.suppliers.find((_) => _._id === l);
308
+ }
309
+ return (l, _) => (F(), $("div", St, [
310
+ (F(!0), $(le, null, Pe(Object.keys(l.prices), (t) => {
311
+ var n;
312
+ return F(), $("div", {
313
+ key: t,
314
+ class: "flex items-center gap-12 xs:gap-4 xs:flex-wrap w-full"
315
+ }, [
316
+ i("div", Ft, A((n = u(t)) == null ? void 0 : n.name), 1),
317
+ i("div", Pt, [
318
+ (F(!0), $(le, null, Pe(l.prices[t].slice(0, 3), (x) => {
319
+ var p;
320
+ return F(), $("div", {
321
+ key: x.date,
322
+ class: "flex flex-col w-[150px] xs:flex-1 text-ellipsis cursor-pointer"
323
+ }, [
324
+ i("div", Tt, [
325
+ i("span", null, A(x.totalCost ? e(He)(x.totalCost) : "No data"), 1),
326
+ _[0] || (_[0] = i("span", { class: "text-fm-color-typo-secondary" }, "/", -1)),
327
+ i("span", null, A(e(z)(x.totalUnit, !1)), 1),
328
+ i("span", null, A(((p = x.measurement) == null ? void 0 : p.abbrev) ?? x.unit.abbrev), 1)
329
+ ]),
330
+ i("div", It, [
331
+ i("span", null, "(#" + A(x.seqNumber) + ")", 1),
332
+ _[1] || (_[1] = i("span", null, A(" "), -1)),
333
+ i("span", null, A(e(Ve)(new Date(x.date))), 1)
334
+ ])
335
+ ]);
336
+ }), 128))
337
+ ])
338
+ ]);
339
+ }), 128))
340
+ ]));
341
+ }
342
+ }), $t = { class: "flex flex-col gap-8 py-16" }, Vt = { class: "flex items-center" }, At = { class: "flex-1 flex gap-1 items-center" }, Dt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Rt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Ot = { class: "flex gap-8 w-full" }, Ut = { class: "flex-1 flex flex-col gap-4" }, Bt = { class: "flex-1 flex flex-col gap-4" }, Mt = { class: "flex gap-8 w-full" }, Et = { class: "flex-1 flex flex-col gap-4" }, Lt = {
343
+ key: 0,
344
+ class: "flex-1 flex flex-col gap-4"
345
+ }, qt = /* @__PURE__ */ ae({
346
+ __name: "TransferItem",
347
+ props: {
348
+ cellByColId: {},
349
+ comparePriceBySku: {},
350
+ showComparePrice: { type: Boolean },
351
+ row: {}
352
+ },
353
+ setup(o) {
354
+ const { t: y } = pe();
355
+ return (u, l) => {
356
+ var n, x, p, s, r, v, d, c, k, b, S, h, I, O, J, L, G, j, q, X, W, m, C, U, Y, Z, _e;
357
+ const _ = T("FmLabel"), t = T("FmSpacer");
358
+ return F(), $("div", $t, [
359
+ i("div", Vt, [
360
+ i("div", At, [
361
+ i("span", Dt, " (" + A(u.row.original.sku.code) + ") ", 1),
362
+ i("span", Rt, A(u.row.original.sku.name), 1)
363
+ ]),
364
+ i("div", null, [
365
+ g(e(ce), {
366
+ render: (p = (x = (n = u.cellByColId.Delete) == null ? void 0 : n.column) == null ? void 0 : x.columnDef) == null ? void 0 : p.cell,
367
+ props: (r = (s = u.cellByColId.Delete) == null ? void 0 : s.getContext) == null ? void 0 : r.call(s)
368
+ }, null, 8, ["render", "props"])
369
+ ])
370
+ ]),
371
+ i("div", Ot, [
372
+ i("div", Ut, [
373
+ g(_, {
374
+ label: e(y)(`inventory.transfer.form.items.table.${e(B).Code}`)
375
+ }, null, 8, ["label"]),
376
+ g(e(ce), {
377
+ render: (c = (d = (v = u.cellByColId[e(B).Code]) == null ? void 0 : v.column) == null ? void 0 : d.columnDef) == null ? void 0 : c.cell,
378
+ props: (b = (k = u.cellByColId[e(B).Code]) == null ? void 0 : k.getContext) == null ? void 0 : b.call(k)
379
+ }, null, 8, ["render", "props"]),
380
+ l[0] || (l[0] = i("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
381
+ ]),
382
+ i("div", Bt, [
383
+ g(_, {
384
+ label: e(y)(`inventory.transfer.form.items.table.${e(B).Name}`)
385
+ }, null, 8, ["label"]),
386
+ g(e(ce), {
387
+ render: (I = (h = (S = u.cellByColId[e(B).Name]) == null ? void 0 : S.column) == null ? void 0 : h.columnDef) == null ? void 0 : I.cell,
388
+ props: (J = (O = u.cellByColId[e(B).Name]) == null ? void 0 : O.getContext) == null ? void 0 : J.call(O)
389
+ }, null, 8, ["render", "props"]),
390
+ l[1] || (l[1] = i("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
391
+ ])
392
+ ]),
393
+ i("div", Mt, [
394
+ i("div", Et, [
395
+ g(_, {
396
+ label: e(y)(`inventory.transfer.form.items.table.${e(B).Amount}`)
397
+ }, null, 8, ["label"]),
398
+ g(e(ce), {
399
+ render: (j = (G = (L = u.cellByColId[e(B).Amount]) == null ? void 0 : L.column) == null ? void 0 : G.columnDef) == null ? void 0 : j.cell,
400
+ props: (X = (q = u.cellByColId[e(B).Amount]) == null ? void 0 : q.getContext) == null ? void 0 : X.call(q)
401
+ }, null, 8, ["render", "props"]),
402
+ l[2] || (l[2] = i("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
403
+ ]),
404
+ u.cellByColId[e(B).Cost] ? (F(), $("div", Lt, [
405
+ g(We, { "z-index": 50 }, {
406
+ default: D(() => [
407
+ g(_, {
408
+ label: e(y)(`inventory.transfer.form.items.table.${e(B).Cost}2`)
409
+ }, null, 8, ["label"])
410
+ ]),
411
+ _: 1
412
+ }),
413
+ g(e(ce), {
414
+ render: (C = (m = (W = u.cellByColId[e(B).Cost]) == null ? void 0 : W.column) == null ? void 0 : m.columnDef) == null ? void 0 : C.cell,
415
+ props: (Y = (U = u.cellByColId[e(B).Cost]) == null ? void 0 : U.getContext) == null ? void 0 : Y.call(U)
416
+ }, null, 8, ["render", "props"]),
417
+ l[3] || (l[3] = i("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
418
+ ])) : N("", !0)
419
+ ]),
420
+ u.showComparePrice && Object.keys(u.comparePriceBySku[(Z = u.row.original.sku) == null ? void 0 : Z._id] ?? {}).length > 0 ? (F(), $(le, { key: 0 }, [
421
+ g(t, { class: "h-8" }),
422
+ g(Ye, {
423
+ prices: u.comparePriceBySku[(_e = u.row.original.sku) == null ? void 0 : _e._id]
424
+ }, null, 8, ["prices"])
425
+ ], 64)) : N("", !0)
426
+ ]);
427
+ };
428
+ }
429
+ });
430
+ function be(o) {
431
+ return dt.parse(o);
432
+ }
433
+ function we(o) {
434
+ return {
435
+ _id: o.doc._id,
436
+ internal: o.type,
437
+ contactName: o.doc.profile.name,
438
+ name: o.doc.profile.name,
439
+ email: o.doc.profile.email,
440
+ phoneNumber: o.doc.profile.phoneNo,
441
+ registrationNumber: o.doc.profile.regNo,
442
+ address: o.doc.profile.address
443
+ };
444
+ }
445
+ function Nt(o, y) {
446
+ const u = Se(), l = Ae(), _ = P(() => !l.businessLevel);
447
+ l.watchLocation(async () => {
448
+ var S;
449
+ await u.readSuppliers();
450
+ const d = o();
451
+ if ((S = d.supplier) != null && S._id) return;
452
+ const c = l.businessLevel ? u.businessSuppliers[0] : u.suppliers[0], b = (_.value ? l.locations.filter((h) => h.doc._id !== l.currentLocation.doc._id) : l.locations)[0];
453
+ y({
454
+ ...d,
455
+ supplier: c ? be(c) : b ? we(b) : d.supplier
456
+ });
457
+ });
458
+ const t = P(
459
+ () => {
460
+ var d, c;
461
+ return typeof ((c = (d = o()) == null ? void 0 : d.supplier) == null ? void 0 : c.internal) == "string" ? V.TRANSFER : V.PURCHASE;
462
+ }
463
+ ), n = P({
464
+ get() {
465
+ var d, c;
466
+ return (c = (d = o()) == null ? void 0 : d.supplier) == null ? void 0 : c._id;
467
+ },
468
+ set(d) {
469
+ const c = o() ?? {};
470
+ if (t.value === V.PURCHASE) {
471
+ const I = (l.businessLevel ? u.businessSuppliers : u.suppliers).find((O) => O._id === d);
472
+ y({
473
+ ...c,
474
+ supplier: I ? be(I) : c.supplier
475
+ });
476
+ return;
477
+ }
478
+ const S = (_.value ? l.locations.filter((h) => h.doc._id !== l.currentLocation.doc._id) : l.locations).find((h) => h.doc._id === d);
479
+ y({
480
+ ...c,
481
+ supplier: S ? we(S) : c.supplier
482
+ });
483
+ }
484
+ }), x = P(() => u.locationSuppliers.map(be)), p = P(() => u.businessSuppliers.map(be)), s = P(() => {
485
+ var k;
486
+ const d = ((k = l._currentLocation) == null ? void 0 : k.type) === je.warehouse;
487
+ return (_.value ? l.locations.filter((b) => b.doc._id !== l.currentLocation.doc._id) : l.locations).filter((b) => d || b.acceptRequest).map(we);
488
+ }), r = P(() => {
489
+ if (t.value === V.PURCHASE) {
490
+ const c = x.value.map((b) => ({
491
+ label: b.name,
492
+ value: b._id
493
+ })), k = p.value.map((b) => ({
494
+ label: b.name,
495
+ sublabel: "Business supplier",
496
+ value: b._id
497
+ }));
498
+ return l.businessLevel ? k : [...c, ...k];
499
+ }
500
+ return s.value.map((c) => ({
501
+ label: c.name,
502
+ sublabel: c.internal ? `${c.internal}` : void 0,
503
+ value: c._id
504
+ }));
505
+ }), v = P(() => {
506
+ var b, S;
507
+ const d = (S = (b = o()) == null ? void 0 : b.supplier) == null ? void 0 : S._id;
508
+ if (t.value === V.PURCHASE) {
509
+ const h = u.suppliers.find((I) => I._id === d);
510
+ return h ? be(h) : null;
511
+ }
512
+ const k = l.locations.find((h) => h.doc._id);
513
+ return k ? we(k) : null;
514
+ });
515
+ return {
516
+ transferLocationModel: n,
517
+ transferLocationOptions: r,
518
+ locationOptionsTypePurchase: x,
519
+ locationOptionsTypeTransfer: s,
520
+ selectedLocation: v
521
+ };
522
+ }
523
+ function Ht(o) {
524
+ const y = P({
525
+ get() {
526
+ const t = o.getEffectiveAt();
527
+ return t ? new Date(t) : null;
528
+ },
529
+ set(t) {
530
+ o.setEffectiveAt((t == null ? void 0 : t.toISOString()) ?? null);
531
+ }
532
+ }), u = P({
533
+ get() {
534
+ return !!y.value;
535
+ },
536
+ set(t) {
537
+ t ? y.value = /* @__PURE__ */ new Date() : y.value = null;
538
+ }
539
+ }), l = P({
540
+ get() {
541
+ return y.value === null ? "" : Ve(y.value);
542
+ },
543
+ set(t) {
544
+ t ? y.value = /* @__PURE__ */ new Date(`${t} ${_.value}`) : y.value = null;
545
+ }
546
+ }), _ = P({
547
+ get() {
548
+ return y.value === null ? "" : ct(y.value);
549
+ },
550
+ set(t) {
551
+ t ? y.value = /* @__PURE__ */ new Date(`${l.value} ${t}`) : y.value = null;
552
+ }
553
+ });
554
+ return {
555
+ backdatePo: y,
556
+ backdateSwitch: u,
557
+ backdateModel: l,
558
+ backdateTimeModel: _
559
+ };
560
+ }
561
+ const zt = {
562
+ width: "24",
563
+ height: "24",
564
+ viewBox: "0 0 24 24",
565
+ fill: "none",
566
+ xmlns: "http://www.w3.org/2000/svg"
567
+ }, jt = ["fill"], Wt = ["fill"], Yt = ["stroke"], Zt = ["stroke"], Qt = /* @__PURE__ */ ae({
568
+ __name: "SparkIcon",
569
+ props: {
570
+ size: {
571
+ type: Number,
572
+ default: 24
573
+ },
574
+ color: {
575
+ type: String,
576
+ default: "#c7c7cc"
577
+ }
578
+ },
579
+ setup(o) {
580
+ return (y, u) => (F(), $("svg", zt, [
581
+ i("path", {
582
+ d: "M7.6 7.6C8.17076 6.94229 8.5 5.5 8.5 5.5C8.5 5.5 8.81356 6.87361 9.35714 7.5C9.92948 8.15953 11.5 8.5 11.5 8.5C11.5 8.5 9.92948 8.69761 9.35714 9.35714C8.81356 9.98354 8.5 11.5 8.5 11.5C8.5 11.5 8.32076 10.1888 7.75 9.59091C7.14905 8.96136 5.5 8.5 5.5 8.5C5.5 8.5 6.99905 8.29251 7.6 7.6Z",
583
+ fill: o.color
584
+ }, null, 8, jt),
585
+ i("path", {
586
+ d: "M12.2 12.2C13.3415 10.8846 14 8 14 8C14 8 14.6271 10.7472 15.7143 12C16.859 13.3191 20 14 20 14C20 14 16.859 14.3952 15.7143 15.7143C14.6271 16.9671 14 20 14 20C14 20 13.6415 17.3777 12.5 16.1818C11.2981 14.9227 8 14 8 14C8 14 10.9981 13.585 12.2 12.2Z",
587
+ fill: o.color
588
+ }, null, 8, Wt),
589
+ i("path", {
590
+ d: "M7.6 7.6C8.17076 6.94229 8.5 5.5 8.5 5.5C8.5 5.5 8.81356 6.87361 9.35714 7.5C9.92948 8.15953 11.5 8.5 11.5 8.5C11.5 8.5 9.92948 8.69761 9.35714 9.35714C8.81356 9.98354 8.5 11.5 8.5 11.5C8.5 11.5 8.32076 10.1888 7.75 9.59091C7.14905 8.96136 5.5 8.5 5.5 8.5C5.5 8.5 6.99905 8.29251 7.6 7.6Z",
591
+ stroke: o.color,
592
+ "stroke-width": "1.5",
593
+ "stroke-linecap": "round",
594
+ "stroke-linejoin": "round"
595
+ }, null, 8, Yt),
596
+ i("path", {
597
+ d: "M12.2 12.2C13.3415 10.8846 14 8 14 8C14 8 14.6271 10.7472 15.7143 12C16.859 13.3191 20 14 20 14C20 14 16.859 14.3952 15.7143 15.7143C14.6271 16.9671 14 20 14 20C14 20 13.6415 17.3777 12.5 16.1818C11.2981 14.9227 8 14 8 14C8 14 10.9981 13.585 12.2 12.2Z",
598
+ stroke: o.color,
599
+ "stroke-width": "1.5",
600
+ "stroke-linecap": "round",
601
+ "stroke-linejoin": "round"
602
+ }, null, 8, Zt)
603
+ ]));
604
+ }
605
+ }), Kt = { class: "flex gap-8 items-center" }, Jt = { class: "fm-typo-en-body-lg-600 line-clamp-1" }, Xt = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, Gt = { class: "flex items-center w-full" }, es = { class: "flex-1" }, ts = { class: "fm-typo-en-title-sm-800" }, ss = { class: "flex items-start gap-8" }, os = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ns = { class: "flex gap-1" }, Me = /* @__PURE__ */ ae({
606
+ __name: "ForecastStock",
607
+ props: {
608
+ disabled: { type: Boolean }
609
+ },
610
+ emits: ["update:poItems"],
611
+ setup(o, { emit: y }) {
612
+ const u = y, l = E(!1), _ = E(7), t = gt(), n = $e(), x = De(), { t: p } = pe();
613
+ async function s() {
614
+ if (_.value < 1)
615
+ return;
616
+ l.value = !1, await t.readPurchaseOrder(_.value);
617
+ const r = [];
618
+ if (t.purchaseOrderForecast.skus.length <= 0) {
619
+ n.open({
620
+ message: p("inventory.transfer.form.items.forecastStock.notAvailable"),
621
+ type: "info"
622
+ });
623
+ return;
624
+ }
625
+ const v = t.purchaseOrderForecast.skus.reduce((d, c) => {
626
+ const k = x.skus.find((h) => h._id === c.id);
627
+ if (d.find((h) => h.sku._id === c.id) || !k)
628
+ return d;
629
+ const S = {
630
+ sku: k,
631
+ code: k.code,
632
+ name: k.name,
633
+ quantity: {
634
+ amount: c.amount,
635
+ precision: 0
636
+ }
637
+ };
638
+ return d.push(S), d;
639
+ }, r);
640
+ u("update:poItems", v);
641
+ }
642
+ return (r, v) => {
643
+ const d = T("FmButton"), c = T("FmIcon"), k = T("FmStepperField"), b = T("FmPopover");
644
+ return F(), H(b, {
645
+ disabled: r.disabled,
646
+ class: "flex",
647
+ "show-popover": l.value,
648
+ onPopoverChanged: v[3] || (v[3] = (S) => l.value = S)
649
+ }, {
650
+ "popover-button": D(() => [
651
+ g(d, {
652
+ label: "unused",
653
+ variant: "secondary",
654
+ "text-color": r.disabled ? "disabled" : "primary",
655
+ "bg-color": "transparent",
656
+ "border-color": r.disabled ? "disabled" : "primary",
657
+ disabled: r.disabled
658
+ }, {
659
+ default: D(() => [
660
+ i("div", Kt, [
661
+ g(Qt, {
662
+ size: 24,
663
+ color: r.disabled ? "#c7c7cc" : "#ff7823"
664
+ }, null, 8, ["color"]),
665
+ i("div", Jt, A(e(p)("inventory.transfer.form.items.forecastStock.title")), 1)
666
+ ])
667
+ ]),
668
+ _: 1
669
+ }, 8, ["text-color", "border-color", "disabled"])
670
+ ]),
671
+ default: D(() => [
672
+ i("div", Xt, [
673
+ i("div", Gt, [
674
+ i("div", es, [
675
+ g(ht, { "z-index": 99 }, {
676
+ default: D(() => [
677
+ i("p", ts, A(e(p)("inventory.transfer.form.items.forecastStock.title")), 1)
678
+ ]),
679
+ _: 1
680
+ })
681
+ ]),
682
+ g(d, {
683
+ icon: "close",
684
+ size: "md",
685
+ variant: "tertiary",
686
+ onClick: v[0] || (v[0] = (S) => l.value = !1)
687
+ })
688
+ ]),
689
+ g(k, {
690
+ modelValue: _.value,
691
+ "onUpdate:modelValue": v[1] || (v[1] = (S) => _.value = S),
692
+ label: e(p)("inventory.transfer.form.items.forecastStock.days"),
693
+ rules: [e(xe)(1)]
694
+ }, {
695
+ "helper-text": D(() => [
696
+ i("div", ss, [
697
+ g(c, {
698
+ name: "warning",
699
+ size: "sm",
700
+ class: "text-fm-color-system-warning-300"
701
+ }),
702
+ i("div", os, A(e(p)("inventory.transfer.form.items.forecastStock.replace")), 1)
703
+ ])
704
+ ]),
705
+ _: 1
706
+ }, 8, ["modelValue", "label", "rules"]),
707
+ i("div", ns, [
708
+ v[4] || (v[4] = i("div", { class: "grow" }, null, -1)),
709
+ g(d, {
710
+ label: e(p)("common.cancel"),
711
+ variant: "tertiary",
712
+ onClick: v[2] || (v[2] = (S) => l.value = !1)
713
+ }, null, 8, ["label"]),
714
+ g(d, {
715
+ label: e(p)("inventory.transfer.form.items.forecastStock.generate"),
716
+ onClick: s
717
+ }, null, 8, ["label"])
718
+ ])
719
+ ])
720
+ ]),
721
+ _: 1
722
+ }, 8, ["disabled", "show-popover"]);
723
+ };
724
+ }
725
+ });
726
+ function ls() {
727
+ const o = $e(), y = qe(), u = E(!1);
728
+ Le(u, (n) => {
729
+ n && (_.value = !0, l().finally(() => {
730
+ _.value = !1;
731
+ }));
732
+ });
733
+ async function l() {
734
+ try {
735
+ const { startDate: n, endDate: x } = pt(6), r = (await y.getPurchaseOrders({ start: n, end: x })).filter(
736
+ (v) => {
737
+ var d, c;
738
+ return v.status === mt.enum.COMPLETE && ((d = v.supplier) == null ? void 0 : d.internal) !== "warehouse" && ((c = v.supplier) == null ? void 0 : c.internal) !== "restaurant";
739
+ }
740
+ ).reduce((v, d) => {
741
+ const c = new Date(ft(d._id)), k = d.supplier._id;
742
+ for (const b of d.items) {
743
+ if (!b.totalCost) continue;
744
+ const S = v[b.sku._id] ?? {}, h = S[k] ?? [];
745
+ h.push({
746
+ date: c.toISOString(),
747
+ totalUnit: b.quantity,
748
+ totalCost: b.totalCost,
749
+ unit: b.sku.unit,
750
+ measurement: b.measurement,
751
+ seqNumber: d.seqNumber
752
+ }), S[k] = h, v[b.sku._id] = S;
753
+ }
754
+ return v;
755
+ }, {});
756
+ t.value = r;
757
+ } catch {
758
+ o.open({
759
+ title: "Something went wrong",
760
+ message: "Cannot retrieve supplier purchase history. Please try again."
761
+ }), u.value = !1;
762
+ }
763
+ }
764
+ const _ = E(!1), t = E({});
765
+ return {
766
+ comparePricesToggle: u,
767
+ comparePriceFetching: _,
768
+ comparePriceBySku: t
769
+ };
770
+ }
771
+ const as = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, rs = { key: 0 }, is = ["colspan"], us = /* @__PURE__ */ ae({
772
+ __name: "TransferItemTable",
773
+ props: {
774
+ row: {},
775
+ comparePriceBySku: {},
776
+ showComparePrice: { type: Boolean }
777
+ },
778
+ setup(o) {
779
+ function y(u) {
780
+ return u.column.columnDef.meta;
781
+ }
782
+ return (u, l) => {
783
+ var _, t;
784
+ return F(), $(le, null, [
785
+ i("tr", {
786
+ class: ne(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm", {
787
+ "bg-fm-color-neutral-gray-100": u.row.getIsSelected()
788
+ }])
789
+ }, [
790
+ (F(!0), $(le, null, Pe(u.row.getVisibleCells(), (n) => {
791
+ var x, p, s, r;
792
+ return F(), $("td", {
793
+ key: n.id,
794
+ class: ne([
795
+ "h-[52px] px-16 text-fm-color-typo-primary",
796
+ ((x = y(n)) == null ? void 0 : x.cellClass) ?? "px-16"
797
+ ]),
798
+ style: Je({
799
+ width: (p = y(n)) == null ? void 0 : p.width,
800
+ maxWidth: (s = y(n)) == null ? void 0 : s.maxWidth,
801
+ textAlign: ((r = y(n)) == null ? void 0 : r.textAlign) ?? "left"
802
+ })
803
+ }, [
804
+ i("span", as, [
805
+ g(e(ce), {
806
+ render: n.column.columnDef.cell,
807
+ props: n.getContext()
808
+ }, null, 8, ["render", "props"])
809
+ ])
810
+ ], 6);
811
+ }), 128))
812
+ ], 2),
813
+ u.showComparePrice && Object.keys(u.comparePriceBySku[(_ = u.row.original.sku) == null ? void 0 : _._id] ?? {}).length > 0 ? (F(), $("tr", rs, [
814
+ i("td", {
815
+ colspan: u.row.getVisibleCells().length
816
+ }, [
817
+ g(Ye, {
818
+ prices: u.comparePriceBySku[(t = u.row.original.sku) == null ? void 0 : t._id]
819
+ }, null, 8, ["prices"])
820
+ ], 8, is)
821
+ ])) : N("", !0)
822
+ ], 64);
823
+ };
824
+ }
825
+ }), ds = { class: "flex flex-col gap-4" }, cs = { class: "flex items-center gap-8 overflow-x-auto pb-12" }, ps = { class: "flex flex-col gap-16" }, ms = { class: "flex flex-col gap-24" }, fs = { class: "flex flex-col gap-8" }, ys = { class: "flex flex-col gap-4" }, vs = { class: "flex flex-col gap-8" }, bs = { class: "flex flex-col gap-4" }, _s = {
826
+ key: 3,
827
+ class: "p-16 border border-fm-color-neutral-gray-300 fm-corner-radius-md flex flex-col"
828
+ }, gs = { class: "flex xs:flex-col sm:flex-col" }, ks = {
829
+ key: 0,
830
+ class: "flex-1 flex gap-8 h-48 xs:flex-col xs:pt-16 sm:flex-col sm:pt-16"
831
+ }, Cs = { class: "flex-1" }, hs = { class: "flex-1" }, ws = {
832
+ key: 1,
833
+ class: "flex items-center gap-4"
834
+ }, xs = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary translate-y-[1px]" }, Ss = { class: "flex flex-col gap-16" }, Fs = { class: "flex sm:flex-col xs:flex-col gap-16 items-center xs:items-start sm:items-start" }, Ps = { class: "flex-1 gap-8 fm-typo-en-title-sm-800" }, Ts = { class: "flex gap-8" }, Is = {
835
+ key: 0,
836
+ class: "xs:w-full"
837
+ }, $s = /* @__PURE__ */ ae({
838
+ __name: "TransferForm2",
839
+ props: {
840
+ modelValue: {},
841
+ disabled: { type: Boolean },
842
+ suppliers: {},
843
+ skus: {},
844
+ lastClosingDate: {}
845
+ },
846
+ emits: ["validation-success", "form:ready"],
847
+ setup(o, { expose: y, emit: u }) {
848
+ const l = o, _ = u, t = kt(), { t: n } = pe(), x = Ae(), p = De(), s = bt(), r = Se(), v = Ne(), d = st(), c = P(
849
+ () => d.templates.value.find((a) => a._id === t.template)
850
+ ), k = P(() => t.status === "DRAFT" || !t._rev);
851
+ Ee(async () => {
852
+ var a;
853
+ try {
854
+ if (!t.template) return;
855
+ await d.loadTemplate(t.template), t.items.length || (t.items = ((a = c.value) == null ? void 0 : a.purchaseOrder.items) ?? []);
856
+ } finally {
857
+ _("form:ready");
858
+ }
859
+ await s.readSubsidiaryOptions();
860
+ });
861
+ const b = P(
862
+ () => x.currentLocation.type === je.restaurant
863
+ );
864
+ x.watchLocation(async () => {
865
+ location && (t.supplier || (t.supplier = r.suppliers.find((a) => a) ?? t.supplier));
866
+ });
867
+ const S = et(), h = Nt(
868
+ () => t,
869
+ (a) => {
870
+ Object.assign(t, a);
871
+ }
872
+ ), I = P({
873
+ get() {
874
+ var a;
875
+ return typeof ((a = t == null ? void 0 : t.supplier) == null ? void 0 : a.internal) == "string" ? V.TRANSFER : V.PURCHASE;
876
+ },
877
+ set(a) {
878
+ var Q;
879
+ const f = typeof ((Q = t == null ? void 0 : t.supplier) == null ? void 0 : Q.internal) == "string" ? V.TRANSFER : V.PURCHASE;
880
+ a !== f && (t.supplier = a === V.PURCHASE ? h.locationOptionsTypePurchase.value[0] : h.locationOptionsTypeTransfer.value[0]);
881
+ }
882
+ }), O = P(() => h.transferLocationOptions.value), J = P({
883
+ get() {
884
+ return t.supplier._id;
885
+ },
886
+ set(a) {
887
+ h.transferLocationModel.value = a;
888
+ }
889
+ }), L = P({
890
+ get() {
891
+ return t.remark ?? void 0;
892
+ },
893
+ set(a) {
894
+ t.remark = a;
895
+ }
896
+ }), G = P({
897
+ get() {
898
+ var a;
899
+ return ((a = t.netSuite) == null ? void 0 : a.subsidiary) || {
900
+ subsidiary: {
901
+ id: "",
902
+ name: ""
903
+ }
904
+ };
905
+ },
906
+ set(a) {
907
+ t.netSuite = {
908
+ ...t.netSuite,
909
+ subsidiary: a
910
+ };
911
+ }
912
+ }), { backdatePo: j, backdateSwitch: q, backdateModel: X, backdateTimeModel: W } = Ht({
913
+ getEffectiveAt() {
914
+ return t.effectiveAt;
915
+ },
916
+ setEffectiveAt(a) {
917
+ t.effectiveAt = a;
918
+ }
919
+ }), { comparePricesToggle: m, comparePriceFetching: C, comparePriceBySku: U } = ls(), Y = E();
920
+ y({
921
+ validateInputs: () => {
922
+ var a, f;
923
+ (f = (a = Y.value) == null ? void 0 : a.validateInputs) == null || f.call(a);
924
+ },
925
+ resetInputsValidation: () => {
926
+ var a, f;
927
+ (f = (a = Y.value) == null ? void 0 : a.resetInputsValidation) == null || f.call(a);
928
+ },
929
+ resetInputs: () => {
930
+ var a, f;
931
+ (f = (a = Y.value) == null ? void 0 : a.resetInputs) == null || f.call(a);
932
+ }
933
+ });
934
+ const Z = xt({
935
+ updateItem: (a) => {
936
+ t.items = t.items.map((f) => f.sku._id !== a.sku._id ? f : a);
937
+ },
938
+ deleteItem: (a) => {
939
+ t.items = t.items.filter((f) => f.sku._id !== a.sku._id);
940
+ },
941
+ get supplier() {
942
+ return t.supplier;
943
+ },
944
+ get items() {
945
+ return t.items;
946
+ },
947
+ get transferType() {
948
+ return I.value;
949
+ },
950
+ get template() {
951
+ return c.value;
952
+ },
953
+ get disabled() {
954
+ return l.disabled;
955
+ }
956
+ }), _e = P(() => Z.columnDefs.value);
957
+ function Ze() {
958
+ var me, re, ke;
959
+ const a = new Set((ke = (re = (me = c.value) == null ? void 0 : me.purchaseOrder) == null ? void 0 : re.items) == null ? void 0 : ke.map((R) => R.sku._id)), Q = (a.size ? p.skus.filter((R) => a.has(R._id)) : p.skus).map(
960
+ (R) => ({
961
+ label: R.name,
962
+ sublabel: R.code,
963
+ value: R
964
+ })
965
+ ), ge = Q.filter((R) => {
966
+ var ee;
967
+ return (ee = t.items) == null ? void 0 : ee.find((ie) => ie.sku._id === R.value._id);
968
+ }).map((R) => R.value);
969
+ S.open({
970
+ title: n("inventory.transfer.form.items.selectItem"),
971
+ closeButton: !0,
972
+ contentComponent: _t,
973
+ contentComponentProps: {
974
+ modelValue: ge,
975
+ items: Q,
976
+ virtualScroll: !0
977
+ },
978
+ primaryActions: {
979
+ text: n("common.confirm"),
980
+ close: !0
981
+ },
982
+ secondaryActions: {
983
+ text: n("common.close"),
984
+ close: !0,
985
+ variant: "tertiary"
986
+ }
987
+ }).onPrimary((R) => {
988
+ const ee = t.items ?? [], ie = R.map((K) => {
989
+ var Ce, he;
990
+ const te = ee.find((fe) => fe.sku._id === K._id);
991
+ if (te)
992
+ return te;
993
+ const se = ((he = (Ce = c.value) == null ? void 0 : Ce.purchaseOrder.items) == null ? void 0 : he.find(
994
+ (fe) => fe.sku._id === K._id
995
+ )) ?? {
996
+ sku: K,
997
+ code: K.code,
998
+ name: K.name,
999
+ quantity: {
1000
+ amount: 1,
1001
+ precision: 0
1002
+ }
1003
+ };
1004
+ return I.value == V.PURCHASE && (se.totalCost = oe(
1005
+ se.sku,
1006
+ se.quantity,
1007
+ se.measurement,
1008
+ {
1009
+ supplier: t.supplier
1010
+ }
1011
+ )), se;
1012
+ });
1013
+ ie.sort((K, te) => K.sku.code.localeCompare(te.sku.code)), t.items = ie;
1014
+ });
1015
+ }
1016
+ function Rs(a) {
1017
+ return a;
1018
+ }
1019
+ return (a, f) => {
1020
+ var Re, Oe;
1021
+ const Q = T("FmChip"), ge = T("FmLabel"), me = T("FmField"), re = T("FmSelect"), ke = T("FmTextField"), R = T("FmTextarea"), ee = T("FmSwitch"), ie = T("FmDatePicker"), K = T("FmTimePicker"), te = T("FmFormGroup"), se = T("FmIcon"), Ce = T("FmButton"), he = T("FmTooltip"), fe = T("FmTable"), Qe = T("FmForm");
1022
+ return F(), $("div", ds, [
1023
+ i("div", cs, [
1024
+ (Re = l.modelValue) != null && Re.template ? (F(), H(Q, {
1025
+ key: 0,
1026
+ variant: a.disabled ? "warning" : void 0,
1027
+ label: `${e(n)("inventory.transfer.template.title")}: ${((Oe = c.value) == null ? void 0 : Oe.name) ?? e(n)("inventory.transfer.form.loading")}`,
1028
+ icon: "summarize",
1029
+ compact: ""
1030
+ }, null, 8, ["variant", "label"])) : N("", !0),
1031
+ g(Q, {
1032
+ label: e(x).currentLocation.name,
1033
+ icon: "storefront",
1034
+ compact: ""
1035
+ }, null, 8, ["label"]),
1036
+ a.lastClosingDate ? (F(), H(Q, {
1037
+ key: 1,
1038
+ label: `${e(n)("inventory.transfer.form.lastClosing")}: ${e(Ve)(a.lastClosingDate)} ${e(yt)(a.lastClosingDate)}`,
1039
+ icon: "calendar_month",
1040
+ compact: ""
1041
+ }, null, 8, ["label"])) : N("", !0)
1042
+ ]),
1043
+ g(Qe, {
1044
+ ref_key: "formRef",
1045
+ ref: Y,
1046
+ class: "flex flex-col gap-32",
1047
+ disabled: a.disabled,
1048
+ onValidationFailed: console.log,
1049
+ onValidationSuccess: f[13] || (f[13] = (Fe) => _("validation-success"))
1050
+ }, {
1051
+ default: D(() => {
1052
+ var Fe, Ue;
1053
+ return [
1054
+ i("div", ps, [
1055
+ i("div", ms, [
1056
+ (Fe = l.modelValue) != null && Fe.template ? (F(), $(le, { key: 0 }, [
1057
+ i("div", fs, [
1058
+ g(ge, {
1059
+ label: e(n)("inventory.transfer.form.type.title")
1060
+ }, null, 8, ["label"]),
1061
+ i("div", ys, [
1062
+ g(me, null, {
1063
+ default: D(() => [
1064
+ i("span", {
1065
+ class: ne({ "text-fm-color-typo-disabled": a.disabled })
1066
+ }, A(e(n)(`inventory.transfer.form.type.${I.value.toLocaleLowerCase("en-us")}`)), 3)
1067
+ ]),
1068
+ _: 1
1069
+ }),
1070
+ i("div", {
1071
+ class: ne([
1072
+ "fm-typo-en-body-sm-400",
1073
+ a.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
1074
+ ])
1075
+ }, " This field is locked from template. ", 2)
1076
+ ])
1077
+ ]),
1078
+ i("div", vs, [
1079
+ g(ge, {
1080
+ label: I.value === e(V).PURCHASE ? e(n)("inventory.transfer.form.purchaseFrom") : e(n)("inventory.transfer.form.transferFrom")
1081
+ }, null, 8, ["label"]),
1082
+ i("div", bs, [
1083
+ g(me, null, {
1084
+ default: D(() => {
1085
+ var w;
1086
+ return [
1087
+ i("span", {
1088
+ class: ne({ "text-fm-color-typo-disabled": a.disabled })
1089
+ }, A((w = O.value.find((ye) => ye.value === J.value)) == null ? void 0 : w.label), 3)
1090
+ ];
1091
+ }),
1092
+ _: 1
1093
+ }),
1094
+ i("div", {
1095
+ class: ne([
1096
+ "fm-typo-en-body-sm-400",
1097
+ a.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
1098
+ ])
1099
+ }, " This field is locked from template. ", 2)
1100
+ ])
1101
+ ])
1102
+ ], 64)) : (F(), $(le, { key: 1 }, [
1103
+ g(re, {
1104
+ label: e(n)("inventory.transfer.form.type.title"),
1105
+ "model-value": I.value,
1106
+ "onUpdate:modelValue": f[0] || (f[0] = (w) => I.value = w),
1107
+ items: [
1108
+ {
1109
+ label: e(n)("inventory.transfer.form.type.purchase"),
1110
+ value: e(V).PURCHASE,
1111
+ disabled: !e(h).locationOptionsTypePurchase.value.length,
1112
+ sublabel: e(h).locationOptionsTypePurchase.value.length ? void 0 : e(n)("inventory.transfer.form.noSupplierAvailable")
1113
+ },
1114
+ {
1115
+ label: e(n)("inventory.transfer.form.type.transfer"),
1116
+ value: e(V).TRANSFER,
1117
+ disabled: !e(h).locationOptionsTypeTransfer.value.length,
1118
+ sublabel: e(h).locationOptionsTypeTransfer.value.length ? void 0 : e(n)("inventory.transfer.form.noLocationAvailable")
1119
+ }
1120
+ ],
1121
+ rules: [e(xe)(1)(O.value)]
1122
+ }, null, 8, ["label", "model-value", "items", "rules"]),
1123
+ g(re, {
1124
+ label: I.value === e(V).PURCHASE ? e(n)("inventory.transfer.form.purchaseFrom") : e(n)("inventory.transfer.form.transferFrom"),
1125
+ modelValue: J.value,
1126
+ "onUpdate:modelValue": f[1] || (f[1] = (w) => J.value = w),
1127
+ items: O.value
1128
+ }, null, 8, ["label", "modelValue", "items"])
1129
+ ], 64)),
1130
+ g(ke, {
1131
+ label: e(n)("inventory.transfer.form.reference"),
1132
+ "label-mark": "optional",
1133
+ modelValue: e(t).ref,
1134
+ "onUpdate:modelValue": f[2] || (f[2] = (w) => e(t).ref = w)
1135
+ }, null, 8, ["label", "modelValue"]),
1136
+ g(R, {
1137
+ label: e(n)("inventory.transfer.form.remark"),
1138
+ "label-mark": "optional",
1139
+ "max-length": 240,
1140
+ modelValue: L.value,
1141
+ "onUpdate:modelValue": f[3] || (f[3] = (w) => L.value = w),
1142
+ class: ne([a.disabled ? "text-fm-color-typo-disabled " : ""])
1143
+ }, null, 8, ["label", "modelValue", "class"]),
1144
+ e(s).isEnabled ? (F(), H(re, {
1145
+ key: 2,
1146
+ modelValue: G.value,
1147
+ "onUpdate:modelValue": f[4] || (f[4] = (w) => G.value = w),
1148
+ label: `NetSuite ${e(n)("inventory.transfer.form.netsuite.subsidiary")}`,
1149
+ items: e(s).subsidiaryOptions,
1150
+ "label-mark": "required",
1151
+ rules: [e(Ie)()]
1152
+ }, null, 8, ["modelValue", "label", "items", "rules"])) : N("", !0),
1153
+ e(v).enableBackdatePo ? (F(), $("div", _s, [
1154
+ i("div", gs, [
1155
+ g(ee, {
1156
+ modelValue: e(q),
1157
+ "onUpdate:modelValue": f[5] || (f[5] = (w) => de(q) ? q.value = w : null),
1158
+ label: e(n)("inventory.transfer.form.backdate.title"),
1159
+ sublabel: e(n)("inventory.transfer.form.backdate.subtitle"),
1160
+ "label-placement": "right",
1161
+ disabled: b.value && !a.lastClosingDate || a.disabled
1162
+ }, null, 8, ["modelValue", "label", "sublabel", "disabled"]),
1163
+ f[14] || (f[14] = i("div", { class: "xs:hidden sm:hidden h-48 lg:w-16 md:w-16" }, null, -1)),
1164
+ e(q) ? (F(), $("div", ks, [
1165
+ i("div", Cs, [
1166
+ g(ie, {
1167
+ modelValue: e(X),
1168
+ "onUpdate:modelValue": f[6] || (f[6] = (w) => de(X) ? X.value = w : null)
1169
+ }, null, 8, ["modelValue"])
1170
+ ]),
1171
+ i("div", hs, [
1172
+ g(K, {
1173
+ modelValue: e(W),
1174
+ "onUpdate:modelValue": f[7] || (f[7] = (w) => de(W) ? W.value = w : null)
1175
+ }, null, 8, ["modelValue"])
1176
+ ])
1177
+ ])) : N("", !0)
1178
+ ]),
1179
+ e(j) ? (F(), H(te, {
1180
+ key: 0,
1181
+ modelValue: e(j),
1182
+ "onUpdate:modelValue": f[8] || (f[8] = (w) => de(j) ? j.value = w : null),
1183
+ rules: [e(vt)(new Date(a.lastClosingDate), /* @__PURE__ */ new Date())]
1184
+ }, null, 8, ["modelValue", "rules"])) : N("", !0),
1185
+ b.value && !a.lastClosingDate ? (F(), $("div", ws, [
1186
+ g(se, {
1187
+ name: "error",
1188
+ size: "sm",
1189
+ class: "text-fm-color-typo-warning"
1190
+ }),
1191
+ i("span", xs, A(e(n)("inventory.transfer.form.backdate.error")), 1)
1192
+ ])) : N("", !0)
1193
+ ])) : N("", !0)
1194
+ ])
1195
+ ]),
1196
+ i("div", Ss, [
1197
+ g(te, {
1198
+ "model-value": e(t).items,
1199
+ rules: [e(xe)(1)]
1200
+ }, null, 8, ["model-value", "rules"]),
1201
+ i("div", Fs, [
1202
+ i("div", Ps, A(e(n)("inventory.transfer.form.items.title")), 1),
1203
+ i("div", Ts, [
1204
+ g(Ce, {
1205
+ disabled: a.disabled,
1206
+ label: e(n)("inventory.transfer.form.items.addItem"),
1207
+ "prepend-icon": "add",
1208
+ variant: "secondary",
1209
+ "text-color": "primary",
1210
+ "bg-color": "transparent",
1211
+ "border-color": "primary",
1212
+ onClick: f[9] || (f[9] = (w) => Ze()),
1213
+ size: "md"
1214
+ }, null, 8, ["disabled", "label"]),
1215
+ e(t).template ? (F(), H(he, {
1216
+ key: 0,
1217
+ "z-index": 50
1218
+ }, {
1219
+ content: D(() => [
1220
+ i("div", null, A(e(n)("inventory.transfer.form.items.forecastStock.notAvailable")), 1)
1221
+ ]),
1222
+ default: D(() => [
1223
+ g(Me, {
1224
+ "onUpdate:poItems": f[10] || (f[10] = (w) => e(t).items = w),
1225
+ disabled: ""
1226
+ })
1227
+ ]),
1228
+ _: 1
1229
+ })) : (F(), H(Me, {
1230
+ key: 1,
1231
+ "onUpdate:poItems": f[11] || (f[11] = (w) => e(t).items = w),
1232
+ disabled: a.disabled || !!e(t).template
1233
+ }, null, 8, ["disabled"]))
1234
+ ])
1235
+ ]),
1236
+ I.value === e(V).PURCHASE && k.value && e(v).enableTotalCost && ((Ue = a.modelValue) != null && Ue.items.length) ? (F(), $("div", Is, [
1237
+ g(ee, {
1238
+ label: e(C) ? e(n)("inventory.transfer.form.items.fetchingData") : e(n)("inventory.transfer.form.items.comparePriceHistory"),
1239
+ "prepend-icon": "compare_arrows",
1240
+ "label-placement": "right",
1241
+ "model-value": e(m),
1242
+ "onUpdate:modelValue": f[12] || (f[12] = (w) => de(m) ? m.value = w : null),
1243
+ disabled: e(C) || a.disabled
1244
+ }, null, 8, ["label", "model-value", "disabled"])
1245
+ ])) : N("", !0),
1246
+ (F(), H(fe, {
1247
+ "column-defs": _e.value,
1248
+ "row-data": e(t).items,
1249
+ key: e(t).items.map((w) => w.sku._id).join("."),
1250
+ "hide-footer": "",
1251
+ "page-size": e(t).items.length
1252
+ }, {
1253
+ "table-row": D((w) => [
1254
+ g(us, {
1255
+ "compare-price-by-sku": e(U),
1256
+ "show-compare-price": I.value === e(V).PURCHASE && e(m),
1257
+ row: w
1258
+ }, null, 8, ["compare-price-by-sku", "show-compare-price", "row"])
1259
+ ]),
1260
+ "list-row": D((w) => [
1261
+ (F(), H(Ct, {
1262
+ row: w,
1263
+ key: e(t).items.map((ye) => ye.sku._id).join(".")
1264
+ }, {
1265
+ default: D((ye) => [
1266
+ g(qt, {
1267
+ "compare-price-by-sku": e(U),
1268
+ "show-compare-price": I.value === e(V).PURCHASE && e(m),
1269
+ row: w,
1270
+ "cell-by-col-id": ye
1271
+ }, null, 8, ["compare-price-by-sku", "show-compare-price", "row", "cell-by-col-id"])
1272
+ ]),
1273
+ _: 2
1274
+ }, 1032, ["row"]))
1275
+ ]),
1276
+ _: 1
1277
+ }, 8, ["column-defs", "row-data", "page-size"]))
1278
+ ])
1279
+ ];
1280
+ }),
1281
+ _: 1
1282
+ }, 8, ["disabled", "onValidationFailed"])
1283
+ ]);
1284
+ };
1285
+ }
1286
+ }), Vs = { class: "flex items-center" }, As = { class: "fm-typo-en-title-md-800" }, Ds = { class: "flex gap-4" }, Ys = /* @__PURE__ */ ae({
1287
+ __name: "TransferDialog",
1288
+ props: {
1289
+ mode: {},
1290
+ modelValue: {},
1291
+ templateId: {},
1292
+ show: { type: Boolean },
1293
+ lastClosingDate: {}
1294
+ },
1295
+ emits: ["update:show", "submitted"],
1296
+ setup(o, { expose: y, emit: u }) {
1297
+ var W;
1298
+ const l = o, _ = u, t = qe(), n = $e(), x = Se(), p = De(), s = Ae(), { t: r } = pe(), v = E(!1), d = E(!1), c = E(!1);
1299
+ async function k(m) {
1300
+ if (m) {
1301
+ d.value = !1;
1302
+ try {
1303
+ await x.readSuppliers(), d.value = !0;
1304
+ } catch {
1305
+ n.open({
1306
+ title: r("inventory.transfer.form.unableToFetchListOfSuppliers.title"),
1307
+ message: r("inventory.transfer.form.unableToFetchListOfSuppliers.message"),
1308
+ type: "error"
1309
+ });
1310
+ }
1311
+ }
1312
+ }
1313
+ s.watchLocation(k);
1314
+ function b() {
1315
+ return {
1316
+ remark: void 0,
1317
+ ref: void 0,
1318
+ stockSnapshotId: void 0,
1319
+ effectiveAt: void 0,
1320
+ items: [],
1321
+ supplier: {
1322
+ _rev: void 0,
1323
+ email: void 0,
1324
+ internal: void 0,
1325
+ contactName: void 0,
1326
+ phoneNumber: void 0,
1327
+ registrationNumber: void 0,
1328
+ supplyItems: void 0,
1329
+ _id: "",
1330
+ name: "",
1331
+ address: {
1332
+ line2: void 0,
1333
+ line1: "",
1334
+ state: "",
1335
+ city: "",
1336
+ postcode: "",
1337
+ country: ""
1338
+ }
1339
+ },
1340
+ status: "DRAFT",
1341
+ _id: "",
1342
+ seqNumber: 0,
1343
+ deliveryOrder: [],
1344
+ template: l.templateId
1345
+ };
1346
+ }
1347
+ const S = tt(l, "show"), h = E(l.modelValue ?? b()), I = E(((W = l.modelValue) == null ? void 0 : W._id) ?? `${Math.random()}`);
1348
+ Le(
1349
+ () => l.show,
1350
+ (m) => {
1351
+ var C;
1352
+ m && (c.value = !1, h.value = l.modelValue ?? b(), I.value = ((C = l.modelValue) == null ? void 0 : C._id) ?? `${Math.random()}`);
1353
+ }
1354
+ );
1355
+ const O = P(() => !d.value || !c.value), J = P(() => {
1356
+ switch (l.mode) {
1357
+ case ve.READ:
1358
+ return "View transfer";
1359
+ case ve.CREATE:
1360
+ return r("inventory.transfer.receiveRequest.create.title");
1361
+ case ve.UPDATE:
1362
+ return r("inventory.transfer.receiveRequest.update.title");
1363
+ }
1364
+ return "";
1365
+ }), L = E();
1366
+ y({
1367
+ validateInputs: () => {
1368
+ var m, C;
1369
+ (C = (m = L.value) == null ? void 0 : m.validateInputs) == null || C.call(m);
1370
+ },
1371
+ resetInputsValidation: () => {
1372
+ var m, C;
1373
+ (C = (m = L.value) == null ? void 0 : m.resetInputsValidation) == null || C.call(m);
1374
+ },
1375
+ resetInputs: () => {
1376
+ var m, C;
1377
+ (C = (m = L.value) == null ? void 0 : m.resetInputs) == null || C.call(m);
1378
+ }
1379
+ });
1380
+ async function G() {
1381
+ const m = h.value;
1382
+ v.value = !0, (m.supplier.internal === "warehouse" || m.supplier.internal === "restaurant") && (m.items = m.items.map(({ totalCost: C, ...U }) => U));
1383
+ try {
1384
+ await t.createPurchaseOrder(m), await new Promise((C) => setTimeout(C, 1e3)), n.open({
1385
+ title: r("inventory.transfer.receiveRequest.create.success"),
1386
+ message: r("inventory.transfer.receiveRequest.create.successMessage"),
1387
+ type: "success"
1388
+ }), _("update:show", !1), _("submitted");
1389
+ } catch (C) {
1390
+ n.open({
1391
+ title: r("inventory.transfer.receiveRequest.create.error.title"),
1392
+ message: r("inventory.transfer.receiveRequest.create.error.message"),
1393
+ type: "error"
1394
+ }), console.error("Error in creating purchase order", C);
1395
+ } finally {
1396
+ v.value = !1;
1397
+ }
1398
+ }
1399
+ async function j() {
1400
+ const m = h.value;
1401
+ v.value = !0, (m.supplier.internal === "warehouse" || m.supplier.internal === "restaurant") && (m.items = m.items.map(({ totalCost: C, ...U }) => U));
1402
+ try {
1403
+ await t.updatePurchaseOrder(m), await new Promise((C) => setTimeout(C, 1e3)), n.open({
1404
+ title: r("inventory.transfer.receiveRequest.update.success"),
1405
+ message: r("inventory.transfer.receiveRequest.update.successMessage"),
1406
+ type: "success"
1407
+ }), _("update:show", !1), _("submitted");
1408
+ } catch (C) {
1409
+ n.open({
1410
+ title: r("inventory.transfer.receiveRequest.update.error.title"),
1411
+ message: r("inventory.transfer.receiveRequest.update.error.message"),
1412
+ type: "error"
1413
+ }), console.error("Error in updating purchase order", C);
1414
+ } finally {
1415
+ v.value = !1;
1416
+ }
1417
+ }
1418
+ function q() {
1419
+ switch (l.mode) {
1420
+ case ve.CREATE:
1421
+ return G();
1422
+ case ve.UPDATE:
1423
+ return j();
1424
+ }
1425
+ }
1426
+ function X() {
1427
+ var m, C;
1428
+ (C = (m = L.value) == null ? void 0 : m.validateInputs) == null || C.call(m);
1429
+ }
1430
+ return (m, C) => {
1431
+ const U = T("FmButton"), Y = T("FmSideSheet");
1432
+ return F(), H(Y, {
1433
+ modelValue: e(S),
1434
+ "onUpdate:modelValue": C[3] || (C[3] = (Z) => de(S) ? S.value = Z : null),
1435
+ "dismiss-away": "",
1436
+ "close-button": "",
1437
+ "max-width": 900
1438
+ }, {
1439
+ "side-sheet-header": D(() => [
1440
+ i("div", Vs, [
1441
+ i("div", As, A(J.value), 1)
1442
+ ])
1443
+ ]),
1444
+ default: D(() => [
1445
+ (F(), H($s, {
1446
+ class: "w-full",
1447
+ ref_key: "formRef",
1448
+ ref: L,
1449
+ "onForm:ready": C[0] || (C[0] = () => c.value = !0),
1450
+ onValidationSuccess: q,
1451
+ modelValue: h.value,
1452
+ "onUpdate:modelValue": C[1] || (C[1] = (Z) => h.value = Z),
1453
+ disabled: v.value || O.value,
1454
+ suppliers: e(x).suppliers,
1455
+ skus: e(p).skus,
1456
+ key: I.value,
1457
+ "last-closing-date": m.lastClosingDate
1458
+ }, null, 8, ["modelValue", "disabled", "suppliers", "skus", "last-closing-date"]))
1459
+ ]),
1460
+ "side-sheet-footer": D(() => [
1461
+ i("div", Ds, [
1462
+ g(U, {
1463
+ loading: v.value,
1464
+ disabled: O.value,
1465
+ label: e(r)("common.save"),
1466
+ onClick: X
1467
+ }, null, 8, ["loading", "disabled", "label"]),
1468
+ g(U, {
1469
+ disabled: O.value,
1470
+ variant: "tertiary",
1471
+ label: e(r)("common.close"),
1472
+ onClick: C[2] || (C[2] = (Z) => _("update:show", !1))
1473
+ }, null, 8, ["disabled", "label"])
1474
+ ])
1475
+ ]),
1476
+ _: 1
1477
+ }, 8, ["modelValue"]);
1478
+ };
1479
+ }
1480
+ });
1481
+ export {
1482
+ Ys as _,
1483
+ oe as c,
1484
+ Nt as u
1485
+ };