import * as m from "react";
import { useEffect as U, useCallback as oe, useState as he, useRef as ge } from "react";
const se = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), ye = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), D = /* @__PURE__ */ new WeakSet();
let E, J = 0, K = 0;
const b = "__aa_tgt", z = "__aa_del", F = "__aa_new", ve = (e) => {
  const t = Te(e);
  t && t.forEach((o) => $e(o));
}, be = (e) => {
  e.forEach((t) => {
    t.target === E && xe(), g.has(t.target) && C(t.target);
  });
};
function we(e) {
  const t = Q.get(e);
  t == null || t.disconnect();
  let o = g.get(e), i = 0;
  const r = 5;
  o || (o = A(e), g.set(e, o));
  const { offsetWidth: n, offsetHeight: s } = E, d = [
    o.top - r,
    n - (o.left + r + o.width),
    s - (o.top + r + o.height),
    o.left - r
  ].map((c) => `${-1 * Math.floor(c)}px`).join(" "), l = new IntersectionObserver(() => {
    ++i > 1 && C(e);
  }, {
    root: E,
    threshold: 1,
    rootMargin: d
  });
  l.observe(e), Q.set(e, l);
}
function C(e) {
  clearTimeout(R.get(e));
  const t = Y(e), o = _(t) ? 500 : t.duration;
  R.set(e, setTimeout(async () => {
    const i = M.get(e);
    try {
      await (i == null ? void 0 : i.finished), g.set(e, A(e)), we(e);
    } catch {
    }
  }, o));
}
function xe() {
  clearTimeout(R.get(E)), R.set(E, setTimeout(() => {
    se.forEach((e) => ce(e, (t) => ae(() => C(t))));
  }, 100));
}
function Ee(e) {
  setTimeout(() => {
    ye.set(e, setInterval(() => ae(C.bind(null, e)), 2e3));
  }, Math.round(2e3 * Math.random()));
}
function ae(e) {
  typeof requestIdleCallback == "function" ? requestIdleCallback(() => e()) : requestAnimationFrame(() => e());
}
let V, P;
const Oe = typeof window < "u" && "ResizeObserver" in window;
Oe && (E = document.documentElement, V = new MutationObserver(ve), P = new ResizeObserver(be), window.addEventListener("scroll", () => {
  K = window.scrollY, J = window.scrollX;
}), P.observe(E));
function Te(e) {
  return e.reduce((i, r) => [
    ...i,
    ...Array.from(r.addedNodes),
    ...Array.from(r.removedNodes)
  ], []).every((i) => i.nodeName === "#comment") ? !1 : e.reduce((i, r) => {
    if (i === !1)
      return !1;
    if (r.target instanceof Element) {
      if (q(r.target), !i.has(r.target)) {
        i.add(r.target);
        for (let n = 0; n < r.target.children.length; n++) {
          const s = r.target.children.item(n);
          if (s) {
            if (z in s)
              return !1;
            q(r.target, s), i.add(s);
          }
        }
      }
      if (r.removedNodes.length)
        for (let n = 0; n < r.removedNodes.length; n++) {
          const s = r.removedNodes[n];
          if (z in s)
            return !1;
          s instanceof Element && (i.add(s), q(r.target, s), S.set(s, [
            r.previousSibling,
            r.nextSibling
          ]));
        }
    }
    return i;
  }, /* @__PURE__ */ new Set());
}
function q(e, t) {
  !t && !(b in e) ? Object.defineProperty(e, b, { value: e }) : t && !(b in t) && Object.defineProperty(t, b, { value: e });
}
function $e(e) {
  var t;
  const o = e.isConnected, i = g.has(e);
  o && S.has(e) && S.delete(e), M.has(e) && ((t = M.get(e)) === null || t === void 0 || t.cancel()), F in e ? ne(e) : i && o ? Ce(e) : i && !o ? Ne(e) : ne(e);
}
function y(e) {
  return Number(e.replace(/[^0-9.\-]/g, ""));
}
function Me(e) {
  let t = e.parentElement;
  for (; t; ) {
    if (t.scrollLeft || t.scrollTop)
      return { x: t.scrollLeft, y: t.scrollTop };
    t = t.parentElement;
  }
  return { x: 0, y: 0 };
}
function A(e) {
  const t = e.getBoundingClientRect(), { x: o, y: i } = Me(e);
  return {
    top: t.top + i,
    left: t.left + o,
    width: t.width,
    height: t.height
  };
}
function de(e, t, o) {
  let i = t.width, r = t.height, n = o.width, s = o.height;
  const a = getComputedStyle(e);
  if (a.getPropertyValue("box-sizing") === "content-box") {
    const l = y(a.paddingTop) + y(a.paddingBottom) + y(a.borderTopWidth) + y(a.borderBottomWidth), c = y(a.paddingLeft) + y(a.paddingRight) + y(a.borderRightWidth) + y(a.borderLeftWidth);
    i -= c, n -= c, r -= l, s -= l;
  }
  return [i, n, r, s].map(Math.round);
}
function Y(e) {
  return b in e && j.has(e[b]) ? j.get(e[b]) : { duration: 250, easing: "ease-in-out" };
}
function le(e) {
  if (b in e)
    return e[b];
}
function ee(e) {
  const t = le(e);
  return t ? D.has(t) : !1;
}
function ce(e, ...t) {
  t.forEach((o) => o(e, j.has(e)));
  for (let o = 0; o < e.children.length; o++) {
    const i = e.children.item(o);
    i && t.forEach((r) => r(i, j.has(i)));
  }
}
function te(e) {
  return Array.isArray(e) ? e : [e];
}
function _(e) {
  return typeof e == "function";
}
function Ce(e) {
  const t = g.get(e), o = A(e);
  if (!ee(e))
    return g.set(e, o);
  let i;
  if (!t)
    return;
  const r = Y(e);
  if (typeof r != "function") {
    const n = t.left - o.left, s = t.top - o.top, [a, d, l, c] = de(e, t, o), f = {
      transform: `translate(${n}px, ${s}px)`
    }, u = {
      transform: "translate(0, 0)"
    };
    a !== d && (f.width = `${a}px`, u.width = `${d}px`), l !== c && (f.height = `${l}px`, u.height = `${c}px`), i = e.animate([f, u], {
      duration: r.duration,
      easing: r.easing
    });
  } else {
    const [n] = te(r(e, "remain", t, o));
    i = new Animation(n), i.play();
  }
  M.set(e, i), g.set(e, o), i.addEventListener("finish", C.bind(null, e));
}
function ne(e) {
  F in e && delete e[F];
  const t = A(e);
  g.set(e, t);
  const o = Y(e);
  if (!ee(e))
    return;
  let i;
  if (typeof o != "function")
    i = e.animate([
      { transform: "scale(.98)", opacity: 0 },
      { transform: "scale(0.98)", opacity: 0, offset: 0.5 },
      { transform: "scale(1)", opacity: 1 }
    ], {
      duration: o.duration * 1.5,
      easing: "ease-in"
    });
  else {
    const [r] = te(o(e, "add", t));
    i = new Animation(r), i.play();
  }
  M.set(e, i), i.addEventListener("finish", C.bind(null, e));
}
function ie(e, t) {
  var o;
  e.remove(), g.delete(e), S.delete(e), M.delete(e), (o = Q.get(e)) === null || o === void 0 || o.disconnect(), setTimeout(() => {
    if (z in e && delete e[z], Object.defineProperty(e, F, { value: !0, configurable: !0 }), t && e instanceof HTMLElement)
      for (const i in t)
        e.style[i] = "";
  }, 0);
}
function Ne(e) {
  var t;
  if (!S.has(e) || !g.has(e))
    return;
  const [o, i] = S.get(e);
  Object.defineProperty(e, z, { value: !0, configurable: !0 });
  const r = window.scrollX, n = window.scrollY;
  if (i && i.parentNode && i.parentNode instanceof Element ? i.parentNode.insertBefore(e, i) : o && o.parentNode ? o.parentNode.appendChild(e) : (t = le(e)) === null || t === void 0 || t.appendChild(e), !ee(e))
    return ie(e);
  const [s, a, d, l] = Pe(e), c = Y(e), f = g.get(e);
  (r !== J || n !== K) && ke(e, r, n, c);
  let u, p = {
    position: "absolute",
    top: `${s}px`,
    left: `${a}px`,
    width: `${d}px`,
    height: `${l}px`,
    margin: "0",
    pointerEvents: "none",
    transformOrigin: "center",
    zIndex: "100"
  };
  if (!_(c))
    Object.assign(e.style, p), u = e.animate([
      {
        transform: "scale(1)",
        opacity: 1
      },
      {
        transform: "scale(.98)",
        opacity: 0
      }
    ], { duration: c.duration, easing: "ease-out" });
  else {
    const [T, k] = te(c(e, "remove", f));
    (k == null ? void 0 : k.styleReset) !== !1 && (p = (k == null ? void 0 : k.styleReset) || p, Object.assign(e.style, p)), u = new Animation(T), u.play();
  }
  M.set(e, u), u.addEventListener("finish", ie.bind(null, e, p));
}
function ke(e, t, o, i) {
  const r = J - t, n = K - o, s = document.documentElement.style.scrollBehavior;
  if (getComputedStyle(E).scrollBehavior === "smooth" && (document.documentElement.style.scrollBehavior = "auto"), window.scrollTo(window.scrollX + r, window.scrollY + n), !e.parentElement)
    return;
  const d = e.parentElement;
  let l = d.clientHeight, c = d.clientWidth;
  const f = performance.now();
  function u() {
    requestAnimationFrame(() => {
      if (!_(i)) {
        const p = l - d.clientHeight, T = c - d.clientWidth;
        f + i.duration > performance.now() ? (window.scrollTo({
          left: window.scrollX - T,
          top: window.scrollY - p
        }), l = d.clientHeight, c = d.clientWidth, u()) : document.documentElement.style.scrollBehavior = s;
      }
    });
  }
  u();
}
function Pe(e) {
  const t = g.get(e), [o, , i] = de(e, t, A(e));
  let r = e.parentElement;
  for (; r && (getComputedStyle(r).position === "static" || r instanceof HTMLBodyElement); )
    r = r.parentElement;
  r || (r = document.body);
  const n = getComputedStyle(r), s = g.get(r) || A(r), a = Math.round(t.top - s.top) - y(n.borderTopWidth), d = Math.round(t.left - s.left) - y(n.borderLeftWidth);
  return [a, d, o, i];
}
function xt(e, t = {}) {
  return V && P && (window.matchMedia("(prefers-reduced-motion: reduce)").matches && !_(t) && !t.disrespectUserMotionPreference || (D.add(e), getComputedStyle(e).position === "static" && Object.assign(e.style, { position: "relative" }), ce(e, C, Ee, (r) => P == null ? void 0 : P.observe(r)), _(t) ? j.set(e, t) : j.set(e, { duration: 250, easing: "ease-in-out", ...t }), V.observe(e, { childList: !0 }), se.add(e))), Object.freeze({
    parent: e,
    enable: () => {
      D.add(e);
    },
    disable: () => {
      D.delete(e);
    },
    isEnabled: () => D.has(e)
  });
}
let Se = { data: "" }, je = (e) => typeof window == "object" ? ((e ? e.querySelector("#_goober") : window._goober) || Object.assign((e || document.head).appendChild(document.createElement("style")), { innerHTML: " ", id: "_goober" })).firstChild : e || Se, Ae = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, De = /\/\*[^]*?\*\/|  +/g, re = /\n+/g, x = (e, t) => {
  let o = "", i = "", r = "";
  for (let n in e) {
    let s = e[n];
    n[0] == "@" ? n[1] == "i" ? o = n + " " + s + ";" : i += n[1] == "f" ? x(s, n) : n + "{" + x(s, n[1] == "k" ? "" : t) + "}" : typeof s == "object" ? i += x(s, t ? t.replace(/([^,])+/g, (a) => n.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g, (d) => /&/.test(d) ? d.replace(/&/g, a) : a ? a + " " + d : d)) : n) : s != null && (n = /^--/.test(n) ? n : n.replace(/[A-Z]/g, "-$&").toLowerCase(), r += x.p ? x.p(n, s) : n + ":" + s + ";");
  }
  return o + (t && r ? t + "{" + r + "}" : r) + i;
}, v = {}, ue = (e) => {
  if (typeof e == "object") {
    let t = "";
    for (let o in e) t += o + ue(e[o]);
    return t;
  }
  return e;
}, We = (e, t, o, i, r) => {
  let n = ue(e), s = v[n] || (v[n] = ((d) => {
    let l = 0, c = 11;
    for (; l < d.length; ) c = 101 * c + d.charCodeAt(l++) >>> 0;
    return "go" + c;
  })(n));
  if (!v[s]) {
    let d = n !== e ? e : ((l) => {
      let c, f, u = [{}];
      for (; c = Ae.exec(l.replace(De, "")); ) c[4] ? u.shift() : c[3] ? (f = c[3].replace(re, " ").trim(), u.unshift(u[0][f] = u[0][f] || {})) : u[0][c[1]] = c[2].replace(re, " ").trim();
      return u[0];
    })(e);
    v[s] = x(r ? { ["@keyframes " + s]: d } : d, o ? "" : "." + s);
  }
  let a = o && v.g ? v.g : null;
  return o && (v.g = v[s]), ((d, l, c, f) => {
    f ? l.data = l.data.replace(f, d) : l.data.indexOf(d) === -1 && (l.data = c ? d + l.data : l.data + d);
  })(v[s], t, i, a), s;
}, ze = (e, t, o) => e.reduce((i, r, n) => {
  let s = t[n];
  if (s && s.call) {
    let a = s(o), d = a && a.props && a.props.className || /^go/.test(a) && a;
    s = d ? "." + d : a && typeof a == "object" ? a.props ? "" : x(a, "") : a === !1 ? "" : a;
  }
  return i + r + (s ?? "");
}, "");
function X(e) {
  let t = this || {}, o = e.call ? e(t.p) : e;
  return We(o.unshift ? o.raw ? ze(o, [].slice.call(arguments, 1), t.p) : o.reduce((i, r) => Object.assign(i, r && r.call ? r(t.p) : r), {}) : o, je(t.target), t.g, t.o, t.k);
}
let fe, Z, G;
X.bind({ g: 1 });
let w = X.bind({ k: 1 });
function _e(e, t, o, i) {
  x.p = t, fe = e, Z = o, G = i;
}
function O(e, t) {
  let o = this || {};
  return function() {
    let i = arguments;
    function r(n, s) {
      let a = Object.assign({}, n), d = a.className || r.className;
      o.p = Object.assign({ theme: Z && Z() }, a), o.o = / *go\d+/.test(d), a.className = X.apply(o, i) + (d ? " " + d : "");
      let l = e;
      return e[0] && (l = a.as || e, delete a.as), G && l[0] && G(a), fe(l, a);
    }
    return r;
  };
}
var Le = (e) => typeof e == "function", H = (e, t) => Le(e) ? e(t) : e, Be = /* @__PURE__ */ (() => {
  let e = 0;
  return () => (++e).toString();
})(), pe = /* @__PURE__ */ (() => {
  let e;
  return () => {
    if (e === void 0 && typeof window < "u") {
      let t = matchMedia("(prefers-reduced-motion: reduce)");
      e = !t || t.matches;
    }
    return e;
  };
})(), Ie = 20, me = (e, t) => {
  switch (t.type) {
    case 0:
      return { ...e, toasts: [t.toast, ...e.toasts].slice(0, Ie) };
    case 1:
      return { ...e, toasts: e.toasts.map((n) => n.id === t.toast.id ? { ...n, ...t.toast } : n) };
    case 2:
      let { toast: o } = t;
      return me(e, { type: e.toasts.find((n) => n.id === o.id) ? 1 : 0, toast: o });
    case 3:
      let { toastId: i } = t;
      return { ...e, toasts: e.toasts.map((n) => n.id === i || i === void 0 ? { ...n, dismissed: !0, visible: !1 } : n) };
    case 4:
      return t.toastId === void 0 ? { ...e, toasts: [] } : { ...e, toasts: e.toasts.filter((n) => n.id !== t.toastId) };
    case 5:
      return { ...e, pausedAt: t.time };
    case 6:
      let r = t.time - (e.pausedAt || 0);
      return { ...e, pausedAt: void 0, toasts: e.toasts.map((n) => ({ ...n, pauseDuration: n.pauseDuration + r })) };
  }
}, I = [], $ = { toasts: [], pausedAt: void 0 }, N = (e) => {
  $ = me($, e), I.forEach((t) => {
    t($);
  });
}, Re = { blank: 4e3, error: 4e3, success: 2e3, loading: 1 / 0, custom: 4e3 }, Fe = (e = {}) => {
  let [t, o] = he($), i = ge($);
  U(() => (i.current !== $ && o($), I.push(o), () => {
    let n = I.indexOf(o);
    n > -1 && I.splice(n, 1);
  }), []);
  let r = t.toasts.map((n) => {
    var s, a, d;
    return { ...e, ...e[n.type], ...n, removeDelay: n.removeDelay || ((s = e[n.type]) == null ? void 0 : s.removeDelay) || (e == null ? void 0 : e.removeDelay), duration: n.duration || ((a = e[n.type]) == null ? void 0 : a.duration) || (e == null ? void 0 : e.duration) || Re[n.type], style: { ...e.style, ...(d = e[n.type]) == null ? void 0 : d.style, ...n.style } };
  });
  return { ...t, toasts: r };
}, He = (e, t = "blank", o) => ({ createdAt: Date.now(), visible: !0, dismissed: !1, type: t, ariaProps: { role: "status", "aria-live": "polite" }, message: e, pauseDuration: 0, ...o, id: (o == null ? void 0 : o.id) || Be() }), L = (e) => (t, o) => {
  let i = He(t, e, o);
  return N({ type: 2, toast: i }), i.id;
}, h = (e, t) => L("blank")(e, t);
h.error = L("error");
h.success = L("success");
h.loading = L("loading");
h.custom = L("custom");
h.dismiss = (e) => {
  N({ type: 3, toastId: e });
};
h.remove = (e) => N({ type: 4, toastId: e });
h.promise = (e, t, o) => {
  let i = h.loading(t.loading, { ...o, ...o == null ? void 0 : o.loading });
  return typeof e == "function" && (e = e()), e.then((r) => {
    let n = t.success ? H(t.success, r) : void 0;
    return n ? h.success(n, { id: i, ...o, ...o == null ? void 0 : o.success }) : h.dismiss(i), r;
  }).catch((r) => {
    let n = t.error ? H(t.error, r) : void 0;
    n ? h.error(n, { id: i, ...o, ...o == null ? void 0 : o.error }) : h.dismiss(i);
  }), e;
};
var Ye = (e, t) => {
  N({ type: 1, toast: { id: e, height: t } });
}, Xe = () => {
  N({ type: 5, time: Date.now() });
}, W = /* @__PURE__ */ new Map(), qe = 1e3, Ue = (e, t = qe) => {
  if (W.has(e)) return;
  let o = setTimeout(() => {
    W.delete(e), N({ type: 4, toastId: e });
  }, t);
  W.set(e, o);
}, Qe = (e) => {
  let { toasts: t, pausedAt: o } = Fe(e);
  U(() => {
    if (o) return;
    let n = Date.now(), s = t.map((a) => {
      if (a.duration === 1 / 0) return;
      let d = (a.duration || 0) + a.pauseDuration - (n - a.createdAt);
      if (d < 0) {
        a.visible && h.dismiss(a.id);
        return;
      }
      return setTimeout(() => h.dismiss(a.id), d);
    });
    return () => {
      s.forEach((a) => a && clearTimeout(a));
    };
  }, [t, o]);
  let i = oe(() => {
    o && N({ type: 6, time: Date.now() });
  }, [o]), r = oe((n, s) => {
    let { reverseOrder: a = !1, gutter: d = 8, defaultPosition: l } = s || {}, c = t.filter((p) => (p.position || l) === (n.position || l) && p.height), f = c.findIndex((p) => p.id === n.id), u = c.filter((p, T) => T < f && p.visible).length;
    return c.filter((p) => p.visible).slice(...a ? [u + 1] : [0, u]).reduce((p, T) => p + (T.height || 0) + d, 0);
  }, [t]);
  return U(() => {
    t.forEach((n) => {
      if (n.dismissed) Ue(n.id, n.removeDelay);
      else {
        let s = W.get(n.id);
        s && (clearTimeout(s), W.delete(n.id));
      }
    });
  }, [t]), { toasts: t, handlers: { updateHeight: Ye, startPause: Xe, endPause: i, calculateOffset: r } };
}, Ve = w`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
 transform: scale(1) rotate(45deg);
  opacity: 1;
}`, Ze = w`
from {
  transform: scale(0);
  opacity: 0;
}
to {
  transform: scale(1);
  opacity: 1;
}`, Ge = w`
from {
  transform: scale(0) rotate(90deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(90deg);
	opacity: 1;
}`, Je = O("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${(e) => e.primary || "#ff4b4b"};
  position: relative;
  transform: rotate(45deg);

  animation: ${Ve} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;

  &:after,
  &:before {
    content: '';
    animation: ${Ze} 0.15s ease-out forwards;
    animation-delay: 150ms;
    position: absolute;
    border-radius: 3px;
    opacity: 0;
    background: ${(e) => e.secondary || "#fff"};
    bottom: 9px;
    left: 4px;
    height: 2px;
    width: 12px;
  }

  &:before {
    animation: ${Ge} 0.15s ease-out forwards;
    animation-delay: 180ms;
    transform: rotate(90deg);
  }
`, Ke = w`
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
`, et = O("div")`
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border: 2px solid;
  border-radius: 100%;
  border-color: ${(e) => e.secondary || "#e0e0e0"};
  border-right-color: ${(e) => e.primary || "#616161"};
  animation: ${Ke} 1s linear infinite;
`, tt = w`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(45deg);
	opacity: 1;
}`, ot = w`
0% {
	height: 0;
	width: 0;
	opacity: 0;
}
40% {
  height: 0;
	width: 6px;
	opacity: 1;
}
100% {
  opacity: 1;
  height: 10px;
}`, nt = O("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${(e) => e.primary || "#61d345"};
  position: relative;
  transform: rotate(45deg);

  animation: ${tt} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;
  &:after {
    content: '';
    box-sizing: border-box;
    animation: ${ot} 0.2s ease-out forwards;
    opacity: 0;
    animation-delay: 200ms;
    position: absolute;
    border-right: 2px solid;
    border-bottom: 2px solid;
    border-color: ${(e) => e.secondary || "#fff"};
    bottom: 6px;
    left: 6px;
    height: 10px;
    width: 6px;
  }
`, it = O("div")`
  position: absolute;
`, rt = O("div")`
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 20px;
  min-height: 20px;
`, st = w`
from {
  transform: scale(0.6);
  opacity: 0.4;
}
to {
  transform: scale(1);
  opacity: 1;
}`, at = O("div")`
  position: relative;
  transform: scale(0.6);
  opacity: 0.4;
  min-width: 20px;
  animation: ${st} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
`, dt = ({ toast: e }) => {
  let { icon: t, type: o, iconTheme: i } = e;
  return t !== void 0 ? typeof t == "string" ? m.createElement(at, null, t) : t : o === "blank" ? null : m.createElement(rt, null, m.createElement(et, { ...i }), o !== "loading" && m.createElement(it, null, o === "error" ? m.createElement(Je, { ...i }) : m.createElement(nt, { ...i })));
}, lt = (e) => `
0% {transform: translate3d(0,${e * -200}%,0) scale(.6); opacity:.5;}
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
`, ct = (e) => `
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
100% {transform: translate3d(0,${e * -150}%,-1px) scale(.6); opacity:0;}
`, ut = "0%{opacity:0;} 100%{opacity:1;}", ft = "0%{opacity:1;} 100%{opacity:0;}", pt = O("div")`
  display: flex;
  align-items: center;
  background: #fff;
  color: #363636;
  line-height: 1.3;
  will-change: transform;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
  max-width: 350px;
  pointer-events: auto;
  padding: 8px 10px;
  border-radius: 8px;
`, mt = O("div")`
  display: flex;
  justify-content: center;
  margin: 4px 10px;
  color: inherit;
  flex: 1 1 auto;
  white-space: pre-line;
`, ht = (e, t) => {
  let o = e.includes("top") ? 1 : -1, [i, r] = pe() ? [ut, ft] : [lt(o), ct(o)];
  return { animation: t ? `${w(i)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards` : `${w(r)} 0.4s forwards cubic-bezier(.06,.71,.55,1)` };
}, gt = m.memo(({ toast: e, position: t, style: o, children: i }) => {
  let r = e.height ? ht(e.position || t || "top-center", e.visible) : { opacity: 0 }, n = m.createElement(dt, { toast: e }), s = m.createElement(mt, { ...e.ariaProps }, H(e.message, e));
  return m.createElement(pt, { className: e.className, style: { ...r, ...o, ...e.style } }, typeof i == "function" ? i({ icon: n, message: s }) : m.createElement(m.Fragment, null, n, s));
});
_e(m.createElement);
var yt = ({ id: e, className: t, style: o, onHeightUpdate: i, children: r }) => {
  let n = m.useCallback((s) => {
    if (s) {
      let a = () => {
        let d = s.getBoundingClientRect().height;
        i(e, d);
      };
      a(), new MutationObserver(a).observe(s, { subtree: !0, childList: !0, characterData: !0 });
    }
  }, [e, i]);
  return m.createElement("div", { ref: n, className: t, style: o }, r);
}, vt = (e, t) => {
  let o = e.includes("top"), i = o ? { top: 0 } : { bottom: 0 }, r = e.includes("center") ? { justifyContent: "center" } : e.includes("right") ? { justifyContent: "flex-end" } : {};
  return { left: 0, right: 0, display: "flex", position: "absolute", transition: pe() ? void 0 : "all 230ms cubic-bezier(.21,1.02,.73,1)", transform: `translateY(${t * (o ? 1 : -1)}px)`, ...i, ...r };
}, bt = X`
  z-index: 9999;
  > * {
    pointer-events: auto;
  }
`, B = 16, Et = ({ reverseOrder: e, position: t = "top-center", toastOptions: o, gutter: i, children: r, containerStyle: n, containerClassName: s }) => {
  let { toasts: a, handlers: d } = Qe(o);
  return m.createElement("div", { id: "_rht_toaster", style: { position: "fixed", zIndex: 9999, top: B, left: B, right: B, bottom: B, pointerEvents: "none", ...n }, className: s, onMouseEnter: d.startPause, onMouseLeave: d.endPause }, a.map((l) => {
    let c = l.position || t, f = d.calculateOffset(l, { reverseOrder: e, gutter: i, defaultPosition: t }), u = vt(c, f);
    return m.createElement(yt, { id: l.id, key: l.id, onHeightUpdate: d.updateHeight, className: l.visible ? bt : "", style: u }, l.type === "custom" ? H(l.message, l) : r ? r(l) : m.createElement(gt, { toast: l, position: c }));
  }));
};
export {
  Et as O,
  xt as a,
  h as c
};
//# sourceMappingURL=index.Bxix3KXR.js.map
