@argusoft/medplat-core 1.0.30 → 1.0.32

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 (226) hide show
  1. package/dist/{AccessRights-xrday-L1.js → AccessRights-DBjTQA1-.js} +395 -390
  2. package/dist/AccessRights-DBjTQA1-.js.map +1 -0
  3. package/dist/{AddFeatures-D1sU8RjY.js → AddFeatures-COj4ZTIM.js} +2 -2
  4. package/dist/{AddFeatures-D1sU8RjY.js.map → AddFeatures-COj4ZTIM.js.map} +1 -1
  5. package/dist/AddMenuConfiguration-Creeib5X.js +11223 -0
  6. package/dist/AddMenuConfiguration-Creeib5X.js.map +1 -0
  7. package/dist/AddMenuConfiguration.css +1 -1
  8. package/dist/{BrandsPage-DmRW5bhm-Bk1szrjI.js → BrandsPage-CdcAvaml-ZtVTX6vX.js} +43 -43
  9. package/dist/{BrandsPage-DmRW5bhm-Bk1szrjI.js.map → BrandsPage-CdcAvaml-ZtVTX6vX.js.map} +1 -1
  10. package/dist/{CategoriesPage-BsS5IQh3-B03lWRY5.js → CategoriesPage-BprQEYJw-CclreTv1.js} +109 -102
  11. package/dist/CategoriesPage-BprQEYJw-CclreTv1.js.map +1 -0
  12. package/dist/{ChangePasswordModalCore-BPsJquTS.js → ChangePasswordModalCore-DZGOkbRY.js} +3 -3
  13. package/dist/{ChangePasswordModalCore-BPsJquTS.js.map → ChangePasswordModalCore-DZGOkbRY.js.map} +1 -1
  14. package/dist/ConditionConfig-Bpm6OoV5.js +408 -0
  15. package/dist/ConditionConfig-Bpm6OoV5.js.map +1 -0
  16. package/dist/{DashboardPage-C3bKc5na-sBd9Yqbi.js → DashboardPage-CTiGSx71-CsYohJ5e.js} +32 -32
  17. package/dist/{DashboardPage-C3bKc5na-sBd9Yqbi.js.map → DashboardPage-CTiGSx71-CsYohJ5e.js.map} +1 -1
  18. package/dist/EntityManagement-BGwJGl9k.js +62 -0
  19. package/dist/EntityManagement-BGwJGl9k.js.map +1 -0
  20. package/dist/EventConfig-BY2cgGyx.js +27 -0
  21. package/dist/{EventConfig-BmLemzX3.js.map → EventConfig-BY2cgGyx.js.map} +1 -1
  22. package/dist/EventConfigurations-B-z7xHh_.js +544 -0
  23. package/dist/EventConfigurations-B-z7xHh_.js.map +1 -0
  24. package/dist/EventConfigurations.css +1 -1
  25. package/dist/EventsExceptionModal-DafomIv6.js +188 -0
  26. package/dist/EventsExceptionModal-DafomIv6.js.map +1 -0
  27. package/dist/EventsUi-Dl_yckSA.js +263 -0
  28. package/dist/EventsUi-Dl_yckSA.js.map +1 -0
  29. package/dist/FacilityPicker-BXa2VF7i-Dab_Jwa5.js +112 -0
  30. package/dist/FacilityPicker-BXa2VF7i-Dab_Jwa5.js.map +1 -0
  31. package/dist/{FeatureMenu-DYJmDt7q.js → FeatureMenu-Kc73yPHH.js} +9 -5
  32. package/dist/FeatureMenu-Kc73yPHH.js.map +1 -0
  33. package/dist/{FhirServerList-DuTwnngN.js → FhirServerList-CrIHMAxz.js} +16 -16
  34. package/dist/{FhirServerList-DuTwnngN.js.map → FhirServerList-CrIHMAxz.js.map} +1 -1
  35. package/dist/{FhirServerProfile-CUOwC6Wb.js → FhirServerProfile-D3aYcpwY.js} +8 -8
  36. package/dist/{FhirServerProfile-CUOwC6Wb.js.map → FhirServerProfile-D3aYcpwY.js.map} +1 -1
  37. package/dist/{FhirServerWizard-DZI8Olku.js → FhirServerWizard-Db6Hm4bQ.js} +15 -15
  38. package/dist/{FhirServerWizard-DZI8Olku.js.map → FhirServerWizard-Db6Hm4bQ.js.map} +1 -1
  39. package/dist/{GrantPermissionModal-BDN66Atn.js → GrantPermissionModal-D7iNZd0M.js} +54 -51
  40. package/dist/GrantPermissionModal-D7iNZd0M.js.map +1 -0
  41. package/dist/ImmunizationConfigurationBase-lKsJZMak.js +8060 -0
  42. package/dist/ImmunizationConfigurationBase-lKsJZMak.js.map +1 -0
  43. package/dist/InventoryPage-JadYMCzU-CzJQfQ2A.js +1017 -0
  44. package/dist/InventoryPage-JadYMCzU-CzJQfQ2A.js.map +1 -0
  45. package/dist/LocationWiseExpectedTargetPage-CjKk1aTF.js +1344 -0
  46. package/dist/LocationWiseExpectedTargetPage-CjKk1aTF.js.map +1 -0
  47. package/dist/{ManageDynamicFeature-BU0I45dd.js → ManageDynamicFeature-CuyYfx_P.js} +104 -97
  48. package/dist/ManageDynamicFeature-CuyYfx_P.js.map +1 -0
  49. package/dist/ManageEventConfiguration-DqPbn3Oi.js +1216 -0
  50. package/dist/ManageEventConfiguration-DqPbn3Oi.js.map +1 -0
  51. package/dist/ManageEventConfiguration.css +1 -1
  52. package/dist/ManageRole-CyfpySt9.js +981 -0
  53. package/dist/ManageRole-CyfpySt9.js.map +1 -0
  54. package/dist/{ManageUser-DCFkUMV9.js → ManageUser-Dm0l833u.js} +286 -286
  55. package/dist/{ManageUser-DCFkUMV9.js.map → ManageUser-Dm0l833u.js.map} +1 -1
  56. package/dist/{MemberProfileCard-BdUNgHRB-VywqQdFF.js → MemberProfileCard-01d_jz3w-DYHtbgMX.js} +46 -46
  57. package/dist/{MemberProfileCard-BdUNgHRB-VywqQdFF.js.map → MemberProfileCard-01d_jz3w-DYHtbgMX.js.map} +1 -1
  58. package/dist/MobileAnalytics-C9oc2yAo.js +18399 -0
  59. package/dist/MobileAnalytics-C9oc2yAo.js.map +1 -0
  60. package/dist/MobileMenuManagement-BmzTPXy7.js +231 -0
  61. package/dist/MobileMenuManagement-BmzTPXy7.js.map +1 -0
  62. package/dist/MobileTypeEventConfigModal-DodU3beR.js +752 -0
  63. package/dist/MobileTypeEventConfigModal-DodU3beR.js.map +1 -0
  64. package/dist/{NewServerManagement-Cxe0dV0O.js → NewServerManagement-BdayO78D.js} +368 -352
  65. package/dist/NewServerManagement-BdayO78D.js.map +1 -0
  66. package/dist/OtherTypeEventConfigModal-D_9S50aI.js +1414 -0
  67. package/dist/OtherTypeEventConfigModal-D_9S50aI.js.map +1 -0
  68. package/dist/{PaymentCreatePage-CIVe0P0p-25BQVpOX.js → PaymentCreatePage-D6NZBUC3-DxXf2kvH.js} +58 -58
  69. package/dist/{PaymentCreatePage-CIVe0P0p-25BQVpOX.js.map → PaymentCreatePage-D6NZBUC3-DxXf2kvH.js.map} +1 -1
  70. package/dist/{PaymentsPage-BvPe5Q9F-D2gfziwW.js → PaymentsPage-CHieGNrn-BnYCtqHd.js} +37 -37
  71. package/dist/{PaymentsPage-BvPe5Q9F-D2gfziwW.js.map → PaymentsPage-CHieGNrn-BnYCtqHd.js.map} +1 -1
  72. package/dist/{PermissionsModal-CCYkcKlC.js → PermissionsModal-Dxbkkrqe.js} +18 -18
  73. package/dist/PermissionsModal-Dxbkkrqe.js.map +1 -0
  74. package/dist/{PickupBatchLinesEditor-DHmcAG23-DL2p6IKJ.js → PickupBatchLinesEditor-QPaqFtUO-CY7BShYh.js} +2 -2
  75. package/dist/{PickupBatchLinesEditor-DHmcAG23-DL2p6IKJ.js.map → PickupBatchLinesEditor-QPaqFtUO-CY7BShYh.js.map} +1 -1
  76. package/dist/PickupCreatePage-C7_67u_u-OId8-e2a.js +801 -0
  77. package/dist/PickupCreatePage-C7_67u_u-OId8-e2a.js.map +1 -0
  78. package/dist/{PickupsPage-Ctpghavs-CUp4uIZq.js → PickupsPage-BWblMlic-CWkgeBw0.js} +132 -132
  79. package/dist/PickupsPage-BWblMlic-CWkgeBw0.js.map +1 -0
  80. package/dist/PmGuard-BvUUbU80-BpYNaDzl.js +641 -0
  81. package/dist/PmGuard-BvUUbU80-BpYNaDzl.js.map +1 -0
  82. package/dist/ProductEditPage-Dbq4vUAA-BoBmTPPL.js +1523 -0
  83. package/dist/ProductEditPage-Dbq4vUAA-BoBmTPPL.js.map +1 -0
  84. package/dist/{ProductsPage-CupVmOD4-D45a_hf-.js → ProductsPage-BI22nPb4-CQBjnc-n.js} +44 -43
  85. package/dist/ProductsPage-BI22nPb4-CQBjnc-n.js.map +1 -0
  86. package/dist/PurchaseCreatePage-C0EK9z4w-BQMTsjE7.js +724 -0
  87. package/dist/PurchaseCreatePage-C0EK9z4w-BQMTsjE7.js.map +1 -0
  88. package/dist/{PurchaseRequestDetailPage-Dg_MRY_N-D1bgTEAn.js → PurchaseRequestDetailPage-DhBuOGHZ-CWZPqzt9.js} +428 -418
  89. package/dist/PurchaseRequestDetailPage-DhBuOGHZ-CWZPqzt9.js.map +1 -0
  90. package/dist/{PurchaseRequestsPage-DPAPzpmm-mDH2IrTl.js → PurchaseRequestsPage-Bj9HUMxb-B7-AxT8m.js} +65 -65
  91. package/dist/{PurchaseRequestsPage-DPAPzpmm-mDH2IrTl.js.map → PurchaseRequestsPage-Bj9HUMxb-B7-AxT8m.js.map} +1 -1
  92. package/dist/{PurchasesPage-It1GHiXl-eH4IsF_U.js → PurchasesPage-Djl1AqD_-DXeYFMrX.js} +55 -55
  93. package/dist/{PurchasesPage-It1GHiXl-eH4IsF_U.js.map → PurchasesPage-Djl1AqD_-DXeYFMrX.js.map} +1 -1
  94. package/dist/{RoleManagement-s8iNx2Mu.js → RoleManagement-DVYufwy-.js} +3 -3
  95. package/dist/{RoleManagement-s8iNx2Mu.js.map → RoleManagement-DVYufwy-.js.map} +1 -1
  96. package/dist/Roles-BoNGJhtR.js +19 -0
  97. package/dist/Roles-BoNGJhtR.js.map +1 -0
  98. package/dist/{SaleCreatePage-C9kFmTvm-B3Y0o4CX.js → SaleCreatePage-DHBLmlBr-BlgjVsq6.js} +39 -39
  99. package/dist/{SaleCreatePage-C9kFmTvm-B3Y0o4CX.js.map → SaleCreatePage-DHBLmlBr-BlgjVsq6.js.map} +1 -1
  100. package/dist/{SalesPage-D18DCseD-BxktGDRQ.js → SalesPage-eF9Yr42z-BQ9FlXC3.js} +61 -61
  101. package/dist/{SalesPage-D18DCseD-BxktGDRQ.js.map → SalesPage-eF9Yr42z-BQ9FlXC3.js.map} +1 -1
  102. package/dist/SettingsPage-Cre-UE3r-9ntnLYsQ.js +741 -0
  103. package/dist/SettingsPage-Cre-UE3r-9ntnLYsQ.js.map +1 -0
  104. package/dist/{ShowFlywayQuery-D1y_4A1u.js → ShowFlywayQuery-DIOUdYfG.js} +26 -19
  105. package/dist/{ShowFlywayQuery-D1y_4A1u.js.map → ShowFlywayQuery-DIOUdYfG.js.map} +1 -1
  106. package/dist/{StorageUnitsPage-7EqwuMOI-BwUso1Th.js → StorageUnitsPage-CTEVuemZ-B4osG74N.js} +253 -223
  107. package/dist/StorageUnitsPage-CTEVuemZ-B4osG74N.js.map +1 -0
  108. package/dist/{SubMenu-eEDhZUvh.js → SubMenu-OO2zhKiu.js} +5 -3
  109. package/dist/SubMenu-OO2zhKiu.js.map +1 -0
  110. package/dist/{TableDetails-BtafRxXb.js → TableDetails-Cc40dEUs.js} +272 -267
  111. package/dist/TableDetails-Cc40dEUs.js.map +1 -0
  112. package/dist/{TableList-Dpo6dO7S.js → TableList-B5tX4wII.js} +316 -312
  113. package/dist/TableList-B5tX4wII.js.map +1 -0
  114. package/dist/{TransactionsPage-DrH53pVS-BkhIGB6C.js → TransactionsPage-Zuu7sjID-B-ACzvd1.js} +195 -180
  115. package/dist/TransactionsPage-Zuu7sjID-B-ACzvd1.js.map +1 -0
  116. package/dist/TransferCreatePage-DlT0nCDj-B2SdPgYB.js +635 -0
  117. package/dist/TransferCreatePage-DlT0nCDj-B2SdPgYB.js.map +1 -0
  118. package/dist/TransfersPage-DqaSvHda-G2tFa5Jq.js +600 -0
  119. package/dist/TransfersPage-DqaSvHda-G2tFa5Jq.js.map +1 -0
  120. package/dist/TypeConfiguration-EaFiOzRE.js +114 -0
  121. package/dist/TypeConfiguration-EaFiOzRE.js.map +1 -0
  122. package/dist/UserList-Cf5B-o_1.js +1904 -0
  123. package/dist/UserList-Cf5B-o_1.js.map +1 -0
  124. package/dist/Users-MC7txo1V.js +43 -0
  125. package/dist/{Users-Bpc4Sazd.js.map → Users-MC7txo1V.js.map} +1 -1
  126. package/dist/VaccineEducation-T_UE57Ef.js +231 -0
  127. package/dist/VaccineEducation-T_UE57Ef.js.map +1 -0
  128. package/dist/VaccineEducation.css +1 -0
  129. package/dist/VaccineEducationConfigurator-CWc20_rv.js +50948 -0
  130. package/dist/VaccineEducationConfigurator-CWc20_rv.js.map +1 -0
  131. package/dist/VaccineEducationConfigurator.css +4 -0
  132. package/dist/VaccineEducationList-Ok7_5EFb.js +334 -0
  133. package/dist/VaccineEducationList-Ok7_5EFb.js.map +1 -0
  134. package/dist/VialsPage-LoDaUqVv-DmMXbK8j.js +457 -0
  135. package/dist/VialsPage-LoDaUqVv-DmMXbK8j.js.map +1 -0
  136. package/dist/{constants-ClZJY2x1-MkSWn6TZ.js → constants-BTpJFQe_-CYPZIqQF.js} +166 -56
  137. package/dist/constants-BTpJFQe_-CYPZIqQF.js.map +1 -0
  138. package/dist/dashboardLayoutUtils--xUnoKPa.js +615 -0
  139. package/dist/dashboardLayoutUtils--xUnoKPa.js.map +1 -0
  140. package/dist/index-mfoqII2U.js +524 -0
  141. package/dist/index-mfoqII2U.js.map +1 -0
  142. package/dist/{index-D9YNFPn9.js → index-o8Pyt1Bt.js} +445 -439
  143. package/dist/index-o8Pyt1Bt.js.map +1 -0
  144. package/dist/index.css +1 -1
  145. package/dist/index.js +1 -1
  146. package/dist/index.lib-BySa9-Z-.js +936 -0
  147. package/dist/index.lib-BySa9-Z-.js.map +1 -0
  148. package/dist/listValueStore-5d4vNGQM-WclZ5nBG.js +43 -0
  149. package/dist/listValueStore-5d4vNGQM-WclZ5nBG.js.map +1 -0
  150. package/package.json +5 -1
  151. package/dist/AccessRights-xrday-L1.js.map +0 -1
  152. package/dist/AddMenuConfiguration-e5BVXhmw.js +0 -8547
  153. package/dist/AddMenuConfiguration-e5BVXhmw.js.map +0 -1
  154. package/dist/CategoriesPage-BsS5IQh3-B03lWRY5.js.map +0 -1
  155. package/dist/ConditionConfig-Ddz9halE.js +0 -395
  156. package/dist/ConditionConfig-Ddz9halE.js.map +0 -1
  157. package/dist/ConditionConfig.css +0 -1
  158. package/dist/EntityManagement-CPQL6qBj.js +0 -50
  159. package/dist/EntityManagement-CPQL6qBj.js.map +0 -1
  160. package/dist/EventConfig-BmLemzX3.js +0 -26
  161. package/dist/EventConfigurations-Bzh1qWXU.js +0 -450
  162. package/dist/EventConfigurations-Bzh1qWXU.js.map +0 -1
  163. package/dist/EventsExceptionModal-B2SRrnB1.js +0 -200
  164. package/dist/EventsExceptionModal-B2SRrnB1.js.map +0 -1
  165. package/dist/EventsSkeleton-BIcPks4T.js +0 -61
  166. package/dist/EventsSkeleton-BIcPks4T.js.map +0 -1
  167. package/dist/FacilityPicker-BiZeupmP-CyPHmj6b.js +0 -79
  168. package/dist/FacilityPicker-BiZeupmP-CyPHmj6b.js.map +0 -1
  169. package/dist/FeatureMenu-DYJmDt7q.js.map +0 -1
  170. package/dist/GrantPermissionModal-BDN66Atn.js.map +0 -1
  171. package/dist/ImmunizationConfigurationBase-Di1KO3oW.js +0 -7639
  172. package/dist/ImmunizationConfigurationBase-Di1KO3oW.js.map +0 -1
  173. package/dist/InventoryPage-C_AxSy7A-QLvlL4rE.js +0 -665
  174. package/dist/InventoryPage-C_AxSy7A-QLvlL4rE.js.map +0 -1
  175. package/dist/ManageDynamicFeature-BU0I45dd.js.map +0 -1
  176. package/dist/ManageEventConfiguration-CoYcpjR9.js +0 -1085
  177. package/dist/ManageEventConfiguration-CoYcpjR9.js.map +0 -1
  178. package/dist/ManageRole-CNZBRKGU.js +0 -776
  179. package/dist/ManageRole-CNZBRKGU.js.map +0 -1
  180. package/dist/MobileAnalytics-pQoE8cG1.js +0 -16888
  181. package/dist/MobileAnalytics-pQoE8cG1.js.map +0 -1
  182. package/dist/MobileMenuManagement-Cf8IZlla.js +0 -108
  183. package/dist/MobileMenuManagement-Cf8IZlla.js.map +0 -1
  184. package/dist/MobileTypeEventConfigModal-BeveaX0C.js +0 -783
  185. package/dist/MobileTypeEventConfigModal-BeveaX0C.js.map +0 -1
  186. package/dist/NewServerManagement-Cxe0dV0O.js.map +0 -1
  187. package/dist/OtherTypeEventConfigModal-CM6VkdmY.js +0 -2046
  188. package/dist/OtherTypeEventConfigModal-CM6VkdmY.js.map +0 -1
  189. package/dist/PermissionsModal-CCYkcKlC.js.map +0 -1
  190. package/dist/PickupCreatePage-CB0Sl0Hb-Mmj7zESG.js +0 -783
  191. package/dist/PickupCreatePage-CB0Sl0Hb-Mmj7zESG.js.map +0 -1
  192. package/dist/PickupsPage-Ctpghavs-CUp4uIZq.js.map +0 -1
  193. package/dist/PmGuard-b10TGXEi-G3N0G_Wg.js +0 -599
  194. package/dist/PmGuard-b10TGXEi-G3N0G_Wg.js.map +0 -1
  195. package/dist/ProductEditPage-C1thoKHu-URQaZ6st.js +0 -1302
  196. package/dist/ProductEditPage-C1thoKHu-URQaZ6st.js.map +0 -1
  197. package/dist/ProductsPage-CupVmOD4-D45a_hf-.js.map +0 -1
  198. package/dist/PurchaseCreatePage-YD3NmhPQ-2j4etSjM.js +0 -648
  199. package/dist/PurchaseCreatePage-YD3NmhPQ-2j4etSjM.js.map +0 -1
  200. package/dist/PurchaseRequestDetailPage-Dg_MRY_N-D1bgTEAn.js.map +0 -1
  201. package/dist/Roles-BIyiic67.js +0 -14
  202. package/dist/Roles-BIyiic67.js.map +0 -1
  203. package/dist/SettingsPage-VsxI-ano-DcmtUUEj.js +0 -747
  204. package/dist/SettingsPage-VsxI-ano-DcmtUUEj.js.map +0 -1
  205. package/dist/StorageUnitsPage-7EqwuMOI-BwUso1Th.js.map +0 -1
  206. package/dist/SubMenu-eEDhZUvh.js.map +0 -1
  207. package/dist/TableDetails-BtafRxXb.js.map +0 -1
  208. package/dist/TableList-Dpo6dO7S.js.map +0 -1
  209. package/dist/TransactionsPage-DrH53pVS-BkhIGB6C.js.map +0 -1
  210. package/dist/TransferCreatePage-CuvoMrYH-DTTfHjz-.js +0 -315
  211. package/dist/TransferCreatePage-CuvoMrYH-DTTfHjz-.js.map +0 -1
  212. package/dist/TransfersPage-Cf701t8s-BBbN7cBf.js +0 -476
  213. package/dist/TransfersPage-Cf701t8s-BBbN7cBf.js.map +0 -1
  214. package/dist/TypeConfiguration-3O6ABrK-.js +0 -117
  215. package/dist/TypeConfiguration-3O6ABrK-.js.map +0 -1
  216. package/dist/UserList-DgPxsnj2.js +0 -1129
  217. package/dist/UserList-DgPxsnj2.js.map +0 -1
  218. package/dist/Users-Bpc4Sazd.js +0 -41
  219. package/dist/VialsPage-8oAc1yFv-Cl3FUXBJ.js +0 -321
  220. package/dist/VialsPage-8oAc1yFv-Cl3FUXBJ.js.map +0 -1
  221. package/dist/constants-ClZJY2x1-MkSWn6TZ.js.map +0 -1
  222. package/dist/dashboardLayoutUtils-D1xCAxp3.js +0 -405
  223. package/dist/dashboardLayoutUtils-D1xCAxp3.js.map +0 -1
  224. package/dist/index-D9YNFPn9.js.map +0 -1
  225. package/dist/index.lib-Dn8PMkeD.js +0 -862
  226. package/dist/index.lib-Dn8PMkeD.js.map +0 -1
@@ -0,0 +1,1017 @@
1
+ import { A as _e, B as Xe, G as T, z as Ye, V as Ke, U as Ze, T as Je, a as y, O as et, _ as tt, i as at, w as nt, R as rt, L as it } from "./ImmunizationConfigurationBase-lKsJZMak.js";
2
+ import { V as ie, j as ot, k as lt, E as Ue, D as st } from "./constants-BTpJFQe_-CYPZIqQF.js";
3
+ import { t as ct, s as dt, a as ht } from "./format-UOyOu75i-D0GyylyQ.js";
4
+ import { r as oe } from "./validation-BzlHnL-r-CCJm2utQ.js";
5
+ import { Q as ut, Z as mt, $ as pt, e as gt, Y as bt } from "./PmGuard-BvUUbU80-BpYNaDzl.js";
6
+ import { y as ft } from "./listValueStore-5d4vNGQM-WclZ5nBG.js";
7
+ import { useState as m, useMemo as z } from "react";
8
+ import { jsxs as r, jsx as t } from "react/jsx-runtime";
9
+ import { Box as I, Alert as le, Stack as g, TextField as N, InputAdornment as yt, Button as c, TableHead as vt, TableRow as se, TableCell as l, Checkbox as We, TableBody as wt, Skeleton as xt, Typography as d, Tooltip as Ct, LinearProgress as Rt, Chip as G, Dialog as V, DialogTitle as _, DialogContent as X, DialogActions as Y } from "@mui/material";
10
+ import { useTheme as It, alpha as Nt } from "@mui/material/styles";
11
+ import { v4 as P } from "uuid";
12
+ import $t from "@mui/icons-material/RefreshRounded";
13
+ import { useSearchParams as St } from "react-router-dom";
14
+ import Tt from "@mui/icons-material/WidgetsRounded";
15
+ import kt from "@mui/icons-material/MoveDownRounded";
16
+ import At from "@mui/icons-material/LockRounded";
17
+ import Et from "@mui/icons-material/LockOpenRounded";
18
+ import Ut from "@mui/icons-material/ReportRounded";
19
+ import Wt from "@mui/icons-material/TuneRounded";
20
+ import qt from "@mui/icons-material/SearchRounded";
21
+ function qe(u) {
22
+ return u ? u.status === "EXPIRED" ? !0 : ht(u.expiryDate) : !1;
23
+ }
24
+ var zt = [
25
+ {
26
+ value: "ACTIVE",
27
+ label: "Active stock"
28
+ },
29
+ {
30
+ value: "IN_USE",
31
+ label: "In use"
32
+ },
33
+ {
34
+ value: "USED_UP",
35
+ label: "Used up"
36
+ },
37
+ {
38
+ value: "EXPIRED",
39
+ label: "Expired"
40
+ },
41
+ {
42
+ value: "QUARANTINED",
43
+ label: "Quarantined"
44
+ },
45
+ {
46
+ value: "WASTAGE",
47
+ label: "Has wastage"
48
+ },
49
+ {
50
+ value: "ALL",
51
+ label: "All batches"
52
+ }
53
+ ];
54
+ function Pt(u, k) {
55
+ let b = qe(u), K = Number(u.qtyRemaining ?? 0);
56
+ switch (k) {
57
+ case "ACTIVE":
58
+ return K > 0 && !b && u.isQuarantined !== !0;
59
+ case "IN_USE":
60
+ return u.status === "IN_USE";
61
+ case "USED_UP":
62
+ return u.status === "EXHAUSTED";
63
+ case "EXPIRED":
64
+ return b;
65
+ case "QUARANTINED":
66
+ return u.isQuarantined === !0 || u.status === "QUARANTINED";
67
+ case "WASTAGE":
68
+ return Number(u.wastedQty ?? 0) > 0;
69
+ default:
70
+ return !0;
71
+ }
72
+ }
73
+ function na() {
74
+ var Ne, $e, Se, Te, ke, Ae, Ee;
75
+ let u = ut(), k = u.has("update.manage.productManagement.inventory"), [b, K] = m([]), [ce, de] = m(!1), [he, ue] = m(""), [h, $] = m({
76
+ open: !1,
77
+ batch: null,
78
+ reason: "OTHER",
79
+ notes: ""
80
+ }), [o, w] = m({
81
+ open: !1,
82
+ batch: null,
83
+ qty: 1,
84
+ reason: "DAMAGED",
85
+ comments: ""
86
+ }), [D, me] = m(!1), ze = It(), [M, pe] = m(""), [Q, ge] = m("ACTIVE"), [L, Pe] = m([]), [be, De] = St(), A = be.get("storageUnitId") ?? "", [p, E] = m(() => /* @__PURE__ */ new Set()), [f, S] = m({
87
+ open: !1,
88
+ toStorageUnitId: "",
89
+ comments: ""
90
+ }), [j, fe] = m(!1), Z = _e(), { adjustmentReasons: Me } = ft(), Qe = (Z == null ? void 0 : Z.allowManualAdjustment) === !0 && u.has("update.manage.productManagement.adjustment"), U = {
91
+ open: !1,
92
+ batch: null,
93
+ delta: 1,
94
+ reasonCode: "",
95
+ comments: ""
96
+ }, [i, x] = m(U), [F, ye] = m(!1);
97
+ function ve(e) {
98
+ let n = new URLSearchParams(be);
99
+ e ? n.set("storageUnitId", e) : n.delete("storageUnitId"), De(n, { replace: !0 }), E(/* @__PURE__ */ new Set());
100
+ }
101
+ async function C() {
102
+ var e, n;
103
+ de(!0), ue("");
104
+ try {
105
+ let [a, s] = await Promise.all([et(), tt({ activeOnly: !1 }).catch(() => [])]);
106
+ K(a), Pe(s), E(/* @__PURE__ */ new Set());
107
+ } catch (a) {
108
+ let s = ((n = (e = a == null ? void 0 : a.response) == null ? void 0 : e.data) == null ? void 0 : n.message) ?? (a == null ? void 0 : a.message) ?? "Failed to load inventory";
109
+ ue(s), y({
110
+ message: s,
111
+ type: "error"
112
+ });
113
+ } finally {
114
+ de(!1);
115
+ }
116
+ }
117
+ mt("view.manage.productManagement.inventory", () => {
118
+ C();
119
+ }, []);
120
+ let W = z(() => {
121
+ let e = M.trim().toLowerCase();
122
+ return b.filter((n) => e && !`${n.productName ?? ""} ${n.lotNumber ?? ""}`.toLowerCase().includes(e) || A && n.storageUnitId !== A ? !1 : Pt(n, Q));
123
+ }, [
124
+ b,
125
+ M,
126
+ Q,
127
+ A
128
+ ]), we = (e) => k && e.ownerType === "FACILITY" && (Number(e.qtyRemaining ?? 0) > 0 || e.isQuarantined === !0), R = z(() => W.filter(we), [W, k]), v = z(() => b.filter((e) => p.has(e.id)), [b, p]), J = z(() => new Set(v.map((e) => e.ownerId)), [v]), ee = J.size > 1, te = J.size === 1 ? [...J][0] : "", ae = z(() => {
129
+ if (!te) return [];
130
+ let e = new Set(v.map((n) => n.storageUnitId).filter(Boolean));
131
+ return L.filter((n) => n.ownerId === te && n.isActive !== !1 && !(e.size === 1 && e.has(n.id)));
132
+ }, [
133
+ L,
134
+ te,
135
+ v
136
+ ]);
137
+ function Le(e) {
138
+ E((n) => {
139
+ let a = new Set(n);
140
+ return a.has(e) ? a.delete(e) : a.add(e), a;
141
+ });
142
+ }
143
+ function je() {
144
+ E((e) => e.size === R.length && e.size > 0 ? /* @__PURE__ */ new Set() : new Set(R.map((n) => n.id)));
145
+ }
146
+ let H = Number(i.delta), ne = !Number.isInteger(H) || H <= 0 ? "Enter a whole number greater than 0." : "", xe = !ne && !!i.reasonCode && !!i.comments.trim();
147
+ async function Fe() {
148
+ var e, n;
149
+ if (!(!i.batch || !xe)) {
150
+ ye(!0);
151
+ try {
152
+ await rt({
153
+ id: P(),
154
+ batchId: i.batch.id,
155
+ delta: H,
156
+ reasonCode: i.reasonCode,
157
+ comments: i.comments.trim()
158
+ }), y({
159
+ message: "Adjustment recorded.",
160
+ type: "success"
161
+ }), x(U), await C();
162
+ } catch (a) {
163
+ y({
164
+ message: ((n = (e = a == null ? void 0 : a.response) == null ? void 0 : e.data) == null ? void 0 : n.message) ?? (a == null ? void 0 : a.message) ?? "Failed to record adjustment",
165
+ type: "error"
166
+ });
167
+ } finally {
168
+ ye(!1);
169
+ }
170
+ }
171
+ }
172
+ async function He() {
173
+ var e, n;
174
+ if (!(!f.toStorageUnitId || v.length === 0)) {
175
+ fe(!0);
176
+ try {
177
+ await it({
178
+ id: P(),
179
+ batchIds: v.map((s) => s.id),
180
+ toStorageUnitId: f.toStorageUnitId,
181
+ comments: f.comments || null
182
+ });
183
+ let a = v.length;
184
+ y({
185
+ message: `Moved ${a} ${a === 1 ? "batch" : "batches"}.`,
186
+ type: "success"
187
+ }), S({
188
+ open: !1,
189
+ toStorageUnitId: "",
190
+ comments: ""
191
+ }), await C();
192
+ } catch (a) {
193
+ y({
194
+ message: ((n = (e = a == null ? void 0 : a.response) == null ? void 0 : e.data) == null ? void 0 : n.message) ?? (a == null ? void 0 : a.message) ?? "Failed to move stock",
195
+ type: "error"
196
+ });
197
+ } finally {
198
+ fe(!1);
199
+ }
200
+ }
201
+ }
202
+ let Ce = 8 + +(R.length > 0), q = M.trim() !== "" || Q !== "ALL" || A !== "";
203
+ function Re() {
204
+ pe(""), ge("ALL"), ve("");
205
+ }
206
+ function Be(e) {
207
+ w({
208
+ open: !0,
209
+ batch: e,
210
+ qty: e.qtyRemaining ?? 1,
211
+ reason: "DAMAGED",
212
+ comments: ""
213
+ });
214
+ }
215
+ let B = Number(o.qty), O = Number(((Ne = o.batch) == null ? void 0 : Ne.qtyRemaining) ?? 0), re = !Number.isInteger(B) || B <= 0 ? "Enter a whole number greater than 0." : B > O ? `Only ${O} available to waste.` : "", Ie = !re && !!o.reason;
216
+ async function Oe() {
217
+ var e, n;
218
+ if (!(!o.batch || !Ie)) {
219
+ me(!0);
220
+ try {
221
+ await nt({
222
+ id: P(),
223
+ batchId: o.batch.id,
224
+ wastedQty: B,
225
+ reason: o.reason,
226
+ comments: o.comments || null
227
+ }), y({
228
+ message: "Wastage recorded.",
229
+ type: "success"
230
+ }), w({
231
+ open: !1,
232
+ batch: null,
233
+ qty: 1,
234
+ reason: "DAMAGED",
235
+ comments: ""
236
+ }), await C();
237
+ } catch (a) {
238
+ y({
239
+ message: ((n = (e = a == null ? void 0 : a.response) == null ? void 0 : e.data) == null ? void 0 : n.message) ?? (a == null ? void 0 : a.message) ?? "Failed to record wastage",
240
+ type: "error"
241
+ });
242
+ } finally {
243
+ me(!1);
244
+ }
245
+ }
246
+ }
247
+ async function Ge() {
248
+ var e, n;
249
+ try {
250
+ await at({
251
+ id: P(),
252
+ batchId: h.batch.id,
253
+ reason: h.reason,
254
+ notes: h.notes || null
255
+ }), y({
256
+ message: "Batch quarantined.",
257
+ type: "success"
258
+ }), $({
259
+ open: !1,
260
+ batch: null,
261
+ reason: "OTHER",
262
+ notes: ""
263
+ }), await C();
264
+ } catch (a) {
265
+ y({
266
+ message: ((n = (e = a == null ? void 0 : a.response) == null ? void 0 : e.data) == null ? void 0 : n.message) ?? (a == null ? void 0 : a.message) ?? "Failed to quarantine",
267
+ type: "error"
268
+ });
269
+ }
270
+ }
271
+ async function Ve(e) {
272
+ var n, a;
273
+ try {
274
+ await Je({
275
+ id: P(),
276
+ batchId: e.id
277
+ }), y({
278
+ message: "Quarantine lifted.",
279
+ type: "success"
280
+ }), await C();
281
+ } catch (s) {
282
+ y({
283
+ message: ((a = (n = s == null ? void 0 : s.response) == null ? void 0 : n.data) == null ? void 0 : a.message) ?? (s == null ? void 0 : s.message) ?? "Failed to unquarantine",
284
+ type: "error"
285
+ });
286
+ }
287
+ }
288
+ return /* @__PURE__ */ r(I, { children: [/* @__PURE__ */ t(pt, {}), /* @__PURE__ */ r(gt, {
289
+ perm: "view.manage.productManagement.inventory",
290
+ children: [
291
+ /* @__PURE__ */ r(bt, {
292
+ title: "Inventory",
293
+ subtitle: "Your stock batches. Click to see history or quarantine items if there's a problem.",
294
+ chips: ["Stock"],
295
+ actions: /* @__PURE__ */ t(g, {
296
+ direction: "row",
297
+ spacing: 1,
298
+ children: /* @__PURE__ */ t(c, {
299
+ variant: "outlined",
300
+ startIcon: /* @__PURE__ */ t($t, {}),
301
+ onClick: () => void C(),
302
+ children: "Refresh"
303
+ })
304
+ }),
305
+ children: [he ? /* @__PURE__ */ t(le, {
306
+ severity: "error",
307
+ sx: { mb: 2 },
308
+ children: he
309
+ }) : null, /* @__PURE__ */ r(Xe, {
310
+ eyebrow: "Stock on hand",
311
+ title: "Inventory batches",
312
+ subtitle: ce ? "Loading…" : q ? `${W.length} of ${b.length} ${b.length === 1 ? "batch" : "batches"} match` : `${b.length} ${b.length === 1 ? "batch" : "batches"} visible`,
313
+ children: [
314
+ /* @__PURE__ */ r(g, {
315
+ direction: {
316
+ xs: "column",
317
+ md: "row"
318
+ },
319
+ spacing: 1.5,
320
+ sx: { mb: 2 },
321
+ alignItems: { md: "center" },
322
+ children: [
323
+ /* @__PURE__ */ t(N, {
324
+ size: "small",
325
+ fullWidth: !0,
326
+ placeholder: "Search product or lot…",
327
+ value: M,
328
+ onChange: (e) => pe(e.target.value),
329
+ InputProps: { startAdornment: /* @__PURE__ */ t(yt, {
330
+ position: "start",
331
+ children: /* @__PURE__ */ t(qt, { fontSize: "small" })
332
+ }) },
333
+ sx: { maxWidth: { md: 360 } }
334
+ }),
335
+ /* @__PURE__ */ t(I, {
336
+ sx: { minWidth: 190 },
337
+ children: /* @__PURE__ */ t(T, {
338
+ label: "Show",
339
+ value: Q,
340
+ onChange: ge,
341
+ options: zt
342
+ })
343
+ }),
344
+ L.length > 0 ? /* @__PURE__ */ t(I, {
345
+ sx: { minWidth: 210 },
346
+ children: /* @__PURE__ */ t(T, {
347
+ label: "Storage unit",
348
+ value: A,
349
+ onChange: ve,
350
+ options: [{
351
+ value: "",
352
+ label: "Any storage unit"
353
+ }, ...L.map((e) => ({
354
+ value: e.id,
355
+ label: e.isActive === !1 ? `${e.unitName} (inactive)` : e.unitName
356
+ }))],
357
+ slotProps: { popper: { style: {
358
+ width: "auto",
359
+ minWidth: 260
360
+ } } }
361
+ })
362
+ }) : null,
363
+ /* @__PURE__ */ t(I, { sx: { flexGrow: 1 } }),
364
+ /* @__PURE__ */ t(c, {
365
+ variant: "text",
366
+ onClick: Re,
367
+ disabled: !q,
368
+ children: "Clear"
369
+ })
370
+ ]
371
+ }),
372
+ p.size > 0 ? /* @__PURE__ */ t(le, {
373
+ severity: ee ? "warning" : "info",
374
+ sx: { mb: 2 },
375
+ action: /* @__PURE__ */ r(g, {
376
+ direction: "row",
377
+ spacing: 1,
378
+ children: [/* @__PURE__ */ t(c, {
379
+ size: "small",
380
+ onClick: () => E(/* @__PURE__ */ new Set()),
381
+ children: "Clear"
382
+ }), /* @__PURE__ */ t(c, {
383
+ size: "small",
384
+ variant: "contained",
385
+ startIcon: /* @__PURE__ */ t(kt, {}),
386
+ disabled: ee || ae.length === 0,
387
+ onClick: () => S({
388
+ open: !0,
389
+ toStorageUnitId: "",
390
+ comments: ""
391
+ }),
392
+ children: "Move to storage unit"
393
+ })]
394
+ }),
395
+ children: ee ? "Those batches are at different facilities. Stock can only be moved between storage units at one facility — use a transfer to move it between facilities." : ae.length === 0 ? `${p.size} selected. This facility has no other active storage unit to move them into.` : `${p.size} ${p.size === 1 ? "batch" : "batches"} selected.`
396
+ }) : null,
397
+ /* @__PURE__ */ r(Ye, {
398
+ dense: !0,
399
+ children: [/* @__PURE__ */ t(vt, { children: /* @__PURE__ */ r(se, { children: [
400
+ R.length > 0 ? /* @__PURE__ */ t(l, {
401
+ padding: "checkbox",
402
+ children: /* @__PURE__ */ t(We, {
403
+ size: "small",
404
+ checked: p.size > 0 && p.size === R.length,
405
+ indeterminate: p.size > 0 && p.size < R.length,
406
+ onChange: je,
407
+ inputProps: { "aria-label": "Select all movable batches" }
408
+ })
409
+ }) : null,
410
+ /* @__PURE__ */ t(l, { children: "Product" }),
411
+ /* @__PURE__ */ t(l, { children: "Lot" }),
412
+ /* @__PURE__ */ t(l, { children: "Owner" }),
413
+ /* @__PURE__ */ t(l, { children: "Expiry" }),
414
+ /* @__PURE__ */ t(l, {
415
+ align: "right",
416
+ children: "Stock"
417
+ }),
418
+ /* @__PURE__ */ t(l, { children: "Storage" }),
419
+ /* @__PURE__ */ t(l, { children: "Status" }),
420
+ /* @__PURE__ */ t(l, {
421
+ align: "right",
422
+ children: "Action"
423
+ })
424
+ ] }) }), /* @__PURE__ */ t(wt, { children: ce ? Array.from({ length: 5 }).map((e, n) => /* @__PURE__ */ t(se, { children: Array.from({ length: Ce }).map((a, s) => /* @__PURE__ */ t(l, { children: /* @__PURE__ */ t(xt, { height: 22 }) }, s)) }, n)) : W.length === 0 ? /* @__PURE__ */ t(Ke, {
425
+ colSpan: Ce,
426
+ icon: Tt,
427
+ title: q ? "No batches match your filters" : "No batches in stock",
428
+ hint: q ? "Adjust your search or filters." : "Record a purchase to add stock.",
429
+ action: q ? /* @__PURE__ */ t(c, {
430
+ variant: "text",
431
+ size: "small",
432
+ onClick: Re,
433
+ children: "Clear filters"
434
+ }) : null
435
+ }) : W.map((e) => {
436
+ let n = qe(e), a = e.qtyPurchased > 0 ? e.qtyRemaining / e.qtyPurchased : 0, s = we(e);
437
+ return /* @__PURE__ */ r(se, {
438
+ hover: !0,
439
+ selected: p.has(e.id),
440
+ children: [
441
+ R.length > 0 ? /* @__PURE__ */ t(l, {
442
+ padding: "checkbox",
443
+ children: /* @__PURE__ */ t(We, {
444
+ size: "small",
445
+ checked: p.has(e.id),
446
+ disabled: !s,
447
+ onChange: () => Le(e.id),
448
+ inputProps: { "aria-label": `Select batch ${e.lotNumber ?? e.id}` }
449
+ })
450
+ }) : null,
451
+ /* @__PURE__ */ t(l, { children: /* @__PURE__ */ r(g, {
452
+ direction: "row",
453
+ alignItems: "baseline",
454
+ spacing: 1,
455
+ sx: { minWidth: 0 },
456
+ children: [/* @__PURE__ */ t(d, {
457
+ variant: "body2",
458
+ sx: {
459
+ fontWeight: 700,
460
+ lineHeight: 1.2
461
+ },
462
+ children: e.productName
463
+ }), /* @__PURE__ */ t(Ze, { id: e.serialId })]
464
+ }) }),
465
+ /* @__PURE__ */ t(l, { children: e.lotNumber ? /* @__PURE__ */ t(I, {
466
+ component: "span",
467
+ sx: {
468
+ display: "inline-flex",
469
+ px: 0.7,
470
+ py: 0.1,
471
+ borderRadius: 1,
472
+ bgcolor: Nt(ze.palette.primary.main, 0.06),
473
+ color: "primary.dark",
474
+ fontFamily: "monospace",
475
+ fontSize: "0.72rem",
476
+ fontWeight: 700
477
+ },
478
+ children: e.lotNumber
479
+ }) : /* @__PURE__ */ t(d, {
480
+ variant: "caption",
481
+ color: "text.disabled",
482
+ children: "—"
483
+ }) }),
484
+ /* @__PURE__ */ r(l, { children: [/* @__PURE__ */ t(d, {
485
+ variant: "body2",
486
+ sx: { fontWeight: 700 },
487
+ children: e.ownerName || ie(ot, e.ownerType)
488
+ }), /* @__PURE__ */ t(d, {
489
+ variant: "caption",
490
+ color: "text.secondary",
491
+ children: e.ownerType
492
+ })] }),
493
+ /* @__PURE__ */ t(l, { children: e.expiryDate ? /* @__PURE__ */ t(Ct, {
494
+ title: n ? "Past printed expiry" : "",
495
+ children: /* @__PURE__ */ t(d, {
496
+ variant: "body2",
497
+ sx: {
498
+ fontWeight: 700,
499
+ fontVariantNumeric: "tabular-nums",
500
+ color: n ? "error.dark" : "text.primary"
501
+ },
502
+ children: ct(e.expiryDate)
503
+ })
504
+ }) : /* @__PURE__ */ t(d, {
505
+ variant: "caption",
506
+ color: "text.disabled",
507
+ children: "—"
508
+ }) }),
509
+ /* @__PURE__ */ t(l, {
510
+ align: "right",
511
+ sx: { minWidth: 150 },
512
+ children: /* @__PURE__ */ r(g, {
513
+ alignItems: "flex-end",
514
+ spacing: 0.5,
515
+ children: [
516
+ /* @__PURE__ */ r(d, {
517
+ variant: "body2",
518
+ sx: {
519
+ fontWeight: 800,
520
+ fontVariantNumeric: "tabular-nums"
521
+ },
522
+ children: [e.qtyRemaining, /* @__PURE__ */ r(d, {
523
+ component: "span",
524
+ variant: "caption",
525
+ color: "text.secondary",
526
+ sx: {
527
+ ml: 0.5,
528
+ fontVariantNumeric: "tabular-nums"
529
+ },
530
+ children: ["/ ", e.qtyPurchased]
531
+ })]
532
+ }),
533
+ /* @__PURE__ */ t(I, {
534
+ sx: { width: 80 },
535
+ children: /* @__PURE__ */ t(Rt, {
536
+ variant: "determinate",
537
+ value: Math.min(100, Math.max(0, a * 100)),
538
+ sx: {
539
+ height: 4,
540
+ borderRadius: 2
541
+ },
542
+ color: a < 0.25 ? "warning" : "primary"
543
+ })
544
+ }),
545
+ Number(e.wastedQty ?? 0) > 0 ? /* @__PURE__ */ r(d, {
546
+ variant: "caption",
547
+ sx: {
548
+ color: "warning.dark",
549
+ fontWeight: 700
550
+ },
551
+ children: [e.wastedQty, " wasted"]
552
+ }) : null
553
+ ]
554
+ })
555
+ }),
556
+ /* @__PURE__ */ t(l, { children: e.storageUnitName ? /* @__PURE__ */ t(d, {
557
+ variant: "caption",
558
+ sx: { fontWeight: 700 },
559
+ children: e.storageUnitName
560
+ }) : /* @__PURE__ */ t(d, {
561
+ variant: "caption",
562
+ color: "text.disabled",
563
+ children: "—"
564
+ }) }),
565
+ /* @__PURE__ */ t(l, { children: /* @__PURE__ */ r(g, {
566
+ direction: "row",
567
+ spacing: 0.5,
568
+ flexWrap: "wrap",
569
+ useFlexGap: !0,
570
+ children: [
571
+ /* @__PURE__ */ t(G, {
572
+ size: "small",
573
+ color: dt(e.status),
574
+ label: ie(lt, e.status),
575
+ sx: {
576
+ fontWeight: 700,
577
+ borderRadius: 1.5,
578
+ height: 22
579
+ }
580
+ }),
581
+ e.isQuarantined ? /* @__PURE__ */ t(G, {
582
+ size: "small",
583
+ color: "error",
584
+ label: ie(Ue, e.quarantineReason) || "Quarantined",
585
+ sx: {
586
+ fontWeight: 700,
587
+ borderRadius: 1.5,
588
+ height: 22
589
+ }
590
+ }) : null,
591
+ n && e.status !== "EXPIRED" ? /* @__PURE__ */ t(G, {
592
+ size: "small",
593
+ color: "warning",
594
+ label: "Expired",
595
+ sx: {
596
+ fontWeight: 700,
597
+ borderRadius: 1.5,
598
+ height: 22
599
+ }
600
+ }) : null,
601
+ e.sourceType ? /* @__PURE__ */ t(G, {
602
+ size: "small",
603
+ variant: "outlined",
604
+ color: e.sourceType === "PICKUP" ? "info" : e.sourceType === "TRANSFER_IN" ? "primary" : "default",
605
+ label: e.sourceType === "TRANSFER_IN" ? "Transfer" : e.sourceType === "PICKUP" ? "Pickup" : e.sourceType === "PURCHASE" ? "Purchase" : e.sourceType,
606
+ sx: {
607
+ fontWeight: 700,
608
+ borderRadius: 1.5,
609
+ height: 22
610
+ }
611
+ }) : null
612
+ ]
613
+ }) }),
614
+ /* @__PURE__ */ t(l, {
615
+ align: "right",
616
+ children: k ? e.isQuarantined ? n ? /* @__PURE__ */ t(d, {
617
+ variant: "caption",
618
+ color: "text.disabled",
619
+ children: "Expired"
620
+ }) : /* @__PURE__ */ t(c, {
621
+ size: "small",
622
+ variant: "outlined",
623
+ color: "success",
624
+ startIcon: /* @__PURE__ */ t(Et, {}),
625
+ onClick: () => void Ve(e),
626
+ children: "Unquarantine"
627
+ }) : /* @__PURE__ */ r(g, {
628
+ direction: "row",
629
+ spacing: 1,
630
+ justifyContent: "flex-end",
631
+ children: [
632
+ n || e.status === "EXHAUSTED" || e.status === "IN_USE" || e.canBeQuarantined === !1 ? null : /* @__PURE__ */ t(c, {
633
+ size: "small",
634
+ variant: "outlined",
635
+ color: "error",
636
+ startIcon: /* @__PURE__ */ t(At, {}),
637
+ onClick: () => $({
638
+ open: !0,
639
+ batch: e,
640
+ reason: "OTHER",
641
+ notes: ""
642
+ }),
643
+ children: "Quarantine"
644
+ }),
645
+ Number(e.qtyRemaining ?? 0) > 0 ? /* @__PURE__ */ t(c, {
646
+ size: "small",
647
+ variant: "outlined",
648
+ color: "warning",
649
+ startIcon: /* @__PURE__ */ t(Ut, {}),
650
+ onClick: () => Be(e),
651
+ children: "Waste"
652
+ }) : null,
653
+ Qe && !n ? /* @__PURE__ */ t(c, {
654
+ size: "small",
655
+ variant: "outlined",
656
+ startIcon: /* @__PURE__ */ t(Wt, {}),
657
+ onClick: () => x({
658
+ ...U,
659
+ open: !0,
660
+ batch: e
661
+ }),
662
+ children: "Adjust"
663
+ }) : null
664
+ ]
665
+ }) : null
666
+ })
667
+ ]
668
+ }, e.id);
669
+ }) })]
670
+ })
671
+ ]
672
+ })]
673
+ }),
674
+ /* @__PURE__ */ r(V, {
675
+ open: h.open,
676
+ onClose: () => $({
677
+ ...h,
678
+ open: !1
679
+ }),
680
+ fullWidth: !0,
681
+ maxWidth: "sm",
682
+ children: [
683
+ /* @__PURE__ */ t(_, { children: "Quarantine Batch" }),
684
+ /* @__PURE__ */ t(X, {
685
+ dividers: !0,
686
+ children: /* @__PURE__ */ r(g, {
687
+ spacing: 2,
688
+ sx: { pt: 1 },
689
+ children: [
690
+ /* @__PURE__ */ r(d, {
691
+ variant: "body2",
692
+ children: [
693
+ "Product: ",
694
+ /* @__PURE__ */ t("strong", { children: ($e = h.batch) == null ? void 0 : $e.productName }),
695
+ /* @__PURE__ */ t("br", {}),
696
+ "Lot: ",
697
+ /* @__PURE__ */ t("strong", { children: ((Se = h.batch) == null ? void 0 : Se.lotNumber) || "—" }),
698
+ /* @__PURE__ */ t("br", {}),
699
+ "Remaining: ",
700
+ /* @__PURE__ */ t("strong", { children: (Te = h.batch) == null ? void 0 : Te.qtyRemaining })
701
+ ]
702
+ }),
703
+ /* @__PURE__ */ t(T, {
704
+ label: "Reason",
705
+ required: !0,
706
+ value: h.reason,
707
+ onChange: (e) => $({
708
+ ...h,
709
+ reason: e
710
+ }),
711
+ options: Ue,
712
+ error: !!oe(h.reason, "Reason"),
713
+ helperText: oe(h.reason, "Reason") || ""
714
+ }),
715
+ /* @__PURE__ */ t(N, {
716
+ label: "Notes",
717
+ size: "small",
718
+ multiline: !0,
719
+ minRows: 2,
720
+ fullWidth: !0,
721
+ value: h.notes,
722
+ onChange: (e) => $({
723
+ ...h,
724
+ notes: e.target.value
725
+ })
726
+ })
727
+ ]
728
+ })
729
+ }),
730
+ /* @__PURE__ */ r(Y, { children: [/* @__PURE__ */ t(c, {
731
+ onClick: () => $({
732
+ ...h,
733
+ open: !1
734
+ }),
735
+ children: "Cancel"
736
+ }), /* @__PURE__ */ t(c, {
737
+ variant: "contained",
738
+ color: "error",
739
+ disabled: !!oe(h.reason, "Reason"),
740
+ onClick: () => void Ge(),
741
+ children: "Quarantine"
742
+ })] })
743
+ ]
744
+ }),
745
+ /* @__PURE__ */ r(V, {
746
+ open: o.open,
747
+ onClose: () => {
748
+ D || w({
749
+ ...o,
750
+ open: !1
751
+ });
752
+ },
753
+ fullWidth: !0,
754
+ maxWidth: "sm",
755
+ children: [
756
+ /* @__PURE__ */ t(_, { children: "Mark Wastage" }),
757
+ /* @__PURE__ */ t(X, {
758
+ dividers: !0,
759
+ children: /* @__PURE__ */ r(g, {
760
+ spacing: 2,
761
+ sx: { pt: 1 },
762
+ children: [
763
+ /* @__PURE__ */ r(d, {
764
+ variant: "body2",
765
+ children: [
766
+ "Product: ",
767
+ /* @__PURE__ */ t("strong", { children: (ke = o.batch) == null ? void 0 : ke.productName }),
768
+ /* @__PURE__ */ t("br", {}),
769
+ "Lot: ",
770
+ /* @__PURE__ */ t("strong", { children: ((Ae = o.batch) == null ? void 0 : Ae.lotNumber) || "—" }),
771
+ /* @__PURE__ */ t("br", {}),
772
+ "Available to waste: ",
773
+ /* @__PURE__ */ t("strong", { children: ((Ee = o.batch) == null ? void 0 : Ee.qtyRemaining) ?? 0 })
774
+ ]
775
+ }),
776
+ /* @__PURE__ */ t(N, {
777
+ required: !0,
778
+ label: "Quantity to waste",
779
+ size: "small",
780
+ type: "number",
781
+ fullWidth: !0,
782
+ inputProps: {
783
+ min: 1,
784
+ max: O
785
+ },
786
+ value: o.qty,
787
+ onChange: (e) => w({
788
+ ...o,
789
+ qty: e.target.value
790
+ }),
791
+ error: !!re,
792
+ helperText: re || `Units to write off (max ${O}).`
793
+ }),
794
+ /* @__PURE__ */ t(T, {
795
+ label: "Reason",
796
+ required: !0,
797
+ value: o.reason,
798
+ onChange: (e) => w({
799
+ ...o,
800
+ reason: e
801
+ }),
802
+ options: st
803
+ }),
804
+ /* @__PURE__ */ t(N, {
805
+ label: "Comments",
806
+ size: "small",
807
+ multiline: !0,
808
+ minRows: 2,
809
+ fullWidth: !0,
810
+ value: o.comments,
811
+ onChange: (e) => w({
812
+ ...o,
813
+ comments: e.target.value
814
+ })
815
+ })
816
+ ]
817
+ })
818
+ }),
819
+ /* @__PURE__ */ r(Y, { children: [/* @__PURE__ */ t(c, {
820
+ onClick: () => w({
821
+ ...o,
822
+ open: !1
823
+ }),
824
+ disabled: D,
825
+ children: "Cancel"
826
+ }), /* @__PURE__ */ t(c, {
827
+ variant: "contained",
828
+ color: "warning",
829
+ disabled: !Ie || D,
830
+ onClick: () => void Oe(),
831
+ children: D ? "Recording…" : "Mark Wastage"
832
+ })] })
833
+ ]
834
+ }),
835
+ /* @__PURE__ */ r(V, {
836
+ open: i.open,
837
+ onClose: () => {
838
+ F || x(U);
839
+ },
840
+ fullWidth: !0,
841
+ maxWidth: "sm",
842
+ children: [
843
+ /* @__PURE__ */ t(_, { children: "Adjust Batch Quantity" }),
844
+ /* @__PURE__ */ t(X, {
845
+ dividers: !0,
846
+ children: i.batch ? /* @__PURE__ */ r(g, {
847
+ spacing: 2,
848
+ sx: { pt: 1 },
849
+ children: [
850
+ /* @__PURE__ */ r(d, {
851
+ variant: "body2",
852
+ color: "text.secondary",
853
+ children: [
854
+ `${i.batch.productName}`,
855
+ i.batch.lotNumber ? ` · lot ${i.batch.lotNumber}` : "",
856
+ ` · ${i.batch.qtyRemaining} in stock now`
857
+ ]
858
+ }),
859
+ /* @__PURE__ */ t(le, {
860
+ severity: "info",
861
+ children: "Use this to add units the system is missing. To take units off, record them as wastage instead."
862
+ }),
863
+ /* @__PURE__ */ t(N, {
864
+ label: "Units to add",
865
+ type: "number",
866
+ size: "small",
867
+ required: !0,
868
+ inputProps: {
869
+ min: 1,
870
+ step: 1
871
+ },
872
+ value: i.delta,
873
+ onChange: (e) => x({
874
+ ...i,
875
+ delta: e.target.value
876
+ }),
877
+ error: !!ne,
878
+ helperText: ne || `Stock will go from ${i.batch.qtyRemaining} to ${Number(i.batch.qtyRemaining ?? 0) + H}.`
879
+ }),
880
+ /* @__PURE__ */ t(T, {
881
+ label: "Reason",
882
+ required: !0,
883
+ value: i.reasonCode,
884
+ onChange: (e) => x({
885
+ ...i,
886
+ reasonCode: e
887
+ }),
888
+ options: Me
889
+ }),
890
+ /* @__PURE__ */ t(N, {
891
+ label: "What was corrected",
892
+ required: !0,
893
+ size: "small",
894
+ multiline: !0,
895
+ minRows: 2,
896
+ fullWidth: !0,
897
+ value: i.comments,
898
+ onChange: (e) => x({
899
+ ...i,
900
+ comments: e.target.value
901
+ }),
902
+ helperText: "Required. Recorded in the ledger with the reason."
903
+ })
904
+ ]
905
+ }) : null
906
+ }),
907
+ /* @__PURE__ */ r(Y, { children: [/* @__PURE__ */ t(c, {
908
+ onClick: () => x(U),
909
+ disabled: F,
910
+ children: "Cancel"
911
+ }), /* @__PURE__ */ t(c, {
912
+ variant: "contained",
913
+ disabled: !xe || F,
914
+ onClick: () => void Fe(),
915
+ children: F ? "Recording…" : "Record Adjustment"
916
+ })] })
917
+ ]
918
+ }),
919
+ /* @__PURE__ */ r(V, {
920
+ open: f.open,
921
+ onClose: () => {
922
+ j || S({
923
+ ...f,
924
+ open: !1
925
+ });
926
+ },
927
+ fullWidth: !0,
928
+ maxWidth: "sm",
929
+ children: [
930
+ /* @__PURE__ */ t(_, { children: "Move Stock" }),
931
+ /* @__PURE__ */ t(X, {
932
+ dividers: !0,
933
+ children: /* @__PURE__ */ r(g, {
934
+ spacing: 2,
935
+ sx: { pt: 1 },
936
+ children: [
937
+ /* @__PURE__ */ r(d, {
938
+ variant: "body2",
939
+ color: "text.secondary",
940
+ children: [`Moving ${v.length} ${v.length === 1 ? "batch" : "batches"}. `, "Quantities, lots and open vials stay with each batch. Only the storage unit changes."]
941
+ }),
942
+ /* @__PURE__ */ t(T, {
943
+ label: "Move into",
944
+ required: !0,
945
+ value: f.toStorageUnitId,
946
+ onChange: (e) => S({
947
+ ...f,
948
+ toStorageUnitId: e
949
+ }),
950
+ options: ae.map((e) => ({
951
+ value: e.id,
952
+ label: `${e.unitName}${e.operatingTempMinCelsius != null && e.operatingTempMaxCelsius != null ? ` · ${e.operatingTempMinCelsius}°C to ${e.operatingTempMaxCelsius}°C` : ""}`
953
+ })),
954
+ slotProps: { popper: { style: {
955
+ width: "auto",
956
+ minWidth: 300
957
+ } } },
958
+ noOptionsText: "No other active storage unit at this facility",
959
+ helperText: "A unit that cannot hold one of these products' temperature range is refused when you save."
960
+ }),
961
+ /* @__PURE__ */ t(I, {
962
+ sx: {
963
+ maxHeight: 200,
964
+ overflowY: "auto"
965
+ },
966
+ children: /* @__PURE__ */ t(g, {
967
+ spacing: 0.5,
968
+ children: v.map((e) => /* @__PURE__ */ r(d, {
969
+ variant: "caption",
970
+ color: "text.secondary",
971
+ children: [
972
+ `${e.productName} · ${e.qtyRemaining} in stock`,
973
+ e.lotNumber ? ` · lot ${e.lotNumber}` : "",
974
+ ` · from ${e.storageUnitName ?? "no storage unit"}`,
975
+ e.isQuarantined ? " · quarantined" : ""
976
+ ]
977
+ }, e.id))
978
+ })
979
+ }),
980
+ /* @__PURE__ */ t(N, {
981
+ label: "Reason or note (optional)",
982
+ size: "small",
983
+ multiline: !0,
984
+ minRows: 2,
985
+ fullWidth: !0,
986
+ value: f.comments,
987
+ onChange: (e) => S({
988
+ ...f,
989
+ comments: e.target.value
990
+ }),
991
+ helperText: "Recorded on every ledger entry this creates, for example why the old unit was emptied."
992
+ })
993
+ ]
994
+ })
995
+ }),
996
+ /* @__PURE__ */ r(Y, { children: [/* @__PURE__ */ t(c, {
997
+ onClick: () => S({
998
+ ...f,
999
+ open: !1
1000
+ }),
1001
+ disabled: j,
1002
+ children: "Cancel"
1003
+ }), /* @__PURE__ */ t(c, {
1004
+ variant: "contained",
1005
+ disabled: !f.toStorageUnitId || j,
1006
+ onClick: () => void He(),
1007
+ children: j ? "Moving…" : "Move Stock"
1008
+ })] })
1009
+ ]
1010
+ })
1011
+ ]
1012
+ })] });
1013
+ }
1014
+ export {
1015
+ na as default
1016
+ };
1017
+ //# sourceMappingURL=InventoryPage-JadYMCzU-CzJQfQ2A.js.map