mario-core 3.0.8-admin → 3.0.8-es

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (291) hide show
  1. package/dist/Dashboard-DiUm-pc-.js +186 -0
  2. package/dist/Dashboard-HV1eiElu.cjs +1 -0
  3. package/dist/EmailTemplateDetail-D0D3bpWO.cjs +1 -0
  4. package/dist/EmailTemplateDetail-KvZuTCLF.js +411 -0
  5. package/dist/EmailTemplateList-B3YqSFaY.js +172 -0
  6. package/dist/EmailTemplateList-BAejgUUG.cjs +1 -0
  7. package/dist/FaqList-D5XugT5h.js +320 -0
  8. package/dist/FaqList-DpUzQ2vq.cjs +1 -0
  9. package/dist/GalleryList-B5QA3Rol.cjs +1 -0
  10. package/dist/GalleryList-CTo33BcT.js +53 -0
  11. package/dist/Login-CHAmP5ek.js +897 -0
  12. package/dist/Login-Cxbto5eM.cjs +1 -0
  13. package/dist/NotificationList-2Mf_NsOP.js +3631 -0
  14. package/dist/NotificationList-D1jMOBwH.cjs +8 -0
  15. package/dist/SchoolList-CClJ_UPT.cjs +1 -0
  16. package/dist/SchoolList-JmrmL2zE.js +5 -0
  17. package/dist/SkillList-BMyhRY78.js +406 -0
  18. package/dist/SkillList-DlMx_Evw.cjs +1 -0
  19. package/dist/TeacherSelector-B4zvSVhk.js +71 -0
  20. package/dist/TeacherSelector-DORi8RIb.cjs +1 -0
  21. package/dist/TheContent-BHmlooLu.cjs +1 -0
  22. package/dist/TheContent-V2T-Pqz8.js +38 -0
  23. package/dist/UserContainer-B-4oVOEp.cjs +1 -0
  24. package/dist/UserContainer-BaHMryYI.js +2337 -0
  25. package/dist/UserDetail-B-Mq_itT.cjs +1 -0
  26. package/dist/UserDetail-BBRiU97G.js +665 -0
  27. package/dist/assets/Images.d.ts +14 -14
  28. package/dist/components/Alerts/CommonAlert.d.ts +3 -3
  29. package/dist/components/Alerts/EmptyDataAlert.d.ts +8 -8
  30. package/dist/components/Alerts/ErrorHandler.d.ts +6 -6
  31. package/dist/components/Buttons/AddButton.d.ts +8 -7
  32. package/dist/components/Buttons/AddButtonIcon.d.ts +6 -6
  33. package/dist/components/Buttons/CloseButton.d.ts +8 -8
  34. package/dist/components/Buttons/DeleteButtonIcon.d.ts +6 -6
  35. package/dist/components/Buttons/DetailActionButtons.d.ts +9 -8
  36. package/dist/components/Buttons/EditButtonIcon.d.ts +6 -6
  37. package/dist/components/Buttons/LinkEditButton.d.ts +8 -7
  38. package/dist/components/Buttons/LoginNavButton.d.ts +8 -8
  39. package/dist/components/Buttons/ToggleButton.d.ts +10 -10
  40. package/dist/components/Buttons/UploadFileButton.d.ts +13 -13
  41. package/dist/components/Headers/CommonHeader.d.ts +7 -7
  42. package/dist/components/Image/UploadImage.d.ts +2 -3
  43. package/dist/components/Inputs/FileInput.d.ts +8 -8
  44. package/dist/components/Inputs/PasswordInput.d.ts +8 -8
  45. package/dist/components/Inputs/SearchBox.d.ts +10 -10
  46. package/dist/components/Inputs/SearchBoxContainer.d.ts +9 -10
  47. package/dist/components/Labels/RequiredLabel.d.ts +6 -6
  48. package/dist/components/Loading/Loading.d.ts +3 -3
  49. package/dist/components/Modals/CommonModal.d.ts +2 -3
  50. package/dist/components/Modals/NotificationLogoutModal.d.ts +2 -0
  51. package/dist/components/Modals/NotificationModal.d.ts +2 -3
  52. package/dist/components/Others/QuitPrompt.d.ts +5 -2
  53. package/dist/components/Pagination/CustomPagination.d.ts +2 -3
  54. package/dist/components/Scroll/ScrollToTop.d.ts +3 -3
  55. package/dist/components/Selectors/AcademicClassSelector.d.ts +2 -3
  56. package/dist/components/Selectors/CreatableSelector.d.ts +2 -3
  57. package/dist/components/Selectors/CustomSelector.d.ts +2 -3
  58. package/dist/components/Selectors/MailCategorySelectors.d.ts +2 -3
  59. package/dist/components/Selectors/QuestionCategorySelector.d.ts +2 -3
  60. package/dist/components/Selectors/QuestionTypeSelector.d.ts +2 -3
  61. package/dist/components/Selectors/StarRatingSelector.d.ts +2 -3
  62. package/dist/components/Selectors/SuggestionCategorySelector.d.ts +2 -3
  63. package/dist/components/Tabs/CustomTab.d.ts +2 -3
  64. package/dist/components/Tabs/TabsWithComponent.d.ts +10 -0
  65. package/dist/configs/editorConfig.d.ts +7 -7
  66. package/dist/containers/Commons/NotFound.d.ts +3 -3
  67. package/dist/containers/DistrictSchools/views/SchoolList.d.ts +3 -3
  68. package/dist/containers/EmailTemplate/components/AttachmentFile.d.ts +8 -7
  69. package/dist/containers/EmailTemplate/components/MailParam.d.ts +8 -7
  70. package/dist/containers/EmailTemplate/configs/emailTemplateSchema.d.ts +13 -13
  71. package/dist/containers/EmailTemplate/hooks/useEmailTemplateDetail.d.ts +27 -28
  72. package/dist/containers/EmailTemplate/hooks/useEmailTemplateList.d.ts +11 -11
  73. package/dist/containers/EmailTemplate/views/EmailTemplateDetail.d.ts +3 -3
  74. package/dist/containers/EmailTemplate/views/EmailTemplateList.d.ts +3 -3
  75. package/dist/containers/Faq/components/FaqDetailModal.d.ts +2 -3
  76. package/dist/containers/Faq/hooks/useFaqDetail.d.ts +17 -18
  77. package/dist/containers/Faq/hooks/useFaqList.d.ts +9 -9
  78. package/dist/containers/Faq/views/FaqList.d.ts +3 -3
  79. package/dist/containers/Gallery/components/ActionModal.d.ts +2 -3
  80. package/dist/containers/Gallery/components/Filter.d.ts +9 -8
  81. package/dist/containers/Gallery/components/Media.d.ts +9 -8
  82. package/dist/containers/Gallery/components/MediaDetail.d.ts +7 -7
  83. package/dist/containers/Gallery/components/MediaList.d.ts +7 -7
  84. package/dist/containers/Gallery/components/MediaNav.d.ts +19 -18
  85. package/dist/containers/Gallery/constants/gallery.types.d.ts +21 -21
  86. package/dist/containers/Gallery/extensions/helpers.d.ts +4 -4
  87. package/dist/containers/Gallery/hooks/useGalleryList.d.ts +30 -31
  88. package/dist/containers/Gallery/views/GalleryList.d.ts +6 -6
  89. package/dist/containers/Login/components/GoogleLoginButton.d.ts +10 -0
  90. package/dist/containers/Login/constant/authConfig.d.ts +38 -0
  91. package/dist/containers/Login/constant/types.d.ts +27 -0
  92. package/dist/containers/Login/hooks/useForgotPassword.d.ts +20 -21
  93. package/dist/containers/Login/hooks/useLogin.d.ts +26 -23
  94. package/dist/containers/Login/hooks/useLoginTwoFactor.d.ts +4 -4
  95. package/dist/containers/Login/views/Dashboard.d.ts +3 -3
  96. package/dist/containers/Login/views/Login.d.ts +8 -9
  97. package/dist/containers/Login/views/block/BlockBackground.d.ts +7 -0
  98. package/dist/containers/Login/views/block/BlockForgetPassword.d.ts +6 -3
  99. package/dist/containers/Login/views/block/BlockLogin.d.ts +9 -7
  100. package/dist/containers/Login/views/block/BlockResetPassword.d.ts +2 -3
  101. package/dist/containers/Login/views/block/BlockSelectTeacher.d.ts +11 -12
  102. package/dist/containers/Login/views/block/BlockTwoFactorLogin.d.ts +2 -3
  103. package/dist/containers/Login/views/block/CloseBlock.d.ts +6 -6
  104. package/dist/containers/Login/views/block/ContentHomePage.d.ts +5 -5
  105. package/dist/containers/Login/views/block/IconContent.d.ts +7 -7
  106. package/dist/containers/Login/views/block/QuoteContent.d.ts +2 -3
  107. package/dist/containers/Notifications/components/NotificationButton.d.ts +5 -5
  108. package/dist/containers/Notifications/components/NotificationStatusSelector.d.ts +6 -7
  109. package/dist/containers/Notifications/hooks/useNotificationList.d.ts +17 -17
  110. package/dist/containers/Notifications/hooks/useUnreadNotification.d.ts +4 -4
  111. package/dist/containers/Notifications/views/NotificationList.d.ts +2 -3
  112. package/dist/containers/Skill/components/SkillDetailModal.d.ts +2 -3
  113. package/dist/containers/Skill/components/SkillSelector.d.ts +2 -3
  114. package/dist/containers/Skill/hooks/useSkillDetail.d.ts +19 -20
  115. package/dist/containers/Skill/hooks/useSkillList.d.ts +10 -9
  116. package/dist/containers/Skill/views/SkillList.d.ts +3 -3
  117. package/dist/containers/User/components/AssignStudentModal.d.ts +19 -0
  118. package/dist/containers/User/components/DeleteBulkModel.d.ts +3 -0
  119. package/dist/containers/User/components/FilterPopover.d.ts +21 -0
  120. package/dist/containers/User/components/HeaderCell.d.ts +19 -0
  121. package/dist/containers/User/components/RemoveAssistant.d.ts +3 -0
  122. package/dist/containers/User/components/RemoveCounselor.d.ts +3 -0
  123. package/dist/containers/User/components/RemoveTeacher.d.ts +3 -0
  124. package/dist/containers/User/components/TableHeader.d.ts +14 -0
  125. package/dist/containers/User/components/TeacherSelector.d.ts +2 -0
  126. package/dist/containers/User/configs/changePasswordSchema.d.ts +11 -10
  127. package/dist/containers/User/configs/constants.d.ts +62 -0
  128. package/dist/containers/User/configs/type.d.ts +210 -0
  129. package/dist/containers/User/configs/userSchema.d.ts +15 -15
  130. package/dist/containers/User/hooks/useAssignStudent.d.ts +33 -0
  131. package/dist/containers/User/hooks/useAssignStudentList.d.ts +33 -0
  132. package/dist/containers/User/hooks/useAssistantList.d.ts +9 -0
  133. package/dist/containers/User/hooks/useClickOutside.d.ts +2 -0
  134. package/dist/containers/User/hooks/useCounselorList.d.ts +9 -0
  135. package/dist/containers/User/hooks/useFilterPopover.d.ts +36 -0
  136. package/dist/containers/User/hooks/useTableHeader.d.ts +19 -0
  137. package/dist/containers/User/hooks/useTeacherList.d.ts +9 -0
  138. package/dist/containers/User/hooks/useUserDetail.d.ts +31 -24
  139. package/dist/containers/User/hooks/useUserList.d.ts +14 -11
  140. package/dist/containers/User/hooks/userFilters.d.ts +7 -0
  141. package/dist/containers/User/views/AssignStudentList.d.ts +2 -0
  142. package/dist/containers/User/views/UserContainer.d.ts +2 -0
  143. package/dist/containers/User/views/UserDetail.d.ts +2 -3
  144. package/dist/containers/User/views/UserList.d.ts +2 -3
  145. package/dist/hooks/useClassFontSize.d.ts +4 -0
  146. package/dist/hooks/useFilters.d.ts +7 -8
  147. package/dist/i18n.d.ts +2 -2
  148. package/dist/index-C95SWLrn.js +18163 -0
  149. package/dist/index-DixwqZ17.cjs +29 -0
  150. package/dist/index.d.ts +111 -110
  151. package/dist/index.esm-BckW25l9.cjs +1 -0
  152. package/dist/index.esm-hqKUWCW0.js +15 -0
  153. package/dist/index.js +1 -10373
  154. package/dist/index.modern.js +159 -10213
  155. package/dist/layouts/TheContent.d.ts +3 -3
  156. package/dist/mailCategoryService-BqDtPJRc.js +10 -0
  157. package/dist/mailCategoryService-DBMJOyls.cjs +1 -0
  158. package/dist/mario-core.css +5 -0
  159. package/dist/redux/assessments/action.d.ts +1 -1
  160. package/dist/redux/assessments/reducer.d.ts +10 -5
  161. package/dist/redux/assignment/action.d.ts +1 -1
  162. package/dist/redux/assignment/reducer.d.ts +4 -2
  163. package/dist/redux/assistants/action.d.ts +1 -1
  164. package/dist/redux/assistants/reducer.d.ts +4 -2
  165. package/dist/redux/badges/action.d.ts +1 -1
  166. package/dist/redux/badges/reducer.d.ts +4 -2
  167. package/dist/redux/bandScores/action.d.ts +1 -1
  168. package/dist/redux/bandScores/reducer.d.ts +4 -2
  169. package/dist/redux/certificate/action.d.ts +1 -1
  170. package/dist/redux/certificate/reducer.d.ts +4 -2
  171. package/dist/redux/classes/action.d.ts +1 -1
  172. package/dist/redux/classes/reducer.d.ts +4 -2
  173. package/dist/redux/commons/action.d.ts +18 -18
  174. package/dist/redux/commons/reducer.d.ts +4 -2
  175. package/dist/redux/conferenceRubrics/action.d.ts +1 -1
  176. package/dist/redux/conferenceRubrics/reducer.d.ts +4 -2
  177. package/dist/redux/customAlert/action.d.ts +1 -1
  178. package/dist/redux/customAlert/reducer.d.ts +4 -2
  179. package/dist/redux/dashboard/action.d.ts +5 -5
  180. package/dist/redux/dashboard/reducer.d.ts +4 -2
  181. package/dist/redux/dataPlayer/action.d.ts +2 -2
  182. package/dist/redux/dataPlayer/reducer.d.ts +4 -2
  183. package/dist/redux/emailTemplates/action.d.ts +1 -1
  184. package/dist/redux/emailTemplates/reducer.d.ts +4 -2
  185. package/dist/redux/faqs/action.d.ts +1 -1
  186. package/dist/redux/faqs/reducer.d.ts +4 -2
  187. package/dist/redux/feedback/action.d.ts +1 -1
  188. package/dist/redux/feedback/reducer.d.ts +4 -2
  189. package/dist/redux/gallery/action.d.ts +2 -2
  190. package/dist/redux/gallery/reducer.d.ts +4 -2
  191. package/dist/redux/goalExamples/action.d.ts +1 -1
  192. package/dist/redux/goalExamples/reducer.d.ts +4 -2
  193. package/dist/redux/improveMyClass/action.d.ts +1 -1
  194. package/dist/redux/improveMyClass/reducer.d.ts +4 -2
  195. package/dist/redux/learningStrategies/action.d.ts +1 -1
  196. package/dist/redux/learningStrategies/reducer.d.ts +4 -2
  197. package/dist/redux/learningSupportCategories/action.d.ts +1 -1
  198. package/dist/redux/learningSupportCategories/reducer.d.ts +4 -2
  199. package/dist/redux/mailCategories/action.d.ts +1 -1
  200. package/dist/redux/mailCategories/reducer.d.ts +4 -2
  201. package/dist/redux/navMobile/action.d.ts +1 -1
  202. package/dist/redux/navMobile/reducer.d.ts +4 -2
  203. package/dist/redux/notifications/action.d.ts +3 -3
  204. package/dist/redux/notifications/reducer.d.ts +4 -2
  205. package/dist/redux/questionBanks/action.d.ts +1 -1
  206. package/dist/redux/questionBanks/reducer.d.ts +4 -2
  207. package/dist/redux/questionByCategory/action.d.ts +8 -8
  208. package/dist/redux/questionByCategory/reducer.d.ts +4 -2
  209. package/dist/redux/questionCategory/action.d.ts +1 -1
  210. package/dist/redux/questionCategory/reducer.d.ts +4 -2
  211. package/dist/redux/reflectionForms/action.d.ts +1 -1
  212. package/dist/redux/reflectionForms/reducer.d.ts +4 -2
  213. package/dist/redux/reflectionResults/action.d.ts +1 -1
  214. package/dist/redux/reflectionResults/reducer.d.ts +4 -2
  215. package/dist/redux/schoolBlankDays/action.d.ts +1 -1
  216. package/dist/redux/schoolBlankDays/reducer.d.ts +4 -2
  217. package/dist/redux/semester/action.d.ts +1 -1
  218. package/dist/redux/semester/reducer.d.ts +4 -2
  219. package/dist/redux/sessionPlayers/action.d.ts +5 -5
  220. package/dist/redux/sessionPlayers/reducer.d.ts +4 -2
  221. package/dist/redux/sessionTemplateGeneralClasses/action.d.ts +1 -1
  222. package/dist/redux/sessionTemplateGeneralClasses/reducer.d.ts +4 -2
  223. package/dist/redux/sessionTemplates/action.d.ts +1 -1
  224. package/dist/redux/sessionTemplates/reducer.d.ts +4 -2
  225. package/dist/redux/skills/action.d.ts +1 -1
  226. package/dist/redux/skills/reducer.d.ts +4 -2
  227. package/dist/redux/subjects/action.d.ts +1 -1
  228. package/dist/redux/subjects/reducer.d.ts +4 -2
  229. package/dist/redux/suggestionBanks/action.d.ts +1 -1
  230. package/dist/redux/suggestionBanks/reducer.d.ts +4 -2
  231. package/dist/redux/teacher/myStudent/action.d.ts +1 -1
  232. package/dist/redux/teacher/myStudent/reducer.d.ts +4 -2
  233. package/dist/redux/tutorialScreen/action.d.ts +1 -1
  234. package/dist/redux/tutorialScreen/reducer.d.ts +10 -5
  235. package/dist/redux/users/action.d.ts +2 -2
  236. package/dist/redux/users/reducer.d.ts +4 -2
  237. package/dist/redux/widget/action.d.ts +1 -1
  238. package/dist/redux/widget/reducer.d.ts +4 -2
  239. package/dist/rootReducer.d.ts +96 -49
  240. package/dist/services/accountService.d.ts +13 -12
  241. package/dist/services/api.d.ts +3 -3
  242. package/dist/services/classService.d.ts +1 -1
  243. package/dist/services/emailTemplateService.d.ts +6 -6
  244. package/dist/services/faqService.d.ts +6 -6
  245. package/dist/services/fileServices.d.ts +13 -13
  246. package/dist/services/galleryService.d.ts +2 -2
  247. package/dist/services/languageService.d.ts +1 -0
  248. package/dist/services/mailCategoryService.d.ts +1 -1
  249. package/dist/services/notificationService.d.ts +7 -7
  250. package/dist/services/questionCategoryService.d.ts +1 -1
  251. package/dist/services/schoolService.d.ts +1 -0
  252. package/dist/services/skillService.d.ts +6 -6
  253. package/dist/services/suggestionCategoryService.d.ts +1 -1
  254. package/dist/services/userService.d.ts +21 -9
  255. package/dist/store.d.ts +3 -3
  256. package/dist/types/Conversation.d.ts +8 -8
  257. package/dist/types/ConversationMember.d.ts +5 -5
  258. package/dist/types/Dashboard.d.ts +5 -5
  259. package/dist/types/Filter.d.ts +10 -10
  260. package/dist/types/Language.d.ts +8 -0
  261. package/dist/types/Message.d.ts +13 -13
  262. package/dist/types/Notification.d.ts +8 -8
  263. package/dist/utils/canAccessRoute.d.ts +2 -2
  264. package/dist/utils/constants.d.ts +77 -67
  265. package/dist/utils/debounce.d.ts +2 -2
  266. package/dist/utils/domHelpers.d.ts +2 -2
  267. package/dist/utils/encodeParams.d.ts +2 -2
  268. package/dist/utils/firstCheckToken.d.ts +2 -2
  269. package/dist/utils/generateRandomString.d.ts +2 -2
  270. package/dist/utils/getAccessToken.d.ts +2 -2
  271. package/dist/utils/getCookieValue.d.ts +2 -0
  272. package/dist/utils/getFileUrl.d.ts +2 -2
  273. package/dist/utils/getStaticFileUrl.d.ts +2 -0
  274. package/dist/utils/getTextFromHTML.d.ts +2 -2
  275. package/dist/utils/utcToLocalTime.d.ts +2 -2
  276. package/package.json +68 -77
  277. package/dist/components/Alerts/ReactNotification.d.ts +0 -4
  278. package/dist/containers/Login/constant/type.d.ts +0 -5
  279. package/dist/containers/Login/views/ModelSelectRole.d.ts +0 -4
  280. package/dist/index.css +0 -658
  281. package/dist/index.js.map +0 -1
  282. package/dist/index.modern.js.map +0 -1
  283. package/dist/index.test.d.ts +0 -1
  284. package/dist/layouts/TheFooter.d.ts +0 -3
  285. package/dist/layouts/TheHeader.d.ts +0 -3
  286. package/dist/layouts/TheHeaderDropdown.d.ts +0 -3
  287. package/dist/layouts/TheLanguageDropdown.d.ts +0 -3
  288. package/dist/layouts/TheLayout.d.ts +0 -4
  289. package/dist/layouts/TheSidebar.d.ts +0 -3
  290. package/dist/types/Payload.d.ts +0 -15
  291. package/dist/utils/amplitude.d.ts +0 -1
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),h=require("react"),Q=require("react-router-dom"),t=require("reactstrap"),V=require("formik"),K=require("react-datepicker"),Y=require("date-fns"),j=require("./TeacherSelector-DORi8RIb.cjs"),G=require("react-redux"),s=require("./index-DixwqZ17.cjs"),X=require("yup"),Z=require("react-i18next");function ee(a){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const g in a)if(g!=="default"){const y=Object.getOwnPropertyDescriptor(a,g);Object.defineProperty(o,g,y.get?y:{enumerable:!0,get:()=>a[g]})}}return o.default=a,Object.freeze(o)}const p=ee(X);function se(a,o){return j.constructFrom(a,a)}const te={id:"",firstName:"",lastName:"",email:"",dateOfBirth:"",roles:[],isActive:!0,profileImageFileName:"",teacherUserId:[]},W="/admin/users/user-list",ae="User detail",re=12,oe=20,le=a=>{const o=G.useDispatch(),g=Q.useNavigate(),y=G.useSelector(i=>{var n;return(n=i.common)==null?void 0:n.defaultFontSize}),[_,F]=h.useState(te),[N,P]=h.useState(null),[L,E]=h.useState(!1),[A,I]=h.useState([]),[f,O]=h.useState([]),[T,z]=h.useState(!1),v=async()=>{localStorage.setItem(window.location.href,"true"),E(!0)},B=()=>{z(!T)},b=h.useMemo(()=>y==oe?"font-large":y==re?"font-small":"",[y]);h.useEffect(()=>{document.title=ae,E(!1),localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href)},[]),h.useEffect(()=>{a&&$(),!a&&c()},[a]);const $=h.useCallback(async()=>{var i,n,d,u;o(s.setLoading(!0));try{const l=await j.getById(a);F({...l.data,dateOfBirth:Y.format(new Date(l.data.dateOfBirth),s.DATE_FORMAT),roles:l.data.roles.includes("EduTeacher")?[s.ROLES.EDUTEACHER]:l.data.roles}),I(((i=l==null?void 0:l.data)==null?void 0:i.roles)??[]),document.title=(n=l.data)==null?void 0:n.fullName}catch(l){o(s.setAlert({type:"danger",message:((u=(d=l.response)==null?void 0:d.data)==null?void 0:u.title)||l.message}))}o(s.setLoading(!1))},[a]),q=h.useCallback(i=>{g(i&&typeof i=="string"?W+`?query=${i}`:W)},[]),k=i=>["Student","Parent","EduTeacher"].includes(i),U=h.useCallback(async i=>{var n,d,u;o(s.setLoading(!0));try{if(N){const C=new FormData,{name:r}=N;C.append("file",N,r);const x=await s.systemProfileUpload(C),S=(n=x==null?void 0:x.data)==null?void 0:n.key;i.profileImageFileName=S}const l=a?j.update:j.create;!a&&delete i.id;const w=await l(i);w&&j.getById(w.data.id).then(C=>{q(C.data.fullName)}),a||alert("Password of "+w.data.email+` is "${w.data.password}"`),o(s.setAlert({type:"success",message:`${a?"Update":"Create"} user successfully`}))}catch(l){o(s.setAlert({type:"danger",message:((u=(d=l.response)==null?void 0:d.data)==null?void 0:u.title)||l.message}))}o(s.setLoading(!1))},[a,N]),M=async i=>{var n,d;o(s.setLoading(!0));try{await j.changePassword(i),o(s.setAlert({type:"success",message:"Change password successfully"}))}catch(u){o(s.setAlert({type:"danger",message:((d=(n=u.response)==null?void 0:n.data)==null?void 0:d.title)||u.message}))}o(s.setLoading(!1))},m=h.useCallback(async i=>{var n,d;o(s.setLoading(!0));try{await j.forgotChangePassword(i),o(s.setAlert({type:"success",message:"Send forgot password link successfully"}))}catch(u){o(s.setAlert({type:"danger",message:((d=(n=u.response)==null?void 0:n.data)==null?void 0:d.title)||u.message||"Error occured"}))}o(s.setLoading(!1))},[]),c=async()=>{var i,n,d,u;try{const l=await j.getTeachers({sortBy:"Email"});l.data&&O(((n=(i=l.data).map)==null?void 0:n.call(i,w=>({label:w.email,value:w.id})))||[])}catch(l){o(s.setAlert({type:"danger",message:((u=(d=l.response)==null?void 0:d.data)==null?void 0:u.title)||l.message}))}};return{userDetail:_,backToList:q,confirmData:U,file:N,setFile:P,edited:L,currentRoles:A,setEdited:E,setEditedTrue:v,confirmChangePassword:M,forgotPasswordRequest:m,handleDisableRoles:k,classFontSize:b,teacherOptions:f,handleToggleModel:B,openModel:T}},ne=p.object({firstName:p.string().required("First name is required"),lastName:p.string().required("Last name is required"),dateOfBirth:p.string().required("Date of birth is required"),email:p.string().email("Email is invalid").required("Email is required"),roles:p.array().of(p.string()).min(1,"Role is required")}),ie=p.object({oldPassword:p.string().required("Current password is required"),newPassword:p.string().required("New password is required"),confirmedNewPassword:p.string().required("Confirm password is required")}),ce="create_user",de="edit_user",ue="change_password",me=()=>{const{t:a}=Z.useTranslation(),{id:o}=Q.useParams(),g=G.useSelector(m=>m.common.user),{userDetail:y,backToList:_,confirmData:F,file:N,setFile:P,edited:L,currentRoles:E,handleDisableRoles:A,setEdited:I,setEditedTrue:f,confirmChangePassword:O,forgotPasswordRequest:T,classFontSize:z,teacherOptions:v,openModel:B,handleToggleModel:b}=le(o),$={oldPassword:"",newPassword:"",confirmedNewPassword:""},q=o?de:ce,k=o?"update":"create",U=()=>{var m=window.location.origin+"/api/ExportDataUser/"+o;window.open(m)},M=async m=>{var c={email:m};T(c)};return e.jsx(V.Formik,{initialValues:y,enableReinitialize:!0,validationSchema:ne,onSubmit:m=>{F({...m,roles:m.roles.includes(s.ROLES.EDUTEACHER)?["EduTeacher"]:m.roles}),I(!1),localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href)},children:m=>{const{values:c,touched:i,errors:n,setFieldValue:d,handleChange:u,handleBlur:l,handleSubmit:w}=m,C=h.useCallback(r=>{if(c.roles.includes(r)){d("roles",c.roles.filter(x=>x!==r));return}if([s.ROLES.STUDENT,s.ROLES.PARENT,s.ROLES.EDUTEACHER].includes(r)){d("roles",[r]);return}if(c.roles.includes(s.ROLES.EDUTEACHER)&&s.ROLES.EDUTEACHER!=r){d("roles",[r]);return}d("roles",[...c.roles,r])},[c.roles]);return e.jsxs("div",{className:`animated fadeIn detail-buttons-padding ${s.styles[z]}`,children:[e.jsx(s.QuitPrompt,{when:L}),e.jsx("h5",{className:`mb-2 ${s.styles["custom-title-font-size"]}`,children:a(q)}),e.jsxs(t.Row,{className:`pt-2 ${s.styles["custom-font-size"]}`,children:[e.jsxs(t.Col,{md:8,children:[e.jsxs(t.Row,{children:[e.jsx(t.Col,{md:6,children:e.jsxs(t.FormGroup,{children:[e.jsx(s.RequiredLabel,{className:` ${s.styles["custom-font-size"]}`,text:a("first_name")}),e.jsx(t.Input,{name:"firstName",value:c.firstName,onChange:r=>{u(r),f()},onBlur:l("subject"),placeholder:a("first_name"),className:` ${s.styles["custom-font-size"]}`}),i.firstName&&n.firstName&&e.jsx(s.ErrorHandler,{text:n.firstName})]})}),e.jsx(t.Col,{md:6,children:e.jsxs(t.FormGroup,{children:[e.jsx(s.RequiredLabel,{className:` ${s.styles["custom-font-size"]}`,text:a("date_of_birth")}),e.jsx("div",{children:e.jsx(K,{value:c.dateOfBirth,todayButton:"Today",peekNextMonth:!0,showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select",selected:c.dateOfBirth?se(new Date(c.dateOfBirth)):null,onChange:r=>{m.setFieldValue("dateOfBirth",Y.format(r,s.DATE_FORMAT)),f()},placeholderText:a("date_of_birth"),customInput:e.jsx(t.Input,{type:"text",style:{width:"maxContent"},placeholder:a("date_of_birth"),className:` ${s.styles["custom-font-size"]}`})})}),i.dateOfBirth&&n.dateOfBirth&&e.jsx(s.ErrorHandler,{text:n.dateOfBirth})]})})]}),e.jsxs(t.Row,{children:[e.jsx(t.Col,{md:6,children:e.jsxs(t.FormGroup,{children:[e.jsx(s.RequiredLabel,{className:` ${s.styles["custom-font-size"]}`,text:a("last_name")}),e.jsx(t.Input,{name:"lastName",value:c.lastName,onChange:r=>{u(r),f()},onBlur:l("lastName"),placeholder:a("last_name"),className:` ${s.styles["custom-font-size"]}`}),i.lastName&&n.lastName&&e.jsx(s.ErrorHandler,{text:n.lastName})]})}),e.jsx(t.Col,{md:6,children:e.jsxs(t.FormGroup,{children:[e.jsx(s.RequiredLabel,{className:` ${s.styles["custom-font-size"]}`,text:a("roles")}),e.jsx(t.Row,{children:e.jsx(t.Col,{md:12,className:"d-flex flex-wrap align-items-center",children:s.USER_ROLES.map(r=>e.jsx("div",{className:"mr-3",children:e.jsx(t.Input,{type:"checkbox",id:`role-checkbox-${r}`,label:r,checked:c.roles.includes(r),onChange:()=>{C(r),f()},disabled:o?E.concat(["Student","Parent","General ED teacher"]).includes(r)||E.every(A):["Parent"].includes(r),className:` ${s.styles["custom-font-size"]}`})},r))})}),i.roles&&n.roles&&e.jsx(s.ErrorHandler,{text:n.roles})]})})]}),e.jsxs(t.Row,{children:[e.jsx(t.Col,{md:6,children:e.jsxs(t.FormGroup,{children:[e.jsx(s.RequiredLabel,{className:` ${s.styles["custom-font-size"]}`,text:a("email")}),e.jsx(t.Input,{name:"email",value:c.email,onChange:r=>{u(r),f()},onBlur:l("email"),placeholder:a("email"),className:` ${s.styles["custom-font-size"]}`}),i.email&&n.email&&e.jsx(s.ErrorHandler,{text:n.email})]})}),e.jsx(t.Col,{md:6,children:e.jsxs(t.FormGroup,{children:[e.jsx(s.RequiredLabel,{text:a("status"),className:` ${s.styles["custom-font-size"]}`}),e.jsxs(t.Row,{children:[e.jsx(t.Col,{md:3,children:e.jsx(t.Input,{id:"role-checkbox-active",type:"radio",name:"active",label:a("active"),checked:!!c&&!!c.isActive,onChange:()=>{d("isActive",!0),f()},className:` ${s.styles["custom-font-size"]}`})}),e.jsx(t.Col,{md:3,children:e.jsx(t.Input,{id:"role-checkbox-inActive",type:"radio",name:"active",label:a("inactive"),checked:!!c&&!c.isActive,onChange:()=>d("isActive",!1),className:` ${s.styles["custom-font-size"]}`})})]})]})})]}),!!o&&e.jsxs(t.Row,{children:[e.jsx(t.Col,{md:6}),e.jsxs(t.Col,{md:6,children:[e.jsx(t.Button,{color:"primary",className:`w-100 ${s.styles["custom-font-size"]}`,onClick:()=>{M(c.email||"")},children:a("send_forgot_password_link")}),e.jsx(t.Button,{className:`w-100 mt-3 ${s.styles["custom-font-size"]}`,color:"success",onClick:()=>{U()},children:a("download_user_data")})]})]})]}),e.jsx(t.Col,{md:4,children:e.jsx(t.Row,{children:e.jsxs(t.Col,{md:8,children:[e.jsx(s.UploadFileButton,{setFile:P,fileName:c.profileImageFileName,onAddImage:f,canDelete:!0,onDelete:()=>{P(null),d("profileImageFileName",""),f()}}),!N&&!c.profileImageFileName&&e.jsx("img",{src:s.DEFAULT_IMAGE_URL,style:{maxWidth:"100%"}})]})})})]}),g.id===o?e.jsxs("div",{children:[e.jsx("h5",{className:"mt-3",children:a(ue)}),e.jsx(V.Formik,{initialValues:$,enableReinitialize:!0,validationSchema:ie,onSubmit:r=>{O(r)},children:r=>{const{values:x,touched:S,errors:R,handleChange:H,handleSubmit:J}=r;return e.jsxs(t.Row,{className:"pt-2 pb-5",children:[e.jsx(t.Col,{md:7,children:e.jsxs(t.FormGroup,{children:[e.jsx(s.RequiredLabel,{className:` ${s.styles["custom-font-size"]}`,text:a("current_password")}),e.jsx(t.Input,{name:"oldPassword",type:"password",value:x.oldPassword,onChange:D=>{H(D),f()},onBlur:l("subject"),placeholder:a("current_password"),className:` ${s.styles["custom-font-size"]}`}),S.oldPassword&&R.oldPassword&&e.jsx(s.ErrorHandler,{text:R.oldPassword})]})}),e.jsx(t.Col,{md:7,children:e.jsxs(t.FormGroup,{children:[e.jsx(s.RequiredLabel,{text:a("new_password"),className:` ${s.styles["custom-font-size"]}`}),e.jsx(t.Input,{name:"newPassword",type:"password",value:x.newPassword,onChange:D=>{H(D),f()},onBlur:l("subject"),placeholder:a("new_password"),className:` ${s.styles["custom-font-size"]}`}),S.newPassword&&R.newPassword&&e.jsx(s.ErrorHandler,{text:R.newPassword})]})}),e.jsx(t.Col,{md:7,children:e.jsxs(t.FormGroup,{children:[e.jsx(s.RequiredLabel,{text:a("confirm_password"),className:` ${s.styles["custom-font-size"]}`}),e.jsx(t.Input,{name:"confirmedNewPassword",type:"password",value:x.confirmedNewPassword,onChange:D=>{H(D),f()},onBlur:l("subject"),placeholder:a("confirm_password"),className:` ${s.styles["custom-font-size"]}`}),S.confirmedNewPassword&&R.confirmedNewPassword&&e.jsx(s.ErrorHandler,{text:R.confirmedNewPassword})]})}),e.jsx(t.Col,{md:12,children:e.jsx(t.Button,{color:"primary",size:"sm",className:`px-4 pl-1 mr-2 ml-3 ${s.styles["custom-font-size"]}`,onClick:()=>J(),children:a("save")})})]})}})]}):null,e.jsx(s.DetailActionButtons,{confirmText:k,onConfirm:c.roles.includes(s.ROLES.STUDENT)&&!o?b:w,onCancel:_,className:` ${s.styles["custom-font-size"]}`}),e.jsxs(t.Modal,{centered:!0,isOpen:B,toggle:()=>b(),children:[e.jsx(t.ModalHeader,{children:"Assign Teacher"}),e.jsx(t.ModalBody,{children:e.jsx(j.TeacherSelector,{value:v.filter(r=>{var x;return(x=c.teacherUserId)==null?void 0:x.includes(r.value)})||null,options:v,placeholder:a("select_teacher"),className:"flex-grow-1 mb-3",onChange:r=>d("teacherUserId",[r.value])})}),e.jsxs(t.ModalFooter,{className:"text-right",children:[e.jsx(t.Button,{onClick:()=>b(),children:"Cancel"}),e.jsx(t.Button,{disabled:!c.teacherUserId,color:"primary",onClick:()=>w(),children:"Assign"})]})]})]})}})};exports.default=me;
@@ -0,0 +1,665 @@
1
+ import { jsx as e, jsxs as d } from "react/jsx-runtime";
2
+ import { useState as R, useMemo as ce, useEffect as se, useCallback as B } from "react";
3
+ import { useNavigate as de, useParams as me } from "react-router-dom";
4
+ import { Row as E, Col as u, FormGroup as y, Input as N, Button as A, Modal as ue, ModalHeader as he, ModalBody as fe, ModalFooter as pe } from "reactstrap";
5
+ import { Formik as ae } from "formik";
6
+ import we from "react-datepicker";
7
+ import { format as oe } from "date-fns";
8
+ import { c as ge, k as te, l as Ne, m as Ee, n as ye, f as Ce, o as ve, T as xe } from "./TeacherSelector-B4zvSVhk.js";
9
+ import { useDispatch as De, useSelector as ne } from "react-redux";
10
+ import { s as v, V as P, a0 as le, c as x, a1 as Pe, h as i, Q as be, R as C, E as D, a2 as Te, a3 as Se, a4 as _e, M as Re } from "./index-C95SWLrn.js";
11
+ import * as w from "yup";
12
+ import { useTranslation as ze } from "react-i18next";
13
+ function $e(s, n) {
14
+ return ge(s, s);
15
+ }
16
+ const Ue = {
17
+ id: "",
18
+ firstName: "",
19
+ lastName: "",
20
+ email: "",
21
+ dateOfBirth: "",
22
+ roles: [],
23
+ isActive: !0,
24
+ profileImageFileName: "",
25
+ teacherUserId: []
26
+ }, re = "/admin/users/user-list", Fe = "User detail", Ae = 12, Be = 20, Ie = (s) => {
27
+ const n = De(), I = de(), z = ne((o) => {
28
+ var r;
29
+ return (r = o.common) == null ? void 0 : r.defaultFontSize;
30
+ }), [L, H] = R(Ue), [b, k] = R(null), [j, T] = R(!1), [V, G] = R([]), [f, Q] = R([]), [O, W] = R(!1), q = async () => {
31
+ localStorage.setItem(window.location.href, "true"), T(!0);
32
+ }, Y = () => {
33
+ W(!O);
34
+ }, $ = ce(() => z == Be ? "font-large" : z == Ae ? "font-small" : "", [z]);
35
+ se(() => {
36
+ document.title = Fe, T(!1), localStorage.getItem(window.location.href) && localStorage.removeItem(window.location.href);
37
+ }, []), se(() => {
38
+ s && J(), !s && l();
39
+ }, [s]);
40
+ const J = B(async () => {
41
+ var o, r, c, m;
42
+ n(v(!0));
43
+ try {
44
+ const t = await te(s);
45
+ H({
46
+ ...t.data,
47
+ dateOfBirth: oe(new Date(t.data.dateOfBirth), le),
48
+ roles: t.data.roles.includes("EduTeacher") ? [P.EDUTEACHER] : t.data.roles
49
+ }), G(((o = t == null ? void 0 : t.data) == null ? void 0 : o.roles) ?? []), document.title = (r = t.data) == null ? void 0 : r.fullName;
50
+ } catch (t) {
51
+ n(
52
+ x({
53
+ type: "danger",
54
+ message: ((m = (c = t.response) == null ? void 0 : c.data) == null ? void 0 : m.title) || t.message
55
+ })
56
+ );
57
+ }
58
+ n(v(!1));
59
+ }, [s]), M = B((o) => {
60
+ I(o && typeof o == "string" ? re + `?query=${o}` : re);
61
+ }, []), K = (o) => ["Student", "Parent", "EduTeacher"].includes(o), X = B(
62
+ async (o) => {
63
+ var r, c, m;
64
+ n(v(!0));
65
+ try {
66
+ if (b) {
67
+ const S = new FormData(), { name: a } = b;
68
+ S.append("file", b, a);
69
+ const p = await Pe(S), U = (r = p == null ? void 0 : p.data) == null ? void 0 : r.key;
70
+ o.profileImageFileName = U;
71
+ }
72
+ const t = s ? Ne : Ee;
73
+ !s && delete o.id;
74
+ const g = await t(o);
75
+ g && te(g.data.id).then((S) => {
76
+ M(S.data.fullName);
77
+ }), s || alert("Password of " + g.data.email + ` is "${g.data.password}"`), n(
78
+ x({
79
+ type: "success",
80
+ message: `${s ? "Update" : "Create"} user successfully`
81
+ })
82
+ );
83
+ } catch (t) {
84
+ n(
85
+ x({
86
+ type: "danger",
87
+ message: ((m = (c = t.response) == null ? void 0 : c.data) == null ? void 0 : m.title) || t.message
88
+ })
89
+ );
90
+ }
91
+ n(v(!1));
92
+ },
93
+ [s, b]
94
+ ), Z = async (o) => {
95
+ var r, c;
96
+ n(v(!0));
97
+ try {
98
+ await ve(o), n(
99
+ x({
100
+ type: "success",
101
+ message: "Change password successfully"
102
+ })
103
+ );
104
+ } catch (m) {
105
+ n(
106
+ x({
107
+ type: "danger",
108
+ message: ((c = (r = m.response) == null ? void 0 : r.data) == null ? void 0 : c.title) || m.message
109
+ })
110
+ );
111
+ }
112
+ n(v(!1));
113
+ }, h = B(async (o) => {
114
+ var r, c;
115
+ n(v(!0));
116
+ try {
117
+ await ye(o), n(
118
+ x({
119
+ type: "success",
120
+ message: "Send forgot password link successfully"
121
+ })
122
+ );
123
+ } catch (m) {
124
+ n(
125
+ x({
126
+ type: "danger",
127
+ message: ((c = (r = m.response) == null ? void 0 : r.data) == null ? void 0 : c.title) || m.message || "Error occured"
128
+ })
129
+ );
130
+ }
131
+ n(v(!1));
132
+ }, []), l = async () => {
133
+ var o, r, c, m;
134
+ try {
135
+ const t = await Ce({
136
+ sortBy: "Email"
137
+ });
138
+ t.data && Q(((r = (o = t.data).map) == null ? void 0 : r.call(o, (g) => ({
139
+ label: g.email,
140
+ value: g.id
141
+ }))) || []);
142
+ } catch (t) {
143
+ n(
144
+ x({
145
+ type: "danger",
146
+ message: ((m = (c = t.response) == null ? void 0 : c.data) == null ? void 0 : m.title) || t.message
147
+ })
148
+ );
149
+ }
150
+ };
151
+ return {
152
+ userDetail: L,
153
+ backToList: M,
154
+ confirmData: X,
155
+ file: b,
156
+ setFile: k,
157
+ edited: j,
158
+ currentRoles: V,
159
+ setEdited: T,
160
+ setEditedTrue: q,
161
+ confirmChangePassword: Z,
162
+ forgotPasswordRequest: h,
163
+ handleDisableRoles: K,
164
+ classFontSize: $,
165
+ teacherOptions: f,
166
+ handleToggleModel: Y,
167
+ openModel: O
168
+ };
169
+ }, ke = w.object({
170
+ firstName: w.string().required("First name is required"),
171
+ lastName: w.string().required("Last name is required"),
172
+ dateOfBirth: w.string().required("Date of birth is required"),
173
+ email: w.string().email("Email is invalid").required("Email is required"),
174
+ roles: w.array().of(w.string()).min(1, "Role is required")
175
+ }), Oe = w.object({
176
+ oldPassword: w.string().required("Current password is required"),
177
+ newPassword: w.string().required("New password is required"),
178
+ confirmedNewPassword: w.string().required("Confirm password is required")
179
+ }), qe = "create_user", Me = "edit_user", Le = "change_password", es = () => {
180
+ const { t: s } = ze(), { id: n } = me(), I = ne((h) => h.common.user), {
181
+ userDetail: z,
182
+ backToList: L,
183
+ confirmData: H,
184
+ file: b,
185
+ setFile: k,
186
+ edited: j,
187
+ currentRoles: T,
188
+ handleDisableRoles: V,
189
+ setEdited: G,
190
+ setEditedTrue: f,
191
+ confirmChangePassword: Q,
192
+ forgotPasswordRequest: O,
193
+ classFontSize: W,
194
+ teacherOptions: q,
195
+ openModel: Y,
196
+ handleToggleModel: $
197
+ } = Ie(n), J = {
198
+ oldPassword: "",
199
+ newPassword: "",
200
+ confirmedNewPassword: ""
201
+ }, M = n ? Me : qe, K = n ? "update" : "create", X = () => {
202
+ var h = window.location.origin + "/api/ExportDataUser/" + n;
203
+ window.open(h);
204
+ }, Z = async (h) => {
205
+ var l = {
206
+ email: h
207
+ };
208
+ O(l);
209
+ };
210
+ return /* @__PURE__ */ e(
211
+ ae,
212
+ {
213
+ initialValues: z,
214
+ enableReinitialize: !0,
215
+ validationSchema: ke,
216
+ onSubmit: (h) => {
217
+ H({
218
+ ...h,
219
+ roles: h.roles.includes(P.EDUTEACHER) ? ["EduTeacher"] : h.roles
220
+ }), G(!1), localStorage.getItem(window.location.href) && localStorage.removeItem(window.location.href);
221
+ },
222
+ children: (h) => {
223
+ const {
224
+ values: l,
225
+ touched: o,
226
+ errors: r,
227
+ setFieldValue: c,
228
+ handleChange: m,
229
+ handleBlur: t,
230
+ handleSubmit: g
231
+ } = h, S = B(
232
+ (a) => {
233
+ if (l.roles.includes(a)) {
234
+ c(
235
+ "roles",
236
+ l.roles.filter((p) => p !== a)
237
+ );
238
+ return;
239
+ }
240
+ if ([P.STUDENT, P.PARENT, P.EDUTEACHER].includes(
241
+ a
242
+ )) {
243
+ c("roles", [a]);
244
+ return;
245
+ }
246
+ if (l.roles.includes(
247
+ P.EDUTEACHER
248
+ ) && P.EDUTEACHER != a) {
249
+ c("roles", [a]);
250
+ return;
251
+ }
252
+ c("roles", [...l.roles, a]);
253
+ },
254
+ [l.roles]
255
+ );
256
+ return /* @__PURE__ */ d("div", { className: `animated fadeIn detail-buttons-padding ${i[W]}`, children: [
257
+ /* @__PURE__ */ e(be, { when: j }),
258
+ /* @__PURE__ */ e("h5", { className: `mb-2 ${i["custom-title-font-size"]}`, children: s(M) }),
259
+ /* @__PURE__ */ d(E, { className: `pt-2 ${i["custom-font-size"]}`, children: [
260
+ /* @__PURE__ */ d(u, { md: 8, children: [
261
+ /* @__PURE__ */ d(E, { children: [
262
+ /* @__PURE__ */ e(u, { md: 6, children: /* @__PURE__ */ d(y, { children: [
263
+ /* @__PURE__ */ e(C, { className: ` ${i["custom-font-size"]}`, text: s("first_name") }),
264
+ /* @__PURE__ */ e(
265
+ N,
266
+ {
267
+ name: "firstName",
268
+ value: l.firstName,
269
+ onChange: (a) => {
270
+ m(a), f();
271
+ },
272
+ onBlur: t("subject"),
273
+ placeholder: s("first_name"),
274
+ className: ` ${i["custom-font-size"]}`
275
+ }
276
+ ),
277
+ o.firstName && r.firstName && /* @__PURE__ */ e(
278
+ D,
279
+ {
280
+ text: r.firstName
281
+ }
282
+ )
283
+ ] }) }),
284
+ /* @__PURE__ */ e(u, { md: 6, children: /* @__PURE__ */ d(y, { children: [
285
+ /* @__PURE__ */ e(C, { className: ` ${i["custom-font-size"]}`, text: s("date_of_birth") }),
286
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
287
+ we,
288
+ {
289
+ value: l.dateOfBirth,
290
+ todayButton: "Today",
291
+ peekNextMonth: !0,
292
+ showMonthDropdown: !0,
293
+ showYearDropdown: !0,
294
+ dropdownMode: "select",
295
+ selected: l.dateOfBirth ? $e(
296
+ new Date(
297
+ l.dateOfBirth
298
+ )
299
+ ) : null,
300
+ onChange: (a) => {
301
+ h.setFieldValue(
302
+ "dateOfBirth",
303
+ oe(
304
+ a,
305
+ le
306
+ )
307
+ ), f();
308
+ },
309
+ placeholderText: s("date_of_birth"),
310
+ customInput: /* @__PURE__ */ e(
311
+ N,
312
+ {
313
+ type: "text",
314
+ style: {
315
+ width: "maxContent"
316
+ },
317
+ placeholder: s("date_of_birth"),
318
+ className: ` ${i["custom-font-size"]}`
319
+ }
320
+ )
321
+ }
322
+ ) }),
323
+ o.dateOfBirth && r.dateOfBirth && /* @__PURE__ */ e(
324
+ D,
325
+ {
326
+ text: r.dateOfBirth
327
+ }
328
+ )
329
+ ] }) })
330
+ ] }),
331
+ /* @__PURE__ */ d(E, { children: [
332
+ /* @__PURE__ */ e(u, { md: 6, children: /* @__PURE__ */ d(y, { children: [
333
+ /* @__PURE__ */ e(C, { className: ` ${i["custom-font-size"]}`, text: s("last_name") }),
334
+ /* @__PURE__ */ e(
335
+ N,
336
+ {
337
+ name: "lastName",
338
+ value: l.lastName,
339
+ onChange: (a) => {
340
+ m(a), f();
341
+ },
342
+ onBlur: t("lastName"),
343
+ placeholder: s("last_name"),
344
+ className: ` ${i["custom-font-size"]}`
345
+ }
346
+ ),
347
+ o.lastName && r.lastName && /* @__PURE__ */ e(
348
+ D,
349
+ {
350
+ text: r.lastName
351
+ }
352
+ )
353
+ ] }) }),
354
+ /* @__PURE__ */ e(u, { md: 6, children: /* @__PURE__ */ d(y, { children: [
355
+ /* @__PURE__ */ e(C, { className: ` ${i["custom-font-size"]}`, text: s("roles") }),
356
+ /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(
357
+ u,
358
+ {
359
+ md: 12,
360
+ className: "d-flex flex-wrap align-items-center",
361
+ children: Te.map(
362
+ (a) => /* @__PURE__ */ e(
363
+ "div",
364
+ {
365
+ className: "mr-3",
366
+ children: /* @__PURE__ */ e(
367
+ N,
368
+ {
369
+ type: "checkbox",
370
+ id: `role-checkbox-${a}`,
371
+ label: a,
372
+ checked: l.roles.includes(
373
+ a
374
+ ),
375
+ onChange: () => {
376
+ S(
377
+ a
378
+ ), f();
379
+ },
380
+ disabled: n ? T.concat(["Student", "Parent", "General ED teacher"]).includes(a) || T.every(V) : [
381
+ "Parent"
382
+ ].includes(
383
+ a
384
+ ),
385
+ className: ` ${i["custom-font-size"]}`
386
+ }
387
+ )
388
+ },
389
+ a
390
+ )
391
+ )
392
+ }
393
+ ) }),
394
+ o.roles && r.roles && /* @__PURE__ */ e(
395
+ D,
396
+ {
397
+ text: r.roles
398
+ }
399
+ )
400
+ ] }) })
401
+ ] }),
402
+ /* @__PURE__ */ d(E, { children: [
403
+ /* @__PURE__ */ e(u, { md: 6, children: /* @__PURE__ */ d(y, { children: [
404
+ /* @__PURE__ */ e(C, { className: ` ${i["custom-font-size"]}`, text: s("email") }),
405
+ /* @__PURE__ */ e(
406
+ N,
407
+ {
408
+ name: "email",
409
+ value: l.email,
410
+ onChange: (a) => {
411
+ m(a), f();
412
+ },
413
+ onBlur: t("email"),
414
+ placeholder: s("email"),
415
+ className: ` ${i["custom-font-size"]}`
416
+ }
417
+ ),
418
+ o.email && r.email && /* @__PURE__ */ e(
419
+ D,
420
+ {
421
+ text: r.email
422
+ }
423
+ )
424
+ ] }) }),
425
+ /* @__PURE__ */ e(u, { md: 6, children: /* @__PURE__ */ d(y, { children: [
426
+ /* @__PURE__ */ e(C, { text: s("status"), className: ` ${i["custom-font-size"]}` }),
427
+ /* @__PURE__ */ d(E, { children: [
428
+ /* @__PURE__ */ e(u, { md: 3, children: /* @__PURE__ */ e(
429
+ N,
430
+ {
431
+ id: "role-checkbox-active",
432
+ type: "radio",
433
+ name: "active",
434
+ label: s("active"),
435
+ checked: !!l && !!l.isActive,
436
+ onChange: () => {
437
+ c(
438
+ "isActive",
439
+ !0
440
+ ), f();
441
+ },
442
+ className: ` ${i["custom-font-size"]}`
443
+ }
444
+ ) }),
445
+ /* @__PURE__ */ e(u, { md: 3, children: /* @__PURE__ */ e(
446
+ N,
447
+ {
448
+ id: "role-checkbox-inActive",
449
+ type: "radio",
450
+ name: "active",
451
+ label: s("inactive"),
452
+ checked: !!l && !l.isActive,
453
+ onChange: () => c(
454
+ "isActive",
455
+ !1
456
+ ),
457
+ className: ` ${i["custom-font-size"]}`
458
+ }
459
+ ) })
460
+ ] })
461
+ ] }) })
462
+ ] }),
463
+ !!n && /* @__PURE__ */ d(E, { children: [
464
+ /* @__PURE__ */ e(u, { md: 6 }),
465
+ /* @__PURE__ */ d(u, { md: 6, children: [
466
+ /* @__PURE__ */ e(
467
+ A,
468
+ {
469
+ color: "primary",
470
+ className: `w-100 ${i["custom-font-size"]}`,
471
+ onClick: () => {
472
+ Z(l.email || "");
473
+ },
474
+ children: s("send_forgot_password_link")
475
+ }
476
+ ),
477
+ /* @__PURE__ */ e(
478
+ A,
479
+ {
480
+ className: `w-100 mt-3 ${i["custom-font-size"]}`,
481
+ color: "success",
482
+ onClick: () => {
483
+ X();
484
+ },
485
+ children: s("download_user_data")
486
+ }
487
+ )
488
+ ] })
489
+ ] })
490
+ ] }),
491
+ /* @__PURE__ */ e(u, { md: 4, children: /* @__PURE__ */ e(E, { children: /* @__PURE__ */ d(u, { md: 8, children: [
492
+ /* @__PURE__ */ e(
493
+ Se,
494
+ {
495
+ setFile: k,
496
+ fileName: l.profileImageFileName,
497
+ onAddImage: f,
498
+ canDelete: !0,
499
+ onDelete: () => {
500
+ k(null), c(
501
+ "profileImageFileName",
502
+ ""
503
+ ), f();
504
+ }
505
+ }
506
+ ),
507
+ !b && !l.profileImageFileName && /* @__PURE__ */ e(
508
+ "img",
509
+ {
510
+ src: _e,
511
+ style: { maxWidth: "100%" }
512
+ }
513
+ )
514
+ ] }) }) })
515
+ ] }),
516
+ I.id === n ? /* @__PURE__ */ d("div", { children: [
517
+ /* @__PURE__ */ e("h5", { className: "mt-3", children: s(Le) }),
518
+ /* @__PURE__ */ e(
519
+ ae,
520
+ {
521
+ initialValues: J,
522
+ enableReinitialize: !0,
523
+ validationSchema: Oe,
524
+ onSubmit: (a) => {
525
+ Q(a);
526
+ },
527
+ children: (a) => {
528
+ const {
529
+ values: p,
530
+ touched: U,
531
+ errors: _,
532
+ handleChange: ee,
533
+ handleSubmit: ie
534
+ } = a;
535
+ return /* @__PURE__ */ d(E, { className: "pt-2 pb-5", children: [
536
+ /* @__PURE__ */ e(u, { md: 7, children: /* @__PURE__ */ d(y, { children: [
537
+ /* @__PURE__ */ e(C, { className: ` ${i["custom-font-size"]}`, text: s("current_password") }),
538
+ /* @__PURE__ */ e(
539
+ N,
540
+ {
541
+ name: "oldPassword",
542
+ type: "password",
543
+ value: p.oldPassword,
544
+ onChange: (F) => {
545
+ ee(F), f();
546
+ },
547
+ onBlur: t(
548
+ "subject"
549
+ ),
550
+ placeholder: s("current_password"),
551
+ className: ` ${i["custom-font-size"]}`
552
+ }
553
+ ),
554
+ U.oldPassword && _.oldPassword && /* @__PURE__ */ e(
555
+ D,
556
+ {
557
+ text: _.oldPassword
558
+ }
559
+ )
560
+ ] }) }),
561
+ /* @__PURE__ */ e(u, { md: 7, children: /* @__PURE__ */ d(y, { children: [
562
+ /* @__PURE__ */ e(C, { text: s("new_password"), className: ` ${i["custom-font-size"]}` }),
563
+ /* @__PURE__ */ e(
564
+ N,
565
+ {
566
+ name: "newPassword",
567
+ type: "password",
568
+ value: p.newPassword,
569
+ onChange: (F) => {
570
+ ee(F), f();
571
+ },
572
+ onBlur: t(
573
+ "subject"
574
+ ),
575
+ placeholder: s("new_password"),
576
+ className: ` ${i["custom-font-size"]}`
577
+ }
578
+ ),
579
+ U.newPassword && _.newPassword && /* @__PURE__ */ e(
580
+ D,
581
+ {
582
+ text: _.newPassword
583
+ }
584
+ )
585
+ ] }) }),
586
+ /* @__PURE__ */ e(u, { md: 7, children: /* @__PURE__ */ d(y, { children: [
587
+ /* @__PURE__ */ e(C, { text: s("confirm_password"), className: ` ${i["custom-font-size"]}` }),
588
+ /* @__PURE__ */ e(
589
+ N,
590
+ {
591
+ name: "confirmedNewPassword",
592
+ type: "password",
593
+ value: p.confirmedNewPassword,
594
+ onChange: (F) => {
595
+ ee(F), f();
596
+ },
597
+ onBlur: t(
598
+ "subject"
599
+ ),
600
+ placeholder: s("confirm_password"),
601
+ className: ` ${i["custom-font-size"]}`
602
+ }
603
+ ),
604
+ U.confirmedNewPassword && _.confirmedNewPassword && /* @__PURE__ */ e(
605
+ D,
606
+ {
607
+ text: _.confirmedNewPassword
608
+ }
609
+ )
610
+ ] }) }),
611
+ /* @__PURE__ */ e(u, { md: 12, children: /* @__PURE__ */ e(
612
+ A,
613
+ {
614
+ color: "primary",
615
+ size: "sm",
616
+ className: `px-4 pl-1 mr-2 ml-3 ${i["custom-font-size"]}`,
617
+ onClick: () => ie(),
618
+ children: s("save")
619
+ }
620
+ ) })
621
+ ] });
622
+ }
623
+ }
624
+ )
625
+ ] }) : null,
626
+ /* @__PURE__ */ e(
627
+ Re,
628
+ {
629
+ confirmText: K,
630
+ onConfirm: l.roles.includes(P.STUDENT) && !n ? $ : g,
631
+ onCancel: L,
632
+ className: ` ${i["custom-font-size"]}`
633
+ }
634
+ ),
635
+ /* @__PURE__ */ d(ue, { centered: !0, isOpen: Y, toggle: () => $(), children: [
636
+ /* @__PURE__ */ e(he, { children: "Assign Teacher" }),
637
+ /* @__PURE__ */ e(fe, { children: /* @__PURE__ */ e(
638
+ xe,
639
+ {
640
+ value: q.filter((a) => {
641
+ var p;
642
+ return (p = l.teacherUserId) == null ? void 0 : p.includes(a.value);
643
+ }) || null,
644
+ options: q,
645
+ placeholder: s("select_teacher"),
646
+ className: "flex-grow-1 mb-3",
647
+ onChange: (a) => c(
648
+ "teacherUserId",
649
+ [a.value]
650
+ )
651
+ }
652
+ ) }),
653
+ /* @__PURE__ */ d(pe, { className: "text-right", children: [
654
+ /* @__PURE__ */ e(A, { onClick: () => $(), children: "Cancel" }),
655
+ /* @__PURE__ */ e(A, { disabled: !l.teacherUserId, color: "primary", onClick: () => g(), children: "Assign" })
656
+ ] })
657
+ ] })
658
+ ] });
659
+ }
660
+ }
661
+ );
662
+ };
663
+ export {
664
+ es as default
665
+ };