package defpackage;

import android.content.Intent;
import com.strmr.ps.data.local.entity.TraktAccount;
import com.strmr.ps.ui.profile.ProfilePickerActivity;
import com.strmr.ps.ui.splash.SyncSplashActivity;
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.profile.ProfilePickerActivity$selectProfile$1", f = "ProfilePickerActivity.kt", i = {1}, l = {128, 132}, m = "invokeSuspend", n = {"previousActiveSlug"}, s = {"L$0"})
final class gj7 extends SuspendLambda implements gr3<ak1, Continuation<? super e6a>, Object> {
    public String a;
    public int b;
    public final /* synthetic */ TraktAccount c;
    public final /* synthetic */ ProfilePickerActivity d;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public gj7(TraktAccount traktAccount, ProfilePickerActivity profilePickerActivity, Continuation continuation) {
        super(2, continuation);
        this.c = traktAccount;
        this.d = profilePickerActivity;
    }

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

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

    /* JADX WARN: Removed duplicated region for block: B:21:0x0071  */
    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) throws Throwable {
        String str;
        ck1 ck1Var = ck1.a;
        int i = this.b;
        TraktAccount traktAccount = this.c;
        ProfilePickerActivity profilePickerActivity = this.d;
        if (i == 0) {
            s38.b(obj);
            m12 m12Var = sc2.a;
            m02 m02Var = m02.c;
            fj7 fj7Var = new fj7(profilePickerActivity, null);
            this.b = 1;
            obj = wj0.f(m02Var, fj7Var, this);
            if (obj != ck1Var) {
            }
            return ck1Var;
        }
        if (i != 1) {
            if (i != 2) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            str = this.a;
            s38.b(obj);
            if (str != null || str.equals(traktAccount.getUserSlug())) {
                ProfilePickerActivity.h(profilePickerActivity);
            } else {
                int i2 = ProfilePickerActivity.n;
                Intent intent = new Intent(profilePickerActivity, (Class<?>) SyncSplashActivity.class);
                intent.setFlags(268468224);
                profilePickerActivity.startActivity(intent);
                profilePickerActivity.finish();
            }
            return e6a.a;
        }
        s38.b(obj);
        String str2 = (String) obj;
        m12 m12Var2 = sc2.a;
        m02 m02Var2 = m02.c;
        ej7 ej7Var = new ej7(traktAccount, profilePickerActivity, null);
        this.a = str2;
        this.b = 2;
        if (wj0.f(m02Var2, ej7Var, this) != ck1Var) {
            str = str2;
            if (str != null) {
                ProfilePickerActivity.h(profilePickerActivity);
            }
            return e6a.a;
        }
        return ck1Var;
    }
}
