@argusoft/medplat-form-engine 1.0.14 → 1.0.16

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 (134) hide show
  1. package/dist/AccessRights-BMRM1u9S-D1Gc0rKI.js +1228 -0
  2. package/dist/AccessRights-BMRM1u9S-D1Gc0rKI.js.map +1 -0
  3. package/dist/AddEditQueryBuilder-7JRplV5J-DHgS6TYG.js +313 -0
  4. package/dist/AddEditQueryBuilder-7JRplV5J-DHgS6TYG.js.map +1 -0
  5. package/dist/AddEditQueryBuilder-7JRplV5J.css +1 -0
  6. package/dist/AddFeatures-CkTu7sOI-BGplSFp6.js +212 -0
  7. package/dist/AddFeatures-CkTu7sOI-BGplSFp6.js.map +1 -0
  8. package/dist/AddLabelModal-DE3ploGD-OOyaGC02.js +734 -0
  9. package/dist/AddLabelModal-DE3ploGD-OOyaGC02.js.map +1 -0
  10. package/dist/AddMenuConfiguration-QWfpcnuP-TAM2c68S.js +5389 -0
  11. package/dist/AddMenuConfiguration-QWfpcnuP-TAM2c68S.js.map +1 -0
  12. package/dist/AddMenuConfiguration-QWfpcnuP.css +1 -0
  13. package/dist/AddRoleDrawer-ZK1eejxI-BM6rfhh5.js +453 -0
  14. package/dist/AddRoleDrawer-ZK1eejxI-BM6rfhh5.js.map +1 -0
  15. package/dist/AppModal-BgZyfrd--BO3wW4ma.js +428 -0
  16. package/dist/AppModal-BgZyfrd--BO3wW4ma.js.map +1 -0
  17. package/dist/ChangePasswordModalCore-DIe4rzW--CSDVIGsb.js +176 -0
  18. package/dist/ChangePasswordModalCore-DIe4rzW--CSDVIGsb.js.map +1 -0
  19. package/dist/ConditionConfig-GDCXIg3C-DuEy85LD.js +395 -0
  20. package/dist/ConditionConfig-GDCXIg3C-DuEy85LD.js.map +1 -0
  21. package/dist/ConditionConfig-GDCXIg3C.css +1 -0
  22. package/dist/EntityManagement-D-x6Qzal-BE01iKNR.js +50 -0
  23. package/dist/EntityManagement-D-x6Qzal-BE01iKNR.js.map +1 -0
  24. package/dist/EventConfigurations-jGCJ4LqP-CJBCGp6J.js +384 -0
  25. package/dist/EventConfigurations-jGCJ4LqP-CJBCGp6J.js.map +1 -0
  26. package/dist/EventConfigurations-jGCJ4LqP.css +1 -0
  27. package/dist/EventsExceptionModal-BF6E1Np7-DHT7pQsx.js +200 -0
  28. package/dist/EventsExceptionModal-BF6E1Np7-DHT7pQsx.js.map +1 -0
  29. package/dist/EventsSkeleton-BN7_0IGs-BAnd1Vug.js +74 -0
  30. package/dist/EventsSkeleton-BN7_0IGs-BAnd1Vug.js.map +1 -0
  31. package/dist/FeatureMenu-Ds6lFg4w-ShGx4okQ.js +249 -0
  32. package/dist/FeatureMenu-Ds6lFg4w-ShGx4okQ.js.map +1 -0
  33. package/dist/Features-Cshdl06N-CZ02Tt89.js +12 -0
  34. package/dist/Features-Cshdl06N-CZ02Tt89.js.map +1 -0
  35. package/dist/FileSaver.min-CN9EpL2h-N-3OFAd7.js +77 -0
  36. package/dist/FileSaver.min-CN9EpL2h-N-3OFAd7.js.map +1 -0
  37. package/dist/FlywayQuery-Cx2sly6g-DdhUw6bN.js +169 -0
  38. package/dist/FlywayQuery-Cx2sly6g-DdhUw6bN.js.map +1 -0
  39. package/dist/ImmunizationConfigurationBase-DZ8EqXlF-B2XcYTYJ.js +5162 -0
  40. package/dist/ImmunizationConfigurationBase-DZ8EqXlF-B2XcYTYJ.js.map +1 -0
  41. package/dist/ImmunizationConfigurationBase-DZ8EqXlF.css +1 -0
  42. package/dist/ImmunizationConfigurationsList-CQnxWa09-Bbr0iyGy.js +335 -0
  43. package/dist/ImmunizationConfigurationsList-CQnxWa09-Bbr0iyGy.js.map +1 -0
  44. package/dist/ImmunizationSkeleton-D2tdv5k--B7SY-gnr.js +186 -0
  45. package/dist/ImmunizationSkeleton-D2tdv5k--B7SY-gnr.js.map +1 -0
  46. package/dist/LanguagesModal-rk6IGQwY-B0Jtpivu.js +394 -0
  47. package/dist/LanguagesModal-rk6IGQwY-B0Jtpivu.js.map +1 -0
  48. package/dist/ManageDynamicFeature-C2I7Ho7i-Bbxkpw0S.js +4189 -0
  49. package/dist/ManageDynamicFeature-C2I7Ho7i-Bbxkpw0S.js.map +1 -0
  50. package/dist/ManageEventConfiguration-BJxS2Su0-CRATBMym.js +1017 -0
  51. package/dist/ManageEventConfiguration-BJxS2Su0-CRATBMym.js.map +1 -0
  52. package/dist/ManageEventConfiguration-BJxS2Su0.css +1 -0
  53. package/dist/ManageNotification-DMN2szWy-DQvdrfwC.js +6819 -0
  54. package/dist/ManageNotification-DMN2szWy-DQvdrfwC.js.map +1 -0
  55. package/dist/ManageRole-CuXmWQyp-Cy15Mlax.js +728 -0
  56. package/dist/ManageRole-CuXmWQyp-Cy15Mlax.js.map +1 -0
  57. package/dist/ManageTranslation-BTxvSYKb-CdO4Fk7f.js +616 -0
  58. package/dist/ManageTranslation-BTxvSYKb-CdO4Fk7f.js.map +1 -0
  59. package/dist/ManageTranslation-BTxvSYKb.css +1 -0
  60. package/dist/ManageUser-Dr3ptCYp-CJBp0yVr.js +2179 -0
  61. package/dist/ManageUser-Dr3ptCYp-CJBp0yVr.js.map +1 -0
  62. package/dist/ManageUser-Dr3ptCYp.css +1 -0
  63. package/dist/MedplatFormWrapper-SwW0rdxN.js +52363 -0
  64. package/dist/MedplatFormWrapper-SwW0rdxN.js.map +1 -0
  65. package/dist/MedplatFormWrapper.css +1 -0
  66. package/dist/MobileMenuManagement-BmrO-7MN-xFkU87j6.js +111 -0
  67. package/dist/MobileMenuManagement-BmrO-7MN-xFkU87j6.js.map +1 -0
  68. package/dist/MobileTypeEventConfigModal-ChhO_A4f-DfJDqFB9.js +783 -0
  69. package/dist/MobileTypeEventConfigModal-ChhO_A4f-DfJDqFB9.js.map +1 -0
  70. package/dist/NewServerManagement-5YcAtF-g-DHV6PFTR.js +1002 -0
  71. package/dist/NewServerManagement-5YcAtF-g-DHV6PFTR.js.map +1 -0
  72. package/dist/NotificationFlywayQuery-BY8Zzml_-C7G-28dx.js +244 -0
  73. package/dist/NotificationFlywayQuery-BY8Zzml_-C7G-28dx.js.map +1 -0
  74. package/dist/NotificationList-BqibwMaM-D4mMbj4h.js +400 -0
  75. package/dist/NotificationList-BqibwMaM-D4mMbj4h.js.map +1 -0
  76. package/dist/OtherTypeEventConfigModal-ZnCGWm9v-D7x0QObl.js +1953 -0
  77. package/dist/OtherTypeEventConfigModal-ZnCGWm9v-D7x0QObl.js.map +1 -0
  78. package/dist/QueryBuilder-BPfavHH9-M3wgeHB3.js +378 -0
  79. package/dist/QueryBuilder-BPfavHH9-M3wgeHB3.js.map +1 -0
  80. package/dist/QueryBuilder-BPfavHH9.css +1 -0
  81. package/dist/QueryManagement-DXA73N2j-De9XnBKC.js +671 -0
  82. package/dist/QueryManagement-DXA73N2j-De9XnBKC.js.map +1 -0
  83. package/dist/QueryManagement-DXA73N2j.css +1 -0
  84. package/dist/RoleManagement-C0feJCuq-DIGwGqOD.js +410 -0
  85. package/dist/RoleManagement-C0feJCuq-DIGwGqOD.js.map +1 -0
  86. package/dist/SecurityAuditLogList-DHTcOtbx-BSjPID73.js +746 -0
  87. package/dist/SecurityAuditLogList-DHTcOtbx-BSjPID73.js.map +1 -0
  88. package/dist/ServerSyncModal-D_oFpv3C-C6c3_3lx.js +836 -0
  89. package/dist/ServerSyncModal-D_oFpv3C-C6c3_3lx.js.map +1 -0
  90. package/dist/ShowFlywayQuery-BkyA6QaA-2t9pZjcx.js +130 -0
  91. package/dist/ShowFlywayQuery-BkyA6QaA-2t9pZjcx.js.map +1 -0
  92. package/dist/ShowFlywayQuery-DVRCd384-BypXcNWX.js +259 -0
  93. package/dist/ShowFlywayQuery-DVRCd384-BypXcNWX.js.map +1 -0
  94. package/dist/ShowQueryHistory-BDN0tzHg-17BxK88Z.js +190 -0
  95. package/dist/ShowQueryHistory-BDN0tzHg-17BxK88Z.js.map +1 -0
  96. package/dist/SubMenu-DAfZC9Xi-B0BQYLdI.js +188 -0
  97. package/dist/SubMenu-DAfZC9Xi-B0BQYLdI.js.map +1 -0
  98. package/dist/TableDetails-DzREeJkm-B-WEBbQz.js +1508 -0
  99. package/dist/TableDetails-DzREeJkm-B-WEBbQz.js.map +1 -0
  100. package/dist/TableList-B9hr05Hs-BIsMbnIV.js +428 -0
  101. package/dist/TableList-B9hr05Hs-BIsMbnIV.js.map +1 -0
  102. package/dist/TypeConfiguration-C-lk8Szs-DkvHWHhr.js +117 -0
  103. package/dist/TypeConfiguration-C-lk8Szs-DkvHWHhr.js.map +1 -0
  104. package/dist/UserList-S5Q76wO7-Cj5u_K4_.js +1104 -0
  105. package/dist/UserList-S5Q76wO7-Cj5u_K4_.js.map +1 -0
  106. package/dist/UserList-S5Q76wO7.css +1 -0
  107. package/dist/UserListSkeleton-cglK2SaU-B_Tj5gUp.js +184 -0
  108. package/dist/UserListSkeleton-cglK2SaU-B_Tj5gUp.js.map +1 -0
  109. package/dist/WidgetList-BSApErov-Z61Kpq4T.js +188 -0
  110. package/dist/WidgetList-BSApErov-Z61Kpq4T.js.map +1 -0
  111. package/dist/_commonjsHelpers-B4e78b8K-B9tZyK9c.js +29 -0
  112. package/dist/_commonjsHelpers-B4e78b8K-B9tZyK9c.js.map +1 -0
  113. package/dist/dayjs.min-BiUMMz0V.js +285 -0
  114. package/dist/dayjs.min-BiUMMz0V.js.map +1 -0
  115. package/dist/default-B6sHblIG.js +11341 -0
  116. package/dist/default-B6sHblIG.js.map +1 -0
  117. package/dist/default.css +1 -0
  118. package/dist/i18next-CTOWN_jH-BKKbdDel.js +1389 -0
  119. package/dist/i18next-CTOWN_jH-BKKbdDel.js.map +1 -0
  120. package/dist/index-B4r0wjBD.js +563 -0
  121. package/dist/index-B4r0wjBD.js.map +1 -0
  122. package/dist/index-BFznsakV-BsOSEQZI.js +42638 -0
  123. package/dist/index-BFznsakV-BsOSEQZI.js.map +1 -0
  124. package/dist/index-DNrIMQFT.js +567 -0
  125. package/dist/index-DNrIMQFT.js.map +1 -0
  126. package/dist/index.css +1 -1
  127. package/dist/index.js +3 -52390
  128. package/dist/index.js.map +1 -1
  129. package/dist/manageImmunization-B4swS745-JldexHrO.js +1204 -0
  130. package/dist/manageImmunization-B4swS745-JldexHrO.js.map +1 -0
  131. package/dist/manageImmunization-B4swS745.css +1 -0
  132. package/dist/xlsx.min-D1LFqt_b-BGwkpd8r.js +11869 -0
  133. package/dist/xlsx.min-D1LFqt_b-BGwkpd8r.js.map +1 -0
  134. package/package.json +1 -4
@@ -0,0 +1,1017 @@
1
+ import { jsxs as r, Fragment as nt, jsx as t } from "react/jsx-runtime";
2
+ import { S as it, N as rt, w as lt, m as ot, b as dt } from "./EventsSkeleton-BN7_0IGs-BAnd1Vug.js";
3
+ import { retrieveAllNotifications as st, getReportsList as ct } from "@/common/services/GlobalApis";
4
+ import { showToast as B } from "@/common/toaster/toaster";
5
+ import we from "@/views/custom-components/CustomTextArea";
6
+ import L from "@/views/custom-components/CustomTextField";
7
+ import { yupResolver as ut } from "@hookform/resolvers/yup";
8
+ import mt from "@/views/custom-components/CustomDropdown";
9
+ import { Card as ft, CardHeader as gt, CardContent as vt, FormControl as x, Typography as d, Box as C, Select as Y, MenuItem as v, Divider as G, Button as W, TableContainer as ht, Paper as pt, Table as yt, TableHead as bt, TableRow as xe, TableCell as S, TableBody as wt, CardActions as xt } from "@mui/material";
10
+ import g from "@mui/material/Grid2";
11
+ import { useRef as Ne, useState as u, useEffect as Te, Suspense as Ce, lazy as Z } from "react";
12
+ import { useForm as Nt, Controller as F } from "react-hook-form";
13
+ import { useNavigate as Tt } from "react-router";
14
+ import { useParams as Ct } from "react-router-dom";
15
+ import * as E from "yup";
16
+ import { useTranslateProvider as Et } from "@/common/languageTranslator/TranslationContext";
17
+ import It from "@/hooks/useTrackEvent";
18
+ import { FontAwesomeIcon as _ } from "@fortawesome/react-fontawesome";
19
+ import { faPen as Dt, faTrash as Ee, faPlus as Ie } from "@fortawesome/free-solid-svg-icons";
20
+ import './ManageEventConfiguration-BJxS2Su0.css';const Rt = Z(() => import("./ConditionConfig-GDCXIg3C-DuEy85LD.js")), Mt = Z(
21
+ () => import("./MobileTypeEventConfigModal-ChhO_A4f-DfJDqFB9.js")
22
+ ), qt = Z(
23
+ () => import("./OtherTypeEventConfigModal-ZnCGWm9v-D7x0QObl.js")
24
+ );
25
+ function Kt() {
26
+ var X, ee, te;
27
+ const { translate: l } = Et(), ae = Ne(null), ne = Ne(!1), { id: O } = Ct(), ie = Tt(), [P, De] = u(null), [re, Re] = u(null), [le, Me] = u({}), [y, I] = u(
28
+ []
29
+ ), [oe, qe] = u(null), [H, Ae] = u(null), [Se, de] = u(null), [Oe, $e] = u(null), [D, $] = u(null), [Le, se] = u(null), [_e, ze] = u(null), [A, R] = u(null), [ce, ke] = u(!1), [ue, me] = u(!1), [fe, V] = u(!1), [z, M] = u([]), [Ue, k] = u(!1), [Be, Ye] = u([]), We = window.getComputedStyle(document.body).lineHeight, ge = () => ke(!ce), Fe = E.object().shape({
30
+ name: E.string().required("Enter Name"),
31
+ eventType: E.string().required("Select Event Type"),
32
+ recursionInterval: E.number().typeError("Recursion Interval must be a number").when([], {
33
+ is: () => m === "RECURSION",
34
+ then: (e) => e.required("Recursion Interval is required").moreThan(0, "Recursion Interval must be greater than or equal to 1").lessThan(1441, "Recursion Interval must be less than or equal to 1440"),
35
+ otherwise: (e) => e.notRequired()
36
+ }),
37
+ trigerWhen: E.string().test(
38
+ "is-required",
39
+ "trigerWhen is required",
40
+ function(e) {
41
+ return m === "TIMMER_BASED" ? !!e : !0;
42
+ }
43
+ ),
44
+ day: E.string().test("is-required", "day is required", function(e) {
45
+ return m === "TIMMER_BASED" && (f === "AFTER" || f === "MONTHLY") ? !!e : !0;
46
+ }),
47
+ hour: E.string().test(
48
+ "is-required",
49
+ "hour is required",
50
+ function(e) {
51
+ return m === "TIMMER_BASED" && (f === "AFTER" || f === "MONTHLY" || f === "DAILY") ? !!e : !0;
52
+ }
53
+ ),
54
+ minute: E.string().notRequired()
55
+ // notificationConfigDetails: Yup.array().of(
56
+ // Yup.object().shape({
57
+ // query: Yup.string().required('Query is required'), // Ensure query is present
58
+ // // condition: Yup.string().required('Condition is required'), // Ensure condition is present
59
+ // // action: Yup.string().required('Action is required'), // Ensure action is present
60
+ // })
61
+ // ),
62
+ }), {
63
+ control: w,
64
+ handleSubmit: Pe,
65
+ setValue: U,
66
+ setError: j,
67
+ clearErrors: J,
68
+ getValues: ve,
69
+ watch: he,
70
+ formState: { errors: s }
71
+ } = Nt({
72
+ defaultValues: {
73
+ name: "",
74
+ description: "",
75
+ eventType: "",
76
+ recursionInterval: 0,
77
+ minute: 0
78
+ },
79
+ resolver: ut(Fe),
80
+ mode: "onChange"
81
+ }), m = he("eventType");
82
+ let f = he("trigerWhen");
83
+ Te(() => {
84
+ let e = ae.current;
85
+ return () => {
86
+ Q("conversion_event", {
87
+ form: e,
88
+ form_name: "Manage Event Configuration",
89
+ submit: ne.current
90
+ });
91
+ };
92
+ }, []);
93
+ const He = async (e) => {
94
+ try {
95
+ if (y.length > 0) {
96
+ e.minute = Number(e.minute || 0), e.notificationConfigDetails = y;
97
+ const a = m === "TIMMER_BASED", i = m === "FORM_SUBMITTED", n = m === "MANUAL", o = m === "RECURSION";
98
+ a || (delete e.trigerWhen, delete e.day, delete e.hour, delete e.minute), i || delete e.formTypeId, !i && !n && (delete e.eventTypeDetailCode, delete e.eventTypeDetailId), o ? (delete e.formTypeId, e.trigerWhen = "RECURSION") : delete e.recursionInterval;
99
+ const h = ["AFTER", "MONTHLY", "WEEKLY"], q = ["AFTER", "MONTHLY", "DAILY", "WEEKLY"];
100
+ h.includes(f) || delete e.day, q.includes(f) || (delete e.day, delete e.hour), f === "IMMEDIATELY" && (delete e.day, delete e.hour, delete e.minute);
101
+ const T = y.map((p) => {
102
+ var c;
103
+ return {
104
+ ...p,
105
+ conditions: (c = p.conditions) == null ? void 0 : c.map((b) => ({
106
+ ...b,
107
+ notificaitonConfigsType: b.notificaitonConfigsType ? b.notificaitonConfigsType.map((N) => ({
108
+ ...N,
109
+ queryCode: N.queryCode === "" ? null : N.queryCode
110
+ })) : b.notificaitonConfigsType
111
+ }))
112
+ };
113
+ });
114
+ e.notificationConfigDetails = T, await dt(e), Q("button_click", {
115
+ button_name: "manageeventconfiguration-save-button",
116
+ button_type: "submit",
117
+ button_id: "manageeventconfiguration-save-button"
118
+ }), B({
119
+ message: O ? "Event Configuration Updated successfully" : "submit successfully",
120
+ type: "success"
121
+ }), ne.current = !0, ie("/ui/medplat/notification/all");
122
+ } else
123
+ B({
124
+ message: "Please add atleast query / condition for the configuration",
125
+ type: "warn"
126
+ });
127
+ } catch {
128
+ B({ message: "submit problem", type: "error" }), k((a) => !a);
129
+ }
130
+ };
131
+ Te(() => {
132
+ Ve();
133
+ }, []);
134
+ const Ve = async () => {
135
+ var e, a, i, n;
136
+ try {
137
+ k((c) => !c);
138
+ const o = await it({ is_active: !0 });
139
+ De(o == null ? void 0 : o.data);
140
+ const h = await rt();
141
+ Re(h == null ? void 0 : h.data);
142
+ const q = await st(!0);
143
+ let T = {};
144
+ (e = q == null ? void 0 : q.data) == null || e.forEach((c) => {
145
+ T[c == null ? void 0 : c.id] = c == null ? void 0 : c.notificationName;
146
+ }), Me(T);
147
+ const { data: p } = await ct();
148
+ if (Ye(p || []), O) {
149
+ const c = await lt(O);
150
+ (i = (a = c == null ? void 0 : c.data) == null ? void 0 : a.notificationConfigDetails) == null || i.forEach((N) => {
151
+ pe(N);
152
+ });
153
+ let b = c == null ? void 0 : c.data;
154
+ (n = Object.keys(b)) == null || n.forEach((N) => {
155
+ b[N] !== void 0 && b[N] !== null && U(N, b[N]);
156
+ }), I((b == null ? void 0 : b.notificationConfigDetails) || []);
157
+ }
158
+ k((c) => !c);
159
+ } catch (o) {
160
+ B({
161
+ message: "Error in loading manage events",
162
+ type: `Error:${o == null ? void 0 : o.message}`
163
+ }), k((h) => !h);
164
+ }
165
+ }, pe = (e) => {
166
+ e.implicitParam = ["#resourceId#"];
167
+ const a = /\bFROM\b/gi, i = /\bSELECT\b/gi;
168
+ if (e != null && e.query) {
169
+ const n = (e.query.match(a) || []).length, o = (e.query.match(i) || []).length;
170
+ let h;
171
+ if (o > 0) {
172
+ n > 1 && n === o ? h = e.query.substring(6, e.query.search(/\bfrom\b(?!(.|\n)*(from))/i)).match(/(\w*\(.*?\) as \w*|[^\(\),]+)(?=\s*,|\s*$)/g) : n !== o ? h = e.query.substring(6).match(/(\w*\(.*?\) as \w*|[^\(\),]+)(?=\s*,|\s*$)/gi) : n === 1 && n === o ? h = e.query.substring(6, e.query.toLowerCase().indexOf("from")).match(/(\w*\(.*?\) as \w*|[^\(\),]+)(?=\s*,|\s*$)/gi) : h = e.query.substring(6).match(/(\w*\(.*?\) as \w*|[^\(\),]+)(?=\s*,|\s*$)/gi);
173
+ const q = h == null ? void 0 : h.filter(
174
+ (T) => T.trim().length > 0
175
+ );
176
+ q == null || q.forEach((T) => {
177
+ let p = T.trim();
178
+ if (p.toLowerCase().indexOf("as") === 0 && (p = T), p.endsWith(";") && (p = p.slice(0, -1)), p !== "*") {
179
+ const c = p.toLowerCase().lastIndexOf(" as ");
180
+ if (c >= 0) {
181
+ const b = p.substring(c + 4).trim();
182
+ e.implicitParam.push("#" + b + "#");
183
+ } else
184
+ e.implicitParam.push("#" + p + "#");
185
+ }
186
+ });
187
+ }
188
+ }
189
+ }, je = (e) => {
190
+ const a = y == null ? void 0 : y.filter(
191
+ (i, n) => n !== e
192
+ );
193
+ I(a);
194
+ }, Je = (e, a) => {
195
+ const i = [...y], n = i[e].conditions.filter((o, h) => h !== a);
196
+ i[e].conditions = n, I(i);
197
+ }, K = async (e, a, i, n) => {
198
+ Ae(e), qe(a), i ? (de(i), se(!0), $(JSON.parse(JSON.stringify(i))), M((i == null ? void 0 : i.notificaitonConfigsType) || []), $e(n)) : (de({}), $({}), M([]), se(!1)), R({}), ge();
199
+ }, Ke = (e, a) => {
200
+ const i = [...y];
201
+ i[e].query = a, I(i);
202
+ }, Qe = async () => {
203
+ let e = [...y], a = !0;
204
+ y.forEach((i, n) => {
205
+ if (i.query === "") {
206
+ a = !1;
207
+ const o = `notificationConfigDetails.${n}.query`;
208
+ j(o, { type: "manual", message: "Query Required" });
209
+ }
210
+ }), a && (e.push({ query: "", conditions: [], queryParam: null }), I(e));
211
+ }, ye = async (e, a) => {
212
+ e ? (e.index = a, ze(e), R({
213
+ ...JSON.parse(JSON.stringify(e)),
214
+ implicitParam: H.implicitParam
215
+ }), me(!0)) : (R({ ...A, implicitParam: H.implicitParam }), me(!1)), Ge();
216
+ }, Ge = () => {
217
+ V((e) => !e);
218
+ }, be = (e) => {
219
+ if (ue) {
220
+ const a = z.map((i, n) => n === e.index ? { ...i, ...e } : i);
221
+ M(a);
222
+ } else
223
+ M([...z, e]);
224
+ et(e);
225
+ }, Ze = (e) => {
226
+ M(
227
+ (a) => a.filter((i, n) => n !== e)
228
+ );
229
+ }, Xe = (e) => {
230
+ ye(z[e], e);
231
+ }, et = (e) => {
232
+ let a = { ...D };
233
+ D.notificaitonConfigsType || (a.notificaitonConfigsType = []), ue ? a.notificaitonConfigsType[_e.index] = e : a.notificaitonConfigsType.push(e), $(a), R({});
234
+ }, Q = It(), tt = (e) => {
235
+ if (Le) {
236
+ const a = [...y];
237
+ $({ ...D, ...e });
238
+ let i = { ...D, ...e };
239
+ a[oe].conditions[Oe] = i, I(a), M([]);
240
+ } else {
241
+ const a = [...y];
242
+ $({ ...D, ...e });
243
+ let i = { ...D, ...e };
244
+ a[oe].conditions.push(i), I(a), M([]);
245
+ }
246
+ }, at = (e) => {
247
+ R({ ...A, ...e });
248
+ };
249
+ return /* @__PURE__ */ r(nt, { children: [
250
+ /* @__PURE__ */ t(ot, { isLoading: Ue, children: /* @__PURE__ */ r(
251
+ ft,
252
+ {
253
+ className: "manage-eventConfiguration-type-body",
254
+ component: "form",
255
+ ref: ae,
256
+ onSubmit: Pe(He),
257
+ "data-testid": "manageeventconfiguration-form",
258
+ children: [
259
+ /* @__PURE__ */ t(
260
+ gt,
261
+ {
262
+ className: "p-2.5 px-5 flex border-b text-customBlue",
263
+ subheader: l(
264
+ `${O ? "UPDATE" : "ADD"} EVENT CONFIGURATION`
265
+ ),
266
+ slotProps: {
267
+ subheader: { className: "font-medium text-lg text-customBlue" }
268
+ },
269
+ "data-testid": "manageeventconfiguration-cardheader-subheader"
270
+ }
271
+ ),
272
+ /* @__PURE__ */ r(vt, { "data-testid": "manageeventconfiguration-cardcontent", children: [
273
+ /* @__PURE__ */ r(g, { container: !0, spacing: 2, children: [
274
+ /* @__PURE__ */ t(
275
+ g,
276
+ {
277
+ item: !0,
278
+ size: { xs: 12, sm: 6 },
279
+ "data-testid": "manageeventconfiguration-name-field",
280
+ children: /* @__PURE__ */ r(x, { variant: "outlined", className: "w-full", children: [
281
+ /* @__PURE__ */ r(d, { variant: "body2", children: [
282
+ l("Name"),
283
+ /* @__PURE__ */ t("span", { className: "text-red-500 ml-1", children: "*" })
284
+ ] }),
285
+ /* @__PURE__ */ t(C, { className: "w-full", children: /* @__PURE__ */ t(
286
+ L,
287
+ {
288
+ control: w,
289
+ id: "name",
290
+ name: "name",
291
+ errors: s,
292
+ label: "",
293
+ size: "small",
294
+ dataTestId: "manageeventconfiguration-name-textfield"
295
+ }
296
+ ) })
297
+ ] })
298
+ }
299
+ ),
300
+ /* @__PURE__ */ t(
301
+ g,
302
+ {
303
+ item: !0,
304
+ size: { xs: 12, sm: 6 },
305
+ "data-testid": "manageeventconfiguration-description-field",
306
+ children: /* @__PURE__ */ r(x, { variant: "outlined", className: "w-full", children: [
307
+ /* @__PURE__ */ t(d, { variant: "body2", children: l("Description") }),
308
+ /* @__PURE__ */ t(C, { className: "w-full", children: /* @__PURE__ */ t(
309
+ we,
310
+ {
311
+ control: w,
312
+ id: "description",
313
+ name: "description",
314
+ errors: s,
315
+ label: "",
316
+ minRows: 2,
317
+ "data-testid": "manageeventconfiguration-description-textarea"
318
+ }
319
+ ) })
320
+ ] })
321
+ }
322
+ ),
323
+ /* @__PURE__ */ t(
324
+ g,
325
+ {
326
+ item: !0,
327
+ size: { xs: 12, sm: 6 },
328
+ "data-testid": "manageeventconfiguration-eventtype-field",
329
+ children: /* @__PURE__ */ r(x, { variant: "outlined", className: "w-full", children: [
330
+ /* @__PURE__ */ r(d, { variant: "body2", children: [
331
+ l("Event Type"),
332
+ /* @__PURE__ */ t("span", { className: "text-red-500 ml-1", children: "*" })
333
+ ] }),
334
+ /* @__PURE__ */ r(C, { className: "w-full", children: [
335
+ /* @__PURE__ */ t(
336
+ F,
337
+ {
338
+ name: "eventType",
339
+ control: w,
340
+ defaultValue: "",
341
+ className: "w-full",
342
+ render: ({ field: e }) => /* @__PURE__ */ r(
343
+ Y,
344
+ {
345
+ className: "w-full",
346
+ labelId: "event-type-label",
347
+ id: "reportgroup",
348
+ ...e,
349
+ error: s.eventType,
350
+ size: "small",
351
+ "data-testid": "manageeventconfiguration-eventtype-select",
352
+ children: [
353
+ /* @__PURE__ */ t(v, { value: "FORM_SUBMITTED", children: /* @__PURE__ */ t(d, { variant: "body2", children: l("Form Submitted") }) }),
354
+ /* @__PURE__ */ t(v, { value: "TIMMER_BASED", children: /* @__PURE__ */ t(d, { variant: "body2", children: l("Timer Based") }) }),
355
+ /* @__PURE__ */ t(v, { value: "MANUAL", children: /* @__PURE__ */ t(d, { variant: "body2", children: l("Manual") }) }),
356
+ /* @__PURE__ */ t(v, { value: "RECURSION", children: /* @__PURE__ */ t(d, { variant: "body2", children: l("Recursion") }) })
357
+ ]
358
+ }
359
+ )
360
+ }
361
+ ),
362
+ (s == null ? void 0 : s.eventType) && /* @__PURE__ */ t(
363
+ "p",
364
+ {
365
+ className: "error-helper-manage-event",
366
+ "data-testid": "custom-error-message",
367
+ children: (X = s == null ? void 0 : s.eventType) == null ? void 0 : X.message
368
+ }
369
+ )
370
+ ] })
371
+ ] })
372
+ }
373
+ ),
374
+ m === "FORM_SUBMITTED" && /* @__PURE__ */ t(
375
+ g,
376
+ {
377
+ item: !0,
378
+ size: { xs: 12, sm: 6 },
379
+ "data-testid": "manageeventconfiguration-formtype-field",
380
+ children: /* @__PURE__ */ r(x, { variant: "outlined", className: "w-full", children: [
381
+ /* @__PURE__ */ t(d, { variant: "body2", children: l("Form Type") }),
382
+ /* @__PURE__ */ t(C, { className: "w-full", children: /* @__PURE__ */ t(
383
+ F,
384
+ {
385
+ className: "w-full",
386
+ name: "formTypeId",
387
+ control: w,
388
+ defaultValue: "",
389
+ render: ({ field: e }) => /* @__PURE__ */ r(
390
+ Y,
391
+ {
392
+ ...e,
393
+ className: "w-full",
394
+ labelId: "event-type-label",
395
+ displayEmpty: !0,
396
+ size: "small",
397
+ onChange: (a) => {
398
+ const i = a.target.value;
399
+ e.onChange(i);
400
+ const n = P.find(
401
+ (o) => o.id === i
402
+ );
403
+ U(
404
+ "eventTypeDetailCode",
405
+ n == null ? void 0 : n.code
406
+ ), U(
407
+ "eventTypeDetailId",
408
+ (n == null ? void 0 : n.detaiId) || null
409
+ );
410
+ },
411
+ "data-testid": "manageeventconfiguration-formtype-select",
412
+ children: [
413
+ /* @__PURE__ */ t(v, { value: "", children: /* @__PURE__ */ t(d, { variant: "body2", children: l("Select") }) }),
414
+ P == null ? void 0 : P.map((a) => /* @__PURE__ */ t(v, { value: a.id, children: /* @__PURE__ */ t(d, { variant: "body2", children: l(a.name) }) }, a.id))
415
+ ]
416
+ }
417
+ )
418
+ }
419
+ ) })
420
+ ] })
421
+ }
422
+ ),
423
+ m === "TIMMER_BASED" && /* @__PURE__ */ t(
424
+ g,
425
+ {
426
+ item: !0,
427
+ size: { xs: 12, sm: 6 },
428
+ "data-testid": "manageeventconfiguration-triggerwhen-field",
429
+ children: /* @__PURE__ */ r(x, { variant: "outlined", className: "w-full", children: [
430
+ /* @__PURE__ */ r(d, { variant: "body2", children: [
431
+ l("Trigger When"),
432
+ /* @__PURE__ */ t("span", { className: "text-red-500 ml-1", children: "*" })
433
+ ] }),
434
+ /* @__PURE__ */ r(C, { className: "w-full", children: [
435
+ /* @__PURE__ */ t(
436
+ F,
437
+ {
438
+ name: "trigerWhen",
439
+ control: w,
440
+ defaultValue: "",
441
+ className: "w-full",
442
+ render: ({ field: e }) => /* @__PURE__ */ r(
443
+ Y,
444
+ {
445
+ className: "w-full",
446
+ ...e,
447
+ value: e.value,
448
+ error: s.trigerWhen,
449
+ size: "small",
450
+ "data-testid": "manageeventconfiguration-triggerwhen-select",
451
+ children: [
452
+ /* @__PURE__ */ t(v, { value: "", children: /* @__PURE__ */ t(d, { variant: "body2", children: l("Select") }) }),
453
+ /* @__PURE__ */ t(v, { value: "IMMEDIATELY", children: /* @__PURE__ */ t(d, { variant: "body2", children: l("Immediately") }) }),
454
+ /* @__PURE__ */ t(v, { value: "AFTER", children: /* @__PURE__ */ t(d, { variant: "body2", children: l("After") }) }),
455
+ /* @__PURE__ */ t(v, { value: "MONTHLY", children: /* @__PURE__ */ t(d, { variant: "body2", children: l("Monthly") }) }),
456
+ /* @__PURE__ */ t(v, { value: "WEEKLY", children: /* @__PURE__ */ t(d, { variant: "body2", children: l("Weekly") }) }),
457
+ /* @__PURE__ */ t(v, { value: "DAILY", children: /* @__PURE__ */ t(d, { variant: "body2", children: l("Daily") }) }),
458
+ /* @__PURE__ */ t(v, { value: "HOURLY", children: /* @__PURE__ */ t(d, { variant: "body2", children: l("Hourly") }) }),
459
+ /* @__PURE__ */ t(v, { value: "MINUTE", children: /* @__PURE__ */ t(d, { variant: "body2", children: l("Minutely") }) })
460
+ ]
461
+ }
462
+ )
463
+ }
464
+ ),
465
+ (s == null ? void 0 : s.trigerWhen) && /* @__PURE__ */ t(
466
+ "p",
467
+ {
468
+ className: "error-helper-manage-event",
469
+ "data-testid": "custom-error-message",
470
+ children: (ee = s == null ? void 0 : s.trigerWhen) == null ? void 0 : ee.message
471
+ }
472
+ )
473
+ ] })
474
+ ] })
475
+ }
476
+ ),
477
+ m === "TIMMER_BASED" && (f === "AFTER" || f === "MONTHLY" || f === "WEEKLY") && /* @__PURE__ */ t(
478
+ g,
479
+ {
480
+ item: !0,
481
+ size: { xs: 12, sm: 6 },
482
+ "data-testid": "manageeventconfiguration-day-field",
483
+ children: /* @__PURE__ */ r(x, { variant: "outlined", className: "w-full", children: [
484
+ /* @__PURE__ */ r(d, { variant: "body2", children: [
485
+ l("day"),
486
+ /* @__PURE__ */ t("span", { className: "text-red-500 ml-1", children: "*" })
487
+ ] }),
488
+ /* @__PURE__ */ t(
489
+ L,
490
+ {
491
+ control: w,
492
+ id: "day",
493
+ name: "day",
494
+ errors: s,
495
+ type: "number",
496
+ label: "",
497
+ size: "small",
498
+ dataTestId: "manageeventconfiguration-day-textfield"
499
+ }
500
+ )
501
+ ] })
502
+ }
503
+ ),
504
+ m === "TIMMER_BASED" && (f === "AFTER" || f === "MONTHLY" || f === "DAILY" || f === "WEEKLY") && /* @__PURE__ */ t(
505
+ g,
506
+ {
507
+ item: !0,
508
+ size: { xs: 12, sm: 6 },
509
+ "data-testid": "manageeventconfiguration-hour-field",
510
+ children: /* @__PURE__ */ r(x, { variant: "outlined", className: "w-full", children: [
511
+ /* @__PURE__ */ r(d, { variant: "body2", children: [
512
+ l("Hour"),
513
+ /* @__PURE__ */ t("span", { className: "text-red-500 ml-1", children: "*" })
514
+ ] }),
515
+ /* @__PURE__ */ t(
516
+ L,
517
+ {
518
+ control: w,
519
+ id: "hour",
520
+ name: "hour",
521
+ type: "number",
522
+ errors: s,
523
+ label: "",
524
+ size: "small",
525
+ dataTestId: "manageeventconfiguration-hour-textfield"
526
+ }
527
+ )
528
+ ] })
529
+ }
530
+ ),
531
+ m === "TIMMER_BASED" && f && f !== "IMMEDIATELY" && /* @__PURE__ */ t(
532
+ g,
533
+ {
534
+ item: !0,
535
+ size: { xs: 12, sm: 6 },
536
+ "data-testid": "manageeventconfiguration-minute-field",
537
+ children: /* @__PURE__ */ r(x, { variant: "outlined", className: "w-full", children: [
538
+ /* @__PURE__ */ t(d, { variant: "body2", children: l("Minute") }),
539
+ /* @__PURE__ */ t(
540
+ L,
541
+ {
542
+ control: w,
543
+ id: "minute",
544
+ name: "minute",
545
+ errors: s,
546
+ type: "number",
547
+ label: "",
548
+ size: "small",
549
+ dataTestId: "manageeventconfiguration-minute-textfield"
550
+ }
551
+ )
552
+ ] })
553
+ }
554
+ ),
555
+ m === "RECURSION" && /* @__PURE__ */ t(g, { item: !0, size: { xs: 12, sm: 6 }, children: /* @__PURE__ */ r(x, { variant: "outlined", className: "w-full", children: [
556
+ /* @__PURE__ */ r(d, { variant: "body2", children: [
557
+ l("Recursion Interval (in Minutes)"),
558
+ /* @__PURE__ */ t("span", { className: "text-red-500 ml-1", children: "*" })
559
+ ] }),
560
+ /* @__PURE__ */ t(C, { className: "w-full", children: /* @__PURE__ */ t(
561
+ L,
562
+ {
563
+ type: "number",
564
+ control: w,
565
+ id: "recursionInterval",
566
+ name: "recursionInterval",
567
+ errors: s,
568
+ label: "",
569
+ size: "small",
570
+ dataTestId: "manageeventconfiguration-recursionInterval-textfield"
571
+ }
572
+ ) })
573
+ ] }) }),
574
+ (m === "TIMMER_BASED" || m === "RECURSION") && /* @__PURE__ */ t(g, { item: !0, size: { xs: 12, sm: 6 }, children: /* @__PURE__ */ r(x, { variant: "outlined", className: "w-full", children: [
575
+ /* @__PURE__ */ t(d, { variant: "body2", children: l("Reports") }),
576
+ /* @__PURE__ */ t(C, { className: "w-full", children: /* @__PURE__ */ t(
577
+ mt,
578
+ {
579
+ id: "reportUUID",
580
+ name: "reportUUID",
581
+ displayName: "name",
582
+ optionValue: "uuid",
583
+ multiple: !0,
584
+ control: w,
585
+ options: Be
586
+ }
587
+ ) })
588
+ ] }) }),
589
+ m === "MANUAL" && /* @__PURE__ */ t(
590
+ g,
591
+ {
592
+ item: !0,
593
+ size: { xs: 12, sm: 6 },
594
+ "data-testid": "manageeventconfiguration-event-field",
595
+ children: /* @__PURE__ */ r(x, { variant: "outlined", className: "w-full", children: [
596
+ /* @__PURE__ */ t(d, { variant: "body2", children: l("Event") }),
597
+ /* @__PURE__ */ r(C, { className: "w-full", children: [
598
+ /* @__PURE__ */ t(
599
+ F,
600
+ {
601
+ name: "eventTypeDetailCode",
602
+ control: w,
603
+ className: "w-full",
604
+ render: ({ field: e }) => /* @__PURE__ */ r(
605
+ Y,
606
+ {
607
+ className: "w-full",
608
+ ...e,
609
+ value: e.value,
610
+ error: s.eventTypeDetailCode,
611
+ size: "small",
612
+ "data-testid": "manageeventconfiguration-eventtype-detail-select",
613
+ children: [
614
+ /* @__PURE__ */ t(v, { value: "", children: l("None") }),
615
+ re && Object.entries(re).map(([a, i]) => /* @__PURE__ */ t(v, { value: a, children: i }, a))
616
+ ]
617
+ }
618
+ )
619
+ }
620
+ ),
621
+ (s == null ? void 0 : s.eventTypeDetailCode) && /* @__PURE__ */ t(
622
+ "p",
623
+ {
624
+ className: "error-helper-manage-event",
625
+ "data-testid": "manageeventconfiguration-eventtype-detail-error",
626
+ children: (te = s == null ? void 0 : s.eventTypeDetailCode) == null ? void 0 : te.message
627
+ }
628
+ )
629
+ ] })
630
+ ] })
631
+ }
632
+ )
633
+ ] }),
634
+ /* @__PURE__ */ t(G, { className: "m-[20px_3px]" }),
635
+ /* @__PURE__ */ r(
636
+ g,
637
+ {
638
+ container: !0,
639
+ spacing: 5,
640
+ justifyContent: "space-between",
641
+ alignItems: "center",
642
+ "data-testid": "manageeventconfiguration-add-configuration",
643
+ children: [
644
+ /* @__PURE__ */ t(g, { item: !0, children: /* @__PURE__ */ t(d, { variant: "body2", children: l("Add Configuration") }) }),
645
+ /* @__PURE__ */ t(g, { item: !0, children: /* @__PURE__ */ t(
646
+ W,
647
+ {
648
+ size: "small",
649
+ variant: "contained",
650
+ onClick: Qe,
651
+ "data-testid": "manageeventconfiguration-add-button",
652
+ children: l("Add")
653
+ }
654
+ ) })
655
+ ]
656
+ }
657
+ ),
658
+ /* @__PURE__ */ t(g, { container: !0, className: "w-full mt-5", children: /* @__PURE__ */ t(g, { item: !0, className: "w-full", children: /* @__PURE__ */ t(
659
+ ht,
660
+ {
661
+ component: pt,
662
+ className: "w-full",
663
+ "data-testid": "manageeventconfiguration-table-container",
664
+ children: /* @__PURE__ */ r(yt, { sx: { minWidth: 800 }, children: [
665
+ /* @__PURE__ */ t(bt, { children: /* @__PURE__ */ r(
666
+ xe,
667
+ {
668
+ sx: {
669
+ backgroundColor: (e) => e.palette.mode === "dark" ? e.palette.custom.tableHeader : "#f5f5f5"
670
+ },
671
+ children: [
672
+ /* @__PURE__ */ t(
673
+ S,
674
+ {
675
+ className: "border border-gray-300 align-top text-[13px]",
676
+ "data-testid": "manageeventconfiguration-table-header-query",
677
+ children: l("Query")
678
+ }
679
+ ),
680
+ /* @__PURE__ */ t(
681
+ S,
682
+ {
683
+ className: "border border-gray-300 align-top text-[13px]",
684
+ "data-testid": "manageeventconfiguration-table-header-condition",
685
+ children: l("Condition")
686
+ }
687
+ ),
688
+ /* @__PURE__ */ t(
689
+ S,
690
+ {
691
+ className: "border border-gray-300 align-top text-[13px]",
692
+ "data-testid": "manageeventconfiguration-table-header-action",
693
+ children: l("Actions")
694
+ }
695
+ )
696
+ ]
697
+ }
698
+ ) }),
699
+ /* @__PURE__ */ t(wt, { children: y == null ? void 0 : y.map((e, a) => {
700
+ var i;
701
+ return /* @__PURE__ */ r(
702
+ xe,
703
+ {
704
+ sx: {
705
+ backgroundColor: (n) => {
706
+ const o = n.palette.mode === "dark";
707
+ return a % 2 === 0 ? o ? n.palette.background.paper : "#fff" : o ? "#1C2128" : "#f9f9f9";
708
+ },
709
+ // Adding a hover state that works in both modes
710
+ "&:hover": {
711
+ backgroundColor: (n) => n.palette.mode === "dark" ? "#21262D" : "#f0f0f0"
712
+ }
713
+ },
714
+ "data-testid": `manageeventconfiguration-table-row-${a}`,
715
+ children: [
716
+ /* @__PURE__ */ t(
717
+ S,
718
+ {
719
+ className: "border border-gray-300 align-top",
720
+ style: { lineHeight: We },
721
+ "data-testid": `manageeventconfiguration-table-row-${a}-query`,
722
+ children: /* @__PURE__ */ r("div", { className: "flex flex-col items-start min-w-[300px]", children: [
723
+ /* @__PURE__ */ t(
724
+ x,
725
+ {
726
+ variant: "outlined",
727
+ className: "w-full",
728
+ children: /* @__PURE__ */ t(C, { className: "w-full", children: /* @__PURE__ */ t(
729
+ we,
730
+ {
731
+ required: !0,
732
+ control: w,
733
+ id: `notificationConfigDetails.${a}.query`,
734
+ name: `notificationConfigDetails.${a}.query`,
735
+ errors: s,
736
+ value: e.query,
737
+ onChange: (n) => {
738
+ U(
739
+ `notificationConfigDetails.${a}.query`,
740
+ n.target.value
741
+ ), Ke(a, n.target.value);
742
+ const o = `notificationConfigDetails.${a}.query`;
743
+ ve(o) === "" ? j(o, {
744
+ type: "manual",
745
+ message: "Query Required"
746
+ }) : J(o);
747
+ },
748
+ onBlur: () => {
749
+ const n = `notificationConfigDetails.${a}.query`;
750
+ ve(n) === "" ? j(n, {
751
+ type: "manual",
752
+ message: "Query Required"
753
+ }) : J(n), pe(e);
754
+ },
755
+ label: "",
756
+ minRows: 5,
757
+ maxRows: 20,
758
+ "data-testid": `manageeventconfiguration-table-row-${a}-query-textarea`
759
+ }
760
+ ) })
761
+ }
762
+ ),
763
+ /* @__PURE__ */ t(
764
+ "td",
765
+ {
766
+ style: {
767
+ whiteSpace: "normal",
768
+ width: "100%",
769
+ overflowWrap: "break-word"
770
+ },
771
+ children: /* @__PURE__ */ t("b", { children: e == null ? void 0 : e.implicitParam })
772
+ }
773
+ )
774
+ ] })
775
+ }
776
+ ),
777
+ /* @__PURE__ */ t(
778
+ S,
779
+ {
780
+ className: "border border-gray-300 align-top",
781
+ "data-testid": `manageeventconfiguration-table-row-${a}-condition`,
782
+ children: /* @__PURE__ */ t(
783
+ "div",
784
+ {
785
+ style: {
786
+ display: "flex",
787
+ flexDirection: "column",
788
+ alignItems: "flex-start",
789
+ width: "100%"
790
+ },
791
+ children: ((i = e == null ? void 0 : e.conditions) == null ? void 0 : i.length) > 0 ? e == null ? void 0 : e.conditions.map(
792
+ (n, o) => /* @__PURE__ */ r(
793
+ "div",
794
+ {
795
+ style: { width: "100%" },
796
+ children: [
797
+ /* @__PURE__ */ r(
798
+ "div",
799
+ {
800
+ style: {
801
+ display: "flex",
802
+ alignItems: "center",
803
+ width: "100%"
804
+ },
805
+ "data-testid": "manageeventconfiguration-condition-rows",
806
+ children: [
807
+ /* @__PURE__ */ t(
808
+ d,
809
+ {
810
+ className: "mr-1",
811
+ variant: "body2",
812
+ children: (n == null ? void 0 : n.condition) || "No condition specified"
813
+ }
814
+ ),
815
+ /* @__PURE__ */ t(
816
+ _,
817
+ {
818
+ className: "bg-[#cecfd0] text-gray-600 rounded-full p-[10px] w-[14px] h-[14px] mx-1 cursor-pointer hover:bg-gray-300 hover:text-[#11B666] transition-all",
819
+ icon: Dt,
820
+ onClick: () => K(
821
+ e,
822
+ a,
823
+ n,
824
+ o
825
+ ),
826
+ "data-testid": `manageeventconfiguration-table-row-${a}-condition-edit-${o}`
827
+ }
828
+ ),
829
+ /* @__PURE__ */ t(
830
+ _,
831
+ {
832
+ icon: Ee,
833
+ className: "bg-[#cecfd0] text-gray-600 rounded-full p-[10px] w-[14px] h-[14px] mx-1 cursor-pointer hover:bg-gray-300 hover:text-[var(--color-error)] transition-all",
834
+ onClick: () => Je(
835
+ a,
836
+ o
837
+ ),
838
+ "data-testid": `manageeventconfiguration-table-row-${a}-condition-delete-${o}`
839
+ }
840
+ ),
841
+ o === (e == null ? void 0 : e.conditions.length) - 1 && /* @__PURE__ */ t(
842
+ _,
843
+ {
844
+ icon: Ie,
845
+ onClick: () => K(e, a),
846
+ className: "bg-[#cecfd0] text-gray-600 rounded-full p-[10px] w-[14px] h-[14px] mx-1 cursor-pointer hover:bg-gray-300 hover:text-[var(--color-primary)] transition-all",
847
+ "data-testid": `manageeventconfiguration-table-row-${a}-condition-add`
848
+ }
849
+ )
850
+ ]
851
+ }
852
+ ),
853
+ o < (e == null ? void 0 : e.conditions.length) - 1 && /* @__PURE__ */ t(G, { className: "w-full m-[10px_0px]" })
854
+ ]
855
+ },
856
+ o + 1
857
+ )
858
+ ) : /* @__PURE__ */ r(
859
+ "div",
860
+ {
861
+ className: "flex flex-row items-center justify-between w-full mt-2 sm:mt-0 text-[14px]",
862
+ children: [
863
+ /* @__PURE__ */ t("span", { className: "mr-3 flex-1", children: l("No Condition Added") }),
864
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ t(
865
+ _,
866
+ {
867
+ icon: Ie,
868
+ onClick: () => K(e, a),
869
+ className: "bg-gray-200 text-gray-600 rounded-full p-2 w-[16px] h-[16px] cursor-pointer hover:bg-gray-300 hover:text-[var(--color-primary)] transition-all",
870
+ "data-testid": `manageeventconfiguration-table-row-${a}-condition-add-empty`
871
+ }
872
+ ) })
873
+ ]
874
+ }
875
+ )
876
+ }
877
+ )
878
+ }
879
+ ),
880
+ /* @__PURE__ */ t(
881
+ S,
882
+ {
883
+ className: "border border-gray-300 align-top",
884
+ "data-testid": `manageeventconfiguration-table-row-${a}-action`,
885
+ children: /* @__PURE__ */ t(
886
+ "div",
887
+ {
888
+ style: {
889
+ display: "flex",
890
+ flexDirection: "column",
891
+ alignItems: "flex-start"
892
+ },
893
+ children: /* @__PURE__ */ t(
894
+ W,
895
+ {
896
+ onClick: () => {
897
+ je(a);
898
+ const n = `notificationConfigDetails.${a}.query`;
899
+ J(n);
900
+ },
901
+ size: "small",
902
+ "aria-label": "delete",
903
+ "data-testid": `manageeventconfiguration-table-row-${a}-action-delete`,
904
+ children: /* @__PURE__ */ t(
905
+ _,
906
+ {
907
+ icon: Ee,
908
+ className: "text-[19px] text-[var(--color-error)]"
909
+ }
910
+ )
911
+ }
912
+ )
913
+ }
914
+ )
915
+ }
916
+ )
917
+ ]
918
+ },
919
+ a + 1
920
+ );
921
+ }) })
922
+ ] })
923
+ }
924
+ ) }) })
925
+ ] }),
926
+ /* @__PURE__ */ t(G, { className: "m-[8px_0px]" }),
927
+ /* @__PURE__ */ r(
928
+ xt,
929
+ {
930
+ className: "flex flex-col sm:flex-row justify-end gap-2",
931
+ "data-testid": "manageeventconfiguration-cardactions",
932
+ children: [
933
+ /* @__PURE__ */ t(
934
+ W,
935
+ {
936
+ variant: "contained",
937
+ color: "secondary",
938
+ type: "button",
939
+ size: "small",
940
+ className: "w-full sm:w-auto",
941
+ onClick: () => {
942
+ Q("button_click", {
943
+ button_name: "manageeventconfiguration-back-button",
944
+ button_type: "cancel",
945
+ button_id: "manageeventconfiguration-back-button"
946
+ }), ie("/ui/medplat/notification/all");
947
+ },
948
+ "data-testid": "manageeventconfiguration-back-button",
949
+ children: l("Cancel")
950
+ }
951
+ ),
952
+ /* @__PURE__ */ t(
953
+ W,
954
+ {
955
+ size: "small",
956
+ variant: "contained",
957
+ type: "submit",
958
+ color: "primary",
959
+ className: "w-full sm:w-auto m-0",
960
+ "data-testid": "manageeventconfiguration-save-button",
961
+ children: l(`${O ? "Update" : "Save"}`)
962
+ }
963
+ )
964
+ ]
965
+ }
966
+ )
967
+ ]
968
+ }
969
+ ) }),
970
+ /* @__PURE__ */ t(Ce, { children: /* @__PURE__ */ t(
971
+ Rt,
972
+ {
973
+ selectedConfig: H,
974
+ notificationtypeMap: le,
975
+ selectedCondition: Se,
976
+ newCondition: D,
977
+ handleTypeConfigurationDelete: Ze,
978
+ handleTypeConfigurationEdit: Xe,
979
+ addTypeConfig: ye,
980
+ setNewConditionData: tt,
981
+ typeConfigurationData: z,
982
+ setNewTypeData: at,
983
+ overlayOpen: ce,
984
+ handleOverlayState: ge,
985
+ "data-testid": "manageeventconfiguration-conditionconfig"
986
+ }
987
+ ) }),
988
+ /* @__PURE__ */ t(Ce, { children: (A == null ? void 0 : A.type) === "MOBILE" ? /* @__PURE__ */ t(
989
+ Mt,
990
+ {
991
+ type: A,
992
+ open: fe,
993
+ notificationtypeMap: le,
994
+ handleClick: be,
995
+ handleClose: () => {
996
+ V((e) => !e), R({});
997
+ },
998
+ "data-testid": "manageeventconfiguration-mobiletypeeventconfigmodal"
999
+ }
1000
+ ) : /* @__PURE__ */ t(
1001
+ qt,
1002
+ {
1003
+ type: A,
1004
+ open: fe,
1005
+ handleClick: be,
1006
+ handleClose: () => {
1007
+ V((e) => !e), R({});
1008
+ },
1009
+ "data-testid": "manageeventconfiguration-othertypeeventconfigmodal"
1010
+ }
1011
+ ) })
1012
+ ] });
1013
+ }
1014
+ export {
1015
+ Kt as default
1016
+ };
1017
+ //# sourceMappingURL=ManageEventConfiguration-BJxS2Su0-CRATBMym.js.map