"use client";
import { initRange as I } from "./init.js";
import O from "./ordinal.js";
import w from "../../d3-array/src/range.js";
function s() {
  var n = O().unknown(void 0), d = n.domain, v = n.range, t = 0, e = 1, i, f, o = !1, a = 0, p = 0, m = 0.5;
  delete n.unknown;
  function u() {
    var r = d().length, l = e < t, g = l ? e : t, h = l ? t : e;
    i = (h - g) / Math.max(1, r - a + p * 2), o && (i = Math.floor(i)), g += (h - g - i * (r - a)) * m, f = i * (1 - a), o && (g = Math.round(g), f = Math.round(f));
    var c = w(r).map(function(y) {
      return g + i * y;
    });
    return v(l ? c.reverse() : c);
  }
  return n.domain = function(r) {
    return arguments.length ? (d(r), u()) : d();
  }, n.range = function(r) {
    return arguments.length ? ([t, e] = r, t = +t, e = +e, u()) : [t, e];
  }, n.rangeRound = function(r) {
    return [t, e] = r, t = +t, e = +e, o = !0, u();
  }, n.bandwidth = function() {
    return f;
  }, n.step = function() {
    return i;
  }, n.round = function(r) {
    return arguments.length ? (o = !!r, u()) : o;
  }, n.padding = function(r) {
    return arguments.length ? (a = Math.min(1, p = +r), u()) : a;
  }, n.paddingInner = function(r) {
    return arguments.length ? (a = Math.min(1, r), u()) : a;
  }, n.paddingOuter = function(r) {
    return arguments.length ? (p = +r, u()) : p;
  }, n.align = function(r) {
    return arguments.length ? (m = Math.max(0, Math.min(1, r)), u()) : m;
  }, n.copy = function() {
    return s(d(), [t, e]).round(o).paddingInner(a).paddingOuter(p).align(m);
  }, I.apply(u(), arguments);
}
function M(n) {
  var d = n.copy;
  return n.padding = n.paddingOuter, delete n.paddingInner, delete n.paddingOuter, n.copy = function() {
    return M(d());
  }, n;
}
function k() {
  return M(s.apply(null, arguments).paddingInner(1));
}
export {
  s as default,
  k as point
};
