"use strict";

exports.__esModule = true;
exports.getInternalLabel = getInternalLabel;
var _color = _interopRequireDefault(require("color"));
var _react = _interopRequireDefault(require("react"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function getInternalLabel(_ref) {
  var ellipsizedName = _ref.ellipsizedName,
    id = _ref.id,
    annotationType = _ref.annotationType,
    revTransform = _ref.revTransform,
    angleAdjust = _ref.angleAdjust,
    isPart = _ref.isPart,
    colorToUse = _ref.colorToUse,
    textPath = _ref.textPath,
    locationNumber = _ref.locationNumber;
  if (!ellipsizedName) return null;
  var pathId = "" + annotationType + id + (locationNumber !== null && locationNumber !== void 0 ? locationNumber : "");
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("path", {
    id: pathId,
    fill: "none",
    d: textPath.print()
  }), /*#__PURE__*/_react["default"].createElement("text", {
    className: "veLabelText veCircularViewInternalLabelText ve-monospace-font",
    transform: (revTransform || "") + (angleAdjust ? " rotate(" + angleAdjust + ")" : ""),
    fill: isPart ? "#ac68cc" : (0, _color["default"])(colorToUse).isDark() ? "white" : "black",
    dy: -3
  }, /*#__PURE__*/_react["default"].createElement("textPath", {
    textAnchor: "middle",
    startOffset: "50%",
    xlinkHref: "#" + pathId
  }, ellipsizedName)));
}