import { SUPER_USER_MODE, APP_NAME } from '@/store/utils/localStorageKeys'

export default {
  config: {
    https: process.env.VUE_APP_HTTPS === 'true',
    developerMode:
      process.env.VUE_APP_ENABLE_DEVELOPER_MODE === 'true' && sessionStorage.getItem(SUPER_USER_MODE) === 'activate',
  },
  evo: {
    enable:
      (process.env.VUE_APP_ENABLE_DEVELOPER_MODE === 'true' && sessionStorage.getItem(APP_NAME) === 'EVO') ||
      process.env.VUE_APP_APPLICATION_NAME === 'EVO',
  },
  order_history: {
    ek_smart: {
      // Disable/Enable download button on ek smart listing
      application_form: false,
    },
  },
  eshop: {
    order_item: {
      cv_transfer_checkbox: process.env.VUE_APP_CV_WALLET === 'true',
    },
  },
  byDzyne: {
    eshopCheckoutBaseUrl: process.env.VUE_APP_THIRDPARTY_CHECKOUT_PATH,
  },
  enrolment: {
    disableContactVerification: process.env.VUE_APP_ENROLMENT_DISABLE_CONTACT_VERIFICATION === 'true',
    disableExpressEnrolment: process.env.VUE_APP_ENROLMENT_DISABLE_EXPRESS_ENROLMENT === 'true',
  },
  payment: {
    on_hold_payment_options:
      process.env.VUE_APP_ON_HOLD_PAYMENT_OPTIONS_TOGGLE === undefined ||
      process.env.VUE_APP_ON_HOLD_PAYMENT_OPTIONS_TOGGLE === 'true',
    cross_domain: process.env.VUE_APP_PAYMENT_APP_CROSS_DOMAIN_PAYMENT === 'true',
    eppPaymentFilter: process.env.VUE_APP_EPP_PAYMENT_FILTER === 'true',
    inlinePaymentMode: process.env.VUE_APP_INLINE_PAYMENT_OPTION === 'true',
  },
  retailPrice: {
    enable: process.env.VUE_APP_RETAIL_PRICE === 'true',
  },
  updateNotification: {
    autoRefresh: process.env.VUE_APP_UPDATE_NOTIFICATION_AUTO_REFRESH === 'true',
    timerDeadlineLimit: Number(process.env.VUE_APP_UPDATE_NOTIFICATION_TIMER_LIMIT) || 900,
  },
  socialAuthentication: {
    enable: process.env.VUE_APP_ENABLE_SOCIAL_LOGIN === 'true',
    baseUrl: process.env.VUE_APP_SOCIAL_AUTH_BASE_URL,
    providers: {
      facebook: {
        name: 'Facebook',
        url: process.env.VUE_APP_FACEBOOK_BACKEND_URL,
        clientId: process.env.VUE_APP_FACEBOOK_CLIENT_ID,
        redirectUri: process.env.VUE_APP_FACEBOOK_REDIRECT_URI,
        icon: 'brands/facebook',
        mappings: ['email', 'gender'],
      },
      google: {
        name: 'Google',
        url: process.env.VUE_APP_GOOGLE_BACKEND_URL,
        clientId: process.env.VUE_APP_GOOGLE_CLIENT_ID,
        redirectUri: process.env.VUE_APP_GOOGLE_REDIRECT_URI,
        icon: 'brands/google',
        mappings: ['email', 'gender'],
      },
    },
  },
  axios: {
    headers: {
      'x-platform': process.env.VUE_APP_AXIOS_HEADER_X_PLATFORM || 'eshop',
    },
  },
  myAccount: {
    ampPreference: process.env.VUE_APP_AMP_PREFERENCES === 'true',
  },
  productViewerApp: {
    addToCartCallBack: process.env.VUE_APP_THIRD_PARTY_ADD_CART_CALLBACK,
  },
  placementPreference: {
    enable: process.env.VUE_APP_PLACEMENT_PREFERENCE === 'true',
    showEnrolmentPlacementPage: process.env.VUE_APP_SHOW_ENROLMENT_PLACEMENT_PAGE === 'true',
  },
  ipWhois: {
    enable: process.env.VUE_APP_IP_WHOIS_ENABLE === 'true',
    key: process.env.VUE_APP_IP_WHOIS_KEY,
  },
  bundle: {
    dynamicPrice: {
      enable: process.env.VUE_APP_ENABLE_BUNDLE_DYNAMIC_PRICE === 'true',
    },
  },
}
