package K2;

import android.view.KeyEvent;
import androidx.compose.runtime.MutableState;

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

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

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

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

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

    public j(J4.a aVar, MutableState mutableState, boolean z6, boolean z7) {
        this.f4093a = mutableState;
        this.f4094b = z6;
        this.f4095c = z7;
        this.f4096d = aVar;
    }

    @Override // J4.c
    public final Object invoke(Object obj) {
        KeyEvent event = ((A0.c) obj).f76a;
        kotlin.jvm.internal.o.h(event, "event");
        int keyCode = event.getKeyCode();
        if (keyCode != 23 && keyCode != 66 && keyCode != 160) {
            return Boolean.FALSE;
        }
        int iC = A0.d.c(event);
        MutableState mutableState = this.f4093a;
        if (iC == 1) {
            if (((Boolean) mutableState.getValue()).booleanValue()) {
                mutableState.setValue(Boolean.FALSE);
            }
            return Boolean.FALSE;
        }
        if (A0.d.c(event) != 2) {
            return Boolean.FALSE;
        }
        if (this.f4094b && this.f4095c && ((Boolean) mutableState.getValue()).booleanValue()) {
            return Boolean.TRUE;
        }
        if (event.getRepeatCount() != 0) {
            return Boolean.FALSE;
        }
        this.f4096d.invoke();
        return Boolean.TRUE;
    }
}
