"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _reactAutosizeTextarea = _interopRequireDefault(require("react-autosize-textarea"));
var _clsx = _interopRequireDefault(require("clsx"));
var _element = require("@wordpress/element");
var _editableText = _interopRequireDefault(require("../editable-text"));
var _jsxRuntime = require("react/jsx-runtime");
/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */

/**
 * Internal dependencies
 */

/**
 * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/plain-text/README.md
 */const PlainText = (0, _element.forwardRef)(({
  __experimentalVersion,
  ...props
}, ref) => {
  if (__experimentalVersion === 2) {
    return /*#__PURE__*/(0, _jsxRuntime.jsx)(_editableText.default, {
      ref: ref,
      ...props
    });
  }
  const {
    className,
    onChange,
    ...remainingProps
  } = props;
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactAutosizeTextarea.default, {
    ref: ref,
    className: (0, _clsx.default)('block-editor-plain-text', className),
    onChange: event => onChange(event.target.value),
    ...remainingProps
  });
});
var _default = exports.default = PlainText;
//# sourceMappingURL=index.js.map