t = 0), t + e + 1;
    }, t._get_resize_options = function() {
        var t = {
            x:!1,
            y:!1
        };
        return "xy" == this.config.autosize? t.x = t.y =!0 :"y" == this.config.autosize || this.config.autosize ===!0? t.y =!0 :"x" == this.config.autosize && (t.x =!0),
            t;
    }, t._clean_el_size = function(t) {
        return 1 * (t || "").toString().replace("px", "") || 0;
    }, t._get_box_styles = function() {
        var t = null;
        t = window.getComputedStyle? window.getComputedStyle(this._obj, null) :{
            width:this._obj.clientWidth,
            height:this._obj.clientHeight
        };
        var e = [ "width", "height", "paddingTop", "paddingBottom", "paddingLeft", "paddingRight", "borderLeftWidth", "borderRightWidth", "borderTopWidth", "borderBottomWidth" ], i = {
            boxSizing:"border-box" == t.boxSizing
        };
        t.MozBoxSizing && (i.boxSizing = "border-box" == t.MozBoxSizing);
        for (var n = 0; n < e.length; n++) i[e[n]] = t[e[n]]? this._clean_el_size(t[e[n]]) :0;
        var a = {
            horPaddings:i.paddingLeft + i.paddingRight + i.borderLeftWidth + i.borderRightWidth,
            vertPaddings:i.paddingTop + i.paddingBottom + i.borderTopWidth + i.borderBottomWidth,
            borderBox:i.boxSizing,
            innerWidth:i.width,
            innerHeight:i.height,
            outerWidth:i.width,
            outerHeight:i.height
        };
        return a.borderBox? (a.innerWidth -= a.horPaddings, a.innerHeight -= a.vertPaddings) :(a.outerWidth += a.horPaddings,
            a.outerHeight += a.vertPaddings), a;
    }, t._do_autosize = function() {
        var t = this._get_resize_options(), e = this._get_box_styles();
        if (t.y) {
            var i = this._calculate_content_height();
            e.borderBox && (i += e.vertPaddings), this._obj.style.height = i + "px";
        }
        if (t.x) {
            var n = this._calculate_content_width();
            e.borderBox && (n += e.horPaddings), this._obj.style.width = n + "px";
        }
    }, t._set_sizes = function() {
        this._do_autosize();
        var t = this._get_box_styles();
        if (this._y = t.innerHeight,!(this._y < 20)) {
            this.$grid.style.height = this.$task.style.height = Math.max(this._y - this.$scroll_hor.offsetHeight - 2, 0) + "px";
            var e = Math.max(this._y - (this.config.scale_height || 0) - this.$scroll_hor.offsetHeight - 2, 0);
            this.$grid_data.style.height = this.$task_data.style.height = e + "px";
            var i = Math.max(this._get_grid_width() - 1, 0);
            this.$grid.style.width = i + "px", this.$grid.style.display = 0 === i? "none" :"",
                t = this._get_box_styles(), this._x = t.innerWidth, this._x < 20 || (this.$grid_data.style.width = this.$grid_scale.offsetWidth + "px",
                this.$task.style.width = Math.max(this._x - this._get_grid_width() - 2, 0) + "px");
        }
    }, t.getScrollState = function() {
        return this.$task && this.$task_data? {
            x:this.$task.scrollLeft,
            y:this.$task_data.scrollTop
        } :null;
    }, t._save_scroll_state = function(t, e) {
        var i = {};
        this._cached_scroll_pos = this._cached_scroll_pos || {}, void 0!== t && (i.x = Math.max(t, 0)),
        void 0!== e && (i.y = Math.max(e, 0)), this.mixin(this._cached_scroll_pos, i,!0);
    }, t._restore_scroll_state = function() {
        var t = {
            x:0,
            y:0
        };
        return this._cached_scroll_pos && (t.x = this._cached_scroll_pos.x || t.x, t.y = this._cached_scroll_pos.y || t.y),
            t;
    }, t.scrollTo = function(e, i) {
        var n = this._restore_scroll_state();
        1 * e == e && (this.$task.scrollLeft = e, this._save_scroll_state(e, void 0)), 1 * i == i && (this.$scroll_ver.scrollTop = i,
            this.$task_data.scrollTop = i, this.$grid_data.scrollTop = i, this._save_scroll_state(void 0, this.config.show_chart? this.$task_data.scrollTop :this.$scroll_ver.scrollTop));
        var a = t._restore_scroll_state();
        this.callEvent("onGanttScroll", [ n.x, n.y, a.x, a.y ]);
    }, t.showDate = function(t) {
        var e = this.posFromDate(t), i = Math.max(e - this.config.task_scroll_offset, 0);
        this.scrollTo(i);
    }, t.showTask = function(t) {
        var e, i = this._get_task_pos(this.getTask(t)), n = Math.max(i.x - this.config.task_scroll_offset, 0), a = this._scroll_sizes().y;
        e = a? i.y - (a - this.config.row_height) / 2 :i.y, this.scrollTo(n, e);
    }, t._on_resize = t.setSizes = function() {
        t._set_sizes(), t._scroll_resize(), t._set_sizes();
    }, t.render = function() {
        this.callEvent("onBeforeGanttRender", []);
        var e = this.copy(this._restore_scroll_state()), i = null;
        if (e && (i = t.dateFromPos(e.x + this.config.task_scroll_offset)), this._render_grid(),this._render_tasks_scales(), this._scroll_resize(), this._on_resize(), this._render_data(), this.config.preserve_scroll && e) {
            var n = t._restore_scroll_state(), a = t.dateFromPos(n.x);
            (+i!= +a || n.y!= e.y) && (i && this.showDate(i), t.scrollTo(void 0, e.y));
        }
        this.callEvent("onGanttRender", []);
    }, t._set_scroll_events = function() {
        function e(e) {
            var n = t._get_resize_options();
            t._wheel_time = new Date();
            var a = i? -20 * e.deltaX :2 * e.wheelDeltaX, s = i? -40 * e.deltaY :e.wheelDelta;
            if (a && Math.abs(a) > Math.abs(s)) {
                if (n.x) return!0;
                if (!t.$scroll_hor ||!t.$scroll_hor.offsetWidth) return!0;
                var r = a / -40, o = t.$task.scrollLeft, _ = o + 30 * r;
                if (t.scrollTo(_, null), t.$scroll_hor.scrollLeft = _, o == t.$task.scrollLeft) return!0;
            } else {