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

import android.os.RemoteException;
import android.view.View;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import java.lang.ref.WeakReference;
import java.util.HashMap;
import xyz.stream.download.config.InnerConstant;

/* JADX INFO: loaded from: classes2.dex */
public final class hn0 implements View.OnClickListener {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final i8.c f12196b;

    @Nullable
    @VisibleForTesting
    String zza;

    @Nullable
    @VisibleForTesting
    Long zzb;

    @Nullable
    @VisibleForTesting
    WeakReference zzc;

    @Nullable
    private as zzf;

    @Nullable
    private ys zzg;

    public hn0(kp0 kp0Var, i8.c cVar) {
        this.f12195a = kp0Var;
        this.f12196b = cVar;
    }

    public final void a(as asVar) {
        this.zzf = asVar;
        ys ysVar = this.zzg;
        kp0 kp0Var = this.f12195a;
        if (ysVar != null) {
            kp0Var.c("/unconfirmedClick", ysVar);
        }
        gn0 gn0Var = new gn0(this, asVar, 0);
        this.zzg = gn0Var;
        kp0Var.b("/unconfirmedClick", gn0Var);
    }

    public final void b() {
        View view;
        if (this.zzf == null || this.zzb == null) {
            return;
        }
        this.zza = null;
        this.zzb = null;
        WeakReference weakReference = this.zzc;
        if (weakReference != null && (view = (View) weakReference.get()) != null) {
            view.setClickable(false);
            view.setOnClickListener(null);
            this.zzc = null;
        }
        try {
            zr zrVar = (zr) this.zzf;
            zrVar.O0(2, zrVar.O());
        } catch (RemoteException e10) {
            q7.j.zzl("#007 Could not call remote method.", e10);
        }
    }

    @Override // android.view.View.OnClickListener
    public final void onClick(View view) {
        View view2;
        WeakReference weakReference = this.zzc;
        if (weakReference == null || weakReference.get() != view) {
            return;
        }
        if (this.zza != null && this.zzb != null) {
            HashMap map = new HashMap();
            map.put(InnerConstant.Db.f36069id, this.zza);
            ((i8.d) this.f12196b).getClass();
            map.put("time_interval", String.valueOf(System.currentTimeMillis() - this.zzb.longValue()));
            map.put("messageType", "onePointFiveClick");
            this.f12195a.d(map);
        }
        this.zza = null;
        this.zzb = null;
        WeakReference weakReference2 = this.zzc;
        if (weakReference2 == null || (view2 = (View) weakReference2.get()) == null) {
            return;
        }
        view2.setClickable(false);
        view2.setOnClickListener(null);
        this.zzc = null;
    }

    @Nullable
    public final as zzb() {
        return this.zzf;
    }
}
