package com.ss.android.ugc.aweme.bullet.bridge.ad;

import X.0CB;
import X.0CH;
import X.6Is;
import X.C2108KnT;
import X.C2121Kng;
import X.D4J;
import X.KT7;
import X.L58;
import X.M12;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.bullet.bridge.BaseBridgeMethod;
import java.util.LinkedHashMap;
import java.util.Map;
import kotlin.h.b.n;

public final class GetPageDataMethod extends BaseBridgeMethod implements 6Is {
    public static final C2121Kng LIZIZ = new C2121Kng((byte) 0);

    static {
        Covode.recordClassIndex(54926);
    }

    public final String LIZLLL() {
        return "getPageData";
    }

    public final void onStateChanged(0CH r1, 0CB r2) {
        super.onStateChanged(r1, r2);
    }

    private final Map<String, String> LJIIIZ() {
        L58 l58 = D4J.LIZ;
        n.LIZIZ(l58, "");
        if (l58.LIZ() == null) {
            return new LinkedHashMap();
        }
        L58 l582 = D4J.LIZ;
        n.LIZIZ(l582, "");
        C2108KnT LIZ = l582.LIZ();
        if (LIZ == null) {
            n.LIZIZ();
        }
        return LIZ.LJIIL();
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public GetPageDataMethod(KT7 kt7) {
        super(kt7);
        M12.LIZ((Object) kt7);
    }

    /* JADX WARNING: Code restructure failed: missing block: B:7:0x002a, code lost:
        if (r1 != null) goto L_0x002c;
     */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void LIZ(org.json.JSONObject r7, X.4UQ r8) {
        /*
            r6 = this;
            X.M12.LIZ((java.lang.Object) r7, (java.lang.Object) r8)
            java.lang.String r0 = "type"
            java.lang.String r2 = ""
            java.lang.String r4 = r7.optString(r0, r2)
            java.lang.String r0 = "4"
            boolean r0 = kotlin.h.b.n.LIZ(r4, r0)
            r3 = 1
            r1 = 0
            if (r0 == 0) goto L_0x0088
            X.L58 r0 = X.D4J.LIZ
            kotlin.h.b.n.LIZIZ(r0, r2)
            X.KnT r0 = r0.LIZ()
            if (r0 == 0) goto L_0x0076
            com.ss.android.ugc.aweme.feed.model.CardStruct r0 = r0.LJIIIIZZ()
            if (r0 == 0) goto L_0x0076
            org.json.JSONObject r1 = r0.getCardData()
        L_0x002a:
            if (r1 == 0) goto L_0x0076
        L_0x002c:
            X.9EH r0 = X.9EH.LJJIFFI
            android.content.Context r0 = r0.LIZ()
            boolean r4 = X.3F7.LIZ(r0)
            if (r3 != r4) goto L_0x003d
            java.lang.String r0 = "webview_layout_direction"
            r1.put(r0, r4)
        L_0x003d:
            X.L58 r0 = X.D4J.LIZ
            kotlin.h.b.n.LIZIZ(r0, r2)
            X.KnT r0 = r0.LIZ()
            if (r0 == 0) goto L_0x0076
            com.ss.android.ugc.aweme.feed.model.Aweme r0 = r0.LJIIJJI()
            if (r0 == 0) goto L_0x0076
            java.util.List r5 = r0.getRawAdClickTrackUrlList()
            if (r5 == 0) goto L_0x0076
            boolean r0 = r5.isEmpty()
            r0 = r0 ^ r3
            if (r0 != r3) goto L_0x0076
            java.lang.String r4 = "app_data"
            org.json.JSONObject r3 = r1.optJSONObject(r4)
            if (r3 == 0) goto L_0x0076
            java.lang.String r2 = "click_track_url_list"
            boolean r0 = r3.has(r2)
            if (r0 != 0) goto L_0x0073
            org.json.JSONArray r0 = new org.json.JSONArray
            r0.<init>(r5)
            r3.put(r2, r0)
        L_0x0073:
            r1.put(r4, r3)
        L_0x0076:
            org.json.JSONObject r2 = new org.json.JSONObject
            r2.<init>()
            java.lang.String r1 = java.lang.String.valueOf(r1)
            java.lang.String r0 = "card_data"
            r2.put(r0, r1)
            r8.LIZ(r2)
            return
        L_0x0088:
            java.lang.String r0 = "5"
            boolean r0 = kotlin.h.b.n.LIZ(r4, r0)
            if (r0 == 0) goto L_0x00a6
            X.L58 r0 = X.D4J.LIZ
            kotlin.h.b.n.LIZIZ(r0, r2)
            X.KnT r0 = r0.LIZ()
            if (r0 == 0) goto L_0x0076
            com.ss.android.ugc.aweme.feed.model.CardStruct r0 = r0.LJIIIZ()
            if (r0 == 0) goto L_0x0076
            org.json.JSONObject r1 = r0.getCardData()
            goto L_0x002a
        L_0x00a6:
            java.util.Map r0 = r6.LJIIIZ()
            boolean r0 = r0.isEmpty()
            r0 = r0 ^ r3
            if (r0 == 0) goto L_0x00d2
            org.json.JSONObject r1 = new org.json.JSONObject
            java.util.Map r0 = r6.LJIIIZ()
            java.lang.Object r0 = r0.get(r4)
            java.lang.String r0 = (java.lang.String) r0
            if (r0 != 0) goto L_0x00cd
            java.util.Map r0 = r6.LJIIIZ()
            java.util.Collection r0 = r0.values()
            java.lang.Object r0 = X.C4105Lea.LIZLLL(r0)
            java.lang.String r0 = (java.lang.String) r0
        L_0x00cd:
            r1.<init>(r0)
            goto L_0x002c
        L_0x00d2:
            X.L58 r0 = X.D4J.LIZ
            kotlin.h.b.n.LIZIZ(r0, r2)
            X.KnT r0 = r0.LIZ()
            if (r0 == 0) goto L_0x0076
            com.ss.android.ugc.aweme.feed.model.CardStruct r0 = r0.LJIIJ()
            if (r0 == 0) goto L_0x0076
            org.json.JSONObject r1 = r0.getCardData()
            goto L_0x002a
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.bullet.bridge.ad.GetPageDataMethod.LIZ(org.json.JSONObject, X.4UQ):void");
    }
}
