import { __extends } from "tslib";
import { EventEmitter, Output, Component, Input } from '@angular/core';
import { delegateCombine } from "igniteui-angular-core";
import { IgxCategoryAngleAxisComponent } from "./igx-category-angle-axis-component";
import { IgxNumericRadiusAxisComponent } from "./igx-numeric-radius-axis-component";
import { IgxAssigningRadialStyleEventArgs } from "./igx-assigning-radial-style-event-args";
import { IgxAssigningRadialMarkerStyleEventArgs } from "./igx-assigning-radial-marker-style-event-args";
import { IgxMarkerSeriesComponent } from "./igx-marker-series-component";
import { ensureBool, toPoint } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
 * Represents the base class for all IgxDataChartComponent radial series
*/
var IgxRadialBaseComponent = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgxRadialBaseComponent, _super);
    function IgxRadialBaseComponent() {
        var _this = _super.call(this) || this;
        _this._assigningRadialStyle = null;
        _this._assigningRadialMarkerStyle = null;
        return _this;
    }
    Object.defineProperty(IgxRadialBaseComponent.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "isRadial", {
        /**
         * Checks if this series is a radial series
        */
        get: function () {
            return this.i.ea;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "isCustomRadialStyleAllowed", {
        /**
         * Gets or sets whether this Radial series should allow custom style overrides of its individual visuals.
        */
        get: function () {
            return this.i.r6;
        },
        set: function (v) {
            this.i.r6 = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "isCustomRadialMarkerStyleAllowed", {
        /**
         * Gets or sets whether this Radial series should allow custom style overrides of its individual marker visuals.
        */
        get: function () {
            return this.i.r5;
        },
        set: function (v) {
            this.i.r5 = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "angleAxis", {
        /**
         * Gets the effective angle axis for the current series object.
        */
        get: function () {
            if (this.i.rk == null) {
                return null;
            }
            if (!this.i.rk.externalObject) {
                var e = IgxCategoryAngleAxisComponent._createFromInternal(this.i.rk);
                if (e) {
                    e._implementation = this.i.rk;
                }
                this.i.rk.externalObject = e;
            }
            return this.i.rk.externalObject;
        },
        set: function (v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.rk = null : this.i.rk = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "valueAxis", {
        /**
         * Gets the effective value axis for the current series object.
        */
        get: function () {
            if (this.i.rr == null) {
                return null;
            }
            if (!this.i.rr.externalObject) {
                var e = IgxNumericRadiusAxisComponent._createFromInternal(this.i.rr);
                if (e) {
                    e._implementation = this.i.rr;
                }
                this.i.rr.externalObject = e;
            }
            return this.i.rr.externalObject;
        },
        set: function (v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.rr = null : this.i.rr = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "clipSeriesToBounds", {
        /**
         * Gets or sets whether to clip the series to the bounds.
         * Setting this property to true will decrease chart performance.
        */
        get: function () {
            return this.i.r4;
        },
        set: function (v) {
            this.i.r4 = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    IgxRadialBaseComponent.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.valueAxis && this.valueAxis.name && this.valueAxis.name == name) {
            return this.valueAxis;
        }
        return null;
    };
    IgxRadialBaseComponent.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.valueAxis && this.valueAxis._styling) {
            this.valueAxis._styling(container, component, this);
        }
        this._inStyling = false;
    };
    /**
     * Determine if object can be used as ValueAxis
    
    * @param axis  * The object to check
    */
    IgxRadialBaseComponent.prototype.canUseAsValueAxis = function (axis) {
        var iv = this.i.r3(axis);
        return (iv);
    };
    /**
     * Determine if object can be used as AngleAxis
    
    * @param axis  * The object to check
    */
    IgxRadialBaseComponent.prototype.canUseAsAngleAxis = function (axis) {
        var iv = this.i.r2(axis);
        return (iv);
    };
    /**
     * Gets the item that is the best match for the specified world coordinates.
    
    * @param world  * The world coordinates to use.
    */
    IgxRadialBaseComponent.prototype.getItem = function (world) {
        var iv = this.i.ht(toPoint(world));
        return (iv);
    };
    /**
     * Gets the angle to the provided world position from the center of the radial series.
    
    * @param world  * The world position to get the angle for
    */
    IgxRadialBaseComponent.prototype.getAngleFromWorld = function (world) {
        var iv = this.i.sb(toPoint(world));
        return (iv);
    };
    /**
     * Gets the precise item index, if possible, based on the closeness to the previous or next whole integer. If the series cannot provide this information, GetExactItemIndex will return the same integer value as GetItemIndex.
    
    * @param world  * The world position for which to return the index.
    */
    IgxRadialBaseComponent.prototype.getExactItemIndex = function (world) {
        var iv = this.i.f5(toPoint(world));
        return (iv);
    };
    /**
     * Get the index of the item near the provided world coordinates.
    
    * @param world  * The world coordinates for which to getch the item index.
    */
    IgxRadialBaseComponent.prototype.getItemIndex = function (world) {
        var iv = this.i.hd(toPoint(world));
        return (iv);
    };
    /**
     * Scrolls the specified item into the view.
    
    * @param item  * The item to scroll into view.
    */
    IgxRadialBaseComponent.prototype.scrollIntoView = function (item) {
        var iv = this.i.en(item);
        return (iv);
    };
    /**
     * Returns the offset value for this series if grouped on a category axis.
    
    */
    IgxRadialBaseComponent.prototype.getOffsetValue = function () {
        var iv = this.i.getOffsetValue();
        return (iv);
    };
    /**
     * Returns the width of the category grouping this series is in.
    
    */
    IgxRadialBaseComponent.prototype.getCategoryWidth = function () {
        var iv = this.i.getCategoryWidth();
        return (iv);
    };
    Object.defineProperty(IgxRadialBaseComponent.prototype, "assigningRadialStyle", {
        /**
         * Event raised when Assigning Category Style
        */
        get: function () {
            var _this = this;
            if (this._assigningRadialStyle == null) {
                this._assigningRadialStyle = new EventEmitter();
                this.i.assigningRadialStyle = delegateCombine(this.i.assigningRadialStyle, function (o, e) {
                    var outerArgs = new IgxAssigningRadialStyleEventArgs();
                    outerArgs._provideImplementation(e);
                    if (_this.beforeAssigningRadialStyle) {
                        _this.beforeAssigningRadialStyle(_this, outerArgs);
                    }
                    _this._assigningRadialStyle.emit({
                        sender: _this,
                        args: outerArgs
                    });
                });
            }
            return this._assigningRadialStyle;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "assigningRadialMarkerStyle", {
        /**
         * Event raised when Assigning Radial Marker Style
        */
        get: function () {
            var _this = this;
            if (this._assigningRadialMarkerStyle == null) {
                this._assigningRadialMarkerStyle = new EventEmitter();
                this.i.assigningRadialMarkerStyle = delegateCombine(this.i.assigningRadialMarkerStyle, function (o, e) {
                    var outerArgs = new IgxAssigningRadialMarkerStyleEventArgs();
                    outerArgs._provideImplementation(e);
                    if (_this.beforeAssigningRadialMarkerStyle) {
                        _this.beforeAssigningRadialMarkerStyle(_this, outerArgs);
                    }
                    _this._assigningRadialMarkerStyle.emit({
                        sender: _this,
                        args: outerArgs
                    });
                });
            }
            return this._assigningRadialMarkerStyle;
        },
        enumerable: false,
        configurable: true
    });
    IgxRadialBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: IgxRadialBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    IgxRadialBaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: IgxRadialBaseComponent, selector: "ng-component", inputs: { isCustomRadialStyleAllowed: "isCustomRadialStyleAllowed", isCustomRadialMarkerStyleAllowed: "isCustomRadialMarkerStyleAllowed", angleAxis: "angleAxis", valueAxis: "valueAxis", clipSeriesToBounds: "clipSeriesToBounds" }, outputs: { assigningRadialStyle: "assigningRadialStyle", assigningRadialMarkerStyle: "assigningRadialMarkerStyle" }, usesInheritance: true, ngImport: i0, template: "", isInline: true });
    return IgxRadialBaseComponent;
}(IgxMarkerSeriesComponent));
export { IgxRadialBaseComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: IgxRadialBaseComponent, decorators: [{
            type: Component,
            args: [{
                    template: "",
                }]
        }], ctorParameters: function () { return []; }, propDecorators: { isCustomRadialStyleAllowed: [{
                type: Input
            }], isCustomRadialMarkerStyleAllowed: [{
                type: Input
            }], angleAxis: [{
                type: Input
            }], valueAxis: [{
                type: Input
            }], clipSeriesToBounds: [{
                type: Input
            }], assigningRadialStyle: [{
                type: Output
            }], assigningRadialMarkerStyle: [{
                type: Output
            }] } });
