import{j as e,b7 as o,bE as x,R as m,l as I,o as S,k as j,F as w}from"./app-BgLa5dit.js";import{g as b,D as T}from"./R0q2T0lv.chunk.js";import{S as A}from"./CcviYpBC.chunk.js";import{S as g}from"./BixyE8L-.chunk.js";import{S as u}from"./DeGPZXe2.chunk.js";import"./D6bTl1fN.chunk.js";import"./kOrk-qeI.chunk.js";import"./BbLwn0px.chunk.js";const c="settings.domainSettingsInvitesToggle";function N(s){const{allowInvites:t,onToggleInvites:n}=s;return e.jsxs("div",{className:"col-12 col-md-7 card p-3",children:[e.jsxs("div",{className:"d-flex justify-content-between",children:[e.jsx("p",{className:"fw-semibold",children:e.jsx(o,{namespace:c,phrase:"invitesLabel"})}),e.jsx(x,{onClick:n,on:t})]}),e.jsx("p",{children:e.jsx(o,{namespace:c,phrase:"invitesDescription"})}),e.jsx("div",{className:"d-flex",children:e.jsx("div",{className:"rounded p-2 bg-light-blue text-info fw-semibold",children:e.jsx(o,{namespace:c,phrase:t?"invitesInfoMessage":"noInvitesInfoMessage"})})})]})}const k="userManager.teacherInvites",d=w.encloseNamespace(k);function q(s){const{customerId:t}=s,n=b(t),[a,r]=m.useState(!1),l=I(),i=S(u.customerSettings(s.customerId)),p=j();m.useEffect(()=>{i.hasCompleted&&r(i.data[g.InviteColleague].value)},[i]);async function v(){const f={name:g.InviteColleague,value:!a,kind:A.Setting};try{const h=u.updateSetting(s.customerId,f);await p(h),l.success(d("successAlert")),r(!a)}catch{l.error(d("errorAlert"))}}return e.jsxs(e.Fragment,{children:[e.jsx(T,{active:"teacher-invites",appLinks:n}),e.jsx(N,{allowInvites:a,onToggleInvites:v})]})}export{q as TeacherInvitesView};
//# sourceMappingURL=YuljBLHh.chunk.js.map
