package I0;

import androidx.compose.runtime.collection.MutableVector;
import i0.AbstractC2254r;
import p0.AbstractC2711q;
import p0.AbstractC2715v;
import p0.C2700f;
import p0.C2702h;
import p0.InterfaceC2712s;
import r0.C2862a;
import r0.C2863b;
import r0.InterfaceC2864c;
import r0.InterfaceC2866e;

/* JADX INFO: loaded from: classes.dex */
public final class J implements InterfaceC2866e, InterfaceC2864c {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final C2863b f2210a = new C2863b();

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public InterfaceC0305n f2211b;

    @Override // r0.InterfaceC2866e
    public final void A(long j4, long j6, long j7, float f6, int i6) {
        this.f2210a.A(j4, j6, j7, f6, i6);
    }

    @Override // r0.InterfaceC2866e
    public final void H(p0.Q q6, AbstractC2711q abstractC2711q, float f6, r0.f fVar, int i6) {
        this.f2210a.H(q6, abstractC2711q, f6, fVar, i6);
    }

    @Override // h1.c
    public final long I(float f6) {
        return this.f2210a.I(f6);
    }

    @Override // h1.c
    public final float L(int i6) {
        return this.f2210a.L(i6);
    }

    @Override // h1.c
    public final float N(float f6) {
        return f6 / this.f2210a.a();
    }

    @Override // r0.InterfaceC2866e
    public final void P(long j4, float f6, long j6) {
        this.f2210a.P(j4, f6, j6);
    }

    @Override // h1.c
    public final float T() {
        return this.f2210a.T();
    }

    @Override // r0.InterfaceC2866e
    public final void W(long j4, long j6, long j7, long j8) {
        this.f2210a.W(j4, j6, j7, j8);
    }

    @Override // h1.c
    public final float Y(float f6) {
        return this.f2210a.a() * f6;
    }

    @Override // h1.c
    public final float a() {
        return this.f2210a.a();
    }

    @Override // r0.InterfaceC2866e
    public final o4.f a0() {
        return this.f2210a.f23803b;
    }

    public final void b() {
        C2863b c2863b = this.f2210a;
        InterfaceC2712s interfaceC2712sC = c2863b.f23803b.c();
        InterfaceC0305n interfaceC0305n = this.f2211b;
        if (interfaceC0305n == null) {
            throw com.google.android.recaptcha.internal.a.g("Attempting to drawContent for a `null` node. This usually means that a call to ContentDrawScope#drawContent() has been captured inside a lambda, and is being invoked outside of the draw pass. Capturing the scope this way is unsupported - if you are trying to record drawContent with graphicsLayer.record(), make sure you are using the GraphicsLayer#record function within DrawScope, instead of the member function on GraphicsLayer.");
        }
        AbstractC2254r child$ui = interfaceC0305n.getNode().getChild$ui();
        if (child$ui == null || (child$ui.getAggregateChildKindSet$ui() & 4) == 0) {
            child$ui = null;
        } else {
            while (child$ui != null && (child$ui.getKindSet$ui() & 2) == 0) {
                if ((child$ui.getKindSet$ui() & 4) != 0) {
                    break;
                } else {
                    child$ui = child$ui.getChild$ui();
                }
            }
            child$ui = null;
        }
        if (child$ui == null) {
            AbstractC0300j0 abstractC0300j0R = AbstractC0303l.r(interfaceC0305n, 4);
            if (abstractC0300j0R.V0() == interfaceC0305n.getNode()) {
                abstractC0300j0R = abstractC0300j0R.f2422s;
                kotlin.jvm.internal.o.e(abstractC0300j0R);
            }
            abstractC0300j0R.k1(interfaceC2712sC, (s0.b) c2863b.f23803b.f21849b);
            return;
        }
        MutableVector mutableVector = null;
        while (child$ui != null) {
            if (child$ui instanceof InterfaceC0305n) {
                InterfaceC0305n interfaceC0305n2 = (InterfaceC0305n) child$ui;
                s0.b bVar = (s0.b) c2863b.f23803b.f21849b;
                AbstractC0300j0 abstractC0300j0R2 = AbstractC0303l.r(interfaceC0305n2, 4);
                long jK = W0.e.K(abstractC0300j0R2.f2000c);
                H h5 = abstractC0300j0R2.f2421r;
                h5.getClass();
                ((J0.A) K.a(h5)).getSharedDrawScope().d(interfaceC2712sC, jK, abstractC0300j0R2, interfaceC0305n2, bVar);
            } else if ((child$ui.getKindSet$ui() & 4) != 0 && (child$ui instanceof AbstractC0301k)) {
                int i6 = 0;
                for (AbstractC2254r child$ui2 = ((AbstractC0301k) child$ui).f2431b; child$ui2 != null; child$ui2 = child$ui2.getChild$ui()) {
                    if ((child$ui2.getKindSet$ui() & 4) != 0) {
                        i6++;
                        if (i6 == 1) {
                            child$ui = child$ui2;
                        } else {
                            if (mutableVector == null) {
                                mutableVector = new MutableVector(new AbstractC2254r[16], 0);
                            }
                            if (child$ui != null) {
                                mutableVector.add(child$ui);
                                child$ui = null;
                            }
                            mutableVector.add(child$ui2);
                        }
                    }
                }
                if (i6 == 1) {
                }
            }
            child$ui = AbstractC0303l.e(mutableVector);
        }
    }

    @Override // r0.InterfaceC2866e
    public final void b0(long j4, float f6, float f7, long j6, long j7, r0.f fVar) {
        this.f2210a.b0(j4, f6, f7, j6, j7, fVar);
    }

    @Override // r0.InterfaceC2866e
    public final long c() {
        return this.f2210a.c();
    }

    public final void d(InterfaceC2712s interfaceC2712s, long j4, AbstractC0300j0 abstractC0300j0, InterfaceC0305n interfaceC0305n, s0.b bVar) {
        InterfaceC0305n interfaceC0305n2 = this.f2211b;
        this.f2211b = interfaceC0305n;
        h1.m mVar = abstractC0300j0.f2421r.f2156D;
        C2863b c2863b = this.f2210a;
        o4.f fVar = c2863b.f23803b;
        C2862a c2862a = ((C2863b) fVar.f21851d).f23802a;
        h1.c cVar = c2862a.f23798a;
        h1.m mVar2 = c2862a.f23799b;
        InterfaceC2712s interfaceC2712sC = fVar.c();
        o4.f fVar2 = c2863b.f23803b;
        long jF = fVar2.f();
        s0.b bVar2 = (s0.b) fVar2.f21849b;
        fVar2.m(abstractC0300j0);
        fVar2.n(mVar);
        fVar2.l(interfaceC2712s);
        fVar2.o(j4);
        fVar2.f21849b = bVar;
        interfaceC2712s.f();
        try {
            interfaceC0305n.draw(this);
            interfaceC2712s.r();
            fVar2.m(cVar);
            fVar2.n(mVar2);
            fVar2.l(interfaceC2712sC);
            fVar2.o(jF);
            fVar2.f21849b = bVar2;
            this.f2211b = interfaceC0305n2;
        } catch (Throwable th) {
            interfaceC2712s.r();
            fVar2.m(cVar);
            fVar2.n(mVar2);
            fVar2.l(interfaceC2712sC);
            fVar2.o(jF);
            fVar2.f21849b = bVar2;
            throw th;
        }
    }

    @Override // r0.InterfaceC2866e
    public final void g(C2702h c2702h, long j4) {
        this.f2210a.g(c2702h, j4);
    }

    @Override // h1.c
    public final int g0(float f6) {
        return this.f2210a.g0(f6);
    }

    @Override // r0.InterfaceC2866e
    public final h1.m getLayoutDirection() {
        return this.f2210a.f23802a.f23799b;
    }

    @Override // r0.InterfaceC2866e
    public final void h(AbstractC2711q abstractC2711q, long j4, long j6, long j7, float f6, r0.f fVar) {
        this.f2210a.h(abstractC2711q, j4, j6, j7, f6, fVar);
    }

    @Override // r0.InterfaceC2866e
    public final long i0() {
        return this.f2210a.i0();
    }

    @Override // h1.c
    public final long k0(long j4) {
        return this.f2210a.k0(j4);
    }

    @Override // r0.InterfaceC2866e
    public final void l0(C2700f c2700f, long j4, long j6, long j7, float f6, AbstractC2715v abstractC2715v, int i6) {
        this.f2210a.l0(c2700f, j4, j6, j7, f6, abstractC2715v, i6);
    }

    @Override // h1.c
    public final long n(float f6) {
        return this.f2210a.n(f6);
    }

    @Override // h1.c
    public final long o(long j4) {
        return this.f2210a.o(j4);
    }

    @Override // h1.c
    public final float o0(long j4) {
        return this.f2210a.o0(j4);
    }

    @Override // r0.InterfaceC2866e
    public final void p0(long j4, long j6, long j7, float f6, int i6) {
        this.f2210a.p0(j4, j6, j7, f6, i6);
    }

    @Override // h1.c
    public final float v(long j4) {
        return this.f2210a.v(j4);
    }

    @Override // r0.InterfaceC2866e
    public final void x(AbstractC2711q abstractC2711q, long j4, long j6, float f6, r0.f fVar) {
        this.f2210a.x(abstractC2711q, j4, j6, f6, fVar);
    }
}
