import { a4 as j, S as A, i as B, s as P, f, b as q, d as L, V as w, W as m, Y as H, X as N, c as z, L as R, o as U, _ as V, a5 as S, P as X, a0 as Y, a1 as F, a2 as G, m as v, e as _, r as y, j as C, z as I, A as J, B as K, C as O } from "./PlayerAccountController-yJR1r7p7.js";
function M(e, { delay: t = 0, duration: n = 400, easing: i = j } = {}) {
  const s = +getComputedStyle(e).opacity;
  return {
    delay: t,
    duration: n,
    easing: i,
    css: (a) => `opacity: ${a * s}`
  };
}
function Q(e) {
  q(e, "svelte-126fglp", "*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}.ModalWindow{display:flex;position:fixed;align-items:center;justify-content:center;width:100%;height:100%;z-index:300;top:0;left:0}");
}
function k(e) {
  let t, n, i, s, a;
  const d = (
    /*#slots*/
    e[9].default
  ), r = V(
    d,
    e,
    /*$$scope*/
    e[8],
    null
  );
  return {
    c() {
      t = _("div"), n = _("div"), i = _("div"), r && r.c(), y(i, "class", "ModalContainer"), y(n, "class", "ModalWindow"), y(n, "id", "Modal");
    },
    m(o, u) {
      z(o, t, u), v(t, n), v(n, i), r && r.m(i, null), e[10](n), e[11](t), a = !0;
    },
    p(o, u) {
      e = o, r && r.p && (!a || u & /*$$scope*/
      256) && Y(
        r,
        d,
        e,
        /*$$scope*/
        e[8],
        a ? G(
          d,
          /*$$scope*/
          e[8],
          u,
          null
        ) : F(
          /*$$scope*/
          e[8]
        ),
        null
      );
    },
    i(o) {
      a || (m(r, o), o && X(() => {
        a && (s || (s = S(n, M, { transitionDuration: (
          /*duration*/
          e[1]
        ) }, !0)), s.run(1));
      }), a = !0);
    },
    o(o) {
      w(r, o), o && (s || (s = S(n, M, { transitionDuration: (
        /*duration*/
        e[1]
      ) }, !1)), s.run(0)), a = !1;
    },
    d(o) {
      o && L(t), r && r.d(o), e[10](null), o && s && s.end(), e[11](null);
    }
  };
}
function T(e) {
  let t, n, i = (
    /*show*/
    e[0] && k(e)
  );
  return {
    c() {
      i && i.c(), t = R();
    },
    m(s, a) {
      i && i.m(s, a), z(s, t, a), n = !0;
    },
    p(s, [a]) {
      /*show*/
      s[0] ? i ? (i.p(s, a), a & /*show*/
      1 && m(i, 1)) : (i = k(s), i.c(), m(i, 1), i.m(t.parentNode, t)) : i && (H(), w(i, 1, 1, () => {
        i = null;
      }), N());
    },
    i(s) {
      n || (m(i), n = !0);
    },
    o(s) {
      w(i), n = !1;
    },
    d(s) {
      s && L(t), i && i.d(s);
    }
  };
}
function Z(e, t, n) {
  let { $$slots: i = {}, $$scope: s } = t, { show: a = !1 } = t, { duration: d = 350 } = t, { clientstyling: r = "" } = t, { clientstylingurl: o = "" } = t, { mbsource: u } = t, { showmodaleventname: g = "ShowLimitsConfirmationModal" } = t, c, D, h;
  const b = (l) => {
    switch (l.data.type) {
      case "ModalClosed":
        n(0, a = !1);
        break;
      case g:
        n(0, a = !0), window.postMessage({ type: "DisableScroll" }, window.location.href);
        break;
    }
  };
  U(() => (window.addEventListener("message", b, !1), () => {
    window.removeEventListener("message", b);
  }));
  function E(l) {
    C[l ? "unshift" : "push"](() => {
      h = l, n(3, h);
    });
  }
  function W(l) {
    C[l ? "unshift" : "push"](() => {
      c = l, n(2, c);
    });
  }
  return e.$$set = (l) => {
    "show" in l && n(0, a = l.show), "duration" in l && n(1, d = l.duration), "clientstyling" in l && n(4, r = l.clientstyling), "clientstylingurl" in l && n(5, o = l.clientstylingurl), "mbsource" in l && n(6, u = l.mbsource), "showmodaleventname" in l && n(7, g = l.showmodaleventname), "$$scope" in l && n(8, s = l.$$scope);
  }, e.$$.update = () => {
    e.$$.dirty & /*clientstyling, customStylingContainer*/
    20 && r && c && I(c, r), e.$$.dirty & /*clientstylingurl, customStylingContainer*/
    36 && o && c && J(c, o), e.$$.dirty & /*mbsource, customStylingContainer*/
    68 && u && c && K(c, `${u}.Style`, D);
  }, [
    a,
    d,
    c,
    h,
    r,
    o,
    u,
    g,
    s,
    i,
    E,
    W
  ];
}
class p extends A {
  constructor(t) {
    super(), B(
      this,
      t,
      Z,
      T,
      P,
      {
        show: 0,
        duration: 1,
        clientstyling: 4,
        clientstylingurl: 5,
        mbsource: 6,
        showmodaleventname: 7
      },
      Q
    );
  }
  get show() {
    return this.$$.ctx[0];
  }
  set show(t) {
    this.$$set({ show: t }), f();
  }
  get duration() {
    return this.$$.ctx[1];
  }
  set duration(t) {
    this.$$set({ duration: t }), f();
  }
  get clientstyling() {
    return this.$$.ctx[4];
  }
  set clientstyling(t) {
    this.$$set({ clientstyling: t }), f();
  }
  get clientstylingurl() {
    return this.$$.ctx[5];
  }
  set clientstylingurl(t) {
    this.$$set({ clientstylingurl: t }), f();
  }
  get mbsource() {
    return this.$$.ctx[6];
  }
  set mbsource(t) {
    this.$$set({ mbsource: t }), f();
  }
  get showmodaleventname() {
    return this.$$.ctx[7];
  }
  set showmodaleventname(t) {
    this.$$set({ showmodaleventname: t }), f();
  }
}
O(p, { show: { type: "Boolean" }, duration: {}, clientstyling: {}, clientstylingurl: {}, mbsource: {}, showmodaleventname: {} }, ["default"], [], !0);
export {
  p as default
};
