mario-core 2.0.127-release → 2.0.128-release

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/Dashboard-Dn1Xl7SC.js +1 -0
  2. package/dist/Dashboard-DxrE_UdE.mjs +206 -0
  3. package/dist/EmailTemplateDetail-BxDmv_IB.mjs +443 -0
  4. package/dist/EmailTemplateDetail-c2h1KwyT.js +1 -0
  5. package/dist/EmailTemplateList-C6KbuCHO.mjs +170 -0
  6. package/dist/EmailTemplateList-Dk7gCfdy.js +1 -0
  7. package/dist/GalleryList-CG-GA7Go.mjs +329 -0
  8. package/dist/GalleryList-p6WP3Krc.js +1 -0
  9. package/dist/Login-BMRuV2H4.js +1 -0
  10. package/dist/Login-Ch1dKH9m.mjs +1700 -0
  11. package/dist/NotificationList-51yt2V-v.js +1 -0
  12. package/dist/NotificationList-bZsuTSkC.mjs +419 -0
  13. package/dist/SkillList-BQM2FIla.mjs +386 -0
  14. package/dist/SkillList-BxqOHumi.js +1 -0
  15. package/dist/TeacherSelector-CrH5Ji_R.mjs +30 -0
  16. package/dist/TeacherSelector-DYwwL8rL.js +1 -0
  17. package/dist/TheContent-B_P8fq4J.mjs +38 -0
  18. package/dist/TheContent-C5I2GeSi.js +1 -0
  19. package/dist/UserContainer-JB0zF0Be.js +5 -0
  20. package/dist/UserContainer-QmPiHlko.mjs +2698 -0
  21. package/dist/UserDetail-BuhWeZrj.mjs +913 -0
  22. package/dist/UserDetail-ClL8qEKG.js +1 -0
  23. package/dist/UserList-Crz4aLRP.mjs +1514 -0
  24. package/dist/UserList-DoZZeZzW.js +7 -0
  25. package/dist/constants-DF79sw6a.mjs +241 -0
  26. package/dist/constants-DSNqVx4Y.js +1 -0
  27. package/dist/index-CD8bO3wO.js +15 -0
  28. package/dist/index-CfBp3NrB.mjs +22670 -0
  29. package/dist/mailCategoryService-C9FSK6lv.js +1 -0
  30. package/dist/mailCategoryService-CRdM3FRx.mjs +11 -0
  31. package/dist/shared/gradeYear/ukYearCsv.d.ts +4 -0
  32. package/dist/userService-CDfW2VnH.js +1 -0
  33. package/dist/userService-CjQDQKT0.mjs +47 -0
  34. package/package.json +113 -113
@@ -0,0 +1,913 @@
1
+ import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
+ import { useState as b, useEffect as ee, useCallback as _ } from "react";
3
+ import { useNavigate as we, useParams as Ee } from "react-router-dom";
4
+ import { Row as A, Col as u, FormGroup as v, Input as I, Label as ne, Button as G, Modal as Se, ModalHeader as ye, ModalBody as Te, ModalFooter as Ne } from "reactstrap";
5
+ import { Formik as le } from "formik";
6
+ import Re from "react-datepicker";
7
+ import { format as me } from "date-fns";
8
+ import { ar as De, b as N, c as R, ah as g, as as ue, at as Ce, a2 as he, u as ve, s as V, _ as be, $ as F, E as M, au as Ue, av as Pe, aw as Ae, a1 as Ie, ap as _e, t as xe, an as He } from "./index-CfBp3NrB.mjs";
9
+ import { useDispatch as pe, useSelector as Oe } from "react-redux";
10
+ import { useTranslation as Be } from "react-i18next";
11
+ import { o as Le, q as ie, v as Fe, w as ke, x as Me, y as qe, z as $e, A as je, B as ze, C as Ge, D as Ve } from "./userService-CjQDQKT0.mjs";
12
+ import * as x from "yup";
13
+ import { T as Je } from "./TeacherSelector-CrH5Ji_R.mjs";
14
+ import { h as ce } from "./constants-DF79sw6a.mjs";
15
+ import "papaparse";
16
+ function Ye(o, r) {
17
+ if (r.length < o)
18
+ throw new TypeError(o + " argument required, but only " + r.length + " present");
19
+ }
20
+ function We(o) {
21
+ Ye(1, arguments);
22
+ var r = Object.prototype.toString.call(o);
23
+ return o instanceof Date || De(o) === "object" && r === "[object Date]" ? new Date(o.getTime()) : typeof o == "number" || r === "[object Number]" ? new Date(o) : ((typeof o == "string" || r === "[object String]") && typeof console < "u" && (console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"), console.warn(new Error().stack)), /* @__PURE__ */ new Date(NaN));
24
+ }
25
+ const Ke = {
26
+ id: "",
27
+ firstName: "",
28
+ lastName: "",
29
+ email: "",
30
+ dateOfBirth: "",
31
+ roles: [],
32
+ isActive: !0,
33
+ profileImageFileName: "",
34
+ teacherUserId: [],
35
+ msRoles: [],
36
+ hsRoles: [],
37
+ esRoles: []
38
+ }, de = "/admin/users/user-list", Qe = "User detail", Xe = (o) => {
39
+ const r = pe(), U = we(), [P, n] = b(Ke), [D, y] = b(!1), [q, J] = b([]), [C, Y] = b(null), [W, p] = b(!1), [K, $] = b({
40
+ isHasAssistantData: !1,
41
+ isHasCounselorData: !1,
42
+ isHasEduTeacherData: !1,
43
+ isHasSecondaryTeacherData: !1,
44
+ isHasTeacherData: !1
45
+ }), B = async () => {
46
+ localStorage.setItem(window.location.href, "true"), p(!0);
47
+ }, [Q, f] = b([]), m = () => {
48
+ y(!D);
49
+ };
50
+ ee(() => {
51
+ document.title = Qe, p(!1), localStorage.getItem(window.location.href) && localStorage.removeItem(window.location.href);
52
+ }, []), ee(() => {
53
+ o && (H(), L()), !o && S();
54
+ }, [o]);
55
+ const H = _(async () => {
56
+ r(N(!0));
57
+ try {
58
+ const s = await Le(o);
59
+ $(s.data);
60
+ } catch (s) {
61
+ r(
62
+ R({
63
+ type: "danger",
64
+ message: s.response?.data?.title || s.message
65
+ })
66
+ );
67
+ }
68
+ r(N(!1));
69
+ }, [o]), L = _(async () => {
70
+ r(N(!0));
71
+ try {
72
+ const s = await ie(o), a = (localStorage.getItem("ACTIVE_TIER") || "MS").toUpperCase(), c = (s.data?.msRoles || []).map((d) => d != "EduTeacher" ? d : g.EDUTEACHER), l = (s.data?.hsRoles || []).map((d) => d != "EduTeacher" ? d : g.EDUTEACHER), h = (s.data?.esRoles || []).map((d) => d != "EduTeacher" ? d : g.EDUTEACHER);
73
+ let T = s.data?.roles?.map((d) => d != "EduTeacher" ? d : g.EDUTEACHER) || [];
74
+ a === "HS" && l.length > 0 ? T = l : a === "MS" && c.length > 0 ? T = c : a === "ES" && h.length > 0 && (T = h), n({
75
+ ...s.data,
76
+ dateOfBirth: me(new Date(s.data.dateOfBirth), ue),
77
+ roles: T,
78
+ msRoles: c,
79
+ hsRoles: l,
80
+ esRoles: h
81
+ }), f(T), document.title = s.data?.fullName;
82
+ } catch (s) {
83
+ r(
84
+ R({
85
+ type: "danger",
86
+ message: s.response?.data?.title || s.message
87
+ })
88
+ );
89
+ }
90
+ r(N(!1));
91
+ }, [o]), S = async () => {
92
+ try {
93
+ const s = await Fe({
94
+ sortBy: "Email"
95
+ });
96
+ s.data && J(s.data.map?.((a) => ({
97
+ label: a.email,
98
+ value: a.id
99
+ })) || []);
100
+ } catch (s) {
101
+ r(
102
+ R({
103
+ type: "danger",
104
+ message: s.response?.data?.title || s.message
105
+ })
106
+ );
107
+ }
108
+ }, k = _((s) => {
109
+ U(s && typeof s == "string" ? de + `?query=${s}` : de);
110
+ }, []), j = _(
111
+ async (s) => {
112
+ r(N(!0));
113
+ try {
114
+ if (C) {
115
+ const l = new FormData(), { name: h } = C;
116
+ l.append("file", C, h);
117
+ const d = (await Ce(l))?.data?.key;
118
+ s.profileImageFileName = d;
119
+ }
120
+ const a = o ? ke : Me;
121
+ !o && delete s.id, s.dateOfBirth === "" && delete s.dateOfBirth;
122
+ const c = await a(s);
123
+ c && ie(c.data.id).then((l) => {
124
+ k(l.data.fullName);
125
+ }), o || alert("Password of " + c.data.email + ` is "${c.data.password}"`), c.data.id && await qe(c.data.id, s.gradeLevel), r(
126
+ R({
127
+ type: "success",
128
+ message: `${o ? "Update" : "Create"} user successfully`
129
+ })
130
+ );
131
+ } catch (a) {
132
+ r(
133
+ R({
134
+ type: "danger",
135
+ message: a.response?.data?.title || a.message
136
+ })
137
+ );
138
+ }
139
+ r(N(!1));
140
+ },
141
+ [o, C]
142
+ ), O = (s) => ["Student", "Parent", "EduTeacher"].includes(s), ae = async (s) => {
143
+ r(N(!0));
144
+ try {
145
+ await ze(s), r(
146
+ R({
147
+ type: "success",
148
+ message: "Change password successfully"
149
+ })
150
+ );
151
+ } catch (a) {
152
+ r(
153
+ R({
154
+ type: "danger",
155
+ message: a.response?.data?.title || a.message
156
+ })
157
+ );
158
+ }
159
+ r(N(!1));
160
+ }, te = _(async (s) => {
161
+ r(N(!0));
162
+ try {
163
+ await $e(s), r(
164
+ R({
165
+ type: "success",
166
+ message: "Send forgot password link successfully"
167
+ })
168
+ );
169
+ } catch (a) {
170
+ r(
171
+ R({
172
+ type: "danger",
173
+ message: a.response?.data?.title || a.message || "Error occured"
174
+ })
175
+ );
176
+ }
177
+ r(N(!1));
178
+ }, []), re = _(
179
+ async (s) => {
180
+ r(N(!0));
181
+ try {
182
+ const c = await je({
183
+ userId: s
184
+ });
185
+ if (c.data) {
186
+ const l = `${P.firstName} ${P.lastName}`;
187
+ alert(`Password of ${l} is ${c.data}`), r(
188
+ R({
189
+ type: "success",
190
+ message: "Update user password successfully"
191
+ })
192
+ );
193
+ }
194
+ } catch (a) {
195
+ r(
196
+ R({
197
+ type: "danger",
198
+ message: a.response?.data?.title || a.message
199
+ })
200
+ );
201
+ }
202
+ r(N(!1));
203
+ },
204
+ [P]
205
+ );
206
+ return {
207
+ userDetail: P,
208
+ backToList: k,
209
+ confirmData: j,
210
+ file: C,
211
+ setFile: Y,
212
+ edited: W,
213
+ setEdited: p,
214
+ setEditedTrue: B,
215
+ confirmChangePassword: ae,
216
+ forgotPasswordRequest: te,
217
+ currentRoles: Q,
218
+ handleDisableRoles: O,
219
+ handleResetPassword: re,
220
+ teacherOptions: q,
221
+ openModel: D,
222
+ handleToggleModel: m,
223
+ userHasData: K
224
+ };
225
+ }, Ze = x.object({
226
+ firstName: x.string().required("First name is required"),
227
+ lastName: x.string().required("Last name is required"),
228
+ email: x.string().email("Email is invalid").required("Email is required"),
229
+ roles: x.array().of(x.string()).min(1, "Role is required")
230
+ }), es = x.object({
231
+ oldPassword: x.string().required("Current password is required"),
232
+ newPassword: x.string().required("New password is required"),
233
+ confirmedNewPassword: x.string().required("Confirm password is required")
234
+ }), ss = {
235
+ currentPage: 1,
236
+ pageSize: 100
237
+ }, as = (o, r) => {
238
+ const [U, P] = b([]), [n, D] = b(!1), [y, q] = b(ss), [J, C] = b(), Y = pe(), W = _(async () => {
239
+ D(!0);
240
+ try {
241
+ const m = (await Ge(y)).data?.items || [];
242
+ P(K(m));
243
+ } catch {
244
+ Y(R({
245
+ type: "error",
246
+ message: "Cannot get roster users"
247
+ }));
248
+ }
249
+ D(!1);
250
+ }, [JSON.stringify(y)]), p = _(async () => {
251
+ if (!r) return;
252
+ const f = U.find((m) => m.value === r);
253
+ if (f) {
254
+ C(f);
255
+ return;
256
+ }
257
+ D(!0);
258
+ try {
259
+ const H = (await Ve(r)).data;
260
+ C({
261
+ label: $(H),
262
+ value: H.sourcedId
263
+ });
264
+ } catch (m) {
265
+ console.log("err:", m);
266
+ }
267
+ D(!1);
268
+ }, [r]), K = (f) => f.map((m) => ({
269
+ label: $(m),
270
+ value: m.sourcedId
271
+ })), $ = (f) => {
272
+ const m = [], { givenName: H, middleName: L, familyName: S, email: k, role: j } = f, O = [];
273
+ return H && O.push(H), L && O.push(L), S && O.push(S), O.length && m.push(O.join(" ")), k && m.push(k), `${m.join(" - ")}${j ? ` (${j})` : ""}`;
274
+ }, B = (f) => {
275
+ q((m) => ({ ...m, searchString: f }));
276
+ }, Q = _((f) => {
277
+ q({
278
+ ...y,
279
+ ...f
280
+ });
281
+ }, [JSON.stringify(y)]);
282
+ return ee(() => {
283
+ y.roles?.length && W();
284
+ }, [JSON.stringify(y)]), ee(() => {
285
+ Q({
286
+ roles: o
287
+ });
288
+ }, [JSON.stringify(o)]), ee(() => {
289
+ p();
290
+ }, [r]), {
291
+ users: U,
292
+ isLoading: n,
293
+ user: J,
294
+ handleInputChange: B
295
+ };
296
+ }, ts = ({ value: o, roles: r, onChange: U }) => {
297
+ const {
298
+ users: P,
299
+ isLoading: n,
300
+ user: D,
301
+ handleInputChange: y
302
+ } = as(r, o);
303
+ return /* @__PURE__ */ e(
304
+ he,
305
+ {
306
+ options: P,
307
+ value: D,
308
+ placeholder: "Select user",
309
+ onChange: U,
310
+ isLoading: n,
311
+ onInputChange: y
312
+ }
313
+ );
314
+ }, rs = "create_user", os = "edit_user", ns = "change_password", Ts = () => {
315
+ const { id: o } = Ee(), { getLabel: r, system: U } = ve(), P = Oe((s) => s.common.user), { t: n } = Be(), {
316
+ userDetail: D,
317
+ backToList: y,
318
+ confirmData: q,
319
+ file: J,
320
+ setFile: C,
321
+ edited: Y,
322
+ setEdited: W,
323
+ setEditedTrue: p,
324
+ confirmChangePassword: K,
325
+ forgotPasswordRequest: $,
326
+ currentRoles: B,
327
+ handleDisableRoles: Q,
328
+ handleResetPassword: f,
329
+ teacherOptions: m,
330
+ openModel: H,
331
+ handleToggleModel: L,
332
+ userHasData: S
333
+ } = Xe(o), k = {
334
+ oldPassword: "",
335
+ newPassword: "",
336
+ confirmedNewPassword: ""
337
+ }, j = n(o ? `${os}` : `${rs}`), O = n(o ? "update" : "create"), ae = () => {
338
+ var s = window.location.origin + "/api/ExportDataUser/" + o;
339
+ window.open(s);
340
+ }, te = async (s) => {
341
+ var a = {
342
+ email: s
343
+ };
344
+ $(a);
345
+ }, re = () => {
346
+ if (!o) return;
347
+ confirm("You want to reset this user's password") == !0 && f(o);
348
+ };
349
+ return /* @__PURE__ */ e(
350
+ le,
351
+ {
352
+ initialValues: D,
353
+ enableReinitialize: !0,
354
+ validationSchema: Ze,
355
+ onSubmit: (s) => {
356
+ const a = (localStorage.getItem("ACTIVE_TIER") || "MS").toUpperCase(), c = s.roles.map(
357
+ (w) => w != g.EDUTEACHER ? w : "EduTeacher"
358
+ );
359
+ let l = a;
360
+ c.includes(g.STUDENT) && s.gradeLevel && (xe.includes(s.gradeLevel) ? l = "ES" : He.includes(s.gradeLevel) ? l = "HS" : l = "MS");
361
+ const h = (l === "MS" ? c : s.msRoles || []).map((w) => w != g.EDUTEACHER ? w : "EduTeacher"), T = (l === "HS" ? c : s.hsRoles || []).map((w) => w != g.EDUTEACHER ? w : "EduTeacher"), d = (l === "ES" ? c : s.esRoles || []).map((w) => w != g.EDUTEACHER ? w : "EduTeacher");
362
+ q({
363
+ ...s,
364
+ roles: c,
365
+ msRoles: h,
366
+ hsRoles: T,
367
+ esRoles: d
368
+ }), W(!1), localStorage.getItem(window.location.href) && localStorage.removeItem(window.location.href);
369
+ },
370
+ children: (s) => {
371
+ const {
372
+ values: a,
373
+ touched: c,
374
+ errors: l,
375
+ setFieldValue: h,
376
+ handleChange: T,
377
+ handleBlur: d,
378
+ handleSubmit: w
379
+ } = s, se = (localStorage.getItem("ACTIVE_TIER") || "MS").toUpperCase(), fe = _(
380
+ (t) => {
381
+ let E;
382
+ a.roles.includes(t) ? E = a.roles.filter((X) => X !== t) : [g.STUDENT, g.PARENT].includes(t) ? E = [t] : a.roles.includes(g.STUDENT) && g.STUDENT !== t ? E = [t] : E = [...a.roles, t], h("roles", E), se === "HS" ? h("hsRoles", E) : se === "MS" ? h("msRoles", E) : se === "ES" && h("esRoles", E);
383
+ },
384
+ [a.roles, se]
385
+ );
386
+ return /* @__PURE__ */ i(
387
+ "div",
388
+ {
389
+ className: `animated fadeIn detail-buttons-padding ${_e <= 767 ? V["p-0-12"] : ""}`,
390
+ children: [
391
+ /* @__PURE__ */ e(be, { when: Y }),
392
+ /* @__PURE__ */ e("h5", { className: "mb-2", children: j }),
393
+ /* @__PURE__ */ i(A, { className: "pt-2", children: [
394
+ /* @__PURE__ */ i(u, { md: 8, children: [
395
+ /* @__PURE__ */ i(A, { children: [
396
+ /* @__PURE__ */ e(u, { md: 6, children: /* @__PURE__ */ i(v, { children: [
397
+ /* @__PURE__ */ e(
398
+ F,
399
+ {
400
+ text: n("first_name"),
401
+ className: "text-capitalize"
402
+ }
403
+ ),
404
+ /* @__PURE__ */ e(
405
+ I,
406
+ {
407
+ name: "firstName",
408
+ value: a.firstName,
409
+ onChange: (t) => {
410
+ T(t), p();
411
+ },
412
+ onBlur: d("subject"),
413
+ placeholder: n("first_name"),
414
+ className: V["input-name"]
415
+ }
416
+ ),
417
+ c.firstName && l.firstName && /* @__PURE__ */ e(
418
+ M,
419
+ {
420
+ text: l.firstName
421
+ }
422
+ )
423
+ ] }) }),
424
+ /* @__PURE__ */ e(u, { md: 6, children: /* @__PURE__ */ i(v, { children: [
425
+ /* @__PURE__ */ e(ne, { children: n("date_of_birth") }),
426
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
427
+ Re,
428
+ {
429
+ value: a.dateOfBirth,
430
+ todayButton: "Today",
431
+ peekNextMonth: !0,
432
+ showMonthDropdown: !0,
433
+ showYearDropdown: !0,
434
+ dropdownMode: "select",
435
+ selected: a.dateOfBirth ? We(
436
+ new Date(
437
+ a.dateOfBirth
438
+ )
439
+ ) : null,
440
+ onChange: (t) => {
441
+ s.setFieldValue(
442
+ "dateOfBirth",
443
+ me(
444
+ t,
445
+ ue
446
+ )
447
+ ), p();
448
+ },
449
+ placeholderText: n(
450
+ "date_of_birth"
451
+ ),
452
+ customInput: /* @__PURE__ */ e(
453
+ I,
454
+ {
455
+ type: "text",
456
+ style: {
457
+ width: "maxContent"
458
+ },
459
+ placeholder: n(
460
+ "date_of_birth"
461
+ )
462
+ }
463
+ )
464
+ }
465
+ ) })
466
+ ] }) })
467
+ ] }),
468
+ /* @__PURE__ */ i(A, { children: [
469
+ /* @__PURE__ */ e(u, { md: 6, children: /* @__PURE__ */ i(v, { children: [
470
+ /* @__PURE__ */ e(
471
+ F,
472
+ {
473
+ text: n("last_name"),
474
+ className: "text-capitalize"
475
+ }
476
+ ),
477
+ /* @__PURE__ */ e(
478
+ I,
479
+ {
480
+ name: "lastName",
481
+ value: a.lastName,
482
+ onChange: (t) => {
483
+ T(t), p();
484
+ },
485
+ onBlur: d("lastName"),
486
+ placeholder: n("last_name"),
487
+ className: V["input-name"]
488
+ }
489
+ ),
490
+ c.lastName && l.lastName && /* @__PURE__ */ e(
491
+ M,
492
+ {
493
+ text: l.lastName
494
+ }
495
+ )
496
+ ] }) }),
497
+ /* @__PURE__ */ e(u, { md: 6, children: /* @__PURE__ */ i(v, { children: [
498
+ /* @__PURE__ */ e(F, { text: n("roles") }),
499
+ /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(
500
+ u,
501
+ {
502
+ md: 12,
503
+ className: "d-flex flex-wrap align-items-center",
504
+ children: Ue.map(
505
+ (t) => /* @__PURE__ */ e(
506
+ "div",
507
+ {
508
+ className: "mr-3",
509
+ children: /* @__PURE__ */ e(
510
+ I,
511
+ {
512
+ type: "checkbox",
513
+ id: `role-checkbox-${t}`,
514
+ label: t === "SecondaryTeacher" ? "SupportTeacher" : `${t}`,
515
+ checked: a.roles.includes(
516
+ t
517
+ ),
518
+ onChange: () => {
519
+ o && (S.isHasTeacherData && t === "Teacher" || S.isHasAssistantData && t === "Assistant" || S.isHasCounselorData && t === "Counselor" || S.isHasSecondaryTeacherData && t === "SecondaryTeacher" || t == "Student" && (S.isHasAssistantData || S.isHasCounselorData || S.isHasSecondaryTeacherData || S.isHasTeacherData)) ? alert(
520
+ "Please switch data before removing the role"
521
+ ) : (fe(
522
+ t
523
+ ), p());
524
+ },
525
+ disabled: B.includes(
526
+ "Parent"
527
+ ) || B.includes(
528
+ "Student"
529
+ ) && o ? B.concat(
530
+ [
531
+ "Student",
532
+ "Parent"
533
+ ]
534
+ ).includes(
535
+ t
536
+ ) || B.every(
537
+ Q
538
+ ) : [
539
+ "Parent"
540
+ ].includes(
541
+ t
542
+ )
543
+ }
544
+ )
545
+ },
546
+ t
547
+ )
548
+ )
549
+ }
550
+ ) }),
551
+ c.roles && l.roles && /* @__PURE__ */ e(
552
+ M,
553
+ {
554
+ text: l.roles
555
+ }
556
+ )
557
+ ] }) })
558
+ ] }),
559
+ /* @__PURE__ */ i(A, { children: [
560
+ /* @__PURE__ */ e(u, { md: 6, children: /* @__PURE__ */ i(v, { children: [
561
+ /* @__PURE__ */ e(F, { text: n("email") }),
562
+ /* @__PURE__ */ e(
563
+ I,
564
+ {
565
+ name: "email",
566
+ value: a.email,
567
+ onChange: (t) => {
568
+ T(t), p();
569
+ },
570
+ onBlur: d("email"),
571
+ placeholder: n("email")
572
+ }
573
+ ),
574
+ c.email && l.email && /* @__PURE__ */ e(
575
+ M,
576
+ {
577
+ text: l.email
578
+ }
579
+ )
580
+ ] }) }),
581
+ /* @__PURE__ */ e(u, { md: 6, children: /* @__PURE__ */ i(v, { children: [
582
+ /* @__PURE__ */ e(F, { text: n("status") }),
583
+ /* @__PURE__ */ i(A, { children: [
584
+ /* @__PURE__ */ e(u, { md: 3, children: /* @__PURE__ */ e(
585
+ I,
586
+ {
587
+ id: "role-checkbox-active",
588
+ type: "radio",
589
+ name: "active",
590
+ label: n("active"),
591
+ checked: !!a && !!a.isActive,
592
+ onChange: () => {
593
+ h(
594
+ "isActive",
595
+ !0
596
+ ), p();
597
+ }
598
+ }
599
+ ) }),
600
+ /* @__PURE__ */ e(u, { md: 3, children: /* @__PURE__ */ e(
601
+ I,
602
+ {
603
+ id: "role-checkbox-inActive",
604
+ type: "radio",
605
+ name: "active",
606
+ label: n("inactive"),
607
+ checked: !!a && !a.isActive,
608
+ onChange: () => h(
609
+ "isActive",
610
+ !1
611
+ )
612
+ }
613
+ ) })
614
+ ] })
615
+ ] }) })
616
+ ] }),
617
+ a.roles.includes(g.STUDENT) && /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(u, { md: 6, children: /* @__PURE__ */ i(v, { children: [
618
+ /* @__PURE__ */ e(ne, { children: U === "UK" ? "Year" : "Grade Level" }),
619
+ /* @__PURE__ */ e(
620
+ he,
621
+ {
622
+ options: ce.map((t) => ({ ...t, label: r(t.value) })),
623
+ value: ce.map((t) => ({ ...t, label: r(t.value) })).find(
624
+ (t) => t.value == a.gradeLevel
625
+ ),
626
+ placeholder: U === "UK" ? "Year" : "Grade Level",
627
+ onChange: (t) => {
628
+ h(
629
+ "gradeLevel",
630
+ t.value
631
+ );
632
+ }
633
+ }
634
+ )
635
+ ] }) }) }),
636
+ !!o && /* @__PURE__ */ i(A, { children: [
637
+ /* @__PURE__ */ e(u, { md: 6, children: (!a.roles.includes("Admin") || a.roles.length > 1) && !!a.roles.length && /* @__PURE__ */ i(v, { children: [
638
+ /* @__PURE__ */ e(ne, { children: "Map from Roster" }),
639
+ /* @__PURE__ */ e(
640
+ ts,
641
+ {
642
+ roles: a.roles,
643
+ value: a.sourcedId,
644
+ onChange: (t) => h(
645
+ "sourcedId",
646
+ t.value
647
+ )
648
+ }
649
+ )
650
+ ] }) }),
651
+ /* @__PURE__ */ i(u, { md: 6, children: [
652
+ /* @__PURE__ */ e(
653
+ G,
654
+ {
655
+ color: "primary",
656
+ className: "w-100",
657
+ onClick: () => {
658
+ te(
659
+ a.email || ""
660
+ );
661
+ },
662
+ children: n("send_forgot_password_link")
663
+ }
664
+ ),
665
+ /* @__PURE__ */ e(
666
+ G,
667
+ {
668
+ color: "primary",
669
+ className: "w-100 mt-3",
670
+ onClick: () => re(),
671
+ children: n("reset_password")
672
+ }
673
+ ),
674
+ /* @__PURE__ */ e(
675
+ G,
676
+ {
677
+ color: "success",
678
+ className: "w-100 mt-3",
679
+ onClick: () => {
680
+ ae();
681
+ },
682
+ children: n("download_user_data")
683
+ }
684
+ )
685
+ ] })
686
+ ] })
687
+ ] }),
688
+ /* @__PURE__ */ e(u, { md: 4, children: /* @__PURE__ */ e(A, { children: /* @__PURE__ */ i(u, { md: 8, children: [
689
+ /* @__PURE__ */ e(
690
+ Pe,
691
+ {
692
+ setFile: C,
693
+ fileName: a.profileImageFileName,
694
+ onAddImage: p,
695
+ canDelete: !0,
696
+ onDelete: () => {
697
+ C(null), h(
698
+ "profileImageFileName",
699
+ ""
700
+ ), p();
701
+ }
702
+ }
703
+ ),
704
+ !J && !a.profileImageFileName && /* @__PURE__ */ e(
705
+ "img",
706
+ {
707
+ src: Ae,
708
+ style: { maxWidth: "100%" }
709
+ }
710
+ )
711
+ ] }) }) })
712
+ ] }),
713
+ P.id === o ? /* @__PURE__ */ i("div", { children: [
714
+ /* @__PURE__ */ e("h5", { className: "mt-3", children: n(`${ns}`) }),
715
+ /* @__PURE__ */ e(
716
+ le,
717
+ {
718
+ initialValues: k,
719
+ enableReinitialize: !0,
720
+ validationSchema: es,
721
+ onSubmit: (t) => {
722
+ K(t);
723
+ },
724
+ children: (t) => {
725
+ const {
726
+ values: E,
727
+ touched: X,
728
+ errors: z,
729
+ handleChange: oe,
730
+ handleSubmit: ge
731
+ } = t;
732
+ return /* @__PURE__ */ i(A, { className: "pt-2 pb-5", children: [
733
+ /* @__PURE__ */ e(u, { md: 7, children: /* @__PURE__ */ i(v, { children: [
734
+ /* @__PURE__ */ e(
735
+ F,
736
+ {
737
+ text: n(
738
+ "current_password"
739
+ ),
740
+ className: "text-capitalize"
741
+ }
742
+ ),
743
+ /* @__PURE__ */ e(
744
+ I,
745
+ {
746
+ name: "oldPassword",
747
+ type: "password",
748
+ value: E.oldPassword,
749
+ onChange: (Z) => {
750
+ oe(Z), p();
751
+ },
752
+ onBlur: d(
753
+ "subject"
754
+ ),
755
+ placeholder: n(
756
+ "current_password"
757
+ ),
758
+ className: V["input-name"]
759
+ }
760
+ ),
761
+ X.oldPassword && z.oldPassword && /* @__PURE__ */ e(
762
+ M,
763
+ {
764
+ text: z.oldPassword
765
+ }
766
+ )
767
+ ] }) }),
768
+ /* @__PURE__ */ e(u, { md: 7, children: /* @__PURE__ */ i(v, { children: [
769
+ /* @__PURE__ */ e(
770
+ F,
771
+ {
772
+ text: n(
773
+ "new_password"
774
+ ),
775
+ className: "text-capitalize"
776
+ }
777
+ ),
778
+ /* @__PURE__ */ e(
779
+ I,
780
+ {
781
+ name: "newPassword",
782
+ type: "password",
783
+ value: E.newPassword,
784
+ onChange: (Z) => {
785
+ oe(Z), p();
786
+ },
787
+ onBlur: d(
788
+ "subject"
789
+ ),
790
+ placeholder: n(
791
+ "new_password"
792
+ ),
793
+ className: V["input-name"]
794
+ }
795
+ ),
796
+ X.newPassword && z.newPassword && /* @__PURE__ */ e(
797
+ M,
798
+ {
799
+ text: z.newPassword
800
+ }
801
+ )
802
+ ] }) }),
803
+ /* @__PURE__ */ e(u, { md: 7, children: /* @__PURE__ */ i(v, { children: [
804
+ /* @__PURE__ */ e(
805
+ F,
806
+ {
807
+ text: n(
808
+ "confirm_password"
809
+ ),
810
+ className: "text-capitalize"
811
+ }
812
+ ),
813
+ /* @__PURE__ */ e(
814
+ I,
815
+ {
816
+ name: "confirmedNewPassword",
817
+ type: "password",
818
+ value: E.confirmedNewPassword,
819
+ onChange: (Z) => {
820
+ oe(Z), p();
821
+ },
822
+ onBlur: d(
823
+ "subject"
824
+ ),
825
+ placeholder: n(
826
+ "confirm_password"
827
+ ),
828
+ className: V["input-name"]
829
+ }
830
+ ),
831
+ X.confirmedNewPassword && z.confirmedNewPassword && /* @__PURE__ */ e(
832
+ M,
833
+ {
834
+ text: z.confirmedNewPassword
835
+ }
836
+ )
837
+ ] }) }),
838
+ /* @__PURE__ */ e(u, { md: 12, children: /* @__PURE__ */ e(
839
+ G,
840
+ {
841
+ color: "primary",
842
+ size: "sm",
843
+ className: "px-4 pl-1 mr-2 ml-3",
844
+ onClick: () => ge(),
845
+ children: n("save")
846
+ }
847
+ ) })
848
+ ] });
849
+ }
850
+ }
851
+ )
852
+ ] }) : null,
853
+ /* @__PURE__ */ e(
854
+ Ie,
855
+ {
856
+ confirmText: O,
857
+ onConfirm: a.roles.includes(g.STUDENT) && !o ? L : w,
858
+ onCancel: y
859
+ }
860
+ ),
861
+ /* @__PURE__ */ i(
862
+ Se,
863
+ {
864
+ centered: !0,
865
+ isOpen: H,
866
+ toggle: () => L(),
867
+ children: [
868
+ /* @__PURE__ */ e(ye, { children: "Assign Teacher" }),
869
+ /* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(
870
+ Je,
871
+ {
872
+ isMulti: !0,
873
+ value: m.filter(
874
+ (t) => a.teacherUserId?.includes(
875
+ t.value
876
+ )
877
+ ) || null,
878
+ options: m,
879
+ onChange: (t) => h(
880
+ "teacherUserId",
881
+ t.map((E) => E.value)
882
+ ),
883
+ placeholder: n("select_teacher"),
884
+ className: "flex-grow-1 mb-3"
885
+ }
886
+ ) }),
887
+ /* @__PURE__ */ i(Ne, { className: "text-right", children: [
888
+ /* @__PURE__ */ e(G, { onClick: () => L(), children: "Cancel" }),
889
+ /* @__PURE__ */ e(
890
+ G,
891
+ {
892
+ disabled: !a.teacherUserId,
893
+ color: "primary",
894
+ onClick: () => {
895
+ w();
896
+ },
897
+ children: "Assign"
898
+ }
899
+ )
900
+ ] })
901
+ ]
902
+ }
903
+ )
904
+ ]
905
+ }
906
+ );
907
+ }
908
+ }
909
+ );
910
+ };
911
+ export {
912
+ Ts as default
913
+ };