package o;

import java.util.ArrayList;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.Ar, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public class C0017Ar implements InterfaceC2755vr {
    public final AbstractC0745al0 d;
    public int f;
    public int g;
    public AbstractC0745al0 a = null;
    public boolean b = false;
    public boolean c = false;
    public int e = 1;
    public int h = 1;
    public C0588Wr i = null;
    public boolean j = false;
    public final ArrayList k = new ArrayList();
    public final ArrayList l = new ArrayList();

    public C0017Ar(AbstractC0745al0 abstractC0745al0) {
        this.d = abstractC0745al0;
    }

    @Override // o.InterfaceC2755vr
    public final void a(InterfaceC2755vr interfaceC2755vr) {
        ArrayList arrayList = this.l;
        int size = arrayList.size();
        int i = 0;
        int i2 = 0;
        while (i2 < size) {
            Object obj = arrayList.get(i2);
            i2++;
            if (!((C0017Ar) obj).j) {
                return;
            }
        }
        this.c = true;
        AbstractC0745al0 abstractC0745al0 = this.a;
        if (abstractC0745al0 != null) {
            abstractC0745al0.a(this);
        }
        if (this.b) {
            this.d.a(this);
            return;
        }
        int size2 = arrayList.size();
        C0017Ar c0017Ar = null;
        int i3 = 0;
        while (i3 < size2) {
            Object obj2 = arrayList.get(i3);
            i3++;
            C0017Ar c0017Ar2 = (C0017Ar) obj2;
            if (!(c0017Ar2 instanceof C0588Wr)) {
                i++;
                c0017Ar = c0017Ar2;
            }
        }
        if (c0017Ar != null && i == 1 && c0017Ar.j) {
            C0588Wr c0588Wr = this.i;
            if (c0588Wr != null) {
                if (!c0588Wr.j) {
                    return;
                } else {
                    this.f = this.h * c0588Wr.g;
                }
            }
            d(c0017Ar.g + this.f);
        }
        AbstractC0745al0 abstractC0745al02 = this.a;
        if (abstractC0745al02 != null) {
            abstractC0745al02.a(this);
        }
    }

    public final void b(AbstractC0745al0 abstractC0745al0) {
        this.k.add(abstractC0745al0);
        if (this.j) {
            abstractC0745al0.a(abstractC0745al0);
        }
    }

    public final void c() {
        this.l.clear();
        this.k.clear();
        this.j = false;
        this.g = 0;
        this.c = false;
        this.b = false;
    }

    public void d(int i) {
        if (this.j) {
            return;
        }
        this.j = true;
        this.g = i;
        ArrayList arrayList = this.k;
        int size = arrayList.size();
        int i2 = 0;
        while (i2 < size) {
            Object obj = arrayList.get(i2);
            i2++;
            InterfaceC2755vr interfaceC2755vr = (InterfaceC2755vr) obj;
            interfaceC2755vr.a(interfaceC2755vr);
        }
    }

    public final String toString() {
        String str;
        StringBuilder sb = new StringBuilder();
        sb.append(this.d.b.h0);
        sb.append(":");
        switch (this.e) {
            case 1:
                str = "UNKNOWN";
                break;
            case 2:
                str = "HORIZONTAL_DIMENSION";
                break;
            case 3:
                str = "VERTICAL_DIMENSION";
                break;
            case 4:
                str = "LEFT";
                break;
            case 5:
                str = "RIGHT";
                break;
            case 6:
                str = "TOP";
                break;
            case 7:
                str = "BOTTOM";
                break;
            case 8:
                str = "BASELINE";
                break;
            default:
                str = "null";
                break;
        }
        sb.append(str);
        sb.append("(");
        sb.append(this.j ? Integer.valueOf(this.g) : "unresolved");
        sb.append(") <t=");
        sb.append(this.l.size());
        sb.append(":d=");
        sb.append(this.k.size());
        sb.append(">");
        return sb.toString();
    }
}
