var tn = Object.defineProperty, an = Object.defineProperties;
var rn = Object.getOwnPropertyDescriptors;
var Ae = Object.getOwnPropertySymbols;
var ln = Object.prototype.hasOwnProperty, un = Object.prototype.propertyIsEnumerable;
var ke = (n, e, o) => e in n ? tn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : n[e] = o, ue = (n, e) => {
  for (var o in e || (e = {}))
    ln.call(e, o) && ke(n, o, e[o]);
  if (Ae)
    for (var o of Ae(e))
      un.call(e, o) && ke(n, o, e[o]);
  return n;
}, Ee = (n, e) => an(n, rn(e));
var ne = (n, e, o) => new Promise((i, s) => {
  var a = (u) => {
    try {
      d(o.next(u));
    } catch (f) {
      s(f);
    }
  }, r = (u) => {
    try {
      d(o.throw(u));
    } catch (f) {
      s(f);
    }
  }, d = (u) => u.done ? i(u.value) : Promise.resolve(u.value).then(a, r);
  d((o = o.apply(n, e)).next());
});
import { a as dn, $ as cn, S as pn, i as fn, s as mn, f as z, b as bn, n as be, d as D, v as ge, t as K, K as Se, c as j, m as p, w as G, e as W, p as N, u as O, r as _, g as gn, h as Bn, o as _n, x as ae, j as vn, L as Be, k as de, l as je, q as t, z as yn, A as hn, B as Cn, C as wn, D as Mn } from "./PlayerAccountController-yJR1r7p7.js";
function Pe(n, e) {
  dn(n, e);
}
function Wn(n) {
  cn.set(n);
}
const Te = {
  en: {
    titleBonuses: "Active Bonuses",
    bonusCode: "Do you have a bonus code?",
    getBonus: "Get Bonus",
    invalidBonusCode: "The bonus code provided is invalid.",
    noActiveBonuses: "You have no active bonuses at the moment.",
    forfeitBonus: "Are you sure want to forfeit bonus?",
    forfeitBonusConfirm: "Confirm",
    forfeitBonusCancel: "Cancel",
    bonusClaimSuccessMessage: "Bonus claimed!",
    bonusClaimErrorMessage: "Invalid bonus"
  },
  "zh-hk": {
    titleBonuses: "活躍獎金",
    bonusCode: "你有獎金代碼嗎？",
    getBonus: "獲得獎金",
    invalidBonusCode: "提供的紅利代碼無效。",
    noActiveBonuses: "您目前沒有有效的獎金。",
    forfeitBonus: "您確定要放棄獎金及其獎金嗎？",
    forfeitBonusConfirm: "確認",
    forfeitBonusCancel: "取消",
    bonusClaimSuccessMessage: "獎金要求！",
    bonusClaimErrorMessage: "無效獎金"
  },
  fr: {
    titleBonuses: "Bonus actifs",
    bonusCode: "Avez-vous un code bonus?",
    getBonus: "Obtenir un bonus",
    invalidBonusCode: "Le code bonus fourni n'est pas valide.",
    noActiveBonuses: "Vous n'avez pas de bonus actifs pour le moment.",
    forfeitBonus: "Etes-vous sûr de vouloir supprimer le bonus et ses gains?",
    forfeitBonusConfirm: "Confirmer",
    forfeitBonusCancel: "Annuler",
    bonusClaimSuccessMessage: "Bonus réclamé!",
    bonusClaimErrorMessage: "Bonus invalide"
  },
  ro: {
    titleBonuses: "Bonusuri active",
    bonusCode: "Ai un cod de bonus?",
    getBonus: "Revendică",
    invalidBonusCode: "Codul de bonus introdus este invalid.",
    noActiveBonuses: "Nu ai niciun bonus activ în acest moment.",
    forfeitBonus: "Ești sigur că vrei să anulezi acest bonus și câștigurile provenite din acest bonus?",
    forfeitBonusConfirm: "Confirmă",
    forfeitBonusCancel: "Anulează",
    bonusClaimSuccessMessage: "Bonus revendicat!",
    bonusClaimErrorMessage: "Bonus invalid"
  },
  es: {
    titleBonuses: "Bonos Activos",
    bonusCode: "Tienes un código de Bono?",
    getBonus: "Obtener Bono",
    invalidBonusCode: "El código del Bono no es válido.",
    noActiveBonuses: "Usted no tiene Bonos activos en este momento.",
    forfeitBonus: "Estas seguro que quieres perder el bono?",
    forfeitBonusConfirm: "Confirmar",
    forfeitBonusCancel: "Cancelar",
    bonusClaimSuccessMessage: "Bono adjudicado!",
    bonusClaimErrorMessage: "Bono invalido"
  },
  pt: {
    titleBonuses: "Bônus Ativos",
    bonusCode: "Você tem um código de bônus?",
    getBonus: "Obter bônus",
    invalidBonusCode: "O código de bônus fornecido é inválido.",
    noActiveBonuses: "Você não tem bônus ativos no momento.",
    forfeitBonus: "Tem certeza de que deseja perder o bônus e seus ganhos?",
    forfeitBonusConfirm: "Confirmar",
    forfeitBonusCancel: "Cancelar",
    bonusClaimSuccessMessage: "Bônus reivindicado!",
    bonusClaimErrorMessage: "Bônus inválido"
  },
  hr: {
    titleBonuses: "Aktivni bonusi",
    bonusCode: "Imate li bonus kod?",
    getBonus: "Preuzmi bonus",
    invalidBonusCode: "Navedeni bonus kod je nevažeći.",
    noActiveBonuses: "Trenutno nemate aktivnih bonusa.",
    forfeitBonus: "Jeste li sigurni da želite otkazati bonus?",
    forfeitBonusConfirm: "Potvrdi",
    forfeitBonusCancel: "Otkaži",
    bonusClaimSuccessMessage: "Preuzet bonus!",
    bonusClaimErrorMessage: "Nevažeći bonus"
  },
  "pt-br": {
    titleBonuses: "Títulos ativos",
    bonusCode: "Você tem um código de bônus?",
    getBonus: "Reivindicar bônus",
    invalidBonusCode: "O código de bônus emitido é inválido",
    noActiveBonuses: "Não possui títulos ativos no momento",
    forfeitBonus: "Tem certeza de que deseja recusar o bônus?",
    forfeitBonusConfirm: "confirme",
    forfeitBonusCancel: "Cancelar",
    bonusClaimSuccessMessage: "Bônus ativado",
    bonusClaimErrorMessage: "Voucher inválido"
  },
  "es-mx": {
    titleBonuses: "Bonos activos",
    bonusCode: "¿Tiene código de bonos?",
    getBonus: "Reclamar bono",
    invalidBonusCode: "El código de bono emitido es inválido",
    noActiveBonuses: "No tiene bonos activos al momento",
    forfeitBonus: "¿ Está seguro que quiere declinar el bono?",
    forfeitBonusConfirm: "Confirmar",
    forfeitBonusCancel: "Cancelar",
    bonusClaimSuccessMessage: "Bono activado",
    bonusClaimErrorMessage: "Bono inválido"
  },
  tr: {
    titleBonuses: "Aktif Bonuslar",
    bonusCode: "Bonus kodunuz var mı?",
    getBonus: "Bonusu Al",
    invalidBonusCode: "Sağlanan bonus kodu geçersiz.",
    noActiveBonuses: "Şu anda aktif bonusunuz yok.",
    forfeitBonus: "Bonusu kaybetmek istediğinizden emin misiniz?",
    forfeitBonusConfirm: "Onaylamak",
    forfeitBonusCancel: "İptal etmek",
    bonusClaimSuccessMessage: "Bonus talep edildi!",
    bonusClaimErrorMessage: "Geçersiz bonus"
  },
  "en-us": {
    titleBonuses: "Active Bonuses",
    bonusCode: "Do you have a bonus code?",
    getBonus: "Get Bonus",
    invalidBonusCode: "The bonus code provided is invalid.",
    noActiveBonuses: "You have no active bonuses at the moment.",
    forfeitBonus: "Are you sure want to forfeit bonus?",
    forfeitBonusConfirm: "Confirm",
    forfeitBonusCancel: "Cancel",
    bonusClaimSuccessMessage: "Bonus claimed!",
    bonusClaimErrorMessage: "Invalid bonus"
  }
}, _e = {
  CLAIM: "/v1/bonus/claim",
  FORFEIT: "/v1/bonus/forfeit",
  GRANTED: "/v1/bonus/granted"
}, Ie = {
  TYPES: "standard,freeBet,freeRound,cashBack,stakeBack,oddsBoost,wagering",
  STATUS_ACTIVE: "active",
  STATUS_COMPLETED: "completed,released,forfeited,expired,closed"
}, An = {
  ODDS_BOOST: "oddsBoost"
};
function ve(o) {
  return ne(this, arguments, function* (n, e = {}) {
    const i = typeof n == "string" ? n : n.toString(), s = yield fetch(i, e);
    let a = null;
    try {
      a = yield s.json();
    } catch (u) {
      a = null;
    }
    if (s.ok && a)
      return a;
    const r = a && typeof a == "object" ? a : {}, d = {
      success: !1,
      errorMessage: typeof r.errorMessage == "string" && r.errorMessage || s.statusText || String(s.status),
      errorCode: typeof r.errorCode == "number" ? r.errorCode : void 0
    };
    return ue(ue({}, r), d);
  });
}
function kn(n, e, o) {
  return ne(this, null, function* () {
    const i = `${n}${_e.CLAIM}`;
    return ve(i, {
      method: "PUT",
      headers: {
        "x-SessionId": e,
        accept: "application/json",
        "Content-Type": "application/json-patch+json"
      },
      body: JSON.stringify(o)
    });
  });
}
function En(n, e, o) {
  return ne(this, null, function* () {
    const i = new URL(`${n}${_e.FORFEIT}`);
    return i.searchParams.append("bonusWalletID", o.bonusWalletID), ve(i, {
      method: "DELETE",
      headers: {
        "x-SessionId": e,
        accept: "application/json"
      }
    });
  });
}
function Sn(n, e, o) {
  return ne(this, null, function* () {
    const i = new URL(`${n}${_e.GRANTED}`);
    Object.entries(o).forEach(([a, r]) => {
      r != null && i.searchParams.append(a, String(r));
    });
    const s = {};
    return e && (s["x-SessionId"] = e), ve(i, {
      headers: s
    });
  });
}
if (typeof window != "undefined") {
  let n = function(e) {
    return function(...o) {
      try {
        return e.apply(this, o);
      } catch (i) {
        if (i instanceof DOMException && i.message.includes("has already been used with this registry") || i.message.includes("Cannot define multiple custom elements with the same tag name"))
          return !1;
        throw i;
      }
    };
  };
  customElements.define = n(customElements.define), import("./PlayerBonusCard-Boengfte.js").then(({ default: e }) => {
    !customElements.get("player-bonus-card") && customElements.define("player-bonus-card", e.element);
  });
}
function Pn(n) {
  bn(n, "svelte-2jgm79", '.ActiveBonusesWrapper{color:var(--emw--pam-typography, var(--emw--color-contrast, #07072A));padding:50px;max-width:850px}.ActiveBonusesWrapper.ActiveBonusesWrapperMobile{padding:20px 15px;max-width:unset}.MenuReturnButton{color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));display:inline-flex;align-items:center;column-gap:10px;margin-bottom:30px}.MenuReturnButton svg{fill:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))}.ActiveBonusesTitle{font-size:26px;color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));font-weight:400}.ActiveBonusesTitleMobile{font-size:16px}.ActiveBonusesTitleNone{display:none}.BonusCodeContainer{color:var(--emw--color-gray-300, #58586B);display:flex;flex-direction:column;padding-bottom:30px;position:relative;width:70%}.BonusCodeContainer label{font-size:16px;font-weight:300;padding-bottom:5px}.BonusCodeContainer.BonusCodeContainerMobile{width:100%}.BonusCodeContainer .BonusCodeWrapper{display:flex;gap:10px}.BonusCodeContainer .BonusCodeWrapper.BonusCodeWrapperMobile{flex-direction:column}.BonusCodeContainer .BonusCodeWrapper .BonusCodeInput{width:70%;height:44px;border:1px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--pam-contrast, var(--emw--color-contrast, #07072A));border-radius:5px;box-sizing:border-box;padding:5px 15px;font-size:16px;line-height:18px}.BonusCodeContainer .BonusCodeWrapper .BonusCodeInput:focus{outline-color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))}.BonusCodeContainer .BonusCodeWrapper .BonusCodeInput.BonusCodeInputMobile{width:100%}.BonusCodeContainer .BonusCodeWrapper .SubmitBonusCode{background:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));border:1px solid var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));color:var(--emw--color-white, #FFFFFF);cursor:pointer;border-radius:5px;width:30%;height:44px;font-size:15px;text-transform:uppercase;text-align:center;transition-duration:0.3s;box-sizing:border-box;padding:10px}.BonusCodeContainer .BonusCodeWrapper .SubmitBonusCode[disabled]{opacity:0.3;cursor:not-allowed}.BonusCodeContainer .BonusCodeWrapper .SubmitBonusCode:hover{filter:brightness(0.9)}.BonusCodeContainer .BonusCodeWrapper .SubmitBonusCode.SubmitBonusCodeMobile{width:100%}.BonusCodeContainer .BonusCodeWrapper .SubmitBonusCode:active{background:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))}.BonusCodeContainer.InvalidField input{border:1px solid var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));background:var(--emw--color-primary-50, var(--emw--color-pink-50, #F1BED9));color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))}.BonusCodeContainer .InvalidBonusCodeMessage{color:var(--emw--color-error, var(--emw--color-red, #FD2839))}.BonusCodeWrapper{display:flex;gap:20px}.SubmitBonusCode{background:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));border:1px solid var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));color:var(--emw--color-white, #FFFFFF);cursor:pointer;border-radius:5px;width:30%;height:44px;font-size:15px;text-transform:uppercase;text-align:center;transition-duration:0.3s;box-sizing:border-box;padding:10px}.SubmitBonusCode[disabled]{opacity:0.3}.SubmitBonusCode:hover{filter:brightness(0.9)}.SubmitBonusCode:active{background:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))}.ActiveBonusesGrid{display:grid;grid-template-columns:1fr 1fr;gap:50px}.ActiveBonusesGrid.ActiveBonusesGridMobile{grid-template-columns:1fr}.ModalWrapper{position:fixed;top:0;right:0;bottom:0;left:0;background-color:rgba(0, 0, 0, 0.7);display:flex;justify-content:center;align-items:center;z-index:300}.ModalWrapper .ModalContent{background-color:var(--emw--color-white, #FFFFFF);position:relative;padding:30px;border-top:5px solid var(--emw--color-secondary, var(--emw--color-secondary, #FD2839));border-radius:5px}.ModalWrapper .ModalBody{background-color:var(--emw--color-gray-50, #F9F8F8);padding:30px;text-align:center}.ModalWrapper .ModalBody .ModalText{font-size:22px;margin-bottom:40px}.ModalWrapper .ModalBody .ModalButtons{display:flex;gap:36px}.ModalWrapper .ModalBody .ModalCancel,.ModalWrapper .ModalBody .ModalConfirm{background:transparent;border:1px solid var(--emw--color-gray-300, #58586B);color:var(--emw--color-gray-300, #58586B);cursor:pointer;border-radius:5px;width:200px;height:50px;font-size:16px;text-transform:uppercase;text-align:center;transition-duration:0.3s;box-sizing:border-box;padding:10px}.ModalWrapper .ModalBody .ModalConfirm{background:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));border:1px solid var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));color:var(--emw--button-typography, var(--emw--color-white, #FFFFFF))}.ModalWrapper.ModalWrapperMobile .ModalContent{padding:20px;width:80vw;border-top:none}.ModalWrapper.ModalWrapperMobile .ModalBody{padding:0;background:transparent}.ModalWrapper.ModalWrapperMobile .ModalText{font-size:16px}.ModalWrapper.ModalWrapperMobile .ModalButtons{gap:10px}.ModalWrapper.ModalWrapperMobile .ModalCancel,.ModalWrapper.ModalWrapperMobile .ModalConfirm{height:40px;width:50%;font-size:14px}.BonusesPaginationWrapper{margin:40px 0;display:block;line-break:anywhere;line-height:2em}.BonusesPaginationWrapper.BonusesPaginationWrapperMobile{text-align:center}.BonusesPaginationWrapper .BonusesFirst,.BonusesPaginationWrapper .BonusesPrev,.BonusesPaginationWrapper .BonusesNext,.BonusesPaginationWrapper .BonusesLast,.BonusesPaginationWrapper .BonusesPage{all:unset;box-sizing:border-box;cursor:pointer}.BonusesPaginationWrapper .BonusesFirst,.BonusesPaginationWrapper .BonusesPrev,.BonusesPaginationWrapper .BonusesNext,.BonusesPaginationWrapper .BonusesLast{color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));font-size:16px;cursor:pointer;padding:5px 10px;font-weight:700}.BonusesPaginationWrapper .BonusesFirst.Inactive,.BonusesPaginationWrapper .BonusesPrev.Inactive,.BonusesPaginationWrapper .BonusesNext.Inactive,.BonusesPaginationWrapper .BonusesLast.Inactive{color:var(--emw--color-gray-100, #E6E6E6);cursor:default}.BonusesPaginationWrapper .BonusesPage{margin:0 5px;color:var(--emw--color-gray-300, #58586B);font-size:16px;cursor:pointer;padding:5px 10px;white-space:nowrap}.BonusesPaginationWrapper .BonusesPage.BonusPageActive{background-color:var(--emw--color-white, #FFFFFF);font-weight:700;cursor:default}.ModalLoader{width:300px;height:300px;margin:0 auto;display:flex;align-items:center;justify-content:center}.ModalLoader:after{content:" ";display:block;width:64px;height:64px;margin:8px;border-radius:50%;border:5px solid var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));border-color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E)) transparent var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E)) transparent;animation:Loader 1.2s linear infinite}@keyframes Loader{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}');
}
function Fe(n, e, o) {
  const i = n.slice();
  return i[57] = e[o], i[59] = o, i;
}
function Re(n, e, o) {
  const i = n.slice();
  return i[60] = e[o], i;
}
function Tn(n) {
  let e, o, i, s, a, r, d, u, f, y, M = (
    /*$_*/
    n[21]("titleBonuses") + ""
  ), A, v, h;
  return {
    c() {
      e = W("div"), o = ae("svg"), i = ae("defs"), s = ae("style"), a = O(`.aaa {
                fill: var(--emw--pam-color-primary, var(--emw--color-primary, #22b04e));
              }
            `), r = ae("g"), d = ae("g"), u = ae("path"), f = N(), y = W("h2"), A = O(M), _(u, "class", "aaa"), _(u, "d", "M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z"), _(u, "transform", "translate(15 15) rotate(180)"), _(d, "transform", "translate(20 158)"), _(r, "transform", "translate(-20 -158)"), _(o, "xmlns", "http://www.w3.org/2000/svg"), _(o, "width", "15"), _(o, "height", "15"), _(o, "viewBox", "0 0 15 15"), _(y, "class", "ActiveBonusesTitleMobile"), _(e, "class", "MenuReturnButton");
    },
    m(w, C) {
      j(w, e, C), p(e, o), p(o, i), p(i, s), p(s, a), p(o, r), p(r, d), p(d, u), p(e, f), p(e, y), p(y, A), v || (h = G(
        e,
        "click",
        /*click_handler*/
        n[36]
      ), v = !0);
    },
    p(w, C) {
      C[0] & /*$_*/
      2097152 && M !== (M = /*$_*/
      w[21]("titleBonuses") + "") && K(A, M);
    },
    d(w) {
      w && D(e), v = !1, h();
    }
  };
}
function Le(n) {
  let e, o = (
    /*$_*/
    n[21]("invalidBonusCode") + ""
  ), i;
  return {
    c() {
      e = W("p"), i = O(o), _(e, "class", "InvalidBonusCodeMessage");
    },
    m(s, a) {
      j(s, e, a), p(e, i);
    },
    p(s, a) {
      a[0] & /*$_*/
      2097152 && o !== (o = /*$_*/
      s[21]("invalidBonusCode") + "") && K(i, o);
    },
    d(s) {
      s && D(e);
    }
  };
}
function In(n) {
  let e, o, i;
  function s(u, f) {
    return (
      /*activeBonusesList*/
      u[19].length === 0 ? Ln : Rn
    );
  }
  let a = s(n), r = a(n), d = (
    /*activeBonusesList*/
    n[19].length !== 0 && Ne(n)
  );
  return {
    c() {
      e = W("div"), r.c(), o = N(), d && d.c(), i = Be(), _(e, "class", "ActiveBonusesGrid " + /*isMobile*/
      (n[22] ? "ActiveBonusesGridMobile" : ""));
    },
    m(u, f) {
      j(u, e, f), r.m(e, null), j(u, o, f), d && d.m(u, f), j(u, i, f);
    },
    p(u, f) {
      a === (a = s(u)) && r ? r.p(u, f) : (r.d(1), r = a(u), r && (r.c(), r.m(e, null))), /*activeBonusesList*/
      u[19].length !== 0 ? d ? d.p(u, f) : (d = Ne(u), d.c(), d.m(i.parentNode, i)) : d && (d.d(1), d = null);
    },
    d(u) {
      u && (D(e), D(o), D(i)), r.d(), d && d.d(u);
    }
  };
}
function Fn(n) {
  let e;
  return {
    c() {
      e = W("div"), _(e, "class", "ModalLoader"), _(e, "part", "ModalLoader");
    },
    m(o, i) {
      j(o, e, i);
    },
    p: be,
    d(o) {
      o && D(e);
    }
  };
}
function Rn(n) {
  let e, o = de(
    /*activeBonusesList*/
    n[19]
  ), i = [];
  for (let s = 0; s < o.length; s += 1)
    i[s] = ze(Re(n, o, s));
  return {
    c() {
      for (let s = 0; s < i.length; s += 1)
        i[s].c();
      e = Be();
    },
    m(s, a) {
      for (let r = 0; r < i.length; r += 1)
        i[r] && i[r].m(s, a);
      j(s, e, a);
    },
    p(s, a) {
      if (a[0] & /*activeBonusesList, lang, dateformat, clientstyling, clientstylingurl, mbsource, translationurl, currencylocale, ishiddenwageringbonus, filterbonusbalance*/
      524799) {
        o = de(
          /*activeBonusesList*/
          s[19]
        );
        let r;
        for (r = 0; r < o.length; r += 1) {
          const d = Re(s, o, r);
          i[r] ? i[r].p(d, a) : (i[r] = ze(d), i[r].c(), i[r].m(e.parentNode, e));
        }
        for (; r < i.length; r += 1)
          i[r].d(1);
        i.length = o.length;
      }
    },
    d(s) {
      s && D(e), je(i, s);
    }
  };
}
function Ln(n) {
  let e, o = (
    /*$_*/
    n[21]("noActiveBonuses") + ""
  ), i;
  return {
    c() {
      e = W("p"), i = O(o);
    },
    m(s, a) {
      j(s, e, a), p(e, i);
    },
    p(s, a) {
      a[0] & /*$_*/
      2097152 && o !== (o = /*$_*/
      s[21]("noActiveBonuses") + "") && K(i, o);
    },
    d(s) {
      s && D(e);
    }
  };
}
function zn(n) {
  let e, o, i, s, a, r, d, u, f, y, M, A, v, h, w, C, m, c;
  return {
    c() {
      e = W("player-bonus-card"), t(e, "termsandconditionsdescription", o = /*activeBonus*/
      n[60].termsandconditionsdescription), t(e, "termsandconditionsurl", i = /*activeBonus*/
      n[60].termsandconditionsurl), t(e, "termsandconditionsasset", s = /*activeBonus*/
      n[60].termsandconditionsasset), t(e, "endpoint", a = /*activeBonus*/
      n[60].endpoint), t(e, "playerid", r = /*activeBonus*/
      n[60].playerid), t(e, "session", d = /*activeBonus*/
      n[60].session), t(e, "bonuswalletid", u = /*activeBonus*/
      n[60].walletId), t(e, "bonusdate", f = /*activeBonus*/
      n[60].granted), t(e, "bonusexpirationdate", y = /*activeBonus*/
      n[60].expiryTime), t(e, "bonusstatus", M = /*activeBonus*/
      n[60].status), t(e, "bonusname", A = /*activeBonus*/
      n[60].name), t(e, "bonustype", v = /*activeBonus*/
      n[60].type), t(e, "bonusamount", h = /*activeBonus*/
      n[60].extension.grantedPlayerCurrencyAmount), t(e, "bonuswageringamount", w = `${/*activeBonus*/
      n[60].fulfilledWR} / ${/*activeBonus*/
      n[60].originalWageringRequirement}`), t(e, "bonusremainingamount", C = /*activeBonus*/
      n[60].currentAmount), t(e, "bonuscurrency", m = /*activeBonus*/
      n[60].currency), t(e, "isWinBonus", c = /*activeBonus*/
      n[60].isWinBonus), t(
        e,
        "lang",
        /*lang*/
        n[0]
      ), t(
        e,
        "dateformat",
        /*dateformat*/
        n[6]
      ), t(
        e,
        "clientstyling",
        /*clientstyling*/
        n[1]
      ), t(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        n[2]
      ), t(
        e,
        "mbsource",
        /*mbsource*/
        n[3]
      ), t(
        e,
        "translationurl",
        /*translationurl*/
        n[4]
      ), t(
        e,
        "currencylocale",
        /*currencylocale*/
        n[5]
      ), t(
        e,
        "ishiddenwageringbonus",
        /*ishiddenwageringbonus*/
        n[7]
      ), t(
        e,
        "filterbonusbalance",
        /*filterbonusbalance*/
        n[8]
      );
    },
    m(g, B) {
      j(g, e, B);
    },
    p(g, B) {
      B[0] & /*activeBonusesList*/
      524288 && o !== (o = /*activeBonus*/
      g[60].termsandconditionsdescription) && t(e, "termsandconditionsdescription", o), B[0] & /*activeBonusesList*/
      524288 && i !== (i = /*activeBonus*/
      g[60].termsandconditionsurl) && t(e, "termsandconditionsurl", i), B[0] & /*activeBonusesList*/
      524288 && s !== (s = /*activeBonus*/
      g[60].termsandconditionsasset) && t(e, "termsandconditionsasset", s), B[0] & /*activeBonusesList*/
      524288 && a !== (a = /*activeBonus*/
      g[60].endpoint) && t(e, "endpoint", a), B[0] & /*activeBonusesList*/
      524288 && r !== (r = /*activeBonus*/
      g[60].playerid) && t(e, "playerid", r), B[0] & /*activeBonusesList*/
      524288 && d !== (d = /*activeBonus*/
      g[60].session) && t(e, "session", d), B[0] & /*activeBonusesList*/
      524288 && u !== (u = /*activeBonus*/
      g[60].walletId) && t(e, "bonuswalletid", u), B[0] & /*activeBonusesList*/
      524288 && f !== (f = /*activeBonus*/
      g[60].granted) && t(e, "bonusdate", f), B[0] & /*activeBonusesList*/
      524288 && y !== (y = /*activeBonus*/
      g[60].expiryTime) && t(e, "bonusexpirationdate", y), B[0] & /*activeBonusesList*/
      524288 && M !== (M = /*activeBonus*/
      g[60].status) && t(e, "bonusstatus", M), B[0] & /*activeBonusesList*/
      524288 && A !== (A = /*activeBonus*/
      g[60].name) && t(e, "bonusname", A), B[0] & /*activeBonusesList*/
      524288 && v !== (v = /*activeBonus*/
      g[60].type) && t(e, "bonustype", v), B[0] & /*activeBonusesList*/
      524288 && h !== (h = /*activeBonus*/
      g[60].extension.grantedPlayerCurrencyAmount) && t(e, "bonusamount", h), B[0] & /*activeBonusesList*/
      524288 && w !== (w = `${/*activeBonus*/
      g[60].fulfilledWR} / ${/*activeBonus*/
      g[60].originalWageringRequirement}`) && t(e, "bonuswageringamount", w), B[0] & /*activeBonusesList*/
      524288 && C !== (C = /*activeBonus*/
      g[60].currentAmount) && t(e, "bonusremainingamount", C), B[0] & /*activeBonusesList*/
      524288 && m !== (m = /*activeBonus*/
      g[60].currency) && t(e, "bonuscurrency", m), B[0] & /*activeBonusesList*/
      524288 && c !== (c = /*activeBonus*/
      g[60].isWinBonus) && t(e, "isWinBonus", c), B[0] & /*lang*/
      1 && t(
        e,
        "lang",
        /*lang*/
        g[0]
      ), B[0] & /*dateformat*/
      64 && t(
        e,
        "dateformat",
        /*dateformat*/
        g[6]
      ), B[0] & /*clientstyling*/
      2 && t(
        e,
        "clientstyling",
        /*clientstyling*/
        g[1]
      ), B[0] & /*clientstylingurl*/
      4 && t(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        g[2]
      ), B[0] & /*mbsource*/
      8 && t(
        e,
        "mbsource",
        /*mbsource*/
        g[3]
      ), B[0] & /*translationurl*/
      16 && t(
        e,
        "translationurl",
        /*translationurl*/
        g[4]
      ), B[0] & /*currencylocale*/
      32 && t(
        e,
        "currencylocale",
        /*currencylocale*/
        g[5]
      ), B[0] & /*ishiddenwageringbonus*/
      128 && t(
        e,
        "ishiddenwageringbonus",
        /*ishiddenwageringbonus*/
        g[7]
      ), B[0] & /*filterbonusbalance*/
      256 && t(
        e,
        "filterbonusbalance",
        /*filterbonusbalance*/
        g[8]
      );
    },
    d(g) {
      g && D(e);
    }
  };
}
function Nn(n) {
  let e, o, i, s, a, r, d, u, f, y, M, A, v, h, w, C;
  return {
    c() {
      e = W("player-bonus-card"), t(e, "termsandconditionsdescription", o = /*activeBonus*/
      n[60].termsandconditionsdescription), t(e, "termsandconditionsurl", i = /*activeBonus*/
      n[60].termsandconditionsurl), t(e, "termsandconditionsasset", s = /*activeBonus*/
      n[60].termsandconditionsasset), t(e, "endpoint", a = /*activeBonus*/
      n[60].endpoint), t(e, "playerid", r = /*activeBonus*/
      n[60].playerid), t(e, "session", d = /*activeBonus*/
      n[60].session), t(e, "bonuswalletid", u = /*activeBonus*/
      n[60].walletId), t(e, "bonusdate", f = /*activeBonus*/
      n[60].granted), t(e, "bonusexpirationdate", y = /*activeBonus*/
      n[60].expiryTime), t(e, "bonusstatus", M = /*activeBonus*/
      n[60].status), t(e, "bonusname", A = /*activeBonus*/
      n[60].name), t(e, "bonustype", v = /*activeBonus*/
      n[60].type), t(e, "bonuscurrency", h = /*activeBonus*/
      n[60].currency), t(e, "bonusfreespins", w = /*activeBonus*/
      n[60].freeRoundNumber), t(e, "isWinBonus", C = /*activeBonus*/
      n[60].isWinBonus), t(
        e,
        "lang",
        /*lang*/
        n[0]
      ), t(
        e,
        "dateformat",
        /*dateformat*/
        n[6]
      ), t(
        e,
        "clientstyling",
        /*clientstyling*/
        n[1]
      ), t(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        n[2]
      ), t(
        e,
        "mbsource",
        /*mbsource*/
        n[3]
      ), t(
        e,
        "translationurl",
        /*translationurl*/
        n[4]
      ), t(
        e,
        "currencylocale",
        /*currencylocale*/
        n[5]
      ), t(
        e,
        "ishiddenwageringbonus",
        /*ishiddenwageringbonus*/
        n[7]
      ), t(
        e,
        "filterbonusbalance",
        /*filterbonusbalance*/
        n[8]
      );
    },
    m(m, c) {
      j(m, e, c);
    },
    p(m, c) {
      c[0] & /*activeBonusesList*/
      524288 && o !== (o = /*activeBonus*/
      m[60].termsandconditionsdescription) && t(e, "termsandconditionsdescription", o), c[0] & /*activeBonusesList*/
      524288 && i !== (i = /*activeBonus*/
      m[60].termsandconditionsurl) && t(e, "termsandconditionsurl", i), c[0] & /*activeBonusesList*/
      524288 && s !== (s = /*activeBonus*/
      m[60].termsandconditionsasset) && t(e, "termsandconditionsasset", s), c[0] & /*activeBonusesList*/
      524288 && a !== (a = /*activeBonus*/
      m[60].endpoint) && t(e, "endpoint", a), c[0] & /*activeBonusesList*/
      524288 && r !== (r = /*activeBonus*/
      m[60].playerid) && t(e, "playerid", r), c[0] & /*activeBonusesList*/
      524288 && d !== (d = /*activeBonus*/
      m[60].session) && t(e, "session", d), c[0] & /*activeBonusesList*/
      524288 && u !== (u = /*activeBonus*/
      m[60].walletId) && t(e, "bonuswalletid", u), c[0] & /*activeBonusesList*/
      524288 && f !== (f = /*activeBonus*/
      m[60].granted) && t(e, "bonusdate", f), c[0] & /*activeBonusesList*/
      524288 && y !== (y = /*activeBonus*/
      m[60].expiryTime) && t(e, "bonusexpirationdate", y), c[0] & /*activeBonusesList*/
      524288 && M !== (M = /*activeBonus*/
      m[60].status) && t(e, "bonusstatus", M), c[0] & /*activeBonusesList*/
      524288 && A !== (A = /*activeBonus*/
      m[60].name) && t(e, "bonusname", A), c[0] & /*activeBonusesList*/
      524288 && v !== (v = /*activeBonus*/
      m[60].type) && t(e, "bonustype", v), c[0] & /*activeBonusesList*/
      524288 && h !== (h = /*activeBonus*/
      m[60].currency) && t(e, "bonuscurrency", h), c[0] & /*activeBonusesList*/
      524288 && w !== (w = /*activeBonus*/
      m[60].freeRoundNumber) && t(e, "bonusfreespins", w), c[0] & /*activeBonusesList*/
      524288 && C !== (C = /*activeBonus*/
      m[60].isWinBonus) && t(e, "isWinBonus", C), c[0] & /*lang*/
      1 && t(
        e,
        "lang",
        /*lang*/
        m[0]
      ), c[0] & /*dateformat*/
      64 && t(
        e,
        "dateformat",
        /*dateformat*/
        m[6]
      ), c[0] & /*clientstyling*/
      2 && t(
        e,
        "clientstyling",
        /*clientstyling*/
        m[1]
      ), c[0] & /*clientstylingurl*/
      4 && t(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        m[2]
      ), c[0] & /*mbsource*/
      8 && t(
        e,
        "mbsource",
        /*mbsource*/
        m[3]
      ), c[0] & /*translationurl*/
      16 && t(
        e,
        "translationurl",
        /*translationurl*/
        m[4]
      ), c[0] & /*currencylocale*/
      32 && t(
        e,
        "currencylocale",
        /*currencylocale*/
        m[5]
      ), c[0] & /*ishiddenwageringbonus*/
      128 && t(
        e,
        "ishiddenwageringbonus",
        /*ishiddenwageringbonus*/
        m[7]
      ), c[0] & /*filterbonusbalance*/
      256 && t(
        e,
        "filterbonusbalance",
        /*filterbonusbalance*/
        m[8]
      );
    },
    d(m) {
      m && D(e);
    }
  };
}
function ze(n) {
  let e;
  function o(a, r) {
    return (
      /*activeBonus*/
      a[60].type === "freeRound" ? Nn : zn
    );
  }
  let i = o(n), s = i(n);
  return {
    c() {
      s.c(), e = Be();
    },
    m(a, r) {
      s.m(a, r), j(a, e, r);
    },
    p(a, r) {
      i === (i = o(a)) && s ? s.p(a, r) : (s.d(1), s = i(a), s && (s.c(), s.m(e.parentNode, e)));
    },
    d(a) {
      a && D(e), s.d(a);
    }
  };
}
function Ne(n) {
  let e, o, i, s, a, r, d, u, f, y, M, A, v, h, w, C, m, c, g, B, Y, Q, X, U = de(Array(
    /*numberOfPages*/
    n[17]
  )), k = [];
  for (let b = 0; b < U.length; b += 1)
    k[b] = Oe(Fe(n, U, b));
  return {
    c() {
      e = W("div"), o = W("button"), i = O("|<"), r = N(), d = W("button"), u = O("<"), M = N();
      for (let b = 0; b < k.length; b += 1)
        k[b].c();
      A = N(), v = W("button"), h = O(">"), m = N(), c = W("button"), g = O(">|"), o.disabled = s = /*currentPage*/
      n[18] === 0, _(o, "class", a = "BonusesFirst " + /*currentPage*/
      (n[18] === 0 ? "Inactive" : "")), d.disabled = f = /*currentPage*/
      n[18] === 0, _(d, "class", y = "BonusesPrev " + /*currentPage*/
      (n[18] === 0 ? "Inactive" : "")), v.disabled = w = /*currentPage*/
      n[18] === /*numberOfPages*/
      n[17] - 1, _(v, "class", C = "BonusesNext " + /*currentPage*/
      (n[18] === /*numberOfPages*/
      n[17] - 1 ? "Inactive" : "")), c.disabled = B = /*currentPage*/
      n[18] === /*numberOfPages*/
      n[17] - 1, _(c, "class", Y = "BonusesLast " + /*currentPage*/
      (n[18] === /*numberOfPages*/
      n[17] - 1 ? "Inactive" : "")), _(e, "class", "BonusesPaginationWrapper " + /*isMobile*/
      (n[22] ? "BonusesPaginationWrapperMobile" : ""));
    },
    m(b, P) {
      j(b, e, P), p(e, o), p(o, i), p(e, r), p(e, d), p(d, u), p(e, M);
      for (let S = 0; S < k.length; S += 1)
        k[S] && k[S].m(e, null);
      p(e, A), p(e, v), p(v, h), p(e, m), p(e, c), p(c, g), Q || (X = [
        G(
          o,
          "click",
          /*click_handler_1*/
          n[38]
        ),
        G(
          d,
          "click",
          /*click_handler_2*/
          n[39]
        ),
        G(
          v,
          "click",
          /*click_handler_4*/
          n[41]
        ),
        G(
          c,
          "click",
          /*click_handler_5*/
          n[42]
        )
      ], Q = !0);
    },
    p(b, P) {
      if (P[0] & /*currentPage*/
      262144 && s !== (s = /*currentPage*/
      b[18] === 0) && (o.disabled = s), P[0] & /*currentPage*/
      262144 && a !== (a = "BonusesFirst " + /*currentPage*/
      (b[18] === 0 ? "Inactive" : "")) && _(o, "class", a), P[0] & /*currentPage*/
      262144 && f !== (f = /*currentPage*/
      b[18] === 0) && (d.disabled = f), P[0] & /*currentPage*/
      262144 && y !== (y = "BonusesPrev " + /*currentPage*/
      (b[18] === 0 ? "Inactive" : "")) && _(d, "class", y), P[0] & /*currentPage, getActiveBonuses, numberOfPages*/
      33947648) {
        U = de(Array(
          /*numberOfPages*/
          b[17]
        ));
        let S;
        for (S = 0; S < U.length; S += 1) {
          const F = Fe(b, U, S);
          k[S] ? k[S].p(F, P) : (k[S] = Oe(F), k[S].c(), k[S].m(e, A));
        }
        for (; S < k.length; S += 1)
          k[S].d(1);
        k.length = U.length;
      }
      P[0] & /*currentPage, numberOfPages*/
      393216 && w !== (w = /*currentPage*/
      b[18] === /*numberOfPages*/
      b[17] - 1) && (v.disabled = w), P[0] & /*currentPage, numberOfPages*/
      393216 && C !== (C = "BonusesNext " + /*currentPage*/
      (b[18] === /*numberOfPages*/
      b[17] - 1 ? "Inactive" : "")) && _(v, "class", C), P[0] & /*currentPage, numberOfPages*/
      393216 && B !== (B = /*currentPage*/
      b[18] === /*numberOfPages*/
      b[17] - 1) && (c.disabled = B), P[0] & /*currentPage, numberOfPages*/
      393216 && Y !== (Y = "BonusesLast " + /*currentPage*/
      (b[18] === /*numberOfPages*/
      b[17] - 1 ? "Inactive" : "")) && _(c, "class", Y);
    },
    d(b) {
      b && D(e), je(k, b), Q = !1, ge(X);
    }
  };
}
function Oe(n) {
  let e, o = (
    /*i*/
    n[59] + 1 + ""
  ), i, s, a, r, d;
  function u() {
    return (
      /*click_handler_3*/
      n[40](
        /*i*/
        n[59]
      )
    );
  }
  return {
    c() {
      e = W("button"), i = O(o), e.disabled = s = /*i*/
      n[59] === /*currentPage*/
      n[18], _(e, "class", a = "BonusesPage " + /*i*/
      (n[59] === /*currentPage*/
      n[18] ? "BonusPageActive" : ""));
    },
    m(f, y) {
      j(f, e, y), p(e, i), r || (d = G(e, "click", u), r = !0);
    },
    p(f, y) {
      n = f, y[0] & /*currentPage*/
      262144 && s !== (s = /*i*/
      n[59] === /*currentPage*/
      n[18]) && (e.disabled = s), y[0] & /*currentPage*/
      262144 && a !== (a = "BonusesPage " + /*i*/
      (n[59] === /*currentPage*/
      n[18] ? "BonusPageActive" : "")) && _(e, "class", a);
    },
    d(f) {
      f && D(e), r = !1, d();
    }
  };
}
function De(n) {
  let e, o, i, s, a = (
    /*$_*/
    n[21]("forfeitBonus") + ""
  ), r, d, u, f, y = (
    /*$_*/
    n[21]("forfeitBonusCancel") + ""
  ), M, A, v, h = (
    /*$_*/
    n[21]("forfeitBonusConfirm") + ""
  ), w, C, m;
  return {
    c() {
      e = W("div"), o = W("div"), i = W("div"), s = W("p"), r = O(a), d = N(), u = W("div"), f = W("button"), M = O(y), A = N(), v = W("button"), w = O(h), _(s, "class", "ModalText"), _(f, "class", "ModalCancel"), _(v, "class", "ModalConfirm"), _(u, "class", "ModalButtons"), _(i, "class", "ModalBody"), _(o, "class", "ModalContent"), _(e, "class", "ModalWrapper " + /*isMobile*/
      (n[22] ? "ModalWrapperMobile" : ""));
    },
    m(c, g) {
      j(c, e, g), p(e, o), p(o, i), p(i, s), p(s, r), p(i, d), p(i, u), p(u, f), p(f, M), p(u, A), p(u, v), p(v, w), C || (m = [
        G(
          f,
          "click",
          /*closeBonusModal*/
          n[27]
        ),
        G(
          v,
          "click",
          /*debouncedFunction*/
          n[29](
            /*deleteBonus*/
            n[28]
          )
        )
      ], C = !0);
    },
    p(c, g) {
      g[0] & /*$_*/
      2097152 && a !== (a = /*$_*/
      c[21]("forfeitBonus") + "") && K(r, a), g[0] & /*$_*/
      2097152 && y !== (y = /*$_*/
      c[21]("forfeitBonusCancel") + "") && K(M, y), g[0] & /*$_*/
      2097152 && h !== (h = /*$_*/
      c[21]("forfeitBonusConfirm") + "") && K(w, h);
    },
    d(c) {
      c && D(e), C = !1, ge(m);
    }
  };
}
function On(n) {
  let e, o, i, s, a = (
    /*$_*/
    n[21]("titleBonuses") + ""
  ), r, d, u, f, y = (
    /*$_*/
    n[21]("bonusCode") + ""
  ), M, A, v, h, w, C, m = (
    /*$_*/
    n[21]("getBonus") + ""
  ), c, g, B, Y, Q, X, U, k = (
    /*isMobile*/
    n[22] && Tn(n)
  ), b = (
    /*invalidBonusCode*/
    n[12] && Le(n)
  );
  function P(E, L) {
    return (
      /*isLoading*/
      E[10] ? Fn : In
    );
  }
  let S = P(n), F = S(n), I = (
    /*bonusModal*/
    n[20] && De(n)
  );
  return {
    c() {
      e = W("div"), o = W("div"), k && k.c(), i = N(), s = W("h2"), r = O(a), d = N(), u = W("div"), f = W("label"), M = O(y), A = N(), v = W("div"), h = W("input"), w = N(), C = W("button"), c = O(m), B = N(), b && b.c(), Y = N(), F.c(), Q = N(), I && I.c(), _(s, "class", "ActiveBonusesTitle " + /*isMobile*/
      (n[22] ? "ActiveBonusesTitleNone" : "")), _(f, "for", "BonusCode"), _(h, "class", "BonusCodeInput " + /*isMobile*/
      (n[22] ? "BonusCodeInputMobile" : "")), _(h, "type", "text"), _(h, "id", "BonusCode"), _(C, "class", "SubmitBonusCode " + /*isMobile*/
      (n[22] ? "SubmitBonusCodeMobile" : "")), C.disabled = g = /*invalidBonusField*/
      n[11] || /*isLoading*/
      n[10], _(v, "class", "BonusCodeWrapper " + /*isMobile*/
      (n[22] ? "BonusCodeWrapperMobile" : "")), _(u, "class", "BonusCodeContainer " + /*isMobile*/
      (n[22] ? "BonusCodeContainerMobile" : "")), _(o, "class", "ActiveBonusesWrapper " + /*isMobile*/
      (n[22] ? "ActiveBonusesWrapperMobile" : ""));
    },
    m(E, L) {
      j(E, e, L), p(e, o), k && k.m(o, null), p(o, i), p(o, s), p(s, r), p(o, d), p(o, u), p(u, f), p(f, M), p(u, A), p(u, v), p(v, h), Se(
        h,
        /*bonusCode*/
        n[13]
      ), p(v, w), p(v, C), p(C, c), p(u, B), b && b.m(u, null), p(o, Y), F.m(o, null), p(e, Q), I && I.m(e, null), n[43](e), X || (U = [
        G(
          h,
          "input",
          /*input_input_handler*/
          n[37]
        ),
        G(
          h,
          "keyup",
          /*validateBonusCode*/
          n[24]
        ),
        G(
          C,
          "click",
          /*claimBonus*/
          n[26]
        )
      ], X = !0);
    },
    p(E, L) {
      /*isMobile*/
      E[22] && k.p(E, L), L[0] & /*$_*/
      2097152 && a !== (a = /*$_*/
      E[21]("titleBonuses") + "") && K(r, a), L[0] & /*$_*/
      2097152 && y !== (y = /*$_*/
      E[21]("bonusCode") + "") && K(M, y), L[0] & /*bonusCode*/
      8192 && h.value !== /*bonusCode*/
      E[13] && Se(
        h,
        /*bonusCode*/
        E[13]
      ), L[0] & /*$_*/
      2097152 && m !== (m = /*$_*/
      E[21]("getBonus") + "") && K(c, m), L[0] & /*invalidBonusField, isLoading*/
      3072 && g !== (g = /*invalidBonusField*/
      E[11] || /*isLoading*/
      E[10]) && (C.disabled = g), /*invalidBonusCode*/
      E[12] ? b ? b.p(E, L) : (b = Le(E), b.c(), b.m(u, null)) : b && (b.d(1), b = null), S === (S = P(E)) && F ? F.p(E, L) : (F.d(1), F = S(E), F && (F.c(), F.m(o, null))), /*bonusModal*/
      E[20] ? I ? I.p(E, L) : (I = De(E), I.c(), I.m(e, null)) : I && (I.d(1), I = null);
    },
    i: be,
    o: be,
    d(E) {
      E && D(e), k && k.d(), b && b.d(), F.d(), I && I.d(), n[43](null), X = !1, ge(U);
    }
  };
}
let Dn = "status=active", H = 6;
function jn(n, e, o) {
  let i;
  gn(n, Mn, (l) => o(21, i = l));
  let { endpoint: s = "" } = e, { session: a = "" } = e, { playerid: r = "" } = e, { lang: d = "en" } = e, { currency: u = "" } = e, { clientstyling: f = "" } = e, { clientstylingurl: y = "" } = e, { mbsource: M } = e, { translationurl: A = "" } = e, { currencylocale: v = "" } = e, { dateformat: h = "" } = e, { bonuscoderegex: w = "" } = e, { ishiddenwageringbonus: C = "false" } = e, { gmversion: m = "" } = e, { filterbonusbalance: c = "false" } = e, g = !1, B, Y, Q = window.navigator.userAgent, X = Bn(Q) !== "PC", U = !0, k = !1, b = "", P = 0, S = 0, F = 0, I = 0, E = 0, L = [], ye, ce = "", pe = !1;
  const Ue = () => {
    fetch(A).then((T) => T.json()).then((T) => {
      Object.keys(T).forEach((q) => {
        Pe(q, T[q]);
      });
    }).catch((T) => {
      console.log(T);
    });
  };
  Object.keys(Te).forEach((l) => {
    Pe(l, Te[l]);
  });
  const he = (l) => {
    if (l.data)
      switch (l.data.type) {
        case "DeleteActiveBonus":
          ce = l.data.bonuswalletid, o(20, pe = !0);
          break;
      }
  };
  function qe(l, T) {
    return (...q) => {
      clearTimeout(ye), ye = setTimeout(
        () => {
          l.apply(this, q);
        },
        T
      );
    };
  }
  const Ce = () => {
    window.postMessage(
      {
        type: "PlayerAccountMenuActive",
        isMobile: X
      },
      window.location.href
    );
  }, Ge = () => b ? w ? new RegExp(w).test(b) : !0 : !1, Ve = () => {
    o(11, U = !Ge()), w && o(12, k = U);
  };
  function He(l) {
    var oe, re, Z, se, R, x, $, ie, me, ee, J, te, We;
    const T = (oe = l.initialWagerRequirementAmount) != null ? oe : 0, q = (re = l.remainingWagerRequirementAmount) != null ? re : 0;
    return Ee(ue({}, l), {
      freeRoundNumber: (Z = l.numberOfFreeSpin) != null ? Z : void 0,
      walletId: (se = l.bonusWalletID) != null ? se : void 0,
      granted: (R = l.grantedDate) != null ? R : void 0,
      expiryTime: (x = l.expiryDate) != null ? x : void 0,
      currentAmount: ($ = l.remainingAmount) != null ? $ : void 0,
      originalWageringRequirement: (ie = l.initialWagerRequirementAmount) != null ? ie : void 0,
      fulfilledWR: T - q,
      extension: {
        grantedPlayerCurrencyAmount: (me = l.amount) != null ? me : void 0
      },
      termsandconditionsurl: (ee = l.url) != null ? ee : void 0,
      termsandconditionsdescription: (J = l.description) != null ? J : void 0,
      termsandconditionsasset: (te = l.assets) != null ? te : void 0,
      isWinBonus: ((We = l == null ? void 0 : l.tags) == null ? void 0 : We.includes("auto_apply")) === !0 && l.type === An.ODDS_BOOST
    });
  }
  const V = (l) => ne(this, null, function* () {
    var T, q, oe, re;
    o(10, g = !0);
    try {
      let Z = [], se = 0;
      if (m === "gm2") {
        console.log("getActiveBonuses - gm2", m);
        const R = {
          pagination: `limit=${H},offset=${l}`,
          language: d || "en",
          sortOrder: "desc",
          status: Ie.STATUS_ACTIVE,
          type: Ie.TYPES,
          expand: "freeSpin"
        };
        C === "true" && (R.includeHiddenWallet = !0);
        const x = yield Sn(s, a, R), $ = x.items;
        Array.isArray($) ? Z = $.map(He) : console.error("Unexpected granted bonuses payload", x), se = (T = x.total) != null ? T : 0;
      } else {
        console.log("getActiveBonuses - /bonusWallet", m);
        const R = {
          method: "GET",
          headers: { "X-SessionId": a }
        }, x = `/v1/player/${r}/bonusWallet`, $ = new URL(`${s}${x}`), ie = new URLSearchParams();
        ie.set("filter", Dn), ie.set("pagination", `offset=${l},limit=${H}`), $.search = ie.toString();
        const ee = yield (yield fetch($, R)).json();
        if (Array.isArray(ee.items)) {
          for (const J of ee.items) {
            const te = (oe = (q = J == null ? void 0 : J.extension) == null ? void 0 : q.bonus) == null ? void 0 : oe.presentation;
            te && (J.termsandconditionsurl = te.url, J.termsandconditionsdescription = te.description, J.termsandconditionsasset = te.assets);
          }
          Z = ee.items;
        } else
          console.error("Unexpected legacy bonus list payload", ee);
        se = (re = ee.total) != null ? re : 0;
      }
      o(17, I = Math.ceil(se / H)), l - H >= 0 && o(14, P = l - H), l + H < se && o(15, S = l + H), o(16, F = (I - 1) * H), o(18, E = l / H), o(19, L = Z), v && L.forEach((R) => {
        R.fulfilledWR = le(R.fulfilledWR), R.originalWageringRequirement = le(R.originalWageringRequirement), R.currentAmount = le(R.currentAmount), R.extension && (R.extension.grantedPlayerCurrencyAmount = le(R.extension.grantedPlayerCurrencyAmount));
      }), window.scrollTo({ top: 0, behavior: "smooth" });
    } catch (Z) {
      console.error(Z);
    } finally {
      o(10, g = !1);
    }
  }), le = (l) => new Intl.NumberFormat(v, { style: "currency", currency: u }).format(l).replace(/\s/g, ""), we = () => {
    console.log("post claim success, status 200"), o(12, k = !1), V(0), window.postMessage({ type: "ActiveBonusesUpdated" }, window.location.href), window.postMessage(
      {
        type: "WidgetNotification",
        data: {
          type: "success",
          message: i("bonusClaimSuccessMessage")
        }
      },
      window.location.href
    ), typeof gtag == "function" && gtag("event", "ClaimBonus", {
      context: "PlayerActiveBonuses",
      userId: `${r || "Not logged in"}`,
      bonusCode: `${b}`
    });
  }, Me = () => {
    o(12, k = !0), console.log("post claim error - status not 200"), window.postMessage(
      {
        type: "WidgetNotification",
        data: {
          type: "error",
          message: i("bonusClaimErrorMessage")
        }
      },
      window.location.href
    );
  }, Ye = () => ne(this, null, function* () {
    o(10, g = !0);
    try {
      if (m === "gm2") {
        if (!(yield kn(s, a, { bonusCode: b, currency: u })).success) {
          Me();
          //!
          return;
        }
        we();
        return;
      }
      const l = new URL(`${s}/v1/player/${r}/claimbonus`);
      l.searchParams.append("currency", u), l.searchParams.append("bonusCode", b);
      const T = {
        method: "POST",
        headers: {
          "X-SessionId": a,
          accept: "application/json"
        }
      };
      (yield fetch(l.href, T)).status == 200 ? we() : Me();
    } finally {
      o(10, g = !1);
    }
  }), fe = () => {
    window.postMessage({ type: "EnableScroll" }, window.location.href), o(20, pe = !1);
  }, Xe = () => ne(this, null, function* () {
    if (m === "gm2") {
      if (!(yield En(s, a, { bonusWalletID: ce })).success)
        return;
      V(0), window.postMessage({ type: "ActiveBonusesUpdated" }, window.location.href), fe();
      return;
    }
    const l = {
      method: "DELETE",
      headers: {
        "X-SessionId": a,
        "Content-Type": "application/json",
        Accept: "application/json"
      }
    }, T = new URL(`${s}/v1/player/${r}/bonusWallet`);
    T.searchParams.append("bonusWalletID", ce), (yield fetch(T, l)).status == 200 && (V(0), window.postMessage({ type: "ActiveBonusesUpdated" }, window.location.href), fe());
  }), Je = () => {
    Wn(d);
  };
  function Ke(l) {
    return qe(l, 1e3);
  }
  _n(() => (window.addEventListener("message", he, !1), () => {
    window.removeEventListener("message", he);
  }));
  const Qe = () => Ce();
  function Ze() {
    b = this.value, o(13, b);
  }
  const xe = () => V(0), $e = () => V(P), en = (l) => V(l * H), nn = () => V(S), on = () => V(F);
  function sn(l) {
    vn[l ? "unshift" : "push"](() => {
      B = l, o(9, B);
    });
  }
  return n.$$set = (l) => {
    "endpoint" in l && o(30, s = l.endpoint), "session" in l && o(31, a = l.session), "playerid" in l && o(32, r = l.playerid), "lang" in l && o(0, d = l.lang), "currency" in l && o(33, u = l.currency), "clientstyling" in l && o(1, f = l.clientstyling), "clientstylingurl" in l && o(2, y = l.clientstylingurl), "mbsource" in l && o(3, M = l.mbsource), "translationurl" in l && o(4, A = l.translationurl), "currencylocale" in l && o(5, v = l.currencylocale), "dateformat" in l && o(6, h = l.dateformat), "bonuscoderegex" in l && o(34, w = l.bonuscoderegex), "ishiddenwageringbonus" in l && o(7, C = l.ishiddenwageringbonus), "gmversion" in l && o(35, m = l.gmversion), "filterbonusbalance" in l && o(8, c = l.filterbonusbalance);
  }, n.$$.update = () => {
    n.$$.dirty[0] & /*lang*/
    1 && d && Je(), n.$$.dirty[0] & /*endpoint*/
    1073741824 | n.$$.dirty[1] & /*session, playerid*/
    3 && a && r && s && V(0), n.$$.dirty[0] & /*clientstyling, customStylingContainer*/
    514 && f && B && yn(B, f), n.$$.dirty[0] & /*clientstylingurl, customStylingContainer*/
    516 && y && B && hn(B, y), n.$$.dirty[0] & /*mbsource, customStylingContainer*/
    520 && M && B && Cn(B, `${M}.Style`, Y), n.$$.dirty[0] & /*translationurl*/
    16 && A && Ue();
  }, [
    d,
    f,
    y,
    M,
    A,
    v,
    h,
    C,
    c,
    B,
    g,
    U,
    k,
    b,
    P,
    S,
    F,
    I,
    E,
    L,
    pe,
    i,
    X,
    Ce,
    Ve,
    V,
    Ye,
    fe,
    Xe,
    Ke,
    s,
    a,
    r,
    u,
    w,
    m,
    Qe,
    Ze,
    xe,
    $e,
    en,
    nn,
    on,
    sn
  ];
}
class Un extends pn {
  constructor(e) {
    super(), fn(
      this,
      e,
      jn,
      On,
      mn,
      {
        endpoint: 30,
        session: 31,
        playerid: 32,
        lang: 0,
        currency: 33,
        clientstyling: 1,
        clientstylingurl: 2,
        mbsource: 3,
        translationurl: 4,
        currencylocale: 5,
        dateformat: 6,
        bonuscoderegex: 34,
        ishiddenwageringbonus: 7,
        gmversion: 35,
        filterbonusbalance: 8
      },
      Pn,
      [-1, -1, -1]
    );
  }
  get endpoint() {
    return this.$$.ctx[30];
  }
  set endpoint(e) {
    this.$$set({ endpoint: e }), z();
  }
  get session() {
    return this.$$.ctx[31];
  }
  set session(e) {
    this.$$set({ session: e }), z();
  }
  get playerid() {
    return this.$$.ctx[32];
  }
  set playerid(e) {
    this.$$set({ playerid: e }), z();
  }
  get lang() {
    return this.$$.ctx[0];
  }
  set lang(e) {
    this.$$set({ lang: e }), z();
  }
  get currency() {
    return this.$$.ctx[33];
  }
  set currency(e) {
    this.$$set({ currency: e }), z();
  }
  get clientstyling() {
    return this.$$.ctx[1];
  }
  set clientstyling(e) {
    this.$$set({ clientstyling: e }), z();
  }
  get clientstylingurl() {
    return this.$$.ctx[2];
  }
  set clientstylingurl(e) {
    this.$$set({ clientstylingurl: e }), z();
  }
  get mbsource() {
    return this.$$.ctx[3];
  }
  set mbsource(e) {
    this.$$set({ mbsource: e }), z();
  }
  get translationurl() {
    return this.$$.ctx[4];
  }
  set translationurl(e) {
    this.$$set({ translationurl: e }), z();
  }
  get currencylocale() {
    return this.$$.ctx[5];
  }
  set currencylocale(e) {
    this.$$set({ currencylocale: e }), z();
  }
  get dateformat() {
    return this.$$.ctx[6];
  }
  set dateformat(e) {
    this.$$set({ dateformat: e }), z();
  }
  get bonuscoderegex() {
    return this.$$.ctx[34];
  }
  set bonuscoderegex(e) {
    this.$$set({ bonuscoderegex: e }), z();
  }
  get ishiddenwageringbonus() {
    return this.$$.ctx[7];
  }
  set ishiddenwageringbonus(e) {
    this.$$set({ ishiddenwageringbonus: e }), z();
  }
  get gmversion() {
    return this.$$.ctx[35];
  }
  set gmversion(e) {
    this.$$set({ gmversion: e }), z();
  }
  get filterbonusbalance() {
    return this.$$.ctx[8];
  }
  set filterbonusbalance(e) {
    this.$$set({ filterbonusbalance: e }), z();
  }
}
wn(Un, { endpoint: {}, session: {}, playerid: {}, lang: {}, currency: {}, clientstyling: {}, clientstylingurl: {}, mbsource: {}, translationurl: {}, currencylocale: {}, dateformat: {}, bonuscoderegex: {}, ishiddenwageringbonus: {}, gmversion: {}, filterbonusbalance: {} }, [], [], !0);
export {
  Un as default
};
