package x1;

import c3.t;
import kotlin.jvm.internal.v;
import rm.n0;
import s1.h0;
import y0.e3;
import y0.n1;
import y0.q1;
import y0.s3;

/* loaded from: classes.dex */
public final class q extends w1.b {

    /* renamed from: n, reason: collision with root package name */
    public static final int f50423n = 8;

    /* renamed from: g, reason: collision with root package name */
    private final q1 f50424g;

    /* renamed from: h, reason: collision with root package name */
    private final q1 f50425h;

    /* renamed from: i, reason: collision with root package name */
    private final m f50426i;

    /* renamed from: j, reason: collision with root package name */
    private final n1 f50427j;

    /* renamed from: k, reason: collision with root package name */
    private float f50428k;

    /* renamed from: l, reason: collision with root package name */
    private h0 f50429l;

    /* renamed from: m, reason: collision with root package name */
    private int f50430m;

    /* loaded from: classes.dex */
    static final class a extends v implements dn.a {
        a() {
            super(0);
        }

        @Override // dn.a
        public /* bridge */ /* synthetic */ Object invoke() {
            m477invoke();
            return n0.f34904a;
        }

        /* renamed from: invoke, reason: collision with other method in class */
        public final void m477invoke() {
            if (q.this.f50430m == q.this.o()) {
                q qVar = q.this;
                qVar.s(qVar.o() + 1);
            }
        }
    }

    public q(c cVar) {
        q1 d10;
        q1 d11;
        d10 = s3.d(r1.m.c(r1.m.f34339b.b()), null, 2, null);
        this.f50424g = d10;
        d11 = s3.d(Boolean.FALSE, null, 2, null);
        this.f50425h = d11;
        m mVar = new m(cVar);
        mVar.o(new a());
        this.f50426i = mVar;
        this.f50427j = e3.a(0);
        this.f50428k = 1.0f;
        this.f50430m = -1;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final int o() {
        return this.f50427j.d();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void s(int i10) {
        this.f50427j.i(i10);
    }

    @Override // w1.b
    protected boolean a(float f10) {
        this.f50428k = f10;
        return true;
    }

    @Override // w1.b
    protected boolean b(h0 h0Var) {
        this.f50429l = h0Var;
        return true;
    }

    @Override // w1.b
    public long h() {
        return p();
    }

    @Override // w1.b
    protected void j(u1.f fVar) {
        m mVar = this.f50426i;
        h0 h0Var = this.f50429l;
        if (h0Var == null) {
            h0Var = mVar.k();
        }
        if (n() && fVar.getLayoutDirection() == t.Rtl) {
            long j12 = fVar.j1();
            u1.d Q0 = fVar.Q0();
            long b10 = Q0.b();
            Q0.i().n();
            try {
                Q0.f().g(-1.0f, 1.0f, j12);
                mVar.i(fVar, this.f50428k, h0Var);
            } finally {
                Q0.i().x();
                Q0.g(b10);
            }
        } else {
            mVar.i(fVar, this.f50428k, h0Var);
        }
        this.f50430m = o();
    }

    public final boolean n() {
        return ((Boolean) this.f50425h.getValue()).booleanValue();
    }

    public final long p() {
        return ((r1.m) this.f50424g.getValue()).m();
    }

    public final void q(boolean z10) {
        this.f50425h.setValue(Boolean.valueOf(z10));
    }

    public final void r(h0 h0Var) {
        this.f50426i.n(h0Var);
    }

    public final void t(String str) {
        this.f50426i.p(str);
    }

    public final void u(long j10) {
        this.f50424g.setValue(r1.m.c(j10));
    }

    public final void v(long j10) {
        this.f50426i.q(j10);
    }
}
