mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2025-04-05 19:42:07 +08:00
2 lines
51 KiB
JavaScript
2 lines
51 KiB
JavaScript
var Oe=Object.defineProperty;var Ye=(n,r,e)=>r in n?Oe(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e;var o=(n,r,e)=>Ye(n,typeof r!="symbol"?r+"":r,e);function Q(n){return(r={})=>{const e=r.width?String(r.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}function W(n){return(r,e)=>{const t=e!=null&&e.context?String(e.context):"standalone";let a;if(t==="formatting"&&n.formattingValues){const i=n.defaultFormattingWidth||n.defaultWidth,c=e!=null&&e.width?String(e.width):i;a=n.formattingValues[c]||n.formattingValues[i]}else{const i=n.defaultWidth,c=e!=null&&e.width?String(e.width):n.defaultWidth;a=n.values[c]||n.values[i]}const s=n.argumentCallback?n.argumentCallback(r):r;return a[s]}}function v(n){return(r,e={})=>{const t=e.width,a=t&&n.matchPatterns[t]||n.matchPatterns[n.defaultMatchWidth],s=r.match(a);if(!s)return null;const i=s[0],c=t&&n.parsePatterns[t]||n.parsePatterns[n.defaultParseWidth],h=Array.isArray(c)?ve(c,D=>D.test(i)):We(c,D=>D.test(i));let w;w=n.valueCallback?n.valueCallback(h):h,w=e.valueCallback?e.valueCallback(w):w;const P=r.slice(i.length);return{value:w,rest:P}}}function We(n,r){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&r(n[e]))return e}function ve(n,r){for(let e=0;e<n.length;e++)if(r(n[e]))return e}function de(n){return(r,e={})=>{const t=r.match(n.matchPattern);if(!t)return null;const a=t[0],s=r.match(n.parsePattern);if(!s)return null;let i=n.valueCallback?n.valueCallback(s[0]):s[0];i=e.valueCallback?e.valueCallback(i):i;const c=r.slice(a.length);return{value:i,rest:c}}}function u(n){const r=Object.prototype.toString.call(n);return n instanceof Date||typeof n=="object"&&r==="[object Date]"?new n.constructor(+n):typeof n=="number"||r==="[object Number]"||typeof n=="string"||r==="[object String]"?new Date(n):new Date(NaN)}let _e={};function R(){return _e}function E(n,r){var c,h,w,P;const e=R(),t=(r==null?void 0:r.weekStartsOn)??((h=(c=r==null?void 0:r.locale)==null?void 0:c.options)==null?void 0:h.weekStartsOn)??e.weekStartsOn??((P=(w=e.locale)==null?void 0:w.options)==null?void 0:P.weekStartsOn)??0,a=u(n),s=a.getDay(),i=(s<t?7:0)+s-t;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function Ne(n,r,e){const t=E(n,e),a=E(r,e);return+t==+a}const Ee={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},qe=(n,r,e)=>{let t;const a=Ee[n];return typeof a=="string"?t=a:r===1?t=a.one:t=a.other.replace("{{count}}",r.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+t:t+" ago":t},He={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Fe=(n,r,e,t)=>He[n],Le={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ce={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Qe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Ie={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Re={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},$e={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Xe=(n,r)=>{const e=Number(n),t=e%100;if(t>20||t<10)switch(t%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},Ge={ordinalNumber:Xe,era:W({values:Le,defaultWidth:"wide"}),quarter:W({values:Ce,defaultWidth:"wide",argumentCallback:n=>n-1}),month:W({values:Qe,defaultWidth:"wide"}),day:W({values:Ie,defaultWidth:"wide"}),dayPeriod:W({values:Re,defaultWidth:"wide",formattingValues:$e,defaultFormattingWidth:"wide"})},Be=/^(\d+)(th|st|nd|rd)?/i,Ae=/\d+/i,Ve={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},je={any:[/^b/i,/^(a|c)/i]},ze={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Je={any:[/1/i,/2/i,/3/i,/4/i]},Ke={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Ze={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Se={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Ue={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},et={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},tt={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},nt={ordinalNumber:de({matchPattern:Be,parsePattern:Ae,valueCallback:n=>parseInt(n,10)}),era:v({matchPatterns:Ve,defaultMatchWidth:"wide",parsePatterns:je,defaultParseWidth:"any"}),quarter:v({matchPatterns:ze,defaultMatchWidth:"wide",parsePatterns:Je,defaultParseWidth:"any",valueCallback:n=>n+1}),month:v({matchPatterns:Ke,defaultMatchWidth:"wide",parsePatterns:Ze,defaultParseWidth:"any"}),day:v({matchPatterns:Se,defaultMatchWidth:"wide",parsePatterns:Ue,defaultParseWidth:"any"}),dayPeriod:v({matchPatterns:et,defaultMatchWidth:"any",parsePatterns:tt,defaultParseWidth:"any"})},rt={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},at={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},st={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ot={date:Q({formats:rt,defaultWidth:"full"}),time:Q({formats:at,defaultWidth:"full"}),dateTime:Q({formats:st,defaultWidth:"full"})},le={code:"en-US",formatDistance:qe,formatLong:ot,formatRelative:Fe,localize:Ge,match:nt,options:{weekStartsOn:0,firstWeekContainsDate:1}},it={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},ut=(n,r,e)=>{let t;const a=it[n];return typeof a=="string"?t=a:r===1?t=a.one:t=a.other.replace("{{count}}",String(r)),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?t+"内":t+"前":t},ct={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},dt={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},lt={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},ft={date:Q({formats:ct,defaultWidth:"full"}),time:Q({formats:dt,defaultWidth:"full"}),dateTime:Q({formats:lt,defaultWidth:"full"})};function ae(n,r,e){const t="eeee p";return Ne(n,r,e)?t:n.getTime()>r.getTime()?"'下个'"+t:"'上个'"+t}const ht={lastWeek:ae,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:ae,other:"PP p"},mt=(n,r,e,t)=>{const a=ht[n];return typeof a=="function"?a(r,e,t):a},wt={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},gt={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},yt={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},bt={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},xt={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},Mt={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},Pt=(n,r)=>{const e=Number(n);switch(r==null?void 0:r.unit){case"date":return e.toString()+"日";case"hour":return e.toString()+"时";case"minute":return e.toString()+"分";case"second":return e.toString()+"秒";default:return"第 "+e.toString()}},pt={ordinalNumber:Pt,era:W({values:wt,defaultWidth:"wide"}),quarter:W({values:gt,defaultWidth:"wide",argumentCallback:n=>n-1}),month:W({values:yt,defaultWidth:"wide"}),day:W({values:bt,defaultWidth:"wide"}),dayPeriod:W({values:xt,defaultWidth:"wide",formattingValues:Mt,defaultFormattingWidth:"wide"})},Dt=/^(第\s*)?\d+(日|时|分|秒)?/i,kt=/\d+/i,Tt={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},Ot={any:[/^(前)/i,/^(公元)/i]},Yt={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},Wt={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},vt={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},_t={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},Nt={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},Et={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},qt={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},Ht={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},Ft={ordinalNumber:de({matchPattern:Dt,parsePattern:kt,valueCallback:n=>parseInt(n,10)}),era:v({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:Ot,defaultParseWidth:"any"}),quarter:v({matchPatterns:Yt,defaultMatchWidth:"wide",parsePatterns:Wt,defaultParseWidth:"any",valueCallback:n=>n+1}),month:v({matchPatterns:vt,defaultMatchWidth:"wide",parsePatterns:_t,defaultParseWidth:"any"}),day:v({matchPatterns:Nt,defaultMatchWidth:"wide",parsePatterns:Et,defaultParseWidth:"any"}),dayPeriod:v({matchPatterns:qt,defaultMatchWidth:"any",parsePatterns:Ht,defaultParseWidth:"any"})},rr={code:"zh-CN",formatDistance:ut,formatLong:ft,formatRelative:mt,localize:pt,match:Ft,options:{weekStartsOn:1,firstWeekContainsDate:4}};function m(n,r){return n instanceof Date?new n.constructor(r):new Date(r)}function fe(n,r){const e=u(n);return isNaN(r)?m(n,NaN):(r&&e.setDate(e.getDate()+r),e)}function he(n,r){const e=u(n);if(isNaN(r))return m(n,NaN);if(!r)return e;const t=e.getDate(),a=m(n,e.getTime());a.setMonth(e.getMonth()+r+1,0);const s=a.getDate();return t>=s?a:(e.setFullYear(a.getFullYear(),a.getMonth(),t),e)}const me=6048e5,Lt=864e5,Ct=6e4,Qt=36e5,It=1e3;function I(n){return E(n,{weekStartsOn:1})}function we(n){const r=u(n),e=r.getFullYear(),t=m(n,0);t.setFullYear(e+1,0,4),t.setHours(0,0,0,0);const a=I(t),s=m(n,0);s.setFullYear(e,0,4),s.setHours(0,0,0,0);const i=I(s);return r.getTime()>=a.getTime()?e+1:r.getTime()>=i.getTime()?e:e-1}function B(n){const r=u(n);return r.setHours(0,0,0,0),r}function A(n){const r=u(n),e=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return e.setUTCFullYear(r.getFullYear()),+n-+e}function Rt(n,r){const e=B(n),t=B(r),a=+e-A(e),s=+t-A(t);return Math.round((a-s)/Lt)}function $t(n){const r=we(n),e=m(n,0);return e.setFullYear(r,0,4),e.setHours(0,0,0,0),I(e)}function ar(n,r){const e=r*3;return he(n,e)}function sr(n,r){return he(n,r*12)}function or(n,r){const e=B(n),t=B(r);return+e==+t}function Xt(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Gt(n){if(!Xt(n)&&typeof n!="number")return!1;const r=u(n);return!isNaN(Number(r))}function ir(n){const r=u(n);return Math.trunc(r.getMonth()/3)+1}function ur(n){const r=u(n);return r.setSeconds(0,0),r}function se(n){const r=u(n),e=r.getMonth(),t=e-e%3;return r.setMonth(t,1),r.setHours(0,0,0,0),r}function cr(n){const r=u(n);return r.setDate(1),r.setHours(0,0,0,0),r}function Bt(n){const r=u(n),e=m(n,0);return e.setFullYear(r.getFullYear(),0,1),e.setHours(0,0,0,0),e}function At(n){const r=u(n);return Rt(r,Bt(r))+1}function ge(n){const r=u(n),e=+I(r)-+$t(r);return Math.round(e/me)+1}function K(n,r){var P,D,O,T;const e=u(n),t=e.getFullYear(),a=R(),s=(r==null?void 0:r.firstWeekContainsDate)??((D=(P=r==null?void 0:r.locale)==null?void 0:P.options)==null?void 0:D.firstWeekContainsDate)??a.firstWeekContainsDate??((T=(O=a.locale)==null?void 0:O.options)==null?void 0:T.firstWeekContainsDate)??1,i=m(n,0);i.setFullYear(t+1,0,s),i.setHours(0,0,0,0);const c=E(i,r),h=m(n,0);h.setFullYear(t,0,s),h.setHours(0,0,0,0);const w=E(h,r);return e.getTime()>=c.getTime()?t+1:e.getTime()>=w.getTime()?t:t-1}function Vt(n,r){var c,h,w,P;const e=R(),t=(r==null?void 0:r.firstWeekContainsDate)??((h=(c=r==null?void 0:r.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??e.firstWeekContainsDate??((P=(w=e.locale)==null?void 0:w.options)==null?void 0:P.firstWeekContainsDate)??1,a=K(n,r),s=m(n,0);return s.setFullYear(a,0,t),s.setHours(0,0,0,0),E(s,r)}function ye(n,r){const e=u(n),t=+E(e,r)-+Vt(e,r);return Math.round(t/me)+1}function f(n,r){const e=n<0?"-":"",t=Math.abs(n).toString().padStart(r,"0");return e+t}const H={y(n,r){const e=n.getFullYear(),t=e>0?e:1-e;return f(r==="yy"?t%100:t,r.length)},M(n,r){const e=n.getMonth();return r==="M"?String(e+1):f(e+1,2)},d(n,r){return f(n.getDate(),r.length)},a(n,r){const e=n.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,r){return f(n.getHours()%12||12,r.length)},H(n,r){return f(n.getHours(),r.length)},m(n,r){return f(n.getMinutes(),r.length)},s(n,r){return f(n.getSeconds(),r.length)},S(n,r){const e=r.length,t=n.getMilliseconds(),a=Math.trunc(t*Math.pow(10,e-3));return f(a,r.length)}},C={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},oe={G:function(n,r,e){const t=n.getFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return e.era(t,{width:"abbreviated"});case"GGGGG":return e.era(t,{width:"narrow"});case"GGGG":default:return e.era(t,{width:"wide"})}},y:function(n,r,e){if(r==="yo"){const t=n.getFullYear(),a=t>0?t:1-t;return e.ordinalNumber(a,{unit:"year"})}return H.y(n,r)},Y:function(n,r,e,t){const a=K(n,t),s=a>0?a:1-a;if(r==="YY"){const i=s%100;return f(i,2)}return r==="Yo"?e.ordinalNumber(s,{unit:"year"}):f(s,r.length)},R:function(n,r){const e=we(n);return f(e,r.length)},u:function(n,r){const e=n.getFullYear();return f(e,r.length)},Q:function(n,r,e){const t=Math.ceil((n.getMonth()+1)/3);switch(r){case"Q":return String(t);case"QQ":return f(t,2);case"Qo":return e.ordinalNumber(t,{unit:"quarter"});case"QQQ":return e.quarter(t,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(t,{width:"wide",context:"formatting"})}},q:function(n,r,e){const t=Math.ceil((n.getMonth()+1)/3);switch(r){case"q":return String(t);case"qq":return f(t,2);case"qo":return e.ordinalNumber(t,{unit:"quarter"});case"qqq":return e.quarter(t,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(t,{width:"wide",context:"standalone"})}},M:function(n,r,e){const t=n.getMonth();switch(r){case"M":case"MM":return H.M(n,r);case"Mo":return e.ordinalNumber(t+1,{unit:"month"});case"MMM":return e.month(t,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(t,{width:"wide",context:"formatting"})}},L:function(n,r,e){const t=n.getMonth();switch(r){case"L":return String(t+1);case"LL":return f(t+1,2);case"Lo":return e.ordinalNumber(t+1,{unit:"month"});case"LLL":return e.month(t,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(t,{width:"wide",context:"standalone"})}},w:function(n,r,e,t){const a=ye(n,t);return r==="wo"?e.ordinalNumber(a,{unit:"week"}):f(a,r.length)},I:function(n,r,e){const t=ge(n);return r==="Io"?e.ordinalNumber(t,{unit:"week"}):f(t,r.length)},d:function(n,r,e){return r==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):H.d(n,r)},D:function(n,r,e){const t=At(n);return r==="Do"?e.ordinalNumber(t,{unit:"dayOfYear"}):f(t,r.length)},E:function(n,r,e){const t=n.getDay();switch(r){case"E":case"EE":case"EEE":return e.day(t,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(t,{width:"short",context:"formatting"});case"EEEE":default:return e.day(t,{width:"wide",context:"formatting"})}},e:function(n,r,e,t){const a=n.getDay(),s=(a-t.weekStartsOn+8)%7||7;switch(r){case"e":return String(s);case"ee":return f(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(a,{width:"short",context:"formatting"});case"eeee":default:return e.day(a,{width:"wide",context:"formatting"})}},c:function(n,r,e,t){const a=n.getDay(),s=(a-t.weekStartsOn+8)%7||7;switch(r){case"c":return String(s);case"cc":return f(s,r.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(a,{width:"narrow",context:"standalone"});case"cccccc":return e.day(a,{width:"short",context:"standalone"});case"cccc":default:return e.day(a,{width:"wide",context:"standalone"})}},i:function(n,r,e){const t=n.getDay(),a=t===0?7:t;switch(r){case"i":return String(a);case"ii":return f(a,r.length);case"io":return e.ordinalNumber(a,{unit:"day"});case"iii":return e.day(t,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(t,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(t,{width:"short",context:"formatting"});case"iiii":default:return e.day(t,{width:"wide",context:"formatting"})}},a:function(n,r,e){const a=n.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(n,r,e){const t=n.getHours();let a;switch(t===12?a=C.noon:t===0?a=C.midnight:a=t/12>=1?"pm":"am",r){case"b":case"bb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(n,r,e){const t=n.getHours();let a;switch(t>=17?a=C.evening:t>=12?a=C.afternoon:t>=4?a=C.morning:a=C.night,r){case"B":case"BB":case"BBB":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(n,r,e){if(r==="ho"){let t=n.getHours()%12;return t===0&&(t=12),e.ordinalNumber(t,{unit:"hour"})}return H.h(n,r)},H:function(n,r,e){return r==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):H.H(n,r)},K:function(n,r,e){const t=n.getHours()%12;return r==="Ko"?e.ordinalNumber(t,{unit:"hour"}):f(t,r.length)},k:function(n,r,e){let t=n.getHours();return t===0&&(t=24),r==="ko"?e.ordinalNumber(t,{unit:"hour"}):f(t,r.length)},m:function(n,r,e){return r==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):H.m(n,r)},s:function(n,r,e){return r==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):H.s(n,r)},S:function(n,r){return H.S(n,r)},X:function(n,r,e){const t=n.getTimezoneOffset();if(t===0)return"Z";switch(r){case"X":return ue(t);case"XXXX":case"XX":return F(t);case"XXXXX":case"XXX":default:return F(t,":")}},x:function(n,r,e){const t=n.getTimezoneOffset();switch(r){case"x":return ue(t);case"xxxx":case"xx":return F(t);case"xxxxx":case"xxx":default:return F(t,":")}},O:function(n,r,e){const t=n.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+ie(t,":");case"OOOO":default:return"GMT"+F(t,":")}},z:function(n,r,e){const t=n.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+ie(t,":");case"zzzz":default:return"GMT"+F(t,":")}},t:function(n,r,e){const t=Math.trunc(n.getTime()/1e3);return f(t,r.length)},T:function(n,r,e){const t=n.getTime();return f(t,r.length)}};function ie(n,r=""){const e=n>0?"-":"+",t=Math.abs(n),a=Math.trunc(t/60),s=t%60;return s===0?e+String(a):e+String(a)+r+f(s,2)}function ue(n,r){return n%60===0?(n>0?"-":"+")+f(Math.abs(n)/60,2):F(n,r)}function F(n,r=""){const e=n>0?"-":"+",t=Math.abs(n),a=f(Math.trunc(t/60),2),s=f(t%60,2);return e+a+r+s}const ce=(n,r)=>{switch(n){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},be=(n,r)=>{switch(n){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},jt=(n,r)=>{const e=n.match(/(P+)(p+)?/)||[],t=e[1],a=e[2];if(!a)return ce(n,r);let s;switch(t){case"P":s=r.dateTime({width:"short"});break;case"PP":s=r.dateTime({width:"medium"});break;case"PPP":s=r.dateTime({width:"long"});break;case"PPPP":default:s=r.dateTime({width:"full"});break}return s.replace("{{date}}",ce(t,r)).replace("{{time}}",be(a,r))},z={p:be,P:jt},zt=/^D+$/,Jt=/^Y+$/,Kt=["D","DD","YY","YYYY"];function xe(n){return zt.test(n)}function Me(n){return Jt.test(n)}function J(n,r,e){const t=Zt(n,r,e);if(console.warn(t),Kt.includes(n))throw new RangeError(t)}function Zt(n,r,e){const t=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${r}\`) for formatting ${t} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const St=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ut=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,en=/^'([^]*?)'?$/,tn=/''/g,nn=/[a-zA-Z]/;function dr(n,r,e){var P,D,O,T,q,$,X,G;const t=R(),a=(e==null?void 0:e.locale)??t.locale??le,s=(e==null?void 0:e.firstWeekContainsDate)??((D=(P=e==null?void 0:e.locale)==null?void 0:P.options)==null?void 0:D.firstWeekContainsDate)??t.firstWeekContainsDate??((T=(O=t.locale)==null?void 0:O.options)==null?void 0:T.firstWeekContainsDate)??1,i=(e==null?void 0:e.weekStartsOn)??(($=(q=e==null?void 0:e.locale)==null?void 0:q.options)==null?void 0:$.weekStartsOn)??t.weekStartsOn??((G=(X=t.locale)==null?void 0:X.options)==null?void 0:G.weekStartsOn)??0,c=u(n);if(!Gt(c))throw new RangeError("Invalid time value");let h=r.match(Ut).map(k=>{const p=k[0];if(p==="p"||p==="P"){const L=z[p];return L(k,a.formatLong)}return k}).join("").match(St).map(k=>{if(k==="''")return{isToken:!1,value:"'"};const p=k[0];if(p==="'")return{isToken:!1,value:rn(k)};if(oe[p])return{isToken:!0,value:k};if(p.match(nn))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:k}});a.localize.preprocessor&&(h=a.localize.preprocessor(c,h));const w={firstWeekContainsDate:s,weekStartsOn:i,locale:a};return h.map(k=>{if(!k.isToken)return k.value;const p=k.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&Me(p)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&xe(p))&&J(p,r,String(n));const L=oe[p[0]];return L(c,p,a.localize,w)}).join("")}function rn(n){const r=n.match(en);return r?r[1].replace(tn,"'"):n}function lr(n){return u(n).getDate()}function fr(n){return u(n).getDay()}function an(n){const r=u(n),e=r.getFullYear(),t=r.getMonth(),a=m(n,0);return a.setFullYear(e,t+1,0),a.setHours(0,0,0,0),a.getDate()}function sn(){return Object.assign({},R())}function hr(n){return u(n).getHours()}function on(n){let e=u(n).getDay();return e===0&&(e=7),e}function mr(n){return u(n).getMilliseconds()}function wr(n){return u(n).getMinutes()}function gr(n){return u(n).getMonth()}function yr(n){return u(n).getSeconds()}function br(n){return u(n).getTime()}function xr(n){return u(n).getFullYear()}function un(n,r){const e=r instanceof Date?m(r,0):new r(0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}const cn=10;class Pe{constructor(){o(this,"subPriority",0)}validate(r,e){return!0}}class dn extends Pe{constructor(r,e,t,a,s){super(),this.value=r,this.validateValue=e,this.setValue=t,this.priority=a,s&&(this.subPriority=s)}validate(r,e){return this.validateValue(r,this.value,e)}set(r,e,t){return this.setValue(r,e,this.value,t)}}class ln extends Pe{constructor(){super(...arguments);o(this,"priority",cn);o(this,"subPriority",-1)}set(e,t){return t.timestampIsSet?e:m(e,un(e,Date))}}class l{run(r,e,t,a){const s=this.parse(r,e,t,a);return s?{setter:new dn(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(r,e,t){return!0}}class fn extends l{constructor(){super(...arguments);o(this,"priority",140);o(this,"incompatibleTokens",["R","u","t","T"])}parse(e,t,a){switch(t){case"G":case"GG":case"GGG":return a.era(e,{width:"abbreviated"})||a.era(e,{width:"narrow"});case"GGGGG":return a.era(e,{width:"narrow"});case"GGGG":default:return a.era(e,{width:"wide"})||a.era(e,{width:"abbreviated"})||a.era(e,{width:"narrow"})}}set(e,t,a){return t.era=a,e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}}const x={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},_={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function M(n,r){return n&&{value:r(n.value),rest:n.rest}}function g(n,r){const e=r.match(n);return e?{value:parseInt(e[0],10),rest:r.slice(e[0].length)}:null}function N(n,r){const e=r.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:r.slice(1)};const t=e[1]==="+"?1:-1,a=e[2]?parseInt(e[2],10):0,s=e[3]?parseInt(e[3],10):0,i=e[5]?parseInt(e[5],10):0;return{value:t*(a*Qt+s*Ct+i*It),rest:r.slice(e[0].length)}}function pe(n){return g(x.anyDigitsSigned,n)}function b(n,r){switch(n){case 1:return g(x.singleDigit,r);case 2:return g(x.twoDigits,r);case 3:return g(x.threeDigits,r);case 4:return g(x.fourDigits,r);default:return g(new RegExp("^\\d{1,"+n+"}"),r)}}function V(n,r){switch(n){case 1:return g(x.singleDigitSigned,r);case 2:return g(x.twoDigitsSigned,r);case 3:return g(x.threeDigitsSigned,r);case 4:return g(x.fourDigitsSigned,r);default:return g(new RegExp("^-?\\d{1,"+n+"}"),r)}}function Z(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function De(n,r){const e=r>0,t=e?r:1-r;let a;if(t<=50)a=n||100;else{const s=t+50,i=Math.trunc(s/100)*100,c=n>=s%100;a=n+i-(c?100:0)}return e?a:1-a}function ke(n){return n%400===0||n%4===0&&n%100!==0}class hn extends l{constructor(){super(...arguments);o(this,"priority",130);o(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,t,a){const s=i=>({year:i,isTwoDigitYear:t==="yy"});switch(t){case"y":return M(b(4,e),s);case"yo":return M(a.ordinalNumber(e,{unit:"year"}),s);default:return M(b(t.length,e),s)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,a){const s=e.getFullYear();if(a.isTwoDigitYear){const c=De(a.year,s);return e.setFullYear(c,0,1),e.setHours(0,0,0,0),e}const i=!("era"in t)||t.era===1?a.year:1-a.year;return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}}class mn extends l{constructor(){super(...arguments);o(this,"priority",130);o(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,t,a){const s=i=>({year:i,isTwoDigitYear:t==="YY"});switch(t){case"Y":return M(b(4,e),s);case"Yo":return M(a.ordinalNumber(e,{unit:"year"}),s);default:return M(b(t.length,e),s)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,a,s){const i=K(e,s);if(a.isTwoDigitYear){const h=De(a.year,i);return e.setFullYear(h,0,s.firstWeekContainsDate),e.setHours(0,0,0,0),E(e,s)}const c=!("era"in t)||t.era===1?a.year:1-a.year;return e.setFullYear(c,0,s.firstWeekContainsDate),e.setHours(0,0,0,0),E(e,s)}}class wn extends l{constructor(){super(...arguments);o(this,"priority",130);o(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,t){return V(t==="R"?4:t.length,e)}set(e,t,a){const s=m(e,0);return s.setFullYear(a,0,4),s.setHours(0,0,0,0),I(s)}}class gn extends l{constructor(){super(...arguments);o(this,"priority",130);o(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,t){return V(t==="u"?4:t.length,e)}set(e,t,a){return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}}class yn extends l{constructor(){super(...arguments);o(this,"priority",120);o(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,t,a){switch(t){case"Q":case"QQ":return b(t.length,e);case"Qo":return a.ordinalNumber(e,{unit:"quarter"});case"QQQ":return a.quarter(e,{width:"abbreviated",context:"formatting"})||a.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return a.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(e,{width:"wide",context:"formatting"})||a.quarter(e,{width:"abbreviated",context:"formatting"})||a.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=1&&t<=4}set(e,t,a){return e.setMonth((a-1)*3,1),e.setHours(0,0,0,0),e}}class bn extends l{constructor(){super(...arguments);o(this,"priority",120);o(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,t,a){switch(t){case"q":case"qq":return b(t.length,e);case"qo":return a.ordinalNumber(e,{unit:"quarter"});case"qqq":return a.quarter(e,{width:"abbreviated",context:"standalone"})||a.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return a.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(e,{width:"wide",context:"standalone"})||a.quarter(e,{width:"abbreviated",context:"standalone"})||a.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=1&&t<=4}set(e,t,a){return e.setMonth((a-1)*3,1),e.setHours(0,0,0,0),e}}class xn extends l{constructor(){super(...arguments);o(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);o(this,"priority",110)}parse(e,t,a){const s=i=>i-1;switch(t){case"M":return M(g(x.month,e),s);case"MM":return M(b(2,e),s);case"Mo":return M(a.ordinalNumber(e,{unit:"month"}),s);case"MMM":return a.month(e,{width:"abbreviated",context:"formatting"})||a.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return a.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(e,{width:"wide",context:"formatting"})||a.month(e,{width:"abbreviated",context:"formatting"})||a.month(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=11}set(e,t,a){return e.setMonth(a,1),e.setHours(0,0,0,0),e}}class Mn extends l{constructor(){super(...arguments);o(this,"priority",110);o(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,t,a){const s=i=>i-1;switch(t){case"L":return M(g(x.month,e),s);case"LL":return M(b(2,e),s);case"Lo":return M(a.ordinalNumber(e,{unit:"month"}),s);case"LLL":return a.month(e,{width:"abbreviated",context:"standalone"})||a.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return a.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(e,{width:"wide",context:"standalone"})||a.month(e,{width:"abbreviated",context:"standalone"})||a.month(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=11}set(e,t,a){return e.setMonth(a,1),e.setHours(0,0,0,0),e}}function Pn(n,r,e){const t=u(n),a=ye(t,e)-r;return t.setDate(t.getDate()-a*7),t}class pn extends l{constructor(){super(...arguments);o(this,"priority",100);o(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,t,a){switch(t){case"w":return g(x.week,e);case"wo":return a.ordinalNumber(e,{unit:"week"});default:return b(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,a,s){return E(Pn(e,a,s),s)}}function Dn(n,r){const e=u(n),t=ge(e)-r;return e.setDate(e.getDate()-t*7),e}class kn extends l{constructor(){super(...arguments);o(this,"priority",100);o(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,t,a){switch(t){case"I":return g(x.week,e);case"Io":return a.ordinalNumber(e,{unit:"week"});default:return b(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,a){return I(Dn(e,a))}}const Tn=[31,28,31,30,31,30,31,31,30,31,30,31],On=[31,29,31,30,31,30,31,31,30,31,30,31];class Yn extends l{constructor(){super(...arguments);o(this,"priority",90);o(this,"subPriority",1);o(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,t,a){switch(t){case"d":return g(x.date,e);case"do":return a.ordinalNumber(e,{unit:"date"});default:return b(t.length,e)}}validate(e,t){const a=e.getFullYear(),s=ke(a),i=e.getMonth();return s?t>=1&&t<=On[i]:t>=1&&t<=Tn[i]}set(e,t,a){return e.setDate(a),e.setHours(0,0,0,0),e}}class Wn extends l{constructor(){super(...arguments);o(this,"priority",90);o(this,"subpriority",1);o(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,t,a){switch(t){case"D":case"DD":return g(x.dayOfYear,e);case"Do":return a.ordinalNumber(e,{unit:"date"});default:return b(t.length,e)}}validate(e,t){const a=e.getFullYear();return ke(a)?t>=1&&t<=366:t>=1&&t<=365}set(e,t,a){return e.setMonth(0,a),e.setHours(0,0,0,0),e}}function S(n,r,e){var D,O,T,q;const t=R(),a=(e==null?void 0:e.weekStartsOn)??((O=(D=e==null?void 0:e.locale)==null?void 0:D.options)==null?void 0:O.weekStartsOn)??t.weekStartsOn??((q=(T=t.locale)==null?void 0:T.options)==null?void 0:q.weekStartsOn)??0,s=u(n),i=s.getDay(),h=(r%7+7)%7,w=7-a,P=r<0||r>6?r-(i+w)%7:(h+w)%7-(i+w)%7;return fe(s,P)}class vn extends l{constructor(){super(...arguments);o(this,"priority",90);o(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,t,a){switch(t){case"E":case"EE":case"EEE":return a.day(e,{width:"abbreviated",context:"formatting"})||a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return a.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return a.day(e,{width:"wide",context:"formatting"})||a.day(e,{width:"abbreviated",context:"formatting"})||a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,a,s){return e=S(e,a,s),e.setHours(0,0,0,0),e}}class _n extends l{constructor(){super(...arguments);o(this,"priority",90);o(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,t,a,s){const i=c=>{const h=Math.floor((c-1)/7)*7;return(c+s.weekStartsOn+6)%7+h};switch(t){case"e":case"ee":return M(b(t.length,e),i);case"eo":return M(a.ordinalNumber(e,{unit:"day"}),i);case"eee":return a.day(e,{width:"abbreviated",context:"formatting"})||a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"});case"eeeee":return a.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return a.day(e,{width:"wide",context:"formatting"})||a.day(e,{width:"abbreviated",context:"formatting"})||a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,a,s){return e=S(e,a,s),e.setHours(0,0,0,0),e}}class Nn extends l{constructor(){super(...arguments);o(this,"priority",90);o(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,t,a,s){const i=c=>{const h=Math.floor((c-1)/7)*7;return(c+s.weekStartsOn+6)%7+h};switch(t){case"c":case"cc":return M(b(t.length,e),i);case"co":return M(a.ordinalNumber(e,{unit:"day"}),i);case"ccc":return a.day(e,{width:"abbreviated",context:"standalone"})||a.day(e,{width:"short",context:"standalone"})||a.day(e,{width:"narrow",context:"standalone"});case"ccccc":return a.day(e,{width:"narrow",context:"standalone"});case"cccccc":return a.day(e,{width:"short",context:"standalone"})||a.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return a.day(e,{width:"wide",context:"standalone"})||a.day(e,{width:"abbreviated",context:"standalone"})||a.day(e,{width:"short",context:"standalone"})||a.day(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=6}set(e,t,a,s){return e=S(e,a,s),e.setHours(0,0,0,0),e}}function En(n,r){const e=u(n),t=on(e),a=r-t;return fe(e,a)}class qn extends l{constructor(){super(...arguments);o(this,"priority",90);o(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,t,a){const s=i=>i===0?7:i;switch(t){case"i":case"ii":return b(t.length,e);case"io":return a.ordinalNumber(e,{unit:"day"});case"iii":return M(a.day(e,{width:"abbreviated",context:"formatting"})||a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"}),s);case"iiiii":return M(a.day(e,{width:"narrow",context:"formatting"}),s);case"iiiiii":return M(a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"}),s);case"iiii":default:return M(a.day(e,{width:"wide",context:"formatting"})||a.day(e,{width:"abbreviated",context:"formatting"})||a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"}),s)}}validate(e,t){return t>=1&&t<=7}set(e,t,a){return e=En(e,a),e.setHours(0,0,0,0),e}}class Hn extends l{constructor(){super(...arguments);o(this,"priority",80);o(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,t,a){switch(t){case"a":case"aa":case"aaa":return a.dayPeriod(e,{width:"abbreviated",context:"formatting"})||a.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return a.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(e,{width:"wide",context:"formatting"})||a.dayPeriod(e,{width:"abbreviated",context:"formatting"})||a.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,a){return e.setHours(Z(a),0,0,0),e}}class Fn extends l{constructor(){super(...arguments);o(this,"priority",80);o(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,t,a){switch(t){case"b":case"bb":case"bbb":return a.dayPeriod(e,{width:"abbreviated",context:"formatting"})||a.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return a.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(e,{width:"wide",context:"formatting"})||a.dayPeriod(e,{width:"abbreviated",context:"formatting"})||a.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,a){return e.setHours(Z(a),0,0,0),e}}class Ln extends l{constructor(){super(...arguments);o(this,"priority",80);o(this,"incompatibleTokens",["a","b","t","T"])}parse(e,t,a){switch(t){case"B":case"BB":case"BBB":return a.dayPeriod(e,{width:"abbreviated",context:"formatting"})||a.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return a.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(e,{width:"wide",context:"formatting"})||a.dayPeriod(e,{width:"abbreviated",context:"formatting"})||a.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,a){return e.setHours(Z(a),0,0,0),e}}class Cn extends l{constructor(){super(...arguments);o(this,"priority",70);o(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,t,a){switch(t){case"h":return g(x.hour12h,e);case"ho":return a.ordinalNumber(e,{unit:"hour"});default:return b(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,a){const s=e.getHours()>=12;return s&&a<12?e.setHours(a+12,0,0,0):!s&&a===12?e.setHours(0,0,0,0):e.setHours(a,0,0,0),e}}class Qn extends l{constructor(){super(...arguments);o(this,"priority",70);o(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,t,a){switch(t){case"H":return g(x.hour23h,e);case"Ho":return a.ordinalNumber(e,{unit:"hour"});default:return b(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,a){return e.setHours(a,0,0,0),e}}class In extends l{constructor(){super(...arguments);o(this,"priority",70);o(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,t,a){switch(t){case"K":return g(x.hour11h,e);case"Ko":return a.ordinalNumber(e,{unit:"hour"});default:return b(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,a){return e.getHours()>=12&&a<12?e.setHours(a+12,0,0,0):e.setHours(a,0,0,0),e}}class Rn extends l{constructor(){super(...arguments);o(this,"priority",70);o(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,t,a){switch(t){case"k":return g(x.hour24h,e);case"ko":return a.ordinalNumber(e,{unit:"hour"});default:return b(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,a){const s=a<=24?a%24:a;return e.setHours(s,0,0,0),e}}class $n extends l{constructor(){super(...arguments);o(this,"priority",60);o(this,"incompatibleTokens",["t","T"])}parse(e,t,a){switch(t){case"m":return g(x.minute,e);case"mo":return a.ordinalNumber(e,{unit:"minute"});default:return b(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,a){return e.setMinutes(a,0,0),e}}class Xn extends l{constructor(){super(...arguments);o(this,"priority",50);o(this,"incompatibleTokens",["t","T"])}parse(e,t,a){switch(t){case"s":return g(x.second,e);case"so":return a.ordinalNumber(e,{unit:"second"});default:return b(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,a){return e.setSeconds(a,0),e}}class Gn extends l{constructor(){super(...arguments);o(this,"priority",30);o(this,"incompatibleTokens",["t","T"])}parse(e,t){const a=s=>Math.trunc(s*Math.pow(10,-t.length+3));return M(b(t.length,e),a)}set(e,t,a){return e.setMilliseconds(a),e}}class Bn extends l{constructor(){super(...arguments);o(this,"priority",10);o(this,"incompatibleTokens",["t","T","x"])}parse(e,t){switch(t){case"X":return N(_.basicOptionalMinutes,e);case"XX":return N(_.basic,e);case"XXXX":return N(_.basicOptionalSeconds,e);case"XXXXX":return N(_.extendedOptionalSeconds,e);case"XXX":default:return N(_.extended,e)}}set(e,t,a){return t.timestampIsSet?e:m(e,e.getTime()-A(e)-a)}}class An extends l{constructor(){super(...arguments);o(this,"priority",10);o(this,"incompatibleTokens",["t","T","X"])}parse(e,t){switch(t){case"x":return N(_.basicOptionalMinutes,e);case"xx":return N(_.basic,e);case"xxxx":return N(_.basicOptionalSeconds,e);case"xxxxx":return N(_.extendedOptionalSeconds,e);case"xxx":default:return N(_.extended,e)}}set(e,t,a){return t.timestampIsSet?e:m(e,e.getTime()-A(e)-a)}}class Vn extends l{constructor(){super(...arguments);o(this,"priority",40);o(this,"incompatibleTokens","*")}parse(e){return pe(e)}set(e,t,a){return[m(e,a*1e3),{timestampIsSet:!0}]}}class jn extends l{constructor(){super(...arguments);o(this,"priority",20);o(this,"incompatibleTokens","*")}parse(e){return pe(e)}set(e,t,a){return[m(e,a),{timestampIsSet:!0}]}}const zn={G:new fn,y:new hn,Y:new mn,R:new wn,u:new gn,Q:new yn,q:new bn,M:new xn,L:new Mn,w:new pn,I:new kn,d:new Yn,D:new Wn,E:new vn,e:new _n,c:new Nn,i:new qn,a:new Hn,b:new Fn,B:new Ln,h:new Cn,H:new Qn,K:new In,k:new Rn,m:new $n,s:new Xn,S:new Gn,X:new Bn,x:new An,t:new Vn,T:new jn},Jn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Kn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Zn=/^'([^]*?)'?$/,Sn=/''/g,Un=/\S/,er=/[a-zA-Z]/;function Mr(n,r,e,t){var $,X,G,k,p,L,U,ee;const a=sn(),s=(t==null?void 0:t.locale)??a.locale??le,i=(t==null?void 0:t.firstWeekContainsDate)??((X=($=t==null?void 0:t.locale)==null?void 0:$.options)==null?void 0:X.firstWeekContainsDate)??a.firstWeekContainsDate??((k=(G=a.locale)==null?void 0:G.options)==null?void 0:k.firstWeekContainsDate)??1,c=(t==null?void 0:t.weekStartsOn)??((L=(p=t==null?void 0:t.locale)==null?void 0:p.options)==null?void 0:L.weekStartsOn)??a.weekStartsOn??((ee=(U=a.locale)==null?void 0:U.options)==null?void 0:ee.weekStartsOn)??0;if(r==="")return n===""?u(e):m(e,NaN);const h={firstWeekContainsDate:i,weekStartsOn:c,locale:s},w=[new ln],P=r.match(Kn).map(d=>{const y=d[0];if(y in z){const Y=z[y];return Y(d,s.formatLong)}return d}).join("").match(Jn),D=[];for(let d of P){!(t!=null&&t.useAdditionalWeekYearTokens)&&Me(d)&&J(d,r,n),!(t!=null&&t.useAdditionalDayOfYearTokens)&&xe(d)&&J(d,r,n);const y=d[0],Y=zn[y];if(Y){const{incompatibleTokens:te}=Y;if(Array.isArray(te)){const ne=D.find(re=>te.includes(re.token)||re.token===y);if(ne)throw new RangeError(`The format string mustn't contain \`${ne.fullToken}\` and \`${d}\` at the same time`)}else if(Y.incompatibleTokens==="*"&&D.length>0)throw new RangeError(`The format string mustn't contain \`${d}\` and any other token at the same time`);D.push({token:y,fullToken:d});const j=Y.run(n,d,s.match,h);if(!j)return m(e,NaN);w.push(j.setter),n=j.rest}else{if(y.match(er))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");if(d==="''"?d="'":y==="'"&&(d=tr(d)),n.indexOf(d)===0)n=n.slice(d.length);else return m(e,NaN)}}if(n.length>0&&Un.test(n))return m(e,NaN);const O=w.map(d=>d.priority).sort((d,y)=>y-d).filter((d,y,Y)=>Y.indexOf(d)===y).map(d=>w.filter(y=>y.priority===d).sort((y,Y)=>Y.subPriority-y.subPriority)).map(d=>d[0]);let T=u(e);if(isNaN(T.getTime()))return m(e,NaN);const q={};for(const d of O){if(!d.validate(T,h))return m(e,NaN);const y=d.set(T,q,h);Array.isArray(y)?(T=y[0],Object.assign(q,y[1])):T=y}return m(e,T)}function tr(n){return n.match(Zn)[1].replace(Sn,"'")}function Pr(n){const r=u(n);return r.setMinutes(0,0,0),r}function pr(n,r){const e=u(n),t=u(r);return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}function Dr(n,r){const e=se(n),t=se(r);return+e==+t}function kr(n){const r=u(n);return r.setMilliseconds(0),r}function Tr(n,r){const e=u(n),t=u(r);return e.getFullYear()===t.getFullYear()}function Te(n,r){const e=u(n),t=e.getFullYear(),a=e.getDate(),s=m(n,0);s.setFullYear(t,r,15),s.setHours(0,0,0,0);const i=an(s);return e.setMonth(r,Math.min(a,i)),e}function Or(n,r){let e=u(n);return isNaN(+e)?m(n,NaN):(r.year!=null&&e.setFullYear(r.year),r.month!=null&&(e=Te(e,r.month)),r.date!=null&&e.setDate(r.date),r.hours!=null&&e.setHours(r.hours),r.minutes!=null&&e.setMinutes(r.minutes),r.seconds!=null&&e.setSeconds(r.seconds),r.milliseconds!=null&&e.setMilliseconds(r.milliseconds),e)}function Yr(n,r){const e=u(n);return e.setHours(r),e}function Wr(n,r){const e=u(n);return e.setMinutes(r),e}function vr(n,r){const e=u(n),t=Math.trunc(e.getMonth()/3)+1,a=r-t;return Te(e,e.getMonth()+a*3)}function _r(n,r){const e=u(n);return e.setSeconds(r),e}function Nr(n,r){const e=u(n);return isNaN(+e)?m(n,NaN):(e.setFullYear(r),e)}export{Te as A,kr as B,se as C,E as D,B as E,hr as F,Yr as G,Pr as H,Wr as I,ur as J,_r as K,wr as L,yr as M,mr as N,gr as a,br as b,fe as c,fr as d,le as e,dr as f,sn as g,Bt as h,Gt as i,he as j,ar as k,Nr as l,sr as m,lr as n,xr as o,Mr as p,pr as q,Tr as r,cr as s,ir as t,Dr as u,or as v,Ne as w,Or as x,vr as y,rr as z};
|