package com.vinfast.companion.main.ui.booking.locationstep;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes3.dex */
@dagger.hilt.android.lifecycle.HiltViewModel
@kotlin.Metadata(d1 = {"\u0000\u0090\u0001\n\u0002\u0018\u0002\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\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0011\n\u0002\u0010\b\n\u0002\b\r\n\u0002\u0018\u0002\n\u0002\u0010\u0006\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0011\n\u0002\u0018\u0002\n\u0002\b\u0016\n\u0002\u0018\u0002\n\u0002\b\u0019\b\u0007\u0018\u0000 \u0085\u00012\u00020\u0001:\u0002\u0086\u0001B)\b\u0007\u0012\u0006\u0010\u0003\u001a\u00020\u0002\u0012\u0006\u0010\u0005\u001a\u00020\u0004\u0012\u0006\u0010\u0007\u001a\u00020\u0006\u0012\u0006\u0010\t\u001a\u00020\b¢\u0006\u0004\b\n\u0010\u000bJ\u001f\u0010\u0011\u001a\u00020\u00102\u0006\u0010\r\u001a\u00020\f2\u0006\u0010\u000f\u001a\u00020\u000eH\u0002¢\u0006\u0004\b\u0011\u0010\u0012J'\u0010\u0015\u001a\u00020\u00102\u0006\u0010\u0014\u001a\u00020\u00132\u0006\u0010\r\u001a\u00020\f2\u0006\u0010\u000f\u001a\u00020\u000eH\u0002¢\u0006\u0004\b\u0015\u0010\u0016J\u001f\u0010\u0017\u001a\u00020\u00102\u0006\u0010\r\u001a\u00020\f2\u0006\u0010\u000f\u001a\u00020\u000eH\u0002¢\u0006\u0004\b\u0017\u0010\u0012J'\u0010\u0018\u001a\u00020\u00102\u0006\u0010\u0014\u001a\u00020\u00132\u0006\u0010\r\u001a\u00020\f2\u0006\u0010\u000f\u001a\u00020\u000eH\u0002¢\u0006\u0004\b\u0018\u0010\u0016J\u000f\u0010\u0019\u001a\u00020\u0010H\u0002¢\u0006\u0004\b\u0019\u0010\u001aJ\u000f\u0010\u001b\u001a\u00020\u0010H\u0002¢\u0006\u0004\b\u001b\u0010\u001aJ!\u0010 \u001a\u00020\u000e2\b\u0010\u001d\u001a\u0004\u0018\u00010\u001c2\u0006\u0010\u001f\u001a\u00020\u001eH\u0002¢\u0006\u0004\b \u0010!J)\u0010\"\u001a\u00020\u000e2\u0006\u0010\u0014\u001a\u00020\u00132\b\u0010\u001d\u001a\u0004\u0018\u00010\u001c2\u0006\u0010\u001f\u001a\u00020\u001eH\u0002¢\u0006\u0004\b\"\u0010#J\u0017\u0010$\u001a\u00020\u00102\u0006\u0010\r\u001a\u00020\fH\u0002¢\u0006\u0004\b$\u0010%J\u0017\u0010&\u001a\u00020\u00102\u0006\u0010\u0014\u001a\u00020\u0013H\u0002¢\u0006\u0004\b&\u0010'J\u000f\u0010(\u001a\u00020\u0010H\u0002¢\u0006\u0004\b(\u0010\u001aJ+\u0010,\u001a\b\u0012\u0004\u0012\u00020*0)2\f\u0010+\u001a\b\u0012\u0004\u0012\u00020*0)2\u0006\u0010\u0014\u001a\u00020\u0013H\u0002¢\u0006\u0004\b,\u0010-J\u0017\u00100\u001a\n\u0012\u0004\u0012\u00020/\u0018\u00010.H\u0002¢\u0006\u0004\b0\u00101J\u001f\u00104\u001a\u00020\u00102\u0006\u00102\u001a\u00020*2\u0006\u00103\u001a\u00020/H\u0002¢\u0006\u0004\b4\u00105J\u001f\u00106\u001a\u00020\u00102\u0006\u00102\u001a\u00020*2\u0006\u00103\u001a\u00020/H\u0002¢\u0006\u0004\b6\u00105J\u000f\u00107\u001a\u00020\u0010H\u0002¢\u0006\u0004\b7\u0010\u001aJ\u0017\u00108\u001a\u00020\u00102\u0006\u0010\u0014\u001a\u00020\u0013H\u0016¢\u0006\u0004\b8\u0010'J\u0017\u00109\u001a\u00020\u00102\u0006\u0010\u0014\u001a\u00020\u0013H\u0016¢\u0006\u0004\b9\u0010'J\u0017\u0010:\u001a\u00020\u00102\u0006\u0010\u0014\u001a\u00020\u0013H\u0016¢\u0006\u0004\b:\u0010'J\u000f\u0010;\u001a\u00020\u0010H\u0016¢\u0006\u0004\b;\u0010\u001aJ\r\u0010<\u001a\u00020\u0010¢\u0006\u0004\b<\u0010\u001aJ\u001d\u0010?\u001a\u0012\u0012\u0006\u0012\u0004\u0018\u00010>\u0012\u0006\u0012\u0004\u0018\u00010>0=¢\u0006\u0004\b?\u0010@J\u0017\u0010C\u001a\u00020\u00102\b\u0010B\u001a\u0004\u0018\u00010A¢\u0006\u0004\bC\u0010DJ\u0017\u0010G\u001a\u00020\u00102\b\u0010F\u001a\u0004\u0018\u00010E¢\u0006\u0004\bG\u0010HJ\u0015\u0010I\u001a\u00020\u00102\u0006\u00103\u001a\u00020/¢\u0006\u0004\bI\u0010JJ\u0015\u0010K\u001a\u00020\u00102\u0006\u00103\u001a\u00020/¢\u0006\u0004\bK\u0010JJ\u0015\u0010M\u001a\u00020\u00102\u0006\u0010L\u001a\u00020\u001e¢\u0006\u0004\bM\u0010NJ\r\u0010O\u001a\u00020\u0010¢\u0006\u0004\bO\u0010\u001aJ\r\u0010P\u001a\u00020\u0010¢\u0006\u0004\bP\u0010\u001aR\u0014\u0010\u0005\u001a\u00020\u00048\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\bQ\u0010RR\u0014\u0010\u0007\u001a\u00020\u00068\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\bS\u0010TR\u0014\u0010\t\u001a\u00020\b8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\bU\u0010VR \u0010Z\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020*0)0W8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\bX\u0010YR\u001c\u0010\\\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u001e0W8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b[\u0010YR\u001c\u0010^\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010*0W8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b]\u0010YR\u001c\u0010`\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010A0W8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b_\u0010YR\u001c\u0010b\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010E0W8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\ba\u0010YR\u001a\u0010d\u001a\b\u0012\u0004\u0012\u00020/0W8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\bc\u0010YR\u001a\u0010f\u001a\b\u0012\u0004\u0012\u00020\u00100W8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\be\u0010YR\u001a\u0010h\u001a\b\u0012\u0004\u0012\u00020\u00100W8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\bg\u0010YR\u001a\u0010j\u001a\b\u0012\u0004\u0012\u00020\u00100W8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\bi\u0010YR\u0016\u0010m\u001a\u00020\u000e8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bk\u0010lR\u001d\u0010q\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020*0)0n8F¢\u0006\u0006\u001a\u0004\bo\u0010pR\u0019\u0010s\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u001e0n8F¢\u0006\u0006\u001a\u0004\br\u0010pR\u0019\u0010u\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010*0n8F¢\u0006\u0006\u001a\u0004\bt\u0010pR\u0019\u0010w\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010A0n8F¢\u0006\u0006\u001a\u0004\bv\u0010pR\u0019\u0010y\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010E0n8F¢\u0006\u0006\u001a\u0004\bx\u0010pR\u0017\u0010{\u001a\b\u0012\u0004\u0012\u00020/0n8F¢\u0006\u0006\u001a\u0004\bz\u0010pR\u0017\u0010}\u001a\b\u0012\u0004\u0012\u00020\u00100n8F¢\u0006\u0006\u001a\u0004\b|\u0010pR\u0017\u0010\u007f\u001a\b\u0012\u0004\u0012\u00020\u00100n8F¢\u0006\u0006\u001a\u0004\b~\u0010pR\u0019\u0010\u0081\u0001\u001a\b\u0012\u0004\u0012\u00020\u00100n8F¢\u0006\u0007\u001a\u0005\b\u0080\u0001\u0010pR\u0014\u0010\u0084\u0001\u001a\u00020\u000e8F¢\u0006\b\u001a\u0006\b\u0082\u0001\u0010\u0083\u0001¨\u0006\u0087\u0001"}, d2 = {"Lcom/vinfast/companion/main/ui/booking/locationstep/LocationStepViewModel;", "Lcom/vinfast/companion/main/ui/booking/BaseStepViewModel;", "Lcom/vinfast/companion/serviceskit/manager/IBookingServiceManager;", "bookingServiceManager", "Lcom/vinfast/companion/vehiclekit/data/manager/IVehicleComponentManager;", "vehicleComponentManager", "Lcom/vinfast/companion/vehiclekit/data/manager/IVehicleManager;", "vehicleManager", "Lcom/vinfast/companion/map/manager/IFavoritePlaceManager;", "favoritePlaceManager", "<init>", "(Lcom/vinfast/companion/serviceskit/manager/IBookingServiceManager;Lcom/vinfast/companion/vehiclekit/data/manager/IVehicleComponentManager;Lcom/vinfast/companion/vehiclekit/data/manager/IVehicleManager;Lcom/vinfast/companion/map/manager/IFavoritePlaceManager;)V", "Lcom/vinfast/companion/serviceskit/domain/model/Service$Type;", "serviceType", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "isTheFirstTimeStart", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "Z0", "(Lcom/vinfast/companion/serviceskit/domain/model/Service$Type;Z)V", "Lcom/vinfast/companion/serviceskit/domain/model/ScheduleFlow;", "flow", "a1", "(Lcom/vinfast/companion/serviceskit/domain/model/ScheduleFlow;Lcom/vinfast/companion/serviceskit/domain/model/Service$Type;Z)V", "X0", "Y0", "U0", "()V", "T0", "Lcom/vinfast/companion/serviceskit/domain/model/BookingServiceInfo$Location;", "oldLocationInfo", "Lcom/vinfast/companion/map/model/MapLocation;", "newLocationInfo", "L0", "(Lcom/vinfast/companion/serviceskit/domain/model/BookingServiceInfo$Location;Lcom/vinfast/companion/map/model/MapLocation;)Z", "N0", "(Lcom/vinfast/companion/serviceskit/domain/model/ScheduleFlow;Lcom/vinfast/companion/serviceskit/domain/model/BookingServiceInfo$Location;Lcom/vinfast/companion/map/model/MapLocation;)Z", "I0", "(Lcom/vinfast/companion/serviceskit/domain/model/Service$Type;)V", "H0", "(Lcom/vinfast/companion/serviceskit/domain/model/ScheduleFlow;)V", "G0", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "Lcom/vinfast/companion/serviceskit/domain/model/ServiceCenter;", "supportedServiceCenters", "m0", "(Ljava/util/List;Lcom/vinfast/companion/serviceskit/domain/model/ScheduleFlow;)Ljava/util/List;", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "u0", "()[Ljava/lang/Integer;", "serviceCenter", "position", "J0", "(Lcom/vinfast/companion/serviceskit/domain/model/ServiceCenter;I)V", "q0", "p0", "U", "T", "S0", "W0", "z0", "Lkotlin/Pair;", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "F0", "()Lkotlin/Pair;", "Lcom/vinfast/companion/serviceskit/domain/model/Province;", "selectedProvince", "V0", "(Lcom/vinfast/companion/serviceskit/domain/model/Province;)V", "Lcom/vinfast/companion/serviceskit/domain/model/District;", "selectedDistrict", "R0", "(Lcom/vinfast/companion/serviceskit/domain/model/District;)V", "Q0", "(I)V", "P0", "mapLocation", "b1", "(Lcom/vinfast/companion/map/model/MapLocation;)V", "O0", "o0", "t", "Lcom/vinfast/companion/vehiclekit/data/manager/IVehicleComponentManager;", "u", "Lcom/vinfast/companion/vehiclekit/data/manager/IVehicleManager;", "v", "Lcom/vinfast/companion/map/manager/IFavoritePlaceManager;", "Landroidx/lifecycle/MutableLiveData;", "w", "Landroidx/lifecycle/MutableLiveData;", "_serviceCenterLiveData", "x", "_userLocationLiveData", "y", "_selectedServiceCenterLiveData", "z", "_selectedProvinceLiveData", "A", "_selectedDistrictLiveData", "B", "_updateFavoriteStateLiveData", "C", "_showDialogMobileServiceNotAvailable", "D", "_navigateToPickLocationLiveData", "E", "_showDialogConfirmChangeMobileServiceAddressLiveData", "F", "Z", "hasVehicleLocation", "Landroidx/lifecycle/LiveData;", "y0", "()Landroidx/lifecycle/LiveData;", "serviceCenterLiveData", "D0", "userLocationLiveData", "x0", "selectedServiceCenterLiveData", "w0", "selectedProvinceLiveData", "v0", "selectedDistrictLiveData", "C0", "updateFavoriteStateLiveData", "B0", "showDialogMobileServiceNotAvailable", "t0", "navigateToPickLocationLiveData", "A0", "showDialogConfirmChangeMobileServiceAddressLiveData", "M0", "()Z", "isPickUpMyCarSupported", "G", "Companion", "services_release"}, k = 1, mv = {2, 2, 0}, xi = 48)
@kotlin.jvm.internal.SourceDebugExtension
public final class LocationStepViewModel extends com.vinfast.companion.main.ui.booking.BaseStepViewModel {

    /* JADX INFO: renamed from: A, reason: from kotlin metadata */
    private final androidx.lifecycle.MutableLiveData _selectedDistrictLiveData;

    /* JADX INFO: renamed from: B, reason: from kotlin metadata */
    private final androidx.lifecycle.MutableLiveData _updateFavoriteStateLiveData;

    /* JADX INFO: renamed from: C, reason: from kotlin metadata */
    private final androidx.lifecycle.MutableLiveData _showDialogMobileServiceNotAvailable;

    /* JADX INFO: renamed from: D, reason: from kotlin metadata */
    private final androidx.lifecycle.MutableLiveData _navigateToPickLocationLiveData;

    /* JADX INFO: renamed from: E, reason: from kotlin metadata */
    private final androidx.lifecycle.MutableLiveData _showDialogConfirmChangeMobileServiceAddressLiveData;

    /* JADX INFO: renamed from: F, reason: from kotlin metadata */
    private boolean hasVehicleLocation;

    /* JADX INFO: renamed from: t, reason: from kotlin metadata */
    private final com.vinfast.companion.vehiclekit.data.manager.IVehicleComponentManager vehicleComponentManager;

    /* JADX INFO: renamed from: u, reason: from kotlin metadata */
    private final com.vinfast.companion.vehiclekit.data.manager.IVehicleManager vehicleManager;

    /* JADX INFO: renamed from: v, reason: from kotlin metadata */
    private final com.vinfast.companion.map.manager.IFavoritePlaceManager favoritePlaceManager;

    /* JADX INFO: renamed from: w, reason: from kotlin metadata */
    private final androidx.lifecycle.MutableLiveData _serviceCenterLiveData;

    /* JADX INFO: renamed from: x, reason: from kotlin metadata */
    private final androidx.lifecycle.MutableLiveData _userLocationLiveData;

    /* JADX INFO: renamed from: y, reason: from kotlin metadata */
    private final androidx.lifecycle.MutableLiveData _selectedServiceCenterLiveData;

    /* JADX INFO: renamed from: z, reason: from kotlin metadata */
    private final androidx.lifecycle.MutableLiveData _selectedProvinceLiveData;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public LocationStepViewModel(com.vinfast.companion.serviceskit.manager.IBookingServiceManager iBookingServiceManager, com.vinfast.companion.vehiclekit.data.manager.IVehicleComponentManager iVehicleComponentManager, com.vinfast.companion.vehiclekit.data.manager.IVehicleManager iVehicleManager, com.vinfast.companion.map.manager.IFavoritePlaceManager iFavoritePlaceManager) {
        super(iBookingServiceManager);
        kotlin.jvm.internal.Intrinsics.l(iBookingServiceManager, "bookingServiceManager");
        kotlin.jvm.internal.Intrinsics.l(iVehicleComponentManager, "vehicleComponentManager");
        kotlin.jvm.internal.Intrinsics.l(iVehicleManager, "vehicleManager");
        kotlin.jvm.internal.Intrinsics.l(iFavoritePlaceManager, "favoritePlaceManager");
        this.vehicleComponentManager = iVehicleComponentManager;
        this.vehicleManager = iVehicleManager;
        this.favoritePlaceManager = iFavoritePlaceManager;
        this._serviceCenterLiveData = new androidx.lifecycle.MutableLiveData();
        this._userLocationLiveData = new androidx.lifecycle.MutableLiveData();
        this._selectedServiceCenterLiveData = new androidx.lifecycle.MutableLiveData();
        this._selectedProvinceLiveData = new androidx.lifecycle.MutableLiveData();
        this._selectedDistrictLiveData = new androidx.lifecycle.MutableLiveData();
        this._updateFavoriteStateLiveData = new androidx.lifecycle.MutableLiveData();
        this._showDialogMobileServiceNotAvailable = new androidx.lifecycle.MutableLiveData();
        this._navigateToPickLocationLiveData = new androidx.lifecycle.MutableLiveData();
        this._showDialogConfirmChangeMobileServiceAddressLiveData = new androidx.lifecycle.MutableLiveData();
    }

    private final void G0() {
        com.vinfast.companion.serviceskit.domain.model.BookingServiceInfo.Location locationR = getBookingServiceManager().r();
        if (locationR == null || (locationR instanceof com.vinfast.companion.serviceskit.domain.model.BookingServiceInfo.Location.ServiceCenter)) {
            return;
        }
        java.lang.String strA = locationR.a();
        java.lang.Double dB = locationR.b();
        double dDoubleValue = dB != null ? dB.doubleValue() : -1.0d;
        java.lang.Double d = locationR.d();
        b1(new com.vinfast.companion.map.model.MapLocation((java.lang.String) null, (java.lang.String) null, strA, (java.lang.String) null, (java.lang.String) null, (java.lang.String) null, (java.lang.String) null, (java.lang.String) null, (java.lang.String) null, false, dDoubleValue, d != null ? d.doubleValue() : -1.0d, (java.lang.Double) null, (java.lang.Integer) null, (java.lang.Integer) null, (java.util.List) null, (java.lang.Double) null, (com.vinfast.companion.map.model.MapLocationCategory) null, (java.lang.String) null, (java.lang.String) null, (java.lang.String) null, (java.lang.String) null, (java.lang.String) null, 8385531, (kotlin.jvm.internal.DefaultConstructorMarker) null));
    }

    /* JADX INFO: Thrown type has an unknown type hierarchy: kotlin.NoWhenBranchMatchedException */
    private final void H0(com.vinfast.companion.serviceskit.domain.model.ScheduleFlow flow) throws kotlin.NoWhenBranchMatchedException {
        com.vinfast.companion.serviceskit.domain.model.Appointment appointmentD;
        com.vinfast.companion.serviceskit.domain.model.ServiceCenter serviceCenterK;
        com.vinfast.companion.serviceskit.domain.model.ServiceCenter serviceCenterK2;
        com.vinfast.companion.serviceskit.domain.model.ServiceCenter serviceCenterK3;
        com.vinfast.companion.serviceskit.domain.model.ServiceCenter serviceCenterK4;
        com.vinfast.companion.serviceskit.domain.model.ServiceCenter serviceCenterK5;
        if ((flow instanceof com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.ServiceCreate) || (flow instanceof com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.VehicleAlertCreate) || (flow instanceof com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.MaintenanceCreate)) {
            return;
        }
        if (flow instanceof com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.MapCreate) {
            if (this._selectedProvinceLiveData.f() == null && this._selectedDistrictLiveData.f() == null) {
                com.vinfast.companion.serviceskit.domain.model.ServiceCenter serviceCenterD = ((com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.MapCreate) flow).d();
                this._selectedProvinceLiveData.q(serviceCenterD.d());
                this._selectedDistrictLiveData.q(serviceCenterD.c());
                return;
            }
            return;
        }
        boolean z = flow instanceof com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.ServiceDuplicate;
        if (!z && !(flow instanceof com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.ServiceReschedule)) {
            throw new kotlin.NoWhenBranchMatchedException();
        }
        java.lang.String strV = null;
        com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.ServiceReschedule serviceReschedule = flow instanceof com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.ServiceReschedule ? (com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.ServiceReschedule) flow : null;
        if (serviceReschedule == null || (appointmentD = serviceReschedule.d()) == null) {
            com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.ServiceDuplicate serviceDuplicate = z ? (com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.ServiceDuplicate) flow : null;
            appointmentD = serviceDuplicate != null ? serviceDuplicate.d() : null;
        }
        com.vinfast.companion.serviceskit.domain.model.Province province = new com.vinfast.companion.serviceskit.domain.model.Province();
        province.f((appointmentD == null || (serviceCenterK5 = appointmentD.k()) == null) ? null : serviceCenterK5.v());
        province.g((appointmentD == null || (serviceCenterK4 = appointmentD.k()) == null) ? null : serviceCenterK4.w());
        this._selectedProvinceLiveData.q(province);
        com.vinfast.companion.serviceskit.domain.model.District district = new com.vinfast.companion.serviceskit.domain.model.District();
        district.f((appointmentD == null || (serviceCenterK3 = appointmentD.k()) == null) ? null : serviceCenterK3.h());
        district.g((appointmentD == null || (serviceCenterK2 = appointmentD.k()) == null) ? null : serviceCenterK2.j());
        if (appointmentD != null && (serviceCenterK = appointmentD.k()) != null) {
            strV = serviceCenterK.v();
        }
        district.k(strV);
        this._selectedDistrictLiveData.q(district);
    }

    private final void I0(com.vinfast.companion.serviceskit.domain.model.Service.Type serviceType) {
        get_serviceTypeLiveData().q(serviceType);
    }

    private final void J0(final com.vinfast.companion.serviceskit.domain.model.ServiceCenter serviceCenter, final int position) {
        io.reactivex.rxjava3.core.Single singleI = this.favoritePlaceManager.t0(serviceCenter.l(), serviceCenter.z(), serviceCenter.A(), serviceCenter.f(), java.lang.Double.valueOf(serviceCenter.o()), java.lang.Double.valueOf(serviceCenter.p()), com.vinfast.companion.map.model.MapLocationCategory.SERVICE_CENTRE, com.vinfast.companion.map.model.FavoriteType.Other.c).l(new io.reactivex.rxjava3.functions.Consumer() { // from class: com.vinfast.companion.main.ui.booking.locationstep.LocationStepViewModel$insertFavoritePlace$1
            /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
            public final void accept(io.reactivex.rxjava3.disposables.Disposable disposable) {
                kotlin.jvm.internal.Intrinsics.l(disposable, "it");
                this.a.F(com.vinfast.companion.core.base.ProgressType.ProgressDialog.b);
            }
        }).i(new io.reactivex.rxjava3.functions.Action() { // from class: com.vinfast.companion.main.ui.booking.locationstep.d0
            public final void run() {
                com.vinfast.companion.main.ui.booking.locationstep.LocationStepViewModel.K0(this.a);
            }
        });
        kotlin.jvm.internal.Intrinsics.k(singleI, "doFinally(...)");
        io.reactivex.rxjava3.disposables.Disposable disposableZ = com.vinfast.companion.core.extensions.RxExtensionKt.C(singleI).z(new io.reactivex.rxjava3.functions.Consumer() { // from class: com.vinfast.companion.main.ui.booking.locationstep.LocationStepViewModel$insertFavoritePlace$3
            /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
            public final void accept(com.vinfast.companion.map.model.FavoritePlace favoritePlace) {
                kotlin.jvm.internal.Intrinsics.l(favoritePlace, "favoritePlace");
                serviceCenter.J(true);
                serviceCenter.K(favoritePlace.e());
                this._updateFavoriteStateLiveData.n(java.lang.Integer.valueOf(position));
            }
        }, new io.reactivex.rxjava3.functions.Consumer() { // from class: com.vinfast.companion.main.ui.booking.locationstep.LocationStepViewModel$insertFavoritePlace$4
            /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
            public final void accept(java.lang.Throwable th) {
                kotlin.jvm.internal.Intrinsics.l(th, "error");
                com.vinfast.companion.core.base.BaseViewModel.v(this.a, th, false, 2, (java.lang.Object) null);
            }
        });
        kotlin.jvm.internal.Intrinsics.k(disposableZ, "subscribe(...)");
        com.vinfast.companion.core.extensions.RxExtensionKt.k(disposableZ, s());
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void K0(com.vinfast.companion.main.ui.booking.locationstep.LocationStepViewModel locationStepViewModel) {
        locationStepViewModel.w();
    }

    private final boolean L0(com.vinfast.companion.serviceskit.domain.model.BookingServiceInfo.Location oldLocationInfo, com.vinfast.companion.map.model.MapLocation newLocationInfo) {
        return kotlin.jvm.internal.Intrinsics.a(newLocationInfo.t(), oldLocationInfo != null ? oldLocationInfo.b() : null) && kotlin.jvm.internal.Intrinsics.a(newLocationInfo.w(), oldLocationInfo.d()) && kotlin.jvm.internal.Intrinsics.g(newLocationInfo.d(), oldLocationInfo.a());
    }

    private final boolean N0(com.vinfast.companion.serviceskit.domain.model.ScheduleFlow flow, com.vinfast.companion.serviceskit.domain.model.BookingServiceInfo.Location oldLocationInfo, com.vinfast.companion.map.model.MapLocation newLocationInfo) {
        if (!(flow instanceof com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.ServiceReschedule)) {
            return false;
        }
        if ((oldLocationInfo != null ? oldLocationInfo.b() : null) == null) {
            if ((oldLocationInfo != null ? oldLocationInfo.d() : null) == null && newLocationInfo.t() == -1.0d && newLocationInfo.w() == -1.0d) {
                return true;
            }
        }
        return false;
    }

    private final void T0() {
        com.vinfast.companion.map.model.MapLocation mapLocation = (com.vinfast.companion.map.model.MapLocation) this._userLocationLiveData.f();
        if (mapLocation == null) {
            return;
        }
        java.lang.String strD = mapLocation.d();
        if (strD == null) {
            strD = okhttp3.HttpUrl.FRAGMENT_ENCODE_SET;
        }
        java.lang.String str = strD;
        double dT = mapLocation.t();
        double dW = mapLocation.w();
        com.vinfast.companion.serviceskit.domain.model.BookingServiceInfo.Location locationR = getBookingServiceManager().r();
        if (L0(locationR, mapLocation) || N0(getMFlow(), locationR, mapLocation)) {
            getNavigateToNextStepTrigger().q(locationR);
        } else {
            kotlinx.coroutines.BuildersKt.d(androidx.lifecycle.ViewModelKt.a(this), (kotlin.coroutines.CoroutineContext) null, (kotlinx.coroutines.CoroutineStart) null, new com.vinfast.companion.main.ui.booking.locationstep.LocationStepViewModel$onFinishStepMobileService$1(this, mapLocation, str, dT, dW, null), 3, (java.lang.Object) null);
        }
    }

    private final void U0() {
        java.lang.String strW;
        java.lang.String strJ;
        com.vinfast.companion.serviceskit.domain.model.ServiceCenter serviceCenter = (com.vinfast.companion.serviceskit.domain.model.ServiceCenter) this._selectedServiceCenterLiveData.f();
        if (serviceCenter == null) {
            return;
        }
        com.vinfast.companion.core.extensions.SingleLiveData navigateToNextStepTrigger = getNavigateToNextStepTrigger();
        com.vinfast.companion.serviceskit.domain.model.BookingServiceInfo.Location.ServiceCenter serviceCenter2 = new com.vinfast.companion.serviceskit.domain.model.BookingServiceInfo.Location.ServiceCenter(serviceCenter, this.hasVehicleLocation);
        com.vinfast.companion.serviceskit.domain.model.Province province = (com.vinfast.companion.serviceskit.domain.model.Province) this._selectedProvinceLiveData.f();
        if (province == null || (strW = province.c()) == null) {
            strW = serviceCenter.w();
        }
        serviceCenter2.j(strW);
        com.vinfast.companion.serviceskit.domain.model.District district = (com.vinfast.companion.serviceskit.domain.model.District) this._selectedDistrictLiveData.f();
        if (district == null || (strJ = district.c()) == null) {
            strJ = serviceCenter.j();
        }
        serviceCenter2.k(strJ);
        navigateToNextStepTrigger.q(serviceCenter2);
    }

    private final void X0(com.vinfast.companion.serviceskit.domain.model.Service.Type serviceType, boolean isTheFirstTimeStart) {
        I0(serviceType);
        if (isTheFirstTimeStart) {
            G0();
        }
        p0();
    }

    /* JADX INFO: Thrown type has an unknown type hierarchy: kotlin.NoWhenBranchMatchedException */
    private final void Y0(com.vinfast.companion.serviceskit.domain.model.ScheduleFlow flow, com.vinfast.companion.serviceskit.domain.model.Service.Type serviceType, boolean isTheFirstTimeStart) throws kotlin.NoWhenBranchMatchedException {
        I0(serviceType);
        if (isTheFirstTimeStart) {
            H0(flow);
            z0();
        }
        p0();
    }

    private final void Z0(com.vinfast.companion.serviceskit.domain.model.Service.Type serviceType, boolean isTheFirstTimeStart) {
        if (isTheFirstTimeStart) {
            I0(serviceType);
            G0();
        }
        p0();
    }

    /* JADX INFO: Thrown type has an unknown type hierarchy: kotlin.NoWhenBranchMatchedException */
    private final void a1(com.vinfast.companion.serviceskit.domain.model.ScheduleFlow flow, com.vinfast.companion.serviceskit.domain.model.Service.Type serviceType, boolean isTheFirstTimeStart) throws kotlin.NoWhenBranchMatchedException {
        if (isTheFirstTimeStart) {
            I0(serviceType);
            H0(flow);
            z0();
            p0();
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* JADX INFO: Thrown type has an unknown type hierarchy: kotlin.NoWhenBranchMatchedException */
    public final java.util.List m0(java.util.List supportedServiceCenters, com.vinfast.companion.serviceskit.domain.model.ScheduleFlow flow) throws kotlin.NoWhenBranchMatchedException {
        com.vinfast.companion.serviceskit.domain.model.Appointment appointmentD;
        com.vinfast.companion.serviceskit.domain.model.ServiceCenter serviceCenterK;
        com.vinfast.companion.serviceskit.domain.model.Service.Type typeS;
        if ((flow instanceof com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.ServiceCreate) || (flow instanceof com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.VehicleAlertCreate) || (flow instanceof com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.MaintenanceCreate)) {
            return supportedServiceCenters;
        }
        if (flow instanceof com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.MapCreate) {
            java.util.ArrayList arrayList = new java.util.ArrayList(supportedServiceCenters);
            java.util.Iterator it = supportedServiceCenters.iterator();
            int i = 0;
            while (true) {
                if (!it.hasNext()) {
                    i = -1;
                    break;
                }
                if (kotlin.jvm.internal.Intrinsics.g(((com.vinfast.companion.serviceskit.domain.model.ServiceCenter) it.next()).y(), ((com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.MapCreate) flow).d().y())) {
                    break;
                }
                i++;
            }
            if (i != -1) {
                arrayList.add(0, (com.vinfast.companion.serviceskit.domain.model.ServiceCenter) arrayList.remove(i));
            }
            return arrayList;
        }
        boolean z = flow instanceof com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.ServiceReschedule;
        if (!z && !(flow instanceof com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.ServiceDuplicate)) {
            throw new kotlin.NoWhenBranchMatchedException();
        }
        com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.ServiceReschedule serviceReschedule = z ? (com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.ServiceReschedule) flow : null;
        if (serviceReschedule == null || (appointmentD = serviceReschedule.d()) == null) {
            com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.ServiceDuplicate serviceDuplicate = flow instanceof com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.ServiceDuplicate ? (com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.ServiceDuplicate) flow : null;
            appointmentD = serviceDuplicate != null ? serviceDuplicate.d() : null;
        }
        if (appointmentD != null && (typeS = appointmentD.s()) != null && typeS.b()) {
            return supportedServiceCenters;
        }
        java.util.ArrayList arrayList2 = new java.util.ArrayList(supportedServiceCenters);
        java.util.Iterator it2 = supportedServiceCenters.iterator();
        int i2 = 0;
        while (true) {
            if (!it2.hasNext()) {
                i2 = -1;
                break;
            }
            if (kotlin.jvm.internal.Intrinsics.g(((com.vinfast.companion.serviceskit.domain.model.ServiceCenter) it2.next()).y(), (appointmentD == null || (serviceCenterK = appointmentD.k()) == null) ? null : serviceCenterK.y())) {
                break;
            }
            i2++;
        }
        if (i2 != -1) {
            arrayList2.add(0, (com.vinfast.companion.serviceskit.domain.model.ServiceCenter) arrayList2.remove(i2));
        }
        return arrayList2;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void p0() {
        com.vinfast.companion.serviceskit.domain.model.Service.Type type = (com.vinfast.companion.serviceskit.domain.model.Service.Type) get_serviceTypeLiveData().f();
        if (type == null) {
            get_enableNextButtonLiveData().q(java.lang.Boolean.FALSE);
            return;
        }
        if (type.c()) {
            get_enableNextButtonLiveData().q(java.lang.Boolean.valueOf(this._selectedServiceCenterLiveData.f() != null));
        } else if (type.b()) {
            get_enableNextButtonLiveData().q(java.lang.Boolean.valueOf(this._userLocationLiveData.f() != null));
        }
    }

    private final void q0(final com.vinfast.companion.serviceskit.domain.model.ServiceCenter serviceCenter, final int position) {
        io.reactivex.rxjava3.core.Completable completableO = this.favoritePlaceManager.b(serviceCenter.k()).t(new io.reactivex.rxjava3.functions.Consumer() { // from class: com.vinfast.companion.main.ui.booking.locationstep.LocationStepViewModel$deleteFavoritePlace$1
            /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
            public final void accept(io.reactivex.rxjava3.disposables.Disposable disposable) {
                kotlin.jvm.internal.Intrinsics.l(disposable, "it");
                this.a.F(com.vinfast.companion.core.base.ProgressType.ProgressDialog.b);
            }
        }).o(new io.reactivex.rxjava3.functions.Action() { // from class: com.vinfast.companion.main.ui.booking.locationstep.b0
            public final void run() {
                com.vinfast.companion.main.ui.booking.locationstep.LocationStepViewModel.r0(this.a);
            }
        });
        kotlin.jvm.internal.Intrinsics.k(completableO, "doFinally(...)");
        io.reactivex.rxjava3.disposables.Disposable disposableE = com.vinfast.companion.core.extensions.RxExtensionKt.A(completableO).E(new io.reactivex.rxjava3.functions.Action() { // from class: com.vinfast.companion.main.ui.booking.locationstep.c0
            public final void run() {
                com.vinfast.companion.main.ui.booking.locationstep.LocationStepViewModel.s0(serviceCenter, this, position);
            }
        }, new io.reactivex.rxjava3.functions.Consumer() { // from class: com.vinfast.companion.main.ui.booking.locationstep.LocationStepViewModel$deleteFavoritePlace$4
            /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
            public final void accept(java.lang.Throwable th) {
                kotlin.jvm.internal.Intrinsics.l(th, "error");
                com.vinfast.companion.core.base.BaseViewModel.v(this.a, th, false, 2, (java.lang.Object) null);
            }
        });
        kotlin.jvm.internal.Intrinsics.k(disposableE, "subscribe(...)");
        com.vinfast.companion.core.extensions.RxExtensionKt.k(disposableE, s());
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void r0(com.vinfast.companion.main.ui.booking.locationstep.LocationStepViewModel locationStepViewModel) {
        locationStepViewModel.w();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void s0(com.vinfast.companion.serviceskit.domain.model.ServiceCenter serviceCenter, com.vinfast.companion.main.ui.booking.locationstep.LocationStepViewModel locationStepViewModel, int i) {
        serviceCenter.J(false);
        serviceCenter.K((java.lang.String) null);
        locationStepViewModel._updateFavoriteStateLiveData.n(java.lang.Integer.valueOf(i));
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final java.lang.Integer[] u0() {
        java.util.List listC;
        com.vinfast.companion.serviceskit.domain.model.BookingServiceInfo.Service serviceB = getBookingServiceManager().B();
        if (serviceB == null || (listC = serviceB.c()) == null) {
            return null;
        }
        java.util.ArrayList arrayList = new java.util.ArrayList(kotlin.collections.CollectionsKt.z(listC, 10));
        java.util.Iterator it = listC.iterator();
        while (it.hasNext()) {
            arrayList.add(java.lang.Integer.valueOf(((com.vinfast.companion.serviceskit.domain.model.Service) it.next()).k()));
        }
        return (java.lang.Integer[]) arrayList.toArray(new java.lang.Integer[0]);
    }

    public final androidx.lifecycle.LiveData A0() {
        return this._showDialogConfirmChangeMobileServiceAddressLiveData;
    }

    public final androidx.lifecycle.LiveData B0() {
        return this._showDialogMobileServiceNotAvailable;
    }

    public final androidx.lifecycle.LiveData C0() {
        return this._updateFavoriteStateLiveData;
    }

    public final androidx.lifecycle.LiveData D0() {
        return this._userLocationLiveData;
    }

    public final kotlin.Pair F0() {
        com.vinfast.companion.core.extensions.validity.Validity.Valid validC = this.vehicleComponentManager.B0(com.vinfast.companion.vehiclekit.data.persistent.model.alias.VehicleDeviceKeyAlias.LOCATION_LATITUDE.INSTANCE).c();
        java.lang.Double d = validC instanceof com.vinfast.companion.core.extensions.validity.Validity.Valid ? (java.lang.Double) validC.b() : null;
        com.vinfast.companion.core.extensions.validity.Validity.Valid validC2 = this.vehicleComponentManager.B0(com.vinfast.companion.vehiclekit.data.persistent.model.alias.VehicleDeviceKeyAlias.LOCATION_LONGITUDE.INSTANCE).c();
        return new kotlin.Pair(d, validC2 instanceof com.vinfast.companion.core.extensions.validity.Validity.Valid ? (java.lang.Double) validC2.b() : null);
    }

    public final boolean M0() {
        com.vinfast.companion.core.uiPrototype.base.VehicleType vehicleTypeI;
        com.vinfast.companion.vehiclekit.data.persistent.model.Vehicle vehicle = (com.vinfast.companion.vehiclekit.data.persistent.model.Vehicle) com.vinfast.companion.core.extensions.validity.ValidityExtensionKt.d(this.vehicleManager.o1());
        boolean z = false;
        if (vehicle != null && (vehicleTypeI = vehicle.I()) != null && vehicleTypeI.p()) {
            z = true;
        }
        return !z;
    }

    /* JADX INFO: Thrown type has an unknown type hierarchy: kotlin.NoWhenBranchMatchedException */
    public final void O0() throws kotlin.NoWhenBranchMatchedException {
        com.vinfast.companion.serviceskit.domain.model.ScheduleFlow mFlow = getMFlow();
        if ((mFlow instanceof com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.MapCreate) || (mFlow instanceof com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.ServiceCreate) || (mFlow instanceof com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.VehicleAlertCreate) || (mFlow instanceof com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.MaintenanceCreate) || (mFlow instanceof com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.ServiceDuplicate)) {
            this._navigateToPickLocationLiveData.q(kotlin.Unit.a);
            return;
        }
        if (!(mFlow instanceof com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.ServiceReschedule)) {
            throw new kotlin.NoWhenBranchMatchedException();
        }
        com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.ServiceReschedule mFlow2 = getMFlow();
        kotlin.jvm.internal.Intrinsics.j(mFlow2, "null cannot be cast to non-null type com.vinfast.companion.serviceskit.domain.model.ScheduleFlow.ServiceReschedule");
        com.vinfast.companion.serviceskit.domain.model.Appointment appointmentD = mFlow2.d();
        com.vinfast.companion.map.model.MapLocation mapLocation = (com.vinfast.companion.map.model.MapLocation) this._userLocationLiveData.f();
        com.vinfast.companion.serviceskit.domain.model.Service.Type typeS = appointmentD.s();
        boolean z = false;
        if (typeS != null && typeS.c()) {
            z = true;
        }
        boolean zG = kotlin.jvm.internal.Intrinsics.g(appointmentD.l(), mapLocation != null ? mapLocation.d() : null);
        if (z || !zG) {
            this._navigateToPickLocationLiveData.q(kotlin.Unit.a);
        } else {
            this._showDialogConfirmChangeMobileServiceAddressLiveData.q(kotlin.Unit.a);
        }
    }

    public final void P0(int position) {
        java.util.List list;
        if (this._serviceCenterLiveData.f() != null && (list = (java.util.List) this._serviceCenterLiveData.f()) != null && position >= 0 && position < list.size()) {
            com.vinfast.companion.serviceskit.domain.model.ServiceCenter serviceCenter = (com.vinfast.companion.serviceskit.domain.model.ServiceCenter) list.get(position);
            if (serviceCenter.B()) {
                q0(serviceCenter, position);
            } else {
                J0(serviceCenter, position);
            }
        }
    }

    public final void Q0(int position) {
        java.util.List list;
        if (this._serviceCenterLiveData.f() != null && (list = (java.util.List) this._serviceCenterLiveData.f()) != null && position >= 0 && position < list.size()) {
            this._selectedServiceCenterLiveData.q(list.get(position));
        }
    }

    public final void R0(com.vinfast.companion.serviceskit.domain.model.District selectedDistrict) {
        if (kotlin.jvm.internal.Intrinsics.g(this._selectedDistrictLiveData.f(), selectedDistrict)) {
            return;
        }
        this._selectedDistrictLiveData.q(selectedDistrict);
        z0();
    }

    public void S0(com.vinfast.companion.serviceskit.domain.model.ScheduleFlow flow) {
        kotlin.jvm.internal.Intrinsics.l(flow, "flow");
        com.vinfast.companion.serviceskit.domain.model.Service.Type type = (com.vinfast.companion.serviceskit.domain.model.Service.Type) get_serviceTypeLiveData().f();
        if (kotlin.jvm.internal.Intrinsics.g(type, com.vinfast.companion.serviceskit.domain.model.Service.Type.ServiceCenter.c)) {
            U0();
        } else if (kotlin.jvm.internal.Intrinsics.g(type, com.vinfast.companion.serviceskit.domain.model.Service.Type.MobileService.c)) {
            T0();
        }
    }

    /* JADX INFO: Thrown type has an unknown type hierarchy: kotlin.NoWhenBranchMatchedException */
    @Override // com.vinfast.companion.main.ui.booking.BaseStepViewModel
    public void T(com.vinfast.companion.serviceskit.domain.model.ScheduleFlow flow) throws kotlin.NoWhenBranchMatchedException {
        kotlin.jvm.internal.Intrinsics.l(flow, "flow");
        super.T(flow);
        com.vinfast.companion.serviceskit.domain.model.BookingServiceInfo.Service serviceB = getBookingServiceManager().B();
        com.vinfast.companion.serviceskit.domain.model.Service.Type typeB = serviceB != null ? serviceB.b() : null;
        boolean zS = S();
        if (kotlin.jvm.internal.Intrinsics.g(typeB, com.vinfast.companion.serviceskit.domain.model.Service.Type.MobileService.c)) {
            X0(typeB, zS);
        } else if (kotlin.jvm.internal.Intrinsics.g(typeB, com.vinfast.companion.serviceskit.domain.model.Service.Type.ServiceCenter.c)) {
            Y0(flow, typeB, zS);
        }
    }

    /* JADX INFO: Thrown type has an unknown type hierarchy: kotlin.NoWhenBranchMatchedException */
    @Override // com.vinfast.companion.main.ui.booking.BaseStepViewModel
    public void U(com.vinfast.companion.serviceskit.domain.model.ScheduleFlow flow) throws kotlin.NoWhenBranchMatchedException {
        kotlin.jvm.internal.Intrinsics.l(flow, "flow");
        super.U(flow);
        com.vinfast.companion.serviceskit.domain.model.BookingServiceInfo.Service serviceB = getBookingServiceManager().B();
        com.vinfast.companion.serviceskit.domain.model.Service.Type typeB = serviceB != null ? serviceB.b() : null;
        boolean zS = S();
        if (kotlin.jvm.internal.Intrinsics.g(typeB, com.vinfast.companion.serviceskit.domain.model.Service.Type.MobileService.c)) {
            Z0(typeB, zS);
        } else if (kotlin.jvm.internal.Intrinsics.g(typeB, com.vinfast.companion.serviceskit.domain.model.Service.Type.ServiceCenter.c)) {
            a1(flow, typeB, zS);
        }
    }

    public final void V0(com.vinfast.companion.serviceskit.domain.model.Province selectedProvince) {
        if (kotlin.jvm.internal.Intrinsics.g(this._selectedProvinceLiveData.f(), selectedProvince)) {
            return;
        }
        this._selectedProvinceLiveData.q(selectedProvince);
        com.vinfast.companion.serviceskit.domain.model.District district = (com.vinfast.companion.serviceskit.domain.model.District) this._selectedDistrictLiveData.f();
        if (district != null && (selectedProvince == null || !kotlin.jvm.internal.Intrinsics.g(district.j(), selectedProvince.getId()))) {
            this._selectedDistrictLiveData.q((java.lang.Object) null);
        }
        z0();
    }

    public void W0() {
        if (R()) {
            return;
        }
        V();
        this._userLocationLiveData.q((java.lang.Object) null);
        this._serviceCenterLiveData.q(kotlin.collections.CollectionsKt.o());
        this._selectedServiceCenterLiveData.q((java.lang.Object) null);
        this._selectedProvinceLiveData.q((java.lang.Object) null);
        this._selectedDistrictLiveData.q((java.lang.Object) null);
        getNavigateToNextStepTrigger().q((java.lang.Object) null);
    }

    public final void b1(com.vinfast.companion.map.model.MapLocation mapLocation) {
        kotlin.jvm.internal.Intrinsics.l(mapLocation, "mapLocation");
        this._userLocationLiveData.q(mapLocation);
        p0();
    }

    public final void o0() {
        get_serviceTypeLiveData().q(com.vinfast.companion.serviceskit.domain.model.Service.Type.ServiceCenter.c);
        z0();
    }

    public final androidx.lifecycle.LiveData t0() {
        return this._navigateToPickLocationLiveData;
    }

    public final androidx.lifecycle.LiveData v0() {
        return this._selectedDistrictLiveData;
    }

    public final androidx.lifecycle.LiveData w0() {
        return this._selectedProvinceLiveData;
    }

    public final androidx.lifecycle.LiveData x0() {
        return this._selectedServiceCenterLiveData;
    }

    public final androidx.lifecycle.LiveData y0() {
        return this._serviceCenterLiveData;
    }

    public final void z0() {
        kotlinx.coroutines.BuildersKt.d(androidx.lifecycle.ViewModelKt.a(this), (kotlin.coroutines.CoroutineContext) null, (kotlinx.coroutines.CoroutineStart) null, new com.vinfast.companion.main.ui.booking.locationstep.LocationStepViewModel$getServiceCenters$1(this, null), 3, (java.lang.Object) null);
    }
}
