package h0;

import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import y0.c2;
import y0.e3;
import y0.m1;
import y0.n1;

/* loaded from: classes.dex */
public final class x {

    /* renamed from: a, reason: collision with root package name */
    private final c0 f20649a;

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

    /* renamed from: c, reason: collision with root package name */
    private final m1 f20651c;

    /* renamed from: d, reason: collision with root package name */
    private boolean f20652d;

    /* renamed from: e, reason: collision with root package name */
    private Object f20653e;

    /* renamed from: f, reason: collision with root package name */
    private final g0.a0 f20654f;

    public x(int i10, float f10, c0 c0Var) {
        this.f20649a = c0Var;
        this.f20650b = e3.a(i10);
        this.f20651c = c2.a(f10);
        this.f20654f = new g0.a0(i10, 30, 100);
    }

    private final void g(int i10) {
        this.f20650b.i(i10);
    }

    private final void h(float f10) {
        this.f20651c.h(f10);
    }

    private final void i(int i10, float f10) {
        g(i10);
        this.f20654f.q(i10);
        h(f10);
    }

    public final void a(int i10) {
        h(c() + (this.f20649a.H() == 0 ? BitmapDescriptorFactory.HUE_RED : i10 / this.f20649a.H()));
    }

    public final int b() {
        return this.f20650b.d();
    }

    public final float c() {
        return this.f20651c.b();
    }

    public final g0.a0 d() {
        return this.f20654f;
    }

    public final int e(r rVar, int i10) {
        int a10 = g0.t.a(rVar, this.f20653e, i10);
        if (i10 != a10) {
            g(a10);
            this.f20654f.q(i10);
        }
        return a10;
    }

    public final void f(int i10, float f10) {
        i(i10, f10);
        this.f20653e = null;
    }

    public final void j(float f10) {
        h(f10);
    }

    public final void k(u uVar) {
        e r10 = uVar.r();
        this.f20653e = r10 != null ? r10.d() : null;
        if (this.f20652d || (!uVar.j().isEmpty())) {
            this.f20652d = true;
            e r11 = uVar.r();
            i(r11 != null ? r11.getIndex() : 0, uVar.s());
        }
    }
}
