package com.strmr.ps.data.local.entity;

import androidx.media3.container.NalUnitUtil;
import com.strmr.ps.data.repository.PreferencesRepository;
import defpackage.cr4;
import defpackage.fi7;
import defpackage.ih7;
import defpackage.kp6;
import defpackage.n41;
import defpackage.pq6;
import defpackage.uz1;
import defpackage.vm2;
import defpackage.vw2;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import kotlin.Metadata;

/* JADX INFO: loaded from: classes3.dex */
@Metadata(d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0010\t\n\u0002\b\u0010\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\b\n\u0002\b\u000e\b\u0087\b\u0018\u00002\u00020\u0001B=\u0012\b\b\u0002\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0003\u0012\b\u0010\u0005\u001a\u0004\u0018\u00010\u0003\u0012\b\u0010\u0006\u001a\u0004\u0018\u00010\u0007\u0012\u0006\u0010\b\u001a\u00020\u0007\u0012\u0006\u0010\t\u001a\u00020\u0007¢\u0006\u0004\b\n\u0010\u000bJ\u0006\u0010\u0016\u001a\u00020\u0003J\u0006\u0010\u0017\u001a\u00020\u0018J\r\u0010\u0019\u001a\u0004\u0018\u00010\u001a¢\u0006\u0002\u0010\u001bJ\t\u0010\u001c\u001a\u00020\u0003HÆ\u0003J\t\u0010\u001d\u001a\u00020\u0003HÆ\u0003J\u000b\u0010\u001e\u001a\u0004\u0018\u00010\u0003HÆ\u0003J\u0010\u0010\u001f\u001a\u0004\u0018\u00010\u0007HÆ\u0003¢\u0006\u0002\u0010\u0011J\t\u0010 \u001a\u00020\u0007HÆ\u0003J\t\u0010!\u001a\u00020\u0007HÆ\u0003JN\u0010\"\u001a\u00020\u00002\b\b\u0002\u0010\u0002\u001a\u00020\u00032\b\b\u0002\u0010\u0004\u001a\u00020\u00032\n\b\u0002\u0010\u0005\u001a\u0004\u0018\u00010\u00032\n\b\u0002\u0010\u0006\u001a\u0004\u0018\u00010\u00072\b\b\u0002\u0010\b\u001a\u00020\u00072\b\b\u0002\u0010\t\u001a\u00020\u0007HÆ\u0001¢\u0006\u0002\u0010#J\u0013\u0010$\u001a\u00020\u00182\b\u0010%\u001a\u0004\u0018\u00010\u0001HÖ\u0003J\t\u0010&\u001a\u00020\u001aHÖ\u0001J\t\u0010'\u001a\u00020\u0003HÖ\u0001R\u0016\u0010\u0002\u001a\u00020\u00038\u0006X\u0087\u0004¢\u0006\b\n\u0000\u001a\u0004\b\f\u0010\rR\u0011\u0010\u0004\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u000e\u0010\rR\u0013\u0010\u0005\u001a\u0004\u0018\u00010\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u000f\u0010\rR\u0015\u0010\u0006\u001a\u0004\u0018\u00010\u0007¢\u0006\n\n\u0002\u0010\u0012\u001a\u0004\b\u0010\u0010\u0011R\u0011\u0010\b\u001a\u00020\u0007¢\u0006\b\n\u0000\u001a\u0004\b\u0013\u0010\u0014R\u0011\u0010\t\u001a\u00020\u0007¢\u0006\b\n\u0000\u001a\u0004\b\u0015\u0010\u0014¨\u0006("}, d2 = {"Lcom/strmr/ps/data/local/entity/EasyDebridAccount;", "", "providerId", "", "apiKey", "userId", "paidUntil", "", "lastVerifiedAt", "createdAt", "<init>", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Long;JJ)V", "getProviderId", "()Ljava/lang/String;", "getApiKey", "getUserId", "getPaidUntil", "()Ljava/lang/Long;", "Ljava/lang/Long;", "getLastVerifiedAt", "()J", "getCreatedAt", "getAuthHeader", "isPremium", "", "getDaysRemaining", "", "()Ljava/lang/Integer;", "component1", "component2", "component3", "component4", "component5", "component6", "copy", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Long;JJ)Lcom/strmr/ps/data/local/entity/EasyDebridAccount;", "equals", "other", "hashCode", "toString", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
@vm2
public final /* data */ class EasyDebridAccount {

    @kp6
    private final String apiKey;
    private final long createdAt;
    private final long lastVerifiedAt;

    @pq6
    private final Long paidUntil;

    @ih7
    @kp6
    private final String providerId;

    @pq6
    private final String userId;

    public EasyDebridAccount(@kp6 String str, @kp6 String str2, @pq6 String str3, @pq6 Long l, long j, long j2) {
        cr4.g(str, "providerId");
        cr4.g(str2, "apiKey");
        this.providerId = str;
        this.apiKey = str2;
        this.userId = str3;
        this.paidUntil = l;
        this.lastVerifiedAt = j;
        this.createdAt = j2;
    }

    public static /* synthetic */ EasyDebridAccount copy$default(EasyDebridAccount easyDebridAccount, String str, String str2, String str3, Long l, long j, long j2, int i, Object obj) {
        if ((i & 1) != 0) {
            str = easyDebridAccount.providerId;
        }
        if ((i & 2) != 0) {
            str2 = easyDebridAccount.apiKey;
        }
        if ((i & 4) != 0) {
            str3 = easyDebridAccount.userId;
        }
        if ((i & 8) != 0) {
            l = easyDebridAccount.paidUntil;
        }
        if ((i & 16) != 0) {
            j = easyDebridAccount.lastVerifiedAt;
        }
        if ((i & 32) != 0) {
            j2 = easyDebridAccount.createdAt;
        }
        long j3 = j2;
        long j4 = j;
        return easyDebridAccount.copy(str, str2, str3, l, j4, j3);
    }

    @kp6
    /* JADX INFO: renamed from: component1, reason: from getter */
    public final String getProviderId() {
        return this.providerId;
    }

    @kp6
    /* JADX INFO: renamed from: component2, reason: from getter */
    public final String getApiKey() {
        return this.apiKey;
    }

    @pq6
    /* JADX INFO: renamed from: component3, reason: from getter */
    public final String getUserId() {
        return this.userId;
    }

    @pq6
    /* JADX INFO: renamed from: component4, reason: from getter */
    public final Long getPaidUntil() {
        return this.paidUntil;
    }

    /* JADX INFO: renamed from: component5, reason: from getter */
    public final long getLastVerifiedAt() {
        return this.lastVerifiedAt;
    }

    /* JADX INFO: renamed from: component6, reason: from getter */
    public final long getCreatedAt() {
        return this.createdAt;
    }

    @kp6
    public final EasyDebridAccount copy(@kp6 String providerId, @kp6 String apiKey, @pq6 String userId, @pq6 Long paidUntil, long lastVerifiedAt, long createdAt) {
        cr4.g(providerId, "providerId");
        cr4.g(apiKey, "apiKey");
        return new EasyDebridAccount(providerId, apiKey, userId, paidUntil, lastVerifiedAt, createdAt);
    }

    public boolean equals(@pq6 Object other) {
        if (this == other) {
            return true;
        }
        if (!(other instanceof EasyDebridAccount)) {
            return false;
        }
        EasyDebridAccount easyDebridAccount = (EasyDebridAccount) other;
        return cr4.b(this.providerId, easyDebridAccount.providerId) && cr4.b(this.apiKey, easyDebridAccount.apiKey) && cr4.b(this.userId, easyDebridAccount.userId) && cr4.b(this.paidUntil, easyDebridAccount.paidUntil) && this.lastVerifiedAt == easyDebridAccount.lastVerifiedAt && this.createdAt == easyDebridAccount.createdAt;
    }

    @kp6
    public final String getApiKey() {
        return this.apiKey;
    }

    @kp6
    public final String getAuthHeader() {
        return n41.n("Bearer ", this.apiKey);
    }

    public final long getCreatedAt() {
        return this.createdAt;
    }

    @pq6
    public final Integer getDaysRemaining() {
        Long l = this.paidUntil;
        if (l == null) {
            return null;
        }
        Instant instantOfEpochSecond = Instant.ofEpochSecond(l.longValue());
        Instant instantNow = Instant.now();
        if (instantOfEpochSecond.isBefore(instantNow)) {
            return 0;
        }
        return Integer.valueOf((int) ChronoUnit.DAYS.between(instantNow, instantOfEpochSecond));
    }

    public final long getLastVerifiedAt() {
        return this.lastVerifiedAt;
    }

    @pq6
    public final Long getPaidUntil() {
        return this.paidUntil;
    }

    @kp6
    public final String getProviderId() {
        return this.providerId;
    }

    @pq6
    public final String getUserId() {
        return this.userId;
    }

    public int hashCode() {
        int iB = vw2.b(this.providerId.hashCode() * 31, 31, this.apiKey);
        String str = this.userId;
        int iHashCode = (iB + (str == null ? 0 : str.hashCode())) * 31;
        Long l = this.paidUntil;
        return Long.hashCode(this.createdAt) + fi7.b((iHashCode + (l != null ? l.hashCode() : 0)) * 31, 31, this.lastVerifiedAt);
    }

    public final boolean isPremium() {
        Long l = this.paidUntil;
        return l != null && l.longValue() > System.currentTimeMillis() / ((long) 1000);
    }

    @kp6
    public String toString() {
        String str = this.providerId;
        String str2 = this.apiKey;
        String str3 = this.userId;
        Long l = this.paidUntil;
        long j = this.lastVerifiedAt;
        long j2 = this.createdAt;
        StringBuilder sbM = fi7.m("EasyDebridAccount(providerId=", str, ", apiKey=", str2, ", userId=");
        sbM.append(str3);
        sbM.append(", paidUntil=");
        sbM.append(l);
        sbM.append(", lastVerifiedAt=");
        sbM.append(j);
        sbM.append(", createdAt=");
        sbM.append(j2);
        sbM.append(")");
        return sbM.toString();
    }

    public /* synthetic */ EasyDebridAccount(String str, String str2, String str3, Long l, long j, long j2, int i, uz1 uz1Var) {
        this((i & 1) != 0 ? PreferencesRepository.DEBRID_EASYDEBRID : str, str2, str3, l, j, j2);
    }
}
