package com.ss.android.ugc.aweme.ecommerce.address;

import X.3T9;
import X.4r1;
import X.C4J;
import X.C5418BzK;
import X.C5570C4g;
import X.C5578C4o;
import X.C5Z;
import X.M12;
import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
import com.bytedance.covode.number.Covode;
import com.google.gson.a.c;
import com.ss.android.ugc.aweme.ecommerce.address.dto.Address;
import com.ss.android.ugc.aweme.ecommerce.address.dto.InputItemData;
import com.ss.android.ugc.aweme.ecommerce.address.dto.Region;
import java.util.LinkedHashMap;
import java.util.List;

public final class AddressPageStarter {
    public static 4r1<? super C5418BzK> LIZ;
    public static final AddressPageStarter LIZIZ = new AddressPageStarter();

    static {
        Covode.recordClassIndex(67970);
    }

    public static final class AddressEditEnterParams implements Parcelable {
        public static final Parcelable.Creator<AddressEditEnterParams> CREATOR = new C4J();
        public static final C5Z LJIIJJI = new C5Z((byte) 0);
        @c(LIZ = "districts")
        public final List<Region> LIZ;
        @c(LIZ = "address")
        public final Address LIZIZ;
        @c(LIZ = "from")
        public final String LIZJ;
        @c(LIZ = "trackParams")
        public final String LIZLLL;
        @c(LIZ = "current_progress")
        public final Integer LJ;
        @c(LIZ = "total_progress")
        public final Integer LJFF;
        @c(LIZ = "template_data")
        public final InputItemData LJI;
        @c(LIZ = "keep_alive")
        public final boolean LJII;
        @c(LIZ = "button_type")
        public final int LJIIIIZZ;
        @c(LIZ = "override_quit_message")
        public final String LJIIIZ;
        @c(LIZ = "pdp_from")
        public final String LJIIJ;

        static {
            Covode.recordClassIndex(67971);
        }

        public final int describeContents() {
            return 0;
        }

        public final void writeToParcel(Parcel parcel, int i) {
            M12.LIZ(parcel);
            List<Region> list = this.LIZ;
            if (list != null) {
                parcel.writeInt(1);
                parcel.writeInt(list.size());
                for (Region writeToParcel : list) {
                    writeToParcel.writeToParcel(parcel, 0);
                }
            } else {
                parcel.writeInt(0);
            }
            Address address = this.LIZIZ;
            if (address != null) {
                parcel.writeInt(1);
                address.writeToParcel(parcel, 0);
            } else {
                parcel.writeInt(0);
            }
            parcel.writeString(this.LIZJ);
            parcel.writeString(this.LIZLLL);
            Integer num = this.LJ;
            if (num != null) {
                parcel.writeInt(1);
                parcel.writeInt(num.intValue());
            } else {
                parcel.writeInt(0);
            }
            Integer num2 = this.LJFF;
            if (num2 != null) {
                parcel.writeInt(1);
                parcel.writeInt(num2.intValue());
            } else {
                parcel.writeInt(0);
            }
            InputItemData inputItemData = this.LJI;
            if (inputItemData != null) {
                parcel.writeInt(1);
                inputItemData.writeToParcel(parcel, 0);
            } else {
                parcel.writeInt(0);
            }
            parcel.writeInt(this.LJII ? 1 : 0);
            parcel.writeInt(this.LJIIIIZZ);
            parcel.writeString(this.LJIIIZ);
            parcel.writeString(this.LJIIJ);
        }

        public /* synthetic */ AddressEditEnterParams(String str) {
            this((List<Region>) null, (Address) null, str, (String) null, (Integer) null, (Integer) null, (InputItemData) null, false, 0, (String) null, (String) null);
        }

        public AddressEditEnterParams(List<Region> list, Address address, String str, String str2, Integer num, Integer num2, InputItemData inputItemData, boolean z, int i, String str3, String str4) {
            M12.LIZ(str);
            this.LIZ = list;
            this.LIZIZ = address;
            this.LIZJ = str;
            this.LIZLLL = str2;
            this.LJ = num;
            this.LJFF = num2;
            this.LJI = inputItemData;
            this.LJII = z;
            this.LJIIIIZZ = i;
            this.LJIIIZ = str3;
            this.LJIIJ = str4;
        }
    }

    public static final class AddressListEnterParams implements Parcelable {
        public static final Parcelable.Creator<AddressListEnterParams> CREATOR = new C5578C4o();
        public static final C5570C4g LJFF = new C5570C4g((byte) 0);
        @c(LIZ = "is_select_mode")
        public final boolean LIZ;
        @c(LIZ = "trackParams")
        public final String LIZIZ;
        @c(LIZ = "from_claim_incentive")
        public final boolean LIZJ;
        @c(LIZ = "incentive_record_id")
        public final String LIZLLL;
        @c(LIZ = "product_id")
        public final String LJ;

        static {
            Covode.recordClassIndex(67975);
        }

        public AddressListEnterParams() {
            this((String) null, 31);
        }

        public final int describeContents() {
            return 0;
        }

        public final void writeToParcel(Parcel parcel, int i) {
            M12.LIZ(parcel);
            parcel.writeInt(this.LIZ ? 1 : 0);
            parcel.writeString(this.LIZIZ);
            parcel.writeInt(this.LIZJ ? 1 : 0);
            parcel.writeString(this.LIZLLL);
            parcel.writeString(this.LJ);
        }

        /* JADX INFO: this call moved to the top of the method (can break code semantics) */
        public /* synthetic */ AddressListEnterParams(String str, int i) {
            this(false, (i & 2) != 0 ? null : str, false, (String) null, (String) null);
        }

        public AddressListEnterParams(boolean z, String str, boolean z2, String str2, String str3) {
            this.LIZ = z;
            this.LIZIZ = str;
            this.LIZJ = z2;
            this.LIZLLL = str2;
            this.LJ = str3;
        }
    }

    public final void LIZ(Context context, String str, String str2, String str3) {
        if (context != null) {
            LinkedHashMap linkedHashMap = new LinkedHashMap();
            if (str != null) {
                linkedHashMap.put("trackParams", str);
            }
            linkedHashMap.put("is_select_mode", true);
            if (str3 != null) {
                linkedHashMap.put("product_id", str3);
            }
            3T9 r1 = 3T9.LIZ;
            if (str2 == null || str2.length() == 0) {
                str2 = "aweme://ec/address/list";
            }
            3T9.LIZ(r1, context, str2, linkedHashMap).open();
        }
    }

    public final void LIZ(Context context, Address address, List<Region> list, String str, boolean z, String str2, String str3, String str4) {
        M12.LIZ(str);
        if (context != null) {
            LinkedHashMap linkedHashMap = new LinkedHashMap();
            if (address != null) {
                linkedHashMap.put("address", address);
            }
            if (list != null) {
                linkedHashMap.put("districts", list);
            }
            if (str2 != null) {
                linkedHashMap.put("trackParams", str2);
            }
            linkedHashMap.put("from", str);
            if (str4 != null) {
                linkedHashMap.put("pdp_from", str4);
            }
            linkedHashMap.put("keep_alive", false);
            linkedHashMap.put("button_type", 0);
            3T9 r1 = 3T9.LIZ;
            if (str3 == null || str3.length() == 0) {
                str3 = "aweme://ec/address/edit";
            }
            r1.LIZ(context, str3, linkedHashMap, z).open();
        }
    }

    public static /* synthetic */ void LIZ(AddressPageStarter addressPageStarter, Context context, Address address, List list, String str, boolean z, String str2, String str3, int i) {
        List list2 = list;
        Address address2 = address;
        boolean z2 = z;
        String str4 = str2;
        int i2 = i;
        String str5 = null;
        if ((i2 & 2) != 0) {
            address2 = null;
        }
        if ((i2 & 4) != 0) {
            list2 = null;
        }
        if ((i2 & 16) != 0) {
            z2 = false;
        }
        if ((i2 & 32) != 0) {
            str4 = null;
        }
        if ((i2 & 2048) == 0) {
            str5 = str3;
        }
        addressPageStarter.LIZ(context, address2, list2, str, z2, str4, str5, (String) null);
    }
}
