"use strict";var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard"),_interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends")),_defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty")),React=_interopRequireWildcard(require("react")),_formik=require("formik"),_get=_interopRequireDefault(require("lodash/get")),_index=_interopRequireDefault(require("./index"));function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var source,i=1;i<arguments.length;i++)source=null==arguments[i]?{}:arguments[i],i%2?ownKeys(Object(source),!0).forEach(function(key){(0,_defineProperty2["default"])(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))});return target}var FormikDatePicker=function(props){return/*#__PURE__*/React.createElement(_formik.Field,{name:props.name},function(_ref){var field=_ref.field,_ref$form=_ref.form,touched=_ref$form.touched,errors=_ref$form.errors,setFieldValue=_ref$form.setFieldValue,setFieldTouched=_ref$form.setFieldTouched;return/*#__PURE__*/React.createElement(_index["default"],(0,_extends2["default"])({},props,field,{textFieldProps:_objectSpread(_objectSpread({},props.textFieldProps||{}),{},{error:(0,_get["default"])(touched,field.name)&&(0,_get["default"])(errors,field.name)}),onDateChange:function onDateChange(date){setFieldValue(field.name,date),setFieldTouched(field.name)}}))})},_default=FormikDatePicker;exports["default"]=_default;