import { S as V, i as G, s as J, f as y, b as K, n as M, d as k, c as x, e as g, j as B, o as O, k as X, l as S, m as D, p as m, t as s, q as C, z as H, u as Y, E as W, v as Z, r as v, A as $, B as tt, C as et, D as it } from "./PlayerAccountControllerNd-DobNa2EP.js";
import "../stencil/ui-skeleton-fEyshHrf.js";
function nt(a) {
  K(a, "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(a, t, n) {
  const e = a.slice();
  return e[24] = t[n], e;
}
function L(a, t, n) {
  const e = a.slice();
  return e[21] = t[n], e;
}
function ot(a) {
  let t, n = S(
    /*notificationsData*/
    a[1]
  ), e = [];
  for (let i = 0; i < n.length; i += 1)
    e[i] = F(z(a, n, i));
  return {
    c() {
      t = g("div");
      for (let i = 0; i < e.length; i += 1)
        e[i].c();
      s(t, "class", "PlayerAccountNotificationsContainer " + /*isMobile*/
      (a[3] ? "PlayerAccountNotificationsMobileContainer" : "")), s(t, "part", "PlayerAccountNotificationsContainer " + /*isMobile*/
      (a[3] ? "PlayerAccountNotificationsMobileContainer" : ""));
    },
    m(i, o) {
      x(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 c = z(i, n, l);
          e[l] ? e[l].p(c, o) : (e[l] = F(c), 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 && k(t), D(e, i);
    }
  };
}
function lt(a) {
  let t, n, e = S({ length: 3 }), i = [];
  for (let o = 0; o < e.length; o += 1)
    i[o] = I(L(a, 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) {
      x(o, t, l), m(t, n);
      for (let c = 0; c < i.length; c += 1)
        i[c] && i[c].m(n, null);
    },
    p(o, l) {
      if (l & /*isMobile, mediaQuery*/
      24) {
        e = S({ length: 3 });
        let c;
        for (c = 0; c < e.length; c += 1) {
          const f = L(o, e, c);
          i[c] ? i[c].p(f, l) : (i[c] = I(f), i[c].c(), i[c].m(n, null));
        }
        for (; c < i.length; c += 1)
          i[c].d(1);
        i.length = e.length;
      }
    },
    d(o) {
      o && k(t), D(i, o);
    }
  };
}
function F(a) {
  let t, n, e, i, o, l, c, f = (
    /*notification*/
    a[24].title + ""
  ), p, _, u, w = (
    /*notification*/
    a[24].description + ""
  ), P;
  return {
    c() {
      t = g("div"), n = g("div"), e = g("img"), l = C(), c = g("p"), p = Z(f), _ = C(), u = g("p"), P = C(), s(e, "class", "PlayerAccountNotificationIcon"), s(e, "width", "24px"), s(e, "height", "24px"), H(e.src, i = /*notification*/
      a[24].icon) || s(e, "src", i), s(e, "alt", o = /*notification*/
      a[24].title), s(c, "class", "PlayerAccountNotificationTitle"), s(n, "class", "PlayerAccountNotificationBoxHeader"), s(u, "class", "PlayerAccountNotificationText"), s(t, "class", "PlayerAccountNotificationBox"), W(
        t,
        "background",
        /*notification*/
        a[24].backgroundColor
      );
    },
    m(d, h) {
      x(d, t, h), m(t, n), m(n, e), m(n, l), m(n, c), m(c, p), m(t, _), m(t, u), u.innerHTML = w, m(t, P);
    },
    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 && w !== (w = /*notification*/
      d[24].description + "") && (u.innerHTML = w), h & /*notificationsData*/
      2 && W(
        t,
        "background",
        /*notification*/
        d[24].backgroundColor
      );
    },
    d(d) {
      d && k(t);
    }
  };
}
function at(a) {
  let t;
  return {
    c() {
      t = g("ui-skeleton"), v(t, "structure", "rectangle"), v(t, "width", "auto"), v(
        t,
        "height",
        /*isMobile*/
        a[3] && /*mediaQuery*/
        a[4].matches ? "250px" : "400px"
      );
    },
    m(n, e) {
      x(n, t, e);
    },
    p: M,
    d(n) {
      n && k(t);
    }
  };
}
function ct(a) {
  let t;
  return {
    c() {
      t = g("ui-skeleton"), t.innerHTML = "", v(t, "structure", "rectangle"), v(t, "width", "auto"), v(t, "height", "130px");
    },
    m(n, e) {
      x(n, t, e);
    },
    p: M,
    d(n) {
      n && k(t);
    }
  };
}
function I(a) {
  let t, n;
  function e(l, c) {
    return (
      /*isMobile*/
      l[3] ? at : ct
    );
  }
  let o = e(a)(a);
  return {
    c() {
      t = g("div"), o.c(), n = C(), s(t, "class", "skeletonNotification");
    },
    m(l, c) {
      x(l, t, c), o.m(t, null), m(t, n);
    },
    p(l, c) {
      o.p(l, c);
    },
    d(l) {
      l && k(t), o.d();
    }
  };
}
function rt(a) {
  let t;
  function n(o, l) {
    if (
      /*skeletonLoading*/
      o[2]
    )
      return lt;
    if (
      /*notificationsData*/
      o[1]?.length
    )
      return ot;
  }
  let e = n(a), i = e && e(a);
  return {
    c() {
      t = g("div"), i && i.c();
    },
    m(o, l) {
      x(o, t, l), i && i.m(t, null), a[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 && k(t), i && i.d(), a[13](null);
    }
  };
}
function st(a, t, n) {
  let { lang: e = "" } = t, { cmsendpoint: i = "" } = t, { env: o = "" } = t, { userroles: l = "" } = t, { customnotif: c = "" } = t, { clientstyling: f = "" } = t, { clientstylingurl: p = "" } = t, { mbsource: _ } = t, u, w, P = !0, d = window.navigator.userAgent, h = B(d) !== "PC", N = [], A = [], j = R();
  const q = window.matchMedia("(min-width: 768px)");
  function R() {
    const r = B(d);
    if (r)
      return r === "PC" ? "dk" : "mtWeb";
  }
  const E = () => {
    const r = new URL(`${i}/${e}/support-information`);
    r.searchParams.append("env", o), r.searchParams.append("userRoles", l), r.searchParams.append("device", j), fetch(r.href).then((b) => b.json()).then((b) => {
      b.length && (n(1, N = b[0].children ?? b), N?.forEach((Q) => {
        A.length && (Q.backgroundColor = A[0], A.shift());
      }));
    }).catch((b) => {
      console.error(b);
    }).finally(() => {
      setTimeout(
        () => {
          n(2, P = !1);
        },
        1e3
      );
    });
  }, T = () => {
    c.replace(" ", ""), A = c.split(",");
  };
  O(() => () => {
  });
  function U(r) {
    X[r ? "unshift" : "push"](() => {
      u = r, n(0, u);
    });
  }
  return a.$$set = (r) => {
    "lang" in r && n(5, e = r.lang), "cmsendpoint" in r && n(6, i = r.cmsendpoint), "env" in r && n(7, o = r.env), "userroles" in r && n(8, l = r.userroles), "customnotif" in r && n(9, c = r.customnotif), "clientstyling" in r && n(10, f = r.clientstyling), "clientstylingurl" in r && n(11, p = r.clientstylingurl), "mbsource" in r && n(12, _ = r.mbsource);
  }, a.$$.update = () => {
    a.$$.dirty & /*customnotif*/
    512 && c && T(), a.$$.dirty & /*notificationsData*/
    2 && N && T(), a.$$.dirty & /*userroles, cmsendpoint, env, lang*/
    480 && l && i && o && e && E(), a.$$.dirty & /*clientstyling, customStylingContainer*/
    1025 && f && u && $(u, f), a.$$.dirty & /*clientstylingurl, customStylingContainer*/
    2049 && p && u && tt(u, p), a.$$.dirty & /*mbsource, customStylingContainer*/
    4097 && _ && u && et(u, `${_}.Style`, w);
  }, [
    u,
    N,
    P,
    h,
    q,
    e,
    i,
    o,
    l,
    c,
    f,
    p,
    _,
    U
  ];
}
class ut extends V {
  constructor(t) {
    super(), G(
      this,
      t,
      st,
      rt,
      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
};
