@argusoft/medplat-core 1.0.30 → 1.0.31

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