package defpackage;

import android.widget.Toast;
import com.strmr.ps.data.event.PlaybackStateManager;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.Boxing;
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.details.EpisodeContextMenuHelper$markSeasonWatched$1", f = "EpisodeContextMenuHelper.kt", i = {}, l = {261, 268}, m = "invokeSuspend", n = {}, s = {})
final class ko2 extends SuspendLambda implements gr3<ak1, Continuation<? super e6a>, Object> {
    public int a;
    public final /* synthetic */ uo2 b;
    public final /* synthetic */ int c;
    public final /* synthetic */ int d;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public ko2(uo2 uo2Var, int i, int i2, Continuation continuation) {
        super(2, continuation);
        this.b = uo2Var;
        this.c = i;
        this.d = i2;
    }

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

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

    /* JADX WARN: Code restructure failed: missing block: B:16:0x0061, code lost:
    
        if (r9.a(r8) == r0) goto L17;
     */
    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) throws Throwable {
        ck1 ck1Var = ck1.a;
        int i = this.a;
        int i2 = this.c;
        uo2 uo2Var = this.b;
        if (i == 0) {
            s38.b(obj);
            m12 m12Var = sc2.a;
            m02 m02Var = m02.c;
            jo2 jo2Var = new jo2(uo2Var, this.d, i2, null);
            this.a = 1;
            obj = wj0.f(m02Var, jo2Var, this);
            if (obj != ck1Var) {
            }
            return ck1Var;
        }
        if (i != 1) {
            if (i != 2) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(obj);
            return e6a.a;
        }
        s38.b(obj);
        if (((Boolean) obj).booleanValue()) {
            Toast.makeText(uo2Var.a, "Season marked as watched", 0).show();
            uo2Var.g.invoke(Boxing.boxInt(i2), Boxing.boxBoolean(true));
            PlaybackStateManager playbackStateManager = uo2Var.e;
            this.a = 2;
        } else {
            Toast.makeText(uo2Var.a, "Failed to mark season as watched", 0).show();
        }
        return e6a.a;
    }
}
