/*
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 { DataAnnotationRangeLayer } from "./DataAnnotationRangeLayer";
import { DependencyProperty } from "igniteui-angular-core";
import { typeCast, enumGetBox, markType, markDep } from "igniteui-angular-core";
import { DataAnnotationDisplayMode_$type } from "./DataAnnotationDisplayMode";
import { List$1 } from "igniteui-angular-core";
import { DataAnnotationInfo } from "./DataAnnotationInfo";
import { IFastItemsSource_$type } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
import { isNaN_ } from "igniteui-angular-core";
/**
 * @hidden
 */
export let DataAnnotationStripLayer = /*@__PURE__*/ (() => {
    class DataAnnotationStripLayer extends DataAnnotationRangeLayer {
        constructor() {
            super();
            this.agm = null;
            this.agl = null;
            this.agk = null;
            this.agj = null;
            this.agi = null;
            this.ab = DataAnnotationStripLayer.$;
        }
        bk() {
            return new DataAnnotationStripLayer();
        }
        aek(a) {
            if (!this.acs(a)) {
                return;
            }
            let b = this.ac2._inner[a];
            b.c = new List$1(DataAnnotationInfo.$, 0);
            b.b = new List$1(DataAnnotationInfo.$, 0);
            b.centerLabelX = this.ado(a, this.agn);
            b.centerLabelY = this.ado(a, this.agn);
            b.startLabelX = this.ado(a, this.agq);
            b.startLabelY = this.ado(a, this.agq);
            b.endLabelX = this.ado(a, this.ago);
            b.endLabelY = this.ado(a, this.ago);
            let c = NaN;
            let d = this.ac7(a, this.agr);
            let e = this.ac7(a, this.agp);
            if (isNaN_(d) && !isNaN_(e)) {
                b.startLabelX = null;
                b.startLabelY = null;
            }
            if (!isNaN_(d) && isNaN_(e)) {
                b.endLabelX = null;
                b.endLabelY = null;
            }
            if (isNaN_(d)) {
                d = e;
            }
            if (isNaN_(e)) {
                e = d;
            }
            if (isNaN_(c)) {
                c = d + ((e - d) / 2);
            }
            if (this.acr) {
                b.shapeStartX = d;
                b.shapeStartY = Number.NEGATIVE_INFINITY;
                b.shapeEndX = e;
                b.shapeEndY = Number.POSITIVE_INFINITY;
                b.shapeCenterX = c;
                b.shapeCenterY = 0;
            }
            else {
                b.shapeStartX = Number.NEGATIVE_INFINITY;
                b.shapeStartY = d;
                b.shapeEndX = Number.POSITIVE_INFINITY;
                b.shapeEndY = e;
                b.shapeCenterX = 0;
                b.shapeCenterY = c;
            }
            b.c.add(((() => {
                let $ret = new DataAnnotationInfo();
                $ret.textColor = this.age;
                $ret.background = this.agc;
                $ret.borderColor = this.agd;
                $ret.j = b.ab.x;
                $ret.k = b.ab.y;
                $ret.dataLabelX = b.startLabelX;
                $ret.dataLabelY = b.startLabelY;
                $ret.dataValueX = b.ab.x;
                $ret.dataValueY = b.ab.y;
                $ret.a = this.acr ? this.agh : 6;
                $ret.b = !this.acr ? this.agh : 6;
                return $ret;
            })()));
            b.c.add(((() => {
                let $ret = new DataAnnotationInfo();
                $ret.j = b.ab.x;
                $ret.k = b.aa.y;
                return $ret;
            })()));
            b.c.add(((() => {
                let $ret = new DataAnnotationInfo();
                $ret.textColor = this.agb;
                $ret.background = this.af9;
                $ret.borderColor = this.aga;
                $ret.j = b.aa.x;
                $ret.k = b.aa.y;
                $ret.dataLabelX = b.endLabelX;
                $ret.dataLabelY = b.endLabelY;
                $ret.dataValueX = b.aa.x;
                $ret.dataValueY = b.aa.y;
                $ret.a = this.acr ? this.agg : 6;
                $ret.b = !this.acr ? this.agg : 6;
                return $ret;
            })()));
            b.c.add(((() => {
                let $ret = new DataAnnotationInfo();
                $ret.j = b.aa.x;
                $ret.k = b.ab.y;
                return $ret;
            })()));
            b.b.add(((() => {
                let $ret = new DataAnnotationInfo();
                $ret.textColor = this.af8;
                $ret.background = this.af6;
                $ret.borderColor = this.af7;
                $ret.j = b.z.x;
                $ret.k = b.z.y;
                $ret.dataLabelX = b.centerLabelX;
                $ret.dataLabelY = b.centerLabelY;
                $ret.dataValueX = b.z.x;
                $ret.dataValueY = b.z.y;
                $ret.a = this.acr ? this.agf : 6;
                $ret.b = !this.acr ? this.agf : 6;
                return $ret;
            })()));
        }
        rg(a, b, c, d) {
            super.rg(a, b, c, d);
            switch (b) {
                case DataAnnotationStripLayer.$$p[7]:
                    if (this.dp != null) {
                        this.dp.deregisterColumn(this.agr);
                        this.agr = this.dl(this.ag8);
                    }
                    break;
                case DataAnnotationStripLayer.$$p[4]:
                    if (this.dp != null) {
                        this.dp.deregisterColumn(this.agp);
                        this.agp = this.dl(this.ag1);
                    }
                    break;
                case DataAnnotationStripLayer.$$p[6]:
                    if (this.dp != null) {
                        this.dp.deregisterColumn(this.agq);
                        this.agq = this.dn(this.ag5);
                    }
                    break;
                case DataAnnotationStripLayer.$$p[3]:
                    if (this.dp != null) {
                        this.dp.deregisterColumn(this.ago);
                        this.ago = this.dn(this.agy);
                    }
                    break;
                case DataAnnotationStripLayer.$$p[1]:
                    if (this.dp != null) {
                        this.dp.deregisterColumn(this.agn);
                        this.agn = this.dn(this.agu);
                    }
                    break;
                case "StartValueColumn":
                case "StartLabelColumn":
                case DataAnnotationStripLayer.$$p[5]:
                case "EndValueColumn":
                case "EndLabelColumn":
                case DataAnnotationStripLayer.$$p[2]:
                case "CenterLabelColumn":
                case DataAnnotationStripLayer.$$p[0]:
                    this.abj();
                    break;
            }
        }
        aem(a, b) {
            super.aem(a, b);
            if (typeCast(IFastItemsSource_$type, a) != null) {
                a.deregisterColumn(this.agr);
                a.deregisterColumn(this.agq);
                a.deregisterColumn(this.agp);
                a.deregisterColumn(this.ago);
                a.deregisterColumn(this.agn);
                this.agr = null;
                this.agq = null;
                this.agp = null;
                this.ago = null;
                this.agn = null;
            }
            if (typeCast(IFastItemsSource_$type, b) != null) {
                this.agr = this.dl(this.ag8);
                this.agq = this.dn(this.ag5);
                this.agp = this.dl(this.ag1);
                this.ago = this.dn(this.agy);
                this.agn = this.dn(this.agu);
            }
        }
        get agr() {
            return this.agm;
        }
        set agr(a) {
            if (this.agm != a) {
                let b = this.agm;
                this.agm = a;
                this.raisePropertyChanged("StartValueColumn", b, this.agm);
            }
        }
        get agq() {
            return this.agl;
        }
        set agq(a) {
            if (this.agl != a) {
                let b = this.agl;
                this.agl = a;
                this.raisePropertyChanged("StartLabelColumn", b, this.agl);
            }
        }
        get agp() {
            return this.agk;
        }
        set agp(a) {
            if (this.agk != a) {
                let b = this.agk;
                this.agk = a;
                this.raisePropertyChanged("EndValueColumn", b, this.agk);
            }
        }
        get ago() {
            return this.agj;
        }
        set ago(a) {
            if (this.agj != a) {
                let b = this.agj;
                this.agj = a;
                this.raisePropertyChanged("EndLabelColumn", b, this.agj);
            }
        }
        get agn() {
            return this.agi;
        }
        set agn(a) {
            if (this.agi != a) {
                let b = this.agi;
                this.agi = a;
                this.raisePropertyChanged("CenterLabelColumn", b, this.agi);
            }
        }
    }
    DataAnnotationStripLayer.$t = markType(DataAnnotationStripLayer, 'DataAnnotationStripLayer', DataAnnotationRangeLayer.$);
    DataAnnotationStripLayer.$$p = markDep(DependencyProperty, PropertyMetadata, DataAnnotationStripLayer, 'raisePropertyChanged', ['CenterLabelDisplayMode:agf:aha', [DataAnnotationDisplayMode_$type, enumGetBox(DataAnnotationDisplayMode_$type, 2)], 'CenterLabelMemberPath:agu:ahb', [2, null], 'EndLabelDisplayMode:agg:ahc', [DataAnnotationDisplayMode_$type, enumGetBox(DataAnnotationDisplayMode_$type, 0)], 'EndLabelMemberPath:agy:ahd', [2, null], 'EndValueMemberPath:ag1:ahe', [2, null], 'StartLabelDisplayMode:agh:ahf', [DataAnnotationDisplayMode_$type, enumGetBox(DataAnnotationDisplayMode_$type, 0)], 'StartLabelMemberPath:ag5:ahg', [2, null], 'StartValueMemberPath:ag8:ahh', [2, null]]);
    return DataAnnotationStripLayer;
})();
