import{shiftDateField as n}from"./date-utils.js";function t(n){const t=new Date;return a({since:new Date(t.getTime()-n),until:t})}function e(n){return null==n.until}function i(){return r(0)}function u(){const t=f(),e=n(t,"D",-1),i=n(t,"S",-1);return{since:e.toISOString(),until:i.toISOString()}}function r(t){const e=f();return{since:n(e,"D",-t).toISOString(),until:(new Date).toISOString()}}function c(n,t){return a(s(l(n),t))}function o(n){return s(l(n),"right").until.getTime()>(new Date).getTime()}function s(n,t){if(e(n))throw new Error("Cannot shift an unbounded date range");const i=n.since.getTime(),u=n.until.getTime(),r=u-i;switch(t){case"left":return{since:new Date(i-r),until:n.since};case"right":return{since:n.until,until:new Date(u+r)}}}function l(n){return{since:new Date(n.since),until:null==n.until?null:new Date(n.until)}}function a(n){return{since:n.since.toISOString(),until:null==n.until?null:n.until.toISOString()}}function f(){const n=new Date;return n.setUTCHours(0),n.setUTCMinutes(0),n.setUTCSeconds(0),n.setUTCMilliseconds(0),n}export{t as getRangeToNow,e as isLive,o as isRightDateRangeAfterNow,r as lastXDays,c as shiftDateRange,i as today,u as yesterday};
//# sourceMappingURL=date-range-utils.js.map
