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

import android.database.Cursor;
import androidx.room.RoomDatabase;
import com.google.android.gms.common.Scopes;
import com.strmr.ps.data.local.entity.PremiumizeAccount;
import defpackage.e6a;
import defpackage.mk1;
import defpackage.oq8;
import defpackage.p58;
import defpackage.pe9;
import defpackage.rq6;
import defpackage.sp1;
import defpackage.vo6;
import defpackage.vw2;
import defpackage.xm2;
import defpackage.yn1;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Callable;
import kotlin.coroutines.Continuation;

/* JADX INFO: loaded from: classes3.dex */
public final class PremiumizeAccountDao_Impl implements PremiumizeAccountDao {
    private final RoomDatabase __db;
    private final xm2<PremiumizeAccount> __insertionAdapterOfPremiumizeAccount;
    private final oq8 __preparedStmtOfDeleteAccount;
    private final oq8 __preparedStmtOfUpdateAccountInfo;

    public PremiumizeAccountDao_Impl(@vo6 RoomDatabase roomDatabase) {
        this.__db = roomDatabase;
        this.__insertionAdapterOfPremiumizeAccount = new xm2<PremiumizeAccount>(roomDatabase) { // from class: com.strmr.ps.data.local.dao.PremiumizeAccountDao_Impl.1
            @Override // defpackage.oq8
            @vo6
            public String createQuery() {
                return "INSERT OR REPLACE INTO `premiumize_accounts` (`providerId`,`apiKey`,`accessToken`,`customerId`,`username`,`email`,`accountStatus`,`expiresAt`,`pointsUsed`,`pointsAvailable`,`spaceLimitBytes`,`spaceUsedBytes`,`fairUsageLimitBytes`,`fairUsageUsedBytes`,`lastVerifiedAt`,`createdAt`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
            }

            @Override // defpackage.xm2
            public void bind(@vo6 pe9 pe9Var, @vo6 PremiumizeAccount premiumizeAccount) {
                pe9Var.bindString(1, premiumizeAccount.getProviderId());
                if (premiumizeAccount.getApiKey() == null) {
                    pe9Var.bindNull(2);
                } else {
                    pe9Var.bindString(2, premiumizeAccount.getApiKey());
                }
                if (premiumizeAccount.getAccessToken() == null) {
                    pe9Var.bindNull(3);
                } else {
                    pe9Var.bindString(3, premiumizeAccount.getAccessToken());
                }
                if (premiumizeAccount.getCustomerId() == null) {
                    pe9Var.bindNull(4);
                } else {
                    pe9Var.bindString(4, premiumizeAccount.getCustomerId());
                }
                if (premiumizeAccount.getUsername() == null) {
                    pe9Var.bindNull(5);
                } else {
                    pe9Var.bindString(5, premiumizeAccount.getUsername());
                }
                if (premiumizeAccount.getEmail() == null) {
                    pe9Var.bindNull(6);
                } else {
                    pe9Var.bindString(6, premiumizeAccount.getEmail());
                }
                if (premiumizeAccount.getAccountStatus() == null) {
                    pe9Var.bindNull(7);
                } else {
                    pe9Var.bindString(7, premiumizeAccount.getAccountStatus());
                }
                if (premiumizeAccount.getExpiresAt() == null) {
                    pe9Var.bindNull(8);
                } else {
                    pe9Var.bindLong(8, premiumizeAccount.getExpiresAt().longValue());
                }
                if (premiumizeAccount.getPointsUsed() == null) {
                    pe9Var.bindNull(9);
                } else {
                    pe9Var.bindDouble(9, premiumizeAccount.getPointsUsed().doubleValue());
                }
                if (premiumizeAccount.getPointsAvailable() == null) {
                    pe9Var.bindNull(10);
                } else {
                    pe9Var.bindDouble(10, premiumizeAccount.getPointsAvailable().doubleValue());
                }
                if (premiumizeAccount.getSpaceLimitBytes() == null) {
                    pe9Var.bindNull(11);
                } else {
                    pe9Var.bindLong(11, premiumizeAccount.getSpaceLimitBytes().longValue());
                }
                if (premiumizeAccount.getSpaceUsedBytes() == null) {
                    pe9Var.bindNull(12);
                } else {
                    pe9Var.bindLong(12, premiumizeAccount.getSpaceUsedBytes().longValue());
                }
                if (premiumizeAccount.getFairUsageLimitBytes() == null) {
                    pe9Var.bindNull(13);
                } else {
                    pe9Var.bindLong(13, premiumizeAccount.getFairUsageLimitBytes().longValue());
                }
                if (premiumizeAccount.getFairUsageUsedBytes() == null) {
                    pe9Var.bindNull(14);
                } else {
                    pe9Var.bindLong(14, premiumizeAccount.getFairUsageUsedBytes().longValue());
                }
                pe9Var.bindLong(15, premiumizeAccount.getLastVerifiedAt());
                pe9Var.bindLong(16, premiumizeAccount.getCreatedAt());
            }
        };
        this.__preparedStmtOfUpdateAccountInfo = new oq8(roomDatabase) { // from class: com.strmr.ps.data.local.dao.PremiumizeAccountDao_Impl.2
            @Override // defpackage.oq8
            @vo6
            public String createQuery() {
                return "\n        UPDATE premiumize_accounts\n        SET username = ?,\n            email = ?,\n            customerId = ?,\n            accountStatus = ?,\n            expiresAt = ?,\n            pointsUsed = ?,\n            pointsAvailable = ?,\n            spaceLimitBytes = ?,\n            spaceUsedBytes = ?,\n            fairUsageLimitBytes = ?,\n            fairUsageUsedBytes = ?,\n            lastVerifiedAt = ?\n        WHERE providerId = ?\n        ";
            }
        };
        this.__preparedStmtOfDeleteAccount = new oq8(roomDatabase) { // from class: com.strmr.ps.data.local.dao.PremiumizeAccountDao_Impl.3
            @Override // defpackage.oq8
            @vo6
            public String createQuery() {
                return "DELETE FROM premiumize_accounts WHERE providerId = ?";
            }
        };
    }

    @vo6
    public static List<Class<?>> getRequiredConverters() {
        return Collections.EMPTY_LIST;
    }

    @Override // com.strmr.ps.data.local.dao.PremiumizeAccountDao
    public Object deleteAccount(final String str, Continuation<? super e6a> continuation) {
        return mk1.b(this.__db, new Callable<e6a>() { // from class: com.strmr.ps.data.local.dao.PremiumizeAccountDao_Impl.6
            /* JADX WARN: Can't rename method to resolve collision */
            @Override // java.util.concurrent.Callable
            @vo6
            public e6a call() throws Exception {
                pe9 pe9VarAcquire = PremiumizeAccountDao_Impl.this.__preparedStmtOfDeleteAccount.acquire();
                pe9VarAcquire.bindString(1, str);
                try {
                    PremiumizeAccountDao_Impl.this.__db.beginTransaction();
                    try {
                        pe9VarAcquire.executeUpdateDelete();
                        PremiumizeAccountDao_Impl.this.__db.setTransactionSuccessful();
                        return e6a.a;
                    } finally {
                        PremiumizeAccountDao_Impl.this.__db.endTransaction();
                    }
                } finally {
                    PremiumizeAccountDao_Impl.this.__preparedStmtOfDeleteAccount.release(pe9VarAcquire);
                }
            }
        }, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.PremiumizeAccountDao
    public Object getAccount(String str, Continuation<? super PremiumizeAccount> continuation) {
        final p58 p58VarD = p58.d(1, "SELECT * FROM premiumize_accounts WHERE providerId = ? LIMIT 1");
        return mk1.c(this.__db, false, vw2.f(p58VarD, 1, str), new Callable<PremiumizeAccount>() { // from class: com.strmr.ps.data.local.dao.PremiumizeAccountDao_Impl.7
            /* JADX WARN: Can't rename method to resolve collision */
            @Override // java.util.concurrent.Callable
            @rq6
            public PremiumizeAccount call() throws Exception {
                int iB;
                int iB2;
                int iB3;
                int iB4;
                int iB5;
                int iB6;
                int iB7;
                int iB8;
                int iB9;
                int iB10;
                int iB11;
                int iB12;
                int iB13;
                int iB14;
                AnonymousClass7 anonymousClass7 = this;
                Cursor cursorB = sp1.b(PremiumizeAccountDao_Impl.this.__db, p58VarD, false);
                try {
                    iB = yn1.b(cursorB, "providerId");
                    iB2 = yn1.b(cursorB, "apiKey");
                    iB3 = yn1.b(cursorB, "accessToken");
                    iB4 = yn1.b(cursorB, "customerId");
                    iB5 = yn1.b(cursorB, "username");
                    iB6 = yn1.b(cursorB, Scopes.EMAIL);
                    iB7 = yn1.b(cursorB, "accountStatus");
                    iB8 = yn1.b(cursorB, "expiresAt");
                    iB9 = yn1.b(cursorB, "pointsUsed");
                    iB10 = yn1.b(cursorB, "pointsAvailable");
                    iB11 = yn1.b(cursorB, "spaceLimitBytes");
                    iB12 = yn1.b(cursorB, "spaceUsedBytes");
                    iB13 = yn1.b(cursorB, "fairUsageLimitBytes");
                    iB14 = yn1.b(cursorB, "fairUsageUsedBytes");
                } catch (Throwable th) {
                    th = th;
                }
                try {
                    int iB15 = yn1.b(cursorB, "lastVerifiedAt");
                    int iB16 = yn1.b(cursorB, "createdAt");
                    PremiumizeAccount premiumizeAccount = null;
                    if (cursorB.moveToFirst()) {
                        premiumizeAccount = new PremiumizeAccount(cursorB.getString(iB), cursorB.isNull(iB2) ? null : cursorB.getString(iB2), cursorB.isNull(iB3) ? null : cursorB.getString(iB3), cursorB.isNull(iB4) ? null : cursorB.getString(iB4), cursorB.isNull(iB5) ? null : cursorB.getString(iB5), cursorB.isNull(iB6) ? null : cursorB.getString(iB6), cursorB.isNull(iB7) ? null : cursorB.getString(iB7), cursorB.isNull(iB8) ? null : Long.valueOf(cursorB.getLong(iB8)), cursorB.isNull(iB9) ? null : Double.valueOf(cursorB.getDouble(iB9)), cursorB.isNull(iB10) ? null : Double.valueOf(cursorB.getDouble(iB10)), cursorB.isNull(iB11) ? null : Long.valueOf(cursorB.getLong(iB11)), cursorB.isNull(iB12) ? null : Long.valueOf(cursorB.getLong(iB12)), cursorB.isNull(iB13) ? null : Long.valueOf(cursorB.getLong(iB13)), cursorB.isNull(iB14) ? null : Long.valueOf(cursorB.getLong(iB14)), cursorB.getLong(iB15), cursorB.getLong(iB16));
                    }
                    cursorB.close();
                    p58VarD.release();
                    return premiumizeAccount;
                } catch (Throwable th2) {
                    th = th2;
                    anonymousClass7 = this;
                    cursorB.close();
                    p58VarD.release();
                    throw th;
                }
            }
        }, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.PremiumizeAccountDao
    public Object updateAccountInfo(final String str, final String str2, final String str3, final String str4, final Long l, final Double d, final Double d2, final Long l2, final Long l3, final Long l4, final Long l5, final long j, final String str5, Continuation<? super e6a> continuation) {
        return mk1.b(this.__db, new Callable<e6a>() { // from class: com.strmr.ps.data.local.dao.PremiumizeAccountDao_Impl.5
            /* JADX WARN: Can't rename method to resolve collision */
            @Override // java.util.concurrent.Callable
            @vo6
            public e6a call() throws Exception {
                pe9 pe9VarAcquire = PremiumizeAccountDao_Impl.this.__preparedStmtOfUpdateAccountInfo.acquire();
                String str6 = str;
                if (str6 == null) {
                    pe9VarAcquire.bindNull(1);
                } else {
                    pe9VarAcquire.bindString(1, str6);
                }
                String str7 = str2;
                if (str7 == null) {
                    pe9VarAcquire.bindNull(2);
                } else {
                    pe9VarAcquire.bindString(2, str7);
                }
                String str8 = str3;
                if (str8 == null) {
                    pe9VarAcquire.bindNull(3);
                } else {
                    pe9VarAcquire.bindString(3, str8);
                }
                String str9 = str4;
                if (str9 == null) {
                    pe9VarAcquire.bindNull(4);
                } else {
                    pe9VarAcquire.bindString(4, str9);
                }
                Long l6 = l;
                if (l6 == null) {
                    pe9VarAcquire.bindNull(5);
                } else {
                    pe9VarAcquire.bindLong(5, l6.longValue());
                }
                Double d3 = d;
                if (d3 == null) {
                    pe9VarAcquire.bindNull(6);
                } else {
                    pe9VarAcquire.bindDouble(6, d3.doubleValue());
                }
                Double d4 = d2;
                if (d4 == null) {
                    pe9VarAcquire.bindNull(7);
                } else {
                    pe9VarAcquire.bindDouble(7, d4.doubleValue());
                }
                Long l7 = l2;
                if (l7 == null) {
                    pe9VarAcquire.bindNull(8);
                } else {
                    pe9VarAcquire.bindLong(8, l7.longValue());
                }
                Long l8 = l3;
                if (l8 == null) {
                    pe9VarAcquire.bindNull(9);
                } else {
                    pe9VarAcquire.bindLong(9, l8.longValue());
                }
                Long l9 = l4;
                if (l9 == null) {
                    pe9VarAcquire.bindNull(10);
                } else {
                    pe9VarAcquire.bindLong(10, l9.longValue());
                }
                Long l10 = l5;
                if (l10 == null) {
                    pe9VarAcquire.bindNull(11);
                } else {
                    pe9VarAcquire.bindLong(11, l10.longValue());
                }
                pe9VarAcquire.bindLong(12, j);
                pe9VarAcquire.bindString(13, str5);
                try {
                    PremiumizeAccountDao_Impl.this.__db.beginTransaction();
                    try {
                        pe9VarAcquire.executeUpdateDelete();
                        PremiumizeAccountDao_Impl.this.__db.setTransactionSuccessful();
                        return e6a.a;
                    } finally {
                        PremiumizeAccountDao_Impl.this.__db.endTransaction();
                    }
                } finally {
                    PremiumizeAccountDao_Impl.this.__preparedStmtOfUpdateAccountInfo.release(pe9VarAcquire);
                }
            }
        }, continuation);
    }

    @Override // com.strmr.ps.data.local.dao.PremiumizeAccountDao
    public Object upsert(final PremiumizeAccount premiumizeAccount, Continuation<? super e6a> continuation) {
        return mk1.b(this.__db, new Callable<e6a>() { // from class: com.strmr.ps.data.local.dao.PremiumizeAccountDao_Impl.4
            /* JADX WARN: Can't rename method to resolve collision */
            @Override // java.util.concurrent.Callable
            @vo6
            public e6a call() throws Exception {
                PremiumizeAccountDao_Impl.this.__db.beginTransaction();
                try {
                    PremiumizeAccountDao_Impl.this.__insertionAdapterOfPremiumizeAccount.insert(premiumizeAccount);
                    PremiumizeAccountDao_Impl.this.__db.setTransactionSuccessful();
                    return e6a.a;
                } finally {
                    PremiumizeAccountDao_Impl.this.__db.endTransaction();
                }
            }
        }, continuation);
    }
}
