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

import android.os.Handler;
import android.webkit.WebView;
import androidx.media3.exoplayer.ExoPlayer;
import java.util.Collections;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import org.json.JSONObject;

/* JADX INFO: loaded from: classes2.dex */
public final class pg1 extends lg1 {

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public WebView f15411e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public Long f15412f;

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

    public pg1(String str, Map map) {
        super(str);
        this.f15412f = null;
        this.f15413g = map;
    }

    @Override // com.google.android.gms.internal.ads.lg1
    public final void a() {
        WebView webView = new WebView(hg1.f12153b.f12154a);
        this.f15411e = webView;
        webView.getSettings().setJavaScriptEnabled(true);
        this.f15411e.getSettings().setAllowContentAccess(false);
        this.f15411e.getSettings().setAllowFileAccess(false);
        this.f15411e.setWebViewClient(new ng1(this));
        this.f13684b = new yg1(this.f15411e);
        w80.o(this.f15411e, null);
        Map map = this.f15413g;
        Iterator it = map.keySet().iterator();
        if (it.hasNext()) {
            com.google.android.gms.measurement.internal.u1.x(map.get((String) it.next()));
            throw null;
        }
        this.f15412f = Long.valueOf(System.nanoTime());
    }

    @Override // com.google.android.gms.internal.ads.lg1
    public final void b() {
        super.b();
        new Handler().postDelayed(new nw0(this), Math.max(4000 - (this.f15412f == null ? 4000L : TimeUnit.MILLISECONDS.convert(System.nanoTime() - this.f15412f.longValue(), TimeUnit.NANOSECONDS)), ExoPlayer.DEFAULT_DETACH_SURFACE_TIMEOUT_MS));
        this.f15411e = null;
    }

    @Override // com.google.android.gms.internal.ads.lg1
    public final void d(uf1 uf1Var, tf1 tf1Var) {
        JSONObject jSONObject = new JSONObject();
        Map mapUnmodifiableMap = Collections.unmodifiableMap(tf1Var.f16873d);
        Iterator it = mapUnmodifiableMap.keySet().iterator();
        if (it.hasNext()) {
            com.google.android.gms.measurement.internal.u1.x(mapUnmodifiableMap.get((String) it.next()));
            throw null;
        }
        e(uf1Var, tf1Var, jSONObject);
    }
}
