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C,MAAM,QAAnF,UACE,SAAC,EAAAC,MAAD,eACEC,YAAY,qBACRR,EAAS,QAAS,CACpBS,SAAU,oBACVC,QAAS,CACPC,MAAO,YACPN,QAAS,2BAKjB,SAAC,EAAAH,MAAD,CAAOC,UAAWF,EAAOhB,KAAMmB,MAAOH,EAAOhB,MAAQgB,EAAOhB,KAAKoB,QAASC,MAAM,OAAhF,UACE,SAAC,EAAAC,MAAD,eAAOC,YAAY,mBAAsBR,EAAS,aAEpD,SAAC,EAAAE,MAAD,CAAOC,UAAWF,EAAOf,SAAUkB,MAAOH,EAAOf,UAAYe,EAAOf,SAASmB,QAASC,MAAM,WAA5F,UACE,SAAC,EAAAC,MAAD,iBAAWP,EAAS,WAAY,CAAES,SAAU,yBAA5C,CAAuED,YAAY,iBAErF,SAAC,EAAAN,MAAD,CAAOC,UAAWF,EAAOW,SAAUR,MAAOH,EAAOW,UAAYX,EAAOW,SAASP,QAASC,MAAM,WAA5F,UACE,SAAC,EAAAC,MAAD,iBACMP,EAAS,WAAY,CAAES,SAAU,yBADvC,CAEEI,KAAK,WACLL,YAAY,gBAvBlB,OA2BE,SAAC,EAAAM,OAAD,CAAQD,KAAK,SAAb,iCA3CH,MAoDX","sources":["webpack://grafana/./public/app/features/invites/SignupInvited.tsx"],"sourcesContent":["import React, { FC, useState } from 'react';\nimport { useAsync } from 'react-use';\n\nimport { getBackendSrv } from '@grafana/runtime';\nimport { Button, Field, Form, Input } from '@grafana/ui';\nimport Page from 'app/core/components/Page/Page';\nimport { getConfig } from 'app/core/config';\nimport { contextSrv } from 'app/core/core';\nimport { GrafanaRouteComponentProps } from 'app/core/navigation/types';\n\ninterface FormModel {\n email: string;\n name?: string;\n username: string;\n password?: string;\n}\n\nconst navModel = {\n main: {\n icon: 'grafana',\n text: 'Invite',\n subTitle: 'Register your Grafana account',\n breadcrumbs: [{ title: 'Login', url: 'login' }],\n },\n node: {\n text: '',\n },\n};\n\nexport interface Props extends GrafanaRouteComponentProps<{ code: string }> {}\n\nexport const SignupInvitedPage: FC = ({ match }) => {\n const code = match.params.code;\n const [initFormModel, setInitFormModel] = useState();\n const [greeting, setGreeting] = useState();\n const [invitedBy, setInvitedBy] = useState();\n\n useAsync(async () => {\n const invite = await getBackendSrv().get(`/api/user/invite/${code}`);\n\n setInitFormModel({\n email: invite.email,\n name: invite.name,\n username: invite.email,\n });\n\n setGreeting(invite.name || invite.email || invite.username);\n setInvitedBy(invite.invitedBy);\n }, [code]);\n\n const onSubmit = async (formData: FormModel) => {\n await getBackendSrv().post('/api/user/invite/complete', { ...formData, inviteCode: code });\n window.location.href = getConfig().appSubUrl + '/';\n };\n\n if (!initFormModel) {\n return null;\n }\n\n return (\n \n \n

Hello {greeting || 'there'}.

\n\n
\n {invitedBy || 'Someone'} has invited you to join Grafana and the organization{' '}\n {contextSrv.user.orgName}\n
\n Please complete the following and choose a password to accept your invitation and continue:\n
\n
\n {({ register, errors }) => (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n )}\n
\n
\n
\n );\n};\n\nexport default SignupInvitedPage;\n"],"names":["navModel","main","icon","text","subTitle","breadcrumbs","title","url","node","SignupInvitedPage","match","code","params","initFormModel","setInitFormModel","useState","greeting","setGreeting","invitedBy","setInvitedBy","useAsync","async","invite","getBackendSrv","get","email","name","username","className","contextSrv","Form","defaultValues","onSubmit","post","formData","inviteCode","window","location","href","getConfig","appSubUrl","register","errors","Field","invalid","error","message","label","Input","placeholder","required","pattern","value","password","type","Button"],"sourceRoot":""}