export const YYYYMMDDHHmmss = "YYYY-MM-DD HH:mm:ss";
export const WEEKDAY_NAMES: Record<number, string> = {
  1: "一",
  2: "二",
  3: "三",
  4: "四",
  5: "五",
  6: "六",
  7: "日",
};

const env = import.meta.env;
export const VITE_SLS_STORE_NAME = env.VITE_SLS_STORE_NAME as string;
// export const VITE_CONFIG_FILE_SEVER_URL = env.VITE_CONFIG_FILE_SEVER_URL;
// 将config server与域名绑定 (为了让构建出来的包在测试和生产环境通用, 弃用环境变量配置)
export const VITE_CONFIG_FILE_SEVER_URL = window.location.hostname.includes("exam-cloud.cn")
  ? "https://ecs-static.qmth.com.cn"
  : "https://ecs-test-static.qmth.com.cn";
const modeStr = env.MODE !== "production" ? env.MODE + "-" : "";
export const VITE_GIT_REPO_VERSION = env.DEV
  ? "开发中..."
  : modeStr + env.VITE_GIT_REPO_VERSION + "-" + env.VITE_BUILD_DATE;

const domainCandidate =
  window.location.hostname.split(".")[0] + ".ecs.qmth.com.cn";
export const DOMAIN = env.DEV
  ? (env.VITE_DEVELOPMENT_DOMAIN as string)
  : domainCandidate;

export const WEBSOCKET_FOR_FACE_ID =
  window.location.origin.replace("http", "ws") + "/api/ws/faceBiopsy";

export const WEBSOCKET_FOR_AUDIO =
  window.location.origin.replace("http", "ws") + "/api/ws/fileAnswer";

export const FACEID_LINENESS_URL =
  "https://api.megvii.com/faceid/liveness/v2/do?token=";

export const PRIVACY_READ_VERSION_NUMBER = "1";

/** 限流请求的服务器 */
export const LIMIT_SERVER = "https://tcc.qmth.com.cn";

export const FACE_API_MODEL_PATH = env.BASE_URL + "models/20190620/";

/** 严格检测exe的指纹 */
export const HOST_FILE_HASH_MAP = new Map([
  [
    "pc-test.ea100.com.cn",
    "7501fb797d0bac668e13f392b42e1b9f6464442c2ffc03c2a3243416ef226eb8",
  ],
  // [
  //   "qmtest.exam-cloud.cn",
  //   "a31c9eb84fe82031fb01e9e25262f0b407caa705b5245654faeed1490bff67f9",
  // ],
  // [
  //   "uestccourse.exam-cloud.cn",
  //   "1ebdaa1e00fbefca0f6519e252e4d372bcb9c3f96c45760b032ca58683d28306",
  // ],
]);

export const STRICT_CHECK_HOSTS = [...HOST_FILE_HASH_MAP.keys()];
