package androidx.compose.foundation;

import android.view.KeyEvent;
import java.util.Arrays;
import o.AbstractC0662Zn;
import o.AbstractC1503ii;
import o.AbstractC1692kh0;
import o.AbstractC2378rs0;
import o.AbstractC2841wm0;
import o.C0140Fk;
import o.C0321Mk;
import o.C0781b40;
import o.C0970d30;
import o.C1065e30;
import o.C2232qL;
import o.C3025yj0;
import o.FJ;
import o.IJ;
import o.JP;
import o.KQ;
import o.L70;
import o.MP;
import o.NC;
import o.OU;
import o.Z40;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public abstract class a {
    public static MP a(MP mp, C2232qL c2232qL) {
        return mp.g(new BackgroundElement(0L, c2232qL, AbstractC2841wm0.j, 1));
    }

    public static final MP b(MP mp, long j, L70 l70) {
        return mp.g(new BackgroundElement(j, null, l70, 2));
    }

    public static MP c(MP mp, KQ kq, C0970d30 c0970d30, boolean z, C1065e30 c1065e30, NC nc, int i) {
        MP mpO;
        if ((i & 4) != 0) {
            z = true;
        }
        boolean z2 = z;
        if ((i & 16) != 0) {
            c1065e30 = null;
        }
        C1065e30 c1065e302 = c1065e30;
        if (c0970d30 != null) {
            mpO = new ClickableElement(kq, c0970d30, false, z2, null, c1065e302, nc);
        } else if (c0970d30 == null) {
            mpO = new ClickableElement(kq, null, false, z2, null, c1065e302, nc);
        } else if (kq != null) {
            mpO = c.a(kq, c0970d30).g(new ClickableElement(kq, null, false, z2, null, c1065e302, nc));
        } else {
            mpO = AbstractC1692kh0.o(JP.a, new b(c0970d30, z2, c1065e302, nc));
        }
        return mp.g(mpO);
    }

    public static MP d(MP mp, String str, NC nc, int i) {
        if ((i & 2) != 0) {
            str = null;
        }
        return mp.g(new ClickableElement(null, null, true, true, str, null, nc));
    }

    public static final MP e(MP mp, boolean z, KQ kq) {
        return mp.g(z ? new FocusableElement(kq) : JP.a);
    }

    public static final boolean f(KeyEvent keyEvent) {
        long jR = IJ.r(keyEvent);
        int i = FJ.p;
        return FJ.a(jR, FJ.h) || FJ.a(jR, FJ.k) || FJ.a(jR, FJ.f117o) || FJ.a(jR, FJ.j);
    }

    public static final Z40 g(C0321Mk c0321Mk) {
        Object[] objArr = new Object[0];
        boolean zD = c0321Mk.d(0);
        Object objK = c0321Mk.K();
        if (zD || objK == C0140Fk.a) {
            objK = new C0781b40(1);
            c0321Mk.f0(objK);
        }
        return (Z40) AbstractC0662Zn.D(Arrays.copyOf(objArr, 0), Z40.i, (NC) objK, c0321Mk, 384);
    }

    public static MP h(MP mp, Z40 z40) {
        KQ kq = z40.c;
        float f = AbstractC1503ii.a;
        return mp.g(AbstractC2378rs0.F(JP.a, C3025yj0.b)).g(new ScrollingContainerElement(z40, OU.l, kq)).g(new ScrollingLayoutElement(z40));
    }
}
