import { S as $, a as ee } from "./Slice.DiEswWa6.js";
import { aU as I, L as Y, T as D, aV as te, m as L, e as v, aq as S, aj as R, j as A, h as C, a as _, D as se, H as X, au as U, C as ie, q as b, G as k, r as G, K as ne, t as q, aW as J, av as Q } from "./am-chart.H2jnOzFc.js";
import { A as ae } from "./AxisLabelRadial.Bs1P_q_F.js";
import { B as Z } from "./BaseColumnSeries.C7jwOxIJ.js";
import { P as K } from "./Polygon.BwMvXN2H.js";
class V extends I {
  constructor() {
    super(...arguments), this.labels = this.addDisposer(new Y(D.new({}), () => te._new(this._root, {
      themeTags: L(this.labels.template.get("themeTags", []), this.get("themeTags", []))
    }, [this.labels.template]))), this.axisFills = this.addDisposer(new Y(D.new({}), () => $._new(this._root, {
      themeTags: L(this.axisFills.template.get("themeTags", ["fill"]), this.get("themeTags", []))
    }, [this.axisFills.template]))), this.pointPostion = [], this.pointDistance = [], this._normalizedPoints = [];
  }
  _afterNew() {
    this._settings.themeTags = L(this._settings.themeTags, ["renderer", "circular"]), super._afterNew(), this.setPrivateRaw("letter", "X"), this.setRaw("position", "absolute");
  }
  _beforeChanged() {
    super._beforeChanged(), this.isDirty("points") && this._updateLayout(), this.isDirty("yRenderer") && this.get("yRenderer").set("xRenderer", this);
  }
  /**
   * @ignore
   */
  processAxis() {
    super.processAxis(), this.axis.labelsContainer.set("isMeasured", !1);
  }
  /**
   * @ignore
   */
  _updateLayout() {
    const e = this.chart;
    if (e) {
      const t = this.get("points");
      if (t) {
        let s = 1 / 0, a = 1 / 0, i = -1 / 0, r = -1 / 0, o = 0, n = t[0];
        v(t, (x, d) => {
          s = Math.min(s, x.x), a = Math.min(a, x.y), i = Math.max(i, x.x), r = Math.max(r, x.y), o += Math.hypot(x.x - n.x, x.y - n.y), this.pointDistance[d] = o, n = x;
        }), v(t, (x, d) => {
          this.pointPostion[d] = this.pointDistance[d] / o;
        });
        let l = this.get("yRenderer").get("axisLength", 0), h = i - s + 2 * l, c = r - a + 2 * l, g = (s + i) / 2, m = (a + r) / 2, f = e.innerWidth(), u = e.innerHeight(), y = f / h, F = u / c, p = Math.min(y, F);
        this.getPrivate("autoScale", !0) || (p = 1), this.axis.setPrivateRaw("width", h * p), this.axis.setPrivateRaw("height", c * p), this.setPrivateRaw("centerX", g), this.setPrivateRaw("centerY", m), this.setPrivateRaw("scale", p), this.setPrivateRaw("axisLength", o), this.set("draw", (x) => {
          x.moveTo((t[0].x - g) * p, (t[0].y - m) * p), v(t, (d) => {
            x.lineTo((d.x - g) * p, (d.y - m) * p);
          });
        }), n = t[0], this._normalizedPoints = [], v(t, (x) => {
          let d = Math.hypot(x.x - n.x, x.y - n.y);
          for (let T = 1; T < d; T++) {
            let M = (n.x + (x.x - n.x) * T / d - g) * p, N = (n.y + (x.y - n.y) * T / d - m) * p;
            const B = this._normalizedPoints[this._normalizedPoints.length - 1];
            B && Math.hypot(M - B.x, N - B.y) < 0.5 || this._normalizedPoints.push({ x: M, y: N });
          }
          n = x;
        }), this.axis.markDirtySize();
      }
    }
  }
  /**
   * @ignore
   */
  updateGrid(e, t, s) {
    if (e) {
      t == null && (t = 0);
      let a = e.get("location", 0.5);
      s != null && s != t && (t = t + (s - t) * a), this.toggleVisibility(e, t, 0, 1);
      const i = this.positionToPoint(t, 0), r = this.positionToPoint(t, 1);
      e.set("draw", (o) => {
        o.moveTo(i.x, i.y), o.lineTo(r.x, r.y);
      });
    }
  }
  /**
   * Converts relative position to angle.
   *
   * @param   position  Position
   * @return            Angle
   */
  positionToAngle(e) {
    e = this.toGlobalPosition(e);
    let t = this.get("points"), s = this.getPrivate("axisLength", 0), a = 0;
    if (t) {
      let i = 0, r = t[0];
      S(t, (o) => {
        let n = Math.hypot(o.x - r.x, o.y - r.y);
        return i += n, i > e * s ? (a = R(r, o) + 90, !1) : (r = o, !0);
      });
    }
    return a;
  }
  getPoints(e, t, s, a) {
    let i = this.get("yRenderer"), r = [];
    if (e > s && ([e, s] = [s, e]), t > a && ([t, a] = [a, t]), i) {
      let o = this.positionToIndex(e), n = this.positionToIndex(s);
      r.push(this.positionToPoint(e, t));
      for (let l = o; l <= n + 1; l++) {
        let h = this.indexToPosition(l);
        h > e && h < s && r.push(this.positionToPoint(h, t));
      }
      if (r.push(this.positionToPoint(s, t)), a != t) {
        r.push(this.positionToPoint(s, a));
        for (let l = n + 1; l >= o; l--) {
          let h = this.indexToPosition(l);
          h > e && h < s && r.push(this.positionToPoint(h, a));
        }
        r.push(this.positionToPoint(e, a)), r.push(r[0]);
      }
    }
    return r;
  }
  // do not delete
  _handleOpposite() {
  }
  positionToIndex(e) {
    let t = this.get("points"), s = this.getPrivate("axisLength", 0), a = 0;
    if (e = this.toGlobalPosition(e), t && t.length > 1) {
      let i = 0, r = t[0];
      if (e <= 0)
        a = 0;
      else if (e >= 1)
        a = t.length - 1;
      else {
        let o = 0;
        S(t, (n) => {
          let l = Math.hypot(n.x - r.x, n.y - r.y);
          return i += l, i >= e * s ? (a = o, !1) : (r = n, o++, !0);
        });
      }
    }
    return a;
  }
  indexToPosition(e) {
    let t = this.get("points"), s = this.getPrivate("axisLength", 0), a = 0;
    if (t && t.length > 1) {
      let i = 0, r = t[0], o = 0;
      S(t, (n) => {
        if (a = i / s, o == e)
          return !1;
        let l = Math.hypot(n.x - r.x, n.y - r.y);
        return i += l, r = n, o++, !0;
      });
    }
    return this.toAxisPosition(a);
  }
  pointToPosition(e) {
    let t = 1 / 0, s = 0, a = this._normalizedPoints[0], i = 0;
    v(this._normalizedPoints, (h, c) => {
      let g = Math.hypot(h.x - e.x, h.y - e.y);
      g < t && (t = g, s = c, i = R(e, h) - R(a, h)), a = h;
    });
    const r = this.get("yRenderer"), o = this.getPrivate("scale", 1), n = this.get("yRenderer"), l = -t / (r.get("axisLength", 0) * o) * A(i) + n.get("axisLocation", 0);
    return { x: s / this._normalizedPoints.length, y: l };
  }
  /**
   * Converts relative position to an X/Y coordinate.
   *
   * @param   position  Position
   * @return            Point
   */
  positionToPoint(e, t, s) {
    t == null && (t = 0);
    const a = this.get("yRenderer");
    s || (e = this.toGlobalPosition(e)), t = a.toGlobalPosition(t), t -= a.get("axisLocation", 0);
    let i = this.get("points"), r = this.getPrivate("axisLength", 0), o = this.getPrivate("scale", 1), n = { x: 0, y: 0 }, l = 0;
    if (i && i.length > 1) {
      let p = 0, x = i[0];
      if (e <= 0)
        l = R(i[0], i[1]) + 90, n = i[0];
      else if (e >= 1) {
        const d = i.length;
        l = R(i[d - 2], i[d - 1]) + 90, n = i[d - 1];
      } else
        S(i, (d) => {
          let T = Math.hypot(d.x - x.x, d.y - x.y);
          if (p += T, p >= e * r) {
            let M = (p - T) / r, N = (e * r - M * r) / T;
            return n = { x: x.x + (d.x - x.x) * N, y: x.y + (d.y - x.y) * N }, l = R(x, d) + 90, !1;
          }
          return x = d, !0;
        });
    }
    let h = this.getPrivate("centerX", 0), c = this.getPrivate("centerY", 0), g = (n.x - h) * o, m = (n.y - c) * o;
    t == null && (t = 0);
    let u = -a.get("axisLength", 0) * t * o, y = g + C(l) * u, F = m + A(l) * u;
    return { x: y, y: F };
  }
  /**
   * @ignore
   */
  updateLabel(e, t, s, a) {
    if (e) {
      t == null && (t = 0);
      let i = 0.5;
      a != null && a > 1 ? i = e.get("multiLocation", i) : i = e.get("location", i), s != null && s != t && (t = t + (s - t) * i);
      const r = this.positionToAngle(t), o = this.get("yRenderer"), n = o.axis, l = this.positionToPoint(t, n.get("start", 0) + o.get("axisLocation", 0));
      e.setAll({
        x: l.x,
        y: l.y
      }), this.get("rotateLabels", !0) && e.set("rotation", r - 90), this.toggleVisibility(e, t, e.get("minPosition", 0), e.get("maxPosition", 1));
    }
  }
  /**
   * @ignore
   */
  updateTick(e, t, s, a) {
    if (e) {
      t == null && (t = 0);
      let i = 0.5;
      a != null && a > 1 ? i = e.get("multiLocation", i) : i = e.get("location", i), s != null && s != t && (t = t + (s - t) * i);
      let r = e.get("length", 0);
      e.get("inside") && (r *= -1);
      let n = this.positionToAngle(t);
      this.toggleVisibility(e, t, e.get("minPosition", 0), e.get("maxPosition", 1));
      const h = this.get("yRenderer").axis, c = this.positionToPoint(t, h.get("start"));
      e.set("draw", (g) => {
        g.moveTo(c.x, c.y), g.lineTo(c.x - r * C(n), c.y - r * A(n));
      });
    }
  }
  /**
   * @ignore
   */
  updateBullet(e, t, s) {
    if (e) {
      const a = e.get("sprite");
      if (a) {
        t == null && (t = 0);
        let i = e.get("location", 0.5);
        s != null && s != t && (t = t + (s - t) * i);
        const o = this.get("yRenderer").axis, n = this.positionToPoint(t, o.get("start"));
        a.setAll({ x: n.x, y: n.y }), this.toggleVisibility(a, t, 0, 1);
      }
    }
  }
  /**
   * @ignore
   */
  updateFill(e, t, s) {
    if (e) {
      t == null && (t = 0), s == null && (s = 1);
      const i = this.get("yRenderer").axis, r = this.getPoints(t, i.get("start", 0), s, i.get("end", 1));
      e.set("draw", (o) => {
        o.moveTo(r[0].x, r[0].y), v(r, (n) => {
          o.lineTo(n.x, n.y);
        }), o.closePath();
      });
    }
  }
  /**
   * Returns axis length in pixels.
   *
   * @return Length
   */
  axisLength() {
    return this.getPrivate("axisLength", 0);
  }
  /**
   * @ignore
   */
  positionTooltip(e, t) {
    const s = this.get("yRenderer"), a = s.axis.get("start", 0), i = s.axis.get("end", 1), r = this.positionToPoint(t, s.get("axisLocation", 0.5) * (i - a) + a);
    this._positionTooltip(e, r);
  }
  /**
   * @ignore
   */
  updateTooltipBounds(e) {
  }
}
V.className = "AxisRendererCurveX";
V.classNames = I.classNames.concat([V.className]);
class z extends I {
  constructor() {
    super(...arguments), this._fillGenerator = ee(), this.labels = this.addDisposer(new Y(D.new({}), () => ae._new(this._root, {
      themeTags: L(this.labels.template.get("themeTags", []), this.get("themeTags", []))
    }, [this.labels.template])));
  }
  _afterNew() {
    this._settings.themeTags = L(this._settings.themeTags, ["renderer", "radial"]), super._afterNew(), this.setPrivate("letter", "Y"), this.setRaw("position", "absolute");
  }
  _changed() {
    super._changed(), this.isDirty("axisLength") && this.updateLayout();
  }
  /**
   * @ignore
   */
  processAxis() {
    super.processAxis();
  }
  /**
   * @ignore
   */
  updateLayout() {
    const e = this.chart;
    if (e) {
      const t = this.positionToPoint(0, 0), s = this.positionToPoint(1, 0);
      this.set("draw", (a) => {
        a.moveTo(t.x, t.y), a.lineTo(s.x, s.y);
      }), this.axis.markDirtySize(), e._updateMasks();
    }
  }
  /**
   * @ignore
   */
  updateGrid(e, t, s) {
    if (e) {
      _(t) || (t = 0);
      let a = e.get("location", 0.5);
      _(s) && s != t && (t = t + (s - t) * a), this.toggleVisibility(e, t, 0, 1);
      let i = this.get("xRenderer");
      if (i) {
        const r = i.get("points");
        r && e.set("draw", (o) => {
          let n;
          v(r, (l, h) => {
            let c = i.pointPostion[h], g = this.positionToPoint(t, c, !0);
            h == 0 ? o.moveTo(g.x, g.y) : n && Math.hypot(n.x - g.x, n.y - g.y) < 0.5 || (o.lineTo(g.x, g.y), n = g);
          });
        });
      }
    }
  }
  // do not delete
  _handleOpposite() {
  }
  /**
   * Converts relative position to X/Y point.
   *
   * @param   position  Position
   * @return            Point
   */
  positionToPoint(e, t, s) {
    t == null && (t = 0);
    const a = this.get("xRenderer");
    return a ? a.positionToPoint(t, e, s) : { x: 0, y: 0 };
  }
  /**
   * @ignore
   */
  updateLabel(e, t, s, a) {
    if (e) {
      _(t) || (t = 0);
      let i = 0.5;
      _(a) && a > 1 ? i = e.get("multiLocation", i) : i = e.get("location", i), _(s) && s != t && (t = t + (s - t) * i);
      const r = this.positionToPoint(t, 0), o = this.get("xRenderer");
      if (o) {
        let n = 0;
        o && (n = o.positionToAngle(0) - 90), e.setAll({
          x: r.x,
          y: r.y
        }), this.get("rotateLabels", !0) && e.set("rotation", n);
      }
      this.toggleVisibility(e, t, e.get("minPosition", 0), e.get("maxPosition", 1));
    }
  }
  /**
   * @ignore
   */
  updateTick(e, t, s, a) {
    if (e) {
      _(t) || (t = 0);
      let i = 0.5;
      _(a) && a > 1 ? i = e.get("multiLocation", i) : i = e.get("location", i), _(s) && s != t && (t = t + (s - t) * i);
      const r = this.positionToPoint(t, 0), o = this.get("xRenderer");
      if (o) {
        let n = 0;
        o && (n = o.positionToAngle(0) - 90);
        let l = e.get("length", 0);
        e.get("inside") && (l *= -1), e.set("draw", (c) => {
          c.moveTo(r.x, r.y), c.lineTo(r.x + l * C(n), r.y + l * A(n));
        }), this.toggleVisibility(e, t, e.get("minPosition", 0), e.get("maxPosition", 1));
      }
    }
  }
  /**
   * @ignore
   */
  updateBullet(e, t, s) {
    if (e) {
      const a = e.get("sprite");
      if (a) {
        _(t) || (t = 0);
        let i = e.get("location", 0.5);
        _(s) && s != t && (t = t + (s - t) * i);
        const r = this.positionToPoint(t);
        a.setAll({ x: r.x, y: r.y }), this.toggleVisibility(a, t, 0, 1);
      }
    }
  }
  getPoints(e, t, s, a) {
    var i;
    return (i = this.get("xRenderer")) === null || i === void 0 ? void 0 : i.getPoints(e, t, s, a);
  }
  /**
   * @ignore
   */
  updateFill(e, t, s) {
    if (e) {
      t == null && (t = 0), s == null && (s = 1);
      const a = this.getPoints(0, t, 1, s);
      a && e.set("draw", (i) => {
        i.moveTo(a[0].x, a[0].y), v(a, (r) => {
          i.lineTo(r.x, r.y);
        }), i.closePath();
      });
    }
  }
  /**
   * Returns axis length in pixels.
   *
   * @return Length
   */
  axisLength() {
    return this.get("axisLength", 60);
  }
  /**
   * @ignore
   */
  updateTooltipBounds(e) {
  }
  /**
   * Converts relative position to pixels.
   *
   * @param   position  Position
   * @return            Pixels
   */
  positionToCoordinate(e) {
    return this._inversed ? (e = Math.min(this._end, e), (this._end - e) * this._axisLength) : (e = Math.max(this._start, e), (e - this._start) * this._axisLength);
  }
  /**
   * @ignore
   */
  positionTooltip(e, t) {
    const s = this.get("xRenderer");
    if (s) {
      const a = this.positionToPoint(t, s.axis.get("start", 0));
      this._positionTooltip(e, a);
    }
  }
}
z.className = "AxisRendererCurveY";
z.classNames = I.classNames.concat([z.className]);
class re extends se {
  setupDefaultRules() {
    super.setupDefaultRules();
    const e = this.rule.bind(this);
    e("SpiralChart").setAll({
      levelCount: 3,
      endAngle: 0,
      startAngle: -90,
      yAxisRadius: X(60),
      innerRadius: X(20)
    }), e("SerpentineChart").setAll({
      levelCount: 3,
      orientation: "vertical",
      startLocation: 0,
      endLocation: 1
    }), e("CurveColumnSeries").setAll({
      clustered: !0
    }), e("Slice", ["curve", "column", "series"]).setAll({
      width: X(50),
      height: X(50)
    }), e("AxisRendererCurveY").setAll({
      minGridDistance: 20,
      inversed: !1,
      cellStartLocation: 0,
      cellEndLocation: 1,
      rotateLabels: !1,
      axisLocation: 0.5,
      axisLength: 60
    }), e("AxisRendererCurveX").setAll({
      minGridDistance: 100,
      inversed: !1,
      cellStartLocation: 0,
      cellEndLocation: 1,
      rotateLabels: !1
    }), e("RadialLabel", ["circular"]).setAll({
      textType: "circular",
      paddingTop: 1,
      paddingRight: 0,
      paddingBottom: 1,
      paddingLeft: 0,
      centerX: 0,
      centerY: 0,
      radius: 8
    }), e("AxisLabelRadial", ["category"]).setAll({
      text: "{category}",
      populateText: !0
    }), e("RadialLabel", ["radial"]).setAll({
      textType: "regular",
      centerX: 0,
      textAlign: "right"
    });
  }
}
class w extends U {
  constructor() {
    super(...arguments), this.curveContainer = this.plotContainer.children.push(ie.new(this._root, { x: b, y: b }));
  }
  _afterNew() {
    this._defaultThemes.push(re.new(this._root)), super._afterNew();
    const e = this.curveContainer, t = this.gridContainer, s = this.topGridContainer, a = this.seriesContainer, i = this.bulletsContainer;
    e.children.pushAll([t, a, s, i]), a.set("mask", k.new(this._root, {})), t.set("mask", k.new(this._root, {})), this._disposers.push(this.plotContainer.events.on("boundschanged", () => {
      this._updateMasks();
    }));
  }
  _maskGrid() {
  }
  _addCursor(e) {
    this.curveContainer.children.push(e);
  }
  // do not delete
  _updateMasks() {
    this.xAxes.each((e) => {
      e.get("renderer")._updateLayout();
    }), this._updateMask(this.seriesContainer), this._updateMask(this.gridContainer), this.series.each((e) => {
      e.get("maskBullets") ? this._updateMask(e.bulletsContainer) : e.bulletsContainer.set("mask", void 0);
    }), this.yAxes.each((e) => {
      e.markDirtySize();
    });
  }
  /**
   * @ignore
   */
  _updateMask(e) {
    const t = e.get("mask");
    if (t) {
      const s = this.xAxes.getIndex(0), a = this.yAxes.getIndex(0);
      if (s && a) {
        const r = s.get("renderer").getPoints(s.get("start", 0), a.get("start", 0), s.get("end", 1), a.get("end", 1));
        t.set("draw", (o) => {
          o.moveTo(r[0].x, r[0].y);
          for (let n = 1; n < r.length; n++)
            o.lineTo(r[n].x, r[n].y);
          o.closePath();
        }), s.markDirtySize();
      }
    }
  }
  /**
   * @ignore
   */
  processAxis(e) {
    this.curveContainer.children.unshift(e);
  }
  /**
   * @ignore
   */
  inPlot(e) {
    return !0;
  }
  _tooltipToLocal(e) {
    return this.curveContainer._display.toLocal(e);
  }
  _handlePinch() {
  }
}
w.className = "CurveChart";
w.classNames = U.classNames.concat([w.className]);
class O extends w {
  _prepareChildren() {
    super._prepareChildren(), (this.isDirty("levelCount") || this.isDirty("orientation")) && this._updateMasks();
  }
  _updateMasks() {
    const e = this.get("levelCount", 1) - 1;
    let t = this.plotContainer.innerWidth(), s = this.plotContainer.innerHeight(), a = [], i;
    if (this.get("orientation") == "vertical") {
      i = Math.min(s / (e + 1) / 2, t / 3), s = Math.min(i * (e + 1) * 2, s);
      const r = this.get("startLocation", 0), o = this.get("endLocation", 1);
      for (let n = 0; n <= e; n++)
        if (n % 2 === 0) {
          n === 0 ? a.push({ x: -t / 2 + (t - i * 2) * r, y: -s / 2 + s / (e + 1) * n }) : a.push({ x: -t / 2 + i, y: -s / 2 + s / (e + 1) * n }), n === e ? a.push({ x: t / 2 - i - (t - i * 2) * (1 - o), y: -s / 2 + s / (e + 1) * n }) : a.push({ x: t / 2 - 2 * i, y: -s / 2 + s / (e + 1) * n });
          let l = { x: t / 2 - 2 * i, y: -s / 2 + s / (e + 1) * (n + 0.5) };
          if (n < e)
            for (let h = 1; h < 50; h++) {
              let c = -90 + h / 50 * 180;
              a.push({ x: l.x + i * C(c), y: l.y + i * A(c) });
            }
        } else {
          a.push({ x: t / 2 - 2 * i, y: -s / 2 + s / (e + 1) * n }), n === e ? a.push({ x: -t / 2 + (t - i * 2) * (1 - o), y: -s / 2 + s / (e + 1) * n }) : a.push({ x: -t / 2 + i, y: -s / 2 + s / (e + 1) * n });
          let l = { x: -t / 2 + i, y: -s / 2 + s / (e + 1) * (n + 0.5) };
          if (n < e)
            for (let h = 1; h < 50; h++) {
              let c = -90 - h / 50 * 180;
              a.push({ x: l.x + i * C(c), y: l.y + i * A(c) });
            }
        }
    } else {
      i = Math.min(t / (e + 1) / 2, s / 3), t = Math.min(i * (e + 1) * 2, t);
      const r = this.get("startLocation", 0), o = this.get("endLocation", 1);
      for (let n = 0; n <= e; n++)
        if (n % 2 === 0) {
          n === 0 ? a.push({ y: -s / 2 + (s - i * 2) * r, x: -t / 2 + t / (e + 1) * n }) : a.push({ y: -s / 2 + i, x: -t / 2 + t / (e + 1) * n }), n === e ? a.push({ y: s / 2 - i - (s - i * 2) * (1 - o), x: -t / 2 + t / (e + 1) * n }) : a.push({ y: s / 2 - 2 * i, x: -t / 2 + t / (e + 1) * n });
          let l = { y: s / 2 - 2 * i, x: -t / 2 + t / (e + 1) * (n + 0.5) };
          if (n < e)
            for (let h = 1; h < 50; h++) {
              let c = -90 + h / 50 * 180;
              a.push({ y: l.y + i * C(c), x: l.x + i * A(c) });
            }
        } else {
          a.push({ y: s / 2 - 2 * i, x: -t / 2 + t / (e + 1) * n }), n === e ? a.push({ y: -s / 2 + (s - i * 2) * (1 - o), x: -t / 2 + t / (e + 1) * n }) : a.push({ y: -s / 2 + i, x: -t / 2 + t / (e + 1) * n });
          let l = { y: -s / 2 + i, x: -t / 2 + t / (e + 1) * (n + 0.5) };
          if (n < e)
            for (let h = 1; h < 50; h++) {
              let c = -90 - h / 50 * 180;
              a.push({ y: l.y + i * C(c), x: l.x + i * A(c) });
            }
        }
    }
    this.yAxes.each((r) => {
      r.get("renderer").set("axisLength", G(this.get("yAxisRadius", b), 2 * i)), r.markDirtySize();
    }), this.xAxes.each((r) => {
      const o = r.get("renderer");
      o.setPrivate("autoScale", !1), o.set("points", a);
    }), super._updateMasks();
  }
}
O.className = "SerpentineChart";
O.classNames = w.classNames.concat([O.className]);
class H extends w {
  _prepareChildren() {
    super._prepareChildren(), this.isDirty("levelCount") && this._updateMasks();
  }
  _updateMasks() {
    let e = this.plotContainer.innerWidth(), t = this.plotContainer.innerHeight(), s = Math.min(e, t) / 2, a = G(this.get("innerRadius", 0), s), i = (s - a) / this.get("levelCount", 1), r = G(this.get("yAxisRadius", b), i);
    const o = ne(0, 0, s, s, a, 20, i, this.get("startAngle", 0), this.get("endAngle", 360));
    this.yAxes.each((n) => {
      n.get("renderer").set("axisLength", r), n.markDirtySize();
    }), this.xAxes.each((n) => {
      const l = n.get("renderer");
      l.setPrivate("autoScale", !1), l.set("points", o);
    }), super._updateMasks();
  }
}
H.className = "SpiralChart";
H.classNames = w.classNames.concat([H.className]);
class W extends Z {
  constructor() {
    super(...arguments), this.columns = this.addDisposer(new Y(D.new({}), () => K._new(this._root, {
      position: "absolute",
      themeTags: L(this.columns.template.get("themeTags", []), ["curve", "series", "column"])
    }, [this.columns.template])));
  }
  /**
   * @ignore
   */
  makeColumn(e, t) {
    const s = this.mainContainer.children.push(t.make());
    return s._setDataItem(e), t.push(s), s;
  }
  _afterNew() {
    super._afterNew(), this.set("maskContent", !1), this.bulletsContainer.set("maskContent", !1), this.bulletsContainer.set("mask", k.new(this._root, {}));
  }
  /**
   * @ignore
   */
  getPoint(e, t) {
    return this.get("xAxis").get("renderer").positionToPoint(e, t);
  }
  _updateSeriesGraphics(e, t, s, a, i, r) {
    t.setPrivate("visible", !0), e.setRaw("left", s), e.setRaw("right", a), e.setRaw("top", i), e.setRaw("bottom", r);
    const n = this.get("xAxis").get("renderer"), l = this.get("yAxis"), h = l.get("start", 0), c = l.get("end", 1);
    i = q(i, h, c), r = q(r, h, c);
    const g = n.getPoints(s, i, a, r);
    t.set("points", g);
  }
  _shouldInclude(e) {
    const t = this.get("xAxis");
    return !(e < t.get("start", 0) || e > t.get("end", 1));
  }
  _shouldShowBullet(e, t) {
    const s = this.get("xAxis");
    return e < s.get("start", 0) || e > s.get("end", 1) ? !1 : this._showBullets;
  }
  _positionBullet(e) {
    let t = e.get("sprite");
    if (t) {
      const s = t.dataItem, a = s.get("locationX", 0.5), i = s.get("locationY", 0.5), r = e.get("locationX", a), o = e.get("locationY", i), n = s.component, l = n.get("xAxis"), h = n.get("yAxis");
      let c = 0, g = n.get("vcx", 1), m = n.get("vcy", 1);
      if (this.get("openValueXField")) {
        const u = l.getDataItemPositionX(s, n._xOpenField, a, g), y = l.getDataItemPositionX(s, n._xField, a, g);
        c = u + (y - u) * r;
      } else
        c = l.getDataItemPositionX(s, n._xField, r, g);
      let f = 0;
      if (this.get("openValueYField")) {
        const u = h.getDataItemPositionY(s, n._yOpenField, i, m), y = h.getDataItemPositionY(s, n._yField, i, m);
        f = u + (y - u) * o;
      } else
        f = h.getDataItemPositionY(s, n._yField, o, m);
      if (n._shouldShowBullet(c, f)) {
        t.setPrivate("visible", !0);
        const u = n.getPoint(c, f);
        t.setAll({
          x: u.x,
          y: u.y
        });
      } else
        t.setPrivate("visible", !1);
    }
  }
  _handleMaskBullets() {
  }
  _updateChildren() {
    super._updateChildren(), this.get("maskBullets") || this.bulletsContainer.remove("mask");
  }
  _processAxisRange(e) {
    super._processAxisRange(e), e.columns = new Y(D.new({}), () => K._new(this._root, {
      position: "absolute",
      themeTags: L(e.columns.template.get("themeTags", []), ["curves", "series", "column"])
    }, [this.columns.template, e.columns.template]));
  }
}
W.className = "CurveColumnSeries";
W.classNames = Z.classNames.concat([W.className]);
class E extends J {
  _afterNew() {
    super._afterNew(), this.set("maskContent", !1), this.bulletsContainer.set("maskContent", !1), this.bulletsContainer.set("mask", k.new(this._root, {}));
  }
  _handleMaskBullets() {
  }
  _updateChildren() {
    super._updateChildren(), this.get("maskBullets") || this.bulletsContainer.remove("mask");
  }
  getPoint(e, t) {
    return this.get("xAxis").get("renderer").positionToPoint(e, t);
  }
  _shouldInclude(e) {
    const t = this.get("xAxis");
    return !(e < t.get("start", 0) || e > t.get("end", 1));
  }
  _shouldShowBullet(e, t) {
    const s = this.get("xAxis");
    return e < s.get("start", 0) || e > s.get("end", 1) ? !1 : this._showBullets;
  }
  _positionBullet(e) {
    let t = e.get("sprite");
    if (t) {
      const s = t.dataItem, a = s.get("locationX", 0.5), i = s.get("locationY", 0.5), r = e.get("locationX", a), o = e.get("locationY", i), n = s.component, l = n.get("xAxis"), h = n.get("yAxis");
      let c = 0, g = n.get("vcx", 1), m = n.get("vcy", 1);
      if (this.get("openValueXField")) {
        const u = l.getDataItemPositionX(s, n._xOpenField, a, g), y = l.getDataItemPositionX(s, n._xField, a, g);
        c = u + (y - u) * r;
      } else
        c = l.getDataItemPositionX(s, n._xField, r, g);
      let f = 0;
      if (this.get("openValueYField")) {
        const u = h.getDataItemPositionY(s, n._yOpenField, i, m), y = h.getDataItemPositionY(s, n._yField, i, m);
        f = u + (y - u) * o;
      } else
        f = h.getDataItemPositionY(s, n._yField, o, m);
      if (n._shouldShowBullet(c, f)) {
        t.setPrivate("visible", !0);
        const u = n.getPoint(c, f);
        t.setAll({
          x: u.x,
          y: u.y
        });
      } else
        t.setPrivate("visible", !1);
    }
  }
}
E.className = "CurveLineSeries";
E.classNames = J.classNames.concat([E.className]);
class j extends Q {
  _afterNew() {
    this._settings.themeTags = L(this._settings.themeTags, ["curve", "cursor"]), super._afterNew();
  }
  _handleXLine() {
  }
  _handleYLine() {
  }
  _getPosition(e) {
    return this.get("xAxis").get("renderer").pointToPosition(e);
  }
  _getPoint(e, t) {
    return this.get("xAxis").get("renderer").positionToPoint(e, t);
  }
  /**
   * @ignore
   */
  updateLayout() {
  }
  _updateLines(e, t) {
    this._tooltipX || this._drawXLine(e, t), this._tooltipY || this._drawYLine(e, t);
  }
  _drawXLine(e, t) {
    const s = this.get("xAxis"), a = this.get("yAxis"), i = s.get("renderer"), r = i.toAxisPosition(this.getPrivate("positionX", 0)), o = i.positionToPoint(r, a.get("start", 0)), n = i.positionToPoint(r, a.get("end", 1));
    this.lineX.set("draw", (l) => {
      l.moveTo(o.x, o.y), l.lineTo(n.x, n.y);
    });
  }
  _drawYLine(e, t) {
    const s = this.get("xAxis"), a = this.get("yAxis"), i = a.get("renderer"), r = 1 - i.toAxisPosition(this.getPrivate("positionY", 0)), o = i.getPoints(s.get("start", 0), r, s.get("end", 1), r);
    o && (r > a.get("start", 0) && r < a.get("end", 1) ? this.lineY.set("draw", (n) => {
      o.length > 0 && (n.moveTo(o[0].x, o[0].y), v(o, (l) => {
        n.lineTo(l.x, l.y);
      }));
    }) : this.lineY.set("draw", (n) => {
      n.clear();
    }));
  }
  _updateXLine(e) {
    let t = e.get("pointTo");
    t && this._drawXLine(t.x, t.y);
  }
  _updateYLine(e) {
    let t = e.get("pointTo");
    t && this._drawYLine(t.x, t.y);
  }
  _inPlot() {
    return this.chart, !0;
  }
  _updateSelection() {
    this.selection.set("draw", (e) => {
      const t = this.get("behavior");
      let s = this.get("xAxis"), a = this.get("yAxis"), i = s.toAxisPosition(this.getPrivate("downPositionX", 0)), r = a.toAxisPosition(this.getPrivate("downPositionY", 0)), o = s.toAxisPosition(this.getPrivate("positionX", 0)), n = a.toAxisPosition(this.getPrivate("positionY", 0));
      t == "zoomX" || t == "selectX" ? (r = a.get("start", 0), n = a.get("end", 1)) : (t == "zoomY" || t == "selectY") && (i = s.get("start", 0), o = s.get("end", 1));
      const l = s.get("renderer").getPoints(i, r, o, n);
      e.moveTo(l[0].x, l[0].y), v(l, (h) => {
        e.lineTo(h.x, h.y);
      }), e.closePath();
    });
  }
}
j.className = "CurveCursor";
j.classNames = Q.classNames.concat([j.className]);
export {
  V as AxisRendererCurveX,
  z as AxisRendererCurveY,
  w as CurveChart,
  W as CurveColumnSeries,
  j as CurveCursor,
  E as CurveLineSeries,
  re as DefaultTheme,
  O as SerpentineChart,
  H as SpiralChart
};
