package ca.canadapost.module.track.views;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.p0;
import androidx.lifecycle.c1;
import androidx.lifecycle.d1;
import androidx.lifecycle.e1;
import androidx.lifecycle.g0;
import androidx.lifecycle.o0;
import androidx.lifecycle.u;
import androidx.lifecycle.z0;
import jg.q4;
import kotlin.Metadata;
import kotlin.jvm.internal.n;
import kotlin.jvm.internal.t;
import kotlin.jvm.internal.v;
import rm.n0;
import rm.o;
import u7.x;
import zf.o3;

@Metadata(d1 = {"\u0000X\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\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\u0010\u000e\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\n\u0018\u00002\u00020\u00012\b\u0012\u0004\u0012\u00020\u00030\u0002B\u0007¢\u0006\u0004\b(\u0010)J5\u0010\u000f\u001a\u00020\u000e2\u0006\u0010\u0005\u001a\u00020\u00042\b\u0010\u0007\u001a\u0004\u0018\u00010\u00062\b\u0010\t\u001a\u0004\u0018\u00010\b2\u0006\u0010\u000b\u001a\u00020\n2\u0006\u0010\r\u001a\u00020\fH\u0096\u0001J\n\u0010\u0011\u001a\u0004\u0018\u00010\u0010H\u0016J\n\u0010\u0013\u001a\u0004\u0018\u00010\u0012H\u0016J$\u0010\u0014\u001a\u00020\u000e2\u0006\u0010\u0005\u001a\u00020\u00042\b\u0010\u0007\u001a\u0004\u0018\u00010\u00062\b\u0010\t\u001a\u0004\u0018\u00010\bH\u0016J\u001a\u0010\u0017\u001a\u00020\u00162\u0006\u0010\u0015\u001a\u00020\u000e2\b\u0010\t\u001a\u0004\u0018\u00010\bH\u0016R\"\u0010\u001f\u001a\u00020\u00188\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b\u0019\u0010\u001a\u001a\u0004\b\u001b\u0010\u001c\"\u0004\b\u001d\u0010\u001eR\u001b\u0010\r\u001a\u00020 8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b!\u0010\"\u001a\u0004\b#\u0010$R\u0014\u0010'\u001a\u00020\u00038\u0016X\u0096\u0005¢\u0006\u0006\u001a\u0004\b%\u0010&¨\u0006*"}, d2 = {"Lca/canadapost/module/track/views/SubscriptionOptInDialogFragment;", "Lca/canadapost/core/common/ui/b;", "", "Lzf/o3;", "Landroid/view/LayoutInflater;", "inflater", "Landroid/view/ViewGroup;", "container", "Landroid/os/Bundle;", "savedInstanceState", "Landroidx/lifecycle/u;", "viewLifecycleOwner", "Landroidx/lifecycle/z0;", "viewModel", "Landroid/view/View;", "I", "Landroidx/appcompat/widget/Toolbar;", "C", "", "B", "onCreateView", "view", "Lrm/n0;", "onViewCreated", "Landroidx/lifecycle/c1$c;", "q", "Landroidx/lifecycle/c1$c;", "H", "()Landroidx/lifecycle/c1$c;", "setViewModelFactory", "(Landroidx/lifecycle/c1$c;)V", "viewModelFactory", "Ljg/q4;", "r", "Lrm/o;", "G", "()Ljg/q4;", "F", "()Lzf/o3;", "binding", "<init>", "()V", "track_productionRelease"}, k = 1, mv = {1, 9, 0})
/* loaded from: classes4.dex */
public final class SubscriptionOptInDialogFragment extends ca.canadapost.core.common.ui.b {

    /* renamed from: q, reason: collision with root package name and from kotlin metadata */
    public c1.c viewModelFactory;

    /* renamed from: p, reason: collision with root package name */
    private final /* synthetic */ x f11062p = new x(yf.e.f52517k0);

    /* renamed from: r, reason: collision with root package name and from kotlin metadata */
    private final o viewModel = p0.a(this, kotlin.jvm.internal.p0.b(q4.class), new f(new e(this)), new g());

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

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ v4.j f11065p;

        /* renamed from: q, reason: collision with root package name */
        final /* synthetic */ SubscriptionOptInDialogFragment f11066q;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        a(v4.j jVar, SubscriptionOptInDialogFragment subscriptionOptInDialogFragment) {
            super(1);
            this.f11065p = jVar;
            this.f11066q = subscriptionOptInDialogFragment;
        }

        public final void a(n0 n0Var) {
            o0 i10;
            v4.g H = this.f11065p.H();
            if (H != null && (i10 = H.i()) != null) {
                i10.k("OPT_IN_ACTION_TYPE", 2);
            }
            this.f11066q.dismiss();
        }

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

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

        public final void a(n0 n0Var) {
            SubscriptionOptInDialogFragment.this.dismiss();
        }

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

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

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ v4.j f11068p;

        /* renamed from: q, reason: collision with root package name */
        final /* synthetic */ SubscriptionOptInDialogFragment f11069q;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        c(v4.j jVar, SubscriptionOptInDialogFragment subscriptionOptInDialogFragment) {
            super(1);
            this.f11068p = jVar;
            this.f11069q = subscriptionOptInDialogFragment;
        }

        public final void a(n0 n0Var) {
            o0 i10;
            v4.g H = this.f11068p.H();
            if (H != null && (i10 = H.i()) != null) {
                i10.k("OPT_IN_ACTION_TYPE", 1);
            }
            this.f11069q.dismiss();
        }

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

    /* loaded from: classes4.dex */
    static final class d implements g0, n {

        /* renamed from: a, reason: collision with root package name */
        private final /* synthetic */ dn.l f11070a;

        d(dn.l function) {
            t.g(function, "function");
            this.f11070a = function;
        }

        @Override // kotlin.jvm.internal.n
        public final rm.i b() {
            return this.f11070a;
        }

        @Override // androidx.lifecycle.g0
        public final /* synthetic */ void d(Object obj) {
            this.f11070a.invoke(obj);
        }

        public final boolean equals(Object obj) {
            if ((obj instanceof g0) && (obj instanceof n)) {
                return t.b(b(), ((n) obj).b());
            }
            return false;
        }

        public final int hashCode() {
            return b().hashCode();
        }
    }

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

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ androidx.fragment.app.f f11071p;

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

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

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

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

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

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

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

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

    private final q4 G() {
        return (q4) this.viewModel.getValue();
    }

    @Override // ca.canadapost.core.common.ui.b
    public String B() {
        return "";
    }

    @Override // ca.canadapost.core.common.ui.b
    public Toolbar C() {
        u7.c appBarBinding = F().D.getAppBarBinding();
        if (appBarBinding != null) {
            return appBarBinding.B;
        }
        return null;
    }

    public o3 F() {
        return (o3) this.f11062p.b();
    }

    public final c1.c H() {
        c1.c cVar = this.viewModelFactory;
        if (cVar != null) {
            return cVar;
        }
        t.y("viewModelFactory");
        return null;
    }

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

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

    @Override // ca.canadapost.core.common.ui.b, androidx.fragment.app.f
    public void onViewCreated(View view, Bundle bundle) {
        t.g(view, "view");
        super.onViewCreated(view, bundle);
        Toolbar C = C();
        if (C != null) {
            C.setVisibility(8);
        }
        v4.j a10 = x4.d.a(this);
        G().S().j(getViewLifecycleOwner(), new d(new a(a10, this)));
        G().T().j(getViewLifecycleOwner(), new d(new b()));
        G().R().j(getViewLifecycleOwner(), new d(new c(a10, this)));
    }
}
