package p037.p065.p066;

import android.annotation.SuppressLint;
import android.os.Looper;
import android.util.AndroidRuntimeException;
import android.util.Log;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import p037.p057.C1729;
import p037.p065.p066.AbstractC1802;
import p037.p065.p066.C1796;
import p138.p139.p143.p144.C2803;

/* JADX INFO: renamed from: މ.ރ.ށ.ރ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class C1806 extends AbstractC1802 implements C1796.InterfaceC1798 {

    /* JADX INFO: renamed from: ޜ, reason: contains not printable characters */
    public static final Comparator<C1810> f6049 = new C1809();

    /* JADX INFO: renamed from: އ, reason: contains not printable characters */
    public ArrayList<C1812> f6050 = new ArrayList<>();

    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public C1729<AbstractC1802, C1812> f6051 = new C1729<>();

    /* JADX INFO: renamed from: މ, reason: contains not printable characters */
    public ArrayList<C1810> f6052 = new ArrayList<>();

    /* JADX INFO: renamed from: ފ, reason: contains not printable characters */
    public ArrayList<C1812> f6053 = new ArrayList<>();

    /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
    public boolean f6054 = false;

    /* JADX INFO: renamed from: ތ, reason: contains not printable characters */
    public boolean f6055 = false;

    /* JADX INFO: renamed from: ލ, reason: contains not printable characters */
    public long f6056 = 0;

    /* JADX INFO: renamed from: ގ, reason: contains not printable characters */
    public C1829 f6057;

    /* JADX INFO: renamed from: ޏ, reason: contains not printable characters */
    public C1812 f6058;

    /* JADX INFO: renamed from: ސ, reason: contains not printable characters */
    public long f6059;

    /* JADX INFO: renamed from: ޑ, reason: contains not printable characters */
    public InterfaceC1818 f6060;

    /* JADX INFO: renamed from: ޒ, reason: contains not printable characters */
    public long f6061;

    /* JADX INFO: renamed from: ޓ, reason: contains not printable characters */
    public long f6062;

    /* JADX INFO: renamed from: ޔ, reason: contains not printable characters */
    public long f6063;

    /* JADX INFO: renamed from: ޕ, reason: contains not printable characters */
    public int f6064;

    /* JADX INFO: renamed from: ޖ, reason: contains not printable characters */
    public boolean f6065;

    /* JADX INFO: renamed from: ޗ, reason: contains not printable characters */
    public boolean f6066;

    /* JADX INFO: renamed from: ޘ, reason: contains not printable characters */
    public C1813 f6067;

    /* JADX INFO: renamed from: ޙ, reason: contains not printable characters */
    public boolean f6068;

    /* JADX INFO: renamed from: ޚ, reason: contains not printable characters */
    public long f6069;

    /* JADX INFO: renamed from: ޛ, reason: contains not printable characters */
    public AbstractC1805 f6070;

    /* JADX INFO: renamed from: މ.ރ.ށ.ރ$֏, reason: contains not printable characters */
    public class C1807 extends AbstractC1805 {
        public C1807() {
        }

        @Override // p037.p065.p066.AbstractC1802.InterfaceC1803
        /* JADX INFO: renamed from: ֏ */
        public void mo1260(AbstractC1802 abstractC1802) {
            if (C1806.this.f6051.getOrDefault(abstractC1802, null) == null) {
                throw new AndroidRuntimeException("Error: animation ended is not in the node map");
            }
            C1806.this.f6051.getOrDefault(abstractC1802, null).f6079 = true;
        }
    }

    /* JADX INFO: renamed from: މ.ރ.ށ.ރ$ؠ, reason: contains not printable characters */
    public class C1808 extends AbstractC1805 {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final /* synthetic */ C1806 f6072;

        public C1808(C1806 c1806, C1806 c18062) {
            this.f6072 = c18062;
        }

        @Override // p037.p065.p066.AbstractC1802.InterfaceC1803
        /* JADX INFO: renamed from: ֏ */
        public void mo1260(AbstractC1802 abstractC1802) {
            if (this.f6072.f6051.getOrDefault(abstractC1802, null) == null) {
                throw new AndroidRuntimeException("Error: animation ended is not in the node map");
            }
            this.f6072.f6051.getOrDefault(abstractC1802, null).f6079 = true;
        }
    }

    /* JADX INFO: renamed from: މ.ރ.ށ.ރ$ހ, reason: contains not printable characters */
    public class C1809 implements Comparator<C1810> {
        @Override // java.util.Comparator
        public int compare(C1810 c1810, C1810 c18102) {
            C1810 c18103 = c1810;
            C1810 c18104 = c18102;
            long jM3586 = c18103.m3586();
            long jM35862 = c18104.m3586();
            if (jM3586 != jM35862) {
                return (jM35862 != -1 && (jM3586 == -1 || jM3586 - jM35862 > 0)) ? 1 : -1;
            }
            int i = c18104.f6074;
            int i2 = c18103.f6074;
            return i + i2 == 1 ? i2 - i : i - i2;
        }
    }

    /* JADX INFO: renamed from: މ.ރ.ށ.ރ$ށ, reason: contains not printable characters */
    public static class C1810 {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final C1812 f6073;

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final int f6074;

        public C1810(C1812 c1812, int i) {
            this.f6073 = c1812;
            this.f6074 = i;
        }

        public String toString() {
            int i = this.f6074;
            StringBuilder sbM4897 = C2803.m4897(i == 0 ? "start" : i == 1 ? "delay ended" : "end", " ");
            sbM4897.append(this.f6073.f6077.toString());
            return sbM4897.toString();
        }

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public long m3586() {
            int i = this.f6074;
            if (i == 0) {
                return this.f6073.f6084;
            }
            if (i != 1) {
                return this.f6073.f6085;
            }
            C1812 c1812 = this.f6073;
            long j = c1812.f6084;
            if (j == -1) {
                return -1L;
            }
            return c1812.f6077.mo3563() + j;
        }
    }

    /* JADX INFO: renamed from: މ.ރ.ށ.ރ$ނ, reason: contains not printable characters */
    @SuppressLint({"MissingBuildMethod"})
    public class C1811 {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public C1812 f6075;

        public C1811(AbstractC1802 abstractC1802) {
            C1806.this.f6054 = true;
            this.f6075 = C1806.this.m3573(abstractC1802);
        }
    }

    /* JADX INFO: renamed from: މ.ރ.ށ.ރ$ރ, reason: contains not printable characters */
    public static class C1812 implements Cloneable {

        /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
        public AbstractC1802 f6077;

        /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
        public ArrayList<C1812> f6080;

        /* JADX INFO: renamed from: އ, reason: contains not printable characters */
        public ArrayList<C1812> f6081;

        /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
        public ArrayList<C1812> f6078 = null;

        /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
        public boolean f6079 = false;

        /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
        public C1812 f6082 = null;

        /* JADX INFO: renamed from: މ, reason: contains not printable characters */
        public boolean f6083 = false;

        /* JADX INFO: renamed from: ފ, reason: contains not printable characters */
        public long f6084 = 0;

        /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
        public long f6085 = 0;

        /* JADX INFO: renamed from: ތ, reason: contains not printable characters */
        public long f6086 = 0;

        public C1812(AbstractC1802 abstractC1802) {
            this.f6077 = abstractC1802;
        }

        public C1812 clone() {
            try {
                C1812 c1812 = (C1812) super.clone();
                c1812.f6077 = this.f6077.clone();
                if (this.f6078 != null) {
                    c1812.f6078 = new ArrayList<>(this.f6078);
                }
                if (this.f6080 != null) {
                    c1812.f6080 = new ArrayList<>(this.f6080);
                }
                if (this.f6081 != null) {
                    c1812.f6081 = new ArrayList<>(this.f6081);
                }
                c1812.f6079 = false;
                return c1812;
            } catch (CloneNotSupportedException unused) {
                throw new AssertionError();
            }
        }

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public void m3587(ArrayList<C1812> arrayList) {
            if (arrayList == null) {
                return;
            }
            int size = arrayList.size();
            for (int i = 0; i < size; i++) {
                m3588(arrayList.get(i));
            }
        }

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public void m3588(C1812 c1812) {
            if (this.f6081 == null) {
                this.f6081 = new ArrayList<>();
            }
            if (this.f6081.contains(c1812)) {
                return;
            }
            this.f6081.add(c1812);
            if (c1812.f6078 == null) {
                c1812.f6078 = new ArrayList<>();
            }
            if (c1812.f6078.contains(this)) {
                return;
            }
            c1812.f6078.add(this);
            m3588(c1812);
        }

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public void m3589(C1812 c1812) {
            if (this.f6080 == null) {
                this.f6080 = new ArrayList<>();
            }
            if (this.f6080.contains(c1812)) {
                return;
            }
            this.f6080.add(c1812);
            c1812.m3589(this);
        }
    }

    /* JADX INFO: renamed from: މ.ރ.ށ.ރ$ބ, reason: contains not printable characters */
    public class C1813 {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public long f6087 = -1;

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public boolean f6088 = false;

        public C1813() {
        }

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public void m3591(boolean z) {
            if (z && C1806.this.mo3564() == -1) {
                throw new UnsupportedOperationException("Error: Cannot reverse infinite animator set");
            }
            if (this.f6087 < 0 || z == this.f6088) {
                return;
            }
            this.f6087 = (C1806.this.mo3564() - C1806.this.f6056) - this.f6087;
            this.f6088 = z;
        }

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public boolean m3592() {
            return this.f6087 != -1;
        }

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public void m3593() {
            this.f6087 = -1L;
            this.f6088 = false;
        }
    }

    public C1806() {
        C1829 c1829M3618 = C1829.m3618(0.0f, 1.0f);
        c1829M3618.mo3562(0L);
        this.f6057 = c1829M3618;
        this.f6058 = new C1812(c1829M3618);
        this.f6059 = -1L;
        this.f6060 = null;
        this.f6061 = 0L;
        this.f6062 = -1L;
        this.f6063 = -1L;
        this.f6064 = -1;
        this.f6065 = false;
        this.f6066 = true;
        this.f6067 = new C1813();
        this.f6068 = false;
        this.f6069 = -1L;
        this.f6070 = new C1807();
        this.f6051.put(this.f6057, this.f6058);
        this.f6053.add(this.f6058);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static boolean m3571(C1806 c1806) {
        if (c1806.f6056 > 0) {
            return false;
        }
        for (int i = 0; i < c1806.m3583().size(); i++) {
            AbstractC1802 abstractC1802 = c1806.m3583().get(i);
            if (!(abstractC1802 instanceof C1806) || !m3571((C1806) abstractC1802)) {
                return false;
            }
        }
        return true;
    }

    @Override // p037.p065.p066.AbstractC1802
    public void cancel() {
        if (Looper.myLooper() == null) {
            throw new AndroidRuntimeException("Animators may only be run on Looper threads");
        }
        if (this.f6055) {
            ArrayList<AbstractC1802.InterfaceC1803> arrayList = this.f6045;
            if (arrayList != null) {
                ArrayList arrayList2 = (ArrayList) arrayList.clone();
                int size = arrayList2.size();
                for (int i = 0; i < size; i++) {
                    ((AbstractC1802.InterfaceC1803) arrayList2.get(i)).mo1261(this);
                }
            }
            ArrayList arrayList3 = new ArrayList(this.f6050);
            int size2 = arrayList3.size();
            for (int i2 = 0; i2 < size2; i2++) {
                ((C1812) arrayList3.get(i2)).f6077.cancel();
            }
            this.f6050.clear();
            m3582();
        }
    }

    @Override // p037.p065.p066.AbstractC1802
    @SuppressLint({"NoClone"})
    public C1806 clone() {
        C1806 c1806 = (C1806) super.clone();
        int size = this.f6053.size();
        c1806.f6055 = false;
        c1806.f6062 = -1L;
        c1806.f6063 = -1L;
        c1806.f6064 = -1;
        c1806.f6048 = false;
        c1806.f6069 = -1L;
        c1806.f6067 = new C1813();
        c1806.f6066 = true;
        c1806.f6050 = new ArrayList<>();
        c1806.f6051 = new C1729<>();
        c1806.f6053 = new ArrayList<>(size);
        c1806.f6052 = new ArrayList<>();
        c1806.f6070 = new C1808(this, c1806);
        c1806.f6065 = false;
        c1806.f6054 = true;
        HashMap map = new HashMap(size);
        for (int i = 0; i < size; i++) {
            C1812 c1812 = this.f6053.get(i);
            C1812 c1812Clone = c1812.clone();
            c1812Clone.f6077.m3558(this.f6070);
            map.put(c1812, c1812Clone);
            c1806.f6053.add(c1812Clone);
            c1806.f6051.put(c1812Clone.f6077, c1812Clone);
        }
        C1812 c18122 = (C1812) map.get(this.f6058);
        c1806.f6058 = c18122;
        c1806.f6057 = (C1829) c18122.f6077;
        for (int i2 = 0; i2 < size; i2++) {
            C1812 c18123 = this.f6053.get(i2);
            C1812 c18124 = (C1812) map.get(c18123);
            C1812 c18125 = c18123.f6082;
            c18124.f6082 = c18125 == null ? null : (C1812) map.get(c18125);
            ArrayList<C1812> arrayList = c18123.f6078;
            int size2 = arrayList == null ? 0 : arrayList.size();
            for (int i3 = 0; i3 < size2; i3++) {
                c18124.f6078.set(i3, (C1812) map.get(c18123.f6078.get(i3)));
            }
            ArrayList<C1812> arrayList2 = c18123.f6080;
            int size3 = arrayList2 == null ? 0 : arrayList2.size();
            for (int i4 = 0; i4 < size3; i4++) {
                c18124.f6080.set(i4, (C1812) map.get(c18123.f6080.get(i4)));
            }
            ArrayList<C1812> arrayList3 = c18123.f6081;
            int size4 = arrayList3 == null ? 0 : arrayList3.size();
            for (int i5 = 0; i5 < size4; i5++) {
                c18124.f6081.set(i5, (C1812) map.get(c18123.f6081.get(i5)));
            }
        }
        return c1806;
    }

    public String toString() {
        StringBuilder sbM4889 = C2803.m4889("AnimatorSet@");
        sbM4889.append(Integer.toHexString(hashCode()));
        sbM4889.append("{");
        String string = sbM4889.toString();
        int size = this.f6053.size();
        for (int i = 0; i < size; i++) {
            C1812 c1812 = this.f6053.get(i);
            StringBuilder sbM4897 = C2803.m4897(string, "\n    ");
            sbM4897.append(c1812.f6077.toString());
            string = sbM4897.toString();
        }
        return C2803.m4879(string, "\n}");
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final long m3572(long j, C1812 c1812) {
        long jMo3564;
        if (this.f6065) {
            jMo3564 = mo3564() - j;
            j = c1812.f6085;
        } else {
            jMo3564 = c1812.f6084;
        }
        return j - jMo3564;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public C1812 m3573(AbstractC1802 abstractC1802) {
        C1812 orDefault = this.f6051.getOrDefault(abstractC1802, null);
        if (orDefault == null) {
            orDefault = new C1812(abstractC1802);
            this.f6051.put(abstractC1802, orDefault);
            this.f6053.add(orDefault);
            if (abstractC1802 instanceof C1806) {
                ((C1806) abstractC1802).f6066 = false;
            }
        }
        return orDefault;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m3574(int i, int i2, long j) {
        if (!this.f6065) {
            for (int i3 = i + 1; i3 <= i2; i3++) {
                C1810 c1810 = this.f6052.get(i3);
                C1812 c1812 = c1810.f6073;
                int i4 = c1810.f6074;
                if (i4 == 0) {
                    this.f6050.add(c1812);
                    if (c1812.f6077.mo3567()) {
                        c1812.f6077.cancel();
                    }
                    c1812.f6079 = false;
                    c1812.f6077.mo3559(false);
                    m3575(c1812, 0L);
                } else if (i4 == 2 && !c1812.f6079) {
                    m3575(c1812, m3572(j, c1812));
                }
            }
            return;
        }
        if (i == -1) {
            i = this.f6052.size();
        }
        for (int i5 = i - 1; i5 >= i2; i5--) {
            C1810 c18102 = this.f6052.get(i5);
            C1812 c18122 = c18102.f6073;
            int i6 = c18102.f6074;
            if (i6 == 2) {
                if (c18122.f6077.mo3567()) {
                    c18122.f6077.cancel();
                }
                c18122.f6079 = false;
                this.f6050.add(c18102.f6073);
                c18122.f6077.mo3559(true);
                m3575(c18122, 0L);
            } else if (i6 == 1 && !c18122.f6079) {
                m3575(c18122, m3572(j, c18122));
            }
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m3575(C1812 c1812, long j) {
        if (c1812.f6079) {
            return;
        }
        float f = C1829.f6122;
        if (f == 0.0f) {
            f = 1.0f;
        }
        c1812.f6079 = c1812.f6077.mo3560((long) (j * f));
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m3576(C1812 c1812, ArrayList<C1812> arrayList) {
        if (arrayList.contains(c1812)) {
            return;
        }
        arrayList.add(c1812);
        if (c1812.f6080 == null) {
            return;
        }
        for (int i = 0; i < c1812.f6080.size(); i++) {
            m3576(c1812.f6080.get(i), arrayList);
        }
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: ֏ */
    public void mo3555(InterfaceC1818 interfaceC1818) {
        this.f6060 = interfaceC1818;
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: ֏ */
    public void mo3556(boolean z) {
        if (this.f6066 && !mo3565()) {
            throw new UnsupportedOperationException("Children must be initialized.");
        }
        m3584();
        if (z) {
            for (int size = this.f6052.size() - 1; size >= 0; size--) {
                if (this.f6052.get(size).f6074 == 1) {
                    this.f6052.get(size).f6073.f6077.mo3556(true);
                }
            }
            return;
        }
        for (int i = 0; i < this.f6052.size(); i++) {
            if (this.f6052.get(i).f6074 == 2) {
                this.f6052.get(i).f6073.f6077.mo3556(false);
            }
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m3577(boolean z, boolean z2) {
        if (Looper.myLooper() == null) {
            throw new AndroidRuntimeException("Animators may only be run on Looper threads");
        }
        this.f6055 = true;
        this.f6066 = z2;
        this.f6048 = false;
        this.f6069 = -1L;
        int size = this.f6053.size();
        for (int i = 0; i < size; i++) {
            this.f6053.get(i).f6079 = false;
        }
        m3584();
        if (z) {
            if (!(mo3564() != -1)) {
                throw new UnsupportedOperationException("Cannot reverse infinite AnimatorSet");
            }
        }
        this.f6065 = z;
        boolean zM3571 = m3571(this);
        if (!zM3571) {
            for (int i2 = 1; i2 < this.f6053.size(); i2++) {
                this.f6053.get(i2).f6077.m3553(this.f6070);
            }
            C1813 c1813 = this.f6067;
            C1806 c1806 = C1806.this;
            long j = 0;
            if ((c1806.f6065 ? (c1806.mo3564() - C1806.this.f6056) - c1813.f6087 : c1813.f6087) == 0 && this.f6065) {
                this.f6067.m3593();
            }
            if (mo3565()) {
                mo3556(!this.f6065);
            } else if (this.f6065) {
                if (!mo3565()) {
                    this.f6068 = true;
                    mo3556(false);
                }
                mo3556(!this.f6065);
            } else {
                for (int size2 = this.f6052.size() - 1; size2 >= 0; size2--) {
                    if (this.f6052.get(size2).f6074 == 1) {
                        AbstractC1802 abstractC1802 = this.f6052.get(size2).f6073.f6077;
                        if (abstractC1802.mo3565()) {
                            abstractC1802.mo3556(true);
                        }
                    }
                }
            }
            if (this.f6065 || this.f6056 == 0 || this.f6067.m3592()) {
                if (this.f6067.m3592()) {
                    this.f6067.m3591(this.f6065);
                    j = this.f6067.f6087;
                }
                int iM3580 = m3580(j);
                m3574(-1, iM3580, j);
                for (int size3 = this.f6050.size() - 1; size3 >= 0; size3--) {
                    if (this.f6050.get(size3).f6079) {
                        this.f6050.remove(size3);
                    }
                }
                this.f6064 = iM3580;
            }
            if (this.f6066) {
                AbstractC1802.m3552(this);
            }
        }
        ArrayList<AbstractC1802.InterfaceC1803> arrayList = this.f6045;
        if (arrayList != null) {
            ArrayList arrayList2 = (ArrayList) arrayList.clone();
            int size4 = arrayList2.size();
            for (int i3 = 0; i3 < size4; i3++) {
                ((AbstractC1802.InterfaceC1803) arrayList2.get(i3)).mo1550(this, z);
            }
        }
        if (zM3571) {
            mo3557();
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void m3578(AbstractC1802... abstractC1802Arr) {
        if (abstractC1802Arr != null) {
            AbstractC1802 abstractC1802 = abstractC1802Arr[0];
            this.f6054 = true;
            C1812 c1812M3573 = m3573(abstractC1802);
            for (int i = 1; i < abstractC1802Arr.length; i++) {
                c1812M3573.m3589(m3573(abstractC1802Arr[i]));
            }
        }
    }

    @Override // p037.p065.p066.C1796.InterfaceC1798
    /* JADX INFO: renamed from: ֏ */
    public boolean mo3547(long j) {
        float f = C1829.f6122;
        if (f == 0.0f) {
            mo3557();
            return true;
        }
        if (this.f6063 < 0) {
            this.f6063 = j;
        }
        if (this.f6048) {
            if (this.f6069 == -1) {
                this.f6069 = j;
            }
            if (this.f6066) {
                C1796.m3541().m3544(this);
            }
            return false;
        }
        long j2 = this.f6069;
        if (j2 > 0) {
            this.f6063 = (j - j2) + this.f6063;
            this.f6069 = -1L;
        }
        if (this.f6067.m3592()) {
            this.f6067.m3591(this.f6065);
            if (this.f6065) {
                this.f6063 = j - ((long) (this.f6067.f6087 * f));
            } else {
                this.f6063 = j - ((long) ((this.f6067.f6087 + this.f6056) * f));
            }
            mo3556(!this.f6065);
            this.f6050.clear();
            for (int size = this.f6053.size() - 1; size >= 0; size--) {
                this.f6053.get(size).f6079 = false;
            }
            this.f6064 = -1;
            this.f6067.m3593();
        }
        if (!this.f6065 && j < this.f6063 + ((long) (this.f6056 * f))) {
            return false;
        }
        long j3 = (long) ((j - this.f6063) / f);
        this.f6062 = j;
        int iM3580 = m3580(j3);
        m3574(this.f6064, iM3580, j3);
        this.f6064 = iM3580;
        for (int i = 0; i < this.f6050.size(); i++) {
            C1812 c1812 = this.f6050.get(i);
            if (!c1812.f6079) {
                m3575(c1812, m3572(j3, c1812));
            }
        }
        for (int size2 = this.f6050.size() - 1; size2 >= 0; size2--) {
            if (this.f6050.get(size2).f6079) {
                this.f6050.remove(size2);
            }
        }
        boolean z = !this.f6065 ? !(this.f6050.isEmpty() && this.f6064 == this.f6052.size() - 1) : !(this.f6050.size() == 1 && this.f6050.get(0) == this.f6058) && (!this.f6050.isEmpty() || this.f6064 >= 3);
        if (this.f6047 != null) {
            for (int i2 = 0; i2 < this.f6047.size(); i2++) {
                this.f6047.get(i2).mo1547(this);
            }
        }
        if (!z) {
            return false;
        }
        m3582();
        return true;
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: ؠ */
    public void mo3557() {
        if (Looper.myLooper() == null) {
            throw new AndroidRuntimeException("Animators may only be run on Looper threads");
        }
        if (this.f6055) {
            if (this.f6065) {
                int size = this.f6064;
                if (size == -1) {
                    size = this.f6052.size();
                }
                this.f6064 = size;
                while (true) {
                    int i = this.f6064;
                    if (i <= 0) {
                        break;
                    }
                    int i2 = i - 1;
                    this.f6064 = i2;
                    C1810 c1810 = this.f6052.get(i2);
                    AbstractC1802 abstractC1802 = c1810.f6073.f6077;
                    if (!this.f6051.get(abstractC1802).f6079) {
                        int i3 = c1810.f6074;
                        if (i3 == 2) {
                            abstractC1802.mo3568();
                        } else if (i3 == 1 && abstractC1802.mo3567()) {
                            abstractC1802.mo3557();
                        }
                    }
                }
            } else {
                while (this.f6064 < this.f6052.size() - 1) {
                    int i4 = this.f6064 + 1;
                    this.f6064 = i4;
                    C1810 c18102 = this.f6052.get(i4);
                    AbstractC1802 abstractC18022 = c18102.f6073.f6077;
                    if (!this.f6051.get(abstractC18022).f6079) {
                        int i5 = c18102.f6074;
                        if (i5 == 0) {
                            abstractC18022.mo3569();
                        } else if (i5 == 2 && abstractC18022.mo3567()) {
                            abstractC18022.mo3557();
                        }
                    }
                }
            }
            this.f6050.clear();
        }
        m3582();
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final void m3579(C1812 c1812, ArrayList<C1812> arrayList) {
        int i = 0;
        if (c1812.f6078 == null) {
            if (c1812 == this.f6058) {
                while (i < this.f6053.size()) {
                    C1812 c18122 = this.f6053.get(i);
                    if (c18122 != this.f6058) {
                        c18122.f6084 = -1L;
                        c18122.f6085 = -1L;
                    }
                    i++;
                }
                return;
            }
            return;
        }
        arrayList.add(c1812);
        int size = c1812.f6078.size();
        while (i < size) {
            C1812 c18123 = c1812.f6078.get(i);
            c18123.f6086 = c18123.f6077.mo3564();
            int iIndexOf = arrayList.indexOf(c18123);
            if (iIndexOf >= 0) {
                while (iIndexOf < arrayList.size()) {
                    arrayList.get(iIndexOf).f6082 = null;
                    arrayList.get(iIndexOf).f6084 = -1L;
                    arrayList.get(iIndexOf).f6085 = -1L;
                    iIndexOf++;
                }
                c18123.f6084 = -1L;
                c18123.f6085 = -1L;
                c18123.f6082 = null;
                Log.w("AnimatorSet", "Cycle found in AnimatorSet: " + this);
            } else {
                long j = c18123.f6084;
                if (j != -1) {
                    long j2 = c1812.f6085;
                    if (j2 == -1) {
                        c18123.f6082 = c1812;
                        c18123.f6084 = -1L;
                        c18123.f6085 = -1L;
                    } else {
                        if (j2 >= j) {
                            c18123.f6082 = c1812;
                            c18123.f6084 = j2;
                        }
                        long j3 = c18123.f6086;
                        c18123.f6085 = j3 == -1 ? -1L : c18123.f6084 + j3;
                    }
                }
                m3579(c18123, arrayList);
            }
            i++;
        }
        arrayList.remove(c1812);
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: ؠ */
    public void mo3559(boolean z) {
        m3577(z, false);
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: ؠ */
    public boolean mo3560(long j) {
        return mo3547(j);
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: ހ */
    public long mo3561() {
        return this.f6059;
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: ހ */
    public /* bridge */ /* synthetic */ AbstractC1802 mo3562(long j) {
        mo3562(j);
        return this;
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: ހ */
    public C1806 mo3562(long j) {
        if (j < 0) {
            throw new IllegalArgumentException("duration must be a value of zero or greater");
        }
        this.f6054 = true;
        this.f6059 = j;
        return this;
    }

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public final int m3580(long j) {
        int size = this.f6052.size();
        int i = this.f6064;
        if (this.f6065) {
            long jMo3564 = mo3564() - j;
            int i2 = this.f6064;
            if (i2 != -1) {
                size = i2;
            }
            this.f6064 = size;
            for (int i3 = size - 1; i3 >= 0; i3--) {
                if (this.f6052.get(i3).m3586() >= jMo3564) {
                    i = i3;
                }
            }
        } else {
            for (int i4 = i + 1; i4 < size; i4++) {
                C1810 c1810 = this.f6052.get(i4);
                if (c1810.m3586() != -1 && c1810.m3586() <= j) {
                    i = i4;
                }
            }
        }
        return i;
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: ށ */
    public long mo3563() {
        return this.f6056;
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: ނ */
    public long mo3564() {
        m3585();
        m3581();
        return this.f6061;
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: ކ */
    public boolean mo3565() {
        boolean z = true;
        if (this.f6068) {
            return true;
        }
        int i = 0;
        while (true) {
            if (i >= this.f6053.size()) {
                break;
            }
            if (!this.f6053.get(i).f6077.mo3565()) {
                z = false;
                break;
            }
            i++;
        }
        this.f6068 = z;
        return z;
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: އ */
    public boolean mo3566() {
        return this.f6056 == 0 ? this.f6055 : this.f6062 > 0;
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: ވ */
    public boolean mo3567() {
        return this.f6055;
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: މ */
    public void mo3568() {
        m3577(true, true);
    }

    @Override // p037.p065.p066.AbstractC1802
    /* JADX INFO: renamed from: ފ */
    public void mo3569() {
        m3577(false, true);
    }

    /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
    public final void m3581() {
        boolean z;
        boolean z2;
        if (!this.f6054) {
            int i = 0;
            while (true) {
                if (i >= this.f6053.size()) {
                    z2 = false;
                    break;
                }
                if (this.f6053.get(i).f6086 != this.f6053.get(i).f6077.mo3564()) {
                    z2 = true;
                    break;
                }
                i++;
            }
            if (!z2) {
                return;
            }
        }
        this.f6054 = false;
        int size = this.f6053.size();
        for (int i2 = 0; i2 < size; i2++) {
            this.f6053.get(i2).f6083 = false;
        }
        for (int i3 = 0; i3 < size; i3++) {
            C1812 c1812 = this.f6053.get(i3);
            if (!c1812.f6083) {
                c1812.f6083 = true;
                ArrayList<C1812> arrayList = c1812.f6080;
                if (arrayList != null) {
                    m3576(c1812, arrayList);
                    c1812.f6080.remove(c1812);
                    int size2 = c1812.f6080.size();
                    for (int i4 = 0; i4 < size2; i4++) {
                        c1812.m3587(c1812.f6080.get(i4).f6081);
                    }
                    for (int i5 = 0; i5 < size2; i5++) {
                        C1812 c18122 = c1812.f6080.get(i5);
                        c18122.m3587(c1812.f6081);
                        c18122.f6083 = true;
                    }
                }
            }
        }
        for (int i6 = 0; i6 < size; i6++) {
            C1812 c18123 = this.f6053.get(i6);
            C1812 c18124 = this.f6058;
            if (c18123 != c18124 && c18123.f6081 == null) {
                c18123.m3588(c18124);
            }
        }
        ArrayList<C1812> arrayList2 = new ArrayList<>(this.f6053.size());
        C1812 c18125 = this.f6058;
        c18125.f6084 = 0L;
        c18125.f6085 = this.f6057.f6136;
        m3579(c18125, arrayList2);
        this.f6052.clear();
        for (int i7 = 1; i7 < this.f6053.size(); i7++) {
            C1812 c18126 = this.f6053.get(i7);
            this.f6052.add(new C1810(c18126, 0));
            this.f6052.add(new C1810(c18126, 1));
            this.f6052.add(new C1810(c18126, 2));
        }
        Collections.sort(this.f6052, f6049);
        int size3 = this.f6052.size();
        int i8 = 0;
        while (i8 < size3) {
            C1810 c1810 = this.f6052.get(i8);
            if (c1810.f6074 == 2) {
                C1812 c18127 = c1810.f6073;
                long j = c18127.f6084;
                long j2 = c18127.f6085;
                if (j == j2) {
                    z = true;
                } else if (j2 == c18127.f6077.mo3563() + j) {
                    z = false;
                }
                int i9 = i8 + 1;
                int i10 = size3;
                int i11 = i10;
                for (int i12 = i9; i12 < size3 && (i10 >= size3 || i11 >= size3); i12++) {
                    if (this.f6052.get(i12).f6073 == c1810.f6073) {
                        if (this.f6052.get(i12).f6074 == 0) {
                            i10 = i12;
                        } else if (this.f6052.get(i12).f6074 == 1) {
                            i11 = i12;
                        }
                    }
                }
                if (z && i10 == this.f6052.size()) {
                    throw new UnsupportedOperationException("Something went wrong, no start isfound after stop for an animation that has the same start and endtime.");
                }
                if (i11 == this.f6052.size()) {
                    throw new UnsupportedOperationException("Something went wrong, no startdelay end is found after stop for an animation");
                }
                if (z) {
                    this.f6052.add(i8, this.f6052.remove(i10));
                    i8 = i9;
                }
                this.f6052.add(i8, this.f6052.remove(i11));
                i8 += 2;
            }
            i8++;
        }
        if (!this.f6052.isEmpty() && this.f6052.get(0).f6074 != 0) {
            throw new UnsupportedOperationException("Sorting went bad, the start event should always be at index 0");
        }
        this.f6052.add(0, new C1810(this.f6058, 0));
        this.f6052.add(1, new C1810(this.f6058, 1));
        this.f6052.add(2, new C1810(this.f6058, 2));
        ArrayList<C1810> arrayList3 = this.f6052;
        if (arrayList3.get(arrayList3.size() - 1).f6074 != 0) {
            ArrayList<C1810> arrayList4 = this.f6052;
            if (arrayList4.get(arrayList4.size() - 1).f6074 != 1) {
                ArrayList<C1810> arrayList5 = this.f6052;
                this.f6061 = arrayList5.get(arrayList5.size() - 1).m3586();
                return;
            }
        }
        throw new UnsupportedOperationException("Something went wrong, the last event is not an end event");
    }

    /* JADX INFO: renamed from: ތ, reason: contains not printable characters */
    public final void m3582() {
        this.f6055 = false;
        this.f6062 = -1L;
        this.f6063 = -1L;
        this.f6064 = -1;
        this.f6048 = false;
        this.f6069 = -1L;
        this.f6067.m3593();
        this.f6050.clear();
        if (this.f6066) {
            C1796.m3541().m3544(this);
        }
        ArrayList<AbstractC1802.InterfaceC1803> arrayList = this.f6045;
        if (arrayList != null) {
            ArrayList arrayList2 = (ArrayList) arrayList.clone();
            int size = arrayList2.size();
            for (int i = 0; i < size; i++) {
                ((AbstractC1802.InterfaceC1803) arrayList2.get(i)).mo1548(this, this.f6065);
            }
        }
        for (int i2 = 1; i2 < this.f6053.size(); i2++) {
            this.f6053.get(i2).f6077.m3558(this.f6070);
        }
        this.f6066 = true;
        this.f6065 = false;
    }

    @SuppressLint({"ConcreteCollection"})
    /* JADX INFO: renamed from: ލ, reason: contains not printable characters */
    public ArrayList<AbstractC1802> m3583() {
        ArrayList<AbstractC1802> arrayList = new ArrayList<>();
        int size = this.f6053.size();
        for (int i = 0; i < size; i++) {
            C1812 c1812 = this.f6053.get(i);
            if (c1812 != this.f6058) {
                arrayList.add(c1812.f6077);
            }
        }
        return arrayList;
    }

    /* JADX INFO: renamed from: ގ, reason: contains not printable characters */
    public final void m3584() {
        if (this.f6060 != null) {
            for (int i = 0; i < this.f6053.size(); i++) {
                this.f6053.get(i).f6077.mo3555(this.f6060);
            }
        }
        m3585();
        m3581();
    }

    /* JADX INFO: renamed from: ޏ, reason: contains not printable characters */
    public final void m3585() {
        if (this.f6059 >= 0) {
            int size = this.f6053.size();
            for (int i = 0; i < size; i++) {
                this.f6053.get(i).f6077.mo3562(this.f6059);
            }
        }
        this.f6057.mo3562(this.f6056);
    }
}
