package com.strmr.ps.data.supabase;

import com.strmr.ps.data.local.dao.RowConfigDao;
import defpackage.ak1;
import defpackage.ck1;
import defpackage.e6a;
import defpackage.gr3;
import defpackage.q07;
import defpackage.s38;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
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.data.supabase.SettingsSyncManager$pullAndRestoreAllData$4$1", f = "SettingsSyncManager.kt", i = {}, l = {439, 443}, m = "invokeSuspend", n = {}, s = {})
final class v extends SuspendLambda implements gr3<ak1, Continuation<? super e6a>, Object> {
    public Iterator a;
    public int b;
    public final /* synthetic */ SettingsSyncManager c;
    public final /* synthetic */ List d;
    public final /* synthetic */ List e;
    public final /* synthetic */ Map f;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public v(SettingsSyncManager settingsSyncManager, List list, List list2, Map map, Continuation continuation) {
        super(2, continuation);
        this.c = settingsSyncManager;
        this.d = list;
        this.e = list2;
        this.f = map;
    }

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

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

    /* JADX WARN: Code restructure failed: missing block: B:11:0x002f, code lost:
    
        if (r8.replaceRowsForProfiles(r7.d, r7.e, r7) == r0) goto L18;
     */
    /* JADX WARN: Removed duplicated region for block: B:16:0x0043  */
    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        Iterator it;
        ck1 ck1Var = ck1.a;
        int i = this.b;
        SettingsSyncManager settingsSyncManager = this.c;
        if (i == 0) {
            s38.b(obj);
            RowConfigDao rowConfigDao = settingsSyncManager.h;
            this.b = 1;
        } else {
            if (i != 1) {
                if (i != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                it = this.a;
                s38.b(obj);
                while (it.hasNext()) {
                    Map.Entry entry = (Map.Entry) it.next();
                    String str = (String) entry.getKey();
                    q07 q07Var = (q07) entry.getValue();
                    RowConfigDao rowConfigDao2 = settingsSyncManager.h;
                    String str2 = (String) q07Var.a;
                    String str3 = (String) q07Var.b;
                    this.a = it;
                    this.b = 2;
                    if (rowConfigDao2.updateSort(str, str2, str3, this) == ck1Var) {
                        return ck1Var;
                    }
                }
                return e6a.a;
            }
            s38.b(obj);
        }
        it = this.f.entrySet().iterator();
        while (it.hasNext()) {
        }
        return e6a.a;
    }
}
