/*
 * Copyright (c) 2023 AccelByte Inc. All Rights Reserved
 * This is licensed software from AccelByte Inc, for limitations
 * and restrictions contact your company contract manager.
 */

import { SdkWidgetProps } from '@accelbyte/widgets-v2/SdkWidget'
import { ConfigsUtils } from '@accelbyte/widgets-v2/utils/ConfigsUtils'

import discoverySeedConfigs from 'seed/seed-latest--template-discovery.json'
import ppSeedConfigs from 'seed/seed-latest--pp.json'
import supportSeedConfigs from 'seed/seed-latest--support.json'
import { DiscoveryConfigData, PlayerPortalConfigData } from '@accelbyte/sdk-odinconfig'
import { Accelbyte } from '@accelbyte/sdk'
import { Env } from '@od-shared/Env'

const widgetOptions: SdkWidgetProps['widgetOptions'] = {
  generalConfigs: discoverySeedConfigs as DiscoveryConfigData,
  playerPortalConfigs: ppSeedConfigs as unknown as PlayerPortalConfigData,
  twitchDropConfigs: ConfigsUtils.createTwitchDropConfigs(undefined),
  supportConfigs: supportSeedConfigs
}

export { widgetOptions }

export const sdk = Accelbyte.SDK({
  options: {
    baseURL: `http://localhost:5173/api`,
    clientId: Env.CLIENT_ID,
    redirectURI: Env.REDIRECT_URL,
    namespace: Env.NAMESPACE
  }
})
