@feedmepos/mf-inventory-portal 1.8.0-dev.7 → 1.8.0

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 (244) hide show
  1. package/dist/App-BPdZMhM8.js +1445 -0
  2. package/dist/{ApprovalView-1Y_jh_UJ.js → ApprovalView-UzjSuZ2L.js} +26 -25
  3. package/dist/{BindingsDialog-VMvTLguN.js → BindingsDialog-Cb6WRlKq.js} +2 -2
  4. package/dist/{BindingsPicker-KNRM5rMU.js → BindingsPicker-CtD4U4lv.js} +2 -2
  5. package/dist/{BindingsTable-CSyNlNCL.js → BindingsTable-CX-3403K.js} +10 -10
  6. package/dist/BulkReceiveRequestPage-CUq1Lmww.js +2839 -0
  7. package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DQuI04Yj.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-C5cA-lGH.js} +1 -1
  8. package/dist/{ClosingDraftView-A2pJuhIb.js → ClosingDraftView-Ca_SvdWQ.js} +748 -746
  9. package/dist/ClosingHistoryView-DzkeJYoe.js +769 -0
  10. package/dist/{ClosingTemplateView-DpkNCyoB.js → ClosingTemplateView-DSrelbso.js} +22 -21
  11. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DOpIDvsy.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-BuOuXPy1.js} +1 -1
  12. package/dist/{DefaultView-B4UuAqYu.js → DefaultView-Dw-7Y8vD.js} +2 -2
  13. package/dist/{DeliveryOrderPrintPreview-w0YcNH3F.js → DeliveryOrderPrintPreview-C5qJsv_O.js} +15 -15
  14. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-BimIEHsW.js → EmailDialog.vue_vue_type_script_setup_true_lang-D8od7aKT.js} +10075 -9949
  15. package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-ChekXW32.js +48 -0
  16. package/dist/FeatureCapabilityGate-C-IM5_7n.js +82 -0
  17. package/dist/FeaturePageGate.vue_vue_type_script_setup_true_lang-DEDU1XUC.js +189 -0
  18. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang--54VR4oB.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-B861gqIJ.js} +1 -1
  19. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-B7j4ZSOe.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Ckli_nZx.js} +2 -2
  20. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-D_y8VcCI.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BEjFoMJJ.js} +2 -2
  21. package/dist/{FmMultiselectDialog-DMA5eR0C.js → FmMultiselectDialog-CShFKSIW.js} +2 -2
  22. package/dist/{FmMultiselectDialog-BnZInvgp.js → FmMultiselectDialog-Ci-6NMsV.js} +2 -2
  23. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BXTUsnwN.js → FmUnitInput.vue_vue_type_script_setup_true_lang-Dkx5vVap.js} +105 -99
  24. package/dist/ImportView-7ij7RUHI.js +1540 -0
  25. package/dist/{IngredientsView-C4-8qNGD.js → IngredientsView-fIPtTyFD.js} +685 -688
  26. package/dist/{IntegrationExplorerView-D3leld2Z.js → IntegrationExplorerView-DLYT4T-I.js} +1537 -1620
  27. package/dist/IntegrationPlatformView-CwywuK_y.js +13385 -0
  28. package/dist/{IntegrationView-BhRzry3g.js → IntegrationView-DnyVHXge.js} +2380 -2340
  29. package/dist/{InventoryBindingForm-ewAgZ6e-.js → InventoryBindingForm-BBs8v7CL.js} +1 -1
  30. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Bpo7Yv9A.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang--pI5wz_M.js} +134 -134
  31. package/dist/{InventoryBindingSummary-e67GzHYr.js → InventoryBindingSummary-CwIrQ8lG.js} +1 -1
  32. package/dist/JsonViewer.vue_vue_type_script_setup_true_lang-C_hg75l0.js +25 -0
  33. package/dist/NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DJSbskyn.js +79 -0
  34. package/dist/PlanTierBadge.vue_vue_type_script_setup_true_lang-CM3gtYZo.js +19 -0
  35. package/dist/PlanUpgradeDialog.vue_vue_type_script_setup_true_lang-0F-yOcPC.js +79 -0
  36. package/dist/PremiumUpgradePage.vue_vue_type_script_setup_true_lang-DGAxPOEh.js +58 -0
  37. package/dist/ProductionRunDetailPage-C_WC4qfP.js +2317 -0
  38. package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-7u0HQH67.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-BIkoMOM2.js} +3051 -3161
  39. package/dist/ProductionRunPage-DuzVrjbZ.js +954 -0
  40. package/dist/{PublishView-BXA3k8Cp.js → PublishView-BVg44yke.js} +3 -3
  41. package/dist/{PurchaseOrderPrintPreview-DRugr4BU.js → PurchaseOrderPrintPreview-CNx6unyj.js} +17 -17
  42. package/dist/{ReceiveRequestView-CeJs9NTD.js → ReceiveRequestView-DeNrYOUt.js} +17 -16
  43. package/dist/RecipeView-De3pLsPR.js +3272 -0
  44. package/dist/SettingsView-B5ud0KtI.js +1005 -0
  45. package/dist/StockView-4N3NRjY8.js +3003 -0
  46. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Ckw1_xIc.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DvlRRKdt.js} +1 -1
  47. package/dist/{SupplierView-DH9u6e2M.js → SupplierView-fC9oe5nu.js} +304 -301
  48. package/dist/{SurchargeView-BPVEpc0f.js → SurchargeView-H6rv7u8A.js} +7 -7
  49. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-BRwxKmwb.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-DFdrmR2Z.js} +2 -2
  50. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-gJQQKKAC.js +71 -0
  51. package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BivHE94R.js +332 -0
  52. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-Df01LqHp.js +4953 -0
  53. package/dist/TransferTemplateView-CVUnofkI.js +2347 -0
  54. package/dist/{UnitCostHistoryView-06rIaX_M.js → UnitCostHistoryView-DjD2WAFI.js} +4 -4
  55. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-C2zidBrl.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-CE0zHU6c.js} +4 -4
  56. package/dist/{UnitView-Xk_F9SYG.js → UnitView-DCfsbE8e.js} +111 -106
  57. package/dist/{WarehouseView-bmpLmpcX.js → WarehouseView-BCebmbcj.js} +12 -11
  58. package/dist/{WastageTemplateView-CWV1pFxM.js → WastageTemplateView-BXYNMBun.js} +19 -18
  59. package/dist/api/bill.d.ts +4 -2
  60. package/dist/api/bill.spec.d.ts +1 -0
  61. package/dist/api/closing.d.ts +1 -0
  62. package/dist/api/feature-flags.d.ts +2 -0
  63. package/dist/api/integration-sync-log.d.ts +0 -13
  64. package/dist/api/inventory.d.ts +9 -9
  65. package/dist/api/netsuite-explorer.d.ts +1 -0
  66. package/dist/api/stock.d.ts +1 -1
  67. package/dist/{app-CURawLhs.js → app-VtVYHCDF.js} +9785 -9546
  68. package/dist/app.d.ts +151 -14
  69. package/dist/app.js +1 -1
  70. package/dist/bulk-edit-simulation.helper-Nd6CtWGf.js +178 -0
  71. package/dist/{closing-template-q_KGB4jO.js → closing-template-LCe0U9w9.js} +4 -4
  72. package/dist/components/FeatureCapabilityGate.spec.d.ts +1 -0
  73. package/dist/components/FeatureCapabilityGate.vue.d.ts +5 -0
  74. package/dist/components/FeatureGateLayout.vue.d.ts +11 -0
  75. package/dist/components/FeaturePageGate.spec.d.ts +1 -0
  76. package/dist/components/FeaturePageGate.vue.d.ts +34 -0
  77. package/dist/components/FmAdminCollapsiblePanel.vue.d.ts +1 -1
  78. package/dist/components/FmDroppableField.vue.d.ts +1 -1
  79. package/dist/components/FmInventoryTableToolbar.vue.d.ts +2 -2
  80. package/dist/components/FmUnitInputProps.d.ts +1 -0
  81. package/dist/components/FmUnitInputRules.d.ts +1 -1
  82. package/dist/components/HrmPermissionGuard.vue.d.ts +1 -1
  83. package/dist/components/MultiLocationSelector.vue.d.ts +6 -6
  84. package/dist/components/NumberPrecisionInput.spec.d.ts +1 -0
  85. package/dist/components/PremiumUpgradePage.vue.d.ts +2 -0
  86. package/dist/components/TemplatePublishDialog.d.ts +2 -0
  87. package/dist/components/TemplatePublishDialog.spec.d.ts +1 -0
  88. package/dist/composable/defineApi.d.ts +1 -1
  89. package/dist/{date2-3kdweNLp.js → date2-Cfb6DXM4.js} +1 -1
  90. package/dist/{dayjs.min-DHE73-wM.js → dayjs.min-BOndKK7B.js} +1 -1
  91. package/dist/{decimal-CAnQe2Ib.js → decimal-nbuisP61.js} +2 -2
  92. package/dist/{defineDeepModel-CctS67Do.js → defineDeepModel-DKySrdwp.js} +5 -5
  93. package/dist/{duplicate-template-Jk2V2Ezg.js → duplicate-template-BxcKb3Jp.js} +1 -1
  94. package/dist/{feature-D9n0IC0c.js → feature-VDUlSvM1.js} +452 -354
  95. package/dist/feature-flags/core.d.ts +1 -0
  96. package/dist/feature-flags/vue.d.ts +22 -1
  97. package/dist/feature-flags/vue.spec.d.ts +1 -0
  98. package/dist/{format-time-from-id-Bmzpbg-8.js → format-time-from-id-CfVH4LZ_.js} +1 -1
  99. package/dist/{format-unit-display-CVg4Bl5L.js → format-unit-display-BjTeAtgS.js} +209 -208
  100. package/dist/helper/country.spec.d.ts +1 -0
  101. package/dist/helper/menu-usage-module.d.ts +2 -1
  102. package/dist/helper/number.d.ts +5 -1
  103. package/dist/helper/rules.d.ts +1 -1
  104. package/dist/{id-to-date-DPCcxufP.js → id-to-date-Jr9SlHLO.js} +1 -1
  105. package/dist/{import-export.helper-bmGZwUBB.js → import-export.helper-FT9Wbigh.js} +17 -17
  106. package/dist/{index-zCBA-X6R.js → index-BV9b3Ulp.js} +2234 -2163
  107. package/dist/{index-yt6MlAFG.js → index-By5-VjVg.js} +1 -1
  108. package/dist/{JsonViewer.vue_vue_type_script_setup_true_lang-ig2zSXAB.js → index-C25C1Dg7.js} +1074 -1066
  109. package/dist/{index-CFNNQo-7.js → index-DXHVgUHU.js} +3 -3
  110. package/dist/index-eGvSlWMU.js +1892 -0
  111. package/dist/layout/SingleColumnLayout.vue.d.ts +1 -1
  112. package/dist/{lz-string-CqlY9MC2.js → lz-string-BAzqO9xf.js} +1 -1
  113. package/dist/menu-usage-module-Bq_KLsO4.js +74 -0
  114. package/dist/{netsuite-DudeltN_.js → netsuite-BhGuduqd.js} +254 -263
  115. package/dist/netsuite-explorer-9Qj7qAum.js +79 -0
  116. package/dist/{predefined-templates-DT32p04n.js → predefined-templates-BlRafgnc.js} +1 -1
  117. package/dist/production-run-list-DR1WsaBR.js +61 -0
  118. package/dist/{purchase-order-template-LaRpWA04.js → purchase-order-template-By_Zxu1b.js} +1 -1
  119. package/dist/{recalculationUtils-BYN393eE.js → recalculationUtils-VsBar7jB.js} +1 -1
  120. package/dist/router/name.d.ts +2 -1
  121. package/dist/{row-action.enum-BiP5wkT6.js → row-action.enum-76yLYmPA.js} +1 -1
  122. package/dist/rules-fOcvgt4t.js +243 -0
  123. package/dist/{stock-B9XerL9c.js → stock-C-dQaxY2.js} +1 -1
  124. package/dist/stock-Dh0KXA1P.js +78 -0
  125. package/dist/stores/feature.d.ts +31 -2
  126. package/dist/stores/feature.load-state.spec.d.ts +1 -0
  127. package/dist/stores/integration/netsuite.d.ts +2 -2
  128. package/dist/stores/inventory.no-location.spec.d.ts +1 -0
  129. package/dist/stores/location.d.ts +42 -42
  130. package/dist/stores/supplier.d.ts +48 -48
  131. package/dist/stores/warehouse.d.ts +2 -2
  132. package/dist/style.css +1 -1
  133. package/dist/{supplier-dpHijd2E.js → supplier-XHHHN8vZ.js} +2 -2
  134. package/dist/{surcharge-BZ4STY5J.js → surcharge-0-oBiYoF.js} +1 -1
  135. package/dist/tsconfig.app.tsbuildinfo +1 -1
  136. package/dist/{uom-rules-Da5Lngvp.js → uom-rules-DrRuSFgM.js} +1 -1
  137. package/dist/{use-ingredient-select-dialog-C3YsT5l-.js → use-ingredient-select-dialog-mQ7aQChK.js} +2 -2
  138. package/dist/{use-inventory-binding-dialog-BSsyrcGe.js → use-inventory-binding-dialog-5Wu0ItnH.js} +2 -2
  139. package/dist/{use-template-enabled-locations-BmJUzSUm.js → use-template-enabled-locations-CgpPMl8g.js} +2 -2
  140. package/dist/{use-transfer-locations-frEk_aBH.js → use-transfer-locations-DZ6B7eMT.js} +14 -14
  141. package/dist/{useHrmPermission-Cyjm0y9a.js → useHrmPermission-BaGxz4EV.js} +1 -1
  142. package/dist/{useNavigationMenu-CnTsOF9T.js → useNavigationMenu-CyP39v3U.js} +50 -49
  143. package/dist/{useSseClient-D_7o9nuf.js → useSseClient-CaD4MVg0.js} +1 -1
  144. package/dist/views/adjustment-template/wastage-template/actions.d.ts +36 -36
  145. package/dist/views/adjustment-template/wastage-template/table.d.ts +36 -36
  146. package/dist/views/changelog/composables/use-snapshot-diff.d.ts +2 -2
  147. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftApprovalDialog.vue.d.ts +6 -6
  148. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +12 -12
  149. package/dist/views/closing-draft/components/closing-draft-groups/ClosingGroupDetailSideSheet.vue.d.ts +6 -6
  150. package/dist/views/closing-draft/composables/use-closing-draft-import.d.ts +3 -3
  151. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +19 -19
  152. package/dist/views/closing-draft/helpers/draft-status-to-class-name.helper.d.ts +1 -1
  153. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +45 -45
  154. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +36 -36
  155. package/dist/views/import/helper/submit-rows.d.ts +1 -1
  156. package/dist/views/ingredients/components/inventory-binding/recipe-amount-validation.spec.d.ts +1 -0
  157. package/dist/views/ingredients/helper/is-linked-ingredient-error.d.ts +3 -1
  158. package/dist/views/integration/IntegrationPlatformView.vue.d.ts +24 -0
  159. package/dist/views/integration/components/IntegrationCard.vue.d.ts +3 -3
  160. package/dist/views/integration/components/Synergy/importFn.spec.d.ts +1 -0
  161. package/dist/views/integration/components/Xilnex/importFn.spec.d.ts +1 -0
  162. package/dist/views/integration/components/netsuite/business/AddLocationDialog.vue.d.ts +36 -36
  163. package/dist/views/integration/components/netsuite/business/AddVendorDialog.vue.d.ts +24 -24
  164. package/dist/views/integration/helper/opening-balance.d.ts +22 -0
  165. package/dist/views/integration/helper/opening-balance.spec.d.ts +1 -0
  166. package/dist/views/production-run/ProductionRunDetailPage.spec.d.ts +1 -0
  167. package/dist/views/{integration/components/IntegrationSyncLogTab.vue.d.ts → production-run/ProductionRunDetailPage.vue.d.ts} +2 -2
  168. package/dist/views/production-run/ProductionRunPage.vue.d.ts +2 -0
  169. package/dist/views/production-run/features/detail/ProductionRunItemsTable.vue.d.ts +2 -2
  170. package/dist/views/production-run/features/detail/ProductionRunOverviewTab.vue.d.ts +4 -4
  171. package/dist/views/production-run/features/detail/use-production-run-detail.d.ts +19 -9
  172. package/dist/views/production-run/features/lifecycle/CancelRunDialog.vue.d.ts +4 -4
  173. package/dist/views/production-run/features/lifecycle/CloseRunDialog.vue.d.ts +4 -4
  174. package/dist/views/production-run/features/lifecycle/ProductionRunLifecycleDialogs.vue.d.ts +14 -14
  175. package/dist/views/production-run/features/lifecycle/TargetReachedDialog.vue.d.ts +4 -4
  176. package/dist/views/production-run/features/planning/ProductionRunFormDialog.vue.d.ts +4 -4
  177. package/dist/views/production-run/features/planning/ProductionRunPlanner.vue.d.ts +1 -1
  178. package/dist/views/production-run/features/planning/use-production-run-duplicate-sources.d.ts +6 -6
  179. package/dist/views/production-run/shared/helpers/production-run-navigation.d.ts +0 -1
  180. package/dist/views/production-run/shared/model/production-run-list.d.ts +1 -1
  181. package/dist/views/production-run/shared/ui/ProductionRunInfoBadge.vue.d.ts +1 -1
  182. package/dist/views/production-run/shared/ui/ProductionRunInfoText.vue.d.ts +1 -1
  183. package/dist/views/production-run/shared/ui/ProductionRunScrollHint.vue.d.ts +2 -2
  184. package/dist/views/production-run/shared/ui/ProductionRunTextarea.vue.d.ts +3 -3
  185. package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +5 -5
  186. package/dist/views/receive-request/composables/netsuite-order-label.d.ts +11 -0
  187. package/dist/views/receive-request/composables/netsuite-order-label.spec.d.ts +1 -0
  188. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +6 -6
  189. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +48 -48
  190. package/dist/views/receive-request/composables/use-receive-request-form.spec.d.ts +1 -0
  191. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +42 -42
  192. package/dist/views/receive-request/import/export.spec.d.ts +1 -0
  193. package/dist/views/receive-request-bulk/BulkReceiveRequestPage.vue.d.ts +2 -0
  194. package/dist/views/receive-request-bulk/components/CreateTransferWizard.spec.d.ts +1 -0
  195. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +54 -54
  196. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.readiness.spec.d.ts +1 -0
  197. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-table.d.ts +8 -8
  198. package/dist/views/recipe/components/recipe-bulk-editor/components/ModificationCard.spec.d.ts +1 -0
  199. package/dist/views/recipe/helper/import-recipe.d.ts +30 -0
  200. package/dist/views/recipe/helper/import-recipe.spec.d.ts +1 -0
  201. package/dist/views/settings/PlanLicenseDisplay.spec.d.ts +1 -0
  202. package/dist/views/settings/PlanLicenseDisplay.vue.d.ts +2 -0
  203. package/dist/views/stock/components/StockRecordCard.spec.d.ts +1 -0
  204. package/dist/views/stock/components/StockRecordCard.vue.d.ts +19 -865
  205. package/dist/views/stock/components/dialog/AmendAdjustmentForm.spec.d.ts +1 -0
  206. package/dist/views/stock/components/dialog/BillInventoryInfoDialog.spec.d.ts +1 -0
  207. package/dist/views/stock/components/dialog/BillInventoryInfoDialog.vue.d.ts +36 -0
  208. package/dist/views/stock/components/dialog/ConvertSkuDialog.spec.d.ts +1 -0
  209. package/dist/views/stock/composables/use-last-closing-summary.d.ts +4 -0
  210. package/dist/views/stock/composables/use-last-closing-summary.spec.d.ts +1 -0
  211. package/dist/views/supplier/components/SupplierForm.vue.d.ts +4 -4
  212. package/dist/views/supplier/composables/use-supplier-table.d.ts +2 -2
  213. package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +8 -8
  214. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +4 -4
  215. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.spec.d.ts +1 -0
  216. package/dist/views/transfer-template/composables/use-template-item-bulk-editor.d.ts +24 -24
  217. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +48 -48
  218. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +48 -48
  219. package/dist/views/transfer-template/helpers/template-item.error.helper.spec.d.ts +1 -0
  220. package/dist/views/unit/composables/use-unit-form.spec.d.ts +1 -0
  221. package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +4 -4
  222. package/dist/{FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-BBkF9lOE.js → vue-KHCpiw_e.js} +106 -108
  223. package/dist/{vue-i18n-DwAcG7yc.js → vue-i18n-D6btLtve.js} +422 -422
  224. package/dist/{xlsx.util-C7S-uyqm.js → xlsx.util-Dr5i_LBa.js} +2 -2
  225. package/package.json +71 -66
  226. package/dist/App-Bo29Nwt0.js +0 -1537
  227. package/dist/BulkReceiveRequestView-vOeHbWM_.js +0 -2656
  228. package/dist/ClosingHistoryView-woRmvmYT.js +0 -761
  229. package/dist/ImportView-C7Hah7MM.js +0 -1291
  230. package/dist/NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CKEzy2Uo.js +0 -72
  231. package/dist/ProductionRunDetailView-Ct7kr5Ht.js +0 -2312
  232. package/dist/ProductionRunView-odWyBZGx.js +0 -930
  233. package/dist/RecipeView-BH0REMB3.js +0 -3428
  234. package/dist/SettingsView-Dc27wyk-.js +0 -977
  235. package/dist/StockView-DrHLzosW.js +0 -2616
  236. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js +0 -84
  237. package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BpiePSmo.js +0 -299
  238. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DOQGPKiv.js +0 -4820
  239. package/dist/TransferTemplateView-CEVRsKL7.js +0 -2326
  240. package/dist/menu-usage-module-BdjYEk3s.js +0 -57
  241. package/dist/number-BoePMDs8.js +0 -138
  242. package/dist/rules-CQT0uAAo.js +0 -98
  243. package/dist/stock-CVybjhUm.js +0 -75
  244. package/dist/views/integration/composables/use-integration-sync-log.d.ts +0 -45
@@ -1,79 +1,81 @@
1
- import { ref as P, defineComponent as ke, computed as g, resolveComponent as S, createElementBlock as V, openBlock as c, Fragment as ee, createCommentVNode as N, createVNode as s, unref as o, withModifiers as Rt, withCtx as x, createElementVNode as n, renderList as de, createBlock as j, toDisplayString as $, normalizeClass as ie, h as Z, mergeModels as st, onMounted as Ot, watch as _t, useModel as Bt, createTextVNode as xt, isRef as rt, createSlots as kt, normalizeStyle as Dt, Teleport as it, normalizeProps as Nt, guardReactiveProps as zt } from "vue";
2
- import { a as Fe, c as wt, S as Lt, g as dt, e as ut, f as jt, h as mt, i as ct, j as pt, k as vt, u as Wt, l as qt } from "./app-CURawLhs.js";
3
- import { useDialog as Ke, useSnackbar as Ae, components as ze, useProxiedModel as ft, useDialogChild as Ht, useBreakpoints as Yt } from "@feedmepos/ui-library";
4
- import { i as Kt, _ as Gt, m as Jt } from "./menu-usage-module-BdjYEk3s.js";
5
- import { F as W } from "./form-mode.enum-BKiNVH6A.js";
1
+ import { ref as P, defineComponent as xe, computed as g, resolveComponent as C, createElementBlock as V, openBlock as p, Fragment as ee, createCommentVNode as L, createVNode as r, unref as o, withModifiers as Rt, withCtx as x, createElementVNode as n, renderList as de, createBlock as Y, toDisplayString as $, normalizeClass as ie, h as Z, mergeModels as st, onMounted as Dt, watch as _t, useModel as Ot, createTextVNode as xt, isRef as rt, createSlots as kt, normalizeStyle as Bt, Teleport as it, normalizeProps as Nt, guardReactiveProps as zt } from "vue";
2
+ import { a as Fe, c as wt, S as Lt, g as dt, e as ut, f as jt, h as ct, i as mt, j as pt, k as vt, u as Wt, l as qt } from "./app-VtVYHCDF.js";
3
+ import { p as Ht } from "./production-run-list-DR1WsaBR.js";
4
+ import { useDialog as Ke, useSnackbar as Ae, components as ze, useProxiedModel as ft, useDialogChild as Yt, useBreakpoints as Kt } from "@feedmepos/ui-library";
5
+ import { i as Gt, _ as Jt, m as Qt } from "./menu-usage-module-Bq_KLsO4.js";
6
+ import { F as j } from "./form-mode.enum-BKiNVH6A.js";
6
7
  import { useI18n as pe, useCoreStore as Ge } from "@feedmepos/mf-common";
7
- import { defineStore as Qt, storeToRefs as Xt } from "pinia";
8
- import { D as yt, R as Pe } from "./row-action.enum-BiP5wkT6.js";
9
- import { c as Zt } from "./component-BmLAdDiY.js";
10
- import { u as Ee, _ as en } from "./netsuite-DudeltN_.js";
11
- import { F as Be } from "./FmAdminBadge-DlplQOHb.js";
12
- import { u as tn, _ as nn } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
13
- import { A as Oe, R as Le, U as on, M as ln } from "./rules-CQT0uAAo.js";
14
- import { g as an, _ as je, S as We, a as sn } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Ckw1_xIc.js";
15
- import { _ as rn } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-Bpo7Yv9A.js";
16
- import { _ as qe, u as dn } from "./FmMultiselectDialog-DMA5eR0C.js";
17
- import { u as Tt } from "./feature-D9n0IC0c.js";
18
- import { t as un, a as mn, g as cn } from "./number-BoePMDs8.js";
19
- import { a as xe } from "./FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-BBkF9lOE.js";
20
- import { d as Re, g as pn, e as vn, a as fn } from "./import-export.helper-bmGZwUBB.js";
21
- import { _ as yn } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-CG1m-B2p.js";
8
+ import { defineStore as Xt, storeToRefs as Zt } from "pinia";
9
+ import { D as yt, R as Pe } from "./row-action.enum-76yLYmPA.js";
10
+ import { c as en } from "./component-BmLAdDiY.js";
11
+ import { u as Ee, _ as tn } from "./netsuite-BhGuduqd.js";
12
+ import { F as Oe } from "./FmAdminBadge-DlplQOHb.js";
13
+ import { u as nn, _ as on } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
14
+ import { A as De, t as ln, a as an, R as Le, U as sn, M as rn, g as dn } from "./rules-fOcvgt4t.js";
15
+ import { g as un, _ as je, S as We, a as cn } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DvlRRKdt.js";
16
+ import { _ as mn } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang--pI5wz_M.js";
17
+ import { _ as qe, u as pn } from "./FmMultiselectDialog-CShFKSIW.js";
18
+ import { u as Tt } from "./feature-VDUlSvM1.js";
19
+ import { _ as ke } from "./FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-ChekXW32.js";
20
+ import { d as Re, g as vn, e as fn, a as yn } from "./import-export.helper-FT9Wbigh.js";
21
+ import { _ as gn } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-CG1m-B2p.js";
22
22
  import { _ as Ce } from "./FmLockableField.vue_vue_type_script_setup_true_lang-FCg4K7y8.js";
23
- import { F as gn, a as He } from "./FmMultiselectDialog-BnZInvgp.js";
24
- import { u as Vt } from "./purchase-order-template-LaRpWA04.js";
25
- import { u as It, a as St } from "./closing-template-q_KGB4jO.js";
26
- import { _ as bn, F as gt } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js";
27
- import { r as hn } from "./xlsx.util-C7S-uyqm.js";
28
- import { F as _n } from "./FmDroppableField-J0tG_U3w.js";
29
- import { _ as xn } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-D_y8VcCI.js";
30
- import { P as kn, J as wn } from "./app-C39bYJmq.js";
31
- const Ye = Qt("ingredientForm", function() {
32
- const h = Ke(), k = Ae(), u = Fe(), _ = P(!1), { t: C } = pe(), A = P();
23
+ import { F as bn, a as He } from "./FmMultiselectDialog-Ci-6NMsV.js";
24
+ import { u as Vt } from "./purchase-order-template-By_Zxu1b.js";
25
+ import { u as It, a as St } from "./closing-template-LCe0U9w9.js";
26
+ import { _ as hn } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-gJQQKKAC.js";
27
+ import { F as gt } from "./index-eGvSlWMU.js";
28
+ import { r as _n } from "./xlsx.util-Dr5i_LBa.js";
29
+ import { F as xn } from "./FmDroppableField-J0tG_U3w.js";
30
+ import { _ as kn } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BEjFoMJJ.js";
31
+ import { P as wn, J as Tn } from "./app-C39bYJmq.js";
32
+ const Ye = Xt("ingredientForm", function() {
33
+ const h = Ke(), k = Ae(), d = Fe(), _ = P(!1), { t: S } = pe(), A = P();
33
34
  function U() {
34
35
  const a = {
35
36
  sku: {},
36
- mode: W.CREATE,
37
+ mode: j.CREATE,
37
38
  show: !0,
38
- "onUpdate:show"(d) {
39
- A.value.show = d;
39
+ "onUpdate:show"(c) {
40
+ A.value.show = c;
40
41
  }
41
42
  };
42
43
  A.value = a;
43
44
  }
44
45
  async function l(a) {
45
- const d = {
46
+ const c = {
46
47
  sku: wt(a),
47
- mode: W.UPDATE,
48
+ mode: j.UPDATE,
48
49
  show: !0,
49
- "onUpdate:show"(r) {
50
- A.value.show = r;
50
+ "onUpdate:show"(s) {
51
+ A.value.show = s;
51
52
  }
52
53
  };
53
- A.value = d;
54
+ A.value = c;
54
55
  }
55
56
  async function i(a) {
56
57
  _.value = !0;
57
58
  try {
58
- await u.deleteSku(a), k.open({
59
+ await d.deleteSku(a), k.open({
59
60
  title: "Success",
60
61
  message: `Deleted ${a.name}`,
61
62
  type: "success"
62
63
  });
63
- } catch (d) {
64
- if (d instanceof Lt && Kt(d)) {
64
+ } catch (c) {
65
+ if (c instanceof Lt && Gt(c)) {
65
66
  h.open({
66
67
  title: "Cannot delete ingredient",
67
- contentComponent: Gt,
68
+ contentComponent: Jt,
68
69
  contentComponentProps: {
69
70
  subject: (a == null ? void 0 : a.name) ?? "",
70
- items: d.errorResponse.errors.map((r) => {
71
+ items: c.errorResponse.errors.map((s) => {
71
72
  var f;
72
73
  return {
73
74
  chain: [
74
75
  {
75
- itemName: r.name,
76
- moduleKey: (f = r.message) != null && f.startsWith("modules.") ? Jt(r.message) : r.module
76
+ itemName: s.module === "productionRun" && s.runNo != null ? Ht({ runName: s.name, runNo: s.runNo }, S("inventory.production.run.list.untitled")) : s.name,
77
+ locationName: s.locationName,
78
+ moduleKey: (f = s.message) != null && f.startsWith("modules.") ? Qt(s.message) : s.module
77
79
  }
78
80
  ]
79
81
  };
@@ -90,23 +92,23 @@ const Ye = Qt("ingredientForm", function() {
90
92
  title: `Cannot delete ${a.name}`,
91
93
  message: "Please try again.",
92
94
  type: "error"
93
- }), console.error("failed to delete ingredient", d);
95
+ }), console.error("failed to delete ingredient", c);
94
96
  } finally {
95
97
  _.value = !1;
96
98
  }
97
99
  }
98
- function m(a) {
100
+ function u(a) {
99
101
  h.open({
100
- title: C("inventory.ingredient.delete.title", [(a == null ? void 0 : a.name) ?? ""]),
102
+ title: S("inventory.ingredient.delete.title", [(a == null ? void 0 : a.name) ?? ""]),
101
103
  closeButton: !1,
102
- message: C("inventory.ingredient.delete.message"),
104
+ message: S("inventory.ingredient.delete.message"),
103
105
  primaryActions: {
104
- text: C("common.delete"),
106
+ text: S("common.delete"),
105
107
  close: !0,
106
108
  variant: "destructive"
107
109
  },
108
110
  secondaryActions: {
109
- text: C("common.cancel"),
111
+ text: S("common.cancel"),
110
112
  close: !0
111
113
  }
112
114
  }).onPrimary(() => i(a));
@@ -114,113 +116,113 @@ const Ye = Qt("ingredientForm", function() {
114
116
  return {
115
117
  createIngredient: U,
116
118
  updateIngredient: l,
117
- deleteIngredient: m,
119
+ deleteIngredient: u,
118
120
  ingredientDialogProps: A,
119
121
  ingredientViewLoading: _
120
122
  };
121
- }), Tn = {
123
+ }), Vn = {
122
124
  key: 0,
123
125
  class: "flex items-center gap-8"
124
- }, Vn = { class: "flex flex-col gap-1" }, In = { class: "fm-typo-en-heading-lg-600" }, Sn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Cn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Fn = {
126
+ }, In = { class: "flex flex-col gap-1" }, Sn = { class: "fm-typo-en-heading-lg-600" }, Cn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Fn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, An = {
125
127
  key: 0,
126
128
  class: "fm-typo-en-body-md-400 text-fm-color-system-warning-300"
127
- }, An = {
129
+ }, En = {
128
130
  key: 1,
129
131
  class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
130
- }, En = { class: "flex flex-col gap-2 mt-4" }, $n = { class: "flex items-center gap-2 fm-typo-en-body-md-400" }, Mn = { class: "flex flex-wrap gap-2" }, Un = { class: "flex flex-col" }, Pn = { class: "flex flex-col bg-fm-color-bg-secondary font-mono p-4 rounded-md" }, Rn = { class: "text-fm-color-typo-tertiary flex-shrink-0 fm-typo-en-body-md-400 whitespace-pre flex items-center" }, On = { class: "px-2 py-1 rounded-md bg-blue-200 border-2 border-blue-400" }, Bn = { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, Dn = /* @__PURE__ */ ke({
132
+ }, $n = { class: "flex flex-col gap-2 mt-4" }, Mn = { class: "flex items-center gap-2 fm-typo-en-body-md-400" }, Un = { class: "flex flex-wrap gap-2" }, Pn = { class: "flex flex-col" }, Rn = { class: "flex flex-col bg-fm-color-bg-secondary font-mono p-4 rounded-md" }, Dn = { class: "text-fm-color-typo-tertiary flex-shrink-0 fm-typo-en-body-md-400 whitespace-pre flex items-center" }, On = { class: "px-2 py-1 rounded-md bg-blue-200 border-2 border-blue-400" }, Bn = { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, Nn = /* @__PURE__ */ xe({
131
133
  __name: "ItemSubsidiaryTreeDialog",
132
134
  props: {
133
135
  skuId: {},
134
136
  itemName: {},
135
137
  itemCode: {}
136
138
  },
137
- setup(q) {
138
- const h = q, { t: k } = pe(), u = Ge(), _ = Ee(), C = P(!1), A = g(() => {
139
- var r;
140
- return ((r = u.sessionUser.value) == null ? void 0 : r.role.isAdmin) ?? !1;
139
+ setup(W) {
140
+ const h = W, { t: k } = pe(), d = Ge(), _ = Ee(), S = P(!1), A = g(() => {
141
+ var s;
142
+ return ((s = d.sessionUser.value) == null ? void 0 : s.role.isAdmin) ?? !1;
141
143
  }), U = g(() => _.getSkuSubsidiaries(h.skuId)), l = g(() => {
142
- const r = /* @__PURE__ */ new Set();
144
+ const s = /* @__PURE__ */ new Set();
143
145
  function f(F) {
144
- for (const p of F)
145
- p.isAssigned && (r.add(p.id), U.value.includeChildren && w(p)), p.children && p.children.length > 0 && f(p.children);
146
+ for (const m of F)
147
+ m.isAssigned && (s.add(m.id), U.value.includeChildren && w(m)), m.children && m.children.length > 0 && f(m.children);
146
148
  }
147
149
  function w(F) {
148
150
  if (F.children)
149
- for (const p of F.children)
150
- r.add(p.id), w(p);
151
+ for (const m of F.children)
152
+ s.add(m.id), w(m);
151
153
  }
152
- return f(U.value.subsidiaryTree), r;
154
+ return f(U.value.subsidiaryTree), s;
153
155
  });
154
- function i(r, f = [], w = !1) {
156
+ function i(s, f = [], w = !1) {
155
157
  const F = [];
156
- return r.forEach((p, B) => {
157
- const R = B === r.length - 1, ve = [...f, R];
158
+ return s.forEach((m, O) => {
159
+ const R = O === s.length - 1, ve = [...f, R];
158
160
  let ne = "";
159
161
  for (let te = 0; te < f.length; te++)
160
162
  ne += f[te] ? " " : "│ ";
161
163
  ne += R ? "└── " : "├── ";
162
- const ue = l.value.has(p.id), oe = p.isAssigned === !0, le = w && !oe;
164
+ const ue = l.value.has(m.id), oe = m.isAssigned === !0, le = w && !oe;
163
165
  if (F.push({
164
- id: p.id,
165
- name: p.name,
166
+ id: m.id,
167
+ name: m.name,
166
168
  prefix: f.length === 0 ? "" : ne,
167
169
  isHighlighted: ue,
168
170
  isDirectlyBound: oe,
169
171
  isParentIncludedChild: le,
170
172
  isRoot: f.length === 0
171
- }), p.children && p.children.length > 0) {
173
+ }), m.children && m.children.length > 0) {
172
174
  const te = w || oe && U.value.includeChildren;
173
- F.push(...i(p.children, ve, te));
175
+ F.push(...i(m.children, ve, te));
174
176
  }
175
177
  }), F;
176
178
  }
177
- function m(r, f = []) {
179
+ function u(s, f = []) {
178
180
  const w = /* @__PURE__ */ new Set();
179
- for (const F of r) {
180
- const p = [...f, F.id];
181
- F.isAssigned === !0 && p.forEach((B) => w.add(B)), F.children && F.children.length > 0 && m(F.children, p).forEach((R) => w.add(R));
181
+ for (const F of s) {
182
+ const m = [...f, F.id];
183
+ F.isAssigned === !0 && m.forEach((O) => w.add(O)), F.children && F.children.length > 0 && u(F.children, m).forEach((R) => w.add(R));
182
184
  }
183
185
  return w;
184
186
  }
185
- function a(r, f) {
186
- return r.map((w) => f.has(w.id) || w.isAssigned === !0 ? {
187
+ function a(s, f) {
188
+ return s.map((w) => f.has(w.id) || w.isAssigned === !0 ? {
187
189
  ...w,
188
190
  // Recursively filter children
189
191
  children: w.children ? a(w.children, f) : []
190
192
  } : null).filter(Boolean);
191
193
  }
192
- const d = g(() => {
193
- let r = U.value.subsidiaryTree;
194
- if ((!r || r.length === 0) && (r = _.getBusinessSubsidiaryTree()), !A.value) {
195
- const f = m(r);
196
- r = a(r, f);
194
+ const c = g(() => {
195
+ let s = U.value.subsidiaryTree;
196
+ if ((!s || s.length === 0) && (s = _.getBusinessSubsidiaryTree()), !A.value) {
197
+ const f = u(s);
198
+ s = a(s, f);
197
199
  }
198
- return i(r, []);
200
+ return i(s, []);
199
201
  });
200
- return (r, f) => {
201
- const w = S("FmButton"), F = S("FmDialog");
202
- return c(), V(ee, null, [
203
- o(_).isEnabled ? (c(), V("div", Tn, [
204
- s(w, {
202
+ return (s, f) => {
203
+ const w = C("FmButton"), F = C("FmDialog");
204
+ return p(), V(ee, null, [
205
+ o(_).isEnabled ? (p(), V("div", Vn, [
206
+ r(w, {
205
207
  "prepend-icon": "info",
206
208
  variant: "tertiary",
207
- onClick: f[0] || (f[0] = Rt((p) => C.value = !0, ["stop"]))
209
+ onClick: f[0] || (f[0] = Rt((m) => S.value = !0, ["stop"]))
208
210
  })
209
- ])) : N("", !0),
210
- s(F, {
211
- modelValue: C.value,
212
- "onUpdate:modelValue": f[1] || (f[1] = (p) => C.value = p),
211
+ ])) : L("", !0),
212
+ r(F, {
213
+ modelValue: S.value,
214
+ "onUpdate:modelValue": f[1] || (f[1] = (m) => S.value = m),
213
215
  "close-button": "",
214
216
  dismissAway: ""
215
217
  }, {
216
218
  "dialog-header": x(() => [
217
- n("div", Vn, [
218
- n("div", In, $(o(k)("inventory.integration.netsuite.subsidiaryHierarchy.title")), 1),
219
- n("p", Sn, " Name: " + $(h.itemName), 1),
220
- n("p", Cn, " Code: " + $(h.itemCode), 1),
221
- A.value ? (c(), V("p", Fn, " All subsidiaries are shown since you are an admin. ")) : (c(), V("p", An, " Only showing subsidiaries in your business path and bound subsidiaries. ")),
222
- n("div", En, [
223
- n("div", $n, [
219
+ n("div", In, [
220
+ n("div", Sn, $(o(k)("inventory.integration.netsuite.subsidiaryHierarchy.title")), 1),
221
+ n("p", Cn, " Name: " + $(h.itemName), 1),
222
+ n("p", Fn, " Code: " + $(h.itemCode), 1),
223
+ A.value ? (p(), V("p", An, " All subsidiaries are shown since you are an admin. ")) : (p(), V("p", En, " Only showing subsidiaries in your business path and bound subsidiaries. ")),
224
+ n("div", $n, [
225
+ n("div", Mn, [
224
226
  f[2] || (f[2] = n("span", { class: "font-semibold" }, "Include Children Subsidiaries:", -1)),
225
227
  n("span", {
226
228
  class: ie(
@@ -228,12 +230,12 @@ const Ye = Qt("ingredientForm", function() {
228
230
  )
229
231
  }, $(U.value.includeChildren ? "Yes" : "No"), 3)
230
232
  ]),
231
- n("div", Mn, [
233
+ n("div", Un, [
232
234
  f[4] || (f[4] = n("div", { class: "flex items-center gap-2 px-2 py-1 bg-fm-color-bg-brand-secondary rounded-md" }, [
233
235
  n("span", { class: "w-3 h-3 rounded-sm bg-green-400" }),
234
236
  n("span", { class: "fm-typo-en-body-sm-400" }, "Directly Bound")
235
237
  ], -1)),
236
- s(Be, null, {
238
+ r(Oe, null, {
237
239
  default: x(() => f[3] || (f[3] = [
238
240
  n("div", { class: "flex items-center gap-2 px-2 py-1 rounded-md" }, [
239
241
  n("span", { class: "w-3 h-3 rounded-sm bg-blue-400" }),
@@ -247,35 +249,35 @@ const Ye = Qt("ingredientForm", function() {
247
249
  ])
248
250
  ]),
249
251
  default: x(() => [
250
- n("div", Un, [
251
- n("div", Pn, [
252
- (c(!0), V(ee, null, de(d.value, (p) => (c(), V("div", {
253
- key: p.id,
252
+ n("div", Pn, [
253
+ n("div", Rn, [
254
+ (p(!0), V(ee, null, de(c.value, (m) => (p(), V("div", {
255
+ key: m.id,
254
256
  class: "flex items-stretch"
255
257
  }, [
256
- n("span", Rn, $(p.prefix), 1),
257
- p.isParentIncludedChild ? (c(), j(Be, {
258
+ n("span", Dn, $(m.prefix), 1),
259
+ m.isParentIncludedChild ? (p(), Y(Oe, {
258
260
  key: 0,
259
261
  class: "flex-1"
260
262
  }, {
261
263
  default: x(() => [
262
264
  n("div", On, [
263
- n("span", Bn, $(p.name), 1)
265
+ n("span", Bn, $(m.name), 1)
264
266
  ])
265
267
  ]),
266
268
  _: 2
267
- }, 1024)) : (c(), V("div", {
269
+ }, 1024)) : (p(), V("div", {
268
270
  key: 1,
269
271
  class: ie([
270
272
  "px-2 py-1 rounded-md flex-1",
271
- p.isDirectlyBound ? "border-2 bg-green-200 border-green-400" : "bg-fm-color-bg-primary border border-fm-color-border-secondary"
273
+ m.isDirectlyBound ? "border-2 bg-green-200 border-green-400" : "bg-fm-color-bg-primary border border-fm-color-border-secondary"
272
274
  ])
273
275
  }, [
274
276
  n("span", {
275
277
  class: ie([
276
- p.isHighlighted ? "fm-typo-en-body-md-600 text-fm-color-typo-primary" : "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
278
+ m.isHighlighted ? "fm-typo-en-body-md-600 text-fm-color-typo-primary" : "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
277
279
  ])
278
- }, $(p.name), 3)
280
+ }, $(m.name), 3)
279
281
  ], 2))
280
282
  ]))), 128))
281
283
  ])
@@ -287,13 +289,13 @@ const Ye = Qt("ingredientForm", function() {
287
289
  };
288
290
  }
289
291
  });
290
- function Nn() {
292
+ function zn() {
291
293
  var l;
292
- const { updateIngredient: q, deleteIngredient: h } = Ye(), k = Fe(), u = Ee(), { t: _ } = pe(), C = Ge();
293
- async function A(i, m) {
294
- const a = wt(m);
294
+ const { updateIngredient: W, deleteIngredient: h } = Ye(), k = Fe(), d = Ee(), { t: _ } = pe(), S = Ge();
295
+ async function A(i, u) {
296
+ const a = wt(u);
295
297
  if (i === Pe.Edit) {
296
- await q(a);
298
+ await W(a);
297
299
  return;
298
300
  }
299
301
  if (i === Pe.Delete) {
@@ -302,10 +304,10 @@ function Nn() {
302
304
  }
303
305
  }
304
306
  return { columnDefs: [
305
- ...(l = C.sessionUser.value) != null && l.role.isAdmin ? [
307
+ ...(l = S.sessionUser.value) != null && l.role.isAdmin ? [
306
308
  {
307
309
  accessorKey: "_id",
308
- header: () => Z(Be, {}, () => "ID"),
310
+ header: () => Z(Oe, {}, () => "ID"),
309
311
  size: 200
310
312
  }
311
313
  ] : [],
@@ -321,11 +323,11 @@ function Nn() {
321
323
  enableSorting: !0,
322
324
  size: 300,
323
325
  cell(i) {
324
- const m = i.row.original, a = k.skuBindingFlattenCache[m._id], d = a == null ? void 0 : a.inventoryBindings.some(
325
- (r) => "error" in r && r.reason === "circularDependency"
326
+ const u = i.row.original, a = k.skuBindingFlattenCache[u._id], c = a == null ? void 0 : a.inventoryBindings.some(
327
+ (s) => "error" in s && s.reason === "circularDependency"
326
328
  );
327
329
  return Z("div", { class: "flex items-center w-full gap-4" }, [
328
- d ? Z(
330
+ c ? Z(
329
331
  ze.FmTooltip,
330
332
  { class: "text-left" },
331
333
  {
@@ -341,7 +343,7 @@ function Nn() {
341
343
  }
342
344
  }
343
345
  ) : null,
344
- m.name
346
+ u.name
345
347
  ]);
346
348
  }
347
349
  },
@@ -350,7 +352,7 @@ function Nn() {
350
352
  header: () => _("inventory.ingredient.unit"),
351
353
  accessorFn: (i) => bt(i),
352
354
  cell(i) {
353
- const m = i.row.original, a = bt(m);
355
+ const u = i.row.original, a = bt(u);
354
356
  return Z(
355
357
  ze.FmTooltip,
356
358
  { zIndex: 51, content: a },
@@ -370,26 +372,26 @@ function Nn() {
370
372
  accessorKey: "isInactive",
371
373
  header: () => _("inventory.ingredient.status.title"),
372
374
  cell(i) {
373
- const m = i.row.original.isInactive;
375
+ const u = i.row.original.isInactive;
374
376
  return Z(
375
377
  "span",
376
378
  {
377
379
  class: [
378
380
  "inline-block px-3 py-1 rounded-full text-xs font-semibold",
379
- m ? "bg-red-100 text-red-700" : "bg-green-100 text-green-700"
381
+ u ? "bg-red-100 text-red-700" : "bg-green-100 text-green-700"
380
382
  ].join(" ")
381
383
  },
382
- _(m ? "inventory.ingredient.status.inactive" : "inventory.ingredient.status.active")
384
+ _(u ? "inventory.ingredient.status.inactive" : "inventory.ingredient.status.active")
383
385
  );
384
386
  },
385
387
  enableSorting: !0
386
388
  },
387
389
  {
388
390
  id: "netsuiteSubsidiary",
389
- accessorFn: (i) => u.getSkuSubsidiaries(i._id),
391
+ accessorFn: (i) => d.getSkuSubsidiaries(i._id),
390
392
  header: () => "NetSuite Subsidiary",
391
393
  cell(i) {
392
- const m = i.row.original, { flattenedSubsidiaryNames: a } = u.getSkuSubsidiaries(m._id);
394
+ const u = i.row.original, { flattenedSubsidiaryNames: a } = d.getSkuSubsidiaries(u._id);
393
395
  return Z("div", { class: "flex gap-2 items-start" }, [
394
396
  Z(
395
397
  "span",
@@ -398,7 +400,7 @@ function Nn() {
398
400
  },
399
401
  a.join(", ")
400
402
  ),
401
- Z(Dn, { skuId: m._id, itemName: m.name, itemCode: m.code })
403
+ Z(Nn, { skuId: u._id, itemName: u.name, itemCode: u.code })
402
404
  ]);
403
405
  },
404
406
  enableSorting: !1,
@@ -408,10 +410,10 @@ function Nn() {
408
410
  id: "action",
409
411
  header: "",
410
412
  cell(i) {
411
- return Zt(
413
+ return en(
412
414
  [yt[Pe.Edit], yt[Pe.Delete]],
413
- (m) => {
414
- A(m, i.row.original);
415
+ (u) => {
416
+ A(u, i.row.original);
415
417
  }
416
418
  );
417
419
  },
@@ -424,16 +426,16 @@ function Nn() {
424
426
  }
425
427
  ] };
426
428
  }
427
- function bt(q) {
429
+ function bt(W) {
428
430
  var h;
429
- if (q.trackingMeasurement) {
430
- const k = (h = q.unit.measurements) == null ? void 0 : h.find((u) => u.id === q.trackingMeasurement);
431
+ if (W.trackingMeasurement) {
432
+ const k = (h = W.unit.measurements) == null ? void 0 : h.find((d) => d.id === W.trackingMeasurement);
431
433
  if (k)
432
434
  return `${k.name} (${k.abbrev})`;
433
435
  }
434
- return `${q.unit.name} (${q.unit.abbrev})`;
436
+ return `${W.unit.name} (${W.unit.abbrev})`;
435
437
  }
436
- const zn = /* @__PURE__ */ ke({
438
+ const Ln = /* @__PURE__ */ xe({
437
439
  __name: "ConvertForm",
438
440
  props: {
439
441
  modelValue: {},
@@ -442,106 +444,106 @@ const zn = /* @__PURE__ */ ke({
442
444
  readonly: { type: Boolean }
443
445
  },
444
446
  emits: ["update:modelValue"],
445
- setup(q, { emit: h }) {
446
- const k = q, u = g(() => {
447
- var d;
448
- return (d = k.rootValue) == null ? void 0 : d.unit;
447
+ setup(W, { emit: h }) {
448
+ const k = W, d = g(() => {
449
+ var c;
450
+ return (c = k.rootValue) == null ? void 0 : c.unit;
449
451
  }), _ = g(() => {
450
- var d;
451
- return (d = k.rootValue) == null ? void 0 : d._id;
452
- }), C = h, { t: A } = pe(), U = g({
452
+ var c;
453
+ return (c = k.rootValue) == null ? void 0 : c._id;
454
+ }), S = h, { t: A } = pe(), U = g({
453
455
  get() {
454
456
  return !!k.modelValue;
455
457
  },
456
- set(d) {
457
- d ? C("update:modelValue", {
458
+ set(c) {
459
+ c ? S("update:modelValue", {
458
460
  measurement: null,
459
461
  inventoryBindings: []
460
- }) : C("update:modelValue", null);
462
+ }) : S("update:modelValue", null);
461
463
  }
462
- }), l = g(() => an(u.value));
463
- function i(d) {
464
- const r = k.modelValue ?? {};
465
- r.measurement = d ? `${d}` : null, C("update:modelValue", r);
464
+ }), l = g(() => un(d.value));
465
+ function i(c) {
466
+ const s = k.modelValue ?? {};
467
+ s.measurement = c ? `${c}` : null, S("update:modelValue", s);
466
468
  }
467
- function m(d) {
468
- const r = k.modelValue ?? {};
469
- r.inventoryBindings = d, C("update:modelValue", r);
469
+ function u(c) {
470
+ const s = k.modelValue ?? {};
471
+ s.inventoryBindings = c, S("update:modelValue", s);
470
472
  }
471
473
  const a = g(() => {
472
474
  if (!k.modelValue) return null;
473
- const d = k.modelValue;
474
- return d.measurement ? l.value.find((r) => r.value === d.measurement) ?? null : l.value.find((r) => r.value === null) ?? null;
475
+ const c = k.modelValue;
476
+ return c.measurement ? l.value.find((s) => s.value === c.measurement) ?? null : l.value.find((s) => s.value === null) ?? null;
475
477
  });
476
- return (d, r) => {
477
- const f = S("FmSwitch"), w = S("FmSelect"), F = S("FmCard");
478
- return c(), j(F, {
478
+ return (c, s) => {
479
+ const f = C("FmSwitch"), w = C("FmSelect"), F = C("FmCard");
480
+ return p(), Y(F, {
479
481
  variant: "outlined",
480
482
  class: "p-16 flex flex-col gap-16"
481
483
  }, {
482
484
  default: x(() => {
483
- var p, B;
485
+ var m, O;
484
486
  return [
485
- s(f, {
487
+ r(f, {
486
488
  value: "",
487
489
  "model-value": U.value,
488
- "onUpdate:modelValue": r[0] || (r[0] = (R) => U.value = R),
490
+ "onUpdate:modelValue": s[0] || (s[0] = (R) => U.value = R),
489
491
  label: o(A)("inventory.ingredient.convertible.title"),
490
492
  sublabel: o(A)("inventory.ingredient.convertible.subtitle"),
491
493
  labelPlacement: "right",
492
- disabled: d.readonly
494
+ disabled: c.readonly
493
495
  }, null, 8, ["model-value", "label", "sublabel", "disabled"]),
494
- U.value ? (c(), V(ee, { key: 0 }, [
496
+ U.value ? (p(), V(ee, { key: 0 }, [
495
497
  n("div", null, [
496
- s(w, {
498
+ r(w, {
497
499
  label: o(A)("inventory.ingredient.convertible.convertTo"),
498
- modelValue: (p = a.value) == null ? void 0 : p.value,
500
+ modelValue: (m = a.value) == null ? void 0 : m.value,
499
501
  "onUpdate:modelValue": i,
500
502
  items: l.value,
501
- disabled: d.readonly
503
+ disabled: c.readonly
502
504
  }, null, 8, ["label", "modelValue", "items", "disabled"])
503
505
  ]),
504
- s(rn, {
506
+ r(mn, {
505
507
  id: _.value,
506
- "model-value": ((B = d.modelValue) == null ? void 0 : B.inventoryBindings) ?? [],
507
- "onUpdate:modelValue": m,
508
+ "model-value": ((O = c.modelValue) == null ? void 0 : O.inventoryBindings) ?? [],
509
+ "onUpdate:modelValue": u,
508
510
  "exclude-binding-id": _.value,
509
- rules: [o(Oe)(1)],
510
- readonly: d.readonly,
511
+ rules: [o(De)(1)],
512
+ readonly: c.readonly,
511
513
  "allow-recipe-decimal": ""
512
514
  }, null, 8, ["id", "model-value", "exclude-binding-id", "rules", "readonly"])
513
- ], 64)) : N("", !0)
515
+ ], 64)) : L("", !0)
514
516
  ];
515
517
  }),
516
518
  _: 1
517
519
  });
518
520
  };
519
521
  }
520
- }), Ln = { class: "flex gap-8" }, jn = { class: "flex-1" }, Wn = { class: "flex-1" }, qn = { class: "flex flex-col gap-5" }, Hn = { class: "flex items-center gap-8" }, Yn = { class: "flex items-center gap-8" }, Kn = { class: "flex items-center gap-8" }, Gn = { class: "text-fm-color-typo-secondary" }, Jn = { class: "text-fm-color-typo-secondary whitespace-nowrap" }, Qn = {
521
- key: 3,
522
+ }), jn = { class: "flex gap-8" }, Wn = { class: "flex-1" }, qn = { class: "flex-1" }, Hn = { class: "flex flex-col gap-5" }, Yn = { class: "flex flex-col gap-32" }, Kn = { class: "flex items-center gap-8" }, Gn = { class: "flex items-center gap-8" }, Jn = { class: "flex items-center gap-8" }, Qn = { class: "text-fm-color-typo-secondary" }, Xn = { class: "text-fm-color-typo-secondary whitespace-nowrap" }, Zn = {
523
+ key: 1,
522
524
  class: "border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
523
- }, Xn = { class: "flex flex-col" }, Zn = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, eo = {
524
- key: 4,
525
+ }, eo = { class: "flex flex-col" }, to = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, no = {
526
+ key: 2,
525
527
  class: "border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
526
- }, to = { class: "flex flex-col gap-12" }, no = { class: "flex flex-col gap-4" }, oo = { class: "flex items-center gap-8" }, lo = { class: "fm-typo-en-title-sm-600" }, ao = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, so = { class: "flex flex-col gap-4" }, ro = { class: "flex fm-corner-radius-md border-1 border-fm-color-neutral-gray-200" }, io = { class: "flex-1 p-12 flex flex-col gap-8" }, uo = { class: "mx-auto" }, mo = { class: "flex flex-col" }, co = { class: "fm-typo-en-body-sm-600 translate-y-4" }, po = { class: "flex-1 p-12 flex flex-col gap-8" }, vo = { class: "mx-auto" }, fo = { class: "flex flex-col" }, yo = { class: "fm-typo-en-body-sm-600 translate-y-4" }, go = { class: "flex-1 p-12 flex flex-col gap-8" }, bo = { class: "mx-auto" }, ho = { class: "flex flex-col" }, _o = { class: "fm-typo-en-body-sm-600 translate-y-4" }, xo = {
527
- key: 5,
528
+ }, oo = { class: "flex flex-col gap-12" }, lo = { class: "flex flex-col gap-4" }, ao = { class: "flex items-center gap-8" }, so = { class: "fm-typo-en-title-sm-600" }, ro = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, io = { class: "flex flex-col gap-4" }, uo = { class: "flex fm-corner-radius-md border-1 border-fm-color-neutral-gray-200" }, co = { class: "flex-1 p-12 flex flex-col gap-8" }, mo = { class: "mx-auto" }, po = { class: "flex flex-col" }, vo = { class: "fm-typo-en-body-sm-600 translate-y-4" }, fo = { class: "flex-1 p-12 flex flex-col gap-8" }, yo = { class: "mx-auto" }, go = { class: "flex flex-col" }, bo = { class: "fm-typo-en-body-sm-600 translate-y-4" }, ho = { class: "flex-1 p-12 flex flex-col gap-8" }, _o = { class: "mx-auto" }, xo = { class: "flex flex-col" }, ko = { class: "fm-typo-en-body-sm-600 translate-y-4" }, wo = {
529
+ key: 3,
528
530
  class: "flex flex-col gap-12"
529
- }, ko = { class: "flex flex-col" }, wo = { class: "flex items-center justify-between" }, To = { class: "flex items-center gap-8" }, Vo = { class: "fm-typo-en-title-sm-600" }, Io = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, So = {
531
+ }, To = { class: "flex flex-col" }, Vo = { class: "flex items-center justify-between" }, Io = { class: "flex items-center gap-8" }, So = { class: "fm-typo-en-title-sm-600" }, Co = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Fo = {
530
532
  key: 0,
531
533
  class: "flex flex-col gap-8"
532
- }, Co = { class: "flex flex-wrap gap-8" }, Fo = {
533
- key: 6,
534
+ }, Ao = { class: "flex flex-wrap gap-8" }, Eo = {
535
+ key: 4,
534
536
  class: "flex flex-col gap-12"
535
- }, Ao = { class: "flex flex-col" }, Eo = { class: "flex items-center justify-between" }, $o = { class: "flex items-center gap-8" }, Mo = { class: "fm-typo-en-title-sm-600" }, Uo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Po = {
537
+ }, $o = { class: "flex flex-col" }, Mo = { class: "flex items-center justify-between" }, Uo = { class: "flex items-center gap-8" }, Po = { class: "fm-typo-en-title-sm-600" }, Ro = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Do = {
536
538
  key: 0,
537
539
  class: "flex flex-col gap-8"
538
- }, Ro = { class: "flex flex-wrap gap-8" }, Oo = {
539
- key: 7,
540
+ }, Oo = { class: "flex flex-wrap gap-8" }, Bo = {
541
+ key: 5,
540
542
  class: "flex flex-col gap-12"
541
- }, Bo = { class: "flex flex-col" }, Do = { class: "flex items-center justify-between" }, No = { class: "flex items-center gap-8" }, zo = { class: "fm-typo-en-title-sm-600" }, Lo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, jo = {
543
+ }, No = { class: "flex flex-col" }, zo = { class: "flex items-center justify-between" }, Lo = { class: "flex items-center gap-8" }, jo = { class: "fm-typo-en-title-sm-600" }, Wo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, qo = {
542
544
  key: 0,
543
545
  class: "flex flex-col gap-8"
544
- }, Wo = { class: "flex flex-wrap gap-8" }, qo = /* @__PURE__ */ ke({
546
+ }, Ho = { class: "flex flex-wrap gap-8" }, Yo = /* @__PURE__ */ xe({
545
547
  __name: "IngredientForm",
546
548
  props: /* @__PURE__ */ st({
547
549
  mode: {},
@@ -555,41 +557,41 @@ const zn = /* @__PURE__ */ ke({
555
557
  searchModifiers: {}
556
558
  }),
557
559
  emits: /* @__PURE__ */ st(["update:modelValue", "click:submit", "update:purchaseOrderTemplateIds", "update:wastageTemplateIds", "update:closingTemplateIds"], ["update:search"]),
558
- setup(q, { expose: h, emit: k }) {
560
+ setup(W, { expose: h, emit: k }) {
559
561
  var Xe;
560
- const { t: u } = pe(), _ = Ke();
562
+ const { t: d } = pe(), _ = Ke();
561
563
  Ae();
562
- const C = Vt(), A = It(), U = St(), l = q, i = k, m = Fe(), a = Ge(), d = Tt(), r = Ee(), f = g(() => r.isEnabled);
564
+ const S = Vt(), A = It(), U = St(), l = W, i = k, u = Fe(), a = Ge(), c = Tt(), s = Ee(), f = g(() => s.isEnabled);
563
565
  P(void 0);
564
- const w = P([]), F = P([]), p = P([]), B = P(!1);
566
+ const w = P([]), F = P([]), m = P([]), O = P(!1);
565
567
  function R(e) {
566
568
  if (e.length === 0) return;
567
569
  const t = e[0], b = l.modelValue ?? {
568
- unit: m.units.find((I) => I)
570
+ unit: u.units.find((I) => I)
569
571
  };
570
572
  b.unit || (b.unit = t, i("update:modelValue", b));
571
573
  }
572
- Ot(() => {
573
- R(m.units), l.mode === W.CREATE && (d.mustUsePoTemplate && ne(), d.enableWastageTemplate && ue(), d.enableClosingTemplate && oe());
574
- }), _t([() => m.units], ([e]) => {
574
+ Dt(() => {
575
+ R(u.units), l.mode === j.CREATE && (c.mustUsePoTemplate && ne(), c.enableWastageTemplate && ue(), c.enableClosingTemplate && oe());
576
+ }), _t([() => u.units], ([e]) => {
575
577
  R(e);
576
578
  });
577
579
  function ve() {
578
580
  i("click:submit");
579
581
  }
580
582
  async function ne() {
581
- w.value = [], B.value = !0;
583
+ w.value = [], O.value = !0;
582
584
  try {
583
- const [e] = await Promise.all([C.readTemplates()]).delayed(1e3);
585
+ const [e] = await Promise.all([S.readTemplates()]).delayed(1e3);
584
586
  w.value = e;
585
587
  } catch (e) {
586
588
  console.log("Something went wrong when fetching templates:", e);
587
589
  } finally {
588
- B.value = !1;
590
+ O.value = !1;
589
591
  }
590
592
  }
591
593
  async function ue() {
592
- F.value = [], B.value = !0;
594
+ F.value = [], O.value = !0;
593
595
  try {
594
596
  const [e] = await Promise.all([A.readTemplates()]).delayed(
595
597
  1e3
@@ -598,20 +600,20 @@ const zn = /* @__PURE__ */ ke({
598
600
  } catch (e) {
599
601
  console.log("Something went wrong when fetching wastage templates:", e);
600
602
  } finally {
601
- B.value = !1;
603
+ O.value = !1;
602
604
  }
603
605
  }
604
606
  async function oe() {
605
- p.value = [], B.value = !0;
607
+ m.value = [], O.value = !0;
606
608
  try {
607
609
  const [e] = await Promise.all([U.listTemplates()]).delayed(
608
610
  1e3
609
611
  );
610
- p.value = e;
612
+ m.value = e;
611
613
  } catch (e) {
612
614
  console.log("Something went wrong when fetching closing templates:", e);
613
615
  } finally {
614
- B.value = !1;
616
+ O.value = !1;
615
617
  }
616
618
  }
617
619
  const le = g({
@@ -651,10 +653,10 @@ const zn = /* @__PURE__ */ ke({
651
653
  get() {
652
654
  var t, b;
653
655
  const e = (b = (t = l.modelValue) == null ? void 0 : t.defaultCost) == null ? void 0 : b.costPerUnit;
654
- return e ? +mn(e) : 0;
656
+ return e ? +an(e) : 0;
655
657
  },
656
658
  set(e) {
657
- var b, I, Y, D;
659
+ var b, I, H, B;
658
660
  const t = l.modelValue ? {
659
661
  ...l.modelValue
660
662
  } : {};
@@ -664,7 +666,7 @@ const zn = /* @__PURE__ */ ke({
664
666
  precision: 2,
665
667
  currency: ((b = dt(a.currentCountry.value)) == null ? void 0 : b.currency) ?? "MYR"
666
668
  },
667
- measurement: (D = (Y = (I = l.modelValue) == null ? void 0 : I.unit) == null ? void 0 : Y.measurements) == null ? void 0 : D.find(
669
+ measurement: (B = (H = (I = l.modelValue) == null ? void 0 : I.unit) == null ? void 0 : H.measurements) == null ? void 0 : B.find(
668
670
  (se) => {
669
671
  var re;
670
672
  return se.id === ((re = l.modelValue) == null ? void 0 : re.trackingMeasurement);
@@ -672,22 +674,22 @@ const zn = /* @__PURE__ */ ke({
672
674
  )
673
675
  }), t.defaultCost.costPerUnit = {
674
676
  ...t.defaultCost.costPerUnit,
675
- ...un(+e, 4)
677
+ ...ln(+e, 4)
676
678
  }, i("update:modelValue", t);
677
679
  }
678
680
  }), ye = g(() => {
679
681
  var t, b, I;
680
- const e = ((t = l.modelValue) == null ? void 0 : t.unit) ?? m.units.find((Y) => Y);
682
+ const e = ((t = l.modelValue) == null ? void 0 : t.unit) ?? u.units.find((H) => H);
681
683
  return e ? {
682
684
  _id: e._id,
683
685
  measurement: (b = l.modelValue) == null ? void 0 : b.trackingMeasurement,
684
- name: ((I = e.measurements.find((Y) => {
685
- var D;
686
- return Y.id === ((D = l.modelValue) == null ? void 0 : D.trackingMeasurement);
686
+ name: ((I = e.measurements.find((H) => {
687
+ var B;
688
+ return H.id === ((B = l.modelValue) == null ? void 0 : B.trackingMeasurement);
687
689
  })) == null ? void 0 : I.name) ?? e.name
688
690
  } : null;
689
691
  }), we = g(
690
- () => m.units.flatMap(({ name: e, _id: t, abbrev: b, measurements: I }) => [
692
+ () => u.units.flatMap(({ name: e, _id: t, abbrev: b, measurements: I }) => [
691
693
  {
692
694
  label: `${e}`,
693
695
  value: null,
@@ -698,41 +700,41 @@ const zn = /* @__PURE__ */ ke({
698
700
  value: { _id: t },
699
701
  displayAsSection: !1
700
702
  },
701
- ...I.map(({ id: Y, name: D, abbrev: se }) => ({
702
- label: `${D} (${se})`,
703
- value: { _id: t, measurement: Y },
703
+ ...I.map(({ id: H, name: B, abbrev: se }) => ({
704
+ label: `${B} (${se})`,
705
+ value: { _id: t, measurement: H },
704
706
  displayAsSection: !1
705
707
  }))
706
708
  ])
707
- ), y = Bt(q, "search"), M = g(
708
- () => new gn(we.value, ["label", "value"], {
709
+ ), y = Ot(W, "search"), M = g(
710
+ () => new bn(we.value, ["label", "value"], {
709
711
  caseSensitive: !1,
710
712
  sort: !0
711
713
  })
712
714
  ), G = g(() => M.value.search(y.value));
713
715
  function E(e) {
714
- var t, b, I, Y, D;
715
- return ((b = (t = l.modelValue) == null ? void 0 : t.unit) == null ? void 0 : b._id) === ((I = e.value) == null ? void 0 : I._id) && ((Y = l.modelValue) == null ? void 0 : Y.trackingMeasurement) === ((D = e.value) == null ? void 0 : D.measurement);
716
+ var t, b, I, H, B;
717
+ return ((b = (t = l.modelValue) == null ? void 0 : t.unit) == null ? void 0 : b._id) === ((I = e.value) == null ? void 0 : I._id) && ((H = l.modelValue) == null ? void 0 : H.trackingMeasurement) === ((B = e.value) == null ? void 0 : B.measurement);
716
718
  }
717
719
  function v(e) {
718
720
  var se, re;
719
721
  if (!e) return;
720
- const { _id: t, measurement: b } = e, I = b || void 0, Y = m.units.find((Se) => Se._id === t);
721
- if (!Y)
722
+ const { _id: t, measurement: b } = e, I = b || void 0, H = u.units.find((Se) => Se._id === t);
723
+ if (!H)
722
724
  return;
723
- const D = l.modelValue ?? {};
724
- D.unit = Y, D.trackingMeasurement = I, D.convert && (D.convert.measurement = I || null), d.enableTotalCost && (D.defaultCost = {
725
- measurement: Y.measurements.find((Se) => Se.id === I),
725
+ const B = l.modelValue ?? {};
726
+ B.unit = H, B.trackingMeasurement = I, B.convert && (B.convert.measurement = I || null), B.defaultCost = {
727
+ measurement: H.measurements.find((Se) => Se.id === I),
726
728
  costPerUnit: {
727
- ...((se = D.defaultCost) == null ? void 0 : se.costPerUnit) ?? {
729
+ ...((se = B.defaultCost) == null ? void 0 : se.costPerUnit) ?? {
728
730
  amount: 0,
729
731
  precision: 2,
730
732
  currency: ((re = dt(a.currentCountry.value)) == null ? void 0 : re.currency) ?? "MYR"
731
733
  }
732
734
  }
733
- }), i("update:modelValue", D);
735
+ }, i("update:modelValue", B);
734
736
  }
735
- const z = g({
737
+ const N = g({
736
738
  get() {
737
739
  var e;
738
740
  return ((e = l.modelValue) == null ? void 0 : e.convert) ?? null;
@@ -749,9 +751,9 @@ const zn = /* @__PURE__ */ ke({
749
751
  e === ut.enum.WAVG
750
752
  )
751
753
  ).map((e) => ({
752
- label: u(`inventory.ingredient.valuationMethod.${e}`),
754
+ label: d(`inventory.ingredient.valuationMethod.${e}`),
753
755
  value: e
754
- }))), me = g({
756
+ }))), ce = g({
755
757
  get() {
756
758
  var e;
757
759
  return ((e = l.modelValue) == null ? void 0 : e.valuation) ?? "WAVG";
@@ -773,42 +775,42 @@ const zn = /* @__PURE__ */ ke({
773
775
  } : {};
774
776
  t.customAttributes = e, i("update:modelValue", t);
775
777
  }
776
- }), H = P();
778
+ }), q = P();
777
779
  h({
778
780
  validateInputs: () => {
779
781
  var e, t;
780
- (t = (e = H.value) == null ? void 0 : e.validateInputs) == null || t.call(e);
782
+ (t = (e = q.value) == null ? void 0 : e.validateInputs) == null || t.call(e);
781
783
  },
782
784
  resetInputsValidation: () => {
783
785
  var e, t;
784
- (t = (e = H.value) == null ? void 0 : e.resetInputsValidation) == null || t.call(e);
786
+ (t = (e = q.value) == null ? void 0 : e.resetInputsValidation) == null || t.call(e);
785
787
  },
786
788
  resetInputs: () => {
787
789
  var e, t;
788
- (t = (e = H.value) == null ? void 0 : e.resetInputs) == null || t.call(e);
790
+ (t = (e = q.value) == null ? void 0 : e.resetInputs) == null || t.call(e);
789
791
  }
790
792
  });
791
- const O = P(!1), K = g(
793
+ const D = P(!1), K = g(
792
794
  () => {
793
795
  var e, t, b;
794
- return (e = l.modelValue) != null && e._id ? ((b = m.menu.bindedBySkuId[(t = l.modelValue) == null ? void 0 : t._id]) == null ? void 0 : b.filter(
796
+ return (e = l.modelValue) != null && e._id ? ((b = u.menu.bindedBySkuId[(t = l.modelValue) == null ? void 0 : t._id]) == null ? void 0 : b.filter(
795
797
  (I) => I.from === "INGREDIENT"
796
798
  )) ?? [] : [];
797
799
  }
798
- ), L = g(
800
+ ), z = g(
799
801
  () => {
800
802
  var e, t, b;
801
- return (e = l.modelValue) != null && e._id ? ((b = m.menu.bindedBySkuId[(t = l.modelValue) == null ? void 0 : t._id]) == null ? void 0 : b.filter(
803
+ return (e = l.modelValue) != null && e._id ? ((b = u.menu.bindedBySkuId[(t = l.modelValue) == null ? void 0 : t._id]) == null ? void 0 : b.filter(
802
804
  (I) => I.from === "RECIPE"
803
805
  )) ?? [] : [];
804
806
  }
805
807
  ), ge = g(
806
808
  () => {
807
809
  var e, t, b;
808
- return (e = l.modelValue) != null && e._id ? ((b = m.menu.bindedBySkuId[(t = l.modelValue) == null ? void 0 : t._id]) == null ? void 0 : b.filter((I) => I.from === "MENU")) ?? [] : [];
810
+ return (e = l.modelValue) != null && e._id ? ((b = u.menu.bindedBySkuId[(t = l.modelValue) == null ? void 0 : t._id]) == null ? void 0 : b.filter((I) => I.from === "MENU")) ?? [] : [];
809
811
  }
810
812
  ), $e = g(
811
- () => m.skus.map((e) => ({ label: e.name, value: e.code }))
813
+ () => u.skus.map((e) => ({ label: e.name, value: e.code }))
812
814
  ), Me = P((Xe = l.modelValue) == null ? void 0 : Xe.code);
813
815
  function Ue(e) {
814
816
  var b;
@@ -817,13 +819,13 @@ const zn = /* @__PURE__ */ ke({
817
819
  }
818
820
  const be = g(
819
821
  () => {
820
- var e, t, b, I, Y, D;
822
+ var e, t, b, I, H, B;
821
823
  return ((I = (b = (t = (e = l.modelValue) == null ? void 0 : e.unit) == null ? void 0 : t.measurements) == null ? void 0 : b.find(
822
824
  (se) => {
823
825
  var re;
824
826
  return se.id === ((re = l.modelValue) == null ? void 0 : re.trackingMeasurement);
825
827
  }
826
- )) == null ? void 0 : I.abbrev) ?? ((D = (Y = l.modelValue) == null ? void 0 : Y.unit) == null ? void 0 : D.abbrev);
828
+ )) == null ? void 0 : I.abbrev) ?? ((B = (H = l.modelValue) == null ? void 0 : H.unit) == null ? void 0 : B.abbrev);
827
829
  }
828
830
  ), he = g({
829
831
  get() {
@@ -839,7 +841,7 @@ const zn = /* @__PURE__ */ ke({
839
841
  } : {};
840
842
  b.thresholds = t, i("update:modelValue", b);
841
843
  }
842
- }), ce = g({
844
+ }), me = g({
843
845
  get() {
844
846
  var e, t;
845
847
  return ((t = (e = l.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.mid) ?? Re().mid;
@@ -853,17 +855,17 @@ const zn = /* @__PURE__ */ ke({
853
855
  } : {};
854
856
  b.thresholds = t, i("update:modelValue", b);
855
857
  }
856
- }), Te = g(() => d.mustUsePoTemplate && l.mode === W.CREATE && w.value.length > 0 ? w.value.map((e) => ({
858
+ }), Te = g(() => c.mustUsePoTemplate && l.mode === j.CREATE && w.value.length > 0 ? w.value.map((e) => ({
857
859
  label: e.name || "Template",
858
860
  value: e._id || "template_" + e.name
859
861
  })) : []), Ve = g(() => Te.value.filter(
860
862
  (e) => (l.purchaseOrderTemplateIds ?? []).includes(e.value)
861
- )), _e = g(() => d.enableWastageTemplate && l.mode === W.CREATE && F.value.length > 0 ? F.value.map((e) => ({
863
+ )), _e = g(() => c.enableWastageTemplate && l.mode === j.CREATE && F.value.length > 0 ? F.value.map((e) => ({
862
864
  label: e.name || "Template",
863
865
  value: e._id || "template_" + e.name
864
866
  })) : []), Ie = g(() => _e.value.filter(
865
867
  (e) => (l.wastageTemplateIds ?? []).includes(e.value)
866
- )), Je = g(() => d.enableClosingTemplate && l.mode === W.CREATE && p.value.length > 0 ? p.value.map((e) => ({
868
+ )), Je = g(() => c.enableClosingTemplate && l.mode === j.CREATE && m.value.length > 0 ? m.value.map((e) => ({
867
869
  label: e.name || "Template",
868
870
  value: e._id || "template_" + e.name
869
871
  })) : []), Qe = g(() => Je.value.filter(
@@ -871,7 +873,7 @@ const zn = /* @__PURE__ */ ke({
871
873
  ));
872
874
  function Ct() {
873
875
  _.open({
874
- title: u("inventory.ingredient.purchaseOrderTemplates.selectTitle"),
876
+ title: d("inventory.ingredient.purchaseOrderTemplates.selectTitle"),
875
877
  closeButton: !0,
876
878
  contentComponent: He,
877
879
  contentComponentProps: {
@@ -879,11 +881,11 @@ const zn = /* @__PURE__ */ ke({
879
881
  items: Te.value
880
882
  },
881
883
  primaryActions: {
882
- text: u("common.confirm"),
884
+ text: d("common.confirm"),
883
885
  close: !0
884
886
  },
885
887
  secondaryActions: {
886
- text: u("common.cancel"),
888
+ text: d("common.cancel"),
887
889
  close: !0,
888
890
  variant: "tertiary"
889
891
  }
@@ -893,7 +895,7 @@ const zn = /* @__PURE__ */ ke({
893
895
  }
894
896
  function Ft() {
895
897
  _.open({
896
- title: u("inventory.ingredient.wastageTemplates.selectTitle"),
898
+ title: d("inventory.ingredient.wastageTemplates.selectTitle"),
897
899
  closeButton: !0,
898
900
  contentComponent: He,
899
901
  contentComponentProps: {
@@ -901,11 +903,11 @@ const zn = /* @__PURE__ */ ke({
901
903
  items: _e.value
902
904
  },
903
905
  primaryActions: {
904
- text: u("common.confirm"),
906
+ text: d("common.confirm"),
905
907
  close: !0
906
908
  },
907
909
  secondaryActions: {
908
- text: u("common.cancel"),
910
+ text: d("common.cancel"),
909
911
  close: !0,
910
912
  variant: "tertiary"
911
913
  }
@@ -915,7 +917,7 @@ const zn = /* @__PURE__ */ ke({
915
917
  }
916
918
  function At() {
917
919
  _.open({
918
- title: u("inventory.ingredient.closingTemplates.selectTitle"),
920
+ title: d("inventory.ingredient.closingTemplates.selectTitle"),
919
921
  closeButton: !0,
920
922
  contentComponent: He,
921
923
  contentComponentProps: {
@@ -923,11 +925,11 @@ const zn = /* @__PURE__ */ ke({
923
925
  items: Je.value
924
926
  },
925
927
  primaryActions: {
926
- text: u("common.confirm"),
928
+ text: d("common.confirm"),
927
929
  close: !0
928
930
  },
929
931
  secondaryActions: {
930
- text: u("common.cancel"),
932
+ text: d("common.cancel"),
931
933
  close: !0,
932
934
  variant: "tertiary"
933
935
  }
@@ -941,53 +943,53 @@ const zn = /* @__PURE__ */ ke({
941
943
  };
942
944
  }
943
945
  return (e, t) => {
944
- const b = S("FmTextField"), I = S("FmLabel"), Y = S("FmField"), D = S("FmIcon"), se = S("FmMenuHeader"), re = S("FmMenuDivider"), Se = S("FmMenuItem"), $t = S("FmMenu"), Ze = S("FmFormGroup"), Mt = S("FmSelect"), et = S("FmSwitch"), tt = S("FmStepperField"), De = S("FmButton"), Ne = S("FmChip"), Ut = S("FmForm");
945
- return c(), j(Ut, {
946
+ const b = C("FmTextField"), I = C("FmLabel"), H = C("FmField"), B = C("FmIcon"), se = C("FmMenuHeader"), re = C("FmMenuDivider"), Se = C("FmMenuItem"), $t = C("FmMenu"), Ze = C("FmFormGroup"), Mt = C("FmSelect"), et = C("FmSwitch"), tt = C("FmStepperField"), Be = C("FmButton"), Ne = C("FmChip"), Ut = C("FmForm");
947
+ return p(), Y(Ut, {
946
948
  disabled: e.disabled,
947
949
  ref_key: "formRef",
948
- ref: H,
950
+ ref: q,
949
951
  class: "flex flex-col gap-32",
950
952
  onValidationSuccess: ve
951
953
  }, {
952
954
  default: x(() => {
953
955
  var nt, ot, lt, at;
954
956
  return [
955
- n("div", Ln, [
956
- n("div", jn, [
957
- s(Ce, {
957
+ n("div", jn, [
958
+ n("div", Wn, [
959
+ r(Ce, {
958
960
  "tooltip-message": "This field is managed by NetSuite",
959
961
  "tooltip-z-index": 50,
960
- label: o(u)("inventory.ingredient.code"),
962
+ label: o(d)("inventory.ingredient.code"),
961
963
  "model-value": le.value,
962
964
  "onUpdate:modelValue": t[1] || (t[1] = (T) => le.value = T),
963
965
  locked: f.value,
964
966
  disabled: e.disabled
965
967
  }, {
966
968
  default: x(() => [
967
- s(b, {
968
- label: o(u)("inventory.ingredient.code"),
969
+ r(b, {
970
+ label: o(d)("inventory.ingredient.code"),
969
971
  "model-value": le.value,
970
972
  "onUpdate:modelValue": t[0] || (t[0] = (T) => le.value = T),
971
- rules: [o(Le)(), o(on)($e.value, Me.value)],
973
+ rules: [o(Le)(), o(sn)($e.value, Me.value)],
972
974
  "label-mark": "required"
973
975
  }, null, 8, ["label", "model-value", "rules"])
974
976
  ]),
975
977
  _: 1
976
978
  }, 8, ["label", "model-value", "locked", "disabled"])
977
979
  ]),
978
- n("div", Wn, [
979
- s(Ce, {
980
+ n("div", qn, [
981
+ r(Ce, {
980
982
  "tooltip-message": "This field is managed by NetSuite",
981
983
  "tooltip-z-index": 50,
982
- label: o(u)("inventory.ingredient.name"),
984
+ label: o(d)("inventory.ingredient.name"),
983
985
  "model-value": ae.value,
984
986
  "onUpdate:modelValue": t[3] || (t[3] = (T) => ae.value = T),
985
987
  locked: f.value,
986
988
  disabled: e.disabled
987
989
  }, {
988
990
  default: x(() => [
989
- s(b, {
990
- label: o(u)("inventory.ingredient.name"),
991
+ r(b, {
992
+ label: o(d)("inventory.ingredient.name"),
991
993
  "model-value": ae.value,
992
994
  "onUpdate:modelValue": t[2] || (t[2] = (T) => ae.value = T),
993
995
  rules: [o(Le)()],
@@ -998,30 +1000,30 @@ const zn = /* @__PURE__ */ ke({
998
1000
  }, 8, ["label", "model-value", "locked", "disabled"])
999
1001
  ])
1000
1002
  ]),
1001
- s(Ce, {
1003
+ r(Ce, {
1002
1004
  "tooltip-message": "This field is managed by NetSuite",
1003
1005
  "tooltip-z-index": 50,
1004
- label: o(u)("inventory.ingredient.unit"),
1006
+ label: o(d)("inventory.ingredient.unit"),
1005
1007
  "helper-text": (nt = e.modelValue) != null && nt.trackingMeasurement ? `Base unit: ${(lt = (ot = e.modelValue) == null ? void 0 : ot.unit) == null ? void 0 : lt.name}` : void 0,
1006
1008
  "model-value": (at = ye.value) == null ? void 0 : at.name,
1007
1009
  locked: f.value,
1008
1010
  disabled: e.disabled
1009
1011
  }, {
1010
1012
  default: x(() => [
1011
- s(Ze, {
1013
+ r(Ze, {
1012
1014
  "model-value": ye.value,
1013
1015
  rules: [o(Le)()],
1014
1016
  "label-mark": "required"
1015
1017
  }, {
1016
1018
  label: x(() => [
1017
- s(I, {
1018
- label: o(u)("inventory.ingredient.unit")
1019
+ r(I, {
1020
+ label: o(d)("inventory.ingredient.unit")
1019
1021
  }, null, 8, ["label"])
1020
1022
  ]),
1021
1023
  default: x(({ invalid: T }) => [
1022
- s($t, null, {
1024
+ r($t, null, {
1023
1025
  "menu-button": x(() => [
1024
- s(Y, {
1026
+ r(H, {
1025
1027
  class: ie([
1026
1028
  "fm-typo-en-body-lg-400",
1027
1029
  {
@@ -1042,14 +1044,14 @@ const zn = /* @__PURE__ */ ke({
1042
1044
  }, 1032, ["class", "invalid"])
1043
1045
  ]),
1044
1046
  default: x(() => [
1045
- n("div", qn, [
1046
- s(b, {
1047
+ n("div", Hn, [
1048
+ r(b, {
1047
1049
  modelValue: y.value,
1048
1050
  "onUpdate:modelValue": t[4] || (t[4] = (X) => y.value = X),
1049
1051
  placeholder: "Filter options"
1050
1052
  }, {
1051
1053
  prepend: x(() => [
1052
- s(D, { name: "search" })
1054
+ r(B, { name: "search" })
1053
1055
  ]),
1054
1056
  _: 1
1055
1057
  }, 8, ["modelValue"]),
@@ -1057,17 +1059,17 @@ const zn = /* @__PURE__ */ ke({
1057
1059
  class: "overflow-x-hidden overflow-y-auto max-h-[300px]",
1058
1060
  onVnodeMounted: Ue
1059
1061
  }, [
1060
- (c(!0), V(ee, null, de(G.value, (X, Pt) => (c(), V(ee, { key: Pt }, [
1061
- X.displayAsSection ? (c(), V(ee, { key: 0 }, [
1062
- s(se, {
1062
+ (p(!0), V(ee, null, de(G.value, (X, Pt) => (p(), V(ee, { key: Pt }, [
1063
+ X.displayAsSection ? (p(), V(ee, { key: 0 }, [
1064
+ r(se, {
1063
1065
  label: X.label
1064
1066
  }, null, 8, ["label"]),
1065
- s(re)
1066
- ], 64)) : (c(), j(Se, {
1067
+ r(re)
1068
+ ], 64)) : (p(), Y(Se, {
1067
1069
  key: 1,
1068
1070
  label: X.label,
1069
1071
  "model-value": E(X),
1070
- onClick: (yl) => v(X.value),
1072
+ onClick: (bl) => v(X.value),
1071
1073
  "x-should-scroll-into": `${E(X)}`
1072
1074
  }, null, 8, ["label", "model-value", "onClick", "x-should-scroll-into"]))
1073
1075
  ], 64))), 128))
@@ -1082,165 +1084,160 @@ const zn = /* @__PURE__ */ ke({
1082
1084
  ]),
1083
1085
  _: 1
1084
1086
  }, 8, ["label", "helper-text", "model-value", "locked", "disabled"]),
1085
- o(d).enableTotalCost ? (c(), j(Ce, {
1087
+ n("div", Yn, [
1088
+ r(Ce, {
1089
+ "tooltip-message": "This field is managed by NetSuite",
1090
+ "tooltip-z-index": 50,
1091
+ label: o(d)("inventory.ingredient.valuationMethod.title"),
1092
+ "model-value": o(d)("inventory.ingredient.valuationMethod." + ce.value),
1093
+ locked: f.value,
1094
+ disabled: e.disabled
1095
+ }, {
1096
+ label: x(() => [
1097
+ n("div", Kn, [
1098
+ r(I, {
1099
+ label: o(d)("inventory.ingredient.valuationMethod.title")
1100
+ }, null, 8, ["label"]),
1101
+ r(ke, {
1102
+ tier: "premium",
1103
+ category: "premium",
1104
+ "feature-key": "total-cost"
1105
+ })
1106
+ ])
1107
+ ]),
1108
+ default: x(() => [
1109
+ r(Mt, {
1110
+ class: "col-span-2",
1111
+ label: o(d)("inventory.ingredient.valuationMethod.title"),
1112
+ "model-value": ce.value,
1113
+ "onUpdate:modelValue": t[5] || (t[5] = (T) => ce.value = T),
1114
+ items: J.value
1115
+ }, null, 8, ["label", "model-value", "items"])
1116
+ ]),
1117
+ _: 1
1118
+ }, 8, ["label", "model-value", "locked", "disabled"]),
1119
+ r(Ce, {
1120
+ "tooltip-message": "This field is managed by NetSuite",
1121
+ "tooltip-z-index": 50,
1122
+ "model-value": `${o(jt)()} ${fe.value}`,
1123
+ locked: f.value,
1124
+ "append-text": `/ ${be.value}`,
1125
+ disabled: e.disabled
1126
+ }, {
1127
+ label: x(() => [
1128
+ n("div", Gn, [
1129
+ r(I, {
1130
+ label: o(d)("inventory.ingredient.pricePerUnit")
1131
+ }, null, 8, ["label"]),
1132
+ r(ke, {
1133
+ tier: "premium",
1134
+ category: "premium",
1135
+ "feature-key": "total-cost"
1136
+ })
1137
+ ])
1138
+ ]),
1139
+ default: x(() => [
1140
+ r(b, {
1141
+ "model-value": fe.value,
1142
+ "onUpdate:modelValue": t[6] || (t[6] = (T) => fe.value = T),
1143
+ rules: [o(De)(0), o(rn)(4)]
1144
+ }, {
1145
+ label: x(() => [
1146
+ n("div", Jn, [
1147
+ r(I, {
1148
+ label: o(d)("inventory.ingredient.pricePerUnit")
1149
+ }, null, 8, ["label"])
1150
+ ])
1151
+ ]),
1152
+ prepend: x(() => {
1153
+ var T, X;
1154
+ return [
1155
+ n("div", Qn, $(o(ct)(((T = o(a).currentCountry) == null ? void 0 : T.value) ?? o(mt)) === "MYR" ? "RM" : o(ct)(((X = o(a).currentCountry) == null ? void 0 : X.value) ?? o(mt))), 1)
1156
+ ];
1157
+ }),
1158
+ append: x(() => [
1159
+ n("div", Xn, " / " + $(be.value), 1)
1160
+ ]),
1161
+ _: 1
1162
+ }, 8, ["model-value", "rules"])
1163
+ ]),
1164
+ _: 1
1165
+ }, 8, ["model-value", "locked", "append-text", "disabled"])
1166
+ ]),
1167
+ !f.value || N.value ? (p(), Y(Ln, {
1086
1168
  key: 0,
1087
- "tooltip-message": "This field is managed by NetSuite",
1088
- "tooltip-z-index": 50,
1089
- label: o(u)("inventory.ingredient.valuationMethod.title"),
1090
- "model-value": o(u)("inventory.ingredient.valuationMethod." + me.value),
1091
- locked: f.value,
1092
- disabled: e.disabled
1093
- }, {
1094
- label: x(() => [
1095
- n("div", Hn, [
1096
- s(I, {
1097
- label: o(u)("inventory.ingredient.valuationMethod.title")
1098
- }, null, 8, ["label"]),
1099
- s(xe, {
1100
- tier: "premium",
1101
- category: "premium",
1102
- "feature-key": "total-cost"
1103
- })
1104
- ])
1105
- ]),
1106
- default: x(() => [
1107
- s(Mt, {
1108
- class: "col-span-2",
1109
- label: o(u)("inventory.ingredient.valuationMethod.title"),
1110
- "model-value": me.value,
1111
- "onUpdate:modelValue": t[5] || (t[5] = (T) => me.value = T),
1112
- items: J.value
1113
- }, null, 8, ["label", "model-value", "items"])
1114
- ]),
1115
- _: 1
1116
- }, 8, ["label", "model-value", "locked", "disabled"])) : N("", !0),
1117
- o(d).enableTotalCost ? (c(), j(Ce, {
1118
- key: 1,
1119
- "tooltip-message": "This field is managed by NetSuite",
1120
- "tooltip-z-index": 50,
1121
- "model-value": `${o(jt)()} ${fe.value}`,
1122
- locked: f.value,
1123
- "append-text": `/ ${be.value}`,
1124
- disabled: e.disabled
1125
- }, {
1126
- label: x(() => [
1127
- n("div", Yn, [
1128
- s(I, {
1129
- label: o(u)("inventory.ingredient.pricePerUnit")
1130
- }, null, 8, ["label"]),
1131
- s(xe, {
1132
- tier: "premium",
1133
- category: "premium",
1134
- "feature-key": "total-cost"
1135
- })
1136
- ])
1137
- ]),
1138
- default: x(() => [
1139
- s(b, {
1140
- "model-value": fe.value,
1141
- "onUpdate:modelValue": t[6] || (t[6] = (T) => fe.value = T),
1142
- rules: [o(Oe)(0), o(ln)(4)]
1143
- }, {
1144
- label: x(() => [
1145
- n("div", Kn, [
1146
- s(I, {
1147
- label: o(u)("inventory.ingredient.pricePerUnit")
1148
- }, null, 8, ["label"]),
1149
- s(xe, {
1150
- tier: "premium",
1151
- category: "premium",
1152
- "feature-key": "total-cost"
1153
- })
1154
- ])
1155
- ]),
1156
- prepend: x(() => {
1157
- var T, X;
1158
- return [
1159
- n("div", Gn, $(o(mt)(((T = o(a).currentCountry) == null ? void 0 : T.value) ?? o(ct)) === "MYR" ? "RM" : o(mt)(((X = o(a).currentCountry) == null ? void 0 : X.value) ?? o(ct))), 1)
1160
- ];
1161
- }),
1162
- append: x(() => [
1163
- n("div", Jn, " / " + $(be.value), 1)
1164
- ]),
1165
- _: 1
1166
- }, 8, ["model-value", "rules"])
1167
- ]),
1168
- _: 1
1169
- }, 8, ["model-value", "locked", "append-text", "disabled"])) : N("", !0),
1170
- !f.value || z.value ? (c(), j(zn, {
1171
- key: 2,
1172
- "model-value": z.value,
1173
- "onUpdate:modelValue": t[7] || (t[7] = (T) => z.value = T),
1169
+ "model-value": N.value,
1170
+ "onUpdate:modelValue": t[7] || (t[7] = (T) => N.value = T),
1174
1171
  "root-value": e.modelValue,
1175
1172
  readonly: f.value
1176
- }, null, 8, ["model-value", "root-value", "readonly"])) : N("", !0),
1177
- e.mode !== o(W).CREATE ? (c(), V("div", Qn, [
1178
- s(et, {
1179
- label: o(u)("inventory.ingredient.status.inactive"),
1173
+ }, null, 8, ["model-value", "root-value", "readonly"])) : L("", !0),
1174
+ e.mode !== o(j).CREATE ? (p(), V("div", Zn, [
1175
+ r(et, {
1176
+ label: o(d)("inventory.ingredient.status.inactive"),
1180
1177
  "model-value": te.value,
1181
1178
  "onUpdate:modelValue": t[8] || (t[8] = (T) => te.value = T),
1182
1179
  "label-placement": "right",
1183
1180
  disabled: f.value
1184
1181
  }, null, 8, ["label", "model-value", "disabled"]),
1185
- n("div", Xn, [
1186
- n("div", Zn, $(o(u)("inventory.ingredient.status.preventFromOrder")), 1)
1182
+ n("div", eo, [
1183
+ n("div", to, $(o(d)("inventory.ingredient.status.preventFromOrder")), 1)
1187
1184
  ])
1188
- ])) : N("", !0),
1189
- e.mode !== o(W).CREATE ? (c(), V("div", eo, [
1185
+ ])) : L("", !0),
1186
+ e.mode !== o(j).CREATE ? (p(), V("div", no, [
1190
1187
  n("div", null, [
1191
- s(et, {
1192
- label: o(u)("inventory.ingredient.bindedItems.title"),
1193
- modelValue: O.value,
1194
- "onUpdate:modelValue": t[9] || (t[9] = (T) => O.value = T),
1188
+ r(et, {
1189
+ label: o(d)("inventory.ingredient.bindedItems.title"),
1190
+ modelValue: D.value,
1191
+ "onUpdate:modelValue": t[9] || (t[9] = (T) => D.value = T),
1195
1192
  "label-placement": "right"
1196
1193
  }, null, 8, ["label", "modelValue"])
1197
1194
  ]),
1198
- O.value && K.value.length ? (c(), j(qe, {
1195
+ D.value && K.value.length ? (p(), Y(qe, {
1199
1196
  key: 0,
1200
- name: o(u)("inventory.ingredient.bindedItems.ingredient"),
1197
+ name: o(d)("inventory.ingredient.bindedItems.ingredient"),
1201
1198
  bindings: K.value
1202
- }, null, 8, ["name", "bindings"])) : N("", !0),
1203
- O.value && L.value.length ? (c(), j(qe, {
1199
+ }, null, 8, ["name", "bindings"])) : L("", !0),
1200
+ D.value && z.value.length ? (p(), Y(qe, {
1204
1201
  key: 1,
1205
- name: o(u)("inventory.ingredient.bindedItems.recipe"),
1206
- bindings: L.value
1207
- }, null, 8, ["name", "bindings"])) : N("", !0),
1208
- O.value && ge.value.length ? (c(), j(qe, {
1202
+ name: o(d)("inventory.ingredient.bindedItems.recipe"),
1203
+ bindings: z.value
1204
+ }, null, 8, ["name", "bindings"])) : L("", !0),
1205
+ D.value && ge.value.length ? (p(), Y(qe, {
1209
1206
  key: 2,
1210
- name: o(u)("inventory.ingredient.bindedItems.menu"),
1207
+ name: o(d)("inventory.ingredient.bindedItems.menu"),
1211
1208
  bindings: ge.value
1212
- }, null, 8, ["name", "bindings"])) : N("", !0)
1213
- ])) : N("", !0),
1214
- n("div", to, [
1215
- n("div", no, [
1216
- n("div", oo, [
1217
- n("div", lo, $(o(u)("inventory.ingredient.threshold.title")), 1),
1218
- s(xe, {
1209
+ }, null, 8, ["name", "bindings"])) : L("", !0)
1210
+ ])) : L("", !0),
1211
+ n("div", oo, [
1212
+ n("div", lo, [
1213
+ n("div", ao, [
1214
+ n("div", so, $(o(d)("inventory.ingredient.threshold.title")), 1),
1215
+ r(ke, {
1219
1216
  tier: "standard",
1220
1217
  category: "beta"
1221
1218
  })
1222
1219
  ]),
1223
- n("div", ao, $(o(u)("inventory.ingredient.threshold.subtitle")), 1)
1220
+ n("div", ro, $(o(d)("inventory.ingredient.threshold.subtitle")), 1)
1224
1221
  ]),
1225
- n("div", so, [
1226
- s(Ze, {
1227
- "model-value": { low: he.value, mid: ce.value },
1222
+ n("div", io, [
1223
+ r(Ze, {
1224
+ "model-value": { low: he.value, mid: me.value },
1228
1225
  rules: [Et()]
1229
1226
  }, null, 8, ["model-value", "rules"]),
1230
- n("div", ro, [
1231
- n("div", io, [
1232
- n("div", uo, [
1233
- s(je, {
1227
+ n("div", uo, [
1228
+ n("div", co, [
1229
+ n("div", mo, [
1230
+ r(je, {
1234
1231
  days: he.value,
1235
1232
  level: o(We).low
1236
1233
  }, null, 8, ["days", "level"])
1237
1234
  ]),
1238
- n("div", mo, [
1239
- n("div", co, $(o(u)("inventory.ingredient.threshold.whenRemaining")), 1),
1240
- s(tt, {
1235
+ n("div", po, [
1236
+ n("div", vo, $(o(d)("inventory.ingredient.threshold.whenRemaining")), 1),
1237
+ r(tt, {
1241
1238
  modelValue: he.value,
1242
1239
  "onUpdate:modelValue": t[10] || (t[10] = (T) => he.value = T),
1243
- rules: [o(Oe)(0)]
1240
+ rules: [o(De)(0)]
1244
1241
  }, {
1245
1242
  append: x(() => t[13] || (t[13] = [
1246
1243
  n("div", {
@@ -1261,19 +1258,19 @@ const zn = /* @__PURE__ */ ke({
1261
1258
  style: { transform: "translate(-50%, -50%)", left: "50%", top: "24px" }
1262
1259
  }, " < ")
1263
1260
  ], -1)),
1264
- n("div", po, [
1265
- n("div", vo, [
1266
- s(je, {
1267
- days: ce.value,
1261
+ n("div", fo, [
1262
+ n("div", yo, [
1263
+ r(je, {
1264
+ days: me.value,
1268
1265
  level: o(We).mid
1269
1266
  }, null, 8, ["days", "level"])
1270
1267
  ]),
1271
- n("div", fo, [
1272
- n("div", yo, $(o(u)("inventory.ingredient.threshold.whenRemaining")), 1),
1273
- s(tt, {
1274
- modelValue: ce.value,
1275
- "onUpdate:modelValue": t[11] || (t[11] = (T) => ce.value = T),
1276
- rules: [o(Oe)(0)]
1268
+ n("div", go, [
1269
+ n("div", bo, $(o(d)("inventory.ingredient.threshold.whenRemaining")), 1),
1270
+ r(tt, {
1271
+ modelValue: me.value,
1272
+ "onUpdate:modelValue": t[11] || (t[11] = (T) => me.value = T),
1273
+ rules: [o(De)(0)]
1277
1274
  }, {
1278
1275
  append: x(() => t[14] || (t[14] = [
1279
1276
  n("div", {
@@ -1294,32 +1291,32 @@ const zn = /* @__PURE__ */ ke({
1294
1291
  style: { transform: "translate(-50%, -50%)", left: "50%", top: "24px" }
1295
1292
  }, " < ")
1296
1293
  ], -1)),
1297
- n("div", go, [
1298
- n("div", bo, [
1299
- s(je, {
1300
- days: ce.value + 1,
1294
+ n("div", ho, [
1295
+ n("div", _o, [
1296
+ r(je, {
1297
+ days: me.value + 1,
1301
1298
  level: o(We).high
1302
1299
  }, null, 8, ["days", "level"])
1303
1300
  ]),
1304
- n("div", ho, [
1305
- n("div", _o, $(o(u)("inventory.ingredient.threshold.stockIsStaple")), 1)
1301
+ n("div", xo, [
1302
+ n("div", ko, $(o(d)("inventory.ingredient.threshold.stockIsStaple")), 1)
1306
1303
  ])
1307
1304
  ])
1308
1305
  ])
1309
1306
  ])
1310
1307
  ]),
1311
- o(d).mustUsePoTemplate && e.mode === o(W).CREATE ? (c(), V("div", xo, [
1312
- n("div", ko, [
1313
- n("div", wo, [
1314
- n("div", To, [
1315
- n("div", Vo, $(o(u)("inventory.ingredient.purchaseOrderTemplates.title")), 1),
1316
- s(xe, {
1308
+ o(c).mustUsePoTemplate && e.mode === o(j).CREATE ? (p(), V("div", wo, [
1309
+ n("div", To, [
1310
+ n("div", Vo, [
1311
+ n("div", Io, [
1312
+ n("div", So, $(o(d)("inventory.ingredient.purchaseOrderTemplates.title")), 1),
1313
+ r(ke, {
1317
1314
  tier: "premium",
1318
1315
  category: "premium",
1319
1316
  "feature-key": "purchase-order-template"
1320
1317
  })
1321
1318
  ]),
1322
- s(De, {
1319
+ r(Be, {
1323
1320
  variant: "secondary",
1324
1321
  "text-color": "primary",
1325
1322
  "border-color": "primary",
@@ -1327,31 +1324,31 @@ const zn = /* @__PURE__ */ ke({
1327
1324
  onClick: Ct
1328
1325
  })
1329
1326
  ]),
1330
- n("div", Io, $(o(u)("inventory.ingredient.purchaseOrderTemplates.description")), 1)
1327
+ n("div", Co, $(o(d)("inventory.ingredient.purchaseOrderTemplates.description")), 1)
1331
1328
  ]),
1332
- Ve.value.length > 0 ? (c(), V("div", So, [
1333
- n("div", Co, [
1334
- (c(!0), V(ee, null, de(Ve.value, (T) => (c(), j(Ne, {
1329
+ Ve.value.length > 0 ? (p(), V("div", Fo, [
1330
+ n("div", Ao, [
1331
+ (p(!0), V(ee, null, de(Ve.value, (T) => (p(), Y(Ne, {
1335
1332
  key: T.value,
1336
1333
  label: T.label,
1337
1334
  variant: "info",
1338
1335
  compact: ""
1339
1336
  }, null, 8, ["label"]))), 128))
1340
1337
  ])
1341
- ])) : N("", !0)
1342
- ])) : N("", !0),
1343
- o(d).enableWastageTemplate && e.mode === o(W).CREATE ? (c(), V("div", Fo, [
1344
- n("div", Ao, [
1345
- n("div", Eo, [
1346
- n("div", $o, [
1347
- n("div", Mo, $(o(u)("inventory.ingredient.wastageTemplates.title")), 1),
1348
- s(xe, {
1338
+ ])) : L("", !0)
1339
+ ])) : L("", !0),
1340
+ o(c).enableWastageTemplate && e.mode === o(j).CREATE ? (p(), V("div", Eo, [
1341
+ n("div", $o, [
1342
+ n("div", Mo, [
1343
+ n("div", Uo, [
1344
+ n("div", Po, $(o(d)("inventory.ingredient.wastageTemplates.title")), 1),
1345
+ r(ke, {
1349
1346
  tier: "premium",
1350
1347
  category: "premium",
1351
1348
  "feature-key": "wastage-template"
1352
1349
  })
1353
1350
  ]),
1354
- s(De, {
1351
+ r(Be, {
1355
1352
  variant: "secondary",
1356
1353
  "text-color": "primary",
1357
1354
  "border-color": "primary",
@@ -1359,31 +1356,31 @@ const zn = /* @__PURE__ */ ke({
1359
1356
  onClick: Ft
1360
1357
  })
1361
1358
  ]),
1362
- n("div", Uo, $(o(u)("inventory.ingredient.wastageTemplates.description")), 1)
1359
+ n("div", Ro, $(o(d)("inventory.ingredient.wastageTemplates.description")), 1)
1363
1360
  ]),
1364
- Ie.value.length > 0 ? (c(), V("div", Po, [
1365
- n("div", Ro, [
1366
- (c(!0), V(ee, null, de(Ie.value, (T) => (c(), j(Ne, {
1361
+ Ie.value.length > 0 ? (p(), V("div", Do, [
1362
+ n("div", Oo, [
1363
+ (p(!0), V(ee, null, de(Ie.value, (T) => (p(), Y(Ne, {
1367
1364
  key: T.value,
1368
1365
  label: T.label,
1369
1366
  variant: "info",
1370
1367
  compact: ""
1371
1368
  }, null, 8, ["label"]))), 128))
1372
1369
  ])
1373
- ])) : N("", !0)
1374
- ])) : N("", !0),
1375
- o(d).enableClosingTemplate && e.mode === o(W).CREATE ? (c(), V("div", Oo, [
1376
- n("div", Bo, [
1377
- n("div", Do, [
1378
- n("div", No, [
1379
- n("div", zo, $(o(u)("inventory.ingredient.closingTemplates.title")), 1),
1380
- s(xe, {
1370
+ ])) : L("", !0)
1371
+ ])) : L("", !0),
1372
+ o(c).enableClosingTemplate && e.mode === o(j).CREATE ? (p(), V("div", Bo, [
1373
+ n("div", No, [
1374
+ n("div", zo, [
1375
+ n("div", Lo, [
1376
+ n("div", jo, $(o(d)("inventory.ingredient.closingTemplates.title")), 1),
1377
+ r(ke, {
1381
1378
  tier: "premium",
1382
1379
  category: "premium",
1383
1380
  "feature-key": "closing-template"
1384
1381
  })
1385
1382
  ]),
1386
- s(De, {
1383
+ r(Be, {
1387
1384
  variant: "secondary",
1388
1385
  "text-color": "primary",
1389
1386
  "border-color": "primary",
@@ -1391,21 +1388,21 @@ const zn = /* @__PURE__ */ ke({
1391
1388
  onClick: At
1392
1389
  })
1393
1390
  ]),
1394
- n("div", Lo, $(o(u)("inventory.ingredient.closingTemplates.description")), 1)
1391
+ n("div", Wo, $(o(d)("inventory.ingredient.closingTemplates.description")), 1)
1395
1392
  ]),
1396
- Qe.value.length > 0 ? (c(), V("div", jo, [
1397
- n("div", Wo, [
1398
- (c(!0), V(ee, null, de(Qe.value, (T) => (c(), j(Ne, {
1393
+ Qe.value.length > 0 ? (p(), V("div", qo, [
1394
+ n("div", Ho, [
1395
+ (p(!0), V(ee, null, de(Qe.value, (T) => (p(), Y(Ne, {
1399
1396
  key: T.value,
1400
1397
  label: T.label,
1401
1398
  variant: "info",
1402
1399
  compact: ""
1403
1400
  }, null, 8, ["label"]))), 128))
1404
1401
  ])
1405
- ])) : N("", !0)
1406
- ])) : N("", !0),
1402
+ ])) : L("", !0)
1403
+ ])) : L("", !0),
1407
1404
  n("div", null, [
1408
- s(yn, {
1405
+ r(gn, {
1409
1406
  entity: "inventorySku",
1410
1407
  modelValue: Q.value,
1411
1408
  "onUpdate:modelValue": t[12] || (t[12] = (T) => Q.value = T)
@@ -1417,50 +1414,50 @@ const zn = /* @__PURE__ */ ke({
1417
1414
  }, 8, ["disabled"]);
1418
1415
  };
1419
1416
  }
1420
- }), Ho = { class: "flex flex-col gap-32" }, Yo = {
1417
+ }), Ko = { class: "flex flex-col gap-32" }, Go = {
1421
1418
  key: 0,
1422
1419
  class: "flex justify-between items-center"
1423
- }, Ko = { class: "flex gap-4" }, Go = /* @__PURE__ */ ke({
1420
+ }, Jo = { class: "flex gap-4" }, Qo = /* @__PURE__ */ xe({
1424
1421
  __name: "IngredientDialog",
1425
1422
  props: {
1426
1423
  show: { type: Boolean },
1427
1424
  sku: {},
1428
- mode: { default: W.READ }
1425
+ mode: { default: j.READ }
1429
1426
  },
1430
1427
  emits: ["update:show"],
1431
- setup(q) {
1432
- const h = q, k = Fe(), u = Tt(), _ = Ee(), C = Vt(), A = It(), U = St(), l = Ae(), { t: i } = pe(), m = ft(h, "show"), a = ft(h, "sku"), d = P([]), r = P([]), f = P([]), w = g(
1428
+ setup(W) {
1429
+ const h = W, k = Fe(), d = Tt(), _ = Ee(), S = Vt(), A = It(), U = St(), l = Ae(), { t: i } = pe(), u = ft(h, "show"), a = ft(h, "sku"), c = P([]), s = P([]), f = P([]), w = g(
1433
1430
  () => {
1434
1431
  var y;
1435
1432
  return _.isEnabled && _.netSuiteItemBySkuId.has((y = h.sku) == null ? void 0 : y._id);
1436
1433
  }
1437
1434
  ), F = g(() => {
1438
1435
  switch (h.mode) {
1439
- case W.READ:
1436
+ case j.READ:
1440
1437
  return "";
1441
- case W.UPDATE:
1438
+ case j.UPDATE:
1442
1439
  return i("inventory.ingredient.update.title");
1443
- case W.CREATE:
1440
+ case j.CREATE:
1444
1441
  return i("inventory.ingredient.create.title");
1445
1442
  }
1446
1443
  return "";
1447
- }), p = g(() => {
1444
+ }), m = g(() => {
1448
1445
  switch (h.mode) {
1449
- case W.READ:
1446
+ case j.READ:
1450
1447
  return "";
1451
- case W.UPDATE:
1448
+ case j.UPDATE:
1452
1449
  return i("common.save");
1453
- case W.CREATE:
1450
+ case j.CREATE:
1454
1451
  return i("common.add");
1455
1452
  }
1456
1453
  return "";
1457
- }), B = P(), R = P(!1);
1454
+ }), O = P(), R = P(!1);
1458
1455
  async function ve() {
1459
1456
  R.value = !0;
1460
1457
  try {
1461
1458
  await k.createSku(a.value);
1462
1459
  const y = k.skuByCode[a.value.code];
1463
- u.enablePoTemplate && d.value.length > 0 && await ue(y), u.enableWastageTemplate && r.value.length > 0 && await oe(y), u.enableClosingTemplate && f.value.length > 0 && await le(y), m.value = !1, l.open({
1460
+ d.enablePoTemplate && c.value.length > 0 && await ue(y), d.enableWastageTemplate && s.value.length > 0 && await oe(y), d.enableClosingTemplate && f.value.length > 0 && await le(y), u.value = !1, l.open({
1464
1461
  title: i("inventory.common.success"),
1465
1462
  message: i("inventory.ingredient.create.success", { name: a.value.name }),
1466
1463
  type: "success"
@@ -1478,7 +1475,7 @@ const zn = /* @__PURE__ */ ke({
1478
1475
  async function ne() {
1479
1476
  R.value = !0;
1480
1477
  try {
1481
- await k.updateSku(a.value), R.value = !1, m.value = !1, l.open({
1478
+ await k.updateSku(a.value), R.value = !1, u.value = !1, l.open({
1482
1479
  title: i("inventory.common.success"),
1483
1480
  message: i("inventory.ingredient.update.success", { name: a.value.name }),
1484
1481
  type: "success"
@@ -1496,16 +1493,16 @@ const zn = /* @__PURE__ */ ke({
1496
1493
  async function ue(y) {
1497
1494
  var M, G, E, v;
1498
1495
  try {
1499
- for (const z of d.value) {
1500
- const J = await C.getTemplate(z);
1496
+ for (const N of c.value) {
1497
+ const J = await S.getTemplate(N);
1501
1498
  if (!J) {
1502
- console.warn(`Template with ID ${z} not found`);
1499
+ console.warn(`Template with ID ${N} not found`);
1503
1500
  continue;
1504
1501
  }
1505
1502
  if (!J.purchaseOrder.items.find(
1506
1503
  (Q) => Q.sku._id === y._id
1507
1504
  )) {
1508
- const Q = { amount: 1, precision: cn(y.unit) }, H = {
1505
+ const Q = { amount: 1, precision: dn(y.unit) }, q = {
1509
1506
  sku: y,
1510
1507
  name: y.name,
1511
1508
  code: y.code,
@@ -1513,29 +1510,29 @@ const zn = /* @__PURE__ */ ke({
1513
1510
  minimumQuantity: Q,
1514
1511
  quantityStep: Q,
1515
1512
  measurement: ((G = (M = y.unit) == null ? void 0 : M.measurements) == null ? void 0 : G[0]) || null
1516
- }, O = {
1513
+ }, D = {
1517
1514
  ...J,
1518
1515
  purchaseOrder: {
1519
1516
  ...J.purchaseOrder,
1520
- items: [...J.purchaseOrder.items, H]
1517
+ items: [...J.purchaseOrder.items, q]
1521
1518
  }
1522
1519
  };
1523
- (((E = O.purchaseOrder.supplier) == null ? void 0 : E.internal) === vt.enum.warehouse || ((v = O.purchaseOrder.supplier) == null ? void 0 : v.internal) === vt.enum.restaurant) && (O.purchaseOrder.items = O.purchaseOrder.items.map(
1524
- ({ totalCost: K, ...L }) => L
1525
- )), await C.updateTemplate(O), await new Promise((K) => setTimeout(K, 1e3));
1520
+ (((E = D.purchaseOrder.supplier) == null ? void 0 : E.internal) === vt.enum.warehouse || ((v = D.purchaseOrder.supplier) == null ? void 0 : v.internal) === vt.enum.restaurant) && (D.purchaseOrder.items = D.purchaseOrder.items.map(
1521
+ ({ totalCost: K, ...z }) => z
1522
+ )), await S.updateTemplate(D), await new Promise((K) => setTimeout(K, 1e3));
1526
1523
  }
1527
1524
  }
1528
- } catch (z) {
1525
+ } catch (N) {
1529
1526
  l.open({
1530
1527
  title: i("inventory.transfer.template.update.error"),
1531
1528
  message: i("inventory.transfer.template.update.errorMessage"),
1532
1529
  type: "error"
1533
- }), console.error("Error in updating transfer template", z);
1530
+ }), console.error("Error in updating transfer template", N);
1534
1531
  }
1535
1532
  }
1536
1533
  async function oe(y) {
1537
1534
  try {
1538
- for (const M of r.value) {
1535
+ for (const M of s.value) {
1539
1536
  const G = await A.getTemplate(M);
1540
1537
  if (!G) {
1541
1538
  console.warn(`Wastage Template with ID ${M} not found`);
@@ -1548,11 +1545,11 @@ const zn = /* @__PURE__ */ ke({
1548
1545
  code: y.code,
1549
1546
  type: "sku",
1550
1547
  disabledMeasurements: []
1551
- }, z = {
1548
+ }, N = {
1552
1549
  ...G,
1553
1550
  items: [...G.items, v]
1554
1551
  };
1555
- await A.updateTemplate(z), await new Promise((J) => setTimeout(J, 1e3));
1552
+ await A.updateTemplate(N), await new Promise((J) => setTimeout(J, 1e3));
1556
1553
  }
1557
1554
  }
1558
1555
  } catch (M) {
@@ -1574,11 +1571,11 @@ const zn = /* @__PURE__ */ ke({
1574
1571
  if (!G.items.find((v) => v.sku._id === y._id)) {
1575
1572
  const v = {
1576
1573
  sku: y
1577
- }, z = {
1574
+ }, N = {
1578
1575
  ...G,
1579
1576
  items: [...G.items, v]
1580
1577
  };
1581
- await U.updateTemplate(z), await new Promise((J) => setTimeout(J, 1e3));
1578
+ await U.updateTemplate(N), await new Promise((J) => setTimeout(J, 1e3));
1582
1579
  }
1583
1580
  }
1584
1581
  } catch (M) {
@@ -1591,77 +1588,77 @@ const zn = /* @__PURE__ */ ke({
1591
1588
  }
1592
1589
  function te() {
1593
1590
  var y, M;
1594
- (M = (y = B.value) == null ? void 0 : y.validateInputs) == null || M.call(y);
1591
+ (M = (y = O.value) == null ? void 0 : y.validateInputs) == null || M.call(y);
1595
1592
  }
1596
1593
  function ae() {
1597
1594
  switch (h.mode) {
1598
- case W.READ:
1595
+ case j.READ:
1599
1596
  return;
1600
- case W.UPDATE:
1597
+ case j.UPDATE:
1601
1598
  return ne();
1602
- case W.CREATE:
1599
+ case j.CREATE:
1603
1600
  return ve();
1604
1601
  }
1605
1602
  }
1606
1603
  function fe(y) {
1607
- d.value = y;
1604
+ c.value = y;
1608
1605
  }
1609
1606
  function ye(y) {
1610
- r.value = y;
1607
+ s.value = y;
1611
1608
  }
1612
1609
  function we(y) {
1613
1610
  f.value = y;
1614
1611
  }
1615
1612
  return (y, M) => {
1616
- const G = S("FmChip"), E = S("FmButton"), v = S("FmSideSheet");
1617
- return c(), j(v, {
1618
- "model-value": o(m),
1619
- "onUpdate:modelValue": M[3] || (M[3] = (z) => rt(m) ? m.value = z : null),
1613
+ const G = C("FmChip"), E = C("FmButton"), v = C("FmSideSheet");
1614
+ return p(), Y(v, {
1615
+ "model-value": o(u),
1616
+ "onUpdate:modelValue": M[3] || (M[3] = (N) => rt(u) ? u.value = N : null),
1620
1617
  header: F.value,
1621
1618
  "close-button": "",
1622
1619
  "dismiss-away": "",
1623
1620
  "max-width": 500
1624
1621
  }, {
1625
1622
  "side-sheet-footer": x(() => [
1626
- n("div", Ko, [
1627
- s(E, {
1623
+ n("div", Jo, [
1624
+ r(E, {
1628
1625
  loading: R.value,
1629
- label: p.value,
1626
+ label: m.value,
1630
1627
  onClick: te
1631
1628
  }, null, 8, ["loading", "label"]),
1632
- s(E, {
1629
+ r(E, {
1633
1630
  disabled: R.value,
1634
1631
  label: o(i)("common.close"),
1635
1632
  variant: "tertiary",
1636
- onClick: M[2] || (M[2] = (z) => m.value = !1)
1633
+ onClick: M[2] || (M[2] = (N) => u.value = !1)
1637
1634
  }, null, 8, ["disabled", "label"])
1638
1635
  ])
1639
1636
  ]),
1640
1637
  default: x(() => [
1641
- n("div", Ho, [
1642
- w.value ? (c(), V("div", Yo, [
1643
- s(G, {
1638
+ n("div", Ko, [
1639
+ w.value ? (p(), V("div", Go, [
1640
+ r(G, {
1644
1641
  label: "Managed by Netsuite",
1645
1642
  compact: ""
1646
1643
  }),
1647
- s(en, {
1644
+ r(tn, {
1648
1645
  readonly: "",
1649
1646
  sku: y.sku,
1650
1647
  settingOptions: o(_).skuSettingOptions
1651
1648
  }, null, 8, ["sku", "settingOptions"])
1652
- ])) : N("", !0),
1653
- s(qo, {
1649
+ ])) : L("", !0),
1650
+ r(Yo, {
1654
1651
  class: "w-full",
1655
1652
  ref_key: "hasValidationExpose",
1656
- ref: B,
1653
+ ref: O,
1657
1654
  modelValue: o(a),
1658
- "onUpdate:modelValue": M[0] || (M[0] = (z) => rt(a) ? a.value = z : null),
1655
+ "onUpdate:modelValue": M[0] || (M[0] = (N) => rt(a) ? a.value = N : null),
1659
1656
  mode: y.mode,
1660
1657
  disabled: R.value,
1661
- purchaseOrderTemplateIds: d.value,
1662
- wastageTemplateIds: r.value,
1658
+ purchaseOrderTemplateIds: c.value,
1659
+ wastageTemplateIds: s.value,
1663
1660
  closingTemplateIds: f.value,
1664
- "onClick:submit": M[1] || (M[1] = (z) => ae()),
1661
+ "onClick:submit": M[1] || (M[1] = (N) => ae()),
1665
1662
  "onUpdate:purchaseOrderTemplateIds": fe,
1666
1663
  "onUpdate:wastageTemplateIds": ye,
1667
1664
  "onUpdate:closingTemplateIds": we
@@ -1672,10 +1669,10 @@ const zn = /* @__PURE__ */ ke({
1672
1669
  }, 8, ["model-value", "header"]);
1673
1670
  };
1674
1671
  }
1675
- }), Jo = { class: "flex items-center gap-12 pl-8" }, Qo = { class: "flex flex-col" }, Xo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, Zo = {
1672
+ }), Xo = { class: "flex items-center gap-12 pl-8" }, Zo = { class: "flex flex-col" }, el = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, tl = {
1676
1673
  key: 0,
1677
1674
  class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
1678
- }, el = { key: 0 }, ht = /* @__PURE__ */ ke({
1675
+ }, nl = { key: 0 }, ht = /* @__PURE__ */ xe({
1679
1676
  __name: "ImportIngredientItem",
1680
1677
  props: {
1681
1678
  type: {},
@@ -1683,30 +1680,30 @@ const zn = /* @__PURE__ */ ke({
1683
1680
  name: {},
1684
1681
  errors: {}
1685
1682
  },
1686
- setup(q) {
1683
+ setup(W) {
1687
1684
  return (h, k) => {
1688
- const u = S("FmIcon"), _ = S("FmTooltip");
1689
- return c(), V("div", Jo, [
1685
+ const d = C("FmIcon"), _ = C("FmTooltip");
1686
+ return p(), V("div", Xo, [
1690
1687
  k[0] || (k[0] = n("div", null, "•", -1)),
1691
- n("div", Qo, [
1692
- n("div", Xo, [
1688
+ n("div", Zo, [
1689
+ n("div", el, [
1693
1690
  n("div", {
1694
1691
  class: ie({
1695
1692
  "text-fm-color-system-error-300": h.errors.length
1696
1693
  })
1697
1694
  }, [
1698
1695
  xt($(h.name) + " ", 1),
1699
- h.type === "create" ? (c(), V("span", Zo, "(new)")) : N("", !0)
1696
+ h.type === "create" ? (p(), V("span", tl, "(new)")) : L("", !0)
1700
1697
  ], 2),
1701
- h.errors.length ? (c(), V("div", el, [
1702
- s(_, { "z-index": 50 }, {
1698
+ h.errors.length ? (p(), V("div", nl, [
1699
+ r(_, { "z-index": 50 }, {
1703
1700
  content: x(() => [
1704
1701
  n("ol", null, [
1705
- (c(!0), V(ee, null, de(h.errors, (C, A) => (c(), V("li", { key: A }, $(C), 1))), 128))
1702
+ (p(!0), V(ee, null, de(h.errors, (S, A) => (p(), V("li", { key: A }, $(S), 1))), 128))
1706
1703
  ])
1707
1704
  ]),
1708
1705
  default: x(() => [
1709
- s(u, {
1706
+ r(d, {
1710
1707
  name: "error",
1711
1708
  size: "sm",
1712
1709
  color: "system-error-300"
@@ -1714,7 +1711,7 @@ const zn = /* @__PURE__ */ ke({
1714
1711
  ]),
1715
1712
  _: 1
1716
1713
  })
1717
- ])) : N("", !0)
1714
+ ])) : L("", !0)
1718
1715
  ]),
1719
1716
  n("div", {
1720
1717
  class: ie([
@@ -1729,79 +1726,79 @@ const zn = /* @__PURE__ */ ke({
1729
1726
  ]);
1730
1727
  };
1731
1728
  }
1732
- }), tl = { class: "flex flex-col gap-24" }, nl = { class: "fm-typo-en-body-md-400" }, ol = { class: "flex flex-col gap-8" }, ll = { class: "line-clamp-2 text-ellipsis break-all" }, al = {
1729
+ }), ol = { class: "flex flex-col gap-24" }, ll = { class: "fm-typo-en-body-md-400" }, al = { class: "flex flex-col gap-8" }, sl = { class: "line-clamp-2 text-ellipsis break-all" }, rl = {
1733
1730
  key: 2,
1734
1731
  class: "shrink-0"
1735
- }, sl = {
1732
+ }, il = {
1736
1733
  key: 0,
1737
1734
  class: "flex flex-col"
1738
- }, rl = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, il = {
1735
+ }, dl = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, ul = {
1739
1736
  key: 0,
1740
1737
  class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
1741
- }, dl = { class: "fm-typo-en-body-lg-600" }, ul = /* @__PURE__ */ ke({
1738
+ }, cl = { class: "fm-typo-en-body-lg-600" }, ml = /* @__PURE__ */ xe({
1742
1739
  __name: "ImportIngredients",
1743
- setup(q) {
1744
- const h = P(null), k = Ht(), u = Ae(), _ = P(!1), C = P(new Array()), A = P([]), U = P([]), l = g(
1745
- () => !!C.value.length || A.value.some((d) => d.errors.length) || U.value.some((d) => d.errors.length)
1740
+ setup(W) {
1741
+ const h = P(null), k = Yt(), d = Ae(), _ = P(!1), S = P(new Array()), A = P([]), U = P([]), l = g(
1742
+ () => !!S.value.length || A.value.some((c) => c.errors.length) || U.value.some((c) => c.errors.length)
1746
1743
  ), i = g(
1747
1744
  () => !!A.value.length || !!U.value.length
1748
- ), { t: m } = pe();
1749
- async function a(d) {
1750
- C.value = [], A.value = [], U.value = [];
1745
+ ), { t: u } = pe();
1746
+ async function a(c) {
1747
+ S.value = [], A.value = [], U.value = [];
1751
1748
  try {
1752
1749
  _.value = !0;
1753
- const [r] = await Promise.all([
1754
- hn(d),
1750
+ const [s] = await Promise.all([
1751
+ _n(c),
1755
1752
  // fake buffer
1756
1753
  new Promise((F) => setTimeout(F, 1e3))
1757
- ]), f = r.SheetNames.find((F) => F);
1754
+ ]), f = s.SheetNames.find((F) => F);
1758
1755
  if (!f) {
1759
- C.value.push(m("inventory.ingredient.import.fileError.noSheet"));
1756
+ S.value.push(u("inventory.ingredient.import.fileError.noSheet"));
1760
1757
  return;
1761
1758
  }
1762
- const w = pn(r.Sheets[f]);
1759
+ const w = vn(s.Sheets[f]);
1763
1760
  if (w.invalidExcel) {
1764
- C.value.push(w.invalidExcelMessage ?? m("inventory.ingredient.import.fileError.invalidExcel"));
1761
+ S.value.push(w.invalidExcelMessage ?? u("inventory.ingredient.import.fileError.invalidExcel"));
1765
1762
  return;
1766
1763
  }
1767
1764
  if (A.value = w.importCreateResult, U.value = w.importUpdateResult, !A.value.length && !U.value.length) {
1768
- C.value.push(m("inventory.ingredient.import.fileError.noData"));
1765
+ S.value.push(u("inventory.ingredient.import.fileError.noData"));
1769
1766
  return;
1770
1767
  }
1771
1768
  k.emitData(w);
1772
- } catch (r) {
1773
- u.open({
1774
- title: m("inventory.ingredient.import.fileError.unableToRead"),
1775
- message: r == null ? void 0 : r.message,
1769
+ } catch (s) {
1770
+ d.open({
1771
+ title: u("inventory.ingredient.import.fileError.unableToRead"),
1772
+ message: s == null ? void 0 : s.message,
1776
1773
  type: "error"
1777
- }), console.error("Error in reading file", r);
1774
+ }), console.error("Error in reading file", s);
1778
1775
  } finally {
1779
- C.value.length && u.open({
1780
- title: m("inventory.ingredient.import.fileError.invalidExcel"),
1776
+ S.value.length && d.open({
1777
+ title: u("inventory.ingredient.import.fileError.invalidExcel"),
1781
1778
  type: "error"
1782
1779
  }), _.value = !1;
1783
1780
  }
1784
1781
  }
1785
- return _t(h, (d) => {
1786
- d && a(d);
1787
- }), (d, r) => {
1788
- const f = S("FmCircularProgress"), w = S("FmIcon"), F = S("FmButton");
1789
- return c(), V("div", tl, [
1790
- n("div", nl, $(o(m)("inventory.ingredient.import.uploadDescription")), 1),
1791
- s(_n, {
1782
+ return _t(h, (c) => {
1783
+ c && a(c);
1784
+ }), (c, s) => {
1785
+ const f = C("FmCircularProgress"), w = C("FmIcon"), F = C("FmButton");
1786
+ return p(), V("div", ol, [
1787
+ n("div", ll, $(o(u)("inventory.ingredient.import.uploadDescription")), 1),
1788
+ r(xn, {
1792
1789
  class: ie({
1793
1790
  "w-full": !0,
1794
1791
  "h-[200px]": !h.value
1795
1792
  }),
1796
1793
  accept: ".xlsx",
1797
- onFileUpload: r[0] || (r[0] = (p) => h.value = p),
1798
- label: o(m)("inventory.ingredient.import.uploadTemplate"),
1799
- "button-label": o(m)("inventory.ingredient.import.selectFile")
1794
+ onFileUpload: s[0] || (s[0] = (m) => h.value = m),
1795
+ label: o(u)("inventory.ingredient.import.uploadTemplate"),
1796
+ "button-label": o(u)("inventory.ingredient.import.selectFile")
1800
1797
  }, kt({ _: 2 }, [
1801
1798
  h.value ? {
1802
1799
  name: "default",
1803
- fn: x(({ openFileDialog: p }) => [
1804
- n("div", ol, [
1800
+ fn: x(({ openFileDialog: m }) => [
1801
+ n("div", al, [
1805
1802
  n("div", {
1806
1803
  class: ie([
1807
1804
  "fm-corner-radius-md p-16 flex items-center gap-16",
@@ -1812,11 +1809,11 @@ const zn = /* @__PURE__ */ ke({
1812
1809
  }
1813
1810
  ])
1814
1811
  }, [
1815
- _.value ? (c(), j(f, {
1812
+ _.value ? (p(), Y(f, {
1816
1813
  key: 0,
1817
1814
  size: "md",
1818
1815
  color: "neutral-gray-200"
1819
- })) : (c(), j(w, {
1816
+ })) : (p(), Y(w, {
1820
1817
  key: 1,
1821
1818
  name: l.value ? "error" : "attach_file",
1822
1819
  outline: "",
@@ -1831,62 +1828,62 @@ const zn = /* @__PURE__ */ ke({
1831
1828
  }
1832
1829
  ])
1833
1830
  }, [
1834
- n("div", ll, $(h.value.name), 1)
1831
+ n("div", sl, $(h.value.name), 1)
1835
1832
  ], 2),
1836
- _.value ? N("", !0) : (c(), V("div", al, [
1837
- s(F, {
1838
- label: o(m)("inventory.ingredient.import.replaceFile"),
1833
+ _.value ? L("", !0) : (p(), V("div", rl, [
1834
+ r(F, {
1835
+ label: o(u)("inventory.ingredient.import.replaceFile"),
1839
1836
  variant: l.value ? "destructive" : "secondary",
1840
1837
  "prepend-icon": l.value ? void 0 : "autorenew",
1841
- onClick: p
1838
+ onClick: m
1842
1839
  }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
1843
1840
  ]))
1844
1841
  ], 2),
1845
- C.value.length ? (c(), V("div", sl, [
1846
- (c(!0), V(ee, null, de(C.value, (B, R) => (c(), V("div", {
1842
+ S.value.length ? (p(), V("div", il, [
1843
+ (p(!0), V(ee, null, de(S.value, (O, R) => (p(), V("div", {
1847
1844
  key: R,
1848
1845
  class: "flex gap-8 items-center"
1849
1846
  }, [
1850
- s(w, {
1847
+ r(w, {
1851
1848
  name: "error",
1852
1849
  size: "sm",
1853
1850
  color: "system-error-300"
1854
1851
  }),
1855
- n("div", rl, $(B), 1)
1852
+ n("div", dl, $(O), 1)
1856
1853
  ]))), 128))
1857
- ])) : N("", !0)
1854
+ ])) : L("", !0)
1858
1855
  ])
1859
1856
  ]),
1860
1857
  key: "0"
1861
1858
  } : void 0
1862
1859
  ]), 1032, ["class", "label", "button-label"]),
1863
- i.value ? (c(), V("div", il, [
1864
- n("div", dl, $(o(m)("inventory.ingredient.import.summary")), 1),
1865
- (c(!0), V(ee, null, de(A.value, (p) => (c(), j(ht, {
1866
- key: p.sku._id,
1867
- code: p.sku.code,
1868
- name: p.sku.name,
1869
- errors: p.errors,
1860
+ i.value ? (p(), V("div", ul, [
1861
+ n("div", cl, $(o(u)("inventory.ingredient.import.summary")), 1),
1862
+ (p(!0), V(ee, null, de(A.value, (m) => (p(), Y(ht, {
1863
+ key: m.sku._id,
1864
+ code: m.sku.code,
1865
+ name: m.sku.name,
1866
+ errors: m.errors,
1870
1867
  type: "create"
1871
1868
  }, null, 8, ["code", "name", "errors"]))), 128)),
1872
- (c(!0), V(ee, null, de(U.value, (p) => (c(), j(ht, {
1873
- key: p.sku._id,
1874
- code: p.sku.code,
1875
- name: p.sku.name,
1876
- errors: p.errors,
1869
+ (p(!0), V(ee, null, de(U.value, (m) => (p(), Y(ht, {
1870
+ key: m.sku._id,
1871
+ code: m.sku.code,
1872
+ name: m.sku.name,
1873
+ errors: m.errors,
1877
1874
  type: "update"
1878
1875
  }, null, 8, ["code", "name", "errors"]))), 128))
1879
- ])) : N("", !0)
1876
+ ])) : L("", !0)
1880
1877
  ]);
1881
1878
  };
1882
1879
  }
1883
- }), ml = {
1880
+ }), pl = {
1884
1881
  key: 0,
1885
1882
  class: "flex items-center gap-1"
1886
- }, cl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pl = { class: "flex flex-col py-8" }, vl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fl = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Yl = /* @__PURE__ */ ke({
1883
+ }, vl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fl = { class: "flex flex-col py-8" }, yl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, gl = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Jl = /* @__PURE__ */ xe({
1887
1884
  __name: "IngredientsView",
1888
- setup(q) {
1889
- const h = Fe(), k = Ee(), u = g(() => [
1885
+ setup(W) {
1886
+ const h = Fe(), k = Ee(), d = g(() => [
1890
1887
  {
1891
1888
  type: "string",
1892
1889
  key: "skuCode",
@@ -1915,13 +1912,13 @@ const zn = /* @__PURE__ */ ke({
1915
1912
  type: "string"
1916
1913
  }
1917
1914
  ]
1918
- }), C = g(
1915
+ }), S = g(
1919
1916
  () => new Set(k.getAvailableItems(k.businessSubsidiaryId))
1920
1917
  ), A = g(() => {
1921
1918
  if (!_.value)
1922
1919
  return h.skus;
1923
- const E = kn.build(_.value);
1924
- return h.skus.filter((v) => k.isEnabled && ne.value && C.value && !C.value.has(v._id) ? !1 : wn(
1920
+ const E = wn.build(_.value);
1921
+ return h.skus.filter((v) => k.isEnabled && ne.value && S.value && !S.value.has(v._id) ? !1 : Tn(
1925
1922
  {
1926
1923
  skuCode: v.code,
1927
1924
  skuUnitAbbrev: v.unit.abbrev,
@@ -1929,11 +1926,11 @@ const zn = /* @__PURE__ */ ke({
1929
1926
  },
1930
1927
  E
1931
1928
  ));
1932
- }), U = Wt(), l = Ke(), i = dn(), m = Ae(), { t: a } = pe(), { createIngredient: d, updateIngredient: r } = Ye(), { ingredientDialogProps: f, ingredientViewLoading: w } = Xt(Ye()), { columnDefs: F } = Nn();
1933
- function p(E) {
1929
+ }), U = Wt(), l = Ke(), i = pn(), u = Ae(), { t: a } = pe(), { createIngredient: c, updateIngredient: s } = Ye(), { ingredientDialogProps: f, ingredientViewLoading: w } = Zt(Ye()), { columnDefs: F } = zn();
1930
+ function m(E) {
1934
1931
  switch (E) {
1935
1932
  case "add":
1936
- return k.isEnabled ? void 0 : d();
1933
+ return k.isEnabled ? void 0 : c();
1937
1934
  case "import":
1938
1935
  return M();
1939
1936
  case "export-all":
@@ -1942,7 +1939,7 @@ const zn = /* @__PURE__ */ ke({
1942
1939
  return y(A.value);
1943
1940
  }
1944
1941
  }
1945
- const B = P(""), R = P(!1), ve = g(() => R.value || w.value), ne = P(!0), { breakpoints: ue } = Yt(), oe = g(() => ue.value.xs || ue.value.sm), le = g(() => oe.value ? 10 : 20), te = tn(), ae = P(!1), fe = [
1942
+ const O = P(""), R = P(!1), ve = g(() => R.value || w.value), ne = P(!0), { breakpoints: ue } = Kt(), oe = g(() => ue.value.xs || ue.value.sm), le = g(() => oe.value ? 10 : 20), te = nn(), ae = P(!1), fe = [
1946
1943
  {
1947
1944
  value: "import",
1948
1945
  label: a("common.import")
@@ -1980,8 +1977,8 @@ const zn = /* @__PURE__ */ ke({
1980
1977
  { label: a("inventory.ingredient.export.exportFiltered"), value: "export-filtered", mobileOnly: !0 }
1981
1978
  ]);
1982
1979
  function y(E) {
1983
- const v = vn(E);
1984
- m.open({
1980
+ const v = fn(E);
1981
+ u.open({
1985
1982
  title: a("inventory.ingredient.export.success"),
1986
1983
  message: a("inventory.ingredient.export.filename", [v]),
1987
1984
  type: "success"
@@ -1990,7 +1987,7 @@ const zn = /* @__PURE__ */ ke({
1990
1987
  function M() {
1991
1988
  l.open({
1992
1989
  title: a("inventory.ingredient.import.title"),
1993
- contentComponent: ul,
1990
+ contentComponent: ml,
1994
1991
  overlay: !0,
1995
1992
  closeButton: !0,
1996
1993
  primaryActions: {
@@ -2008,14 +2005,14 @@ const zn = /* @__PURE__ */ ke({
2008
2005
  }
2009
2006
  }).onPrimary((E) => {
2010
2007
  if (!E) {
2011
- m.open({
2008
+ u.open({
2012
2009
  title: a("inventory.ingredient.import.error.noData"),
2013
2010
  type: "error"
2014
2011
  });
2015
2012
  return;
2016
2013
  }
2017
2014
  if (!E.importCreateResult.length && !E.importUpdateResult.length) {
2018
- m.open({
2015
+ u.open({
2019
2016
  title: a("inventory.ingredient.import.error.invalidContent"),
2020
2017
  message: a("inventory.ingredient.import.error.noImportData"),
2021
2018
  type: "error"
@@ -2023,7 +2020,7 @@ const zn = /* @__PURE__ */ ke({
2023
2020
  return;
2024
2021
  }
2025
2022
  if (E.importCreateResult.some((v) => v.errors.length) || E.importUpdateResult.some((v) => v.errors.length)) {
2026
- m.open({
2023
+ u.open({
2027
2024
  title: a("inventory.ingredient.import.error.invalidContent"),
2028
2025
  message: a("inventory.ingredient.import.error.hasErrors"),
2029
2026
  type: "error"
@@ -2031,50 +2028,50 @@ const zn = /* @__PURE__ */ ke({
2031
2028
  return;
2032
2029
  }
2033
2030
  l.close(), G(E);
2034
- }).onTertiary(fn);
2031
+ }).onTertiary(yn);
2035
2032
  }
2036
2033
  async function G(E) {
2037
2034
  R.value = !0;
2038
2035
  try {
2039
2036
  const v = [
2040
- ...E.importCreateResult.map(({ sku: H }) => ({ type: "create", sku: H })),
2041
- ...E.importUpdateResult.map(({ sku: H }) => ({ type: "update", sku: H }))
2042
- ], z = 100;
2037
+ ...E.importCreateResult.map(({ sku: q }) => ({ type: "create", sku: q })),
2038
+ ...E.importUpdateResult.map(({ sku: q }) => ({ type: "update", sku: q }))
2039
+ ], N = 100;
2043
2040
  let J = 0;
2044
- const me = () => {
2045
- J += z, m.open({
2041
+ const ce = () => {
2042
+ J += N, u.open({
2046
2043
  title: a("inventory.ingredient.import.progress", [
2047
2044
  Math.min(J, v.length),
2048
2045
  v.length
2049
2046
  ])
2050
2047
  });
2051
2048
  }, Q = new Array();
2052
- for (const H of v.chunk(100)) {
2053
- me();
2049
+ for (const q of v.chunk(100)) {
2050
+ ce();
2054
2051
  try {
2055
- const O = await h.importSkus({
2056
- create: H.filter((K) => K.type === "create").map((K) => K.sku),
2057
- update: H.filter((K) => K.type === "update").map((K) => K.sku)
2052
+ const D = await h.importSkus({
2053
+ create: q.filter((K) => K.type === "create").map((K) => K.sku),
2054
+ update: q.filter((K) => K.type === "update").map((K) => K.sku)
2058
2055
  });
2059
- Q.push(...O.errors);
2060
- } catch (O) {
2056
+ Q.push(...D.errors);
2057
+ } catch (D) {
2061
2058
  Q.push(
2062
- ...H.map((K) => {
2063
- const L = {
2059
+ ...q.map((K) => {
2060
+ const z = {
2064
2061
  module: qt.enum.sku,
2065
2062
  _id: K.sku._id,
2066
2063
  name: K.sku.name,
2067
- message: (O == null ? void 0 : O.stack) ?? O
2064
+ message: (D == null ? void 0 : D.stack) ?? D
2068
2065
  };
2069
2066
  return {
2070
2067
  data: K.sku,
2071
- error: [L]
2068
+ error: [z]
2072
2069
  };
2073
2070
  })
2074
2071
  );
2075
2072
  }
2076
2073
  }
2077
- m.open({
2074
+ u.open({
2078
2075
  title: a("inventory.ingredient.import.success"),
2079
2076
  type: "success"
2080
2077
  }), Q.length && i.alert(
@@ -2083,19 +2080,19 @@ const zn = /* @__PURE__ */ ke({
2083
2080
  "div",
2084
2081
  { class: "flex flex-col gap-8" },
2085
2082
  Q.map(
2086
- (H) => Z("div", { class: "flex flex-col" }, [
2087
- Z("div", { class: "fm-typo-en-body-lg-600" }, `(${H.data.code}) ${H.data.name}`),
2083
+ (q) => Z("div", { class: "flex flex-col" }, [
2084
+ Z("div", { class: "fm-typo-en-body-lg-600" }, `(${q.data.code}) ${q.data.name}`),
2088
2085
  Z(
2089
2086
  "div",
2090
2087
  { class: "fm-typo-en-body-lg-400" },
2091
- `${H.error.map((O) => (O == null ? void 0 : O.message) ?? "Unknown error").join(", ")}`
2088
+ `${q.error.map((D) => (D == null ? void 0 : D.message) ?? "Unknown error").join(", ")}`
2092
2089
  )
2093
2090
  ])
2094
2091
  )
2095
2092
  )
2096
2093
  );
2097
2094
  } catch (v) {
2098
- m.open({
2095
+ u.open({
2099
2096
  title: a("inventory.ingredient.import.error.failed"),
2100
2097
  message: a("inventory.ingredient.import.error.systemMessage", [v == null ? void 0 : v.message]),
2101
2098
  type: "error"
@@ -2105,29 +2102,29 @@ const zn = /* @__PURE__ */ ke({
2105
2102
  }
2106
2103
  }
2107
2104
  return (E, v) => {
2108
- const z = S("FmButton"), J = S("FmMenuItem"), me = S("FmMenu"), Q = S("FmSwitch"), H = S("FmTable"), O = S("FmCollapsibleTabs"), K = S("FmBottomSheet");
2109
- return c(), j(nn, {
2105
+ const N = C("FmButton"), J = C("FmMenuItem"), ce = C("FmMenu"), Q = C("FmSwitch"), q = C("FmTable"), D = C("FmCollapsibleTabs"), K = C("FmBottomSheet");
2106
+ return p(), Y(on, {
2110
2107
  title: o(a)("inventory.ingredient.title"),
2111
2108
  actions: we.value,
2112
- "onClick:action": p
2109
+ "onClick:action": m
2113
2110
  }, {
2114
2111
  "header-end": x(() => [
2115
- s(me, { "close-on-click": !0 }, {
2112
+ r(ce, { "close-on-click": !0 }, {
2116
2113
  "menu-button": x(() => [
2117
- s(z, {
2114
+ r(N, {
2118
2115
  label: o(a)("common.export"),
2119
2116
  "bg-color": "neutral-gray-100",
2120
2117
  "text-color": "neutral-gray-400"
2121
2118
  }, null, 8, ["label"])
2122
2119
  ]),
2123
2120
  default: x(() => [
2124
- s(J, {
2121
+ r(J, {
2125
2122
  label: o(a)("inventory.ingredient.export.exportAll"),
2126
- onClick: v[0] || (v[0] = (L) => y())
2123
+ onClick: v[0] || (v[0] = (z) => y())
2127
2124
  }, null, 8, ["label"]),
2128
- s(J, {
2125
+ r(J, {
2129
2126
  label: o(a)("inventory.ingredient.export.exportFiltered"),
2130
- onClick: v[1] || (v[1] = (L) => y(A.value))
2127
+ onClick: v[1] || (v[1] = (z) => y(A.value))
2131
2128
  }, null, 8, ["label"])
2132
2129
  ]),
2133
2130
  _: 1
@@ -2143,64 +2140,64 @@ const zn = /* @__PURE__ */ ke({
2143
2140
  }
2144
2141
  ])
2145
2142
  }, [
2146
- s(xn, {
2143
+ r(kn, {
2147
2144
  searchable: "",
2148
- search: B.value,
2149
- "onUpdate:search": v[3] || (v[3] = (L) => B.value = L),
2145
+ search: O.value,
2146
+ "onUpdate:search": v[3] || (v[3] = (z) => O.value = z),
2150
2147
  filterable: "",
2151
- "filter-attributes": u.value,
2148
+ "filter-attributes": d.value,
2152
2149
  filter: _.value,
2153
- "onUpdate:filter": v[4] || (v[4] = (L) => _.value = L)
2150
+ "onUpdate:filter": v[4] || (v[4] = (z) => _.value = z)
2154
2151
  }, {
2155
2152
  default: x(() => [
2156
- o(k).isEnabled ? (c(), V("div", ml, [
2157
- n("span", cl, $(o(a)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
2158
- s(sn),
2159
- s(Be, null, {
2153
+ o(k).isEnabled ? (p(), V("div", pl, [
2154
+ n("span", vl, $(o(a)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
2155
+ r(cn),
2156
+ r(Oe, null, {
2160
2157
  default: x(() => [
2161
- s(Q, {
2158
+ r(Q, {
2162
2159
  modelValue: ne.value,
2163
- "onUpdate:modelValue": v[2] || (v[2] = (L) => ne.value = L)
2160
+ "onUpdate:modelValue": v[2] || (v[2] = (z) => ne.value = z)
2164
2161
  }, null, 8, ["modelValue"])
2165
2162
  ]),
2166
2163
  _: 1
2167
2164
  })
2168
- ])) : N("", !0)
2165
+ ])) : L("", !0)
2169
2166
  ]),
2170
2167
  _: 1
2171
2168
  }, 8, ["search", "filter-attributes", "filter"]),
2172
- (c(), j(H, {
2169
+ (p(), Y(q, {
2173
2170
  key: JSON.stringify(_.value),
2174
- style: Dt(o(te).tableHeight),
2171
+ style: Bt(o(te).tableHeight),
2175
2172
  "column-defs": o(F),
2176
2173
  "row-data": A.value,
2177
- "search-value": B.value,
2174
+ "search-value": O.value,
2178
2175
  columnVisibility: {
2179
2176
  netsuiteSubsidiary: o(k).isEnabled
2180
2177
  },
2181
2178
  loading: (!o(U)._currentLocation || ve.value) && o(k).isReady,
2182
2179
  "loading-text": o(a)("inventory.common.loading"),
2183
- onRowClick: v[5] || (v[5] = (L) => o(r)(L.original)),
2180
+ onRowClick: v[5] || (v[5] = (z) => o(s)(z.original)),
2184
2181
  "page-size": le.value
2185
2182
  }, {
2186
- "list-row": x((L) => [
2187
- s(bn, {
2188
- row: L,
2189
- onRowClick: o(r)
2183
+ "list-row": x((z) => [
2184
+ r(hn, {
2185
+ row: z,
2186
+ onRowClick: o(s)
2190
2187
  }, kt({
2191
2188
  default: x((ge) => {
2192
- var $e, Me, Ue, be, he, ce, Te, Ve, _e, Ie;
2189
+ var $e, Me, Ue, be, he, me, Te, Ve, _e, Ie;
2193
2190
  return [
2194
- n("div", pl, [
2195
- n("div", vl, [
2196
- s(o(gt), {
2191
+ n("div", fl, [
2192
+ n("div", yl, [
2193
+ r(o(gt), {
2197
2194
  render: (Ue = (Me = ($e = ge.code) == null ? void 0 : $e.column) == null ? void 0 : Me.columnDef) == null ? void 0 : Ue.cell,
2198
2195
  props: (he = (be = ge.code) == null ? void 0 : be.getContext) == null ? void 0 : he.call(be)
2199
2196
  }, null, 8, ["render", "props"])
2200
2197
  ]),
2201
- n("div", fl, [
2202
- s(o(gt), {
2203
- render: (Ve = (Te = (ce = ge.name) == null ? void 0 : ce.column) == null ? void 0 : Te.columnDef) == null ? void 0 : Ve.cell,
2198
+ n("div", gl, [
2199
+ r(o(gt), {
2200
+ render: (Ve = (Te = (me = ge.name) == null ? void 0 : me.column) == null ? void 0 : Te.columnDef) == null ? void 0 : Ve.cell,
2204
2201
  props: (Ie = (_e = ge.name) == null ? void 0 : _e.getContext) == null ? void 0 : Ie.call(_e)
2205
2202
  }, null, 8, ["render", "props"])
2206
2203
  ])
@@ -2221,20 +2218,20 @@ const zn = /* @__PURE__ */ ke({
2221
2218
  _: 1
2222
2219
  }, 8, ["style", "column-defs", "row-data", "search-value", "columnVisibility", "loading", "loading-text", "page-size"]))
2223
2220
  ], 2),
2224
- (c(), j(it, { to: "body" }, [
2225
- s(Go, Nt(zt(o(f))), null, 16)
2221
+ (p(), Y(it, { to: "body" }, [
2222
+ r(Qo, Nt(zt(o(f))), null, 16)
2226
2223
  ])),
2227
- (c(), j(it, { to: "body" }, [
2228
- s(K, {
2224
+ (p(), Y(it, { to: "body" }, [
2225
+ r(K, {
2229
2226
  "dismiss-away": "",
2230
2227
  modelValue: ae.value,
2231
- "onUpdate:modelValue": v[7] || (v[7] = (L) => ae.value = L)
2228
+ "onUpdate:modelValue": v[7] || (v[7] = (z) => ae.value = z)
2232
2229
  }, {
2233
2230
  default: x(() => [
2234
- s(O, {
2231
+ r(D, {
2235
2232
  class: "pb-8",
2236
2233
  items: fe,
2237
- "onUpdate:modelValue": v[6] || (v[6] = (L) => ye(L))
2234
+ "onUpdate:modelValue": v[6] || (v[6] = (z) => ye(z))
2238
2235
  })
2239
2236
  ]),
2240
2237
  _: 1
@@ -2247,5 +2244,5 @@ const zn = /* @__PURE__ */ ke({
2247
2244
  }
2248
2245
  });
2249
2246
  export {
2250
- Yl as default
2247
+ Jl as default
2251
2248
  };