package com.bytedance.ies.xelement.picker;

import X.7xU;
import X.9HM;
import X.C4083QhU;
import X.C4273QkY;
import X.C4274QkZ;
import X.C4277Qkc;
import X.C4278Qkd;
import X.C4373QmA;
import X.C4997QwE;
import X.C4999QwG;
import X.C5001QwI;
import X.C5014QwV;
import X.C5018QwZ;
import X.C5029Qwk;
import X.LC0;
import X.LC5;
import X.Ls0;
import X.M12;
import X.Q39;
import X.QNL;
import X.QNX;
import android.content.Context;
import android.view.View;
import com.bytedance.covode.number.Covode;
import com.lynx.react.bridge.ReadableArray;
import com.lynx.react.bridge.ReadableType;
import com.lynx.tasm.behavior.ui.view.UISimpleView;
import com.lynx.tasm.utils.ColorUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import kotlin.h.b.n;

public final class LynxPickerView extends UISimpleView<C4373QmA> {
    public static final C5029Qwk LJIJJ = new C5029Qwk((byte) 0);
    public String LIZ;
    public boolean LIZIZ;
    public LC5 LIZJ;
    public LC5 LIZLLL;
    public LC5 LJ;
    public String LJFF;
    public String LJI;
    public String LJII;
    public String LJIIIIZZ;
    public String LJIIIZ;
    public String LJIIJ;
    public String LJIIJJI;
    public String LJIIL;
    public String LJIILIIL;
    public String LJIILJJIL;
    public String LJIILL;
    public boolean LJIILLIIL;
    public boolean LJIIZILJ;
    public boolean LJIJ;
    public C4083QhU LJIJI;

    static {
        Covode.recordClassIndex(32457);
    }

    @QNL(LIZ = "cancel-color")
    public final void setCancelColor(String str) {
        this.LJIIL = str;
    }

    @QNL(LIZ = "cancel-string")
    public final void setCancelString(String str) {
        this.LJIIJ = str;
    }

    @QNL(LIZ = "confirm-color")
    public final void setConfirmColor(String str) {
        this.LJIIJJI = str;
    }

    @QNL(LIZ = "confirm-string")
    public final void setConfirmString(String str) {
        this.LJIIIZ = str;
    }

    @QNL(LIZ = "end")
    public final void setEnd(String str) {
        this.LJI = str;
    }

    @QNL(LIZ = "fields")
    public final void setFields(String str) {
        this.LJII = str;
    }

    @QNL(LIZ = "range")
    public final void setRange(LC5 lc5) {
        this.LIZLLL = lc5;
    }

    @QNL(LIZ = "range-key")
    public final void setRangeKey(LC5 lc5) {
        this.LJ = lc5;
    }

    @QNL(LIZ = "separator")
    public final void setSeparator(String str) {
        this.LJIIIIZZ = str;
    }

    @QNL(LIZ = "start")
    public final void setStart(String str) {
        this.LJFF = str;
    }

    @QNL(LIZ = "title")
    public final void setTitle(String str) {
        this.LJIILIIL = str;
    }

    @QNL(LIZ = "title-color")
    public final void setTitleColor(String str) {
        this.LJIILJJIL = str;
    }

    @QNL(LIZ = "title-font-size")
    public final void setTitleFontSize(String str) {
        this.LJIILL = str;
    }

    @QNL(LIZ = "value")
    public final void setValue(LC5 lc5) {
        this.LIZJ = lc5;
    }

    @QNL(LIZ = "mode")
    public final void setMode(String str) {
        M12.LIZ(str);
        this.LIZ = str;
    }

    @QNL(LIZ = "disabled")
    public final void setDisabled(Boolean bool) {
        if (bool != null) {
            bool.booleanValue();
            this.LIZIZ = bool.booleanValue();
        }
    }

    public final /* synthetic */ View createView(Context context) {
        M12.LIZ(context);
        C4373QmA qmA = new C4373QmA(context);
        qmA.setOnClickListener(new C5001QwI(this, context));
        return qmA;
    }

    public final void setEvents(Map<String, ? extends LC0> map) {
        super.setEvents(map);
        if (map != null) {
            this.LJIILLIIL = map.containsKey("cancel");
            this.LJIIZILJ = map.containsKey("change");
            this.LJIJ = map.containsKey("columnchange");
        }
    }

    public final void LIZ(Context context) {
        ReadableArray LJI2;
        ArrayList<Number> arrayList;
        C4083QhU qwV;
        ReadableArray LJI3;
        ReadableArray LJI4;
        String string;
        LC5 lc5 = this.LIZLLL;
        if (lc5 != null && lc5.LJIIIIZZ() == ReadableType.Array && !lc5.LIZ()) {
            List list = null;
            if (1 != 0 && (LJI2 = lc5.LJI()) != null) {
                ArrayList arrayList2 = new ArrayList();
                int size = LJI2.size();
                for (int i = 0; i < size; i++) {
                    ReadableArray array = LJI2.getArray(i);
                    ArrayList arrayList3 = new ArrayList();
                    if (!array.isNull(0)) {
                        if (array.getType(0) == ReadableType.String) {
                            ArrayList arrayList4 = array.toArrayList();
                            if (arrayList4 != null) {
                                arrayList3.addAll(Ls0.LIZLLL(arrayList4));
                            } else {
                                throw new 7xU("null cannot be cast to non-null type kotlin.collections.MutableList<kotlin.String>");
                            }
                        } else {
                            LC5 lc52 = this.LJ;
                            if (!(lc52 == null || (LJI4 = lc52.LJI()) == null || (string = LJI4.getString(i)) == null)) {
                                int size2 = array.size();
                                for (int i2 = 0; i2 < size2; i2++) {
                                    String string2 = array.getMap(i2).getString(string);
                                    n.LIZ(string2, Q39.LIZJ);
                                    arrayList3.add(string2);
                                }
                            }
                        }
                    }
                    arrayList2.add(arrayList3);
                }
                LC5 lc53 = this.LIZJ;
                if (lc53 == null || (LJI3 = lc53.LJI()) == null) {
                    arrayList = null;
                } else {
                    arrayList = LJI3.toArrayList();
                }
                if (Ls0.LIZJ(arrayList) && arrayList != null) {
                    ArrayList arrayList5 = new ArrayList(9HM.LIZ(arrayList, 10));
                    for (Number doubleValue : arrayList) {
                        arrayList5.add(Integer.valueOf((int) doubleValue.doubleValue()));
                    }
                    list = arrayList5;
                }
                C4997QwE qwE = new C4997QwE(context);
                if (!(this.LJIIIZ == null && this.LJIIJ == null && (qwV = this.LJIJI) != null)) {
                    qwV = new C5014QwV(this);
                }
                qwE.LIZ(qwV);
                qwE.LIZ((C4274QkZ) new C4273QkY(this));
                qwE.LIZ((C4278Qkd) new C4277Qkc(this));
                qwE.LIZ((C4999QwG) new C5018QwZ(this));
                qwE.LIZ((List<List<String>>) arrayList2);
                qwE.LIZIZ(list);
                String str = this.LJIIJJI;
                if (str != null) {
                    qwE.LIZ(ColorUtils.LIZ(str));
                }
                String str2 = this.LJIIL;
                if (str2 != null) {
                    qwE.LIZIZ(ColorUtils.LIZ(str2));
                }
                String str3 = this.LJIILIIL;
                if (str3 != null) {
                    qwE.LIZ(str3);
                }
                String str4 = this.LJIILJJIL;
                if (str4 != null) {
                    qwE.LIZJ(ColorUtils.LIZ(str4));
                }
                String str5 = this.LJIILL;
                if (str5 != null) {
                    qwE.LIZLLL((int) QNX.LIZ(str5));
                }
                qwE.LIZIZ().LIZ((View) this.mView);
            }
        }
    }
}
