import { G as A, r as T, C as b, b as H, L as X, T as Y, R as Z, m as I, aw as j, a as N, f as k, x as y, H as J, ak as x, e as q, h as V, j as z, E as B } from "./am-chart.H2jnOzFc.js";
import { ay as it, aJ as rt, B as ot, aT as nt, aS as ht, aE as lt, al as ct, az as gt, ae as dt, a2 as pt, aM as mt, ag as ft, aN as ut, aA as yt, aB as _t, aO as xt, aC as Ct, an as wt, aL as Pt, M as kt, aP as bt, P as Nt, aK as Lt, aD as Dt, w as Tt, a8 as vt, aF as Mt, J as Rt, S as Gt, n as St, aR as Ot, D as Wt, aG as Ft, aI as Ht, aH as It, d as At, aQ as Vt, q as zt, ax as Bt } from "./am-chart.H2jnOzFc.js";
import { B as Xt, E as Yt, L as Zt, M as jt, S as Jt } from "./SpriteResizer.DFnmcy0h.js";
import { L as K } from "./ProgressPie.DlCwXN17.js";
import { C as Kt, a as Qt, N as Ut, O as $t, P as te } from "./ProgressPie.DlCwXN17.js";
import { C as se } from "./Circle.DBa5Ok8V.js";
import { P as ie } from "./Polygon.BwMvXN2H.js";
import { a as oe, Z as ne } from "./ZoomTools.D5JPehoL.js";
import { L as Q } from "./LinearGradient.B1z9AGUt.js";
import { E as le } from "./EditableLabel.BWeq6fgX.js";
import { P as ge } from "./Picture.YSPC0l0Q.js";
import { R as pe, a as me } from "./RadialLabel.DyVOf2K8.js";
import { T as ue } from "./Triangle.BaOef7HV.js";
import { S as _e } from "./Scrollbar.BdZVb_Z-.js";
import { S as Ce } from "./Slider.C20No2z5.js";
import { S as Pe } from "./Slice.DiEswWa6.js";
import { G as E } from "./Gradient.CdcsPIru.js";
class v extends A {
  _beforeChanged() {
    super._beforeChanged(), (this.isDirty("radius") || this.isDirty("innerRadius") || this.isDirty("spikes")) && (this._clear = !0);
  }
  _changed() {
    if (super._changed(), this._clear) {
      const t = this._display, s = this.get("radius", 0), e = T(this.get("innerRadius", 0), s), a = this.get("spikes", 0), i = Math.PI / a;
      let r = Math.PI / 2 * 3;
      t.moveTo(0, -s);
      for (let o = 0; o < a; o++)
        t.lineTo(Math.cos(r) * s, Math.sin(r) * s), r += i, t.lineTo(Math.cos(r) * e, Math.sin(r) * e), r += i;
      t.lineTo(0, -s), t.closePath();
    }
  }
}
v.className = "Star";
v.classNames = A.classNames.concat([v.className]);
class M extends b {
  constructor() {
    super(...arguments), this.labelContainer = this.children.push(b.new(this._root, {})), this.markerContainer = this.children.push(b.new(this._root, {})), this.startLabel = this.labelContainer.children.push(H.new(this._root, { themeTags: ["start"] })), this.endLabel = this.labelContainer.children.push(H.new(this._root, { themeTags: ["end"] })), this.markers = this.addDisposer(new X(Y.new({}), () => Z._new(this._root, {
      themeTags: I(this.markers.template.get("themeTags", []), [this.get("orientation"), "heatlegend", "marker"])
    }, [this.markers.template])));
  }
  _afterNew() {
    this._settings.themeTags = I(this._settings.themeTags, ["heatlegend", this._settings.orientation]), super._afterNew(), this.set("tooltip", j.new(this._root, {
      themeTags: ["heatlegend"]
    }));
  }
  /**
   * @ignore
   */
  makeMarker() {
    const t = this.markers.make();
    return t.states.create("disabled", {}), t;
  }
  /**
   * Moves and shows tooltip at specific value.
   *
   * Can also specify optional text to show in tooltip, as well as the color.
   *
   * @param  value  Value
   * @param  text   Text
   * @param  color  Color
   */
  showValue(t, s, e) {
    const a = this.getTooltip();
    if (a && N(t)) {
      const i = this.get("startValue", 0), r = this.get("endValue", 1);
      let o = (t - i) / (r - i);
      (o == 1 / 0 || o == -1 / 0 || isNaN(o)) && (o = 0.5);
      const g = this.get("startColor"), c = this.get("endColor");
      s || (s = this.getNumberFormatter().format(t)), e || (e = k.interpolate(o, g, c)), a.label.set("text", s);
      let l;
      this.get("orientation") == "vertical" ? l = this.markerContainer.toGlobal({ x: 0, y: this.innerHeight() * (1 - o) }) : l = this.markerContainer.toGlobal({ x: this.innerWidth() * o, y: 0 });
      let n = a.get("background");
      n && n.set("fill", e), a.set("pointTo", l), a.show();
    }
  }
  _prepareChildren() {
    super._prepareChildren();
    const t = this.labelContainer, s = this.get("orientation"), e = this.startLabel, a = this.endLabel, i = this.getTooltip();
    if (this.isDirty("orientation") && (s == "vertical" ? (this.markerContainer.setAll({ layout: this._root.verticalLayout, height: y }), this.set("layout", this._root.horizontalLayout), e.setAll({ y, x: void 0, centerY: y, centerX: y }), a.setAll({ y: 0, x: void 0, centerY: 0, centerX: y }), t.setAll({ height: y, width: void 0 }), i && i.set("pointerOrientation", "horizontal")) : (this.markerContainer.setAll({ layout: this._root.horizontalLayout, width: y }), this.set("layout", this._root.verticalLayout), e.setAll({ x: 0, y: void 0, centerX: 0, centerY: 0 }), a.setAll({ x: y, y: void 0, centerX: y, centerY: 0 }), t.setAll({ width: y, height: void 0 }), i && i.set("pointerOrientation", "vertical"))), this.isDirty("stepCount")) {
      const r = this.get("stepCount", 1), o = this.get("startColor"), g = this.get("endColor"), c = this.get("startOpacity", 1), l = this.get("endOpacity", 1);
      if (this.markerContainer.children.clear(), r > 1)
        for (let n = 0; n < r; n++) {
          const h = this.makeMarker();
          s == "vertical" ? this.markerContainer.children.moveValue(h, 0) : this.markerContainer.children.push(h), o && g && h.setAll({
            fill: k.interpolate(n / r, o, g),
            fillOpacity: J(n / r * 100).interpolate(c, l)
          });
        }
      else if (r == 1) {
        const n = this.makeMarker();
        this.markerContainer.children.push(n);
        const h = Q.new(this._root, {
          stops: [{
            color: o,
            opacity: c
          }, {
            color: g,
            opacity: l
          }]
        });
        if (s == "vertical") {
          h.set("rotation", 90);
          let d = h.get("stops");
          d && d.reverse();
        } else
          h.set("rotation", 0);
        o && g && n.set("fillGradient", h);
      }
    }
    (this.isDirty("startText") || this.isDirty("startValue")) && e.set("text", this.get("startText", this.getNumberFormatter().format(this.get("startValue", 0)))), (this.isDirty("endText") || this.isDirty("endValue")) && a.set("text", this.get("endText", this.getNumberFormatter().format(this.get("endValue", 1))));
  }
}
M.className = "HeatLegend";
M.classNames = b.classNames.concat([M.className]);
class R extends x {
  constructor() {
    super(...arguments), this.canvas = document.createElement("canvas"), this.context = this.canvas.getContext("2d"), this._clearGrain = !1;
  }
  _beforeChanged() {
    this.canvas.width = this.get("width", 200), this.canvas.height = this.get("height", 200), (this.isDirty("size") || this.isDirty("density") || this.isDirty("minOpacity") || this.isDirty("maxOpacity") || this.isDirty("colors") || this.isDirty("horizontalGap") || this.isDirty("verticalGap")) && (this._clearGrain = !0), super._beforeChanged();
  }
  _changed() {
    if (super._changed(), this._clearGrain) {
      const t = this.get("width", 200), s = this.get("height", 200), e = this.context.getImageData(0, 0, t, s), a = Math.max(1, this.get("size", 1)), i = this.get("minOpacity", 0), r = this.get("maxOpacity", 0.3), o = this.get("colors", [this.get("color", k.fromHex(0))]), g = t / a, c = s / a, l = this.get("density", 1), n = this.get("horizontalGap", 0) + 1, h = this.get("verticalGap", 0) + 1;
      for (let d = 0; d < c; d++)
        if (!(h > 0 && d / h != Math.round(d / h)))
          for (let p = 0; p < g; p++) {
            const m = o[Math.floor(Math.random() * o.length)], u = (i + Math.random() * (r - i)) * 255, f = Math.random();
            n > 0 && p / n != Math.round(p / n) || f < l && this._setRectData(p, d, a, t, e.data, m.r, m.g, m.b, u);
          }
      this.context.putImageData(e, 0, 0), this._pattern = this.context.createPattern(this.canvas, "repeat");
    }
    this._clearGrain = !1;
  }
  _checkDirtyFill() {
    return !1;
  }
  _setRectData(t, s, e, a, i, r, o, g, c) {
    for (var l = t * e; l < t * e + e; l++)
      for (var n = s * e; n < s * e + e; n++) {
        var h = (n * a + l) * 4;
        i[h] = r, i[h + 1] = o, i[h + 2] = g, i[h + 3] = c;
      }
  }
}
R.className = "GrainPattern";
R.classNames = x.classNames.concat([R.className]);
class G extends E {
  /**
   * @ignore
   */
  getFill(t) {
    const s = this.getBounds(t);
    let e = 0, a = 0, i = s.left || 0, r = s.right || 0, o = s.top || 0, g = s.bottom || 0;
    const c = r - i, l = g - o;
    let n = t.get("radius");
    N(n) ? (e = 0, a = 0) : (n = Math.min(c, l) / 2, e = c / 2, a = l / 2);
    let h = this.get("x"), d = this.get("y");
    h != null && (e = T(h, c)), d != null && (a = T(d, l));
    const p = this._root._renderer.createRadialGradient(e, a, 0, e, a, n), m = this.get("stops");
    if (m) {
      let u = 0;
      q(m, (f) => {
        let w = f.offset;
        N(w) || (w = u / (m.length - 1));
        let P = f.opacity;
        N(P) || (P = 1);
        let _ = f.color;
        if (_) {
          const W = f.lighten;
          W && (_ = k.lighten(_, W));
          const F = f.brighten;
          F && (_ = k.brighten(_, F)), p.addColorStop(w, "rgba(" + _.r + "," + _.g + "," + _.b + "," + P + ")");
        }
        u++;
      });
    }
    return p;
  }
}
G.className = "RadialGradient";
G.classNames = E.classNames.concat([G.className]);
class L extends x {
  _beforeChanged() {
    super._beforeChanged(), this.isDirty("gap") && (this._clear = !0);
  }
  _draw() {
    super._draw();
    const t = this.get("checkered", !1), s = this.get("centered", !0), e = this.get("gap", 0), a = this.get("rotation", 0);
    let i = this.get("width", 100), r = this.get("height", 100), o = this.get("radius", 3), g = o * 2 + e, c = o * 2 + e, l = Math.round(i / g), n = Math.round(r / c);
    g = i / l, c = r / n, a != 0 && (this._display.x = g * V(a), this._display.y = c * z(a));
    const h = this.get("color"), d = this.get("colorOpacity");
    (h || d) && this._display.beginFill(h, d);
    for (let p = a == 0 ? 0 : -n * 2; p < n * 2; p++)
      for (let m = a == 0 ? 0 : -l * 2; m < l * 2; m++)
        if (!t || (p & 1) != 1 && (m & 1) != 1 || (p & 1) == 1 && (m & 1) == 1) {
          let u = m * g, f = p * c;
          s && (u += g + e / 2, f += c + e / 2), this._display.drawCircle(u - o, f - o, o);
        }
    t ? (i = i / 2 - e * 2, r = r / 2 - e * 2) : (i -= e, r -= e), (h || d) && this._display.endFill();
  }
}
L.className = "CirclePattern";
L.classNames = x.classNames.concat([L.className]);
class D extends x {
  _beforeChanged() {
    super._beforeChanged(), this.isDirty("gap") && (this._clear = !0);
  }
  _draw() {
    super._draw();
    const t = this.get("checkered", !1), s = this.get("centered", !0), e = this.get("gap", 0), a = this.get("rotation", 0);
    let i = this.get("width", 100), r = this.get("height", 100), o = this.get("maxWidth", 5), g = this.get("maxHeight", 5);
    const c = this._display;
    let l = o + e, n = g + e, h = Math.round(i / l), d = Math.round(r / n);
    l = i / h, n = r / d, a != 0 && (c.x = l / 2 * V(a), c.y = -n / 2 * z(a));
    for (let u = a == 0 ? 0 : -d * 2; u < d * 2; u++)
      for (let f = a == 0 ? 0 : -h * 2; f < h * 2; f++)
        if (!t || (u & 1) != 1 && (f & 1) != 1 || (u & 1) == 1 && (f & 1) == 1) {
          let w = f * l, P = u * n;
          s && (w += (l - o) / 2, P += (n - g) / 2), c.drawRect(w, P, o, g);
        }
    t ? (i = i / 2 - e * 2, r = r / 2 - e * 2) : (i -= e, r -= e);
    const p = this.get("color"), m = this.get("colorOpacity");
    (p || m) && (c.beginFill(p, m), c.endFill());
  }
}
D.className = "RectanglePattern";
D.classNames = x.classNames.concat([D.className]);
class S extends x {
  _beforeChanged() {
    super._beforeChanged(), this.isDirty("svgPath") && (this._clear = !0);
  }
  _draw() {
    super._draw();
    const t = this.get("svgPath");
    t != null && this._display.svgPath(t);
    const s = this.get("color"), e = this.get("colorOpacity");
    (s || e) && (this._display.beginFill(s, e), this._display.endFill());
  }
}
S.className = "PathPattern";
S.classNames = x.classNames.concat([S.className]);
class O extends B {
  _afterNew() {
    if (super._afterNewApplyThemes(), this.get("patterns", []).length === 0) {
      const t = this.get("color", this.root.interfaceColors.get("stroke"));
      this.set("patterns", [
        this.getLinePattern({
          width: 1e3,
          height: 1e3,
          rotation: 45,
          strokeWidth: 1,
          //gap: 6,
          color: t
        }),
        this.getRectanglePattern({
          width: 10,
          height: 10,
          rotation: 0,
          maxWidth: 4,
          maxHeight: 4,
          color: t
        }),
        this.getLinePattern({
          width: 1e3,
          height: 1e3,
          rotation: -45,
          strokeWidth: 1,
          gap: 6,
          color: t
        }),
        this.getCirclePattern({
          width: 11,
          height: 11,
          radius: 2,
          color: t
        }),
        this.getLinePattern({
          width: 6,
          height: 6,
          rotation: 90,
          strokeWidth: 1,
          color: t
        }),
        this.getRectanglePattern({
          width: 14,
          height: 14,
          rotation: 45,
          gap: 4,
          maxWidth: 6,
          maxHeight: 6,
          checkered: !0,
          color: t
        }),
        this.getLinePattern({
          width: 6,
          height: 6,
          rotation: 0,
          strokeWidth: 1,
          color: t
        }),
        this.getRectanglePattern({
          width: 15,
          height: 15,
          rotation: 0,
          gap: 5,
          maxWidth: 5,
          maxHeight: 5,
          checkered: !0,
          color: t
        }),
        this.getLinePattern({
          width: 1e3,
          height: 1e3,
          rotation: 45,
          strokeWidth: 2,
          gap: 3,
          strokeDasharray: [4, 2],
          color: t
        }),
        this.getCirclePattern({
          width: 20,
          height: 20,
          radius: 3,
          gap: 4,
          checkered: !0,
          color: t
        }),
        this.getLinePattern({
          width: 1e3,
          height: 1e3,
          rotation: -45,
          strokeWidth: 2,
          gap: 3,
          strokeDasharray: [4, 2],
          color: t
        }),
        this.getRectanglePattern({
          width: 10,
          height: 10,
          rotation: 0,
          gap: 1,
          maxWidth: 9,
          maxHeight: 9,
          color: t
        }),
        this.getLinePattern({
          width: 1e3,
          height: 1e3,
          rotation: -45,
          strokeWidth: 2,
          gap: 1,
          color: t
        }),
        this.getLinePattern({
          width: 1e3,
          height: 1e3,
          rotation: 45,
          strokeWidth: 2,
          gap: 1,
          color: t
        }),
        this.getLinePattern({
          width: 1e3,
          height: 1e3,
          rotation: 0,
          strokeWidth: 3,
          gap: 1,
          color: t
        }),
        this.getLinePattern({
          width: 1e3,
          height: 1e3,
          rotation: 90,
          strokeWidth: 3,
          gap: 1,
          color: t
        })
      ]);
    }
    this._dirty.patterns = !1;
  }
  _beforeChanged() {
    this.isDirty("patterns") && this.reset();
  }
  /**
   * Returns a [[Pattern]] at specific index.
   *
   * @param   index  Index
   * @return         Color
   */
  getIndex(t) {
    const s = this.get("patterns", []);
    if (t < s.length && s[t] !== null)
      return s[t];
    if (t > s.length - 1) {
      const e = t - Math.floor(t * (t / s.length));
      return s[e];
    }
    return s[t];
  }
  /**
   * Returns next [[Color]] in the list.
   *
   * If the list is out of colors, new ones are generated dynamically.
   */
  next() {
    let t = this.getPrivate("currentStep", this.get("startIndex", 0));
    return this.setPrivate("currentStep", t + this.get("step", 1)), this.getIndex(t);
  }
  /**
   * Resets counter to the start of the list, so the next call for `next()` will
   * return the first pattern.
   */
  reset() {
    this.setPrivate("currentStep", this.get("startIndex", 0));
  }
  /**
   * Returns a [[LinePattern].
   *
   * @param   settings  Pattern settings
   * @return            Pattern object
   */
  getLinePattern(t) {
    return K.new(this.root, t);
  }
  /**
   * Returns a [[RectanglePattern].
   *
   * @param   settings  Pattern settings
   * @return            Pattern object
   */
  getRectanglePattern(t) {
    return D.new(this.root, t);
  }
  /**
   * Returns a [[CirclePattern].
   *
   * @param   settings  Pattern settings
   * @return            Pattern object
   */
  getCirclePattern(t) {
    return L.new(this.root, t);
  }
}
O.className = "PatternSet";
O.classNames = B.classNames.concat([O.className]);
export {
  it as ArrayDisposer,
  rt as BlendMode,
  Xt as Bullet,
  ot as Button,
  nt as CanvasLayer,
  ht as CanvasRenderer,
  lt as Chart,
  se as Circle,
  L as CirclePattern,
  k as Color,
  ct as ColorSet,
  gt as Component,
  Kt as ConfirmButton,
  b as Container,
  dt as CounterDisposer,
  pt as DataItem,
  mt as DateFormatter,
  ft as Disposer,
  ut as DurationFormatter,
  le as EditableLabel,
  Yt as Ellipse,
  B as Entity,
  E as Gradient,
  R as GrainPattern,
  A as Graphics,
  yt as GridLayout,
  M as HeatLegend,
  _t as HorizontalLayout,
  xt as InterfaceColors,
  H as Label,
  Ct as Layout,
  Zt as Legend,
  wt as Line,
  K as LinePattern,
  Q as LinearGradient,
  Qt as Link,
  Pt as ListData,
  X as ListTemplate,
  jt as Modal,
  kt as MultiDisposer,
  bt as NumberFormatter,
  Ut as NumericStepper,
  $t as OrthogonalLine,
  S as PathPattern,
  x as Pattern,
  O as PatternSet,
  Nt as Percent,
  ge as Picture,
  Lt as PicturePattern,
  Dt as PointedRectangle,
  ie as Polygon,
  te as ProgressPie,
  G as RadialGradient,
  pe as RadialLabel,
  me as RadialText,
  Tt as Rectangle,
  D as RectanglePattern,
  vt as Root,
  Z as RoundedRectangle,
  _e as Scrollbar,
  Mt as SerialChart,
  Rt as Series,
  Pe as Slice,
  Ce as Slider,
  Gt as Sprite,
  Jt as SpriteResizer,
  v as Star,
  Y as Template,
  St as Text,
  Ot as TextFormatter,
  Wt as Theme,
  Ft as Tick,
  Ht as Timezone,
  j as Tooltip,
  ue as Triangle,
  It as VerticalLayout,
  oe as ZoomTools,
  ne as ZoomableContainer,
  At as color,
  Vt as p0,
  y as p100,
  zt as p50,
  J as percent,
  Bt as registry
};
