import { jsx } from 'react/jsx-runtime';
import { forwardRef } from 'react';
import { useField, useFormikContext, getIn } from 'formik';
import { dissoc } from 'ramda';
import { T as TreeSelect } from '../TreeSelect-BxsQrdjf.js';
import '../utils-DdHUxIdC.js';
import '../primitives/Popover.js';
import '../index-DNzunGHb.js';
import '../index-BtkPdosV.js';
import '../index-CiyxEyB0.js';
import '../index-BNPynZWM.js';
import '../index-DhnfW8wQ.js';
import 'react-dom';
import '../index-CSUSJzOJ.js';
import '../index-B4_fVWDx.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 '../SelectFieldWrapper-BJzq9aCY.js';
import '../primitives/Field.js';
import '../index-D7Zy7P05.js';
import '../label-B4qDF3W1.js';
import '../separator-BbhgePmX.js';
import '../Tree-C7r10UY5.js';
import '../chevron-down-BNi0ntys.js';
import '../createLucideIcon-C8ycilSN.js';
import '../chevron-right-DQnrO-ek.js';
import '../primitives/Checkbox.js';
import '../check-Cpkv29p1.js';
import '../index-30QpKM0j.js';
import '../loader-circle-DycHUAWN.js';
import '../index-DZXbzIgC.js';
import '../index-CSMSzzKM.js';
import '../redux-BKH6DnBB.js';
import '../x-_o2T3n6D.js';

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

export { FormikTreeSelect };
//# sourceMappingURL=TreeSelect.js.map
