import { jsx } from 'react/jsx-runtime';
import { forwardRef } from 'react';
import { useFormikContext } from 'formik';
import { equals } from 'ramda';
import { B as Button } from '../Button-DSvnInaL.js';
import 'react-router-dom';
import '../utils-DdHUxIdC.js';
import '../renderIcon-tlvMyboj.js';
import '../primitives/Button.js';
import '../button-D6uWDFCs.js';
import '../index-D7Zy7P05.js';
import '../index-CfriMyrd.js';
import '../index-BtkPdosV.js';
import '../primitives/Spinner.js';
import 'react-i18next';
import '../loader-circle-DycHUAWN.js';
import '../createLucideIcon-C8ycilSN.js';
import '../primitives/Tooltip.js';
import '../tooltip-XkHLgxlU.js';
import '../index-DNzunGHb.js';
import '../index-CiyxEyB0.js';
import '../index-BNPynZWM.js';
import '../index-DhnfW8wQ.js';
import 'react-dom';
import '../index-CSUSJzOJ.js';
import '../index-zW4GjM5L.js';
import '../index-DOzu5J1s.js';
import '../index-C3hByjk3.js';
import '../floating-ui.react-dom-D8_f_WWh.js';
import '../index-BYZaLNq1.js';
import '../index-fV_U4ZJM.js';
import '../index-yFgkK_AM.js';
import '../index-Cor698lu.js';
import '../index-CSggBaQF.js';

const FormikButton = forwardRef(({ disabled, ...otherProps }, ref) => {
    const { handleSubmit, isSubmitting, values, initialValues, isValid } = useFormikContext();
    const isDisabled = disabled ?? (isSubmitting || equals(values, initialValues));
    return (jsx(Button, { ref: ref, disabled: isDisabled, loading: isSubmitting && isValid, onClick: () => handleSubmit(), ...otherProps }));
});
FormikButton.displayName = "FormikButton";

export { FormikButton };
//# sourceMappingURL=Button.js.map
