/*
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 { TrendLineManagerBase$1 } from "./TrendLineManagerBase$1";
import { IPreparesCategoryTrendline_$type } from "./IPreparesCategoryTrendline";
import { Number_$type, typeCast, markType } from "igniteui-react-core/ES2015/type";
import { TrendResolutionParams } from "./TrendResolutionParams";
import { ScalerParams } from "./ScalerParams";
import { Series } from "./Series";
import { SafeSortedReadOnlyDoubleCollection } from "./SafeSortedReadOnlyDoubleCollection";
/**
 * @hidden
 */
export class CategoryTrendLineManagerBase extends TrendLineManagerBase$1 {
    constructor() {
        super(Number_$type);
    }
    get_g$a() {
        return 0;
    }
    get g$a() {
        return this.get_g$a();
    }
    prepareLine(a, b, c, d) {
        let e = b.k;
        let f = new ScalerParams(0, b.m, b.l, b.b.j$a, e);
        let g = new ScalerParams(0, b.m, b.l, b.c.j$a, e);
        if (typeCast(Series.$, a) !== null) {
            g.b = a.ee();
        }
        let h = c.f;
        if (b.d != null && b.d.i$b != null) {
            h = new SafeSortedReadOnlyDoubleCollection(0, h, b.d.i$b);
        }
        let i = ((() => {
            let $ret = new TrendResolutionParams();
            $ret.c = b.h;
            $ret.d = b.i;
            $ret.e = b.j;
            $ret.a = d;
            $ret.b = b.g;
            $ret.f = b.l;
            return $ret;
        })());
        if (a.trendLineType != 0) {
            if (a.isVertical) {
                this.prepareLineCore(b.a.p, a.trendLineType, h, a.trendLinePeriod, (j) => b.c.j$b(j, g), (j) => b.b.j$b(j, f), i);
            }
            else {
                this.prepareLineCore(b.a.p, a.trendLineType, h, a.trendLinePeriod, (j) => b.b.j$b(j, f), (j) => b.c.j$b(j, g), i);
            }
        }
    }
}
CategoryTrendLineManagerBase.$t = markType(CategoryTrendLineManagerBase, 'CategoryTrendLineManagerBase', TrendLineManagerBase$1.$.specialize(Number_$type), [IPreparesCategoryTrendline_$type]);
