(function (root, factory) {
  if (typeof define === 'function' && define.amd)
    define(['exports', 'kotlin', 'd2v-core-js', 'd2v-color-js'], factory);
  else if (typeof exports === 'object')
    factory(module.exports, require('kotlin'), require('d2v-core-js'), require('d2v-color-js'));
  else {
    if (typeof kotlin === 'undefined') {
      throw new Error("Error loading module 'd2v-interpolate-js'. Its dependency 'kotlin' was not found. Please, check whether 'kotlin' is loaded prior to 'd2v-interpolate-js'.");
    }
    if (typeof this['d2v-core-js'] === 'undefined') {
      throw new Error("Error loading module 'd2v-interpolate-js'. Its dependency 'd2v-core-js' was not found. Please, check whether 'd2v-core-js' is loaded prior to 'd2v-interpolate-js'.");
    }
    if (typeof this['d2v-color-js'] === 'undefined') {
      throw new Error("Error loading module 'd2v-interpolate-js'. Its dependency 'd2v-color-js' was not found. Please, check whether 'd2v-color-js' is loaded prior to 'd2v-interpolate-js'.");
    }
    root['d2v-interpolate-js'] = factory(typeof this['d2v-interpolate-js'] === 'undefined' ? {} : this['d2v-interpolate-js'], kotlin, this['d2v-core-js'], this['d2v-color-js']);
  }
}(this, function (_, Kotlin, $module$d2v_core_js, $module$d2v_color_js) {
  'use strict';
  var coerceIn = Kotlin.kotlin.ranges.coerceIn_nig4hr$;
  var numberToInt = Kotlin.numberToInt;
  var math = $module$d2v_core_js.io.data2viz.math;
  var coerceAtMost = Kotlin.kotlin.ranges.coerceAtMost_38ydlf$;
  var toLab = $module$d2v_color_js.io.data2viz.color.toLab_byfp7d$;
  var toHcla = $module$d2v_color_js.io.data2viz.color.toHcla_5jieu1$;
  var color = $module$d2v_color_js.io.data2viz.color;
  var Angle = $module$d2v_core_js.io.data2viz.math.Angle;
  var toHsla = $module$d2v_color_js.io.data2viz.color.toHsla_byfp7d$;
  var numberToDouble = Kotlin.numberToDouble;
  var round = Kotlin.kotlin.math.round_14dthe$;
  var roundToInt = Kotlin.kotlin.math.roundToInt_yrwdxr$;
  var Kind_CLASS = Kotlin.Kind.CLASS;
  var throwCCE = Kotlin.throwCCE;
  var Point = $module$d2v_core_js.io.data2viz.geom.Point;
  var Kind_OBJECT = Kotlin.Kind.OBJECT;
  var coerceAtLeast = Kotlin.kotlin.ranges.coerceAtLeast_38ydlf$;
  var indexOf = Kotlin.kotlin.collections.indexOf_2ws7j4$;
  function computeSpline(t1, v0, v1, v2, v3) {
    var t2 = t1 * t1;
    var t3 = t2 * t1;
    return ((1 - 3 * t1 + 3 * t2 - t3) * v0 + (4 - 6 * t2 + 3 * t3) * v1 + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2 + t3 * v3) / 6;
  }
  var Math_0 = Math;
  function basis$lambda(closure$n, closure$values) {
    return function (t) {
      var newT = coerceIn(t, 0.0, 1.0);
      var tmp$;
      if (t <= 0)
        tmp$ = 0;
      else {
        var tmp$_0;
        if (t >= 1)
          tmp$_0 = closure$n - 1 | 0;
        else {
          var x = t * closure$n;
          tmp$_0 = numberToInt(Math_0.floor(x));
        }
        tmp$ = tmp$_0;
      }
      var currentIndex = tmp$;
      var v1 = closure$values.get_za3lpa$(currentIndex);
      var v2 = closure$values.get_za3lpa$(currentIndex + 1 | 0);
      var v0 = currentIndex > 0 ? closure$values.get_za3lpa$(currentIndex - 1 | 0) : (2 * v1 | 0) - v2 | 0;
      var v3 = currentIndex < (closure$n - 1 | 0) ? closure$values.get_za3lpa$(currentIndex + 2 | 0) : (2 * v2 | 0) - v1 | 0;
      return computeSpline((newT - currentIndex / closure$n) * closure$n, v0, v1, v2, v3);
    };
  }
  function basis(values) {
    var n = values.size - 1 | 0;
    return basis$lambda(n, values);
  }
  function basisClosed$lambda(closure$n, closure$values) {
    return function (t) {
      var newT = t < 0 ? t % 1 : t % 1 + 1;
      var x = newT * closure$n;
      var currentIndex = numberToInt(Math_0.floor(x));
      var v0 = closure$values.get_za3lpa$((currentIndex + closure$n - 1 | 0) % closure$n);
      var v1 = closure$values.get_za3lpa$(currentIndex % closure$n);
      var v2 = closure$values.get_za3lpa$((currentIndex + 1 | 0) % closure$n);
      var v3 = closure$values.get_za3lpa$((currentIndex + 2 | 0) % closure$n);
      return computeSpline((newT - (currentIndex / closure$n | 0)) * closure$n, v0, v1, v2, v3);
    };
  }
  function basisClosed(values) {
    var n = values.size;
    return basisClosed$lambda(n, values);
  }
  function gamma$lambda(closure$gamma) {
    return function (a, b) {
      return closure$gamma === 1.0 ? linearClamped(a, b - a) : exponential(a, b, closure$gamma);
    };
  }
  function gamma(gamma) {
    if (gamma === void 0)
      gamma = 1.0;
    return gamma$lambda(gamma);
  }
  function ungamma$lambda(closure$y) {
    return function (a, b) {
      return closure$y === 1.0 ? uninterpolateNumber_0(a, b) : exponential(a, b, closure$y);
    };
  }
  function ungamma(y) {
    if (y === void 0)
      y = 1.0;
    return ungamma$lambda(y);
  }
  function interpolateHue$lambda(closure$a2, closure$diff, closure$long) {
    return function (t) {
      if (!closure$long && closure$diff < -math.PI)
        return linearClamped(closure$a2.rad, closure$diff + math.TAU)(t);
      else if (!closure$long && closure$diff > math.PI)
        return linearClamped(closure$a2.rad, closure$diff - math.TAU)(t);
      else
        return linearClamped(closure$a2.rad, closure$diff)(t);
    };
  }
  function interpolateHue(from, to, long) {
    if (long === void 0)
      long = false;
    var a2 = from.normalize();
    var b2 = to.normalize();
    var diff = b2.rad - a2.rad;
    return interpolateHue$lambda(a2, diff, long);
  }
  function linearClamped$lambda(closure$a, closure$b) {
    return function (t) {
      return closure$a + coerceIn(t, 0.0, 1.0) * closure$b;
    };
  }
  function linearClamped(a, b) {
    return linearClamped$lambda(a, b);
  }
  function exponential$lambda(closure$na, closure$nb, closure$ny) {
    return function (t) {
      var $receiver = closure$na + t * closure$nb;
      var x = closure$ny;
      return Math_0.pow($receiver, x);
    };
  }
  function exponential(a, b, y) {
    var ny = 1 / y;
    var na = Math_0.pow(a, y);
    var nb = Math_0.pow(b, y) - na;
    return exponential$lambda(na, nb, ny);
  }
  function getSplineInterpolator$lambda(a) {
    return basisClosed(a);
  }
  function getSplineInterpolator$lambda_0(a) {
    return basis(a);
  }
  function getSplineInterpolator(cyclical) {
    return cyclical ? getSplineInterpolator$lambda : getSplineInterpolator$lambda_0;
  }
  function quad(x) {
    return x * x;
  }
  function cubicIn(x) {
    return x * x * x;
  }
  function cubicOut(t) {
    return (t - 1) * (t - 1) * (t - 1) + 1;
  }
  function cubicInOut(t) {
    return (t <= 0.5 ? 8 * t * t * t : (2 * t - 2) * (2 * t - 2) * (2 * t - 2) + 2) / 2;
  }
  function sin(x) {
    var x_0 = x * math.HALFPI_ANGLE.rad;
    return 1 - Math_0.cos(x_0);
  }
  function poly$lambda(closure$e) {
    return function (t) {
      var x = closure$e;
      return Math_0.pow(t, x);
    };
  }
  function poly(e) {
    return poly$lambda(e);
  }
  function circleIn(t) {
    var x = 1 - coerceAtMost(t * t, 1.0);
    return 1 - Math_0.sqrt(x);
  }
  function circleOut(t) {
    var x = 1 - (t - 1) * (t - 1);
    return Math_0.sqrt(x);
  }
  function interpolateHcl$lambda(closure$h, closure$c, closure$l) {
    return function (percent) {
      return color.Colors.hcl_b90iom$(new Angle(closure$h(percent)), closure$c(percent), closure$l(percent));
    };
  }
  function interpolateHcl(start, end, long) {
    var startHCL = toHcla(toLab(start.toRgb()));
    var endHCL = toHcla(toLab(end.toRgb()));
    var colorInterpolator = gamma();
    if (startHCL.isAchromatic())
      startHCL = color.Colors.hcl_b90iom$(endHCL.h, startHCL.c, startHCL.l, startHCL.alpha);
    if (endHCL.isAchromatic())
      endHCL = color.Colors.hcl_b90iom$(startHCL.h, endHCL.c, endHCL.l, endHCL.alpha);
    var h = interpolateHue(startHCL.h, endHCL.h, long);
    var c = colorInterpolator(startHCL.c, endHCL.c);
    var l = colorInterpolator(startHCL.l, endHCL.l);
    return interpolateHcl$lambda(h, c, l);
  }
  function hclLongInterpolator(start, end) {
    return interpolateHcl(start, end, true);
  }
  function hclInterpolator(start, end) {
    return interpolateHcl(start, end, false);
  }
  function interpolateHsl$lambda(closure$h, closure$s, closure$l) {
    return function (percent) {
      return color.Colors.hsl_b90iom$(new Angle(closure$h(percent)), closure$s(percent), closure$l(percent));
    };
  }
  function interpolateHsl(start, end, long) {
    var startHSL = toHsla(start.toRgb());
    var endHSL = toHsla(end.toRgb());
    var colorInterpolator = gamma();
    if (startHSL.isAchromatic())
      startHSL = color.Colors.hsl_b90iom$(endHSL.h, endHSL.s, startHSL.l, startHSL.alpha);
    if (endHSL.isAchromatic())
      endHSL = color.Colors.hsl_b90iom$(startHSL.h, startHSL.s, endHSL.l, endHSL.alpha);
    var h = interpolateHue(startHSL.h, endHSL.h, long);
    var s = colorInterpolator(startHSL.s, endHSL.s);
    var l = colorInterpolator(startHSL.l, endHSL.l);
    return interpolateHsl$lambda(h, s, l);
  }
  function hslLongInterpolator(start, end) {
    return interpolateHsl(start, end, true);
  }
  function hslInterpolator(start, end) {
    return interpolateHsl(start, end, false);
  }
  function interpolateLab$lambda(closure$l, closure$a, closure$b) {
    return function (percent) {
      return color.Colors.lab_6y0v78$(closure$l(percent), closure$a(percent), closure$b(percent));
    };
  }
  function interpolateLab(start, end) {
    var startLab = toLab(start.toRgb());
    var endLab = toLab(end.toRgb());
    var colorInterpolator = gamma();
    var l = colorInterpolator(startLab.labL, endLab.labL);
    var a = colorInterpolator(startLab.labA, endLab.labA);
    var b = colorInterpolator(startLab.labB, endLab.labB);
    return interpolateLab$lambda(l, a, b);
  }
  function labInterpolator(start, end) {
    return interpolateLab(start, end);
  }
  function interpolateNumber$lambda(closure$a, closure$diff) {
    return function (t) {
      return numberToDouble(closure$a) + t * closure$diff;
    };
  }
  function interpolateNumber(a, b) {
    var diff = numberToDouble(b) - numberToDouble(a);
    return interpolateNumber$lambda(a, diff);
  }
  function interpolateNumber$lambda_0(closure$a, closure$diff) {
    return function (t) {
      return closure$a + t * closure$diff;
    };
  }
  function interpolateNumber_0(a, b) {
    var diff = b - a;
    return interpolateNumber$lambda_0(a, diff);
  }
  function interpolateRound$lambda(closure$a, closure$diff) {
    return function (t) {
      return round(closure$a + t * closure$diff);
    };
  }
  function interpolateRound(a, b) {
    var diff = b - a;
    return interpolateRound$lambda(a, diff);
  }
  function uninterpolateNumber$lambda(closure$start, closure$end) {
    return function (t) {
      return (t - closure$start) / (closure$end - closure$start);
    };
  }
  function uninterpolateNumber(start, end) {
    return uninterpolateNumber$lambda(start, end);
  }
  function uninterpolateNumber$lambda_0(closure$end, closure$start) {
    return function (it) {
      return closure$end !== closure$start ? (it - closure$start) / (closure$end - closure$start) : closure$start;
    };
  }
  function uninterpolateNumber_0(start, end) {
    return uninterpolateNumber$lambda_0(end, start);
  }
  function identity(t) {
    return t;
  }
  function interpolateRgb$lambda(closure$r, closure$g, closure$b) {
    return function (percent) {
      return color.Colors.rgb_gb4hak$(roundToInt(closure$r(percent)), roundToInt(closure$g(percent)), roundToInt(closure$b(percent)));
    };
  }
  function interpolateRgb(start, end, gamma_0) {
    if (gamma_0 === void 0)
      gamma_0 = 1.0;
    var interpolator = gamma(gamma_0);
    var r = interpolator(start.r, end.r);
    var g = interpolator(start.g, end.g);
    var b = interpolator(start.b, end.b);
    return interpolateRgb$lambda(r, g, b);
  }
  function lRGBInterpolator$lambda(closure$start, closure$end) {
    return function (it) {
      var percent = coerceIn(it, 0.0, 1.0);
      var $receiver = closure$start;
      var tmp$ = Math_0.pow($receiver, 2) * (1 - percent);
      var $receiver_0 = closure$end;
      var x = tmp$ + Math_0.pow($receiver_0, 2) * percent;
      return Math_0.sqrt(x);
    };
  }
  function lRGBInterpolator(start, end) {
    return lRGBInterpolator$lambda(start, end);
  }
  function interpolateLRgb$lambda(closure$r, closure$g, closure$b) {
    return function (percent) {
      return color.Colors.rgb_gb4hak$(roundToInt(closure$r(percent)), roundToInt(closure$g(percent)), roundToInt(closure$b(percent)));
    };
  }
  function interpolateLRgb(start, end) {
    var r = lRGBInterpolator(start.r, end.r);
    var g = lRGBInterpolator(start.g, end.g);
    var b = lRGBInterpolator(start.b, end.b);
    return interpolateLRgb$lambda(r, g, b);
  }
  function interpolateRgbBasis$lambda(closure$r, closure$g, closure$b) {
    return function (percent) {
      return color.Colors.rgb_gb4hak$(roundToInt(closure$r(percent)), roundToInt(closure$g(percent)), roundToInt(closure$b(percent)));
    };
  }
  var collectionSizeOrDefault = Kotlin.kotlin.collections.collectionSizeOrDefault_ba2ldo$;
  var ArrayList_init = Kotlin.kotlin.collections.ArrayList_init_ww73n8$;
  function interpolateRgbBasis(colorsList, cyclical) {
    if (cyclical === void 0)
      cyclical = false;
    var spline = getSplineInterpolator(cyclical);
    var destination = ArrayList_init(collectionSizeOrDefault(colorsList, 10));
    var tmp$;
    tmp$ = colorsList.iterator();
    while (tmp$.hasNext()) {
      var item = tmp$.next();
      destination.add_11rb$(item.r);
    }
    var r = spline(destination);
    var destination_0 = ArrayList_init(collectionSizeOrDefault(colorsList, 10));
    var tmp$_0;
    tmp$_0 = colorsList.iterator();
    while (tmp$_0.hasNext()) {
      var item_0 = tmp$_0.next();
      destination_0.add_11rb$(item_0.g);
    }
    var g = spline(destination_0);
    var destination_1 = ArrayList_init(collectionSizeOrDefault(colorsList, 10));
    var tmp$_1;
    tmp$_1 = colorsList.iterator();
    while (tmp$_1.hasNext()) {
      var item_1 = tmp$_1.next();
      destination_1.add_11rb$(item_1.b);
    }
    var b = spline(destination_1);
    return interpolateRgbBasis$lambda(r, g, b);
  }
  function rgbBasisInterpolator(colors) {
    return interpolateRgbBasis(colors, false);
  }
  function rgbBasisClosedInterpolator(colors) {
    return interpolateRgbBasis(colors, true);
  }
  function rgbDefaultInterpolator(start, end) {
    return interpolateRgb(start, end);
  }
  function rgbLinearInterpolator(start, end) {
    return interpolateLRgb(start, end);
  }
  function DomainToViz(domain, viz) {
    this.domain = domain;
    this.viz = viz;
  }
  DomainToViz.$metadata$ = {
    kind: Kind_CLASS,
    simpleName: 'DomainToViz',
    interfaces: []
  };
  DomainToViz.prototype.component1 = function () {
    return this.domain;
  };
  DomainToViz.prototype.component2 = function () {
    return this.viz;
  };
  DomainToViz.prototype.copy_xwzc9p$ = function (domain, viz) {
    return new DomainToViz(domain === void 0 ? this.domain : domain, viz === void 0 ? this.viz : viz);
  };
  DomainToViz.prototype.toString = function () {
    return 'DomainToViz(domain=' + Kotlin.toString(this.domain) + (', viz=' + Kotlin.toString(this.viz)) + ')';
  };
  DomainToViz.prototype.hashCode = function () {
    var result = 0;
    result = result * 31 + Kotlin.hashCode(this.domain) | 0;
    result = result * 31 + Kotlin.hashCode(this.viz) | 0;
    return result;
  };
  DomainToViz.prototype.equals = function (other) {
    return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.domain, other.domain) && Kotlin.equals(this.viz, other.viz)))));
  };
  function linkedTo($receiver, that) {
    return new DomainToViz($receiver, that);
  }
  function NumberToColor(start, end) {
    this.domainToNormalized = uninterpolateNumber_0(start.domain, end.domain);
    this.normalizedToColor = rgbDefaultInterpolator(start.viz, end.viz);
    this.numberToColor = NumberToColor$numberToColor$lambda(this);
  }
  function NumberToColor$numberToColor$lambda(this$NumberToColor) {
    return function (number) {
      var tmp$;
      return this$NumberToColor.normalizedToColor(this$NumberToColor.domainToNormalized(typeof (tmp$ = number) === 'number' ? tmp$ : throwCCE()));
    };
  }
  NumberToColor.$metadata$ = {
    kind: Kind_CLASS,
    simpleName: 'NumberToColor',
    interfaces: []
  };
  function scale() {
  }
  function scale$linear() {
    scale$linear_instance = this;
  }
  function scale$linear$pointsToPoints$lambda(closure$start, closure$end, this$linear) {
    return function (pt) {
      return new Point(this$linear.numberToNumber_u0n7dg$(linkedTo(closure$start.domain.x, closure$start.viz.x), linkedTo(closure$end.domain.x, closure$end.viz.x))(pt.x), this$linear.numberToNumber_u0n7dg$(linkedTo(closure$start.domain.y, closure$start.viz.y), linkedTo(closure$end.domain.y, closure$end.viz.y))(pt.y));
    };
  }
  scale$linear.prototype.pointsToPoints_kcwy98$ = function (start, end) {
    return scale$linear$pointsToPoints$lambda(start, end, this);
  };
  function scale$linear$numberToNumber$lambda(closure$start, closure$end) {
    return function (domain) {
      var tmp$;
      return interpolateNumber_0(closure$start.viz, closure$end.viz)(uninterpolateNumber_0(closure$start.domain, closure$end.domain)(typeof (tmp$ = domain) === 'number' ? tmp$ : throwCCE()));
    };
  }
  scale$linear.prototype.numberToNumber_u0n7dg$ = function (start, end) {
    return scale$linear$numberToNumber$lambda(start, end);
  };
  scale$linear.prototype.numberToColor_mj6dn0$ = function (start, end) {
    return (new NumberToColor(start, end)).numberToColor;
  };
  scale$linear.$metadata$ = {
    kind: Kind_OBJECT,
    simpleName: 'linear',
    interfaces: []
  };
  var scale$linear_instance = null;
  function scale$linear_getInstance() {
    if (scale$linear_instance === null) {
      new scale$linear();
    }
    return scale$linear_instance;
  }
  function scale$ordinal() {
    scale$ordinal_instance = this;
  }
  scale$ordinal.prototype.bands_hlnlxj$ = function (domain, initBandScale) {
    var $receiver = new BandScale(domain);
    initBandScale($receiver);
    return $receiver;
  };
  scale$ordinal.$metadata$ = {
    kind: Kind_OBJECT,
    simpleName: 'ordinal',
    interfaces: []
  };
  var scale$ordinal_instance = null;
  function scale$ordinal_getInstance() {
    if (scale$ordinal_instance === null) {
      new scale$ordinal();
    }
    return scale$ordinal_instance;
  }
  scale.$metadata$ = {
    kind: Kind_CLASS,
    simpleName: 'scale',
    interfaces: []
  };
  function BandScale(domain) {
    this.domain = domain;
    this.start_adfnc5$_0 = 0.0;
    this.stop_ovb3lh$_0 = 1.0;
    this.padding_fbdm1i$_0 = new BandScale$Padding(0.0, 0.0);
    this.round = false;
    this.bandwidth_gl43a$_0 = 0.0;
    this.step_ovbb0f$_0 = 0.0;
    this.rescale();
  }
  function BandScale$Padding(inner, outer) {
    this.inner = inner;
    this.outer = outer;
  }
  BandScale$Padding.$metadata$ = {
    kind: Kind_CLASS,
    simpleName: 'Padding',
    interfaces: []
  };
  BandScale$Padding.prototype.component1 = function () {
    return this.inner;
  };
  BandScale$Padding.prototype.component2 = function () {
    return this.outer;
  };
  BandScale$Padding.prototype.copy_lu1900$ = function (inner, outer) {
    return new BandScale$Padding(inner === void 0 ? this.inner : inner, outer === void 0 ? this.outer : outer);
  };
  BandScale$Padding.prototype.toString = function () {
    return 'Padding(inner=' + Kotlin.toString(this.inner) + (', outer=' + Kotlin.toString(this.outer)) + ')';
  };
  BandScale$Padding.prototype.hashCode = function () {
    var result = 0;
    result = result * 31 + Kotlin.hashCode(this.inner) | 0;
    result = result * 31 + Kotlin.hashCode(this.outer) | 0;
    return result;
  };
  BandScale$Padding.prototype.equals = function (other) {
    return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.inner, other.inner) && Kotlin.equals(this.outer, other.outer)))));
  };
  Object.defineProperty(BandScale.prototype, 'start', {
    get: function () {
      return this.start_adfnc5$_0;
    },
    set: function (value) {
      this.start_adfnc5$_0 = value;
      this.rescale();
    }
  });
  Object.defineProperty(BandScale.prototype, 'stop', {
    get: function () {
      return this.stop_ovb3lh$_0;
    },
    set: function (value) {
      this.stop_ovb3lh$_0 = value;
      this.rescale();
    }
  });
  Object.defineProperty(BandScale.prototype, 'padding', {
    get: function () {
      return this.padding_fbdm1i$_0;
    },
    set: function (value) {
      this.padding_fbdm1i$_0 = value;
      this.rescale();
    }
  });
  BandScale.prototype.padding_lu1900$ = function (inner, outer) {
    if (inner === void 0)
      inner = 0.0;
    if (outer === void 0)
      outer = inner;
    return new BandScale$Padding(inner, outer);
  };
  Object.defineProperty(BandScale.prototype, 'bandwidth', {
    get: function () {
      return this.bandwidth_gl43a$_0;
    },
    set: function (bandwidth) {
      this.bandwidth_gl43a$_0 = bandwidth;
    }
  });
  Object.defineProperty(BandScale.prototype, 'step', {
    get: function () {
      return this.step_ovbb0f$_0;
    },
    set: function (step) {
      this.step_ovbb0f$_0 = step;
    }
  });
  BandScale.prototype.rescale = function () {
    var n = this.domain.size;
    this.step = (numberToDouble(this.stop) - numberToDouble(this.start)) / coerceAtLeast(n - this.padding.inner + this.padding.outer * 2, 1.0);
    if (this.round) {
      var x = this.step;
      this.step = Math_0.floor(x);
    }
    this.bandwidth = this.step * (1 - this.padding.inner);
  };
  BandScale.prototype.invoke_11rb$ = function (key) {
    var i = indexOf(this.domain, key);
    return this.padding.outer + i * this.step;
  };
  BandScale.$metadata$ = {
    kind: Kind_CLASS,
    simpleName: 'BandScale',
    interfaces: []
  };
  var package$io = _.io || (_.io = {});
  var package$data2viz = package$io.data2viz || (package$io.data2viz = {});
  var package$interpolate = package$data2viz.interpolate || (package$data2viz.interpolate = {});
  package$interpolate.computeSpline_vrk9a6$ = computeSpline;
  package$interpolate.basis_pqoyrt$ = basis;
  package$interpolate.basisClosed_pqoyrt$ = basisClosed;
  package$interpolate.gamma_tq0o01$ = gamma;
  package$interpolate.ungamma_tq0o01$ = ungamma;
  package$interpolate.interpolateHue_totmiw$ = interpolateHue;
  package$interpolate.getSplineInterpolator_vft4zs$ = getSplineInterpolator;
  package$interpolate.quad_14dthe$ = quad;
  package$interpolate.cubicIn_14dthe$ = cubicIn;
  package$interpolate.cubicOut_14dthe$ = cubicOut;
  package$interpolate.cubicInOut_14dthe$ = cubicInOut;
  package$interpolate.sin_14dthe$ = sin;
  package$interpolate.poly_14dthe$ = poly;
  package$interpolate.circleIn_14dthe$ = circleIn;
  package$interpolate.circleOut_14dthe$ = circleOut;
  package$interpolate.hclLongInterpolator_lu7xrq$ = hclLongInterpolator;
  package$interpolate.hclInterpolator_lu7xrq$ = hclInterpolator;
  package$interpolate.hslLongInterpolator_lu7xrq$ = hslLongInterpolator;
  package$interpolate.hslInterpolator_lu7xrq$ = hslInterpolator;
  package$interpolate.labInterpolator_lu7xrq$ = labInterpolator;
  package$interpolate.interpolateNumber_z8e4lc$ = interpolateNumber;
  package$interpolate.interpolateNumber_lu1900$ = interpolateNumber_0;
  package$interpolate.interpolateRound_lu1900$ = interpolateRound;
  package$interpolate.uninterpolateNumber_dleff0$ = uninterpolateNumber;
  package$interpolate.uninterpolateNumber_lu1900$ = uninterpolateNumber_0;
  package$interpolate.identity_14dthe$ = identity;
  package$interpolate.rgbBasisInterpolator_o5f480$ = rgbBasisInterpolator;
  package$interpolate.rgbBasisClosedInterpolator_o5f480$ = rgbBasisClosedInterpolator;
  package$interpolate.rgbDefaultInterpolator_lu7xrq$ = rgbDefaultInterpolator;
  package$interpolate.rgbLinearInterpolator_lu7xrq$ = rgbLinearInterpolator;
  package$interpolate.DomainToViz = DomainToViz;
  package$interpolate.linkedTo_ujzrz7$ = linkedTo;
  package$interpolate.NumberToColor = NumberToColor;
  Object.defineProperty(scale, 'linear', {
    get: scale$linear_getInstance
  });
  Object.defineProperty(scale, 'ordinal', {
    get: scale$ordinal_getInstance
  });
  package$interpolate.scale = scale;
  BandScale.Padding = BandScale$Padding;
  package$interpolate.BandScale = BandScale;
  Kotlin.defineModule('d2v-interpolate-js', _);
  return _;
}));

//# sourceMappingURL=d2v-interpolate-js.js.map
