import _defineProperty from '@babel/runtime/helpers/defineProperty';
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
import { forwardRef } from 'react';
import { useField, useFormikContext, getIn } from 'formik';
import { dissoc } from 'ramda';
import MultiEmailInput from '../MultiEmailInput.js';
import { jsx } from 'react/jsx-runtime';
import '@babel/runtime/helpers/toConsumableArray';
import 'classnames';
import '../react-select-creatable.esm-C-18UhvM.js';
import '@babel/runtime/helpers/esm/extends';
import '@babel/runtime/helpers/esm/objectSpread2';
import '@babel/runtime/helpers/esm/classCallCheck';
import '@babel/runtime/helpers/esm/createClass';
import '@babel/runtime/helpers/esm/inherits';
import '@babel/runtime/helpers/esm/createSuper';
import '@babel/runtime/helpers/esm/toConsumableArray';
import '@babel/runtime/helpers/extends';
import '@babel/runtime/helpers/esm/taggedTemplateLiteral';
import '@babel/runtime/helpers/esm/objectWithoutProperties';
import '@babel/runtime/helpers/esm/slicedToArray';
import '@babel/runtime/helpers/esm/typeof';
import '@babel/runtime/helpers/esm/defineProperty';
import 'react-dom';
import '@babel/runtime/helpers/objectSpread2';
import '@babel/runtime/helpers/classCallCheck';
import '@babel/runtime/helpers/createClass';
import '@babel/runtime/helpers/inherits';
import '@babel/runtime/helpers/createSuper';
import '@babel/runtime/helpers/taggedTemplateLiteral';
import '@babel/runtime/helpers/typeof';
import '../index-QWVp_Xt6.js';
import '@bigbinary/neeto-cist';
import 'qs';
import '../en-Dmu3B4Vs.js';
import '../index-DyUNP5G9.js';
import 'dayjs';
import 'dayjs/plugin/localeData';
import 'dayjs/plugin/utc';
import 'dayjs/plugin/weekday';
import 'dayjs/plugin/weekOfYear';
import 'i18next';
import '@babel/runtime/helpers/toArray';
import '@bigbinary/neeto-icons/Close';
import '../Tag.js';
import '../Label.js';
import '@bigbinary/neeto-icons/Help';
import '../Button.js';
import 'react-router-dom';
import '../Spinner.js';
import '../Tooltip.js';
import '@tippyjs/react';
import 'tippy.js';
import '@bigbinary/neeto-hotkeys';
import '../overlayManager.js';
import '../usePrefersReducedMotion-n4ZJtExQ.js';
import '../Popover.js';
import '../Typography.js';

var _excluded = ["name"];
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var FormikMultiEmailInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
  var name = _ref.name,
    otherProps = _objectWithoutProperties(_ref, _excluded);
  var _useField = useField(name),
    _useField2 = _slicedToArray(_useField, 3),
    field = _useField2[0],
    meta = _useField2[1],
    _useField2$ = _useField2[2],
    setValue = _useField2$.setValue,
    setTouched = _useField2$.setTouched;
  var _useFormikContext = useFormikContext(),
    _useFormikContext$sta = _useFormikContext.status,
    status = _useFormikContext$sta === void 0 ? {} : _useFormikContext$sta,
    setStatus = _useFormikContext.setStatus;
  var fieldStatus = getIn(status, name);
  return /*#__PURE__*/jsx(MultiEmailInput, _objectSpread({
    ref: ref,
    error: meta.touched ? meta.error || fieldStatus : "",
    name: field.name,
    value: field.value,
    onBlur: function onBlur() {
      return setTouched(true);
    },
    onChange: function onChange(value) {
      setStatus(dissoc(name, status));
      setValue(value);
    }
  }, otherProps));
});
FormikMultiEmailInput.displayName = "FormikMultiEmailInput";

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