package D;

import F.O;
import androidx.compose.runtime.MutableIntState;
import androidx.compose.runtime.snapshots.Snapshot;
import androidx.compose.runtime.snapshots.SnapshotStateList;
import h3.T3;
import java.util.Collection;
import java.util.List;
import java.util.Locale;
import org.json.JSONObject;
import w4.C3137A;
import x.InterfaceC3146a1;

/* JADX INFO: loaded from: classes.dex */
public final /* synthetic */ class C implements J4.c {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f752a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ int f753b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ Object f754c;

    public /* synthetic */ C(int i6, int i7, Object obj) {
        this.f752a = i7;
        this.f753b = i6;
        this.f754c = obj;
    }

    @Override // J4.c
    public final Object invoke(Object obj) {
        int i6;
        z = false;
        boolean z6 = false;
        C3137A c3137a = C3137A.f25453a;
        int i7 = this.f753b;
        Object obj2 = this.f754c;
        switch (this.f752a) {
            case 0:
                O o6 = (O) obj;
                C0130a c0130a = ((H) obj2).f767a;
                Snapshot.Companion companion = Snapshot.Companion;
                Snapshot currentThreadSnapshot = companion.getCurrentThreadSnapshot();
                companion.restoreNonObservable(currentThreadSnapshot, companion.makeCurrentNonObservable(currentThreadSnapshot), currentThreadSnapshot != null ? currentThreadSnapshot.getReadObserver() : null);
                c0130a.getClass();
                int i8 = o6.f1216a;
                i6 = i8 != -1 ? i8 : 2;
                for (int i9 = 0; i9 < i6; i9++) {
                    o6.a(i7 + i9);
                }
                return c3137a;
            case 1:
                O o7 = (O) obj;
                C0130a c0130a2 = ((E.D) obj2).f964a;
                Snapshot.Companion companion2 = Snapshot.Companion;
                Snapshot currentThreadSnapshot2 = companion2.getCurrentThreadSnapshot();
                companion2.restoreNonObservable(currentThreadSnapshot2, companion2.makeCurrentNonObservable(currentThreadSnapshot2), currentThreadSnapshot2 != null ? currentThreadSnapshot2.getReadObserver() : null);
                c0130a2.getClass();
                int i10 = o7.f1216a;
                i6 = i10 != -1 ? i10 : 2;
                for (int i11 = 0; i11 < i6; i11++) {
                    o7.a(i7 + i11);
                }
                return c3137a;
            case 2:
                n0.q focusProperties = (n0.q) obj;
                kotlin.jvm.internal.o.h(focusProperties, "$this$focusProperties");
                List list = (List) obj2;
                focusProperties.e((n0.x) (i7 > 0 ? list.get(i7 - 1) : list.get(i7)));
                focusProperties.g((n0.x) list.get(1 + i7));
                focusProperties.i((n0.x) list.get(i7));
                focusProperties.b((n0.x) list.get(i7));
                return c3137a;
            case 3:
                JSONObject jo = (JSONObject) obj;
                kotlin.jvm.internal.o.h(jo, "jo");
                if (jo.optInt("tmdbId", 0) == i7) {
                    String lowerCase = A0.a.p(jo, "type", "movie", "optString(...)").toLowerCase(Locale.ROOT);
                    kotlin.jvm.internal.o.g(lowerCase, "toLowerCase(...)");
                    if ((S4.p.Q0(lowerCase) ? "movie" : lowerCase).equals((String) obj2)) {
                        z6 = true;
                    }
                }
                return Boolean.valueOf(z6);
            case 4:
                return Boolean.valueOf(SnapshotStateList.addAll$lambda$0(i7, (Collection) obj2, (List) obj));
            default:
                n0.B it = (n0.B) obj;
                kotlin.jvm.internal.o.h(it, "it");
                if (((n0.C) it).a()) {
                    J.f fVar = T3.f17405a;
                    ((MutableIntState) obj2).setIntValue(i7);
                }
                return c3137a;
        }
    }

    public /* synthetic */ C(InterfaceC3146a1 interfaceC3146a1, int i6, int i7) {
        this.f752a = i7;
        this.f754c = interfaceC3146a1;
        this.f753b = i6;
    }
}
