"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[7429],{46142:(e,a,s)=>{s.d(a,{Yb:()=>r,d5:()=>n});var i=s(67273);const r=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;const n=()=>function(){var e;const a=null===(e=i.v.licenseInfo)||void 0===e?void 0:e.trialExpiry;return!!(a&&a>0)}()&&i.v.featureToggles.featureHighlights},31058:(e,a,s)=>{s.r(a),s.d(a,{SignupInvitedPage:()=>x,default:()=>b});var i,r,n=s(76687),l=s(68021),t=s(5205),o=s(56481),d=s(45550),m=s(9120),c=s(55312),u=s(28781),g=s(72e3),h=s(31271),p=s(46142),j=s(52010);const v={main:{icon:"grafana",text:"Invite",subTitle:"Register your Grafana account",breadcrumbs:[{title:"Login",url:"login"}]},node:{text:""}},x=e=>{let{match:a}=e;const s=a.params.code,[x,b]=(0,n.useState)(),[w,f]=(0,n.useState)(),[y,z]=(0,n.useState)();(0,l.Z)((async()=>{const e=await(0,t.i)().get(`/api/user/invite/${s}`);b({email:e.email,name:e.name,username:e.email}),f(e.name||e.email||e.username),z(e.invitedBy)}),[s]);return x?(0,j.jsx)(u.T,{navModel:v,children:(0,j.jsxs)(u.T.Contents,{children:[(0,j.jsxs)("h3",{className:"page-sub-heading",children:["Hello ",w||"there","."]}),(0,j.jsxs)("div",{className:"modal-tagline p-b-2",children:[(0,j.jsx)("em",{children:y||"Someone"})," has invited you to join Grafana and the organization"," ",(0,j.jsx)("span",{className:"highlight-word",children:h.Vt.user.orgName}),i||(i=(0,j.jsx)("br",{})),"Please complete the following and choose a password to accept your invitation and continue:"]}),(0,j.jsx)(o.l,{defaultValues:x,onSubmit:async e=>{await(0,t.i)().post("/api/user/invite/complete",Object.assign({},e,{inviteCode:s})),window.location.href=(0,g.iE)().appSubUrl+"/"},children:e=>{let{register:a,errors:s}=e;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(d.g,{invalid:!!s.email,error:s.email&&s.email.message,label:"Email",children:(0,j.jsx)(m.I,Object.assign({placeholder:"email@example.com"},a("email",{required:"Email is required",pattern:{value:p.Yb,message:"Email is invalid"}})))}),(0,j.jsx)(d.g,{invalid:!!s.name,error:s.name&&s.name.message,label:"Name",children:(0,j.jsx)(m.I,Object.assign({placeholder:"Name (optional)"},a("name")))}),(0,j.jsx)(d.g,{invalid:!!s.username,error:s.username&&s.username.message,label:"Username",children:(0,j.jsx)(m.I,Object.assign({},a("username",{required:"Username is required"}),{placeholder:"Username"}))}),(0,j.jsx)(d.g,{invalid:!!s.password,error:s.password&&s.password.message,label:"Password",children:(0,j.jsx)(m.I,Object.assign({},a("password",{required:"Password is required"}),{type:"password",placeholder:"Password"}))}),r||(r=(0,j.jsx)(c.zx,{type:"submit",children:"Sign up"}))]})}})]})}):null},b=x}}]);
//# sourceMappingURL=SignupInvited.172fe4c444bdf7ca7acc.js.map