/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { __extends } from "tslib";
import { Base, BaseError, markType, TypeRegistrar } from "igniteui-angular-core";
import { IDataChartToolbarProvider_$type } from "./IDataChartToolbarProvider";
import { ToolActionCheckboxInfo } from "igniteui-angular-core";
import { ToolActionIconButtonInfo } from "igniteui-angular-core";
import { AutomaticSeriesRequest } from "./AutomaticSeriesRequest";
/**
 * @hidden
 */
var DataChartToolbarProvider = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(DataChartToolbarProvider, _super);
    function DataChartToolbarProvider() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.a = null;
        return _this;
    }
    Object.defineProperty(DataChartToolbarProvider.prototype, "b", {
        get: function () {
            if (TypeRegistrar.isRegistered("AnnotationLayerProxy")) {
                return TypeRegistrar.create("AnnotationLayerProxy");
            }
            else {
                throw new BaseError(1, "annotation layer module is not loaded, but is required.");
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataChartToolbarProvider.prototype, "c", {
        get: function () {
            return (TypeRegistrar.isRegistered("AnnotationLayerProxy"));
        },
        enumerable: false,
        configurable: true
    });
    DataChartToolbarProvider.prototype.getDesiredToolbarActions = function () {
        var a = new ToolActionCheckboxInfo();
        a.commandId = "Crosshairs";
        a.commandArgument = "CrosshairsEnabled";
        a.iconName = "Search";
        a.label = "Crosshairs";
        var b = new ToolActionIconButtonInfo();
        b.commandId = "ZoomIn";
        b.iconName = "ZoomIn";
        b.label = "Zoom In";
        var c = new ToolActionIconButtonInfo();
        c.commandId = "ZoomOut";
        c.iconName = "ZoomOut";
        c.label = "Zoom Out";
        var d = new ToolActionIconButtonInfo();
        d.commandId = "ZoomReset";
        d.iconName = "Search";
        d.label = "Reset Zoom";
        return [d, b, c, a];
    };
    DataChartToolbarProvider.prototype.onToolCommandExecuting = function (a, b) {
        if (b.commandId == null) {
            return;
        }
        switch (b.commandId) {
            case "ZoomReset":
                this.g(a, b);
                break;
            case "ZoomIn":
                this.e(a, b);
                break;
            case "ZoomOut":
                this.f(a, b);
                break;
            case "Crosshairs":
                this.d(a, b);
                break;
        }
    };
    DataChartToolbarProvider.prototype.d = function (a, b) {
        var c = a.ao(a);
        var d = false;
        var g = b.argumentsList;
        for (var f = 0; f < g.length; f++) {
            var e = g[f];
            if (e.argumentName == "CrosshairsEnabled") {
                d = e.value;
            }
        }
        if (d && !c.e(0)) {
            if (this.c) {
                var h = this.b.createCrosshairLayer();
                var i = new AutomaticSeriesRequest();
                i.a = 0;
                i.e = true;
                i.d = h;
                c.b.add(i);
            }
        }
        if (!d && c.e(0)) {
            c.l(0);
        }
    };
    DataChartToolbarProvider.prototype.e = function (a, b) {
        a.pj(0.05);
    };
    DataChartToolbarProvider.prototype.f = function (a, b) {
        a.pk(0.05);
    };
    DataChartToolbarProvider.prototype.g = function (a, b) {
        a.ot();
    };
    DataChartToolbarProvider.$t = markType(DataChartToolbarProvider, 'DataChartToolbarProvider', Base.$, [IDataChartToolbarProvider_$type]);
    return DataChartToolbarProvider;
}(Base));
export { DataChartToolbarProvider };
