package h3;

import android.view.KeyEvent;
import androidx.compose.runtime.MutableState;
import androidx.compose.runtime.State;
import java.util.List;

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

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ n0.x f17086b;

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ J4.a f17088d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final /* synthetic */ boolean f17089e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final /* synthetic */ MutableState f17090f;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final /* synthetic */ State f17091j;

    public N2(boolean z6, n0.x xVar, List list, J4.a aVar, boolean z7, MutableState mutableState, State state) {
        this.f17085a = z6;
        this.f17086b = xVar;
        this.f17087c = list;
        this.f17088d = aVar;
        this.f17089e = z7;
        this.f17090f = mutableState;
        this.f17091j = state;
    }

    @Override // J4.c
    public final Object invoke(Object obj) {
        KeyEvent event = ((A0.c) obj).f76a;
        kotlin.jvm.internal.o.h(event, "event");
        if (event.getAction() != 0) {
            return Boolean.FALSE;
        }
        if (event.getKeyCode() != 20) {
            return Boolean.FALSE;
        }
        if (this.f17085a) {
            n0.x.a(this.f17086b);
            return Boolean.TRUE;
        }
        State state = this.f17091j;
        boolean zQ0 = S4.p.Q0(((U2) state.getValue()).f17476a);
        List list = this.f17087c;
        if (!zQ0 && !list.isEmpty()) {
            this.f17088d.invoke();
            return Boolean.TRUE;
        }
        if (!S4.p.Q0(((U2) state.getValue()).f17476a)) {
            return Boolean.FALSE;
        }
        if (!list.isEmpty()) {
            return Boolean.FALSE;
        }
        if (!this.f17089e) {
            return Boolean.FALSE;
        }
        J4.a aVar = (J4.a) this.f17090f.getValue();
        if (aVar != null) {
            aVar.invoke();
        }
        return Boolean.TRUE;
    }
}
