export default function buildStyles(_ref) {
  var rotation = _ref.rotation,
    strokeLinecap = _ref.strokeLinecap,
    textColor = _ref.textColor,
    textSize = _ref.textSize,
    pathColor = _ref.pathColor,
    pathTransition = _ref.pathTransition,
    pathTransitionDuration = _ref.pathTransitionDuration,
    trailColor = _ref.trailColor,
    backgroundColor = _ref.backgroundColor;
  var rotationTransform = rotation == null ? undefined : "rotate(".concat(rotation, "turn)");
  var rotationTransformOrigin = rotation == null ? undefined : 'center center';
  return {
    root: {},
    path: removeUndefinedValues({
      stroke: pathColor,
      strokeLinecap: strokeLinecap,
      transform: rotationTransform,
      transformOrigin: rotationTransformOrigin,
      transition: pathTransition,
      transitionDuration: pathTransitionDuration == null ? undefined : "".concat(pathTransitionDuration, "s")
    }),
    trail: removeUndefinedValues({
      stroke: trailColor,
      strokeLinecap: strokeLinecap,
      transform: rotationTransform,
      transformOrigin: rotationTransformOrigin
    }),
    text: removeUndefinedValues({
      fill: textColor,
      fontSize: textSize
    }),
    background: removeUndefinedValues({
      fill: backgroundColor
    })
  };
}
function removeUndefinedValues(obj) {
  Object.keys(obj).forEach(function (key) {
    if (obj[key] == null) {
      delete obj[key];
    }
  });
  return obj;
}