@argusoft/medplat-core 1.0.28 → 1.0.30

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 (229) hide show
  1. package/dist/AccessRights-xrday-L1.js +1023 -0
  2. package/dist/AccessRights-xrday-L1.js.map +1 -0
  3. package/dist/AddEditQueryBuilder-D-iQiVIe.js +365 -0
  4. package/dist/AddEditQueryBuilder-D-iQiVIe.js.map +1 -0
  5. package/dist/{AddFeatures-C0Z29oSd.js → AddFeatures-D1sU8RjY.js} +2 -2
  6. package/dist/{AddFeatures-C0Z29oSd.js.map → AddFeatures-D1sU8RjY.js.map} +1 -1
  7. package/dist/AddLabelModal-Bq-wRqv9.js +631 -0
  8. package/dist/AddLabelModal-Bq-wRqv9.js.map +1 -0
  9. package/dist/AddMenuConfiguration-e5BVXhmw.js +8547 -0
  10. package/dist/AddMenuConfiguration-e5BVXhmw.js.map +1 -0
  11. package/dist/{AddRoleDrawer-CQdzQZLb.js → AddRoleDrawer-0gqAK8N0.js} +62 -63
  12. package/dist/AddRoleDrawer-0gqAK8N0.js.map +1 -0
  13. package/dist/AppModal-CCtrQ5Tr.js +394 -0
  14. package/dist/AppModal-CCtrQ5Tr.js.map +1 -0
  15. package/dist/BrandsPage-DmRW5bhm-Bk1szrjI.js +387 -0
  16. package/dist/BrandsPage-DmRW5bhm-Bk1szrjI.js.map +1 -0
  17. package/dist/CategoriesPage-BsS5IQh3-B03lWRY5.js +391 -0
  18. package/dist/CategoriesPage-BsS5IQh3-B03lWRY5.js.map +1 -0
  19. package/dist/{ChangePasswordModalCore-CDxkeIIM.js → ChangePasswordModalCore-BPsJquTS.js} +1606 -1611
  20. package/dist/ChangePasswordModalCore-BPsJquTS.js.map +1 -0
  21. package/dist/{ConditionConfig-DSsgGEXS.js → ConditionConfig-Ddz9halE.js} +2 -2
  22. package/dist/ConditionConfig-Ddz9halE.js.map +1 -0
  23. package/dist/DashboardPage-C3bKc5na-sBd9Yqbi.js +435 -0
  24. package/dist/DashboardPage-C3bKc5na-sBd9Yqbi.js.map +1 -0
  25. package/dist/{EntityManagement-GaYsBTvf.js → EntityManagement-CPQL6qBj.js} +2 -2
  26. package/dist/{EntityManagement-GaYsBTvf.js.map → EntityManagement-CPQL6qBj.js.map} +1 -1
  27. package/dist/EventConfig-BmLemzX3.js +26 -0
  28. package/dist/EventConfig-BmLemzX3.js.map +1 -0
  29. package/dist/{EventConfigurations-kNtAj_WM.js → EventConfigurations-Bzh1qWXU.js} +31 -30
  30. package/dist/{EventConfigurations-kNtAj_WM.js.map → EventConfigurations-Bzh1qWXU.js.map} +1 -1
  31. package/dist/{EventsExceptionModal-D4Bf1ilS.js → EventsExceptionModal-B2SRrnB1.js} +2 -2
  32. package/dist/{EventsExceptionModal-D4Bf1ilS.js.map → EventsExceptionModal-B2SRrnB1.js.map} +1 -1
  33. package/dist/EventsSkeleton-BIcPks4T.js +61 -0
  34. package/dist/EventsSkeleton-BIcPks4T.js.map +1 -0
  35. package/dist/FacilityPicker-BiZeupmP-CyPHmj6b.js +79 -0
  36. package/dist/FacilityPicker-BiZeupmP-CyPHmj6b.js.map +1 -0
  37. package/dist/FeatureMenu-DYJmDt7q.js +521 -0
  38. package/dist/FeatureMenu-DYJmDt7q.js.map +1 -0
  39. package/dist/Features-Dne21RWu.js +14 -0
  40. package/dist/Features-Dne21RWu.js.map +1 -0
  41. package/dist/{FhirServerList-Dkq7Kbes.js → FhirServerList-DuTwnngN.js} +19 -19
  42. package/dist/{FhirServerList-Dkq7Kbes.js.map → FhirServerList-DuTwnngN.js.map} +1 -1
  43. package/dist/{FhirServerWizard-Db6Hm4bQ.js → FhirServerWizard-DZI8Olku.js} +15 -15
  44. package/dist/{FhirServerWizard-Db6Hm4bQ.js.map → FhirServerWizard-DZI8Olku.js.map} +1 -1
  45. package/dist/FlywayQuery-CQygj51V.js +179 -0
  46. package/dist/FlywayQuery-CQygj51V.js.map +1 -0
  47. package/dist/{ManageNotification-CaBAOhji.js → Google-DQxMfbaL.js} +1725 -2652
  48. package/dist/{ManageNotification-CaBAOhji.js.map → Google-DQxMfbaL.js.map} +1 -1
  49. package/dist/GrantPermissionModal-BDN66Atn.js +236 -0
  50. package/dist/GrantPermissionModal-BDN66Atn.js.map +1 -0
  51. package/dist/ImmunizationConfigurationBase-Di1KO3oW.js +7639 -0
  52. package/dist/ImmunizationConfigurationBase-Di1KO3oW.js.map +1 -0
  53. package/dist/ImmunizationConfigurationBase.css +1 -1
  54. package/dist/ImmunizationConfigurationsList-TZcLDEci.js +369 -0
  55. package/dist/ImmunizationConfigurationsList-TZcLDEci.js.map +1 -0
  56. package/dist/InventoryPage-C_AxSy7A-QLvlL4rE.js +665 -0
  57. package/dist/InventoryPage-C_AxSy7A-QLvlL4rE.js.map +1 -0
  58. package/dist/LanguagesModal-B3NTebYT.js +352 -0
  59. package/dist/LanguagesModal-B3NTebYT.js.map +1 -0
  60. package/dist/ManageDynamicFeature-BU0I45dd.js +4475 -0
  61. package/dist/ManageDynamicFeature-BU0I45dd.js.map +1 -0
  62. package/dist/{ManageEventConfiguration-DV3I5POA.js → ManageEventConfiguration-CoYcpjR9.js} +465 -397
  63. package/dist/ManageEventConfiguration-CoYcpjR9.js.map +1 -0
  64. package/dist/ManageNotification-C5MhV77Q.js +934 -0
  65. package/dist/ManageNotification-C5MhV77Q.js.map +1 -0
  66. package/dist/{ManageRole-CGYfglpo.js → ManageRole-CNZBRKGU.js} +32 -30
  67. package/dist/ManageRole-CNZBRKGU.js.map +1 -0
  68. package/dist/ManageTranslation-vRiptUAP.js +833 -0
  69. package/dist/ManageTranslation-vRiptUAP.js.map +1 -0
  70. package/dist/ManageTranslation.css +1 -1
  71. package/dist/{ManageUser-AY1EUDLI.js → ManageUser-DCFkUMV9.js} +1722 -1586
  72. package/dist/ManageUser-DCFkUMV9.js.map +1 -0
  73. package/dist/MemberProfileCard-BdUNgHRB-VywqQdFF.js +272 -0
  74. package/dist/MemberProfileCard-BdUNgHRB-VywqQdFF.js.map +1 -0
  75. package/dist/MobileAnalytics-pQoE8cG1.js +16888 -0
  76. package/dist/MobileAnalytics-pQoE8cG1.js.map +1 -0
  77. package/dist/MobileMenuManagement-Cf8IZlla.js +108 -0
  78. package/dist/MobileMenuManagement-Cf8IZlla.js.map +1 -0
  79. package/dist/{MobileTypeEventConfigModal-BxLympIO.js → MobileTypeEventConfigModal-BeveaX0C.js} +2 -2
  80. package/dist/MobileTypeEventConfigModal-BeveaX0C.js.map +1 -0
  81. package/dist/NotificationFlywayQuery-BAHVjf6N.js +247 -0
  82. package/dist/NotificationFlywayQuery-BAHVjf6N.js.map +1 -0
  83. package/dist/{NotificationList-C3Vb_jKU.js → NotificationList-DEyRZEuM.js} +109 -110
  84. package/dist/NotificationList-DEyRZEuM.js.map +1 -0
  85. package/dist/{OtherTypeEventConfigModal-BeG1GrUi.js → OtherTypeEventConfigModal-CM6VkdmY.js} +570 -478
  86. package/dist/OtherTypeEventConfigModal-CM6VkdmY.js.map +1 -0
  87. package/dist/PaymentCreatePage-CIVe0P0p-25BQVpOX.js +482 -0
  88. package/dist/PaymentCreatePage-CIVe0P0p-25BQVpOX.js.map +1 -0
  89. package/dist/PaymentsPage-BvPe5Q9F-D2gfziwW.js +157 -0
  90. package/dist/PaymentsPage-BvPe5Q9F-D2gfziwW.js.map +1 -0
  91. package/dist/PermissionsModal-CCYkcKlC.js +151 -0
  92. package/dist/PermissionsModal-CCYkcKlC.js.map +1 -0
  93. package/dist/PickupBatchLinesEditor-DHmcAG23-DL2p6IKJ.js +119 -0
  94. package/dist/PickupBatchLinesEditor-DHmcAG23-DL2p6IKJ.js.map +1 -0
  95. package/dist/PickupCreatePage-CB0Sl0Hb-Mmj7zESG.js +783 -0
  96. package/dist/PickupCreatePage-CB0Sl0Hb-Mmj7zESG.js.map +1 -0
  97. package/dist/PickupsPage-Ctpghavs-CUp4uIZq.js +818 -0
  98. package/dist/PickupsPage-Ctpghavs-CUp4uIZq.js.map +1 -0
  99. package/dist/PmGuard-b10TGXEi-G3N0G_Wg.js +599 -0
  100. package/dist/PmGuard-b10TGXEi-G3N0G_Wg.js.map +1 -0
  101. package/dist/ProductEditPage-C1thoKHu-URQaZ6st.js +1302 -0
  102. package/dist/ProductEditPage-C1thoKHu-URQaZ6st.js.map +1 -0
  103. package/dist/ProductsPage-CupVmOD4-D45a_hf-.js +252 -0
  104. package/dist/ProductsPage-CupVmOD4-D45a_hf-.js.map +1 -0
  105. package/dist/PurchaseCreatePage-YD3NmhPQ-2j4etSjM.js +648 -0
  106. package/dist/PurchaseCreatePage-YD3NmhPQ-2j4etSjM.js.map +1 -0
  107. package/dist/PurchaseRequestDetailPage-Dg_MRY_N-D1bgTEAn.js +1577 -0
  108. package/dist/PurchaseRequestDetailPage-Dg_MRY_N-D1bgTEAn.js.map +1 -0
  109. package/dist/PurchaseRequestsPage-DPAPzpmm-mDH2IrTl.js +279 -0
  110. package/dist/PurchaseRequestsPage-DPAPzpmm-mDH2IrTl.js.map +1 -0
  111. package/dist/PurchasesPage-It1GHiXl-eH4IsF_U.js +293 -0
  112. package/dist/PurchasesPage-It1GHiXl-eH4IsF_U.js.map +1 -0
  113. package/dist/QueryBuilder-CXaBe6sr.js +478 -0
  114. package/dist/QueryBuilder-CXaBe6sr.js.map +1 -0
  115. package/dist/{RoleManagement-BPl2cE27.js → RoleManagement-s8iNx2Mu.js} +131 -142
  116. package/dist/RoleManagement-s8iNx2Mu.js.map +1 -0
  117. package/dist/Roles-BIyiic67.js +14 -0
  118. package/dist/Roles-BIyiic67.js.map +1 -0
  119. package/dist/SaleCreatePage-C9kFmTvm-B3Y0o4CX.js +544 -0
  120. package/dist/SaleCreatePage-C9kFmTvm-B3Y0o4CX.js.map +1 -0
  121. package/dist/SalesPage-D18DCseD-BxktGDRQ.js +315 -0
  122. package/dist/SalesPage-D18DCseD-BxktGDRQ.js.map +1 -0
  123. package/dist/{ServerSyncModal-D_oFpv3C.js → ServerSyncModal-92U3xtqI.js} +84 -85
  124. package/dist/ServerSyncModal-92U3xtqI.js.map +1 -0
  125. package/dist/SettingsPage-VsxI-ano-DcmtUUEj.js +747 -0
  126. package/dist/SettingsPage-VsxI-ano-DcmtUUEj.js.map +1 -0
  127. package/dist/ShowFlywayQuery-D10Olk5Z.js +154 -0
  128. package/dist/ShowFlywayQuery-D10Olk5Z.js.map +1 -0
  129. package/dist/{ShowFlywayQuery-DVRCd384.js → ShowFlywayQuery-D1y_4A1u.js} +161 -121
  130. package/dist/ShowFlywayQuery-D1y_4A1u.js.map +1 -0
  131. package/dist/ShowQueryHistory-DRBKYDKk.js +313 -0
  132. package/dist/ShowQueryHistory-DRBKYDKk.js.map +1 -0
  133. package/dist/StorageUnitsPage-7EqwuMOI-BwUso1Th.js +721 -0
  134. package/dist/StorageUnitsPage-7EqwuMOI-BwUso1Th.js.map +1 -0
  135. package/dist/SubMenu-eEDhZUvh.js +317 -0
  136. package/dist/SubMenu-eEDhZUvh.js.map +1 -0
  137. package/dist/{TableDetails-Cf_YfnY2.js → TableDetails-BtafRxXb.js} +1069 -831
  138. package/dist/TableDetails-BtafRxXb.js.map +1 -0
  139. package/dist/{TableList-D6jnIbnz.js → TableList-Dpo6dO7S.js} +2 -2
  140. package/dist/{TableList-D6jnIbnz.js.map → TableList-Dpo6dO7S.js.map} +1 -1
  141. package/dist/TransactionsPage-DrH53pVS-BkhIGB6C.js +746 -0
  142. package/dist/TransactionsPage-DrH53pVS-BkhIGB6C.js.map +1 -0
  143. package/dist/TransferCreatePage-CuvoMrYH-DTTfHjz-.js +315 -0
  144. package/dist/TransferCreatePage-CuvoMrYH-DTTfHjz-.js.map +1 -0
  145. package/dist/TransfersPage-Cf701t8s-BBbN7cBf.js +476 -0
  146. package/dist/TransfersPage-Cf701t8s-BBbN7cBf.js.map +1 -0
  147. package/dist/{TypeConfiguration-37wp-gsl.js → TypeConfiguration-3O6ABrK-.js} +2 -2
  148. package/dist/{TypeConfiguration-37wp-gsl.js.map → TypeConfiguration-3O6ABrK-.js.map} +1 -1
  149. package/dist/{UserList-Bc8gYxRL.js → UserList-DgPxsnj2.js} +253 -236
  150. package/dist/{UserList-Bc8gYxRL.js.map → UserList-DgPxsnj2.js.map} +1 -1
  151. package/dist/Users-Bpc4Sazd.js +41 -0
  152. package/dist/Users-Bpc4Sazd.js.map +1 -0
  153. package/dist/VialsPage-8oAc1yFv-Cl3FUXBJ.js +321 -0
  154. package/dist/VialsPage-8oAc1yFv-Cl3FUXBJ.js.map +1 -0
  155. package/dist/{WidgetList-Dw_FmbbE.js → WidgetList-D7YuWfDD.js} +2 -2
  156. package/dist/{WidgetList-Dw_FmbbE.js.map → WidgetList-D7YuWfDD.js.map} +1 -1
  157. package/dist/constants-ClZJY2x1-MkSWn6TZ.js +434 -0
  158. package/dist/constants-ClZJY2x1-MkSWn6TZ.js.map +1 -0
  159. package/dist/dashboardLayoutUtils-D1xCAxp3.js +405 -0
  160. package/dist/dashboardLayoutUtils-D1xCAxp3.js.map +1 -0
  161. package/dist/format-UOyOu75i-D0GyylyQ.js +63 -0
  162. package/dist/format-UOyOu75i-D0GyylyQ.js.map +1 -0
  163. package/dist/index.css +1 -1
  164. package/dist/index.js +4 -752
  165. package/dist/index.js.map +1 -1
  166. package/dist/index.lib-Dn8PMkeD.js +862 -0
  167. package/dist/index.lib-Dn8PMkeD.js.map +1 -0
  168. package/dist/useFieldErrors-hDG8ox_x-DbSAzrGo.js +28 -0
  169. package/dist/useFieldErrors-hDG8ox_x-DbSAzrGo.js.map +1 -0
  170. package/dist/validation-BzlHnL-r-CCJm2utQ.js +125 -0
  171. package/dist/validation-BzlHnL-r-CCJm2utQ.js.map +1 -0
  172. package/package.json +5 -4
  173. package/dist/AccessRights-CHu27ZOw.js +0 -1262
  174. package/dist/AccessRights-CHu27ZOw.js.map +0 -1
  175. package/dist/AddEditQueryBuilder-Brdnm6rQ.js +0 -313
  176. package/dist/AddEditQueryBuilder-Brdnm6rQ.js.map +0 -1
  177. package/dist/AddLabelModal-DFllBVcd.js +0 -734
  178. package/dist/AddLabelModal-DFllBVcd.js.map +0 -1
  179. package/dist/AddMenuConfiguration-BSQLl88V.js +0 -6570
  180. package/dist/AddMenuConfiguration-BSQLl88V.js.map +0 -1
  181. package/dist/AddRoleDrawer-CQdzQZLb.js.map +0 -1
  182. package/dist/AppModal-CtG2GjD_.js +0 -428
  183. package/dist/AppModal-CtG2GjD_.js.map +0 -1
  184. package/dist/ChangePasswordModalCore-CDxkeIIM.js.map +0 -1
  185. package/dist/ConditionConfig-DSsgGEXS.js.map +0 -1
  186. package/dist/EventsSkeleton-8iiETGcf.js +0 -76
  187. package/dist/EventsSkeleton-8iiETGcf.js.map +0 -1
  188. package/dist/FeatureMenu-jl7-Tk6y.js +0 -265
  189. package/dist/FeatureMenu-jl7-Tk6y.js.map +0 -1
  190. package/dist/Features-CObdzJp_.js +0 -13
  191. package/dist/Features-CObdzJp_.js.map +0 -1
  192. package/dist/FlywayQuery-Cx2sly6g.js +0 -169
  193. package/dist/FlywayQuery-Cx2sly6g.js.map +0 -1
  194. package/dist/ImmunizationConfigurationBase-DZGqwda2.js +0 -5910
  195. package/dist/ImmunizationConfigurationBase-DZGqwda2.js.map +0 -1
  196. package/dist/ImmunizationConfigurationsList-DdSZicTP.js +0 -344
  197. package/dist/ImmunizationConfigurationsList-DdSZicTP.js.map +0 -1
  198. package/dist/LanguagesModal-D6VfaGrl.js +0 -394
  199. package/dist/LanguagesModal-D6VfaGrl.js.map +0 -1
  200. package/dist/ManageDynamicFeature-BhONvfC_.js +0 -4189
  201. package/dist/ManageDynamicFeature-BhONvfC_.js.map +0 -1
  202. package/dist/ManageEventConfiguration-DV3I5POA.js.map +0 -1
  203. package/dist/ManageRole-CGYfglpo.js.map +0 -1
  204. package/dist/ManageTranslation-B4C9-lWD.js +0 -625
  205. package/dist/ManageTranslation-B4C9-lWD.js.map +0 -1
  206. package/dist/ManageUser-AY1EUDLI.js.map +0 -1
  207. package/dist/MobileMenuManagement-CVAKyKDa.js +0 -112
  208. package/dist/MobileMenuManagement-CVAKyKDa.js.map +0 -1
  209. package/dist/MobileTypeEventConfigModal-BxLympIO.js.map +0 -1
  210. package/dist/NotificationFlywayQuery-BY8Zzml_.js +0 -244
  211. package/dist/NotificationFlywayQuery-BY8Zzml_.js.map +0 -1
  212. package/dist/NotificationList-C3Vb_jKU.js.map +0 -1
  213. package/dist/OtherTypeEventConfigModal-BeG1GrUi.js.map +0 -1
  214. package/dist/QueryBuilder-z7eqfd7D.js +0 -383
  215. package/dist/QueryBuilder-z7eqfd7D.js.map +0 -1
  216. package/dist/RoleManagement-BPl2cE27.js.map +0 -1
  217. package/dist/ServerSyncModal-D_oFpv3C.js.map +0 -1
  218. package/dist/ShowFlywayQuery-DVRCd384.js.map +0 -1
  219. package/dist/ShowFlywayQuery-tj42YQAS.js +0 -130
  220. package/dist/ShowFlywayQuery-tj42YQAS.js.map +0 -1
  221. package/dist/ShowQueryHistory-BDN0tzHg.js +0 -190
  222. package/dist/ShowQueryHistory-BDN0tzHg.js.map +0 -1
  223. package/dist/SubMenu-DYxAPH2Z.js +0 -191
  224. package/dist/SubMenu-DYxAPH2Z.js.map +0 -1
  225. package/dist/TableDetails-Cf_YfnY2.js.map +0 -1
  226. package/dist/Users-CsJ08Kjm.js +0 -40
  227. package/dist/Users-CsJ08Kjm.js.map +0 -1
  228. package/dist/dashboardLayoutUtils-Bt5HA96J.js +0 -265
  229. package/dist/dashboardLayoutUtils-Bt5HA96J.js.map +0 -1
@@ -0,0 +1,1302 @@
1
+ import { C as Ne, W as we, G as S, g as ze, m as Le, k as Y, h as Ye, c as je, u as Qe, s as Ge, p as _e } from "./ImmunizationConfigurationBase-Di1KO3oW.js";
2
+ import { f as Ke, e as Xe, c as Ze, t as Je, n as Oe, s as ei, r as Pe } from "./constants-ClZJY2x1-MkSWn6TZ.js";
3
+ import { r as F, v as ii, d as ti, u as ni, l as ri, f as oi, C as ai } from "./validation-BzlHnL-r-CCJm2utQ.js";
4
+ import { n as li } from "./useFieldErrors-hDG8ox_x-DbSAzrGo.js";
5
+ import { Y as si, Z as ci, Q as ui, q as di } from "./PmGuard-b10TGXEi-G3N0G_Wg.js";
6
+ import { useState as I, useMemo as Ee, useEffect as oe, useRef as Ie } from "react";
7
+ import { jsxs as u, jsx as e, Fragment as mi } from "react/jsx-runtime";
8
+ import te from "prop-types";
9
+ import { Box as E, Alert as Be, Card as ne, CardContent as re, Typography as v, Grid as a, TextField as T, FormControlLabel as W, Checkbox as q, Stack as H, Divider as pi, Button as _, CircularProgress as He, IconButton as ke } from "@mui/material";
10
+ import { v4 as le } from "uuid";
11
+ import gi from "@mui/icons-material/AddRounded";
12
+ import { useParams as hi, useNavigate as fi } from "react-router-dom";
13
+ import vi from "@mui/icons-material/SaveRounded";
14
+ import Ci from "@mui/icons-material/DeleteOutlineRounded";
15
+ import xi from "@mui/icons-material/AddPhotoAlternateRounded";
16
+ import bi from "@mui/icons-material/CloseRounded";
17
+ var K = 5, yi = 5 * 1024 * 1024, z = {
18
+ display: "block",
19
+ fontWeight: 800,
20
+ letterSpacing: 0.6,
21
+ color: "text.secondary"
22
+ };
23
+ function ae() {
24
+ return {
25
+ key: le(),
26
+ profileType: "AGE_BASED",
27
+ fromAge: "",
28
+ fromUnit: "YEARS",
29
+ toAge: "",
30
+ toUnit: "YEARS",
31
+ doseAmount: ""
32
+ };
33
+ }
34
+ var L = {
35
+ vaccineCode: "",
36
+ vialVolumeMl: "",
37
+ singleDose: !1,
38
+ profiles: [ae()],
39
+ openVialValidityHours: 6,
40
+ openVialValidityUnit: "HOURS",
41
+ maxConcurrentOpenVials: 2,
42
+ requiresReconstitution: !1,
43
+ reconstitutedValidityHours: "",
44
+ reconstitutedValidityUnit: "HOURS",
45
+ route: "",
46
+ storageTempMinCelsius: "",
47
+ storageTempMaxCelsius: "",
48
+ comments: ""
49
+ };
50
+ function Vi(g, k) {
51
+ var w;
52
+ let V = !k && !!g.singleDose, U = (C) => C === "" || C == null ? null : Number(C);
53
+ return {
54
+ vaccineCode: (w = g.vaccineCode) == null ? void 0 : w.trim().toUpperCase(),
55
+ vialVolumeMl: Number(g.vialVolumeMl),
56
+ singleDose: V,
57
+ profiles: V ? [] : (g.profiles ?? []).map((C) => {
58
+ let B = U(C.toAge);
59
+ return {
60
+ profileType: C.profileType || "AGE_BASED",
61
+ fromAge: U(C.fromAge),
62
+ fromUnit: C.fromUnit || "YEARS",
63
+ toAge: B,
64
+ toUnit: B == null ? null : C.toUnit || "YEARS",
65
+ doseAmount: U(C.doseAmount)
66
+ };
67
+ }),
68
+ openVialValidityHours: Number(g.openVialValidityHours ?? 6),
69
+ openVialValidityUnit: g.openVialValidityUnit || "HOURS",
70
+ maxConcurrentOpenVials: V ? null : Number(g.maxConcurrentOpenVials ?? 2),
71
+ requiresReconstitution: !!g.requiresReconstitution,
72
+ reconstitutedValidityHours: U(g.reconstitutedValidityHours),
73
+ reconstitutedValidityUnit: g.reconstitutedValidityUnit || "HOURS",
74
+ route: g.route || null,
75
+ storageTempMinCelsius: U(g.storageTempMinCelsius),
76
+ storageTempMaxCelsius: U(g.storageTempMaxCelsius),
77
+ comments: g.comments || null
78
+ };
79
+ }
80
+ function Wi() {
81
+ var ce, ue, de, me, pe, ge, he, fe, ve, Ce, xe, be, ye, Ve, Ae, Te, Me, Ue, Re, Se;
82
+ let { productId: g } = hi(), k = fi(), [V, U] = I(!0), [w, C] = I(""), [B, j] = I(!1), [$, Q] = I([]), [X, Z] = I([]), [J, d] = I([]), n = li(), f = ((ce = Ne()) == null ? void 0 : ce.manageSales) !== !1, [t, R] = I({
83
+ id: g,
84
+ name: "",
85
+ categoryId: "",
86
+ brandId: "",
87
+ description: "",
88
+ unit: "",
89
+ unitOther: "",
90
+ hasExpiry: !0,
91
+ needsStorageUnit: !1,
92
+ notForSale: !1,
93
+ canBeQuarantined: !0,
94
+ salePriceMode: "FREE",
95
+ salePrice: "",
96
+ isActive: !0,
97
+ imageUuids: [],
98
+ vaccineConfig: null
99
+ }), O = Ee(() => $.find((i) => i.id === t.categoryId), [$, t.categoryId]), b = ((ue = O == null ? void 0 : O.code) == null ? void 0 : ue.toUpperCase()) === Ke, x = b && t.unit === "DROPS";
100
+ si("update.manage.productManagement.product", () => {
101
+ async function i() {
102
+ var l, h;
103
+ U(!0);
104
+ try {
105
+ let [s, p, M] = await Promise.all([
106
+ je(),
107
+ Qe(),
108
+ Ge().catch(() => [])
109
+ ]);
110
+ Q(s), Z(p), d(M);
111
+ try {
112
+ let o = await _e(g);
113
+ j(!1), R({
114
+ id: o.id,
115
+ name: o.name ?? "",
116
+ categoryId: o.categoryId ?? "",
117
+ brandId: o.brandId ?? "",
118
+ description: o.description ?? "",
119
+ unit: o.unit ?? "PIECE",
120
+ unitOther: o.unitOther ?? "",
121
+ hasExpiry: o.hasExpiry ?? !1,
122
+ needsStorageUnit: o.needsStorageUnit ?? !1,
123
+ notForSale: o.notForSale ?? !1,
124
+ canBeQuarantined: o.canBeQuarantined ?? !0,
125
+ salePriceMode: o.salePriceMode ?? "FREE",
126
+ salePrice: o.salePrice ?? "",
127
+ isActive: o.isActive ?? !0,
128
+ imageUuids: o.imageUuids ?? [],
129
+ vaccineConfig: o.vaccineConfig ? {
130
+ vaccineCode: o.vaccineConfig.vaccineCode ?? "",
131
+ vialVolumeMl: o.vaccineConfig.vialVolumeMl ?? "",
132
+ singleDose: o.vaccineConfig.singleDose ?? !1,
133
+ profiles: (o.vaccineConfig.profiles ?? []).length > 0 ? o.vaccineConfig.profiles.map((A) => ({
134
+ key: le(),
135
+ profileType: A.profileType ?? "AGE_BASED",
136
+ fromAge: A.fromAge ?? "",
137
+ fromUnit: A.fromUnit ?? "YEARS",
138
+ toAge: A.toAge ?? "",
139
+ toUnit: A.toUnit ?? "YEARS",
140
+ doseAmount: A.doseAmount ?? ""
141
+ })) : [ae()],
142
+ openVialValidityHours: o.vaccineConfig.openVialValidityHours ?? 6,
143
+ openVialValidityUnit: o.vaccineConfig.openVialValidityUnit ?? "HOURS",
144
+ maxConcurrentOpenVials: o.vaccineConfig.maxConcurrentOpenVials ?? 2,
145
+ requiresReconstitution: o.vaccineConfig.requiresReconstitution ?? !1,
146
+ reconstitutedValidityHours: o.vaccineConfig.reconstitutedValidityHours ?? "",
147
+ reconstitutedValidityUnit: o.vaccineConfig.reconstitutedValidityUnit ?? "HOURS",
148
+ route: o.vaccineConfig.route ?? "",
149
+ storageTempMinCelsius: o.vaccineConfig.storageTempMinCelsius ?? "",
150
+ storageTempMaxCelsius: o.vaccineConfig.storageTempMaxCelsius ?? "",
151
+ comments: o.vaccineConfig.comments ?? ""
152
+ } : null
153
+ });
154
+ } catch {
155
+ j(!0);
156
+ }
157
+ } catch (s) {
158
+ C(((h = (l = s == null ? void 0 : s.response) == null ? void 0 : l.data) == null ? void 0 : h.message) ?? (s == null ? void 0 : s.message) ?? "Failed to load product");
159
+ } finally {
160
+ U(!1);
161
+ }
162
+ }
163
+ i();
164
+ }, [g]), oe(() => {
165
+ R(b ? (i) => ({
166
+ ...i,
167
+ unit: i.unit === "VIAL" || i.unit === "DROPS" ? i.unit : "VIAL",
168
+ needsStorageUnit: !0,
169
+ vaccineConfig: i.vaccineConfig ?? { ...L }
170
+ }) : (i) => i.vaccineConfig ? {
171
+ ...i,
172
+ vaccineConfig: null
173
+ } : i);
174
+ }, [b]);
175
+ function c(i, l) {
176
+ R((h) => ({
177
+ ...h,
178
+ [i]: l
179
+ }));
180
+ }
181
+ function y(i, l) {
182
+ R((h) => ({
183
+ ...h,
184
+ vaccineConfig: {
185
+ ...h.vaccineConfig ?? L,
186
+ [i]: l
187
+ }
188
+ }));
189
+ }
190
+ function D(i, l, h) {
191
+ R((s) => {
192
+ let p = s.vaccineConfig ?? L, M = (p.profiles ?? []).slice();
193
+ return M[i] = {
194
+ ...M[i],
195
+ [l]: h
196
+ }, {
197
+ ...s,
198
+ vaccineConfig: {
199
+ ...p,
200
+ profiles: M
201
+ }
202
+ };
203
+ });
204
+ }
205
+ function Fe() {
206
+ R((i) => {
207
+ let l = i.vaccineConfig ?? L;
208
+ return {
209
+ ...i,
210
+ vaccineConfig: {
211
+ ...l,
212
+ profiles: [...l.profiles ?? [], ae()]
213
+ }
214
+ };
215
+ });
216
+ }
217
+ function We(i) {
218
+ R((l) => {
219
+ let h = l.vaccineConfig ?? L;
220
+ return {
221
+ ...l,
222
+ vaccineConfig: {
223
+ ...h,
224
+ profiles: (h.profiles ?? []).filter((s, p) => p !== i)
225
+ }
226
+ };
227
+ });
228
+ }
229
+ function qe() {
230
+ let i = (t.vaccineConfig ?? {}).profiles ?? [], l = x ? "drops" : "ml", h = x ? {
231
+ min: 0,
232
+ step: 1
233
+ } : {
234
+ step: "0.01",
235
+ min: 0
236
+ };
237
+ return /* @__PURE__ */ u(E, { children: [
238
+ /* @__PURE__ */ u(H, {
239
+ direction: "row",
240
+ justifyContent: "space-between",
241
+ alignItems: "center",
242
+ sx: { mb: 0.5 },
243
+ children: [/* @__PURE__ */ e(v, {
244
+ variant: "body2",
245
+ sx: { fontWeight: 700 },
246
+ children: "Dose profiles"
247
+ }), /* @__PURE__ */ e(_, {
248
+ size: "small",
249
+ variant: "outlined",
250
+ startIcon: /* @__PURE__ */ e(gi, {}),
251
+ onClick: Fe,
252
+ children: "Add profile"
253
+ })]
254
+ }),
255
+ /* @__PURE__ */ u(v, {
256
+ variant: "caption",
257
+ color: "text.secondary",
258
+ sx: {
259
+ display: "block",
260
+ mb: 1.5
261
+ },
262
+ children: [
263
+ "Each band sets one dose. It is measured from the patient's reference date, so the right dose is chosen automatically when giving the vaccine.",
264
+ /* @__PURE__ */ e("br", {}),
265
+ /* @__PURE__ */ e("strong", { children: "From" }),
266
+ " is included and ",
267
+ /* @__PURE__ */ e("strong", { children: "To" }),
268
+ " is not — a patient exactly at a To value falls into the next band. Leave To blank for no upper limit."
269
+ ]
270
+ }),
271
+ /* @__PURE__ */ e(H, {
272
+ spacing: 1.5,
273
+ children: i.map((s, p) => {
274
+ let M = `profiles.${p}.fromAge`, o = `profiles.${p}.toAge`, A = `profiles.${p}.doseAmount`, N = s.toAge !== "" && s.toAge != null;
275
+ return /* @__PURE__ */ e(E, {
276
+ sx: {
277
+ p: 1.5,
278
+ border: "1px solid",
279
+ borderColor: "divider",
280
+ borderRadius: 1.5
281
+ },
282
+ children: /* @__PURE__ */ u(a, {
283
+ container: !0,
284
+ spacing: 1.5,
285
+ alignItems: "flex-start",
286
+ children: [
287
+ /* @__PURE__ */ e(a, {
288
+ item: !0,
289
+ xs: 6,
290
+ md: 2,
291
+ children: /* @__PURE__ */ e(T, {
292
+ required: !0,
293
+ fullWidth: !0,
294
+ size: "small",
295
+ type: "number",
296
+ inputProps: {
297
+ min: 0,
298
+ step: 1
299
+ },
300
+ label: "From",
301
+ value: s.fromAge ?? "",
302
+ onChange: (m) => D(p, "fromAge", m.target.value),
303
+ onBlur: n.onBlur(M),
304
+ error: n.show(M) && !!r[M],
305
+ helperText: n.show(M) ? r[M] : ""
306
+ })
307
+ }),
308
+ /* @__PURE__ */ e(a, {
309
+ item: !0,
310
+ xs: 6,
311
+ md: 2,
312
+ children: /* @__PURE__ */ e(S, {
313
+ label: "From unit",
314
+ value: s.fromUnit || "YEARS",
315
+ onChange: (m) => D(p, "fromUnit", m),
316
+ options: Pe
317
+ })
318
+ }),
319
+ /* @__PURE__ */ e(a, {
320
+ item: !0,
321
+ xs: 6,
322
+ md: 2,
323
+ children: /* @__PURE__ */ e(T, {
324
+ fullWidth: !0,
325
+ size: "small",
326
+ type: "number",
327
+ inputProps: {
328
+ min: 0,
329
+ step: 1
330
+ },
331
+ label: "To",
332
+ value: s.toAge ?? "",
333
+ onChange: (m) => D(p, "toAge", m.target.value),
334
+ onBlur: n.onBlur(o),
335
+ error: n.show(o) && !!r[o],
336
+ helperText: n.show(o) && r[o] ? r[o] : "Blank = no limit"
337
+ })
338
+ }),
339
+ /* @__PURE__ */ e(a, {
340
+ item: !0,
341
+ xs: 6,
342
+ md: 2,
343
+ children: /* @__PURE__ */ e(S, {
344
+ label: "To unit",
345
+ disabled: !N,
346
+ value: N ? s.toUnit || "YEARS" : "",
347
+ onChange: (m) => D(p, "toUnit", m),
348
+ options: Pe
349
+ })
350
+ }),
351
+ /* @__PURE__ */ e(a, {
352
+ item: !0,
353
+ xs: 8,
354
+ md: 3,
355
+ children: /* @__PURE__ */ e(T, {
356
+ required: !0,
357
+ fullWidth: !0,
358
+ size: "small",
359
+ type: "number",
360
+ inputProps: h,
361
+ label: `Dose (${l})`,
362
+ value: s.doseAmount ?? "",
363
+ onChange: (m) => D(p, "doseAmount", m.target.value),
364
+ onBlur: n.onBlur(A),
365
+ error: n.show(A) && !!r[A],
366
+ helperText: n.show(A) ? r[A] : ""
367
+ })
368
+ }),
369
+ /* @__PURE__ */ e(a, {
370
+ item: !0,
371
+ xs: 4,
372
+ md: 1,
373
+ sx: { textAlign: "right" },
374
+ children: /* @__PURE__ */ e(ke, {
375
+ color: "error",
376
+ onClick: () => We(p),
377
+ disabled: i.length === 1,
378
+ children: /* @__PURE__ */ e(Ci, {})
379
+ })
380
+ })
381
+ ]
382
+ })
383
+ }, s.key);
384
+ })
385
+ }),
386
+ n.show("profiles") && r.profiles ? /* @__PURE__ */ e(v, {
387
+ variant: "caption",
388
+ color: "error",
389
+ sx: {
390
+ display: "block",
391
+ mt: 1
392
+ },
393
+ children: r.profiles
394
+ }) : null
395
+ ] });
396
+ }
397
+ let r = Ee(() => {
398
+ let i = {
399
+ name: F(t.name, "Product name"),
400
+ categoryId: F(t.categoryId, "Category"),
401
+ brandId: F(t.brandId, "Brand"),
402
+ unit: F(t.unit, "Unit"),
403
+ unitOther: t.unit === "OTHER" ? F(t.unitOther, "Custom unit") : "",
404
+ salePrice: f && !t.notForSale && t.salePriceMode !== "FREE" ? F(t.salePrice, "Sale price") || (Number(t.salePrice) > 0 ? "" : "Sale price must be greater than 0.") : ""
405
+ };
406
+ if (b && t.vaccineConfig) {
407
+ let l = t.vaccineConfig, h = !x && l.singleDose, s = ii(l.storageTempMinCelsius, l.storageTempMaxCelsius);
408
+ if (Object.assign(i, {
409
+ vaccineCode: F(l.vaccineCode, "Vaccine"),
410
+ vialVolumeMl: ri(l.vialVolumeMl),
411
+ openVialValidityHours: h ? "" : ni(l.openVialValidityHours),
412
+ reconstitutedValidityHours: ti(l.reconstitutedValidityHours, l.requiresReconstitution),
413
+ storageTempMinCelsius: s.min,
414
+ storageTempMaxCelsius: s.max
415
+ }), !h) {
416
+ let p = Number(l.vialVolumeMl), M = x ? "drops" : "ml", o = l.profiles ?? [];
417
+ o.length === 0 && (i.profiles = "Add at least one administration profile.");
418
+ let A = {
419
+ DAYS: 1,
420
+ WEEKS: 7,
421
+ MONTHS: 30,
422
+ YEARS: 365
423
+ }, N = (m, P) => Number(m) * (A[P] || 1);
424
+ o.forEach((m, P) => {
425
+ let ee = Number(m.fromAge);
426
+ if (m.fromAge === "" || m.fromAge == null ? i[`profiles.${P}.fromAge`] = "Required" : (!Number.isInteger(ee) || ee < 0) && (i[`profiles.${P}.fromAge`] = "Whole number, 0 or more"), m.toAge !== "" && m.toAge != null) {
427
+ let ie = Number(m.toAge);
428
+ !Number.isInteger(ie) || ie < 0 ? i[`profiles.${P}.toAge`] = "Whole number, 0 or more" : N(ie, m.toUnit) <= N(ee, m.fromUnit) && (i[`profiles.${P}.toAge`] = "Must be greater than From");
429
+ }
430
+ let G = Number(m.doseAmount);
431
+ m.doseAmount === "" || m.doseAmount == null ? i[`profiles.${P}.doseAmount`] = "Required" : !Number.isFinite(G) || G <= 0 ? i[`profiles.${P}.doseAmount`] = "Must be greater than 0" : x && !Number.isInteger(G) ? i[`profiles.${P}.doseAmount`] = "Whole number" : Number.isFinite(p) && p > 0 && G > p && (i[`profiles.${P}.doseAmount`] = `At most ${p} ${M}`);
432
+ }), i.maxConcurrentOpenVials = oi(l.maxConcurrentOpenVials);
433
+ }
434
+ }
435
+ return i;
436
+ }, [
437
+ t,
438
+ b,
439
+ x,
440
+ f
441
+ ]), se = ai(r);
442
+ async function De() {
443
+ var i, l, h;
444
+ if (!se) {
445
+ n.markAllTouched(), C("Please fix the highlighted fields and try again.");
446
+ return;
447
+ }
448
+ try {
449
+ await Le({
450
+ id: t.id,
451
+ name: t.name.trim(),
452
+ categoryId: t.categoryId,
453
+ brandId: t.brandId,
454
+ description: t.description || null,
455
+ unit: t.unit,
456
+ unitOther: t.unit === "OTHER" && ((i = t.unitOther) == null ? void 0 : i.trim()) || null,
457
+ hasExpiry: !!t.hasExpiry,
458
+ needsStorageUnit: !!t.needsStorageUnit,
459
+ notForSale: f ? !!t.notForSale : !1,
460
+ canBeQuarantined: !!t.canBeQuarantined,
461
+ salePriceMode: f && !t.notForSale ? t.salePriceMode : "FREE",
462
+ salePrice: f && !t.notForSale && t.salePriceMode !== "FREE" && t.salePrice !== "" ? Number(t.salePrice) : null,
463
+ isActive: !!t.isActive,
464
+ imageUuids: t.imageUuids ?? [],
465
+ vaccineConfig: t.vaccineConfig ? Vi(t.vaccineConfig, x) : null
466
+ }), Y({
467
+ message: "Product saved.",
468
+ type: "success"
469
+ }), k("/ui/medplat/manage/pm/products");
470
+ } catch (s) {
471
+ C(((h = (l = s == null ? void 0 : s.response) == null ? void 0 : l.data) == null ? void 0 : h.message) ?? (s == null ? void 0 : s.message) ?? "Failed to save product");
472
+ }
473
+ }
474
+ return /* @__PURE__ */ u(E, { children: [/* @__PURE__ */ e(ci, {}), /* @__PURE__ */ e(ui, {
475
+ perm: "update.manage.productManagement.product",
476
+ title: "You don’t have permission to create or edit products",
477
+ children: /* @__PURE__ */ u(di, {
478
+ title: B ? "Add Product" : "Edit Product",
479
+ subtitle: `Category: ${(O == null ? void 0 : O.code) ?? "—"}`,
480
+ actions: /* @__PURE__ */ u(H, {
481
+ direction: "row",
482
+ spacing: 1,
483
+ children: [/* @__PURE__ */ e(_, {
484
+ variant: "outlined",
485
+ onClick: () => k("/ui/medplat/manage/pm/products"),
486
+ children: "Cancel"
487
+ }), /* @__PURE__ */ e(_, {
488
+ variant: "contained",
489
+ startIcon: /* @__PURE__ */ e(vi, {}),
490
+ disabled: !se,
491
+ onClick: () => void De(),
492
+ children: "Save"
493
+ })]
494
+ }),
495
+ children: [
496
+ V ? /* @__PURE__ */ e(Be, {
497
+ severity: "info",
498
+ children: "Loading…"
499
+ }) : null,
500
+ w ? /* @__PURE__ */ e(Be, {
501
+ severity: "error",
502
+ sx: { mb: 2 },
503
+ children: w
504
+ }) : null,
505
+ /* @__PURE__ */ e(ne, {
506
+ sx: {
507
+ borderRadius: 1.5,
508
+ mb: 2
509
+ },
510
+ children: /* @__PURE__ */ u(re, { children: [/* @__PURE__ */ e(v, {
511
+ variant: "h6",
512
+ sx: {
513
+ fontWeight: 800,
514
+ mb: 2
515
+ },
516
+ children: "Basic Details"
517
+ }), /* @__PURE__ */ u(a, {
518
+ container: !0,
519
+ spacing: 2,
520
+ children: [
521
+ /* @__PURE__ */ e(a, {
522
+ item: !0,
523
+ xs: 12,
524
+ md: 6,
525
+ children: /* @__PURE__ */ e(T, {
526
+ required: !0,
527
+ fullWidth: !0,
528
+ size: "small",
529
+ label: "Product Name",
530
+ value: t.name,
531
+ inputProps: { maxLength: 255 },
532
+ onChange: (i) => c("name", i.target.value),
533
+ onBlur: n.onBlur("name"),
534
+ error: n.show("name") && !!r.name,
535
+ FormHelperTextProps: { component: "div" },
536
+ helperText: /* @__PURE__ */ e(we, {
537
+ message: n.show("name") ? r.name : "",
538
+ value: t.name,
539
+ max: 255
540
+ })
541
+ })
542
+ }),
543
+ /* @__PURE__ */ e(a, {
544
+ item: !0,
545
+ xs: 12,
546
+ md: 3,
547
+ children: /* @__PURE__ */ e(S, {
548
+ label: "Category",
549
+ required: !0,
550
+ value: t.categoryId,
551
+ onChange: (i) => c("categoryId", i),
552
+ onBlur: n.onBlur("categoryId"),
553
+ error: n.show("categoryId") && !!r.categoryId,
554
+ helperText: n.show("categoryId") ? r.categoryId : "",
555
+ options: $.map((i) => ({
556
+ value: i.id,
557
+ label: `${i.name} (${i.code})`
558
+ }))
559
+ })
560
+ }),
561
+ /* @__PURE__ */ e(a, {
562
+ item: !0,
563
+ xs: 12,
564
+ md: 3,
565
+ children: /* @__PURE__ */ e(S, {
566
+ label: "Brand",
567
+ required: !0,
568
+ value: t.brandId,
569
+ onChange: (i) => c("brandId", i),
570
+ onBlur: n.onBlur("brandId"),
571
+ error: n.show("brandId") && !!r.brandId,
572
+ helperText: n.show("brandId") ? r.brandId : "",
573
+ options: X.map((i) => ({
574
+ value: i.id,
575
+ label: i.name
576
+ }))
577
+ })
578
+ }),
579
+ b ? null : /* @__PURE__ */ e(a, {
580
+ item: !0,
581
+ xs: 12,
582
+ md: 3,
583
+ children: /* @__PURE__ */ e(S, {
584
+ label: "Unit",
585
+ required: !0,
586
+ value: t.unit,
587
+ onChange: (i) => c("unit", i),
588
+ onBlur: n.onBlur("unit"),
589
+ error: n.show("unit") && !!r.unit,
590
+ helperText: n.show("unit") && r.unit ? r.unit : "",
591
+ options: Xe
592
+ })
593
+ }),
594
+ !b && t.unit === "OTHER" ? /* @__PURE__ */ e(a, {
595
+ item: !0,
596
+ xs: 12,
597
+ md: 3,
598
+ children: /* @__PURE__ */ e(T, {
599
+ required: !0,
600
+ fullWidth: !0,
601
+ size: "small",
602
+ label: "Custom unit name",
603
+ value: t.unitOther,
604
+ inputProps: { maxLength: 50 },
605
+ onChange: (i) => c("unitOther", i.target.value),
606
+ onBlur: n.onBlur("unitOther"),
607
+ error: n.show("unitOther") && !!r.unitOther,
608
+ FormHelperTextProps: { component: "div" },
609
+ helperText: /* @__PURE__ */ e(we, {
610
+ message: n.show("unitOther") && r.unitOther ? r.unitOther : "e.g. Strip, Ampoule, Sachet",
611
+ value: t.unitOther,
612
+ max: 50
613
+ })
614
+ })
615
+ }) : null,
616
+ /* @__PURE__ */ e(a, {
617
+ item: !0,
618
+ xs: 6,
619
+ md: 3,
620
+ children: /* @__PURE__ */ e(W, {
621
+ control: /* @__PURE__ */ e(q, {
622
+ checked: !!t.hasExpiry,
623
+ disabled: b,
624
+ onChange: (i) => c("hasExpiry", i.target.checked)
625
+ }),
626
+ label: b ? "Has expiry (vaccine)" : "Has expiry"
627
+ })
628
+ }),
629
+ /* @__PURE__ */ e(a, {
630
+ item: !0,
631
+ xs: 6,
632
+ md: 3,
633
+ children: /* @__PURE__ */ e(W, {
634
+ control: /* @__PURE__ */ e(q, {
635
+ checked: !!t.needsStorageUnit,
636
+ disabled: b,
637
+ onChange: (i) => c("needsStorageUnit", i.target.checked)
638
+ }),
639
+ label: b ? "Needs storage unit (vaccine)" : "Needs storage unit"
640
+ })
641
+ }),
642
+ f ? /* @__PURE__ */ e(a, {
643
+ item: !0,
644
+ xs: 6,
645
+ md: 3,
646
+ children: /* @__PURE__ */ e(W, {
647
+ control: /* @__PURE__ */ e(q, {
648
+ checked: !!t.notForSale,
649
+ onChange: (i) => c("notForSale", i.target.checked)
650
+ }),
651
+ label: "Not for sale"
652
+ })
653
+ }) : null,
654
+ /* @__PURE__ */ e(a, {
655
+ item: !0,
656
+ xs: 6,
657
+ md: 3,
658
+ children: /* @__PURE__ */ e(W, {
659
+ control: /* @__PURE__ */ e(q, {
660
+ checked: !!t.canBeQuarantined,
661
+ onChange: (i) => c("canBeQuarantined", i.target.checked)
662
+ }),
663
+ label: "Can be quarantined"
664
+ })
665
+ }),
666
+ /* @__PURE__ */ e(a, {
667
+ item: !0,
668
+ xs: 6,
669
+ md: 3,
670
+ children: /* @__PURE__ */ e(W, {
671
+ control: /* @__PURE__ */ e(q, {
672
+ checked: !!t.isActive,
673
+ onChange: (i) => c("isActive", i.target.checked)
674
+ }),
675
+ label: "Active"
676
+ })
677
+ }),
678
+ f && !t.notForSale ? /* @__PURE__ */ u(mi, { children: [/* @__PURE__ */ e(a, {
679
+ item: !0,
680
+ xs: 12,
681
+ md: 4,
682
+ children: /* @__PURE__ */ e(S, {
683
+ label: "Sale price mode",
684
+ value: t.salePriceMode,
685
+ onChange: (i) => c("salePriceMode", i),
686
+ options: Ze,
687
+ helperText: "Fixed shows a locked price at sale time; MRP caps the entered price."
688
+ })
689
+ }), t.salePriceMode === "FREE" ? null : /* @__PURE__ */ e(a, {
690
+ item: !0,
691
+ xs: 12,
692
+ md: 4,
693
+ children: /* @__PURE__ */ e(T, {
694
+ required: !0,
695
+ fullWidth: !0,
696
+ size: "small",
697
+ type: "number",
698
+ inputProps: {
699
+ step: "0.01",
700
+ min: 0
701
+ },
702
+ label: t.salePriceMode === "FIXED" ? "Fixed sale price" : "Price cap (MRP)",
703
+ value: t.salePrice,
704
+ onChange: (i) => c("salePrice", i.target.value),
705
+ onBlur: n.onBlur("salePrice"),
706
+ error: n.show("salePrice") && !!r.salePrice,
707
+ helperText: n.show("salePrice") ? r.salePrice : ""
708
+ })
709
+ })] }) : null,
710
+ /* @__PURE__ */ e(a, {
711
+ item: !0,
712
+ xs: 12,
713
+ children: /* @__PURE__ */ e(T, {
714
+ fullWidth: !0,
715
+ size: "small",
716
+ multiline: !0,
717
+ minRows: 2,
718
+ label: "Description",
719
+ value: t.description,
720
+ onChange: (i) => c("description", i.target.value)
721
+ })
722
+ })
723
+ ]
724
+ })] })
725
+ }),
726
+ /* @__PURE__ */ e(ne, {
727
+ sx: {
728
+ borderRadius: 1.5,
729
+ mb: 2
730
+ },
731
+ children: /* @__PURE__ */ u(re, { children: [
732
+ /* @__PURE__ */ u(H, {
733
+ direction: "row",
734
+ justifyContent: "space-between",
735
+ alignItems: "center",
736
+ sx: { mb: 0.5 },
737
+ children: [/* @__PURE__ */ e(v, {
738
+ variant: "h6",
739
+ sx: { fontWeight: 800 },
740
+ children: "Product Images"
741
+ }), /* @__PURE__ */ u(v, {
742
+ variant: "caption",
743
+ color: "text.secondary",
744
+ children: [
745
+ "Optional · up to ",
746
+ K,
747
+ " images"
748
+ ]
749
+ })]
750
+ }),
751
+ /* @__PURE__ */ e(v, {
752
+ variant: "caption",
753
+ color: "text.secondary",
754
+ sx: {
755
+ display: "block",
756
+ mb: 2
757
+ },
758
+ children: "Add photos of the product or its packaging. The first image is used as the main picture."
759
+ }),
760
+ /* @__PURE__ */ e($e, {
761
+ value: t.imageUuids,
762
+ onChange: (i) => c("imageUuids", i)
763
+ })
764
+ ] })
765
+ }),
766
+ b ? /* @__PURE__ */ e(ne, {
767
+ sx: { borderRadius: 1.5 },
768
+ children: /* @__PURE__ */ u(re, { children: [
769
+ /* @__PURE__ */ u(H, {
770
+ direction: "row",
771
+ justifyContent: "space-between",
772
+ alignItems: "center",
773
+ sx: { mb: 2 },
774
+ children: [/* @__PURE__ */ e(v, {
775
+ variant: "h6",
776
+ sx: { fontWeight: 800 },
777
+ children: "Vaccine Configuration"
778
+ }), /* @__PURE__ */ e(v, {
779
+ variant: "caption",
780
+ color: "text.secondary",
781
+ children: "Required for vaccine products. Controls vial size, dosing, and shelf life rules."
782
+ })]
783
+ }),
784
+ /* @__PURE__ */ e(pi, { sx: { mb: 2 } }),
785
+ /* @__PURE__ */ u(a, {
786
+ container: !0,
787
+ spacing: 2,
788
+ children: [
789
+ /* @__PURE__ */ e(a, {
790
+ item: !0,
791
+ xs: 12,
792
+ children: /* @__PURE__ */ e(v, {
793
+ variant: "overline",
794
+ sx: z,
795
+ children: "Vaccine & measure"
796
+ })
797
+ }),
798
+ /* @__PURE__ */ e(a, {
799
+ item: !0,
800
+ xs: 12,
801
+ md: 4,
802
+ children: /* @__PURE__ */ e(S, {
803
+ label: "Vaccine",
804
+ required: !0,
805
+ value: ((de = t.vaccineConfig) == null ? void 0 : de.vaccineCode) || "",
806
+ onChange: (i) => y("vaccineCode", i),
807
+ onBlur: n.onBlur("vaccineCode"),
808
+ error: n.show("vaccineCode") && !!r.vaccineCode,
809
+ helperText: n.show("vaccineCode") && r.vaccineCode ? r.vaccineCode : "",
810
+ noOptionsText: "No vaccines configured in immunization master",
811
+ options: J.map((i) => ({
812
+ value: i.vaccineCode,
813
+ label: `${i.vaccineName} (${i.vaccineCode})`
814
+ }))
815
+ })
816
+ }),
817
+ /* @__PURE__ */ e(a, {
818
+ item: !0,
819
+ xs: 12,
820
+ md: 4,
821
+ children: /* @__PURE__ */ e(S, {
822
+ label: "Measured in",
823
+ value: t.unit,
824
+ onChange: (i) => c("unit", i),
825
+ options: Je,
826
+ helperText: "Vials are dosed in millilitres; drops are counted."
827
+ })
828
+ }),
829
+ /* @__PURE__ */ e(a, {
830
+ item: !0,
831
+ xs: 12,
832
+ md: 4,
833
+ children: /* @__PURE__ */ e(T, {
834
+ required: !0,
835
+ fullWidth: !0,
836
+ size: "small",
837
+ type: "number",
838
+ inputProps: x ? {
839
+ min: 1,
840
+ step: 1
841
+ } : {
842
+ step: "0.01",
843
+ min: 0
844
+ },
845
+ label: x ? "Drops per vial" : "Vial volume (ml)",
846
+ value: ((me = t.vaccineConfig) == null ? void 0 : me.vialVolumeMl) ?? "",
847
+ onChange: (i) => y("vialVolumeMl", i.target.value),
848
+ onBlur: n.onBlur("vialVolumeMl"),
849
+ error: n.show("vialVolumeMl") && !!r.vialVolumeMl,
850
+ helperText: n.show("vialVolumeMl") ? r.vialVolumeMl : x ? "Total drops in a fresh vial" : ""
851
+ })
852
+ }),
853
+ /* @__PURE__ */ e(a, {
854
+ item: !0,
855
+ xs: 12,
856
+ children: /* @__PURE__ */ e(v, {
857
+ variant: "overline",
858
+ sx: {
859
+ ...z,
860
+ mt: 1
861
+ },
862
+ children: "Dosing"
863
+ })
864
+ }),
865
+ x ? null : /* @__PURE__ */ u(a, {
866
+ item: !0,
867
+ xs: 12,
868
+ children: [/* @__PURE__ */ e(W, {
869
+ control: /* @__PURE__ */ e(q, {
870
+ checked: !!((pe = t.vaccineConfig) != null && pe.singleDose),
871
+ onChange: (i) => y("singleDose", i.target.checked)
872
+ }),
873
+ label: "Single dose vial"
874
+ }), /* @__PURE__ */ e(v, {
875
+ variant: "caption",
876
+ color: "text.secondary",
877
+ sx: {
878
+ display: "block",
879
+ ml: 4,
880
+ mt: -0.5
881
+ },
882
+ children: "One dose per vial — used up the moment it's opened, so there's no limit on how many can be open at once."
883
+ })]
884
+ }),
885
+ /* @__PURE__ */ e(a, {
886
+ item: !0,
887
+ xs: 12,
888
+ children: !x && ((ge = t.vaccineConfig) != null && ge.singleDose) ? /* @__PURE__ */ u(E, {
889
+ sx: {
890
+ p: 1.5,
891
+ border: "1px solid",
892
+ borderColor: "divider",
893
+ borderRadius: 1.5
894
+ },
895
+ children: [/* @__PURE__ */ e(v, {
896
+ variant: "body2",
897
+ sx: { fontWeight: 700 },
898
+ children: "Single dose"
899
+ }), /* @__PURE__ */ u(v, {
900
+ variant: "caption",
901
+ color: "text.secondary",
902
+ children: [
903
+ "Each vial is one dose of ",
904
+ ((he = t.vaccineConfig) == null ? void 0 : he.vialVolumeMl) || "—",
905
+ " ml, given to any patient. No dose profiles are needed."
906
+ ]
907
+ })]
908
+ }) : qe()
909
+ }),
910
+ /* @__PURE__ */ e(a, {
911
+ item: !0,
912
+ xs: 12,
913
+ children: /* @__PURE__ */ e(v, {
914
+ variant: "overline",
915
+ sx: {
916
+ ...z,
917
+ mt: 1
918
+ },
919
+ children: "Open vial & reconstitution"
920
+ })
921
+ }),
922
+ !x && ((fe = t.vaccineConfig) != null && fe.singleDose) ? null : /* @__PURE__ */ e(a, {
923
+ item: !0,
924
+ xs: 12,
925
+ md: 4,
926
+ children: /* @__PURE__ */ u(H, {
927
+ direction: "row",
928
+ spacing: 1,
929
+ children: [/* @__PURE__ */ e(T, {
930
+ required: !0,
931
+ fullWidth: !0,
932
+ size: "small",
933
+ type: "number",
934
+ inputProps: { min: 1 },
935
+ label: "Open vial validity",
936
+ value: ((ve = t.vaccineConfig) == null ? void 0 : ve.openVialValidityHours) ?? "",
937
+ onChange: (i) => y("openVialValidityHours", i.target.value),
938
+ onBlur: n.onBlur("openVialValidityHours"),
939
+ error: n.show("openVialValidityHours") && !!r.openVialValidityHours,
940
+ helperText: n.show("openVialValidityHours") ? r.openVialValidityHours : "How long the vial stays usable once opened"
941
+ }), /* @__PURE__ */ e(E, {
942
+ sx: {
943
+ minWidth: 132,
944
+ flexShrink: 0
945
+ },
946
+ children: /* @__PURE__ */ e(S, {
947
+ label: "Unit",
948
+ value: ((Ce = t.vaccineConfig) == null ? void 0 : Ce.openVialValidityUnit) || "HOURS",
949
+ onChange: (i) => y("openVialValidityUnit", i),
950
+ options: Oe
951
+ })
952
+ })]
953
+ })
954
+ }),
955
+ !x && ((xe = t.vaccineConfig) != null && xe.singleDose) ? null : /* @__PURE__ */ e(a, {
956
+ item: !0,
957
+ xs: 12,
958
+ md: 4,
959
+ children: /* @__PURE__ */ e(T, {
960
+ required: !0,
961
+ fullWidth: !0,
962
+ size: "small",
963
+ type: "number",
964
+ inputProps: {
965
+ min: 1,
966
+ max: 20
967
+ },
968
+ label: "Max concurrent open vials",
969
+ value: ((be = t.vaccineConfig) == null ? void 0 : be.maxConcurrentOpenVials) ?? "",
970
+ onChange: (i) => y("maxConcurrentOpenVials", i.target.value),
971
+ onBlur: n.onBlur("maxConcurrentOpenVials"),
972
+ error: n.show("maxConcurrentOpenVials") && !!r.maxConcurrentOpenVials,
973
+ helperText: n.show("maxConcurrentOpenVials") ? r.maxConcurrentOpenVials : ""
974
+ })
975
+ }),
976
+ /* @__PURE__ */ e(a, {
977
+ item: !0,
978
+ xs: 12,
979
+ children: /* @__PURE__ */ e(W, {
980
+ control: /* @__PURE__ */ e(q, {
981
+ checked: !!((ye = t.vaccineConfig) != null && ye.requiresReconstitution),
982
+ onChange: (i) => y("requiresReconstitution", i.target.checked)
983
+ }),
984
+ label: "Requires reconstitution"
985
+ })
986
+ }),
987
+ (Ve = t.vaccineConfig) != null && Ve.requiresReconstitution ? /* @__PURE__ */ e(a, {
988
+ item: !0,
989
+ xs: 12,
990
+ md: 4,
991
+ children: /* @__PURE__ */ u(H, {
992
+ direction: "row",
993
+ spacing: 1,
994
+ children: [/* @__PURE__ */ e(T, {
995
+ fullWidth: !0,
996
+ size: "small",
997
+ type: "number",
998
+ inputProps: { min: 1 },
999
+ required: !0,
1000
+ label: "Reconstituted validity",
1001
+ value: ((Ae = t.vaccineConfig) == null ? void 0 : Ae.reconstitutedValidityHours) ?? "",
1002
+ onChange: (i) => y("reconstitutedValidityHours", i.target.value),
1003
+ onBlur: n.onBlur("reconstitutedValidityHours"),
1004
+ error: n.show("reconstitutedValidityHours") && !!r.reconstitutedValidityHours,
1005
+ helperText: n.show("reconstitutedValidityHours") ? r.reconstitutedValidityHours : ""
1006
+ }), /* @__PURE__ */ e(E, {
1007
+ sx: {
1008
+ minWidth: 132,
1009
+ flexShrink: 0
1010
+ },
1011
+ children: /* @__PURE__ */ e(S, {
1012
+ label: "Unit",
1013
+ value: ((Te = t.vaccineConfig) == null ? void 0 : Te.reconstitutedValidityUnit) || "HOURS",
1014
+ onChange: (i) => y("reconstitutedValidityUnit", i),
1015
+ options: Oe
1016
+ })
1017
+ })]
1018
+ })
1019
+ }) : null,
1020
+ /* @__PURE__ */ e(a, {
1021
+ item: !0,
1022
+ xs: 12,
1023
+ children: /* @__PURE__ */ e(v, {
1024
+ variant: "overline",
1025
+ sx: {
1026
+ ...z,
1027
+ mt: 1
1028
+ },
1029
+ children: "Storage & route"
1030
+ })
1031
+ }),
1032
+ /* @__PURE__ */ e(a, {
1033
+ item: !0,
1034
+ xs: 12,
1035
+ md: 4,
1036
+ children: /* @__PURE__ */ e(S, {
1037
+ label: "Route of administration",
1038
+ value: ((Me = t.vaccineConfig) == null ? void 0 : Me.route) || "",
1039
+ onChange: (i) => y("route", i),
1040
+ options: ei
1041
+ })
1042
+ }),
1043
+ /* @__PURE__ */ e(a, {
1044
+ item: !0,
1045
+ xs: 6,
1046
+ md: 4,
1047
+ children: /* @__PURE__ */ e(T, {
1048
+ fullWidth: !0,
1049
+ size: "small",
1050
+ type: "number",
1051
+ inputProps: {
1052
+ step: "0.1",
1053
+ min: -90,
1054
+ max: 30
1055
+ },
1056
+ label: "Storage temp min (°C)",
1057
+ value: ((Ue = t.vaccineConfig) == null ? void 0 : Ue.storageTempMinCelsius) ?? "",
1058
+ onChange: (i) => y("storageTempMinCelsius", i.target.value),
1059
+ onBlur: n.onBlur("storageTempMinCelsius"),
1060
+ error: n.show("storageTempMinCelsius") && !!r.storageTempMinCelsius,
1061
+ helperText: n.show("storageTempMinCelsius") && r.storageTempMinCelsius ? r.storageTempMinCelsius : "−90°C to +30°C"
1062
+ })
1063
+ }),
1064
+ /* @__PURE__ */ e(a, {
1065
+ item: !0,
1066
+ xs: 6,
1067
+ md: 4,
1068
+ children: /* @__PURE__ */ e(T, {
1069
+ fullWidth: !0,
1070
+ size: "small",
1071
+ type: "number",
1072
+ inputProps: {
1073
+ step: "0.1",
1074
+ min: -90,
1075
+ max: 30
1076
+ },
1077
+ label: "Storage temp max (°C)",
1078
+ value: ((Re = t.vaccineConfig) == null ? void 0 : Re.storageTempMaxCelsius) ?? "",
1079
+ onChange: (i) => y("storageTempMaxCelsius", i.target.value),
1080
+ onBlur: n.onBlur("storageTempMaxCelsius"),
1081
+ error: n.show("storageTempMaxCelsius") && !!r.storageTempMaxCelsius,
1082
+ helperText: n.show("storageTempMaxCelsius") && r.storageTempMaxCelsius ? r.storageTempMaxCelsius : "−90°C to +30°C"
1083
+ })
1084
+ }),
1085
+ /* @__PURE__ */ e(a, {
1086
+ item: !0,
1087
+ xs: 12,
1088
+ children: /* @__PURE__ */ e(v, {
1089
+ variant: "overline",
1090
+ sx: {
1091
+ ...z,
1092
+ mt: 1
1093
+ },
1094
+ children: "Notes"
1095
+ })
1096
+ }),
1097
+ /* @__PURE__ */ e(a, {
1098
+ item: !0,
1099
+ xs: 12,
1100
+ children: /* @__PURE__ */ e(T, {
1101
+ fullWidth: !0,
1102
+ size: "small",
1103
+ multiline: !0,
1104
+ minRows: 2,
1105
+ label: "Comments",
1106
+ value: ((Se = t.vaccineConfig) == null ? void 0 : Se.comments) || "",
1107
+ onChange: (i) => y("comments", i.target.value)
1108
+ })
1109
+ })
1110
+ ]
1111
+ })
1112
+ ] })
1113
+ }) : null
1114
+ ]
1115
+ })
1116
+ })] });
1117
+ }
1118
+ function $e({ value: g, onChange: k }) {
1119
+ let V = g ?? [], U = Ie(null), [w, C] = I(!1), [B, j] = I({}), $ = Ie({});
1120
+ $.current = B;
1121
+ function Q(d, n) {
1122
+ j((f) => f[d] ? f : {
1123
+ ...f,
1124
+ [d]: n
1125
+ });
1126
+ }
1127
+ oe(() => {
1128
+ let d = !1;
1129
+ return V.forEach((n) => {
1130
+ $.current[n] || ze(n).then((f) => {
1131
+ d || Q(n, URL.createObjectURL(f));
1132
+ }).catch(() => {
1133
+ });
1134
+ }), () => {
1135
+ d = !0;
1136
+ };
1137
+ }, [V]), oe(() => () => {
1138
+ Object.values($.current).forEach((d) => {
1139
+ try {
1140
+ URL.revokeObjectURL(d);
1141
+ } catch {
1142
+ }
1143
+ });
1144
+ }, []);
1145
+ async function X(d) {
1146
+ var b, x;
1147
+ let n = Array.from(d || []);
1148
+ if (n.length === 0) return;
1149
+ let f = K - V.length;
1150
+ if (f <= 0) {
1151
+ Y({
1152
+ message: `You can add at most ${K} images.`,
1153
+ type: "warning"
1154
+ });
1155
+ return;
1156
+ }
1157
+ let t = n.find((c) => !c.type.startsWith("image/") || c.size > yi);
1158
+ if (t) {
1159
+ Y({
1160
+ message: t.type.startsWith("image/") ? "Each image must be 5 MB or smaller." : "Only image files can be uploaded.",
1161
+ type: "error"
1162
+ });
1163
+ return;
1164
+ }
1165
+ let R = n.slice(0, f);
1166
+ n.length > f && Y({
1167
+ message: `Only ${f} more image${f === 1 ? "" : "s"} can be added.`,
1168
+ type: "warning"
1169
+ });
1170
+ let O = R.map(() => le());
1171
+ C(!0);
1172
+ try {
1173
+ await Ye(R, O), R.forEach((c, y) => Q(O[y], URL.createObjectURL(c))), k([...V, ...O]);
1174
+ } catch (c) {
1175
+ Y({
1176
+ message: ((x = (b = c == null ? void 0 : c.response) == null ? void 0 : b.data) == null ? void 0 : x.message) ?? (c == null ? void 0 : c.message) ?? "Failed to upload images",
1177
+ type: "error"
1178
+ });
1179
+ } finally {
1180
+ C(!1);
1181
+ }
1182
+ }
1183
+ function Z(d) {
1184
+ k(V.filter((n) => n !== d));
1185
+ }
1186
+ let J = V.length >= K;
1187
+ return /* @__PURE__ */ u(E, { children: [
1188
+ /* @__PURE__ */ e("input", {
1189
+ ref: U,
1190
+ type: "file",
1191
+ accept: "image/*",
1192
+ multiple: !0,
1193
+ hidden: !0,
1194
+ onChange: (d) => {
1195
+ X(d.target.files), d.target.value = "";
1196
+ }
1197
+ }),
1198
+ /* @__PURE__ */ u(H, {
1199
+ direction: "row",
1200
+ spacing: 1.5,
1201
+ sx: {
1202
+ flexWrap: "wrap",
1203
+ gap: 1.5
1204
+ },
1205
+ children: [V.map((d, n) => /* @__PURE__ */ u(E, {
1206
+ sx: {
1207
+ position: "relative",
1208
+ width: 104,
1209
+ height: 104,
1210
+ borderRadius: 1.5,
1211
+ border: "1px solid",
1212
+ borderColor: "divider",
1213
+ overflow: "hidden",
1214
+ bgcolor: "grey.50",
1215
+ display: "flex",
1216
+ alignItems: "center",
1217
+ justifyContent: "center"
1218
+ },
1219
+ children: [
1220
+ B[d] ? /* @__PURE__ */ e(E, {
1221
+ component: "img",
1222
+ src: B[d],
1223
+ alt: `Product image ${n + 1}`,
1224
+ sx: {
1225
+ width: "100%",
1226
+ height: "100%",
1227
+ objectFit: "cover"
1228
+ }
1229
+ }) : /* @__PURE__ */ e(He, { size: 20 }),
1230
+ n === 0 ? /* @__PURE__ */ e(E, {
1231
+ sx: {
1232
+ position: "absolute",
1233
+ left: 0,
1234
+ bottom: 0,
1235
+ right: 0,
1236
+ bgcolor: "rgba(0,0,0,0.55)",
1237
+ color: "#fff",
1238
+ fontSize: "0.6rem",
1239
+ fontWeight: 800,
1240
+ letterSpacing: 0.5,
1241
+ textAlign: "center",
1242
+ py: 0.25
1243
+ },
1244
+ children: "MAIN"
1245
+ }) : null,
1246
+ /* @__PURE__ */ e(ke, {
1247
+ size: "small",
1248
+ onClick: () => Z(d),
1249
+ sx: {
1250
+ position: "absolute",
1251
+ top: 2,
1252
+ right: 2,
1253
+ p: 0.25,
1254
+ bgcolor: "rgba(0,0,0,0.5)",
1255
+ color: "#fff",
1256
+ "&:hover": { bgcolor: "rgba(0,0,0,0.7)" }
1257
+ },
1258
+ "aria-label": "Remove image",
1259
+ children: /* @__PURE__ */ e(bi, { sx: { fontSize: 16 } })
1260
+ })
1261
+ ]
1262
+ }, d)), J ? null : /* @__PURE__ */ u(_, {
1263
+ variant: "outlined",
1264
+ onClick: () => {
1265
+ var d;
1266
+ return (d = U.current) == null ? void 0 : d.click();
1267
+ },
1268
+ disabled: w,
1269
+ sx: {
1270
+ width: 104,
1271
+ height: 104,
1272
+ borderStyle: "dashed",
1273
+ flexDirection: "column",
1274
+ gap: 0.5,
1275
+ color: "text.secondary"
1276
+ },
1277
+ children: [w ? /* @__PURE__ */ e(He, { size: 22 }) : /* @__PURE__ */ e(xi, {}), /* @__PURE__ */ e(v, {
1278
+ variant: "caption",
1279
+ sx: { fontWeight: 700 },
1280
+ children: w ? "Uploading…" : "Add"
1281
+ })]
1282
+ })]
1283
+ }),
1284
+ V.length === 0 && !w ? /* @__PURE__ */ e(v, {
1285
+ variant: "caption",
1286
+ color: "text.disabled",
1287
+ sx: {
1288
+ display: "block",
1289
+ mt: 1
1290
+ },
1291
+ children: "No images added yet."
1292
+ }) : null
1293
+ ] });
1294
+ }
1295
+ $e.propTypes = {
1296
+ value: te.arrayOf(te.string),
1297
+ onChange: te.func.isRequired
1298
+ };
1299
+ export {
1300
+ Wi as default
1301
+ };
1302
+ //# sourceMappingURL=ProductEditPage-C1thoKHu-URQaZ6st.js.map