package ca.canadapost.module.customsform;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
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.g0;
import androidx.lifecycle.u;
import androidx.lifecycle.z0;
import ib.b1;
import ib.l;
import ib.t0;
import ib.x0;
import ib.y0;
import kotlin.Metadata;
import kotlin.jvm.internal.n;
import kotlin.jvm.internal.t;
import kotlin.jvm.internal.v;
import rm.i;
import rm.n0;
import rm.o;
import u7.x;
import w8.d0;
import w8.w;

@Metadata(d1 = {"\u0000L\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\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\f\b\u0007\u0018\u0000 (2\u00020\u00012\b\u0012\u0004\u0012\u00020\u00030\u0002:\u0001)B\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\u0012\u0010\u0011\u001a\u00020\u00102\b\u0010\t\u001a\u0004\u0018\u00010\bH\u0016J$\u0010\u0012\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\b\u0010\u0013\u001a\u00020\u0010H\u0016J\u001a\u0010\u0015\u001a\u00020\u00102\u0006\u0010\u0014\u001a\u00020\u000e2\b\u0010\t\u001a\u0004\u0018\u00010\bH\u0016R\"\u0010\u001d\u001a\u00020\u00168\u0004@\u0004X\u0085.¢\u0006\u0012\n\u0004\b\u0017\u0010\u0018\u001a\u0004\b\u0019\u0010\u001a\"\u0004\b\u001b\u0010\u001cR\u001b\u0010\r\u001a\u00020\u001e8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u001f\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/customsform/CustomsFormGeneratedQrCodeFragment;", "Lu8/b;", "", "Ljb/i;", "Landroid/view/LayoutInflater;", "inflater", "Landroid/view/ViewGroup;", "container", "Landroid/os/Bundle;", "savedInstanceState", "Landroidx/lifecycle/u;", "viewLifecycleOwner", "Landroidx/lifecycle/z0;", "viewModel", "Landroid/view/View;", "K", "Lrm/n0;", "onCreate", "onCreateView", "onResume", "view", "onViewCreated", "Lib/t0;", "t", "Lib/t0;", "getCustomsFormQRCodeService", "()Lib/t0;", "setCustomsFormQRCodeService", "(Lib/t0;)V", "customsFormQRCodeService", "Lib/l;", "u", "Lrm/o;", "J", "()Lib/l;", "I", "()Ljb/i;", "binding", "<init>", "()V", "v", "a", "customsform_productionRelease"}, k = 1, mv = {1, 9, 0})
/* loaded from: classes4.dex */
public final class CustomsFormGeneratedQrCodeFragment extends u8.b {

    /* renamed from: w, reason: collision with root package name */
    public static final int f8352w = 8;

    /* renamed from: t, reason: collision with root package name and from kotlin metadata */
    protected t0 customsFormQRCodeService;

    /* renamed from: s, reason: collision with root package name */
    private final /* synthetic */ x f8353s = new x(y0.f23127i);

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

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

        public final void a(String str) {
            l J = CustomsFormGeneratedQrCodeFragment.this.J();
            t.d(str);
            CustomsFormGeneratedQrCodeFragment.this.I().V.setImageBitmap(J.e0(str));
        }

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

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

        public final void a(n0 n0Var) {
            w.d(x4.d.a(CustomsFormGeneratedQrCodeFragment.this), x0.f23094c, null, null, 6, null);
        }

        @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 f8358a;

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

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

        @Override // androidx.lifecycle.g0
        public final /* synthetic */ void d(Object obj) {
            this.f8358a.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 f8359p;

        /* 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.f8359p = fVar;
        }

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

    /* 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 f8360p;

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

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final d1 invoke() {
            d1 viewModelStore = ((e1) this.f8360p.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 CustomsFormGeneratedQrCodeFragment.this.y();
        }
    }

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

    public jb.i I() {
        return (jb.i) this.f8353s.b();
    }

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

    @Override // u8.b, androidx.fragment.app.f
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setHasOptionsMenu(true);
    }

    @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 K(inflater, container, savedInstanceState, viewLifecycleOwner, J());
    }

    @Override // u8.b, androidx.fragment.app.f
    public void onResume() {
        super.onResume();
        J().c0();
    }

    @Override // u8.b, androidx.fragment.app.f
    public void onViewCreated(View view, Bundle bundle) {
        t.g(view, "view");
        super.onViewCreated(view, bundle);
        k activity = getActivity();
        if (activity != null) {
            activity.setTitle((CharSequence) J().k0().f());
        }
        J().l0().j(getViewLifecycleOwner(), new d(new b()));
        J().g0().j(getViewLifecycleOwner(), new d(new c()));
        View requireView = requireView();
        t.f(requireView, "requireView(...)");
        String string = requireActivity().getString(b1.f22615u);
        t.f(string, "getString(...)");
        d0.v(requireView, string);
    }
}
