mario-education 2.0.75-staging → 2.0.76-staging

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.
@@ -0,0 +1,1133 @@
1
+ import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
+ import { Input as Ie, Label as Le } from "reactstrap";
3
+ import { setAlert as O, useTranslation as De, setLoading as H, DATE_FORMAT as Fe, getFileUrl as Oe, getStaticFileUrl as W } from "mario-core";
4
+ import { i as Be, c as xe } from "./constants-DH_6jWvS.js";
5
+ import { useState as M, useCallback as Y, useEffect as ne, useRef as qe, useMemo as He } from "react";
6
+ import { useDispatch as ke, useSelector as Se } from "react-redux";
7
+ import { Formik as Ue } from "formik";
8
+ import * as P from "yup";
9
+ import { Select as ce, MenuItem as X, CircularProgress as Ve, TextField as ue, ToggleButtonGroup as je, ToggleButton as pe, Radio as ze, Checkbox as Ge, ListItemText as Ye } from "@mui/material";
10
+ import { LocalizationProvider as Je, DatePicker as We } from "@mui/x-date-pickers";
11
+ import Ke from "moment";
12
+ import { F as fe, O as he, I as _e, V as ge, g as Xe, b as Ze, d as Qe, e as er, f as rr, h as ar, i as sr, j as Ee, s as tr, k as nr } from "./OutlinedInput-BKMQB9jE.js";
13
+ import { v as $e } from "./constants-CRUp7QNf.js";
14
+ import { D as Me } from "./DoneCheckInIcon-3Yg4kjqY.js";
15
+ import { g as or, a as ir } from "./userService-C7yjwsZq.js";
16
+ import { s as lr } from "./styles.module-BJ4dhumc.js";
17
+ import { A as cr } from "./AdapterMoment-CeMS9jLD.js";
18
+ import { V as ve } from "./Visibility-C-IdsQr2.js";
19
+ import { I as we } from "./IconButton-BWXPPeTP.js";
20
+ import { useNavigate as dr, useParams as mr } from "react-router-dom";
21
+ import { format as ur } from "date-fns";
22
+ const pr = "_name_1koi9_205", fr = "_role_1koi9_217", hr = "_item_1koi9_230", _r = "_gender_1koi9_323", gr = "_gender__item_1koi9_328", a = {
23
+ "profile-value": "_profile-value_1koi9_77",
24
+ "input-error": "_input-error_1koi9_94",
25
+ "user-profile-container-admin": "_user-profile-container-admin_1koi9_122",
26
+ "user-profile-container-admin__left": "_user-profile-container-admin__left_1koi9_135",
27
+ "user-profile-container-admin__left--information": "_user-profile-container-admin__left--information_1koi9_146",
28
+ "image-user-container": "_image-user-container_1koi9_154",
29
+ "image-user-container__image": "_image-user-container__image_1koi9_169",
30
+ "image-user-container__edit-btn": "_image-user-container__edit-btn_1koi9_176",
31
+ "image-user-container__delete-btn": "_image-user-container__delete-btn_1koi9_190",
32
+ "name-role-container": "_name-role-container_1koi9_205",
33
+ name: pr,
34
+ role: fr,
35
+ "user-profile-container-admin__left--btn-control": "_user-profile-container-admin__left--btn-control_1koi9_224",
36
+ item: hr,
37
+ "item-active": "_item-active_1koi9_246",
38
+ "user-profile-container-admin__right": "_user-profile-container-admin__right_1koi9_274",
39
+ "edit-profile-container": "_edit-profile-container_1koi9_285",
40
+ "edit-profile-container__title": "_edit-profile-container__title_1koi9_290",
41
+ "edit-profile-container__form": "_edit-profile-container__form_1koi9_297",
42
+ "edit-profile-container__form--row": "_edit-profile-container__form--row_1koi9_302",
43
+ "edit-profile-container__form--field": "_edit-profile-container__form--field_1koi9_307",
44
+ gender: _r,
45
+ gender__item: gr,
46
+ "edit-profile-container__form--width-50": "_edit-profile-container__form--width-50_1koi9_334",
47
+ "edit-profile-container__form--width-30": "_edit-profile-container__form--width-30_1koi9_337",
48
+ "edit-profile-container__form--width-70": "_edit-profile-container__form--width-70_1koi9_340",
49
+ "edit-profile-container__form--btn-group": "_edit-profile-container__form--btn-group_1koi9_343",
50
+ "btn-save": "_btn-save_1koi9_349",
51
+ "btn-cancel": "_btn-cancel_1koi9_371"
52
+ };
53
+ var K = /* @__PURE__ */ ((s) => (s.Info = "info", s.ForgotPassword = "forgotPassword", s.DownloadUserData = "downloadUserData", s.ChangePassword = "changePassword", s))(K || {});
54
+ const le = [
55
+ {
56
+ value: "info",
57
+ label: "Personal Information",
58
+ icon: "/images/user/User.svg",
59
+ isControl: !0
60
+ },
61
+ {
62
+ value: "changePassword",
63
+ label: "Change Password",
64
+ icon: "/images/user/Lock.svg",
65
+ isControl: !1
66
+ },
67
+ {
68
+ value: "forgotPassword",
69
+ label: "Send Forgot Password Link",
70
+ icon: "/images/user/Lock.svg",
71
+ isControl: !1
72
+ },
73
+ {
74
+ value: "downloadUserData",
75
+ label: "Download User Data",
76
+ icon: "/images/user/Log-out.svg",
77
+ isControl: !1
78
+ }
79
+ ], Ae = ["Admin", "Assistant", "Teacher", "Counselor", "General ED teacher", "SecondaryTeacher", "Parent", "Student"], vr = Ae, wr = Ae.filter((s) => s !== "SecondaryTeacher"), Sr = (s) => s === "both" ? ["MS", "ES"] : [s.toUpperCase()], br = (s) => s === "both" ? "ES, MS" : s.toUpperCase(), be = (s, n) => {
80
+ const u = (s || "").toUpperCase();
81
+ if (u === "ES, MS") return "both";
82
+ if (u === "ES") return "es";
83
+ if (u === "MS") return "ms";
84
+ const S = (n || []).includes("MS");
85
+ return (n || []).includes("ES") && !S ? "es" : "ms";
86
+ }, R = {
87
+ EDUTEACHER: "General ED teacher",
88
+ STUDENT: "Student"
89
+ }, Nr = [
90
+ {
91
+ value: !0,
92
+ label: "Active"
93
+ },
94
+ {
95
+ value: !1,
96
+ label: "Inactive"
97
+ }
98
+ ], Ce = [
99
+ "K",
100
+ "G",
101
+ "1",
102
+ "2",
103
+ "3",
104
+ "4",
105
+ "5",
106
+ "6",
107
+ "7",
108
+ "8",
109
+ "9",
110
+ "10",
111
+ "11",
112
+ "12",
113
+ ...Be ? ["12/13"] : [],
114
+ "13",
115
+ ...xe ? ["PCS"] : []
116
+ ], Ne = ["K", "G", "1", "2", "3", "4", "5"], ye = ["6", "7", "8", "9", "10", "11", "12", "12/13", "13", "PCS"], Pe = ["Student"], yr = P.object({
117
+ firstName: P.string().required("First name is required"),
118
+ lastName: P.string().required("Last name is required"),
119
+ email: P.string().email("Email is invalid").required("Email is required"),
120
+ appTypes: P.array().of(P.string()).min(1, "School tier is required"),
121
+ msRoles: P.array().of(P.string()).test(
122
+ "ms-role-required",
123
+ "MS role is required",
124
+ (s, n) => {
125
+ const u = be(n.parent.preferredAppType, n.parent.appTypes);
126
+ return u !== "ms" && u !== "both" ? !0 : !!s && s.length > 0;
127
+ }
128
+ ),
129
+ esRoles: P.array().of(P.string()).test(
130
+ "es-role-required",
131
+ "ES role is required",
132
+ (s, n) => {
133
+ const u = be(n.parent.preferredAppType, n.parent.appTypes);
134
+ return u !== "es" && u !== "both" ? !0 : !!s && s.length > 0;
135
+ }
136
+ ),
137
+ gradeLevel: P.string().nullable().test(
138
+ "grade-level-required",
139
+ "Grade level is required",
140
+ (s, n) => {
141
+ const u = n.parent.msRoles || [], S = n.parent.esRoles || [];
142
+ return u.includes("Student") || S.includes("Student") ? !!s : !0;
143
+ }
144
+ )
145
+ }), Tr = {
146
+ currentPage: 1,
147
+ pageSize: 100
148
+ }, Er = (s, n) => {
149
+ const [u, S] = M([]), [p, c] = M(!1), [y, g] = M(Tr), [I, N] = M(), m = ke(), B = Y(async () => {
150
+ c(!0);
151
+ try {
152
+ const l = (await or(y)).data?.items || [];
153
+ S(x(l));
154
+ } catch {
155
+ m(O({
156
+ type: "error",
157
+ message: "Cannot get roster users"
158
+ }));
159
+ }
160
+ c(!1);
161
+ }, [JSON.stringify(y)]), Z = Y(async () => {
162
+ if (!n) return;
163
+ const b = u.find((l) => l.value === n);
164
+ if (b) {
165
+ N(b);
166
+ return;
167
+ }
168
+ c(!0);
169
+ try {
170
+ const T = (await ir(n)).data;
171
+ N({
172
+ label: L(T),
173
+ value: T.sourcedId
174
+ });
175
+ } catch (l) {
176
+ console.log("err:", l);
177
+ }
178
+ c(!1);
179
+ }, [n]), x = (b) => b.map((l) => ({
180
+ label: L(l),
181
+ value: l.sourcedId
182
+ })), L = (b) => {
183
+ const l = [], { givenName: T, middleName: q, familyName: D, email: A, role: U } = b, d = [];
184
+ return T && d.push(T), q && d.push(q), D && d.push(D), d.length && l.push(d.join(" ")), A && l.push(A), `${l.join(" - ")}${U ? ` (${U})` : ""}`;
185
+ }, _ = (b) => {
186
+ g((l) => ({ ...l, searchString: b }));
187
+ }, v = Y((b) => {
188
+ g({
189
+ ...y,
190
+ ...b
191
+ });
192
+ }, [JSON.stringify(y)]);
193
+ return ne(() => {
194
+ y.roles?.length && B();
195
+ }, [JSON.stringify(y)]), ne(() => {
196
+ v({
197
+ roles: s
198
+ });
199
+ }, [JSON.stringify(s)]), ne(() => {
200
+ Z();
201
+ }, [n]), {
202
+ users: u,
203
+ isLoading: p,
204
+ user: I,
205
+ handleInputChange: _
206
+ };
207
+ }, Cr = ({ value: s, roles: n, onChange: u }) => {
208
+ const {
209
+ users: S,
210
+ isLoading: p,
211
+ user: c,
212
+ handleInputChange: y
213
+ } = Er(n, s);
214
+ return /* @__PURE__ */ e(
215
+ ce,
216
+ {
217
+ label: "Select user",
218
+ value: c?.value || "",
219
+ onChange: (g) => {
220
+ u(g.target.value);
221
+ },
222
+ onOpen: () => y(""),
223
+ disabled: p,
224
+ className: `${lr["profile-value"]}`,
225
+ variant: "outlined",
226
+ children: p ? /* @__PURE__ */ e(X, { disabled: !0, children: /* @__PURE__ */ e(Ve, { size: 20 }) }) : S.length > 0 ? S.map((g) => /* @__PURE__ */ e(X, { value: g.value, children: `${g.label}` }, g.value)) : /* @__PURE__ */ e(X, { disabled: !0, children: "No users found" })
227
+ }
228
+ );
229
+ }, Pr = ({
230
+ userDetail: s,
231
+ confirmData: n,
232
+ goBack: u,
233
+ teacherOptions: S,
234
+ getDataTeachers: p,
235
+ id: c,
236
+ checkHasTeacher: y,
237
+ setCheckHasTeacher: g,
238
+ userHasData: I,
239
+ currentRoles: N
240
+ }) => {
241
+ const { t: m } = De(), B = qe(null), x = Se((L) => L.common.user)?.hasEsSchool !== !1;
242
+ return /* @__PURE__ */ o("div", { className: a["edit-profile-container"], children: [
243
+ /* @__PURE__ */ e("div", { className: a["edit-profile-container__title"], children: `${c ? "Edit User Profile" : "Create User"}` }),
244
+ /* @__PURE__ */ e(
245
+ Ue,
246
+ {
247
+ initialValues: s,
248
+ enableReinitialize: !0,
249
+ onSubmit: (L) => {
250
+ n(L);
251
+ },
252
+ validationSchema: yr,
253
+ children: (L) => {
254
+ const { values: _, setFieldValue: v, handleSubmit: b, errors: l, touched: T } = L, q = Object.keys(l);
255
+ q.length && document.querySelector(`input[name=${q[0]}]`)?.scrollIntoView({
256
+ behavior: "smooth",
257
+ block: "center"
258
+ });
259
+ const D = _?.appTypes || [], A = D.includes("MS"), U = D.includes("ES"), d = _?.msRoles || [], Q = _?.esRoles || [], F = d.includes(R.STUDENT) || Q.includes(R.STUDENT), V = x ? be(_?.preferredAppType, D) : "ms", ae = V === "ms" || V === "both", se = V === "es" || V === "both", G = F ? V === "ms" ? "MS" : V === "es" ? "ES" : null : null, oe = (t, f) => {
260
+ if (!f) return;
261
+ const $ = Sr(f), j = br(f);
262
+ c ? v("preferredAppType", j) : (v("appTypes", $), v("preferredAppType", j), F && p(f === "both" ? "MS" : f.toUpperCase()));
263
+ }, de = (t) => (f) => {
264
+ const $ = f.target.value, j = t === "MS" ? "msRoles" : "esRoles", J = t === "MS" ? "esRoles" : "msRoles", w = B.current, k = I?.[t] ?? {};
265
+ if (c && (k.isHasTeacherData && w === "Teacher" || k.isHasAssistantData && w === "Assistant" || k.isHasCounselorData && w === "Counselor" || k.isHasSecondaryTeacherData && w === "SecondaryTeacher" || w === "Student" && (k.isHasAssistantData || k.isHasCounselorData || k.isHasSecondaryTeacherData || k.isHasTeacherData))) {
266
+ alert("Please switch data before removing the role");
267
+ return;
268
+ }
269
+ const ee = _?.[j] || [], me = $.some((h) => Pe.includes(h)) ? w && !ee.includes(w) ? [w] : [$.find((h) => Pe.includes(h))].filter(Boolean) : $, r = ee.includes(R.STUDENT), i = me.includes(R.STUDENT);
270
+ v(j, me), B.current = null, i ? (v("preferredAppType", t), v(J, [R.STUDENT]), c || (v("appTypes", [t]), p(t))) : r && !i && v(J, []);
271
+ }, ie = (t) => {
272
+ const f = t === "MS" ? "msRoles" : "esRoles", $ = t === "MS" ? d : Q, j = t === "MS" ? vr : wr, J = N?.[t] || [];
273
+ return /* @__PURE__ */ o("div", { className: `${a["edit-profile-container__form--field"]} ${ae && se ? a["edit-profile-container__form--width-50"] : ""}`, children: [
274
+ /* @__PURE__ */ o("p", { children: [
275
+ x && /* @__PURE__ */ e("span", { style: {
276
+ display: "inline-block",
277
+ fontSize: 11,
278
+ fontWeight: 700,
279
+ color: "#3b4ba8",
280
+ backgroundColor: "#e9ecfb",
281
+ borderRadius: 4,
282
+ padding: "1px 6px",
283
+ marginRight: 6,
284
+ verticalAlign: "middle"
285
+ }, children: t }),
286
+ x ? t === "MS" ? "Middle school roles" : "Elementary school roles" : "Roles",
287
+ " ",
288
+ /* @__PURE__ */ e("sup", { children: "*" })
289
+ ] }),
290
+ /* @__PURE__ */ e(
291
+ ce,
292
+ {
293
+ variant: "outlined",
294
+ multiple: !0,
295
+ name: f,
296
+ value: $,
297
+ renderValue: (w) => w.map((k) => k === "SecondaryTeacher" ? "Support Teacher" : k).join(", "),
298
+ onChange: de(t),
299
+ className: `${a["profile-value"]}`,
300
+ children: j.map((w) => {
301
+ const k = N?.MS?.includes(R.STUDENT) || N?.ES?.includes(R.STUDENT);
302
+ return /* @__PURE__ */ o(
303
+ X,
304
+ {
305
+ value: w,
306
+ disabled: c ? J.some((ee) => ["Student", "Parent", "General ED teacher"].includes(ee)) || ["Parent"].includes(w) || !k && w === R.STUDENT : ["Parent"].includes(w) || F && w !== R.STUDENT,
307
+ onClick: () => {
308
+ B.current = w;
309
+ },
310
+ children: [
311
+ /* @__PURE__ */ e(Ge, { checked: $.includes(w) }),
312
+ /* @__PURE__ */ e(Ye, { primary: w === "SecondaryTeacher" ? "Support Teacher" : w })
313
+ ]
314
+ },
315
+ w
316
+ );
317
+ })
318
+ }
319
+ ),
320
+ l[f] && T[f] ? /* @__PURE__ */ e("div", { className: `${a["input-error"]}`, children: l[f] }) : null
321
+ ] });
322
+ };
323
+ return /* @__PURE__ */ o("div", { className: a["edit-profile-container__form"], children: [
324
+ /* @__PURE__ */ o("div", { className: a["edit-profile-container__form--row"], children: [
325
+ /* @__PURE__ */ o("div", { className: `${a["edit-profile-container__form--field"]} ${a["edit-profile-container__form--width-50"]}`, children: [
326
+ /* @__PURE__ */ o("p", { children: [
327
+ m("first_name"),
328
+ " ",
329
+ /* @__PURE__ */ e("sup", { children: "*" })
330
+ ] }),
331
+ /* @__PURE__ */ e(
332
+ ue,
333
+ {
334
+ name: "firstName",
335
+ variant: "outlined",
336
+ value: _?.firstName || "",
337
+ onChange: (t) => v("firstName", t.target.value)
338
+ }
339
+ ),
340
+ l.firstName && T.firstName ? /* @__PURE__ */ e("div", { className: `${a["input-error"]}`, children: l.firstName }) : null
341
+ ] }),
342
+ /* @__PURE__ */ o("div", { className: `${a["edit-profile-container__form--field"]} ${a["edit-profile-container__form--width-50"]}`, children: [
343
+ /* @__PURE__ */ o("p", { children: [
344
+ m("last_name"),
345
+ " ",
346
+ /* @__PURE__ */ e("sup", { children: "*" })
347
+ ] }),
348
+ /* @__PURE__ */ e(
349
+ ue,
350
+ {
351
+ name: "lastName",
352
+ variant: "outlined",
353
+ className: `${a["profile-value"]}`,
354
+ value: _?.lastName || "",
355
+ onChange: (t) => v("lastName", t.target.value)
356
+ }
357
+ ),
358
+ l.lastName && T.lastName ? /* @__PURE__ */ e("div", { className: `${a["input-error"]}`, children: l.lastName }) : null
359
+ ] })
360
+ ] }),
361
+ /* @__PURE__ */ o("div", { className: a["edit-profile-container__form--row"], children: [
362
+ /* @__PURE__ */ o("div", { className: `${a["edit-profile-container__form--field"]} ${a["edit-profile-container__form--width-30"]}`, children: [
363
+ /* @__PURE__ */ o("p", { children: [
364
+ " ",
365
+ m("date_of_birth")
366
+ ] }),
367
+ /* @__PURE__ */ e(Je, { dateAdapter: cr, children: /* @__PURE__ */ e(
368
+ We,
369
+ {
370
+ format: "Do MMM YYYY",
371
+ value: _?.dateOfBirth && !$e.includes(_?.dateOfBirth) ? Ke(_?.dateOfBirth) : null,
372
+ onChange: (t) => {
373
+ if (t) {
374
+ const f = t.format("YYYY-MM-DD");
375
+ v("dateOfBirth", f);
376
+ } else
377
+ v("dateOfBirth", null);
378
+ },
379
+ slotProps: {
380
+ textField: {
381
+ variant: "outlined",
382
+ id: "time-picker",
383
+ className: `${a["profile-value"]}`
384
+ },
385
+ openPickerButton: {
386
+ "aria-label": "change date"
387
+ }
388
+ }
389
+ }
390
+ ) })
391
+ ] }),
392
+ /* @__PURE__ */ o("div", { className: `${a["edit-profile-container__form--field"]} ${a["edit-profile-container__form--width-70"]}`, children: [
393
+ /* @__PURE__ */ o("p", { children: [
394
+ m("email"),
395
+ " ",
396
+ /* @__PURE__ */ e("sup", { children: "*" })
397
+ ] }),
398
+ /* @__PURE__ */ e(
399
+ ue,
400
+ {
401
+ name: "email",
402
+ variant: "outlined",
403
+ className: `${a["profile-value"]}`,
404
+ value: _?.email || "",
405
+ onChange: (t) => v("email", t.target.value)
406
+ }
407
+ ),
408
+ l.email && T.email ? /* @__PURE__ */ e("div", { className: `${a["input-error"]}`, children: l.email }) : null
409
+ ] })
410
+ ] }),
411
+ /* @__PURE__ */ o("div", { style: { border: "1px solid #e0e0e0", borderRadius: "12px", marginBottom: "24px", overflow: "hidden" }, children: [
412
+ x && /* @__PURE__ */ e("div", { style: { backgroundColor: "#f8f9fa", padding: "16px 24px", borderBottom: "1px solid #e0e0e0" }, children: /* @__PURE__ */ o("div", { className: `${a["edit-profile-container__form--field"]}`, style: { marginBottom: 0, width: "100%" }, children: [
413
+ /* @__PURE__ */ o("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
414
+ /* @__PURE__ */ o("div", { children: [
415
+ /* @__PURE__ */ o("p", { style: { marginBottom: 4, fontWeight: 600, fontSize: 16 }, children: [
416
+ "School tier ",
417
+ /* @__PURE__ */ e("sup", { children: "*" })
418
+ ] }),
419
+ /* @__PURE__ */ e("p", { style: { fontSize: 13, color: "#6c757d", marginTop: 0, marginBottom: 0 }, children: "Pick a tier. Roles are assigned per tier." })
420
+ ] }),
421
+ /* @__PURE__ */ o(
422
+ je,
423
+ {
424
+ exclusive: !0,
425
+ value: V,
426
+ onChange: oe,
427
+ size: "small",
428
+ sx: {
429
+ border: "1px solid #e0e0e0",
430
+ borderRadius: "30px",
431
+ padding: "4px",
432
+ backgroundColor: "#fff",
433
+ "& .MuiToggleButton-root": {
434
+ border: "none",
435
+ borderRadius: "30px !important",
436
+ textTransform: "none",
437
+ padding: "6px 20px",
438
+ margin: "0",
439
+ color: "#6c757d",
440
+ fontWeight: 500,
441
+ fontSize: 14,
442
+ "&.Mui-selected": {
443
+ backgroundColor: "#2b65d9",
444
+ color: "#fff",
445
+ "&:hover": {
446
+ backgroundColor: "#1d4ed8"
447
+ }
448
+ }
449
+ }
450
+ },
451
+ children: [
452
+ /* @__PURE__ */ e(pe, { value: "ms", disabled: !!c && !A && F, children: "Middle school" }),
453
+ /* @__PURE__ */ e(pe, { value: "es", disabled: !!c && !U && F, children: "Elementary" }),
454
+ !F && /* @__PURE__ */ e(pe, { value: "both", disabled: !1, children: "Both" })
455
+ ]
456
+ }
457
+ )
458
+ ] }),
459
+ l.appTypes && T.appTypes ? /* @__PURE__ */ e("div", { className: `${a["input-error"]}`, children: l.appTypes }) : null
460
+ ] }) }),
461
+ /* @__PURE__ */ e("div", { style: { backgroundColor: "#fff", padding: "24px" }, children: /* @__PURE__ */ o("div", { className: a["edit-profile-container__form--row"], style: { margin: 0 }, children: [
462
+ se && ie("ES"),
463
+ ae && ie("MS")
464
+ ] }) })
465
+ ] }),
466
+ /* @__PURE__ */ e("div", { className: a["edit-profile-container__form--row"], children: /* @__PURE__ */ o("div", { className: `${a["edit-profile-container__form--field"]} ${a["edit-profile-container__form--width-50"]}`, children: [
467
+ /* @__PURE__ */ e("p", { children: m("status") }),
468
+ /* @__PURE__ */ e("div", { className: `${a.gender}`, children: Nr.map((t) => /* @__PURE__ */ o("div", { className: `${a.gender__item}`, children: [
469
+ /* @__PURE__ */ e(
470
+ ze,
471
+ {
472
+ color: "primary",
473
+ value: t.value,
474
+ checked: _?.isActive === t.value,
475
+ onChange: () => v("isActive", t.value),
476
+ disabled: !!c && !!_?.isImportedFromIntegration
477
+ }
478
+ ),
479
+ t.label
480
+ ] }, t.label)) })
481
+ ] }) }),
482
+ F && !c && !!S && /* @__PURE__ */ e("div", { className: a["edit-profile-container__form--row"], children: /* @__PURE__ */ o("div", { className: `${a["edit-profile-container__form--field"]}`, children: [
483
+ /* @__PURE__ */ o("p", { children: [
484
+ "Assign Teacher ",
485
+ /* @__PURE__ */ e("sup", { children: "*" })
486
+ ] }),
487
+ /* @__PURE__ */ e(
488
+ ce,
489
+ {
490
+ multiple: !0,
491
+ variant: "outlined",
492
+ name: "teacherUserId",
493
+ value: _?.teacherUserId || [],
494
+ renderValue: (t) => S.filter((f) => t.includes(f.value)).map((f) => f.label).join(", "),
495
+ onChange: (t) => {
496
+ const f = t.target.value;
497
+ v("teacherUserId", f), g(!!f.length);
498
+ },
499
+ className: `${a["profile-value"]}`,
500
+ children: S?.map((t) => /* @__PURE__ */ e(X, { value: t.value, children: t.label }, t.value))
501
+ }
502
+ ),
503
+ !y && /* @__PURE__ */ e("div", { className: `${a["input-error"]}`, children: "Teacher is required" })
504
+ ] }) }),
505
+ F && /* @__PURE__ */ e("div", { className: a["edit-profile-container__form--row"], children: /* @__PURE__ */ o("div", { className: `${a["edit-profile-container__form--field"]} ${a["edit-profile-container__form--width-50"]}`, children: [
506
+ /* @__PURE__ */ o("p", { children: [
507
+ " ",
508
+ m("grade_level"),
509
+ " ",
510
+ /* @__PURE__ */ e("sup", { children: "*" })
511
+ ] }),
512
+ /* @__PURE__ */ o(
513
+ ce,
514
+ {
515
+ variant: "outlined",
516
+ value: _?.gradeLevel ?? "",
517
+ renderValue: (t) => t,
518
+ onChange: (t) => v("gradeLevel", t.target.value),
519
+ className: `${a["profile-value"]}`,
520
+ children: [
521
+ _?.gradeLevel && !Ce.filter((t) => {
522
+ const f = Ne.includes(t), $ = ye.includes(t);
523
+ return G ? G === "MS" ? $ : G === "ES" ? f : !1 : !0;
524
+ }).includes(_.gradeLevel) && /* @__PURE__ */ e(X, { value: _.gradeLevel, sx: { display: "none" }, children: _.gradeLevel }, "__current__"),
525
+ Ce.filter((t) => {
526
+ const f = Ne.includes(t), $ = ye.includes(t);
527
+ return G ? G === "MS" ? $ : G === "ES" ? f : !1 : !0;
528
+ }).map((t) => /* @__PURE__ */ e(X, { value: t, children: t }, t))
529
+ ]
530
+ }
531
+ ),
532
+ l.gradeLevel && T.gradeLevel ? /* @__PURE__ */ e("div", { className: `${a["input-error"]}`, children: l.gradeLevel }) : null
533
+ ] }) }),
534
+ !F && (!!d.length || !!Q.length) && !!c && /* @__PURE__ */ e("div", { className: a["edit-profile-container__form--row"], children: /* @__PURE__ */ o("div", { className: `${a["edit-profile-container__form--field"]} ${a["edit-profile-container__form--width-50"]}`, children: [
535
+ /* @__PURE__ */ e("p", { children: m("Map from Roster") }),
536
+ /* @__PURE__ */ e(
537
+ Cr,
538
+ {
539
+ roles: [...d, ...Q],
540
+ value: _.sourcedId,
541
+ onChange: (t) => v("sourcedId", t)
542
+ }
543
+ )
544
+ ] }) }),
545
+ /* @__PURE__ */ o("div", { className: a["edit-profile-container__form--btn-group"], children: [
546
+ /* @__PURE__ */ e(
547
+ "button",
548
+ {
549
+ type: "button",
550
+ className: a["btn-cancel"],
551
+ onClick: () => u(),
552
+ children: m("cancel")
553
+ }
554
+ ),
555
+ /* @__PURE__ */ o(
556
+ "button",
557
+ {
558
+ type: "button",
559
+ className: a["btn-save"],
560
+ onClick: () => b(),
561
+ children: [
562
+ /* @__PURE__ */ e(Me, { color: "#fff" }),
563
+ m("save_changes")
564
+ ]
565
+ }
566
+ )
567
+ ] })
568
+ ] });
569
+ }
570
+ }
571
+ )
572
+ ] });
573
+ }, C = {
574
+ "input-error": "_input-error_gmvmh_1",
575
+ "change-password-container": "_change-password-container_gmvmh_6",
576
+ "change-password-container__title": "_change-password-container__title_gmvmh_11",
577
+ "change-password-container__form": "_change-password-container__form_gmvmh_19",
578
+ "change-password-container__form--field": "_change-password-container__form--field_gmvmh_24",
579
+ "change-password-container__form--description": "_change-password-container__form--description_gmvmh_38",
580
+ "change-password-container__form--btn-group": "_change-password-container__form--btn-group_gmvmh_54",
581
+ "btn-save": "_btn-save_gmvmh_60",
582
+ "btn-cancel": "_btn-cancel_gmvmh_82"
583
+ }, Rr = P.object({
584
+ oldPassword: P.string().required("Old password is required"),
585
+ newPassword: P.string().required("New password is required"),
586
+ confirmedNewPassword: P.string().oneOf([P.ref("newPassword"), void 0], "New password must match").required("Confirm your new password")
587
+ }), Dr = ({ confirmChangePassword: s, goBack: n }) => {
588
+ const { t: u } = De();
589
+ return /* @__PURE__ */ o("div", { className: C["change-password-container"], children: [
590
+ /* @__PURE__ */ e("div", { className: C["change-password-container__title"], children: u("change_password") }),
591
+ /* @__PURE__ */ e(
592
+ Ue,
593
+ {
594
+ initialValues: {
595
+ oldPassword: "",
596
+ newPassword: "",
597
+ confirmedNewPassword: "",
598
+ showOldPassword: !1,
599
+ showNewPassword: !1,
600
+ showConfirmNewPassword: !1
601
+ },
602
+ enableReinitialize: !0,
603
+ onSubmit: (S) => {
604
+ s(S);
605
+ },
606
+ validateOnChange: !1,
607
+ validateOnBlur: !1,
608
+ validationSchema: Rr,
609
+ children: (S) => {
610
+ const { values: p, setFieldValue: c, handleSubmit: y, errors: g, touched: I } = S, N = Object.keys(g);
611
+ return N.length && document.querySelector(
612
+ `input[name=${N[0]}]`
613
+ )?.scrollIntoView({
614
+ behavior: "smooth",
615
+ block: "center"
616
+ }), /* @__PURE__ */ o("div", { className: C["change-password-container__form"], children: [
617
+ /* @__PURE__ */ o("div", { className: `${C["change-password-container__form--field"]}`, children: [
618
+ /* @__PURE__ */ e("p", { children: u("old_password") }),
619
+ /* @__PURE__ */ e(
620
+ fe,
621
+ {
622
+ variant: "outlined",
623
+ className: `${C["input-field"]}`,
624
+ children: /* @__PURE__ */ e(
625
+ he,
626
+ {
627
+ type: p.showOldPassword ? "text" : "password",
628
+ value: p?.oldPassword,
629
+ onChange: (m) => c(
630
+ "oldPassword",
631
+ m.target.value.trim()
632
+ ),
633
+ endAdornment: /* @__PURE__ */ e(_e, { position: "end", children: /* @__PURE__ */ e(
634
+ we,
635
+ {
636
+ "aria-label": "toggle password visibility",
637
+ onClick: () => c(
638
+ "showOldPassword",
639
+ !p.showOldPassword
640
+ ),
641
+ onMouseDown: (m) => m.preventDefault(),
642
+ children: p.showOldPassword ? /* @__PURE__ */ e(ve, { color: "primary" }) : /* @__PURE__ */ e(ge, { color: "primary" })
643
+ }
644
+ ) })
645
+ }
646
+ )
647
+ }
648
+ ),
649
+ g.oldPassword && I.oldPassword && /* @__PURE__ */ e("div", { className: `${C["input-error"]}`, children: g.oldPassword })
650
+ ] }),
651
+ /* @__PURE__ */ o("div", { className: `${C["change-password-container__form--field"]}`, children: [
652
+ /* @__PURE__ */ e("p", { children: u("new_password") }),
653
+ /* @__PURE__ */ e(
654
+ fe,
655
+ {
656
+ variant: "outlined",
657
+ className: `${C["input-field"]}`,
658
+ children: /* @__PURE__ */ e(
659
+ he,
660
+ {
661
+ type: p.showNewPassword ? "text" : "password",
662
+ value: p?.newPassword,
663
+ onChange: (m) => c(
664
+ "newPassword",
665
+ m.target.value.trim()
666
+ ),
667
+ endAdornment: /* @__PURE__ */ e(_e, { position: "end", children: /* @__PURE__ */ e(
668
+ we,
669
+ {
670
+ "aria-label": "toggle password visibility",
671
+ onClick: () => c(
672
+ "showNewPassword",
673
+ !p.showNewPassword
674
+ ),
675
+ onMouseDown: (m) => m.preventDefault(),
676
+ children: p.showNewPassword ? /* @__PURE__ */ e(ve, { color: "primary" }) : /* @__PURE__ */ e(ge, { color: "primary" })
677
+ }
678
+ ) })
679
+ }
680
+ )
681
+ }
682
+ ),
683
+ g.newPassword && I.newPassword && /* @__PURE__ */ e("div", { className: `${C["input-error"]}`, children: g.newPassword }),
684
+ /* @__PURE__ */ o("div", { className: `${C["change-password-container__form--description"]}`, children: [
685
+ "Password must contain at least: 1 uppercase letter, 1 lowercase letter,",
686
+ /* @__PURE__ */ e("br", {}),
687
+ " 1 number, and 1 special character"
688
+ ] })
689
+ ] }),
690
+ /* @__PURE__ */ o("div", { className: `${C["change-password-container__form--field"]}`, children: [
691
+ /* @__PURE__ */ e("p", { children: u("confirm_new_password") }),
692
+ /* @__PURE__ */ e(
693
+ fe,
694
+ {
695
+ variant: "outlined",
696
+ className: `${C["input-field"]}`,
697
+ children: /* @__PURE__ */ e(
698
+ he,
699
+ {
700
+ type: p.showConfirmNewPassword ? "text" : "password",
701
+ value: p?.confirmedNewPassword,
702
+ onChange: (m) => c(
703
+ "confirmedNewPassword",
704
+ m.target.value.trim()
705
+ ),
706
+ endAdornment: /* @__PURE__ */ e(_e, { position: "end", children: /* @__PURE__ */ e(
707
+ we,
708
+ {
709
+ "aria-label": "toggle password visibility",
710
+ onClick: () => c(
711
+ "showConfirmNewPassword",
712
+ !p.showConfirmNewPassword
713
+ ),
714
+ onMouseDown: (m) => m.preventDefault(),
715
+ children: p.showConfirmNewPassword ? /* @__PURE__ */ e(ve, { color: "primary" }) : /* @__PURE__ */ e(ge, { color: "primary" })
716
+ }
717
+ ) })
718
+ }
719
+ )
720
+ }
721
+ ),
722
+ g.confirmedNewPassword && I.confirmedNewPassword && /* @__PURE__ */ e("div", { className: `${C["input-error"]}`, children: g.confirmedNewPassword })
723
+ ] }),
724
+ /* @__PURE__ */ o("div", { className: C["change-password-container__form--btn-group"], children: [
725
+ /* @__PURE__ */ e(
726
+ "button",
727
+ {
728
+ type: "button",
729
+ className: C["btn-cancel"],
730
+ onClick: () => {
731
+ n();
732
+ },
733
+ children: u("cancel")
734
+ }
735
+ ),
736
+ /* @__PURE__ */ o(
737
+ "button",
738
+ {
739
+ type: "button",
740
+ className: C["btn-save"],
741
+ onClick: () => y(),
742
+ children: [
743
+ /* @__PURE__ */ e(Me, { color: "#fff" }),
744
+ u("save_new_password")
745
+ ]
746
+ }
747
+ )
748
+ ] })
749
+ ] });
750
+ }
751
+ }
752
+ )
753
+ ] });
754
+ }, kr = {
755
+ id: "",
756
+ firstName: "",
757
+ lastName: "",
758
+ email: "",
759
+ dateOfBirth: $e,
760
+ msRoles: [],
761
+ esRoles: [],
762
+ isActive: !0,
763
+ profileImageFileName: "",
764
+ teacherUserId: [],
765
+ gradeLevel: "",
766
+ currentGradeLevel: "",
767
+ isImportedFromIntegration: !1,
768
+ // Man tao moi mac dinh MS; man edit se duoc getData ghi de bang appType tu API
769
+ appTypes: ["MS"],
770
+ preferredAppType: "MS"
771
+ }, Re = "/admin/users/user-list", Ur = "User detail", $r = 12, Mr = 20, Ar = (s) => {
772
+ const n = ke(), u = dr(), S = Se((r) => r.common.user), p = Se((r) => r.common?.defaultFontSize), [c, y] = M(kr), [g, I] = M(null), [N, m] = M(!1), [B, Z] = M({ MS: [], ES: [] }), [x, L] = M([]), [_, v] = M(!1), [b, l] = M(K.Info), [T, q] = M(!0), [D, A] = M({}), U = async () => {
773
+ localStorage.setItem(window.location.href, "true"), m(!0);
774
+ }, d = () => {
775
+ v(!_);
776
+ }, Q = He(() => p == Mr ? "font-large" : p == $r ? "font-small" : "", [p]);
777
+ ne(() => {
778
+ document.title = Ur, m(!1), localStorage.getItem(window.location.href) && localStorage.removeItem(window.location.href);
779
+ }, []), ne(() => {
780
+ s && V(), !s && f();
781
+ }, [s]);
782
+ const F = (r = []) => r.includes("EduTeacher") ? [...r.filter((i) => i !== "EduTeacher"), R.EDUTEACHER] : r, V = Y(async () => {
783
+ n(H(!0));
784
+ try {
785
+ const r = await Xe(s), i = (r.data.appTypeRaw || r.data.appType || "MS").toUpperCase(), h = i.includes("MS"), E = i.includes("ES"), z = h && E ? ["MS", "ES"] : E ? ["ES"] : ["MS"], re = r.data.preferredAppType || i;
786
+ y({
787
+ ...r.data,
788
+ dateOfBirth: ur(new Date(r.data.dateOfBirth), Fe),
789
+ msRoles: F(r.data.msRoles),
790
+ esRoles: F(r.data.esRoles),
791
+ currentGradeLevel: r.data.gradeLevel,
792
+ appTypes: z,
793
+ preferredAppType: re
794
+ }), Z({ MS: r.data.msRoles ?? [], ES: r.data.esRoles ?? [] }), document.title = r.data?.fullName, h && ae("MS"), E && ae("ES");
795
+ } catch (r) {
796
+ n(
797
+ O({
798
+ type: "danger",
799
+ message: r.response?.data?.title || r.message
800
+ })
801
+ );
802
+ }
803
+ n(H(!1));
804
+ }, [s]), ae = Y(async (r) => {
805
+ n(H(!0));
806
+ try {
807
+ const i = await Ze(s, r);
808
+ A((h) => ({ ...h, [r]: i.data }));
809
+ } catch (i) {
810
+ n(
811
+ O({
812
+ type: "danger",
813
+ message: i.response?.data?.title || i.message
814
+ })
815
+ );
816
+ }
817
+ n(H(!1));
818
+ }, [s]), se = Y((r) => {
819
+ u(r && typeof r == "string" ? Re + `?query=${r}` : Re);
820
+ }, []), G = (r) => ["Student", "Parent", "EduTeacher"].includes(r), oe = (r = []) => r.includes(R.EDUTEACHER) ? [...r.filter((i) => i !== R.EDUTEACHER), "EduTeacher"] : r, de = Y(
821
+ async (r) => {
822
+ const i = r.msRoles?.includes(R.STUDENT) || r.esRoles?.includes(R.STUDENT);
823
+ if (i && !s && !r.teacherUserId) {
824
+ q(!1);
825
+ return;
826
+ }
827
+ if (i && r.gradeLevel) {
828
+ const h = r.msRoles?.includes(R.STUDENT), E = r.esRoles?.includes(R.STUDENT), z = r.preferredAppType, re = h && !E ? "MS" : E && !h ? "ES" : z === "MS" || z === "ES" ? z : null, te = re === "MS" ? ye : re === "ES" ? Ne : null;
829
+ if (te && !te.includes(r.gradeLevel)) {
830
+ n(
831
+ O({
832
+ type: "danger",
833
+ message: `Grade "${r.gradeLevel}" is not valid for ${re} students. Please select a new grade level.`
834
+ })
835
+ );
836
+ return;
837
+ }
838
+ }
839
+ n(H(!0));
840
+ try {
841
+ S?.hasEsSchool === !1 && (r.appTypes = ["MS"], r.preferredAppType = "MS", r.esRoles = []);
842
+ const h = s ? Qe : er;
843
+ !s && delete r.id, r.teacherUserId = i ? r.teacherUserId : [], r.msRoles = oe(r.msRoles), r.esRoles = oe(r.esRoles), s || (r.profileImageFileName = g || "");
844
+ const E = await h(r);
845
+ E && rr(E.data.id).then((z) => {
846
+ se(z.data.fullName);
847
+ }), s || alert("Password of " + E.data.email + ` is "${E.data.password}"`), n(
848
+ O({
849
+ type: "success",
850
+ message: `${s ? "Update" : "Create"} user successfully`
851
+ })
852
+ );
853
+ } catch (h) {
854
+ n(
855
+ O({
856
+ type: "danger",
857
+ message: h.response?.data?.title || h.message
858
+ })
859
+ );
860
+ }
861
+ n(H(!1));
862
+ },
863
+ [s, g]
864
+ ), ie = async (r) => {
865
+ n(H(!0));
866
+ try {
867
+ await nr(r), n(
868
+ O({
869
+ type: "success",
870
+ message: "Change password successfully"
871
+ })
872
+ );
873
+ } catch (i) {
874
+ n(
875
+ O({
876
+ type: "danger",
877
+ message: i.response?.data?.title || i.message
878
+ })
879
+ );
880
+ }
881
+ n(H(!1));
882
+ }, t = Y(async (r) => {
883
+ n(H(!0));
884
+ try {
885
+ await ar(r), n(
886
+ O({
887
+ type: "success",
888
+ message: "Send forgot password link successfully"
889
+ })
890
+ );
891
+ } catch (i) {
892
+ n(
893
+ O({
894
+ type: "danger",
895
+ message: i.response?.data?.title || i.message || "Error occured"
896
+ })
897
+ );
898
+ }
899
+ n(H(!1));
900
+ }, []), f = async (r) => {
901
+ try {
902
+ const i = await sr({
903
+ sortBy: "Email"
904
+ }, r);
905
+ i.data && L(
906
+ (i.data.map?.((h) => ({
907
+ label: h.email,
908
+ value: h.id
909
+ })) || []).sort((h, E) => h.label.localeCompare(E.label))
910
+ );
911
+ } catch (i) {
912
+ n(
913
+ O({
914
+ type: "danger",
915
+ message: i.response?.data?.title || i.message
916
+ })
917
+ );
918
+ }
919
+ }, $ = 20097152, [j, J] = M(""), w = (r) => {
920
+ r.preventDefault();
921
+ let i = new FileReader(), h = r.target.files[0];
922
+ if (h.size > $) {
923
+ n(
924
+ O({
925
+ type: "danger",
926
+ message: "File can't be larger than 2MB"
927
+ })
928
+ );
929
+ return;
930
+ }
931
+ i.onloadend = async () => {
932
+ if (J(i.result), h) {
933
+ const E = new FormData(), { name: z } = h;
934
+ E.append("file", h, z);
935
+ const te = (await tr(E))?.data?.key;
936
+ s ? await Ee(c.id || "", te) : I(te);
937
+ }
938
+ }, h && i.readAsDataURL(h);
939
+ }, k = async () => {
940
+ await Ee(c.id || "", ""), J("");
941
+ }, ee = j || Oe(c?.profileImageFileName), Te = c?.profileImageFileName || "";
942
+ return {
943
+ userDetail: c,
944
+ getDataTeachers: f,
945
+ backToList: se,
946
+ confirmData: de,
947
+ file: g,
948
+ setFile: I,
949
+ edited: N,
950
+ currentRoles: B,
951
+ setEdited: m,
952
+ setEditedTrue: U,
953
+ confirmChangePassword: ie,
954
+ forgotPasswordRequest: t,
955
+ handleDisableRoles: G,
956
+ classFontSize: Q,
957
+ teacherOptions: x,
958
+ handleToggleModel: d,
959
+ openModel: _,
960
+ user: S,
961
+ activeTab: b,
962
+ setActiveTab: l,
963
+ imageSrc: ee,
964
+ imageUse: Te,
965
+ handleImageChange: w,
966
+ handleDeleteAvatar: k,
967
+ getFile: () => {
968
+ var r = window.location.origin + "/api/ExportDataUser/" + s;
969
+ window.open(r);
970
+ },
971
+ checkHasTeacher: T,
972
+ setCheckHasTeacher: q,
973
+ userHasData: D
974
+ };
975
+ }, Ir = "/images/image-default.png", aa = () => {
976
+ const { id: s } = mr(), {
977
+ userDetail: n,
978
+ getDataTeachers: u,
979
+ backToList: S,
980
+ confirmData: p,
981
+ confirmChangePassword: c,
982
+ forgotPasswordRequest: y,
983
+ teacherOptions: g,
984
+ user: I,
985
+ activeTab: N,
986
+ setActiveTab: m,
987
+ imageSrc: B,
988
+ handleImageChange: Z,
989
+ handleDeleteAvatar: x,
990
+ getFile: L,
991
+ currentRoles: _,
992
+ handleDisableRoles: v,
993
+ checkHasTeacher: b,
994
+ setCheckHasTeacher: l,
995
+ userHasData: T
996
+ } = Ar(s), q = [
997
+ {
998
+ value: K.Info,
999
+ component: /* @__PURE__ */ e(
1000
+ Pr,
1001
+ {
1002
+ id: s,
1003
+ goBack: S,
1004
+ userDetail: n,
1005
+ confirmData: p,
1006
+ teacherOptions: g,
1007
+ getDataTeachers: u,
1008
+ currentRoles: _,
1009
+ handleDisableRoles: v,
1010
+ checkHasTeacher: b,
1011
+ setCheckHasTeacher: l,
1012
+ userHasData: T
1013
+ }
1014
+ )
1015
+ },
1016
+ {
1017
+ value: K.ChangePassword,
1018
+ component: /* @__PURE__ */ e(
1019
+ Dr,
1020
+ {
1021
+ confirmChangePassword: c,
1022
+ goBack: S
1023
+ }
1024
+ )
1025
+ }
1026
+ ], D = le.find((d) => d.value === K.ForgotPassword), A = le.find((d) => d.value === K.DownloadUserData), U = le.find((d) => d.value === K.ChangePassword);
1027
+ return /* @__PURE__ */ o("div", { className: a["user-profile-container-admin"], children: [
1028
+ /* @__PURE__ */ o("div", { className: a["user-profile-container-admin__left"], children: [
1029
+ /* @__PURE__ */ o("div", { className: a["user-profile-container-admin__left--information"], children: [
1030
+ /* @__PURE__ */ o("div", { className: a["image-user-container"], children: [
1031
+ /* @__PURE__ */ e(
1032
+ Ie,
1033
+ {
1034
+ className: "d-none",
1035
+ type: "file",
1036
+ id: "uploadFile",
1037
+ onChange: Z,
1038
+ accept: "image/*"
1039
+ }
1040
+ ),
1041
+ /* @__PURE__ */ e(
1042
+ "img",
1043
+ {
1044
+ src: B || W(Ir),
1045
+ alt: "avatar",
1046
+ className: `${a["image-user-container__image"]}`
1047
+ }
1048
+ ),
1049
+ /* @__PURE__ */ e(
1050
+ Le,
1051
+ {
1052
+ htmlFor: "uploadFile",
1053
+ role: "button",
1054
+ tabIndex: 0,
1055
+ children: /* @__PURE__ */ e("div", { className: a["image-user-container__edit-btn"], children: /* @__PURE__ */ e("img", { src: W("/images/user/Edit.svg"), alt: "edit-avatar" }) })
1056
+ }
1057
+ ),
1058
+ s && /* @__PURE__ */ e(
1059
+ "button",
1060
+ {
1061
+ type: "button",
1062
+ onClick: () => x(),
1063
+ className: a["image-user-container__delete-btn"],
1064
+ children: /* @__PURE__ */ e("img", { src: W("/images/user/DeleteAvatar.svg"), alt: "delete-avatar" })
1065
+ }
1066
+ )
1067
+ ] }),
1068
+ /* @__PURE__ */ o("div", { className: a["name-role-container"], children: [
1069
+ /* @__PURE__ */ e("div", { className: a.name, children: `${n?.firstName || ""} ${n?.lastName || ""}` }),
1070
+ /* @__PURE__ */ e("div", { className: a.role, children: Array.from(/* @__PURE__ */ new Set([...n?.msRoles || [], ...n?.esRoles || []])).map((d) => d === "SecondaryTeacher" ? "Support Teacher" : d).join(", ") })
1071
+ ] })
1072
+ ] }),
1073
+ /* @__PURE__ */ o("div", { className: a["user-profile-container-admin__left--btn-control"], children: [
1074
+ le.filter((d) => d.isControl).map((d) => /* @__PURE__ */ o(
1075
+ "button",
1076
+ {
1077
+ type: "button",
1078
+ className: `${a.item} ${N === d.value ? a["item-active"] : ""}`,
1079
+ onClick: () => m(d.value),
1080
+ children: [
1081
+ /* @__PURE__ */ e("img", { src: W(d.icon), alt: d.icon }),
1082
+ d.label
1083
+ ]
1084
+ },
1085
+ d.value
1086
+ )),
1087
+ !!s && !!U && I?.id === s && /* @__PURE__ */ o(
1088
+ "button",
1089
+ {
1090
+ type: "button",
1091
+ className: `${a.item} ${N === U.value ? a["item-active"] : ""}`,
1092
+ onClick: () => m(U.value),
1093
+ children: [
1094
+ /* @__PURE__ */ e("img", { src: W(U.icon), alt: U.icon }),
1095
+ U.label
1096
+ ]
1097
+ },
1098
+ U.value
1099
+ ),
1100
+ s && D && /* @__PURE__ */ o(
1101
+ "button",
1102
+ {
1103
+ type: "button",
1104
+ className: `${a.item} ${N === D.value ? a["item-active"] : ""}`,
1105
+ onClick: () => y({ email: n?.email || "" }),
1106
+ children: [
1107
+ /* @__PURE__ */ e("img", { src: W(D.icon), alt: D.icon }),
1108
+ D.label
1109
+ ]
1110
+ },
1111
+ D.value
1112
+ ),
1113
+ s && A && /* @__PURE__ */ o(
1114
+ "button",
1115
+ {
1116
+ type: "button",
1117
+ className: `${a.item} ${N === A.value ? a["item-active"] : ""}`,
1118
+ onClick: () => L(),
1119
+ children: [
1120
+ /* @__PURE__ */ e("img", { src: W(A.icon), alt: A.icon }),
1121
+ A.label
1122
+ ]
1123
+ },
1124
+ A.value
1125
+ )
1126
+ ] })
1127
+ ] }),
1128
+ /* @__PURE__ */ e("div", { className: a["user-profile-container-admin__right"], children: q.find((d) => d.value === N)?.component })
1129
+ ] });
1130
+ };
1131
+ export {
1132
+ aa as default
1133
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),fe=require("reactstrap"),c=require("mario-core"),he=require("./constants-DfnEgLPg.cjs"),p=require("react"),re=require("react-redux"),xe=require("formik"),Te=require("yup"),j=require("@mui/material"),ge=require("@mui/x-date-pickers"),Ce=require("moment"),b=require("./OutlinedInput-Ce7Dma58.cjs"),be=require("./constants-BIVJZV78.cjs"),je=require("./DoneCheckInIcon-7Q31KvHI.cjs"),_e=require("./userService-DsbgpY7L.cjs"),Ee=require("./styles.module-CHKJJ8Zm.cjs"),ke=require("./AdapterMoment-B-q0UCj0.cjs"),le=require("./Visibility-CDU117S_.cjs"),ce=require("./IconButton-DWhytE6k.cjs"),ye=require("react-router-dom"),Pe=require("date-fns");function De(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const v=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,v.get?v:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const P=De(Te),Re="_name_1koi9_205",Ae="_role_1koi9_217",Ue="_item_1koi9_230",Me="_gender_1koi9_323",Ie="_gender__item_1koi9_328",r={"profile-value":"_profile-value_1koi9_77","input-error":"_input-error_1koi9_94","user-profile-container-admin":"_user-profile-container-admin_1koi9_122","user-profile-container-admin__left":"_user-profile-container-admin__left_1koi9_135","user-profile-container-admin__left--information":"_user-profile-container-admin__left--information_1koi9_146","image-user-container":"_image-user-container_1koi9_154","image-user-container__image":"_image-user-container__image_1koi9_169","image-user-container__edit-btn":"_image-user-container__edit-btn_1koi9_176","image-user-container__delete-btn":"_image-user-container__delete-btn_1koi9_190","name-role-container":"_name-role-container_1koi9_205",name:Re,role:Ae,"user-profile-container-admin__left--btn-control":"_user-profile-container-admin__left--btn-control_1koi9_224",item:Ue,"item-active":"_item-active_1koi9_246","user-profile-container-admin__right":"_user-profile-container-admin__right_1koi9_274","edit-profile-container":"_edit-profile-container_1koi9_285","edit-profile-container__title":"_edit-profile-container__title_1koi9_290","edit-profile-container__form":"_edit-profile-container__form_1koi9_297","edit-profile-container__form--row":"_edit-profile-container__form--row_1koi9_302","edit-profile-container__form--field":"_edit-profile-container__form--field_1koi9_307",gender:Me,gender__item:Ie,"edit-profile-container__form--width-50":"_edit-profile-container__form--width-50_1koi9_334","edit-profile-container__form--width-30":"_edit-profile-container__form--width-30_1koi9_337","edit-profile-container__form--width-70":"_edit-profile-container__form--width-70_1koi9_340","edit-profile-container__form--btn-group":"_edit-profile-container__form--btn-group_1koi9_343","btn-save":"_btn-save_1koi9_349","btn-cancel":"_btn-cancel_1koi9_371"};var J=(t=>(t.Info="info",t.ForgotPassword="forgotPassword",t.DownloadUserData="downloadUserData",t.ChangePassword="changePassword",t))(J||{});const ne=[{value:"info",label:"Personal Information",icon:"/images/user/User.svg",isControl:!0},{value:"changePassword",label:"Change Password",icon:"/images/user/Lock.svg",isControl:!1},{value:"forgotPassword",label:"Send Forgot Password Link",icon:"/images/user/Lock.svg",isControl:!1},{value:"downloadUserData",label:"Download User Data",icon:"/images/user/Log-out.svg",isControl:!1}],Ne=["Admin","Assistant","Teacher","Counselor","General ED teacher","SecondaryTeacher","Parent","Student"],$e=Ne,Le=Ne.filter(t=>t!=="SecondaryTeacher"),Fe=t=>t==="both"?["MS","ES"]:[t.toUpperCase()],Oe=t=>t==="both"?"ES, MS":t.toUpperCase(),de=(t,n)=>{const o=(t||"").toUpperCase();if(o==="ES, MS")return"both";if(o==="ES")return"es";if(o==="MS")return"ms";const v=(n||[]).includes("MS");return(n||[]).includes("ES")&&!v?"es":"ms"},D={EDUTEACHER:"General ED teacher",STUDENT:"Student"},qe=[{value:!0,label:"Active"},{value:!1,label:"Inactive"}],ve=["K","G","1","2","3","4","5","6","7","8","9","10","11","12",...he.isMalvernCollege?["12/13"]:[],"13",...he.isSaisSchool?["PCS"]:[]],ue=["K","G","1","2","3","4","5"],me=["6","7","8","9","10","11","12","12/13","13","PCS"],we=["Student"],Be=P.object({firstName:P.string().required("First name is required"),lastName:P.string().required("Last name is required"),email:P.string().email("Email is invalid").required("Email is required"),appTypes:P.array().of(P.string()).min(1,"School tier is required"),msRoles:P.array().of(P.string()).test("ms-role-required","MS role is required",(t,n)=>{const o=de(n.parent.preferredAppType,n.parent.appTypes);return o!=="ms"&&o!=="both"?!0:!!t&&t.length>0}),esRoles:P.array().of(P.string()).test("es-role-required","ES role is required",(t,n)=>{const o=de(n.parent.preferredAppType,n.parent.appTypes);return o!=="es"&&o!=="both"?!0:!!t&&t.length>0}),gradeLevel:P.string().nullable().test("grade-level-required","Grade level is required",(t,n)=>{const o=n.parent.msRoles||[],v=n.parent.esRoles||[];return o.includes("Student")||v.includes("Student")?!!t:!0})}),Ve={currentPage:1,pageSize:100},He=(t,n)=>{const[o,v]=p.useState([]),[f,d]=p.useState(!1),[T,w]=p.useState(Ve),[$,N]=p.useState(),m=re.useDispatch(),O=p.useCallback(async()=>{d(!0);try{const l=(await _e.getRosterUsersApi(T)).data?.items||[];v(q(l))}catch{m(c.setAlert({type:"error",message:"Cannot get roster users"}))}d(!1)},[JSON.stringify(T)]),W=p.useCallback(async()=>{if(!n)return;const y=o.find(l=>l.value===n);if(y){N(y);return}d(!0);try{const C=(await _e.getRosterUserBySourcedIdApi(n)).data;N({label:L(C),value:C.sourcedId})}catch(l){console.log("err:",l)}d(!1)},[n]),q=y=>y.map(l=>({label:L(l),value:l.sourcedId})),L=y=>{const l=[],{givenName:C,middleName:B,familyName:R,email:I,role:U}=y,u=[];return C&&u.push(C),B&&u.push(B),R&&u.push(R),u.length&&l.push(u.join(" ")),I&&l.push(I),`${l.join(" - ")}${U?` (${U})`:""}`},_=y=>{w(l=>({...l,searchString:y}))},S=p.useCallback(y=>{w({...T,...y})},[JSON.stringify(T)]);return p.useEffect(()=>{T.roles?.length&&O()},[JSON.stringify(T)]),p.useEffect(()=>{S({roles:t})},[JSON.stringify(t)]),p.useEffect(()=>{W()},[n]),{users:o,isLoading:f,user:$,handleInputChange:_}},ze=({value:t,roles:n,onChange:o})=>{const{users:v,isLoading:f,user:d,handleInputChange:T}=He(n,t);return e.jsx(j.Select,{label:"Select user",value:d?.value||"",onChange:w=>{o(w.target.value)},onOpen:()=>T(""),disabled:f,className:`${Ee.styles["profile-value"]}`,variant:"outlined",children:f?e.jsx(j.MenuItem,{disabled:!0,children:e.jsx(j.CircularProgress,{size:20})}):v.length>0?v.map(w=>e.jsx(j.MenuItem,{value:w.value,children:`${w.label}`},w.value)):e.jsx(j.MenuItem,{disabled:!0,children:"No users found"})})},Ge=({userDetail:t,confirmData:n,goBack:o,teacherOptions:v,getDataTeachers:f,id:d,checkHasTeacher:T,setCheckHasTeacher:w,userHasData:$,currentRoles:N})=>{const{t:m}=c.useTranslation(),O=p.useRef(null),q=re.useSelector(L=>L.common.user)?.hasEsSchool!==!1;return e.jsxs("div",{className:r["edit-profile-container"],children:[e.jsx("div",{className:r["edit-profile-container__title"],children:`${d?"Edit User Profile":"Create User"}`}),e.jsx(xe.Formik,{initialValues:t,enableReinitialize:!0,onSubmit:L=>{n(L)},validationSchema:Be,children:L=>{const{values:_,setFieldValue:S,handleSubmit:y,errors:l,touched:C}=L,B=Object.keys(l);B.length&&document.querySelector(`input[name=${B[0]}]`)?.scrollIntoView({behavior:"smooth",block:"center"});const R=_?.appTypes||[],I=R.includes("MS"),U=R.includes("ES"),u=_?.msRoles||[],K=_?.esRoles||[],F=u.includes(D.STUDENT)||K.includes(D.STUDENT),V=q?de(_?.preferredAppType,R):"ms",Q=V==="ms"||V==="both",ee=V==="es"||V==="both",G=F?V==="ms"?"MS":V==="es"?"ES":null:null,te=(a,h)=>{if(!h)return;const M=Fe(h),H=Oe(h);d?S("preferredAppType",H):(S("appTypes",M),S("preferredAppType",H),F&&f(h==="both"?"MS":h.toUpperCase()))},oe=a=>h=>{const M=h.target.value,H=a==="MS"?"msRoles":"esRoles",Y=a==="MS"?"esRoles":"msRoles",x=O.current,A=$?.[a]??{};if(d&&(A.isHasTeacherData&&x==="Teacher"||A.isHasAssistantData&&x==="Assistant"||A.isHasCounselorData&&x==="Counselor"||A.isHasSecondaryTeacherData&&x==="SecondaryTeacher"||x==="Student"&&(A.isHasAssistantData||A.isHasCounselorData||A.isHasSecondaryTeacherData||A.isHasTeacherData))){alert("Please switch data before removing the role");return}const X=_?.[H]||[],ie=M.some(g=>we.includes(g))?x&&!X.includes(x)?[x]:[M.find(g=>we.includes(g))].filter(Boolean):M,s=X.includes(D.STUDENT),i=ie.includes(D.STUDENT);S(H,ie),O.current=null,i?(S("preferredAppType",a),S(Y,[D.STUDENT]),d||(S("appTypes",[a]),f(a))):s&&!i&&S(Y,[])},ae=a=>{const h=a==="MS"?"msRoles":"esRoles",M=a==="MS"?u:K,H=a==="MS"?$e:Le,Y=N?.[a]||[];return e.jsxs("div",{className:`${r["edit-profile-container__form--field"]} ${Q&&ee?r["edit-profile-container__form--width-50"]:""}`,children:[e.jsxs("p",{children:[q&&e.jsx("span",{style:{display:"inline-block",fontSize:11,fontWeight:700,color:"#3b4ba8",backgroundColor:"#e9ecfb",borderRadius:4,padding:"1px 6px",marginRight:6,verticalAlign:"middle"},children:a}),q?a==="MS"?"Middle school roles":"Elementary school roles":"Roles"," ",e.jsx("sup",{children:"*"})]}),e.jsx(j.Select,{variant:"outlined",multiple:!0,name:h,value:M,renderValue:x=>x.map(A=>A==="SecondaryTeacher"?"Support Teacher":A).join(", "),onChange:oe(a),className:`${r["profile-value"]}`,children:H.map(x=>{const A=N?.MS?.includes(D.STUDENT)||N?.ES?.includes(D.STUDENT);return e.jsxs(j.MenuItem,{value:x,disabled:d?Y.some(X=>["Student","Parent","General ED teacher"].includes(X))||["Parent"].includes(x)||!A&&x===D.STUDENT:["Parent"].includes(x)||F&&x!==D.STUDENT,onClick:()=>{O.current=x},children:[e.jsx(j.Checkbox,{checked:M.includes(x)}),e.jsx(j.ListItemText,{primary:x==="SecondaryTeacher"?"Support Teacher":x})]},x)})}),l[h]&&C[h]?e.jsx("div",{className:`${r["input-error"]}`,children:l[h]}):null]})};return e.jsxs("div",{className:r["edit-profile-container__form"],children:[e.jsxs("div",{className:r["edit-profile-container__form--row"],children:[e.jsxs("div",{className:`${r["edit-profile-container__form--field"]} ${r["edit-profile-container__form--width-50"]}`,children:[e.jsxs("p",{children:[m("first_name")," ",e.jsx("sup",{children:"*"})]}),e.jsx(j.TextField,{name:"firstName",variant:"outlined",value:_?.firstName||"",onChange:a=>S("firstName",a.target.value)}),l.firstName&&C.firstName?e.jsx("div",{className:`${r["input-error"]}`,children:l.firstName}):null]}),e.jsxs("div",{className:`${r["edit-profile-container__form--field"]} ${r["edit-profile-container__form--width-50"]}`,children:[e.jsxs("p",{children:[m("last_name")," ",e.jsx("sup",{children:"*"})]}),e.jsx(j.TextField,{name:"lastName",variant:"outlined",className:`${r["profile-value"]}`,value:_?.lastName||"",onChange:a=>S("lastName",a.target.value)}),l.lastName&&C.lastName?e.jsx("div",{className:`${r["input-error"]}`,children:l.lastName}):null]})]}),e.jsxs("div",{className:r["edit-profile-container__form--row"],children:[e.jsxs("div",{className:`${r["edit-profile-container__form--field"]} ${r["edit-profile-container__form--width-30"]}`,children:[e.jsxs("p",{children:[" ",m("date_of_birth")]}),e.jsx(ge.LocalizationProvider,{dateAdapter:ke.AdapterMoment,children:e.jsx(ge.DatePicker,{format:"Do MMM YYYY",value:_?.dateOfBirth&&!be.DATE_MIN_VALUE.includes(_?.dateOfBirth)?Ce(_?.dateOfBirth):null,onChange:a=>{if(a){const h=a.format("YYYY-MM-DD");S("dateOfBirth",h)}else S("dateOfBirth",null)},slotProps:{textField:{variant:"outlined",id:"time-picker",className:`${r["profile-value"]}`},openPickerButton:{"aria-label":"change date"}}})})]}),e.jsxs("div",{className:`${r["edit-profile-container__form--field"]} ${r["edit-profile-container__form--width-70"]}`,children:[e.jsxs("p",{children:[m("email")," ",e.jsx("sup",{children:"*"})]}),e.jsx(j.TextField,{name:"email",variant:"outlined",className:`${r["profile-value"]}`,value:_?.email||"",onChange:a=>S("email",a.target.value)}),l.email&&C.email?e.jsx("div",{className:`${r["input-error"]}`,children:l.email}):null]})]}),e.jsxs("div",{style:{border:"1px solid #e0e0e0",borderRadius:"12px",marginBottom:"24px",overflow:"hidden"},children:[q&&e.jsx("div",{style:{backgroundColor:"#f8f9fa",padding:"16px 24px",borderBottom:"1px solid #e0e0e0"},children:e.jsxs("div",{className:`${r["edit-profile-container__form--field"]}`,style:{marginBottom:0,width:"100%"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs("div",{children:[e.jsxs("p",{style:{marginBottom:4,fontWeight:600,fontSize:16},children:["School tier ",e.jsx("sup",{children:"*"})]}),e.jsx("p",{style:{fontSize:13,color:"#6c757d",marginTop:0,marginBottom:0},children:"Pick a tier. Roles are assigned per tier."})]}),e.jsxs(j.ToggleButtonGroup,{exclusive:!0,value:V,onChange:te,size:"small",sx:{border:"1px solid #e0e0e0",borderRadius:"30px",padding:"4px",backgroundColor:"#fff","& .MuiToggleButton-root":{border:"none",borderRadius:"30px !important",textTransform:"none",padding:"6px 20px",margin:"0",color:"#6c757d",fontWeight:500,fontSize:14,"&.Mui-selected":{backgroundColor:"#2b65d9",color:"#fff","&:hover":{backgroundColor:"#1d4ed8"}}}},children:[e.jsx(j.ToggleButton,{value:"ms",disabled:!!d&&!I&&F,children:"Middle school"}),e.jsx(j.ToggleButton,{value:"es",disabled:!!d&&!U&&F,children:"Elementary"}),!F&&e.jsx(j.ToggleButton,{value:"both",disabled:!1,children:"Both"})]})]}),l.appTypes&&C.appTypes?e.jsx("div",{className:`${r["input-error"]}`,children:l.appTypes}):null]})}),e.jsx("div",{style:{backgroundColor:"#fff",padding:"24px"},children:e.jsxs("div",{className:r["edit-profile-container__form--row"],style:{margin:0},children:[ee&&ae("ES"),Q&&ae("MS")]})})]}),e.jsx("div",{className:r["edit-profile-container__form--row"],children:e.jsxs("div",{className:`${r["edit-profile-container__form--field"]} ${r["edit-profile-container__form--width-50"]}`,children:[e.jsx("p",{children:m("status")}),e.jsx("div",{className:`${r.gender}`,children:qe.map(a=>e.jsxs("div",{className:`${r.gender__item}`,children:[e.jsx(j.Radio,{color:"primary",value:a.value,checked:_?.isActive===a.value,onChange:()=>S("isActive",a.value),disabled:!!d&&!!_?.isImportedFromIntegration}),a.label]},a.label))})]})}),F&&!d&&!!v&&e.jsx("div",{className:r["edit-profile-container__form--row"],children:e.jsxs("div",{className:`${r["edit-profile-container__form--field"]}`,children:[e.jsxs("p",{children:["Assign Teacher ",e.jsx("sup",{children:"*"})]}),e.jsx(j.Select,{multiple:!0,variant:"outlined",name:"teacherUserId",value:_?.teacherUserId||[],renderValue:a=>v.filter(h=>a.includes(h.value)).map(h=>h.label).join(", "),onChange:a=>{const h=a.target.value;S("teacherUserId",h),w(!!h.length)},className:`${r["profile-value"]}`,children:v?.map(a=>e.jsx(j.MenuItem,{value:a.value,children:a.label},a.value))}),!T&&e.jsx("div",{className:`${r["input-error"]}`,children:"Teacher is required"})]})}),F&&e.jsx("div",{className:r["edit-profile-container__form--row"],children:e.jsxs("div",{className:`${r["edit-profile-container__form--field"]} ${r["edit-profile-container__form--width-50"]}`,children:[e.jsxs("p",{children:[" ",m("grade_level")," ",e.jsx("sup",{children:"*"})]}),e.jsxs(j.Select,{variant:"outlined",value:_?.gradeLevel??"",renderValue:a=>a,onChange:a=>S("gradeLevel",a.target.value),className:`${r["profile-value"]}`,children:[_?.gradeLevel&&!ve.filter(a=>{const h=ue.includes(a),M=me.includes(a);return G?G==="MS"?M:G==="ES"?h:!1:!0}).includes(_.gradeLevel)&&e.jsx(j.MenuItem,{value:_.gradeLevel,sx:{display:"none"},children:_.gradeLevel},"__current__"),ve.filter(a=>{const h=ue.includes(a),M=me.includes(a);return G?G==="MS"?M:G==="ES"?h:!1:!0}).map(a=>e.jsx(j.MenuItem,{value:a,children:a},a))]}),l.gradeLevel&&C.gradeLevel?e.jsx("div",{className:`${r["input-error"]}`,children:l.gradeLevel}):null]})}),!F&&(!!u.length||!!K.length)&&!!d&&e.jsx("div",{className:r["edit-profile-container__form--row"],children:e.jsxs("div",{className:`${r["edit-profile-container__form--field"]} ${r["edit-profile-container__form--width-50"]}`,children:[e.jsx("p",{children:m("Map from Roster")}),e.jsx(ze,{roles:[...u,...K],value:_.sourcedId,onChange:a=>S("sourcedId",a)})]})}),e.jsxs("div",{className:r["edit-profile-container__form--btn-group"],children:[e.jsx("button",{type:"button",className:r["btn-cancel"],onClick:()=>o(),children:m("cancel")}),e.jsxs("button",{type:"button",className:r["btn-save"],onClick:()=>y(),children:[e.jsx(je.DoneCheckInIcon,{color:"#fff"}),m("save_changes")]})]})]})}})]})},k={"input-error":"_input-error_gmvmh_1","change-password-container":"_change-password-container_gmvmh_6","change-password-container__title":"_change-password-container__title_gmvmh_11","change-password-container__form":"_change-password-container__form_gmvmh_19","change-password-container__form--field":"_change-password-container__form--field_gmvmh_24","change-password-container__form--description":"_change-password-container__form--description_gmvmh_38","change-password-container__form--btn-group":"_change-password-container__form--btn-group_gmvmh_54","btn-save":"_btn-save_gmvmh_60","btn-cancel":"_btn-cancel_gmvmh_82"},Ye=P.object({oldPassword:P.string().required("Old password is required"),newPassword:P.string().required("New password is required"),confirmedNewPassword:P.string().oneOf([P.ref("newPassword"),void 0],"New password must match").required("Confirm your new password")}),Je=({confirmChangePassword:t,goBack:n})=>{const{t:o}=c.useTranslation();return e.jsxs("div",{className:k["change-password-container"],children:[e.jsx("div",{className:k["change-password-container__title"],children:o("change_password")}),e.jsx(xe.Formik,{initialValues:{oldPassword:"",newPassword:"",confirmedNewPassword:"",showOldPassword:!1,showNewPassword:!1,showConfirmNewPassword:!1},enableReinitialize:!0,onSubmit:v=>{t(v)},validateOnChange:!1,validateOnBlur:!1,validationSchema:Ye,children:v=>{const{values:f,setFieldValue:d,handleSubmit:T,errors:w,touched:$}=v,N=Object.keys(w);return N.length&&document.querySelector(`input[name=${N[0]}]`)?.scrollIntoView({behavior:"smooth",block:"center"}),e.jsxs("div",{className:k["change-password-container__form"],children:[e.jsxs("div",{className:`${k["change-password-container__form--field"]}`,children:[e.jsx("p",{children:o("old_password")}),e.jsx(b.FormControl,{variant:"outlined",className:`${k["input-field"]}`,children:e.jsx(b.OutlinedInput,{type:f.showOldPassword?"text":"password",value:f?.oldPassword,onChange:m=>d("oldPassword",m.target.value.trim()),endAdornment:e.jsx(b.InputAdornment,{position:"end",children:e.jsx(ce.IconButton,{"aria-label":"toggle password visibility",onClick:()=>d("showOldPassword",!f.showOldPassword),onMouseDown:m=>m.preventDefault(),children:f.showOldPassword?e.jsx(le.Visibility,{color:"primary"}):e.jsx(b.VisibilityOff,{color:"primary"})})})})}),w.oldPassword&&$.oldPassword&&e.jsx("div",{className:`${k["input-error"]}`,children:w.oldPassword})]}),e.jsxs("div",{className:`${k["change-password-container__form--field"]}`,children:[e.jsx("p",{children:o("new_password")}),e.jsx(b.FormControl,{variant:"outlined",className:`${k["input-field"]}`,children:e.jsx(b.OutlinedInput,{type:f.showNewPassword?"text":"password",value:f?.newPassword,onChange:m=>d("newPassword",m.target.value.trim()),endAdornment:e.jsx(b.InputAdornment,{position:"end",children:e.jsx(ce.IconButton,{"aria-label":"toggle password visibility",onClick:()=>d("showNewPassword",!f.showNewPassword),onMouseDown:m=>m.preventDefault(),children:f.showNewPassword?e.jsx(le.Visibility,{color:"primary"}):e.jsx(b.VisibilityOff,{color:"primary"})})})})}),w.newPassword&&$.newPassword&&e.jsx("div",{className:`${k["input-error"]}`,children:w.newPassword}),e.jsxs("div",{className:`${k["change-password-container__form--description"]}`,children:["Password must contain at least: 1 uppercase letter, 1 lowercase letter,",e.jsx("br",{})," 1 number, and 1 special character"]})]}),e.jsxs("div",{className:`${k["change-password-container__form--field"]}`,children:[e.jsx("p",{children:o("confirm_new_password")}),e.jsx(b.FormControl,{variant:"outlined",className:`${k["input-field"]}`,children:e.jsx(b.OutlinedInput,{type:f.showConfirmNewPassword?"text":"password",value:f?.confirmedNewPassword,onChange:m=>d("confirmedNewPassword",m.target.value.trim()),endAdornment:e.jsx(b.InputAdornment,{position:"end",children:e.jsx(ce.IconButton,{"aria-label":"toggle password visibility",onClick:()=>d("showConfirmNewPassword",!f.showConfirmNewPassword),onMouseDown:m=>m.preventDefault(),children:f.showConfirmNewPassword?e.jsx(le.Visibility,{color:"primary"}):e.jsx(b.VisibilityOff,{color:"primary"})})})})}),w.confirmedNewPassword&&$.confirmedNewPassword&&e.jsx("div",{className:`${k["input-error"]}`,children:w.confirmedNewPassword})]}),e.jsxs("div",{className:k["change-password-container__form--btn-group"],children:[e.jsx("button",{type:"button",className:k["btn-cancel"],onClick:()=>{n()},children:o("cancel")}),e.jsxs("button",{type:"button",className:k["btn-save"],onClick:()=>T(),children:[e.jsx(je.DoneCheckInIcon,{color:"#fff"}),o("save_new_password")]})]})]})}})]})},We={id:"",firstName:"",lastName:"",email:"",dateOfBirth:be.DATE_MIN_VALUE,msRoles:[],esRoles:[],isActive:!0,profileImageFileName:"",teacherUserId:[],gradeLevel:"",currentGradeLevel:"",isImportedFromIntegration:!1,appTypes:["MS"],preferredAppType:"MS"},Se="/admin/users/user-list",Ke="User detail",Xe=12,Ze=20,Qe=t=>{const n=re.useDispatch(),o=ye.useNavigate(),v=re.useSelector(s=>s.common.user),f=re.useSelector(s=>s.common?.defaultFontSize),[d,T]=p.useState(We),[w,$]=p.useState(null),[N,m]=p.useState(!1),[O,W]=p.useState({MS:[],ES:[]}),[q,L]=p.useState([]),[_,S]=p.useState(!1),[y,l]=p.useState(J.Info),[C,B]=p.useState(!0),[R,I]=p.useState({}),U=async()=>{localStorage.setItem(window.location.href,"true"),m(!0)},u=()=>{S(!_)},K=p.useMemo(()=>f==Ze?"font-large":f==Xe?"font-small":"",[f]);p.useEffect(()=>{document.title=Ke,m(!1),localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href)},[]),p.useEffect(()=>{t&&V(),!t&&h()},[t]);const F=(s=[])=>s.includes("EduTeacher")?[...s.filter(i=>i!=="EduTeacher"),D.EDUTEACHER]:s,V=p.useCallback(async()=>{n(c.setLoading(!0));try{const s=await b.getByIdUser(t),i=(s.data.appTypeRaw||s.data.appType||"MS").toUpperCase(),g=i.includes("MS"),E=i.includes("ES"),z=g&&E?["MS","ES"]:E?["ES"]:["MS"],Z=s.data.preferredAppType||i;T({...s.data,dateOfBirth:Pe.format(new Date(s.data.dateOfBirth),c.DATE_FORMAT),msRoles:F(s.data.msRoles),esRoles:F(s.data.esRoles),currentGradeLevel:s.data.gradeLevel,appTypes:z,preferredAppType:Z}),W({MS:s.data.msRoles??[],ES:s.data.esRoles??[]}),document.title=s.data?.fullName,g&&Q("MS"),E&&Q("ES")}catch(s){n(c.setAlert({type:"danger",message:s.response?.data?.title||s.message}))}n(c.setLoading(!1))},[t]),Q=p.useCallback(async s=>{n(c.setLoading(!0));try{const i=await b.userRoleHasDataApi(t,s);I(g=>({...g,[s]:i.data}))}catch(i){n(c.setAlert({type:"danger",message:i.response?.data?.title||i.message}))}n(c.setLoading(!1))},[t]),ee=p.useCallback(s=>{o(s&&typeof s=="string"?Se+`?query=${s}`:Se)},[]),G=s=>["Student","Parent","EduTeacher"].includes(s),te=(s=[])=>s.includes(D.EDUTEACHER)?[...s.filter(i=>i!==D.EDUTEACHER),"EduTeacher"]:s,oe=p.useCallback(async s=>{const i=s.msRoles?.includes(D.STUDENT)||s.esRoles?.includes(D.STUDENT);if(i&&!t&&!s.teacherUserId){B(!1);return}if(i&&s.gradeLevel){const g=s.msRoles?.includes(D.STUDENT),E=s.esRoles?.includes(D.STUDENT),z=s.preferredAppType,Z=g&&!E?"MS":E&&!g?"ES":z==="MS"||z==="ES"?z:null,se=Z==="MS"?me:Z==="ES"?ue:null;if(se&&!se.includes(s.gradeLevel)){n(c.setAlert({type:"danger",message:`Grade "${s.gradeLevel}" is not valid for ${Z} students. Please select a new grade level.`}));return}}n(c.setLoading(!0));try{v?.hasEsSchool===!1&&(s.appTypes=["MS"],s.preferredAppType="MS",s.esRoles=[]);const g=t?b.update:b.create;!t&&delete s.id,s.teacherUserId=i?s.teacherUserId:[],s.msRoles=te(s.msRoles),s.esRoles=te(s.esRoles),t||(s.profileImageFileName=w||"");const E=await g(s);E&&b.getById(E.data.id).then(z=>{ee(z.data.fullName)}),t||alert("Password of "+E.data.email+` is "${E.data.password}"`),n(c.setAlert({type:"success",message:`${t?"Update":"Create"} user successfully`}))}catch(g){n(c.setAlert({type:"danger",message:g.response?.data?.title||g.message}))}n(c.setLoading(!1))},[t,w]),ae=async s=>{n(c.setLoading(!0));try{await b.changePassword(s),n(c.setAlert({type:"success",message:"Change password successfully"}))}catch(i){n(c.setAlert({type:"danger",message:i.response?.data?.title||i.message}))}n(c.setLoading(!1))},a=p.useCallback(async s=>{n(c.setLoading(!0));try{await b.forgotChangePassword(s),n(c.setAlert({type:"success",message:"Send forgot password link successfully"}))}catch(i){n(c.setAlert({type:"danger",message:i.response?.data?.title||i.message||"Error occured"}))}n(c.setLoading(!1))},[]),h=async s=>{try{const i=await b.getTeachers({sortBy:"Email"},s);i.data&&L((i.data.map?.(g=>({label:g.email,value:g.id}))||[]).sort((g,E)=>g.label.localeCompare(E.label)))}catch(i){n(c.setAlert({type:"danger",message:i.response?.data?.title||i.message}))}},M=20097152,[H,Y]=p.useState(""),x=s=>{s.preventDefault();let i=new FileReader,g=s.target.files[0];if(g.size>M){n(c.setAlert({type:"danger",message:"File can't be larger than 2MB"}));return}i.onloadend=async()=>{if(Y(i.result),g){const E=new FormData,{name:z}=g;E.append("file",g,z);const se=(await b.systemProfileUpload(E))?.data?.key;t?await b.updateAvatarByAdminApi(d.id||"",se):$(se)}},g&&i.readAsDataURL(g)},A=async()=>{await b.updateAvatarByAdminApi(d.id||"",""),Y("")},X=H||c.getFileUrl(d?.profileImageFileName),pe=d?.profileImageFileName||"";return{userDetail:d,getDataTeachers:h,backToList:ee,confirmData:oe,file:w,setFile:$,edited:N,currentRoles:O,setEdited:m,setEditedTrue:U,confirmChangePassword:ae,forgotPasswordRequest:a,handleDisableRoles:G,classFontSize:K,teacherOptions:q,handleToggleModel:u,openModel:_,user:v,activeTab:y,setActiveTab:l,imageSrc:X,imageUse:pe,handleImageChange:x,handleDeleteAvatar:A,getFile:()=>{var s=window.location.origin+"/api/ExportDataUser/"+t;window.open(s)},checkHasTeacher:C,setCheckHasTeacher:B,userHasData:R}},es="/images/image-default.png",ss=()=>{const{id:t}=ye.useParams(),{userDetail:n,getDataTeachers:o,backToList:v,confirmData:f,confirmChangePassword:d,forgotPasswordRequest:T,teacherOptions:w,user:$,activeTab:N,setActiveTab:m,imageSrc:O,handleImageChange:W,handleDeleteAvatar:q,getFile:L,currentRoles:_,handleDisableRoles:S,checkHasTeacher:y,setCheckHasTeacher:l,userHasData:C}=Qe(t),B=[{value:J.Info,component:e.jsx(Ge,{id:t,goBack:v,userDetail:n,confirmData:f,teacherOptions:w,getDataTeachers:o,currentRoles:_,handleDisableRoles:S,checkHasTeacher:y,setCheckHasTeacher:l,userHasData:C})},{value:J.ChangePassword,component:e.jsx(Je,{confirmChangePassword:d,goBack:v})}],R=ne.find(u=>u.value===J.ForgotPassword),I=ne.find(u=>u.value===J.DownloadUserData),U=ne.find(u=>u.value===J.ChangePassword);return e.jsxs("div",{className:r["user-profile-container-admin"],children:[e.jsxs("div",{className:r["user-profile-container-admin__left"],children:[e.jsxs("div",{className:r["user-profile-container-admin__left--information"],children:[e.jsxs("div",{className:r["image-user-container"],children:[e.jsx(fe.Input,{className:"d-none",type:"file",id:"uploadFile",onChange:W,accept:"image/*"}),e.jsx("img",{src:O||c.getStaticFileUrl(es),alt:"avatar",className:`${r["image-user-container__image"]}`}),e.jsx(fe.Label,{htmlFor:"uploadFile",role:"button",tabIndex:0,children:e.jsx("div",{className:r["image-user-container__edit-btn"],children:e.jsx("img",{src:c.getStaticFileUrl("/images/user/Edit.svg"),alt:"edit-avatar"})})}),t&&e.jsx("button",{type:"button",onClick:()=>q(),className:r["image-user-container__delete-btn"],children:e.jsx("img",{src:c.getStaticFileUrl("/images/user/DeleteAvatar.svg"),alt:"delete-avatar"})})]}),e.jsxs("div",{className:r["name-role-container"],children:[e.jsx("div",{className:r.name,children:`${n?.firstName||""} ${n?.lastName||""}`}),e.jsx("div",{className:r.role,children:Array.from(new Set([...n?.msRoles||[],...n?.esRoles||[]])).map(u=>u==="SecondaryTeacher"?"Support Teacher":u).join(", ")})]})]}),e.jsxs("div",{className:r["user-profile-container-admin__left--btn-control"],children:[ne.filter(u=>u.isControl).map(u=>e.jsxs("button",{type:"button",className:`${r.item} ${N===u.value?r["item-active"]:""}`,onClick:()=>m(u.value),children:[e.jsx("img",{src:c.getStaticFileUrl(u.icon),alt:u.icon}),u.label]},u.value)),!!t&&!!U&&$?.id===t&&e.jsxs("button",{type:"button",className:`${r.item} ${N===U.value?r["item-active"]:""}`,onClick:()=>m(U.value),children:[e.jsx("img",{src:c.getStaticFileUrl(U.icon),alt:U.icon}),U.label]},U.value),t&&R&&e.jsxs("button",{type:"button",className:`${r.item} ${N===R.value?r["item-active"]:""}`,onClick:()=>T({email:n?.email||""}),children:[e.jsx("img",{src:c.getStaticFileUrl(R.icon),alt:R.icon}),R.label]},R.value),t&&I&&e.jsxs("button",{type:"button",className:`${r.item} ${N===I.value?r["item-active"]:""}`,onClick:()=>L(),children:[e.jsx("img",{src:c.getStaticFileUrl(I.icon),alt:I.icon}),I.label]},I.value)]})]}),e.jsx("div",{className:r["user-profile-container-admin__right"],children:B.find(u=>u.value===N)?.component})]})};exports.default=ss;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("mario-core"),t=require("@ag-grid-enterprise/core"),e=require("react"),n=e.lazy(()=>Promise.resolve().then(()=>require("./ConferenceRubricList-CASLPVnE.cjs"))),i=e.lazy(()=>Promise.resolve().then(()=>require("./ConferenceRubricDetail-BcKMyu7H.cjs"))),s=e.lazy(()=>Promise.resolve().then(()=>require("./LearningStrategyList-c9ut_ZBs.cjs"))),a=e.lazy(()=>Promise.resolve().then(()=>require("./SetupContainer-CLOQ9w-y.cjs"))),l=e.lazy(()=>Promise.resolve().then(()=>require("./QuestionBankList-a0FN-Phc.cjs"))),u=e.lazy(()=>Promise.resolve().then(()=>require("./ReflectionContainer-T8k3ipxn.cjs"))),m=e.lazy(()=>Promise.resolve().then(()=>require("./QuestionDetail-qOOl31Ce.cjs"))),y=e.lazy(()=>Promise.resolve().then(()=>require("./SubjectList-DBvEGKQs.cjs"))),c=e.lazy(()=>Promise.resolve().then(()=>require("./LearningSupportCategoryList-BpCRx0CF.cjs"))),v=e.lazy(()=>Promise.resolve().then(()=>require("./BadgeList-DHs-Rsvu.cjs"))),P=e.lazy(()=>Promise.resolve().then(()=>require("./GoalExampleList-DdkEu4hA.cjs"))),h=e.lazy(()=>Promise.resolve().then(()=>require("./TutorialScreenContainer-Cc7pBhl5.cjs"))),q=e.lazy(()=>Promise.resolve().then(()=>require("./QuestionBankContainer-BwGHIERo.cjs"))),z=e.lazy(()=>Promise.resolve().then(()=>require("./SurveyQuestionContainer-CTaOAo9a.cjs"))),S=e.lazy(()=>Promise.resolve().then(()=>require("./SessionTemplateDetail-B9-wcCpc.cjs"))),d=e.lazy(()=>Promise.resolve().then(()=>require("./CustomAlertList-C9WlP5dR.cjs"))),C=e.lazy(()=>Promise.resolve().then(()=>require("./AssetLog-Bexcnjvn.cjs"))),g=e.lazy(()=>Promise.resolve().then(()=>require("./Dashboard-CyhUbj2F.cjs"))),p=e.lazy(()=>Promise.resolve().then(()=>require("./AdminTraining-CFhKwWEu.cjs"))),A=e.lazy(()=>Promise.resolve().then(()=>require("./TemplateContainer-wVMb1knJ.cjs"))),L=e.lazy(()=>Promise.resolve().then(()=>require("./OneRosterContainer-BsWxtfSQ.cjs"))),D=e.lazy(()=>Promise.resolve().then(()=>require("./SandboxContainer-2xT8qr0Z.cjs"))),b=e.lazy(()=>Promise.resolve().then(()=>require("./TemplateBuilderPage-RtTtRDYv.cjs"))),Q=e.lazy(()=>Promise.resolve().then(()=>require("./TemplateStartBuild-L-GJIKx5.cjs"))),T=e.lazy(()=>Promise.resolve().then(()=>require("./SurveyDashboardContainer--45lxz2v.cjs"))),W=e.lazy(()=>Promise.resolve().then(()=>require("./RevertUser-BQszWVGK.cjs"))),f=e.lazy(()=>Promise.resolve().then(()=>require("./CustomQuestionAlert-CxG1sL2e.cjs"))),R=e.lazy(()=>Promise.resolve().then(()=>require("./SurveyDetailAdmin-00pkvypI.cjs"))),B=e.lazy(()=>Promise.resolve().then(()=>require("./SurveyStudentFlagListAdmin-C5MREKO4.cjs"))),M=e.lazy(()=>Promise.resolve().then(()=>require("./SurveyResultAdmin-DzXnpqwQ.cjs"))),k=e.lazy(()=>Promise.resolve().then(()=>require("./SurveyIndexAdmin-D27jhWNF.cjs"))),F=e.lazy(()=>Promise.resolve().then(()=>require("./CreateSurveyAdmin-BHwRSSCq.cjs"))),I=e.lazy(()=>Promise.resolve().then(()=>require("./PreviewSurveyAdmin-BV0_f7Sk.cjs"))),x=e.lazy(()=>Promise.resolve().then(()=>require("./ExternalApi-C9QAZfYm.cjs"))),E=e.lazy(()=>Promise.resolve().then(()=>require("./WeeklyQuest-CTN2Q9aF.cjs"))),G=e.lazy(()=>Promise.resolve().then(()=>require("./SettingWeeklyQuest-CDi1sio0.cjs"))),O=e.lazy(()=>Promise.resolve().then(()=>require("./HomePage-Dj_9gia6.cjs"))),w=e.lazy(()=>Promise.resolve().then(()=>require("./MainLayoutAdmin-BCH_8O1B.cjs"))),H=e.lazy(()=>Promise.resolve().then(()=>require("./SyncData-C2Shc7Al.cjs"))),U=e.lazy(()=>Promise.resolve().then(()=>require("./SummarizeQuestion-CqQlUM5X.cjs"))),j=e.lazy(()=>Promise.resolve().then(()=>require("./SurveyQuestion-CvX38eWN.cjs"))),V=e.lazy(()=>Promise.resolve().then(()=>require("./MarioAi-CqHtgeFP.cjs"))),K=e.lazy(()=>Promise.resolve().then(()=>require("./AIMario-DP2HBmgn.cjs"))),N=e.lazy(()=>Promise.resolve().then(()=>require("./ChatWithAI-DOQCVUXe.cjs"))),_=e.lazy(()=>Promise.resolve().then(()=>require("./ViewHistoryPrompt-DAaaXoCx.cjs"))),$=e.lazy(()=>Promise.resolve().then(()=>require("./SurveyPortal-CRWz4TYf.cjs"))),J=e.lazy(()=>Promise.resolve().then(()=>require("./ConversationGoal-DpXDZc4j.cjs"))),X=e.lazy(()=>Promise.resolve().then(()=>require("./FrequencyAndSetup-CdoUkIkQ.cjs"))),Y=e.lazy(()=>Promise.resolve().then(()=>require("./DesignatedStaff-C7KVBBAN.cjs"))),Z=e.lazy(()=>Promise.resolve().then(()=>require("./WellBeingDashboard-BT1ibjgm.cjs"))),ee=e.lazy(()=>Promise.resolve().then(()=>require("./OpenFieldWellbeingQuestion-Z3w7NmKC.cjs"))),re=e.lazy(()=>Promise.resolve().then(()=>require("./MyProfile-oLwbD9-6.cjs"))),oe=e.lazy(()=>Promise.resolve().then(()=>require("./UserProfileManagement-CYgBLNA8.cjs"))),te=e.lazy(()=>Promise.resolve().then(()=>require("./EditFlagCard-CDHWffHh.cjs"))),ne=e.lazy(()=>Promise.resolve().then(()=>require("./ConversationTarget-BDG8Okh1.cjs"))),ie=e.lazy(()=>Promise.resolve().then(()=>require("./TeacherConversations-oDH8-5A2.cjs")).then(r=>r.TeacherConversations$1)),se=e.lazy(()=>Promise.resolve().then(()=>require("./index-DnCKrFI9.cjs"))),ae=e.lazy(()=>Promise.resolve().then(()=>require("./DashboardWrapper-BqcF82EB.cjs"))),le=e.lazy(()=>Promise.resolve().then(()=>require("./FlagAlertWrapper-D_OLRdEa.cjs"))),ue=e.lazy(()=>Promise.resolve().then(()=>require("./PersonalLearningPlansWrapper-CDAwvKfS.cjs")));t.LicenseManager.setLicenseKey(o.LICENSE_AGGRID);exports.AIMario=K;exports.AdminTraining=p;exports.AssetLog=C;exports.BadgeList=v;exports.ChatWithAI=N;exports.CheckInSetup=se;exports.ConferenceRubricDetail=i;exports.ConferenceRubricList=n;exports.ConversationGoal=J;exports.ConversationTarget=ne;exports.CreateSurveyAdmin=F;exports.CustomAlertList=d;exports.CustomQuestionAlert=f;exports.Dashboard=g;exports.DashboardWrapper=ae;exports.DesignatedStaff=Y;exports.EditFlagCard=te;exports.ExternalApi=x;exports.FlagAlertWrapper=le;exports.FrequencyAndSetup=X;exports.GoalExampleList=P;exports.HomePage=O;exports.LearningStrategyList=s;exports.LearningSupportCategoryList=c;exports.MainLayoutAdmin=w;exports.MarioAi=V;exports.MyProfile=re;exports.OneRosterContainer=L;exports.OpenFieldWellbeingQuestion=ee;exports.PersonalLearningPlansWrapper=ue;exports.PreviewSurveyAdmin=I;exports.QuestionBankContainer=q;exports.QuestionBankList=l;exports.QuestionDetail=m;exports.ReflectionContainer=u;exports.RevertUser=W;exports.SandboxContainer=D;exports.SessionTemplateDetail=S;exports.SettingWeeklyQuest=G;exports.SetupContainer=a;exports.SubjectList=y;exports.SummarizeQuestion=U;exports.SurveyDashboardContainer=T;exports.SurveyDetailAdmin=R;exports.SurveyIndexAdmin=k;exports.SurveyPortal=$;exports.SurveyQuestion=j;exports.SurveyQuestionContainer=z;exports.SurveyResultAdmin=M;exports.SurveyStudentFlagListAdmin=B;exports.SyncData=H;exports.TeacherConversations=ie;exports.TemplateBuilderPage=b;exports.TemplateContainer=A;exports.TemplateStartBuild=Q;exports.TutorialScreenContainer=h;exports.UserProfileManagement=oe;exports.ViewHistoryPrompt=_;exports.WeeklyQuest=E;exports.WellBeingDashboard=Z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("mario-core"),t=require("@ag-grid-enterprise/core"),e=require("react"),n=e.lazy(()=>Promise.resolve().then(()=>require("./ConferenceRubricList-CASLPVnE.cjs"))),i=e.lazy(()=>Promise.resolve().then(()=>require("./ConferenceRubricDetail-BcKMyu7H.cjs"))),s=e.lazy(()=>Promise.resolve().then(()=>require("./LearningStrategyList-c9ut_ZBs.cjs"))),a=e.lazy(()=>Promise.resolve().then(()=>require("./SetupContainer-CLOQ9w-y.cjs"))),l=e.lazy(()=>Promise.resolve().then(()=>require("./QuestionBankList-a0FN-Phc.cjs"))),u=e.lazy(()=>Promise.resolve().then(()=>require("./ReflectionContainer-T8k3ipxn.cjs"))),m=e.lazy(()=>Promise.resolve().then(()=>require("./QuestionDetail-qOOl31Ce.cjs"))),y=e.lazy(()=>Promise.resolve().then(()=>require("./SubjectList-DBvEGKQs.cjs"))),c=e.lazy(()=>Promise.resolve().then(()=>require("./LearningSupportCategoryList-BpCRx0CF.cjs"))),v=e.lazy(()=>Promise.resolve().then(()=>require("./BadgeList-DHs-Rsvu.cjs"))),P=e.lazy(()=>Promise.resolve().then(()=>require("./GoalExampleList-DdkEu4hA.cjs"))),h=e.lazy(()=>Promise.resolve().then(()=>require("./TutorialScreenContainer-Cc7pBhl5.cjs"))),q=e.lazy(()=>Promise.resolve().then(()=>require("./QuestionBankContainer-BwGHIERo.cjs"))),z=e.lazy(()=>Promise.resolve().then(()=>require("./SurveyQuestionContainer-CTaOAo9a.cjs"))),S=e.lazy(()=>Promise.resolve().then(()=>require("./SessionTemplateDetail-B9-wcCpc.cjs"))),d=e.lazy(()=>Promise.resolve().then(()=>require("./CustomAlertList-C9WlP5dR.cjs"))),C=e.lazy(()=>Promise.resolve().then(()=>require("./AssetLog-Bexcnjvn.cjs"))),g=e.lazy(()=>Promise.resolve().then(()=>require("./Dashboard-CyhUbj2F.cjs"))),p=e.lazy(()=>Promise.resolve().then(()=>require("./AdminTraining-CFhKwWEu.cjs"))),A=e.lazy(()=>Promise.resolve().then(()=>require("./TemplateContainer-wVMb1knJ.cjs"))),L=e.lazy(()=>Promise.resolve().then(()=>require("./OneRosterContainer-BsWxtfSQ.cjs"))),D=e.lazy(()=>Promise.resolve().then(()=>require("./SandboxContainer-2xT8qr0Z.cjs"))),b=e.lazy(()=>Promise.resolve().then(()=>require("./TemplateBuilderPage-RtTtRDYv.cjs"))),Q=e.lazy(()=>Promise.resolve().then(()=>require("./TemplateStartBuild-L-GJIKx5.cjs"))),T=e.lazy(()=>Promise.resolve().then(()=>require("./SurveyDashboardContainer--45lxz2v.cjs"))),W=e.lazy(()=>Promise.resolve().then(()=>require("./RevertUser-BQszWVGK.cjs"))),f=e.lazy(()=>Promise.resolve().then(()=>require("./CustomQuestionAlert-CxG1sL2e.cjs"))),R=e.lazy(()=>Promise.resolve().then(()=>require("./SurveyDetailAdmin-00pkvypI.cjs"))),B=e.lazy(()=>Promise.resolve().then(()=>require("./SurveyStudentFlagListAdmin-C5MREKO4.cjs"))),M=e.lazy(()=>Promise.resolve().then(()=>require("./SurveyResultAdmin-DzXnpqwQ.cjs"))),k=e.lazy(()=>Promise.resolve().then(()=>require("./SurveyIndexAdmin-D27jhWNF.cjs"))),F=e.lazy(()=>Promise.resolve().then(()=>require("./CreateSurveyAdmin-BHwRSSCq.cjs"))),I=e.lazy(()=>Promise.resolve().then(()=>require("./PreviewSurveyAdmin-BV0_f7Sk.cjs"))),x=e.lazy(()=>Promise.resolve().then(()=>require("./ExternalApi-C9QAZfYm.cjs"))),E=e.lazy(()=>Promise.resolve().then(()=>require("./WeeklyQuest-CTN2Q9aF.cjs"))),G=e.lazy(()=>Promise.resolve().then(()=>require("./SettingWeeklyQuest-CDi1sio0.cjs"))),O=e.lazy(()=>Promise.resolve().then(()=>require("./HomePage-Dj_9gia6.cjs"))),w=e.lazy(()=>Promise.resolve().then(()=>require("./MainLayoutAdmin-BCH_8O1B.cjs"))),H=e.lazy(()=>Promise.resolve().then(()=>require("./SyncData-C2Shc7Al.cjs"))),U=e.lazy(()=>Promise.resolve().then(()=>require("./SummarizeQuestion-CqQlUM5X.cjs"))),j=e.lazy(()=>Promise.resolve().then(()=>require("./SurveyQuestion-CvX38eWN.cjs"))),V=e.lazy(()=>Promise.resolve().then(()=>require("./MarioAi-CqHtgeFP.cjs"))),K=e.lazy(()=>Promise.resolve().then(()=>require("./AIMario-DP2HBmgn.cjs"))),N=e.lazy(()=>Promise.resolve().then(()=>require("./ChatWithAI-DOQCVUXe.cjs"))),_=e.lazy(()=>Promise.resolve().then(()=>require("./ViewHistoryPrompt-DAaaXoCx.cjs"))),$=e.lazy(()=>Promise.resolve().then(()=>require("./SurveyPortal-CRWz4TYf.cjs"))),J=e.lazy(()=>Promise.resolve().then(()=>require("./ConversationGoal-DpXDZc4j.cjs"))),X=e.lazy(()=>Promise.resolve().then(()=>require("./FrequencyAndSetup-CdoUkIkQ.cjs"))),Y=e.lazy(()=>Promise.resolve().then(()=>require("./DesignatedStaff-C7KVBBAN.cjs"))),Z=e.lazy(()=>Promise.resolve().then(()=>require("./WellBeingDashboard-BT1ibjgm.cjs"))),ee=e.lazy(()=>Promise.resolve().then(()=>require("./OpenFieldWellbeingQuestion-Z3w7NmKC.cjs"))),re=e.lazy(()=>Promise.resolve().then(()=>require("./MyProfile-oLwbD9-6.cjs"))),oe=e.lazy(()=>Promise.resolve().then(()=>require("./UserProfileManagement-DX8MUFAk.cjs"))),te=e.lazy(()=>Promise.resolve().then(()=>require("./EditFlagCard-CDHWffHh.cjs"))),ne=e.lazy(()=>Promise.resolve().then(()=>require("./ConversationTarget-BDG8Okh1.cjs"))),ie=e.lazy(()=>Promise.resolve().then(()=>require("./TeacherConversations-oDH8-5A2.cjs")).then(r=>r.TeacherConversations$1)),se=e.lazy(()=>Promise.resolve().then(()=>require("./index-DnCKrFI9.cjs"))),ae=e.lazy(()=>Promise.resolve().then(()=>require("./DashboardWrapper-BqcF82EB.cjs"))),le=e.lazy(()=>Promise.resolve().then(()=>require("./FlagAlertWrapper-D_OLRdEa.cjs"))),ue=e.lazy(()=>Promise.resolve().then(()=>require("./PersonalLearningPlansWrapper-CDAwvKfS.cjs")));t.LicenseManager.setLicenseKey(o.LICENSE_AGGRID);exports.AIMario=K;exports.AdminTraining=p;exports.AssetLog=C;exports.BadgeList=v;exports.ChatWithAI=N;exports.CheckInSetup=se;exports.ConferenceRubricDetail=i;exports.ConferenceRubricList=n;exports.ConversationGoal=J;exports.ConversationTarget=ne;exports.CreateSurveyAdmin=F;exports.CustomAlertList=d;exports.CustomQuestionAlert=f;exports.Dashboard=g;exports.DashboardWrapper=ae;exports.DesignatedStaff=Y;exports.EditFlagCard=te;exports.ExternalApi=x;exports.FlagAlertWrapper=le;exports.FrequencyAndSetup=X;exports.GoalExampleList=P;exports.HomePage=O;exports.LearningStrategyList=s;exports.LearningSupportCategoryList=c;exports.MainLayoutAdmin=w;exports.MarioAi=V;exports.MyProfile=re;exports.OneRosterContainer=L;exports.OpenFieldWellbeingQuestion=ee;exports.PersonalLearningPlansWrapper=ue;exports.PreviewSurveyAdmin=I;exports.QuestionBankContainer=q;exports.QuestionBankList=l;exports.QuestionDetail=m;exports.ReflectionContainer=u;exports.RevertUser=W;exports.SandboxContainer=D;exports.SessionTemplateDetail=S;exports.SettingWeeklyQuest=G;exports.SetupContainer=a;exports.SubjectList=y;exports.SummarizeQuestion=U;exports.SurveyDashboardContainer=T;exports.SurveyDetailAdmin=R;exports.SurveyIndexAdmin=k;exports.SurveyPortal=$;exports.SurveyQuestion=j;exports.SurveyQuestionContainer=z;exports.SurveyResultAdmin=M;exports.SurveyStudentFlagListAdmin=B;exports.SyncData=H;exports.TeacherConversations=ie;exports.TemplateBuilderPage=b;exports.TemplateContainer=A;exports.TemplateStartBuild=Q;exports.TutorialScreenContainer=h;exports.UserProfileManagement=oe;exports.ViewHistoryPrompt=_;exports.WeeklyQuest=E;exports.WellBeingDashboard=Z;
@@ -1,7 +1,7 @@
1
1
  import { LICENSE_AGGRID as n } from "mario-core";
2
2
  import { LicenseManager as r } from "@ag-grid-enterprise/core";
3
3
  import { lazy as t } from "react";
4
- const m = t(() => import("./ConferenceRubricList-BMS__Zhg.js")), p = t(() => import("./ConferenceRubricDetail-Dkw4IAmz.js")), a = t(() => import("./LearningStrategyList-CXDUExaq.js")), c = t(() => import("./SetupContainer-BNV9qWaW.js")), u = t(() => import("./QuestionBankList-DIL_Kyp_.js")), l = t(() => import("./ReflectionContainer-DYumB3DG.js")), S = t(() => import("./QuestionDetail-DBqKhna4.js")), d = t(() => import("./SubjectList-ewa6hXBk.js")), C = t(() => import("./LearningSupportCategoryList-BmFj6dul.js")), y = t(() => import("./BadgeList-DUEUMpRP.js")), g = t(() => import("./GoalExampleList-DwoJ0Zn_.js")), A = t(() => import("./TutorialScreenContainer-BIhGp5Xb.js")), L = t(() => import("./QuestionBankContainer-DBm_Ox_n.js")), v = t(() => import("./SurveyQuestionContainer-CLwodcFd.js")), D = t(() => import("./SessionTemplateDetail-Y0ShCfW-.js")), b = t(() => import("./CustomAlertList-CEBlJZHr.js")), f = t(() => import("./AssetLog-9i4_srMc.js")), Q = t(() => import("./Dashboard-BNt47u0H.js")), h = t(() => import("./AdminTraining-BS64lsyg.js")), P = t(() => import("./TemplateContainer-CPK7IVP1.js")), T = t(() => import("./OneRosterContainer-B77ZZCHp.js")), W = t(() => import("./SandboxContainer-DmPlQa8l.js")), R = t(() => import("./TemplateBuilderPage-DzJLw-Su.js")), B = t(() => import("./TemplateStartBuild-naD1Xn49.js")), I = t(() => import("./SurveyDashboardContainer-DVuZchc5.js")), M = t(() => import("./RevertUser-bHci1c1Z.js")), k = t(() => import("./CustomQuestionAlert-Cw7DnLNn.js")), x = t(() => import("./SurveyDetailAdmin-3RdEiTUq.js")), E = t(() => import("./SurveyStudentFlagListAdmin-CkPPFzer.js")), F = t(() => import("./SurveyResultAdmin-DMp91TED.js")), G = t(() => import("./SurveyIndexAdmin-D_wWwpHD.js")), w = t(() => import("./CreateSurveyAdmin-DvHW5Xfl.js")), z = t(() => import("./PreviewSurveyAdmin-B14R4OTK.js")), H = t(() => import("./ExternalApi-CFsQM9Kw.js")), O = t(() => import("./WeeklyQuest-ClxZC-ik.js")), U = t(() => import("./SettingWeeklyQuest-D61948jR.js")), j = t(() => import("./HomePage-Wp52RhWh.js")), q = t(() => import("./MainLayoutAdmin-3xAJReUH.js")), K = t(() => import("./SyncData-BTSEX_ZA.js")), N = t(() => import("./SummarizeQuestion-DwhA4lQm.js")), V = t(() => import("./SurveyQuestion-D-JHKXI1.js")), _ = t(() => import("./MarioAi-B-ricYkP.js")), J = t(() => import("./AIMario-Bk_MPYou.js")), X = t(() => import("./ChatWithAI-Da8rIe7x.js")), Y = t(() => import("./ViewHistoryPrompt-BH7HEaKc.js")), Z = t(() => import("./SurveyPortal-WCUgHo68.js")), $ = t(() => import("./ConversationGoal-CPtGyH13.js")), tt = t(() => import("./FrequencyAndSetup-BzRROiSe.js")), ot = t(() => import("./DesignatedStaff-B3X_Bwgs.js")), nt = t(() => import("./WellBeingDashboard-B5SIvSbO.js")), rt = t(() => import("./OpenFieldWellbeingQuestion-Cp7Nn8Q7.js")), it = t(() => import("./MyProfile-Bn_MVEhq.js")), et = t(() => import("./UserProfileManagement-Cw5jornX.js")), st = t(() => import("./EditFlagCard-CmrxdNyn.js")), mt = t(() => import("./ConversationTarget-MLIO7MiW.js")), pt = t(() => import("./TeacherConversations-u42EuCZX.js").then((o) => o.b)), at = t(() => import("./index-C1mwVZd_.js")), ct = t(() => import("./DashboardWrapper-CxXistlm.js")), ut = t(() => import("./FlagAlertWrapper-BXV9VXMs.js")), lt = t(() => import("./PersonalLearningPlansWrapper-Cx_orIAt.js"));
4
+ const m = t(() => import("./ConferenceRubricList-BMS__Zhg.js")), p = t(() => import("./ConferenceRubricDetail-Dkw4IAmz.js")), a = t(() => import("./LearningStrategyList-CXDUExaq.js")), c = t(() => import("./SetupContainer-BNV9qWaW.js")), u = t(() => import("./QuestionBankList-DIL_Kyp_.js")), l = t(() => import("./ReflectionContainer-DYumB3DG.js")), S = t(() => import("./QuestionDetail-DBqKhna4.js")), d = t(() => import("./SubjectList-ewa6hXBk.js")), C = t(() => import("./LearningSupportCategoryList-BmFj6dul.js")), y = t(() => import("./BadgeList-DUEUMpRP.js")), g = t(() => import("./GoalExampleList-DwoJ0Zn_.js")), A = t(() => import("./TutorialScreenContainer-BIhGp5Xb.js")), L = t(() => import("./QuestionBankContainer-DBm_Ox_n.js")), v = t(() => import("./SurveyQuestionContainer-CLwodcFd.js")), D = t(() => import("./SessionTemplateDetail-Y0ShCfW-.js")), b = t(() => import("./CustomAlertList-CEBlJZHr.js")), f = t(() => import("./AssetLog-9i4_srMc.js")), Q = t(() => import("./Dashboard-BNt47u0H.js")), h = t(() => import("./AdminTraining-BS64lsyg.js")), P = t(() => import("./TemplateContainer-CPK7IVP1.js")), T = t(() => import("./OneRosterContainer-B77ZZCHp.js")), W = t(() => import("./SandboxContainer-DmPlQa8l.js")), R = t(() => import("./TemplateBuilderPage-DzJLw-Su.js")), B = t(() => import("./TemplateStartBuild-naD1Xn49.js")), I = t(() => import("./SurveyDashboardContainer-DVuZchc5.js")), M = t(() => import("./RevertUser-bHci1c1Z.js")), k = t(() => import("./CustomQuestionAlert-Cw7DnLNn.js")), x = t(() => import("./SurveyDetailAdmin-3RdEiTUq.js")), E = t(() => import("./SurveyStudentFlagListAdmin-CkPPFzer.js")), F = t(() => import("./SurveyResultAdmin-DMp91TED.js")), G = t(() => import("./SurveyIndexAdmin-D_wWwpHD.js")), w = t(() => import("./CreateSurveyAdmin-DvHW5Xfl.js")), z = t(() => import("./PreviewSurveyAdmin-B14R4OTK.js")), H = t(() => import("./ExternalApi-CFsQM9Kw.js")), O = t(() => import("./WeeklyQuest-ClxZC-ik.js")), U = t(() => import("./SettingWeeklyQuest-D61948jR.js")), j = t(() => import("./HomePage-Wp52RhWh.js")), q = t(() => import("./MainLayoutAdmin-3xAJReUH.js")), K = t(() => import("./SyncData-BTSEX_ZA.js")), N = t(() => import("./SummarizeQuestion-DwhA4lQm.js")), V = t(() => import("./SurveyQuestion-D-JHKXI1.js")), _ = t(() => import("./MarioAi-B-ricYkP.js")), J = t(() => import("./AIMario-Bk_MPYou.js")), X = t(() => import("./ChatWithAI-Da8rIe7x.js")), Y = t(() => import("./ViewHistoryPrompt-BH7HEaKc.js")), Z = t(() => import("./SurveyPortal-WCUgHo68.js")), $ = t(() => import("./ConversationGoal-CPtGyH13.js")), tt = t(() => import("./FrequencyAndSetup-BzRROiSe.js")), ot = t(() => import("./DesignatedStaff-B3X_Bwgs.js")), nt = t(() => import("./WellBeingDashboard-B5SIvSbO.js")), rt = t(() => import("./OpenFieldWellbeingQuestion-Cp7Nn8Q7.js")), it = t(() => import("./MyProfile-Bn_MVEhq.js")), et = t(() => import("./UserProfileManagement-BMD6lTyi.js")), st = t(() => import("./EditFlagCard-CmrxdNyn.js")), mt = t(() => import("./ConversationTarget-MLIO7MiW.js")), pt = t(() => import("./TeacherConversations-u42EuCZX.js").then((o) => o.b)), at = t(() => import("./index-C1mwVZd_.js")), ct = t(() => import("./DashboardWrapper-CxXistlm.js")), ut = t(() => import("./FlagAlertWrapper-BXV9VXMs.js")), lt = t(() => import("./PersonalLearningPlansWrapper-Cx_orIAt.js"));
5
5
  r.setLicenseKey(n);
6
6
  export {
7
7
  J as AIMario,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mario-education",
3
- "version": "2.0.75-staging",
3
+ "version": "2.0.76-staging",
4
4
  "description": "Contains education components && functions for BRSS Mario project",
5
5
  "author": "brss",
6
6
  "license": "MIT",