'use strict';

var _ = require('lodash');
var path = require('path');
var envConfig = {};

try {
  envConfig = require('./config.js');
} catch (e) {
  // do nothing
}
var defaultConfig = {
  env: 'dev',
  debug: true,
  cacheDir: 'tmp_cache',
  iconDir: 'icons',
  resourceDir: 'resources',
  root: path.join(__dirname, '../'),
  servers: {
    CN: {
      server: 'http://com.datav.aliyun.com/cube/',
      serverRoot: 'http://com.datav.aliyun.com/',
      locale: 'zh_CN'
    },
    JP: {
      server: 'http://datav-com-ap-northeast-1.alibabacloud.com/cube/',
      serverRoot: 'http://datav-com-ap-northeast-1.alibabacloud.com/',
      locale: 'ja_JP'
    },
    INNER: {
      server: 'http://com.datav.alibaba-inc.com/cube/',
      serverRoot: 'http://com.datav.alibaba-inc.com/',
      locale: 'zh_CN'
    },
    INNER_ALIPAY:{
      server: 'https://datav.alipay.com/component-center/cube/',
      serverRoot: 'https://datav.alipay.com/component-center/',
      locale: 'zh_CN'
    }
  },
  regionDefault: 'CN',
  localeDefault: 'en_US',
  serverDefault: 'http://com.datav.aliyun.com/',
  accountNameDefault: 'default',
  locale: '',
  systemToken: 'JV7TAs^n3u3eut1EaYug$cOPcsYQHchBPMank*3#X2AkQIDqctt&WHqSKGlbq^#F',
  port: 1111
};
var config = _.merge({}, defaultConfig, envConfig);

module.exports = config;
