/*
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 { Base, runOn, delegateCombine, fromEnum, markType, INotifyPropertyChanged_$type, PropertyChangedEventArgs, delegateRemove, enumGetBox } from "igniteui-webcomponents-core";
import { DomWrapper_$type } from "igniteui-webcomponents-core";
import { Dictionary$2 } from "igniteui-webcomponents-core";
import { Checkbox } from "igniteui-webcomponents-inputs";
import { Prefix } from "igniteui-webcomponents-inputs";
import { InputGroup } from "igniteui-webcomponents-inputs";
import { Icon } from "igniteui-webcomponents-inputs";
import { Input } from "igniteui-webcomponents-inputs";
import { ControlDisplayDensity_$type } from "igniteui-webcomponents-core";
import { NativeUI } from "igniteui-webcomponents-core";
import { PrimaryKeyValue } from "./PrimaryKeyValue";
import { Thickness } from "igniteui-webcomponents-core";
import { CheckboxListIndexType_$type } from "./CheckboxListIndexType";
import { SRProvider } from "igniteui-webcomponents-core";
import { GridSelectedKeysCollection } from "./GridSelectedKeysCollection";
import { InputGroupDisplayType_$type } from "igniteui-webcomponents-inputs";
import { BaseControlTheme_$type } from "igniteui-webcomponents-core";
import { FilterFactory } from "igniteui-webcomponents-core";
import { CheckedChangedEventArgs } from "./CheckedChangedEventArgs";
import { TemplateColumn } from "./TemplateColumn";
import { DataSourceSchemaPropertyType_$type } from "igniteui-webcomponents-core";
import { FastReflectionHelper } from "igniteui-webcomponents-core";
import { ColumnWidth } from "./ColumnWidth";
import { DateTimeColumn } from "./DateTimeColumn";
import { NumericColumn } from "./NumericColumn";
import { TextColumn } from "./TextColumn";
import { ArgumentException } from "igniteui-webcomponents-core";
import { SelectAllCheckboxChangedEventArgs } from "./SelectAllCheckboxChangedEventArgs";
import { BrushUtil } from "igniteui-webcomponents-core";
import { stringIsNullOrWhiteSpace } from "igniteui-webcomponents-core";
/**
 * @hidden
 */
export let CheckboxListView = /*@__PURE__*/ (() => {
    class CheckboxListView extends Base {
        constructor() {
            super();
            this.d = new Dictionary$2(DomWrapper_$type, Checkbox.$, 0);
            this.i = null;
            this.a = null;
            this.h = null;
            this.g = null;
            this.b = null;
            this.e = null;
            this.c = false;
            this.f = null;
        }
        m() {
        }
        l(a) {
            if (a == null) {
                this.e = null;
                this.d.clear();
                return;
            }
            this.e = a;
            this.u();
            this.aa();
            this.ad();
            this.r();
            let b = Math.round(a.rootWrapper.width());
            let c = Math.round(a.rootWrapper.height());
            this.e.rootWrapper.setStyleProperty("position", "relative");
            this.e.rootWrapper.setStyleProperty("padding-bottom", "4px");
        }
        u() {
            if (this.e != null) {
                this.v(this.e);
            }
        }
        v(a) {
            let b = a.rootWrapper.getChildAt(0);
            this.g = b;
            this.b.v = new InputGroup();
            let c = a.getSubRenderer(b);
            this.b.v.provideContainer(c);
            this.b.v.k = this.b.x;
            this.b.v.d = this.b.l;
            this.b.v.h = this.b.n;
            let d = a.createElement("div");
            let e = a.getSubRenderer(d);
            let f = new Prefix();
            f.provideContainer(e);
            let g = a.createElement("div");
            let h = a.getSubRenderer(g);
            let i = new Icon();
            i.provideContainer(h);
            i.fill = CheckboxList.cv;
            i.svgPath = CheckboxList.be;
            f.appendContentChild(g);
            this.b.v.appendContentChild(d);
            this.b.v.inputs.add(f);
            let j = a.createElement("div");
            j.setRawStyleProperty("flex-grow", "1");
            let k = a.getSubRenderer(j);
            this.b.t = new Input();
            this.b.t.provideContainer(k);
            this.b.t.b1 = "text";
            if (this.b.a6 != null) {
                this.b.t.b8 = this.b.a6;
            }
            this.b.v.appendContentChild(j);
            this.b.v.inputs.add(this.b.t);
            this.b.b3();
        }
        r() {
            if (this.e != null) {
                let a = this.e.rootWrapper.getChildAt(3);
                a.setStyleProperty("width", "100%");
                a.setStyleProperty("margin", "4px 0px 0px 0px");
                if (this.b.ao == false) {
                    a.setStyleProperty("height", "calc(100% - 50px");
                }
                else {
                    a.setStyleProperty("height", "calc(100% - 75px");
                }
                if (!this.b.am && !this.b.ao) {
                    a.setStyleProperty("height", "100%");
                }
            }
        }
        n(a, b, c) {
            let d = null;
            if (a.getChildCount() == 0) {
                d = new Checkbox();
                let e = this.e.getSubRenderer(a);
                d.provideContainer(e);
                this.d.addItem(a, d);
                d.d = this.b.l;
                d.t = true;
                d.change = delegateCombine(d.change, runOn(this, this.j));
                let f = this.e.createElement("div");
                a.setStyleProperty("display", "flex");
                a.setStyleProperty("height", "100%");
                a.setStyleProperty("align-items", "center");
                switch (this.b.n) {
                    case 1:
                        a.setStyleProperty("margin-top", "-4px");
                        break;
                    case 2:
                        a.setStyleProperty("margin-top", "-1px");
                        break;
                    case 3:
                        a.setStyleProperty("margin-top", "1px");
                        break;
                }
                a.append(f);
            }
            else {
                d = this.d.item(a);
            }
            if (d != null) {
                let g = d.u;
                try {
                    d.u = true;
                    d.a5 = b;
                    if (c) {
                        if (this.b.p == 0) {
                            d.checked = false;
                        }
                        else {
                            d.checked = true;
                        }
                    }
                    else {
                        if (this.b.p == 0) {
                            d.checked = true;
                        }
                        else {
                            d.checked = false;
                        }
                    }
                }
                finally {
                    d.u = g;
                }
            }
        }
        x() {
            if (this.d != null) {
                for (let a of fromEnum(this.d)) {
                    let b = a.value;
                    b.d = this.b.l;
                }
            }
            if (this.a != null) {
                this.a.d = this.b.l;
            }
        }
        w() {
        }
        j(a, b) {
            let c = a;
            let d = parseInt(c.a5.toString());
            let e = c.checked;
            if (e == true) {
                if (this.b.p == 0) {
                    this.b.cf(d);
                }
                else {
                    this.b.bo(d);
                }
            }
            else {
                if (this.b.p == 0) {
                    this.b.bo(d);
                }
                else {
                    this.b.cf(d);
                }
            }
            this.b.b1(d, e);
            this.ac(false);
        }
        k() {
        }
        s(a, b) {
            for (let c of fromEnum(this.d)) {
                let d = c.value;
                let e = parseInt(d.a5.toString());
                if (e == a) {
                    d.checked = b;
                    this.b.b1(e, b);
                }
            }
            this.ac();
        }
        t(a) {
            for (let b of fromEnum(this.d)) {
                let c = b.value;
                c.checked = a;
            }
        }
        p(a) {
            this.i = a;
            if (null != this.i) {
                this.i.setStyleProperty("margin", "5px 0px 4px 0px");
            }
        }
        ad() {
            let a = this.e;
            if (null == a || null == this.i) {
                return;
            }
            let b = a.createElement("div");
            let c = a.getSubRenderer(b);
            this.a = new Checkbox();
            this.a.provideContainer(c);
            this.a.d = this.b.l;
            this.h = a.createElement("label");
            this.h.setRawText(this.b.bg);
            this.h.setStyleProperty("font-size", "13px");
            this.i.setStyleProperty("display", "flex");
            this.i.setStyleProperty("flex-direction", "row");
            this.i.setStyleProperty("font-family", "'Segoe UI', Verdana");
            this.i.setStyleProperty("align-items", "center");
            this.i.append(b);
            this.i.append(this.h);
            this.ae();
            this.ab();
            let d = this.a;
            d.change = delegateCombine(d.change, runOn(this, this.q));
            this.a.t = true;
        }
        ab() {
            if (null != this.h) {
                this.h.setRawText(this.b.bg);
                NativeUI.n(this.h, this.b.cq);
            }
        }
        ae() {
            if (null != this.h) {
                let a = this.b.ao ? "flex" : "none";
                this.i.setStyleProperty("display", a);
            }
        }
        aa() {
            if (this.g != null) {
                this.g.setStyleProperty("display", this.b.am ? "block" : "none");
            }
            if (this.f != null) {
                this.f.setStyleProperty("display", this.b.am ? "block" : "none");
            }
        }
        ac(a = true) {
            let b = this.c;
            this.c = true;
            let c = this.a.u;
            this.a.u = a;
            try {
                if (this.b.ak) {
                    this.a.indeterminate = true;
                    return;
                }
                this.a.indeterminate = false;
                if (this.b.p == 0) {
                    this.a.checked = this.b.g.count == 0;
                }
                else {
                    this.a.checked = this.b.g.count != 0;
                }
            }
            finally {
                this.a.u = c;
                this.c = b;
            }
        }
        q(a, b) {
            if (this.c || b.isIndeterminate) {
                return;
            }
            if (b.isChecked) {
                this.b.ch();
                this.b.b8(b.isChecked);
            }
            else {
                this.b.bs();
                this.b.b8(b.isChecked);
            }
        }
        z() {
            let a = this.e;
            if (null == a) {
                return;
            }
            let b = a.rootWrapper;
            if (null != b) {
                NativeUI.n(b, this.b.cw);
                NativeUI.j(b, this.b.cr);
            }
        }
        y(a) {
            if (this.f != null) {
                NativeUI.s(this.f, a);
            }
        }
        o(a) {
            this.f = a;
        }
    }
    CheckboxListView.$t = /*@__PURE__*/ markType(CheckboxListView, 'CheckboxListView');
    return CheckboxListView;
})();
/**
 * @hidden
 */
export let CheckboxList = /*@__PURE__*/ (() => {
    class CheckboxList extends Base {
        constructor() {
            super();
            this.q = null;
            this.h = null;
            this.i = null;
            this.z = null;
            this.d = null;
            this.ae = false;
            this.c = null;
            this.s = null;
            this.u = null;
            this.af = false;
            this.ac = null;
            this.f = new GridSelectedKeysCollection();
            this.a = null;
            this.propertyChanged = null;
            this.checkedChanged = null;
            this.at = null;
            this.av = null;
            this.ax = null;
            this.aw = null;
            this.w = 3;
            this.ap = -1;
            this.aa = null;
            this.o = 1;
            this.k = 1;
            this.m = 2;
            this.bf = null;
            this.co = null;
            this.cm = CheckboxList.ct;
            this.an = true;
            this.cn = CheckboxList.cs;
            this.cp = CheckboxList.ct;
            this.selectAllCheckboxChanged = null;
            this.ar = -1;
            this.al = true;
            this.ai = true;
            let a = this.f;
            a.collectionChanged = delegateCombine(a.collectionChanged, runOn(this, this.ca));
            this.d = new FilterFactory();
            let b = new CheckboxListView();
            b.b = this;
            this.q = b;
            this.q.m();
        }
        get v() {
            return this.u;
        }
        set v(a) {
            this.u = a;
        }
        get t() {
            return this.s;
        }
        set t(a) {
            this.s = a;
        }
        get e() {
            if (this.h == null) {
                return null;
            }
            return this.h.actualDataSource;
        }
        get ad() {
            if (this.ac == null) {
                this.ac = new SRProvider(this.q.e);
                this.ac.cb("DataGrid");
            }
            return this.ac;
        }
        get g() {
            return this.f;
        }
        get b() {
            return this.a;
        }
        set b(a) {
            let b = this.a;
            this.a = a;
            if (b != this.a) {
                this.b6("PrimaryKey", b, this.a);
            }
        }
        ca(a, b) {
            if (this.e == null || this.e.actualSchema == null || this.ae) {
                return;
            }
            switch (b.action) {
                case 0:
                    for (let c = 0; c < b.newItems.count; c++) {
                        this.b4(b.newItems.item(c));
                    }
                    break;
                case 1:
                    for (let d = 0; d < b.oldItems.count; d++) {
                        this.b5(b.oldItems.item(d));
                    }
                    break;
                case 2:
                    for (let e = 0; e < b.oldItems.count; e++) {
                        this.b5(b.oldItems.item(e));
                    }
                    for (let f = 0; f < b.newItems.count; f++) {
                        this.b4(b.newItems.item(f));
                    }
                    break;
                case 4:
                    this.q.t(this.p == 0);
                    for (let g = 0; g < this.g.ae.count; g++) {
                        this.b4(this.g.ae._inner[g]);
                    }
                    break;
            }
        }
        b4(a) {
            let b = this.e.indexOfKey(a.value);
            if (b >= 0) {
                this.q.s(b, this.p == 1);
            }
        }
        b5(a) {
            let b = this.e.indexOfKey(a.value);
            if (b >= 0) {
                this.q.s(b, this.p == 0);
            }
        }
        b1(a, b) {
            if (this.checkedChanged != null && this.af == false) {
                this.checkedChanged(this, ((() => {
                    let $ret = new CheckedChangedEventArgs();
                    $ret.b = a;
                    $ret.a = b;
                    return $ret;
                })()));
            }
        }
        notifySizeChanged() {
            this.q.k();
        }
        destroy() {
            if (this.h != null) {
                let a = this.h;
                a.cellClicked = delegateRemove(a.cellClicked, runOn(this, this.bu));
            }
            if (this.s != null) {
                let b = this.s;
                b.change = delegateRemove(b.change, runOn(this, this.bv));
            }
            this.provideContainer(null, null, null);
            if (this.i != null) {
                let c = this.i;
                c.cellUpdating = delegateRemove(c.cellUpdating, runOn(this, this.br));
            }
        }
        provideContainer(a, b, c) {
            this.h = b;
            if (null != this.h) {
                this.h.lt = 0;
                this.h.l3 = 0;
                this.h.hc = false;
                this.h.cm = 0;
                this.h.cg = 0;
                let d = this.h;
                d.cellClicked = delegateCombine(d.cellClicked, runOn(this, this.bu));
                if (this.at != null) {
                    this.h.itemsSource = this.at;
                    this.bq();
                    this.b9();
                }
                if (this.av != null) {
                    this.b9();
                    this.ck();
                }
            }
            this.q.p(c);
            this.q.l(a);
        }
        provideSelectAllSection(a) {
            this.q.p(a);
        }
        bu(a, b) {
            if (b.cellInfo.k.a0 == 0) {
                return;
            }
            let c = b.cellInfo.k.w;
            if (-1 == c) {
                return;
            }
            let d = this.j(b.cellInfo.gq);
            if (this.g.contains(d)) {
                this.g.remove(d);
            }
            else {
                this.g.add(d);
            }
        }
        br(a, b) {
            let c = b.cellInfo.k.w;
            if (-1 == c) {
                return;
            }
            let d = false;
            if (b.cellInfo.gq != null) {
                let e = this.j(b.cellInfo.gq);
                if (this.g.contains(e)) {
                    d = true;
                }
            }
            this.q.n(b.content.element, c, d);
        }
        b2(a) {
            if (this.av != null) {
                let b = this.d.property(this.av).cast(enumGetBox(DataSourceSchemaPropertyType_$type, 0)).toLower();
                let c = b.contains(a);
                if (!this.h.v.j.contains(this.c)) {
                    this.c = c;
                    this.h.v.add(this.c);
                }
                else {
                    let d = this.h.v.j.indexOf(this.c);
                    this.h.v.j.item(d, this.c = c);
                }
            }
        }
        get itemsSource() {
            return this.at;
        }
        set itemsSource(a) {
            let b = this.at;
            this.at = a;
            if (b != this.at) {
                this.b6("ItemsSource", b, this.at);
            }
        }
        get a2() {
            return this.av;
        }
        set a2(a) {
            let b = this.av;
            this.av = a;
            if (b != this.av) {
                this.b6("DataMemberPath", b, this.av);
            }
        }
        get bj() {
            return this.ax;
        }
        set bj(a) {
            let b = this.ax;
            this.ax = a;
            if (b != this.ax) {
                this.b6("SelectedMemberPath", b, this.ax);
            }
        }
        get a6() {
            return this.aw;
        }
        set a6(a) {
            let b = this.aw;
            this.aw = a;
            if (b != this.aw) {
                this.b6("FilterPlaceholderText", b, this.aw);
            }
        }
        get x() {
            return this.w;
        }
        set x(a) {
            let b = this.w;
            this.w = a;
            if (b != this.w) {
                this.b6("SearchInputType", enumGetBox(InputGroupDisplayType_$type, b), enumGetBox(InputGroupDisplayType_$type, this.w));
            }
        }
        get as() {
            return this.ap;
        }
        set as(a) {
            let b = this.ap;
            this.ap = a;
            if (b != this.ap) {
                this.b6("RowHeight", b, this.ap);
            }
        }
        get aq() {
            if (this.h != null) {
                return this.h.k8;
            }
            return -1;
        }
        get ab() {
            return this.aa;
        }
        set ab(a) {
            let b = this.aa;
            this.aa = a;
            if (b != this.aa) {
                this.b6("CellTextStyle", b, this.aa);
            }
        }
        get p() {
            return this.o;
        }
        set p(a) {
            let b = this.o;
            this.o = a;
            if (b != this.o) {
                this.b6("IndexType", enumGetBox(CheckboxListIndexType_$type, b), enumGetBox(CheckboxListIndexType_$type, this.o));
            }
        }
        get l() {
            return this.k;
        }
        set l(a) {
            let b = this.k;
            this.k = a;
            if (b != this.k) {
                this.b6("BaseTheme", enumGetBox(BaseControlTheme_$type, b), enumGetBox(BaseControlTheme_$type, this.k));
            }
        }
        get n() {
            return this.m;
        }
        set n(a) {
            let b = this.m;
            this.m = a;
            if (b != this.m) {
                this.b6("Density", enumGetBox(ControlDisplayDensity_$type, b), enumGetBox(ControlDisplayDensity_$type, this.m));
            }
        }
        b6(a, b, c) {
            if (this.propertyChanged != null) {
                this.propertyChanged(this, new PropertyChangedEventArgs(a));
            }
            this.cb(a, b, c);
        }
        cb(a, b, c) {
            switch (a) {
                case "ItemsSource":
                    if (this.h != null) {
                        this.p = 1;
                        if (c != null) {
                            this.h.a8.m();
                            this.h.b5.m();
                            this.h.v.clear();
                            this.h.b8.m();
                        }
                        if (this.h.actualDataSource != null) {
                            let d = this.h.actualDataSource;
                            d.schemaChanged = delegateRemove(d.schemaChanged, runOn(this, this.b7));
                        }
                        this.h.itemsSource = this.at;
                        this.bq();
                        if (this.h.actualDataSource != null) {
                            let e = this.h.actualDataSource;
                            e.schemaChanged = delegateCombine(e.schemaChanged, runOn(this, this.b7));
                        }
                        this.af = true;
                        this.b9();
                        this.af = false;
                        this.q.ac();
                    }
                    break;
                case "DataMemberPath":
                case "SelectedMemberPath":
                    if (this.h != null) {
                        if (this.av != null) {
                            this.b9();
                            this.ck();
                        }
                    }
                    break;
                case "PrimaryKey":
                    if (this.h != null) {
                        this.h.l = this.b;
                    }
                    break;
                case "SelectAllCaptionTextColor":
                    this.cq = null != this.cu ? this.cu : CheckboxList.ct;
                    break;
                case "SelectAllCaption":
                case "ActualSelectAllCaptionTextColor":
                    this.q.ab();
                    break;
                case "showSelectAll":
                    this.q.ae();
                    this.q.r();
                    break;
                case "ShowFilter":
                    this.q.aa();
                    this.q.r();
                    break;
                case "FilterPlaceholderText":
                    if (this.s != null) {
                        this.s.b8 = this.a6;
                    }
                    break;
                case "SearchInputType":
                    if (this.u != null) {
                        this.u.k = this.x;
                    }
                    break;
                case "RowHeight":
                    if (this.h != null) {
                        this.h.l1 = this.as;
                    }
                    break;
                case "CellTextStyle":
                    if (this.h != null) {
                        this.h.fu = this.ab;
                    }
                    break;
                case "BackgroundColor":
                case "TextColor":
                    let f = this.h;
                    if (null != f) {
                        f.v4 = this.cw;
                        f.v2 = this.cr;
                    }
                    this.q.z();
                    break;
                case "BaseTheme":
                    this.cj();
                    break;
                case "Density":
                    this.ci();
                    break;
                case "IsRowHoverEnabled":
                    if (this.h != null) {
                        this.h.ig = this.aj;
                    }
                    break;
            }
        }
        ci() {
            if (this.h != null) {
                this.h.fl = this.n;
            }
            if (this.u != null) {
                this.u.h = this.n;
            }
            this.q.w();
        }
        cj() {
            if (this.u != null) {
                this.u.d = this.l;
            }
            this.q.x();
        }
        b7(a, b) {
            this.af = true;
            this.bq();
            if (b.schema != null) {
                this.b9();
                for (let c = 0; c < this.g.count; c++) {
                    this.b4(this.g._inner[c]);
                }
                this.q.ac();
            }
            this.af = false;
        }
        b9() {
            if (this.z == null && this.ax != null && this.ax != "") {
                this.z = new FastReflectionHelper(false, this.ax);
            }
            if (this.at != null && this.z != null && this.h.actualDataSource.actualSchema != null) {
                this.z.propertyName = this.ax;
                let a = this.h.actualDataSource.actualCount;
                for (let b = 0; b < a; b++) {
                    let c = this.h.actualDataSource.getItemAtIndex(b);
                    let d = this.z.getPropertyValue(c);
                    if (d == true) {
                        let e = this.j(c);
                        if (!this.g.contains(e)) {
                            this.g.add(e);
                        }
                    }
                }
            }
        }
        ck() {
            this.h.actualColumns.clear();
            this.h.l = this.b;
            this.h.h5 = false;
            this.h.l1 = this.as;
            this.h.v2 = this.cr;
            this.h.v3 = this.cr;
            this.h.fl = this.n;
            this.h.ig = this.aj;
            this.h.w8 = new Thickness(0, 0);
            if (this.ab != null) {
                this.h.fu = this.ab;
            }
            let a = new TemplateColumn();
            if (this.ax == null) {
                this.ax = "";
            }
            a.h4 = this.ax;
            a.il = "CheckboxColumn";
            let b = new ColumnWidth();
            b.f = 28;
            a.width = b;
            a.g2 = 0;
            a.g3 = 0;
            a.cellUpdating = delegateCombine(a.cellUpdating, runOn(this, this.br));
            this.h.columns.add(a);
            this.i = a;
            let c = this.h.actualDataSource.resolveSchemaPropertyType(this.av);
            let d;
            switch (c) {
                case 8:
                case 9:
                    d = new DateTimeColumn();
                    break;
                case 1:
                case 3:
                case 4:
                case 5:
                case 6:
                case 7:
                case 10:
                    d = new NumericColumn();
                    break;
                case 2:
                case 11:
                case 0:
                default:
                    d = new TextColumn();
                    break;
            }
            d.h4 = this.av;
            d.il = "DataColumn";
            d.g2 = 0;
            d.e = 0;
            this.h.columns.add(d);
        }
        updateHrMargin(a) {
            this.q.y(a);
        }
        provideHrElement(a) {
            this.q.o(a);
        }
        b3() {
            let a = this.t;
            a.changing = delegateCombine(a.changing, runOn(this, this.bv));
        }
        bv(a, b) {
            let c = b.value.toLowerCase();
            this.b2(c);
        }
        j(a) {
            if (this.b == null) {
                return PrimaryKeyValue.createIdentityKey(a);
            }
            let b = new Array(this.b.length);
            let c = new Array(this.b.length);
            for (let d = 0; d < b.length; d++) {
                b[d] = this.b[d];
                c[d] = this.e.getItemProperty(a, b[d]);
            }
            return new PrimaryKeyValue(b, c);
        }
        cf(a) {
            this.ae = true;
            let b = this.e.getItemAtIndex(a);
            let c = this.j(b);
            this.g.remove(c);
            this.ae = false;
        }
        bo(a) {
            this.ae = true;
            let b = this.e.getItemAtIndex(a);
            let c = this.j(b);
            this.g.add(c);
            this.ae = false;
        }
        ch() {
            this.p = 0;
            this.g.clear();
            this.bw();
            this.q.ac();
        }
        bs() {
            this.p = 1;
            this.g.clear();
            this.bw();
            this.q.ac();
        }
        bz(a, b, c) {
            if (this.h != null) {
                this.h.rm(a, b, c);
            }
        }
        bw() {
            if (this.h != null) {
                this.h.rg();
            }
        }
        bx(a, b) {
            if (this.h != null) {
                this.h.ri(a, b);
            }
            ;
        }
        by(a, b) {
            if (this.h != null) {
                this.h.rj(a, b);
            }
            ;
        }
        bp(a) {
            let b = null;
            if (this.b == null || this.b.length == 0) {
                b = new PrimaryKeyValue(null, a);
            }
            else if (this.b.length == a.length) {
                b = new PrimaryKeyValue(this.b, a);
            }
            else {
                throw new ArgumentException(1, "value length must match PrimaryKey length");
            }
            if (b != null) {
                this.g.add(b);
            }
        }
        cg(a) {
            let b = null;
            if (this.b == null || this.b.length == 0) {
                b = new PrimaryKeyValue(null, a);
            }
            else if (this.b.length == a.length) {
                b = new PrimaryKeyValue(this.b, a);
            }
            else {
                throw new ArgumentException(1, "value length must match PrimaryKey length");
            }
            if (this.g.contains(b)) {
                this.g.remove(b);
            }
        }
        get bg() {
            return this.bf != null ? this.bf : !stringIsNullOrWhiteSpace(this.ad.b1("Select_All")) ? this.ad.b1("Select_All") : "(Select All)";
        }
        set bg(a) {
            if (a == this.bf) {
                return;
            }
            let b = this.bf;
            this.bf = a;
            this.b6("SelectAllCaption", b, this.bf);
        }
        get cu() {
            return this.co;
        }
        set cu(a) {
            let b = this.co;
            this.co = a;
            if (b != this.co) {
                this.b6("SelectAllCaptionTextColor", b, a);
            }
        }
        get cq() {
            return this.cm;
        }
        set cq(a) {
            let b = this.cm;
            this.cm = a;
            if (b != this.cm) {
                this.b6("ActualSelectAllCaptionTextColor", b, a);
            }
        }
        get ak() {
            if (-1 == this.ar) {
                return false;
            }
            let a = this.g.count;
            if (0 == a) {
                return false;
            }
            if (a == this.ar) {
                return false;
            }
            return true;
        }
        get ao() {
            return this.an;
        }
        set ao(a) {
            if (a == this.an) {
                return;
            }
            let b = this.an;
            this.an = a;
            this.b6("showSelectAll", b, this.an);
        }
        get cr() {
            return this.cn;
        }
        set cr(a) {
            let b = this.cn;
            this.cn = a;
            if (b != this.cn) {
                this.b6("BackgroundColor", b, a);
            }
        }
        get cw() {
            return this.cp;
        }
        set cw(a) {
            let b = this.cp;
            this.cp = a;
            if (b != this.cp) {
                this.b6("TextColor", b, a);
            }
        }
        b8(a) {
            if (this.selectAllCheckboxChanged != null) {
                this.selectAllCheckboxChanged(this, ((() => {
                    let $ret = new SelectAllCheckboxChangedEventArgs();
                    $ret.a = a;
                    return $ret;
                })()));
            }
        }
        ah() {
            if (-1 == this.ar) {
                return true;
            }
            let a = this.g.count;
            switch (this.p) {
                case 0: return this.ar == a;
                case 1: return 0 == a;
                default: return false;
            }
        }
        ag() {
            if (-1 == this.ar) {
                return false;
            }
            let a = this.g.count;
            switch (this.p) {
                case 0: return 0 == a;
                case 1: return this.ar == a;
                default: return false;
            }
        }
        bq() {
            let a = this.h.actualDataSource;
            if (null != a) {
                if (null == a.actualSchema) {
                    this.ar = -1;
                    return;
                }
                let b = a.actualCount;
                this.ar = b;
            }
            else {
                this.ar = -1;
            }
        }
        get am() {
            return this.al;
        }
        set am(a) {
            if (a == this.al) {
                return;
            }
            let b = this.al;
            this.al = a;
            this.b6("ShowFilter", b, this.al);
        }
        get aj() {
            return this.ai;
        }
        set aj(a) {
            if (a == this.ai) {
                return;
            }
            let b = this.ai;
            this.ai = a;
            this.b6("IsRowHoverEnabled", b, this.ai);
        }
    }
    CheckboxList.$t = /*@__PURE__*/ markType(CheckboxList, 'CheckboxList', Base.$, [INotifyPropertyChanged_$type]);
    CheckboxList.cv = /*@__PURE__*/ BrushUtil.g(255, 24, 29, 31);
    CheckboxList.be = "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z";
    CheckboxList.cs = /*@__PURE__*/ BrushUtil.g(255, 248, 248, 248);
    CheckboxList.ct = /*@__PURE__*/ BrushUtil.g(255, 24, 29, 31);
    return CheckboxList;
})();
//# sourceMappingURL=CheckboxListView_combined.js.map
