"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[3818],{81545(C,x,t){t.r(x),t.d(x,{SendResetMailPage:()=>g,default:()=>E});var n=t(74848),o=t(58102),m=t(22803),u=t(96540),f=t(49785),e=t(92745),p=t(68143),y=t(63142),h=t(32881),c=t(45861),d=t(53487),s=t(37386),a=t(63527),l=t(41654),i=t(65642);const j=r=>(0,m.css)({color:r.colors.text.secondary,fontSize:r.typography.bodySmall.fontSize,fontWeight:r.typography.fontWeightRegular,marginTop:r.spacing(1),display:"block"}),v=()=>{const[r,L]=(0,u.useState)(!1),M=(0,y.of)(j),B=`${i.Ay.appSubUrl}/login`,{handleSubmit:D,register:I,formState:{errors:S}}=(0,f.mN)(),O=async P=>{await(0,p.AI)().post("/api/user/password/send-reset-email",P)&&L(!0)};return r?(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{children:(0,n.jsx)(e.x6,{i18nKey:"forgot-password.email-sent",children:"An email with a reset link has been sent to the email address. You should receive it shortly."})}),(0,n.jsx)(h.mc,{margin:"md"}),(0,n.jsx)(c.z9,{variant:"primary",href:B,children:(0,n.jsx)(e.x6,{i18nKey:"forgot-password.back-button",children:"Back to login"})})]}):(0,n.jsxs)("form",{onSubmit:D(O),children:[(0,n.jsx)(d.s,{children:(0,n.jsx)(e.x6,{i18nKey:"forgot-password.reset-password-header",children:"Reset password"})}),(0,n.jsx)(s.D,{label:(0,e.t)("forgot-password.user-field-label","User"),description:(0,e.t)("forgot-password.user-field-description","Enter your information to get a reset link sent to you"),invalid:!!S.userOrEmail,error:S?.userOrEmail?.message,children:(0,n.jsx)(a.p,{id:"user-input",placeholder:(0,e.t)("forgot-password.user-field-placeholder","Email or username"),...I("userOrEmail",{required:"Email or username is required"})})}),(0,n.jsxs)(l.B,{children:[(0,n.jsx)(c.$n,{type:"submit",children:(0,n.jsx)(e.x6,{i18nKey:"forgot-password.send-email-button",children:"Send reset email"})}),(0,n.jsx)(c.z9,{fill:"text",href:B,children:(0,n.jsx)(e.x6,{i18nKey:"forgot-password.back-button",children:"Back to login"})})]}),(0,n.jsx)("p",{className:M,children:(0,n.jsx)(e.x6,{i18nKey:"forgot-password.contact-admin",children:"Did you forget your username or email? Contact your Grafana administrator."})})]})},g=()=>(0,n.jsx)(o.GU,{children:(0,n.jsx)(o.qm,{children:(0,n.jsx)(v,{})})}),E=g},58102(C,x,t){t.d(x,{GU:()=>h,YO:()=>d,qm:()=>y});var n=t(74848),o=t(22803),m=t(96540),u=t(92745),f=t(63142),e=t(92948),p=t(10388);const y=({children:s,enterAnimation:a=!0})=>{const l=(0,f.of)(d);return(0,n.jsx)("div",{className:(0,o.cx)(l.loginInnerBox,a&&l.enterAnimation),children:s})},h=({children:s,branding:a,isChangingPassword:l})=>{const i=(0,f.of)(d),[j,v]=(0,m.useState)(!1),g=a?.loginSubtitle??e.Me.GetLoginSubTitle(),E=a?.loginTitle??e.Me.LoginTitle,r=a?.loginBoxBackground||e.Me.LoginBoxBackground(),L=a?.loginLogo,M=a?.hideEdition??e.Me.HideEdition;return(0,m.useEffect)(()=>v(!0),[]),(0,n.jsxs)(e.Me.LoginBackground,{className:(0,o.cx)(i.container,j&&i.loginAnim,a?.loginBackground),children:[(0,n.jsx)("div",{className:i.loginMain,children:(0,n.jsxs)("div",{className:(0,o.cx)(i.loginContent,r,"login-content-box"),children:[(0,n.jsxs)("div",{className:i.loginLogoWrapper,children:[(0,n.jsx)(e.Me.LoginLogo,{className:i.loginLogo,logo:L}),(0,n.jsx)("div",{className:i.titleWrapper,children:l?(0,n.jsx)("h1",{className:i.mainTitle,children:(0,n.jsx)(u.x6,{i18nKey:"login.layout.update-password",children:"Update your password"})}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("h1",{className:i.mainTitle,children:E}),g&&(0,n.jsx)("h3",{className:i.subTitle,children:g})]})})]}),(0,n.jsx)("div",{className:i.loginOuterBox,children:s})]})}),a?.hideFooter?(0,n.jsx)(n.Fragment,{}):(0,n.jsx)(p.wi,{hideEdition:M,customLinks:a?.footerLinks})]})},c=(0,o.keyframes)`
from{
  opacity: 0;
  transform: translate(-60px, 0px);
}

to{
  opacity: 1;
  transform: translate(0px, 0px);
}`,d=s=>({loginMain:(0,o.css)({flexGrow:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minWidth:"100%"}),container:(0,o.css)({minHeight:"100%",backgroundPosition:"center",backgroundRepeat:"no-repeat",flex:1,minWidth:"100%",marginLeft:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}),loginAnim:(0,o.css)({"&:before":{opacity:1},".login-content-box":{opacity:1}}),submitButton:(0,o.css)({justifyContent:"center",width:"100%"}),loginLogo:(0,o.css)({width:"100%",maxWidth:60,marginBottom:s.spacing(2),[s.breakpoints.up("sm")]:{maxWidth:100}}),loginLogoWrapper:(0,o.css)({display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",padding:s.spacing(3)}),titleWrapper:(0,o.css)({textAlign:"center"}),mainTitle:(0,o.css)({fontSize:22,[s.breakpoints.up("sm")]:{fontSize:32}}),subTitle:(0,o.css)({fontSize:s.typography.size.md,color:s.colors.text.secondary}),loginContent:(0,o.css)({maxWidth:478,width:"calc(100% - 2rem)",display:"flex",alignItems:"stretch",flexDirection:"column",position:"relative",justifyContent:"flex-start",zIndex:1,minHeight:320,borderRadius:s.shape.radius.lg,padding:s.spacing(2,0),opacity:0,[s.transitions.handleMotion("no-preference")]:{transition:"opacity 0.5s ease-in-out"},[s.transitions.handleMotion("reduce")]:{opacity:1},[s.breakpoints.up("sm")]:{minHeight:s.spacing(40),justifyContent:"center"}}),loginOuterBox:(0,o.css)({display:"flex",overflowY:"hidden",alignItems:"center",justifyContent:"center"}),loginInnerBox:(0,o.css)({padding:s.spacing(0,2,2,2),display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flexGrow:1,maxWidth:415,width:"100%",transform:"translate(0px, 0px)",[s.transitions.handleMotion("no-preference")]:{transition:"0.25s ease"}}),enterAnimation:(0,o.css)({[s.transitions.handleMotion("no-preference")]:{animation:`${c} ease-out 0.2s`}})})}}]);

//# sourceMappingURL=SendResetMailPage.5c26d47fb6199869ae0d.js.map