package S2;

import Y4.InterfaceC0844j;
import java.util.Map;
import m3.AbstractC2467b;
import w4.C3137A;

/* JADX INFO: loaded from: classes.dex */
public final class o extends C4.j implements J4.f {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public int f6184b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public /* synthetic */ Object f6185c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public /* synthetic */ Object f6186d;

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

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    /* JADX WARN: Multi-variable type inference failed */
    public o(J4.e eVar, A4.d dVar) {
        super(3, dVar);
        this.f6187e = (C4.j) eVar;
    }

    /* JADX WARN: Type inference failed for: r1v3, types: [C4.j, J4.e] */
    @Override // J4.f
    public final Object invoke(Object obj, Object obj2, Object obj3) {
        switch (this.f6183a) {
            case 0:
                ((Number) obj2).intValue();
                o oVar = new o((String) this.f6186d, (N2.r) this.f6187e, (A4.d) obj3);
                oVar.f6185c = (String) obj;
                return oVar.invokeSuspend(C3137A.f25453a);
            default:
                o oVar2 = new o((C4.j) this.f6187e, (A4.d) obj3);
                oVar2.f6185c = (InterfaceC0844j) obj;
                oVar2.f6186d = obj2;
                return oVar2.invokeSuspend(C3137A.f25453a);
        }
    }

    /* JADX WARN: Type inference failed for: r3v9, types: [C4.j, J4.e] */
    @Override // C4.a
    public final Object invokeSuspend(Object obj) {
        InterfaceC0844j interfaceC0844j;
        switch (this.f6183a) {
            case 0:
                B4.a aVar = B4.a.f492a;
                int i6 = this.f6184b;
                if (i6 == 0) {
                    AbstractC2467b.l(obj);
                    String str = (String) this.f6185c;
                    this.f6184b = 1;
                    obj = w.o(str, (String) this.f6186d, (N2.r) this.f6187e, this);
                    if (obj == aVar) {
                        return aVar;
                    }
                } else {
                    if (i6 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    AbstractC2467b.l(obj);
                }
                Map map = (Map) obj;
                if (map == null) {
                    return null;
                }
                Object obj2 = map.get("download");
                String str2 = obj2 instanceof String ? (String) obj2 : null;
                if (str2 == null) {
                    str2 = "";
                }
                Object obj3 = map.get("download");
                String str3 = obj3 instanceof String ? (String) obj3 : null;
                if (str3 == null) {
                    str3 = "";
                }
                Object obj4 = map.get("filename");
                String str4 = obj4 instanceof String ? (String) obj4 : null;
                if (str4 == null) {
                    str4 = "";
                }
                Object obj5 = map.get("download");
                String str5 = obj5 instanceof String ? (String) obj5 : null;
                String str6 = str5 != null ? str5 : "";
                Object obj6 = map.get("filesize");
                Number number = obj6 instanceof Number ? (Number) obj6 : null;
                return new a(str2, str3, str4, str6, number != null ? number.longValue() : 0L);
            default:
                B4.a aVar2 = B4.a.f492a;
                int i7 = this.f6184b;
                if (i7 == 0) {
                    AbstractC2467b.l(obj);
                    interfaceC0844j = (InterfaceC0844j) this.f6185c;
                    Object obj7 = this.f6186d;
                    this.f6185c = interfaceC0844j;
                    this.f6184b = 1;
                    obj = ((C4.j) this.f6187e).invoke(obj7, this);
                    if (obj == aVar2) {
                        return aVar2;
                    }
                } else {
                    if (i7 != 1) {
                        if (i7 != 2) {
                            throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                        }
                        AbstractC2467b.l(obj);
                        return C3137A.f25453a;
                    }
                    interfaceC0844j = (InterfaceC0844j) this.f6185c;
                    AbstractC2467b.l(obj);
                }
                this.f6185c = null;
                this.f6184b = 2;
                if (interfaceC0844j.emit(obj, this) == aVar2) {
                    return aVar2;
                }
                return C3137A.f25453a;
        }
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public o(String str, N2.r rVar, A4.d dVar) {
        super(3, dVar);
        this.f6186d = str;
        this.f6187e = rVar;
    }
}
