(window.webpackJsonp=window.webpackJsonp||[]).push([[35],{"6CAQ":function(e,t,r){"use strict";r.r(t);var n=r("q1tI"),a=r.n(n),o=r("NoLC"),i=r("kDLi"),l=r("t8hP"),u=r("kDDq"),c=r("ZFWI");function s(e,t,r,n,a,o,i){try{var l=e[o](i),u=l.value}catch(e){return void r(e)}l.done?t(u):Promise.resolve(u).then(n,a)}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e))&&"[object Arguments]"!==Object.prototype.toString.call(e))return;var r=[],n=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(n=(i=l.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){a=!0,o=e}finally{try{n||null==l.return||l.return()}finally{if(a)throw o}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function f(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n  color: ",";\n  font-size: ",";\n  font-weight: ",";\n  margin-top: ",";\n  display: block;\n"]);return f=function(){return e},e}var p=function(e){return Object(u.css)(f(),e.colors.formDescription,e.typography.size.sm,e.typography.weight.regular,e.spacing.sm)},d=function(){var e=m(Object(n.useState)(!1),2),t=e[0],r=e[1],o=Object(i.useStyles)(p),u="".concat(c.b.appSubUrl,"/login"),f=function(){var e,t=(e=regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(l.getBackendSrv)().post("/api/user/password/send-reset-email",t);case 2:e.sent&&r(!0);case 4:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){s(o,n,a,i,l,"next",e)}function l(e){s(o,n,a,i,l,"throw",e)}i(void 0)}))});return function(e){return t.apply(this,arguments)}}();return t?a.a.createElement("div",null,a.a.createElement("p",null,"An email with a reset link has been sent to the email address. You should receive it shortly."),a.a.createElement(i.Container,{margin:"md"}),a.a.createElement(i.LinkButton,{variant:"primary",href:u},"Back to login")):a.a.createElement(i.Form,{onSubmit:f},(function(e){var t,r=e.register,n=e.errors;return a.a.createElement(a.a.Fragment,null,a.a.createElement(i.Legend,null,"Reset password"),a.a.createElement(i.Field,{label:"User",description:"Enter your information to get a reset link sent to you",invalid:!!n.userOrEmail,error:null==n||null===(t=n.userOrEmail)||void 0===t?void 0:t.message},a.a.createElement(i.Input,{placeholder:"Email or username",name:"userOrEmail",ref:r({required:!0})})),a.a.createElement(i.HorizontalGroup,null,a.a.createElement(i.Button,null,"Send reset email"),a.a.createElement(i.LinkButton,{variant:"link",href:u},"Back to login")),a.a.createElement("p",{className:o},"Did you forget your username or email? Contact your Grafana administrator."))}))};r.d(t,"SendResetMailPage",(function(){return v}));var v=function(){return a.a.createElement(o.b,null,a.a.createElement(o.a,null,a.a.createElement(d,null)))};t.default=v}}]);
//# sourceMappingURL=SendResetMailPage.3b87c7ad03e52dfc5e30.js.map