"use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;exports.__esModule = true;exports.TokenInputPlayground = void 0;var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _react = _interopRequireDefault(require("react"));

var _TokenInput = require("../../components/TokenInput");
var _Token = require("../../components/Token");function

getItems(_x) {return _getItems.apply(this, arguments);}function _getItems() {_getItems = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(query) {return _regenerator.default.wrap(function _callee$(_context) {while (1) switch (_context.prev = _context.next) {case 0:return _context.abrupt("return",
          Promise.resolve(
            ['First', 'Second', 'Third', 'Fourth', 'Fifth', 'Sixth'].filter(
              function (x) {return x.toLowerCase().includes(query.toLowerCase()) || x.toString() === query;}
            )
          ).then(function (res) {return new Promise(function (resolve) {return setTimeout(resolve.bind(null, res), 500);});}));case 1:case "end":return _context.stop();}}, _callee);}));return _getItems.apply(this, arguments);}var





TokenInputPlayground = exports.TokenInputPlayground = /*#__PURE__*/function (_React$Component) {function TokenInputPlayground() {var _this;for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];}_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;_this.
    state = { selectedItems: ['First', 'Second'] };return _this;}(0, _inheritsLoose2.default)(TokenInputPlayground, _React$Component);var _proto = TokenInputPlayground.prototype;_proto.

  render = function render() {var _this2 = this;
    return /*#__PURE__*/(
      _react.default.createElement(_TokenInput.TokenInput, {
        getItems: getItems,
        selectedItems: this.state.selectedItems,
        renderToken: function renderToken(item, _ref) {var isActive = _ref.isActive,onClick = _ref.onClick,onRemove = _ref.onRemove;return /*#__PURE__*/(
            _react.default.createElement(_Token.Token, { key: item.toString(), isActive: isActive, onClick: onClick, onRemove: onRemove },
            item
            ));},

        onValueChange: function onValueChange(itemsNew) {return _this2.setState({ selectedItems: itemsNew });} }
      ));

  };return TokenInputPlayground;}(_react.default.Component);