/*
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 { INotifyPropertyChanged_$type, PropertyChangedEventArgs, Base, fromEnum, String_$type, runOn, delegateCombine, EnumUtil, typeCast, delegateRemove, enumGetBox, markType, getInstanceType } from "igniteui-react-core/ES5/type";
import { ArrayExtension } from "igniteui-react-core/ES5/ArrayExtension";
import { List$1 } from "igniteui-react-core/ES5/List$1";
import { Brush } from "igniteui-react-core/ES5/Brush";
import { XamDataChart } from "./XamDataChart";
import { DataSeriesType_$type } from "igniteui-react-core/ES5/DataSeriesType";
import { MarkerType_$type } from "./MarkerType";
import { Color } from "igniteui-react-core/ES5/Color";
import { ColorUtil } from "igniteui-react-core/ES5/ColorUtil";
import { Rect } from "igniteui-react-core/ES5/Rect";
import { HorizontalAlignment_$type } from "igniteui-react-core/ES5/HorizontalAlignment";
import { UnknownValuePlotting_$type } from "igniteui-react-core/ES5/UnknownValuePlotting";
import { TrendLineType_$type } from "igniteui-react-core/ES5/TrendLineType";
import { DeviceUtils } from "igniteui-react-core/ES5/DeviceUtils";
import { DataSeriesAdapter } from "igniteui-react-core/ES5/DataSeriesAdapter";
import { ObservableCollection$1 } from "igniteui-react-core/ES5/ObservableCollection$1";
import { BrushCollectionUtil } from "igniteui-react-core/ES5/BrushCollectionUtil";
import { ChartSeriesEventArgs } from "./ChartSeriesEventArgs";
import { DomainChartSeriesPointerEventArgs } from "./DomainChartSeriesPointerEventArgs";
import { IUnknownValuePlotting_$type } from "igniteui-react-core/ES5/IUnknownValuePlotting";
import { ITrendLineSeries_$type } from "./ITrendLineSeries";
import { Random } from "igniteui-react-core/ES5/Random";
import { isNaN_ } from "igniteui-react-core/ES5/number";
import { stringIsNullOrEmpty, stringEmpty } from "igniteui-react-core/ES5/string";
var DomainChart = /** @class */ (function (_super) {
    tslib_1.__extends(DomainChart, _super);
    function DomainChart() {
        var _this = _super.call(this) || this;
        _this.cm = null;
        _this.cl = null;
        _this.a6 = null;
        _this.bh = NaN;
        _this.ck = null;
        _this.bq = 0;
        _this.br = 0;
        _this.bs = 0;
        _this.bp = 0;
        _this.bl = 0;
        _this.bn = 0;
        _this.bm = 0;
        _this.bk = 0;
        _this.f8 = null;
        _this.f9 = null;
        _this.bg = NaN;
        _this.bt = NaN;
        _this.bj = NaN;
        _this.bf = NaN;
        _this.cf = 0;
        _this.an = null;
        _this.cb = null;
        _this.a4 = false;
        _this.aa = null;
        _this.cv = null;
        _this.cx = null;
        _this.al = null;
        _this.a8 = null;
        _this.propertyChanged = null;
        _this.ce = 0;
        _this.az = false;
        _this.a5 = null;
        _this.seriesAdded = null;
        _this.seriesRemoved = null;
        _this.seriesPointerEnter = null;
        _this.seriesPointerLeave = null;
        _this.seriesPointerMove = null;
        _this.seriesPointerDown = null;
        _this.seriesPointerUp = null;
        _this.ar = false;
        _this.bc = null;
        _this.b = null;
        _this.a = null;
        _this.e = null;
        _this.h = null;
        _this.y = null;
        _this.as = true;
        _this.at = true;
        _this.gh = new Rect(0, 0, 0, 1, 1);
        _this.cw = null;
        _this.cu = null;
        _this.f5 = 1;
        _this.f4 = 1;
        _this.aj = 0;
        _this.bi = 1;
        _this.bo = 1;
        _this.ae = null;
        _this.f = null;
        _this.g = null;
        _this.cd = 400;
        _this.aq = false;
        _this.i = null;
        _this.ah = 0;
        _this.bu = 1.5;
        _this.ap = true;
        _this.cg = 7;
        _this.ez();
        _this.em();
        return _this;
    }
    DomainChart.prototype.provideContainer = function (a) {
        if (a == null) {
            this.dataChart.provideContainer(null);
            return;
        }
        this.cm = a;
        var b = ((function () {
            var $ret = new XamDataChart();
            $ret.cq = true;
            return $ret;
        })());
        b.provideContainer(a);
        this.dataChart = b;
        this.e0();
    };
    DomainChart.prototype.destroy = function () {
        this.provideContainer(null);
    };
    DomainChart.prototype.e0 = function () {
        if (this.dataChart == null) {
            return;
        }
        var a = this.dataChart.bk.i.e();
        this.j = a.a;
        this.n = a.f;
        this.l = a.b;
        this.m = a.c;
        this.o = a.g;
        this.b4 = DeviceUtils.g(1);
        this.e1();
    };
    DomainChart.prototype.e1 = function () {
    };
    DomainChart.prototype.ex = function (a) {
        if (a == null) {
            return;
        }
        a.eq = this.b8;
        a.eo = this.b6;
        a.ep = this.b7;
        a.en = this.b5;
        a.ma = this.gf;
        a.ek = this.b1;
        a.em = this.b3;
        a.el = this.b2;
        a.ej = this.b0;
        a.l9 = this.ge;
        if (!isNaN_(this.bx)) {
            a.eh = this.bx;
        }
    };
    DomainChart.prototype.eu = function () {
    };
    DomainChart.prototype.e3 = function (a, b) {
        a.fc = this.ci;
        a.bu = this.ao;
    };
    DomainChart.prototype.fk = function (a, b, c) {
        var _this = this;
        switch (a) {
            case "TitleTopMargin":
                if (this.dataChart != null) {
                    this.dataChart.eq = this.b8;
                }
                break;
            case "TitleLeftMargin":
                if (this.dataChart != null) {
                    this.dataChart.eo = this.b6;
                }
                break;
            case "PixelScalingRatio":
                if (this.dataChart != null) {
                    this.fe(function (d) { return d.eh = _this.bx; });
                }
                break;
            case "TitleRightMargin":
                if (this.dataChart != null) {
                    this.dataChart.ep = this.b7;
                }
                break;
            case "TitleBottomMargin":
                if (this.dataChart != null) {
                    this.dataChart.en = this.b5;
                }
                break;
            case "TitleTextColor":
                if (this.dataChart != null) {
                    this.dataChart.ma = this.gf;
                }
                break;
            case "SubtitleLeftMargin":
                if (this.dataChart != null) {
                    this.dataChart.ek = this.b1;
                }
                break;
            case "SubtitleTopMargin":
                if (this.dataChart != null) {
                    this.dataChart.em = this.b3;
                }
                break;
            case "SubtitleRightMargin":
                if (this.dataChart != null) {
                    this.dataChart.el = this.b2;
                }
                break;
            case "SubtitleBottomMargin":
                if (this.dataChart != null) {
                    this.dataChart.ej = this.b0;
                }
                break;
            case "SubtitleTextColor":
                if (this.dataChart != null) {
                    this.dataChart.l9 = this.ge;
                }
                break;
            case "LeftMargin":
                if (this.dataChart != null) {
                    this.dataChart.eg = this.bw;
                }
                break;
            case "TopMargin":
                if (this.dataChart != null) {
                    this.dataChart.er = this.b9;
                }
                break;
            case "RightMargin":
                if (this.dataChart != null) {
                    this.dataChart.ei = this.bz;
                }
                break;
            case "BottomMargin":
                if (this.dataChart != null) {
                    this.dataChart.ec = this.bv;
                }
                break;
            case "TransitionDuration":
                this.eq(function (d) { return d.fc = _this.ci; });
                break;
            case "TransitionEasingFunction":
                this.eq(function (d) { return d.bu = _this.ao; });
                break;
        }
    };
    Object.defineProperty(DomainChart.prototype, "tooltipTemplate", {
        get: function () {
            return ArrayExtension.getModulus$1(Base.$, this.tooltipTemplates, 0);
        },
        set: function (a) {
            this.tooltipTemplates = a == null ? null : new List$1(Base.$, 1, [a]);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "tooltipTemplates", {
        get: function () {
            return this.a6;
        },
        set: function (a) {
            var b = this.tooltipTemplates;
            if (a != b) {
                this.a6 = a;
                this.fj("TooltipTemplates", b, this.tooltipTemplates);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "bx", {
        get: function () {
            return this.bh;
        },
        set: function (a) {
            var b = this.bh;
            if (a != b) {
                this.bh = a;
                this.fj("PixelScalingRatio", b, this.bx);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "toolTip", {
        get: function () {
            return this.ck;
        },
        set: function (a) {
            var b = this.toolTip;
            if (b != a) {
                this.ck = a;
                this.fj("ToolTip", b, this.toolTip);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "b6", {
        get: function () {
            return this.bq;
        },
        set: function (a) {
            var b = this.b6;
            if (a != b) {
                this.bq = a;
                this.fj("TitleLeftMargin", b, this.b6);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "b7", {
        get: function () {
            return this.br;
        },
        set: function (a) {
            var b = this.b7;
            if (a != b) {
                this.br = a;
                this.fj("TitleRightMargin", b, this.b7);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "b8", {
        get: function () {
            return this.bs;
        },
        set: function (a) {
            var b = this.b8;
            if (a != b) {
                this.bs = a;
                this.fj("TitleTopMargin", b, this.b8);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "b5", {
        get: function () {
            return this.bp;
        },
        set: function (a) {
            var b = this.b5;
            if (a != b) {
                this.bp = a;
                this.fj("TitleBottomMargin", b, this.b5);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "b1", {
        get: function () {
            return this.bl;
        },
        set: function (a) {
            var b = this.b1;
            if (a != b) {
                this.bl = a;
                this.fj("SubtitleLeftMargin", b, this.b1);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "b3", {
        get: function () {
            return this.bn;
        },
        set: function (a) {
            var b = this.b3;
            if (a != b) {
                this.bn = a;
                this.fj("SubtitleTopMargin", b, this.b3);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "b2", {
        get: function () {
            return this.bm;
        },
        set: function (a) {
            var b = this.b2;
            if (a != b) {
                this.bm = a;
                this.fj("SubtitleRightMargin", b, this.b2);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "b0", {
        get: function () {
            return this.bk;
        },
        set: function (a) {
            var b = this.b0;
            if (a != b) {
                this.bk = a;
                this.fj("SubtitleBottomMargin", b, this.b0);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "ge", {
        get: function () {
            return this.f8;
        },
        set: function (a) {
            var b = this.ge;
            if (a != b) {
                this.f8 = a;
                this.fj("SubtitleTextColor", b, this.ge);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "gf", {
        get: function () {
            return this.f9;
        },
        set: function (a) {
            var b = this.gf;
            if (a != b) {
                this.f9 = a;
                this.fj("TitleTextColor", b, this.gf);
            }
        },
        enumerable: true,
        configurable: true
    });
    DomainChart.prototype.get_bw = function () {
        return this.bg;
    };
    DomainChart.prototype.set_bw = function (a) {
        var b = this.bw;
        if (a != b) {
            this.bg = a;
            this.fj("LeftMargin", b, this.bw);
        }
    };
    Object.defineProperty(DomainChart.prototype, "bw", {
        get: function () {
            return this.get_bw();
        },
        set: function (a) {
            this.set_bw(a);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "b9", {
        get: function () {
            return this.bt;
        },
        set: function (a) {
            var b = this.b9;
            if (a != b) {
                this.bt = a;
                this.fj("TopMargin", b, this.b9);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "bz", {
        get: function () {
            return this.bj;
        },
        set: function (a) {
            var b = this.bz;
            if (a != b) {
                this.bj = a;
                this.fj("RightMargin", b, this.bz);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "bv", {
        get: function () {
            return this.bf;
        },
        set: function (a) {
            var b = this.bv;
            if (a != b) {
                this.bf = a;
                this.fj("BottomMargin", b, this.bv);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "ci", {
        get: function () {
            return this.cf;
        },
        set: function (a) {
            var b = this.ci;
            if (a != b) {
                this.cf = a;
                this.fj("TransitionDuration", b, this.ci);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "ao", {
        get: function () {
            return this.an;
        },
        set: function (a) {
            var b = this.ao;
            if (a != b) {
                this.an = a;
                this.fj("TransitionEasingFunction", b, this.ao);
            }
        },
        enumerable: true,
        configurable: true
    });
    DomainChart.prototype.ey = function (a) {
        if (this.dataChart == null) {
            return;
        }
        a.gt = this.d4;
        a.gh = this.dt;
    };
    DomainChart.prototype.e4 = function (a, b) {
        this.e5(a, b);
    };
    DomainChart.prototype.ev = function () {
    };
    DomainChart.prototype.e5 = function (a, b) {
        if (a == null) {
            return;
        }
        var toolTipTemplate_ = ArrayExtension.getModulus$1(Base.$, this.tooltipTemplates, b);
        if (toolTipTemplate_ == null) {
            a.da = true;
        }
        else {
            var series_ = a;
            a.da = false;
            series_.externalObject.tooltipTemplate = toolTipTemplate_;
        }
    };
    DomainChart.prototype.f3 = function (a, b, c) {
    };
    DomainChart.prototype.co = function (a) {
        return a;
        return null;
    };
    DomainChart.prototype.cc = function (a) {
        return null;
    };
    DomainChart.prototype.fl = function (a, b, c) {
        var _this = this;
        switch (a) {
            case "SubtitleTextStyle":
                if (this.dataChart != null) {
                    this.dataChart.gh = this.dt;
                }
                break;
            case "TitleTextStyle":
                if (this.dataChart != null) {
                    this.dataChart.gt = this.d4;
                }
                break;
            case "TooltipTemplate":
                if (this.a4) {
                    return;
                }
                this.a4 = true;
                this.tooltipTemplate = this.co(this.tooltipTemplate);
                this.a4 = false;
                if (this.dataChart != null) {
                    this.dataChart.e5 = this.tooltipTemplate;
                }
                this.toolTip = this.tooltipTemplate;
                break;
            case "ToolTip":
                this.er(function (d, e) { return _this.e5(d, e); });
                break;
            case "TooltipTemplates":
                if (this.tooltipTemplates == null) {
                    break;
                }
                this.a4 = true;
                this.er(function (d, e) {
                    var f = _this.co(ArrayExtension.getModulus$1(Base.$, _this.tooltipTemplates, e));
                    var series_ = d;
                    var templ_ = f;
                    series_.externalObject.tooltipTemplate = templ_;
                });
                this.a4 = false;
                break;
        }
    };
    Object.defineProperty(DomainChart.prototype, "ab", {
        get: function () {
            return this.aa;
        },
        set: function (a) {
            var b = this.ab;
            if (a != b) {
                this.aa = a;
                this.fj("Widget", b, this.ab);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "dt", {
        get: function () {
            return this.cv;
        },
        set: function (a) {
            var b = this.dt;
            if (a != b) {
                this.cv = a;
                this.fj("SubtitleTextStyle", b, this.dt);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "d4", {
        get: function () {
            return this.cx;
        },
        set: function (a) {
            var b = this.d4;
            if (a != b) {
                this.cx = a;
                this.fj("TitleTextStyle", b, this.d4);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "dataChart", {
        get: function () {
            return this.al;
        },
        set: function (a) {
            var b = this.dataChart;
            if (b != a) {
                this.al = a;
                this.fj("DataChart", b, this.dataChart);
            }
        },
        enumerable: true,
        configurable: true
    });
    DomainChart.prototype.ez = function () {
        this.a8 = new List$1(MarkerType_$type, 0);
        this.s = new DataSeriesAdapter().e;
        if (this.d != null) {
            this.s.includedProperties = this.d;
        }
        if (this.c != null) {
            this.s.excludedProperties = this.c;
        }
        this.s.supportedSeriesTypes = this.ba.toArray();
        this.s.rules.clear();
        try {
            for (var _a = tslib_1.__values(fromEnum(this.a9)), _b = _a.next(); !_b.done; _b = _a.next()) {
                var a = _b.value;
                this.s.rules.add(a);
            }
        }
        catch (e_1_1) { e_1 = { error: e_1_1 }; }
        finally {
            try {
                if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
            }
            finally { if (e_1) throw e_1.error; }
        }
        var b = new List$1(String_$type, 0);
        try {
            for (var _d = tslib_1.__values(fromEnum(this.s.rules)), _e = _d.next(); !_e.done; _e = _d.next()) {
                var c = _e.value;
                b.add(getInstanceType(c).typeName);
            }
        }
        catch (e_2_1) { e_2 = { error: e_2_1 }; }
        finally {
            try {
                if (_e && !_e.done && (_f = _d.return)) _f.call(_d);
            }
            finally { if (e_2) throw e_2.error; }
        }
        var d = this.s.dataSeries;
        d.collectionChanged = delegateCombine(d.collectionChanged, runOn(this, this.fh));
        var e_1, _c, e_2, _f;
    };
    DomainChart.prototype.a0 = function (a) {
        return a != 24 && this.ba.contains(a);
    };
    DomainChart.prototype.notifyResized = function () {
        this.fe(function (a) { return a.notifyContainerResized(); });
    };
    DomainChart.prototype.fd = function () {
        this.fe(function (a) {
            for (var b = 0; b < a.series.count; b++) {
                a.series._inner[b].ia();
            }
        });
    };
    DomainChart.prototype.ep = function () {
        if (this.dataChart == null) {
            return;
        }
        if (this.az) {
            this.fz();
        }
        this.dataChart.flush();
    };
    DomainChart.prototype.es = function () {
        if (this.dataChart == null) {
            return;
        }
        this.dataChart.hk();
    };
    DomainChart.prototype.fo = function (a) {
        if (this.propertyChanged != null) {
            this.propertyChanged(this, new PropertyChangedEventArgs(a));
        }
    };
    DomainChart.prototype.eq = function (a) {
        this.er(function (b, c) { return a(b); });
    };
    DomainChart.prototype.er = function (a) {
        if (this.dataChart == null) {
            return;
        }
        for (var b = 0; b < this.dataChart.series.count; b++) {
            a(this.dataChart.series._inner[b], b);
        }
    };
    DomainChart.prototype.fe = function (a) {
        this.ff(a, true);
    };
    DomainChart.prototype.ff = function (a, b) {
        this.fg(a, b, null);
    };
    DomainChart.prototype.fg = function (a, b, c) {
        if (this.dataChart == null) {
            return;
        }
        a(this.dataChart);
    };
    DomainChart.prototype.a1 = function (a) {
        if (!this.a0(a.suggestedSeries)) {
            return false;
        }
        var b = a.data;
        if (b == null) {
            return false;
        }
        return true;
    };
    DomainChart.prototype.ax = function () {
        if (this.dataChart == null) {
            return false;
        }
        return true;
    };
    DomainChart.prototype.c5 = function (a) {
        var b = "series_" + (this.dataChart.series.count + 1) + "_" + EnumUtil.getName(DataSeriesType_$type, a.suggestedSeries);
        return b;
    };
    DomainChart.prototype.c6 = function (a, b) {
        if (stringIsNullOrEmpty(a.title)) {
            var c = EnumUtil.getName(DataSeriesType_$type, b);
            return c + (this.dataChart.series.count + 1);
        }
        else {
            return a.title;
        }
    };
    DomainChart.prototype.c4 = function () {
        return stringEmpty();
    };
    DomainChart.prototype.fz = function () {
        if (this.dataChart == null) {
            return;
        }
        this.az = false;
        this.f1();
        if (this.itemsSource == null) {
            return;
        }
        var a = new List$1(MarkerType_$type, 0);
        try {
            for (var _a = tslib_1.__values(fromEnum(this.s.dataSeries)), _b = _a.next(); !_b.done; _b = _a.next()) {
                var b = _b.value;
                a.add(this.ac(b.suggestedMarker));
            }
        }
        catch (e_3_1) { e_3 = { error: e_3_1 }; }
        finally {
            try {
                if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
            }
            finally { if (e_3) throw e_3.error; }
        }
        this.a8 = a;
        var c = 0;
        try {
            for (var _d = tslib_1.__values(fromEnum(this.s.dataSeries)), _e = _d.next(); !_e.done; _e = _d.next()) {
                var d = _e.value;
                if (!this.a1(d)) {
                    continue;
                }
                if (d.index < 0) {
                    d.index = c;
                }
                this.fx(d);
                this.fy(d);
                c++;
            }
        }
        catch (e_4_1) { e_4 = { error: e_4_1 }; }
        finally {
            try {
                if (_e && !_e.done && (_f = _d.return)) _f.call(_d);
            }
            finally { if (e_4) throw e_4.error; }
        }
        this.er(runOn(this, this.e2));
        var e_3, _c, e_4, _f;
    };
    DomainChart.prototype.f1 = function () {
        this.f0();
        if (this.dataChart.series.count == 0) {
            return;
        }
        this.eq(runOn(this, this.fv));
        try {
            for (var _a = tslib_1.__values(fromEnum(this.dataChart.series)), _b = _a.next(); !_b.done; _b = _a.next()) {
                var a = _b.value;
                a.itemsSource = null;
                a.ay = null;
                this.f2(a);
            }
        }
        catch (e_5_1) { e_5 = { error: e_5_1 }; }
        finally {
            try {
                if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
            }
            finally { if (e_5) throw e_5.error; }
        }
        this.dataChart.series.clear();
        var e_5, _c;
    };
    DomainChart.prototype.f2 = function (a) {
        a.itemsSource = null;
        a.ay = null;
    };
    DomainChart.prototype.fh = function (a, b) {
        if (this.dataChart == null) {
            return;
        }
        var c = b.oldItems == null ? "null" : b.oldItems.count.toString();
        var d = b.newItems == null ? "null" : b.newItems.count.toString();
        if (this.az) {
            return;
        }
        var e = this.fn(runOn(this, this.fz), this.az);
        this.az = e.p1;
    };
    DomainChart.prototype.ga = function (a) {
        return ArrayExtension.getModulus$1(Brush.$, this.j, a);
    };
    DomainChart.prototype.gd = function (a) {
        return ArrayExtension.getModulus$1(Brush.$, this.n, a);
    };
    DomainChart.prototype.gb = function (a) {
        return ArrayExtension.getModulus$1(Brush.$, this.l, a);
    };
    DomainChart.prototype.gc = function (a) {
        return ArrayExtension.getModulus$1(Brush.$, this.m, a);
    };
    DomainChart.prototype.gg = function (a) {
        var b = new Color();
        if (this.j == null || this.j.count == 0) {
            b = ArrayExtension.getModulus$1(Color.$, this.a7, a);
        }
        else {
            var c = ArrayExtension.getModulus$1(Brush.$, this.j, a);
            if (c == null) {
                b = ArrayExtension.getModulus$1(Color.$, this.a7, a);
            }
            else {
                b = ColorUtil.j(c);
            }
        }
        return b;
    };
    DomainChart.prototype.be = function (a) {
        var b = new ObservableCollection$1(Color.$, 0);
        b.add(ColorUtil.o(a, 0.5));
        b.add(a);
        return b;
    };
    DomainChart.prototype.k = function (a) {
        var b = this.be(a);
        var c = BrushCollectionUtil.a(b);
        return c;
    };
    Object.defineProperty(DomainChart.prototype, "a7", {
        get: function () {
            if (this.a5 != null) {
                return this.a5;
            }
            this.a5 = new List$1(Color.$, 0);
            this.a5.add(ColorUtil.k("#FF7446B9"));
            this.a5.add(ColorUtil.k("#FF9FB328"));
            this.a5.add(ColorUtil.k("#FFF96232"));
            this.a5.add(ColorUtil.k("#FF2E9CA6"));
            this.a5.add(ColorUtil.k("#FFDC3F76"));
            this.a5.add(ColorUtil.k("#FFFF9800"));
            this.a5.add(ColorUtil.k("#FF3F51B5"));
            this.a5.add(ColorUtil.k("#FF439C47"));
            this.a5.add(ColorUtil.k("#FF795548"));
            this.a5.add(ColorUtil.k("#FF494747"));
            return this.a5;
        },
        enumerable: true,
        configurable: true
    });
    DomainChart.prototype.cn = function () {
        if (this.dataChart == null) {
            return null;
        }
        return this.dataChart.n8();
    };
    DomainChart.prototype.e6 = function (a, b) {
    };
    DomainChart.prototype.e7 = function (a, b, c) {
    };
    DomainChart.prototype.ac = function (a) {
        if (a == 2) {
            return 3;
        }
        else if (a == 6) {
            return 7;
        }
        else if (a == 8) {
            return 9;
        }
        else if (a == 11) {
            return 12;
        }
        else if (a == 1) {
            return 1;
        }
        else if (a == 7) {
            return 8;
        }
        else if (a == 10) {
            return 11;
        }
        else if (a == 4) {
            return 5;
        }
        else if (a == 5) {
            return 6;
        }
        else if (a == 9) {
            return 10;
        }
        else if (a == 3) {
            return 4;
        }
        return 2;
    };
    DomainChart.prototype.fc = function (source_, a, b, c) {
        if (this.s != null) {
            this.s.notifySetItem(source_, a, b, c);
        }
        if (this.dataChart != null) {
            this.dataChart.hw(source_, a, b, c);
        }
    };
    DomainChart.prototype.e8 = function (source_) {
        if (this.s != null) {
            this.s.notifyClearItems(source_);
        }
        if (this.dataChart != null) {
            this.dataChart.hr(source_);
        }
    };
    DomainChart.prototype.e9 = function (source_, a, b) {
        if (this.s != null) {
            this.s.notifyInsertItem(source_, a, b);
        }
        if (this.dataChart != null) {
            this.dataChart.hu(source_, a, b);
        }
    };
    DomainChart.prototype.fa = function (source_, a, b) {
        if (this.s != null) {
            this.s.notifyRemoveItem(source_, a, b);
        }
        if (this.dataChart != null) {
            this.dataChart.hv(source_, a, b);
        }
    };
    DomainChart.prototype.fp = function (a) {
        if (this.seriesAdded != null && a != null) {
            this.seriesAdded(this, new ChartSeriesEventArgs(a));
        }
    };
    DomainChart.prototype.fv = function (a) {
        if (this.seriesRemoved != null && a != null) {
            this.seriesRemoved(this, new ChartSeriesEventArgs(a));
        }
    };
    DomainChart.prototype.fr = function (a, b) {
        if (this.seriesPointerEnter != null && a != null) {
            this.seriesPointerEnter(this, new DomainChartSeriesPointerEventArgs(a, b));
        }
    };
    DomainChart.prototype.fs = function (a, b) {
        if (this.seriesPointerLeave != null && a != null) {
            this.seriesPointerLeave(this, new DomainChartSeriesPointerEventArgs(a, b));
        }
    };
    DomainChart.prototype.ft = function (a, b) {
        if (this.seriesPointerMove != null && a != null) {
            this.seriesPointerMove(this, new DomainChartSeriesPointerEventArgs(a, b));
        }
    };
    DomainChart.prototype.fq = function (a, b) {
        if (this.seriesPointerDown != null && a != null) {
            this.seriesPointerDown(this, new DomainChartSeriesPointerEventArgs(a, b));
        }
    };
    DomainChart.prototype.fu = function (a, b) {
        if (this.seriesPointerUp != null && a != null) {
            this.seriesPointerUp(this, new DomainChartSeriesPointerEventArgs(a, b));
        }
    };
    DomainChart.prototype.fn = function (a, b) {
        if (!b) {
            b = true;
            if (this.cm != null) {
                this.cm.setTimeout(a, 0);
            }
            else {
                window.setTimeout(a, 0);
            }
        }
        return {
            p1: b
        };
    };
    DomainChart.prototype.get_a2 = function () {
        return true;
    };
    Object.defineProperty(DomainChart.prototype, "a2", {
        get: function () {
            return this.get_a2();
        },
        enumerable: true,
        configurable: true
    });
    DomainChart.prototype.ew = function (a) {
        var _this = this;
        var b = a == this.dataChart;
        if (b) {
            a.m3 = this.j;
        }
        if (b) {
            a.m6 = this.n;
        }
        a.m4 = this.l;
        a.m5 = this.m;
        a.ay = this.legend;
        a.nl = this.ay;
        a.nn = this.a3 && this.a2;
        a.seriesMouseEnter = delegateCombine(a.seriesMouseEnter, function (c, d) { return _this.fr(d.series, d.item); });
        a.seriesMouseLeave = delegateCombine(a.seriesMouseLeave, function (c, d) { return _this.fs(d.series, d.item); });
        a.seriesMouseMove = delegateCombine(a.seriesMouseMove, function (c, d) { return _this.ft(d.series, d.item); });
        a.seriesMouseLeftButtonDown = delegateCombine(a.seriesMouseLeftButtonDown, function (c, d) { return _this.fq(d.series, d.item); });
        a.seriesMouseLeftButtonUp = delegateCombine(a.seriesMouseLeftButtonUp, function (c, d) { return _this.fu(d.series, d.item); });
        if (b) {
            a.my = this.gj;
        }
        if (b) {
            a.gm = this.dx;
        }
        a.lt = this.f7;
        if (b) {
            a.ga = this.dl;
        }
        a.ls = this.f6;
        a.nh = this.au;
        a.ca = this.av;
        a.eg = this.bw;
        a.ei = this.bz;
        a.er = this.b9;
        a.ec = this.bv;
        if (a == this.dataChart) {
            this.fz();
        }
        this.ex(a);
        this.ey(a);
    };
    DomainChart.prototype.e2 = function (a, b) {
        if (!isNaN_(this.by)) {
            a.eo = this.by;
        }
        a.es = this.b4;
        a.ay = this.legend;
        if (typeCast(IUnknownValuePlotting_$type, a) !== null) {
            a.unknownValuePlotting = this.ak;
        }
        this.ek(a, b);
        this.el(a, b);
        this.e3(a, b);
        this.e4(a, b);
        this.fp(a);
    };
    Object.defineProperty(DomainChart.prototype, "aw", {
        get: function () {
            return this.ar;
        },
        enumerable: true,
        configurable: true
    });
    DomainChart.prototype.eo = function () {
        if (!this.ar) {
            this.ar = true;
            this.et();
        }
    };
    DomainChart.prototype.et = function () {
        this.eu();
        this.ev();
    };
    DomainChart.prototype.el = function (a, b) {
        var c = typeCast(ITrendLineSeries_$type, a);
        if (c != null) {
            c.trendLineBrush = ArrayExtension.getModulus$1(Brush.$, this.o, b);
            c.trendLineThickness = this.ca;
            c.trendLineType = this.ai;
            c.trendLinePeriod = this.cj;
        }
    };
    DomainChart.prototype.ad = function (a, b) {
        if (this.af == null || this.af.count == 0) {
            if (this.a8 == null || this.a8.count == 0) {
                return a != null && a.cx ? 1 : 2;
            }
            var c = ArrayExtension.getModulus$1(MarkerType_$type, this.a8, b);
            return c == 2 && a != null && a.cx ? 1 : c;
        }
        return ArrayExtension.getModulus$1(MarkerType_$type, this.af, b);
    };
    DomainChart.prototype.fj = function (a, b, c) {
        var _this = this;
        if (this.propertyChanged != null) {
            this.propertyChanged(this, new PropertyChangedEventArgs(a));
        }
        switch (a) {
            case "DataChart":
                this.fw(typeCast(XamDataChart.$, b));
                this.ew(typeCast(XamDataChart.$, c));
                break;
            case "ItemsSource":
                this.s.itemsSource = this.itemsSource;
                break;
            case "IncludedProperties":
                this.s.includedProperties = this.d;
                break;
            case "ExcludedProperties":
                this.s.excludedProperties = this.c;
                break;
            case "Brushes":
                this.fg(function (d) { return d.m3 = _this.j; }, true, a);
                break;
            case "Outlines":
                this.fg(function (d) { return d.m6 = _this.n; }, true, a);
                break;
            case "Legend":
                this.fe(function (d) { return d.ay = _this.legend; });
                break;
            case "IsHorizontalZoomEnabled":
                this.fe(function (d) { return d.nl = _this.ay; });
                break;
            case "IsVerticalZoomEnabled":
                this.fe(function (d) { return d.nn = _this.a3; });
                break;
            case "WindowRect":
                this.ff(function (d) { return d.my = _this.gj; }, false);
                break;
            case "Title":
                this.ff(function (d) { return d.gm = _this.dx; }, false);
                break;
            case "Subtitle":
                this.ff(function (d) { return d.ga = _this.dl; }, false);
                break;
            case "TitleAlignment":
                this.fe(function (d) { return d.lt = _this.f7; });
                break;
            case "SubtitleAlignment":
                this.fe(function (d) { return d.ls = _this.f6; });
                break;
            case "UnknownValuePlotting":
                this.eq(function (d) {
                    if (typeCast(IUnknownValuePlotting_$type, d) !== null) {
                        d.unknownValuePlotting = _this.ak;
                    }
                });
                break;
            case "Thickness":
                this.eq(function (d) { return d.es = _this.b4; });
                break;
            case "Resolution":
                if (!isNaN_(this.by)) {
                    this.eq(function (d) { return d.eo = _this.by; });
                }
                break;
            case "TrendLineBrushes":
            case "TrendLineType":
            case "TrendLineThickness":
            case "TrendLinePeriod":
                this.er(function (d, e) { return _this.el(d, e); });
                break;
            case "MarkerMaxCount":
                this.er(function (d, e) { return _this.ek(d, e); });
                break;
            case "MarkerTypes":
                var d = typeCast(ObservableCollection$1.$.specialize(MarkerType_$type), b);
                if (d != null) {
                    d.collectionChanged = delegateRemove(d.collectionChanged, runOn(this, this.fi));
                }
                var e = typeCast(ObservableCollection$1.$.specialize(MarkerType_$type), c);
                if (e != null) {
                    e.collectionChanged = delegateCombine(e.collectionChanged, runOn(this, this.fi));
                }
                this.er(function (f, g) { return _this.ek(f, g); });
                break;
            case "MarkerBrushes":
                this.fe(function (f) { return f.m4 = _this.l; });
                break;
            case "MarkerOutlines":
                this.fe(function (f) { return f.m5 = _this.m; });
                break;
            case "AlignsGridLinesToPixels":
                this.fe(function (f) { return f.nh = _this.au; });
                break;
            case "AnimateSeriesWhenAxisRangeChanges":
                this.fe(function (f) { return f.ca = _this.av; });
                break;
        }
        this.fk(a, b, c);
        this.fl(a, b, c);
    };
    DomainChart.prototype.fi = function (a, b) {
        var _this = this;
        this.er(function (c, d) { return _this.ek(c, d); });
    };
    Object.defineProperty(DomainChart.prototype, "itemsSource", {
        get: function () {
            return this.bc;
        },
        set: function (a) {
            var b = this.itemsSource;
            if (b != a) {
                this.bc = a;
                this.fj("ItemsSource", b, this.itemsSource);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "d", {
        get: function () {
            return this.b;
        },
        set: function (a) {
            var b = this.b;
            this.b = a;
            if (b != this.b) {
                this.fj("IncludedProperties", b, this.b);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "c", {
        get: function () {
            return this.a;
        },
        set: function (a) {
            var b = this.a;
            this.a = a;
            if (b != this.a) {
                this.fj("ExcludedProperties", b, this.a);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "j", {
        get: function () {
            return this.e;
        },
        set: function (a) {
            var b = this.j;
            if (a != b) {
                this.e = a;
                this.fj("Brushes", b, this.j);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "n", {
        get: function () {
            return this.h;
        },
        set: function (a) {
            var b = this.n;
            if (a != b) {
                this.h = a;
                this.fj("Outlines", b, this.n);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "legend", {
        get: function () {
            return this.y;
        },
        set: function (a) {
            var b = this.legend;
            if (a != b) {
                this.y = a;
                this.fj("Legend", b, this.legend);
            }
        },
        enumerable: true,
        configurable: true
    });
    DomainChart.prototype.get_ay = function () {
        return this.as;
    };
    DomainChart.prototype.set_ay = function (a) {
        var b = this.ay;
        if (a != b) {
            this.as = a;
            this.fj("IsHorizontalZoomEnabled", b, this.ay);
        }
    };
    Object.defineProperty(DomainChart.prototype, "ay", {
        get: function () {
            return this.get_ay();
        },
        set: function (a) {
            this.set_ay(a);
        },
        enumerable: true,
        configurable: true
    });
    DomainChart.prototype.get_a3 = function () {
        return this.at;
    };
    DomainChart.prototype.set_a3 = function (a) {
        var b = this.a3;
        if (a != b) {
            this.at = a;
            this.fj("IsVerticalZoomEnabled", b, this.a3);
        }
    };
    Object.defineProperty(DomainChart.prototype, "a3", {
        get: function () {
            return this.get_a3();
        },
        set: function (a) {
            this.set_a3(a);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "gj", {
        get: function () {
            return this.gh;
        },
        set: function (a) {
            var b = this.gj;
            if (Rect.l_op_Inequality(a, b)) {
                this.gh = a;
                this.fj("WindowRect", b, this.gj);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "gi", {
        get: function () {
            return this.dataChart != null ? this.dataChart.mx : Rect.empty;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "dx", {
        get: function () {
            return this.cw;
        },
        set: function (a) {
            var b = this.dx;
            if (a != b) {
                this.cw = a;
                this.fj("Title", b, this.dx);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "dl", {
        get: function () {
            return this.cu;
        },
        set: function (a) {
            var b = this.dl;
            if (a != b) {
                this.cu = a;
                this.fj("Subtitle", b, this.dl);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "f7", {
        get: function () {
            return this.f5;
        },
        set: function (a) {
            var b = this.f7;
            if (b != a) {
                this.f5 = a;
                this.fj("TitleAlignment", enumGetBox(HorizontalAlignment_$type, b), enumGetBox(HorizontalAlignment_$type, this.f7));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "f6", {
        get: function () {
            return this.f4;
        },
        set: function (a) {
            var b = this.f6;
            if (b != a) {
                this.f4 = a;
                this.fj("SubtitleAlignment", enumGetBox(HorizontalAlignment_$type, b), enumGetBox(HorizontalAlignment_$type, this.f6));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "ak", {
        get: function () {
            return this.aj;
        },
        set: function (a) {
            var b = this.ak;
            if (a != b) {
                this.aj = a;
                this.fj("UnknownValuePlotting", enumGetBox(UnknownValuePlotting_$type, b), enumGetBox(UnknownValuePlotting_$type, this.ak));
            }
        },
        enumerable: true,
        configurable: true
    });
    DomainChart.prototype.get_by = function () {
        return this.bi;
    };
    DomainChart.prototype.set_by = function (a) {
        var b = this.by;
        if (a != b) {
            this.bi = a;
            this.fj("Resolution", b, this.by);
        }
    };
    Object.defineProperty(DomainChart.prototype, "by", {
        get: function () {
            return this.get_by();
        },
        set: function (a) {
            this.set_by(a);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "b4", {
        get: function () {
            return this.bo;
        },
        set: function (a) {
            var b = this.b4;
            if (a != b) {
                this.bo = a;
                this.fj("Thickness", b, this.b4);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "af", {
        get: function () {
            return this.ae;
        },
        set: function (a) {
            var b = this.af;
            if (a != b) {
                this.ae = a;
                this.fj("MarkerTypes", b, this.af);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "l", {
        get: function () {
            return this.f;
        },
        set: function (a) {
            var b = this.l;
            if (a != b) {
                this.f = a;
                this.fj("MarkerBrushes", b, this.l);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "m", {
        get: function () {
            return this.g;
        },
        set: function (a) {
            var b = this.m;
            if (!Base.equalsStatic(a, b)) {
                this.g = a;
                this.fj("MarkerOutlines", b, this.m);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "ch", {
        get: function () {
            return this.cd;
        },
        set: function (a) {
            var b = this.cd;
            if (a != b) {
                this.cd = a;
                this.fj("MarkerMaxCount", b, this.cd);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "av", {
        get: function () {
            return this.aq;
        },
        set: function (a) {
            var b = this.aq;
            if (a != b) {
                this.aq = a;
                this.fj("AnimateSeriesWhenAxisRangeChanges", b, this.aq);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "o", {
        get: function () {
            return this.i;
        },
        set: function (a) {
            var b = this.o;
            if (a != b) {
                this.i = a;
                this.fj("TrendLineBrushes", b, this.o);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "ai", {
        get: function () {
            return this.ah;
        },
        set: function (a) {
            var b = this.ai;
            if (a != b) {
                this.ah = a;
                this.fj("TrendLineType", enumGetBox(TrendLineType_$type, b), enumGetBox(TrendLineType_$type, this.ai));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "ca", {
        get: function () {
            return this.bu;
        },
        set: function (a) {
            var b = this.ca;
            if (a != b) {
                this.bu = a;
                this.fj("TrendLineThickness", b, this.ca);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "au", {
        get: function () {
            return this.ap;
        },
        set: function (a) {
            var b = this.au;
            if (a != b) {
                this.ap = a;
                this.fj("AlignsGridLinesToPixels", b, this.au);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DomainChart.prototype, "cj", {
        get: function () {
            return this.cg;
        },
        set: function (a) {
            var b = this.cj;
            if (a != b) {
                this.cg = a;
                this.fj("TrendLinePeriod", b, this.cj);
            }
        },
        enumerable: true,
        configurable: true
    });
    DomainChart.ct = new Random(0);
    DomainChart.$t = markType(DomainChart, 'DomainChart', Base.$, [INotifyPropertyChanged_$type]);
    return DomainChart;
}(Base));
export { DomainChart };
/*<BeginStatics Name="Infragistics.Controls.Charts.DomainChart" />*/
/*<EndStatics Name="Infragistics.Controls.Charts.DomainChart" />*/
