package com.ss.android.ugc.aweme.duetmode.impl;

import X.4er;
import X.C3505BMv;
import X.C3855Ba7;
import X.EXZ;
import X.EiA;
import X.Lnj;
import X.M12;
import X.TnU;
import X.TnV;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.ss.android.ugc.aweme.detail.ui.DetailFragment;
import com.ss.android.ugc.aweme.duetmode.ui.DuetDiscoverAwemeListFragment;
import com.ss.android.ugc.aweme.tools.detail.IDeutModeDiscoverService;

public final class DuetDiscoverServiceImpl implements IDeutModeDiscoverService {
    static {
        Covode.recordClassIndex(67791);
    }

    public final String LIZ() {
        return 4er.LIZ();
    }

    public static IDeutModeDiscoverService LIZIZ() {
        MethodCollector.i(11753);
        IDeutModeDiscoverService iDeutModeDiscoverService = (IDeutModeDiscoverService) Lnj.LIZ(IDeutModeDiscoverService.class, false);
        if (iDeutModeDiscoverService != null) {
            MethodCollector.o(11753);
            return iDeutModeDiscoverService;
        }
        Object LIZIZ = Lnj.LIZIZ(IDeutModeDiscoverService.class, false);
        if (LIZIZ != null) {
            IDeutModeDiscoverService iDeutModeDiscoverService2 = (IDeutModeDiscoverService) LIZIZ;
            MethodCollector.o(11753);
            return iDeutModeDiscoverService2;
        }
        if (Lnj.LLJILLL == null) {
            synchronized (IDeutModeDiscoverService.class) {
                try {
                    if (Lnj.LLJILLL == null) {
                        Lnj.LLJILLL = new DuetDiscoverServiceImpl();
                    }
                } catch (Throwable th) {
                    MethodCollector.o(11753);
                    throw th;
                }
            }
        }
        DuetDiscoverServiceImpl duetDiscoverServiceImpl = (DuetDiscoverServiceImpl) Lnj.LLJILLL;
        MethodCollector.o(11753);
        return duetDiscoverServiceImpl;
    }

    public final EiA LIZ(EXZ<?, ?> exz) {
        return new C3855Ba7(exz);
    }

    public final Fragment LIZ(String str) {
        M12.LIZ(str);
        String LIZ = 4er.LIZ();
        int hashCode = LIZ.hashCode();
        if (hashCode != -1008505828) {
            if (hashCode != 345765098 || !LIZ.equals("two_columns")) {
                return null;
            }
            M12.LIZ(str);
            DuetDiscoverAwemeListFragment duetDiscoverAwemeListFragment = new DuetDiscoverAwemeListFragment();
            duetDiscoverAwemeListFragment.LJJIJIL = new C3505BMv();
            Bundle bundle = new Bundle();
            bundle.putBoolean("extra_challenge_is_hashtag", false);
            bundle.putString("extra_challenge_hashtag_name", "");
            bundle.putString("detail_aweme_from", "from_duet_mode");
            bundle.putString("creation_id", str);
            duetDiscoverAwemeListFragment.setArguments(bundle);
            return duetDiscoverAwemeListFragment;
        } else if (!LIZ.equals("full_screen")) {
            return null;
        } else {
            TnV tnV = new TnV();
            tnV.setFrom("from_duet_mode");
            tnV.setVideoType(51);
            tnV.setEventType(TnU.LIZ("", tnV.getFrom()));
            tnV.setCreationId(str);
            return DetailFragment.LIZ(tnV, new Bundle());
        }
    }
}
