package I0;

/* JADX INFO: loaded from: classes.dex */
public final class L {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final H f2213a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public boolean f2214b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public boolean f2215c;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public boolean f2217e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public boolean f2218f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public boolean f2219g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public int f2220h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public int f2221i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public boolean f2222j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public boolean f2223k;
    public int l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public boolean f2224m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public boolean f2225n;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public int f2226o;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public U f2228q;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public D f2216d = D.f2140e;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    public final Y f2227p = new Y(this);

    public L(H h5) {
        this.f2213a = h5;
    }

    public final AbstractC0300j0 a() {
        return (AbstractC0300j0) this.f2213a.f2162J.f2363e;
    }

    public final void b() {
        D d6 = this.f2213a.f2163K.f2216d;
        if (d6 == D.f2138c || d6 == D.f2139d) {
            if (this.f2227p.f2302D) {
                g(true);
            } else {
                f(true);
            }
        }
        if (d6 == D.f2139d) {
            U u6 = this.f2228q;
            if (u6 == null || !u6.f2282x) {
                h(true);
            } else {
                i(true);
            }
        }
    }

    public final void c(long j4) throws Throwable {
        U u6 = this.f2228q;
        if (u6 != null) {
            D d6 = D.f2137b;
            L l = u6.f2268f;
            l.f2216d = d6;
            l.f2217e = false;
            u6.f2264B = j4;
            H h5 = l.f2213a;
            v0 snapshotObserver = ((J0.A) K.a(h5)).getSnapshotObserver();
            snapshotObserver.f2468a.observeReads(h5, snapshotObserver.f2469b, u6.f2265C);
            l.f2218f = true;
            l.f2219g = true;
            boolean zO = AbstractC0303l.o(h5);
            Y y6 = l.f2227p;
            if (zO) {
                y6.f2328y = true;
                y6.f2329z = true;
            } else {
                y6.f2327x = true;
            }
            l.f2216d = D.f2140e;
        }
    }

    public final void d(int i6) {
        int i7 = this.l;
        this.l = i6;
        if ((i7 == 0) != (i6 == 0)) {
            H hT = this.f2213a.t();
            L l = hT != null ? hT.f2163K : null;
            if (l != null) {
                if (i6 == 0) {
                    l.d(l.l - 1);
                } else {
                    l.d(l.l + 1);
                }
            }
        }
    }

    public final void e(int i6) {
        int i7 = this.f2226o;
        this.f2226o = i6;
        if ((i7 == 0) != (i6 == 0)) {
            H hT = this.f2213a.t();
            L l = hT != null ? hT.f2163K : null;
            if (l != null) {
                if (i6 == 0) {
                    l.e(l.f2226o - 1);
                } else {
                    l.e(l.f2226o + 1);
                }
            }
        }
    }

    public final void f(boolean z6) {
        if (this.f2223k != z6) {
            this.f2223k = z6;
            if (z6 && !this.f2222j) {
                d(this.l + 1);
            } else {
                if (z6 || this.f2222j) {
                    return;
                }
                d(this.l - 1);
            }
        }
    }

    public final void g(boolean z6) {
        if (this.f2222j != z6) {
            this.f2222j = z6;
            if (z6 && !this.f2223k) {
                d(this.l + 1);
            } else {
                if (z6 || this.f2223k) {
                    return;
                }
                d(this.l - 1);
            }
        }
    }

    public final void h(boolean z6) {
        if (this.f2225n != z6) {
            this.f2225n = z6;
            if (z6 && !this.f2224m) {
                e(this.f2226o + 1);
            } else {
                if (z6 || this.f2224m) {
                    return;
                }
                e(this.f2226o - 1);
            }
        }
    }

    public final void i(boolean z6) {
        if (this.f2224m != z6) {
            this.f2224m = z6;
            if (z6 && !this.f2225n) {
                e(this.f2226o + 1);
            } else {
                if (z6 || this.f2225n) {
                    return;
                }
                e(this.f2226o - 1);
            }
        }
    }

    public final void j() {
        Y y6 = this.f2227p;
        Object obj = y6.f2324u;
        H h5 = this.f2213a;
        L l = y6.f2313f;
        if ((obj != null || l.a().S() != null) && y6.f2323t) {
            y6.f2323t = false;
            y6.f2324u = l.a().S();
            H hT = h5.t();
            if (hT != null) {
                H.V(hT, false, 7);
            }
        }
        U u6 = this.f2228q;
        if (u6 != null) {
            Object obj2 = u6.f2263A;
            L l6 = u6.f2268f;
            if (obj2 == null) {
                Q qT0 = l6.a().T0();
                kotlin.jvm.internal.o.e(qT0);
                if (qT0.f2251r.S() == null) {
                    return;
                }
            }
            if (u6.f2284z) {
                u6.f2284z = false;
                Q qT02 = l6.a().T0();
                kotlin.jvm.internal.o.e(qT02);
                u6.f2263A = qT02.f2251r.S();
                if (AbstractC0303l.o(h5)) {
                    H hT2 = h5.t();
                    if (hT2 != null) {
                        H.V(hT2, false, 7);
                        return;
                    }
                    return;
                }
                H hT3 = h5.t();
                if (hT3 != null) {
                    H.T(hT3, false, 7);
                }
            }
        }
    }
}
