mario-education 2.0.90-staging → 2.0.91-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 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),pe=require("reactstrap"),c=require("mario-core"),oe=require("./constants-DfnEgLPg.cjs"),p=require("react"),re=require("react-redux"),ve=require("formik"),Te=require("yup"),j=require("@mui/material"),fe=require("@mui/x-date-pickers"),Ce=require("moment"),b=require("./OutlinedInput-Ce7Dma58.cjs"),we=require("./constants-BIVJZV78.cjs"),Se=require("./DoneCheckInIcon-7Q31KvHI.cjs"),he=require("./userService-DsbgpY7L.cjs"),Ee=require("./styles.module-CHKJJ8Zm.cjs"),ke=require("./AdapterMoment-B-q0UCj0.cjs"),ce=require("./Visibility-CDU117S_.cjs"),de=require("./IconButton-DWhytE6k.cjs"),xe=require("react-router-dom"),Pe=require("date-fns");function De(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const _=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(a,o,_.get?_:{enumerable:!0,get:()=>t[o]})}}return a.default=t,Object.freeze(a)}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 G=(t=>(t.Info="info",t.ForgotPassword="forgotPassword",t.DownloadUserData="downloadUserData",t.ChangePassword="changePassword",t))(G||{});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}],be=["Admin","Assistant","Teacher","Counselor","General ED teacher","SecondaryTeacher","Parent","Student"],$e=be,Le=be.filter(t=>t!=="SecondaryTeacher"),Fe=t=>t==="both"?["MS","ES"]:[t.toUpperCase()],Oe=t=>t==="both"?"ES, MS":t.toUpperCase(),me=(t,a)=>{const o=(t||"").toUpperCase();if(o==="ES, MS")return"both";if(o==="ES")return"es";if(o==="MS")return"ms";const _=(a||[]).includes("MS");return(a||[]).includes("ES")&&!_?"es":"ms"},D={EDUTEACHER:"General ED teacher",STUDENT:"Student"},qe=[{value:!0,label:"Active"},{value:!1,label:"Inactive"}],ue=["K","G","1","2","3","4","5","6","7","8","9","10","11","12",...oe.isMalvernCollege?["12/13"]:[],"13",...oe.isSaisSchool?["PCS"]:[]],je=["K","G","1","2","3","4","5",...oe.isMalvernCollege?["6"]:[]],ye=[...oe.isMalvernCollege?[]:["6"],"7","8","9","10","11","12","12/13","13","PCS"],ge=["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,a)=>{const o=me(a.parent.preferredAppType,a.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,a)=>{const o=me(a.parent.preferredAppType,a.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,a)=>{const o=a.parent.msRoles||[],_=a.parent.esRoles||[];return o.includes("Student")||_.includes("Student")?!!t:!0})}),Ve={currentPage:1,pageSize:100},He=(t,a)=>{const[o,_]=p.useState([]),[f,d]=p.useState(!1),[C,v]=p.useState(Ve),[I,T]=p.useState(),m=re.useDispatch(),F=p.useCallback(async()=>{d(!0);try{const l=(await he.getRosterUsersApi(C)).data?.items||[];_(O(l))}catch{m(c.setAlert({type:"error",message:"Cannot get roster users"}))}d(!1)},[JSON.stringify(C)]),Y=p.useCallback(async()=>{if(!a)return;const N=o.find(l=>l.value===a);if(N){T(N);return}d(!0);try{const E=(await he.getRosterUserBySourcedIdApi(a)).data;T({label:$(E),value:E.sourcedId})}catch(l){console.log("err:",l)}d(!1)},[a]),O=N=>N.map(l=>({label:$(l),value:l.sourcedId})),$=N=>{const l=[],{givenName:E,middleName:q,familyName:R,email:M,role:U}=N,u=[];return E&&u.push(E),q&&u.push(q),R&&u.push(R),u.length&&l.push(u.join(" ")),M&&l.push(M),`${l.join(" - ")}${U?` (${U})`:""}`},h=N=>{v(l=>({...l,searchString:N}))},w=p.useCallback(N=>{v({...C,...N})},[JSON.stringify(C)]);return p.useEffect(()=>{C.roles?.length&&F()},[JSON.stringify(C)]),p.useEffect(()=>{w({roles:t})},[JSON.stringify(t)]),p.useEffect(()=>{Y()},[a]),{users:o,isLoading:f,user:I,handleInputChange:h}},ze=({value:t,roles:a,onChange:o})=>{const{users:_,isLoading:f,user:d,handleInputChange:C}=He(a,t);return e.jsx(j.Select,{label:"Select user",value:d?.value||"",onChange:v=>{o(v.target.value)},onOpen:()=>C(""),disabled:f,className:`${Ee.styles["profile-value"]}`,variant:"outlined",children:f?e.jsx(j.MenuItem,{disabled:!0,children:e.jsx(j.CircularProgress,{size:20})}):_.length>0?_.map(v=>e.jsx(j.MenuItem,{value:v.value,children:`${v.label}`},v.value)):e.jsx(j.MenuItem,{disabled:!0,children:"No users found"})})},Ge=({userDetail:t,confirmData:a,goBack:o,teacherOptions:_,getDataTeachers:f,id:d,checkHasTeacher:C,setCheckHasTeacher:v,userHasData:I,currentRoles:T})=>{const{t:m}=c.useTranslation(),F=p.useRef(null),O=re.useSelector($=>$.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(ve.Formik,{initialValues:t,enableReinitialize:!0,onSubmit:$=>{a($)},validationSchema:Be,children:$=>{const{values:h,setFieldValue:w,handleSubmit:N,errors:l,touched:E}=$,q=Object.keys(l);q.length&&document.querySelector(`input[name=${q[0]}]`)?.scrollIntoView({behavior:"smooth",block:"center"});const R=h?.appTypes||[],M=R.includes("MS"),U=R.includes("ES"),u=h?.msRoles||[],J=h?.esRoles||[],L=u.includes(D.STUDENT)||J.includes(D.STUDENT),H=O?me(h?.preferredAppType,R):"ms",Z=H==="ms"||H==="both",Q=H==="es"||H==="both",te=L?H==="ms"?"MS":H==="es"?"ES":null:null,ee=te==="MS"?ue.filter(n=>ye.includes(n)):te==="ES"?ue.filter(n=>je.includes(n)):ue,ie=(n,S)=>{if(!S)return;const B=Fe(S),V=Oe(S);d?w("preferredAppType",V):(w("appTypes",B),w("preferredAppType",V),L&&f(S==="both"?"MS":S.toUpperCase()))},le=n=>S=>{const B=S.target.value,V=n==="MS"?"msRoles":"esRoles",W=n==="MS"?"esRoles":"msRoles",x=F.current,A=I?.[n]??{};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 K=h?.[V]||[],s=B.some(y=>ge.includes(y))?x&&!K.includes(x)?[x]:[B.find(y=>ge.includes(y))].filter(Boolean):B,i=K.includes(D.STUDENT),g=s.includes(D.STUDENT);w(V,s),F.current=null,g?(w("preferredAppType",n),w(W,[D.STUDENT]),d||(w("appTypes",[n]),f(n))):i&&!g&&w(W,[])},ae=n=>{const S=n==="MS"?"msRoles":"esRoles",B=n==="MS"?u:J,V=n==="MS"?$e:Le,W=T?.[n]||[];return e.jsxs("div",{className:`${r["edit-profile-container__form--field"]} ${Z&&Q?r["edit-profile-container__form--width-50"]:""}`,children:[e.jsxs("p",{children:[O&&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:n}),O?n==="MS"?"Middle school roles":"Elementary school roles":"Roles"," ",e.jsx("sup",{children:"*"})]}),e.jsx(j.Select,{variant:"outlined",multiple:!0,name:S,value:B,renderValue:x=>x.map(A=>A==="SecondaryTeacher"?"Support Teacher":A).join(", "),onChange:le(n),className:`${r["profile-value"]}`,children:V.map(x=>{const A=T?.MS?.includes(D.STUDENT)||T?.ES?.includes(D.STUDENT);return e.jsxs(j.MenuItem,{value:x,disabled:d?W.some(K=>["Student","Parent","General ED teacher"].includes(K))||["Parent"].includes(x)||!A&&x===D.STUDENT:["Parent"].includes(x)||L&&x!==D.STUDENT,onClick:()=>{F.current=x},children:[e.jsx(j.Checkbox,{checked:B.includes(x)}),e.jsx(j.ListItemText,{primary:x==="SecondaryTeacher"?"Support Teacher":x})]},x)})}),l[S]&&E[S]?e.jsx("div",{className:`${r["input-error"]}`,children:l[S]}):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:h?.firstName||"",onChange:n=>w("firstName",n.target.value)}),l.firstName&&E.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:h?.lastName||"",onChange:n=>w("lastName",n.target.value)}),l.lastName&&E.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(fe.LocalizationProvider,{dateAdapter:ke.AdapterMoment,children:e.jsx(fe.DatePicker,{format:"Do MMM YYYY",value:h?.dateOfBirth&&!we.DATE_MIN_VALUE.includes(h?.dateOfBirth)?Ce(h?.dateOfBirth):null,onChange:n=>{if(n){const S=n.format("YYYY-MM-DD");w("dateOfBirth",S)}else w("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:h?.email||"",onChange:n=>w("email",n.target.value)}),l.email&&E.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:[O&&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:H,onChange:ie,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&&!M&&L,children:"Middle school"}),e.jsx(j.ToggleButton,{value:"es",disabled:!!d&&!U&&L,children:"Elementary"}),!L&&e.jsx(j.ToggleButton,{value:"both",disabled:!1,children:"Both"})]})]}),l.appTypes&&E.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:[Q&&ae("ES"),Z&&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(n=>e.jsxs("div",{className:`${r.gender__item}`,children:[e.jsx(j.Radio,{color:"primary",value:n.value,checked:h?.isActive===n.value,onChange:()=>w("isActive",n.value),disabled:!!d&&!!h?.isImportedFromIntegration}),n.label]},n.label))})]})}),L&&!d&&!!_&&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:h?.teacherUserId||[],renderValue:n=>_.filter(S=>n.includes(S.value)).map(S=>S.label).join(", "),onChange:n=>{const S=n.target.value;w("teacherUserId",S),v(!!S.length)},className:`${r["profile-value"]}`,children:_?.map(n=>e.jsx(j.MenuItem,{value:n.value,children:n.label},n.value))}),!C&&e.jsx("div",{className:`${r["input-error"]}`,children:"Teacher is required"})]})}),L&&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:h?.gradeLevel??"",renderValue:n=>n,onChange:n=>w("gradeLevel",n.target.value),className:`${r["profile-value"]}`,children:[h?.gradeLevel&&!ee.includes(h.gradeLevel)&&e.jsx(j.MenuItem,{value:h.gradeLevel,sx:{display:"none"},children:h.gradeLevel},"__current__"),ee.map(n=>e.jsx(j.MenuItem,{value:n,children:n},n))]}),l.gradeLevel&&E.gradeLevel?e.jsx("div",{className:`${r["input-error"]}`,children:l.gradeLevel}):null]})}),!L&&(!!u.length||!!J.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,...J],value:h.sourcedId,onChange:n=>w("sourcedId",n)})]})}),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:()=>N(),children:[e.jsx(Se.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:a})=>{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(ve.Formik,{initialValues:{oldPassword:"",newPassword:"",confirmedNewPassword:"",showOldPassword:!1,showNewPassword:!1,showConfirmNewPassword:!1},enableReinitialize:!0,onSubmit:_=>{t(_)},validateOnChange:!1,validateOnBlur:!1,validationSchema:Ye,children:_=>{const{values:f,setFieldValue:d,handleSubmit:C,errors:v,touched:I}=_,T=Object.keys(v);return T.length&&document.querySelector(`input[name=${T[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(de.IconButton,{"aria-label":"toggle password visibility",onClick:()=>d("showOldPassword",!f.showOldPassword),onMouseDown:m=>m.preventDefault(),children:f.showOldPassword?e.jsx(ce.Visibility,{color:"primary"}):e.jsx(b.VisibilityOff,{color:"primary"})})})})}),v.oldPassword&&I.oldPassword&&e.jsx("div",{className:`${k["input-error"]}`,children:v.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(de.IconButton,{"aria-label":"toggle password visibility",onClick:()=>d("showNewPassword",!f.showNewPassword),onMouseDown:m=>m.preventDefault(),children:f.showNewPassword?e.jsx(ce.Visibility,{color:"primary"}):e.jsx(b.VisibilityOff,{color:"primary"})})})})}),v.newPassword&&I.newPassword&&e.jsx("div",{className:`${k["input-error"]}`,children:v.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(de.IconButton,{"aria-label":"toggle password visibility",onClick:()=>d("showConfirmNewPassword",!f.showConfirmNewPassword),onMouseDown:m=>m.preventDefault(),children:f.showConfirmNewPassword?e.jsx(ce.Visibility,{color:"primary"}):e.jsx(b.VisibilityOff,{color:"primary"})})})})}),v.confirmedNewPassword&&I.confirmedNewPassword&&e.jsx("div",{className:`${k["input-error"]}`,children:v.confirmedNewPassword})]}),e.jsxs("div",{className:k["change-password-container__form--btn-group"],children:[e.jsx("button",{type:"button",className:k["btn-cancel"],onClick:()=>{a()},children:o("cancel")}),e.jsxs("button",{type:"button",className:k["btn-save"],onClick:()=>C(),children:[e.jsx(Se.DoneCheckInIcon,{color:"#fff"}),o("save_new_password")]})]})]})}})]})},We={id:"",firstName:"",lastName:"",email:"",dateOfBirth:we.DATE_MIN_VALUE,msRoles:[],esRoles:[],isActive:!0,profileImageFileName:"",teacherUserId:[],gradeLevel:"",currentGradeLevel:"",isImportedFromIntegration:!1,appTypes:["MS"],preferredAppType:"MS"},_e="/admin/users/user-list",Ke="User detail",Xe=12,Ze=20,Qe=t=>{const a=re.useDispatch(),o=xe.useNavigate(),_=re.useSelector(s=>s.common.user),f=re.useSelector(s=>s.common?.defaultFontSize),[d,C]=p.useState(We),[v,I]=p.useState(null),[T,m]=p.useState(!1),[F,Y]=p.useState({MS:[],ES:[]}),[O,$]=p.useState([]),[h,w]=p.useState(!1),[N,l]=p.useState(G.Info),[E,q]=p.useState(!0),[R,M]=p.useState({}),U=async()=>{localStorage.setItem(window.location.href,"true"),m(!0)},u=()=>{w(!h)},J=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&&H(),!t&&n()},[t]);const L=(s=[])=>s.includes("EduTeacher")?[...s.filter(i=>i!=="EduTeacher"),D.EDUTEACHER]:s,H=p.useCallback(async()=>{a(c.setLoading(!0));try{const s=await b.getByIdUser(t),i=(s.data.appTypeRaw||s.data.appType||"MS").toUpperCase(),g=i.includes("MS"),y=i.includes("ES"),z=g&&y?["MS","ES"]:y?["ES"]:["MS"],X=s.data.preferredAppType||i;C({...s.data,dateOfBirth:Pe.format(new Date(s.data.dateOfBirth),c.DATE_FORMAT),msRoles:L(s.data.msRoles),esRoles:L(s.data.esRoles),currentGradeLevel:s.data.gradeLevel,appTypes:z,preferredAppType:X}),Y({MS:s.data.msRoles??[],ES:s.data.esRoles??[]}),document.title=s.data?.fullName,g&&Z("MS"),y&&Z("ES")}catch(s){a(c.setAlert({type:"danger",message:s.response?.data?.title||s.message}))}a(c.setLoading(!1))},[t]),Z=p.useCallback(async s=>{a(c.setLoading(!0));try{const i=await b.userRoleHasDataApi(t,s);M(g=>({...g,[s]:i.data}))}catch(i){a(c.setAlert({type:"danger",message:i.response?.data?.title||i.message}))}a(c.setLoading(!1))},[t]),Q=p.useCallback(s=>{o(s&&typeof s=="string"?_e+`?query=${s}`:_e)},[]),te=s=>["Student","Parent","EduTeacher"].includes(s),ee=(s=[])=>s.includes(D.EDUTEACHER)?[...s.filter(i=>i!==D.EDUTEACHER),"EduTeacher"]:s,ie=p.useCallback(async s=>{const i=s.msRoles?.includes(D.STUDENT)||s.esRoles?.includes(D.STUDENT);if(i&&!t&&!s.teacherUserId){q(!1);return}if(i&&s.gradeLevel){const g=s.msRoles?.includes(D.STUDENT),y=s.esRoles?.includes(D.STUDENT),z=s.preferredAppType,X=g&&!y?"MS":y&&!g?"ES":z==="MS"||z==="ES"?z:null,se=X==="MS"?ye:X==="ES"?je:null;if(se&&!se.includes(s.gradeLevel)){a(c.setAlert({type:"danger",message:`Grade "${s.gradeLevel}" is not valid for ${X} students. Please select a new grade level.`}));return}}a(c.setLoading(!0));try{_?.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=ee(s.msRoles),s.esRoles=ee(s.esRoles),t||(s.profileImageFileName=v||"");const y=await g(s);y&&b.getById(y.data.id).then(z=>{Q(z.data.fullName)}),t||alert("Password of "+y.data.email+` is "${y.data.password}"`),a(c.setAlert({type:"success",message:`${t?"Update":"Create"} user successfully`}))}catch(g){a(c.setAlert({type:"danger",message:g.response?.data?.title||g.message}))}a(c.setLoading(!1))},[t,v]),le=async s=>{a(c.setLoading(!0));try{await b.changePassword(s),a(c.setAlert({type:"success",message:"Change password successfully"}))}catch(i){a(c.setAlert({type:"danger",message:i.response?.data?.title||i.message}))}a(c.setLoading(!1))},ae=p.useCallback(async s=>{a(c.setLoading(!0));try{await b.forgotChangePassword(s),a(c.setAlert({type:"success",message:"Send forgot password link successfully"}))}catch(i){a(c.setAlert({type:"danger",message:i.response?.data?.title||i.message||"Error occured"}))}a(c.setLoading(!1))},[]),n=async s=>{try{const i=await b.getTeachers({sortBy:"Email"},s);i.data&&$((i.data.map?.(g=>({label:g.email,value:g.id}))||[]).sort((g,y)=>g.label.localeCompare(y.label)))}catch(i){a(c.setAlert({type:"danger",message:i.response?.data?.title||i.message}))}},S=20097152,[B,V]=p.useState(""),W=s=>{s.preventDefault();let i=new FileReader,g=s.target.files[0];if(g.size>S){a(c.setAlert({type:"danger",message:"File can't be larger than 2MB"}));return}i.onloadend=async()=>{if(V(i.result),g){const y=new FormData,{name:z}=g;y.append("file",g,z);const se=(await b.systemProfileUpload(y))?.data?.key;t?await b.updateAvatarByAdminApi(d.id||"",se):I(se)}},g&&i.readAsDataURL(g)},x=async()=>{await b.updateAvatarByAdminApi(d.id||"",""),V("")},A=B||c.getFileUrl(d?.profileImageFileName),K=d?.profileImageFileName||"";return{userDetail:d,getDataTeachers:n,backToList:Q,confirmData:ie,file:v,setFile:I,edited:T,currentRoles:F,setEdited:m,setEditedTrue:U,confirmChangePassword:le,forgotPasswordRequest:ae,handleDisableRoles:te,classFontSize:J,teacherOptions:O,handleToggleModel:u,openModel:h,user:_,activeTab:N,setActiveTab:l,imageSrc:A,imageUse:K,handleImageChange:W,handleDeleteAvatar:x,getFile:()=>{var s=window.location.origin+"/api/ExportDataUser/"+t;window.open(s)},checkHasTeacher:E,setCheckHasTeacher:q,userHasData:R}},es="/images/image-default.png",ss=()=>{const{id:t}=xe.useParams(),{userDetail:a,getDataTeachers:o,backToList:_,confirmData:f,confirmChangePassword:d,forgotPasswordRequest:C,teacherOptions:v,user:I,activeTab:T,setActiveTab:m,imageSrc:F,handleImageChange:Y,handleDeleteAvatar:O,getFile:$,currentRoles:h,handleDisableRoles:w,checkHasTeacher:N,setCheckHasTeacher:l,userHasData:E}=Qe(t),q=[{value:G.Info,component:e.jsx(Ge,{id:t,goBack:_,userDetail:a,confirmData:f,teacherOptions:v,getDataTeachers:o,currentRoles:h,handleDisableRoles:w,checkHasTeacher:N,setCheckHasTeacher:l,userHasData:E})},{value:G.ChangePassword,component:e.jsx(Je,{confirmChangePassword:d,goBack:_})}],R=ne.find(u=>u.value===G.ForgotPassword),M=ne.find(u=>u.value===G.DownloadUserData),U=ne.find(u=>u.value===G.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(pe.Input,{className:"d-none",type:"file",id:"uploadFile",onChange:Y,accept:"image/*"}),e.jsx("img",{src:F||c.getStaticFileUrl(es),alt:"avatar",className:`${r["image-user-container__image"]}`}),e.jsx(pe.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:()=>O(),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:`${a?.firstName||""} ${a?.lastName||""}`}),e.jsx("div",{className:r.role,children:Array.from(new Set([...a?.msRoles||[],...a?.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} ${T===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&&I?.id===t&&e.jsxs("button",{type:"button",className:`${r.item} ${T===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} ${T===R.value?r["item-active"]:""}`,onClick:()=>C({email:a?.email||""}),children:[e.jsx("img",{src:c.getStaticFileUrl(R.icon),alt:R.icon}),R.label]},R.value),t&&M&&e.jsxs("button",{type:"button",className:`${r.item} ${T===M.value?r["item-active"]:""}`,onClick:()=>$(),children:[e.jsx("img",{src:c.getStaticFileUrl(M.icon),alt:M.icon}),M.label]},M.value)]})]}),e.jsx("div",{className:r["user-profile-container-admin__right"],children:q.find(u=>u.value===T)?.component})]})};exports.default=ss;
@@ -0,0 +1,1127 @@
1
+ import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
+ import { Input as Le, Label as Fe } from "reactstrap";
3
+ import { setAlert as F, useTranslation as Pe, setLoading as V, DATE_FORMAT as Oe, getFileUrl as Be, getStaticFileUrl as Y } from "mario-core";
4
+ import { i as ye, c as xe } from "./constants-DH_6jWvS.js";
5
+ import { useState as $, useCallback as z, useEffect as ne, useRef as qe, useMemo as He } from "react";
6
+ import { useDispatch as Re, useSelector as be } from "react-redux";
7
+ import { Formik as De } from "formik";
8
+ import * as P from "yup";
9
+ import { Select as ce, MenuItem as W, CircularProgress as Ve, TextField as ue, ToggleButtonGroup as Ge, ToggleButton as pe, Radio as je, Checkbox as ze, 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 Te, s as tr, k as nr } from "./OutlinedInput-BKMQB9jE.js";
13
+ import { v as ke } from "./constants-CRUp7QNf.js";
14
+ import { D as Ue } 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 J = /* @__PURE__ */ ((s) => (s.Info = "info", s.ForgotPassword = "forgotPassword", s.DownloadUserData = "downloadUserData", s.ChangePassword = "changePassword", s))(J || {});
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
+ ], $e = ["Admin", "Assistant", "Teacher", "Counselor", "General ED teacher", "SecondaryTeacher", "Parent", "Student"], vr = $e, wr = $e.filter((s) => s !== "SecondaryTeacher"), Sr = (s) => s === "both" ? ["MS", "ES"] : [s.toUpperCase()], br = (s) => s === "both" ? "ES, MS" : s.toUpperCase(), Ne = (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
+ ], Se = [
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
+ ...ye ? ["12/13"] : [],
114
+ "13",
115
+ ...xe ? ["PCS"] : []
116
+ ], Me = ["K", "G", "1", "2", "3", "4", "5", ...ye ? ["6"] : []], Ae = [...ye ? [] : ["6"], "7", "8", "9", "10", "11", "12", "12/13", "13", "PCS"], Ce = ["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 = Ne(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 = Ne(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
+ }, Cr = (s, n) => {
149
+ const [u, S] = $([]), [p, c] = $(!1), [T, _] = $(Tr), [A, y] = $(), m = Re(), O = z(async () => {
150
+ c(!0);
151
+ try {
152
+ const l = (await or(T)).data?.items || [];
153
+ S(B(l));
154
+ } catch {
155
+ m(F({
156
+ type: "error",
157
+ message: "Cannot get roster users"
158
+ }));
159
+ }
160
+ c(!1);
161
+ }, [JSON.stringify(T)]), K = z(async () => {
162
+ if (!n) return;
163
+ const N = u.find((l) => l.value === n);
164
+ if (N) {
165
+ y(N);
166
+ return;
167
+ }
168
+ c(!0);
169
+ try {
170
+ const C = (await ir(n)).data;
171
+ y({
172
+ label: I(C),
173
+ value: C.sourcedId
174
+ });
175
+ } catch (l) {
176
+ console.log("err:", l);
177
+ }
178
+ c(!1);
179
+ }, [n]), B = (N) => N.map((l) => ({
180
+ label: I(l),
181
+ value: l.sourcedId
182
+ })), I = (N) => {
183
+ const l = [], { givenName: C, middleName: x, familyName: D, email: M, role: U } = N, d = [];
184
+ return C && d.push(C), x && d.push(x), D && d.push(D), d.length && l.push(d.join(" ")), M && l.push(M), `${l.join(" - ")}${U ? ` (${U})` : ""}`;
185
+ }, f = (N) => {
186
+ _((l) => ({ ...l, searchString: N }));
187
+ }, g = z((N) => {
188
+ _({
189
+ ...T,
190
+ ...N
191
+ });
192
+ }, [JSON.stringify(T)]);
193
+ return ne(() => {
194
+ T.roles?.length && O();
195
+ }, [JSON.stringify(T)]), ne(() => {
196
+ g({
197
+ roles: s
198
+ });
199
+ }, [JSON.stringify(s)]), ne(() => {
200
+ K();
201
+ }, [n]), {
202
+ users: u,
203
+ isLoading: p,
204
+ user: A,
205
+ handleInputChange: f
206
+ };
207
+ }, Er = ({ value: s, roles: n, onChange: u }) => {
208
+ const {
209
+ users: S,
210
+ isLoading: p,
211
+ user: c,
212
+ handleInputChange: T
213
+ } = Cr(n, s);
214
+ return /* @__PURE__ */ e(
215
+ ce,
216
+ {
217
+ label: "Select user",
218
+ value: c?.value || "",
219
+ onChange: (_) => {
220
+ u(_.target.value);
221
+ },
222
+ onOpen: () => T(""),
223
+ disabled: p,
224
+ className: `${lr["profile-value"]}`,
225
+ variant: "outlined",
226
+ children: p ? /* @__PURE__ */ e(W, { disabled: !0, children: /* @__PURE__ */ e(Ve, { size: 20 }) }) : S.length > 0 ? S.map((_) => /* @__PURE__ */ e(W, { value: _.value, children: `${_.label}` }, _.value)) : /* @__PURE__ */ e(W, { 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: T,
237
+ setCheckHasTeacher: _,
238
+ userHasData: A,
239
+ currentRoles: y
240
+ }) => {
241
+ const { t: m } = Pe(), O = qe(null), B = be((I) => I.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
+ De,
246
+ {
247
+ initialValues: s,
248
+ enableReinitialize: !0,
249
+ onSubmit: (I) => {
250
+ n(I);
251
+ },
252
+ validationSchema: yr,
253
+ children: (I) => {
254
+ const { values: f, setFieldValue: g, handleSubmit: N, errors: l, touched: C } = I, x = Object.keys(l);
255
+ x.length && document.querySelector(`input[name=${x[0]}]`)?.scrollIntoView({
256
+ behavior: "smooth",
257
+ block: "center"
258
+ });
259
+ const D = f?.appTypes || [], M = D.includes("MS"), U = D.includes("ES"), d = f?.msRoles || [], X = f?.esRoles || [], L = d.includes(R.STUDENT) || X.includes(R.STUDENT), G = B ? Ne(f?.preferredAppType, D) : "ms", re = G === "ms" || G === "both", ae = G === "es" || G === "both", oe = L ? G === "ms" ? "MS" : G === "es" ? "ES" : null : null, se = oe === "MS" ? Se.filter((t) => Ae.includes(t)) : oe === "ES" ? Se.filter((t) => Me.includes(t)) : Se, de = (t, v) => {
260
+ if (!v) return;
261
+ const q = Sr(v), H = br(v);
262
+ c ? g("preferredAppType", H) : (g("appTypes", q), g("preferredAppType", H), L && p(v === "both" ? "MS" : v.toUpperCase()));
263
+ }, me = (t) => (v) => {
264
+ const q = v.target.value, H = t === "MS" ? "msRoles" : "esRoles", Z = t === "MS" ? "esRoles" : "msRoles", w = O.current, k = A?.[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 Q = f?.[H] || [], r = q.some((b) => Ce.includes(b)) ? w && !Q.includes(w) ? [w] : [q.find((b) => Ce.includes(b))].filter(Boolean) : q, i = Q.includes(R.STUDENT), h = r.includes(R.STUDENT);
270
+ g(H, r), O.current = null, h ? (g("preferredAppType", t), g(Z, [R.STUDENT]), c || (g("appTypes", [t]), p(t))) : i && !h && g(Z, []);
271
+ }, ie = (t) => {
272
+ const v = t === "MS" ? "msRoles" : "esRoles", q = t === "MS" ? d : X, H = t === "MS" ? vr : wr, Z = y?.[t] || [];
273
+ return /* @__PURE__ */ o("div", { className: `${a["edit-profile-container__form--field"]} ${re && ae ? a["edit-profile-container__form--width-50"] : ""}`, children: [
274
+ /* @__PURE__ */ o("p", { children: [
275
+ B && /* @__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
+ B ? 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: v,
296
+ value: q,
297
+ renderValue: (w) => w.map((k) => k === "SecondaryTeacher" ? "Support Teacher" : k).join(", "),
298
+ onChange: me(t),
299
+ className: `${a["profile-value"]}`,
300
+ children: H.map((w) => {
301
+ const k = y?.MS?.includes(R.STUDENT) || y?.ES?.includes(R.STUDENT);
302
+ return /* @__PURE__ */ o(
303
+ W,
304
+ {
305
+ value: w,
306
+ disabled: c ? Z.some((Q) => ["Student", "Parent", "General ED teacher"].includes(Q)) || ["Parent"].includes(w) || !k && w === R.STUDENT : ["Parent"].includes(w) || L && w !== R.STUDENT,
307
+ onClick: () => {
308
+ O.current = w;
309
+ },
310
+ children: [
311
+ /* @__PURE__ */ e(ze, { checked: q.includes(w) }),
312
+ /* @__PURE__ */ e(Ye, { primary: w === "SecondaryTeacher" ? "Support Teacher" : w })
313
+ ]
314
+ },
315
+ w
316
+ );
317
+ })
318
+ }
319
+ ),
320
+ l[v] && C[v] ? /* @__PURE__ */ e("div", { className: `${a["input-error"]}`, children: l[v] }) : 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: f?.firstName || "",
337
+ onChange: (t) => g("firstName", t.target.value)
338
+ }
339
+ ),
340
+ l.firstName && C.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: f?.lastName || "",
355
+ onChange: (t) => g("lastName", t.target.value)
356
+ }
357
+ ),
358
+ l.lastName && C.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: f?.dateOfBirth && !ke.includes(f?.dateOfBirth) ? Ke(f?.dateOfBirth) : null,
372
+ onChange: (t) => {
373
+ if (t) {
374
+ const v = t.format("YYYY-MM-DD");
375
+ g("dateOfBirth", v);
376
+ } else
377
+ g("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: f?.email || "",
405
+ onChange: (t) => g("email", t.target.value)
406
+ }
407
+ ),
408
+ l.email && C.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
+ B && /* @__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
+ Ge,
423
+ {
424
+ exclusive: !0,
425
+ value: G,
426
+ onChange: de,
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 && !M && L, children: "Middle school" }),
453
+ /* @__PURE__ */ e(pe, { value: "es", disabled: !!c && !U && L, children: "Elementary" }),
454
+ !L && /* @__PURE__ */ e(pe, { value: "both", disabled: !1, children: "Both" })
455
+ ]
456
+ }
457
+ )
458
+ ] }),
459
+ l.appTypes && C.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
+ ae && ie("ES"),
463
+ re && 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
+ je,
471
+ {
472
+ color: "primary",
473
+ value: t.value,
474
+ checked: f?.isActive === t.value,
475
+ onChange: () => g("isActive", t.value),
476
+ disabled: !!c && !!f?.isImportedFromIntegration
477
+ }
478
+ ),
479
+ t.label
480
+ ] }, t.label)) })
481
+ ] }) }),
482
+ L && !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: f?.teacherUserId || [],
494
+ renderValue: (t) => S.filter((v) => t.includes(v.value)).map((v) => v.label).join(", "),
495
+ onChange: (t) => {
496
+ const v = t.target.value;
497
+ g("teacherUserId", v), _(!!v.length);
498
+ },
499
+ className: `${a["profile-value"]}`,
500
+ children: S?.map((t) => /* @__PURE__ */ e(W, { value: t.value, children: t.label }, t.value))
501
+ }
502
+ ),
503
+ !T && /* @__PURE__ */ e("div", { className: `${a["input-error"]}`, children: "Teacher is required" })
504
+ ] }) }),
505
+ L && /* @__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: f?.gradeLevel ?? "",
517
+ renderValue: (t) => t,
518
+ onChange: (t) => g("gradeLevel", t.target.value),
519
+ className: `${a["profile-value"]}`,
520
+ children: [
521
+ f?.gradeLevel && !se.includes(f.gradeLevel) && /* @__PURE__ */ e(W, { value: f.gradeLevel, sx: { display: "none" }, children: f.gradeLevel }, "__current__"),
522
+ se.map((t) => /* @__PURE__ */ e(W, { value: t, children: t }, t))
523
+ ]
524
+ }
525
+ ),
526
+ l.gradeLevel && C.gradeLevel ? /* @__PURE__ */ e("div", { className: `${a["input-error"]}`, children: l.gradeLevel }) : null
527
+ ] }) }),
528
+ !L && (!!d.length || !!X.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: [
529
+ /* @__PURE__ */ e("p", { children: m("Map from Roster") }),
530
+ /* @__PURE__ */ e(
531
+ Er,
532
+ {
533
+ roles: [...d, ...X],
534
+ value: f.sourcedId,
535
+ onChange: (t) => g("sourcedId", t)
536
+ }
537
+ )
538
+ ] }) }),
539
+ /* @__PURE__ */ o("div", { className: a["edit-profile-container__form--btn-group"], children: [
540
+ /* @__PURE__ */ e(
541
+ "button",
542
+ {
543
+ type: "button",
544
+ className: a["btn-cancel"],
545
+ onClick: () => u(),
546
+ children: m("cancel")
547
+ }
548
+ ),
549
+ /* @__PURE__ */ o(
550
+ "button",
551
+ {
552
+ type: "button",
553
+ className: a["btn-save"],
554
+ onClick: () => N(),
555
+ children: [
556
+ /* @__PURE__ */ e(Ue, { color: "#fff" }),
557
+ m("save_changes")
558
+ ]
559
+ }
560
+ )
561
+ ] })
562
+ ] });
563
+ }
564
+ }
565
+ )
566
+ ] });
567
+ }, E = {
568
+ "input-error": "_input-error_gmvmh_1",
569
+ "change-password-container": "_change-password-container_gmvmh_6",
570
+ "change-password-container__title": "_change-password-container__title_gmvmh_11",
571
+ "change-password-container__form": "_change-password-container__form_gmvmh_19",
572
+ "change-password-container__form--field": "_change-password-container__form--field_gmvmh_24",
573
+ "change-password-container__form--description": "_change-password-container__form--description_gmvmh_38",
574
+ "change-password-container__form--btn-group": "_change-password-container__form--btn-group_gmvmh_54",
575
+ "btn-save": "_btn-save_gmvmh_60",
576
+ "btn-cancel": "_btn-cancel_gmvmh_82"
577
+ }, Rr = P.object({
578
+ oldPassword: P.string().required("Old password is required"),
579
+ newPassword: P.string().required("New password is required"),
580
+ confirmedNewPassword: P.string().oneOf([P.ref("newPassword"), void 0], "New password must match").required("Confirm your new password")
581
+ }), Dr = ({ confirmChangePassword: s, goBack: n }) => {
582
+ const { t: u } = Pe();
583
+ return /* @__PURE__ */ o("div", { className: E["change-password-container"], children: [
584
+ /* @__PURE__ */ e("div", { className: E["change-password-container__title"], children: u("change_password") }),
585
+ /* @__PURE__ */ e(
586
+ De,
587
+ {
588
+ initialValues: {
589
+ oldPassword: "",
590
+ newPassword: "",
591
+ confirmedNewPassword: "",
592
+ showOldPassword: !1,
593
+ showNewPassword: !1,
594
+ showConfirmNewPassword: !1
595
+ },
596
+ enableReinitialize: !0,
597
+ onSubmit: (S) => {
598
+ s(S);
599
+ },
600
+ validateOnChange: !1,
601
+ validateOnBlur: !1,
602
+ validationSchema: Rr,
603
+ children: (S) => {
604
+ const { values: p, setFieldValue: c, handleSubmit: T, errors: _, touched: A } = S, y = Object.keys(_);
605
+ return y.length && document.querySelector(
606
+ `input[name=${y[0]}]`
607
+ )?.scrollIntoView({
608
+ behavior: "smooth",
609
+ block: "center"
610
+ }), /* @__PURE__ */ o("div", { className: E["change-password-container__form"], children: [
611
+ /* @__PURE__ */ o("div", { className: `${E["change-password-container__form--field"]}`, children: [
612
+ /* @__PURE__ */ e("p", { children: u("old_password") }),
613
+ /* @__PURE__ */ e(
614
+ fe,
615
+ {
616
+ variant: "outlined",
617
+ className: `${E["input-field"]}`,
618
+ children: /* @__PURE__ */ e(
619
+ he,
620
+ {
621
+ type: p.showOldPassword ? "text" : "password",
622
+ value: p?.oldPassword,
623
+ onChange: (m) => c(
624
+ "oldPassword",
625
+ m.target.value.trim()
626
+ ),
627
+ endAdornment: /* @__PURE__ */ e(_e, { position: "end", children: /* @__PURE__ */ e(
628
+ we,
629
+ {
630
+ "aria-label": "toggle password visibility",
631
+ onClick: () => c(
632
+ "showOldPassword",
633
+ !p.showOldPassword
634
+ ),
635
+ onMouseDown: (m) => m.preventDefault(),
636
+ children: p.showOldPassword ? /* @__PURE__ */ e(ve, { color: "primary" }) : /* @__PURE__ */ e(ge, { color: "primary" })
637
+ }
638
+ ) })
639
+ }
640
+ )
641
+ }
642
+ ),
643
+ _.oldPassword && A.oldPassword && /* @__PURE__ */ e("div", { className: `${E["input-error"]}`, children: _.oldPassword })
644
+ ] }),
645
+ /* @__PURE__ */ o("div", { className: `${E["change-password-container__form--field"]}`, children: [
646
+ /* @__PURE__ */ e("p", { children: u("new_password") }),
647
+ /* @__PURE__ */ e(
648
+ fe,
649
+ {
650
+ variant: "outlined",
651
+ className: `${E["input-field"]}`,
652
+ children: /* @__PURE__ */ e(
653
+ he,
654
+ {
655
+ type: p.showNewPassword ? "text" : "password",
656
+ value: p?.newPassword,
657
+ onChange: (m) => c(
658
+ "newPassword",
659
+ m.target.value.trim()
660
+ ),
661
+ endAdornment: /* @__PURE__ */ e(_e, { position: "end", children: /* @__PURE__ */ e(
662
+ we,
663
+ {
664
+ "aria-label": "toggle password visibility",
665
+ onClick: () => c(
666
+ "showNewPassword",
667
+ !p.showNewPassword
668
+ ),
669
+ onMouseDown: (m) => m.preventDefault(),
670
+ children: p.showNewPassword ? /* @__PURE__ */ e(ve, { color: "primary" }) : /* @__PURE__ */ e(ge, { color: "primary" })
671
+ }
672
+ ) })
673
+ }
674
+ )
675
+ }
676
+ ),
677
+ _.newPassword && A.newPassword && /* @__PURE__ */ e("div", { className: `${E["input-error"]}`, children: _.newPassword }),
678
+ /* @__PURE__ */ o("div", { className: `${E["change-password-container__form--description"]}`, children: [
679
+ "Password must contain at least: 1 uppercase letter, 1 lowercase letter,",
680
+ /* @__PURE__ */ e("br", {}),
681
+ " 1 number, and 1 special character"
682
+ ] })
683
+ ] }),
684
+ /* @__PURE__ */ o("div", { className: `${E["change-password-container__form--field"]}`, children: [
685
+ /* @__PURE__ */ e("p", { children: u("confirm_new_password") }),
686
+ /* @__PURE__ */ e(
687
+ fe,
688
+ {
689
+ variant: "outlined",
690
+ className: `${E["input-field"]}`,
691
+ children: /* @__PURE__ */ e(
692
+ he,
693
+ {
694
+ type: p.showConfirmNewPassword ? "text" : "password",
695
+ value: p?.confirmedNewPassword,
696
+ onChange: (m) => c(
697
+ "confirmedNewPassword",
698
+ m.target.value.trim()
699
+ ),
700
+ endAdornment: /* @__PURE__ */ e(_e, { position: "end", children: /* @__PURE__ */ e(
701
+ we,
702
+ {
703
+ "aria-label": "toggle password visibility",
704
+ onClick: () => c(
705
+ "showConfirmNewPassword",
706
+ !p.showConfirmNewPassword
707
+ ),
708
+ onMouseDown: (m) => m.preventDefault(),
709
+ children: p.showConfirmNewPassword ? /* @__PURE__ */ e(ve, { color: "primary" }) : /* @__PURE__ */ e(ge, { color: "primary" })
710
+ }
711
+ ) })
712
+ }
713
+ )
714
+ }
715
+ ),
716
+ _.confirmedNewPassword && A.confirmedNewPassword && /* @__PURE__ */ e("div", { className: `${E["input-error"]}`, children: _.confirmedNewPassword })
717
+ ] }),
718
+ /* @__PURE__ */ o("div", { className: E["change-password-container__form--btn-group"], children: [
719
+ /* @__PURE__ */ e(
720
+ "button",
721
+ {
722
+ type: "button",
723
+ className: E["btn-cancel"],
724
+ onClick: () => {
725
+ n();
726
+ },
727
+ children: u("cancel")
728
+ }
729
+ ),
730
+ /* @__PURE__ */ o(
731
+ "button",
732
+ {
733
+ type: "button",
734
+ className: E["btn-save"],
735
+ onClick: () => T(),
736
+ children: [
737
+ /* @__PURE__ */ e(Ue, { color: "#fff" }),
738
+ u("save_new_password")
739
+ ]
740
+ }
741
+ )
742
+ ] })
743
+ ] });
744
+ }
745
+ }
746
+ )
747
+ ] });
748
+ }, kr = {
749
+ id: "",
750
+ firstName: "",
751
+ lastName: "",
752
+ email: "",
753
+ dateOfBirth: ke,
754
+ msRoles: [],
755
+ esRoles: [],
756
+ isActive: !0,
757
+ profileImageFileName: "",
758
+ teacherUserId: [],
759
+ gradeLevel: "",
760
+ currentGradeLevel: "",
761
+ isImportedFromIntegration: !1,
762
+ // Man tao moi mac dinh MS; man edit se duoc getData ghi de bang appType tu API
763
+ appTypes: ["MS"],
764
+ preferredAppType: "MS"
765
+ }, Ee = "/admin/users/user-list", Ur = "User detail", $r = 12, Mr = 20, Ar = (s) => {
766
+ const n = Re(), u = dr(), S = be((r) => r.common.user), p = be((r) => r.common?.defaultFontSize), [c, T] = $(kr), [_, A] = $(null), [y, m] = $(!1), [O, K] = $({ MS: [], ES: [] }), [B, I] = $([]), [f, g] = $(!1), [N, l] = $(J.Info), [C, x] = $(!0), [D, M] = $({}), U = async () => {
767
+ localStorage.setItem(window.location.href, "true"), m(!0);
768
+ }, d = () => {
769
+ g(!f);
770
+ }, X = He(() => p == Mr ? "font-large" : p == $r ? "font-small" : "", [p]);
771
+ ne(() => {
772
+ document.title = Ur, m(!1), localStorage.getItem(window.location.href) && localStorage.removeItem(window.location.href);
773
+ }, []), ne(() => {
774
+ s && G(), !s && t();
775
+ }, [s]);
776
+ const L = (r = []) => r.includes("EduTeacher") ? [...r.filter((i) => i !== "EduTeacher"), R.EDUTEACHER] : r, G = z(async () => {
777
+ n(V(!0));
778
+ try {
779
+ const r = await Xe(s), i = (r.data.appTypeRaw || r.data.appType || "MS").toUpperCase(), h = i.includes("MS"), b = i.includes("ES"), j = h && b ? ["MS", "ES"] : b ? ["ES"] : ["MS"], ee = r.data.preferredAppType || i;
780
+ T({
781
+ ...r.data,
782
+ dateOfBirth: ur(new Date(r.data.dateOfBirth), Oe),
783
+ msRoles: L(r.data.msRoles),
784
+ esRoles: L(r.data.esRoles),
785
+ currentGradeLevel: r.data.gradeLevel,
786
+ appTypes: j,
787
+ preferredAppType: ee
788
+ }), K({ MS: r.data.msRoles ?? [], ES: r.data.esRoles ?? [] }), document.title = r.data?.fullName, h && re("MS"), b && re("ES");
789
+ } catch (r) {
790
+ n(
791
+ F({
792
+ type: "danger",
793
+ message: r.response?.data?.title || r.message
794
+ })
795
+ );
796
+ }
797
+ n(V(!1));
798
+ }, [s]), re = z(async (r) => {
799
+ n(V(!0));
800
+ try {
801
+ const i = await Ze(s, r);
802
+ M((h) => ({ ...h, [r]: i.data }));
803
+ } catch (i) {
804
+ n(
805
+ F({
806
+ type: "danger",
807
+ message: i.response?.data?.title || i.message
808
+ })
809
+ );
810
+ }
811
+ n(V(!1));
812
+ }, [s]), ae = z((r) => {
813
+ u(r && typeof r == "string" ? Ee + `?query=${r}` : Ee);
814
+ }, []), oe = (r) => ["Student", "Parent", "EduTeacher"].includes(r), se = (r = []) => r.includes(R.EDUTEACHER) ? [...r.filter((i) => i !== R.EDUTEACHER), "EduTeacher"] : r, de = z(
815
+ async (r) => {
816
+ const i = r.msRoles?.includes(R.STUDENT) || r.esRoles?.includes(R.STUDENT);
817
+ if (i && !s && !r.teacherUserId) {
818
+ x(!1);
819
+ return;
820
+ }
821
+ if (i && r.gradeLevel) {
822
+ const h = r.msRoles?.includes(R.STUDENT), b = r.esRoles?.includes(R.STUDENT), j = r.preferredAppType, ee = h && !b ? "MS" : b && !h ? "ES" : j === "MS" || j === "ES" ? j : null, te = ee === "MS" ? Ae : ee === "ES" ? Me : null;
823
+ if (te && !te.includes(r.gradeLevel)) {
824
+ n(
825
+ F({
826
+ type: "danger",
827
+ message: `Grade "${r.gradeLevel}" is not valid for ${ee} students. Please select a new grade level.`
828
+ })
829
+ );
830
+ return;
831
+ }
832
+ }
833
+ n(V(!0));
834
+ try {
835
+ S?.hasEsSchool === !1 && (r.appTypes = ["MS"], r.preferredAppType = "MS", r.esRoles = []);
836
+ const h = s ? Qe : er;
837
+ !s && delete r.id, r.teacherUserId = i ? r.teacherUserId : [], r.msRoles = se(r.msRoles), r.esRoles = se(r.esRoles), s || (r.profileImageFileName = _ || "");
838
+ const b = await h(r);
839
+ b && rr(b.data.id).then((j) => {
840
+ ae(j.data.fullName);
841
+ }), s || alert("Password of " + b.data.email + ` is "${b.data.password}"`), n(
842
+ F({
843
+ type: "success",
844
+ message: `${s ? "Update" : "Create"} user successfully`
845
+ })
846
+ );
847
+ } catch (h) {
848
+ n(
849
+ F({
850
+ type: "danger",
851
+ message: h.response?.data?.title || h.message
852
+ })
853
+ );
854
+ }
855
+ n(V(!1));
856
+ },
857
+ [s, _]
858
+ ), me = async (r) => {
859
+ n(V(!0));
860
+ try {
861
+ await nr(r), n(
862
+ F({
863
+ type: "success",
864
+ message: "Change password successfully"
865
+ })
866
+ );
867
+ } catch (i) {
868
+ n(
869
+ F({
870
+ type: "danger",
871
+ message: i.response?.data?.title || i.message
872
+ })
873
+ );
874
+ }
875
+ n(V(!1));
876
+ }, ie = z(async (r) => {
877
+ n(V(!0));
878
+ try {
879
+ await ar(r), n(
880
+ F({
881
+ type: "success",
882
+ message: "Send forgot password link successfully"
883
+ })
884
+ );
885
+ } catch (i) {
886
+ n(
887
+ F({
888
+ type: "danger",
889
+ message: i.response?.data?.title || i.message || "Error occured"
890
+ })
891
+ );
892
+ }
893
+ n(V(!1));
894
+ }, []), t = async (r) => {
895
+ try {
896
+ const i = await sr({
897
+ sortBy: "Email"
898
+ }, r);
899
+ i.data && I(
900
+ (i.data.map?.((h) => ({
901
+ label: h.email,
902
+ value: h.id
903
+ })) || []).sort((h, b) => h.label.localeCompare(b.label))
904
+ );
905
+ } catch (i) {
906
+ n(
907
+ F({
908
+ type: "danger",
909
+ message: i.response?.data?.title || i.message
910
+ })
911
+ );
912
+ }
913
+ }, v = 20097152, [q, H] = $(""), Z = (r) => {
914
+ r.preventDefault();
915
+ let i = new FileReader(), h = r.target.files[0];
916
+ if (h.size > v) {
917
+ n(
918
+ F({
919
+ type: "danger",
920
+ message: "File can't be larger than 2MB"
921
+ })
922
+ );
923
+ return;
924
+ }
925
+ i.onloadend = async () => {
926
+ if (H(i.result), h) {
927
+ const b = new FormData(), { name: j } = h;
928
+ b.append("file", h, j);
929
+ const te = (await tr(b))?.data?.key;
930
+ s ? await Te(c.id || "", te) : A(te);
931
+ }
932
+ }, h && i.readAsDataURL(h);
933
+ }, w = async () => {
934
+ await Te(c.id || "", ""), H("");
935
+ }, k = q || Be(c?.profileImageFileName), Q = c?.profileImageFileName || "";
936
+ return {
937
+ userDetail: c,
938
+ getDataTeachers: t,
939
+ backToList: ae,
940
+ confirmData: de,
941
+ file: _,
942
+ setFile: A,
943
+ edited: y,
944
+ currentRoles: O,
945
+ setEdited: m,
946
+ setEditedTrue: U,
947
+ confirmChangePassword: me,
948
+ forgotPasswordRequest: ie,
949
+ handleDisableRoles: oe,
950
+ classFontSize: X,
951
+ teacherOptions: B,
952
+ handleToggleModel: d,
953
+ openModel: f,
954
+ user: S,
955
+ activeTab: N,
956
+ setActiveTab: l,
957
+ imageSrc: k,
958
+ imageUse: Q,
959
+ handleImageChange: Z,
960
+ handleDeleteAvatar: w,
961
+ getFile: () => {
962
+ var r = window.location.origin + "/api/ExportDataUser/" + s;
963
+ window.open(r);
964
+ },
965
+ checkHasTeacher: C,
966
+ setCheckHasTeacher: x,
967
+ userHasData: D
968
+ };
969
+ }, Ir = "/images/image-default.png", aa = () => {
970
+ const { id: s } = mr(), {
971
+ userDetail: n,
972
+ getDataTeachers: u,
973
+ backToList: S,
974
+ confirmData: p,
975
+ confirmChangePassword: c,
976
+ forgotPasswordRequest: T,
977
+ teacherOptions: _,
978
+ user: A,
979
+ activeTab: y,
980
+ setActiveTab: m,
981
+ imageSrc: O,
982
+ handleImageChange: K,
983
+ handleDeleteAvatar: B,
984
+ getFile: I,
985
+ currentRoles: f,
986
+ handleDisableRoles: g,
987
+ checkHasTeacher: N,
988
+ setCheckHasTeacher: l,
989
+ userHasData: C
990
+ } = Ar(s), x = [
991
+ {
992
+ value: J.Info,
993
+ component: /* @__PURE__ */ e(
994
+ Pr,
995
+ {
996
+ id: s,
997
+ goBack: S,
998
+ userDetail: n,
999
+ confirmData: p,
1000
+ teacherOptions: _,
1001
+ getDataTeachers: u,
1002
+ currentRoles: f,
1003
+ handleDisableRoles: g,
1004
+ checkHasTeacher: N,
1005
+ setCheckHasTeacher: l,
1006
+ userHasData: C
1007
+ }
1008
+ )
1009
+ },
1010
+ {
1011
+ value: J.ChangePassword,
1012
+ component: /* @__PURE__ */ e(
1013
+ Dr,
1014
+ {
1015
+ confirmChangePassword: c,
1016
+ goBack: S
1017
+ }
1018
+ )
1019
+ }
1020
+ ], D = le.find((d) => d.value === J.ForgotPassword), M = le.find((d) => d.value === J.DownloadUserData), U = le.find((d) => d.value === J.ChangePassword);
1021
+ return /* @__PURE__ */ o("div", { className: a["user-profile-container-admin"], children: [
1022
+ /* @__PURE__ */ o("div", { className: a["user-profile-container-admin__left"], children: [
1023
+ /* @__PURE__ */ o("div", { className: a["user-profile-container-admin__left--information"], children: [
1024
+ /* @__PURE__ */ o("div", { className: a["image-user-container"], children: [
1025
+ /* @__PURE__ */ e(
1026
+ Le,
1027
+ {
1028
+ className: "d-none",
1029
+ type: "file",
1030
+ id: "uploadFile",
1031
+ onChange: K,
1032
+ accept: "image/*"
1033
+ }
1034
+ ),
1035
+ /* @__PURE__ */ e(
1036
+ "img",
1037
+ {
1038
+ src: O || Y(Ir),
1039
+ alt: "avatar",
1040
+ className: `${a["image-user-container__image"]}`
1041
+ }
1042
+ ),
1043
+ /* @__PURE__ */ e(
1044
+ Fe,
1045
+ {
1046
+ htmlFor: "uploadFile",
1047
+ role: "button",
1048
+ tabIndex: 0,
1049
+ children: /* @__PURE__ */ e("div", { className: a["image-user-container__edit-btn"], children: /* @__PURE__ */ e("img", { src: Y("/images/user/Edit.svg"), alt: "edit-avatar" }) })
1050
+ }
1051
+ ),
1052
+ s && /* @__PURE__ */ e(
1053
+ "button",
1054
+ {
1055
+ type: "button",
1056
+ onClick: () => B(),
1057
+ className: a["image-user-container__delete-btn"],
1058
+ children: /* @__PURE__ */ e("img", { src: Y("/images/user/DeleteAvatar.svg"), alt: "delete-avatar" })
1059
+ }
1060
+ )
1061
+ ] }),
1062
+ /* @__PURE__ */ o("div", { className: a["name-role-container"], children: [
1063
+ /* @__PURE__ */ e("div", { className: a.name, children: `${n?.firstName || ""} ${n?.lastName || ""}` }),
1064
+ /* @__PURE__ */ e("div", { className: a.role, children: Array.from(/* @__PURE__ */ new Set([...n?.msRoles || [], ...n?.esRoles || []])).map((d) => d === "SecondaryTeacher" ? "Support Teacher" : d).join(", ") })
1065
+ ] })
1066
+ ] }),
1067
+ /* @__PURE__ */ o("div", { className: a["user-profile-container-admin__left--btn-control"], children: [
1068
+ le.filter((d) => d.isControl).map((d) => /* @__PURE__ */ o(
1069
+ "button",
1070
+ {
1071
+ type: "button",
1072
+ className: `${a.item} ${y === d.value ? a["item-active"] : ""}`,
1073
+ onClick: () => m(d.value),
1074
+ children: [
1075
+ /* @__PURE__ */ e("img", { src: Y(d.icon), alt: d.icon }),
1076
+ d.label
1077
+ ]
1078
+ },
1079
+ d.value
1080
+ )),
1081
+ !!s && !!U && A?.id === s && /* @__PURE__ */ o(
1082
+ "button",
1083
+ {
1084
+ type: "button",
1085
+ className: `${a.item} ${y === U.value ? a["item-active"] : ""}`,
1086
+ onClick: () => m(U.value),
1087
+ children: [
1088
+ /* @__PURE__ */ e("img", { src: Y(U.icon), alt: U.icon }),
1089
+ U.label
1090
+ ]
1091
+ },
1092
+ U.value
1093
+ ),
1094
+ s && D && /* @__PURE__ */ o(
1095
+ "button",
1096
+ {
1097
+ type: "button",
1098
+ className: `${a.item} ${y === D.value ? a["item-active"] : ""}`,
1099
+ onClick: () => T({ email: n?.email || "" }),
1100
+ children: [
1101
+ /* @__PURE__ */ e("img", { src: Y(D.icon), alt: D.icon }),
1102
+ D.label
1103
+ ]
1104
+ },
1105
+ D.value
1106
+ ),
1107
+ s && M && /* @__PURE__ */ o(
1108
+ "button",
1109
+ {
1110
+ type: "button",
1111
+ className: `${a.item} ${y === M.value ? a["item-active"] : ""}`,
1112
+ onClick: () => I(),
1113
+ children: [
1114
+ /* @__PURE__ */ e("img", { src: Y(M.icon), alt: M.icon }),
1115
+ M.label
1116
+ ]
1117
+ },
1118
+ M.value
1119
+ )
1120
+ ] })
1121
+ ] }),
1122
+ /* @__PURE__ */ e("div", { className: a["user-profile-container-admin__right"], children: x.find((d) => d.value === y)?.component })
1123
+ ] });
1124
+ };
1125
+ export {
1126
+ aa as default
1127
+ };
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"))),v=e.lazy(()=>Promise.resolve().then(()=>require("./LearningSupportCategoryList-BpCRx0CF.cjs"))),c=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"))),O=e.lazy(()=>Promise.resolve().then(()=>require("./SettingWeeklyQuest-CDi1sio0.cjs"))),w=e.lazy(()=>Promise.resolve().then(()=>require("./HomePage-Dj_9gia6.cjs"))),G=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-Ci7ubPZE.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-DFrRk7yz.cjs"))),ae=e.lazy(()=>Promise.resolve().then(()=>require("./index-DqjyD3wy.cjs"))),le=e.lazy(()=>Promise.resolve().then(()=>require("./DashboardWrapper-BqcF82EB.cjs"))),ue=e.lazy(()=>Promise.resolve().then(()=>require("./FlagAlertWrapper-D_OLRdEa.cjs"))),me=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=c;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=le;exports.DesignatedStaff=Y;exports.EditFlagCard=te;exports.ExternalApi=x;exports.FlagAlertWrapper=ue;exports.FrequencyAndSetup=X;exports.GoalExampleList=P;exports.HomePage=w;exports.LearningStrategyList=s;exports.LearningSupportCategoryList=v;exports.MainLayoutAdmin=G;exports.MarioAi=V;exports.MyProfile=re;exports.OneRosterContainer=L;exports.OpenFieldWellbeingQuestion=ee;exports.Overview=ae;exports.PersonalLearningPlansWrapper=me;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=O;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"))),v=e.lazy(()=>Promise.resolve().then(()=>require("./LearningSupportCategoryList-BpCRx0CF.cjs"))),c=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"))),O=e.lazy(()=>Promise.resolve().then(()=>require("./SettingWeeklyQuest-CDi1sio0.cjs"))),w=e.lazy(()=>Promise.resolve().then(()=>require("./HomePage-Dj_9gia6.cjs"))),G=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-Ci7ubPZE.cjs"))),oe=e.lazy(()=>Promise.resolve().then(()=>require("./UserProfileManagement-BN6nZmKa.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-DFrRk7yz.cjs"))),ae=e.lazy(()=>Promise.resolve().then(()=>require("./index-DqjyD3wy.cjs"))),le=e.lazy(()=>Promise.resolve().then(()=>require("./DashboardWrapper-BqcF82EB.cjs"))),ue=e.lazy(()=>Promise.resolve().then(()=>require("./FlagAlertWrapper-D_OLRdEa.cjs"))),me=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=c;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=le;exports.DesignatedStaff=Y;exports.EditFlagCard=te;exports.ExternalApi=x;exports.FlagAlertWrapper=ue;exports.FrequencyAndSetup=X;exports.GoalExampleList=P;exports.HomePage=w;exports.LearningStrategyList=s;exports.LearningSupportCategoryList=v;exports.MainLayoutAdmin=G;exports.MarioAi=V;exports.MyProfile=re;exports.OneRosterContainer=L;exports.OpenFieldWellbeingQuestion=ee;exports.Overview=ae;exports.PersonalLearningPlansWrapper=me;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=O;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")), v = t(() => import("./QuestionBankContainer-DBm_Ox_n.js")), L = 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")), O = t(() => import("./PreviewSurveyAdmin-B14R4OTK.js")), z = t(() => import("./ExternalApi-CFsQM9Kw.js")), H = 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-BtlyDPG3.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-C44pkLLI.js")), ct = t(() => import("./index-6wZg8Ev6.js")), ut = t(() => import("./DashboardWrapper-CxXistlm.js")), lt = t(() => import("./FlagAlertWrapper-BXV9VXMs.js")), St = 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")), v = t(() => import("./QuestionBankContainer-DBm_Ox_n.js")), L = 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")), O = t(() => import("./PreviewSurveyAdmin-B14R4OTK.js")), z = t(() => import("./ExternalApi-CFsQM9Kw.js")), H = 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-BtlyDPG3.js")), et = t(() => import("./UserProfileManagement-BjKkSVSJ.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-C44pkLLI.js")), ct = t(() => import("./index-6wZg8Ev6.js")), ut = t(() => import("./DashboardWrapper-CxXistlm.js")), lt = t(() => import("./FlagAlertWrapper-BXV9VXMs.js")), St = 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.90-staging",
3
+ "version": "2.0.91-staging",
4
4
  "description": "Contains education components && functions for BRSS Mario project",
5
5
  "author": "brss",
6
6
  "license": "MIT",
@@ -65,7 +65,7 @@
65
65
  "formik": "^2.4.9",
66
66
  "html2canvas": "^1.4.1",
67
67
  "jspdf": "^3.0.4",
68
- "mario-core": "2.0.89-staging",
68
+ "mario-core": "2.0.90-staging",
69
69
  "moment": "^2.29.4",
70
70
  "papaparse": "^5.5.2",
71
71
  "pusher-js": "^7.0.3",