/*
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-react-core/ES2015/DVContainer";
import { Type, runOn, Point_$type, typeCast, EnumUtil, enumGetBox, markType } from "igniteui-react-core/ES2015/type";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { DependencyProperty } from "igniteui-react-core/ES2015/DependencyProperty";
import { NumericYAxis } from "./NumericYAxis";
import { CategoryMode_$type } from "./CategoryMode";
import { Rect } from "igniteui-react-core/ES2015/Rect";
import { ScalerParams } from "./ScalerParams";
import { Axis } from "./Axis";
import { TrendLineType_$type } from "igniteui-react-core/ES2015/TrendLineType";
import { CategoryTrendLineManagerFactory } from "./CategoryTrendLineManagerFactory";
import { ISortingAxis_$type } from "./ISortingAxis";
import { CategoryXAxis } from "./CategoryXAxis";
import { PropertyMetadata } from "igniteui-react-core/ES2015/PropertyMetadata";
export class HorizontalAnchoredCategorySeries extends AnchoredCategorySeries {
    constructor() {
        super(...arguments);
        this.pr = null;
        this.pn = null;
        this.pt = null;
        this.pp = 0;
    }
    get ps() {
        if (this.pr == null) {
            this.pr = DVContainer.instance.createInstance(IHorizontalAnchoredCategorySeriesInteractionManager_$type, () => this.b2.n);
        }
        return this.pr;
    }
    hj() {
        super.hj();
        this.xAxis = null;
        this.yAxis = null;
    }
    bd() {
        if (this.be == 0) {
            return 1;
        }
        else {
            return super.bd();
        }
    }
    mu() {
        return this.pn;
    }
    ne() {
        return this.pt;
    }
    lk(a) {
        if (this.mv == null || this.mv.m.count == 0 || !this.hasMarkers || !this.lr()) {
            return Rect.empty;
        }
        return this.ps.d$d(this, this.mv.m, a, runOn(this, this.p5));
    }
    p5(a) {
        return this.on.c3(a);
    }
    px(a, b, c) {
        return this.ps.d$c(this, this.ne(), a, b, c);
    }
    ah(a) {
        return this.ps.d$a(this, this.mv.f, this.nv(this.bi), this.nw(this.bi), a);
    }
    ai(a) {
        return this.ps.d$b(this, this.mv.f, this.nv(this.bi), this.nw(this.bi), a);
    }
    de(a, b) {
        if (this.dd(a, b)) {
            return true;
        }
        if (this.ls(a, b)) {
            return true;
        }
        return false;
    }
    getOffsetValue() {
        return this.mz.r(this.mu(), this.bi.bq, this.bi.bp, this.getEffectiveViewport1(this.bi));
    }
    getCategoryWidth() {
        let a = this.getEffectiveViewport1(this.bi);
        return this.mu().getCategorySize(this.bi.bq, this.bi.bp, a);
    }
    eh(a, b, c) {
        if (this.bs == null) {
            return NaN;
        }
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.mu();
        let f = new ScalerParams(0, this.bs.mk, this.bi.bp, e.b8, d);
        let g = this.mz.r(e, this.bs.mk, this.bi.bp, d);
        return this.ej(this.valueColumn, a, e, f, g, runOn(this, this.nt), b, c);
    }
    e8(a, b) {
        return this.e9(a, b, this.mu(), runOn(this, this.nt), this.valueColumn);
    }
    e6(a, b) {
        return this.e7(a, b, this.mu(), runOn(this, this.nt), this.valueColumn);
    }
    d4(a, b, c, d, e) {
        if (this.valueColumn == null) {
            return Number.POSITIVE_INFINITY;
        }
        return this.d5(a, b, this.mu(), d, e, this.valueColumn.count, runOn(this, this.nt));
    }
    k9(a, b, c) {
        if (this.mu() == null || this.ne() == null) {
            return { $type: Point_$type, x: NaN, y: NaN };
        }
        return this.lb(a, b, c, this.mz.r(this.mu(), this.bi.bq, this.bi.bp, this.getEffectiveViewport1(this.bi)), this.ne(), this.mu(), null, null, null);
    }
    fetchXAxis() {
        return this.pn;
    }
    fetchYAxis() {
        return this.pt;
    }
    o5(a) {
        this.xAxis = typeCast(CategoryAxisBase.$, a);
    }
    o6(a) {
        this.yAxis = typeCast(NumericYAxis.$, a);
    }
    np() {
        return this.pt != null && this.pt.ck();
    }
    p1(a) {
        this.pn = a;
    }
    p2(a) {
        this.pt = a;
    }
    mo(a, b) {
        return this.ok(a, b, this.pn);
    }
    io(a, b, c, d) {
        switch (b) {
            case HorizontalAnchoredCategorySeries.$$p[0]:
                this.p1(this.xAxis);
                if (this.on.cx) {
                    this.on.cw = CategoryTrendLineManagerFactory.a(this.on.cw, this.pn, this.jl, this, this.b2);
                }
                break;
            case "TrendLineType":
                let e = EnumUtil.getEnumValue(TrendLineType_$type, d);
                if (e != 0) {
                    this.on.cw = CategoryTrendLineManagerFactory.a(this.on.cw, this.pn, this.jl, this, this.b2);
                }
                break;
        }
        super.io(a, b, c, d);
        switch (b) {
            case HorizontalAnchoredCategorySeries.$$p[0]:
                if (c != d) {
                    this.hp(typeCast(Axis.$, c));
                    this.it(typeCast(Axis.$, d));
                    this.p1(this.xAxis);
                    this.m3.cl.g(this.eo);
                    this.i1(false);
                    this.h8();
                }
                break;
            case HorizontalAnchoredCategorySeries.$$p[1]:
                if (c != d) {
                    this.hp(typeCast(Axis.$, c));
                    this.it(typeCast(Axis.$, d));
                    this.p2(this.yAxis);
                    this.m3.cl.g(this.eo);
                    this.np();
                    this.i1(false);
                    this.h8();
                }
                break;
            case "CategoryMode":
                if (this.xAxis != null) {
                    this.xAxis.kf(true);
                }
                break;
        }
    }
    ho(a, b, c, d) {
        super.ho(a, b, c, d);
        if (this.pn != null && typeCast(ISortingAxis_$type, this.pn) !== null) {
            this.pn.i$i();
        }
        switch (a) {
            case 4:
                if (this.pn != null) {
                    this.pn.ck();
                }
                if (this.pt != null && !this.pt.ck()) {
                    this.i1(true);
                }
                break;
            case 1:
                if (this.pn != null) {
                    this.pn.ck();
                }
                if (this.pt != null && !this.pt.ck()) {
                    this.i1(true);
                }
                break;
            case 0:
                if (this.pn != null) {
                    this.pn.ck();
                }
                if (this.pt != null && !this.pt.ck()) {
                    this.i1(true);
                }
                break;
            case 2:
                if (this.oy != null && this.on.cl.d > 0 && this.pt != null && !this.pt.ck()) {
                    this.i1(true);
                }
                break;
            case 3:
                if (d == this.oy) {
                    if (this.pn != null) {
                        this.pn.ck();
                    }
                    if (this.pt != null && !this.pt.ck()) {
                        this.i1(true);
                    }
                }
                break;
        }
    }
    pv(a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.b5) {
            return true;
        }
        return false;
    }
    pw(a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    }
    get pq() {
        return this.pp;
    }
    set pq(a) {
        let b = this.pq;
        if (a != b) {
            this.pp = a;
            this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.pq));
        }
    }
    get useHighMarkerFidelity() {
        return this.nq;
    }
}
HorizontalAnchoredCategorySeries.$t = markType(HorizontalAnchoredCategorySeries, 'HorizontalAnchoredCategorySeries', AnchoredCategorySeries.$);
Type.dep(DependencyProperty, PropertyMetadata, HorizontalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::p3', [CategoryAxisBase.$, null], 'YAxis::p4', [NumericYAxis.$, null]]);
/*<BeginStatics Name="Infragistics.Controls.Charts.HorizontalAnchoredCategorySeries" />*/
/*<EndStatics Name="Infragistics.Controls.Charts.HorizontalAnchoredCategorySeries" />*/
