package e.a.r;

/* JADX INFO: compiled from: Json.kt */
/* JADX INFO: loaded from: classes.dex */
@d.n
public final class d {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private boolean f2951a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private boolean f2952b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    private boolean f2953c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private boolean f2954d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    private boolean f2955e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    private boolean f2956f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    private String f2957g;
    private boolean h;
    private boolean i;
    private String j;
    private boolean k;
    private boolean l;
    private e.a.s.c m;

    public d(a aVar) {
        d.n0.c.s.e(aVar, "json");
        this.f2951a = aVar.d().e();
        this.f2952b = aVar.d().f();
        this.f2953c = aVar.d().g();
        this.f2954d = aVar.d().l();
        this.f2955e = aVar.d().b();
        this.f2956f = aVar.d().h();
        this.f2957g = aVar.d().i();
        this.h = aVar.d().d();
        this.i = aVar.d().k();
        this.j = aVar.d().c();
        this.k = aVar.d().a();
        this.l = aVar.d().j();
        this.m = aVar.e();
    }

    public final f a() {
        if (this.i && !d.n0.c.s.a(this.j, "type")) {
            throw new IllegalArgumentException("Class discriminator should not be specified when array polymorphism is specified".toString());
        }
        if (this.f2956f) {
            if (!d.n0.c.s.a(this.f2957g, "    ")) {
                String str = this.f2957g;
                boolean z = false;
                int i = 0;
                while (true) {
                    boolean z2 = true;
                    if (i >= str.length()) {
                        z = true;
                        break;
                    }
                    char cCharAt = str.charAt(i);
                    if (cCharAt != ' ' && cCharAt != '\t' && cCharAt != '\r' && cCharAt != '\n') {
                        z2 = false;
                    }
                    if (!z2) {
                        break;
                    }
                    i++;
                }
                if (!z) {
                    throw new IllegalArgumentException(("Only whitespace, tab, newline and carriage return are allowed as pretty print symbols. Had " + this.f2957g).toString());
                }
            }
        } else if (!d.n0.c.s.a(this.f2957g, "    ")) {
            throw new IllegalArgumentException("Indent should not be specified when default printing mode is used".toString());
        }
        return new f(this.f2951a, this.f2953c, this.f2954d, this.f2955e, this.f2956f, this.f2952b, this.f2957g, this.h, this.i, this.j, this.k, this.l);
    }

    public final e.a.s.c b() {
        return this.m;
    }

    public final void c(boolean z) {
        this.f2951a = z;
    }

    public final void d(boolean z) {
        this.f2953c = z;
    }
}
