import { events as c } from "@universityofmaryland/web-elements-library/atomic";
import * as s from "@universityofmaryland/web-utilities-library/date";
import { Attributes as r, Slots as i } from "@universityofmaryland/web-model-library";
const m = (t) => ({
  startDate: t.querySelector(`[slot="${i.name.DATE_START_ISO}"]`),
  endDate: t.querySelector(`[slot="${i.name.DATE_END_ISO}"]`),
  location: t.querySelector(`[slot="${i.name.contact.location}"]`)
}), D = (t) => {
  const e = s.parseDateFromElement({ element: t.startDate });
  if (!e)
    return null;
  const a = s.parseDateFromElement({ element: t.endDate });
  return {
    detailsData: s.createEventDetails({
      locationElement: t.location,
      startDate: e,
      endDate: a
    }),
    startDate: e,
    endDate: a,
    locationElement: t.location
  };
}, E = (t) => ({
  isThemeDark: r.isTheme.dark({ element: t }) || r.isTheme.maryland({ element: t }),
  showTime: r.isVisual.showTime({ element: t })
}), u = (t, e = {}) => {
  const {
    isThemeDark: a = !1,
    showTime: n = !1,
    isLargeSize: o = !1,
    isDateSignDark: l
  } = e;
  return {
    eventMeta: c.meta({
      ...t.detailsData,
      isThemeDark: a,
      showTime: n
    }),
    dateSign: c.sign({
      ...t.detailsData,
      isThemeDark: l ?? a,
      isLargeSize: o
    })
  };
}, S = (t, e) => {
  const a = m(t), n = D(a);
  if (!n)
    return null;
  const o = {
    ...E(t),
    ...e
  };
  return u(n, o);
};
export {
  S as e
};
//# sourceMappingURL=_event-Duz7QGRD.js.map
