package vo;

import hp.e0;
import hp.m0;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import sm.c0;
import tn.g0;

/* loaded from: classes3.dex */
public final class h {

    /* renamed from: a, reason: collision with root package name */
    public static final h f40379a = new h();

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes3.dex */
    public static final class a extends kotlin.jvm.internal.v implements dn.l {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ qn.h f40380p;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        a(qn.h hVar) {
            super(1);
            this.f40380p = hVar;
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final e0 invoke(g0 it) {
            kotlin.jvm.internal.t.g(it, "it");
            m0 O = it.m().O(this.f40380p);
            kotlin.jvm.internal.t.f(O, "getPrimitiveArrayKotlinType(...)");
            return O;
        }
    }

    private h() {
    }

    private final b b(List list, g0 g0Var, qn.h hVar) {
        List S0;
        S0 = c0.S0(list);
        ArrayList arrayList = new ArrayList();
        Iterator it = S0.iterator();
        while (it.hasNext()) {
            g d10 = d(this, it.next(), null, 2, null);
            if (d10 != null) {
                arrayList.add(d10);
            }
        }
        if (g0Var == null) {
            return new b(arrayList, new a(hVar));
        }
        m0 O = g0Var.m().O(hVar);
        kotlin.jvm.internal.t.f(O, "getPrimitiveArrayKotlinType(...)");
        return new v(arrayList, O);
    }

    public static /* synthetic */ g d(h hVar, Object obj, g0 g0Var, int i10, Object obj2) {
        if ((i10 & 2) != 0) {
            g0Var = null;
        }
        return hVar.c(obj, g0Var);
    }

    public final b a(List value, e0 type) {
        kotlin.jvm.internal.t.g(value, "value");
        kotlin.jvm.internal.t.g(type, "type");
        return new v(value, type);
    }

    public final g c(Object obj, g0 g0Var) {
        List L0;
        List F0;
        List G0;
        List E0;
        List I0;
        List H0;
        List K0;
        List D0;
        if (obj instanceof Byte) {
            return new d(((Number) obj).byteValue());
        }
        if (obj instanceof Short) {
            return new t(((Number) obj).shortValue());
        }
        if (obj instanceof Integer) {
            return new m(((Number) obj).intValue());
        }
        if (obj instanceof Long) {
            return new q(((Number) obj).longValue());
        }
        if (obj instanceof Character) {
            return new e(((Character) obj).charValue());
        }
        if (obj instanceof Float) {
            return new l(((Number) obj).floatValue());
        }
        if (obj instanceof Double) {
            return new i(((Number) obj).doubleValue());
        }
        if (obj instanceof Boolean) {
            return new c(((Boolean) obj).booleanValue());
        }
        if (obj instanceof String) {
            return new u((String) obj);
        }
        if (obj instanceof byte[]) {
            D0 = sm.p.D0((byte[]) obj);
            return b(D0, g0Var, qn.h.BYTE);
        }
        if (obj instanceof short[]) {
            K0 = sm.p.K0((short[]) obj);
            return b(K0, g0Var, qn.h.SHORT);
        }
        if (obj instanceof int[]) {
            H0 = sm.p.H0((int[]) obj);
            return b(H0, g0Var, qn.h.INT);
        }
        if (obj instanceof long[]) {
            I0 = sm.p.I0((long[]) obj);
            return b(I0, g0Var, qn.h.LONG);
        }
        if (obj instanceof char[]) {
            E0 = sm.p.E0((char[]) obj);
            return b(E0, g0Var, qn.h.CHAR);
        }
        if (obj instanceof float[]) {
            G0 = sm.p.G0((float[]) obj);
            return b(G0, g0Var, qn.h.FLOAT);
        }
        if (obj instanceof double[]) {
            F0 = sm.p.F0((double[]) obj);
            return b(F0, g0Var, qn.h.DOUBLE);
        }
        if (obj instanceof boolean[]) {
            L0 = sm.p.L0((boolean[]) obj);
            return b(L0, g0Var, qn.h.BOOLEAN);
        }
        if (obj == null) {
            return new r();
        }
        return null;
    }
}
