"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[6964],{67293(L,u,s){s.d(u,{GU:()=>c,YO:()=>P,qm:()=>d});var n=s(74848),i=s(22803),E=s(96540),_=s(29675),f=s(11817),e=s(77455),l=s(50363);const d=({children:o,enterAnimation:a=!0})=>{const p=(0,_.of)(P);return(0,n.jsx)("div",{className:(0,i.cx)(p.loginInnerBox,a&&p.enterAnimation),children:o})},c=({children:o,branding:a,isChangingPassword:p})=>{const t=(0,_.of)(P),[M,h]=(0,E.useState)(!1),O=a?.loginSubtitle??e.M.GetLoginSubTitle(),g=a?.loginTitle??e.M.LoginTitle,m=a?.loginBoxBackground||e.M.LoginBoxBackground(),D=a?.loginLogo,j=a?.hideEdition??e.M.HideEdition;return(0,E.useEffect)(()=>h(!0),[]),(0,n.jsxs)(e.M.LoginBackground,{className:(0,i.cx)(t.container,M&&t.loginAnim,a?.loginBackground),children:[(0,n.jsx)("div",{className:t.loginMain,children:(0,n.jsxs)("div",{className:(0,i.cx)(t.loginContent,m,"login-content-box"),children:[(0,n.jsxs)("div",{className:t.loginLogoWrapper,children:[(0,n.jsx)(e.M.LoginLogo,{className:t.loginLogo,logo:D}),(0,n.jsx)("div",{className:t.titleWrapper,children:p?(0,n.jsx)("h1",{className:t.mainTitle,children:(0,n.jsx)(f.x6,{i18nKey:"login.layout.update-password",children:"Update your password"})}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("h1",{className:t.mainTitle,children:g}),O&&(0,n.jsx)("h3",{className:t.subTitle,children:O})]})})]}),(0,n.jsx)("div",{className:t.loginOuterBox,children:o})]})}),a?.hideFooter?(0,n.jsx)(n.Fragment,{}):(0,n.jsx)(l.wi,{hideEdition:j,customLinks:a?.footerLinks})]})},x=(0,i.keyframes)`
from{
  opacity: 0;
  transform: translate(-60px, 0px);
}

to{
  opacity: 1;
  transform: translate(0px, 0px);
}`,P=o=>({loginMain:(0,i.css)({flexGrow:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minWidth:"100%"}),container:(0,i.css)({minHeight:"100%",backgroundPosition:"center",backgroundRepeat:"no-repeat",flex:1,minWidth:"100%",marginLeft:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}),loginAnim:(0,i.css)({"&:before":{opacity:1},".login-content-box":{opacity:1}}),submitButton:(0,i.css)({justifyContent:"center",width:"100%"}),loginLogo:(0,i.css)({width:"100%",maxWidth:60,marginBottom:o.spacing(2),[o.breakpoints.up("sm")]:{maxWidth:100}}),loginLogoWrapper:(0,i.css)({display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",padding:o.spacing(3)}),titleWrapper:(0,i.css)({textAlign:"center"}),mainTitle:(0,i.css)({fontSize:22,[o.breakpoints.up("sm")]:{fontSize:32}}),subTitle:(0,i.css)({fontSize:o.typography.size.md,color:o.colors.text.secondary}),loginContent:(0,i.css)({maxWidth:478,width:"calc(100% - 2rem)",display:"flex",alignItems:"stretch",flexDirection:"column",position:"relative",justifyContent:"flex-start",zIndex:1,minHeight:320,borderRadius:o.shape.radius.default,padding:o.spacing(2,0),opacity:0,[o.transitions.handleMotion("no-preference","reduce")]:{transition:"opacity 0.5s ease-in-out"},[o.breakpoints.up("sm")]:{minHeight:o.spacing(40),justifyContent:"center"}}),loginOuterBox:(0,i.css)({display:"flex",overflowY:"hidden",alignItems:"center",justifyContent:"center"}),loginInnerBox:(0,i.css)({padding:o.spacing(0,2,2,2),display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flexGrow:1,maxWidth:415,width:"100%",transform:"translate(0px, 0px)",[o.transitions.handleMotion("no-preference")]:{transition:"0.25s ease"}}),enterAnimation:(0,i.css)({[o.transitions.handleMotion("no-preference")]:{animation:`${x} ease-out 0.2s`}})})},34191(L,u,s){s.d(u,{s:()=>e});var n=s(74848),i=s(96540),E=s(58779),_=s(99764),f=s(34128);const e=(0,i.forwardRef)((l,d)=>{const[c,x]=(0,i.useState)(!1);return(0,n.jsx)(f.p,{...l,type:c?"text":"password","data-testid":E.Tp.pages.Login.password,ref:d,suffix:(0,n.jsx)(_.K,{name:c?"eye-slash":"eye","aria-controls":l.id,role:"switch","aria-checked":c,onClick:()=>{x(!c)},tooltip:c?"Hide password":"Show password"})})});e.displayName="PasswordField"},26964(L,u,s){s.r(u),s.d(u,{SignupPage:()=>p,default:()=>t});var n=s(74848),i=s(49785),E=s(28082),_=s(54594),f=s(48583),e=s(86489),l=s(34128),d=s(88023),c=s(17687),x=s(11817),P=s(4148),o=s(67293),a=s(34191);const p=({queryParams:M})=>{const h=(0,c._2)(),{handleSubmit:O,formState:{errors:g},register:m,getValues:D}=(0,i.mN)({defaultValues:{email:M.email,code:M.code}}),j=async r=>{r.name===""&&delete r.name,delete r.confirm,(await(0,E.AI)().post("/api/user/signup/step2",{email:r.email,code:r.code,username:r.email,orgName:r.orgName,password:r.password,name:r.name}).catch(y=>{const B=y.data?.message||y;h.warning(B)})).code==="redirect-to-select-org"&&window.location.assign((0,d.zj)().appSubUrl+"/profile/select-org?signup=1"),window.location.assign((0,d.zj)().appSubUrl+"/")};return(0,n.jsx)(o.GU,{children:(0,n.jsx)(o.qm,{children:(0,n.jsxs)("form",{onSubmit:O(j),style:{width:"100%"},children:[(0,n.jsx)(e.D,{label:"Your name",children:(0,n.jsx)(l.p,{id:"user-name",...m("name"),placeholder:"(optional)"})}),(0,n.jsx)(e.D,{label:"Email",invalid:!!g.email,error:g.email?.message,children:(0,n.jsx)(l.p,{id:"email",...m("email",{required:"Email is required",pattern:{value:P.pL,message:"Email is invalid"}}),type:"email",placeholder:"Email"})}),!(0,d.zj)().autoAssignOrg&&(0,n.jsx)(e.D,{label:"Org. name",children:(0,n.jsx)(l.p,{id:"org-name",...m("orgName"),placeholder:"Org. name"})}),(0,d.zj)().verifyEmailEnabled&&(0,n.jsx)(e.D,{label:"Email verification code (sent to your email)",children:(0,n.jsx)(l.p,{id:"verification-code",...m("code"),placeholder:"Code"})}),(0,n.jsx)(e.D,{label:"Password",invalid:!!g.password,error:g?.password?.message,children:(0,n.jsx)(a.s,{id:"new-password",autoFocus:!0,autoComplete:"new-password",...m("password",{required:"Password is required"})})}),(0,n.jsx)(e.D,{label:"Confirm password",invalid:!!g.confirm,error:g?.confirm?.message,children:(0,n.jsx)(a.s,{id:"confirm-new-password",autoComplete:"new-password",...m("confirm",{required:"Confirmed password is required",validate:r=>r===D().password||"Passwords must match!"})})}),(0,n.jsxs)(f.B,{children:[(0,n.jsx)(_.$n,{type:"submit",children:(0,n.jsx)(x.x6,{i18nKey:"sign-up.submit-button",children:"Submit"})}),(0,n.jsx)(_.z9,{fill:"text",href:(0,d.zj)().appSubUrl+"/login",children:(0,n.jsx)(x.x6,{i18nKey:"sign-up.back-button",children:"Back to login"})})]})]})})})},t=p}}]);

//# sourceMappingURL=6964.5bd87334892f46e8752d.js.map