@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1 lines • 78.2 kB
JavaScript
(function(d,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("vue"),require("bignumber.js"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","bignumber.js","lodash-es"],c):(d=typeof globalThis<"u"?globalThis:d||self,c(d.common={},d.Vue,d.BigNumber,d.LodashES))})(this,function(d,c,I,Yt){"use strict";var La=Object.defineProperty;var Sa=(d,c,I)=>c in d?La(d,c,{enumerable:!0,configurable:!0,writable:!0,value:I}):d[c]=I;var f=(d,c,I)=>Sa(d,typeof c!="symbol"?c+"":c,I);function ve(t){const r=t.nativeElement?t.nativeElement:t;return r.classList!==void 0&&r.classList!==null?r:null}function xe(t,r){if(r===void 0)return;const e=ve(t);e&&e.classList.remove(r)}function me(t,r){if(r===void 0)return;const e=ve(t);e&&e.classList.add(r)}const At=[{size:"sm",width:576,pattern:/\b(col-|col-sm-)\d+\b/},{size:"md",width:768,pattern:/\bcol-md-\d+\b/},{size:"lg",width:888,pattern:/\bcol-lg-\d+\b/},{size:"xl",width:1200,pattern:/\bcol-xl-\d+\b/},{size:"el",width:1690,pattern:/\bcol-el-\d+\b/}];function je(t){t&&t.resizeObserver&&(t.resizeObserver.disconnect(),t.resizeObserver=null)}function ze(t,r,e=0){const n=[];if(!r)return;const a=e||r.getBoundingClientRect().width,i=parseFloat(a),o=t.breakPoints;for(let s=0;s<o.length;s++)o[s].width<=i&&n.push(o[s].size);if(t.className.join(",")!==n.join(",")){if(t.className.length-n.length>0)for(let u=n.length;u<t.className.length;u++)xe(r,"f-area-response--"+t.className[u]);else for(let u=t.className.length;u<n.length;u++)me(r,"f-area-response--"+n[u]);t.className=[...n]}}function It(t,r){t.enable&&t.autoWidth?t.resizeObserver||(t.resizeObserver=new ResizeObserver(e=>{if(!e||e.length<1||!e[0].contentRect)return;const n=e[0].contentRect;Math.abs(parseInt(n.width+"")-t.width)>t.threshold&&(ze(t,r,n.width),t.width=parseInt(n.width+""))}),t.resizeObserver.observe(r)):je(t)}function Xe(t,r){if(t.enable)me(r,"f-area-response"),ze(t,r);else{xe(r,"f-area-response");for(let e=t.className.length;e>0;e--)me(r,"f-area-response--"+t.className[e]);t.className=[]}It(t,r)}function Ht(t){const r=[];return At.map(e=>{const n="col-"+e.size+"-";if(t.querySelectorAll('[class*="'+n+'"]').length>0)r.push({size:e.size,width:e.width});else if(e.size==="sm"){const i=t.querySelectorAll('[class*="col-"]');Array.from(i).some(s=>s.className.match(e.pattern))&&r.push({size:e.size,width:e.width})}}),r}function Qe(t,r,e){r.value&&Object.prototype.hasOwnProperty.call(r.value,"enable")&&(t.enable=r.value.enable),r.value&&Object.prototype.hasOwnProperty.call(r.value,"autoWidth")&&(t.autoWidth=r.value.autoWidth),t&&(t.breakPoints=Ht(e))}const we={mounted:(t,r,e)=>{e.sharedObject={className:[],resizeObserver:null,enable:!0,autoWidth:!0,threshold:10,width:0,breakPoints:[]},Qe(e.sharedObject,r,t),Xe(e.sharedObject,t)},updated:function(t,r,e,n){n&&n.sharedObject?e.sharedObject=n.sharedObject:e.sharedObject={className:[],resizeObserver:null,enable:!0,autoWidth:!0,threshold:10,width:0,breakPoints:[]},Qe(e.sharedObject,r,t),Xe(e.sharedObject,t)},beforeUnmount(t,r,e){e.sharedObject&&je(e.sharedObject)}},Ge={created(t,r){t.setAttribute("title",t.textContent||r.value||"")},mounted(t,r){const e=r.value||t.textContent||"";t.setAttribute("title",e)},updated(t,r){const e=r.value||t.textContent||"";t.setAttribute("title",e)},beforeUpdate(t,r){const e=r.value||t.textContent||"";t.setAttribute("title",e)}};function Rt(t,r,e,n,a){const i=c.ref(t.disabled),o=c.ref(!1),s=c.ref(t.showBorder),u=c.ref(t.textAlign),g=c.ref(t.updateOn),D=c.ref(!1),T=c.computed(()=>t.editable||!t.readonly&&!t.disabled),M=c.computed(()=>t.editable&&!t.disabled&&!t.readonly),y=c.computed(()=>!t.disabled&&!t.readonly&&o.value),v=c.computed(()=>e.value===""||e.value===null||e.value===void 0),l=c.computed(()=>(t.disabled||t.readonly)&&!t.forcePlaceholder?"":t.placeholder),w=c.computed(()=>t.readonly||!t.editable),h=c.computed(()=>t.enableTitle?e.value:""),x=c.computed(()=>t.maxLength>0?t.maxLength:void 0),m=c.computed(()=>({"form-control":!0,"f-utils-fill":!0,"text-left":u.value==="left","text-center":u.value==="center","text-right":u.value==="right"})),p=c.computed(()=>{const b={"f-cmp-inputgroup":!0,"input-group":!0,"f-state-disabled":i.value,"f-state-editable":M.value,"f-state-readonly":w.value,"f-state-focus":y.value,"input-group--has-clear":t.enableClear&&D.value};return(t.customClass||"").split(" ").reduce((he,Et)=>(he[Et]=!0,he),b),b}),C=b=>t.maxLength>0&&typeof b=="string"?b.slice(0,t.maxLength):b,j=c.computed(()=>s.value?"":"border-width : 0 ");function W(){return t.type&&t.type!=="text"?t.type:t.showType||"text"}const R=c.ref(W());function k(b,S=!0){e.value=C(b),n.value!==e.value&&(n.value=e.value),S&&(r.emit("change",e.value),r.emit("update:modelValue",e.value),r.emit("update:value",e.value))}c.watch(()=>t.modelValue,(b,S)=>{if(b===S)return;const he=C(b);k(he,!(he===b))},{immediate:!0}),c.watch(()=>t.disabled,(b,S)=>{b!==S&&(i.value=b)}),c.watch(()=>t.showType,b=>{b&&(R.value=b)}),c.watch(()=>t.type,b=>{R.value=b});function de(b){return b.stopPropagation(),o.value=!1,r.emit("blur",b),b.target.tagName==="TEXTAREA"&&g.value==="blur"&&(r.emit("update:modelValue",b.target.value),r.emit("update:value",b.target.value),r.emit("change",b.target.value)),!1}function fe(b){r.emit("click",b)}function K(b){i.value||w.value||(s.value&&(o.value=!0),T.value&&r.emit("focus",b))}function Q(b){r.emit("input",b.target.value,b);const S=b.target.value;n.value=S,g.value==="change"&&(r.emit("update:modelValue",S),r.emit("update:value",S),r.emit("change",S))}function G(b){r.emit("keydown",b)}function Te(b){r.emit("keyup",b)}function De(b){const S=b.target;S.tagName!=="INPUT"&&S.tagName!=="TEXTAREA"&&b.preventDefault(),b.stopPropagation(),r.emit("mousedownEvent",b)}function $e(b){r.emit("mouseupEvent",b)}function Me(b){if(g.value==="blur"){const S=b.target.value;b.stopPropagation(),k(S)}}return{changeTextBoxValue:k,disabled:i,displayText:n,editable:M,hasFocused:y,inputGroupClass:p,inputType:R,isEmpty:v,modelValue:e,readonly:w,maxLength:x,onBlur:de,hasClearClass:D,onClick:fe,onFocus:K,onInput:Q,onKeydown:G,onKeyup:Te,onMousedown:De,onMouseup:$e,onTextBoxValueChange:Me,placeholder:l,textBoxClass:m,textBoxTitle:h,inputGroupStyle:j}}function Wt(t,r,e,n){const a=c.ref(t.disabled),i=c.ref(!1),o=c.ref("text"),s=c.ref(t.showBorder),u=c.ref(t.textAlign);c.computed(()=>t.editable||!t.readonly);const g=c.computed(()=>t.editable&&!t.disabled&&!t.readonly),D=c.computed(()=>!t.disabled&&i.value),T=c.computed(()=>e.value===""||e.value===null||e.value===void 0),M=c.computed(()=>t.placeholder),y=c.computed(()=>t.readonly||!t.editable),v=c.computed(()=>t.enableTitle?e.value:""),l=c.computed(()=>t.maxLength>0?t.maxLength:void 0),w=c.computed(()=>({"form-control":!0,"text-left":u.value==="left","text-center":u.value==="center","text-right":u.value==="right"})),h=c.computed(()=>({"f-cmp-inputgroup":!0,"input-group":!0,"f-state-disabled":!0,"f-state-editable":!1,"f-state-readonly":!0})),x=c.computed(()=>s.value?"":"border-width : 0 ");function m(p,C=!0){}return{changeTextBoxValue:m,disabled:a,displayText:n,editable:g,hasFocused:D,inputGroupClass:h,inputType:o,isEmpty:T,modelValue:e,readonly:y,maxLength:l,placeholder:M,textBoxClass:w,textBoxTitle:v,inputGroupStyle:x}}function Ft(t,r,e){const n=c.ref(!1),a=c.computed(()=>t.enableClear&&!t.readonly&&!t.disabled),{changeTextBoxValue:i,displayText:o,hasFocused:s,modelValue:u,isEmpty:g,hasClearClass:D}=e,T=c.ref(!1);function M(m){n.value=m,D&&(D.value=n.value)}const y=c.computed(()=>a.value&&!!(o!=null&&o.value)&&T.value);c.watch(o,()=>{M(y.value)});const v=c.computed(()=>({"input-group-text":!0,"input-group-clear":!0})),l=c.computed(()=>({width:"24px",display:n.value?"flex":"none"}));function w(m){m.stopPropagation(),a.value&&(i("",!0),M(!n.value),r.emit("clear"))}function h(m){var W,R;T.value=!0;const p=((W=m.target.querySelector("input"))==null?void 0:W.value)||"",C=((R=m.target.querySelector("textarea"))==null?void 0:R.value)||"",j=p||C;j!==u.value&&(u.value=j),a.value&&M(!!j)}function x(m){T.value=!1,a.value&&M(!1)}return{clearButtonClass:v,clearButtonStyle:l,hasShownClearButton:n,onClearValue:w,onMouseEnter:h,onMouseLeave:x,shouldShowClearButton:a}}const Bt={jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12},qt={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};class Ne{constructor(){f(this,"regexes",{YEAR:"[1-9]\\d{3}",MONTH:"1[0-2]|0?[1-9]",MONTH2:"1[0-2]|0[1-9]",MONTHNAME:"jan|january|feb|february|mar|march|apr|april|may|jun|june|jul|july|aug|august|sep|september|oct|october|nov|november|dec|december",DAYNAME:"mon|monday|tue|tuesday|wed|wednesday|thu|thursday|fri|friday|sat|saturday|sun|sunday",DAY:"3[01]|[12]\\d|0?[1-9]",DAY2:"3[01]|[12]\\d|0[1-9]",TIMEZONE:"[+-][01]\\d\\:?[0-5]\\d",H24:"[01]\\d|2[0-3]",MIN:"[0-5]\\d",SEC:"[0-5]\\d",MS:"\\d{3,}",H12:"0?[1-9]|1[012]",AMPM:"am|pm",UNIT:"year|month|week|day|hour|minute|second|millisecond"});f(this,"patterns",[["iso_8601",this.makePattern("^(_YEAR_)-(_MONTH_)-(_DAY_)$"),"$2/$3/$1"],["us",this.makePattern("^(_MONTH_)([\\/-])(_DAY_)\\2(_YEAR_)$"),"$1/$3/$4"],["world",this.makePattern("^(_DAY_)([\\/\\.])(_MONTH_)\\2(_YEAR_)$"),"$3/$1/$4"],["chicago",this.makePattern("^(?:(?:_DAYNAME_),? )?(_DAY_)([ -])(_MONTHNAME_)\\2(_YEAR_)$"),"$3 $1, $4"],["conversational",this.makePattern("^(?:(?:_DAYNAME_),? )?(_MONTHNAME_) (_DAY_),? (_YEAR_)$"),"$1 $2, $3"],["month_day_time_year",this.makePattern("^(?:_DAYNAME_) (_MONTHNAME_) (_DAY_) ((?:_H24_)\\:(?:_MIN_)(?:\\:_SEC_)?) (_TIMEZONE_) (_YEAR_)$"),r=>{const e=(""+this.getMonthByName(r[1])).padStart(2,"0"),n=(""+r[2]).padStart(2,"0"),a=r[5],i=r[3],o=r[4],s=a+"-"+e+"-"+n+"T"+i+o;return isNaN(s)?!1:s}],["unix",/^@(-?\d+)$/,r=>this.create(parseInt(r[1],10)*1e3)],["24_hour",this.makePattern("^(?:(.+?)(?: |T))?(_H24_)\\:(_MIN_)(?:\\:(_SEC_)(?:\\.(_MS_))?)? ?(?:GMT)?(_TIMEZONE_)?(?: \\([A-Z]+\\))?$"),r=>{let e;const n=r[1];if(n){if(e=this.create(n),isNaN(e))return!1}else e=new Date,e.setMilliseconds(0);const a=r[2],i=r[3],o=r[4],s=r[5];return e.setHours(parseFloat(a),parseFloat(i),parseFloat(o||0)),s&&e.setMilliseconds(+String(s).slice(0,3)),e}],["12_hour",this.makePattern("^(?:(.+) )?(_H12_)(?:\\:(_MIN_)(?:\\:(_SEC_))?)? ?(_AMPM_)$"),r=>{let e;const n=r[1];if(n){if(e=this.create(n),isNaN(e))return!1}else e=new Date,e.setMilliseconds(0);let a=parseFloat(r[2]);a=r[5].toLowerCase()==="am"?a===12?0:a:a===12?12:a+12;const i=r[3],o=r[4];return e.setHours(a,parseFloat(i||0),parseFloat(o||0)),e}]])}makePattern(r){return r=r.replace(/_([A-Z][A-Z0-9]+)_/g,(e,n)=>this.regexes[n]),new RegExp(r,"i")}getMonthByName(r){return Bt[String(r).slice(0,3).toLowerCase()]}getWeekdayByName(r){return qt[String(r).slice(0,3).toLowerCase()]}parse(r){if(!isNaN(Number(r)))return new Date(r);if(r=String(r).replace(/^\s*(.*)\s*$/,"$1"),r=r.replace(/\s{2,}/g," "),r==="")return Date.now();let e=0;for(;e<this.patterns.length;){const n=this.patterns[e];let a,i;typeof n[0]=="string"?(i=n[1],a=n[2]):(i=n[0],a=n[1]);const o=r.match(i);if(!o){e++;continue}if(typeof a=="function"){const s=a(o);if(s instanceof Date)return s}else{const s=Date.parse(r.replace(i,a));if(!isNaN(s))return new Date(s)}e++}return NaN}create(r){return r==null?Date.now():r instanceof Date?r:this.parse(r)}}function H(t){const r=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&r==="[object Date]"?new t.constructor(+t):typeof t=="number"||r==="[object Number]"||typeof t=="string"||r==="[object String]"?new Date(t):new Date(NaN)}function P(t,r){return t instanceof Date?new t.constructor(r):new Date(r)}function Ue(t,r){const e=H(t);return isNaN(r)?P(t,NaN):(r&&e.setDate(e.getDate()+r),e)}const Ve=6048e5,Lt=864e5,Oe=6e4,ke=36e5,St=1e3;let $t={};function ee(){return $t}function U(t,r){var s,u,g,D;const e=ee(),n=(r==null?void 0:r.weekStartsOn)??((u=(s=r==null?void 0:r.locale)==null?void 0:s.options)==null?void 0:u.weekStartsOn)??e.weekStartsOn??((D=(g=e.locale)==null?void 0:g.options)==null?void 0:D.weekStartsOn)??0,a=H(t),i=a.getDay(),o=(i<n?7:0)+i-n;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function te(t){return U(t,{weekStartsOn:1})}function Ze(t){const r=H(t),e=r.getFullYear(),n=P(t,0);n.setFullYear(e+1,0,4),n.setHours(0,0,0,0);const a=te(n),i=P(t,0);i.setFullYear(e,0,4),i.setHours(0,0,0,0);const o=te(i);return r.getTime()>=a.getTime()?e+1:r.getTime()>=o.getTime()?e:e-1}function Ke(t){const r=H(t);return r.setHours(0,0,0,0),r}function ge(t){const r=H(t),e=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return e.setUTCFullYear(r.getFullYear()),+t-+e}function jt(t,r){const e=Ke(t),n=Ke(r),a=+e-ge(e),i=+n-ge(n);return Math.round((a-i)/Lt)}function zt(t){const r=Ze(t),e=P(t,0);return e.setFullYear(r,0,4),e.setHours(0,0,0,0),te(e)}function Xt(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function _e(t){if(!Xt(t)&&typeof t!="number")return!1;const r=H(t);return!isNaN(Number(r))}function Qt(t){const r=H(t),e=P(t,0);return e.setFullYear(r.getFullYear(),0,1),e.setHours(0,0,0,0),e}const Gt={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"}},Ut=(t,r,e)=>{let n;const a=Gt[t];return typeof a=="string"?n=a:r===1?n=a.one:n=a.other.replace("{{count}}",r.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+n:n+" ago":n};function Ce(t){return(r={})=>{const e=r.width?String(r.width):t.defaultWidth;return t.formats[e]||t.formats[t.defaultWidth]}}const Vt={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Zt={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Kt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Jt={date:Ce({formats:Vt,defaultWidth:"full"}),time:Ce({formats:Zt,defaultWidth:"full"}),dateTime:Ce({formats:Kt,defaultWidth:"full"})},en={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},tn=(t,r,e,n)=>en[t];function ie(t){return(r,e)=>{const n=e!=null&&e.context?String(e.context):"standalone";let a;if(n==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,s=e!=null&&e.width?String(e.width):o;a=t.formattingValues[s]||t.formattingValues[o]}else{const o=t.defaultWidth,s=e!=null&&e.width?String(e.width):t.defaultWidth;a=t.values[s]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(r):r;return a[i]}}const nn={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},rn={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},an={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"]},on={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"]},sn={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"}},un={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"}},cn={ordinalNumber:(t,r)=>{const e=Number(t),n=e%100;if(n>20||n<10)switch(n%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:ie({values:nn,defaultWidth:"wide"}),quarter:ie({values:rn,defaultWidth:"wide",argumentCallback:t=>t-1}),month:ie({values:an,defaultWidth:"wide"}),day:ie({values:on,defaultWidth:"wide"}),dayPeriod:ie({values:sn,defaultWidth:"wide",formattingValues:un,defaultFormattingWidth:"wide"})};function oe(t){return(r,e={})=>{const n=e.width,a=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],i=r.match(a);if(!i)return null;const o=i[0],s=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?dn(s,T=>T.test(o)):ln(s,T=>T.test(o));let g;g=t.valueCallback?t.valueCallback(u):u,g=e.valueCallback?e.valueCallback(g):g;const D=r.slice(o.length);return{value:g,rest:D}}}function ln(t,r){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&r(t[e]))return e}function dn(t,r){for(let e=0;e<t.length;e++)if(r(t[e]))return e}function fn(t){return(r,e={})=>{const n=r.match(t.matchPattern);if(!n)return null;const a=n[0],i=r.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=e.valueCallback?e.valueCallback(o):o;const s=r.slice(a.length);return{value:o,rest:s}}}const hn=/^(\d+)(th|st|nd|rd)?/i,mn=/\d+/i,wn={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},gn={any:[/^b/i,/^(a|c)/i]},yn={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},bn={any:[/1/i,/2/i,/3/i,/4/i]},pn={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},Tn={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]},Dn={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},Mn={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]},vn={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},xn={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}},Nn={ordinalNumber:fn({matchPattern:hn,parsePattern:mn,valueCallback:t=>parseInt(t,10)}),era:oe({matchPatterns:wn,defaultMatchWidth:"wide",parsePatterns:gn,defaultParseWidth:"any"}),quarter:oe({matchPatterns:yn,defaultMatchWidth:"wide",parsePatterns:bn,defaultParseWidth:"any",valueCallback:t=>t+1}),month:oe({matchPatterns:pn,defaultMatchWidth:"wide",parsePatterns:Tn,defaultParseWidth:"any"}),day:oe({matchPatterns:Dn,defaultMatchWidth:"wide",parsePatterns:Mn,defaultParseWidth:"any"}),dayPeriod:oe({matchPatterns:vn,defaultMatchWidth:"any",parsePatterns:xn,defaultParseWidth:"any"})},Je={code:"en-US",formatDistance:Ut,formatLong:Jt,formatRelative:tn,localize:cn,match:Nn,options:{weekStartsOn:0,firstWeekContainsDate:1}};function On(t){const r=H(t);return jt(r,Qt(r))+1}function et(t){const r=H(t),e=+te(r)-+zt(r);return Math.round(e/Ve)+1}function Pe(t,r){var D,T,M,y;const e=H(t),n=e.getFullYear(),a=ee(),i=(r==null?void 0:r.firstWeekContainsDate)??((T=(D=r==null?void 0:r.locale)==null?void 0:D.options)==null?void 0:T.firstWeekContainsDate)??a.firstWeekContainsDate??((y=(M=a.locale)==null?void 0:M.options)==null?void 0:y.firstWeekContainsDate)??1,o=P(t,0);o.setFullYear(n+1,0,i),o.setHours(0,0,0,0);const s=U(o,r),u=P(t,0);u.setFullYear(n,0,i),u.setHours(0,0,0,0);const g=U(u,r);return e.getTime()>=s.getTime()?n+1:e.getTime()>=g.getTime()?n:n-1}function kn(t,r){var s,u,g,D;const e=ee(),n=(r==null?void 0:r.firstWeekContainsDate)??((u=(s=r==null?void 0:r.locale)==null?void 0:s.options)==null?void 0:u.firstWeekContainsDate)??e.firstWeekContainsDate??((D=(g=e.locale)==null?void 0:g.options)==null?void 0:D.firstWeekContainsDate)??1,a=Pe(t,r),i=P(t,0);return i.setFullYear(a,0,n),i.setHours(0,0,0,0),U(i,r)}function tt(t,r){const e=H(t),n=+U(e,r)-+kn(e,r);return Math.round(n/Ve)+1}function O(t,r){const e=t<0?"-":"",n=Math.abs(t).toString().padStart(r,"0");return e+n}const V={y(t,r){const e=t.getFullYear(),n=e>0?e:1-e;return O(r==="yy"?n%100:n,r.length)},M(t,r){const e=t.getMonth();return r==="M"?String(e+1):O(e+1,2)},d(t,r){return O(t.getDate(),r.length)},a(t,r){const e=t.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(t,r){return O(t.getHours()%12||12,r.length)},H(t,r){return O(t.getHours(),r.length)},m(t,r){return O(t.getMinutes(),r.length)},s(t,r){return O(t.getSeconds(),r.length)},S(t,r){const e=r.length,n=t.getMilliseconds(),a=Math.trunc(n*Math.pow(10,e-3));return O(a,r.length)}},ne={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},nt={G:function(t,r,e){const n=t.getFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return e.era(n,{width:"abbreviated"});case"GGGGG":return e.era(n,{width:"narrow"});case"GGGG":default:return e.era(n,{width:"wide"})}},y:function(t,r,e){if(r==="yo"){const n=t.getFullYear(),a=n>0?n:1-n;return e.ordinalNumber(a,{unit:"year"})}return V.y(t,r)},Y:function(t,r,e,n){const a=Pe(t,n),i=a>0?a:1-a;if(r==="YY"){const o=i%100;return O(o,2)}return r==="Yo"?e.ordinalNumber(i,{unit:"year"}):O(i,r.length)},R:function(t,r){const e=Ze(t);return O(e,r.length)},u:function(t,r){const e=t.getFullYear();return O(e,r.length)},Q:function(t,r,e){const n=Math.ceil((t.getMonth()+1)/3);switch(r){case"Q":return String(n);case"QQ":return O(n,2);case"Qo":return e.ordinalNumber(n,{unit:"quarter"});case"QQQ":return e.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,r,e){const n=Math.ceil((t.getMonth()+1)/3);switch(r){case"q":return String(n);case"qq":return O(n,2);case"qo":return e.ordinalNumber(n,{unit:"quarter"});case"qqq":return e.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,r,e){const n=t.getMonth();switch(r){case"M":case"MM":return V.M(t,r);case"Mo":return e.ordinalNumber(n+1,{unit:"month"});case"MMM":return e.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(n,{width:"wide",context:"formatting"})}},L:function(t,r,e){const n=t.getMonth();switch(r){case"L":return String(n+1);case"LL":return O(n+1,2);case"Lo":return e.ordinalNumber(n+1,{unit:"month"});case"LLL":return e.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(n,{width:"wide",context:"standalone"})}},w:function(t,r,e,n){const a=tt(t,n);return r==="wo"?e.ordinalNumber(a,{unit:"week"}):O(a,r.length)},I:function(t,r,e){const n=et(t);return r==="Io"?e.ordinalNumber(n,{unit:"week"}):O(n,r.length)},d:function(t,r,e){return r==="do"?e.ordinalNumber(t.getDate(),{unit:"date"}):V.d(t,r)},D:function(t,r,e){const n=On(t);return r==="Do"?e.ordinalNumber(n,{unit:"dayOfYear"}):O(n,r.length)},E:function(t,r,e){const n=t.getDay();switch(r){case"E":case"EE":case"EEE":return e.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(n,{width:"short",context:"formatting"});case"EEEE":default:return e.day(n,{width:"wide",context:"formatting"})}},e:function(t,r,e,n){const a=t.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(r){case"e":return String(i);case"ee":return O(i,2);case"eo":return e.ordinalNumber(i,{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(t,r,e,n){const a=t.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(r){case"c":return String(i);case"cc":return O(i,r.length);case"co":return e.ordinalNumber(i,{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(t,r,e){const n=t.getDay(),a=n===0?7:n;switch(r){case"i":return String(a);case"ii":return O(a,r.length);case"io":return e.ordinalNumber(a,{unit:"day"});case"iii":return e.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(n,{width:"short",context:"formatting"});case"iiii":default:return e.day(n,{width:"wide",context:"formatting"})}},a:function(t,r,e){const a=t.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(t,r,e){const n=t.getHours();let a;switch(n===12?a=ne.noon:n===0?a=ne.midnight:a=n/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(t,r,e){const n=t.getHours();let a;switch(n>=17?a=ne.evening:n>=12?a=ne.afternoon:n>=4?a=ne.morning:a=ne.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(t,r,e){if(r==="ho"){let n=t.getHours()%12;return n===0&&(n=12),e.ordinalNumber(n,{unit:"hour"})}return V.h(t,r)},H:function(t,r,e){return r==="Ho"?e.ordinalNumber(t.getHours(),{unit:"hour"}):V.H(t,r)},K:function(t,r,e){const n=t.getHours()%12;return r==="Ko"?e.ordinalNumber(n,{unit:"hour"}):O(n,r.length)},k:function(t,r,e){let n=t.getHours();return n===0&&(n=24),r==="ko"?e.ordinalNumber(n,{unit:"hour"}):O(n,r.length)},m:function(t,r,e){return r==="mo"?e.ordinalNumber(t.getMinutes(),{unit:"minute"}):V.m(t,r)},s:function(t,r,e){return r==="so"?e.ordinalNumber(t.getSeconds(),{unit:"second"}):V.s(t,r)},S:function(t,r){return V.S(t,r)},X:function(t,r,e){const n=t.getTimezoneOffset();if(n===0)return"Z";switch(r){case"X":return at(n);case"XXXX":case"XX":return J(n);case"XXXXX":case"XXX":default:return J(n,":")}},x:function(t,r,e){const n=t.getTimezoneOffset();switch(r){case"x":return at(n);case"xxxx":case"xx":return J(n);case"xxxxx":case"xxx":default:return J(n,":")}},O:function(t,r,e){const n=t.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+rt(n,":");case"OOOO":default:return"GMT"+J(n,":")}},z:function(t,r,e){const n=t.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+rt(n,":");case"zzzz":default:return"GMT"+J(n,":")}},t:function(t,r,e){const n=Math.trunc(t.getTime()/1e3);return O(n,r.length)},T:function(t,r,e){const n=t.getTime();return O(n,r.length)}};function rt(t,r=""){const e=t>0?"-":"+",n=Math.abs(t),a=Math.trunc(n/60),i=n%60;return i===0?e+String(a):e+String(a)+r+O(i,2)}function at(t,r){return t%60===0?(t>0?"-":"+")+O(Math.abs(t)/60,2):J(t,r)}function J(t,r=""){const e=t>0?"-":"+",n=Math.abs(t),a=O(Math.trunc(n/60),2),i=O(n%60,2);return e+a+r+i}const it=(t,r)=>{switch(t){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"})}},ot=(t,r)=>{switch(t){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"})}},Ee={p:ot,P:(t,r)=>{const e=t.match(/(P+)(p+)?/)||[],n=e[1],a=e[2];if(!a)return it(t,r);let i;switch(n){case"P":i=r.dateTime({width:"short"});break;case"PP":i=r.dateTime({width:"medium"});break;case"PPP":i=r.dateTime({width:"long"});break;case"PPPP":default:i=r.dateTime({width:"full"});break}return i.replace("{{date}}",it(n,r)).replace("{{time}}",ot(a,r))}},_n=/^D+$/,Cn=/^Y+$/,Pn=["D","DD","YY","YYYY"];function st(t){return _n.test(t)}function ut(t){return Cn.test(t)}function Ye(t,r,e){const n=En(t,r,e);if(console.warn(n),Pn.includes(t))throw new RangeError(n)}function En(t,r,e){const n=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${r}\`) for formatting ${n} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Yn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,An=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,In=/^'([^]*?)'?$/,Hn=/''/g,Rn=/[a-zA-Z]/;function se(t,r,e){var D,T,M,y;const n=ee(),a=n.locale??Je,i=n.firstWeekContainsDate??((T=(D=n.locale)==null?void 0:D.options)==null?void 0:T.firstWeekContainsDate)??1,o=n.weekStartsOn??((y=(M=n.locale)==null?void 0:M.options)==null?void 0:y.weekStartsOn)??0,s=H(t);if(!_e(s))throw new RangeError("Invalid time value");let u=r.match(An).map(v=>{const l=v[0];if(l==="p"||l==="P"){const w=Ee[l];return w(v,a.formatLong)}return v}).join("").match(Yn).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const l=v[0];if(l==="'")return{isToken:!1,value:Wn(v)};if(nt[l])return{isToken:!0,value:v};if(l.match(Rn))throw new RangeError("Format string contains an unescaped latin alphabet character `"+l+"`");return{isToken:!1,value:v}});a.localize.preprocessor&&(u=a.localize.preprocessor(s,u));const g={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return u.map(v=>{if(!v.isToken)return v.value;const l=v.value;(ut(l)||st(l))&&Ye(l,r,String(t));const w=nt[l[0]];return w(s,l,a.localize,g)}).join("")}function Wn(t){const r=t.match(In);return r?r[1].replace(Hn,"'"):t}function Fn(){return Object.assign({},ee())}function Bn(t){let e=H(t).getDay();return e===0&&(e=7),e}function qn(t,r){const e=r instanceof Date?P(r,0):new r(0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),e}const Ln=10;class ct{constructor(){f(this,"subPriority",0)}validate(r,e){return!0}}class Sn extends ct{constructor(r,e,n,a,i){super(),this.value=r,this.validateValue=e,this.setValue=n,this.priority=a,i&&(this.subPriority=i)}validate(r,e){return this.validateValue(r,this.value,e)}set(r,e,n){return this.setValue(r,e,this.value,n)}}class $n extends ct{constructor(){super(...arguments);f(this,"priority",Ln);f(this,"subPriority",-1)}set(e,n){return n.timestampIsSet?e:P(e,qn(e,Date))}}class N{run(r,e,n,a){const i=this.parse(r,e,n,a);return i?{setter:new Sn(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(r,e,n){return!0}}class jn extends N{constructor(){super(...arguments);f(this,"priority",140);f(this,"incompatibleTokens",["R","u","t","T"])}parse(e,n,a){switch(n){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,n,a){return n.era=a,e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}}const Y={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}/},z={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 A(t,r){return t&&{value:r(t.value),rest:t.rest}}function _(t,r){const e=r.match(t);return e?{value:parseInt(e[0],10),rest:r.slice(e[0].length)}:null}function X(t,r){const e=r.match(t);if(!e)return null;if(e[0]==="Z")return{value:0,rest:r.slice(1)};const n=e[1]==="+"?1:-1,a=e[2]?parseInt(e[2],10):0,i=e[3]?parseInt(e[3],10):0,o=e[5]?parseInt(e[5],10):0;return{value:n*(a*ke+i*Oe+o*St),rest:r.slice(e[0].length)}}function lt(t){return _(Y.anyDigitsSigned,t)}function E(t,r){switch(t){case 1:return _(Y.singleDigit,r);case 2:return _(Y.twoDigits,r);case 3:return _(Y.threeDigits,r);case 4:return _(Y.fourDigits,r);default:return _(new RegExp("^\\d{1,"+t+"}"),r)}}function ye(t,r){switch(t){case 1:return _(Y.singleDigitSigned,r);case 2:return _(Y.twoDigitsSigned,r);case 3:return _(Y.threeDigitsSigned,r);case 4:return _(Y.fourDigitsSigned,r);default:return _(new RegExp("^-?\\d{1,"+t+"}"),r)}}function Ae(t){switch(t){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 dt(t,r){const e=r>0,n=e?r:1-r;let a;if(n<=50)a=t||100;else{const i=n+50,o=Math.trunc(i/100)*100,s=t>=i%100;a=t+o-(s?100:0)}return e?a:1-a}function ft(t){return t%400===0||t%4===0&&t%100!==0}class zn extends N{constructor(){super(...arguments);f(this,"priority",130);f(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,n,a){const i=o=>({year:o,isTwoDigitYear:n==="yy"});switch(n){case"y":return A(E(4,e),i);case"yo":return A(a.ordinalNumber(e,{unit:"year"}),i);default:return A(E(n.length,e),i)}}validate(e,n){return n.isTwoDigitYear||n.year>0}set(e,n,a){const i=e.getFullYear();if(a.isTwoDigitYear){const s=dt(a.year,i);return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}const o=!("era"in n)||n.era===1?a.year:1-a.year;return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}class Xn extends N{constructor(){super(...arguments);f(this,"priority",130);f(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,n,a){const i=o=>({year:o,isTwoDigitYear:n==="YY"});switch(n){case"Y":return A(E(4,e),i);case"Yo":return A(a.ordinalNumber(e,{unit:"year"}),i);default:return A(E(n.length,e),i)}}validate(e,n){return n.isTwoDigitYear||n.year>0}set(e,n,a,i){const o=Pe(e,i);if(a.isTwoDigitYear){const u=dt(a.year,o);return e.setFullYear(u,0,i.firstWeekContainsDate),e.setHours(0,0,0,0),U(e,i)}const s=!("era"in n)||n.era===1?a.year:1-a.year;return e.setFullYear(s,0,i.firstWeekContainsDate),e.setHours(0,0,0,0),U(e,i)}}class Qn extends N{constructor(){super(...arguments);f(this,"priority",130);f(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,n){return ye(n==="R"?4:n.length,e)}set(e,n,a){const i=P(e,0);return i.setFullYear(a,0,4),i.setHours(0,0,0,0),te(i)}}class Gn extends N{constructor(){super(...arguments);f(this,"priority",130);f(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,n){return ye(n==="u"?4:n.length,e)}set(e,n,a){return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}}class Un extends N{constructor(){super(...arguments);f(this,"priority",120);f(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,n,a){switch(n){case"Q":case"QQ":return E(n.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,n){return n>=1&&n<=4}set(e,n,a){return e.setMonth((a-1)*3,1),e.setHours(0,0,0,0),e}}class Vn extends N{constructor(){super(...arguments);f(this,"priority",120);f(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,n,a){switch(n){case"q":case"qq":return E(n.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,n){return n>=1&&n<=4}set(e,n,a){return e.setMonth((a-1)*3,1),e.setHours(0,0,0,0),e}}class Zn extends N{constructor(){super(...arguments);f(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);f(this,"priority",110)}parse(e,n,a){const i=o=>o-1;switch(n){case"M":return A(_(Y.month,e),i);case"MM":return A(E(2,e),i);case"Mo":return A(a.ordinalNumber(e,{unit:"month"}),i);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,n){return n>=0&&n<=11}set(e,n,a){return e.setMonth(a,1),e.setHours(0,0,0,0),e}}class Kn extends N{constructor(){super(...arguments);f(this,"priority",110);f(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,n,a){const i=o=>o-1;switch(n){case"L":return A(_(Y.month,e),i);case"LL":return A(E(2,e),i);case"Lo":return A(a.ordinalNumber(e,{unit:"month"}),i);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,n){return n>=0&&n<=11}set(e,n,a){return e.setMonth(a,1),e.setHours(0,0,0,0),e}}function Jn(t,r,e){const n=H(t),a=tt(n,e)-r;return n.setDate(n.getDate()-a*7),n}class er extends N{constructor(){super(...arguments);f(this,"priority",100);f(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,n,a){switch(n){case"w":return _(Y.week,e);case"wo":return a.ordinalNumber(e,{unit:"week"});default:return E(n.length,e)}}validate(e,n){return n>=1&&n<=53}set(e,n,a,i){return U(Jn(e,a,i),i)}}function tr(t,r){const e=H(t),n=et(e)-r;return e.setDate(e.getDate()-n*7),e}class nr extends N{constructor(){super(...arguments);f(this,"priority",100);f(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,n,a){switch(n){case"I":return _(Y.week,e);case"Io":return a.ordinalNumber(e,{unit:"week"});default:return E(n.length,e)}}validate(e,n){return n>=1&&n<=53}set(e,n,a){return te(tr(e,a))}}const rr=[31,28,31,30,31,30,31,31,30,31,30,31],ar=[31,29,31,30,31,30,31,31,30,31,30,31];class ir extends N{constructor(){super(...arguments);f(this,"priority",90);f(this,"subPriority",1);f(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,n,a){switch(n){case"d":return _(Y.date,e);case"do":return a.ordinalNumber(e,{unit:"date"});default:return E(n.length,e)}}validate(e,n){const a=e.getFullYear(),i=ft(a),o=e.getMonth();return i?n>=1&&n<=ar[o]:n>=1&&n<=rr[o]}set(e,n,a){return e.setDate(a),e.setHours(0,0,0,0),e}}class or extends N{constructor(){super(...arguments);f(this,"priority",90);f(this,"subpriority",1);f(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,n,a){switch(n){case"D":case"DD":return _(Y.dayOfYear,e);case"Do":return a.ordinalNumber(e,{unit:"date"});default:return E(n.length,e)}}validate(e,n){const a=e.getFullYear();return ft(a)?n>=1&&n<=366:n>=1&&n<=365}set(e,n,a){return e.setMonth(0,a),e.setHours(0,0,0,0),e}}function Ie(t,r,e){var T,M,y,v;const n=ee(),a=(e==null?void 0:e.weekStartsOn)??((M=(T=e==null?void 0:e.locale)==null?void 0:T.options)==null?void 0:M.weekStartsOn)??n.weekStartsOn??((v=(y=n.locale)==null?void 0:y.options)==null?void 0:v.weekStartsOn)??0,i=H(t),o=i.getDay(),u=(r%7+7)%7,g=7-a,D=r<0||r>6?r-(o+g)%7:(u+g)%7-(o+g)%7;return Ue(i,D)}class sr extends N{constructor(){super(...arguments);f(this,"priority",90);f(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,n,a){switch(n){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,n){return n>=0&&n<=6}set(e,n,a,i){return e=Ie(e,a,i),e.setHours(0,0,0,0),e}}class ur extends N{constructor(){super(...arguments);f(this,"priority",90);f(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,n,a,i){const o=s=>{const u=Math.floor((s-1)/7)*7;return(s+i.weekStartsOn+6)%7+u};switch(n){case"e":case"ee":return A(E(n.length,e),o);case"eo":return A(a.ordinalNumber(e,{unit:"day"}),o);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,n){return n>=0&&n<=6}set(e,n,a,i){return e=Ie(e,a,i),e.setHours(0,0,0,0),e}}class cr extends N{constructor(){super(...arguments);f(this,"priority",90);f(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,n,a,i){const o=s=>{const u=Math.floor((s-1)/7)*7;return(s+i.weekStartsOn+6)%7+u};switch(n){case"c":case"cc":return A(E(n.length,e),o);case"co":return A(a.ordinalNumber(e,{unit:"day"}),o);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,n){return n>=0&&n<=6}set(e,n,a,i){return e=Ie(e,a,i),e.setHours(0,0,0,0),e}}function lr(t,r){const e=H(t),n=Bn(e),a=r-n;return Ue(e,a)}class dr extends N{constructor(){super(...arguments);f(this,"priority",90);f(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,n,a){const i=o=>o===0?7:o;switch(n){case"i":case"ii":return E(n.length,e);case"io":return a.ordinalNumber(e,{unit:"day"});case"iii":return A(a.day(e,{width:"abbreviated",context:"formatting"})||a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"}),i);case"iiiii":return A(a.day(e,{width:"narrow",context:"formatting"}),i);case"iiiiii":return A(a.day(e,{width:"short",context:"formatting"})||a.day(e,{width:"narrow",context:"formatting"}),i);case"iiii":default:return A(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"}),i)}}validate(e,n){return n>=1&&n<=7}set(e,n,a){return e=lr(e,a),e.setHours(0,0,0,0),e}}class fr extends N{constructor(){super(...arguments);f(this,"priority",80);f(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,n,a){switch(n){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,n,a){return e.setHours(Ae(a),0,0,0),e}}class hr extends N{constructor(){super(...arguments);f(this,"priority",80);f(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,n,a){switch(n){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,n,a){return e.setHours(Ae(a),0,0,0),e}}class mr extends N{constructor(){super(...arguments);f(this,"priority",80);f(this,"incompatibleTokens",["a","b","t","T"])}parse(e,n,a){switch(n){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,n,a){return e.setHours(Ae(a),0,0,0),e}}class wr extends N{constructor(){super(...arguments);f(this,"priority",70);f(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,n,a){switch(n){case"h":return _(Y.hour12h,e);case"ho":return a.ordinalNumber(e,{unit:"hour"});default:return E(n.length,e)}}validate(e,n){return n>=1&&n<=12}set(e,n,a){const i=e.getHours()>=12;return i&&a<12?e.setHours(a+12,0,0,0):!i&&a===12?e.setHours(0,0,0,0):e.setHours(a,0,0,0),e}}class gr extends N{constructor(){super(...arguments);f(this,"priority",70);f(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,n,a){switch(n){case"H":return _(Y.hour23h,e);case"Ho":return a.ordinalNumber(e,{unit:"hour"});default:return E(n.length,e)}}validate(e,n){return n>=0&&n<=23}set(e,n,a){return e.setHours(a,0,0,0),e}}class yr extends N{constructor(){super(...arguments);f(this,"priority",70);f(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,n,a){switch(n){case"K":return _(Y.hour11h,e);case"Ko":return a.ordinalNumber(e,{unit:"hour"});default:return E(n.length,e)}}validate(e,n){return n>=0&&n<=11}set(e,n,a){return e.getHours()>=12&&a<12?e.setHours(a+12,0,0,0):e.setHours(a,0,0,0),e}}class br extends N{constructor(){super(...arguments);f(this,"priority",70);f(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,n,a){switch(n){case"k":return _(Y.hour24h,e);case"ko":return a.ordinalNumber(e,{unit:"hour"});default:return E(n.length,e)}}validate(e,n){return n>=1&&n<=24}set(e,n,a){const i=a<=24?a%24:a;return e.setHours(i,0,0,0),e}}class pr extends N{constructor(){super(...arguments);f(this,"priority",60);f(this,"incompatibleTokens",["t","T"])}parse(e,n,a){switch(n){case"m":return _(Y.minute,e);case"mo":return a.ordinalNumber(e,{unit:"minute"});default:return E(n.length,e)}}validate(e,n){return n>=0&&n<=59}set(e,n,a){return e.setMinutes(a,0,0),e}}class Tr extends N{constructor(){super(...arguments);f(this,"priority",50);f(this,"incompatibleTokens",["t","T"])}parse(e,n,a){switch(n){case"s":return _(Y.second,e);case"so":return a.ordinalNumber(e,{unit:"second"});default:return E(n.length,e)}}validate(e,n){return n>=0&&n<=59}set(e,n,a){return e.setSeconds(a,0),e}}class Dr extends N{constructor