'use strict';

var jsxRuntime = require('react/jsx-runtime');
var React = require('react');
var formik = require('formik');
var ramda = require('ramda');
var TreeSelect = require('../TreeSelect-C9BSJt1d.js');
require('../utils-BhM0B89p.js');
require('../primitives/Popover.js');
require('../index-COPkC3I5.js');
require('../index-D-iDn9RI.js');
require('../index-CGUGhyIp.js');
require('../index-Bvu9MiFi.js');
require('../index-DMbj7vXd.js');
require('react-dom');
require('../index-lWVw05cs.js');
require('../index-CS_WSHYi.js');
require('../index-BwAq9ba8.js');
require('../index-CCdG4z4E.js');
require('../index-owSUsE-n.js');
require('../floating-ui.react-dom--alWUjS1.js');
require('../floating-ui.utils.dom-BGEmL7pd.js');
require('../index-Bf0WsHta.js');
require('../index-Df-Ffa3s.js');
require('../index-DcCSSgb7.js');
require('../index-CyrAgb4H.js');
require('../SelectFieldWrapper-BLVvwUcK.js');
require('../primitives/Field.js');
require('../HelpIcon-QpZY6Zmc.js');
require('../primitives/Tooltip.js');
require('../tooltip-hM8gc5L8.js');
require('../index-CB9xFokC.js');
require('../renderIcon-BRrpZu9a.js');
require('../createLucideIcon-D0tRgV6l.js');
require('../Popover-5BUgIW60.js');
require('../index-vioSzJOw.js');
require('../primitives/HoverCard.js');
require('../Typography-BW6xEk10.js');
require('../index-DuNgWCXZ.js');
require('../Button-DJSysuyG.js');
require('react-router-dom');
require('../primitives/Button.js');
require('../button-CSBhDSDJ.js');
require('../primitives/Spinner.js');
require('react-i18next');
require('../loader-circle-Bw7zP2Gn.js');
require('../label-BdcX4_ud.js');
require('../separator-DSL-aG1J.js');
require('../Tree-Y0ulyxew.js');
require('../chevron-down-CPsWSS51.js');
require('../chevron-right-0jNdwX2Q.js');
require('../primitives/Checkbox.js');
require('../check-BQgcDXys.js');
require('../index-CF951Pw9.js');
require('../index-DnKJmaCq.js');
require('../index-BrpkRQoS.js');
require('../redux-DEF7lAd1.js');
require('../x-Brw3FJst.js');

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

exports.FormikTreeSelect = FormikTreeSelect;
//# sourceMappingURL=TreeSelect.js.map
