'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
var Slider_tokens = require('../Slider.tokens.js');

var getTickStyle = function getTickStyle(_ref) {
  var tick = _ref.tick,
    min = _ref.min,
    max = _ref.max,
    isVertical = _ref.isVertical,
    reversed = _ref.reversed;
  var percent = (tick - min) / (max - min) * 100;
  var tickSizeVar = "var(".concat(Slider_tokens.tokens.tickSize, ")");
  if (isVertical) {
    var direction = reversed ? 'bottom' : 'top';
    if (tick === min) {
      return _rollupPluginBabelHelpers.defineProperty({}, direction, "calc(".concat(percent, "% + ").concat(tickSizeVar, " / 2 )"));
    }
    if (tick === max) {
      return _rollupPluginBabelHelpers.defineProperty({}, direction, "calc(".concat(percent, "% - ").concat(tickSizeVar, " / 2 )"));
    }
    return _rollupPluginBabelHelpers.defineProperty({}, direction, "".concat(percent, "%"));
  }
  if (tick === min) {
    return {
      left: "calc(".concat(percent, "% + ").concat(tickSizeVar, " / 2 )")
    };
  }
  if (tick === max) {
    return {
      left: "calc(".concat(percent, "% - ").concat(tickSizeVar, " / 2 )")
    };
  }
  return {
    left: "".concat(percent, "%")
  };
};

exports.getTickStyle = getTickStyle;
