/*
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";
import { runOn, Point_$type, typeCast, EnumUtil, enumGetBox, markType, markDep } from "igniteui-angular-core";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { DependencyProperty } from "igniteui-angular-core";
import { NumericYAxis } from "./NumericYAxis";
import { CategoryMode_$type } from "./CategoryMode";
import { Axis } from "./Axis";
import { Rect } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { TrendLineType_$type } from "igniteui-angular-core";
import { CategoryTrendLineManagerFactory } from "./CategoryTrendLineManagerFactory";
import { ISortingAxis_$type } from "./ISortingAxis";
import { CategoryXAxis } from "./CategoryXAxis";
import { PropertyMetadata } from "igniteui-angular-core";
/**
 * @hidden
 */
export let HorizontalAnchoredCategorySeries = /*@__PURE__*/ (() => {
    class HorizontalAnchoredCategorySeries extends AnchoredCategorySeries {
        constructor() {
            super(...arguments);
            this.u4 = null;
            this.u0 = null;
            this.u6 = null;
            this.u2 = 0;
        }
        get u5() {
            if (this.u4 == null) {
                this.u4 = DVContainer.instance.createInstance(IHorizontalAnchoredCategorySeriesInteractionManager_$type, () => this.co.n);
            }
            return this.u4;
        }
        kz() {
            super.kz();
            this.xAxis = null;
            this.yAxis = null;
        }
        bw() {
            return 1;
        }
        bx() {
            if (this.yAxis != null && this.yAxis.cg) {
                return 4;
            }
            return 3;
        }
        bq() {
            if (this.br == 0) {
                return 1;
            }
            else {
                return super.bq();
            }
        }
        rw() {
            return this.u0;
        }
        sh() {
            return this.u6;
        }
        p5(a) {
            if (this.rx == null || this.rx.m.count == 0 || !this.hasMarkers || !this.qn()) {
                return Rect.empty;
            }
            return this.u5.d$d(this, this.rx.m, a, runOn(this, this.vi));
        }
        vi(a) {
            return this.tp.c9(a);
        }
        va(a, b, c) {
            return this.u5.d$c(this, this.sh(), a, b, c);
        }
        ah(a) {
            return this.u5.d$a(this, this.rx.f, this.sx(this.b1), this.sy(this.b1), a);
        }
        ai(a) {
            return this.u5.d$b(this, this.rx.f, this.sx(this.b1), this.sy(this.b1), a);
        }
        ez(a, b) {
            if (this.ey(a, b)) {
                return true;
            }
            if (this.qo(a, b)) {
                return true;
            }
            return false;
        }
        getOffsetValue() {
            return this.r2.r(this.rw(), this.b1.bv, this.b1.bu, this.getEffectiveViewport1(this.b1));
        }
        getCategoryWidth() {
            let a = this.getEffectiveViewport1(this.b1);
            return this.rw().getCategorySize(this.b1.bv, this.b1.bu, a);
        }
        gn(a, b, c) {
            if (this.ce == null) {
                return NaN;
            }
            let d = this.getEffectiveViewport1(this.b1);
            let e = this.rw();
            if (e == null) {
                return NaN;
            }
            let f = new ScalerParams(0, this.ce.ta, this.b1.bu, e.cg, d);
            let g = this.r2.r(e, this.ce.ta, this.b1.bu, d);
            return this.gp(this.valueColumn, a, e, f, g, runOn(this, this.sv), b, c);
        }
        ho(a, b) {
            return this.hp(a, b, this.rw(), runOn(this, this.sv), this.valueColumn);
        }
        hm(a, b) {
            return this.hn(a, b, this.rw(), runOn(this, this.sv), this.valueColumn);
        }
        f7(a, b, c, d, e) {
            if (this.valueColumn == null) {
                return Number.POSITIVE_INFINITY;
            }
            return this.f8(a, b, this.rw(), d, e, this.valueColumn.count, runOn(this, this.sv));
        }
        ps(a, b, c) {
            if (this.rw() == null || this.sh() == null) {
                return { $type: Point_$type, x: NaN, y: NaN };
            }
            return this.pu(a, b, c, this.r2.r(this.rw(), this.b1.bv, this.b1.bu, this.getEffectiveViewport1(this.b1)), this.sh(), this.rw(), null, null, null);
        }
        fetchXAxis() {
            return this.u0;
        }
        fetchYAxis() {
            return this.u6;
        }
        uf(a) {
            this.xAxis = typeCast(CategoryAxisBase.$, a);
        }
        ug(a) {
            this.yAxis = typeCast(NumericYAxis.$, a);
        }
        sr() {
            return this.u6 != null && this.u6.c0();
        }
        ve(a) {
            this.u0 = a;
        }
        vf(a) {
            this.u6 = a;
        }
        rq(a, b) {
            return this.tm(a, b, this.u0);
        }
        l9(a, b, c, d) {
            switch (b) {
                case HorizontalAnchoredCategorySeries.$$p[0]:
                    this.ve(this.xAxis);
                    if (this.tp.c3) {
                        this.tp.c2 = CategoryTrendLineManagerFactory.a(this.tp.c2, this.u0, this.nf, this, this.co);
                    }
                    break;
                case "TrendLineType":
                    let e = EnumUtil.getEnumValue(TrendLineType_$type, d);
                    if (e != 0) {
                        this.tp.c2 = CategoryTrendLineManagerFactory.a(this.tp.c2, this.u0, this.nf, this, this.co);
                    }
                    break;
            }
            super.l9(a, b, c, d);
            switch (b) {
                case HorizontalAnchoredCategorySeries.$$p[0]:
                    if (c != d) {
                        this.k6(typeCast(Axis.$, c));
                        this.me(typeCast(Axis.$, d));
                        this.ve(this.xAxis);
                        this.r6.cr.g(this.fx);
                        this.mn(false);
                        this.lu();
                    }
                    break;
                case HorizontalAnchoredCategorySeries.$$p[1]:
                    if (c != d) {
                        this.k6(typeCast(Axis.$, c));
                        this.me(typeCast(Axis.$, d));
                        this.vf(this.yAxis);
                        if (this.ce != null) {
                            this.ce.l6();
                        }
                        this.r6.cr.g(this.fx);
                        this.sr();
                        this.mn(false);
                        this.lu();
                    }
                    break;
                case "CategoryMode":
                    if (this.xAxis != null) {
                        this.xAxis.l4(true);
                    }
                    break;
            }
        }
        k5(a, b, c, d) {
            super.k5(a, b, c, d);
            if (this.u0 != null && typeCast(ISortingAxis_$type, this.u0) !== null) {
                this.u0.i$i();
            }
            switch (a) {
                case 4:
                    if (this.u0 != null) {
                        this.u0.c0();
                    }
                    if (this.u6 != null && !this.u6.c0()) {
                        this.mn(true);
                    }
                    break;
                case 1:
                    if (this.u0 != null) {
                        this.u0.c0();
                    }
                    if (this.u6 != null && !this.u6.c0()) {
                        this.mn(true);
                    }
                    break;
                case 0:
                    if (this.u0 != null) {
                        this.u0.c0();
                    }
                    if (this.u6 != null && !this.u6.c0()) {
                        this.mn(true);
                    }
                    break;
                case 2:
                    if (this.t4 != null && this.tp.cr.d > 0 && this.u6 != null && !this.u6.c0()) {
                        this.mn(true);
                    }
                    break;
                case 3:
                    if (d == this.t4) {
                        if (this.u0 != null) {
                            this.u0.c0();
                        }
                        if (this.u6 != null && !this.u6.c0()) {
                            this.mn(true);
                        }
                    }
                    break;
            }
        }
        u8(a) {
            if (typeCast(CategoryXAxis.$, a) !== null || a.cd) {
                return true;
            }
            return false;
        }
        u9(a) {
            if (typeCast(NumericYAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        get u3() {
            return this.u2;
        }
        set u3(a) {
            let b = this.u3;
            if (a != b) {
                this.u2 = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.u3));
            }
        }
        get useHighMarkerFidelity() {
            return this.ss;
        }
    }
    HorizontalAnchoredCategorySeries.$t = markType(HorizontalAnchoredCategorySeries, 'HorizontalAnchoredCategorySeries', AnchoredCategorySeries.$);
    HorizontalAnchoredCategorySeries.$$p = markDep(DependencyProperty, PropertyMetadata, HorizontalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::vg', [CategoryAxisBase.$, null], 'YAxis::vh', [NumericYAxis.$, null]]);
    return HorizontalAnchoredCategorySeries;
})();
