import{o as D,k as R,l as S,R as v,j as s,G as x,az as F,cD as j,F as b}from"./app-BgLa5dit.js";import{R as y}from"./fn6G7i9o.chunk.js";import{g as B,D as C}from"./R0q2T0lv.chunk.js";import{b as r,a as I,D as m,A as O}from"./DlWawfes.chunk.js";import"./BbLwn0px.chunk.js";import"./D6bTl1fN.chunk.js";import"./kOrk-qeI.chunk.js";const k="settings.requestingAccess",u=b.encloseNamespace(k);function T(l){const{customerId:t}=l,i=B(t),a=D(t&&m.domains(t)),p=R(),n=S(),[g,d]=v.useState([]);async function h(e,A){var c;const q=r.formatRequestData(a.data,e.requestingAccess,O.Request);try{await p(m.updateDomains(t,q)),n.success(u("success"))}catch(o){(c=o.responseJSON)!=null&&c.problems&&d(o.responseJSON.problems),n.error(u("error"))}finally{A()}}if(!a.hasCompleted)return s.jsx(s.Fragment,{});const f={requestingAccess:r.getInitialJoinRequests(a.data),teacherInvites:!1,automaticAccess:r.getInitialAccessBehaviour(a.data)};return s.jsxs(s.Fragment,{children:[s.jsx(C,{active:"requesting-access",appLinks:i}),s.jsx(x,{initialValues:f,onSubmit:h,validate:e=>I({values:e,alerts:n,setShowPopup:()=>{}}),validateOnChange:!1,validateOnBlur:!1,children:e=>s.jsxs(F,{children:[s.jsx(y,{formikProps:e,errors:g,appLinks:i}),s.jsx(j,{variant:"dark",disabled:!e.dirty,onClick:()=>e.submitForm(),children:"Save changes"})]})})]})}export{T as RequestingAccessView};
//# sourceMappingURL=B3SXiJ_c.chunk.js.map
