import { jsx } from 'react/jsx-runtime';
import { forwardRef } from 'react';
import { useField, useFormikContext, getIn } from 'formik';
import { dissoc } from 'ramda';
import { M as MultiEmailInput } from '../MultiEmailInput-SCTYovtX.js';
import '../utils-DdHUxIdC.js';
import '../primitives/Field.js';
import '../index-D7Zy7P05.js';
import '../label-B4qDF3W1.js';
import '../index-DhnfW8wQ.js';
import 'react-dom';
import '../index-BtkPdosV.js';
import '../separator-BbhgePmX.js';
import '../x-_o2T3n6D.js';
import '../createLucideIcon-C8ycilSN.js';

const FormikMultiEmailInput = forwardRef(({ name, onChange: onChangeProp, ...otherProps }, ref) => {
    const [field, meta, { setValue, setTouched }] = useField(name);
    const { status = {}, setStatus } = useFormikContext();
    const fieldStatus = getIn(status, name);
    return (jsx(MultiEmailInput, { ref: ref, error: meta.touched ? meta.error || fieldStatus : "", value: field.value, onBlur: () => setTouched(true), onChange: value => {
            setStatus(dissoc(name, status));
            setValue(value);
            onChangeProp?.(value);
        }, ...otherProps }));
});
FormikMultiEmailInput.displayName = "FormikMultiEmailInput";

export { FormikMultiEmailInput };
//# sourceMappingURL=MultiEmailInput.js.map
