import { EventEmitter, Output, Component, Input } from '@angular/core';
import { delegateCombine } from "igniteui-angular-core";
import { OverlayTextLocation_$type } from "./OverlayTextLocation";
import { AnnotationAppearanceMode_$type } from "./AnnotationAppearanceMode";
import { IgxOverlayTextUpdatingEventArgs } from "./igx-overlay-text-updating-event-args";
import { IgxDataAnnotationItem } from "./igx-data-annotation-item";
import { IgxDataAnnotationInfo } from "./igx-data-annotation-info";
import { IgxDataAnnotationAxisLayerComponent } from "./igx-data-annotation-axis-layer-component";
import { ensureBool, ensureEnum, brushToString, stringToBrush, toPoint, fromPoint } from "igniteui-angular-core";
import { FontInfo } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
 * Represents a base annotation layer that renders shapes defined by derived data annotation, e.g. line, strip, slice, rect, band
*/
export let IgxDataAnnotationShapeLayerComponent = /*@__PURE__*/ (() => {
    class IgxDataAnnotationShapeLayerComponent extends IgxDataAnnotationAxisLayerComponent {
        constructor() {
            super();
            this._stylingOverlayText = null;
            this._stylingShapeAnnotation = null;
            this._stylingAxisAnnotation = null;
        }
        /**
                                     * @hidden
                                     */
        get i() {
            return this._implementation;
        }
        /**
         * Gets or sets whether to draw shape of annotations in the plot area
        */
        get annotationShapeVisible() {
            return this.i.acq;
        }
        set annotationShapeVisible(v) {
            this.i.acq = ensureBool(v);
        }
        /**
         * Gets or sets whether the data items of the annotations use world coordinates (0.0 - 1.0) or they default to using axes coordinates (data indexes for category axis or data values for numeric axis).
        */
        get itemsUseWorldCoordinates() {
            return this.i.acu;
        }
        set itemsUseWorldCoordinates(v) {
            this.i.acu = ensureBool(v);
        }
        /**
         * Gets or sets location of the overlay text in relation to shape of data annotation.
        */
        get overlayTextLocation() {
            return this.i.aci;
        }
        set overlayTextLocation(v) {
            this.i.aci = 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.ade;
        }
        set overlayTextHorizontalMargin(v) {
            this.i.ade = +v;
        }
        /**
         * Gets or sets the vertical margin of the overlay text in relation to shape of data annotation.
        */
        get overlayTextVerticalMargin() {
            return this.i.adg;
        }
        set overlayTextVerticalMargin(v) {
            this.i.adg = +v;
        }
        /**
         * Gets or sets the horizontal padding of the overlay text in relation to shape of data annotation.
        */
        get overlayTextHorizontalPadding() {
            return this.i.adf;
        }
        set overlayTextHorizontalPadding(v) {
            this.i.adf = +v;
        }
        /**
         * Gets or sets the vertical padding of the overlay text in relation to shape of data annotation.
        */
        get overlayTextVerticalPadding() {
            return this.i.adh;
        }
        set overlayTextVerticalPadding(v) {
            this.i.adh = +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.ac8;
        }
        set overlayTextAngle(v) {
            this.i.ac8 = +v;
        }
        /**
         * Gets or sets the color the overlay text.
        */
        get overlayTextColor() {
            return brushToString(this.i.afi);
        }
        set overlayTextColor(v) {
            this.i.afi = stringToBrush(v);
        }
        /**
         * Gets or sets the background the overlay text.
        */
        get overlayTextBackground() {
            return brushToString(this.i.afg);
        }
        set overlayTextBackground(v) {
            this.i.afg = stringToBrush(v);
        }
        /**
         * Gets or sets the border stroke of the overlay text.
        */
        get overlayTextBorderColor() {
            return brushToString(this.i.afh);
        }
        set overlayTextBorderColor(v) {
            this.i.afh = stringToBrush(v);
        }
        /**
         * Gets or sets the border corner of the overlay text.
        */
        get overlayTextBorderRadius() {
            return this.i.ada;
        }
        set overlayTextBorderRadius(v) {
            this.i.ada = +v;
        }
        /**
         * Gets or sets the border thickness of the overlay text.
        */
        get overlayTextBorderThickness() {
            return this.i.adc;
        }
        set overlayTextBorderThickness(v) {
            this.i.adc = +v;
        }
        /**
         * Gets or sets whether the overlay text is visible in shape of data annotation
        */
        get overlayTextVisible() {
            return this.i.acy;
        }
        set overlayTextVisible(v) {
            this.i.acy = ensureBool(v);
        }
        /**
         * Gets or sets name of data column with text that will be displayed as overlay text.
        */
        get overlayTextMemberPath() {
            return this.i.aea;
        }
        set overlayTextMemberPath(v) {
            this.i.aea = v;
        }
        /**
         * Gets or sets the text that will be displayed as the overlay annotation.
        */
        get overlayText() {
            return this.i.adq;
        }
        set overlayText(v) {
            this.i.adq = 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.add;
        }
        set overlayTextColorShift(v) {
            this.i.add = +v;
        }
        /**
         * Gets or sets the mode used for shifting the background of overlay text based on the target series.
        */
        get overlayTextColorMode() {
            return this.i.acb;
        }
        set overlayTextColorMode(v) {
            this.i.acb = ensureEnum(AnnotationAppearanceMode_$type, v);
        }
        /**
         * Gets or sets whether the overlay text color matches brush of the layer
        */
        get overlayTextColorMatchLayer() {
            return this.i.acx;
        }
        set overlayTextColorMatchLayer(v) {
            this.i.acx = 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.ac9;
        }
        set overlayTextBackgroundShift(v) {
            this.i.ac9 = +v;
        }
        /**
         * Gets or sets the mode used for shifting the background of overlay text based on the target series.
        */
        get overlayTextBackgroundMode() {
            return this.i.ab9;
        }
        set overlayTextBackgroundMode(v) {
            this.i.ab9 = ensureEnum(AnnotationAppearanceMode_$type, v);
        }
        /**
         * Gets or sets whether the overlay text background matches brush of the layer
        */
        get overlayTextBackgroundMatchLayer() {
            return this.i.acv;
        }
        set overlayTextBackgroundMatchLayer(v) {
            this.i.acv = 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.adb;
        }
        set overlayTextBorderShift(v) {
            this.i.adb = +v;
        }
        /**
         * Gets or sets the mode used for shifting the border of overlay text based on the target series.
        */
        get overlayTextBorderMode() {
            return this.i.aca;
        }
        set overlayTextBorderMode(v) {
            this.i.aca = ensureEnum(AnnotationAppearanceMode_$type, v);
        }
        /**
         * Gets or sets whether the overlay text border matches brush of the layer
        */
        get overlayTextBorderMatchLayer() {
            return this.i.acw;
        }
        set overlayTextBorderMatchLayer(v) {
            this.i.acw = ensureBool(v);
        }
        /**
         * Gets or Sets the style to use for the display text.
        */
        get overlayTextStyle() {
            if (this.i.acn == null) {
                return null;
            }
            return this.i.acn.fontString;
        }
        set overlayTextStyle(v) {
            let fi = new FontInfo();
            fi.fontString = v;
            this.i.acn = fi;
        }
        /**
         * Gets whether the annotation layer is currently targeting horizontal axis.
        */
        get isTargetingHorizontalAxis() {
            return this.i.acr;
        }
        set isTargetingHorizontalAxis(v) {
            this.i.acr = ensureBool(v);
        }
        /**
         * Converts world coordinate (0.0 - 1.0) to pixel coordinate that is relative to component's size
        
        */
        fromWorld(world) {
            let iv = this.i.afk(toPoint(world));
            return fromPoint(iv);
        }
        /**
         * Converts world X coordinate (0.0 - 1.0) to pixel coordinate that is relative to component's width
        
        */
        fromWorldX(x) {
            let iv = this.i.ac5(x);
            return (iv);
        }
        /**
         * Converts world Y coordinate (0.0 - 1.0) to pixel coordinate that is relative to component's height
        
        */
        fromWorldY(y) {
            let iv = this.i.ac6(y);
            return (iv);
        }
        /**
         * Converts pixel coordinate (relative to component's size) to world coordinate (0.0 - 1.0)
        
        */
        toWorld(pixel) {
            let iv = this.i.afn(toPoint(pixel));
            return fromPoint(iv);
        }
        /**
         * Converts pixel X coordinate (relative to component's width) to world coordinate (0.0 - 1.0)
        
        */
        toWorldX(x) {
            let iv = this.i.adi(x);
            return (iv);
        }
        /**
         * Converts pixel Y coordinate (relative to component's height) to world coordinate (0.0 - 1.0)
        
        */
        toWorldY(y) {
            let iv = this.i.adj(y);
            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;
        }
        /**
         * Event raised when updating style of annotation
        */
        get stylingShapeAnnotation() {
            if (this._stylingShapeAnnotation == null) {
                this._stylingShapeAnnotation = new EventEmitter();
                this.i.stylingShapeAnnotation = delegateCombine(this.i.stylingShapeAnnotation, (o, e) => {
                    this._runInZone(() => {
                        let outerArgs = new IgxDataAnnotationItem();
                        outerArgs._provideImplementation(e);
                        if (this.beforeStylingShapeAnnotation) {
                            this.beforeStylingShapeAnnotation(this, outerArgs);
                        }
                        this._stylingShapeAnnotation.emit({
                            sender: this,
                            args: outerArgs
                        });
                    });
                });
            }
            return this._stylingShapeAnnotation;
        }
        /**
         * Event raised when updating style of annotation
        */
        get stylingAxisAnnotation() {
            if (this._stylingAxisAnnotation == null) {
                this._stylingAxisAnnotation = new EventEmitter();
                this.i.stylingAxisAnnotation = delegateCombine(this.i.stylingAxisAnnotation, (o, e) => {
                    this._runInZone(() => {
                        let outerArgs = new IgxDataAnnotationInfo();
                        outerArgs._provideImplementation(e);
                        if (this.beforeStylingAxisAnnotation) {
                            this.beforeStylingAxisAnnotation(this, outerArgs);
                        }
                        this._stylingAxisAnnotation.emit({
                            sender: this,
                            args: outerArgs
                        });
                    });
                });
            }
            return this._stylingAxisAnnotation;
        }
    }
    IgxDataAnnotationShapeLayerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxDataAnnotationShapeLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    IgxDataAnnotationShapeLayerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxDataAnnotationShapeLayerComponent, selector: "ng-component", inputs: { annotationShapeVisible: "annotationShapeVisible", itemsUseWorldCoordinates: "itemsUseWorldCoordinates", overlayTextLocation: "overlayTextLocation", overlayTextHorizontalMargin: "overlayTextHorizontalMargin", overlayTextVerticalMargin: "overlayTextVerticalMargin", overlayTextHorizontalPadding: "overlayTextHorizontalPadding", overlayTextVerticalPadding: "overlayTextVerticalPadding", overlayTextAngle: "overlayTextAngle", overlayTextColor: "overlayTextColor", overlayTextBackground: "overlayTextBackground", overlayTextBorderColor: "overlayTextBorderColor", overlayTextBorderRadius: "overlayTextBorderRadius", overlayTextBorderThickness: "overlayTextBorderThickness", overlayTextVisible: "overlayTextVisible", overlayTextMemberPath: "overlayTextMemberPath", overlayText: "overlayText", overlayTextColorShift: "overlayTextColorShift", overlayTextColorMode: "overlayTextColorMode", overlayTextColorMatchLayer: "overlayTextColorMatchLayer", overlayTextBackgroundShift: "overlayTextBackgroundShift", overlayTextBackgroundMode: "overlayTextBackgroundMode", overlayTextBackgroundMatchLayer: "overlayTextBackgroundMatchLayer", overlayTextBorderShift: "overlayTextBorderShift", overlayTextBorderMode: "overlayTextBorderMode", overlayTextBorderMatchLayer: "overlayTextBorderMatchLayer", overlayTextStyle: "overlayTextStyle", isTargetingHorizontalAxis: "isTargetingHorizontalAxis" }, outputs: { stylingOverlayText: "stylingOverlayText", stylingShapeAnnotation: "stylingShapeAnnotation", stylingAxisAnnotation: "stylingAxisAnnotation" }, usesInheritance: true, ngImport: i0, template: ``, isInline: true });
    return IgxDataAnnotationShapeLayerComponent;
})();
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxDataAnnotationShapeLayerComponent, decorators: [{
            type: Component,
            args: [{
                    template: ``,
                }]
        }], ctorParameters: function () { return []; }, propDecorators: { annotationShapeVisible: [{
                type: Input
            }], itemsUseWorldCoordinates: [{
                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
            }], overlayTextMemberPath: [{
                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
            }], isTargetingHorizontalAxis: [{
                type: Input
            }], stylingOverlayText: [{
                type: Output
            }], stylingShapeAnnotation: [{
                type: Output
            }], stylingAxisAnnotation: [{
                type: Output
            }] } });
