import { c as J, p as tt, h as M, f as A, i as T, k as L, A as R, s as S, r as u, e as q, b as d, d as N, u as V, a as et } from "./AssetItem-BxjLUzNd.js";
import { o as rt } from "./index-client-C5PXnhDi.js";
import { t as F, J as st, L as at, n as ct, D as _, m as b, E as t, v as E, o as ot, w as c, z as v, x as o, y as j, C as l, r as G, l as nt, p as it, M as lt, V as wt } from "./index-BBXAtvZr.js";
import { b as pt } from "./App-BwT5MYkN.js";
var ft = A("<button> </button>"), ut = A(`<a class="crtw-flex crtw-justify-center crtw-items-center crtw-w-full crtw-h-[50px] crtw-cursor-pointer
          crtw-border-2 crtw-border-black crtw-rounded crtw-font-['Poppins'] crtw-text-base crtw-font-medium"> </a>`), xt = A(`<div class="crtw-flex crtw-flex-col crtw-justify-start crtw-items-start crtw-w-full crtw-mx-[50px]"><img alt="credenza-logo" class="crtw-w-[200px] crtw-mx-auto"/> <div class="crtw-flex crtw-flex-col crtw-justify-start crtw-items-start crtw-font-['Poppins'] crtw-w-full crtw-mt-[36px]"><span class="crtw-text-[24px] crtw-text-[#313a2c] crtw-font-medium"> </span> <span class="crtw-text-base crtw-text-[#747474] crtw-mb-1"> </span></div> <div class="crtw-flex crtw-flex crtw-gap-[6px] crtw-w-full crtw-items-center crtw-mb-[100px] crtw-mt-[30px]"><!> <button> </button></div></div>`);
function H(w, n) {
  if (new.target) return J({ component: H, ...w });
  F(n, !1);
  let r = tt(n, "options", 12), p = b(), f = b(), e = b();
  const { close: g } = st(at), D = `crtw-px-[36px] crtw-flex crtw-justify-center crtw-items-center crtw-bg-black crtw-text-white crtw-h-[50px] crtw-cursor-pointer
      crtw-border-0 crtw-rounded crtw-font-['Poppins'] crtw-text-sm crtw-font-medium`;
  ct(
    () => (E(r()), t(p), t(f), t(e)),
    () => {
      r() && ((s) => {
        _(p, s.title), _(f, s.description), _(e, s.action);
      })(r());
    }
  ), ot();
  var I = {
    get options() {
      return r();
    },
    set options(s) {
      r(s), nt();
    },
    $set: V,
    $on: (s, m) => N(n, s, m)
  };
  M();
  var h = xt(), z = c(h), y = v(z, 2), k = c(y), K = c(k, !0);
  o(k);
  var B = v(k, 2), Q = c(B, !0);
  o(B), o(y);
  var O = v(y, 2), P = c(O);
  {
    var U = (s) => {
      var m = et(), X = it(m);
      {
        var Y = (i) => {
          var a = ft();
          L(a, 1, R(D));
          var C = c(a, !0);
          o(a), j(() => u(C, (t(e), l(() => t(e).text)))), q("click", a, function(...$) {
            t(e).onClick?.apply(this, $);
          }), d(i, a);
        }, Z = (i) => {
          var a = ut(), C = c(a, !0);
          o(a), j(() => {
            S(a, "href", (t(e), l(() => t(e)?.link))), u(C, (t(e), l(() => t(e)?.text)));
          }), d(i, a);
        };
        T(X, (i) => {
          t(e), l(() => t(e)?.onClick) ? i(Y) : (t(e), l(() => t(e)?.link) && i(Z, 1));
        });
      }
      d(s, m);
    };
    T(P, (s) => {
      t(e) && s(U);
    });
  }
  var x = v(P, 2);
  L(x, 1, R(D));
  var W = c(x, !0);
  return o(x), o(O), o(h), j(() => {
    S(z, "src", pt), u(K, t(p)), u(Q, t(f)), u(W, (E(r()), l(() => r().closeButtonText || "Close")));
  }), q("click", x, g), d(w, h), G(I);
}
function mt(w, n) {
  if (new.target) return J({ component: mt, ...w });
  F(n, !1);
  let r = b();
  const p = lt.subscribe((e) => {
    _(r, Object.assign(Object.assign({}, t(r)), e.richAlertData));
  });
  rt(p);
  var f = {
    $set: V,
    $on: (e, g) => N(n, e, g)
  };
  M();
  {
    let e = wt(() => ({
      title: t(r).title || "Notification",
      description: t(r).description || "Choose your next steps",
      action: t(r).action,
      closeButtonText: t(r).closeButtonText
    }));
    H(w, {
      get options() {
        return t(e);
      }
    });
  }
  return G(f);
}
export {
  mt as default
};
//# sourceMappingURL=RichAlert-D01N1xgc.js.map
