package defpackage;

import android.content.Context;
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$markEpisodeUnwatched$1", f = "EpisodeContextMenuHelper.kt", i = {}, l = {186, 193}, m = "invokeSuspend", n = {}, s = {})
final class fo2 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;
    public final /* synthetic */ int e;

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

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

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

    /* JADX WARN: Code restructure failed: missing block: B:16:0x006b, code lost:
    
        if (r11.a(r10) == r7) goto L17;
     */
    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) throws Throwable {
        uo2 uo2Var = this.b;
        Context context = uo2Var.a;
        ck1 ck1Var = ck1.a;
        int i = this.a;
        if (i == 0) {
            s38.b(obj);
            m12 m12Var = sc2.a;
            m02 m02Var = m02.c;
            eo2 eo2Var = new eo2(uo2Var, this.e, this.c, this.d, null);
            this.a = 1;
            obj = wj0.f(m02Var, eo2Var, 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(context, "Marked as unwatched", 0).show();
            uo2Var.f.invoke(Boxing.boxInt(this.c), Boxing.boxInt(this.d), Boxing.boxBoolean(false));
            PlaybackStateManager playbackStateManager = uo2Var.e;
            this.a = 2;
        } else {
            Toast.makeText(context, "Failed to mark as unwatched", 0).show();
        }
        return e6a.a;
    }
}
