/*
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 { NumericXAxis } from "./NumericXAxis";
import { DependencyProperty } from "igniteui-angular-core/ES2015/DependencyProperty";
import { CategoryYAxis } from "./CategoryYAxis";
import { IVerticalAnchoredCategorySeriesInteractionManager_$type } from "./IVerticalAnchoredCategorySeriesInteractionManager";
import { DVContainer } from "igniteui-angular-core/ES2015/DVContainer";
import { Type, runOn, typeCast, EnumUtil, markType } from "igniteui-angular-core/ES2015/type";
import { Axis } from "./Axis";
import { ScalerParams } from "./ScalerParams";
import { Rect } from "igniteui-angular-core/ES2015/Rect";
import { TrendLineType_$type } from "igniteui-angular-core/ES2015/TrendLineType";
import { CategoryTrendLineManagerFactory } from "./CategoryTrendLineManagerFactory";
import { PropertyMetadata } from "igniteui-angular-core/ES2015/PropertyMetadata";
import { truncate } from "igniteui-angular-core/ES2015/number";
/**
 * @hidden
 */
export class VerticalAnchoredCategorySeries extends AnchoredCategorySeries {
    constructor() {
        super(...arguments);
        this.py = null;
    }
    ht() {
        super.ht();
        this.xAxis = null;
        this.yAxis = null;
    }
    get pz() {
        if (this.py == null) {
            this.py = DVContainer.instance.createInstance(IVerticalAnchoredCategorySeriesInteractionManager_$type, () => this.b2.n);
        }
        return this.py;
    }
    get_isVertical() {
        return true;
    }
    m5() {
        return this.yAxis;
    }
    np() {
        return this.xAxis;
    }
    getOffsetValue() {
        return this.na.r(this.m5(), this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    }
    getCategoryWidth() {
        return this.yAxis.getCategorySize(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    }
    fc(a, b) {
        return this.fd(a, b, this.m5(), runOn(this, this.n4), this.valueColumn);
    }
    fe(a, b) {
        return this.ff(a, b, this.m5(), runOn(this, this.n4), this.valueColumn);
    }
    d9(a, b, c, d, e) {
        if (this.valueColumn == null) {
            return Number.POSITIVE_INFINITY;
        }
        return this.ea(a, b, this.yAxis, d, e, this.valueColumn.count, runOn(this, this.n4));
    }
    bd() {
        if (this.be == 0) {
            return 1;
        }
        else {
            return super.bd();
        }
    }
    lv(a) {
        if (!this.hasMarkers || !this.l2()) {
            return Rect.empty;
        }
        return this.pz.e$b(this, this.m6.m, a, runOn(this, this.p7));
    }
    p7(a) {
        return this.ox.c5(a);
    }
    dh(a, b) {
        if (this.dg(a, b)) {
            return true;
        }
        if (this.l3(a, b)) {
            return true;
        }
        return false;
    }
    en(a, b, c) {
        if (this.bs == null) {
            return NaN;
        }
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.m5();
        let f = new ScalerParams(0, this.bs.mq, this.bi.br, e.b8, d);
        let g = this.na.r(e, this.bs.mq, this.bi.br, d);
        return this.ep(this.valueColumn, a, e, f, g, runOn(this, this.n4), b, c);
    }
    lk(a, b, c) {
        let d = this.m5();
        return this.lm(a, b, c, this.na.r(d, this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.np(), d, null, null, null);
    }
    fetchXAxis() {
        return this.xAxis;
    }
    fetchYAxis() {
        return this.yAxis;
    }
    pf(a) {
        this.xAxis = typeCast(NumericXAxis.$, a);
    }
    pg(a) {
        this.yAxis = typeCast(CategoryYAxis.$, a);
    }
    n0() {
        return this.xAxis != null && this.xAxis.ck();
    }
    mz(a, b) {
        return this.ou(a, b, this.yAxis);
    }
    eb(a) {
        return this.pz.e$a(this, a);
    }
    n4(a) {
        return this.ed(a, this.m5());
    }
    e8(a) {
        return truncate(Math.round(this.eb(a)));
    }
    fp(a) {
        let b = this.e8(a);
        return b >= 0 && this.bz != null && b < this.bz.count ? this.bz.item(b) : null;
    }
    iy(a, b, c, d) {
        super.iy(a, b, c, d);
        switch (b) {
            case VerticalAnchoredCategorySeries.$$p[0]:
                if (c != d) {
                    this.hz(typeCast(Axis.$, c));
                    this.i3(typeCast(Axis.$, d));
                    this.ne.cn.g(this.eu);
                    this.jc(false);
                    this.ij();
                }
                break;
            case VerticalAnchoredCategorySeries.$$p[1]:
                if (c != d) {
                    this.hz(typeCast(Axis.$, c));
                    this.i3(typeCast(Axis.$, d));
                    this.ne.cn.g(this.eu);
                    this.n0();
                    this.jc(false);
                    this.ij();
                }
                break;
            case "TrendLineType":
                let e = EnumUtil.getEnumValue(TrendLineType_$type, d);
                if (e != 0) {
                    this.ox.cy = CategoryTrendLineManagerFactory.a(this.ox.cy, this.yAxis, this.jw, this, this.b2);
                }
                break;
        }
    }
    p2(a) {
        if (typeCast(CategoryYAxis.$, a) !== null) {
            return true;
        }
        return false;
    }
    p1(a) {
        if (typeCast(NumericXAxis.$, a) !== null) {
            return true;
        }
        return false;
    }
    get useHighMarkerFidelity() {
        return this.n1;
    }
}
VerticalAnchoredCategorySeries.$t = markType(VerticalAnchoredCategorySeries, 'VerticalAnchoredCategorySeries', AnchoredCategorySeries.$);
Type.dep(DependencyProperty, PropertyMetadata, VerticalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::p5', [NumericXAxis.$, null], 'YAxis::p6', [CategoryYAxis.$, null]]);
//# sourceMappingURL=VerticalAnchoredCategorySeries.js.map