package com.strmr.ps.data.model;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import androidx.media3.container.NalUnitUtil;
import androidx.media3.extractor.text.ttml.TtmlNode;
import com.google.android.gms.measurement.api.AppMeasurementSdk;
import com.strmr.ps.R;
import defpackage.cr4;
import defpackage.fi7;
import defpackage.kp6;
import defpackage.n41;
import defpackage.n89;
import defpackage.pq6;
import defpackage.q07;
import defpackage.uz1;
import defpackage.vw2;
import defpackage.vx8;
import defpackage.wo5;
import java.util.Locale;
import java.util.Map;
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\b\n\u0002\b\u000e\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0014\b\u0086\b\u0018\u0000 -2\u00020\u0001:\u0001-B?\u0012\u0006\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\b\u0010\b\u001a\u0004\u0018\u00010\u0003\u0012\b\u0010\t\u001a\u0004\u0018\u00010\u0003¢\u0006\u0004\b\n\u0010\u000bJ\u000e\u0010\u0015\u001a\u00020\u00162\u0006\u0010\u0017\u001a\u00020\u0018J+\u0010\u0019\u001a\u00020\u001a2\u0006\u0010\u0017\u001a\u00020\u00182\n\b\u0002\u0010\u001b\u001a\u0004\u0018\u00010\u00032\n\b\u0002\u0010\u001c\u001a\u0004\u0018\u00010\u0007¢\u0006\u0002\u0010\u001dJ#\u0010\u001e\u001a\u0004\u0018\u00010\u00032\b\u0010\u001b\u001a\u0004\u0018\u00010\u00032\b\u0010\u001c\u001a\u0004\u0018\u00010\u0007H\u0002¢\u0006\u0002\u0010\u001fJ\u0006\u0010 \u001a\u00020\u001aJ\t\u0010!\u001a\u00020\u0003HÆ\u0003J\t\u0010\"\u001a\u00020\u0003HÆ\u0003J\u000b\u0010#\u001a\u0004\u0018\u00010\u0003HÆ\u0003J\u0010\u0010$\u001a\u0004\u0018\u00010\u0007HÆ\u0003¢\u0006\u0002\u0010\u0011J\u000b\u0010%\u001a\u0004\u0018\u00010\u0003HÆ\u0003J\u000b\u0010&\u001a\u0004\u0018\u00010\u0003HÆ\u0003JR\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\n\b\u0002\u0010\b\u001a\u0004\u0018\u00010\u00032\n\b\u0002\u0010\t\u001a\u0004\u0018\u00010\u0003HÆ\u0001¢\u0006\u0002\u0010(J\u0013\u0010)\u001a\u00020\u00162\b\u0010*\u001a\u0004\u0018\u00010\u0001HÖ\u0003J\t\u0010+\u001a\u00020\u0007HÖ\u0001J\t\u0010,\u001a\u00020\u0003HÖ\u0001R\u0011\u0010\u0002\u001a\u00020\u0003¢\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\u0013\u0010\b\u001a\u0004\u0018\u00010\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u0013\u0010\rR\u0013\u0010\t\u001a\u0004\u0018\u00010\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u0014\u0010\r¨\u0006."}, d2 = {"Lcom/strmr/ps/data/model/StreamingService;", "", TtmlNode.ATTR_ID, "", "displayName", "packageName", "logoRes", "", "webUrl", "playStoreUrl", "<init>", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;)V", "getId", "()Ljava/lang/String;", "getDisplayName", "getPackageName", "getLogoRes", "()Ljava/lang/Integer;", "Ljava/lang/Integer;", "getWebUrl", "getPlayStoreUrl", "isAppInstalled", "", "context", "Landroid/content/Context;", "createIntent", "Landroid/content/Intent;", "imdbId", "tmdbId", "(Landroid/content/Context;Ljava/lang/String;Ljava/lang/Integer;)Landroid/content/Intent;", "getDeepLinkUrl", "(Ljava/lang/String;Ljava/lang/Integer;)Ljava/lang/String;", "createPlayStoreIntent", "component1", "component2", "component3", "component4", "component5", "component6", "copy", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;)Lcom/strmr/ps/data/model/StreamingService;", "equals", "other", "hashCode", "toString", "Companion", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
@vx8
public final /* data */ class StreamingService {

    /* JADX INFO: renamed from: Companion, reason: from kotlin metadata */
    @kp6
    public static final Companion INSTANCE = new Companion(null);

    @kp6
    private static final Map<String, StreamingService> KNOWN_SERVICES;

    @kp6
    private final String displayName;

    @kp6
    private final String id;

    @pq6
    private final Integer logoRes;

    @pq6
    private final String packageName;

    @pq6
    private final String playStoreUrl;

    @pq6
    private final String webUrl;

    @Metadata(d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0004\n\u0002\u0010$\n\u0002\b\u0003\b\u0086\u0003\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\u0002\u0010\u0003J\u001e\u0010\u0004\u001a\u0004\u0018\u00010\u00052\b\u0010\u0006\u001a\u0004\u0018\u00010\u00072\n\b\u0002\u0010\b\u001a\u0004\u0018\u00010\u0007J\u001a\u0010\t\u001a\u00020\u00052\u0006\u0010\u0006\u001a\u00020\u00072\b\u0010\n\u001a\u0004\u0018\u00010\u0007H\u0002R\u001d\u0010\u000b\u001a\u000e\u0012\u0004\u0012\u00020\u0007\u0012\u0004\u0012\u00020\u00050\f¢\u0006\b\n\u0000\u001a\u0004\b\r\u0010\u000e¨\u0006\u000f"}, d2 = {"Lcom/strmr/ps/data/model/StreamingService$Companion;", "", "<init>", "()V", "fromStreamName", "Lcom/strmr/ps/data/model/StreamingService;", AppMeasurementSdk.ConditionalUserProperty.NAME, "", "externalUrl", "createUnknownService", "webUrl", "KNOWN_SERVICES", "", "getKNOWN_SERVICES", "()Ljava/util/Map;", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
    public static final class Companion {
        public /* synthetic */ Companion(uz1 uz1Var) {
            this();
        }

        private final StreamingService createUnknownService(String name, String webUrl) {
            String lowerCase = name.toLowerCase(Locale.ROOT);
            cr4.f(lowerCase, "toLowerCase(...)");
            return new StreamingService(n89.an(lowerCase, " ", "_"), name, null, null, webUrl, null);
        }

        public static /* synthetic */ StreamingService fromStreamName$default(Companion companion, String str, String str2, int i, Object obj) {
            if ((i & 2) != 0) {
                str2 = null;
            }
            return companion.fromStreamName(str, str2);
        }

        @pq6
        public final StreamingService fromStreamName(@pq6 String name, @pq6 String externalUrl) {
            Object obj = null;
            if (name == null || n89.ab(name)) {
                return null;
            }
            String lowerCase = name.toLowerCase(Locale.ROOT);
            cr4.f(lowerCase, "toLowerCase(...)");
            String strAn = n89.an(n89.an(n89.an(n89.bg(lowerCase).toString(), "+", "plus"), " ", "_"), "-", "_");
            StreamingService streamingService = getKNOWN_SERVICES().get(strAn);
            if (streamingService != null) {
                return streamingService;
            }
            for (Object obj2 : getKNOWN_SERVICES().values()) {
                StreamingService streamingService2 = (StreamingService) obj2;
                if (!n89.l(strAn, streamingService2.getId(), false)) {
                    String lowerCase2 = streamingService2.getDisplayName().toLowerCase(Locale.ROOT);
                    cr4.f(lowerCase2, "toLowerCase(...)");
                    if (n89.l(strAn, lowerCase2, false)) {
                    }
                }
                obj = obj2;
            }
            StreamingService streamingService3 = (StreamingService) obj;
            return streamingService3 == null ? createUnknownService(name, externalUrl) : streamingService3;
        }

        @kp6
        public final Map<String, StreamingService> getKNOWN_SERVICES() {
            return StreamingService.KNOWN_SERVICES;
        }

        private Companion() {
        }
    }

    static {
        q07 q07Var = new q07("netflix", new StreamingService("netflix", "Netflix", "com.netflix.mediaclient", Integer.valueOf(R.drawable.network_netflix), "https://www.netflix.com", "https://play.google.com/store/apps/details?id=com.netflix.mediaclient"));
        Integer numValueOf = Integer.valueOf(R.drawable.network_amazon_prime);
        q07 q07Var2 = new q07("amazon_prime", new StreamingService("amazon_prime", "Prime Video", "com.amazon.avod.thirdpartyclient", numValueOf, "https://www.amazon.com/primevideo", "https://play.google.com/store/apps/details?id=com.amazon.avod.thirdpartyclient"));
        q07 q07Var3 = new q07("prime_video", new StreamingService("amazon_prime", "Prime Video", "com.amazon.avod.thirdpartyclient", numValueOf, "https://www.amazon.com/primevideo", "https://play.google.com/store/apps/details?id=com.amazon.avod.thirdpartyclient"));
        q07 q07Var4 = new q07("amazon", new StreamingService("amazon_prime", "Prime Video", "com.amazon.avod.thirdpartyclient", numValueOf, "https://www.amazon.com/primevideo", "https://play.google.com/store/apps/details?id=com.amazon.avod.thirdpartyclient"));
        Integer numValueOf2 = Integer.valueOf(R.drawable.network_disney_plus);
        q07 q07Var5 = new q07("disneyplus", new StreamingService("disney", "Disney+", "com.disney.disneyplus", numValueOf2, "https://www.disneyplus.com", "https://play.google.com/store/apps/details?id=com.disney.disneyplus"));
        q07 q07Var6 = new q07("disney", new StreamingService("disney", "Disney+", "com.disney.disneyplus", numValueOf2, "https://www.disneyplus.com", "https://play.google.com/store/apps/details?id=com.disney.disneyplus"));
        q07 q07Var7 = new q07("hulu", new StreamingService("hulu", "Hulu", "com.hulu.plus", Integer.valueOf(R.drawable.network_hulu), "https://www.hulu.com", "https://play.google.com/store/apps/details?id=com.hulu.plus"));
        Integer numValueOf3 = Integer.valueOf(R.drawable.network_hbo_max);
        q07 q07Var8 = new q07("max", new StreamingService("max", "Max", "com.wbd.stream", numValueOf3, "https://www.max.com", "https://play.google.com/store/apps/details?id=com.wbd.stream"));
        q07 q07Var9 = new q07("hbo_max", new StreamingService("max", "Max", "com.wbd.stream", numValueOf3, "https://www.max.com", "https://play.google.com/store/apps/details?id=com.wbd.stream"));
        q07 q07Var10 = new q07("hbo", new StreamingService("max", "Max", "com.wbd.stream", numValueOf3, "https://www.max.com", "https://play.google.com/store/apps/details?id=com.wbd.stream"));
        Integer numValueOf4 = Integer.valueOf(R.drawable.network_paramount);
        q07 q07Var11 = new q07("paramount", new StreamingService("paramount", "Paramount+", "com.cbs.ott", numValueOf4, "https://www.paramountplus.com", "https://play.google.com/store/apps/details?id=com.cbs.ott"));
        q07 q07Var12 = new q07("paramountplus", new StreamingService("paramount", "Paramount+", "com.cbs.ott", numValueOf4, "https://www.paramountplus.com", "https://play.google.com/store/apps/details?id=com.cbs.ott"));
        q07 q07Var13 = new q07("peacock", new StreamingService("peacock", "Peacock", "com.peacocktv.peacockandroid", Integer.valueOf(R.drawable.network_peacock), "https://www.peacocktv.com", "https://play.google.com/store/apps/details?id=com.peacocktv.peacockandroid"));
        Integer numValueOf5 = Integer.valueOf(R.drawable.network_apple_tv_plus);
        q07 q07Var14 = new q07("apple_tv", new StreamingService("apple_tv", "Apple TV+", "com.apple.atve.androidtv.appletv", numValueOf5, "https://tv.apple.com", "https://play.google.com/store/apps/details?id=com.apple.atve.androidtv.appletv"));
        q07 q07Var15 = new q07("appletv", new StreamingService("apple_tv", "Apple TV+", "com.apple.atve.androidtv.appletv", numValueOf5, "https://tv.apple.com", "https://play.google.com/store/apps/details?id=com.apple.atve.androidtv.appletv"));
        q07 q07Var16 = new q07("apple_tvplus", new StreamingService("apple_tv", "Apple TV+", "com.apple.atve.androidtv.appletv", numValueOf5, "https://tv.apple.com", "https://play.google.com/store/apps/details?id=com.apple.atve.androidtv.appletv"));
        q07 q07Var17 = new q07("showtime", new StreamingService("showtime", "Showtime", "com.showtime.standalone", Integer.valueOf(R.drawable.ic_streaming_showtime), "https://www.sho.com", "https://play.google.com/store/apps/details?id=com.showtime.standalone"));
        q07 q07Var18 = new q07("starz", new StreamingService("starz", "Starz", "com.starz.starzplay.android", Integer.valueOf(R.drawable.network_starz), "https://www.starz.com", "https://play.google.com/store/apps/details?id=com.starz.starzplay.android"));
        Integer numValueOf6 = Integer.valueOf(R.drawable.ic_streaming_mgm);
        q07 q07Var19 = new q07("mgmplus", new StreamingService("mgmplus", "MGM+", "com.epix.epix", numValueOf6, "https://www.mgmplus.com", "https://play.google.com/store/apps/details?id=com.epix.epix"));
        q07 q07Var20 = new q07("epix", new StreamingService("mgmplus", "MGM+", "com.epix.epix", numValueOf6, "https://www.mgmplus.com", "https://play.google.com/store/apps/details?id=com.epix.epix"));
        Integer numValueOf7 = Integer.valueOf(R.drawable.ic_streaming_crunchyroll);
        q07 q07Var21 = new q07("crunchyroll", new StreamingService("crunchyroll", "Crunchyroll", "com.crunchyroll.crunchyroid", numValueOf7, "https://www.crunchyroll.com", "https://play.google.com/store/apps/details?id=com.crunchyroll.crunchyroid"));
        q07 q07Var22 = new q07("funimation", new StreamingService("crunchyroll", "Crunchyroll", "com.crunchyroll.crunchyroid", numValueOf7, "https://www.crunchyroll.com", "https://play.google.com/store/apps/details?id=com.crunchyroll.crunchyroid"));
        q07 q07Var23 = new q07("hidive", new StreamingService("hidive", "HIDIVE", "com.hidive.streaming", null, "https://www.hidive.com", "https://play.google.com/store/apps/details?id=com.hidive.streaming"));
        q07 q07Var24 = new q07("tubi", new StreamingService("tubi", "Tubi", "com.tubitv", Integer.valueOf(R.drawable.ic_streaming_tubi), "https://tubitv.com", "https://play.google.com/store/apps/details?id=com.tubitv"));
        Integer numValueOf8 = Integer.valueOf(R.drawable.ic_streaming_pluto);
        q07 q07Var25 = new q07("pluto", new StreamingService("pluto", "Pluto TV", "tv.pluto.android", numValueOf8, "https://pluto.tv", "https://play.google.com/store/apps/details?id=tv.pluto.android"));
        q07 q07Var26 = new q07("pluto_tv", new StreamingService("pluto", "Pluto TV", "tv.pluto.android", numValueOf8, "https://pluto.tv", "https://play.google.com/store/apps/details?id=tv.pluto.android"));
        q07 q07Var27 = new q07("freevee", new StreamingService("freevee", "Freevee", "com.amazon.imdb.tv.android.app", null, "https://www.amazon.com/freevee", "https://play.google.com/store/apps/details?id=com.amazon.imdb.tv.android.app"));
        q07 q07Var28 = new q07("roku", new StreamingService("roku", "The Roku Channel", "com.roku.web.trc", null, "https://therokuchannel.roku.com", "https://play.google.com/store/apps/details?id=com.roku.web.trc"));
        Integer numValueOf9 = Integer.valueOf(R.drawable.ic_streaming_youtube);
        KNOWN_SERVICES = wo5.j(q07Var, q07Var2, q07Var3, q07Var4, q07Var5, q07Var6, q07Var7, q07Var8, q07Var9, q07Var10, q07Var11, q07Var12, q07Var13, q07Var14, q07Var15, q07Var16, q07Var17, q07Var18, q07Var19, q07Var20, q07Var21, q07Var22, q07Var23, q07Var24, q07Var25, q07Var26, q07Var27, q07Var28, new q07("youtube", new StreamingService("youtube", "YouTube", "com.google.android.youtube", numValueOf9, "https://www.youtube.com", "https://play.google.com/store/apps/details?id=com.google.android.youtube")), new q07("youtube_premium", new StreamingService("youtube", "YouTube", "com.google.android.youtube", numValueOf9, "https://www.youtube.com", "https://play.google.com/store/apps/details?id=com.google.android.youtube")), new q07("vudu", new StreamingService("vudu", "Vudu", "air.com.vudu.air.DownloaderTablet", null, "https://www.vudu.com", "https://play.google.com/store/apps/details?id=air.com.vudu.air.DownloaderTablet")), new q07("google_play", new StreamingService("google_play", "Google Play", "com.google.android.videos", null, "https://play.google.com/store/movies", "https://play.google.com/store/apps/details?id=com.google.android.videos")), new q07("itunes", new StreamingService("itunes", "iTunes", null, null, "https://itunes.apple.com", null)));
    }

    public StreamingService(@kp6 String str, @kp6 String str2, @pq6 String str3, @pq6 Integer num, @pq6 String str4, @pq6 String str5) {
        cr4.g(str, TtmlNode.ATTR_ID);
        cr4.g(str2, "displayName");
        this.id = str;
        this.displayName = str2;
        this.packageName = str3;
        this.logoRes = num;
        this.webUrl = str4;
        this.playStoreUrl = str5;
    }

    public static /* synthetic */ StreamingService copy$default(StreamingService streamingService, String str, String str2, String str3, Integer num, String str4, String str5, int i, Object obj) {
        if ((i & 1) != 0) {
            str = streamingService.id;
        }
        if ((i & 2) != 0) {
            str2 = streamingService.displayName;
        }
        if ((i & 4) != 0) {
            str3 = streamingService.packageName;
        }
        if ((i & 8) != 0) {
            num = streamingService.logoRes;
        }
        if ((i & 16) != 0) {
            str4 = streamingService.webUrl;
        }
        if ((i & 32) != 0) {
            str5 = streamingService.playStoreUrl;
        }
        String str6 = str4;
        String str7 = str5;
        return streamingService.copy(str, str2, str3, num, str6, str7);
    }

    public static /* synthetic */ Intent createIntent$default(StreamingService streamingService, Context context, String str, Integer num, int i, Object obj) {
        if ((i & 2) != 0) {
            str = null;
        }
        if ((i & 4) != 0) {
            num = null;
        }
        return streamingService.createIntent(context, str, num);
    }

    /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
    /* JADX WARN: Code restructure failed: missing block: B:24:0x0048, code lost:
    
        if (r3.equals("hbo_max") == false) goto L63;
     */
    /* JADX WARN: Code restructure failed: missing block: B:37:0x0073, code lost:
    
        if (r3.equals("max") == false) goto L63;
     */
    /* JADX WARN: Code restructure failed: missing block: B:40:0x007c, code lost:
    
        return "https://play.max.com/show/".concat(r2);
     */
    /* JADX WARN: Failed to restore switch over string. Please report as a decompilation issue */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    private final String getDeepLinkUrl(String imdbId, Integer tmdbId) {
        if (imdbId == null) {
            return null;
        }
        String str = this.id;
        switch (str.hashCode()) {
            case -1331547564:
                if (str.equals("disney")) {
                    return "https://www.disneyplus.com/video/".concat(imdbId);
                }
                return this.webUrl;
            case -694617888:
                if (str.equals("peacock")) {
                    return "https://www.peacocktv.com/watch/playback/".concat(imdbId);
                }
                return this.webUrl;
            case -337877174:
                if (str.equals("showtime")) {
                    return "https://www.sho.com/video/".concat(imdbId);
                }
                return this.webUrl;
            case -259192087:
                if (str.equals("crunchyroll")) {
                    return "https://www.crunchyroll.com/watch/".concat(imdbId);
                }
                return this.webUrl;
            case -164853628:
                if (str.equals("amazon_prime")) {
                    return "https://watch.amazon.com/detail?gti=".concat(imdbId);
                }
                return this.webUrl;
            case 107876:
                break;
            case 3214166:
                if (str.equals("hulu")) {
                    return "https://www.hulu.com/watch/".concat(imdbId);
                }
                return this.webUrl;
            case 109757544:
                if (str.equals("starz")) {
                    return "https://www.starz.com/play/".concat(imdbId);
                }
                return this.webUrl;
            case 722207962:
                break;
            case 1179384199:
                if (str.equals("apple_tv")) {
                    return "https://tv.apple.com/show/".concat(imdbId);
                }
                return this.webUrl;
            case 1842975634:
                if (str.equals("netflix")) {
                    return "https://www.netflix.com/title/".concat(imdbId);
                }
                return this.webUrl;
            case 1954759737:
                if (str.equals("paramount")) {
                    return "https://www.paramountplus.com/shows/video/".concat(imdbId);
                }
                return this.webUrl;
            default:
                return this.webUrl;
        }
    }

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

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

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

    @pq6
    /* JADX INFO: renamed from: component4, reason: from getter */
    public final Integer getLogoRes() {
        return this.logoRes;
    }

    @pq6
    /* JADX INFO: renamed from: component5, reason: from getter */
    public final String getWebUrl() {
        return this.webUrl;
    }

    @pq6
    /* JADX INFO: renamed from: component6, reason: from getter */
    public final String getPlayStoreUrl() {
        return this.playStoreUrl;
    }

    @kp6
    public final StreamingService copy(@kp6 String id, @kp6 String displayName, @pq6 String packageName, @pq6 Integer logoRes, @pq6 String webUrl, @pq6 String playStoreUrl) {
        cr4.g(id, TtmlNode.ATTR_ID);
        cr4.g(displayName, "displayName");
        return new StreamingService(id, displayName, packageName, logoRes, webUrl, playStoreUrl);
    }

    @kp6
    public final Intent createIntent(@kp6 Context context, @pq6 String imdbId, @pq6 Integer tmdbId) {
        cr4.g(context, "context");
        if (this.packageName != null && isAppInstalled(context)) {
            String deepLinkUrl = getDeepLinkUrl(imdbId, tmdbId);
            if (deepLinkUrl != null) {
                Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(deepLinkUrl));
                intent.setPackage(this.packageName);
                intent.addFlags(268435456);
                return intent;
            }
            Intent launchIntentForPackage = context.getPackageManager().getLaunchIntentForPackage(this.packageName);
            if (launchIntentForPackage != null) {
                launchIntentForPackage.addFlags(268435456);
                return launchIntentForPackage;
            }
        }
        return createPlayStoreIntent();
    }

    @kp6
    public final Intent createPlayStoreIntent() {
        String strConcat = this.playStoreUrl;
        if (strConcat == null) {
            String str = this.packageName;
            strConcat = str != null ? "https://play.google.com/store/apps/details?id=".concat(str) : null;
            if (strConcat == null) {
                strConcat = "https://play.google.com/store";
            }
        }
        Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(strConcat));
        intent.addFlags(268435456);
        return intent;
    }

    public boolean equals(@pq6 Object other) {
        if (this == other) {
            return true;
        }
        if (!(other instanceof StreamingService)) {
            return false;
        }
        StreamingService streamingService = (StreamingService) other;
        return cr4.b(this.id, streamingService.id) && cr4.b(this.displayName, streamingService.displayName) && cr4.b(this.packageName, streamingService.packageName) && cr4.b(this.logoRes, streamingService.logoRes) && cr4.b(this.webUrl, streamingService.webUrl) && cr4.b(this.playStoreUrl, streamingService.playStoreUrl);
    }

    @kp6
    public final String getDisplayName() {
        return this.displayName;
    }

    @kp6
    public final String getId() {
        return this.id;
    }

    @pq6
    public final Integer getLogoRes() {
        return this.logoRes;
    }

    @pq6
    public final String getPackageName() {
        return this.packageName;
    }

    @pq6
    public final String getPlayStoreUrl() {
        return this.playStoreUrl;
    }

    @pq6
    public final String getWebUrl() {
        return this.webUrl;
    }

    public int hashCode() {
        int iB = vw2.b(this.id.hashCode() * 31, 31, this.displayName);
        String str = this.packageName;
        int iHashCode = (iB + (str == null ? 0 : str.hashCode())) * 31;
        Integer num = this.logoRes;
        int iHashCode2 = (iHashCode + (num == null ? 0 : num.hashCode())) * 31;
        String str2 = this.webUrl;
        int iHashCode3 = (iHashCode2 + (str2 == null ? 0 : str2.hashCode())) * 31;
        String str3 = this.playStoreUrl;
        return iHashCode3 + (str3 != null ? str3.hashCode() : 0);
    }

    public final boolean isAppInstalled(@kp6 Context context) {
        cr4.g(context, "context");
        if (this.packageName == null) {
            return false;
        }
        try {
            context.getPackageManager().getPackageInfo(this.packageName, 0);
            return true;
        } catch (Exception unused) {
            return false;
        }
    }

    @kp6
    public String toString() {
        String str = this.id;
        String str2 = this.displayName;
        String str3 = this.packageName;
        Integer num = this.logoRes;
        String str4 = this.webUrl;
        String str5 = this.playStoreUrl;
        StringBuilder sbM = fi7.m("StreamingService(id=", str, ", displayName=", str2, ", packageName=");
        sbM.append(str3);
        sbM.append(", logoRes=");
        sbM.append(num);
        sbM.append(", webUrl=");
        return n41.u(sbM, str4, ", playStoreUrl=", str5, ")");
    }
}
