var _domain = "thscore";
function getCookie(e) {
  var t,
    n = new RegExp("(^| )" + e + "=([^;]*)(;|$)");
  return (t = document.cookie.match(n)) ? unescape(t[2]) : null;
}
function GetOrderbyOption() {
  return "time";
}
function GetFilterOption() {
  return 1;
}
function getCurrentTimeZone() {
  const e = getCookie("Time_Zone") || getCookie("Default_TimeZone") || 7;
  return Number.parseFloat(e);
}
function getUTCTime() {
  const e = new Date();
  return new Date(e.getTime() + 6e4 * e.getTimezoneOffset());
}
function convertTime(n, t) {
  var i = 1 == t ? 1 : 0,
    n;
  return (
    -1 != n.indexOf(":") &&
      ((n = n.replace(/-/g, ",").replace(/\ /g, ",").replace(/:/g, ",")),
      (i = 1)),
    (n = n.split(",")),
    (n[1] = eval(n[1]) - i),
    new Date(n[0], n[1], n[2], n[3], n[4])
  );
}
window.helper = () => {
  const e = (e, t, n = 30) => {
    const o = new Date();
    o.setTime(o.getTime() + 24 * n * 60 * 60 * 1e3);
    const a = "expires=" + o.toUTCString();
    document.cookie = `${e}=${t}; domain=${getDoMain()}; ${a}; path=/`;
  };
  return {
    listCompany: (e = "") => {
      const t = [
        { value: 31, label: "Sbobet" },
        { value: 100, label: "K - Sport" },
        { value: 8, label: "Bet365" },
        { value: 23, label: "188bet" },
        { value: 24, label: "12bet" },
        { value: 42, label: "18Bet" },
        { value: 1, label: "Macauslot" },
        { value: 4, label: "Ladbrokes" },
        { value: 12, label: "Easybet" },
      ];
      return e ? t.find((t) => t.value == e) : t;
    },
    getCompany: () => this.getCookie("thscore_SelCompany") || 31,
    setCompany: (t) => {
      e("thscore_SelCompany", t);
    },
    getCookie: (e) => {
      const t = `${e}=`,
        n = decodeURIComponent(document.cookie)
          .split(";")
          .find((e) => e.trim().startsWith(t));
      return n ? n.substring(t.length) : "";
    },
    setCookie: e,
    listHtFt: () => [
      { value: "1", label: "HT" },
      { value: "0", label: "FT" },
    ],
  };
};
