/*
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 { __extends, __values } from "tslib";
import { ISupportsDataChangeNotifications_$type } from "./ISupportsDataChangeNotifications";
import { IDataSourceSupportsCount_$type } from "./IDataSourceSupportsCount";
import { IDataSourceDataProviderUpdateNotifier_$type } from "./IDataSourceDataProviderUpdateNotifier";
import { SortDescriptionCollection } from "./SortDescriptionCollection";
import { DataSourceSummaryScope_$type } from "./DataSourceSummaryScope";
import { Base, Type, markType, typeGetValue, PropertyChangedEventArgs, runOn, delegateCombine, typeCast, fromEnum, String_$type, delegateRemove, enumGetBox } from "./type";
import { SyncableObservableCollection$1 } from "./SyncableObservableCollection$1";
import { IDataSourceSupportsIndexedAccess_$type } from "./IDataSourceSupportsIndexedAccess";
import { DataSourceSectionHeaderDisplayMode_$type } from "./DataSourceSectionHeaderDisplayMode";
import { DataSourceSchemaChangedEventArgs } from "./DataSourceSchemaChangedEventArgs";
import { DataSourceRowExpansionChangedEventArgs } from "./DataSourceRowExpansionChangedEventArgs";
import { Convert } from "./Convert";
import { truncate, isNaN_ } from "./number";
import { toOADate, fromOADate } from "./dateExtended";
import { DefaultSummaryResult } from "./DefaultSummaryResult";
import { stringCompare } from "./string";
import { ArgumentNullException } from "./ArgumentNullException";
import { IEditableDataSource_$type } from "./IEditableDataSource";
import { TransactionService } from "./TransactionService";
import { TransactionKeyEqualityComparer } from "./TransactionKeyEqualityComparer";
import { Transaction } from "./Transaction";
import { DataSourceSpecialRow } from "./DataSourceSpecialRow";
import { List$1 } from "./List$1";
import { Dictionary$2 } from "./Dictionary$2";
import { DataSourceAggregatedResult } from "./DataSourceAggregatedResult";
import { DataSourceDataCommittedEventArgs } from "./DataSourceDataCommittedEventArgs";
import { Localization } from "./Localization";
import { TransactionType } from "./TransactionType";
import { stringFormat } from "./stringExtended";
/**
 * @hidden
 */
export var IDataSourceDataProvider_$type = new Type(null, 'IDataSourceDataProvider', null, [ISupportsDataChangeNotifications_$type, IDataSourceSupportsCount_$type]);
/**
 * @hidden
 */
export var IFilterExpression_$type = new Type(null, 'IFilterExpression');
/**
 * @hidden
 */
var FilterExpressionCollection = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FilterExpressionCollection, _super);
    function FilterExpressionCollection() {
        var _this = _super.call(this) || this;
        _this.a = null;
        _this.f = null;
        _this.f = new SyncableObservableCollection$1(IFilterExpression_$type);
        return _this;
    }
    Object.defineProperty(FilterExpressionCollection.prototype, "syncTarget", {
        get: function () {
            return this.a;
        },
        set: function (a) {
            if (a == null) {
                this.f.syncTarget = null;
                this.a = null;
                return;
            }
            this.a = a;
            this.f.syncTarget = this.a.f;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FilterExpressionCollection.prototype, "shouldDetachOnTargetChange", {
        get: function () {
            return this.f.shouldDetachOnTargetChange;
        },
        set: function (a) {
            this.f.shouldDetachOnTargetChange = a;
        },
        enumerable: false,
        configurable: true
    });
    FilterExpressionCollection.prototype.add = function (a) {
        return this.f.add(a);
    };
    FilterExpressionCollection.prototype.insert = function (a, b) {
        this.f.add1(a, b);
    };
    FilterExpressionCollection.prototype.clear = function () {
        this.f.clear();
    };
    FilterExpressionCollection.prototype.get = function (a) {
        return this.f.get(a);
    };
    FilterExpressionCollection.prototype.indexOf = function (a) {
        return this.f.indexOf(a);
    };
    FilterExpressionCollection.prototype.remove = function (a) {
        return this.f.remove1(a);
    };
    FilterExpressionCollection.prototype.removeAt = function (a) {
        return this.f.remove(a);
    };
    FilterExpressionCollection.prototype.set = function (a, b) {
        return this.f.set(a, b);
    };
    FilterExpressionCollection.prototype.size = function () {
        return this.f.size();
    };
    Object.defineProperty(FilterExpressionCollection.prototype, "onChanged", {
        get: function () {
            return this.f.f;
        },
        set: function (a) {
            this.f.f = a;
        },
        enumerable: false,
        configurable: true
    });
    FilterExpressionCollection.prototype.n = function (a) {
        this.f.addListener(a);
    };
    FilterExpressionCollection.prototype.q = function (a) {
        this.f.removeListener(a);
    };
    Object.defineProperty(FilterExpressionCollection.prototype, "k", {
        get: function () {
            return this.f.all;
        },
        enumerable: false,
        configurable: true
    });
    FilterExpressionCollection.$t = markType(FilterExpressionCollection, 'FilterExpressionCollection');
    return FilterExpressionCollection;
}(Base));
export { FilterExpressionCollection };
/**
 * @hidden
 */
export var IDataSource_$type = new Type(null, 'IDataSource', null, [ISupportsDataChangeNotifications_$type, IDataSourceSupportsIndexedAccess_$type]);
/**
 * @hidden
 */
var SummaryCalculator = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SummaryCalculator, _super);
    function SummaryCalculator() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this._propertyName = null;
        _this._propertyType = 0;
        _this._dataSource = null;
        _this._isSummaryDirty = false;
        _this.b = 5;
        return _this;
    }
    Object.defineProperty(SummaryCalculator.prototype, "propertyName", {
        get: function () {
            return this._propertyName;
        },
        set: function (a) {
            this._propertyName = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SummaryCalculator.prototype, "propertyType", {
        get: function () {
            return this._propertyType;
        },
        set: function (a) {
            this._propertyType = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SummaryCalculator.prototype, "dataSource", {
        get: function () {
            return this._dataSource;
        },
        set: function (a) {
            this._dataSource = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SummaryCalculator.prototype, "isSummaryDirty", {
        get: function () {
            return this._isSummaryDirty;
        },
        set: function (a) {
            this._isSummaryDirty = a;
        },
        enumerable: false,
        configurable: true
    });
    SummaryCalculator.prototype.get_operand = function () {
        return this.b;
    };
    Object.defineProperty(SummaryCalculator.prototype, "operand", {
        get: function () {
            return this.get_operand();
        },
        enumerable: false,
        configurable: true
    });
    SummaryCalculator.prototype.beginCalculation = function (a, b) {
        this.dataSource = a;
        this.propertyName = b;
        if (this.propertyName != null) {
            this.propertyType = a.resolveSchemaPropertyType(this.propertyName);
        }
        this.isSummaryDirty = false;
    };
    SummaryCalculator.prototype.endCalculation = function () {
        return null;
    };
    SummaryCalculator.prototype.aggregate = function (a) {
    };
    SummaryCalculator.prototype.itemAdded = function (a, b, c) {
        return b;
    };
    SummaryCalculator.prototype.itemRemoved = function (a, b, c) {
        return b;
    };
    SummaryCalculator.prototype.i = function (a) {
        if (this.dataSource == null) {
            return NaN;
        }
        var b = this.dataSource.getItemProperty(a, this.propertyName);
        if (b == null) {
            return NaN;
        }
        return this.j(b);
    };
    SummaryCalculator.prototype.j = function (a) {
        if (a == null) {
            return NaN;
        }
        switch (this.propertyType) {
            case 6: return a;
            case 5: return a;
            case 1: return typeGetValue(a);
            case 3: return typeGetValue(a);
            case 4: return typeGetValue(a);
            case 7: return a;
            case 8: return toOADate(a);
            case 11: try {
                return Convert.toDouble3(a);
            }
            catch (b) {
                return NaN;
            }
        }
        return 0;
    };
    SummaryCalculator.prototype.k = function (a) {
        switch (this.propertyType) {
            case 6: return a;
            case 5: return a;
            case 1: return truncate(a);
            case 3: return truncate(a);
            case 4: return truncate(a);
            case 7: return a;
            case 8: return fromOADate(a);
            default: return a;
        }
    };
    SummaryCalculator.$t = markType(SummaryCalculator, 'SummaryCalculator');
    return SummaryCalculator;
}(Base));
export { SummaryCalculator };
/**
 * @hidden
 */
var SumSummaryCalculator = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SumSummaryCalculator, _super);
    function SumSummaryCalculator() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.p = 0;
        return _this;
    }
    SumSummaryCalculator.prototype.get_displayName = function () {
        var a = BaseDataSource.ba("DataSource_Summary_Sum");
        return a != null ? a : "Sum";
    };
    Object.defineProperty(SumSummaryCalculator.prototype, "displayName", {
        get: function () {
            return this.get_displayName();
        },
        enumerable: false,
        configurable: true
    });
    SumSummaryCalculator.prototype.get_operand = function () {
        return 2;
    };
    SumSummaryCalculator.prototype.beginCalculation = function (a, b) {
        _super.prototype.beginCalculation.call(this, a, b);
        this.p = 0;
    };
    SumSummaryCalculator.prototype.endCalculation = function () {
        return new DefaultSummaryResult(this.propertyName, 2, this.k(this.p));
    };
    SumSummaryCalculator.prototype.aggregate = function (a) {
        var b = this.i(a);
        if (!isNaN_(b)) {
            this.p += b;
        }
    };
    SumSummaryCalculator.prototype.itemAdded = function (a, b, c) {
        var d = this.i(a);
        if (isNaN_(d)) {
            d = 0;
        }
        if (b == null) {
            return new DefaultSummaryResult(this.propertyName, 2, this.k(d));
        }
        var e = this.j(b.value) + d;
        return new DefaultSummaryResult(this.propertyName, 2, this.k(e));
    };
    SumSummaryCalculator.prototype.itemRemoved = function (a, b, c) {
        var d = this.i(a);
        if (isNaN_(d)) {
            d = 0;
        }
        var e = this.j(b.value) - d;
        return new DefaultSummaryResult(this.propertyName, 2, this.k(e));
    };
    SumSummaryCalculator.$t = markType(SumSummaryCalculator, 'SumSummaryCalculator', SummaryCalculator.$);
    return SumSummaryCalculator;
}(SummaryCalculator));
export { SumSummaryCalculator };
/**
 * @hidden
 */
var CountSummaryCalculator = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(CountSummaryCalculator, _super);
    function CountSummaryCalculator() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.p = 0;
        return _this;
    }
    CountSummaryCalculator.prototype.get_displayName = function () {
        var a = BaseDataSource.ba("DataSource_Summary_Count");
        return a != null ? a : "Count";
    };
    Object.defineProperty(CountSummaryCalculator.prototype, "displayName", {
        get: function () {
            return this.get_displayName();
        },
        enumerable: false,
        configurable: true
    });
    CountSummaryCalculator.prototype.get_operand = function () {
        return 4;
    };
    CountSummaryCalculator.prototype.beginCalculation = function (a, b) {
        _super.prototype.beginCalculation.call(this, a, b);
        this.propertyType = 1;
        this.p = 0;
    };
    CountSummaryCalculator.prototype.endCalculation = function () {
        return new DefaultSummaryResult(this.propertyName, 4, this.p);
    };
    CountSummaryCalculator.prototype.aggregate = function (a) {
        this.p++;
    };
    CountSummaryCalculator.prototype.itemAdded = function (a, b, c) {
        if (b == null) {
            return new DefaultSummaryResult(this.propertyName, 4, 1);
        }
        return new DefaultSummaryResult(this.propertyName, 4, typeGetValue(b.value) + 1);
    };
    CountSummaryCalculator.prototype.itemRemoved = function (a, b, c) {
        return new DefaultSummaryResult(this.propertyName, 4, typeGetValue(b.value) - 1);
    };
    CountSummaryCalculator.$t = markType(CountSummaryCalculator, 'CountSummaryCalculator', SummaryCalculator.$);
    return CountSummaryCalculator;
}(SummaryCalculator));
export { CountSummaryCalculator };
/**
 * @hidden
 */
var AverageSummaryCalculator = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AverageSummaryCalculator, _super);
    function AverageSummaryCalculator() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.p = 0;
        _this.q = 0;
        return _this;
    }
    AverageSummaryCalculator.prototype.get_displayName = function () {
        var a = BaseDataSource.ba("DataSource_Summary_Avg");
        return a != null ? a : "Avg";
    };
    Object.defineProperty(AverageSummaryCalculator.prototype, "displayName", {
        get: function () {
            return this.get_displayName();
        },
        enumerable: false,
        configurable: true
    });
    AverageSummaryCalculator.prototype.get_operand = function () {
        return 3;
    };
    AverageSummaryCalculator.prototype.beginCalculation = function (a, b) {
        _super.prototype.beginCalculation.call(this, a, b);
        this.p = 0;
        this.q = 0;
    };
    AverageSummaryCalculator.prototype.endCalculation = function () {
        var a = this.q > 0 ? this.p / this.q : 0;
        return new DefaultSummaryResult(this.propertyName, 3, this.k(a));
    };
    AverageSummaryCalculator.prototype.aggregate = function (a) {
        var b = this.i(a);
        if (!isNaN_(b)) {
            this.p += b;
            this.q++;
        }
    };
    AverageSummaryCalculator.prototype.itemAdded = function (a, b, c) {
        var d = this.i(a);
        if (isNaN_(d)) {
            d = 0;
        }
        if (b == null) {
            return new DefaultSummaryResult(this.propertyName, 3, this.k(d));
        }
        var e = this.j(b.value) * (c - 1);
        var f = (e + d) / c;
        return new DefaultSummaryResult(this.propertyName, 3, this.k(f));
    };
    AverageSummaryCalculator.prototype.itemRemoved = function (a, b, c) {
        var d = this.i(a);
        if (isNaN_(d)) {
            d = 0;
        }
        var e = this.j(b.value) * (c + 1);
        var f = (e - d) / c;
        return new DefaultSummaryResult(this.propertyName, 3, this.k(f));
    };
    AverageSummaryCalculator.$t = markType(AverageSummaryCalculator, 'AverageSummaryCalculator', SummaryCalculator.$);
    return AverageSummaryCalculator;
}(SummaryCalculator));
export { AverageSummaryCalculator };
/**
 * @hidden
 */
var MaxSummaryCalculator = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(MaxSummaryCalculator, _super);
    function MaxSummaryCalculator() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.p = null;
        return _this;
    }
    MaxSummaryCalculator.prototype.get_displayName = function () {
        var a = BaseDataSource.ba("DataSource_Summary_Max");
        return a != null ? a : "Max";
    };
    Object.defineProperty(MaxSummaryCalculator.prototype, "displayName", {
        get: function () {
            return this.get_displayName();
        },
        enumerable: false,
        configurable: true
    });
    MaxSummaryCalculator.prototype.get_operand = function () {
        return 1;
    };
    MaxSummaryCalculator.prototype.beginCalculation = function (a, b) {
        _super.prototype.beginCalculation.call(this, a, b);
        this.p = null;
    };
    MaxSummaryCalculator.prototype.endCalculation = function () {
        return new DefaultSummaryResult(this.propertyName, 1, this.p);
    };
    MaxSummaryCalculator.prototype.aggregate = function (a) {
        this.p = this.q(a, this.p);
    };
    MaxSummaryCalculator.prototype.itemAdded = function (a, b, c) {
        if (b == null) {
            return new DefaultSummaryResult(this.propertyName, 1, this.q(a, null));
        }
        var d = this.q(a, b.value);
        return new DefaultSummaryResult(this.propertyName, 1, d);
    };
    MaxSummaryCalculator.prototype.itemRemoved = function (a, b, c) {
        var d = this.dataSource.getItemProperty(a, this.propertyName);
        if (Base.equalsStatic(d, b.value)) {
            this.isSummaryDirty = true;
        }
        return b;
    };
    MaxSummaryCalculator.prototype.q = function (a, b) {
        var c = this.dataSource.getItemProperty(a, this.propertyName);
        if (b == null) {
            return c;
        }
        if (c == null) {
            return b;
        }
        switch (this.propertyType) {
            case 0:
                b = stringCompare(c, b) > 0 ? c : b;
                break;
            case 6:
                b = c > b ? c : b;
                break;
            case 5:
                b = c > b ? c : b;
                break;
            case 1:
                b = typeGetValue(c) > typeGetValue(b) ? c : b;
                break;
            case 3:
                b = typeGetValue(c) > typeGetValue(b) ? c : b;
                break;
            case 4:
                b = typeGetValue(c) > typeGetValue(b) ? c : b;
                break;
            case 7:
                b = c > b ? c : b;
                break;
            case 2:
                b = c ? c : b;
                break;
            case 10:
                b = typeGetValue(c) > typeGetValue(b) ? c : b;
                break;
            case 8:
                var xVal_ = c;
                var yVal_ = b;
                xVal_ = +xVal_;
                yVal_ = +yVal_;
                var d = typeGetValue(xVal_);
                var e = typeGetValue(yVal_);
                b = Base.compareSimple(d, e) > 0 ? c : b;
                break;
        }
        return b;
    };
    MaxSummaryCalculator.$t = markType(MaxSummaryCalculator, 'MaxSummaryCalculator', SummaryCalculator.$);
    return MaxSummaryCalculator;
}(SummaryCalculator));
export { MaxSummaryCalculator };
/**
 * @hidden
 */
var MinSummaryCalculator = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(MinSummaryCalculator, _super);
    function MinSummaryCalculator() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.p = null;
        return _this;
    }
    MinSummaryCalculator.prototype.get_displayName = function () {
        var a = BaseDataSource.ba("DataSource_Summary_Min");
        return a != null ? a : "Min";
    };
    Object.defineProperty(MinSummaryCalculator.prototype, "displayName", {
        get: function () {
            return this.get_displayName();
        },
        enumerable: false,
        configurable: true
    });
    MinSummaryCalculator.prototype.get_operand = function () {
        return 0;
    };
    MinSummaryCalculator.prototype.beginCalculation = function (a, b) {
        _super.prototype.beginCalculation.call(this, a, b);
        this.p = null;
    };
    MinSummaryCalculator.prototype.endCalculation = function () {
        return new DefaultSummaryResult(this.propertyName, 0, this.p);
    };
    MinSummaryCalculator.prototype.aggregate = function (a) {
        this.p = this.q(a, this.p);
    };
    MinSummaryCalculator.prototype.itemAdded = function (a, b, c) {
        if (b == null) {
            return new DefaultSummaryResult(this.propertyName, 0, this.q(a, null));
        }
        var d = this.q(a, b.value);
        return new DefaultSummaryResult(this.propertyName, 0, d);
    };
    MinSummaryCalculator.prototype.itemRemoved = function (a, b, c) {
        var d = this.dataSource.getItemProperty(a, this.propertyName);
        if (Base.equalsStatic(d, b.value)) {
            this.isSummaryDirty = true;
        }
        return b;
    };
    MinSummaryCalculator.prototype.q = function (a, b) {
        var c = this.dataSource.getItemProperty(a, this.propertyName);
        if (b == null) {
            return c;
        }
        if (c == null) {
            return b;
        }
        switch (this.propertyType) {
            case 0:
                b = stringCompare(c, b) < 0 ? c : b;
                break;
            case 6:
                b = c < b ? c : b;
                break;
            case 5:
                b = c < b ? c : b;
                break;
            case 1:
                b = typeGetValue(c) < typeGetValue(b) ? c : b;
                break;
            case 3:
                b = typeGetValue(c) < typeGetValue(b) ? c : b;
                break;
            case 4:
                b = typeGetValue(c) < typeGetValue(b) ? c : b;
                break;
            case 7:
                b = c < b ? c : b;
                break;
            case 2:
                b = !c ? c : b;
                break;
            case 10:
                b = typeGetValue(c) < typeGetValue(b) ? c : b;
                break;
            case 8:
                var xVal_ = c;
                var yVal_ = b;
                xVal_ = +xVal_;
                yVal_ = +yVal_;
                var d = typeGetValue(xVal_);
                var e = typeGetValue(yVal_);
                b = Base.compareSimple(d, e) < 0 ? c : b;
                break;
        }
        return b;
    };
    MinSummaryCalculator.$t = markType(MinSummaryCalculator, 'MinSummaryCalculator', SummaryCalculator.$);
    return MinSummaryCalculator;
}(SummaryCalculator));
export { MinSummaryCalculator };
/**
 * @hidden
 */
var SummaryDescription = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SummaryDescription, _super);
    function SummaryDescription(a) {
        var _rest = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            _rest[_i - 1] = arguments[_i];
        }
        var _this = _super.call(this) || this;
        _this.h = false;
        _this.k = null;
        _this.a = 0;
        _this._alias = null;
        _this.d = null;
        _this.provideCalculator = null;
        a = (a == void 0) ? 0 : a;
        switch (a) {
            case 0: break;
            case 1:
                {
                    var c = _rest[0];
                    _this.propertyName = c;
                    _this.operand = 4;
                }
                break;
            case 2:
                {
                    var c = _rest[0];
                    var d = _rest[1];
                    _this.propertyName = c;
                    _this.operand = d;
                }
                break;
        }
        return _this;
    }
    Object.defineProperty(SummaryDescription.prototype, "propertyName", {
        get: function () {
            return this.k;
        },
        set: function (a) {
            this.k = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SummaryDescription.prototype, "operand", {
        get: function () {
            return this.a;
        },
        set: function (a) {
            this.a = a;
            switch (this.a) {
                case 0:
                    this.calculator = new MinSummaryCalculator();
                    break;
                case 1:
                    this.calculator = new MaxSummaryCalculator();
                    break;
                case 2:
                    this.calculator = new SumSummaryCalculator();
                    break;
                case 3:
                    this.calculator = new AverageSummaryCalculator();
                    break;
                case 4:
                    this.calculator = new CountSummaryCalculator();
                    break;
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SummaryDescription.prototype, "alias", {
        get: function () {
            return this._alias;
        },
        set: function (a) {
            this._alias = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SummaryDescription.prototype, "calculator", {
        get: function () {
            return this.d;
        },
        set: function (a) {
            this.d = a;
        },
        enumerable: false,
        configurable: true
    });
    SummaryDescription.prototype.equals = function (a) {
        var b = a;
        if (b == null) {
            return _super.prototype.equals.call(this, a);
        }
        return b.propertyName == this.propertyName && b.operand == this.operand;
    };
    SummaryDescription.prototype.getHashCode = function () {
        return Base.getHashCodeStatic(this.propertyName) * 17 + this.operand;
    };
    SummaryDescription.prototype.n = function () {
        this.h = true;
    };
    SummaryDescription.prototype.g = function () {
        if (this.provideCalculator != null) {
            var a = new ProvideCalculatorEventArgs();
            this.provideCalculator(this, a);
            return a.a;
        }
        return null;
    };
    SummaryDescription.prototype.f = function () {
        switch (this.a) {
            case 0: return new MinSummaryCalculator();
            case 1: return new MaxSummaryCalculator();
            case 2: return new SumSummaryCalculator();
            case 3: return new AverageSummaryCalculator();
            case 4: return new CountSummaryCalculator();
            case 5:
                var a = this.g();
                if (a == null) {
                    throw new ArgumentNullException(2, "Calculator", "No custom calculator was provided.");
                }
                return a;
        }
        return null;
    };
    SummaryDescription.$t = markType(SummaryDescription, 'SummaryDescription');
    return SummaryDescription;
}(Base));
export { SummaryDescription };
/**
 * @hidden
 */
var SummaryDescriptionCollection = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SummaryDescriptionCollection, _super);
    function SummaryDescriptionCollection() {
        var _this = _super.call(this) || this;
        _this.d = null;
        _this.f = null;
        _this.f = new SyncableObservableCollection$1(SummaryDescription.$);
        return _this;
    }
    SummaryDescriptionCollection.prototype.g = function () {
        return this.f;
    };
    Object.defineProperty(SummaryDescriptionCollection.prototype, "syncTarget", {
        get: function () {
            return this.d;
        },
        set: function (a) {
            if (a == null) {
                this.f.syncTarget = null;
                this.d = null;
                return;
            }
            this.d = a;
            this.f.syncTarget = this.d.f;
        },
        enumerable: false,
        configurable: true
    });
    SummaryDescriptionCollection.prototype.add = function (a) {
        return this.f.add(a);
    };
    SummaryDescriptionCollection.prototype.insert = function (a, b) {
        this.f.add1(a, b);
    };
    SummaryDescriptionCollection.prototype.clear = function () {
        this.f.clear();
    };
    SummaryDescriptionCollection.prototype.get = function (a) {
        return this.f.get(a);
    };
    SummaryDescriptionCollection.prototype.indexOf = function (a) {
        return this.f.indexOf(a);
    };
    SummaryDescriptionCollection.prototype.remove = function (a) {
        return this.f.remove1(a);
    };
    SummaryDescriptionCollection.prototype.removeAt = function (a) {
        return this.f.remove(a);
    };
    SummaryDescriptionCollection.prototype.set = function (a, b) {
        return this.f.set(a, b);
    };
    SummaryDescriptionCollection.prototype.size = function () {
        return this.f.size();
    };
    SummaryDescriptionCollection.prototype.n = function (a) {
        this.f.addListener(a);
    };
    SummaryDescriptionCollection.prototype.q = function (a) {
        this.f.removeListener(a);
    };
    Object.defineProperty(SummaryDescriptionCollection.prototype, "onChanged", {
        get: function () {
            return this.f.f;
        },
        set: function (a) {
            this.f.f = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SummaryDescriptionCollection.prototype, "k", {
        get: function () {
            return this.f.all;
        },
        enumerable: false,
        configurable: true
    });
    SummaryDescriptionCollection.$t = markType(SummaryDescriptionCollection, 'SummaryDescriptionCollection');
    return SummaryDescriptionCollection;
}(Base));
export { SummaryDescriptionCollection };
/**
 * @hidden
 */
var ProvideCalculatorEventArgs = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ProvideCalculatorEventArgs, _super);
    function ProvideCalculatorEventArgs() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.a = null;
        return _this;
    }
    ProvideCalculatorEventArgs.$t = markType(ProvideCalculatorEventArgs, 'ProvideCalculatorEventArgs');
    return ProvideCalculatorEventArgs;
}(Base));
export { ProvideCalculatorEventArgs };
/**
 * @hidden
 */
var BaseDataSource = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(BaseDataSource, _super);
    function BaseDataSource() {
        var _this = _super.call(this) || this;
        _this.u = null;
        _this._isReadOnly = false;
        _this.z = false;
        _this.dataCommitted = null;
        _this.ap = false;
        _this.az = null;
        _this._externalDataSource = null;
        _this.s = null;
        _this.r = null;
        _this.i = null;
        _this.t = null;
        _this.j = null;
        _this.o = null;
        _this.at = 0;
        _this.au = 0;
        _this.av = 0;
        _this.p = null;
        _this.propertyChanged = null;
        _this.l = null;
        _this.n = null;
        _this.schemaChanged = null;
        _this.rowExpansionChanged = null;
        _this.aa = false;
        _this.h = 0;
        _this.x = false;
        _this.b = null;
        _this.a = null;
        _this.c = null;
        _this.ag = false;
        _this.ah = false;
        _this.v = false;
        _this.g = 0;
        _this.ab = true;
        _this.ad = true;
        _this.y = false;
        _this.af = false;
        _this.ae = false;
        _this.ac = true;
        _this.aj = true;
        _this.ai = false;
        _this.ak = true;
        _this.al = true;
        _this.w = false;
        _this.d = null;
        _this.l = new DefaultDataSourceDataProviderUpdateNotifier(_this);
        _this.s = new SortDescriptionCollection();
        _this.r = new SortDescriptionCollection();
        _this.t = new SummaryDescriptionCollection();
        _this.s.n(runOn(_this, _this.ct));
        _this.r.n(runOn(_this, _this.bx));
        _this.t.n(runOn(_this, _this.cu));
        _this.i = new FilterExpressionCollection();
        _this.i.n(runOn(_this, _this.bv));
        _this.u = new TransactionService(runOn(_this, _this.bz), runOn(_this, _this.clone1), new TransactionKeyEqualityComparer());
        var a = _this.u;
        a.stateChanged = delegateCombine(a.stateChanged, runOn(_this, _this.cp));
        return _this;
    }
    BaseDataSource.prototype.cp = function (a, b) {
        if (a == 0 || a == 1) {
            if (this.updateNotifier != null) {
                var c = b;
                var d = c.transactions._inner[0];
                if (d.type == 1 || d.type == TransactionType.Delete) {
                    var e = d.id;
                    var f = this.indexOfKey(e);
                    if (f > -1) {
                        var g = this.getItemAtIndex(f);
                        this.updateNotifier.notifySetItem(f, g, g);
                        var h = this.getStickyRows();
                        if (h != null) {
                            for (var i = 0; i < h.length; i++) {
                                var j = h[i];
                                var k = typeCast(DataSourceSpecialRow.$, this.getItemAtIndex(j));
                                if (k != null && k.rowType == 3 && k.targetRow == g) {
                                    this.updateNotifier.notifySetItem(j, k, k);
                                    break;
                                }
                            }
                        }
                    }
                }
                else if (d.type == 0) {
                }
            }
        }
        this.co(a, b);
    };
    BaseDataSource.prototype.co = function (a, b) {
    };
    BaseDataSource.prototype.aq = function () {
        return !this.isReadOnly && this.actualPrimaryKey != null && this.actualBaseDataProvider != null && this.u != null;
    };
    BaseDataSource.prototype.bz = function (a, b) {
        var e_1, _a;
        if (a != null && b != null) {
            var c = a;
            var d = b;
            try {
                for (var _b = __values(fromEnum(d)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var e = _c.value;
                    if (c.containsKey(e.key)) {
                        c.item(e.key, e.value);
                    }
                    else {
                        c.addItem(e.key, e.value);
                    }
                }
            }
            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;
                }
            }
        }
    };
    BaseDataSource.prototype.clone1 = function (a) {
        var e_2, _a;
        if (a != null) {
            var b = a;
            var c = new Dictionary$2(String_$type, Base.$, 0);
            try {
                for (var _b = __values(fromEnum(b)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var d = _c.value;
                    c.addItem(d.key, d.value);
                }
            }
            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;
                }
            }
            return c;
        }
        return null;
    };
    Object.defineProperty(BaseDataSource.prototype, "isReadOnly", {
        get: function () {
            return this._isReadOnly;
        },
        set: function (a) {
            this._isReadOnly = a;
        },
        enumerable: false,
        configurable: true
    });
    BaseDataSource.prototype.get_isBatchingEnabled = function () {
        return this.z;
    };
    BaseDataSource.prototype.set_isBatchingEnabled = function (a) {
        this.z = a;
    };
    Object.defineProperty(BaseDataSource.prototype, "isBatchingEnabled", {
        get: function () {
            return this.get_isBatchingEnabled();
        },
        set: function (a) {
            this.set_isBatchingEnabled(a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "canUndo", {
        get: function () {
            return this.u.k;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "canRedo", {
        get: function () {
            return this.u.j;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "canCommit", {
        get: function () {
            return this.u.a(-1).length > 0;
        },
        enumerable: false,
        configurable: true
    });
    BaseDataSource.prototype.updatePropertyAtKey = function (a, b, c, d) {
        if (d === void 0) {
            d = false;
        }
        if (this.aq()) {
            var e = null;
            if (a.length == 1 && typeCast(DataSourceSpecialRow.$, a[0]) !== null) {
                var f = typeCast(DataSourceSpecialRow.$, a[0]);
                if (f.rowType == 3) {
                    e = f;
                    if (this.actualPrimaryKey != null) {
                        a = new Array(this.actualPrimaryKey.length);
                        this.getPrimaryKeyValue(e.targetRow, a);
                    }
                    else {
                        a = [e.targetRow];
                    }
                }
            }
            var g = new Dictionary$2(String_$type, Base.$, 0);
            g.addItem(b, c);
            var h = new Transaction();
            h.id = a;
            h.value = g;
            h.type = 1;
            this.u.v(h, d);
            if (this.isBatchingEnabled || d) {
                if (this.updateNotifier != null) {
                    var i = this.indexOfKey(a);
                    if (i > -1) {
                        var j = this.getItemAtIndex(i);
                        this.updateNotifier.notifySetItem(i, j, j);
                    }
                    if (this.isRowPinned(i)) {
                        var k = -1;
                        if (e != null) {
                            k = this.indexOfItem(e);
                        }
                        else {
                            var l = this.getStickyRows();
                            if (l != null) {
                                for (var m = 0; m < l.length; m++) {
                                    var n = typeCast(DataSourceSpecialRow.$, this.getItemAtIndex(l[m]));
                                    if (n != null && n.rowType == 3) {
                                        e = n;
                                        k = l[m];
                                        break;
                                    }
                                }
                            }
                        }
                        if (k > -1) {
                            this.updateNotifier.notifySetItem(k, e, e);
                        }
                    }
                }
            }
            return h.transactionID;
        }
        return -1;
    };
    BaseDataSource.prototype.removeItemByKey = function (a) {
        if (this.aq()) {
            var b = null;
            if (a.length == 1 && typeCast(DataSourceSpecialRow.$, a[0]) !== null) {
                var c = typeCast(DataSourceSpecialRow.$, a[0]);
                if (c.rowType == 3) {
                    b = c;
                    if (this.actualPrimaryKey != null) {
                        a = new Array(this.actualPrimaryKey.length);
                        this.getPrimaryKeyValue(b.targetRow, a);
                    }
                    else {
                        a = [b.targetRow];
                    }
                }
            }
            var d = new Transaction();
            d.id = a;
            d.type = TransactionType.Delete;
            this.u.v(d, false);
            if (this.isBatchingEnabled) {
                if (this.updateNotifier != null) {
                    var e = this.indexOfKey(a);
                    if (e > -1) {
                        var f = this.getItemAtIndex(e);
                        this.updateNotifier.notifySetItem(e, f, f);
                    }
                    if (this.isRowPinned(e)) {
                        var g = -1;
                        if (b != null) {
                            g = this.indexOfItem(b);
                        }
                        else {
                            var h = this.getStickyRows();
                            if (h != null) {
                                for (var i = 0; i < h.length; i++) {
                                    var j = typeCast(DataSourceSpecialRow.$, this.getItemAtIndex(h[i]));
                                    if (j != null && j.rowType == 3) {
                                        b = j;
                                        g = h[i];
                                        break;
                                    }
                                }
                            }
                        }
                        if (g > -1) {
                            this.updateNotifier.notifySetItem(g, b, b);
                        }
                    }
                }
            }
        }
    };
    BaseDataSource.prototype.removeItem = function (a) {
        if (this.aq()) {
            var b = void 0;
            if (typeCast(DataSourceSpecialRow.$, a) !== null) {
                b = [a];
            }
            else if (this.actualPrimaryKey == null || this.actualPrimaryKey.length < 1) {
                b = [a];
            }
            else {
                b = new Array(this.actualPrimaryKey.length);
                this.getPrimaryKeyValue(a, b);
            }
            this.removeItemByKey(b);
        }
    };
    BaseDataSource.prototype.addItem = function (a) {
        if (this.aq()) {
            if (typeCast(DataSourceSpecialRow.$, a) !== null) {
                return;
            }
            var b = new Transaction();
            b.id = [a];
            b.type = 0;
            this.u.v(b, false);
        }
    };
    BaseDataSource.prototype.acceptPendingTransaction = function (a) {
        if (this.aq()) {
            var b = this.u.d(a);
            if (b != null) {
                this.u.ap(a);
            }
        }
    };
    BaseDataSource.prototype.rejectPendingTransaction = function (a) {
        if (this.aq()) {
            var b = this.u.d(a);
            if (b != null) {
                this.u.x(a);
                if (this.updateNotifier != null) {
                    if (b.type != 0) {
                        var c = b.id;
                        var d = this.indexOfKey(c);
                        if (d > -1) {
                            var e = this.getItemAtIndex(d);
                            this.updateNotifier.notifySetItem(d, e, e);
                            var f = this.getStickyRows();
                            if (f != null) {
                                for (var g = 0; g < f.length; g++) {
                                    var h = typeCast(DataSourceSpecialRow.$, this.getItemAtIndex(f[g]));
                                    if (h != null && h.rowType == 3) {
                                        if (h.targetRow == e) {
                                            this.updateNotifier.notifySetItem(f[g], h, h);
                                            break;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    };
    BaseDataSource.prototype.commitEdits = function (a) {
        if (this.aq()) {
            var b = this.u.c(null).length > 0;
            var c = this.u.s(a, this.isBatchingEnabled);
            if (c == -1 && b) {
                if (this.updateNotifier != null) {
                    this.updateNotifier.notifyClearItems();
                }
            }
            return c;
        }
        return -1;
    };
    BaseDataSource.prototype.cancelEdits = function () {
        if (this.aq()) {
            this.u.w(true, null);
            if (this.updateNotifier != null) {
                this.updateNotifier.notifyClearItems();
            }
        }
    };
    BaseDataSource.prototype.acceptPendingCommit = function (a) {
        if (this.aq()) {
            var b = this.u.e(a);
            if (b != null) {
                this.u.u(a);
                if (this.updateNotifier != null) {
                    for (var c = 0; c < b.a.length; c++) {
                        if (b.a[c].transactionType != 0) {
                            var d = b.a[c].id;
                            var e = this.indexOfKey(d);
                            if (e > -1) {
                                var f = this.getItemAtIndex(e);
                                this.updateNotifier.notifySetItem(e, f, f);
                            }
                        }
                    }
                }
            }
        }
    };
    BaseDataSource.prototype.rejectPendingCommit = function (a) {
        if (this.aq()) {
            var b = this.u.e(a);
            if (b != null) {
                this.u.ac(a);
                if (this.updateNotifier != null) {
                    for (var c = 0; c < b.a.length; c++) {
                        if (b.a[c].transactionType != 0) {
                            var d = b.a[c].id;
                            var e = this.indexOfKey(d);
                            if (e > -1) {
                                var f = this.getItemAtIndex(e);
                                this.updateNotifier.notifySetItem(e, f, f);
                            }
                        }
                    }
                }
            }
        }
    };
    BaseDataSource.prototype.undo = function () {
        if (this.aq()) {
            this.u.ae();
        }
    };
    BaseDataSource.prototype.redo = function () {
        if (this.aq()) {
            this.u.ab();
        }
    };
    BaseDataSource.prototype.hasEdit = function (a, b) {
        if (this.aq()) {
            a = this.f(a);
            var c = this.u.g(a);
            if (c != null) {
                var d = typeCast(Dictionary$2.$.specialize(String_$type, Base.$), c.value);
                if (d != null && d.containsKey(b)) {
                    return true;
                }
            }
            c = this.u.ah(a);
            if (c != null) {
                var e = typeCast(Dictionary$2.$.specialize(String_$type, Base.$), c.value);
                if (e != null && e.containsKey(b)) {
                    return true;
                }
            }
            c = this.u.ag(a);
            if (c != null) {
                var f = typeCast(Dictionary$2.$.specialize(String_$type, Base.$), c.value);
                if (f != null && f.containsKey(b)) {
                    return true;
                }
            }
        }
        return false;
    };
    BaseDataSource.prototype.hasDelete = function (a) {
        if (this.aq()) {
            a = this.f(a);
            var b = this.u.g(a);
            if (b != null && b.transactionType == TransactionType.Delete) {
                return true;
            }
            b = this.u.ah(a);
            if (b != null && b.transactionType == TransactionType.Delete) {
                return true;
            }
            b = this.u.ag(a);
            if (b != null && b.transactionType == TransactionType.Delete) {
                return true;
            }
        }
        return false;
    };
    BaseDataSource.prototype.hasAdd = function (a) {
        if (this.aq()) {
            var b = this.u.g(a);
            if (b != null && b.transactionType == 0) {
                return true;
            }
            b = this.u.ah(a);
            if (b != null && b.transactionType == 0) {
                return true;
            }
        }
        return false;
    };
    BaseDataSource.prototype.getAggregatedChanges = function (a) {
        var e_3, _a;
        if (this.aq()) {
            var b = this.u.a(a);
            var c = new List$1(DataSourceAggregatedResult.$, 0);
            for (var d = 0; d < b.length; d++) {
                var e = b[d].id;
                var f = new DataSourceAggregatedResult();
                if (b[d].transactionType == 0) {
                    f.transactionType = 0;
                    f.item = e[0];
                }
                else if (b[d].transactionType == TransactionType.Delete) {
                    f.transactionType = TransactionType.Delete;
                    var g = this.indexOfKey(e);
                    if (g > -1) {
                        f.item = this.getItemAtIndex(g);
                    }
                    else {
                        f.item = e;
                    }
                }
                else if (b[d].transactionType == 1) {
                    f.transactionType = 1;
                    var h = b[d].value;
                    f.keys = new Array(h.count);
                    f.values = new Array(h.count);
                    var i = 0;
                    try {
                        for (var _b = (e_3 = void 0, __values(fromEnum(h))), _c = _b.next(); !_c.done; _c = _b.next()) {
                            var j = _c.value;
                            f.keys[i] = j.key;
                            f.values[i] = j.value;
                            i++;
                        }
                    }
                    catch (e_3_1) {
                        e_3 = { error: e_3_1 };
                    }
                    finally {
                        try {
                            if (_c && !_c.done && (_a = _b.return))
                                _a.call(_b);
                        }
                        finally {
                            if (e_3)
                                throw e_3.error;
                        }
                    }
                    var k = this.getItemFromKey(e);
                    if (k != null) {
                        f.item = k;
                    }
                    else {
                        f.item = e;
                    }
                }
                c.add(f);
            }
            return c.toArray();
        }
        return new Array(0);
    };
    BaseDataSource.prototype.isPendingTransaction = function (a) {
        return this.u.d(a) != null;
    };
    BaseDataSource.prototype.isPendingCommit = function (a) {
        return this.u.e(a) != null;
    };
    BaseDataSource.prototype.setTransactionError = function (a, b) {
        var c = this.u.d(a);
        if (c != null) {
            c.error = b;
            if (this.updateNotifier != null) {
                var d = c.id;
                var e = this.indexOfKey(d);
                if (e > -1) {
                    var f = this.getItemAtIndex(e);
                    this.updateNotifier.notifySetItem(e, f, f);
                }
            }
        }
    };
    BaseDataSource.prototype.getTransactionErrorByKey = function (a, b) {
        a = this.f(a);
        var c = this.u.c(a);
        for (var d = 0; d < c.length; d++) {
            if (c[d].error != null) {
                if (c[d].type == 1) {
                    var e = c[d].value;
                    if (e.containsKey(b)) {
                        return c[d].error;
                    }
                }
            }
        }
        return null;
    };
    BaseDataSource.prototype.getTransactionErrorByID = function (a) {
        var b = this.u.d(a);
        if (b != null) {
            return b.error;
        }
        return null;
    };
    BaseDataSource.prototype.getTransactionID = function (a, b) {
        a = this.f(a);
        var c = this.u.c(a);
        for (var d = 0; d < c.length; d++) {
            if (c[d].type == 1) {
                var e = c[d].value;
                if (e.containsKey(b)) {
                    return c[d].transactionID;
                }
            }
        }
        return -1;
    };
    BaseDataSource.prototype.f = function (a) {
        if (a.length == 1 && typeCast(DataSourceSpecialRow.$, a[0]) !== null) {
            var b = typeCast(DataSourceSpecialRow.$, a[0]);
            if (b.rowType == 3) {
                if (this.actualPrimaryKey != null) {
                    a = new Array(this.actualPrimaryKey.length);
                    this.getPrimaryKeyValue(b.targetRow, a);
                }
                else {
                    a = [b.targetRow];
                }
            }
        }
        return a;
    };
    BaseDataSource.prototype.b0 = function (a, b) {
        if (this.dataCommitted != null) {
            this.dataCommitted(this, new DataSourceDataCommittedEventArgs(a, b));
        }
    };
    BaseDataSource.ba = function (a) {
        var b = Localization.d("DataVisualization");
        var c = stringFormat("DataVisualization-{0}", b);
        return Localization.isRegistered(c) ? Localization.getString(c, a) : null;
    };
    BaseDataSource.prototype.ct = function (a, b) {
        this.onSortDescriptionsChanged(b);
    };
    BaseDataSource.prototype.bx = function (a, b) {
        this.onGroupDescriptionsChanged(b);
    };
    BaseDataSource.prototype.cu = function (a, b) {
        this.onSummaryDescriptionsChanged(b);
    };
    BaseDataSource.prototype.bv = function (a, b) {
        this.onFilterExpressionsChanged(b);
    };
    BaseDataSource.prototype.onSortDescriptionsChanged = function (a) {
        this.queueAutoRefresh();
    };
    BaseDataSource.prototype.onGroupDescriptionsChanged = function (a) {
        if (this.isGroupingSupported) {
            if (this.groupDescriptions != null && this.groupDescriptions.k.count > 0) {
                this.ap = true;
            }
            else {
                this.ap = false;
            }
            this.queueAutoRefresh();
        }
    };
    BaseDataSource.prototype.onSummaryDescriptionsChanged = function (a) {
        this.queueAutoRefresh();
    };
    BaseDataSource.prototype.onFilterExpressionsChanged = function (a) {
        this.queueAutoRefresh();
    };
    BaseDataSource.prototype.onRowExpansionChanged = function (a, b, c) {
        if (this.rowExpansionChanged != null) {
            this.rowExpansionChanged(this, new DataSourceRowExpansionChangedEventArgs(a, b, c));
        }
    };
    BaseDataSource.prototype.isPlaceholderItem = function (a) {
        return false;
    };
    Object.defineProperty(BaseDataSource.prototype, "externalDataSource", {
        get: function () {
            return this._externalDataSource;
        },
        set: function (a) {
            this._externalDataSource = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "actualSchema", {
        get: function () {
            return this.o;
        },
        set: function (a) {
            var b = this.o;
            this.o = a;
            if (b != this.o) {
                this.onPropertyUpdated("ActualSchema", b, this.o);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "actualCount", {
        get: function () {
            return this.at;
        },
        set: function (a) {
            var b = this.at;
            this.at = a;
            if (b != this.at) {
                this.onPropertyUpdated("ActualCount", b, this.at);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "firstVisibleIndexRequested", {
        get: function () {
            return this.au;
        },
        set: function (a) {
            var b = this.au;
            this.au = a;
            if (b != this.au) {
                this.onPropertyUpdated("FirstVisibleIndexRequested", b, this.au);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "lastVisibleIndexRequested", {
        get: function () {
            return this.av;
        },
        set: function (a) {
            var b = this.av;
            this.av = a;
            if (b != this.av) {
                this.onPropertyUpdated("LastVisibleIndexRequested", b, this.av);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "updateNotifier", {
        get: function () {
            return this.p;
        },
        set: function (a) {
            var b = this.p;
            this.p = a;
            if (b != this.p) {
                this.onPropertyUpdated("UpdateNotifier", b, this.p);
            }
        },
        enumerable: false,
        configurable: true
    });
    BaseDataSource.prototype.getItemAtIndex = function (a) {
        return null;
    };
    BaseDataSource.prototype.getItemFromKey = function (a) {
        return null;
    };
    BaseDataSource.prototype.getItemProperty = function (a, b) {
        if (this.actualBaseDataProvider != null) {
            var item_ = a;
            if ((item_ != null && item_.$$isSpecialRow !== undefined)) {
                return this.getSpecialRowItemValue(a, b);
            }
            return this.actualBaseDataProvider.getItemValue(a, b);
        }
        return null;
    };
    BaseDataSource.prototype.getSpecialRowItemValue = function (a, b) {
        if (a.rowType == 3) {
            if (this.aq()) {
                var c = this.a1(a.targetRow, b);
                if (c != null) {
                    return c;
                }
            }
            return this.getItemProperty(a.targetRow, b);
        }
        return a.getSectionValue(b);
    };
    BaseDataSource.prototype.a1 = function (a, b) {
        var c;
        if (this.actualPrimaryKey == null || this.actualPrimaryKey.length < 1) {
            c = [a];
        }
        else {
            c = new Array(this.actualPrimaryKey.length);
            this.getPrimaryKeyValue(a, c);
        }
        var d = this.u.g(c);
        if (d != null && d.transactionType == 1) {
            var e = d.value;
            if (e.containsKey(b)) {
                return e.item(b);
            }
        }
        d = this.u.ah(c);
        if (d != null && d.transactionType == 1) {
            var f = d.value;
            if (f.containsKey(b)) {
                return f.item(b);
            }
        }
        d = this.u.ag(c);
        if (d != null && d.transactionType == 1) {
            var g = d.value;
            if (g.containsKey(b)) {
                return g.item(b);
            }
        }
        return null;
    };
    BaseDataSource.prototype.an = function (a, b) {
        var c;
        if (this.actualPrimaryKey == null || this.actualPrimaryKey.length < 1) {
            c = [a];
        }
        else {
            c = new Array(this.actualPrimaryKey.length);
            this.getPrimaryKeyValue(a, c);
        }
        var d = this.u.g(c);
        if (d != null && d.transactionType == 1) {
            var e = d.value;
            if (e.containsKey(b)) {
                return true;
            }
        }
        d = this.u.ah(c);
        if (d != null && d.transactionType == 1) {
            var f = d.value;
            if (f.containsKey(b)) {
                return true;
            }
        }
        d = this.u.ag(c);
        if (d != null && d.transactionType == 1) {
            var g = d.value;
            if (g.containsKey(b)) {
                return true;
            }
        }
        return false;
    };
    BaseDataSource.prototype.getItemPropertyAtIndex = function (a, b) {
        return null;
    };
    BaseDataSource.prototype.get_fullSectionInformationWillForceLoad = function () {
        return false;
    };
    Object.defineProperty(BaseDataSource.prototype, "fullSectionInformationWillForceLoad", {
        get: function () {
            return this.get_fullSectionInformationWillForceLoad();
        },
        enumerable: false,
        configurable: true
    });
    BaseDataSource.prototype.onPropertyUpdated = function (a, b, c) {
        if (this.propertyChanged != null) {
            this.propertyChanged(this, new PropertyChangedEventArgs(a));
        }
        this.propertyUpdatedOverride(a, b, c);
    };
    BaseDataSource.prototype.propertyUpdatedOverride = function (a, b, c) {
        switch (a) {
            case "PrimaryKey":
                this.actualPrimaryKey = this.primaryKey;
                break;
            case "ActualPrimaryKey":
                this.onActualPrimaryKeyChanged(b, c);
                break;
            case "ExecutionContext":
                if (this.actualBaseDataProvider != null) {
                    this.actualBaseDataProvider.executionContext = this.executionContext;
                }
                this.queueAutoRefresh();
                break;
            case "LastVisibleIndexRequested":
            case "FirstVisibleIndexRequested":
                this.onRequestedVisibleRangeChanged();
                break;
            case "ActualDataProvider":
                this.onActualDataProviderChanged(b, c);
                break;
            case "DeferAutoRefresh":
                if (this.actualBaseDataProvider != null) {
                    this.actualBaseDataProvider.deferAutoRefresh = this.deferAutoRefresh;
                }
                if (!c) {
                    this.queueAutoRefresh();
                }
                break;
            case "PropertiesRequested":
                if (this.actualBaseDataProvider != null) {
                    this.actualBaseDataProvider.propertiesRequested = this.propertiesRequested;
                }
                break;
            case "ShouldEmitSectionFooters":
            case "ShouldEmitSectionHeaders":
            case "ShouldEmitShiftedRows":
            case "SectionHeaderDisplayMode":
            case "IsSectionCollapsable":
            case "IncludeSummaryRowsInSection":
            case "IsSectionSummaryRowsAtBottom":
            case "IsSectionContentVisible":
                this.queueAutoRefresh();
                break;
            case "SummaryScope":
                if (this.actualBaseDataProvider != null) {
                    this.actualBaseDataProvider.summaryScope = this.summaryScope;
                }
                this.queueAutoRefresh();
                break;
        }
    };
    BaseDataSource.prototype.onActualPrimaryKeyChanged = function (a, b) {
        this.onActualPrimaryKeyChangedOverrride(a, b);
    };
    BaseDataSource.prototype.onActualPrimaryKeyChangedOverrride = function (a, b) {
    };
    BaseDataSource.prototype.get_isVirtual = function () {
        return false;
    };
    Object.defineProperty(BaseDataSource.prototype, "isVirtual", {
        get: function () {
            return this.get_isVirtual();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "dataProviderUpdateNotifier", {
        get: function () {
            return this.l;
        },
        enumerable: false,
        configurable: true
    });
    BaseDataSource.prototype.onActualDataProviderChanged = function (a, b) {
        var c = a;
        var d = b;
        if (c != null) {
            c.updateNotifier = null;
        }
        if (d != null) {
            d.updateNotifier = this.l;
        }
        if (c != null) {
            c.schemaChanged = delegateRemove(c.schemaChanged, runOn(this, this.br));
        }
        if (d != null) {
            d.schemaChanged = delegateCombine(d.schemaChanged, runOn(this, this.br));
            d.executionContext = this.executionContext;
            this.notifyUsingSourceIndexes = this.actualBaseDataProvider.notifyUsingSourceIndexes;
        }
        else {
            this.notifyUsingSourceIndexes = false;
        }
        if (c != null) {
            this.sortDescriptions.syncTarget = null;
            this.groupDescriptions.syncTarget = null;
            this.filterExpressions.syncTarget = null;
            this.summaryDescriptions.syncTarget = null;
        }
        if (d != null) {
            this.sortDescriptions.syncTarget = d.sortDescriptions;
            this.groupDescriptions.syncTarget = d.groupDescriptions;
            this.filterExpressions.syncTarget = d.filterExpressions;
            this.summaryDescriptions.syncTarget = d.summaryDescriptions;
            if (this.propertiesRequested != null) {
                d.propertiesRequested = this.propertiesRequested;
            }
            d.summaryScope = this.summaryScope;
        }
        this.queueAutoRefresh();
    };
    BaseDataSource.prototype.onRequestedVisibleRangeChanged = function () {
    };
    Object.defineProperty(BaseDataSource.prototype, "executionContext", {
        get: function () {
            return this.n;
        },
        set: function (a) {
            var b = this.n;
            this.n = a;
            if (this.n != b) {
                this.onPropertyUpdated("ExecutionContext", b, this.n);
            }
        },
        enumerable: false,
        configurable: true
    });
    BaseDataSource.prototype.canInitialize = function () {
        if (this.n != null && this.actualBaseDataProvider != null) {
            return true;
        }
        return false;
    };
    Object.defineProperty(BaseDataSource.prototype, "isInitializing", {
        get: function () {
            return this.aa;
        },
        enumerable: false,
        configurable: true
    });
    BaseDataSource.prototype.get_isSortingSupported = function () {
        return false;
    };
    Object.defineProperty(BaseDataSource.prototype, "isSortingSupported", {
        get: function () {
            return this.get_isSortingSupported();
        },
        enumerable: false,
        configurable: true
    });
    BaseDataSource.prototype.get_isFilteringSupported = function () {
        return false;
    };
    Object.defineProperty(BaseDataSource.prototype, "isFilteringSupported", {
        get: function () {
            return this.get_isFilteringSupported();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "sortDescriptions", {
        get: function () {
            return this.s;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "groupDescriptions", {
        get: function () {
            return this.r;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "filterExpressions", {
        get: function () {
            return this.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "summaryDescriptions", {
        get: function () {
            return this.t;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "summaryScope", {
        get: function () {
            return this.h;
        },
        set: function (a) {
            var b = this.h;
            this.h = a;
            if (this.h != b) {
                this.onPropertyUpdated("SummaryScope", enumGetBox(DataSourceSummaryScope_$type, b), enumGetBox(DataSourceSummaryScope_$type, this.h));
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "deferAutoRefresh", {
        get: function () {
            return this.x;
        },
        set: function (a) {
            var b = this.x;
            this.x = a;
            if (this.x != b) {
                this.onPropertyUpdated("DeferAutoRefresh", b, this.x);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "primaryKey", {
        get: function () {
            return this.b;
        },
        set: function (a) {
            var b = this.b;
            this.b = a;
            if (this.b != b) {
                this.onPropertyUpdated("PrimaryKey", b, this.b);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "actualPrimaryKey", {
        get: function () {
            return this.a;
        },
        set: function (a) {
            var b = this.a;
            this.a = a;
            if (this.a != b) {
                this.onPropertyUpdated("ActualPrimaryKey", b, this.a);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "propertiesRequested", {
        get: function () {
            return this.c;
        },
        set: function (a) {
            var b = this.c;
            this.c = a;
            if (this.c != b) {
                this.onPropertyUpdated("PropertiesRequested", b, this.c);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "notifyUsingSourceIndexes", {
        get: function () {
            return this.ag;
        },
        set: function (a) {
            var b = this.ag;
            this.ag = a;
            if (this.ag != b) {
                this.onPropertyUpdated("NotifyUsingSourceIndexes", b, this.ag);
            }
        },
        enumerable: false,
        configurable: true
    });
    BaseDataSource.prototype.get_isItemIndexLookupSupported = function () {
        return false;
    };
    Object.defineProperty(BaseDataSource.prototype, "isItemIndexLookupSupported", {
        get: function () {
            return this.get_isItemIndexLookupSupported();
        },
        enumerable: false,
        configurable: true
    });
    BaseDataSource.prototype.get_isKeyIndexLookupSupported = function () {
        return false;
    };
    Object.defineProperty(BaseDataSource.prototype, "isKeyIndexLookupSupported", {
        get: function () {
            return this.get_isKeyIndexLookupSupported();
        },
        enumerable: false,
        configurable: true
    });
    BaseDataSource.prototype.initializeOverride = function () {
    };
    BaseDataSource.prototype.resolveFullCount = function (a) {
        return a;
    };
    BaseDataSource.prototype.br = function (a, b) {
        var _this = this;
        var c = this.executionContext;
        c.execute(function () {
            _this.ah = true;
            _this.w = true;
            _this.queueAutoRefresh();
            if (_this.deferAutoRefresh) {
                _this.actualSchema = b.schema;
                _this.actualCount = _this.resolveFullCount(b.count);
                _this.b1();
            }
        });
    };
    BaseDataSource.prototype.b1 = function () {
        if (this.schemaChanged != null) {
            this.schemaChanged(this, new DataSourceSchemaChangedEventArgs(this.actualSchema, this.actualCount));
        }
    };
    BaseDataSource.prototype.onSetItem = function (a, b, c) {
        this.onSetItemOverride(a, b, c);
    };
    BaseDataSource.prototype.onBroadcastSetItem = function (a, b, c) {
        if (this.updateNotifier != null) {
            this.updateNotifier.notifySetItem(a, b, c);
        }
    };
    BaseDataSource.prototype.onSetItemOverride = function (a, b, c) {
        if (this.actualBaseDataProvider != null) {
            this.actualCount = this.resolveFullCount(this.actualBaseDataProvider.actualCount);
        }
        this.onBroadcastSetItem(a, b, c);
    };
    BaseDataSource.prototype.onClearItems = function () {
        this.onClearItemsOverride();
    };
    BaseDataSource.prototype.onBroadcastClearItems = function () {
        if (this.updateNotifier != null) {
            this.updateNotifier.notifyClearItems();
        }
    };
    BaseDataSource.prototype.onClearItemsOverride = function () {
        if (this.actualBaseDataProvider != null) {
            this.actualCount = this.resolveFullCount(this.actualBaseDataProvider.actualCount);
        }
        this.onBroadcastClearItems();
    };
    BaseDataSource.prototype.onInsertItem = function (a, b) {
        this.onInsertItemOverride(a, b);
    };
    BaseDataSource.prototype.onBroadcastInsertItem = function (a, b) {
        if (this.updateNotifier != null) {
            this.updateNotifier.notifyInsertItem(a, b);
        }
    };
    BaseDataSource.prototype.onInsertItemOverride = function (a, b) {
        if (this.actualBaseDataProvider != null) {
            this.actualCount = this.resolveFullCount(this.actualBaseDataProvider.actualCount);
        }
        this.onBroadcastInsertItem(a, b);
    };
    BaseDataSource.prototype.onRemoveItem = function (a, b) {
        this.onRemoveItemOverride(a, b);
    };
    BaseDataSource.prototype.onBroadcastRemoveItem = function (a, b) {
        if (this.updateNotifier != null) {
            this.updateNotifier.notifyRemoveItem(a, b);
        }
    };
    BaseDataSource.prototype.onRemoveItemOverride = function (a, b) {
        if (this.actualBaseDataProvider != null) {
            this.actualCount = this.resolveFullCount(this.actualBaseDataProvider.actualCount);
        }
        this.onBroadcastRemoveItem(a, b);
    };
    BaseDataSource.prototype.notifySetItem = function (a, b, c) {
        if (this.actualBaseDataProvider != null) {
            this.actualBaseDataProvider.notifySetItem(a, b, c);
        }
    };
    BaseDataSource.prototype.notifyClearItems = function () {
        if (this.actualBaseDataProvider != null) {
            this.actualBaseDataProvider.notifyClearItems();
        }
    };
    BaseDataSource.prototype.notifyInsertItem = function (a, b) {
        if (this.actualBaseDataProvider != null) {
            this.actualBaseDataProvider.notifyInsertItem(a, b);
        }
        ;
    };
    BaseDataSource.prototype.notifyRemoveItem = function (a, b) {
        if (this.actualBaseDataProvider != null) {
            this.actualBaseDataProvider.notifyRemoveItem(a, b);
        }
        ;
    };
    BaseDataSource.prototype.queueAutoRefresh = function () {
        if (this.deferAutoRefresh) {
            return;
        }
        if (this.actualBaseDataProvider != null) {
            this.actualBaseDataProvider.queueAutoRefresh();
        }
        if (this.v) {
            return;
        }
        if (this.executionContext != null) {
            this.v = true;
            this.executionContext.enqueueAction(runOn(this, this.bt));
        }
    };
    BaseDataSource.prototype.bt = function () {
        if (this.deferAutoRefresh) {
            this.v = false;
            return;
        }
        if (this.actualBaseDataProvider != null) {
            this.actualBaseDataProvider.flushAutoRefresh();
        }
        if (!this.v) {
            return;
        }
        this.v = false;
        this.cr();
    };
    BaseDataSource.prototype.cr = function () {
        if (this.actualBaseDataProvider != null) {
            this.actualSchema = this.actualBaseDataProvider.actualSchema;
            this.actualCount = this.resolveFullCount(this.actualBaseDataProvider.actualCount);
        }
        if (this.actualSchema != null && this.primaryKey == null) {
            this.actualPrimaryKey = this.actualSchema.primaryKey;
        }
        this.refreshInternalOverride();
        if (this.ah) {
            this.ah = false;
            this.b1();
        }
    };
    BaseDataSource.prototype.refreshInternalOverride = function () {
    };
    BaseDataSource.prototype.flushAutoRefresh = function () {
        this.bt();
    };
    BaseDataSource.prototype.refresh = function () {
        if (this.actualBaseDataProvider != null) {
            this.actualBaseDataProvider.refresh();
        }
        this.cr();
    };
    BaseDataSource.prototype.indexOfItem = function (a) {
        return -1;
    };
    BaseDataSource.prototype.indexOfKey = function (a) {
        return -1;
    };
    BaseDataSource.prototype.getPrimaryKeyValue = function (a, b) {
        var c = this.actualPrimaryKey;
        if (c == null || c.length < 1 || this.actualBaseDataProvider == null) {
            return;
        }
        for (var d = 0; d < c.length; d++) {
            b[d] = this.actualBaseDataProvider.getItemValue(a, c[d]);
        }
    };
    BaseDataSource.prototype.getRowType = function (a) {
        return 0;
    };
    BaseDataSource.prototype.getMainValuePath = function (a) {
        return "SectionInformation";
    };
    BaseDataSource.prototype.getStickyRows = function () {
        return this.getStickyRowsInRange(this.firstVisibleIndexRequested, this.lastVisibleIndexRequested);
    };
    BaseDataSource.prototype.getStickyRowsInRange = function (a, b) {
        return null;
    };
    BaseDataSource.prototype.isRowSpanning = function (a) {
        return a == 1 || a == 2;
    };
    BaseDataSource.prototype.getStickyRowPriority = function (a) {
        return -1;
    };
    BaseDataSource.prototype.isExclusivelySticky = function (a) {
        return false;
    };
    BaseDataSource.prototype.pinRow = function (a) {
    };
    BaseDataSource.prototype.unpinRow = function (a) {
    };
    BaseDataSource.prototype.clearPinnedRows = function () {
    };
    BaseDataSource.prototype.isRowPinned = function (a) {
        return false;
    };
    BaseDataSource.prototype.get_isGroupingSupported = function () {
        return false;
    };
    Object.defineProperty(BaseDataSource.prototype, "isGroupingSupported", {
        get: function () {
            return this.get_isGroupingSupported();
        },
        enumerable: false,
        configurable: true
    });
    BaseDataSource.prototype.get_sectionHeaderDisplayMode = function () {
        return this.g;
    };
    BaseDataSource.prototype.set_sectionHeaderDisplayMode = function (a) {
        var b = this.g;
        this.g = a;
        if (b != this.g) {
            this.onPropertyUpdated("SectionHeaderDisplayMode", enumGetBox(DataSourceSectionHeaderDisplayMode_$type, b), enumGetBox(DataSourceSectionHeaderDisplayMode_$type, this.g));
        }
    };
    Object.defineProperty(BaseDataSource.prototype, "sectionHeaderDisplayMode", {
        get: function () {
            return this.get_sectionHeaderDisplayMode();
        },
        set: function (a) {
            this.set_sectionHeaderDisplayMode(a);
        },
        enumerable: false,
        configurable: true
    });
    BaseDataSource.prototype.get_isSectionCollapsable = function () {
        return this.ab;
    };
    BaseDataSource.prototype.set_isSectionCollapsable = function (a) {
        var b = this.ab;
        this.ab = a;
        if (this.ab != b) {
            this.onPropertyUpdated("IsSectionCollapsable", b, this.ab);
        }
    };
    Object.defineProperty(BaseDataSource.prototype, "isSectionCollapsable", {
        get: function () {
            return this.get_isSectionCollapsable();
        },
        set: function (a) {
            this.set_isSectionCollapsable(a);
        },
        enumerable: false,
        configurable: true
    });
    BaseDataSource.prototype.get_isSectionExpandedDefault = function () {
        return this.ad;
    };
    BaseDataSource.prototype.set_isSectionExpandedDefault = function (a) {
        this.ad = a;
    };
    Object.defineProperty(BaseDataSource.prototype, "isSectionExpandedDefault", {
        get: function () {
            return this.get_isSectionExpandedDefault();
        },
        set: function (a) {
            this.set_isSectionExpandedDefault(a);
        },
        enumerable: false,
        configurable: true
    });
    BaseDataSource.prototype.get_includeSummaryRowsInSection = function () {
        return this.y;
    };
    BaseDataSource.prototype.set_includeSummaryRowsInSection = function (a) {
        var b = this.y;
        this.y = a;
        if (this.y != b) {
            this.onPropertyUpdated("IncludeSummaryRowsInSection", b, this.y);
        }
    };
    Object.defineProperty(BaseDataSource.prototype, "includeSummaryRowsInSection", {
        get: function () {
            return this.get_includeSummaryRowsInSection();
        },
        set: function (a) {
            this.set_includeSummaryRowsInSection(a);
        },
        enumerable: false,
        configurable: true
    });
    BaseDataSource.prototype.get_isSectionSummaryRowsAtBottom = function () {
        return this.af;
    };
    BaseDataSource.prototype.set_isSectionSummaryRowsAtBottom = function (a) {
        var b = this.af;
        this.af = a;
        if (this.af != b) {
            this.onPropertyUpdated("IsSectionSummaryRowsAtBottom", b, this.af);
        }
    };
    Object.defineProperty(BaseDataSource.prototype, "isSectionSummaryRowsAtBottom", {
        get: function () {
            return this.get_isSectionSummaryRowsAtBottom();
        },
        set: function (a) {
            this.set_isSectionSummaryRowsAtBottom(a);
        },
        enumerable: false,
        configurable: true
    });
    BaseDataSource.prototype.get_isSectionHeaderNormalRow = function () {
        return this.ae;
    };
    BaseDataSource.prototype.set_isSectionHeaderNormalRow = function (a) {
        var b = this.ae;
        this.ae = a;
        if (this.ae != b) {
            this.onPropertyUpdated("IsSectionHeaderNormalRow", b, this.ae);
        }
    };
    Object.defineProperty(BaseDataSource.prototype, "isSectionHeaderNormalRow", {
        get: function () {
            return this.get_isSectionHeaderNormalRow();
        },
        set: function (a) {
            this.set_isSectionHeaderNormalRow(a);
        },
        enumerable: false,
        configurable: true
    });
    BaseDataSource.prototype.get_isSectionContentVisible = function () {
        return this.ac;
    };
    BaseDataSource.prototype.set_isSectionContentVisible = function (a) {
        var b = this.ac;
        this.ac = a;
        if (this.ac != b) {
            this.onPropertyUpdated("IsSectionContentVisible", b, this.ac);
        }
    };
    Object.defineProperty(BaseDataSource.prototype, "isSectionContentVisible", {
        get: function () {
            return this.get_isSectionContentVisible();
        },
        set: function (a) {
            this.set_isSectionContentVisible(a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "shouldEmitSectionHeaders", {
        get: function () {
            return this.aj;
        },
        set: function (a) {
            var b = this.aj;
            this.aj = a;
            if (this.aj != b) {
                this.onPropertyUpdated("ShouldEmitSectionHeaders", b, this.aj);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "shouldEmitSectionFooters", {
        get: function () {
            return this.ai;
        },
        set: function (a) {
            var b = this.ai;
            this.ai = a;
            if (this.ai != b) {
                this.onPropertyUpdated("ShouldEmitSectionFooters", b, this.ai);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "shouldEmitShiftedRows", {
        get: function () {
            return this.ak;
        },
        set: function (a) {
            var b = this.ak;
            this.ak = a;
            if (this.ak != b) {
                this.onPropertyUpdated("ShouldEmitShiftedRows", b, this.ak);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "shouldEmitSummaryRows", {
        get: function () {
            return this.al;
        },
        set: function (a) {
            var b = this.al;
            this.al = a;
            if (this.al != b) {
                this.onPropertyUpdated("ShouldEmitSummaryRows", b, this.al);
            }
        },
        enumerable: false,
        configurable: true
    });
    BaseDataSource.prototype.ensureComparables = function (a) {
        if (this.w && this.actualCount > 0 && this.actualBaseDataProvider != null) {
            var b = null;
            this.d = this.e(a, b);
            this.w = false;
        }
    };
    BaseDataSource.prototype.e = function (a, b) {
        var c = new Array(a.propertyNames.length);
        return c;
    };
    BaseDataSource.prototype.resolveSchemaPropertyType = function (a) {
        return this.actualBaseDataProvider.resolveSchemaPropertyType(a);
    };
    BaseDataSource.prototype.setIsRowExpandedAtIndex = function (a, b) {
    };
    BaseDataSource.prototype.getIsRowExpandedAtIndex = function (a) {
        return true;
    };
    BaseDataSource.prototype.getRowLevel = function (a) {
        return 0;
    };
    BaseDataSource.prototype.getRootSummaryRowCount = function () {
        return 0;
    };
    BaseDataSource.prototype.getRootSummaryResults = function () {
        return null;
    };
    BaseDataSource.prototype.getSectionSummaryResults = function (a) {
        return null;
    };
    BaseDataSource.prototype.clone = function () {
        return null;
    };
    BaseDataSource.prototype.cloneProperties = function (a) {
        var b = typeCast(BaseDataSource.$, a);
        if (b != null) {
            b.executionContext = this.executionContext;
            b.includeSummaryRowsInSection = this.includeSummaryRowsInSection;
            b.isSectionCollapsable = this.isSectionCollapsable;
            b.isSectionExpandedDefault = this.isSectionExpandedDefault;
            b.isSectionHeaderNormalRow = this.isSectionHeaderNormalRow;
            b.isSectionSummaryRowsAtBottom = this.isSectionSummaryRowsAtBottom;
            b.isSectionContentVisible = this.isSectionContentVisible;
            b.primaryKey = this.primaryKey;
            b.propertiesRequested = this.propertiesRequested;
            b.sectionHeaderDisplayMode = this.sectionHeaderDisplayMode;
            b.shouldEmitSectionFooters = this.shouldEmitSectionFooters;
            b.shouldEmitSectionHeaders = this.shouldEmitSectionHeaders;
            b.shouldEmitShiftedRows = this.shouldEmitShiftedRows;
            b.summaryScope = this.summaryScope;
            for (var c = 0; c < this.groupDescriptions.k.count; c++) {
                b.groupDescriptions.add(this.groupDescriptions.k.item(c));
            }
            for (var d = 0; d < this.sortDescriptions.k.count; d++) {
                b.sortDescriptions.add(this.sortDescriptions.k.item(d));
            }
            for (var e = 0; e < this.filterExpressions.k.count; e++) {
                b.filterExpressions.add(this.filterExpressions.k.item(e));
            }
            for (var f = 0; f < this.summaryDescriptions.k.count; f++) {
                b.summaryDescriptions.add(this.summaryDescriptions.k.item(f));
            }
        }
    };
    BaseDataSource.prototype.getRowCount = function () {
        return this.actualCount;
    };
    BaseDataSource.$t = markType(BaseDataSource, 'BaseDataSource', Base.$, [IDataSource_$type, IEditableDataSource_$type]);
    return BaseDataSource;
}(Base));
export { BaseDataSource };
/**
 * @hidden
 */
var DefaultDataSourceDataProviderUpdateNotifier = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(DefaultDataSourceDataProviderUpdateNotifier, _super);
    function DefaultDataSourceDataProviderUpdateNotifier(a) {
        var _this = _super.call(this) || this;
        _this.a = null;
        _this.a = a;
        return _this;
    }
    DefaultDataSourceDataProviderUpdateNotifier.prototype.notifySetItem = function (a, b, c) {
        this.a.onSetItem(a, b, c);
    };
    DefaultDataSourceDataProviderUpdateNotifier.prototype.notifyClearItems = function () {
        this.a.onClearItems();
    };
    DefaultDataSourceDataProviderUpdateNotifier.prototype.notifyInsertItem = function (a, b) {
        this.a.onInsertItem(a, b);
    };
    DefaultDataSourceDataProviderUpdateNotifier.prototype.notifyRemoveItem = function (a, b) {
        this.a.onRemoveItem(a, b);
    };
    DefaultDataSourceDataProviderUpdateNotifier.$t = markType(DefaultDataSourceDataProviderUpdateNotifier, 'DefaultDataSourceDataProviderUpdateNotifier', Base.$, [IDataSourceDataProviderUpdateNotifier_$type]);
    return DefaultDataSourceDataProviderUpdateNotifier;
}(Base));
export { DefaultDataSourceDataProviderUpdateNotifier };
