package ca.canadapost.module.track.model;

import ca.canadapost.core.data.google.model.googlepass.GooglePass;
import ca.canadapost.core.data.google.model.googlepass.GooglePassNameValue;
import java.text.DateFormat;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import kotlin.Metadata;
import kotlin.jvm.internal.t;
import kotlin.text.y;
import rm.b0;
import rm.v;
import sm.u;

@Metadata(d1 = {"\u0000N\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010 \n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0006\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0018\u0002\n\u0002\b\u000b\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0012\b\u0086\b\u0018\u00002\u00020\u0001BU\u0012\u0006\u0010\u001a\u001a\u00020\u0002\u0012\u0006\u0010\u001b\u001a\u00020\u0002\u0012\b\u0010\u001c\u001a\u0004\u0018\u00010\u0002\u0012\b\u0010\u001d\u001a\u0004\u0018\u00010\u0002\u0012\u0014\u0010\u001e\u001a\u0010\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\u0002\u0018\u00010\n\u0012\b\u0010\u001f\u001a\u0004\u0018\u00010\u000b\u0012\b\u0010 \u001a\u0004\u0018\u00010\u0018¢\u0006\u0004\b7\u00108J\u0006\u0010\u0003\u001a\u00020\u0002J\u0006\u0010\u0004\u001a\u00020\u0002J\f\u0010\u0006\u001a\b\u0012\u0004\u0012\u00020\u00020\u0005J\f\u0010\b\u001a\b\u0012\u0004\u0012\u00020\u00070\u0005J\u000e\u0010\t\u001a\n\u0012\u0004\u0012\u00020\u0007\u0018\u00010\u0005J\u001a\u0010\f\u001a\u0016\u0012\u0010\u0012\u000e\u0012\u0004\u0012\u00020\u000b\u0012\u0004\u0012\u00020\u000b0\n\u0018\u00010\u0005J\u0018\u0010\u000e\u001a\u0014\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\u00020\rJ\u0006\u0010\u0010\u001a\u00020\u000fJ\t\u0010\u0011\u001a\u00020\u0002HÆ\u0003J\t\u0010\u0012\u001a\u00020\u0002HÆ\u0003J\u000b\u0010\u0013\u001a\u0004\u0018\u00010\u0002HÆ\u0003J\u000b\u0010\u0014\u001a\u0004\u0018\u00010\u0002HÆ\u0003J\u0017\u0010\u0015\u001a\u0010\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\u0002\u0018\u00010\nHÆ\u0003J\u0012\u0010\u0016\u001a\u0004\u0018\u00010\u000bHÆ\u0003¢\u0006\u0004\b\u0016\u0010\u0017J\u000b\u0010\u0019\u001a\u0004\u0018\u00010\u0018HÆ\u0003Jl\u0010!\u001a\u00020\u00002\b\b\u0002\u0010\u001a\u001a\u00020\u00022\b\b\u0002\u0010\u001b\u001a\u00020\u00022\n\b\u0002\u0010\u001c\u001a\u0004\u0018\u00010\u00022\n\b\u0002\u0010\u001d\u001a\u0004\u0018\u00010\u00022\u0016\b\u0002\u0010\u001e\u001a\u0010\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\u0002\u0018\u00010\n2\n\b\u0002\u0010\u001f\u001a\u0004\u0018\u00010\u000b2\n\b\u0002\u0010 \u001a\u0004\u0018\u00010\u0018HÆ\u0001¢\u0006\u0004\b!\u0010\"J\t\u0010#\u001a\u00020\u0002HÖ\u0001J\t\u0010%\u001a\u00020$HÖ\u0001J\u0013\u0010(\u001a\u00020'2\b\u0010&\u001a\u0004\u0018\u00010\u0001HÖ\u0003R\u0017\u0010\u001a\u001a\u00020\u00028\u0006¢\u0006\f\n\u0004\b\u001a\u0010)\u001a\u0004\b*\u0010+R\u0017\u0010\u001b\u001a\u00020\u00028\u0006¢\u0006\f\n\u0004\b\u001b\u0010)\u001a\u0004\b,\u0010+R\u0019\u0010\u001c\u001a\u0004\u0018\u00010\u00028\u0006¢\u0006\f\n\u0004\b\u001c\u0010)\u001a\u0004\b-\u0010+R\u0019\u0010\u001d\u001a\u0004\u0018\u00010\u00028\u0006¢\u0006\f\n\u0004\b\u001d\u0010)\u001a\u0004\b.\u0010+R%\u0010\u001e\u001a\u0010\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\u0002\u0018\u00010\n8\u0006¢\u0006\f\n\u0004\b\u001e\u0010/\u001a\u0004\b0\u00101R\u0019\u0010\u001f\u001a\u0004\u0018\u00010\u000b8\u0006¢\u0006\f\n\u0004\b\u001f\u00102\u001a\u0004\b3\u0010\u0017R\u0019\u0010 \u001a\u0004\u0018\u00010\u00188\u0006¢\u0006\f\n\u0004\b \u00104\u001a\u0004\b5\u00106¨\u00069"}, d2 = {"Lca/canadapost/module/track/model/DeliveryPickupPass;", "", "", "getObjectId", "getClassId", "", "getOriginName", "Lca/canadapost/core/data/google/model/googlepass/GooglePassNameValue;", "getTextModules", "getLinkModules", "Lrm/v;", "", "getLocations", "Lrm/b0;", "getBarCode", "Lca/canadapost/core/data/google/model/googlepass/GooglePass;", "toGooglePass", "component1", "component2", "component3", "component4", "component5", "component6", "()Ljava/lang/Double;", "Ljava/util/Date;", "component7", "itemNumber", "deliveryNoticeNumber", "userDescription", "postOfficeName", "pickupLocation", "dutiesAndTaxesOwed", "pickupByDate", "copy", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lrm/v;Ljava/lang/Double;Ljava/util/Date;)Lca/canadapost/module/track/model/DeliveryPickupPass;", "toString", "", "hashCode", "other", "", "equals", "Ljava/lang/String;", "getItemNumber", "()Ljava/lang/String;", "getDeliveryNoticeNumber", "getUserDescription", "getPostOfficeName", "Lrm/v;", "getPickupLocation", "()Lrm/v;", "Ljava/lang/Double;", "getDutiesAndTaxesOwed", "Ljava/util/Date;", "getPickupByDate", "()Ljava/util/Date;", "<init>", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lrm/v;Ljava/lang/Double;Ljava/util/Date;)V", "track_productionRelease"}, k = 1, mv = {1, 9, 0})
/* loaded from: classes4.dex */
public final /* data */ class DeliveryPickupPass {
    private final String deliveryNoticeNumber;
    private final Double dutiesAndTaxesOwed;
    private final String itemNumber;
    private final Date pickupByDate;
    private final v pickupLocation;
    private final String postOfficeName;
    private final String userDescription;

    public DeliveryPickupPass(String itemNumber, String deliveryNoticeNumber, String str, String str2, v vVar, Double d10, Date date) {
        t.g(itemNumber, "itemNumber");
        t.g(deliveryNoticeNumber, "deliveryNoticeNumber");
        this.itemNumber = itemNumber;
        this.deliveryNoticeNumber = deliveryNoticeNumber;
        this.userDescription = str;
        this.postOfficeName = str2;
        this.pickupLocation = vVar;
        this.dutiesAndTaxesOwed = d10;
        this.pickupByDate = date;
    }

    public static /* synthetic */ DeliveryPickupPass copy$default(DeliveryPickupPass deliveryPickupPass, String str, String str2, String str3, String str4, v vVar, Double d10, Date date, int i10, Object obj) {
        if ((i10 & 1) != 0) {
            str = deliveryPickupPass.itemNumber;
        }
        if ((i10 & 2) != 0) {
            str2 = deliveryPickupPass.deliveryNoticeNumber;
        }
        String str5 = str2;
        if ((i10 & 4) != 0) {
            str3 = deliveryPickupPass.userDescription;
        }
        String str6 = str3;
        if ((i10 & 8) != 0) {
            str4 = deliveryPickupPass.postOfficeName;
        }
        String str7 = str4;
        if ((i10 & 16) != 0) {
            vVar = deliveryPickupPass.pickupLocation;
        }
        v vVar2 = vVar;
        if ((i10 & 32) != 0) {
            d10 = deliveryPickupPass.dutiesAndTaxesOwed;
        }
        Double d11 = d10;
        if ((i10 & 64) != 0) {
            date = deliveryPickupPass.pickupByDate;
        }
        return deliveryPickupPass.copy(str, str5, str6, str7, vVar2, d11, date);
    }

    /* renamed from: component1, reason: from getter */
    public final String getItemNumber() {
        return this.itemNumber;
    }

    /* renamed from: component2, reason: from getter */
    public final String getDeliveryNoticeNumber() {
        return this.deliveryNoticeNumber;
    }

    /* renamed from: component3, reason: from getter */
    public final String getUserDescription() {
        return this.userDescription;
    }

    /* renamed from: component4, reason: from getter */
    public final String getPostOfficeName() {
        return this.postOfficeName;
    }

    /* renamed from: component5, reason: from getter */
    public final v getPickupLocation() {
        return this.pickupLocation;
    }

    /* renamed from: component6, reason: from getter */
    public final Double getDutiesAndTaxesOwed() {
        return this.dutiesAndTaxesOwed;
    }

    /* renamed from: component7, reason: from getter */
    public final Date getPickupByDate() {
        return this.pickupByDate;
    }

    public final DeliveryPickupPass copy(String itemNumber, String deliveryNoticeNumber, String userDescription, String postOfficeName, v pickupLocation, Double dutiesAndTaxesOwed, Date pickupByDate) {
        t.g(itemNumber, "itemNumber");
        t.g(deliveryNoticeNumber, "deliveryNoticeNumber");
        return new DeliveryPickupPass(itemNumber, deliveryNoticeNumber, userDescription, postOfficeName, pickupLocation, dutiesAndTaxesOwed, pickupByDate);
    }

    public boolean equals(Object other) {
        if (this == other) {
            return true;
        }
        if (!(other instanceof DeliveryPickupPass)) {
            return false;
        }
        DeliveryPickupPass deliveryPickupPass = (DeliveryPickupPass) other;
        return t.b(this.itemNumber, deliveryPickupPass.itemNumber) && t.b(this.deliveryNoticeNumber, deliveryPickupPass.deliveryNoticeNumber) && t.b(this.userDescription, deliveryPickupPass.userDescription) && t.b(this.postOfficeName, deliveryPickupPass.postOfficeName) && t.b(this.pickupLocation, deliveryPickupPass.pickupLocation) && t.b(this.dutiesAndTaxesOwed, deliveryPickupPass.dutiesAndTaxesOwed) && t.b(this.pickupByDate, deliveryPickupPass.pickupByDate);
    }

    public final b0 getBarCode() {
        String str = this.deliveryNoticeNumber;
        return new b0("CODE_128", str, str);
    }

    public final String getClassId() {
        return "3377791565379757323.TRANSIT_CLASS_CPC_TRACK_PICKUP";
    }

    public final String getDeliveryNoticeNumber() {
        return this.deliveryNoticeNumber;
    }

    public final Double getDutiesAndTaxesOwed() {
        return this.dutiesAndTaxesOwed;
    }

    public final String getItemNumber() {
        return this.itemNumber;
    }

    public final List<GooglePassNameValue> getLinkModules() {
        List<GooglePassNameValue> e10;
        v vVar = this.pickupLocation;
        if (vVar == null) {
            return null;
        }
        e10 = sm.t.e(new GooglePassNameValue("Pickup Location", "geo:" + vVar.c() + "," + this.pickupLocation.d(), "Emplacement du bureau de poste", null));
        return e10;
    }

    public final List<v> getLocations() {
        List<v> e10;
        v vVar = this.pickupLocation;
        if (vVar == null) {
            return null;
        }
        e10 = sm.t.e(new v(Double.valueOf(Double.parseDouble((String) vVar.c())), Double.valueOf(Double.parseDouble((String) this.pickupLocation.d()))));
        return e10;
    }

    public final String getObjectId() {
        return "delivery_pickup_" + this.itemNumber;
    }

    /* JADX WARN: Removed duplicated region for block: B:10:0x003d  */
    /* JADX WARN: Removed duplicated region for block: B:7:0x0036  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final List<String> getOriginName() {
        boolean z10;
        List<String> n10;
        boolean C;
        String str = "Tracking number " + this.itemNumber;
        String str2 = "Numéro de repérage " + this.itemNumber;
        String str3 = this.userDescription;
        if (str3 != null) {
            C = y.C(str3);
            if (!C) {
                z10 = false;
                if (!z10) {
                    str = this.userDescription;
                    str2 = str;
                }
                if (this.pickupByDate != null) {
                    String format = DateFormat.getDateInstance(2, Locale.CANADA).format(this.pickupByDate);
                    str = ((Object) str) + "\\nPick up by " + format;
                    str2 = ((Object) str2) + "\\nRamasser d’ici " + DateFormat.getDateInstance(2, Locale.CANADA_FRENCH).format(this.pickupByDate);
                }
                n10 = u.n(str, str2);
                return n10;
            }
        }
        z10 = true;
        if (!z10) {
        }
        if (this.pickupByDate != null) {
        }
        n10 = u.n(str, str2);
        return n10;
    }

    public final Date getPickupByDate() {
        return this.pickupByDate;
    }

    public final v getPickupLocation() {
        return this.pickupLocation;
    }

    public final String getPostOfficeName() {
        return this.postOfficeName;
    }

    public final List<GooglePassNameValue> getTextModules() {
        ArrayList arrayList = new ArrayList();
        String str = this.postOfficeName;
        if (str != null) {
            arrayList.add(new GooglePassNameValue("Post office", str, "Bureau de poste", str));
        }
        String str2 = this.itemNumber;
        arrayList.add(new GooglePassNameValue("Tracking number", str2, "Numéro de repérage", str2));
        Double d10 = this.dutiesAndTaxesOwed;
        if (d10 != null) {
            d10.doubleValue();
            arrayList.add(new GooglePassNameValue("Duty and taxes owed", NumberFormat.getCurrencyInstance(Locale.CANADA).format(this.dutiesAndTaxesOwed.doubleValue()), "Droits et taxes à payer", NumberFormat.getCurrencyInstance(Locale.CANADA_FRENCH).format(this.dutiesAndTaxesOwed.doubleValue())));
        }
        return arrayList;
    }

    public final String getUserDescription() {
        return this.userDescription;
    }

    public int hashCode() {
        int hashCode = ((this.itemNumber.hashCode() * 31) + this.deliveryNoticeNumber.hashCode()) * 31;
        String str = this.userDescription;
        int hashCode2 = (hashCode + (str == null ? 0 : str.hashCode())) * 31;
        String str2 = this.postOfficeName;
        int hashCode3 = (hashCode2 + (str2 == null ? 0 : str2.hashCode())) * 31;
        v vVar = this.pickupLocation;
        int hashCode4 = (hashCode3 + (vVar == null ? 0 : vVar.hashCode())) * 31;
        Double d10 = this.dutiesAndTaxesOwed;
        int hashCode5 = (hashCode4 + (d10 == null ? 0 : d10.hashCode())) * 31;
        Date date = this.pickupByDate;
        return hashCode5 + (date != null ? date.hashCode() : 0);
    }

    public final GooglePass toGooglePass() {
        return new GooglePass.Builder(null, 1, null).addClassId(getClassId()).addObjectId(getObjectId()).addOriginName(getOriginName()).addTextModules(getTextModules()).addLinkModules(getLinkModules()).addLocations(getLocations()).addBarCode((String) getBarCode().d(), (String) getBarCode().e(), (String) getBarCode().f()).build();
    }

    public String toString() {
        return "DeliveryPickupPass(itemNumber=" + this.itemNumber + ", deliveryNoticeNumber=" + this.deliveryNoticeNumber + ", userDescription=" + this.userDescription + ", postOfficeName=" + this.postOfficeName + ", pickupLocation=" + this.pickupLocation + ", dutiesAndTaxesOwed=" + this.dutiesAndTaxesOwed + ", pickupByDate=" + this.pickupByDate + ")";
    }
}
