@fasttrack-solutions/rewards 1.44.2-beta.0 → 1.46.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3336,7 +3336,7 @@ function fs() {
3336
3336
  }
3337
3337
  //#endregion
3338
3338
  //#region src/version.ts
3339
- var ps = "1.44.2-beta.0", ms = "graphql-caller", hs = "/rewards-graphql-api/query", gs = !1;
3339
+ var ps = "1.46.1-beta.0", ms = "graphql-caller", hs = "/rewards-graphql-api/query", gs = !1;
3340
3340
  function _s(e) {
3341
3341
  gs = e;
3342
3342
  }
@@ -3442,7 +3442,7 @@ async function W(e, t, n) {
3442
3442
  kind: "API_FAILURE",
3443
3443
  operation: n
3444
3444
  }), e;
3445
- await og(200 * 2 ** (c - 1));
3445
+ await pg(200 * 2 ** (c - 1));
3446
3446
  }
3447
3447
  }
3448
3448
  throw Error("safeFetch failed unexpectedly");
@@ -7278,7 +7278,7 @@ var Tf = rs("tournament", () => {
7278
7278
  try {
7279
7279
  n.value = await ld();
7280
7280
  } catch (e) {
7281
- Hh(e, "loadTournaments"), t.value = !0;
7281
+ Yh(e, "loadTournaments"), t.value = !0;
7282
7282
  } finally {
7283
7283
  e.value = !1;
7284
7284
  }
@@ -7517,7 +7517,7 @@ var Tf = rs("tournament", () => {
7517
7517
  };
7518
7518
  let t = Mf({
7519
7519
  ...e,
7520
- excludeAutoClaimedChallenges: e.excludeAutoClaimedChallenges ?? Vh().playerHistoryHideAutoClaimedChallenges
7520
+ excludeAutoClaimedChallenges: e.excludeAutoClaimedChallenges ?? Jh().playerHistoryHideAutoClaimedChallenges
7521
7521
  }), n = Z(X.supportHiddenChallengeBonusHistory), r = Z(X.supportBonusTermsAcceptance), i = `
7522
7522
  query GetPlayerBonusHistory {
7523
7523
  getPlayerBonusHistory${t} {
@@ -7669,7 +7669,7 @@ var Tf = rs("tournament", () => {
7669
7669
  ], If = rs("playerBonusHistory", () => {
7670
7670
  let e = /* @__PURE__ */ B([]), t = /* @__PURE__ */ B(0), n = /* @__PURE__ */ B({}), r = /* @__PURE__ */ B(Pf), i = /* @__PURE__ */ B(1), a = /* @__PURE__ */ B(!1), o = /* @__PURE__ */ B(!1), s = /* @__PURE__ */ B(null), c = 0, l = /* @__PURE__ */ B([]);
7671
7671
  function u() {
7672
- let n = Vh().playerHistoryHideAutoClaimedChallenges ? l.value.filter((e) => !(e.Type === "challenge" && e.autoClaimed)) : l.value;
7672
+ let n = Jh().playerHistoryHideAutoClaimedChallenges ? l.value.filter((e) => !(e.Type === "challenge" && e.autoClaimed)) : l.value;
7673
7673
  e.value = n, t.value = n.length, i.value = 1, a.value = !1, s.value = null;
7674
7674
  }
7675
7675
  let d = U(() => e.value.length < t.value), f = U(() => !a.value && !s.value && e.value.length === 0), p = U(() => Math.max(1, Math.ceil(t.value / r.value)));
@@ -7753,7 +7753,7 @@ var Tf = rs("tournament", () => {
7753
7753
  function y() {
7754
7754
  e.value = [], t.value = 0, n.value = {}, a.value = !1, o.value = !1, s.value = null, i.value = 1;
7755
7755
  }
7756
- ir(() => Vh().playerHistoryHideAutoClaimedChallenges, $(() => {
7756
+ ir(() => Jh().playerHistoryHideAutoClaimedChallenges, $(() => {
7757
7757
  K() && u();
7758
7758
  }));
7759
7759
  function b() {
@@ -8229,7 +8229,7 @@ var ip = 25, ap = rs("playerChallengeHistory", () => {
8229
8229
  addEventListeners: C
8230
8230
  };
8231
8231
  }), op = rs("christmasPromo2026", () => {
8232
- let { balance: e, virtualCurrencies: t, miniGames: n } = is(Vh()), r = /* @__PURE__ */ B(Date.now()), i = /* @__PURE__ */ B(null), a = /* @__PURE__ */ B(structuredClone(Hu)), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = -1e6, l = !1;
8232
+ let { balance: e, virtualCurrencies: t, miniGames: n } = is(Jh()), r = /* @__PURE__ */ B(Date.now()), i = /* @__PURE__ */ B(null), a = /* @__PURE__ */ B(structuredClone(Hu)), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = -1e6, l = !1;
8233
8233
  function u() {
8234
8234
  t.value?.some((e) => e.ID === -2026) || (t.value = [...t.value ?? [], Au]), e.value.has(-2026) || e.value.set(yu, Eu);
8235
8235
  let r = Fu.filter((e) => !n.value.some((t) => t.id === e.id));
@@ -8450,7 +8450,7 @@ function Tp() {
8450
8450
  function Ep() {
8451
8451
  if (Cp) return;
8452
8452
  Cp = !0;
8453
- let e = Vh();
8453
+ let e = Jh();
8454
8454
  window.addEventListener("hashchange", $(() => {
8455
8455
  e.enableDeepLinking && Tp();
8456
8456
  }));
@@ -8459,10 +8459,10 @@ function Dp() {
8459
8459
  Sp.test(window.location.hash) && window.history.replaceState(window.history.state, "", window.location.pathname + window.location.search);
8460
8460
  }
8461
8461
  function Op() {
8462
- wp || Vh().enableDeepLinking && (wp = !0, Tp());
8462
+ wp || Jh().enableDeepLinking && (wp = !0, Tp());
8463
8463
  }
8464
8464
  function kp(e = "init") {
8465
- Mg(), window.ftRewardsReady = !0, window.ftRewardsError = null, window.dispatchEvent(new CustomEvent("ft-rewards-ready")), window.dispatchEvent(new CustomEvent("ft-rewards-loaded")), ag(`[${e}] Ready`);
8465
+ zg(), window.ftRewardsReady = !0, window.ftRewardsError = null, window.dispatchEvent(new CustomEvent("ft-rewards-ready")), window.dispatchEvent(new CustomEvent("ft-rewards-loaded")), fg(`[${e}] Ready`);
8466
8466
  }
8467
8467
  function Ap(e, t = "init") {
8468
8468
  Q(e, {
@@ -8494,7 +8494,7 @@ function Mp(e, t) {
8494
8494
  window.ftRewardsError = n, window.dispatchEvent(new CustomEvent("ft-config-error", { detail: n }));
8495
8495
  }
8496
8496
  async function Np(e = "init") {
8497
- let t = Xu(), n = Vh(), r = Cl(), i = Tf(), a = od(), o = Of(), s = If(), c = Uf(), l = ap();
8497
+ let t = Xu(), n = Jh(), r = Cl(), i = Tf(), a = od(), o = Of(), s = If(), c = Uf(), l = ap();
8498
8498
  await new Promise((e) => setTimeout(e, 1e3));
8499
8499
  let u = (e, t) => {
8500
8500
  try {
@@ -8509,7 +8509,7 @@ async function Np(e = "init") {
8509
8509
  u("cms.addEventListeners", () => t.addEventListeners()), u("bonus.addEventListeners", () => r.addEventListeners()), u("tournament.addEventListeners", () => i.addEventListeners()), u("shop.addEventListeners", () => a.addEventListeners()), u("playerHistory.addEventListeners", () => o.addEventListeners()), u("playerBonusHistory.addEventListeners", () => s.addEventListeners()), u("playerVcHistory.addEventListeners", () => c.addEventListeners()), u("playerChallengeHistory.addEventListeners", () => l.addEventListeners()), u("loyalty.setupMock", () => n.setupMock()), u("bonus.setupMock", () => r.setupMock()), u("cms.setupMockPages", () => t.setupMockPages()), u("tournament.setupMock", () => i.setupMock()), u("shop.setupMock", () => a.setupMock()), u("playerHistory.setupMock", () => o.setupMock()), u("playerBonusHistory.setupMock", () => s.setupMock()), u("playerVcHistory.setupMock", () => c.setupMock()), u("playerChallengeHistory.setupMock", () => l.setupMock()), await In(), kp(e);
8510
8510
  }
8511
8511
  async function Pp(e = {}) {
8512
- let t = e.source || "init", n = Vh(), r = Cl(), i = Xu(), a = Ts(), o = () => a !== Ts(), { loadRewardsConfiguration: s, loadConfiguration: c, loadChallenges: l, setupSubscription: u, loadUser: d } = n, { wheelsEnabled: f } = is(n), { loadBonuses: p } = r, { loadMenu: m } = i;
8512
+ let t = e.source || "init", n = Jh(), r = Cl(), i = Xu(), a = Ts(), o = () => a !== Ts(), { loadRewardsConfiguration: s, loadConfiguration: c, loadChallenges: l, setupSubscription: u, loadUser: d } = n, { wheelsEnabled: f } = is(n), { loadBonuses: p } = r, { loadMenu: m } = i;
8513
8513
  try {
8514
8514
  let n = await s();
8515
8515
  if (o()) return gp;
@@ -8529,19 +8529,19 @@ async function Pp(e = {}) {
8529
8529
  }
8530
8530
  }
8531
8531
  function Fp() {
8532
- let e = Vh();
8532
+ let e = Jh();
8533
8533
  return () => {
8534
8534
  qs(), window.dispatchEvent(new CustomEvent("close-my-rewards")), e.logout(), window?.ftcrm?.auth && (window.ftcrm.auth.jwtToken = ""), window.ftRewardsReady = !1, window.ftRewardsError = null, ss(!1), ws(), window.dispatchEvent(new CustomEvent("ft-rewards-signed-out"));
8535
8535
  };
8536
8536
  }
8537
8537
  function Ip(e) {
8538
- return Ng(), window.ftRewardsReady ? (ss(!0), Lp()()) : jp(e), {
8538
+ return Bg(), window.ftRewardsReady ? (ss(!0), Lp()()) : jp(e), {
8539
8539
  success: !1,
8540
8540
  error: "Rewards not enabled"
8541
8541
  };
8542
8542
  }
8543
8543
  function Lp() {
8544
- let e = Vh();
8544
+ let e = Jh();
8545
8545
  return () => {
8546
8546
  cs() && (qs(), [
8547
8547
  "close-my-rewards",
@@ -8556,7 +8556,7 @@ function Rp(e) {
8556
8556
  Y("No auth object found.");
8557
8557
  return;
8558
8558
  }
8559
- window.ftcrm.auth.jwtToken = e, Mg(), !(!e || !window.ftRewardsReady) && Vh().setupSubscription().catch($((e) => {
8559
+ window.ftcrm.auth.jwtToken = e, zg(), !(!e || !window.ftRewardsReady) && Jh().setupSubscription().catch($((e) => {
8560
8560
  Q(e, {
8561
8561
  kind: "UNKNOWN",
8562
8562
  operation: "handleJwtTokenRefresh"
@@ -8565,7 +8565,7 @@ function Rp(e) {
8565
8565
  }
8566
8566
  async function zp(e = {}) {
8567
8567
  let t = e.source || "init";
8568
- ag(`[${t}] Initializing...`), window.ftRewardsError = null, Cs(), ss(!1);
8568
+ fg(`[${t}] Initializing...`), window.ftRewardsError = null, Cs(), ss(!1);
8569
8569
  let n = bp();
8570
8570
  if (!vp() && n.errors.length > 0 && n.errors.forEach((e) => Y(e)), xp(), vp()) return await Np(t), { success: !0 };
8571
8571
  if (!(window?.fasttrack?.baseUrl || window?.ftcrm?.baseApiUrl)) {
@@ -8579,7 +8579,7 @@ async function zp(e = {}) {
8579
8579
  }
8580
8580
  async function Bp(e = {}) {
8581
8581
  let t = e.source || "init";
8582
- return _p() ? (ag(`[${t}] Already initialized`), { success: !0 }) : zp(e);
8582
+ return _p() ? (fg(`[${t}] Already initialized`), { success: !0 }) : zp(e);
8583
8583
  }
8584
8584
  async function Vp(e = {}) {
8585
8585
  return zp(e);
@@ -8938,7 +8938,7 @@ function lm(e, t) {
8938
8938
  });
8939
8939
  }
8940
8940
  function um(e) {
8941
- let t = e.tiers.findIndex((t) => t.ID === e.currentLevelId), n = t >= 0 ? e.tiers[t] : void 0, r = t >= 0 ? e.tiers[t + 1] : void 0, i = r?.XP ?? n?.XP ?? 0, a = i > 0 ? sg(e.currentXp / i * 100, 0, 100) : 0;
8941
+ let t = e.tiers.findIndex((t) => t.ID === e.currentLevelId), n = t >= 0 ? e.tiers[t] : void 0, r = t >= 0 ? e.tiers[t + 1] : void 0, i = r?.XP ?? n?.XP ?? 0, a = i > 0 ? mg(e.currentXp / i * 100, 0, 100) : 0;
8942
8942
  return {
8943
8943
  ...e,
8944
8944
  currentTier: n,
@@ -8948,82 +8948,105 @@ function um(e) {
8948
8948
  };
8949
8949
  }
8950
8950
  //#endregion
8951
+ //#region src/core/utils/loyaltyDisplay.ts
8952
+ function dm(e) {
8953
+ return typeof e == "number" && e > 0 ? Math.floor(e) : 0;
8954
+ }
8955
+ var fm = ["xp.singular", "xp.plural"], pm = (e, t) => t(e, "").trim();
8956
+ function mm(e, t) {
8957
+ let n = pm("xp.singular", t), r = pm("xp.plural", t);
8958
+ return (e === 1 ? n || r : r || n) || "XP";
8959
+ }
8960
+ function hm(e, t) {
8961
+ return `${e} ${mm(e, t)}`;
8962
+ }
8963
+ function gm(e) {
8964
+ let t = (e) => e.CommunicationProfileID === -1;
8965
+ return e.some((e) => fm.includes(e.Key) && !t(e) && e.Value.trim() !== "") ? e.map((e) => fm.includes(e.Key) && t(e) ? {
8966
+ ...e,
8967
+ Value: ""
8968
+ } : e) : e;
8969
+ }
8970
+ function _m(e) {
8971
+ return e.some((e) => e.amount > 0);
8972
+ }
8973
+ //#endregion
8951
8974
  //#region src/core/types/bonus.ts
8952
- var dm = /* @__PURE__ */ function(e) {
8975
+ var vm = /* @__PURE__ */ function(e) {
8953
8976
  return e.Pending = "pending", e.Reward = "reward", e.MiniGameToken = "mini_game_token", e;
8954
- }({}), fm = [
8977
+ }({}), ym = [
8955
8978
  "created_at",
8956
8979
  "expires_at",
8957
8980
  "challenge_target_amount",
8958
8981
  "challenge_required_amount",
8959
8982
  "name"
8960
8983
  ];
8961
- function pm(e) {
8962
- return fm.includes(e) ? e : "none";
8984
+ function bm(e) {
8985
+ return ym.includes(e) ? e : "none";
8963
8986
  }
8964
- function mm(e) {
8987
+ function xm(e) {
8965
8988
  return e === "desc" ? "desc" : "asc";
8966
8989
  }
8967
- function hm(e, t) {
8990
+ function Sm(e, t) {
8968
8991
  return {
8969
8992
  groupByType: e(`${t}-group-by-type`) === "true",
8970
- primary: pm(e(`${t}-sort-primary`)),
8971
- primaryDirection: mm(e(`${t}-sort-primary-direction`)),
8972
- secondary: pm(e(`${t}-sort-secondary`)),
8973
- secondaryDirection: mm(e(`${t}-sort-secondary-direction`))
8993
+ primary: bm(e(`${t}-sort-primary`)),
8994
+ primaryDirection: xm(e(`${t}-sort-primary-direction`)),
8995
+ secondary: bm(e(`${t}-sort-secondary`)),
8996
+ secondaryDirection: xm(e(`${t}-sort-secondary-direction`))
8974
8997
  };
8975
8998
  }
8976
- function gm(e) {
8999
+ function Cm(e) {
8977
9000
  if (!e.some((e) => e.Key.startsWith("my-rewards-order") || e.Key.startsWith("my-rewards-claimable") || e.Key.startsWith("my-rewards-active"))) return null;
8978
9001
  let t = (t) => e.find((e) => e.Key === t)?.Value;
8979
9002
  return {
8980
9003
  claimableFirst: t("my-rewards-order-primary-bucket") !== "active_first",
8981
- claimable: hm(t, "my-rewards-claimable"),
8982
- active: hm(t, "my-rewards-active")
9004
+ claimable: Sm(t, "my-rewards-claimable"),
9005
+ active: Sm(t, "my-rewards-active")
8983
9006
  };
8984
9007
  }
8985
- function _m(e) {
9008
+ function wm(e) {
8986
9009
  return e ? new Date(e).getTime() : NaN;
8987
9010
  }
8988
- function vm(e, t) {
9011
+ function Tm(e, t) {
8989
9012
  switch (e.type) {
8990
- case dm.Pending: {
9013
+ case vm.Pending: {
8991
9014
  let n = e.data;
8992
- return t === "created_at" ? _m(n.CreatedAt) : t === "expires_at" ? _m(n.ExpiresAt) : t === "challenge_required_amount" ? n.ChallengeRequiredAmount ?? NaN : n.ChallengeTargetAmount ?? NaN;
9015
+ return t === "created_at" ? wm(n.CreatedAt) : t === "expires_at" ? wm(n.ExpiresAt) : t === "challenge_required_amount" ? n.ChallengeRequiredAmount ?? NaN : n.ChallengeTargetAmount ?? NaN;
8993
9016
  }
8994
- case dm.MiniGameToken: {
9017
+ case vm.MiniGameToken: {
8995
9018
  let n = e.data;
8996
- return t === "created_at" ? _m(n.CreatedAt) : t === "expires_at" ? _m(n.ExpireDate) : NaN;
9019
+ return t === "created_at" ? wm(n.CreatedAt) : t === "expires_at" ? wm(n.ExpireDate) : NaN;
8997
9020
  }
8998
- case dm.Reward: {
9021
+ case vm.Reward: {
8999
9022
  let n = e.data;
9000
- if (t === "created_at") return _m(n.CreatedAt);
9001
- if (t === "expires_at") return _m(n.ExpiresAt);
9023
+ if (t === "created_at") return wm(n.CreatedAt);
9024
+ if (t === "expires_at") return wm(n.ExpiresAt);
9002
9025
  let r = Zc(n);
9003
9026
  return t === "challenge_required_amount" ? r?.RequirementAmount ?? NaN : r?.Amount ?? NaN;
9004
9027
  }
9005
9028
  default: return NaN;
9006
9029
  }
9007
9030
  }
9008
- function ym(e, t) {
9031
+ function Em(e, t) {
9009
9032
  switch (e.type) {
9010
- case dm.Pending: return e.data.Title ?? "";
9011
- case dm.Reward: {
9033
+ case vm.Pending: return e.data.Title ?? "";
9034
+ case vm.Reward: {
9012
9035
  let t = e.data;
9013
9036
  return t.Appearance?.TitleAvailable || t.Name || "";
9014
9037
  }
9015
- case dm.MiniGameToken: return t.tokenName?.(e.data.WheelID) ?? "";
9038
+ case vm.MiniGameToken: return t.tokenName?.(e.data.WheelID) ?? "";
9016
9039
  default: return "";
9017
9040
  }
9018
9041
  }
9019
- var bm = {
9042
+ var Dm = {
9020
9043
  generic: 0,
9021
9044
  funds: 1,
9022
9045
  virtual_currency: 2,
9023
9046
  challenge: 3,
9024
9047
  wheel: 4,
9025
9048
  pick_and_win: 4
9026
- }, xm = 5, Sm = 99, Cm = {
9049
+ }, Om = 5, km = 99, Am = {
9027
9050
  wager: 0,
9028
9051
  big_win_multiplier: 1,
9029
9052
  casino_count: 2,
@@ -9034,19 +9057,19 @@ var bm = {
9034
9057
  sports_win: 7,
9035
9058
  sports_bet_get: 8
9036
9059
  };
9037
- function wm(e) {
9038
- if (e.type === dm.Pending) {
9039
- let t = bm[e.data.Type ?? ""] ?? Sm;
9060
+ function jm(e) {
9061
+ if (e.type === vm.Pending) {
9062
+ let t = Dm[e.data.Type ?? ""] ?? km;
9040
9063
  return String(t).padStart(2, "0");
9041
9064
  }
9042
- if (e.type === dm.MiniGameToken) return String(xm).padStart(2, "0");
9043
- let t = Cm[Zc(e.data)?.RequirementType ?? ""] ?? Sm;
9065
+ if (e.type === vm.MiniGameToken) return String(Om).padStart(2, "0");
9066
+ let t = Am[Zc(e.data)?.RequirementType ?? ""] ?? km;
9044
9067
  return String(t).padStart(2, "0");
9045
9068
  }
9046
- function Tm(e) {
9047
- return e.type === dm.Pending ? e.data.UserBonusId ?? 0 : e.type === dm.MiniGameToken ? e.data.TokenID : e.data.ChallengeUserID;
9069
+ function Mm(e) {
9070
+ return e.type === vm.Pending ? e.data.UserBonusId ?? 0 : e.type === vm.MiniGameToken ? e.data.TokenID : e.data.ChallengeUserID;
9048
9071
  }
9049
- function Em(e, t, n, r, i) {
9072
+ function Nm(e, t, n, r, i) {
9050
9073
  if (n === "name") {
9051
9074
  let n = i(e), a = i(t);
9052
9075
  if (!n && !a) return 0;
@@ -9055,18 +9078,18 @@ function Em(e, t, n, r, i) {
9055
9078
  let o = n.localeCompare(a, void 0, { sensitivity: "base" });
9056
9079
  return r === "desc" ? -o : o;
9057
9080
  }
9058
- let a = vm(e, n), o = vm(t, n), s = Number.isNaN(a), c = Number.isNaN(o);
9081
+ let a = Tm(e, n), o = Tm(t, n), s = Number.isNaN(a), c = Number.isNaN(o);
9059
9082
  if (s && c) return 0;
9060
9083
  if (s) return 1;
9061
9084
  if (c) return -1;
9062
9085
  let l = a - o;
9063
9086
  return r === "desc" ? -l : l;
9064
9087
  }
9065
- function Dm(e) {
9088
+ function Pm(e) {
9066
9089
  return !e.groupByType && e.primary === "none" && e.secondary === "none";
9067
9090
  }
9068
- function Om(e, t, n) {
9069
- if (Dm(t)) return e;
9091
+ function Fm(e, t, n) {
9092
+ if (Pm(t)) return e;
9070
9093
  let r = [];
9071
9094
  t.primary !== "none" && r.push({
9072
9095
  key: t.primary,
@@ -9077,147 +9100,147 @@ function Om(e, t, n) {
9077
9100
  });
9078
9101
  let i = /* @__PURE__ */ new Map(), a = (e) => {
9079
9102
  let t = i.get(e);
9080
- return t === void 0 && (t = ym(e, n), i.set(e, t)), t;
9103
+ return t === void 0 && (t = Em(e, n), i.set(e, t)), t;
9081
9104
  };
9082
9105
  return [...e].sort((e, n) => {
9083
9106
  if (t.groupByType) {
9084
- let t = wm(e), r = wm(n);
9107
+ let t = jm(e), r = jm(n);
9085
9108
  if (t !== r) return t < r ? -1 : 1;
9086
9109
  }
9087
9110
  for (let { key: t, direction: i } of r) {
9088
- let r = Em(e, n, t, i, a);
9111
+ let r = Nm(e, n, t, i, a);
9089
9112
  if (r !== 0) return r;
9090
9113
  }
9091
- let i = Tm(e) - Tm(n);
9114
+ let i = Mm(e) - Mm(n);
9092
9115
  return i === 0 ? e.key < n.key ? -1 : +(e.key > n.key) : i;
9093
9116
  });
9094
9117
  }
9095
- function km(e, t, n = {}) {
9096
- if (!t || t.claimableFirst && Dm(t.claimable) && Dm(t.active)) return e;
9097
- let r = e.filter((e) => e.type === dm.Pending || e.type === dm.MiniGameToken), i = e.filter((e) => e.type === dm.Reward), a = Om(r, t.claimable, n), o = Om(i, t.active, n);
9118
+ function Im(e, t, n = {}) {
9119
+ if (!t || t.claimableFirst && Pm(t.claimable) && Pm(t.active)) return e;
9120
+ let r = e.filter((e) => e.type === vm.Pending || e.type === vm.MiniGameToken), i = e.filter((e) => e.type === vm.Reward), a = Fm(r, t.claimable, n), o = Fm(i, t.active, n);
9098
9121
  return t.claimableFirst ? [...a, ...o] : [...o, ...a];
9099
9122
  }
9100
9123
  //#endregion
9101
9124
  //#region src/core/utils/formatVcBalance.ts
9102
- function Am(e) {
9125
+ function Lm(e) {
9103
9126
  return Math.abs(Math.ceil(e)).toLocaleString(void 0, { minimumFractionDigits: 0 });
9104
9127
  }
9105
9128
  //#endregion
9106
9129
  //#region src/core/utils/rewardsFieldTokens.ts
9107
- var jm = /\{\{\s*([A-Za-z_]+)\s*:\s*([A-Za-z0-9_-]{1,32})\s*\}\}/g, Mm = /^\d+$/, Nm = 1234, Pm = 620, Fm = 5, Im = 7, Lm = new Set([
9130
+ var Rm = /\{\{\s*([A-Za-z_]+)\s*:\s*([A-Za-z0-9_-]{1,32})\s*\}\}/g, zm = /^\d+$/, Bm = 1234, Vm = 620, Hm = 5, Um = 7, Wm = new Set([
9108
9131
  "tournament_score",
9109
9132
  "tournament_position",
9110
9133
  "tournament_participants"
9111
- ]), Rm = /[\s"'()<>\\{}]/, zm = {
9134
+ ]), Gm = /[\s"'()<>\\{}]/, Km = {
9112
9135
  "&": "&amp;",
9113
9136
  "<": "&lt;",
9114
9137
  ">": "&gt;",
9115
9138
  "\"": "&quot;",
9116
9139
  "'": "&#39;"
9117
9140
  };
9118
- function Bm(e) {
9141
+ function qm(e) {
9119
9142
  return typeof e == "number" && Number.isFinite(e);
9120
9143
  }
9121
- function Vm(e) {
9122
- return Mm.test(e) ? Number(e) : void 0;
9144
+ function Jm(e) {
9145
+ return zm.test(e) ? Number(e) : void 0;
9123
9146
  }
9124
- function Hm(e, t) {
9147
+ function Ym(e, t) {
9125
9148
  return e === void 0 ? void 0 : t.virtualCurrencies.find((t) => Number(t.ID) === e);
9126
9149
  }
9127
- function Um(e) {
9128
- return e.replace(/[&<>"']/g, (e) => zm[e] ?? e);
9150
+ function Xm(e) {
9151
+ return e.replace(/[&<>"']/g, (e) => Km[e] ?? e);
9129
9152
  }
9130
- function Wm(e) {
9153
+ function Zm(e) {
9131
9154
  let t = e.charCodeAt(0);
9132
9155
  return t < 128 ? `%${t.toString(16).toUpperCase().padStart(2, "0")}` : encodeURIComponent(e);
9133
9156
  }
9134
- function Gm(e) {
9157
+ function Qm(e) {
9135
9158
  let t = "";
9136
9159
  for (let n of e) {
9137
9160
  let e = n.charCodeAt(0);
9138
- e < 32 || e === 127 || Rm.test(n) ? t += Wm(n) : n === "&" ? t += "&amp;" : t += n;
9161
+ e < 32 || e === 127 || Gm.test(n) ? t += Zm(n) : n === "&" ? t += "&amp;" : t += n;
9139
9162
  }
9140
9163
  return t;
9141
9164
  }
9142
- function Km(e, t) {
9143
- let n = Vm(e);
9165
+ function $m(e, t) {
9166
+ let n = Jm(e);
9144
9167
  if (t.preview) {
9145
9168
  let e = n === void 0 ? void 0 : t.balance.get(n);
9146
- return Um(Am(Bm(e) ? e : Nm));
9169
+ return Xm(Lm(qm(e) ? e : Bm));
9147
9170
  }
9148
- if (!t.virtualCurrenciesEnabled || n === void 0 || !Hm(n, t)) return "";
9171
+ if (!t.virtualCurrenciesEnabled || n === void 0 || !Ym(n, t)) return "";
9149
9172
  let r = t.balance.get(n);
9150
- return Bm(r) ? Um(Am(r)) : "";
9173
+ return qm(r) ? Xm(Lm(r)) : "";
9151
9174
  }
9152
- function qm(e, t) {
9153
- let n = Hm(Vm(e), t);
9154
- return t.preview ? Gm(n?.ImageURL || t.virtualCurrencies[0]?.ImageURL || "") : t.virtualCurrenciesEnabled ? Gm(n?.ImageURL ?? "") : "";
9175
+ function eh(e, t) {
9176
+ let n = Ym(Jm(e), t);
9177
+ return t.preview ? Qm(n?.ImageURL || t.virtualCurrencies[0]?.ImageURL || "") : t.virtualCurrenciesEnabled ? Qm(n?.ImageURL ?? "") : "";
9155
9178
  }
9156
- var Jm = 2 ** 31 - 1;
9157
- function Ym(e) {
9158
- return Number.isInteger(e) && e > 0 && e <= Jm;
9179
+ var th = 2 ** 31 - 1;
9180
+ function nh(e) {
9181
+ return Number.isInteger(e) && e > 0 && e <= th;
9159
9182
  }
9160
- function Xm(e) {
9161
- let t = Vm(e);
9162
- return t !== void 0 && Ym(t) ? t : void 0;
9183
+ function rh(e) {
9184
+ let t = Jm(e);
9185
+ return t !== void 0 && nh(t) ? t : void 0;
9163
9186
  }
9164
- function Zm(e, t) {
9165
- let n = Xm(e), r = n === void 0 ? void 0 : t.tournamentStats.get(n);
9187
+ function ih(e, t) {
9188
+ let n = rh(e), r = n === void 0 ? void 0 : t.tournamentStats.get(n);
9166
9189
  return r?.instanceID == null ? void 0 : r;
9167
9190
  }
9168
- function Qm(e, t) {
9169
- if (t.preview) return Xm(e) === void 0 ? "" : String(Pm);
9170
- let n = Zm(e, t);
9171
- return !n || !Bm(n.score) ? "" : Um(lg(n.score, n.leaderboardDecimalPlaces));
9172
- }
9173
- function $m(e, t) {
9174
- if (t.preview) return Xm(e) === void 0 ? "" : String(Fm);
9175
- let n = Zm(e, t)?.position;
9176
- return Bm(n) ? Um(String(n)) : "";
9177
- }
9178
- function eh(e, t) {
9179
- if (t.preview) return Xm(e) === void 0 ? "" : String(Im);
9180
- let n = Zm(e, t)?.totalParticipants;
9181
- return Bm(n) ? Um(String(n)) : "";
9182
- }
9183
- var th = new Map([
9184
- ["vc_balance", Km],
9185
- ["vc_icon", qm],
9186
- ["tournament_score", Qm],
9187
- ["tournament_position", $m],
9188
- ["tournament_participants", eh]
9191
+ function ah(e, t) {
9192
+ if (t.preview) return rh(e) === void 0 ? "" : String(Vm);
9193
+ let n = ih(e, t);
9194
+ return !n || !qm(n.score) ? "" : Xm(gg(n.score, n.leaderboardDecimalPlaces));
9195
+ }
9196
+ function oh(e, t) {
9197
+ if (t.preview) return rh(e) === void 0 ? "" : String(Hm);
9198
+ let n = ih(e, t)?.position;
9199
+ return qm(n) ? Xm(String(n)) : "";
9200
+ }
9201
+ function sh(e, t) {
9202
+ if (t.preview) return rh(e) === void 0 ? "" : String(Um);
9203
+ let n = ih(e, t)?.totalParticipants;
9204
+ return qm(n) ? Xm(String(n)) : "";
9205
+ }
9206
+ var ch = new Map([
9207
+ ["vc_balance", $m],
9208
+ ["vc_icon", eh],
9209
+ ["tournament_score", ah],
9210
+ ["tournament_position", oh],
9211
+ ["tournament_participants", sh]
9189
9212
  ]);
9190
- function nh(e) {
9213
+ function lh(e) {
9191
9214
  if (!e || !e.includes("{{")) return [];
9192
9215
  let t = /* @__PURE__ */ new Set();
9193
- for (let [, n = "", r = ""] of e.matchAll(jm)) {
9194
- if (!Lm.has(n.toLowerCase())) continue;
9195
- let e = Xm(r);
9216
+ for (let [, n = "", r = ""] of e.matchAll(Rm)) {
9217
+ if (!Wm.has(n.toLowerCase())) continue;
9218
+ let e = rh(r);
9196
9219
  e !== void 0 && t.add(e);
9197
9220
  }
9198
9221
  return [...t];
9199
9222
  }
9200
- function rh(e, t) {
9201
- return !e || !e.includes("{{") ? e : e.replace(jm, (e, n, r) => {
9202
- let i = th.get(n.toLowerCase());
9223
+ function uh(e, t) {
9224
+ return !e || !e.includes("{{") ? e : e.replace(Rm, (e, n, r) => {
9225
+ let i = ch.get(n.toLowerCase());
9203
9226
  return i ? i(r, t) : e;
9204
9227
  });
9205
9228
  }
9206
9229
  //#endregion
9207
9230
  //#region src/core/stores/tournamentFieldStats.ts
9208
- var ih = 15e3, ah = 6e4, oh = 5 * 6e4, sh = 1e3, ch = 2e3, lh = .1;
9209
- function uh(e) {
9231
+ var dh = 15e3, fh = 6e4, ph = 5 * 6e4, mh = 1e3, hh = 2e3, gh = .1;
9232
+ function _h(e) {
9210
9233
  if (!e) return;
9211
9234
  let t = Date.parse(e);
9212
9235
  return Number.isFinite(t) ? t : void 0;
9213
9236
  }
9214
- var dh = rs("tournamentFieldStats", () => {
9215
- let e = Vh(), t = /* @__PURE__ */ B(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = 0, a = /* @__PURE__ */ new Map(), o, s, c = 0, l, u = 0, d = !1;
9237
+ var vh = rs("tournamentFieldStats", () => {
9238
+ let e = Jh(), t = /* @__PURE__ */ B(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = 0, a = /* @__PURE__ */ new Map(), o, s, c = 0, l, u = 0, d = !1;
9216
9239
  function f(e) {
9217
9240
  if (K()) return;
9218
9241
  let t = [];
9219
9242
  for (let r of e) {
9220
- if (!Ym(r)) continue;
9243
+ if (!nh(r)) continue;
9221
9244
  let e = n.get(r) ?? 0;
9222
9245
  n.set(r, e + 1), e === 0 && t.push(r);
9223
9246
  }
@@ -9288,13 +9311,13 @@ var dh = rs("tournamentFieldStats", () => {
9288
9311
  for (let a of n.keys()) {
9289
9312
  let n = t.value.get(a);
9290
9313
  if (!n || n.instanceID == null) continue;
9291
- let o = uh(n.startDate), s = uh(n.endDate);
9314
+ let o = _h(n.startDate), s = _h(n.endDate);
9292
9315
  o !== void 0 && s !== void 0 && o <= e && e < s && (r = !0);
9293
9316
  for (let t of [o, s]) t !== void 0 && t > e && (i === void 0 || t < i) && (i = t);
9294
9317
  }
9295
- let a = Math.min((r ? ih : ah) * 2 ** c, oh) * (1 + lh * (2 * Math.random() - 1));
9318
+ let a = Math.min((r ? dh : fh) * 2 ** c, ph) * (1 + gh * (2 * Math.random() - 1));
9296
9319
  if (!c && i !== void 0) {
9297
- let t = sh + Math.random() * ch;
9320
+ let t = mh + Math.random() * hh;
9298
9321
  a = Math.min(a, i + t - e);
9299
9322
  }
9300
9323
  o = setTimeout($(v), Math.max(0, Math.round(a)));
@@ -9333,17 +9356,17 @@ var dh = rs("tournamentFieldStats", () => {
9333
9356
  refresh: m,
9334
9357
  reset: T
9335
9358
  };
9336
- }), fh = 3e3;
9337
- function ph(e) {
9359
+ }), yh = 3e3;
9360
+ function bh(e) {
9338
9361
  return e?.kind === "milestone_reached" && G(e.milestone_id);
9339
9362
  }
9340
- function mh(e) {
9363
+ function xh(e) {
9341
9364
  return e?.kind === "task_completed" && G(e.user_task_id);
9342
9365
  }
9343
- function hh(e, t) {
9366
+ function Sh(e, t) {
9344
9367
  return e.flatMap((e) => Array.isArray(e.rewards) ? e.rewards : []).filter((e) => !G(e?.user_bonus_id) || !t(e.user_bonus_id)).map((e) => typeof e?.title == "string" && e.title.trim() !== "" ? e.title : null);
9345
9368
  }
9346
- function gh(e, t) {
9369
+ function Ch(e, t) {
9347
9370
  if (Array.isArray(e.rewards) && e.rewards.length > 0) return !0;
9348
9371
  for (let n of t?.Tasks ?? []) {
9349
9372
  if (G(e.user_task_id) && n.UserTaskID !== e.user_task_id) continue;
@@ -9352,10 +9375,10 @@ function gh(e, t) {
9352
9375
  }
9353
9376
  return !1;
9354
9377
  }
9355
- function _h(e) {
9378
+ function wh(e) {
9356
9379
  return (Array.isArray(e.rewards) ? e.rewards : []).map((e) => e?.user_bonus_id).filter(G);
9357
9380
  }
9358
- function vh() {
9381
+ function Th() {
9359
9382
  let e = /* @__PURE__ */ new Map(), t = () => {
9360
9383
  let t = Date.now();
9361
9384
  e.forEach((n, r) => {
@@ -9383,8 +9406,8 @@ function vh() {
9383
9406
  }
9384
9407
  };
9385
9408
  }
9386
- function yh(e) {
9387
- let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = vh(), o = vh(), s = /* @__PURE__ */ new Map();
9409
+ function Eh(e) {
9410
+ let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = Th(), o = Th(), s = /* @__PURE__ */ new Map();
9388
9411
  function c(e, t) {
9389
9412
  s.delete(e), o.set(e, t());
9390
9413
  }
@@ -9403,10 +9426,10 @@ function yh(e) {
9403
9426
  let d = (e) => o.get(e) === !0;
9404
9427
  function f(t, n) {
9405
9428
  if (t.TaskDoneToast !== !0) return;
9406
- let r = _h(n), a = {
9429
+ let r = wh(n), a = {
9407
9430
  userTaskId: n.user_task_id,
9408
9431
  sequence: G(n.task_sequence) ? n.task_sequence : void 0,
9409
- rewards: hh([n], d)
9432
+ rewards: Sh([n], d)
9410
9433
  }, o = i.get(t.ChallengeUserID);
9411
9434
  if (i.delete(t.ChallengeUserID), o && Date.now() - o.at <= 3e3 && o.userTaskIds.has(n.user_task_id)) {
9412
9435
  let n = o.record, i = {
@@ -9467,22 +9490,22 @@ function yh(e) {
9467
9490
  function h(n) {
9468
9491
  let r = n?.user_challenge_id;
9469
9492
  if (!G(r) || !Array.isArray(n?.entries)) return !1;
9470
- let a = n.entries.filter(mh);
9493
+ let a = n.entries.filter(xh);
9471
9494
  a.length && p(r, a);
9472
- let s = n.entries.filter(ph);
9495
+ let s = n.entries.filter(bh);
9473
9496
  if (s.length === 0) return !1;
9474
9497
  let c = e.challenges().find((e) => e.ChallengeUserID === r), f = [], m = !1;
9475
9498
  for (let n of s) {
9476
9499
  G(n.user_task_id) && e.markReached(r, n.user_task_id, n.milestone_id);
9477
9500
  let i = Fc(r, n.milestone_id);
9478
- if (t.has(i) || (t.add(i), Array.isArray(n.rewards) && n.rewards.length > 0 && (m = !0), !gh(n, c))) continue;
9479
- let a = _h(n);
9501
+ if (t.has(i) || (t.add(i), Array.isArray(n.rewards) && n.rewards.length > 0 && (m = !0), !Ch(n, c))) continue;
9502
+ let a = wh(n);
9480
9503
  a.length > 0 && a.every((e) => o.get(e) === !0) || f.push(n);
9481
9504
  }
9482
- let h = s.flatMap(_h), g = (e) => e.filter((e) => o.get(e) !== !0), _ = f.reduce((e, t) => !e || (t.threshold ?? 0) >= (e.threshold ?? 0) ? t : e, void 0), v = _ && {
9505
+ let h = s.flatMap(wh), g = (e) => e.filter((e) => o.get(e) !== !0), _ = f.reduce((e, t) => !e || (t.threshold ?? 0) >= (e.threshold ?? 0) ? t : e, void 0), v = _ && {
9483
9506
  challenge: c,
9484
- bonus: e.findClaimableBonus(g(_h(_))) ?? e.findClaimableBonus(g(h)),
9485
- rewards: hh(f, d)
9507
+ bonus: e.findClaimableBonus(g(wh(_))) ?? e.findClaimableBonus(g(h)),
9508
+ rewards: Sh(f, d)
9486
9509
  };
9487
9510
  if (!v || !e.showMilestoneToast(v) || !e.isToastEnabled()) return e.isToastEnabled() || l(h), m;
9488
9511
  if (Jc(c) && c?.TaskDoneToast === !0) {
@@ -9532,7 +9555,7 @@ function yh(e) {
9532
9555
  return;
9533
9556
  }
9534
9557
  c(r, n);
9535
- }), fh), s.set(r, l);
9558
+ }), yh), s.set(r, l);
9536
9559
  }
9537
9560
  function v() {
9538
9561
  s.forEach((e, t) => {
@@ -9561,7 +9584,7 @@ function yh(e) {
9561
9584
  }
9562
9585
  //#endregion
9563
9586
  //#region src/core/stores/jackpot.ts
9564
- var bh = rs("jackpot", () => {
9587
+ var Dh = rs("jackpot", () => {
9565
9588
  let e = /* @__PURE__ */ B([]), t = /* @__PURE__ */ B(void 0), n = /* @__PURE__ */ B([]), r = U(() => !!t.value);
9566
9589
  function i(e) {
9567
9590
  t.value = e;
@@ -9590,14 +9613,14 @@ var bh = rs("jackpot", () => {
9590
9613
  jackpotWin: t,
9591
9614
  setJackpotUpdates: a
9592
9615
  };
9593
- }), xh = 15, Sh = 500, Ch = 3, wh = 1e4, Th = 3, Eh = 2 * 6e4, Dh = 3e4, Oh = 2e3, kh = 5e3, Ah = 5 * 6e4;
9594
- function jh(e) {
9616
+ }), Oh = 15, kh = 500, Ah = 3, jh = 1e4, Mh = 3, Nh = 2 * 6e4, Ph = 3e4, Fh = 2e3, Ih = 5e3, Lh = 5 * 6e4;
9617
+ function Rh(e) {
9595
9618
  return e.includes("token is expired") ? "token_expired" : e.includes("failed to initialize user session") ? "session_init_failed" : e.startsWith("failed to authenticate user") || e.includes("token") ? "token_invalid" : "other";
9596
9619
  }
9597
- function Mh(e) {
9620
+ function zh(e) {
9598
9621
  return e.reason === "token_expired" || e.reason === "token_invalid";
9599
9622
  }
9600
- function Nh(e) {
9623
+ function Bh(e) {
9601
9624
  let t = null, n = !1, r = 0, i = !0, a = 0, o = [], s = !1, c = -Infinity, l = -Infinity, u = !1, d = !1, f = -Infinity, p, m = null, h = !1;
9602
9625
  function g() {
9603
9626
  if (document.visibilityState === "hidden") {
@@ -9639,15 +9662,15 @@ function Nh(e) {
9639
9662
  if (!e.transportFailed && t.code !== 1006) return;
9640
9663
  let n = Date.now(), r = typeof document < "u" && document.visibilityState === "hidden";
9641
9664
  if (e.connectedAt === void 0) {
9642
- if (typeof navigator < "u" && navigator.onLine === !1 || r || n - l < wh) return;
9643
- a++, a >= Ch && x("reconnect_failing", e, t);
9665
+ if (typeof navigator < "u" && navigator.onLine === !1 || r || n - l < jh) return;
9666
+ a++, a >= Ah && x("reconnect_failing", e, t);
9644
9667
  return;
9645
9668
  }
9646
- r || c >= e.connectedAt || (o = o.filter((e) => n - e < Eh), o.push(n), o.length >= Th && x("connection_unstable", e, t));
9669
+ r || c >= e.connectedAt || (o = o.filter((e) => n - e < Nh), o.push(n), o.length >= Mh && x("connection_unstable", e, t));
9647
9670
  }
9648
9671
  function C() {
9649
9672
  if (p !== void 0) return;
9650
- let t = Date.now(), n = Math.max(t + Math.random() * Oh, f + Dh);
9673
+ let t = Date.now(), n = Math.max(t + Math.random() * Fh, f + Ph);
9651
9674
  p = setTimeout($(() => {
9652
9675
  p = void 0, f = Date.now(), D(e.onReconnected(), "reconnect");
9653
9676
  }), n - t);
@@ -9673,21 +9696,21 @@ function Nh(e) {
9673
9696
  let a = e.getJwtToken();
9674
9697
  if (!a || a === t) {
9675
9698
  let e = Date.now() - i;
9676
- e >= Ah && w(n, e);
9699
+ e >= Lh && w(n, e);
9677
9700
  return;
9678
9701
  }
9679
9702
  T(), r = 0, D(k(), "token refresh");
9680
- }), kh);
9703
+ }), Ih);
9681
9704
  }
9682
9705
  function D(t, n) {
9683
9706
  t.catch($((t) => {
9684
- e.warn(`Failed to process WebSocket ${n}`, t), Hh(t, `WebSocket handler: ${n}`);
9707
+ e.warn(`Failed to process WebSocket ${n}`, t), Yh(t, `WebSocket handler: ${n}`);
9685
9708
  }));
9686
9709
  }
9687
9710
  async function ee() {
9688
9711
  if (!i) return;
9689
9712
  r++;
9690
- let t = Sh * 2 ** (r - 1), n = Math.min(t, xh * 1e3), a = n - n / 2 * Math.random();
9713
+ let t = kh * 2 ** (r - 1), n = Math.min(t, Oh * 1e3), a = n - n / 2 * Math.random();
9691
9714
  if (e.log(`Reconnecting in ${Math.round(a)}ms (attempt ${r})....`), await v(a), i) {
9692
9715
  if (!e.getJwtToken()) {
9693
9716
  e.warn("No JWT token available, waiting for re-auth event"), r = 0;
@@ -9711,9 +9734,9 @@ function Nh(e) {
9711
9734
  e.warn("GraphQL WS protocol error", o);
9712
9735
  let r = o.payload?.message, i = typeof r == "string" ? r : "";
9713
9736
  n.rejection = {
9714
- reason: jh(i),
9737
+ reason: Rh(i),
9715
9738
  serverMessage: i
9716
- }, Mh(n.rejection) || w(n.rejection), t.close(3e3, o.type);
9739
+ }, zh(n.rejection) || w(n.rejection), t.close(3e3, o.type);
9717
9740
  return;
9718
9741
  }
9719
9742
  if (o.type === "connection_ack") {
@@ -9851,7 +9874,7 @@ function Nh(e) {
9851
9874
  e.log("Web Socket Connection closed", (/* @__PURE__ */ new Date()).toISOString(), n), t === a && S(o, n);
9852
9875
  let r = t === a && n.code !== 3001;
9853
9876
  if (b(a), r) {
9854
- if (o.rejection && Mh(o.rejection) && o.token) {
9877
+ if (o.rejection && zh(o.rejection) && o.token) {
9855
9878
  E(o.token, o.rejection);
9856
9879
  return;
9857
9880
  }
@@ -9888,15 +9911,15 @@ function Nh(e) {
9888
9911
  }
9889
9912
  //#endregion
9890
9913
  //#region src/core/stores/loyalty.ts
9891
- var { sendToast: Ph } = uc(), { getJwtToken: Fh, baseApiUrl: Ih } = r(), Lh = 2500, Rh = 3, zh = ["person", "history"];
9892
- function Bh(e) {
9893
- return zh.includes(e) ? e : "person";
9914
+ var { sendToast: Vh } = uc(), { getJwtToken: Hh, baseApiUrl: Uh } = r(), Wh = 2500, Gh = 3, Kh = ["person", "history"];
9915
+ function qh(e) {
9916
+ return Kh.includes(e) ? e : "person";
9894
9917
  }
9895
- var Vh = rs("loyalty", () => {
9896
- let { setupToasts: e, showLevelupToast: t, showChallengeCompletedToast: n, showBonusCreditedToast: r, showChallengeCreditedToast: i, showChallengesExpiredToast: a, showChallengeMilestoneToast: s, isChallengeMilestoneToastEnabled: c, showQuestTaskDoneToast: l, updateQuestTaskDoneToast: u, attachBonusToToast: d } = vl(), { setupTranslations: f } = cc(), { bonuses: p } = is(Cl()), { loadBonuses: m, reset: h } = Cl(), { setJackpotWin: g, setJackpotUpdates: _ } = bh(), v = /* @__PURE__ */ B(!1), y = /* @__PURE__ */ B(!1), b = /* @__PURE__ */ B(""), x = /* @__PURE__ */ B(0), S = /* @__PURE__ */ B([]), C = /* @__PURE__ */ B([]), w = /* @__PURE__ */ B([]), T = /* @__PURE__ */ B(null), E = /* @__PURE__ */ B(0), D = /* @__PURE__ */ B([]), ee = /* @__PURE__ */ B(0), O = /* @__PURE__ */ B(0), k = /* @__PURE__ */ B("idle"), te = 0, ne = 0, A = /* @__PURE__ */ B([]), re = /* @__PURE__ */ B("idle"), j = 0, M = /* @__PURE__ */ new Set(), ie = /* @__PURE__ */ B(/* @__PURE__ */ new Map()), ae = /* @__PURE__ */ B([]), oe = /* @__PURE__ */ B(!1), se = /* @__PURE__ */ B(!0), N = /* @__PURE__ */ B(!1), ce = /* @__PURE__ */ B(!1), le = /* @__PURE__ */ B(!0), ue = /* @__PURE__ */ B(!0), de = /* @__PURE__ */ B(!1), fe = /* @__PURE__ */ B(!1), pe = /* @__PURE__ */ B([]), me = /* @__PURE__ */ B([]), he = /* @__PURE__ */ B(!1), ge = /* @__PURE__ */ B("default"), _e = /* @__PURE__ */ B(!1), ve = /* @__PURE__ */ B(!1), ye = /* @__PURE__ */ B("default"), be = /* @__PURE__ */ B(!1), xe = /* @__PURE__ */ B(!1), Se = /* @__PURE__ */ B(!1), Ce = /* @__PURE__ */ B(!0), we = /* @__PURE__ */ B(!0), Te = /* @__PURE__ */ B(!0), Ee = /* @__PURE__ */ B(!1), De = /* @__PURE__ */ B(/* @__PURE__ */ new Set()), Oe = /* @__PURE__ */ B(/* @__PURE__ */ new Set()), ke = /* @__PURE__ */ B(!1), Ae = /* @__PURE__ */ B(!1), je = /* @__PURE__ */ B(!1), Me = /* @__PURE__ */ B(!1), P = /* @__PURE__ */ B(!1), Ne = /* @__PURE__ */ B(!1), Pe = /* @__PURE__ */ B(!1), Fe = /* @__PURE__ */ B(!1), Ie = /* @__PURE__ */ B(!1), F = /* @__PURE__ */ B("person"), Le = /* @__PURE__ */ B(!0), Re = /* @__PURE__ */ B(!0), ze = /* @__PURE__ */ B(!1), Be = /* @__PURE__ */ B(!0), Ve = /* @__PURE__ */ B(!1), He = /* @__PURE__ */ B(5e3), Ue = /* @__PURE__ */ B(null), We = /* @__PURE__ */ B(null), Ge = /* @__PURE__ */ B(""), Ke = /* @__PURE__ */ B(!1), qe = /* @__PURE__ */ B([]), Je = /* @__PURE__ */ new Set(), Ye = /* @__PURE__ */ new Set(), Xe = [], Ze = (e) => e.IsClaimable !== !1 && !e.AutoClaimed && !e.ClaimedAt, Qe = yh({
9918
+ var Jh = rs("loyalty", () => {
9919
+ let { setupToasts: e, showLevelupToast: t, showChallengeCompletedToast: n, showBonusCreditedToast: r, showChallengeCreditedToast: i, showChallengesExpiredToast: a, showChallengeMilestoneToast: s, isChallengeMilestoneToastEnabled: c, showQuestTaskDoneToast: l, updateQuestTaskDoneToast: u, attachBonusToToast: d } = vl(), { setupTranslations: f } = cc(), { bonuses: p } = is(Cl()), { loadBonuses: m, reset: h } = Cl(), { setJackpotWin: g, setJackpotUpdates: _ } = Dh(), v = /* @__PURE__ */ B(!1), y = /* @__PURE__ */ B(!1), b = /* @__PURE__ */ B(""), x = /* @__PURE__ */ B(0), S = /* @__PURE__ */ B([]), C = /* @__PURE__ */ B([]), w = /* @__PURE__ */ B([]), T = /* @__PURE__ */ B(null), E = /* @__PURE__ */ B(0), D = /* @__PURE__ */ B([]), ee = /* @__PURE__ */ B(0), O = /* @__PURE__ */ B(0), k = /* @__PURE__ */ B("idle"), te = 0, ne = 0, A = /* @__PURE__ */ B([]), re = /* @__PURE__ */ B("idle"), j = 0, M = /* @__PURE__ */ new Set(), ie = /* @__PURE__ */ B(/* @__PURE__ */ new Map()), ae = /* @__PURE__ */ B([]), oe = /* @__PURE__ */ B(!1), se = /* @__PURE__ */ B(!0), N = /* @__PURE__ */ B(!1), ce = /* @__PURE__ */ B(!1), le = /* @__PURE__ */ B(!0), ue = /* @__PURE__ */ B(!0), de = /* @__PURE__ */ B(!1), fe = /* @__PURE__ */ B(!1), pe = /* @__PURE__ */ B([]), me = /* @__PURE__ */ B([]), he = /* @__PURE__ */ B(!1), ge = /* @__PURE__ */ B("default"), _e = /* @__PURE__ */ B(!1), ve = /* @__PURE__ */ B(!1), ye = /* @__PURE__ */ B("default"), be = /* @__PURE__ */ B(!1), xe = /* @__PURE__ */ B(!1), Se = /* @__PURE__ */ B(!1), Ce = /* @__PURE__ */ B(!0), we = /* @__PURE__ */ B(!0), Te = /* @__PURE__ */ B(!0), Ee = /* @__PURE__ */ B(!1), De = /* @__PURE__ */ B(/* @__PURE__ */ new Set()), Oe = /* @__PURE__ */ B(/* @__PURE__ */ new Set()), ke = /* @__PURE__ */ B(!1), Ae = /* @__PURE__ */ B(!1), je = /* @__PURE__ */ B(!1), Me = /* @__PURE__ */ B(!1), P = /* @__PURE__ */ B(!1), Ne = /* @__PURE__ */ B(!1), Pe = /* @__PURE__ */ B(!1), Fe = /* @__PURE__ */ B(!1), Ie = /* @__PURE__ */ B(!1), F = /* @__PURE__ */ B("person"), Le = /* @__PURE__ */ B(!0), Re = /* @__PURE__ */ B(!0), ze = /* @__PURE__ */ B(!1), Be = /* @__PURE__ */ B(!0), Ve = /* @__PURE__ */ B(!1), He = /* @__PURE__ */ B(5e3), Ue = /* @__PURE__ */ B(null), We = /* @__PURE__ */ B(null), Ge = /* @__PURE__ */ B(""), Ke = /* @__PURE__ */ B(!1), qe = /* @__PURE__ */ B([]), Je = /* @__PURE__ */ new Set(), Ye = /* @__PURE__ */ new Set(), Xe = [], Ze = (e) => e.IsClaimable !== !1 && !e.AutoClaimed && !e.ClaimedAt, Qe = Eh({
9897
9920
  challenges: () => A.value,
9898
9921
  isToastEnabled: c,
9899
- showMilestoneToast: (e) => qt() ? Xe.length >= Rh ? !1 : (Xe.push(e), !0) : ($e(e), !0),
9922
+ showMilestoneToast: (e) => qt() ? Xe.length >= Gh ? !1 : (Xe.push(e), !0) : ($e(e), !0),
9900
9923
  attachBonusToToast: d,
9901
9924
  findClaimableBonus: (e) => p.value.find((t) => t.UserBonusId !== void 0 && e.includes(t.UserBonusId) && Ze(t)),
9902
9925
  isClaimable: Ze,
@@ -9912,7 +9935,7 @@ var Vh = rs("loyalty", () => {
9912
9935
  let et = "ft-rewards-config", tt = null, nt = /* @__PURE__ */ new Date();
9913
9936
  nt.setHours(nt.getHours() + 1);
9914
9937
  function rt() {
9915
- h(), ne++, te++, y.value = !1, b.value = "", x.value = 0, S.value = [], C.value = [], w.value = [], T.value = null, D.value = [], ee.value = 0, O.value = 0, k.value = "idle", A.value = [], re.value = "idle", j++, M.clear(), ie.value.clear(), dh().reset(), ae.value = [], Ke.value = !1, qe.value = [], Xe.length = 0, Je.forEach(clearTimeout), Je.clear(), Ye.clear(), oe.value = !1, se.value = !0, N.value = !1, ce.value = !1, le.value = !0, ue.value = !0, de.value = !1, fe.value = !1, pe.value = [], me.value = [], he.value = !1, ge.value = "default", _e.value = !1, ve.value = !1, ye.value = "default", be.value = !1, xe.value = !1, Se.value = !1, Ce.value = !0, we.value = !0, Te.value = !0, Ee.value = !1, De.value = /* @__PURE__ */ new Set(), Oe.value = /* @__PURE__ */ new Set(), Qe.reset(), ke.value = !1, Ae.value = !1, Me.value = !1, P.value = !1, Ne.value = !1, Pe.value = !1, Fe.value = !1, F.value = "person", We.value = null, Ge.value = "", _s(!1);
9938
+ h(), ne++, te++, y.value = !1, b.value = "", x.value = 0, S.value = [], C.value = [], w.value = [], T.value = null, D.value = [], ee.value = 0, O.value = 0, k.value = "idle", A.value = [], re.value = "idle", j++, M.clear(), ie.value.clear(), vh().reset(), ae.value = [], Ke.value = !1, qe.value = [], Xe.length = 0, Je.forEach(clearTimeout), Je.clear(), Ye.clear(), oe.value = !1, se.value = !0, N.value = !1, ce.value = !1, le.value = !0, ue.value = !0, de.value = !1, fe.value = !1, pe.value = [], me.value = [], he.value = !1, ge.value = "default", _e.value = !1, ve.value = !1, ye.value = "default", be.value = !1, xe.value = !1, Se.value = !1, Ce.value = !0, we.value = !0, Te.value = !0, Ee.value = !1, De.value = /* @__PURE__ */ new Set(), Oe.value = /* @__PURE__ */ new Set(), Qe.reset(), ke.value = !1, Ae.value = !1, Me.value = !1, P.value = !1, Ne.value = !1, Pe.value = !1, Fe.value = !1, F.value = "person", We.value = null, Ge.value = "", _s(!1);
9916
9939
  try {
9917
9940
  localStorage.removeItem(et);
9918
9941
  } catch (e) {
@@ -9921,7 +9944,7 @@ var Vh = rs("loyalty", () => {
9921
9944
  operation: "logout"
9922
9945
  }), Y("Failed to clear config cache on logout", e);
9923
9946
  }
9924
- Ut().disconnect(3001, "User logged out"), Ng();
9947
+ Ut().disconnect(3001, "User logged out"), Bg();
9925
9948
  }
9926
9949
  function it(e = "EUR", t = 0) {
9927
9950
  let n = new Intl.NumberFormat().resolvedOptions().locale;
@@ -9984,7 +10007,7 @@ var Vh = rs("loyalty", () => {
9984
10007
  }
9985
10008
  if (r) {
9986
10009
  let t = S.value[n + 1]?.XP ?? r.XP;
9987
- ee.value = t > 0 ? sg(e.xp / t * 100, 0, 100) : 0;
10010
+ ee.value = t > 0 ? mg(e.xp / t * 100, 0, 100) : 0;
9988
10011
  }
9989
10012
  e.level != null && (x.value = e.level);
9990
10013
  }
@@ -10039,7 +10062,7 @@ var Vh = rs("loyalty", () => {
10039
10062
  }
10040
10063
  async function Et() {
10041
10064
  let e = ++ne, t = await Gp(), n = !t.data && String(t?.errors?.[0]?.extensions?.code ?? "").toUpperCase() === "UNAUTHENTICATED";
10042
- n && (Y("Could not authenticate user"), ag(`User JWT: ${Fh()}`));
10065
+ n && (Y("Could not authenticate user"), fg(`User JWT: ${Hh()}`));
10043
10066
  let r = t?.data?.Reward;
10044
10067
  if (!r) {
10045
10068
  let e = t?.errors?.[0]?.message, r = `Could not load the Rewards configuration${e ? `: ${e}` : ""}`;
@@ -10105,7 +10128,7 @@ var Vh = rs("loyalty", () => {
10105
10128
  let i = n.Branding ?? [], a = i.filter((e) => e.Type === "setting"), o = i.filter((e) => e.Type === "template_string");
10106
10129
  Mt(a);
10107
10130
  let s = i.filter((e) => e.Type === "css").find((e) => e.Key === "level-up-modal-image");
10108
- s && (We.value = s.Value), f(o), e(o, a);
10131
+ s && (We.value = s.Value), f(gm(o)), e(o, a);
10109
10132
  let c = document.getElementById("ft-branding");
10110
10133
  if (!c) return;
10111
10134
  let l = i.filter((e) => e.Type === "css"), u = l.filter((e) => e.Key.includes("font-family")).map((e) => im(e.Value)).filter((e) => e.length > 0);
@@ -10123,7 +10146,7 @@ var Vh = rs("loyalty", () => {
10123
10146
  let n = e.find((e) => e.Key === "enable-rewards-badge");
10124
10147
  n && (je.value = n.Value === "true");
10125
10148
  let r = e.find((e) => e.Key === "calendar-door-blur-unopened-door-enabled");
10126
- r && (Me.value = r.Value === "true"), P.value = L("player-history-enabled", e, !1), Ne.value = L("player-bonus-history-enabled", e, !1), Pe.value = L("player-vc-history-enabled", e, !1), Fe.value = L("player-challenge-history-enabled", e, !1), Ie.value = L("player-history-hide-auto-claimed-challenges", e, !1), F.value = Bh(e.find((e) => e.Key === "player-history-icon")?.Value);
10149
+ r && (Me.value = r.Value === "true"), P.value = L("player-history-enabled", e, !1), Ne.value = L("player-bonus-history-enabled", e, !1), Pe.value = L("player-vc-history-enabled", e, !1), Fe.value = L("player-challenge-history-enabled", e, !1), Ie.value = L("player-history-hide-auto-claimed-challenges", e, !1), F.value = qh(e.find((e) => e.Key === "player-history-icon")?.Value);
10127
10150
  let i = e.find((e) => e.Key === "wheel-speed");
10128
10151
  i && (ge.value = i.Value, i.Value !== "default" && (he.value = !0));
10129
10152
  let a = e.find((e) => e.Key === "wheel-version");
@@ -10133,12 +10156,12 @@ var Vh = rs("loyalty", () => {
10133
10156
  let e = parseInt(o.Value, 10);
10134
10157
  Number.isFinite(e) && e > 0 && (He.value = e);
10135
10158
  }
10136
- Ue.value = gm(e);
10159
+ Ue.value = Cm(e);
10137
10160
  }
10138
10161
  async function Nt() {
10139
10162
  let e = !1, t = Dt();
10140
10163
  if (t) try {
10141
- ag("loadConfiguration: applying cached config"), jt(t), e = !0;
10164
+ fg("loadConfiguration: applying cached config"), jt(t), e = !0;
10142
10165
  } catch (e) {
10143
10166
  Q(e, {
10144
10167
  kind: "UNKNOWN",
@@ -10154,7 +10177,7 @@ var Vh = rs("loyalty", () => {
10154
10177
  }
10155
10178
  }
10156
10179
  try {
10157
- ag("loadConfiguration"), _s(!1);
10180
+ fg("loadConfiguration"), _s(!1);
10158
10181
  let e = await Kp();
10159
10182
  _s(Z(X.supportGraphqlCallerHeader, e?.data?.GetConfiguration?.APIVersion ?? "")), jt(e), Ot(e);
10160
10183
  } catch (t) {
@@ -10301,7 +10324,7 @@ var Vh = rs("loyalty", () => {
10301
10324
  we.value = t === !0 || t === "true";
10302
10325
  })), window.addEventListener("set-my-rewards-order", $((e) => {
10303
10326
  let t = e.detail;
10304
- Array.isArray(t) && (Ue.value = gm(t.filter((e) => !!e && typeof e.Key == "string" && typeof e.Value == "string")));
10327
+ Array.isArray(t) && (Ue.value = Cm(t.filter((e) => !!e && typeof e.Key == "string" && typeof e.Value == "string")));
10305
10328
  })), window.addEventListener("set-brand-settings", $((e) => {
10306
10329
  let t = e.detail;
10307
10330
  Array.isArray(t) && Mt(t.filter((e) => !!e && typeof e.Key == "string" && typeof e.Value == "string").map((e) => ({
@@ -10342,7 +10365,7 @@ var Vh = rs("loyalty", () => {
10342
10365
  })), window.addEventListener("player-history-hide-auto-claimed-challenges", $((e) => {
10343
10366
  Ie.value = e.detail === "true";
10344
10367
  })), window.addEventListener("player-history-icon", $((e) => {
10345
- F.value = Bh(e.detail);
10368
+ F.value = qh(e.detail);
10346
10369
  })), window.addEventListener("set-mute", $((e) => {
10347
10370
  he.value = e.detail === "true";
10348
10371
  })), window.addEventListener("menu-enabled", $((e) => {
@@ -10358,11 +10381,11 @@ var Vh = rs("loyalty", () => {
10358
10381
  }));
10359
10382
  }
10360
10383
  function Ut() {
10361
- return tt ||= Nh({
10362
- getJwtToken: Fh,
10363
- baseApiUrl: Ih,
10364
- createConnectionId: (e) => `${Kh()}-${e}`,
10365
- log: ag,
10384
+ return tt ||= Bh({
10385
+ getJwtToken: Hh,
10386
+ baseApiUrl: Uh,
10387
+ createConnectionId: (e) => `${$h()}-${e}`,
10388
+ log: fg,
10366
10389
  warn: Y,
10367
10390
  onChallengesCreditUpdate: async () => {
10368
10391
  await Lt(), Re.value || await m();
@@ -10392,7 +10415,7 @@ var Vh = rs("loyalty", () => {
10392
10415
  if (t?.toString() === e?.WinnerUserID?.toString()) g(e);
10393
10416
  else {
10394
10417
  let t = e;
10395
- Ph(`Someone just won ${t.JackpotName} jackpot of ${it(t.CurrencyCode, parseFloat(t.Amount))}!`);
10418
+ Vh(`Someone just won ${t.JackpotName} jackpot of ${it(t.CurrencyCode, parseFloat(t.Amount))}!`);
10396
10419
  }
10397
10420
  },
10398
10421
  onPendingBonusUpdate: Tt,
@@ -10428,11 +10451,11 @@ var Vh = rs("loyalty", () => {
10428
10451
  function Kt(e) {
10429
10452
  let t = setTimeout($(() => {
10430
10453
  if (Je.delete(t), qt()) {
10431
- qe.value.length < Rh && qe.value.push(e);
10454
+ qe.value.length < Gh && qe.value.push(e);
10432
10455
  return;
10433
10456
  }
10434
10457
  Qe.flushHeldBonusToasts(), a(e);
10435
- }), Lh);
10458
+ }), Wh);
10436
10459
  Je.add(t);
10437
10460
  }
10438
10461
  function qt() {
@@ -10547,49 +10570,49 @@ var Vh = rs("loyalty", () => {
10547
10570
  });
10548
10571
  //#endregion
10549
10572
  //#region src/core/utils/utils.ts
10550
- function Hh(e, t) {
10573
+ function Yh(e, t) {
10551
10574
  Q(e, {
10552
10575
  kind: "UNKNOWN",
10553
10576
  operation: t
10554
10577
  });
10555
10578
  }
10556
- function Uh(e) {
10579
+ function Xh(e) {
10557
10580
  let t = e;
10558
10581
  if (!(!t || typeof t.showModal != "function" || t.open)) try {
10559
10582
  t.showModal();
10560
10583
  } catch {}
10561
10584
  }
10562
- function Wh(e) {
10585
+ function Zh(e) {
10563
10586
  if (Jc(e)) return tl(e);
10564
10587
  let t = e.Tasks[0];
10565
10588
  return t ? t?.CompletedAt === "0001-01-01T00:00:00Z" ? t.Progress === 0 ? "available" : t.Progress < t.Amount ? "in-progress" : "finished" : "finished" : "";
10566
10589
  }
10567
- function Gh(e) {
10568
- return Wh(e) !== "finished" && e.ID !== -1;
10590
+ function Qh(e) {
10591
+ return Zh(e) !== "finished" && e.ID !== -1;
10569
10592
  }
10570
- function Kh() {
10593
+ function $h() {
10571
10594
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
10572
10595
  let t = Math.random() * 16 | 0;
10573
10596
  return (e == "x" ? t : t & 3 | 8).toString(16);
10574
10597
  });
10575
10598
  }
10576
- var qh = new Set([
10599
+ var eg = new Set([
10577
10600
  "b",
10578
10601
  "strong",
10579
10602
  "i",
10580
10603
  "em"
10581
10604
  ]);
10582
- function Jh(e) {
10605
+ function tg(e) {
10583
10606
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
10584
10607
  }
10585
- function Yh(e) {
10608
+ function ng(e) {
10586
10609
  return e.replace(/(^|[^&;"'=])(https?:\/\/[^\s<>"']+)/gi, "$1<a href=\"$2\" target=\"_blank\" rel=\"noopener noreferrer\">$2</a>");
10587
10610
  }
10588
- function Xh(e, t) {
10589
- let n = Jh(e);
10590
- return t ? Yh(n) : n;
10611
+ function rg(e, t) {
10612
+ let n = tg(e);
10613
+ return t ? ng(n) : n;
10591
10614
  }
10592
- function Zh(e, t) {
10615
+ function ig(e, t) {
10593
10616
  let n = null;
10594
10617
  for (let r = t + 1; r < e.length; r += 1) {
10595
10618
  let t = e[r];
@@ -10605,77 +10628,77 @@ function Zh(e, t) {
10605
10628
  }
10606
10629
  return -1;
10607
10630
  }
10608
- function Qh(e) {
10631
+ function ag(e) {
10609
10632
  if (typeof DOMParser < "u") return new DOMParser().parseFromString(`${e}</a>`, "text/html").querySelector("a")?.getAttribute("href") ?? null;
10610
10633
  let t = e.match(/\shref\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+))/i);
10611
10634
  return t?.[1] ?? t?.[2] ?? t?.[3] ?? null;
10612
10635
  }
10613
- function $h(e) {
10636
+ function og(e) {
10614
10637
  return typeof DOMParser > "u" ? e : new DOMParser().parseFromString(e, "text/html").documentElement.textContent ?? e;
10615
10638
  }
10616
- function eg(e) {
10639
+ function sg(e) {
10617
10640
  for (let t = 0; t < e.length; t += 1) {
10618
10641
  let n = e.charCodeAt(t);
10619
10642
  if (n <= 32 || n === 127) return !0;
10620
10643
  }
10621
10644
  return !1;
10622
10645
  }
10623
- function tg(e) {
10646
+ function cg(e) {
10624
10647
  let t = e.trim();
10625
- if (!t || eg(t)) return !1;
10648
+ if (!t || sg(t)) return !1;
10626
10649
  let n = t.toLowerCase();
10627
10650
  return n.startsWith("http://") || n.startsWith("https://") || n.startsWith("mailto:") || n.startsWith("tel:") || t.startsWith("#") ? !0 : t.startsWith("/") ? !t.startsWith("//") : t.startsWith("\\") ? !1 : !/^[a-z][a-z0-9+.-]*:/i.test(t);
10628
10651
  }
10629
- function ng(e) {
10630
- let t = Qh(e);
10652
+ function lg(e) {
10653
+ let t = ag(e);
10631
10654
  if (t === null) return null;
10632
- let n = $h(t).trim();
10633
- return tg(n) ? n : null;
10655
+ let n = og(t).trim();
10656
+ return cg(n) ? n : null;
10634
10657
  }
10635
- function rg(e, t) {
10658
+ function ug(e, t) {
10636
10659
  let n = e.match(/^<(\/?)([a-z][a-z0-9:-]*)\b[\s\S]*?>$/i);
10637
- if (!n) return Jh(e);
10660
+ if (!n) return tg(e);
10638
10661
  let r = n[1] === "/", i = Fs(n, 2, "sanitized tag name").toLowerCase(), a = /\/\s*>$/.test(e);
10639
- if (qh.has(i)) return r ? `</${i}>` : a ? `<${i}></${i}>` : `<${i}>`;
10640
- if (i !== "a") return Jh(e);
10662
+ if (eg.has(i)) return r ? `</${i}>` : a ? `<${i}></${i}>` : `<${i}>`;
10663
+ if (i !== "a") return tg(e);
10641
10664
  if (r) {
10642
10665
  let n = t.pop();
10643
- return n === void 0 ? Jh(e) : n ? "</a>" : "";
10666
+ return n === void 0 ? tg(e) : n ? "</a>" : "";
10644
10667
  }
10645
- let o = ng(e);
10668
+ let o = lg(e);
10646
10669
  if (!o) return a || t.push(!1), "";
10647
- let s = `<a href="${Jh(o)}" target="_blank" rel="noopener noreferrer">`;
10670
+ let s = `<a href="${tg(o)}" target="_blank" rel="noopener noreferrer">`;
10648
10671
  return a ? `${s}</a>` : (t.push(!0), s);
10649
10672
  }
10650
- function ig(e) {
10673
+ function dg(e) {
10651
10674
  if (!e) return "";
10652
10675
  let t = [], n = "", r = 0;
10653
10676
  for (; r < e.length;) {
10654
10677
  let i = e.indexOf("<", r);
10655
10678
  if (i === -1) {
10656
- n += Xh(e.slice(r), !t.includes(!0));
10679
+ n += rg(e.slice(r), !t.includes(!0));
10657
10680
  break;
10658
10681
  }
10659
- if (n += Xh(e.slice(r, i), !t.includes(!0)), !/^<\/?[a-z]/i.test(e.slice(i, i + 3))) {
10660
- n += Jh("<"), r = i + 1;
10682
+ if (n += rg(e.slice(r, i), !t.includes(!0)), !/^<\/?[a-z]/i.test(e.slice(i, i + 3))) {
10683
+ n += tg("<"), r = i + 1;
10661
10684
  continue;
10662
10685
  }
10663
- let a = Zh(e, i);
10686
+ let a = ig(e, i);
10664
10687
  if (a === -1) {
10665
- n += Xh(e.slice(i), !t.includes(!0));
10688
+ n += rg(e.slice(i), !t.includes(!0));
10666
10689
  break;
10667
10690
  }
10668
- n += rg(e.slice(i, a + 1), t), r = a + 1;
10691
+ n += ug(e.slice(i, a + 1), t), r = a + 1;
10669
10692
  }
10670
10693
  return n.replace(/\n/g, "<br>");
10671
10694
  }
10672
- function ag(...e) {
10695
+ function fg(...e) {
10673
10696
  localStorage?.getItem("ft-debug") && console.log("[Rewards]", ...e);
10674
10697
  }
10675
10698
  function Y(...e) {
10676
10699
  console.warn("[Rewards]", ...e);
10677
10700
  }
10678
- async function og(e) {
10701
+ async function pg(e) {
10679
10702
  return new Promise((t) => setTimeout(t, e));
10680
10703
  }
10681
10704
  var X = {
@@ -10724,28 +10747,28 @@ var X = {
10724
10747
  };
10725
10748
  function Z(e, t) {
10726
10749
  if (!e) return !1;
10727
- let n = t ?? Vh().apiVersion;
10750
+ let n = t ?? Jh().apiVersion;
10728
10751
  if (!n || !e) return !1;
10729
10752
  let r = n.split("-"), i = Fs(r, r.length - 1, "API version segment"), a = parseInt(i, 10);
10730
10753
  return isNaN(a) ? !1 : a >= e;
10731
10754
  }
10732
- function sg(e, t, n) {
10755
+ function mg(e, t, n) {
10733
10756
  return Math.min(n, Math.max(t, e));
10734
10757
  }
10735
- function cg(e) {
10758
+ function hg(e) {
10736
10759
  return e ? xf(new Date(e), "do MMM HH:mm") : "";
10737
10760
  }
10738
- function lg(e, t) {
10761
+ function gg(e, t) {
10739
10762
  let n = typeof e == "number" && Number.isFinite(e) ? e : 0, r = Math.min(Math.max(typeof t == "number" && Number.isFinite(t) ? Math.floor(t) : 0, 0), 4), i = 10 ** r, a = n * i, o = a + Math.sign(a) * Math.abs(a) * 2 ** -52 * 4;
10740
10763
  return (Math.trunc(o) / i).toFixed(r);
10741
10764
  }
10742
- function ug(e, t, n) {
10765
+ function _g(e, t, n) {
10743
10766
  let r = /* @__PURE__ */ new Date();
10744
10767
  r.setTime(r.getTime() + n * 24 * 60 * 60 * 1e3);
10745
10768
  let i = `expires=${r.toUTCString()}`;
10746
10769
  document.cookie = `${e}=${t};${i};path=/`;
10747
10770
  }
10748
- function dg(e) {
10771
+ function vg(e) {
10749
10772
  let t = `${e}=`, n = document.cookie.split(";");
10750
10773
  for (let e of n) {
10751
10774
  let n = e;
@@ -10756,7 +10779,7 @@ function dg(e) {
10756
10779
  }
10757
10780
  //#endregion
10758
10781
  //#region src/core/api/clientErrors.ts
10759
- var fg = {
10782
+ var yg = {
10760
10783
  UNCAUGHT: "exception",
10761
10784
  WINDOW_ERROR: "window_error",
10762
10785
  UNHANDLED_REJECTION: "unhandled_rejection",
@@ -10764,44 +10787,44 @@ var fg = {
10764
10787
  API_FAILURE: "api_failure",
10765
10788
  RENDER: "render",
10766
10789
  UNKNOWN: "unknown"
10767
- }, pg = new Set([
10790
+ }, bg = new Set([
10768
10791
  "UNCAUGHT",
10769
10792
  "WINDOW_ERROR",
10770
10793
  "UNHANDLED_REJECTION",
10771
10794
  "VUE_ERROR"
10772
- ]), mg = "ft-rewards-install-id", hg = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/, gg = 10, _g = 2e3, vg = 50, yg = 5e3, bg = 0;
10773
- function xg(e) {
10774
- if (bg + e > 61440) return {
10795
+ ]), xg = "ft-rewards-install-id", Sg = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/, Cg = 10, wg = 2e3, Tg = 50, Eg = 5e3, Dg = 0;
10796
+ function Og(e) {
10797
+ if (Dg + e > 61440) return {
10775
10798
  keepalive: !1,
10776
10799
  release: () => {}
10777
10800
  };
10778
- bg += e;
10801
+ Dg += e;
10779
10802
  let t = !0;
10780
10803
  return {
10781
10804
  keepalive: !0,
10782
10805
  release: () => {
10783
- t && (t = !1, bg -= e);
10806
+ t && (t = !1, Dg -= e);
10784
10807
  }
10785
10808
  };
10786
10809
  }
10787
- function Sg(e) {
10810
+ function kg(e) {
10788
10811
  try {
10789
10812
  return new TextEncoder().encode(e).length;
10790
10813
  } catch {
10791
10814
  return e.length * 3;
10792
10815
  }
10793
10816
  }
10794
- function Cg() {
10817
+ function Ag() {
10795
10818
  try {
10796
- let e = localStorage.getItem(mg)?.toLowerCase();
10797
- if (e && hg.test(e)) return e;
10798
- let t = Kh();
10799
- return localStorage.setItem(mg, t), t;
10819
+ let e = localStorage.getItem(xg)?.toLowerCase();
10820
+ if (e && Sg.test(e)) return e;
10821
+ let t = $h();
10822
+ return localStorage.setItem(xg, t), t;
10800
10823
  } catch {
10801
10824
  return;
10802
10825
  }
10803
10826
  }
10804
- function wg(e) {
10827
+ function jg(e) {
10805
10828
  let t = [
10806
10829
  ["Edge", /Edg(?:e|A|iOS)?\/(\d+(?:\.\d+)?)/],
10807
10830
  ["Opera", /OPR\/(\d+(?:\.\d+)?)/],
@@ -10822,18 +10845,18 @@ function wg(e) {
10822
10845
  version: ""
10823
10846
  };
10824
10847
  }
10825
- function Tg(e) {
10848
+ function Mg(e) {
10826
10849
  try {
10827
10850
  return new URL(e).hostname.toLowerCase();
10828
10851
  } catch {
10829
10852
  return "";
10830
10853
  }
10831
10854
  }
10832
- function Eg() {
10855
+ function Ng() {
10833
10856
  return typeof location < "u" && typeof location.pathname == "string" ? location.pathname.slice(0, 256) : "";
10834
10857
  }
10835
- function Dg(e, t, n) {
10836
- let { browser: r, version: i } = wg(typeof navigator < "u" && typeof navigator.userAgent == "string" ? navigator.userAgent : "");
10858
+ function Pg(e, t, n) {
10859
+ let { browser: r, version: i } = jg(typeof navigator < "u" && typeof navigator.userAgent == "string" ? navigator.userAgent : "");
10837
10860
  return {
10838
10861
  schema: 1,
10839
10862
  client: {
@@ -10843,16 +10866,16 @@ function Dg(e, t, n) {
10843
10866
  browser: r,
10844
10867
  browser_version: i
10845
10868
  },
10846
- install_id: Cg(),
10869
+ install_id: Ag(),
10847
10870
  session_id: e,
10848
10871
  ...t ? { identity: { env_host: t } } : {},
10849
10872
  events: n
10850
10873
  };
10851
10874
  }
10852
- function Og(e, t, n, r) {
10853
- let i = xg(r), a = typeof AbortController == "function" ? new AbortController() : void 0, o = setTimeout(() => {
10875
+ function Fg(e, t, n, r) {
10876
+ let i = Og(r), a = typeof AbortController == "function" ? new AbortController() : void 0, o = setTimeout(() => {
10854
10877
  i.release(), a?.abort();
10855
- }, yg), s = () => {
10878
+ }, Eg), s = () => {
10856
10879
  clearTimeout(o), i.release();
10857
10880
  };
10858
10881
  try {
@@ -10871,7 +10894,7 @@ function Og(e, t, n, r) {
10871
10894
  throw s(), e;
10872
10895
  }
10873
10896
  }
10874
- function kg(e) {
10897
+ function Ig(e) {
10875
10898
  let t = /* @__PURE__ */ new Map(), n = 6e4, r = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new Map(), a, o = [], c, l = !1, u = 0, d = !1;
10876
10899
  function f(e) {
10877
10900
  return !d && !e.disabled && !!e.endpoint && !!e.ingestKey;
@@ -10907,8 +10930,8 @@ function kg(e) {
10907
10930
  function v(t, n, r = !1) {
10908
10931
  let i = e();
10909
10932
  if (!f(i) || n.length === 0) return;
10910
- a ??= Kh();
10911
- let o = JSON.stringify(Dg(a, t, n)), s = Sg(o);
10933
+ a ??= $h();
10934
+ let o = JSON.stringify(Pg(a, t, n)), s = kg(o);
10912
10935
  if (s > 61440) {
10913
10936
  if (n.length < 2) return;
10914
10937
  let e = Math.ceil(n.length / 2);
@@ -10917,7 +10940,7 @@ function kg(e) {
10917
10940
  }
10918
10941
  let c;
10919
10942
  try {
10920
- c = Og(i.endpoint, i.ingestKey, o, s);
10943
+ c = Fg(i.endpoint, i.ingestKey, o, s);
10921
10944
  } catch {
10922
10945
  m();
10923
10946
  return;
@@ -10949,16 +10972,16 @@ function kg(e) {
10949
10972
  let e = o;
10950
10973
  for (o = []; e.length > 0;) {
10951
10974
  let t = e[0].envHost, n = [];
10952
- for (let r = 0; r < e.length && n.length < gg;) e[r].envHost === t ? n.push(e.splice(r, 1)[0].event) : r++;
10975
+ for (let r = 0; r < e.length && n.length < Cg;) e[r].envHost === t ? n.push(e.splice(r, 1)[0].event) : r++;
10953
10976
  v(t, n);
10954
10977
  }
10955
10978
  } catch {}
10956
10979
  }
10957
10980
  function b(e, t) {
10958
- return o.length >= vg ? !1 : (o.push({
10981
+ return o.length >= Tg ? !1 : (o.push({
10959
10982
  envHost: e,
10960
10983
  event: t
10961
- }), !l && typeof window.addEventListener == "function" && (l = !0, window.addEventListener("pagehide", y)), o.length >= gg ? y() : c === void 0 && (c = setTimeout(y, _g)), !0);
10984
+ }), !l && typeof window.addEventListener == "function" && (l = !0, window.addEventListener("pagehide", y)), o.length >= Cg ? y() : c === void 0 && (c = setTimeout(y, wg)), !0);
10962
10985
  }
10963
10986
  function x(e) {
10964
10987
  S(e);
@@ -10994,18 +11017,18 @@ function kg(e) {
10994
11017
  for (let [e, r] of t) u - r >= n && t.delete(e);
10995
11018
  if (t.has(l) || t.size >= 100) return !1;
10996
11019
  t.set(l, u);
10997
- let d = pg.has(c.kind), p = {
11020
+ let d = bg.has(c.kind), p = {
10998
11021
  ...c.attrs,
10999
11022
  ...c.operation ? { operation: c.operation } : {}
11000
- }, m = Eg();
11001
- return b(Tg(s.baseUrl), {
11023
+ }, m = Ng();
11024
+ return b(Mg(s.baseUrl), {
11002
11025
  type: "error",
11003
11026
  name: d ? "error.uncaught" : "error.handled",
11004
11027
  ts: new Date(o).toISOString(),
11005
11028
  ...m ? { url_path: m } : {},
11006
11029
  ...Object.keys(p).length > 0 ? { attrs: p } : {},
11007
11030
  error: {
11008
- kind: fg[c.kind] ?? "unknown",
11031
+ kind: yg[c.kind] ?? "unknown",
11009
11032
  message: c.message,
11010
11033
  ...c.stack ? { stack: c.stack } : {},
11011
11034
  component: c.component,
@@ -11021,9 +11044,9 @@ function kg(e) {
11021
11044
  if (typeof window > "u") return !1;
11022
11045
  let n = e();
11023
11046
  if (n.disabled || !n.endpoint || !n.ingestKey || !n.baseUrl) return !1;
11024
- a ??= Kh();
11025
- let r = JSON.stringify(Dg(a, Tg(n.baseUrl), [t])), i = Sg(r);
11026
- return i > 61440 ? !1 : (Og(n.endpoint, n.ingestKey, r, i).catch(() => {}), !0);
11047
+ a ??= $h();
11048
+ let r = JSON.stringify(Pg(a, Mg(n.baseUrl), [t])), i = kg(r);
11049
+ return i > 61440 ? !1 : (Fg(n.endpoint, n.ingestKey, r, i).catch(() => {}), !0);
11027
11050
  } catch {
11028
11051
  return !1;
11029
11052
  }
@@ -11054,24 +11077,24 @@ function kg(e) {
11054
11077
  sendSessionEvent: C
11055
11078
  };
11056
11079
  }
11057
- function Ag() {
11080
+ function Lg() {
11058
11081
  return {
11059
11082
  endpoint: As("https://sentry.fasttrack.ai/v1/events"),
11060
11083
  ingestKey: "e61ce9ee333a0e4c760231f69529e5793a3e24089f8e6526"
11061
11084
  };
11062
11085
  }
11063
- var { reportClientError: jg, captureClientError: Q, flushClientErrors: Mg, clearPendingClientErrors: Ng, drainClientErrors: Pg, sendSessionEvent: Fg } = kg(() => {
11086
+ var { reportClientError: Rg, captureClientError: Q, flushClientErrors: zg, clearPendingClientErrors: Bg, drainClientErrors: Vg, sendSessionEvent: Hg } = Ig(() => {
11064
11087
  let { getJwtToken: e, baseApiUrl: t } = r();
11065
11088
  return {
11066
11089
  token: e(),
11067
11090
  baseUrl: t(),
11068
11091
  disabled: cs() || window?.fasttrack?.rewards?.errorReporting === !1,
11069
- ...Ag()
11092
+ ...Lg()
11070
11093
  };
11071
- }), Ig = /* @__PURE__ */ new WeakMap();
11094
+ }), Ug = /* @__PURE__ */ new WeakMap();
11072
11095
  function $(e, t = Q) {
11073
- let n = Ig.get(t);
11074
- n || (n = /* @__PURE__ */ new WeakMap(), Ig.set(t, n));
11096
+ let n = Ug.get(t);
11097
+ n || (n = /* @__PURE__ */ new WeakMap(), Ug.set(t, n));
11075
11098
  let r = n.get(e);
11076
11099
  if (r) return r;
11077
11100
  let i = function(...n) {
@@ -11087,4 +11110,4 @@ function $(e, t = Q) {
11087
11110
  return n.set(e, i), n.set(i, i), i;
11088
11111
  }
11089
11112
  //#endregion
11090
- export { wf as $, sn as $n, Ls as $t, Dp as A, Kr as An, xl as At, hp as B, Ni as Bn, Ac as Bt, rh as C, fi as Cn, Ae as Cr, nu as Ct, rm as D, Gr as Dn, t as Dr, mu as Dt, am as E, In as En, r as Er, gu as Et, Bp as F, ti as Fn, al as Ft, Zf as G, Xn as Gn, Mc as Gt, ap as H, fr as Hn, Uc as Ht, yp as I, ei as In, Jc as It, qf as J, Gt as Jn, uc as Jt, Qf as K, Fe as Kn, Pc as Kt, vp as L, yr as Ln, pl as Lt, Lp as M, ka as Mn, vl as Mt, Op as N, ii as Nn, Gc as Nt, Xp as O, Xr as On, n as Or, K as Ot, Rp as P, ai as Pn, ml as Pt, Tf as Q, hn as Qn, Xs as Qt, Vp as R, Sr as Rn, tl as Rt, nh as S, Co as Sn, me as Sr, ru as St, dm as T, Za as Tn, o as Tr, _u as Tt, np as U, ir as Un, Bc as Ut, op as V, Or as Vn, Vc as Vt, rp as W, Yn as Wn, Ic as Wt, If as X, nn as Xn, sc as Xt, Uf as Y, B as Yn, cc as Yt, Of as Z, R as Zn, ic as Zt, ug as _, Ga as _n, T as _r, Cu as _t, Hh as a, is as an, ae as ar, wd as at, bh as b, io as bn, ue as br, Uu as bt, cg as c, wa as cn, y as cr, bd as ct, Gh as d, Ba as dn, E as dr, ud as dt, W as en, on as er, Cf as et, Z as f, Fa as fn, p as fr, dd as ft, ig as g, Ka as gn, w as gr, Du as gt, Uh as h, fa as hn, xe as hr, Xu as ht, Fg as i, Uo as in, v as ir, Od as it, Fp as j, Wr as jn, Cl as jt, $p as k, Hr as kn, Bl as kt, lg as l, En as ln, C as lr, _d as lt, X as m, Pa as mn, x as mr, $u as mt, Q as n, ps as nn, oe as nr, Ad as nt, sg as o, _r as on, Se as or, Cd as ot, ag as p, qa as pn, te as pr, od as pt, Xf as q, Ie as qn, Fc as qt, Eg as r, us as rn, h as rr, kd as rt, og as s, mr as sn, ce as sr, xd as st, $ as t, Es as tn, M as tr, xf as tt, dg as u, U as un, m as ur, gd as ut, Y as v, Va as vn, De as vr, bu as vt, km as w, pi as wn, de as wr, vu as wt, dh as x, Cr as xn, ye as xr, cu as xt, Vh as y, Tr as yn, Oe as yr, Bu as yt, Ep as z, Er as zn, ul as zt };
11113
+ export { If as $, nn as $n, sc as $t, rm as A, Gr as An, t as Ar, mu as At, vp as B, yr as Bn, pl as Bt, uh as C, io as Cn, ue as Cr, Uu as Ct, _m as D, pi as Dn, de as Dr, vu as Dt, hm as E, fi as En, Ae as Er, nu as Et, Lp as F, ka as Fn, vl as Ft, ap as G, fr as Gn, Uc as Gt, Ep as H, Er as Hn, ul as Ht, Op as I, ii as In, Gc as It, Zf as J, Xn as Jn, Mc as Jt, np as K, ir as Kn, Bc as Kt, Rp as L, ai as Ln, ml as Lt, $p as M, Hr as Mn, Bl as Mt, Dp as N, Kr as Nn, xl as Nt, dm as O, Za as On, o as Or, _u as Ot, Fp as P, Wr as Pn, Cl as Pt, Uf as Q, B as Qn, cc as Qt, Bp as R, ti as Rn, al as Rt, lh as S, Tr as Sn, Oe as Sr, Bu as St, vm as T, Co as Tn, me as Tr, ru as Tt, hp as U, Ni as Un, Ac as Ut, Vp as V, Sr as Vn, tl as Vt, op as W, Or as Wn, Vc as Wt, Xf as X, Ie as Xn, Fc as Xt, Qf as Y, Fe as Yn, Pc as Yt, qf as Z, Gt as Zn, uc as Zt, _g as _, Pa as _n, x as _r, $u as _t, Yh as a, ps as an, oe as ar, Ad as at, Dh as b, Ga as bn, T as br, Cu as bt, hg as c, is as cn, ae as cr, wd as ct, Qh as d, wa as dn, y as dr, bd as dt, ic as en, R as er, Of as et, Z as f, En as fn, C as fr, _d as ft, dg as g, qa as gn, te as gr, od as gt, Xh as h, Fa as hn, p as hr, dd as ht, Hg as i, Es as in, M as ir, xf as it, Xp as j, Xr as jn, n as jr, K as jt, am as k, In as kn, r as kr, gu as kt, gg as l, _r as ln, Se as lr, Cd as lt, X as m, Ba as mn, E as mr, ud as mt, Q as n, Ls as nn, sn as nr, wf as nt, mg as o, us as on, h as or, kd as ot, fg as p, U as pn, m as pr, gd as pt, rp as q, Yn as qn, Ic as qt, Ng as r, W as rn, on as rr, Cf as rt, pg as s, Uo as sn, v as sr, Od as st, $ as t, Xs as tn, hn as tr, Tf as tt, vg as u, mr as un, ce as ur, xd as ut, Y as v, fa as vn, xe as vr, Xu as vt, Im as w, Cr as wn, ye as wr, cu as wt, vh as x, Va as xn, De as xr, bu as xt, Jh as y, Ka as yn, w as yr, Du as yt, yp as z, ei as zn, Jc as zt };