/*
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 { __extends } from "tslib";
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
 */
var HorizontalAnchoredCategorySeries = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(HorizontalAnchoredCategorySeries, _super);
    function HorizontalAnchoredCategorySeries() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.u4 = null;
        _this.u0 = null;
        _this.u6 = null;
        _this.u2 = 0;
        return _this;
    }
    Object.defineProperty(HorizontalAnchoredCategorySeries.prototype, "u5", {
        get: function () {
            var _this = this;
            if (this.u4 == null) {
                this.u4 = DVContainer.instance.createInstance(IHorizontalAnchoredCategorySeriesInteractionManager_$type, function () { return _this.co.n; });
            }
            return this.u4;
        },
        enumerable: false,
        configurable: true
    });
    HorizontalAnchoredCategorySeries.prototype.kz = function () {
        _super.prototype.kz.call(this);
        this.xAxis = null;
        this.yAxis = null;
    };
    HorizontalAnchoredCategorySeries.prototype.bw = function () {
        return 1;
    };
    HorizontalAnchoredCategorySeries.prototype.bx = function () {
        if (this.yAxis != null && this.yAxis.cg) {
            return 4;
        }
        return 3;
    };
    HorizontalAnchoredCategorySeries.prototype.bq = function () {
        if (this.br == 0) {
            return 1;
        }
        else {
            return _super.prototype.bq.call(this);
        }
    };
    HorizontalAnchoredCategorySeries.prototype.rw = function () {
        return this.u0;
    };
    HorizontalAnchoredCategorySeries.prototype.sh = function () {
        return this.u6;
    };
    HorizontalAnchoredCategorySeries.prototype.p5 = function (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));
    };
    HorizontalAnchoredCategorySeries.prototype.vi = function (a) {
        return this.tp.c9(a);
    };
    HorizontalAnchoredCategorySeries.prototype.va = function (a, b, c) {
        return this.u5.d$c(this, this.sh(), a, b, c);
    };
    HorizontalAnchoredCategorySeries.prototype.ah = function (a) {
        return this.u5.d$a(this, this.rx.f, this.sx(this.b1), this.sy(this.b1), a);
    };
    HorizontalAnchoredCategorySeries.prototype.ai = function (a) {
        return this.u5.d$b(this, this.rx.f, this.sx(this.b1), this.sy(this.b1), a);
    };
    HorizontalAnchoredCategorySeries.prototype.ez = function (a, b) {
        if (this.ey(a, b)) {
            return true;
        }
        if (this.qo(a, b)) {
            return true;
        }
        return false;
    };
    HorizontalAnchoredCategorySeries.prototype.getOffsetValue = function () {
        return this.r2.r(this.rw(), this.b1.bv, this.b1.bu, this.getEffectiveViewport1(this.b1));
    };
    HorizontalAnchoredCategorySeries.prototype.getCategoryWidth = function () {
        var a = this.getEffectiveViewport1(this.b1);
        return this.rw().getCategorySize(this.b1.bv, this.b1.bu, a);
    };
    HorizontalAnchoredCategorySeries.prototype.gn = function (a, b, c) {
        if (this.ce == null) {
            return NaN;
        }
        var d = this.getEffectiveViewport1(this.b1);
        var e = this.rw();
        if (e == null) {
            return NaN;
        }
        var f = new ScalerParams(0, this.ce.ta, this.b1.bu, e.cg, d);
        var 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);
    };
    HorizontalAnchoredCategorySeries.prototype.ho = function (a, b) {
        return this.hp(a, b, this.rw(), runOn(this, this.sv), this.valueColumn);
    };
    HorizontalAnchoredCategorySeries.prototype.hm = function (a, b) {
        return this.hn(a, b, this.rw(), runOn(this, this.sv), this.valueColumn);
    };
    HorizontalAnchoredCategorySeries.prototype.f7 = function (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));
    };
    HorizontalAnchoredCategorySeries.prototype.ps = function (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);
    };
    HorizontalAnchoredCategorySeries.prototype.fetchXAxis = function () {
        return this.u0;
    };
    HorizontalAnchoredCategorySeries.prototype.fetchYAxis = function () {
        return this.u6;
    };
    HorizontalAnchoredCategorySeries.prototype.uf = function (a) {
        this.xAxis = typeCast(CategoryAxisBase.$, a);
    };
    HorizontalAnchoredCategorySeries.prototype.ug = function (a) {
        this.yAxis = typeCast(NumericYAxis.$, a);
    };
    HorizontalAnchoredCategorySeries.prototype.sr = function () {
        return this.u6 != null && this.u6.c0();
    };
    HorizontalAnchoredCategorySeries.prototype.ve = function (a) {
        this.u0 = a;
    };
    HorizontalAnchoredCategorySeries.prototype.vf = function (a) {
        this.u6 = a;
    };
    HorizontalAnchoredCategorySeries.prototype.rq = function (a, b) {
        return this.tm(a, b, this.u0);
    };
    HorizontalAnchoredCategorySeries.prototype.l9 = function (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":
                var 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.prototype.l9.call(this, 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;
        }
    };
    HorizontalAnchoredCategorySeries.prototype.k5 = function (a, b, c, d) {
        _super.prototype.k5.call(this, 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;
        }
    };
    HorizontalAnchoredCategorySeries.prototype.u8 = function (a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.cd) {
            return true;
        }
        return false;
    };
    HorizontalAnchoredCategorySeries.prototype.u9 = function (a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    Object.defineProperty(HorizontalAnchoredCategorySeries.prototype, "u3", {
        get: function () {
            return this.u2;
        },
        set: function (a) {
            var b = this.u3;
            if (a != b) {
                this.u2 = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.u3));
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(HorizontalAnchoredCategorySeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.ss;
        },
        enumerable: false,
        configurable: true
    });
    HorizontalAnchoredCategorySeries.$t = markType(HorizontalAnchoredCategorySeries, 'HorizontalAnchoredCategorySeries', AnchoredCategorySeries.$);
    HorizontalAnchoredCategorySeries.$$p = markDep(DependencyProperty, PropertyMetadata, HorizontalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::vg', [CategoryAxisBase.$, null], 'YAxis::vh', [NumericYAxis.$, null]]);
    return HorizontalAnchoredCategorySeries;
}(AnchoredCategorySeries));
export { HorizontalAnchoredCategorySeries };
