package com.strmr.ps.ui.rowitems;

import com.strmr.ps.data.model.ContentItem;
import defpackage.ag8;
import defpackage.ak1;
import defpackage.ck1;
import defpackage.e6a;
import defpackage.gr3;
import defpackage.s38;
import defpackage.vx8;
import defpackage.xf8;
import defpackage.y41;
import java.util.ArrayList;
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.rowitems.RowItemsViewModel$enrichAllItems$1$1$1$1", f = "RowItemsViewModel.kt", i = {0, 1}, l = {183, 97}, m = "invokeSuspend", n = {"$this$withPermit$iv", "$this$withPermit$iv"}, s = {"L$0", "L$0"})
@vx8
final class e extends SuspendLambda implements gr3<ak1, Continuation<? super e6a>, Object> {
    public xf8 a;
    public RowItemsViewModel b;
    public Object c;
    public ArrayList d;
    public int e;
    public int f;
    public final /* synthetic */ xf8 i;
    public final /* synthetic */ RowItemsViewModel j;
    public final /* synthetic */ ContentItem k;
    public final /* synthetic */ ArrayList l;
    public final /* synthetic */ int m;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public e(xf8 xf8Var, RowItemsViewModel rowItemsViewModel, ContentItem contentItem, ArrayList arrayList, int i, Continuation continuation) {
        super(2, continuation);
        this.i = xf8Var;
        this.j = rowItemsViewModel;
        this.k = contentItem;
        this.l = arrayList;
        this.m = i;
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Continuation create(Object obj, Continuation continuation) {
        return new e(this.i, this.j, this.k, this.l, this.m, continuation);
    }

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

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:24:0x0079 A[Catch: all -> 0x001a, TRY_LEAVE, TryCatch #1 {all -> 0x001a, blocks: (B:7:0x0016, B:22:0x0075, B:24:0x0079, B:26:0x0084, B:27:0x0085, B:29:0x008c, B:30:0x008d, B:25:0x007a), top: B:39:0x0016, inners: #2 }] */
    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) throws Throwable {
        ContentItem contentItem;
        ArrayList arrayList;
        RowItemsViewModel rowItemsViewModel;
        int i;
        xf8 xf8Var;
        xf8 xf8Var2;
        Throwable th;
        int i2;
        List list;
        RowItemsViewModel rowItemsViewModel2;
        ContentItem contentItem2;
        List listBo;
        ck1 ck1Var = ck1.a;
        int i3 = this.f;
        try {
            if (i3 == 0) {
                s38.b(obj);
                xf8 xf8Var3 = this.i;
                RowItemsViewModel rowItemsViewModel3 = this.j;
                contentItem = this.k;
                ArrayList arrayList2 = this.l;
                int i4 = this.m;
                this.a = xf8Var3;
                this.b = rowItemsViewModel3;
                this.c = contentItem;
                this.d = arrayList2;
                this.e = i4;
                this.f = 1;
                if (((ag8) xf8Var3).b(this) != ck1Var) {
                    arrayList = arrayList2;
                    rowItemsViewModel = rowItemsViewModel3;
                    i = i4;
                    xf8Var = xf8Var3;
                }
                return ck1Var;
            }
            if (i3 != 1) {
                if (i3 != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                i2 = this.e;
                list = (List) this.c;
                rowItemsViewModel2 = this.b;
                xf8Var2 = this.a;
                try {
                    s38.b(obj);
                    xf8Var2 = xf8Var2;
                    contentItem2 = (ContentItem) obj;
                    if (contentItem2 != null) {
                        synchronized (list) {
                            list.set(i2, contentItem2);
                            listBo = y41.bo(list);
                        }
                        rowItemsViewModel2.e.j(listBo);
                    }
                    xf8Var2.release();
                    return e6a.a;
                } catch (Throwable th2) {
                    th = th2;
                    xf8Var2.release();
                    throw th;
                }
            }
            i = this.e;
            arrayList = this.d;
            contentItem = (ContentItem) this.c;
            rowItemsViewModel = this.b;
            xf8 xf8Var4 = this.a;
            s38.b(obj);
            xf8Var = xf8Var4;
            this.a = xf8Var;
            this.b = rowItemsViewModel;
            this.c = arrayList;
            this.d = null;
            this.e = i;
            this.f = 2;
            Object objB = RowItemsViewModel.b(rowItemsViewModel, contentItem, this);
            if (objB != ck1Var) {
                i2 = i;
                list = arrayList;
                xf8Var2 = xf8Var;
                obj = objB;
                rowItemsViewModel2 = rowItemsViewModel;
                contentItem2 = (ContentItem) obj;
                if (contentItem2 != null) {
                }
                xf8Var2.release();
                return e6a.a;
            }
            return ck1Var;
        } catch (Throwable th3) {
            xf8Var2 = xf8Var;
            th = th3;
            xf8Var2.release();
            throw th;
        }
    }
}
