package com.google.android.gms.internal.p002firebaseauthapi; import android.text.TextUtils; import android.util.Log; import com.google.android.gms.ads.RequestConfiguration; import com.google.android.gms.common.internal.Preconditions; import java.text.ParseException; import java.util.ArrayList; import java.util.List; import org.json.JSONArray; import org.json.JSONObject; /* loaded from: classes.dex */ public final class zzady { private final String zza; private final String zzb; private final String zzc; private final long zzd; private final zzaet zze; private String zzf; public zzady(String str, String str2, String str3, long j10, zzaet zzaetVar) { if (!TextUtils.isEmpty(str) && zzaetVar != null) { Log.e("MfaInfo", "Cannot have both MFA phone_info and totp_info"); throw new IllegalArgumentException("Cannot have both MFA phone_info and totp_info"); } this.zza = str; this.zzb = Preconditions.checkNotEmpty(str2); this.zzc = str3; this.zzd = j10; this.zze = zzaetVar; } public static zzady zzb(JSONObject jSONObject) { zzady zzadyVar = new zzady(jSONObject.optString("phoneInfo", null), jSONObject.optString("mfaEnrollmentId", null), jSONObject.optString("displayName", null), zzh(jSONObject.optString("enrolledAt", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED)), jSONObject.opt("totpInfo") != null ? new zzaet() : null); zzadyVar.zzf = jSONObject.optString("unobfuscatedPhoneInfo"); return zzadyVar; } public static List zzg(JSONArray jSONArray) { if (jSONArray == null || jSONArray.length() == 0) { return new ArrayList(); } ArrayList arrayList = new ArrayList(); for (int i10 = 0; i10 < jSONArray.length(); i10++) { arrayList.add(zzb(jSONArray.getJSONObject(i10))); } return arrayList; } private static long zzh(String str) { try { zzajm zzb = zzakh.zzb(str); zzakh.zza(zzb); return zzb.zzb(); } catch (ParseException e10) { Log.w("MfaInfo", "Could not parse timestamp as ISOString. Invalid ISOString \"" + str + "\"", e10); return 0L; } } public final long zza() { return this.zzd; } public final zzaet zzc() { return this.zze; } public final String zzd() { return this.zzc; } public final String zze() { return this.zzb; } public final String zzf() { return this.zza; } }