package com.revenuecat.purchases.ui.revenuecatui.customercenter.viewmodel;

import A4.d;
import B4.a;
import C4.e;
import C4.j;
import Y4.InterfaceC0844j;
import Y4.c0;
import com.revenuecat.purchases.ui.revenuecatui.customercenter.data.CustomerCenterState;
import m3.AbstractC2467b;
import w4.C3137A;

/* JADX INFO: loaded from: classes3.dex */
@e(c = "com.revenuecat.purchases.ui.revenuecatui.customercenter.viewmodel.CustomerCenterViewModelImpl$state$1", f = "CustomerCenterViewModel.kt", l = {215}, m = "invokeSuspend")
public final class CustomerCenterViewModelImpl$state$1 extends j implements J4.e {
    int label;
    final /* synthetic */ CustomerCenterViewModelImpl this$0;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public CustomerCenterViewModelImpl$state$1(CustomerCenterViewModelImpl customerCenterViewModelImpl, d dVar) {
        super(2, dVar);
        this.this$0 = customerCenterViewModelImpl;
    }

    @Override // C4.a
    public final d create(Object obj, d dVar) {
        return new CustomerCenterViewModelImpl$state$1(this.this$0, dVar);
    }

    @Override // J4.e
    public final Object invoke(InterfaceC0844j interfaceC0844j, d dVar) {
        return ((CustomerCenterViewModelImpl$state$1) create(interfaceC0844j, dVar)).invokeSuspend(C3137A.f25453a);
    }

    @Override // C4.a
    public final Object invokeSuspend(Object obj) {
        a aVar = a.f492a;
        int i6 = this.label;
        if (i6 == 0) {
            AbstractC2467b.l(obj);
            CustomerCenterState customerCenterState = (CustomerCenterState) ((c0) this.this$0._state).getValue();
            if ((customerCenterState instanceof CustomerCenterState.NotLoaded) || (customerCenterState instanceof CustomerCenterState.Loading) || (customerCenterState instanceof CustomerCenterState.Error)) {
                CustomerCenterViewModelImpl customerCenterViewModelImpl = this.this$0;
                this.label = 1;
                if (customerCenterViewModelImpl.loadCustomerCenter(this) == aVar) {
                    return aVar;
                }
            }
        } else {
            if (i6 != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            AbstractC2467b.l(obj);
        }
        return C3137A.f25453a;
    }
}
