package com.vinfast.vehicle.licenseplate;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes15.dex */
@kotlin.Metadata(d1 = {"\u0000f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u000e\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0007\u0018\u0000 .2\b\u0012\u0004\u0012\u00020\u00020\u0001:\u0001/B\u0007¢\u0006\u0004\b\u0003\u0010\u0004J\u000f\u0010\u0006\u001a\u00020\u0005H\u0002¢\u0006\u0004\b\u0006\u0010\u0004J\u000f\u0010\u0007\u001a\u00020\u0005H\u0002¢\u0006\u0004\b\u0007\u0010\u0004J\u0017\u0010\n\u001a\u00020\u00052\u0006\u0010\t\u001a\u00020\bH\u0002¢\u0006\u0004\b\n\u0010\u000bJ\u000f\u0010\f\u001a\u00020\u0005H\u0002¢\u0006\u0004\b\f\u0010\u0004J\u000f\u0010\r\u001a\u00020\u0005H\u0002¢\u0006\u0004\b\r\u0010\u0004J\u0017\u0010\u0010\u001a\u00020\u00052\u0006\u0010\u000f\u001a\u00020\u000eH\u0002¢\u0006\u0004\b\u0010\u0010\u0011J\u000f\u0010\u0013\u001a\u00020\u0012H\u0016¢\u0006\u0004\b\u0013\u0010\u0014J!\u0010\u0019\u001a\u00020\u00052\u0006\u0010\u0016\u001a\u00020\u00152\b\u0010\u0018\u001a\u0004\u0018\u00010\u0017H\u0016¢\u0006\u0004\b\u0019\u0010\u001aJ\u000f\u0010\u001c\u001a\u00020\u001bH\u0016¢\u0006\u0004\b\u001c\u0010\u001dJ\u0017\u0010 \u001a\u00020\u00052\u0006\u0010\u001f\u001a\u00020\u001eH\u0016¢\u0006\u0004\b \u0010!R\u001b\u0010'\u001a\u00020\"8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b#\u0010$\u001a\u0004\b%\u0010&R\u0016\u0010+\u001a\u00020(8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b)\u0010*R\u0016\u0010-\u001a\u00020(8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b,\u0010*¨\u00062²\u0006\f\u00101\u001a\u0002008\nX\u008a\u0084\u0002"}, d2 = {"Lcom/vinfast/vehicle/licenseplate/EditLicensePlateFragment;", "Lcom/vinfast/companion/core/base/fragment/BaseFragment;", "Lcom/vinfast/vehicle/databinding/FragmentEditLicensePlateBinding;", "<init>", "()V", "", "i2", "f2", "", "isVerified", "m2", "(Z)V", "b2", "o2", "Lcom/vinfast/vehicle/licenseplate/EditLicensePlateResult;", "result", "n2", "(Lcom/vinfast/vehicle/licenseplate/EditLicensePlateResult;)V", "Lcom/vinfast/companion/core/base/BaseViewModel;", "U1", "()Lcom/vinfast/companion/core/base/BaseViewModel;", "Landroid/view/View;", "view", "Landroid/os/Bundle;", "savedInstanceState", "y1", "(Landroid/view/View;Landroid/os/Bundle;)V", "Lcom/vinfast/companion/core/base/fragment/ToolbarConfiguration;", "T0", "()Lcom/vinfast/companion/core/base/fragment/ToolbarConfiguration;", "Lcom/vinfast/companion/core/base/ViewModelState$Error;", "error", "I0", "(Lcom/vinfast/companion/core/base/ViewModelState$Error;)V", "Lcom/vinfast/vehicle/licenseplate/EditLicensePlateViewModel;", "A", "Lkotlin/Lazy;", "e2", "()Lcom/vinfast/vehicle/licenseplate/EditLicensePlateViewModel;", "viewModel", "", "B", "Ljava/lang/String;", "oldData", "C", "dmsData", "D", "Companion", "Lcom/vinfast/vehicle/licenseplate/EditLicensePlateFragmentArgs;", "args", "vehicle_release"}, k = 1, mv = {2, 2, 0}, xi = 48)
@dagger.hilt.android.AndroidEntryPoint
@kotlin.jvm.internal.SourceDebugExtension
public final class EditLicensePlateFragment extends com.vinfast.vehicle.licenseplate.Hilt_EditLicensePlateFragment<com.vinfast.vehicle.databinding.FragmentEditLicensePlateBinding> {

    /* JADX INFO: renamed from: A, reason: from kotlin metadata */
    private final kotlin.Lazy viewModel;

    /* JADX INFO: renamed from: B, reason: from kotlin metadata */
    private java.lang.String oldData;

    /* JADX INFO: renamed from: C, reason: from kotlin metadata */
    private java.lang.String dmsData;

    /* JADX INFO: renamed from: com.vinfast.vehicle.licenseplate.EditLicensePlateFragment$1, reason: invalid class name */
    /* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
    @kotlin.Metadata(k = 3, mv = {2, 2, 0}, xi = 48)
    static final /* synthetic */ class AnonymousClass1 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function1<android.view.LayoutInflater, com.vinfast.vehicle.databinding.FragmentEditLicensePlateBinding> {
        public static final com.vinfast.vehicle.licenseplate.EditLicensePlateFragment.AnonymousClass1 a = new com.vinfast.vehicle.licenseplate.EditLicensePlateFragment.AnonymousClass1();

        AnonymousClass1() {
            super(1, com.vinfast.vehicle.databinding.FragmentEditLicensePlateBinding.class, "inflate", "inflate(Landroid/view/LayoutInflater;)Lcom/vinfast/vehicle/databinding/FragmentEditLicensePlateBinding;", 0);
        }

        /* JADX INFO: renamed from: q, reason: merged with bridge method [inline-methods] */
        public final com.vinfast.vehicle.databinding.FragmentEditLicensePlateBinding invoke(android.view.LayoutInflater layoutInflater) {
            kotlin.jvm.internal.Intrinsics.l(layoutInflater, "p0");
            return com.vinfast.vehicle.databinding.FragmentEditLicensePlateBinding.c(layoutInflater);
        }
    }

    public EditLicensePlateFragment() {
        super(com.vinfast.vehicle.licenseplate.EditLicensePlateFragment.AnonymousClass1.a);
        final kotlin.jvm.functions.Function0<androidx.fragment.app.Fragment> function0 = new kotlin.jvm.functions.Function0<androidx.fragment.app.Fragment>() { // from class: com.vinfast.vehicle.licenseplate.EditLicensePlateFragment$special$$inlined$viewModels$default$1
            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            {
                super(0);
            }

            /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
            public final androidx.fragment.app.Fragment invoke() {
                return this;
            }
        };
        final kotlin.Lazy lazyA = kotlin.LazyKt.a(kotlin.LazyThreadSafetyMode.NONE, new kotlin.jvm.functions.Function0<androidx.lifecycle.ViewModelStoreOwner>() { // from class: com.vinfast.vehicle.licenseplate.EditLicensePlateFragment$special$$inlined$viewModels$default$2
            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            {
                super(0);
            }

            /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
            public final androidx.lifecycle.ViewModelStoreOwner invoke() {
                return (androidx.lifecycle.ViewModelStoreOwner) function0.invoke();
            }
        });
        final kotlin.jvm.functions.Function0 function1 = null;
        this.viewModel = androidx.fragment.app.FragmentViewModelLazyKt.c(this, kotlin.jvm.internal.Reflection.b(com.vinfast.vehicle.licenseplate.EditLicensePlateViewModel.class), new kotlin.jvm.functions.Function0<androidx.lifecycle.ViewModelStore>() { // from class: com.vinfast.vehicle.licenseplate.EditLicensePlateFragment$special$$inlined$viewModels$default$3
            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            {
                super(0);
            }

            /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
            public final androidx.lifecycle.ViewModelStore invoke() {
                return androidx.fragment.app.FragmentViewModelLazyKt.b(lazyA).getViewModelStore();
            }
        }, new kotlin.jvm.functions.Function0<androidx.lifecycle.viewmodel.CreationExtras>() { // from class: com.vinfast.vehicle.licenseplate.EditLicensePlateFragment$special$$inlined$viewModels$default$4
            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            {
                super(0);
            }

            /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
            public final androidx.lifecycle.viewmodel.CreationExtras invoke() {
                androidx.lifecycle.viewmodel.CreationExtras creationExtras;
                kotlin.jvm.functions.Function0 function2 = function1;
                if (function2 != null && (creationExtras = (androidx.lifecycle.viewmodel.CreationExtras) function2.invoke()) != null) {
                    return creationExtras;
                }
                androidx.lifecycle.HasDefaultViewModelProviderFactory hasDefaultViewModelProviderFactoryB = androidx.fragment.app.FragmentViewModelLazyKt.b(lazyA);
                androidx.lifecycle.HasDefaultViewModelProviderFactory hasDefaultViewModelProviderFactory = hasDefaultViewModelProviderFactoryB instanceof androidx.lifecycle.HasDefaultViewModelProviderFactory ? hasDefaultViewModelProviderFactoryB : null;
                return hasDefaultViewModelProviderFactory != null ? hasDefaultViewModelProviderFactory.getDefaultViewModelCreationExtras() : androidx.lifecycle.viewmodel.CreationExtras.Empty.c;
            }
        }, new kotlin.jvm.functions.Function0<androidx.lifecycle.ViewModelProvider.Factory>() { // from class: com.vinfast.vehicle.licenseplate.EditLicensePlateFragment$special$$inlined$viewModels$default$5
            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            {
                super(0);
            }

            /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
            public final androidx.lifecycle.ViewModelProvider.Factory invoke() {
                androidx.lifecycle.ViewModelProvider.Factory defaultViewModelProviderFactory;
                androidx.lifecycle.HasDefaultViewModelProviderFactory hasDefaultViewModelProviderFactoryB = androidx.fragment.app.FragmentViewModelLazyKt.b(lazyA);
                androidx.lifecycle.HasDefaultViewModelProviderFactory hasDefaultViewModelProviderFactory = hasDefaultViewModelProviderFactoryB instanceof androidx.lifecycle.HasDefaultViewModelProviderFactory ? hasDefaultViewModelProviderFactoryB : null;
                return (hasDefaultViewModelProviderFactory == null || (defaultViewModelProviderFactory = hasDefaultViewModelProviderFactory.getDefaultViewModelProviderFactory()) == null) ? this.getDefaultViewModelProviderFactory() : defaultViewModelProviderFactory;
            }
        });
        this.oldData = "";
        this.dmsData = "";
    }

    private final void b2() {
        com.vinfast.companion.core.logger.firebase.FLog.c(j0(), com.vinfast.companion.core.logger.firebase.FLogKey.LicensePlateAdd.b, null, 2, null);
        if (e2().L()) {
            o2();
            return;
        }
        java.lang.String textInputTrim = ((com.vinfast.vehicle.databinding.FragmentEditLicensePlateBinding) T1()).d.getTextInputTrim();
        if (this.oldData.length() == 0) {
            com.vinfast.companion.core.base.ui.widget.dialog.OptionsDialogFragment.Companion companion = com.vinfast.companion.core.base.ui.widget.dialog.OptionsDialogFragment.INSTANCE;
            androidx.fragment.app.FragmentManager childFragmentManager = getChildFragmentManager();
            kotlin.jvm.internal.Intrinsics.k(childFragmentManager, "getChildFragmentManager(...)");
            companion.a(childFragmentManager, (6290294 & 2) != 0 ? false : false, (6290294 & 4) != 0 ? null : null, (6290294 & 8) != 0 ? null : java.lang.Integer.valueOf(com.vinfast.vehicle.R.string.CA20104_license_updated), (6290294 & 16) != 0 ? null : null, (6290294 & 32) != 0 ? false : false, (6290294 & 64) != 0 ? null : null, (6290294 & 128) != 0 ? null : java.lang.Integer.valueOf(com.vinfast.vehicle.R.string.CA20104_license_updated_details), (6290294 & 256) != 0 ? null : null, (6290294 & 512) != 0 ? null : null, (6290294 & 1024) != 0 ? null : java.lang.Integer.valueOf(com.vinfast.vehicle.R.string.common_btn_ok), (6290294 & 2048) != 0 ? null : null, (6290294 & 4096) != 0 ? null : null, (6290294 & 8192) != 0 ? null : null, (6290294 & 16384) != 0 ? null : null, (6290294 & 32768) != 0 ? null : null, (6290294 & 65536) != 0 ? false : false, (6290294 & 131072) != 0 ? null : null, (6290294 & 262144) != 0 ? null : new kotlin.jvm.functions.Function0() { // from class: com.vinfast.vehicle.licenseplate.e
                public final java.lang.Object invoke() {
                    return com.vinfast.vehicle.licenseplate.EditLicensePlateFragment.c2(this.a);
                }
            }, (6290294 & 524288) != 0 ? null : null, (6290294 & 1048576) != 0 ? null : null, (6290294 & 2097152) != 0 ? null : null, (6290294 & 4194304) != 0 ? null : null, (6290294 & 8388608) != 0 ? null : null);
            return;
        }
        if (!kotlin.jvm.internal.Intrinsics.g(this.oldData, this.dmsData) || kotlin.jvm.internal.Intrinsics.g(textInputTrim, this.dmsData)) {
            o2();
            return;
        }
        com.vinfast.companion.core.base.ui.widget.dialog.OptionsDialogFragment.Companion companion2 = com.vinfast.companion.core.base.ui.widget.dialog.OptionsDialogFragment.INSTANCE;
        androidx.fragment.app.FragmentManager childFragmentManager2 = getChildFragmentManager();
        kotlin.jvm.internal.Intrinsics.k(childFragmentManager2, "getChildFragmentManager(...)");
        companion2.a(childFragmentManager2, (6290294 & 2) != 0 ? false : false, (6290294 & 4) != 0 ? null : null, (6290294 & 8) != 0 ? null : java.lang.Integer.valueOf(com.vinfast.vehicle.R.string.CA20104_change_lisence_plate), (6290294 & 16) != 0 ? null : null, (6290294 & 32) != 0 ? false : false, (6290294 & 64) != 0 ? null : requireContext().getString(com.vinfast.vehicle.R.string.CA20104_license_change_confirmation, this.dmsData, textInputTrim), (6290294 & 128) != 0 ? null : null, (6290294 & 256) != 0 ? null : null, (6290294 & 512) != 0 ? null : null, (6290294 & 1024) != 0 ? null : null, (6290294 & 2048) != 0 ? null : null, (6290294 & 4096) != 0 ? null : java.lang.Integer.valueOf(com.vinfast.vehicle.R.string.common_btn_cancel), (6290294 & 8192) != 0 ? null : null, (6290294 & 16384) != 0 ? null : java.lang.Integer.valueOf(com.vinfast.vehicle.R.string.CA20104_save_changes), (6290294 & 32768) != 0 ? null : null, (6290294 & 65536) != 0 ? false : false, (6290294 & 131072) != 0 ? null : null, (6290294 & 262144) != 0 ? null : null, (6290294 & 524288) != 0 ? null : null, (6290294 & 1048576) != 0 ? null : new kotlin.jvm.functions.Function0() { // from class: com.vinfast.vehicle.licenseplate.f
            public final java.lang.Object invoke() {
                return com.vinfast.vehicle.licenseplate.EditLicensePlateFragment.d2(this.a);
            }
        }, (6290294 & 2097152) != 0 ? null : null, (6290294 & 4194304) != 0 ? null : null, (6290294 & 8388608) != 0 ? null : null);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit c2(com.vinfast.vehicle.licenseplate.EditLicensePlateFragment editLicensePlateFragment) {
        editLicensePlateFragment.o2();
        return kotlin.Unit.a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit d2(com.vinfast.vehicle.licenseplate.EditLicensePlateFragment editLicensePlateFragment) {
        editLicensePlateFragment.o2();
        return kotlin.Unit.a;
    }

    private final com.vinfast.vehicle.licenseplate.EditLicensePlateViewModel e2() {
        return (com.vinfast.vehicle.licenseplate.EditLicensePlateViewModel) this.viewModel.getValue();
    }

    private final void f2() {
        int i;
        androidx.navigation.NavArgsLazy navArgsLazy = new androidx.navigation.NavArgsLazy(kotlin.jvm.internal.Reflection.b(com.vinfast.vehicle.licenseplate.EditLicensePlateFragmentArgs.class), new kotlin.jvm.functions.Function0<android.os.Bundle>() { // from class: com.vinfast.vehicle.licenseplate.EditLicensePlateFragment$initData$$inlined$navArgs$1
            /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
            public final android.os.Bundle invoke() {
                android.os.Bundle arguments = this.getArguments();
                if (arguments != null) {
                    return arguments;
                }
                throw new java.lang.IllegalStateException("Fragment " + this + " has null arguments");
            }
        });
        java.lang.String licensePlate = g2(navArgsLazy).getLicensePlate();
        if (licensePlate == null) {
            licensePlate = "";
        }
        this.oldData = licensePlate;
        java.lang.String dmsLicensePlate = g2(navArgsLazy).getDmsLicensePlate();
        this.dmsData = dmsLicensePlate != null ? dmsLicensePlate : "";
        ((com.vinfast.vehicle.databinding.FragmentEditLicensePlateBinding) T1()).d.setText(this.oldData);
        int i2 = com.vinfast.vehicle.R.string.common_btn_save;
        if (this.oldData.length() == 0) {
            i2 = com.vinfast.vehicle.R.string.common_btn_add;
            i = com.vinfast.vehicle.R.string.CA20104_add_license_plate;
        } else {
            i = com.vinfast.vehicle.R.string.CA70402_edit_license_plate;
        }
        com.vinfast.companion.core.base.ui.widget.CommonToolbar commonToolbarS0 = com.vinfast.companion.core.base.fragment.BaseFragment.S0(this, null, 1, null);
        if (commonToolbarS0 != null) {
            commonToolbarS0.setTitleText(getString(i));
        }
        ((com.vinfast.vehicle.databinding.FragmentEditLicensePlateBinding) T1()).b.setText(i2);
        androidx.lifecycle.LiveData editLicensePlateResult = e2().getEditLicensePlateResult();
        androidx.lifecycle.LifecycleOwner viewLifecycleOwner = getViewLifecycleOwner();
        kotlin.jvm.internal.Intrinsics.k(viewLifecycleOwner, "getViewLifecycleOwner(...)");
        com.vinfast.companion.core.extensions.LiveDataExtensionsKt.c(editLicensePlateResult, viewLifecycleOwner, new kotlin.jvm.functions.Function1() { // from class: com.vinfast.vehicle.licenseplate.a
            public final java.lang.Object invoke(java.lang.Object obj) {
                return com.vinfast.vehicle.licenseplate.EditLicensePlateFragment.h2(this.a, (com.vinfast.vehicle.licenseplate.EditLicensePlateResult) obj);
            }
        });
    }

    private static final com.vinfast.vehicle.licenseplate.EditLicensePlateFragmentArgs g2(androidx.navigation.NavArgsLazy navArgsLazy) {
        return (com.vinfast.vehicle.licenseplate.EditLicensePlateFragmentArgs) navArgsLazy.getValue();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit h2(com.vinfast.vehicle.licenseplate.EditLicensePlateFragment editLicensePlateFragment, com.vinfast.vehicle.licenseplate.EditLicensePlateResult editLicensePlateResult) {
        kotlin.jvm.internal.Intrinsics.l(editLicensePlateResult, "it");
        editLicensePlateFragment.n2(editLicensePlateResult);
        return kotlin.Unit.a;
    }

    private final void i2() {
        ((com.vinfast.vehicle.databinding.FragmentEditLicensePlateBinding) T1()).getRoot().setAnchor(((com.vinfast.vehicle.databinding.FragmentEditLicensePlateBinding) T1()).b);
        androidx.appcompat.widget.AppCompatTextView appCompatTextView = ((com.vinfast.vehicle.databinding.FragmentEditLicensePlateBinding) T1()).b;
        kotlin.jvm.internal.Intrinsics.k(appCompatTextView, "btnSend");
        com.vinfast.companion.core.extensions.ViewExtensionKt.G(appCompatTextView, new kotlin.jvm.functions.Function1() { // from class: com.vinfast.vehicle.licenseplate.b
            public final java.lang.Object invoke(java.lang.Object obj) {
                return com.vinfast.vehicle.licenseplate.EditLicensePlateFragment.j2(this.a, (android.view.View) obj);
            }
        });
        com.vinfast.companion.core.base.ui.widget.CustomEditTextItem customEditTextItem = ((com.vinfast.vehicle.databinding.FragmentEditLicensePlateBinding) T1()).d;
        customEditTextItem.u();
        customEditTextItem.setFocusInput();
        com.vinfast.companion.core.extensions.RxExtensionKt.o(customEditTextItem.getTextChanges(), new kotlin.jvm.functions.Function1() { // from class: com.vinfast.vehicle.licenseplate.c
            public final java.lang.Object invoke(java.lang.Object obj) {
                return com.vinfast.vehicle.licenseplate.EditLicensePlateFragment.k2(this.a, (java.lang.String) obj);
            }
        });
        io.reactivex.rxjava3.core.Observable observableFilter = customEditTextItem.getEditorActions().filter(new io.reactivex.rxjava3.functions.Predicate() { // from class: com.vinfast.vehicle.licenseplate.EditLicensePlateFragment$initView$2$2
            /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
            public final boolean test(java.lang.Integer num) {
                kotlin.jvm.internal.Intrinsics.l(num, "it");
                return num.intValue() == 6;
            }
        });
        kotlin.jvm.internal.Intrinsics.k(observableFilter, "filter(...)");
        com.vinfast.companion.core.extensions.RxExtensionKt.o(observableFilter, new kotlin.jvm.functions.Function1() { // from class: com.vinfast.vehicle.licenseplate.d
            public final java.lang.Object invoke(java.lang.Object obj) {
                return com.vinfast.vehicle.licenseplate.EditLicensePlateFragment.l2(this.a, (java.lang.Integer) obj);
            }
        });
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit j2(com.vinfast.vehicle.licenseplate.EditLicensePlateFragment editLicensePlateFragment, android.view.View view) {
        kotlin.jvm.internal.Intrinsics.l(view, "it");
        editLicensePlateFragment.b2();
        return kotlin.Unit.a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit k2(com.vinfast.vehicle.licenseplate.EditLicensePlateFragment editLicensePlateFragment, java.lang.String str) {
        kotlin.jvm.internal.Intrinsics.l(str, "it");
        boolean z = false;
        ((com.vinfast.vehicle.databinding.FragmentEditLicensePlateBinding) editLicensePlateFragment.T1()).b.setEnabled(!kotlin.jvm.internal.Intrinsics.g(str, editLicensePlateFragment.oldData) && (editLicensePlateFragment.e2().L() || str.length() > 0));
        if (kotlin.jvm.internal.Intrinsics.g(str, editLicensePlateFragment.dmsData) && editLicensePlateFragment.dmsData.length() > 0) {
            z = true;
        }
        editLicensePlateFragment.m2(z);
        return kotlin.Unit.a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit l2(com.vinfast.vehicle.licenseplate.EditLicensePlateFragment editLicensePlateFragment, java.lang.Integer num) {
        kotlin.jvm.internal.Intrinsics.l(num, "it");
        editLicensePlateFragment.b2();
        return kotlin.Unit.a;
    }

    private final void m2(boolean isVerified) {
        com.vinfast.vehicle.databinding.FragmentEditLicensePlateBinding fragmentEditLicensePlateBinding = (com.vinfast.vehicle.databinding.FragmentEditLicensePlateBinding) T1();
        if (e2().L()) {
            android.widget.RelativeLayout relativeLayout = fragmentEditLicensePlateBinding.f;
            kotlin.jvm.internal.Intrinsics.k(relativeLayout, "rlVerify");
            com.vinfast.companion.core.extensions.ViewExtensionKt.m(relativeLayout);
            return;
        }
        if (this.oldData.length() == 0) {
            android.widget.RelativeLayout relativeLayout2 = fragmentEditLicensePlateBinding.f;
            kotlin.jvm.internal.Intrinsics.k(relativeLayout2, "rlVerify");
            com.vinfast.companion.core.extensions.ViewExtensionKt.m(relativeLayout2);
            return;
        }
        android.widget.RelativeLayout relativeLayout3 = fragmentEditLicensePlateBinding.f;
        kotlin.jvm.internal.Intrinsics.k(relativeLayout3, "rlVerify");
        com.vinfast.companion.core.extensions.ViewExtensionKt.S(relativeLayout3);
        if (isVerified) {
            fragmentEditLicensePlateBinding.c.setImageResource(com.vinfast.vehicle.R.drawable.ic_verified);
            androidx.appcompat.widget.AppCompatTextView appCompatTextView = fragmentEditLicensePlateBinding.g;
            kotlin.jvm.internal.Intrinsics.k(appCompatTextView, "verifiedDesc");
            com.vinfast.companion.core.extensions.ViewExtensionKt.S(appCompatTextView);
            androidx.appcompat.widget.LinearLayoutCompat linearLayoutCompat = fragmentEditLicensePlateBinding.e;
            kotlin.jvm.internal.Intrinsics.k(linearLayoutCompat, "notVerifiedDesc");
            com.vinfast.companion.core.extensions.ViewExtensionKt.m(linearLayoutCompat);
            return;
        }
        fragmentEditLicensePlateBinding.c.setImageResource(com.vinfast.vehicle.R.drawable.ic_not_verified);
        androidx.appcompat.widget.AppCompatTextView appCompatTextView2 = fragmentEditLicensePlateBinding.g;
        kotlin.jvm.internal.Intrinsics.k(appCompatTextView2, "verifiedDesc");
        com.vinfast.companion.core.extensions.ViewExtensionKt.m(appCompatTextView2);
        androidx.appcompat.widget.LinearLayoutCompat linearLayoutCompat2 = fragmentEditLicensePlateBinding.e;
        kotlin.jvm.internal.Intrinsics.k(linearLayoutCompat2, "notVerifiedDesc");
        com.vinfast.companion.core.extensions.ViewExtensionKt.S(linearLayoutCompat2);
    }

    private final void n2(com.vinfast.vehicle.licenseplate.EditLicensePlateResult result) {
        androidx.lifecycle.SavedStateHandle savedStateHandleJ;
        int i = result.getIsSuccess() ? com.vinfast.vehicle.R.string.CA20801_successfully_added_license : com.vinfast.vehicle.R.string.CA20801_falied_to_add;
        if (!result.getIsSuccess()) {
            android.content.Context contextRequireContext = requireContext();
            kotlin.jvm.internal.Intrinsics.k(contextRequireContext, "requireContext(...)");
            com.vinfast.companion.core.base.ui.widget.VFToastKt.c(contextRequireContext, i, com.vinfast.companion.core.base.ui.widget.ToastType.BottomFailed, false, 4, null);
            return;
        }
        android.content.Context contextRequireContext2 = requireContext();
        kotlin.jvm.internal.Intrinsics.k(contextRequireContext2, "requireContext(...)");
        com.vinfast.companion.core.base.ui.widget.VFToastKt.c(contextRequireContext2, i, com.vinfast.companion.core.base.ui.widget.ToastType.BottomSuccess, false, 4, null);
        androidx.navigation.NavBackStackEntry navBackStackEntryC = androidx.navigation.fragment.FragmentKt.a(this).C();
        if (navBackStackEntryC != null && (savedStateHandleJ = navBackStackEntryC.j()) != null) {
            savedStateHandleJ.i("key_update_license_plate", result);
        }
        androidx.navigation.fragment.FragmentKt.a(this).X();
    }

    private final void o2() {
        java.lang.String textInputTrim = ((com.vinfast.vehicle.databinding.FragmentEditLicensePlateBinding) T1()).d.getTextInputTrim();
        com.vinfast.companion.core.base.ui.widget.CustomEditTextItem customEditTextItem = ((com.vinfast.vehicle.databinding.FragmentEditLicensePlateBinding) T1()).d;
        kotlin.jvm.internal.Intrinsics.k(customEditTextItem, "inputLicensePlate");
        com.vinfast.companion.core.extensions.ViewExtensionKt.s(customEditTextItem);
        if (this.oldData.length() <= 0 || !kotlin.jvm.internal.Intrinsics.g(textInputTrim, this.oldData)) {
            e2().M(textInputTrim, kotlin.jvm.internal.Intrinsics.g(textInputTrim, this.dmsData) && this.dmsData.length() > 0);
        } else {
            androidx.navigation.fragment.FragmentKt.a(this).X();
        }
    }

    /* JADX INFO: Thrown type has an unknown type hierarchy: kotlin.UninitializedPropertyAccessException */
    @Override // com.vinfast.companion.core.base.fragment.BaseFragment
    public void I0(com.vinfast.companion.core.base.ViewModelState.Error error) throws kotlin.UninitializedPropertyAccessException {
        kotlin.jvm.internal.Intrinsics.l(error, "error");
        java.lang.String code = error.getCode();
        if (kotlin.jvm.internal.Intrinsics.g(code, "offline") || kotlin.jvm.internal.Intrinsics.g(code, "timeout")) {
            super.I0(error);
            return;
        }
        android.content.Context contextRequireContext = requireContext();
        kotlin.jvm.internal.Intrinsics.k(contextRequireContext, "requireContext(...)");
        com.vinfast.companion.core.base.ui.widget.VFToastKt.c(contextRequireContext, com.vinfast.vehicle.R.string.CA20801_falied_to_add, com.vinfast.companion.core.base.ui.widget.ToastType.BottomFailed, false, 4, null);
    }

    @Override // com.vinfast.companion.core.base.fragment.BaseFragment
    public com.vinfast.companion.core.base.fragment.ToolbarConfiguration T0() {
        return com.vinfast.companion.core.base.fragment.ToolbarConfiguration.Builder.z(new com.vinfast.companion.core.base.fragment.ToolbarConfiguration.Builder().s(true).t(false), false, 0, 2, null).a();
    }

    @Override // com.vinfast.companion.core.base.fragment.BaseFragment
    public com.vinfast.companion.core.base.BaseViewModel U1() {
        return e2();
    }

    @Override // com.vinfast.companion.core.base.fragment.BaseFragment
    public void y1(android.view.View view, android.os.Bundle savedInstanceState) {
        kotlin.jvm.internal.Intrinsics.l(view, "view");
        i2();
        f2();
    }
}
