package androidx.compose.foundation.lazy.layout;

import dn.l;
import g0.k0;
import g0.m0;
import g0.p0;
import java.util.ArrayList;
import java.util.List;
import kotlin.jvm.internal.k;
import sm.u;

/* loaded from: classes.dex */
public final class d {

    /* renamed from: a, reason: collision with root package name */
    private final p0 f1923a;

    /* renamed from: b, reason: collision with root package name */
    private final l f1924b;

    /* renamed from: c, reason: collision with root package name */
    private final m0 f1925c;

    /* renamed from: d, reason: collision with root package name */
    private h f1926d;

    /* loaded from: classes.dex */
    private final class a implements k0 {

        /* renamed from: a, reason: collision with root package name */
        private final List f1927a = new ArrayList();

        public a() {
        }

        @Override // g0.k0
        public void a(int i10) {
            c(i10, e.a());
        }

        public final List b() {
            return this.f1927a;
        }

        public void c(int i10, long j10) {
            h c10 = d.this.c();
            if (c10 == null) {
                return;
            }
            this.f1927a.add(c10.c(i10, j10, d.this.f1925c));
        }
    }

    /* loaded from: classes.dex */
    public interface b {
        void b();

        void cancel();
    }

    public d(p0 p0Var, l lVar) {
        this.f1923a = p0Var;
        this.f1924b = lVar;
        this.f1925c = new m0();
    }

    public final List b() {
        List k10;
        l lVar = this.f1924b;
        if (lVar == null) {
            k10 = u.k();
            return k10;
        }
        a aVar = new a();
        lVar.invoke(aVar);
        return aVar.b();
    }

    public final h c() {
        return this.f1926d;
    }

    public final p0 d() {
        return this.f1923a;
    }

    public final b e(int i10, long j10) {
        b d10;
        h hVar = this.f1926d;
        return (hVar == null || (d10 = hVar.d(i10, j10, this.f1925c)) == null) ? androidx.compose.foundation.lazy.layout.a.f1917a : d10;
    }

    public final void f(h hVar) {
        this.f1926d = hVar;
    }

    public /* synthetic */ d(p0 p0Var, l lVar, int i10, k kVar) {
        this((i10 & 1) != 0 ? null : p0Var, (i10 & 2) != 0 ? null : lVar);
    }
}
