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

import android.content.Context;
import android.os.Binder;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.regex.Pattern;

/* JADX INFO: loaded from: classes2.dex */
public final class ut0 implements mu0 {

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public static final Pattern f17383h = Pattern.compile("Received error HTTP response code: (.*)");

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

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

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

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

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

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

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

    public ut0(Context context, ib1 ib1Var, kt0 kt0Var, a30 a30Var, ScheduledExecutorService scheduledExecutorService, sv0 sv0Var, md1 md1Var) {
        this.f17390g = context;
        this.f17386c = ib1Var;
        this.f17384a = kt0Var;
        this.f17385b = a30Var;
        this.f17387d = scheduledExecutorService;
        this.f17388e = sv0Var;
        this.f17389f = md1Var;
    }

    @Override // com.google.android.gms.internal.ads.mu0
    public final com.google.common.util.concurrent.w a(tz tzVar) {
        com.google.common.util.concurrent.w wVarW0;
        kt0 kt0Var = this.f17384a;
        kt0Var.getClass();
        String str = tzVar.f17034d;
        p7.r0 r0Var = m7.n.C.f30464c;
        boolean zC = p7.r0.c(str);
        int i10 = 5;
        dv1 dv1Var = kt0Var.f13403b;
        if (zC) {
            wVarW0 = ih1.q0(new zzeff(1));
        } else {
            wVarW0 = ih1.W0(((iu1) kt0Var.f13402a).g(new hg(kt0Var, tzVar, i10)), ExecutionException.class, ht0.f12257a, dv1Var);
        }
        tt1 tt1VarW0 = ih1.W0(wVarW0, zzeff.class, new it0(kt0Var, tzVar, Binder.getCallingUid(), 0), dv1Var);
        id1 id1VarD = id1.d(this.f17390g, 11);
        ni.u(tt1VarW0, id1VarD);
        com.google.common.util.concurrent.w wVarE1 = ih1.e1(tt1VarW0, new wt(this, 5), this.f17385b);
        if (((Boolean) n7.y.f31093e.f31096c.b(ao.f9067s6)).booleanValue()) {
            wVarE1 = ih1.W0(ih1.Z0(wVarE1, ((Integer) r2.f31096c.b(ao.f9083t6)).intValue(), TimeUnit.SECONDS, this.f17387d), TimeoutException.class, tt0.f17002a, b30.f9365g);
        }
        ni.L(wVarE1, this.f17389f, id1VarD, false);
        ih1.z1(wVarE1, new dh0(this), b30.f9365g);
        return wVarE1;
    }
}
