package R1;

import C0.B;
import C0.C0104e;
import O1.C0565e;
import O1.InterfaceC0563c;
import O1.O;
import Q4.m;
import V4.C;
import android.content.Context;
import java.util.List;
import kotlin.jvm.internal.o;
import n2.AbstractC2612c;
import p5.AbstractC2749t;

/* JADX INFO: loaded from: classes.dex */
public final class b implements M4.a {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final String f6038a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final B f6039b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final J4.c f6040c;

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

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final Object f6042e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public volatile S1.d f6043f;

    public b(String name, B b5, J4.c cVar, C c6) {
        o.h(name, "name");
        this.f6038a = name;
        this.f6039b = b5;
        this.f6040c = cVar;
        this.f6041d = c6;
        this.f6042e = new Object();
    }

    @Override // M4.a
    public final Object a(Context thisRef, m property) {
        S1.d dVar;
        o.h(thisRef, "thisRef");
        o.h(property, "property");
        S1.d dVar2 = this.f6043f;
        if (dVar2 != null) {
            return dVar2;
        }
        synchronized (this.f6042e) {
            try {
                if (this.f6043f == null) {
                    Context applicationContext = thisRef.getApplicationContext();
                    InterfaceC0563c cVar = this.f6039b;
                    J4.c cVar2 = this.f6040c;
                    o.g(applicationContext, "applicationContext");
                    List migrations = (List) cVar2.invoke(applicationContext);
                    C c6 = this.f6041d;
                    C0104e c0104e = new C0104e(7, applicationContext, this);
                    o.h(migrations, "migrations");
                    Q1.f fVar = new Q1.f(AbstractC2749t.SYSTEM, new B0.b(c0104e, 9));
                    if (cVar == null) {
                        cVar = new u4.c(8);
                    }
                    this.f6043f = new S1.d(new S1.d(new O(fVar, AbstractC2612c.q(new C0565e(migrations, null)), cVar, c6)));
                }
                dVar = this.f6043f;
                o.e(dVar);
            } catch (Throwable th) {
                throw th;
            }
        }
        return dVar;
    }
}
