package y2;

import b3.l;
import java.util.List;
import java.util.Locale;
import q2.o0;
import q2.x;
import q2.z;
import v2.i;

/* loaded from: classes.dex */
public abstract class e {
    public static final q2.r a(String str, o0 o0Var, List list, List list2, c3.d dVar, i.b bVar) {
        return new d(str, o0Var, list, list2, bVar, dVar);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final boolean c(o0 o0Var) {
        x a10;
        z w10 = o0Var.w();
        return !(((w10 == null || (a10 = w10.a()) == null) ? null : q2.g.d(a10.b())) == null ? false : q2.g.g(r1.j(), q2.g.f33289b.c()));
    }

    public static final int d(int i10, x2.e eVar) {
        Locale locale;
        l.a aVar = b3.l.f6705b;
        if (b3.l.j(i10, aVar.b())) {
            return 2;
        }
        if (!b3.l.j(i10, aVar.c())) {
            if (b3.l.j(i10, aVar.d())) {
                return 0;
            }
            if (b3.l.j(i10, aVar.e())) {
                return 1;
            }
            if (!(b3.l.j(i10, aVar.a()) ? true : b3.l.j(i10, aVar.f()))) {
                throw new IllegalStateException("Invalid TextDirection.".toString());
            }
            if (eVar == null || (locale = eVar.i(0).a()) == null) {
                locale = Locale.getDefault();
            }
            int a10 = androidx.core.text.g.a(locale);
            if (a10 == 0 || a10 != 1) {
                return 2;
            }
        }
        return 3;
    }
}
