package o;

import android.content.Context;
import android.graphics.Rect;
import android.graphics.Region;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import androidx.compose.ui.semantics.AppendedSemanticsElement;
import com.google.android.gms.common.R;
import java.util.LinkedHashMap;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public abstract class Z5 extends ViewGroup implements SR, InterfaceC2646uk, InterfaceC1672kV, InterfaceC2904xT {
    public Kl0 A;
    public final Y5 B;
    public final Y5 C;
    public OC D;
    public final int[] E;
    public int F;
    public int G;
    public final KZ H;
    public boolean I;
    public final C2420sK J;
    public final JR l;
    public final View m;
    public final InterfaceC1577jV n;

    /* renamed from: o, reason: collision with root package name */
    public NC f434o;
    public boolean p;
    public NC q;
    public NC r;
    public MP s;
    public OC t;
    public InterfaceC2281qr u;
    public OC v;
    public InterfaceC0898cL w;
    public InterfaceC1925n40 x;
    public final int[] y;
    public long z;

    public Z5(Context context, C0244Jk c0244Jk, int i, JR jr, View view, InterfaceC1577jV interfaceC1577jV) {
        super(context);
        this.l = jr;
        this.m = view;
        this.n = interfaceC1577jV;
        LinkedHashMap linkedHashMap = Yl0.a;
        setTag(R.id.androidx_compose_ui_view_composition_context, c0244Jk);
        int i2 = 0;
        setSaveFromParentEnabled(false);
        addView(view);
        Tj0 tj0 = (Tj0) this;
        Oj0.o(this, new R5(tj0, i2));
        Gj0.l(this, this);
        this.f434o = G3.y;
        this.q = G3.x;
        this.r = G3.w;
        this.s = JP.a;
        this.u = AbstractC0752ap.e();
        int i3 = 2;
        this.y = new int[2];
        this.z = 0L;
        this.B = new Y5(tj0, 1);
        this.C = new Y5(tj0, i2);
        this.E = new int[2];
        this.F = Integer.MIN_VALUE;
        this.G = Integer.MIN_VALUE;
        this.H = new KZ(1);
        C2420sK c2420sK = new C2420sK(3);
        c2420sK.y = tj0;
        MP mpG = androidx.compose.ui.input.nestedscroll.a.a(jr).g(new AppendedSemanticsElement(C1160f3.y, true));
        NX nx = new NX();
        nx.a = new T5(tj0, 1);
        C1513in c1513in = new C1513in();
        C1513in c1513in2 = nx.b;
        if (c1513in2 != null) {
            c1513in2.m = null;
        }
        nx.b = c1513in;
        c1513in.m = nx;
        setOnRequestDisallowInterceptTouchEvent$ui_release(c1513in);
        MP mpD = androidx.compose.ui.layout.a.d(androidx.compose.ui.draw.a.a(mpG.g(nx), new V5(tj0, c2420sK, tj0)), new S5(tj0, c2420sK, i3));
        c2420sK.Z(this.s.g(mpD));
        int i4 = 7;
        this.t = new K3(i4, c2420sK, mpD);
        c2420sK.V(this.u);
        this.v = new C2769w(i4, c2420sK);
        c2420sK.T = new S5(tj0, c2420sK, i2);
        c2420sK.U = new T5(tj0, 0);
        c2420sK.Y(new U5(tj0, c2420sK));
        this.J = c2420sK;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final C1767lV getSnapshotObserver() {
        if (!isAttachedToWindow()) {
            AbstractC2133pH.b("Expected AndroidViewHolder to be attached when observing reads.");
        }
        return ((C2207q3) this.n).getSnapshotObserver();
    }

    public static final int k(Tj0 tj0, int i, int i2, int i3) {
        return (i3 >= 0 || i == i2) ? View.MeasureSpec.makeMeasureSpec(AbstractC0940cn0.k(i3, i, i2), 1073741824) : (i3 != -2 || i2 == Integer.MAX_VALUE) ? (i3 != -1 || i2 == Integer.MAX_VALUE) ? View.MeasureSpec.makeMeasureSpec(0, 0) : View.MeasureSpec.makeMeasureSpec(i2, 1073741824) : View.MeasureSpec.makeMeasureSpec(i2, Integer.MIN_VALUE);
    }

    public static LH l(LH lh, int i, int i2, int i3, int i4) {
        int i5 = lh.a - i;
        if (i5 < 0) {
            i5 = 0;
        }
        int i6 = lh.b - i2;
        if (i6 < 0) {
            i6 = 0;
        }
        int i7 = lh.c - i3;
        if (i7 < 0) {
            i7 = 0;
        }
        int i8 = lh.d - i4;
        return LH.b(i5, i6, i7, i8 >= 0 ? i8 : 0);
    }

    @Override // o.InterfaceC1672kV
    public final boolean C() {
        return isAttachedToWindow();
    }

    @Override // o.RR
    public final void a(View view, View view2, int i, int i2) {
        KZ kz = this.H;
        if (i2 == 1) {
            kz.c = i;
        } else {
            kz.b = i;
        }
    }

    @Override // o.RR
    public final void b(View view, int i) {
        KZ kz = this.H;
        if (i == 1) {
            kz.c = 0;
        } else {
            kz.b = 0;
        }
    }

    @Override // o.RR
    public final void c(View view, int i, int i2, int[] iArr, int i3) {
        if (this.m.isNestedScrollingEnabled()) {
            float f = i;
            float f2 = -1;
            long jFloatToRawIntBits = (Float.floatToRawIntBits(f * f2) << 32) | (Float.floatToRawIntBits(i2 * f2) & 4294967295L);
            int i4 = i3 == 0 ? 1 : 2;
            NR nr = this.l.a;
            NR nr2 = null;
            if (nr != null && nr.y) {
                nr2 = (NR) YT.v(nr);
            }
            long jF0 = nr2 != null ? nr2.f0(i4, jFloatToRawIntBits) : 0L;
            iArr[0] = C80.q(Float.intBitsToFloat((int) (jF0 >> 32)));
            iArr[1] = C80.q(Float.intBitsToFloat((int) (jF0 & 4294967295L)));
        }
    }

    @Override // o.InterfaceC2646uk
    public final void d() {
        this.r.a();
    }

    @Override // o.InterfaceC2646uk
    public final void e() {
        this.q.a();
        removeAllViewsInLayout();
    }

    @Override // o.SR
    public final void f(View view, int i, int i2, int i3, int i4, int i5, int[] iArr) {
        if (this.m.isNestedScrollingEnabled()) {
            float f = i;
            float f2 = -1;
            long jFloatToRawIntBits = (Float.floatToRawIntBits(f * f2) << 32) | (Float.floatToRawIntBits(i2 * f2) & 4294967295L);
            long jFloatToRawIntBits2 = (Float.floatToRawIntBits(i3 * f2) << 32) | (Float.floatToRawIntBits(i4 * f2) & 4294967295L);
            int i6 = i5 == 0 ? 1 : 2;
            NR nr = this.l.a;
            NR nr2 = null;
            if (nr != null && nr.y) {
                nr2 = (NR) YT.v(nr);
            }
            NR nr3 = nr2;
            long jL = nr3 != null ? nr3.L(i6, jFloatToRawIntBits, jFloatToRawIntBits2) : 0L;
            iArr[0] = C80.q(Float.intBitsToFloat((int) (jL >> 32)));
            iArr[1] = C80.q(Float.intBitsToFloat((int) (jL & 4294967295L)));
        }
    }

    @Override // o.RR
    public final void g(View view, int i, int i2, int i3, int i4, int i5) {
        if (this.m.isNestedScrollingEnabled()) {
            float f = -1;
            long jFloatToRawIntBits = (Float.floatToRawIntBits(i * f) << 32) | (Float.floatToRawIntBits(i2 * f) & 4294967295L);
            long jFloatToRawIntBits2 = (Float.floatToRawIntBits(i3 * f) << 32) | (Float.floatToRawIntBits(i4 * f) & 4294967295L);
            int i6 = i5 == 0 ? 1 : 2;
            NR nr = this.l.a;
            NR nr2 = null;
            if (nr != null && nr.y) {
                nr2 = (NR) YT.v(nr);
            }
            if (nr2 != null) {
                nr2.L(i6, jFloatToRawIntBits, jFloatToRawIntBits2);
            }
        }
    }

    @Override // android.view.ViewGroup, android.view.View
    public final boolean gatherTransparentRegion(Region region) {
        if (region == null) {
            return true;
        }
        int[] iArr = this.E;
        getLocationInWindow(iArr);
        int i = iArr[0];
        region.op(i, iArr[1], getWidth() + i, getHeight() + iArr[1], Region.Op.DIFFERENCE);
        return true;
    }

    @Override // android.view.ViewGroup, android.view.View
    public CharSequence getAccessibilityClassName() {
        return getClass().getName();
    }

    public final InterfaceC2281qr getDensity() {
        return this.u;
    }

    public final View getInteropView() {
        return this.m;
    }

    public final C2420sK getLayoutNode() {
        return this.J;
    }

    @Override // android.view.View
    public ViewGroup.LayoutParams getLayoutParams() {
        ViewGroup.LayoutParams layoutParams = this.m.getLayoutParams();
        return layoutParams == null ? new ViewGroup.LayoutParams(-1, -1) : layoutParams;
    }

    public final InterfaceC0898cL getLifecycleOwner() {
        return this.w;
    }

    public final MP getModifier() {
        return this.s;
    }

    @Override // android.view.ViewGroup
    public int getNestedScrollAxes() {
        KZ kz = this.H;
        return kz.c | kz.b;
    }

    public final OC getOnDensityChanged$ui_release() {
        return this.v;
    }

    public final OC getOnModifierChanged$ui_release() {
        return this.t;
    }

    public final OC getOnRequestDisallowInterceptTouchEvent$ui_release() {
        return this.D;
    }

    public final NC getRelease() {
        return this.r;
    }

    public final NC getReset() {
        return this.q;
    }

    public final InterfaceC1925n40 getSavedStateRegistryOwner() {
        return this.x;
    }

    public final NC getUpdate() {
        return this.f434o;
    }

    public final View getView() {
        return this.m;
    }

    @Override // o.RR
    public final boolean h(View view, View view2, int i, int i2) {
        return ((i & 2) == 0 && (i & 1) == 0) ? false : true;
    }

    @Override // o.InterfaceC2904xT
    public final Kl0 i(View view, Kl0 kl0) {
        this.A = new Kl0(kl0);
        return m(kl0);
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final ViewParent invalidateChildInParent(int[] iArr, Rect rect) {
        super.invalidateChildInParent(iArr, rect);
        if (!this.I) {
            this.J.z();
            return null;
        }
        this.m.postOnAnimation(new J1(3, this.C));
        return null;
    }

    @Override // android.view.View
    public final boolean isNestedScrollingEnabled() {
        return this.m.isNestedScrollingEnabled();
    }

    public final Kl0 m(Kl0 kl0) {
        Hl0 hl0 = kl0.a;
        LH lhG = hl0.g(-1);
        LH lh = LH.e;
        if (!lhG.equals(lh) || !hl0.h(-9).equals(lh) || hl0.f() != null) {
            C2702vH c2702vH = (C2702vH) this.J.N.d;
            if (c2702vH.Z.y) {
                long jP = As0.P(c2702vH.L(0L));
                int i = (int) (jP >> 32);
                if (i < 0) {
                    i = 0;
                }
                int i2 = (int) (jP & 4294967295L);
                if (i2 < 0) {
                    i2 = 0;
                }
                long jK = AbstractC2841wm0.s(c2702vH).K();
                int i3 = (int) (jK >> 32);
                int i4 = (int) (jK & 4294967295L);
                long j = c2702vH.n;
                long jP2 = As0.P(c2702vH.L((Float.floatToRawIntBits((int) (j >> 32)) << 32) | (Float.floatToRawIntBits((int) (j & 4294967295L)) & 4294967295L)));
                int i5 = i3 - ((int) (jP2 >> 32));
                if (i5 < 0) {
                    i5 = 0;
                }
                int i6 = i4 - ((int) (4294967295L & jP2));
                int i7 = i6 >= 0 ? i6 : 0;
                if (i != 0 || i2 != 0 || i5 != 0 || i7 != 0) {
                    return kl0.a.n(i, i2, i5, i7);
                }
            }
        }
        return kl0;
    }

    @Override // android.view.ViewGroup, android.view.View
    public final void onAttachedToWindow() {
        super.onAttachedToWindow();
        this.B.a();
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final void onDescendantInvalidated(View view, View view2) {
        super.onDescendantInvalidated(view, view2);
        if (!this.I) {
            this.J.z();
        } else {
            this.m.postOnAnimation(new J1(3, this.C));
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:22:0x0079  */
    /* JADX WARN: Removed duplicated region for block: B:8:0x0026  */
    @Override // android.view.ViewGroup, android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void onDetachedFromWindow() {
        /*
            r22 = this;
            r1 = r22
            super.onDetachedFromWindow()
            o.lV r0 = r1.getSnapshotObserver()
            o.J90 r0 = r0.a
            java.lang.Object r2 = r0.g
            monitor-enter(r2)
            o.iR r0 = r0.f     // Catch: java.lang.Throwable -> L96
            int r3 = r0.n     // Catch: java.lang.Throwable -> L96
            r5 = 0
            r6 = 0
        L14:
            if (r5 >= r3) goto L9c
            java.lang.Object[] r7 = r0.l     // Catch: java.lang.Throwable -> L96
            r7 = r7[r5]     // Catch: java.lang.Throwable -> L96
            o.I90 r7 = (o.I90) r7     // Catch: java.lang.Throwable -> L96
            o.ZQ r8 = r7.f     // Catch: java.lang.Throwable -> L96
            java.lang.Object r8 = r8.k(r1)     // Catch: java.lang.Throwable -> L96
            o.QQ r8 = (o.QQ) r8     // Catch: java.lang.Throwable -> L96
            if (r8 != 0) goto L29
        L26:
            r16 = r5
            goto L80
        L29:
            java.lang.Object[] r9 = r8.b     // Catch: java.lang.Throwable -> L96
            int[] r10 = r8.c     // Catch: java.lang.Throwable -> L96
            long[] r8 = r8.a     // Catch: java.lang.Throwable -> L96
            int r11 = r8.length     // Catch: java.lang.Throwable -> L96
            int r11 = r11 + (-2)
            if (r11 < 0) goto L26
            r12 = 0
        L35:
            r13 = r8[r12]     // Catch: java.lang.Throwable -> L96
            r16 = r5
            long r4 = ~r13     // Catch: java.lang.Throwable -> L96
            r17 = 7
            long r4 = r4 << r17
            long r4 = r4 & r13
            r17 = -9187201950435737472(0x8080808080808080, double:-2.937446524422997E-306)
            long r4 = r4 & r17
            int r4 = (r4 > r17 ? 1 : (r4 == r17 ? 0 : -1))
            if (r4 == 0) goto L79
            int r4 = r12 - r11
            int r4 = ~r4     // Catch: java.lang.Throwable -> L96
            int r4 = r4 >>> 31
            r5 = 8
            int r4 = 8 - r4
            r15 = 0
        L54:
            if (r15 >= r4) goto L77
            r18 = 255(0xff, double:1.26E-321)
            long r18 = r13 & r18
            r20 = 128(0x80, double:6.3E-322)
            int r18 = (r18 > r20 ? 1 : (r18 == r20 ? 0 : -1))
            if (r18 >= 0) goto L6e
            int r18 = r12 << 3
            int r18 = r18 + r15
            r19 = r5
            r5 = r9[r18]     // Catch: java.lang.Throwable -> L96
            r18 = r10[r18]     // Catch: java.lang.Throwable -> L96
            r7.d(r1, r5)     // Catch: java.lang.Throwable -> L96
            goto L70
        L6e:
            r19 = r5
        L70:
            long r13 = r13 >> r19
            int r15 = r15 + 1
            r5 = r19
            goto L54
        L77:
            if (r4 != r5) goto L80
        L79:
            if (r12 == r11) goto L80
            int r12 = r12 + 1
            r5 = r16
            goto L35
        L80:
            o.ZQ r4 = r7.f     // Catch: java.lang.Throwable -> L96
            boolean r4 = r4.j()     // Catch: java.lang.Throwable -> L96
            if (r4 != 0) goto L8b
            int r6 = r6 + 1
            goto L98
        L8b:
            if (r6 <= 0) goto L98
            java.lang.Object[] r4 = r0.l     // Catch: java.lang.Throwable -> L96
            int r5 = r16 - r6
            r7 = r4[r16]     // Catch: java.lang.Throwable -> L96
            r4[r5] = r7     // Catch: java.lang.Throwable -> L96
            goto L98
        L96:
            r0 = move-exception
            goto La8
        L98:
            int r5 = r16 + 1
            goto L14
        L9c:
            java.lang.Object[] r4 = r0.l     // Catch: java.lang.Throwable -> L96
            int r5 = r3 - r6
            r6 = 0
            java.util.Arrays.fill(r4, r5, r3, r6)     // Catch: java.lang.Throwable -> L96
            r0.n = r5     // Catch: java.lang.Throwable -> L96
            monitor-exit(r2)
            return
        La8:
            monitor-exit(r2)
            throw r0
        */
        throw new UnsupportedOperationException("Method not decompiled: o.Z5.onDetachedFromWindow():void");
    }

    @Override // android.view.ViewGroup, android.view.View
    public final void onLayout(boolean z, int i, int i2, int i3, int i4) {
        this.m.layout(0, 0, i3 - i, i4 - i2);
    }

    @Override // android.view.View
    public final void onMeasure(int i, int i2) {
        View view = this.m;
        if (view.getParent() != this) {
            setMeasuredDimension(View.MeasureSpec.getSize(i), View.MeasureSpec.getSize(i2));
            return;
        }
        if (view.getVisibility() == 8) {
            setMeasuredDimension(0, 0);
            return;
        }
        view.measure(i, i2);
        setMeasuredDimension(view.getMeasuredWidth(), view.getMeasuredHeight());
        this.F = i;
        this.G = i2;
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final boolean onNestedFling(View view, float f, float f2, boolean z) {
        if (!this.m.isNestedScrollingEnabled()) {
            return false;
        }
        AbstractC1692kh0.C(this.l.c(), null, new W5(z, this, AbstractC0752ap.l(f * (-1.0f), f2 * (-1.0f)), null), 3);
        return false;
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final boolean onNestedPreFling(View view, float f, float f2) {
        if (!this.m.isNestedScrollingEnabled()) {
            return false;
        }
        AbstractC1692kh0.C(this.l.c(), null, new X5(this, AbstractC0752ap.l(f * (-1.0f), f2 * (-1.0f)), null, 0), 3);
        return false;
    }

    @Override // android.view.View
    public final void onWindowVisibilityChanged(int i) {
        super.onWindowVisibilityChanged(i);
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final void requestDisallowInterceptTouchEvent(boolean z) {
        OC oc = this.D;
        if (oc != null) {
            oc.g(Boolean.valueOf(z));
        }
        super.requestDisallowInterceptTouchEvent(z);
    }

    public final void setDensity(InterfaceC2281qr interfaceC2281qr) {
        if (interfaceC2281qr != this.u) {
            this.u = interfaceC2281qr;
            OC oc = this.v;
            if (oc != null) {
                oc.g(interfaceC2281qr);
            }
        }
    }

    public final void setLifecycleOwner(InterfaceC0898cL interfaceC0898cL) {
        if (interfaceC0898cL != this.w) {
            this.w = interfaceC0898cL;
            AbstractC2461sm0.D(this, interfaceC0898cL);
        }
    }

    public final void setModifier(MP mp) {
        if (mp != this.s) {
            this.s = mp;
            OC oc = this.t;
            if (oc != null) {
                oc.g(mp);
            }
        }
    }

    public final void setOnDensityChanged$ui_release(OC oc) {
        this.v = oc;
    }

    public final void setOnModifierChanged$ui_release(OC oc) {
        this.t = oc;
    }

    public final void setOnRequestDisallowInterceptTouchEvent$ui_release(OC oc) {
        this.D = oc;
    }

    public final void setRelease(NC nc) {
        this.r = nc;
    }

    public final void setReset(NC nc) {
        this.q = nc;
    }

    public final void setSavedStateRegistryOwner(InterfaceC1925n40 interfaceC1925n40) {
        if (interfaceC1925n40 != this.x) {
            this.x = interfaceC1925n40;
            AbstractC2841wm0.C(this, interfaceC1925n40);
        }
    }

    public final void setUpdate(NC nc) {
        this.f434o = nc;
        this.p = true;
        this.B.a();
    }

    @Override // android.view.ViewGroup
    public final boolean shouldDelayChildPressedState() {
        return true;
    }
}
