var it = Object.defineProperty, ot = Object.defineProperties;
var st = Object.getOwnPropertyDescriptors;
var We = Object.getOwnPropertySymbols;
var lt = Object.prototype.hasOwnProperty, ut = Object.prototype.propertyIsEnumerable;
var Ue = (r, e, t) => e in r ? it(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, ke = (r, e) => {
  for (var t in e || (e = {}))
    lt.call(e, t) && Ue(r, t, e[t]);
  if (We)
    for (var t of We(e))
      ut.call(e, t) && Ue(r, t, e[t]);
  return r;
}, ze = (r, e) => ot(r, st(e));
var V = (r, e, t) => new Promise((n, a) => {
  var i = (c) => {
    try {
      s(t.next(c));
    } catch (u) {
      a(u);
    }
  }, o = (c) => {
    try {
      s(t.throw(c));
    } catch (u) {
      a(u);
    }
  }, s = (c) => c.done ? n(c.value) : Promise.resolve(c.value).then(i, o);
  s((t = t.apply(r, e)).next());
});
import { S as ct, b as dt, s as ft, f as ne, c as mt, n as se, d as Y, r as ht, w as W, y as ue, e as E, m as l, p as $, k as h, g as y, x as U, l as m, u as gt, o as pt, v as vt, D as ee, E as fe, h as ye, j as Le, q as de, t as wt } from "./CasinoGameOverlay-JJaexRWs.js";
import { a as bt, $ as _t, i as yt, c as xt } from "./CasinoMysteryChestContainer-DKa6J1xr.js";
import "../stencil/ui-skeleton-xXZA3rYO.js";
const Ye = (r) => window.postMessage(r, window.location.href), kt = "data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.1978%2013.2348C12.1978%209.60751%2015.1383%206.66699%2018.7656%206.66699C22.3929%206.66699%2025.3334%209.60751%2025.3334%2013.2348C25.3334%2016.8621%2022.3929%2019.8026%2018.7656%2019.8026C18.467%2019.8026%2018.1725%2019.7826%2017.8835%2019.7438C17.6825%2019.7168%2017.557%2019.7001%2017.4658%2019.6909C17.4218%2019.7326%2017.3626%2019.7916%2017.2673%2019.8869L12.5565%2024.5977C12.5457%2024.6085%2012.5344%2024.6198%2012.5229%2024.6315C12.4009%2024.7542%2012.2356%2024.9205%2012.0329%2025.0448C11.8576%2025.1522%2011.6665%2025.2313%2011.4666%2025.2793C11.2354%2025.3348%2011.001%2025.3341%2010.8279%2025.3335C10.8115%2025.3335%2010.7956%2025.3334%2010.7803%2025.3334L9.14719%2025.3334C8.91663%2025.3335%208.68571%2025.3335%208.48899%2025.3174C8.27114%2025.2996%208.00565%2025.2571%207.7365%2025.1199C7.36793%2024.9321%207.06826%2024.6325%206.88046%2024.2639C6.74332%2023.9948%206.70076%2023.7293%206.68297%2023.5114C6.66689%2023.3147%206.66693%2023.0838%206.66696%2022.8532L6.66696%2021.2201C6.66696%2021.2049%206.66691%2021.189%206.66686%2021.1725C6.66631%2020.9994%206.66557%2020.765%206.72109%2020.5338C6.76907%2020.3339%206.84822%2020.1428%206.95562%2019.9676C7.07986%2019.7648%207.24617%2019.5995%207.36894%2019.4776C7.3806%2019.466%207.39188%2019.4548%207.40268%2019.4439L12.1135%2014.7331C12.2088%2014.6378%2012.2678%2014.5786%2012.3095%2014.5346C12.3003%2014.4434%2012.2836%2014.3179%2012.2566%2014.1169C12.2178%2013.8279%2012.1978%2013.5334%2012.1978%2013.2348ZM18.7656%208.74104C16.2837%208.74104%2014.2718%2010.753%2014.2718%2013.2348C14.2718%2013.4408%2014.2856%2013.6429%2014.3122%2013.8406L14.3146%2013.8585C14.3394%2014.0432%2014.3618%2014.2097%2014.3749%2014.3451C14.3874%2014.4747%2014.4011%2014.6598%2014.3736%2014.8525C14.3367%2015.1105%2014.2715%2015.3033%2014.1443%2015.5308C14.0078%2015.7751%2013.7931%2015.9881%2013.629%2016.151C13.6121%2016.1678%2013.5958%2016.184%2013.5801%2016.1997L8.86926%2020.9105C8.82845%2020.9513%208.79718%2020.9826%208.77036%2021.0099C8.75929%2021.0212%208.74992%2021.0308%208.74194%2021.0392C8.7417%2021.0507%208.74151%2021.0641%208.74137%2021.0799C8.74102%2021.1182%208.74101%2021.1624%208.74101%2021.2201V22.8215C8.74101%2023.0268%208.74146%2023.1591%208.74514%2023.2553C8.84132%2023.2589%208.97362%2023.2594%209.17887%2023.2594H10.7803C10.838%2023.2594%2010.8822%2023.2594%2010.9205%2023.259C10.9363%2023.2589%2010.9497%2023.2587%2010.9613%2023.2585C10.9696%2023.2505%2010.9792%2023.2411%2010.9905%2023.2301C11.0178%2023.2032%2011.0491%2023.172%2011.0899%2023.1312L15.8007%2018.4203C15.8164%2018.4046%2015.8327%2018.3883%2015.8494%2018.3714C16.0123%2018.2073%2016.2253%2017.9926%2016.4696%2017.8561C16.6971%2017.7289%2016.8899%2017.6638%2017.1479%2017.6268C17.3406%2017.5993%2017.5257%2017.613%2017.6553%2017.6255C17.7907%2017.6386%2017.9572%2017.661%2018.1419%2017.6858L18.1598%2017.6882C18.3575%2017.7148%2018.5597%2017.7286%2018.7656%2017.7286C21.2474%2017.7286%2023.2594%2015.7167%2023.2594%2013.2348C23.2594%2010.753%2021.2474%208.74104%2018.7656%208.74104ZM17.7286%2013.2348C17.7286%2012.6621%2018.1929%2012.1978%2018.7656%2012.1978H18.7748C19.3475%2012.1978%2019.8118%2012.6621%2019.8118%2013.2348C19.8118%2013.8076%2019.3475%2014.2718%2018.7748%2014.2718H18.7656C18.1929%2014.2718%2017.7286%2013.8076%2017.7286%2013.2348Z'%20fill='url(%23paint0_linear_714_605)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_714_605'%20x1='6.66675'%20y1='16.0003'%20x2='25.3334'%20y2='16.0003'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2375FFE9'/%3e%3cstop%20offset='1'%20stop-color='%23B2FF6D'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e", Ee = "data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.96967%203.96967C4.26256%203.67678%204.73744%203.67678%205.03033%203.96967L9%207.93934L12.9697%203.96967C13.2626%203.67678%2013.7374%203.67678%2014.0303%203.96967C14.3232%204.26256%2014.3232%204.73744%2014.0303%205.03033L10.0607%209L14.0303%2012.9697C14.3232%2013.2626%2014.3232%2013.7374%2014.0303%2014.0303C13.7374%2014.3232%2013.2626%2014.3232%2012.9697%2014.0303L9%2010.0607L5.03033%2014.0303C4.73744%2014.3232%204.26256%2014.3232%203.96967%2014.0303C3.67678%2013.7374%203.67678%2013.2626%203.96967%2012.9697L7.93934%209L3.96967%205.03033C3.67678%204.73744%203.67678%204.26256%203.96967%203.96967Z'%20fill='%23FF9B59'/%3e%3c/svg%3e", Fe = "data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15.1724%204.72381C15.4708%205.02223%2015.4708%205.50607%2015.1724%205.80449L7.70071%2013.2762C7.40229%2013.5746%206.91846%2013.5746%206.62004%2013.2762L3.22381%209.87996C2.9254%209.58154%202.9254%209.09771%203.22381%208.79929C3.52223%208.50087%204.00607%208.50087%204.30449%208.79929L7.16038%2011.6552L14.0917%204.72381C14.3902%204.4254%2014.874%204.4254%2015.1724%204.72381Z'%20fill='%2358DB4A'/%3e%3c/svg%3e", Ct = "data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.9124%204.83736C11.1402%205.06516%2011.1402%205.43451%2010.9124%205.66232L7.41243%209.16232C7.18462%209.39012%206.81528%209.39012%206.58747%209.16232L3.08747%205.66232C2.85966%205.43451%202.85966%205.06516%203.08747%204.83736C3.31528%204.60955%203.68462%204.60955%203.91243%204.83736L6.99995%207.92488L10.0875%204.83736C10.3153%204.60955%2010.6846%204.60955%2010.9124%204.83736Z'%20fill='url(%23paint0_linear_738_1669)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_738_1669'%20x1='6.99995'%20y1='4.6665'%20x2='6.99995'%20y2='9.33317'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2375FFE9'/%3e%3cstop%20offset='1'%20stop-color='%23B2FF6D'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e";
function we(r) {
  "@babel/helpers - typeof";
  return we = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
    return typeof e;
  } : function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, we(r);
}
function le(r) {
  if (r === null || r === !0 || r === !1)
    return NaN;
  var e = Number(r);
  return isNaN(e) ? e : e < 0 ? Math.ceil(e) : Math.floor(e);
}
function I(r, e) {
  if (e.length < r)
    throw new TypeError(r + " argument" + (r > 1 ? "s" : "") + " required, but only " + e.length + " present");
}
function J(r) {
  I(1, arguments);
  var e = Object.prototype.toString.call(r);
  return r instanceof Date || we(r) === "object" && e === "[object Date]" ? new Date(r.getTime()) : typeof r == "number" || e === "[object Number]" ? new Date(r) : ((typeof r == "string" || e === "[object String]") && typeof console != "undefined" && (console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"), console.warn(new Error().stack)), /* @__PURE__ */ new Date(NaN));
}
function Tt(r, e) {
  I(2, arguments);
  var t = J(r).getTime(), n = le(e);
  return new Date(t + n);
}
var Mt = {};
function xe() {
  return Mt;
}
function Ot(r) {
  var e = new Date(Date.UTC(r.getFullYear(), r.getMonth(), r.getDate(), r.getHours(), r.getMinutes(), r.getSeconds(), r.getMilliseconds()));
  return e.setUTCFullYear(r.getFullYear()), r.getTime() - e.getTime();
}
function Pt(r) {
  return I(1, arguments), r instanceof Date || we(r) === "object" && Object.prototype.toString.call(r) === "[object Date]";
}
function Dt(r) {
  if (I(1, arguments), !Pt(r) && typeof r != "number")
    return !1;
  var e = J(r);
  return !isNaN(Number(e));
}
function St(r, e) {
  I(2, arguments);
  var t = le(e);
  return Tt(r, -t);
}
var Wt = 864e5;
function Ut(r) {
  I(1, arguments);
  var e = J(r), t = e.getTime();
  e.setUTCMonth(0, 1), e.setUTCHours(0, 0, 0, 0);
  var n = e.getTime(), a = t - n;
  return Math.floor(a / Wt) + 1;
}
function be(r) {
  I(1, arguments);
  var e = 1, t = J(r), n = t.getUTCDay(), a = (n < e ? 7 : 0) + n - e;
  return t.setUTCDate(t.getUTCDate() - a), t.setUTCHours(0, 0, 0, 0), t;
}
function $e(r) {
  I(1, arguments);
  var e = J(r), t = e.getUTCFullYear(), n = /* @__PURE__ */ new Date(0);
  n.setUTCFullYear(t + 1, 0, 4), n.setUTCHours(0, 0, 0, 0);
  var a = be(n), i = /* @__PURE__ */ new Date(0);
  i.setUTCFullYear(t, 0, 4), i.setUTCHours(0, 0, 0, 0);
  var o = be(i);
  return e.getTime() >= a.getTime() ? t + 1 : e.getTime() >= o.getTime() ? t : t - 1;
}
function zt(r) {
  I(1, arguments);
  var e = $e(r), t = /* @__PURE__ */ new Date(0);
  t.setUTCFullYear(e, 0, 4), t.setUTCHours(0, 0, 0, 0);
  var n = be(t);
  return n;
}
var Lt = 6048e5;
function Yt(r) {
  I(1, arguments);
  var e = J(r), t = be(e).getTime() - zt(e).getTime();
  return Math.round(t / Lt) + 1;
}
function _e(r, e) {
  var t, n, a, i, o, s, c, u;
  I(1, arguments);
  var f = xe(), p = le((t = (n = (a = (i = e == null ? void 0 : e.weekStartsOn) !== null && i !== void 0 ? i : e == null || (o = e.locale) === null || o === void 0 || (s = o.options) === null || s === void 0 ? void 0 : s.weekStartsOn) !== null && a !== void 0 ? a : f.weekStartsOn) !== null && n !== void 0 ? n : (c = f.locale) === null || c === void 0 || (u = c.options) === null || u === void 0 ? void 0 : u.weekStartsOn) !== null && t !== void 0 ? t : 0);
  if (!(p >= 0 && p <= 6))
    throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
  var d = J(r), v = d.getUTCDay(), g = (v < p ? 7 : 0) + v - p;
  return d.setUTCDate(d.getUTCDate() - g), d.setUTCHours(0, 0, 0, 0), d;
}
function et(r, e) {
  var t, n, a, i, o, s, c, u;
  I(1, arguments);
  var f = J(r), p = f.getUTCFullYear(), d = xe(), v = le((t = (n = (a = (i = e == null ? void 0 : e.firstWeekContainsDate) !== null && i !== void 0 ? i : e == null || (o = e.locale) === null || o === void 0 || (s = o.options) === null || s === void 0 ? void 0 : s.firstWeekContainsDate) !== null && a !== void 0 ? a : d.firstWeekContainsDate) !== null && n !== void 0 ? n : (c = d.locale) === null || c === void 0 || (u = c.options) === null || u === void 0 ? void 0 : u.firstWeekContainsDate) !== null && t !== void 0 ? t : 1);
  if (!(v >= 1 && v <= 7))
    throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
  var g = /* @__PURE__ */ new Date(0);
  g.setUTCFullYear(p + 1, 0, v), g.setUTCHours(0, 0, 0, 0);
  var b = _e(g, e), _ = /* @__PURE__ */ new Date(0);
  _.setUTCFullYear(p, 0, v), _.setUTCHours(0, 0, 0, 0);
  var O = _e(_, e);
  return f.getTime() >= b.getTime() ? p + 1 : f.getTime() >= O.getTime() ? p : p - 1;
}
function Et(r, e) {
  var t, n, a, i, o, s, c, u;
  I(1, arguments);
  var f = xe(), p = le((t = (n = (a = (i = e == null ? void 0 : e.firstWeekContainsDate) !== null && i !== void 0 ? i : e == null || (o = e.locale) === null || o === void 0 || (s = o.options) === null || s === void 0 ? void 0 : s.firstWeekContainsDate) !== null && a !== void 0 ? a : f.firstWeekContainsDate) !== null && n !== void 0 ? n : (c = f.locale) === null || c === void 0 || (u = c.options) === null || u === void 0 ? void 0 : u.firstWeekContainsDate) !== null && t !== void 0 ? t : 1), d = et(r, e), v = /* @__PURE__ */ new Date(0);
  v.setUTCFullYear(d, 0, p), v.setUTCHours(0, 0, 0, 0);
  var g = _e(v, e);
  return g;
}
var Ft = 6048e5;
function Nt(r, e) {
  I(1, arguments);
  var t = J(r), n = _e(t, e).getTime() - Et(t, e).getTime();
  return Math.round(n / Ft) + 1;
}
function C(r, e) {
  for (var t = r < 0 ? "-" : "", n = Math.abs(r).toString(); n.length < e; )
    n = "0" + n;
  return t + n;
}
var re = {
  // Year
  y: function(e, t) {
    var n = e.getUTCFullYear(), a = n > 0 ? n : 1 - n;
    return C(t === "yy" ? a % 100 : a, t.length);
  },
  // Month
  M: function(e, t) {
    var n = e.getUTCMonth();
    return t === "M" ? String(n + 1) : C(n + 1, 2);
  },
  // Day of the month
  d: function(e, t) {
    return C(e.getUTCDate(), t.length);
  },
  // AM or PM
  a: function(e, t) {
    var n = e.getUTCHours() / 12 >= 1 ? "pm" : "am";
    switch (t) {
      case "a":
      case "aa":
        return n.toUpperCase();
      case "aaa":
        return n;
      case "aaaaa":
        return n[0];
      case "aaaa":
      default:
        return n === "am" ? "a.m." : "p.m.";
    }
  },
  // Hour [1-12]
  h: function(e, t) {
    return C(e.getUTCHours() % 12 || 12, t.length);
  },
  // Hour [0-23]
  H: function(e, t) {
    return C(e.getUTCHours(), t.length);
  },
  // Minute
  m: function(e, t) {
    return C(e.getUTCMinutes(), t.length);
  },
  // Second
  s: function(e, t) {
    return C(e.getUTCSeconds(), t.length);
  },
  // Fraction of second
  S: function(e, t) {
    var n = t.length, a = e.getUTCMilliseconds(), i = Math.floor(a * Math.pow(10, n - 3));
    return C(i, t.length);
  }
}, ce = {
  midnight: "midnight",
  noon: "noon",
  morning: "morning",
  afternoon: "afternoon",
  evening: "evening",
  night: "night"
}, Ht = {
  // Era
  G: function(e, t, n) {
    var a = e.getUTCFullYear() > 0 ? 1 : 0;
    switch (t) {
      case "G":
      case "GG":
      case "GGG":
        return n.era(a, {
          width: "abbreviated"
        });
      case "GGGGG":
        return n.era(a, {
          width: "narrow"
        });
      case "GGGG":
      default:
        return n.era(a, {
          width: "wide"
        });
    }
  },
  // Year
  y: function(e, t, n) {
    if (t === "yo") {
      var a = e.getUTCFullYear(), i = a > 0 ? a : 1 - a;
      return n.ordinalNumber(i, {
        unit: "year"
      });
    }
    return re.y(e, t);
  },
  // Local week-numbering year
  Y: function(e, t, n, a) {
    var i = et(e, a), o = i > 0 ? i : 1 - i;
    if (t === "YY") {
      var s = o % 100;
      return C(s, 2);
    }
    return t === "Yo" ? n.ordinalNumber(o, {
      unit: "year"
    }) : C(o, t.length);
  },
  // ISO week-numbering year
  R: function(e, t) {
    var n = $e(e);
    return C(n, t.length);
  },
  // Extended year. This is a single number designating the year of this calendar system.
  // The main difference between `y` and `u` localizers are B.C. years:
  // | Year | `y` | `u` |
  // |------|-----|-----|
  // | AC 1 |   1 |   1 |
  // | BC 1 |   1 |   0 |
  // | BC 2 |   2 |  -1 |
  // Also `yy` always returns the last two digits of a year,
  // while `uu` pads single digit years to 2 characters and returns other years unchanged.
  u: function(e, t) {
    var n = e.getUTCFullYear();
    return C(n, t.length);
  },
  // Quarter
  Q: function(e, t, n) {
    var a = Math.ceil((e.getUTCMonth() + 1) / 3);
    switch (t) {
      case "Q":
        return String(a);
      case "QQ":
        return C(a, 2);
      case "Qo":
        return n.ordinalNumber(a, {
          unit: "quarter"
        });
      case "QQQ":
        return n.quarter(a, {
          width: "abbreviated",
          context: "formatting"
        });
      case "QQQQQ":
        return n.quarter(a, {
          width: "narrow",
          context: "formatting"
        });
      case "QQQQ":
      default:
        return n.quarter(a, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone quarter
  q: function(e, t, n) {
    var a = Math.ceil((e.getUTCMonth() + 1) / 3);
    switch (t) {
      case "q":
        return String(a);
      case "qq":
        return C(a, 2);
      case "qo":
        return n.ordinalNumber(a, {
          unit: "quarter"
        });
      case "qqq":
        return n.quarter(a, {
          width: "abbreviated",
          context: "standalone"
        });
      case "qqqqq":
        return n.quarter(a, {
          width: "narrow",
          context: "standalone"
        });
      case "qqqq":
      default:
        return n.quarter(a, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // Month
  M: function(e, t, n) {
    var a = e.getUTCMonth();
    switch (t) {
      case "M":
      case "MM":
        return re.M(e, t);
      case "Mo":
        return n.ordinalNumber(a + 1, {
          unit: "month"
        });
      case "MMM":
        return n.month(a, {
          width: "abbreviated",
          context: "formatting"
        });
      case "MMMMM":
        return n.month(a, {
          width: "narrow",
          context: "formatting"
        });
      case "MMMM":
      default:
        return n.month(a, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone month
  L: function(e, t, n) {
    var a = e.getUTCMonth();
    switch (t) {
      case "L":
        return String(a + 1);
      case "LL":
        return C(a + 1, 2);
      case "Lo":
        return n.ordinalNumber(a + 1, {
          unit: "month"
        });
      case "LLL":
        return n.month(a, {
          width: "abbreviated",
          context: "standalone"
        });
      case "LLLLL":
        return n.month(a, {
          width: "narrow",
          context: "standalone"
        });
      case "LLLL":
      default:
        return n.month(a, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // Local week of year
  w: function(e, t, n, a) {
    var i = Nt(e, a);
    return t === "wo" ? n.ordinalNumber(i, {
      unit: "week"
    }) : C(i, t.length);
  },
  // ISO week of year
  I: function(e, t, n) {
    var a = Yt(e);
    return t === "Io" ? n.ordinalNumber(a, {
      unit: "week"
    }) : C(a, t.length);
  },
  // Day of the month
  d: function(e, t, n) {
    return t === "do" ? n.ordinalNumber(e.getUTCDate(), {
      unit: "date"
    }) : re.d(e, t);
  },
  // Day of year
  D: function(e, t, n) {
    var a = Ut(e);
    return t === "Do" ? n.ordinalNumber(a, {
      unit: "dayOfYear"
    }) : C(a, t.length);
  },
  // Day of week
  E: function(e, t, n) {
    var a = e.getUTCDay();
    switch (t) {
      case "E":
      case "EE":
      case "EEE":
        return n.day(a, {
          width: "abbreviated",
          context: "formatting"
        });
      case "EEEEE":
        return n.day(a, {
          width: "narrow",
          context: "formatting"
        });
      case "EEEEEE":
        return n.day(a, {
          width: "short",
          context: "formatting"
        });
      case "EEEE":
      default:
        return n.day(a, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Local day of week
  e: function(e, t, n, a) {
    var i = e.getUTCDay(), o = (i - a.weekStartsOn + 8) % 7 || 7;
    switch (t) {
      case "e":
        return String(o);
      case "ee":
        return C(o, 2);
      case "eo":
        return n.ordinalNumber(o, {
          unit: "day"
        });
      case "eee":
        return n.day(i, {
          width: "abbreviated",
          context: "formatting"
        });
      case "eeeee":
        return n.day(i, {
          width: "narrow",
          context: "formatting"
        });
      case "eeeeee":
        return n.day(i, {
          width: "short",
          context: "formatting"
        });
      case "eeee":
      default:
        return n.day(i, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone local day of week
  c: function(e, t, n, a) {
    var i = e.getUTCDay(), o = (i - a.weekStartsOn + 8) % 7 || 7;
    switch (t) {
      case "c":
        return String(o);
      case "cc":
        return C(o, t.length);
      case "co":
        return n.ordinalNumber(o, {
          unit: "day"
        });
      case "ccc":
        return n.day(i, {
          width: "abbreviated",
          context: "standalone"
        });
      case "ccccc":
        return n.day(i, {
          width: "narrow",
          context: "standalone"
        });
      case "cccccc":
        return n.day(i, {
          width: "short",
          context: "standalone"
        });
      case "cccc":
      default:
        return n.day(i, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // ISO day of week
  i: function(e, t, n) {
    var a = e.getUTCDay(), i = a === 0 ? 7 : a;
    switch (t) {
      case "i":
        return String(i);
      case "ii":
        return C(i, t.length);
      case "io":
        return n.ordinalNumber(i, {
          unit: "day"
        });
      case "iii":
        return n.day(a, {
          width: "abbreviated",
          context: "formatting"
        });
      case "iiiii":
        return n.day(a, {
          width: "narrow",
          context: "formatting"
        });
      case "iiiiii":
        return n.day(a, {
          width: "short",
          context: "formatting"
        });
      case "iiii":
      default:
        return n.day(a, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM or PM
  a: function(e, t, n) {
    var a = e.getUTCHours(), i = a / 12 >= 1 ? "pm" : "am";
    switch (t) {
      case "a":
      case "aa":
        return n.dayPeriod(i, {
          width: "abbreviated",
          context: "formatting"
        });
      case "aaa":
        return n.dayPeriod(i, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "aaaaa":
        return n.dayPeriod(i, {
          width: "narrow",
          context: "formatting"
        });
      case "aaaa":
      default:
        return n.dayPeriod(i, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM, PM, midnight, noon
  b: function(e, t, n) {
    var a = e.getUTCHours(), i;
    switch (a === 12 ? i = ce.noon : a === 0 ? i = ce.midnight : i = a / 12 >= 1 ? "pm" : "am", t) {
      case "b":
      case "bb":
        return n.dayPeriod(i, {
          width: "abbreviated",
          context: "formatting"
        });
      case "bbb":
        return n.dayPeriod(i, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "bbbbb":
        return n.dayPeriod(i, {
          width: "narrow",
          context: "formatting"
        });
      case "bbbb":
      default:
        return n.dayPeriod(i, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // in the morning, in the afternoon, in the evening, at night
  B: function(e, t, n) {
    var a = e.getUTCHours(), i;
    switch (a >= 17 ? i = ce.evening : a >= 12 ? i = ce.afternoon : a >= 4 ? i = ce.morning : i = ce.night, t) {
      case "B":
      case "BB":
      case "BBB":
        return n.dayPeriod(i, {
          width: "abbreviated",
          context: "formatting"
        });
      case "BBBBB":
        return n.dayPeriod(i, {
          width: "narrow",
          context: "formatting"
        });
      case "BBBB":
      default:
        return n.dayPeriod(i, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Hour [1-12]
  h: function(e, t, n) {
    if (t === "ho") {
      var a = e.getUTCHours() % 12;
      return a === 0 && (a = 12), n.ordinalNumber(a, {
        unit: "hour"
      });
    }
    return re.h(e, t);
  },
  // Hour [0-23]
  H: function(e, t, n) {
    return t === "Ho" ? n.ordinalNumber(e.getUTCHours(), {
      unit: "hour"
    }) : re.H(e, t);
  },
  // Hour [0-11]
  K: function(e, t, n) {
    var a = e.getUTCHours() % 12;
    return t === "Ko" ? n.ordinalNumber(a, {
      unit: "hour"
    }) : C(a, t.length);
  },
  // Hour [1-24]
  k: function(e, t, n) {
    var a = e.getUTCHours();
    return a === 0 && (a = 24), t === "ko" ? n.ordinalNumber(a, {
      unit: "hour"
    }) : C(a, t.length);
  },
  // Minute
  m: function(e, t, n) {
    return t === "mo" ? n.ordinalNumber(e.getUTCMinutes(), {
      unit: "minute"
    }) : re.m(e, t);
  },
  // Second
  s: function(e, t, n) {
    return t === "so" ? n.ordinalNumber(e.getUTCSeconds(), {
      unit: "second"
    }) : re.s(e, t);
  },
  // Fraction of second
  S: function(e, t) {
    return re.S(e, t);
  },
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
  X: function(e, t, n, a) {
    var i = a._originalDate || e, o = i.getTimezoneOffset();
    if (o === 0)
      return "Z";
    switch (t) {
      case "X":
        return He(o);
      case "XXXX":
      case "XX":
        return ae(o);
      case "XXXXX":
      case "XXX":
      default:
        return ae(o, ":");
    }
  },
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
  x: function(e, t, n, a) {
    var i = a._originalDate || e, o = i.getTimezoneOffset();
    switch (t) {
      case "x":
        return He(o);
      case "xxxx":
      case "xx":
        return ae(o);
      case "xxxxx":
      case "xxx":
      default:
        return ae(o, ":");
    }
  },
  // Timezone (GMT)
  O: function(e, t, n, a) {
    var i = a._originalDate || e, o = i.getTimezoneOffset();
    switch (t) {
      case "O":
      case "OO":
      case "OOO":
        return "GMT" + Ne(o, ":");
      case "OOOO":
      default:
        return "GMT" + ae(o, ":");
    }
  },
  // Timezone (specific non-location)
  z: function(e, t, n, a) {
    var i = a._originalDate || e, o = i.getTimezoneOffset();
    switch (t) {
      case "z":
      case "zz":
      case "zzz":
        return "GMT" + Ne(o, ":");
      case "zzzz":
      default:
        return "GMT" + ae(o, ":");
    }
  },
  // Seconds timestamp
  t: function(e, t, n, a) {
    var i = a._originalDate || e, o = Math.floor(i.getTime() / 1e3);
    return C(o, t.length);
  },
  // Milliseconds timestamp
  T: function(e, t, n, a) {
    var i = a._originalDate || e, o = i.getTime();
    return C(o, t.length);
  }
};
function Ne(r, e) {
  var t = r > 0 ? "-" : "+", n = Math.abs(r), a = Math.floor(n / 60), i = n % 60;
  if (i === 0)
    return t + String(a);
  var o = e;
  return t + String(a) + o + C(i, 2);
}
function He(r, e) {
  if (r % 60 === 0) {
    var t = r > 0 ? "-" : "+";
    return t + C(Math.abs(r) / 60, 2);
  }
  return ae(r, e);
}
function ae(r, e) {
  var t = e || "", n = r > 0 ? "-" : "+", a = Math.abs(r), i = C(Math.floor(a / 60), 2), o = C(a % 60, 2);
  return n + i + t + o;
}
var qe = function(e, t) {
  switch (e) {
    case "P":
      return t.date({
        width: "short"
      });
    case "PP":
      return t.date({
        width: "medium"
      });
    case "PPP":
      return t.date({
        width: "long"
      });
    case "PPPP":
    default:
      return t.date({
        width: "full"
      });
  }
}, tt = function(e, t) {
  switch (e) {
    case "p":
      return t.time({
        width: "short"
      });
    case "pp":
      return t.time({
        width: "medium"
      });
    case "ppp":
      return t.time({
        width: "long"
      });
    case "pppp":
    default:
      return t.time({
        width: "full"
      });
  }
}, qt = function(e, t) {
  var n = e.match(/(P+)(p+)?/) || [], a = n[1], i = n[2];
  if (!i)
    return qe(e, t);
  var o;
  switch (a) {
    case "P":
      o = t.dateTime({
        width: "short"
      });
      break;
    case "PP":
      o = t.dateTime({
        width: "medium"
      });
      break;
    case "PPP":
      o = t.dateTime({
        width: "long"
      });
      break;
    case "PPPP":
    default:
      o = t.dateTime({
        width: "full"
      });
      break;
  }
  return o.replace("{{date}}", qe(a, t)).replace("{{time}}", tt(i, t));
}, Rt = {
  p: tt,
  P: qt
}, jt = ["D", "DD"], Bt = ["YY", "YYYY"];
function It(r) {
  return jt.indexOf(r) !== -1;
}
function At(r) {
  return Bt.indexOf(r) !== -1;
}
function Re(r, e, t) {
  if (r === "YYYY")
    throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e, "`) for formatting years to the input `").concat(t, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
  if (r === "YY")
    throw new RangeError("Use `yy` instead of `YY` (in `".concat(e, "`) for formatting years to the input `").concat(t, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
  if (r === "D")
    throw new RangeError("Use `d` instead of `D` (in `".concat(e, "`) for formatting days of the month to the input `").concat(t, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
  if (r === "DD")
    throw new RangeError("Use `dd` instead of `DD` (in `".concat(e, "`) for formatting days of the month to the input `").concat(t, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
}
var Gt = {
  lessThanXSeconds: {
    one: "less than a second",
    other: "less than {{count}} seconds"
  },
  xSeconds: {
    one: "1 second",
    other: "{{count}} seconds"
  },
  halfAMinute: "half a minute",
  lessThanXMinutes: {
    one: "less than a minute",
    other: "less than {{count}} minutes"
  },
  xMinutes: {
    one: "1 minute",
    other: "{{count}} minutes"
  },
  aboutXHours: {
    one: "about 1 hour",
    other: "about {{count}} hours"
  },
  xHours: {
    one: "1 hour",
    other: "{{count}} hours"
  },
  xDays: {
    one: "1 day",
    other: "{{count}} days"
  },
  aboutXWeeks: {
    one: "about 1 week",
    other: "about {{count}} weeks"
  },
  xWeeks: {
    one: "1 week",
    other: "{{count}} weeks"
  },
  aboutXMonths: {
    one: "about 1 month",
    other: "about {{count}} months"
  },
  xMonths: {
    one: "1 month",
    other: "{{count}} months"
  },
  aboutXYears: {
    one: "about 1 year",
    other: "about {{count}} years"
  },
  xYears: {
    one: "1 year",
    other: "{{count}} years"
  },
  overXYears: {
    one: "over 1 year",
    other: "over {{count}} years"
  },
  almostXYears: {
    one: "almost 1 year",
    other: "almost {{count}} years"
  }
}, Qt = function(e, t, n) {
  var a, i = Gt[e];
  return typeof i == "string" ? a = i : t === 1 ? a = i.one : a = i.other.replace("{{count}}", t.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + a : a + " ago" : a;
};
function Ce(r) {
  return function() {
    var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.width ? String(e.width) : r.defaultWidth, n = r.formats[t] || r.formats[r.defaultWidth];
    return n;
  };
}
var Xt = {
  full: "EEEE, MMMM do, y",
  long: "MMMM do, y",
  medium: "MMM d, y",
  short: "MM/dd/yyyy"
}, Vt = {
  full: "h:mm:ss a zzzz",
  long: "h:mm:ss a z",
  medium: "h:mm:ss a",
  short: "h:mm a"
}, Zt = {
  full: "{{date}} 'at' {{time}}",
  long: "{{date}} 'at' {{time}}",
  medium: "{{date}}, {{time}}",
  short: "{{date}}, {{time}}"
}, Jt = {
  date: Ce({
    formats: Xt,
    defaultWidth: "full"
  }),
  time: Ce({
    formats: Vt,
    defaultWidth: "full"
  }),
  dateTime: Ce({
    formats: Zt,
    defaultWidth: "full"
  })
}, Kt = {
  lastWeek: "'last' eeee 'at' p",
  yesterday: "'yesterday at' p",
  today: "'today at' p",
  tomorrow: "'tomorrow at' p",
  nextWeek: "eeee 'at' p",
  other: "P"
}, $t = function(e, t, n, a) {
  return Kt[e];
};
function he(r) {
  return function(e, t) {
    var n = t != null && t.context ? String(t.context) : "standalone", a;
    if (n === "formatting" && r.formattingValues) {
      var i = r.defaultFormattingWidth || r.defaultWidth, o = t != null && t.width ? String(t.width) : i;
      a = r.formattingValues[o] || r.formattingValues[i];
    } else {
      var s = r.defaultWidth, c = t != null && t.width ? String(t.width) : r.defaultWidth;
      a = r.values[c] || r.values[s];
    }
    var u = r.argumentCallback ? r.argumentCallback(e) : e;
    return a[u];
  };
}
var er = {
  narrow: ["B", "A"],
  abbreviated: ["BC", "AD"],
  wide: ["Before Christ", "Anno Domini"]
}, tr = {
  narrow: ["1", "2", "3", "4"],
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
  wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
}, rr = {
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
  abbreviated: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
  wide: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
}, nr = {
  narrow: ["S", "M", "T", "W", "T", "F", "S"],
  short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
  abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
  wide: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
}, ar = {
  narrow: {
    am: "a",
    pm: "p",
    midnight: "mi",
    noon: "n",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  },
  abbreviated: {
    am: "AM",
    pm: "PM",
    midnight: "midnight",
    noon: "noon",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  },
  wide: {
    am: "a.m.",
    pm: "p.m.",
    midnight: "midnight",
    noon: "noon",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  }
}, ir = {
  narrow: {
    am: "a",
    pm: "p",
    midnight: "mi",
    noon: "n",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  },
  abbreviated: {
    am: "AM",
    pm: "PM",
    midnight: "midnight",
    noon: "noon",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  },
  wide: {
    am: "a.m.",
    pm: "p.m.",
    midnight: "midnight",
    noon: "noon",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  }
}, or = function(e, t) {
  var n = Number(e), a = n % 100;
  if (a > 20 || a < 10)
    switch (a % 10) {
      case 1:
        return n + "st";
      case 2:
        return n + "nd";
      case 3:
        return n + "rd";
    }
  return n + "th";
}, sr = {
  ordinalNumber: or,
  era: he({
    values: er,
    defaultWidth: "wide"
  }),
  quarter: he({
    values: tr,
    defaultWidth: "wide",
    argumentCallback: function(e) {
      return e - 1;
    }
  }),
  month: he({
    values: rr,
    defaultWidth: "wide"
  }),
  day: he({
    values: nr,
    defaultWidth: "wide"
  }),
  dayPeriod: he({
    values: ar,
    defaultWidth: "wide",
    formattingValues: ir,
    defaultFormattingWidth: "wide"
  })
};
function ge(r) {
  return function(e) {
    var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.width, a = n && r.matchPatterns[n] || r.matchPatterns[r.defaultMatchWidth], i = e.match(a);
    if (!i)
      return null;
    var o = i[0], s = n && r.parsePatterns[n] || r.parsePatterns[r.defaultParseWidth], c = Array.isArray(s) ? ur(s, function(p) {
      return p.test(o);
    }) : lr(s, function(p) {
      return p.test(o);
    }), u;
    u = r.valueCallback ? r.valueCallback(c) : c, u = t.valueCallback ? t.valueCallback(u) : u;
    var f = e.slice(o.length);
    return {
      value: u,
      rest: f
    };
  };
}
function lr(r, e) {
  for (var t in r)
    if (r.hasOwnProperty(t) && e(r[t]))
      return t;
}
function ur(r, e) {
  for (var t = 0; t < r.length; t++)
    if (e(r[t]))
      return t;
}
function cr(r) {
  return function(e) {
    var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = e.match(r.matchPattern);
    if (!n)
      return null;
    var a = n[0], i = e.match(r.parsePattern);
    if (!i)
      return null;
    var o = r.valueCallback ? r.valueCallback(i[0]) : i[0];
    o = t.valueCallback ? t.valueCallback(o) : o;
    var s = e.slice(a.length);
    return {
      value: o,
      rest: s
    };
  };
}
var dr = /^(\d+)(th|st|nd|rd)?/i, fr = /\d+/i, mr = {
  narrow: /^(b|a)/i,
  abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
  wide: /^(before christ|before common era|anno domini|common era)/i
}, hr = {
  any: [/^b/i, /^(a|c)/i]
}, gr = {
  narrow: /^[1234]/i,
  abbreviated: /^q[1234]/i,
  wide: /^[1234](th|st|nd|rd)? quarter/i
}, pr = {
  any: [/1/i, /2/i, /3/i, /4/i]
}, vr = {
  narrow: /^[jfmasond]/i,
  abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
  wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
}, wr = {
  narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
  any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
}, br = {
  narrow: /^[smtwf]/i,
  short: /^(su|mo|tu|we|th|fr|sa)/i,
  abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
  wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
}, _r = {
  narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
  any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
}, yr = {
  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
  any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
}, xr = {
  any: {
    am: /^a/i,
    pm: /^p/i,
    midnight: /^mi/i,
    noon: /^no/i,
    morning: /morning/i,
    afternoon: /afternoon/i,
    evening: /evening/i,
    night: /night/i
  }
}, kr = {
  ordinalNumber: cr({
    matchPattern: dr,
    parsePattern: fr,
    valueCallback: function(e) {
      return parseInt(e, 10);
    }
  }),
  era: ge({
    matchPatterns: mr,
    defaultMatchWidth: "wide",
    parsePatterns: hr,
    defaultParseWidth: "any"
  }),
  quarter: ge({
    matchPatterns: gr,
    defaultMatchWidth: "wide",
    parsePatterns: pr,
    defaultParseWidth: "any",
    valueCallback: function(e) {
      return e + 1;
    }
  }),
  month: ge({
    matchPatterns: vr,
    defaultMatchWidth: "wide",
    parsePatterns: wr,
    defaultParseWidth: "any"
  }),
  day: ge({
    matchPatterns: br,
    defaultMatchWidth: "wide",
    parsePatterns: _r,
    defaultParseWidth: "any"
  }),
  dayPeriod: ge({
    matchPatterns: yr,
    defaultMatchWidth: "any",
    parsePatterns: xr,
    defaultParseWidth: "any"
  })
}, Cr = {
  code: "en-US",
  formatDistance: Qt,
  formatLong: Jt,
  formatRelative: $t,
  localize: sr,
  match: kr,
  options: {
    weekStartsOn: 0,
    firstWeekContainsDate: 1
  }
}, Tr = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Mr = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Or = /^'([^]*?)'?$/, Pr = /''/g, Dr = /[a-zA-Z]/;
function Sr(r, e, t) {
  var n, a, i, o, s, c, u, f, p, d, v, g, b, _;
  I(2, arguments);
  var O = String(e), x = xe(), k = (n = (a = void 0) !== null && a !== void 0 ? a : x.locale) !== null && n !== void 0 ? n : Cr, z = le((i = (o = (s = (c = void 0) !== null && c !== void 0 ? c : void 0) !== null && s !== void 0 ? s : x.firstWeekContainsDate) !== null && o !== void 0 ? o : (u = x.locale) === null || u === void 0 || (f = u.options) === null || f === void 0 ? void 0 : f.firstWeekContainsDate) !== null && i !== void 0 ? i : 1);
  if (!(z >= 1 && z <= 7))
    throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
  var H = le((p = (d = (v = (g = void 0) !== null && g !== void 0 ? g : void 0) !== null && v !== void 0 ? v : x.weekStartsOn) !== null && d !== void 0 ? d : (b = x.locale) === null || b === void 0 || (_ = b.options) === null || _ === void 0 ? void 0 : _.weekStartsOn) !== null && p !== void 0 ? p : 0);
  if (!(H >= 0 && H <= 6))
    throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
  if (!k.localize)
    throw new RangeError("locale must contain localize property");
  if (!k.formatLong)
    throw new RangeError("locale must contain formatLong property");
  var A = J(r);
  if (!Dt(A))
    throw new RangeError("Invalid time value");
  var q = Ot(A), X = St(A, q), G = {
    firstWeekContainsDate: z,
    weekStartsOn: H,
    locale: k,
    _originalDate: A
  }, Q = O.match(Mr).map(function(D) {
    var R = D[0];
    if (R === "p" || R === "P") {
      var P = Rt[R];
      return P(D, k.formatLong);
    }
    return D;
  }).join("").match(Tr).map(function(D) {
    if (D === "''")
      return "'";
    var R = D[0];
    if (R === "'")
      return Wr(D);
    var P = Ht[R];
    if (P)
      return At(D) && Re(D, e, String(r)), It(D) && Re(D, e, String(r)), P(X, D, k.localize, G);
    if (R.match(Dr))
      throw new RangeError("Format string contains an unescaped latin alphabet character `" + R + "`");
    return D;
  }).join("");
  return Q;
}
function Wr(r) {
  var e = r.match(Or);
  return e ? e[1].replace(Pr, "'") : r;
}
var oe = /* @__PURE__ */ ((r) => (r.lotteries = "lotteries", r.outcome = "outcome", r.history = "history", r.draw = "draw", r))(oe || {}), ie = /* @__PURE__ */ ((r) => (r.en = "en", r.default = "*", r))(ie || {});
const Ur = (r) => V(void 0, null, function* () {
  const { path: e, params: t = {}, options: n = {} } = r, a = new URL(e);
  return Object.keys(t).map((i) => {
    a.searchParams.append(i, t[i]);
  }), yield zr(a, n);
}), zr = (t, ...n) => V(void 0, [t, ...n], function* (r, e = {}) {
  try {
    const i = yield (yield fetch(r, e)).text();
    return JSON.parse(i);
  } catch (a) {
    return a.message;
  }
}), Te = (r, e, t) => V(void 0, null, function* () {
  const { session: n } = t, a = {
    headers: ke({
      "Content-Type": "application/json",
      accept: "text/plain"
    }, n ? { "x-SessionId": n } : {})
  }, o = {
    [oe.lotteries]: () => ({
      path: "/wof/lotteries",
      params: {
        filter: "Types[]=mysteryChest"
      },
      options: a
    }),
    [oe.history]: () => ({
      path: "/wof/lotteryHistory",
      options: a
    }),
    [oe.outcome]: () => {
      const { id: s } = t;
      return {
        path: `/wof/outcome/${s}`,
        params: {
          filter: "Types[]=mysteryChest"
        },
        options: a
      };
    }
  }[r]();
  return o.path = e + "/v1" + o.path, yield Ur(o);
}), Me = {
  lotteries: (r, e) => V(void 0, null, function* () {
    const t = yield Te(oe.lotteries, r, { session: e });
    return (t == null ? void 0 : t.items) || [];
  }),
  outcome: (r, e, t) => V(void 0, null, function* () {
    return yield Te(oe.outcome, r, { session: e, id: t });
  }),
  history: (r, e) => V(void 0, null, function* () {
    return yield Te(oe.history, r, { session: e });
  })
}, Lr = (r) => {
  var e;
  return +((e = r == null ? void 0 : r.current) == null ? void 0 : e.remainingTimes) > 0;
};
function je(r, e) {
  bt(r, e);
}
function Yr(r) {
  _t.set(r);
}
const Be = {
  en: {
    infoTooltip: "Open Mystery Chest and find your reward!",
    play: "Play",
    history: "History",
    rules: "Rules",
    noChestYet: "There are no available Chests",
    noHistoryYet: "There is no history yet",
    more: "More",
    rulesDescription: "Mystery Chest is a particularly interesting game, will bring you a lot of surprises; When you obtained the Mystery Chest, means you got a key to open the Chest, and if you are lucky, you can get the surprise prize.",
    terms: "Terms&Conditions link",
    prizeAgenda: "Prize agenda",
    tournamentTicket: "Tournament ticket",
    freeSpins: "Free spins",
    bonusMoney: "Bonus Money",
    loyaltyPoints: "Loyalty Points&Coins",
    luckyWheel: "LuckyWheel",
    mysteryChest: "Mystery Chest",
    customRewards: "Custom Rewards"
  }
};
function Er(r) {
  mt(r, "svelte-1h28m9c", `.mobile.drawer{width:100%;height:100%;border-top-left-radius:28px;border-top-right-radius:28px;padding:20px 28px}.mobile.drawer .Skeleton.Text{width:var(--emw-skeleton-text-width-100, 135px)}.mobile .tooltip-backdrop{padding:60px 20px 0;border-top-left-radius:28px;border-top-right-radius:28px}.mobile .tooltip-backdrop .tooltip{padding:20px;font-size:var(--emw--font-size-x-small, 12px)}.mobile .icon-button{width:24px;height:24px}.mobile .chests-header__title{font-size:var(--emw--font-size-medium, 16px);font-weight:var(--emw--font-weight-medium, 500);line-height:14px}.mobile .chests-tabs{margin:20px 0}.mobile .chests-tabs__container{border-bottom:1px solid var(--emw--color-secondary, #729787)}.mobile .chests-tabs__tab{font-size:var(--emw--font-size-x-small, 12px);line-height:15px}.mobile .chests-tabs__tab.active{border-bottom:1px solid}.mobile .chests-list{gap:16px}.mobile .chests-list__item{font-weight:var(--emw--font-weight-normal, 400);padding:20px;font-size:var(--emw--font-size-x-small, 12px);line-height:15px;border-radius:16px;height:56px}.mobile .chests-list__item__keys{gap:5px;font-size:var(--emw--font-size-medium, 16px)}.mobile .chests-rules{gap:24px}.mobile .chests-rules__description{font-size:var(--emw--font-size-x-small, 12px);line-height:24px}.mobile .chests-rules__terms{font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-x-small, 12px)}.mobile .chests-rules__prize-title{font-size:var(--emw--font-size-x-small, 12px);line-height:24px}.mobile .chests-rules__list{padding-inline-start:15px;margin:5px 0 0}.mobile .chests-rules__list__item{margin-bottom:5px;font-size:var(--emw--font-size-x-small, 12px);line-height:24px}.mobile .chests-empty{margin-top:50px;font-size:var(--emw--font-size-x-small, 12px)}.mobile .chests-history__title{font-size:var(--emw--font-size-x-small, 12px);line-height:14px;margin-bottom:12px}.mobile .chests-history__list{margin-bottom:32px}.mobile .chests-history__list__item{font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-x-small, 12px);line-height:14px;margin-bottom:12px}.mobile .chests-history__list__item .name img{width:14px;height:14px}.mobile .chests-loader{border-radius:var(--emw--border-radius-large, 16px);padding:20px;line-height:15px}.drawer{position:fixed;left:50%;transform:translateX(-50%);background:linear-gradient(180deg, var(--emw--color-background, #213841) 0%, var(--emw--color-background-secondary, #0c1a1c) 100%);box-sizing:border-box;z-index:100;bottom:0;width:60%;height:90%;border-top-left-radius:72px;border-top-right-radius:72px;padding:40px 80px}@container (max-width: 1300px){.drawer{padding:20px 40px}}@container (max-width: 992px){.drawer{width:70%}}@container (max-width: 768px){.drawer{width:80%}}@container (max-width: 576px){.drawer{width:90%}}.drawer .Skeleton{border-radius:var(--emw--border-radius-small, 12px);--emw-skeleton-primary-color:var(--emw--color-primary, #d9d9d9);--emw-skeleton-secondary-color:var(--emw--color-secondary, #999999)}.drawer .Skeleton.Text{width:var(--emw-skeleton-text-width-100, 155px)}.overlay{border:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:var(--emw--color-gray-transparency-20, rgba(21, 43, 48, 0.5019607843));z-index:0;bottom:0;opacity:1;transition:opacity 0.5s ease-in-out}.icon-button{width:30px;height:30px;border:0px;cursor:pointer}.icon-button.help{background:center/100% url('data:image/svg+xml,<svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M11.708 4.583a7.125 7.125 0 1 0 0 14.25 7.125 7.125 0 0 0 0-14.25ZM3 11.708a8.708 8.708 0 1 1 17.417 0 8.708 8.708 0 0 1-17.417 0Zm8.913-3.147a1.583 1.583 0 0 0-1.762 1.035.792.792 0 0 1-1.493-.525 3.167 3.167 0 0 1 6.154 1.055c0 1.211-.899 2.011-1.54 2.439a6.37 6.37 0 0 1-1.335.672l-.028.01-.008.002-.003.001h-.002l-.251-.75.25.751a.792.792 0 0 1-.5-1.502l.011-.004.06-.022a4.778 4.778 0 0 0 .928-.476c.545-.363.834-.75.834-1.122v-.001a1.583 1.583 0 0 0-1.315-1.563Zm-.996 7.106c0-.438.354-.792.791-.792h.008a.792.792 0 1 1 0 1.583h-.008a.792.792 0 0 1-.791-.791Z" fill="%23729787"/></svg>') no-repeat}.icon-button.close{background:center/100% url('data:image/svg+xml,<svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18 6 6 18M6 6l12 12" stroke="%23729787" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat}.tooltip-backdrop{box-sizing:border-box;z-index:200;position:absolute;width:100%;height:100%;inset:0;background-color:rgba(0, 0, 0, 0.5);padding:90px 30px 0;border-top-left-radius:72px;border-top-right-radius:72px}.tooltip-backdrop .tooltip{border:1px solid var(--emw--button-border-color, #75ffe9);background:var(--emw--color-background, #213841);border-radius:var(--emw--border-radius-large, 8px);line-height:24px;color:var(--emw--color-secondary, #bbb9c3);position:relative;padding:32px;font-size:var(--emw--font-size-medium, 16px)}.tooltip-backdrop .tooltip .icon-button{top:12px;right:12px;position:absolute}.chests-header{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.chests-header__title{color:var(--emw--color-primary, #d3ffed);font-size:var(--emw--font-size-large, 22px);font-weight:var(--emw--font-weight-bold, 700);line-height:25px}.chests-tabs{margin:28px 0}.chests-tabs__container{display:flex;position:relative;border-bottom:2px solid var(--emw--color-secondary, #729787)}.chests-tabs__tab{padding:8px 10px;font-weight:var(--emw--font-weight-bold, 700);color:var(--emw--color-gray-300, #729787);cursor:pointer;flex-grow:1;text-align:center;background:transparent;border:none;font-size:var(--emw--font-size-medium, 16px);line-height:18px}.chests-tabs__tab.active{color:var(--emw--color-typography, #fff);border-image-source:linear-gradient(90deg, var(--emw--button-border-color, #75ffe9) 0%, var(--emw--button-border-color-secondary, #b2ff6d) 100%);border-image-slice:1;margin-bottom:-2px;border-bottom:2px solid}@media screen and (max-width: 1300px){.chests-tabs{margin:15px 0 28px}}.chests-list{max-height:85%;overflow:auto;gap:24px;display:flex;flex-wrap:wrap}.chests-list__item{font-weight:var(--emw--font-weight-bold, 700);font-size:var(--emw--font-size-large, 22px);line-height:25px;padding:35px 48px;border-radius:28px;color:var(--emw--color-primary, #d3ffed);width:100%;display:flex;justify-content:space-between;align-items:center;box-sizing:border-box;background:var(--emw--color-background-secondary, #233e42);border:1px solid var(--emw--button-border-color-secondary, #244346);cursor:pointer}.chests-list__item__keys{display:flex;align-items:center;font-weight:var(--emw--font-weight-bold, 700);background:linear-gradient(90deg, var(--emw--button-border-color, #75ffe9) 0%, var(--emw--button-border-color-secondary, #b2ff6d) 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;font-size:var(--emw--font-size-large, 22px);gap:7px}@media screen and (max-width: 992px){.chests-list__item{font-size:var(--emw--font-size-medium, 16px);padding:20px 24px}.chests-list__item__keys{font-size:var(--emw--font-size-medium, 16px)}}@media screen and (max-width: 1300px){.chests-list{gap:20px}.chests-list__item{padding:25px 24px}}.chests-rules{display:flex;flex-flow:column;gap:40px;color:var(--emw--color-primary-variant, #a9ccbe)}.chests-rules__description{font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-medium, 16px);line-height:32px}.chests-rules__terms{display:flex;gap:5px;font-weight:var(--emw--font-weight-semibold, 500);font-size:var(--emw--font-size-medium, 16px);border:none;padding:0;cursor:pointer;background:linear-gradient(90deg, var(--emw--button-border-color, #75ffe9) 0%, var(--emw--button-border-color-secondary, #b2ff6d) 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.chests-rules__terms .arrow-icon{width:14px;height:14px;background:center/100% url('data:image/svg+xml,<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M4.41 7.744a.833.833 0 0 0 0 1.179l5 5a.833.833 0 0 0 1.18 0l5-5a.833.833 0 1 0-1.18-1.179L10 12.154l-4.41-4.41a.833.833 0 0 0-1.18 0Z" fill="url(%23a)"/><defs><linearGradient id="a" x1="10" y1="7.5" x2="10" y2="14.167" gradientUnits="userSpaceOnUse"><stop stop-color="%2375FFE9"/><stop offset="1" stop-color="%23B2FF6D"/></linearGradient></defs></svg>') no-repeat}.chests-rules__prize-title{color:#ffffff;font-weight:var(--emw--font-weight-bold, 700);font-size:var(--emw--font-size-medium, 16px);line-height:18px}.chests-rules__list{padding-inline-start:25px;margin:15px 0 0}.chests-rules__list__item{font-weight:var(--emw--font-weight-normal, 400);margin-bottom:12px;font-size:var(--emw--font-size-medium, 16px);line-height:32px}.chests-empty{text-align:center;color:var(--emw--color-primary-variant, #a9ccbe);font-weight:var(--emw--font-weight-normal, 400);line-height:24px;margin-top:75px;font-size:var(--emw--font-size-medium, 16px)}.chests-history__title{font-weight:var(--emw--font-weight-bold, 700);color:#ffffff;font-size:var(--emw--font-size-medium, 16px);line-height:18px;margin-bottom:16px}.chests-history__wrap{max-height:85%;overflow:auto;padding-right:10px;padding-bottom:50px}.chests-history__more{border:none;display:flex;gap:4px;padding:0;background:linear-gradient(90deg, var(--emw--button-border-color, #75ffe9) 0%, var(--emw--button-border-color-secondary, #b2ff6d) 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;cursor:pointer;font-weight:var(--emw--font-weight-medium, 500);font-size:var(--emw--font-size-medium, 16px);line-height:18px}.chests-history__list{margin-bottom:40px;overflow:auto;max-height:215px}.chests-history__list__item{display:flex;color:var(--emw--color-primary-variant, #a9ccbe);font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-medium, 16px);line-height:16px;margin-bottom:16px}.chests-history__list__item .index{margin-right:20px}.chests-history__list__item .name{flex-grow:1;margin:0;display:flex;gap:6px}.chests-history__list__item .name img{width:18px;height:18px}.chests-loader{border-radius:var(--emw--border-radius-large, 28px);display:flex;padding:45px 48px;background:var(--emw--color-background-secondary, #233e42);border:1px solid var(--emw--button-border-color-secondary, #244346);justify-content:space-between;line-height:35px;overflow:hidden;margin-bottom:24px}.chests-history-loader{display:flex;flex-direction:column;gap:16px;margin-bottom:32px}.chests-history-loader-body{display:flex;justify-content:space-between}.chests-history-loader-left{display:flex}.chests-history-dot .Skeleton{border-radius:var(--emw--border-radius-large, 50%);margin-right:10px}.chests-history-text .Skeleton{margin-right:20px}::-webkit-scrollbar{width:4px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--emw--color-gray-105, #1b2e31)}::-webkit-scrollbar-thumb:hover{background:var(--emw--color-gray-290, #284044)}`);
}
function Ie(r, e, t) {
  const n = r.slice();
  return n[43] = e[t], n;
}
function Ae(r, e, t) {
  const n = r.slice();
  return n[46] = e[t], n[48] = t, n;
}
function Ge(r, e, t) {
  const n = r.slice();
  return n[40] = e[t], n[42] = t, n;
}
function Fr(r, e, t) {
  const n = r.slice();
  return n[33] = e[t], n;
}
function Nr(r, e, t) {
  const n = r.slice();
  return n[33] = e[t], n;
}
function Hr(r, e, t) {
  const n = r.slice();
  return n[33] = e[t], n;
}
function Qe(r) {
  let e, t, n, a, i, o = (
    /*$_*/
    r[10]("infoTooltip") + ""
  ), s, c, u;
  return {
    c() {
      e = h("div"), t = h("div"), n = h("button"), a = y(), i = h("span"), s = U(o), m(n, "class", "icon-button close"), m(t, "class", "tooltip"), m(e, "class", "tooltip-backdrop");
    },
    m(f, p) {
      E(f, e, p), l(e, t), l(t, n), l(t, a), l(t, i), l(i, s), c || (u = $(
        n,
        "click",
        /*showHideToolip*/
        r[13]
      ), c = !0);
    },
    p(f, p) {
      p[0] & /*$_*/
      1024 && o !== (o = /*$_*/
      f[10]("infoTooltip") + "") && W(s, o);
    },
    d(f) {
      f && Y(e), c = !1, u();
    }
  };
}
function qr(r) {
  let e, t, n = (
    /*$_*/
    r[10]("rulesDescription") + ""
  ), a, i, o, s, c, u = (
    /*$_*/
    r[10]("prizeAgenda") + ""
  ), f, p, d, v, g = (
    /*$_*/
    r[10]("tournamentTicket") + ""
  ), b, _, O, x = (
    /*$_*/
    r[10]("freeSpins") + ""
  ), k, z, H, A = (
    /*$_*/
    r[10]("bonusMoney") + ""
  ), q, X, G, Q = (
    /*$_*/
    r[10]("loyaltyPoints") + ""
  ), D, R, P, K = (
    /*$_*/
    r[10]("luckyWheel") + ""
  ), Z, j, T, N = (
    /*$_*/
    r[10]("mysteryChest") + ""
  ), me, w, L, F = (
    /*$_*/
    r[10]("customRewards") + ""
  ), te, M = (
    /*hasUrl*/
    r[8] && Xe(r)
  );
  return {
    c() {
      e = h("div"), t = h("span"), a = U(n), i = y(), M && M.c(), o = y(), s = h("section"), c = h("span"), f = U(u), p = y(), d = h("ul"), v = h("li"), b = U(g), _ = y(), O = h("li"), k = U(x), z = y(), H = h("li"), q = U(A), X = y(), G = h("li"), D = U(Q), R = y(), P = h("li"), Z = U(K), j = y(), T = h("li"), me = U(N), w = y(), L = h("li"), te = U(F), m(t, "class", "chests-rules__description"), m(c, "class", "chests-rules__prize-title"), m(v, "class", "chests-rules__list__item"), m(O, "class", "chests-rules__list__item"), m(H, "class", "chests-rules__list__item"), m(G, "class", "chests-rules__list__item"), m(P, "class", "chests-rules__list__item"), m(T, "class", "chests-rules__list__item"), m(L, "class", "chests-rules__list__item"), m(d, "class", "chests-rules__list"), m(e, "class", "chests-rules");
    },
    m(S, B) {
      E(S, e, B), l(e, t), l(t, a), l(e, i), M && M.m(e, null), l(e, o), l(e, s), l(s, c), l(c, f), l(s, p), l(s, d), l(d, v), l(v, b), l(d, _), l(d, O), l(O, k), l(d, z), l(d, H), l(H, q), l(d, X), l(d, G), l(G, D), l(d, R), l(d, P), l(P, Z), l(d, j), l(d, T), l(T, me), l(d, w), l(d, L), l(L, te);
    },
    p(S, B) {
      B[0] & /*$_*/
      1024 && n !== (n = /*$_*/
      S[10]("rulesDescription") + "") && W(a, n), /*hasUrl*/
      S[8] ? M ? M.p(S, B) : (M = Xe(S), M.c(), M.m(e, o)) : M && (M.d(1), M = null), B[0] & /*$_*/
      1024 && u !== (u = /*$_*/
      S[10]("prizeAgenda") + "") && W(f, u), B[0] & /*$_*/
      1024 && g !== (g = /*$_*/
      S[10]("tournamentTicket") + "") && W(b, g), B[0] & /*$_*/
      1024 && x !== (x = /*$_*/
      S[10]("freeSpins") + "") && W(k, x), B[0] & /*$_*/
      1024 && A !== (A = /*$_*/
      S[10]("bonusMoney") + "") && W(q, A), B[0] & /*$_*/
      1024 && Q !== (Q = /*$_*/
      S[10]("loyaltyPoints") + "") && W(D, Q), B[0] & /*$_*/
      1024 && K !== (K = /*$_*/
      S[10]("luckyWheel") + "") && W(Z, K), B[0] & /*$_*/
      1024 && N !== (N = /*$_*/
      S[10]("mysteryChest") + "") && W(me, N), B[0] & /*$_*/
      1024 && F !== (F = /*$_*/
      S[10]("customRewards") + "") && W(te, F);
    },
    d(S) {
      S && Y(e), M && M.d();
    }
  };
}
function Rr(r) {
  let e;
  function t(i, o) {
    return (
      /*mysteryChestsHistory*/
      i[9].length > 0 ? Gr : Ar
    );
  }
  let n = t(r), a = n(r);
  return {
    c() {
      a.c(), e = ye();
    },
    m(i, o) {
      a.m(i, o), E(i, e, o);
    },
    p(i, o) {
      n === (n = t(i)) && a ? a.p(i, o) : (a.d(1), a = n(i), a && (a.c(), a.m(e.parentNode, e)));
    },
    d(i) {
      i && Y(e), a.d(i);
    }
  };
}
function jr(r) {
  let e;
  function t(i, o) {
    return (
      /*mysteryChests*/
      i[6].length > 0 ? Zr : Vr
    );
  }
  let n = t(r), a = n(r);
  return {
    c() {
      a.c(), e = ye();
    },
    m(i, o) {
      a.m(i, o), E(i, e, o);
    },
    p(i, o) {
      n === (n = t(i)) && a ? a.p(i, o) : (a.d(1), a = n(i), a && (a.c(), a.m(e.parentNode, e)));
    },
    d(i) {
      i && Y(e), a.d(i);
    }
  };
}
function Br(r) {
  let e, t = ee([1, 2, 3]), n = [];
  for (let a = 0; a < 3; a += 1)
    n[a] = Kr(Fr(r, t, a));
  return {
    c() {
      for (let a = 0; a < 3; a += 1)
        n[a].c();
      e = ye();
    },
    m(a, i) {
      for (let o = 0; o < 3; o += 1)
        n[o] && n[o].m(a, i);
      E(a, e, i);
    },
    p: se,
    d(a) {
      a && Y(e), fe(n, a);
    }
  };
}
function Ir(r) {
  let e, t = ee([1, 2, 3, 4, 5, 6, 7]), n = [];
  for (let a = 0; a < 7; a += 1)
    n[a] = $r(Hr(r, t, a));
  return {
    c() {
      for (let a = 0; a < 7; a += 1)
        n[a].c();
      e = ye();
    },
    m(a, i) {
      for (let o = 0; o < 7; o += 1)
        n[o] && n[o].m(a, i);
      E(a, e, i);
    },
    p: se,
    d(a) {
      a && Y(e), fe(n, a);
    }
  };
}
function Xe(r) {
  let e, t, n = (
    /*$_*/
    r[10]("terms") + ""
  ), a, i, o;
  return {
    c() {
      e = h("a"), t = h("span"), a = U(n), i = y(), o = h("span"), m(o, "class", "arrow-icon"), m(e, "class", "chests-rules__terms"), m(
        e,
        "href",
        /*terms*/
        r[0]
      ), m(e, "target", "_blank");
    },
    m(s, c) {
      E(s, e, c), l(e, t), l(t, a), l(e, i), l(e, o);
    },
    p(s, c) {
      c[0] & /*$_*/
      1024 && n !== (n = /*$_*/
      s[10]("terms") + "") && W(a, n), c[0] & /*terms*/
      1 && m(
        e,
        "href",
        /*terms*/
        s[0]
      );
    },
    d(s) {
      s && Y(e);
    }
  };
}
function Ar(r) {
  let e, t = (
    /*$_*/
    r[10]("noHistoryYet") + ""
  ), n;
  return {
    c() {
      e = h("div"), n = U(t), m(e, "class", "chests-empty");
    },
    m(a, i) {
      E(a, e, i), l(e, n);
    },
    p(a, i) {
      i[0] & /*$_*/
      1024 && t !== (t = /*$_*/
      a[10]("noHistoryYet") + "") && W(n, t);
    },
    d(a) {
      a && Y(e);
    }
  };
}
function Gr(r) {
  let e, t = ee(
    /*mysteryChestsHistory*/
    r[9]
  ), n = [];
  for (let a = 0; a < t.length; a += 1)
    n[a] = Je(Ie(r, t, a));
  return {
    c() {
      e = h("div");
      for (let a = 0; a < n.length; a += 1)
        n[a].c();
      m(e, "class", "chests-history__wrap");
    },
    m(a, i) {
      E(a, e, i);
      for (let o = 0; o < n.length; o += 1)
        n[o] && n[o].m(e, null);
    },
    p(a, i) {
      if (i[0] & /*showMore, mysteryChestsHistory, $_*/
      17920) {
        t = ee(
          /*mysteryChestsHistory*/
          a[9]
        );
        let o;
        for (o = 0; o < t.length; o += 1) {
          const s = Ie(a, t, o);
          n[o] ? n[o].p(s, i) : (n[o] = Je(s), n[o].c(), n[o].m(e, null));
        }
        for (; o < n.length; o += 1)
          n[o].d(1);
        n.length = t.length;
      }
    },
    d(a) {
      a && Y(e), fe(n, a);
    }
  };
}
function Qr(r) {
  let e, t;
  return {
    c() {
      e = h("img"), de(e.src, t = /*outcome*/
      r[46].assets) || m(e, "src", t), m(e, "alt", "");
    },
    m(n, a) {
      E(n, e, a);
    },
    p(n, a) {
      a[0] & /*mysteryChestsHistory*/
      512 && !de(e.src, t = /*outcome*/
      n[46].assets) && m(e, "src", t);
    },
    d(n) {
      n && Y(e);
    }
  };
}
function Xr(r) {
  let e = (
    /*outcome*/
    r[46].name + ""
  ), t;
  return {
    c() {
      t = U(e);
    },
    m(n, a) {
      E(n, t, a);
    },
    p(n, a) {
      a[0] & /*mysteryChestsHistory*/
      512 && e !== (e = /*outcome*/
      n[46].name + "") && W(t, e);
    },
    d(n) {
      n && Y(t);
    }
  };
}
function Ve(r) {
  var b;
  let e, t, n, a, i, o, s, c, u, f = (
    /*outcome*/
    ((b = r[46]) == null ? void 0 : b.date) + ""
  ), p;
  function d(_, O) {
    var x;
    return (
      /*outcome*/
      (x = _[46]) != null && x.name ? Xr : Qr
    );
  }
  let v = d(r), g = v(r);
  return {
    c() {
      var _;
      e = h("div"), t = h("span"), t.textContent = `${/*index*/
      r[48] + 1}`, n = y(), a = h("p"), g.c(), i = y(), o = h("img"), c = y(), u = h("span"), p = U(f), m(t, "class", "index"), de(o.src, s = /*outcome*/
      (_ = r[46]) != null && _.state ? Fe : Ee) || m(o, "src", s), m(o, "alt", ""), m(a, "class", "name"), m(u, "class", "time"), m(e, "class", "chests-history__list__item");
    },
    m(_, O) {
      E(_, e, O), l(e, t), l(e, n), l(e, a), g.m(a, null), l(a, i), l(a, o), l(e, c), l(e, u), l(u, p);
    },
    p(_, O) {
      var x, k;
      v === (v = d(_)) && g ? g.p(_, O) : (g.d(1), g = v(_), g && (g.c(), g.m(a, i))), O[0] & /*mysteryChestsHistory*/
      512 && !de(o.src, s = /*outcome*/
      (x = _[46]) != null && x.state ? Fe : Ee) && m(o, "src", s), O[0] & /*mysteryChestsHistory*/
      512 && f !== (f = /*outcome*/
      ((k = _[46]) == null ? void 0 : k.date) + "") && W(p, f);
    },
    d(_) {
      _ && Y(e), g.d();
    }
  };
}
function Ze(r) {
  let e, t = (
    /*$_*/
    r[10]("more") + ""
  ), n, a, i, o, s, c;
  function u() {
    return (
      /*click_handler_1*/
      r[23](
        /*history*/
        r[43]
      )
    );
  }
  return {
    c() {
      e = h("button"), n = U(t), a = y(), i = h("img"), de(i.src, o = Ct) || m(i, "src", o), m(i, "alt", "More"), m(e, "class", "chests-history__more");
    },
    m(f, p) {
      E(f, e, p), l(e, n), l(e, a), l(e, i), s || (c = $(e, "click", u), s = !0);
    },
    p(f, p) {
      r = f, p[0] & /*$_*/
      1024 && t !== (t = /*$_*/
      r[10]("more") + "") && W(n, t);
    },
    d(f) {
      f && Y(e), s = !1, c();
    }
  };
}
function Je(r) {
  var p;
  let e, t, n = (
    /*history*/
    r[43].name + ""
  ), a, i, o, s, c = ee(
    /*history*/
    r[43].outcomes.slice(
      0,
      /*history*/
      r[43].endPos
    )
  ), u = [];
  for (let d = 0; d < c.length; d += 1)
    u[d] = Ve(Ae(r, c, d));
  let f = (
    /*history*/
    ((p = r[43].outcomes) == null ? void 0 : p.length) > 3 && /*history*/
    r[43].endPos === 3 && Ze(r)
  );
  return {
    c() {
      e = h("div"), t = h("div"), a = U(n), i = y();
      for (let d = 0; d < u.length; d += 1)
        u[d].c();
      o = y(), f && f.c(), s = y(), m(t, "class", "chests-history__title"), m(e, "class", "chests-history__list");
    },
    m(d, v) {
      E(d, e, v), l(e, t), l(t, a), l(e, i);
      for (let g = 0; g < u.length; g += 1)
        u[g] && u[g].m(e, null);
      l(e, o), f && f.m(e, null), l(e, s);
    },
    p(d, v) {
      var g;
      if (v[0] & /*mysteryChestsHistory*/
      512 && n !== (n = /*history*/
      d[43].name + "") && W(a, n), v[0] & /*mysteryChestsHistory*/
      512) {
        c = ee(
          /*history*/
          d[43].outcomes.slice(
            0,
            /*history*/
            d[43].endPos
          )
        );
        let b;
        for (b = 0; b < c.length; b += 1) {
          const _ = Ae(d, c, b);
          u[b] ? u[b].p(_, v) : (u[b] = Ve(_), u[b].c(), u[b].m(e, o));
        }
        for (; b < u.length; b += 1)
          u[b].d(1);
        u.length = c.length;
      }
      /*history*/
      ((g = d[43].outcomes) == null ? void 0 : g.length) > 3 && /*history*/
      d[43].endPos === 3 ? f ? f.p(d, v) : (f = Ze(d), f.c(), f.m(e, s)) : f && (f.d(1), f = null);
    },
    d(d) {
      d && Y(e), fe(u, d), f && f.d();
    }
  };
}
function Vr(r) {
  let e, t = (
    /*$_*/
    r[10]("noChestYet") + ""
  ), n;
  return {
    c() {
      e = h("div"), n = U(t), m(e, "class", "chests-empty");
    },
    m(a, i) {
      E(a, e, i), l(e, n);
    },
    p(a, i) {
      i[0] & /*$_*/
      1024 && t !== (t = /*$_*/
      a[10]("noChestYet") + "") && W(n, t);
    },
    d(a) {
      a && Y(e);
    }
  };
}
function Zr(r) {
  let e, t = ee(
    /*mysteryChests*/
    r[6]
  ), n = [];
  for (let a = 0; a < t.length; a += 1)
    n[a] = Ke(Ge(r, t, a));
  return {
    c() {
      e = h("div");
      for (let a = 0; a < n.length; a += 1)
        n[a].c();
      m(e, "class", "chests-list");
    },
    m(a, i) {
      E(a, e, i);
      for (let o = 0; o < n.length; o += 1)
        n[o] && n[o].m(e, null);
    },
    p(a, i) {
      if (i[0] & /*openChestDetails, mysteryChests, lang*/
      65602) {
        t = ee(
          /*mysteryChests*/
          a[6]
        );
        let o;
        for (o = 0; o < t.length; o += 1) {
          const s = Ge(a, t, o);
          n[o] ? n[o].p(s, i) : (n[o] = Ke(s), n[o].c(), n[o].m(e, null));
        }
        for (; o < n.length; o += 1)
          n[o].d(1);
        n.length = t.length;
      }
    },
    d(a) {
      a && Y(e), fe(n, a);
    }
  };
}
function Ke(r) {
  var _, O;
  let e, t = (
    /*chest*/
    (r[40].program.name[
      /*lang*/
      r[1]
    ] || /*chest*/
    r[40].program.name[ie.default]) + ""
  ), n, a, i, o, s, c, u, f = (
    /*chest*/
    ((O = (_ = r[40]) == null ? void 0 : _.current) == null ? void 0 : O.remainingTimes) + ""
  ), p, d, v, g;
  function b() {
    return (
      /*click_handler*/
      r[22](
        /*chest*/
        r[40]
      )
    );
  }
  return {
    c() {
      e = h("button"), n = U(t), a = y(), i = h("div"), o = h("img"), c = y(), u = h("span"), p = U(f), d = y(), de(o.src, s = kt) || m(o, "src", s), m(o, "alt", "Key"), m(i, "class", "chests-list__item__keys"), m(e, "class", "chests-list__item");
    },
    m(x, k) {
      E(x, e, k), l(e, n), l(e, a), l(e, i), l(i, o), l(i, c), l(i, u), l(u, p), l(e, d), v || (g = $(e, "click", b), v = !0);
    },
    p(x, k) {
      var z, H;
      r = x, k[0] & /*mysteryChests, lang*/
      66 && t !== (t = /*chest*/
      (r[40].program.name[
        /*lang*/
        r[1]
      ] || /*chest*/
      r[40].program.name[ie.default]) + "") && W(n, t), k[0] & /*mysteryChests*/
      64 && f !== (f = /*chest*/
      ((H = (z = r[40]) == null ? void 0 : z.current) == null ? void 0 : H.remainingTimes) + "") && W(p, f);
    },
    d(x) {
      x && Y(e), v = !1, g();
    }
  };
}
function Jr(r) {
  let e;
  return {
    c() {
      e = h("div"), e.innerHTML = '<div class="chests-history-loader-left"><ui-skeleton class="chests-history-dot" structure="rectangle" width="16px" height="16px"></ui-skeleton> <ui-skeleton class="chests-history-text" structure="text" height="16px"></ui-skeleton></div> <ui-skeleton structure="text" width="50px" height="16px"></ui-skeleton>', m(e, "class", "chests-history-loader-body");
    },
    m(t, n) {
      E(t, e, n);
    },
    p: se,
    d(t) {
      t && Y(e);
    }
  };
}
function Kr(r) {
  let e, t, n, a, i = ee([1, 2, 3]), o = [];
  for (let s = 0; s < 3; s += 1)
    o[s] = Jr(Nr(r, i, s));
  return {
    c() {
      e = h("div"), t = h("ui-skeleton"), n = y();
      for (let s = 0; s < 3; s += 1)
        o[s].c();
      a = y(), Le(t, "structure", "text"), Le(t, "height", "16px"), m(e, "class", "chests-history-loader");
    },
    m(s, c) {
      E(s, e, c), l(e, t), l(e, n);
      for (let u = 0; u < 3; u += 1)
        o[u] && o[u].m(e, null);
      l(e, a);
    },
    p: se,
    d(s) {
      s && Y(e), fe(o, s);
    }
  };
}
function $r(r) {
  let e;
  return {
    c() {
      e = h("div"), e.innerHTML = '<ui-skeleton structure="text" height="16px"></ui-skeleton> <ui-skeleton structure="rectangle" width="50px" height="16px"></ui-skeleton> ', m(e, "class", "chests-loader");
    },
    m(t, n) {
      E(t, e, n);
    },
    p: se,
    d(t) {
      t && Y(e);
    }
  };
}
function en(r) {
  let e, t, n, a, i, o, s, c, u, f, p, d, v, g, b, _ = (
    /*$_*/
    r[10]("play") + ""
  ), O, x, k, z = (
    /*$_*/
    r[10]("history") + ""
  ), H, A, q, X = (
    /*$_*/
    r[10]("rules") + ""
  ), G, Q, D, R, P = (
    /*tooltip*/
    r[7] && Qe(r)
  );
  function K(T, N) {
    return (
      /*chestsLoading*/
      T[5] ? Ir : (
        /*historyLoading*/
        T[4] ? Br : (
          /*activeTab*/
          T[3] === 1 ? jr : (
            /*activeTab*/
            T[3] === 2 ? Rr : qr
          )
        )
      )
    );
  }
  let Z = K(r), j = Z(r);
  return {
    c() {
      e = h("div"), t = h("button"), n = y(), a = h("div"), P && P.c(), i = y(), o = h("div"), s = h("button"), c = y(), u = h("div"), u.textContent = "Mystery Chests", f = y(), p = h("button"), d = y(), v = h("div"), g = h("div"), b = h("button"), O = U(_), x = y(), k = h("button"), H = U(z), A = y(), q = h("button"), G = U(X), Q = y(), j.c(), m(t, "class", "overlay"), m(s, "class", "icon-button help"), m(u, "class", "chests-header__title"), m(p, "class", "icon-button close"), m(o, "class", "chests-header"), m(b, "data-index", "1"), m(b, "class", "chests-tabs__tab"), ue(
        b,
        "active",
        /*activeTab*/
        r[3] === 1
      ), m(k, "data-index", "2"), m(k, "class", "chests-tabs__tab"), ue(
        k,
        "active",
        /*activeTab*/
        r[3] === 2
      ), m(q, "data-index", "3"), m(q, "class", "chests-tabs__tab"), ue(
        q,
        "active",
        /*activeTab*/
        r[3] === 3
      ), m(g, "class", "chests-tabs__container"), m(v, "class", "chests-tabs"), m(a, "class", "drawer " + /*mobileView*/
      (r[11] ? "mobile" : "")), m(e, "part", "CustomStylingContainer");
    },
    m(T, N) {
      E(T, e, N), l(e, t), l(e, n), l(e, a), P && P.m(a, null), l(a, i), l(a, o), l(o, s), l(o, c), l(o, u), l(o, f), l(o, p), l(a, d), l(a, v), l(v, g), l(g, b), l(b, O), l(g, x), l(g, k), l(k, H), l(g, A), l(g, q), l(q, G), l(a, Q), j.m(a, null), r[24](e), D || (R = [
        $(
          t,
          "click",
          /*onClose*/
          r[12]
        ),
        $(
          s,
          "click",
          /*showHideToolip*/
          r[13]
        ),
        $(
          p,
          "click",
          /*onClose*/
          r[12]
        ),
        $(
          b,
          "click",
          /*handleTabChange*/
          r[15]
        ),
        $(
          k,
          "click",
          /*handleTabChange*/
          r[15]
        ),
        $(
          q,
          "click",
          /*handleTabChange*/
          r[15]
        )
      ], D = !0);
    },
    p(T, N) {
      /*tooltip*/
      T[7] ? P ? P.p(T, N) : (P = Qe(T), P.c(), P.m(a, i)) : P && (P.d(1), P = null), N[0] & /*$_*/
      1024 && _ !== (_ = /*$_*/
      T[10]("play") + "") && W(O, _), N[0] & /*activeTab*/
      8 && ue(
        b,
        "active",
        /*activeTab*/
        T[3] === 1
      ), N[0] & /*$_*/
      1024 && z !== (z = /*$_*/
      T[10]("history") + "") && W(H, z), N[0] & /*activeTab*/
      8 && ue(
        k,
        "active",
        /*activeTab*/
        T[3] === 2
      ), N[0] & /*$_*/
      1024 && X !== (X = /*$_*/
      T[10]("rules") + "") && W(G, X), N[0] & /*activeTab*/
      8 && ue(
        q,
        "active",
        /*activeTab*/
        T[3] === 3
      ), Z === (Z = K(T)) && j ? j.p(T, N) : (j.d(1), j = Z(T), j && (j.c(), j.m(a, null)));
    },
    i: se,
    o: se,
    d(T) {
      T && Y(e), P && P.d(), j.d(), r[24](null), D = !1, ht(R);
    }
  };
}
function tn(r, e, t) {
  let n;
  gt(r, xt, (w) => t(10, n = w));
  let { terms: a = "" } = e, { lang: i = ie.en } = e, { endpoint: o = "" } = e, { session: s = "" } = e, { clientstyling: c = "" } = e, { clientstylingurl: u = "" } = e, { translationurl: f = "" } = e, p = window.navigator.userAgent, d = yt(p), v, g = 1, b = !1, _ = !1, O = [], x = !1, k = !1, z;
  const H = (w) => /(https?:\/\/[^\s]+)/g.test(w), A = () => {
    Ye({ type: "CloseMysteryChestDrawer" });
  }, q = () => {
    t(7, x = !x);
  }, X = () => V(this, null, function* () {
    var te;
    t(4, b = !0);
    const w = yield Me.history(o, s), L = (te = w == null ? void 0 : w.items) == null ? void 0 : te.map((M) => M.programID);
    let F = O.filter((M) => !L || L.includes(M.program.id)).map((M) => ({
      id: M.program.id,
      name: M.program.name[i] || M.program.name[ie.default],
      partitions: M.program.wheelOfFortune.partitions,
      endPos: 0,
      outcomes: []
    }));
    if (F.length > 0) {
      const M = F.map((S, B) => V(this, null, function* () {
        const pe = (yield Me.outcome(o, s, S == null ? void 0 : S.id)).items || [];
        if (pe.length === 0) {
          F[B] = null;
          return;
        }
        F[B] = ze(ke({}, S), {
          endPos: pe.length > 3 ? 3 : pe.length,
          outcomes: pe.map((ve) => {
            var De, Se;
            const Oe = ((De = S.partitions[ve.draw.result.wheelOfFortunePartitionIndex]) == null ? void 0 : De.name) || {}, Pe = ((Se = S.partitions[ve.draw.result.wheelOfFortunePartitionIndex]) == null ? void 0 : Se.image1) || {}, nt = ve.draw.state === "fulfilled", at = Sr(new Date(ve.draw.time), "LLL d, yyyy HH:mm:ss");
            return {
              name: Oe[i] || Oe[ie.default],
              state: nt,
              date: at,
              assets: Pe[i] || Pe[ie.default]
            };
          })
        });
      }));
      yield Promise.all(M);
    }
    t(9, z = F.filter((M) => !!M)), t(4, b = !1);
  }), G = () => V(this, null, function* () {
    t(5, _ = !0);
    const w = yield Me.lotteries(o, s);
    t(6, O = w.filter((L) => Lr(L))), t(5, _ = !1);
  }), Q = (w) => {
    var F;
    const L = z.findIndex((te) => te.id === w);
    t(9, z[L].endPos = (F = z[L].outcomes) == null ? void 0 : F.length, z);
  }, D = (w) => V(this, null, function* () {
    t(3, g = +w.target.getAttribute("data-index")), g === 2 && (yield X());
  }), R = () => {
    let w = document.createElement("style");
    w.innerHTML = c, v.appendChild(w);
  }, P = () => {
    let w = new URL(u), L = document.createElement("style");
    fetch(w.href).then((F) => F.text()).then((F) => {
      L.innerHTML = F, setTimeout(
        () => {
          v.appendChild(L);
        },
        1
      );
    });
  }, K = () => {
    fetch(f).then((L) => L.json()).then((L) => {
      Object.keys(L).forEach((F) => {
        je(F, L[F]);
      });
    });
  };
  Object.keys(Be).forEach((w) => {
    je(w, Be[w]);
  });
  const Z = () => {
    Yr(i);
  }, j = (w) => {
    Ye({
      type: "OpenMysteryChestDetails",
      data: w
    });
  };
  pt(() => {
    t(8, k = H(a)), G();
  });
  const T = (w) => {
    j(w);
  }, N = (w) => Q(w.id);
  function me(w) {
    vt[w ? "unshift" : "push"](() => {
      v = w, t(2, v);
    });
  }
  return r.$$set = (w) => {
    "terms" in w && t(0, a = w.terms), "lang" in w && t(1, i = w.lang), "endpoint" in w && t(17, o = w.endpoint), "session" in w && t(18, s = w.session), "clientstyling" in w && t(19, c = w.clientstyling), "clientstylingurl" in w && t(20, u = w.clientstylingurl), "translationurl" in w && t(21, f = w.translationurl);
  }, r.$$.update = () => {
    r.$$.dirty[0] & /*lang*/
    2 && i && Z(), r.$$.dirty[0] & /*clientstyling, customStylingContainer*/
    524292 && c && v && R(), r.$$.dirty[0] & /*clientstylingurl, customStylingContainer*/
    1048580 && u && v && P(), r.$$.dirty[0] & /*translationurl*/
    2097152 && f && K();
  }, [
    a,
    i,
    v,
    g,
    b,
    _,
    O,
    x,
    k,
    z,
    n,
    d,
    A,
    q,
    Q,
    D,
    j,
    o,
    s,
    c,
    u,
    f,
    T,
    N,
    me
  ];
}
class rt extends ct {
  constructor(e) {
    super(), dt(
      this,
      e,
      tn,
      en,
      ft,
      {
        terms: 0,
        lang: 1,
        endpoint: 17,
        session: 18,
        clientstyling: 19,
        clientstylingurl: 20,
        translationurl: 21
      },
      Er,
      [-1, -1]
    );
  }
  get terms() {
    return this.$$.ctx[0];
  }
  set terms(e) {
    this.$$set({ terms: e }), ne();
  }
  get lang() {
    return this.$$.ctx[1];
  }
  set lang(e) {
    this.$$set({ lang: e }), ne();
  }
  get endpoint() {
    return this.$$.ctx[17];
  }
  set endpoint(e) {
    this.$$set({ endpoint: e }), ne();
  }
  get session() {
    return this.$$.ctx[18];
  }
  set session(e) {
    this.$$set({ session: e }), ne();
  }
  get clientstyling() {
    return this.$$.ctx[19];
  }
  set clientstyling(e) {
    this.$$set({ clientstyling: e }), ne();
  }
  get clientstylingurl() {
    return this.$$.ctx[20];
  }
  set clientstylingurl(e) {
    this.$$set({ clientstylingurl: e }), ne();
  }
  get translationurl() {
    return this.$$.ctx[21];
  }
  set translationurl(e) {
    this.$$set({ translationurl: e }), ne();
  }
}
wt(rt, { terms: {}, lang: {}, endpoint: {}, session: {}, clientstyling: {}, clientstylingurl: {}, translationurl: {} }, [], [], !0);
const ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: rt
}, Symbol.toStringTag, { value: "Module" }));
export {
  ln as C,
  Sr as f
};
