package defpackage;

import android.app.Application;
import android.os.Bundle;
import java.lang.reflect.Constructor;
import java.util.LinkedHashMap;

/* JADX INFO: renamed from: ᵲᵳᵽ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C4533 implements InterfaceC3930 {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final C4616 f17247;

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final Bundle f17248;

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public final C1709 f17249;

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final Application f17250;

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public final C0727 f17251;

    public C4533(Application application, InterfaceC2566 interfaceC2566, Bundle bundle) {
        C4616 c4616;
        this.f17249 = interfaceC2566.mo4525();
        this.f17251 = interfaceC2566.mo4192();
        this.f17248 = bundle;
        this.f17250 = application;
        if (application != null) {
            if (C4616.f17557 == null) {
                C4616.f17557 = new C4616(application);
            }
            c4616 = C4616.f17557;
        } else {
            c4616 = new C4616(null);
        }
        this.f17247 = c4616;
    }

    @Override // defpackage.InterfaceC3930
    /* JADX INFO: renamed from: ʽˈˋ */
    public final AbstractC4442 mo8662(Class cls, C4090 c4090) {
        LinkedHashMap linkedHashMap = c4090.f9950;
        String str = (String) linkedHashMap.get(AbstractC1842.f7297);
        if (str == null) {
            ᵕᵩʽᵲ.ᵪᵹᵥᵻ("VIEW_MODEL_KEY must always be provided by ViewModelProvider");
            return null;
        }
        if (linkedHashMap.get(AbstractC1656.f6582) == null || linkedHashMap.get(AbstractC1656.f6580) == null) {
            if (this.f17251 != null) {
                return m9574(cls, str);
            }
            ᵕᵩʽᵲ.ᵪᵹᵥᵻ("SAVED_STATE_REGISTRY_OWNER_KEY andVIEW_MODEL_STORE_OWNER_KEY must be provided in the creation extras tosuccessfully create a ViewModel.");
            return null;
        }
        Application application = (Application) linkedHashMap.get(C4616.f17556);
        boolean zIsAssignableFrom = AbstractC2130.class.isAssignableFrom(cls);
        Constructor constructorM3506 = (!zIsAssignableFrom || application == null) ? AbstractC1064.m3506(cls, AbstractC1064.f4567) : AbstractC1064.m3506(cls, AbstractC1064.f4568);
        return constructorM3506 == null ? this.f17247.m9748(cls, c4090) : (!zIsAssignableFrom || application == null) ? AbstractC1064.m3505(cls, constructorM3506, AbstractC1656.m4548(c4090)) : AbstractC1064.m3505(cls, constructorM3506, application, AbstractC1656.m4548(c4090));
    }

    @Override // defpackage.InterfaceC3930
    /* JADX INFO: renamed from: ːˏᵟᵯ */
    public final AbstractC4442 mo8663(C4397 c4397, C4090 c4090) {
        return mo8662(c4397.f16695, c4090);
    }

    @Override // defpackage.InterfaceC3930
    /* JADX INFO: renamed from: ᵲᵶᵳˈ */
    public final AbstractC4442 mo8664(Class cls) {
        String canonicalName = cls.getCanonicalName();
        if (canonicalName != null) {
            return m9574(cls, canonicalName);
        }
        ᵕᵩʽᵲ.ᵮᵣᵗˈ("Local and anonymous classes can not be ViewModels");
        return null;
    }

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public final AbstractC4442 m9574(Class cls, String str) {
        C5088 c5088;
        C0727 c0727 = this.f17251;
        if (c0727 == null) {
            C4468.m9515("SavedStateViewModelFactory constructed with empty constructor supports only calls to create(modelClass: Class<T>, extras: CreationExtras).");
            return null;
        }
        boolean zIsAssignableFrom = AbstractC2130.class.isAssignableFrom(cls);
        Application application = this.f17250;
        Constructor constructorM3506 = (!zIsAssignableFrom || application == null) ? AbstractC1064.m3506(cls, AbstractC1064.f4567) : AbstractC1064.m3506(cls, AbstractC1064.f4568);
        if (constructorM3506 == null) {
            if (application != null) {
                return this.f17247.m9749(cls);
            }
            if (ˋᵳ.ʽˈˋ == null) {
                ˋᵳ.ʽˈˋ = new ˋᵳ(11);
            }
            ˋᵳ.ʽˈˋ.getClass();
            return ᵲᵧˇ.ᵵᵽ(cls);
        }
        C1709 c1709 = this.f17249;
        Bundle bundleM4743 = c1709.m4743(str);
        if (bundleM4743 == null) {
            bundleM4743 = this.f17248;
        }
        if (bundleM4743 == null) {
            c5088 = new C5088();
        } else {
            bundleM4743.setClassLoader(C5088.class.getClassLoader());
            C3197 c3197 = new C3197(bundleM4743.size());
            for (String str2 : bundleM4743.keySet()) {
                c3197.put(str2, bundleM4743.get(str2));
            }
            c5088 = new C5088(c3197.m7328());
        }
        C5079 c5079 = new C5079(str, c5088);
        c5079.m10405(c1709, c0727);
        EnumC0038 enumC0038 = c0727.f3300;
        int i = 1;
        if (enumC0038 == EnumC0038.f1191 || enumC0038.m1024(EnumC0038.f1192)) {
            c1709.m4730();
        } else {
            c0727.m2595(new C3640(c0727, i, c1709));
        }
        AbstractC4442 abstractC4442M3505 = (!zIsAssignableFrom || application == null) ? AbstractC1064.m3505(cls, constructorM3506, c5088) : AbstractC1064.m3505(cls, constructorM3506, application, c5088);
        abstractC4442M3505.m9449("androidx.lifecycle.savedstate.vm.tag", c5079);
        return abstractC4442M3505;
    }
}
