import{ax as S,e9 as C,aI as i,i$ as A,ao as e,aO as T,aq as l,L as p,iO as f,bN as j,az as c,aj as d,bu as k,aG as L,aH as b,aP as g,c6 as y,Y as R}from"./app-k0jcl5PQ.js";import{I}from"./CovT_itD.chunk.js";import{T as N}from"./m0YrH4Ug.chunk.js";import{u as E,a as q}from"./DaGep5vp.chunk.js";import"./BUELddOb.chunk.js";import"./CnoMMtVD.chunk.js";import"./BzIt8QkE.chunk.js";import"./BEDdXV-K.chunk.js";import"./D1M9dqnr.chunk.js";import"./CnSDR2E3.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";const h="userManager.bulkUserActionsAddToClassroomActionDetails",H=p.encloseNamespace(h);function v(s){const[a,r]=S(C.BULK_USER_ACTIONS);i.useEffect(()=>{r("subAction","addToClassroom")},[]);const{setDisableNext:o}=i.useContext(A);return i.useEffect(()=>{o(!(a!=null&&a.classroom))},[a==null?void 0:a.classroom]),e.jsxs(T.Provider,{value:h,children:[e.jsx("h2",{className:"h4 mb-3",children:e.jsx(l,{phrase:"heading"})}),e.jsx("p",{className:"mb-2",children:e.jsx(l,{phrase:"info"})}),e.jsxs("div",{className:"p-2 border rounded mb-2",children:[e.jsx("label",{children:e.jsx(l,{phrase:"placeholder"})}),a.classroom?e.jsx("div",{className:"d-flex",children:e.jsx(I,{selection:a.classroom,onClickRemove:()=>r("classroom",null)})}):e.jsx("div",{className:"w-50",children:e.jsx(N,{placeholder:H("placeholder"),getRemoteUrl:s.getSearchUrl,requestHeaders:s==null?void 0:s.requestHeaders,selections:a.classroom?[a.classroom]:[],formatRemoteSuggestions:t=>t.results,onSuggestionSelected:t=>r("classroom",t),removeSelection:()=>{},imageCdnUrl:s.imageCdnUrl,activationLength:2,debounceTime:200,errorStateImageUrl:s.errorStateImageUrl,emptyStateImageUrl:s.emptyStateImageUrl})}),s.addToClassroomSupportLink&&e.jsxs("p",{className:"mb-0 mt-2",children:[e.jsx(l,{phrase:"cantFindAClassroom"})," ",e.jsx("a",{href:s.addToClassroomSupportLink,className:"text-info",target:"_blank",children:e.jsx(l,{phrase:"howToCreateClassroom"})})]})]})]})}const B="userManager.bulkAddToClassroomDetails";function D(s,a,r){const t=y.searchClassrooms(s,a).url.split("{gateway}")[1];return R.safeUrlConcat(r,t)}function Z(s){const{users:a,count:r}=E(s.userType),o=f(s.userType);j({title:p.getPhrase(B,"pageTitle")});const t=c(d.currentUser()),m=c(d.token()),n=c(k.config()),u=!!t.data&&!!m.data&&!!n.data,U=L.getLiteArticle(b.Classrooms);return e.jsx(q,{appLinks:o,userType:s.userType,users:a,currentStep:"action-details",userCount:r,loaded:u,children:u&&e.jsx(v,{getSearchUrl:x=>D(x,t.data.customerId,n.data.gatewayApiUrl),requestHeaders:{authorization:`Bearer ${m.data.value}`},imageCdnUrl:n.data.imageCdnUrl,addToClassroomSupportLink:U,errorStateImageUrl:g.TYPEAHEAD_ERROR,emptyStateImageUrl:g.EmptyStates.TYPEAHEAD_RESULTS,appLinks:o})})}export{Z as BulkUserActionsAddToClassroomActionDetailsView};
//# sourceMappingURL=gW94OnpF.chunk.js.map
