package w;

import java.util.ArrayList;

/* JADX INFO: renamed from: w.e, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public class C1687e implements InterfaceC1686d {

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final AbstractC1694l f18141d;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public int f18143f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public int f18144g;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public AbstractC1694l f18138a = null;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public boolean f18139b = false;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public boolean f18140c = false;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public int f18142e = 1;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public int f18145h = 1;
    public C1688f i = null;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public boolean f18146j = false;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final ArrayList f18147k = new ArrayList();

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public final ArrayList f18148l = new ArrayList();

    public C1687e(AbstractC1694l abstractC1694l) {
        this.f18141d = abstractC1694l;
    }

    @Override // w.InterfaceC1686d
    public final void a(InterfaceC1686d interfaceC1686d) {
        ArrayList arrayList = this.f18148l;
        int size = arrayList.size();
        int i = 0;
        int i5 = 0;
        while (i5 < size) {
            Object obj = arrayList.get(i5);
            i5++;
            if (!((C1687e) obj).f18146j) {
                return;
            }
        }
        this.f18140c = true;
        AbstractC1694l abstractC1694l = this.f18138a;
        if (abstractC1694l != null) {
            abstractC1694l.a(this);
        }
        if (this.f18139b) {
            this.f18141d.a(this);
            return;
        }
        int size2 = arrayList.size();
        C1687e c1687e = null;
        int i8 = 0;
        while (i8 < size2) {
            Object obj2 = arrayList.get(i8);
            i8++;
            C1687e c1687e2 = (C1687e) obj2;
            if (!(c1687e2 instanceof C1688f)) {
                i++;
                c1687e = c1687e2;
            }
        }
        if (c1687e != null && i == 1 && c1687e.f18146j) {
            C1688f c1688f = this.i;
            if (c1688f != null) {
                if (!c1688f.f18146j) {
                    return;
                } else {
                    this.f18143f = this.f18145h * c1688f.f18144g;
                }
            }
            d(c1687e.f18144g + this.f18143f);
        }
        AbstractC1694l abstractC1694l2 = this.f18138a;
        if (abstractC1694l2 != null) {
            abstractC1694l2.a(this);
        }
    }

    public final void b(AbstractC1694l abstractC1694l) {
        this.f18147k.add(abstractC1694l);
        if (this.f18146j) {
            abstractC1694l.a(abstractC1694l);
        }
    }

    public final void c() {
        this.f18148l.clear();
        this.f18147k.clear();
        this.f18146j = false;
        this.f18144g = 0;
        this.f18140c = false;
        this.f18139b = false;
    }

    public void d(int i) {
        if (this.f18146j) {
            return;
        }
        this.f18146j = true;
        this.f18144g = i;
        ArrayList arrayList = this.f18147k;
        int size = arrayList.size();
        int i5 = 0;
        while (i5 < size) {
            Object obj = arrayList.get(i5);
            i5++;
            InterfaceC1686d interfaceC1686d = (InterfaceC1686d) obj;
            interfaceC1686d.a(interfaceC1686d);
        }
    }

    public final String toString() {
        String str;
        StringBuilder sb = new StringBuilder();
        sb.append(this.f18141d.f18156b.f17894W);
        sb.append(":");
        switch (this.f18142e) {
            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 Z.g.STRING_SET_FIELD_NUMBER /* 6 */:
                str = "TOP";
                break;
            case Z.g.DOUBLE_FIELD_NUMBER /* 7 */:
                str = "BOTTOM";
                break;
            case Z.g.BYTES_FIELD_NUMBER /* 8 */:
                str = "BASELINE";
                break;
            default:
                str = "null";
                break;
        }
        sb.append(str);
        sb.append("(");
        sb.append(this.f18146j ? Integer.valueOf(this.f18144g) : "unresolved");
        sb.append(") <t=");
        sb.append(this.f18148l.size());
        sb.append(":d=");
        sb.append(this.f18147k.size());
        sb.append(">");
        return sb.toString();
    }
}
