mario-core 2.0.97-release → 2.0.98-release

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/Dashboard-D2zLzwFR.mjs +206 -0
  2. package/dist/Dashboard-dOwpd3sn.js +1 -0
  3. package/dist/EmailTemplateDetail-D07dUCZL.js +1 -0
  4. package/dist/EmailTemplateDetail-uNlh3Otz.mjs +443 -0
  5. package/dist/EmailTemplateList-B5ee4Byb.js +1 -0
  6. package/dist/EmailTemplateList-EZ_sAp6W.mjs +170 -0
  7. package/dist/GalleryList-CdyApn-m.mjs +329 -0
  8. package/dist/GalleryList-DFuoYp_Q.js +1 -0
  9. package/dist/Login-8c69l-hn.js +1 -0
  10. package/dist/Login-MzPc2sA6.mjs +1684 -0
  11. package/dist/NotificationList-BP871ggG.mjs +3982 -0
  12. package/dist/NotificationList-CzX65qMV.js +2 -0
  13. package/dist/SkillList-C-aJeufd.mjs +386 -0
  14. package/dist/SkillList-hMvqDcsQ.js +1 -0
  15. package/dist/TeacherSelector-CV9c0Cn8.js +1 -0
  16. package/dist/TeacherSelector-XuYxdZgr.mjs +30 -0
  17. package/dist/TheContent-BfT4R2Gc.mjs +38 -0
  18. package/dist/TheContent-BicDxizL.js +1 -0
  19. package/dist/UserContainer-DR6lGYNl.js +5 -0
  20. package/dist/UserContainer-Ip-sYnrv.mjs +2902 -0
  21. package/dist/UserDetail-iw6l5L3a.mjs +903 -0
  22. package/dist/UserDetail-uR6dMDOB.js +1 -0
  23. package/dist/UserList-DLC9FDWG.mjs +1252 -0
  24. package/dist/UserList-DUiZTiTR.js +7 -0
  25. package/dist/constants-DUelcmx7.js +1 -0
  26. package/dist/constants-QjFnVl1d.mjs +286 -0
  27. package/dist/index--POWjYN0.mjs +19073 -0
  28. package/dist/index-KWXe_Hjz.js +15 -0
  29. package/dist/index.js +1 -1
  30. package/dist/index.modern.js +1 -1
  31. package/dist/mailCategoryService-B9Yboyna.mjs +11 -0
  32. package/dist/mailCategoryService-DAw3X_PE.js +1 -0
  33. package/dist/services/userService.d.ts +1 -0
  34. package/dist/userService-DEwtByu1.js +1 -0
  35. package/dist/userService-DxucAe6U.mjs +56 -0
  36. package/package.json +1 -1
@@ -0,0 +1,7 @@
1
+ "use strict";const t=require("react/jsx-runtime"),N=require("reactstrap"),z=require("./userService-DEwtByu1.js"),Y=require("react-i18next"),u=require("react"),H=require("react-redux"),ie=require("react-router-dom"),s=require("./index-KWXe_Hjz.js"),F=require("./constants-DUelcmx7.js"),fe=require("./types-CTFcZUFS.js"),ae=require("date-fns"),re=require("papaparse");function ye(e,n){z.requiredArgs(2,arguments);var m=z.toDate(e),l=z.toDate(n);return m.getFullYear()-l.getFullYear()}const Se=()=>{const[e,n]=u.useState(F.DEFAULT_FILTER);return{filters:e,setFilters:n,changeFilters:l=>{const v={...e,...l};v.searchString&&l.searchString&&l.searchString!=e.searchString&&(v.currentPage=1),n(v)}}},xe="/admin/user",ve="/admin/create-user",Ce="User list",W="/home",be="/home",Ee="/admin/home",je="/parent",Ne="/admin/schools",_e="/list-student",Ae=()=>{const e=ie.useNavigate(),m=new URLSearchParams(location.search).get("query"),l=H.useSelector(a=>a.users.userList),v=H.useSelector(a=>a.users.totalItems),{filters:S,changeFilters:o}=Se(),x=m||"",[f,E]=u.useState([]),i=window.location.host.includes("-district"),c=H.useDispatch(),{t:p}=Y.useTranslation(),w=a=>{const y=f.find(g=>g==a);E(y?f.filter(g=>g!=a):f.concat([a]))},_=u.useMemo(()=>(l||[]).length>0&&(l||[]).every(a=>f.includes(a.id)),[l,f]),I=u.useCallback(()=>{if(_){const y=new Set((l||[]).map(g=>g.id));E(g=>g.filter(r=>!y.has(r)));return}const a=(l||[]).map(y=>y.id).filter(y=>!f.includes(y));E(y=>[...y,...a])},[l,_,f]),j=u.useCallback(async()=>{if(S.searchBy!==void 0&&S.searchByStrings!==void 0&&S.searchByStrings.length===0){c(s.setUserList({userList:[],totalItems:0}));return}c(s.setLoading(!0));try{const a=await z.getRosterUser(S),{items:y,totalItems:g}=a.data;for(const r of y)r.roles=r.roles.map(h=>h!=s.ROLES.EDUTEACHER?h:"EduTeacher"),r.msRoles&&(r.msRoles=r.msRoles.map(h=>h!=s.ROLES.EDUTEACHER?h:"EduTeacher")),r.esRoles&&(r.esRoles=r.esRoles.map(h=>h!=s.ROLES.EDUTEACHER?h:"EduTeacher"));c(s.setUserList({userList:y,totalItems:g}))}catch(a){c(s.setAlert({type:"danger",message:a.response?.data?.title||a.message}))}c(s.setLoading(!1))},[c,S]),C=async()=>{c(s.setLoading(!0));try{const y=(await z.triggerAllRosterSyncApi()).data?.message||p("sync_roster_running_in_background","Roster synchronization is currently running in the background. Please wait a few moments before refreshing the page.");c(s.setModal({isOpen:!0,type:"success",message:y}))}catch(a){c(s.setModal({isOpen:!0,type:"danger",message:a.response?.data?.message||a.response?.data?.title||a.message}))}c(s.setLoading(!1))},b=a=>{if(!a)return"";const y=[],{sourcedId:g,rosterUser:r}=a;if(g&&r&&y.push(g),r){const{givenName:h,middleName:O,familyName:R,email:D}=r,$=[];R&&$.push(R),O&&$.push(O),h&&$.push(h),y.push($.join(" ")||""),y.push(D||"")}return y.join(" / ")};u.useEffect(()=>{document.title=Ce},[]),u.useEffect(()=>{o({...S,searchString:x})},[x]),u.useEffect(()=>{j()},[JSON.stringify(S)]);const A=u.useCallback(a=>{c(s.setModal({isOpen:!0,type:"warning",message:p("do_you_want_to_remove_this_user"),onConfirm:async()=>{c(s.setLoading(!0));try{await z.remove(a),c(s.setAlert({type:"success",message:"Remove user successfully"})),S.currentPage!==1?o({currentPage:1}):j()}catch(y){c(s.setAlert({type:"danger",message:y.response?.data?.title||y.message}))}c(s.setLoading(!1))}}))},[JSON.stringify(S)]),k=[{role:"Admin",path:Ee},{role:"Teacher",path:W},{role:"Assistant",path:W},{role:"Student",path:be},{role:"Parent",path:je},{role:"EduTeacher",path:_e},{role:"Counselor",path:W},{role:"SecondaryTeacher",path:W}],T=a=>{const y=sessionStorage.getItem(s.IS_USER_SESSION_BROWSER),g=a.data?.token;let r=a.data.msRoles||[],h=a.data.esRoles||[];const O=a.data.roles||a.data.userRoles||[],R=(a.data.appType||"").toUpperCase();r.length===0&&h.length===0&&O.length>0&&(R.includes("ES")&&!R.includes("MS")?h=O:R.includes("MS")&&!R.includes("ES")?r=O:(r=O,h=O));let D="MS",$="/home",U=!1;for(const{role:V,path:J}of k){const G=r.includes(V),q=h.includes(V);if(!(!G&&!q)){D=G?"MS":"ES",$=J,U=!0;break}}U||(D=r.length>0?"MS":h.length>0?"ES":"MS");const B=D==="ES"?h:r;y?sessionStorage.setItem(s.ACCESS_TOKEN,g):localStorage.setItem(s.ACCESS_TOKEN,g),B.includes("Admin")?localStorage.setItem("ROLES","Admin"):B.length>0&&localStorage.setItem("ROLES",B.toString()),localStorage.removeItem(s.NOTIFICATION_ALERT_KEY),i&&($=Ne);const P=D==="ES"&&!B.includes("Admin")?`/es${$}`:$;window.location.href=P},L=u.useCallback(async a=>{try{const g=(await z.switchAccountUser(a)).data;c(s.setModal({isOpen:!0,type:"warning",message:p("do_you_want_to_impersonate_this_user"),onConfirm:async()=>{c(s.setLoading(!0));try{const r={email:g.email,password:"default",accessToken:g.token,loginType:fe.LoginType.Impersonate},h=await s.logIn(r),O={};for(let R=0;R<localStorage.length;R++){const D=localStorage.key(R);D&&(D==="SELECTED_TIER"||D.startsWith("SELECTED_TIER_"))&&(O[D]=localStorage.getItem(D)||"")}localStorage.clear(),Object.keys(O).forEach(R=>{localStorage.setItem(R,O[R])}),T(h)}catch(r){s.setAlert({type:"danger",message:r.response?.data?.title||r.message})}c(s.setLoading(!1))}}))}catch(y){c(s.setAlert({type:"danger",message:y.response?.data?.title||y.message}))}},[S]);return{userList:l,totalItems:v,filters:S,queryName:m,fullName:x,getData:j,removeData:A,changeFilters:o,reDirectDetailPage:a=>{const y=a?`${xe}/${a}`:ve;e(y)},switchUser:L,handleSyncRosterUsers:C,rosterUserInfo:b,userIds:f,onSelectAllUser:I,onSelectUser:w,isCheckAll:_}},Re={fontWeight:500},Ie={height:38,background:"#316cd9"},Le=({text:e,onClick:n,className:m=""})=>t.jsxs(N.Button,{onClick:n,color:"primary",style:Ie,className:`d-flex align-items-center ${m} gap-2`,children:[t.jsx(s.FaSyncAlt,{}),t.jsx("span",{style:Re,children:e})]});function Oe(e){return s.GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M21 3H5a1 1 0 0 0-1 1v2.59c0 .523.213 1.037.583 1.407L10 13.414V21a1.001 1.001 0 0 0 1.447.895l4-2c.339-.17.553-.516.553-.895v-5.586l5.417-5.417c.37-.37.583-.884.583-1.407V4a1 1 0 0 0-1-1zm-6.707 9.293A.996.996 0 0 0 14 13v5.382l-2 1V13a.996.996 0 0 0-.293-.707L6 6.59V5h14.001l.002 1.583-5.71 5.71z"}}]})(e)}function we(e){return s.GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.023 16.977a35.13 35.13 0 0 1-1.367-1.384c-.372-.378-.596-.653-.596-.653l-2.8-1.337A6.962 6.962 0 0 0 16 9c0-3.859-3.14-7-7-7S2 5.141 2 9s3.14 7 7 7c1.763 0 3.37-.66 4.603-1.739l1.337 2.8s.275.224.653.596c.387.363.896.854 1.384 1.367l1.358 1.392.604.646 2.121-2.121-.646-.604c-.379-.372-.885-.866-1.391-1.36zM9 14c-2.757 0-5-2.243-5-5s2.243-5 5-5 5 2.243 5 5-2.243 5-5 5z"}}]})(e)}function Te(e){return s.GenIcon({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z",clipRule:"evenodd"}}]})(e)}function Ue(e){return s.GenIcon({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M505.7 661a8 8 0 0 0 12.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]})(e)}function de(e){return s.GenIcon({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M839.6 433.8L749 150.5a9.24 9.24 0 0 0-8.9-6.5h-77.4c-4.1 0-7.6 2.6-8.9 6.5l-91.3 283.3c-.3.9-.5 1.9-.5 2.9 0 5.1 4.2 9.3 9.3 9.3h56.4c4.2 0 7.8-2.8 9-6.8l17.5-61.6h89l17.3 61.5c1.1 4 4.8 6.8 9 6.8h61.2c1 0 1.9-.1 2.8-.4 2.4-.8 4.3-2.4 5.5-4.6 1.1-2.2 1.3-4.7.6-7.1zM663.3 325.5l32.8-116.9h6.3l32.1 116.9h-71.2zm143.5 492.9H677.2v-.4l132.6-188.9c1.1-1.6 1.7-3.4 1.7-5.4v-36.4c0-5.1-4.2-9.3-9.3-9.3h-204c-5.1 0-9.3 4.2-9.3 9.3v43c0 5.1 4.2 9.3 9.3 9.3h122.6v.4L587.7 828.9a9.35 9.35 0 0 0-1.7 5.4v36.4c0 5.1 4.2 9.3 9.3 9.3h211.4c5.1 0 9.3-4.2 9.3-9.3v-43a9.2 9.2 0 0 0-9.2-9.3zM416 702h-76V172c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v530h-76c-6.7 0-10.5 7.8-6.3 13l112 141.9a8 8 0 0 0 12.6 0l112-141.9c4.1-5.2.4-13-6.3-13z"}}]})(e)}function ue(e){return s.GenIcon({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M839.6 433.8L749 150.5a9.24 9.24 0 0 0-8.9-6.5h-77.4c-4.1 0-7.6 2.6-8.9 6.5l-91.3 283.3c-.3.9-.5 1.9-.5 2.9 0 5.1 4.2 9.3 9.3 9.3h56.4c4.2 0 7.8-2.8 9-6.8l17.5-61.6h89l17.3 61.5c1.1 4 4.8 6.8 9 6.8h61.2c1 0 1.9-.1 2.8-.4 2.4-.8 4.3-2.4 5.5-4.6 1.1-2.2 1.3-4.7.6-7.1zM663.3 325.5l32.8-116.9h6.3l32.1 116.9h-71.2zm143.5 492.9H677.2v-.4l132.6-188.9c1.1-1.6 1.7-3.4 1.7-5.4v-36.4c0-5.1-4.2-9.3-9.3-9.3h-204c-5.1 0-9.3 4.2-9.3 9.3v43c0 5.1 4.2 9.3 9.3 9.3h122.6v.4L587.7 828.9a9.35 9.35 0 0 0-1.7 5.4v36.4c0 5.1 4.2 9.3 9.3 9.3h211.4c5.1 0 9.3-4.2 9.3-9.3v-43a9.2 9.2 0 0 0-9.2-9.3zM310.3 167.1a8 8 0 0 0-12.6 0L185.7 309c-4.2 5.3-.4 13 6.3 13h76v530c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V322h76c6.7 0 10.5-7.8 6.3-13l-112-141.9z"}}]})(e)}const Be=(e,n)=>{u.useEffect(()=>{function m(l){e.current&&!e.current.contains(l.target)&&n?.()}return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m)}},[e.current])},ke=e=>{const{isOpen:n,sortBy:m,filters:l,users:v,searchBy:S,defaultOptions:o,selectedOptions:x,searchKey:f,onChangeSearchKey:E,onOptionsChange:i,onSearch:c,onClose:p,onChangeFilters:w,getOption:_}=e,[I,j]=u.useState(),[C,b]=u.useState([]),A=u.useRef(null),k=u.useRef(null);Be(A,p);const{t:T}=Y.useTranslation(),L=u.useCallback(()=>{if(!n)return;const U=f?.trim?.()??"";S!=null&&!o&&c?.(U,S),S!=null&&o&&b(o.filter(B=>B.label.toLowerCase().includes(U.toLowerCase())))},[S,f,JSON.stringify(o),n]),d=()=>{k.current&&clearTimeout(k.current),k.current=setTimeout(L,500)},a=U=>{const B=U.target.value;E(B)},y=u.useCallback(()=>{i?.(I,S),p?.()},[JSON.stringify(I)]),g=u.useCallback(U=>{const B=U.target.value??"";let P=I??[],V=P.indexOf(B);V>-1?P.splice(V,1):P=[...P,B],j(P==null?P:[...P])},[JSON.stringify(I)]),r=u.useCallback(U=>{const B=U.target.checked;j(B?void 0:[])},[]),h=u.useCallback(()=>{w?.({...l,sortBy:m,isDescending:!0}),p?.()},[JSON.stringify(l),S]),O=u.useCallback(()=>{w?.({...l,sortBy:m,isDescending:!1}),p?.()},[JSON.stringify(l),S]),R=u.useMemo(()=>_?v.map(U=>_(U,T)):[],[JSON.stringify(v),JSON.stringify(_)]),D=l?.isDescending==!1&&l.sortBy===m,$=!!l?.isDescending&&l.sortBy===m;return u.useEffect(()=>{l?.searchBy!==S?j(void 0):j(x)},[JSON.stringify(x),l?.searchBy]),u.useEffect(()=>{b(o||[])},[JSON.stringify(o)]),u.useEffect(()=>{d()},[f,n]),{ref:A,options:R,inputRef:k,sOptions:I,isAscending:D,isDescending:$,filteredOptions:C,searchKey:f,handleSearch:L,handleApplyFilter:y,handleOptionSelected:g,handleOptionSelectedAll:r,handleSortDesc:h,handleSortAsc:O,handleChangeSearchKey:a}},De=e=>{const{defaultOptions:n,onClose:m,getOption:l}=e,{ref:v,inputRef:S,options:o,sOptions:x,isAscending:f,isDescending:E,filteredOptions:i,searchKey:c,handleChangeSearchKey:p,handleApplyFilter:w,handleOptionSelected:_,handleOptionSelectedAll:I,handleSortDesc:j,handleSortAsc:C}=ke(e);return t.jsx(N.Popover,{...e,hideArrow:!0,className:s.styles["popover-zindex"],children:t.jsx(N.PopoverBody,{className:"pb-3",children:t.jsxs("div",{ref:v,className:s.styles.popover,children:[t.jsxs("div",{className:`d-flex flex-column ${s.styles.popover__sort}`,children:[t.jsx(N.Label,{className:"font-weight-bold",children:"Sort"}),t.jsxs("div",{className:`px-1 ${s.styles.popover__sort__item} ${f&&s.styles["popover__sort__item--active"]}`,onClick:C,children:[t.jsx(de,{className:"mr-1"}),"Ascending"]}),t.jsxs("div",{className:`px-1 mt-1 ${s.styles.popover__sort__item} ${E&&s.styles["popover__sort__item--active"]}`,onClick:j,children:[t.jsx(ue,{className:"mr-1"}),"Descending"]})]}),(typeof l<"u"||!!n)&&t.jsxs(u.Fragment,{children:[t.jsx("div",{className:"border border-top-1 border-bottom-0 mx-1 my-2"}),t.jsxs("div",{className:"d-flex flex-column",children:[t.jsx(N.Label,{className:"font-weight-bold",children:"Filter"}),t.jsxs("div",{className:`position-relative px-1 ${s.styles.popover__search}`,children:[t.jsx(we,{className:`position-absolute ${s.styles.popover__search__icon}`}),t.jsx(N.Input,{ref:S,className:s.styles.popover__search__input,value:c,onChange:p})]}),t.jsxs("div",{className:`mx-1 mt-2 p-2 bg-light ${s.styles.popover__options}`,children:[t.jsxs(N.FormGroup,{className:"d-flex align-items-center",check:!0,style:{gap:"8px"},children:[t.jsx(N.Input,{type:"checkbox",onChange:I,checked:x==null})," ",t.jsx(N.Label,{check:!0,children:"(Select all)"})]}),!!l&&!n&&o.map(b=>t.jsxs(N.FormGroup,{className:"d-flex align-items-center",check:!0,style:{gap:"8px"},children:[t.jsx(N.Input,{type:"checkbox",value:b.value,onChange:_,checked:x?.includes(b.value)||x==null})," ",t.jsx(N.Label,{check:!0,children:b.label})]},b.value)),!!n&&i.map(b=>t.jsxs(N.FormGroup,{className:"d-flex align-items-center",check:!0,style:{gap:"8px"},children:[t.jsx(N.Input,{type:"checkbox",value:b.value,onChange:_,checked:x?.includes(b.value)||x==null})," ",t.jsx(N.Label,{check:!0,children:b.label})]},b.value))]})]}),t.jsxs("div",{className:"d-flex justify-content-end mt-3",style:{gap:"8px"},children:[t.jsx(N.Button,{color:"primary",className:"mr-2",size:"sm",onClick:w,children:"Apply Filter"}),t.jsx(N.Button,{color:"secondary",size:"sm",onClick:m,children:"Cancel"})]})]})]})})})},$e=({data:e,popoverId:n,filters:m,searchString:l,users:v,selectedOptions:S,onOptionsChange:o,onSearch:x,onChangeFilters:f,onOpenFilter:E,onClose:i,isCenter:c,isActive:p=!1})=>{const{t:w}=Y.useTranslation(),[_,I]=u.useState(""),j=u.useMemo(()=>e.sortBy!=null?F.userOrders[e.sortBy]:"",[e.sortBy]),C=u.useMemo(()=>n===j,[j,n]),b=()=>{E?.(j,e.searchBy,_,e.sortBy)},A=k=>{I(k)};return t.jsx("th",{className:e.className,children:j&&e.sortBy!==void 0?t.jsxs("div",{className:`w-100 d-flex ${c?"justify-content-center":"justify-content-between"} align-items-center ${s.styles["table-filter-icon"]}`,children:[w(e.name),t.jsxs("div",{className:"ml-2 p-1",id:j,onClick:b,style:{cursor:"pointer"},children:[e.sortBy!==void 0&&e.sortBy===m?.sortBy&&t.jsx("span",{children:m.isDescending?t.jsx(ue,{}):t.jsx(de,{})}),m?.searchByStrings?.length&&e.searchBy===m?.searchBy?t.jsx(Te,{color:p?"#007bff":"#242424"}):t.jsx(Oe,{color:p?"#007bff":"#242424"})]}),t.jsx(De,{placement:"bottom-end",target:j,users:v,isOpen:C,filters:m,sortBy:e.sortBy,searchKey:_,searchBy:e.searchBy,searchString:l,defaultOptions:e.options,selectedOptions:S,onClose:i,onSearch:x,getOption:e.getOption,onChangeFilters:f,onOptionsChange:o,onChangeSearchKey:A})]}):w(e.name)})},Fe=e=>{const{filters:n,onChangeFilters:m,isStudentFilter:l,teacherOptions:v,assistantOptions:S,counselorOptions:o,secondaryTeacherOptions:x}=e,[f,E]=u.useState(),[i,c]=u.useState([]),[p,w]=u.useState({...F.DEFAULT_FILTER_POPOVER,isDescending:n.isDescending,searchString:n.searchString}),_=H.useDispatch(),I=ie.useLocation(),j=u.useCallback(async T=>{try{const d=(l?await z.getStudentFilter(p):await z.getFilterRosterUser({...p,byStudent:T})).data?.items||[];c(d)}catch(L){_(s.setAlert({type:"danger",message:L.response?.data?.title||L.message}))}},[JSON.stringify(p),l]),C=u.useCallback((T,L,d,a)=>{E(T),w({...p,searchBy:L,searchStringBy:d,isDescending:n.sortBy===a?n.isDescending:void 0,searchString:n.searchString})},[JSON.stringify(p),n.isDescending,n.searchString]),b=()=>{E("")},A=u.useCallback((T,L)=>{w({...p,searchBy:L,searchStringBy:T})},[JSON.stringify(p)]),k=u.useCallback((T,L)=>{L&&m?.({...n,[F.SearchBy[L]]:T})},[JSON.stringify(n)]);return u.useEffect(()=>{if(!I.pathname.includes("users/assign-student"))return;const T=d=>d.sort((a,y)=>a.localeCompare(y)),L=p.searchStringBy?.toLowerCase()||"";if(p.searchBy===F.SearchBy.Grade)c(F.GRADE);else{let d=[];switch(p.searchBy){case F.SearchBy.Name:j(!0);break;case F.SearchBy.Teacher:d=v?.map(r=>r.label).filter(Boolean)||[];break;case F.SearchBy.Assistant:d=S?.map(r=>r.label).filter(Boolean)||[];break;case F.SearchBy.Counselor:d=o?.map(r=>r.label).filter(Boolean)||[];break;case F.SearchBy.SecondaryTeacher:d=x?.map(r=>r.label).filter(Boolean)||[];break}const a=Array.from(new Set(d)),y=L?a.filter(r=>r.toLowerCase().includes(L)):a,g=T(y);c(g)}},[JSON.stringify(p),v,S,o,x,I.pathname]),u.useEffect(()=>{!(I.pathname.includes("users/assign-student")&&p.searchBy!==void 0)&&p.searchBy!==void 0&&j()},[JSON.stringify(p),I.pathname]),{popoverFilters:p,popoverId:f,users:i,handleFilterIcon:C,handleCloseFilter:b,handleSearch:A,handleChangeFilters:k}},he=({headers:e,filters:n,onChangeFilters:m,isStudentFilter:l,teacherOptions:v=[],assistantOptions:S=[],counselorOptions:o=[],secondaryTeacherOptions:x=[]})=>{const{popoverId:f,users:E,handleFilterIcon:i,handleCloseFilter:c,handleSearch:p,handleChangeFilters:w}=Fe({filters:n,onChangeFilters:m,isStudentFilter:l,teacherOptions:v,assistantOptions:S,counselorOptions:o,secondaryTeacherOptions:x}),_=Object.entries(n).filter(([C,b])=>b!==""&&!(Array.isArray(b)&&b.length===0)&&b!==null&&b!==void 0).map(([C])=>C),I=Object.entries(F.SearchBy).filter(([C,b])=>isNaN(Number(C))),j=_.map(C=>I.find(([b])=>b===C)).filter(C=>!!C);return t.jsx("tr",{children:e.map(C=>C.onSelectAll?t.jsx("th",{className:`align-middle text-center ${C.className}`,children:t.jsx("input",{type:"checkbox",onChange:()=>C.onSelectAll?.(),checked:C.isCheckAll??!1})},C.name):t.jsx($e,{users:E,data:C,isCenter:C.isCenter,filters:n,popoverId:f,selectedOptions:n.searchByStrings,onSearch:p,onClose:c,onOpenFilter:i,onChangeFilters:m,onOptionsChange:w,isActive:typeof C.searchBy=="number"&&j.some(([b,A])=>A===C.searchBy)},C.name))})},Me=()=>{const e=H.useDispatch(),n=H.useSelector(x=>x?.common?.user?.schoolName)||"",m=async x=>{e(s.setLoading(!0));try{const f=await z.getRosterUserExport(x),E=f.data.items||f.data,i=l(E),c=document.createElement("a");c.href=i,c.download=`${n}_Users_Report.csv`,c.click()}catch(f){e(s.setAlert({type:"danger",message:f.response?.data?.title||f.message}))}e(s.setLoading(!1))},l=x=>{let f=`First Name,Last Name,Email,Phone,Age,Grade,Tiers,Role,Active Status,Create Time,Roster Sourced Id,Roster Status,Roster Family Name,Roster Middle Name,Roster Given Name,Roster Email,Roster Role,Roster Grades,Teachers,Assistants,Counselors,SupportTeachers,EduTeachers
2
+ `;const E=x.map(i=>{const c=i.dateOfBirth!==s.DATE_MIN_VALUE?ae.differenceInCalendarYears(new Date,ae.parseISO(i.dateOfBirth)):"";return`${o(i.firstName)},${o(i.lastName)},${o(i.email)},${o(i.phoneNumber)},${c},${o(i.grade)},${o(i.appType||"")},${o(i.roles.join(", ").replace("SecondaryTeacher","SupportTeacher"))},${i.isActive?"Active":"Inactive"},${s.formatLocalTime(i?.createTime,"yyyy-MM-dd HH:mm")},${o(i.sourcedId)},${o(i.rosterUser?.status)},${o(i.rosterUser?.familyName)},${o(i.rosterUser?.middleName)},${o(i.rosterUser?.givenName)},${o(i.rosterUser?.email)},${o(i.rosterUser?.role)},${o(i.rosterUser?.grades)},${o(i.teachers)},${o(i.assistants)},${o(i.counselors)},${o(i.supportTeachers)},${o(i.eduTeachers)}`}).join(`
3
+ `);return`${F.CSV_PREFIX}${f}${encodeURIComponent(E)}`},v=async x=>{e(s.setLoading(!0));try{const f=await z.getTeacherClassCodesExport(x),E=f?.data?.items||f?.data||[],i=S(E),c=document.createElement("a");c.href=i,c.download="Classcode.csv",c.click()}catch(f){e(s.setAlert({type:"danger",message:f.response?.data?.title||f.message}))}e(s.setLoading(!1))},S=x=>{let f=`Teacher name,Teacher Email,Teacher code
4
+ `;const c=(Array.isArray(x)?x:[]).filter(p=>p.roles&&p.roles.includes("Teacher")).map(p=>`${o(p.fullName)},${o(p.email)},${o(p?.assignCode||"")}`).join(`
5
+ `);return`${F.CSV_PREFIX}${f}${encodeURIComponent(c)}`},o=x=>x?`"${x.replace(/"/g,'""').replaceAll(/\n/g," ")}"`:"";return{exportUsers:m,exportClassCodes:v}},me=`${s.BASE_URL}/api/ImportCsv/csv`,X=`${s.BASE_URL}/api/Teacher`,Pe=(e,n)=>s.apiUpload.post(`${me}/${n}`,e),oe=e=>s.apiUpload.post(`${me}/importClassReflection`,e),ze=(e,n)=>s.apiUpload.post(`${X}/adminImportStudentByTeacherId/${e}`,n),He=e=>s.apiUpload.post(`${X}/adminImport`,e),Ve=(e=!0)=>s.api.get(`${X}/download-template-file-user?hasEsSchool=${e}`),Ge=(e,n,m=!0)=>s.apiUpload.post(`${X}/validate-csv-template-student/${n}?hasEsSchool=${m}`,e);var pe=(e=>(e.Students="students",e.Subjects="subjects",e.Grades="grades",e.Attendances="attendances",e.ClassReflection="classReflection",e.Others="others",e.AllUser="allUser",e))(pe||{});const Z="csvupload",ce={teacherName:"",teacherEmail:"",studentIds:[],file:""},qe=()=>{const e=H.useDispatch(),n=H.useSelector(g=>g.common.isLoading),[m,l]=u.useState(null),[v,S]=u.useState(),[o,x]=u.useState([]),[f,E]=u.useState(ce),[i,c]=u.useState(),p=window.location.hostname,w=p.includes("isb")||p.includes("stage"),[_,I]=u.useState(0),[j,C]=u.useState(""),b=async()=>{e(s.setLoading(!0));try{const h=await Ve();var g=new Blob([h.data.content],{type:"text/csv"});const O=window.URL.createObjectURL(g);var r=document.createElement("a");r.href=O,r.setAttribute("download",h.data.nameFile),r.click(),e(s.setAlert({type:"success",message:"Download successfully"}))}catch(h){e(s.setAlert({type:"danger",message:h.message}))}e(s.setLoading(!1))},A=u.useCallback(async g=>{if(!m||!g)return;e(s.setLoading(!0));try{const R=new FormData;if(R.append("file",g,g.name),m=="allUser"){let $=(await g.text()).trim();const U=$.split(`
6
+ `).map(M=>M.trim()),B=U.findIndex(M=>M.split(",").includes("FirstName"));if(B===0)throw new Error("Invalid CSV: Missing header row.");$=U.slice(B).join(`
7
+ `);const P=re.parse($,{header:!0,skipEmptyLines:!0}),V=P.meta.fields,J=P.data;if(!V)throw new Error("Unable to determine header from CSV file");const G=20,q=[];for(let M=0;M<J.length;M+=G){const Q=J.slice(M,M+G),K=re.unparse({fields:V,data:Q});q.push(K)}for(let M=0;M<q.length;M++){const Q=new Blob([q[M]],{type:"text/csv"}),K=new FormData;K.append("file",Q,`students_chunk${M+1}.csv`),await He(K)}}else w?m=="classReflection"&&await oe(R):await Pe(R,m.toString());e(s.setAlert({type:"success",message:"Import CSV successfully"}))}catch(R){e(s.setAlert({type:"danger",message:R.response?.data?.title||R.message}))}e(s.setLoading(!1));const r=document.getElementById(Z),h=document.getElementById("import-student"),O=document.getElementById("import-classReflection");r&&(r.value=""),h&&(h.value=""),O&&(O.value="")},[m]),k=async g=>{if(!_){e(s.setAlert({type:"danger",message:"Select teacher before import csv"}));return}if(!m||!g)return;e(s.setLoading(!0));try{const h=new FormData;h.append("file",g,g.name),await ze(_,h),e(s.setAlert({type:"success",message:"Import CSV successfully"}))}catch(h){e(s.setAlert({type:"danger",message:h.response?.data?.title||h.message}))}e(s.setLoading(!1));const r=document.getElementById("teacherSelector");r&&(r.value="")},T=async g=>{if(!v||!v)return;e(s.setLoading(!0));try{const h=new FormData;h.append("file",v,v.name),h.append("teacherName",g.teacherName),h.append("teacherEmail",g.teacherEmail),g.studentIds.forEach(O=>{h.append("studentIds",O)}),await oe(h),e(s.setAlert({type:"success",message:"Import CSV successfully"})),E(ce)}catch(h){e(s.setAlert({type:"danger",message:h.response?.data?.title||h.message}))}e(s.setLoading(!1));const r=document.getElementById(Z);r&&(r.value="")},L=g=>{I(g.value)},d=g=>{c(g),C(g?.name||"")},a=()=>{if(!i){e(s.setAlert({type:"danger",message:"Select CSV to import"}));return}k(i)};return{isLoading:n,id:Z,setType:l,upload:A,initImportReflection:f,setInitImportReflection:E,onConfirm:T,CSVType:pe,dataFile:v,setDataFile:S,setArrStudent:x,arrStudent:o,isCheckDomainIBS:w,onChangeTeacher:L,uploadByTeacherId:k,setDataFileImportStudent:d,onUpLoadStudentFile:a,defaultTeacher:_,fileName:j,onStudentSubmit:()=>{e(s.setModal({isOpen:!0,type:"warning",message:"Are you sure upload this file?",onConfirm:()=>{a()}}))},downloadTemplateUser:b}},Je=()=>{const e=H.useDispatch(),n=async v=>{e(s.setLoading(!0));try{await z.postRequestResendMail(v),e(s.setAlert({type:"success",message:"Send Successfully"}))}catch(S){e(s.setAlert({type:"danger",message:S.response?.data?.title||S.message}))}e(s.setLoading(!1))};return{handleSendMultiUsers:v=>{n({userIds:[...v]})},handleSendSingleUser:v=>{n({userIds:[v]})}}},ee={fontWeight:500},te={height:38,backgroundColor:"#2eb85c",borderColor:"#2eb85c"},Ke={display:"inline-block",fontSize:11,fontWeight:700,color:"#3b4ba8",backgroundColor:"#e9ecfb",borderRadius:4,padding:"1px 6px",marginRight:6,textTransform:"uppercase"},le=({label:e})=>t.jsx("span",{style:Ke,children:e}),se=({label:e})=>t.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:11,fontWeight:700,color:"#3b4ba8",backgroundColor:"#e9ecfb",borderRadius:4,padding:"3px 8px",textTransform:"uppercase"},children:e}),We=({isActive:e,t:n})=>t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",fontSize:12,fontWeight:600,color:e?"#047857":"#6b7280",backgroundColor:e?"#d1fae5":"#f3f4f6",borderRadius:"20px",padding:"4px 12px"},children:[t.jsx("span",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:e?"#10b981":"#9ca3af",marginRight:"8px"}}),n(e?"active":"inactive")]}),ne=e=>(e||[]).map(n=>n==="SecondaryTeacher"?"SupportTeacher":n).join(", "),Ye="user",ge=()=>{const{queryName:e,userList:n,totalItems:m,filters:l,fullName:v,removeData:S,changeFilters:o,reDirectDetailPage:x,switchUser:f,handleSyncRosterUsers:E,rosterUserInfo:i,onSelectUser:c,userIds:p,onSelectAllUser:w,isCheckAll:_}=Ae(),{handleSendMultiUsers:I}=Je(),{upload:j}=qe(),{exportUsers:C,exportClassCodes:b}=Me(),{t:A}=Y.useTranslation(),k=()=>C(l),T=()=>b(l),L=[{name:"",isCenter:!0,onSelectAll:w,isCheckAll:_}].concat(F.UserColumns);return t.jsxs("div",{className:`fadeIn animated h-100 ${s.screenWidth<=767?s.styles["p-0-12"]:""}`,children:[t.jsx("h5",{className:"mt-4 mb-2",children:A(`${Ye}`)}),t.jsxs(N.Row,{className:"my-2",children:[t.jsx(N.Col,{md:8,children:t.jsx(s.SearchBoxContainer,{text:A("create_user"),onClick:()=>x(),initValue:e||"",onSearch:d=>o({searchString:d}),placeholder:A("type_something_to_search_by_user_name")})}),t.jsxs(N.Col,{md:4,className:"d-flex justify-content-end align-items-center",children:[A("total_of_users")," : ",m]}),t.jsxs(N.Col,{md:12,className:"d-flex justify-content-end my-2 flex-wrap",style:{gap:"8px"},children:[t.jsx("button",{className:"btn btn-success d-flex align-items-center border-0",style:te,onClick:()=>I(p),children:t.jsx("p",{className:`${s.styles["button-content"]} mb-0`,style:ee,children:A("welcome_email_resend")})}),t.jsx(N.Input,{id:"import-user",className:"d-none",type:"file",onChange:d=>j(d.target.files[0]),accept:"text/csv"}),t.jsx(Le,{text:A("sync_roster_users"),onClick:E}),t.jsxs("button",{className:"btn btn-success d-flex align-items-center border-0 p-0",style:te,onClick:T,children:[t.jsx("div",{className:`${s.styles["button-icon"]}`,children:t.jsx("img",{src:"images/export-icon.svg",alt:""})}),t.jsx("p",{className:`${s.styles["button-content"]} mb-0`,style:ee,children:A("export_class_code_to_csv")})]}),t.jsxs("button",{className:"btn btn-success d-flex align-items-center border-0 p-0",style:te,onClick:k,children:[t.jsx("div",{className:`${s.styles["button-icon"]}`,children:t.jsx("img",{src:"images/export-icon.svg",alt:""})}),t.jsx("p",{className:`${s.styles["button-content"]} mb-0`,style:ee,children:A("export_to_csv")})]})]})]}),t.jsxs(N.Row,{className:"mb-2",children:[t.jsx(N.Col,{md:12,children:t.jsx("div",{style:{overflow:"auto"},children:t.jsxs(N.Table,{bordered:!0,hover:!0,striped:!0,size:"sm",children:[t.jsx("thead",{children:t.jsx(he,{headers:L,filters:l,fullName:v,onChangeFilters:o})}),t.jsxs("tbody",{children:[n&&n.length>0&&n.map(d=>{const a=(d.appType||"").toUpperCase(),y=a.includes("ES")&&a.includes("MS");return t.jsxs("tr",{children:[t.jsx("td",{className:"align-middle",children:t.jsx("input",{type:"checkbox",onChange:()=>c(d.id),checked:p.includes(d.id)??!1})}),t.jsx("td",{className:"align-middle",children:t.jsx(s.LinkEditButton,{label:`${d.fullName}`,onClick:()=>x(d.id)})}),t.jsx("td",{className:"align-middle",children:d.email}),t.jsx("td",{className:"align-middle",children:d.dateOfBirth!==s.DATE_MIN_VALUE&&ye(new Date,new Date(d.dateOfBirth))}),t.jsx("td",{className:"align-middle",children:y?t.jsxs(t.Fragment,{children:[t.jsxs("div",{children:[t.jsx(le,{label:"ES"}),ne(d.esRoles)]}),t.jsxs("div",{className:"mt-1",children:[t.jsx(le,{label:"MS"}),ne(d.msRoles)]})]}):!!d.roles&&ne(d.roles)}),t.jsx("td",{className:"align-middle text-uppercase",children:y?t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px",alignItems:"center",width:"fit-content"},children:[t.jsx(se,{label:"ES"}),t.jsx(se,{label:"MS"})]}):d.appType?t.jsx(se,{label:d.appType}):null}),t.jsx("td",{className:"align-middle",children:t.jsx(We,{isActive:d.isActive,t:A})}),t.jsx("td",{className:"align-middle",children:s.formatLocalTime(d?.createTime,"yyyy-MM-dd HH:mm")}),t.jsx("td",{children:i(d)}),t.jsx("td",{className:"align-middle",children:t.jsx(s.FaUsersCog,{style:{fontSize:"18px",margin:"0 10px",cursor:"pointer"},onClick:()=>f(d.id)})}),t.jsx("td",{className:"align-middle",style:{padding:"0 15px"},children:t.jsx(s.DeleteButtonIcon,{onClick:()=>S(d.id)})})]},`${d.id}_${d.appType||""}`)}),(!n||!n.length)&&t.jsx("tr",{children:t.jsx("td",{colSpan:12,className:"p-0",children:t.jsx(s.EmptyDataAlert,{className:"mb-0",label:A("user")})})})]})]})})}),t.jsx(N.Col,{md:12,children:t.jsx(s.CustomPagination,{filters:l,totalRecordCount:m,changePageSize:d=>o({pageSize:d}),changePage:d=>o({currentPage:d})})})]})]})},Xe=Object.freeze(Object.defineProperty({__proto__:null,default:ge},Symbol.toStringTag,{value:"Module"}));exports.AiOutlineDownload=Ue;exports.TableHeader=he;exports.UserList=ge;exports.UserList$1=Xe;exports.validateCsvApi=Ge;
@@ -0,0 +1 @@
1
+ "use strict";const t=require("./index-KWXe_Hjz.js");var a=(e=>(e[e.Id=0]="Id",e[e.Name=1]="Name",e[e.Email=2]="Email",e[e.Age=3]="Age",e[e.Role=4]="Role",e[e.Status=5]="Status",e[e.CreatedAt=6]="CreatedAt",e[e.RosterUser=7]="RosterUser",e[e.Grade=8]="Grade",e[e.Teacher=9]="Teacher",e[e.Assistant=10]="Assistant",e[e.Counselor=11]="Counselor",e[e.SecondaryTeacher=12]="SecondaryTeacher",e[e.Tiers=13]="Tiers",e))(a||{}),l=(e=>(e[e.Id=0]="Id",e[e.Name=1]="Name",e[e.Email=2]="Email",e[e.Role=3]="Role",e[e.RosterUser=4]="RosterUser",e[e.Status=5]="Status",e[e.Grade=6]="Grade",e[e.Teacher=7]="Teacher",e[e.Assistant=8]="Assistant",e[e.Counselor=9]="Counselor",e[e.SecondaryTeacher=10]="SecondaryTeacher",e[e.Tiers=11]="Tiers",e))(l||{}),s=(e=>(e[e.Teacher=0]="Teacher",e[e.Assistant=1]="Assistant",e[e.Counselor=2]="Counselor",e[e.SecondaryTeacher=3]="SecondaryTeacher",e))(s||{});const i={[a.Id]:"filter-id",[a.Name]:"filter-name",[a.Email]:"filter-email",[a.Age]:"filter-age",[a.Role]:"filter-role",[a.Status]:"filter-status",[a.CreatedAt]:"filter-createdAt",[a.RosterUser]:"filter-roster",[a.Grade]:"filter-grade",[a.Teacher]:"filter-teacher",[a.Assistant]:"filter-assistant",[a.Counselor]:"filter-counselor",[a.SecondaryTeacher]:"filter-secondary",[a.Tiers]:"filter-tiers"},n=[{name:"name",isCenter:!0,sortBy:a.Name,searchBy:l.Name,className:"align-top",getOption:e=>({label:e||"empty",value:e})},{name:"email",isCenter:!0,sortBy:a.Email,searchBy:l.Email,className:"align-top",getOption:e=>({label:e||"empty",value:e})},{name:"age",isCenter:!0,sortBy:a.Age,className:"align-top"},{name:"role",isCenter:!0,sortBy:a.Role,searchBy:l.Role,className:"align-top",getOption:e=>({label:e?e?.replace?.("SecondaryTeacher","SupportTeacher"):"empty",value:e})},{name:"tiers",isCenter:!0,sortBy:a.Tiers,searchBy:l.Tiers,className:"align-top",options:[{label:"ES",value:"ES"},{label:"MS",value:"MS"},{label:"ES, MS",value:"ES, MS"}]},{name:"active_status",isCenter:!0,sortBy:a.Status,searchBy:l.Status,className:"align-top",options:[{label:"Active",value:"true"},{label:"Inactive",value:"false"}]},{name:"created_time",isCenter:!0,sortBy:a.CreatedAt,className:"align-top"},{name:"information_roster_sourced_id_full_name_email",isCenter:!0,sortBy:a.RosterUser,searchBy:l.RosterUser,className:"align-top",getOption:e=>({label:e||"empty",value:e})},{name:"impersonate",isCenter:!0,className:"align-top"},{name:"delete",isCenter:!0,className:"align-top"}],o={value:10},u={searchString:"",currentPage:1,pageSize:o.value},r={searchString:"",currentPage:1,pageSize:o.value},c={currentPage:1,pageSize:200},m="data:text/csv;charset=utf-8,",v={assistantId:"",counselors:[],secondaryTeacherId:"",teacher:[],assistantEmail:"",secondaryTeacherEmail:""},b={studentId:0,id:"",email:"",fullName:"",gradeLevel:"",phoneNumber:"",isActive:!0,dateOfBirth:"",profileImageFileName:"",quote:"",assistantName:"",assistantEmail:"",assistantUserId:"",counselors:[],secondaryTeacherName:"",secondaryTeacherEmail:"",secondaryTeacherUserId:"",teachers:[]},E=[{label:"K",value:"K",schoolLevel:"es"},{label:"G",value:"G",schoolLevel:"es"},{label:"1",value:"1",schoolLevel:"es"},{label:"2",value:"2",schoolLevel:"es"},{label:"3",value:"3",schoolLevel:"es"},{label:"4",value:"4",schoolLevel:"es"},{label:"5",value:"5",schoolLevel:"es"},{label:"6",value:"6",schoolLevel:t.isMalvernCollege?"es":"ms"},{label:"7",value:"7",schoolLevel:"ms"},{label:"8",value:"8",schoolLevel:"ms"},{label:"9",value:"9",schoolLevel:"ms"},{label:"10",value:"10",schoolLevel:"ms"},{label:"11",value:"11",schoolLevel:"ms"},{label:"12",value:"12",schoolLevel:"ms"},...t.isMalvernCollege?[{label:"12/13",value:"12/13",schoolLevel:"ms"}]:[],{label:"13",value:"13",schoolLevel:"ms"}],g=["K","G","1","2","3","4","5","6","7","8","9","10","11","12",...t.isMalvernCollege?["12/13"]:[],"13"],T=[{label:"K",value:"K"},{label:"G",value:"G"},{label:"1",value:"1"},{label:"2",value:"2"},{label:"3",value:"3"},{label:"4",value:"4"},{label:"5",value:"5"},{label:"6",value:"6"},{label:"7",value:"7"},{label:"8",value:"8"},{label:"9",value:"9"},{label:"10",value:"10"},{label:"11",value:"11"},{label:"12",value:"12"},...t.isMalvernCollege?[{label:"12/13",value:"12/13"}]:[],{label:"13",value:"13"}],d={assistantRemoveUserId:[],counselorRemoveUserIds:[],teacherRemoveUserIds:[],teacherSwitchDataUserId:"",assistantSwitchDataUserId:"",counselorSwitchDataUserId:"",supportTeacherRemoveUserIds:[],supportTeacherSwitchDataUserId:""},A={id:"",firstName:"",lastName:"",email:"",fullName:"",roles:[]};exports.CSV_PREFIX=m;exports.DEFAULT_FILTER=u;exports.DEFAULT_FILTER_POPOVER=c;exports.DEFAULT_STUDENT_FILTER=r;exports.GRADE=g;exports.GRADE_DEFAULT=E;exports.SearchBy=l;exports.TeacherType=s;exports.UserColumns=n;exports.UserOrder=a;exports.gradeOptions=T;exports.initAssignStd=b;exports.initStaffDeleteBulk=d;exports.initialStaffBulk=v;exports.initialUserChoice=A;exports.userOrders=i;
@@ -0,0 +1,286 @@
1
+ import { ao as s } from "./index--POWjYN0.mjs";
2
+ var a = /* @__PURE__ */ ((e) => (e[e.Id = 0] = "Id", e[e.Name = 1] = "Name", e[e.Email = 2] = "Email", e[e.Age = 3] = "Age", e[e.Role = 4] = "Role", e[e.Status = 5] = "Status", e[e.CreatedAt = 6] = "CreatedAt", e[e.RosterUser = 7] = "RosterUser", e[e.Grade = 8] = "Grade", e[e.Teacher = 9] = "Teacher", e[e.Assistant = 10] = "Assistant", e[e.Counselor = 11] = "Counselor", e[e.SecondaryTeacher = 12] = "SecondaryTeacher", e[e.Tiers = 13] = "Tiers", e))(a || {}), l = /* @__PURE__ */ ((e) => (e[e.Id = 0] = "Id", e[e.Name = 1] = "Name", e[e.Email = 2] = "Email", e[e.Role = 3] = "Role", e[e.RosterUser = 4] = "RosterUser", e[e.Status = 5] = "Status", e[e.Grade = 6] = "Grade", e[e.Teacher = 7] = "Teacher", e[e.Assistant = 8] = "Assistant", e[e.Counselor = 9] = "Counselor", e[e.SecondaryTeacher = 10] = "SecondaryTeacher", e[e.Tiers = 11] = "Tiers", e))(l || {}), o = /* @__PURE__ */ ((e) => (e[e.Teacher = 0] = "Teacher", e[e.Assistant = 1] = "Assistant", e[e.Counselor = 2] = "Counselor", e[e.SecondaryTeacher = 3] = "SecondaryTeacher", e))(o || {});
3
+ const n = {
4
+ [a.Id]: "filter-id",
5
+ [a.Name]: "filter-name",
6
+ [a.Email]: "filter-email",
7
+ [a.Age]: "filter-age",
8
+ [a.Role]: "filter-role",
9
+ [a.Status]: "filter-status",
10
+ [a.CreatedAt]: "filter-createdAt",
11
+ [a.RosterUser]: "filter-roster",
12
+ [a.Grade]: "filter-grade",
13
+ [a.Teacher]: "filter-teacher",
14
+ [a.Assistant]: "filter-assistant",
15
+ [a.Counselor]: "filter-counselor",
16
+ [a.SecondaryTeacher]: "filter-secondary",
17
+ [a.Tiers]: "filter-tiers"
18
+ }, u = [
19
+ {
20
+ name: "name",
21
+ isCenter: !0,
22
+ sortBy: a.Name,
23
+ searchBy: l.Name,
24
+ className: "align-top",
25
+ getOption: (e) => ({
26
+ label: e || "empty",
27
+ value: e
28
+ })
29
+ },
30
+ {
31
+ name: "email",
32
+ isCenter: !0,
33
+ sortBy: a.Email,
34
+ searchBy: l.Email,
35
+ className: "align-top",
36
+ getOption: (e) => ({
37
+ label: e || "empty",
38
+ value: e
39
+ })
40
+ },
41
+ {
42
+ name: "age",
43
+ isCenter: !0,
44
+ sortBy: a.Age,
45
+ className: "align-top"
46
+ },
47
+ {
48
+ name: "role",
49
+ isCenter: !0,
50
+ sortBy: a.Role,
51
+ searchBy: l.Role,
52
+ className: "align-top",
53
+ getOption: (e) => ({
54
+ label: e ? e?.replace?.("SecondaryTeacher", "SupportTeacher") : "empty",
55
+ value: e
56
+ })
57
+ },
58
+ {
59
+ name: "tiers",
60
+ isCenter: !0,
61
+ sortBy: a.Tiers,
62
+ searchBy: l.Tiers,
63
+ className: "align-top",
64
+ // Khop CHINH XAC voi "AppType hieu luc" tu API mappingRosterUsers:
65
+ // "ES"/"MS" = user chi thuoc (hoac chi con active o) 1 ben;
66
+ // "ES, MS" = user dang active o ca 2 ben.
67
+ options: [
68
+ { label: "ES", value: "ES" },
69
+ { label: "MS", value: "MS" },
70
+ { label: "ES, MS", value: "ES, MS" }
71
+ ]
72
+ },
73
+ {
74
+ name: "active_status",
75
+ isCenter: !0,
76
+ sortBy: a.Status,
77
+ searchBy: l.Status,
78
+ className: "align-top",
79
+ options: [
80
+ {
81
+ label: "Active",
82
+ value: "true"
83
+ },
84
+ {
85
+ label: "Inactive",
86
+ value: "false"
87
+ }
88
+ ]
89
+ },
90
+ {
91
+ name: "created_time",
92
+ isCenter: !0,
93
+ sortBy: a.CreatedAt,
94
+ className: "align-top"
95
+ },
96
+ {
97
+ name: "information_roster_sourced_id_full_name_email",
98
+ isCenter: !0,
99
+ sortBy: a.RosterUser,
100
+ searchBy: l.RosterUser,
101
+ className: "align-top",
102
+ getOption: (e) => ({
103
+ label: e || "empty",
104
+ value: e
105
+ })
106
+ },
107
+ {
108
+ name: "impersonate",
109
+ isCenter: !0,
110
+ className: "align-top"
111
+ },
112
+ {
113
+ name: "delete",
114
+ isCenter: !0,
115
+ className: "align-top"
116
+ }
117
+ ], t = {
118
+ value: 10
119
+ }, c = {
120
+ searchString: "",
121
+ currentPage: 1,
122
+ pageSize: t.value
123
+ }, r = {
124
+ searchString: "",
125
+ currentPage: 1,
126
+ pageSize: t.value
127
+ }, m = {
128
+ currentPage: 1,
129
+ pageSize: 200
130
+ }, v = "data:text/csv;charset=utf-8,", b = {
131
+ assistantId: "",
132
+ counselors: [],
133
+ secondaryTeacherId: "",
134
+ teacher: [],
135
+ assistantEmail: "",
136
+ secondaryTeacherEmail: ""
137
+ }, g = {
138
+ studentId: 0,
139
+ id: "",
140
+ email: "",
141
+ fullName: "",
142
+ gradeLevel: "",
143
+ phoneNumber: "",
144
+ isActive: !0,
145
+ dateOfBirth: "",
146
+ profileImageFileName: "",
147
+ quote: "",
148
+ assistantName: "",
149
+ assistantEmail: "",
150
+ assistantUserId: "",
151
+ counselors: [],
152
+ secondaryTeacherName: "",
153
+ secondaryTeacherEmail: "",
154
+ secondaryTeacherUserId: "",
155
+ teachers: []
156
+ }, d = [
157
+ { label: "K", value: "K", schoolLevel: "es" },
158
+ { label: "G", value: "G", schoolLevel: "es" },
159
+ { label: "1", value: "1", schoolLevel: "es" },
160
+ { label: "2", value: "2", schoolLevel: "es" },
161
+ { label: "3", value: "3", schoolLevel: "es" },
162
+ { label: "4", value: "4", schoolLevel: "es" },
163
+ { label: "5", value: "5", schoolLevel: "es" },
164
+ { label: "6", value: "6", schoolLevel: s ? "es" : "ms" },
165
+ { label: "7", value: "7", schoolLevel: "ms" },
166
+ { label: "8", value: "8", schoolLevel: "ms" },
167
+ { label: "9", value: "9", schoolLevel: "ms" },
168
+ { label: "10", value: "10", schoolLevel: "ms" },
169
+ { label: "11", value: "11", schoolLevel: "ms" },
170
+ { label: "12", value: "12", schoolLevel: "ms" },
171
+ ...s ? [{ label: "12/13", value: "12/13", schoolLevel: "ms" }] : [],
172
+ { label: "13", value: "13", schoolLevel: "ms" }
173
+ ], h = [
174
+ "K",
175
+ "G",
176
+ "1",
177
+ "2",
178
+ "3",
179
+ "4",
180
+ "5",
181
+ "6",
182
+ "7",
183
+ "8",
184
+ "9",
185
+ "10",
186
+ "11",
187
+ "12",
188
+ ...s ? ["12/13"] : [],
189
+ "13"
190
+ ], E = [
191
+ {
192
+ label: "K",
193
+ value: "K"
194
+ },
195
+ {
196
+ label: "G",
197
+ value: "G"
198
+ },
199
+ {
200
+ label: "1",
201
+ value: "1"
202
+ },
203
+ {
204
+ label: "2",
205
+ value: "2"
206
+ },
207
+ {
208
+ label: "3",
209
+ value: "3"
210
+ },
211
+ {
212
+ label: "4",
213
+ value: "4"
214
+ },
215
+ {
216
+ label: "5",
217
+ value: "5"
218
+ },
219
+ {
220
+ label: "6",
221
+ value: "6"
222
+ },
223
+ {
224
+ label: "7",
225
+ value: "7"
226
+ },
227
+ {
228
+ label: "8",
229
+ value: "8"
230
+ },
231
+ {
232
+ label: "9",
233
+ value: "9"
234
+ },
235
+ {
236
+ label: "10",
237
+ value: "10"
238
+ },
239
+ {
240
+ label: "11",
241
+ value: "11"
242
+ },
243
+ {
244
+ label: "12",
245
+ value: "12"
246
+ },
247
+ ...s ? [{ label: "12/13", value: "12/13" }] : [],
248
+ {
249
+ label: "13",
250
+ value: "13"
251
+ }
252
+ ], f = {
253
+ assistantRemoveUserId: [],
254
+ counselorRemoveUserIds: [],
255
+ teacherRemoveUserIds: [],
256
+ teacherSwitchDataUserId: "",
257
+ assistantSwitchDataUserId: "",
258
+ counselorSwitchDataUserId: "",
259
+ supportTeacherRemoveUserIds: [],
260
+ supportTeacherSwitchDataUserId: ""
261
+ }, p = {
262
+ id: "",
263
+ firstName: "",
264
+ lastName: "",
265
+ email: "",
266
+ fullName: "",
267
+ roles: []
268
+ };
269
+ export {
270
+ v as C,
271
+ r as D,
272
+ d as G,
273
+ l as S,
274
+ o as T,
275
+ a as U,
276
+ b as a,
277
+ f as b,
278
+ p as c,
279
+ c as d,
280
+ m as e,
281
+ h as f,
282
+ u as g,
283
+ E as h,
284
+ g as i,
285
+ n as u
286
+ };