@boichikpro/vue3-date-time-picker
Version:
Date & time picker for vue3
1 lines • 206 kB
JavaScript
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),T=require("date-fns"),Ha=require("vue-i18n");;/* empty css */const $a={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"}},Wa=(n,e,t)=>{let r;const a=$a[n];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+r:r+" ago":r};function rn(n){return(e={})=>{const t=e.width?String(e.width):n.defaultWidth;return n.formats[t]||n.formats[n.defaultWidth]}}const Ua={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Xa={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ja={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},za={date:rn({formats:Ua,defaultWidth:"full"}),time:rn({formats:Xa,defaultWidth:"full"}),dateTime:rn({formats:ja,defaultWidth:"full"})},qa={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ga=(n,e,t,r)=>qa[n];function vt(n){return(e,t)=>{const r=t!=null&&t.context?String(t.context):"standalone";let a;if(r==="formatting"&&n.formattingValues){const o=n.defaultFormattingWidth||n.defaultWidth,l=t!=null&&t.width?String(t.width):o;a=n.formattingValues[l]||n.formattingValues[o]}else{const o=n.defaultWidth,l=t!=null&&t.width?String(t.width):n.defaultWidth;a=n.values[l]||n.values[o]}const s=n.argumentCallback?n.argumentCallback(e):e;return a[s]}}const Za={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ka={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Qa={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"]},Ja={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"]},es={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"}},ts={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"}},ns=(n,e)=>{const t=Number(n),r=t%100;if(r>20||r<10)switch(r%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},rs={ordinalNumber:ns,era:vt({values:Za,defaultWidth:"wide"}),quarter:vt({values:Ka,defaultWidth:"wide",argumentCallback:n=>n-1}),month:vt({values:Qa,defaultWidth:"wide"}),day:vt({values:Ja,defaultWidth:"wide"}),dayPeriod:vt({values:es,defaultWidth:"wide",formattingValues:ts,defaultFormattingWidth:"wide"})};function gt(n){return(e,t={})=>{const r=t.width,a=r&&n.matchPatterns[r]||n.matchPatterns[n.defaultMatchWidth],s=e.match(a);if(!s)return null;const o=s[0],l=r&&n.parsePatterns[r]||n.parsePatterns[n.defaultParseWidth],u=Array.isArray(l)?ss(l,h=>h.test(o)):as(l,h=>h.test(o));let d;d=n.valueCallback?n.valueCallback(u):u,d=t.valueCallback?t.valueCallback(d):d;const c=e.slice(o.length);return{value:d,rest:c}}}function as(n,e){for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&e(n[t]))return t}function ss(n,e){for(let t=0;t<n.length;t++)if(e(n[t]))return t}function is(n){return(e,t={})=>{const r=e.match(n.matchPattern);if(!r)return null;const a=r[0],s=e.match(n.parsePattern);if(!s)return null;let o=n.valueCallback?n.valueCallback(s[0]):s[0];o=t.valueCallback?t.valueCallback(o):o;const l=e.slice(a.length);return{value:o,rest:l}}}const os=/^(\d+)(th|st|nd|rd)?/i,ls=/\d+/i,us={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},cs={any:[/^b/i,/^(a|c)/i]},ds={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},hs={any:[/1/i,/2/i,/3/i,/4/i]},ps={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},fs={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]},ms={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},vs={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]},gs={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},ys={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}},bs={ordinalNumber:is({matchPattern:os,parsePattern:ls,valueCallback:n=>parseInt(n,10)}),era:gt({matchPatterns:us,defaultMatchWidth:"wide",parsePatterns:cs,defaultParseWidth:"any"}),quarter:gt({matchPatterns:ds,defaultMatchWidth:"wide",parsePatterns:hs,defaultParseWidth:"any",valueCallback:n=>n+1}),month:gt({matchPatterns:ps,defaultMatchWidth:"wide",parsePatterns:fs,defaultParseWidth:"any"}),day:gt({matchPatterns:ms,defaultMatchWidth:"wide",parsePatterns:vs,defaultParseWidth:"any"}),dayPeriod:gt({matchPatterns:gs,defaultMatchWidth:"any",parsePatterns:ys,defaultParseWidth:"any"})},ks={code:"en-US",formatDistance:Wa,formatLong:za,formatRelative:Ga,localize:rs,match:bs,options:{weekStartsOn:0,firstWeekContainsDate:1}};let _s={};function Gt(){return _s}const qr=6048e5,ws=864e5,On=Symbol.for("constructDateFrom");function Le(n,e){return typeof n=="function"?n(e):n&&typeof n=="object"&&On in n?n[On](e):n instanceof Date?new n.constructor(e):new Date(e)}function ge(n,e){return Le(e||n,n)}function In(n){const e=ge(n),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+n-+t}function Es(n,...e){const t=Le.bind(null,e.find(r=>typeof r=="object"));return e.map(t)}function Rn(n,e){const t=ge(n,e==null?void 0:e.in);return t.setHours(0,0,0,0),t}function As(n,e,t){const[r,a]=Es(t==null?void 0:t.in,n,e),s=Rn(r),o=Rn(a),l=+s-In(s),u=+o-In(o);return Math.round((l-u)/ws)}function xs(n,e){const t=ge(n,e==null?void 0:e.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}function Ms(n,e){const t=ge(n,e==null?void 0:e.in);return As(t,xs(t))+1}function _t(n,e){var l,u,d,c;const t=Gt(),r=(e==null?void 0:e.weekStartsOn)??((u=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:u.weekStartsOn)??t.weekStartsOn??((c=(d=t.locale)==null?void 0:d.options)==null?void 0:c.weekStartsOn)??0,a=ge(n,e==null?void 0:e.in),s=a.getDay(),o=(s<r?7:0)+s-r;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function Yt(n,e){return _t(n,{...e,weekStartsOn:1})}function Gr(n,e){const t=ge(n,e==null?void 0:e.in),r=t.getFullYear(),a=Le(t,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const s=Yt(a),o=Le(t,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const l=Yt(o);return t.getTime()>=s.getTime()?r+1:t.getTime()>=l.getTime()?r:r-1}function Ds(n,e){const t=Gr(n,e),r=Le(n,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),Yt(r)}function Bs(n,e){const t=ge(n,e==null?void 0:e.in),r=+Yt(t)-+Ds(t);return Math.round(r/qr)+1}function Zr(n,e){var c,h,f,p;const t=ge(n,e==null?void 0:e.in),r=t.getFullYear(),a=Gt(),s=(e==null?void 0:e.firstWeekContainsDate)??((h=(c=e==null?void 0:e.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??a.firstWeekContainsDate??((p=(f=a.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=Le((e==null?void 0:e.in)||n,0);o.setFullYear(r+1,0,s),o.setHours(0,0,0,0);const l=_t(o,e),u=Le((e==null?void 0:e.in)||n,0);u.setFullYear(r,0,s),u.setHours(0,0,0,0);const d=_t(u,e);return+t>=+l?r+1:+t>=+d?r:r-1}function Ss(n,e){var l,u,d,c;const t=Gt(),r=(e==null?void 0:e.firstWeekContainsDate)??((u=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:u.firstWeekContainsDate)??t.firstWeekContainsDate??((c=(d=t.locale)==null?void 0:d.options)==null?void 0:c.firstWeekContainsDate)??1,a=Zr(n,e),s=Le((e==null?void 0:e.in)||n,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),_t(s,e)}function Ts(n,e){const t=ge(n,e==null?void 0:e.in),r=+_t(t,e)-+Ss(t,e);return Math.round(r/qr)+1}function X(n,e){const t=n<0?"-":"",r=Math.abs(n).toString().padStart(e,"0");return t+r}const Oe={y(n,e){const t=n.getFullYear(),r=t>0?t:1-t;return X(e==="yy"?r%100:r,e.length)},M(n,e){const t=n.getMonth();return e==="M"?String(t+1):X(t+1,2)},d(n,e){return X(n.getDate(),e.length)},a(n,e){const t=n.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(n,e){return X(n.getHours()%12||12,e.length)},H(n,e){return X(n.getHours(),e.length)},m(n,e){return X(n.getMinutes(),e.length)},s(n,e){return X(n.getSeconds(),e.length)},S(n,e){const t=e.length,r=n.getMilliseconds(),a=Math.trunc(r*Math.pow(10,t-3));return X(a,e.length)}},Je={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ln={G:function(n,e,t){const r=n.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(r,{width:"abbreviated"});case"GGGGG":return t.era(r,{width:"narrow"});case"GGGG":default:return t.era(r,{width:"wide"})}},y:function(n,e,t){if(e==="yo"){const r=n.getFullYear(),a=r>0?r:1-r;return t.ordinalNumber(a,{unit:"year"})}return Oe.y(n,e)},Y:function(n,e,t,r){const a=Zr(n,r),s=a>0?a:1-a;if(e==="YY"){const o=s%100;return X(o,2)}return e==="Yo"?t.ordinalNumber(s,{unit:"year"}):X(s,e.length)},R:function(n,e){const t=Gr(n);return X(t,e.length)},u:function(n,e){const t=n.getFullYear();return X(t,e.length)},Q:function(n,e,t){const r=Math.ceil((n.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return X(r,2);case"Qo":return t.ordinalNumber(r,{unit:"quarter"});case"QQQ":return t.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(r,{width:"wide",context:"formatting"})}},q:function(n,e,t){const r=Math.ceil((n.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return X(r,2);case"qo":return t.ordinalNumber(r,{unit:"quarter"});case"qqq":return t.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(r,{width:"wide",context:"standalone"})}},M:function(n,e,t){const r=n.getMonth();switch(e){case"M":case"MM":return Oe.M(n,e);case"Mo":return t.ordinalNumber(r+1,{unit:"month"});case"MMM":return t.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(r,{width:"wide",context:"formatting"})}},L:function(n,e,t){const r=n.getMonth();switch(e){case"L":return String(r+1);case"LL":return X(r+1,2);case"Lo":return t.ordinalNumber(r+1,{unit:"month"});case"LLL":return t.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(r,{width:"wide",context:"standalone"})}},w:function(n,e,t,r){const a=Ts(n,r);return e==="wo"?t.ordinalNumber(a,{unit:"week"}):X(a,e.length)},I:function(n,e,t){const r=Bs(n);return e==="Io"?t.ordinalNumber(r,{unit:"week"}):X(r,e.length)},d:function(n,e,t){return e==="do"?t.ordinalNumber(n.getDate(),{unit:"date"}):Oe.d(n,e)},D:function(n,e,t){const r=Ms(n);return e==="Do"?t.ordinalNumber(r,{unit:"dayOfYear"}):X(r,e.length)},E:function(n,e,t){const r=n.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(r,{width:"short",context:"formatting"});case"EEEE":default:return t.day(r,{width:"wide",context:"formatting"})}},e:function(n,e,t,r){const a=n.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return X(s,2);case"eo":return t.ordinalNumber(s,{unit:"day"});case"eee":return t.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(a,{width:"short",context:"formatting"});case"eeee":default:return t.day(a,{width:"wide",context:"formatting"})}},c:function(n,e,t,r){const a=n.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return X(s,e.length);case"co":return t.ordinalNumber(s,{unit:"day"});case"ccc":return t.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(a,{width:"narrow",context:"standalone"});case"cccccc":return t.day(a,{width:"short",context:"standalone"});case"cccc":default:return t.day(a,{width:"wide",context:"standalone"})}},i:function(n,e,t){const r=n.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return X(a,e.length);case"io":return t.ordinalNumber(a,{unit:"day"});case"iii":return t.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(r,{width:"short",context:"formatting"});case"iiii":default:return t.day(r,{width:"wide",context:"formatting"})}},a:function(n,e,t){const a=n.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(n,e,t){const r=n.getHours();let a;switch(r===12?a=Je.noon:r===0?a=Je.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(n,e,t){const r=n.getHours();let a;switch(r>=17?a=Je.evening:r>=12?a=Je.afternoon:r>=4?a=Je.morning:a=Je.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(n,e,t){if(e==="ho"){let r=n.getHours()%12;return r===0&&(r=12),t.ordinalNumber(r,{unit:"hour"})}return Oe.h(n,e)},H:function(n,e,t){return e==="Ho"?t.ordinalNumber(n.getHours(),{unit:"hour"}):Oe.H(n,e)},K:function(n,e,t){const r=n.getHours()%12;return e==="Ko"?t.ordinalNumber(r,{unit:"hour"}):X(r,e.length)},k:function(n,e,t){let r=n.getHours();return r===0&&(r=24),e==="ko"?t.ordinalNumber(r,{unit:"hour"}):X(r,e.length)},m:function(n,e,t){return e==="mo"?t.ordinalNumber(n.getMinutes(),{unit:"minute"}):Oe.m(n,e)},s:function(n,e,t){return e==="so"?t.ordinalNumber(n.getSeconds(),{unit:"second"}):Oe.s(n,e)},S:function(n,e){return Oe.S(n,e)},X:function(n,e,t){const r=n.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return Yn(r);case"XXXX":case"XX":return Ue(r);case"XXXXX":case"XXX":default:return Ue(r,":")}},x:function(n,e,t){const r=n.getTimezoneOffset();switch(e){case"x":return Yn(r);case"xxxx":case"xx":return Ue(r);case"xxxxx":case"xxx":default:return Ue(r,":")}},O:function(n,e,t){const r=n.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Nn(r,":");case"OOOO":default:return"GMT"+Ue(r,":")}},z:function(n,e,t){const r=n.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Nn(r,":");case"zzzz":default:return"GMT"+Ue(r,":")}},t:function(n,e,t){const r=Math.trunc(+n/1e3);return X(r,e.length)},T:function(n,e,t){return X(+n,e.length)}};function Nn(n,e=""){const t=n>0?"-":"+",r=Math.abs(n),a=Math.trunc(r/60),s=r%60;return s===0?t+String(a):t+String(a)+e+X(s,2)}function Yn(n,e){return n%60===0?(n>0?"-":"+")+X(Math.abs(n)/60,2):Ue(n,e)}function Ue(n,e=""){const t=n>0?"-":"+",r=Math.abs(n),a=X(Math.trunc(r/60),2),s=X(r%60,2);return t+a+e+s}const Pn=(n,e)=>{switch(n){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Kr=(n,e)=>{switch(n){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Cs=(n,e)=>{const t=n.match(/(P+)(p+)?/)||[],r=t[1],a=t[2];if(!a)return Pn(n,e);let s;switch(r){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",Pn(r,e)).replace("{{time}}",Kr(a,e))},Vs={p:Kr,P:Cs},Fs=/^D+$/,Os=/^Y+$/,Is=["D","DD","YY","YYYY"];function Rs(n){return Fs.test(n)}function Ls(n){return Os.test(n)}function Ns(n,e,t){const r=Ys(n,e,t);if(console.warn(r),Is.includes(n))throw new RangeError(r)}function Ys(n,e,t){const r=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${e}\`) for formatting ${r} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function Ps(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Hs(n){return!(!Ps(n)&&typeof n!="number"||isNaN(+ge(n)))}const $s=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ws=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Us=/^'([^]*?)'?$/,Xs=/''/g,js=/[a-zA-Z]/;function Qr(n,e,t){var c,h,f,p,v,w,k,S;const r=Gt(),a=(t==null?void 0:t.locale)??r.locale??ks,s=(t==null?void 0:t.firstWeekContainsDate)??((h=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=(t==null?void 0:t.weekStartsOn)??((w=(v=t==null?void 0:t.locale)==null?void 0:v.options)==null?void 0:w.weekStartsOn)??r.weekStartsOn??((S=(k=r.locale)==null?void 0:k.options)==null?void 0:S.weekStartsOn)??0,l=ge(n,t==null?void 0:t.in);if(!Hs(l))throw new RangeError("Invalid time value");let u=e.match(Ws).map(y=>{const b=y[0];if(b==="p"||b==="P"){const x=Vs[b];return x(y,a.formatLong)}return y}).join("").match($s).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const b=y[0];if(b==="'")return{isToken:!1,value:zs(y)};if(Ln[b])return{isToken:!0,value:y};if(b.match(js))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:y}});a.localize.preprocessor&&(u=a.localize.preprocessor(l,u));const d={firstWeekContainsDate:s,weekStartsOn:o,locale:a};return u.map(y=>{if(!y.isToken)return y.value;const b=y.value;(!(t!=null&&t.useAdditionalWeekYearTokens)&&Ls(b)||!(t!=null&&t.useAdditionalDayOfYearTokens)&&Rs(b))&&Ns(b,e,String(n));const x=Ln[b[0]];return x(l,b,a.localize,d)}).join("")}function zs(n){const e=n.match(Us);return e?e[1].replace(Xs,"'"):n}const G=n=>!!n&&n instanceof Date&&!Number.isNaN(new Date(n).valueOf());function Re(n){return typeof n=="string"||n instanceof String}function Hn(n){var e;return typeof n=="object"&&n!=null&&(n==null||(e=n.constructor)==null?void 0:e.name)==="Object"}function Jr(n,e){return Array.isArray(e)?Jr(n,(t,r)=>e.includes(r)):Object.entries(n).reduce((t,r)=>{let[a,s]=r;return e(s,a)&&(t[a]=s),t},{})}const Y={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function qs(n){switch(n){case Y.LEFT:return Y.FORCE_LEFT;case Y.RIGHT:return Y.FORCE_RIGHT;default:return n}}function an(n){return n.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function Pt(n,e){if(e===n)return!0;const t=Array.isArray(e),r=Array.isArray(n);let a;if(t&&r){if(e.length!=n.length)return!1;for(a=0;a<e.length;a++)if(!Pt(e[a],n[a]))return!1;return!0}if(t!=r)return!1;if(e&&n&&typeof e=="object"&&typeof n=="object"){const s=e instanceof Date,o=n instanceof Date;if(s&&o)return e.getTime()==n.getTime();if(s!=o)return!1;const l=e instanceof RegExp,u=n instanceof RegExp;if(l&&u)return e.toString()==n.toString();if(l!=u)return!1;const d=Object.keys(e);for(a=0;a<d.length;a++)if(!Object.prototype.hasOwnProperty.call(n,d[a]))return!1;for(a=0;a<d.length;a++)if(!Pt(n[d[a]],e[d[a]]))return!1;return!0}else if(e&&n&&typeof e=="function"&&typeof n=="function")return e.toString()===n.toString();return!1}class Gs{constructor(e){for(Object.assign(this,e);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?Y.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?Y.RIGHT:Y.LEFT}}function F(n,e){return new F.InputMask(n,e)}function ea(n){if(n==null)throw new Error("mask property should be defined");return n instanceof RegExp?F.MaskedRegExp:Re(n)?F.MaskedPattern:n===Date?F.MaskedDate:n===Number?F.MaskedNumber:Array.isArray(n)||n===Array?F.MaskedDynamic:F.Masked&&n.prototype instanceof F.Masked?n:F.Masked&&n instanceof F.Masked?n.constructor:n instanceof Function?F.MaskedFunction:(console.warn("Mask not found for mask",n),F.Masked)}function wt(n){if(!n)throw new Error("Options in not defined");if(F.Masked){if(n.prototype instanceof F.Masked)return{mask:n};const{mask:e=void 0,...t}=n instanceof F.Masked?{mask:n}:Hn(n)&&n.mask instanceof F.Masked?n:{};if(e){const r=e.mask;return{...Jr(e,(a,s)=>!s.startsWith("_")),mask:e.constructor,_mask:r,...t}}}return Hn(n)?{...n}:{mask:n}}function De(n){if(F.Masked&&n instanceof F.Masked)return n;const e=wt(n),t=ea(e.mask);if(!t)throw new Error("Masked class is not found for provided mask "+e.mask+", appropriate module needs to be imported manually before creating mask.");return e.mask===t&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new t(e)}F.createMask=De;class _n{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return e??this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return e??this.value.length}select(e,t){if(!(e==null||t==null||e===this.selectionStart&&t===this.selectionEnd))try{this._unsafeSelect(e,t)}catch{}}get isActive(){return!1}}F.MaskElement=_n;const $n=90,Zs=89;class Zt extends _n{constructor(e){super(),this.input=e,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var e,t,r;return(e=(t=(r=this.input).getRootNode)==null?void 0:t.call(r))!=null?e:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",e.drop),this.input.addEventListener("click",e.click),this.input.addEventListener("focus",e.focus),this.input.addEventListener("blur",e.commit),this._handlers=e}_onKeydown(e){if(this._handlers.redo&&(e.keyCode===$n&&e.shiftKey&&(e.metaKey||e.ctrlKey)||e.keyCode===Zs&&e.ctrlKey))return e.preventDefault(),this._handlers.redo(e);if(this._handlers.undo&&e.keyCode===$n&&(e.metaKey||e.ctrlKey))return e.preventDefault(),this._handlers.undo(e);e.isComposing||this._handlers.selectionChange(e)}_onBeforeinput(e){if(e.inputType==="historyUndo"&&this._handlers.undo)return e.preventDefault(),this._handlers.undo(e);if(e.inputType==="historyRedo"&&this._handlers.redo)return e.preventDefault(),this._handlers.redo(e)}_onCompositionEnd(e){this._handlers.input(e)}_onInput(e){e.isComposing||this._handlers.input(e)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}F.HTMLMaskElement=Zt;class Ks extends Zt{constructor(e){super(e),this.input=e}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,t){this.input.setSelectionRange(e,t)}get value(){return this.input.value}set value(e){this.input.value=e}}F.HTMLMaskElement=Zt;class ta extends Zt{get _unsafeSelectionStart(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),r=t&&t.anchorOffset,a=t&&t.focusOffset;return a==null||r==null||r<a?r:a}get _unsafeSelectionEnd(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),r=t&&t.anchorOffset,a=t&&t.focusOffset;return a==null||r==null||r>a?r:a}_unsafeSelect(e,t){if(!this.rootElement.createRange)return;const r=this.rootElement.createRange();r.setStart(this.input.firstChild||this.input,e),r.setEnd(this.input.lastChild||this.input,t);const a=this.rootElement,s=a.getSelection&&a.getSelection();s&&(s.removeAllRanges(),s.addRange(r))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}F.HTMLContenteditableMaskElement=ta;class Kt{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(e){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(e),this.states.length>Kt.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(e){return this.currentIndex=Math.min(Math.max(this.currentIndex+e,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}Kt.MAX_LENGTH=100;class Qs{constructor(e,t){this.el=e instanceof _n?e:e.isContentEditable&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"?new ta(e):new Ks(e),this.masked=De(t),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new Kt,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(e){var t;return e==null||((t=this.masked)==null?void 0:t.maskEquals(e))}get mask(){return this.masked.mask}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof F.Masked)&&this.masked.constructor===ea(e)){this.masked.updateOptions({mask:e});return}const t=e instanceof F.Masked?e:De({mask:e});t.unmaskedValue=this.masked.unmaskedValue,this.masked=t}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(e){this.rawInputValue!==e&&(this.masked.rawInputValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(e,t){const r=this._listeners[e];r&&r.forEach(a=>a(t))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){!this.el||!this.el.isActive||(this.el.select(e,e),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(e){const t=this.masked.unmaskedValue,r=this.masked.value,a=this.masked.rawInputValue,s=this.displayValue,o=this.unmaskedValue!==t||this.value!==r||this._rawInputValue!==a;this._unmaskedValue=t,this._value=r,this._rawInputValue=a,this.el.value!==s&&(this.el.value=s),e==="auto"?this.alignCursor():e!=null&&(this.cursorPos=e),o&&this._fireChangeEvents(),!this._historyChanging&&(o||this.history.isEmpty)&&this.history.push({unmaskedValue:t,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(e){const{mask:t,...r}=e,a=!this.maskEquals(t),s=this.masked.optionsIsChanged(r);a&&(this.mask=t),s&&this.masked.updateOptions(r),(a||s)&&this.updateControl()}updateCursor(e){e!=null&&(this.cursorPos=e,this._delayUpdateCursor(e))}_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,Y.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,t){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t),this}off(e,t){if(!this._listeners[e])return this;if(!t)return delete this._listeners[e],this;const r=this._listeners[e].indexOf(t);return r>=0&&this._listeners[e].splice(r,1),this}_onInput(e){this._inputEvent=e,this._abortUpdateCursor();const t=new Gs({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),r=this.masked.rawInputValue,a=this.masked.splice(t.startChangePos,t.removed.length,t.inserted,t.removeDirection,{input:!0,raw:!0}).offset,s=r===this.masked.rawInputValue?t.removeDirection:Y.NONE;let o=this.masked.nearestInputPos(t.startChangePos+a,s);s!==Y.NONE&&(o=this.masked.nearestInputPos(o,Y.NONE)),this.updateControl(o),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(e){e&&(this._historyChanging=!0,this.unmaskedValue=e.unmaskedValue,this.el.select(e.selection.start,e.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}F.InputMask=Qs;class ${static normalize(e){return Array.isArray(e)?e:[e,new $]}constructor(e){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},e)}aggregate(e){return this.inserted+=e.inserted,this.rawInserted+=e.rawInserted,this.tailShift+=e.tailShift,this.skip=this.skip||e.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(e){return this.inserted===e.inserted&&this.tailShift===e.tailShift&&this.rawInserted===e.rawInserted&&this.skip===e.skip}}F.ChangeDetails=$;class be{constructor(e,t,r){e===void 0&&(e=""),t===void 0&&(t=0),this.value=e,this.from=t,this.stop=r}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||e!=null&&this.from>=e)return"";const t=this.value[0];return this.value=this.value.slice(1),t}shift(){if(!this.value.length)return"";const e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class ee{constructor(e){this._value="",this._update({...ee.DEFAULTS,...e}),this._initialized=!0}updateOptions(e){this.optionsIsChanged(e)&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e,{input:!0})}resolve(e,t){t===void 0&&(t={input:!0}),this.reset(),this.append(e,t,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(e){this.resolve(e,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(e){this.format?this.value=this.format(e,this):this.unmaskedValue=String(e)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(e){this.resolve(e,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,t){return e}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),Math.min(this.displayValue.length,t-e)}extractInput(e,t,r){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),this.displayValue.slice(e,t)}extractTail(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),new be(this.extractInput(e,t),e)}appendTail(e){return Re(e)&&(e=new be(String(e))),e.appendTo(this)}_appendCharRaw(e,t){return e?(this._value+=e,new $({inserted:e,rawInserted:e})):new $}_appendChar(e,t,r){t===void 0&&(t={});const a=this.state;let s;if([e,s]=this.doPrepareChar(e,t),e&&(s=s.aggregate(this._appendCharRaw(e,t)),!s.rawInserted&&this.autofix==="pad")){const o=this.state;this.state=a;let l=this.pad(t);const u=this._appendCharRaw(e,t);l=l.aggregate(u),u.rawInserted||l.equals(s)?s=l:this.state=o}if(s.inserted){let o,l=this.doValidate(t)!==!1;if(l&&r!=null){const u=this.state;if(this.overwrite===!0){o=r.state;for(let c=0;c<s.rawInserted.length;++c)r.unshift(this.displayValue.length-s.tailShift)}let d=this.appendTail(r);if(l=d.rawInserted.length===r.toString().length,!(l&&d.inserted)&&this.overwrite==="shift"){this.state=u,o=r.state;for(let c=0;c<s.rawInserted.length;++c)r.shift();d=this.appendTail(r),l=d.rawInserted.length===r.toString().length}l&&d.inserted&&(this.state=u)}l||(s=new $,this.state=a,r&&o&&(r.state=o))}return s}_appendPlaceholder(){return new $}_appendEager(){return new $}append(e,t,r){if(!Re(e))throw new Error("value should be string");const a=Re(r)?new be(String(r)):r;t!=null&&t.tail&&(t._beforeTailState=this.state);let s;[e,s]=this.doPrepare(e,t);for(let o=0;o<e.length;++o){const l=this._appendChar(e[o],t,a);if(!l.rawInserted&&!this.doSkipInvalid(e[o],t,a))break;s.aggregate(l)}return(this.eager===!0||this.eager==="append")&&t!=null&&t.input&&e&&s.aggregate(this._appendEager()),a!=null&&(s.tailShift+=this.appendTail(a).tailShift),s}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),this._value=this.displayValue.slice(0,e)+this.displayValue.slice(t),new $}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;const t=this.rawInputValue,r=this.value,a=e();return this.rawInputValue=t,this.value&&this.value!==r&&r.indexOf(this.value)===0&&(this.append(r.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,a}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;const t=this.state,r=e(this);return this.state=t,delete this._isolated,r}doSkipInvalid(e,t,r){return!!this.skipInvalid}doPrepare(e,t){return t===void 0&&(t={}),$.normalize(this.prepare?this.prepare(e,this,t):e)}doPrepareChar(e,t){return t===void 0&&(t={}),$.normalize(this.prepareChar?this.prepareChar(e,this,t):e)}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}splice(e,t,r,a,s){r===void 0&&(r=""),a===void 0&&(a=Y.NONE),s===void 0&&(s={input:!0});const o=e+t,l=this.extractTail(o),u=this.eager===!0||this.eager==="remove";let d;u&&(a=qs(a),d=this.extractInput(0,o,{raw:!0}));let c=e;const h=new $;if(a!==Y.NONE&&(c=this.nearestInputPos(e,t>1&&e!==0&&!u?Y.NONE:a),h.tailShift=c-e),h.aggregate(this.remove(c)),u&&a!==Y.NONE&&d===this.rawInputValue)if(a===Y.FORCE_LEFT){let f;for(;d===this.rawInputValue&&(f=this.displayValue.length);)h.aggregate(new $({tailShift:-1})).aggregate(this.remove(f-1))}else a===Y.FORCE_RIGHT&&l.unshift();return h.aggregate(this.append(r,s,l))}maskEquals(e){return this.mask===e}optionsIsChanged(e){return!Pt(this,e)}typedValueEquals(e){const t=this.typedValue;return e===t||ee.EMPTY_VALUES.includes(e)&&ee.EMPTY_VALUES.includes(t)||(this.format?this.format(e,this)===this.format(this.typedValue,this):!1)}pad(e){return new $}}ee.DEFAULTS={skipInvalid:!0};ee.EMPTY_VALUES=[void 0,null,""];F.Masked=ee;class ze{constructor(e,t){e===void 0&&(e=[]),t===void 0&&(t=0),this.chunks=e,this.from=t}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;e=Re(e)?new be(String(e)):e;const t=this.chunks[this.chunks.length-1],r=t&&(t.stop===e.stop||e.stop==null)&&e.from===t.from+t.toString().length;if(e instanceof be)r?t.extend(e.toString()):this.chunks.push(e);else if(e instanceof ze){if(e.stop==null){let a;for(;e.chunks.length&&e.chunks[0].stop==null;)a=e.chunks.shift(),a.from+=e.from,this.extend(a)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof F.MaskedPattern))return new be(this.toString()).appendTo(e);const t=new $;for(let r=0;r<this.chunks.length;++r){const a=this.chunks[r],s=e._mapPosToBlock(e.displayValue.length),o=a.stop;let l;if(o!=null&&(!s||s.index<=o)&&((a instanceof ze||e._stops.indexOf(o)>=0)&&t.aggregate(e._appendPlaceholder(o)),l=a instanceof ze&&e._blocks[o]),l){const u=l.appendTail(a);t.aggregate(u);const d=a.toString().slice(u.rawInserted.length);d&&t.aggregate(e.append(d,{tail:!0}))}else t.aggregate(e.append(a.toString(),{tail:!0}))}return t}get state(){return{chunks:this.chunks.map(e=>e.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){const{chunks:t,...r}=e;Object.assign(this,r),this.chunks=t.map(a=>{const s="chunks"in a?new ze:new be;return s.state=a,s})}unshift(e){if(!this.chunks.length||e!=null&&this.from>=e)return"";const t=e!=null?e-this.from:e;let r=0;for(;r<this.chunks.length;){const a=this.chunks[r],s=a.unshift(t);if(a.toString()){if(!s)break;++r}else this.chunks.splice(r,1);if(s)return s}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){const t=this.chunks[e],r=t.shift();if(t.toString()){if(!r)break;--e}else this.chunks.splice(e,1);if(r)return r}return""}}class Js{constructor(e,t){this.masked=e,this._log=[];const{offset:r,index:a}=e._mapPosToBlock(t)||(t<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=r,this.index=a,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){const e=this._log.pop();return e&&(this.state=e),e}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((t=this.block)==null?void 0:t.displayValue.length)||0){var t;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,Y.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Y.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Y.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,Y.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Y.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Y.NONE),!0})}}class na{constructor(e){Object.assign(this,e),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),this._value=this._value.slice(0,e)+this._value.slice(t),this._value||(this._isRawInput=!1),new $}nearestInputPos(e,t){t===void 0&&(t=Y.NONE);const r=0,a=this._value.length;switch(t){case Y.LEFT:case Y.FORCE_LEFT:return r;case Y.NONE:case Y.RIGHT:case Y.FORCE_RIGHT:default:return a}}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),this._isRawInput?t-e:0}extractInput(e,t,r){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),r===void 0&&(r={}),r.raw&&this._isRawInput&&this._value.slice(e,t)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(e,t){if(t===void 0&&(t={}),this.isFilled)return new $;const r=this.eager===!0||this.eager==="append",s=this.char===e&&(this.isUnmasking||t.input||t.raw)&&(!t.raw||!r)&&!t.tail,o=new $({inserted:this.char,rawInserted:s?this.char:""});return this._value=this.char,this._isRawInput=s&&(t.raw||t.input),o}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const e=new $;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new be("")}appendTail(e){return Re(e)&&(e=new be(String(e))),e.appendTo(this)}append(e,t,r){const a=this._appendChar(e[0],t);return r!=null&&(a.tailShift+=this.appendTail(r).tailShift),a}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=!!e._rawInputValue}pad(e){return this._appendPlaceholder()}}class Ht{constructor(e){const{parent:t,isOptional:r,placeholderChar:a,displayChar:s,lazy:o,eager:l,...u}=e;this.masked=De(u),Object.assign(this,{parent:t,isOptional:r,placeholderChar:a,displayChar:s,lazy:o,eager:l})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),e===0&&t>=1?(this.isFilled=!1,this.masked.remove(e,t)):new $}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(e,t){if(t===void 0&&(t={}),this.isFilled)return new $;const r=this.masked.state;let a=this.masked._appendChar(e,this.currentMaskFlags(t));return a.inserted&&this.doValidate(t)===!1&&(a=new $,this.masked.state=r),!a.inserted&&!this.isOptional&&!this.lazy&&!t.input&&(a.inserted=this.placeholderChar),a.skip=!a.inserted&&!this.isOptional,this.isFilled=!!a.inserted,a}append(e,t,r){return this.masked.append(e,this.currentMaskFlags(t),r)}_appendPlaceholder(){return this.isFilled||this.isOptional?new $:(this.isFilled=!0,new $({inserted:this.placeholderChar}))}_appendEager(){return new $}extractTail(e,t){return this.masked.extractTail(e,t)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,t,r){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),this.masked.extractInput(e,t,r)}nearestInputPos(e,t){t===void 0&&(t=Y.NONE);const r=0,a=this.value.length,s=Math.min(Math.max(e,r),a);switch(t){case Y.LEFT:case Y.FORCE_LEFT:return this.isComplete?s:r;case Y.RIGHT:case Y.FORCE_RIGHT:return this.isComplete?s:a;case Y.NONE:default:return s}}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),this.value.slice(e,t).length}doValidate(e){return this.masked.doValidate(this.currentMaskFlags(e))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(e)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}currentMaskFlags(e){var t;return{...e,_beforeTailState:(e==null||(t=e._beforeTailState)==null?void 0:t.masked)||(e==null?void 0:e._beforeTailState)}}pad(e){return new $}}Ht.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0