/*
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, delegateRemove, markType, INotifyPropertyChanged_$type, PropertyChangedEventArgs, enumGetBox } from "igniteui-react-core/ES2015/type";
import { RenderingContext } from "igniteui-react-core/ES2015/RenderingContext";
import { DefaultTrackThumbVisual } from "./DefaultTrackThumbVisual";
import { DefaultTrackRangeVisual } from "./DefaultTrackRangeVisual";
import { DefaultTrackBarVisual } from "./DefaultTrackBarVisual";
import { DefaultTrackShadeVisual } from "./DefaultTrackShadeVisual";
import { DefaultTrackThumbCalloutVisual } from "./DefaultTrackThumbCalloutVisual";
import { FontInfo } from "igniteui-react-core/ES2015/FontInfo";
import { Rect } from "igniteui-react-core/ES2015/Rect";
import { TranslateTransform } from "igniteui-react-core/ES2015/TranslateTransform";
import { DoubleAnimator } from "igniteui-react-core/ES2015/DoubleAnimator";
import { CanvasViewRenderer } from "igniteui-react-core/ES2015/CanvasViewRenderer";
import { CanvasGestureDOMEventProxy } from "igniteui-react-core/ES2015/CanvasGestureDOMEventProxy";
import { FontUtil } from "igniteui-react-core/ES2015/FontUtil";
import { Size } from "igniteui-react-core/ES2015/Size";
import { truncate, isNaN_ } from "igniteui-react-core/ES2015/number";
import { ITrackOwner_$type } from "./ITrackOwner";
import { IZoomSlider_$type } from "igniteui-react-core/ES2015/IZoomSlider";
import { TrackThumb } from "./TrackThumb";
import { TrackThumbRange } from "./TrackThumbRange";
import { ZoomSliderOrientation_$type } from "./ZoomSliderOrientation";
import { ZoomSliderResolvingAxisValueEventArgs } from "./ZoomSliderResolvingAxisValueEventArgs";
import { RectChangedEventArgs } from "igniteui-react-core/ES2015/RectChangedEventArgs";
import { Thickness } from "igniteui-react-core/ES2015/Thickness";
import { NotImplementedException } from "igniteui-react-core/ES2015/NotImplementedException";
import { EasingFunctions } from "igniteui-react-core/ES2015/EasingFunctions";
/**
 * @hidden
 */
export class ZoomSliderView extends Base {
    constructor(a) {
        super();
        this.p = false;
        this.i = null;
        this.h = null;
        this.c = null;
        this.b = null;
        this.e = null;
        this.d = null;
        this.g = null;
        this.f = null;
        this.j = null;
        this.u = null;
        this.v = null;
        this.o = null;
        this.s = 0;
        this.q = false;
        this.x = 0;
        this.w = 0;
        this.m = null;
        this.a = null;
        this.t = null;
        this.l = null;
        this.y = -1;
        this.r = 10;
        this.k = 0;
        this.j = a;
        this.i = new DefaultTrackThumbVisual();
        this.h = new DefaultTrackThumbVisual();
        this.c = new DefaultTrackRangeVisual();
        this.b = new DefaultTrackBarVisual();
        this.e = new DefaultTrackShadeVisual();
        this.d = new DefaultTrackShadeVisual();
        this.g = new DefaultTrackThumbCalloutVisual();
        this.f = new DefaultTrackThumbCalloutVisual();
        this.m = this.n();
        this.am();
    }
    an() {
        if (!this.p) {
            if (this.u != null) {
                this.p = true;
                this.u.setTimeout(runOn(this, this.az), 0);
            }
        }
    }
    ai() {
        this.az();
    }
    az() {
        if (!this.p) {
            return;
        }
        this.p = false;
        this.j.d6();
        this.at();
    }
    at() {
        if (this.o == null) {
            return;
        }
        let a = this.j.fj.width;
        let b = this.j.fj.height;
        let c = Math.round(a * this.s);
        let d = Math.round(b * this.s);
        if (this.x != c || this.w != d) {
            this.v.setAttribute("width", c.toString());
            this.v.setAttribute("height", d.toString());
            this.v.setStyleProperty("width", a.toString() + "px");
            this.v.setStyleProperty("height", b.toString() + "px");
            this.x = truncate(Math.round(c));
            this.w = truncate(Math.round(d));
        }
        if (this.o.d && this.s != 1) {
            this.o.z();
            this.o.aa(this.s, this.s);
        }
        this.o.k(this.j.fj.left, this.j.fj.top, this.j.fj.width, this.j.fj.height);
        this.ax(this.i.allPaths, this.i.translateX, this.i.translateY);
        this.ax(this.h.allPaths, this.h.translateX, this.h.translateY);
        this.ax(this.c.allPaths, this.c.translateX, this.c.translateY);
        this.ax(this.b.allPaths, this.b.translateX, this.b.translateY);
        this.ax(this.e.allPaths, this.e.translateX, this.e.translateY);
        this.ax(this.d.allPaths, this.d.translateX, this.d.translateY);
        this.ax(this.g.allPaths, this.g.translateX, this.g.translateY);
        this.ax(this.f.allPaths, this.f.translateX, this.f.translateY);
        this.ay(this.g.calloutText, this.g.textTranslateX, this.g.textTranslateY);
        this.ay(this.f.calloutText, this.f.textTranslateX, this.f.textTranslateY);
        this.au(this.b.allPaths);
        this.au(this.c.allPaths);
        this.au(this.e.allPaths);
        this.au(this.d.allPaths);
        this.au(this.i.allPaths);
        this.au(this.h.allPaths);
        this.au(this.g.allPaths);
        this.au(this.f.allPaths);
        this.av(this.g.calloutText);
        this.av(this.f.calloutText);
        if (this.o.d && this.s != 1) {
            this.o.y();
        }
    }
    av(a) {
        if (a.j != null) {
            this.o.z();
        }
        this.o.j(a.j);
        this.o.w(a);
        if (a.j != null) {
            this.o.y();
        }
    }
    au(a) {
        for (let b = 0; b < a.count; b++) {
            let c = a.item(b);
            if (c.j != null) {
                this.o.z();
            }
            this.o.j(c.j);
            this.o.s(c);
            if (c.j != null) {
                this.o.y();
            }
        }
    }
    ay(a, b, c) {
        if (a.j == null) {
            a.j = new TranslateTransform();
        }
        let d = a.j;
        d.j = b;
        d.k = c;
    }
    ax(a, b, c) {
        for (let d = 0; d < a.count; d++) {
            let e = a.item(d);
            if (e.j == null) {
                e.j = new TranslateTransform();
            }
            let f = e.j;
            f.j = b;
            f.k = c;
        }
    }
    am() {
        if (this.t == null) {
            this.t = (a) => {
                let b = this.j.bi;
                let c = this.j.a4;
                if (!isNaN_(b) && b != 0) {
                    return;
                }
                if (window.devicePixelRatio != undefined && window.devicePixelRatio != c) {
                    this.j.a4 = window.devicePixelRatio;
                }
            };
            window.addEventListener("resize", this.t, false);
        }
        this.t(null);
    }
    ar(a) {
        if (a == null) {
            this.v = null;
            this.u = null;
            this.o = null;
            this.aa();
            if (this.t != null) {
                window.removeEventListener("resize", this.t, false);
                this.t = null;
            }
            return;
        }
        this.s = (isNaN_(this.j.bi) ? this.j.a4 : this.j.bi);
        let b = a;
        this.u = b;
        this.j.l.u(this.u);
        this.u.rootWrapper.addClass("ui-zoomslider-container");
        let c = this.s;
        let d = Math.round(b.rootWrapper.width());
        let e = Math.round(b.rootWrapper.height());
        let f = d * c;
        let g = e * c;
        this.u.rootWrapper.setStyleProperty("position", "relative");
        let h = this.u.createElement("canvas");
        h.setStyleProperty("position", "absolute");
        this.u.append(h);
        this.x = truncate(Math.round(f));
        this.w = truncate(Math.round(g));
        h.setAttribute("width", f.toString());
        h.setAttribute("height", g.toString());
        h.setStyleProperty("width", d.toString() + "px");
        h.setStyleProperty("height", e.toString() + "px");
        this.v = h;
        let i = this.u.get2DCanvasContext(this.v);
        this.o = new RenderingContext(new CanvasViewRenderer(), i);
        this.o.ac(this.m);
        this.aa();
        this.a = new CanvasGestureDOMEventProxy(this.u.rootWrapper, this.u, false);
        this.a.bd = this.j.fj;
        let j = this.a;
        j.onContactStarted = delegateCombine(j.onContactStarted, runOn(this, this.ah));
        let k = this.a;
        k.onContactMoved = delegateCombine(k.onContactMoved, runOn(this, this.ag));
        let l = this.a;
        l.onContactCompleted = delegateCombine(l.onContactCompleted, runOn(this, this.af));
        this.a.ai = (m) => this.j.fh.containsPoint(m);
        this.j.de(0, 0, d, e);
        this.r = FontUtil.getCurrentFontHeight(this.u, this.m);
        this.j.trackDirty();
        this.u.setTimeout(runOn(this, this.ak), 200);
    }
    af(a, b) {
        this.j.c8(a);
    }
    ag(a, b) {
        this.j.c9(a);
    }
    ah(a, b) {
        this.j.ae(a);
    }
    aa() {
        if (this.a != null) {
            let a = this.a;
            a.onContactStarted = delegateRemove(a.onContactStarted, runOn(this, this.ah));
            let b = this.a;
            b.onContactMoved = delegateRemove(b.onContactMoved, runOn(this, this.ag));
            let c = this.a;
            c.onContactCompleted = delegateRemove(c.onContactCompleted, runOn(this, this.af));
            this.a.ai = null;
            this.a.ao();
        }
    }
    as() {
    }
    ao() {
        this.ap(true);
    }
    ap(a) {
        if (this.u == null || this.u.rootWrapper == null) {
            return;
        }
        let b = Math.round(this.u.rootWrapper.width());
        let c = Math.round(this.u.rootWrapper.height());
        let d = b != this.j.fj.width || c != this.j.fj.height;
        if (a || d) {
            this.j.de(0, 0, b, c);
            if (this.a != null) {
                this.a.bd = this.j.fj;
            }
        }
    }
    aj() {
    }
    n() {
        return ((() => {
            let $ret = new FontInfo();
            $ret.n = "Verdana";
            $ret.d = 10;
            return $ret;
        })());
    }
    a0(a, b, c) {
        if (a.ak != b) {
            a.ak = b;
        }
        if (this.l != c) {
            this.l = c;
            this.m = this.l;
            this.r = FontUtil.getCurrentFontHeight(this.u, this.m);
            this.o.ac(this.l);
            this.j.trackDirty();
        }
    }
    ac() {
        if (this.k != 3) {
            this.k = 3;
            this.u.rootWrapper.setStyleProperty("cursor", "move");
        }
    }
    ae() {
        if (this.k != 2) {
            this.k = 2;
            this.u.rootWrapper.setStyleProperty("cursor", "ns-resize");
        }
    }
    ab() {
        if (this.k != 0) {
            this.k = 0;
            this.u.rootWrapper.setStyleProperty("cursor", "inherit");
        }
    }
    ad() {
        if (this.k != 1) {
            this.k = 1;
            this.u.rootWrapper.setStyleProperty("cursor", "ew-resize");
        }
    }
    a1(a) {
        let b = this.r;
        let c = this.o.f(a.ak);
        return new Size(1, c, b);
    }
    aq() {
        this.s = this.j.a4;
        this.an();
    }
    aw() {
        if (this.u == null || this.u.rootWrapper == null) {
            return;
        }
        this.u.rootWrapper.show();
    }
    al() {
        if (this.u == null || this.u.rootWrapper == null) {
            return;
        }
        this.u.rootWrapper.hide();
    }
    ak() {
        if (this.u == null) {
            return;
        }
        this.ap(false);
        this.u.setTimeout(runOn(this, this.ak), 200);
    }
}
ZoomSliderView.$t = markType(ZoomSliderView, 'ZoomSliderView');
/**
 * @hidden
 */
export class ZoomSlider extends Base {
    constructor() {
        super();
        this.b = null;
        this.a = null;
        this.c = null;
        this.g = null;
        this.propertyChanged = null;
        this.bk = 500;
        this.ax = 1;
        this.az = NaN;
        this.ag = 1;
        this.resolvingAxisValue = null;
        this.fg = new Rect(0, 0, 0, 1, 1);
        this.w = false;
        this.af = false;
        this.windowRectChanged = null;
        this.i = 0;
        this.h = 0;
        this.ff = null;
        this.fe = null;
        this.fk = new Thickness(1, 5, 5, 5, 5);
        this.fj = null;
        this.fh = null;
        this.fi = null;
        this.ay = 1E-05;
        this.a1 = 0;
        this.al = 0;
        this.a3 = 5;
        this.a2 = 5;
        this.ah = 16;
        this.d = 0;
        this.en = null;
        this.av = 1;
        this.ap = 1;
        this.ef = null;
        this.eo = null;
        this.eg = null;
        this.ep = null;
        this.eh = null;
        this.aw = 10;
        this.aq = 10;
        this.au = 22;
        this.ao = 22;
        this.el = null;
        this.em = null;
        this.at = 1;
        this.ed = null;
        this.ee = null;
        this.an = 1;
        this.d8 = null;
        this.d9 = null;
        this.ai = 0;
        this.eq = null;
        this.er = null;
        this.a0 = 1;
        this.es = null;
        this.ei = null;
        this.ek = null;
        this.ej = null;
        this.as = 1;
        this.ea = null;
        this.ec = null;
        this.eb = null;
        this.am = 1;
        this.q = false;
        this.m = null;
        this.o = null;
        this.k = null;
        this.ak = 0;
        this.aj = 0;
        this.ar = 0;
        this.p = false;
        this.h = 6;
        this.fj = Rect.empty;
        this.fh = Rect.empty;
        this.fi = Rect.empty;
        this.g = new ZoomSliderView(this);
        this.m = this.g.n();
        this.b = new TrackThumb();
        this.b.d = 0;
        this.a = new TrackThumb();
        this.a.d = 1;
        this.c = new TrackThumbRange();
        this.c.f = this.b;
        this.c.e = this.a;
        this.b.i = 0;
        this.a.i = 1;
        this.c.r = 1;
        this.c.n = 0.5;
        this.c.m = 0;
        this.c.l = 1;
        this.b.f = this.c;
        this.a.f = this.c;
        this.c.f = this.b;
        this.c.e = this.a;
        this.b.b = this;
        this.a.b = this;
        this.c.b = this;
        this.k = new DoubleAnimator(0, 1, this.bl);
        let a = this.k;
        a.propertyChanged = delegateCombine(a.propertyChanged, runOn(this, this.cx));
        this.k.b = EasingFunctions.exponentialEase;
    }
    get bl() {
        return this.bk;
    }
    set bl(a) {
        let b = this.bk;
        this.bk = a;
        if (b != this.bk) {
            this.dc("PanTransitionDuration", b, this.bk);
        }
    }
    get bg() {
        return this.ax;
    }
    set bg(a) {
        let b = this.ax;
        this.ax = a;
        if (b != this.ax) {
            this.dc("MaxZoomWidth", b, this.ax);
        }
    }
    get bi() {
        return this.az;
    }
    set bi(a) {
        let b = this.az;
        this.az = a;
        if (b != this.az) {
            this.dc("PixelScalingRatio", b, this.az);
        }
    }
    get a4() {
        return this.ag;
    }
    set a4(a) {
        let b = this.ag;
        this.ag = a;
        if (b != this.ag) {
            this.dc("ActualPixelScalingRatio", b, this.ag);
        }
    }
    de(a, b, c, d) {
        this.fj = new Rect(0, a, b, c, d);
        if (this.e == 0) {
            let e = Math.max(0, this.fj.width - (this.startInset + this.endInset));
            this.fh = new Rect(0, this.fj.left + this.startInset, this.fj.top, e, this.fj.height);
            let f = Math.max(0, this.fh.width - (this.trackStartInset + this.trackEndInset));
            this.fi = new Rect(0, this.fh.left + this.trackStartInset, this.fh.top, f, Math.max(0, this.fh.height - this.barExtent));
        }
        else {
            this.fh = new Rect(0, this.fj.left, this.fj.top + this.startInset, this.fj.width, this.fj.height - (this.startInset + this.endInset));
            this.fi = new Rect(0, this.fh.left, this.fh.top + this.trackStartInset, this.fh.width - this.barExtent, this.fh.height - (this.trackStartInset + this.trackEndInset));
        }
        this.trackDirty();
    }
    d6() {
        if (!this.p) {
            return;
        }
        this.p = false;
        let a = this.g.i;
        let b = this.g.h;
        let c = this.g.c;
        let d = this.g.b;
        let e = this.g.e;
        let f = this.g.d;
        if (this.ab) {
            let g = this.bn();
            let h = this.bm();
            this.ds(g, this.b);
            this.dr(h, this.b.i);
            this.ds(h, this.a);
            this.dr(h, this.a.i);
        }
        else {
            this.d5(a, this.b);
            this.d5(b, this.a);
        }
        if (this.z) {
        }
        else {
            this.d3(c, this.c);
        }
        if (this.y) {
        }
        else {
            this.dp(d);
        }
        if (this.aa) {
        }
        else {
            this.dz(e);
            this.du(f);
        }
        this.d7();
    }
    get windowRect() {
        return this.fg;
    }
    set windowRect(a) {
        let b = this.fg;
        this.fg = a;
        if (Rect.l_op_Inequality(b, this.fg)) {
            this.dc("WindowRect", b, this.fg);
        }
    }
    d7() {
        let a = this.windowRect.width;
        let b = this.windowRect.height;
        let c = this.windowRect.left;
        let d = this.windowRect.top;
        let e = c;
        let f = d;
        let g = a;
        let h = b;
        if (this.e == 0) {
            e = this.b.i;
            g = this.c.r;
        }
        else {
            f = this.b.i;
            h = this.c.r;
        }
        if (e != c || f != d || g != a || h != b) {
            this.w = true;
            let i = this.windowRect;
            this.windowRect = new Rect(0, e, f, g, h);
            this.dg(i, this.windowRect);
            this.w = false;
        }
    }
    dg(a, b) {
        if (this.af) {
            return;
        }
        if (this.windowRectChanged != null) {
            this.windowRectChanged(this, new RectChangedEventArgs(a, b));
        }
    }
    c8(a) {
        if (this.h != 6) {
            this.g.as();
        }
        this.i = this.j(a);
        this.h = 6;
        this.c0();
        this.c1();
    }
    c1() {
        this.g.g.isVisible = false;
        this.g.an();
    }
    c0() {
        this.g.f.isVisible = false;
        this.g.an();
    }
    da(a, b) {
        this.i = this.j(a);
    }
    ae(a) {
        this.i = this.j(a);
        if (this.i == 6) {
            return false;
        }
        this.cy();
        if (this.ac(this.i)) {
            this.dm(a, this.i);
            this.g.aj();
            return true;
        }
        if (this.x(this.i)) {
            return this.ad(a, this.i);
        }
        return false;
    }
    ad(a, b) {
        switch (b) {
            case 5:
            case 2:
            case 3:
                this.di(a);
                return true;
        }
        return false;
    }
    di(a) {
        let b;
        if (this.e == 0) {
            b = (a.x - this.fi.left) / this.fi.width;
        }
        else {
            b = (a.y - this.fi.top) / this.fi.height;
        }
        if (b < 0 || b > 1) {
            return;
        }
        if (b + (this.c.r / 2) > 1) {
            b = 1 - (this.c.r / 2);
        }
        if (b - (this.c.r / 2) < 0) {
            b = (this.c.r / 2);
        }
        if (this.bl > 0) {
            this.dn(b);
        }
        else {
            this.c.n = b;
        }
    }
    dm(a, b) {
        this.h = b;
        this.ff = a;
        this.fe = a;
    }
    ac(a) {
        switch (a) {
            case 0:
            case 1:
            case 4: return true;
        }
        return false;
    }
    x(a) {
        switch (a) {
            case 5:
            case 2:
            case 3: return true;
        }
        return false;
    }
    c9(a) {
        this.i = this.j(a);
        if (this.h != 6) {
            if (this.e == 0) {
                this.c4(a);
            }
            else {
                this.dd(a);
            }
        }
        else {
            this.c2();
        }
    }
    c2() {
        if (this.i == 4) {
            this.g.ac();
        }
        else if (this.i == 0 || this.i == 1) {
            if (this.e == 1) {
                this.g.ae();
            }
            else {
                this.g.ad();
            }
        }
        else {
            this.g.ab();
        }
    }
    dd(a) {
        let b = a.y - this.fe.y;
        b = b / this.fi.height;
        this.fe = a;
        switch (this.h) {
            case 0:
                this.b.j(b);
                this.d1(this.b);
                this.c3();
                break;
            case 1:
                this.a.j(b);
                this.dw(this.a);
                this.c3();
                break;
            case 4:
                this.c.o(b);
                this.d1(this.b);
                this.dw(this.a);
                this.c3();
                break;
        }
    }
    dw(a) {
        let b;
        let c;
        if (this.e == 0) {
            b = a.i;
            c = a.i * this.fi.width + this.fi.left;
            if (this.q) {
                let d = b;
                if (this.resolvingAxisValue != null) {
                    let e = ((() => {
                        let $ret = new ZoomSliderResolvingAxisValueEventArgs();
                        $ret.position = b;
                        $ret.value = d;
                        return $ret;
                    })());
                    this.resolvingAxisValue(this, e);
                    d = e.value;
                }
                this.dk(c, this.fi.top, d);
            }
        }
        else {
            b = a.i;
            c = a.i * this.fi.height + this.fi.top;
            if (this.q) {
                let f = b;
                if (this.resolvingAxisValue != null) {
                    let g = ((() => {
                        let $ret = new ZoomSliderResolvingAxisValueEventArgs();
                        $ret.position = b;
                        $ret.value = f;
                        return $ret;
                    })());
                    this.resolvingAxisValue(this, g);
                    f = g.value;
                }
                this.dk(c, this.fi.top, f);
            }
        }
    }
    dk(a, b, c) {
        let d = this.g.f;
        d.isVisible = true;
        let e = "";
        if (c != null) {
            e = c.toString();
        }
        this.g.a0(d.calloutText, e, this.n());
        let f = this.g.a1(d.calloutText);
        let g = this.fl();
        f = new Size(1, f.width + g.c + g.d, f.height + g.e + g.b);
        let h = this.a.i * this.fi.width + this.fi.left;
        let i = this.b.i * this.fi.width + this.fi.left;
        let j = 0;
        let k = 0;
        if ((this.fj.right - h) <= f.width) {
            j = h - f.width;
        }
        else {
            j = h;
        }
        if (j < i) {
            k = this.fi.top;
        }
        else {
            k = this.fi.bottom - f.height;
        }
        d.width = f.width;
        d.height = f.height;
        d.translateX = j;
        d.translateY = k;
        d.textTranslateX = j + g.c;
        d.textTranslateY = k + g.e;
    }
    d1(a) {
        let b;
        let c;
        if (this.e == 0) {
            b = a.i;
            c = a.i * this.fi.width + this.fi.left;
            if (this.q) {
                let d = b;
                if (this.resolvingAxisValue != null) {
                    let e = ((() => {
                        let $ret = new ZoomSliderResolvingAxisValueEventArgs();
                        $ret.position = b;
                        $ret.value = d;
                        return $ret;
                    })());
                    this.resolvingAxisValue(this, e);
                    d = e.value;
                }
                this.dl(c, this.fi.top, d);
            }
        }
        else {
            b = a.i;
            c = a.i * this.fi.height + this.fi.top;
            if (this.q) {
                let f = b;
                if (this.resolvingAxisValue != null) {
                    let g = ((() => {
                        let $ret = new ZoomSliderResolvingAxisValueEventArgs();
                        $ret.position = b;
                        $ret.value = f;
                        return $ret;
                    })());
                    this.resolvingAxisValue(this, g);
                    f = g.value;
                }
                this.dl(c, this.fi.top, f);
            }
        }
    }
    fl() {
        return this.fk;
    }
    dl(a, b, c) {
        let d = this.g.g;
        d.isVisible = true;
        let e = "";
        if (c != null) {
            e = c.toString();
        }
        this.g.a0(d.calloutText, e, this.n());
        let f = this.g.a1(d.calloutText);
        let g = this.fl();
        f = new Size(1, f.width + g.c + g.d, f.height + g.e + g.b);
        let h = this.b.i * this.fi.width + this.fi.left;
        let i = this.a.i * this.fi.width + this.fi.left;
        let j = 0;
        let k = 0;
        if (h >= f.width) {
            j = h - f.width;
        }
        else {
            j = h;
        }
        if (j > i) {
            k = this.fi.top;
        }
        else {
            k = this.fi.bottom - f.height;
        }
        d.width = f.width;
        d.height = f.height;
        d.translateX = j;
        d.translateY = k;
        d.textTranslateX = j + g.c;
        d.textTranslateY = k + g.e;
    }
    n() {
        if (this.o != null) {
            return this.o;
        }
        return this.m;
    }
    c4(a) {
        let b = a.x - this.fe.x;
        this.fe = a;
        b = b / this.fi.width;
        switch (this.h) {
            case 0:
                this.b.j(b);
                this.d1(this.b);
                this.c3();
                break;
            case 1:
                this.a.j(b);
                this.dw(this.a);
                this.c3();
                break;
            case 4:
                this.c.o(b);
                this.d1(this.b);
                this.dw(this.a);
                this.c3();
                break;
        }
    }
    c6(a) {
        this.i = this.j(a);
    }
    c7(a) {
        this.i = this.j(a);
    }
    j(a) {
        if (this.v(a, this.b, this.g.i)) {
            return 0;
        }
        if (this.v(a, this.a, this.g.h)) {
            return 1;
        }
        if (this.u(a, this.c, this.g.c)) {
            return 4;
        }
        if (this.t(a, this.b)) {
            return 2;
        }
        if (this.s(a, this.a)) {
            return 3;
        }
        if (this.r(a)) {
            return 5;
        }
        return 6;
    }
    r(a) {
        if (this.e == 0) {
            if (a.y > this.fi.bottom && a.x >= this.fi.left && a.x <= this.fi.right && a.y <= this.fh.bottom) {
                return true;
            }
        }
        else {
            if (a.x > this.fi.right && a.y >= this.fi.top && a.y <= this.fi.bottom && a.x <= this.fh.right) {
                return true;
            }
        }
        return false;
    }
    u(a, b, c) {
        if (this.e == 0) {
            let d = (b.n) * this.fi.width + this.fi.left;
            let e = d - c.width / 2;
            let f = d + c.width / 2;
            if (a.y >= this.fh.top && a.y <= this.fh.bottom && a.x >= e && a.x <= f) {
                return true;
            }
        }
        else {
            let g = (b.n) * this.fi.height + this.fi.top;
            let h = g - c.height / 2;
            let i = g + c.height / 2;
            if (a.x >= this.fh.left && a.x <= this.fh.right && a.y >= h && a.y <= i) {
                return true;
            }
        }
        return false;
    }
    t(a, b) {
        if (this.e == 0) {
            let c = b.i * this.fi.width + this.fi.left;
            if (a.y >= this.fh.top && a.x >= this.fh.left && a.x <= this.fh.right && a.x <= c && a.y <= this.fi.bottom) {
                return true;
            }
        }
        else {
            let d = b.i * this.fi.height + this.fi.top;
            if (a.y >= this.fh.top && a.x >= this.fh.left && a.x <= this.fh.right && a.y <= d && a.x <= this.fi.right) {
                return true;
            }
        }
        return false;
    }
    s(a, b) {
        if (this.e == 0) {
            let c = b.i * this.fi.width + this.fi.left;
            if (a.y >= this.fh.top && a.x >= this.fh.left && a.x <= this.fh.right && a.x >= c && a.y <= this.fi.bottom) {
                return true;
            }
        }
        else {
            let d = b.i * this.fi.height + this.fi.top;
            if (a.y >= this.fh.top && a.y <= this.fh.bottom && a.x >= this.fh.left && a.x <= this.fh.right && a.y >= d && a.x <= this.fi.right) {
                return true;
            }
        }
        return false;
    }
    v(a, b, c) {
        if (this.e == 0) {
            let d = b.i * this.fi.width + this.fi.left;
            let e = this.fi.top + this.fi.height / 2;
            let f = new Rect(0, d - c.width / 2, e - c.height / 2, c.width, c.height);
            if (f.containsPoint(a)) {
                return true;
            }
        }
        else {
            let g = b.i * this.fi.height + this.fi.top;
            let h = this.fi.left + this.fi.width / 2;
            let i = new Rect(0, h - c.width / 2, g - c.height / 2, c.width, c.height);
            if (i.containsPoint(a)) {
                return true;
            }
        }
        return false;
    }
    d3(a, b) {
        if (this.e == 0) {
            a.orientation = this.e;
            a.width = Math.max(15, this.fi.width * b.r);
            a.height = this.barExtent;
            a.translateX = (this.fi.left + this.fi.width * b.n);
            a.translateY = this.fi.bottom + this.barExtent / 2;
        }
        else {
            a.orientation = this.e;
            a.height = Math.max(15, this.fi.height * b.r);
            a.width = this.barExtent;
            a.translateY = (this.fi.top + this.fi.height * b.n);
            a.translateX = this.fi.right + this.barExtent / 2;
        }
    }
    du(a) {
        let b = this.a.i;
        if (this.e == 0) {
            let c = this.fi.left + b * this.fi.width;
            a.height = this.fi.height;
            a.translateX = c + (this.fh.right - c) / 2;
            a.translateY = this.fi.top + this.fi.height / 2;
            a.width = (this.fh.right - c);
            a.orientation = 1;
        }
        else {
            let d = this.fi.top + b * this.fi.height;
            a.width = this.fi.width;
            a.translateY = d + (this.fh.bottom - d) / 2;
            a.translateX = this.fh.left + this.fi.width / 2;
            a.height = (this.fh.bottom - d);
            a.orientation = 3;
        }
    }
    dz(a) {
        let b = this.b.i;
        if (this.e == 0) {
            let c = this.fi.left + b * this.fi.width;
            a.height = this.fi.height;
            a.translateX = c - (c - this.fh.left) / 2;
            a.translateY = this.fi.top + this.fi.height / 2;
            a.width = c - this.fh.left;
            a.orientation = 0;
        }
        else {
            let d = this.fi.top + b * this.fi.height;
            a.width = this.fi.width;
            a.translateY = d - (d - this.fh.top) / 2;
            a.translateX = this.fh.left + this.fi.width / 2;
            a.height = d - this.fh.top;
            a.orientation = 2;
        }
    }
    dp(a) {
        if (this.e == 0) {
            a.height = this.barExtent;
            a.width = this.fi.width;
            a.translateX = this.fi.left + this.fi.width / 2;
            a.translateY = this.fh.bottom - this.barExtent / 2;
        }
        else {
            a.width = this.barExtent;
            a.height = this.fi.height;
            a.translateY = this.fi.top + this.fi.height / 2;
            a.translateX = this.fh.right - this.barExtent / 2;
        }
    }
    d5(a, b) {
        if (this.e == 0) {
            a.orientation = this.e;
            a.translateX = this.fi.left + this.fi.width * b.i;
            a.translateY = this.fi.top + this.fi.height / 2;
        }
        else {
            a.orientation = this.e;
            a.translateY = this.fi.top + this.fi.height * b.i;
            a.translateX = this.fi.left + this.fi.width / 2;
        }
    }
    ds(a, b) {
    }
    dr(a, b) {
    }
    bm() {
        throw new NotImplementedException(0);
    }
    bn() {
        throw new NotImplementedException(0);
    }
    get bh() {
        return this.ay;
    }
    set bh(a) {
        let b = this.ay;
        this.ay = a;
        if (b != this.ay) {
            this.dc("MinZoomWidth", b, this.ay);
        }
    }
    get startInset() {
        return this.a1;
    }
    set startInset(a) {
        let b = this.a1;
        this.a1 = a;
        if (b != this.a1) {
            this.dc("StartInset", b, this.a1);
        }
    }
    get endInset() {
        return this.al;
    }
    set endInset(a) {
        let b = this.al;
        this.al = a;
        if (b != this.al) {
            this.dc("EndInset", b, this.al);
        }
    }
    get trackStartInset() {
        return this.a3;
    }
    set trackStartInset(a) {
        let b = this.a3;
        this.a3 = a;
        if (b != this.a3) {
            this.dc("TrackStartInset", b, this.a3);
        }
    }
    get trackEndInset() {
        return this.a2;
    }
    set trackEndInset(a) {
        let b = this.a2;
        this.a2 = a;
        if (b != this.a2) {
            this.dc("TrackEndInset", b, this.a2);
        }
    }
    get barExtent() {
        return this.ah;
    }
    set barExtent(a) {
        let b = this.ah;
        this.ah = a;
        if (b != this.ah) {
            this.dc("BarExtent", b, this.ah);
        }
    }
    get e() {
        return this.d;
    }
    set e(a) {
        let b = this.d;
        this.d = a;
        if (b != this.d) {
            this.dc("Orientation", enumGetBox(ZoomSliderOrientation_$type, b), enumGetBox(ZoomSliderOrientation_$type, this.d));
        }
    }
    get e8() {
        return this.en;
    }
    set e8(a) {
        let b = this.en;
        this.en = a;
        if (b != this.en) {
            this.dc("LowerThumbBrush", b, this.en);
        }
    }
    get be() {
        return this.av;
    }
    set be(a) {
        let b = this.av;
        this.av = a;
        if (b != this.av) {
            this.dc("LowerThumbStrokeThickness", b, this.av);
        }
    }
    get a9() {
        return this.ap;
    }
    set a9(a) {
        let b = this.ap;
        this.ap = a;
        if (b != this.ap) {
            this.dc("HigherThumbStrokeThickness", b, this.ap);
        }
    }
    get e0() {
        return this.ef;
    }
    set e0(a) {
        let b = this.ef;
        this.ef = a;
        if (b != this.ef) {
            this.dc("HigherThumbBrush", b, this.ef);
        }
    }
    get e9() {
        return this.eo;
    }
    set e9(a) {
        let b = this.eo;
        this.eo = a;
        if (b != this.eo) {
            this.dc("LowerThumbOutline", b, this.eo);
        }
    }
    get e1() {
        return this.eg;
    }
    set e1(a) {
        let b = this.eg;
        this.eg = a;
        if (b != this.eg) {
            this.dc("HigherThumbOutline", b, this.eg);
        }
    }
    get fa() {
        return this.ep;
    }
    set fa(a) {
        let b = this.ep;
        this.ep = a;
        if (b != this.ep) {
            this.dc("LowerThumbRidgesBrush", b, this.ep);
        }
    }
    get e2() {
        return this.eh;
    }
    set e2(a) {
        let b = this.eh;
        this.eh = a;
        if (b != this.eh) {
            this.dc("HigherThumbRidgesBrush", b, this.eh);
        }
    }
    get bf() {
        return this.aw;
    }
    set bf(a) {
        let b = this.aw;
        this.aw = a;
        if (b != this.aw) {
            this.dc("LowerThumbWidth", b, this.aw);
        }
    }
    get ba() {
        return this.aq;
    }
    set ba(a) {
        let b = this.aq;
        this.aq = a;
        if (b != this.aq) {
            this.dc("HigherThumbWidth", b, this.aq);
        }
    }
    get bd() {
        return this.au;
    }
    set bd(a) {
        let b = this.au;
        this.au = a;
        if (b != this.au) {
            this.dc("LowerThumbHeight", b, this.au);
        }
    }
    get a8() {
        return this.ao;
    }
    set a8(a) {
        let b = this.ao;
        this.ao = a;
        if (b != this.ao) {
            this.dc("HigherThumbHeight", b, this.ao);
        }
    }
    get e6() {
        return this.el;
    }
    set e6(a) {
        let b = this.el;
        this.el = a;
        if (b != this.el) {
            this.dc("LowerShadeBrush", b, this.el);
        }
    }
    get e7() {
        return this.em;
    }
    set e7(a) {
        let b = this.em;
        this.em = a;
        if (b != this.em) {
            this.dc("LowerShadeOutline", b, this.em);
        }
    }
    destroy() {
        this.provideContainer(null);
    }
    get bc() {
        return this.at;
    }
    set bc(a) {
        let b = this.at;
        this.at = a;
        if (b != this.at) {
            this.dc("LowerShadeStrokeThickness", b, this.at);
        }
    }
    get ey() {
        return this.ed;
    }
    set ey(a) {
        let b = this.ed;
        this.ed = a;
        if (b != this.ed) {
            this.dc("HigherShadeBrush", b, this.ed);
        }
    }
    get ez() {
        return this.ee;
    }
    set ez(a) {
        let b = this.ee;
        this.ee = a;
        if (b != this.ee) {
            this.dc("HigherShadeOutline", b, this.ee);
        }
    }
    get a7() {
        return this.an;
    }
    set a7(a) {
        let b = this.an;
        this.an = a;
        if (b != this.an) {
            this.dc("HigherShadeStrokeThickness", b, this.an);
        }
    }
    get et() {
        return this.d8;
    }
    set et(a) {
        let b = this.d8;
        this.d8 = a;
        if (b != this.d8) {
            this.dc("BarBrush", b, this.d8);
        }
    }
    get eu() {
        return this.d9;
    }
    set eu(a) {
        let b = this.d9;
        this.d9 = a;
        if (b != this.d9) {
            this.dc("BarOutline", b, this.d9);
        }
    }
    get a5() {
        return this.ai;
    }
    set a5(a) {
        let b = this.ai;
        this.ai = a;
        if (b != this.ai) {
            this.dc("BarStrokeThickness", b, this.ai);
        }
    }
    get fb() {
        return this.eq;
    }
    set fb(a) {
        let b = this.eq;
        this.eq = a;
        if (b != this.eq) {
            this.dc("RangeThumbBrush", b, this.eq);
        }
    }
    get fc() {
        return this.er;
    }
    set fc(a) {
        let b = this.er;
        this.er = a;
        if (b != this.er) {
            this.dc("RangeThumbOutline", b, this.er);
        }
    }
    get bj() {
        return this.a0;
    }
    set bj(a) {
        let b = this.a0;
        this.a0 = a;
        if (b != this.a0) {
            this.dc("RangeThumbStrokeThickness", b, this.a0);
        }
    }
    get fd() {
        return this.es;
    }
    set fd(a) {
        let b = this.es;
        this.es = a;
        if (b != this.es) {
            this.dc("RangeThumbRidgesBrush", b, this.es);
        }
    }
    get e3() {
        return this.ei;
    }
    set e3(a) {
        let b = this.ei;
        this.ei = a;
        if (b != this.ei) {
            this.dc("LowerCalloutBrush", b, this.ei);
        }
    }
    get e5() {
        return this.ek;
    }
    set e5(a) {
        let b = this.ek;
        this.ek = a;
        if (b != this.ek) {
            this.dc("LowerCalloutTextColor", b, this.ek);
        }
    }
    get e4() {
        return this.ej;
    }
    set e4(a) {
        let b = this.ej;
        this.ej = a;
        if (b != this.ej) {
            this.dc("LowerCalloutOutline", b, this.ej);
        }
    }
    get bb() {
        return this.as;
    }
    set bb(a) {
        let b = this.as;
        this.as = a;
        if (b != this.as) {
            this.dc("LowerCalloutStrokeThickness", b, this.as);
        }
    }
    get ev() {
        return this.ea;
    }
    set ev(a) {
        let b = this.ea;
        this.ea = a;
        if (b != this.ea) {
            this.dc("HigherCalloutBrush", b, this.ea);
        }
    }
    get ex() {
        return this.ec;
    }
    set ex(a) {
        let b = this.ec;
        this.ec = a;
        if (b != this.ec) {
            this.dc("HigherCalloutTextColor", b, this.ec);
        }
    }
    get ew() {
        return this.eb;
    }
    set ew(a) {
        let b = this.eb;
        this.eb = a;
        if (b != this.eb) {
            this.dc("HigherCalloutOutline", b, this.eb);
        }
    }
    get a6() {
        return this.am;
    }
    set a6(a) {
        let b = this.am;
        this.am = a;
        if (b != this.am) {
            this.dc("HigherCalloutStrokeThickness", b, this.am);
        }
    }
    get ab() {
        return false;
    }
    get z() {
        return false;
    }
    get y() {
        return false;
    }
    get aa() {
        return false;
    }
    dc(a, b, c) {
        this.dj(a, b, c);
        if (this.propertyChanged != null) {
            this.propertyChanged(this, new PropertyChangedEventArgs(a));
        }
    }
    dj(a, b, c) {
        switch (a) {
            case "PixelScalingRatio":
                this.a4 = this.bi;
                break;
            case "ActualPixelScalingRatio":
                if (this.g != null) {
                    this.g.aq();
                }
                break;
            case "Orientation":
                this.db();
                this.trackDirty();
                break;
            case "TrackStartInset":
            case "TrackEndInset":
            case "StartInset":
            case "EndInset":
                this.c5();
                this.trackDirty();
                break;
            case "MaxZoomWidth":
            case "MinZoomWidth":
                this.dh();
                this.trackDirty();
                break;
            case "WindowRect":
                if (!this.w) {
                    this.af = true;
                    this.df();
                    this.trackDirty();
                    this.c3();
                    this.af = false;
                }
                break;
            case "LowerThumbBrush":
            case "LowerThumbOutline":
            case "LowerThumbRidgesBrush":
            case "LowerThumbStrokeThickness":
                this.d2();
                this.g.an();
                break;
            case "LowerThumbWidth":
            case "LowerThumbHeight":
                this.g.i.width = this.bf;
                this.g.i.height = this.bd;
                this.trackDirty();
                break;
            case "HigherThumbBrush":
            case "HigherThumbOutline":
            case "HigherThumbRidgesBrush":
            case "HigherThumbStrokeThickness":
                this.dx();
                this.g.an();
                break;
            case "HigherThumbWidth":
            case "HigherThumbHeight":
                this.g.i.width = this.bf;
                this.g.i.height = this.bd;
                this.trackDirty();
                break;
            case "LowerShadeBrush":
            case "LowerShadeOutline":
            case "LowerShadeStrokeThickness":
                this.d0();
                this.g.an();
                break;
            case "HigherShadeBrush":
            case "HigherShadeOutline":
            case "HigherShadeStrokeThickness":
                this.dv();
                this.g.an();
                break;
            case "RangeThumbBrush":
            case "RangeThumbOutline":
            case "RangeThumbRidgesBrush":
            case "RangeThumbStrokeThickness":
                this.d4();
                this.g.an();
                break;
            case "BarBrush":
            case "BarOutline":
            case "BarStrokeThickness":
                this.dq();
                this.g.an();
                break;
            case "LowerCalloutBrush":
            case "LowerCalloutOutline":
            case "LowerCalloutTextColor":
            case "LowerCalloutStrokeThickness":
                this.dy();
                this.g.an();
                break;
            case "HigherCalloutBrush":
            case "HigherCalloutOutline":
            case "HigherCalloutTextColor":
            case "HigherCalloutStrokeThickness":
                this.dt();
                this.g.an();
                break;
        }
    }
    dq() {
        let a = this.g.b;
        if (this.et == null) {
            a.barBox._fill = a.getBarBoxDefaultBrush();
        }
        else {
            a.barBox._fill = this.et;
        }
        if (this.eu == null) {
            a.barBox._stroke = a.getBarBoxDefaultOutline();
        }
        else {
            a.barBox._stroke = this.eu;
        }
        if (this.a5 == NaN) {
            a.barBox.ac = a.getBarBoxDefaultStrokeThickness();
        }
        else {
            a.barBox.ac = this.a5;
        }
    }
    dy() {
        let a = this.g.g;
        if (this.e3 == null) {
            a.calloutBox._fill = a.getCalloutBoxDefaultBrush();
        }
        else {
            a.calloutBox._fill = this.e3;
        }
        if (this.e4 == null) {
            a.calloutBox._stroke = a.getCalloutBoxDefaultStroke();
        }
        else {
            a.calloutBox._stroke = this.e4;
        }
        if (this.e5 == null) {
            a.calloutText.am = a.getCalloutTextDefaultBrush();
        }
        else {
            a.calloutText.am = this.e5;
        }
        if (this.bb == NaN) {
            a.calloutBox.ac = a.getCalloutBoxDefaultStrokeThickness();
        }
        else {
            a.calloutBox.ac = this.bb;
        }
    }
    dt() {
        let a = this.g.f;
        if (this.ev == null) {
            a.calloutBox._fill = a.getCalloutBoxDefaultBrush();
        }
        else {
            a.calloutBox._fill = this.ev;
        }
        if (this.ew == null) {
            a.calloutBox._stroke = a.getCalloutBoxDefaultStroke();
        }
        else {
            a.calloutBox._stroke = this.ew;
        }
        if (this.ex == null) {
            a.calloutText.am = a.getCalloutTextDefaultBrush();
        }
        else {
            a.calloutText.am = this.ex;
        }
        if (this.a6 == NaN) {
            a.calloutBox.ac = a.getCalloutBoxDefaultStrokeThickness();
        }
        else {
            a.calloutBox.ac = this.a6;
        }
    }
    d2() {
        let a = this.g.i;
        if (this.e8 == null) {
            a.thumbBox._fill = a.getThumbBoxDefaultBrush();
        }
        else {
            a.thumbBox._fill = this.e8;
        }
        if (this.e9 == null) {
            a.thumbBox._stroke = a.getThumbBoxDefaultStroke();
        }
        else {
            a.thumbBox._stroke = this.e9;
        }
        if (this.fa == null) {
            a.thumbRidges._stroke = a.getThumbRidgesDefaultStroke();
        }
        else {
            a.thumbRidges._stroke = this.fa;
        }
        if (this.be == NaN) {
            a.thumbBox.ac = a.getThumbBoxDefaultStrokeThickness();
        }
        else {
            a.thumbBox.ac = this.be;
        }
    }
    d4() {
        let a = this.g.c;
        if (this.fb == null) {
            a.thumbBox._fill = a.getThumbBoxDefaultBrush();
        }
        else {
            a.thumbBox._fill = this.fb;
        }
        if (this.fc == null) {
            a.thumbBox._stroke = a.getThumbBoxDefaultStroke();
        }
        else {
            a.thumbBox._stroke = this.fc;
        }
        if (this.fd == null) {
            a.thumbRidges._stroke = a.getThumbRidgesDefaultStroke();
        }
        else {
            a.thumbRidges._stroke = this.fd;
        }
        if (this.bj == NaN) {
            a.thumbBox.ac = a.getThumbBoxDefaultStrokeThickness();
        }
        else {
            a.thumbBox.ac = this.bj;
        }
    }
    d0() {
        let a = this.g.e;
        if (this.e6 == null) {
            a.shadeBox._fill = a.getShadeBoxDefaultBrush();
        }
        else {
            a.shadeBox._fill = this.e6;
        }
        if (this.e7 == null) {
            a.shadeOutline._stroke = a.getShadeOutlineDefaultBrush();
        }
        else {
            a.shadeOutline._stroke = this.e7;
        }
        if (this.bc == NaN) {
            a.shadeOutline.ac = a.getShadeOutlineDefaultStrokeThickness();
        }
        else {
            a.shadeOutline.ac = this.bc;
        }
    }
    dv() {
        let a = this.g.d;
        if (this.ey == null) {
            a.shadeBox._fill = a.getShadeBoxDefaultBrush();
        }
        else {
            a.shadeBox._fill = this.ey;
        }
        if (this.ez == null) {
            a.shadeOutline._stroke = a.getShadeOutlineDefaultBrush();
        }
        else {
            a.shadeOutline._stroke = this.ez;
        }
        if (this.a7 == NaN) {
            a.shadeOutline.ac = a.getShadeOutlineDefaultStrokeThickness();
        }
        else {
            a.shadeOutline.ac = this.a7;
        }
    }
    dx() {
        let a = this.g.h;
        if (this.e0 == null) {
            a.thumbBox._fill = a.getThumbBoxDefaultBrush();
        }
        else {
            a.thumbBox._fill = this.e0;
        }
        if (this.e1 == null) {
            a.thumbBox._stroke = a.getThumbBoxDefaultStroke();
        }
        else {
            a.thumbBox._stroke = this.e1;
        }
        if (this.e2 == null) {
            a.thumbRidges._stroke = a.getThumbRidgesDefaultStroke();
        }
        else {
            a.thumbRidges._stroke = this.e2;
        }
        if (this.a9 == NaN) {
            a.thumbBox.ac = a.getThumbBoxDefaultStrokeThickness();
        }
        else {
            a.thumbBox.ac = this.a9;
        }
    }
    df() {
        if (this.w) {
            return;
        }
        if (this.e == 0) {
            this.b.i = this.windowRect.left;
            this.a.i = this.windowRect.right;
            this.c.r = this.windowRect.width;
            this.c.n = this.windowRect.left + this.windowRect.width / 2;
        }
        else {
            this.b.i = this.windowRect.top;
            this.a.i = this.windowRect.bottom;
            this.c.r = this.windowRect.height;
            this.c.n = this.windowRect.top + this.windowRect.height / 2;
        }
    }
    dh() {
        this.c.m = this.bh;
        this.c.l = this.bg;
    }
    c5() {
        if (this.fj.isEmpty) {
            return;
        }
        this.de(this.fj.left, this.fj.top, this.fj.width, this.fj.height);
    }
    db() {
        if (this.e == 0) {
            this.g.i.width = this.bf;
            this.g.i.height = this.bd;
            this.g.h.width = this.ba;
            this.g.h.height = this.a8;
        }
        else {
            this.g.i.height = this.bf;
            this.g.i.width = this.bd;
            this.g.h.height = this.ba;
            this.g.h.width = this.a8;
        }
        if (this.fj.isEmpty) {
            return;
        }
        this.de(this.fj.left, this.fj.top, this.fj.width, this.fj.height);
    }
    provideContainer(a) {
        this.g.ar(a);
    }
    notifySizeChanged() {
        this.g.ao();
    }
    get l() {
        return this.k;
    }
    dn(a) {
        this.ak = a;
        this.aj = this.c.n;
        this.ar = this.aj;
        this.k.v();
    }
    cy() {
        if (this.k.f()) {
            this.k.w();
        }
    }
    cx(a, b) {
        let c = this.k.o;
        let d = this.aj + c * (this.ak - this.aj);
        let e = d - this.ar;
        this.ar = d;
        this.c.o(e);
        if (this.k.f()) {
            this.d1(this.b);
            this.dw(this.a);
            this.c3();
        }
        else {
            this.c1();
            this.c0();
        }
    }
    c3() {
        this.g.ai();
    }
    trackDirty() {
        this.p = true;
        if (this.g == null) {
            return;
        }
        this.g.an();
    }
    show() {
        if (this.g != null) {
            this.g.aw();
        }
    }
    hide() {
        if (this.g != null) {
            this.g.al();
        }
    }
}
ZoomSlider.$t = markType(ZoomSlider, 'ZoomSlider', Base.$, [ITrackOwner_$type, INotifyPropertyChanged_$type, IZoomSlider_$type]);
