package z;

import android.view.View;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.HashMap;
import v.q;
import xyz.stream.utils.f0;

/* JADX INFO: loaded from: classes.dex */
public abstract class p extends q {
    public p() {
        this.f33622b = 0;
        this.f33623c = new int[10];
        this.f33624d = (float[][]) Array.newInstance((Class<?>) Float.TYPE, 10, 3);
        this.f33627g = new float[3];
        this.f33628h = false;
        this.f33630j = Float.NaN;
    }

    public static p e(long j10, String str) {
        int i10;
        int i11;
        int i12;
        int i13;
        int i14;
        int i15;
        int i16;
        int i17;
        int i18;
        int i19;
        p lVar;
        i10 = 9;
        i11 = 8;
        i12 = 7;
        i13 = 6;
        i14 = 5;
        i15 = 4;
        i16 = 3;
        i17 = 2;
        i18 = 1;
        i19 = 0;
        switch (str) {
            case "rotationX":
                lVar = new l(i16);
                break;
            case "rotationY":
                lVar = new l(i15);
                break;
            case "translationX":
                lVar = new l(i12);
                break;
            case "translationY":
                lVar = new l(i11);
                break;
            case "translationZ":
                lVar = new l(i10);
                break;
            case "progress":
                o oVar = new o();
                oVar.f37007k = false;
                lVar = oVar;
                break;
            case "scaleX":
                lVar = new l(i14);
                break;
            case "scaleY":
                lVar = new l(i13);
                break;
            case "rotation":
                lVar = new l(i17);
                break;
            case "elevation":
                lVar = new l(i18);
                break;
            case "transitionPathRotate":
                lVar = new n();
                break;
            case "alpha":
                lVar = new l(i19);
                break;
            default:
                return null;
        }
        lVar.f33629i = j10;
        return lVar;
    }

    public final float d(float f10, long j10, View view, f0 f0Var) {
        this.f33621a.g(f10, this.f33627g);
        float[] fArr = this.f33627g;
        boolean z10 = true;
        float f11 = fArr[1];
        if (f11 == 0.0f) {
            this.f33628h = false;
            return fArr[2];
        }
        if (Float.isNaN(this.f33630j)) {
            float fN = f0Var.n(view, this.f33626f);
            this.f33630j = fN;
            if (Float.isNaN(fN)) {
                this.f33630j = 0.0f;
            }
        }
        float f12 = (float) (((((j10 - this.f33629i) * 1.0E-9d) * ((double) f11)) + ((double) this.f33630j)) % 1.0d);
        this.f33630j = f12;
        String str = this.f33626f;
        if (((HashMap) f0Var.f36136b).containsKey(view)) {
            HashMap map = (HashMap) ((HashMap) f0Var.f36136b).get(view);
            if (map == null) {
                map = new HashMap();
            }
            if (map.containsKey(str)) {
                float[] fArrCopyOf = (float[]) map.get(str);
                if (fArrCopyOf == null) {
                    fArrCopyOf = new float[0];
                }
                if (fArrCopyOf.length <= 0) {
                    fArrCopyOf = Arrays.copyOf(fArrCopyOf, 1);
                }
                fArrCopyOf[0] = f12;
                map.put(str, fArrCopyOf);
            } else {
                map.put(str, new float[]{f12});
                ((HashMap) f0Var.f36136b).put(view, map);
            }
        } else {
            HashMap map2 = new HashMap();
            map2.put(str, new float[]{f12});
            ((HashMap) f0Var.f36136b).put(view, map2);
        }
        this.f33629i = j10;
        float f13 = this.f33627g[0];
        float fA = (a(this.f33630j) * f13) + this.f33627g[2];
        if (f13 == 0.0f && f11 == 0.0f) {
            z10 = false;
        }
        this.f33628h = z10;
        return fA;
    }

    public abstract boolean f(float f10, long j10, View view, f0 f0Var);
}
