@timestamp-js/core 0.1.0-rc.0 → 0.1.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -11
- package/dist/calendar.d.ts +101 -0
- package/dist/calendar.d.ts.map +1 -0
- package/dist/calendar.js +69 -0
- package/dist/calendar.js.map +1 -0
- package/dist/index.d.ts +439 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.global.js +1550 -0
- package/dist/index.global.min.js +1 -0
- package/dist/index.js +646 -87
- package/dist/index.js.map +1 -1
- package/package.json +8 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var TimestampJsCore=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});let t=864e5,n=[0,31,28,31,30,31,30,31,31,30,31,30,31],r=[0,31,29,31,30,31,30,31,31,30,31,30,31];function i(e,t){let n=String(e);for(;n.length<t;)n=`0`+n;return n}function a(e){return`${i(e.year,4)}-${i(e.month,2)}-${i(e.day,2)}`}function o(e){return{year:e.getUTCFullYear(),month:e.getUTCMonth()+1,day:e.getUTCDate()}}function s(e){return new Date(Date.UTC(e.year,e.month-1,e.day))}let c=Object.freeze({id:`gregorian`,intlCalendar:`gregory`,label:`Gregorian`,monthsInYear(){return 12},isLeapYear(e){return e%4==0&&e%100!=0||e%400==0},daysInMonth(e,t){return this.isLeapYear(e)?r[t]:n[t]},toEpochDay(e){return Math.floor(Date.UTC(e.year,e.month-1,e.day)/t)},fromEpochDay(e){return o(new Date(e*t))},addDays(e,t){return this.fromEpochDay(this.toEpochDay(e)+t)},nextDay(e){return this.addDays(e,1)},prevDay(e){return this.addDays(e,-1)},getDayOfYear(e){let t=this.toEpochDay({year:e.year,month:1,day:1});return this.toEpochDay(e)-t+1},getWeekday(e){return s(e).getUTCDay()}}),l=/^(\d{4})-(\d{1,2})(?:-(\d{1,2}))?(?:[Tt\s]+(\d{1,2})(?::(\d{1,2}))?(?::(\d{1,2})(?:\.(\d{1,3}))?)?)?(?:\s*(Z|[+-]\d{2}:?\d{2}))?$/,u=/^(\d{4})-(\d{1,2})(-(\d{1,2}))?/,d=/^(\d\d?)(?::(\d\d?))?(?::(\d\d?))?(?:\.(\d{1,3}))?$/,f=[0,31,28,31,30,31,30,31,31,30,31,30,31],p=[0,31,29,31,30,31,30,31,31,30,31,30,31],m={MILLISECONDS_IN:{SECOND:1e3,MINUTE:6e4,HOUR:36e5,DAY:864e5,WEEK:6048e5},SECONDS_IN:{MINUTE:60,HOUR:3600,DAY:86400,WEEK:604800},MINUTES_IN:{MINUTE:1,HOUR:60,DAY:1440,WEEK:10080},HOURS_IN:{DAY:24,WEEK:168},DAYS_IN:{WEEK:7}},h=m.DAYS_IN.WEEK,g=m.MINUTES_IN.HOUR,_=m.HOURS_IN.DAY,v=m.MILLISECONDS_IN.MINUTE,y=m.MILLISECONDS_IN.SECOND,b=m.MILLISECONDS_IN.HOUR,x=m.MILLISECONDS_IN.DAY,ee=m.MILLISECONDS_IN.WEEK,te=m.SECONDS_IN.MINUTE,ne=m.SECONDS_IN.HOUR,re=m.SECONDS_IN.DAY,ie=S({date:``,hasDay:!1,year:0,month:0,day:0,hasTime:!1,hour:0,minute:0,weekday:0,doy:0,workweek:0,past:!1,current:!1,future:!1,disabled:!1}),ae=Object.freeze({hour:0,minute:0});function S(e){return Object.freeze({...e})}function C(e){return{...e}}function w(e){return{year:e.year,month:e.month,day:e.day}}function T(e){return{hasTime:e.hasTime,hour:e.hour,minute:e.minute,second:e.second,millisecond:e.millisecond,timezone:e.timezone}}function oe(e,t){let n=t.getWeekday({year:e.year,month:1,day:1});return Math.floor((t.getDayOfYear(e)+n-1)/7)+1}function se(e){return e===void 0?void 0:parseInt(e.padEnd(3,`0`),10)}function ce(e){return typeof e==`string`?l.test(e):!1}function E(e){if(typeof e!=`string`)return null;let t=l.exec(e);if(!t||!t[1]||!t[2])return null;let n=parseInt(t[1],10),r=parseInt(t[2],10),i=parseInt(t[3]||`1`,10),a=parseInt(t[4]||`0`,10),o=parseInt(t[5]||`0`,10),s=t[6]===void 0?void 0:parseInt(t[6],10),c=se(t[7]),u={date:e,year:n,month:r,day:i,hour:a,minute:o,hasDay:!!t[3],hasTime:!0,past:!1,current:!1,future:!1,disabled:!1,weekday:0,doy:0,workweek:0};return s!==void 0&&(u.second=s),c!==void 0&&(u.millisecond=c),t[8]!==void 0&&(u.timezone=t[8]),u.time=U(u),S(u)}function le(e,t){if(!(e instanceof Date)||Number.isNaN(e.getTime()))return null;let n=t?`UTC`:``,r=e[`get${n}Seconds`](),i=e[`get${n}Milliseconds`](),a={date:D(e[`get${n}FullYear`](),4)+`-`+D(e[`get${n}Month`]()+1,2)+`-`+D(e[`get${n}Date`](),2),time:D(e[`get${n}Hours`]()||0,2)+`:`+D(e[`get${n}Minutes`]()||0,2),year:e[`get${n}FullYear`](),month:e[`get${n}Month`]()+1,day:e[`get${n}Date`](),hour:e[`get${n}Hours`](),minute:e[`get${n}Minutes`](),weekday:0,doy:0,workweek:0,hasDay:!0,hasTime:!0,past:!1,current:!1,future:!1,disabled:!1};return r!==0&&(a.second=r),i!==0&&(a.millisecond=i),B(a)}function ue(e){return le(e,!1)}function de(e){return le(e,!0)}function D(e,t){let n=String(e);for(;n.length<t;)n=`0`+n;return n}function fe(e){return c.isLeapYear(e)}function O(e,t){return c.daysInMonth(e,t)}function k(e){let t=c.nextDay(w(e));return B($({...e,year:t.year,month:t.month,day:t.day}))}function pe(e){let t=c.prevDay(w(e));return B($({...e,year:t.year,month:t.month,day:t.day}))}function me(){let e=new Date,t=e.getMonth()+1,n=e.getDate();return[e.getFullYear(),D(t,2),D(n,2)].join(`-`)}function he(e=new Date){return[D(e.getUTCFullYear(),4),D(e.getUTCMonth()+1,2),D(e.getUTCDate(),2)].join(`-`)}function ge(e=new Date){return de(e)}function _e(e){return e===me()}function ve(e,t=new Date){return e===he(t)}function ye(e,t,n){let r=C(e);if(!t)return S(r);if(r.day===1||r.weekday===0)for(;!t.includes(Number(r.weekday));)r=k(r);return r=K(r,t[0],pe),r=B(r),n&&(r=z(r,n,r.hasTime)),r}function be(e,t,n){let r=C(e);if(!t||!Array.isArray(t))return S(r);if(O(r.year,r.month)===r.day||r.weekday===t[t.length-1])for(;!t.includes(Number(r.weekday));)r=pe(r);return r=K(r,t[t.length-1],k),r=B(r),n&&(r=z(r,n,r.hasTime)),r}function xe(e){let t=C(e);return t.day=1,t=B(t),t}function Se(e){let t=C(e);return t.day=O(t.year,t.month),t=B(t),t}function Ce(e){switch(Object.prototype.toString.call(e)){case`[object Number]`:return e;case`[object String]`:{let t=d.exec(e);return t?parseInt(t[1],10)*60+parseInt(t[2]||`0`,10):!1}case`[object Object]`:return typeof e!=`object`||typeof e.hour!=`number`||typeof e.minute!=`number`?!1:typeof e==`object`&&`hour`in e&&`minute`in e?e.hour*60+e.minute:!1}return!1}function we(e,t){return!e||!t?!1:e.year===t.year&&e.month===t.month&&e.day===t.day&&e.hour===t.hour&&e.minute===t.minute&&e.second===t.second&&e.millisecond===t.millisecond&&e.timezone===t.timezone}function Te(e,t){return H(e)===H(t)}function Ee(e,t){return U(e)===U(t)}function De(e,t){return W(e)===W(t)}function A(e,t=null){let n=E(e);return n?(n=B(n),t&&(n=z(n,t,n.hasTime)),n):null}function j(e){return(e.year??0)*1e8+(e.month??0)*1e6+(e.day??0)*1e4}function Oe(e,t=c){return t.toEpochDay(w(e))}function M(e,t=c){return Oe(e,t)}function ke(e,t=c){return e.year<1||e.month<1||e.month>t.monthsInYear(e.year)?!1:e.day>=1&&e.day<=t.daysInMonth(e.year,e.month)}function N(e,t=c,n={}){let r={calendarId:t.id,date:a(e),hasDay:!0,year:e.year,month:e.month,day:e.day,hasTime:n.hasTime??!0,hour:n.hour??0,minute:n.minute??0,past:!1,current:!1,future:!1,disabled:!1,weekday:t.getWeekday(e),doy:t.getDayOfYear(e),workweek:oe(e,t)};n.second!==void 0&&(r.second=n.second),n.millisecond!==void 0&&(r.millisecond=n.millisecond),n.timezone!==void 0&&(r.timezone=n.timezone),r.time=U(r);let i=S(r);return n.now?F(i,n.now,t,i.hasTime):i}function Ae(e,t=c,n=null){let r=E(e);if(r===null)return null;let i=w(r);return ke(i,t)===!1?null:N(i,t,{...T(r),now:n})}function je(e,t=c,n={}){return N(t.fromEpochDay(e),t,n)}function P(e,t=c){return N(w(e),t,T(e))}function F(e,t,n=c,r=!1){let i=C(e),a=M(t,n),o=M(i,n),s=a===o;return i.hasTime&&r&&s&&(a=R(t),o=R(i),s=a===o),i.past=o<a,i.current=s,i.future=o>a,i.currentWeekday=i.weekday===t.weekday,S(i)}function I(e,t=c){return N(t.nextDay(w(e)),t,T(e))}function Me(e,t=c){return N(t.prevDay(w(e)),t,T(e))}function Ne(e,t,n=c){return N(n.addDays(w(e),t),n,T(e))}function Pe(e,t,n=c){let{year:r,month:i,day:a}=w(e),o=Math.trunc(t);for(;o>0;)i+=1,i>n.monthsInYear(r)&&(r+=1,i=1),--o;for(;o<0;)--i,i<1&&(--r,i=n.monthsInYear(r)),o+=1;return a=Math.min(a,n.daysInMonth(r,i)),N({year:r,month:i,day:a},n,T(e))}function Fe(e,t,n=c){let{year:r,month:i,day:a}=w(e);return r+=Math.trunc(t),i=Math.min(i,n.monthsInYear(r)),a=Math.min(a,n.daysInMonth(r,i)),N({year:r,month:i,day:a},n,T(e))}function Ie(e,t=c){return N({...w(e),day:1},t,T(e))}function Le(e,t=c){let n=w(e);return N({...n,day:t.daysInMonth(n.year,n.month)},t,T(e))}function Re(e,t=c){return N({year:e.year,month:1,day:1},t,T(e))}function ze(e,t=c){let n=t.monthsInYear(e.year);return N({year:e.year,month:n,day:t.daysInMonth(e.year,n)},t,T(e))}function Be(e,t,n=c,r=`next`,i=6){let a=V(e),o=r===`next`?I:Me;for(;a.weekday!==t&&--i>=0;)a=o(a,n);return a}function Ve(e,t,n=c,r=null){let i=P(e,n);if(!t||!Array.isArray(t))return i;if(i.day===1||i.weekday===0)for(;!t.includes(Number(i.weekday));)i=I(i,n);return i=Be(i,t[0],n,`prev`),r?F(i,r,n,i.hasTime):i}function He(e,t,n=c,r=null){let i=P(e,n);if(!t||!Array.isArray(t))return i;if(n.daysInMonth(i.year,i.month)===i.day||i.weekday===t[t.length-1])for(;!t.includes(Number(i.weekday));)i=Me(i,n);return i=Be(i,t[t.length-1],n,`next`),r?F(i,r,n,i.hasTime):i}function Ue(e,t,n,r=c,i={}){let{weekdays:a=[0,1,2,3,4,5,6],disabledBefore:o,disabledAfter:s,disabledWeekdays:l=[],disabledDays:u=[],max:d=42,min:f=0}=i,p=M(e,r),m=M(t,r),h=[],g=P(e,r),_=0,v=_===m;if(m<p)return h;for(;(!v||h.length<f)&&h.length<d&&(_=M(g,r),v||=_>m&&h.length>=f,!v);){if(!a.includes(Number(g.weekday))){g=I(g,r);continue}let e=P(g,r);e=F(e,n,r),e=$e(e,o,s,l,u),h.push(e),g=I(g,r)}return h}function L(e){return(e.hour??0)*100+(e.minute??0)}function R(e){return(((e.hour??0)*m.MINUTES_IN.HOUR+(e.minute??0))*m.SECONDS_IN.MINUTE+(e.second??0))*m.MILLISECONDS_IN.SECOND+(e.millisecond??0)}function We(e){return j(e)+L(e)}function Ge(e,t,n=!1){let r=Date.UTC(e.year??0,(e.month??1)-1,e.day??1,e.hour??0,e.minute??0,e.second??0,e.millisecond??0),i=Date.UTC(t.year??0,(t.month??1)-1,t.day??1,t.hour??0,t.minute??0,t.second??0,t.millisecond??0);return n===!0&&i<r?0:i-r}function z(e,t,n=!1){let r=C(e),i=j(t),a=j(r),o=i===a;return r.hasTime&&n&&o&&(i=R(t),a=R(r),o=i===a),r.past=a<i,r.current=o,r.future=a>i,r.currentWeekday=r.weekday===t.weekday,S(r)}function Ke(e,t,n=null){let r=C(e);return r.hasTime=!0,r.hour=Math.floor(t/m.MINUTES_IN.HOUR),r.minute=t%m.MINUTES_IN.HOUR,delete r.second,delete r.millisecond,r.time=U(r),n?z(r,n,!0):S(r)}function qe(e){let t=C(e);return t.weekday=nt(t),S(t)}function Je(e){let t=C(e);return t.doy=et(t)||0,S(t)}function Ye(e){let t=C(e);return t.workweek=tt(t),S(t)}function Xe(e){return typeof e==`object`&&!!e&&Array.isArray(e)===!1}function Ze(e,t){return e.disabled=!0,t!==void 0&&(e.disabledColor=t.color,e.disabledTextColor=t.textColor,e.disabledClass=t.class,e.disabledStyle=t.style,e.disabledLabel=t.label),e}function Qe(e,t){let n=j(e);if(Array.isArray(t)===!0){if(t.length===2&&t[0]&&t[1]){let n=E(t[0]),r=E(t[1]);return n!==null&&r!==null&&Q(e,n,r)}return t.some(e=>{let t=A(e);return t!==null&&j(t)===n})}if(Xe(t)===!0){let r=t.date,i=t.from??t.start,a=t.to??t.end;if(r!==void 0){let e=A(r);return e!==null&&j(e)===n}if(i!==void 0&&a!==void 0){let t=E(i),n=E(a);return t!==null&&n!==null&&Q(e,t,n)}return!1}let r=A(t);return r!==null&&j(r)===n}function $e(e,t,n,r,i){let a=C(e),o=j(a);if(t!==void 0){let e=E(t);e&&o<=j(e)&&(a.disabled=!0)}if(a.disabled!==!0&&n!==void 0){let e=E(n);e&&o>=j(e)&&(a.disabled=!0)}if(a.disabled!==!0&&Array.isArray(r)&&r.length>0){for(let e in r)if(r[e]===a.weekday){a.disabled=!0;break}}if(a.disabled!==!0&&Array.isArray(i)&&i.length>0){for(let e of i)if(Qe(a,e)===!0){a=Ze(a,Xe(e)===!0?e:void 0);break}}return S(a)}function B(e){let t=C(e);return t.hasTime=!0,t.time=U(t),t.date=H(t),t.weekday=nt(t),t.doy=et(t)||0,t.workweek=tt(t),S(t)}function et(e){if(e.year!==0)return c.getDayOfYear(w(e))}function tt(e){let t=e;if(t.year===0){let e=A(me());e&&(t=e)}let n=new Date(Date.UTC(t.year,t.month-1,t.day));n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+6)%7+4),n.setUTCDate(n.getUTCDate()+4-(n.getUTCDay()||7));var r=new Date(Date.UTC(n.getUTCFullYear(),0,1));return Math.ceil(((n.valueOf()-r.valueOf())/864e5+1)/7)}function nt(e){let t=e.weekday;return e.hasDay&&(t=c.getWeekday(w(e))),t??0}function V(e){return S(e)}function rt(e,t,n,r,i){let a=C(e);return a.hasTime=!0,a.hour=t,a.minute=n,r===void 0?delete a.second:a.second=r,i===void 0?delete a.millisecond:a.millisecond=i,B(a)}function it(e){return rt(e,0,0)}function at(e){return rt(e,23,59,59,999)}function ot(e){let t=C(e);return t.month=1,t.day=1,it(B(t))}function st(e){let t=C(e);return t.month=12,t.day=O(t.year,12),at(B(t))}function H(e){let t=`${D(e.year,4)}-${D(e.month,2)}`;return e.hasDay&&(t+=`-${D(e.day,2)}`),t}function U(e){if(!e.hasTime)return``;let t=`${D(e.hour,2)}:${D(e.minute,2)}`;return(e.second!==void 0||e.millisecond!==void 0)&&(t+=`:${D(e.second??0,2)}`),e.millisecond!==void 0&&(t+=`.${D(e.millisecond,3)}`),t}function W(e){return H(e)+` `+(e.hasTime?U(e):`00:00`)}function ct(e,t=k,n=1,r=[0,1,2,3,4,5,6]){return G(e,t,n,r)}function G(e,t=k,n=1,r=[0,1,2,3,4,5,6]){let i=V(e);for(!r.includes(Number(i.weekday))&&i.weekday===0&&t===k&&++n;--n>=0;)i=t(i),r.length<7&&!r.includes(Number(i.weekday))&&++n;return i}function K(e,t,n=k,r=6){let i=V(e);for(;i.weekday!==t&&--r>=0;)i=n(i);return i}function lt(e,t,n,r=[0,1,2,3,4,5,6],i=void 0,a=void 0,o=[],s=[],c=42,l=0){let u=j(e),d=j(t),f=[],p=V(e),m=0,h=m===d;if(d<u)return f;for(;(!h||f.length<l)&&f.length<c&&(m=j(p),h||=m>d&&f.length>=l,!h);){if(!r.includes(Number(p.weekday))){p=G(p,k);continue}let e=V(p);e=B(e),e=z(e,n),e=$e(e,i,a,o,s),f.push(e),p=G(p,k)}return f}function ut(e,t,n,r,i){let a=[];for(let o=0;o<r;++o){let r=(t+o)*n;a.push(Ke(e,r,i))}return a}function dt(e,t,n){return typeof Intl>`u`||Intl.DateTimeFormat===void 0?()=>``:(r,i)=>{try{return new Intl.DateTimeFormat(e||void 0,t(r,i)).format(n(r))}catch(e){return console.error(`Intl.DateTimeFormat: ${e.message} -> ${W(r)}`),``}}}function ft(e,t){return dt(e,t,vt)}function pt(e,t){return dt(e,t,bt)}function mt(e,t,n){return dt(t,(t,r)=>{let i=n(t,r),a=i.timeZone===void 0?{...i,timeZone:`UTC`}:i;return e.intlCalendar===void 0||a.calendar!==void 0?a:{...a,calendar:e.intlCalendar}},t=>yt(t,e))}function ht(e){return new Date(e.year,e.month-1,e.day,0,0)}function gt(e){return new Date(Date.UTC(e.year,e.month-1,e.day,0,0))}function _t(e,t=c){let n=c.fromEpochDay(M(e,t));return new Date(Date.UTC(n.year,n.month-1,n.day,0,0))}function vt(e){return new Date(e.year,e.month-1,e.day,e.hour,e.minute,e.second??0,e.millisecond??0)}function yt(e,t=c){let n=c.fromEpochDay(M(e,t));return new Date(Date.UTC(n.year,n.month-1,n.day,e.hour,e.minute,e.second??0,e.millisecond??0))}function bt(e){return new Date(Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second??0,e.millisecond??0))}function q(e){return bt(e).getTime()}function xt(e){return Math.floor(q(e)/y)}function J(e){return de(new Date(e))}function St(e){return J(e*y)}function Ct(e){return vt(e)}function wt(e){return isFinite(Number(e))}function Tt(e,t=!1){let n=t===!0?We:j;return e.reduce((e,t)=>Math.max(n(e),n(t))===n(e)?e:t)}function Et(e,t=!1){let n=t===!0?We:j;return e.reduce((e,t)=>Math.min(n(e),n(t))===n(e)?e:t)}function Y(e,t){return t===!0?q(e):Oe(e)*x}function X(e,t,n){return Y(e,n)-Y(t,n)}function Dt(e,t){return Object.freeze({start:V(e),end:V(t)})}function Ot(e,t,n){let r=n?1:x;return Y(t.start,n)<=Y(e.end,n)+r}function kt(e,t,n){return n===!0?J(q(e)+t):Lt(e,{day:t})}function Z(e,t,n=!1){return X(e,t,n)<=0?Dt(e,t):Dt(t,e)}function At(e,t,n=!1){return Q(e,t.start,t.end,n)}function jt(e,t,n=!1){let r=Z(e.start,e.end,n),i=Z(t.start,t.end,n);return Y(r.start,n)<=Y(i.end,n)&&Y(i.start,n)<=Y(r.end,n)}function Mt(e,t,n=!1){return jt(e,t,n)===!1?null:Z(X(e.start,t.start,n)>=0?e.start:t.start,X(e.end,t.end,n)<=0?e.end:t.end,n)}function Nt(e,t=!1){let n=e.map(e=>Z(e.start,e.end,t)).sort((e,n)=>X(e.start,n.start,t)),r=[];for(let e of n){let n=r[r.length-1];if(n===void 0||Ot(n,e,t)===!1){r.push(e);continue}let i=X(n.end,e.end,t)>=0?n.end:e.end;r[r.length-1]=Dt(n.start,i)}return r}function Pt(e,t,n=!1){let r=Z(e.start,e.end,n),i=Nt(t,n),a=[r];for(let e of i){let t=[];for(let r of a){let i=Mt(r,e,n);if(i===null){t.push(r);continue}X(r.start,i.start,n)<0&&t.push(Z(r.start,kt(i.start,-1,n),n)),X(i.end,r.end,n)<0&&t.push(Z(kt(i.end,1,n),r.end,n))}a=t}return a}function Ft(e,t,n=!1){return Pt(e,t,n)}function Q(e,t,n,r=!1){let i=j(e)+(r===!0?L(e):0),a=j(t)+(r===!0?L(t):0),o=j(n)+(r===!0?L(n):0);return i>=a&&i<=o}function It(e,t,n,r){let i=j(e),a=j(t),o=j(n),s=j(r);return i>=o&&i<=s||a>=o&&a<=s||o>=i&&a>=s}function Lt(e,t){let n=C(e);return t.year&&(n.year+=t.year),t.month&&(n.month+=t.month),t.day&&(n.day+=t.day),t.hour&&(n.hour+=t.hour),t.minute&&(n.minute+=t.minute),t.second&&(n.second=(n.second??0)+t.second),t.millisecond&&(n.millisecond=(n.millisecond??0)+t.millisecond),B($(n))}function Rt(e,t){let n=C(e);if(t.year||t.month){let e=zt(n.year+(t.year??0),n.month+(t.month??0));n.year=e.year,n.month=e.month,n.day=Math.min(n.day,O(n.year,n.month))}return t.day&&(n.day+=t.day),t.hour&&(n.hour+=t.hour),t.minute&&(n.minute+=t.minute),t.second&&(n.second=(n.second??0)+t.second),t.millisecond&&(n.millisecond=(n.millisecond??0)+t.millisecond),B($(n))}function zt(e,t){let n=new Date(e,t-1,1);return{year:n.getFullYear(),month:n.getMonth()+1}}function $(e){let t=new Date(e.year,e.month-1,e.day,e.hour,e.minute,e.second??0,e.millisecond??0),n={...e,year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes()};return(e.second!==void 0||t.getSeconds()!==0)&&(n.second=t.getSeconds()),(e.millisecond!==void 0||t.getMilliseconds()!==0)&&(n.millisecond=t.getMilliseconds()),S(n)}function Bt(e,t){let n=Ge(e,t,!0);return Math.floor(n/m.MILLISECONDS_IN.DAY)}function Vt(e,t){let n=V(e),r=V(t);return n=K(n,0),r=K(r,6),Math.ceil(Bt(n,r)/m.DAYS_IN.WEEK)}function Ht(e){let t=e===0?0:e<0?-1:1,n=Math.abs(e),r=Math.floor(n/x);n-=r*x;let i=Math.floor(n/b);n-=i*b;let a=Math.floor(n/v);n-=a*v;let o=Math.floor(n/y);return n-=o*y,Object.freeze({totalMilliseconds:e,absoluteMilliseconds:Math.abs(e),sign:t,days:r,hours:i,minutes:a,seconds:o,milliseconds:n})}function Ut(e,t){return Ht(q(t)-q(e))}function Wt(e,t){let n=typeof t==`number`?t:t.totalMilliseconds;return J(q(e)+n)}function Gt(e,t){return Wt(e,-(typeof t==`number`?t:t.totalMilliseconds))}function Kt(e,t={}){let n=typeof e==`number`?Ht(e):e,r=n.days*_+n.hours,i=`${t.signed===!0&&n.sign<0?`-`:``}${D(r,2)}:${D(n.minutes,2)}:${D(n.seconds,2)}`;return t.milliseconds===!0&&(i+=`.${D(n.milliseconds,3)}`),i}function qt(e,t,n){if(t<=0||Number.isFinite(t)===!1)return V(e);let r=t*v;return J(n(q(e)/r)*r)}function Jt(e,t){return qt(e,t,Math.floor)}function Yt(e,t){return qt(e,t,Math.ceil)}function Xt(e,t){return qt(e,t,Math.round)}let Zt={Sun:new Date(`2020-01-05T00:00:00.000Z`),Mon:new Date(`2020-01-06T00:00:00.000Z`),Tue:new Date(`2020-01-07T00:00:00.000Z`),Wed:new Date(`2020-01-08T00:00:00.000Z`),Thu:new Date(`2020-01-09T00:00:00.000Z`),Fri:new Date(`2020-01-10T00:00:00.000Z`),Sat:new Date(`2020-01-11T00:00:00.000Z`)};function Qt(e,t){return t===`long`||t===`short`||t===`narrow`?e[t]:e.long}function $t(){let e=()=>``,t={long:{timeZone:`UTC`,weekday:`long`},short:{timeZone:`UTC`,weekday:`short`},narrow:{timeZone:`UTC`,weekday:`narrow`}};if(typeof Intl>`u`||Intl.DateTimeFormat===void 0)return e;function n(e,n,r){try{return new Intl.DateTimeFormat(r||void 0,Qt(t,n)).format(Zt[e])}catch(t){return t instanceof Error&&console.error(`Intl.DateTimeFormat: ${t.message} -> day of week: ${e}`),``}}return n}function en(e,t){let n=Object.keys(Zt),r=$t();return n.map(n=>String(r(n,e,t)))}function tn(){let e=()=>``,t={long:{timeZone:`UTC`,month:`long`},short:{timeZone:`UTC`,month:`short`},narrow:{timeZone:`UTC`,month:`narrow`}};if(typeof Intl>`u`||Intl.DateTimeFormat===void 0)return e;function n(e,n=`long`,r){try{let i=new Intl.DateTimeFormat(r||void 0,Qt(t,n)),a=new Date;return a.setDate(1),a.setMonth(e),i.format(a)}catch(t){return t instanceof Error&&console.error(`Intl.DateTimeFormat: ${t.message} -> month: ${e}`),``}}return n}function nn(e,t){let n=tn();return[...Array(12).keys()].map(r=>n(r,e,t))}return e.DAYS_IN_MONTH=f,e.DAYS_IN_MONTH_LEAP=p,e.DAYS_IN_MONTH_MAX=31,e.DAYS_IN_MONTH_MIN=28,e.DAYS_IN_WEEK=h,e.DAY_MIN=1,e.FIRST_HOUR=0,e.HOURS_IN_DAY=_,e.MILLISECONDS_IN_DAY=x,e.MILLISECONDS_IN_HOUR=b,e.MILLISECONDS_IN_MINUTE=v,e.MILLISECONDS_IN_SECOND=y,e.MILLISECONDS_IN_WEEK=ee,e.MINUTES_IN_HOUR=g,e.MONTH_MAX=12,e.MONTH_MIN=1,e.PARSE_DATE=u,e.PARSE_DATETIME=l,e.PARSE_TIME=d,e.SECONDS_IN_DAY=re,e.SECONDS_IN_HOUR=ne,e.SECONDS_IN_MINUTE=te,e.TIME_CONSTANTS=m,e.TimeObject=ae,e.Timestamp=ie,e.addCalendarDays=Ne,e.addCalendarMonths=Pe,e.addCalendarYears=Fe,e.addDuration=Wt,e.addToDate=Lt,e.addToDateClamped=Rt,e.ceilToInterval=Yt,e.compareDate=Te,e.compareDateTime=De,e.compareTime=Ee,e.compareTimestamps=we,e.copyTimestamp=V,e.createCalendarDayList=Ue,e.createCalendarLocaleFormatterUTC=mt,e.createCalendarTimestamp=N,e.createCalendarTimestampFromEpochDay=je,e.createDayList=lt,e.createDuration=Ht,e.createIntervalList=ut,e.createNativeLocaleFormatter=ft,e.createNativeLocaleFormatterUTC=pt,e.createTimestampRange=Z,e.daysBetween=Bt,e.daysInMonth=O,e.diffTimestamp=Ge,e.durationBetween=Ut,e.findCalendarWeekday=Be,e.findRangeGaps=Ft,e.findWeekday=K,e.floorToInterval=Jt,e.formatCalendarDate=a,e.formatDuration=Kt,e.fromUnixMilliseconds=J,e.fromUnixSeconds=St,e.getCalendarDayIdentifier=M,e.getCalendarEndOfMonth=Le,e.getCalendarEndOfWeek=He,e.getCalendarEndOfYear=ze,e.getCalendarStartOfMonth=Ie,e.getCalendarStartOfWeek=Ve,e.getCalendarStartOfYear=Re,e.getDate=H,e.getDateObject=Ct,e.getDateTime=W,e.getDayIdentifier=j,e.getDayOfYear=et,e.getDayTimeIdentifier=We,e.getEndOfDay=at,e.getEndOfMonth=Se,e.getEndOfWeek=be,e.getEndOfYear=st,e.getEpochDay=Oe,e.getMonthFormatter=tn,e.getMonthNames=nn,e.getStartOfDay=it,e.getStartOfMonth=xe,e.getStartOfWeek=ye,e.getStartOfYear=ot,e.getTime=U,e.getTimeIdentifier=L,e.getWeekday=nt,e.getWeekdayFormatter=$t,e.getWeekdayNames=en,e.getWorkWeek=tt,e.gregorianCalendar=c,e.intersectRanges=Mt,e.isBetweenDates=Q,e.isLeapYear=fe,e.isOverlappingDates=It,e.isRangeOverlapping=jt,e.isTimestampInRange=At,e.isToday=_e,e.isTodayUTC=ve,e.isValidCalendarDate=ke,e.makeCalendarDateTimeUTC=yt,e.makeCalendarDateUTC=_t,e.makeDate=ht,e.makeDateTime=vt,e.makeDateTimeUTC=bt,e.makeDateUTC=gt,e.maxTimestamp=Tt,e.mergeRanges=Nt,e.minTimestamp=Et,e.moveRelativeDays=ct,e.nextCalendarDay=I,e.nextDay=k,e.nowUTC=ge,e.padNumber=D,e.parseCalendarTimestamp=Ae,e.parseDate=ue,e.parseDateUTC=de,e.parseTime=Ce,e.parseTimestamp=A,e.parsed=E,e.prevCalendarDay=Me,e.prevDay=pe,e.relativeDays=G,e.roundToInterval=Xt,e.subtractDuration=Gt,e.subtractRanges=Pt,e.toCalendarDateParts=w,e.toUnixMilliseconds=q,e.toUnixSeconds=xt,e.today=me,e.todayUTC=he,e.updateCalendarFormatted=P,e.updateCalendarRelative=F,e.updateDayOfYear=Je,e.updateDisabled=$e,e.updateFormatted=B,e.updateMinutes=Ke,e.updateRelative=z,e.updateWeekday=qe,e.updateWorkWeek=Ye,e.validateNumber=wt,e.validateTimestamp=ce,e.weeksBetween=Vt,e})({});
|