package q2;

import android.os.Build;
import android.text.Spannable;
import android.text.SpannableString;
import b3.e;
import b3.f;
import b3.j;
import q2.d0;
import r2.u0;

/* loaded from: classes.dex */
public abstract class b {
    public static final /* synthetic */ CharSequence a(CharSequence charSequence) {
        return j(charSequence);
    }

    public static final /* synthetic */ int b(u0 u0Var, int i10) {
        return k(u0Var, i10);
    }

    public static final /* synthetic */ boolean c(o0 o0Var, boolean z10) {
        return l(o0Var, z10);
    }

    public static final /* synthetic */ int d(int i10) {
        return m(i10);
    }

    public static final /* synthetic */ int e(int i10) {
        return n(i10);
    }

    public static final /* synthetic */ int f(int i10) {
        return o(i10);
    }

    public static final /* synthetic */ int g(int i10) {
        return p(i10);
    }

    public static final /* synthetic */ int h(int i10) {
        return q(i10);
    }

    public static final /* synthetic */ int i(int i10) {
        return r(i10);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final CharSequence j(CharSequence charSequence) {
        if (charSequence.length() == 0) {
            return charSequence;
        }
        Spannable spannableString = charSequence instanceof Spannable ? (Spannable) charSequence : new SpannableString(charSequence);
        z2.c.u(spannableString, new t2.c(), spannableString.length() - 1, spannableString.length() - 1);
        return spannableString;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final int k(u0 u0Var, int i10) {
        int m10 = u0Var.m();
        for (int i11 = 0; i11 < m10; i11++) {
            if (u0Var.l(i11) > i10) {
                return i11;
            }
        }
        return u0Var.m();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final boolean l(o0 o0Var, boolean z10) {
        if (!z10 || c3.v.e(o0Var.q(), c3.w.g(0)) || c3.v.e(o0Var.q(), c3.v.f7436b.a())) {
            return false;
        }
        int z11 = o0Var.z();
        j.a aVar = b3.j.f6691b;
        return (b3.j.k(z11, aVar.g()) || b3.j.k(o0Var.z(), aVar.f()) || b3.j.k(o0Var.z(), aVar.c())) ? false : true;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final int m(int i10) {
        j.a aVar = b3.j.f6691b;
        if (b3.j.k(i10, aVar.d())) {
            return 3;
        }
        if (b3.j.k(i10, aVar.e())) {
            return 4;
        }
        if (b3.j.k(i10, aVar.a())) {
            return 2;
        }
        return (!b3.j.k(i10, aVar.f()) && b3.j.k(i10, aVar.b())) ? 1 : 0;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final int n(int i10) {
        f.b.a aVar = f.b.f6662a;
        if (f.b.e(i10, aVar.c())) {
            return 0;
        }
        if (f.b.e(i10, aVar.b())) {
            return 1;
        }
        return f.b.e(i10, aVar.a()) ? 2 : 0;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final int o(int i10) {
        e.a aVar = b3.e.f6651b;
        if (b3.e.g(i10, aVar.a())) {
            return Build.VERSION.SDK_INT <= 32 ? 2 : 4;
        }
        b3.e.g(i10, aVar.b());
        return 0;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final int p(int i10) {
        f.c.a aVar = f.c.f6667a;
        if (f.c.f(i10, aVar.a())) {
            return 0;
        }
        if (f.c.f(i10, aVar.b())) {
            return 1;
        }
        if (f.c.f(i10, aVar.c())) {
            return 2;
        }
        return f.c.f(i10, aVar.d()) ? 3 : 0;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final int q(int i10) {
        f.d.a aVar = f.d.f6673a;
        return (!f.d.d(i10, aVar.a()) && f.d.d(i10, aVar.b())) ? 1 : 0;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final int r(int i10) {
        d0.a aVar = d0.f33285a;
        return (!d0.d(i10, aVar.a()) && d0.d(i10, aVar.b())) ? 1 : 0;
    }
}
