import { useLingui, Trans } from '../../../../../../../node_modules/@lingui/react/dist/index.mjs';
import React__default from 'react';
import EmailActionLayout from '../../../components/molecules/EmailActionLayout.mjs';
import { useErrorCallback, useEventCallback } from '../../GlobalContextProvider.mjs';
import { useResetResendPasswordActions } from './useResetResendPasswordActions.mjs';
import { StytchEventType } from '../../../../../../core/src/public/ui.mjs';

const PasswordSetNew = ()=>{
    const { i18n: $__i18n, _: $__ } = useLingui();
    const onError = useErrorCallback();
    const onEvent = useEventCallback();
    const { email, resendResetPassword, goBack } = useResetResendPasswordActions();
    return /*#__PURE__*/ React__default.createElement(EmailActionLayout, {
        header: $__i18n._({
            id: "password.setNew.title",
            message: "Check your email"
        }),
        description: /*#__PURE__*/ React__default.createElement(Trans, {
            id: "password.setNew.content",
            message: "A login link was sent to you at <bold>{email}</bold>.",
            components: {
                bold: /*#__PURE__*/ React__default.createElement("b", null)
            },
            values: {
                email
            }
        }),
        resend: async ()=>{
            try {
                const data = await resendResetPassword();
                onEvent({
                    type: StytchEventType.PasswordResetByEmailStart,
                    data
                });
            // eslint-disable-next-line @typescript-eslint/no-explicit-any
            } catch (e) {
                onError(e);
                throw e;
            }
        },
        goBack: goBack
    });
};

export { PasswordSetNew };
//# sourceMappingURL=PasswordSetNew.mjs.map
