package F1;

import android.os.Build;
import android.view.WindowInsets;
import android.view.WindowInsetsAnimation;
import android.view.WindowInsetsAnimation$Callback;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;

/* JADX INFO: loaded from: classes.dex */
public final class S extends WindowInsetsAnimation$Callback {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final L f1399a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public List f1400b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public ArrayList f1401c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final HashMap f1402d;

    public S(L l) {
        super(l.f1378a);
        this.f1402d = new HashMap();
        this.f1399a = l;
    }

    public final V a(WindowInsetsAnimation windowInsetsAnimation) {
        V v3 = (V) this.f1402d.get(windowInsetsAnimation);
        if (v3 == null) {
            v3 = new V(0, null, 0L);
            if (Build.VERSION.SDK_INT >= 30) {
                v3.f1408a = new T(windowInsetsAnimation);
            }
            this.f1402d.put(windowInsetsAnimation, v3);
        }
        return v3;
    }

    public final void onEnd(WindowInsetsAnimation windowInsetsAnimation) {
        this.f1399a.k(a(windowInsetsAnimation));
        this.f1402d.remove(windowInsetsAnimation);
    }

    public final void onPrepare(WindowInsetsAnimation windowInsetsAnimation) {
        L l = this.f1399a;
        a(windowInsetsAnimation);
        l.l();
    }

    public final WindowInsets onProgress(WindowInsets windowInsets, List list) {
        ArrayList arrayList = this.f1401c;
        if (arrayList == null) {
            ArrayList arrayList2 = new ArrayList(list.size());
            this.f1401c = arrayList2;
            this.f1400b = Collections.unmodifiableList(arrayList2);
        } else {
            arrayList.clear();
        }
        for (int size = list.size() - 1; size >= 0; size--) {
            WindowInsetsAnimation windowInsetsAnimationJ = AbstractC0189s.j(list.get(size));
            V vA = a(windowInsetsAnimationJ);
            vA.f1408a.e(windowInsetsAnimationJ.getFraction());
            this.f1401c.add(vA);
        }
        return this.f1399a.m(m0.c(null, windowInsets), this.f1400b).b();
    }

    public final WindowInsetsAnimation.Bounds onStart(WindowInsetsAnimation windowInsetsAnimation, WindowInsetsAnimation.Bounds bounds) {
        T.p pVarN = this.f1399a.n(a(windowInsetsAnimation), new T.p(bounds));
        pVarN.getClass();
        AbstractC0189s.l();
        return AbstractC0189s.h(((z1.b) pVarN.f6345b).d(), ((z1.b) pVarN.f6346c).d());
    }
}
