/*
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 { 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
 */
export let DataChartToolbarProvider = /*@__PURE__*/ (() => {
    class DataChartToolbarProvider extends Base {
        constructor() {
            super(...arguments);
            this.a = null;
        }
        get b() {
            if (TypeRegistrar.isRegistered("AnnotationLayerProxy")) {
                return TypeRegistrar.create("AnnotationLayerProxy");
            }
            else {
                throw new BaseError(1, "annotation layer module is not loaded, but is required.");
            }
        }
        get c() {
            return (TypeRegistrar.isRegistered("AnnotationLayerProxy"));
        }
        getDesiredToolbarActions() {
            let a = new ToolActionCheckboxInfo();
            a.commandId = "Crosshairs";
            a.commandArgument = "CrosshairsEnabled";
            a.iconName = "Search";
            a.label = "Crosshairs";
            let b = new ToolActionIconButtonInfo();
            b.commandId = "ZoomIn";
            b.iconName = "ZoomIn";
            b.label = "Zoom In";
            let c = new ToolActionIconButtonInfo();
            c.commandId = "ZoomOut";
            c.iconName = "ZoomOut";
            c.label = "Zoom Out";
            let d = new ToolActionIconButtonInfo();
            d.commandId = "ZoomReset";
            d.iconName = "Search";
            d.label = "Reset Zoom";
            return [d, b, c, a];
        }
        onToolCommandExecuting(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;
            }
        }
        d(a, b) {
            let c = a.ao(a);
            let d = false;
            let g = b.argumentsList;
            for (let f = 0; f < g.length; f++) {
                let e = g[f];
                if (e.argumentName == "CrosshairsEnabled") {
                    d = e.value;
                }
            }
            if (d && !c.e(0)) {
                if (this.c) {
                    let h = this.b.createCrosshairLayer();
                    let i = new AutomaticSeriesRequest();
                    i.a = 0;
                    i.e = true;
                    i.d = h;
                    c.b.add(i);
                }
            }
            if (!d && c.e(0)) {
                c.l(0);
            }
        }
        e(a, b) {
            a.pj(0.05);
        }
        f(a, b) {
            a.pk(0.05);
        }
        g(a, b) {
            a.ot();
        }
    }
    DataChartToolbarProvider.$t = markType(DataChartToolbarProvider, 'DataChartToolbarProvider', Base.$, [IDataChartToolbarProvider_$type]);
    return DataChartToolbarProvider;
})();
