@feedmepos/mf-inventory-portal 1.7.7-dev.4 → 1.7.7

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 (101) hide show
  1. package/dist/App-Ct-clbwd.js +311 -0
  2. package/dist/{ApprovalView-C3wOLlHv.js → ApprovalView-GQ3y8yRP.js} +9 -9
  3. package/dist/{BindingsDialog-JlcH1aTw.js → BindingsDialog-B_x8LMvt.js} +2 -2
  4. package/dist/{BindingsPicker-DkrqlfPN.js → BindingsPicker-C4rmlhNo.js} +2 -2
  5. package/dist/{BindingsTable-jpp6SPws.js → BindingsTable-SYw-DYjb.js} +3 -3
  6. package/dist/{BulkReceiveRequestView-BirdnUIo.js → BulkReceiveRequestView-CMyD6XsB.js} +896 -913
  7. package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DNR7YGEF.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-BnWxOouO.js} +1 -1
  8. package/dist/{ClosingDraftView-DIQch6xD.js → ClosingDraftView-BaSaIRL0.js} +19 -19
  9. package/dist/{ClosingHistoryView-CZJoa31l.js → ClosingHistoryView-DSmrywZa.js} +5 -5
  10. package/dist/{ClosingTemplateView-ZkzqXyT8.js → ClosingTemplateView-B37qyruZ.js} +16 -16
  11. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-CxtMXhQB.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-xiwiyiaY.js} +1 -1
  12. package/dist/{DefaultView-DWTZ6C3R.js → DefaultView-HHRPuCzZ.js} +2 -2
  13. package/dist/{DeliveryOrderPrintPreview-DzaNa2kK.js → DeliveryOrderPrintPreview-vxKT_EyZ.js} +2 -2
  14. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-DUTCUt3m.js → EmailDialog.vue_vue_type_script_setup_true_lang-CKThUy1e.js} +2301 -2308
  15. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-Ct1GCzAa.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-w76hrhQw.js} +6 -6
  16. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Lh-Vr5z8.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-SVrNjS4I.js} +2 -2
  17. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CtQGcvea.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DZdqasAP.js} +2 -2
  18. package/dist/{FmMultiselectDialog-DbnFLr4o.js → FmMultiselectDialog-CJXq4uI3.js} +1 -1
  19. package/dist/{FmMultiselectDialog-DcoxFEB2.js → FmMultiselectDialog-CmmTQGla.js} +2 -2
  20. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DKcmu7bM.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CZD1CVvQ.js} +5 -5
  21. package/dist/{ImportView-DMPur1x5.js → ImportView-BJVRrKvB.js} +6 -6
  22. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-Iq3mSUfb.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-ujJY99aa.js} +1 -1
  23. package/dist/{IngredientGroupView-BvVTo1Ke.js → IngredientGroupView-B1JXaOhq.js} +5 -5
  24. package/dist/{IngredientsView-CU69Hilq.js → IngredientsView-D6NKO-Gh.js} +16 -16
  25. package/dist/{IntegrationExplorerView-DB9Jbj1t.js → IntegrationExplorerView-BvdOXNvG.js} +4 -4
  26. package/dist/{IntegrationView-B_qDF6wh.js → IntegrationView-2ZYIuc_C.js} +376 -376
  27. package/dist/{InventoryBindingForm-BKVf7QV7.js → InventoryBindingForm-CcF_BDm-.js} +1 -1
  28. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DUjlsaXv.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CNV_bnBT.js} +5 -5
  29. package/dist/{InventoryBindingSummary-DMdzvxMo.js → InventoryBindingSummary-DiN6rNkt.js} +1 -1
  30. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DUiwhqTz.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Bo12cqUh.js} +1 -1
  31. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DC1TZ8zc.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CimBirfu.js} +1 -1
  32. package/dist/{ProductionView-AUaZW4HQ.js → ProductionView-P-LqTvzE.js} +7 -7
  33. package/dist/{PublishView-vslQlSGy.js → PublishView-ZeEaZqqy.js} +3 -3
  34. package/dist/{PurchaseOrderPrintPreview-BxzRJu3z.js → PurchaseOrderPrintPreview-CExHtihT.js} +2 -2
  35. package/dist/{ReceiveRequestView-B9vQ0two.js → ReceiveRequestView-DL1Ss34y.js} +14 -14
  36. package/dist/{RecipeView-0DnB9vpf.js → RecipeView-HOLyv97y.js} +90 -90
  37. package/dist/{SettingsView-BZ2li6OG.js → SettingsView-CRdleCee.js} +4 -4
  38. package/dist/{StockView-0PLcziHH.js → StockView-DBxrmHEr.js} +21 -21
  39. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-xR_iYH46.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-D4JR_U_Z.js} +1 -1
  40. package/dist/{SupplierView-MQpBEso3.js → SupplierView-BqijOCyT.js} +12 -12
  41. package/dist/{SurchargeView-CRmL4yf7.js → SurchargeView-Xj3KUxjo.js} +6 -6
  42. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-OAfKYJHc.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-BSPdcQZp.js} +2 -2
  43. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DLmu0Z09.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Dk7G0e7l.js} +1 -1
  44. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-DI7ugC2e.js → TransferDetails.vue_vue_type_script_setup_true_lang-xT6NiHzk.js} +20 -20
  45. package/dist/{TransferTemplateView-CUIMBNiD.js → TransferTemplateView-J92-tUO_.js} +20 -20
  46. package/dist/{UnitCostHistoryView-Dzmio_VF.js → UnitCostHistoryView-g57cYtw5.js} +4 -4
  47. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-rxm53Kpe.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-BdcVihLf.js} +4 -4
  48. package/dist/{UnitView-BF8oW55F.js → UnitView-BRTPJUUL.js} +8 -8
  49. package/dist/{WarehouseView-DMa16xHP.js → WarehouseView-1QwCjF29.js} +5 -5
  50. package/dist/{WastageTemplateView-Bf7cHP8P.js → WastageTemplateView-DZKoMLRy.js} +14 -14
  51. package/dist/api/codemax.d.ts +2 -3
  52. package/dist/{app-6IztYHx0.js → app-CegeEo5h.js} +18885 -19639
  53. package/dist/app.d.ts +9 -866
  54. package/dist/app.js +1 -1
  55. package/dist/{closing-template-MIqLe_gz.js → closing-template-D5UxukOI.js} +1 -1
  56. package/dist/{date2-DbL4HabJ.js → date2-C-GDWzCe.js} +5 -5
  57. package/dist/{dayjs.min-ePcZnrnS.js → dayjs.min-Byig1yQ9.js} +1 -1
  58. package/dist/{decimal-D-LnqjKq.js → decimal-eroTbDqK.js} +2 -2
  59. package/dist/{defineDeepModel-Bty3whQM.js → defineDeepModel-QJOziCR5.js} +1 -1
  60. package/dist/{duplicate-template-H_NPyDBN.js → duplicate-template-DrZN_ru3.js} +1 -1
  61. package/dist/{feature-CPc36p5Q.js → feature-D6GXXPff.js} +2 -2
  62. package/dist/{format-time-from-id-BkSJPBPj.js → format-time-from-id-Cj_s-cFT.js} +1 -1
  63. package/dist/{format-unit-display-BOclhjP_.js → format-unit-display-DN98qBJs.js} +27 -27
  64. package/dist/{import-export.helper-DamKVb5B.js → import-export.helper-NknO9288.js} +6 -6
  65. package/dist/{index-DYv_DAVd.js → index-D2MIrxVZ.js} +37 -31
  66. package/dist/{index-Ya7If-Ie.js → index-DPbEVw86.js} +1 -1
  67. package/dist/{index-BJdt1ytp.js → index-DYKM4puu.js} +1 -1
  68. package/dist/{inventory-core-dart.default-iDYPRIr1.js → inventory-core-dart.default-YlbNYG1d.js} +1 -1
  69. package/dist/{lz-string--yaiymH2.js → lz-string-K_57q5YR.js} +1 -1
  70. package/dist/{netsuite-DMU7KBLH.js → netsuite-9yeyNqUg.js} +2 -2
  71. package/dist/{number-CnoNE3dq.js → number-CV-_xcmY.js} +3 -3
  72. package/dist/{predefined-templates-j-OmxHRV.js → predefined-templates-DuoWmhYv.js} +1 -1
  73. package/dist/{purchase-order-template-qrm11ZSb.js → purchase-order-template-BHlAdzEG.js} +1 -1
  74. package/dist/{recalculationUtils-DdROokZS.js → recalculationUtils-DVkOvHEE.js} +1 -1
  75. package/dist/{rules-C9KpfT_c.js → rules-CTKq3x64.js} +2 -2
  76. package/dist/{stock-k1HJnDb5.js → stock-B22_nRFF.js} +3 -3
  77. package/dist/{stock-DFl6hM8p.js → stock-BSaEC2u4.js} +1 -1
  78. package/dist/style.css +1 -1
  79. package/dist/{supplier-1RVDAJgt.js → supplier-DR_5qF95.js} +2 -2
  80. package/dist/{surcharge-BGpOQVQk.js → surcharge-DSqDRLyV.js} +8 -8
  81. package/dist/tsconfig.app.tsbuildinfo +1 -1
  82. package/dist/{uom-rules-u_8oQL8X.js → uom-rules-DeDTqzIO.js} +1 -1
  83. package/dist/{use-ingredient-select-dialog-CWD-rBKb.js → use-ingredient-select-dialog-r4uUF4br.js} +2 -2
  84. package/dist/{use-inventory-binding-dialog-MAXDJLSD.js → use-inventory-binding-dialog-COAfAZoQ.js} +2 -2
  85. package/dist/{use-template-enabled-locations-BKKnG3h9.js → use-template-enabled-locations-CsjbDWWR.js} +2 -2
  86. package/dist/{use-transfer-locations-Do66oqYE.js → use-transfer-locations-CE5jC9rF.js} +2 -2
  87. package/dist/{useHrmPermission-Kwlb-xbn.js → useHrmPermission-B1laswqe.js} +1 -1
  88. package/dist/{useNavigationMenu-Or_fkxv1.js → useNavigationMenu-Dk50LuHw.js} +2 -2
  89. package/dist/{useSseClient-ClQjN-eX.js → useSseClient-DD0mCXGT.js} +1 -1
  90. package/dist/{vue-i18n-B8mT1TfS.js → vue-i18n-D8emVl6r.js} +178 -178
  91. package/dist/{xlsx.util-D6RuisON.js → xlsx.util-BFraXVxh.js} +2 -2
  92. package/package.json +5 -5
  93. package/dist/App-e4ZmCNvN.js +0 -978
  94. package/dist/api/changelog.d.ts +0 -46
  95. package/dist/views/changelog/components/ChangelogDialog.vue.d.ts +0 -19
  96. package/dist/views/changelog/components/ChangelogFloatingButton.vue.d.ts +0 -2
  97. package/dist/views/changelog/components/ChangelogPanel.vue.d.ts +0 -18
  98. package/dist/views/changelog/composables/change-path.d.ts +0 -10
  99. package/dist/views/changelog/composables/commit-message.d.ts +0 -9
  100. package/dist/views/changelog/composables/commit-message.spec.d.ts +0 -1
  101. package/dist/views/changelog/composables/use-changelog.d.ts +0 -36
@@ -1,86 +1,85 @@
1
- import { defineComponent as nt, ref as C, computed as L, watch as Ve, createElementBlock as y, openBlock as m, Fragment as he, createBlock as ue, createVNode as E, Teleport as lt, Transition as qt, withCtx as Pe, createCommentVNode as D, createElementVNode as e, toDisplayString as v, unref as t, normalizeClass as J, renderList as Ke, createTextVNode as st, withModifiers as Nt, mergeModels as $t, useModel as At, resolveComponent as Ce, h as _e, onMounted as Ot, onUnmounted as Bt, normalizeStyle as mt, watchEffect as Tt, isRef as bt, normalizeProps as ht, mergeProps as ct, guardReactiveProps as It } from "vue";
2
- import { u as Lt, l as zt } from "./netsuite-DMU7KBLH.js";
3
- import { u as it, a as Mt, G as Ut, T as gt, s as Vt, U as Ye, q as Jt, c as jt, D as at, x as Wt } from "./app-6IztYHx0.js";
4
- import { i as ft, _ as Yt } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-Ct1GCzAa.js";
5
- import { a as _t, d as Ht } from "./number-CnoNE3dq.js";
6
- import { b as Qt, d as Kt, c as Gt, e as Xt, f as Zt, P as Ft, h as en, a as tn, _ as nn, g as on } from "./TransferDetails.vue_vue_type_script_setup_true_lang-DI7ugC2e.js";
7
- import { i as sn } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-DC1TZ8zc.js";
8
- import { d as He } from "./dayjs.min-ePcZnrnS.js";
9
- import { e as an } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-rxm53Kpe.js";
10
- import { u as rn } from "./useTabStorage-BkIVScW_.js";
11
- import { u as ln, _ as un } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DwrLsWX_.js";
12
- import { components as cn, useSnackbar as ut, useDialog as dn, useBreakpoints as mn } from "@feedmepos/ui-library";
13
- import { c as fn, u as pn, _ as vn, a as yn, b as bn } from "./EmailDialog.vue_vue_type_script_setup_true_lang-DUTCUt3m.js";
14
- import { useI18n as ot, useCoreStore as St } from "@feedmepos/mf-common";
15
- import { u as Rt, a as hn } from "./supplier-1RVDAJgt.js";
16
- import { u as gn } from "./stock-DFl6hM8p.js";
17
- import { u as Ge } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-OAfKYJHc.js";
18
- import { b as Pt, a as _n } from "./format-unit-display-BOclhjP_.js";
19
- import { P as xn } from "./inventory-core-dart.default-iDYPRIr1.js";
20
- import { _ as wn, F as et } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js";
21
- import { u as Dt } from "./feature-CPc36p5Q.js";
22
- import { P as kn, J as Cn, D as Fn } from "./app-C39bYJmq.js";
23
- import { a as Sn, t as Rn } from "./date2-DbL4HabJ.js";
24
- import { F as xt } from "./form-mode.enum-BKiNVH6A.js";
25
- import { p as Pn } from "./format-time-from-id-BkSJPBPj.js";
26
- import { defineStore as Dn } from "pinia";
27
- import { u as En } from "./useSseClient-ClQjN-eX.js";
28
- import { u as qn } from "./use-row-action-Cvq6VO38.js";
29
- import { R as rt, D as Nn } from "./row-action.enum-ncgDYAjP.js";
30
- import { u as $n } from "./vue-i18n-B8mT1TfS.js";
31
- const An = {
1
+ import { defineComponent as tt, ref as k, computed as L, watch as Ve, createElementBlock as y, openBlock as m, Fragment as ye, createBlock as le, createVNode as E, Teleport as lt, Transition as Dt, withCtx as Pe, createCommentVNode as D, createElementVNode as e, toDisplayString as p, unref as t, normalizeClass as J, renderList as Qe, createTextVNode as ot, withModifiers as Et, mergeModels as qt, useModel as Nt, resolveComponent as Ce, h as xe, onMounted as At, onUnmounted as $t, normalizeStyle as mt, watchEffect as Ot, isRef as bt, normalizeProps as ht, mergeProps as ct, guardReactiveProps as Bt } from "vue";
2
+ import { u as Tt, l as It } from "./netsuite-9yeyNqUg.js";
3
+ import { u as it, a as Lt, G as zt, T as gt, s as Mt, U as Ye, q as Ut, c as Vt, D as st, x as Jt } from "./app-CegeEo5h.js";
4
+ import { i as ft, _ as jt } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-w76hrhQw.js";
5
+ import { a as xt, d as Wt } from "./number-CV-_xcmY.js";
6
+ import { b as Yt, d as Ht, c as Qt, e as Kt, f as Gt, P as kt, h as Xt, a as Zt, _ as en, g as tn } from "./TransferDetails.vue_vue_type_script_setup_true_lang-xT6NiHzk.js";
7
+ import { i as nn } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-CimBirfu.js";
8
+ import { d as He } from "./dayjs.min-Byig1yQ9.js";
9
+ import { e as on } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-BdcVihLf.js";
10
+ import { u as sn } from "./useTabStorage-BkIVScW_.js";
11
+ import { u as an, _ as rn } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DwrLsWX_.js";
12
+ import { components as ln, useSnackbar as ut, useDialog as un, useBreakpoints as cn } from "@feedmepos/ui-library";
13
+ import { c as dn, u as mn, _ as fn, a as pn, b as vn } from "./EmailDialog.vue_vue_type_script_setup_true_lang-CKThUy1e.js";
14
+ import { useI18n as nt, useCoreStore as Ct } from "@feedmepos/mf-common";
15
+ import { u as Ft, a as yn } from "./supplier-DR_5qF95.js";
16
+ import { u as bn } from "./stock-BSaEC2u4.js";
17
+ import { u as Ke } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-BSPdcQZp.js";
18
+ import { b as St, a as hn } from "./format-unit-display-DN98qBJs.js";
19
+ import { P as gn } from "./inventory-core-dart.default-YlbNYG1d.js";
20
+ import { _ as xn, F as Ze } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js";
21
+ import { u as Rt } from "./feature-D6GXXPff.js";
22
+ import { P as _n, J as wn, D as kn } from "./app-C39bYJmq.js";
23
+ import { d as Cn, t as Fn } from "./date2-C-GDWzCe.js";
24
+ import { F as _t } from "./form-mode.enum-BKiNVH6A.js";
25
+ import { p as Sn } from "./format-time-from-id-Cj_s-cFT.js";
26
+ import { defineStore as Rn } from "pinia";
27
+ import { u as Pn } from "./use-row-action-Cvq6VO38.js";
28
+ import { R as at, D as Dn } from "./row-action.enum-ncgDYAjP.js";
29
+ import { u as En } from "./vue-i18n-D8emVl6r.js";
30
+ const qn = {
32
31
  key: 0,
33
32
  class: "fixed inset-0 z-[200] bg-white flex flex-col overflow-hidden",
34
33
  style: { "font-family": "Inter, sans-serif" }
35
- }, On = {
34
+ }, Nn = {
36
35
  key: 0,
37
36
  class: "flex items-center justify-between px-24 h-[64px] border-b border-[#F0F0F0] shrink-0 bg-white"
38
- }, Bn = { class: "fm-typo-en-title-md-800 text-[#1C1C1E]" }, Tn = { class: "flex items-center gap-8" }, In = {
37
+ }, An = { class: "fm-typo-en-title-md-800 text-[#1C1C1E]" }, $n = { class: "flex items-center gap-8" }, On = {
39
38
  key: 1,
40
39
  class: "flex items-center justify-center px-32 py-16 border-b border-[#F0F0F0] shrink-0 bg-white"
41
- }, Ln = { class: "flex items-center max-w-[600px] w-full" }, zn = ["disabled"], Mn = { key: 1 }, Un = ["disabled"], Vn = { key: 1 }, Jn = {
40
+ }, Bn = { class: "flex items-center max-w-[600px] w-full" }, Tn = ["disabled"], In = { key: 1 }, Ln = ["disabled"], zn = { key: 1 }, Mn = {
42
41
  class: "flex flex-col items-center gap-4 min-w-0",
43
42
  disabled: !0
44
- }, jn = { class: "flex flex-1 overflow-hidden" }, Wn = { class: "flex-1 min-w-0 overflow-y-auto" }, Yn = {
43
+ }, Un = { class: "flex flex-1 overflow-hidden" }, Vn = { class: "flex-1 min-w-0 overflow-y-auto" }, Jn = {
45
44
  key: 0,
46
45
  class: "px-32 py-24"
47
- }, Hn = { class: "flex flex-col gap-4 mb-10" }, Qn = { class: "fm-typo-en-title-sm-700 text-[#1C1C1E]" }, Kn = { class: "fm-typo-en-body-md-400 text-[#4B4B4B]" }, Gn = { class: "mb-12" }, Xn = { class: "border border-[#E0E0E0] rounded-sm overflow-hidden bg-white" }, Zn = ["onClick"], eo = { class: "w-32 h-32 rounded-full bg-[#F0F0F0] flex items-center justify-center shrink-0" }, to = { class: "fm-typo-en-body-xs text-[#6B6C70]" }, no = { class: "flex-1 min-w-0" }, oo = { class: "fm-typo-en-body-md-600 text-[#1C1C1E]" }, so = { class: "fm-typo-en-body-sm-400 text-[#6B6C70] truncate" }, ao = { class: "text-[10px] leading-[12px] font-semibold text-[#6B6C70] bg-[#F6F7F8] px-4 py-1 rounded-[4px] uppercase tracking-[0.08em] shrink-0" }, ro = {
46
+ }, jn = { class: "flex flex-col gap-4 mb-10" }, Wn = { class: "fm-typo-en-title-sm-700 text-[#1C1C1E]" }, Yn = { class: "fm-typo-en-body-md-400 text-[#4B4B4B]" }, Hn = { class: "mb-12" }, Qn = { class: "border border-[#E0E0E0] rounded-sm overflow-hidden bg-white" }, Kn = ["onClick"], Gn = { class: "w-32 h-32 rounded-full bg-[#F0F0F0] flex items-center justify-center shrink-0" }, Xn = { class: "fm-typo-en-body-xs text-[#6B6C70]" }, Zn = { class: "flex-1 min-w-0" }, eo = { class: "fm-typo-en-body-md-600 text-[#1C1C1E]" }, to = { class: "fm-typo-en-body-sm-400 text-[#6B6C70] truncate" }, no = { class: "text-[10px] leading-[12px] font-semibold text-[#6B6C70] bg-[#F6F7F8] px-4 py-1 rounded-[4px] uppercase tracking-[0.08em] shrink-0" }, oo = {
48
47
  key: 0,
49
48
  class: "w-[8px] h-[8px] rounded-full bg-[#FF7823]"
50
- }, lo = {
49
+ }, so = {
51
50
  key: 0,
52
51
  class: "py-40 text-center text-[#B2B3B6] fm-typo-en-body-md-400"
53
- }, io = {
52
+ }, ao = {
54
53
  key: 1,
55
54
  class: "px-32 py-24"
56
- }, uo = { class: "flex flex-col gap-4 mb-12" }, co = { class: "fm-typo-en-title-sm-700 text-[#1C1C1E]" }, mo = { class: "fm-typo-en-body-md-400 text-[#4B4B4B]" }, fo = { class: "grid grid-cols-2 gap-12 mb-12" }, po = { class: "flex items-start justify-between mb-12" }, vo = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-4" }, yo = { class: "fm-typo-en-body-sm-400 text-[#6B6C70]" }, bo = { class: "flex items-start justify-between mb-12" }, ho = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-4" }, go = { class: "fm-typo-en-body-sm-400 text-[#6B6C70]" }, _o = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-12" }, xo = { class: "mb-12" }, wo = { class: "border border-[#E0E0E0] rounded-xl overflow-hidden bg-white" }, ko = ["onClick"], Co = { class: "w-32 h-32 rounded-full bg-[#F0F0F0] flex items-center justify-center shrink-0" }, Fo = { class: "fm-typo-en-body-xs-600 text-[#6B6C70]" }, So = { class: "flex-1 min-w-0" }, Ro = { class: "fm-typo-en-body-md-600 text-[#1C1C1E]" }, Po = { class: "fm-typo-en-body-sm-400 text-[#6B6C70] truncate" }, Do = { class: "text-[10px] leading-[12px] font-semibold text-[#6B6C70] bg-[#F6F7F8] px-4 py-1 rounded-[4px] uppercase tracking-[0.08em] shrink-0" }, Eo = {
55
+ }, ro = { class: "flex flex-col gap-4 mb-12" }, lo = { class: "fm-typo-en-title-sm-700 text-[#1C1C1E]" }, io = { class: "fm-typo-en-body-md-400 text-[#4B4B4B]" }, uo = { class: "grid grid-cols-2 gap-12 mb-12" }, co = { class: "flex items-start justify-between mb-12" }, mo = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-4" }, fo = { class: "fm-typo-en-body-sm-400 text-[#6B6C70]" }, po = { class: "flex items-start justify-between mb-12" }, vo = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-4" }, yo = { class: "fm-typo-en-body-sm-400 text-[#6B6C70]" }, bo = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-12" }, ho = { class: "mb-12" }, go = { class: "border border-[#E0E0E0] rounded-xl overflow-hidden bg-white" }, xo = ["onClick"], _o = { class: "w-32 h-32 rounded-full bg-[#F0F0F0] flex items-center justify-center shrink-0" }, wo = { class: "fm-typo-en-body-xs-600 text-[#6B6C70]" }, ko = { class: "flex-1 min-w-0" }, Co = { class: "fm-typo-en-body-md-600 text-[#1C1C1E]" }, Fo = { class: "fm-typo-en-body-sm-400 text-[#6B6C70] truncate" }, So = { class: "text-[10px] leading-[12px] font-semibold text-[#6B6C70] bg-[#F6F7F8] px-4 py-1 rounded-[4px] uppercase tracking-[0.08em] shrink-0" }, Ro = {
57
56
  key: 0,
58
57
  class: "w-[8px] h-[8px] rounded-full bg-[#FF7823]"
59
- }, qo = {
58
+ }, Po = {
60
59
  key: 0,
61
60
  class: "py-32 text-center text-[#B2B3B6] fm-typo-en-body-md-400"
62
- }, No = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-12" }, $o = { class: "mb-12" }, Ao = {
61
+ }, Do = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-12" }, Eo = { class: "mb-12" }, qo = {
63
62
  key: 0,
64
63
  class: "py-32 flex justify-center"
65
- }, Oo = {
64
+ }, No = {
66
65
  key: 1,
67
66
  class: "py-32 text-center text-[#B2B3B6] fm-typo-en-body-md-400"
68
- }, Bo = {
67
+ }, Ao = {
69
68
  key: 2,
70
69
  class: "flex flex-col gap-8"
71
- }, To = ["onClick"], Io = { class: "flex-1 min-w-0" }, Lo = { class: "fm-typo-en-body-md-600 text-[#1C1C1E] mb-2" }, zo = { class: "fm-typo-en-body-sm-400 text-[#6B6C70]" }, Mo = {
70
+ }, $o = ["onClick"], Oo = { class: "flex-1 min-w-0" }, Bo = { class: "fm-typo-en-body-md-600 text-[#1C1C1E] mb-2" }, To = { class: "fm-typo-en-body-sm-400 text-[#6B6C70]" }, Io = {
72
71
  key: 0,
73
72
  class: "w-[8px] h-[8px] rounded-full bg-[#FF7823]"
74
- }, Uo = {
73
+ }, Lo = {
75
74
  key: 2,
76
75
  class: "px-32 py-24"
77
- }, Vo = { class: "flex flex-col gap-4 mb-12" }, Jo = { class: "fm-typo-en-title-sm-700 text-[#1C1C1E]" }, jo = { class: "w-[332px] shrink-0 border-l border-[#F0F0F0] overflow-y-auto bg-white" }, Wo = { class: "p-4" }, Yo = { class: "flex flex-col gap-0 border border-[#E9EAEC] rounded-2xl bg-white overflow-hidden" }, Ho = { class: "px-10 py-5 border-b border-[#F0F0F0]" }, Qo = { class: "fm-typo-en-body-md-700 text-[#1C1C1E]" }, Ko = { class: "flex flex-col gap-0.5 px-10 py-4 border-b border-[#F0F0F0]" }, Go = { class: "text-[11px] leading-[14px] font-medium text-[#6B6C70]" }, Xo = {
76
+ }, zo = { class: "flex flex-col gap-4 mb-12" }, Mo = { class: "fm-typo-en-title-sm-700 text-[#1C1C1E]" }, Uo = { class: "w-[332px] shrink-0 border-l border-[#F0F0F0] overflow-y-auto bg-white" }, Vo = { class: "p-4" }, Jo = { class: "flex flex-col gap-0 border border-[#E9EAEC] rounded-2xl bg-white overflow-hidden" }, jo = { class: "px-10 py-5 border-b border-[#F0F0F0]" }, Wo = { class: "fm-typo-en-body-md-700 text-[#1C1C1E]" }, Yo = { class: "flex flex-col gap-0.5 px-10 py-4 border-b border-[#F0F0F0]" }, Ho = { class: "text-[11px] leading-[14px] font-medium text-[#6B6C70]" }, Qo = {
78
77
  key: 0,
79
78
  class: "text-[11px] leading-[14px] text-[#6B6C70]"
80
- }, Zo = { class: "flex flex-col gap-0.5 px-10 py-4 border-b border-[#F0F0F0]" }, es = { class: "text-[11px] leading-[14px] font-medium text-[#6B6C70]" }, ts = { class: "flex flex-col gap-0.5 px-10 py-4 border-b border-[#F0F0F0]" }, ns = { class: "text-[11px] leading-[14px] font-medium text-[#6B6C70]" }, os = {
79
+ }, Ko = { class: "flex flex-col gap-0.5 px-10 py-4 border-b border-[#F0F0F0]" }, Go = { class: "text-[11px] leading-[14px] font-medium text-[#6B6C70]" }, Xo = { class: "flex flex-col gap-0.5 px-10 py-4 border-b border-[#F0F0F0]" }, Zo = { class: "text-[11px] leading-[14px] font-medium text-[#6B6C70]" }, es = {
81
80
  key: 0,
82
81
  class: "text-[11px] leading-[14px] text-[#6B6C70]"
83
- }, ss = { class: "flex items-center justify-between gap-8 px-10 py-4" }, as = { class: "text-[15px] leading-[20px] font-semibold text-[#1C1C1E]" }, rs = { class: "fm-typo-en-title-md-600" }, ls = { class: "flex flex-col gap-16" }, is = { class: "fm-typo-en-body-md-400" }, us = { class: "max-h-[300px] overflow-y-auto" }, cs = { class: "list-disc pl-16" }, ds = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ms = { class: "flex w-full gap-8 justify-end" }, fs = /* @__PURE__ */ nt({
82
+ }, ts = { class: "flex items-center justify-between gap-8 px-10 py-4" }, ns = { class: "text-[15px] leading-[20px] font-semibold text-[#1C1C1E]" }, os = { class: "fm-typo-en-title-md-600" }, ss = { class: "flex flex-col gap-16" }, as = { class: "fm-typo-en-body-md-400" }, rs = { class: "max-h-[300px] overflow-y-auto" }, ls = { class: "list-disc pl-16" }, is = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, us = { class: "flex w-full gap-8 justify-end" }, cs = /* @__PURE__ */ tt({
84
83
  __name: "CreateTransferWizard",
85
84
  props: {
86
85
  show: { type: Boolean },
@@ -88,15 +87,15 @@ const An = {
88
87
  selectedOutletIds: {}
89
88
  },
90
89
  emits: ["update:show", "submitted"],
91
- setup(x, { emit: h }) {
92
- const { FmButton: k, FmDialog: A, FmIcon: S, FmTextField: M } = cn, Y = x, O = h, { t: c } = ot(), l = ut(), g = it(), U = Rt(), fe = Mt(), p = gn(), f = Ge(), d = Pt(), i = C(0), _ = C(!1), o = C(null), H = C(""), R = C(null), q = C(null), z = C(null), pe = C(""), G = C(""), se = C(!1), ee = C(!1), de = C(!1), De = C(!1), xe = C(!1), $e = C(/* @__PURE__ */ new Map()), Ee = C(), ve = C([]), ge = L(() => !!o.value), Ae = L(() => R.value === "transfer" ? !!q.value : R.value === "template" ? !!z.value : !1), Fe = L(() => (ve.value.length ? ve.value : $.value.items ?? []).some((a) => a.quantity.amount > 0)), Xe = L(() => se.value), qe = L(
93
- () => Fe.value && ee.value && de.value && !se.value
94
- ), Oe = L(() => i.value === 0 ? ge.value : i.value === 1 ? Ae.value : i.value === 2 ? qe.value : !1), Se = L(
90
+ setup(_, { emit: h }) {
91
+ const { FmButton: w, FmDialog: O, FmIcon: S, FmTextField: z } = ln, Y = _, $ = h, { t: c } = nt(), l = ut(), g = it(), V = Ft(), de = Lt(), v = bn(), f = Ke(), d = St(), i = k(0), C = k(!1), o = k(null), H = k(""), R = k(null), N = k(null), M = k(null), be = k(""), he = k(""), ue = k(!1), ne = k(!1), ve = k(!1), De = k(!1), _e = k(!1), Ae = k(/* @__PURE__ */ new Map()), Ee = k(), me = k([]), ge = L(() => !!o.value), $e = L(() => R.value === "transfer" ? !!N.value : R.value === "template" ? !!M.value : !1), Fe = L(() => (me.value.length ? me.value : A.value.items ?? []).some((a) => a.quantity.amount > 0)), Ge = L(() => ue.value), qe = L(
92
+ () => Fe.value && ne.value && ve.value && !ue.value
93
+ ), Oe = L(() => i.value === 0 ? ge.value : i.value === 1 ? $e.value : i.value === 2 ? qe.value : !1), Se = L(
95
94
  () => i.value === 2 ? c("inventory.transfer.receiveRequest.bulk.wizard.createTransferBtn") : c("inventory.transfer.receiveRequest.bulk.wizard.continueBtn")
96
95
  ), P = L(
97
- () => ne.value === "Purchase" ? "Purchase method" : "Transfer method"
96
+ () => ee.value === "Purchase" ? "Purchase method" : "Transfer method"
98
97
  ), F = L(
99
- () => ne.value === "Purchase" ? "Purchase details" : "Transfer details"
98
+ () => ee.value === "Purchase" ? "Purchase details" : "Transfer details"
100
99
  ), B = L(() => {
101
100
  const n = H.value.trim().toLowerCase();
102
101
  let a = g.locations;
@@ -104,72 +103,72 @@ const An = {
104
103
  (s) => s.name.toLowerCase().includes(n) || (s.doc.profile.code ?? "").toLowerCase().includes(n)
105
104
  ) : a;
106
105
  }), K = L(() => {
107
- var ye;
108
- const n = (ye = o.value) == null ? void 0 : ye.doc._id, a = U.suppliers.map((re) => ({
109
- doc: re,
110
- name: re.name,
106
+ var fe;
107
+ const n = (fe = o.value) == null ? void 0 : fe.doc._id, a = V.suppliers.map((se) => ({
108
+ doc: se,
109
+ name: se.name,
111
110
  dbName: "",
112
111
  type: "supplier",
113
112
  acceptRequest: !0
114
- })), Z = [
113
+ })), X = [
115
114
  ...g.allLocations ?? g.locations,
116
115
  ...a
117
- ].filter((re) => re.doc._id !== n), oe = pe.value.trim().toLowerCase();
118
- return oe ? Z.filter((re) => {
119
- var Ze;
120
- const Ue = re.type === "supplier" ? "" : ((Ze = re.doc.profile) == null ? void 0 : Ze.code) ?? "";
121
- return re.name.toLowerCase().includes(oe) || Ue.toLowerCase().includes(oe);
122
- }) : Z;
123
- }), X = L(() => {
124
- const n = G.value.trim().toLowerCase(), a = d.templates;
116
+ ].filter((se) => se.doc._id !== n), te = be.value.trim().toLowerCase();
117
+ return te ? X.filter((se) => {
118
+ var Xe;
119
+ const Ue = se.type === "supplier" ? "" : ((Xe = se.doc.profile) == null ? void 0 : Xe.code) ?? "";
120
+ return se.name.toLowerCase().includes(te) || Ue.toLowerCase().includes(te);
121
+ }) : X;
122
+ }), G = L(() => {
123
+ const n = he.value.trim().toLowerCase(), a = d.templates;
125
124
  return n ? a.filter((s) => s.name.toLowerCase().includes(n)) : a;
126
- }), ne = L(() => {
125
+ }), ee = L(() => {
127
126
  var n;
128
- if ($.value.supplier)
129
- return typeof $.value.supplier.internal == "string" ? "Transfer" : "Purchase";
130
- if (R.value === "transfer" && q.value)
131
- return q.value.type === "supplier" ? "Purchase" : "Transfer";
132
- if (R.value === "template" && z.value) {
127
+ if (A.value.supplier)
128
+ return typeof A.value.supplier.internal == "string" ? "Transfer" : "Purchase";
129
+ if (R.value === "transfer" && N.value)
130
+ return N.value.type === "supplier" ? "Purchase" : "Transfer";
131
+ if (R.value === "template" && M.value) {
133
132
  const a = d.templates.find(
134
- (s) => s._id === z.value
133
+ (s) => s._id === M.value
135
134
  );
136
135
  if ((n = a == null ? void 0 : a.purchaseOrder) != null && n.supplier)
137
136
  return typeof a.purchaseOrder.supplier.internal == "string" ? "Transfer" : "Purchase";
138
137
  }
139
138
  return "Transfer";
140
- }), Re = L(() => o.value ? o.value.name : c("inventory.transfer.receiveRequest.bulk.wizard.notSelected")), we = L(() => R.value === "transfer" ? ne.value === "Purchase" ? "Purchase from Supplier" : c("inventory.transfer.receiveRequest.bulk.wizard.outletToOutletMethod") : R.value === "template" ? c("inventory.transfer.receiveRequest.bulk.wizard.fromTemplateMethod") : c("inventory.transfer.receiveRequest.bulk.wizard.notChosen")), j = L(() => {
139
+ }), Re = L(() => o.value ? o.value.name : c("inventory.transfer.receiveRequest.bulk.wizard.notSelected")), we = L(() => R.value === "transfer" ? ee.value === "Purchase" ? "Purchase from Supplier" : c("inventory.transfer.receiveRequest.bulk.wizard.outletToOutletMethod") : R.value === "template" ? c("inventory.transfer.receiveRequest.bulk.wizard.fromTemplateMethod") : c("inventory.transfer.receiveRequest.bulk.wizard.notChosen")), j = L(() => {
141
140
  var n;
142
- if (R.value === "transfer" && q.value)
143
- return q.value.name;
144
- if (R.value === "template" && z.value) {
145
- const a = d.templates.find((s) => s._id === z.value);
146
- return (n = a == null ? void 0 : a.purchaseOrder) != null && n.supplier ? a.purchaseOrder.supplier.name || z.value : (a == null ? void 0 : a.name) ?? z.value;
141
+ if (R.value === "transfer" && N.value)
142
+ return N.value.name;
143
+ if (R.value === "template" && M.value) {
144
+ const a = d.templates.find((s) => s._id === M.value);
145
+ return (n = a == null ? void 0 : a.purchaseOrder) != null && n.supplier ? a.purchaseOrder.supplier.name || M.value : (a == null ? void 0 : a.name) ?? M.value;
147
146
  }
148
147
  return c("inventory.transfer.receiveRequest.bulk.wizard.noneYet");
149
148
  });
150
- function le(n) {
151
- var Z, oe, ye, re, Ue;
152
- const a = (Z = n.doc.profile) != null && Z.code ? `#${n.doc.profile.code}` : "", s = [(ye = (oe = n.doc.profile) == null ? void 0 : oe.address) == null ? void 0 : ye.line1, (Ue = (re = n.doc.profile) == null ? void 0 : re.address) == null ? void 0 : Ue.city].filter(Boolean).join(" · ");
149
+ function ae(n) {
150
+ var X, te, fe, se, Ue;
151
+ const a = (X = n.doc.profile) != null && X.code ? `#${n.doc.profile.code}` : "", s = [(fe = (te = n.doc.profile) == null ? void 0 : te.address) == null ? void 0 : fe.line1, (Ue = (se = n.doc.profile) == null ? void 0 : se.address) == null ? void 0 : Ue.city].filter(Boolean).join(" · ");
153
152
  return [a, s].filter(Boolean).join(" · ");
154
153
  }
155
154
  function Be(n) {
156
- var s, Z;
157
- return [(s = n.doc.address) == null ? void 0 : s.line1, (Z = n.doc.address) == null ? void 0 : Z.city].filter(Boolean).join(" · ");
155
+ var s, X;
156
+ return [(s = n.doc.address) == null ? void 0 : s.line1, (X = n.doc.address) == null ? void 0 : X.city].filter(Boolean).join(" · ");
158
157
  }
159
158
  function Te(n) {
160
159
  var a;
161
160
  return n.type === "supplier" ? "" : ((a = n.doc.profile) == null ? void 0 : a.code) ?? "";
162
161
  }
163
162
  function r(n) {
164
- var a, s, Z, oe, ye, re;
165
- return n.type === "supplier" ? [(a = n.doc.address) == null ? void 0 : a.line1, (s = n.doc.address) == null ? void 0 : s.city].filter(Boolean).join(" · ") : [(oe = (Z = n.doc.profile) == null ? void 0 : Z.address) == null ? void 0 : oe.line1, (re = (ye = n.doc.profile) == null ? void 0 : ye.address) == null ? void 0 : re.city].filter(Boolean).join(" · ");
163
+ var a, s, X, te, fe, se;
164
+ return n.type === "supplier" ? [(a = n.doc.address) == null ? void 0 : a.line1, (s = n.doc.address) == null ? void 0 : s.city].filter(Boolean).join(" · ") : [(te = (X = n.doc.profile) == null ? void 0 : X.address) == null ? void 0 : te.line1, (se = (fe = n.doc.profile) == null ? void 0 : fe.address) == null ? void 0 : se.city].filter(Boolean).join(" · ");
166
165
  }
167
166
  const u = L(
168
- () => o.value ? le(o.value) : ""
167
+ () => o.value ? ae(o.value) : ""
169
168
  ), b = L(
170
- () => R.value === "transfer" && q.value ? q.value.type === "supplier" ? Be(q.value) : le(q.value) : ""
169
+ () => R.value === "transfer" && N.value ? N.value.type === "supplier" ? Be(N.value) : ae(N.value) : ""
171
170
  ), T = L(() => {
172
- const a = (ve.value.length ? ve.value : $.value.items ?? []).filter((s) => s.quantity.amount > 0).length;
171
+ const a = (me.value.length ? me.value : A.value.items ?? []).filter((s) => s.quantity.amount > 0).length;
173
172
  return a === 0 ? c("inventory.transfer.receiveRequest.bulk.wizard.noneYet") : `${a} ${a === 1 ? "item" : "items"}`;
174
173
  });
175
174
  function I(n) {
@@ -177,7 +176,7 @@ const An = {
177
176
  const a = (s = n.purchaseOrder) == null ? void 0 : s.supplier;
178
177
  return a ? a.internal === "warehouse" ? `Transfer from ${a.name}` : a.internal === "restaurant" ? `Transfer from ${a.name}` : `Purchase from ${a.name}` : "";
179
178
  }
180
- function N(n) {
179
+ function q(n) {
181
180
  return {
182
181
  _id: n.doc._id,
183
182
  internal: n.type,
@@ -217,8 +216,8 @@ const An = {
217
216
  };
218
217
  }
219
218
  function Q() {
220
- var Z;
221
- const n = z.value ? d.templates.find((oe) => oe._id === z.value) : void 0, a = {
219
+ var X;
220
+ const n = M.value ? d.templates.find((te) => te._id === M.value) : void 0, a = {
222
221
  _rev: void 0,
223
222
  email: void 0,
224
223
  internal: void 0,
@@ -229,32 +228,32 @@ const An = {
229
228
  _id: "",
230
229
  name: "",
231
230
  address: { line2: void 0, line1: "", state: "", city: "", postcode: "", country: "" }
232
- }, s = R.value === "transfer" && q.value ? q.value.type === "supplier" ? W(q.value.doc) : N(q.value) : R.value === "template" && (n != null && n.purchaseOrder.supplier) ? n.purchaseOrder.supplier : a;
231
+ }, s = R.value === "transfer" && N.value ? N.value.type === "supplier" ? W(N.value.doc) : q(N.value) : R.value === "template" && (n != null && n.purchaseOrder.supplier) ? n.purchaseOrder.supplier : a;
233
232
  return {
234
233
  remark: void 0,
235
234
  ref: void 0,
236
235
  stockSnapshotId: void 0,
237
236
  effectiveAt: void 0,
238
- items: R.value === "template" && ((Z = n == null ? void 0 : n.purchaseOrder) != null && Z.items) ? n.purchaseOrder.items : [],
237
+ items: R.value === "template" && ((X = n == null ? void 0 : n.purchaseOrder) != null && X.items) ? n.purchaseOrder.items : [],
239
238
  supplier: s,
240
239
  status: "DRAFT",
241
240
  _id: "",
242
241
  seqNumber: 0,
243
242
  deliveryOrder: [],
244
- template: z.value ?? void 0,
243
+ template: M.value ?? void 0,
245
244
  templateDoc: n
246
245
  };
247
246
  }
248
- const $ = C(Q()), te = C(`${Math.random()}`), V = L(
247
+ const A = k(Q()), Z = k(`${Math.random()}`), U = L(
249
248
  () => {
250
249
  var n;
251
- return ((n = $.value.items) == null ? void 0 : n.filter((a) => a.quantity.amount === 0)) ?? [];
250
+ return ((n = A.value.items) == null ? void 0 : n.filter((a) => a.quantity.amount === 0)) ?? [];
252
251
  }
253
252
  );
254
253
  Ve(
255
254
  () => Y.show,
256
255
  (n) => {
257
- if (n && (i.value = 0, _.value = !1, o.value = null, R.value = null, q.value = null, z.value = null, H.value = "", pe.value = "", G.value = "", ee.value = !1, de.value = !1, ve.value = [], $.value = Q(), te.value = `${Math.random()}`, d.fetchTemplates(), Y.selectedOutletIds && Y.selectedOutletIds.length === 1)) {
256
+ if (n && (i.value = 0, C.value = !1, o.value = null, R.value = null, N.value = null, M.value = null, H.value = "", be.value = "", he.value = "", ne.value = !1, ve.value = !1, me.value = [], A.value = Q(), Z.value = `${Math.random()}`, d.fetchTemplates(), Y.selectedOutletIds && Y.selectedOutletIds.length === 1)) {
258
257
  const a = g.locations.find(
259
258
  (s) => s.doc._id === Y.selectedOutletIds[0]
260
259
  );
@@ -262,13 +261,13 @@ const An = {
262
261
  }
263
262
  }
264
263
  );
265
- function ie() {
264
+ function re() {
266
265
  if (i.value === 0) {
267
266
  if (!o.value) return;
268
267
  g._currentLocation = o.value, ze(), Me(), i.value = 1;
269
268
  } else if (i.value === 1) {
270
- if (!Ae.value) return;
271
- $.value = Q(), te.value = `${Math.random()}`, ve.value = [], i.value = 2;
269
+ if (!$e.value) return;
270
+ A.value = Q(), Z.value = `${Math.random()}`, me.value = [], i.value = 2;
272
271
  } else i.value === 2 && We();
273
272
  }
274
273
  function Je() {
@@ -278,26 +277,26 @@ const An = {
278
277
  n < i.value && (i.value = n);
279
278
  }
280
279
  function Le() {
281
- O("update:show", !1);
280
+ $("update:show", !1);
282
281
  }
283
282
  function Ne(n) {
284
- R.value !== n && (R.value = n, q.value = null, z.value = null, ve.value = [], $.value = {
285
- ...$.value,
283
+ R.value !== n && (R.value = n, N.value = null, M.value = null, me.value = [], A.value = {
284
+ ...A.value,
286
285
  items: [],
287
286
  template: void 0,
288
287
  templateDoc: void 0
289
288
  });
290
289
  }
291
290
  function ke(n) {
292
- ve.value = n ?? [];
291
+ me.value = n ?? [];
293
292
  }
294
- Ve(z, (n) => {
295
- R.value === "template" && n && ($.value = Q(), te.value = `${Math.random()}`);
293
+ Ve(M, (n) => {
294
+ R.value === "template" && n && (A.value = Q(), Z.value = `${Math.random()}`);
296
295
  });
297
296
  async function ze() {
298
- ee.value = !1;
297
+ ne.value = !1;
299
298
  try {
300
- await U.readSuppliers(), ee.value = !0;
299
+ await V.readSuppliers(), ne.value = !0;
301
300
  } catch {
302
301
  l.open({
303
302
  title: c("inventory.transfer.form.unableToFetchListOfSuppliers.title"),
@@ -307,57 +306,57 @@ const An = {
307
306
  }
308
307
  }
309
308
  async function Me() {
310
- xe.value = !0, $e.value = /* @__PURE__ */ new Map();
309
+ _e.value = !0, Ae.value = /* @__PURE__ */ new Map();
311
310
  try {
312
- const n = await p.readStockBalance(), a = /* @__PURE__ */ new Map();
311
+ const n = await v.readStockBalance(), a = /* @__PURE__ */ new Map();
313
312
  for (const s of n.skus ?? [])
314
313
  a.set(s.id, s);
315
- $e.value = a;
314
+ Ae.value = a;
316
315
  } catch {
317
316
  } finally {
318
- xe.value = !1;
317
+ _e.value = !1;
319
318
  }
320
319
  }
321
320
  function je() {
322
321
  var n;
323
- (n = Ee.value) != null && n.getFormData && ($.value = { ...$.value, ...Ee.value.getFormData() });
322
+ (n = Ee.value) != null && n.getFormData && (A.value = { ...A.value, ...Ee.value.getFormData() });
324
323
  }
325
324
  function We() {
326
- if (je(), V.value.length > 0) {
325
+ if (je(), U.value.length > 0) {
327
326
  De.value = !0;
328
327
  return;
329
328
  }
330
- ae();
329
+ oe();
331
330
  }
332
- function w() {
331
+ function x() {
333
332
  var n;
334
- $.value.items = ((n = $.value.items) == null ? void 0 : n.filter((a) => a.quantity.amount > 0)) ?? [], De.value = !1, ae();
333
+ A.value.items = ((n = A.value.items) == null ? void 0 : n.filter((a) => a.quantity.amount > 0)) ?? [], De.value = !1, oe();
335
334
  }
336
- function ae() {
337
- var s, Z;
338
- const n = xn.validatePurchaseOrderItems({
339
- skusById: fe.skuById ?? {},
340
- items: $.value.items ?? []
335
+ function oe() {
336
+ var s, X;
337
+ const n = gn.validatePurchaseOrderItems({
338
+ skusById: de.skuById ?? {},
339
+ items: A.value.items ?? []
341
340
  }), a = Object.values(n).flat();
342
341
  if (a.length > 0) {
343
- const oe = a[0];
342
+ const te = a[0];
344
343
  l.open({
345
- title: `[Row ${oe.index + 1}] "${oe.poItem.sku.name}"`,
346
- message: `${oe.message}`,
344
+ title: `[Row ${te.index + 1}] "${te.poItem.sku.name}"`,
345
+ message: `${te.message}`,
347
346
  type: "error"
348
347
  });
349
348
  return;
350
349
  }
351
- (Z = (s = Ee.value) == null ? void 0 : s.validateInputs) == null || Z.call(s);
350
+ (X = (s = Ee.value) == null ? void 0 : s.validateInputs) == null || X.call(s);
352
351
  }
353
- async function ce() {
354
- const n = $.value;
355
- if (se.value = !0, n.items = n.items.filter((a) => a.quantity.amount > 0), !n.items.length) {
352
+ async function ie() {
353
+ const n = A.value;
354
+ if (ue.value = !0, n.items = n.items.filter((a) => a.quantity.amount > 0), !n.items.length) {
356
355
  l.open({
357
356
  title: "Cannot create order",
358
357
  message: "There are no items with non-zero amount in your request.",
359
358
  type: "error"
360
- }), se.value = !1;
359
+ }), ue.value = !1;
361
360
  return;
362
361
  }
363
362
  (n.supplier.internal === "warehouse" || n.supplier.internal === "restaurant") && (n.items = n.items.map(({ totalCost: a, ...s }) => s));
@@ -366,7 +365,7 @@ const An = {
366
365
  title: c("inventory.transfer.receiveRequest.create.success"),
367
366
  message: c("inventory.transfer.receiveRequest.create.successMessage"),
368
367
  type: "success"
369
- }), O("submitted"), O("update:show", !1), me();
368
+ }), $("submitted"), $("update:show", !1), ce();
370
369
  } catch (a) {
371
370
  l.open({
372
371
  title: c("inventory.transfer.receiveRequest.create.error.title"),
@@ -374,15 +373,15 @@ const An = {
374
373
  type: "error"
375
374
  }), console.error("Error creating purchase order", a);
376
375
  } finally {
377
- se.value = !1;
376
+ ue.value = !1;
378
377
  }
379
378
  }
380
- function me() {
381
- i.value = 0, _.value = !1, o.value = null, R.value = null, q.value = null, z.value = null, H.value = "", pe.value = "", G.value = "", ee.value = !1, de.value = !1, ve.value = [], $.value = Q(), te.value = `${Math.random()}`;
379
+ function ce() {
380
+ i.value = 0, C.value = !1, o.value = null, R.value = null, N.value = null, M.value = null, H.value = "", be.value = "", he.value = "", ne.value = !1, ve.value = !1, me.value = [], A.value = Q(), Z.value = `${Math.random()}`;
382
381
  }
383
- return (n, a) => (m(), y(he, null, [
384
- (m(), ue(lt, { to: "body" }, [
385
- E(qt, {
382
+ return (n, a) => (m(), y(ye, null, [
383
+ (m(), le(lt, { to: "body" }, [
384
+ E(Dt, {
386
385
  "enter-active-class": "transition-opacity duration-150 ease-out",
387
386
  "enter-from-class": "opacity-0",
388
387
  "enter-to-class": "opacity-100",
@@ -391,17 +390,17 @@ const An = {
391
390
  "leave-to-class": "opacity-0"
392
391
  }, {
393
392
  default: Pe(() => [
394
- n.show ? (m(), y("div", An, [
395
- _.value ? D("", !0) : (m(), y("div", On, [
396
- e("span", Bn, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.title")), 1),
397
- e("div", Tn, [
398
- E(t(k), {
393
+ n.show ? (m(), y("div", qn, [
394
+ C.value ? D("", !0) : (m(), y("div", Nn, [
395
+ e("span", An, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.title")), 1),
396
+ e("div", $n, [
397
+ E(t(w), {
399
398
  variant: "tertiary",
400
399
  size: "md",
401
400
  label: t(c)("inventory.transfer.receiveRequest.bulk.wizard.cancelBtn"),
402
401
  onClick: Le
403
402
  }, null, 8, ["label"]),
404
- i.value > 0 ? (m(), ue(t(k), {
403
+ i.value > 0 ? (m(), le(t(w), {
405
404
  key: 0,
406
405
  variant: "secondary",
407
406
  size: "md",
@@ -409,17 +408,17 @@ const An = {
409
408
  label: t(c)("inventory.transfer.receiveRequest.bulk.wizard.backBtn"),
410
409
  onClick: Je
411
410
  }, null, 8, ["label"])) : D("", !0),
412
- E(t(k), {
411
+ E(t(w), {
413
412
  size: "md",
414
413
  disabled: !Oe.value,
415
- loading: se.value,
414
+ loading: ue.value,
416
415
  label: Se.value,
417
- onClick: ie
416
+ onClick: re
418
417
  }, null, 8, ["disabled", "loading", "label"])
419
418
  ])
420
419
  ])),
421
- _.value ? D("", !0) : (m(), y("div", In, [
422
- e("div", Ln, [
420
+ C.value ? D("", !0) : (m(), y("div", On, [
421
+ e("div", Bn, [
423
422
  e("button", {
424
423
  class: "flex flex-col items-center gap-4 min-w-0 group",
425
424
  disabled: i.value <= 0,
@@ -431,16 +430,16 @@ const An = {
431
430
  i.value > 0 || i.value === 0 ? "bg-[#FF7823] text-white" : "bg-[#F0F0F0] text-[#6B6C70]"
432
431
  ])
433
432
  }, [
434
- i.value > 0 ? (m(), ue(t(S), {
433
+ i.value > 0 ? (m(), le(t(S), {
435
434
  key: 0,
436
435
  name: "check",
437
436
  size: "sm"
438
- })) : (m(), y("span", Mn, "1"))
437
+ })) : (m(), y("span", In, "1"))
439
438
  ], 2),
440
439
  e("span", {
441
440
  class: J(["fm-typo-en-body-xs-500 whitespace-nowrap transition-colors duration-150", i.value >= 0 ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
442
441
  }, " Select destination ", 2)
443
- ], 8, zn),
442
+ ], 8, Tn),
444
443
  e("div", {
445
444
  class: J(["flex-1 h-1 mx-8 transition-colors duration-200", i.value > 0 ? "bg-[#FF7823]" : "bg-[#E0E0E0]"])
446
445
  }, null, 2),
@@ -455,20 +454,20 @@ const An = {
455
454
  i.value > 1 || i.value === 1 ? "bg-[#FF7823] text-white" : "bg-[#F0F0F0] text-[#6B6C70]"
456
455
  ])
457
456
  }, [
458
- i.value > 1 ? (m(), ue(t(S), {
457
+ i.value > 1 ? (m(), le(t(S), {
459
458
  key: 0,
460
459
  name: "check",
461
460
  size: "sm"
462
- })) : (m(), y("span", Vn, "2"))
461
+ })) : (m(), y("span", zn, "2"))
463
462
  ], 2),
464
463
  e("span", {
465
464
  class: J(["fm-typo-en-body-xs-500 whitespace-nowrap transition-colors duration-150", i.value >= 1 ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
466
- }, v(P.value), 3)
467
- ], 8, Un),
465
+ }, p(P.value), 3)
466
+ ], 8, Ln),
468
467
  e("div", {
469
468
  class: J(["flex-1 h-1 mx-8 transition-colors duration-200", i.value > 1 ? "bg-[#FF7823]" : "bg-[#E0E0E0]"])
470
469
  }, null, 2),
471
- e("button", Jn, [
470
+ e("button", Mn, [
472
471
  e("div", {
473
472
  class: J([
474
473
  "w-32 h-32 rounded-full flex items-center justify-center text-sm font-semibold transition-colors duration-150",
@@ -479,68 +478,68 @@ const An = {
479
478
  ]), 2),
480
479
  e("span", {
481
480
  class: J(["fm-typo-en-body-xs-500 whitespace-nowrap transition-colors duration-150", i.value >= 2 ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
482
- }, v(F.value), 3)
481
+ }, p(F.value), 3)
483
482
  ])
484
483
  ])
485
484
  ])),
486
- e("div", jn, [
487
- e("div", Wn, [
488
- i.value === 0 ? (m(), y("div", Yn, [
489
- e("div", Hn, [
490
- e("h3", Qn, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step1Heading")), 1),
491
- e("p", Kn, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step1Desc")), 1)
485
+ e("div", Un, [
486
+ e("div", Vn, [
487
+ i.value === 0 ? (m(), y("div", Jn, [
488
+ e("div", jn, [
489
+ e("h3", Wn, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step1Heading")), 1),
490
+ e("p", Yn, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step1Desc")), 1)
492
491
  ]),
493
- e("div", Gn, [
494
- E(t(M), {
492
+ e("div", Hn, [
493
+ E(t(z), {
495
494
  "model-value": H.value,
496
495
  "onUpdate:modelValue": a[2] || (a[2] = (s) => H.value = s),
497
496
  "prepend-icon": "search",
498
497
  placeholder: t(c)("inventory.transfer.receiveRequest.bulk.wizard.step1SearchPlaceholder")
499
498
  }, null, 8, ["model-value", "placeholder"])
500
499
  ]),
501
- e("div", Xn, [
502
- (m(!0), y(he, null, Ke(B.value, (s, Z) => {
503
- var oe, ye, re, Ue, Ze, vt, yt;
500
+ e("div", Qn, [
501
+ (m(!0), y(ye, null, Qe(B.value, (s, X) => {
502
+ var te, fe, se, Ue, Xe, vt, yt;
504
503
  return m(), y("div", {
505
504
  key: s.dbName,
506
505
  class: J(["flex items-center gap-8 px-12 h-[67px] cursor-pointer transition-colors duration-150", [
507
- ((oe = o.value) == null ? void 0 : oe.dbName) === s.dbName ? "bg-[#FFF5EE]" : "hover:bg-[#FAFAFA]",
508
- Z > 0 ? "border-t border-[#F0F0F0]" : ""
506
+ ((te = o.value) == null ? void 0 : te.dbName) === s.dbName ? "bg-[#FFF5EE]" : "hover:bg-[#FAFAFA]",
507
+ X > 0 ? "border-t border-[#F0F0F0]" : ""
509
508
  ]]),
510
- onClick: (Sa) => o.value = s
509
+ onClick: (ka) => o.value = s
511
510
  }, [
512
- e("div", eo, [
513
- e("span", to, v(s.name.slice(0, 2).toUpperCase()), 1)
511
+ e("div", Gn, [
512
+ e("span", Xn, p(s.name.slice(0, 2).toUpperCase()), 1)
514
513
  ]),
515
- e("div", no, [
516
- e("div", oo, v(s.name), 1),
517
- e("div", so, [
518
- st(v(s.doc.profile.code ? `#${s.doc.profile.code}` : t(c)("inventory.transfer.receiveRequest.bulk.wizard.noCode")) + " ", 1),
519
- (ye = s.doc.profile.address) != null && ye.line1 || (re = s.doc.profile.address) != null && re.city ? (m(), y(he, { key: 0 }, [
520
- st(" · " + v([(Ue = s.doc.profile.address) == null ? void 0 : Ue.line1, (Ze = s.doc.profile.address) == null ? void 0 : Ze.city].filter(Boolean).join(" · ")), 1)
514
+ e("div", Zn, [
515
+ e("div", eo, p(s.name), 1),
516
+ e("div", to, [
517
+ ot(p(s.doc.profile.code ? `#${s.doc.profile.code}` : t(c)("inventory.transfer.receiveRequest.bulk.wizard.noCode")) + " ", 1),
518
+ (fe = s.doc.profile.address) != null && fe.line1 || (se = s.doc.profile.address) != null && se.city ? (m(), y(ye, { key: 0 }, [
519
+ ot(" · " + p([(Ue = s.doc.profile.address) == null ? void 0 : Ue.line1, (Xe = s.doc.profile.address) == null ? void 0 : Xe.city].filter(Boolean).join(" · ")), 1)
521
520
  ], 64)) : D("", !0)
522
521
  ])
523
522
  ]),
524
- e("span", ao, v(s.type === "warehouse" ? "Warehouse" : "Restaurant"), 1),
523
+ e("span", no, p(s.type === "warehouse" ? "Warehouse" : "Restaurant"), 1),
525
524
  e("div", {
526
525
  class: J([
527
526
  "w-[18px] h-[18px] rounded-full border flex items-center justify-center shrink-0 transition-colors duration-150",
528
527
  ((vt = o.value) == null ? void 0 : vt.dbName) === s.dbName ? "border-[#FF7823]" : "border-[#CCCCCC]"
529
528
  ])
530
529
  }, [
531
- ((yt = o.value) == null ? void 0 : yt.dbName) === s.dbName ? (m(), y("div", ro)) : D("", !0)
530
+ ((yt = o.value) == null ? void 0 : yt.dbName) === s.dbName ? (m(), y("div", oo)) : D("", !0)
532
531
  ], 2)
533
- ], 10, Zn);
532
+ ], 10, Kn);
534
533
  }), 128)),
535
- B.value.length === 0 ? (m(), y("div", lo, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.noOutletsAvailable")), 1)) : D("", !0)
534
+ B.value.length === 0 ? (m(), y("div", so, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.noOutletsAvailable")), 1)) : D("", !0)
536
535
  ])
537
536
  ])) : D("", !0),
538
- i.value === 1 ? (m(), y("div", io, [
539
- e("div", uo, [
540
- e("h3", co, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step2Heading")), 1),
541
- e("p", mo, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step2Desc")), 1)
537
+ i.value === 1 ? (m(), y("div", ao, [
538
+ e("div", ro, [
539
+ e("h3", lo, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step2Heading")), 1),
540
+ e("p", io, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step2Desc")), 1)
542
541
  ]),
543
- e("div", fo, [
542
+ e("div", uo, [
544
543
  e("div", {
545
544
  class: J([
546
545
  "border rounded-xl p-16 cursor-pointer transition-all duration-150 flex flex-col",
@@ -548,7 +547,7 @@ const An = {
548
547
  ]),
549
548
  onClick: a[3] || (a[3] = (s) => Ne("transfer"))
550
549
  }, [
551
- e("div", po, [
550
+ e("div", co, [
552
551
  e("div", {
553
552
  class: J(["w-36 h-36 rounded-xl flex items-center justify-center shrink-0", R.value === "transfer" ? "bg-[#FF7823]" : "bg-[#F0F0F0]"])
554
553
  }, [
@@ -561,7 +560,7 @@ const An = {
561
560
  e("div", {
562
561
  class: J(["w-16 h-16 rounded-full flex items-center justify-center shrink-0", R.value === "transfer" ? "bg-[#FF7823]" : "border border-[#CCCCCC]"])
563
562
  }, [
564
- R.value === "transfer" ? (m(), ue(t(S), {
563
+ R.value === "transfer" ? (m(), le(t(S), {
565
564
  key: 0,
566
565
  name: "check",
567
566
  size: "sm",
@@ -569,8 +568,8 @@ const An = {
569
568
  })) : D("", !0)
570
569
  ], 2)
571
570
  ]),
572
- e("div", vo, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.outletToOutlet")), 1),
573
- e("div", yo, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.outletToOutletDesc")), 1)
571
+ e("div", mo, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.outletToOutlet")), 1),
572
+ e("div", fo, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.outletToOutletDesc")), 1)
574
573
  ], 2),
575
574
  e("div", {
576
575
  class: J([
@@ -579,7 +578,7 @@ const An = {
579
578
  ]),
580
579
  onClick: a[4] || (a[4] = (s) => Ne("template"))
581
580
  }, [
582
- e("div", bo, [
581
+ e("div", po, [
583
582
  e("div", {
584
583
  class: J(["w-36 h-36 rounded-xl flex items-center justify-center shrink-0", R.value === "template" ? "bg-[#FF7823]" : "bg-[#F0F0F0]"])
585
584
  }, [
@@ -592,7 +591,7 @@ const An = {
592
591
  e("div", {
593
592
  class: J(["w-16 h-16 rounded-full flex items-center justify-center shrink-0", R.value === "template" ? "bg-[#FF7823]" : "border border-[#CCCCCC]"])
594
593
  }, [
595
- R.value === "template" ? (m(), ue(t(S), {
594
+ R.value === "template" ? (m(), le(t(S), {
596
595
  key: 0,
597
596
  name: "check",
598
597
  size: "sm",
@@ -600,159 +599,159 @@ const An = {
600
599
  })) : D("", !0)
601
600
  ], 2)
602
601
  ]),
603
- e("div", ho, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.fromTemplate")), 1),
604
- e("div", go, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.fromTemplateDesc")), 1)
602
+ e("div", vo, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.fromTemplate")), 1),
603
+ e("div", yo, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.fromTemplateDesc")), 1)
605
604
  ], 2)
606
605
  ]),
607
- R.value === "transfer" ? (m(), y(he, { key: 0 }, [
608
- e("div", _o, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step2SourceHeading")), 1),
609
- e("div", xo, [
610
- E(t(M), {
611
- "model-value": pe.value,
612
- "onUpdate:modelValue": a[5] || (a[5] = (s) => pe.value = s),
606
+ R.value === "transfer" ? (m(), y(ye, { key: 0 }, [
607
+ e("div", bo, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step2SourceHeading")), 1),
608
+ e("div", ho, [
609
+ E(t(z), {
610
+ "model-value": be.value,
611
+ "onUpdate:modelValue": a[5] || (a[5] = (s) => be.value = s),
613
612
  "prepend-icon": "search",
614
613
  placeholder: t(c)(
615
614
  "inventory.transfer.receiveRequest.bulk.wizard.step2SearchSourcePlaceholder"
616
615
  )
617
616
  }, null, 8, ["model-value", "placeholder"])
618
617
  ]),
619
- e("div", wo, [
620
- (m(!0), y(he, null, Ke(K.value, (s, Z) => {
621
- var oe, ye, re;
618
+ e("div", go, [
619
+ (m(!0), y(ye, null, Qe(K.value, (s, X) => {
620
+ var te, fe, se;
622
621
  return m(), y("div", {
623
622
  key: s.dbName,
624
623
  class: J(["flex items-center gap-8 px-12 h-[67px] cursor-pointer transition-colors duration-150", [
625
- ((oe = q.value) == null ? void 0 : oe.doc._id) === s.doc._id ? "bg-[#FFF5EE]" : "hover:bg-[#FAFAFA]",
626
- Z > 0 ? "border-t border-[#F0F0F0]" : ""
624
+ ((te = N.value) == null ? void 0 : te.doc._id) === s.doc._id ? "bg-[#FFF5EE]" : "hover:bg-[#FAFAFA]",
625
+ X > 0 ? "border-t border-[#F0F0F0]" : ""
627
626
  ]]),
628
- onClick: (Ue) => q.value = s
627
+ onClick: (Ue) => N.value = s
629
628
  }, [
630
- e("div", Co, [
631
- e("span", Fo, v(s.name.slice(0, 2).toUpperCase()), 1)
629
+ e("div", _o, [
630
+ e("span", wo, p(s.name.slice(0, 2).toUpperCase()), 1)
632
631
  ]),
633
- e("div", So, [
634
- e("div", Ro, v(s.name), 1),
635
- e("div", Po, [
636
- st(v(Te(s) ? `#${Te(s)}` : t(c)("inventory.transfer.receiveRequest.bulk.wizard.noCode")) + " ", 1),
637
- r(s) ? (m(), y(he, { key: 0 }, [
638
- st(" · " + v(r(s)), 1)
632
+ e("div", ko, [
633
+ e("div", Co, p(s.name), 1),
634
+ e("div", Fo, [
635
+ ot(p(Te(s) ? `#${Te(s)}` : t(c)("inventory.transfer.receiveRequest.bulk.wizard.noCode")) + " ", 1),
636
+ r(s) ? (m(), y(ye, { key: 0 }, [
637
+ ot(" · " + p(r(s)), 1)
639
638
  ], 64)) : D("", !0)
640
639
  ])
641
640
  ]),
642
- e("span", Do, v(s.type === "warehouse" ? "Warehouse" : s.type === "supplier" ? "Supplier" : "Restaurant"), 1),
641
+ e("span", So, p(s.type === "warehouse" ? "Warehouse" : s.type === "supplier" ? "Supplier" : "Restaurant"), 1),
643
642
  e("div", {
644
643
  class: J([
645
644
  "w-[18px] h-[18px] rounded-full border flex items-center justify-center shrink-0 transition-colors duration-150",
646
- ((ye = q.value) == null ? void 0 : ye.doc._id) === s.doc._id ? "border-[#FF7823]" : "border-[#CCCCCC]"
645
+ ((fe = N.value) == null ? void 0 : fe.doc._id) === s.doc._id ? "border-[#FF7823]" : "border-[#CCCCCC]"
647
646
  ])
648
647
  }, [
649
- ((re = q.value) == null ? void 0 : re.doc._id) === s.doc._id ? (m(), y("div", Eo)) : D("", !0)
648
+ ((se = N.value) == null ? void 0 : se.doc._id) === s.doc._id ? (m(), y("div", Ro)) : D("", !0)
650
649
  ], 2)
651
- ], 10, ko);
650
+ ], 10, xo);
652
651
  }), 128)),
653
- K.value.length === 0 ? (m(), y("div", qo, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.noOutletsAvailable")), 1)) : D("", !0)
652
+ K.value.length === 0 ? (m(), y("div", Po, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.noOutletsAvailable")), 1)) : D("", !0)
654
653
  ])
655
654
  ], 64)) : D("", !0),
656
- R.value === "template" ? (m(), y(he, { key: 1 }, [
657
- e("div", No, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step2TemplateHeading")), 1),
658
- e("div", $o, [
659
- E(t(M), {
660
- "model-value": G.value,
661
- "onUpdate:modelValue": a[6] || (a[6] = (s) => G.value = s),
655
+ R.value === "template" ? (m(), y(ye, { key: 1 }, [
656
+ e("div", Do, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step2TemplateHeading")), 1),
657
+ e("div", Eo, [
658
+ E(t(z), {
659
+ "model-value": he.value,
660
+ "onUpdate:modelValue": a[6] || (a[6] = (s) => he.value = s),
662
661
  "prepend-icon": "search",
663
662
  placeholder: t(c)(
664
663
  "inventory.transfer.receiveRequest.bulk.wizard.step2SearchTemplatePlaceholder"
665
664
  )
666
665
  }, null, 8, ["model-value", "placeholder"])
667
666
  ]),
668
- t(d).loading ? (m(), y("div", Ao, [
667
+ t(d).loading ? (m(), y("div", qo, [
669
668
  E(t(S), {
670
669
  name: "progress_activity",
671
670
  class: "text-[#FF7823] animate-spin"
672
671
  })
673
- ])) : X.value.length === 0 ? (m(), y("div", Oo, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.noTemplatesAvailable")), 1)) : (m(), y("div", Bo, [
674
- (m(!0), y(he, null, Ke(X.value, (s) => (m(), y("div", {
672
+ ])) : G.value.length === 0 ? (m(), y("div", No, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.noTemplatesAvailable")), 1)) : (m(), y("div", Ao, [
673
+ (m(!0), y(ye, null, Qe(G.value, (s) => (m(), y("div", {
675
674
  key: s._id,
676
675
  class: J([
677
676
  "border rounded-lg px-16 py-12 cursor-pointer transition-all duration-150 flex items-center gap-12",
678
- z.value === s._id ? "border-[#FF7823] bg-[#FFF5EE]" : "border-[#E0E0E0] bg-white hover:bg-[#FAFAFA]"
677
+ M.value === s._id ? "border-[#FF7823] bg-[#FFF5EE]" : "border-[#E0E0E0] bg-white hover:bg-[#FAFAFA]"
679
678
  ]),
680
- onClick: (Z) => z.value = s._id
679
+ onClick: (X) => M.value = s._id
681
680
  }, [
682
- e("div", Io, [
683
- e("div", Lo, v(s.name), 1),
684
- e("div", zo, v(I(s)) + " · " + v(s.purchaseOrder.items.length) + " items ", 1)
681
+ e("div", Oo, [
682
+ e("div", Bo, p(s.name), 1),
683
+ e("div", To, p(I(s)) + " · " + p(s.purchaseOrder.items.length) + " items ", 1)
685
684
  ]),
686
685
  e("div", {
687
686
  class: J([
688
687
  "w-[18px] h-[18px] rounded-full border flex items-center justify-center shrink-0 transition-colors duration-150",
689
- z.value === s._id ? "border-[#FF7823]" : "border-[#CCCCCC]"
688
+ M.value === s._id ? "border-[#FF7823]" : "border-[#CCCCCC]"
690
689
  ])
691
690
  }, [
692
- z.value === s._id ? (m(), y("div", Mo)) : D("", !0)
691
+ M.value === s._id ? (m(), y("div", Io)) : D("", !0)
693
692
  ], 2)
694
- ], 10, To))), 128))
693
+ ], 10, $o))), 128))
695
694
  ]))
696
695
  ], 64)) : D("", !0)
697
696
  ])) : D("", !0),
698
- i.value === 2 ? (m(), y("div", Uo, [
699
- e("div", Vo, [
700
- e("h3", Jo, v(F.value), 1)
697
+ i.value === 2 ? (m(), y("div", Lo, [
698
+ e("div", zo, [
699
+ e("h3", Mo, p(F.value), 1)
701
700
  ]),
702
- (m(), ue(fn, {
701
+ (m(), le(dn, {
703
702
  ref_key: "formRef",
704
703
  ref: Ee,
705
704
  class: "w-full",
706
- "onForm:ready": a[7] || (a[7] = () => de.value = !0),
705
+ "onForm:ready": a[7] || (a[7] = () => ve.value = !0),
707
706
  "onForm:dataChange": ke,
708
- onValidationSuccess: ce,
709
- modelValue: $.value,
710
- "onUpdate:modelValue": a[8] || (a[8] = (s) => $.value = s),
711
- disabled: Xe.value,
712
- "locked-supplier": $.value.supplier,
713
- suppliers: t(U).suppliers,
714
- skus: t(fe).skus,
715
- key: te.value,
707
+ onValidationSuccess: ie,
708
+ modelValue: A.value,
709
+ "onUpdate:modelValue": a[8] || (a[8] = (s) => A.value = s),
710
+ disabled: Ge.value,
711
+ "locked-supplier": A.value.supplier,
712
+ suppliers: t(V).suppliers,
713
+ skus: t(de).skus,
714
+ key: Z.value,
716
715
  "last-closing-date": n.lastClosingDate,
717
- "sku-balance-map": $e.value,
718
- "is-balance-loading": xe.value
716
+ "sku-balance-map": Ae.value,
717
+ "is-balance-loading": _e.value
719
718
  }, null, 8, ["modelValue", "disabled", "locked-supplier", "suppliers", "skus", "last-closing-date", "sku-balance-map", "is-balance-loading"]))
720
719
  ])) : D("", !0)
721
720
  ]),
722
- e("div", jo, [
723
- e("div", Wo, [
724
- e("div", Yo, [
725
- e("div", Ho, [
726
- e("div", Qo, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.summaryTitle")), 1)
721
+ e("div", Uo, [
722
+ e("div", Vo, [
723
+ e("div", Jo, [
724
+ e("div", jo, [
725
+ e("div", Wo, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.summaryTitle")), 1)
727
726
  ]),
728
- e("div", Ko, [
729
- e("span", Go, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.summaryDestination")), 1),
727
+ e("div", Yo, [
728
+ e("span", Ho, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.summaryDestination")), 1),
730
729
  e("span", {
731
730
  class: J(["text-[15px] leading-[20px] font-semibold transition-colors duration-200", o.value ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
732
- }, v(Re.value), 3),
733
- u.value ? (m(), y("span", Xo, v(u.value), 1)) : D("", !0)
731
+ }, p(Re.value), 3),
732
+ u.value ? (m(), y("span", Qo, p(u.value), 1)) : D("", !0)
734
733
  ]),
735
- e("div", Zo, [
736
- e("span", es, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.summaryMethod")), 1),
734
+ e("div", Ko, [
735
+ e("span", Go, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.summaryMethod")), 1),
737
736
  e("span", {
738
737
  class: J(["text-[15px] leading-[20px] font-semibold transition-colors duration-200", R.value ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
739
- }, v(we.value), 3)
738
+ }, p(we.value), 3)
740
739
  ]),
741
- e("div", ts, [
742
- e("span", ns, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.summarySource")), 1),
740
+ e("div", Xo, [
741
+ e("span", Zo, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.summarySource")), 1),
743
742
  e("span", {
744
743
  class: J([
745
744
  "text-[15px] leading-[20px] font-semibold transition-colors duration-200",
746
- q.value || z.value ? "text-[#1C1C1E]" : "text-[#B2B3B6]"
745
+ N.value || M.value ? "text-[#1C1C1E]" : "text-[#B2B3B6]"
747
746
  ])
748
- }, v(j.value), 3),
749
- b.value ? (m(), y("span", os, v(b.value), 1)) : D("", !0)
747
+ }, p(j.value), 3),
748
+ b.value ? (m(), y("span", es, p(b.value), 1)) : D("", !0)
750
749
  ]),
751
- e("div", ss, [
752
- e("span", as, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.summaryItems")), 1),
750
+ e("div", ts, [
751
+ e("span", ns, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.summaryItems")), 1),
753
752
  e("span", {
754
753
  class: J(["text-[15px] leading-[20px] font-medium transition-colors duration-200", Fe.value ? "text-[#1C1C1E]" : "text-[#6B6C70]"])
755
- }, v(T.value), 3)
754
+ }, p(T.value), 3)
756
755
  ])
757
756
  ])
758
757
  ])
@@ -763,55 +762,55 @@ const An = {
763
762
  _: 1
764
763
  })
765
764
  ])),
766
- E(t(A), {
765
+ E(t(O), {
767
766
  modelValue: De.value,
768
767
  "onUpdate:modelValue": a[10] || (a[10] = (s) => De.value = s),
769
768
  overlay: !0
770
769
  }, {
771
770
  "dialog-header": Pe(() => [
772
- e("div", rs, v(t(c)("inventory.transfer.template.zeroQuantity.title")), 1)
771
+ e("div", os, p(t(c)("inventory.transfer.template.zeroQuantity.title")), 1)
773
772
  ]),
774
773
  "dialog-footer": Pe(() => [
775
- e("div", ms, [
776
- E(t(k), {
774
+ e("div", us, [
775
+ E(t(w), {
777
776
  label: t(c)("common.cancel"),
778
777
  variant: "tertiary",
779
778
  size: "md",
780
779
  onClick: a[9] || (a[9] = (s) => De.value = !1)
781
780
  }, null, 8, ["label"]),
782
- E(t(k), {
781
+ E(t(w), {
783
782
  label: t(c)("inventory.transfer.template.zeroQuantity.removeAll"),
784
783
  variant: "primary",
785
784
  size: "md",
786
785
  "prepend-icon": "delete",
787
- onClick: w
786
+ onClick: x
788
787
  }, null, 8, ["label"])
789
788
  ])
790
789
  ]),
791
790
  default: Pe(() => [
792
- e("div", ls, [
793
- e("div", is, v(t(c)("inventory.transfer.template.zeroQuantity.message", {
794
- count: V.value.length
791
+ e("div", ss, [
792
+ e("div", as, p(t(c)("inventory.transfer.template.zeroQuantity.message", {
793
+ count: U.value.length
795
794
  })), 1),
796
- e("div", us, [
797
- e("ul", cs, [
798
- (m(!0), y(he, null, Ke(V.value, (s) => (m(), y("li", {
795
+ e("div", rs, [
796
+ e("ul", ls, [
797
+ (m(!0), y(ye, null, Qe(U.value, (s) => (m(), y("li", {
799
798
  key: s.sku._id,
800
799
  class: "fm-typo-en-body-md-400"
801
- }, v(s.sku.name) + " (" + v(s.sku.code) + ") ", 1))), 128))
800
+ }, p(s.sku.name) + " (" + p(s.sku.code) + ") ", 1))), 128))
802
801
  ])
803
802
  ]),
804
- e("div", ds, v(t(c)("inventory.transfer.template.zeroQuantity.prompt")), 1)
803
+ e("div", is, p(t(c)("inventory.transfer.template.zeroQuantity.prompt")), 1)
805
804
  ])
806
805
  ]),
807
806
  _: 1
808
807
  }, 8, ["modelValue"])
809
808
  ], 64));
810
809
  }
811
- }), ps = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-2xl overflow-hidden" }, vs = { class: "flex justify-between items-center px-16 py-3 border-b border-gray-200 bg-gray-50" }, ys = { class: "flex gap-2 items-center" }, bs = ["disabled"], hs = { class: "flex-1 overflow-auto bg-gray-100 flex items-center justify-center" }, gs = {
810
+ }), ds = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-2xl overflow-hidden" }, ms = { class: "flex justify-between items-center px-16 py-3 border-b border-gray-200 bg-gray-50" }, fs = { class: "flex gap-2 items-center" }, ps = ["disabled"], vs = { class: "flex-1 overflow-auto bg-gray-100 flex items-center justify-center" }, ys = {
812
811
  key: 0,
813
812
  class: "flex flex-col items-center gap-3 text-gray-500"
814
- }, _s = ["src"], xs = /* @__PURE__ */ nt({
813
+ }, bs = ["src"], hs = /* @__PURE__ */ tt({
815
814
  __name: "PdfPreviewDialog",
816
815
  props: {
817
816
  modelValue: { type: Boolean },
@@ -819,44 +818,44 @@ const An = {
819
818
  blobUrl: {}
820
819
  },
821
820
  emits: ["update:modelValue"],
822
- setup(x, { emit: h }) {
823
- const k = x, A = h, S = C(null);
824
- function M() {
825
- A("update:modelValue", !1);
821
+ setup(_, { emit: h }) {
822
+ const w = _, O = h, S = k(null);
823
+ function z() {
824
+ O("update:modelValue", !1);
826
825
  }
827
826
  function Y() {
828
- var O, c;
829
- if (k.blobUrl)
827
+ var $, c;
828
+ if (w.blobUrl)
830
829
  try {
831
- (c = (O = S.value) == null ? void 0 : O.contentWindow) == null || c.print();
830
+ (c = ($ = S.value) == null ? void 0 : $.contentWindow) == null || c.print();
832
831
  } catch {
833
832
  const l = document.createElement("a");
834
- l.href = k.blobUrl, l.download = "purchase-order.pdf", document.body.appendChild(l), l.click(), document.body.removeChild(l);
833
+ l.href = w.blobUrl, l.download = "purchase-order.pdf", document.body.appendChild(l), l.click(), document.body.removeChild(l);
835
834
  }
836
835
  }
837
- return (O, c) => (m(), ue(lt, { to: "body" }, [
838
- O.modelValue ? (m(), y("div", {
836
+ return ($, c) => (m(), le(lt, { to: "body" }, [
837
+ $.modelValue ? (m(), y("div", {
839
838
  key: 0,
840
839
  class: "fixed inset-0 z-[9999] bg-black/50 flex justify-center items-center",
841
- onClick: Nt(M, ["self"])
840
+ onClick: Et(z, ["self"])
842
841
  }, [
843
- e("div", ps, [
844
- e("div", vs, [
842
+ e("div", ds, [
843
+ e("div", ms, [
845
844
  c[0] || (c[0] = e("span", { class: "text-base font-semibold text-gray-700" }, "Print Preview", -1)),
846
- e("div", ys, [
845
+ e("div", fs, [
847
846
  e("button", {
848
- disabled: O.loading || !O.blobUrl,
847
+ disabled: $.loading || !$.blobUrl,
849
848
  class: "px-8 py-1.5 bg-blue-500 text-white border-none rounded text-sm cursor-pointer hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed",
850
849
  onClick: Y
851
- }, " Print ", 8, bs),
850
+ }, " Print ", 8, ps),
852
851
  e("button", {
853
852
  class: "px-2.5 py-1 bg-transparent border border-gray-300 rounded text-xl leading-none cursor-pointer text-gray-500 hover:bg-gray-100",
854
- onClick: M
853
+ onClick: z
855
854
  }, " × ")
856
855
  ])
857
856
  ]),
858
- e("div", hs, [
859
- O.loading ? (m(), y("div", gs, c[1] || (c[1] = [
857
+ e("div", vs, [
858
+ $.loading ? (m(), y("div", ys, c[1] || (c[1] = [
860
859
  e("svg", {
861
860
  class: "animate-spin h-10 w-10 text-blue-500",
862
861
  xmlns: "http://www.w3.org/2000/svg",
@@ -878,67 +877,67 @@ const An = {
878
877
  })
879
878
  ], -1),
880
879
  e("span", { class: "text-sm" }, "Generating PDF…", -1)
881
- ]))) : O.blobUrl ? (m(), y("iframe", {
880
+ ]))) : $.blobUrl ? (m(), y("iframe", {
882
881
  key: 1,
883
882
  ref_key: "iframeRef",
884
883
  ref: S,
885
- src: O.blobUrl,
884
+ src: $.blobUrl,
886
885
  class: "w-full h-full border-none"
887
- }, null, 8, _s)) : D("", !0)
886
+ }, null, 8, bs)) : D("", !0)
888
887
  ])
889
888
  ])
890
889
  ])) : D("", !0)
891
890
  ]));
892
891
  }
893
- }), ws = /* @__PURE__ */ nt({
892
+ }), gs = /* @__PURE__ */ tt({
894
893
  __name: "MultiLocationSelector",
895
- props: /* @__PURE__ */ $t({
894
+ props: /* @__PURE__ */ qt({
896
895
  locations: {}
897
896
  }, {
898
897
  modelValue: { default: () => [] },
899
898
  modelModifiers: {}
900
899
  }),
901
900
  emits: ["update:modelValue"],
902
- setup(x) {
903
- const { t: h } = ot(), k = x, A = At(x, "modelValue"), S = C(!1), M = C(""), Y = L(() => {
904
- const f = M.value.trim().toLowerCase();
905
- return f ? k.locations.filter(
901
+ setup(_) {
902
+ const { t: h } = nt(), w = _, O = Nt(_, "modelValue"), S = k(!1), z = k(""), Y = L(() => {
903
+ const f = z.value.trim().toLowerCase();
904
+ return f ? w.locations.filter(
906
905
  (d) => d.name.toLowerCase().includes(f) || (d.doc.profile.code ?? "").toLowerCase().includes(f)
907
- ) : k.locations;
908
- }), O = L(() => A.value.length), c = L(
909
- () => Y.value.length > 0 && Y.value.every((f) => A.value.includes(f.dbName))
906
+ ) : w.locations;
907
+ }), $ = L(() => O.value.length), c = L(
908
+ () => Y.value.length > 0 && Y.value.every((f) => O.value.includes(f.dbName))
910
909
  ), l = L(
911
- () => Y.value.some((f) => A.value.includes(f.dbName)) && !c.value
910
+ () => Y.value.some((f) => O.value.includes(f.dbName)) && !c.value
912
911
  ), g = L(() => {
913
- if (O.value === 0) return h("inventory.transfer.receiveRequest.bulk.noLocationsSelected");
914
- if (O.value === 1) {
915
- const f = k.locations.find((d) => d.dbName === A.value[0]);
916
- return f ? `${f.name} (${f.doc.profile.code ?? "--"})` : A.value[0];
912
+ if ($.value === 0) return h("inventory.transfer.receiveRequest.bulk.noLocationsSelected");
913
+ if ($.value === 1) {
914
+ const f = w.locations.find((d) => d.dbName === O.value[0]);
915
+ return f ? `${f.name} (${f.doc.profile.code ?? "--"})` : O.value[0];
917
916
  }
918
- return h("inventory.transfer.receiveRequest.bulk.locationsSelected", [O.value]);
917
+ return h("inventory.transfer.receiveRequest.bulk.locationsSelected", [$.value]);
919
918
  });
920
- function U() {
919
+ function V() {
921
920
  const f = Y.value.map((d) => d.dbName);
922
- c.value ? A.value = A.value.filter((d) => !f.includes(d)) : A.value = [.../* @__PURE__ */ new Set([...A.value, ...f])];
921
+ c.value ? O.value = O.value.filter((d) => !f.includes(d)) : O.value = [.../* @__PURE__ */ new Set([...O.value, ...f])];
923
922
  }
924
- function fe(f) {
925
- A.value.includes(f) ? A.value = A.value.filter((d) => d !== f) : A.value = [...A.value, f];
923
+ function de(f) {
924
+ O.value.includes(f) ? O.value = O.value.filter((d) => d !== f) : O.value = [...O.value, f];
926
925
  }
927
- function p(f) {
928
- return A.value.includes(f);
926
+ function v(f) {
927
+ return O.value.includes(f);
929
928
  }
930
929
  return (f, d) => {
931
- const i = Ce("FmIcon"), _ = Ce("FmChip"), o = Ce("FmTextField"), H = Ce("FmMenuItem"), R = Ce("FmMenu");
932
- return m(), ue(R, {
930
+ const i = Ce("FmIcon"), C = Ce("FmChip"), o = Ce("FmTextField"), H = Ce("FmMenuItem"), R = Ce("FmMenu");
931
+ return m(), le(R, {
933
932
  "model-value": S.value,
934
933
  placement: "bottom-end",
935
934
  "close-on-click": !1,
936
- onMenuChanged: d[1] || (d[1] = (q) => {
937
- S.value = q, q || (M.value = "");
935
+ onMenuChanged: d[1] || (d[1] = (N) => {
936
+ S.value = N, N || (z.value = "");
938
937
  })
939
938
  }, {
940
939
  "menu-button": Pe(() => [
941
- E(_, {
940
+ E(C, {
942
941
  label: g.value,
943
942
  class: "text-fm-color-neutral-gray-400 cursor-pointer"
944
943
  }, {
@@ -949,8 +948,8 @@ const An = {
949
948
  size: "sm"
950
949
  }),
951
950
  e("div", {
952
- class: J(["fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap max-w-[200px]", { "text-fm-color-typo-primary": O.value > 0 }])
953
- }, v(g.value), 3),
951
+ class: J(["fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap max-w-[200px]", { "text-fm-color-typo-primary": $.value > 0 }])
952
+ }, p(g.value), 3),
954
953
  E(i, {
955
954
  name: S.value ? "keyboard_arrow_up" : "keyboard_arrow_down",
956
955
  outline: "",
@@ -962,8 +961,8 @@ const An = {
962
961
  ]),
963
962
  default: Pe(() => [
964
963
  E(o, {
965
- "model-value": M.value,
966
- "onUpdate:modelValue": d[0] || (d[0] = (q) => M.value = q),
964
+ "model-value": z.value,
965
+ "onUpdate:modelValue": d[0] || (d[0] = (N) => z.value = N),
967
966
  placeholder: t(h)("inventory.common.table.toolbar.filterItems"),
968
967
  class: "my-8"
969
968
  }, null, 8, ["model-value", "placeholder"]),
@@ -972,17 +971,17 @@ const An = {
972
971
  label: t(h)("inventory.common.selectAll"),
973
972
  "has-checkbox": !0,
974
973
  indeterminate: l.value,
975
- onClick: U
974
+ onClick: V
976
975
  }, null, 8, ["model-value", "label", "indeterminate"]),
977
- (m(!0), y(he, null, Ke(Y.value, (q) => (m(), ue(H, {
978
- key: q.dbName,
979
- "model-value": p(q.dbName),
980
- label: `${q.name} (${q.doc.profile.code ?? "--"})`,
981
- sublabel: q.type === "restaurant" ? t(h)("inventory.common.restaurant") : t(h)("inventory.common.warehouse"),
976
+ (m(!0), y(ye, null, Qe(Y.value, (N) => (m(), le(H, {
977
+ key: N.dbName,
978
+ "model-value": v(N.dbName),
979
+ label: `${N.name} (${N.doc.profile.code ?? "--"})`,
980
+ sublabel: N.type === "restaurant" ? t(h)("inventory.common.restaurant") : t(h)("inventory.common.warehouse"),
982
981
  "has-checkbox": !0,
983
- onClick: (z) => fe(q.dbName)
982
+ onClick: (M) => de(N.dbName)
984
983
  }, null, 8, ["model-value", "label", "sublabel", "onClick"]))), 128)),
985
- Y.value.length === 0 ? (m(), ue(H, {
984
+ Y.value.length === 0 ? (m(), le(H, {
986
985
  key: 0,
987
986
  disabled: "",
988
987
  label: t(h)("inventory.common.noResultFound")
@@ -992,121 +991,105 @@ const An = {
992
991
  }, 8, ["model-value"]);
993
992
  };
994
993
  }
995
- }), Et = "bulk-jobs-v1";
996
- function ks() {
994
+ }), Pt = "bulk-jobs-v1";
995
+ function xs() {
997
996
  try {
998
- const x = localStorage.getItem(Et);
999
- return x ? JSON.parse(x) : [];
997
+ const _ = localStorage.getItem(Pt);
998
+ return _ ? JSON.parse(_) : [];
1000
999
  } catch {
1001
1000
  return [];
1002
1001
  }
1003
1002
  }
1004
- function Cs(x) {
1003
+ function _s(_) {
1005
1004
  try {
1006
- localStorage.setItem(Et, JSON.stringify(x));
1005
+ localStorage.setItem(Pt, JSON.stringify(_));
1007
1006
  } catch {
1008
1007
  }
1009
1008
  }
1010
- const wt = 5e3, kt = 3e3, Fs = 300, Qe = ["completed", "failed", "cancelled"];
1011
- function Ss(x, h) {
1012
- var k;
1013
- return x.cancelled ? "cancelled" : x.message === "completed" ? "completed" : x.message === "error" || (k = x.message) != null && k.startsWith("error:") ? "failed" : x.message === "processing" ? "active" : "waiting";
1009
+ const ws = 300, rt = ["completed", "failed", "cancelled"];
1010
+ function ks(_, h) {
1011
+ var w;
1012
+ return _.cancelled ? "cancelled" : _.message === "completed" ? "completed" : _.message === "error" || (w = _.message) != null && w.startsWith("error:") ? "failed" : _.message === "processing" ? "active" : "waiting";
1014
1013
  }
1015
- const pt = Dn("bulkJob", () => {
1016
- const x = C(ks()), h = /* @__PURE__ */ new Map();
1017
- let k = null;
1018
- Ve(x, (p) => {
1019
- k && clearTimeout(k), k = setTimeout(() => Cs(p), Fs);
1014
+ const pt = Rn("bulkJob", () => {
1015
+ const _ = k(xs()), h = /* @__PURE__ */ new Map();
1016
+ let w = null;
1017
+ Ve(_, (v) => {
1018
+ w && clearTimeout(w), w = setTimeout(() => _s(v), ws);
1020
1019
  }, { deep: !0 });
1021
- function A(p, f) {
1020
+ function O(v, f) {
1022
1021
  var R;
1023
- const d = x.value.find((q) => q.jobId === p);
1024
- let i = Ss(f, d == null ? void 0 : d.type);
1025
- const _ = f.errorCount ?? 0;
1026
- i === "completed" && _ > 0 && (d == null ? void 0 : d.type) === "download" && (i = "failed");
1022
+ const d = _.value.find((N) => N.jobId === v);
1023
+ let i = ks(f, d == null ? void 0 : d.type);
1024
+ const C = f.errorCount ?? 0;
1025
+ i === "completed" && C > 0 && (d == null ? void 0 : d.type) === "download" && (i = "failed");
1027
1026
  const o = f.total ?? 0, H = f.current ?? 0;
1028
- O(p, {
1027
+ $(v, {
1029
1028
  status: i,
1030
1029
  progress: o > 0 ? Math.round(H / o * 100) : 0,
1031
1030
  current: H,
1032
1031
  total: o,
1033
1032
  currentItem: f.currentItem ?? void 0,
1034
- errorCount: _,
1033
+ errorCount: C,
1035
1034
  // Only expose the download button when the job fully succeeded.
1036
1035
  downloadReady: i === "completed" ? f.downloadReady : !1,
1037
1036
  zipSizeBytes: f.zipSizeBytes ?? void 0,
1038
1037
  stalePoIds: (R = f.stalePoIds) != null && R.length ? f.stalePoIds : void 0
1039
- }), Qe.includes(i) && M(p);
1038
+ }), rt.includes(i) && z(v);
1040
1039
  }
1041
- function S(p) {
1042
- if (h.has(p) || !x.value.find((G) => G.jobId === p)) return;
1043
- const d = Ge();
1044
- let i = !1, _ = null, o = !1;
1045
- async function H() {
1046
- if (o) return;
1047
- const G = x.value.find((se) => se.jobId === p);
1048
- if (!(!G || Qe.includes(G.status)))
1049
- try {
1050
- const se = await d.getBulkJobStatus(G.dbName, p);
1051
- if (se && !o) {
1052
- A(p, se);
1053
- const ee = x.value.find((de) => de.jobId === p);
1054
- ee && !Qe.includes(ee.status) && (_ = setTimeout(H, kt));
1055
- }
1056
- } catch {
1057
- o || (_ = setTimeout(H, kt));
1058
- }
1059
- }
1060
- const R = En(), { unsubscribe: q, initialState: z } = R.subscribe(
1061
- { type: "bulkPo", params: { jobId: p } },
1062
- (G) => {
1063
- i = !0, _ && (clearTimeout(_), _ = null), A(p, G);
1040
+ function S(v) {
1041
+ if (h.has(v)) return;
1042
+ const f = _.value.find((H) => H.jobId === v);
1043
+ if (!f) return;
1044
+ const d = 5;
1045
+ let i = 0;
1046
+ const C = async () => {
1047
+ const H = Ke();
1048
+ try {
1049
+ const R = await H.getBulkJobStatus(f.dbName, v);
1050
+ R ? (i = 0, O(v, R)) : (i++, i >= d && ($(v, { status: "failed" }), z(v)));
1051
+ } catch {
1064
1052
  }
1065
- ), pe = () => {
1066
- o = !0, q(), _ && (clearTimeout(_), _ = null);
1067
1053
  };
1068
- h.set(p, pe), z.then((G) => {
1069
- G != null && G.initialState && (i = !0, A(p, G.initialState));
1070
- }).catch(() => {
1071
- }), setTimeout(() => {
1072
- !i && !o && (console.warn(`[bulkJob] SSE silent for job ${p} after ${wt}ms — starting polling fallback`), H());
1073
- }, wt);
1054
+ C();
1055
+ const o = setInterval(C, 2e3);
1056
+ h.set(v, o);
1074
1057
  }
1075
- function M(p) {
1076
- const f = h.get(p);
1077
- f !== void 0 && (f(), h.delete(p));
1058
+ function z(v) {
1059
+ const f = h.get(v);
1060
+ f !== void 0 && (clearInterval(f), h.delete(v));
1078
1061
  }
1079
- function Y(p) {
1080
- x.value = [p, ...x.value], S(p.jobId);
1062
+ function Y(v) {
1063
+ _.value = [v, ..._.value], S(v.jobId);
1081
1064
  }
1082
- for (const p of x.value)
1083
- Qe.includes(p.status) || S(p.jobId);
1084
- function O(p, f) {
1085
- const d = x.value.findIndex((i) => i.jobId === p);
1065
+ for (const v of _.value)
1066
+ rt.includes(v.status) || S(v.jobId);
1067
+ function $(v, f) {
1068
+ const d = _.value.findIndex((i) => i.jobId === v);
1086
1069
  if (d !== -1) {
1087
- const i = x.value[d], _ = f.status ?? i.status, o = Qe.includes(_) && !Qe.includes(i.status) && !i.completedAt;
1088
- x.value[d] = {
1070
+ const i = _.value[d], C = f.status ?? i.status, o = rt.includes(C) && !rt.includes(i.status) && !i.completedAt;
1071
+ _.value[d] = {
1089
1072
  ...i,
1090
1073
  ...f,
1091
1074
  ...o ? { completedAt: Date.now() } : {}
1092
1075
  };
1093
1076
  }
1094
1077
  }
1095
- function c(p) {
1096
- M(p), x.value = x.value.filter((f) => f.jobId !== p);
1078
+ function c(v) {
1079
+ z(v), _.value = _.value.filter((f) => f.jobId !== v);
1097
1080
  }
1098
- async function l(p) {
1099
- const f = x.value.find((d) => d.jobId === p);
1081
+ async function l(v) {
1082
+ const f = _.value.find((d) => d.jobId === v);
1100
1083
  if (f)
1101
1084
  try {
1102
- await Ge().cancelBulkJob(f.dbName, p);
1085
+ await Ke().cancelBulkJob(f.dbName, v);
1103
1086
  } catch (d) {
1104
- console.warn("[cancelJob] cancel API call failed for job", p, d);
1087
+ console.warn("[cancelJob] cancel API call failed for job", v, d);
1105
1088
  }
1106
1089
  }
1107
- function g(p, f) {
1108
- return x.value.find((d) => d.jobId === p) || Y({
1109
- jobId: p,
1090
+ function g(v, f) {
1091
+ return _.value.find((d) => d.jobId === v) || Y({
1092
+ jobId: v,
1110
1093
  type: "download",
1111
1094
  dbName: f,
1112
1095
  title: "",
@@ -1117,23 +1100,23 @@ const pt = Dn("bulkJob", () => {
1117
1100
  errorCount: 0,
1118
1101
  startedAt: Date.now()
1119
1102
  }), new Promise((d, i) => {
1120
- const _ = Ve(
1121
- () => x.value.find((o) => o.jobId === p),
1103
+ const C = Ve(
1104
+ () => _.value.find((o) => o.jobId === v),
1122
1105
  (o) => {
1123
1106
  if (!o) {
1124
- _(), i(new Error("PDF generation job not found"));
1107
+ C(), i(new Error("PDF generation job not found"));
1125
1108
  return;
1126
1109
  }
1127
1110
  if (o.status === "failed") {
1128
- _(), i(new Error("PDF generation failed"));
1111
+ C(), i(new Error("PDF generation failed"));
1129
1112
  return;
1130
1113
  }
1131
1114
  if (o.status === "cancelled") {
1132
- _(), i(new Error("PDF generation cancelled"));
1115
+ C(), i(new Error("PDF generation cancelled"));
1133
1116
  return;
1134
1117
  }
1135
1118
  if (o.downloadReady) {
1136
- _(), d();
1119
+ C(), d();
1137
1120
  return;
1138
1121
  }
1139
1122
  },
@@ -1141,81 +1124,81 @@ const pt = Dn("bulkJob", () => {
1141
1124
  );
1142
1125
  });
1143
1126
  }
1144
- const U = L(
1145
- () => x.value.filter((p) => p.status === "waiting" || p.status === "active")
1146
- ), fe = L(() => U.value.length > 0);
1147
- return { jobs: x, addJob: Y, updateJob: O, removeJob: c, cancelJob: l, waitForPdfJob: g, activeJobs: U, hasActiveJobs: fe };
1148
- }), tt = C(), be = C(), dt = C();
1149
- function Rs(x) {
1150
- const h = dn(), k = it(), A = Dt(), S = Rt(), M = St(), Y = _n(), O = Pt(), c = C(!1), l = ut(), { t: g } = ot(), U = Ge(), fe = Qt(), p = pt(), f = C([]), d = C([]), i = C(new Array()), _ = C(
1127
+ const V = L(
1128
+ () => _.value.filter((v) => v.status === "waiting" || v.status === "active")
1129
+ ), de = L(() => V.value.length > 0);
1130
+ return { jobs: _, addJob: Y, updateJob: $, removeJob: c, cancelJob: l, waitForPdfJob: g, activeJobs: V, hasActiveJobs: de };
1131
+ }), et = k(), pe = k(), dt = k();
1132
+ function Cs(_) {
1133
+ const h = un(), w = it(), O = Rt(), S = Ft(), z = Ct(), Y = hn(), $ = St(), c = k(!1), l = ut(), { t: g } = nt(), V = Ke(), de = Yt(), v = pt(), f = k([]), d = k([]), i = k(new Array()), C = k(
1151
1134
  new Array()
1152
- ), o = C(
1153
- x != null && x.startDate && (x != null && x.endDate) ? x : ft()
1135
+ ), o = k(
1136
+ _ != null && _.startDate && (_ != null && _.endDate) ? _ : ft()
1154
1137
  ), H = L(() => {
1155
1138
  const r = new Date(o.value.startDate), u = new Date(o.value.endDate);
1156
1139
  return {
1157
- start: Rn(r).toISOString(),
1158
- end: Sn(u).toISOString()
1140
+ start: Fn(r).toISOString(),
1141
+ end: Cn(u).toISOString()
1159
1142
  };
1160
- }), R = Ut(), q = C(null), z = C([]), pe = C(), G = C(!1), se = C(null);
1161
- let ee = null;
1162
- function de() {
1163
- ee && (ee.abort(), ee = null, c.value = !1, G.value = !1, se.value = null);
1143
+ }), R = zt(), N = k(null), M = k([]), be = k(), he = k(!1), ue = k(null);
1144
+ let ne = null;
1145
+ function ve() {
1146
+ ne && (ne.abort(), ne = null, c.value = !1, he.value = !1, ue.value = null);
1164
1147
  }
1165
1148
  function De(r) {
1166
- const u = k.locations.find((b) => b.dbName === r._locationDbName);
1149
+ const u = w.locations.find((b) => b.dbName === r._locationDbName);
1167
1150
  if (!u) return null;
1168
1151
  if (u.type === "restaurant") {
1169
- const b = k.locationRestaurantFromCore(u.doc._id);
1152
+ const b = w.locationRestaurantFromCore(u.doc._id);
1170
1153
  if (b !== null)
1171
1154
  return { ...u, doc: b };
1172
1155
  }
1173
1156
  return u;
1174
1157
  }
1175
- function xe(r) {
1176
- const u = k.locations.find((b) => b.dbName === r._locationDbName);
1177
- u && (k._currentLocation = u);
1158
+ function _e(r) {
1159
+ const u = w.locations.find((b) => b.dbName === r._locationDbName);
1160
+ u && (w._currentLocation = u);
1178
1161
  }
1179
- async function $e(r, u, b) {
1180
- const T = f.value.map(($) => ({ dbName: $ })), I = T.length;
1181
- se.value = { done: 0, total: I };
1182
- let N = u.cursor, W = u.retryFailed, Q = !0;
1162
+ async function Ae(r, u, b) {
1163
+ const T = f.value.map((A) => ({ dbName: A })), I = T.length;
1164
+ ue.value = { done: 0, total: I };
1165
+ let q = u.cursor, W = u.retryFailed, Q = !0;
1183
1166
  for (; Q && !b.aborted; ) {
1184
- const $ = await U.getBulkPaginatedPurchaseOrders(
1167
+ const A = await V.getBulkPaginatedPurchaseOrders(
1185
1168
  {
1186
1169
  locations: T,
1187
1170
  ...H.value,
1188
1171
  pageSize: 100,
1189
- cursor: N,
1172
+ cursor: q,
1190
1173
  retryFailed: W
1191
1174
  },
1192
1175
  b
1193
1176
  );
1194
1177
  if (b.aborted) return;
1195
- W = void 0, se.value = {
1196
- done: Math.max(0, I - $.pendingLocations),
1178
+ W = void 0, ue.value = {
1179
+ done: Math.max(0, I - A.pendingLocations),
1197
1180
  total: I
1198
1181
  }, r.push(
1199
- ...$.data.map(
1200
- ({ locationDbName: te, ...V }) => ({ ...V, _locationDbName: te })
1182
+ ...A.data.map(
1183
+ ({ locationDbName: Z, ...U }) => ({ ...U, _locationDbName: Z })
1201
1184
  )
1202
- ), d.value = [...r].sort((te, V) => V._id.localeCompare(te._id)), z.value = $.failed, pe.value = $.cursor, Q = $.hasNext, N = $.cursor;
1185
+ ), d.value = [...r].sort((Z, U) => U._id.localeCompare(Z._id)), M.value = A.failed, be.value = A.cursor, Q = A.hasNext, q = A.cursor;
1203
1186
  }
1204
1187
  }
1205
1188
  async function Ee() {
1206
1189
  const r = d.value.flatMap((u) => u.shipmentIds || []).filter(Boolean);
1207
- i.value = r.length > 0 ? await fe.getShipmentsByIds(r) : [];
1190
+ i.value = r.length > 0 ? await de.getShipmentsByIds(r) : [];
1208
1191
  }
1209
- async function ve(r) {
1192
+ async function me(r) {
1210
1193
  const u = r.map((b) => {
1211
1194
  var T;
1212
1195
  return ((T = b.request) == null ? void 0 : T.id) ?? "";
1213
1196
  }).filter((b) => b);
1214
- _.value = u.length > 0 ? await U.readRequestByIds(u) : [];
1197
+ C.value = u.length > 0 ? await V.readRequestByIds(u) : [];
1215
1198
  }
1216
1199
  const ge = 25;
1217
- async function Ae() {
1218
- if (d.value = [], i.value = [], z.value = [], pe.value = void 0, f.value.length === 0)
1200
+ async function $e() {
1201
+ if (d.value = [], i.value = [], M.value = [], be.value = void 0, f.value.length === 0)
1219
1202
  return;
1220
1203
  if (f.value.length > ge) {
1221
1204
  l.open({
@@ -1225,17 +1208,17 @@ function Rs(x) {
1225
1208
  });
1226
1209
  return;
1227
1210
  }
1228
- de();
1211
+ ve();
1229
1212
  const r = new AbortController();
1230
- ee = r, c.value = !0;
1213
+ ne = r, c.value = !0;
1231
1214
  try {
1232
- await $e([], {}, r.signal), z.value.length > 0 && l.open({
1215
+ await Ae([], {}, r.signal), M.value.length > 0 && l.open({
1233
1216
  title: "Some locations failed to load",
1234
- message: `Purchase orders could not be loaded for ${z.value.length} location(s)`,
1217
+ message: `Purchase orders could not be loaded for ${M.value.length} location(s)`,
1235
1218
  type: "error"
1236
1219
  }), await Ee();
1237
1220
  const b = await R.readCurrentLocationLastClosing(!0), T = b == null ? void 0 : b._id;
1238
- T && (q.value = Pn(T)), await A.awaitFeatureLoaded(() => A.mustUsePoTemplate) && await O.fetchTemplates();
1221
+ T && (N.value = Sn(T)), await O.awaitFeatureLoaded(() => O.mustUsePoTemplate) && await $.fetchTemplates();
1239
1222
  } catch (u) {
1240
1223
  if (r.signal.aborted) return;
1241
1224
  l.open({
@@ -1245,17 +1228,17 @@ function Rs(x) {
1245
1228
  type: "error"
1246
1229
  });
1247
1230
  } finally {
1248
- ee === r && (ee = null, c.value = !1, se.value = null);
1231
+ ne === r && (ne = null, c.value = !1, ue.value = null);
1249
1232
  }
1250
1233
  }
1251
1234
  async function Fe() {
1252
- if (!pe.value || !z.value.some((u) => u.retryable)) return;
1253
- de();
1235
+ if (!be.value || !M.value.some((u) => u.retryable)) return;
1236
+ ve();
1254
1237
  const r = new AbortController();
1255
- ee = r, G.value = !0;
1238
+ ne = r, he.value = !0;
1256
1239
  try {
1257
1240
  const u = [...d.value];
1258
- if (await $e(u, { cursor: pe.value, retryFailed: !0 }, r.signal), r.signal.aborted) return;
1241
+ if (await Ae(u, { cursor: be.value, retryFailed: !0 }, r.signal), r.signal.aborted) return;
1259
1242
  await Ee();
1260
1243
  } catch (u) {
1261
1244
  if (r.signal.aborted) return;
@@ -1265,34 +1248,34 @@ function Rs(x) {
1265
1248
  type: "error"
1266
1249
  });
1267
1250
  } finally {
1268
- ee === r && (ee = null, G.value = !1, se.value = null);
1251
+ ne === r && (ne = null, he.value = !1, ue.value = null);
1269
1252
  }
1270
1253
  }
1271
- function Xe(r, u) {
1272
- o.value = { startDate: r, endDate: u }, Ae();
1254
+ function Ge(r, u) {
1255
+ o.value = { startDate: r, endDate: u }, $e();
1273
1256
  }
1274
- const qe = C();
1257
+ const qe = k();
1275
1258
  async function Oe(r) {
1276
1259
  const u = f.value[0];
1277
1260
  if (u) {
1278
- const I = k.locations.find((N) => N.dbName === u);
1279
- I && (k._currentLocation = I);
1261
+ const I = w.locations.find((q) => q.dbName === u);
1262
+ I && (w._currentLocation = I);
1280
1263
  }
1281
1264
  function b(I) {
1282
- const N = {
1283
- mode: xt.CREATE,
1265
+ const q = {
1266
+ mode: _t.CREATE,
1284
1267
  modelValue: r || void 0,
1285
1268
  show: !0,
1286
1269
  "onUpdate:show"(W) {
1287
- tt.value.show = W;
1270
+ et.value.show = W;
1288
1271
  },
1289
1272
  templateId: I,
1290
- lastClosingDate: q.value
1273
+ lastClosingDate: N.value
1291
1274
  };
1292
- tt.value = N;
1275
+ et.value = q;
1293
1276
  }
1294
1277
  let T;
1295
- A.mustUsePoTemplate && !(r != null && r.template) ? h.open({
1278
+ O.mustUsePoTemplate && !(r != null && r.template) ? h.open({
1296
1279
  title: "Create transfer",
1297
1280
  message: "",
1298
1281
  primaryActions: { text: "Select a template", close: !0 },
@@ -1303,84 +1286,84 @@ function Rs(x) {
1303
1286
  b(void 0);
1304
1287
  }) : b(T);
1305
1288
  }
1306
- const Se = qn();
1289
+ const Se = Pn();
1307
1290
  async function P(r, u) {
1308
- return r.items != null ? r : await U.getPurchaseOrderById(r._id, void 0, u);
1291
+ return r.items != null ? r : await V.getPurchaseOrderById(r._id, void 0, u);
1309
1292
  }
1310
1293
  async function F(r) {
1311
1294
  await Se.run(async (u) => {
1312
- xe(r);
1295
+ _e(r);
1313
1296
  const b = await P(r, u), T = {
1314
- mode: xt.UPDATE,
1315
- modelValue: jt(b),
1297
+ mode: _t.UPDATE,
1298
+ modelValue: Vt(b),
1316
1299
  show: !0,
1317
1300
  "onUpdate:show"(I) {
1318
- tt.value.show = I;
1301
+ et.value.show = I;
1319
1302
  },
1320
- lastClosingDate: q.value
1303
+ lastClosingDate: N.value
1321
1304
  };
1322
- tt.value = T;
1305
+ et.value = T;
1323
1306
  });
1324
1307
  }
1325
1308
  async function B(r) {
1326
- var Q, $, te;
1327
- if (xe(r), !M.currentBusiness.value) return;
1309
+ var Q, A, Z;
1310
+ if (_e(r), !z.currentBusiness.value) return;
1328
1311
  const u = r, b = S.supplierById[r.supplier._id], T = (b == null ? void 0 : b.email) ?? ((Q = r.supplier) == null ? void 0 : Q.email) ?? "";
1329
1312
  let I = null;
1330
- be.value = {
1313
+ pe.value = {
1331
1314
  recipientName: b == null ? void 0 : b.name,
1332
1315
  email: T,
1333
- business: M.currentBusiness.value,
1316
+ business: z.currentBusiness.value,
1334
1317
  pdfLoading: !0,
1335
1318
  show: !0,
1336
- "onUpdate:show"(V) {
1337
- !V && I && (URL.revokeObjectURL(I), I = null), be.value && (be.value = { ...be.value, show: V });
1319
+ "onUpdate:show"(U) {
1320
+ !U && I && (URL.revokeObjectURL(I), I = null), pe.value && (pe.value = { ...pe.value, show: U });
1338
1321
  }
1339
1322
  };
1340
- const N = await Se.run((V) => P(u, V));
1341
- if (!N) {
1342
- be.value && (be.value = { ...be.value, show: !1, pdfLoading: !1 });
1323
+ const q = await Se.run((U) => P(u, U));
1324
+ if (!q) {
1325
+ pe.value && (pe.value = { ...pe.value, show: !1, pdfLoading: !1 });
1343
1326
  return;
1344
1327
  }
1345
- const W = N._rev;
1328
+ const W = q._rev;
1346
1329
  try {
1347
- let V = await U.getPurchaseOrderPdf(r._id, u._locationDbName, W);
1348
- "pending" in V && (await p.waitForPdfJob(V.jobId, u._locationDbName), V = await U.getPurchaseOrderPdf(r._id, u._locationDbName, W));
1349
- const ie = URL.createObjectURL(V);
1350
- ($ = be.value) != null && $.show ? (I = ie, be.value = {
1351
- ...be.value,
1352
- pdfBlobUrl: ie,
1330
+ let U = await V.getPurchaseOrderPdf(r._id, u._locationDbName, W);
1331
+ "pending" in U && (await v.waitForPdfJob(U.jobId, u._locationDbName), U = await V.getPurchaseOrderPdf(r._id, u._locationDbName, W));
1332
+ const re = URL.createObjectURL(U);
1333
+ (A = pe.value) != null && A.show ? (I = re, pe.value = {
1334
+ ...pe.value,
1335
+ pdfBlobUrl: re,
1353
1336
  pdfLoading: !1
1354
- }) : URL.revokeObjectURL(ie);
1355
- } catch (V) {
1356
- console.error("[promptEmailDialog] PDF fetch failed:", V), (te = be.value) != null && te.show && (be.value = { ...be.value, pdfLoading: !1 }, l.open({
1337
+ }) : URL.revokeObjectURL(re);
1338
+ } catch (U) {
1339
+ console.error("[promptEmailDialog] PDF fetch failed:", U), (Z = pe.value) != null && Z.show && (pe.value = { ...pe.value, pdfLoading: !1 }, l.open({
1357
1340
  title: g("inventory.common.somethingWentWrong"),
1358
- message: g("inventory.transfer.receiveRequest.bulk.pdfUnavailableMsg"),
1341
+ message: (U == null ? void 0 : U.message) || g("inventory.common.tryAgain"),
1359
1342
  type: "error"
1360
1343
  }));
1361
1344
  }
1362
1345
  }
1363
1346
  async function K(r) {
1364
- if (xe(r), r.items != null)
1347
+ if (_e(r), r.items != null)
1365
1348
  return r;
1366
1349
  try {
1367
- return { ...await U.getPurchaseOrderById(r._id), _locationDbName: r._locationDbName };
1350
+ return { ...await V.getPurchaseOrderById(r._id), _locationDbName: r._locationDbName };
1368
1351
  } catch (u) {
1369
1352
  throw console.error(`Failed to hydrate PO ${r._id} for action`, u), u;
1370
1353
  }
1371
1354
  }
1372
- async function X(r, u) {
1355
+ async function G(r, u) {
1373
1356
  var W;
1374
- xe(r);
1357
+ _e(r);
1375
1358
  const b = await Se.run((Q) => P(r, Q));
1376
1359
  if (!b) return;
1377
1360
  if (u === void 0 && ((W = r.request) != null && W.id))
1378
1361
  try {
1379
- u = await U.getLatestPurchaseOrderRequest(r._id);
1362
+ u = await V.getLatestPurchaseOrderRequest(r._id);
1380
1363
  } catch (Q) {
1381
1364
  console.warn("[transfer-details] POR fetch failed for", r._id, Q);
1382
1365
  }
1383
- const I = De(r), N = {
1366
+ const I = De(r), q = {
1384
1367
  poRequest: u,
1385
1368
  purchaseOrder: b,
1386
1369
  transferTo: I == null ? void 0 : I.name,
@@ -1391,21 +1374,21 @@ function Rs(x) {
1391
1374
  "onUpdate:show"(Q) {
1392
1375
  qe.value && (qe.value = { ...qe.value, show: Q });
1393
1376
  },
1394
- scope: Ft.RECEIVE_REQUEST,
1395
- receivedMap: Zt(b) ?? {},
1377
+ scope: kt.RECEIVE_REQUEST,
1378
+ receivedMap: Gt(b) ?? {},
1396
1379
  shipments: i.value
1397
1380
  };
1398
- qe.value = N;
1381
+ qe.value = q;
1399
1382
  }
1400
- async function ne(r, u, b, T, I) {
1401
- const N = en();
1383
+ async function ee(r, u, b, T, I) {
1384
+ const q = Xt();
1402
1385
  c.value = !0;
1403
1386
  try {
1404
- await N({
1387
+ await q({
1405
1388
  operate: {
1406
1389
  operation: u,
1407
1390
  doc: r,
1408
- options: (u === Ye.enum.confirmDraft || u === Ye.enum.completeReceive) && A.autoReceiveWarehouse ? { autoReceive: !0 } : void 0
1391
+ options: (u === Ye.enum.confirmDraft || u === Ye.enum.completeReceive) && O.autoReceiveWarehouse ? { autoReceive: !0 } : void 0
1409
1392
  },
1410
1393
  operateV2: {
1411
1394
  _id: r._id,
@@ -1422,49 +1405,49 @@ function Rs(x) {
1422
1405
  type: "error"
1423
1406
  }), console.error("Error when submitting PO operation", u, r, W);
1424
1407
  } finally {
1425
- c.value = !1, Ae();
1408
+ c.value = !1, $e();
1426
1409
  }
1427
1410
  }
1428
1411
  async function Re(r, u, b) {
1429
- xe(r);
1430
- const T = Kt[u];
1412
+ _e(r);
1413
+ const T = Ht[u];
1431
1414
  if (!T) {
1432
1415
  l.open({
1433
1416
  title: "Something went wrong",
1434
- message: `Cannot process order: ${Vt(u)}`,
1417
+ message: `Cannot process order: ${Mt(u)}`,
1435
1418
  type: "error"
1436
1419
  });
1437
1420
  return;
1438
1421
  }
1439
- const { successMessage: I, ...N } = T;
1422
+ const { successMessage: I, ...q } = T;
1440
1423
  if (u === Ye.enum.rejectDraft) {
1441
- let $ = "";
1424
+ let A = "";
1442
1425
  h.open({
1443
- title: N.title,
1444
- message: N.message,
1445
- primaryActions: N.primaryActions,
1446
- contentComponent: Gt,
1426
+ title: q.title,
1427
+ message: q.message,
1428
+ primaryActions: q.primaryActions,
1429
+ contentComponent: Qt,
1447
1430
  contentComponentProps: {
1448
- message: N.message,
1449
- onChange: (te) => $ = te
1431
+ message: q.message,
1432
+ onChange: (Z) => A = Z
1450
1433
  }
1451
1434
  }).onPrimary(() => {
1452
- ne(r, u, I, b, [
1453
- { action: "rejectDraft", payload: { rejectReason: $ } }
1435
+ ee(r, u, I, b, [
1436
+ { action: "rejectDraft", payload: { rejectReason: A } }
1454
1437
  ]);
1455
1438
  });
1456
1439
  return;
1457
1440
  }
1458
- const W = [], Q = Xt();
1441
+ const W = [], Q = Kt();
1459
1442
  Q.init(r), (u === Ye.enum.confirmDraft || u === Ye.enum.submitRequest) && W.push({
1460
1443
  action: "confirmDraft",
1461
- payload: Q.controller.value.toConfirmDraftData(Jt())
1444
+ payload: Q.controller.value.toConfirmDraftData(Ut())
1462
1445
  }), h.open({
1463
- title: N.title,
1464
- message: N.message,
1465
- primaryActions: N.primaryActions
1446
+ title: q.title,
1447
+ message: q.message,
1448
+ primaryActions: q.primaryActions
1466
1449
  }).onPrimary(() => {
1467
- ne(
1450
+ ee(
1468
1451
  r,
1469
1452
  u,
1470
1453
  I,
@@ -1491,11 +1474,11 @@ function Rs(x) {
1491
1474
  async function j() {
1492
1475
  const { start: r, end: u } = H.value;
1493
1476
  return (await Promise.allSettled(
1494
- f.value.map(async (T) => (await U.getPurchaseOrders({ start: r, end: u, dbName: T })).map((N) => ({ ...N, _locationDbName: T })))
1477
+ f.value.map(async (T) => (await V.getPurchaseOrders({ start: r, end: u, dbName: T })).map((q) => ({ ...q, _locationDbName: T })))
1495
1478
  )).flatMap((T) => T.status === "fulfilled" ? T.value : []);
1496
1479
  }
1497
- async function le(r) {
1498
- return p.activeJobs.find((b) => b.type === r) ? new Promise((b) => {
1480
+ async function ae(r) {
1481
+ return v.activeJobs.find((b) => b.type === r) ? new Promise((b) => {
1499
1482
  h.open({
1500
1483
  title: g("inventory.transfer.receiveRequest.bulk.activeJobWarningTitle"),
1501
1484
  message: g("inventory.transfer.receiveRequest.bulk.activeJobWarningMsg", [r]),
@@ -1505,7 +1488,7 @@ function Rs(x) {
1505
1488
  }) : !0;
1506
1489
  }
1507
1490
  async function Be(r) {
1508
- if (!await le("download")) return;
1491
+ if (!await ae("download")) return;
1509
1492
  const { startDate: u, endDate: b } = o.value;
1510
1493
  if (He(b).diff(He(u), "month", !0) > 2) {
1511
1494
  l.open({
@@ -1523,15 +1506,15 @@ function Rs(x) {
1523
1506
  });
1524
1507
  return;
1525
1508
  }
1526
- const T = r.map((N) => {
1527
- var V;
1528
- const Q = (((V = k.locations.find((ie) => ie.dbName === N._locationDbName)) == null ? void 0 : V.name) || N._locationDbName).replace(/[/\\?%*:|"<>]/g, "-").trim().slice(0, 50), $ = `PO_${N.seqNumber || N._id}`.replace(/[/\\?%*:|"<>]/g, "-").slice(0, 50), te = `${Q}/${$}`;
1529
- return { poId: N._id, dbName: N._locationDbName, filename: te, rev: N._rev };
1509
+ const T = r.map((q) => {
1510
+ var U;
1511
+ const Q = (((U = w.locations.find((re) => re.dbName === q._locationDbName)) == null ? void 0 : U.name) || q._locationDbName).replace(/[/\\?%*:|"<>]/g, "-").trim().slice(0, 50), A = `PO_${q.seqNumber || q._id}`.replace(/[/\\?%*:|"<>]/g, "-").slice(0, 50), Z = `${Q}/${A}`;
1512
+ return { poId: q._id, dbName: q._locationDbName, filename: Z, rev: q._rev };
1530
1513
  }), I = f.value[0];
1531
1514
  try {
1532
- const { jobId: N, fromCache: W } = await U.enqueueBulkDownload(I, { items: T });
1533
- p.addJob({
1534
- jobId: N,
1515
+ const { jobId: q, fromCache: W } = await V.enqueueBulkDownload(I, { items: T });
1516
+ v.addJob({
1517
+ jobId: q,
1535
1518
  type: "download",
1536
1519
  dbName: I,
1537
1520
  title: `Download All (${r.length} POs)`,
@@ -1550,8 +1533,8 @@ function Rs(x) {
1550
1533
  message: g("inventory.transfer.receiveRequest.bulk.downloadQueued"),
1551
1534
  type: "success"
1552
1535
  });
1553
- } catch (N) {
1554
- console.error("Bulk download enqueue failed", N), l.open({
1536
+ } catch (q) {
1537
+ console.error("Bulk download enqueue failed", q), l.open({
1555
1538
  title: g("inventory.transfer.receiveRequest.bulk.downloadError"),
1556
1539
  message: g("inventory.transfer.receiveRequest.bulk.downloadErrorMsg"),
1557
1540
  type: "error"
@@ -1560,12 +1543,12 @@ function Rs(x) {
1560
1543
  }
1561
1544
  async function Te(r) {
1562
1545
  var Me, je, We;
1563
- if (!await le("email")) return;
1546
+ if (!await ae("email")) return;
1564
1547
  const u = [
1565
1548
  gt.enum.RECEIVING,
1566
1549
  gt.enum.PROCESSING
1567
1550
  // PARTIAL_RECEIVED display status maps from PROCESSING
1568
- ], b = r.filter((w) => u.includes(w.status));
1551
+ ], b = r.filter((x) => u.includes(x.status));
1569
1552
  if (b.length === 0) {
1570
1553
  l.open({
1571
1554
  title: g("inventory.transfer.receiveRequest.bulk.emailSendError"),
@@ -1574,58 +1557,58 @@ function Rs(x) {
1574
1557
  });
1575
1558
  return;
1576
1559
  }
1577
- if (!((Me = M.currentBusiness.value) != null && Me._id)) return;
1578
- await ve(b);
1579
- const T = pn(), I = hn(), N = /* @__PURE__ */ new Map(), W = k.locations.map((w) => w.dbName), Q = `business_${M.currentBusiness.value._id}`, $ = [.../* @__PURE__ */ new Set([...W, Q])];
1560
+ if (!((Me = z.currentBusiness.value) != null && Me._id)) return;
1561
+ await me(b);
1562
+ const T = mn(), I = yn(), q = /* @__PURE__ */ new Map(), W = w.locations.map((x) => x.dbName), Q = `business_${z.currentBusiness.value._id}`, A = [.../* @__PURE__ */ new Set([...W, Q])];
1580
1563
  await Promise.allSettled(
1581
- $.map(async (w) => {
1564
+ A.map(async (x) => {
1582
1565
  try {
1583
- (await I.readSuppliersByDbName(w)).forEach((ce) => {
1584
- const me = N.get(ce._id);
1585
- (!me || !me.email && ce.email) && N.set(ce._id, ce);
1566
+ (await I.readSuppliersByDbName(x)).forEach((ie) => {
1567
+ const ce = q.get(ie._id);
1568
+ (!ce || !ce.email && ie.email) && q.set(ie._id, ie);
1586
1569
  });
1587
- } catch (ae) {
1588
- console.warn("[emailAll] fetch failed for", w, ae);
1570
+ } catch (oe) {
1571
+ console.warn("[emailAll] fetch failed for", x, oe);
1589
1572
  }
1590
1573
  })
1591
1574
  );
1592
- function te(w) {
1593
- var ce;
1594
- const ae = N.get(w.supplier._id);
1595
- return (ae == null ? void 0 : ae.email) || ((ce = w.supplier) == null ? void 0 : ce.email);
1596
- }
1597
- const V = [], ie = [];
1598
- for (const w of b)
1599
- te(w) ? V.push(w) : ie.push(w);
1600
- const Je = _e(
1575
+ function Z(x) {
1576
+ var ie;
1577
+ const oe = q.get(x.supplier._id);
1578
+ return (oe == null ? void 0 : oe.email) || ((ie = x.supplier) == null ? void 0 : ie.email);
1579
+ }
1580
+ const U = [], re = [];
1581
+ for (const x of b)
1582
+ Z(x) ? U.push(x) : re.push(x);
1583
+ const Je = xe(
1601
1584
  "p",
1602
1585
  { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
1603
1586
  g("inventory.transfer.receiveRequest.bulk.emailAllowedStatusInfo")
1604
1587
  );
1605
- if (ie.length > 0) {
1606
- const w = /* @__PURE__ */ new Map();
1607
- for (const me of ie) {
1608
- const n = me.supplier._id;
1609
- w.has(n) || w.set(n, { supplierName: me.supplier.name, pos: [] }), w.get(n).pos.push(me);
1588
+ if (re.length > 0) {
1589
+ const x = /* @__PURE__ */ new Map();
1590
+ for (const ce of re) {
1591
+ const n = ce.supplier._id;
1592
+ x.has(n) || x.set(n, { supplierName: ce.supplier.name, pos: [] }), x.get(n).pos.push(ce);
1610
1593
  }
1611
- const ae = _e("div", { class: "flex flex-col gap-12" }, [
1594
+ const oe = xe("div", { class: "flex flex-col gap-12" }, [
1612
1595
  Je,
1613
- _e(
1596
+ xe(
1614
1597
  "p",
1615
1598
  { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
1616
- g("inventory.transfer.receiveRequest.bulk.missingEmailMsg", [ie.length])
1599
+ g("inventory.transfer.receiveRequest.bulk.missingEmailMsg", [re.length])
1617
1600
  ),
1618
- _e(
1601
+ xe(
1619
1602
  "div",
1620
1603
  { class: "flex flex-col gap-4 max-h-[320px] overflow-y-auto rounded-md border border-fm-color-neutral-gray-100 p-8" },
1621
- [...w.values()].map(
1622
- ({ supplierName: me, pos: n }) => _e("div", { class: "flex flex-col gap-2 py-6 border-b border-fm-color-neutral-gray-100 last:border-0" }, [
1623
- _e("div", { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, me),
1624
- _e(
1604
+ [...x.values()].map(
1605
+ ({ supplierName: ce, pos: n }) => xe("div", { class: "flex flex-col gap-2 py-6 border-b border-fm-color-neutral-gray-100 last:border-0" }, [
1606
+ xe("div", { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, ce),
1607
+ xe(
1625
1608
  "div",
1626
1609
  { class: "flex flex-wrap gap-4" },
1627
1610
  n.map(
1628
- (a) => _e("span", {
1611
+ (a) => xe("span", {
1629
1612
  class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 rounded px-6 py-2"
1630
1613
  }, `PO #${a.seqNumber ?? a._id}`)
1631
1614
  )
@@ -1633,52 +1616,52 @@ function Rs(x) {
1633
1616
  ])
1634
1617
  )
1635
1618
  ),
1636
- _e(
1619
+ xe(
1637
1620
  "p",
1638
1621
  { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
1639
- g("inventory.transfer.receiveRequest.bulk.emailWillSendCount", [V.length, b.length])
1622
+ g("inventory.transfer.receiveRequest.bulk.emailWillSendCount", [U.length, b.length])
1640
1623
  ),
1641
- _e(
1624
+ xe(
1642
1625
  "p",
1643
1626
  { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
1644
1627
  g("inventory.transfer.receiveRequest.bulk.missingEmailConfirm")
1645
1628
  )
1646
1629
  ]);
1647
- if (!await new Promise((me) => {
1630
+ if (!await new Promise((ce) => {
1648
1631
  h.open({
1649
1632
  title: g("inventory.transfer.receiveRequest.bulk.missingEmailTitle"),
1650
- contentComponent: ae,
1633
+ contentComponent: oe,
1651
1634
  contentComponentProps: {},
1652
1635
  primaryActions: {
1653
1636
  text: g("inventory.transfer.receiveRequest.bulk.skipAndContinue"),
1654
1637
  close: !0
1655
1638
  },
1656
1639
  secondaryActions: { text: g("inventory.common.cancel"), close: !0 }
1657
- }).onPrimary(() => me(!0)).onSecondary(() => me(!1));
1640
+ }).onPrimary(() => ce(!0)).onSecondary(() => ce(!1));
1658
1641
  })) return;
1659
1642
  } else {
1660
- const w = _e("div", { class: "flex flex-col gap-12" }, [
1643
+ const x = xe("div", { class: "flex flex-col gap-12" }, [
1661
1644
  Je,
1662
- _e(
1645
+ xe(
1663
1646
  "p",
1664
1647
  { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
1665
- g("inventory.transfer.receiveRequest.bulk.emailAllConfirmMsg", [V.length])
1648
+ g("inventory.transfer.receiveRequest.bulk.emailAllConfirmMsg", [U.length])
1666
1649
  )
1667
1650
  ]);
1668
- if (!await new Promise((ce) => {
1651
+ if (!await new Promise((ie) => {
1669
1652
  h.open({
1670
1653
  title: g("inventory.transfer.receiveRequest.bulk.missingEmailTitle"),
1671
- contentComponent: w,
1654
+ contentComponent: x,
1672
1655
  contentComponentProps: {},
1673
1656
  primaryActions: {
1674
1657
  text: g("inventory.transfer.receiveRequest.bulk.emailConfirm"),
1675
1658
  close: !0
1676
1659
  },
1677
1660
  secondaryActions: { text: g("inventory.common.cancel"), close: !0 }
1678
- }).onPrimary(() => ce(!0)).onSecondary(() => ce(!1));
1661
+ }).onPrimary(() => ie(!0)).onSecondary(() => ie(!1));
1679
1662
  })) return;
1680
1663
  }
1681
- if (V.length === 0) {
1664
+ if (U.length === 0) {
1682
1665
  l.open({
1683
1666
  title: g("inventory.transfer.receiveRequest.bulk.emailSendError"),
1684
1667
  message: g("inventory.transfer.receiveRequest.bulk.noEmailsToSend"),
@@ -1688,7 +1671,7 @@ function Rs(x) {
1688
1671
  }
1689
1672
  let Ie = [];
1690
1673
  try {
1691
- Ie = await T.getEmailList(M.currentBusiness.value._id);
1674
+ Ie = await T.getEmailList(z.currentBusiness.value._id);
1692
1675
  } catch {
1693
1676
  l.open({
1694
1677
  title: g("inventory.transfer.receiveRequest.bulk.emailSendError"),
@@ -1697,7 +1680,7 @@ function Rs(x) {
1697
1680
  });
1698
1681
  return;
1699
1682
  }
1700
- const Le = Ie.find((w) => w.verified);
1683
+ const Le = Ie.find((x) => x.verified);
1701
1684
  if (!Le) {
1702
1685
  l.open({
1703
1686
  title: g("inventory.transfer.receiveRequest.bulk.emailSendError"),
@@ -1707,34 +1690,34 @@ function Rs(x) {
1707
1690
  return;
1708
1691
  }
1709
1692
  const Ne = /* @__PURE__ */ new Map();
1710
- for (const w of V) {
1711
- const ae = te(w);
1712
- if (!ae) continue;
1713
- const me = (((je = k.locations.find((Z) => Z.dbName === w._locationDbName)) == null ? void 0 : je.name) || w._locationDbName).replace(/[/\\?%*:|"<>]/g, "-").trim().slice(0, 50), n = `PO_${w.seqNumber || w._id}`.replace(/[/\\?%*:|"<>]/g, "-").slice(0, 50), a = { poId: w._id, dbName: w._locationDbName, filename: `${me}/${n}` }, s = Ne.get(ae);
1714
- s ? (s.pos.push(a), s.seqNumbers.push(w.seqNumber ?? w._id)) : Ne.set(ae, {
1715
- recipientName: w.supplier.name,
1716
- recipientEmail: ae,
1693
+ for (const x of U) {
1694
+ const oe = Z(x);
1695
+ if (!oe) continue;
1696
+ const ce = (((je = w.locations.find((X) => X.dbName === x._locationDbName)) == null ? void 0 : je.name) || x._locationDbName).replace(/[/\\?%*:|"<>]/g, "-").trim().slice(0, 50), n = `PO_${x.seqNumber || x._id}`.replace(/[/\\?%*:|"<>]/g, "-").slice(0, 50), a = { poId: x._id, dbName: x._locationDbName, filename: `${ce}/${n}` }, s = Ne.get(oe);
1697
+ s ? (s.pos.push(a), s.seqNumbers.push(x.seqNumber ?? x._id)) : Ne.set(oe, {
1698
+ recipientName: x.supplier.name,
1699
+ recipientEmail: oe,
1717
1700
  pos: [a],
1718
- seqNumbers: [w.seqNumber ?? w._id]
1701
+ seqNumbers: [x.seqNumber ?? x._id]
1719
1702
  });
1720
1703
  }
1721
- const ke = [...Ne.values()].map((w) => ({
1722
- subject: w.pos.length > 1 ? `Purchase Orders (${w.pos.length})` : `Purchase Order #${w.seqNumbers[0]}`,
1723
- recipientName: w.recipientName,
1724
- recipientEmail: w.recipientEmail,
1725
- pos: w.pos
1704
+ const ke = [...Ne.values()].map((x) => ({
1705
+ subject: x.pos.length > 1 ? `Purchase Orders (${x.pos.length})` : `Purchase Order #${x.seqNumbers[0]}`,
1706
+ recipientName: x.recipientName,
1707
+ recipientEmail: x.recipientEmail,
1708
+ pos: x.pos
1726
1709
  })), ze = f.value[0];
1727
1710
  try {
1728
- const { jobId: w } = await U.enqueueBulkEmail(ze, {
1711
+ const { jobId: x } = await V.enqueueBulkEmail(ze, {
1729
1712
  senderEmail: Le.emailAddress,
1730
- senderName: Le.name || ((We = M.currentBusiness.value) == null ? void 0 : We.name) || "FeedMe Inventory",
1713
+ senderName: Le.name || ((We = z.currentBusiness.value) == null ? void 0 : We.name) || "FeedMe Inventory",
1731
1714
  items: ke
1732
1715
  });
1733
- p.addJob({
1734
- jobId: w,
1716
+ v.addJob({
1717
+ jobId: x,
1735
1718
  type: "email",
1736
1719
  dbName: ze,
1737
- title: `Email All (${ke.length} supplier${ke.length === 1 ? "" : "s"}, ${V.length} POs)`,
1720
+ title: `Email All (${ke.length} supplier${ke.length === 1 ? "" : "s"}, ${U.length} POs)`,
1738
1721
  status: "waiting",
1739
1722
  progress: 0,
1740
1723
  current: 0,
@@ -1746,8 +1729,8 @@ function Rs(x) {
1746
1729
  message: g("inventory.transfer.receiveRequest.bulk.emailQueued"),
1747
1730
  type: "success"
1748
1731
  });
1749
- } catch (w) {
1750
- console.error("Bulk email enqueue failed", w), l.open({
1732
+ } catch (x) {
1733
+ console.error("Bulk email enqueue failed", x), l.open({
1751
1734
  title: g("inventory.transfer.receiveRequest.bulk.emailSendError"),
1752
1735
  message: g("inventory.transfer.receiveRequest.bulk.emailErrorMsg"),
1753
1736
  type: "error"
@@ -1758,60 +1741,60 @@ function Rs(x) {
1758
1741
  selectedLocationDbNames: f,
1759
1742
  purchaseOrders: d,
1760
1743
  shipments: i,
1761
- purchaseRequests: _,
1744
+ purchaseRequests: C,
1762
1745
  rowAction: Se,
1763
- updateDateRange: Xe,
1764
- fetchData: Ae,
1765
- failedLocations: z,
1746
+ updateDateRange: Ge,
1747
+ fetchData: $e,
1748
+ failedLocations: M,
1766
1749
  retryFailedLocations: Fe,
1767
- retryingFailed: G,
1768
- fetchProgress: se,
1769
- abortOngoingBrowse: de,
1750
+ retryingFailed: he,
1751
+ fetchProgress: ue,
1752
+ abortOngoingBrowse: ve,
1770
1753
  fetchFullPurchaseOrders: j,
1771
1754
  loading: c,
1772
- transferDialogProps: tt,
1755
+ transferDialogProps: et,
1773
1756
  promptCreateTransferDialog: Oe,
1774
1757
  promptUpdateTransferDialog: F,
1775
1758
  transferDetailsProps: qe,
1776
- promptShowTransferDetails: X,
1759
+ promptShowTransferDetails: G,
1777
1760
  resolvePO: K,
1778
1761
  submitAction: Re,
1779
1762
  xilnexImportDialogProps: dt,
1780
1763
  promptUploadTransferDialog: we,
1781
- emailDialogProps: be,
1764
+ emailDialogProps: pe,
1782
1765
  promptEmailDialog: B,
1783
1766
  downloadAll: Be,
1784
1767
  emailAll: Te,
1785
- lastClosingDate: q
1768
+ lastClosingDate: N
1786
1769
  };
1787
1770
  }
1788
- function Ps(x, h, k) {
1789
- const A = x._locationDbName;
1790
- if (!A) return null;
1791
- const S = h.find((M) => M.dbName === A);
1771
+ function Fs(_, h, w) {
1772
+ const O = _._locationDbName;
1773
+ if (!O) return null;
1774
+ const S = h.find((z) => z.dbName === O);
1792
1775
  if (!S) return null;
1793
1776
  if (S.type === "restaurant") {
1794
- const M = k(S.doc._id);
1795
- if (M !== null) return { ...S, doc: M };
1777
+ const z = w(S.doc._id);
1778
+ if (z !== null) return { ...S, doc: z };
1796
1779
  }
1797
1780
  return S;
1798
1781
  }
1799
- function Ds(x, h) {
1800
- return h.find((k) => k.purchaseOrderId === x._id);
1782
+ function Ss(_, h) {
1783
+ return h.find((w) => w.purchaseOrderId === _._id);
1801
1784
  }
1802
- function Es(x, h) {
1803
- const k = it(), { t: A } = ot(), S = Ge(), M = ut(), Y = pt(), O = C(!1), c = C(!1), l = C(null);
1804
- async function g(p, f) {
1805
- if (p !== rt.PrintPdf) return !1;
1806
- const i = f._locationDbName, _ = f._rev;
1807
- l.value && (URL.revokeObjectURL(l.value), l.value = null), c.value = !0, O.value = !0;
1785
+ function Rs(_, h) {
1786
+ const w = it(), { t: O } = nt(), S = Ke(), z = ut(), Y = pt(), $ = k(!1), c = k(!1), l = k(null);
1787
+ async function g(v, f) {
1788
+ if (v !== at.PrintPdf) return !1;
1789
+ const i = f._locationDbName, C = f._rev;
1790
+ l.value && (URL.revokeObjectURL(l.value), l.value = null), c.value = !0, $.value = !0;
1808
1791
  try {
1809
- let o = await S.getPurchaseOrderPdf(f._id, i, _);
1810
- "pending" in o && (await Y.waitForPdfJob(o.jobId, i), o = await S.getPurchaseOrderPdf(f._id, i, _)), l.value = URL.createObjectURL(o);
1811
- } catch {
1812
- O.value = !1, M.open({
1813
- title: A("inventory.common.somethingWentWrong"),
1814
- message: A("inventory.transfer.receiveRequest.bulk.pdfUnavailableMsg"),
1792
+ let o = await S.getPurchaseOrderPdf(f._id, i, C);
1793
+ "pending" in o && (await Y.waitForPdfJob(o.jobId, i), o = await S.getPurchaseOrderPdf(f._id, i, C)), l.value = URL.createObjectURL(o);
1794
+ } catch (o) {
1795
+ $.value = !1, z.open({
1796
+ title: O("inventory.common.somethingWentWrong"),
1797
+ message: (o == null ? void 0 : o.message) || O("inventory.common.tryAgain"),
1815
1798
  type: "error"
1816
1799
  });
1817
1800
  } finally {
@@ -1819,104 +1802,104 @@ function Es(x, h) {
1819
1802
  }
1820
1803
  return !0;
1821
1804
  }
1822
- const U = tn(
1823
- Ft.RECEIVE_REQUEST,
1824
- x,
1805
+ const V = Zt(
1806
+ kt.RECEIVE_REQUEST,
1807
+ _,
1825
1808
  h,
1826
1809
  {
1827
1810
  // Bulk rows are summaries (no items) — print needs the full doc from the
1828
1811
  // row's own location db, independent of the global current location.
1829
1812
  // Runs behind the shared cancellable loading state; undefined (failed or
1830
1813
  // cancelled) becomes null, which aborts the print.
1831
- fetchFullPo: async (p) => {
1832
- const f = p._locationDbName;
1833
- return await x.rowAction.run(
1834
- (i) => S.getPurchaseOrderById(p._id, f, i)
1814
+ fetchFullPo: async (v) => {
1815
+ const f = v._locationDbName;
1816
+ return await _.rowAction.run(
1817
+ (i) => S.getPurchaseOrderById(v._id, f, i)
1835
1818
  ) ?? null;
1836
1819
  },
1837
- resolveLocation: (p) => Ps(
1838
- p,
1839
- k.locations,
1840
- k.locationRestaurantFromCore
1820
+ resolveLocation: (v) => Fs(
1821
+ v,
1822
+ w.locations,
1823
+ w.locationRestaurantFromCore
1841
1824
  ),
1842
- resolvePurchaseRequest: (p) => Ds(p, x.purchaseRequests.value),
1825
+ resolvePurchaseRequest: (v) => Ss(v, _.purchaseRequests.value),
1843
1826
  // Exclude both legacy Print and Print (Beta) — the bulk listing uses
1844
1827
  // Lambda-generated PDF via PrintPdf instead.
1845
- excludeRowActions: [rt.Print, rt.PrintCustom],
1828
+ excludeRowActions: [at.Print, at.PrintCustom],
1846
1829
  // Inject the Lambda PDF print action into every row's context menu.
1847
- appendRowActions: () => [Nn[rt.PrintPdf]],
1830
+ appendRowActions: () => [Dn[at.PrintPdf]],
1848
1831
  // Handle the PrintPdf action before the default handler runs.
1849
- onCustomAction: (p, f) => g(p, f)
1832
+ onCustomAction: (v, f) => g(v, f)
1850
1833
  }
1851
1834
  );
1852
1835
  return {
1853
1836
  columnDefs: L(() => {
1854
- const p = U.columnDefs.value, f = {
1837
+ const v = V.columnDefs.value, f = {
1855
1838
  id: "location",
1856
- header: () => A("inventory.transfer.receiveRequest.bulk.locationColumn"),
1839
+ header: () => O("inventory.transfer.receiveRequest.bulk.locationColumn"),
1857
1840
  cell(i) {
1858
- const _ = i.row.original._locationDbName, o = k.locations.find((H) => H.dbName === _);
1859
- return o ? `${o.name} (${o.doc.profile.code ?? "--"})` : _;
1841
+ const C = i.row.original._locationDbName, o = w.locations.find((H) => H.dbName === C);
1842
+ return o ? `${o.name} (${o.doc.profile.code ?? "--"})` : C;
1860
1843
  },
1861
1844
  enableSorting: !1,
1862
1845
  size: 160
1863
- }, d = [...p];
1846
+ }, d = [...v];
1864
1847
  return d.splice(1, 0, f), d;
1865
1848
  }),
1866
- showPdfDialog: O,
1849
+ showPdfDialog: $,
1867
1850
  pdfPreviewLoading: c,
1868
1851
  pdfPreviewBlobUrl: l
1869
1852
  };
1870
1853
  }
1871
- const qs = {
1854
+ const Ps = {
1872
1855
  key: 0,
1873
1856
  class: "inline-flex items-center justify-center bg-white/25 text-white rounded-full min-w-[18px] h-[18px] px-[4px] text-[10px] font-semibold leading-none"
1874
- }, Ns = {
1857
+ }, Ds = {
1875
1858
  key: 1,
1876
1859
  class: "bg-white rounded-lg shadow-xl border border-fm-color-neutral-gray-100 w-[360px] max-h-[480px] flex flex-col overflow-hidden"
1877
- }, $s = { class: "flex items-center justify-between px-16 py-12 border-b border-fm-color-neutral-gray-100" }, As = { class: "fm-typo-en-title-sm-600" }, Os = { class: "overflow-y-auto flex-1 divide-y divide-fm-color-neutral-gray-100" }, Bs = { class: "flex items-start justify-between gap-8" }, Ts = { class: "flex flex-col gap-2" }, Is = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-primary line-clamp-1" }, Ls = { class: "fm-typo-en-body-xs-400 text-fm-color-typo-secondary capitalize" }, zs = { class: "flex items-center gap-4" }, Ms = ["disabled", "onClick"], Us = ["disabled", "onClick"], Vs = ["onClick"], Js = {
1860
+ }, Es = { class: "flex items-center justify-between px-16 py-12 border-b border-fm-color-neutral-gray-100" }, qs = { class: "fm-typo-en-title-sm-600" }, Ns = { class: "overflow-y-auto flex-1 divide-y divide-fm-color-neutral-gray-100" }, As = { class: "flex items-start justify-between gap-8" }, $s = { class: "flex flex-col gap-2" }, Os = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-primary line-clamp-1" }, Bs = { class: "fm-typo-en-body-xs-400 text-fm-color-typo-secondary capitalize" }, Ts = { class: "flex items-center gap-4" }, Is = ["disabled", "onClick"], Ls = ["disabled", "onClick"], zs = ["onClick"], Ms = {
1878
1861
  key: 0,
1879
1862
  class: "flex flex-col gap-4"
1880
- }, js = { class: "w-full bg-fm-color-neutral-gray-200 rounded-full h-[3px]" }, Ws = { class: "flex justify-between fm-typo-en-body-xs-400 text-fm-color-typo-secondary" }, Ys = {
1863
+ }, Us = { class: "w-full bg-fm-color-neutral-gray-200 rounded-full h-[3px]" }, Vs = { class: "flex justify-between fm-typo-en-body-xs-400 text-fm-color-typo-secondary" }, Js = {
1881
1864
  key: 0,
1882
1865
  class: "truncate max-w-[200px]"
1883
- }, Hs = { class: "ml-auto" }, Qs = {
1866
+ }, js = { class: "ml-auto" }, Ws = {
1884
1867
  key: 1,
1885
1868
  class: "flex items-center gap-4 fm-typo-en-body-xs-400 text-fm-color-typo-success"
1886
- }, Ks = {
1869
+ }, Ys = {
1887
1870
  key: 2,
1888
1871
  class: "flex items-center gap-4 fm-typo-en-body-xs-400 text-fm-color-typo-warning"
1889
- }, Gs = {
1872
+ }, Hs = {
1890
1873
  key: 3,
1891
1874
  class: "flex items-center gap-4 fm-typo-en-body-xs-400 text-fm-color-typo-secondary"
1892
- }, Xs = {
1875
+ }, Qs = {
1893
1876
  key: 4,
1894
1877
  class: "flex items-center gap-4 fm-typo-en-body-xs-400 text-fm-color-typo-error"
1895
- }, Zs = { key: 0 }, ea = { key: 1 }, ta = {
1878
+ }, Ks = { key: 0 }, Gs = { key: 1 }, Xs = {
1896
1879
  key: 5,
1897
1880
  class: "flex items-center gap-[5px] text-[11px] leading-none text-fm-color-typo-secondary"
1898
- }, na = /* @__PURE__ */ nt({
1881
+ }, Zs = /* @__PURE__ */ tt({
1899
1882
  __name: "BulkJobProgressPanel",
1900
- setup(x) {
1901
- const { t: h } = $n(), k = pt(), A = Ge(), S = C(!1), M = C(null);
1883
+ setup(_) {
1884
+ const { t: h } = En(), w = pt(), O = Ke(), S = k(!1), z = k(null);
1902
1885
  function Y(d) {
1903
- S.value && M.value && !M.value.contains(d.target) && (S.value = !1);
1886
+ S.value && z.value && !z.value.contains(d.target) && (S.value = !1);
1904
1887
  }
1905
- Ot(() => {
1888
+ At(() => {
1906
1889
  document.addEventListener("click", Y, !0);
1907
- }), Bt(() => {
1890
+ }), $t(() => {
1908
1891
  document.removeEventListener("click", Y, !0);
1909
1892
  });
1910
- const O = C(/* @__PURE__ */ new Set()), c = C(/* @__PURE__ */ new Set());
1893
+ const $ = k(/* @__PURE__ */ new Set()), c = k(/* @__PURE__ */ new Set());
1911
1894
  async function l(d) {
1912
- if (!O.value.has(d.jobId)) {
1913
- O.value = /* @__PURE__ */ new Set([...O.value, d.jobId]);
1895
+ if (!$.value.has(d.jobId)) {
1896
+ $.value = /* @__PURE__ */ new Set([...$.value, d.jobId]);
1914
1897
  try {
1915
- const i = await A.downloadBulkJob(d.dbName, d.jobId), _ = URL.createObjectURL(i), o = document.createElement("a");
1916
- o.href = _, o.download = "purchase-orders.zip", document.body.appendChild(o), o.click(), document.body.removeChild(o), setTimeout(() => URL.revokeObjectURL(_), 1e3);
1898
+ const i = await O.downloadBulkJob(d.dbName, d.jobId), C = URL.createObjectURL(i), o = document.createElement("a");
1899
+ o.href = C, o.download = "purchase-orders.zip", document.body.appendChild(o), o.click(), document.body.removeChild(o), setTimeout(() => URL.revokeObjectURL(C), 1e3);
1917
1900
  } finally {
1918
- const i = new Set(O.value);
1919
- i.delete(d.jobId), O.value = i;
1901
+ const i = new Set($.value);
1902
+ i.delete(d.jobId), $.value = i;
1920
1903
  }
1921
1904
  }
1922
1905
  }
@@ -1924,33 +1907,33 @@ const qs = {
1924
1907
  if (!c.value.has(d.jobId)) {
1925
1908
  c.value = /* @__PURE__ */ new Set([...c.value, d.jobId]);
1926
1909
  try {
1927
- await k.cancelJob(d.jobId);
1910
+ await w.cancelJob(d.jobId);
1928
1911
  } finally {
1929
1912
  const i = new Set(c.value);
1930
1913
  i.delete(d.jobId), c.value = i;
1931
1914
  }
1932
1915
  }
1933
1916
  }
1934
- function U(d) {
1935
- k.removeJob(d);
1917
+ function V(d) {
1918
+ w.removeJob(d);
1936
1919
  }
1937
- function fe(d) {
1920
+ function de(d) {
1938
1921
  return d === "completed" || d === "failed" || d === "cancelled";
1939
1922
  }
1940
- function p(d) {
1941
- const i = Math.round(d / 1e3), _ = Math.floor(i / 60), o = i % 60;
1942
- return _ > 0 ? `${_}m ${o}s` : `${o}s`;
1923
+ function v(d) {
1924
+ const i = Math.round(d / 1e3), C = Math.floor(i / 60), o = i % 60;
1925
+ return C > 0 ? `${C}m ${o}s` : `${o}s`;
1943
1926
  }
1944
1927
  function f(d) {
1945
1928
  return d < 1024 ? `${d} B` : d < 1024 * 1024 ? `${(d / 1024).toFixed(1)} KB` : `${(d / (1024 * 1024)).toFixed(1)} MB`;
1946
1929
  }
1947
1930
  return (d, i) => {
1948
- const _ = Ce("FmIcon");
1949
- return m(), ue(lt, { to: "body" }, [
1950
- t(k).jobs.length > 0 ? (m(), y("div", {
1931
+ const C = Ce("FmIcon");
1932
+ return m(), le(lt, { to: "body" }, [
1933
+ t(w).jobs.length > 0 ? (m(), y("div", {
1951
1934
  key: 0,
1952
1935
  ref_key: "panelRef",
1953
- ref: M,
1936
+ ref: z,
1954
1937
  class: "fixed bottom-24 right-24 z-[9998] flex flex-col items-end gap-8"
1955
1938
  }, [
1956
1939
  S.value ? D("", !0) : (m(), y("button", {
@@ -1958,53 +1941,53 @@ const qs = {
1958
1941
  class: "flex items-center gap-8 bg-fm-color-primary text-white rounded-full px-16 py-[6px] shadow-lg fm-typo-en-body-sm-600 cursor-pointer",
1959
1942
  onClick: i[0] || (i[0] = (o) => S.value = !0)
1960
1943
  }, [
1961
- E(_, {
1944
+ E(C, {
1962
1945
  name: "cloud_upload",
1963
1946
  size: "sm"
1964
1947
  }),
1965
- e("span", null, v(t(h)("inventory.transfer.receiveRequest.bulk.backgroundJobsTitle")), 1),
1966
- t(k).activeJobs.length > 0 ? (m(), y("span", qs, v(t(k).activeJobs.length), 1)) : D("", !0)
1948
+ e("span", null, p(t(h)("inventory.transfer.receiveRequest.bulk.backgroundJobsTitle")), 1),
1949
+ t(w).activeJobs.length > 0 ? (m(), y("span", Ps, p(t(w).activeJobs.length), 1)) : D("", !0)
1967
1950
  ])),
1968
- S.value ? (m(), y("div", Ns, [
1969
- e("div", $s, [
1970
- e("span", As, v(t(h)("inventory.transfer.receiveRequest.bulk.backgroundJobsTitle")), 1),
1951
+ S.value ? (m(), y("div", Ds, [
1952
+ e("div", Es, [
1953
+ e("span", qs, p(t(h)("inventory.transfer.receiveRequest.bulk.backgroundJobsTitle")), 1),
1971
1954
  e("button", {
1972
1955
  "aria-label": "Collapse",
1973
1956
  onClick: i[1] || (i[1] = (o) => S.value = !1),
1974
1957
  class: "text-fm-color-typo-secondary hover:text-fm-color-typo-primary"
1975
1958
  }, [
1976
- E(_, {
1959
+ E(C, {
1977
1960
  name: "close",
1978
1961
  size: "sm"
1979
1962
  })
1980
1963
  ])
1981
1964
  ]),
1982
- e("div", Os, [
1983
- (m(!0), y(he, null, Ke(t(k).jobs, (o) => {
1965
+ e("div", Ns, [
1966
+ (m(!0), y(ye, null, Qe(t(w).jobs, (o) => {
1984
1967
  var H;
1985
1968
  return m(), y("div", {
1986
1969
  key: o.jobId,
1987
1970
  class: "px-16 py-12 flex flex-col gap-8"
1988
1971
  }, [
1989
- e("div", Bs, [
1990
- e("div", Ts, [
1991
- e("span", Is, v(o.title), 1),
1992
- e("span", Ls, v(o.status), 1)
1972
+ e("div", As, [
1973
+ e("div", $s, [
1974
+ e("span", Os, p(o.title), 1),
1975
+ e("span", Bs, p(o.status), 1)
1993
1976
  ]),
1994
- e("div", zs, [
1977
+ e("div", Ts, [
1995
1978
  o.downloadReady ? (m(), y("button", {
1996
1979
  key: 0,
1997
1980
  class: "text-fm-color-primary hover:opacity-80 disabled:opacity-40",
1998
- disabled: O.value.has(o.jobId),
1981
+ disabled: $.value.has(o.jobId),
1999
1982
  title: "Download",
2000
1983
  "aria-label": "Download",
2001
1984
  onClick: (R) => l(o)
2002
1985
  }, [
2003
- E(_, {
2004
- name: O.value.has(o.jobId) ? "progress_activity" : "download",
1986
+ E(C, {
1987
+ name: $.value.has(o.jobId) ? "progress_activity" : "download",
2005
1988
  size: "sm"
2006
1989
  }, null, 8, ["name"])
2007
- ], 8, Ms)) : D("", !0),
1990
+ ], 8, Is)) : D("", !0),
2008
1991
  o.status === "waiting" || o.status === "active" ? (m(), y("button", {
2009
1992
  key: 1,
2010
1993
  class: "text-fm-color-semantic-error-500 hover:opacity-80 disabled:opacity-40",
@@ -2013,70 +1996,70 @@ const qs = {
2013
1996
  "aria-label": "Cancel",
2014
1997
  onClick: (R) => g(o)
2015
1998
  }, [
2016
- E(_, {
1999
+ E(C, {
2017
2000
  name: c.value.has(o.jobId) ? "progress_activity" : "cancel",
2018
2001
  size: "sm"
2019
2002
  }, null, 8, ["name"])
2020
- ], 8, Us)) : D("", !0),
2021
- fe(o.status) ? (m(), y("button", {
2003
+ ], 8, Ls)) : D("", !0),
2004
+ de(o.status) ? (m(), y("button", {
2022
2005
  key: 2,
2023
2006
  class: "text-fm-color-typo-secondary hover:text-fm-color-typo-primary",
2024
2007
  title: "Dismiss",
2025
2008
  "aria-label": "Dismiss",
2026
- onClick: (R) => U(o.jobId)
2009
+ onClick: (R) => V(o.jobId)
2027
2010
  }, [
2028
- E(_, {
2011
+ E(C, {
2029
2012
  name: "close",
2030
2013
  size: "sm"
2031
2014
  })
2032
- ], 8, Vs)) : D("", !0)
2015
+ ], 8, zs)) : D("", !0)
2033
2016
  ])
2034
2017
  ]),
2035
- o.status === "active" || o.status === "waiting" ? (m(), y("div", Js, [
2036
- e("div", js, [
2018
+ o.status === "active" || o.status === "waiting" ? (m(), y("div", Ms, [
2019
+ e("div", Us, [
2037
2020
  e("div", {
2038
2021
  class: "bg-fm-color-primary h-[3px] rounded-full transition-all duration-300",
2039
2022
  style: mt({ width: `${o.progress}%` })
2040
2023
  }, null, 4)
2041
2024
  ]),
2042
- e("div", Ws, [
2043
- o.currentItem ? (m(), y("span", Ys, v(o.currentItem), 1)) : D("", !0),
2044
- e("span", Hs, v(o.current) + " / " + v(o.total), 1)
2025
+ e("div", Vs, [
2026
+ o.currentItem ? (m(), y("span", Js, p(o.currentItem), 1)) : D("", !0),
2027
+ e("span", js, p(o.current) + " / " + p(o.total), 1)
2045
2028
  ])
2046
2029
  ])) : D("", !0),
2047
- o.status === "completed" && o.errorCount === 0 ? (m(), y("div", Qs, [
2048
- E(_, {
2030
+ o.status === "completed" && o.errorCount === 0 ? (m(), y("div", Ws, [
2031
+ E(C, {
2049
2032
  name: "check_circle",
2050
2033
  size: "sm"
2051
2034
  }),
2052
- e("span", null, v(t(h)("inventory.transfer.receiveRequest.bulk.jobDone")), 1)
2035
+ e("span", null, p(t(h)("inventory.transfer.receiveRequest.bulk.jobDone")), 1)
2053
2036
  ])) : D("", !0),
2054
- o.status === "completed" && (((H = o.stalePoIds) == null ? void 0 : H.length) ?? 0) > 0 ? (m(), y("div", Ks, [
2055
- E(_, {
2037
+ o.status === "completed" && (((H = o.stalePoIds) == null ? void 0 : H.length) ?? 0) > 0 ? (m(), y("div", Ys, [
2038
+ E(C, {
2056
2039
  name: "warning",
2057
2040
  size: "sm"
2058
2041
  }),
2059
- e("span", null, v(t(h)("inventory.transfer.receiveRequest.bulk.jobStalePos", [o.stalePoIds.length])), 1)
2042
+ e("span", null, p(t(h)("inventory.transfer.receiveRequest.bulk.jobStalePos", [o.stalePoIds.length])), 1)
2060
2043
  ])) : D("", !0),
2061
- o.status === "cancelled" ? (m(), y("div", Gs, [
2062
- E(_, {
2044
+ o.status === "cancelled" ? (m(), y("div", Hs, [
2045
+ E(C, {
2063
2046
  name: "do_not_disturb_on",
2064
2047
  size: "sm"
2065
2048
  }),
2066
- e("span", null, v(t(h)("inventory.transfer.receiveRequest.bulk.jobCancelled")), 1)
2049
+ e("span", null, p(t(h)("inventory.transfer.receiveRequest.bulk.jobCancelled")), 1)
2067
2050
  ])) : D("", !0),
2068
- o.status === "failed" ? (m(), y("div", Xs, [
2069
- E(_, {
2051
+ o.status === "failed" ? (m(), y("div", Qs, [
2052
+ E(C, {
2070
2053
  name: "cancel",
2071
2054
  size: "sm"
2072
2055
  }),
2073
- o.errorCount > 0 ? (m(), y("span", Zs, v(t(h)("inventory.transfer.receiveRequest.bulk.jobDoneWithErrors", [o.errorCount])), 1)) : (m(), y("span", ea, v(t(h)("inventory.transfer.receiveRequest.bulk.jobFailed")), 1))
2056
+ o.errorCount > 0 ? (m(), y("span", Ks, p(t(h)("inventory.transfer.receiveRequest.bulk.jobDoneWithErrors", [o.errorCount])), 1)) : (m(), y("span", Gs, p(t(h)("inventory.transfer.receiveRequest.bulk.jobFailed")), 1))
2074
2057
  ])) : D("", !0),
2075
- fe(o.status) && o.completedAt ? (m(), y("div", ta, [
2076
- e("span", null, v(t(h)("inventory.transfer.receiveRequest.bulk.jobCompletedIn", [p(o.completedAt - o.startedAt)])), 1),
2077
- o.zipSizeBytes ? (m(), y(he, { key: 0 }, [
2058
+ de(o.status) && o.completedAt ? (m(), y("div", Xs, [
2059
+ e("span", null, p(t(h)("inventory.transfer.receiveRequest.bulk.jobCompletedIn", [v(o.completedAt - o.startedAt)])), 1),
2060
+ o.zipSizeBytes ? (m(), y(ye, { key: 0 }, [
2078
2061
  i[2] || (i[2] = e("span", null, "·", -1)),
2079
- e("span", null, v(f(o.zipSizeBytes)), 1)
2062
+ e("span", null, p(f(o.zipSizeBytes)), 1)
2080
2063
  ], 64)) : D("", !0)
2081
2064
  ])) : D("", !0)
2082
2065
  ]);
@@ -2087,45 +2070,45 @@ const qs = {
2087
2070
  ]);
2088
2071
  };
2089
2072
  }
2090
- }), oa = {
2073
+ }), ea = {
2091
2074
  key: 0,
2092
2075
  class: "flex flex-col items-center justify-center py-48 gap-8 text-fm-color-typo-secondary"
2093
- }, sa = { class: "flex-1 w-full flex items-center gap-4 xs:flex-col-reverse sm:flex-col-reverse" }, aa = { class: "flex-1 xs:w-full sm:w-full" }, ra = {
2076
+ }, ta = { class: "flex-1 w-full flex items-center gap-4 xs:flex-col-reverse sm:flex-col-reverse" }, na = { class: "flex-1 xs:w-full sm:w-full" }, oa = {
2094
2077
  key: 0,
2095
2078
  class: "flex-1"
2096
- }, la = { class: "w-full max-w-[343px] xs:max-w-[unset] sm:max-w-[unset]" }, ia = {
2079
+ }, sa = { class: "w-full max-w-[343px] xs:max-w-[unset] sm:max-w-[unset]" }, aa = {
2097
2080
  key: 0,
2098
2081
  class: "flex flex-col items-center justify-center py-48 gap-8 text-fm-color-typo-secondary"
2099
- }, ua = { class: "fm-typo-en-body-md-400" }, ca = {
2082
+ }, ra = { class: "fm-typo-en-body-md-400" }, la = {
2100
2083
  key: 1,
2101
2084
  class: "relative"
2102
- }, da = {
2085
+ }, ia = {
2103
2086
  key: 0,
2104
2087
  class: "flex items-center gap-12 mb-8"
2105
- }, ma = { class: "flex-1 h-4 rounded-full bg-fm-color-neutral-gray-200 overflow-hidden" }, fa = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary whitespace-nowrap" }, pa = {
2088
+ }, ua = { class: "flex-1 h-4 rounded-full bg-fm-color-neutral-gray-200 overflow-hidden" }, ca = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary whitespace-nowrap" }, da = {
2106
2089
  key: 1,
2107
2090
  class: "flex items-center justify-between gap-12 rounded-md border border-red-200 bg-red-50 px-16 py-8 mb-8"
2108
- }, va = { class: "fm-typo-en-body-md-400 text-red-800" }, ya = { class: "flex flex-col py-8" }, ba = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ha = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ga = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, _a = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, xa = {
2091
+ }, ma = { class: "fm-typo-en-body-md-400 text-red-800" }, fa = { class: "flex flex-col py-8" }, pa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, va = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ya = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, ba = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, ha = {
2109
2092
  key: 0,
2110
2093
  class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1"
2111
- }, wa = { class: "pt-8" }, ka = {
2094
+ }, ga = { class: "pt-8" }, xa = {
2112
2095
  key: 2,
2113
2096
  class: "absolute inset-0 z-10 flex items-center justify-center bg-fm-color-opacity-sm"
2114
- }, Ca = { class: "flex items-center gap-12 rounded-md bg-white px-16 py-8 shadow-lg" }, Fa = { class: "fm-typo-en-body-md-400" }, Ct = "BulkReceiveRequestViewSearchCriteria", or = /* @__PURE__ */ nt({
2097
+ }, _a = { class: "flex items-center gap-12 rounded-md bg-white px-16 py-8 shadow-lg" }, wa = { class: "fm-typo-en-body-md-400" }, wt = "BulkReceiveRequestViewSearchCriteria", Za = /* @__PURE__ */ tt({
2115
2098
  __name: "BulkReceiveRequestView",
2116
- setup(x) {
2117
- const { t: h } = ot(), k = ut();
2118
- at.object({
2119
- name: at.string().optional().nullable(),
2120
- startDate: at.string().optional().nullable(),
2121
- endDate: at.string().optional().nullable()
2099
+ setup(_) {
2100
+ const { t: h } = nt(), w = ut();
2101
+ st.object({
2102
+ name: st.string().optional().nullable(),
2103
+ startDate: st.string().optional().nullable(),
2104
+ endDate: st.string().optional().nullable()
2122
2105
  });
2123
- const A = rn(), S = Dt(), M = Lt();
2106
+ const O = sn(), S = Rt(), z = Tt();
2124
2107
  function Y() {
2125
2108
  const P = {
2126
2109
  name: "",
2127
2110
  ...ft()
2128
- }, F = A.getItem(Ct);
2111
+ }, F = O.getItem(wt);
2129
2112
  if (!F) return P;
2130
2113
  try {
2131
2114
  return JSON.parse(F);
@@ -2133,20 +2116,20 @@ const qs = {
2133
2116
  return P;
2134
2117
  }
2135
2118
  }
2136
- function O() {
2137
- A.setItem(Ct, JSON.stringify(c.value));
2119
+ function $() {
2120
+ O.setItem(wt, JSON.stringify(c.value));
2138
2121
  }
2139
- const c = C(Y()), l = Rs(c.value), g = C(!1), { selectedLocationDbNames: U } = l, fe = L(() => R.value.filter((P) => U.value.includes(P.dbName)).map((P) => P.doc._id)), {
2140
- columnDefs: p,
2122
+ const c = k(Y()), l = Cs(c.value), g = k(!1), { selectedLocationDbNames: V } = l, de = L(() => R.value.filter((P) => V.value.includes(P.dbName)).map((P) => P.doc._id)), {
2123
+ columnDefs: v,
2141
2124
  showPdfDialog: f,
2142
2125
  pdfPreviewLoading: d,
2143
2126
  pdfPreviewBlobUrl: i
2144
- } = Es(l, l.shipments), _ = it(), o = Wt(), H = St(), R = C([]);
2145
- Tt(() => {
2146
- const P = _.locations;
2127
+ } = Rs(l, l.shipments), C = it(), o = Jt(), H = Ct(), R = k([]);
2128
+ Ot(() => {
2129
+ const P = C.locations;
2147
2130
  P.length > 0 && (R.value = P);
2148
2131
  });
2149
- async function q() {
2132
+ async function N() {
2150
2133
  var F;
2151
2134
  if ((F = H.currentBusiness.value) != null && F._id)
2152
2135
  try {
@@ -2158,25 +2141,25 @@ const qs = {
2158
2141
  Ve(
2159
2142
  [() => H.sessionUser.value, () => H.currentBusiness.value],
2160
2143
  ([P, F]) => {
2161
- P && F && q();
2144
+ P && F && N();
2162
2145
  },
2163
2146
  { immediate: !0 }
2164
2147
  );
2165
- const z = L(() => l.loading.value), pe = L(
2148
+ const M = L(() => l.loading.value), be = L(
2166
2149
  () => l.failedLocations.value.map((P) => {
2167
2150
  var F;
2168
- return ((F = _.locations.find((B) => B.dbName === P.dbName)) == null ? void 0 : F.name) ?? P.dbName;
2151
+ return ((F = C.locations.find((B) => B.dbName === P.dbName)) == null ? void 0 : F.name) ?? P.dbName;
2169
2152
  }).join(", ")
2170
- ), G = L(
2153
+ ), he = L(
2171
2154
  () => l.failedLocations.value.some((P) => P.retryable)
2172
2155
  );
2173
- async function se() {
2156
+ async function ue() {
2174
2157
  const P = `inventory-record_${He(c.value.startDate).format("DD-MM-YYYY_HH-mm")}-${He(c.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`;
2175
2158
  let F = [];
2176
2159
  try {
2177
2160
  F = await l.fetchFullPurchaseOrders();
2178
2161
  } catch {
2179
- k.open({
2162
+ w.open({
2180
2163
  title: h("inventory.transfer.receiveRequest.export.error"),
2181
2164
  message: h("inventory.transfer.receiveRequest.export.fetchError"),
2182
2165
  type: "error"
@@ -2184,24 +2167,24 @@ const qs = {
2184
2167
  return;
2185
2168
  }
2186
2169
  const B = F.flatMap(
2187
- (X) => X.items.map((ne) => {
2170
+ (G) => G.items.map((ee) => {
2188
2171
  var r, u;
2189
- const Re = new Date(sn(X._id) ?? ""), we = X.effectiveAt ? new Date(X.effectiveAt) : void 0, j = _t(
2190
- on(ne.sku, X.deliveryOrder || [])
2191
- ), le = _t(ne.quantity), Be = ((r = ne == null ? void 0 : ne.measurement) == null ? void 0 : r.abbrev) || ne.sku.unit.abbrev;
2172
+ const Re = new Date(nn(G._id) ?? ""), we = G.effectiveAt ? new Date(G.effectiveAt) : void 0, j = xt(
2173
+ tn(ee.sku, G.deliveryOrder || [])
2174
+ ), ae = xt(ee.quantity), Be = ((r = ee == null ? void 0 : ee.measurement) == null ? void 0 : r.abbrev) || ee.sku.unit.abbrev;
2192
2175
  return {
2193
- Location: ((u = _.locations.find((b) => b.dbName === X._locationDbName)) == null ? void 0 : u.name) ?? "",
2194
- "SKU code": ne.code,
2195
- "SKU name": ne.name,
2196
- "PO #": X.seqNumber,
2176
+ Location: ((u = C.locations.find((b) => b.dbName === G._locationDbName)) == null ? void 0 : u.name) ?? "",
2177
+ "SKU code": ee.code,
2178
+ "SKU name": ee.name,
2179
+ "PO #": G.seqNumber,
2197
2180
  "Effective at": we,
2198
2181
  Date: Re,
2199
- Status: X.status,
2200
- Reference: X.ref ?? "",
2182
+ Status: G.status,
2183
+ Reference: G.ref ?? "",
2201
2184
  "Received quantity": j,
2202
- "Ordered quantity": le,
2185
+ "Ordered quantity": ae,
2203
2186
  Unit: Be,
2204
- "Total cost": ne.totalCost ? Ht(ne.totalCost) : null
2187
+ "Total cost": ee.totalCost ? Wt(ee.totalCost) : null
2205
2188
  };
2206
2189
  })
2207
2190
  ), K = [
@@ -2216,45 +2199,45 @@ const qs = {
2216
2199
  "Ordered quantity",
2217
2200
  "Unit"
2218
2201
  ];
2219
- S.enableBackdatePo && K.insert("Effective at", 5), S.enableTotalCost && K.push("Total cost"), await an([{ name: "purchases", data: B, columns: K }], P), k.open({
2202
+ S.enableBackdatePo && K.insert("Effective at", 5), S.enableTotalCost && K.push("Total cost"), await on([{ name: "purchases", data: B, columns: K }], P), w.open({
2220
2203
  title: h("inventory.transfer.receiveRequest.export.success"),
2221
2204
  message: h("inventory.transfer.receiveRequest.export.message", [P]),
2222
2205
  type: "success"
2223
2206
  });
2224
2207
  }
2225
- const ee = C(ft()), de = C("");
2226
- Ve([() => ee.value], ([P]) => {
2208
+ const ne = k(ft()), ve = k("");
2209
+ Ve([() => ne.value], ([P]) => {
2227
2210
  if (!P.startDate || !P.endDate) return;
2228
2211
  if (He(P.endDate).diff(He(P.startDate), "day") > 60) {
2229
- k.open({
2212
+ w.open({
2230
2213
  title: h("inventory.transfer.receiveRequest.bulk.dateRangeLimitTitle"),
2231
2214
  message: h("inventory.transfer.receiveRequest.bulk.dateRangeLimitMsg"),
2232
2215
  type: "warning"
2233
- }), ee.value = {
2216
+ }), ne.value = {
2234
2217
  startDate: P.startDate,
2235
2218
  endDate: He(P.startDate).add(60, "day").format("YYYY-MM-DD")
2236
2219
  };
2237
2220
  return;
2238
2221
  }
2239
- c.value.startDate = P.startDate, c.value.endDate = P.endDate, l.updateDateRange(c.value.startDate, c.value.endDate), O();
2240
- }), Ve([() => de.value], () => {
2241
- O();
2222
+ c.value.startDate = P.startDate, c.value.endDate = P.endDate, l.updateDateRange(c.value.startDate, c.value.endDate), $();
2223
+ }), Ve([() => ve.value], () => {
2224
+ $();
2242
2225
  });
2243
- const De = zt.debounce(() => l.fetchData(), 1500);
2226
+ const De = It.debounce(() => l.fetchData(), 1500);
2244
2227
  Ve(
2245
- () => U.value,
2228
+ () => V.value,
2246
2229
  () => {
2247
2230
  l.abortOngoingBrowse(), De();
2248
2231
  }
2249
2232
  );
2250
- function xe(P) {
2233
+ function _e(P) {
2251
2234
  if (P === "create") {
2252
- if (z.value) {
2253
- k.open({ title: "Loading data...", message: "Please wait.", type: "info" });
2235
+ if (M.value) {
2236
+ w.open({ title: "Loading data...", message: "Please wait.", type: "info" });
2254
2237
  return;
2255
2238
  }
2256
- if (U.value.length === 0) {
2257
- k.open({
2239
+ if (V.value.length === 0) {
2240
+ w.open({
2258
2241
  title: "No outlets selected",
2259
2242
  message: "Please select at least one outlet to create a transfer.",
2260
2243
  type: "warning"
@@ -2267,13 +2250,13 @@ const qs = {
2267
2250
  if (P === "upload" && S.enableXilnexTransferNote)
2268
2251
  return l.promptUploadTransferDialog();
2269
2252
  if (P === "refresh") return l.fetchData();
2270
- if (P === "export") return se();
2271
- if (P === "downloadAll") return $e();
2253
+ if (P === "export") return ue();
2254
+ if (P === "downloadAll") return Ae();
2272
2255
  if (P === "emailAll") return Ee();
2273
2256
  }
2274
- async function $e() {
2275
- if (U.value.length === 0) {
2276
- k.open({
2257
+ async function Ae() {
2258
+ if (V.value.length === 0) {
2259
+ w.open({
2277
2260
  title: h("inventory.transfer.receiveRequest.bulk.noLocationsSelected"),
2278
2261
  message: "",
2279
2262
  type: "warning"
@@ -2284,8 +2267,8 @@ const qs = {
2284
2267
  }
2285
2268
  async function Ee() {
2286
2269
  if (S.enablePurchaseOrderEmail) {
2287
- if (U.value.length === 0) {
2288
- k.open({
2270
+ if (V.value.length === 0) {
2271
+ w.open({
2289
2272
  title: h("inventory.transfer.receiveRequest.bulk.noLocationsSelected"),
2290
2273
  message: "",
2291
2274
  type: "warning"
@@ -2295,7 +2278,7 @@ const qs = {
2295
2278
  await l.emailAll(Se.value);
2296
2279
  }
2297
2280
  }
2298
- const { breakpoints: ve } = mn(), ge = L(() => ve.value.xs || ve.value.sm), Ae = L(() => ge.value ? 10 : 20), Fe = ln(), Xe = L(() => S.enableReceiveRequestBeta ? [
2281
+ const { breakpoints: me } = cn(), ge = L(() => me.value.xs || me.value.sm), $e = L(() => ge.value ? 10 : 20), Fe = an(), Ge = L(() => S.enableReceiveRequestBeta ? [
2299
2282
  {
2300
2283
  label: h("inventory.transfer.receiveRequest.actions.create"),
2301
2284
  value: "create",
@@ -2305,14 +2288,14 @@ const qs = {
2305
2288
  ...S.enableXilnexTransferNote ? [{ label: h("inventory.common.upload"), value: "upload" }] : [],
2306
2289
  { label: h("inventory.common.refresh"), value: "refresh" },
2307
2290
  { label: h("inventory.common.export"), value: "export" },
2308
- ...S.enablePrintTemplate && !z.value ? [
2291
+ ...S.enablePrintTemplate && !M.value ? [
2309
2292
  {
2310
2293
  label: h("inventory.transfer.receiveRequest.bulk.downloadAll"),
2311
2294
  value: "downloadAll",
2312
2295
  prependIcon: "download"
2313
2296
  }
2314
2297
  ] : [],
2315
- ...S.enablePurchaseOrderEmail && !z.value ? [
2298
+ ...S.enablePurchaseOrderEmail && !M.value ? [
2316
2299
  {
2317
2300
  label: h("inventory.transfer.receiveRequest.bulk.emailAll"),
2318
2301
  value: "emailAll",
@@ -2340,7 +2323,7 @@ const qs = {
2340
2323
  values: Array.from(
2341
2324
  new Set(
2342
2325
  l.purchaseOrders.value.map((B) => {
2343
- const K = _.locations.find((X) => X.dbName === B._locationDbName);
2326
+ const K = C.locations.find((G) => G.dbName === B._locationDbName);
2344
2327
  return (K == null ? void 0 : K.name) ?? B._locationDbName;
2345
2328
  })
2346
2329
  )
@@ -2352,8 +2335,8 @@ const qs = {
2352
2335
  key: "netsuiteTransactionNumber",
2353
2336
  entity: "purchaseOrder",
2354
2337
  values: l.purchaseOrders.value.map((B) => {
2355
- var K, X;
2356
- return (X = (K = B.netSuite) == null ? void 0 : K.additionalInfo) == null ? void 0 : X.transactionnumber;
2338
+ var K, G;
2339
+ return (G = (K = B.netSuite) == null ? void 0 : K.additionalInfo) == null ? void 0 : G.transactionnumber;
2357
2340
  }).filter((B) => B != null)
2358
2341
  },
2359
2342
  {
@@ -2375,16 +2358,16 @@ const qs = {
2375
2358
  }).filter((B) => B != null)
2376
2359
  }
2377
2360
  ];
2378
- return [...P, ...M.isEnabled ? F : []];
2379
- }), Oe = C(null), Se = L(() => {
2361
+ return [...P, ...z.isEnabled ? F : []];
2362
+ }), Oe = k(null), Se = L(() => {
2380
2363
  if (!Oe.value) return l.purchaseOrders.value;
2381
- const P = kn.build(Oe.value);
2364
+ const P = _n.build(Oe.value);
2382
2365
  return l.purchaseOrders.value.filter((F) => {
2383
- var K, X, ne, Re, we;
2384
- const B = ((K = _.locations.find((j) => j.dbName === F._locationDbName)) == null ? void 0 : K.name) ?? F._locationDbName;
2385
- return Cn(
2366
+ var K, G, ee, Re, we;
2367
+ const B = ((K = C.locations.find((j) => j.dbName === F._locationDbName)) == null ? void 0 : K.name) ?? F._locationDbName;
2368
+ return wn(
2386
2369
  {
2387
- netsuiteTransactionNumber: (ne = (X = F.netSuite) == null ? void 0 : X.additionalInfo) == null ? void 0 : ne.transactionnumber,
2370
+ netsuiteTransactionNumber: (ee = (G = F.netSuite) == null ? void 0 : G.additionalInfo) == null ? void 0 : ee.transactionnumber,
2388
2371
  netsuiteOrderNo: (Re = F.netSuite) == null ? void 0 : Re.refNo,
2389
2372
  netsuiteOrderId: (we = F.netSuite) == null ? void 0 : we.id,
2390
2373
  status: F.status,
@@ -2396,22 +2379,22 @@ const qs = {
2396
2379
  });
2397
2380
  });
2398
2381
  return (P, F) => {
2399
- const B = Ce("FmIcon"), K = Ce("FmTextField"), X = Ce("FmButton"), ne = Ce("FmTable"), Re = Ce("FmCircularProgress");
2400
- return m(), ue(un, {
2382
+ const B = Ce("FmIcon"), K = Ce("FmTextField"), G = Ce("FmButton"), ee = Ce("FmTable"), Re = Ce("FmCircularProgress");
2383
+ return m(), le(rn, {
2401
2384
  title: t(h)("inventory.transfer.receiveRequest.bulk.title"),
2402
- actions: Xe.value,
2403
- "onClick:action": xe
2385
+ actions: Ge.value,
2386
+ "onClick:action": _e
2404
2387
  }, {
2405
2388
  default: Pe(() => {
2406
2389
  var we;
2407
2390
  return [
2408
- t(S).isLoaded && !t(S).enableReceiveRequestBeta ? (m(), y("div", oa, [
2391
+ t(S).isLoaded && !t(S).enableReceiveRequestBeta ? (m(), y("div", ea, [
2409
2392
  E(B, {
2410
2393
  name: "block",
2411
2394
  size: "xl"
2412
2395
  }),
2413
2396
  F[9] || (F[9] = e("p", { class: "fm-typo-en-body-md-400" }, "Not available", -1))
2414
- ])) : t(S).enableReceiveRequestBeta ? (m(), y(he, { key: 1 }, [
2397
+ ])) : t(S).enableReceiveRequestBeta ? (m(), y(ye, { key: 1 }, [
2415
2398
  e("div", {
2416
2399
  class: J(["flex flex-col gap-8 max-h-full", { "p-0": ge.value, "px-24": !ge.value }])
2417
2400
  }, [
@@ -2431,29 +2414,29 @@ const qs = {
2431
2414
  e("div", {
2432
2415
  class: J(["flex gap-8 items-center", { "w-full overflow-x-auto": ge.value }])
2433
2416
  }, [
2434
- E(ws, {
2435
- modelValue: t(U),
2436
- "onUpdate:modelValue": F[0] || (F[0] = (j) => bt(U) ? U.value = j : null),
2417
+ E(gs, {
2418
+ modelValue: t(V),
2419
+ "onUpdate:modelValue": F[0] || (F[0] = (j) => bt(V) ? V.value = j : null),
2437
2420
  locations: R.value
2438
2421
  }, null, 8, ["modelValue", "locations"]),
2439
- E(Yt, {
2440
- "model-value": ee.value,
2441
- "onUpdate:modelValue": F[1] || (F[1] = (j) => ee.value = j)
2422
+ E(jt, {
2423
+ "model-value": ne.value,
2424
+ "onUpdate:modelValue": F[1] || (F[1] = (j) => ne.value = j)
2442
2425
  }, null, 8, ["model-value"])
2443
2426
  ], 2),
2444
- e("div", sa, [
2445
- e("div", aa, [
2446
- E(t(Fn), {
2427
+ e("div", ta, [
2428
+ e("div", na, [
2429
+ E(t(kn), {
2447
2430
  modelValue: Oe.value,
2448
2431
  "onUpdate:modelValue": F[2] || (F[2] = (j) => Oe.value = j),
2449
2432
  attributes: qe.value
2450
2433
  }, null, 8, ["modelValue", "attributes"])
2451
2434
  ]),
2452
- ge.value ? D("", !0) : (m(), y("div", ra)),
2453
- e("div", la, [
2435
+ ge.value ? D("", !0) : (m(), y("div", oa)),
2436
+ e("div", sa, [
2454
2437
  E(K, {
2455
- "model-value": de.value,
2456
- "onUpdate:modelValue": F[3] || (F[3] = (j) => de.value = j),
2438
+ "model-value": ve.value,
2439
+ "onUpdate:modelValue": F[3] || (F[3] = (j) => ve.value = j),
2457
2440
  "prepend-icon": "search",
2458
2441
  placeholder: t(h)("inventory.common.table.toolbar.filterItems"),
2459
2442
  class: "w-full"
@@ -2462,15 +2445,15 @@ const qs = {
2462
2445
  ])
2463
2446
  ], 2)
2464
2447
  ], 512),
2465
- t(U).length === 0 && !z.value ? (m(), y("div", ia, [
2448
+ t(V).length === 0 && !M.value ? (m(), y("div", aa, [
2466
2449
  E(B, {
2467
2450
  name: "storefront",
2468
2451
  size: "xl"
2469
2452
  }),
2470
- e("p", ua, v(t(h)("inventory.transfer.receiveRequest.bulk.selectLocationsHint")), 1)
2471
- ])) : (m(), y("div", ca, [
2472
- (z.value || t(l).retryingFailed.value) && t(l).fetchProgress.value ? (m(), y("div", da, [
2473
- e("div", ma, [
2453
+ e("p", ra, p(t(h)("inventory.transfer.receiveRequest.bulk.selectLocationsHint")), 1)
2454
+ ])) : (m(), y("div", la, [
2455
+ (M.value || t(l).retryingFailed.value) && t(l).fetchProgress.value ? (m(), y("div", ia, [
2456
+ e("div", ua, [
2474
2457
  e("div", {
2475
2458
  class: "h-full rounded-full bg-fm-color-primary transition-all duration-300",
2476
2459
  style: mt({
@@ -2478,65 +2461,65 @@ const qs = {
2478
2461
  })
2479
2462
  }, null, 4)
2480
2463
  ]),
2481
- e("span", fa, v(t(l).fetchProgress.value.done) + "/" + v(t(l).fetchProgress.value.total) + " locations ", 1)
2464
+ e("span", ca, p(t(l).fetchProgress.value.done) + "/" + p(t(l).fetchProgress.value.total) + " locations ", 1)
2482
2465
  ])) : D("", !0),
2483
- t(l).failedLocations.value.length > 0 ? (m(), y("div", pa, [
2484
- e("span", va, " Failed to load: " + v(pe.value), 1),
2485
- G.value ? (m(), ue(X, {
2466
+ t(l).failedLocations.value.length > 0 ? (m(), y("div", da, [
2467
+ e("span", ma, " Failed to load: " + p(be.value), 1),
2468
+ he.value ? (m(), le(G, {
2486
2469
  key: 0,
2487
2470
  variant: "secondary",
2488
- disabled: t(l).retryingFailed.value || z.value,
2471
+ disabled: t(l).retryingFailed.value || M.value,
2489
2472
  label: t(l).retryingFailed.value ? "Retrying…" : "Retry failed locations",
2490
2473
  onClick: t(l).retryFailedLocations
2491
2474
  }, null, 8, ["disabled", "label", "onClick"])) : D("", !0)
2492
2475
  ])) : D("", !0),
2493
- E(ne, {
2476
+ E(ee, {
2494
2477
  style: mt(t(Fe).tableHeight),
2495
- "column-defs": t(p),
2478
+ "column-defs": t(v),
2496
2479
  "row-data": Se.value,
2497
- "search-value": de.value,
2498
- loading: z.value,
2480
+ "search-value": ve.value,
2481
+ loading: M.value,
2499
2482
  onRowClick: F[6] || (F[6] = (j) => t(l).promptShowTransferDetails(j.original)),
2500
- "page-size": Ae.value
2483
+ "page-size": $e.value
2501
2484
  }, {
2502
2485
  "list-row": Pe((j) => [
2503
- E(wn, {
2486
+ E(xn, {
2504
2487
  row: j,
2505
2488
  onRowClick: t(l).promptShowTransferDetails
2506
2489
  }, {
2507
- default: Pe((le) => {
2508
- var Be, Te, r, u, b, T, I, N, W, Q, $, te, V, ie, Je, Ie, Le, Ne, ke, ze, Me, je, We, w, ae;
2490
+ default: Pe((ae) => {
2491
+ var Be, Te, r, u, b, T, I, q, W, Q, A, Z, U, re, Je, Ie, Le, Ne, ke, ze, Me, je, We, x, oe;
2509
2492
  return [
2510
- e("div", ya, [
2511
- e("div", ba, [
2512
- E(t(et), {
2513
- render: (r = (Te = (Be = le._id) == null ? void 0 : Be.column) == null ? void 0 : Te.columnDef) == null ? void 0 : r.cell,
2514
- props: (b = (u = le._id) == null ? void 0 : u.getContext) == null ? void 0 : b.call(u)
2493
+ e("div", fa, [
2494
+ e("div", pa, [
2495
+ E(t(Ze), {
2496
+ render: (r = (Te = (Be = ae._id) == null ? void 0 : Be.column) == null ? void 0 : Te.columnDef) == null ? void 0 : r.cell,
2497
+ props: (b = (u = ae._id) == null ? void 0 : u.getContext) == null ? void 0 : b.call(u)
2515
2498
  }, null, 8, ["render", "props"])
2516
2499
  ]),
2517
- e("div", ha, [
2518
- E(t(et), {
2519
- render: (N = (I = (T = le.location) == null ? void 0 : T.column) == null ? void 0 : I.columnDef) == null ? void 0 : N.cell,
2520
- props: (Q = (W = le.location) == null ? void 0 : W.getContext) == null ? void 0 : Q.call(W)
2500
+ e("div", va, [
2501
+ E(t(Ze), {
2502
+ render: (q = (I = (T = ae.location) == null ? void 0 : T.column) == null ? void 0 : I.columnDef) == null ? void 0 : q.cell,
2503
+ props: (Q = (W = ae.location) == null ? void 0 : W.getContext) == null ? void 0 : Q.call(W)
2521
2504
  }, null, 8, ["render", "props"])
2522
2505
  ]),
2523
- e("div", ga, [
2524
- E(t(et), {
2525
- render: (V = (te = ($ = le.supplier_name) == null ? void 0 : $.column) == null ? void 0 : te.columnDef) == null ? void 0 : V.cell,
2526
- props: (Je = (ie = le.supplier_name) == null ? void 0 : ie.getContext) == null ? void 0 : Je.call(ie)
2506
+ e("div", ya, [
2507
+ E(t(Ze), {
2508
+ render: (U = (Z = (A = ae.supplier_name) == null ? void 0 : A.column) == null ? void 0 : Z.columnDef) == null ? void 0 : U.cell,
2509
+ props: (Je = (re = ae.supplier_name) == null ? void 0 : re.getContext) == null ? void 0 : Je.call(re)
2527
2510
  }, null, 8, ["render", "props"])
2528
2511
  ]),
2529
- e("div", _a, v(j.original.items.map((ce) => `${ce.name}`).join(", ")), 1),
2530
- j.original.ref ? (m(), y("div", xa, [
2531
- E(t(et), {
2532
- render: (Ne = (Le = (Ie = le.ref) == null ? void 0 : Ie.column) == null ? void 0 : Le.columnDef) == null ? void 0 : Ne.cell,
2533
- props: (ze = (ke = le.ref) == null ? void 0 : ke.getContext) == null ? void 0 : ze.call(ke)
2512
+ e("div", ba, p(j.original.items.map((ie) => `${ie.name}`).join(", ")), 1),
2513
+ j.original.ref ? (m(), y("div", ha, [
2514
+ E(t(Ze), {
2515
+ render: (Ne = (Le = (Ie = ae.ref) == null ? void 0 : Ie.column) == null ? void 0 : Le.columnDef) == null ? void 0 : Ne.cell,
2516
+ props: (ze = (ke = ae.ref) == null ? void 0 : ke.getContext) == null ? void 0 : ze.call(ke)
2534
2517
  }, null, 8, ["render", "props"])
2535
2518
  ])) : D("", !0),
2536
- e("div", wa, [
2537
- E(t(et), {
2538
- render: (We = (je = (Me = le.status) == null ? void 0 : Me.column) == null ? void 0 : je.columnDef) == null ? void 0 : We.cell,
2539
- props: (ae = (w = le.status) == null ? void 0 : w.getContext) == null ? void 0 : ae.call(w)
2519
+ e("div", ga, [
2520
+ E(t(Ze), {
2521
+ render: (We = (je = (Me = ae.status) == null ? void 0 : Me.column) == null ? void 0 : je.columnDef) == null ? void 0 : We.cell,
2522
+ props: (oe = (x = ae.status) == null ? void 0 : x.getContext) == null ? void 0 : oe.call(x)
2540
2523
  }, null, 8, ["render", "props"])
2541
2524
  ])
2542
2525
  ])
@@ -2547,11 +2530,11 @@ const qs = {
2547
2530
  ]),
2548
2531
  _: 1
2549
2532
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]),
2550
- t(l).rowAction.pending.value ? (m(), y("div", ka, [
2551
- e("div", Ca, [
2533
+ t(l).rowAction.pending.value ? (m(), y("div", xa, [
2534
+ e("div", _a, [
2552
2535
  E(Re, { size: "md" }),
2553
- e("span", Fa, v(t(h)("inventory.common.loading")), 1),
2554
- E(X, {
2536
+ e("span", wa, p(t(h)("inventory.common.loading")), 1),
2537
+ E(G, {
2555
2538
  variant: "secondary",
2556
2539
  label: t(h)("inventory.common.cancel"),
2557
2540
  onClick: t(l).rowAction.cancel
@@ -2560,28 +2543,28 @@ const qs = {
2560
2543
  ])) : D("", !0)
2561
2544
  ]))
2562
2545
  ], 2),
2563
- (m(), ue(lt, { to: "body" }, [
2564
- E(na),
2565
- t(S).enablePurchaseOrderEmail ? (m(), ue(vn, ht(ct({ key: 0 }, t(l).emailDialogProps.value)), null, 16)) : D("", !0),
2566
- E(fs, {
2546
+ (m(), le(lt, { to: "body" }, [
2547
+ E(Zs),
2548
+ t(S).enablePurchaseOrderEmail ? (m(), le(fn, ht(ct({ key: 0 }, t(l).emailDialogProps.value)), null, 16)) : D("", !0),
2549
+ E(cs, {
2567
2550
  show: g.value,
2568
2551
  "onUpdate:show": F[7] || (F[7] = (j) => g.value = j),
2569
2552
  "last-closing-date": t(l).lastClosingDate.value,
2570
- "selected-outlet-ids": fe.value,
2553
+ "selected-outlet-ids": de.value,
2571
2554
  onSubmitted: t(l).fetchData
2572
2555
  }, null, 8, ["show", "last-closing-date", "selected-outlet-ids", "onSubmitted"]),
2573
- E(yn, ct(t(l).transferDialogProps.value, {
2556
+ E(pn, ct(t(l).transferDialogProps.value, {
2574
2557
  onSubmitted: t(l).fetchData
2575
2558
  }), null, 16, ["onSubmitted"]),
2576
- t(l).transferDetailsProps.value != null ? (m(), ue(nn, ct({ key: 1 }, {
2559
+ t(l).transferDetailsProps.value != null ? (m(), le(en, ct({ key: 1 }, {
2577
2560
  ...t(l).transferDetailsProps.value,
2578
2561
  receivedMap: ((we = t(l).transferDetailsProps.value) == null ? void 0 : we.receivedMap) ?? {},
2579
2562
  shipments: t(l).shipments.value ?? []
2580
2563
  }, {
2581
2564
  onSubmitted: t(l).fetchData
2582
2565
  }), null, 16, ["onSubmitted"])) : D("", !0),
2583
- E(bn, ht(It(t(l).xilnexImportDialogProps.value)), null, 16),
2584
- E(xs, {
2566
+ E(vn, ht(Bt(t(l).xilnexImportDialogProps.value)), null, 16),
2567
+ E(hs, {
2585
2568
  modelValue: t(f),
2586
2569
  "onUpdate:modelValue": F[8] || (F[8] = (j) => bt(f) ? f.value = j : null),
2587
2570
  loading: t(d),
@@ -2597,5 +2580,5 @@ const qs = {
2597
2580
  }
2598
2581
  });
2599
2582
  export {
2600
- or as default
2583
+ Za as default
2601
2584
  };