package onexbet

import (
	//"bytes"

	"regexp"
	"strings"
	//"time"
	//"github.com/PuerkitoBio/goquery"
)

var (
	reCyber   = regexp.MustCompile(`(?i)\bCyber\b`)
	reEsoccer = regexp.MustCompile(`(?i)\bEsoccer\b`)

	bannedFootballChamps = []string{
		"Alternative Matches",
		"2x2",
		"3х3",
		"3x3",
		"4x4",
		"4х4",
		"5x5",
		"5x5",
		"5х5",
		"6x6",
		"7x7",
		"8 х 8",
		"8 х 8",
		"LFL",
		"SRL",
		"Club Friendlies",
		"Soap Soccer League",
		"League short football",
		"Dragon League",
		"CFL. Championship",
		"Table Soccer League",
		"Ladies League",
		"Dragon League. National",
		"Student League",
		"ACL Indoor",
		"Nacional Night League",
		"PRO Soccer League",
		"PRO Soccer League 2",
		"Short Football",
		"Derby League",
		"Serie A8",
		"Nacional League",
		"BumperBall Cup",
		"KLASK",
		"Copa Diego Armando Maradona",
		"Copa Luis Toti Brunengo",
	}

	bannedFootballPrefixes = []string{
		"FIFA 20.",
		"FIFA.",
		"USSR.",
		"PES 2020.",
	}
)

func FootballChampFilter(champName string) (_ bool) {
	// Мусор (champName)
	// FIFA 20. GT League G-26
	// Division 4х4
	// FIFA. eSports Battle. Night Retro International
	// Soccer Box 2x2
	// FIFA. 247. Division 1
	// USSR. 3x3. Division B
	// Turkey. Cyber FIFA20 Super Lig Matches
	// "Soccer Box 2x2"
	// "BudnesLiga LFL 5x5"
	// "RPL 6x6"
	// "La Liga Roja 7x7"
	// "6x6. Liga Pro"
	// "Short Football 4x4 L1"
	// "Short Football 4x4 L2"
	// "Division 4х4"
	// "Dream League 3x3"
	// "Short Football 5x5"
	// "6х6. Czech Republic. Regional League"
	// "Esoccer GT Leagues"
	// "Club Friendlies"
	// "Club Friendlies. Women"
	// Soap Soccer League. Women

	for _, bannedChampName := range bannedFootballChamps {
		if strings.Contains(champName, bannedChampName) {
			return
		}
	}

	for _, bannedPrefix := range bannedFootballPrefixes {
		if strings.HasPrefix(champName, bannedPrefix) {
			return
		}
	}

	if reCyber.MatchString(champName) {
		return
	}

	if reEsoccer.MatchString(champName) {
		return
	}
	return true
}
