/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import * as tslib_1 from "tslib";
import { Base, runOn, delegateRemove, delegateCombine, markType } from "igniteui-webcomponents-core";
import { MinSummaryCalculator } from "igniteui-webcomponents-core";
import { MaxSummaryCalculator } from "igniteui-webcomponents-core";
import { SumSummaryCalculator } from "igniteui-webcomponents-core";
import { AverageSummaryCalculator } from "igniteui-webcomponents-core";
import { CountSummaryCalculator } from "igniteui-webcomponents-core";
import { BindingFormatter } from "igniteui-webcomponents-core";
import { FormatSummaryTextEventArgs } from "./FormatSummaryTextEventArgs";
/**
 * @hidden
 */
var ColumnSummaryDescription = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(ColumnSummaryDescription, _super);
    function ColumnSummaryDescription(a) {
        var _rest = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            _rest[_i - 1] = arguments[_i];
        }
        var _this = _super.call(this) || this;
        _this.r = false;
        _this.g = 0;
        _this.aa = null;
        _this.m = 0;
        _this.i = null;
        _this.x = null;
        _this.z = null;
        _this.ab = null;
        _this.b = null;
        _this.y = null;
        _this.a = null;
        _this.f = null;
        _this.e = null;
        _this.v = null;
        _this.s = 10;
        _this.formatText = null;
        _this.provideCalculator = null;
        _this.k = null;
        a = (a == void 0) ? 0 : a;
        switch (a) {
            case 0: break;
            case 1:
                {
                    var c = _rest[0];
                    _this.af = c;
                    _this.n = 4;
                }
                break;
            case 2:
                {
                    var c = _rest[0];
                    var d = _rest[1];
                    _this.af = c;
                    _this.n = d;
                }
                break;
        }
        return _this;
    }
    Object.defineProperty(ColumnSummaryDescription.prototype, "af", {
        get: function () {
            return this.aa;
        },
        set: function (a) {
            this.aa = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ColumnSummaryDescription.prototype, "n", {
        get: function () {
            return this.m;
        },
        set: function (a) {
            this.m = a;
            switch (this.m) {
                case 0:
                    this.j = new MinSummaryCalculator();
                    break;
                case 1:
                    this.j = new MaxSummaryCalculator();
                    break;
                case 2:
                    this.j = new SumSummaryCalculator();
                    break;
                case 3:
                    this.j = new AverageSummaryCalculator();
                    break;
                case 4:
                    this.j = new CountSummaryCalculator();
                    break;
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ColumnSummaryDescription.prototype, "j", {
        get: function () {
            return this.i;
        },
        set: function (a) {
            this.i = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ColumnSummaryDescription.prototype, "ac", {
        get: function () {
            return this.x;
        },
        set: function (a) {
            this.x = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ColumnSummaryDescription.prototype, "ae", {
        get: function () {
            return this.z;
        },
        set: function (a) {
            this.z = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ColumnSummaryDescription.prototype, "ag", {
        get: function () {
            return this.ab;
        },
        set: function (a) {
            this.ab = a;
            this.ah();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ColumnSummaryDescription.prototype, "d", {
        get: function () {
            return this.b;
        },
        set: function (a) {
            this.b = a;
            this.ah();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ColumnSummaryDescription.prototype, "ad", {
        get: function () {
            return this.y;
        },
        set: function (a) {
            this.y = a;
            this.ah();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ColumnSummaryDescription.prototype, "c", {
        get: function () {
            return this.a;
        },
        set: function (a) {
            this.a = a;
            this.ah();
        },
        enumerable: true,
        configurable: true
    });
    ColumnSummaryDescription.prototype.ah = function () {
        if (this.ag != null) {
            this.f = new BindingFormatter();
            this.f.j = this.ag;
            this.f.d = this.d;
        }
        else {
            this.f = null;
        }
        if (this.ad != null) {
            this.e = new BindingFormatter();
            this.e.j = this.ad;
            this.e.d = this.c;
        }
        else {
            this.e = null;
        }
    };
    Object.defineProperty(ColumnSummaryDescription.prototype, "w", {
        get: function () {
            return this.v;
        },
        set: function (a) {
            this.v = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ColumnSummaryDescription.prototype, "u", {
        get: function () {
            return this.s;
        },
        set: function (a) {
            this.s = a;
        },
        enumerable: true,
        configurable: true
    });
    ColumnSummaryDescription.prototype.equals = function (a) {
        var b = a;
        if (b == null) {
            return _super.prototype.equals.call(this, a);
        }
        return b.af == this.af && b.n == this.n;
    };
    ColumnSummaryDescription.prototype.getHashCode = function () {
        return Base.getHashCodeStatic(this.af) * 17 + this.n;
    };
    ColumnSummaryDescription.prototype.o = function (a, b, c) {
        var _this = this;
        var d = ((function () {
            var $ret = new FormatSummaryTextEventArgs();
            $ret.c = _this.af;
            $ret.b = _this.ae;
            $ret.a = a;
            $ret.d = b;
            $ret.e = c;
            return $ret;
        })());
        if (this.formatText != null) {
            this.formatText(this, d);
        }
        return d;
    };
    Object.defineProperty(ColumnSummaryDescription.prototype, "l", {
        get: function () {
            return this.k;
        },
        set: function (a) {
            var b = this.k;
            if (b != null) {
                b.provideCalculator = delegateRemove(b.provideCalculator, runOn(this, this.ai));
            }
            this.k = a;
            if (this.k != null) {
                var c = this.k;
                c.provideCalculator = delegateCombine(c.provideCalculator, runOn(this, this.ai));
            }
        },
        enumerable: true,
        configurable: true
    });
    ColumnSummaryDescription.prototype.ai = function (a, b) {
        if (this.provideCalculator != null) {
            this.provideCalculator(this, b);
            this.j = b.a;
        }
    };
    ColumnSummaryDescription.$t = markType(ColumnSummaryDescription, 'ColumnSummaryDescription');
    return ColumnSummaryDescription;
}(Base));
export { ColumnSummaryDescription };
//# sourceMappingURL=ColumnSummaryDescription.js.map
