var et = Object.defineProperty, tt = Object.defineProperties;
var nt = Object.getOwnPropertyDescriptors;
var Te = Object.getOwnPropertySymbols;
var rt = Object.prototype.hasOwnProperty, at = Object.prototype.propertyIsEnumerable;
var Me = (n, e, t) => e in n ? et(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, ye = (n, e) => {
  for (var t in e || (e = {}))
    rt.call(e, t) && Me(n, t, e[t]);
  if (Te)
    for (var t of Te(e))
      at.call(e, t) && Me(n, t, e[t]);
  return n;
}, Oe = (n, e) => tt(n, nt(e));
var Z = (n, e, t) => new Promise((a, r) => {
  var i = (d) => {
    try {
      s(t.next(d));
    } catch (u) {
      r(u);
    }
  }, o = (d) => {
    try {
      s(t.throw(d));
    } catch (u) {
      r(u);
    }
  }, s = (d) => d.done ? a(d.value) : Promise.resolve(d.value).then(i, o);
  s((t = t.apply(n, e)).next());
});
import { a as it, $ as ot, S as st, c as lt, f as re, d as ut, s as dt, e as ct, g, h as y, t as W, j as m, D as se, m as Y, p as l, q as $, r as U, u as ie, v as E, x as ft, y as mt, z as ht, o as gt, B as pt, E as ge, F as ee, G as de, H as Pe, C as vt, k as pe } from "./CasinoMysteryChestContainer-yZPfQ-_e.js";
import "../stencil/ui-skeleton-CJbkvgG7.js";
const De = (n) => window.postMessage(n, window.location.href), wt = "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", Se = "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", We = "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", bt = "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 ve(n) {
  "@babel/helpers - typeof";
  return ve = 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;
  }, ve(n);
}
function oe(n) {
  if (n === null || n === !0 || n === !1)
    return NaN;
  var e = Number(n);
  return isNaN(e) ? e : e < 0 ? Math.ceil(e) : Math.floor(e);
}
function I(n, e) {
  if (e.length < n)
    throw new TypeError(n + " argument" + (n > 1 ? "s" : "") + " required, but only " + e.length + " present");
}
function J(n) {
  I(1, arguments);
  var e = Object.prototype.toString.call(n);
  return n instanceof Date || ve(n) === "object" && e === "[object Date]" ? new Date(n.getTime()) : typeof n == "number" || e === "[object Number]" ? new Date(n) : ((typeof n == "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 _t(n, e) {
  I(2, arguments);
  var t = J(n).getTime(), a = oe(e);
  return new Date(t + a);
}
var yt = {};
function _e() {
  return yt;
}
function xt(n) {
  var e = new Date(Date.UTC(n.getFullYear(), n.getMonth(), n.getDate(), n.getHours(), n.getMinutes(), n.getSeconds(), n.getMilliseconds()));
  return e.setUTCFullYear(n.getFullYear()), n.getTime() - e.getTime();
}
function Ct(n) {
  return I(1, arguments), n instanceof Date || ve(n) === "object" && Object.prototype.toString.call(n) === "[object Date]";
}
function kt(n) {
  if (I(1, arguments), !Ct(n) && typeof n != "number")
    return !1;
  var e = J(n);
  return !isNaN(Number(e));
}
function Tt(n, e) {
  I(2, arguments);
  var t = oe(e);
  return _t(n, -t);
}
var Mt = 864e5;
function Ot(n) {
  I(1, arguments);
  var e = J(n), t = e.getTime();
  e.setUTCMonth(0, 1), e.setUTCHours(0, 0, 0, 0);
  var a = e.getTime(), r = t - a;
  return Math.floor(r / Mt) + 1;
}
function we(n) {
  I(1, arguments);
  var e = 1, t = J(n), a = t.getUTCDay(), r = (a < e ? 7 : 0) + a - e;
  return t.setUTCDate(t.getUTCDate() - r), t.setUTCHours(0, 0, 0, 0), t;
}
function Ve(n) {
  I(1, arguments);
  var e = J(n), t = e.getUTCFullYear(), a = /* @__PURE__ */ new Date(0);
  a.setUTCFullYear(t + 1, 0, 4), a.setUTCHours(0, 0, 0, 0);
  var r = we(a), i = /* @__PURE__ */ new Date(0);
  i.setUTCFullYear(t, 0, 4), i.setUTCHours(0, 0, 0, 0);
  var o = we(i);
  return e.getTime() >= r.getTime() ? t + 1 : e.getTime() >= o.getTime() ? t : t - 1;
}
function Pt(n) {
  I(1, arguments);
  var e = Ve(n), t = /* @__PURE__ */ new Date(0);
  t.setUTCFullYear(e, 0, 4), t.setUTCHours(0, 0, 0, 0);
  var a = we(t);
  return a;
}
var Dt = 6048e5;
function St(n) {
  I(1, arguments);
  var e = J(n), t = we(e).getTime() - Pt(e).getTime();
  return Math.round(t / Dt) + 1;
}
function be(n, e) {
  var t, a, r, i, o, s, d, u;
  I(1, arguments);
  var f = _e(), p = oe((t = (a = (r = (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 && r !== void 0 ? r : f.weekStartsOn) !== null && a !== void 0 ? a : (d = f.locale) === null || d === void 0 || (u = d.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 c = J(n), v = c.getUTCDay(), w = (v < p ? 7 : 0) + v - p;
  return c.setUTCDate(c.getUTCDate() - w), c.setUTCHours(0, 0, 0, 0), c;
}
function Ze(n, e) {
  var t, a, r, i, o, s, d, u;
  I(1, arguments);
  var f = J(n), p = f.getUTCFullYear(), c = _e(), v = oe((t = (a = (r = (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 && r !== void 0 ? r : c.firstWeekContainsDate) !== null && a !== void 0 ? a : (d = c.locale) === null || d === void 0 || (u = d.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 w = /* @__PURE__ */ new Date(0);
  w.setUTCFullYear(p + 1, 0, v), w.setUTCHours(0, 0, 0, 0);
  var b = be(w, e), _ = /* @__PURE__ */ new Date(0);
  _.setUTCFullYear(p, 0, v), _.setUTCHours(0, 0, 0, 0);
  var P = be(_, e);
  return f.getTime() >= b.getTime() ? p + 1 : f.getTime() >= P.getTime() ? p : p - 1;
}
function Wt(n, e) {
  var t, a, r, i, o, s, d, u;
  I(1, arguments);
  var f = _e(), p = oe((t = (a = (r = (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 && r !== void 0 ? r : f.firstWeekContainsDate) !== null && a !== void 0 ? a : (d = f.locale) === null || d === void 0 || (u = d.options) === null || u === void 0 ? void 0 : u.firstWeekContainsDate) !== null && t !== void 0 ? t : 1), c = Ze(n, e), v = /* @__PURE__ */ new Date(0);
  v.setUTCFullYear(c, 0, p), v.setUTCHours(0, 0, 0, 0);
  var w = be(v, e);
  return w;
}
var Ut = 6048e5;
function zt(n, e) {
  I(1, arguments);
  var t = J(n), a = be(t, e).getTime() - Wt(t, e).getTime();
  return Math.round(a / Ut) + 1;
}
function C(n, e) {
  for (var t = n < 0 ? "-" : "", a = Math.abs(n).toString(); a.length < e; )
    a = "0" + a;
  return t + a;
}
var ne = {
  // Year
  y: function(e, t) {
    var a = e.getUTCFullYear(), r = a > 0 ? a : 1 - a;
    return C(t === "yy" ? r % 100 : r, t.length);
  },
  // Month
  M: function(e, t) {
    var a = e.getUTCMonth();
    return t === "M" ? String(a + 1) : C(a + 1, 2);
  },
  // Day of the month
  d: function(e, t) {
    return C(e.getUTCDate(), t.length);
  },
  // AM or PM
  a: function(e, t) {
    var a = e.getUTCHours() / 12 >= 1 ? "pm" : "am";
    switch (t) {
      case "a":
      case "aa":
        return a.toUpperCase();
      case "aaa":
        return a;
      case "aaaaa":
        return a[0];
      case "aaaa":
      default:
        return a === "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 a = t.length, r = e.getUTCMilliseconds(), i = Math.floor(r * Math.pow(10, a - 3));
    return C(i, t.length);
  }
}, le = {
  am: "am",
  pm: "pm",
  midnight: "midnight",
  noon: "noon",
  morning: "morning",
  afternoon: "afternoon",
  evening: "evening",
  night: "night"
}, Lt = {
  // Era
  G: function(e, t, a) {
    var r = e.getUTCFullYear() > 0 ? 1 : 0;
    switch (t) {
      case "G":
      case "GG":
      case "GGG":
        return a.era(r, {
          width: "abbreviated"
        });
      case "GGGGG":
        return a.era(r, {
          width: "narrow"
        });
      case "GGGG":
      default:
        return a.era(r, {
          width: "wide"
        });
    }
  },
  // Year
  y: function(e, t, a) {
    if (t === "yo") {
      var r = e.getUTCFullYear(), i = r > 0 ? r : 1 - r;
      return a.ordinalNumber(i, {
        unit: "year"
      });
    }
    return ne.y(e, t);
  },
  // Local week-numbering year
  Y: function(e, t, a, r) {
    var i = Ze(e, r), o = i > 0 ? i : 1 - i;
    if (t === "YY") {
      var s = o % 100;
      return C(s, 2);
    }
    return t === "Yo" ? a.ordinalNumber(o, {
      unit: "year"
    }) : C(o, t.length);
  },
  // ISO week-numbering year
  R: function(e, t) {
    var a = Ve(e);
    return C(a, 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 a = e.getUTCFullYear();
    return C(a, t.length);
  },
  // Quarter
  Q: function(e, t, a) {
    var r = Math.ceil((e.getUTCMonth() + 1) / 3);
    switch (t) {
      case "Q":
        return String(r);
      case "QQ":
        return C(r, 2);
      case "Qo":
        return a.ordinalNumber(r, {
          unit: "quarter"
        });
      case "QQQ":
        return a.quarter(r, {
          width: "abbreviated",
          context: "formatting"
        });
      case "QQQQQ":
        return a.quarter(r, {
          width: "narrow",
          context: "formatting"
        });
      case "QQQQ":
      default:
        return a.quarter(r, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone quarter
  q: function(e, t, a) {
    var r = Math.ceil((e.getUTCMonth() + 1) / 3);
    switch (t) {
      case "q":
        return String(r);
      case "qq":
        return C(r, 2);
      case "qo":
        return a.ordinalNumber(r, {
          unit: "quarter"
        });
      case "qqq":
        return a.quarter(r, {
          width: "abbreviated",
          context: "standalone"
        });
      case "qqqqq":
        return a.quarter(r, {
          width: "narrow",
          context: "standalone"
        });
      case "qqqq":
      default:
        return a.quarter(r, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // Month
  M: function(e, t, a) {
    var r = e.getUTCMonth();
    switch (t) {
      case "M":
      case "MM":
        return ne.M(e, t);
      case "Mo":
        return a.ordinalNumber(r + 1, {
          unit: "month"
        });
      case "MMM":
        return a.month(r, {
          width: "abbreviated",
          context: "formatting"
        });
      case "MMMMM":
        return a.month(r, {
          width: "narrow",
          context: "formatting"
        });
      case "MMMM":
      default:
        return a.month(r, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone month
  L: function(e, t, a) {
    var r = e.getUTCMonth();
    switch (t) {
      case "L":
        return String(r + 1);
      case "LL":
        return C(r + 1, 2);
      case "Lo":
        return a.ordinalNumber(r + 1, {
          unit: "month"
        });
      case "LLL":
        return a.month(r, {
          width: "abbreviated",
          context: "standalone"
        });
      case "LLLLL":
        return a.month(r, {
          width: "narrow",
          context: "standalone"
        });
      case "LLLL":
      default:
        return a.month(r, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // Local week of year
  w: function(e, t, a, r) {
    var i = zt(e, r);
    return t === "wo" ? a.ordinalNumber(i, {
      unit: "week"
    }) : C(i, t.length);
  },
  // ISO week of year
  I: function(e, t, a) {
    var r = St(e);
    return t === "Io" ? a.ordinalNumber(r, {
      unit: "week"
    }) : C(r, t.length);
  },
  // Day of the month
  d: function(e, t, a) {
    return t === "do" ? a.ordinalNumber(e.getUTCDate(), {
      unit: "date"
    }) : ne.d(e, t);
  },
  // Day of year
  D: function(e, t, a) {
    var r = Ot(e);
    return t === "Do" ? a.ordinalNumber(r, {
      unit: "dayOfYear"
    }) : C(r, t.length);
  },
  // Day of week
  E: function(e, t, a) {
    var r = e.getUTCDay();
    switch (t) {
      case "E":
      case "EE":
      case "EEE":
        return a.day(r, {
          width: "abbreviated",
          context: "formatting"
        });
      case "EEEEE":
        return a.day(r, {
          width: "narrow",
          context: "formatting"
        });
      case "EEEEEE":
        return a.day(r, {
          width: "short",
          context: "formatting"
        });
      case "EEEE":
      default:
        return a.day(r, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Local day of week
  e: function(e, t, a, r) {
    var i = e.getUTCDay(), o = (i - r.weekStartsOn + 8) % 7 || 7;
    switch (t) {
      case "e":
        return String(o);
      case "ee":
        return C(o, 2);
      case "eo":
        return a.ordinalNumber(o, {
          unit: "day"
        });
      case "eee":
        return a.day(i, {
          width: "abbreviated",
          context: "formatting"
        });
      case "eeeee":
        return a.day(i, {
          width: "narrow",
          context: "formatting"
        });
      case "eeeeee":
        return a.day(i, {
          width: "short",
          context: "formatting"
        });
      case "eeee":
      default:
        return a.day(i, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone local day of week
  c: function(e, t, a, r) {
    var i = e.getUTCDay(), o = (i - r.weekStartsOn + 8) % 7 || 7;
    switch (t) {
      case "c":
        return String(o);
      case "cc":
        return C(o, t.length);
      case "co":
        return a.ordinalNumber(o, {
          unit: "day"
        });
      case "ccc":
        return a.day(i, {
          width: "abbreviated",
          context: "standalone"
        });
      case "ccccc":
        return a.day(i, {
          width: "narrow",
          context: "standalone"
        });
      case "cccccc":
        return a.day(i, {
          width: "short",
          context: "standalone"
        });
      case "cccc":
      default:
        return a.day(i, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // ISO day of week
  i: function(e, t, a) {
    var r = e.getUTCDay(), i = r === 0 ? 7 : r;
    switch (t) {
      case "i":
        return String(i);
      case "ii":
        return C(i, t.length);
      case "io":
        return a.ordinalNumber(i, {
          unit: "day"
        });
      case "iii":
        return a.day(r, {
          width: "abbreviated",
          context: "formatting"
        });
      case "iiiii":
        return a.day(r, {
          width: "narrow",
          context: "formatting"
        });
      case "iiiiii":
        return a.day(r, {
          width: "short",
          context: "formatting"
        });
      case "iiii":
      default:
        return a.day(r, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM or PM
  a: function(e, t, a) {
    var r = e.getUTCHours(), i = r / 12 >= 1 ? "pm" : "am";
    switch (t) {
      case "a":
      case "aa":
        return a.dayPeriod(i, {
          width: "abbreviated",
          context: "formatting"
        });
      case "aaa":
        return a.dayPeriod(i, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "aaaaa":
        return a.dayPeriod(i, {
          width: "narrow",
          context: "formatting"
        });
      case "aaaa":
      default:
        return a.dayPeriod(i, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM, PM, midnight, noon
  b: function(e, t, a) {
    var r = e.getUTCHours(), i;
    switch (r === 12 ? i = le.noon : r === 0 ? i = le.midnight : i = r / 12 >= 1 ? "pm" : "am", t) {
      case "b":
      case "bb":
        return a.dayPeriod(i, {
          width: "abbreviated",
          context: "formatting"
        });
      case "bbb":
        return a.dayPeriod(i, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "bbbbb":
        return a.dayPeriod(i, {
          width: "narrow",
          context: "formatting"
        });
      case "bbbb":
      default:
        return a.dayPeriod(i, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // in the morning, in the afternoon, in the evening, at night
  B: function(e, t, a) {
    var r = e.getUTCHours(), i;
    switch (r >= 17 ? i = le.evening : r >= 12 ? i = le.afternoon : r >= 4 ? i = le.morning : i = le.night, t) {
      case "B":
      case "BB":
      case "BBB":
        return a.dayPeriod(i, {
          width: "abbreviated",
          context: "formatting"
        });
      case "BBBBB":
        return a.dayPeriod(i, {
          width: "narrow",
          context: "formatting"
        });
      case "BBBB":
      default:
        return a.dayPeriod(i, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Hour [1-12]
  h: function(e, t, a) {
    if (t === "ho") {
      var r = e.getUTCHours() % 12;
      return r === 0 && (r = 12), a.ordinalNumber(r, {
        unit: "hour"
      });
    }
    return ne.h(e, t);
  },
  // Hour [0-23]
  H: function(e, t, a) {
    return t === "Ho" ? a.ordinalNumber(e.getUTCHours(), {
      unit: "hour"
    }) : ne.H(e, t);
  },
  // Hour [0-11]
  K: function(e, t, a) {
    var r = e.getUTCHours() % 12;
    return t === "Ko" ? a.ordinalNumber(r, {
      unit: "hour"
    }) : C(r, t.length);
  },
  // Hour [1-24]
  k: function(e, t, a) {
    var r = e.getUTCHours();
    return r === 0 && (r = 24), t === "ko" ? a.ordinalNumber(r, {
      unit: "hour"
    }) : C(r, t.length);
  },
  // Minute
  m: function(e, t, a) {
    return t === "mo" ? a.ordinalNumber(e.getUTCMinutes(), {
      unit: "minute"
    }) : ne.m(e, t);
  },
  // Second
  s: function(e, t, a) {
    return t === "so" ? a.ordinalNumber(e.getUTCSeconds(), {
      unit: "second"
    }) : ne.s(e, t);
  },
  // Fraction of second
  S: function(e, t) {
    return ne.S(e, t);
  },
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
  X: function(e, t, a, r) {
    var i = r._originalDate || e, o = i.getTimezoneOffset();
    if (o === 0)
      return "Z";
    switch (t) {
      case "X":
        return ze(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, a, r) {
    var i = r._originalDate || e, o = i.getTimezoneOffset();
    switch (t) {
      case "x":
        return ze(o);
      case "xxxx":
      case "xx":
        return ae(o);
      case "xxxxx":
      case "xxx":
      default:
        return ae(o, ":");
    }
  },
  // Timezone (GMT)
  O: function(e, t, a, r) {
    var i = r._originalDate || e, o = i.getTimezoneOffset();
    switch (t) {
      case "O":
      case "OO":
      case "OOO":
        return "GMT" + Ue(o, ":");
      case "OOOO":
      default:
        return "GMT" + ae(o, ":");
    }
  },
  // Timezone (specific non-location)
  z: function(e, t, a, r) {
    var i = r._originalDate || e, o = i.getTimezoneOffset();
    switch (t) {
      case "z":
      case "zz":
      case "zzz":
        return "GMT" + Ue(o, ":");
      case "zzzz":
      default:
        return "GMT" + ae(o, ":");
    }
  },
  // Seconds timestamp
  t: function(e, t, a, r) {
    var i = r._originalDate || e, o = Math.floor(i.getTime() / 1e3);
    return C(o, t.length);
  },
  // Milliseconds timestamp
  T: function(e, t, a, r) {
    var i = r._originalDate || e, o = i.getTime();
    return C(o, t.length);
  }
};
function Ue(n, e) {
  var t = n > 0 ? "-" : "+", a = Math.abs(n), r = Math.floor(a / 60), i = a % 60;
  if (i === 0)
    return t + String(r);
  var o = e;
  return t + String(r) + o + C(i, 2);
}
function ze(n, e) {
  if (n % 60 === 0) {
    var t = n > 0 ? "-" : "+";
    return t + C(Math.abs(n) / 60, 2);
  }
  return ae(n, e);
}
function ae(n, e) {
  var t = e || "", a = n > 0 ? "-" : "+", r = Math.abs(n), i = C(Math.floor(r / 60), 2), o = C(r % 60, 2);
  return a + i + t + o;
}
var Le = 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"
      });
  }
}, Je = 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"
      });
  }
}, Yt = function(e, t) {
  var a = e.match(/(P+)(p+)?/) || [], r = a[1], i = a[2];
  if (!i)
    return Le(e, t);
  var o;
  switch (r) {
    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}}", Le(r, t)).replace("{{time}}", Je(i, t));
}, Et = {
  p: Je,
  P: Yt
}, Ft = ["D", "DD"], Nt = ["YY", "YYYY"];
function Ht(n) {
  return Ft.indexOf(n) !== -1;
}
function qt(n) {
  return Nt.indexOf(n) !== -1;
}
function Ye(n, e, t) {
  if (n === "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 (n === "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 (n === "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 (n === "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 Rt = {
  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"
  }
}, Bt = function(e, t, a) {
  var r, i = Rt[e];
  return typeof i == "string" ? r = i : t === 1 ? r = i.one : r = i.other.replace("{{count}}", t.toString()), a != null && a.addSuffix ? a.comparison && a.comparison > 0 ? "in " + r : r + " ago" : r;
};
function xe(n) {
  return function() {
    var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.width ? String(e.width) : n.defaultWidth, a = n.formats[t] || n.formats[n.defaultWidth];
    return a;
  };
}
var jt = {
  full: "EEEE, MMMM do, y",
  long: "MMMM do, y",
  medium: "MMM d, y",
  short: "MM/dd/yyyy"
}, It = {
  full: "h:mm:ss a zzzz",
  long: "h:mm:ss a z",
  medium: "h:mm:ss a",
  short: "h:mm a"
}, At = {
  full: "{{date}} 'at' {{time}}",
  long: "{{date}} 'at' {{time}}",
  medium: "{{date}}, {{time}}",
  short: "{{date}}, {{time}}"
}, Gt = {
  date: xe({
    formats: jt,
    defaultWidth: "full"
  }),
  time: xe({
    formats: It,
    defaultWidth: "full"
  }),
  dateTime: xe({
    formats: At,
    defaultWidth: "full"
  })
}, Qt = {
  lastWeek: "'last' eeee 'at' p",
  yesterday: "'yesterday at' p",
  today: "'today at' p",
  tomorrow: "'tomorrow at' p",
  nextWeek: "eeee 'at' p",
  other: "P"
}, Xt = function(e, t, a, r) {
  return Qt[e];
};
function fe(n) {
  return function(e, t) {
    var a = t != null && t.context ? String(t.context) : "standalone", r;
    if (a === "formatting" && n.formattingValues) {
      var i = n.defaultFormattingWidth || n.defaultWidth, o = t != null && t.width ? String(t.width) : i;
      r = n.formattingValues[o] || n.formattingValues[i];
    } else {
      var s = n.defaultWidth, d = t != null && t.width ? String(t.width) : n.defaultWidth;
      r = n.values[d] || n.values[s];
    }
    var u = n.argumentCallback ? n.argumentCallback(e) : e;
    return r[u];
  };
}
var Vt = {
  narrow: ["B", "A"],
  abbreviated: ["BC", "AD"],
  wide: ["Before Christ", "Anno Domini"]
}, Zt = {
  narrow: ["1", "2", "3", "4"],
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
  wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
}, Jt = {
  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"]
}, Kt = {
  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"]
}, $t = {
  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"
  }
}, en = {
  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"
  }
}, tn = function(e, t) {
  var a = Number(e), r = a % 100;
  if (r > 20 || r < 10)
    switch (r % 10) {
      case 1:
        return a + "st";
      case 2:
        return a + "nd";
      case 3:
        return a + "rd";
    }
  return a + "th";
}, nn = {
  ordinalNumber: tn,
  era: fe({
    values: Vt,
    defaultWidth: "wide"
  }),
  quarter: fe({
    values: Zt,
    defaultWidth: "wide",
    argumentCallback: function(e) {
      return e - 1;
    }
  }),
  month: fe({
    values: Jt,
    defaultWidth: "wide"
  }),
  day: fe({
    values: Kt,
    defaultWidth: "wide"
  }),
  dayPeriod: fe({
    values: $t,
    defaultWidth: "wide",
    formattingValues: en,
    defaultFormattingWidth: "wide"
  })
};
function me(n) {
  return function(e) {
    var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = t.width, r = a && n.matchPatterns[a] || n.matchPatterns[n.defaultMatchWidth], i = e.match(r);
    if (!i)
      return null;
    var o = i[0], s = a && n.parsePatterns[a] || n.parsePatterns[n.defaultParseWidth], d = Array.isArray(s) ? an(s, function(p) {
      return p.test(o);
    }) : rn(s, function(p) {
      return p.test(o);
    }), u;
    u = n.valueCallback ? n.valueCallback(d) : d, u = t.valueCallback ? t.valueCallback(u) : u;
    var f = e.slice(o.length);
    return {
      value: u,
      rest: f
    };
  };
}
function rn(n, e) {
  for (var t in n)
    if (n.hasOwnProperty(t) && e(n[t]))
      return t;
}
function an(n, e) {
  for (var t = 0; t < n.length; t++)
    if (e(n[t]))
      return t;
}
function on(n) {
  return function(e) {
    var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = e.match(n.matchPattern);
    if (!a)
      return null;
    var r = a[0], i = e.match(n.parsePattern);
    if (!i)
      return null;
    var o = n.valueCallback ? n.valueCallback(i[0]) : i[0];
    o = t.valueCallback ? t.valueCallback(o) : o;
    var s = e.slice(r.length);
    return {
      value: o,
      rest: s
    };
  };
}
var sn = /^(\d+)(th|st|nd|rd)?/i, ln = /\d+/i, un = {
  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
}, dn = {
  any: [/^b/i, /^(a|c)/i]
}, cn = {
  narrow: /^[1234]/i,
  abbreviated: /^q[1234]/i,
  wide: /^[1234](th|st|nd|rd)? quarter/i
}, fn = {
  any: [/1/i, /2/i, /3/i, /4/i]
}, mn = {
  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
}, hn = {
  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]
}, gn = {
  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
}, pn = {
  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]
}, vn = {
  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
}, wn = {
  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
  }
}, bn = {
  ordinalNumber: on({
    matchPattern: sn,
    parsePattern: ln,
    valueCallback: function(e) {
      return parseInt(e, 10);
    }
  }),
  era: me({
    matchPatterns: un,
    defaultMatchWidth: "wide",
    parsePatterns: dn,
    defaultParseWidth: "any"
  }),
  quarter: me({
    matchPatterns: cn,
    defaultMatchWidth: "wide",
    parsePatterns: fn,
    defaultParseWidth: "any",
    valueCallback: function(e) {
      return e + 1;
    }
  }),
  month: me({
    matchPatterns: mn,
    defaultMatchWidth: "wide",
    parsePatterns: hn,
    defaultParseWidth: "any"
  }),
  day: me({
    matchPatterns: gn,
    defaultMatchWidth: "wide",
    parsePatterns: pn,
    defaultParseWidth: "any"
  }),
  dayPeriod: me({
    matchPatterns: vn,
    defaultMatchWidth: "any",
    parsePatterns: wn,
    defaultParseWidth: "any"
  })
}, _n = {
  code: "en-US",
  formatDistance: Bt,
  formatLong: Gt,
  formatRelative: Xt,
  localize: nn,
  match: bn,
  options: {
    weekStartsOn: 0,
    firstWeekContainsDate: 1
  }
}, yn = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, xn = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Cn = /^'([^]*?)'?$/, kn = /''/g, Tn = /[a-zA-Z]/;
function Mn(n, e, t) {
  var a, r, i, o, s, d, u, f, p, c, v, w, b, _;
  I(2, arguments);
  var P = String(e), M = _e(), x = (a = (r = void 0) !== null && r !== void 0 ? r : M.locale) !== null && a !== void 0 ? a : _n, D = oe((i = (o = (s = (d = void 0) !== null && d !== void 0 ? d : void 0) !== null && s !== void 0 ? s : M.firstWeekContainsDate) !== null && o !== void 0 ? o : (u = M.locale) === null || u === void 0 || (f = u.options) === null || f === void 0 ? void 0 : f.firstWeekContainsDate) !== null && i !== void 0 ? i : 1);
  if (!(D >= 1 && D <= 7))
    throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
  var N = oe((p = (c = (v = (w = void 0) !== null && w !== void 0 ? w : void 0) !== null && v !== void 0 ? v : M.weekStartsOn) !== null && c !== void 0 ? c : (b = M.locale) === null || b === void 0 || (_ = b.options) === null || _ === void 0 ? void 0 : _.weekStartsOn) !== null && p !== void 0 ? p : 0);
  if (!(N >= 0 && N <= 6))
    throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
  if (!x.localize)
    throw new RangeError("locale must contain localize property");
  if (!x.formatLong)
    throw new RangeError("locale must contain formatLong property");
  var A = J(n);
  if (!kt(A))
    throw new RangeError("Invalid time value");
  var H = xt(A), X = Tt(A, H), G = {
    firstWeekContainsDate: D,
    weekStartsOn: N,
    locale: x,
    _originalDate: A
  }, Q = P.match(xn).map(function(S) {
    var q = S[0];
    if (q === "p" || q === "P") {
      var O = Et[q];
      return O(S, x.formatLong);
    }
    return S;
  }).join("").match(yn).map(function(S) {
    if (S === "''")
      return "'";
    var q = S[0];
    if (q === "'")
      return On(S);
    var O = Lt[q];
    if (O)
      return qt(S) && Ye(S, e, String(n)), Ht(S) && Ye(S, e, String(n)), O(X, S, x.localize, G);
    if (q.match(Tn))
      throw new RangeError("Format string contains an unescaped latin alphabet character `" + q + "`");
    return S;
  }).join("");
  return Q;
}
function On(n) {
  var e = n.match(Cn);
  return e ? e[1].replace(kn, "'") : n;
}
var he = /* @__PURE__ */ ((n) => (n.lotteries = "lotteries", n.outcome = "outcome", n.draw = "draw", n))(he || {}), ue = /* @__PURE__ */ ((n) => (n.en = "en", n.default = "*", n))(ue || {});
const Pn = (n) => Z(void 0, null, function* () {
  const { path: e, params: t = {}, options: a = {} } = n, r = new URL(e);
  return Object.keys(t).map((i) => {
    r.searchParams.append(i, t[i]);
  }), yield Dn(r, a);
}), Dn = (t, ...a) => Z(void 0, [t, ...a], function* (n, e = {}) {
  let r;
  try {
    r = yield fetch(n, e), r = yield r.text(), r = JSON.parse(r);
  } catch (i) {
    throw new Error(i.message);
  }
  return r;
}), Ee = (n, e, t) => Z(void 0, null, function* () {
  const { session: a } = t, r = {
    headers: ye({
      "Content-Type": "application/json",
      accept: "text/plain"
    }, a ? { "x-SessionId": a } : {})
  }, o = {
    [he.lotteries]: () => ({
      path: "/wof/lotteries",
      params: {
        filter: "Types[]=mysteryChest"
      },
      options: r
    }),
    [he.outcome]: () => {
      const { id: s } = t;
      return {
        path: `/wof/outcome/${s}`,
        params: {
          filter: "Types[]=mysteryChest"
        },
        options: r
      };
    }
  }[n]();
  return o.path = e + "/v1" + o.path, yield Pn(o);
}), Fe = {
  lotteries: (n, e) => Z(void 0, null, function* () {
    const t = yield Ee(he.lotteries, n, { session: e });
    return (t == null ? void 0 : t.items) || [];
  }),
  outcome: (n, e, t) => Z(void 0, null, function* () {
    return yield Ee(he.outcome, n, { session: e, id: t });
  })
}, Sn = (n) => {
  var e;
  return ((e = n == null ? void 0 : n.current) == null ? void 0 : e.remainingTimes) > 0 && (n == null ? void 0 : n.next);
};
function Ne(n, e) {
  it(n, e);
}
function Wn(n) {
  ot.set(n);
}
const He = {
  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 Un(n) {
  ct(n, "svelte-4ymzhp", `.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__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}.chests-history-dot .Skeleton{border-radius:var(--emw--border-radius-large, 50%);margin-right:10px}.chests-history-text .Skeleton{margin-right:20px}`);
}
function qe(n, e, t) {
  const a = n.slice();
  return a[43] = e[t], a;
}
function Re(n, e, t) {
  const a = n.slice();
  return a[46] = e[t], a[48] = t, a;
}
function Be(n, e, t) {
  const a = n.slice();
  return a[40] = e[t], a[42] = t, a;
}
function zn(n, e, t) {
  const a = n.slice();
  return a[33] = e[t], a;
}
function Ln(n, e, t) {
  const a = n.slice();
  return a[33] = e[t], a;
}
function Yn(n, e, t) {
  const a = n.slice();
  return a[33] = e[t], a;
}
function je(n) {
  let e, t, a, r, i, o = (
    /*$_*/
    n[10]("infoTooltip") + ""
  ), s, d, u;
  return {
    c() {
      e = g("div"), t = g("div"), a = g("button"), r = y(), i = g("span"), s = W(o), m(a, "class", "icon-button close"), m(t, "class", "tooltip"), m(e, "class", "tooltip-backdrop");
    },
    m(f, p) {
      Y(f, e, p), l(e, t), l(t, a), l(t, r), l(t, i), l(i, s), d || (u = $(
        a,
        "click",
        /*showHideToolip*/
        n[13]
      ), d = !0);
    },
    p(f, p) {
      p[0] & /*$_*/
      1024 && o !== (o = /*$_*/
      f[10]("infoTooltip") + "") && U(s, o);
    },
    d(f) {
      f && E(e), d = !1, u();
    }
  };
}
function En(n) {
  let e, t, a = (
    /*$_*/
    n[10]("rulesDescription") + ""
  ), r, i, o, s, d, u = (
    /*$_*/
    n[10]("prizeAgenda") + ""
  ), f, p, c, v, w = (
    /*$_*/
    n[10]("tournamentTicket") + ""
  ), b, _, P, M = (
    /*$_*/
    n[10]("freeSpins") + ""
  ), x, D, N, A = (
    /*$_*/
    n[10]("bonusMoney") + ""
  ), H, X, G, Q = (
    /*$_*/
    n[10]("loyaltyPoints") + ""
  ), S, q, O, K = (
    /*$_*/
    n[10]("luckyWheel") + ""
  ), V, R, k, F = (
    /*$_*/
    n[10]("mysteryChest") + ""
  ), ce, h, T, L = (
    /*$_*/
    n[10]("customRewards") + ""
  ), te, j = (
    /*hasUrl*/
    n[8] && Ie(n)
  );
  return {
    c() {
      e = g("div"), t = g("span"), r = W(a), i = y(), j && j.c(), o = y(), s = g("section"), d = g("span"), f = W(u), p = y(), c = g("ul"), v = g("li"), b = W(w), _ = y(), P = g("li"), x = W(M), D = y(), N = g("li"), H = W(A), X = y(), G = g("li"), S = W(Q), q = y(), O = g("li"), V = W(K), R = y(), k = g("li"), ce = W(F), h = y(), T = g("li"), te = W(L), m(t, "class", "chests-rules__description"), m(d, "class", "chests-rules__prize-title"), m(v, "class", "chests-rules__list__item"), m(P, "class", "chests-rules__list__item"), m(N, "class", "chests-rules__list__item"), m(G, "class", "chests-rules__list__item"), m(O, "class", "chests-rules__list__item"), m(k, "class", "chests-rules__list__item"), m(T, "class", "chests-rules__list__item"), m(c, "class", "chests-rules__list"), m(e, "class", "chests-rules");
    },
    m(z, B) {
      Y(z, e, B), l(e, t), l(t, r), l(e, i), j && j.m(e, null), l(e, o), l(e, s), l(s, d), l(d, f), l(s, p), l(s, c), l(c, v), l(v, b), l(c, _), l(c, P), l(P, x), l(c, D), l(c, N), l(N, H), l(c, X), l(c, G), l(G, S), l(c, q), l(c, O), l(O, V), l(c, R), l(c, k), l(k, ce), l(c, h), l(c, T), l(T, te);
    },
    p(z, B) {
      B[0] & /*$_*/
      1024 && a !== (a = /*$_*/
      z[10]("rulesDescription") + "") && U(r, a), /*hasUrl*/
      z[8] ? j ? j.p(z, B) : (j = Ie(z), j.c(), j.m(e, o)) : j && (j.d(1), j = null), B[0] & /*$_*/
      1024 && u !== (u = /*$_*/
      z[10]("prizeAgenda") + "") && U(f, u), B[0] & /*$_*/
      1024 && w !== (w = /*$_*/
      z[10]("tournamentTicket") + "") && U(b, w), B[0] & /*$_*/
      1024 && M !== (M = /*$_*/
      z[10]("freeSpins") + "") && U(x, M), B[0] & /*$_*/
      1024 && A !== (A = /*$_*/
      z[10]("bonusMoney") + "") && U(H, A), B[0] & /*$_*/
      1024 && Q !== (Q = /*$_*/
      z[10]("loyaltyPoints") + "") && U(S, Q), B[0] & /*$_*/
      1024 && K !== (K = /*$_*/
      z[10]("luckyWheel") + "") && U(V, K), B[0] & /*$_*/
      1024 && F !== (F = /*$_*/
      z[10]("mysteryChest") + "") && U(ce, F), B[0] & /*$_*/
      1024 && L !== (L = /*$_*/
      z[10]("customRewards") + "") && U(te, L);
    },
    d(z) {
      z && E(e), j && j.d();
    }
  };
}
function Fn(n) {
  let e;
  function t(i, o) {
    return (
      /*mysteryChestsHistory*/
      i[9].length > 0 ? Bn : Rn
    );
  }
  let a = t(n), r = a(n);
  return {
    c() {
      r.c(), e = ge();
    },
    m(i, o) {
      r.m(i, o), Y(i, e, o);
    },
    p(i, o) {
      a === (a = t(i)) && r ? r.p(i, o) : (r.d(1), r = a(i), r && (r.c(), r.m(e.parentNode, e)));
    },
    d(i) {
      i && E(e), r.d(i);
    }
  };
}
function Nn(n) {
  let e;
  function t(i, o) {
    return (
      /*mysteryChests*/
      i[6].length > 0 ? In : jn
    );
  }
  let a = t(n), r = a(n);
  return {
    c() {
      r.c(), e = ge();
    },
    m(i, o) {
      r.m(i, o), Y(i, e, o);
    },
    p(i, o) {
      a === (a = t(i)) && r ? r.p(i, o) : (r.d(1), r = a(i), r && (r.c(), r.m(e.parentNode, e)));
    },
    d(i) {
      i && E(e), r.d(i);
    }
  };
}
function Hn(n) {
  let e, t = ee([1, 2, 3]), a = [];
  for (let r = 0; r < 3; r += 1)
    a[r] = Gn(zn(n, t, r));
  return {
    c() {
      for (let r = 0; r < 3; r += 1)
        a[r].c();
      e = ge();
    },
    m(r, i) {
      for (let o = 0; o < 3; o += 1)
        a[o] && a[o].m(r, i);
      Y(r, e, i);
    },
    p: ie,
    d(r) {
      r && E(e), de(a, r);
    }
  };
}
function qn(n) {
  let e, t = ee([1, 2, 3, 4, 5, 6, 7]), a = [];
  for (let r = 0; r < 7; r += 1)
    a[r] = Qn(Yn(n, t, r));
  return {
    c() {
      for (let r = 0; r < 7; r += 1)
        a[r].c();
      e = ge();
    },
    m(r, i) {
      for (let o = 0; o < 7; o += 1)
        a[o] && a[o].m(r, i);
      Y(r, e, i);
    },
    p: ie,
    d(r) {
      r && E(e), de(a, r);
    }
  };
}
function Ie(n) {
  let e, t, a = (
    /*$_*/
    n[10]("terms") + ""
  ), r, i, o;
  return {
    c() {
      e = g("a"), t = g("span"), r = W(a), i = y(), o = g("span"), m(o, "class", "arrow-icon"), m(e, "class", "chests-rules__terms"), m(
        e,
        "href",
        /*terms*/
        n[0]
      ), m(e, "target", "_blank");
    },
    m(s, d) {
      Y(s, e, d), l(e, t), l(t, r), l(e, i), l(e, o);
    },
    p(s, d) {
      d[0] & /*$_*/
      1024 && a !== (a = /*$_*/
      s[10]("terms") + "") && U(r, a), d[0] & /*terms*/
      1 && m(
        e,
        "href",
        /*terms*/
        s[0]
      );
    },
    d(s) {
      s && E(e);
    }
  };
}
function Rn(n) {
  let e, t = (
    /*$_*/
    n[10]("noHistoryYet") + ""
  ), a;
  return {
    c() {
      e = g("div"), a = W(t), m(e, "class", "chests-empty");
    },
    m(r, i) {
      Y(r, e, i), l(e, a);
    },
    p(r, i) {
      i[0] & /*$_*/
      1024 && t !== (t = /*$_*/
      r[10]("noHistoryYet") + "") && U(a, t);
    },
    d(r) {
      r && E(e);
    }
  };
}
function Bn(n) {
  let e, t = ee(
    /*mysteryChestsHistory*/
    n[9]
  ), a = [];
  for (let r = 0; r < t.length; r += 1)
    a[r] = Qe(qe(n, t, r));
  return {
    c() {
      for (let r = 0; r < a.length; r += 1)
        a[r].c();
      e = ge();
    },
    m(r, i) {
      for (let o = 0; o < a.length; o += 1)
        a[o] && a[o].m(r, i);
      Y(r, e, i);
    },
    p(r, i) {
      if (i[0] & /*showMore, mysteryChestsHistory, $_*/
      17920) {
        t = ee(
          /*mysteryChestsHistory*/
          r[9]
        );
        let o;
        for (o = 0; o < t.length; o += 1) {
          const s = qe(r, t, o);
          a[o] ? a[o].p(s, i) : (a[o] = Qe(s), a[o].c(), a[o].m(e.parentNode, e));
        }
        for (; o < a.length; o += 1)
          a[o].d(1);
        a.length = t.length;
      }
    },
    d(r) {
      r && E(e), de(a, r);
    }
  };
}
function Ae(n) {
  var w, b;
  let e, t, a, r, i = (
    /*outcome*/
    ((w = n[46]) == null ? void 0 : w.name) + ""
  ), o, s, d, u, f, p, c = (
    /*outcome*/
    ((b = n[46]) == null ? void 0 : b.date) + ""
  ), v;
  return {
    c() {
      var _;
      e = g("div"), t = g("span"), t.textContent = `${/*index*/
      n[48] + 1}`, a = y(), r = g("p"), o = W(i), s = y(), d = g("img"), f = y(), p = g("span"), v = W(c), m(t, "class", "index"), pe(d.src, u = /*outcome*/
      (_ = n[46]) != null && _.state ? We : Se) || m(d, "src", u), m(d, "alt", ""), m(r, "class", "name"), m(p, "class", "time"), m(e, "class", "chests-history__list__item");
    },
    m(_, P) {
      Y(_, e, P), l(e, t), l(e, a), l(e, r), l(r, o), l(r, s), l(r, d), l(e, f), l(e, p), l(p, v);
    },
    p(_, P) {
      var M, x, D;
      P[0] & /*mysteryChestsHistory*/
      512 && i !== (i = /*outcome*/
      ((M = _[46]) == null ? void 0 : M.name) + "") && U(o, i), P[0] & /*mysteryChestsHistory*/
      512 && !pe(d.src, u = /*outcome*/
      (x = _[46]) != null && x.state ? We : Se) && m(d, "src", u), P[0] & /*mysteryChestsHistory*/
      512 && c !== (c = /*outcome*/
      ((D = _[46]) == null ? void 0 : D.date) + "") && U(v, c);
    },
    d(_) {
      _ && E(e);
    }
  };
}
function Ge(n) {
  let e, t = (
    /*$_*/
    n[10]("more") + ""
  ), a, r, i, o, s, d;
  function u() {
    return (
      /*click_handler_1*/
      n[23](
        /*history*/
        n[43]
      )
    );
  }
  return {
    c() {
      e = g("button"), a = W(t), r = y(), i = g("img"), pe(i.src, o = bt) || m(i, "src", o), m(i, "alt", "More"), m(e, "class", "chests-history__more");
    },
    m(f, p) {
      Y(f, e, p), l(e, a), l(e, r), l(e, i), s || (d = $(e, "click", u), s = !0);
    },
    p(f, p) {
      n = f, p[0] & /*$_*/
      1024 && t !== (t = /*$_*/
      n[10]("more") + "") && U(a, t);
    },
    d(f) {
      f && E(e), s = !1, d();
    }
  };
}
function Qe(n) {
  var p;
  let e, t, a = (
    /*history*/
    n[43].name + ""
  ), r, i, o, s, d = ee(
    /*history*/
    n[43].outcomes.slice(
      0,
      /*history*/
      n[43].endPos
    )
  ), u = [];
  for (let c = 0; c < d.length; c += 1)
    u[c] = Ae(Re(n, d, c));
  let f = (
    /*history*/
    ((p = n[43].outcomes) == null ? void 0 : p.length) > 3 && /*history*/
    n[43].endPos === 3 && Ge(n)
  );
  return {
    c() {
      e = g("div"), t = g("div"), r = W(a), i = y();
      for (let c = 0; c < u.length; c += 1)
        u[c].c();
      o = y(), f && f.c(), s = y(), m(t, "class", "chests-history__title"), m(e, "class", "chests-history__list");
    },
    m(c, v) {
      Y(c, e, v), l(e, t), l(t, r), l(e, i);
      for (let w = 0; w < u.length; w += 1)
        u[w] && u[w].m(e, null);
      l(e, o), f && f.m(e, null), l(e, s);
    },
    p(c, v) {
      var w;
      if (v[0] & /*mysteryChestsHistory*/
      512 && a !== (a = /*history*/
      c[43].name + "") && U(r, a), v[0] & /*mysteryChestsHistory*/
      512) {
        d = ee(
          /*history*/
          c[43].outcomes.slice(
            0,
            /*history*/
            c[43].endPos
          )
        );
        let b;
        for (b = 0; b < d.length; b += 1) {
          const _ = Re(c, d, b);
          u[b] ? u[b].p(_, v) : (u[b] = Ae(_), u[b].c(), u[b].m(e, o));
        }
        for (; b < u.length; b += 1)
          u[b].d(1);
        u.length = d.length;
      }
      /*history*/
      ((w = c[43].outcomes) == null ? void 0 : w.length) > 3 && /*history*/
      c[43].endPos === 3 ? f ? f.p(c, v) : (f = Ge(c), f.c(), f.m(e, s)) : f && (f.d(1), f = null);
    },
    d(c) {
      c && E(e), de(u, c), f && f.d();
    }
  };
}
function jn(n) {
  let e, t = (
    /*$_*/
    n[10]("noChestYet") + ""
  ), a;
  return {
    c() {
      e = g("div"), a = W(t), m(e, "class", "chests-empty");
    },
    m(r, i) {
      Y(r, e, i), l(e, a);
    },
    p(r, i) {
      i[0] & /*$_*/
      1024 && t !== (t = /*$_*/
      r[10]("noChestYet") + "") && U(a, t);
    },
    d(r) {
      r && E(e);
    }
  };
}
function In(n) {
  let e, t = ee(
    /*mysteryChests*/
    n[6]
  ), a = [];
  for (let r = 0; r < t.length; r += 1)
    a[r] = Xe(Be(n, t, r));
  return {
    c() {
      e = g("div");
      for (let r = 0; r < a.length; r += 1)
        a[r].c();
      m(e, "class", "chests-list");
    },
    m(r, i) {
      Y(r, e, i);
      for (let o = 0; o < a.length; o += 1)
        a[o] && a[o].m(e, null);
    },
    p(r, i) {
      if (i[0] & /*openChestDetails, mysteryChests, lang*/
      65602) {
        t = ee(
          /*mysteryChests*/
          r[6]
        );
        let o;
        for (o = 0; o < t.length; o += 1) {
          const s = Be(r, t, o);
          a[o] ? a[o].p(s, i) : (a[o] = Xe(s), a[o].c(), a[o].m(e, null));
        }
        for (; o < a.length; o += 1)
          a[o].d(1);
        a.length = t.length;
      }
    },
    d(r) {
      r && E(e), de(a, r);
    }
  };
}
function Xe(n) {
  var _, P;
  let e, t = (
    /*chest*/
    (n[40].program.name[
      /*lang*/
      n[1]
    ] || /*chest*/
    n[40].program.name[ue.default]) + ""
  ), a, r, i, o, s, d, u, f = (
    /*chest*/
    ((P = (_ = n[40]) == null ? void 0 : _.current) == null ? void 0 : P.remainingTimes) + ""
  ), p, c, v, w;
  function b() {
    return (
      /*click_handler*/
      n[22](
        /*chest*/
        n[40]
      )
    );
  }
  return {
    c() {
      e = g("button"), a = W(t), r = y(), i = g("div"), o = g("img"), d = y(), u = g("span"), p = W(f), c = y(), pe(o.src, s = wt) || m(o, "src", s), m(o, "alt", "Key"), m(i, "class", "chests-list__item__keys"), m(e, "class", "chests-list__item");
    },
    m(M, x) {
      Y(M, e, x), l(e, a), l(e, r), l(e, i), l(i, o), l(i, d), l(i, u), l(u, p), l(e, c), v || (w = $(e, "click", b), v = !0);
    },
    p(M, x) {
      var D, N;
      n = M, x[0] & /*mysteryChests, lang*/
      66 && t !== (t = /*chest*/
      (n[40].program.name[
        /*lang*/
        n[1]
      ] || /*chest*/
      n[40].program.name[ue.default]) + "") && U(a, t), x[0] & /*mysteryChests*/
      64 && f !== (f = /*chest*/
      ((N = (D = n[40]) == null ? void 0 : D.current) == null ? void 0 : N.remainingTimes) + "") && U(p, f);
    },
    d(M) {
      M && E(e), v = !1, w();
    }
  };
}
function An(n) {
  let e;
  return {
    c() {
      e = g("div"), e.innerHTML = '<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> <ui-skeleton structure="text" width="50px" height="16px"></ui-skeleton>', m(e, "class", "chests-history-loader-body");
    },
    m(t, a) {
      Y(t, e, a);
    },
    p: ie,
    d(t) {
      t && E(e);
    }
  };
}
function Gn(n) {
  let e, t, a, r, i = ee([1, 2, 3]), o = [];
  for (let s = 0; s < 3; s += 1)
    o[s] = An(Ln(n, i, s));
  return {
    c() {
      e = g("div"), t = g("ui-skeleton"), a = y();
      for (let s = 0; s < 3; s += 1)
        o[s].c();
      r = y(), Pe(t, "structure", "text"), Pe(t, "height", "16px"), m(e, "class", "chests-history-loader");
    },
    m(s, d) {
      Y(s, e, d), l(e, t), l(e, a);
      for (let u = 0; u < 3; u += 1)
        o[u] && o[u].m(e, null);
      l(e, r);
    },
    p: ie,
    d(s) {
      s && E(e), de(o, s);
    }
  };
}
function Qn(n) {
  let e;
  return {
    c() {
      e = g("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, a) {
      Y(t, e, a);
    },
    p: ie,
    d(t) {
      t && E(e);
    }
  };
}
function Xn(n) {
  let e, t, a, r, i, o, s, d, u, f, p, c, v, w, b, _ = (
    /*$_*/
    n[10]("play") + ""
  ), P, M, x, D = (
    /*$_*/
    n[10]("history") + ""
  ), N, A, H, X = (
    /*$_*/
    n[10]("rules") + ""
  ), G, Q, S, q, O = (
    /*tooltip*/
    n[7] && je(n)
  );
  function K(k, F) {
    return (
      /*chestsLoading*/
      k[5] ? qn : (
        /*historyLoading*/
        k[4] ? Hn : (
          /*activeTab*/
          k[3] === 1 ? Nn : (
            /*activeTab*/
            k[3] === 2 ? Fn : En
          )
        )
      )
    );
  }
  let V = K(n), R = V(n);
  return {
    c() {
      e = g("div"), t = g("button"), a = y(), r = g("div"), O && O.c(), i = y(), o = g("div"), s = g("button"), d = y(), u = g("div"), u.textContent = "Mystery Chests", f = y(), p = g("button"), c = y(), v = g("div"), w = g("div"), b = g("button"), P = W(_), M = y(), x = g("button"), N = W(D), A = y(), H = g("button"), G = W(X), Q = y(), R.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"), se(
        b,
        "active",
        /*activeTab*/
        n[3] === 1
      ), m(x, "data-index", "2"), m(x, "class", "chests-tabs__tab"), se(
        x,
        "active",
        /*activeTab*/
        n[3] === 2
      ), m(H, "data-index", "3"), m(H, "class", "chests-tabs__tab"), se(
        H,
        "active",
        /*activeTab*/
        n[3] === 3
      ), m(w, "class", "chests-tabs__container"), m(v, "class", "chests-tabs"), m(r, "class", "drawer " + /*mobileView*/
      (n[11] ? "mobile" : "")), m(e, "part", "CustomStylingContainer");
    },
    m(k, F) {
      Y(k, e, F), l(e, t), l(e, a), l(e, r), O && O.m(r, null), l(r, i), l(r, o), l(o, s), l(o, d), l(o, u), l(o, f), l(o, p), l(r, c), l(r, v), l(v, w), l(w, b), l(b, P), l(w, M), l(w, x), l(x, N), l(w, A), l(w, H), l(H, G), l(r, Q), R.m(r, null), n[24](e), S || (q = [
        $(
          t,
          "click",
          /*onClose*/
          n[12]
        ),
        $(
          s,
          "click",
          /*showHideToolip*/
          n[13]
        ),
        $(
          p,
          "click",
          /*onClose*/
          n[12]
        ),
        $(
          b,
          "click",
          /*handleTabChange*/
          n[15]
        ),
        $(
          x,
          "click",
          /*handleTabChange*/
          n[15]
        ),
        $(
          H,
          "click",
          /*handleTabChange*/
          n[15]
        )
      ], S = !0);
    },
    p(k, F) {
      /*tooltip*/
      k[7] ? O ? O.p(k, F) : (O = je(k), O.c(), O.m(r, i)) : O && (O.d(1), O = null), F[0] & /*$_*/
      1024 && _ !== (_ = /*$_*/
      k[10]("play") + "") && U(P, _), F[0] & /*activeTab*/
      8 && se(
        b,
        "active",
        /*activeTab*/
        k[3] === 1
      ), F[0] & /*$_*/
      1024 && D !== (D = /*$_*/
      k[10]("history") + "") && U(N, D), F[0] & /*activeTab*/
      8 && se(
        x,
        "active",
        /*activeTab*/
        k[3] === 2
      ), F[0] & /*$_*/
      1024 && X !== (X = /*$_*/
      k[10]("rules") + "") && U(G, X), F[0] & /*activeTab*/
      8 && se(
        H,
        "active",
        /*activeTab*/
        k[3] === 3
      ), V === (V = K(k)) && R ? R.p(k, F) : (R.d(1), R = V(k), R && (R.c(), R.m(r, null)));
    },
    i: ie,
    o: ie,
    d(k) {
      k && E(e), O && O.d(), R.d(), n[24](null), S = !1, ft(q);
    }
  };
}
function Vn(n, e, t) {
  let a;
  mt(n, vt, (h) => t(10, a = h));
  let { terms: r = "" } = e, { lang: i = ue.en } = e, { endpoint: o = "" } = e, { session: s = "" } = e, { clientstyling: d = "" } = e, { clientstylingurl: u = "" } = e, { translationurl: f = "" } = e, p = window.navigator.userAgent, c = ht(p), v, w = 1, b = !1, _ = !1, P = [], M = !1, x = !1, D;
  const N = (h) => /(https?:\/\/[^\s]+)/g.test(h), A = () => {
    De({ type: "CloseMysteryChestDrawer" });
  }, H = () => {
    t(7, M = !M);
  }, X = () => Z(this, null, function* () {
    t(4, b = !0);
    let h = P.map((T) => ({
      id: T.program.id,
      name: T.program.name[i] || T.program.name[ue.default],
      partitions: T.program.wheelOfFortune.partitions,
      endPos: 0,
      outcomes: []
    }));
    if (h.length > 0) {
      const T = h.map((L, te) => Z(this, null, function* () {
        const z = (yield Fe.outcome(o, s, L == null ? void 0 : L.id)).items || [];
        if (z.length === 0) {
          h[te] = null;
          return;
        }
        h[te] = Oe(ye({}, L), {
          endPos: z.length > 3 ? 3 : z.length,
          outcomes: z.map((B) => {
            var ke;
            const Ce = ((ke = L.partitions[B.draw.result.wheelOfFortunePartitionIndex]) == null ? void 0 : ke.name) || {}, Ke = B.draw.state === "fulfilled", $e = Mn(new Date(B.draw.time), "LLL d, yyyy HH:mm:ss");
            return {
              name: Ce[i] || Ce[ue.default],
              state: Ke,
              date: $e
            };
          })
        });
      }));
      yield Promise.all(T);
    }
    t(9, D = h.filter((T) => !!T)), t(4, b = !1);
  }), G = () => Z(this, null, function* () {
    t(5, _ = !0);
    const h = yield Fe.lotteries(o, s);
    t(6, P = h.filter((T) => Sn(T))), t(5, _ = !1);
  }), Q = (h) => {
    var L;
    const T = D.findIndex((te) => te.id === h);
    t(9, D[T].endPos = (L = D[T].outcomes) == null ? void 0 : L.length, D);
  }, S = (h) => Z(this, null, function* () {
    t(3, w = +h.target.getAttribute("data-index")), w === 2 && (yield X());
  }), q = () => {
    let h = document.createElement("style");
    h.innerHTML = d, v.appendChild(h);
  }, O = () => {
    let h = new URL(u), T = document.createElement("style");
    fetch(h.href).then((L) => L.text()).then((L) => {
      T.innerHTML = L, setTimeout(
        () => {
          v.appendChild(T);
        },
        1
      );
    });
  }, K = () => {
    fetch(f).then((T) => T.json()).then((T) => {
      Object.keys(T).forEach((L) => {
        Ne(L, T[L]);
      });
    });
  };
  Object.keys(He).forEach((h) => {
    Ne(h, He[h]);
  });
  const V = () => {
    Wn(i);
  }, R = (h) => {
    De({
      type: "OpenMysteryChestDetails",
      data: h
    });
  };
  gt(() => {
    t(8, x = N(r)), G();
  });
  const k = (h) => {
    R(h);
  }, F = (h) => Q(h.id);
  function ce(h) {
    pt[h ? "unshift" : "push"](() => {
      v = h, t(2, v);
    });
  }
  return n.$$set = (h) => {
    "terms" in h && t(0, r = h.terms), "lang" in h && t(1, i = h.lang), "endpoint" in h && t(17, o = h.endpoint), "session" in h && t(18, s = h.session), "clientstyling" in h && t(19, d = h.clientstyling), "clientstylingurl" in h && t(20, u = h.clientstylingurl), "translationurl" in h && t(21, f = h.translationurl);
  }, n.$$.update = () => {
    n.$$.dirty[0] & /*lang*/
    2 && i && V(), n.$$.dirty[0] & /*clientstyling, customStylingContainer*/
    524292 && d && v && q(), n.$$.dirty[0] & /*clientstylingurl, customStylingContainer*/
    1048580 && u && v && O(), n.$$.dirty[0] & /*translationurl*/
    2097152 && f && K();
  }, [
    r,
    i,
    v,
    w,
    b,
    _,
    P,
    M,
    x,
    D,
    a,
    c,
    A,
    H,
    Q,
    S,
    R,
    o,
    s,
    d,
    u,
    f,
    k,
    F,
    ce
  ];
}
class Zn extends st {
  constructor(e) {
    super(), lt(
      this,
      e,
      Vn,
      Xn,
      dt,
      {
        terms: 0,
        lang: 1,
        endpoint: 17,
        session: 18,
        clientstyling: 19,
        clientstylingurl: 20,
        translationurl: 21
      },
      Un,
      [-1, -1]
    );
  }
  get terms() {
    return this.$$.ctx[0];
  }
  set terms(e) {
    this.$$set({ terms: e }), re();
  }
  get lang() {
    return this.$$.ctx[1];
  }
  set lang(e) {
    this.$$set({ lang: e }), re();
  }
  get endpoint() {
    return this.$$.ctx[17];
  }
  set endpoint(e) {
    this.$$set({ endpoint: e }), re();
  }
  get session() {
    return this.$$.ctx[18];
  }
  set session(e) {
    this.$$set({ session: e }), re();
  }
  get clientstyling() {
    return this.$$.ctx[19];
  }
  set clientstyling(e) {
    this.$$set({ clientstyling: e }), re();
  }
  get clientstylingurl() {
    return this.$$.ctx[20];
  }
  set clientstylingurl(e) {
    this.$$set({ clientstylingurl: e }), re();
  }
  get translationurl() {
    return this.$$.ctx[21];
  }
  set translationurl(e) {
    this.$$set({ translationurl: e }), re();
  }
}
ut(Zn, { terms: {}, lang: {}, endpoint: {}, session: {}, clientstyling: {}, clientstylingurl: {}, translationurl: {} }, [], [], !0);
export {
  Zn as default
};
