package com.google.android.gms.internal.ads;

import android.os.Bundle;
import android.util.JsonReader;
import android.util.JsonToken;
import androidx.annotation.Nullable;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import org.json.JSONException;
import org.json.JSONObject;

/* JADX INFO: loaded from: classes2.dex */
public final class za1 {

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

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final int f19182c;

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

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final String f19184e;

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

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final long f19186g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final boolean f19187h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public final String f19188i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final Bundle f19189j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final String f19190k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public final String f19191l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public final String f19192m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public final JSONObject f19193n;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public final JSONObject f19194o;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    public final String f19195p;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final int f19196q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public final long f19197r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public final long f19198s;

    @Nullable
    public final ya1 zzj;

    /* JADX WARN: Unreachable blocks removed: 1, instructions: 1 */
    public za1(JsonReader jsonReader) throws JSONException, IOException {
        List listEmptyList = Collections.emptyList();
        Bundle bundle = new Bundle();
        JSONObject jSONObject = new JSONObject();
        JSONObject jSONObject2 = new JSONObject();
        jsonReader.beginObject();
        int iNextInt = 0;
        String strNextString = "";
        String strNextString2 = strNextString;
        String strNextString3 = strNextString2;
        String strNextString4 = strNextString3;
        String strNextString5 = strNextString4;
        String strNextString6 = strNextString5;
        String strNextString7 = strNextString6;
        boolean zNextBoolean = false;
        ya1 ya1Var = null;
        long jNextLong = 0;
        long j10 = -1;
        long j11 = -1;
        int iNextInt2 = -1;
        int iMax = 1;
        int iNextInt3 = 0;
        while (jsonReader.hasNext()) {
            String strNextName = jsonReader.nextName();
            if (Objects.equals(strNextName, "nofill_urls")) {
                listEmptyList = p7.y.a(jsonReader);
            } else if ("refresh_interval".equals(strNextName)) {
                iNextInt = jsonReader.nextInt();
            } else if (Objects.equals(strNextName, "refresh_load_delay_time_interval")) {
                iNextInt2 = jsonReader.nextInt();
            } else if ("gws_query_id".equals(strNextName)) {
                strNextString = jsonReader.nextString();
            } else if ("analytics_query_ad_event_id".equals(strNextName)) {
                strNextString2 = jsonReader.nextString();
            } else if ("is_idless".equals(strNextName)) {
                zNextBoolean = jsonReader.nextBoolean();
            } else if ("response_code".equals(strNextName)) {
                iNextInt3 = jsonReader.nextInt();
            } else if ("latency".equals(strNextName)) {
                jNextLong = jsonReader.nextLong();
            } else {
                tn tnVar = ao.f9070s9;
                n7.y yVar = n7.y.f31093e;
                if (((Boolean) yVar.f31096c.b(tnVar)).booleanValue() && "public_error".equals(strNextName) && jsonReader.peek() == JsonToken.BEGIN_OBJECT) {
                    ya1 ya1Var2 = new ya1();
                    jsonReader.beginObject();
                    String strNextString8 = "";
                    while (jsonReader.hasNext()) {
                        String strNextName2 = jsonReader.nextName();
                        strNextName2.getClass();
                        if (strNextName2.equals("code")) {
                            jsonReader.nextInt();
                        } else if (strNextName2.equals("description")) {
                            strNextString8 = jsonReader.nextString();
                        } else {
                            jsonReader.skipValue();
                        }
                    }
                    jsonReader.endObject();
                    ya1Var2.f18778a = strNextString8;
                    ya1Var = ya1Var2;
                } else if ("bidding_data".equals(strNextName)) {
                    strNextString3 = jsonReader.nextString();
                } else {
                    tn tnVar2 = ao.Fb;
                    yn ynVar = yVar.f31096c;
                    if (((Boolean) ynVar.b(tnVar2)).booleanValue() && Objects.equals(strNextName, "topics_should_record_observation")) {
                        jsonReader.nextBoolean();
                    } else if ("adapter_response_replacement_key".equals(strNextName)) {
                        strNextString7 = jsonReader.nextString();
                    } else if ("response_info_extras".equals(strNextName)) {
                        if (((Boolean) ynVar.b(ao.f9183z7)).booleanValue()) {
                            try {
                                try {
                                    Bundle bundleZzl = p7.y.zzl(p7.y.b(jsonReader));
                                    if (bundleZzl != null) {
                                        bundle = bundleZzl;
                                    }
                                } catch (IOException | JSONException unused) {
                                }
                            } catch (IllegalStateException unused2) {
                                jsonReader.skipValue();
                            }
                        } else {
                            jsonReader.skipValue();
                        }
                    } else if ("adRequestPostBody".equals(strNextName)) {
                        if (((Boolean) ynVar.b(ao.f9171ya)).booleanValue()) {
                            strNextString5 = jsonReader.nextString();
                        } else {
                            jsonReader.skipValue();
                        }
                    } else if (!"adRequestUrl".equals(strNextName)) {
                        tn tnVar3 = ao.f9186za;
                        if (((Boolean) ynVar.b(tnVar3)).booleanValue() && Objects.equals(strNextName, "adResponseBody")) {
                            strNextString6 = jsonReader.nextString();
                        } else if (((Boolean) ynVar.b(tnVar3)).booleanValue() && Objects.equals(strNextName, "adResponseHeaders")) {
                            jSONObject = p7.y.b(jsonReader);
                        } else if (Objects.equals(strNextName, "max_parallel_renderers")) {
                            iMax = Math.max(1, jsonReader.nextInt());
                        } else if (((Boolean) ynVar.b(ao.Ha)).booleanValue() && Objects.equals(strNextName, "inspector_ad_transaction_extras")) {
                            jSONObject2 = p7.y.b(jsonReader);
                        } else if (((Boolean) ynVar.b(ao.C2)).booleanValue() && Objects.equals(strNextName, "latency_extras")) {
                            try {
                                Bundle bundleZzl2 = p7.y.zzl(p7.y.b(jsonReader));
                                if (bundleZzl2 != null) {
                                    double d10 = bundleZzl2.getDouble("start_time");
                                    long j12 = (d10 > 9.223372036854776E18d || d10 < -9.223372036854776E18d) ? -1L : (long) d10;
                                    try {
                                        double d11 = bundleZzl2.getDouble("end_time");
                                        j10 = (d11 > 9.223372036854776E18d || d11 < -9.223372036854776E18d) ? -1L : (long) d11;
                                    } catch (IOException | JSONException unused3) {
                                    } catch (IllegalStateException unused4) {
                                        j11 = j12;
                                        jsonReader.skipValue();
                                    }
                                    j11 = j12;
                                }
                            } catch (IllegalStateException unused5) {
                            }
                        } else {
                            jsonReader.skipValue();
                        }
                    } else if (((Boolean) ynVar.b(ao.f9171ya)).booleanValue()) {
                        strNextString4 = jsonReader.nextString();
                    } else {
                        jsonReader.skipValue();
                    }
                }
            }
        }
        jsonReader.endObject();
        this.f19180a = listEmptyList;
        this.f19182c = iNextInt;
        if (((Boolean) up.f17363d.j()).booleanValue()) {
            this.f19183d = -1;
        } else {
            bp bpVar = ep.f10869a;
            if (((Long) bpVar.j()).longValue() > -1) {
                this.f19183d = ((Long) bpVar.j()).intValue();
            } else {
                this.f19183d = iNextInt2;
            }
        }
        this.f19181b = strNextString;
        this.f19184e = strNextString2;
        this.f19185f = iNextInt3;
        this.f19186g = jNextLong;
        this.zzj = ya1Var;
        this.f19187h = zNextBoolean;
        this.f19188i = strNextString3;
        this.f19189j = bundle;
        this.f19190k = strNextString4;
        this.f19191l = strNextString5;
        this.f19192m = strNextString6;
        this.f19193n = jSONObject;
        this.f19194o = jSONObject2;
        this.f19195p = strNextString7;
        bp bpVar2 = sp.f16523a;
        this.f19196q = ((Long) bpVar2.j()).longValue() > 0 ? ((Long) bpVar2.j()).intValue() : iMax;
        this.f19197r = j11;
        this.f19198s = j10;
    }
}
