import { a3 as W, S as j, i as A, s as H, f, b as N, d as L, K as w, L as m, a0 as q, _ as B, h as z, H as J, u as K, J as O, a4 as S, W as P, M as R, N as U, O as F, j as M, k as _, e as y, w as k, x as G, y as I, z as Q, A as T } from "./GeneralLogout-B7wytw3i.js";
function v(e, { delay: t = 0, duration: n = 400, easing: i = W } = {}) {
  const s = +getComputedStyle(e).opacity;
  return {
    delay: t,
    duration: n,
    easing: i,
    css: (a) => `opacity: ${a * s}`
  };
}
function V(e) {
  N(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 C(e) {
  let t, n, i, s, a;
  const d = (
    /*#slots*/
    e[9].default
  ), r = O(
    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), M(t, n), M(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) && R(
        r,
        d,
        e,
        /*$$scope*/
        e[8],
        a ? F(
          d,
          /*$$scope*/
          e[8],
          u,
          null
        ) : U(
          /*$$scope*/
          e[8]
        ),
        null
      );
    },
    i(o) {
      a || (m(r, o), o && P(() => {
        a && (s || (s = S(n, v, { transitionDuration: (
          /*duration*/
          e[1]
        ) }, !0)), s.run(1));
      }), a = !0);
    },
    o(o) {
      w(r, o), o && (s || (s = S(n, v, { 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 X(e) {
  let t, n, i = (
    /*show*/
    e[0] && C(e)
  );
  return {
    c() {
      i && i.c(), t = J();
    },
    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 = C(s), i.c(), m(i, 1), i.m(t.parentNode, t)) : i && (q(), w(i, 1, 1, () => {
        i = null;
      }), B());
    },
    i(s) {
      n || (m(i), n = !0);
    },
    o(s) {
      w(i), n = !1;
    },
    d(s) {
      s && L(t), i && i.d(s);
    }
  };
}
function Y(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, 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;
    }
  };
  K(() => (window.addEventListener("message", b, !1), () => {
    window.removeEventListener("message", b);
  }));
  function D(l) {
    k[l ? "unshift" : "push"](() => {
      h = l, n(3, h);
    });
  }
  function E(l) {
    k[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 && G(c, r), e.$$.dirty & /*clientstylingurl, customStylingContainer*/
    36 && o && c && I(c, o), e.$$.dirty & /*mbsource, customStylingContainer*/
    68 && u && c && Q(c, `${u}.Style`);
  }, [
    a,
    d,
    c,
    h,
    r,
    o,
    u,
    g,
    s,
    i,
    D,
    E
  ];
}
class Z extends j {
  constructor(t) {
    super(), A(
      this,
      t,
      Y,
      X,
      H,
      {
        show: 0,
        duration: 1,
        clientstyling: 4,
        clientstylingurl: 5,
        mbsource: 6,
        showmodaleventname: 7
      },
      V
    );
  }
  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();
  }
}
T(Z, { show: { type: "Boolean" }, duration: {}, clientstyling: {}, clientstylingurl: {}, mbsource: {}, showmodaleventname: {} }, ["default"], [], !0);
export {
  Z as default
};
