import { S as V, i as G, s as J, f as y, b as K, n as M, d as b, c as k, e as g, h as B, o as O, j as X, k as S, l as j, m, r as s, p as C, y as H, t as Y, E as W, u as Z, q as P, z as $, A as tt, B as et, C as it } from "./PlayerAccountController-DQUfjs7n.js";
import "../stencil/ui-skeleton-BKpwkQ2A.js";
function nt(r) {
  K(r, "svelte-1b8j2p", ':host{padding:0;margin:0;font-family:inherit}.PlayerAccountNotificationsContainer{padding:0 5px;display:grid;grid-gap:20px;animation-name:fadeIn;animation-iteration-count:1;animation-timing-function:ease-in;animation-duration:0.3s;container-type:inline-size;container-name:notifications-container}.PlayerAccountNotificationBox{background:var(--emw--color-pale, var(--emw--color-gray-50, #f1f1f1));display:block;padding:20px;border-radius:var(--emw--border-radius-medium, 10px);width:100%;color:var(--emw--color-black, #000);box-sizing:border-box;text-decoration:none;word-break:break-word;word-wrap:break-word;overflow-wrap:anywhere;white-space:normal}.PlayerAccountNotificationBoxHeader{display:grid;width:100%;grid-template-areas:"nav  main  aside";grid-template-rows:auto;grid-template-columns:34px calc(100% - 34px);align-items:center}.PlayerAccountNotificationBoxHeader .PlayerAccountNotificationIcon{width:24px;margin-right:10px;flex:1}.PlayerAccountNotificationBoxHeader .PlayerAccountNotificationTitle{font-size:16px;flex:2}.PlayerAccountNotificationText{margin:0;font-size:14px;font-weight:300}.PlayerAccountNotificationText a{text-decoration:none;color:var(--emw--color-white, #FFFFFF)}.PlayerAccountNotificationsMobileContainer{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));grid-gap:20px;padding:20px}.PlayerAccountNotificationsMobileContainer .PlayerAccountNotificationBoxHeader{grid-template-columns:40px calc(100% - 40px)}.PlayerAccountNotificationsMobileContainer .PlayerAccountNotificationTitle{font-size:14px}.PlayerAccountNotificationsMobileContainer .PlayerAccountNotificationIcon{width:30px;margin-right:10px}.skeletonContainer{container-type:inline-size}.skeletonContainer .skeletonWrapper{animation:fadeIn ease 0.3s}@container (max-width: 768px){.skeletonContainer .skeletonWrapper{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));grid-gap:20px}.skeletonContainer .skeletonWrapper .skeletonNotification{width:100%}}@container (max-width: 425px){.skeletonContainer .skeletonWrapper{display:grid;grid-template-columns:repeat(1, minmax(0, 1fr));grid-gap:20px;padding:0px 10px}.skeletonContainer .skeletonWrapper .skeletonNotification{width:100%}}@keyframes fadeIn{0%{opacity:0.01}1%{opacity:0}50%{opacity:0}100%{opacity:1}}');
}
function z(r, t, n) {
  const e = r.slice();
  return e[24] = t[n], e;
}
function L(r, t, n) {
  const e = r.slice();
  return e[21] = t[n], e;
}
function ot(r) {
  let t, n = S(
    /*notificationsData*/
    r[1]
  ), e = [];
  for (let i = 0; i < n.length; i += 1)
    e[i] = F(z(r, n, i));
  return {
    c() {
      t = g("div");
      for (let i = 0; i < e.length; i += 1)
        e[i].c();
      s(t, "class", "PlayerAccountNotificationsContainer " + /*isMobile*/
      (r[3] ? "PlayerAccountNotificationsMobileContainer" : "")), s(t, "part", "PlayerAccountNotificationsContainer " + /*isMobile*/
      (r[3] ? "PlayerAccountNotificationsMobileContainer" : ""));
    },
    m(i, o) {
      k(i, t, o);
      for (let l = 0; l < e.length; l += 1)
        e[l] && e[l].m(t, null);
    },
    p(i, o) {
      if (o & /*notificationsData*/
      2) {
        n = S(
          /*notificationsData*/
          i[1]
        );
        let l;
        for (l = 0; l < n.length; l += 1) {
          const a = z(i, n, l);
          e[l] ? e[l].p(a, o) : (e[l] = F(a), e[l].c(), e[l].m(t, null));
        }
        for (; l < e.length; l += 1)
          e[l].d(1);
        e.length = n.length;
      }
    },
    d(i) {
      i && b(t), j(e, i);
    }
  };
}
function lt(r) {
  let t, n, e = S({ length: 3 }), i = [];
  for (let o = 0; o < e.length; o += 1)
    i[o] = I(L(r, e, o));
  return {
    c() {
      t = g("div"), n = g("div");
      for (let o = 0; o < i.length; o += 1)
        i[o].c();
      s(n, "class", "skeletonWrapper"), s(t, "class", "skeletonContainer");
    },
    m(o, l) {
      k(o, t, l), m(t, n);
      for (let a = 0; a < i.length; a += 1)
        i[a] && i[a].m(n, null);
    },
    p(o, l) {
      if (l & /*isMobile, mediaQuery*/
      24) {
        e = S({ length: 3 });
        let a;
        for (a = 0; a < e.length; a += 1) {
          const f = L(o, e, a);
          i[a] ? i[a].p(f, l) : (i[a] = I(f), i[a].c(), i[a].m(n, null));
        }
        for (; a < i.length; a += 1)
          i[a].d(1);
        i.length = e.length;
      }
    },
    d(o) {
      o && b(t), j(i, o);
    }
  };
}
function F(r) {
  let t, n, e, i, o, l, a, f = (
    /*notification*/
    r[24].title + ""
  ), p, _, u, x = (
    /*notification*/
    r[24].description + ""
  ), N;
  return {
    c() {
      t = g("div"), n = g("div"), e = g("img"), l = C(), a = g("p"), p = Z(f), _ = C(), u = g("p"), N = C(), s(e, "class", "PlayerAccountNotificationIcon"), s(e, "width", "24px"), s(e, "height", "24px"), H(e.src, i = /*notification*/
      r[24].icon) || s(e, "src", i), s(e, "alt", o = /*notification*/
      r[24].title), s(a, "class", "PlayerAccountNotificationTitle"), s(n, "class", "PlayerAccountNotificationBoxHeader"), s(u, "class", "PlayerAccountNotificationText"), s(t, "class", "PlayerAccountNotificationBox"), W(
        t,
        "background",
        /*notification*/
        r[24].backgroundColor
      );
    },
    m(d, h) {
      k(d, t, h), m(t, n), m(n, e), m(n, l), m(n, a), m(a, p), m(t, _), m(t, u), u.innerHTML = x, m(t, N);
    },
    p(d, h) {
      h & /*notificationsData*/
      2 && !H(e.src, i = /*notification*/
      d[24].icon) && s(e, "src", i), h & /*notificationsData*/
      2 && o !== (o = /*notification*/
      d[24].title) && s(e, "alt", o), h & /*notificationsData*/
      2 && f !== (f = /*notification*/
      d[24].title + "") && Y(p, f), h & /*notificationsData*/
      2 && x !== (x = /*notification*/
      d[24].description + "") && (u.innerHTML = x), h & /*notificationsData*/
      2 && W(
        t,
        "background",
        /*notification*/
        d[24].backgroundColor
      );
    },
    d(d) {
      d && b(t);
    }
  };
}
function rt(r) {
  let t;
  return {
    c() {
      t = g("ui-skeleton"), P(t, "structure", "rectangle"), P(t, "width", "auto"), P(
        t,
        "height",
        /*isMobile*/
        r[3] && /*mediaQuery*/
        r[4].matches ? "250px" : "400px"
      );
    },
    m(n, e) {
      k(n, t, e);
    },
    p: M,
    d(n) {
      n && b(t);
    }
  };
}
function at(r) {
  let t;
  return {
    c() {
      t = g("ui-skeleton"), t.innerHTML = "", P(t, "structure", "rectangle"), P(t, "width", "auto"), P(t, "height", "130px");
    },
    m(n, e) {
      k(n, t, e);
    },
    p: M,
    d(n) {
      n && b(t);
    }
  };
}
function I(r) {
  let t, n;
  function e(l, a) {
    return (
      /*isMobile*/
      l[3] ? rt : at
    );
  }
  let o = e(r)(r);
  return {
    c() {
      t = g("div"), o.c(), n = C(), s(t, "class", "skeletonNotification");
    },
    m(l, a) {
      k(l, t, a), o.m(t, null), m(t, n);
    },
    p(l, a) {
      o.p(l, a);
    },
    d(l) {
      l && b(t), o.d();
    }
  };
}
function ct(r) {
  let t;
  function n(o, l) {
    var a;
    if (
      /*skeletonLoading*/
      o[2]
    )
      return lt;
    if (
      /*notificationsData*/
      (a = o[1]) != null && a.length
    )
      return ot;
  }
  let e = n(r), i = e && e(r);
  return {
    c() {
      t = g("div"), i && i.c();
    },
    m(o, l) {
      k(o, t, l), i && i.m(t, null), r[13](t);
    },
    p(o, [l]) {
      e === (e = n(o)) && i ? i.p(o, l) : (i && i.d(1), i = e && e(o), i && (i.c(), i.m(t, null)));
    },
    i: M,
    o: M,
    d(o) {
      o && b(t), i && i.d(), r[13](null);
    }
  };
}
function st(r, t, n) {
  let { lang: e = "" } = t, { cmsendpoint: i = "" } = t, { env: o = "" } = t, { userroles: l = "" } = t, { customnotif: a = "" } = t, { clientstyling: f = "" } = t, { clientstylingurl: p = "" } = t, { mbsource: _ } = t, u, x, N = !0, d = window.navigator.userAgent, h = B(d) !== "PC", w = [], A = [], q = D();
  const R = window.matchMedia("(min-width: 768px)");
  function D() {
    const c = B(d);
    if (c)
      return c === "PC" ? "dk" : "mtWeb";
  }
  const E = () => {
    const c = new URL(`${i}/${e}/support-information`);
    c.searchParams.append("env", o), c.searchParams.append("userRoles", l), c.searchParams.append("device", q), fetch(c.href).then((v) => v.json()).then((v) => {
      v.length && (n(1, w = v[0].children), w == null || w.forEach((Q) => {
        A.length && (Q.backgroundColor = A[0], A.shift());
      }));
    }).catch((v) => {
      console.error(v);
    }).finally(() => {
      setTimeout(
        () => {
          n(2, N = !1);
        },
        1e3
      );
    });
  }, T = () => {
    a.replace(" ", ""), A = a.split(",");
  };
  O(() => () => {
  });
  function U(c) {
    X[c ? "unshift" : "push"](() => {
      u = c, n(0, u);
    });
  }
  return r.$$set = (c) => {
    "lang" in c && n(5, e = c.lang), "cmsendpoint" in c && n(6, i = c.cmsendpoint), "env" in c && n(7, o = c.env), "userroles" in c && n(8, l = c.userroles), "customnotif" in c && n(9, a = c.customnotif), "clientstyling" in c && n(10, f = c.clientstyling), "clientstylingurl" in c && n(11, p = c.clientstylingurl), "mbsource" in c && n(12, _ = c.mbsource);
  }, r.$$.update = () => {
    r.$$.dirty & /*customnotif*/
    512 && a && T(), r.$$.dirty & /*notificationsData*/
    2 && w && T(), r.$$.dirty & /*userroles, cmsendpoint, env, lang*/
    480 && l && i && o && e && E(), r.$$.dirty & /*clientstyling, customStylingContainer*/
    1025 && f && u && $(u, f), r.$$.dirty & /*clientstylingurl, customStylingContainer*/
    2049 && p && u && tt(u, p), r.$$.dirty & /*mbsource, customStylingContainer*/
    4097 && _ && u && et(u, `${_}.Style`, x);
  }, [
    u,
    w,
    N,
    h,
    R,
    e,
    i,
    o,
    l,
    a,
    f,
    p,
    _,
    U
  ];
}
class ut extends V {
  constructor(t) {
    super(), G(
      this,
      t,
      st,
      ct,
      J,
      {
        lang: 5,
        cmsendpoint: 6,
        env: 7,
        userroles: 8,
        customnotif: 9,
        clientstyling: 10,
        clientstylingurl: 11,
        mbsource: 12
      },
      nt
    );
  }
  get lang() {
    return this.$$.ctx[5];
  }
  set lang(t) {
    this.$$set({ lang: t }), y();
  }
  get cmsendpoint() {
    return this.$$.ctx[6];
  }
  set cmsendpoint(t) {
    this.$$set({ cmsendpoint: t }), y();
  }
  get env() {
    return this.$$.ctx[7];
  }
  set env(t) {
    this.$$set({ env: t }), y();
  }
  get userroles() {
    return this.$$.ctx[8];
  }
  set userroles(t) {
    this.$$set({ userroles: t }), y();
  }
  get customnotif() {
    return this.$$.ctx[9];
  }
  set customnotif(t) {
    this.$$set({ customnotif: t }), y();
  }
  get clientstyling() {
    return this.$$.ctx[10];
  }
  set clientstyling(t) {
    this.$$set({ clientstyling: t }), y();
  }
  get clientstylingurl() {
    return this.$$.ctx[11];
  }
  set clientstylingurl(t) {
    this.$$set({ clientstylingurl: t }), y();
  }
  get mbsource() {
    return this.$$.ctx[12];
  }
  set mbsource(t) {
    this.$$set({ mbsource: t }), y();
  }
}
it(ut, { lang: {}, cmsendpoint: {}, env: {}, userroles: {}, customnotif: {}, clientstyling: {}, clientstylingurl: {}, mbsource: {} }, [], [], !0);
export {
  ut as default
};
