package f;

import java.util.HashMap;
import n4.u0;
import s7.l;

/* JADX INFO: renamed from: f.e, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0897e extends AbstractC0895c {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f12593a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ String f12594b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ l f12595c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ d.g f12596d;

    public /* synthetic */ C0897e(d.g gVar, String str, l lVar, int i) {
        this.f12593a = i;
        this.f12596d = gVar;
        this.f12594b = str;
        this.f12595c = lVar;
    }

    @Override // f.AbstractC0895c
    public final void a(Object obj) throws Exception {
        switch (this.f12593a) {
            case u0.f15495q /* 0 */:
                d.g gVar = this.f12596d;
                HashMap map = gVar.f11269b;
                String str = this.f12594b;
                Integer num = (Integer) map.get(str);
                l lVar = this.f12595c;
                if (num != null) {
                    gVar.f11271d.add(str);
                    try {
                        gVar.b(num.intValue(), lVar, obj);
                        return;
                    } catch (Exception e8) {
                        gVar.f11271d.remove(str);
                        throw e8;
                    }
                }
                throw new IllegalStateException("Attempting to launch an unregistered ActivityResultLauncher with contract " + lVar + " and input " + obj + ". You must ensure the ActivityResultLauncher is registered before calling launch().");
            default:
                d.g gVar2 = this.f12596d;
                HashMap map2 = gVar2.f11269b;
                String str2 = this.f12594b;
                Integer num2 = (Integer) map2.get(str2);
                l lVar2 = this.f12595c;
                if (num2 != null) {
                    gVar2.f11271d.add(str2);
                    try {
                        gVar2.b(num2.intValue(), lVar2, obj);
                        return;
                    } catch (Exception e9) {
                        gVar2.f11271d.remove(str2);
                        throw e9;
                    }
                }
                throw new IllegalStateException("Attempting to launch an unregistered ActivityResultLauncher with contract " + lVar2 + " and input " + obj + ". You must ensure the ActivityResultLauncher is registered before calling launch().");
        }
    }

    public void b() {
        this.f12596d.e(this.f12594b);
    }
}
