function c(r, a, n) {
  return (r - a) / (n - a);
}
function s(r, a, n, o) {
  var e = c(a, n, o), t = {};
  switch (r) {
    case "rtl":
      t.right = "".concat(e * 100, "%"), t.transform = "translateX(50%)";
      break;
    case "btt":
      t.bottom = "".concat(e * 100, "%"), t.transform = "translateY(50%)";
      break;
    case "ttb":
      t.top = "".concat(e * 100, "%"), t.transform = "translateY(-50%)";
      break;
    default:
      t.left = "".concat(e * 100, "%"), t.transform = "translateX(-50%)";
      break;
  }
  return t;
}
function f(r, a) {
  return Array.isArray(r) ? r[a] : r;
}
export {
  s as getDirectionStyle,
  f as getIndex,
  c as getOffset
};
