/*
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 { Series } from "./Series";
import { DependencyProperty } from "igniteui-react-core";
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 { 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.nk = null;
            this.nj = null;
            let a = new FinalValueLayerFrame();
            let b = new FinalValueLayerFrame();
            let c = new FinalValueLayerFrame();
            let d = this.fi / 1000;
            this.mc = a;
            this.mb = b;
            this.md = c;
            this.ab = FinalValueLayer.$;
        }
        bf() {
            return new FinalValueLayerView(this);
        }
        i2(a) {
            super.i2(a);
            this.nf = a;
        }
        get oj() {
            return new Thickness(1, this.nm, this.no, this.nn, this.nl);
        }
        ni() {
            return this.axisAnnotationFormatLabel != null;
        }
        mv(a, b) {
            if (this.nh == null || this.nh == a) {
                if (!this.aq.c) {
                    this.jl(b);
                }
            }
        }
        mx(a, b) {
            super.mx(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.mi(this.nh)) {
                this.n2(this.nh, c);
            }
            else {
                for (let d of fromEnum(this.bs.series)) {
                    if (this.mi(d)) {
                        this.n2(d, c);
                    }
                }
            }
        }
        mi(a) {
            if (!super.mi(a)) {
                return false;
            }
            return true;
        }
        iw() {
            super.iw();
            if (!this.aq.c && !this.ca()) {
                return;
            }
            if (this.ca()) {
                this.n3(this.md, false);
            }
            else {
                this.n3(this.mb, false);
            }
        }
        oi(a) {
            let b = NaN;
            let c = NaN;
            let d = this.ng;
            if (d == 0) {
                d = 1;
            }
            let e = false;
            if (d == 2) {
                e = true;
            }
            if (a.isVertical) {
                let f = a.ap();
                if (f != null) {
                    if (d == 1 || d == 2) {
                        if (f.ca) {
                            c = a.ly({ $type: Point_$type, x: this.l8.right, y: this.l8.bottom }).y;
                        }
                        else {
                            c = a.ly({ $type: Point_$type, x: this.l8.right, y: this.l8.top }).y;
                        }
                    }
                    else {
                        if (f.ca) {
                            c = 1;
                        }
                        else {
                            c = 0;
                        }
                    }
                }
                return a.lv({ $type: Point_$type, x: 0, y: c }, e, true);
            }
            else {
                let g = a.ap();
                if (g != null) {
                    if (d == 1 || d == 2) {
                        if (g.ca) {
                            b = a.ly({ $type: Point_$type, x: this.l8.left, y: this.l8.top }).x;
                        }
                        else {
                            b = a.ly({ $type: Point_$type, x: this.l8.right, y: this.l8.top }).x;
                        }
                    }
                    else {
                        if (g.ca) {
                            b = 0;
                        }
                        else {
                            b = 1;
                        }
                    }
                }
                if (a.cr) {
                    return a.lv({ $type: Point_$type, x: b, y: 0 }, e, true);
                }
                else {
                    return a.lv({ $type: Point_$type, x: b, y: 0 }, e, true);
                }
            }
        }
        n2(a, b) {
            let c = this.oi(a);
            let d = this.ly(c);
            let e = this.lb;
            if (e == null) {
                e = this.ld;
            }
            if (e == null) {
                e = a.lb;
                if (e != null) {
                    e = this.nf.b2(e);
                }
            }
            AxisAnnotationFrameManager.c(b, c, a, this.bs, this.getEffectiveViewport(), e, this.of, this.oh, this.og, this.oj, this.np, this.of, this.oh, this.og, this.oj, this.np, a.isVertical, !a.isVertical);
        }
        n3(a, b) {
            let c = false;
            if (this.nj == null) {
                c = true;
                this.nk = new List$1(Axis.$, 0);
                this.nj = new Dictionary$2(Axis.$, Pool$1.$.specialize(AxisAnnotation.$), 0);
            }
            AxisAnnotationFrameManager.d(this, a, c, this.nj, this.nk, b, this.nq, this.nq, this.axisAnnotationFormatLabel, this.axisAnnotationFormatLabel);
        }
        m0(a, b) {
            super.m0(a, b);
            if (this.ca()) {
                this.n3(this.md, true);
            }
            else {
                this.n3(this.mb, false);
            }
        }
        c8() {
            return true;
        }
        i7(a, b, c, d) {
            super.i7(a, b, c, d);
            switch (b) {
                case FinalValueLayer.$$p[10]:
                    this.jl(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.jl(true);
                    break;
                case "SeriesViewer":
                    let e = this.nk;
                    let f = this.nj;
                    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:of:n4', [Brush.$, null], 'AxisAnnotationInterpolatedValuePrecision:nq:n5', [1, -1], 'AxisAnnotationOutline:og:n6', [Brush.$, null], 'AxisAnnotationPaddingBottom:nl:n7', [1, NaN], 'AxisAnnotationPaddingLeft:nm:n8', [1, NaN], 'AxisAnnotationPaddingRight:nn:n9', [1, NaN], 'AxisAnnotationPaddingTop:no:oa', [1, NaN], 'AxisAnnotationStrokeThickness:np:ob', [1, NaN], 'AxisAnnotationTextColor:oh:oc', [Brush.$, null], 'FinalValueSelectionMode:ng:od', [FinalValueSelectionMode_$type, /*@__PURE__*/ enumGetBox(FinalValueSelectionMode_$type, 0)], 'TargetSeries:nh:oe', [Series.$, null]]);
    return FinalValueLayer;
})();
/**
 * @hidden
 */
export let FinalValueLayerView = /*@__PURE__*/ (() => {
    class FinalValueLayerView extends AnnotationLayerView {
        constructor(a) {
            super(a);
            this.b1 = null;
            this.b1 = a;
        }
        ap() {
            super.ap();
        }
        b2(a) {
            if (a == null) {
                return a;
            }
            return BrushUtil.l(a, 0.1);
        }
        ai(a) {
            super.ai(a);
        }
    }
    FinalValueLayerView.$t = /*@__PURE__*/ markType(FinalValueLayerView, 'FinalValueLayerView', AnnotationLayerView.$);
    return FinalValueLayerView;
})();
//# sourceMappingURL=FinalValueLayer_combined.js.map
