/*
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 { UIElementPropertyAccessor } from "./UIElementPropertyAccessor";
import { markType } from "./type";
import { Thickness } from "./Thickness";
import { stringReplace } from "./string";
import { isNaN_ } from "./number";
/**
 * @hidden
 */
var CssThicknessPropertyAccessor = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(CssThicknessPropertyAccessor, _super);
    function CssThicknessPropertyAccessor(a) {
        var _this = _super.call(this) || this;
        _this.e = null;
        _this.g = null;
        _this.f = null;
        _this.d = null;
        _this.h = null;
        _this.h = a;
        if (_this.h == "border-width") {
            _this.e = "border-left-width";
            _this.g = "border-top-width";
            _this.f = "border-right-width";
            _this.d = "border-bottom-width";
        }
        else {
            _this.e = _this.h + "-left";
            _this.g = _this.h + "-top";
            _this.f = _this.h + "-right";
            _this.d = _this.h + "-bottom";
        }
        return _this;
    }
    CssThicknessPropertyAccessor.prototype.b = function (a) {
        var b = a;
        var c = b.getStyleProperty(this.e);
        var d = b.getStyleProperty(this.g);
        var e = b.getStyleProperty(this.f);
        var f = b.getStyleProperty(this.d);
        var g = parseFloat(stringReplace(c, "px", ""));
        var h = parseFloat(stringReplace(c, "px", ""));
        var i = parseFloat(stringReplace(c, "px", ""));
        var j = parseFloat(stringReplace(c, "px", ""));
        if (isNaN_(g)) {
            g = 0;
        }
        if (isNaN_(h)) {
            h = 0;
        }
        if (isNaN_(i)) {
            i = 0;
        }
        if (isNaN_(j)) {
            j = 0;
        }
        return new Thickness(1, g, h, i, j);
    };
    CssThicknessPropertyAccessor.prototype.c = function (a, b) {
        var c = a;
        var d = b;
        var e = d.top + "px " + d.right + "px " + d.bottom + "px " + d.left + "px";
        c.setStyleProperty(this.h, e);
    };
    CssThicknessPropertyAccessor.$t = markType(CssThicknessPropertyAccessor, 'CssThicknessPropertyAccessor', UIElementPropertyAccessor.$);
    return CssThicknessPropertyAccessor;
}(UIElementPropertyAccessor));
export { CssThicknessPropertyAccessor };
//# sourceMappingURL=CssThicknessPropertyAccessor.js.map
