package vg;

import java.util.Iterator;
import java.util.List;
import vg.q;

/* loaded from: classes4.dex */
public class h implements e {

    /* renamed from: a, reason: collision with root package name */
    public final List f39688a;

    /* renamed from: b, reason: collision with root package name */
    public final String f39689b;

    public h(List list, String str) {
        this.f39688a = list;
        this.f39689b = str;
    }

    private q b(c cVar, List list) {
        Iterator it = list.iterator();
        while (it.hasNext()) {
            e eVar = (e) it.next();
            if (eVar != null && !eVar.a(cVar).a()) {
                return new q(q.a.CONDITION_FAILED, "AND operation returned false.");
            }
        }
        return q.f39705d;
    }

    private q c(c cVar, List list) {
        Iterator it = list.iterator();
        while (it.hasNext()) {
            e eVar = (e) it.next();
            if (eVar != null && eVar.a(cVar).a()) {
                return q.f39705d;
            }
        }
        return new q(q.a.CONDITION_FAILED, "OR operation returned false.");
    }

    @Override // vg.e
    public q a(c cVar) {
        String str = this.f39689b;
        if (str == null || str.isEmpty()) {
            return new q(q.a.MISSING_OPERATOR, "Null or empty operator for logical expression");
        }
        String str2 = this.f39689b;
        str2.hashCode();
        return !str2.equals("or") ? !str2.equals("and") ? new q(q.a.MISSING_OPERATOR, String.format("Unknown conjunction operator - %s.", this.f39689b)) : b(cVar, this.f39688a) : c(cVar, this.f39688a);
    }
}
