package com.ss.android.ugc.aweme.poi.videolist;

import X.0C0;
import X.0CH;
import X.0HH;
import X.2sG;
import X.3EX;
import X.4Jn;
import X.7he;
import X.8eL;
import X.8fM;
import X.8fh;
import X.8fu;
import X.8g3;
import X.8g4;
import X.A7H;
import X.BE6;
import X.BE7;
import X.BE9;
import X.BEB;
import X.BEC;
import X.BED;
import X.BEP;
import X.BEQ;
import X.BGG;
import X.C1393AbV;
import X.C2188AoK;
import X.C2202AoY;
import X.C3149B9d;
import X.C3264BDo;
import X.C3266BDq;
import X.C3267BDr;
import X.C3271BDv;
import X.C3272BDw;
import X.C3835BZn;
import X.Crj;
import X.Csa;
import X.Css;
import X.Csw;
import X.Csy;
import X.Ct1;
import X.CuL;
import X.Cus;
import X.Cvh;
import X.D1G;
import X.DYo;
import X.DZp;
import X.DaP;
import X.KEM;
import X.M12;
import X.MNS;
import X.QHW;
import X.QJt;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.recyclerview.widget.GridLayoutManager;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.powerlist.PowerCell;
import com.bytedance.lighten.loader.SmartImageView;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import com.ss.android.ugc.aweme.feed.model.Video;
import com.ss.android.ugc.aweme.poi.collect.PoiCollectStatusViewModel;
import kotlin.h.b.n;

public final class PoiVideoListContentAssem extends DYo<PoiVideoListSharedViewModel> {
    public float LJIIIIZZ;
    public final int LJIIIZ = 10;
    public final Crj LJIIJ = 7he.LIZ(new C3271BDv(this));
    public final Crj LJIIJJI = 7he.LIZ(new BEC(this));
    public final Csa LJIIL;
    public final 4Jn LJIILIIL;

    static {
        Covode.recordClassIndex(97555);
    }

    public final DZp LJIJJLI() {
        return (DZp) this.LJIIJ.getValue();
    }

    /* renamed from: LJJ */
    public final PoiVideoListSharedViewModel LIZ() {
        return (PoiVideoListSharedViewModel) this.LJIIJJI.getValue();
    }

    public final BEB LJJI() {
        return (BEB) this.LJIILIIL.getValue();
    }

    public final C1393AbV LJIL() {
        C1393AbV abV = new C1393AbV();
        abV.LIZIZ = true;
        return abV;
    }

    public static final class PoiVideoListItemCell extends PowerCell<C3266BDq> {
        public SmartImageView LIZ;

        static {
            Covode.recordClassIndex(97556);
        }

        public final void bE_() {
            PoiVideoListContentAssem.super.bE_();
            SmartImageView smartImageView = this.LIZ;
            if (smartImageView != null) {
                smartImageView.setAttached(true);
            }
            SmartImageView smartImageView2 = this.LIZ;
            if (smartImageView2 != null) {
                smartImageView2.LIZIZ();
            }
        }

        public final void bF_() {
            PoiVideoListContentAssem.super.bF_();
            SmartImageView smartImageView = this.LIZ;
            if (smartImageView != null) {
                smartImageView.setAttached(false);
            }
            SmartImageView smartImageView2 = this.LIZ;
            if (smartImageView2 != null) {
                smartImageView2.LIZIZ();
            }
        }

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

        public final /* synthetic */ void LIZ(DaP daP) {
            Aweme aweme;
            Video video;
            SmartImageView smartImageView;
            C3266BDq bDq = (C3266BDq) daP;
            M12.LIZ(bDq);
            Aweme aweme2 = bDq.LIZIZ;
            String str = bDq.LIZ;
            if (str == null) {
                str = "";
            }
            int adapterPosition = getAdapterPosition();
            M12.LIZ(aweme2, str);
            8eL.LIZJ().execute(new C3149B9d(adapterPosition, str, aweme2));
            this.LIZ = this.itemView.findViewById(2131363809);
            this.itemView.setOnClickListener(new C3264BDo(this, bDq));
            C3266BDq bDq2 = this.LIZLLL;
            if (bDq2 != null && (aweme = bDq2.LIZIZ) != null && (video = aweme.getVideo()) != null && (smartImageView = this.LIZ) != null) {
                if (C3835BZn.LIZ(C3835BZn.LIZ, smartImageView, video, "PoiVideoListItem", false, false, 120)) {
                    smartImageView.setAttached(true);
                    smartImageView.LIZIZ();
                    return;
                }
                QJt LIZ2 = QHW.LIZ(3EX.LIZ(video.getCover()));
                LIZ2.LJJIIZ = smartImageView;
                LIZ2.LIZJ();
            }
        }
    }

    public PoiVideoListContentAssem() {
        Csa csa;
        Csy csy = Csy.LIZ;
        D1G LIZ = KEM.LIZ.LIZ(PoiCollectStatusViewModel.class);
        C3272BDw bDw = new C3272BDw(LIZ);
        BEQ beq = BEQ.INSTANCE;
        if (n.LIZ(csy, Csw.LIZ)) {
            csa = new Csa(LIZ, bDw, Css.LIZ, C2188AoK.LIZIZ((CuL) this, true), C2188AoK.LIZJ(this, true), A7H.LIZ, beq, C2188AoK.LIZ((CuL) this, true), C2188AoK.LIZLLL(this, true));
        } else if (n.LIZ(csy, Csy.LIZ)) {
            csa = new Csa(LIZ, bDw, Css.LIZ, C2188AoK.LIZIZ((CuL) this, false), C2188AoK.LIZJ(this, false), A7H.LIZ, beq, C2188AoK.LIZ((CuL) this, false), C2188AoK.LIZLLL(this, false));
        } else if (csy != null && !n.LIZ(csy, Ct1.LIZ)) {
            throw new IllegalArgumentException("Don't support this VMScope here.");
        } else {
            csa = new Csa(LIZ, bDw, Css.LIZ, C2188AoK.LIZ((0CH) this, false), C2188AoK.LIZ((0C0) this, false), A7H.LIZ, beq, C2188AoK.LIZIZ((CuL) this), C2188AoK.LIZJ(this));
        }
        this.LJIIL = csa;
        this.LJIILIIL = new 4Jn(LJIJ(), C2202AoY.LIZ((CuL) this, BEB.class, "PoiVideoListHierarchyData"));
    }

    public final void LIZ(String str) {
        if (BE9.LIZJ.LIZ()) {
            LIZIZ(str);
            return;
        }
        BE9 be9 = BE9.LIZJ;
        Context context = bZ_().LIZJ;
        BED bed = new BED(this, str);
        M12.LIZ(bed);
        if (!be9.LIZ() && BGG.LIZIZ.LIZIZ()) {
            8fu r3 = new 8fu();
            r3.LIZ = "com.ss.android.ugc.aweme.poi_map";
            r3.LIZJ = false;
            8fM r1 = new 8fM();
            r1.LIZ = true;
            r1.LJIIIZ = BE9.LIZIZ;
            r1.LJI = 8fh.REPLACE;
            r3.LJFF = r1.LIZ();
            r3.LIZLLL = bed;
            if (context != null) {
                8g4 r12 = new 8g4();
                r12.LIZIZ = context.getString(2131826853);
                r12.LIZJ = context.getString(2131826854);
                r3.LJII = new 8g3(r12, (byte) 0);
            }
            BE9.LIZ.LIZ(r3.LIZ());
        }
    }

    public final void LIZIZ(View view) {
        M12.LIZ(view);
        PoiVideoListContentAssem.super.LIZIZ(view);
        LJIJJLI().setLifecycleOwner(this);
        LJIJJLI().LIZ(new Class[]{PoiVideoListItemCell.class});
        int LIZJ = MNS.LIZ.LIZ().LIZJ();
        DZp LJIJJLI = LJIJJLI();
        bZ_();
        GridLayoutManager gridLayoutManager = new GridLayoutManager(LIZJ);
        gridLayoutManager.LIZ(new C3267BDr(this, LIZJ));
        LJIJJLI.setLayoutManager(gridLayoutManager);
        2sG r1 = new 2sG();
        r1.element = null;
        Cus.LIZ(this, LIZ(), BEP.LIZ, (Cvh) null, new BE7(this, r1, view), 6);
        LJIJJLI().LIZ(new BE6(this));
    }

    /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r9v1, resolved type: android.os.Bundle} */
    /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r9v2, resolved type: java.lang.String} */
    /* JADX WARNING: type inference failed for: r9v0 */
    /* JADX WARNING: type inference failed for: r9v5 */
    /* JADX WARNING: type inference failed for: r9v6 */
    /* JADX WARNING: Multi-variable type inference failed */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void LIZIZ(java.lang.String r31) {
        /*
            r30 = this;
            com.bytedance.assem.arch.core.AssemSupervisor r0 = r30.bZ_()
            android.content.Context r1 = r0.LIZJ
            if (r1 == 0) goto L_0x00c1
            X.BEB r0 = r30.LJJI()
            X.B9f r0 = r0.LIZJ
            r9 = 0
            if (r0 == 0) goto L_0x00af
            X.BP3 r7 = X.BP3.LIZ
            com.ss.android.ugc.aweme.poi.videolist.PoiVideoListSharedViewModel r2 = r30.LIZ()
            X.4HR r2 = r2.getState()
            X.BEb r2 = (X.C3277BEb) r2
            X.BEA r2 = r2.LIZ
            if (r2 == 0) goto L_0x00ba
            java.lang.String r8 = r2.LIZ
        L_0x0023:
            com.ss.android.ugc.aweme.poi.videolist.PoiVideoListSharedViewModel r2 = r30.LIZ()
            X.4HR r2 = r2.getState()
            X.BEb r2 = (X.C3277BEb) r2
            X.BEA r2 = r2.LIZ
            if (r2 == 0) goto L_0x0033
            java.lang.String r9 = r2.LIZIZ
        L_0x0033:
            com.ss.android.ugc.aweme.poi.videolist.PoiVideoListSharedViewModel r2 = r30.LIZ()
            java.lang.String r10 = r2.LIZ
            if (r10 != 0) goto L_0x003d
            java.lang.String r10 = ""
        L_0x003d:
            java.lang.String r11 = r0.getPoiId()
            java.lang.String r12 = r0.getPoiName()
            java.lang.String r13 = r0.getPoiCity()
            java.lang.String r14 = r0.getDescription()
            java.lang.Integer r15 = r0.getPoiDeviceSameCity()
            java.lang.String r16 = r0.getPoiCityCode()
            java.lang.Long r17 = r0.getVideoCount()
            java.lang.String r18 = r0.getPoiRegionCode()
            java.lang.String r19 = r0.getPoiBackEndType()
            java.lang.String r20 = r0.getPoiInfoSource()
            java.lang.String r21 = r0.getFromGroupId()
            com.ss.android.ugc.aweme.base.model.UrlModel r22 = r0.getIcon()
            X.BEB r0 = r30.LJJI()
            java.lang.String r6 = r0.LIZ
            X.BEB r0 = r30.LJJI()
            java.lang.String r5 = r0.LIZIZ
            X.BEB r0 = r30.LJJI()
            java.lang.String r4 = r0.LIZLLL
            X.BEB r0 = r30.LJJI()
            java.lang.String r3 = r0.LJ
            X.BEB r0 = r30.LJJI()
            java.lang.String r2 = r0.LJFF
            r0 = r30
            X.Csa r0 = r0.LJIIL
            java.lang.Object r0 = r0.getValue()
            com.bytedance.assem.arch.viewModel.AssemViewModel r0 = (com.bytedance.assem.arch.viewModel.AssemViewModel) r0
            X.4HR r0 = r0.getState()
            X.BFo r0 = (X.C3316BFo) r0
            boolean r0 = r0.LIZ
            r23 = r31
            r24 = r6
            r25 = r5
            r26 = r4
            r27 = r3
            r28 = r2
            r29 = r0
            android.os.Bundle r9 = r7.LIZ(r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, r20, r21, r22, r23, r24, r25, r26, r27, r28, r29)
        L_0x00af:
            X.FNZ r2 = X.FNZ.LIZ
            X.BP3 r0 = X.BP3.LIZ
            java.lang.Class r0 = r0.LIZ()
            if (r0 != 0) goto L_0x00bd
            return
        L_0x00ba:
            r8 = r9
            goto L_0x0023
        L_0x00bd:
            X.FNZ.LIZ(r2, r1, r0, r9)
            return
        L_0x00c1:
            r0 = r30
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.poi.videolist.PoiVideoListContentAssem.LIZIZ(java.lang.String):void");
    }
}
