'use strict';

var _defineProperty = require('@babel/runtime/helpers/defineProperty');
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
var React = require('react');
var formik = require('formik');
var ramda = require('ramda');
var Textarea = require('../Textarea-DxdJutA8.js');
var jsxRuntime = require('react/jsx-runtime');
require('@babel/runtime/helpers/toConsumableArray');
require('@babel/runtime/helpers/slicedToArray');
require('classnames');
require('../useId-DXHUzdxd.js');
require('react-router-dom');
require('@bigbinary/neeto-hotkeys');
require('../overlayManager.js');
require('@babel/runtime/helpers/classCallCheck');
require('@babel/runtime/helpers/createClass');
require('../index-CNZKW5X0.js');
require('@bigbinary/neeto-cist');
require('qs');
require('../en-B1i-pQJm.js');
require('../index-BgzkP01c.js');
require('dayjs');
require('dayjs/plugin/localeData');
require('dayjs/plugin/utc');
require('dayjs/plugin/weekday');
require('dayjs/plugin/weekOfYear');
require('i18next');
require('../Label.js');
require('@bigbinary/neeto-icons/Help');
require('../Button.js');
require('../Spinner.js');
require('../Tooltip.js');
require('@tippyjs/react');
require('tippy.js');
require('../usePrefersReducedMotion-D2Ck84HM.js');
require('../Popover.js');
require('../Typography.js');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var _defineProperty__default = /*#__PURE__*/_interopDefault(_defineProperty);
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefault(_objectWithoutProperties);

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__default.default(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 FormikTextarea = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
  var name = _ref.name,
    rest = _objectWithoutProperties__default.default(_ref, _excluded);
  return /*#__PURE__*/jsxRuntime.jsx(formik.Field, {
    name: name,
    children: function children(_ref2) {
      var field = _ref2.field,
        meta = _ref2.meta,
        form = _ref2.form;
      var _form$status = form.status,
        status = _form$status === void 0 ? {} : _form$status,
        setStatus = form.setStatus;
      var fieldStatus = formik.getIn(status, name);
      var fieldProps = _objectSpread(_objectSpread({}, field), {}, {
        onChange: function onChange(e) {
          setStatus(ramda.dissoc(name, status));
          field.onChange(e);
        }
      });
      return /*#__PURE__*/jsxRuntime.jsx(Textarea.Textarea, _objectSpread({
        error: meta.touched ? meta.error || fieldStatus : ""
      }, _objectSpread(_objectSpread({
        ref: ref
      }, fieldProps), rest)));
    }
  });
});
FormikTextarea.displayName = "FormikTextarea";

module.exports = FormikTextarea;
//# sourceMappingURL=Textarea.js.map
