import { G as x } from "./Gradient.CdcsPIru.js";
import { e as $, a as u, f as L, h as j, j as w } from "./am-chart.H2jnOzFc.js";
class f extends x {
  /**
   * @ignore
   */
  getFill(y) {
    const g = this.get("rotation", 0);
    let i = this.getBounds(y), s = i.left || 0, C = i.right || 0, a = i.top || 0, _ = i.bottom || 0, h = j(g), d = w(g), o = h * (C - s), r = d * (_ - a);
    o == 0 && (o = 1), r == 0 && (r = 1);
    let m = Math.max(o, r);
    const b = this._root._renderer.createLinearGradient(s, a, s + m * h, a + m * d), l = this.get("stops");
    if (l) {
      let p = 0;
      $(l, (e) => {
        let n = e.offset;
        u(n) || (n = p / (l.length - 1));
        let c = e.opacity;
        u(c) || (c = 1);
        let t = e.color;
        if (t) {
          const G = e.lighten;
          G && (t = L.lighten(t, G));
          const N = e.brighten;
          N && (t = L.brighten(t, N)), b.addColorStop(n, "rgba(" + t.r + "," + t.g + "," + t.b + "," + c + ")");
        }
        p++;
      });
    }
    return b;
  }
}
f.className = "LinearGradient";
f.classNames = x.classNames.concat([f.className]);
export {
  f as L
};
