import { jsx as a, Fragment as d, jsxs as c } from "react/jsx-runtime";
import { useMemo as f } from "react";
import { a3 as g, o as x, a4 as b, a5 as _, z as u, a6 as y, a7 as n, a8 as o, a9 as I, aa as N } from "./index-C62tPk5p.js";
function S(r) {
  return g.safeParse(r).success;
}
function k(r) {
  let t = null;
  return S(r) && (t = r), t;
}
const M = ({
  eventType: r,
  className: t,
  shortenDescription: m,
  isPublic: A
}) => {
  const { t: s, i18n: D } = x(), i = f(
    () => k(r.recurringEvent),
    [r.recurringEvent]
  ), e = b.parse(r.metadata), l = _({
    ...r,
    metadata: e
  });
  return /* @__PURE__ */ a(d, { children: /* @__PURE__ */ c("div", { className: u("text-subtle", t), children: [
    r.descriptionAsSafeHTML && /* @__PURE__ */ a(
      "div",
      {
        className: u(
          "text-subtle line-clamp-3 wrap-break-word py-1 text-sm sm:max-w-[650px] [&_a]:text-blue-500 [&_a]:underline [&_a]:hover:text-blue-600",
          m ? "line-clamp-4 [&>*:not(:first-child)]:hidden" : ""
        ),
        dangerouslySetInnerHTML: {
          __html: y(r.descriptionAsSafeHTML || "")
        }
      }
    ),
    /* @__PURE__ */ c("ul", { className: "mt-2 flex flex-wrap gap-x-2 gap-y-1", children: [
      e != null && e.multipleDuration ? e.multipleDuration.map((h, p) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ c(n, { variant: "gray", startIcon: "clock", children: [
        h,
        "m"
      ] }) }, p)) : /* @__PURE__ */ a("li", { children: /* @__PURE__ */ c(n, { variant: "gray", startIcon: "clock", children: [
        r.length,
        "m"
      ] }) }),
      r.schedulingType && r.schedulingType !== o.MANAGED && /* @__PURE__ */ a("li", { children: /* @__PURE__ */ c(n, { variant: "gray", startIcon: "users", children: [
        r.schedulingType === o.ROUND_ROBIN && s("round_robin"),
        r.schedulingType === o.COLLECTIVE && s("collective")
      ] }) }),
      (i == null ? void 0 : i.count) && i.count > 0 && /* @__PURE__ */ a("li", { className: "hidden xl:block", "data-testid": "repeat-eventtype", children: /* @__PURE__ */ a(n, { variant: "gray", startIcon: "refresh-cw", children: s("repeats_up_to", {
        count: i.count
      }) }) }),
      l.enabled && /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(
        n,
        {
          variant: "gray",
          customStartIcon: /* @__PURE__ */ a(I, { currency: l.currency, className: "h-3 w-3 stroke-[3px]" }),
          children: /* @__PURE__ */ a(
            N,
            {
              currency: l.currency,
              price: l.price,
              displayAlternateSymbol: !1
            }
          )
        }
      ) }),
      r.requiresConfirmation && /* @__PURE__ */ a("li", { className: "hidden xl:block", "data-testid": "requires-confirmation-badge", children: /* @__PURE__ */ a(n, { variant: "gray", startIcon: "clipboard", children: e != null && e.requiresConfirmationThreshold ? s("may_require_confirmation") : s("requires_confirmation") }) }),
      r.requiresConfirmation || i != null && i.count && i.count ? /* @__PURE__ */ a("li", { className: "block xl:hidden", children: /* @__PURE__ */ a(n, { variant: "gray", startIcon: "plus", children: /* @__PURE__ */ a("p", { children: [r.requiresConfirmation, i == null ? void 0 : i.count].filter(Boolean).length }) }) }) : /* @__PURE__ */ a(d, {}),
      r != null && r.seatsPerTimeSlot ? /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(n, { variant: "gray", startIcon: "user", children: /* @__PURE__ */ c("p", { children: [
        s("event_type_seats", { numberOfSeats: r.seatsPerTimeSlot }),
        " "
      ] }) }) }) : null
    ] })
  ] }) });
};
export {
  M as EventTypeDescription,
  M as default
};
