/*
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-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 { Axis } from "./Axis";
import { Rect } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
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
 */
var HorizontalAnchoredCategorySeries = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(HorizontalAnchoredCategorySeries, _super);
    function HorizontalAnchoredCategorySeries() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.abx = null;
        _this.abt = null;
        _this.abz = null;
        _this.abv = 0;
        return _this;
    }
    Object.defineProperty(HorizontalAnchoredCategorySeries.prototype, "aby", {
        get: function () {
            var _this = this;
            if (this.abx == null) {
                this.abx = DVContainer.instance.createInstance(IHorizontalAnchoredCategorySeriesInteractionManager_$type, function () { return _this.dp.n; });
            }
            return this.abx;
        },
        enumerable: false,
        configurable: true
    });
    HorizontalAnchoredCategorySeries.prototype.oz = function () {
        _super.prototype.oz.call(this);
        this.xAxis = null;
        this.yAxis = null;
    };
    HorizontalAnchoredCategorySeries.prototype.ci = function () {
        return 1;
    };
    HorizontalAnchoredCategorySeries.prototype.cj = function () {
        if (this.yAxis != null && this.yAxis.ch) {
            return 4;
        }
        return 3;
    };
    HorizontalAnchoredCategorySeries.prototype.b0 = function () {
        if (this.b1 == 0) {
            return 1;
        }
        else {
            return _super.prototype.b0.call(this);
        }
    };
    HorizontalAnchoredCategorySeries.prototype.yj = function () {
        return this.abt;
    };
    HorizontalAnchoredCategorySeries.prototype.yz = function () {
        return this.abz;
    };
    HorizontalAnchoredCategorySeries.prototype.wi = function (a) {
        if (this.yk == null || this.yk.n.count == 0 || !this.hasMarkers || !this.w7()) {
            return Rect.empty;
        }
        return this.aby.d$d(this, this.yk.n, a, runOn(this, this.acb));
    };
    HorizontalAnchoredCategorySeries.prototype.acb = function (a) {
        return this.aad.de(a);
    };
    HorizontalAnchoredCategorySeries.prototype.ab3 = function (a, b, c) {
        return this.aby.d$c(this, this.yz(), a, b, c);
    };
    HorizontalAnchoredCategorySeries.prototype.aj = function (a) {
        return this.aby.d$a(this, this.yk.f, this.zl(this.ct), this.zm(this.ct), a);
    };
    HorizontalAnchoredCategorySeries.prototype.ak = function (a) {
        return this.aby.d$b(this, this.yk.f, this.zl(this.ct), this.zm(this.ct), a);
    };
    HorizontalAnchoredCategorySeries.prototype.gu = function (a, b) {
        if (this.gt(a, b)) {
            return true;
        }
        if (this.w8(a, b)) {
            return true;
        }
        return false;
    };
    HorizontalAnchoredCategorySeries.prototype.getOffsetValue = function () {
        return this.yp.r(this.yj(), this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct));
    };
    HorizontalAnchoredCategorySeries.prototype.getCategoryWidth = function () {
        var a = this.getEffectiveViewport1(this.ct);
        return this.yj().getCategorySize(this.ct.by, this.ct.bx, a);
    };
    HorizontalAnchoredCategorySeries.prototype.i3 = function (a, b, c) {
        if (this.c9 == null) {
            return NaN;
        }
        var d = this.getEffectiveViewport1(this.ct);
        var e = this.yj();
        if (e == null) {
            return NaN;
        }
        var f = new ScalerParams(0, this.c9.vl, this.ct.bx, e.ch, d);
        var g = this.yp.r(e, this.c9.vl, this.ct.bx, d);
        return this.i5(this.valueColumn, a, e, f, g, runOn(this, this.zj), b, c);
    };
    HorizontalAnchoredCategorySeries.prototype.j8 = function (a, b) {
        return this.j9(a, b, this.yj(), runOn(this, this.zj), this.valueColumn);
    };
    HorizontalAnchoredCategorySeries.prototype.j6 = function (a, b) {
        return this.j7(a, b, this.yj(), runOn(this, this.zj), this.valueColumn);
    };
    HorizontalAnchoredCategorySeries.prototype.im = function (a, b, c, d, e) {
        if (this.valueColumn == null) {
            return Number.POSITIVE_INFINITY;
        }
        return this.io(a, b, this.yj(), d, e, this.valueColumn.count, runOn(this, this.zj));
    };
    HorizontalAnchoredCategorySeries.prototype.v5 = function (a, b, c) {
        if (this.yj() == null || this.yz() == null) {
            return { $type: Point_$type, x: NaN, y: NaN };
        }
        return this.v7(a, b, c, this.yp.r(this.yj(), this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct)), this.yz(), this.yj(), null, null, null);
    };
    HorizontalAnchoredCategorySeries.prototype.fetchXAxis = function () {
        return this.abt;
    };
    HorizontalAnchoredCategorySeries.prototype.fetchYAxis = function () {
        return this.abz;
    };
    HorizontalAnchoredCategorySeries.prototype.aa7 = function (a) {
        this.xAxis = typeCast(CategoryAxisBase.$, a);
    };
    HorizontalAnchoredCategorySeries.prototype.aa8 = function (a) {
        this.yAxis = typeCast(NumericYAxis.$, a);
    };
    HorizontalAnchoredCategorySeries.prototype.zf = function () {
        return this.abz != null && this.abz.c1();
    };
    HorizontalAnchoredCategorySeries.prototype.ab7 = function (a) {
        this.abt = a;
    };
    HorizontalAnchoredCategorySeries.prototype.ab8 = function (a) {
        this.abz = a;
    };
    HorizontalAnchoredCategorySeries.prototype.yd = function (a, b) {
        return this.aaa(a, b, this.abt);
    };
    HorizontalAnchoredCategorySeries.prototype.q4 = function (a, b, c, d) {
        switch (b) {
            case HorizontalAnchoredCategorySeries.$$p[0]:
                this.ab7(this.xAxis);
                if (this.aad.c8) {
                    this.aad.c7 = CategoryTrendLineManagerFactory.a(this.aad.c7, this.abt, this.so, this, this.dp);
                }
                break;
            case "TrendLineType":
                var e = EnumUtil.getEnumValue(TrendLineType_$type, d);
                if (e != 0) {
                    this.aad.c7 = CategoryTrendLineManagerFactory.a(this.aad.c7, this.abt, this.so, this, this.dp);
                }
                break;
        }
        _super.prototype.q4.call(this, a, b, c, d);
        switch (b) {
            case HorizontalAnchoredCategorySeries.$$p[0]:
                if (c != d) {
                    this.o9(typeCast(Axis.$, c));
                    this.rc(typeCast(Axis.$, d));
                    this.ab7(this.xAxis);
                    this.yt.cw.g(this.ib);
                    this.rm(false);
                    this.qg();
                }
                break;
            case HorizontalAnchoredCategorySeries.$$p[1]:
                if (c != d) {
                    this.o9(typeCast(Axis.$, c));
                    this.rc(typeCast(Axis.$, d));
                    this.ab8(this.yAxis);
                    if (this.c9 != null) {
                        this.c9.nq();
                    }
                    this.yt.cw.g(this.ib);
                    this.zf();
                    this.rm(false);
                    this.qg();
                }
                break;
            case "CategoryMode":
                if (this.xAxis != null) {
                    this.xAxis.l7(true);
                }
                break;
        }
    };
    HorizontalAnchoredCategorySeries.prototype.o8 = function (a, b, c, d) {
        _super.prototype.o8.call(this, a, b, c, d);
        if (this.abt != null && typeCast(ISortingAxis_$type, this.abt) !== null) {
            this.abt.i$i();
        }
        switch (a) {
            case 4:
                if (this.abt != null) {
                    this.abt.c1();
                }
                if (this.abz != null && !this.abz.c1()) {
                    this.rm(true);
                }
                break;
            case 1:
                if (this.abt != null) {
                    this.abt.c1();
                }
                if (this.abz != null && !this.abz.c1()) {
                    this.rm(true);
                }
                break;
            case 0:
                if (this.abt != null) {
                    this.abt.c1();
                }
                if (this.abz != null && !this.abz.c1()) {
                    this.rm(true);
                }
                break;
            case 2:
                if (this.aat != null && this.aad.cw.d > 0 && this.abz != null && !this.abz.c1()) {
                    this.rm(true);
                }
                break;
            case 3:
                if (d == this.aat) {
                    if (this.abt != null) {
                        this.abt.c1();
                    }
                    if (this.abz != null && !this.abz.c1()) {
                        this.rm(true);
                    }
                }
                break;
        }
    };
    HorizontalAnchoredCategorySeries.prototype.ab1 = function (a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.ce) {
            return true;
        }
        return false;
    };
    HorizontalAnchoredCategorySeries.prototype.ab2 = function (a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    Object.defineProperty(HorizontalAnchoredCategorySeries.prototype, "abw", {
        get: function () {
            return this.abv;
        },
        set: function (a) {
            var b = this.abw;
            if (a != b) {
                this.abv = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.abw));
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(HorizontalAnchoredCategorySeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.zg;
        },
        enumerable: false,
        configurable: true
    });
    HorizontalAnchoredCategorySeries.$t = markType(HorizontalAnchoredCategorySeries, 'HorizontalAnchoredCategorySeries', AnchoredCategorySeries.$);
    HorizontalAnchoredCategorySeries.$$p = markDep(DependencyProperty, PropertyMetadata, HorizontalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::ab9', [CategoryAxisBase.$, null], 'YAxis::aca', [NumericYAxis.$, null]]);
    return HorizontalAnchoredCategorySeries;
}(AnchoredCategorySeries));
export { HorizontalAnchoredCategorySeries };
