import { EventEmitter, Output, Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core';
import { delegateCombine } from "igniteui-angular-core";
import { IgxAxisComponent } from "./igx-axis-component";
import { OverlayTextLocation_$type } from "./OverlayTextLocation";
import { AnnotationAppearanceMode_$type } from "./AnnotationAppearanceMode";
import { IgxOverlayTextUpdatingEventArgs } from "./igx-overlay-text-updating-event-args";
import { IgxSeriesComponent } from "./igx-series-component";
import { ValueOverlay } from "./ValueOverlay";
import { ensureBool, brushToString, stringToBrush, ensureEnum, toPoint, fromPoint } from "igniteui-angular-core";
import { FontInfo } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
 * Represents the class of the value overlay. The value overlay is a line or circle representing a value on an axis.
*/
export let IgxValueOverlayComponent = /*@__PURE__*/ (() => {
    class IgxValueOverlayComponent extends IgxSeriesComponent {
        constructor() {
            super();
            this._stylingOverlayText = null;
        }
        createImplementation() {
            return new ValueOverlay();
        }
        /**
                                     * @hidden
                                     */
        get i() {
            return this._implementation;
        }
        /**
         * Gets or sets the axis used by the value overlay.
        */
        get axis() {
            const r = this.i.xb;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                let e = IgxAxisComponent._createFromInternal(r);
                if (e) {
                    e._implementation = r;
                }
                r.externalObject = e;
            }
            return r.externalObject;
        }
        set axis(v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.xb = null : this.i.xb = v.i;
        }
        /**
         * Gets or sets the value of the overlay.
        */
        get value() {
            return this.i.yc;
        }
        set value(v) {
            this.i.yc = +v;
        }
        /**
         * Gets or sets whether to draw annotations over the axes where the crosshair meets with them.
        */
        get isAxisAnnotationEnabled() {
            return this.i.xj;
        }
        set isAxisAnnotationEnabled(v) {
            this.i.xj = ensureBool(v);
        }
        /**
         * Sets or gets a function which takes an object that produces a formatted label for the axis annotation.
        */
        get axisAnnotationFormatLabel() {
            return this.i.xd;
        }
        set axisAnnotationFormatLabel(v) {
            this.i.xd = v;
        }
        /**
         * Gets or sets the color to use for the axis annotation text. Leave unset for an automatic value.
        */
        get axisAnnotationTextColor() {
            return brushToString(this.i.aan);
        }
        set axisAnnotationTextColor(v) {
            this.i.aan = stringToBrush(v);
        }
        /**
         * Gets or sets the color to use for the axis annotation backing. Leave unset for an automatic value.
        */
        get axisAnnotationBackground() {
            return brushToString(this.i.aal);
        }
        set axisAnnotationBackground(v) {
            this.i.aal = stringToBrush(v);
        }
        /**
         * Gets or sets the corner radius to use for the axis annotation backing. Leave unset for an automatic value.
        */
        get axisAnnotationBackgroundCornerRadius() {
            return this.i.xr;
        }
        set axisAnnotationBackgroundCornerRadius(v) {
            this.i.xr = +v;
        }
        /**
         * Gets or sets the precision to use displaying values for interpolated positions.
        */
        get axisAnnotationInterpolatedValuePrecision() {
            return this.i.yd;
        }
        set axisAnnotationInterpolatedValuePrecision(v) {
            this.i.yd = +v;
        }
        /**
         * Gets or sets the color to use for the axis annotation outline. Leave unset for an automatic value.
        */
        get axisAnnotationOutline() {
            return brushToString(this.i.aam);
        }
        set axisAnnotationOutline(v) {
            this.i.aam = stringToBrush(v);
        }
        /**
         * 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 axisAnnotationPaddingLeft() {
            return this.i.xt;
        }
        set axisAnnotationPaddingLeft(v) {
            this.i.xt = +v;
        }
        /**
         * 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 axisAnnotationPaddingTop() {
            return this.i.xv;
        }
        set axisAnnotationPaddingTop(v) {
            this.i.xv = +v;
        }
        /**
         * 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 axisAnnotationPaddingRight() {
            return this.i.xu;
        }
        set axisAnnotationPaddingRight(v) {
            this.i.xu = +v;
        }
        /**
         * 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 axisAnnotationPaddingBottom() {
            return this.i.xs;
        }
        set axisAnnotationPaddingBottom(v) {
            this.i.xs = +v;
        }
        /**
         * Gets or sets the stroke thickness for the axis annotation backing. Leave unset for an automatic value.
        */
        get axisAnnotationStrokeThickness() {
            return this.i.xw;
        }
        set axisAnnotationStrokeThickness(v) {
            this.i.xw = +v;
        }
        /**
         * Gets whether the series is a value overlay.
        */
        get isValueOverlay() {
            return this.i.isValueOverlay;
        }
        get labelResolved() {
            return this.i.ys;
        }
        /**
         * Gets or sets location of the overlay text in relation to shape of data annotation.
        */
        get overlayTextLocation() {
            return this.i.xe;
        }
        set overlayTextLocation(v) {
            this.i.xe = ensureEnum(OverlayTextLocation_$type, v);
        }
        /**
         * Gets or sets the horizontal margin of the overlay text in relation to shape of data annotation.
        */
        get overlayTextHorizontalMargin() {
            return this.i.x5;
        }
        set overlayTextHorizontalMargin(v) {
            this.i.x5 = +v;
        }
        /**
         * Gets or sets the vertical margin of the overlay text in relation to shape of data annotation.
        */
        get overlayTextVerticalMargin() {
            return this.i.x7;
        }
        set overlayTextVerticalMargin(v) {
            this.i.x7 = +v;
        }
        /**
         * Gets or sets the horizontal padding of the overlay text in relation to shape of data annotation.
        */
        get overlayTextHorizontalPadding() {
            return this.i.x6;
        }
        set overlayTextHorizontalPadding(v) {
            this.i.x6 = +v;
        }
        /**
         * Gets or sets the vertical padding of the overlay text in relation to shape of data annotation.
        */
        get overlayTextVerticalPadding() {
            return this.i.x8;
        }
        set overlayTextVerticalPadding(v) {
            this.i.x8 = +v;
        }
        /**
         * Gets or sets the angle rotation (in degrees) of the overlay text in relation to shape of data annotation.
        */
        get overlayTextAngle() {
            return this.i.xz;
        }
        set overlayTextAngle(v) {
            this.i.xz = +v;
        }
        /**
         * Gets or sets the color the overlay text.
        */
        get overlayTextColor() {
            return brushToString(this.i.aaq);
        }
        set overlayTextColor(v) {
            this.i.aaq = stringToBrush(v);
        }
        /**
         * Gets or sets the background the overlay text.
        */
        get overlayTextBackground() {
            return brushToString(this.i.aao);
        }
        set overlayTextBackground(v) {
            this.i.aao = stringToBrush(v);
        }
        /**
         * Gets or sets the border stroke of the overlay text.
        */
        get overlayTextBorderColor() {
            return brushToString(this.i.aap);
        }
        set overlayTextBorderColor(v) {
            this.i.aap = stringToBrush(v);
        }
        /**
         * Gets or sets the border corner of the overlay text.
        */
        get overlayTextBorderRadius() {
            return this.i.x1;
        }
        set overlayTextBorderRadius(v) {
            this.i.x1 = +v;
        }
        /**
         * Gets or sets the border thickness of the overlay text.
        */
        get overlayTextBorderThickness() {
            return this.i.x3;
        }
        set overlayTextBorderThickness(v) {
            this.i.x3 = +v;
        }
        /**
         * Gets or sets whether the overlay text is visible in shape of data annotation
        */
        get overlayTextVisible() {
            return this.i.xn;
        }
        set overlayTextVisible(v) {
            this.i.xn = ensureBool(v);
        }
        /**
         * Gets or sets the text that will be displayed as the overlay annotation.
        */
        get overlayText() {
            return this.i.yt;
        }
        set overlayText(v) {
            this.i.yt = v;
        }
        /**
         * Gets or sets the shift of the overlay text color based on OverlayTextColorMode. Value must range between -1.0 to 1.0, where 0 means no color shift.
        */
        get overlayTextColorShift() {
            return this.i.x4;
        }
        set overlayTextColorShift(v) {
            this.i.x4 = +v;
        }
        /**
         * Gets or sets the mode used for shifting the background of overlay text based on the target series.
        */
        get overlayTextColorMode() {
            return this.i.xa;
        }
        set overlayTextColorMode(v) {
            this.i.xa = ensureEnum(AnnotationAppearanceMode_$type, v);
        }
        /**
         * Gets or sets whether the overlay text color matches brush of the layer
        */
        get overlayTextColorMatchLayer() {
            return this.i.xm;
        }
        set overlayTextColorMatchLayer(v) {
            this.i.xm = ensureBool(v);
        }
        /**
         * Gets or sets the shift of the overlay background based on OverlayTextBackgroundMode. Value must range between -1.0 to 1.0, where 0 means no color shift.
        */
        get overlayTextBackgroundShift() {
            return this.i.x0;
        }
        set overlayTextBackgroundShift(v) {
            this.i.x0 = +v;
        }
        /**
         * Gets or sets the mode used for shifting the background of overlay text based on the target series.
        */
        get overlayTextBackgroundMode() {
            return this.i.w8;
        }
        set overlayTextBackgroundMode(v) {
            this.i.w8 = ensureEnum(AnnotationAppearanceMode_$type, v);
        }
        /**
         * Gets or sets whether the overlay text background matches brush of the layer
        */
        get overlayTextBackgroundMatchLayer() {
            return this.i.xk;
        }
        set overlayTextBackgroundMatchLayer(v) {
            this.i.xk = ensureBool(v);
        }
        /**
         * Gets or sets the shift of the overlay border based on OverlayTextBorderMode. Value must range between -1.0 to 1.0, where 0 means no color shift.
        */
        get overlayTextBorderShift() {
            return this.i.x2;
        }
        set overlayTextBorderShift(v) {
            this.i.x2 = +v;
        }
        /**
         * Gets or sets the mode used for shifting the border of overlay text based on the target series.
        */
        get overlayTextBorderMode() {
            return this.i.w9;
        }
        set overlayTextBorderMode(v) {
            this.i.w9 = ensureEnum(AnnotationAppearanceMode_$type, v);
        }
        /**
         * Gets or sets whether the overlay text border matches brush of the layer
        */
        get overlayTextBorderMatchLayer() {
            return this.i.xl;
        }
        set overlayTextBorderMatchLayer(v) {
            this.i.xl = ensureBool(v);
        }
        /**
         * Gets or Sets the style to use for the display text.
        */
        get overlayTextStyle() {
            if (this.i.xi == null) {
                return null;
            }
            return this.i.xi.fontString;
        }
        set overlayTextStyle(v) {
            let fi = new FontInfo();
            fi.fontString = v;
            this.i.xi = fi;
        }
        findByName(name) {
            var baseResult = super.findByName(name);
            if (baseResult) {
                return baseResult;
            }
            if (this.axis && this.axis.name && this.axis.name == name) {
                return this.axis;
            }
            return null;
        }
        _styling(container, component, parent) {
            super._styling(container, component, parent);
            this._inStyling = true;
            if (this.axis && this.axis._styling) {
                this.axis._styling(container, component, this);
            }
            this._inStyling = false;
        }
        getSeriesValue(world, useInterpolation, skipUnknowns) {
            let iv = this.i.i8(toPoint(world), useInterpolation, skipUnknowns);
            return (iv);
        }
        getSeriesValuePosition(world, useInterpolation, skipUnknowns) {
            let iv = this.i.wm(toPoint(world), useInterpolation, skipUnknowns);
            return fromPoint(iv);
        }
        /**
         * Gets the item index associated with the specified world position
        
        * @param world
        */
        getItemIndex(world) {
            let iv = this.i.j7(toPoint(world));
            return (iv);
        }
        /**
         * Gets the item that is the best match for the specified world coordinates.
        
        * @param world  * The world coordinates to use.
        */
        getItem(world) {
            let iv = this.i.kr(toPoint(world));
            return (iv);
        }
        /**
         * Requests that the provided item should be brought into view if possible.
        
        * @param item  * The item to attempt to bring into view.
        */
        scrollIntoView(item) {
            let iv = this.i.ge(item);
            return (iv);
        }
        /**
         * Gets the label for a data item.
        
        * @param value  * The unscaled value to get a label for.
        */
        getLabel(value) {
            let iv = this.i.yq(value);
            return (iv);
        }
        /**
         * Event raised when updating style of overlay text
        */
        get stylingOverlayText() {
            if (this._stylingOverlayText == null) {
                this._stylingOverlayText = new EventEmitter();
                this.i.stylingOverlayText = delegateCombine(this.i.stylingOverlayText, (o, e) => {
                    this._runInZone(() => {
                        let outerArgs = new IgxOverlayTextUpdatingEventArgs();
                        outerArgs._provideImplementation(e);
                        if (this.beforeStylingOverlayText) {
                            this.beforeStylingOverlayText(this, outerArgs);
                        }
                        this._stylingOverlayText.emit({
                            sender: this,
                            args: outerArgs
                        });
                    });
                });
            }
            return this._stylingOverlayText;
        }
    }
    IgxValueOverlayComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxValueOverlayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    IgxValueOverlayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxValueOverlayComponent, selector: "igx-value-overlay", inputs: { axis: "axis", value: "value", isAxisAnnotationEnabled: "isAxisAnnotationEnabled", axisAnnotationFormatLabel: "axisAnnotationFormatLabel", axisAnnotationTextColor: "axisAnnotationTextColor", axisAnnotationBackground: "axisAnnotationBackground", axisAnnotationBackgroundCornerRadius: "axisAnnotationBackgroundCornerRadius", axisAnnotationInterpolatedValuePrecision: "axisAnnotationInterpolatedValuePrecision", axisAnnotationOutline: "axisAnnotationOutline", axisAnnotationPaddingLeft: "axisAnnotationPaddingLeft", axisAnnotationPaddingTop: "axisAnnotationPaddingTop", axisAnnotationPaddingRight: "axisAnnotationPaddingRight", axisAnnotationPaddingBottom: "axisAnnotationPaddingBottom", axisAnnotationStrokeThickness: "axisAnnotationStrokeThickness", overlayTextLocation: "overlayTextLocation", overlayTextHorizontalMargin: "overlayTextHorizontalMargin", overlayTextVerticalMargin: "overlayTextVerticalMargin", overlayTextHorizontalPadding: "overlayTextHorizontalPadding", overlayTextVerticalPadding: "overlayTextVerticalPadding", overlayTextAngle: "overlayTextAngle", overlayTextColor: "overlayTextColor", overlayTextBackground: "overlayTextBackground", overlayTextBorderColor: "overlayTextBorderColor", overlayTextBorderRadius: "overlayTextBorderRadius", overlayTextBorderThickness: "overlayTextBorderThickness", overlayTextVisible: "overlayTextVisible", overlayText: "overlayText", overlayTextColorShift: "overlayTextColorShift", overlayTextColorMode: "overlayTextColorMode", overlayTextColorMatchLayer: "overlayTextColorMatchLayer", overlayTextBackgroundShift: "overlayTextBackgroundShift", overlayTextBackgroundMode: "overlayTextBackgroundMode", overlayTextBackgroundMatchLayer: "overlayTextBackgroundMatchLayer", overlayTextBorderShift: "overlayTextBorderShift", overlayTextBorderMode: "overlayTextBorderMode", overlayTextBorderMatchLayer: "overlayTextBorderMatchLayer", overlayTextStyle: "overlayTextStyle" }, outputs: { stylingOverlayText: "stylingOverlayText" }, providers: [{ provide: IgxSeriesComponent, useExisting: forwardRef(() => IgxValueOverlayComponent) }], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
    return IgxValueOverlayComponent;
})();
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxValueOverlayComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'igx-value-overlay',
                    template: ``,
                    providers: [{ provide: IgxSeriesComponent, useExisting: forwardRef(() => IgxValueOverlayComponent) }],
                    changeDetection: ChangeDetectionStrategy.OnPush
                }]
        }], ctorParameters: function () { return []; }, propDecorators: { axis: [{
                type: Input
            }], value: [{
                type: Input
            }], isAxisAnnotationEnabled: [{
                type: Input
            }], axisAnnotationFormatLabel: [{
                type: Input
            }], axisAnnotationTextColor: [{
                type: Input
            }], axisAnnotationBackground: [{
                type: Input
            }], axisAnnotationBackgroundCornerRadius: [{
                type: Input
            }], axisAnnotationInterpolatedValuePrecision: [{
                type: Input
            }], axisAnnotationOutline: [{
                type: Input
            }], axisAnnotationPaddingLeft: [{
                type: Input
            }], axisAnnotationPaddingTop: [{
                type: Input
            }], axisAnnotationPaddingRight: [{
                type: Input
            }], axisAnnotationPaddingBottom: [{
                type: Input
            }], axisAnnotationStrokeThickness: [{
                type: Input
            }], overlayTextLocation: [{
                type: Input
            }], overlayTextHorizontalMargin: [{
                type: Input
            }], overlayTextVerticalMargin: [{
                type: Input
            }], overlayTextHorizontalPadding: [{
                type: Input
            }], overlayTextVerticalPadding: [{
                type: Input
            }], overlayTextAngle: [{
                type: Input
            }], overlayTextColor: [{
                type: Input
            }], overlayTextBackground: [{
                type: Input
            }], overlayTextBorderColor: [{
                type: Input
            }], overlayTextBorderRadius: [{
                type: Input
            }], overlayTextBorderThickness: [{
                type: Input
            }], overlayTextVisible: [{
                type: Input
            }], overlayText: [{
                type: Input
            }], overlayTextColorShift: [{
                type: Input
            }], overlayTextColorMode: [{
                type: Input
            }], overlayTextColorMatchLayer: [{
                type: Input
            }], overlayTextBackgroundShift: [{
                type: Input
            }], overlayTextBackgroundMode: [{
                type: Input
            }], overlayTextBackgroundMatchLayer: [{
                type: Input
            }], overlayTextBorderShift: [{
                type: Input
            }], overlayTextBorderMode: [{
                type: Input
            }], overlayTextBorderMatchLayer: [{
                type: Input
            }], overlayTextStyle: [{
                type: Input
            }], stylingOverlayText: [{
                type: Output
            }] } });
