/*
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 { AnnotationLayer } from "./AnnotationLayer";
import { DependencyProperty } from "igniteui-react-core";
import { Series } from "./Series";
import { FinalValueSelectionMode_$type } from "./FinalValueSelectionMode";
import { Brush } from "igniteui-react-core";
import { Thickness } from "igniteui-react-core";
import { FinalValueLayerFrame } from "./FinalValueLayerFrame";
import { List$1 } from "igniteui-react-core";
import { Axis } from "./Axis";
import { Dictionary$2 } from "igniteui-react-core";
import { Pool$1 } from "igniteui-react-core";
import { AxisAnnotation } from "./AxisAnnotation";
import { Base, enumGetBox, fromEnum, Point_$type, markType, markDep } from "igniteui-react-core";
import { AxisAnnotationFrameManager } from "./AxisAnnotationFrameManager";
import { PropertyMetadata } from "igniteui-react-core";
import { AnnotationLayerView } from "./AnnotationLayerView";
import { BrushUtil } from "igniteui-react-core";
/**
 * @hidden
 */
export let FinalValueLayer = /*@__PURE__*/ (() => {
    class FinalValueLayer extends AnnotationLayer {
        constructor() {
            super();
            this.axisAnnotationFormatLabel = null;
            this.pj = null;
            this.pi = null;
            let a = new FinalValueLayerFrame();
            let b = new FinalValueLayerFrame();
            let c = new FinalValueLayerFrame();
            let d = this.gj / 1000;
            this.ob = a;
            this.oa = b;
            this.oc = c;
            this.ab = FinalValueLayer.$;
        }
        bp() {
            return new FinalValueLayerView(this);
        }
        kk(a) {
            super.kk(a);
            this.pe = a;
        }
        get ql() {
            return new Thickness(1, this.pl, this.pn, this.pm, this.pk);
        }
        ph() {
            return this.axisAnnotationFormatLabel != null;
        }
        ou(a, b) {
            if (this.pg == null || this.pg == a) {
                if (!this.ar.c) {
                    this.k3(b);
                }
            }
        }
        ow(a, b) {
            super.ow(a, b);
            let c = a;
            c.f.clear();
            c.q.clear();
            c.p.clear();
            c.aa.clear();
            c.o.clear();
            c.z.clear();
            c.g.clear();
            c.h.clear();
            c.j.clear();
            c.l.clear();
            c.k.clear();
            c.i.clear();
            c.m.clear();
            c.n.clear();
            c.r.clear();
            c.s.clear();
            c.u.clear();
            c.w.clear();
            c.v.clear();
            c.t.clear();
            c.x.clear();
            c.y.clear();
            if (this.oh(this.pg)) {
                this.p3(this.pg, c);
            }
            else {
                for (let d of fromEnum(this.b6.series)) {
                    if (this.oh(d)) {
                        this.p3(d, c);
                    }
                    if (d.isStacked) {
                        d.jy((e) => {
                            if (this.oh(e)) {
                                this.p3(e, c);
                            }
                            return true;
                        });
                    }
                }
            }
        }
        oh(a) {
            if (!super.oh(a)) {
                return false;
            }
            if (this.p0 != null) {
                if (a.c7) {
                    let b = a.ib();
                    if (!Base.equalsStatic(this.p0, b)) {
                        return false;
                    }
                }
                else {
                    if (!Base.equalsStatic(this.p0, a.name)) {
                        return false;
                    }
                }
            }
            return true;
        }
        kd() {
            super.kd();
            if (!this.ar.c && !this.cn()) {
                return;
            }
            if (this.cn()) {
                this.p4(this.oc, false);
            }
            else {
                this.p4(this.oa, false);
            }
        }
        qk(a) {
            let b = NaN;
            let c = NaN;
            let d = this.pf;
            if (d == 0) {
                d = 1;
            }
            let e = false;
            if (d == 2) {
                e = true;
            }
            if (a.isVertical) {
                let f = a.aq();
                if (f != null) {
                    if (d == 1 || d == 2) {
                        if (f.ca) {
                            c = a.nw({ $type: Point_$type, x: this.n6.right, y: this.n6.bottom }).y;
                        }
                        else {
                            c = a.nw({ $type: Point_$type, x: this.n6.right, y: this.n6.top }).y;
                        }
                    }
                    else {
                        if (f.ca) {
                            c = 1;
                        }
                        else {
                            c = 0;
                        }
                    }
                }
                return a.nt({ $type: Point_$type, x: 0, y: c }, e, true);
            }
            else {
                let g = a.aq();
                if (g != null) {
                    if (d == 1 || d == 2) {
                        if (g.ca) {
                            b = a.nw({ $type: Point_$type, x: this.n6.left, y: this.n6.top }).x;
                        }
                        else {
                            b = a.nw({ $type: Point_$type, x: this.n6.right, y: this.n6.top }).x;
                        }
                    }
                    else {
                        if (g.ca) {
                            b = 0;
                        }
                        else {
                            b = 1;
                        }
                    }
                }
                if (a.c6) {
                    return a.nt({ $type: Point_$type, x: b, y: 0 }, e, true);
                }
                else {
                    return a.nt({ $type: Point_$type, x: b, y: 0 }, e, true);
                }
            }
        }
        p3(a, b) {
            let c = this.qk(a);
            let d = this.nw(c);
            let e = this.m9;
            if (e == null) {
                e = this.nb;
            }
            if (e == null) {
                e = a.m9;
                if (e != null) {
                    e = this.pe.b5(e);
                }
            }
            AxisAnnotationFrameManager.c(b, c, a, this.b6, this.getEffectiveViewport(), e, this.qh, this.qj, this.qi, this.ql, this.po, this.qh, this.qj, this.qi, this.ql, this.po, a.isVertical, !a.isVertical);
        }
        p4(a, b) {
            let c = false;
            if (this.pi == null) {
                c = true;
                this.pj = new List$1(Axis.$, 0);
                this.pi = new Dictionary$2(Axis.$, Pool$1.$.specialize(AxisAnnotation.$), 0);
            }
            AxisAnnotationFrameManager.d(this, a, c, this.pi, this.pj, b, this.pp, this.pp, this.axisAnnotationFormatLabel, this.axisAnnotationFormatLabel);
        }
        oz(a, b) {
            super.oz(a, b);
            if (this.cn()) {
                this.p4(this.oc, true);
            }
            else {
                this.p4(this.oa, false);
            }
        }
        dp() {
            return true;
        }
        kp(a, b, c, d) {
            super.kp(a, b, c, d);
            switch (b) {
                case FinalValueLayer.$$p[10]:
                case FinalValueLayer.$$p[11]:
                    this.k3(true);
                    break;
                case FinalValueLayer.$$p[0]:
                case FinalValueLayer.$$p[2]:
                case FinalValueLayer.$$p[4]:
                case FinalValueLayer.$$p[6]:
                case FinalValueLayer.$$p[5]:
                case FinalValueLayer.$$p[3]:
                case FinalValueLayer.$$p[7]:
                case FinalValueLayer.$$p[8]:
                case FinalValueLayer.$$p[9]:
                    this.k3(true);
                    break;
                case "SeriesViewer":
                    let e = this.pj;
                    let f = this.pi;
                    if (f != null) {
                        for (let g of fromEnum(f)) {
                            let h = g.value;
                            h.c((i) => g.key.am.remove(i));
                            h.clear();
                        }
                        e.clear();
                        f.clear();
                    }
                    break;
            }
        }
    }
    FinalValueLayer.$t = /*@__PURE__*/ markType(FinalValueLayer, 'FinalValueLayer', AnnotationLayer.$);
    FinalValueLayer.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, FinalValueLayer, 'raisePropertyChanged', ['AxisAnnotationBackground:qh:p5', [Brush.$, null], 'AxisAnnotationInterpolatedValuePrecision:pp:p6', [1, -1], 'AxisAnnotationOutline:qi:p7', [Brush.$, null], 'AxisAnnotationPaddingBottom:pk:p8', [1, NaN], 'AxisAnnotationPaddingLeft:pl:p9', [1, NaN], 'AxisAnnotationPaddingRight:pm:qa', [1, NaN], 'AxisAnnotationPaddingTop:pn:qb', [1, NaN], 'AxisAnnotationStrokeThickness:po:qc', [1, NaN], 'AxisAnnotationTextColor:qj:qd', [Brush.$, null], 'FinalValueSelectionMode:pf:qe', [FinalValueSelectionMode_$type, /*@__PURE__*/ enumGetBox(FinalValueSelectionMode_$type, 0)], 'TargetSeriesName:p0:qf', [2, null], 'TargetSeries:pg:qg', [Series.$, null]]);
    return FinalValueLayer;
})();
/**
 * @hidden
 */
export let FinalValueLayerView = /*@__PURE__*/ (() => {
    class FinalValueLayerView extends AnnotationLayerView {
        constructor(a) {
            super(a);
            this.b4 = null;
            this.b4 = a;
        }
        as() {
            super.as();
        }
        b5(a) {
            if (a == null) {
                return a;
            }
            return BrushUtil.l(a, 0.1);
        }
        al(a) {
            super.al(a);
        }
    }
    FinalValueLayerView.$t = /*@__PURE__*/ markType(FinalValueLayerView, 'FinalValueLayerView', AnnotationLayerView.$);
    return FinalValueLayerView;
})();
//# sourceMappingURL=FinalValueLayer_combined.js.map
