package com.bytedance.sdk.component.adexpress.dynamic.yz;

import java.util.ArrayList;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import xyz.stream.download.config.InnerConstant;

/* JADX INFO: loaded from: classes.dex */
public class yz {
    public List<fm> fm;

    /* JADX INFO: renamed from: lb, reason: collision with root package name */
    public String f6526lb;
    public String ro;
    public String yz;

    public static class fm {
        public int fm;
        public JSONObject ro;
    }

    public static yz fm(JSONObject jSONObject) {
        if (jSONObject == null) {
            return null;
        }
        yz yzVar = new yz();
        String strOptString = jSONObject.optString("custom_components");
        ArrayList arrayList = new ArrayList();
        try {
            JSONArray jSONArray = new JSONArray(strOptString);
            for (int i10 = 0; i10 < jSONArray.length(); i10++) {
                JSONObject jSONObjectOptJSONObject = jSONArray.optJSONObject(i10);
                if (jSONObjectOptJSONObject != null) {
                    fm fmVar = new fm();
                    fmVar.fm = jSONObjectOptJSONObject.optInt(InnerConstant.Db.f36069id);
                    fmVar.ro = new JSONObject(jSONObjectOptJSONObject.optString("componentLayout"));
                    arrayList.add(fmVar);
                }
            }
        } catch (JSONException unused) {
        }
        yzVar.fm = arrayList;
        yzVar.ro = jSONObject.optString("diff_data");
        yzVar.f6526lb = jSONObject.optString("style_diff");
        yzVar.yz = jSONObject.optString("tag_diff");
        return yzVar;
    }
}
