/*
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";
import { runOn, Point_$type, typeCast, EnumUtil, enumGetBox, markType, markDep } from "igniteui-react-core";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { DependencyProperty } from "igniteui-react-core";
import { NumericYAxis } from "./NumericYAxis";
import { CategoryMode_$type } from "./CategoryMode";
import { Rect } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { Axis } from "./Axis";
import { TrendLineType_$type } from "igniteui-react-core";
import { CategoryTrendLineManagerFactory } from "./CategoryTrendLineManagerFactory";
import { ISortingAxis_$type } from "./ISortingAxis";
import { CategoryXAxis } from "./CategoryXAxis";
import { PropertyMetadata } from "igniteui-react-core";
/**
 * @hidden
 */
export let HorizontalAnchoredCategorySeries = /*@__PURE__*/ (() => {
    class HorizontalAnchoredCategorySeries extends AnchoredCategorySeries {
        constructor() {
            super(...arguments);
            this.sr = null;
            this.sn = null;
            this.st = null;
            this.sp = 0;
        }
        get ss() {
            if (this.sr == null) {
                this.sr = DVContainer.instance.createInstance(IHorizontalAnchoredCategorySeriesInteractionManager_$type, () => this.cg.n);
            }
            return this.sr;
        }
        ji() {
            super.ji();
            this.xAxis = null;
            this.yAxis = null;
        }
        bj() {
            if (this.bk == 0) {
                return 1;
            }
            else {
                return super.bj();
            }
        }
        pu() {
            return this.sn;
        }
        qe() {
            return this.st;
        }
        n4(a) {
            if (this.pv == null || this.pv.m.count == 0 || !this.hasMarkers || !this.ok()) {
                return Rect.empty;
            }
            return this.ss.d$d(this, this.pv.m, a, runOn(this, this.s5));
        }
        s5(a) {
            return this.rm.c9(a);
        }
        sx(a, b, c) {
            return this.ss.d$c(this, this.qe(), a, b, c);
        }
        ah(a) {
            return this.ss.d$a(this, this.pv.f, this.qu(this.bs), this.qv(this.bs), a);
        }
        ai(a) {
            return this.ss.d$b(this, this.pv.f, this.qu(this.bs), this.qv(this.bs), a);
        }
        dy(a, b) {
            if (this.dx(a, b)) {
                return true;
            }
            if (this.ol(a, b)) {
                return true;
            }
            return false;
        }
        getOffsetValue() {
            return this.pz.r(this.pu(), this.bs.bv, this.bs.bu, this.getEffectiveViewport1(this.bs));
        }
        getCategoryWidth() {
            let a = this.getEffectiveViewport1(this.bs);
            return this.pu().getCategorySize(this.bs.bv, this.bs.bu, a);
        }
        fh(a, b, c) {
            if (this.b6 == null) {
                return NaN;
            }
            let d = this.getEffectiveViewport1(this.bs);
            let e = this.pu();
            let f = new ScalerParams(0, this.b6.os, this.bs.bu, e.ca, d);
            let g = this.pz.r(e, this.b6.os, this.bs.bu, d);
            return this.fj(this.valueColumn, a, e, f, g, runOn(this, this.qs), b, c);
        }
        gf(a, b) {
            return this.gg(a, b, this.pu(), runOn(this, this.qs), this.valueColumn);
        }
        gd(a, b) {
            return this.ge(a, b, this.pu(), runOn(this, this.qs), this.valueColumn);
        }
        e2(a, b, c, d, e) {
            if (this.valueColumn == null) {
                return Number.POSITIVE_INFINITY;
            }
            return this.e3(a, b, this.pu(), d, e, this.valueColumn.count, runOn(this, this.qs));
        }
        nt(a, b, c) {
            if (this.pu() == null || this.qe() == null) {
                return { $type: Point_$type, x: NaN, y: NaN };
            }
            return this.nv(a, b, c, this.pz.r(this.pu(), this.bs.bv, this.bs.bu, this.getEffectiveViewport1(this.bs)), this.qe(), this.pu(), null, null, null);
        }
        fetchXAxis() {
            return this.sn;
        }
        fetchYAxis() {
            return this.st;
        }
        r5(a) {
            this.xAxis = typeCast(CategoryAxisBase.$, a);
        }
        r6(a) {
            this.yAxis = typeCast(NumericYAxis.$, a);
        }
        qo() {
            return this.st != null && this.st.cn();
        }
        s1(a) {
            this.sn = a;
        }
        s2(a) {
            this.st = a;
        }
        po(a, b) {
            return this.rj(a, b, this.sn);
        }
        kp(a, b, c, d) {
            switch (b) {
                case HorizontalAnchoredCategorySeries.$$p[0]:
                    this.s1(this.xAxis);
                    if (this.rm.c3) {
                        this.rm.c2 = CategoryTrendLineManagerFactory.a(this.rm.c2, this.sn, this.ls, this, this.cg);
                    }
                    break;
                case "TrendLineType":
                    let e = EnumUtil.getEnumValue(TrendLineType_$type, d);
                    if (e != 0) {
                        this.rm.c2 = CategoryTrendLineManagerFactory.a(this.rm.c2, this.sn, this.ls, this, this.cg);
                    }
                    break;
            }
            super.kp(a, b, c, d);
            switch (b) {
                case HorizontalAnchoredCategorySeries.$$p[0]:
                    if (c != d) {
                        this.jp(typeCast(Axis.$, c));
                        this.ku(typeCast(Axis.$, d));
                        this.s1(this.xAxis);
                        this.p3.cr.g(this.fq);
                        this.k3(false);
                        this.ka();
                    }
                    break;
                case HorizontalAnchoredCategorySeries.$$p[1]:
                    if (c != d) {
                        this.jp(typeCast(Axis.$, c));
                        this.ku(typeCast(Axis.$, d));
                        this.s2(this.yAxis);
                        this.p3.cr.g(this.fq);
                        this.qo();
                        this.k3(false);
                        this.ka();
                    }
                    break;
                case "CategoryMode":
                    if (this.xAxis != null) {
                        this.xAxis.kw(true);
                    }
                    break;
            }
        }
        jo(a, b, c, d) {
            super.jo(a, b, c, d);
            if (this.sn != null && typeCast(ISortingAxis_$type, this.sn) !== null) {
                this.sn.i$i();
            }
            switch (a) {
                case 4:
                    if (this.sn != null) {
                        this.sn.cn();
                    }
                    if (this.st != null && !this.st.cn()) {
                        this.k3(true);
                    }
                    break;
                case 1:
                    if (this.sn != null) {
                        this.sn.cn();
                    }
                    if (this.st != null && !this.st.cn()) {
                        this.k3(true);
                    }
                    break;
                case 0:
                    if (this.sn != null) {
                        this.sn.cn();
                    }
                    if (this.st != null && !this.st.cn()) {
                        this.k3(true);
                    }
                    break;
                case 2:
                    if (this.ry != null && this.rm.cr.d > 0 && this.st != null && !this.st.cn()) {
                        this.k3(true);
                    }
                    break;
                case 3:
                    if (d == this.ry) {
                        if (this.sn != null) {
                            this.sn.cn();
                        }
                        if (this.st != null && !this.st.cn()) {
                            this.k3(true);
                        }
                    }
                    break;
            }
        }
        sv(a) {
            if (typeCast(CategoryXAxis.$, a) !== null || a.b7) {
                return true;
            }
            return false;
        }
        sw(a) {
            if (typeCast(NumericYAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        get sq() {
            return this.sp;
        }
        set sq(a) {
            let b = this.sq;
            if (a != b) {
                this.sp = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.sq));
            }
        }
        get useHighMarkerFidelity() {
            return this.qp;
        }
    }
    HorizontalAnchoredCategorySeries.$t = /*@__PURE__*/ markType(HorizontalAnchoredCategorySeries, 'HorizontalAnchoredCategorySeries', AnchoredCategorySeries.$);
    HorizontalAnchoredCategorySeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, HorizontalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::s3', [CategoryAxisBase.$, null], 'YAxis::s4', [NumericYAxis.$, null]]);
    return HorizontalAnchoredCategorySeries;
})();
//# sourceMappingURL=HorizontalAnchoredCategorySeries.js.map
