package j2;

import l1.i;

/* loaded from: classes.dex */
public final class c0 extends z0 {

    /* renamed from: m0, reason: collision with root package name */
    public static final a f23598m0 = new a(null);

    /* renamed from: n0, reason: collision with root package name */
    private static final s1.d1 f23599n0;

    /* renamed from: i0, reason: collision with root package name */
    private b0 f23600i0;

    /* renamed from: j0, reason: collision with root package name */
    private c3.b f23601j0;

    /* renamed from: k0, reason: collision with root package name */
    private q0 f23602k0;

    /* renamed from: l0, reason: collision with root package name */
    private h2.d f23603l0;

    /* loaded from: classes.dex */
    public static final class a {
        private a() {
        }

        public /* synthetic */ a(kotlin.jvm.internal.k kVar) {
            this();
        }
    }

    /* loaded from: classes.dex */
    private final class b extends q0 {
        public b() {
            super(c0.this);
        }

        @Override // j2.q0, h2.n
        public int T(int i10) {
            b0 u32 = c0.this.u3();
            q0 v22 = c0.this.v3().v2();
            kotlin.jvm.internal.t.d(v22);
            return u32.I(this, v22, i10);
        }

        @Override // j2.q0, h2.n
        public int X(int i10) {
            b0 u32 = c0.this.u3();
            q0 v22 = c0.this.v3().v2();
            kotlin.jvm.internal.t.d(v22);
            return u32.x(this, v22, i10);
        }

        @Override // h2.d0
        public h2.p0 Y(long j10) {
            c0 c0Var = c0.this;
            q0.Q1(this, j10);
            c0Var.y3(c3.b.a(j10));
            b0 u32 = c0Var.u3();
            q0 v22 = c0Var.v3().v2();
            kotlin.jvm.internal.t.d(v22);
            q0.R1(this, u32.h(this, v22, j10));
            return this;
        }

        @Override // j2.p0
        public int n1(h2.a aVar) {
            int b10;
            b10 = d0.b(this, aVar);
            U1().put(aVar, Integer.valueOf(b10));
            return b10;
        }

        @Override // j2.q0, h2.n
        public int s(int i10) {
            b0 u32 = c0.this.u3();
            q0 v22 = c0.this.v3().v2();
            kotlin.jvm.internal.t.d(v22);
            return u32.p(this, v22, i10);
        }

        @Override // j2.q0, h2.n
        public int v0(int i10) {
            b0 u32 = c0.this.u3();
            q0 v22 = c0.this.v3().v2();
            kotlin.jvm.internal.t.d(v22);
            return u32.s(this, v22, i10);
        }
    }

    static {
        s1.d1 a10 = s1.l.a();
        a10.G(s1.g0.f35254b.b());
        a10.I(1.0f);
        a10.F(s1.e1.f35240a.b());
        f23599n0 = a10;
    }

    public c0(g0 g0Var, b0 b0Var) {
        super(g0Var);
        this.f23600i0 = b0Var;
        h2.d dVar = null;
        this.f23602k0 = g0Var.b0() != null ? new b() : null;
        if ((b0Var.P0().J1() & b1.a(512)) != 0) {
            kotlin.jvm.internal.t.e(b0Var, "null cannot be cast to non-null type androidx.compose.ui.layout.ApproachLayoutModifierNode");
            android.support.v4.media.session.b.a(b0Var);
            dVar = new h2.d(this, null);
        }
        this.f23603l0 = dVar;
    }

    private final void w3() {
        if (L1()) {
            return;
        }
        T2();
        h2.d dVar = this.f23603l0;
        if (dVar == null) {
            A1().i();
            v3().b3(false);
            return;
        }
        dVar.h();
        E1();
        q0 v22 = v2();
        kotlin.jvm.internal.t.d(v22);
        v22.X1();
        throw null;
    }

    @Override // h2.n
    public int T(int i10) {
        h2.d dVar = this.f23603l0;
        if (dVar == null) {
            return this.f23600i0.I(this, v3(), i10);
        }
        dVar.h();
        v3();
        throw null;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // j2.z0, h2.p0
    public void V0(long j10, float f10, dn.l lVar) {
        super.V0(j10, f10, lVar);
        w3();
    }

    @Override // j2.z0
    public void V2(s1.a0 a0Var, v1.c cVar) {
        v3().i2(a0Var, cVar);
        if (k0.b(w1()).getShowLayoutBounds()) {
            j2(a0Var, f23599n0);
        }
    }

    @Override // h2.n
    public int X(int i10) {
        h2.d dVar = this.f23603l0;
        if (dVar == null) {
            return this.f23600i0.x(this, v3(), i10);
        }
        dVar.h();
        v3();
        throw null;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // j2.z0, h2.p0
    public void X0(long j10, float f10, v1.c cVar) {
        super.X0(j10, f10, cVar);
        w3();
    }

    @Override // h2.d0
    public h2.p0 Y(long j10) {
        if (r2()) {
            c3.b bVar = this.f23601j0;
            if (bVar == null) {
                throw new IllegalArgumentException("Lookahead constraints cannot be null in approach pass.".toString());
            }
            j10 = bVar.r();
        }
        d1(j10);
        h2.d dVar = this.f23603l0;
        if (dVar == null) {
            c3(u3().h(this, v3(), j10));
            S2();
            return this;
        }
        dVar.h();
        dVar.q();
        throw null;
    }

    @Override // j2.z0
    public void l2() {
        if (v2() == null) {
            z3(new b());
        }
    }

    @Override // j2.p0
    public int n1(h2.a aVar) {
        int b10;
        q0 v22 = v2();
        if (v22 != null) {
            return v22.T1(aVar);
        }
        b10 = d0.b(this, aVar);
        return b10;
    }

    @Override // h2.n
    public int s(int i10) {
        h2.d dVar = this.f23603l0;
        if (dVar == null) {
            return this.f23600i0.p(this, v3(), i10);
        }
        dVar.h();
        v3();
        throw null;
    }

    public final b0 u3() {
        return this.f23600i0;
    }

    @Override // h2.n
    public int v0(int i10) {
        h2.d dVar = this.f23603l0;
        if (dVar == null) {
            return this.f23600i0.s(this, v3(), i10);
        }
        dVar.h();
        v3();
        throw null;
    }

    @Override // j2.z0
    public q0 v2() {
        return this.f23602k0;
    }

    public final z0 v3() {
        z0 A2 = A2();
        kotlin.jvm.internal.t.d(A2);
        return A2;
    }

    public final void x3(b0 b0Var) {
        if (!kotlin.jvm.internal.t.b(b0Var, this.f23600i0)) {
            if ((b0Var.P0().J1() & b1.a(512)) != 0) {
                kotlin.jvm.internal.t.e(b0Var, "null cannot be cast to non-null type androidx.compose.ui.layout.ApproachLayoutModifierNode");
                android.support.v4.media.session.b.a(b0Var);
                h2.d dVar = this.f23603l0;
                if (dVar != null) {
                    android.support.v4.media.session.b.a(b0Var);
                    dVar.r(null);
                } else {
                    android.support.v4.media.session.b.a(b0Var);
                    dVar = new h2.d(this, null);
                }
                this.f23603l0 = dVar;
            } else {
                this.f23603l0 = null;
            }
        }
        this.f23600i0 = b0Var;
    }

    public final void y3(c3.b bVar) {
        this.f23601j0 = bVar;
    }

    @Override // j2.z0
    public i.c z2() {
        return this.f23600i0.P0();
    }

    protected void z3(q0 q0Var) {
        this.f23602k0 = q0Var;
    }
}
