package vd;

import android.app.Application;
import android.content.Context;
import androidx.lifecycle.a0;
import androidx.lifecycle.a1;
import ca.canadapost.core.data.auth.model.UserProfile;
import kotlin.jvm.internal.g0;
import kotlin.jvm.internal.p0;
import l8.h;
import rm.n0;
import rm.y;
import tp.m0;
import tp.o0;
import tp.u1;

/* loaded from: classes4.dex */
public final class a extends androidx.lifecycle.b implements l8.h {

    /* renamed from: l, reason: collision with root package name */
    static final /* synthetic */ kn.l[] f39532l = {p0.h(new g0(a.class, "doubleClickGuard", "getDoubleClickGuard()Z", 0))};

    /* renamed from: c, reason: collision with root package name */
    private final t7.c f39533c;

    /* renamed from: d, reason: collision with root package name */
    private final ka.c f39534d;

    /* renamed from: e, reason: collision with root package name */
    private final g9.l f39535e;

    /* renamed from: f, reason: collision with root package name */
    private final ja.d f39536f;

    /* renamed from: g, reason: collision with root package name */
    private final String f39537g;

    /* renamed from: h, reason: collision with root package name */
    private final /* synthetic */ l8.i f39538h;

    /* renamed from: i, reason: collision with root package name */
    private final l8.e f39539i;

    /* renamed from: j, reason: collision with root package name */
    private final l8.g f39540j;

    /* renamed from: k, reason: collision with root package name */
    private final a0 f39541k;

    /* JADX INFO: Access modifiers changed from: package-private */
    /* renamed from: vd.a$a, reason: collision with other inner class name */
    /* loaded from: classes4.dex */
    public static final class C0944a extends kotlin.coroutines.jvm.internal.l implements dn.p {

        /* renamed from: p, reason: collision with root package name */
        int f39542p;

        C0944a(vm.d dVar) {
            super(2, dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final vm.d create(Object obj, vm.d dVar) {
            return new C0944a(dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            Object f10;
            f10 = wm.d.f();
            int i10 = this.f39542p;
            if (i10 == 0) {
                y.b(obj);
                g9.l lVar = a.this.f39535e;
                this.f39542p = 1;
                if (lVar.e(this) == f10) {
                    return f10;
                }
            } else {
                if (i10 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                y.b(obj);
            }
            a.this.f39540j.s();
            return n0.f34904a;
        }

        @Override // dn.p
        public final Object invoke(m0 m0Var, vm.d dVar) {
            return ((C0944a) create(m0Var, dVar)).invokeSuspend(n0.f34904a);
        }
    }

    /* JADX WARN: Illegal instructions before constructor call */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public a(t7.c contextService, ka.c userProfileRepository, g9.l userAuthenticationRepository, ja.d sharedPreferencesService, String str) {
        super((Application) r0);
        kotlin.jvm.internal.t.g(contextService, "contextService");
        kotlin.jvm.internal.t.g(userProfileRepository, "userProfileRepository");
        kotlin.jvm.internal.t.g(userAuthenticationRepository, "userAuthenticationRepository");
        kotlin.jvm.internal.t.g(sharedPreferencesService, "sharedPreferencesService");
        Context a10 = contextService.a();
        kotlin.jvm.internal.t.e(a10, "null cannot be cast to non-null type android.app.Application");
        this.f39533c = contextService;
        this.f39534d = userProfileRepository;
        this.f39535e = userAuthenticationRepository;
        this.f39536f = sharedPreferencesService;
        this.f39537g = str;
        this.f39538h = new l8.i(contextService);
        this.f39539i = new l8.e(false, 0L, 3, null);
        l8.g gVar = new l8.g();
        this.f39540j = gVar;
        this.f39541k = gVar;
    }

    private final boolean S() {
        return this.f39539i.a(this, f39532l[0]).booleanValue();
    }

    @Override // l8.h
    public a0 J() {
        return this.f39538h.J();
    }

    public final a0 T() {
        return this.f39541k;
    }

    public final String U() {
        String str = this.f39537g;
        return str == null ? "" : str;
    }

    public final ja.d V() {
        return this.f39536f;
    }

    public final String W() {
        String userName;
        UserProfile userProfile = (UserProfile) this.f39534d.a().f();
        return (userProfile == null || (userName = userProfile.getUserName()) == null) ? "" : userName;
    }

    public final void X() {
        h.a.a(this, a1.a(this), null, null, null, new C0944a(null), 7, null);
    }

    public final void Y() {
        if (S()) {
            return;
        }
        X();
    }

    @Override // l8.h
    public u1 u(m0 m0Var, vm.g context, o0 start, String str, dn.p block) {
        kotlin.jvm.internal.t.g(m0Var, "<this>");
        kotlin.jvm.internal.t.g(context, "context");
        kotlin.jvm.internal.t.g(start, "start");
        kotlin.jvm.internal.t.g(block, "block");
        return this.f39538h.u(m0Var, context, start, str, block);
    }
}
