/*
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 * as tslib_1 from "tslib";
import { AnchoredCategorySeries } from "./AnchoredCategorySeries";
import { NumericXAxis } from "./NumericXAxis";
import { DependencyProperty } from "igniteui-angular-core/ES5/DependencyProperty";
import { CategoryYAxis } from "./CategoryYAxis";
import { IVerticalAnchoredCategorySeriesInteractionManager_$type } from "./IVerticalAnchoredCategorySeriesInteractionManager";
import { DVContainer } from "igniteui-angular-core/ES5/DVContainer";
import { Type, runOn, typeCast, EnumUtil, markType } from "igniteui-angular-core/ES5/type";
import { Axis } from "./Axis";
import { ScalerParams } from "./ScalerParams";
import { Rect } from "igniteui-angular-core/ES5/Rect";
import { TrendLineType_$type } from "igniteui-angular-core/ES5/TrendLineType";
import { CategoryTrendLineManagerFactory } from "./CategoryTrendLineManagerFactory";
import { PropertyMetadata } from "igniteui-angular-core/ES5/PropertyMetadata";
import { truncate } from "igniteui-angular-core/ES5/number";
/**
 * @hidden
 */
var VerticalAnchoredCategorySeries = /** @class */ (function (_super) {
    tslib_1.__extends(VerticalAnchoredCategorySeries, _super);
    function VerticalAnchoredCategorySeries() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.pr = null;
        return _this;
    }
    VerticalAnchoredCategorySeries.prototype.hn = function () {
        _super.prototype.hn.call(this);
        this.xAxis = null;
        this.yAxis = null;
    };
    Object.defineProperty(VerticalAnchoredCategorySeries.prototype, "ps", {
        get: function () {
            var _this = this;
            if (this.pr == null) {
                this.pr = DVContainer.instance.createInstance(IVerticalAnchoredCategorySeriesInteractionManager_$type, function () { return _this.b2.n; });
            }
            return this.pr;
        },
        enumerable: true,
        configurable: true
    });
    VerticalAnchoredCategorySeries.prototype.get_isVertical = function () {
        return true;
    };
    VerticalAnchoredCategorySeries.prototype.my = function () {
        return this.yAxis;
    };
    VerticalAnchoredCategorySeries.prototype.ni = function () {
        return this.xAxis;
    };
    VerticalAnchoredCategorySeries.prototype.getOffsetValue = function () {
        return this.m3.r(this.my(), this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    };
    VerticalAnchoredCategorySeries.prototype.getCategoryWidth = function () {
        return this.yAxis.getCategorySize(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    };
    VerticalAnchoredCategorySeries.prototype.e9 = function (a, b) {
        return this.fa(a, b, this.my(), runOn(this, this.nx), this.valueColumn);
    };
    VerticalAnchoredCategorySeries.prototype.fb = function (a, b) {
        return this.fc(a, b, this.my(), runOn(this, this.nx), this.valueColumn);
    };
    VerticalAnchoredCategorySeries.prototype.d6 = function (a, b, c, d, e) {
        if (this.valueColumn == null) {
            return Number.POSITIVE_INFINITY;
        }
        return this.d7(a, b, this.yAxis, d, e, this.valueColumn.count, runOn(this, this.nx));
    };
    VerticalAnchoredCategorySeries.prototype.bd = function () {
        if (this.be == 0) {
            return 1;
        }
        else {
            return _super.prototype.bd.call(this);
        }
    };
    VerticalAnchoredCategorySeries.prototype.lo = function (a) {
        if (!this.hasMarkers || !this.lv()) {
            return Rect.empty;
        }
        return this.ps.e$b(this, this.mz.m, a, runOn(this, this.p0));
    };
    VerticalAnchoredCategorySeries.prototype.p0 = function (a) {
        return this.oq.c5(a);
    };
    VerticalAnchoredCategorySeries.prototype.dg = function (a, b) {
        if (this.df(a, b)) {
            return true;
        }
        if (this.lw(a, b)) {
            return true;
        }
        return false;
    };
    VerticalAnchoredCategorySeries.prototype.ek = function (a, b, c) {
        if (this.bs == null) {
            return NaN;
        }
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.my();
        var f = new ScalerParams(0, this.bs.mq, this.bi.br, e.b8, d);
        var g = this.m3.r(e, this.bs.mq, this.bi.br, d);
        return this.em(this.valueColumn, a, e, f, g, runOn(this, this.nx), b, c);
    };
    VerticalAnchoredCategorySeries.prototype.ld = function (a, b, c) {
        var d = this.my();
        return this.lf(a, b, c, this.m3.r(d, this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.ni(), d, null, null, null);
    };
    VerticalAnchoredCategorySeries.prototype.fetchXAxis = function () {
        return this.xAxis;
    };
    VerticalAnchoredCategorySeries.prototype.fetchYAxis = function () {
        return this.yAxis;
    };
    VerticalAnchoredCategorySeries.prototype.o8 = function (a) {
        this.xAxis = typeCast(NumericXAxis.$, a);
    };
    VerticalAnchoredCategorySeries.prototype.o9 = function (a) {
        this.yAxis = typeCast(CategoryYAxis.$, a);
    };
    VerticalAnchoredCategorySeries.prototype.nt = function () {
        return this.xAxis != null && this.xAxis.ck();
    };
    VerticalAnchoredCategorySeries.prototype.ms = function (a, b) {
        return this.on(a, b, this.yAxis);
    };
    VerticalAnchoredCategorySeries.prototype.d8 = function (a) {
        return this.ps.e$a(this, a);
    };
    VerticalAnchoredCategorySeries.prototype.nx = function (a) {
        return this.ea(a, this.my());
    };
    VerticalAnchoredCategorySeries.prototype.e5 = function (a) {
        return truncate(Math.round(this.d8(a)));
    };
    VerticalAnchoredCategorySeries.prototype.fm = function (a) {
        var b = this.e5(a);
        return b >= 0 && this.bz != null && b < this.bz.count ? this.bz.item(b) : null;
    };
    VerticalAnchoredCategorySeries.prototype.is = function (a, b, c, d) {
        _super.prototype.is.call(this, a, b, c, d);
        switch (b) {
            case VerticalAnchoredCategorySeries.$$p[0]:
                if (c != d) {
                    this.ht(typeCast(Axis.$, c));
                    this.ix(typeCast(Axis.$, d));
                    this.m7.cn.g(this.er);
                    this.i5(false);
                    this.ic();
                }
                break;
            case VerticalAnchoredCategorySeries.$$p[1]:
                if (c != d) {
                    this.ht(typeCast(Axis.$, c));
                    this.ix(typeCast(Axis.$, d));
                    this.m7.cn.g(this.er);
                    this.nt();
                    this.i5(false);
                    this.ic();
                }
                break;
            case "TrendLineType":
                var e = EnumUtil.getEnumValue(TrendLineType_$type, d);
                if (e != 0) {
                    this.oq.cy = CategoryTrendLineManagerFactory.a(this.oq.cy, this.yAxis, this.jp, this, this.b2);
                }
                break;
        }
    };
    VerticalAnchoredCategorySeries.prototype.pv = function (a) {
        if (typeCast(CategoryYAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    VerticalAnchoredCategorySeries.prototype.pu = function (a) {
        if (typeCast(NumericXAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    Object.defineProperty(VerticalAnchoredCategorySeries.prototype, "useHighMarkerFidelity", {
        get: function () {
            return this.nu;
        },
        enumerable: true,
        configurable: true
    });
    VerticalAnchoredCategorySeries.$t = markType(VerticalAnchoredCategorySeries, 'VerticalAnchoredCategorySeries', AnchoredCategorySeries.$);
    return VerticalAnchoredCategorySeries;
}(AnchoredCategorySeries));
export { VerticalAnchoredCategorySeries };
Type.dep(DependencyProperty, PropertyMetadata, VerticalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::py', [NumericXAxis.$, null], 'YAxis::pz', [CategoryYAxis.$, null]]);
//# sourceMappingURL=VerticalAnchoredCategorySeries.js.map