import { a as U, $ as V, S as G, i as Z, s as F, f as k, b as J, n as L, d as W, r as K, c as R, e as o, g as v, h as q, j as l, l as z, k as M, m as A, t as P, o as Q, p as X, q as Y, u as $, v as I, w as tt, x as et, y as st, z as it, A as nt, B as lt } from "./GeneralLogout-hWNQ3J3o.js";
function D(e, t) {
  U(e, t);
}
function ot(e) {
  V.set(e);
}
const rt = {
  en: {
    titleBettingHistory: "Betting History",
    settledBets: "Settled Bets",
    openBets: "Open Bets"
  },
  ro: {
    titleBettingHistory: "Istoric Pariuri",
    settledBets: "Pariuri Decise",
    openBets: "Pariuri Deschise"
  },
  es: {
    titleBettingHistory: "Historial de Apuestas",
    settledBets: "Apuestas cerradas",
    openBets: "Apuestas abiertas"
  },
  hr: {
    titleBettingHistory: "Povijest klađenja",
    settledBets: "Obračunate oklade",
    openBets: "Otvorene oklade"
  },
  "pt-br": {
    titleBettingHistory: "Histórico de apostas",
    settledBets: "Apostas liquidadas",
    openBets: "apostas abertas"
  },
  "es-mx": {
    titleBettingHistory: "Historial de apuesta",
    settledBets: "Apuestas liquidadas",
    openBets: "Apuestas abiertas"
  },
  tr: {
    titleBettingHistory: "Bahis Geçmişi",
    settledBets: "Sonuçlandırılmış Bahisler",
    openBets: "Açık Bahisler"
  },
  "en-us": {
    titleBettingHistory: "Betting History",
    settledBets: "Settled Bets",
    openBets: "Open Bets"
  }
};
function at(e) {
  J(e, "svelte-1kgy21f", `@import 'https://static.everymatrix.com/omfe-widgets/s/widgets/1.2.0-alpha.0/widgets.min.css';:host{font-family:system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"}.BettingHistoryTitle{font-size:26px;color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));font-weight:400}.BettingHistoryTitle.BettingHistoryTitleMobile{font-size:16px}.BettingHistoryTitle.BettingHistoryTitleNone{display:none}.BettingHistoryWrapper{color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));padding:50px 50px 30px 50px;max-width:100%}.BettingHistoryWrapper.BettingHistoryWrapperMobile{padding:20px 15px;max-width:unset}.BettingHistoryTabs{width:100%;display:flex;justify-content:center}.BettingHistoryButton{margin:0;width:100%;padding:20px;border:none;font-size:24px;color:var(--emw--color-black, #000);background:var(--emw--color-white, #fff);border:2px solid var(--emw--color-black, #000)}.BettingHistoryButton.BettingHistoryButtonMobile{padding:20px;font-size:12px}.BettingHistoryButton.BettingHistoryButtonSelected{color:var(--emw--color-white, #fff);background:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));border:none}.MenuReturnButton{color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));display:inline-flex;align-items:center;column-gap:10px;margin-bottom:10px}.MenuReturnButton svg{fill:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))}.OM-MatchScore,.OM-MatchScore__List{display:flex;align-items:center;justify-content:center;list-style-type:none;margin:0;padding:0}`);
}
function ct(e) {
  let t, n, m, f, h, H, u, a, p, d, B = (
    /*$_*/
    e[4]("titleBettingHistory") + ""
  ), S, y, c;
  return {
    c() {
      t = M("div"), n = I("svg"), m = I("defs"), f = I("style"), h = P(".aaa{fill:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));}"), H = I("g"), u = I("g"), a = I("path"), p = A(), d = M("h2"), S = P(B), o(a, "class", "aaa"), o(a, "d", "M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z"), o(a, "transform", "translate(15 15) rotate(180)"), o(u, "transform", "translate(20 158)"), o(H, "transform", "translate(-20 -158)"), o(n, "xmlns", "http://www.w3.org/2000/svg"), o(n, "width", "15"), o(n, "height", "15"), o(n, "viewBox", "0 0 15 15"), o(d, "class", "BettingHistoryTitleMobile"), o(t, "class", "MenuReturnButton");
    },
    m(_, b) {
      q(_, t, b), l(t, n), l(n, m), l(m, f), l(f, h), l(n, H), l(H, u), l(u, a), l(t, p), l(t, d), l(d, S), y || (c = z(
        t,
        "click",
        /*click_handler*/
        e[14]
      ), y = !0);
    },
    p(_, b) {
      b & /*$_*/
      16 && B !== (B = /*$_*/
      _[4]("titleBettingHistory") + "") && R(S, B);
    },
    d(_) {
      _ && W(t), y = !1, c();
    }
  };
}
function N(e) {
  return { c: L, m: L, d: L };
}
function ut(e) {
  let t, n, m, f = (
    /*$_*/
    e[4]("bettingHistory.title") + ""
  ), h, H, u, a, p = (
    /*$_*/
    e[4]("bettingHistory.openBets") + ""
  ), d, B, S, y, c = (
    /*$_*/
    e[4]("bettingHistory.settledBets") + ""
  ), _, b, T, g, E, O, j, C, x, s = (
    /*isMobile*/
    e[5] && ct(e)
  ), i = (
    /*showModal*/
    e[3] === "true" && /*selectedBetId*/
    e[1] && N()
  );
  return {
    c() {
      t = M("div"), s && s.c(), n = A(), m = M("h2"), h = P(f), H = A(), u = M("div"), a = M("button"), d = P(p), S = A(), y = M("button"), _ = P(c), T = A(), g = M("om-betting-history-list"), E = A(), i && i.c(), O = A(), j = M("div"), o(m, "class", "BettingHistoryTitle " + /*isMobile*/
      (e[5] ? "BettingHistoryTitleNone" : "")), o(m, "part", "`BettingHistoryTitleMobile"), o(a, "class", B = `BettingHistoryButton ${/*isMobile*/
      e[5] ? "BettingHistoryButtonMobile" : ""} ${/*betstatus*/
      e[0] === "openBets" ? "BettingHistoryButtonSelected" : ""}`), o(y, "class", b = `BettingHistoryButton ${/*isMobile*/
      e[5] ? "BettingHistoryButtonMobile" : ""} ${/*betstatus*/
      e[0] === "settledBets" ? "BettingHistoryButtonSelected" : ""}`), o(u, "class", "BettingHistoryTabs"), v(
        g,
        "bet-status",
        /*betstatus*/
        e[0]
      ), v(g, "item-layout", "V2"), v(g, "match-score-layout", "v2"), v(g, "match-score-scope", "BHDetailed"), v(g, "date-format", "dd.mm.yyyy"), v(g, "time-format", "HH:MM"), v(g, "tournament-route", ":sportId/:tournamentId"), v(g, "match-route", ":betId"), o(j, "class", "OM-MatchScore OM-MatchScore__List"), o(t, "class", "BettingHistoryWrapper"), Q(
        t,
        "BettingHistoryWrapperMobile",
        /*isMobile*/
        e[5]
      );
    },
    m(r, w) {
      q(r, t, w), s && s.m(t, null), l(t, n), l(t, m), l(m, h), l(t, H), l(t, u), l(u, a), l(a, d), l(u, S), l(u, y), l(y, _), l(t, T), l(t, g), l(t, E), i && i.m(t, null), l(t, O), l(t, j), e[17](t), C || (x = [
        z(
          a,
          "click",
          /*click_handler_1*/
          e[15]
        ),
        z(
          y,
          "click",
          /*click_handler_2*/
          e[16]
        ),
        z(
          g,
          "routeChange",
          /*handleMoreDetails*/
          e[8]
        )
      ], C = !0);
    },
    p(r, [w]) {
      /*isMobile*/
      r[5] && s.p(r, w), w & /*$_*/
      16 && f !== (f = /*$_*/
      r[4]("bettingHistory.title") + "") && R(h, f), w & /*$_*/
      16 && p !== (p = /*$_*/
      r[4]("bettingHistory.openBets") + "") && R(d, p), w & /*betstatus*/
      1 && B !== (B = `BettingHistoryButton ${/*isMobile*/
      r[5] ? "BettingHistoryButtonMobile" : ""} ${/*betstatus*/
      r[0] === "openBets" ? "BettingHistoryButtonSelected" : ""}`) && o(a, "class", B), w & /*$_*/
      16 && c !== (c = /*$_*/
      r[4]("bettingHistory.settledBets") + "") && R(_, c), w & /*betstatus*/
      1 && b !== (b = `BettingHistoryButton ${/*isMobile*/
      r[5] ? "BettingHistoryButtonMobile" : ""} ${/*betstatus*/
      r[0] === "settledBets" ? "BettingHistoryButtonSelected" : ""}`) && o(y, "class", b), w & /*betstatus*/
      1 && v(
        g,
        "bet-status",
        /*betstatus*/
        r[0]
      ), /*showModal*/
      r[3] === "true" && /*selectedBetId*/
      r[1] ? i || (i = N(), i.c(), i.m(t, O)) : i && (i.d(1), i = null);
    },
    i: L,
    o: L,
    d(r) {
      r && W(t), s && s.d(), i && i.d(), e[17](null), C = !1, K(x);
    }
  };
}
function gt(e, t, n) {
  let m;
  X(e, lt, (s) => n(4, m = s));
  let { betstatus: f = "openBets" } = t, { lang: h = "en" } = t, { selectedBetId: H = null } = t, { clientstyling: u = "" } = t, { clientstylingurl: a = "" } = t, { mbsource: p } = t, { translationurl: d = "" } = t, B = "false", S = window.navigator.userAgent, y = Y(S) !== "PC", c;
  const _ = () => {
    fetch(d).then((i) => i.json()).then((i) => {
      Object.keys(i).forEach((r) => {
        D(r, i[r]);
      });
    }).catch((i) => {
      console.log(i);
    });
  };
  Object.entries(rt).forEach(([s, i]) => {
    D(s, i);
  });
  const b = (s) => {
    n(0, f = s);
  }, T = () => {
    window.postMessage(
      {
        type: "PlayerAccountMenuActive",
        isMobile: y
      },
      window.location.href
    );
  }, g = (s) => {
    const { betId: i } = s.detail.params;
    n(1, H = i), n(3, B = "true");
  }, E = (s) => {
    var i;
    ((i = s.data) == null ? void 0 : i.type) === "ModalClosed" && n(3, B = "false");
  };
  $(() => (window.addEventListener("message", E, !1), () => {
    window.removeEventListener("message", E);
  }));
  const O = () => T(), j = () => b("openBets"), C = () => b("settledBets");
  function x(s) {
    tt[s ? "unshift" : "push"](() => {
      c = s, n(2, c);
    });
  }
  return e.$$set = (s) => {
    "betstatus" in s && n(0, f = s.betstatus), "lang" in s && n(9, h = s.lang), "selectedBetId" in s && n(1, H = s.selectedBetId), "clientstyling" in s && n(10, u = s.clientstyling), "clientstylingurl" in s && n(11, a = s.clientstylingurl), "mbsource" in s && n(12, p = s.mbsource), "translationurl" in s && n(13, d = s.translationurl);
  }, e.$$.update = () => {
    e.$$.dirty & /*lang*/
    512 && h && ot(h), e.$$.dirty & /*clientstyling, customStylingContainer*/
    1028 && u && c && et(c, u), e.$$.dirty & /*clientstylingurl, customStylingContainer*/
    2052 && a && c && st(c, a), e.$$.dirty & /*mbsource, customStylingContainer*/
    4100 && p && c && it(c, `${p}.Style`), e.$$.dirty & /*translationurl*/
    8192 && d && _();
  }, [
    f,
    H,
    c,
    B,
    m,
    y,
    b,
    T,
    g,
    h,
    u,
    a,
    p,
    d,
    O,
    j,
    C,
    x
  ];
}
class dt extends G {
  constructor(t) {
    super(), Z(
      this,
      t,
      gt,
      ut,
      F,
      {
        betstatus: 0,
        lang: 9,
        selectedBetId: 1,
        clientstyling: 10,
        clientstylingurl: 11,
        mbsource: 12,
        translationurl: 13
      },
      at
    );
  }
  get betstatus() {
    return this.$$.ctx[0];
  }
  set betstatus(t) {
    this.$$set({ betstatus: t }), k();
  }
  get lang() {
    return this.$$.ctx[9];
  }
  set lang(t) {
    this.$$set({ lang: t }), k();
  }
  get selectedBetId() {
    return this.$$.ctx[1];
  }
  set selectedBetId(t) {
    this.$$set({ selectedBetId: t }), k();
  }
  get clientstyling() {
    return this.$$.ctx[10];
  }
  set clientstyling(t) {
    this.$$set({ clientstyling: t }), k();
  }
  get clientstylingurl() {
    return this.$$.ctx[11];
  }
  set clientstylingurl(t) {
    this.$$set({ clientstylingurl: t }), k();
  }
  get mbsource() {
    return this.$$.ctx[12];
  }
  set mbsource(t) {
    this.$$set({ mbsource: t }), k();
  }
  get translationurl() {
    return this.$$.ctx[13];
  }
  set translationurl(t) {
    this.$$set({ translationurl: t }), k();
  }
}
nt(dt, { betstatus: {}, lang: {}, selectedBetId: {}, clientstyling: {}, clientstylingurl: {}, mbsource: {}, translationurl: {} }, [], [], !0);
export {
  dt as default
};
