package com.bytedance.android.live.liveinteract.multiguestv3.widget;

import X.2Pr;
import X.6Is;
import X.7eq;
import X.9qj;
import X.AnonymousClass0CB;
import X.AnonymousClass0CH;
import X.AnonymousClass1Y4;
import X.AnonymousClass2BQ;
import X.C09630aP;
import X.C10000b0;
import X.C14600iQ;
import X.C14700ia;
import X.C16190kz;
import X.C19840qs;
import X.C20260rY;
import X.C20950sf;
import X.C21150sz;
import X.C21280tC;
import X.C21400tO;
import X.C24190xt;
import X.C265013w;
import X.C33641Vi;
import X.C33651Vj;
import X.C34011Wt;
import X.C41491kh;
import X.C41711l3;
import X.C42521mM;
import X.C42971n5;
import X.C515222c;
import X.C54052Bv;
import X.Fz8;
import X.G2l;
import X.GJB;
import X.GQb;
import X.Gc2;
import X.Gg0;
import X.GiY;
import X.LsC;
import X.M12;
import android.view.SurfaceView;
import android.widget.FrameLayout;
import com.bytedance.android.live.liveinteract.commoninterface.BaseInternalLinkMicAnchorWidget;
import com.bytedance.android.live.liveinteract.multilive.anchor.ui.dialog.MultiLiveAnchorOpenCameraDialog;
import com.bytedance.android.livesdk.chatroom.model.interact.LinkPlayerInfo;
import com.bytedance.android.livesdk.livesetting.linkmic.multilive.MultiLiveLinkPanelStyle;
import com.bytedance.android.livesdkapi.depend.model.live.Room;
import com.bytedance.bpea.basics.PrivacyCert;
import com.bytedance.bpea.store.policy.PrivacyPolicyStore;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.sdk.datachannel.DataChannel;
import java.util.List;
import kotlin.h.b.n;

public final class MultiGuestV3AnchorWidget extends BaseInternalLinkMicAnchorWidget implements C42521mM, 6Is {
    public static final C20950sf LJ = new C20950sf((byte) 0);
    public C41711l3 LIZ;
    public C33651Vj LIZIZ;
    public C21400tO LIZJ;
    @C14700ia(LIZ = "MULTI_GUEST_DATA_HOLDER")
    public C33641Vi LIZLLL;
    public C42971n5 LJFF;
    public C19840qs LJI;
    public C265013w LJII;
    public Room LJIIIIZZ;
    public MultiLiveAnchorOpenCameraDialog LJIIIZ;
    public C34011Wt LJIIJ = new C34011Wt(true);
    public final LsC<GQb, 2Pr> LJIIJJI = new C515222c(this);
    public final FrameLayout LJIIL;

    static {
        Covode.recordClassIndex(8545);
    }

    public final void LIZ(String str) {
        M12.LIZ(str);
    }

    public final void LIZ(String str, SurfaceView surfaceView) {
        M12.LIZ(str, surfaceView);
    }

    public final void LIZ(Throwable th) {
        Gc2.LIZ(this, th);
    }

    public final void LIZIZ(String str) {
        M12.LIZ(str);
    }

    public final void LIZLLL(String str) {
        M12.LIZ(str);
    }

    public final void LJ(String str) {
        M12.LIZ(str);
    }

    public final void LJFF(String str) {
        M12.LIZ(str);
    }

    public final int LJII(String str) {
        M12.LIZ(str);
        return 0;
    }

    public final int getLayoutId() {
        return 2131562102;
    }

    public final void onStateChanged(AnonymousClass0CH r1, AnonymousClass0CB r2) {
        super.onStateChanged(r1, r2);
    }

    public final C16190kz LIZJ() {
        return this.LIZ;
    }

    public final void LIZ() {
        C41711l3 r0 = this.LIZ;
        if (r0 != null) {
            r0.LJIIIZ();
        }
    }

    public final void LIZIZ() {
        C41711l3 r0 = this.LIZ;
        if (r0 != null) {
            r0.LIZLLL();
        }
    }

    public final void LIZLLL() {
        C34011Wt r0 = this.LJIIJ;
        if (r0 != null) {
            r0.LIZ();
        }
    }

    public final String LJIIL() {
        return getClass().getName();
    }

    public final void onPause() {
        C41711l3 r0 = this.LIZ;
        if (r0 != null) {
            r0.LJIIIIZZ();
        }
        MultiGuestV3AnchorWidget.super.onPause();
    }

    public final void LJFF() {
        C34011Wt r0;
        if (C20260rY.LIZJ.LIZ().LJIIIIZZ() != C14600iQ.NORMAL && (r0 = this.LJIIJ) != null) {
            r0.LIZJ();
        }
    }

    /* JADX WARNING: type inference failed for: r0v1, types: [android.app.Dialog, X.1n5] */
    /* JADX WARNING: type inference failed for: r0v2, types: [X.1Vj, android.app.Dialog] */
    public final void LJII() {
        C42971n5 r0 = this.LJFF;
        if (r0 != null) {
            r0.LJIIIIZZ();
        }
        ? r02 = this.LJFF;
        if (r02 != 0) {
            G2l.LIZIZ(r02);
        }
        ? r03 = this.LIZIZ;
        if (r03 != 0) {
            G2l.LIZIZ(r03);
        }
    }

    public final void LJ() {
        Fz8.LIZ(this.context, 2131833949);
        C41711l3 r5 = this.LIZ;
        if (r5 != null) {
            7eq r4 = 7eq.RTC_ERROR;
            PrivacyCert.Builder with = PrivacyCert.Builder.Companion.with("bpea-530");
            with.usage("");
            with.tag("stop link mic when error occurs");
            with.policies(new 9qj[]{PrivacyPolicyStore.getAudioPrivacyPolicy()});
            r5.LIZ(r4, with.build());
        }
    }

    /* JADX WARNING: type inference failed for: r4v0, types: [com.bytedance.android.live.liveinteract.multilive.anchor.ui.dialog.MultiLiveAnchorOpenCameraDialog, android.app.Dialog] */
    /* JADX WARNING: type inference failed for: r1v1, types: [X.0CH] */
    /* JADX WARNING: Multi-variable type inference failed */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void LJI() {
        /*
            r5 = this;
            com.bytedance.android.live.liveinteract.multilive.anchor.ui.dialog.MultiLiveAnchorOpenCameraDialog r0 = r5.LJIIIZ
            if (r0 == 0) goto L_0x000c
            boolean r1 = r0.isShowing()
            r0 = 1
            if (r1 != r0) goto L_0x000c
            return
        L_0x000c:
            com.bytedance.android.livesdk.livesetting.linkmic.multilive.MultiLiveLinkPanelStyle r0 = com.bytedance.android.livesdk.livesetting.linkmic.multilive.MultiLiveLinkPanelStyle.INSTANCE
            int r0 = r0.getValue()
            if (r0 <= 0) goto L_0x0048
            X.1Vi r0 = r5.LIZLLL
            java.lang.String r1 = ""
            if (r0 != 0) goto L_0x001d
            kotlin.h.b.n.LIZ(r1)
        L_0x001d:
            boolean r0 = r0.LJFF
            if (r0 != 0) goto L_0x0048
            X.1Vj r0 = r5.LIZIZ
            if (r0 == 0) goto L_0x0028
            r0.dismiss()
        L_0x0028:
            X.1n5 r0 = r5.LJFF
            if (r0 == 0) goto L_0x002f
            r0.dismiss()
        L_0x002f:
            com.bytedance.android.live.liveinteract.multilive.anchor.ui.dialog.MultiLiveAnchorOpenCameraDialog r4 = new com.bytedance.android.live.liveinteract.multilive.anchor.ui.dialog.MultiLiveAnchorOpenCameraDialog
            android.content.Context r3 = r5.context
            kotlin.h.b.n.LIZIZ(r3, r1)
            com.bytedance.ies.sdk.datachannel.DataChannel r2 = r5.dataChannel
            r1 = r5
            java.lang.String r0 = "end_link_and_no_guest"
            r4.<init>(r3, r2, r1, r0)
            r5.LJIIIZ = r4
            r4.show()
            X.2fU r0 = X.2fU.LIZ
            r0.LIZ(r4)
        L_0x0048:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.bytedance.android.live.liveinteract.multiguestv3.widget.MultiGuestV3AnchorWidget.LJI():void");
    }

    public final void onDestroy() {
        C24190xt.LIZ("LinkIn_Anchor_Widget_onDestroy");
        C41711l3 r0 = this.LIZ;
        if (r0 != null) {
            r0.f_();
        }
        C34011Wt r02 = this.LJIIJ;
        if (r02 != null) {
            r02.LIZJ();
        }
        C33651Vj r03 = this.LIZIZ;
        if (r03 != null && r03.isShowing()) {
            C33651Vj r04 = this.LIZIZ;
            if (r04 != null) {
                r04.LIZLLL();
            }
            C33651Vj r05 = this.LIZIZ;
            if (r05 != null) {
                r05.dismiss();
            }
        }
        DataChannel dataChannel = this.dataChannel;
        if (dataChannel != null) {
            dataChannel.LIZIZ(this);
        }
        C34011Wt r06 = this.LJIIJ;
        if (r06 != null) {
            r06.LJ();
        }
        this.LJIIJ = null;
        MultiGuestV3AnchorWidget.super.onDestroy();
        C21280tC LIZ2 = AnonymousClass1Y4.LJI.LIZ();
        if (LIZ2 != null) {
            LIZ2.LIZIZ();
        }
        LJII();
    }

    public final void onResume() {
        MultiGuestV3AnchorWidget.super.onResume();
        C41711l3 r0 = this.LIZ;
        if (r0 != null) {
            r0.LJII();
        }
        MultiLiveAnchorOpenCameraDialog multiLiveAnchorOpenCameraDialog = this.LJIIIZ;
        if (multiLiveAnchorOpenCameraDialog != null && multiLiveAnchorOpenCameraDialog.isShowing()) {
            MultiLiveAnchorOpenCameraDialog multiLiveAnchorOpenCameraDialog2 = this.LJIIIZ;
            if (multiLiveAnchorOpenCameraDialog2 != null) {
                multiLiveAnchorOpenCameraDialog2.LIZ();
            }
        } else if (MultiLiveLinkPanelStyle.INSTANCE.getValue() > 0) {
            C33641Vi r02 = this.LIZLLL;
            if (r02 == null) {
                n.LIZ("");
            }
            if (r02.LJIILL == 0) {
                C33641Vi r03 = this.LIZLLL;
                if (r03 == null) {
                    n.LIZ("");
                }
                r03.LJFF = true;
                Gg0.LIZ().LIZ(new GJB(40));
                DataChannel dataChannel = this.dataChannel;
                if (dataChannel != null) {
                    dataChannel.LIZJ(C54052Bv.class, true);
                }
                DataChannel dataChannel2 = this.dataChannel;
                if (dataChannel2 != null) {
                    dataChannel2.LIZJ(AnonymousClass2BQ.class, new C21150sz(false, "end_link_and_no_guest"));
                }
            }
        }
    }

    /* JADX WARNING: type inference failed for: r0v9, types: [X.0CH] */
    /* JADX WARNING: type inference failed for: r2v4, types: [X.0CH] */
    /* JADX WARNING: Multi-variable type inference failed */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void onCreate() {
        /*
            r5 = this;
            com.bytedance.android.live.liveinteract.multiguestv3.widget.MultiGuestV3AnchorWidget.super.onCreate()
            java.lang.String r0 = "LinkIn_Anchor_Widget_onCreate"
            X.C24190xt.LIZ((java.lang.String) r0)
            com.bytedance.ies.sdk.datachannel.DataChannel r1 = r5.dataChannel
            if (r1 == 0) goto L_0x00bb
            java.lang.Class<X.Fv7> r0 = X.Fv7.class
            java.lang.Object r0 = r1.LIZIZ(r0)
            com.bytedance.android.livesdkapi.depend.model.live.Room r0 = (com.bytedance.android.livesdkapi.depend.model.live.Room) r0
        L_0x0014:
            r5.LJIIIIZZ = r0
            com.bytedance.ies.sdk.datachannel.DataChannelGlobal r2 = com.bytedance.ies.sdk.datachannel.DataChannelGlobal.LIZLLL
            java.lang.Class<X.2CN> r1 = X.AnonymousClass2CN.class
            X.22d r0 = new X.22d
            r0.<init>(r5)
            r2.LIZ(r5, r1, r0)
            com.bytedance.ies.sdk.datachannel.DataChannel r3 = r5.dataChannel
            if (r3 == 0) goto L_0x0067
            java.lang.Class<X.2AX> r1 = X.AnonymousClass2AX.class
            X.LsC<X.GQb, X.2Pr> r0 = r5.LJIIJJI
            r3.LIZ(r5, r1, r0)
            r2 = r5
            java.lang.Class<X.H1t> r1 = X.H1t.class
            X.22e r0 = new X.22e
            r0.<init>(r5)
            r3.LIZ(r2, r1, r0)
            java.lang.Class<X.2CC> r1 = X.AnonymousClass2CC.class
            X.22f r0 = new X.22f
            r0.<init>(r5)
            r3.LIZ(r2, r1, r0)
            java.lang.Class<X.2Bx> r1 = X.C54072Bx.class
            X.22g r0 = new X.22g
            r0.<init>(r5)
            r3.LIZ(r2, r1, r0)
            java.lang.Class<X.2CV> r1 = X.AnonymousClass2CV.class
            X.22h r0 = X.C515722h.LIZ
            r3.LIZ(r2, r1, r0)
            java.lang.Class<X.2BR> r1 = X.AnonymousClass2BR.class
            X.22i r0 = new X.22i
            r0.<init>(r5)
            r3.LIZ(r5, r1, r0)
            java.lang.Class<X.2CB> r1 = X.AnonymousClass2CB.class
            X.22j r0 = new X.22j
            r0.<init>(r5)
            r3.LIZ(r2, r1, r0)
        L_0x0067:
            com.bytedance.android.livesdkapi.depend.model.live.Room r3 = r5.LJIIIIZZ
            java.lang.String r2 = ""
            if (r3 == 0) goto L_0x0079
            X.21c r1 = new X.21c
            com.bytedance.ies.sdk.datachannel.DataChannel r0 = r5.dataChannel
            kotlin.h.b.n.LIZIZ(r0, r2)
            r1.<init>(r3, r0)
            r5.LIZ = r1
        L_0x0079:
            X.1l3 r1 = r5.LIZ
            if (r1 == 0) goto L_0x0081
            r0 = r5
            r1.LIZ(r0)
        L_0x0081:
            com.bytedance.android.livesdk.livesetting.linkmic.multilive.MultiGuestHostSideSwitchSetting r0 = com.bytedance.android.livesdk.livesetting.linkmic.multilive.MultiGuestHostSideSwitchSetting.INSTANCE
            boolean r0 = r0.isEnable()
            if (r0 != 0) goto L_0x0093
            android.content.Context r1 = X.C10000b0.LJ()
            r0 = 2131828226(0x7f111e02, float:1.9289387E38)
            X.Fz8.LIZ(r1, r0)
        L_0x0093:
            X.1l3 r0 = r5.LIZ
            if (r0 == 0) goto L_0x00aa
            X.1Wt r4 = r5.LJIIJ
            if (r4 == 0) goto L_0x00aa
            com.bytedance.ies.sdk.datachannel.DataChannel r3 = r5.dataChannel
            kotlin.h.b.n.LIZIZ(r3, r2)
            X.1Un r2 = r0.LIZJ()
            android.widget.FrameLayout r1 = r5.LJIIL
            r0 = r5
            r4.LIZ(r3, r2, r1, r0)
        L_0x00aa:
            X.0tD r4 = X.AnonymousClass1Y4.LJI
            com.bytedance.android.livesdkapi.depend.model.live.Room r3 = r5.LJIIIIZZ
            android.content.Context r0 = r5.context
            X.1hK r2 = X.G2l.LIZ(r0)
            com.bytedance.ies.sdk.datachannel.DataChannel r1 = r5.dataChannel
            r0 = 1
            r4.LIZ(r3, r2, r1, r0)
            return
        L_0x00bb:
            r0 = 0
            goto L_0x0014
        */
        throw new UnsupportedOperationException("Method not decompiled: com.bytedance.android.live.liveinteract.multiguestv3.widget.MultiGuestV3AnchorWidget.onCreate():void");
    }

    public final void LIZ(C33651Vj r1) {
        M12.LIZ(r1);
        this.LIZIZ = r1;
    }

    public MultiGuestV3AnchorWidget(FrameLayout frameLayout) {
        M12.LIZ(frameLayout);
        this.LJIIL = frameLayout;
        C41491kh.LIZ.LIZ((Object) this);
    }

    public final void LIZ(C42971n5 r2) {
        M12.LIZ(r2);
        r2.LIZ((C16190kz) this.LIZ);
        this.LJFF = r2;
    }

    public final void LIZJ(String str) {
        M12.LIZ(str);
        Fz8.LIZ(C10000b0.LJ(), C10000b0.LIZ(2131829299, str), 0);
    }

    public final int LJI(String str) {
        M12.LIZ(str);
        GiY LIZ2 = GiY.LIZ();
        n.LIZIZ(LIZ2, "");
        if (n.LIZ(str, LIZ2.LJII)) {
            return 0;
        }
        C19840qs r0 = this.LJI;
        if (r0 != null) {
            return r0.LJ(str);
        }
        return -1;
    }

    public final void LIZIZ(List<LinkPlayerInfo> list) {
        Integer num;
        C42971n5 r0;
        M12.LIZ(list);
        if (isViewValid()) {
            StringBuilder sb = new StringBuilder("onPlayerListChange mUserListDialog.hash = ");
            C33651Vj r02 = this.LIZIZ;
            Integer num2 = null;
            if (r02 != null) {
                num = Integer.valueOf(r02.hashCode());
            } else {
                num = null;
            }
            sb.append(num);
            sb.append(" mUserListDialogV2 = ");
            C42971n5 r03 = this.LJFF;
            if (r03 != null) {
                num2 = Integer.valueOf(r03.hashCode());
            }
            sb.append(num2);
            C09630aP.LIZ(3, "MultiGuestV3AnchorWidget", sb.toString());
            C33651Vj r04 = this.LIZIZ;
            if (r04 == null || !r04.isShowing()) {
                C42971n5 r05 = this.LJFF;
                if (r05 != null && r05.isShowing() && (r0 = this.LJFF) != null) {
                    r0.LJI();
                    return;
                }
                return;
            }
            C33651Vj r06 = this.LIZIZ;
            if (r06 != null) {
                r06.LIZ(list);
            }
        }
    }

    /* JADX WARNING: type inference failed for: r7v0, types: [X.0CH] */
    /* JADX WARNING: type inference failed for: r1v1, types: [X.1Vj, android.app.Dialog] */
    /* JADX WARNING: type inference failed for: r3v0, types: [X.0CH] */
    /* JADX WARNING: type inference failed for: r1v3, types: [android.app.Dialog, X.1n5] */
    /* JADX WARNING: Multi-variable type inference failed */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void LIZ(java.util.List<com.bytedance.android.livesdk.chatroom.model.interact.LinkPlayerInfo> r13) {
        /*
            r12 = this;
            X.M12.LIZ(r13)
            X.2sG r5 = new X.2sG
            r5.<init>()
            r5.element = r13
            boolean r0 = r12.isViewValid()
            if (r0 != 0) goto L_0x0011
            return
        L_0x0011:
            java.lang.Object r0 = r5.element
            if (r0 != 0) goto L_0x001c
            java.util.ArrayList r0 = new java.util.ArrayList
            r0.<init>()
            r5.element = r0
        L_0x001c:
            X.1l3 r9 = r12.LIZ
            if (r9 == 0) goto L_0x0096
            X.1Vi r1 = r12.LIZLLL
            java.lang.String r2 = ""
            if (r1 != 0) goto L_0x0029
            kotlin.h.b.n.LIZ(r2)
        L_0x0029:
            X.0tO r0 = r12.LIZJ
            if (r0 == 0) goto L_0x006b
            int r0 = r0.LIZ
        L_0x002f:
            r1.LJJII = r0
            com.bytedance.android.livesdk.livesetting.linkmic.multilive.MultiLiveLinkPanelStyle r0 = com.bytedance.android.livesdk.livesetting.linkmic.multilive.MultiLiveLinkPanelStyle.INSTANCE
            int r0 = r0.getValue()
            if (r0 <= 0) goto L_0x006d
            X.1n5 r4 = new X.1n5
            r3 = r12
            android.content.Context r1 = r12.context
            kotlin.h.b.n.LIZIZ(r1, r2)
            X.1l3 r0 = r12.LIZ
            r2 = 0
            if (r0 == 0) goto L_0x0069
            com.bytedance.ies.sdk.datachannel.DataChannel r0 = r0.LJIIJ()
        L_0x004a:
            r4.<init>(r3, r1, r0)
            r4.LIZ((X.C16190kz) r9)
            r12.LJFF = r4
            X.0sg r0 = new X.0sg
            r0.<init>(r12, r5)
            r4.setOnDismissListener(r0)
            X.1n5 r1 = r12.LJFF
            if (r1 == 0) goto L_0x0066
            r1.show()
            X.2fU r0 = X.2fU.LIZ
            r0.LIZ(r1)
        L_0x0066:
            r12.LIZJ = r2
            return
        L_0x0069:
            r0 = r2
            goto L_0x004a
        L_0x006b:
            r0 = -1
            goto L_0x002f
        L_0x006d:
            X.1n6 r6 = new X.1n6
            r7 = r12
            android.content.Context r8 = r12.context
            kotlin.h.b.n.LIZIZ(r8, r2)
            java.lang.Object r10 = r5.element
            java.util.List r10 = (java.util.List) r10
            com.bytedance.ies.sdk.datachannel.DataChannel r11 = r9.LJIIJ()
            r6.<init>(r7, r8, r9, r10, r11)
            r12.LIZIZ = r6
            X.0sh r0 = new X.0sh
            r0.<init>(r12, r5)
            r6.setOnDismissListener(r0)
            X.1Vj r1 = r12.LIZIZ
            if (r1 == 0) goto L_0x0096
            r1.show()
            X.2fU r0 = X.2fU.LIZ
            r0.LIZ(r1)
        L_0x0096:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.bytedance.android.live.liveinteract.multiguestv3.widget.MultiGuestV3AnchorWidget.LIZ(java.util.List):void");
    }

    public final void LIZ(long j, long j2) {
        StringBuilder sb = new StringBuilder();
        sb.append(j);
        sb.append(' ');
        sb.append(j2);
        C09630aP.LIZ(4, "bitrate_callback", sb.toString());
        C265013w r0 = this.LJII;
        if (r0 != null) {
            r0.LIZ();
        }
    }
}
