/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import * as tslib_1 from "tslib";
import { GridColumnOptionsViewBase } from "./GridColumnOptionsViewBase";
import { DomWrapper_$type } from "igniteui-webcomponents-core";
import { List$1 } from "igniteui-webcomponents-core";
import { Size } from "igniteui-webcomponents-core";
import { GridColumnOptionsUtilities } from "./GridColumnOptionsUtilities";
import { runOn, delegateCombine, markType } from "igniteui-webcomponents-core";
import { GridColumnOptionsSimpleSectionBase } from "./GridColumnOptionsSimpleSectionBase";
import { StringComparer } from "igniteui-webcomponents-core";
/**
 * @hidden
 */
var GridColumnPinOptionsView = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(GridColumnPinOptionsView, _super);
    function GridColumnPinOptionsView() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.y = null;
        _this.z = null;
        _this.q = null;
        _this.v = null;
        _this.u = null;
        _this.o = null;
        _this.p = null;
        _this.r = null;
        _this.s = null;
        _this.t = false;
        return _this;
    }
    Object.defineProperty(GridColumnPinOptionsView.prototype, "n", {
        get: function () {
            return this.b;
        },
        enumerable: true,
        configurable: true
    });
    GridColumnPinOptionsView.prototype.w = function () {
        var _this = this;
        var a = this.e;
        var b = this.n;
        this.u = a.createElement("div");
        var c = new List$1(DomWrapper_$type, 0);
        var d = ((function () { var e = GridColumnOptionsUtilities.f(a, GridColumnPinOptionsView.aa, b.p, b.j, new Size(1, 18, 18), _this.o, _this.r, _this.y, true, true); _this.o = e.p5; _this.r = e.p6; _this.y = e.p7; return e.ret; })());
        var e = ((function () { var f = GridColumnOptionsUtilities.f(a, GridColumnPinOptionsView.ab, b.p, b.j, new Size(1, 18, 18), _this.p, _this.s, _this.z, false, true); _this.p = f.p5; _this.s = f.p6; _this.z = f.p7; return f.ret; })());
        c.add(d);
        c.add(e);
        var f = [this.o, this.p];
        var g = ((function () { var h = GridColumnOptionsUtilities.h(a, f, c, b.p, b.j, _this.q); _this.q = h.p5; return h.ret; })());
        var h = this.q;
        h.selectionChanged = delegateCombine(h.selectionChanged, runOn(this, this.ae));
        this.u.append(g);
        return this.u;
    };
    GridColumnPinOptionsView.prototype.x = function () {
        var a = this.e.createElement("label");
        return a;
    };
    GridColumnPinOptionsView.prototype.af = function () {
        if (null == this.r || null == this.s) {
            return;
        }
        var a = this.n.b2;
        var t1 = a;
        L0: while (true) {
            switch (t1) {
                case 0:
                    this.r.svgPath = GridColumnPinOptionsView.aa;
                    this.s.svgPath = GridColumnPinOptionsView.ab;
                    break;
                case 1:
                    this.r.svgPath = GridColumnPinOptionsView.ac;
                    this.s.svgPath = GridColumnPinOptionsView.ab;
                    break;
                case 2:
                    this.r.svgPath = GridColumnPinOptionsView.aa;
                    this.s.svgPath = GridColumnPinOptionsView.ad;
                    break;
                default:
                    t1 = 0;
                    continue L0;
            }
            break;
        }
    };
    GridColumnPinOptionsView.prototype.ag = function () {
        if (null == this.q) {
            return;
        }
        this.t = true;
        try {
            var a = this.n.b2;
            switch (a) {
                case 0:
                    this.q.d = [];
                    break;
                case 1:
                    this.q.d = [0];
                    break;
                case 2:
                    this.q.d = [1];
                    break;
            }
        }
        finally {
            this.t = false;
        }
    };
    GridColumnPinOptionsView.prototype.k = function () {
        _super.prototype.k.call(this);
        if (null == this.g || null == this.e) {
            return;
        }
        this.v = this.x();
        var a = this.w();
        var b = this.e;
        var c = this.g;
        c.setStyleProperty("display", "flex");
        c.setStyleProperty("flex-direction", "row");
        c.setStyleProperty("flex-wrap", "no-wrap");
        c.setStyleProperty("justify-content", "space-between");
        c.setStyleProperty("align-items", "center");
        c.append(this.v);
        c.append(a);
    };
    GridColumnPinOptionsView.prototype.m = function () {
        _super.prototype.m.call(this);
        this.ag();
        this.af();
        var a = this.n;
        if (null != this.v) {
            this.v.setRawText(a.bw);
            if (a.bu) {
                this.g.setStyleProperty("display", "flex");
                this.v.setStyleProperty("display", "inline-block");
            }
            else {
                this.g.setStyleProperty("display", "block");
                this.v.setStyleProperty("display", "none");
            }
            this.v.setStyleProperty("font", a.aa.fontString);
        }
        if (null != this.y) {
            this.y.setRawText(this.n.b4);
        }
        if (null != this.z) {
            this.z.setRawText(this.n.b8);
        }
        a.bf(this.o);
        a.bf(this.p);
        a.be(this.q);
    };
    GridColumnPinOptionsView.prototype.ae = function (a, b) {
        if (this.t) {
            return;
        }
        var c;
        if (null == this.q || null == this.q.d || 0 == this.q.d.length) {
            c = 0;
        }
        else {
            if (this.q.d.length > 1) {
            }
            var d = this.q.d[0];
            switch (d) {
                case 0:
                    c = 1;
                    break;
                case 1:
                    c = 2;
                    break;
                default:
                    c = 0;
                    break;
            }
        }
        this.n.b2 = c;
        this.af();
    };
    GridColumnPinOptionsView.$t = markType(GridColumnPinOptionsView, 'GridColumnPinOptionsView', GridColumnOptionsViewBase.$);
    GridColumnPinOptionsView.aa = "M13.2,3.8l7.1,7.1l-2.8-0.1l-3.4,3.4l0.1,4.2l-3.5-3.5l-5.4,5.4l-1.4,0l0-1.4l5.4-5.4L5.7,9.8l4.2,0.1l3.4-3.4L13.2,3.8z";
    GridColumnPinOptionsView.ab = "M10.8,3.8l-7.1,7.1l2.8-0.1l3.4,3.4l-0.1,4.2l3.5-3.5l5.4,5.4l1.4,0l0-1.4l-5.4-5.4l3.5-3.5l-4.2,0.1l-3.4-3.4L10.8,3.8z";
    GridColumnPinOptionsView.ac = "M3,3.4l19,17.1l-1.3,1.2L12.1,14l-4.9,4.9l-1.4-0.1l-0.1-1.4l4.8-4.8l-8.9-8L3,3.4z M14.9,2.3l7.5,7.5l-2.8-0.1L16.1,13 l0,0.3l-5.4-4.8l0.9,0L15,5.1L14.9,2.3z";
    GridColumnPinOptionsView.ad = "M21,3.4L2,20.5l1.3,1.2l8.5-7.7l4.9,4.9l1.4-0.1l0.1-1.4l-4.8-4.8l8.9-8L21,3.4z M9.1,2.3L1.7,9.8l2.8-0.1L7.9,13l0,0.3 l5.4-4.8l-0.9,0L9,5.1L9.1,2.3z";
    return GridColumnPinOptionsView;
}(GridColumnOptionsViewBase));
export { GridColumnPinOptionsView };
/**
 * @hidden
 */
var GridColumnPinOptions = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(GridColumnPinOptions, _super);
    function GridColumnPinOptions() {
        var _this = _super.call(this) || this;
        _this.b1 = 0;
        _this.b3 = "Left";
        _this.b7 = "Right";
        return _this;
    }
    GridColumnPinOptions.prototype.f = function () {
        return new GridColumnPinOptionsView();
    };
    GridColumnPinOptions.prototype.get_by = function () {
        return "Pin";
    };
    Object.defineProperty(GridColumnPinOptions.prototype, "by", {
        get: function () {
            return this.get_by();
        },
        enumerable: true,
        configurable: true
    });
    GridColumnPinOptions.prototype.bq = function () {
        if (null == this.column) {
            return false;
        }
        return true;
    };
    GridColumnPinOptions.prototype.a5 = function () {
        var a = this.column;
        this.b1 = a != null ? a.fk : 0;
        _super.prototype.a5.call(this);
    };
    GridColumnPinOptions.prototype.a6 = function (a, b) {
        _super.prototype.a6.call(this, a, b);
        var c = this.column;
        if (null == c) {
            return;
        }
        switch (b.propertyName) {
            case "Pinned":
                this.b1 = c != null ? c.fk : 0;
                this.b0.m();
                break;
        }
    };
    GridColumnPinOptions.prototype.bc = function (a, b, c) {
        _super.prototype.bc.call(this, a, b, c);
        switch (a) {
            case "PinLeftCaption":
            case "PinRightCaption":
                this.b0.m();
                break;
        }
    };
    Object.defineProperty(GridColumnPinOptions.prototype, "b2", {
        get: function () {
            var a = this.column;
            if (null != a) {
                return a.fk;
            }
            return this.b1;
        },
        set: function (a) {
            this.b1 = a;
            var b = this.c;
            var c = this.column;
            if (null != b && null != c) {
                b.tf(c, this.b1);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridColumnPinOptions.prototype, "b0", {
        get: function () {
            return this.e;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridColumnPinOptions.prototype, "b4", {
        get: function () {
            return this.b3;
        },
        set: function (a) {
            if (0 == StringComparer.b.compare(a, this.b3)) {
                return;
            }
            var b = this.b3;
            this.b3 = a;
            this.ba("PinLeftCaption", b, this.b3);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridColumnPinOptions.prototype, "b8", {
        get: function () {
            return this.b7;
        },
        set: function (a) {
            if (0 == StringComparer.b.compare(a, this.b7)) {
                return;
            }
            var b = this.b7;
            this.b7 = a;
            this.ba("PinRightCaption", b, this.b7);
        },
        enumerable: true,
        configurable: true
    });
    GridColumnPinOptions.$t = markType(GridColumnPinOptions, 'GridColumnPinOptions', GridColumnOptionsSimpleSectionBase.$);
    return GridColumnPinOptions;
}(GridColumnOptionsSimpleSectionBase));
export { GridColumnPinOptions };
//# sourceMappingURL=GridColumnPinOptionsView_combined.js.map
