package com.strmr.ps.ui.contextmenu;

import android.content.Context;
import android.widget.Toast;
import com.strmr.ps.R;
import com.strmr.ps.data.model.ContentItem;
import defpackage.ak1;
import defpackage.ck1;
import defpackage.e6a;
import defpackage.gr3;
import defpackage.m02;
import defpackage.m12;
import defpackage.s38;
import defpackage.sc2;
import defpackage.wj0;
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.contextmenu.ContextMenuHelper$addItemToList$1", f = "ContextMenuHelper.kt", i = {}, l = {557}, m = "invokeSuspend", n = {}, s = {})
final class j extends SuspendLambda implements gr3<ak1, Continuation<? super e6a>, Object> {
    public int a;
    public final /* synthetic */ h b;
    public final /* synthetic */ String c;
    public final /* synthetic */ ContentItem d;
    public final /* synthetic */ boolean e;
    public final /* synthetic */ String f;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public j(h hVar, String str, ContentItem contentItem, boolean z, String str2, Continuation continuation) {
        super(2, continuation);
        this.b = hVar;
        this.c = str;
        this.d = contentItem;
        this.e = z;
        this.f = str2;
    }

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

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

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Object invokeSuspend(Object obj) throws Throwable {
        h hVar = this.b;
        Context context = hVar.a;
        ck1 ck1Var = ck1.a;
        int i = this.a;
        if (i == 0) {
            s38.b(obj);
            m12 m12Var = sc2.a;
            m02 m02Var = m02.c;
            i iVar = new i(hVar, this.d, this.e, this.f, null);
            this.a = 1;
            obj = wj0.f(m02Var, iVar, this);
            if (obj == ck1Var) {
                return ck1Var;
            }
        } else {
            if (i != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(obj);
        }
        if (((Boolean) obj).booleanValue()) {
            Toast.makeText(context, context.getString(R.string.added_to_list_feedback, this.c), 0).show();
        } else {
            Toast.makeText(context, "Failed to add to list", 0).show();
        }
        return e6a.a;
    }
}
