package r3;

import F1.r;
import android.content.Context;
import java.nio.charset.Charset;
import java.util.Collections;
import java.util.Set;
import p3.C2721a;
import q.AbstractC2761L;
import x3.C3222g;
import x3.C3223h;

/* JADX INFO: loaded from: classes.dex */
public final class q {

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public static volatile k f23993e;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final u4.c f23994a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final u4.c f23995b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final w3.b f23996c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final C3222g f23997d;

    public q(u4.c cVar, u4.c cVar2, w3.b bVar, C3222g c3222g, C3223h c3223h) {
        this.f23994a = cVar;
        this.f23995b = cVar2;
        this.f23996c = bVar;
        this.f23997d = c3222g;
        c3223h.getClass();
        c3223h.f26028a.execute(new r(c3223h, 29));
    }

    public static q a() {
        k kVar = f23993e;
        if (kVar != null) {
            return (q) kVar.f23980f.get();
        }
        throw new IllegalStateException("Not initialized!");
    }

    public static void b(Context context) {
        if (f23993e == null) {
            synchronized (q.class) {
                try {
                    if (f23993e == null) {
                        C3.j jVar = new C3.j();
                        context.getClass();
                        jVar.f733a = context;
                        f23993e = jVar.c();
                    }
                } catch (Throwable th) {
                    throw th;
                }
            }
        }
    }

    public final o c(C2721a c2721a) {
        byte[] bytes;
        Set setUnmodifiableSet = c2721a != null ? Collections.unmodifiableSet(C2721a.f22969d) : Collections.singleton(new o3.b("proto"));
        o4.f fVarA = j.a();
        c2721a.getClass();
        fVarA.f21849b = "cct";
        String str = c2721a.f22972a;
        String str2 = c2721a.f22973b;
        if (str2 == null && str == null) {
            bytes = null;
        } else {
            if (str2 == null) {
                str2 = "";
            }
            bytes = AbstractC2761L.g("1$", str, "\\", str2).getBytes(Charset.forName("UTF-8"));
        }
        fVarA.f21850c = bytes;
        return new o(setUnmodifiableSet, fVarA.a(), this);
    }
}
