package defpackage;

import android.os.Bundle;
import java.util.Arrays;
import java.util.LinkedHashMap;

/* JADX INFO: renamed from: ˌⁱʜ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public abstract class AbstractC1656 {

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public static final ᵻᵧˁ f6582 = new ᵻᵧˁ(6);

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public static final ᵤᵮᵨ f6580 = new ᵤᵮᵨ(6);

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public static final ᵨᵡᵱ f6581 = new ᵨᵡᵱ(6);

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public static final void m4546(InterfaceC2566 interfaceC2566) {
        EnumC0038 enumC0038 = interfaceC2566.mo4192().f3300;
        if (enumC0038 != EnumC0038.f1191 && enumC0038 != EnumC0038.f1190) {
            C4468.m9509("Failed to enable `SavedStateHandle` for `", interfaceC2566, "`. The `Lifecycle.State` must be `INITIALIZED` or `CREATED`, but was `", enumC0038, "`. You must call `enableSavedStateHandles()` before the `Lifecycle.State` moves to `STARTED`.");
        } else if (interfaceC2566.mo4525().m4731() == null) {
            C1355 c1355 = new C1355(interfaceC2566.mo4525(), (InterfaceC3111) interfaceC2566);
            interfaceC2566.mo4525().m4727("androidx.lifecycle.internal.SavedStateHandlesProvider", c1355);
            interfaceC2566.mo4192().m2595(new C3811(4, c1355));
        }
    }

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public static final C5309 m4547(InterfaceC3111 interfaceC3111) {
        return (C5309) new C4055(interfaceC3111.mo4782(), new ˋᵳ(0), ᵿᵽᵤ.ᵻʽᵯ(interfaceC3111)).m8876(AbstractC3463.m7898(C5309.class), "androidx.lifecycle.internal.SavedStateHandlesVM");
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public static final C5088 m4548(C4090 c4090) {
        C5088 c5088;
        LinkedHashMap linkedHashMap = c4090.f9950;
        InterfaceC2566 interfaceC2566 = (InterfaceC2566) linkedHashMap.get(f6582);
        Bundle bundle = null;
        if (interfaceC2566 == null) {
            ᵕᵩʽᵲ.ᵮᵣᵗˈ("CreationExtras must have a value by `SAVED_STATE_REGISTRY_OWNER_KEY`");
            return null;
        }
        InterfaceC3111 interfaceC3111 = (InterfaceC3111) linkedHashMap.get(f6580);
        if (interfaceC3111 == null) {
            ᵕᵩʽᵲ.ᵮᵣᵗˈ("CreationExtras must have a value by `VIEW_MODEL_STORE_OWNER_KEY`");
            return null;
        }
        Bundle bundle2 = (Bundle) linkedHashMap.get(f6581);
        String str = (String) linkedHashMap.get(AbstractC1842.f7297);
        if (str == null) {
            ᵕᵩʽᵲ.ᵮᵣᵗˈ("CreationExtras must have a value by `VIEW_MODEL_KEY`");
            return null;
        }
        InterfaceC2058 interfaceC2058M4731 = interfaceC2566.mo4525().m4731();
        C1355 c1355 = interfaceC2058M4731 instanceof C1355 ? (C1355) interfaceC2058M4731 : null;
        if (c1355 == null) {
            ᵕᵩʽᵲ.ᵪᵹᵥᵻ("enableSavedStateHandles() wasn't called prior to createSavedStateHandle() call");
            return null;
        }
        C5309 c5309M4547 = m4547(interfaceC3111);
        C5088 c50882 = (C5088) c5309M4547.f20035.get(str);
        if (c50882 != null) {
            return c50882;
        }
        c1355.m3883();
        Bundle bundle3 = c1355.f5607;
        if (bundle3 != null && bundle3.containsKey(str)) {
            Bundle bundle4 = bundle3.getBundle(str);
            if (bundle4 == null) {
                bundle4 = ᵗʓ.ːˏᵟᵯ((C1081[]) Arrays.copyOf(new C1081[0], 0));
            }
            bundle3.remove(str);
            if (bundle3.isEmpty()) {
                c1355.f5607 = null;
            }
            bundle = bundle4;
        }
        if (bundle != null) {
            bundle2 = bundle;
        }
        if (bundle2 == null) {
            c5088 = new C5088();
        } else {
            bundle2.setClassLoader(C5088.class.getClassLoader());
            C3197 c3197 = new C3197(bundle2.size());
            for (String str2 : bundle2.keySet()) {
                c3197.put(str2, bundle2.get(str2));
            }
            c5088 = new C5088(c3197.m7328());
        }
        c5309M4547.f20035.put(str, c5088);
        return c5088;
    }
}
