package o;

import android.os.Bundle;
import android.text.TextUtils;
import com.google.android.gms.common.internal.Preconditions;
import java.util.Iterator;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class Io0 {
    public final String a;
    public final String b;
    public final String c;
    public final long d;
    public final long e;
    public final Lo0 f;

    public Io0(Kr0 kr0, String str, String str2, String str3, long j, long j2, Bundle bundle) {
        Lo0 lo0;
        Preconditions.checkNotEmpty(str2);
        Preconditions.checkNotEmpty(str3);
        this.a = str2;
        this.b = str3;
        this.c = true == TextUtils.isEmpty(str) ? null : str;
        this.d = j;
        this.e = j2;
        if (j2 != 0 && j2 > j) {
            Nq0 nq0 = kr0.f;
            Kr0.l(nq0);
            nq0.i.c(Nq0.A(str2), "Event created with reverse previous/current timestamps. appId");
        }
        if (bundle == null || bundle.isEmpty()) {
            lo0 = new Lo0(new Bundle());
        } else {
            Bundle bundle2 = new Bundle(bundle);
            Iterator<String> it = bundle2.keySet().iterator();
            while (it.hasNext()) {
                String next = it.next();
                if (next == null) {
                    Nq0 nq02 = kr0.f;
                    Kr0.l(nq02);
                    nq02.f.b("Param name can't be null");
                    it.remove();
                } else {
                    C2574tv0 c2574tv0 = kr0.i;
                    Kr0.j(c2574tv0);
                    Object objZ = c2574tv0.z(bundle2.get(next), next);
                    if (objZ == null) {
                        Nq0 nq03 = kr0.f;
                        Kr0.l(nq03);
                        nq03.i.c(kr0.j.b(next), "Param value can't be null");
                        it.remove();
                    } else {
                        C2574tv0 c2574tv02 = kr0.i;
                        Kr0.j(c2574tv02);
                        c2574tv02.H(bundle2, next, objZ);
                    }
                }
            }
            lo0 = new Lo0(bundle2);
        }
        this.f = lo0;
    }

    public final Io0 a(Kr0 kr0, long j) {
        return new Io0(kr0, this.c, this.a, this.b, this.d, j, this.f);
    }

    public final String toString() {
        String string = this.f.toString();
        String str = this.a;
        int length = String.valueOf(str).length();
        String str2 = this.b;
        StringBuilder sb = new StringBuilder(length + 22 + String.valueOf(str2).length() + 10 + string.length() + 1);
        sb.append("Event{appId='");
        sb.append(str);
        sb.append("', name='");
        sb.append(str2);
        sb.append("', params=");
        sb.append(string);
        sb.append("}");
        return sb.toString();
    }

    public Io0(Kr0 kr0, String str, String str2, String str3, long j, long j2, Lo0 lo0) {
        Preconditions.checkNotEmpty(str2);
        Preconditions.checkNotEmpty(str3);
        Preconditions.checkNotNull(lo0);
        this.a = str2;
        this.b = str3;
        this.c = true == TextUtils.isEmpty(str) ? null : str;
        this.d = j;
        this.e = j2;
        if (j2 != 0 && j2 > j) {
            Nq0 nq0 = kr0.f;
            Kr0.l(nq0);
            nq0.i.d("Event created with reverse previous/current timestamps. appId, name", Nq0.A(str2), Nq0.A(str3));
        }
        this.f = lo0;
    }
}
