package com.bytedance.android.livesdk.browser.jsbridge.newmethods;

import X.KMI;
import com.bytedance.covode.number.Covode;
import org.json.JSONObject;

public final class LiveGiftAuthMethod extends KMI<JSONObject, Object> {
    static {
        Covode.recordClassIndex(13016);
    }

    /* JADX WARNING: Removed duplicated region for block: B:17:0x0065  */
    /* JADX WARNING: Removed duplicated region for block: B:20:0x006e  */
    /* JADX WARNING: Removed duplicated region for block: B:23:0x007f  */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final org.json.JSONObject invoke(org.json.JSONObject r10, X.KLg r11) {
        /*
            r9 = this;
            X.M12.LIZ(r10, r11)
            X.0Uq r0 = X.0Ur.LIZ
            com.bytedance.android.live.base.model.user.User r2 = r0.LIZ()
            com.bytedance.ies.sdk.datachannel.DataChannelGlobal r1 = com.bytedance.ies.sdk.datachannel.DataChannelGlobal.LIZLLL
            java.lang.Class<X.HEP> r0 = X.HEP.class
            java.lang.Object r4 = r1.LIZIZ(r0)
            com.bytedance.android.livesdkapi.depend.model.live.Room r4 = (com.bytedance.android.livesdkapi.depend.model.live.Room) r4
            r3 = 0
            if (r2 == 0) goto L_0x0085
            long r0 = r2.getId()
            java.lang.Long r2 = java.lang.Long.valueOf(r0)
        L_0x001e:
            if (r4 == 0) goto L_0x0083
            com.bytedance.android.live.base.model.user.User r0 = r4.getOwner()
            if (r0 == 0) goto L_0x0083
            long r0 = r0.getId()
            java.lang.Long r0 = java.lang.Long.valueOf(r0)
        L_0x002e:
            boolean r8 = kotlin.h.b.n.LIZ(r2, r0)
            if (r4 == 0) goto L_0x0038
            com.bytedance.android.livesdk.model.RoomAuthStatus r3 = r4.getRoomAuthStatus()
        L_0x0038:
            java.lang.String r1 = ""
            r6 = 0
            r7 = 1
            if (r3 == 0) goto L_0x0081
            com.bytedance.android.livesdk.model.RoomAuthStatus r0 = r4.getRoomAuthStatus()
            kotlin.h.b.n.LIZIZ(r0, r1)
            boolean r0 = r0.isEnableGift()
            if (r0 == 0) goto L_0x0081
            r5 = 1
        L_0x004c:
            java.lang.Class<com.bytedance.android.live.wallet.IWalletService> r0 = com.bytedance.android.live.wallet.IWalletService.class
            X.0UT r0 = X.0cm.LIZ(r0)
            com.bytedance.android.live.wallet.IWalletService r0 = (com.bytedance.android.live.wallet.IWalletService) r0
            com.bytedance.android.live.wallet.IWalletCenter r0 = r0.walletCenter()
            kotlin.h.b.n.LIZIZ(r0, r1)
            long r3 = r0.LIZIZ()
            r1 = 0
            int r0 = (r3 > r1 ? 1 : (r3 == r1 ? 0 : -1))
            if (r0 <= 0) goto L_0x007f
            r0 = 1
        L_0x0066:
            X.GRo r1 = X.C2082GRn.LIZ(r8, r0, r5)
            X.GRo r0 = X.C2083GRo.SHOW
            if (r1 == r0) goto L_0x006f
            r6 = 1
        L_0x006f:
            org.json.JSONObject r1 = new org.json.JSONObject
            r1.<init>()
            java.lang.String r0 = "code"
            r1.put(r0, r7)
            java.lang.String r0 = "isDisabledGift"
            r1.put(r0, r6)
            return r1
        L_0x007f:
            r0 = 0
            goto L_0x0066
        L_0x0081:
            r5 = 0
            goto L_0x004c
        L_0x0083:
            r0 = r3
            goto L_0x002e
        L_0x0085:
            r2 = r3
            goto L_0x001e
        */
        throw new UnsupportedOperationException("Method not decompiled: com.bytedance.android.livesdk.browser.jsbridge.newmethods.LiveGiftAuthMethod.invoke(org.json.JSONObject, X.KLg):org.json.JSONObject");
    }
}
