package o;

import android.content.Context;
import android.content.ContextWrapper;
import android.graphics.Bitmap;
import java.util.LinkedHashMap;
import java.util.List;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.wG, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C2796wG {
    public final Context a;
    public C2279qq b;
    public Object c;
    public Lc0 d;
    public final List e;
    public final KE f;
    public final LinkedHashMap g;
    public final boolean h;
    public final boolean i;
    public final C1379hN j;
    public Z80 k;
    public WK l;
    public Z80 m;
    public int n;

    /* renamed from: o, reason: collision with root package name */
    public int f771o;
    public int p;

    public C2796wG(Context context) {
        this.a = context;
        this.b = AbstractC1249g.a;
        this.c = null;
        this.d = null;
        this.n = 0;
        this.e = C0332Mv.l;
        this.f = null;
        this.g = null;
        this.h = true;
        this.i = true;
        this.j = null;
        this.k = null;
        this.f771o = 0;
        this.l = null;
        this.m = null;
        this.p = 0;
    }

    public final C2891xG a() {
        Z80 z80;
        Object obj = this.c;
        if (obj == null) {
            obj = C0669Zu.P;
        }
        Object obj2 = obj;
        Lc0 lc0 = this.d;
        C2279qq c2279qq = this.b;
        Bitmap.Config config = c2279qq.g;
        int i = this.n;
        if (i == 0) {
            i = c2279qq.f;
        }
        int i2 = i;
        C2808wS c2808wS = c2279qq.e;
        KE ke = this.f;
        LE leD = ke != null ? ke.d() : null;
        if (leD == null) {
            leD = AbstractC1345h.c;
        } else {
            Bitmap.Config[] configArr = AbstractC1345h.a;
        }
        LE le = leD;
        LinkedHashMap linkedHashMap = this.g;
        Ac0 ac0 = linkedHashMap != null ? new Ac0(AbstractC2378rs0.l0(linkedHashMap)) : null;
        if (ac0 == null) {
            ac0 = Ac0.b;
        }
        Ac0 ac02 = ac0;
        C2279qq c2279qq2 = this.b;
        boolean z = c2279qq2.h;
        c2279qq2.getClass();
        C2279qq c2279qq3 = this.b;
        int i3 = c2279qq3.i;
        int i4 = c2279qq3.j;
        int i5 = c2279qq3.k;
        AbstractC2842wn abstractC2842wn = c2279qq3.a;
        AbstractC2842wn abstractC2842wn2 = c2279qq3.b;
        AbstractC2842wn abstractC2842wn3 = c2279qq3.c;
        AbstractC2842wn abstractC2842wn4 = c2279qq3.d;
        WK lifecycle = this.l;
        Context context = this.a;
        if (lifecycle == null) {
            Object baseContext = context;
            while (true) {
                if (baseContext instanceof InterfaceC0898cL) {
                    lifecycle = ((InterfaceC0898cL) baseContext).getLifecycle();
                    break;
                }
                if (!(baseContext instanceof ContextWrapper)) {
                    lifecycle = null;
                    break;
                }
                baseContext = ((ContextWrapper) baseContext).getBaseContext();
            }
            if (lifecycle == null) {
                lifecycle = QD.b;
            }
        }
        WK wk = lifecycle;
        Z80 z802 = this.k;
        if (z802 == null) {
            Z80 c2093os = this.m;
            if (c2093os == null) {
                c2093os = new C2093os(context);
            }
            z80 = c2093os;
        } else {
            z80 = z802;
        }
        int i6 = this.f771o;
        if (i6 == 0 && (i6 = this.p) == 0) {
            if ((z802 instanceof InterfaceC1983nk0 ? (InterfaceC1983nk0) z802 : null) != null) {
                throw null;
            }
            i6 = 2;
        }
        int i7 = i6;
        C1379hN c1379hN = this.j;
        HV hv = c1379hN != null ? new HV(AbstractC2378rs0.l0(c1379hN.a)) : null;
        if (hv == null) {
            hv = HV.m;
        }
        return new C2891xG(context, obj2, lc0, config, i2, this.e, c2808wS, le, ac02, this.h, z, false, this.i, i3, i4, i5, abstractC2842wn, abstractC2842wn2, abstractC2842wn3, abstractC2842wn4, wk, z80, i7, hv, new C0379Oq(this.k, this.f771o, this.n), this.b);
    }

    public C2796wG(C2891xG c2891xG, Context context) {
        this.a = context;
        this.b = c2891xG.u;
        this.c = c2891xG.b;
        this.d = c2891xG.c;
        C0379Oq c0379Oq = c2891xG.t;
        this.n = c0379Oq.c;
        this.e = c2891xG.e;
        this.f = c2891xG.g.c();
        this.g = new LinkedHashMap(c2891xG.h.a);
        this.h = c2891xG.i;
        this.i = c2891xG.l;
        this.j = new C1379hN(c2891xG.s);
        this.k = c0379Oq.a;
        this.f771o = c0379Oq.b;
        if (c2891xG.a == context) {
            this.l = c2891xG.q;
            this.m = c2891xG.r;
            this.p = c2891xG.z;
        } else {
            this.l = null;
            this.m = null;
            this.p = 0;
        }
    }
}
