package g3;

import com.google.firebase.sessions.settings.RemoteSettings;

/* JADX INFO: loaded from: classes.dex */
public abstract class u {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public static final S4.m f16581a = new S4.m("/(medium|large|full)/");

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final S4.m f16582b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static final S4.m f16583c;

    static {
        S4.n[] nVarArr = S4.n.f6290a;
        f16582b = new S4.m("/(medium|large|thumb)/", 0);
        f16583c = new S4.m("/t/p/[^/]+/");
    }

    public static final String a(String str, boolean z6) {
        if (str == null || S4.p.Q0(str)) {
            return "";
        }
        if (S4.p.D0(str, "image.tmdb.org", true)) {
            return f16583c.f(str, Z0.o.o("/t/p/", z6 ? "w780" : "w500", RemoteSettings.FORWARD_SLASH_STRING));
        }
        return z6 ? str : f16581a.f(str, "/thumb/");
    }
}
