import { css } from 'styled-components/macro'

import { PROCEDURES } from '../procedures'

import {
  ClientConfig,
  ClientIds,
  ClientNames,
} from './types'

const randomHash = () => (
  (Math.random() ** Math.random()) * 9999999999999999
)

const params = {
  _p_version: 'facrtv',
}

export const facr: ClientConfig = {
  auth: {
    clientId: ClientIds.Facr,
    metaDataUrlParams: `?hash=${randomHash()}`,
  },
  defaultLanguage: 'cs',
  description: 'Live sports streaming platform. All matches playing under the auspices of Czech Republic FA. Access to full matches, various player playlists, and highlights. Free access in the Czech Republic. Available across all devices',
  disabledPreferences: false,
  name: ClientNames.Facr,
  privacyLink: '/privacy-policy-and-statement',
  requests: {
    [PROCEDURES.get_matches]: params,
    [PROCEDURES.get_team_matches]: params,
    [PROCEDURES.get_player_matches]: params,
    [PROCEDURES.get_tournament_matches]: params,
  },
  showSearch: false,
  styles: {
    background: '',
    homePageHeader: css`
      background: linear-gradient(83.42deg, #00257A 53.04%, rgba(0, 0, 0, 0) 94.83%), #000000;
    `,
    logo: 'facr-logo.svg',
    logoHeight: 6.3,
    logoLeft: 1.1,
    logoTop: 1.74,
    logoWidth: 8.25,
    matchLogoHeight: 3.4,
    matchLogoTopMargin: 0.9,
    matchLogoWidth: 4.5,
    matchPageMobileHeaderLogo: css`
      width: 35px;
      height: 25px;
      top: 2px;
    `,
    mobileHeaderLogo: css`
      width: 48px;
      height: 37px;
    `,
    userAccountLogo: css`
      width: 4.56rem;
      height: 3.488rem;
    `,
  },
  termsLink: '/terms-and-conditions?client_id=facr-ott-web',
  title: 'FACR.TV - The home of Czech football streaming',
  userAccountLinksDisabled: true,
}
