package d3;

import android.os.SystemClock;
import androidx.compose.runtime.MutableLongState;
import j$.time.format.DateTimeFormatter;
import m3.AbstractC2467b;
import w4.C3137A;

/* JADX INFO: loaded from: classes.dex */
public final class Z1 extends C4.j implements J4.e {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public long f15504a;

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ MutableLongState f15506c;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public Z1(MutableLongState mutableLongState, A4.d dVar) {
        super(2, dVar);
        this.f15506c = mutableLongState;
    }

    @Override // C4.a
    public final A4.d create(Object obj, A4.d dVar) {
        return new Z1(this.f15506c, dVar);
    }

    @Override // J4.e
    public final Object invoke(Object obj, Object obj2) {
        return ((Z1) create((V4.C) obj, (A4.d) obj2)).invokeSuspend(C3137A.f25453a);
    }

    @Override // C4.a
    public final Object invokeSuspend(Object obj) {
        long longValue;
        long j4;
        B4.a aVar = B4.a.f492a;
        int i6 = this.f15505b;
        C3137A c3137a = C3137A.f25453a;
        MutableLongState mutableLongState = this.f15506c;
        if (i6 == 0) {
            AbstractC2467b.l(obj);
            DateTimeFormatter dateTimeFormatter = v2.f16084a;
            longValue = mutableLongState.getLongValue();
            if (longValue > 0) {
                long jElapsedRealtime = longValue - SystemClock.elapsedRealtime();
                if (jElapsedRealtime > 0) {
                    this.f15504a = longValue;
                    this.f15505b = 1;
                    if (V4.E.l(jElapsedRealtime, this) == aVar) {
                        return aVar;
                    }
                    j4 = longValue;
                }
                DateTimeFormatter dateTimeFormatter2 = v2.f16084a;
                if (mutableLongState.getLongValue() == longValue && SystemClock.elapsedRealtime() >= longValue) {
                    mutableLongState.setLongValue(0L);
                }
            }
            return c3137a;
        }
        if (i6 != 1) {
            throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
        }
        j4 = this.f15504a;
        AbstractC2467b.l(obj);
        longValue = j4;
        DateTimeFormatter dateTimeFormatter22 = v2.f16084a;
        if (mutableLongState.getLongValue() == longValue) {
            mutableLongState.setLongValue(0L);
        }
        return c3137a;
    }
}
