package com.vinfast.companion.serviceskit.data.repository;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes6.dex */
@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>", "", "Lkotlinx/coroutines/flow/FlowCollector;", "", "Lcom/vinfast/companion/serviceskit/domain/model/Service;"}, k = 3, mv = {2, 2, 0}, xi = 48)
@kotlin.coroutines.jvm.internal.DebugMetadata(c = "com.vinfast.companion.serviceskit.data.repository.BookingServiceRepositoryProvider$getServices$1", f = "BookingServiceRepositoryProvider.kt", l = {301, 306}, m = "invokeSuspend", v = 1)
@kotlin.jvm.internal.SourceDebugExtension
final class BookingServiceRepositoryProvider$getServices$1 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.Service>>, kotlin.coroutines.Continuation<? super kotlin.Unit>, java.lang.Object> {
    java.lang.Object n;
    java.lang.Object o;
    int p;
    private /* synthetic */ java.lang.Object q;
    final /* synthetic */ com.vinfast.companion.serviceskit.data.repository.BookingServiceRepositoryProvider r;
    final /* synthetic */ java.lang.String s;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    BookingServiceRepositoryProvider$getServices$1(com.vinfast.companion.serviceskit.data.repository.BookingServiceRepositoryProvider bookingServiceRepositoryProvider, java.lang.String str, kotlin.coroutines.Continuation continuation) {
        super(2, continuation);
        this.r = bookingServiceRepositoryProvider;
        this.s = str;
    }

    /* 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) {
        com.vinfast.companion.serviceskit.data.repository.BookingServiceRepositoryProvider$getServices$1 bookingServiceRepositoryProvider$getServices$1 = new com.vinfast.companion.serviceskit.data.repository.BookingServiceRepositoryProvider$getServices$1(this.r, this.s, continuation);
        bookingServiceRepositoryProvider$getServices$1.q = obj;
        return bookingServiceRepositoryProvider$getServices$1;
    }

    /* JADX WARN: Code restructure failed: missing block: B:21:0x0093, code lost:
    
        if (r0.emit(r4, r13) == r1) goto L22;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final java.lang.Object invokeSuspend(java.lang.Object r14) {
        /*
            r13 = this;
            java.lang.Object r0 = r13.q
            kotlinx.coroutines.flow.FlowCollector r0 = (kotlinx.coroutines.flow.FlowCollector) r0
            java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.g()
            int r2 = r13.p
            r3 = 2
            r4 = 1
            if (r2 == 0) goto L2b
            if (r2 == r4) goto L27
            if (r2 != r3) goto L1f
            java.lang.Object r0 = r13.o
            java.util.List r0 = (java.util.List) r0
            java.lang.Object r13 = r13.n
            com.vinfast.companion.core.base.BaseResponse r13 = (com.vinfast.companion.core.base.BaseResponse) r13
            kotlin.ResultKt.b(r14)
            goto L96
        L1f:
            java.lang.IllegalStateException r13 = new java.lang.IllegalStateException
            java.lang.String r14 = "call to 'resume' before 'invoke' with coroutine"
            r13.<init>(r14)
            throw r13
        L27:
            kotlin.ResultKt.b(r14)
            goto L41
        L2b:
            kotlin.ResultKt.b(r14)
            com.vinfast.companion.serviceskit.data.repository.BookingServiceRepositoryProvider r14 = r13.r
            com.vinfast.companion.serviceskit.data.api.BookingServiceApi r14 = com.vinfast.companion.serviceskit.data.repository.BookingServiceRepositoryProvider.p(r14)
            java.lang.String r2 = r13.s
            r13.q = r0
            r13.p = r4
            java.lang.Object r14 = r14.G(r2, r13)
            if (r14 != r1) goto L41
            goto L95
        L41:
            com.vinfast.companion.core.base.BaseResponse r14 = (com.vinfast.companion.core.base.BaseResponse) r14
            java.lang.Object r2 = r14.a()
            java.util.List r2 = (java.util.List) r2
            if (r2 == 0) goto L77
            java.util.ArrayList r4 = new java.util.ArrayList
            r5 = 10
            int r5 = kotlin.collections.CollectionsKt.z(r2, r5)
            r4.<init>(r5)
            java.util.Iterator r2 = r2.iterator()
        L5a:
            boolean r5 = r2.hasNext()
            if (r5 == 0) goto L7b
            java.lang.Object r5 = r2.next()
            r7 = r5
            com.vinfast.companion.serviceskit.domain.response.ServiceDto r7 = (com.vinfast.companion.serviceskit.domain.response.ServiceDto) r7
            com.vinfast.companion.serviceskit.domain.model.Service$CREATOR r6 = com.vinfast.companion.serviceskit.domain.model.Service.INSTANCE
            r11 = 14
            r12 = 0
            r8 = 0
            r9 = 0
            r10 = 0
            com.vinfast.companion.serviceskit.domain.model.Service r5 = com.vinfast.companion.serviceskit.domain.model.Service.Companion.b(r6, r7, r8, r9, r10, r11, r12)
            r4.add(r5)
            goto L5a
        L77:
            java.util.List r4 = kotlin.collections.CollectionsKt.o()
        L7b:
            java.lang.Object r2 = kotlin.coroutines.jvm.internal.SpillingKt.a(r0)
            r13.q = r2
            java.lang.Object r14 = kotlin.coroutines.jvm.internal.SpillingKt.a(r14)
            r13.n = r14
            java.lang.Object r14 = kotlin.coroutines.jvm.internal.SpillingKt.a(r4)
            r13.o = r14
            r13.p = r3
            java.lang.Object r13 = r0.emit(r4, r13)
            if (r13 != r1) goto L96
        L95:
            return r1
        L96:
            kotlin.Unit r13 = kotlin.Unit.a
            return r13
        */
        throw new UnsupportedOperationException("Method not decompiled: com.vinfast.companion.serviceskit.data.repository.BookingServiceRepositoryProvider$getServices$1.invokeSuspend(java.lang.Object):java.lang.Object");
    }
}
