import{ah as C,ax as j,e9 as U,aI as c,i$ as b,aC as R,ao as e,aO as k,aq as i,aT as N,L as S,iO as B,c4 as L,bN as T,az as h,aj as Y,bu as I,b4 as H,m as E,aG as D,aH as V}from"./app-k0jcl5PQ.js";import{B as W}from"./B7zGk4Xf.chunk.js";import{u as q,a as M}from"./DaGep5vp.chunk.js";import{u as _}from"./VKSuH0OD.chunk.js";import{U as A,A as z}from"./9ls1F1Ve.chunk.js";import"./BgdsWk2A.chunk.js";import"./BlKMjFEf.chunk.js";import"./CpGXOT1_.chunk.js";import"./DkDkjje4.chunk.js";import"./Djb1f-EX.chunk.js";import"./CCtuxSlD.chunk.js";import"./CPXlV0fg.chunk.js";import"./CnmbO5oy.chunk.js";import"./fstW5ZQE.chunk.js";const G="userManager.bulkUserActionsYearGroupRolloverActionDetails";function F(r){var p;const n=C.getValidYearGroups(r.yearGroups),[a,l]=j(U.BULK_USER_ACTIONS),[o,g]=c.useState(!1),{setDisableNext:u}=c.useContext(b);c.useEffect(()=>{u(!(a!=null&&a.yearGroup)||!o)},[o,a==null?void 0:a.yearGroup]),c.useEffect(()=>{l("yearGroup",R.last(n)),l("subAction","yearGroupRollover")},[]);function s(t){const{value:d}=t.target;l("yearGroup",n.find(m=>m.value.toString()===d.toString()))}return e.jsxs(k.Provider,{value:G,children:[e.jsx("h2",{className:"h4 mb-3",children:e.jsx(i,{phrase:"heading"})}),e.jsxs("div",{className:"px-2 pt-2 border rounded mb-2 pb-0",children:[e.jsxs("ul",{className:"mt-2 ps-3 ms-1",children:[e.jsx("li",{children:e.jsx(i,{phrase:"info"})}),e.jsxs("li",{children:[e.jsx(i,{phrase:"ssoWarning"})," ",!!r.editSsoHelpArticleUrl&&e.jsx("a",{href:r.editSsoHelpArticleUrl,target:"_blank",className:"info-link",children:e.jsx(i,{phrase:"ssoWarningArticle"})})]}),e.jsx("li",{className:"text-danger",children:e.jsx(i,{phrase:"infoWarning"})})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:e.jsx(i,{phrase:"label"})}),e.jsx("select",{className:"form-select form-select-lg w-33",onChange:s,value:((p=a.yearGroup)==null?void 0:p.value)||"",children:n.map(t=>e.jsx("option",{value:t.value,className:"text-dark",children:t.name},t.id))})]}),e.jsx(W,{yearGroups:r.yearGroups,graduatingYearGroup:a.yearGroup,countsByYearGroup:r.countsByYearGroup}),e.jsx(N.Check,{className:"my-3",type:"checkbox",label:S.getPhrase(G,"rolloverConfirmationLabel"),id:"rolloverConfirmation",value:"rolloverConfirmation",onChange:()=>g(!o),checked:o})]})]})}const O="userManager.yearGroupRolloverDetails";function ie(r){var f;const{users:n,count:a,setAllUserIds:l}=q(r.userType),o=B(r.userType),g=L();T({title:S.getPhrase(O,"pageTitle")});const[u]=j(U.BULK_USER_ACTIONS),s=h(Y.currentUser()),p=h(I.config()),t=h(s.hasCompleted&&H.yearGroups(s.data.customerId)),d=_({userType:r.userType,field:z.YearGroupValues,getSearchAggregation:A.getSearchAggregation});c.useEffect(()=>{var x,y;(x=u==null?void 0:u.userIdMap)!=null&&x.size||!((y=s.data)!=null&&y.customerId)||E(g,A.getSearchUserIds(s.data.customerId,s.data.id,r.userType,{},v=>l(v)))},[(f=s.data)==null?void 0:f.customerId]);const m=!!t.data&&!!p.data&&!!s.data&&!!d;return e.jsx(M,{appLinks:o,userType:r.userType,users:n,currentStep:"action-details",userCount:a,preventRedirect:!0,loaded:m,children:m&&e.jsx(F,{appLinks:o,yearGroups:t.data,countsByYearGroup:d,currentUser:s.data,editSsoHelpArticleUrl:D.getLiteArticle(V.EditSsoAccounts)})})}export{ie as BulkUserActionsYearGroupRolloverActionDetailsView};
//# sourceMappingURL=DT0xL9KC.chunk.js.map
