package com.ss.android.ugc.aweme.commerce.tools.mission.service;

import X.0P5;
import X.1Hv;
import X.1hK;
import X.2Pr;
import X.2nK;
import X.3af;
import X.AnonymousClass5E9;
import X.AnonymousClass5N0;
import X.AnonymousClass6J4;
import X.AnonymousClass6YQ;
import X.C31156Iv;
import X.C31166Iw;
import X.C34286Uw;
import X.C34306Uy;
import X.C43426ma;
import X.C44156nl;
import X.FsH;
import X.Lnj;
import X.LsD;
import X.M12;
import X.NO8;
import X.NrO;
import X.NtX;
import X.OCO;
import X.OZG;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.google.gson.Gson;
import com.ss.android.ugc.aweme.commerce.tools.common.CommerceToolsModel;
import com.ss.android.ugc.aweme.commerce.tools.mission.Mission;
import com.ss.android.ugc.aweme.commerce.tools.tcm.service.CommerceToolsTcmServiceImpl;
import com.ss.android.ugc.aweme.shortvideo.ShortVideoContext;
import com.ss.android.ugc.aweme.shortvideo.edit.VideoPublishEditModel;
import com.ss.android.ugc.aweme.shortvideo.model.CreativeFlowData;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import kotlin.h.b.n;
import kotlin.o.z;

public final class CommerceToolsMissionService implements ICommerceToolsMissionService {
    static {
        Covode.recordClassIndex(58077);
    }

    public final void LIZ(String str, VideoPublishEditModel videoPublishEditModel) {
        Mission mission;
        M12.LIZ(str, videoPublishEditModel);
        M12.LIZ(str, videoPublishEditModel);
        if (TextUtils.equals(str, "mission_logo") && (mission = videoPublishEditModel.creativeFlowData.getCommerceToolsModel().getMission()) != null && mission.getEnableImageSticker() && mission.getImageSticker() != null) {
            AnonymousClass6J4 r2 = new AnonymousClass6J4();
            r2.LIZ("mission_id", mission.getMissionId());
            r2.LIZ("page_source", mission.getEnterFrom());
            r2.LIZ("creator_followers", C43426ma.LIZ.LJJ().LIZIZ());
            r2.LIZ("event", 1);
            r2.LIZ("sticker_type", 1);
            2nK.LIZ("mission_requirement_sticker", r2.LIZ);
        }
    }

    public static ICommerceToolsMissionService LIZ() {
        MethodCollector.i(10767);
        ICommerceToolsMissionService iCommerceToolsMissionService = (ICommerceToolsMissionService) Lnj.LIZ(ICommerceToolsMissionService.class, false);
        if (iCommerceToolsMissionService != null) {
            MethodCollector.o(10767);
            return iCommerceToolsMissionService;
        }
        Object LIZIZ = Lnj.LIZIZ(ICommerceToolsMissionService.class, false);
        if (LIZIZ != null) {
            ICommerceToolsMissionService iCommerceToolsMissionService2 = (ICommerceToolsMissionService) LIZIZ;
            MethodCollector.o(10767);
            return iCommerceToolsMissionService2;
        }
        if (Lnj.LJJZZIII == null) {
            synchronized (ICommerceToolsMissionService.class) {
                try {
                    if (Lnj.LJJZZIII == null) {
                        Lnj.LJJZZIII = new CommerceToolsMissionService();
                    }
                } catch (Throwable th) {
                    MethodCollector.o(10767);
                    throw th;
                }
            }
        }
        CommerceToolsMissionService commerceToolsMissionService = (CommerceToolsMissionService) Lnj.LJJZZIII;
        MethodCollector.o(10767);
        return commerceToolsMissionService;
    }

    public final 1Hv<0P5> LIZ(NrO nrO) {
        M12.LIZ(nrO);
        return new FsH(nrO);
    }

    public final void LIZ(int i, C34306Uy r2) {
        C34286Uw.LIZ(i, r2);
    }

    public final void LIZ(VideoPublishEditModel videoPublishEditModel, LinkedHashMap<String, String> linkedHashMap) {
        CreativeFlowData creativeFlowData;
        CommerceToolsModel commerceToolsModel;
        Mission mission;
        M12.LIZ(linkedHashMap);
        M12.LIZ(linkedHashMap);
        if (videoPublishEditModel != null && (creativeFlowData = videoPublishEditModel.creativeFlowData) != null && (commerceToolsModel = creativeFlowData.getCommerceToolsModel()) != null && (mission = commerceToolsModel.getMission()) != null) {
            String missionId = mission.getMissionId();
            String str = "";
            if (missionId == null) {
                missionId = str;
            }
            linkedHashMap.put("mission_id", missionId);
            String enterFrom = mission.getEnterFrom();
            if (enterFrom != null) {
                str = enterFrom;
            }
            linkedHashMap.put("mission_from", str);
        }
    }

    public final void LIZ(Activity activity, ShortVideoContext shortVideoContext) {
        CreativeFlowData creativeFlowData;
        CommerceToolsModel commerceToolsModel;
        Mission mission;
        String str;
        String str2;
        String stickerId;
        M12.LIZ(activity);
        M12.LIZ(activity);
        if (shortVideoContext != null && (creativeFlowData = shortVideoContext.LIZIZ) != null && (commerceToolsModel = creativeFlowData.getCommerceToolsModel()) != null && (mission = commerceToolsModel.getMission()) != null) {
            String musicId = mission.getMusicId();
            if ((musicId != null && musicId.length() != 0) || ((stickerId = mission.getStickerId()) != null && stickerId.length() != 0)) {
                String stickerId2 = mission.getStickerId();
                if (stickerId2 == null || stickerId2.length() == 0 || !mission.isStickerToasted()) {
                    String musicId2 = mission.getMusicId();
                    if (musicId2 == null || musicId2.length() == 0 || !mission.isMusicToasted()) {
                        OZG ozg = C44156nl.LIZ().LIZ;
                        Integer num = null;
                        if (ozg != null) {
                            str = ozg.getMusicId();
                        } else {
                            str = null;
                        }
                        if (TextUtils.equals(mission.getMusicId(), str)) {
                            3af r2 = new 3af(activity);
                            r2.LIZIZ(2131755388);
                            r2.LIZLLL(2130968624);
                            r2.LIZ(5000);
                            r2.LJ(2131827047);
                            3af.LIZ(r2);
                            AnonymousClass6J4 r22 = new AnonymousClass6J4();
                            r22.LIZ("reason", 6);
                            r22.LIZ("mission_id", mission.getMissionId());
                            r22.LIZ("page_source", mission.getEnterFrom());
                            NO8 LJ = NtX.LJIJ.LJ();
                            if (LJ != null) {
                                num = Integer.valueOf(LJ.LJIIJJI());
                            }
                            r22.LIZ("creator_followers", (Object) num);
                            if (CommerceToolsTcmServiceImpl.LJFF().LIZLLL()) {
                                str2 = "0";
                            } else {
                                str2 = "1";
                            }
                            r22.LIZ("creator_type", str2);
                            2nK.LIZ("mission_requirement_toast", r22.LIZ);
                        }
                    }
                }
            }
        }
    }

    public final void LIZIZ(Activity activity, ShortVideoContext shortVideoContext) {
        String str;
        Long l;
        String stickerId;
        M12.LIZ(activity, shortVideoContext);
        M12.LIZ(activity, shortVideoContext);
        Mission mission = shortVideoContext.LIZIZ.getCommerceToolsModel().getMission();
        if (mission != null) {
            String musicId = mission.getMusicId();
            if ((musicId != null && musicId.length() != 0) || ((stickerId = mission.getStickerId()) != null && stickerId.length() != 0)) {
                String stickerId2 = mission.getStickerId();
                if (stickerId2 == null || stickerId2.length() == 0 || !mission.isStickerToasted()) {
                    String musicId2 = mission.getMusicId();
                    if (musicId2 == null || musicId2.length() == 0 || !mission.isMusicToasted()) {
                        Integer num = null;
                        if (!mission.isMusicToasted()) {
                            String musicId3 = mission.getMusicId();
                            OZG ozg = C44156nl.LIZ().LIZ;
                            if (ozg != null) {
                                l = Long.valueOf(ozg.id);
                            } else {
                                l = null;
                            }
                            if (!TextUtils.equals(musicId3, String.valueOf(l))) {
                                mission.setMusicToasted(true);
                                shortVideoContext.LIZIZ.getCommerceToolsModel().setMission(mission);
                                return;
                            }
                        }
                        3af r2 = new 3af(activity);
                        r2.LIZIZ(2131755388);
                        r2.LIZLLL(2130968624);
                        r2.LIZ(5000);
                        r2.LJ(2131827049);
                        3af.LIZ(r2);
                        AnonymousClass6J4 r22 = new AnonymousClass6J4();
                        r22.LIZ("reason", 4);
                        r22.LIZ("mission_id", mission.getMissionId());
                        r22.LIZ("page_source", mission.getEnterFrom());
                        NO8 LJ = NtX.LJIJ.LJ();
                        if (LJ != null) {
                            num = Integer.valueOf(LJ.LJIIJJI());
                        }
                        r22.LIZ("creator_followers", (Object) num);
                        if (CommerceToolsTcmServiceImpl.LJFF().LIZLLL()) {
                            str = "0";
                        } else {
                            str = "1";
                        }
                        r22.LIZ("creator_type", str);
                        2nK.LIZ("mission_requirement_toast", r22.LIZ);
                    }
                }
            }
        }
    }

    public final void LIZJ(Activity activity, ShortVideoContext shortVideoContext) {
        CreativeFlowData creativeFlowData;
        CommerceToolsModel commerceToolsModel;
        Mission mission;
        String musicId;
        String str;
        String str2;
        if (shortVideoContext != null && (creativeFlowData = shortVideoContext.LIZIZ) != null && (commerceToolsModel = creativeFlowData.getCommerceToolsModel()) != null && (mission = commerceToolsModel.getMission()) != null && (musicId = mission.getMusicId()) != null && musicId.length() != 0) {
            Integer num = null;
            if (!mission.isMusicToasted()) {
                OZG ozg = C44156nl.LIZ().LIZ;
                if (ozg != null) {
                    str2 = ozg.getMid();
                } else {
                    str2 = null;
                }
                if (!TextUtils.equals(str2, mission.getMusicId())) {
                    mission.setMusicToasted(true);
                    shortVideoContext.LIZIZ.getCommerceToolsModel().setMission(mission);
                }
            }
            if (!mission.isMusicToasted() && activity != null) {
                AnonymousClass6J4 r2 = new AnonymousClass6J4();
                r2.LIZ("reason", 1);
                r2.LIZ("mission_id", mission.getMissionId());
                r2.LIZ("page_source", mission.getEnterFrom());
                NO8 LJ = NtX.LJIJ.LJ();
                if (LJ != null) {
                    num = Integer.valueOf(LJ.LJIIJJI());
                }
                r2.LIZ("creator_followers", (Object) num);
                if (CommerceToolsTcmServiceImpl.LJFF().LIZLLL()) {
                    str = "0";
                } else {
                    str = "1";
                }
                r2.LIZ("creator_type", str);
                2nK.LIZ("mission_requirement_toast", r2.LIZ);
            }
        }
    }

    public final void LIZLLL(Activity activity, ShortVideoContext shortVideoContext) {
        CreativeFlowData creativeFlowData;
        CommerceToolsModel commerceToolsModel;
        Mission mission;
        Long l;
        String stickerId;
        if (shortVideoContext != null && (creativeFlowData = shortVideoContext.LIZIZ) != null && (commerceToolsModel = creativeFlowData.getCommerceToolsModel()) != null && (mission = commerceToolsModel.getMission()) != null) {
            String musicId = mission.getMusicId();
            if ((musicId != null && musicId.length() != 0) || ((stickerId = mission.getStickerId()) != null && stickerId.length() != 0)) {
                String stickerId2 = mission.getStickerId();
                if (stickerId2 == null || stickerId2.length() == 0 || !mission.isStickerToasted()) {
                    String musicId2 = mission.getMusicId();
                    if (musicId2 == null || musicId2.length() == 0 || !mission.isMusicToasted()) {
                        if (!mission.isMusicToasted()) {
                            String musicId3 = mission.getMusicId();
                            OZG ozg = C44156nl.LIZ().LIZ;
                            if (ozg != null) {
                                l = Long.valueOf(ozg.id);
                            } else {
                                l = null;
                            }
                            if (!TextUtils.equals(musicId3, String.valueOf(l))) {
                                mission.setMusicToasted(true);
                                shortVideoContext.LIZIZ.getCommerceToolsModel().setMission(mission);
                                return;
                            }
                        }
                        if (activity != null) {
                            3af r1 = new 3af(activity);
                            r1.LJ(2131827042);
                            3af.LIZ(r1);
                        }
                    }
                }
            }
        }
    }

    public final void LIZ(Activity activity, VideoPublishEditModel videoPublishEditModel) {
        CreativeFlowData creativeFlowData;
        CommerceToolsModel commerceToolsModel;
        Mission mission;
        String musicId;
        String str;
        String str2;
        if (videoPublishEditModel != null && (creativeFlowData = videoPublishEditModel.creativeFlowData) != null && (commerceToolsModel = creativeFlowData.getCommerceToolsModel()) != null && (mission = commerceToolsModel.getMission()) != null && (musicId = mission.getMusicId()) != null && musicId.length() != 0) {
            if (!mission.isMusicToasted()) {
                OZG ozg = C44156nl.LIZ().LIZ;
                if (ozg != null) {
                    str2 = ozg.getMid();
                } else {
                    str2 = null;
                }
                if (!TextUtils.equals(str2, mission.getMusicId())) {
                    mission.setMusicToasted(true);
                    videoPublishEditModel.creativeFlowData.getCommerceToolsModel().setMission(mission);
                }
            }
            if (!mission.isMusicToasted() && activity != null) {
                AnonymousClass6J4 r2 = new AnonymousClass6J4();
                r2.LIZ("reason", 1);
                r2.LIZ("mission_id", mission.getMissionId());
                r2.LIZ("page_source", mission.getEnterFrom());
                r2.LIZ("creator_followers", C43426ma.LIZ.LJJ().LIZIZ());
                if (CommerceToolsTcmServiceImpl.LJFF().LIZLLL()) {
                    str = "0";
                } else {
                    str = "1";
                }
                r2.LIZ("creator_type", str);
                2nK.LIZ("mission_requirement_toast", r2.LIZ);
            }
        }
    }

    public final void LIZ(Context context, C34306Uy r2, LsD<? super Integer, ? super CharSequence, 2Pr> lsD) {
        M12.LIZ(lsD);
        C34286Uw.LIZ(context, r2, lsD);
    }

    public final void LIZ(Intent intent, Intent intent2, String str, String str2) {
        String str3;
        Object obj;
        AnonymousClass5N0 imageSticker;
        String str4;
        if (intent != null) {
            str3 = C31166Iw.LIZ(intent, "mission_data");
        } else {
            str3 = null;
        }
        if (TextUtils.equals(str, "mission") && !TextUtils.isEmpty(str3)) {
            Mission mission = (Mission) new Gson().LIZ(str3, Mission.class);
            if (!TextUtils.isEmpty(mission.getStickerId())) {
                mission.setStickerToasted(false);
            }
            if (!TextUtils.isEmpty(mission.getMusicId())) {
                mission.setMusicToasted(false);
            }
            List<String> challengeNames = mission.getChallengeNames();
            if (challengeNames != null && !challengeNames.isEmpty()) {
                mission.setChallengeToasted(false);
            }
            List<AnonymousClass6YQ> mentionedUsers = mission.getMentionedUsers();
            if (mentionedUsers != null && !mentionedUsers.isEmpty()) {
                ArrayList arrayList = new ArrayList();
                List<AnonymousClass6YQ> mentionedUsers2 = mission.getMentionedUsers();
                if (mentionedUsers2 != null) {
                    for (AnonymousClass6YQ r4 : mentionedUsers2) {
                        String nickname = r4.getNickname();
                        if (nickname != null) {
                            Locale locale = Locale.getDefault();
                            n.LIZIZ(locale, "");
                            Objects.requireNonNull(nickname, "null cannot be cast to non-null type java.lang.String");
                            str4 = nickname.toLowerCase(locale);
                            n.LIZIZ(str4, "");
                        } else {
                            str4 = null;
                        }
                        r4.setNickname(str4);
                        arrayList.add(r4);
                    }
                }
                mission.setMentionedUsers(arrayList);
                mission.setUserToasted(false);
            }
            if (!(!mission.getEnableImageSticker() || mission.getImageSticker() == null || (imageSticker = mission.getImageSticker()) == null)) {
                OCO.LIZ(imageSticker.getLogoImageUrl());
            }
            Objects.requireNonNull(mission, "null cannot be cast to non-null type android.os.Parcelable");
            intent2.putExtra("mission", mission);
            NO8 LJ = NtX.LJIJ.LJ();
            AnonymousClass6J4 r3 = new AnonymousClass6J4();
            r3.LIZ("creation_id", str2);
            r3.LIZ("shoot_way", str);
            r3.LIZ("mission_id", mission.getMissionId());
            r3.LIZ("page_source", mission.getEnterFrom());
            String str5 = "0";
            if (LJ != null) {
                obj = Integer.valueOf(LJ.LJIIJJI());
            } else {
                obj = str5;
            }
            r3.LIZ("creator_followers", obj);
            if (!CommerceToolsTcmServiceImpl.LJFF().LIZLLL()) {
                str5 = "1";
            }
            r3.LIZ("creator_type", str5);
            2nK.LIZ("shoot", r3.LIZ);
        }
    }

    public final void LIZ(int i, int i2, VideoPublishEditModel videoPublishEditModel, String str, String str2) {
        List<AnonymousClass6YQ> mentionedUsers;
        List<AnonymousClass6YQ> mentionedUsers2;
        Object obj;
        List<String> challengeNames;
        List<String> challengeNames2;
        Object obj2;
        VideoPublishEditModel videoPublishEditModel2 = videoPublishEditModel;
        VideoPublishEditModel videoPublishEditModel3 = videoPublishEditModel2;
        String str3 = str2;
        M12.LIZ(str3);
        M12.LIZ(str3);
        if (videoPublishEditModel3 != null) {
            String LIZ = C31156Iv.LIZ.LIZ(str, str3);
            int i3 = i2;
            int i4 = i;
            if (i4 < i3 && i4 >= 0 && !TextUtils.isEmpty(LIZ) && LIZ.length() != 0) {
                NO8 LJ = NtX.LJIJ.LJ();
                Objects.requireNonNull(LIZ, "null cannot be cast to non-null type java.lang.String");
                String substring = LIZ.substring(i4, i3);
                n.LIZIZ(substring, "");
                Mission mission = videoPublishEditModel3.creativeFlowData.getCommerceToolsModel().getMission();
                if (mission != null) {
                    String str4 = "0";
                    if (!mission.isChallengeToasted() && (challengeNames = mission.getChallengeNames()) != null && !challengeNames.isEmpty() && (challengeNames2 = mission.getChallengeNames()) != null) {
                        boolean z = false;
                        for (T next : challengeNames2) {
                            if (substring.length() > 1) {
                                if (TextUtils.equals(String.valueOf(substring.charAt(substring.length() - 1)), C31156Iv.LIZ(AnonymousClass5E9.LIZ.LIZ()).getString(2131832825))) {
                                    C31156Iv r16 = C31156Iv.LIZ;
                                    Objects.requireNonNull(LIZ, "null cannot be cast to non-null type java.lang.String");
                                    String substring2 = LIZ.substring(0, i3 - 1);
                                    n.LIZIZ(substring2, "");
                                    z = TextUtils.equals(r16.LIZ(substring2), "#".concat(String.valueOf(next)));
                                }
                            }
                            if (!TextUtils.equals(substring, "#".concat(String.valueOf(next))) || z) {
                                videoPublishEditModel3 = videoPublishEditModel2;
                            } else {
                                mission.setChallengeToasted(true);
                                AnonymousClass6J4 r1 = new AnonymousClass6J4();
                                r1.LIZ("value", 3);
                                r1.LIZ("mission_id", mission.getMissionId());
                                r1.LIZ("page_source", mission.getEnterFrom());
                                if (LJ != null) {
                                    obj2 = Integer.valueOf(LJ.LJIIJJI());
                                } else {
                                    obj2 = str4;
                                }
                                r1.LIZ("creator_followers", obj2);
                                if (!CommerceToolsTcmServiceImpl.LJFF().LIZLLL()) {
                                    str4 = "1";
                                }
                                r1.LIZ("creator_type", str4);
                                2nK.LIZ("mission_requirement_modified", r1.LIZ);
                                videoPublishEditModel2.creativeFlowData.getCommerceToolsModel().setMission(mission);
                                return;
                            }
                        }
                    }
                    if (!mission.isUserToasted() && (mentionedUsers = mission.getMentionedUsers()) != null && !mentionedUsers.isEmpty() && (mentionedUsers2 = mission.getMentionedUsers()) != null) {
                        for (AnonymousClass6YQ nickname : mentionedUsers2) {
                            if (TextUtils.equals(substring, "@" + nickname.getNickname())) {
                                mission.setUserToasted(true);
                                AnonymousClass6J4 r12 = new AnonymousClass6J4();
                                r12.LIZ("value", 2);
                                r12.LIZ("mission_id", mission.getMissionId());
                                r12.LIZ("page_source", mission.getEnterFrom());
                                if (LJ != null) {
                                    obj = Integer.valueOf(LJ.LJIIJJI());
                                } else {
                                    obj = str4;
                                }
                                r12.LIZ("creator_followers", obj);
                                if (!CommerceToolsTcmServiceImpl.LJFF().LIZLLL()) {
                                    str4 = "1";
                                }
                                r12.LIZ("creator_type", str4);
                                2nK.LIZ("mission_requirement_modified", r12.LIZ);
                                videoPublishEditModel3.creativeFlowData.getCommerceToolsModel().setMission(mission);
                                return;
                            }
                        }
                    }
                }
            }
        }
    }

    public final void LIZ(String str, int i, VideoPublishEditModel videoPublishEditModel, String str2, String str3, 1hK r26) {
        List<AnonymousClass6YQ> mentionedUsers;
        List<AnonymousClass6YQ> mentionedUsers2;
        Integer num;
        List<String> challengeNames;
        List<String> challengeNames2;
        Integer num2;
        String str4 = str;
        String str5 = str3;
        M12.LIZ(str4, str5);
        M12.LIZ(str4, str5);
        VideoPublishEditModel videoPublishEditModel2 = videoPublishEditModel;
        if (videoPublishEditModel2 != null) {
            NO8 LJ = NtX.LJIJ.LJ();
            Mission mission = videoPublishEditModel2.creativeFlowData.getCommerceToolsModel().getMission();
            if (mission != null) {
                String str6 = "1";
                int i2 = 1;
                1hK r10 = r26;
                if (!mission.isChallengeToasted() && (challengeNames = mission.getChallengeNames()) != null && !challengeNames.isEmpty() && (challengeNames2 = mission.getChallengeNames()) != null) {
                    boolean z = false;
                    for (T next : challengeNames2) {
                        if (str4.length() > i2 && TextUtils.equals(String.valueOf(str4.charAt(str4.length() - i2)), AnonymousClass5E9.LIZ.LIZ().getString(2131832825))) {
                            C31156Iv r13 = C31156Iv.LIZ;
                            String LIZ = r13.LIZ(str2, str5);
                            Objects.requireNonNull(LIZ, "null cannot be cast to non-null type java.lang.String");
                            String substring = LIZ.substring(0, i - 1);
                            n.LIZIZ(substring, "");
                            z = TextUtils.equals(r13.LIZ(substring), "#".concat(String.valueOf(next)));
                        }
                        str4 = str4;
                        if (TextUtils.equals(str4, "#".concat(String.valueOf(next))) || z) {
                            if (r10 != null) {
                                3af r9 = new 3af(r10);
                                r9.LIZIZ(2131755388);
                                r9.LIZLLL(2130968624);
                                r9.LIZ(5000);
                                r9.LJ(2131827041);
                                3af.LIZ(r9);
                            }
                            AnonymousClass6J4 r1 = new AnonymousClass6J4();
                            r1.LIZ("reason", 3);
                            r1.LIZ("mission_id", mission.getMissionId());
                            r1.LIZ("page_source", mission.getEnterFrom());
                            if (LJ != null) {
                                num2 = Integer.valueOf(LJ.LJIIJJI());
                            } else {
                                num2 = "0";
                            }
                            r1.LIZ("creator_followers", (Object) num2);
                            if (CommerceToolsTcmServiceImpl.LJFF().LIZLLL()) {
                                str6 = "0";
                            }
                            r1.LIZ("creator_type", str6);
                            2nK.LIZ("mission_requirement_toast", r1.LIZ);
                            return;
                        }
                        i2 = 1;
                    }
                }
                if (!mission.isUserToasted() && (mentionedUsers = mission.getMentionedUsers()) != null && !mentionedUsers.isEmpty() && (mentionedUsers2 = mission.getMentionedUsers()) != null) {
                    for (AnonymousClass6YQ nickname : mentionedUsers2) {
                        String nickname2 = nickname.getNickname();
                        if (nickname2 != null && z.LJ(str4, nickname2)) {
                            if (r10 != null) {
                                3af r92 = new 3af(r10);
                                r92.LIZIZ(2131755388);
                                r92.LIZLLL(2130968624);
                                r92.LIZ(5000);
                                r92.LJ(2131827037);
                                3af.LIZ(r92);
                            }
                            AnonymousClass6J4 r12 = new AnonymousClass6J4();
                            r12.LIZ("reason", 2);
                            r12.LIZ("mission_id", mission.getMissionId());
                            r12.LIZ("page_source", mission.getEnterFrom());
                            if (LJ != null) {
                                num = Integer.valueOf(LJ.LJIIJJI());
                            } else {
                                num = "0";
                            }
                            r12.LIZ("creator_followers", (Object) num);
                            if (CommerceToolsTcmServiceImpl.LJFF().LIZLLL()) {
                                str6 = "0";
                            }
                            r12.LIZ("creator_type", str6);
                            2nK.LIZ("mission_requirement_toast", r12.LIZ);
                            return;
                        }
                    }
                }
            }
        }
    }
}
