package ca.canadapost.module.l1auth;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.activity.p;
import androidx.activity.q;
import androidx.activity.s;
import androidx.fragment.app.f;
import androidx.fragment.app.k;
import androidx.fragment.app.p0;
import androidx.lifecycle.c1;
import androidx.lifecycle.d1;
import androidx.lifecycle.e1;
import androidx.lifecycle.u;
import androidx.lifecycle.z0;
import ca.canadapost.module.l1auth.VerifyIdentitySuccessFragment;
import dn.l;
import kotlin.Metadata;
import kotlin.jvm.internal.t;
import kotlin.jvm.internal.v;
import rm.n0;
import rm.o;
import u7.x;
import yc.j0;
import yc.y;

@Metadata(d1 = {"\u0000P\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\n\u0018\u00002\u00020\u00012\b\u0012\u0004\u0012\u00020\u00030\u0002B\u0007¢\u0006\u0004\b!\u0010\"J\u001a\u0010\t\u001a\u00020\b2\u0006\u0010\u0005\u001a\u00020\u00042\b\u0010\u0007\u001a\u0004\u0018\u00010\u0006H\u0002J5\u0010\u0015\u001a\u00020\u00142\u0006\u0010\u000b\u001a\u00020\n2\b\u0010\r\u001a\u0004\u0018\u00010\f2\b\u0010\u000f\u001a\u0004\u0018\u00010\u000e2\u0006\u0010\u0011\u001a\u00020\u00102\u0006\u0010\u0013\u001a\u00020\u0012H\u0096\u0001J$\u0010\u0016\u001a\u00020\u00142\u0006\u0010\u000b\u001a\u00020\n2\b\u0010\r\u001a\u0004\u0018\u00010\f2\b\u0010\u000f\u001a\u0004\u0018\u00010\u000eH\u0016J\u001a\u0010\u0018\u001a\u00020\b2\u0006\u0010\u0017\u001a\u00020\u00142\b\u0010\u000f\u001a\u0004\u0018\u00010\u000eH\u0016R\u001b\u0010\u0013\u001a\u00020\u00198BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u001a\u0010\u001b\u001a\u0004\b\u001c\u0010\u001dR\u0014\u0010 \u001a\u00020\u00038\u0016X\u0096\u0005¢\u0006\u0006\u001a\u0004\b\u001e\u0010\u001f¨\u0006#"}, d2 = {"Lca/canadapost/module/l1auth/VerifyIdentitySuccessFragment;", "Lu8/b;", "", "Lad/y;", "", "resultCode", "Landroid/content/Intent;", "intent", "Lrm/n0;", "O", "Landroid/view/LayoutInflater;", "inflater", "Landroid/view/ViewGroup;", "container", "Landroid/os/Bundle;", "savedInstanceState", "Landroidx/lifecycle/u;", "viewLifecycleOwner", "Landroidx/lifecycle/z0;", "viewModel", "Landroid/view/View;", "M", "onCreateView", "view", "onViewCreated", "Lyc/j0;", "t", "Lrm/o;", "L", "()Lyc/j0;", "K", "()Lad/y;", "binding", "<init>", "()V", "l1auth_productionRelease"}, k = 1, mv = {1, 9, 0})
/* loaded from: classes4.dex */
public final class VerifyIdentitySuccessFragment extends u8.b {

    /* renamed from: s, reason: collision with root package name */
    private final /* synthetic */ x f9668s = new x(y.f52231m);

    /* renamed from: t, reason: collision with root package name and from kotlin metadata */
    private final o viewModel = p0.a(this, kotlin.jvm.internal.p0.b(j0.class), new c(new b(this)), new d());

    /* loaded from: classes4.dex */
    static final class a extends v implements l {
        a() {
            super(1);
        }

        public final void a(p addCallback) {
            t.g(addCallback, "$this$addCallback");
            if (t.b(VerifyIdentitySuccessFragment.this.L().Q().f(), Boolean.TRUE)) {
                VerifyIdentitySuccessFragment.this.O(-1, new Intent());
                return;
            }
            VerifyIdentitySuccessFragment verifyIdentitySuccessFragment = VerifyIdentitySuccessFragment.this;
            k activity = verifyIdentitySuccessFragment.getActivity();
            verifyIdentitySuccessFragment.O(0, activity != null ? activity.getIntent() : null);
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            a((p) obj);
            return n0.f34904a;
        }
    }

    /* loaded from: classes4.dex */
    public static final class b extends v implements dn.a {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ f f9671p;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public b(f fVar) {
            super(0);
            this.f9671p = fVar;
        }

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final f invoke() {
            return this.f9671p;
        }
    }

    /* loaded from: classes4.dex */
    public static final class c extends v implements dn.a {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ dn.a f9672p;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public c(dn.a aVar) {
            super(0);
            this.f9672p = aVar;
        }

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final d1 invoke() {
            d1 viewModelStore = ((e1) this.f9672p.invoke()).getViewModelStore();
            t.f(viewModelStore, "ownerProducer().viewModelStore");
            return viewModelStore;
        }
    }

    /* loaded from: classes4.dex */
    static final class d extends v implements dn.a {
        d() {
            super(0);
        }

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final c1.c invoke() {
            return VerifyIdentitySuccessFragment.this.y();
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final j0 L() {
        return (j0) this.viewModel.getValue();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void N(VerifyIdentitySuccessFragment this$0, View view) {
        t.g(this$0, "this$0");
        if (t.b(this$0.L().Q().f(), Boolean.TRUE)) {
            this$0.L().R();
            this$0.O(-1, new Intent());
        } else {
            k activity = this$0.getActivity();
            this$0.O(-1, activity != null ? activity.getIntent() : null);
        }
        this$0.requireActivity().onBackPressed();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void O(int i10, Intent intent) {
        k requireActivity = requireActivity();
        requireActivity.setResult(i10, intent);
        requireActivity.finish();
    }

    public ad.y K() {
        return (ad.y) this.f9668s.b();
    }

    public View M(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState, u viewLifecycleOwner, z0 viewModel) {
        t.g(inflater, "inflater");
        t.g(viewLifecycleOwner, "viewLifecycleOwner");
        t.g(viewModel, "viewModel");
        return this.f9668s.c(inflater, container, savedInstanceState, viewLifecycleOwner, viewModel);
    }

    @Override // androidx.fragment.app.f
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        t.g(inflater, "inflater");
        u viewLifecycleOwner = getViewLifecycleOwner();
        t.f(viewLifecycleOwner, "getViewLifecycleOwner(...)");
        return M(inflater, container, savedInstanceState, viewLifecycleOwner, L());
    }

    @Override // u8.b, androidx.fragment.app.f
    public void onViewCreated(View view, Bundle bundle) {
        t.g(view, "view");
        super.onViewCreated(view, bundle);
        q onBackPressedDispatcher = requireActivity().getOnBackPressedDispatcher();
        t.f(onBackPressedDispatcher, "<get-onBackPressedDispatcher>(...)");
        s.a(onBackPressedDispatcher, getViewLifecycleOwner(), true, new a());
        K().A.setOnClickListener(new View.OnClickListener() { // from class: yc.i0
            @Override // android.view.View.OnClickListener
            public final void onClick(View view2) {
                VerifyIdentitySuccessFragment.N(VerifyIdentitySuccessFragment.this, view2);
            }
        });
    }
}
