package defpackage;

import android.widget.TextView;
import androidx.appcompat.app.e;
import com.strmr.ps.R;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.Boxing;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;

/* JADX INFO: loaded from: classes3.dex */
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0002\u0010\u0003"}, d2 = {"Lak1;", "Le6a;", "<anonymous>", "(Lak1;)V"}, k = 3, mv = {2, 0, 0})
@DebugMetadata(c = "com.strmr.ps.ui.settings.fragments.AccountsFragment$startOAuthCountdown$1", f = "AccountsFragment.kt", i = {0}, l = {770}, m = "invokeSuspend", n = {"remaining"}, s = {"I$0"})
final class j6 extends SuspendLambda implements gr3<ak1, Continuation<? super e6a>, Object> {
    public int a;
    public int b;
    public final /* synthetic */ int c;
    public final /* synthetic */ e d;
    public final /* synthetic */ a4 e;
    public final /* synthetic */ TextView f;
    public final /* synthetic */ String i;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public j6(int i, e eVar, a4 a4Var, TextView textView, String str, Continuation continuation) {
        super(2, continuation);
        this.c = i;
        this.d = eVar;
        this.e = a4Var;
        this.f = textView;
        this.i = str;
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Continuation create(Object obj, Continuation continuation) {
        return new j6(this.c, this.d, this.e, this.f, this.i, continuation);
    }

    @Override // defpackage.gr3
    public final Object invoke(Object obj, Object obj2) {
        return ((j6) create((ak1) obj, (Continuation) obj2)).invokeSuspend(e6a.a);
    }

    /* JADX WARN: Removed duplicated region for block: B:11:0x0023  */
    /* JADX WARN: Removed duplicated region for block: B:26:0x0089  */
    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:21:0x007d -> B:23:0x0080). Please report as a decompilation issue!!! */
    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        int i;
        e eVar;
        String string;
        ck1 ck1Var = ck1.a;
        int i2 = this.b;
        if (i2 == 0) {
            s38.b(obj);
            i = this.c;
            eVar = this.d;
            a4 a4Var = this.e;
            if (i > 0) {
            }
            if (eVar.isShowing()) {
            }
            return e6a.a;
        }
        if (i2 != 1) {
            throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
        }
        i = this.a;
        s38.b(obj);
        i--;
        eVar = this.d;
        a4 a4Var2 = this.e;
        if (i > 0 || !eVar.isShowing()) {
            if (eVar.isShowing()) {
                eVar.dismiss();
                vw2.w(a4Var2, R.string.toast_code_expired, new Object[]{this.i}, a4Var2.requireContext(), 1);
            }
            return e6a.a;
        }
        int i3 = i / 60;
        int i4 = i % 60;
        if (i3 > 0) {
            Integer numBoxInt = Boxing.boxInt(i3);
            string = i4 > 0 ? a4Var2.getString(R.string.oauth_time_min_sec, numBoxInt, Boxing.boxInt(i4)) : a4Var2.getString(R.string.oauth_time_minutes, numBoxInt);
        } else {
            string = a4Var2.getString(R.string.oauth_time_seconds, Boxing.boxInt(i4));
        }
        cr4.d(string);
        this.f.setText(a4Var2.getString(R.string.oauth_code_expires_in, string));
        this.a = i;
        this.b = 1;
        if (h32.a(1000L, this) == ck1Var) {
            return ck1Var;
        }
        i--;
        eVar = this.d;
        a4 a4Var22 = this.e;
        if (i > 0) {
        }
        if (eVar.isShowing()) {
        }
        return e6a.a;
    }
}
