import { S as X, a as S } from "./Slice.DiEswWa6.js";
import { aU as Y, L as M, T as b, m as p, r as m, x as z, o as A, h as u, j as f, a as _, C as W, G as L, H as v, P as Q, D as at, am as H, au as Z, q as O, b1 as K, b2 as nt, p as C, b5 as w, av as $, b6 as j, t as q, aW as tt } from "./am-chart.H2jnOzFc.js";
import { A as et } from "./AxisLabelRadial.Bs1P_q_F.js";
import { B as st } from "./BaseColumnSeries.C7jwOxIJ.js";
import { p as rt, c as lt } from "./cardinal.BCA_LB0u.js";
function U() {
}
function it(c, t) {
  this._context = c, this._k = (1 - t) / 6;
}
it.prototype = {
  areaStart: U,
  areaEnd: U,
  lineStart: function() {
    this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN, this._point = 0;
  },
  lineEnd: function() {
    switch (this._point) {
      case 1: {
        this._context.moveTo(this._x3, this._y3), this._context.closePath();
        break;
      }
      case 2: {
        this._context.lineTo(this._x3, this._y3), this._context.closePath();
        break;
      }
      case 3: {
        this.point(this._x3, this._y3), this.point(this._x4, this._y4), this.point(this._x5, this._y5);
        break;
      }
    }
  },
  point: function(c, t) {
    switch (c = +c, t = +t, this._point) {
      case 0:
        this._point = 1, this._x3 = c, this._y3 = t;
        break;
      case 1:
        this._point = 2, this._context.moveTo(this._x4 = c, this._y4 = t);
        break;
      case 2:
        this._point = 3, this._x5 = c, this._y5 = t;
        break;
      default:
        rt(this, c, t);
        break;
    }
    this._x0 = this._x1, this._x1 = this._x2, this._x2 = c, this._y0 = this._y1, this._y1 = this._y2, this._y2 = t;
  }
};
const J = function c(t) {
  function e(s) {
    return new it(s, t);
  }
  return e.tension = function(s) {
    return c(+s);
  }, e;
}(0);
class k extends Y {
  constructor() {
    super(...arguments), this.labels = this.addDisposer(new M(b.new({}), () => et._new(this._root, {
      themeTags: p(this.labels.template.get("themeTags", []), this.get("themeTags", []))
    }, [this.labels.template]))), this.axisFills = this.addDisposer(new M(b.new({}), () => X._new(this._root, {
      themeTags: p(this.axisFills.template.get("themeTags", ["fill"]), this.get("themeTags", []))
    }, [this.axisFills.template]))), this._fillGenerator = S();
  }
  _afterNew() {
    this._settings.themeTags = p(this._settings.themeTags, ["renderer", "circular"]), super._afterNew(), this.setPrivateRaw("letter", "X"), this.setRaw("position", "absolute");
  }
  _changed() {
    super._changed(), (this.isDirty("radius") || this.isDirty("innerRadius") || this.isDirty("startAngle") || this.isDirty("endAngle")) && this.updateLayout();
  }
  /**
   * @ignore
   */
  processAxis() {
    super.processAxis(), this.axis.labelsContainer.set("isMeasured", !1);
  }
  /**
   * @ignore
   */
  updateLayout() {
    const t = this.chart;
    if (t) {
      const e = t.getPrivate("radius", 0);
      let s = m(this.get("radius", z), e);
      s < 0 && (s = e + s), this.setPrivate("radius", s);
      let i = m(this.get("innerRadius", t.getPrivate("innerRadius", 0)), e) * t.getPrivate("irModifyer", 1);
      i < 0 && (i = s + i), this.setPrivate("innerRadius", i);
      let a = this.get("startAngle", t.get("startAngle", -90)), n = this.get("endAngle", t.get("endAngle", 270));
      this.setPrivate("startAngle", a), this.setPrivate("endAngle", n), this.set("draw", (r) => {
        const l = this.positionToPoint(0);
        r.moveTo(l.x, l.y), a > n && ([a, n] = [n, a]), r.arc(0, 0, s, a * A, n * A);
      }), this.axis.markDirtySize();
    }
  }
  /**
   * @ignore
   */
  updateGrid(t, e, s) {
    if (t) {
      e == null && (e = 0);
      let i = t.get("location", 0.5);
      s != null && s != e && (e = e + (s - e) * i);
      let a = this.getPrivate("radius", 0), n = this.getPrivate("innerRadius", 0), r = this.positionToAngle(e);
      this.toggleVisibility(t, e, 0, 1), a != null && t.set("draw", (l) => {
        l.moveTo(n * u(r), n * f(r)), l.lineTo(a * u(r), a * f(r));
      });
    }
  }
  /**
   * Converts relative position to angle.
   *
   * @param   position  Position
   * @return            Angle
   */
  positionToAngle(t) {
    const e = this.axis, s = this.getPrivate("startAngle", 0), i = this.getPrivate("endAngle", 360), a = e.get("start", 0), n = e.get("end", 1);
    let r = (i - s) / (n - a), l;
    return this.get("inversed") ? l = s + (n - t) * r : l = s + (t - a) * r, l;
  }
  // do not delete
  _handleOpposite() {
  }
  /**
   * Converts relative position to an X/Y coordinate.
   *
   * @param   position  Position
   * @return            Point
   */
  positionToPoint(t) {
    const e = this.getPrivate("radius", 0), s = this.positionToAngle(t);
    return { x: e * u(s), y: e * f(s) };
  }
  /**
   * @ignore
   */
  updateLabel(t, e, s, i) {
    if (t) {
      e == null && (e = 0);
      let a = 0.5;
      i != null && i > 1 ? a = t.get("multiLocation", a) : a = t.get("location", a), s != null && s != e && (e = e + (s - e) * a);
      const n = this.getPrivate("radius", 0), r = this.getPrivate("innerRadius", 0), l = this.positionToAngle(e);
      t.setPrivate("radius", n), t.setPrivate("innerRadius", r), t.set("labelAngle", l), this.toggleVisibility(t, e, t.get("minPosition", 0), t.get("maxPosition", 1));
    }
  }
  /**
   * @ignore
   */
  fillDrawMethod(t, e, s) {
    t.set("draw", (i) => {
      e == null && (e = this.getPrivate("startAngle", 0)), s == null && (s = this.getPrivate("endAngle", 0));
      const a = this.getPrivate("innerRadius", 0), n = this.getPrivate("radius", 0);
      this._fillGenerator.context(i), this._fillGenerator({ innerRadius: a, outerRadius: n, startAngle: (e + 90) * A, endAngle: (s + 90) * A });
    });
  }
  /**
   * @ignore
   */
  updateTick(t, e, s, i) {
    if (t) {
      e == null && (e = 0);
      let a = 0.5;
      i != null && i > 1 ? a = t.get("multiLocation", a) : a = t.get("location", a), s != null && s != e && (e = e + (s - e) * a);
      let n = t.get("length", 0);
      t.get("inside") && (n *= -1);
      let l = this.getPrivate("radius", 0), o = this.positionToAngle(e);
      this.toggleVisibility(t, e, t.get("minPosition", 0), t.get("maxPosition", 1)), l != null && t.set("draw", (h) => {
        h.moveTo(l * u(o), l * f(o)), l += n, h.lineTo(l * u(o), l * f(o));
      });
    }
  }
  /**
   * @ignore
   */
  updateBullet(t, e, s) {
    if (t) {
      const i = t.get("sprite");
      if (i) {
        e == null && (e = 0);
        let a = t.get("location", 0.5);
        s != null && s != e && (e = e + (s - e) * a);
        let n = this.getPrivate("radius", 0), r = this.positionToAngle(e);
        this.toggleVisibility(i, e, 0, 1), i.setAll({ rotation: r, x: n * u(r), y: n * f(r) });
      }
    }
  }
  /**
   * @ignore
   */
  updateFill(t, e, s) {
    if (t) {
      e == null && (e = 0), s == null && (s = 1);
      let i = this.fitAngle(this.positionToAngle(e)), a = this.fitAngle(this.positionToAngle(s));
      t.setAll({ startAngle: i, arc: a - i }), t._setSoft("innerRadius", this.getPrivate("innerRadius")), t._setSoft("radius", this.getPrivate("radius"));
    }
  }
  /**
   * @ignore
   */
  fitAngle(t) {
    const e = this.getPrivate("startAngle", 0), s = this.getPrivate("endAngle", 0), i = Math.min(e, s), a = Math.max(e, s);
    return t < i && (t = i), t > a && (t = a), t;
  }
  /**
   * Returns axis length in pixels.
   *
   * @return Length
   */
  axisLength() {
    return Math.abs(this.getPrivate("radius", 0) * Math.PI * 2 * (this.getPrivate("endAngle", 360) - this.getPrivate("startAngle", 0)) / 360);
  }
  /**
   * @ignore
   */
  positionTooltip(t, e) {
    let s = this.getPrivate("radius", 0);
    const i = this.positionToAngle(e);
    this._positionTooltip(t, { x: s * u(i), y: s * f(i) });
  }
  /**
   * @ignore
   */
  updateTooltipBounds(t) {
  }
}
k.className = "AxisRendererCircular";
k.classNames = Y.classNames.concat([k.className]);
class G extends Y {
  constructor() {
    super(...arguments), this._fillGenerator = S(), this.labels = this.addDisposer(new M(b.new({}), () => et._new(this._root, {
      themeTags: p(this.labels.template.get("themeTags", []), this.get("themeTags", []))
    }, [this.labels.template])));
  }
  _afterNew() {
    this._settings.themeTags = p(this._settings.themeTags, ["renderer", "radial"]), super._afterNew(), this.setPrivate("letter", "Y"), this.setRaw("position", "absolute");
  }
  _changed() {
    super._changed(), (this.isDirty("radius") || this.isDirty("innerRadius") || this.isDirty("startAngle") || this.isDirty("endAngle")) && this.updateLayout();
  }
  /**
   * @ignore
   */
  processAxis() {
    super.processAxis();
  }
  /**
   * @ignore
   */
  updateLayout() {
    const t = this.chart;
    if (t) {
      const e = t.getPrivate("radius", 0);
      let s = m(this.get("radius", z), e), i = m(this.get("innerRadius", t.getPrivate("innerRadius", 0)), e) * t.getPrivate("irModifyer", 1);
      i < 0 && (i = s + i), this.setPrivate("radius", s), this.setPrivate("innerRadius", i);
      let a = this.get("startAngle", t.get("startAngle", -90)), n = this.get("endAngle", t.get("endAngle", 270));
      this.setPrivate("startAngle", a), this.setPrivate("endAngle", n);
      const r = this.get("axisAngle", 0);
      this.set("draw", (l) => {
        l.moveTo(i * u(r), i * f(r)), l.lineTo(s * u(r), s * f(r));
      }), this.axis.markDirtySize();
    }
  }
  /**
   * @ignore
   */
  updateGrid(t, e, s) {
    if (t) {
      _(e) || (e = 0);
      let i = t.get("location", 0.5);
      _(s) && s != e && (e = e + (s - e) * i);
      let a = this.positionToCoordinate(e) + this.getPrivate("innerRadius", 0);
      this.toggleVisibility(t, e, 0, 1), _(a) && t.set("draw", (n) => {
        let r = this.getPrivate("startAngle", 0) * A, l = this.getPrivate("endAngle", 0) * A;
        n.arc(0, 0, Math.max(0, a), Math.min(r, l), Math.max(r, l));
      });
    }
  }
  // do not delete
  _handleOpposite() {
  }
  /**
   * Converts relative position to X/Y point.
   *
   * @param   position  Position
   * @return            Point
   */
  positionToPoint(t) {
    const e = this.getPrivate("innerRadius", 0), s = this.positionToCoordinate(t) + e, i = this.get("axisAngle", 0);
    return { x: s * u(i), y: s * f(i) };
  }
  /**
   * @ignore
   */
  updateLabel(t, e, s, i) {
    if (t) {
      _(e) || (e = 0);
      let a = 0.5;
      _(i) && i > 1 ? a = t.get("multiLocation", a) : a = t.get("location", a), _(s) && s != e && (e = e + (s - e) * a);
      const n = this.positionToPoint(e);
      let r = Math.hypot(n.x, n.y);
      t.setPrivate("radius", r), t.setPrivate("innerRadius", r), t.set("labelAngle", this.get("axisAngle")), this.toggleVisibility(t, e, t.get("minPosition", 0), t.get("maxPosition", 1));
    }
  }
  fillDrawMethod(t, e, s) {
    t.set("draw", (i) => {
      e = Math.max(0, e), s = Math.max(0, s), this._fillGenerator.context(i);
      let a = (this.getPrivate("startAngle", 0) + 90) * A, n = (this.getPrivate("endAngle", 0) + 90) * A;
      n < a && ([a, n] = [n, a]), this._fillGenerator({ innerRadius: e, outerRadius: s, startAngle: a, endAngle: n });
    });
  }
  /**
   * @ignore
   */
  updateTick(t, e, s, i) {
    if (t) {
      _(e) || (e = 0);
      let a = 0.5;
      _(i) && i > 1 ? a = t.get("multiLocation", a) : a = t.get("location", a), _(s) && s != e && (e = e + (s - e) * a);
      const n = this.positionToPoint(e);
      t.set("x", n.x), t.set("y", n.y);
      let r = t.get("length", 0);
      t.get("inside") && (r *= -1);
      const o = this.get("axisAngle", 0) + 90;
      t.set("draw", (h) => {
        h.moveTo(0, 0), h.lineTo(r * u(o), r * f(o));
      }), this.toggleVisibility(t, e, t.get("minPosition", 0), t.get("maxPosition", 1));
    }
  }
  /**
   * @ignore
   */
  updateBullet(t, e, s) {
    if (t) {
      const i = t.get("sprite");
      if (i) {
        _(e) || (e = 0);
        let a = t.get("location", 0.5);
        _(s) && s != e && (e = e + (s - e) * a);
        const n = this.positionToPoint(e);
        i.setAll({ x: n.x, y: n.y }), this.toggleVisibility(i, e, 0, 1);
      }
    }
  }
  /**
   * @ignore
   */
  updateFill(t, e, s) {
    if (t) {
      _(e) || (e = 0), _(s) || (s = 1);
      const i = this.getPrivate("innerRadius", 0);
      let a = this.positionToCoordinate(e) + i, n = this.positionToCoordinate(s) + i;
      this.fillDrawMethod(t, a, n);
    }
  }
  /**
   * Returns axis length in pixels.
   *
   * @return Length
   */
  axisLength() {
    return this.getPrivate("radius", 0) - this.getPrivate("innerRadius", 0);
  }
  /**
   * @ignore
   */
  updateTooltipBounds(t) {
  }
  /**
   * Converts relative position to pixels.
   *
   * @param   position  Position
   * @return            Pixels
   */
  positionToCoordinate(t) {
    return this._inversed ? (t = Math.min(this._end, t), (this._end - t) * this._axisLength) : (t = Math.max(this._start, t), (t - this._start) * this._axisLength);
  }
  /**
   * @ignore
   */
  positionTooltip(t, e) {
    let s = this.getPrivate("innerRadius", 0) + this.positionToCoordinate(e);
    const i = this.get("axisAngle", 0);
    this._positionTooltip(t, { x: s * u(i), y: s * f(i) });
  }
}
G.className = "AxisRendererRadial";
G.classNames = Y.classNames.concat([G.className]);
class B extends W {
  constructor() {
    super(...arguments), this.hand = this.children.push(L.new(this._root, { themeTags: ["hand"] })), this.pin = this.children.push(L.new(this._root, { themeTags: ["pin"] }));
  }
  _afterNew() {
    this._settings.themeTags = p(this._settings.themeTags, ["clock"]), super._afterNew(), this.set("width", v(1)), this.adapters.add("x", () => 0), this.adapters.add("y", () => 0), this.pin.set("draw", (t, e) => {
      const s = e.parent;
      if (s) {
        const i = s.dataItem;
        if (i) {
          const a = i.component;
          if (a) {
            const n = a.chart;
            if (n) {
              const r = n.getPrivate("radius", 0);
              let l = m(s.get("pinRadius", 0), r);
              l < 0 && (l = r + l), t.moveTo(l, 0), t.arc(0, 0, l, 0, 360);
            }
          }
        }
      }
    }), this.hand.set("draw", (t, e) => {
      const s = e.parent;
      if (s) {
        let i = s.parent;
        i && i.set("width", v(1));
        const a = s.dataItem;
        if (a) {
          const n = a.component;
          if (n) {
            const r = n.chart;
            if (r) {
              const l = s.get("bottomWidth", 10) / 2, o = s.get("topWidth", 0) / 2, h = r.getPrivate("radius", 0);
              let d = m(s.get("radius", 0), h);
              d < 0 && (d = h + d);
              let g = s.get("innerRadius", 0);
              g instanceof Q ? g = m(g, h) : g < 0 && g < 0 && (g = d + g), t.moveTo(g, -l), t.lineTo(d, -o), t.lineTo(d, o), t.lineTo(g, l), t.lineTo(g, -l);
            }
          }
        }
      }
    });
  }
  _prepareChildren() {
    super._prepareChildren(), this.hand._markDirtyKey("fill"), this.pin._markDirtyKey("fill");
  }
}
B.className = "ClockHand";
B.classNames = W.classNames.concat([B.className]);
class ot extends at {
  setupDefaultRules() {
    super.setupDefaultRules();
    const t = this.rule.bind(this), e = this._root.interfaceColors;
    t("RadarChart").setAll({
      radius: v(80),
      innerRadius: 0,
      startAngle: -90,
      endAngle: 270
    }), t("RadarColumnSeries").setAll({
      clustered: !0
    }), t("Slice", ["radar", "column", "series"]).setAll({
      width: v(80),
      height: v(80)
    }), t("RadarLineSeries").setAll({
      connectEnds: !0
    }), t("SmoothedRadarLineSeries").setAll({
      tension: 0.5
    }), t("AxisRendererRadial").setAll({
      minGridDistance: 40,
      axisAngle: -90,
      inversed: !1,
      cellStartLocation: 0,
      cellEndLocation: 1
    }), t("AxisRendererCircular").setAll({
      minGridDistance: 100,
      inversed: !1,
      cellStartLocation: 0,
      cellEndLocation: 1
    }), t("RadialLabel", ["circular"]).setAll({
      textType: "circular",
      paddingTop: 1,
      paddingRight: 0,
      paddingBottom: 1,
      paddingLeft: 0,
      centerX: 0,
      centerY: 0,
      radius: 8
    }), t("AxisLabelRadial", ["category"]).setAll({
      text: "{category}",
      populateText: !0
    }), t("RadialLabel", ["radial"]).setAll({
      textType: "regular",
      centerX: 0,
      textAlign: "right"
    }), t("RadarChart", ["gauge"]).setAll({
      startAngle: 180,
      endAngle: 360,
      innerRadius: v(90)
    }), t("ClockHand").setAll({
      topWidth: 1,
      bottomWidth: 10,
      radius: v(90),
      pinRadius: 10
    });
    {
      const s = t("Graphics", ["clock", "hand"]);
      s.setAll({
        fillOpacity: 1
      }), H(s, "fill", e, "alternativeBackground");
    }
    {
      const s = t("Graphics", ["clock", "pin"]);
      s.setAll({
        fillOpacity: 1
      }), H(s, "fill", e, "alternativeBackground");
    }
  }
}
class I extends Z {
  constructor() {
    super(...arguments), this.radarContainer = this.plotContainer.children.push(W.new(this._root, { x: O, y: O })), this._arcGenerator = S(), this._maxRadius = 1;
  }
  _afterNew() {
    this._defaultThemes.push(ot.new(this._root)), super._afterNew();
    const t = this.radarContainer, e = this.gridContainer, s = this.topGridContainer, i = this.seriesContainer, a = this.bulletsContainer;
    t.children.pushAll([e, i, s, a]), i.set("mask", L.new(this._root, {})), e.set("mask", L.new(this._root, {})), this._disposers.push(this.plotContainer.events.on("boundschanged", () => {
      this._updateRadius();
    }));
  }
  _maskGrid() {
  }
  _prepareChildren() {
    if (super._prepareChildren(), this._sizeDirty || this.isDirty("radius") || this.isDirty("innerRadius") || this.isDirty("startAngle") || this.isDirty("endAngle")) {
      const t = this.chartContainer, e = t.innerWidth(), s = t.innerHeight(), i = this.get("startAngle", 0), a = this.get("endAngle", 0), n = this.get("innerRadius");
      let r = K(0, 0, i, a, 1);
      const l = e / (r.right - r.left), o = s / (r.bottom - r.top);
      let h = { left: 0, right: 0, top: 0, bottom: 0 };
      if (n instanceof Q) {
        let g = n.value, x = Math.min(l, o);
        g = Math.max(x * g, x - Math.min(s, e)) / x, h = K(0, 0, i, a, g), this.setPrivateRaw("irModifyer", g / n.value);
      }
      r = nt([r, h]), this._maxRadius = Math.max(0, Math.min(l, o));
      const d = m(this.get("radius", 0), this._maxRadius);
      this.radarContainer.setAll({
        dy: -d * (r.bottom + r.top) / 2,
        dx: -d * (r.right + r.left) / 2
      }), this._updateRadius();
    }
  }
  _addCursor(t) {
    this.radarContainer.children.push(t);
  }
  // do not delete
  _updateRadius() {
    const t = m(this.get("radius", v(80)), this._maxRadius);
    this.setPrivateRaw("radius", t);
    let e = m(this.get("innerRadius", 0), t);
    e < 0 && (e = t + e), this.setPrivateRaw("innerRadius", e), this.xAxes.each((i) => {
      i.get("renderer").updateLayout();
    }), this.yAxes.each((i) => {
      i.get("renderer").updateLayout();
    }), this._updateMask(this.seriesContainer, e, t), this._updateMask(this.gridContainer, e, t), this.series.each((i) => {
      i.get("maskBullets") ? this._updateMask(i.bulletsContainer, e, t) : i.bulletsContainer.remove("mask");
    });
    const s = this.get("cursor");
    s && s.updateLayout();
  }
  /**
   * @ignore
   */
  _updateMask(t, e, s) {
    const i = t.get("mask");
    i && i.set("draw", (a) => {
      this._arcGenerator.context(a), this._arcGenerator({ innerRadius: e, outerRadius: s + 0.5, startAngle: (this.get("startAngle", 0) + 90) * A, endAngle: (this.get("endAngle", 0) + 90) * A });
    });
  }
  /**
   * @ignore
   */
  processAxis(t) {
    this.radarContainer.children.push(t);
  }
  _processSeries(t) {
    super._processSeries(t), this._updateRadius();
  }
  /**
   * @ignore
   */
  inPlot(t, e, s) {
    const i = Math.hypot(t.x, t.y), a = C(Math.atan2(t.y, t.x) * w);
    let n = C(this.get("startAngle", 0)), r = C(this.get("endAngle", 0)), l = !1;
    return n < r && n < a && a < r && (l = !0), n > r && (a > n && (l = !0), a < r && (l = !0)), n == r && (l = !0), l ? (e == null && (e = this.getPrivate("radius", 0)), s == null && (s = this.getPrivate("innerRadius", 0)), s > e && ([s, e] = [e, s]), i <= e + 0.5 && i >= s - 0.5) : !1;
  }
  _tooltipToLocal(t) {
    return this.radarContainer._display.toLocal(t);
  }
  _handlePinch() {
  }
}
I.className = "RadarChart";
I.classNames = Z.classNames.concat([I.className]);
class E extends st {
  constructor() {
    super(...arguments), this.columns = this.addDisposer(new M(b.new({}), () => X._new(this._root, {
      position: "absolute",
      themeTags: p(this.columns.template.get("themeTags", []), ["radar", "series", "column"])
    }, [this.columns.template])));
  }
  /**
   * @ignore
   */
  makeColumn(t, e) {
    const s = this.mainContainer.children.push(e.make());
    return s._setDataItem(t), e.push(s), s;
  }
  _afterNew() {
    super._afterNew(), this.set("maskContent", !1), this.bulletsContainer.set("maskContent", !1), this.bulletsContainer.set("mask", L.new(this._root, {}));
  }
  /**
   * @ignore
   */
  getPoint(t, e) {
    const s = this.get("yAxis"), i = this.get("xAxis"), a = i.get("renderer"), n = s.get("renderer").positionToCoordinate(e) + a.getPrivate("innerRadius", 0), l = i.get("renderer").positionToAngle(t);
    return { x: n * u(l), y: n * f(l) };
  }
  _updateSeriesGraphics(t, e, s, i, a, n) {
    e.setPrivate("visible", !0);
    const r = this.get("xAxis"), l = this.get("yAxis"), o = r.get("renderer"), h = l.get("renderer"), d = h.getPrivate("innerRadius", 0), g = o.fitAngle(o.positionToAngle(s)), x = o.fitAngle(o.positionToAngle(i));
    let R = h.positionToCoordinate(n) + d, y = h.positionToCoordinate(a) + d;
    const N = e;
    t.setRaw("startAngle", g), t.setRaw("endAngle", x), t.setRaw("innerRadius", R), t.setRaw("radius", y);
    let P = 0, T = 360;
    l == this.get("baseAxis") ? (P = h.getPrivate("startAngle", 0), T = h.getPrivate("endAngle", 360)) : (P = o.getPrivate("startAngle", 0), T = o.getPrivate("endAngle", 360)), P > T && ([P, T] = [T, P]), (x <= P || g >= T || y <= d && R <= d) && N.setPrivate("visible", !1), N.setAll({ innerRadius: R, radius: y, startAngle: g, arc: x - g });
  }
  _shouldInclude(t) {
    const e = this.get("xAxis");
    return !(t < e.get("start") || t > e.get("end"));
  }
  _shouldShowBullet(t, e) {
    const s = this.get("xAxis");
    return t < s.get("start") || t > s.get("end") ? !1 : this._showBullets;
  }
  _positionBullet(t) {
    let e = t.get("sprite");
    if (e) {
      const s = e.dataItem, i = t.get("locationX", s.get("locationX", 0.5)), a = t.get("locationY", s.get("locationY", 0.5)), n = s.component, r = n.get("xAxis"), l = n.get("yAxis"), o = r.getDataItemPositionX(s, n._xField, i, n.get("vcx", 1)), h = l.getDataItemPositionY(s, n._yField, a, n.get("vcy", 1)), d = s.get("startAngle", 0), g = s.get("endAngle", 0), x = s.get("radius", 0), R = s.get("innerRadius", 0);
      if (n._shouldShowBullet(o, h)) {
        e.setPrivate("visible", !0);
        const y = d + (g - d) * i, N = R + (x - R) * a;
        e.set("x", u(y) * N), e.set("y", f(y) * N);
      } else
        e.setPrivate("visible", !1);
    }
  }
  _handleMaskBullets() {
  }
  _processAxisRange(t) {
    super._processAxisRange(t), t.columns = new M(b.new({}), () => X._new(this._root, {
      position: "absolute",
      themeTags: p(t.columns.template.get("themeTags", []), ["radar", "series", "column"])
    }, [this.columns.template, t.columns.template]));
  }
}
E.className = "RadarColumnSeries";
E.classNames = st.classNames.concat([E.className]);
class F extends $ {
  constructor() {
    super(...arguments), this._fillGenerator = S();
  }
  _afterNew() {
    this._settings.themeTags = p(this._settings.themeTags, ["radar", "cursor"]), super._afterNew();
  }
  _handleXLine() {
  }
  _handleYLine() {
  }
  _getPosition(t) {
    const e = Math.hypot(t.x, t.y);
    let s = C(Math.atan2(t.y, t.x) * w);
    const i = this.getPrivate("innerRadius");
    let a = C(this.getPrivate("startAngle")), n = C(this.getPrivate("endAngle"));
    (n < a || n == a) && (s < a && (s += 360), n = n + 360);
    let r = (s - a) / (n - a);
    return r < 0 && (r = 1 + r), r < 3e-3 && (r = 0), r > 0.997 && (r = 1), { x: r, y: (e - i) / (this.getPrivate("radius") - i) };
  }
  _getPoint(t, e) {
    const s = this.getPrivate("innerRadius"), i = this.getPrivate("startAngle"), a = this.getPrivate("endAngle"), n = this.getPrivate("radius"), r = i + t * (a - i), l = s + (n - s) * e;
    return { x: l * u(r), y: l * f(r) };
  }
  /**
   * @ignore
   */
  updateLayout() {
    const t = this.chart;
    if (t) {
      const e = t.getPrivate("radius", 0);
      this.setPrivate("radius", m(this.get("radius", z), e));
      let s = m(this.get("innerRadius", t.getPrivate("innerRadius", 0)), e);
      s < 0 && (s = e + s), this.setPrivate("innerRadius", s);
      let i = this.get("startAngle", t.get("startAngle", -90)), a = this.get("endAngle", t.get("endAngle", 270));
      this.setPrivate("startAngle", i), this.setPrivate("endAngle", a);
    }
  }
  _updateLines(t, e) {
    this._tooltipX || this._drawXLine(t, e), this._tooltipY || this._drawYLine(t, e);
  }
  _drawXLine(t, e) {
    const s = this.getPrivate("innerRadius"), i = this.getPrivate("radius"), a = Math.atan2(e, t);
    this.lineX.set("draw", (n) => {
      n.moveTo(s * Math.cos(a), s * Math.sin(a)), n.lineTo(i * Math.cos(a), i * Math.sin(a));
    });
  }
  _drawYLine(t, e) {
    const s = Math.hypot(t, e);
    this.lineY.set("draw", (i) => {
      i.arc(0, 0, s, this.getPrivate("startAngle", 0) * A, this.getPrivate("endAngle", 0) * A);
    });
  }
  _updateXLine(t) {
    let e = t.get("pointTo");
    e && (e = this._display.toLocal(e), this._drawXLine(e.x, e.y));
  }
  _updateYLine(t) {
    let e = t.get("pointTo");
    e && (e = this._display.toLocal(e), this._drawYLine(e.x, e.y));
  }
  _inPlot(t) {
    const e = this.chart;
    return e ? e.inPlot(t, this.getPrivate("radius"), this.getPrivate("innerRadius")) : !1;
  }
  _updateSelection(t) {
    this.selection.set("draw", (e) => {
      const s = this.get("behavior"), i = this._downPoint, a = this.getPrivate("startAngle"), n = this.getPrivate("endAngle");
      let r = this.getPrivate("radius"), l = this.getPrivate("innerRadius");
      r < l && ([r, l] = [l, r]);
      let o = a, h = n, d = r, g = l;
      i && (s == "zoomXY" || s == "selectXY" ? (o = Math.atan2(i.y, i.x) * w, h = Math.atan2(t.y, t.x) * w, g = Math.hypot(i.x, i.y), d = Math.hypot(t.x, t.y)) : s == "zoomX" || s == "selectX" ? (o = Math.atan2(i.y, i.x) * w, h = Math.atan2(t.y, t.x) * w) : (s == "zoomY" || s == "selectY") && (g = Math.hypot(i.x, i.y), d = Math.hypot(t.x, t.y))), g = q(g, l, r), d = q(d, l, r), o = j(o, a, n), h = j(h, a, n), o == h && (h = o + 360), o *= A, h *= A, this._fillGenerator.context(e), this._fillGenerator({ innerRadius: g, outerRadius: d, startAngle: o + Math.PI / 2, endAngle: h + Math.PI / 2 });
    });
  }
}
F.className = "RadarCursor";
F.classNames = $.classNames.concat([F.className]);
class D extends tt {
  _afterNew() {
    super._afterNew(), this.set("maskContent", !1), this.bulletsContainer.set("maskContent", !1), this.bulletsContainer.set("mask", L.new(this._root, {}));
  }
  _handleMaskBullets() {
  }
  getPoint(t, e) {
    const s = this.get("yAxis"), i = this.get("xAxis"), a = s.get("renderer"), n = a.positionToCoordinate(e) + a.getPrivate("innerRadius", 0), l = i.get("renderer").positionToAngle(t);
    return { x: n * u(l), y: n * f(l) };
  }
  _endLine(t, e) {
    this.get("connectEnds") && e && t.push(e);
  }
  _shouldInclude(t) {
    const e = this.get("xAxis");
    return !(t < e.get("start") || t > e.get("end"));
  }
  _shouldShowBullet(t, e) {
    const s = this.get("xAxis");
    return t < s.get("start") || t > s.get("end") ? !1 : this._showBullets;
  }
  _positionBullet(t) {
    let e = t.get("sprite");
    if (e) {
      let s = e.dataItem, i = t.get("locationX", s.get("locationX", 0.5)), a = t.get("locationY", s.get("locationY", 0.5)), n = this.get("xAxis"), r = this.get("yAxis");
      const l = n.getDataItemPositionX(s, this._xField, i, this.get("vcx", 1)), o = r.getDataItemPositionY(s, this._yField, a, this.get("vcy", 1));
      let h = this.getPoint(l, o);
      this._shouldShowBullet(l, o) ? (e.setPrivate("visible", !0), e.set("x", h.x), e.set("y", h.y)) : e.setPrivate("visible", !1);
    }
  }
}
D.className = "RadarLineSeries";
D.classNames = tt.classNames.concat([D.className]);
class V extends D {
  _afterNew() {
    this._setDefault("curveFactory", J.tension(this.get("tension", 0))), super._afterNew();
  }
  _prepareChildren() {
    if (super._prepareChildren(), this.isDirty("connectEnds") && (this.get("connectEnds") ? this.setRaw("curveFactory", J.tension(this.get("tension", 0))) : this.setRaw("curveFactory", lt.tension(this.get("tension", 0)))), this.isDirty("tension")) {
      let t = this.get("curveFactory");
      t && t.tension(this.get("tension", 0));
    }
  }
  _endLine(t, e) {
  }
}
V.className = "SmoothedRadarLineSeries";
V.classNames = D.classNames.concat([V.className]);
export {
  k as AxisRendererCircular,
  G as AxisRendererRadial,
  B as ClockHand,
  ot as DefaultTheme,
  I as RadarChart,
  E as RadarColumnSeries,
  F as RadarCursor,
  D as RadarLineSeries,
  V as SmoothedRadarLineSeries
};
