(window.webpackJsonp=window.webpackJsonp||[]).push([["38d3"],{"+9xx":function(e,t,n){"use strict";var r=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=h(n("q1tI")),a=n("mR6N"),o=n("Vxy9"),s=r(n("wa3X")),l=r(n("Pwnf")),d=r(n("gE8/")),u=n("JimW"),c=h(n("4PhQ")),f=n("sMvG"),m=h(n("8jAt")),E=r(n("M+bw"));function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}function h(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}const y={errorSendingEmail:m._("Oops! We were unable to send you an email."),resendEmailButton:e=>e?m._("Resend email to %(email)s",{email:e}):m._("Resend email"),sent:m._("Email sent!"),tryAgainButton:m._("Try again?")};class w extends i.Component{constructor(...e){super(...e),this.state={sendStatus:"unsent"},this._isMounted=!1,this.onEmailSendSuccess=()=>{this._isMounted&&this.setState({sendStatus:"sent"})},this.onEmailSendError=()=>{this._isMounted&&this.setState({sendStatus:"failed"})},this.onResendClick=e=>{this.setState({sendStatus:"sending"}),e?(0,f.signupResendVerificationEmail)(this.props.gqlClient).then(this.onEmailSendSuccess).catch(this.onEmailSendError):c.default.error("User attempted to resend verification email without an email",c.Errors.Internal)}}componentDidMount(){this._isMounted=!0}componentWillUnmount(){this._isMounted=!1}render(){const{email:e}=this.props,{sendStatus:t}=this.state;return"unsent"===t||"sending"===t?i.createElement(s.default,{kind:"tertiary",spinner:"sending"===t,onClick:()=>this.onResendClick(e)},y.resendEmailButton(e)):"sent"===t?i.createElement(u.View,{style:g.centeredContainer},i.createElement(o.Body,{style:g.successText},y.sent)):i.createElement(u.View,{style:g.centeredContainer,"aria-live":"polite"},i.createElement(o.Body,{style:g.errorText},y.errorSendingEmail),i.createElement(s.default,{kind:"tertiary",onClick:()=>this.onResendClick(e)},y.tryAgainButton))}}const g=a.StyleSheet.create({centeredContainer:{display:"flex",alignItems:"center",justifyContent:"center"},errorText:{color:l.default.red,marginTop:d.default.xxxSmall_4},successText:{marginTop:d.default.small_12,marginBottom:d.default.small_12}});var _=(0,E.default)(w);t.default=_},sMvG:function(e,t,n){"use strict";var r=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.SIGNUP_RESEND_VERIFICATION_EMAIL_MUTATION=void 0,t.resendVerificationEmail=function(e,t){const n={token:t};return e.mutate(u,{variables:n}).then((e=>{var t,n;if(null!=(t=e.data)&&null!=(n=t.resendVerificationEmail)&&n.error)throw new a.KAError(e.data.resendVerificationEmail.error.code,a.Errors.Internal);return e})).catch((e=>{throw new a.KAError("Failed to resend verification email",a.Errors.Internal,{cause:e})}))},t.signupResendVerificationEmail=async function(e){try{var t,n;const r=await e.mutate(c);if(null!=(t=r.data)&&null!=(n=t.signupResendVerificationEmail)&&n.error)throw new a.KAError(r.data.signupResendVerificationEmail.error.code,a.Errors.Internal);return!0}catch(e){if(e instanceof a.KAError)throw e;throw new a.KAError("Failed to resend the verification email",a.Errors.Internal)}};var i=r(n("lTCR")),a=n("4PhQ"),o=n("8r+/");let s,l,d=e=>e;const u=(0,o.gqlOp)((0,i.default)(s||(s=d`
    mutation resendVerificationEmail($token: String!) {
        resendVerificationEmail(token: $token) {
            error {
                code
            }
        }
    }
`)));const c=(0,o.gqlOp)((0,i.default)(l||(l=d`
        mutation signupResendVerificationEmailMutation {
            signupResendVerificationEmail {
                error {
                    code
                }
            }
        }
    `)));t.SIGNUP_RESEND_VERIFICATION_EMAIL_MUTATION=c}}]);
//# sourceMappingURL=../../sourcemaps/en/38d3.6a1ab009c224c44a9e70.js.map