hplx-feature-library 1.0.202 → 1.0.203

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 (94) hide show
  1. package/dist/APIAction-5-3i1gGx.cjs +1 -0
  2. package/dist/{APIAction-BpUGTq-P.js → APIAction-l6i46qgX.js} +24 -23
  3. package/dist/AllInvestigations/components/AllInvestigationsTable.d.ts +19 -0
  4. package/dist/AllInvestigations/index.d.ts +1 -0
  5. package/dist/AllInvestigations/index.js +4 -0
  6. package/dist/AllInvestigations/utils/test-tange-util.d.ts +8 -0
  7. package/dist/AllInvestigationsTable-BDLPOHjr.cjs +79 -0
  8. package/dist/AllInvestigationsTable-Dg-YXASz.js +17065 -0
  9. package/dist/Attachments/index.js +1 -1
  10. package/dist/{Attachments-3UkuRnaT.js → Attachments-BzZHI8d3.js} +6180 -6297
  11. package/dist/Attachments-CziD-_gm.cjs +186 -0
  12. package/dist/CommonConstant-Bj7SvPfU.js +436 -0
  13. package/dist/CommonConstant-COHqiSWL.cjs +1 -0
  14. package/dist/NineDots/index.js +4 -0
  15. package/dist/NineDots-BEzE3Pj8.cjs +3 -0
  16. package/dist/NineDots-CCtE2t9I.js +1788 -0
  17. package/dist/PatientAddEdit/index.js +1 -1
  18. package/dist/{PatientAddEdit-DjNwzBQV.js → PatientAddEdit-CPjv2_ZF.js} +20 -18
  19. package/dist/PatientAddEdit-UFho4sOA.cjs +7 -0
  20. package/dist/PatientPopup/index.js +1 -1
  21. package/dist/{PatientPopupContainer-RxozPrZy.js → PatientPopupContainer-AprY0NY2.js} +49 -47
  22. package/dist/PatientPopupContainer-Cwv4GWjB.cjs +36 -0
  23. package/dist/PediatricsCalculator/index.js +1 -1
  24. package/dist/PediatricsCalculatorTable-B4fTy1J5.cjs +9 -0
  25. package/dist/{PediatricsCalculatorTable-qu37FR7D.js → PediatricsCalculatorTable-G0ttbDpi.js} +228 -236
  26. package/dist/{PrintModal-DYCkcIdD.cjs → PrintModal-CHkA2pab.cjs} +50 -52
  27. package/dist/{PrintModal-D4AX-Rz-.js → PrintModal-DFzssQg2.js} +3261 -3227
  28. package/dist/{ReusableModal-2GKjVVbf.cjs → ReusableModal-CIgDYOWZ.cjs} +1 -1
  29. package/dist/{ReusableModal-BL_DwV8I.js → ReusableModal-CT4_gW1b.js} +1 -1
  30. package/dist/ReusableTable/ReusableTable.d.ts +3 -0
  31. package/dist/ReusableTable/ReusableTableConstants.d.ts +8 -0
  32. package/dist/ReusableTable/ReusableTableTypes.d.ts +96 -0
  33. package/dist/ReusableTable/components/EmptyTableContainer.d.ts +12 -0
  34. package/dist/ReusableTable/components/FilterCheckbox.d.ts +8 -0
  35. package/dist/ReusableTable/components/FilterDropdown.d.ts +17 -0
  36. package/dist/ReusableTable/components/Pagination.d.ts +2 -0
  37. package/dist/ReusableTable/components/TableBody.d.ts +2 -0
  38. package/dist/ReusableTable/components/TableCell.d.ts +3 -0
  39. package/dist/ReusableTable/components/TableFilterSelect.d.ts +12 -0
  40. package/dist/ReusableTable/components/TableHead.d.ts +2 -0
  41. package/dist/ReusableTable/components/TableMain.d.ts +2 -0
  42. package/dist/ReusableTable/components/TableRow.d.ts +3 -0
  43. package/dist/ReusableTable/context/TableContext.d.ts +21 -0
  44. package/dist/ReusableTable/context/TableContextBase.d.ts +26 -0
  45. package/dist/ReusableTable/context/useTableContext.d.ts +2 -0
  46. package/dist/SearchPatients/index.js +1 -1
  47. package/dist/{SearchPatients-CKu0XGDw.cjs → SearchPatients-BXNWucYz.cjs} +1 -1
  48. package/dist/{SearchPatients-B34Jmyh7.js → SearchPatients-BYGGaUoD.js} +3 -3
  49. package/dist/TrendGraphs/AreaChartComponent.d.ts +9 -0
  50. package/dist/TrendGraphs/LineChartComponent/DataPointToolTip.d.ts +16 -0
  51. package/dist/TrendGraphs/LineChartComponent/LineChartBody.d.ts +2 -0
  52. package/dist/TrendGraphs/LineChartComponent/LineChartHeader.d.ts +2 -0
  53. package/dist/TrendGraphs/LineChartComponent/index.d.ts +2 -0
  54. package/dist/TrendGraphs/context/index.d.ts +2 -0
  55. package/dist/TrendGraphs/hooks/useTrendGraphContext.d.ts +2 -0
  56. package/dist/TrendGraphs/utils/index.d.ts +4 -0
  57. package/dist/UserProfile/index.js +4 -0
  58. package/dist/UserProfile-CcEbhDhd.js +1761 -0
  59. package/dist/UserProfile-DkQgWGvV.cjs +14 -0
  60. package/dist/clsx-C11secjj.cjs +1 -0
  61. package/dist/clsx-OuTLNxxd.js +16 -0
  62. package/dist/common-utils-CJv4_aVl.cjs +6 -0
  63. package/dist/common-utils-Dq5TMP7t.js +1952 -0
  64. package/dist/components/Modal.d.ts +5 -0
  65. package/dist/constants/TrendGraphsConstants.d.ts +2 -0
  66. package/dist/dayjs.min-D52_GdfV.js +284 -0
  67. package/dist/dayjs.min-DXp74Ozx.cjs +1 -0
  68. package/dist/hplx-feature-library.css +1 -1
  69. package/dist/{index-UPYT3B9g.js → index-Bd0CDVpH.js} +3 -2
  70. package/dist/index-CJFGOBPb.js +122 -0
  71. package/dist/{index-CJ2AKRoq.cjs → index-DQlbIHh3.cjs} +26 -26
  72. package/dist/index-DfcUmlge.cjs +17 -0
  73. package/dist/{index-CRCsQdYf.cjs → index-DkA8S5IK.cjs} +1 -1
  74. package/dist/{index-BzwuwvT5.js → index-T1lUjzhG.js} +1 -1
  75. package/dist/index.d.ts +3 -0
  76. package/dist/index.js +18 -12
  77. package/dist/nineDots/index.d.ts +1 -0
  78. package/dist/print-pdf/index.js +1 -1
  79. package/dist/types/AllInvestigationTypes/index.js +4 -0
  80. package/dist/types/AllInvestigationTypes.d.ts +45 -0
  81. package/dist/types/CommonTypes.d.ts +1 -1
  82. package/dist/types/NineDotsTypes/index.js +1 -0
  83. package/dist/types/TrendGraphTypes.d.ts +19 -0
  84. package/dist/useClickOutside-BjJyGTec.js +14 -0
  85. package/dist/useClickOutside-DsVG12Cs.cjs +1 -0
  86. package/dist/userProfile/index.d.ts +1 -0
  87. package/package.json +14 -9
  88. package/dist/APIAction-Dh8yXpE0.cjs +0 -1
  89. package/dist/Attachments-B9GrTokn.cjs +0 -202
  90. package/dist/PatientAddEdit-DKtOZH2N.cjs +0 -7
  91. package/dist/PatientPopupContainer-Bg9zUots.cjs +0 -36
  92. package/dist/PediatricsCalculatorTable-bTvt7SWQ.cjs +0 -9
  93. package/dist/common-utils-B6431-iN.js +0 -2657
  94. package/dist/common-utils-DeErqLTB.cjs +0 -6
@@ -1,47 +1,48 @@
1
- import { j as e, b as L, O as Ee, K as oe, N as Re, d as ue, g as We } from "./index-UPYT3B9g.js";
2
- import be, { createContext as Ge, useContext as Ve, useEffect as X, useState as G, useRef as pe, useMemo as re, useCallback as W, forwardRef as Pe, useImperativeHandle as Ke } from "react";
1
+ import { j as e, b as $, O as Ee, K as oe, N as Re, d as ue, g as We } from "./index-Bd0CDVpH.js";
2
+ import be, { createContext as Ge, useContext as Ve, useState as G, useRef as pe, useMemo as re, useCallback as W, useEffect as Q, forwardRef as Pe, useImperativeHandle as Ke } from "react";
3
3
  import { C_MedicineCalculatorList as _e, C_FrequencyDosageMap as Me, C_MedicineTypeList as we, C_MedicineFrequencyList as Se, C_DefaultMgKgFields as Je, C_DefaultMlKgFields as Ye, C_Table_Column_Name as Ue } from "./constants/PediatricsCalculatorConstants/index.js";
4
- import { u as Xe } from "./useOutsideClick-C4Q0aGuf.js";
5
- import { M as Fe } from "./index-BzwuwvT5.js";
6
- const Oe = Ge(null), Le = () => {
7
- const n = Ve(Oe);
8
- if (!n) throw new Error("usePediatricsCalculatorTableContext must be used inside a MedicineTableProvider");
9
- return n;
10
- }, Ze = ({
11
- effectiveEditMode: n,
4
+ import { u as Xe } from "./useClickOutside-BjJyGTec.js";
5
+ import { u as Ze } from "./useOutsideClick-C4Q0aGuf.js";
6
+ import { M as Fe } from "./index-T1lUjzhG.js";
7
+ const Oe = Ge(null), $e = () => {
8
+ const a = Ve(Oe);
9
+ if (!a) throw new Error("usePediatricsCalculatorTableContext must be used inside a MedicineTableProvider");
10
+ return a;
11
+ }, Qe = ({
12
+ effectiveEditMode: a,
12
13
  rowData: t,
13
- isSavedToLibrary: p,
14
- onSave: y,
15
- onCancel: g,
14
+ isSavedToLibrary: g,
15
+ onSave: _,
16
+ onCancel: m,
16
17
  onEdit: N,
17
18
  onCheckboxToggle: i
18
19
  }) => {
19
- const { variant: C, externallyTriggeredEditMode: w, setRowToDelete: _, openPopupForRow: k } = Le();
20
- return C === "standard" ? n ? /* @__PURE__ */ e.jsxs("div", { className: "hfl-grid hfl-grid-cols-[1fr_1fr] hfl-border-1 hfl-border-Gray-200 hfl-rounded-lg ", children: [
20
+ const { variant: C, externallyTriggeredEditMode: w, setRowToDelete: b, openPopupForRow: k } = $e();
21
+ return C === "standard" ? a ? /* @__PURE__ */ e.jsxs("div", { className: "hfl-grid hfl-grid-cols-[1fr_1fr] hfl-border-1 hfl-border-Gray-200 hfl-rounded-lg ", children: [
21
22
  /* @__PURE__ */ e.jsx(
22
23
  "button",
23
24
  {
24
25
  className: "hfl-px-3 hfl-py-1 hfl-text-Blue_gray-800 hfl-border-r-1 hover:hfl-bg-Primary-50",
25
- onClick: y,
26
- children: /* @__PURE__ */ e.jsx(L, { variant: "Medium", type: "Text xs", className: "hfl-text-Blue_gray-800", children: "Save" })
26
+ onClick: _,
27
+ children: /* @__PURE__ */ e.jsx($, { variant: "Medium", type: "Text xs", className: "hfl-text-Blue_gray-800", children: "Save" })
27
28
  }
28
29
  ),
29
- /* @__PURE__ */ e.jsx("button", { className: "hfl-px-3 hfl-py-2 hfl-text-Error-600 hover:hfl-bg-Error-50", onClick: g, children: /* @__PURE__ */ e.jsx(L, { variant: "Medium", type: "Text xs", className: "", children: "Cancel" }) })
30
+ /* @__PURE__ */ e.jsx("button", { className: "hfl-px-3 hfl-py-2 hfl-text-Error-600 hover:hfl-bg-Error-50", onClick: m, children: /* @__PURE__ */ e.jsx($, { variant: "Medium", type: "Text xs", className: "", children: "Cancel" }) })
30
31
  ] }) : /* @__PURE__ */ e.jsxs("div", { className: "hfl-grid hfl-grid-cols-[1fr_1fr_1fr] hfl-border-1 hfl-border-Gray-200 hfl-rounded-lg", children: [
31
- /* @__PURE__ */ e.jsx("button", { className: "hfl-px-3 hfl-py-1 hfl-text-Blue_gray-800 hover:hfl-bg-Primary-50", onClick: N, children: /* @__PURE__ */ e.jsx(L, { variant: "Medium", type: "Text xs", className: "", children: "Edit" }) }),
32
+ /* @__PURE__ */ e.jsx("button", { className: "hfl-px-3 hfl-py-1 hfl-text-Blue_gray-800 hover:hfl-bg-Primary-50", onClick: N, children: /* @__PURE__ */ e.jsx($, { variant: "Medium", type: "Text xs", className: "", children: "Edit" }) }),
32
33
  /* @__PURE__ */ e.jsx(
33
34
  "button",
34
35
  {
35
36
  className: "hfl-px-3 hfl-py-2 hfl-text-Blue_gray-800 hfl-border-x-1 hover:hfl-bg-Primary-50",
36
37
  onClick: () => k?.(t),
37
- children: /* @__PURE__ */ e.jsx(L, { variant: "Medium", type: "Text xs", className: "", children: "Copy" })
38
+ children: /* @__PURE__ */ e.jsx($, { variant: "Medium", type: "Text xs", className: "", children: "Copy" })
38
39
  }
39
40
  ),
40
41
  /* @__PURE__ */ e.jsx(
41
42
  "button",
42
43
  {
43
44
  className: "hx_delete hfl-px-3 hfl-py-2 hfl-text-Error-500 hover:hfl-bg-Error-50",
44
- onClick: () => _?.(t.rowId)
45
+ onClick: () => b?.(t.rowId)
45
46
  }
46
47
  )
47
48
  ] }) : /* @__PURE__ */ e.jsx(
@@ -52,57 +53,48 @@ const Oe = Ge(null), Le = () => {
52
53
  id: t.rowId,
53
54
  size: "md",
54
55
  onClick: i,
55
- isMarked: p ?? !1,
56
+ isMarked: g ?? !1,
56
57
  checkboxClasses: "hfl-mt-2",
57
58
  checkBoxInnerDivClasses: "hfl-text-Blue-600 hfl-bg-Blue-50"
58
59
  },
59
60
  t.rowId
60
61
  );
61
- }, Qe = (n, t) => {
62
- X(() => {
63
- const p = (y) => {
64
- n.current && !n.current.contains(y.target) && t();
65
- };
66
- return document.addEventListener("mousedown", p), () => {
67
- document.removeEventListener("mousedown", p);
68
- };
69
- }, [n, t]);
70
62
  };
71
- function el(n) {
72
- const { options: t, selectedOption: p, onChangeHandler: y } = n;
73
- return /* @__PURE__ */ e.jsx("div", { className: "hfl-flex hfl-gap-2 hfl-h-full hfl-items-center hfl-px-4 hfl-justify-center hfl-py-1", children: t?.map((g) => /* @__PURE__ */ e.jsx("div", { className: "hfl-bg-White hfl-rounded-lg", children: /* @__PURE__ */ e.jsx(
63
+ function el(a) {
64
+ const { options: t, selectedOption: g, onChangeHandler: _ } = a;
65
+ return /* @__PURE__ */ e.jsx("div", { className: "hfl-flex hfl-gap-2 hfl-h-full hfl-items-center hfl-px-4 hfl-justify-center hfl-py-1", children: t?.map((m) => /* @__PURE__ */ e.jsx("div", { className: "hfl-bg-White hfl-rounded-lg", children: /* @__PURE__ */ e.jsx(
74
66
  oe,
75
67
  {
76
- onClick: () => y && y(g),
77
- hierarchy: p?.label === g.label ? "Primary" : "Secondary-Grey",
68
+ onClick: () => _ && _(m),
69
+ hierarchy: g?.label === m.label ? "Primary" : "Secondary-Grey",
78
70
  size: "sm",
79
- textField: g.label,
80
- className: p?.label === g.label ? "hfl-bg-Blue-600" : ""
71
+ textField: m.label,
72
+ className: g?.label === m.label ? "hfl-bg-Blue-600" : ""
81
73
  }
82
- ) }, g.label)) });
74
+ ) }, m.label)) });
83
75
  }
84
76
  const ll = "data:image/svg+xml,%3csvg%20width='10'%20height='6'%20viewBox='0%200%2010%206'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0.480062%200.819173C0.650418%200.648817%200.92662%200.648817%201.09698%200.819173L4.71454%204.43674L8.3321%200.819173C8.50246%200.648817%208.77866%200.648817%208.94902%200.819173C9.11937%200.98953%209.11937%201.26573%208.94902%201.43609L5.023%205.36211C4.85264%205.53246%204.57644%205.53246%204.40608%205.36211L0.480062%201.43609C0.309706%201.26573%200.309706%200.98953%200.480062%200.819173Z'%20fill='%23667085'/%3e%3c/svg%3e";
85
- function D(n) {
77
+ function D(a) {
86
78
  const {
87
79
  label: t,
88
- labelClassName: p,
89
- hideDropdownIcon: y,
90
- showClearOption: g,
80
+ labelClassName: g,
81
+ hideDropdownIcon: _,
82
+ showClearOption: m,
91
83
  isRequiredField: N,
92
84
  btnClassName: i,
93
85
  placeholder: C,
94
86
  options: w,
95
- selectedOption: _,
87
+ selectedOption: b,
96
88
  onChangeHandler: k,
97
- inputValue: b,
98
- inputChangeHandler: $,
89
+ inputValue: y,
90
+ inputChangeHandler: L,
99
91
  onInputFocusOutEvent: B,
100
92
  inputClassName: s,
101
- isSearchable: m,
93
+ isSearchable: p,
102
94
  inputType: H,
103
95
  showInput: M,
104
96
  inputSuffix: S,
105
- selectedLabel: Z,
97
+ selectedLabel: X,
106
98
  suffixPadding: V,
107
99
  disableInputAutoSize: r,
108
100
  selectedOptions: x,
@@ -111,7 +103,7 @@ function D(n) {
111
103
  showToggle: z,
112
104
  toggleChangeHandler: E,
113
105
  selectedToggleOption: o,
114
- toggleOptionsList: a,
106
+ toggleOptionsList: n,
115
107
  border: I,
116
108
  height: j,
117
109
  disabled: T,
@@ -128,19 +120,19 @@ function D(n) {
128
120
  alternateListBgStyle: te,
129
121
  showLabelTooltip: v = !1,
130
122
  labelToolTipContent: J = "",
131
- inputContainerClasses: Q = "",
123
+ inputContainerClasses: Z = "",
132
124
  onInputFocus: le
133
- } = n, [ee, ne] = G(!1), [ae, $e] = G(null), he = pe(null), me = pe(null), Ce = pe(null), ge = pe([]), Be = re(() => w?.filter((h) => h ? h.label.toLowerCase().includes((b ?? "").toLowerCase()) : void 0), [b, w]), [He, xe] = G(!1), ze = () => {
134
- ne(!1), f && $ && $(""), $e(null);
125
+ } = a, [ee, ae] = G(!1), [ne, Le] = G(null), he = pe(null), me = pe(null), Ce = pe(null), ge = pe([]), Be = re(() => w?.filter((h) => h ? h.label.toLowerCase().includes((y ?? "").toLowerCase()) : void 0), [y, w]), [He, xe] = G(!1), ze = () => {
126
+ ae(!1), f && L && L(""), Le(null);
135
127
  }, Ne = W(
136
128
  (h) => {
137
- h.stopPropagation(), T || ne((O) => !O);
129
+ h.stopPropagation(), T || ae((O) => !O);
138
130
  },
139
131
  [T]
140
- ), Ie = (b?.length || 0) + 2 + Number(V || 0);
141
- Xe(he, ze), X(() => {
142
- ae !== null && ge.current[ae] && ge.current[ae].scrollIntoView({ block: "nearest" });
143
- }, [ae]);
132
+ ), Ie = (y?.length || 0) + 2 + Number(V || 0);
133
+ Ze(he, ze), Q(() => {
134
+ ne !== null && ge.current[ne] && ge.current[ne].scrollIntoView({ block: "nearest" });
135
+ }, [ne]);
144
136
  const se = W(() => {
145
137
  if (R && ee) {
146
138
  const h = M ? me.current : Ce.current, O = he.current;
@@ -150,12 +142,12 @@ function D(n) {
150
142
  }
151
143
  }
152
144
  }, [R, ee, M]);
153
- X(() => {
145
+ Q(() => {
154
146
  if (R)
155
147
  return ee ? (se(), window.addEventListener("scroll", se, !0)) : window.removeEventListener("scroll", se, !0), () => {
156
148
  window.removeEventListener("scroll", se, !0);
157
149
  };
158
- }, [R, se, ee]), Qe(he, () => {
150
+ }, [R, se, ee]), Xe(he, () => {
159
151
  He && B && B();
160
152
  });
161
153
  const Te = (h) => {
@@ -165,13 +157,13 @@ function D(n) {
165
157
  }
166
158
  }, qe = W(
167
159
  async (h) => {
168
- h.stopPropagation(), ee || ne(!0), le && await le();
160
+ h.stopPropagation(), ee || ae(!0), le && await le();
169
161
  },
170
162
  [le, ee]
171
163
  );
172
164
  return /* @__PURE__ */ e.jsxs("div", { className: `hfl-relative hfl-inline-block hfl-text-left ${de || ""}`, children: [
173
165
  !!t && /* @__PURE__ */ e.jsxs("div", { className: "hfl-text-Gray-700 hfl-mb-1 hfl-flex", children: [
174
- /* @__PURE__ */ e.jsx(L, { type: "Text sm", variant: "Medium", className: p || "", children: `${t}` }),
166
+ /* @__PURE__ */ e.jsx($, { type: "Text sm", variant: "Medium", className: g || "", children: `${t}` }),
175
167
  N && /* @__PURE__ */ e.jsx("span", { className: "hfl-ml-1 hfl-text-Error-600", children: "*" }),
176
168
  v && /* @__PURE__ */ e.jsx(Re, { variant: "Right", text: J, theme: "dark", children: /* @__PURE__ */ e.jsx("i", { className: "hx_info-filled" }) })
177
169
  ] }),
@@ -179,7 +171,7 @@ function D(n) {
179
171
  /* @__PURE__ */ e.jsxs(
180
172
  "div",
181
173
  {
182
- className: `hfl-flex hfl-items-center hfl-shadow-xs hfl-px-2 ${Q || ""} ${I || "hfl-border-1"} hfl-rounded-lg hfl-overflow-x-auto ${l ? "hfl-border-Error-300" : "hfl-border-Gray-300"} ${j || "hfl-h-10"} ${T ? "!hfl-bg-Gray-50 !hfl-pointer-events-none" : q || "hfl-bg-White"} hover:hfl-border-Primary-300 hover:hfl-shadow-xs-primary`,
174
+ className: `hfl-flex hfl-items-center hfl-shadow-xs hfl-px-2 ${Z || ""} ${I || "hfl-border-1"} hfl-rounded-lg hfl-overflow-x-auto ${l ? "hfl-border-Error-300" : "hfl-border-Gray-300"} ${j || "hfl-h-10"} ${T ? "!hfl-bg-Gray-50 !hfl-pointer-events-none" : q || "hfl-bg-White"} hover:hfl-border-Primary-300 hover:hfl-shadow-xs-primary`,
183
175
  onClick: T ? () => {
184
176
  } : Ne,
185
177
  children: [
@@ -215,27 +207,27 @@ function D(n) {
215
207
  "input",
216
208
  {
217
209
  ref: me,
218
- style: r ? {} : { width: `${Number(b?.length) > 4 ? (b?.length || 0) + 5 : 12}ch` },
210
+ style: r ? {} : { width: `${Number(y?.length) > 4 ? (y?.length || 0) + 5 : 12}ch` },
219
211
  type: H,
220
212
  placeholder: C,
221
- value: b,
213
+ value: y,
222
214
  className: `input-placeholder hfl-flex-1 hfl-pl-2 hfl-placeholder hfl-py-1 focus-visible:hfl-outline-0 focus-visible:hfl-outline-none hfl-border-0 focus:hfl-border-0 ${T ? "!hfl-bg-Gray-50 !hfl-cursor-not-allowed" : q || "hfl-bg-White"} ${s || ""}`,
223
215
  onChange: (h) => {
224
- $ && $(h.target.value), xe(!0);
216
+ L && L(h.target.value), xe(!0);
225
217
  },
226
218
  onClick: qe,
227
- onKeyDown: (h) => F && F(h, ne, me),
219
+ onKeyDown: (h) => F && F(h, ae, me),
228
220
  maxLength: fe ?? fe,
229
- ...n.inputProps || {}
221
+ ...a.inputProps || {}
230
222
  }
231
223
  ),
232
- !y && !g && /* @__PURE__ */ e.jsx("i", { className: "hx_down hfl-mx-2" }),
233
- g && /* @__PURE__ */ e.jsx(
224
+ !_ && !m && /* @__PURE__ */ e.jsx("i", { className: "hx_down hfl-mx-2" }),
225
+ m && /* @__PURE__ */ e.jsx(
234
226
  "i",
235
227
  {
236
- className: `${b ? "hx_close hfl-cursor-pointer" : "hx_down"} hfl-mx-2`,
228
+ className: `${y ? "hx_close hfl-cursor-pointer" : "hx_down"} hfl-mx-2`,
237
229
  onClick: () => {
238
- (_?.value || b) && ($ && $(""), xe(!0));
230
+ (b?.value || y) && (L && L(""), xe(!0));
239
231
  }
240
232
  }
241
233
  ),
@@ -257,7 +249,7 @@ function D(n) {
257
249
  ref: Ce,
258
250
  onClick: Ne,
259
251
  className: `hfl-w-full hfl-bg-White hfl-py-[6px] hfl-px-4 hfl-rounded-lg hfl-inline-flex hfl-justify-between hfl-items-center ${i || ""} ${I || "hfl-border-1"} ${l ? "hfl-border-Error-300" : "hfl-border-Gray-300"} ${j || "hfl-h-[40px]"} ${T ? "!hfl-bg-Gray-50 !hfl-cursor-not-allowed" : ""}`,
260
- style: Z || _?.label ? {} : c ? {
252
+ style: X || b?.label ? {} : c ? {
261
253
  fontFamily: c?.fontFamily,
262
254
  fontSize: c?.fontSize,
263
255
  fontWeight: c?.fontWeight,
@@ -265,7 +257,7 @@ function D(n) {
265
257
  color: c?.color
266
258
  } : {},
267
259
  children: [
268
- /* @__PURE__ */ e.jsx("span", { className: "hfl-pr-4", children: Z || _?.label || C || "Select an option" }),
260
+ /* @__PURE__ */ e.jsx("span", { className: "hfl-pr-4", children: X || b?.label || C || "Select an option" }),
269
261
  /* @__PURE__ */ e.jsx("img", { src: ll, alt: "down arrow" })
270
262
  ]
271
263
  }
@@ -284,16 +276,16 @@ function D(n) {
284
276
  {
285
277
  onChangeHandler: E,
286
278
  selectedOption: o,
287
- options: a
279
+ options: n
288
280
  }
289
281
  ) : !1,
290
- (m ? Be : w)?.map((h, O) => {
291
- const Y = f ? !!x?.some((ye) => ye.value === h?.value) : !1, ke = _?.value === h?.value, Ae = ae === O;
282
+ (p ? Be : w)?.map((h, O) => {
283
+ const Y = f ? !!x?.some((ye) => ye.value === h?.value) : !1, ke = b?.value === h?.value, Ae = ne === O;
292
284
  return h ? /* @__PURE__ */ e.jsx(
293
285
  "li",
294
286
  {
295
287
  onClick: () => {
296
- f ? Te(h) : (k && k(h), ne(!1), xe(!1));
288
+ f ? Te(h) : (k && k(h), ae(!1), xe(!1));
297
289
  },
298
290
  className: `hfl-text-1 hfl-block hfl-px-4 hfl-py-2 hfl-rounded-md hover:hfl-bg-Blue-50 hfl-cursor-pointer custom_dropdown_item ${te ? "odd:hfl-bg-Gray-100" : ""} ${ke ? "hfl-bg-Blue-50 hfl-text-Blue-500" : ""}`,
299
291
  role: "menuitem",
@@ -333,53 +325,53 @@ var je, De;
333
325
  function tl() {
334
326
  if (De) return je;
335
327
  De = 1;
336
- var n = "Expected a function", t = NaN, p = "[object Symbol]", y = /^\s+|\s+$/g, g = /^[-+]0x[0-9a-f]+$/i, N = /^0b[01]+$/i, i = /^0o[0-7]+$/i, C = parseInt, w = typeof ue == "object" && ue && ue.Object === Object && ue, _ = typeof self == "object" && self && self.Object === Object && self, k = w || _ || Function("return this")(), b = Object.prototype, $ = b.toString, B = Math.max, s = Math.min, m = function() {
328
+ var a = "Expected a function", t = NaN, g = "[object Symbol]", _ = /^\s+|\s+$/g, m = /^[-+]0x[0-9a-f]+$/i, N = /^0b[01]+$/i, i = /^0o[0-7]+$/i, C = parseInt, w = typeof ue == "object" && ue && ue.Object === Object && ue, b = typeof self == "object" && self && self.Object === Object && self, k = w || b || Function("return this")(), y = Object.prototype, L = y.toString, B = Math.max, s = Math.min, p = function() {
337
329
  return k.Date.now();
338
330
  };
339
331
  function H(r, x, f) {
340
- var u, z, E, o, a, I, j = 0, T = !1, q = !1, l = !0;
332
+ var u, z, E, o, n, I, j = 0, T = !1, q = !1, l = !0;
341
333
  if (typeof r != "function")
342
- throw new TypeError(n);
334
+ throw new TypeError(a);
343
335
  x = V(x) || 0, M(f) && (T = !!f.leading, q = "maxWait" in f, E = q ? B(V(f.maxWait) || 0, x) : E, l = "trailing" in f ? !!f.trailing : l);
344
336
  function d(v) {
345
- var J = u, Q = z;
346
- return u = z = void 0, j = v, o = r.apply(Q, J), o;
337
+ var J = u, Z = z;
338
+ return u = z = void 0, j = v, o = r.apply(Z, J), o;
347
339
  }
348
340
  function c(v) {
349
- return j = v, a = setTimeout(R, x), T ? d(v) : o;
341
+ return j = v, n = setTimeout(R, x), T ? d(v) : o;
350
342
  }
351
343
  function F(v) {
352
- var J = v - I, Q = v - j, le = x - J;
353
- return q ? s(le, E - Q) : le;
344
+ var J = v - I, Z = v - j, le = x - J;
345
+ return q ? s(le, E - Z) : le;
354
346
  }
355
347
  function A(v) {
356
- var J = v - I, Q = v - j;
357
- return I === void 0 || J >= x || J < 0 || q && Q >= E;
348
+ var J = v - I, Z = v - j;
349
+ return I === void 0 || J >= x || J < 0 || q && Z >= E;
358
350
  }
359
351
  function R() {
360
- var v = m();
352
+ var v = p();
361
353
  if (A(v))
362
354
  return ce(v);
363
- a = setTimeout(R, F(v));
355
+ n = setTimeout(R, F(v));
364
356
  }
365
357
  function ce(v) {
366
- return a = void 0, l && u ? d(v) : (u = z = void 0, o);
358
+ return n = void 0, l && u ? d(v) : (u = z = void 0, o);
367
359
  }
368
360
  function de() {
369
- a !== void 0 && clearTimeout(a), j = 0, u = I = z = a = void 0;
361
+ n !== void 0 && clearTimeout(n), j = 0, u = I = z = n = void 0;
370
362
  }
371
363
  function fe() {
372
- return a === void 0 ? o : ce(m());
364
+ return n === void 0 ? o : ce(p());
373
365
  }
374
366
  function te() {
375
- var v = m(), J = A(v);
367
+ var v = p(), J = A(v);
376
368
  if (u = arguments, z = this, I = v, J) {
377
- if (a === void 0)
369
+ if (n === void 0)
378
370
  return c(I);
379
371
  if (q)
380
- return a = setTimeout(R, x), d(I);
372
+ return n = setTimeout(R, x), d(I);
381
373
  }
382
- return a === void 0 && (a = setTimeout(R, x)), o;
374
+ return n === void 0 && (n = setTimeout(R, x)), o;
383
375
  }
384
376
  return te.cancel = de, te.flush = fe, te;
385
377
  }
@@ -390,13 +382,13 @@ function tl() {
390
382
  function S(r) {
391
383
  return !!r && typeof r == "object";
392
384
  }
393
- function Z(r) {
394
- return typeof r == "symbol" || S(r) && $.call(r) == p;
385
+ function X(r) {
386
+ return typeof r == "symbol" || S(r) && L.call(r) == g;
395
387
  }
396
388
  function V(r) {
397
389
  if (typeof r == "number")
398
390
  return r;
399
- if (Z(r))
391
+ if (X(r))
400
392
  return t;
401
393
  if (M(r)) {
402
394
  var x = typeof r.valueOf == "function" ? r.valueOf() : r;
@@ -404,66 +396,66 @@ function tl() {
404
396
  }
405
397
  if (typeof r != "string")
406
398
  return r === 0 ? r : +r;
407
- r = r.replace(y, "");
399
+ r = r.replace(_, "");
408
400
  var f = N.test(r);
409
- return f || i.test(r) ? C(r.slice(2), f ? 2 : 8) : g.test(r) ? t : +r;
401
+ return f || i.test(r) ? C(r.slice(2), f ? 2 : 8) : m.test(r) ? t : +r;
410
402
  }
411
403
  return je = H, je;
412
404
  }
413
- var nl = tl();
414
- const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
415
- const p = parseFloat(n), y = parseFloat(t);
416
- if (!n || !t || isNaN(p) || isNaN(y) || y === 0)
405
+ var al = tl();
406
+ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
407
+ const g = parseFloat(a), _ = parseFloat(t);
408
+ if (!a || !t || isNaN(g) || isNaN(_) || _ === 0)
417
409
  return "";
418
- const g = p / y;
419
- return Number.isInteger(g) ? g.toString(10) : g.toFixed(3).replace(/\.?0+$/, "");
420
- }, U = (n) => /^(\d+)?(\.)?(\d*)?$/.test(n), P = ({ label: n, children: t }) => /* @__PURE__ */ e.jsxs(
421
- L,
410
+ const m = g / _;
411
+ return Number.isInteger(m) ? m.toString(10) : m.toFixed(3).replace(/\.?0+$/, "");
412
+ }, U = (a) => /^(\d+)?(\.)?(\d*)?$/.test(a), P = ({ label: a, children: t }) => /* @__PURE__ */ e.jsxs(
413
+ $,
422
414
  {
423
415
  variant: "Regular",
424
416
  type: "Text sm",
425
417
  className: "hfl-grid hfl-grid-cols-2 hfl-items-center hfl-text-Blue_gray-800 hfl-justify-between hfl-gap-8",
426
418
  children: [
427
419
  /* @__PURE__ */ e.jsxs("span", { className: "hfl-flex-shrink-0", children: [
428
- n,
420
+ a,
429
421
  ":"
430
422
  ] }),
431
423
  /* @__PURE__ */ e.jsx("div", { className: "hfl-flex-1 hfl-min-w-0", children: t })
432
424
  ]
433
425
  }
434
- ), K = ({ label: n, value: t }) => /* @__PURE__ */ e.jsxs(L, { variant: "Regular", type: "Text sm", className: "hfl-flex hfl-text-Blue_gray-800 hfl-gap-1", children: [
426
+ ), K = ({ label: a, value: t }) => /* @__PURE__ */ e.jsxs($, { variant: "Regular", type: "Text sm", className: "hfl-flex hfl-text-Blue_gray-800 hfl-gap-1", children: [
435
427
  /* @__PURE__ */ e.jsxs("span", { className: "hfl-flex-shrink-0", children: [
436
- n,
428
+ a,
437
429
  ":"
438
430
  ] }),
439
- /* @__PURE__ */ e.jsx(L, { variant: "Bold", type: "Text sm", className: "hfl-text-Blue_gray-800 hfl-break-words hfl-min-w-0", children: t || "--" })
440
- ] }), ie = ({ children: n, className: t = "" }) => /* @__PURE__ */ e.jsx(
441
- L,
431
+ /* @__PURE__ */ e.jsx($, { variant: "Bold", type: "Text sm", className: "hfl-text-Blue_gray-800 hfl-break-words hfl-min-w-0", children: t || "--" })
432
+ ] }), ie = ({ children: a, className: t = "" }) => /* @__PURE__ */ e.jsx(
433
+ $,
442
434
  {
443
435
  variant: "Regular",
444
436
  type: "Text sm",
445
437
  className: `hfl-text-Blue_gray-800 hfl-px-2 hfl-break-words hfl-overflow-wrap-anywhere hfl-min-w-0 ${t}`,
446
- children: n
438
+ children: a
447
439
  }
448
440
  ), sl = be.memo(
449
- function({ rowData: t, isEditing: p, setIsEditing: y, onSaveRow: g, allowCustomMedicineInput: N }) {
441
+ function({ rowData: t, isEditing: g, setIsEditing: _, onSaveRow: m, allowCustomMedicineInput: N }) {
450
442
  const {
451
443
  variant: i,
452
444
  externallyTriggeredEditMode: C,
453
445
  externallyTriggeredEditRowIds: w,
454
- getMedicineOptions: _,
446
+ getMedicineOptions: b,
455
447
  onRowChange: k,
456
- onRowDelete: b
457
- } = Le(), [$, B] = G([]), [s, m] = G(t), [H, M] = G(t.medicine_name);
458
- X(() => {
459
- p || M(t.medicine_name);
460
- }, [t.medicine_name, p]), X(() => {
461
- p || m(t);
462
- }, [t, p]);
463
- const S = async (l) => (await _?.(l))?.map((c) => ({
448
+ onRowDelete: y
449
+ } = $e(), [L, B] = G([]), [s, p] = G(t), [H, M] = G(t.medicine_name);
450
+ Q(() => {
451
+ g || M(t.medicine_name);
452
+ }, [t.medicine_name, g]), Q(() => {
453
+ g || p(t);
454
+ }, [t, g]);
455
+ const S = async (l) => (await b?.(l))?.map((c) => ({
464
456
  label: c.doctorMedicineName,
465
457
  value: c
466
- })) || [], V = C || w?.includes(t.rowId) || p, r = re(() => s.out_of_range || t.out_of_range, [s.out_of_range, t.out_of_range]), x = re(() => s?.isDosageMismatch || t?.isDosageMismatch, [s?.isDosageMismatch, t?.isDosageMismatch]), f = be.useMemo(() => s.calculation_type === _e[0] ? s.calculation_fields : null, [s.calculation_fields, s.calculation_type]), u = be.useMemo(() => s.calculation_type === _e[1] ? s.calculation_fields : null, [s.calculation_fields, s.calculation_type]), z = (l, d) => {
458
+ })) || [], V = C || w?.includes(t.rowId) || g, r = re(() => s.out_of_range || t.out_of_range, [s.out_of_range, t.out_of_range]), x = re(() => s?.isDosageMismatch || t?.isDosageMismatch, [s?.isDosageMismatch, t?.isDosageMismatch]), f = be.useMemo(() => s.calculation_type === _e[0] ? s.calculation_fields : null, [s.calculation_fields, s.calculation_type]), u = be.useMemo(() => s.calculation_type === _e[1] ? s.calculation_fields : null, [s.calculation_fields, s.calculation_type]), z = (l, d) => {
467
459
  let c;
468
460
  if (l === "calculation_type") {
469
461
  const F = d, A = {
@@ -480,22 +472,22 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
480
472
  ...s,
481
473
  [l]: d
482
474
  };
483
- m(c), i === "prescription" && E(c, l);
475
+ p(c), i === "prescription" && E(c, l);
484
476
  }, E = re(
485
- () => al((l, d) => {
477
+ () => nl((l, d) => {
486
478
  k?.(l, d || void 0);
487
479
  }, 500),
488
480
  [k]
489
481
  ), o = re(() => /* @__PURE__ */ e.jsxs("div", { className: "hfl-mb-1 hfl-flex hfl-w-max hfl-items-center hfl-rounded hfl-border-1 hfl-border-Warning-400 hfl-bg-Warning-50 hfl-p-1 hfl-px-2", children: [
490
482
  /* @__PURE__ */ e.jsx("div", { className: "hx_warning hfl-text-Error-400" }),
491
- /* @__PURE__ */ e.jsx(L, { variant: "Regular", type: "Text sm", className: "hfl-px-2 hfl-text-1 hfl-text-Error-500", children: "Dosage exceed safety limits" })
483
+ /* @__PURE__ */ e.jsx($, { variant: "Regular", type: "Text sm", className: "hfl-px-2 hfl-text-1 hfl-text-Error-500", children: "Dosage exceed safety limits" })
492
484
  ] }), []);
493
- X(() => () => {
485
+ Q(() => () => {
494
486
  E.cancel();
495
487
  }, [E]);
496
- const a = W(
488
+ const n = W(
497
489
  (l, d) => {
498
- m((c) => {
490
+ p((c) => {
499
491
  let F = { ...c.calculation_fields, [l]: d };
500
492
  if (l === "frequency" && i === "standard") {
501
493
  const R = Me[d] || [];
@@ -517,16 +509,16 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
517
509
  ...s,
518
510
  calculation_fields: { ...s.calculation_fields }
519
511
  };
520
- await g?.(l) && E({ ...l, isNewlyAdded: !1, isEditing: !1 });
512
+ await m?.(l) && E({ ...l, isNewlyAdded: !1, isEditing: !1 });
521
513
  }, j = async () => {
522
514
  if (!t.medicine_name || t.medicine_name.trim() === "") {
523
- b?.(t.rowId);
515
+ y?.(t.rowId);
524
516
  return;
525
517
  }
526
- m(t), i === "standard" && y(!1);
518
+ p(t), i === "standard" && _(!1);
527
519
  }, T = (l) => i === "prescription" && (l === "medicine_name" || l === "generic_name" || l === "type" || l === "calculation_type") ? !1 : V, q = () => {
528
520
  const l = !(s?.isSavedToLibrary ?? !1), d = { ...s, isSavedToLibrary: l };
529
- m(d), E(d, "isSavedToLibrary");
521
+ p(d), E(d, "isSavedToLibrary");
530
522
  };
531
523
  return /* @__PURE__ */ e.jsxs(
532
524
  "div",
@@ -555,7 +547,7 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
555
547
  },
556
548
  onChangeHandler: (l) => {
557
549
  const d = l.value, c = we.find((F) => F.val === d.medicineType);
558
- m((F) => ({
550
+ p((F) => ({
559
551
  ...F,
560
552
  medicine_name: d.doctorMedicineName,
561
553
  medicine_id: d.medicineId,
@@ -563,7 +555,7 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
563
555
  type: c?.type ?? ""
564
556
  })), M(d.doctorMedicineName);
565
557
  },
566
- options: $,
558
+ options: L,
567
559
  isSearchable: !0,
568
560
  placeholder: "Search medicine",
569
561
  disabled: !s?.isNewlyAdded,
@@ -572,7 +564,7 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
572
564
  const d = l.relatedTarget;
573
565
  if (!(d && d.closest(".custom-dropdown-menu")) && !N) {
574
566
  const c = s.medicine_name?.trim() || "";
575
- $.some((A) => A.label === c) || m((A) => ({ ...A, medicine_name: H }));
567
+ L.some((A) => A.label === c) || p((A) => ({ ...A, medicine_name: H }));
576
568
  }
577
569
  }
578
570
  }
@@ -636,7 +628,7 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
636
628
  inputType: "text",
637
629
  inputValue: f.drug_strength || "",
638
630
  inputChangeHandler: (l) => {
639
- U(l) && a("drug_strength", l);
631
+ U(l) && n("drug_strength", l);
640
632
  }
641
633
  }
642
634
  ) }),
@@ -651,7 +643,7 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
651
643
  inputType: "text",
652
644
  inputValue: f.dose_mg_kg || "",
653
645
  inputChangeHandler: (l) => {
654
- U(l) && a("dose_mg_kg", l);
646
+ U(l) && n("dose_mg_kg", l);
655
647
  }
656
648
  }
657
649
  ) }),
@@ -667,7 +659,7 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
667
659
  } : void 0,
668
660
  options: Se.map((l) => ({ label: l, value: l })),
669
661
  onChangeHandler: (l) => {
670
- a("frequency", l.value);
662
+ n("frequency", l.value);
671
663
  }
672
664
  }
673
665
  ) }),
@@ -682,7 +674,7 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
682
674
  inputType: "text",
683
675
  inputValue: f.max_mg_dose || "",
684
676
  inputChangeHandler: (l) => {
685
- U(l) && a("max_mg_dose", l);
677
+ U(l) && n("max_mg_dose", l);
686
678
  }
687
679
  }
688
680
  ) }),
@@ -697,7 +689,7 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
697
689
  inputType: "text",
698
690
  inputValue: f.max_mg_day || "",
699
691
  inputChangeHandler: (l) => {
700
- U(l) && a("max_mg_day", l);
692
+ U(l) && n("max_mg_day", l);
701
693
  }
702
694
  }
703
695
  ) })
@@ -714,7 +706,7 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
714
706
  inputType: "text",
715
707
  inputValue: u.drug_strength || "",
716
708
  inputChangeHandler: (l) => {
717
- U(l) && (a("drug_strength", l), a("dose_ml_kg", ve(u.dose_mg_kg, l)));
709
+ U(l) && (n("drug_strength", l), n("dose_ml_kg", ve(u.dose_mg_kg, l)));
718
710
  }
719
711
  }
720
712
  ) }),
@@ -729,7 +721,7 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
729
721
  inputType: "text",
730
722
  inputValue: u.dose_mg_kg || "",
731
723
  inputChangeHandler: (l) => {
732
- U(l) && (a("dose_mg_kg", l), a("dose_ml_kg", ve(l, u.drug_strength)));
724
+ U(l) && (n("dose_mg_kg", l), n("dose_ml_kg", ve(l, u.drug_strength)));
733
725
  }
734
726
  }
735
727
  ) }),
@@ -745,7 +737,7 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
745
737
  inputType: "text",
746
738
  inputValue: ve(u.dose_mg_kg, u.drug_strength) || "",
747
739
  inputChangeHandler: (l) => {
748
- U(l) && a("dose_ml_kg", l);
740
+ U(l) && n("dose_ml_kg", l);
749
741
  }
750
742
  }
751
743
  ) }),
@@ -761,7 +753,7 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
761
753
  } : void 0,
762
754
  options: Se.map((l) => ({ label: l, value: l })),
763
755
  onChangeHandler: (l) => {
764
- a("frequency", l.value);
756
+ n("frequency", l.value);
765
757
  }
766
758
  }
767
759
  ) }),
@@ -776,7 +768,7 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
776
768
  inputType: "text",
777
769
  inputValue: u.max_ml_dose || "",
778
770
  inputChangeHandler: (l) => {
779
- U(l) && a("max_ml_dose", l);
771
+ U(l) && n("max_ml_dose", l);
780
772
  }
781
773
  }
782
774
  ) }),
@@ -791,7 +783,7 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
791
783
  inputType: "text",
792
784
  inputValue: u.max_ml_day || "",
793
785
  inputChangeHandler: (l) => {
794
- U(l) && a("max_ml_day", l);
786
+ U(l) && n("max_ml_day", l);
795
787
  }
796
788
  }
797
789
  ) })
@@ -825,13 +817,13 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
825
817
  showInput: i !== "standard",
826
818
  disableInputAutoSize: !0,
827
819
  inputValue: i === "standard" ? s.calculation_fields.pedia_dosage : s.pedia_dosage,
828
- inputChangeHandler: (c) => i === "prescription" ? z("pedia_dosage", c) : a("pedia_dosage", c),
820
+ inputChangeHandler: (c) => i === "prescription" ? z("pedia_dosage", c) : n("pedia_dosage", c),
829
821
  selectedOption: i === "standard" ? {
830
822
  label: s.calculation_fields.pedia_dosage,
831
823
  value: s.calculation_fields.pedia_dosage
832
824
  } : void 0,
833
825
  options: i !== "prescription" ? d.map((c) => ({ label: c, value: c })) : void 0,
834
- onChangeHandler: i !== "prescription" ? (c) => a("pedia_dosage", c.value) : void 0,
826
+ onChangeHandler: i !== "prescription" ? (c) => n("pedia_dosage", c.value) : void 0,
835
827
  hideDropdownIcon: i === "prescription",
836
828
  showEmptyDropdownPopup: i !== "prescription",
837
829
  showErrorMsg: i === "prescription" ? r || x : !1,
@@ -843,14 +835,14 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
843
835
  r && o
844
836
  ] }) }),
845
837
  /* @__PURE__ */ e.jsx("div", { className: "hfl-w-full hfl-py-2.5 hfl-min-w-0", children: /* @__PURE__ */ e.jsx(
846
- Ze,
838
+ Qe,
847
839
  {
848
840
  effectiveEditMode: V,
849
841
  rowData: t,
850
842
  isSavedToLibrary: s.isSavedToLibrary ?? !1,
851
843
  onSave: I,
852
844
  onCancel: j,
853
- onEdit: () => y(!0),
845
+ onEdit: () => _(!0),
854
846
  onCheckboxToggle: q
855
847
  }
856
848
  ) })
@@ -858,26 +850,26 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
858
850
  }
859
851
  );
860
852
  },
861
- (n, t) => n.isEditing === t.isEditing && n.rowData.rowId === t.rowData.rowId && n.rowData.isEditing === t.rowData.isEditing && n.rowData.medicine_name === t.rowData.medicine_name && n.rowData.generic_name === t.rowData.generic_name && n.rowData.type === t.rowData.type && n.rowData.pedia_dosage === t.rowData.pedia_dosage && n.rowData.calculation_type === t.rowData.calculation_type && JSON.stringify(n.rowData.calculation_fields) === JSON.stringify(t.rowData.calculation_fields) && n.rowData.out_of_range === t.rowData.out_of_range && n.rowData.isDosageMismatch === t.rowData.isDosageMismatch && n.rowData.calculation_fields.pedia_dosage === t.rowData.calculation_fields.pedia_dosage && n.rowData?.isNewlyAdded === t.rowData?.isNewlyAdded && n.rowData?.pedia_data_available === t.rowData?.pedia_data_available
862
- ), il = (n) => {
853
+ (a, t) => a.isEditing === t.isEditing && a.rowData.rowId === t.rowData.rowId && a.rowData.isEditing === t.rowData.isEditing && a.rowData.medicine_name === t.rowData.medicine_name && a.rowData.generic_name === t.rowData.generic_name && a.rowData.type === t.rowData.type && a.rowData.pedia_dosage === t.rowData.pedia_dosage && a.rowData.calculation_type === t.rowData.calculation_type && JSON.stringify(a.rowData.calculation_fields) === JSON.stringify(t.rowData.calculation_fields) && a.rowData.out_of_range === t.rowData.out_of_range && a.rowData.isDosageMismatch === t.rowData.isDosageMismatch && a.rowData.calculation_fields.pedia_dosage === t.rowData.calculation_fields.pedia_dosage && a.rowData?.isNewlyAdded === t.rowData?.isNewlyAdded && a.rowData?.pedia_data_available === t.rowData?.pedia_data_available
854
+ ), il = (a) => {
863
855
  const {
864
856
  openState: t,
865
- closePopupCallback: p,
866
- headingIconFile: y,
867
- headingText: g,
857
+ closePopupCallback: g,
858
+ headingIconFile: _,
859
+ headingText: m,
868
860
  subHeadingText: N,
869
861
  positiveButtonText: i,
870
862
  negativeButtonText: C,
871
863
  classNamePositiveBtn: w,
872
- classNameNegativeBtn: _,
864
+ classNameNegativeBtn: b,
873
865
  positiveActionCallback: k,
874
- negativeActionCallback: b
875
- } = n;
866
+ negativeActionCallback: y
867
+ } = a;
876
868
  return /* @__PURE__ */ e.jsxs(
877
869
  Fe,
878
870
  {
879
871
  isOpen: t,
880
- onRequestClose: p,
872
+ onRequestClose: g,
881
873
  shouldCloseOnOverlayClick: !1,
882
874
  style: {
883
875
  overlay: {
@@ -902,9 +894,9 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
902
894
  }
903
895
  },
904
896
  children: [
905
- y == "warning" && /* @__PURE__ */ e.jsx("div", { className: "hfl-hx_warning hfl-mb-4 hfl-flex hfl-h-12 hfl-w-12 hfl-items-center hfl-justify-center hfl-rounded-full hfl-border-8 hfl-border-Warning-50 hfl-bg-Warning-100 hfl-text-Warning-600", children: /* @__PURE__ */ e.jsx("i", { className: "hx_warning hfl-text-5" }) }),
906
- /* @__PURE__ */ e.jsx(L, { variant: "Medium", type: "Text xl", className: "hfl-mt-5 hfl-text-Gray-900", children: g }),
907
- N && /* @__PURE__ */ e.jsx(L, { variant: "Regular", type: "Text sm", className: "hfl-mt-1 hfl-text-Gray-500 ", children: N }),
897
+ _ == "warning" && /* @__PURE__ */ e.jsx("div", { className: "hfl-hx_warning hfl-mb-4 hfl-flex hfl-h-12 hfl-w-12 hfl-items-center hfl-justify-center hfl-rounded-full hfl-border-8 hfl-border-Warning-50 hfl-bg-Warning-100 hfl-text-Warning-600", children: /* @__PURE__ */ e.jsx("i", { className: "hx_warning hfl-text-5" }) }),
898
+ /* @__PURE__ */ e.jsx($, { variant: "Medium", type: "Text xl", className: "hfl-mt-5 hfl-text-Gray-900", children: m }),
899
+ N && /* @__PURE__ */ e.jsx($, { variant: "Regular", type: "Text sm", className: "hfl-mt-1 hfl-text-Gray-500 ", children: N }),
908
900
  /* @__PURE__ */ e.jsxs("div", { className: "hfl-mt-4 hfl-flex hfl-items-center hfl-justify-center hfl-gap-4", children: [
909
901
  C && /* @__PURE__ */ e.jsx(
910
902
  oe,
@@ -912,8 +904,8 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
912
904
  size: "md",
913
905
  textField: C,
914
906
  hierarchy: "Primary",
915
- className: _ || "",
916
- onClick: b,
907
+ className: b || "",
908
+ onClick: y,
917
909
  "data-qa": "negative-action"
918
910
  }
919
911
  ),
@@ -932,10 +924,10 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
932
924
  ]
933
925
  }
934
926
  );
935
- }, rl = ({ open: n, onCancel: t, onCopySave: p, rowMedicineData: y, getMedicineOptions: g }) => {
936
- const [N, i] = G([]), [C, w] = G(""), [_, k] = G([]), b = W(
937
- async (m) => {
938
- const M = (await g?.(m))?.map(
927
+ }, rl = ({ open: a, onCancel: t, onCopySave: g, rowMedicineData: _, getMedicineOptions: m }) => {
928
+ const [N, i] = G([]), [C, w] = G(""), [b, k] = G([]), y = W(
929
+ async (p) => {
930
+ const M = (await m?.(p))?.map(
939
931
  (S) => ({
940
932
  label: S.doctorMedicineName,
941
933
  value: S
@@ -943,25 +935,25 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
943
935
  );
944
936
  k(M || []);
945
937
  },
946
- [g]
938
+ [m]
947
939
  );
948
- X(() => {
949
- n && b(C);
950
- }, [C, b, n]);
951
- const $ = (m) => {
952
- const H = m.value;
940
+ Q(() => {
941
+ a && y(C);
942
+ }, [C, y, a]);
943
+ const L = (p) => {
944
+ const H = p.value;
953
945
  N.some(
954
946
  (S) => S.medicineId === H.medicineId && S.doctorMedicineName.trim().toLowerCase() === H.doctorMedicineName.trim().toLowerCase()
955
947
  ) || i((S) => [...S, H]), w(""), k([]);
956
- }, B = (m) => {
957
- i((H) => H.filter((M) => M.medicineId !== m));
948
+ }, B = (p) => {
949
+ i((H) => H.filter((M) => M.medicineId !== p));
958
950
  }, s = async () => {
959
- C.trim() || await b("");
951
+ C.trim() || await y("");
960
952
  };
961
953
  return /* @__PURE__ */ e.jsxs(
962
954
  Fe,
963
955
  {
964
- isOpen: n,
956
+ isOpen: a,
965
957
  onRequestClose: t,
966
958
  shouldCloseOnOverlayClick: !1,
967
959
  style: {
@@ -983,7 +975,7 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
983
975
  },
984
976
  children: [
985
977
  /* @__PURE__ */ e.jsx(
986
- L,
978
+ $,
987
979
  {
988
980
  variant: "Bold",
989
981
  type: "Text lg",
@@ -1000,22 +992,22 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
1000
992
  isSearchable: !0,
1001
993
  disableInputAutoSize: !0,
1002
994
  inputChangeHandler: w,
1003
- onChangeHandler: $,
995
+ onChangeHandler: L,
1004
996
  onInputFocus: s,
1005
- options: _,
997
+ options: b,
1006
998
  placeholder: "Search for medicines"
1007
999
  }
1008
1000
  ),
1009
- /* @__PURE__ */ e.jsx("div", { className: "hfl-flex hfl-flex-wrap hfl-gap-2", children: N.map((m) => /* @__PURE__ */ e.jsxs(
1001
+ /* @__PURE__ */ e.jsx("div", { className: "hfl-flex hfl-flex-wrap hfl-gap-2", children: N.map((p) => /* @__PURE__ */ e.jsxs(
1010
1002
  "div",
1011
1003
  {
1012
1004
  className: "hfl-flex hfl-items-center hfl-bg-Gray-100 hfl-px-2 hfl-py-0.5 hfl-rounded-md hfl-gap-1",
1013
1005
  children: [
1014
- /* @__PURE__ */ e.jsx(L, { variant: "Regular", type: "Text sm", className: "hfl-text-nowrap", children: m.doctorMedicineName }),
1015
- /* @__PURE__ */ e.jsx("button", { className: "hfl-text-Blue_gray-800", onClick: () => B(m.medicineId), children: /* @__PURE__ */ e.jsx("i", { className: "hx_close" }) })
1006
+ /* @__PURE__ */ e.jsx($, { variant: "Regular", type: "Text sm", className: "hfl-text-nowrap", children: p.doctorMedicineName }),
1007
+ /* @__PURE__ */ e.jsx("button", { className: "hfl-text-Blue_gray-800", onClick: () => B(p.medicineId), children: /* @__PURE__ */ e.jsx("i", { className: "hx_close" }) })
1016
1008
  ]
1017
1009
  },
1018
- m.doctorMedicineName + m.medicineId
1010
+ p.doctorMedicineName + p.medicineId
1019
1011
  )) })
1020
1012
  ] }),
1021
1013
  /* @__PURE__ */ e.jsxs("div", { className: "hfl-flex hfl-justify-end hfl-gap-2.5 hfl-bg-Gray-50 hfl-px-7 hfl-py-3 hfl-border-t hfl-border-Gray-200", children: [
@@ -1027,7 +1019,7 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
1027
1019
  textField: "Save",
1028
1020
  disabled: !N || N.length == 0,
1029
1021
  onClick: async () => {
1030
- await p(y, N) && t();
1022
+ await g(_, N) && t();
1031
1023
  },
1032
1024
  className: "hfl-bg-Primary-600 hfl-text-White disabled:hfl-opacity-50 disabled:hfl-cursor-not-allowed",
1033
1025
  hierarchy: "Primary"
@@ -1037,48 +1029,48 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
1037
1029
  ]
1038
1030
  }
1039
1031
  );
1040
- }, ul = Pe(
1032
+ }, pl = Pe(
1041
1033
  ({
1042
- data: n = [],
1034
+ data: a = [],
1043
1035
  variant: t,
1044
- externallyTriggeredEditRowIds: p = [],
1045
- externallyTriggeredEditMode: y = !1,
1046
- allowCustomMedicineInput: g = !0,
1036
+ externallyTriggeredEditRowIds: g = [],
1037
+ externallyTriggeredEditMode: _ = !1,
1038
+ allowCustomMedicineInput: m = !0,
1047
1039
  getMedicineOptions: N,
1048
1040
  onRowChange: i,
1049
1041
  onRowDelete: C,
1050
1042
  onRowCopy: w,
1051
- onSaveRow: _,
1043
+ onSaveRow: b,
1052
1044
  externalSaveTrigger: k,
1053
- setSearchDisabled: b
1054
- }, $) => {
1055
- const [B, s] = G(null), [m, H] = G(!1), [M, S] = G(), Z = W(
1056
- (o, a, I) => {
1057
- const j = n.find((q) => q.rowId === o);
1045
+ setSearchDisabled: y
1046
+ }, L) => {
1047
+ const [B, s] = G(null), [p, H] = G(!1), [M, S] = G(), X = W(
1048
+ (o, n, I) => {
1049
+ const j = a.find((q) => q.rowId === o);
1058
1050
  if (!j) return;
1059
- const T = { ...j, ...a };
1051
+ const T = { ...j, ...n };
1060
1052
  i?.(T, I || void 0);
1061
1053
  },
1062
- [n, i]
1054
+ [a, i]
1063
1055
  ), V = W(async () => {
1064
- const o = n.filter((a) => a.isEditing && a.medicine_name);
1056
+ const o = a.filter((n) => n.isEditing && n.medicine_name);
1065
1057
  if (o.length !== 0)
1066
1058
  try {
1067
- await _?.(o) && o.forEach((I) => {
1059
+ await b?.(o) && o.forEach((I) => {
1068
1060
  i?.({ ...I, isEditing: !1 });
1069
1061
  });
1070
- } catch (a) {
1071
- console.error("Bulk save failed", a);
1062
+ } catch (n) {
1063
+ console.error("Bulk save failed", n);
1072
1064
  } finally {
1073
- b?.(!1);
1065
+ y?.(!1);
1074
1066
  }
1075
- }, [n, _, i, b]);
1076
- X(() => {
1067
+ }, [a, b, i, y]);
1068
+ Q(() => {
1077
1069
  k && V();
1078
- }, [k, V]), X(() => {
1079
- const o = n.some((a) => a.isEditing);
1080
- b?.(o);
1081
- }, [n, b]);
1070
+ }, [k, V]), Q(() => {
1071
+ const o = a.some((n) => n.isEditing);
1072
+ y?.(o);
1073
+ }, [a, y]);
1082
1074
  const r = W((o) => {
1083
1075
  S(o), H(!0);
1084
1076
  }, []), x = W(async () => {
@@ -1095,32 +1087,32 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
1095
1087
  }, []), u = W(
1096
1088
  async (o) => {
1097
1089
  try {
1098
- return await _?.([o]) ? (i?.({ ...o, isEditing: !1 }), !0) : !1;
1099
- } catch (a) {
1100
- return console.error("Save row failed", a), !1;
1090
+ return await b?.([o]) ? (i?.({ ...o, isEditing: !1 }), !0) : !1;
1091
+ } catch (n) {
1092
+ return console.error("Save row failed", n), !1;
1101
1093
  }
1102
1094
  },
1103
- [_, i]
1095
+ [b, i]
1104
1096
  ), z = W(async () => {
1105
- const o = n.filter((a) => a.isEditing && a.medicine_name);
1097
+ const o = a.filter((n) => n.isEditing && n.medicine_name);
1106
1098
  if (o.length === 0) return !0;
1107
1099
  try {
1108
- const a = await _?.(o);
1109
- return a && n.map((j) => j.isEditing ? { ...j, isEditing: !1 } : j).forEach((j) => i?.(j)), !!a;
1110
- } catch (a) {
1111
- return console.error("External bulk save failed", a), !1;
1100
+ const n = await b?.(o);
1101
+ return n && a.map((j) => j.isEditing ? { ...j, isEditing: !1 } : j).forEach((j) => i?.(j)), !!n;
1102
+ } catch (n) {
1103
+ return console.error("External bulk save failed", n), !1;
1112
1104
  }
1113
- }, [n, _, i]);
1114
- Ke($, () => ({
1105
+ }, [a, b, i]);
1106
+ Ke(L, () => ({
1115
1107
  triggerExternalSave: z
1116
1108
  }));
1117
1109
  const E = {
1118
1110
  variant: t,
1119
- externallyTriggeredEditMode: y,
1120
- externallyTriggeredEditRowIds: p,
1111
+ externallyTriggeredEditMode: _,
1112
+ externallyTriggeredEditRowIds: g,
1121
1113
  getMedicineOptions: N,
1122
- onRowChange: (o, a) => {
1123
- Z(o.rowId, o, a), i?.(o, a);
1114
+ onRowChange: (o, n) => {
1115
+ X(o.rowId, o, n), i?.(o, n);
1124
1116
  },
1125
1117
  onRowDelete: C,
1126
1118
  onRowCopy: w,
@@ -1128,16 +1120,16 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
1128
1120
  openPopupForRow: r
1129
1121
  };
1130
1122
  return /* @__PURE__ */ e.jsxs("div", { className: "hfl-border-1 hfl-border-Gray-200", children: [
1131
- /* @__PURE__ */ e.jsx("div", { className: "table-header hfl-grid hfl-grid-cols-[1.36fr_1.36fr_1.02fr_1.25fr_2.27fr_1.36fr_1.36fr] hfl-gap-2 hfl-py-2 hfl-px-2 hfl-font-bold hfl-border-b-1 hfl-border-Gray-200 hfl-bg-Blue_gray-50", children: Ue.map((o) => /* @__PURE__ */ e.jsx(L, { variant: "Medium", type: "Text sm", className: "hfl-text-Blue_gray-600", children: o }, o)) }),
1123
+ /* @__PURE__ */ e.jsx("div", { className: "table-header hfl-grid hfl-grid-cols-[1.36fr_1.36fr_1.02fr_1.25fr_2.27fr_1.36fr_1.36fr] hfl-gap-2 hfl-py-2 hfl-px-2 hfl-font-bold hfl-border-b-1 hfl-border-Gray-200 hfl-bg-Blue_gray-50", children: Ue.map((o) => /* @__PURE__ */ e.jsx($, { variant: "Medium", type: "Text sm", className: "hfl-text-Blue_gray-600", children: o }, o)) }),
1132
1124
  /* @__PURE__ */ e.jsxs(Oe.Provider, { value: E, children: [
1133
- /* @__PURE__ */ e.jsx("div", { className: "table-body", children: n.length === 0 ? /* @__PURE__ */ e.jsx(L, { variant: "Medium", type: "Text sm", className: "hfl-text-Blue_gray-600 hfl-px-2 hfl-py-3", children: "No medicines added" }) : n.map((o) => /* @__PURE__ */ e.jsx(
1125
+ /* @__PURE__ */ e.jsx("div", { className: "table-body", children: a.length === 0 ? /* @__PURE__ */ e.jsx($, { variant: "Medium", type: "Text sm", className: "hfl-text-Blue_gray-600 hfl-px-2 hfl-py-3", children: "No medicines added" }) : a.map((o) => /* @__PURE__ */ e.jsx(
1134
1126
  sl,
1135
1127
  {
1136
1128
  rowData: o,
1137
1129
  isEditing: o.isEditing || !1,
1138
- setIsEditing: (a) => Z(o.rowId, { isEditing: a }),
1130
+ setIsEditing: (n) => X(o.rowId, { isEditing: n }),
1139
1131
  onSaveRow: u,
1140
- allowCustomMedicineInput: g
1132
+ allowCustomMedicineInput: m
1141
1133
  },
1142
1134
  o.rowId
1143
1135
  )) }),
@@ -1159,7 +1151,7 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
1159
1151
  /* @__PURE__ */ e.jsx(
1160
1152
  rl,
1161
1153
  {
1162
- open: m,
1154
+ open: p,
1163
1155
  onCancel: () => H(!1),
1164
1156
  onCopySave: w,
1165
1157
  rowMedicineData: M,
@@ -1171,5 +1163,5 @@ const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
1171
1163
  }
1172
1164
  );
1173
1165
  export {
1174
- ul as P
1166
+ pl as P
1175
1167
  };