package defpackage;

import android.graphics.Path;
import android.graphics.PathMeasure;
import android.graphics.PointF;
import java.util.ArrayList;

/* JADX INFO: loaded from: classes.dex */
public class d47 extends v35<PointF> {
    public final PointF i;
    public final float[] j;
    public final float[] k;
    public final PathMeasure l;
    public c47 m;

    public d47(ArrayList arrayList) {
        super(arrayList);
        this.i = new PointF();
        this.j = new float[2];
        this.k = new float[2];
        this.l = new PathMeasure();
    }

    @Override // defpackage.u70
    public final Object f(u35 u35Var, float f) {
        float f2;
        c47 c47Var = (c47) u35Var;
        Path path = c47Var.q;
        hl5 hl5Var = this.e;
        if (hl5Var == null || u35Var.h == null) {
            f2 = f;
        } else {
            f2 = f;
            PointF pointF = (PointF) hl5Var.b(c47Var.g, c47Var.h.floatValue(), (PointF) c47Var.b, (PointF) c47Var.c, d(), f2, this.d);
            if (pointF != null) {
                return pointF;
            }
        }
        if (path == null) {
            return (PointF) u35Var.b;
        }
        c47 c47Var2 = this.m;
        PathMeasure pathMeasure = this.l;
        if (c47Var2 != c47Var) {
            pathMeasure.setPath(path, false);
            this.m = c47Var;
        }
        float length = pathMeasure.getLength();
        float f3 = f2 * length;
        float[] fArr = this.j;
        float[] fArr2 = this.k;
        pathMeasure.getPosTan(f3, fArr, fArr2);
        float f4 = fArr[0];
        float f5 = fArr[1];
        PointF pointF2 = this.i;
        pointF2.set(f4, f5);
        if (f3 < 0.0f) {
            pointF2.offset(fArr2[0] * f3, fArr2[1] * f3);
            return pointF2;
        }
        if (f3 > length) {
            float f6 = f3 - length;
            pointF2.offset(fArr2[0] * f6, fArr2[1] * f6);
        }
        return pointF2;
    }
}
