hplx-feature-library 1.0.200 → 1.0.202

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-l6i46qgX.js → APIAction-BpUGTq-P.js} +23 -24
  2. package/dist/APIAction-Dh8yXpE0.cjs +1 -0
  3. package/dist/Attachments/index.js +1 -1
  4. package/dist/{Attachments-BzZHI8d3.js → Attachments-3UkuRnaT.js} +6297 -6180
  5. package/dist/Attachments-B9GrTokn.cjs +202 -0
  6. package/dist/PatientAddEdit/index.js +1 -1
  7. package/dist/PatientAddEdit-DKtOZH2N.cjs +7 -0
  8. package/dist/{PatientAddEdit-CPjv2_ZF.js → PatientAddEdit-DjNwzBQV.js} +18 -20
  9. package/dist/PatientPopup/index.js +1 -1
  10. package/dist/PatientPopupContainer-Bg9zUots.cjs +36 -0
  11. package/dist/{PatientPopupContainer-Bf80eZlB.js → PatientPopupContainer-RxozPrZy.js} +47 -49
  12. package/dist/PediatricsCalculator/index.js +1 -1
  13. package/dist/PediatricsCalculatorTable-bTvt7SWQ.cjs +9 -0
  14. package/dist/{PediatricsCalculatorTable-G0ttbDpi.js → PediatricsCalculatorTable-qu37FR7D.js} +236 -228
  15. package/dist/{PrintModal-ifEeax6V.js → PrintModal-D4AX-Rz-.js} +3203 -3215
  16. package/dist/{PrintModal-Db9_gQic.cjs → PrintModal-DYCkcIdD.cjs} +52 -50
  17. package/dist/{ReusableModal-CIgDYOWZ.cjs → ReusableModal-2GKjVVbf.cjs} +1 -1
  18. package/dist/{ReusableModal-CT4_gW1b.js → ReusableModal-BL_DwV8I.js} +1 -1
  19. package/dist/SearchPatients/index.js +1 -1
  20. package/dist/{SearchPatients-BYGGaUoD.js → SearchPatients-B34Jmyh7.js} +3 -3
  21. package/dist/{SearchPatients-BXNWucYz.cjs → SearchPatients-CKu0XGDw.cjs} +1 -1
  22. package/dist/common-utils-B6431-iN.js +2657 -0
  23. package/dist/common-utils-DeErqLTB.cjs +6 -0
  24. package/dist/hplx-feature-library.css +1 -1
  25. package/dist/{index-T1lUjzhG.js → index-BzwuwvT5.js} +1 -1
  26. package/dist/{index-DQlbIHh3.cjs → index-CJ2AKRoq.cjs} +26 -26
  27. package/dist/{index-DkA8S5IK.cjs → index-CRCsQdYf.cjs} +1 -1
  28. package/dist/{index-Bd0CDVpH.js → index-UPYT3B9g.js} +2 -3
  29. package/dist/index.d.ts +0 -3
  30. package/dist/index.js +12 -18
  31. package/dist/nineDots/index.d.ts +0 -1
  32. package/dist/print-pdf/index.js +1 -1
  33. package/dist/types/CommonTypes.d.ts +1 -1
  34. package/dist/userProfile/index.d.ts +0 -1
  35. package/package.json +9 -14
  36. package/dist/APIAction-5-3i1gGx.cjs +0 -1
  37. package/dist/AllInvestigations/components/AllInvestigationsTable.d.ts +0 -19
  38. package/dist/AllInvestigations/index.d.ts +0 -1
  39. package/dist/AllInvestigations/index.js +0 -4
  40. package/dist/AllInvestigations/utils/test-tange-util.d.ts +0 -8
  41. package/dist/AllInvestigationsTable-BDLPOHjr.cjs +0 -79
  42. package/dist/AllInvestigationsTable-Dg-YXASz.js +0 -17065
  43. package/dist/Attachments-CziD-_gm.cjs +0 -186
  44. package/dist/CommonConstant-Bj7SvPfU.js +0 -436
  45. package/dist/CommonConstant-COHqiSWL.cjs +0 -1
  46. package/dist/NineDots/index.js +0 -4
  47. package/dist/NineDots-BEzE3Pj8.cjs +0 -3
  48. package/dist/NineDots-CCtE2t9I.js +0 -1788
  49. package/dist/PatientAddEdit-UFho4sOA.cjs +0 -7
  50. package/dist/PatientPopupContainer-SfsdSNpR.cjs +0 -36
  51. package/dist/PediatricsCalculatorTable-B4fTy1J5.cjs +0 -9
  52. package/dist/ReusableTable/ReusableTable.d.ts +0 -3
  53. package/dist/ReusableTable/ReusableTableConstants.d.ts +0 -8
  54. package/dist/ReusableTable/ReusableTableTypes.d.ts +0 -96
  55. package/dist/ReusableTable/components/EmptyTableContainer.d.ts +0 -12
  56. package/dist/ReusableTable/components/FilterCheckbox.d.ts +0 -8
  57. package/dist/ReusableTable/components/FilterDropdown.d.ts +0 -17
  58. package/dist/ReusableTable/components/Pagination.d.ts +0 -2
  59. package/dist/ReusableTable/components/TableBody.d.ts +0 -2
  60. package/dist/ReusableTable/components/TableCell.d.ts +0 -3
  61. package/dist/ReusableTable/components/TableFilterSelect.d.ts +0 -12
  62. package/dist/ReusableTable/components/TableHead.d.ts +0 -2
  63. package/dist/ReusableTable/components/TableMain.d.ts +0 -2
  64. package/dist/ReusableTable/components/TableRow.d.ts +0 -3
  65. package/dist/ReusableTable/context/TableContext.d.ts +0 -21
  66. package/dist/ReusableTable/context/TableContextBase.d.ts +0 -26
  67. package/dist/ReusableTable/context/useTableContext.d.ts +0 -2
  68. package/dist/TrendGraphs/AreaChartComponent.d.ts +0 -9
  69. package/dist/TrendGraphs/LineChartComponent/DataPointToolTip.d.ts +0 -16
  70. package/dist/TrendGraphs/LineChartComponent/LineChartBody.d.ts +0 -2
  71. package/dist/TrendGraphs/LineChartComponent/LineChartHeader.d.ts +0 -2
  72. package/dist/TrendGraphs/LineChartComponent/index.d.ts +0 -2
  73. package/dist/TrendGraphs/context/index.d.ts +0 -2
  74. package/dist/TrendGraphs/hooks/useTrendGraphContext.d.ts +0 -2
  75. package/dist/TrendGraphs/utils/index.d.ts +0 -4
  76. package/dist/UserProfile/index.js +0 -4
  77. package/dist/UserProfile-CcEbhDhd.js +0 -1761
  78. package/dist/UserProfile-DkQgWGvV.cjs +0 -14
  79. package/dist/clsx-C11secjj.cjs +0 -1
  80. package/dist/clsx-OuTLNxxd.js +0 -16
  81. package/dist/common-utils-CJv4_aVl.cjs +0 -6
  82. package/dist/common-utils-Dq5TMP7t.js +0 -1952
  83. package/dist/components/Modal.d.ts +0 -5
  84. package/dist/constants/TrendGraphsConstants.d.ts +0 -2
  85. package/dist/dayjs.min-D52_GdfV.js +0 -284
  86. package/dist/dayjs.min-DXp74Ozx.cjs +0 -1
  87. package/dist/index-CJFGOBPb.js +0 -122
  88. package/dist/index-DfcUmlge.cjs +0 -17
  89. package/dist/types/AllInvestigationTypes/index.js +0 -4
  90. package/dist/types/AllInvestigationTypes.d.ts +0 -45
  91. package/dist/types/NineDotsTypes/index.js +0 -1
  92. package/dist/types/TrendGraphTypes.d.ts +0 -19
  93. package/dist/useClickOutside-BjJyGTec.js +0 -14
  94. package/dist/useClickOutside-DsVG12Cs.cjs +0 -1
@@ -1,14 +1,12 @@
1
- import { j as e, b as D, g as xn, t as Ln, K as Fe, h as kn, P as Tt, Z as Or, k as ll, a as Oa, e as hr, A as ur, c as vn, N as _n, O as Ul, E as yn, q as Vn } from "./index-Bd0CDVpH.js";
1
+ import { j as e, b as D, g as xn, t as Ln, K as Fe, h as kn, P as Tt, Z as Or, k as ll, a as Oa, e as hr, A as ur, c as vn, N as _n, O as Ul, E as yn, q as Vn } from "./index-UPYT3B9g.js";
2
2
  import cl, { createContext as On, useContext as kt, useState as Y, forwardRef as Wn, useRef as Mr, useEffect as Ke, useCallback as Lt, useMemo as Kt, useReducer as Wa } from "react";
3
- import { n as Ga, R as Ct, h as za, c as zn, v as an, j as nn, i as Yn } from "./common-utils-Dq5TMP7t.js";
4
- import { G as qn, a as $n, b as Un, c as bn, U as Ya, d as Zn, e as wn, f as Kn, g as Cn, h as Xn, i as Jn, j as Qn, k as ei, l as ti, m as ri, n as li, o as jn, D as ai, p as ni, q as ii, r as si, s as oi, V as ci, t as Rn, u as di, v as ui, w as fi, x as hi, y as pi, z as mi, A as gi, B as xi, C as vi, F as At, E as _i, H as yi, I as bi, T as It, W as Pn, J as Sn, K as wi, L as Ci, M as ji, P as Ri } from "./PrintModal-ifEeax6V.js";
5
- import { d as Be } from "./dayjs.min-D52_GdfV.js";
6
- import { G as Pi, f as Si, h as sn, i as Ni } from "./APIAction-l6i46qgX.js";
7
- import { a as Di, H as Ai, D as Na, M as Da, b as Wl, S as Ii, C as Aa, O as Ia } from "./CommonConstant-Bj7SvPfU.js";
3
+ import { o as Ga, R as Ct, c as Be, h as za, q as zn, e as Yn, H as qn, v as an, k as nn, D as Na, M as Da, l as Wl, S as $n, C as Aa, O as Ia, i as Un } from "./common-utils-B6431-iN.js";
4
+ import { G as Zn, a as Kn, b as Xn, c as bn, U as Ya, d as Jn, e as wn, f as Qn, g as Cn, h as ei, i as ti, j as ri, k as li, l as ai, m as ni, n as ii, o as jn, D as si, p as oi, q as ci, r as di, s as ui, V as fi, t as Rn, u as hi, v as pi, w as mi, x as gi, y as xi, z as vi, A as _i, B as yi, C as bi, F as At, E as wi, H as Ci, I as ji, T as It, W as Pn, J as Sn, K as Ri, L as Pi, M as Si, P as Ni } from "./PrintModal-D4AX-Rz-.js";
5
+ import { G as Di, f as Ai, h as sn, i as Ii } from "./APIAction-BpUGTq-P.js";
8
6
  import { c as ol } from "./index.esm-Bn1Rklqj.js";
9
7
  /* empty css */
10
8
  import { u as qa } from "./useMediaQuery-CZAbdJzN.js";
11
- import { R as Bi } from "./ReusableModal-CT4_gW1b.js";
9
+ import { R as Bi } from "./ReusableModal-BL_DwV8I.js";
12
10
  const on = {
13
11
  color: "white"
14
12
  }, Ar = (s) => /* @__PURE__ */ e.jsx("div", { children: s.isRequired && /* @__PURE__ */ e.jsx("a", { href: s.goToPage, children: /* @__PURE__ */ e.jsxs(
@@ -289,7 +287,7 @@ const rl = {
289
287
  };
290
288
  window?.partner_service_enabled === "1" && (n.partner_service_enabled = !0);
291
289
  const v = await Ct(d.token, d.envName).post(
292
- Pi,
290
+ Di,
293
291
  {
294
292
  ...n
295
293
  }
@@ -303,7 +301,7 @@ const rl = {
303
301
  }, Hi = async (s) => {
304
302
  try {
305
303
  const u = await Ct(s.token, s.envName).get(
306
- Zn + "/" + s.window_var.org_branch_id_for_seg + "?doctor_role_id=" + s.window_var.doctor_role_id_for_seg + "&doctor_id=" + s.window_var.person_id_for_seg
304
+ Jn + "/" + s.window_var.org_branch_id_for_seg + "?doctor_role_id=" + s.window_var.doctor_role_id_for_seg + "&doctor_id=" + s.window_var.person_id_for_seg
307
305
  ), { data: d } = u || {};
308
306
  return Promise.resolve(d);
309
307
  } catch (u) {
@@ -312,7 +310,7 @@ const rl = {
312
310
  }, Li = async (s) => {
313
311
  try {
314
312
  const u = await Ct(s.token, s.envName).get(
315
- qn + "/" + s.window_var.org_branch_id_for_seg + "?doctor_role_id=" + s.window_var.doctor_role_id_for_seg + "&doctor_id=" + s.window_var.person_id_for_seg
313
+ Zn + "/" + s.window_var.org_branch_id_for_seg + "?doctor_role_id=" + s.window_var.doctor_role_id_for_seg + "&doctor_id=" + s.window_var.person_id_for_seg
316
314
  ), { data: d } = u || {};
317
315
  return Promise.resolve(d);
318
316
  } catch (u) {
@@ -339,7 +337,7 @@ const rl = {
339
337
  }, $a = async (s, u, d) => {
340
338
  try {
341
339
  const n = await Ct(d.token, d.envName).get(
342
- `${li}?order_item_id=${s}&patient_role_id=${u}&org_branch_id=${d.window_var.org_branch_id_for_seg}`
340
+ `${ii}?order_item_id=${s}&patient_role_id=${u}&org_branch_id=${d.window_var.org_branch_id_for_seg}`
343
341
  ), { data: v } = n || {};
344
342
  return Promise.resolve(v);
345
343
  } catch (n) {
@@ -348,7 +346,7 @@ const rl = {
348
346
  }, La = async (s, u, d = !0, n) => {
349
347
  try {
350
348
  const v = await Ct(n.token, n.envName).get(
351
- `${Kn}?bill_date=${s}&org_branch_id=${n.window_var.org_branch_id_for_seg}&patient_role_id=${u}&past_due=${d}`
349
+ `${Qn}?bill_date=${s}&org_branch_id=${n.window_var.org_branch_id_for_seg}&patient_role_id=${u}&past_due=${d}`
352
350
  ), { data: w } = v || {};
353
351
  return Promise.resolve(w);
354
352
  } catch (v) {
@@ -357,7 +355,7 @@ const rl = {
357
355
  }, ki = async (s, u, d) => {
358
356
  try {
359
357
  const n = await Ct(d.token, d.envName).get(
360
- `${ri}/${s}/${u}?doctor_role_id=${d.window_var.doctor_role_id_for_seg}&doctor_id=${d.window_var.person_id_for_seg}&org_branch_id=${d.window_var.org_branch_id_for_seg}`
358
+ `${ni}/${s}/${u}?doctor_role_id=${d.window_var.doctor_role_id_for_seg}&doctor_id=${d.window_var.person_id_for_seg}&org_branch_id=${d.window_var.org_branch_id_for_seg}`
361
359
  ), { data: v } = n || {};
362
360
  return Promise.resolve(v);
363
361
  } catch (n) {
@@ -409,7 +407,7 @@ const rl = {
409
407
  order_unit_item_price: +s.order_unit_item_price,
410
408
  order_item_discount: +s.order_item_discount,
411
409
  order_item_service_tax: Math.floor(s.order_item_service_tax)
412
- }, v = await Ct(d.token, d.envName).put(hi, {
410
+ }, v = await Ct(d.token, d.envName).put(gi, {
413
411
  ...n
414
412
  }), { data: w } = v || {};
415
413
  return Promise.resolve(w);
@@ -431,7 +429,7 @@ const rl = {
431
429
  // give_discount: true,
432
430
  // existing_discount: '6',
433
431
  // },
434
- }, S = await Ct(a.token, a.envName).put(ui, {
432
+ }, S = await Ct(a.token, a.envName).put(pi, {
435
433
  ...A
436
434
  }), { data: h } = S || {};
437
435
  return Promise.resolve(h);
@@ -441,7 +439,7 @@ const rl = {
441
439
  }, Dn = async (s, u, d, n, v, w) => {
442
440
  try {
443
441
  const a = await Ct(w.token, w.envName).delete(
444
- `${ai}?deleting_person_role_id=${w.window_var.doctor_role_id_for_seg}&mode=${v}&order_id=${s}&order_item_id=${u}&org_branch_id=${w.window_var.org_branch_id_for_seg}&patient_role_id=${d}&reason=${n}`
442
+ `${si}?deleting_person_role_id=${w.window_var.doctor_role_id_for_seg}&mode=${v}&order_id=${s}&order_item_id=${u}&org_branch_id=${w.window_var.org_branch_id_for_seg}&patient_role_id=${d}&reason=${n}`
445
443
  ), { data: A } = a || {};
446
444
  return Promise.resolve(A);
447
445
  } catch (a) {
@@ -538,7 +536,7 @@ const rl = {
538
536
  }, qi = async (s = "", u) => {
539
537
  try {
540
538
  const d = await Ct(u.token, u.envName).get(
541
- `${$n}/${u.window_var.org_branch_id_for_seg}?fields_required=${s}`
539
+ `${Kn}/${u.window_var.org_branch_id_for_seg}?fields_required=${s}`
542
540
  ), { data: n } = d || {};
543
541
  return Promise.resolve(n);
544
542
  } catch (d) {
@@ -565,7 +563,7 @@ const rl = {
565
563
  drawing_board: !0
566
564
  },
567
565
  visit_id: d
568
- }, w = await Ct(n.token, n.envName).post(Jn, {
566
+ }, w = await Ct(n.token, n.envName).post(ti, {
569
567
  ...v
570
568
  }), { data: a } = w || {};
571
569
  return Promise.resolve(a);
@@ -575,7 +573,7 @@ const rl = {
575
573
  }, Ui = async (s, u, d, n) => {
576
574
  try {
577
575
  const v = await Ct(n.enc_token, n.envName).get(
578
- `${ii}/${d}/reports?page=${u}&limit=${s}`
576
+ `${ci}/${d}/reports?page=${u}&limit=${s}`
579
577
  ), { data: w } = v || {}, { status: a, message: A } = w || {};
580
578
  if (!a)
581
579
  throw new Error(A);
@@ -586,7 +584,7 @@ const rl = {
586
584
  }, Zi = async (s, u, d, n) => {
587
585
  try {
588
586
  const v = await Ct(n.token, n.envName).get(
589
- `${Xn}/${d}?doctor_role_id=${n.window_var.doctor_role_id_for_seg}&doctor_id=${n.window_var.person_id_for_seg}&branch_id=${n.window_var.org_branch_id_for_seg}&page_size=${s}&page_number=${u}`
587
+ `${ei}/${d}?doctor_role_id=${n.window_var.doctor_role_id_for_seg}&doctor_id=${n.window_var.person_id_for_seg}&branch_id=${n.window_var.org_branch_id_for_seg}&page_size=${s}&page_number=${u}`
590
588
  ), { data: w } = v || {}, { error: a } = w || {};
591
589
  if (a)
592
590
  throw new Error(a);
@@ -598,7 +596,7 @@ const rl = {
598
596
  const { patientRoleID: n, patientID: v } = d || {};
599
597
  try {
600
598
  const w = await Ct(u.token, u.envName).put(
601
- oi + "/" + n,
599
+ ui + "/" + n,
602
600
  {
603
601
  ...s,
604
602
  person_role_id: u.window_var.doctor_role_id_for_seg,
@@ -615,7 +613,7 @@ const rl = {
615
613
  }, Xi = async (s) => {
616
614
  try {
617
615
  const u = await za(s.token, s.envName).post(
618
- ti
616
+ ai
619
617
  ), { data: d } = u || {}, { apiError: n } = d || {};
620
618
  if (n)
621
619
  throw new Error(n);
@@ -626,7 +624,7 @@ const rl = {
626
624
  }, Ji = async (s, u) => {
627
625
  try {
628
626
  const d = await za(s.token, s.envName).post(
629
- `${ni}?pid=${u}`
627
+ `${oi}?pid=${u}`
630
628
  ), { data: n } = d || {};
631
629
  return Promise.resolve(n);
632
630
  } catch (d) {
@@ -652,7 +650,7 @@ const rl = {
652
650
  }, ts = async (s, u) => {
653
651
  try {
654
652
  const d = await za(u.token, u.envName).post(
655
- vi,
653
+ bi,
656
654
  s
657
655
  ), { data: n } = d || {};
658
656
  return Promise.resolve(n);
@@ -669,7 +667,7 @@ const rl = {
669
667
  total_amount: s,
670
668
  data: u,
671
669
  payment_split: d
672
- }, a = await Ct(v.token, v.envName).post(di, {
670
+ }, a = await Ct(v.token, v.envName).post(hi, {
673
671
  ...w
674
672
  }), { data: A } = a || {};
675
673
  return Promise.resolve(A);
@@ -704,7 +702,7 @@ const rl = {
704
702
  }, ns = async (s, u, d, n, v) => {
705
703
  try {
706
704
  const w = await Ct(v.token, v.envName).delete(
707
- `${pi}/${s}/${u}?org_branch_id=${v.window_var.org_branch_id_for_seg}&patient_role_id=${n}&order_id=${d}&deleting_person_role_id=${v.window_var.doctor_role_id_for_seg}&doctor_role_id=${v.window_var.doctor_role_id_for_seg}&doctor_id=${v.window_var.person_id_for_seg}`
705
+ `${xi}/${s}/${u}?org_branch_id=${v.window_var.org_branch_id_for_seg}&patient_role_id=${n}&order_id=${d}&deleting_person_role_id=${v.window_var.doctor_role_id_for_seg}&doctor_role_id=${v.window_var.doctor_role_id_for_seg}&doctor_id=${v.window_var.person_id_for_seg}`
708
706
  ), { data: a } = w || {};
709
707
  return Promise.resolve(a);
710
708
  } catch (w) {
@@ -717,7 +715,7 @@ const rl = {
717
715
  v = "fields=" + A + (S < d.length - 1 ? "&" : "");
718
716
  });
719
717
  const w = await Ct(n.token, n.envName).get(
720
- `${fi}/${s}?branch_id=${n.window_var.org_branch_id_for_seg}&patient_role_id=${u}&${v}`
718
+ `${mi}/${s}?branch_id=${n.window_var.org_branch_id_for_seg}&patient_role_id=${u}&${v}`
721
719
  ), { data: a } = w || {};
722
720
  return Promise.resolve(a);
723
721
  } catch (v) {
@@ -731,7 +729,7 @@ const rl = {
731
729
  };
732
730
  try {
733
731
  const v = await Ct(d.token, d.envName).post(
734
- Un,
732
+ Xn,
735
733
  n
736
734
  ), { data: w } = v || {};
737
735
  return Promise.resolve(w);
@@ -746,7 +744,7 @@ const rl = {
746
744
  };
747
745
  try {
748
746
  const n = await Ct(u.token, u.envName).post(
749
- xi,
747
+ yi,
750
748
  d
751
749
  ), { data: v } = n || {};
752
750
  return Promise.resolve(v);
@@ -763,7 +761,7 @@ const rl = {
763
761
  };
764
762
  try {
765
763
  const a = await Ct(v.token, v.envName).post(
766
- mi,
764
+ vi,
767
765
  w
768
766
  ), { data: A } = a || {};
769
767
  return Promise.resolve(A);
@@ -781,7 +779,7 @@ const rl = {
781
779
  };
782
780
  try {
783
781
  const n = await Ct(u.token, u.envName).post(
784
- gi,
782
+ _i,
785
783
  d
786
784
  ), { data: v } = n || {};
787
785
  return Promise.resolve(v);
@@ -791,7 +789,7 @@ const rl = {
791
789
  }, cs = async (s, u) => {
792
790
  try {
793
791
  const d = await Ct(u.token, u.envName).get(
794
- `${si}/${s}`
792
+ `${di}/${s}`
795
793
  ), { data: n } = d || {};
796
794
  return Promise.resolve(n);
797
795
  } catch (d) {
@@ -801,7 +799,7 @@ const rl = {
801
799
  try {
802
800
  const u = {
803
801
  doctor_id: s.window_var.person_id_for_seg
804
- }, d = await Ct(s.token, s.envName).post(Qn, { ...u }), { data: n, status: v } = d || {};
802
+ }, d = await Ct(s.token, s.envName).post(ri, { ...u }), { data: n, status: v } = d || {};
805
803
  if (v !== 200)
806
804
  throw new Error("error");
807
805
  return Promise.resolve(n);
@@ -814,7 +812,7 @@ const rl = {
814
812
  branch_id: u.window_var.org_branch_id_for_seg,
815
813
  doctor_id: u.window_var.person_id_for_seg,
816
814
  ...s
817
- }, n = await Ct(u.token, u.envName).post(ci, {
815
+ }, n = await Ct(u.token, u.envName).post(fi, {
818
816
  ...d
819
817
  });
820
818
  return Promise.resolve(n);
@@ -829,7 +827,7 @@ const rl = {
829
827
  doctor_role_id: s.window_var.doctor_role_id_for_seg,
830
828
  master_tests_needed: !1
831
829
  }, d = await Ct(s.token, s.envName).post(
832
- ei,
830
+ li,
833
831
  {
834
832
  ...u
835
833
  }
@@ -1350,7 +1348,7 @@ const In = (...s) => {
1350
1348
  }
1351
1349
  };
1352
1350
  const Q = () => {
1353
- v === "appointments" ? typeof window.redirectVPFromAppnt == "function" && window.redirectVPFromAppnt(n?.patientRoleID || "", n?.patientID || "") : v === "consultations" ? typeof window.redirectVPFromConsult == "function" && window.redirectVPFromConsult(n?.patientRoleID || "", n?.patientID || "") : v === "addpatient" || v === "frontDeskDashboard" ? window.location.href = `${window.origin}${Di.visitpad}?pid=${n?.patientRoleID}` : window.location.reload(), d(!1), w();
1351
+ v === "appointments" ? typeof window.redirectVPFromAppnt == "function" && window.redirectVPFromAppnt(n?.patientRoleID || "", n?.patientID || "") : v === "consultations" ? typeof window.redirectVPFromConsult == "function" && window.redirectVPFromConsult(n?.patientRoleID || "", n?.patientID || "") : v === "addpatient" || v === "frontDeskDashboard" ? window.location.href = `${window.origin}${zn.visitpad}?pid=${n?.patientRoleID}` : window.location.reload(), d(!1), w();
1354
1352
  };
1355
1353
  return /* @__PURE__ */ e.jsxs("div", { className: "hfl-flex hfl-h-[56px] hfl-shrink-0 hfl-items-center hfl-justify-between hfl-rounded-t-xl hfl-bg-Blue_gray-600 hfl-py-1 hfl-pl-[11px] hfl-pr-1.5", children: [
1356
1354
  /* @__PURE__ */ e.jsxs("div", { className: "hfl-flex hfl-items-center hfl-justify-center hfl-gap-[13px]", children: [
@@ -1799,7 +1797,7 @@ const In = (...s) => {
1799
1797
  };
1800
1798
  Ke(() => {
1801
1799
  if (!H) {
1802
- const G = zn(u.age, _t);
1800
+ const G = Yn(u.age, _t);
1803
1801
  G && d((_e) => ({
1804
1802
  ..._e,
1805
1803
  org_person_dob: G
@@ -1937,7 +1935,7 @@ const In = (...s) => {
1937
1935
  style: {
1938
1936
  boxShadow: "0px 24px 48px -12px rgba(16, 24, 40, 0.18)"
1939
1937
  },
1940
- children: Ai.map((G) => /* @__PURE__ */ e.jsx(
1938
+ children: qn.map((G) => /* @__PURE__ */ e.jsx(
1941
1939
  ll,
1942
1940
  {
1943
1941
  className: "hfl-text-Primary-700",
@@ -2346,7 +2344,7 @@ const In = (...s) => {
2346
2344
  suffixClassName: "hfl-w-[100px]",
2347
2345
  suffixDropdownClassName: "hfl-ml-[160px]",
2348
2346
  options: v,
2349
- suffixOptions: Ii,
2347
+ suffixOptions: $n,
2350
2348
  handleValChange: (G) => {
2351
2349
  yt("ref_doc_name", G);
2352
2350
  },
@@ -2766,7 +2764,7 @@ const In = (...s) => {
2766
2764
  }, J = async (oe) => {
2767
2765
  const Te = new FormData();
2768
2766
  Te.append("pid", oe);
2769
- const Se = await Si(Te, be);
2767
+ const Se = await Ai(Te, be);
2770
2768
  Se.apiError && z("Error", Se.apiError, "Error", 3e3);
2771
2769
  }, K = async (oe = it?.name ?? "", Te = it?.org_person_dob ?? "") => {
2772
2770
  if (!it || !q?.patientRoleID) {
@@ -11896,7 +11894,7 @@ const Qa = /* @__PURE__ */ xn(Os), en = (s) => {
11896
11894
  }), At.register({
11897
11895
  family: "Rupee",
11898
11896
  src: `${s}/fonts/IndianRupee.ttf`
11899
- }), /* @__PURE__ */ e.jsx(_i, { style: { display: "none" }, children: /* @__PURE__ */ e.jsx(yi, { children: /* @__PURE__ */ e.jsxs(bi, { children: [
11897
+ }), /* @__PURE__ */ e.jsx(wi, { style: { display: "none" }, children: /* @__PURE__ */ e.jsx(Ci, { children: /* @__PURE__ */ e.jsxs(ji, { children: [
11900
11898
  /* @__PURE__ */ e.jsx(It, { style: { fontFamily: "notoKannada" }, children: "load font" }),
11901
11899
  /* @__PURE__ */ e.jsx(It, { style: { fontFamily: "notoHindi" }, children: "load font" }),
11902
11900
  /* @__PURE__ */ e.jsx(It, { style: { fontFamily: "notoUrdu" }, children: "load font" }),
@@ -13467,7 +13465,7 @@ ${x}`,
13467
13465
  receiver_phone_numbers: q ? [q] : [],
13468
13466
  label: de?.label || "",
13469
13467
  patient_name: L
13470
- }, Me = await wi(Re, A), ke = H === "SMS/WA" ? "WhatsApp" : H;
13468
+ }, Me = await Ri(Re, A), ke = H === "SMS/WA" ? "WhatsApp" : H;
13471
13469
  Me || w("", ke + " failed to sent", "Error", 3e3), w("", ke + " sent successfully", "Success", 3e3);
13472
13470
  }, $ = (de) => de ? `${de}#toolbar=0&navpanes=0` : `data:text/html;charset=utf-8,${encodeURIComponent(`
13473
13471
  <html>
@@ -13853,7 +13851,7 @@ ${x}`,
13853
13851
  rids: L
13854
13852
  };
13855
13853
  try {
13856
- const $ = await Ci(ne, a);
13854
+ const $ = await Pi(ne, a);
13857
13855
  if ($ && $?.pdf) {
13858
13856
  ie($.pdf);
13859
13857
  const H = await (await fetch($.pdf)).blob(), Re = URL.createObjectURL(H);
@@ -13888,7 +13886,7 @@ ${x}`,
13888
13886
  },
13889
13887
  triggerCode: Le === "WA" ? "EHR-LAB-REPORT-WHATSAPP" : "EHR-LAB-REPORT-EMAIL"
13890
13888
  };
13891
- if (await ji(ne, a))
13889
+ if (await Si(ne, a))
13892
13890
  w("", `${Le === "Email" ? "Email" : "WhatsApp"} Sent Successfully`, "Success", 1e3, "topRight");
13893
13891
  else
13894
13892
  throw new Error("Error while uploading the file");
@@ -14260,7 +14258,7 @@ ${x}`,
14260
14258
  ] })
14261
14259
  ] }) : /* @__PURE__ */ e.jsx("div", { className: "hfl-flex hfl-h-full hfl-items-center hfl-justify-center", children: /* @__PURE__ */ e.jsx(D, { variant: "Regular", type: "Text lg", className: "hfl-text-Gray-500", children: "Lab is not active." }) }) }) }) });
14262
14260
  };
14263
- function No({ variable: s }) {
14261
+ function Po({ variable: s }) {
14264
14262
  const { window_var: u, token: d, envName: n, IMGREP_DIRECTORY: v } = s, w = qa("(max-width: 1080px)"), a = Mr(null), [A, S] = Y(!1), [h, O] = Y(!1), [x, L] = Y([]), [k, W] = Y(Rt[2]), [I, N] = Y(), [P, B] = Y(), [b, Q] = Y(), [F, M] = Y(), [V, te] = Y(), [q, ie] = Y(), [z, ge] = Y({
14265
14263
  printDataFrom: "",
14266
14264
  visible: !1,
@@ -14339,7 +14337,7 @@ function No({ variable: s }) {
14339
14337
  Cr();
14340
14338
  }, [St, le, Cr]);
14341
14339
  const mr = async (ct, bt, dt, Nt = !0) => {
14342
- const { unmodifiedVisitPadJson: Yt, printPrefMasterArr: Wt } = ct, qt = Yt && Yn(Yt) ? JSON.parse(Yt) : {}, Ut = Wt?.[bt] || {
14340
+ const { unmodifiedVisitPadJson: Yt, printPrefMasterArr: Wt } = ct, qt = Yt && Un(Yt) ? JSON.parse(Yt) : {}, Ut = Wt?.[bt] || {
14343
14341
  config: {}
14344
14342
  }, Ht = Ut?.config || {}, _e = {
14345
14343
  ...qt,
@@ -14368,7 +14366,7 @@ function No({ variable: s }) {
14368
14366
  else
14369
14367
  return $t;
14370
14368
  }, _r = async (ct = { doc_id: "", doc_rid: "" }) => {
14371
- const bt = await Ni(
14369
+ const bt = await Ii(
14372
14370
  ct,
14373
14371
  { token: d, envName: n },
14374
14372
  u.org_branch_id_for_seg || "",
@@ -14608,7 +14606,7 @@ function No({ variable: s }) {
14608
14606
  }
14609
14607
  ),
14610
14608
  z?.visible && /* @__PURE__ */ e.jsx(
14611
- Ri,
14609
+ Ni,
14612
14610
  {
14613
14611
  modalProps: {
14614
14612
  mfePrefix: "hfl",
@@ -14688,5 +14686,5 @@ function No({ variable: s }) {
14688
14686
  ) });
14689
14687
  }
14690
14688
  export {
14691
- No as P
14689
+ Po as P
14692
14690
  };
@@ -1,4 +1,4 @@
1
- import { P as f } from "../PediatricsCalculatorTable-G0ttbDpi.js";
1
+ import { P as f } from "../PediatricsCalculatorTable-qu37FR7D.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -0,0 +1,9 @@
1
+ "use strict";const e=require("./index-CJ2AKRoq.cjs"),r=require("react"),A=require("./constants/PediatricsCalculatorConstants/index.js"),Me=require("./useOutsideClick-CicUjzPP.cjs"),_e=require("./index-CRCsQdYf.cjs"),we=r.createContext(null),Ee=()=>{const l=r.useContext(we);if(!l)throw new Error("usePediatricsCalculatorTableContext must be used inside a MedicineTableProvider");return l},Se=({effectiveEditMode:l,rowData:s,isSavedToLibrary:p,onSave:b,onCancel:g,onEdit:v,onCheckboxToggle:a})=>{const{variant:C,externallyTriggeredEditMode:w,setRowToDelete:_,openPopupForRow:k}=Ee();return C==="standard"?l?e.jsxRuntimeExports.jsxs("div",{className:"hfl-grid hfl-grid-cols-[1fr_1fr] hfl-border-1 hfl-border-Gray-200 hfl-rounded-lg ",children:[e.jsxRuntimeExports.jsx("button",{className:"hfl-px-3 hfl-py-1 hfl-text-Blue_gray-800 hfl-border-r-1 hover:hfl-bg-Primary-50",onClick:b,children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Medium",type:"Text xs",className:"hfl-text-Blue_gray-800",children:"Save"})}),e.jsxRuntimeExports.jsx("button",{className:"hfl-px-3 hfl-py-2 hfl-text-Error-600 hover:hfl-bg-Error-50",onClick:g,children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Medium",type:"Text xs",className:"",children:"Cancel"})})]}):e.jsxRuntimeExports.jsxs("div",{className:"hfl-grid hfl-grid-cols-[1fr_1fr_1fr] hfl-border-1 hfl-border-Gray-200 hfl-rounded-lg",children:[e.jsxRuntimeExports.jsx("button",{className:"hfl-px-3 hfl-py-1 hfl-text-Blue_gray-800 hover:hfl-bg-Primary-50",onClick:v,children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Medium",type:"Text xs",className:"",children:"Edit"})}),e.jsxRuntimeExports.jsx("button",{className:"hfl-px-3 hfl-py-2 hfl-text-Blue_gray-800 hfl-border-x-1 hover:hfl-bg-Primary-50",onClick:()=>k?.(s),children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Medium",type:"Text xs",className:"",children:"Copy"})}),e.jsxRuntimeExports.jsx("button",{className:"hx_delete hfl-px-3 hfl-py-2 hfl-text-Error-500 hover:hfl-bg-Error-50",onClick:()=>_?.(s.rowId)})]}):e.jsxRuntimeExports.jsx(e.Os,{disabled:!w,text:"Save this to Pediatric Calculator Library ",id:s.rowId,size:"md",onClick:a,isMarked:p??!1,checkboxClasses:"hfl-mt-2",checkBoxInnerDivClasses:"hfl-text-Blue-600 hfl-bg-Blue-50"},s.rowId)},Te=(l,s)=>{r.useEffect(()=>{const p=b=>{l.current&&!l.current.contains(b.target)&&s()};return document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}},[l,s])};function De(l){const{options:s,selectedOption:p,onChangeHandler:b}=l;return e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-gap-2 hfl-h-full hfl-items-center hfl-px-4 hfl-justify-center hfl-py-1",children:s?.map(g=>e.jsxRuntimeExports.jsx("div",{className:"hfl-bg-White hfl-rounded-lg",children:e.jsxRuntimeExports.jsx(e.Ku,{onClick:()=>b&&b(g),hierarchy:p?.label===g.label?"Primary":"Secondary-Grey",size:"sm",textField:g.label,className:p?.label===g.label?"hfl-bg-Blue-600":""})},g.label))})}const Fe="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";function T(l){const{label:s,labelClassName:p,hideDropdownIcon:b,showClearOption:g,isRequiredField:v,btnClassName:a,placeholder:C,options:w,selectedOption:_,onChangeHandler:k,inputValue:y,inputChangeHandler:L,onInputFocusOutEvent:B,inputClassName:i,isSearchable:m,inputType:$,showInput:M,inputSuffix:S,selectedLabel:U,suffixPadding:W,disableInputAutoSize:o,selectedOptions:j,isMulti:f,dropDownItemClickHandler:x,showToggle:q,toggleChangeHandler:D,selectedToggleOption:c,toggleOptionsList:n,border:N,height:E,disabled:I,fieldColor:H,errorMsg:t,showErrorMsg:d,placeholderStyle:u,onInputKeyDown:F,showEmptyDropdownPopup:z=!0,isDropdownFixed:G=!1,dropdownClassName:ie="",wrapperClass:re="",maxInputLength:ae,alternateListBgStyle:ee,showLabelTooltip:R=!1,labelToolTipContent:K="",inputContainerClasses:X="",onInputFocus:Q}=l,[Z,te]=r.useState(!1),[se,Re]=r.useState(null),oe=r.useRef(null),ce=r.useRef(null),pe=r.useRef(null),ue=r.useRef([]),Ce=r.useMemo(()=>w?.filter(h=>h?h.label.toLowerCase().includes((y??"").toLowerCase()):void 0),[y,w]),[ve,de]=r.useState(!1),Ne=()=>{te(!1),f&&L&&L(""),Re(null)},me=r.useCallback(h=>{h.stopPropagation(),I||te(O=>!O)},[I]),ge=(y?.length||0)+2+Number(W||0);Me.useOutsideClick(oe,Ne),r.useEffect(()=>{se!==null&&ue.current[se]&&ue.current[se].scrollIntoView({block:"nearest"})},[se]);const le=r.useCallback(()=>{if(G&&Z){const h=M?ce.current:pe.current,O=oe.current;if(h&&O){const J=h.getBoundingClientRect();O.style.position="fixed",O.style.top=`${window.scrollY?J.bottom+window.scrollY:J.bottom}px`,O.style.left=`${J.left}px`,O.style.width=`${J.width}px`}}},[G,Z,M]);r.useEffect(()=>{if(G)return Z?(le(),window.addEventListener("scroll",le,!0)):window.removeEventListener("scroll",le,!0),()=>{window.removeEventListener("scroll",le,!0)}},[G,le,Z]),Te(oe,()=>{ve&&B&&B()});const je=h=>{if(f&&x){const O=j?.some(J=>J.value===h.value);x(!!O,h)}},Ie=r.useCallback(async h=>{h.stopPropagation(),Z||te(!0),Q&&await Q()},[Q,Z]);return e.jsxRuntimeExports.jsxs("div",{className:`hfl-relative hfl-inline-block hfl-text-left ${re||""}`,children:[!!s&&e.jsxRuntimeExports.jsxs("div",{className:"hfl-text-Gray-700 hfl-mb-1 hfl-flex",children:[e.jsxRuntimeExports.jsx(e.bs,{type:"Text sm",variant:"Medium",className:p||"",children:`${s}`}),v&&e.jsxRuntimeExports.jsx("span",{className:"hfl-ml-1 hfl-text-Error-600",children:"*"}),R&&e.jsxRuntimeExports.jsx(e.Nu,{variant:"Right",text:K,theme:"dark",children:e.jsxRuntimeExports.jsx("i",{className:"hx_info-filled"})})]}),M?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:`hfl-flex hfl-items-center hfl-shadow-xs hfl-px-2 ${X||""} ${N||"hfl-border-1"} hfl-rounded-lg hfl-overflow-x-auto ${t?"hfl-border-Error-300":"hfl-border-Gray-300"} ${E||"hfl-h-10"} ${I?"!hfl-bg-Gray-50 !hfl-pointer-events-none":H||"hfl-bg-White"} hover:hfl-border-Primary-300 hover:hfl-shadow-xs-primary`,onClick:I?()=>{}:me,children:[j?.map((h,O)=>e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-center hfl-bg-Blue-100 hfl-mr-2 hfl-py-1 hfl-px-2 hfl-rounded-sm hfl-font-inter-0 hfl-text-nowrap",children:[e.jsxRuntimeExports.jsx("span",{className:"hfl-pointer-events-none",children:h.label}),e.jsxRuntimeExports.jsx("span",{onClick:J=>{J.stopPropagation(),je(h)},className:"hx_close hfl-text-Gray-500 hfl-my-0 hfl-text-[14px] hfl-ml-[1px] hfl-cursor-pointer"})]},`${h.label}-${O}`)),Object.keys(u||{}).length>0&&e.jsxRuntimeExports.jsx("style",{children:`
2
+ input.input-placeholder::placeholder {
3
+ font-family: ${u?.fontFamily};
4
+ font-weight: ${u?.fontWeight};
5
+ line-height: ${u?.lineHeight};
6
+ font-size: ${u?.fontSize};
7
+ color: ${u?.color};
8
+ }
9
+ `}),e.jsxRuntimeExports.jsx("input",{ref:ce,style:o?{}:{width:`${Number(y?.length)>4?(y?.length||0)+5:12}ch`},type:$,placeholder:C,value:y,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 ${I?"!hfl-bg-Gray-50 !hfl-cursor-not-allowed":H||"hfl-bg-White"} ${i||""}`,onChange:h=>{L&&L(h.target.value),de(!0)},onClick:Ie,onKeyDown:h=>F&&F(h,te,ce),maxLength:ae??ae,...l.inputProps||{}}),!b&&!g&&e.jsxRuntimeExports.jsx("i",{className:"hx_down hfl-mx-2"}),g&&e.jsxRuntimeExports.jsx("i",{className:`${y?"hx_close hfl-cursor-pointer":"hx_down"} hfl-mx-2`,onClick:()=>{(_?.value||y)&&(L&&L(""),de(!0))}}),S?e.jsxRuntimeExports.jsx("span",{style:{left:`${ge<2?"3":ge}ch`},className:"hfl-absolute hfl-top-1/2 hfl--translate-y-1/2 hfl-pointer-events-none",children:S}):null]}),d&&e.jsxRuntimeExports.jsx("span",{className:"hfl-text-0 hfl-text-Error-600",children:t})]}):e.jsxRuntimeExports.jsxs("button",{ref:pe,onClick:me,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 ${a||""} ${N||"hfl-border-1"} ${t?"hfl-border-Error-300":"hfl-border-Gray-300"} ${E||"hfl-h-[40px]"} ${I?"!hfl-bg-Gray-50 !hfl-cursor-not-allowed":""}`,style:U||_?.label?{}:u?{fontFamily:u?.fontFamily,fontSize:u?.fontSize,fontWeight:u?.fontWeight,lineHeight:u?.lineHeight,color:u?.color}:{},children:[e.jsxRuntimeExports.jsx("span",{className:"hfl-pr-4",children:U||_?.label||C||"Select an option"}),e.jsxRuntimeExports.jsx("img",{src:Fe,alt:"down arrow"})]}),w&&w?.length>=0&&e.jsxRuntimeExports.jsxs("ul",{ref:oe,className:`custom-dropdown-menu ${Z?"hfl-visible":"hfl-invisible"} hfl-absolute hfl-z-50 hfl-grid hfl-gap-1 hfl-mt-3 hfl-w-full hfl-rounded-lg hfl-shadow-lg hfl-bg-White hfl-font-inter-0 hfl-p-1 hfl-px-2 ${f?"hfl-min-w-[20em]":"hfl-min-w-[16em]"} hfl-max-h-[330px] hfl-overflow-y-scroll ${ie}`,role:"menu","aria-orientation":"vertical","aria-labelledby":"options-menu",children:[q?e.jsxRuntimeExports.jsx(De,{onChangeHandler:D,selectedOption:c,options:n}):!1,(m?Ce:w)?.map((h,O)=>{const J=f?!!j?.some(fe=>fe.value===h?.value):!1,be=_?.value===h?.value,ke=se===O;return h?e.jsxRuntimeExports.jsx("li",{onClick:()=>{f?je(h):(k&&k(h),te(!1),de(!1))},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 ${ee?"odd:hfl-bg-Gray-100":""} ${be?"hfl-bg-Blue-50 hfl-text-Blue-500":""}`,role:"menuitem","aria-selected":be,tabIndex:ke?0:-1,ref:fe=>{ue.current[O]=fe},children:f?e.jsxRuntimeExports.jsx(e.Os,{size:"sm",disabled:!1,text:e.jsxRuntimeExports.jsx("span",{children:h.label}),secondaryText:"",id:`${h.label}-${O}`,isMarked:J}):h.label},`${h.label}-${O}`):null}),w?.length===0&&z&&e.jsxRuntimeExports.jsx("li",{className:"hfl-block hfl-px-4 hfl-py-2 hfl-rounded-md hover:hfl-bg-Blue-50 hfl-cursor-pointer custom_dropdown_item",children:"No items found, please change the search criteria"})]})]})}var he,ye;function Oe(){if(ye)return he;ye=1;var l="Expected a function",s=NaN,p="[object Symbol]",b=/^\s+|\s+$/g,g=/^[-+]0x[0-9a-f]+$/i,v=/^0b[01]+$/i,a=/^0o[0-7]+$/i,C=parseInt,w=typeof e.commonjsGlobal=="object"&&e.commonjsGlobal&&e.commonjsGlobal.Object===Object&&e.commonjsGlobal,_=typeof self=="object"&&self&&self.Object===Object&&self,k=w||_||Function("return this")(),y=Object.prototype,L=y.toString,B=Math.max,i=Math.min,m=function(){return k.Date.now()};function $(o,j,f){var x,q,D,c,n,N,E=0,I=!1,H=!1,t=!0;if(typeof o!="function")throw new TypeError(l);j=W(j)||0,M(f)&&(I=!!f.leading,H="maxWait"in f,D=H?B(W(f.maxWait)||0,j):D,t="trailing"in f?!!f.trailing:t);function d(R){var K=x,X=q;return x=q=void 0,E=R,c=o.apply(X,K),c}function u(R){return E=R,n=setTimeout(G,j),I?d(R):c}function F(R){var K=R-N,X=R-E,Q=j-K;return H?i(Q,D-X):Q}function z(R){var K=R-N,X=R-E;return N===void 0||K>=j||K<0||H&&X>=D}function G(){var R=m();if(z(R))return ie(R);n=setTimeout(G,F(R))}function ie(R){return n=void 0,t&&x?d(R):(x=q=void 0,c)}function re(){n!==void 0&&clearTimeout(n),E=0,x=N=q=n=void 0}function ae(){return n===void 0?c:ie(m())}function ee(){var R=m(),K=z(R);if(x=arguments,q=this,N=R,K){if(n===void 0)return u(N);if(H)return n=setTimeout(G,j),d(N)}return n===void 0&&(n=setTimeout(G,j)),c}return ee.cancel=re,ee.flush=ae,ee}function M(o){var j=typeof o;return!!o&&(j=="object"||j=="function")}function S(o){return!!o&&typeof o=="object"}function U(o){return typeof o=="symbol"||S(o)&&L.call(o)==p}function W(o){if(typeof o=="number")return o;if(U(o))return s;if(M(o)){var j=typeof o.valueOf=="function"?o.valueOf():o;o=M(j)?j+"":j}if(typeof o!="string")return o===0?o:+o;o=o.replace(b,"");var f=v.test(o);return f||a.test(o)?C(o.slice(2),f?2:8):g.test(o)?s:+o}return he=$,he}var Le=Oe();const Be=e.getDefaultExportFromCjs(Le),xe=(l,s)=>{const p=parseFloat(l),b=parseFloat(s);if(!l||!s||isNaN(p)||isNaN(b)||b===0)return"";const g=p/b;return Number.isInteger(g)?g.toString(10):g.toFixed(3).replace(/\.?0+$/,"")},Y=l=>/^(\d+)?(\.)?(\d*)?$/.test(l),V=({label:l,children:s})=>e.jsxRuntimeExports.jsxs(e.bs,{variant:"Regular",type:"Text sm",className:"hfl-grid hfl-grid-cols-2 hfl-items-center hfl-text-Blue_gray-800 hfl-justify-between hfl-gap-8",children:[e.jsxRuntimeExports.jsxs("span",{className:"hfl-flex-shrink-0",children:[l,":"]}),e.jsxRuntimeExports.jsx("div",{className:"hfl-flex-1 hfl-min-w-0",children:s})]}),P=({label:l,value:s})=>e.jsxRuntimeExports.jsxs(e.bs,{variant:"Regular",type:"Text sm",className:"hfl-flex hfl-text-Blue_gray-800 hfl-gap-1",children:[e.jsxRuntimeExports.jsxs("span",{className:"hfl-flex-shrink-0",children:[l,":"]}),e.jsxRuntimeExports.jsx(e.bs,{variant:"Bold",type:"Text sm",className:"hfl-text-Blue_gray-800 hfl-break-words hfl-min-w-0",children:s||"--"})]}),ne=({children:l,className:s=""})=>e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text sm",className:`hfl-text-Blue_gray-800 hfl-px-2 hfl-break-words hfl-overflow-wrap-anywhere hfl-min-w-0 ${s}`,children:l}),$e=r.memo(function({rowData:s,isEditing:p,setIsEditing:b,onSaveRow:g,allowCustomMedicineInput:v}){const{variant:a,externallyTriggeredEditMode:C,externallyTriggeredEditRowIds:w,getMedicineOptions:_,onRowChange:k,onRowDelete:y}=Ee(),[L,B]=r.useState([]),[i,m]=r.useState(s),[$,M]=r.useState(s.medicine_name);r.useEffect(()=>{p||M(s.medicine_name)},[s.medicine_name,p]),r.useEffect(()=>{p||m(s)},[s,p]);const S=async t=>(await _?.(t))?.map(u=>({label:u.doctorMedicineName,value:u}))||[],W=C||w?.includes(s.rowId)||p,o=r.useMemo(()=>i.out_of_range||s.out_of_range,[i.out_of_range,s.out_of_range]),j=r.useMemo(()=>i?.isDosageMismatch||s?.isDosageMismatch,[i?.isDosageMismatch,s?.isDosageMismatch]),f=r.useMemo(()=>i.calculation_type===A.C_MedicineCalculatorList[0]?i.calculation_fields:null,[i.calculation_fields,i.calculation_type]),x=r.useMemo(()=>i.calculation_type===A.C_MedicineCalculatorList[1]?i.calculation_fields:null,[i.calculation_fields,i.calculation_type]),q=(t,d)=>{let u;if(t==="calculation_type"){const F=d,z={frequency:i.calculation_fields.frequency,pedia_dosage:a==="standard"?i.calculation_fields.pedia_dosage:i.pedia_dosage};u={...i,calculation_type:F,calculation_fields:F==="mg/kg/dose"?{...A.C_DefaultMgKgFields,...z}:{...A.C_DefaultMlKgFields,...z}}}else u={...i,[t]:d};m(u),a==="prescription"&&D(u,t)},D=r.useMemo(()=>Be((t,d)=>{k?.(t,d||void 0)},500),[k]),c=r.useMemo(()=>e.jsxRuntimeExports.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:[e.jsxRuntimeExports.jsx("div",{className:"hx_warning hfl-text-Error-400"}),e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text sm",className:"hfl-px-2 hfl-text-1 hfl-text-Error-500",children:"Dosage exceed safety limits"})]}),[]);r.useEffect(()=>()=>{D.cancel()},[D]);const n=r.useCallback((t,d)=>{m(u=>{let F={...u.calculation_fields,[t]:d};if(t==="frequency"&&a==="standard"){const G=A.C_FrequencyDosageMap[d]||[];G.length>0&&(F={...F,pedia_dosage:G[0]})}const z={...u,calculation_fields:F};return a==="prescription"&&D(z,t),z})},[D,a]),N=async()=>{const t={...i,calculation_fields:{...i.calculation_fields}};await g?.(t)&&D({...t,isNewlyAdded:!1,isEditing:!1})},E=async()=>{if(!s.medicine_name||s.medicine_name.trim()===""){y?.(s.rowId);return}m(s),a==="standard"&&b(!1)},I=t=>a==="prescription"&&(t==="medicine_name"||t==="generic_name"||t==="type"||t==="calculation_type")?!1:W,H=()=>{const t=!(i?.isSavedToLibrary??!1),d={...i,isSavedToLibrary:t};m(d),D(d,"isSavedToLibrary")};return e.jsxRuntimeExports.jsxs("div",{className:`medicine-row hfl-grid hfl-grid-cols-[1.36fr_1.36fr_1.02fr_1.25fr_2.27fr_1.36fr_1.36fr] hfl-gap-2 hfl-px-2 hfl-py-1 hfl-border-b-1 hfl-border-Gray-200 ${W?"hfl-bg-gradient-to-b hfl-from-White_20 hfl-to-Primary-50":""} ${a==="prescription"&&!i.pedia_data_available?"hfl-hidden":""}`,children:[e.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:I("medicine_name")?e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",btnClassName:"hfl-w-full",inputClassName:"hfl-w-full",inputValue:i.medicine_name,showInput:!0,disableInputAutoSize:!0,inputChangeHandler:async t=>{if(q("medicine_name",t),t.trim()){const d=await S(t);B(d)}else B([])},onInputFocus:async()=>{const t=await S(i.medicine_name);B(t)},onChangeHandler:t=>{const d=t.value,u=A.C_MedicineTypeList.find(F=>F.val===d.medicineType);m(F=>({...F,medicine_name:d.doctorMedicineName,medicine_id:d.medicineId,generic_name:d.doctorGenericName,type:u?.type??""})),M(d.doctorMedicineName)},options:L,isSearchable:!0,placeholder:"Search medicine",disabled:!i?.isNewlyAdded,inputProps:{onBlur:t=>{const d=t.relatedTarget;if(!(d&&d.closest(".custom-dropdown-menu"))&&!v){const u=i.medicine_name?.trim()||"";L.some(z=>z.label===u)||m(z=>({...z,medicine_name:$}))}}}}):e.jsxRuntimeExports.jsx(ne,{children:s.medicine_name})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:I("generic_name")?e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",inputClassName:"hfl-w-full",btnClassName:"hfl-w-full",inputValue:i.generic_name,showInput:!0,disableInputAutoSize:!0,inputChangeHandler:t=>q("generic_name",t),hideDropdownIcon:!0}):e.jsxRuntimeExports.jsx(ne,{children:s.generic_name})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:I("type")?e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",btnClassName:"hfl-w-full",placeholder:"Select",showInput:!1,disableInputAutoSize:!0,selectedOption:(()=>{const t=A.C_MedicineTypeList.find(d=>d.type===i.type);return t?{label:t.type,value:t.type}:void 0})(),options:A.C_MedicineTypeList.map(t=>({label:t.type,value:t.type})),onChangeHandler:t=>q("type",t.value)}):e.jsxRuntimeExports.jsx(ne,{children:s.type||""})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:I("calculation_type")?e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",btnClassName:"hfl-w-full",placeholder:"Select",showInput:!1,disableInputAutoSize:!0,selectedOption:{label:i.calculation_type,value:i.calculation_type},options:A.C_MedicineCalculatorList.map(t=>({label:t,value:t})),onChangeHandler:t=>q("calculation_type",t.value)}):e.jsxRuntimeExports.jsx(ne,{children:s.calculation_type})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-w-full hfl-flex-col hfl-gap-2 hfl-py-2.5 hfl-px-2",children:I("calculation_fields")?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[f&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(V,{label:"Drug Strength",children:e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",placeholder:"e.g., 250",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:f.drug_strength||"",inputChangeHandler:t=>{Y(t)&&n("drug_strength",t)}})}),e.jsxRuntimeExports.jsx(V,{label:"Dose/mg/kg",children:e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",placeholder:"e.g., 15",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:f.dose_mg_kg||"",inputChangeHandler:t=>{Y(t)&&n("dose_mg_kg",t)}})}),e.jsxRuntimeExports.jsx(V,{label:"Frequency",children:e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",placeholder:"Frequency",showInput:!1,selectedOption:i.calculation_fields.frequency?{label:i.calculation_fields.frequency,value:i.calculation_fields.frequency}:void 0,options:A.C_MedicineFrequencyList.map(t=>({label:t,value:t})),onChangeHandler:t=>{n("frequency",t.value)}})}),e.jsxRuntimeExports.jsx(V,{label:"Max Dose (mg)",children:e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",placeholder:"Max mg/dose",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:f.max_mg_dose||"",inputChangeHandler:t=>{Y(t)&&n("max_mg_dose",t)}})}),e.jsxRuntimeExports.jsx(V,{label:"Max Day (mg)",children:e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",placeholder:"Max mg/day",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:f.max_mg_day||"",inputChangeHandler:t=>{Y(t)&&n("max_mg_day",t)}})})]}),x&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(V,{label:"Drug Strength/mL",children:e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",placeholder:"e.g., 250",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:x.drug_strength||"",inputChangeHandler:t=>{Y(t)&&(n("drug_strength",t),n("dose_ml_kg",xe(x.dose_mg_kg,t)))}})}),e.jsxRuntimeExports.jsx(V,{label:"Dose/mg/kg",children:e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",placeholder:"e.g., 15",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:x.dose_mg_kg||"",inputChangeHandler:t=>{Y(t)&&(n("dose_mg_kg",t),n("dose_ml_kg",xe(t,x.drug_strength)))}})}),e.jsxRuntimeExports.jsx(V,{label:"Dose/mL/kg",children:e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",disabled:!0,placeholder:"e.g., 5",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:xe(x.dose_mg_kg,x.drug_strength)||"",inputChangeHandler:t=>{Y(t)&&n("dose_ml_kg",t)}})}),e.jsxRuntimeExports.jsx(V,{label:"Frequency",children:e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",placeholder:"Frequency",showInput:!1,selectedOption:i.calculation_fields.frequency?{label:i.calculation_fields.frequency,value:i.calculation_fields.frequency}:void 0,options:A.C_MedicineFrequencyList.map(t=>({label:t,value:t})),onChangeHandler:t=>{n("frequency",t.value)}})}),e.jsxRuntimeExports.jsx(V,{label:"Max Dose (mL)",children:e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",placeholder:"Max mL/dose",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:x.max_ml_dose||"",inputChangeHandler:t=>{Y(t)&&n("max_ml_dose",t)}})}),e.jsxRuntimeExports.jsx(V,{label:"Max Day (mL)",children:e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",placeholder:"Max mL/day",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:x.max_ml_day||"",inputChangeHandler:t=>{Y(t)&&n("max_ml_day",t)}})})]})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[f&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(P,{label:"Drug Strength",value:f.drug_strength}),e.jsxRuntimeExports.jsx(P,{label:"Dose/mg/kg",value:f.dose_mg_kg}),e.jsxRuntimeExports.jsx(P,{label:"Frequency",value:f.frequency}),e.jsxRuntimeExports.jsx(P,{label:"Max Dose (mg)",value:f.max_mg_dose}),e.jsxRuntimeExports.jsx(P,{label:"Max Day (mg)",value:f.max_mg_day})]}),x&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(P,{label:"Drug Strength/mL",value:x.drug_strength}),e.jsxRuntimeExports.jsx(P,{label:"Dose/mg/kg",value:x.dose_mg_kg}),e.jsxRuntimeExports.jsx(P,{label:"Dose/mL/kg",value:x.dose_ml_kg}),e.jsxRuntimeExports.jsx(P,{label:"Frequency",value:x.frequency}),e.jsxRuntimeExports.jsx(P,{label:"Max Dose (mL)",value:x.max_ml_dose}),e.jsxRuntimeExports.jsx(P,{label:"Max Day (mL)",value:x.max_ml_day})]})]})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:I("pedia_dosage")?(()=>{const t=i.calculation_fields.frequency,d=A.C_FrequencyDosageMap[t]||[];return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",btnClassName:"hfl-w-full",inputClassName:"hfl-w-full",placeholder:"Select",showInput:a!=="standard",disableInputAutoSize:!0,inputValue:a==="standard"?i.calculation_fields.pedia_dosage:i.pedia_dosage,inputChangeHandler:u=>a==="prescription"?q("pedia_dosage",u):n("pedia_dosage",u),selectedOption:a==="standard"?{label:i.calculation_fields.pedia_dosage,value:i.calculation_fields.pedia_dosage}:void 0,options:a!=="prescription"?d.map(u=>({label:u,value:u})):void 0,onChangeHandler:a!=="prescription"?u=>n("pedia_dosage",u.value):void 0,hideDropdownIcon:a==="prescription",showEmptyDropdownPopup:a!=="prescription",showErrorMsg:a==="prescription"?o||j:!1,errorMsg:a==="prescription"&&o?"Dosage Exceeds Safety Limits":a==="prescription"&&j?"Dosage is in mismatch with selected type of Frequency":""})})})():e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-col hfl-h-full hfl-justify-between hfl-min-w-0",children:[e.jsxRuntimeExports.jsx(ne,{children:a==="prescription"?s.pedia_dosage:s.calculation_fields.pedia_dosage}),o&&c]})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:e.jsxRuntimeExports.jsx(Se,{effectiveEditMode:W,rowData:s,isSavedToLibrary:i.isSavedToLibrary??!1,onSave:N,onCancel:E,onEdit:()=>b(!0),onCheckboxToggle:H})})]})},(l,s)=>l.isEditing===s.isEditing&&l.rowData.rowId===s.rowData.rowId&&l.rowData.isEditing===s.rowData.isEditing&&l.rowData.medicine_name===s.rowData.medicine_name&&l.rowData.generic_name===s.rowData.generic_name&&l.rowData.type===s.rowData.type&&l.rowData.pedia_dosage===s.rowData.pedia_dosage&&l.rowData.calculation_type===s.rowData.calculation_type&&JSON.stringify(l.rowData.calculation_fields)===JSON.stringify(s.rowData.calculation_fields)&&l.rowData.out_of_range===s.rowData.out_of_range&&l.rowData.isDosageMismatch===s.rowData.isDosageMismatch&&l.rowData.calculation_fields.pedia_dosage===s.rowData.calculation_fields.pedia_dosage&&l.rowData?.isNewlyAdded===s.rowData?.isNewlyAdded&&l.rowData?.pedia_data_available===s.rowData?.pedia_data_available),qe=l=>{const{openState:s,closePopupCallback:p,headingIconFile:b,headingText:g,subHeadingText:v,positiveButtonText:a,negativeButtonText:C,classNamePositiveBtn:w,classNameNegativeBtn:_,positiveActionCallback:k,negativeActionCallback:y}=l;return e.jsxRuntimeExports.jsxs(_e.Modal,{isOpen:s,onRequestClose:p,shouldCloseOnOverlayClick:!1,style:{overlay:{backgroundColor:"rgba(52, 64, 84, 0.5)",position:"fixed",alignContent:"center",justifyContent:"center",zIndex:1030,display:s?"block":"none"},content:{zIndex:1030,padding:"24px",maxWidth:"750px",maxHeight:"600px",width:"400px",height:"fit-content",margin:"auto",borderRadius:"12px",overflow:"unset",display:s?"block":"none"}},children:[b=="warning"&&e.jsxRuntimeExports.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:e.jsxRuntimeExports.jsx("i",{className:"hx_warning hfl-text-5"})}),e.jsxRuntimeExports.jsx(e.bs,{variant:"Medium",type:"Text xl",className:"hfl-mt-5 hfl-text-Gray-900",children:g}),v&&e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text sm",className:"hfl-mt-1 hfl-text-Gray-500 ",children:v}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-mt-4 hfl-flex hfl-items-center hfl-justify-center hfl-gap-4",children:[C&&e.jsxRuntimeExports.jsx(e.Ku,{size:"md",textField:C,hierarchy:"Primary",className:_||"",onClick:y,"data-qa":"negative-action"}),a&&e.jsxRuntimeExports.jsx(e.Ku,{size:"md",textField:a,hierarchy:"Secondary",className:w||"",onClick:k,"data-qa":"positive-action"})]})]})},He=({open:l,onCancel:s,onCopySave:p,rowMedicineData:b,getMedicineOptions:g})=>{const[v,a]=r.useState([]),[C,w]=r.useState(""),[_,k]=r.useState([]),y=r.useCallback(async m=>{const M=(await g?.(m))?.map(S=>({label:S.doctorMedicineName,value:S}));k(M||[])},[g]);r.useEffect(()=>{l&&y(C)},[C,y,l]);const L=m=>{const $=m.value;v.some(S=>S.medicineId===$.medicineId&&S.doctorMedicineName.trim().toLowerCase()===$.doctorMedicineName.trim().toLowerCase())||a(S=>[...S,$]),w(""),k([])},B=m=>{a($=>$.filter(M=>M.medicineId!==m))},i=async()=>{C.trim()||await y("")};return e.jsxRuntimeExports.jsxs(_e.Modal,{isOpen:l,onRequestClose:s,shouldCloseOnOverlayClick:!1,style:{overlay:{backgroundColor:"rgba(52, 64, 84, 0.5)",zIndex:1030},content:{zIndex:1031,maxWidth:"600px",maxHeight:"50vh",height:"auto",margin:"auto",borderRadius:"12px",padding:"0px",display:"flex",flexDirection:"column"}},children:[e.jsxRuntimeExports.jsx(e.bs,{variant:"Bold",type:"Text lg",className:"hfl-text-White hfl-bg-gradient_primary_600_500_90 hfl-px-6 hfl-py-2",children:"Please select medicine to copy"}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-px-6 hfl-py-5 hfl-flex hfl-flex-col hfl-gap-6 hfl-overflow-y-auto hfl-flex-1",children:[e.jsxRuntimeExports.jsx(T,{inputValue:C,showInput:!0,isSearchable:!0,disableInputAutoSize:!0,inputChangeHandler:w,onChangeHandler:L,onInputFocus:i,options:_,placeholder:"Search for medicines"}),e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-flex-wrap hfl-gap-2",children:v.map(m=>e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-center hfl-bg-Gray-100 hfl-px-2 hfl-py-0.5 hfl-rounded-md hfl-gap-1",children:[e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text sm",className:"hfl-text-nowrap",children:m.doctorMedicineName}),e.jsxRuntimeExports.jsx("button",{className:"hfl-text-Blue_gray-800",onClick:()=>B(m.medicineId),children:e.jsxRuntimeExports.jsx("i",{className:"hx_close"})})]},m.doctorMedicineName+m.medicineId))})]}),e.jsxRuntimeExports.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:[e.jsxRuntimeExports.jsx(e.Ku,{size:"md",textField:"Cancel",onClick:s,hierarchy:"Secondary-Grey"}),e.jsxRuntimeExports.jsx(e.Ku,{size:"md",textField:"Save",disabled:!v||v.length==0,onClick:async()=>{await p(b,v)&&s()},className:"hfl-bg-Primary-600 hfl-text-White disabled:hfl-opacity-50 disabled:hfl-cursor-not-allowed",hierarchy:"Primary"})]})]})},ze=r.forwardRef(({data:l=[],variant:s,externallyTriggeredEditRowIds:p=[],externallyTriggeredEditMode:b=!1,allowCustomMedicineInput:g=!0,getMedicineOptions:v,onRowChange:a,onRowDelete:C,onRowCopy:w,onSaveRow:_,externalSaveTrigger:k,setSearchDisabled:y},L)=>{const[B,i]=r.useState(null),[m,$]=r.useState(!1),[M,S]=r.useState(),U=r.useCallback((c,n,N)=>{const E=l.find(H=>H.rowId===c);if(!E)return;const I={...E,...n};a?.(I,N||void 0)},[l,a]),W=r.useCallback(async()=>{const c=l.filter(n=>n.isEditing&&n.medicine_name);if(c.length!==0)try{await _?.(c)&&c.forEach(N=>{a?.({...N,isEditing:!1})})}catch(n){console.error("Bulk save failed",n)}finally{y?.(!1)}},[l,_,a,y]);r.useEffect(()=>{k&&W()},[k,W]),r.useEffect(()=>{const c=l.some(n=>n.isEditing);y?.(c)},[l,y]);const o=r.useCallback(c=>{S(c),$(!0)},[]),j=r.useCallback(async()=>{if(B)try{await C?.(B)}catch(c){console.error("Delete failed",c)}finally{i(null)}},[B,C]),f=r.useCallback(()=>{i(null)},[]),x=r.useCallback(async c=>{try{return await _?.([c])?(a?.({...c,isEditing:!1}),!0):!1}catch(n){return console.error("Save row failed",n),!1}},[_,a]),q=r.useCallback(async()=>{const c=l.filter(n=>n.isEditing&&n.medicine_name);if(c.length===0)return!0;try{const n=await _?.(c);return n&&l.map(E=>E.isEditing?{...E,isEditing:!1}:E).forEach(E=>a?.(E)),!!n}catch(n){return console.error("External bulk save failed",n),!1}},[l,_,a]);r.useImperativeHandle(L,()=>({triggerExternalSave:q}));const D={variant:s,externallyTriggeredEditMode:b,externallyTriggeredEditRowIds:p,getMedicineOptions:v,onRowChange:(c,n)=>{U(c.rowId,c,n),a?.(c,n)},onRowDelete:C,onRowCopy:w,setRowToDelete:i,openPopupForRow:o};return e.jsxRuntimeExports.jsxs("div",{className:"hfl-border-1 hfl-border-Gray-200",children:[e.jsxRuntimeExports.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:A.C_Table_Column_Name.map(c=>e.jsxRuntimeExports.jsx(e.bs,{variant:"Medium",type:"Text sm",className:"hfl-text-Blue_gray-600",children:c},c))}),e.jsxRuntimeExports.jsxs(we.Provider,{value:D,children:[e.jsxRuntimeExports.jsx("div",{className:"table-body",children:l.length===0?e.jsxRuntimeExports.jsx(e.bs,{variant:"Medium",type:"Text sm",className:"hfl-text-Blue_gray-600 hfl-px-2 hfl-py-3",children:"No medicines added"}):l.map(c=>e.jsxRuntimeExports.jsx($e,{rowData:c,isEditing:c.isEditing||!1,setIsEditing:n=>U(c.rowId,{isEditing:n}),onSaveRow:x,allowCustomMedicineInput:g},c.rowId))}),e.jsxRuntimeExports.jsx(qe,{headingText:"Delete Medicine",subHeadingText:"Are you sure you want to delete this medicine?",openState:!!B,positiveButtonText:"Delete",negativeButtonText:"Cancel",positiveActionCallback:j,negativeActionCallback:f,classNameNegativeBtn:"hfl-bg-Blue-600",classNamePositiveBtn:"hfl-bg-Error-500 hover:hfl-bg-Error-700 hfl-text-White",closePopupCallback:f}),e.jsxRuntimeExports.jsx(He,{open:m,onCancel:()=>$(!1),onCopySave:w,rowMedicineData:M,getMedicineOptions:v})]})]})});exports.PediatricsCalculatorTable=ze;