/*
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 { TrendLineManagerBase$1 } from "./TrendLineManagerBase$1";
import { IPreparesCategoryTrendline_$type } from "./IPreparesCategoryTrendline";
import { Number_$type, typeCast, markType } from "igniteui-react-core";
import { TrendResolutionParams } from "./TrendResolutionParams";
import { ScalerParams } from "./ScalerParams";
import { Series } from "./Series";
import { SortedReadOnlyDoubleCollection } from "./SortedReadOnlyDoubleCollection";
/**
 * @hidden
 */
var CategoryTrendLineManagerBase = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(CategoryTrendLineManagerBase, _super);
    function CategoryTrendLineManagerBase() {
        return _super.call(this, Number_$type) || this;
    }
    CategoryTrendLineManagerBase.prototype.get_g$a = function () {
        return 0;
    };
    Object.defineProperty(CategoryTrendLineManagerBase.prototype, "g$a", {
        get: function () {
            return this.get_g$a();
        },
        enumerable: false,
        configurable: true
    });
    CategoryTrendLineManagerBase.prototype.prepareLine = function (a, b, c, d) {
        var e = b.n;
        var f = b.m;
        var g = new ScalerParams(0, b.p, b.o, b.b.j$b, e);
        var h = new ScalerParams(0, b.p, b.o, b.c.j$b, e);
        var i = b.b.j$a();
        var j = i[0];
        var k = i[1];
        if (typeCast(Series.$, a) !== null) {
            h.b = a.h2();
        }
        var l = c.f;
        if (b.d != null && b.d.i$b != null) {
            l = new SortedReadOnlyDoubleCollection(l, b.d.i$b);
        }
        var m = ((function () {
            var $ret = new TrendResolutionParams();
            $ret.e = b.j;
            $ret.f = b.k;
            $ret.g = b.l;
            $ret.a = d;
            $ret.d = b.i;
            $ret.h = b.o;
            $ret.c = j;
            $ret.b = k;
            return $ret;
        })());
        if (a.trendLineType != 0) {
            if (a.isVertical) {
                this.prepareLineCore(b.a.p, a.trendLineType, l, a.trendLinePeriod, function (n) { return b.c.j$c(n, h); }, function (n) { return b.b.j$c(n, g); }, m);
            }
            else {
                this.prepareLineCore(b.a.p, a.trendLineType, l, a.trendLinePeriod, function (n) { return b.b.j$c(n, g); }, function (n) { return b.c.j$c(n, h); }, m);
            }
        }
    };
    CategoryTrendLineManagerBase.$t = markType(CategoryTrendLineManagerBase, 'CategoryTrendLineManagerBase', TrendLineManagerBase$1.$.specialize(Number_$type), [IPreparesCategoryTrendline_$type]);
    return CategoryTrendLineManagerBase;
}(TrendLineManagerBase$1));
export { CategoryTrendLineManagerBase };
