package com.ss.android.ugc.aweme.discover.ui.bottomsheet.filter.powerlist;

import X.0CH;
import X.0HH;
import X.2Pr;
import X.4HR;
import X.4hP;
import X.7he;
import X.A82;
import X.A83;
import X.A84;
import X.A85;
import X.A86;
import X.A87;
import X.A88;
import X.A89;
import X.A8A;
import X.APV;
import X.APW;
import X.APX;
import X.APY;
import X.APZ;
import X.ARA;
import X.ARD;
import X.ARE;
import X.C1014APa;
import X.C1015APb;
import X.C1016APc;
import X.C1017APd;
import X.C1018APe;
import X.C1019APf;
import X.C1020APg;
import X.C1021APh;
import X.C1022APi;
import X.C1023APj;
import X.C5724CAe;
import X.Crj;
import X.Csa;
import X.Csw;
import X.Csy;
import X.Ct1;
import X.Cuh;
import X.Cus;
import X.Cv8;
import X.Cvh;
import X.CwK;
import X.CwU;
import X.Cwc;
import X.Cwf;
import X.D1G;
import X.DaP;
import X.KEM;
import X.LnI;
import X.LsC;
import X.LsD;
import X.LsE;
import X.LsF;
import X.Lsh;
import X.M12;
import X.Okm;
import X.PHD;
import X.Qeg;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.StateListDrawable;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.bytedance.assem.arch.viewModel.AssemViewModel;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.powerlist.PowerCell;
import com.ss.android.ugc.aweme.discover.ui.bottomsheet.filter.SearchFilterViewModel;
import kotlin.h.b.n;

public final class FlowLayoutCell extends PowerCell<C1014APa> implements ARE {
    public final Csa LIZ;
    public final Crj LIZIZ;

    static {
        Covode.recordClassIndex(65743);
    }

    private final Qeg LIZIZ() {
        return (Qeg) this.LIZIZ.getValue();
    }

    public final SearchFilterViewModel LIZ() {
        return (SearchFilterViewModel) this.LIZ.getValue();
    }

    public final 0CH getActualLifecycleOwner() {
        ARD.LIZIZ(this);
        return this;
    }

    public final Cv8 getActualLifecycleOwnerHolder() {
        ARD.LIZ(this);
        return this;
    }

    public final 4hP getActualReceiver() {
        ARD.LIZLLL(this);
        return this;
    }

    public final Cuh<4hP> getActualReceiverHolder() {
        ARD.LIZJ(this);
        return this;
    }

    public final 0CH getHostLifecycleOwner() {
        M12.LIZ(this);
        return null;
    }

    public final 0CH getOwnLifecycleOwner() {
        ARD.LJ(this);
        return this;
    }

    public final 4hP getReceiverForHostVM() {
        M12.LIZ(this);
        return null;
    }

    public final boolean getUniqueOnlyDefault() {
        return ARD.LJFF(this);
    }

    public FlowLayoutCell() {
        Csa csa;
        Csw csw = Csw.LIZ;
        D1G LIZ2 = KEM.LIZ.LIZ(SearchFilterViewModel.class);
        A89 a89 = new A89(LIZ2);
        A8A a8a = A8A.INSTANCE;
        if (n.LIZ(csw, Csw.LIZ)) {
            csa = new Csa(LIZ2, a89, C1016APc.INSTANCE, new A83(this), new A82(this), C1023APj.INSTANCE, a8a);
        } else if (n.LIZ(csw, Csy.LIZ)) {
            csa = new Csa(LIZ2, a89, C1017APd.INSTANCE, new A85(this), new A84(this), C1022APi.INSTANCE, a8a);
        } else if (csw != null && !n.LIZ(csw, Ct1.LIZ)) {
            throw new IllegalArgumentException("Don't support this VMScope: " + csw + " there");
        } else {
            csa = new Csa(LIZ2, a89, C1015APb.INSTANCE, new A88(this), new A86(this), new A87(this), a8a);
        }
        this.LIZ = csa;
        this.LIZIZ = 7he.LIZ(new C1018APe(this));
    }

    public final void bD_() {
        FlowLayoutCell.super.bD_();
        LIZIZ().setOnClickListener(new APZ(this));
        Cus.LIZ(this, LIZ(), C1019APf.LIZ, (Cvh) null, new APV(this), 6);
        Cus.LIZ(this, LIZ(), C1020APg.LIZ, (Cvh) null, new APX(this), 6);
        Cus.LIZ(this, LIZ(), C1021APh.LIZ, (Cvh) null, new APY(this), 6);
        Qeg LIZIZ2 = LIZIZ();
        C5724CAe cAe = C5724CAe.LIZ;
        View view = this.itemView;
        n.LIZIZ(view, "");
        Context context = view.getContext();
        n.LIZIZ(context, "");
        int LIZ2 = Okm.LIZ(context, 2130968604, 2131099668);
        View view2 = this.itemView;
        n.LIZIZ(view2, "");
        Context context2 = view2.getContext();
        n.LIZIZ(context2, "");
        int LIZ3 = Okm.LIZ(context2, 2130968648, 2131099731);
        Resources system = Resources.getSystem();
        n.LIZIZ(system, "");
        Drawable LIZ4 = cAe.LIZ(LIZ2, LIZ3, LnI.LIZ(TypedValue.applyDimension(1, 1.0f, system.getDisplayMetrics())), ARA.LIZ(2));
        C5724CAe cAe2 = C5724CAe.LIZ;
        View view3 = this.itemView;
        n.LIZIZ(view3, "");
        Context context3 = view3.getContext();
        n.LIZIZ(context3, "");
        int LIZ5 = Okm.LIZ(context3, 2130968604, 2131099668);
        View view4 = this.itemView;
        n.LIZIZ(view4, "");
        Context context4 = view4.getContext();
        n.LIZIZ(context4, "");
        int LIZ6 = Okm.LIZ(context4, 2130968638, 2131099720);
        Resources system2 = Resources.getSystem();
        n.LIZIZ(system2, "");
        Drawable LIZ7 = cAe2.LIZ(LIZ5, LIZ6, LnI.LIZ(TypedValue.applyDimension(1, 1.0f, system2.getDisplayMetrics())), ARA.LIZ(2));
        M12.LIZ(LIZ4, LIZ7);
        StateListDrawable stateListDrawable = new StateListDrawable();
        stateListDrawable.addState(new int[]{16842913}, LIZ4);
        stateListDrawable.addState(new int[]{-16842913}, LIZ7);
        LIZIZ2.setBackground(stateListDrawable);
    }

    public final View LIZ(ViewGroup viewGroup) {
        M12.LIZ(viewGroup);
        View LIZ2 = 0HH.LIZ(LayoutInflater.from(viewGroup.getContext()), 2131561222, viewGroup, false);
        n.LIZIZ(LIZ2, "");
        return LIZ2;
    }

    public final /* synthetic */ void LIZ(DaP daP) {
        C1014APa aPa = (C1014APa) daP;
        M12.LIZ(aPa);
        FlowLayoutCell.super.LIZ(aPa);
        LIZIZ().setText(aPa.LIZ.getName());
        SearchFilterViewModel LIZ2 = LIZ();
        APW apw = new APW(this, aPa);
        M12.LIZ(LIZ2, apw);
        ARD.LIZ(this, LIZ2, apw);
    }

    public final void LIZIZ(boolean z) {
        Qeg LIZIZ2 = LIZIZ();
        LIZIZ2.setSelected(z);
        if (z) {
            View view = this.itemView;
            n.LIZIZ(view, "");
            Context context = view.getContext();
            n.LIZIZ(context, "");
            LIZIZ2.setTextColor(Okm.LIZ(context, 2130968648, 2131099731));
            LIZIZ2.setTuxFont(52);
            return;
        }
        View view2 = this.itemView;
        n.LIZIZ(view2, "");
        Context context2 = view2.getContext();
        n.LIZIZ(context2, "");
        LIZIZ2.setTextColor(Okm.LIZ(context2, 2130968666, 2131099750));
        LIZIZ2.setTuxFont(51);
    }

    public final <S extends 4HR> void subscribe(AssemViewModel<S> assemViewModel, Cvh<S> cvh, LsC<? super Throwable, 2Pr> lsC, LsD<? super 4hP, ? super S, 2Pr> lsD) {
        M12.LIZ(assemViewModel, cvh, lsD);
        ARD.LIZ(this, assemViewModel, cvh, lsC, lsD);
    }

    public final <S extends 4HR, A> void selectSubscribe(AssemViewModel<S> assemViewModel, PHD<S, ? extends A> phd, Cvh<CwK<A>> cvh, LsC<? super Throwable, 2Pr> lsC, LsD<? super 4hP, ? super A, 2Pr> lsD) {
        M12.LIZ(assemViewModel, phd, cvh, lsD);
        ARD.LIZ(this, assemViewModel, phd, cvh, lsC, lsD);
    }

    public final <S extends 4HR, A> void selectSubscribeOnAsync(AssemViewModel<S> assemViewModel, PHD<S, ? extends A> phd, Cvh<CwK<A>> cvh, LsC<? super Throwable, 2Pr> lsC, LsD<? super 4hP, ? super A, 2Pr> lsD) {
        M12.LIZ(assemViewModel, phd, cvh, lsD);
        ARD.LIZIZ(this, assemViewModel, phd, cvh, lsC, lsD);
    }

    public final <S extends 4HR, A, B> void selectSubscribe(AssemViewModel<S> assemViewModel, PHD<S, ? extends A> phd, PHD<S, ? extends B> phd2, Cvh<CwU<A, B>> cvh, LsC<? super Throwable, 2Pr> lsC, LsE<? super 4hP, ? super A, ? super B, 2Pr> lsE) {
        M12.LIZ(assemViewModel, phd, phd2, cvh, lsE);
        ARD.LIZ(this, assemViewModel, phd, phd2, cvh, lsC, lsE);
    }

    public final <S extends 4HR, A, B, C> void selectSubscribe(AssemViewModel<S> assemViewModel, PHD<S, ? extends A> phd, PHD<S, ? extends B> phd2, PHD<S, ? extends C> phd3, Cvh<Cwc<A, B, C>> cvh, LsC<? super Throwable, 2Pr> lsC, LsF<? super 4hP, ? super A, ? super B, ? super C, 2Pr> lsF) {
        LsF<? super 4hP, ? super A, ? super B, ? super C, 2Pr> lsF2 = lsF;
        AssemViewModel<S> assemViewModel2 = assemViewModel;
        PHD<S, ? extends A> phd4 = phd;
        PHD<S, ? extends B> phd5 = phd2;
        PHD<S, ? extends C> phd6 = phd3;
        Cvh<Cwc<A, B, C>> cvh2 = cvh;
        M12.LIZ(assemViewModel2, phd4, phd5, phd6, cvh2, lsF2);
        ARD.LIZ(this, assemViewModel2, phd4, phd5, phd6, cvh2, lsC, lsF2);
    }

    public final <S extends 4HR, A, B, C, D> void selectSubscribe(AssemViewModel<S> assemViewModel, PHD<S, ? extends A> phd, PHD<S, ? extends B> phd2, PHD<S, ? extends C> phd3, PHD<S, ? extends D> phd4, Cvh<Cwf<A, B, C, D>> cvh, LsC<? super Throwable, 2Pr> lsC, Lsh<? super 4hP, ? super A, ? super B, ? super C, ? super D, 2Pr> lsh) {
        Lsh<? super 4hP, ? super A, ? super B, ? super C, ? super D, 2Pr> lsh2 = lsh;
        AssemViewModel<S> assemViewModel2 = assemViewModel;
        PHD<S, ? extends A> phd5 = phd;
        PHD<S, ? extends B> phd6 = phd2;
        PHD<S, ? extends C> phd7 = phd3;
        PHD<S, ? extends D> phd8 = phd4;
        Cvh<Cwf<A, B, C, D>> cvh2 = cvh;
        M12.LIZ(assemViewModel2, phd5, phd6, phd7, phd8, cvh2, lsh2);
        ARD.LIZ(this, assemViewModel2, phd5, phd6, phd7, phd8, cvh2, lsC, lsh2);
    }
}
