import { EventEmitter, Output, Component, Input } from '@angular/core';
import { delegateCombine } from "igniteui-angular-core";
import { ShapeItemSearchMode_$type } from "./ShapeItemSearchMode";
import { IgxNumericXAxisComponent } from "./igx-numeric-x-axis-component";
import { IgxNumericYAxisComponent } from "./igx-numeric-y-axis-component";
import { IgxAssigningShapeStyleEventArgs } from "./igx-assigning-shape-style-event-args";
import { IgxAssigningShapeMarkerStyleEventArgs } from "./igx-assigning-shape-marker-style-event-args";
import { IgxStyleShapeEventArgs } from "./igx-style-shape-event-args";
import { IgxSeriesComponent } from "./igx-series-component";
import { ensureBool, ensureEnum, toPoint, fromPoint } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
 * Series class for rendering polygons.
*/
export let IgxShapeSeriesBaseComponent = /*@__PURE__*/ (() => {
    class IgxShapeSeriesBaseComponent extends IgxSeriesComponent {
        constructor() {
            super();
            this._assigningShapeStyle = null;
            this._assigningShapeMarkerStyle = null;
            this._styleShape = null;
        }
        /**
                                     * @hidden
                                     */
        get i() {
            return this._implementation;
        }
        /**
         * Gets or sets whether this Shape series should allow custom style overrides of its individual visuals.
        */
        get isCustomShapeStyleAllowed() {
            return this.i.rd;
        }
        set isCustomShapeStyleAllowed(v) {
            this.i.rd = ensureBool(v);
        }
        /**
         * Gets or sets whether this Shape series should allow custom style overrides of its individual marker visuals.
        */
        get isCustomShapeMarkerStyleAllowed() {
            return this.i.rc;
        }
        set isCustomShapeMarkerStyleAllowed(v) {
            this.i.rc = ensureBool(v);
        }
        get actualItemSearchMode() {
            return this.i.qx;
        }
        set actualItemSearchMode(v) {
            this.i.qx = ensureEnum(ShapeItemSearchMode_$type, v);
        }
        /**
         * Gets or sets the mode the series will use to find the closest point to the cursor.
        */
        get itemSearchMode() {
            return this.i.qz;
        }
        set itemSearchMode(v) {
            this.i.qz = ensureEnum(ShapeItemSearchMode_$type, v);
        }
        /**
         * Gets or sets the threshold to use when searching for items using ItemSearchMode.
        */
        get itemSearchThreshold() {
            return this.i.rv;
        }
        set itemSearchThreshold(v) {
            this.i.rv = +v;
        }
        /**
         * Gets or sets the points threshold to use when searching for items using ItemSearchMode.
        */
        get itemSearchPointsThreshold() {
            return this.i.ru;
        }
        set itemSearchPointsThreshold(v) {
            this.i.ru = +v;
        }
        /**
         * The name of the property on ItemsSource items which, for each shape, contains a list of points to be converted to a polygon.
         * To be consistent with the Shapefile technical description, it is expected that each list of points is defined as an IEnumerable of IEnumerable of Point, or in other words, a list of lists of points.
        */
        get shapeMemberPath() {
            return this.i.r5;
        }
        set shapeMemberPath(v) {
            this.i.r5 = v;
        }
        /**
         * Gets or sets the effective x-axis for the current ScatterBase object.
        */
        get xAxis() {
            const r = this.i.qt;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                let e = IgxNumericXAxisComponent._createFromInternal(r);
                if (e) {
                    e._implementation = r;
                }
                r.externalObject = e;
            }
            return r.externalObject;
        }
        set xAxis(v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.qt = null : this.i.qt = v.i;
        }
        /**
         * Gets or sets the effective y-axis for the current ScatterBase object.
        */
        get yAxis() {
            const r = this.i.qv;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                let e = IgxNumericYAxisComponent._createFromInternal(r);
                if (e) {
                    e._implementation = r;
                }
                r.externalObject = e;
            }
            return r.externalObject;
        }
        set yAxis(v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.qv = null : this.i.qv = v.i;
        }
        /**
         * The resolution at which to filter out shapes in the series.  For example, if the ShapeFilterResolution is set to 3, then elements with a bounding rectangle smaller than 3 X 3 pixels will be filtered out.
         * In the case of ScatterPolylineSeries, the resolution is compared to either dimension, rather than both.  In other words, a polyline will not be filtered if its height or its width exceeds the value of this property.  Whereas with a ShapeSeries, both the height and the width must exceed the value of this property.
        */
        get shapeFilterResolution() {
            return this.i.rr;
        }
        set shapeFilterResolution(v) {
            this.i.rr = +v;
        }
        /**
         * Gets whether or not this series is a shape series
        */
        get isShape() {
            return this.i.eg;
        }
        /**
         * Overridden by derived series classes to indicate when marker-less display is preferred or not.
        */
        get isMarkerlessDisplayPreferred() {
            return this.i.d5;
        }
        findByName(name) {
            var baseResult = super.findByName(name);
            if (baseResult) {
                return baseResult;
            }
            if (this.xAxis && this.xAxis.name && this.xAxis.name == name) {
                return this.xAxis;
            }
            if (this.yAxis && this.yAxis.name && this.yAxis.name == name) {
                return this.yAxis;
            }
            return null;
        }
        _styling(container, component, parent) {
            super._styling(container, component, parent);
            this._inStyling = true;
            if (this.xAxis && this.xAxis._styling) {
                this.xAxis._styling(container, component, this);
            }
            if (this.yAxis && this.yAxis._styling) {
                this.yAxis._styling(container, component, this);
            }
            this._inStyling = false;
        }
        getItemValue(item, memberPathName) {
            let iv = this.i.h1(item, memberPathName);
            return (iv);
        }
        getExactItemIndex(world) {
            let iv = this.i.f9(toPoint(world));
            return (iv);
        }
        getSeriesValuePosition(world, useInterpolation, skipUnknowns) {
            let iv = this.i.ps(toPoint(world), useInterpolation, skipUnknowns);
            return fromPoint(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.hy(toPoint(world));
            return (iv);
        }
        /**
         * Determine if object can be used as YAxis
        
        * @param axis  * The object to check
        */
        canUseAsYAxis(axis) {
            let iv = this.i.q8(axis);
            return (iv);
        }
        /**
         * Determine if object can be used as XAxis
        
        * @param axis  * The object to check
        */
        canUseAsXAxis(axis) {
            let iv = this.i.q7(axis);
            return (iv);
        }
        /**
         * Event raised when Assigning Shape Style. Note, if using this event, or highlighting, its best to avoid use of ShapeStyle/StyleShape/ShapeStyleSelector.
        */
        get assigningShapeStyle() {
            if (this._assigningShapeStyle == null) {
                this._assigningShapeStyle = new EventEmitter();
                this.i.assigningShapeStyle = delegateCombine(this.i.assigningShapeStyle, (o, e) => {
                    let outerArgs = new IgxAssigningShapeStyleEventArgs();
                    outerArgs._provideImplementation(e);
                    if (this.beforeAssigningShapeStyle) {
                        this.beforeAssigningShapeStyle(this, outerArgs);
                    }
                    this._assigningShapeStyle.emit({
                        sender: this,
                        args: outerArgs
                    });
                });
            }
            return this._assigningShapeStyle;
        }
        /**
         * Event raised when Assigning Shape Marker Style
        */
        get assigningShapeMarkerStyle() {
            if (this._assigningShapeMarkerStyle == null) {
                this._assigningShapeMarkerStyle = new EventEmitter();
                this.i.assigningShapeMarkerStyle = delegateCombine(this.i.assigningShapeMarkerStyle, (o, e) => {
                    let outerArgs = new IgxAssigningShapeMarkerStyleEventArgs();
                    outerArgs._provideImplementation(e);
                    if (this.beforeAssigningShapeMarkerStyle) {
                        this.beforeAssigningShapeMarkerStyle(this, outerArgs);
                    }
                    this._assigningShapeMarkerStyle.emit({
                        sender: this,
                        args: outerArgs
                    });
                });
            }
            return this._assigningShapeMarkerStyle;
        }
        /**
         * Raised when tile's image URI should be provided
        */
        get styleShape() {
            if (this._styleShape == null) {
                this._styleShape = new EventEmitter();
                this.i.styleShape = delegateCombine(this.i.styleShape, (o, e) => {
                    let outerArgs = new IgxStyleShapeEventArgs();
                    outerArgs._provideImplementation(e);
                    if (this.beforeStyleShape) {
                        this.beforeStyleShape(this, outerArgs);
                    }
                    this._styleShape.emit({
                        sender: this,
                        args: outerArgs
                    });
                });
            }
            return this._styleShape;
        }
    }
    IgxShapeSeriesBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxShapeSeriesBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    IgxShapeSeriesBaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxShapeSeriesBaseComponent, selector: "ng-component", inputs: { isCustomShapeStyleAllowed: "isCustomShapeStyleAllowed", isCustomShapeMarkerStyleAllowed: "isCustomShapeMarkerStyleAllowed", actualItemSearchMode: "actualItemSearchMode", itemSearchMode: "itemSearchMode", itemSearchThreshold: "itemSearchThreshold", itemSearchPointsThreshold: "itemSearchPointsThreshold", shapeMemberPath: "shapeMemberPath", xAxis: "xAxis", yAxis: "yAxis", shapeFilterResolution: "shapeFilterResolution" }, outputs: { assigningShapeStyle: "assigningShapeStyle", assigningShapeMarkerStyle: "assigningShapeMarkerStyle", styleShape: "styleShape" }, usesInheritance: true, ngImport: i0, template: ``, isInline: true });
    return IgxShapeSeriesBaseComponent;
})();
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxShapeSeriesBaseComponent, decorators: [{
            type: Component,
            args: [{
                    template: ``,
                }]
        }], ctorParameters: function () { return []; }, propDecorators: { isCustomShapeStyleAllowed: [{
                type: Input
            }], isCustomShapeMarkerStyleAllowed: [{
                type: Input
            }], actualItemSearchMode: [{
                type: Input
            }], itemSearchMode: [{
                type: Input
            }], itemSearchThreshold: [{
                type: Input
            }], itemSearchPointsThreshold: [{
                type: Input
            }], shapeMemberPath: [{
                type: Input
            }], xAxis: [{
                type: Input
            }], yAxis: [{
                type: Input
            }], shapeFilterResolution: [{
                type: Input
            }], assigningShapeStyle: [{
                type: Output
            }], assigningShapeMarkerStyle: [{
                type: Output
            }], styleShape: [{
                type: Output
            }] } });
