package o; import android.graphics.DashPathEffect; import android.graphics.Paint; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import java.util.ArrayList; import java.util.List; /* loaded from: classes.dex */ public final class UFB extends ITM { public EHj[] i; public EHj[] h = new EHj[0]; /* renamed from: o, reason: collision with root package name */ public boolean f8385o = false; public Sts m = Sts.LEFT; public LWm D = LWm.BOTTOM; public IeS s = IeS.HORIZONTAL; public boolean c = false; public RVV d = RVV.LEFT_TO_RIGHT; public HBt u = HBt.SQUARE; public float f = 8.0f; public float j = 3.0f; public DashPathEffect g = null; public float B = 6.0f; public float C = BitmapDescriptorFactory.HUE_RED; public float l = 5.0f; public float y = 3.0f; public float k = 0.95f; public float p = BitmapDescriptorFactory.HUE_RED; public float n = BitmapDescriptorFactory.HUE_RED; public float z = BitmapDescriptorFactory.HUE_RED; private float A = BitmapDescriptorFactory.HUE_RED; private boolean G = false; public List e = new ArrayList(16); public List a = new ArrayList(16); public List b = new ArrayList(16); /* loaded from: classes.dex */ public enum HBt { NONE, EMPTY, DEFAULT, SQUARE, CIRCLE, LINE } /* loaded from: classes.dex */ public enum IeS { HORIZONTAL, VERTICAL } /* loaded from: classes.dex */ public enum LWm { TOP, CENTER, BOTTOM } /* loaded from: classes.dex */ public enum RVV { LEFT_TO_RIGHT, RIGHT_TO_LEFT } /* loaded from: classes.dex */ public enum Sts { LEFT, CENTER, RIGHT } public UFB() { this.t = AbstractC0810PWv.d(10.0f); this.x = AbstractC0810PWv.d(5.0f); this.w = AbstractC0810PWv.d(3.0f); } public final void Gu_(Paint paint, DRH drh) { float d = AbstractC0810PWv.d(this.f); float d2 = AbstractC0810PWv.d(this.y); float d3 = AbstractC0810PWv.d(this.l); float d4 = AbstractC0810PWv.d(this.B); float d5 = AbstractC0810PWv.d(BitmapDescriptorFactory.HUE_RED); EHj[] eHjArr = this.h; int length = eHjArr.length; float d6 = AbstractC0810PWv.d(this.l); float f = 0.0f; float f2 = 0.0f; for (EHj eHj : this.h) { float d7 = AbstractC0810PWv.d(Float.isNaN(eHj.e) ? this.f : eHj.e); if (d7 > f2) { f2 = d7; } String str = eHj.h; if (str != null) { float He_ = AbstractC0810PWv.He_(paint, str); if (He_ > f) { f = He_; } } } this.A = f + f2 + d6; EHj[] eHjArr2 = this.h; float f3 = BitmapDescriptorFactory.HUE_RED; for (EHj eHj2 : eHjArr2) { String str2 = eHj2.h; if (str2 != null) { float Hc_ = AbstractC0810PWv.Hc_(paint, str2); if (Hc_ > f3) { f3 = Hc_; } } } this.z = f3; int i = AnonymousClass3.a[this.s.ordinal()]; if (i == 1) { float Hg_ = AbstractC0810PWv.Hg_(paint); float f4 = 0.0f; float f5 = 0.0f; float f6 = 0.0f; boolean z = false; for (int i2 = 0; i2 < length; i2++) { EHj eHj3 = eHjArr[i2]; boolean z2 = eHj3.a != HBt.NONE; float d8 = Float.isNaN(eHj3.e) ? d : AbstractC0810PWv.d(eHj3.e); String str3 = eHj3.h; if (!z) { f5 = 0.0f; } if (z2) { if (z) { f5 += d2; } f5 += d8; } if (str3 != null) { if (z2 && !z) { f5 += d3; } else if (z) { f4 += Hg_ + d5; f6 = Math.max(f6, f5); z = false; f5 = 0.0f; } float He_2 = AbstractC0810PWv.He_(paint, str3); if (i2 < length - 1) { f4 += Hg_ + d5; } f5 += He_2; } else { f5 += d8; if (i2 < length - 1) { f5 += d2; } z = true; } f6 = Math.max(f6, f5); } this.p = f6; this.n = f4; } else if (i == 2) { float Hg_2 = AbstractC0810PWv.Hg_(paint); float Hi_ = AbstractC0810PWv.Hi_(paint); drh.b.width(); this.a.clear(); this.e.clear(); this.b.clear(); int i3 = -1; float f7 = BitmapDescriptorFactory.HUE_RED; int i4 = 0; float f8 = BitmapDescriptorFactory.HUE_RED; float f9 = BitmapDescriptorFactory.HUE_RED; while (i4 < length) { EHj eHj4 = eHjArr[i4]; float f10 = d; float f11 = d4; boolean z3 = eHj4.a != HBt.NONE; float d9 = Float.isNaN(eHj4.e) ? f10 : AbstractC0810PWv.d(eHj4.e); String str4 = eHj4.h; EHj[] eHjArr3 = eHjArr; float f12 = d5; this.a.add(Boolean.FALSE); float f13 = i3 == -1 ? BitmapDescriptorFactory.HUE_RED : f7 + d2; if (str4 != null) { this.e.add(AbstractC0810PWv.Hd_(paint, str4)); f7 = f13 + (z3 ? d3 + d9 : BitmapDescriptorFactory.HUE_RED) + this.e.get(i4).c; } else { float f14 = d9; this.e.add(RlR.c(BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED)); f7 = f13 + (!z3 ? BitmapDescriptorFactory.HUE_RED : f14); if (i3 == -1) { i3 = i4; } } if (str4 != null || i4 == length - 1) { float f15 = f9 + (f9 == BitmapDescriptorFactory.HUE_RED ? 0.0f : f11) + f7; if (i4 == length - 1) { this.b.add(RlR.c(f15, Hg_2)); f8 = Math.max(f8, f15); } f9 = f15; } if (str4 != null) { i3 = -1; } i4++; d = f10; d4 = f11; eHjArr = eHjArr3; d5 = f12; } float f16 = d5; this.p = f8; this.n = (Hg_2 * this.b.size()) + ((Hi_ + f16) * (this.b.size() == 0 ? 0 : this.b.size() - 1)); } this.n += this.w; this.p += this.x; } /* renamed from: o.UFB$3, reason: invalid class name */ /* loaded from: classes.dex */ static /* synthetic */ class AnonymousClass3 { static final int[] a; static { int[] iArr = new int[IeS.values().length]; a = iArr; try { iArr[IeS.VERTICAL.ordinal()] = 1; } catch (NoSuchFieldError unused) { } try { a[IeS.HORIZONTAL.ordinal()] = 2; } catch (NoSuchFieldError unused2) { } } } }