package com.google.android.gms.measurement.internal; import android.os.Bundle; import com.google.android.gms.common.internal.Preconditions; import java.util.ArrayList; import java.util.concurrent.atomic.AtomicReference; /* loaded from: classes.dex */ public final class zzeo { protected static final AtomicReference zza = new AtomicReference(); protected static final AtomicReference zzb = new AtomicReference(); protected static final AtomicReference zzc = new AtomicReference(); private final zzen zzd; public zzeo(zzen zzenVar) { this.zzd = zzenVar; } private static final String zzg(String str, String[] strArr, String[] strArr2, AtomicReference atomicReference) { String str2; Preconditions.checkNotNull(strArr); Preconditions.checkNotNull(strArr2); Preconditions.checkNotNull(atomicReference); Preconditions.checkArgument(strArr.length == strArr2.length); for (int i10 = 0; i10 < strArr.length; i10++) { Object obj = strArr[i10]; if (str == obj || str.equals(obj)) { synchronized (atomicReference) { String[] strArr3 = (String[]) atomicReference.get(); if (strArr3 == null) { strArr3 = new String[strArr2.length]; atomicReference.set(strArr3); } str2 = strArr3[i10]; if (str2 == null) { str2 = strArr2[i10] + "(" + strArr[i10] + ")"; strArr3[i10] = str2; } } return str2; } } return str; } protected final String zza(Object[] objArr) { if (objArr == null) { return "[]"; } StringBuilder sb = new StringBuilder(); sb.append("["); for (Object obj : objArr) { String zzb2 = obj instanceof Bundle ? zzb((Bundle) obj) : String.valueOf(obj); if (zzb2 != null) { if (sb.length() != 1) { sb.append(", "); } sb.append(zzb2); } } sb.append("]"); return sb.toString(); } protected final String zzb(Bundle bundle) { if (bundle == null) { return null; } if (!this.zzd.zza()) { return bundle.toString(); } StringBuilder sb = new StringBuilder(); sb.append("Bundle[{"); for (String str : bundle.keySet()) { if (sb.length() != 8) { sb.append(", "); } sb.append(zze(str)); sb.append("="); Object obj = bundle.get(str); sb.append(obj instanceof Bundle ? zza(new Object[]{obj}) : obj instanceof Object[] ? zza((Object[]) obj) : obj instanceof ArrayList ? zza(((ArrayList) obj).toArray()) : String.valueOf(obj)); } sb.append("}]"); return sb.toString(); } protected final String zzc(zzau zzauVar) { if (!this.zzd.zza()) { return zzauVar.toString(); } StringBuilder sb = new StringBuilder(); sb.append("origin="); sb.append(zzauVar.zzc); sb.append(",name="); sb.append(zzd(zzauVar.zza)); sb.append(",params="); zzas zzasVar = zzauVar.zzb; sb.append(zzasVar == null ? null : !this.zzd.zza() ? zzasVar.toString() : zzb(zzasVar.zzc())); return sb.toString(); } protected final String zzd(String str) { if (str == null) { return null; } return !this.zzd.zza() ? str : zzg(str, zzhc.zzc, zzhc.zza, zza); } protected final String zze(String str) { if (str == null) { return null; } return !this.zzd.zza() ? str : zzg(str, zzhd.zzb, zzhd.zza, zzb); } protected final String zzf(String str) { if (str == null) { return null; } if (!this.zzd.zza()) { return str; } if (!str.startsWith("_exp_")) { return zzg(str, zzhe.zzb, zzhe.zza, zzc); } return "experiment_id(" + str + ")"; } }