"use client";
const w = Math.sqrt(50), q = Math.sqrt(10), m = Math.sqrt(2);
function d(i, r, f) {
  const c = (r - i) / Math.max(0, f), l = Math.floor(Math.log10(c)), u = c / Math.pow(10, l), M = u >= w ? 10 : u >= q ? 5 : u >= m ? 2 : 1;
  let n, h, e;
  return l < 0 ? (e = Math.pow(10, -l) / M, n = Math.round(i * e), h = Math.round(r * e), n / e < i && ++n, h / e > r && --h, e = -e) : (e = Math.pow(10, l) * M, n = Math.round(i / e), h = Math.round(r / e), n * e < i && ++n, h * e > r && --h), h < n && 0.5 <= f && f < 2 ? d(i, r, f * 2) : [n, h, e];
}
function v(i, r, f) {
  if (r = +r, i = +i, f = +f, !(f > 0)) return [];
  if (i === r) return [i];
  const c = r < i, [l, u, M] = c ? d(r, i, f) : d(i, r, f);
  if (!(u >= l)) return [];
  const n = u - l + 1, h = new Array(n);
  if (c)
    if (M < 0) for (let e = 0; e < n; ++e) h[e] = (u - e) / -M;
    else for (let e = 0; e < n; ++e) h[e] = (u - e) * M;
  else if (M < 0) for (let e = 0; e < n; ++e) h[e] = (l + e) / -M;
  else for (let e = 0; e < n; ++e) h[e] = (l + e) * M;
  return h;
}
function k(i, r, f) {
  return r = +r, i = +i, f = +f, d(i, r, f)[2];
}
function x(i, r, f) {
  r = +r, i = +i, f = +f;
  const c = r < i, l = c ? k(r, i, f) : k(i, r, f);
  return (c ? -1 : 1) * (l < 0 ? 1 / -l : l);
}
export {
  v as default,
  k as tickIncrement,
  x as tickStep
};
