Picsart v24.6版本的 MD5 值为:21a61631d94e54da68d2ad9268b8b9d9

以下内容为反编译后的 MakeUpEffectUseCase.java 源代码,内容仅作参考


package com.beautify.studio.impl.makeup.core.noneTestableUseCase;

import android.graphics.Bitmap;
import androidx.recyclerview.widget.RecyclerView;
import com.beautify.studio.impl.makeup.core.DetectionRepo;
import com.beautify.studio.impl.makeup.core.EffectParamProvider;
import com.google.android.gms.measurement.api.AppMeasurementSdk;
import com.picsart.createflow.model.Item;
import com.picsart.detection.domain.entity.MaskSourceDataFactoryImpl;
import com.picsart.effect.core.BaseEffectUseCase;
import com.picsart.effect.core.InputMap;
import com.picsart.effect.core.LibInputName;
import com.picsart.effect.core.k;
import com.picsart.effect.core.p;
import com.picsart.logger.PALog;
import com.picsart.picore.jninative.imageing.buffer.BufferPoint2f;
import com.picsart.picore.jninative.imageing.image.ImageBuffer8;
import com.picsart.picore.x.RXSession;
import com.picsart.picore.x.value.virtual.RXVirtualValue;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.Unit;
import kotlin.coroutines.intrinsics.CoroutineSingletons;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.MutablePropertyReference1Impl;
import myobfuscated.al2.b;
import myobfuscated.c81.e;
import myobfuscated.el2.j;
import myobfuscated.ik2.i;
import myobfuscated.ok2.d;
import myobfuscated.vq0.c;
import myobfuscated.vq0.t;
import myobfuscated.wk2.n;
import myobfuscated.xk2.q;
import org.jetbrains.annotations.NotNull;
import org.json.JSONArray;
import org.json.JSONObject;
public final class MakeUpEffectUseCase extends BaseEffectUseCase<p.a> {
    public static final j<Object>[] q = {q.a.d(new MutablePropertyReference1Impl(MakeUpEffectUseCase.class, "paramItem", "getParamItem()Lcom/beautify/studio/impl/makeup/core/EffectColorItemHolder;", 0))};
    @NotNull
    public final EffectParamProvider m;
    @NotNull
    public final DetectionRepo n;
    @NotNull
    public final com.picsart.detection.domain.entity.a o;
    @NotNull
    public final b p;

    public static final class a<T> implements Comparator {
        @Override
        public final int compare(T t, T t2) {
            return myobfuscated.lk2.b.b(Integer.valueOf(((k) t).b), Integer.valueOf(((k) t2).b));
        }
    }

    public MakeUpEffectUseCase(@NotNull EffectParamProvider effectParamProvider, @NotNull DetectionRepo detectionRepo, @NotNull c baseDependencyProvider, @NotNull com.picsart.detection.domain.entity.a maskSourceDataFactory) {
        super(baseDependencyProvider);
        Intrinsics.checkNotNullParameter(effectParamProvider, "effectParamProvider");
        Intrinsics.checkNotNullParameter(detectionRepo, "detectionRepo");
        Intrinsics.checkNotNullParameter(baseDependencyProvider, "baseDependencyProvider");
        Intrinsics.checkNotNullParameter(maskSourceDataFactory, "maskSourceDataFactory");
        this.m = effectParamProvider;
        this.n = detectionRepo;
        this.o = maskSourceDataFactory;
        this.p = myobfuscated.a0.a.k(myobfuscated.al2.a.a);
    }

    @Override
    public final Object h(@NotNull p.a aVar, @NotNull myobfuscated.mk2.c<? super InputMap> cVar) {
        MakeUpEffectUseCase$getInputs$1 makeUpEffectUseCase$getInputs$1;
        int i;
        final MakeUpEffectUseCase makeUpEffectUseCase;
        final p.a aVar2;
        MakeUpEffectUseCase makeUpEffectUseCase2;
        if (cVar instanceof MakeUpEffectUseCase$getInputs$1) {
            makeUpEffectUseCase$getInputs$1 = (MakeUpEffectUseCase$getInputs$1) cVar;
            int i2 = makeUpEffectUseCase$getInputs$1.label;
            if ((i2 & RecyclerView.UNDEFINED_DURATION) != 0) {
                makeUpEffectUseCase$getInputs$1.label = i2 - RecyclerView.UNDEFINED_DURATION;
                Object obj = makeUpEffectUseCase$getInputs$1.result;
                CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
                i = makeUpEffectUseCase$getInputs$1.label;
                if (i != 0) {
                    i.b(obj);
                    String str = aVar.j;
                    makeUpEffectUseCase$getInputs$1.L$0 = this;
                    makeUpEffectUseCase$getInputs$1.L$1 = aVar;
                    makeUpEffectUseCase$getInputs$1.L$2 = this;
                    makeUpEffectUseCase$getInputs$1.label = 1;
                    obj = this.m.a(str, makeUpEffectUseCase$getInputs$1);
                    if (obj == coroutineSingletons) {
                        return coroutineSingletons;
                    }
                    makeUpEffectUseCase = this;
                    aVar2 = aVar;
                    makeUpEffectUseCase2 = makeUpEffectUseCase;
                } else if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                } else {
                    makeUpEffectUseCase2 = (MakeUpEffectUseCase) makeUpEffectUseCase$getInputs$1.L$2;
                    aVar2 = (p.a) makeUpEffectUseCase$getInputs$1.L$1;
                    makeUpEffectUseCase = (MakeUpEffectUseCase) makeUpEffectUseCase$getInputs$1.L$0;
                    i.b(obj);
                }
                makeUpEffectUseCase2.p.setValue(makeUpEffectUseCase2, q[0], (myobfuscated.wc.c) obj);
                return com.picsart.effect.core.c.a(aVar2.c, new Function1<InputMap, Unit>() {

                    @Metadata(d1 = {"\u0000\u000e\n\u0002\u0010$\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\u0010\u0003\u001a\u000e\u0012\u0004\u0012\u00020\u0001\u0012\u0004\u0012\u00020\u00020\u0000H\u008a@"}, d2 = {"", "Lcom/picsart/effect/core/LibInputName;", "Lcom/picsart/picore/x/value/virtual/RXVirtualValue;", "<anonymous>"}, k = 3, mv = {1, 9, 0})
                    @d(c = "com.beautify.studio.impl.makeup.core.noneTestableUseCase.MakeUpEffectUseCase$getInputs$2$1", f = "MakeUpEffectUseCase.kt", l = {35, 36, 40}, m = "invokeSuspend")
                    public static final class AnonymousClass1 extends SuspendLambda implements Function1<myobfuscated.mk2.c<? super Map<LibInputName, ? extends RXVirtualValue>>, Object> {
                        final p.a $inputData;
                        Object L$0;
                        int label;
                        final MakeUpEffectUseCase this$0;

                        public AnonymousClass1(MakeUpEffectUseCase makeUpEffectUseCase, p.a aVar, myobfuscated.mk2.c<? super AnonymousClass1> cVar) {
                            super(1, cVar);
                            this.this$0 = makeUpEffectUseCase;
                            this.$inputData = aVar;
                        }

                        @Override
                        @NotNull
                        public final myobfuscated.mk2.c<Unit> create(@NotNull myobfuscated.mk2.c<?> cVar) {
                            return new AnonymousClass1(this.this$0, this.$inputData, cVar);
                        }

                        @Override
                        public final Object invoke(myobfuscated.mk2.c<? super Map<LibInputName, ? extends RXVirtualValue>> cVar) {
                            return ((AnonymousClass1) create(cVar)).invokeSuspend(Unit.a);
                        }

                        @Override
                        public final Object invokeSuspend(@NotNull Object obj) {
                            final BufferPoint2f bufferPoint2f;
                            CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
                            int i = this.label;
                            if (i == 0) {
                                i.b(obj);
                                DetectionRepo detectionRepo = this.this$0.n;
                                p.a aVar = this.$inputData;
                                Bitmap bitmap = aVar.d;
                                float f = aVar.m;
                                this.label = 1;
                                obj = detectionRepo.c(bitmap, f, this);
                                if (obj == coroutineSingletons) {
                                    return coroutineSingletons;
                                }
                            } else if (i != 1) {
                                if (i != 2) {
                                    if (i != 3) {
                                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                                    }
                                    i.b(obj);
                                }
                                bufferPoint2f = (BufferPoint2f) this.L$0;
                                i.b(obj);
                                final ImageBuffer8 imageBuffer8 = (ImageBuffer8) obj;
                                final int width = this.$inputData.d.getWidth();
                                final int height = this.$inputData.d.getHeight();
                                MakeUpEffectUseCase makeUpEffectUseCase = this.this$0;
                                j<Object>[] jVarArr = MakeUpEffectUseCase.q;
                                myobfuscated.yq0.q qVar = makeUpEffectUseCase.e;
                                Function1<RXSession, Map<LibInputName, ? extends RXVirtualValue>> function1 = new Function1<RXSession, Map<LibInputName, ? extends RXVirtualValue>>() {
                                    {
                                        super(1);
                                    }

                                    @Override
                                    @NotNull
                                    public final Map<LibInputName, RXVirtualValue> invoke(@NotNull RXSession it) {
                                        Intrinsics.checkNotNullParameter(it, "it");
                                        return kotlin.collections.d.i(new Pair(LibInputName.LANDMARKS, e.d(BufferPoint2f.this)), new Pair(LibInputName.HAIR_MASK, e.i(imageBuffer8, null, 6)), new Pair(LibInputName.INPUT_IMAGE_WIDTH, e.q(width, null, 6)), new Pair(LibInputName.INPUT_IMAGE_HEIGHT, e.q(height, null, 6)));
                                    }
                                };
                                this.L$0 = null;
                                this.label = 3;
                                obj = qVar.a(null, function1, this);
                                return obj != coroutineSingletons ? coroutineSingletons : obj;
                            } else {
                                i.b(obj);
                            }
                            bufferPoint2f = (BufferPoint2f) obj;
                            MakeUpEffectUseCase makeUpEffectUseCase2 = this.this$0;
                            DetectionRepo detectionRepo2 = makeUpEffectUseCase2.n;
                            Bitmap bitmap2 = this.$inputData.d;
                            MaskSourceDataFactoryImpl.a.d d = makeUpEffectUseCase2.o.d();
                            this.L$0 = bufferPoint2f;
                            this.label = 2;
                            obj = detectionRepo2.d(bitmap2, d, this);
                            if (obj == coroutineSingletons) {
                                return coroutineSingletons;
                            }
                            final ImageBuffer8 imageBuffer82 = (ImageBuffer8) obj;
                            final int width2 = this.$inputData.d.getWidth();
                            final int height2 = this.$inputData.d.getHeight();
                            MakeUpEffectUseCase makeUpEffectUseCase3 = this.this$0;
                            j<Object>[] jVarArr2 = MakeUpEffectUseCase.q;
                            myobfuscated.yq0.q qVar2 = makeUpEffectUseCase3.e;
                            Function1<RXSession, Map<LibInputName, ? extends RXVirtualValue>> function12 = new Function1<RXSession, Map<LibInputName, ? extends RXVirtualValue>>() {
                                {
                                    super(1);
                                }

                                @Override
                                @NotNull
                                public final Map<LibInputName, RXVirtualValue> invoke(@NotNull RXSession it) {
                                    Intrinsics.checkNotNullParameter(it, "it");
                                    return kotlin.collections.d.i(new Pair(LibInputName.LANDMARKS, e.d(BufferPoint2f.this)), new Pair(LibInputName.HAIR_MASK, e.i(imageBuffer82, null, 6)), new Pair(LibInputName.INPUT_IMAGE_WIDTH, e.q(width2, null, 6)), new Pair(LibInputName.INPUT_IMAGE_HEIGHT, e.q(height2, null, 6)));
                                }
                            };
                            this.L$0 = null;
                            this.label = 3;
                            obj = qVar2.a(null, function12, this);
                            if (obj != coroutineSingletons) {
                            }
                        }
                    }

                    {
                        super(1);
                    }

                    @Override
                    public Unit invoke(InputMap inputMap) {
                        invoke2(inputMap);
                        return Unit.a;
                    }

                    public final void invoke2(@NotNull InputMap inputMap) {
                        Intrinsics.checkNotNullParameter(inputMap, "$this$inputMap");
                        AnonymousClass1 anonymousClass1 = new AnonymousClass1(MakeUpEffectUseCase.this, aVar2, null);
                        inputMap.getClass();
                        Intrinsics.checkNotNullParameter(anonymousClass1, "<set-?>");
                        inputMap.c = anonymousClass1;
                    }
                });
            }
        }
        makeUpEffectUseCase$getInputs$1 = new MakeUpEffectUseCase$getInputs$1(this, cVar);
        Object obj2 = makeUpEffectUseCase$getInputs$1.result;
        CoroutineSingletons coroutineSingletons2 = CoroutineSingletons.COROUTINE_SUSPENDED;
        i = makeUpEffectUseCase$getInputs$1.label;
        if (i != 0) {
        }
        makeUpEffectUseCase2.p.setValue(makeUpEffectUseCase2, q[0], (myobfuscated.wc.c) obj2);
        return com.picsart.effect.core.c.a(aVar2.c, new Function1<InputMap, Unit>() {

            @Metadata(d1 = {"\u0000\u000e\n\u0002\u0010$\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\u0010\u0003\u001a\u000e\u0012\u0004\u0012\u00020\u0001\u0012\u0004\u0012\u00020\u00020\u0000H\u008a@"}, d2 = {"", "Lcom/picsart/effect/core/LibInputName;", "Lcom/picsart/picore/x/value/virtual/RXVirtualValue;", "<anonymous>"}, k = 3, mv = {1, 9, 0})
            @d(c = "com.beautify.studio.impl.makeup.core.noneTestableUseCase.MakeUpEffectUseCase$getInputs$2$1", f = "MakeUpEffectUseCase.kt", l = {35, 36, 40}, m = "invokeSuspend")
            public static final class AnonymousClass1 extends SuspendLambda implements Function1<myobfuscated.mk2.c<? super Map<LibInputName, ? extends RXVirtualValue>>, Object> {
                final p.a $inputData;
                Object L$0;
                int label;
                final MakeUpEffectUseCase this$0;

                public AnonymousClass1(MakeUpEffectUseCase makeUpEffectUseCase, p.a aVar, myobfuscated.mk2.c<? super AnonymousClass1> cVar) {
                    super(1, cVar);
                    this.this$0 = makeUpEffectUseCase;
                    this.$inputData = aVar;
                }

                @Override
                @NotNull
                public final myobfuscated.mk2.c<Unit> create(@NotNull myobfuscated.mk2.c<?> cVar) {
                    return new AnonymousClass1(this.this$0, this.$inputData, cVar);
                }

                @Override
                public final Object invoke(myobfuscated.mk2.c<? super Map<LibInputName, ? extends RXVirtualValue>> cVar) {
                    return ((AnonymousClass1) create(cVar)).invokeSuspend(Unit.a);
                }

                @Override
                public final Object invokeSuspend(@NotNull Object obj) {
                    final BufferPoint2f bufferPoint2f;
                    CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
                    int i = this.label;
                    if (i == 0) {
                        i.b(obj);
                        DetectionRepo detectionRepo = this.this$0.n;
                        p.a aVar = this.$inputData;
                        Bitmap bitmap = aVar.d;
                        float f = aVar.m;
                        this.label = 1;
                        obj = detectionRepo.c(bitmap, f, this);
                        if (obj == coroutineSingletons) {
                            return coroutineSingletons;
                        }
                    } else if (i != 1) {
                        if (i != 2) {
                            if (i != 3) {
                                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                            }
                            i.b(obj);
                        }
                        bufferPoint2f = (BufferPoint2f) this.L$0;
                        i.b(obj);
                        final ImageBuffer8 imageBuffer82 = (ImageBuffer8) obj;
                        final int width2 = this.$inputData.d.getWidth();
                        final int height2 = this.$inputData.d.getHeight();
                        MakeUpEffectUseCase makeUpEffectUseCase3 = this.this$0;
                        j<Object>[] jVarArr2 = MakeUpEffectUseCase.q;
                        myobfuscated.yq0.q qVar2 = makeUpEffectUseCase3.e;
                        Function1<RXSession, Map<LibInputName, ? extends RXVirtualValue>> function12 = new Function1<RXSession, Map<LibInputName, ? extends RXVirtualValue>>() {
                            {
                                super(1);
                            }

                            @Override
                            @NotNull
                            public final Map<LibInputName, RXVirtualValue> invoke(@NotNull RXSession it) {
                                Intrinsics.checkNotNullParameter(it, "it");
                                return kotlin.collections.d.i(new Pair(LibInputName.LANDMARKS, e.d(BufferPoint2f.this)), new Pair(LibInputName.HAIR_MASK, e.i(imageBuffer82, null, 6)), new Pair(LibInputName.INPUT_IMAGE_WIDTH, e.q(width2, null, 6)), new Pair(LibInputName.INPUT_IMAGE_HEIGHT, e.q(height2, null, 6)));
                            }
                        };
                        this.L$0 = null;
                        this.label = 3;
                        obj = qVar2.a(null, function12, this);
                        return obj != coroutineSingletons ? coroutineSingletons : obj;
                    } else {
                        i.b(obj);
                    }
                    bufferPoint2f = (BufferPoint2f) obj;
                    MakeUpEffectUseCase makeUpEffectUseCase2 = this.this$0;
                    DetectionRepo detectionRepo2 = makeUpEffectUseCase2.n;
                    Bitmap bitmap2 = this.$inputData.d;
                    MaskSourceDataFactoryImpl.a.d d = makeUpEffectUseCase2.o.d();
                    this.L$0 = bufferPoint2f;
                    this.label = 2;
                    obj = detectionRepo2.d(bitmap2, d, this);
                    if (obj == coroutineSingletons) {
                        return coroutineSingletons;
                    }
                    final ImageBuffer8 imageBuffer822 = (ImageBuffer8) obj;
                    final int width22 = this.$inputData.d.getWidth();
                    final int height22 = this.$inputData.d.getHeight();
                    MakeUpEffectUseCase makeUpEffectUseCase32 = this.this$0;
                    j<Object>[] jVarArr22 = MakeUpEffectUseCase.q;
                    myobfuscated.yq0.q qVar22 = makeUpEffectUseCase32.e;
                    Function1<RXSession, Map<LibInputName, ? extends RXVirtualValue>> function122 = new Function1<RXSession, Map<LibInputName, ? extends RXVirtualValue>>() {
                        {
                            super(1);
                        }

                        @Override
                        @NotNull
                        public final Map<LibInputName, RXVirtualValue> invoke(@NotNull RXSession it) {
                            Intrinsics.checkNotNullParameter(it, "it");
                            return kotlin.collections.d.i(new Pair(LibInputName.LANDMARKS, e.d(BufferPoint2f.this)), new Pair(LibInputName.HAIR_MASK, e.i(imageBuffer822, null, 6)), new Pair(LibInputName.INPUT_IMAGE_WIDTH, e.q(width22, null, 6)), new Pair(LibInputName.INPUT_IMAGE_HEIGHT, e.q(height22, null, 6)));
                        }
                    };
                    this.L$0 = null;
                    this.label = 3;
                    obj = qVar22.a(null, function122, this);
                    if (obj != coroutineSingletons) {
                    }
                }
            }

            {
                super(1);
            }

            @Override
            public Unit invoke(InputMap inputMap) {
                invoke2(inputMap);
                return Unit.a;
            }

            public final void invoke2(@NotNull InputMap inputMap) {
                Intrinsics.checkNotNullParameter(inputMap, "$this$inputMap");
                AnonymousClass1 anonymousClass1 = new AnonymousClass1(MakeUpEffectUseCase.this, aVar2, null);
                inputMap.getClass();
                Intrinsics.checkNotNullParameter(anonymousClass1, "<set-?>");
                inputMap.c = anonymousClass1;
            }
        });
    }

    public final myobfuscated.wc.c B() {
        return (myobfuscated.wc.c) this.p.getValue(this, q[0]);
    }

    @Override
    public final <R> Object a(@NotNull String str, @NotNull String str2, R r, boolean z, @NotNull n<? super Bitmap, ? super Bitmap, ? super Bitmap, Unit> nVar, @NotNull myobfuscated.mk2.c<? super Boolean> cVar) {
        MakeUpEffectUseCase$changeEffectParameter$1 makeUpEffectUseCase$changeEffectParameter$1;
        int i;
        String str3;
        Object obj;
        MakeUpEffectUseCase makeUpEffectUseCase;
        Object obj2;
        if (cVar instanceof MakeUpEffectUseCase$changeEffectParameter$1) {
            makeUpEffectUseCase$changeEffectParameter$1 = (MakeUpEffectUseCase$changeEffectParameter$1) cVar;
            int i2 = makeUpEffectUseCase$changeEffectParameter$1.label;
            if ((i2 & RecyclerView.UNDEFINED_DURATION) != 0) {
                makeUpEffectUseCase$changeEffectParameter$1.label = i2 - RecyclerView.UNDEFINED_DURATION;
                MakeUpEffectUseCase$changeEffectParameter$1 makeUpEffectUseCase$changeEffectParameter$12 = makeUpEffectUseCase$changeEffectParameter$1;
                Object obj3 = makeUpEffectUseCase$changeEffectParameter$12.result;
                CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
                i = makeUpEffectUseCase$changeEffectParameter$12.label;
                if (i != 0) {
                    i.b(obj3);
                    MakeUpEffectUseCase$changeEffectParameter$2 makeUpEffectUseCase$changeEffectParameter$2 = new MakeUpEffectUseCase$changeEffectParameter$2(this, str, z, nVar, null);
                    makeUpEffectUseCase$changeEffectParameter$12.L$0 = this;
                    makeUpEffectUseCase$changeEffectParameter$12.L$1 = str;
                    str3 = str2;
                    makeUpEffectUseCase$changeEffectParameter$12.L$2 = str3;
                    makeUpEffectUseCase$changeEffectParameter$12.L$3 = r;
                    makeUpEffectUseCase$changeEffectParameter$12.L$4 = nVar;
                    makeUpEffectUseCase$changeEffectParameter$12.Z$0 = z;
                    makeUpEffectUseCase$changeEffectParameter$12.label = 1;
                    if (r instanceof myobfuscated.er0.b) {
                        myobfuscated.wc.c B = B();
                        myobfuscated.er0.b bVar = (myobfuscated.er0.b) r;
                        Intrinsics.checkNotNullParameter(bVar, "<set-?>");
                        B.b = bVar;
                        obj = makeUpEffectUseCase$changeEffectParameter$2.invoke((MakeUpEffectUseCase$changeEffectParameter$2) r, (R) makeUpEffectUseCase$changeEffectParameter$12);
                        if (obj != coroutineSingletons) {
                            obj = Unit.a;
                        }
                    } else {
                        obj = Unit.a;
                    }
                    if (obj == coroutineSingletons) {
                        return coroutineSingletons;
                    }
                    makeUpEffectUseCase = this;
                    obj2 = r;
                } else if (i != 1) {
                    if (i != 2) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    i.b(obj3);
                } else {
                    n nVar2 = (n) makeUpEffectUseCase$changeEffectParameter$12.L$4;
                    obj2 = makeUpEffectUseCase$changeEffectParameter$12.L$3;
                    String str4 = (String) makeUpEffectUseCase$changeEffectParameter$12.L$1;
                    makeUpEffectUseCase = (MakeUpEffectUseCase) makeUpEffectUseCase$changeEffectParameter$12.L$0;
                    i.b(obj3);
                    str3 = (String) makeUpEffectUseCase$changeEffectParameter$12.L$2;
                }
                makeUpEffectUseCase$changeEffectParameter$12.L$0 = null;
                makeUpEffectUseCase$changeEffectParameter$12.L$1 = null;
                makeUpEffectUseCase$changeEffectParameter$12.L$2 = null;
                makeUpEffectUseCase$changeEffectParameter$12.L$3 = null;
                makeUpEffectUseCase$changeEffectParameter$12.L$4 = null;
                makeUpEffectUseCase$changeEffectParameter$12.label = 2;
                makeUpEffectUseCase.getClass();
                obj3 = BaseEffectUseCase.e(makeUpEffectUseCase, str3, obj2, makeUpEffectUseCase$changeEffectParameter$12);
                return obj3 != coroutineSingletons ? coroutineSingletons : obj3;
            }
        }
        makeUpEffectUseCase$changeEffectParameter$1 = new MakeUpEffectUseCase$changeEffectParameter$1(this, cVar);
        MakeUpEffectUseCase$changeEffectParameter$1 makeUpEffectUseCase$changeEffectParameter$122 = makeUpEffectUseCase$changeEffectParameter$1;
        Object obj32 = makeUpEffectUseCase$changeEffectParameter$122.result;
        CoroutineSingletons coroutineSingletons2 = CoroutineSingletons.COROUTINE_SUSPENDED;
        i = makeUpEffectUseCase$changeEffectParameter$122.label;
        if (i != 0) {
        }
        makeUpEffectUseCase$changeEffectParameter$122.L$0 = null;
        makeUpEffectUseCase$changeEffectParameter$122.L$1 = null;
        makeUpEffectUseCase$changeEffectParameter$122.L$2 = null;
        makeUpEffectUseCase$changeEffectParameter$122.L$3 = null;
        makeUpEffectUseCase$changeEffectParameter$122.L$4 = null;
        makeUpEffectUseCase$changeEffectParameter$122.label = 2;
        makeUpEffectUseCase.getClass();
        obj32 = BaseEffectUseCase.e(makeUpEffectUseCase, str3, obj2, makeUpEffectUseCase$changeEffectParameter$122);
        if (obj32 != coroutineSingletons2) {
        }
    }

    @Override
    public final Object i(@NotNull String str, @NotNull myobfuscated.mk2.c<? super List<? extends k>> cVar) {
        MakeUpEffectUseCase$getEffectParamInfoList$1 makeUpEffectUseCase$getEffectParamInfoList$1;
        int i;
        MakeUpEffectUseCase makeUpEffectUseCase;
        if (cVar instanceof MakeUpEffectUseCase$getEffectParamInfoList$1) {
            makeUpEffectUseCase$getEffectParamInfoList$1 = (MakeUpEffectUseCase$getEffectParamInfoList$1) cVar;
            int i2 = makeUpEffectUseCase$getEffectParamInfoList$1.label;
            if ((i2 & RecyclerView.UNDEFINED_DURATION) != 0) {
                makeUpEffectUseCase$getEffectParamInfoList$1.label = i2 - RecyclerView.UNDEFINED_DURATION;
                Object obj = makeUpEffectUseCase$getEffectParamInfoList$1.result;
                CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
                i = makeUpEffectUseCase$getEffectParamInfoList$1.label;
                if (i == 0) {
                    if (i != 1) {
                        if (i != 2) {
                            throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                        }
                        i.b(obj);
                    }
                    makeUpEffectUseCase = (MakeUpEffectUseCase) makeUpEffectUseCase$getEffectParamInfoList$1.L$0;
                    i.b(obj);
                    ArrayList y0 = kotlin.collections.c.y0((Collection) obj);
                    y0.add(new k.d("colorList", makeUpEffectUseCase.B().b, makeUpEffectUseCase.B().a));
                    ArrayList arrayList = new ArrayList();
                    for (Object obj2 : kotlin.collections.c.q0(new Object(), y0)) {
                        if (!Intrinsics.c(((k) obj2).a, Item.ICON_TYPE_COLOR)) {
                            arrayList.add(obj2);
                        }
                    }
                    return arrayList;
                }
                i.b(obj);
                if (!(!B().a.isEmpty())) {
                    makeUpEffectUseCase$getEffectParamInfoList$1.label = 2;
                    obj = super.i(str, makeUpEffectUseCase$getEffectParamInfoList$1);
                    return obj == coroutineSingletons ? coroutineSingletons : obj;
                }
                makeUpEffectUseCase$getEffectParamInfoList$1.L$0 = this;
                makeUpEffectUseCase$getEffectParamInfoList$1.label = 1;
                obj = super.i(str, makeUpEffectUseCase$getEffectParamInfoList$1);
                if (obj == coroutineSingletons) {
                    return coroutineSingletons;
                }
                makeUpEffectUseCase = this;
                ArrayList y02 = kotlin.collections.c.y0((Collection) obj);
                y02.add(new k.d("colorList", makeUpEffectUseCase.B().b, makeUpEffectUseCase.B().a));
                ArrayList arrayList2 = new ArrayList();
                while (r6.hasNext()) {
                }
                return arrayList2;
            }
        }
        makeUpEffectUseCase$getEffectParamInfoList$1 = new MakeUpEffectUseCase$getEffectParamInfoList$1(this, cVar);
        Object obj3 = makeUpEffectUseCase$getEffectParamInfoList$1.result;
        CoroutineSingletons coroutineSingletons2 = CoroutineSingletons.COROUTINE_SUSPENDED;
        i = makeUpEffectUseCase$getEffectParamInfoList$1.label;
        if (i == 0) {
        }
    }

    @Override
    @NotNull
    public final String o(@NotNull String jsonName) {
        Intrinsics.checkNotNullParameter(jsonName, "jsonName");
        PALog.a("getJsonUrl", "getJsonUrl " + jsonName);
        this.k.getClass();
        return e.j("https://effres.picsart.com/", t.a(), "beautify/makeup-effects/", this.f.a(jsonName), ".json");
    }

    @Override
    @NotNull
    public final String p(@NotNull String resName) {
        String str;
        Intrinsics.checkNotNullParameter(resName, "resName");
        if (kotlin.text.d.w(resName, ".", false)) {
            String substring = resName.substring(0, kotlin.text.d.H(resName, ".", 0, 6));
            Intrinsics.checkNotNullExpressionValue(substring, "this as java.lang.String…ing(startIndex, endIndex)");
            String substring2 = resName.substring(kotlin.text.d.H(resName, ".", 0, 6));
            Intrinsics.checkNotNullExpressionValue(substring2, "this as java.lang.String).substring(startIndex)");
            str = substring2;
            resName = substring;
        } else {
            str = "";
        }
        this.k.getClass();
        String a2 = t.a();
        String a3 = this.f.a(resName);
        return "https://effres.picsart.com/" + a2 + "beautify/makeup-res/" + a3 + ((Object) str);
    }

    @Override
    public final String v(p.a aVar) {
        p.a inputData = aVar;
        Intrinsics.checkNotNullParameter(inputData, "inputData");
        boolean z = inputData.l;
        String str = inputData.b;
        return z ? com.appsflyer.internal.c.n(str, "_apply") : str;
    }

    @Override
    public final String w(p pVar, String str) {
        if (((p.a) pVar).l) {
            JSONObject jSONObject = new JSONObject(str);
            String string = jSONObject.getString(AppMeasurementSdk.ConditionalUserProperty.NAME);
            jSONObject.put(AppMeasurementSdk.ConditionalUserProperty.NAME, string + "_apply");
            JSONArray jSONArray = jSONObject.getJSONArray("resources");
            int length = jSONArray.length();
            for (int i = 0; i < length; i++) {
                if (jSONArray.getJSONObject(i).has("apply_file_name") && jSONArray.getJSONObject(i).has("file_name")) {
                    Object obj = jSONArray.getJSONObject(i).get("apply_file_name");
                    jSONArray.getJSONObject(i).remove("apply_file_name");
                    jSONArray.getJSONObject(i).remove("file_name");
                    jSONArray.getJSONObject(i).put("file_name", obj);
                }
            }
            String jSONObject2 = jSONObject.toString();
            Intrinsics.checkNotNullExpressionValue(jSONObject2, "toString(...)");
            return jSONObject2;
        }
        return str;
    }
}