"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var l=require("./components/calendar/utils.js"),s=require("./dateUtils.js");const u=new Date,r=s.subDays(u,1),y=l.getPrevMonth(u.getMonth()),c=y===11?u.getFullYear()-1:u.getFullYear(),m=s.getFirstDayOfMonth(c,y),d=s.getLastDayOfMonth(c,y),t={today:"TODAY",yesterday:"YESTERDAY",last7Days:"LASTSEVEN",last28Days:"LASTTWENTYEIGHT",lastMonth:"LASTMONTH",custom:"CUSTOM"},n={[t.today]:{label:"Today",value:t.today,dateRange:u},[t.yesterday]:{label:"Yesterday",value:t.yesterday,dateRange:r},[t.last7Days]:{label:"Last 7 Days",value:t.last7Days,dateRange:{start:s.subDays(r,6),end:r}},[t.last28Days]:{label:"Last 28 Days",value:t.last28Days,dateRange:{start:s.subDays(r,27),end:r}},[t.lastMonth]:{label:"Last Month",value:t.lastMonth,dateRange:{start:m,end:d}}},S=[n[t.today],n[t.yesterday],n[t.last7Days],n[t.last28Days],n[t.lastMonth]],f=(e=[])=>{const a=e.find(o=>o.value===t.custom)??{label:"Custom",value:t.custom};return[...e.filter(({value:o})=>o!==t.custom),a]},M=(e=[])=>e.length>1,g={placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,2]}},{name:"preventOverflow",options:{altAxis:!0}},{name:"computeStyles",options:{adaptive:!1}}]};function p(e,a){return[{month:l.getPrevMonth(e),year:l.getPrevYear(e,a)},{month:e,year:a},{month:l.getNextMonth(e),year:l.getNextYear(e,a)}]}function h(e,a){return a?a instanceof Date?a.getMonth():a.start.getMonth():e.getMonth()}function v(e,a,o,b){if(s.getIsSameDay(e.start,e.end))return s.formatDate(e.start,a,o);const D=s.formatDate(e.start,a,o),i=s.formatDate(e.end,a,o);return`${D} - ${i}`}const T={January:0,December:11},E=82.53;exports.CALENDAR_HEADER_HEIGHT=E;exports.CommonSelectorValue=t;exports.JS_MONTHS=T;exports.commonDateSelector=n;exports.commonDateSelectors=S;exports.formatInputValue=v;exports.getCurrentMonth=h;exports.getInitialMonths=p;exports.getSelectors=f;exports.popperOptions=g;exports.prevMonth=y;exports.shouldUseSelectorsProp=M;exports.year=c;
