import { __extends } from "tslib";
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.
*/
var IgxShapeSeriesBaseComponent = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgxShapeSeriesBaseComponent, _super);
    function IgxShapeSeriesBaseComponent() {
        var _this = _super.call(this) || this;
        _this._assigningShapeStyle = null;
        _this._assigningShapeMarkerStyle = null;
        _this._styleShape = null;
        return _this;
    }
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "isCustomShapeStyleAllowed", {
        /**
         * Gets or sets whether this Shape series should allow custom style overrides of its individual visuals.
        */
        get: function () {
            return this.i.q9;
        },
        set: function (v) {
            this.i.q9 = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "isCustomShapeMarkerStyleAllowed", {
        /**
         * Gets or sets whether this Shape series should allow custom style overrides of its individual marker visuals.
        */
        get: function () {
            return this.i.q8;
        },
        set: function (v) {
            this.i.q8 = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "actualItemSearchMode", {
        get: function () {
            return this.i.qt;
        },
        set: function (v) {
            this.i.qt = ensureEnum(ShapeItemSearchMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "itemSearchMode", {
        /**
         * Gets or sets the mode the series will use to find the closest point to the cursor.
        */
        get: function () {
            return this.i.qv;
        },
        set: function (v) {
            this.i.qv = ensureEnum(ShapeItemSearchMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "itemSearchThreshold", {
        /**
         * Gets or sets the threshold to use when searching for items using ItemSearchMode.
        */
        get: function () {
            return this.i.rr;
        },
        set: function (v) {
            this.i.rr = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "itemSearchPointsThreshold", {
        /**
         * Gets or sets the points threshold to use when searching for items using ItemSearchMode.
        */
        get: function () {
            return this.i.rq;
        },
        set: function (v) {
            this.i.rq = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "shapeMemberPath", {
        /**
         * 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: function () {
            return this.i.r1;
        },
        set: function (v) {
            this.i.r1 = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "xAxis", {
        /**
         * Gets or sets the effective x-axis for the current ScatterBase object.
        */
        get: function () {
            var r = this.i.qp;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                var e = IgxNumericXAxisComponent._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.qp = null : this.i.qp = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "yAxis", {
        /**
         * Gets or sets the effective y-axis for the current ScatterBase object.
        */
        get: function () {
            var r = this.i.qr;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                var e = IgxNumericYAxisComponent._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.qr = null : this.i.qr = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "shapeFilterResolution", {
        /**
         * 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: function () {
            return this.i.rn;
        },
        set: function (v) {
            this.i.rn = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "isShape", {
        /**
         * Gets whether or not this series is a shape series
        */
        get: function () {
            return this.i.ee;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "isMarkerlessDisplayPreferred", {
        /**
         * Overridden by derived series classes to indicate when marker-less display is preferred or not.
        */
        get: function () {
            return this.i.d3;
        },
        enumerable: false,
        configurable: true
    });
    IgxShapeSeriesBaseComponent.prototype.findByName = function (name) {
        var baseResult = _super.prototype.findByName.call(this, 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;
    };
    IgxShapeSeriesBaseComponent.prototype._styling = function (container, component, parent) {
        _super.prototype._styling.call(this, 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;
    };
    IgxShapeSeriesBaseComponent.prototype.getItemValue = function (item, memberPathName) {
        var iv = this.i.hy(item, memberPathName);
        return (iv);
    };
    IgxShapeSeriesBaseComponent.prototype.getExactItemIndex = function (world) {
        var iv = this.i.f7(toPoint(world));
        return (iv);
    };
    IgxShapeSeriesBaseComponent.prototype.getSeriesValuePosition = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.pq(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.
    */
    IgxShapeSeriesBaseComponent.prototype.getItem = function (world) {
        var iv = this.i.hv(toPoint(world));
        return (iv);
    };
    /**
     * Determine if object can be used as YAxis
    
    * @param axis  * The object to check
    */
    IgxShapeSeriesBaseComponent.prototype.canUseAsYAxis = function (axis) {
        var iv = this.i.q4(axis);
        return (iv);
    };
    /**
     * Determine if object can be used as XAxis
    
    * @param axis  * The object to check
    */
    IgxShapeSeriesBaseComponent.prototype.canUseAsXAxis = function (axis) {
        var iv = this.i.q3(axis);
        return (iv);
    };
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "assigningShapeStyle", {
        /**
         * Event raised when Assigning Shape Style. Note, if using this event, or highlighting, its best to avoid use of ShapeStyle/StyleShape/ShapeStyleSelector.
        */
        get: function () {
            var _this = this;
            if (this._assigningShapeStyle == null) {
                this._assigningShapeStyle = new EventEmitter();
                this.i.assigningShapeStyle = delegateCombine(this.i.assigningShapeStyle, function (o, e) {
                    var outerArgs = new IgxAssigningShapeStyleEventArgs();
                    outerArgs._provideImplementation(e);
                    if (_this.beforeAssigningShapeStyle) {
                        _this.beforeAssigningShapeStyle(_this, outerArgs);
                    }
                    _this._assigningShapeStyle.emit({
                        sender: _this,
                        args: outerArgs
                    });
                });
            }
            return this._assigningShapeStyle;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "assigningShapeMarkerStyle", {
        /**
         * Event raised when Assigning Shape Marker Style
        */
        get: function () {
            var _this = this;
            if (this._assigningShapeMarkerStyle == null) {
                this._assigningShapeMarkerStyle = new EventEmitter();
                this.i.assigningShapeMarkerStyle = delegateCombine(this.i.assigningShapeMarkerStyle, function (o, e) {
                    var outerArgs = new IgxAssigningShapeMarkerStyleEventArgs();
                    outerArgs._provideImplementation(e);
                    if (_this.beforeAssigningShapeMarkerStyle) {
                        _this.beforeAssigningShapeMarkerStyle(_this, outerArgs);
                    }
                    _this._assigningShapeMarkerStyle.emit({
                        sender: _this,
                        args: outerArgs
                    });
                });
            }
            return this._assigningShapeMarkerStyle;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "styleShape", {
        /**
         * Raised when tile's image URI should be provided
        */
        get: function () {
            var _this = this;
            if (this._styleShape == null) {
                this._styleShape = new EventEmitter();
                this.i.styleShape = delegateCombine(this.i.styleShape, function (o, e) {
                    var outerArgs = new IgxStyleShapeEventArgs();
                    outerArgs._provideImplementation(e);
                    if (_this.beforeStyleShape) {
                        _this.beforeStyleShape(_this, outerArgs);
                    }
                    _this._styleShape.emit({
                        sender: _this,
                        args: outerArgs
                    });
                });
            }
            return this._styleShape;
        },
        enumerable: false,
        configurable: true
    });
    IgxShapeSeriesBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: IgxShapeSeriesBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    IgxShapeSeriesBaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", 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;
}(IgxSeriesComponent));
export { IgxShapeSeriesBaseComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", 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
            }] } });
