'use strict';

import _extends from "@babel/runtime/helpers/extends";
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import React from 'react';
import { FormGroup } from './FormGroup';
import { AutosuggestControl } from './AutosuggestControl';
export var Autosuggest =
/*#__PURE__*/
function (_FormGroup) {
  _inheritsLoose(Autosuggest, _FormGroup);

  function Autosuggest() {
    return _FormGroup.apply(this, arguments) || this;
  }

  var _proto = Autosuggest.prototype;

  _proto.getInputDOMNode = function getInputDOMNode() {
    return this.refs.control.refs.autoSuggest.input;
  };

  _proto.renderInput = function renderInput(hasError) {
    var ariaDescProps = this.getAriaDescProps(hasError);
    return React.createElement(AutosuggestControl, _extends({}, this.getSafeProps(this.props), {
      ref: "control",
      hasFormGroupContainer: true
    }, ariaDescProps));
  };

  return Autosuggest;
}(FormGroup);

_defineProperty(Autosuggest, "propTypes", Object.assign({}, FormGroup.propTypes));

_defineProperty(Autosuggest, "defaultProps", Object.assign({}, FormGroup.defaultProps, {
  testAutomationId: 'suggestions'
}));