import{u as x,bZ as h,R as k,d as f,bT as m,F as T,j as e,b7 as c}from"./app-BgLa5dit.js";import{U as b}from"./B82YbMjA.chunk.js";function j(s){var u;const[r,t]=x(h.BULK_USER_UPLOAD);k.useEffect(()=>{t("existingUserToAdd",s.existingUsers)},[]);const l=s.existingUsers,n=f(l,{idField:"lookupId",preselectedIds:l.map(i=>i.lookupId)}),o=s.userType===m.Learner?"userManager.existingStudent":"userManager.existsingStaff",d=T.encloseNamespace(o),g={firstName:d("tooltip",{field:"first name"}),lastName:d("tooltip",{field:"last name"}),username:d("tooltip",{field:"username"})};return!((u=s.users)!=null&&u.length)||!s.users?e.jsx(e.Fragment,{}):e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"h4",children:e.jsx(c,{namespace:o,phrase:"heading"})}),e.jsxs("main",{className:"pb-3",children:[e.jsx("p",{children:e.jsx(c,{namespace:o,phrase:"subheading"})}),e.jsx("p",{children:e.jsx(c,{namespace:o,phrase:"actions"})}),e.jsx(b,{tableHeightOffset:s.tableHeightOffset,users:l,invalidUsers:{},userType:s.userType,appLinks:s.appLinks,isChecked:n.isChecked,tooltips:g,checkboxId:"bulk-upload-review-existing-accounts",onToggleCheckbox:i=>{r.existingUserToAdd.find(a=>a.lookupId===i)?t("existingUserToAdd",r.existingUserToAdd.filter(a=>a.lookupId!==i)):t("existingUserToAdd",[...r.existingUserToAdd,s.users.find(a=>a.lookupId===i)]),n.onToggleItem(i)},onToggleBulkCheckbox:i=>{n.onToggleBulk(),i.target.checked?t("existingUserToAdd",s.existingUsers):t("existingUserToAdd",[])},bulkCheckboxChecked:n.bulkChecked,bulkIndeterminate:n.hasSomeSelections()})]})]})}export{j as R};
//# sourceMappingURL=DufcUoVJ.chunk.js.map
