import{h as r,dz as M,dA as m,dB as u,ag as Y}from"./app-k0jcl5PQ.js";function f(t){const e=new Set;return t.filter(n=>e.has(n.specialEventId)?!1:(e.add(n.specialEventId),!0))}const l={getDisplayDate(t,e){return e?t.slice(5,7)!==e.slice(5,7)?`${r.format(t,"D MMM")} - ${r.format(e,"D MMM")}`:m.getCurrentRegion()===u[Y.US]?`${r.format(t,"MMM")} ${r.format(t,"D")} - ${r.format(e,"D")}`:`${r.format(t,"D")} - ${r.format(e,"D")} ${r.format(t,"MMM")}`:r.format(t,"D MMM")},getEventsInMonth(t,e){return t.filter(n=>r.format(n.startDate,"YYYY-MM")===r.format(e,"YYYY-MM"))},getOrdinalDate(t){return`${r.getLocalDateOrdinal(r.get(t,"date"))} ${r.format(t,"MMMM")}`},isEventFromPreviousMonth(t,e){if(!t.endDate)return!1;const n=r.format(t.startDate,"YYYY-MM"),s=r.format(e,"YYYY-MM");return n<s&&t.endDate>=r.format(e,"YYYY-MM-DD")},getEventsForDay(t,e,n=[],s){const a=e.filter(o=>r.isSame(t,o.startDate))||[];return r.isSame(M(s),t,"day")?f([...a,...n]):a},getCrossMonthEventsForDate(t,e,n){return r.isSame(M(n),t,"day")?e.filter(a=>{const i=l.isEventFromPreviousMonth(a,t),o=r.isSame(t,a.startDate);return i&&!o}):[]},getAllEventsForDate(t,e,n){const s=r.format(t,"YYYY-MM-DD"),a=e.filter(o=>o.startDate===s),i=l.getCrossMonthEventsForDate(t,e,n);return f([...a,...i])}};export{l as S};
//# sourceMappingURL=BC-7kXnm.chunk.js.map
