const protocol = EASY_ENV_IS_BROWSER ? window.location.protocol : 'https';

const hostMap = {
  apiHost: `${protocol}//quantum-blocks.q-gp.com`,
  h5Host: `${protocol}//quantum-h5.q-gp.com`,
  qiniuHost: `${protocol}//appsync.lkbang.net`,
  shenceUrl: `${protocol}//bn.xyqb.com/sa?project=production`,
  opapiHost: `${protocol}//opapi.q-gp.com`,
  qiniuUpHost: `${protocol}//up-z0.qiniup.com`,
  talosHost: `${protocol}//talos.q-gp.com`,
  kdspHost: `${protocol}//kdsp-api.q-gp.com`,
  yxmTenantId: 560761,
  appIdMap: {
    560761: 'wxb3e6270e1b1e0bc7',
    560867: 'wxbd0bc68b270a1dab',
  },
};

if (EASY_ENV_IS_BROWSER) {
  const apolloCfg = window.apollo || window.__INITIAL_STATE__.apollo;
  if (apolloCfg) {
    for (const key in apolloCfg) {
      if (apolloCfg[key]) {
        hostMap[key] = apolloCfg[key];
      }
    }
  }
}

export default hostMap;