@argusoft/medplat-core 1.0.24 → 1.0.25

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 (34) hide show
  1. package/dist/{AddFeatures-CTVs_Gr9.js → AddFeatures-CqE3v0BN.js} +2 -2
  2. package/dist/{AddFeatures-CTVs_Gr9.js.map → AddFeatures-CqE3v0BN.js.map} +1 -1
  3. package/dist/AddMenuConfiguration-BSQLl88V.js +6570 -0
  4. package/dist/AddMenuConfiguration-BSQLl88V.js.map +1 -0
  5. package/dist/{ChangePasswordModalCore-Czu7OZe6.js → ChangePasswordModalCore-DTYWRTa-.js} +3 -3
  6. package/dist/{ChangePasswordModalCore-Czu7OZe6.js.map → ChangePasswordModalCore-DTYWRTa-.js.map} +1 -1
  7. package/dist/{ConditionConfig-BECSbvY2.js → ConditionConfig-DSsgGEXS.js} +2 -2
  8. package/dist/{ConditionConfig-BECSbvY2.js.map → ConditionConfig-DSsgGEXS.js.map} +1 -1
  9. package/dist/{ManageEventConfiguration-CBi2KMB1.js → ManageEventConfiguration-DV3I5POA.js} +4 -4
  10. package/dist/{ManageEventConfiguration-CBi2KMB1.js.map → ManageEventConfiguration-DV3I5POA.js.map} +1 -1
  11. package/dist/{ManageRole-CZAk-IlM.js → ManageRole-B9bs_T00.js} +116 -116
  12. package/dist/ManageRole-B9bs_T00.js.map +1 -0
  13. package/dist/{ManageUser-BnEPFSPT.js → ManageUser-AB3_Vfp_.js} +34 -33
  14. package/dist/{ManageUser-BnEPFSPT.js.map → ManageUser-AB3_Vfp_.js.map} +1 -1
  15. package/dist/{MobileTypeEventConfigModal-C34AN-IJ.js → MobileTypeEventConfigModal-BxLympIO.js} +2 -2
  16. package/dist/{MobileTypeEventConfigModal-C34AN-IJ.js.map → MobileTypeEventConfigModal-BxLympIO.js.map} +1 -1
  17. package/dist/{OtherTypeEventConfigModal-BYjMFl0-.js → OtherTypeEventConfigModal-BeG1GrUi.js} +3 -2
  18. package/dist/{OtherTypeEventConfigModal-BYjMFl0-.js.map → OtherTypeEventConfigModal-BeG1GrUi.js.map} +1 -1
  19. package/dist/{RoleManagement-B9WgZGEj.js → RoleManagement-BIiW9uTq.js} +2 -2
  20. package/dist/{RoleManagement-B9WgZGEj.js.map → RoleManagement-BIiW9uTq.js.map} +1 -1
  21. package/dist/{TypeConfiguration-Bs5WkIa2.js → TypeConfiguration-37wp-gsl.js} +2 -2
  22. package/dist/{TypeConfiguration-Bs5WkIa2.js.map → TypeConfiguration-37wp-gsl.js.map} +1 -1
  23. package/dist/{UserList-BzHsbYel.js → UserList-2gGuDgNa.js} +38 -37
  24. package/dist/{UserList-BzHsbYel.js.map → UserList-2gGuDgNa.js.map} +1 -1
  25. package/dist/{UserListSkeleton-DhIJ5X3y.js → UserListSkeleton-BMKANCtW.js} +57 -93
  26. package/dist/UserListSkeleton-BMKANCtW.js.map +1 -0
  27. package/dist/Users-CsJ08Kjm.js +40 -0
  28. package/dist/Users-CsJ08Kjm.js.map +1 -0
  29. package/dist/index.js +4 -4
  30. package/package.json +1 -1
  31. package/dist/AddMenuConfiguration-m3R8FDhj.js +0 -5570
  32. package/dist/AddMenuConfiguration-m3R8FDhj.js.map +0 -1
  33. package/dist/ManageRole-CZAk-IlM.js.map +0 -1
  34. package/dist/UserListSkeleton-DhIJ5X3y.js.map +0 -1
@@ -1,114 +1,119 @@
1
- import { jsxs as o, jsx as a, Fragment as A } from "react/jsx-runtime";
1
+ import { jsxs as l, jsx as a, Fragment as P } from "react/jsx-runtime";
2
2
  import { useRef as X, useState as J, useEffect as he } from "react";
3
3
  import { Modal as ge, Box as H, IconButton as fe, FormControl as y, FormGroup as pe, Button as Q } from "@mui/material";
4
4
  import ye from "@/hooks/useTrackEvent";
5
- import { g as be, a as ve, b as we } from "./RoleManagement-B9WgZGEj.js";
5
+ import { g as be, a as ve, b as we } from "./RoleManagement-BIiW9uTq.js";
6
6
  import { getRoleList as Ne, getLocationTypes as Te, execute as O } from "@/common/services/GlobalApis";
7
- import { showToast as W } from "@/common/toaster/toaster";
7
+ import { showToast as j } from "@/common/toaster/toaster";
8
8
  import { useForm as Ie } from "react-hook-form";
9
9
  import { yupResolver as xe } from "@hookform/resolvers/yup";
10
10
  import "@/assets/scss/scrollBar.scss";
11
11
  import { FormItem as d } from "@/views/custom-components/FormItem.jsx";
12
- import * as v from "yup";
13
- import j from "@/views/custom-components/CustomTextField";
12
+ import * as b from "yup";
13
+ import W from "@/views/custom-components/CustomTextField";
14
14
  import Z from "@/views/custom-components/CustomDropdown";
15
15
  import $ from "@/views/custom-components/CustomCheckBox";
16
16
  import x from "@/views/custom-components/CustomAutoComplete";
17
17
  import { useTranslateProvider as Re } from "@/common/languageTranslator/TranslationContext";
18
18
  import { FontAwesomeIcon as Me } from "@fortawesome/react-fontawesome";
19
19
  import { faXmark as Be } from "@fortawesome/free-solid-svg-icons";
20
- import Ce from "@/common/services/util/GeneralUtil";
20
+ import qe from "@/common/services/util/GeneralUtil";
21
21
  import f from "@/common/config/implementationConfig";
22
- import b from "prop-types";
22
+ import v from "prop-types";
23
23
  import z from "@/views/custom-components/CustomToggleSwitch";
24
- import { useSelector as ke } from "react-redux";
25
- import { getUseSkeleton as qe } from "@/store/reducers/SkeletonReducer";
26
- const ee = ({ children: N, isLoading: p }) => !ke(qe) || !p ? N : /* @__PURE__ */ o("div", { className: "pt-6 h-[88vh]", children: [
27
- /* @__PURE__ */ o("div", { className: "px-8 pt-2 pb-4 flex items-center justify-between", children: [
24
+ import { useSelector as Fe } from "react-redux";
25
+ import { getUseSkeleton as Ce } from "@/store/reducers/SkeletonReducer";
26
+ const ee = ({ children: N, isLoading: p }) => !Fe(Ce) || !p ? N : /* @__PURE__ */ l("div", { className: "pt-6 h-[88vh]", children: [
27
+ /* @__PURE__ */ l("div", { className: "px-8 pt-2 pb-4 flex items-center justify-between", children: [
28
28
  /* @__PURE__ */ a("div", { className: "bg-gray-300 animate-pulse rounded-md w-32 h-8" }),
29
29
  /* @__PURE__ */ a("div", { className: "bg-gray-300 animate-pulse rounded-full w-10 h-10" })
30
30
  ] }),
31
- /* @__PURE__ */ o("div", { className: "px-8 pb-8 space-y-6 overflow-y-auto max-h-[80vh]", children: [
32
- /* @__PURE__ */ a("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [1, 2, 3].map((u) => /* @__PURE__ */ o("div", { className: "space-y-1.5", children: [
31
+ /* @__PURE__ */ l("div", { className: "px-8 pb-8 space-y-6 overflow-y-auto max-h-[80vh]", children: [
32
+ /* @__PURE__ */ a("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [1, 2, 3].map((u) => /* @__PURE__ */ l("div", { className: "space-y-1.5", children: [
33
33
  /* @__PURE__ */ a("div", { className: "h-4 bg-gray-300 rounded w-1/3 mb-2 animate-pulse" }),
34
34
  /* @__PURE__ */ a("div", { className: "h-10 bg-gray-300 rounded animate-pulse w-full" })
35
35
  ] }, u)) }),
36
- /* @__PURE__ */ a("div", { className: "flex items-center gap-6 w-full", children: /* @__PURE__ */ o("div", { className: "w-full", children: [
36
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-6 w-full", children: /* @__PURE__ */ l("div", { className: "w-full", children: [
37
37
  /* @__PURE__ */ a("div", { className: "h-4 bg-gray-300 rounded w-1/4 mb-2 animate-pulse" }),
38
38
  /* @__PURE__ */ a("div", { className: "h-8 bg-gray-300 rounded-full w-16 animate-pulse" })
39
39
  ] }) }),
40
- /* @__PURE__ */ o("div", { className: "space-y-4", children: [
41
- [1, 2].map((u) => /* @__PURE__ */ o("div", { className: "space-y-1.5", children: [
40
+ /* @__PURE__ */ l("div", { className: "space-y-4", children: [
41
+ [1, 2].map((u) => /* @__PURE__ */ l("div", { className: "space-y-1.5", children: [
42
42
  /* @__PURE__ */ a("div", { className: "h-4 bg-gray-300 rounded w-1/4 mb-2 animate-pulse" }),
43
43
  /* @__PURE__ */ a("div", { className: "h-10 bg-gray-300 rounded animate-pulse w-full" })
44
44
  ] }, u)),
45
- /* @__PURE__ */ a("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [1, 2].map((u) => /* @__PURE__ */ o("div", { className: "space-y-1.5", children: [
45
+ /* @__PURE__ */ a("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [1, 2].map((u) => /* @__PURE__ */ l("div", { className: "space-y-1.5", children: [
46
46
  /* @__PURE__ */ a("div", { className: "h-4 bg-gray-300 rounded w-1/3 mb-2 animate-pulse" }),
47
47
  /* @__PURE__ */ a("div", { className: "h-10 bg-gray-300 rounded animate-pulse w-full" })
48
48
  ] }, u)) }),
49
- [1, 2].map((u) => /* @__PURE__ */ o("div", { className: "space-y-1.5", children: [
49
+ [1, 2].map((u) => /* @__PURE__ */ l("div", { className: "space-y-1.5", children: [
50
50
  /* @__PURE__ */ a("div", { className: "h-4 bg-gray-300 rounded w-1/3 mb-2 animate-pulse" }),
51
51
  /* @__PURE__ */ a("div", { className: "h-10 bg-gray-300 rounded animate-pulse w-full" })
52
52
  ] }, u))
53
53
  ] }),
54
- /* @__PURE__ */ o("div", { className: "flex items-center gap-6", children: [
55
- /* @__PURE__ */ o("div", { className: "w-[60%]", children: [
54
+ /* @__PURE__ */ l("div", { className: "flex items-center gap-6", children: [
55
+ /* @__PURE__ */ l("div", { className: "w-[60%]", children: [
56
56
  /* @__PURE__ */ a("div", { className: "h-4 bg-gray-300 rounded w-1/3 mb-2 animate-pulse" }),
57
57
  /* @__PURE__ */ a("div", { className: "h-8 bg-gray-300 rounded-full w-16 animate-pulse" })
58
58
  ] }),
59
- /* @__PURE__ */ o("div", { className: "w-[40%] flex items-center gap-2", children: [
59
+ /* @__PURE__ */ l("div", { className: "w-[40%] flex items-center gap-2", children: [
60
60
  /* @__PURE__ */ a("div", { className: "h-5 w-5 bg-gray-300 rounded animate-pulse" }),
61
61
  /* @__PURE__ */ a("div", { className: "h-4 bg-gray-300 rounded w-1/3 animate-pulse" })
62
62
  ] })
63
63
  ] }),
64
- /* @__PURE__ */ o("div", { className: "space-y-2", children: [
64
+ /* @__PURE__ */ l("div", { className: "space-y-2", children: [
65
65
  /* @__PURE__ */ a("div", { className: "h-4 bg-gray-300 rounded w-1/4 mb-2 animate-pulse" }),
66
- /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-4", children: [1, 2, 3, 4].map((u) => /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
66
+ /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-4", children: [1, 2, 3, 4].map((u) => /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
67
67
  /* @__PURE__ */ a("div", { className: "h-5 w-5 bg-gray-300 rounded animate-pulse" }),
68
68
  /* @__PURE__ */ a("div", { className: "h-4 w-16 bg-gray-300 rounded animate-pulse" })
69
69
  ] }, u)) })
70
70
  ] })
71
71
  ] }),
72
- /* @__PURE__ */ o("div", { className: "flex items-center justify-end gap-3 pt-6 px-8 pb-4 border-t border-slate-100", children: [
72
+ /* @__PURE__ */ l("div", { className: "flex items-center justify-end gap-3 pt-6 px-8 pb-4 border-t border-slate-100", children: [
73
73
  /* @__PURE__ */ a("div", { className: "h-9 w-20 bg-gray-300 rounded animate-pulse" }),
74
74
  /* @__PURE__ */ a("div", { className: "h-9 w-24 bg-gray-300 rounded animate-pulse" })
75
75
  ] })
76
76
  ] });
77
77
  ee.propTypes = {
78
- children: b.any,
79
- isLoading: b.any
78
+ children: v.any,
79
+ isLoading: v.any
80
80
  };
81
- const Fe = [{ name: "WEB" }, { name: "MOBILE" }, { name: "BOTH" }], Le = [
81
+ const ke = [{ name: "WEB" }, { name: "MOBILE" }, { name: "BOTH" }], Le = [
82
82
  { label: "Authenticator App", value: "AUTHENTICATOR_APP" }
83
83
  ], De = ({
84
84
  selectedId: N,
85
85
  isUpdate: p,
86
- open: C,
86
+ open: q,
87
87
  setOpen: u,
88
88
  isRoleListModified: ae
89
89
  }) => {
90
- const G = X(null), V = X(!1), D = ye(), [w, U] = J({}), [te, S] = J(!1), le = v.object().shape({
91
- name: v.string().required("Enter Role Name"),
92
- locationTypes: v.array().when("isLocationRequired", {
90
+ const G = X(null), V = X(!1), D = ye(), [w, U] = J({}), [te, S] = J(!1), le = b.object().shape({
91
+ name: b.string().required("Enter Role Name"),
92
+ locationTypes: b.array().when("isLocationRequired", {
93
93
  is: !0,
94
94
  then: (e) => e.min(1, "Select Location Type").required("Select Location Type"),
95
95
  otherwise: (e) => e.notRequired()
96
96
  }),
97
- roleType: f.role.showRoleType ? v.string().required("Select Role Type") : v.string().notRequired(),
98
- isBankDetailsRequired: f.role.showBankDetailsRequired ? v.boolean().nullable().defined("Please Select a Value") : v.boolean().notRequired(),
99
- healthInfrastructureIds: v.array().when("isHealthInfraMandatory", {
97
+ roleType: f.role.showRoleType ? b.string().required("Select Role Type") : b.string().notRequired(),
98
+ isBankDetailsRequired: f.role.showBankDetailsRequired ? b.boolean().nullable().defined("Please Select a Value") : b.boolean().notRequired(),
99
+ healthInfrastructureIds: b.array().when("isHealthInfraMandatory", {
100
100
  is: !0,
101
101
  then: (e) => e.min(1, "Select Health Infrastructure Type").required("Select Health Infrastructure Type"),
102
102
  otherwise: (e) => e.notRequired()
103
+ }),
104
+ twoFactorType: b.string().when("isTwoFactorEnabled", {
105
+ is: !0,
106
+ then: (e) => e.required("Select Authentication Method"),
107
+ otherwise: (e) => e.notRequired().nullable()
103
108
  })
104
109
  }), {
105
110
  control: n,
106
111
  handleSubmit: oe,
107
- formState: { errors: c, isSubmitting: se },
112
+ formState: { errors: c, isSubmitting: re },
108
113
  setValue: h,
109
114
  // getValues,
110
115
  watch: T,
111
- reset: re
116
+ reset: se
112
117
  } = Ie({
113
118
  defaultValues: {
114
119
  name: "",
@@ -148,7 +153,7 @@ const Fe = [{ name: "WEB" }, { name: "MOBILE" }, { name: "BOTH" }], Le = [
148
153
  resolver: xe(le),
149
154
  mode: "onChange",
150
155
  shouldUnregister: !1
151
- }), ne = T("isBankDetailsRequired"), ie = T("isTwoFactorEnabled"), Y = T("roleType"), de = Y === "WEB" || Y === "BOTH", _ = T("locationTypes"), { translate: E } = Re(), ce = T("isLocationRequired"), me = T("isHealthInfraMandatory"), P = [
156
+ }), ne = T("isBankDetailsRequired"), ie = T("isTwoFactorEnabled"), Y = T("roleType"), de = Y === "WEB" || Y === "BOTH", _ = T("locationTypes"), { translate: E } = Re(), ce = T("isLocationRequired"), me = T("isHealthInfraMandatory"), A = [
152
157
  { label: "Email", value: "isEmailMandatory" },
153
158
  { label: "Aadhar Number", value: "isAadharNumMandatory" },
154
159
  { label: "Contact Number", value: "isContactNumMandatory" },
@@ -161,8 +166,8 @@ const Fe = [{ name: "WEB" }, { name: "MOBILE" }, { name: "BOTH" }], Le = [
161
166
  ].filter((e) => {
162
167
  var t;
163
168
  return ((t = f.role.mandatoryFieldsToExclude) == null ? void 0 : t.length) > 0 ? !f.role.mandatoryFieldsToExclude.includes(e.value) : !0;
164
- }), k = () => {
165
- u(0), re(), D("conversion_event", {
169
+ }), F = () => {
170
+ u(0), se(), D("conversion_event", {
166
171
  form: G.current,
167
172
  form_name: "Manage Role",
168
173
  submit: V.current
@@ -180,18 +185,18 @@ const Fe = [{ name: "WEB" }, { name: "MOBILE" }, { name: "BOTH" }], Le = [
180
185
  button_name: p ? "update role button" : "add role button",
181
186
  button_type: "submit",
182
187
  button_id: "managerole-add-button"
183
- }), delete e.bankDetailsRequired, delete e.bankDetailsMandatory, e.roleType !== "WEB" && e.roleType !== "BOTH" && (e.isTwoFactorEnabled = !1), e.isTwoFactorEnabled ? e.twoFactorType || (e.twoFactorType = "AUTHENTICATOR_APP") : e.twoFactorType = null, p || (delete e.id, delete e.state, delete e.createdOn, delete e.createdBy, delete e.code, delete e.description, delete e.assignedFeatures, delete e.assignedFeatureList), e.roleIds = e.roleIds.map((l) => l == null ? void 0 : l.id), e.canManageRoleIds = e.canManageRoleIds.map((l) => l == null ? void 0 : l.id), e.manageByTeamTypeIds = e.manageByTeamTypeIds.map(
184
- (l) => l == null ? void 0 : l.id
188
+ }), delete e.bankDetailsRequired, delete e.bankDetailsMandatory, e.roleType !== "WEB" && e.roleType !== "BOTH" && (e.isTwoFactorEnabled = !1), e.isTwoFactorEnabled ? e.twoFactorType || (e.twoFactorType = "AUTHENTICATOR_APP") : e.twoFactorType = null, p || (delete e.id, delete e.state, delete e.createdOn, delete e.createdBy, delete e.code, delete e.description, delete e.assignedFeatures, delete e.assignedFeatureList), e.roleIds = e.roleIds.map((o) => o == null ? void 0 : o.id), e.canManageRoleIds = e.canManageRoleIds.map((o) => o == null ? void 0 : o.id), e.manageByTeamTypeIds = e.manageByTeamTypeIds.map(
189
+ (o) => o == null ? void 0 : o.id
185
190
  ), e.healthInfrastructureIds = e.healthInfrastructureIds.map(
186
- (l) => l == null ? void 0 : l.id
187
- ), e.categoryIds = e.categoryIds.map((l) => l == null ? void 0 : l.id), e.locationTypes = e.isLocationRequired === !0 ? e.locationTypes : [], delete e.isLocationRequired, e.manageByRoleIds = e.roleIds, p ? await ve(e) : await we(e), W({
191
+ (o) => o == null ? void 0 : o.id
192
+ ), e.categoryIds = e.categoryIds.map((o) => o == null ? void 0 : o.id), e.locationTypes = e.isLocationRequired === !0 ? e.locationTypes : [], delete e.isLocationRequired, e.manageByRoleIds = e.roleIds, p ? await ve(e) : await we(e), j({
188
193
  type: "success",
189
194
  message: `Role ${p ? "Updated" : "Added"} Successfully`
190
- }), V.current = !0, k(), ae();
191
- } catch (l) {
192
- W({
195
+ }), V.current = !0, F(), ae();
196
+ } catch (o) {
197
+ j({
193
198
  type: "error",
194
- message: `Role Cannot be added: ${(i = (t = l == null ? void 0 : l.response) == null ? void 0 : t.data) == null ? void 0 : i.message}`
199
+ message: `Role Cannot be added: ${(i = (t = o == null ? void 0 : o.response) == null ? void 0 : t.data) == null ? void 0 : i.message}`
195
200
  });
196
201
  }
197
202
  };
@@ -199,9 +204,9 @@ const Fe = [{ name: "WEB" }, { name: "MOBILE" }, { name: "BOTH" }], Le = [
199
204
  (async () => {
200
205
  try {
201
206
  S((i) => !i);
202
- const t = Ce.getEnv();
203
- if (C !== 0) {
204
- const [i, l, q, F, L] = await Promise.all([
207
+ const t = qe.getEnv();
208
+ if (q !== 0) {
209
+ const [i, o, C, k, L] = await Promise.all([
205
210
  Ne(),
206
211
  Te(),
207
212
  O({
@@ -228,14 +233,14 @@ const Fe = [{ name: "WEB" }, { name: "MOBILE" }, { name: "BOTH" }], Le = [
228
233
  return {
229
234
  ...g,
230
235
  roles: i.data,
231
- locationData: l.data,
232
- manageTeam: (R = q == null ? void 0 : q.data) == null ? void 0 : R.result,
233
- category: (M = F == null ? void 0 : F.data) == null ? void 0 : M.result,
236
+ locationData: o.data,
237
+ manageTeam: (R = C == null ? void 0 : C.data) == null ? void 0 : R.result,
238
+ category: (M = k == null ? void 0 : k.data) == null ? void 0 : M.result,
234
239
  healthInfraType: (B = L == null ? void 0 : L.data) == null ? void 0 : B.result
235
240
  };
236
241
  }), N) {
237
242
  const { data: g } = await be(N);
238
- U((s) => ({ ...s, roleData: g, env: t })), Object.keys(g).map((s) => h(s, g[s])), h("isBankDetailsRequired", g.isBankDetailsRequired), h("isBankDetailsMandatory", g.isBankDetailsMandatory);
243
+ U((r) => ({ ...r, roleData: g, env: t })), Object.keys(g).map((r) => h(r, g[r])), h("isBankDetailsRequired", g.isBankDetailsRequired), h("isBankDetailsMandatory", g.isBankDetailsMandatory);
239
244
  const {
240
245
  manageByTeamTypeIds: R,
241
246
  healthInfrastructureIds: M,
@@ -245,65 +250,65 @@ const Fe = [{ name: "WEB" }, { name: "MOBILE" }, { name: "BOTH" }], Le = [
245
250
  h(
246
251
  "manageByTeamTypeIds",
247
252
  R ? R.map(
248
- (s) => {
253
+ (r) => {
249
254
  var m;
250
- return (m = q.data.result) == null ? void 0 : m.find((r) => (r == null ? void 0 : r.id) === s);
255
+ return (m = C.data.result) == null ? void 0 : m.find((s) => (s == null ? void 0 : s.id) === r);
251
256
  }
252
257
  ) : []
253
258
  ), h(
254
259
  "healthInfrastructureIds",
255
260
  M ? M.map(
256
- (s) => {
261
+ (r) => {
257
262
  var m;
258
263
  return (m = L.data.result) == null ? void 0 : m.find(
259
- (r) => (r == null ? void 0 : r.id) === s
264
+ (s) => (s == null ? void 0 : s.id) === r
260
265
  );
261
266
  }
262
- ).filter((s) => s !== void 0) : []
267
+ ).filter((r) => r !== void 0) : []
263
268
  ), h(
264
269
  "categoryIds",
265
270
  K ? K.map(
266
- (s) => {
271
+ (r) => {
267
272
  var m;
268
- return (m = F.data.result) == null ? void 0 : m.find((r) => (r == null ? void 0 : r.id) === s);
273
+ return (m = k.data.result) == null ? void 0 : m.find((s) => (s == null ? void 0 : s.id) === r);
269
274
  }
270
275
  ) : []
271
276
  ), h(
272
277
  "roleIds",
273
- B ? B.map((s) => {
278
+ B ? B.map((r) => {
274
279
  var m;
275
- return (m = i.data) == null ? void 0 : m.find((r) => (r == null ? void 0 : r.id) === s);
276
- }).filter((s) => s !== void 0) : []
280
+ return (m = i.data) == null ? void 0 : m.find((s) => (s == null ? void 0 : s.id) === r);
281
+ }).filter((r) => r !== void 0) : []
277
282
  ), h(
278
283
  "canManageRoleIds",
279
- g.canManageRoleIds ? g.canManageRoleIds.map((s) => {
284
+ g.canManageRoleIds ? g.canManageRoleIds.map((r) => {
280
285
  var m;
281
- return (m = i.data) == null ? void 0 : m.find((r) => (r == null ? void 0 : r.id) === s);
282
- }).filter((s) => s !== void 0) : []
286
+ return (m = i.data) == null ? void 0 : m.find((s) => (s == null ? void 0 : s.id) === r);
287
+ }).filter((r) => r !== void 0) : []
283
288
  ), g.locationTypes.length > 0 ? h("isLocationRequired", !0) : h("isLocationRequired", !1);
284
289
  }
285
290
  }
286
291
  S((i) => !i);
287
292
  } catch (t) {
288
- W({
293
+ j({
289
294
  message: `Error in manage role :${t == null ? void 0 : t.message}`,
290
295
  type: "error"
291
296
  }), S((i) => !i);
292
297
  }
293
298
  })();
294
- }, [N, C]), /* @__PURE__ */ a(
299
+ }, [N, q]), /* @__PURE__ */ a(
295
300
  ge,
296
301
  {
297
- open: C !== 0,
298
- onClose: k,
302
+ open: q !== 0,
303
+ onClose: F,
299
304
  "data-testid": "managerole-modal",
300
305
  children: /* @__PURE__ */ a("div", { className: "mt-10 fixed inset-0 z-[100] flex items-center justify-center p-4 animate-in fade-in duration-200", children: /* @__PURE__ */ a(
301
306
  H,
302
307
  {
303
308
  className: "w-full max-w-2xl rounded-[2.5rem] shadow-2xl shadow-blue-900/10 overflow-hidden flex flex-col animate-in zoom-in-95 duration-300",
304
309
  sx: { bgcolor: (e) => e.palette.custom.customBackground },
305
- children: /* @__PURE__ */ o(ee, { isLoading: te, children: [
306
- /* @__PURE__ */ o("div", { className: "px-8 pt-8 pb-4 flex items-center justify-between", children: [
310
+ children: /* @__PURE__ */ l(ee, { isLoading: te, children: [
311
+ /* @__PURE__ */ l("div", { className: "px-8 pt-8 pb-4 flex items-center justify-between", children: [
307
312
  /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
308
313
  H,
309
314
  {
@@ -317,23 +322,23 @@ const Fe = [{ name: "WEB" }, { name: "MOBILE" }, { name: "BOTH" }], Le = [
317
322
  fe,
318
323
  {
319
324
  size: "small",
320
- onClick: k,
325
+ onClick: F,
321
326
  className: "w-10 h-10 rounded-full bg-slate-100 flex items-center justify-center text-slate-400 hover:bg-slate-200 hover:text-slate-600 transition-all",
322
327
  "data-testid": "managerole-close-icon",
323
328
  children: /* @__PURE__ */ a(Me, { icon: Be, size: "lg" })
324
329
  }
325
330
  )
326
331
  ] }),
327
- /* @__PURE__ */ o(
332
+ /* @__PURE__ */ l(
328
333
  "form",
329
334
  {
330
335
  onSubmit: oe(ue),
331
336
  ref: G,
332
337
  className: "px-8 pb-8 space-y-6 overflow-y-auto max-h-[80vh]",
333
338
  children: [
334
- /* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
339
+ /* @__PURE__ */ l("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
335
340
  /* @__PURE__ */ a(y, { variant: "outlined", children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: /* @__PURE__ */ a(d, { label: "Role Name", children: /* @__PURE__ */ a(
336
- j,
341
+ W,
337
342
  {
338
343
  placeholder: "Role Name",
339
344
  name: "name",
@@ -349,7 +354,7 @@ const Fe = [{ name: "WEB" }, { name: "MOBILE" }, { name: "BOTH" }], Le = [
349
354
  label: "Max Position",
350
355
  tooltip: "This is the maximum no of users that can be created at one location of this role type",
351
356
  children: /* @__PURE__ */ a(
352
- j,
357
+ W,
353
358
  {
354
359
  name: "maxPosition",
355
360
  id: "maxPosition",
@@ -373,7 +378,7 @@ const Fe = [{ name: "WEB" }, { name: "MOBILE" }, { name: "BOTH" }], Le = [
373
378
  }
374
379
  ) }) }),
375
380
  f.role.showMaxHealthData && /* @__PURE__ */ a(y, { variant: "outlined", children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: /* @__PURE__ */ a(d, { label: "Max Health Infrastructure", children: /* @__PURE__ */ a(
376
- j,
381
+ W,
377
382
  {
378
383
  name: "maxHealthInfra",
379
384
  id: "maxHealthInfra",
@@ -425,8 +430,8 @@ const Fe = [{ name: "WEB" }, { name: "MOBILE" }, { name: "BOTH" }], Le = [
425
430
  )
426
431
  }
427
432
  ) }),
428
- /* @__PURE__ */ o("div", { className: "space-y-4", children: [
429
- (ce === !0 || se) && /* @__PURE__ */ a(A, { children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: /* @__PURE__ */ a(
433
+ /* @__PURE__ */ l("div", { className: "space-y-4", children: [
434
+ (ce === !0 || re) && /* @__PURE__ */ a(P, { children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: /* @__PURE__ */ a(
430
435
  d,
431
436
  {
432
437
  label: "Location",
@@ -496,7 +501,7 @@ const Fe = [{ name: "WEB" }, { name: "MOBILE" }, { name: "BOTH" }], Le = [
496
501
  )
497
502
  }
498
503
  ) }),
499
- /* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
504
+ /* @__PURE__ */ l("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
500
505
  f.role.showRoleType && /* @__PURE__ */ a("div", { className: "space-y-1.5", children: /* @__PURE__ */ a(
501
506
  d,
502
507
  {
@@ -509,7 +514,7 @@ const Fe = [{ name: "WEB" }, { name: "MOBILE" }, { name: "BOTH" }], Le = [
509
514
  control: n,
510
515
  id: "roleType",
511
516
  name: "roleType",
512
- options: Fe,
517
+ options: ke,
513
518
  displayName: "name",
514
519
  optionValue: "name",
515
520
  errors: c,
@@ -560,7 +565,7 @@ const Fe = [{ name: "WEB" }, { name: "MOBILE" }, { name: "BOTH" }], Le = [
560
565
  )
561
566
  }
562
567
  ) }) }),
563
- f.role.showCategoryIds && /* @__PURE__ */ a(A, { children: /* @__PURE__ */ a("div", { className: "space-y-4", children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: /* @__PURE__ */ a(
568
+ f.role.showCategoryIds && /* @__PURE__ */ a(P, { children: /* @__PURE__ */ a("div", { className: "space-y-4", children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: /* @__PURE__ */ a(
564
569
  d,
565
570
  {
566
571
  label: "Category",
@@ -581,7 +586,7 @@ const Fe = [{ name: "WEB" }, { name: "MOBILE" }, { name: "BOTH" }], Le = [
581
586
  }
582
587
  ) }) }) })
583
588
  ] }),
584
- /* @__PURE__ */ o("div", { className: "flex items-center gap-6", children: [
589
+ /* @__PURE__ */ l("div", { className: "flex items-center gap-6", children: [
585
590
  f.role.showBankDetailsRequired && /* @__PURE__ */ a(
586
591
  y,
587
592
  {
@@ -612,26 +617,20 @@ const Fe = [{ name: "WEB" }, { name: "MOBILE" }, { name: "BOTH" }], Le = [
612
617
  )
613
618
  }
614
619
  ),
615
- !p && /* @__PURE__ */ a(A, { children: /* @__PURE__ */ a(y, { variant: "outlined ", className: "w-[40%]", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ a(
616
- d,
617
- {
618
- label: "Self Manage",
619
- labelWidth: "60%",
620
- childrenWidth: "40%",
621
- direction: "row",
622
- children: /* @__PURE__ */ a(
623
- $,
624
- {
625
- name: "canSelfManage",
626
- control: n,
627
- isFullWidth: !1,
628
- "data-testid": "managerole-self-manage-checkbox"
629
- }
630
- )
631
- }
632
- ) }) }) })
620
+ !p && /* @__PURE__ */ a(P, { children: /* @__PURE__ */ a(y, { variant: "outlined ", className: "w-[40%]", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
621
+ /* @__PURE__ */ a("label", { className: "text-sm font-medium text-gray-700", children: "Self Manage" }),
622
+ /* @__PURE__ */ a(
623
+ $,
624
+ {
625
+ name: "canSelfManage",
626
+ control: n,
627
+ isFullWidth: !1,
628
+ "data-testid": "managerole-self-manage-checkbox"
629
+ }
630
+ )
631
+ ] }) }) })
633
632
  ] }),
634
- de && /* @__PURE__ */ o("div", { className: "flex items-center gap-6 w-full", children: [
633
+ de && /* @__PURE__ */ l("div", { className: "flex items-center gap-6 w-full", children: [
635
634
  /* @__PURE__ */ a(
636
635
  y,
637
636
  {
@@ -666,6 +665,7 @@ const Fe = [{ name: "WEB" }, { name: "MOBILE" }, { name: "BOTH" }], Le = [
666
665
  {
667
666
  label: "Authentication Method",
668
667
  tooltip: "Select which authentication method users of this role will use",
668
+ required: !0,
669
669
  children: /* @__PURE__ */ a(
670
670
  Z,
671
671
  {
@@ -692,8 +692,8 @@ const Fe = [{ name: "WEB" }, { name: "MOBILE" }, { name: "BOTH" }], Le = [
692
692
  {
693
693
  label: "Mandatory Fields",
694
694
  tooltip: "These fields are Mandatory when creating users of this role type",
695
- children: /* @__PURE__ */ o(pe, { row: !0, children: [
696
- P == null ? void 0 : P.map((e) => /* @__PURE__ */ a(
695
+ children: /* @__PURE__ */ l(pe, { row: !0, children: [
696
+ A == null ? void 0 : A.map((e) => /* @__PURE__ */ a(
697
697
  $,
698
698
  {
699
699
  control: n,
@@ -719,7 +719,7 @@ const Fe = [{ name: "WEB" }, { name: "MOBILE" }, { name: "BOTH" }], Le = [
719
719
  )
720
720
  }
721
721
  ) }),
722
- /* @__PURE__ */ o(
722
+ /* @__PURE__ */ l(
723
723
  H,
724
724
  {
725
725
  className: "flex items-center justify-end gap-3 pt-6 border-t",
@@ -731,7 +731,7 @@ const Fe = [{ name: "WEB" }, { name: "MOBILE" }, { name: "BOTH" }], Le = [
731
731
  variant: "contained",
732
732
  color: "secondary",
733
733
  size: "small",
734
- onClick: k,
734
+ onClick: F,
735
735
  "data-testid": "managerole-close-button",
736
736
  children: E("Close")
737
737
  }
@@ -760,15 +760,15 @@ const Fe = [{ name: "WEB" }, { name: "MOBILE" }, { name: "BOTH" }], Le = [
760
760
  );
761
761
  };
762
762
  De.propTypes = {
763
- isUpdate: b.bool,
764
- role: b.object,
765
- onClose: b.func,
766
- open: b.bool,
767
- setOpen: b.func,
768
- selectedId: b.string,
769
- isRoleListModified: b.bool
763
+ isUpdate: v.bool,
764
+ role: v.object,
765
+ onClose: v.func,
766
+ open: v.bool,
767
+ setOpen: v.func,
768
+ selectedId: v.string,
769
+ isRoleListModified: v.bool
770
770
  };
771
771
  export {
772
772
  De as default
773
773
  };
774
- //# sourceMappingURL=ManageRole-CZAk-IlM.js.map
774
+ //# sourceMappingURL=ManageRole-B9bs_T00.js.map