mario-core 2.0.102-release → 2.0.103-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 (67) hide show
  1. package/dist/Dashboard-B2WY8-IU.js +1 -0
  2. package/dist/Dashboard-BzKx6Ox_.mjs +206 -0
  3. package/dist/Dashboard-DJS7P679.mjs +206 -0
  4. package/dist/Dashboard-NC2RHYE3.js +1 -0
  5. package/dist/EmailTemplateDetail-22mli8ZO.js +1 -0
  6. package/dist/EmailTemplateDetail-CfqeSysW.js +1 -0
  7. package/dist/EmailTemplateDetail-D5H-KPFi.mjs +443 -0
  8. package/dist/EmailTemplateDetail-DnEe1dJY.mjs +443 -0
  9. package/dist/EmailTemplateList-BBgctzKn.mjs +170 -0
  10. package/dist/EmailTemplateList-BSETyjvK.js +1 -0
  11. package/dist/EmailTemplateList-CEfrVodv.mjs +170 -0
  12. package/dist/EmailTemplateList-CpfPUX5H.js +1 -0
  13. package/dist/GalleryList-BKH6TE8o.js +1 -0
  14. package/dist/GalleryList-D1-lprY3.mjs +329 -0
  15. package/dist/GalleryList-D6Npg6OD.mjs +329 -0
  16. package/dist/GalleryList-DZDBNr1J.js +1 -0
  17. package/dist/Login-07zPaPX9.js +1 -0
  18. package/dist/Login-CSb85ENW.mjs +1697 -0
  19. package/dist/Login-C_elLcnh.mjs +1688 -0
  20. package/dist/Login-t8Cp9sZB.js +1 -0
  21. package/dist/NotificationList-D1ay6Hyf.mjs +3982 -0
  22. package/dist/NotificationList-DHjB1hHV.js +2 -0
  23. package/dist/NotificationList-DlWtyPB-.mjs +3982 -0
  24. package/dist/NotificationList-Dr8Yrfl7.js +2 -0
  25. package/dist/SkillList-CjP3DHVV.mjs +386 -0
  26. package/dist/SkillList-DED-BKhK.js +1 -0
  27. package/dist/SkillList-EMox2GtU.js +1 -0
  28. package/dist/SkillList-a-PCBXTS.mjs +386 -0
  29. package/dist/TeacherSelector-CT_LK5ps.js +1 -0
  30. package/dist/TeacherSelector-CYN1RV9H.js +1 -0
  31. package/dist/TeacherSelector-Ckdz4LDA.mjs +30 -0
  32. package/dist/TeacherSelector-TtFRSN6T.mjs +30 -0
  33. package/dist/TheContent-BLL5TnF0.js +1 -0
  34. package/dist/TheContent-C1z93b1T.mjs +38 -0
  35. package/dist/TheContent-CV2yUmwY.js +1 -0
  36. package/dist/TheContent-ClceIaDH.mjs +38 -0
  37. package/dist/UserContainer-BwVN8uDh.mjs +2902 -0
  38. package/dist/UserContainer-DKBxc6bM.js +5 -0
  39. package/dist/UserContainer-Dgajsjc2.js +5 -0
  40. package/dist/UserContainer-W5RhNyuY.mjs +2902 -0
  41. package/dist/UserDetail-B1OEfUkB.mjs +903 -0
  42. package/dist/UserDetail-CcAyPDXB.mjs +903 -0
  43. package/dist/UserDetail-D_54wIZ1.js +1 -0
  44. package/dist/UserDetail-EIVg7R4V.js +1 -0
  45. package/dist/UserList-BHBPOboi.js +7 -0
  46. package/dist/UserList-CuML6EN2.mjs +1261 -0
  47. package/dist/UserList-D7DcyFHI.js +7 -0
  48. package/dist/UserList-DPS62SYL.mjs +1254 -0
  49. package/dist/constants-CAl8i9EQ.mjs +286 -0
  50. package/dist/constants-CQviSc2u.js +1 -0
  51. package/dist/constants-DIXj0L_y.js +1 -0
  52. package/dist/constants-Jqu1Wphx.mjs +286 -0
  53. package/dist/index-7hA60HfM.mjs +19133 -0
  54. package/dist/index-9XtI-PeV.js +15 -0
  55. package/dist/index-C6cqi7Br.js +15 -0
  56. package/dist/index-DplP6JK1.mjs +19133 -0
  57. package/dist/index.js +1 -1
  58. package/dist/index.modern.js +1 -1
  59. package/dist/mailCategoryService-Bhcruih6.js +1 -0
  60. package/dist/mailCategoryService-CJQb-5oo.mjs +11 -0
  61. package/dist/mailCategoryService-CQdNPG8e.js +1 -0
  62. package/dist/mailCategoryService-D_DFc1LB.mjs +11 -0
  63. package/dist/userService-1_ugW9AK.js +1 -0
  64. package/dist/userService-C4VF2Wck.mjs +56 -0
  65. package/dist/userService-De8Jm8I4.js +1 -0
  66. package/dist/userService-OWU32PxA.mjs +56 -0
  67. package/package.json +1 -1
@@ -0,0 +1,329 @@
1
+ import { jsx as e, jsxs as s } from "react/jsx-runtime";
2
+ import { Row as k, Col as u, Input as R, Button as y, Label as g, Card as E, CardImg as S, CardBody as w, CardTitle as M, CardHeader as B, CardText as j } from "reactstrap";
3
+ import { useSelector as q } from "react-redux";
4
+ import { forwardRef as H, memo as v, useRef as U, useState as K } from "react";
5
+ import { a0 as W, E as L, ar as z, as as P, at as T, au as Q, av as J, aw as X, ax as C, h as Y, a2 as Z, $ as ee, ay as le, m as ae } from "./index-7hA60HfM.mjs";
6
+ import { Formik as ne } from "formik";
7
+ import * as b from "yup";
8
+ import { useTranslation as A } from "react-i18next";
9
+ const re = b.object({
10
+ name: b.string().required("Name is required")
11
+ }), se = (l, n) => {
12
+ const { targetMedia: r, onConfirm: i } = l, a = r?.key ? "Update" : "Create", d = r?.key ? "Rename" : "Folder";
13
+ return /* @__PURE__ */ e(
14
+ ne,
15
+ {
16
+ initialValues: { name: r?.name },
17
+ enableReinitialize: !0,
18
+ validationSchema: re,
19
+ onSubmit: (o, m) => {
20
+ i && i(o), m.resetForm();
21
+ },
22
+ children: (o) => {
23
+ const {
24
+ values: m,
25
+ touched: I,
26
+ errors: p,
27
+ handleChange: D,
28
+ handleBlur: O,
29
+ handleSubmit: f
30
+ } = o;
31
+ return /* @__PURE__ */ e(
32
+ W,
33
+ {
34
+ header: d,
35
+ confirmText: a,
36
+ onConfirm: f,
37
+ ref: n,
38
+ children: /* @__PURE__ */ e(k, { children: /* @__PURE__ */ s(u, { md: 12, children: [
39
+ /* @__PURE__ */ e(
40
+ R,
41
+ {
42
+ name: "name",
43
+ placeholder: `Enter your ${r?.key ? "file" : "folder"} name`,
44
+ value: m.name,
45
+ onChange: D,
46
+ onBlur: O("question")
47
+ }
48
+ ),
49
+ I.name && p.name && /* @__PURE__ */ e(
50
+ L,
51
+ {
52
+ text: p.name
53
+ }
54
+ )
55
+ ] }) })
56
+ }
57
+ );
58
+ }
59
+ }
60
+ );
61
+ }, te = H(se), ie = ({
62
+ isLibrary: l,
63
+ step: n,
64
+ breadcumb: r,
65
+ currentPrefix: i,
66
+ targetMedia: a,
67
+ handleSelectFile: d,
68
+ handleCreateFolder: o,
69
+ handleRenameFile: m,
70
+ handleGoBack: I,
71
+ handleDownloadMedia: p,
72
+ handleDeleteMediaOrFolder: D,
73
+ showErrorAlert: O
74
+ }) => {
75
+ const f = U(null), x = U(null), { t: F } = A(), N = () => f?.current?.toggle();
76
+ return /* @__PURE__ */ s("div", { children: [
77
+ /* @__PURE__ */ s(k, { className: "p-2 pl-3", style: { gap: "8px" }, children: [
78
+ !!n && /* @__PURE__ */ s(
79
+ y,
80
+ {
81
+ className: "mr-2",
82
+ color: "secondary",
83
+ onClick: I,
84
+ style: { width: "auto", display: "flex", gap: "4px" },
85
+ children: [
86
+ /* @__PURE__ */ e(z, {}),
87
+ /* @__PURE__ */ e(g, { className: "ml-1 h6 m-0", children: "Go up" })
88
+ ]
89
+ }
90
+ ),
91
+ a && !a.isFolder && /* @__PURE__ */ s(
92
+ y,
93
+ {
94
+ className: "mr-2",
95
+ color: "success",
96
+ onClick: p,
97
+ style: { width: "auto", display: "flex", gap: "4px" },
98
+ children: [
99
+ /* @__PURE__ */ e(P, {}),
100
+ /* @__PURE__ */ e(g, { className: "ml-1 h6 m-0", children: "Download" })
101
+ ]
102
+ }
103
+ ),
104
+ a && !l && /* @__PURE__ */ s(
105
+ y,
106
+ {
107
+ className: "mr-2",
108
+ color: "danger",
109
+ onClick: D,
110
+ style: { width: "auto", display: "flex", gap: "4px" },
111
+ children: [
112
+ /* @__PURE__ */ e(T, {}),
113
+ /* @__PURE__ */ e(g, { className: "ml-1 h6 m-0", children: "Delete" })
114
+ ]
115
+ }
116
+ ),
117
+ a && !l && !a.isFolder && /* @__PURE__ */ s(y, { className: "mr-2", color: "primary", onClick: N, style: { width: "auto", display: "flex", gap: "4px" }, children: [
118
+ /* @__PURE__ */ e(Q, {}),
119
+ /* @__PURE__ */ e(g, { className: "ml-1 h6 m-0", children: "Rename" })
120
+ ] }),
121
+ !a && !l && /* @__PURE__ */ s(y, { className: "mr-2", color: "success", onClick: N, style: { width: "auto", display: "flex", gap: "4px" }, children: [
122
+ /* @__PURE__ */ e(J, {}),
123
+ /* @__PURE__ */ e(g, { className: "ml-1 h6 m-0", children: F("new_folder") })
124
+ ] }),
125
+ !a && !l && /* @__PURE__ */ s(
126
+ y,
127
+ {
128
+ className: "mr-2",
129
+ color: "info",
130
+ onClick: () => x?.current?.click(),
131
+ style: { width: "auto", display: "flex", gap: "4px" },
132
+ children: [
133
+ /* @__PURE__ */ e(X, {}),
134
+ /* @__PURE__ */ e(g, { className: "ml-1 h6 m-0", children: F("upload") })
135
+ ]
136
+ }
137
+ ),
138
+ r && /* @__PURE__ */ e(u, { className: "h-100 d-flex align-items-center", children: r })
139
+ ] }),
140
+ /* @__PURE__ */ e(
141
+ te,
142
+ {
143
+ ref: f,
144
+ targetMedia: a,
145
+ onConfirm: async (h) => {
146
+ h.name != "" ? a && !a.isFolder ? (N(), await m(h.name)) : (N(), await o(i, h.name)) : O("Name can't be empty");
147
+ }
148
+ }
149
+ ),
150
+ /* @__PURE__ */ e(
151
+ "input",
152
+ {
153
+ type: "file",
154
+ id: "customMediaUpload",
155
+ ref: x,
156
+ style: { display: "none" },
157
+ onChange: async (h) => {
158
+ const c = h?.target?.files[0];
159
+ c && await d({ key: i, file: c });
160
+ }
161
+ }
162
+ )
163
+ ] });
164
+ }, oe = v(ie), _ = {
165
+ "media-wrapper": "_media-wrapper_1nc2k_6",
166
+ "media-image": "_media-image_1nc2k_11",
167
+ "media-image-selected": "_media-image-selected_1nc2k_17",
168
+ "media-title": "_media-title_1nc2k_21",
169
+ "filter-media-file": "_filter-media-file_1nc2k_30"
170
+ };
171
+ var t = /* @__PURE__ */ ((l) => (l[l.IMAGE = 0] = "IMAGE", l[l.VIDEO = 1] = "VIDEO", l[l.AUDIO = 2] = "AUDIO", l[l.DOC = 3] = "DOC", l[l.UNKNOW = 4] = "UNKNOW", l))(t || {});
172
+ const ce = ["png", "jpg", "jpeg", "gif"], de = ["mp4", "mp4v"], me = ["txt", "pdf", "doc", "docx", "xls", "csv"], he = ["wav", "mp3"], V = (l) => {
173
+ if (l) {
174
+ if (ce.includes(l)) return t.IMAGE;
175
+ if (de.includes(l)) return t.VIDEO;
176
+ if (me.includes(l)) return t.DOC;
177
+ if (he.includes(l)) return t.AUDIO;
178
+ }
179
+ return t.UNKNOW;
180
+ }, ue = (l) => {
181
+ if (l.isFolder) return C.FOLDER_IMAGE;
182
+ const n = V(l.extension);
183
+ return n === t.IMAGE ? C.PHOTO_IMAGE : n === t.VIDEO ? C.VIDEO_IMAGE : n === t.AUDIO ? C.AUDIO_IMAGE : n === t.DOC ? C.DOCS_IMAGE : C.UNKNOW_IMAGE;
184
+ }, pe = ({ media: l, isTarget: n }) => {
185
+ const r = ue(l);
186
+ return /* @__PURE__ */ s(E, { className: `${n ? _["media-image-selected"] : ""} border-0 `, children: [
187
+ /* @__PURE__ */ e(
188
+ S,
189
+ {
190
+ className: `${_["media-image"]} p-1`,
191
+ top: !0,
192
+ width: "90%",
193
+ src: Y(r),
194
+ alt: l.name
195
+ }
196
+ ),
197
+ /* @__PURE__ */ e(w, { className: "p-1", style: { height: 45 }, children: /* @__PURE__ */ e(M, { tag: "h6", className: _["media-title"], children: l.name }) })
198
+ ] });
199
+ }, fe = v(pe), Ne = [
200
+ { value: t.IMAGE, label: "images" },
201
+ { value: t.AUDIO, label: "audios" },
202
+ { value: t.DOC, label: "docs" },
203
+ { value: t.VIDEO, label: "videos" }
204
+ ], ye = ({
205
+ changeFilters: l
206
+ // filters
207
+ }) => {
208
+ const [n, r] = K(), { t: i } = A();
209
+ return /* @__PURE__ */ s(k, { className: `${_["filter-media-file"]}`, children: [
210
+ /* @__PURE__ */ e(u, { sm: 8, children: /* @__PURE__ */ e(
211
+ Z,
212
+ {
213
+ initValue: "",
214
+ onSearch: (a) => l({
215
+ searchString: a
216
+ }),
217
+ placeholder: i("type_something_to_search_by_file_name")
218
+ }
219
+ ) }),
220
+ /* @__PURE__ */ e(u, { sm: 4, children: /* @__PURE__ */ e(
221
+ ee,
222
+ {
223
+ value: n,
224
+ isMulti: !0,
225
+ options: Ne.map((a) => ({ ...a, label: i(a.label) })),
226
+ onChange: (a) => {
227
+ r(a);
228
+ const d = a.map((o) => o.value);
229
+ l({ types: d });
230
+ }
231
+ }
232
+ ) })
233
+ ] });
234
+ }, ge = ({ height: l, isLibrary: n }) => {
235
+ const {
236
+ filters: r,
237
+ mediaList: i,
238
+ targetMedia: a,
239
+ router: d,
240
+ breadcrumb: o,
241
+ changeFilters: m,
242
+ handleOpenFolder: I,
243
+ handleSelectMedia: p,
244
+ handleSelectFile: D,
245
+ handleCreateFolder: O,
246
+ handleRenameFile: f,
247
+ handleDownloadMedia: x,
248
+ handleDeleteMediaOrFolder: F,
249
+ handleGoBack: N,
250
+ showErrorAlert: G
251
+ } = le(n), h = () => i.map((c) => {
252
+ const $ = a?.key === c.key;
253
+ return /* @__PURE__ */ e(u, { className: "p-2", xs: "auto", children: /* @__PURE__ */ e(
254
+ "div",
255
+ {
256
+ onDoubleClick: () => I(c),
257
+ onClick: () => p(c),
258
+ className: _["media-wrapper"],
259
+ children: /* @__PURE__ */ e(fe, { media: c, isTarget: $ })
260
+ }
261
+ ) }, c.key);
262
+ });
263
+ return /* @__PURE__ */ s(E, { children: [
264
+ /* @__PURE__ */ s(B, { children: [
265
+ /* @__PURE__ */ e(ye, { changeFilters: m, filters: r }),
266
+ /* @__PURE__ */ e(
267
+ oe,
268
+ {
269
+ isLibrary: n,
270
+ step: d.step,
271
+ breadcumb: o,
272
+ currentPrefix: r.prefix || "",
273
+ targetMedia: a,
274
+ handleSelectFile: D,
275
+ handleCreateFolder: O,
276
+ handleRenameFile: f,
277
+ handleDownloadMedia: x,
278
+ handleDeleteMediaOrFolder: F,
279
+ handleGoBack: N,
280
+ showErrorAlert: G
281
+ }
282
+ )
283
+ ] }),
284
+ /* @__PURE__ */ e(w, { style: { minHeight: l }, children: /* @__PURE__ */ e(k, { className: "p-1", children: h() }) })
285
+ ] });
286
+ }, Ce = ({ targetMedia: l }) => {
287
+ if (!l || l?.isFolder) return /* @__PURE__ */ e("div", {});
288
+ const n = V(l.extension), r = ae(l.key || "");
289
+ return /* @__PURE__ */ s(E, { className: "position-sticky", children: [
290
+ /* @__PURE__ */ e(B, { children: l?.name || "Media name" }),
291
+ n === t.IMAGE && /* @__PURE__ */ e(S, { className: "p-2", src: r, loading: "lazy" }),
292
+ n === t.VIDEO && /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e(
293
+ "video",
294
+ {
295
+ id: l.key,
296
+ width: "100%",
297
+ height: "100%",
298
+ controls: !0,
299
+ children: /* @__PURE__ */ e("source", { src: r })
300
+ }
301
+ ) }),
302
+ n === t.AUDIO && /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e("audio", { controls: !0, className: "w-100", children: /* @__PURE__ */ e("source", { src: r }) }) }),
303
+ /* @__PURE__ */ s(w, { children: [
304
+ /* @__PURE__ */ e(M, { tag: "h6", children: "General Info" }),
305
+ /* @__PURE__ */ s(j, { children: [
306
+ "File extension: ",
307
+ l.extension?.toUpperCase()
308
+ ] })
309
+ ] })
310
+ ] });
311
+ }, Ie = v(Ce), De = "media_gallery", ve = ({ isLibrary: l }) => {
312
+ const n = q((i) => i.gallery.targetMedia), { t: r } = A();
313
+ return /* @__PURE__ */ s("div", { className: "fadeIn animated", children: [
314
+ !l && /* @__PURE__ */ e("h5", { className: "mb-2", children: r(De) }),
315
+ /* @__PURE__ */ s(k, { className: "mb-2", children: [
316
+ /* @__PURE__ */ e(u, { md: 8, children: /* @__PURE__ */ e(ge, { height: "100vh", isLibrary: l }) }),
317
+ /* @__PURE__ */ e(u, { md: 4, children: /* @__PURE__ */ e(
318
+ Ie,
319
+ {
320
+ targetMedia: n
321
+ },
322
+ n?.key
323
+ ) })
324
+ ] })
325
+ ] });
326
+ };
327
+ export {
328
+ ve as default
329
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("reactstrap"),F=require("react-redux"),x=require("react"),t=require("./index-9XtI-PeV.js"),v=require("formik"),E=require("yup"),D=require("react-i18next");function A(s){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const a in s)if(a!=="default"){const i=Object.getOwnPropertyDescriptor(s,a);Object.defineProperty(n,a,i.get?i:{enumerable:!0,get:()=>s[a]})}}return n.default=s,Object.freeze(n)}const b=A(E),G=b.object({name:b.string().required("Name is required")}),U=(s,n)=>{const{targetMedia:a,onConfirm:i}=s,r=a?.key?"Update":"Create",m=a?.key?"Rename":"Folder";return e.jsx(v.Formik,{initialValues:{name:a?.name},enableReinitialize:!0,validationSchema:G,onSubmit:(c,u)=>{i&&i(c),u.resetForm()},children:c=>{const{values:u,touched:g,errors:p,handleChange:y,handleBlur:C,handleSubmit:j}=c;return e.jsx(t.CommonModal,{header:m,confirmText:r,onConfirm:j,ref:n,children:e.jsx(l.Row,{children:e.jsxs(l.Col,{md:12,children:[e.jsx(l.Input,{name:"name",placeholder:`Enter your ${a?.key?"file":"folder"} name`,value:u.name,onChange:y,onBlur:C("question")}),g.name&&p.name&&e.jsx(t.ErrorHandler,{text:p.name})]})})})}})},R=x.forwardRef(U),S=({isLibrary:s,step:n,breadcumb:a,currentPrefix:i,targetMedia:r,handleSelectFile:m,handleCreateFolder:c,handleRenameFile:u,handleGoBack:g,handleDownloadMedia:p,handleDeleteMediaOrFolder:y,showErrorAlert:C})=>{const j=x.useRef(null),I=x.useRef(null),{t:O}=D.useTranslation(),f=()=>j?.current?.toggle(),_=()=>e.jsxs(l.Row,{className:"p-2 pl-3",style:{gap:"8px"},children:[!!n&&e.jsxs(l.Button,{className:"mr-2",color:"secondary",onClick:g,style:{width:"auto",display:"flex",gap:"4px"},children:[e.jsx(t.FaArrowLeft,{}),e.jsx(l.Label,{className:"ml-1 h6 m-0",children:"Go up"})]}),r&&!r.isFolder&&e.jsxs(l.Button,{className:"mr-2",color:"success",onClick:p,style:{width:"auto",display:"flex",gap:"4px"},children:[e.jsx(t.FaDownload,{}),e.jsx(l.Label,{className:"ml-1 h6 m-0",children:"Download"})]}),r&&!s&&e.jsxs(l.Button,{className:"mr-2",color:"danger",onClick:y,style:{width:"auto",display:"flex",gap:"4px"},children:[e.jsx(t.FaTrash,{}),e.jsx(l.Label,{className:"ml-1 h6 m-0",children:"Delete"})]}),r&&!s&&!r.isFolder&&e.jsxs(l.Button,{className:"mr-2",color:"primary",onClick:f,style:{width:"auto",display:"flex",gap:"4px"},children:[e.jsx(t.FaEdit,{}),e.jsx(l.Label,{className:"ml-1 h6 m-0",children:"Rename"})]}),!r&&!s&&e.jsxs(l.Button,{className:"mr-2",color:"success",onClick:f,style:{width:"auto",display:"flex",gap:"4px"},children:[e.jsx(t.FaFolderPlus,{}),e.jsx(l.Label,{className:"ml-1 h6 m-0",children:O("new_folder")})]}),!r&&!s&&e.jsxs(l.Button,{className:"mr-2",color:"info",onClick:()=>I?.current?.click(),style:{width:"auto",display:"flex",gap:"4px"},children:[e.jsx(t.FaFileUpload,{}),e.jsx(l.Label,{className:"ml-1 h6 m-0",children:O("upload")})]}),a&&e.jsx(l.Col,{className:"h-100 d-flex align-items-center",children:a})]});return e.jsxs("div",{children:[_(),e.jsx(R,{ref:j,targetMedia:r,onConfirm:async h=>{h.name!=""?r&&!r.isFolder?(f(),await u(h.name)):(f(),await c(i,h.name)):C("Name can't be empty")}}),e.jsx("input",{type:"file",id:"customMediaUpload",ref:I,style:{display:"none"},onChange:async h=>{const d=h?.target?.files[0];d&&await m({key:i,file:d})}})]})},B=x.memo(S),N={"media-wrapper":"_media-wrapper_1nc2k_6","media-image":"_media-image_1nc2k_11","media-image-selected":"_media-image-selected_1nc2k_17","media-title":"_media-title_1nc2k_21","filter-media-file":"_filter-media-file_1nc2k_30"};var o=(s=>(s[s.IMAGE=0]="IMAGE",s[s.VIDEO=1]="VIDEO",s[s.AUDIO=2]="AUDIO",s[s.DOC=3]="DOC",s[s.UNKNOW=4]="UNKNOW",s))(o||{});const q=["png","jpg","jpeg","gif"],M=["mp4","mp4v"],V=["txt","pdf","doc","docx","xls","csv"],L=["wav","mp3"],k=s=>{if(s){if(q.includes(s))return o.IMAGE;if(M.includes(s))return o.VIDEO;if(V.includes(s))return o.DOC;if(L.includes(s))return o.AUDIO}return o.UNKNOW},$=s=>{if(s.isFolder)return t.Images.FOLDER_IMAGE;const n=k(s.extension);return n===o.IMAGE?t.Images.PHOTO_IMAGE:n===o.VIDEO?t.Images.VIDEO_IMAGE:n===o.AUDIO?t.Images.AUDIO_IMAGE:n===o.DOC?t.Images.DOCS_IMAGE:t.Images.UNKNOW_IMAGE},T=({media:s,isTarget:n})=>{const a=$(s);return e.jsxs(l.Card,{className:`${n?N["media-image-selected"]:""} border-0 `,children:[e.jsx(l.CardImg,{className:`${N["media-image"]} p-1`,top:!0,width:"90%",src:t.getStaticFileUrl(a),alt:s.name}),e.jsx(l.CardBody,{className:"p-1",style:{height:45},children:e.jsx(l.CardTitle,{tag:"h6",className:N["media-title"],children:s.name})})]})},H=x.memo(T),P=[{value:o.IMAGE,label:"images"},{value:o.AUDIO,label:"audios"},{value:o.DOC,label:"docs"},{value:o.VIDEO,label:"videos"}],K=({changeFilters:s})=>{const[n,a]=x.useState(),{t:i}=D.useTranslation();return e.jsxs(l.Row,{className:`${N["filter-media-file"]}`,children:[e.jsx(l.Col,{sm:8,children:e.jsx(t.SearchBox,{initValue:"",onSearch:r=>s({searchString:r}),placeholder:i("type_something_to_search_by_file_name")})}),e.jsx(l.Col,{sm:4,children:e.jsx(t.CustomSelector,{value:n,isMulti:!0,options:P.map(r=>({...r,label:i(r.label)})),onChange:r=>{a(r);const m=r.map(c=>c.value);s({types:m})}})})]})},W=({height:s,isLibrary:n})=>{const{filters:a,mediaList:i,targetMedia:r,router:m,breadcrumb:c,changeFilters:u,handleOpenFolder:g,handleSelectMedia:p,handleSelectFile:y,handleCreateFolder:C,handleRenameFile:j,handleDownloadMedia:I,handleDeleteMediaOrFolder:O,handleGoBack:f,showErrorAlert:_}=t.useGalleryList(n),h=()=>i.map(d=>{const w=r?.key===d.key;return e.jsx(l.Col,{className:"p-2",xs:"auto",children:e.jsx("div",{onDoubleClick:()=>g(d),onClick:()=>p(d),className:N["media-wrapper"],children:e.jsx(H,{media:d,isTarget:w})})},d.key)});return e.jsxs(l.Card,{children:[e.jsxs(l.CardHeader,{children:[e.jsx(K,{changeFilters:u,filters:a}),e.jsx(B,{isLibrary:n,step:m.step,breadcumb:c,currentPrefix:a.prefix||"",targetMedia:r,handleSelectFile:y,handleCreateFolder:C,handleRenameFile:j,handleDownloadMedia:I,handleDeleteMediaOrFolder:O,handleGoBack:f,showErrorAlert:_})]}),e.jsx(l.CardBody,{style:{minHeight:s},children:e.jsx(l.Row,{className:"p-1",children:h()})})]})},z=({targetMedia:s})=>{if(!s||s?.isFolder)return e.jsx("div",{});const n=k(s.extension),a=t.getFileUrl(s.key||"");return e.jsxs(l.Card,{className:"position-sticky",children:[e.jsx(l.CardHeader,{children:s?.name||"Media name"}),n===o.IMAGE&&e.jsx(l.CardImg,{className:"p-2",src:a,loading:"lazy"}),n===o.VIDEO&&e.jsx("div",{className:"p-2",children:e.jsx("video",{id:s.key,width:"100%",height:"100%",controls:!0,children:e.jsx("source",{src:a})})}),n===o.AUDIO&&e.jsx("div",{className:"p-2",children:e.jsx("audio",{controls:!0,className:"w-100",children:e.jsx("source",{src:a})})}),e.jsxs(l.CardBody,{children:[e.jsx(l.CardTitle,{tag:"h6",children:"General Info"}),e.jsxs(l.CardText,{children:["File extension: ",s.extension?.toUpperCase()]})]})]})},Q=x.memo(z),J="media_gallery",X=({isLibrary:s})=>{const n=F.useSelector(i=>i.gallery.targetMedia),{t:a}=D.useTranslation();return e.jsxs("div",{className:"fadeIn animated",children:[!s&&e.jsx("h5",{className:"mb-2",children:a(J)}),e.jsxs(l.Row,{className:"mb-2",children:[e.jsx(l.Col,{md:8,children:e.jsx(W,{height:"100vh",isLibrary:s})}),e.jsx(l.Col,{md:4,children:e.jsx(Q,{targetMedia:n},n?.key)})]})]})};exports.default=X;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("react"),g=require("reactstrap"),te=require("react-router-dom"),e=require("./index-C6cqi7Br.js"),Q=require("react-redux"),ue=require("formik"),De=require("yup"),le=require("react-google-recaptcha-v3"),ke=require("@react-oauth/google"),se=require("./types-CTFcZUFS.js"),Ce=require("./constants-DIXj0L_y.js"),re=require("@azure/msal-browser"),qe=require("@amplitude/analytics-browser");function Ie(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const l=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,l.get?l:{enumerable:!0,get:()=>t[r]})}}return n.default=t,Object.freeze(n)}const M=Ie(De),ne=Ie(qe),Ve={backgroundColor:"#f7f9fc",borderRadius:"4px",marginBottom:"5px",position:"relative"},He={backgroundColor:"#ffffff",paddingRight:"50px",color:"#333333",caretColor:"#333333"},We={fontSize:"20px",position:"absolute",right:"10px",color:"#316CD9"},Ke=t=>t.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(n,r)=>r.toUpperCase()),ie=({isShowPassword:t,togglePasswordVisible:n,onChange:r,placeholder:l})=>s.jsxs("div",{className:"d-flex align-items-center w-100",style:Ve,children:[s.jsx(g.Input,{className:"border password-input",style:He,type:t?"text":"password",name:"password",onChange:r,placeholder:l||"Password",autocomplete:l?Ke(l):"password",required:!0}),s.jsx("i",{className:`far ${t?"fa-eye-slash":"fa-eye"} mx-2 cursor-pointer`,style:We,onClick:()=>n(),title:t?"Hide":"Show"})]}),Ye=({open:t,onConfirm:n,onClose:r,clickHandler:l})=>{const[m,p]=o.useState(Ce.GRADE_DEFAULT[0].value);return s.jsxs(g.Modal,{isOpen:t,className:`${e.styles["teacher-code"]}`,style:{zIndex:1201},centered:!0,autoFocus:!1,returnFocusAfterClose:!1,children:[s.jsxs("div",{className:`${e.styles["header-teacher-code"]}`,children:[s.jsx("div",{style:{padding:"16px 24px",margin:0,fontWeight:500,fontSize:"1.25rem"},children:"Select Grade"}),s.jsx("div",{hidden:!r,children:s.jsx(e.MdClose,{onClick:()=>r?.(),className:`${e.styles["close-icon"]}`,size:24,style:{color:"rgba(0, 0, 0, 0.54)"}})})]}),s.jsxs(g.ModalBody,{style:{padding:"20px 24px"},children:[s.jsx("p",{className:`${e.styles["teacher-code-label"]}`,style:{margin:0,marginBottom:"16px",color:"rgba(0, 0, 0, 0.6)"},children:"You are logging in as a student, please select your grade"}),s.jsxs("div",{className:"form-floating",style:{marginTop:"16px",marginBottom:"8px"},children:[s.jsx(g.Input,{type:"select",id:"floatingSelectGrade",value:m,onChange:h=>p(h.target.value),children:Ce.GRADE_DEFAULT.map(h=>s.jsx("option",{value:h.value,children:h.label},h.value))}),s.jsx("label",{htmlFor:"floatingSelectGrade",children:"Select grade"})]})]}),s.jsx(g.ModalFooter,{style:{borderTop:"none",padding:"8px 24px"},children:s.jsx(g.Button,{disabled:!m,style:{borderRadius:20,background:"#316cd9",border:"none",opacity:m?1:.65},color:"primary",onClick:()=>n(m,l),children:"Confirm"})})]})};function Je(t,n){return JSON.stringify(t)===JSON.stringify(n)}const Ze=o.memo(Ye,Je),Qe=M.object({email:M.string().email("Email is invalid").required("Email is required"),password:M.string().required("Password is required"),rememberMe:M.boolean()}),Xe=({onSuccess:t,onError:n})=>{const r=ke.useGoogleLogin({onSuccess:async l=>{try{const m=await fetch("https://www.googleapis.com/oauth2/v3/userinfo",{headers:{Authorization:`Bearer ${l.access_token}`}}).then(h=>h.json()),p={accessToken:l.access_token,googleId:m.sub,profileObj:{email:m.email,familyName:m.family_name,givenName:m.given_name,imageUrl:m.picture,name:m.name}};t(p)}catch(m){n(m)}},onError:l=>n(l)});return s.jsxs("div",{className:e.styles["btn-login-with-sso"],onClick:()=>r(),children:[s.jsxs("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",width:"24px",height:"24px",style:{marginRight:"8px"},children:[s.jsx("path",{fill:"#EA4335",d:"M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"}),s.jsx("path",{fill:"#4285F4",d:"M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"}),s.jsx("path",{fill:"#FBBC05",d:"M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"}),s.jsx("path",{fill:"#34A853",d:"M24 48c6.48 0 12.38-2.12 16.66-5.73l-7.73-6c-2.15 1.45-4.92 2.3-8.93 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"}),s.jsx("path",{fill:"none",d:"M0 0h48v48H0z"})]}),s.jsx("p",{children:"GOOGLE"})]})},es=({defaultInfo:t,userLogin:n,school:r,isShowPassword:l,setIsShowPassword:m,fnIsCheckLogin:p,googleClientId:h,fnLoginSSO:N,extensionEmail:b,onLoginWidthClever:j,openModalSelectGrade:L,handleRegisterUser:x,onToggleModelGrade:k})=>{const w=()=>m(!l),D=Q.useDispatch(),{executeRecaptcha:P}=le.useGoogleReCaptcha(),C=o.useCallback(async()=>{if(!P){console.log("execute recaptcha undefined");return}return await P("login")},[P]),T=async v=>{try{await e.AccountSSOLogApi(v)}catch(E){console.error(E)}},q=async v=>{if(v?.accessToken){let{email:E,familyName:V,givenName:y,imageUrl:I,name:_}=v.profileObj,F=v.accessToken,Y=v.googleId;const J=window.location.hostname.split(".marioforme.com")?.[0],W=E.split("@")?.[1],he=b?.split(",")?.map(U=>U.trim())?.filter(U=>U).some(U=>W.includes(U));if(!W.includes(J)&&!he){alert("The email address you used does not match the login information in the database. Please check that you are using your school assigned email address to log into MARIO for Me. If you have further trouble please notify your school site administrator"),await T([`${W} is incorrect`]);return}const ce={firstName:y,lastName:V,imageUrl:I,fullName:_,email:E,accessToken:F,googleId:Y};D(e.setInforUserGoogle(ce)),p(se.TypeLogin.Google,ce,F,C)}};return s.jsxs(o.Fragment,{children:[s.jsx(ue.Formik,{initialValues:t,validationSchema:Qe,onSubmit:async v=>{try{const E=await C();if(!E)return;v.captcha=E,v.loginType=se.LoginType.Default,n(v)}catch(E){console.error(E)}},children:v=>{const{handleBlur:E,handleSubmit:V,values:y,touched:I,errors:_,setFieldValue:F}=v,Y=I.email&&_.email,ae=I.password&&_.password;return s.jsx("div",{className:`${e.styles["box-login"]} w-100`,children:s.jsx(g.Form,{className:`${e.styles["block-login"]}`,onSubmit:V,children:s.jsxs("div",{className:`${e.styles["block-form"]}`,children:[s.jsxs("div",{className:"d-flex align-items-center mb-4",children:[s.jsx("img",{hidden:!r?.schoolLogo,src:r?.schoolLogo,className:`${e.styles["school-icon"]} mr-3`}),s.jsx("p",{className:`${e.styles["school-name"]} mb-0`,children:r.schoolName})]}),s.jsx("p",{className:`${e.styles["title-login"]}`,children:"Welcome Back!"}),s.jsx("p",{className:`${e.styles["login-description"]} mb-5`,children:"Please enter your MARIO Education account details"}),s.jsxs(g.FormGroup,{className:`${e.styles["form-user-name"]}`,children:[s.jsx(g.Input,{type:"text",name:"email",placeholder:"Email",value:y.email,onChange:J=>F("email",J.target?.value?.trim()||""),autocomplete:"email",onBlur:E("email"),required:!0}),Y&&s.jsx(e.ErrorHandler,{text:_.email})]}),s.jsxs(g.FormGroup,{children:[s.jsx(ie,{isShowPassword:l,togglePasswordVisible:w,onChange:J=>F("password",J.target?.value?.trim()||"")}),ae&&s.jsx(e.ErrorHandler,{text:_.password})]}),s.jsx(g.FormGroup,{}),s.jsxs("div",{className:"d-flex justify-content-between",children:[s.jsxs("div",{className:"d-flex align-items-center",style:{gap:"8px"},children:[s.jsx("input",{type:"checkbox",checked:!y.isSessionUserBrowser,className:`${e.styles["checkbox-keep-login"]}`,onChange:()=>F("isSessionUserBrowser",!y.isSessionUserBrowser)}),s.jsx("p",{className:`${e.styles["label-keep-login"]} mb-0 ml-2`,children:"Keep me logged in"})]}),s.jsx(te.Link,{to:"/forgot-password",className:`${e.styles["link-to-login"]}`,children:"Forgot password?"})]}),s.jsx("button",{className:`${e.styles["btn-login"]} mt-5`,type:"submit",children:"LOG IN"}),s.jsx("p",{className:`${e.styles["option-text"]} my-3 text-center`,children:"OR"}),s.jsxs(g.Row,{className:"mb-4",children:[s.jsx(g.Col,{lg:6,md:6,xs:12,className:"pr-md-3",children:!!h&&s.jsx(ke.GoogleOAuthProvider,{clientId:h,children:s.jsx(Xe,{onSuccess:q,onError:()=>console.log("Google login failed")})})}),r.schoolId&&s.jsx(g.Col,{lg:6,md:6,xs:12,className:`${e.styles["btn-login-sso"]} pl-md-2`,hidden:!r?.schoolId,children:s.jsxs("div",{className:e.styles["btn-login-with-sso"],onClick:()=>N(C),children:[s.jsx("img",{src:"images/microsoft-logo.png"}),s.jsx("p",{children:"MICROSOFT"})]})})]}),s.jsx("div",{className:`${e.styles["btn-login-sso"]}`,children:s.jsxs("div",{className:e.styles["btn-login-with-sso"],onClick:()=>window.open("https://launchpad.classlink.com/login"),children:[s.jsx("img",{src:"images/class-link-icon.png"}),s.jsx("p",{children:"SIGN IN WITH CLASSLINK"})]})}),s.jsx("div",{className:`${e.styles["btn-login-sso"]} mt-4`,children:s.jsxs("div",{className:e.styles["btn-login-with-sso"],onClick:()=>j(),children:[s.jsx("img",{src:"images/clever-icon.png"}),s.jsx("p",{children:"SIGN IN WITH CLEVER"})]})})]})})})}}),s.jsx(Ze,{open:L,onConfirm:x,clickHandler:C,onClose:k})]})},ss={email:"",captcha:""},ts="/",ve="/login",as="Log in",Te=()=>{const t=new URLSearchParams(te.useLocation().search),n=t.get("token"),r=t.get("key")??"",l=Q.useDispatch(),m=te.useNavigate(),[p,h]=o.useState(!1),N=o.useCallback(()=>{h(!p)},[p]),[b,j]=o.useState(!1),[L,x]=o.useState(!1),[k,w]=o.useState({token:"",password:"",reEnterPassword:"",email:"",userId:""}),[D,P]=o.useState(!0),{executeRecaptcha:C}=le.useGoogleReCaptcha();o.useEffect(()=>{document.title=as,e.getAccessToken()&&m(ts)},[]);const T=o.useCallback(async y=>{l(e.setLoading(!0));try{await e.forgotPassword(y),m(ve),l(e.setAlert({type:"success",message:"A mail to reset password was sent"}))}catch(I){l(e.setAlert({type:"danger",message:I.response?.data?.title||I.message||"Error occured"})),localStorage.removeItem(e.ACCESS_TOKEN),sessionStorage.removeItem(e.ACCESS_TOKEN)}l(e.setLoading(!1))},[]),q=o.useCallback(async(y,I)=>{l(e.setLoading(!0));try{const _=await e.checkResetToken(y,I);_.data?w({...k,token:y,email:_.data}):P(!1)}catch{P(!1)}l(e.setLoading(!1))},[]),v=o.useCallback(async y=>{l(e.setLoading(!0));try{await e.resetPassword({...y,key:r}),m(ve),l(e.setAlert({type:"success",message:"Reset password sucessfully"}))}catch(I){l(e.setAlert({type:"danger",message:I.response?.data?.title||I.message||"Error occured"})),localStorage.removeItem(e.ACCESS_TOKEN),sessionStorage.removeItem(e.ACCESS_TOKEN)}l(e.setLoading(!1))},[]),E=o.useCallback(async()=>{if(!C){console.log("execute recaptcha undefined");return}return await C("forgetPass")},[C]),V=o.useCallback(()=>{},[]);return o.useEffect(()=>{n&&r&&q(n,r)},[n,r]),{defaultInfo:ss,forgotPasswordRequest:T,checkResetTokenRequest:q,validLink:D,resetPasswordRequest:v,openLogin:p,toggle:N,isShowNewPassword:b,setIsShowNewPassword:j,isShowReTypePassword:L,setIsShowReTypePassword:x,clickHandler:E,handleVerify:V,initialValues:k}},os={email:"",captcha:""},ns=M.object({email:M.string().email("Email is invalid").required("Email is required")}),rs=({school:t})=>{const{forgotPasswordRequest:n,clickHandler:r,handleVerify:l}=Te();return s.jsx(ue.Formik,{initialValues:os,enableReinitialize:!0,validationSchema:ns,onSubmit:async m=>{const p=await r();p&&(m.captcha=p,n(m))},children:m=>{const{handleChange:p,handleSubmit:h,values:N,touched:b,errors:j}=m;return s.jsx("div",{className:`${e.styles["box-login"]}`,children:s.jsx("div",{className:`${e.styles["block-login"]}`,children:s.jsxs("div",{className:`${e.styles["block-form"]}`,children:[s.jsxs("div",{className:"d-flex align-items-center mb-4",children:[s.jsx("img",{src:t.schoolLogo,className:`${e.styles["school-icon"]} mr-3`}),s.jsx("p",{className:`${e.styles["school-name"]} mb-0`,children:t.schoolName})]}),s.jsx("p",{className:`${e.styles["title-login"]} `,children:"Forgot password"}),s.jsx("p",{className:`${e.styles["recover-account"]} mb-5`,children:"Enter email to recover your account"}),s.jsxs("div",{className:"w-100",children:[s.jsx(g.Input,{type:"text",name:"email",id:"email",placeholder:"Input email",onChange:p,value:N.email}),b.email&&j.email&&s.jsx(e.ErrorHandler,{text:j.email})]}),s.jsx(te.Link,{to:"/login",className:`${e.styles["link-to-login"]} mt-2`,children:"Return to login"}),s.jsx(le.GoogleReCaptcha,{action:"forgetPass",onVerify:l}),s.jsx(g.Col,{className:"p-0",children:s.jsx("button",{className:`${e.styles["btn-login"]} mt-5`,onClick:()=>h(),children:"Continue"})})]})})})}})},is=M.object({password:M.string().required("New password is required"),reEnterPassword:M.string().required("Please re-enter new password").test("matching","Passwords do not match",function(){return this.parent.password===this.parent.reEnterPassword})}),ls=()=>{const{validLink:t,resetPasswordRequest:n,isShowNewPassword:r,setIsShowNewPassword:l,isShowReTypePassword:m,setIsShowReTypePassword:p,initialValues:h}=Te();return s.jsx(ue.Formik,{initialValues:h,enableReinitialize:!0,validationSchema:is,onSubmit:N=>{n(N)},children:N=>{const{setFieldValue:b,handleSubmit:j,touched:L,errors:x,values:k}=N;return s.jsx(g.Row,{className:`${e.styles["box-login"]}`,children:s.jsx(g.Col,{className:"p-0",children:s.jsx("div",{className:`${e.styles["block-login"]}`,children:s.jsxs("div",{className:`${e.styles["block-form"]}`,children:[s.jsx("img",{src:`${e.getStaticFileUrl("/images/horizontal-logo-blue.svg")}`,className:`${e.styles["img-login-rectangle"]}`}),s.jsx("p",{className:`${e.styles["title-login"]}`,children:"Reset Password"}),s.jsx("div",{className:"w-100",children:t?s.jsxs(o.Fragment,{children:[s.jsx(g.FormGroup,{className:`${e.styles["form-user-name"]}`,children:s.jsx(g.Input,{disabled:!0,type:"text",name:"email",placeholder:"Email",value:k.email,autocomplete:"email",required:!0,className:`${e.styles.input}`})}),s.jsxs("div",{className:`${e.styles["form-user-name"]}`,children:[s.jsx(ie,{isShowPassword:r,togglePasswordVisible:()=>l(!r),onChange:w=>b("password",w.target.value)}),L.password&&x.password&&s.jsx(e.ErrorHandler,{text:x.password})]}),s.jsxs("div",{className:`${e.styles["form-user-name"]}`,children:[s.jsx(ie,{placeholder:"Confirm Password",isShowPassword:m,togglePasswordVisible:()=>p(!m),onChange:w=>b("reEnterPassword",w.target.value)}),L.reEnterPassword&&x.reEnterPassword&&s.jsx(e.ErrorHandler,{text:x.reEnterPassword})]})]}):s.jsxs(o.Fragment,{children:[s.jsx("p",{className:`${e.styles["recover-account"]} mb-5`,children:"Invalid reset password link"}),s.jsx("p",{className:"w-100",children:"It may have been accessed before or expired or you have just tried to reset another account's password"})]})}),t&&s.jsx(g.Col,{className:"p-0",children:s.jsx("button",{className:`${e.styles["btn-login"]} ${e.styles["btn-rounder"]} mt-4`,onClick:()=>j(),children:"SET A NEW PASSWORD"})})]})})})})}})},Ae=`${e.BASE_URL}/api/school`,cs=()=>e.api.get(`${Ae}/settings`),ds=()=>e.api.get(`${Ae}/info`),ms={auth:{clientId:e.isLocalhost?"a27f8ac9-e039-4bbd-a9e1-3096e52a77bb":"90c6897c-f17b-475e-a7a8-9a19651e0060",authority:"https://login.microsoftonline.com/common",redirectUri:"https://sso.marioforme.com/microsoft-login.html"},cache:{cacheLocation:"sessionStorage",storeAuthStateInCookie:!1},system:{loggerOptions:{loggerCallback:(t,n,r)=>{if(!r)switch(t){case re.LogLevel.Error:console.error(n);return;case re.LogLevel.Info:console.info(n);return;case re.LogLevel.Verbose:console.debug(n);return;case re.LogLevel.Warning:console.warn(n);return;default:return}}}}},gs={email:"",password:"",captcha:"",rememberMe:!1,isSessionUserBrowser:!!sessionStorage.getItem(e.IS_USER_SESSION_BROWSER)},us="/home",Ee="/home",hs="/admin/home",ps="/parent",fs="/admin/schools",xs="/list-student",Ss="Log in",ws=()=>{const t=Q.useDispatch(),n=te.useNavigate(),[r,l]=o.useState(!1),m=Q.useSelector(a=>a.common.isLoginGoogle),[p,h]=o.useState(""),[N,b]=o.useState(""),[j,L]=o.useState(""),[x,k]=o.useState(!1),w=Q.useSelector(a=>a.common.inforUserGoogle),D=Q.useSelector(a=>a.common.environment),P=new URLSearchParams(location.search),C=P.get("type")==="classlink",T=P.get("token"),q=P.get("isAdminUser"),[v]=o.useState(!1),[E,V]=o.useState({schoolName:"",schoolLogo:"",schoolId:0}),[y,I]=o.useState(null),_=o.useCallback(()=>{l(!r)},[r]),[F,Y]=o.useState(!1),[ae,J]=o.useState(!1),[W,he]=o.useState({firstName:"",lastName:"",fullName:"",imageUrl:"",email:"",accessToken:"",googleId:""});o.useEffect(()=>{document.title=Ss;const a=e.getCookieValue("auth-token");if(a){const d=window.location.hostname;if(localStorage.setItem(e.ACCESS_TOKEN,a),document.cookie=`auth-token=;domain=${d.includes("localhost")?d:".marioforme.com"}; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`,document.cookie="redirect-uri=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/",q)return n("/admin/home");Se(a);return}e.getAccessToken()&&n("/"),Ge()},[q,Se,n]);const ce=()=>{localStorage.removeItem(e.ACCESS_TOKEN),sessionStorage.removeItem(e.ACCESS_TOKEN),localStorage.removeItem("USER_EMAIL")};o.useEffect(()=>{C&&T!=""&&_e()},[]);const U=()=>{J(!ae)},Pe=()=>{if(e.isLocalhost){const a="https://clever.com/oauth/instant-login?client_id=44f4bbf55cd873d3f7e5&district_id=6620cba31f1ddde7bd689dc5";window.location.href=a}else{const a=`https://clever.com/oauth/authorize?response_type=code&redirect_uri=${encodeURIComponent("https://classlink.marioforme.com/api/clever/clever-login")}&client_id=c3da6c669d239c70d48e`;window.location.href=a}},_e=async()=>{t(e.setLoading(!0));try{const a={tokenClassLink:T},i=await e.apiInforUserClassLink(a),{email:d,token:f}=i.data;await Z({email:d,rememberMe:!1,password:"default",accessToken:f})}catch(a){t(e.setAlert({type:"danger",message:a.response?.data?.title||a.message}))}t(e.setLoading(!1))},pe=window.location.host.includes("-district"),Re=o.useCallback(async()=>{t(e.setLoading(!0));try{const a=await ds(),i=a.data.schoolLogo??"";a.data&&V({schoolName:a.data.schoolName,schoolLogo:i?e.getFileUrl(i):e.getStaticFileUrl("/images/logo_header_blue.png"),schoolId:a.data.schoolId})}catch(a){t(e.setAlert({type:"danger",message:a.response?.data?.title||a.message}))}t(e.setLoading(!1))},[]),[$e,de]=o.useState(!1),[X,fe]=o.useState(null),oe=o.useCallback((a,i,d,f,c,B,$,z,H,A)=>{const O=A?.isSessionUserBrowser??!1;O?(sessionStorage.setItem(e.ACCESS_TOKEN,a),sessionStorage.setItem(e.IS_USER_SESSION_BROWSER,String(O))):(sessionStorage.removeItem(e.IS_USER_SESSION_BROWSER),localStorage.setItem(e.ACCESS_TOKEN,a)),localStorage.removeItem(e.NOTIFICATION_ALERT_KEY),sessionStorage.removeItem("ACTIVE_ROLE"),t(e.setUser({id:i,firstName:d,lastName:f,roles:c,email:B,profileImageFileName:$}));let S=localStorage.getItem("ROLES")||"";if(!S){if(c.includes("Admin"))S="Admin";else{const R=((i?localStorage.getItem(`PREFERRED_ROLE_${i}`):null)||"").split(",").map(ge=>ge.trim()).filter(Boolean);R.length>0&&R.every(ge=>c.includes(ge))?R.length>1?S=R.every(je=>je==="Teacher"||je==="Assistant")?"Teacher,Assistant":R[0]:S=R[0]:c.includes("Teacher")?S=c.includes("Assistant")?"Teacher,Assistant":"Teacher":c.includes("Assistant")?S="Assistant":c.includes("Counselor")?S="Counselor":c.includes("SecondaryTeacher")?S="SecondaryTeacher":c.includes("EduTeacher")?S="EduTeacher":c.includes("Student")?S="Student":c.includes("Parent")?S="Parent":c.length>0&&(S=c[0])}S&&(localStorage.setItem("ROLES",S),sessionStorage.setItem("ACTIVE_ROLE",S))}if(A?.email&&!c.includes("Admin")){ne.init(e.isLocalhost?e.INIT_AMPLITUDE_KEY_STAGE:e.INIT_AMPLITUDE_KEY_PROD,A.email,{defaultTracking:!1});const ee=window.location.hostname,R=new ne.Identify;R.set("domain",ee),ne.identify(R),ne.track("general: session start",{user_id:A.email,domain:ee,roles:c?.toString()}),localStorage.setItem("USER_EMAIL",A.email),z&&ne.track("general: first login",{user_id:A.email,domain:ee,roles:c?.toString()})}const K=ee=>{const R=e.navigateBySchoolLevel(ee,H);window.location.pathname.startsWith("/es")?H==="es"?n(R):window.location.href=R:H==="es"?window.location.href=R:n(R)},G=S.split(",")[0]||"";pe?K(fs):c.includes("Admin")||G==="Admin"?K(hs):G==="Teacher"||G==="Assistant"||G==="Counselor"||G==="SecondaryTeacher"||!G&&(c.includes("Teacher")||c.includes("Assistant")||c.includes("Counselor")||c.includes("SecondaryTeacher"))?K(us):G==="Student"||!G&&c.includes("Student")?K(Ee):G==="Parent"||!G&&c.includes("Parent")?K(ps):(G==="EduTeacher"||!G&&c.includes("EduTeacher"))&&K(xs),t(e.setLoading(!1))},[t,n,pe]),me=o.useCallback((a,i,d)=>x&&a?.includes("Student")&&(i==="es"||d==="ES")?(t(e.setAlert({type:"danger",message:"Unable to sign in with SSO. Please contact your admin or teacher."})),localStorage.removeItem(e.ACCESS_TOKEN),sessionStorage.removeItem(e.ACCESS_TOKEN),t(e.setLoading(!1)),!0):!1,[x,t]),xe=o.useCallback(a=>x&&a&&e.ES_GRADES.includes(a.trim())?(t(e.setAlert({type:"danger",message:"Unable to sign in with SSO. Please contact your admin or teacher."})),t(e.setLoading(!1)),!0):!1,[x,t]);async function Se(a){t(e.setLoading(!0));try{const i=await e.getInfo();let{id:d,firstName:f,lastName:c,roles:B,email:$,profileImageFileName:z,isLoginFirst:H,schoolLevel:A,appType:O,preferredAppType:S,needsAppTypeChoice:K}=i.data;if(K){fe({email:$}),de(!0),t(e.setLoading(!1));return}A||(O==="ES"||O==="ES, MS"&&S==="ES")&&(A="es"),oe(a,d,f,c,B,$,z,H,A,{email:$})}catch(i){t(e.setAlert({type:"danger",message:i.response?.data?.title||i.message||"Login failed"})),t(e.setLoading(!1))}}const Oe=o.useCallback(async a=>{if(de(!1),!X)return;t(e.setLoading(!0));const i=a==="es"?"ES":a==="ms"?"MS":"ES, MS";try{const d=await e.logIn({...X,email:X?.email?.trim(),password:X?.password?.trim(),preferredAppType:i});let{token:f,id:c,firstName:B,lastName:$,roles:z,email:H,profileImageFileName:A,isLoginFirst:O,schoolLevel:S}=d.data;if(!S&&a==="es"&&(S="es"),me(z,S,d.data.appType))return;oe(f,c,B,$,z,H,A,O,S,X)}catch(d){t(e.setAlert({type:"danger",message:d.response?.data?.title||d.message||"Login failed"})),t(e.setLoading(!1))}},[X,oe,me,t]),Z=o.useCallback(async a=>{t(e.setLoading(!0));try{const i=await e.logIn({...a,email:a?.email?.trim(),password:a?.password?.trim()});let{token:d,id:f,firstName:c,lastName:B,roles:$,email:z,profileImageFileName:H,isLoginFirst:A,schoolLevel:O}=i.data;if(i.data.needsAppTypeChoice){fe(a),de(!0),t(e.setLoading(!1));return}if(O||(i.data.appType==="ES"||i.data.appType==="ES, MS"&&i.data.preferredAppType==="ES")&&(O="es"),me($,O,i.data.appType))return;oe(d,f,c,B,$,z,H,A,O,a)}catch(i){t(e.setAlert({type:"danger",message:i.response?.data?.title||i.message||"Login failed"})),localStorage.removeItem(e.ACCESS_TOKEN),sessionStorage.removeItem(e.ACCESS_TOKEN),t(e.setLoading(!1))}},[oe,me,t]),Ge=async()=>{try{const a=await e.getGoogleClientId();h(a.data.googleClientId),b(a.data.googleCaptchaId),L(a.data.extensionEmail),k(a.data.isRestrictedLogin)}catch(a){t(e.setAlert({type:"danger",message:a.response?.data?.title||a.message||"Login failed"}))}},we=o.useCallback(async(a,i,d,f)=>{t(e.setLoading(!0));try{if((await e.checkUserGoogle(a,i)).data){const $={email:i.email,isLoginGoogle:!0,rememberMe:!1,password:"default",accessToken:d,captcha:"",loginType:se.LoginType.Google};if(f!=null){const z=await f();$.captcha=z}await Z($),t(e.setIsLoginGoogle(!1))}else he({...i,token:d}),U()}catch(c){t(e.setAlert({type:"danger",message:c.response?.data?.title||c.message||"Login failed"}))}t(e.setLoading(!1))},[Z,t,U]),Me=o.useCallback(async(a,i)=>{t(e.setLoading(!0));try{if(xe(a))return;if((await e.registerUserStudent({...W,gradeLevel:a}))?.data){const f={email:W.email,isLoginGoogle:!0,rememberMe:!1,password:"default",accessToken:W.accessToken,captcha:"",loginType:se.LoginType.Google};if(i!=null){const c=await i();f.captcha=c}await Z(f),U()}}catch(d){t(e.setAlert({type:"danger",message:d.response?.data?.title||d.message||"Login failed"}))}t(e.setLoading(!1))},[xe,W,Z,U,t]),Ue=async(a,i)=>{t(e.setLoading(!0));try{const d={firstName:w.firstName,lastName:w.lastName,imageUrl:w.imageUrl,fullName:w.fullName,email:w.email,accessToken:w.accessToken,teacherId:a};if((await e.registerUserStudent(d)).data){const c=await i(),B={email:w.email,captcha:c,isLoginGoogle:!0,rememberMe:!1,password:"default",accessToken:w.accessToken,loginType:se.LoginType.Google};t(e.setIsLoginGoogle(!1)),await Z(B),n(Ee)}}catch(d){t(e.setAlert({type:"danger",message:d.response?.data?.title||d.message||"Login failed"}))}t(e.setIsLoginGoogle(!1)),t(e.setLoading(!1))},Fe=async()=>{try{const a=await cs();t(e.setSandboxMode(a.data.isSandboxMode))}catch(a){console.error(a)}},ye=async a=>{y.handleRedirectPromise().then(async i=>{if(E?.schoolId)if(i){let d=i.account;await Ne(d,a)}else{const d=y.getAllAccounts();if(d.length===0){const f=D==="PreProduction"?"https://mario1.marioforme.com":e.isLocalhost?"https://brightsoft.marioforme.com":"https://sso.marioforme.com";window.location.href=(window.location.hostname==="localhost"?window.location.origin:f)+`/microsoft-login.html?redirect-uri=${window.location.origin}&schoolId=${E.schoolId}`}else{let f=d[0];await Ne(f,a)}}}).catch(i=>{console.error(i)})},Ne=async(a,i)=>{let d=a.name,f={firstName:d.split(" ").slice(0,-1).join(" "),lastName:d.split(" ").slice(-1).join(" "),fullName:d,imageUrl:"",email:a.username,accessToken:a.idTokenClaims.aio,googleId:a.tenantId};t(e.setInforUserGoogle(f)),await we(se.TypeLogin.MicrosoftSSO,f,a.idTokenClaims.aio,i)},Be=async()=>{const a=new re.PublicClientApplication(ms);await a.initialize(),I(a)};return o.useEffect(()=>{let a=window.location.href;y&&a.includes("code")&&a.includes("client_info")&&ye()},[JSON.stringify(y)]),o.useEffect(()=>{Fe(),Be(),Re()},[]),{defaultInfo:gs,userLogin:Z,openLogin:r,toggle:_,isShowPassword:F,setIsShowPassword:Y,fnIsCheckLogin:we,isLoginGoogle:m,infoUser:w,submitLogin:Ue,googleClientId:p,googleRecaptchaId:N,handleCancelModelAssign:ce,openModelAssign:v,fnLoginSSO:ye,school:E,extensionEmail:j,handleLoginWidthClever:Pe,openModalSelectGrade:ae,handleRegisterUser:Me,handleToggleModelGrade:U,openModalSelectTier:$e,handleSelectTier:Oe,setOpenModalSelectTier:de}},Le="/",ys="/login",be="Log in",Ns=()=>{const t=Q.useDispatch(),n=te.useNavigate(),r=location.search,m=new URLSearchParams(r).get("userId"),[p,h]=o.useState(!1),[N,b]=o.useState(!1),[j,L]=o.useState({password:"",reEnterPassword:"",email:"",userId:m??"",token:""}),{executeRecaptcha:x}=le.useGoogleReCaptcha(),k=o.useCallback(async C=>{t(e.setLoading(!0));try{const T=await e.getUserNewPassword(C);L({...j,email:T.data})}catch(T){t(e.setAlert({type:"danger",message:T.message}))}t(e.setLoading(!1))},[]),w=o.useCallback(async C=>{t(e.setLoading(!0));try{await e.createPassword(C),n(ys),t(e.setAlert({type:"success",message:"Create password sucessfully"}))}catch(T){t(e.setAlert({type:"danger",message:T.response?.data?.title||T.message||"Error occured"})),localStorage.removeItem(e.ACCESS_TOKEN),sessionStorage.removeItem(e.ACCESS_TOKEN)}t(e.setLoading(!1))},[]),D=o.useCallback(async()=>{if(!x){console.log("execute recaptcha undefined");return}return await x("forgetPass")},[x]),P=o.useCallback(()=>{},[]);return o.useEffect(()=>{document.title=be,e.getAccessToken()&&n(Le),m&&k(m)},[m]),o.useEffect(()=>{document.title=be,e.getAccessToken()&&n(Le)},[]),{createPasswordRequest:w,isShowNewPassword:p,setIsShowNewPassword:h,isShowReTypePassword:N,setIsShowReTypePassword:b,clickHandler:D,handleVerify:P,initialValues:j}},js=M.object({password:M.string().required("Password is required"),reEnterPassword:M.string().required("Please re-enter Password").test("matching","Passwords do not match",function(){return this.parent.password===this.parent.reEnterPassword})}),Cs=()=>{const{createPasswordRequest:t,isShowNewPassword:n,setIsShowNewPassword:r,isShowReTypePassword:l,setIsShowReTypePassword:m,initialValues:p}=Ns();return s.jsx(ue.Formik,{initialValues:p,enableReinitialize:!0,validationSchema:js,onSubmit:h=>{t(h)},children:h=>{const{setFieldValue:N,handleSubmit:b,touched:j,errors:L,values:x}=h;return s.jsx(g.Row,{className:`${e.styles["box-login"]}`,children:s.jsxs(g.Col,{className:"p-0",children:[s.jsx("div",{hidden:!x.email,className:`${e.styles["block-login"]}`,children:s.jsxs("div",{className:`${e.styles["block-form"]}`,children:[s.jsx("img",{src:`${e.getStaticFileUrl("/images/horizontal-logo-blue.svg")}`,className:`${e.styles["img-login-rectangle"]}`}),s.jsx("p",{className:`${e.styles["title-login"]}`,children:"Create Your Password"}),s.jsx("div",{className:"w-100",children:s.jsxs(o.Fragment,{children:[s.jsx(g.FormGroup,{className:`${e.styles["form-user-name"]}`,children:s.jsx(g.Input,{disabled:!0,type:"text",name:"email",placeholder:"Email",value:x.email,autocomplete:"email",required:!0,className:`${e.styles.input}`})}),s.jsxs("div",{className:`${e.styles["form-user-name"]}`,children:[s.jsx(ie,{isShowPassword:n,togglePasswordVisible:()=>r(!n),onChange:k=>N("password",k.target.value)}),j.password&&L.password&&s.jsx(e.ErrorHandler,{text:L.password})]}),s.jsxs("div",{className:`${e.styles["form-user-name"]}`,children:[s.jsx(ie,{placeholder:"Confirm Password",isShowPassword:l,togglePasswordVisible:()=>m(!l),onChange:k=>N("reEnterPassword",k.target.value)}),j.reEnterPassword&&L.reEnterPassword&&s.jsx(e.ErrorHandler,{text:L.reEnterPassword})]})]})}),s.jsx("button",{className:`${e.styles["btn-login"]} ${e.styles["btn-rounder"]} mt-4`,onClick:()=>b(),children:"CREATE YOUR PASSWORD"})]})}),s.jsx("div",{hidden:!!x.email,className:`${e.styles["block-login"]}`,children:s.jsxs("div",{className:`${e.styles["block-form"]}`,children:[s.jsx("img",{src:`${e.getStaticFileUrl("/images/horizontal-logo-blue.svg")}`,className:`${e.styles["img-login-rectangle"]}`}),s.jsx("p",{className:`${e.styles["title-login"]}`,children:"You cannot regenerate the password"})]})})]})})}})},vs="_modalContent_1pxxz_1",Es="_closeButton_1pxxz_6",Ls="_modalBody_1pxxz_17",bs="_iconWrapper_1pxxz_22",ks="_title_1pxxz_38",Is="_subtitle_1pxxz_45",Ts="_tierCard_1pxxz_51",As="_es_1pxxz_60",Ps="_tierTitle_1pxxz_71",_s="_tierDesc_1pxxz_76",Rs="_arrow_1pxxz_81",$s="_ms_1pxxz_85",Os="_both_1pxxz_110",Gs="_cardLeft_1pxxz_134",Ms="_cardText_1pxxz_138",u={modalContent:vs,closeButton:Es,modalBody:Ls,iconWrapper:bs,title:ks,subtitle:Is,tierCard:Ts,es:As,tierTitle:Ps,tierDesc:_s,arrow:Rs,ms:$s,both:Os,cardLeft:Gs,cardText:Ms},Us=({open:t,onSelectTier:n,onClose:r})=>s.jsxs(g.Modal,{isOpen:t,style:{zIndex:1201,maxWidth:450},centered:!0,autoFocus:!1,returnFocusAfterClose:!1,contentClassName:u.modalContent,children:[s.jsx("div",{className:u.closeButton,children:r&&s.jsx(e.MdClose,{onClick:()=>r(),size:24})}),s.jsxs(g.ModalBody,{className:u.modalBody,children:[s.jsx("div",{className:u.iconWrapper,children:s.jsx("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})})}),s.jsx("h4",{className:u.title,children:"Select Grade Level"}),s.jsx("p",{className:u.subtitle,children:"Select the grade levels you support"}),s.jsxs("div",{onClick:()=>n("es"),className:`${u.tierCard} ${u.es}`,children:[s.jsxs("div",{className:u.cardLeft,children:[s.jsx("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"})}),s.jsxs("div",{className:u.cardText,children:[s.jsx("div",{className:u.tierTitle,children:"Elementary / Primary"}),s.jsx("div",{className:u.tierDesc,children:"Grades 2-5 / Years 3-6"})]})]}),s.jsx("div",{className:u.arrow,children:">"})]}),s.jsxs("div",{onClick:()=>n("ms"),className:`${u.tierCard} ${u.ms}`,children:[s.jsxs("div",{className:u.cardLeft,children:[s.jsx("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"})}),s.jsxs("div",{className:u.cardText,children:[s.jsx("div",{className:u.tierTitle,children:"Middle & High / Secondary"}),s.jsx("div",{className:u.tierDesc,children:"Grades 6-12 / Years 7-13"})]})]}),s.jsx("div",{className:u.arrow,children:">"})]}),s.jsxs("div",{onClick:()=>n("both"),className:`${u.tierCard} ${u.both}`,children:[s.jsxs("div",{className:u.cardLeft,children:[s.jsx("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M17 14v6m-3-3h6M6 10h2a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v2a2 2 0 002 2zm10 0h2a2 2 0 002-2V6a2 2 0 00-2-2h-2a2 2 0 00-2 2v2a2 2 0 002 2zM6 20h2a2 2 0 002-2v-2a2 2 0 00-2-2H6a2 2 0 00-2 2v2a2 2 0 002 2z"})}),s.jsxs("div",{className:u.cardText,children:[s.jsx("div",{className:u.tierTitle,children:"Both Tiers"}),s.jsx("div",{className:u.tierDesc,children:"Access all grade levels"})]})]}),s.jsx("div",{className:u.arrow,children:">"})]})]})]}),Fs=o.memo(Us),Bs="Log in",zs="Forgot password",Ds="Reset password",qs=t=>{const{isLogin:n,isForgotPassword:r,isResetPassword:l,isCreatePassword:m}=t,{defaultInfo:p,userLogin:h,googleRecaptchaId:N,handleCancelModelAssign:b,school:j,openModelAssign:L,setIsShowPassword:x,fnIsCheckLogin:k,isLoginGoogle:w,submitLogin:D,infoUser:P,googleClientId:C,isShowPassword:T,fnLoginSSO:q,extensionEmail:v,handleLoginWidthClever:E,openModalSelectGrade:V,handleRegisterUser:y,handleToggleModelGrade:I,openModalSelectTier:_,handleSelectTier:F,setOpenModalSelectTier:Y}=ws();return o.useEffect(()=>{n&&(document.title=Bs),r&&(document.title=zs),l&&(document.title=Ds)},[n,r,l]),s.jsxs("div",{className:`${e.styles.login} container-fluid font-family-lato`,children:[s.jsxs(g.Row,{className:"h-100",children:[s.jsxs(g.Col,{lg:8,md:12,xs:12,className:"d-flex justify-content-center h-100 align-items-center p-3 flex-column",children:[!!N&&s.jsxs(le.GoogleReCaptchaProvider,{useRecaptchaNet:!0,reCaptchaKey:N,scriptProps:{async:!0,defer:!0,appendTo:"body"},children:[n&&s.jsx(es,{userLogin:h,defaultInfo:p,onCancelModelAssign:b,openModelAssign:L,school:j,fnIsCheckLogin:k,googleClientId:C,infoUser:P,isLoginGoogle:w,isShowPassword:T,setIsShowPassword:x,submitLogin:D,fnLoginSSO:q,extensionEmail:v,onLoginWidthClever:E,openModalSelectGrade:V,handleRegisterUser:y,onToggleModelGrade:I}),r&&s.jsx(rs,{school:j})]}),l&&s.jsx(ls,{}),m&&s.jsx(Cs,{}),s.jsx("a",{href:"/privacy-policy/",target:"blank",className:`${e.styles["privacy-policy"]}`,children:"Privacy Policy"})]}),s.jsx(g.Col,{className:"p-3 mh-100 d-flex justify-content-end",lg:4,md:12,xs:12,children:s.jsx("img",{src:`${e.getStaticFileUrl(window.innerWidth>992?"/images/img-login.png":"/images/img-login-tablet.png")}`,className:`${e.styles["img-login"]}`})})]}),s.jsx(Fs,{open:_,onSelectTier:F,onClose:()=>Y(!1)})]})};exports.default=qs;