import { __extends } from "tslib";
import { EventEmitter, Output, Component, Input } from '@angular/core';
import { delegateCombine } from "igniteui-angular-core";
import { IgxNumericAngleAxisComponent } from "./igx-numeric-angle-axis-component";
import { IgxNumericRadiusAxisComponent } from "./igx-numeric-radius-axis-component";
import { TrendLineType_$type } from "igniteui-angular-core";
import { ScatterItemSearchMode_$type } from "./ScatterItemSearchMode";
import { IgxAssigningPolarStyleEventArgs } from "./igx-assigning-polar-style-event-args";
import { IgxAssigningPolarMarkerStyleEventArgs } from "./igx-assigning-polar-marker-style-event-args";
import { IgxMarkerSeriesComponent } from "./igx-marker-series-component";
import { ensureBool, ensureEnum, brushToString, stringToBrush, toPoint, fromPoint } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
 * Represents the base class from which all IgxDataChartComponent polar series are derived.
*/
var IgxPolarBaseComponent = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgxPolarBaseComponent, _super);
    function IgxPolarBaseComponent() {
        var _this = _super.call(this) || this;
        _this._assigningPolarStyle = null;
        _this._assigningPolarMarkerStyle = null;
        return _this;
    }
    Object.defineProperty(IgxPolarBaseComponent.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "isPolar", {
        /**
         * Checks if this series is a polar series
        */
        get: function () {
            return this.i.d7;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "angleMemberPath", {
        /**
         * Gets or sets the path to use to find the angle values for the series.
        */
        get: function () {
            return this.i.ti;
        },
        set: function (v) {
            this.i.ti = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "radiusMemberPath", {
        /**
         * Gets or sets the path to use to get the radius values for the series.
        */
        get: function () {
            return this.i.tw;
        },
        set: function (v) {
            this.i.tw = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "angleAxis", {
        /**
         * Gets the effective angle axis for the current series object.
        */
        get: function () {
            var r = this.i.ry;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                var e = IgxNumericAngleAxisComponent._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.ry = null : this.i.ry = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "radiusAxis", {
        /**
         * Gets the effective radius axis for the current series object.
        */
        get: function () {
            var r = this.i.rz;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                var e = IgxNumericRadiusAxisComponent._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.rz = null : this.i.rz = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "useCartesianInterpolation", {
        /**
         * Gets or sets whether Cartesian Interpolation should be used rather than Archimedian
         * spiral based interpolation.
        */
        get: function () {
            return this.i.sy;
        },
        set: function (v) {
            this.i.sy = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "maximumMarkers", {
        /**
         * Gets or sets the maximum number of markers displayed by the current series.
         * If more than the specified number of markers are visible, the polar series will automatically
         * choose a representative set.
        */
        get: function () {
            return this.i.s8;
        },
        set: function (v) {
            this.i.s8 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "trendLineType", {
        /**
         * Gets or sets the trend type for the current series object.
        */
        get: function () {
            return this.i.sg;
        },
        set: function (v) {
            this.i.sg = ensureEnum(TrendLineType_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "trendLineBrush", {
        /**
         * Gets or sets the brush that specifies how the current series
         * object's trend line is drawn.
        */
        get: function () {
            return brushToString(this.i.uz);
        },
        set: function (v) {
            this.i.uz = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "actualTrendLineBrush", {
        /**
         * Gets the effective TrendLineBrush for this series.
        */
        get: function () {
            return brushToString(this.i.uy);
        },
        set: function (v) {
            this.i.uy = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "trendLineThickness", {
        /**
         * Gets or sets the thickness of the current series object's trend line.
        */
        get: function () {
            return this.i.s6;
        },
        set: function (v) {
            this.i.s6 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "trendLinePeriod", {
        /**
         * Gets or sets the moving average period for the current series object.
        */
        get: function () {
            return this.i.s9;
        },
        set: function (v) {
            this.i.s9 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "trendLineZIndex", {
        /**
         * Sets or Gets the Trendline Z index.
        */
        get: function () {
            return this.i.ta;
        },
        set: function (v) {
            this.i.ta = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "clipSeriesToBounds", {
        /**
         * Gets or sets whether to clip the series to the bounds.
         * Setting this to true can effect performance.
        */
        get: function () {
            return this.i.sp;
        },
        set: function (v) {
            this.i.sp = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "actualItemSearchMode", {
        get: function () {
            return this.i.sc;
        },
        set: function (v) {
            this.i.sc = ensureEnum(ScatterItemSearchMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "itemSearchMode", {
        /**
         * Gets or sets the mode the series will use to find the closest point to the cursor.
        */
        get: function () {
            return this.i.se;
        },
        set: function (v) {
            this.i.se = ensureEnum(ScatterItemSearchMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "itemSearchThreshold", {
        /**
         * Gets or sets the threshold to use when searching for items using ItemSearchMode.
        */
        get: function () {
            return this.i.s7;
        },
        set: function (v) {
            this.i.s7 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "isCustomPolarStyleAllowed", {
        /**
         * Gets or sets whether this Polar series should allow custom style overrides of its individual visuals.
        */
        get: function () {
            return this.i.ss;
        },
        set: function (v) {
            this.i.ss = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "isCustomPolarMarkerStyleAllowed", {
        /**
         * Gets or sets whether this Polar series should allow custom style overrides of its individual marker visuals.
        */
        get: function () {
            return this.i.sr;
        },
        set: function (v) {
            this.i.sr = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "radiusMemberAsLegendLabel", {
        /**
         * Gets or sets the label displayed before series' radius value in the Data Legend.
        */
        get: function () {
            return this.i.ts;
        },
        set: function (v) {
            this.i.ts = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "angleMemberAsLegendLabel", {
        /**
         * Gets or sets the label displayed before series' angle value in the Data Legend.
        */
        get: function () {
            return this.i.te;
        },
        set: function (v) {
            this.i.te = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "radiusMemberAsLegendUnit", {
        /**
         * Gets or sets the unit displayed after series' radius value in the Data Legend.
        */
        get: function () {
            return this.i.tu;
        },
        set: function (v) {
            this.i.tu = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "angleMemberAsLegendUnit", {
        /**
         * Gets or sets the unit displayed after series' angle value in the Data Legend.
        */
        get: function () {
            return this.i.tg;
        },
        set: function (v) {
            this.i.tg = v;
        },
        enumerable: false,
        configurable: true
    });
    IgxPolarBaseComponent.prototype.findByName = function (name) {
        var baseResult = _super.prototype.findByName.call(this, name);
        if (baseResult) {
            return baseResult;
        }
        if (this.angleAxis && this.angleAxis.name && this.angleAxis.name == name) {
            return this.angleAxis;
        }
        if (this.radiusAxis && this.radiusAxis.name && this.radiusAxis.name == name) {
            return this.radiusAxis;
        }
        return null;
    };
    IgxPolarBaseComponent.prototype._styling = function (container, component, parent) {
        _super.prototype._styling.call(this, container, component, parent);
        this._inStyling = true;
        if (this.angleAxis && this.angleAxis._styling) {
            this.angleAxis._styling(container, component, this);
        }
        if (this.radiusAxis && this.radiusAxis._styling) {
            this.radiusAxis._styling(container, component, this);
        }
        this._inStyling = false;
    };
    /**
     * Scrolls the requested item into view, if possible.
    
    * @param item  * The item to scroll into view.
    */
    IgxPolarBaseComponent.prototype.scrollIntoView = function (item) {
        var iv = this.i.eo(item);
        return (iv);
    };
    /**
     * Gets the item that is the best match for the specified world coordinates.
    
    * @param world  * The world coordinates to use.
    */
    IgxPolarBaseComponent.prototype.getItem = function (world) {
        var iv = this.i.hv(toPoint(world));
        return (iv);
    };
    /**
     * Gets the index of the item that resides at the provided world coordinates.
    
    * @param world  * The world coordinates of the requested item.
    */
    IgxPolarBaseComponent.prototype.getItemIndex = function (world) {
        var iv = this.i.hf(toPoint(world));
        return (iv);
    };
    IgxPolarBaseComponent.prototype.getExactItemIndex = function (world) {
        var iv = this.i.f7(toPoint(world));
        return (iv);
    };
    IgxPolarBaseComponent.prototype.getSeriesValuePosition = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.pq(toPoint(world), useInterpolation, skipUnknowns);
        return fromPoint(iv);
    };
    IgxPolarBaseComponent.prototype.getItemValue = function (item, memberPathName) {
        var iv = this.i.hy(item, memberPathName);
        return (iv);
    };
    /**
     * Determine if object can be used as RadiusAxis
    
    * @param axis  * The object to check
    */
    IgxPolarBaseComponent.prototype.canUseAsRadiusAxis = function (axis) {
        var iv = this.i.so(axis);
        return (iv);
    };
    /**
     * Determine if object can be used as AngleAxis
    
    * @param axis  * The object to check
    */
    IgxPolarBaseComponent.prototype.canUseAsAngleAxis = function (axis) {
        var iv = this.i.sn(axis);
        return (iv);
    };
    Object.defineProperty(IgxPolarBaseComponent.prototype, "assigningPolarStyle", {
        /**
         * Event raised when Assigning Category Style
        */
        get: function () {
            var _this = this;
            if (this._assigningPolarStyle == null) {
                this._assigningPolarStyle = new EventEmitter();
                this.i.assigningPolarStyle = delegateCombine(this.i.assigningPolarStyle, function (o, e) {
                    var outerArgs = new IgxAssigningPolarStyleEventArgs();
                    outerArgs._provideImplementation(e);
                    if (_this.beforeAssigningPolarStyle) {
                        _this.beforeAssigningPolarStyle(_this, outerArgs);
                    }
                    _this._assigningPolarStyle.emit({
                        sender: _this,
                        args: outerArgs
                    });
                });
            }
            return this._assigningPolarStyle;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxPolarBaseComponent.prototype, "assigningPolarMarkerStyle", {
        /**
         * Event raised when Assigning Polar Marker Style
        */
        get: function () {
            var _this = this;
            if (this._assigningPolarMarkerStyle == null) {
                this._assigningPolarMarkerStyle = new EventEmitter();
                this.i.assigningPolarMarkerStyle = delegateCombine(this.i.assigningPolarMarkerStyle, function (o, e) {
                    var outerArgs = new IgxAssigningPolarMarkerStyleEventArgs();
                    outerArgs._provideImplementation(e);
                    if (_this.beforeAssigningPolarMarkerStyle) {
                        _this.beforeAssigningPolarMarkerStyle(_this, outerArgs);
                    }
                    _this._assigningPolarMarkerStyle.emit({
                        sender: _this,
                        args: outerArgs
                    });
                });
            }
            return this._assigningPolarMarkerStyle;
        },
        enumerable: false,
        configurable: true
    });
    IgxPolarBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: IgxPolarBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    IgxPolarBaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: IgxPolarBaseComponent, selector: "ng-component", inputs: { angleMemberPath: "angleMemberPath", radiusMemberPath: "radiusMemberPath", angleAxis: "angleAxis", radiusAxis: "radiusAxis", useCartesianInterpolation: "useCartesianInterpolation", maximumMarkers: "maximumMarkers", trendLineType: "trendLineType", trendLineBrush: "trendLineBrush", actualTrendLineBrush: "actualTrendLineBrush", trendLineThickness: "trendLineThickness", trendLinePeriod: "trendLinePeriod", trendLineZIndex: "trendLineZIndex", clipSeriesToBounds: "clipSeriesToBounds", actualItemSearchMode: "actualItemSearchMode", itemSearchMode: "itemSearchMode", itemSearchThreshold: "itemSearchThreshold", isCustomPolarStyleAllowed: "isCustomPolarStyleAllowed", isCustomPolarMarkerStyleAllowed: "isCustomPolarMarkerStyleAllowed", radiusMemberAsLegendLabel: "radiusMemberAsLegendLabel", angleMemberAsLegendLabel: "angleMemberAsLegendLabel", radiusMemberAsLegendUnit: "radiusMemberAsLegendUnit", angleMemberAsLegendUnit: "angleMemberAsLegendUnit" }, outputs: { assigningPolarStyle: "assigningPolarStyle", assigningPolarMarkerStyle: "assigningPolarMarkerStyle" }, usesInheritance: true, ngImport: i0, template: "", isInline: true });
    return IgxPolarBaseComponent;
}(IgxMarkerSeriesComponent));
export { IgxPolarBaseComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: IgxPolarBaseComponent, decorators: [{
            type: Component,
            args: [{
                    template: "",
                }]
        }], ctorParameters: function () { return []; }, propDecorators: { angleMemberPath: [{
                type: Input
            }], radiusMemberPath: [{
                type: Input
            }], angleAxis: [{
                type: Input
            }], radiusAxis: [{
                type: Input
            }], useCartesianInterpolation: [{
                type: Input
            }], maximumMarkers: [{
                type: Input
            }], trendLineType: [{
                type: Input
            }], trendLineBrush: [{
                type: Input
            }], actualTrendLineBrush: [{
                type: Input
            }], trendLineThickness: [{
                type: Input
            }], trendLinePeriod: [{
                type: Input
            }], trendLineZIndex: [{
                type: Input
            }], clipSeriesToBounds: [{
                type: Input
            }], actualItemSearchMode: [{
                type: Input
            }], itemSearchMode: [{
                type: Input
            }], itemSearchThreshold: [{
                type: Input
            }], isCustomPolarStyleAllowed: [{
                type: Input
            }], isCustomPolarMarkerStyleAllowed: [{
                type: Input
            }], radiusMemberAsLegendLabel: [{
                type: Input
            }], angleMemberAsLegendLabel: [{
                type: Input
            }], radiusMemberAsLegendUnit: [{
                type: Input
            }], angleMemberAsLegendUnit: [{
                type: Input
            }], assigningPolarStyle: [{
                type: Output
            }], assigningPolarMarkerStyle: [{
                type: Output
            }] } });
