package q2;

import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import java.util.ArrayList;
import java.util.List;
import q2.d;
import v2.i;

/* loaded from: classes.dex */
public final class k implements r {

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

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

    /* renamed from: c, reason: collision with root package name */
    private final rm.o f33338c;

    /* renamed from: d, reason: collision with root package name */
    private final rm.o f33339d;

    /* renamed from: e, reason: collision with root package name */
    private final List f33340e;

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

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final Float invoke() {
            int m10;
            Object obj;
            r b10;
            List f10 = k.this.f();
            if (f10.isEmpty()) {
                obj = null;
            } else {
                Object obj2 = f10.get(0);
                float b11 = ((q) obj2).b().b();
                m10 = sm.u.m(f10);
                int i10 = 1;
                if (1 <= m10) {
                    while (true) {
                        Object obj3 = f10.get(i10);
                        float b12 = ((q) obj3).b().b();
                        if (Float.compare(b11, b12) < 0) {
                            obj2 = obj3;
                            b11 = b12;
                        }
                        if (i10 == m10) {
                            break;
                        }
                        i10++;
                    }
                }
                obj = obj2;
            }
            q qVar = (q) obj;
            return Float.valueOf((qVar == null || (b10 = qVar.b()) == null) ? BitmapDescriptorFactory.HUE_RED : b10.b());
        }
    }

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

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final Float invoke() {
            int m10;
            Object obj;
            r b10;
            List f10 = k.this.f();
            if (f10.isEmpty()) {
                obj = null;
            } else {
                Object obj2 = f10.get(0);
                float a10 = ((q) obj2).b().a();
                m10 = sm.u.m(f10);
                int i10 = 1;
                if (1 <= m10) {
                    while (true) {
                        Object obj3 = f10.get(i10);
                        float a11 = ((q) obj3).b().a();
                        if (Float.compare(a10, a11) < 0) {
                            obj2 = obj3;
                            a10 = a11;
                        }
                        if (i10 == m10) {
                            break;
                        }
                        i10++;
                    }
                }
                obj = obj2;
            }
            q qVar = (q) obj;
            return Float.valueOf((qVar == null || (b10 = qVar.b()) == null) ? BitmapDescriptorFactory.HUE_RED : b10.a());
        }
    }

    public k(d dVar, o0 o0Var, List list, c3.d dVar2, i.b bVar) {
        rm.o b10;
        rm.o b11;
        d n10;
        List b12;
        this.f33336a = dVar;
        this.f33337b = list;
        rm.s sVar = rm.s.NONE;
        b10 = rm.q.b(sVar, new b());
        this.f33338c = b10;
        b11 = rm.q.b(sVar, new a());
        this.f33339d = b11;
        u L = o0Var.L();
        List m10 = e.m(dVar, L);
        ArrayList arrayList = new ArrayList(m10.size());
        int size = m10.size();
        for (int i10 = 0; i10 < size; i10++) {
            d.c cVar = (d.c) m10.get(i10);
            n10 = e.n(dVar, cVar.h(), cVar.f());
            u h10 = h((u) cVar.g(), L);
            String j10 = n10.j();
            o0 H = o0Var.H(h10);
            List g10 = n10.g();
            b12 = l.b(g(), cVar.h(), cVar.f());
            arrayList.add(new q(s.a(j10, H, g10, b12, dVar2, bVar), cVar.h(), cVar.f()));
        }
        this.f33340e = arrayList;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final u h(u uVar, u uVar2) {
        u a10;
        if (!b3.l.j(uVar.i(), b3.l.f6705b.f())) {
            return uVar;
        }
        a10 = uVar.a((r22 & 1) != 0 ? uVar.f33369a : 0, (r22 & 2) != 0 ? uVar.f33370b : uVar2.i(), (r22 & 4) != 0 ? uVar.f33371c : 0L, (r22 & 8) != 0 ? uVar.f33372d : null, (r22 & 16) != 0 ? uVar.f33373e : null, (r22 & 32) != 0 ? uVar.f33374f : null, (r22 & 64) != 0 ? uVar.f33375g : 0, (r22 & 128) != 0 ? uVar.f33376h : 0, (r22 & 256) != 0 ? uVar.f33377i : null);
        return a10;
    }

    @Override // q2.r
    public float a() {
        return ((Number) this.f33338c.getValue()).floatValue();
    }

    @Override // q2.r
    public float b() {
        return ((Number) this.f33339d.getValue()).floatValue();
    }

    @Override // q2.r
    public boolean c() {
        List list = this.f33340e;
        int size = list.size();
        for (int i10 = 0; i10 < size; i10++) {
            if (((q) list.get(i10)).b().c()) {
                return true;
            }
        }
        return false;
    }

    public final d e() {
        return this.f33336a;
    }

    public final List f() {
        return this.f33340e;
    }

    public final List g() {
        return this.f33337b;
    }
}
