import { __extends, __values } from "tslib";
import * as React from 'react';
import { ReactRenderer } from "igniteui-react-core";
import { TypeRegistrar, delegateRemove, delegateCombine } from "igniteui-react-core";
import { DataChartStylingDefaults } from './DataChartStylingDefaults';
import { XamFunnelChart } from './XamFunnelChart';
import { isValidProp, toSpinal, getModifiedProps, initializePropertiesFromCss, NamePatcher, fromBrushCollection, toBrushCollection, ensureBool, stringToBrush, brushToString, ensureEnum } from "igniteui-react-core";
import { Visibility_$type } from "igniteui-react-core";
import { OuterLabelAlignment_$type } from './OuterLabelAlignment';
import { FunnelSliceDisplay_$type } from './FunnelSliceDisplay';
import { IgrFunnelSliceClickedEventArgs } from './igr-funnel-slice-clicked-event-args';
import { IgrFunnelSliceEventArgs } from './igr-funnel-slice-event-args';
import { Style } from "igniteui-react-core";
var IgrFunnelChart = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgrFunnelChart, _super);
    function IgrFunnelChart(props) {
        var _this = _super.call(this, props) || this;
        _this._dataSource = null;
        _this.mounted = false;
        _this.__p = null;
        _this._hasUserValues = new Set();
        _this._stylingContainer = null;
        _this._stylingParent = null;
        _this._inStyling = false;
        _this._sliceClicked = null;
        _this._sliceClicked_wrapped = null;
        _this._sliceEnter = null;
        _this._sliceEnter_wrapped = null;
        _this._sliceLeave = null;
        _this._sliceLeave_wrapped = null;
        _this._sliceHover = null;
        _this._sliceHover_wrapped = null;
        if (_this._styling) {
            NamePatcher.ensureStylablePatched(Object.getPrototypeOf(_this));
        }
        _this._getMainRef = _this._getMainRef.bind(_this);
        var container;
        if (document) {
            container = document.createElement("div");
            container.style.display = "block";
            container.style.width = "100%";
            container.style.height = "100%";
        }
        _this._implementation = _this.createImplementation();
        var root;
        root = container;
        var ren = new ReactRenderer(root, document, true, DataChartStylingDefaults);
        _this.container = ren.getWrapper(container);
        _this._wrapper = ren;
        var chart = _this.i;
        _this._chart = chart;
        chart.provideContainer(ren);
        _this.bindData();
        if (props) {
            _this.initializeProperties();
        }
        chart.notifyResized();
        ren.addSizeWatcher(function () {
            _this._chart.notifyResized();
        });
        return _this;
    }
    Object.defineProperty(IgrFunnelChart.prototype, "height", {
        get: function () {
            return this._height;
        },
        set: function (value) {
            this._height = value;
            if (this._elRef) {
                this._elRef.style.height = value;
                this._chart.notifyResized();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "width", {
        get: function () {
            return this._width;
        },
        set: function (value) {
            this._width = value;
            if (this._elRef) {
                this._elRef.style.width = value;
                this._chart.notifyResized();
            }
        },
        enumerable: false,
        configurable: true
    });
    IgrFunnelChart.prototype._getMainRef = function (ref) {
        this._elRef = ref;
    };
    IgrFunnelChart.prototype.render = function () {
        var div = React.createElement("div", {
            className: "ig-funnel-chart igr-funnel-chart",
            ref: this._getMainRef
        });
        return div;
    };
    IgrFunnelChart.prototype.destroy = function () {
        this._chart.destroy();
        this._wrapper.destroy();
    };
    IgrFunnelChart.prototype.shouldComponentUpdate = function (nextProps, nextState) {
        var e_1, _a;
        var mod = getModifiedProps(this.props, nextProps);
        try {
            for (var _b = __values(Object.keys(mod)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var p = _c.value;
                if (isValidProp(this, p)) {
                    this[p] = mod[p];
                }
            }
        }
        catch (e_1_1) {
            e_1 = { error: e_1_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_1)
                    throw e_1.error;
            }
        }
        return true;
    };
    IgrFunnelChart.prototype.initializeProperties = function () {
        var e_2, _a;
        try {
            for (var _b = __values(Object.keys(this.props)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var p = _c.value;
                if (isValidProp(this, p)) {
                    this[p] = this.props[p];
                }
            }
        }
        catch (e_2_1) {
            e_2 = { error: e_2_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_2)
                    throw e_2.error;
            }
        }
    };
    IgrFunnelChart.prototype.componentDidMount = function () {
        this._elRef.style.width = this._width ? this._width : "";
        this._elRef.style.height = this._height ? this._height : "";
        this._elRef.appendChild(this.container.getNativeElement());
        this._styling(this._elRef, this);
        this._chart.notifyResized();
    };
    IgrFunnelChart.prototype.componentWillUnmount = function () {
        this.destroy();
    };
    IgrFunnelChart.prototype.createImplementation = function () {
        return new XamFunnelChart();
    };
    IgrFunnelChart.prototype.createSeriesComponent = function (type) {
        if (TypeRegistrar.isRegistered(type)) {
            var s = TypeRegistrar.create(type);
            s.owner = this;
            s._provideRenderer(this._wrapper);
            return s;
        }
        else {
            //we shouldn't get here, hopefully.
            throw Error("series type not loaded: " + type);
        }
    };
    Object.defineProperty(IgrFunnelChart.prototype, "dataSource", {
        get: function () {
            return this._dataSource;
        },
        set: function (value) {
            this._dataSource = value;
            this.bindData();
        },
        enumerable: false,
        configurable: true
    });
    IgrFunnelChart.prototype.bindData = function () {
        if (this._chart != null && this._chart !== undefined) {
            this._chart.itemsSource = this._dataSource;
        }
    };
    Object.defineProperty(IgrFunnelChart.prototype, "legend", {
        /**
         * Gets or sets the legend used for the current chart.
        */
        get: function () {
            if (this.i.legend != null)
                return this.i.legend.externalObject;
        },
        set: function (v) {
            if (v != undefined && v != null)
                this.i.legend = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "i", {
        /**
         * @hidden
         */
        get: function () {
            return this._implementation;
        } /**
                                     * @hidden
                                     */,
        enumerable: false,
        configurable: true
    });
    IgrFunnelChart._createFromInternal = function (internal) {
        if (!internal) {
            return null;
        }
        if (!internal.$type) {
            return null;
        }
        var name = internal.$type.name;
        var externalName = "Igr" + name;
        if (!TypeRegistrar.isRegistered(externalName)) {
            return null;
        }
        return TypeRegistrar.create(externalName);
    };
    Object.defineProperty(IgrFunnelChart.prototype, "valueMemberPath", {
        /**
     * Gets or sets the value member path for the funnel chart.
    */
        get: function () {
            return this.i.c9;
        },
        set: function (v) {
            this.i.c9 = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "brushes", {
        /**
         * Gets or sets the palette of brushes to use for coloring the slices.
        */
        get: function () {
            return fromBrushCollection(this.i.ah);
        },
        set: function (v) {
            this.i.ah = toBrushCollection(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "outlines", {
        /**
         * Gets or sets the palette of brushes to use for outlines on the slices.
        */
        get: function () {
            return fromBrushCollection(this.i.ai);
        },
        set: function (v) {
            this.i.ai = toBrushCollection(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "bottomEdgeWidth", {
        /**
         * Gets or sets the percentage (from near 0 to 1) of space the bottom edge of the funnel should take.
        */
        get: function () {
            return this.i.bo;
        },
        set: function (v) {
            this.i.bo = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "innerLabelMemberPath", {
        /**
         * Gets or sets the InnerLabel mapping property for the current series object.
        */
        get: function () {
            return this.i.cd;
        },
        set: function (v) {
            this.i.cd = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "outerLabelMemberPath", {
        /**
         * Gets or sets the OuterLabel mapping property for the current series object.
        */
        get: function () {
            return this.i.co;
        },
        set: function (v) {
            this.i.co = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "innerLabelVisibility", {
        /**
         * Gets or sets whether the inner labels are visible.
        */
        get: function () {
            return this.i.ez;
        },
        set: function (v) {
            this.i.ez = ensureEnum(Visibility_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "outerLabelVisibility", {
        /**
         * Gets or sets whether the outer labels are visible.
        */
        get: function () {
            return this.i.e0;
        },
        set: function (v) {
            this.i.e0 = ensureEnum(Visibility_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "outerLabelAlignment", {
        /**
         * Gets or sets which side of the chart the outer labels should appear.
        */
        get: function () {
            return this.i.au;
        },
        set: function (v) {
            this.i.au = ensureEnum(OuterLabelAlignment_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "funnelSliceDisplay", {
        /**
         * Gets or sets how the heights of the funnel slices should be configured.
        */
        get: function () {
            return this.i.ak;
        },
        set: function (v) {
            this.i.ak = ensureEnum(FunnelSliceDisplay_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "formatInnerLabel", {
        /**
         * Gets or sets the formatter function for inner labels. Function should return string and it takes 3 parameters: 1st-value of item to format, 2nd-index of item within data, 3rd-reference to the funnel chart.
        */
        get: function () {
            return this.i.bw;
        },
        set: function (v) {
            this.i.bw = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "formatOuterLabel", {
        /**
         * Gets or sets the formatter function for outer labels. Function should return string and it takes 3 parameters: 1st-value of item to format, 2nd-index of item within data, 3rd-reference to the funnel chart.
        */
        get: function () {
            return this.i.bx;
        },
        set: function (v) {
            this.i.bx = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "transitionDuration", {
        /**
         * Gets or sets how long the animations should take to run.
        */
        get: function () {
            return this.i.by;
        },
        set: function (v) {
            this.i.by = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "isInverted", {
        /**
         * Gets or sets if the funnel should be rendered inverted.
        */
        get: function () {
            return this.i.bd;
        },
        set: function (v) {
            this.i.bd = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "useBezierCurve", {
        /**
         * Gets or sets whether to use a Bezier curve to define the funnel.
        */
        get: function () {
            return this.i.be;
        },
        set: function (v) {
            this.i.be = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "allowSliceSelection", {
        /**
         * Gets or sets whether to allow slices to be selected.
        */
        get: function () {
            return this.i.a8;
        },
        set: function (v) {
            this.i.a8 = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "useUnselectedStyle", {
        /**
         * Gets or sets whether to use the unselected style on unselected slices.
        */
        get: function () {
            return this.i.bg;
        },
        set: function (v) {
            this.i.bg = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "selectedSliceFill", {
        /**
         * Gets or sets the fill brush.
        */
        get: function () {
            return this.i.ex ? this.i.ex.fill : null;
        },
        set: function (v) {
            this.ensureSelectedSliceStyle();
            this.i.ex.fill = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "selectedSliceStroke", {
        /**
         * Gets or sets the stroke brush.
        */
        get: function () {
            return this.i.ex ? this.i.ex.stroke : null;
        },
        set: function (v) {
            this.ensureSelectedSliceStyle();
            this.i.ex.stroke = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "selectedSliceStrokeThickness", {
        /**
         * Gets or sets the stroke thickness.
        */
        get: function () {
            return this.i.ex ? this.i.ex.strokeThickness : NaN;
        },
        set: function (v) {
            this.ensureSelectedSliceStyle();
            this.i.ex.strokeThickness = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "selectedSliceOpacity", {
        /**
         * Gets or sets the opacity.
        */
        get: function () {
            return this.i.ex ? this.i.ex.opacity : NaN;
        },
        set: function (v) {
            this.ensureSelectedSliceStyle();
            this.i.ex.opacity = +v;
        },
        enumerable: false,
        configurable: true
    });
    IgrFunnelChart.prototype.ensureSelectedSliceStyle = function () {
        if (this.i.ex) {
            return;
        }
        this.i.ex = new Style();
    };
    Object.defineProperty(IgrFunnelChart.prototype, "unselectedSliceFill", {
        /**
         * Gets or sets the fill brush.
        */
        get: function () {
            return this.i.ey ? this.i.ey.fill : null;
        },
        set: function (v) {
            this.ensureUnselectedSliceStyle();
            this.i.ey.fill = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "unselectedSliceStroke", {
        /**
         * Gets or sets the stroke brush.
        */
        get: function () {
            return this.i.ey ? this.i.ey.stroke : null;
        },
        set: function (v) {
            this.ensureUnselectedSliceStyle();
            this.i.ey.stroke = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "unselectedSliceStrokeThickness", {
        /**
         * Gets or sets the stroke thickness.
        */
        get: function () {
            return this.i.ey ? this.i.ey.strokeThickness : NaN;
        },
        set: function (v) {
            this.ensureUnselectedSliceStyle();
            this.i.ey.strokeThickness = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "unselectedSliceOpacity", {
        /**
         * Gets or sets the opacity.
        */
        get: function () {
            return this.i.ey ? this.i.ey.opacity : NaN;
        },
        set: function (v) {
            this.ensureUnselectedSliceStyle();
            this.i.ey.opacity = +v;
        },
        enumerable: false,
        configurable: true
    });
    IgrFunnelChart.prototype.ensureUnselectedSliceStyle = function () {
        if (this.i.ey) {
            return;
        }
        this.i.ey = new Style();
    };
    Object.defineProperty(IgrFunnelChart.prototype, "legendItemBadgeTemplate", {
        /**
         * Gets or sets the LegendItemBadgeTemplate to use for the legend items.
        */
        get: function () {
            return this.i.legendItemBadgeTemplate;
        },
        set: function (v) {
            this.i.legendItemBadgeTemplate = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "useOuterLabelsForLegend", {
        /**
         * Gets or sets whether to use the outer labels to identify the legend items.
        */
        get: function () {
            return this.i.bf;
        },
        set: function (v) {
            this.i.bf = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "textStyle", {
        /**
         * Gets or sets the text style for inner labels
        */
        get: function () {
            return this.i.cz;
        },
        set: function (v) {
            this.i.cz = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "outerLabelTextStyle", {
        /**
         * Gets or sets the text style for outer labels
        */
        get: function () {
            return this.i.cr;
        },
        set: function (v) {
            this.i.cr = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "outlineThickness", {
        /**
         * Gets or sets the thickness of outline around slices.
        */
        get: function () {
            return this.i.bq;
        },
        set: function (v) {
            this.i.bq = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "pixelScalingRatio", {
        /**
         * Gets or sets the scaling value used to affect the pixel density of the control.
         * A higher scaling ratio will produce crisper visuals at the expense of memory.  Lower values will cause the control
         * to appear blurry.
        */
        get: function () {
            return this.i.bs;
        },
        set: function (v) {
            this.i.bs = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "outerLabelTextColor", {
        /**
         * Gets or sets the brush used for the outer labels.
        */
        get: function () {
            return brushToString(this.i.et);
        },
        set: function (v) {
            this.i.et = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "textColor", {
        /**
         * Gets or sets the brush used for the inner labels.
        */
        get: function () {
            return brushToString(this.i.eu);
        },
        set: function (v) {
            this.i.eu = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    IgrFunnelChart.prototype.findByName = function (name) {
        if (this.findEphemera) {
            if (name && name.indexOf("@@e:") == 0) {
                return this.findEphemera(name);
            }
        }
        return null;
    };
    Object.defineProperty(IgrFunnelChart.prototype, "hasUserValues", {
        get: function () {
            return this._hasUserValues;
        },
        enumerable: false,
        configurable: true
    });
    IgrFunnelChart.prototype.__m = function (propertyName) {
        if (!this._inStyling) {
            this._hasUserValues.add(propertyName);
        }
    };
    IgrFunnelChart.prototype._styling = function (container, component, parent) {
        if (this._inStyling) {
            return;
        }
        this._inStyling = true;
        this._stylingContainer = container;
        this._stylingParent = component;
        var genericPrefix = "";
        var typeName = this.i.$type.name;
        if (typeName.indexOf("Xam") === 0) {
            typeName = typeName.substring(3);
        }
        genericPrefix = toSpinal("FunnelChart");
        var additionalPrefixes = [];
        var prefix = toSpinal(typeName);
        additionalPrefixes.push(prefix + "-");
        var b = this.i.$type.baseType;
        while (b && b.name != "Object" &&
            b.name != "Base" &&
            b.name != "Control" &&
            b.Name != "DependencyObject" &&
            b.Name != "FrameworkElement") {
            typeName = b.name;
            if (typeName.indexOf("Xam") === 0) {
                typeName = typeName.substring(3);
            }
            var basePrefix = toSpinal(typeName);
            additionalPrefixes.push(basePrefix + "-");
            b = b.baseType;
        }
        if (parent) {
            var parentTypeName = parent.i.$type.name;
            if (parentTypeName.indexOf("Xam") === 0) {
                parentTypeName = parentTypeName.substring(3);
            }
            var parentPrefix = toSpinal(parentTypeName);
            additionalPrefixes.push(parentPrefix + "-" + genericPrefix + "-");
            additionalPrefixes.push(parentPrefix + "-" + prefix + "-");
        }
        initializePropertiesFromCss(container, this, genericPrefix + "-", this.hasUserValues, false, additionalPrefixes);
        if (this._otherStyling) {
            this._otherStyling(container, component, parent);
        }
        this._inStyling = false;
    };
    /**
 * Use to force the funnel chart to finish any deferred work before printing or evaluating its visual.
 * This should only be called if the visual of the funnel chart needs to be synchronously saved or evaluated.
 * Calling this method too often will hinder the performance of the funnel chart.

*/
    IgrFunnelChart.prototype.flush = function () {
        this.i.dd();
    };
    /**
     * Provides container for funnel chart
    
    */
    IgrFunnelChart.prototype.provideContainer = function (container) {
        this.i.provideContainer(container);
    };
    /**
     * Notifies the controller and view about a size change.
    
    */
    IgrFunnelChart.prototype.notifyResized = function () {
        this.i.notifyResized();
    };
    IgrFunnelChart.prototype.notifySetItem = function (source_, index, oldItem, newItem) {
        this.i.dm(source_, index, oldItem, newItem);
    };
    /**
     * Manually notifies the chart's data source that the data it has bound to has been cleared and needs to be re-examined.
     * This should not be called if the data that the chart is bound to is already observable.
    
    */
    IgrFunnelChart.prototype.notifyClearItems = function (source_) {
        this.i.dh(source_);
    };
    IgrFunnelChart.prototype.notifyInsertItem = function (source_, index, newItem) {
        this.i.dj(source_, index, newItem);
    };
    IgrFunnelChart.prototype.notifyRemoveItem = function (source_, index, oldItem) {
        this.i.dk(source_, index, oldItem);
    };
    /**
     * Toggle selection of item at index.
    
    */
    IgrFunnelChart.prototype.toggleSelection = function (index) {
        this.i.dz(index);
    };
    /**
     * Exports and serializes the chart visuals.
    
    */
    IgrFunnelChart.prototype.exportSerializedVisualData = function () {
        var iv = this.i.b7();
        return (iv);
    };
    Object.defineProperty(IgrFunnelChart.prototype, "sliceClicked", {
        /**
         * Event which is raised when a slice is clicked.
         * Function takes first argument null and second argument ui.
         * Use ui.owner to obtain reference to igFunnelChart.
         * Use ui.index to obtain index of clicked slice.
         * Use ui.item to obtain reference to clicked slice item.
         * Use ui.selected to check if slice became selected.
        */
        get: function () {
            return this._sliceClicked;
        },
        set: function (ev) {
            var _this = this;
            if (this._sliceClicked_wrapped !== null) {
                this.i.sliceClicked = delegateRemove(this.i.sliceClicked, this._sliceClicked_wrapped);
                this._sliceClicked_wrapped = null;
                this._sliceClicked = null;
            }
            this._sliceClicked = ev;
            this._sliceClicked_wrapped = function (o, e) {
                var outerArgs = new IgrFunnelSliceClickedEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeSliceClicked) {
                    _this.beforeSliceClicked(_this, outerArgs);
                }
                if (_this._sliceClicked) {
                    _this._sliceClicked(_this, outerArgs);
                }
            };
            this.i.sliceClicked = delegateCombine(this.i.sliceClicked, this._sliceClicked_wrapped);
            ;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "sliceEnter", {
        /**
         * Raised when a funnel slice is entered.
        */
        get: function () {
            return this._sliceEnter;
        },
        set: function (ev) {
            var _this = this;
            if (this._sliceEnter_wrapped !== null) {
                this.i.sliceEnter = delegateRemove(this.i.sliceEnter, this._sliceEnter_wrapped);
                this._sliceEnter_wrapped = null;
                this._sliceEnter = null;
            }
            this._sliceEnter = ev;
            this._sliceEnter_wrapped = function (o, e) {
                var outerArgs = new IgrFunnelSliceEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeSliceEnter) {
                    _this.beforeSliceEnter(_this, outerArgs);
                }
                if (_this._sliceEnter) {
                    _this._sliceEnter(_this, outerArgs);
                }
            };
            this.i.sliceEnter = delegateCombine(this.i.sliceEnter, this._sliceEnter_wrapped);
            ;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "sliceLeave", {
        /**
         * Raised when a funnel slice is left.
        */
        get: function () {
            return this._sliceLeave;
        },
        set: function (ev) {
            var _this = this;
            if (this._sliceLeave_wrapped !== null) {
                this.i.sliceLeave = delegateRemove(this.i.sliceLeave, this._sliceLeave_wrapped);
                this._sliceLeave_wrapped = null;
                this._sliceLeave = null;
            }
            this._sliceLeave = ev;
            this._sliceLeave_wrapped = function (o, e) {
                var outerArgs = new IgrFunnelSliceEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeSliceLeave) {
                    _this.beforeSliceLeave(_this, outerArgs);
                }
                if (_this._sliceLeave) {
                    _this._sliceLeave(_this, outerArgs);
                }
            };
            this.i.sliceLeave = delegateCombine(this.i.sliceLeave, this._sliceLeave_wrapped);
            ;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrFunnelChart.prototype, "sliceHover", {
        /**
         * Raised when a funnel slice is hovered.
        */
        get: function () {
            return this._sliceHover;
        },
        set: function (ev) {
            var _this = this;
            if (this._sliceHover_wrapped !== null) {
                this.i.sliceHover = delegateRemove(this.i.sliceHover, this._sliceHover_wrapped);
                this._sliceHover_wrapped = null;
                this._sliceHover = null;
            }
            this._sliceHover = ev;
            this._sliceHover_wrapped = function (o, e) {
                var outerArgs = new IgrFunnelSliceEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeSliceHover) {
                    _this.beforeSliceHover(_this, outerArgs);
                }
                if (_this._sliceHover) {
                    _this._sliceHover(_this, outerArgs);
                }
            };
            this.i.sliceHover = delegateCombine(this.i.sliceHover, this._sliceHover_wrapped);
            ;
        },
        enumerable: false,
        configurable: true
    });
    return IgrFunnelChart;
}(React.Component));
export { IgrFunnelChart };
