package com.strmr.ps.ui.search;

import defpackage.ak1;
import defpackage.ck1;
import defpackage.e6a;
import defpackage.gr3;
import defpackage.h32;
import defpackage.i50;
import defpackage.ig6;
import defpackage.od;
import defpackage.r22;
import defpackage.re6;
import defpackage.s38;
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.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.search.SearchViewModel$search$2", f = "SearchViewModel.kt", i = {0, 1}, l = {235, 259, 260}, m = "invokeSuspend", n = {"$this$launch", "addonJobs"}, s = {"L$0", "L$0"})
@vx8
final class i extends SuspendLambda implements gr3<ak1, Continuation<? super e6a>, Object> {
    public int a;
    public /* synthetic */ Object b;
    public final /* synthetic */ SearchViewModel c;
    public final /* synthetic */ String d;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public i(SearchViewModel searchViewModel, String str, Continuation continuation) {
        super(2, continuation);
        this.c = searchViewModel;
        this.d = str;
    }

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

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

    /* JADX WARN: Code restructure failed: missing block: B:24:0x009e, code lost:
    
        if (r14 != r3) goto L26;
     */
    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        ak1 ak1Var;
        List list;
        SearchViewModel searchViewModel = this.c;
        ig6 ig6Var = searchViewModel.s;
        re6 re6Var = searchViewModel.n;
        ck1 ck1Var = ck1.a;
        int i = this.a;
        if (i == 0) {
            s38.b(obj);
            ak1Var = (ak1) this.b;
            re6Var.l(Boxing.boxBoolean(true));
            this.b = ak1Var;
            this.a = 1;
            if (h32.a(200L, this) != ck1Var) {
            }
            return ck1Var;
        }
        if (i == 1) {
            ak1Var = (ak1) this.b;
            s38.b(obj);
        } else {
            if (i != 2) {
                if (i != 3) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                s38.b(obj);
                ig6Var.setValue((List) obj);
                re6Var.l(Boxing.boxBoolean(false));
                return e6a.a;
            }
            list = (List) this.b;
            s38.b(obj);
            this.b = null;
            this.a = 3;
            obj = i50.a(list, this);
        }
        String str = this.d;
        r22 r22VarA = wj0.a(ak1Var, null, new h(searchViewModel, str, null), 3);
        Iterable iterable = (Iterable) ig6Var.getValue();
        ArrayList arrayList = new ArrayList(y41.p(iterable, 10));
        Iterator it = iterable.iterator();
        while (it.hasNext()) {
            arrayList.add(wj0.a(ak1Var, null, new g(searchViewModel, (od) it.next(), str, null), 3));
        }
        this.b = arrayList;
        this.a = 2;
        if (r22VarA.ab(this) != ck1Var) {
            list = arrayList;
            this.b = null;
            this.a = 3;
            obj = i50.a(list, this);
        }
        return ck1Var;
    }
}
