/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { AnchoredRadialSeries } from "./AnchoredRadialSeries";
import { UnknownValuePlotting_$type } from "igniteui-angular-core";
import { DependencyProperty } from "igniteui-angular-core";
import { Array_$type, Point_$type, runOn, enumGetBox, markType, markDep } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { Path } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { ViewportUtils } from "./ViewportUtils";
import { PropertyMetadata } from "igniteui-angular-core";
import { AnchoredRadialSeriesView } from "./AnchoredRadialSeriesView";
import { Defaults } from "./Defaults";
/**
 * @hidden
 */
export let RadialAreaSeries = /*@__PURE__*/ (() => {
    class RadialAreaSeries extends AnchoredRadialSeries {
        constructor() {
            super();
            this.ab = RadialAreaSeries.$;
        }
        get_dd() {
            return true;
        }
        bx() {
            return new RadialAreaSeriesView(this);
        }
        l2(a) {
            super.l2(a);
            this.ub = a;
        }
        preferredCategoryMode(a) {
            return 0;
        }
        k0(a, b) {
            super.k0(a, b);
            this.ub.c1();
        }
        su(a, b) {
            super.su(a, b);
            let c = b.bv;
            let d = b.bu;
            let e = b;
            if (b.o() && !c.isEmpty && !d.isEmpty && this.rp != null && this.rw != null) {
                let f = a.f;
                let g = f.count;
                let h = new List$1(Array_$type, 2, g);
                let i = 0;
                for (let j = 0; j < g; j++) {
                    let k = new Array(4);
                    h.add(k);
                    k[0] = this.rx.d(a.f._inner[j][0], a.f._inner[j][1], c, d);
                    k[1] = this.rx.e(a.f._inner[j][0], a.f._inner[j][1], c, d);
                    k[2] = this.rx.d(a.f._inner[j][0], a.f._inner[j][2], c, d);
                    let l = a.f._inner[j][2];
                    k[3] = this.rx.e(a.f._inner[j][0], l, c, d);
                    if (l > i) {
                        i = l;
                    }
                }
                let m = ViewportUtils.c(0.5, c, d);
                let n = ViewportUtils.f(0.5, c, d);
                this.ua = { $type: Point_$type, x: m, y: n };
                let o = this.getEffectiveViewport1(e);
                this.r3.a0(this, this.sf(), runOn(this, this.rm), this.sh(b), this.si(b));
                let p = false;
                let q = this.r3.b;
                if (q != null) {
                    p = true;
                }
                if (p) {
                    let r = new ScalerParams(0, b.bv, b.bu, this.rp.cg, o);
                    this.tt(f, -1, this.s8.count, this.rp, r, b.q);
                }
                let s = e.c9;
                let t = e.da;
                let u = e.c7;
                let v = e.c8;
                this.r3.ad(s, true, false, true, true);
                this.r3.ad(t, true, false, true, true);
                this.r3.ad(u, false, true, false, false);
                this.r3.ad(v, false, true, false, false);
                e.c2(a.f.count, h, false, this.ub.cs.b, this.fv, runOn(this, this.tu), this.uc);
                u._opacity = this.r3.j * this.fs;
                v._opacity = 0.5 * this.r3.j * this.fs;
            }
        }
        l7(a, b, c, d) {
            super.l7(a, b, c, d);
            switch (b) {
                case RadialAreaSeries.$$p[0]:
                    this.ml(false);
                    this.ls();
                    break;
            }
        }
        get_tb() {
            return true;
        }
    }
    RadialAreaSeries.$t = markType(RadialAreaSeries, 'RadialAreaSeries', AnchoredRadialSeries.$);
    RadialAreaSeries.$$p = markDep(DependencyProperty, PropertyMetadata, RadialAreaSeries, 'raisePropertyChanged', ['UnknownValuePlotting:uc:ue', [UnknownValuePlotting_$type, enumGetBox(UnknownValuePlotting_$type, 1)]]);
    return RadialAreaSeries;
})();
/**
 * @hidden
 */
export let RadialAreaSeriesView = /*@__PURE__*/ (() => {
    class RadialAreaSeriesView extends AnchoredRadialSeriesView {
        constructor(a) {
            super(a);
            this.c0 = null;
            this.c7 = new Path();
            this.c9 = new Path();
            this.c8 = new Path();
            this.da = new Path();
            this.c3 = new Path();
            this.c5 = new Path();
            this.c4 = new Path();
            this.c6 = new Path();
            this.c0 = a;
        }
        as() {
            super.as();
            if (!this.q) {
                this.c0.qh = Defaults.e;
            }
        }
        c1() {
            this.c7.ak = null;
            this.c9.ak = null;
            this.c8.ak = null;
            this.da.ak = null;
            this.c3.ak = null;
            this.c5.ak = null;
            this.c4.ak = null;
            this.c6.ak = null;
            this.aq();
        }
        c2(a, b, c, d, e, f, g) {
            this.cw.s3.i(this.c7, this.c9, this.c8, this.da, a, b, c, d, e, f, g);
            this.aq();
        }
        bb() {
            super.bb();
        }
        bc() {
            super.bc();
            let a = this.bo();
            this.c5.ak = this.c9.ak;
            this.c6.ak = this.da.ak;
            this.c3.ak = this.c7.ak;
            this.c4.ak = this.c8.ak;
            this.c5._stroke = a;
            this.c5.ac = this.e.fw + 3;
            this.c6._stroke = a;
            this.c6.ac = this.e.fw + 3;
            this.c3._fill = a;
            this.c3._opacity = 1;
            this.c4._fill = a;
            this.c4._opacity = 1;
        }
        a6(a, b) {
            super.a6(a, b);
            if (a.d) {
                if (b) {
                    a.t(this.c3);
                    a.t(this.c4);
                    a.t(this.c5);
                    a.t(this.c6);
                }
                else {
                    a.t(this.c7);
                    a.t(this.c8);
                    a.t(this.c9);
                    a.t(this.da);
                }
            }
        }
        al(a) {
            super.al(a);
            this.e.a8.exportPathData(a, this.c9, "lowerShape", ["Lower"]);
            this.e.a8.exportPathData(a, this.da, "upperShape", ["Upper", "Main"]);
            this.e.a8.exportPathData(a, this.c8, "translucentShape", ["Translucent"]);
            this.e.a8.exportPathData(a, this.c7, "fillShape", ["Fill"]);
        }
    }
    RadialAreaSeriesView.$t = markType(RadialAreaSeriesView, 'RadialAreaSeriesView', AnchoredRadialSeriesView.$);
    return RadialAreaSeriesView;
})();
