"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[7707],{32096:(V,s,t)=>{t.r(s),t.d(s,{UserInvitePage:()=>d,default:()=>N});var e=t(65237),u=t(49784),m=t(38992),g=t(63969),E=t(85428),h=t(66917),f=t(38002),I=t(46181),S=t(37885),l=t(5263),v=t(96682),F=t(58102),U=t(12007),O=t(57313),c=t(48389),R=t(18819),a=t(3315),C=t(61036);const x=[{label:"Viewer",value:a.OrgRole.Viewer},{label:"Editor",value:a.OrgRole.Editor},{label:"Admin",value:a.OrgRole.Admin}],y={name:"",email:"",role:a.OrgRole.Editor,sendEmail:!0},B=()=>{const o=(0,a.useDispatch)(),i=async n=>{await o((0,C.MA)(n)).unwrap(),f.E1.push("/org/users/")};return e.createElement(I.l,{defaultValues:y,onSubmit:i},({register:n,control:P,errors:r})=>e.createElement(e.Fragment,null,e.createElement(S.C,null,e.createElement(l.g,{invalid:!!r.loginOrEmail,error:r.loginOrEmail?"Email or username is required":void 0,label:"Email or username"},e.createElement(v.I,{...n("loginOrEmail",{required:!0}),placeholder:"email@example.com"})),e.createElement(l.g,{invalid:!!r.name,label:"Name"},e.createElement(v.I,{...n("name"),placeholder:"(optional)"})),e.createElement(l.g,{invalid:!!r.role,label:"Role"},e.createElement(F.g,{render:({field:{ref:A,...T}})=>e.createElement(U.S,{...T,options:x}),control:P,name:"role"})),e.createElement(l.g,{label:"Send invite email"},e.createElement(O.r,{id:"send-email-switch",...n("sendEmail")}))),e.createElement(h.Stack,null,e.createElement(c.zx,{type:"submit"},"Submit"),e.createElement(c.Qj,{href:E.u.assureBaseUrl((0,R.iE)().appSubUrl+"/org/users"),variant:"secondary"},"Back"))))};function d(){const o=e.createElement(e.Fragment,null,"Send invitation or add existing Grafana user to the organization.",e.createElement("span",{className:"highlight-word"}," ",g.Vt.user.orgName)),i=u.v.featureToggles.topnav?"global-users":"users";return e.createElement(m.T,{navId:i,pageNav:{text:"Invite user"},subTitle:o},e.createElement(m.T.Contents,null,e.createElement(B,null)))}const N=d}}]);

//# sourceMappingURL=UserInvitePage.1cacbecdeaf863cbf777.js.map