package defpackage;

import com.strmr.ps.data.local.entity.TraktAccount;
import com.strmr.ps.data.repository.TraktAccountRepository;
import java.util.List;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;

/* JADX INFO: loaded from: classes3.dex */
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0002\u0010\u0003"}, d2 = {"Lak1;", "Le6a;", "<anonymous>", "(Lak1;)V"}, k = 3, mv = {2, 0, 0})
@DebugMetadata(c = "com.strmr.ps.ui.settings.fragments.AccountsFragment$showAvatarPicker$1$1", f = "AccountsFragment.kt", i = {}, l = {506, 507, 508}, m = "invokeSuspend", n = {}, s = {})
final class i6 extends SuspendLambda implements gr3<ak1, Continuation<? super e6a>, Object> {
    public a4 a;
    public int b;
    public final /* synthetic */ a4 c;
    public final /* synthetic */ TraktAccount d;
    public final /* synthetic */ int e;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public i6(a4 a4Var, TraktAccount traktAccount, int i, Continuation continuation) {
        super(2, continuation);
        this.c = a4Var;
        this.d = traktAccount;
        this.e = i;
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Continuation create(Object obj, Continuation continuation) {
        return new i6(this.c, this.d, this.e, continuation);
    }

    @Override // defpackage.gr3
    public final Object invoke(Object obj, Object obj2) {
        return ((i6) create((ak1) obj, (Continuation) obj2)).invokeSuspend(e6a.a);
    }

    /* JADX WARN: Code restructure failed: missing block: B:20:0x0065, code lost:
    
        if (defpackage.wj0.f(r7, r1, r6) != r0) goto L22;
     */
    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        a4 a4Var;
        ck1 ck1Var = ck1.a;
        int i = this.b;
        a4 a4Var2 = this.c;
        if (i == 0) {
            s38.b(obj);
            TraktAccountRepository traktAccountRepositoryQ = a4Var2.q();
            String userSlug = this.d.getUserSlug();
            this.b = 1;
            if (traktAccountRepositoryQ.updateAvatar(userSlug, this.e, this) != ck1Var) {
            }
            return ck1Var;
        }
        if (i == 1) {
            s38.b(obj);
        } else {
            if (i != 2) {
                if (i != 3) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                s38.b(obj);
                return e6a.a;
            }
            a4Var = this.a;
            s38.b(obj);
            a4Var.y = (List) obj;
            m12 m12Var = sc2.a;
            qm5 qm5Var = sm5.a;
            h6 h6Var = new h6(a4Var2, null);
            this.a = null;
            this.b = 3;
        }
        TraktAccountRepository traktAccountRepositoryQ2 = a4Var2.q();
        this.a = a4Var2;
        this.b = 2;
        obj = traktAccountRepositoryQ2.getAllAccountsSync(this);
        if (obj != ck1Var) {
            a4Var = a4Var2;
            a4Var.y = (List) obj;
            m12 m12Var2 = sc2.a;
            qm5 qm5Var2 = sm5.a;
            h6 h6Var2 = new h6(a4Var2, null);
            this.a = null;
            this.b = 3;
        }
        return ck1Var;
    }
}
