text: function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
  
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  
  import PropTypes from 'prop-types';
  import React, { Component } from 'react';
  import MessageList from './MessageList';
  import UserInput from './UserInput';
  import Header from './Header';
  
  var ChatWindow = /*#__PURE__*/function (_Component) {
    _inheritsLoose(ChatWindow, _Component);
  
    function ChatWindow(props) {
      return _Component.call(this, props) || this;
    }
  
    var _proto = ChatWindow.prototype;
  
    _proto.onUserInputSubmit = function onUserInputSubmit(message) {
      this.props.onUserInputSubmit(message);
    };
  
    _proto.onFilesSelected = function onFilesSelected(filesList) {
      this.props.onFilesSelected(filesList);
    };
  
    _proto.onButtonClick = function onButtonClick(button) {
      this.props.onButtonClick(button);
    };
  
    _proto.render = function render() {
      var messageList = this.props.messageList || [];
      var classList = ["sc-chat-window", this.props.isOpen ? "opened" : "closed"];
      return /*#__PURE__*/React.createElement("div", {
        className: classList.join(' ')
      }, /*#__PURE__*/React.createElement(Header, {
        teamName: this.props.agentProfile.teamName,
        imageUrl: this.props.agentProfile.imageUrl,
        onClose: this.props.onClose
      }), /*#__PURE__*/React.createElement(MessageList, {
        messages: messageList,
        imageUrl: this.props.agentProfile.imageUrl,
        onButtonClick: this.onButtonClick.bind(this)
      }), /*#__PURE__*/React.createElement(UserInput, {
        onSubmit: this.onUserInputSubmit.bind(this),
        onFilesSelected: this.onFilesSelected.bind(this),
        showEmoji: this.props.showEmoji
      }));
    };
  
    return ChatWindow;
  }(Component);
  
  ChatWindow.propTypes = process.env.NODE_ENV !== "production" ? {
    agentProfile: PropTypes.object.isRequired,
    isOpen: PropTypes.bool.isRequired,
    onClose: PropTypes.func.isRequired,
    onFilesSelected: PropTypes.func,
    onUserInputSubmit: PropTypes.func.isRequired,
    showEmoji: PropTypes.bool
  } : {};
  export default ChatWindow;