package j.p0.d;

import j.k0.j0;
import j.k0.k0;
import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/* JADX INFO: compiled from: ClassReference.kt */
/* JADX INFO: loaded from: classes.dex */
public final class h implements j.s0.c<Object>, g {
    public static final a d = new a(null);
    private static final Map<Class<? extends j.g<?>>, Integer> e;
    private static final HashMap<String, String> f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    private static final HashMap<String, String> f884g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    private static final HashMap<String, String> f885h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    private static final Map<String, String> f886i;
    private final Class<?> b;

    /* JADX INFO: compiled from: ClassReference.kt */
    public static final class a {
        private a() {
        }

        public /* synthetic */ a(j jVar) {
            this();
        }

        public final String a(Class<?> cls) {
            String str;
            r.f(cls, "jClass");
            String str2 = null;
            if (!cls.isAnonymousClass()) {
                if (cls.isLocalClass()) {
                    String simpleName = cls.getSimpleName();
                    Method enclosingMethod = cls.getEnclosingMethod();
                    if (enclosingMethod != null) {
                        r.e(simpleName, "name");
                        String strB0 = j.u0.r.B0(simpleName, enclosingMethod.getName() + '$', null, 2, null);
                        if (strB0 != null) {
                            return strB0;
                        }
                    }
                    Constructor<?> enclosingConstructor = cls.getEnclosingConstructor();
                    if (enclosingConstructor == null) {
                        r.e(simpleName, "name");
                        return j.u0.r.A0(simpleName, '$', null, 2, null);
                    }
                    r.e(simpleName, "name");
                    return j.u0.r.B0(simpleName, enclosingConstructor.getName() + '$', null, 2, null);
                }
                if (!cls.isArray()) {
                    String str3 = (String) h.f886i.get(cls.getName());
                    return str3 == null ? cls.getSimpleName() : str3;
                }
                Class<?> componentType = cls.getComponentType();
                if (componentType.isPrimitive() && (str = (String) h.f886i.get(componentType.getName())) != null) {
                    str2 = str + "Array";
                }
                if (str2 == null) {
                    return "Array";
                }
            }
            return str2;
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    static {
        int i2 = 0;
        List listI = j.k0.o.i(j.p0.c.a.class, j.p0.c.l.class, j.p0.c.p.class, j.p0.c.q.class, j.p0.c.r.class, j.p0.c.s.class, j.p0.c.t.class, j.p0.c.u.class, j.p0.c.v.class, j.p0.c.w.class, j.p0.c.b.class, j.p0.c.c.class, j.p0.c.d.class, j.p0.c.e.class, j.p0.c.f.class, j.p0.c.g.class, j.p0.c.h.class, j.p0.c.i.class, j.p0.c.j.class, j.p0.c.k.class, j.p0.c.m.class, j.p0.c.n.class, j.p0.c.o.class);
        ArrayList arrayList = new ArrayList(j.k0.p.p(listI, 10));
        for (Object obj : listI) {
            int i3 = i2 + 1;
            if (i2 < 0) {
                j.k0.m.o();
                throw null;
            }
            arrayList.add(j.v.a((Class) obj, Integer.valueOf(i2)));
            i2 = i3;
        }
        e = k0.l(arrayList);
        HashMap<String, String> map = new HashMap<>();
        map.put("boolean", "kotlin.Boolean");
        map.put("char", "kotlin.Char");
        map.put("byte", "kotlin.Byte");
        map.put("short", "kotlin.Short");
        map.put("int", "kotlin.Int");
        map.put("float", "kotlin.Float");
        map.put("long", "kotlin.Long");
        map.put("double", "kotlin.Double");
        f = map;
        HashMap<String, String> map2 = new HashMap<>();
        map2.put("java.lang.Boolean", "kotlin.Boolean");
        map2.put("java.lang.Character", "kotlin.Char");
        map2.put("java.lang.Byte", "kotlin.Byte");
        map2.put("java.lang.Short", "kotlin.Short");
        map2.put("java.lang.Integer", "kotlin.Int");
        map2.put("java.lang.Float", "kotlin.Float");
        map2.put("java.lang.Long", "kotlin.Long");
        map2.put("java.lang.Double", "kotlin.Double");
        f884g = map2;
        HashMap<String, String> map3 = new HashMap<>();
        map3.put("java.lang.Object", "kotlin.Any");
        map3.put("java.lang.String", "kotlin.String");
        map3.put("java.lang.CharSequence", "kotlin.CharSequence");
        map3.put("java.lang.Throwable", "kotlin.Throwable");
        map3.put("java.lang.Cloneable", "kotlin.Cloneable");
        map3.put("java.lang.Number", "kotlin.Number");
        map3.put("java.lang.Comparable", "kotlin.Comparable");
        map3.put("java.lang.Enum", "kotlin.Enum");
        map3.put("java.lang.annotation.Annotation", "kotlin.Annotation");
        map3.put("java.lang.Iterable", "kotlin.collections.Iterable");
        map3.put("java.util.Iterator", "kotlin.collections.Iterator");
        map3.put("java.util.Collection", "kotlin.collections.Collection");
        map3.put("java.util.List", "kotlin.collections.List");
        map3.put("java.util.Set", "kotlin.collections.Set");
        map3.put("java.util.ListIterator", "kotlin.collections.ListIterator");
        map3.put("java.util.Map", "kotlin.collections.Map");
        map3.put("java.util.Map$Entry", "kotlin.collections.Map.Entry");
        map3.put("kotlin.jvm.internal.StringCompanionObject", "kotlin.String.Companion");
        map3.put("kotlin.jvm.internal.EnumCompanionObject", "kotlin.Enum.Companion");
        map3.putAll(f);
        map3.putAll(f884g);
        Collection<String> collectionValues = f.values();
        r.e(collectionValues, "primitiveFqNames.values");
        for (String str : collectionValues) {
            StringBuilder sb = new StringBuilder();
            sb.append("kotlin.jvm.internal.");
            r.e(str, "kotlinName");
            sb.append(j.u0.r.D0(str, '.', null, 2, null));
            sb.append("CompanionObject");
            j.p pVarA = j.v.a(sb.toString(), str + ".Companion");
            map3.put(pVarA.c(), pVarA.d());
        }
        for (Map.Entry<Class<? extends j.g<?>>, Integer> entry : e.entrySet()) {
            map3.put(entry.getKey().getName(), "kotlin.Function" + entry.getValue().intValue());
        }
        f885h = map3;
        LinkedHashMap linkedHashMap = new LinkedHashMap(j0.b(map3.size()));
        for (Map.Entry entry2 : map3.entrySet()) {
            linkedHashMap.put(entry2.getKey(), j.u0.r.D0((String) entry2.getValue(), '.', null, 2, null));
        }
        f886i = linkedHashMap;
    }

    public h(Class<?> cls) {
        r.f(cls, "jClass");
        this.b = cls;
    }

    private final Void d() {
        throw new j.p0.b();
    }

    @Override // j.s0.c
    public String a() {
        return d.a(b());
    }

    @Override // j.p0.d.g
    public Class<?> b() {
        return this.b;
    }

    public boolean equals(Object obj) {
        return (obj instanceof h) && r.a(j.p0.a.b(this), j.p0.a.b((j.s0.c) obj));
    }

    @Override // j.s0.a
    public List<Annotation> getAnnotations() {
        d();
        throw null;
    }

    public int hashCode() {
        return j.p0.a.b(this).hashCode();
    }

    public String toString() {
        return b().toString() + " (Kotlin reflection is not available)";
    }
}
