package com.strmr.ps.data.repository;

import com.strmr.ps.data.model.trakt.TraktShow;
import defpackage.ak1;
import defpackage.bt5;
import defpackage.ck1;
import defpackage.e6a;
import defpackage.gr3;
import defpackage.hl4;
import defpackage.hx9;
import defpackage.i50;
import defpackage.js5;
import defpackage.m02;
import defpackage.m12;
import defpackage.os5;
import defpackage.s38;
import defpackage.sc2;
import defpackage.vx8;
import defpackage.wj0;
import defpackage.y41;
import java.util.ArrayList;
import java.util.Iterator;
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\u001c\n\u0002\u0018\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0006\u001a\u001c\u0012\u0018\u0012\u0016\u0012\u0004\u0012\u00020\u0003\u0012\u0004\u0012\u00020\u0004\u0012\u0004\u0012\u00020\u0005\u0018\u00010\u00020\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0006\u0010\u0007"}, d2 = {"Lak1;", "", "Lhx9;", "Ljs5;", "Los5;", "Lbt5;", "<anonymous>", "(Lak1;)Ljava/util/List;"}, k = 3, mv = {2, 0, 0})
@DebugMetadata(c = "com.strmr.ps.data.repository.MediaRepository$fetchShows$2$results$1", f = "MediaRepository.kt", i = {}, l = {430}, m = "invokeSuspend", n = {}, s = {})
@vx8
public final class MediaRepository$fetchShows$2$results$1 extends SuspendLambda implements gr3<ak1, Continuation<? super List<? extends hx9<? extends js5, ? extends os5, ? extends bt5>>>, Object> {
    final /* synthetic */ int $basePosition;
    final /* synthetic */ List<hl4<TraktShow>> $batch;
    final /* synthetic */ String $category;
    private /* synthetic */ Object L$0;
    int label;
    final /* synthetic */ MediaRepository this$0;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public MediaRepository$fetchShows$2$results$1(List<hl4<TraktShow>> list, MediaRepository mediaRepository, String str, int i, Continuation<? super MediaRepository$fetchShows$2$results$1> continuation) {
        super(2, continuation);
        this.$batch = list;
        this.this$0 = mediaRepository;
        this.$category = str;
        this.$basePosition = i;
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Continuation<e6a> create(Object obj, Continuation<?> continuation) {
        MediaRepository$fetchShows$2$results$1 mediaRepository$fetchShows$2$results$1 = new MediaRepository$fetchShows$2$results$1(this.$batch, this.this$0, this.$category, this.$basePosition, continuation);
        mediaRepository$fetchShows$2$results$1.L$0 = obj;
        return mediaRepository$fetchShows$2$results$1;
    }

    @Override // defpackage.gr3
    public final Object invoke(ak1 ak1Var, Continuation<? super List<hx9<js5, os5, bt5>>> continuation) {
        return ((MediaRepository$fetchShows$2$results$1) create(ak1Var, continuation)).invokeSuspend(e6a.a);
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Object invokeSuspend(Object obj) {
        ck1 ck1Var = ck1.a;
        int i = this.label;
        if (i != 0) {
            if (i != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(obj);
            return obj;
        }
        s38.b(obj);
        ak1 ak1Var = (ak1) this.L$0;
        List<hl4<TraktShow>> list = this.$batch;
        MediaRepository mediaRepository = this.this$0;
        String str = this.$category;
        int i2 = this.$basePosition;
        ArrayList arrayList = new ArrayList(y41.p(list, 10));
        Iterator<T> it = list.iterator();
        while (it.hasNext()) {
            hl4 hl4Var = (hl4) it.next();
            int i3 = hl4Var.a;
            TraktShow traktShow = (TraktShow) hl4Var.b;
            m12 m12Var = sc2.a;
            arrayList.add(wj0.a(ak1Var, m02.c, new MediaRepository$fetchShows$2$results$1$1$1(traktShow, mediaRepository, str, i2, i3, null), 2));
        }
        this.label = 1;
        Object objA = i50.a(arrayList, this);
        return objA == ck1Var ? ck1Var : objA;
    }
}
