package nn;

import hp.t1;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import kotlin.jvm.internal.w0;
import nn.j0;
import tn.e1;

/* loaded from: classes3.dex */
public final class f0 implements kn.q, p {

    /* renamed from: s, reason: collision with root package name */
    static final /* synthetic */ kn.l[] f30177s = {kotlin.jvm.internal.p0.h(new kotlin.jvm.internal.g0(kotlin.jvm.internal.p0.b(f0.class), "upperBounds", "getUpperBounds()Ljava/util/List;"))};

    /* renamed from: p, reason: collision with root package name */
    private final e1 f30178p;

    /* renamed from: q, reason: collision with root package name */
    private final j0.a f30179q;

    /* renamed from: r, reason: collision with root package name */
    private final g0 f30180r;

    /* loaded from: classes3.dex */
    public /* synthetic */ class a {

        /* renamed from: a, reason: collision with root package name */
        public static final /* synthetic */ int[] f30181a;

        static {
            int[] iArr = new int[t1.values().length];
            try {
                iArr[t1.INVARIANT.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                iArr[t1.IN_VARIANCE.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                iArr[t1.OUT_VARIANCE.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            f30181a = iArr;
        }
    }

    /* loaded from: classes3.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 List invoke() {
            int v10;
            List upperBounds = f0.this.getDescriptor().getUpperBounds();
            kotlin.jvm.internal.t.f(upperBounds, "getUpperBounds(...)");
            List list = upperBounds;
            v10 = sm.v.v(list, 10);
            ArrayList arrayList = new ArrayList(v10);
            Iterator it = list.iterator();
            while (it.hasNext()) {
                arrayList.add(new e0((hp.e0) it.next(), null, 2, null));
            }
            return arrayList;
        }
    }

    public f0(g0 g0Var, e1 descriptor) {
        o oVar;
        Object A0;
        kotlin.jvm.internal.t.g(descriptor, "descriptor");
        this.f30178p = descriptor;
        this.f30179q = j0.b(new b());
        if (g0Var == null) {
            tn.m b10 = getDescriptor().b();
            kotlin.jvm.internal.t.f(b10, "getContainingDeclaration(...)");
            if (b10 instanceof tn.e) {
                A0 = c((tn.e) b10);
            } else {
                if (!(b10 instanceof tn.b)) {
                    throw new h0("Unknown type parameter container: " + b10);
                }
                tn.m b11 = ((tn.b) b10).b();
                kotlin.jvm.internal.t.f(b11, "getContainingDeclaration(...)");
                if (b11 instanceof tn.e) {
                    oVar = c((tn.e) b11);
                } else {
                    fp.g gVar = b10 instanceof fp.g ? (fp.g) b10 : null;
                    if (gVar == null) {
                        throw new h0("Non-class callable descriptor must be deserialized: " + b10);
                    }
                    kn.d e10 = cn.a.e(a(gVar));
                    kotlin.jvm.internal.t.e(e10, "null cannot be cast to non-null type kotlin.reflect.jvm.internal.KClassImpl<*>");
                    oVar = (o) e10;
                }
                A0 = b10.A0(new i(oVar), rm.n0.f34904a);
            }
            kotlin.jvm.internal.t.d(A0);
            g0Var = (g0) A0;
        }
        this.f30180r = g0Var;
    }

    private final Class a(fp.g gVar) {
        Class d10;
        fp.f X = gVar.X();
        ko.n nVar = X instanceof ko.n ? (ko.n) X : null;
        Object g10 = nVar != null ? nVar.g() : null;
        xn.f fVar = g10 instanceof xn.f ? (xn.f) g10 : null;
        if (fVar != null && (d10 = fVar.d()) != null) {
            return d10;
        }
        throw new h0("Container of deserialized member is not resolved: " + gVar);
    }

    private final o c(tn.e eVar) {
        Class q10 = p0.q(eVar);
        o oVar = (o) (q10 != null ? cn.a.e(q10) : null);
        if (oVar != null) {
            return oVar;
        }
        throw new h0("Type parameter container is not resolved: " + eVar.b());
    }

    @Override // nn.p
    /* renamed from: b, reason: merged with bridge method [inline-methods] */
    public e1 getDescriptor() {
        return this.f30178p;
    }

    public boolean equals(Object obj) {
        if (obj instanceof f0) {
            f0 f0Var = (f0) obj;
            if (kotlin.jvm.internal.t.b(this.f30180r, f0Var.f30180r) && kotlin.jvm.internal.t.b(getName(), f0Var.getName())) {
                return true;
            }
        }
        return false;
    }

    @Override // kn.q
    public String getName() {
        String e10 = getDescriptor().getName().e();
        kotlin.jvm.internal.t.f(e10, "asString(...)");
        return e10;
    }

    @Override // kn.q
    public List getUpperBounds() {
        Object b10 = this.f30179q.b(this, f30177s[0]);
        kotlin.jvm.internal.t.f(b10, "getValue(...)");
        return (List) b10;
    }

    public int hashCode() {
        return (this.f30180r.hashCode() * 31) + getName().hashCode();
    }

    @Override // kn.q
    public kn.s l() {
        int i10 = a.f30181a[getDescriptor().l().ordinal()];
        if (i10 == 1) {
            return kn.s.INVARIANT;
        }
        if (i10 == 2) {
            return kn.s.IN;
        }
        if (i10 == 3) {
            return kn.s.OUT;
        }
        throw new rm.t();
    }

    public String toString() {
        return w0.f26207p.a(this);
    }
}
