/*
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 { AnchoredCategorySeries } from "./AnchoredCategorySeries";
import { IHorizontalAnchoredCategorySeriesInteractionManager_$type } from "./IHorizontalAnchoredCategorySeriesInteractionManager";
import { DVContainer } from "igniteui-angular-core/ES2015/DVContainer";
import { Type, runOn, Point_$type, typeCast, EnumUtil, enumGetBox, markType } from "igniteui-angular-core/ES2015/type";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { DependencyProperty } from "igniteui-angular-core/ES2015/DependencyProperty";
import { NumericYAxis } from "./NumericYAxis";
import { CategoryMode_$type } from "./CategoryMode";
import { Rect } from "igniteui-angular-core/ES2015/Rect";
import { ScalerParams } from "./ScalerParams";
import { Axis } from "./Axis";
import { TrendLineType_$type } from "igniteui-angular-core/ES2015/TrendLineType";
import { CategoryTrendLineManagerFactory } from "./CategoryTrendLineManagerFactory";
import { ISortingAxis_$type } from "./ISortingAxis";
import { CategoryXAxis } from "./CategoryXAxis";
import { PropertyMetadata } from "igniteui-angular-core/ES2015/PropertyMetadata";
/**
 * @hidden
 */
export class HorizontalAnchoredCategorySeries extends AnchoredCategorySeries {
    constructor() {
        super(...arguments);
        this.pu = null;
        this.pq = null;
        this.pw = null;
        this.ps = 0;
    }
    get pv() {
        if (this.pu == null) {
            this.pu = DVContainer.instance.createInstance(IHorizontalAnchoredCategorySeriesInteractionManager_$type, () => this.b2.n);
        }
        return this.pu;
    }
    hn() {
        super.hn();
        this.xAxis = null;
        this.yAxis = null;
    }
    bd() {
        if (this.be == 0) {
            return 1;
        }
        else {
            return super.bd();
        }
    }
    my() {
        return this.pq;
    }
    ni() {
        return this.pw;
    }
    lo(a) {
        if (this.mz == null || this.mz.m.count == 0 || !this.hasMarkers || !this.lv()) {
            return Rect.empty;
        }
        return this.pv.d$d(this, this.mz.m, a, runOn(this, this.p8));
    }
    p8(a) {
        return this.oq.c5(a);
    }
    p0(a, b, c) {
        return this.pv.d$c(this, this.ni(), a, b, c);
    }
    ah(a) {
        return this.pv.d$a(this, this.mz.f, this.nz(this.bi), this.n0(this.bi), a);
    }
    ai(a) {
        return this.pv.d$b(this, this.mz.f, this.nz(this.bi), this.n0(this.bi), a);
    }
    dg(a, b) {
        if (this.df(a, b)) {
            return true;
        }
        if (this.lw(a, b)) {
            return true;
        }
        return false;
    }
    getOffsetValue() {
        return this.m3.r(this.my(), this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    }
    getCategoryWidth() {
        let a = this.getEffectiveViewport1(this.bi);
        return this.my().getCategorySize(this.bi.bs, this.bi.br, a);
    }
    ek(a, b, c) {
        if (this.bs == null) {
            return NaN;
        }
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.my();
        let f = new ScalerParams(0, this.bs.mq, this.bi.br, e.b8, d);
        let g = this.m3.r(e, this.bs.mq, this.bi.br, d);
        return this.em(this.valueColumn, a, e, f, g, runOn(this, this.nx), b, c);
    }
    fb(a, b) {
        return this.fc(a, b, this.my(), runOn(this, this.nx), this.valueColumn);
    }
    e9(a, b) {
        return this.fa(a, b, this.my(), runOn(this, this.nx), this.valueColumn);
    }
    d6(a, b, c, d, e) {
        if (this.valueColumn == null) {
            return Number.POSITIVE_INFINITY;
        }
        return this.d7(a, b, this.my(), d, e, this.valueColumn.count, runOn(this, this.nx));
    }
    ld(a, b, c) {
        if (this.my() == null || this.ni() == null) {
            return { $type: Point_$type, x: NaN, y: NaN };
        }
        return this.lf(a, b, c, this.m3.r(this.my(), this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.ni(), this.my(), null, null, null);
    }
    fetchXAxis() {
        return this.pq;
    }
    fetchYAxis() {
        return this.pw;
    }
    o8(a) {
        this.xAxis = typeCast(CategoryAxisBase.$, a);
    }
    o9(a) {
        this.yAxis = typeCast(NumericYAxis.$, a);
    }
    nt() {
        return this.pw != null && this.pw.ck();
    }
    p4(a) {
        this.pq = a;
    }
    p5(a) {
        this.pw = a;
    }
    ms(a, b) {
        return this.on(a, b, this.pq);
    }
    is(a, b, c, d) {
        switch (b) {
            case HorizontalAnchoredCategorySeries.$$p[0]:
                this.p4(this.xAxis);
                if (this.oq.cz) {
                    this.oq.cy = CategoryTrendLineManagerFactory.a(this.oq.cy, this.pq, this.jp, this, this.b2);
                }
                break;
            case "TrendLineType":
                let e = EnumUtil.getEnumValue(TrendLineType_$type, d);
                if (e != 0) {
                    this.oq.cy = CategoryTrendLineManagerFactory.a(this.oq.cy, this.pq, this.jp, this, this.b2);
                }
                break;
        }
        super.is(a, b, c, d);
        switch (b) {
            case HorizontalAnchoredCategorySeries.$$p[0]:
                if (c != d) {
                    this.ht(typeCast(Axis.$, c));
                    this.ix(typeCast(Axis.$, d));
                    this.p4(this.xAxis);
                    this.m7.cn.g(this.er);
                    this.i5(false);
                    this.ic();
                }
                break;
            case HorizontalAnchoredCategorySeries.$$p[1]:
                if (c != d) {
                    this.ht(typeCast(Axis.$, c));
                    this.ix(typeCast(Axis.$, d));
                    this.p5(this.yAxis);
                    this.m7.cn.g(this.er);
                    this.nt();
                    this.i5(false);
                    this.ic();
                }
                break;
            case "CategoryMode":
                if (this.xAxis != null) {
                    this.xAxis.kg(true);
                }
                break;
        }
    }
    hs(a, b, c, d) {
        super.hs(a, b, c, d);
        if (this.pq != null && typeCast(ISortingAxis_$type, this.pq) !== null) {
            this.pq.i$i();
        }
        switch (a) {
            case 4:
                if (this.pq != null) {
                    this.pq.ck();
                }
                if (this.pw != null && !this.pw.ck()) {
                    this.i5(true);
                }
                break;
            case 1:
                if (this.pq != null) {
                    this.pq.ck();
                }
                if (this.pw != null && !this.pw.ck()) {
                    this.i5(true);
                }
                break;
            case 0:
                if (this.pq != null) {
                    this.pq.ck();
                }
                if (this.pw != null && !this.pw.ck()) {
                    this.i5(true);
                }
                break;
            case 2:
                if (this.o1 != null && this.oq.cn.d > 0 && this.pw != null && !this.pw.ck()) {
                    this.i5(true);
                }
                break;
            case 3:
                if (d == this.o1) {
                    if (this.pq != null) {
                        this.pq.ck();
                    }
                    if (this.pw != null && !this.pw.ck()) {
                        this.i5(true);
                    }
                }
                break;
        }
    }
    py(a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.b5) {
            return true;
        }
        return false;
    }
    pz(a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    }
    get pt() {
        return this.ps;
    }
    set pt(a) {
        let b = this.pt;
        if (a != b) {
            this.ps = a;
            this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.pt));
        }
    }
    get useHighMarkerFidelity() {
        return this.nu;
    }
}
HorizontalAnchoredCategorySeries.$t = markType(HorizontalAnchoredCategorySeries, 'HorizontalAnchoredCategorySeries', AnchoredCategorySeries.$);
Type.dep(DependencyProperty, PropertyMetadata, HorizontalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::p6', [CategoryAxisBase.$, null], 'YAxis::p7', [NumericYAxis.$, null]]);
//# sourceMappingURL=HorizontalAnchoredCategorySeries.js.map