"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _classnames = _interopRequireDefault(require("classnames"));

var _react = _interopRequireDefault(require("react"));

var _constants = require("../../constants");

var _Icon = _interopRequireDefault(require("../Icon"));

// Copyright 1999-2019. Plesk International GmbH. All rights reserved.
const MultiValue = ({
  baseClassName = "".concat(_constants.CLS_PREFIX, "select-multi-value"),
  onRemove,
  children,
  ...props
}) => {
  const onMouseDown = e => {
    e.preventDefault();
  };

  const onClick = e => {
    e.stopPropagation();
    onRemove();
  };

  return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
    className: (0, _classnames.default)(baseClassName)
  }, props), /*#__PURE__*/_react.default.createElement("div", {
    className: "".concat(baseClassName, "__content")
  }, /*#__PURE__*/_react.default.createElement("span", {
    className: "".concat(baseClassName, "__label")
  }, children), /*#__PURE__*/_react.default.createElement(_Icon.default, {
    className: "".concat(baseClassName, "__remove"),
    size: "12",
    onMouseDown: onMouseDown,
    onClick: onClick
  }, /*#__PURE__*/_react.default.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 12 12",
    focusable: "false",
    "aria-hidden": "true"
  }, /*#__PURE__*/_react.default.createElement("path", {
    d: "M3.85 8.854a.498.498 0 1 1-.704-.704L5.296 6l-2.15-2.15a.498.498 0 0 1 .704-.704L6 5.296l2.15-2.15a.498.498 0 1 1\r .704.704L6.704 6l2.15 2.15a.498.498 0 0 1-.704.704L6 6.704l-2.15 2.15z"
  })))));
};

var _default = MultiValue;
exports.default = _default;