import{ah as G,ax as y,e9 as f,aI as p,i$ as A,ao as e,aO as j,aq as i,L as h,iO as U,bN as S,az as g,aj as b,bu as C,b4 as Y,aG as k,aH as N}from"./app-k0jcl5PQ.js";import{B}from"./Dh0S4UG3.chunk.js";import{u as L,a as T}from"./DaGep5vp.chunk.js";import{u as v}from"./VKSuH0OD.chunk.js";import{U as R,A as V}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 m="userManager.bulkUserActionsChangeYearGroupActionDetails";function H(r){var n,u;const c=G.getValidYearGroups(r.yearGroups),[a,t]=y(f.BULK_USER_ACTIONS);p.useEffect(()=>{t("subAction","changeYearGroup")},[]);const{setDisableNext:o}=p.useContext(A);p.useEffect(()=>{o(!(a!=null&&a.yearGroup))},[a==null?void 0:a.yearGroup]);function l(s){const{value:d}=s.target;if(!d){t("yearGroup",null);return}t("yearGroup",r.yearGroups.find(x=>x.value.toString()===d.toString()))}return e.jsxs(j.Provider,{value:m,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.jsx("ul",{className:"mt-2 ps-3 ms-1",children: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.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:e.jsx(i,{phrase:"label"})}),e.jsxs("select",{className:`form-select form-select-lg w-33 ${(n=a.yearGroup)!=null&&n.id?"":"text-secondary"}`,onChange:l,defaultValue:((u=a==null?void 0:a.yearGroup)==null?void 0:u.value)||"",children:[e.jsx("option",{className:"text-secondary",value:"",children:h.getPhrase(m,"placeholder")}),c.map(s=>e.jsx("option",{value:s.value,className:"text-dark",children:s.name},s.id))]})]}),e.jsx(B,{countsByYearGroup:r.countsByYearGroup,yearGroups:r.yearGroups,selectedYearGroup:a.yearGroup})]})]})}const q="userManager.bulkChangeYearGroupDetails";function Q(r){const{users:c,count:a}=L(r.userType),t=U(r.userType);S({title:h.getPhrase(q,"pageTitle")});const o=g(b.currentUser()),l=g(C.config()),n=g(o.hasCompleted&&Y.yearGroups(o.data.customerId)),u=v({userType:r.userType,field:V.YearGroupValues,getSearchAggregation:R.getSearchAggregation}),s=!!u&&!!n.data&&!!l.data&&!!o.data;return e.jsx(T,{appLinks:t,userType:r.userType,users:c,currentStep:"action-details",userCount:a,loaded:s,children:s&&e.jsx(H,{appLinks:t,yearGroups:n.data,countsByYearGroup:u,editSsoHelpArticleUrl:k.getLiteArticle(N.EditSsoAccounts)})})}export{Q as BulkUserActionsChangeYearGroupActionDetailsView};
//# sourceMappingURL=CCM1y3_N.chunk.js.map
