package d3;

import androidx.compose.runtime.MutableState;
import f3.C2038c;
import f3.C2039d;
import j$.time.format.DateTimeFormatter;
import java.util.Iterator;
import java.util.List;
import m3.AbstractC2467b;
import okhttp3.OkHttpClient;
import w4.C3137A;

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

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public MutableState f15231a;

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

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

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

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

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

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final /* synthetic */ MutableState f15237j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final /* synthetic */ MutableState f15238k;
    public final /* synthetic */ MutableState l;

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

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public N0(boolean z6, int i6, int i7, String str, MutableState mutableState, MutableState mutableState2, MutableState mutableState3, int i8, A4.d dVar) {
        super(2, dVar);
        this.f15233c = z6;
        this.f15234d = i6;
        this.f15235e = i7;
        this.f15236f = str;
        this.f15237j = mutableState;
        this.f15238k = mutableState2;
        this.l = mutableState3;
        this.f15239m = i8;
    }

    @Override // C4.a
    public final A4.d create(Object obj, A4.d dVar) {
        return new N0(this.f15233c, this.f15234d, this.f15235e, this.f15236f, this.f15237j, this.f15238k, this.l, this.f15239m, dVar);
    }

    @Override // J4.e
    public final Object invoke(Object obj, Object obj2) {
        return ((N0) create((V4.C) obj, (A4.d) obj2)).invokeSuspend(C3137A.f25453a);
    }

    /* JADX WARN: Code restructure failed: missing block: B:37:0x009e, code lost:
    
        if (r0 != r7) goto L39;
     */
    /* JADX WARN: Removed duplicated region for block: B:35:0x008b  */
    @Override // C4.a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        Object objF;
        String str;
        Object objH;
        Object next;
        B4.a aVar = B4.a.f492a;
        int i6 = this.f15232b;
        MutableState mutableState = this.l;
        MutableState mutableState2 = this.f15238k;
        MutableState mutableState3 = this.f15237j;
        int i7 = 0;
        try {
            try {
            } catch (Exception e6) {
                String message = e6.getMessage();
                if (message == null) {
                    message = "Failed to load";
                }
                DateTimeFormatter dateTimeFormatter = v2.f16084a;
                mutableState2.setValue(message);
            }
            if (i6 == 0) {
                AbstractC2467b.l(obj);
                DateTimeFormatter dateTimeFormatter2 = v2.f16084a;
                mutableState3.setValue(Boolean.TRUE);
                mutableState2.setValue(null);
                mutableState.setValue(x4.y.f26065a);
                if (this.f15233c) {
                    X2.f fVar = new X2.f();
                    int i8 = this.f15234d;
                    int i9 = this.f15235e;
                    this.f15232b = 1;
                    objF = fVar.f(i8, i9, false, null, "en", this);
                    if (objF == aVar) {
                    }
                } else {
                    OkHttpClient okHttpClient = C2039d.f16416a;
                    int i10 = this.f15234d;
                    str = this.f15236f;
                    if (S4.p.Q0(str)) {
                        str = "en";
                    }
                    this.f15231a = mutableState;
                    this.f15232b = 2;
                    c5.e eVar = V4.N.f8259a;
                    objH = V4.E.H(c5.d.f13466b, new C2038c(i7, i10, null, str), this);
                }
                return aVar;
            }
            if (i6 != 1) {
                if (i6 != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                mutableState = this.f15231a;
                AbstractC2467b.l(obj);
                objH = obj;
                DateTimeFormatter dateTimeFormatter3 = v2.f16084a;
                mutableState.setValue((List) objH);
                mutableState3.setValue(Boolean.FALSE);
                return C3137A.f25453a;
            }
            AbstractC2467b.l(obj);
            objF = obj;
            int i11 = this.f15239m;
            Iterator it = ((List) objF).iterator();
            while (true) {
                if (!it.hasNext()) {
                    next = null;
                    break;
                }
                next = it.next();
                if (((X2.i) next).f8597e == i11) {
                    break;
                }
            }
            X2.i iVar = (X2.i) next;
            if (iVar != null) {
                i7 = iVar.f8593a;
            }
            OkHttpClient okHttpClient2 = C2039d.f16416a;
            int i102 = this.f15234d;
            str = this.f15236f;
            if (S4.p.Q0(str)) {
            }
            this.f15231a = mutableState;
            this.f15232b = 2;
            c5.e eVar2 = V4.N.f8259a;
            objH = V4.E.H(c5.d.f13466b, new C2038c(i7, i102, null, str), this);
        } catch (Throwable th) {
            DateTimeFormatter dateTimeFormatter4 = v2.f16084a;
            mutableState3.setValue(Boolean.FALSE);
            throw th;
        }
    }
}
