import { __extends } from "tslib";
import { IgrSeries } from "./igr-series";
import { Visibility_$type } from "igniteui-react-core";
import { IgrAnnotationLayer } from "./igr-annotation-layer";
import { CrosshairLayer } from "./CrosshairLayer";
import { ensureBool, brushToString, stringToBrush, ensureEnum } from "igniteui-react-core";
/**
 * Represents an annotation layer that displays crosshair lines that cross through the closest value of the target series under the cursor.
*/
var IgrCrosshairLayer = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgrCrosshairLayer, _super);
    function IgrCrosshairLayer(props) {
        return _super.call(this, props) || this;
    }
    IgrCrosshairLayer.prototype.createImplementation = function () {
        return new CrosshairLayer();
    };
    Object.defineProperty(IgrCrosshairLayer.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "isAnnotationHoverLayer", {
        /**
         * Gets whether the series is an annotation layer displayed only when hovering over the chart.
        */
        get: function () {
            return this.i.ep;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "isAnnotationCrosshairLayer", {
        /**
         * Gets whether the series is an crosshair annotation layer.
        */
        get: function () {
            return this.i.en;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "horizontalLineStroke", {
        /**
         * Gets or sets the color to use for the horizontal line. Leave null for an automatic value.
        */
        get: function () {
            return brushToString(this.i.ab3);
        },
        set: function (v) {
            this.i.ab3 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "verticalLineStroke", {
        /**
         * Gets or sets the color to use for vertical line. Leave null for an automatic value.
        */
        get: function () {
            return brushToString(this.i.ab4);
        },
        set: function (v) {
            this.i.ab4 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "targetSeriesName", {
        /**
         * Gets or sets the name of the series to target this annotation to. If null, this annotation targets all series simultaneously.
        */
        get: function () {
            return this.i.aah;
        },
        set: function (v) {
            this.i.aah = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "targetSeries", {
        /**
         * Gets or sets the series to target this annotation to. If null, this annotation targets all series simultaneously.
        */
        get: function () {
            var r = this.i.zr;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                var e = IgrSeries._createFromInternal(r);
                if (e) {
                    e._implementation = r;
                }
                r.externalObject = e;
            }
            return r.externalObject;
        },
        set: function (v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.zr = null : this.i.zr = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "useInterpolation", {
        /**
         * Gets or sets whether to use value interpolation when drawing a line through the best value for the cursor position.
        */
        get: function () {
            return this.i.zw;
        },
        set: function (v) {
            this.i.zw = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "isAxisAnnotationEnabled", {
        /**
         * Gets or sets whether to draw annotations over the axes where the crosshair meets with them.
        */
        get: function () {
            return this.i.zu;
        },
        set: function (v) {
            this.i.zu = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "xAxisAnnotationTextColor", {
        /**
         * Gets or sets the color to use for the x axis annotation text. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.ab7);
        },
        set: function (v) {
            this.i.ab7 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "xAxisAnnotationBackground", {
        /**
         * Gets or sets the color to use for the x axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.ab5);
        },
        set: function (v) {
            this.i.ab5 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "xAxisAnnotationBackgroundCornerRadius", {
        /**
         * Gets or sets the corner radius to use for the x axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.zz;
        },
        set: function (v) {
            this.i.zz = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "xAxisAnnotationInterpolatedValuePrecision", {
        /**
         * Gets or sets the precision to use displaying values for interpolated crosshair positions.
        */
        get: function () {
            return this.i.aab;
        },
        set: function (v) {
            this.i.aab = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "xAxisAnnotationOutline", {
        /**
         * Gets or sets the color to use for the x axis annotation outline. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.ab6);
        },
        set: function (v) {
            this.i.ab6 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "xAxisAnnotationPaddingLeft", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.z1;
        },
        set: function (v) {
            this.i.z1 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "xAxisAnnotationPaddingTop", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.z3;
        },
        set: function (v) {
            this.i.z3 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "xAxisAnnotationPaddingRight", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.z2;
        },
        set: function (v) {
            this.i.z2 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "xAxisAnnotationPaddingBottom", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.z0;
        },
        set: function (v) {
            this.i.z0 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "yAxisAnnotationPaddingLeft", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.z7;
        },
        set: function (v) {
            this.i.z7 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "yAxisAnnotationPaddingTop", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.z9;
        },
        set: function (v) {
            this.i.z9 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "yAxisAnnotationPaddingRight", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.z8;
        },
        set: function (v) {
            this.i.z8 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "yAxisAnnotationPaddingBottom", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.z6;
        },
        set: function (v) {
            this.i.z6 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "xAxisAnnotationStrokeThickness", {
        /**
         * Gets or sets the stroke thickness for the x axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.z4;
        },
        set: function (v) {
            this.i.z4 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "yAxisAnnotationTextColor", {
        /**
         * Gets or sets the color to use for the y axis annotation text. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.aca);
        },
        set: function (v) {
            this.i.aca = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "yAxisAnnotationBackground", {
        /**
         * Gets or sets the color to use for the y axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.ab8);
        },
        set: function (v) {
            this.i.ab8 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "yAxisAnnotationBackgroundCornerRadius", {
        /**
         * Gets or sets the corner radius to use for the y axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.z5;
        },
        set: function (v) {
            this.i.z5 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "yAxisAnnotationInterpolatedValuePrecision", {
        /**
         * Gets or sets the precision to use displaying values for interpolated crosshair positions.
        */
        get: function () {
            return this.i.aac;
        },
        set: function (v) {
            this.i.aac = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "yAxisAnnotationOutline", {
        /**
         * Gets or sets the color to use for the y axis annotation outline. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.ab9);
        },
        set: function (v) {
            this.i.ab9 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "yAxisAnnotationStrokeThickness", {
        /**
         * Gets or sets the stroke thickness for the y axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.aaa;
        },
        set: function (v) {
            this.i.aaa = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "verticalLineVisibility", {
        /**
         * Gets or sets whether to display the vertical line.
        */
        get: function () {
            return this.i.acg;
        },
        set: function (v) {
            this.i.acg = ensureEnum(Visibility_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "horizontalLineVisibility", {
        /**
         * Gets or sets whether to display the horizontal line.
        */
        get: function () {
            return this.i.acf;
        },
        set: function (v) {
            this.i.acf = ensureEnum(Visibility_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "skipUnknownValues", {
        /**
         * Gets or sets whether to skip unknown values when searching for series values.
        */
        get: function () {
            return this.i.zv;
        },
        set: function (v) {
            this.i.zv = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    IgrCrosshairLayer.prototype.findByName = function (name) {
        var baseResult = _super.prototype.findByName.call(this, name);
        if (baseResult) {
            return baseResult;
        }
        if (this.targetSeries && this.targetSeries.name && this.targetSeries.name == name) {
            return this.targetSeries;
        }
        return null;
    };
    IgrCrosshairLayer.prototype._styling = function (container, component, parent) {
        _super.prototype._styling.call(this, container, component, parent);
        this._inStyling = true;
        if (this.targetSeries && this.targetSeries._styling) {
            this.targetSeries._styling(container, component, this);
        }
        this._inStyling = false;
    };
    return IgrCrosshairLayer;
}(IgrAnnotationLayer));
export { IgrCrosshairLayer };
