/*
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, __values } from "tslib";
import { FinancialSeries } from "./FinancialSeries";
import { ITrendLineSeries_$type } from "./ITrendLineSeries";
import { TrendLineType_$type } from "igniteui-angular-core";
import { DependencyProperty } from "igniteui-angular-core";
import { Brush } from "igniteui-angular-core";
import { PenLineCap_$type } from "igniteui-angular-core";
import { DoubleCollection } from "igniteui-angular-core";
import { PriceDisplayType_$type } from "./PriceDisplayType";
import { CategoryCollisionMode_$type } from "./CategoryCollisionMode";
import { Series } from "./Series";
import { Defaults } from "./Defaults";
import { enumGetBox, EnumUtil, Number_$type, typeCast, fromEnum, Point_$type, runOn, markType, markDep } from "igniteui-angular-core";
import { CategoryFrame } from "./CategoryFrame";
import { ISortingAxis_$type } from "./ISortingAxis";
import { FinancialSeriesView } from "./FinancialSeriesView";
import { List$1 } from "igniteui-angular-core";
import { Rect } from "igniteui-angular-core";
import { RectUtil } from "igniteui-angular-core";
import { CategoryTrendLineManagerFactory } from "./CategoryTrendLineManagerFactory";
import { AxisRange } from "./AxisRange";
import { ScalerParams } from "./ScalerParams";
import { TrendResolutionParams } from "./TrendResolutionParams";
import { Pool$1 } from "igniteui-angular-core";
import { Path } from "igniteui-angular-core";
import { Thickness } from "igniteui-angular-core";
import { PathGeometry } from "igniteui-angular-core";
import { PathFigure } from "igniteui-angular-core";
import { LineSegment } from "igniteui-angular-core";
import { GeometryGroup } from "igniteui-angular-core";
import { LineGeometry } from "igniteui-angular-core";
import { RectangleGeometry } from "igniteui-angular-core";
import { DataLegendSeriesValueInfo } from "igniteui-angular-core";
import { DataLegendSeriesContext } from "igniteui-angular-core";
import { ChartSelection } from "./ChartSelection";
import { PropertyMetadata } from "igniteui-angular-core";
import { truncate, isNaN_, isInfinity } from "igniteui-angular-core";
import { boxArray$1 } from "igniteui-angular-core";
import { round10N } from "igniteui-angular-core";
import { FinancialPriceBucketCalculator } from "./FinancialPriceBucketCalculator";
import { Extensions } from "igniteui-angular-core";
/**
 * @hidden
 */
var FinancialPriceSeries = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FinancialPriceSeries, _super);
    function FinancialPriceSeries() {
        var _this = _super.call(this) || this;
        _this.abe = true;
        _this.abf = 0;
        _this.abg = 0;
        _this.ab = FinancialPriceSeries.$;
        _this.xk = new CategoryFrame(5);
        _this.xm = new CategoryFrame(5);
        _this.xi = new CategoryFrame(5);
        return _this;
    }
    FinancialPriceSeries.prototype.bk = function () {
        return new FinancialPriceSeries();
    };
    FinancialPriceSeries.prototype.get_fb = function () {
        return true;
    };
    FinancialPriceSeries.prototype.jn = function () {
        if (!isNaN_(this.jm)) {
            return _super.prototype.jn.call(this);
        }
        return Defaults.financialSeries_Resolution;
    };
    FinancialPriceSeries.prototype.ct = function () {
        return new FinancialPriceSeriesView(this);
    };
    FinancialPriceSeries.prototype.q7 = function (a) {
        _super.prototype.q7.call(this, a);
        this.abc = a;
    };
    Object.defineProperty(FinancialPriceSeries.prototype, "acv", {
        get: function () {
            return this.c(FinancialPriceSeries.acc);
        },
        set: function (a) {
            this.h(FinancialPriceSeries.acc, a);
        },
        enumerable: false,
        configurable: true
    });
    FinancialPriceSeries.prototype.ph = function (a, b, c, d) {
        var e_1, _a;
        _super.prototype.ph.call(this, a, b, c, d);
        if (this.xg != null && typeCast(ISortingAxis_$type, this.xg) !== null) {
            this.xg.i$i();
        }
        this.abc.cd.e(this.ie);
        if (this.abc.cn) {
            this.abc.cl.g$i(a, b, c, d);
        }
        if (this.abc.aa.count > 0) {
            try {
                for (var _b = __values(fromEnum(this.abc.aa)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var e = _c.value;
                    e.g$i(a, b, c, d);
                }
            }
            catch (e_1_1) {
                e_1 = { error: e_1_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_1)
                        throw e_1.error;
                }
            }
        }
        if (this.xz != null) {
            this.xz.d2();
        }
        this.ry(true);
        if (a == 0 || a == 2 || a == 3 || a == 4) {
            this.abe = true;
        }
        else if (a == 1) {
            for (var f = b; f < b + c; f++) {
                var g = 0;
                g += this.ya.item(f);
                g += this.yb.item(f);
                g += this.x9.item(f);
                this.abf += g / 3;
            }
            this.abg = this.abf / this.ya.count;
        }
    };
    FinancialPriceSeries.prototype.b3 = function () {
        if (this.b4 == 0) {
            return 1;
        }
        else {
            return _super.prototype.b3.call(this);
        }
    };
    FinancialPriceSeries.prototype.wx = function (a) {
        if (this.xi == null || this.xi.h.count == 0) {
            return Rect.empty;
        }
        var b = this.wh(a);
        var c = this.cw.ca;
        var d = this.cw.b9;
        var e = this.getEffectiveViewport1(this.cw);
        var f = this.an(this.xg, this.xi.h, this.zd(this.cw), this.zf(this.cw), a, true);
        var g = f[0];
        var h = f[1];
        var i = Math.abs(b.x - g[0]);
        var j = Math.abs(b.x - h[0]);
        var k = this.abh(this.xx, e);
        k = Math.max(k, 3);
        var l = (k - 1) / 2;
        if (i < j) {
            var m = g[0] - l;
            var n = g[0];
            var o = g[0] + l;
            var p = g[1];
            var q = g[2];
            var r = g[3];
            var s = g[4];
            var t = Math.min(Math.min(Math.min(p, q), r), s);
            var u = Math.max(Math.max(Math.max(p, q), r), s);
            return new Rect(0, m, t, Math.abs(o - m), u - t);
        }
        else {
            var v = h[0] - l;
            var w = h[0];
            var x = h[0] + l;
            var y = h[1];
            var z = h[2];
            var aa = h[3];
            var ab = h[4];
            var ac = Math.min(Math.min(Math.min(y, z), aa), ab);
            var ad = Math.max(Math.max(Math.max(y, z), aa), ab);
            return new Rect(0, v, ac, Math.abs(x - v), ad - ac);
        }
    };
    FinancialPriceSeries.prototype.aba = function (a, b) {
        var c = a[0] - b;
        var d = a[0];
        var e = a[0] + b;
        var f = a[1];
        var g = a[2];
        var h = a[3];
        var i = a[4];
        var j = Math.min(Math.min(Math.min(f, g), h), i);
        var k = Math.max(Math.max(Math.max(f, g), h), i);
        var l = Math.min(g, h);
        var m = Math.max(g, h);
        var n = Math.min(f, i);
        var o = Math.max(f, i);
        if (this.abd == 1) {
            var p = new Array(3);
            var q = new Rect(0, c, f, b, 0);
            var r = new Rect(0, d, i, b, 0);
            var s = new Rect(0, d, l, 0, m - l);
            p[0] = q;
            p[1] = r;
            p[2] = s;
            return p;
        }
        else {
            var t = new Array(2);
            var u = new Rect(0, d, l, 0, m - l);
            var v = new Rect(0, c, n, b * 2, o - n);
            t[0] = u;
            t[1] = v;
            return t;
        }
    };
    FinancialPriceSeries.prototype.ao = function (a) {
        var b = new List$1(Rect.$, 0);
        var c = this.wh(a);
        var d = this.cw.ca;
        var e = this.cw.b9;
        var f = this.getEffectiveViewport1(this.cw);
        var g = this.an(this.xg, this.xi.h, this.zd(this.cw), this.zf(this.cw), a, true);
        var h = g[0];
        var i = g[1];
        var j = Math.abs(c.x - h[0]);
        var k = Math.abs(c.x - i[0]);
        var l = this.abh(this.xx, f);
        l = Math.max(l, 3);
        var m = (l - 1) / 2;
        if (j < k) {
            return this.aba(h, m);
        }
        else {
            return this.aba(i, m);
        }
    };
    FinancialPriceSeries.prototype.gx = function (a, b) {
        if (this.g0(a, b)) {
            return true;
        }
        return false;
    };
    FinancialPriceSeries.prototype.g0 = function (a, b) {
        var c = this.wy(a);
        if (c.isEmpty) {
            return false;
        }
        var d = RectUtil.r(c, (this.ig / 2) + this.iw(b));
        if (d.containsPoint(a)) {
            var e = this.ap(a);
            if (e != null) {
                for (var f = 0; f < e.length; f++) {
                    var g = e[f];
                    var h = RectUtil.r(g, (this.ig / 2) + this.iw(b));
                    if (h.containsPoint(a)) {
                        return true;
                    }
                }
            }
        }
        return false;
    };
    FinancialPriceSeries.prototype.rg = function (a, b, c, d) {
        switch (b) {
            case FinancialPriceSeries.$$p[4]:
            case FinancialPriceSeries.$$p[5]:
            case FinancialPriceSeries.$$p[6]:
            case FinancialPriceSeries.$$p[7]:
            case FinancialPriceSeries.$$p[1]:
            case FinancialPriceSeries.$$p[2]:
            case FinancialPriceSeries.$$p[9]:
            case FinancialPriceSeries.$$p[10]:
                this.ql();
                break;
            case FinancialSeries.$$p[14]:
                this.abc.ct();
                if (this.dc != null) {
                    this.dc.o0();
                }
                break;
            case "TrendLineType":
                var e = EnumUtil.getEnumValue(TrendLineType_$type, d);
                if (e != 0) {
                    this.abc.cl = CategoryTrendLineManagerFactory.a(this.abc.cl, this.xg, this.s3, this, this.ds);
                }
                break;
        }
        _super.prototype.rg.call(this, a, b, c, d);
        if (this.abc.cn && this.abc.cl != null && this.abc.cl.g$e(a, b, c, d)) {
            this.ry(false);
            this.qr();
        }
        switch (b) {
            case FinancialPriceSeries.$$p[3]:
                if (this.s3 != null) {
                    this.acb();
                    this.sq();
                    this.xi.z();
                    this.aao(this.xi, this.abc);
                }
                this.qr();
                break;
            case "ActualHighlightingMode":
            case "ActualSelectionMode":
            case "ActualFocusMode":
                this.ry(true);
                break;
            case "TrendLineBrush":
                this.rm(b);
                break;
            case "TrendLineType":
                this.qr();
                break;
            case FinancialSeries.$$p[10]:
            case FinancialPriceSeries.$$p[8]:
                this.q9();
                break;
        }
    };
    FinancialPriceSeries.prototype.acb = function () {
        this.abc.cx();
        if (this.cv != null) {
            this.cv.cx();
        }
    };
    FinancialPriceSeries.prototype.ay = function (a) {
        if (a != null && a == this.xz && this.yb != null && !isNaN_(this.yb.minimum) && this.ya != null && !isNaN_(this.ya.maximum)) {
            return new AxisRange(this.yb.minimum, this.ya.maximum);
        }
        return null;
    };
    FinancialPriceSeries.prototype.az = function (a) {
        if (a.isEmpty && this.dc != null) {
            a = this.dc.xm;
        }
        if (this.yb == null || this.ya == null) {
            return null;
        }
        var b = this.wt(this.cw);
        var c = new ScalerParams(0, a, this.dc.x4, this.xg.df, this.getEffectiveViewport());
        var d = (this.xg.fw(b.left, c));
        var e = (this.xg.fw(b.right, c));
        if (this.xg.df) {
            var f = d;
            d = e;
            e = f;
        }
        var g = null;
        if (this.xg.dm) {
            g = this.xg;
            d = g.i$f(d);
            e = g.i$f(e);
        }
        else {
            d = Math.floor(d);
            e = Math.ceil(e);
        }
        d = Math.max(0, Math.min(this.yb.count - 1, d));
        e = Math.max(0, Math.min(this.yb.count - 1, e));
        var h = 1.7976931348623157E+308;
        var i = -1.7976931348623157E+308;
        for (var j = truncate(d); j <= truncate(e); j++) {
            var k = j;
            if (g != null) {
                k = g.i$b._inner[j];
            }
            var l = this.yb.item(k);
            if (this.yb.mayContainUnknowns) {
                if (isInfinity(l) || isNaN_(l)) {
                    continue;
                }
            }
            var m = this.ya.item(k);
            if (this.ya.mayContainUnknowns) {
                if (isInfinity(m) || isNaN_(m)) {
                    continue;
                }
            }
            h = Math.min(h, l);
            i = Math.max(i, m);
        }
        var n = new AxisRange(h, i);
        n = this.ax(n, this.xz, a);
        return n;
    };
    FinancialPriceSeries.prototype.i0 = function () {
        return Series.i1(this.yc, typeCast(ISortingAxis_$type, this.xg));
    };
    FinancialPriceSeries.prototype.ge = function (a) {
        var b = this.dp != null ? this.dp.indexOf(a) : -1;
        var c = this.cw.ca;
        c = c.copy();
        var d = this.cw.b9;
        var e = new Rect(0, 0, 0, 1, 1);
        var f = this.wv(this.cw);
        if (b >= 0 && Rect.l_op_Inequality(c, null) && Rect.l_op_Inequality(d, null)) {
            if (this.xg != null) {
                var g = new ScalerParams(0, e, e, this.xg.df, f);
                var h = this.xg.ft(b, g);
                if (h < c.left + 0.1 * c.width) {
                    h = h + 0.4 * c.width;
                }
                if (h > c.right - 0.1 * c.width) {
                    h = h - 0.4 * c.width;
                }
                c.x = h - 0.5 * c.width;
            }
            if (this.xz != null && this.yb != null && this.ya != null && b < this.yb.count && b < this.ya.count) {
                var i = new ScalerParams(0, e, e, this.xz.df, f);
                i.b = this.i0();
                var j = this.xz.ft(this.yb.item(b), i);
                var k = this.xz.ft(this.ya.item(b), i);
                if (!isNaN_(j) && !isNaN_(k)) {
                    var l = Math.abs(j - k);
                    if (c.height < l) {
                        c.height = l;
                        c.y = Math.min(j, k);
                    }
                    else {
                        if (j < c.top + 0.1 * c.height) {
                            j = j + 0.4 * c.height;
                        }
                        if (j > c.bottom - 0.1 * c.height) {
                            j = j - 0.4 * c.height;
                        }
                        c.y = j - 0.5 * c.height;
                    }
                }
            }
            this.c4.au(this.dc, c, true);
        }
        return b >= 0;
    };
    FinancialPriceSeries.prototype.hf = function (a, b, c) {
        var d = _super.prototype.hf.call(this, a, b, c);
        if (this.yc == null || this.x9 == null || this.ya == null || this.yb == null) {
            d = false;
        }
        return d;
    };
    FinancialPriceSeries.prototype.aam = function (a, b) {
        var e_2, _a, e_3, _b;
        var _this = this;
        _super.prototype.aam.call(this, a, b);
        var c = b.ca;
        var d = b.b9;
        var e = this.getEffectiveViewport1(b);
        var f = this.xg;
        var g = this.xz;
        var h = new ScalerParams(0, c, d, f.df, e);
        var i = ((function () {
            var $ret = new ScalerParams(0, c, d, g.df, e);
            $ret.b = _this.i0();
            return $ret;
        })());
        var j = this.xg.ag();
        var k = j[0];
        var l = j[1];
        a.h.clear();
        if (a.o != null) {
            a.o.clear();
        }
        a.p.clear();
        a.s.clear();
        var m = 0;
        var n = typeCast(ISortingAxis_$type, this.xg);
        if (n != null && (n.i$b == null || n.i$b.count != this.dp.count)) {
            return;
        }
        m = this.y7(c, d, e);
        var o = typeCast(FinancialPriceSeriesView.$, b);
        var p = this.ie;
        var q = b.cd.b;
        if (this.trendLineType != 0) {
            var r = new Array(this.dp.count);
            var s = 0;
            try {
                for (var _c = __values(fromEnum(this.yy)), _d = _c.next(); !_d.done; _d = _c.next()) {
                    var t = _d.value;
                    r[s] = t;
                    s++;
                }
            }
            catch (e_2_1) {
                e_2 = { error: e_2_1 };
            }
            finally {
                try {
                    if (_d && !_d.done && (_a = _c.return))
                        _a.call(_c);
                }
                finally {
                    if (e_2)
                        throw e_2.error;
                }
            }
            if (this.abc.cn) {
                this.abc.cl.prepareLineCore(a.s, this.trendLineType, boxArray$1(r), this.trendLinePeriod, function (u) { return _this.xg.ft(u, h); }, function (u) { return _this.xz.ft(u, i); }, ((function () {
                    var $ret = new TrendResolutionParams();
                    $ret.e = b.cd.b;
                    $ret.f = b.cd.c;
                    $ret.g = b.cd.d;
                    $ret.a = m;
                    $ret.d = p;
                    $ret.i = d;
                    $ret.h = e;
                    $ret.c = k;
                    $ret.b = l;
                    return $ret;
                })()));
            }
        }
        if (b.aa.count > 0) {
            var u = new Array(this.dp.count);
            var v = 0;
            try {
                for (var _e = __values(fromEnum(this.yy)), _f = _e.next(); !_f.done; _f = _e.next()) {
                    var w = _f.value;
                    u[v] = w;
                    v++;
                }
            }
            catch (e_3_1) {
                e_3 = { error: e_3_1 };
            }
            finally {
                try {
                    if (_f && !_f.done && (_b = _e.return))
                        _b.call(_e);
                }
                finally {
                    if (e_3)
                        throw e_3.error;
                }
            }
            a.f.clear();
            for (var x = 0; x < b.aa.count; x++) {
                a.f.add(new List$1(Point_$type, 0));
                var y = b.aa._inner[x];
                y.prepareLineCore(a.f._inner[x], y.g$b, boxArray$1(u), y.g$f, function (z) { return _this.xg.ft(z, h); }, function (z) { return _this.xz.ft(z, i); }, ((function () {
                    var $ret = new TrendResolutionParams();
                    $ret.e = b.cd.b;
                    $ret.f = b.cd.c;
                    $ret.g = b.cd.d;
                    $ret.a = m;
                    $ret.d = p;
                    $ret.i = d;
                    $ret.h = e;
                    $ret.c = k;
                    $ret.b = l;
                    return $ret;
                })()));
            }
        }
        var z = this.xg.fw(2, h) - this.xg.fw(1, h);
        for (var aa = b.cd.c; aa <= b.cd.d; ++aa) {
            var ab = void 0;
            var ac = aa * q;
            if (n == null) {
                ab = b.cd.getBucket(aa);
            }
            else {
                var ad = n.i$b._inner[aa];
                ac = ad;
                var ae = n.i$d(ad);
                var af = this.yc.item(ad);
                var ag = this.ya.item(ad);
                var ah = this.yb.item(ad);
                var ai = this.x9.item(ad);
                var aj = af;
                var ak = ag;
                var al = ah;
                var am = ai;
                var an = ae;
                while (aa < b.cd.d) {
                    ad = n.i$b._inner[aa + 1];
                    an = n.i$d(ad);
                    if (an - ae > z * p) {
                        break;
                    }
                    ac = ad;
                    aa++;
                    ak = Math.max(ak, this.ya.item(ad));
                    al = Math.min(al, this.yb.item(ad));
                    am = this.x9.item(ad);
                }
                var ao = NaN;
                if (!isNaN_(ae)) {
                    ao = this.xg.ft(ae, h);
                }
                ab = [ao, aj, ak, al, am];
            }
            if (!isNaN_(ab[0])) {
                if (n != null) {
                    ab[0] = ab[0] + m;
                }
                else {
                    ab[0] = f.ft(ab[0], h) + m;
                }
                ab[1] = g.ft(ab[1], i);
                ab[2] = g.ft(ab[2], i);
                ab[3] = g.ft(ab[3], i);
                ab[4] = g.ft(ab[4], i);
                if (n != null) {
                    if (a.o == null) {
                        a.o = new List$1(Number_$type, 0);
                    }
                    a.o.add(ac);
                }
                a.h.add(ab);
            }
        }
        return;
    };
    FinancialPriceSeries.prototype.pb = function (a, b) {
        _super.prototype.pb.call(this, a, b);
        var c = typeCast(FinancialPriceSeriesView.$, b);
        c.cr();
        if (a) {
            c.cm.count = 0;
        }
        if (c.cn && c.cl != null) {
            c.cl.g$h();
        }
    };
    FinancialPriceSeries.prototype.sy = function (a, b) {
        _super.prototype.sy.call(this, a, b);
        if (this.dc != null) {
            this.dc.o0();
        }
    };
    FinancialPriceSeries.prototype.w5 = function (a, b) {
        if (this.xg != null && this.xg.categoryMode == 0) {
            var c = this.getEffectiveViewport1(this.cw);
            var d = this.abh(this.xx, c) / 2;
            return new Thickness(1, d, 0, d, 0);
        }
        return _super.prototype.w5.call(this, a, b);
    };
    FinancialPriceSeries.prototype.get_ef = function () {
        return true;
    };
    FinancialPriceSeries.prototype.aao = function (a, b) {
        _super.prototype.aao.call(this, a, b);
        if (this.xg == null || this.xz == null) {
            return;
        }
        var c = false;
        if (b.cg(a)) {
            c = true;
            b.ci(a);
        }
        this.xp.a2(this, this.yo(), runOn(this, this.w8), this.zd(b), this.zf(b));
        var d = false;
        var e = this.xp.b;
        if (e != null) {
            d = true;
        }
        var f = typeCast(FinancialPriceSeriesView.$, b);
        f.cq();
        f.co = false;
        if (f.cn) {
            f.cl.g$h();
        }
        if (this.trendLineType != 0) {
            f.cl.g$k(a.s);
        }
        if (b.aa.count > 0 && b.aa.count == a.f.count) {
            for (var g = 0; g < b.aa.count; g++) {
                var h = b.aa._inner[g];
                h.g$k(a.f._inner[g]);
            }
        }
        if (d) {
            this.ab9(a, b, c);
        }
        else {
            f.cm.count = 0;
            this.ab8(a, b);
        }
    };
    FinancialPriceSeries.prototype.iy = function () {
        var a = this.getEffectiveViewport1(this.cw);
        return this.abh(this.xx, a);
    };
    FinancialPriceSeries.prototype.ab9 = function (a, b, c) {
        var d = this.abd;
        var e = this.getEffectiveViewport1(b);
        var f = this.abh(b, e);
        var g = (f - 1) / 2;
        var h = typeCast(ISortingAxis_$type, this.xg) !== null;
        var i = typeCast(FinancialPriceSeriesView.$, b);
        i.co = true;
        var j = a.h;
        var k = 0;
        var l = this.dp.count;
        var m = this.xg;
        var n = new ScalerParams(0, b.ca, b.b9, m.df, e);
        var o = this.vj;
        var p = this.aa6;
        if (p == null) {
            p = o;
        }
        var q = this.vn;
        var r = this.acw;
        if (r == null) {
            r = q;
        }
        var _loop_1 = function (s) {
            var t = j._inner[s][0] - g;
            var u = j._inner[s][0];
            var v = j._inner[s][0] + g;
            var w = j._inner[s][1];
            var x = j._inner[s][2];
            var y = j._inner[s][3];
            var z = j._inner[s][4];
            if (isNaN_(w) || isNaN_(x) || isNaN_(y) || isNaN_(z)) {
                return "continue";
            }
            var aa = i.cm.item(k);
            k++;
            var ab = w < z;
            var ac = new PathGeometry();
            if (c) {
                switch (d) {
                    case 0:
                        if (ab) {
                            var ad = w;
                            w = z;
                            z = ad;
                        }
                        var ae = new PathFigure();
                        ae._startPoint = { $type: Point_$type, x: u, y: y };
                        ae._segments.add(((function () {
                            var $ret = new LineSegment(1);
                            $ret.c = { $type: Point_$type, x: u, y: w };
                            return $ret;
                        })()));
                        var af = new PathFigure();
                        af._startPoint = { $type: Point_$type, x: t, y: z };
                        af._segments.add(((function () {
                            var $ret = new LineSegment(1);
                            $ret.c = { $type: Point_$type, x: v, y: z };
                            return $ret;
                        })()));
                        af._segments.add(((function () {
                            var $ret = new LineSegment(1);
                            $ret.c = { $type: Point_$type, x: v, y: w };
                            return $ret;
                        })()));
                        af._segments.add(((function () {
                            var $ret = new LineSegment(1);
                            $ret.c = { $type: Point_$type, x: t, y: w };
                            return $ret;
                        })()));
                        af._segments.add(((function () {
                            var $ret = new LineSegment(1);
                            $ret.c = { $type: Point_$type, x: t, y: z };
                            return $ret;
                        })()));
                        var ag = new PathFigure();
                        ag._startPoint = { $type: Point_$type, x: u, y: z };
                        ag._segments.add(((function () {
                            var $ret = new LineSegment(1);
                            $ret.c = { $type: Point_$type, x: u, y: x };
                            return $ret;
                        })()));
                        ac.c.add(ae);
                        ac.c.add(af);
                        ac.c.add(ag);
                        break;
                    case 1:
                        var ah = new PathFigure();
                        ah._startPoint = { $type: Point_$type, x: t, y: w };
                        ah._segments.add(((function () {
                            var $ret = new LineSegment(1);
                            $ret.c = { $type: Point_$type, x: u, y: w };
                            return $ret;
                        })()));
                        var ai = new PathFigure();
                        ai._startPoint = { $type: Point_$type, x: u, y: y };
                        ai._segments.add(((function () {
                            var $ret = new LineSegment(1);
                            $ret.c = { $type: Point_$type, x: u, y: x };
                            return $ret;
                        })()));
                        var aj = new PathFigure();
                        aj._startPoint = { $type: Point_$type, x: u, y: z };
                        aj._segments.add(((function () {
                            var $ret = new LineSegment(1);
                            $ret.c = { $type: Point_$type, x: v, y: z };
                            return $ret;
                        })()));
                        ac.c.add(ah);
                        ac.c.add(ai);
                        ac.c.add(aj);
                        break;
                }
            }
            if (ab) {
                this_1.xp.ak = p;
                this_1.xp.ag = p;
                this_1.xp.ah = r;
                this_1.xp.al = r;
                this_1.xp.f = true;
            }
            else {
                this_1.xp.ak = o;
                this_1.xp.ag = o;
                this_1.xp.ah = q;
                this_1.xp.al = q;
                this_1.xp.f = false;
            }
            var ak = this_1.xp.aw(l, s)[0];
            if (h && a.o != null && s >= 0 && s < a.o.count) {
                ak = truncate(Math.round(a.o._inner[s]));
            }
            this_1.aal(j, s, l, m, n, b.t, ak);
            if (d == 1) {
                this_1.xp.ad(aa, true, false, false, false);
            }
            else {
                this_1.xp.ad(aa, false, false, false, false);
            }
            if (c) {
                aa.an = ac;
            }
        };
        var this_1 = this;
        for (var s = 0; s < j.count; ++s) {
            _loop_1(s);
        }
        i.cm.count = k;
        i.cs();
    };
    FinancialPriceSeries.prototype.abh = function (a, b) {
        var c = this.xg.ou(a.ca, a.b9, b);
        c = Math.max(c, this.ie * 0.9);
        c = Math.max(c, 3);
        return c;
    };
    FinancialPriceSeries.prototype.ab8 = function (a, b) {
        var c = this.abd;
        var d = this.getEffectiveViewport1(b);
        var e = this.abh(b, d);
        var f = (e - 1) / 2;
        var g = typeCast(FinancialPriceSeriesView.$, b);
        var h = g.c0();
        var i = g.cz();
        var j = a.h;
        var _loop_2 = function (k) {
            var l = j._inner[k][0] - f;
            var m = j._inner[k][0];
            var n = j._inner[k][0] + f;
            var o = j._inner[k][1];
            var p = j._inner[k][2];
            var q = j._inner[k][3];
            var r = j._inner[k][4];
            if (isNaN_(o) || isNaN_(p) || isNaN_(q) || isNaN_(r)) {
                return "continue";
            }
            var s = o < r;
            var t = s ? i : h;
            switch (c) {
                case 0:
                    if (s) {
                        var u = o;
                        o = r;
                        r = u;
                    }
                    t.d.add(((function () {
                        var $ret = new LineGeometry();
                        $ret.d = { $type: Point_$type, x: m, y: q };
                        $ret.c = { $type: Point_$type, x: m, y: o };
                        return $ret;
                    })()));
                    t.d.add(((function () {
                        var $ret = new RectangleGeometry();
                        $ret.e = new Rect(0, l, r, n - l, o - r);
                        return $ret;
                    })()));
                    t.d.add(((function () {
                        var $ret = new LineGeometry();
                        $ret.d = { $type: Point_$type, x: m, y: r };
                        $ret.c = { $type: Point_$type, x: m, y: p };
                        return $ret;
                    })()));
                    break;
                case 1:
                    t.d.add(((function () {
                        var $ret = new LineGeometry();
                        $ret.d = { $type: Point_$type, x: l, y: o };
                        $ret.c = { $type: Point_$type, x: m, y: o };
                        return $ret;
                    })()));
                    t.d.add(((function () {
                        var $ret = new LineGeometry();
                        $ret.d = { $type: Point_$type, x: m, y: q };
                        $ret.c = { $type: Point_$type, x: m, y: p };
                        return $ret;
                    })()));
                    t.d.add(((function () {
                        var $ret = new LineGeometry();
                        $ret.d = { $type: Point_$type, x: m, y: r };
                        $ret.c = { $type: Point_$type, x: n, y: r };
                        return $ret;
                    })()));
                    break;
            }
        };
        for (var k = 0; k < j.count; ++k) {
            _loop_2(k);
        }
    };
    FinancialPriceSeries.prototype.k1 = function (a, b) {
        if (this.abc.cn && a == this.abc.cl.g$n) {
            return null;
        }
        return _super.prototype.k1.call(this, a, b);
    };
    FinancialPriceSeries.prototype.sp = function () {
        _super.prototype.sp.call(this);
        if (this.index < 0) {
            return;
        }
        this.abc.cy();
    };
    FinancialPriceSeries.prototype.p5 = function (a) {
        _super.prototype.p5.call(this, a);
        if (this.abc.cn) {
            this.bc.exportTrendlineData(this, a, this.abc.cl.g$n);
        }
    };
    FinancialPriceSeries.prototype.v7 = function () {
        return this.acw;
    };
    FinancialPriceSeries.prototype.sb = function (a, b) {
        _super.prototype.sb.call(this, a, b);
        this.acw = b;
    };
    FinancialPriceSeries.prototype.bf = function (a) {
        if (this.abd == 0) {
            return 3;
        }
        else if (this.abd == 1) {
            if (this.be == 1) {
                return 3;
            }
            return 2;
        }
        return a;
    };
    FinancialPriceSeries.prototype.getDataLegendSeriesContextAt = function (a, b) {
        var c = { $type: Point_$type, x: a, y: b };
        var d = this.i6(c, false, false);
        var e = this.i4(c, false, false);
        var f = new DataLegendSeriesValueInfo();
        f.a = 4;
        f.l = this.y8(c, false, false);
        f.q = "Close";
        f.r = this.zk != null ? this.zk : "Close";
        f.s = this.abl != null ? this.abl : "C:";
        f.t = this.abn != null ? this.abn : "";
        var g = new DataLegendSeriesValueInfo();
        g.l = this.y9(c, false, false);
        g.a = 3;
        g.q = "Open";
        g.r = this.z6 != null ? this.z6 : "Open";
        g.s = this.abz != null ? this.abz : "O:";
        g.t = this.ab1 != null ? this.ab1 : "";
        g.k = true;
        var h = new DataLegendSeriesValueInfo();
        h.l = (f.l - g.l) / g.l * 100;
        h.l = round10N(h.l, 1);
        h.a = 9;
        h.q = "Change";
        h.r = "Change";
        h.s = "";
        h.v = "";
        h.x = "+";
        h.w = "%";
        h.y = "%";
        h.t = null;
        h.c = false;
        h.k = true;
        h.e = false;
        h.f = true;
        h.h = false;
        h.g = false;
        h.d = false;
        h.n = 1;
        h.m = 1;
        g.z = h.l >= 0 ? this.vj : this.aa6;
        f.z = h.l >= 0 ? this.vj : this.aa6;
        h.z = h.l >= 0 ? this.vj : this.aa6;
        var i = new DataLegendSeriesValueInfo();
        i.l = e > d ? d : e;
        i.a = 1;
        i.q = "Low";
        i.r = this.z2 != null ? this.z2 : "Low";
        i.s = this.abu != null ? this.abu : "L:";
        i.t = this.abw != null ? this.abw : "";
        i.k = true;
        var j = new DataLegendSeriesValueInfo();
        j.l = e > d ? e : d;
        j.a = 2;
        j.q = "High";
        j.r = this.zx != null ? this.zx : "High";
        j.s = this.abq != null ? this.abq : "H:";
        j.t = this.abs != null ? this.abs : "";
        j.k = true;
        var k = new DataLegendSeriesValueInfo();
        k.l = (j.l + i.l + f.l) / 3;
        k.l = round10N(k.l, 2);
        k.a = 5;
        k.q = "TypicalPrice";
        k.r = "TypicalPrice";
        k.s = "TP:";
        k.t = "";
        k.k = true;
        var l = new DataLegendSeriesValueInfo();
        l.l = this.za(c, false, false);
        l.a = 8;
        l.q = "Volume";
        l.r = this.aaa != null ? this.aaa : "Volume";
        l.s = "VOL:";
        l.t = "";
        l.k = true;
        l.n = 0;
        l.m = 0;
        l.e = false;
        l.f = false;
        l.h = false;
        var m = new List$1(DataLegendSeriesValueInfo.$, 0);
        m.add(g);
        m.add(j);
        m.add(i);
        m.add(f);
        m.add(k);
        m.add(h);
        m.add(l);
        var n = new DataLegendSeriesContext();
        n.h = this.mh();
        n.e = m;
        return n;
    };
    FinancialPriceSeries.prototype.aca = function () {
        if (this.abe) {
            this.abf = 0;
            for (var a = 0; a < this.ya.count; a++) {
                var b = 0;
                b += this.ya.item(a);
                b += this.yb.item(a);
                b += this.x9.item(a);
                this.abf += b / 3;
            }
            this.abg = this.abf / this.ya.count;
            this.abe = false;
        }
    };
    FinancialPriceSeries.prototype.aq = function (a) {
        var b = NaN;
        switch (a) {
            case 2:
                b = this.ya.maximum;
                break;
            case 1:
                b = this.yb.minimum;
                break;
            case 3:
                if (this.abe) {
                    this.aca();
                }
                b = this.abg;
                break;
        }
        var c = this.xz;
        if (c.dq) {
            return [NaN, b];
        }
        else {
            return [b, NaN];
        }
    };
    FinancialPriceSeries.prototype.wp = function (a) {
        var b = NaN;
        switch (a) {
            case 2:
                b = this.ya.maximum;
                break;
            case 1:
                b = this.yb.minimum;
                break;
            case 3:
                if (this.abe) {
                    this.aca();
                }
                b = this.abg;
                break;
        }
        if (isNaN_(b)) {
            return { $type: Point_$type, x: NaN, y: NaN };
        }
        var c = this.xz;
        var d = this.getEffectiveViewport1(this.cw);
        var e = new ScalerParams(0, this.cw.ca, this.cw.b9, c.df, d);
        if (c.dq) {
            e.b = this.i0();
        }
        e.c = d;
        if (c.dq) {
            return { $type: Point_$type, x: NaN, y: c.ft(b, e) };
        }
        else {
            return { $type: Point_$type, x: c.ft(b, e), y: NaN };
        }
    };
    FinancialPriceSeries.prototype.wq = function (a) {
        var b = this.xz;
        var c = this.getEffectiveViewport1(this.cw);
        var d = new ScalerParams(0, this.cw.ca, this.cw.b9, b.df, c);
        if (b.dq) {
            d.b = this.i0();
        }
        d.c = c;
        if (b.dq) {
            return { $type: Point_$type, x: NaN, y: b.ft(a[1], d) };
        }
        else {
            return { $type: Point_$type, x: b.ft(a[0], d), y: NaN };
        }
    };
    FinancialPriceSeries.prototype.ak = function (a, b) {
        var c = new List$1(ChartSelection.$, 0);
        this.qa(a, c, b);
        return c.toArray();
    };
    FinancialPriceSeries.prototype.qa = function (a, b, c) {
        var d = this.dc.x1(this.dc.xr(a));
        var e = this.xz;
        var f = this.xg;
        var g = this.dc.xu(this.w2, this.getEffectiveViewport(), d);
        var h, i;
        var j = this.ab5(d, f, true, g, h, i);
        h = j.p4;
        i = j.p5;
        if (this.abb == 0) {
            this.ab7(b, h, i, c);
        }
        else {
            var k = void 0, l = void 0;
            var m = this.ab4(d, e, true, g, k, l);
            k = m.p4;
            l = m.p5;
            this.ab6(1, b, h, i, k, l, c);
        }
    };
    FinancialPriceSeries.prototype.ab5 = function (a, b, c, d, e, f) {
        var g = new ScalerParams(0, a, this.dc.x4, this.xg.df, this.getEffectiveViewport());
        var h = (this.xg.fw(d.left, g));
        var i = (this.xg.fw(d.right, g));
        if (this.xg.df) {
            var j = h;
            h = i;
            i = j;
        }
        if (this.xg.dm) {
            var k = this.xg;
            h = k.i$f(h);
            i = k.i$f(i);
        }
        else {
            h = Math.floor(h);
            i = Math.ceil(i);
        }
        e = truncate(Math.max(0, Math.min(this.yb.count - 1, h)));
        f = truncate(Math.max(0, Math.min(this.yb.count - 1, i)));
        return {
            p4: e,
            p5: f
        };
    };
    FinancialPriceSeries.prototype.ab4 = function (a, b, c, d, e, f) {
        var g = new ScalerParams(0, a, this.dc.x4, b.df, this.getEffectiveViewport());
        var h = c ? (b.df ? d.top : d.bottom) : (b.df ? d.left : d.right);
        var i = c ? (b.df ? d.bottom : d.top) : (b.df ? d.right : d.left);
        e = b.fw(h, g);
        f = b.fw(i, g);
        return {
            p4: e,
            p5: f
        };
    };
    FinancialPriceSeries.prototype.ab3 = function (a, b, c) {
        var _this = this;
        if (c == 2 || c == 1) {
            a.add(((function () {
                var $ret = new ChartSelection();
                $ret.item = _this.dp.item(b);
                return $ret;
            })()));
        }
        else {
            a.add(((function () {
                var $ret = new ChartSelection();
                $ret.item = _this.dp.item(b);
                $ret.series = _this;
                return $ret;
            })()));
        }
    };
    FinancialPriceSeries.prototype.ab7 = function (a, b, c, d) {
        var _this = this;
        if (b == -1 || c == -1) {
            return;
        }
        if (d == 7 || d == 6) {
            a.add(((function () {
                var $ret = new ChartSelection();
                $ret.series = _this;
                return $ret;
            })()));
            return;
        }
        for (var e = b; e <= c; e++) {
            this.ab3(a, e, d);
        }
    };
    FinancialPriceSeries.prototype.ab6 = function (a, b, c, d, e, f, g) {
        var _this = this;
        if (c == -1 || d == -1) {
            return;
        }
        for (var h = c; h <= d; h++) {
            var i = Math.min(this.yc.item(h), this.yb.item(h));
            var j = Math.max(this.x9.item(h), this.ya.item(h));
            var k = Math.min(i, j);
            var l = Math.max(i, j);
            if (k < f && e < l) {
                if (g == 7 || g == 6) {
                    b.add(((function () {
                        var $ret = new ChartSelection();
                        $ret.series = _this;
                        return $ret;
                    })()));
                    return;
                }
                this.ab3(b, h, g);
            }
        }
    };
    FinancialPriceSeries.prototype.bd = function () {
        return CategoryTrendLineManagerFactory.a(null, this.xg, null, null, this.ds);
    };
    FinancialPriceSeries.$t = markType(FinancialPriceSeries, 'FinancialPriceSeries', FinancialSeries.$, [ITrendLineSeries_$type]);
    FinancialPriceSeries.acc = DependencyProperty.i("ActualTrendLineBrush", Brush.$, FinancialPriceSeries.$, new PropertyMetadata(2, null, function (a, b) { return a.raisePropertyChanged("ActualTrendLineBrush", b.oldValue, b.newValue); }));
    FinancialPriceSeries.$$p = markDep(DependencyProperty, PropertyMetadata, FinancialPriceSeries, 'raisePropertyChanged', ['CategoryCollisionMode:abb:acd', [CategoryCollisionMode_$type, enumGetBox(CategoryCollisionMode_$type, 0)], 'CloseMemberAsLegendLabel:abl:ace', [2, null], 'CloseMemberAsLegendUnit:abn:acf', [2, null], 'DisplayType:abd:acg', [PriceDisplayType_$type, enumGetBox(PriceDisplayType_$type, 0)], 'HighMemberAsLegendLabel:abq:ach', [2, null], 'HighMemberAsLegendUnit:abs:aci', [2, null], 'LowMemberAsLegendLabel:abu:acj', [2, null], 'LowMemberAsLegendUnit:abw:ack', [2, null], 'NegativeOutline:acw:acl', [Brush.$, null], 'OpenMemberAsLegendLabel:abz:acm', [2, null], 'OpenMemberAsLegendUnit:ab1:acn', [2, null], 'TrendLineType::act', [TrendLineType_$type, enumGetBox(TrendLineType_$type, 0)], 'TrendLineThickness::acs', [1, 1.5], 'TrendLinePeriod::acr', [1, 7], 'TrendLineBrush::aco', [Brush.$, null], 'TrendLineZIndex:abj:acu', [1, 1001], 'TrendLineDashArray:acx:acp', [DoubleCollection.$], 'TrendLineDashCap:acy:acq', [PenLineCap_$type, enumGetBox(PenLineCap_$type, 0)]]);
    return FinancialPriceSeries;
}(FinancialSeries));
export { FinancialPriceSeries };
/**
 * @hidden
 */
var FinancialPriceSeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FinancialPriceSeriesView, _super);
    function FinancialPriceSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.cj = null;
        _this.cm = null;
        _this.cp = null;
        _this.c3 = ((function () {
            var $ret = new Path();
            $ret.an = new GeometryGroup();
            return $ret;
        })());
        _this.c2 = ((function () {
            var $ret = new Path();
            $ret.an = new GeometryGroup();
            return $ret;
        })());
        _this.ck = null;
        _this.c1 = new Path();
        _this.co = false;
        _this.cj = a;
        _this.cp = new List$1(Path.$, 0);
        _this.cm = ((function () {
            var $ret = new Pool$1(Path.$);
            $ret.create = runOn(_this, _this.c4);
            $ret.activate = runOn(_this, _this.cu);
            $ret.disactivate = runOn(_this, _this.cw);
            $ret.destroy = runOn(_this, _this.cv);
            return $ret;
        })());
        return _this;
    }
    FinancialPriceSeriesView.prototype.c4 = function () {
        var a = new Path();
        this.cp.add(a);
        a._visibility = 1;
        return a;
    };
    FinancialPriceSeriesView.prototype.cu = function (a) {
        a._visibility = 0;
    };
    FinancialPriceSeriesView.prototype.cw = function (a) {
        a._visibility = 1;
    };
    FinancialPriceSeriesView.prototype.cv = function (a) {
        this.cp.remove(a);
    };
    FinancialPriceSeriesView.prototype.ce = function () {
        return new FinancialPriceBucketCalculator(this);
    };
    FinancialPriceSeriesView.prototype.a4 = function () {
        _super.prototype.a4.call(this);
        if (!this.t) {
            this.cj.abd = Defaults.g;
            this.cj.aa6 = Defaults.financialSeries_NegativeBrush;
            this.cj.acw = Defaults.financialSeries_NegativeOutline;
            this.cj.jt = Defaults.financialSeries_Thickness;
            this.cj.v5 = this.cj.vn;
        }
    };
    Object.defineProperty(FinancialPriceSeriesView.prototype, "cl", {
        get: function () {
            if (this.ck == null) {
                this.ck = CategoryTrendLineManagerFactory.a(this.ck, this.f.a0(), this.f.s3, this.f, this.f.ds);
            }
            return this.ck;
        },
        set: function (a) {
            this.ck = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialPriceSeriesView.prototype, "cn", {
        get: function () {
            return this.ck != null;
        },
        enumerable: false,
        configurable: true
    });
    FinancialPriceSeriesView.prototype.cx = function () {
        if (this.cj.abd == 1) {
            this.c3._stroke = this.f.vj;
        }
        else {
            this.c3._stroke = this.f.vn;
        }
        if (this.cj.abd == 1) {
            this.c2._stroke = this.cf.aa6;
        }
        else {
            this.c2._stroke = this.cj.acw;
        }
    };
    FinancialPriceSeriesView.prototype.cr = function () {
        this.a2();
        this.cm.count = 0;
        this.cq();
    };
    FinancialPriceSeriesView.prototype.cq = function () {
        var a = typeCast(GeometryGroup.$, this.c3.an);
        var b = typeCast(GeometryGroup.$, this.c2.an);
        Extensions.d(a);
        Extensions.d(b);
    };
    FinancialPriceSeriesView.prototype.c0 = function () {
        this.a2();
        return typeCast(GeometryGroup.$, this.c3.an);
    };
    FinancialPriceSeriesView.prototype.cz = function () {
        this.a2();
        return typeCast(GeometryGroup.$, this.c2.an);
    };
    FinancialPriceSeriesView.prototype.cy = function () {
        this.cj.acv = null;
        if (this.cj.trendLineBrush != null) {
            this.cj.acv = this.cj.trendLineBrush;
        }
        else {
            this.cj.acv = this.cj.vj;
        }
    };
    FinancialPriceSeriesView.prototype.bp = function () {
        _super.prototype.bp.call(this);
        this.c3.ad = this.f.ig;
        this.c3.ai = this.f.wc;
        this.c3.aj = this.f.wd;
        if (this.cj.abd == 1) {
            this.c3._stroke = this.f.vj;
        }
        else {
            this.c3._stroke = this.f.vn;
            this.c3._fill = this.f.vj;
        }
        this.c2.ad = this.f.ig;
        this.c2.ai = this.f.wc;
        this.c2.aj = this.f.wd;
        if (this.cj.abd == 1) {
            this.c2._stroke = this.cf.aa6;
        }
        else {
            this.c2._stroke = this.cj.acw;
            this.c2._fill = this.cf.aa6;
        }
    };
    FinancialPriceSeriesView.prototype.bq = function () {
        _super.prototype.bq.call(this);
        var a = this.b3();
        this.c3.ad = this.f.ig + 3;
        if (this.cj.abd == 1) {
            this.c3._stroke = a;
        }
        else {
            this.c3._stroke = a;
            this.c3._fill = a;
        }
        this.c2.ad = this.f.ig + 3;
        if (this.cj.abd == 1) {
            this.c2._stroke = a;
        }
        else {
            this.c2._stroke = a;
            this.c2._fill = a;
        }
    };
    FinancialPriceSeriesView.prototype.ak = function (a) {
        return this.cp._inner[a];
    };
    FinancialPriceSeriesView.prototype.aj = function (a) {
        var b = this.cp._inner[a];
        this.c1._visibility = b._visibility;
        this.c1.an = b.an;
        var c = this.b4(a);
        this.c1._fill = c;
        this.c1._stroke = c;
        this.c1.ad = this.f.ig + 3;
        return this.c1;
    };
    FinancialPriceSeriesView.prototype.bj = function (a, b) {
        _super.prototype.bj.call(this, a, b);
        if (a.d) {
            if (this.co) {
                for (var c = 0; c < this.cp.count; c++) {
                    var d = this.ai(c, b);
                    if (d._visibility == 0) {
                        a.t(d);
                    }
                }
            }
            else {
                a.t(this.c3);
                a.t(this.c2);
            }
        }
    };
    FinancialPriceSeriesView.prototype.bi = function (a, b) {
        if (a.d) {
            if (this.cj.trendLineType != 0 && !b) {
                var c = this.cl.g$n;
                c.ad = this.cj.trendLineThickness;
                c._stroke = this.cj.acv;
                c.ai = this.cj.acx;
                c.aj = this.cj.acy;
                a.v(c);
            }
        }
        _super.prototype.bi.call(this, a, b);
    };
    FinancialPriceSeriesView.prototype.ax = function (a) {
        _super.prototype.ax.call(this, a);
        if (this.cj.yo()) {
            for (var b = 0; b < this.cp.count; b++) {
                var c = this.cp._inner[b];
                if (c._fill == this.cj.aa6) {
                    this.f.bc.exportPathData(a, c, "negativePathShape" + b, ["Negative"]);
                }
                else {
                    this.f.bc.exportPathData(a, c, "positivePathShape" + b, ["Positive", "Main"]);
                }
            }
        }
        else {
            this.f.bc.exportPathData(a, this.c3, "positivePathShape", ["Positive", "Main"]);
            this.f.bc.exportPathData(a, this.c2, "negativePathShape", ["Negative"]);
        }
    };
    FinancialPriceSeriesView.prototype.cs = function () {
        this.a2();
    };
    FinancialPriceSeriesView.prototype.ct = function () {
        if (this.cn) {
            this.ck = CategoryTrendLineManagerFactory.a(this.ck, this.f.a0(), this.f.s3, this.f, this.f.ds);
        }
    };
    FinancialPriceSeriesView.$t = markType(FinancialPriceSeriesView, 'FinancialPriceSeriesView', FinancialSeriesView.$);
    return FinancialPriceSeriesView;
}(FinancialSeriesView));
export { FinancialPriceSeriesView };
