package com.vinfast.companion.main.ui.gltestdrive.locationstep;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes3.dex */
@kotlin.Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u0001*\u00020\u0002H\n"}, d2 = {"<anonymous>", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "Lkotlinx/coroutines/CoroutineScope;"}, k = 3, mv = {2, 2, 0}, xi = 48)
@kotlin.coroutines.jvm.internal.DebugMetadata(c = "com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1", f = "GlTestDriveLocationStepViewModel.kt", l = {208}, m = "invokeSuspend", v = 1)
@kotlin.jvm.internal.SourceDebugExtension
final class GlTestDriveLocationStepViewModel$getServiceCenters$1 extends kotlin.coroutines.jvm.internal.SuspendLambda implements kotlin.jvm.functions.Function2<kotlinx.coroutines.CoroutineScope, kotlin.coroutines.Continuation<? super kotlin.Unit>, java.lang.Object> {
    java.lang.Object n;
    int o;
    final /* synthetic */ com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel p;
    final /* synthetic */ android.location.Location q;

    /* JADX INFO: renamed from: com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$2, reason: invalid class name */
    /* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
    @kotlin.Metadata(d1 = {"\u0000\u0012\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u0001*\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00040\u00030\u0002H\n"}, d2 = {"<anonymous>", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "Lkotlinx/coroutines/flow/FlowCollector;", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "Lcom/vinfast/companion/serviceskit/domain/model/gltestdrive/GlServiceCenter;"}, k = 3, mv = {2, 2, 0}, xi = 48)
    @kotlin.coroutines.jvm.internal.DebugMetadata(c = "com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$2", f = "GlTestDriveLocationStepViewModel.kt", l = {}, m = "invokeSuspend", v = 1)
    static final class AnonymousClass2 extends kotlin.coroutines.jvm.internal.SuspendLambda implements kotlin.jvm.functions.Function2<kotlinx.coroutines.flow.FlowCollector<? super java.util.List<? extends com.vinfast.companion.serviceskit.domain.model.gltestdrive.GlServiceCenter>>, kotlin.coroutines.Continuation<? super kotlin.Unit>, java.lang.Object> {
        int n;
        final /* synthetic */ com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel o;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        AnonymousClass2(com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel glTestDriveLocationStepViewModel, kotlin.coroutines.Continuation continuation) {
            super(2, continuation);
            this.o = glTestDriveLocationStepViewModel;
        }

        /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
        public final java.lang.Object invoke(kotlinx.coroutines.flow.FlowCollector flowCollector, kotlin.coroutines.Continuation continuation) {
            return create(flowCollector, continuation).invokeSuspend(kotlin.Unit.a);
        }

        public final kotlin.coroutines.Continuation create(java.lang.Object obj, kotlin.coroutines.Continuation continuation) {
            return new com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1.AnonymousClass2(this.o, continuation);
        }

        public final java.lang.Object invokeSuspend(java.lang.Object obj) {
            kotlin.coroutines.intrinsics.IntrinsicsKt.g();
            if (this.n != 0) {
                throw new java.lang.IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            kotlin.ResultKt.b(obj);
            this.o.F(com.vinfast.companion.core.base.ProgressType.ProgressDialog.b);
            return kotlin.Unit.a;
        }
    }

    /* JADX INFO: renamed from: com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$3, reason: invalid class name */
    /* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
    @kotlin.Metadata(d1 = {"\u0000\u0018\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0003\u0010\u0000\u001a\u00020\u0001*\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00040\u00030\u00022\b\u0010\u0005\u001a\u0004\u0018\u00010\u0006H\n"}, d2 = {"<anonymous>", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "Lkotlinx/coroutines/flow/FlowCollector;", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "Lcom/vinfast/companion/serviceskit/domain/model/gltestdrive/GlServiceCenter;", "it", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET}, k = 3, mv = {2, 2, 0}, xi = 48)
    @kotlin.coroutines.jvm.internal.DebugMetadata(c = "com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$3", f = "GlTestDriveLocationStepViewModel.kt", l = {}, m = "invokeSuspend", v = 1)
    static final class AnonymousClass3 extends kotlin.coroutines.jvm.internal.SuspendLambda implements kotlin.jvm.functions.Function3<kotlinx.coroutines.flow.FlowCollector<? super java.util.List<? extends com.vinfast.companion.serviceskit.domain.model.gltestdrive.GlServiceCenter>>, java.lang.Throwable, kotlin.coroutines.Continuation<? super kotlin.Unit>, java.lang.Object> {
        int n;
        final /* synthetic */ com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel o;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        AnonymousClass3(com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel glTestDriveLocationStepViewModel, kotlin.coroutines.Continuation continuation) {
            super(3, continuation);
            this.o = glTestDriveLocationStepViewModel;
        }

        public final java.lang.Object invokeSuspend(java.lang.Object obj) {
            kotlin.coroutines.intrinsics.IntrinsicsKt.g();
            if (this.n != 0) {
                throw new java.lang.IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            kotlin.ResultKt.b(obj);
            this.o.w();
            return kotlin.Unit.a;
        }

        public final java.lang.Object invoke(kotlinx.coroutines.flow.FlowCollector flowCollector, java.lang.Throwable th, kotlin.coroutines.Continuation continuation) {
            return new com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1.AnonymousClass3(this.o, continuation).invokeSuspend(kotlin.Unit.a);
        }
    }

    /* JADX INFO: renamed from: com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$4, reason: invalid class name */
    /* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
    @kotlin.Metadata(d1 = {"\u0000\u0018\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0003\u0010\u0000\u001a\u00020\u0001*\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00040\u00030\u00022\u0006\u0010\u0005\u001a\u00020\u0006H\n"}, d2 = {"<anonymous>", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "Lkotlinx/coroutines/flow/FlowCollector;", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "Lcom/vinfast/companion/serviceskit/domain/model/gltestdrive/GlServiceCenter;", "error", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET}, k = 3, mv = {2, 2, 0}, xi = 48)
    @kotlin.coroutines.jvm.internal.DebugMetadata(c = "com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$4", f = "GlTestDriveLocationStepViewModel.kt", l = {205}, m = "invokeSuspend", v = 1)
    static final class AnonymousClass4 extends kotlin.coroutines.jvm.internal.SuspendLambda implements kotlin.jvm.functions.Function3<kotlinx.coroutines.flow.FlowCollector<? super java.util.List<? extends com.vinfast.companion.serviceskit.domain.model.gltestdrive.GlServiceCenter>>, java.lang.Throwable, kotlin.coroutines.Continuation<? super kotlin.Unit>, java.lang.Object> {
        int n;
        private /* synthetic */ java.lang.Object o;
        /* synthetic */ java.lang.Object p;
        final /* synthetic */ com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel q;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        AnonymousClass4(com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel glTestDriveLocationStepViewModel, kotlin.coroutines.Continuation continuation) {
            super(3, continuation);
            this.q = glTestDriveLocationStepViewModel;
        }

        public final java.lang.Object invokeSuspend(java.lang.Object obj) {
            kotlinx.coroutines.flow.FlowCollector flowCollector = (kotlinx.coroutines.flow.FlowCollector) this.o;
            java.lang.Throwable th = (java.lang.Throwable) this.p;
            java.lang.Object objG = kotlin.coroutines.intrinsics.IntrinsicsKt.g();
            int i = this.n;
            if (i == 0) {
                kotlin.ResultKt.b(obj);
                com.vinfast.companion.core.base.BaseViewModel.v(this.q, th, false, 2, (java.lang.Object) null);
                java.util.Collection collection = (java.util.Collection) this.q._serviceCenterLiveData.f();
                if (collection == null || collection.isEmpty()) {
                    java.util.List listO = kotlin.collections.CollectionsKt.o();
                    this.o = kotlin.coroutines.jvm.internal.SpillingKt.a(flowCollector);
                    this.p = kotlin.coroutines.jvm.internal.SpillingKt.a(th);
                    this.n = 1;
                    if (flowCollector.emit(listO, this) == objG) {
                        return objG;
                    }
                }
            } else {
                if (i != 1) {
                    throw new java.lang.IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                kotlin.ResultKt.b(obj);
            }
            return kotlin.Unit.a;
        }

        public final java.lang.Object invoke(kotlinx.coroutines.flow.FlowCollector flowCollector, java.lang.Throwable th, kotlin.coroutines.Continuation continuation) {
            com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1.AnonymousClass4 anonymousClass4 = new com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1.AnonymousClass4(this.q, continuation);
            anonymousClass4.o = flowCollector;
            anonymousClass4.p = th;
            return anonymousClass4.invokeSuspend(kotlin.Unit.a);
        }
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    GlTestDriveLocationStepViewModel$getServiceCenters$1(com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel glTestDriveLocationStepViewModel, android.location.Location location, kotlin.coroutines.Continuation continuation) {
        super(2, continuation);
        this.p = glTestDriveLocationStepViewModel;
        this.q = location;
    }

    public final kotlin.coroutines.Continuation create(java.lang.Object obj, kotlin.coroutines.Continuation continuation) {
        return new com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1(this.p, this.q, continuation);
    }

    public final java.lang.Object invokeSuspend(java.lang.Object obj) {
        java.lang.Object objG = kotlin.coroutines.intrinsics.IntrinsicsKt.g();
        int i = this.o;
        if (i == 0) {
            kotlin.ResultKt.b(obj);
            java.lang.String strT0 = this.p.t0();
            com.vinfast.companion.serviceskit.manager.ITestDriveBookingManager testDriveBookingManager = this.p.getTestDriveBookingManager();
            android.location.Location location = this.q;
            java.lang.Double dB = location != null ? kotlin.coroutines.jvm.internal.Boxing.b(location.getLatitude()) : null;
            android.location.Location location2 = this.q;
            final kotlinx.coroutines.flow.Flow flowV = testDriveBookingManager.v(strT0, dB, location2 != null ? kotlin.coroutines.jvm.internal.Boxing.b(location2.getLongitude()) : null);
            final com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel glTestDriveLocationStepViewModel = this.p;
            kotlinx.coroutines.flow.Flow flowI = kotlinx.coroutines.flow.FlowKt.i(kotlinx.coroutines.flow.FlowKt.b0(kotlinx.coroutines.flow.FlowKt.d0(kotlinx.coroutines.flow.FlowKt.T(new kotlinx.coroutines.flow.Flow<java.util.List<? extends com.vinfast.companion.serviceskit.domain.model.gltestdrive.GlServiceCenter>>() { // from class: com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1

                /* JADX INFO: renamed from: com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1$2, reason: invalid class name */
                /* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
                @kotlin.Metadata(k = 3, mv = {2, 2, 0}, xi = 48)
                @kotlin.jvm.internal.SourceDebugExtension
                public static final class AnonymousClass2<T> implements kotlinx.coroutines.flow.FlowCollector {
                    final /* synthetic */ kotlinx.coroutines.flow.FlowCollector a;
                    final /* synthetic */ com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel b;

                    /* JADX INFO: renamed from: com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1$2$1, reason: invalid class name */
                    @kotlin.Metadata(k = 3, mv = {2, 2, 0}, xi = 48)
                    @kotlin.coroutines.jvm.internal.DebugMetadata(c = "com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1$2", f = "GlTestDriveLocationStepViewModel.kt", l = {50}, m = "emit", v = 1)
                    public static final class AnonymousClass1 extends kotlin.coroutines.jvm.internal.ContinuationImpl {
                        /* synthetic */ java.lang.Object n;
                        int o;
                        java.lang.Object p;
                        java.lang.Object r;
                        java.lang.Object s;
                        java.lang.Object t;
                        int u;

                        public AnonymousClass1(kotlin.coroutines.Continuation continuation) {
                            super(continuation);
                        }

                        public final java.lang.Object invokeSuspend(java.lang.Object obj) {
                            this.n = obj;
                            this.o |= Integer.MIN_VALUE;
                            return com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1.AnonymousClass2.this.emit(null, this);
                        }
                    }

                    public AnonymousClass2(kotlinx.coroutines.flow.FlowCollector flowCollector, com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel glTestDriveLocationStepViewModel) {
                        this.a = flowCollector;
                        this.b = glTestDriveLocationStepViewModel;
                    }

                    /* JADX INFO: Thrown type has an unknown type hierarchy: kotlin.NoWhenBranchMatchedException */
                    /* JADX WARN: Code duplicated, block: B:7:0x0013  */
                    @Override // kotlinx.coroutines.flow.FlowCollector
                    public final java.lang.Object emit(java.lang.Object obj, kotlin.coroutines.Continuation continuation) throws kotlin.NoWhenBranchMatchedException {
                        com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1.AnonymousClass2.AnonymousClass1 anonymousClass1;
                        if (continuation instanceof com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1.AnonymousClass2.AnonymousClass1) {
                            anonymousClass1 = (com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1.AnonymousClass2.AnonymousClass1) continuation;
                            int i = anonymousClass1.o;
                            if ((i & Integer.MIN_VALUE) != 0) {
                                anonymousClass1.o = i - Integer.MIN_VALUE;
                            } else {
                                anonymousClass1 = new com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1.AnonymousClass2.AnonymousClass1(continuation);
                            }
                        } else {
                            anonymousClass1 = new com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1.AnonymousClass2.AnonymousClass1(continuation);
                        }
                        java.lang.Object obj2 = anonymousClass1.n;
                        java.lang.Object objG = kotlin.coroutines.intrinsics.IntrinsicsKt.g();
                        int i2 = anonymousClass1.o;
                        if (i2 == 0) {
                            kotlin.ResultKt.b(obj2);
                            kotlinx.coroutines.flow.FlowCollector flowCollector = this.a;
                            java.util.List listA1 = kotlin.collections.CollectionsKt.a1((java.util.List) obj, 
                            /*  JADX ERROR: Method code generation error
                                jadx.core.utils.exceptions.CodegenException: Error generate insn: 0x0046: INVOKE (r2v3 'listA1' java.util.List) = 
                                  (wrap java.util.List:0x003f: CHECK_CAST (java.util.List) (r6v0 'obj' java.lang.Object))
                                  (wrap java.util.Comparator:0x0043: CONSTRUCTOR  A[MD:():void (m), WRAPPED] (LINE:68) call: com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$lambda$0$$inlined$sortedByDescending$1.<init>():void type: CONSTRUCTOR)
                                 STATIC call: kotlin.collections.CollectionsKt.a1(java.lang.Iterable, java.util.Comparator):java.util.List A[DECLARE_VAR] (LINE:71) in method: com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1.2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object, file: E:\ios\vf_dex\classes3.dex
                                	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:310)
                                	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:273)
                                	at jadx.core.codegen.RegionGen.makeSimpleBlock(RegionGen.java:94)
                                	at jadx.core.dex.nodes.IBlock.generate(IBlock.java:15)
                                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:66)
                                	at jadx.core.dex.regions.Region.generate(Region.java:35)
                                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:66)
                                	at jadx.core.codegen.RegionGen.makeRegionIndent(RegionGen.java:83)
                                	at jadx.core.codegen.RegionGen.makeIf(RegionGen.java:126)
                                	at jadx.core.dex.regions.conditions.IfRegion.generate(IfRegion.java:90)
                                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:66)
                                	at jadx.core.dex.regions.Region.generate(Region.java:35)
                                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:66)
                                	at jadx.core.codegen.MethodGen.addRegionInsns(MethodGen.java:291)
                                	at jadx.core.codegen.MethodGen.addInstructions(MethodGen.java:270)
                                	at jadx.core.codegen.ClassGen.addMethodCode(ClassGen.java:420)
                                	at jadx.core.codegen.ClassGen.addMethod(ClassGen.java:345)
                                	at jadx.core.codegen.ClassGen.lambda$addInnerClsAndMethods$3(ClassGen.java:299)
                                	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:186)
                                	at java.base/java.util.ArrayList.forEach(ArrayList.java:1612)
                                	at java.base/java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:395)
                                	at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:261)
                                	at java.base/java.util.stream.ReferencePipeline$7$1FlatMap.end(ReferencePipeline.java:284)
                                	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:571)
                                	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
                                	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:153)
                                	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:176)
                                	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
                                	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:632)
                                	at jadx.core.codegen.ClassGen.addInnerClsAndMethods(ClassGen.java:295)
                                	at jadx.core.codegen.ClassGen.addClassBody(ClassGen.java:284)
                                	at jadx.core.codegen.ClassGen.addClassBody(ClassGen.java:268)
                                	at jadx.core.codegen.ClassGen.addClassCode(ClassGen.java:160)
                                	at jadx.core.codegen.ClassGen.addInnerClass(ClassGen.java:320)
                                	at jadx.core.codegen.ClassGen.lambda$addInnerClsAndMethods$3(ClassGen.java:297)
                                	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:186)
                                	at java.base/java.util.ArrayList.forEach(ArrayList.java:1612)
                                	at java.base/java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:395)
                                	at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:261)
                                	at java.base/java.util.stream.ReferencePipeline$7$1FlatMap.end(ReferencePipeline.java:284)
                                	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:571)
                                	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
                                	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:153)
                                	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:176)
                                	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
                                	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:632)
                                	at jadx.core.codegen.ClassGen.addInnerClsAndMethods(ClassGen.java:295)
                                	at jadx.core.codegen.ClassGen.addClassBody(ClassGen.java:284)
                                	at jadx.core.codegen.InsnGen.inlineAnonymousConstructor(InsnGen.java:845)
                                	at jadx.core.codegen.InsnGen.makeConstructor(InsnGen.java:730)
                                	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:418)
                                	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:145)
                                	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:121)
                                	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:108)
                                	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:1143)
                                	at jadx.core.codegen.InsnGen.makeInvoke(InsnGen.java:910)
                                	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:422)
                                	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:145)
                                	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:121)
                                	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:108)
                                	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:1143)
                                	at jadx.core.codegen.InsnGen.makeInvoke(InsnGen.java:910)
                                	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:422)
                                	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:145)
                                	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:121)
                                	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:108)
                                	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:1143)
                                	at jadx.core.codegen.InsnGen.makeInvoke(InsnGen.java:910)
                                	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:422)
                                	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:145)
                                	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:121)
                                	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:108)
                                	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:1143)
                                	at jadx.core.codegen.InsnGen.makeInvoke(InsnGen.java:910)
                                	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:422)
                                	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:303)
                                	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:273)
                                	at jadx.core.codegen.RegionGen.makeSimpleBlock(RegionGen.java:94)
                                	at jadx.core.dex.nodes.IBlock.generate(IBlock.java:15)
                                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:66)
                                	at jadx.core.dex.regions.Region.generate(Region.java:35)
                                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:66)
                                	at jadx.core.codegen.RegionGen.makeRegionIndent(RegionGen.java:83)
                                	at jadx.core.codegen.RegionGen.makeIf(RegionGen.java:126)
                                	at jadx.core.dex.regions.conditions.IfRegion.generate(IfRegion.java:90)
                                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:66)
                                	at jadx.core.dex.regions.Region.generate(Region.java:35)
                                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:66)
                                	at jadx.core.codegen.MethodGen.addRegionInsns(MethodGen.java:291)
                                	at jadx.core.codegen.MethodGen.addInstructions(MethodGen.java:270)
                                	at jadx.core.codegen.ClassGen.addMethodCode(ClassGen.java:420)
                                	at jadx.core.codegen.ClassGen.addMethod(ClassGen.java:345)
                                	at jadx.core.codegen.ClassGen.lambda$addInnerClsAndMethods$3(ClassGen.java:299)
                                	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:186)
                                	at java.base/java.util.ArrayList.forEach(ArrayList.java:1612)
                                	at java.base/java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:395)
                                	at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:261)
                                	at java.base/java.util.stream.ReferencePipeline$7$1FlatMap.end(ReferencePipeline.java:284)
                                	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:571)
                                	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
                                	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:153)
                                	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:176)
                                	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
                                	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:632)
                                	at jadx.core.codegen.ClassGen.addInnerClsAndMethods(ClassGen.java:295)
                                	at jadx.core.codegen.ClassGen.addClassBody(ClassGen.java:284)
                                	at jadx.core.codegen.ClassGen.addClassBody(ClassGen.java:268)
                                	at jadx.core.codegen.ClassGen.addClassCode(ClassGen.java:160)
                                	at jadx.core.codegen.ClassGen.makeClass(ClassGen.java:104)
                                	at jadx.core.codegen.CodeGen.wrapCodeGen(CodeGen.java:45)
                                	at jadx.core.codegen.CodeGen.generateJavaCode(CodeGen.java:34)
                                	at jadx.core.codegen.CodeGen.generate(CodeGen.java:22)
                                	at jadx.core.ProcessClass.process(ProcessClass.java:89)
                                	at jadx.core.ProcessClass.generateCode(ProcessClass.java:127)
                                	at jadx.core.dex.nodes.ClassNode.generateClassCode(ClassNode.java:405)
                                	at jadx.core.dex.nodes.ClassNode.decompile(ClassNode.java:393)
                                	at jadx.core.dex.nodes.ClassNode.getCode(ClassNode.java:343)
                                Caused by: jadx.core.utils.exceptions.JadxRuntimeException: Expected class to be processed at this point, class: com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$lambda$0$$inlined$sortedByDescending$1, state: NOT_LOADED
                                	at jadx.core.dex.nodes.ClassNode.ensureProcessed(ClassNode.java:306)
                                	at jadx.core.codegen.InsnGen.inlineAnonymousConstructor(InsnGen.java:807)
                                	at jadx.core.codegen.InsnGen.makeConstructor(InsnGen.java:730)
                                	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:418)
                                	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:145)
                                	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:121)
                                	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:108)
                                	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:1143)
                                	at jadx.core.codegen.InsnGen.makeInvoke(InsnGen.java:910)
                                	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:422)
                                	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:303)
                                	... 116 more
                                */
                            /*
                                this = this;
                                boolean r0 = r7 instanceof com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1.AnonymousClass2.AnonymousClass1
                                if (r0 == 0) goto L13
                                r0 = r7
                                com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1$2$1 r0 = (com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1.AnonymousClass2.AnonymousClass1) r0
                                int r1 = r0.o
                                r2 = -2147483648(0xffffffff80000000, float:-0.0)
                                r3 = r1 & r2
                                if (r3 == 0) goto L13
                                int r1 = r1 - r2
                                r0.o = r1
                                goto L18
                            L13:
                                com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1$2$1 r0 = new com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1$2$1
                                r0.<init>(r7)
                            L18:
                                java.lang.Object r7 = r0.n
                                java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.g()
                                int r2 = r0.o
                                r3 = 1
                                if (r2 == 0) goto L39
                                if (r2 != r3) goto L31
                                java.lang.Object r5 = r0.t
                                kotlinx.coroutines.flow.FlowCollector r5 = (kotlinx.coroutines.flow.FlowCollector) r5
                                java.lang.Object r5 = r0.r
                                com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1$2$1 r5 = (com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1.AnonymousClass2.AnonymousClass1) r5
                                kotlin.ResultKt.b(r7)
                                goto L78
                            L31:
                                java.lang.IllegalStateException r5 = new java.lang.IllegalStateException
                                java.lang.String r6 = "call to 'resume' before 'invoke' with coroutine"
                                r5.<init>(r6)
                                throw r5
                            L39:
                                kotlin.ResultKt.b(r7)
                                kotlinx.coroutines.flow.FlowCollector r7 = r5.a
                                r2 = r6
                                java.util.List r2 = (java.util.List) r2
                                com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$lambda$0$$inlined$sortedByDescending$1 r4 = new com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$lambda$0$$inlined$sortedByDescending$1
                                r4.<init>()
                                java.util.List r2 = kotlin.collections.CollectionsKt.a1(r2, r4)
                                com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel r5 = r5.b
                                com.vinfast.companion.serviceskit.domain.model.TestDriveScheduleFlow r4 = com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel.a0(r5)
                                java.util.List r5 = com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel.Y(r5, r2, r4)
                                java.lang.Object r2 = kotlin.coroutines.jvm.internal.SpillingKt.a(r6)
                                r0.p = r2
                                java.lang.Object r2 = kotlin.coroutines.jvm.internal.SpillingKt.a(r0)
                                r0.r = r2
                                java.lang.Object r6 = kotlin.coroutines.jvm.internal.SpillingKt.a(r6)
                                r0.s = r6
                                java.lang.Object r6 = kotlin.coroutines.jvm.internal.SpillingKt.a(r7)
                                r0.t = r6
                                r6 = 0
                                r0.u = r6
                                r0.o = r3
                                java.lang.Object r5 = r7.emit(r5, r0)
                                if (r5 != r1) goto L78
                                return r1
                            L78:
                                kotlin.Unit r5 = kotlin.Unit.a
                                return r5
                            */
                            throw new UnsupportedOperationException("Method not decompiled: com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1.AnonymousClass2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object");
                        }
                    }

                    @Override // kotlinx.coroutines.flow.Flow
                    public java.lang.Object a(kotlinx.coroutines.flow.FlowCollector flowCollector, kotlin.coroutines.Continuation continuation) {
                        java.lang.Object objA = flowV.a(new com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1.AnonymousClass2(flowCollector, glTestDriveLocationStepViewModel), continuation);
                        return objA == kotlin.coroutines.intrinsics.IntrinsicsKt.g() ? objA : kotlin.Unit.a;
                    }
                }, kotlinx.coroutines.Dispatchers.b()), new com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1.AnonymousClass2(this.p, null)), new com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1.AnonymousClass3(this.p, null)), new com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1.AnonymousClass4(this.p, null));
                final com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel glTestDriveLocationStepViewModel2 = this.p;
                kotlinx.coroutines.flow.FlowCollector flowCollector = new kotlinx.coroutines.flow.FlowCollector() { // from class: com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel$getServiceCenters$1.5
                    @Override // kotlinx.coroutines.flow.FlowCollector
                    /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
                    public final java.lang.Object emit(java.util.List list, kotlin.coroutines.Continuation continuation) {
                        java.lang.Object obj2;
                        glTestDriveLocationStepViewModel2._serviceCenterLiveData.q(list);
                        com.vinfast.companion.serviceskit.domain.model.gltestdrive.GlServiceCenter glServiceCenter = (com.vinfast.companion.serviceskit.domain.model.gltestdrive.GlServiceCenter) glTestDriveLocationStepViewModel2._selectedServiceCenterLiveData.f();
                        if (glServiceCenter != null) {
                            int size = list.size();
                            boolean z = false;
                            for (int i2 = 0; i2 < size; i2++) {
                                if (kotlin.jvm.internal.Intrinsics.g(((com.vinfast.companion.serviceskit.domain.model.gltestdrive.GlServiceCenter) list.get(i2)).getId(), glServiceCenter.getId())) {
                                    glTestDriveLocationStepViewModel2._selectedServiceCenterLiveData.q(list.get(i2));
                                    z = true;
                                }
                            }
                            if (!z) {
                                glTestDriveLocationStepViewModel2._selectedServiceCenterLiveData.q(kotlin.collections.CollectionsKt.s0(list));
                            }
                        } else if (glTestDriveLocationStepViewModel2.getMFlow() instanceof com.vinfast.companion.serviceskit.domain.model.TestDriveScheduleFlow.Reschedule) {
                            com.vinfast.companion.main.ui.gltestdrive.locationstep.GlTestDriveLocationStepViewModel glTestDriveLocationStepViewModel3 = glTestDriveLocationStepViewModel2;
                            java.util.Iterator<T> it = list.iterator();
                            while (true) {
                                obj2 = null;
                                if (!it.hasNext()) {
                                    break;
                                }
                                T next = it.next();
                                java.lang.String id = ((com.vinfast.companion.serviceskit.domain.model.gltestdrive.GlServiceCenter) next).getId();
                                com.vinfast.companion.serviceskit.domain.model.TestDriveScheduleFlow.Reschedule mFlow = glTestDriveLocationStepViewModel3.getMFlow();
                                kotlin.jvm.internal.Intrinsics.j(mFlow, "null cannot be cast to non-null type com.vinfast.companion.serviceskit.domain.model.TestDriveScheduleFlow.Reschedule");
                                com.vinfast.companion.serviceskit.domain.model.ServiceCenter serviceCenterL = mFlow.g().l();
                                if (kotlin.jvm.internal.Intrinsics.g(id, serviceCenterL != null ? serviceCenterL.y() : null)) {
                                    obj2 = next;
                                    break;
                                }
                            }
                            com.vinfast.companion.serviceskit.domain.model.gltestdrive.GlServiceCenter glServiceCenter2 = (com.vinfast.companion.serviceskit.domain.model.gltestdrive.GlServiceCenter) obj2;
                            androidx.lifecycle.MutableLiveData mutableLiveData = glTestDriveLocationStepViewModel2._selectedServiceCenterLiveData;
                            if (glServiceCenter2 == null) {
                                glServiceCenter2 = (com.vinfast.companion.serviceskit.domain.model.gltestdrive.GlServiceCenter) kotlin.collections.CollectionsKt.s0(list);
                            }
                            mutableLiveData.q(glServiceCenter2);
                        } else {
                            glTestDriveLocationStepViewModel2._selectedServiceCenterLiveData.q(kotlin.collections.CollectionsKt.s0(list));
                        }
                        glTestDriveLocationStepViewModel2.h0();
                        return kotlin.Unit.a;
                    }
                };
                this.n = kotlin.coroutines.jvm.internal.SpillingKt.a(strT0);
                this.o = 1;
                if (flowI.a(flowCollector, this) == objG) {
                    return objG;
                }
            } else {
                if (i != 1) {
                    throw new java.lang.IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                kotlin.ResultKt.b(obj);
            }
            return kotlin.Unit.a;
        }

        public final java.lang.Object invoke(kotlinx.coroutines.CoroutineScope coroutineScope, kotlin.coroutines.Continuation continuation) {
            return create(coroutineScope, continuation).invokeSuspend(kotlin.Unit.a);
        }
    }
