package com.bytedance.sdk.openadsdk.core.model;

import androidx.annotation.Nullable;
import java.util.ArrayList;
import java.util.Set;
import org.json.JSONArray;
import org.json.JSONObject;

/* JADX INFO: loaded from: classes2.dex */
public class jnr {
    private ArrayList<fm> fm;
    private yz ro;

    public static class fm {
        private final String fm;

        /* JADX INFO: renamed from: lb, reason: collision with root package name */
        private com.bytedance.sdk.openadsdk.core.onz.yz f7181lb;
        private final String ro;
        private Set<com.bytedance.sdk.openadsdk.core.onz.vt> yz;

        public fm(JSONObject jSONObject) {
            this.fm = jSONObject.optString("vast_url");
            this.ro = jSONObject.optString("vast_content");
            JSONObject jSONObjectOptJSONObject = jSONObject.optJSONObject("videoTrackers");
            if (jSONObjectOptJSONObject != null) {
                com.bytedance.sdk.openadsdk.core.onz.yz yzVar = new com.bytedance.sdk.openadsdk.core.onz.yz();
                this.f7181lb = yzVar;
                yzVar.fm(jSONObjectOptJSONObject);
            }
            JSONArray jSONArrayOptJSONArray = jSONObject.optJSONArray("viewabilityVendor");
            if (jSONArrayOptJSONArray != null) {
                this.yz = com.bytedance.sdk.openadsdk.core.onz.vt.fm(jSONArrayOptJSONArray);
            }
        }

        public com.bytedance.sdk.openadsdk.core.onz.yz fm() {
            return this.f7181lb;
        }

        public String lb() {
            return this.fm;
        }

        public Set<com.bytedance.sdk.openadsdk.core.onz.vt> ro() {
            return this.yz;
        }

        public String yz() {
            return this.ro;
        }

        public void fm(com.bytedance.sdk.openadsdk.core.onz.yz yzVar) {
            this.f7181lb = yzVar;
        }

        public void fm(Set<com.bytedance.sdk.openadsdk.core.onz.vt> set) {
            this.yz = set;
        }
    }

    public jnr(JSONArray jSONArray) {
        if (jSONArray == null) {
            return;
        }
        for (int i10 = 0; i10 < jSONArray.length(); i10++) {
            fm fmVar = new fm(jSONArray.optJSONObject(i10));
            if (this.fm == null) {
                this.fm = new ArrayList<>();
            }
            this.fm.add(fmVar);
        }
    }

    public ArrayList<fm> fm() {
        return this.fm;
    }

    public boolean lb() {
        ArrayList<fm> arrayList = this.fm;
        return (arrayList == null || arrayList.isEmpty()) ? false : true;
    }

    @Nullable
    public yz ro() {
        if (this.ro == null) {
            this.ro = new yz();
            ArrayList<fm> arrayList = this.fm;
            if (arrayList != null) {
                for (fm fmVar : arrayList) {
                    com.bytedance.sdk.openadsdk.core.onz.yz yzVarFm = fmVar.fm();
                    Set<com.bytedance.sdk.openadsdk.core.onz.vt> setRo = fmVar.ro();
                    if (yzVarFm != null) {
                        this.ro.fm().fm(yzVarFm);
                    }
                    if (setRo != null) {
                        this.ro.ro().addAll(setRo);
                    }
                }
            }
        }
        return this.ro;
    }

    public static boolean fm(lse lseVar) {
        if (lseVar == null || lseVar.ol()) {
            return false;
        }
        int iIe = lseVar.ie();
        int iSiu = lseVar.siu();
        return (iIe == 3 || iIe == 7 || iIe == 8) && (iSiu == 5 || iSiu == 15 || iSiu == 50);
    }
}
