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

import android.content.Context;
import android.graphics.Point;
import android.net.Uri;
import android.text.TextUtils;
import androidx.media3.common.MimeTypes;
import com.google.android.gms.ads.internal.util.client.zzt;
import java.security.GeneralSecurityException;
import java.security.InvalidAlgorithmParameterException;
import java.util.ArrayDeque;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Executor;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import org.json.JSONException;
import org.json.JSONObject;
import xyz.stream.download.config.InnerConstant;

/* JADX INFO: loaded from: classes2.dex */
public final class eb implements zu1, h30, hl, or2 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f10740a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public Object f10741b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public Object f10742c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public Object f10743d;

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

    public /* synthetic */ eb(int i10, int i11) {
        this.f10740a = i10;
        if (i10 == 16) {
            this.f10742c = null;
            this.f10741b = null;
            this.f10743d = null;
            this.f10744e = zw1.f19411d;
            return;
        }
        if (i10 == 17) {
            this.f10742c = null;
            this.f10741b = null;
            this.f10743d = null;
            this.f10744e = ex1.f10946d;
            return;
        }
        if (i10 == 20) {
            this.f10742c = null;
            this.f10741b = null;
            this.f10743d = null;
            this.f10744e = e22.f10605e;
            return;
        }
        if (i10 != 21) {
            this.f10742c = null;
            this.f10741b = null;
            this.f10743d = null;
            this.f10744e = null;
            return;
        }
        this.f10742c = null;
        this.f10741b = null;
        this.f10743d = null;
        this.f10744e = r62.f16009e;
    }

    /*  JADX ERROR: Failed to decode insn: 0x0019: IGET r6, r8
        java.util.ConcurrentModificationException
        	at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1095)
        	at java.base/java.util.ArrayList$Itr.next(ArrayList.java:1049)
        	at jadx.core.dex.nodes.ClassNode.searchField(ClassNode.java:545)
        	at jadx.core.dex.nodes.RootNode.resolveField(RootNode.java:652)
        	at jadx.core.dex.instructions.InsnDecoder.tryResolveFieldType(InsnDecoder.java:553)
        	at jadx.core.dex.instructions.InsnDecoder.decode(InsnDecoder.java:377)
        	at jadx.core.dex.instructions.InsnDecoder.lambda$process$0(InsnDecoder.java:51)
        	at jadx.plugins.input.dex.sections.DexCodeReader.visitInstructions(DexCodeReader.java:86)
        	at jadx.core.dex.instructions.InsnDecoder.process(InsnDecoder.java:46)
        	at jadx.core.dex.nodes.MethodNode.load(MethodNode.java:164)
        	at jadx.core.dex.nodes.ClassNode.load(ClassNode.java:462)
        	at jadx.core.ProcessClass.process(ProcessClass.java:77)
        	at jadx.core.ProcessClass.generateCode(ProcessClass.java:118)
        	at jadx.core.dex.nodes.ClassNode.generateClassCode(ClassNode.java:405)
        	at jadx.core.dex.nodes.ClassNode.decompile(ClassNode.java:393)
        	at jadx.core.dex.nodes.ClassNode.getCode(ClassNode.java:343)
        */
    public eb(com.google.android.gms.internal.ads.a80 r8) {
        /*
            r7 = this;
            r7.<init>()
            r0 = 5
            r7.f10740a = r0
            r7.f10741b = r7
            r7.f10742c = r8
            com.google.android.gms.internal.ads.w70 r0 = r8.Y
            com.google.android.gms.internal.ads.lv0 r4 = new com.google.android.gms.internal.ads.lv0
            r4.<init>(r0)
            r7.f10743d = r4
            com.google.android.gms.internal.ads.o70 r2 = r8.f8535h
            com.google.android.gms.internal.ads.t70 r3 = r8.X
            com.google.android.gms.internal.ads.og2 r5 = r8.Z
            com.google.android.gms.internal.ads.og2 r6 = r8.f8567x
            com.google.android.gms.internal.ads.oa0 r8 = new com.google.android.gms.internal.ads.oa0
            r1 = r8
            r1.<init>(r2, r3, r4, r5, r6)
            r7.f10744e = r8
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.internal.ads.eb.<init>(com.google.android.gms.internal.ads.a80):void");
    }

    /* JADX WARN: Removed duplicated region for block: B:29:0x0053  */
    /* JADX WARN: Removed duplicated region for block: B:32:0x005b  */
    /* JADX WARN: Removed duplicated region for block: B:33:0x0066  */
    @Override // com.google.android.gms.internal.ads.or2
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final List a(int i10, fl flVar, int[] iArr) {
        int i11;
        int i12;
        int i13;
        int i14;
        Point point;
        ts1 ts1Var = b.f9321f;
        Point point2 = (Point) this.f10744e;
        int i15 = ((int[]) this.f10743d)[i10];
        jr2 jr2Var = (jr2) this.f10742c;
        int i16 = point2 != null ? point2.x : jr2Var.f9247e;
        int i17 = point2 != null ? point2.y : jr2Var.f9248f;
        boolean z10 = jr2Var.f9250h;
        int i18 = -1;
        if (i16 == Integer.MAX_VALUE) {
            i11 = Integer.MAX_VALUE;
        } else if (i17 == Integer.MAX_VALUE) {
            i11 = Integer.MAX_VALUE;
        } else {
            int i19 = Integer.MAX_VALUE;
            for (int i20 = 0; i20 < flVar.f11273a; i20++) {
                zn2 zn2Var = flVar.f11276d[i20];
                int i21 = zn2Var.f19339l;
                if (i21 > 0 && (i12 = zn2Var.f19340m) > 0) {
                    if (z10) {
                        if ((i21 > i12) != (i16 > i17)) {
                            i14 = i17;
                            i13 = i16;
                        }
                        if (i21 * i13 < i12 * i14) {
                        }
                        int i22 = i21 * i12;
                        if (i21 < ((int) (point.x * 0.98f))) {
                        }
                    } else {
                        i13 = i17;
                        i14 = i16;
                        if (i21 * i13 < i12 * i14) {
                            String str = bb1.f9474a;
                            point = new Point(i14, ((r9 + i21) - 1) / i21);
                        } else {
                            String str2 = bb1.f9474a;
                            point = new Point(((r15 + i12) - 1) / i12, i13);
                        }
                        int i222 = i21 * i12;
                        if (i21 < ((int) (point.x * 0.98f)) && i12 >= ((int) (point.y * 0.98f)) && i222 < i19) {
                            i19 = i222;
                        }
                    }
                }
            }
            i11 = i19;
        }
        bs1 bs1Var = zzguf.f19771b;
        as1 as1Var = new as1(4);
        int i23 = 0;
        while (i23 < flVar.f11273a) {
            int iB = flVar.f11276d[i23].b();
            as1Var.a(new wr2(i10, flVar, i23, jr2Var, iArr[i23], (String) this.f10741b, i15, i11 == Integer.MAX_VALUE || (iB != i18 && iB <= i11)));
            i23++;
            i18 = -1;
        }
        return as1Var.g();
    }

    public final void b(q2 q2Var, x2.o0 o0Var) {
        int i10 = 0;
        while (true) {
            u3[] u3VarArr = (u3[]) this.f10743d;
            if (i10 >= u3VarArr.length) {
                return;
            }
            o0Var.d();
            o0Var.e();
            u3 u3VarE = q2Var.e(o0Var.f34560d, 3);
            zn2 zn2Var = (zn2) ((List) this.f10742c).get(i10);
            String str = zn2Var.zzo;
            boolean z10 = true;
            if (!MimeTypes.APPLICATION_CEA608.equals(str) && !MimeTypes.APPLICATION_CEA708.equals(str)) {
                z10 = false;
            }
            ih1.R0(z10, "Invalid closed caption MIME type provided: %s", str);
            String str2 = zn2Var.zza;
            if (str2 == null) {
                o0Var.e();
                str2 = o0Var.f34561e;
            }
            sm2 sm2Var = new sm2();
            sm2Var.zza(str2);
            sm2Var.zzl((String) this.f10741b);
            sm2Var.zzm(str);
            sm2Var.f16479b = zn2Var.f19329b;
            sm2Var.zze(zn2Var.zzd);
            sm2Var.f16501x = zn2Var.f19353z;
            sm2Var.zzp(zn2Var.f19336i);
            u3VarE.d(new zn2(sm2Var));
            u3VarArr[i10] = u3VarE;
            i10++;
        }
    }

    public final void c(vg1 vg1Var) {
        vg1Var.f17626a = this;
        ((ArrayDeque) this.f10743d).add(vg1Var);
        if (((vg1) this.f10744e) == null) {
            vg1 vg1Var2 = (vg1) ((ArrayDeque) this.f10743d).poll();
            this.f10744e = vg1Var2;
            if (vg1Var2 != null) {
                vg1Var2.executeOnExecutor((ThreadPoolExecutor) this.f10741b, new Object[0]);
            }
        }
    }

    @Override // com.google.android.gms.internal.ads.hl
    public final void d(kn knVar) {
        kl klVar = (kl) ((ln) knVar.f8617b).D().s();
        zzbgj$zza$zza zzbgj_zza_zza = (zzbgj$zza$zza) this.f10742c;
        klVar.c();
        ((ll) klVar.f8617b).C(zzbgj_zza_zza);
        knVar.c();
        ((ln) knVar.f8617b).I((ll) klVar.e());
        fn fnVar = (fn) ((ln) knVar.f8617b).B().s();
        String str = (String) this.f10741b;
        fnVar.c();
        ((gn) fnVar.f8617b).C(str);
        cm cmVar = (cm) this.f10743d;
        fnVar.c();
        ((gn) fnVar.f8617b).D(cmVar);
        knVar.c();
        ((ln) knVar.f8617b).H((gn) fnVar.e());
        String str2 = (String) this.f10744e;
        knVar.c();
        ((ln) knVar.f8617b).C(str2);
    }

    public final void e(b02 b02Var) throws GeneralSecurityException {
        n12 n12Var = new n12(b02Var.f9331a, b02Var.f9332b);
        Map map = (Map) this.f10742c;
        if (!map.containsKey(n12Var)) {
            map.put(n12Var, b02Var);
            return;
        }
        b02 b02Var2 = (b02) map.get(n12Var);
        if (!b02Var2.equals(b02Var) || !b02Var.equals(b02Var2)) {
            throw new GeneralSecurityException("Attempt to register non-equal serializer for already existing object of type: ".concat(n12Var.toString()));
        }
    }

    public final void f(int i10) throws InvalidAlgorithmParameterException {
        if (i10 != 16 && i10 != 24 && i10 != 32) {
            throw new InvalidAlgorithmParameterException(String.format("Invalid key size %d; only 16-byte, 24-byte and 32-byte AES keys are supported", Integer.valueOf(i10)));
        }
        this.f10742c = Integer.valueOf(i10);
    }

    public final void g(int i10) {
        if (i10 != 16 && i10 != 24 && i10 != 32) {
            throw new InvalidAlgorithmParameterException(String.format("Invalid key size %d; only 16-byte, 24-byte and 32-byte AES keys are supported", Integer.valueOf(i10)));
        }
        this.f10742c = Integer.valueOf(i10);
    }

    public final void h(int i10) {
        this.f10742c = Integer.valueOf(i10);
    }

    public final void i(zz1 zz1Var) throws GeneralSecurityException {
        m12 m12Var = new m12(zz1Var.f19427a, zz1Var.f19428b);
        Map map = (Map) this.f10741b;
        if (!map.containsKey(m12Var)) {
            map.put(m12Var, zz1Var);
            return;
        }
        zz1 zz1Var2 = (zz1) map.get(m12Var);
        if (!zz1Var2.equals(zz1Var) || !zz1Var.equals(zz1Var2)) {
            throw new GeneralSecurityException("Attempt to register non-equal parser for already existing object of type: ".concat(m12Var.toString()));
        }
    }

    public final void j(int i10) {
        ((dq1) this.f10744e).a(i10);
    }

    public final void k() {
        this.f10741b = 12;
    }

    public final void l(int i10) {
        if (i10 != 12 && i10 != 16) {
            throw new GeneralSecurityException(String.format("Invalid IV size in bytes %d; acceptable values have 12 or 16 bytes", Integer.valueOf(i10)));
        }
        this.f10741b = Integer.valueOf(i10);
    }

    public final void m(int i10) {
        this.f10741b = Integer.valueOf(i10);
    }

    public final void n(x02 x02Var) throws GeneralSecurityException {
        n12 n12Var = new n12(x02Var.f18282a, x02Var.f18283b);
        Map map = (Map) this.f10743d;
        if (!map.containsKey(n12Var)) {
            map.put(n12Var, x02Var);
            return;
        }
        x02 x02Var2 = (x02) map.get(n12Var);
        if (!x02Var2.equals(x02Var) || !x02Var.equals(x02Var2)) {
            throw new GeneralSecurityException("Attempt to register non-equal serializer for already existing object of type: ".concat(n12Var.toString()));
        }
    }

    public final void o() {
        this.f10743d = 16;
    }

    public final void p() {
        this.f10743d = 16;
    }

    public final void q(v02 v02Var) throws GeneralSecurityException {
        m12 m12Var = new m12(v02Var.f17465a, v02Var.f17466b);
        Map map = (Map) this.f10744e;
        if (!map.containsKey(m12Var)) {
            map.put(m12Var, v02Var);
            return;
        }
        v02 v02Var2 = (v02) map.get(m12Var);
        if (!v02Var2.equals(v02Var) || !v02Var.equals(v02Var2)) {
            throw new GeneralSecurityException("Attempt to register non-equal parser for already existing object of type: ".concat(m12Var.toString()));
        }
    }

    public final v10 r() {
        vj1.k(Context.class, (Context) this.f10742c);
        vj1.k(i8.c.class, (i8.c) this.f10741b);
        vj1.k(p7.n0.class, (p7.n0) this.f10743d);
        vj1.k(y10.class, (y10) this.f10744e);
        return new v10((Context) this.f10742c, (i8.c) this.f10741b, (p7.n0) this.f10743d, (y10) this.f10744e);
    }

    public final dc1 s() {
        ib1 ib1VarZzb = ((ee0) this.f10741b).zzb();
        n7.a4 a4Var = ib1VarZzb.f12452a;
        String str = ib1VarZzb.f12455d;
        n7.i4 i4Var = ib1VarZzb.f12458g;
        ac1 ac1Var = ((yb1) ((xb1) this.f10742c)).f18790b;
        return new dc1(a4Var, str, new vz(ac1Var.f8630a).a().f18265j, ac1Var.f8636g, i4Var);
    }

    public final ow1 t() throws GeneralSecurityException {
        i92 i92VarB;
        uw1 uw1Var = (uw1) this.f10742c;
        if (uw1Var == null) {
            throw new GeneralSecurityException("Cannot build without parameters");
        }
        jc1 jc1Var = (jc1) this.f10741b;
        if (jc1Var == null || ((jc1) this.f10743d) == null) {
            throw new GeneralSecurityException("Cannot build without key material");
        }
        if (uw1Var.f17404a != jc1Var.i()) {
            throw new GeneralSecurityException("AES key size mismatch");
        }
        if (uw1Var.f17405b != ((jc1) this.f10743d).i()) {
            throw new GeneralSecurityException("HMAC key size mismatch");
        }
        if (((uw1) this.f10742c).a() && ((Integer) this.f10744e) == null) {
            throw new GeneralSecurityException("Cannot create key without ID requirement with parameters with ID requirement");
        }
        if (!((uw1) this.f10742c).a() && ((Integer) this.f10744e) != null) {
            throw new GeneralSecurityException("Cannot create key with ID requirement with parameters without ID requirement");
        }
        tw1 tw1Var = ((uw1) this.f10742c).f17408e;
        if (tw1Var == tw1.f17013d) {
            i92VarB = u02.f17053a;
        } else if (tw1Var == tw1.f17012c) {
            i92VarB = u02.a(((Integer) this.f10744e).intValue());
        } else {
            if (tw1Var != tw1.f17011b) {
                throw new IllegalStateException("Unknown AesCtrHmacAeadParameters.Variant: ".concat(String.valueOf(((uw1) this.f10742c).f17408e)));
            }
            i92VarB = u02.b(((Integer) this.f10744e).intValue());
        }
        return new ow1((uw1) this.f10742c, (jc1) this.f10741b, (jc1) this.f10743d, i92VarB, (Integer) this.f10744e);
    }

    public final ax1 u() {
        Integer num = (Integer) this.f10742c;
        if (num == null) {
            throw new GeneralSecurityException("Key size is not set");
        }
        if (((Integer) this.f10741b) == null) {
            throw new GeneralSecurityException("IV size is not set");
        }
        if (((zw1) this.f10744e) == null) {
            throw new GeneralSecurityException("Variant is not set");
        }
        if (((Integer) this.f10743d) == null) {
            throw new GeneralSecurityException("Tag size is not set");
        }
        int iIntValue = num.intValue();
        int iIntValue2 = ((Integer) this.f10741b).intValue();
        ((Integer) this.f10743d).intValue();
        return new ax1(iIntValue, iIntValue2, (zw1) this.f10744e);
    }

    public final fx1 v() throws GeneralSecurityException {
        Integer num = (Integer) this.f10742c;
        if (num == null) {
            throw new GeneralSecurityException("Key size is not set");
        }
        if (((ex1) this.f10744e) == null) {
            throw new GeneralSecurityException("Variant is not set");
        }
        if (((Integer) this.f10741b) == null) {
            throw new GeneralSecurityException("IV size is not set");
        }
        if (((Integer) this.f10743d) == null) {
            throw new GeneralSecurityException("Tag size is not set");
        }
        int iIntValue = num.intValue();
        ((Integer) this.f10741b).intValue();
        ((Integer) this.f10743d).intValue();
        return new fx1(iIntValue, (ex1) this.f10744e);
    }

    public final f22 w() {
        Integer num = (Integer) this.f10742c;
        if (num == null) {
            throw new GeneralSecurityException("key size is not set");
        }
        if (((Integer) this.f10741b) == null) {
            throw new GeneralSecurityException("tag size is not set");
        }
        if (((d22) this.f10743d) == null) {
            throw new GeneralSecurityException("hash type is not set");
        }
        if (((e22) this.f10744e) == null) {
            throw new GeneralSecurityException("variant is not set");
        }
        if (num.intValue() < 16) {
            throw new InvalidAlgorithmParameterException(String.format("Invalid key size in bytes %d; must be at least 16 bytes", (Integer) this.f10742c));
        }
        int iIntValue = ((Integer) this.f10741b).intValue();
        d22 d22Var = (d22) this.f10743d;
        if (iIntValue < 10) {
            throw new GeneralSecurityException(String.format("Invalid tag size in bytes %d; must be at least 10 bytes", Integer.valueOf(iIntValue)));
        }
        if (d22Var == d22.f10161b) {
            if (iIntValue > 20) {
                throw new GeneralSecurityException(String.format("Invalid tag size in bytes %d; can be at most 20 bytes for SHA1", Integer.valueOf(iIntValue)));
            }
        } else if (d22Var == d22.f10162c) {
            if (iIntValue > 28) {
                throw new GeneralSecurityException(String.format("Invalid tag size in bytes %d; can be at most 28 bytes for SHA224", Integer.valueOf(iIntValue)));
            }
        } else if (d22Var == d22.f10163d) {
            if (iIntValue > 32) {
                throw new GeneralSecurityException(String.format("Invalid tag size in bytes %d; can be at most 32 bytes for SHA256", Integer.valueOf(iIntValue)));
            }
        } else if (d22Var == d22.f10164e) {
            if (iIntValue > 48) {
                throw new GeneralSecurityException(String.format("Invalid tag size in bytes %d; can be at most 48 bytes for SHA384", Integer.valueOf(iIntValue)));
            }
        } else {
            if (d22Var != d22.f10165f) {
                throw new GeneralSecurityException("unknown hash type; must be SHA256, SHA384 or SHA512");
            }
            if (iIntValue > 64) {
                throw new GeneralSecurityException(String.format("Invalid tag size in bytes %d; can be at most 64 bytes for SHA512", Integer.valueOf(iIntValue)));
            }
        }
        return new f22(((Integer) this.f10742c).intValue(), ((Integer) this.f10741b).intValue(), (e22) this.f10744e, (d22) this.f10743d);
    }

    public final s62 x() throws GeneralSecurityException {
        q62 q62Var = (q62) this.f10742c;
        if (q62Var == null) {
            throw new GeneralSecurityException("signature encoding is not set");
        }
        o62 o62Var = (o62) this.f10741b;
        if (o62Var == null) {
            throw new GeneralSecurityException("EC curve type is not set");
        }
        p62 p62Var = (p62) this.f10743d;
        if (p62Var == null) {
            throw new GeneralSecurityException("hash type is not set");
        }
        r62 r62Var = (r62) this.f10744e;
        if (r62Var == null) {
            throw new GeneralSecurityException("variant is not set");
        }
        if (o62Var == o62.f14878c && p62Var != p62.f15279b) {
            throw new GeneralSecurityException("NIST_P256 requires SHA256");
        }
        o62 o62Var2 = o62.f14879d;
        p62 p62Var2 = p62.f15281d;
        if (o62Var == o62Var2 && p62Var != p62.f15280c && p62Var != p62Var2) {
            throw new GeneralSecurityException("NIST_P384 requires SHA384 or SHA512");
        }
        if (o62Var != o62.f14880e || p62Var == p62Var2) {
            return new s62(q62Var, o62Var, p62Var, r62Var);
        }
        throw new GeneralSecurityException("NIST_P521 requires SHA512");
    }

    @Override // com.google.android.gms.internal.ads.h30
    public final void zza(Object obj) {
        ev evVar = (ev) obj;
        p7.l0.g("callJs > getEngine: Promise fulfilled");
        Object obj2 = this.f10741b;
        e30 e30Var = (e30) this.f10743d;
        lv lvVar = (lv) this.f10744e;
        zu zuVar = (zu) this.f10742c;
        lvVar.getClass();
        try {
            p7.r0 r0Var = m7.n.C.f30464c;
            String string = UUID.randomUUID().toString();
            xs.f18544j.b(string, new kv(zuVar, lvVar, e30Var));
            JSONObject jSONObject = new JSONObject();
            jSONObject.put(InnerConstant.Db.f36069id, string);
            jSONObject.put("args", lvVar.f13874b.zzb(obj2));
            String str = lvVar.f13876d;
            pu puVar = (pu) evVar;
            puVar.getClass();
            puVar.a(str, jSONObject.toString());
        } catch (Exception e10) {
            try {
                e30Var.a(e10);
            } finally {
                zuVar.p();
            }
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:36:0x009e  */
    @Override // com.google.android.gms.internal.ads.zu1
    /* JADX INFO: renamed from: zzb */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void mo3zzb(Object obj) {
        md1 md1Var;
        y90 y90Var;
        byte b10;
        int i10;
        boolean z10 = false;
        int i11 = 2;
        switch (this.f10740a) {
            case 1:
                String str = (String) obj;
                if (((Boolean) n7.y.f31093e.f31096c.b(ao.f8988nb)).booleanValue()) {
                    ((Map) this.f10742c).put("u", str);
                }
                ((ft) this.f10744e).d(str, (n7.a) this.f10743d, (Map) this.f10742c, (String) this.f10741b);
                return;
            case 4:
                ((c60) this.f10744e).m((Map) obj, (List) this.f10742c, (String) this.f10741b);
                return;
            case 6:
                ((iu1) ((y90) this.f10744e).f18762e).e(new m1((re1) this.f10742c, (String) obj, (q7.n) this.f10743d, 5));
                return;
            case 7:
                x50 x50Var = (x50) obj;
                wa1 wa1Var = (wa1) this.f10742c;
                x50Var.Q(wa1Var, (za1) this.f10741b);
                c60 c60VarZzP = x50Var.zzP();
                tn tnVar = ao.f9039qb;
                n7.y yVar = n7.y.f31093e;
                if (((Boolean) yVar.f31096c.b(tnVar)).booleanValue() && c60VarZzP != null) {
                    y90 y90Var2 = (y90) this.f10743d;
                    kp0 kp0Var = (kp0) this.f10744e;
                    c60VarZzP.zzd(y90Var2, kp0Var.f13362i, kp0Var.f13363j);
                    c60VarZzP.zze(y90Var2, kp0Var.f13362i, kp0Var.f13357d);
                }
                if (!((Boolean) yVar.f31096c.b(ao.f8974me)).booleanValue() || c60VarZzP == null) {
                    return;
                }
                y10 y10Var = m7.n.C.f30486y;
                x50 x50Var2 = c60VarZzP.f9746a;
                if (y10Var.a(x50Var2.getContext())) {
                    c60VarZzP.e("/logScionEvent");
                    new HashMap();
                    c60VarZzP.d("/logScionEvent", new gn0(x50Var2.getContext(), wa1Var.f18004q0, i11));
                    return;
                }
                return;
            case 10:
                x81 x81Var = (x81) this.f10744e;
                eb0 eb0Var = (eb0) obj;
                synchronized (x81Var) {
                    if (eb0Var != null) {
                        try {
                            eb0Var.b();
                        } finally {
                        }
                    }
                    if (x81Var.f18365k) {
                        x81Var.a();
                    }
                    if (!((Boolean) ip.f12589c.j()).booleanValue() || (md1Var = (md1) this.f10742c) == null) {
                        nd1 nd1Var = x81Var.f18362h;
                        id1 id1Var = (id1) this.f10741b;
                        id1Var.e(eb0Var.f14056a.f10746b);
                        id1Var.zzi(eb0Var.f14060e.f15040a);
                        id1Var.a(true);
                        nd1Var.zzb(id1Var.zzm());
                    } else {
                        md1Var.e(eb0Var.f14056a.f10746b);
                        md1Var.g(eb0Var.f14060e.f15040a);
                        id1 id1Var2 = (id1) this.f10741b;
                        id1Var2.a(true);
                        md1Var.a(id1Var2);
                        md1Var.h();
                    }
                    break;
                }
                return;
            case 12:
                String str2 = (String) obj;
                x50 x50Var3 = (x50) this.f10742c;
                wa1 wa1VarZzC = x50Var3.zzC();
                if (wa1VarZzC != null && !wa1VarZzC.f17978d0) {
                    q7.n nVar = wa1VarZzC.zzax;
                    if (((Boolean) n7.y.f31093e.f31096c.b(ao.f8971mb)).booleanValue() && (y90Var = (y90) this.f10741b) != null && y90.b(str2)) {
                        y90Var.zza(str2, (re1) this.f10743d, n7.x.f31085g.f31090e, nVar);
                        return;
                    } else {
                        ((re1) this.f10743d).zzb(str2, nVar, null, null);
                        return;
                    }
                }
                za1 za1VarZzaC = x50Var3.zzaC();
                if (za1VarZzaC == null) {
                    m7.n.C.f30469h.d("BufferingGmsgHandlers.getBufferingClickGmsgHandler", new IllegalArgumentException("Common configuration cannot be null"));
                    return;
                }
                m7.n nVar2 = m7.n.C;
                nVar2.f30472k.getClass();
                long jCurrentTimeMillis = System.currentTimeMillis();
                boolean zI = nVar2.f30469h.i(x50Var3.getContext());
                boolean z11 = ((Boolean) n7.y.f31093e.f31096c.b(ao.Y6)).booleanValue() && wa1VarZzC != null && wa1VarZzC.P;
                if (wa1VarZzC != null && wa1VarZzC.zzad != null) {
                    z10 = true;
                }
                ((dw0) this.f10744e).k(new vc(jCurrentTimeMillis, za1VarZzaC.f19181b, str2, (zI || z11 || z10) ? 2 : 1));
                return;
            default:
                id1 id1Var3 = (id1) this.f10742c;
                zzt zztVar = (zzt) obj;
                if (id1Var3 != null) {
                    id1Var3.a(zztVar == zzt.f7959a);
                    md1 md1Var2 = (md1) this.f10741b;
                    if (md1Var2 == null) {
                        ((re1) this.f10744e).f16114f.zzb(id1Var3.zzm());
                    } else {
                        md1Var2.a(id1Var3);
                        md1Var2.h();
                    }
                }
                rg0 rg0Var = (rg0) this.f10743d;
                if (rg0Var != null) {
                    String strZzb = ((re1) this.f10744e).f16112d.zzb();
                    if (TextUtils.isEmpty(strZzb)) {
                        return;
                    }
                    try {
                        JSONObject jSONObject = new JSONObject(strZzb);
                        String strOptString = jSONObject.optString("type");
                        String strOptString2 = jSONObject.optString("precision");
                        String strOptString3 = jSONObject.optString("currency");
                        long jOptLong = jSONObject.optLong("value", 0L);
                        int iHashCode = strOptString.hashCode();
                        if (iHashCode != 66934) {
                            if (iHashCode != 66944) {
                                b10 = (iHashCode == 1349395245 && strOptString.equals("ONE_PIXEL")) ? (byte) 2 : (byte) -1;
                            } else if (strOptString.equals("CPM")) {
                                b10 = 0;
                            }
                        } else if (strOptString.equals("CPC")) {
                            b10 = 1;
                        }
                        if (b10 == 0) {
                            i10 = 1;
                        } else if (b10 == 1) {
                            i10 = 2;
                        } else if (b10 != 2) {
                            i10 = 0;
                        } else {
                            jOptLong /= 1000;
                            i10 = 3;
                        }
                        long j10 = jOptLong;
                        strOptString2.getClass();
                        switch (strOptString2) {
                            case "ESTIMATED":
                                i11 = 1;
                                break;
                            case "PRECISE":
                                i11 = 3;
                                break;
                            case "PUBLISHER_PROVIDED":
                                break;
                            default:
                                i11 = 0;
                                break;
                        }
                        n7.g4 g4Var = new n7.g4(i10, j10, i11, strOptString3);
                        if (com.google.android.gms.ads.nonagon.signalgeneration.b.b((ib1) rg0Var.f16133d.f10745a.f10402b) != 1 && rg0Var.f16131b.f18010t0) {
                            rg0Var.H0(new qg0(g4Var, 0));
                            return;
                        }
                        return;
                    } catch (JSONException e10) {
                        m7.n.C.f30469h.d("UrlPinger.pingUrl", e10);
                        return;
                    }
                }
                return;
        }
    }

    public /* synthetic */ eb(int i10, Object obj) {
        this.f10740a = i10;
    }

    public eb(Context context, q7.a aVar, il ilVar, pv0 pv0Var) {
        this.f10740a = 9;
        this.f10741b = context;
        this.f10744e = aVar;
        this.f10742c = ilVar;
        this.f10743d = pv0Var;
    }

    public eb(xb1 xb1Var, ee0 ee0Var, Executor executor) {
        this.f10740a = 11;
        this.f10742c = xb1Var;
        this.f10741b = ee0Var;
        this.f10743d = executor;
    }

    public eb(zzies zziesVar, zzies zziesVar2, aj1 aj1Var) {
        this.f10740a = 22;
        this.f10742c = zziesVar;
        this.f10741b = "";
        this.f10743d = zziesVar2;
        this.f10744e = aj1Var;
    }

    public /* synthetic */ eb(Object obj, Object obj2, Object obj3, Object obj4, int i10) {
        this.f10740a = i10;
        this.f10742c = obj;
        this.f10741b = obj2;
        this.f10743d = obj3;
        this.f10744e = obj4;
    }

    public eb(int i10) {
        this.f10740a = i10;
        if (i10 != 19) {
            this.f10743d = new ArrayDeque();
            this.f10744e = null;
            this.f10742c = new LinkedBlockingQueue();
            this.f10741b = new ThreadPoolExecutor(1, 1, 1L, TimeUnit.SECONDS, (BlockingQueue) this.f10742c);
            return;
        }
        this.f10742c = new HashMap();
        this.f10741b = new HashMap();
        this.f10743d = new HashMap();
        this.f10744e = new HashMap();
    }

    @Override // com.google.android.gms.internal.ads.zu1
    public final void zza(Throwable th) {
        md1 md1Var;
        int i10;
        switch (this.f10740a) {
            case 1:
                m7.n.C.f30469h.d("OpenGmsgHandler.attributionReportingManager", th);
                return;
            case 4:
                q7.j.d("Failed to parse gmsg params for: ".concat(String.valueOf((Uri) this.f10743d)));
                return;
            case 6:
                ((iu1) ((y90) this.f10744e).f18762e).e(new v40(this, th, (re1) this.f10742c, (String) this.f10741b, (q7.n) this.f10743d));
                return;
            case 7:
                return;
            case 10:
                if (((Boolean) n7.y.f31093e.f31096c.b(ao.B6)).booleanValue()) {
                    p7.l0.h();
                }
                x81 x81Var = (x81) this.f10744e;
                synchronized (x81Var) {
                    try {
                        xb0 xb0Var = (xb0) this.f10743d;
                        n7.l2 l2VarZzb = sb1.zzb(th, ((dd0) ((g80) xb0Var).D0.zzb()).f10385k);
                        x81Var.c(l2VarZzb);
                        ((we0) ((g80) xb0Var).f11593p0.zzb()).q(l2VarZzb);
                        ni.h(l2VarZzb.f30997a, "BannerAdLoader.onFailure", th);
                        if (x81Var.f18365k) {
                            x81Var.d();
                            bh0 bh0Var = x81Var.f18361g;
                            si0 si0Var = x81Var.f18363i;
                            synchronized (si0Var) {
                                i10 = si0Var.f16452a;
                            }
                            bh0Var.J0(i10);
                        }
                        if (((Boolean) ip.f12589c.j()).booleanValue() && (md1Var = (md1) this.f10742c) != null) {
                            md1Var.f(l2VarZzb);
                            id1 id1Var = (id1) this.f10741b;
                            id1Var.b(th);
                            id1Var.a(false);
                            md1Var.a(id1Var);
                            md1Var.h();
                        } else {
                            nd1 nd1Var = x81Var.f18362h;
                            id1 id1Var2 = (id1) this.f10741b;
                            id1Var2.g(l2VarZzb);
                            id1Var2.b(th);
                            id1Var2.a(false);
                            nd1Var.zzb(id1Var2.zzm());
                        }
                    } catch (Throwable th2) {
                        throw th2;
                    }
                }
                return;
            case 12:
                return;
            default:
                id1 id1Var3 = (id1) this.f10742c;
                if (id1Var3 == null) {
                    return;
                }
                id1Var3.a(false);
                md1 md1Var2 = (md1) this.f10741b;
                if (md1Var2 == null) {
                    ((re1) this.f10744e).f16114f.zzb(id1Var3.zzm());
                    return;
                } else {
                    md1Var2.a(id1Var3);
                    md1Var2.h();
                    return;
                }
        }
    }

    public eb(ft ftVar, Map map, n7.a aVar, String str) {
        this.f10740a = 1;
        this.f10742c = map;
        this.f10743d = aVar;
        this.f10741b = str;
        Objects.requireNonNull(ftVar);
        this.f10744e = ftVar;
    }

    public eb(lv lvVar, zu zuVar, Object obj, e30 e30Var) {
        this.f10740a = 2;
        this.f10742c = zuVar;
        this.f10741b = obj;
        this.f10743d = e30Var;
        Objects.requireNonNull(lvVar);
        this.f10744e = lvVar;
    }

    public eb(c60 c60Var, List list, String str, Uri uri) {
        this.f10740a = 4;
        this.f10742c = list;
        this.f10741b = str;
        this.f10743d = uri;
        Objects.requireNonNull(c60Var);
        this.f10744e = c60Var;
    }

    public eb(y90 y90Var, re1 re1Var, String str, q7.n nVar) {
        this.f10740a = 6;
        this.f10742c = re1Var;
        this.f10741b = str;
        this.f10743d = nVar;
        Objects.requireNonNull(y90Var);
        this.f10744e = y90Var;
    }

    public eb(kp0 kp0Var, wa1 wa1Var, za1 za1Var, y90 y90Var) {
        this.f10740a = 7;
        this.f10742c = wa1Var;
        this.f10741b = za1Var;
        this.f10743d = y90Var;
        this.f10744e = kp0Var;
    }

    public eb(x81 x81Var, md1 md1Var, id1 id1Var, g80 g80Var) {
        this.f10740a = 10;
        this.f10742c = md1Var;
        this.f10741b = id1Var;
        this.f10743d = g80Var;
        Objects.requireNonNull(x81Var);
        this.f10744e = x81Var;
    }

    public eb(re1 re1Var, id1 id1Var, md1 md1Var, rg0 rg0Var) {
        this.f10740a = 13;
        this.f10742c = id1Var;
        this.f10741b = md1Var;
        this.f10743d = rg0Var;
        Objects.requireNonNull(re1Var);
        this.f10744e = re1Var;
    }

    public eb(List list) {
        this.f10740a = 0;
        this.f10742c = list;
        this.f10741b = MimeTypes.VIDEO_MP2T;
        this.f10743d = new u3[list.size()];
        this.f10744e = new dq1(new ru(this, 9));
    }

    public eb(o12 o12Var) {
        this.f10740a = 19;
        this.f10742c = new HashMap(o12Var.f14805a);
        this.f10741b = new HashMap(o12Var.f14806b);
        this.f10743d = new HashMap(o12Var.f14807c);
        this.f10744e = new HashMap(o12Var.f14808d);
    }
}
