import{r as W,j as h,R as y}from"./app-BGey7YPf.js";import{T as Tn}from"./textarea-B31u9E-S.js";import{L as ge}from"./label-BbSRpehS.js";import{c as Xe,a as E,B as le,b as at}from"./button-D5r5edT8.js";import{S as st,a as ot,b as it,c as ct,d as je}from"./select-BqSuhmAT.js";import{P as _n,b as En,c as Yn,I as Pn,a as jn}from"./input-select-DHdS_tES.js";import{h as Fn}from"./has-role-XA1xdWi8.js";import{C as vt}from"./chevron-left-7ssMp1N3.js";import{C as xt}from"./chevron-right-CE_1krjA.js";import{X as Bn}from"./x-C4WIHhXm.js";import{L as In,S as An}from"./save-Bm3_KHjE.js";import"./index-BFyaOBDQ.js";import"./index-Q2wK6uZI.js";import"./index-CwO5dfCw.js";import"./index-BuSoVzfP.js";import"./chevron-down-DOZGaFlM.js";import"./dialog-OAe1w9Cd.js";import"./search-CA9JuCC9.js";import"./separator-Di-l93J0.js";/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Hn=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],qn=Xe("Calendar",Hn);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $n=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Rn=Xe("KeyRound",$n);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Gn=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],zn=Xe("RefreshCcw",Gn),Ot=W.forwardRef(({className:t,onGenerate:e,disabled:n,...r},a)=>h.jsxs("div",{className:"relative flex items-center",children:[h.jsx("div",{className:"absolute left-3 text-gray-400 dark:text-gray-500",children:h.jsx(Rn,{className:"w-4 h-4"})}),h.jsx("input",{ref:a,className:E("flex h-9 w-full rounded-md border px-10 pr-24 py-2 text-sm","border-gray-300 bg-white text-gray-900 placeholder:text-gray-500","hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary","transition-all duration-200 ease-in-out","disabled:cursor-not-allowed disabled:opacity-50","dark:border-zinc-700 dark:bg-zinc-900 dark:text-gray-100","dark:placeholder:text-gray-400 dark:focus:ring-primary/30 dark:focus:border-primary",t),autoComplete:"off",autoFocus:!1,disabled:n,...r}),e&&h.jsx("div",{className:"absolute right-1.5",children:h.jsxs(le,{type:"button",size:"sm",variant:"outline",className:"text-xs px-2 py-1",onClick:e,disabled:n,children:[h.jsx(zn,{className:"w-3 h-3 mr-1"})," Generate"]})})]}));Ot.displayName="InputToken";const Nt=6048e5,Ln=864e5,Ct=6e4,pt=36e5,ut=Symbol.for("constructDateFrom");function B(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&ut in t?t[ut](e):t instanceof Date?new t.constructor(e):new Date(e)}function S(t,e){return B(e||t,t)}function Wt(t,e,n){const r=S(t,n==null?void 0:n.in);return isNaN(e)?B(t,NaN):(e&&r.setDate(r.getDate()+e),r)}function St(t,e,n){const r=S(t,n==null?void 0:n.in);if(isNaN(e))return B(t,NaN);if(!e)return r;const a=r.getDate(),s=B(t,r.getTime());s.setMonth(r.getMonth()+e+1,0);const i=s.getDate();return a>=i?s:(r.setFullYear(s.getFullYear(),s.getMonth(),a),r)}let Zn={};function We(){return Zn}function we(t,e){var o,c,d,u;const n=We(),r=(e==null?void 0:e.weekStartsOn)??((c=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,a=S(t,e==null?void 0:e.in),s=a.getDay(),i=(s<r?7:0)+s-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function Ce(t,e){return we(t,{...e,weekStartsOn:1})}function Tt(t,e){const n=S(t,e==null?void 0:e.in),r=n.getFullYear(),a=B(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const s=Ce(a),i=B(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const o=Ce(i);return n.getTime()>=s.getTime()?r+1:n.getTime()>=o.getTime()?r:r-1}function dt(t){const e=S(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function Me(t,...e){const n=B.bind(null,e.find(r=>typeof r=="object"));return e.map(n)}function pe(t,e){const n=S(t,e==null?void 0:e.in);return n.setHours(0,0,0,0),n}function ie(t,e,n){const[r,a]=Me(n==null?void 0:n.in,t,e),s=pe(r),i=pe(a),o=+s-dt(s),c=+i-dt(i);return Math.round((o-c)/Ln)}function Un(t,e){const n=Tt(t,e),r=B(t,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Ce(r)}function Qn(t,e,n){return Wt(t,e*7,n)}function Xn(t,e,n){return St(t,e*12,n)}function Vn(t,e){let n,r=e==null?void 0:e.in;return t.forEach(a=>{!r&&typeof a=="object"&&(r=B.bind(null,a));const s=S(a,r);(!n||n<s||isNaN(+s))&&(n=s)}),B(r,n||NaN)}function Jn(t,e){let n,r=e==null?void 0:e.in;return t.forEach(a=>{!r&&typeof a=="object"&&(r=B.bind(null,a));const s=S(a,r);(!n||n>s||isNaN(+s))&&(n=s)}),B(r,n||NaN)}function Kn(t,e,n){const[r,a]=Me(n==null?void 0:n.in,t,e);return+pe(r)==+pe(a)}function _t(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function er(t){return!(!_t(t)&&typeof t!="number"||isNaN(+S(t)))}function tr(t,e,n){const[r,a]=Me(n==null?void 0:n.in,t,e),s=r.getFullYear()-a.getFullYear(),i=r.getMonth()-a.getMonth();return s*12+i}function nr(t,e){const n=S(t,e==null?void 0:e.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function rr(t,e){const[n,r]=Me(t,e.start,e.end);return{start:n,end:r}}function ar(t,e){const{start:n,end:r}=rr(e==null?void 0:e.in,t);let a=+n>+r;const s=a?+n:+r,i=a?r:n;i.setHours(0,0,0,0),i.setDate(1);let o=1;const c=[];for(;+i<=s;)c.push(B(n,i)),i.setMonth(i.getMonth()+o);return a?c.reverse():c}function sr(t,e){const n=S(t,e==null?void 0:e.in);return n.setDate(1),n.setHours(0,0,0,0),n}function or(t,e){const n=S(t,e==null?void 0:e.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function Et(t,e){const n=S(t,e==null?void 0:e.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Yt(t,e){var o,c,d,u;const n=We(),r=(e==null?void 0:e.weekStartsOn)??((c=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,a=S(t,e==null?void 0:e.in),s=a.getDay(),i=(s<r?-7:0)+6-(s-r);return a.setDate(a.getDate()+i),a.setHours(23,59,59,999),a}function ir(t,e){return Yt(t,{...e,weekStartsOn:1})}const cr={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"}},ur=(t,e,n)=>{let r;const a=cr[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function $e(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const dr={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},lr={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},fr={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},hr={date:$e({formats:dr,defaultWidth:"full"}),time:$e({formats:lr,defaultWidth:"full"}),dateTime:$e({formats:fr,defaultWidth:"full"})},mr={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},yr=(t,e,n,r)=>mr[t];function De(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,o=n!=null&&n.width?String(n.width):i;a=t.formattingValues[o]||t.formattingValues[i]}else{const i=t.defaultWidth,o=n!=null&&n.width?String(n.width):t.defaultWidth;a=t.values[o]||t.values[i]}const s=t.argumentCallback?t.argumentCallback(e):e;return a[s]}}const gr={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},br={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},wr={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"]},Mr={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"]},kr={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"}},Dr={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"}},vr=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},xr={ordinalNumber:vr,era:De({values:gr,defaultWidth:"wide"}),quarter:De({values:br,defaultWidth:"wide",argumentCallback:t=>t-1}),month:De({values:wr,defaultWidth:"wide"}),day:De({values:Mr,defaultWidth:"wide"}),dayPeriod:De({values:kr,defaultWidth:"wide",formattingValues:Dr,defaultFormattingWidth:"wide"})};function ve(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=e.match(a);if(!s)return null;const i=s[0],o=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(o)?Nr(o,l=>l.test(i)):Or(o,l=>l.test(i));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const u=e.slice(i.length);return{value:d,rest:u}}}function Or(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Nr(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Cr(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],s=e.match(t.parsePattern);if(!s)return null;let i=t.valueCallback?t.valueCallback(s[0]):s[0];i=n.valueCallback?n.valueCallback(i):i;const o=e.slice(a.length);return{value:i,rest:o}}}const pr=/^(\d+)(th|st|nd|rd)?/i,Wr=/\d+/i,Sr={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},Tr={any:[/^b/i,/^(a|c)/i]},_r={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Er={any:[/1/i,/2/i,/3/i,/4/i]},Yr={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},Pr={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]},jr={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},Fr={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]},Br={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},Ir={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}},Ar={ordinalNumber:Cr({matchPattern:pr,parsePattern:Wr,valueCallback:t=>parseInt(t,10)}),era:ve({matchPatterns:Sr,defaultMatchWidth:"wide",parsePatterns:Tr,defaultParseWidth:"any"}),quarter:ve({matchPatterns:_r,defaultMatchWidth:"wide",parsePatterns:Er,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ve({matchPatterns:Yr,defaultMatchWidth:"wide",parsePatterns:Pr,defaultParseWidth:"any"}),day:ve({matchPatterns:jr,defaultMatchWidth:"wide",parsePatterns:Fr,defaultParseWidth:"any"}),dayPeriod:ve({matchPatterns:Br,defaultMatchWidth:"any",parsePatterns:Ir,defaultParseWidth:"any"})},Ve={code:"en-US",formatDistance:ur,formatLong:hr,formatRelative:yr,localize:xr,match:Ar,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Hr(t,e){const n=S(t,e==null?void 0:e.in);return ie(n,Et(n))+1}function Pt(t,e){const n=S(t,e==null?void 0:e.in),r=+Ce(n)-+Un(n);return Math.round(r/Nt)+1}function jt(t,e){var u,l,m,b;const n=S(t,e==null?void 0:e.in),r=n.getFullYear(),a=We(),s=(e==null?void 0:e.firstWeekContainsDate)??((l=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:l.firstWeekContainsDate)??a.firstWeekContainsDate??((b=(m=a.locale)==null?void 0:m.options)==null?void 0:b.firstWeekContainsDate)??1,i=B((e==null?void 0:e.in)||t,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const o=we(i,e),c=B((e==null?void 0:e.in)||t,0);c.setFullYear(r,0,s),c.setHours(0,0,0,0);const d=we(c,e);return+n>=+o?r+1:+n>=+d?r:r-1}function qr(t,e){var o,c,d,u;const n=We(),r=(e==null?void 0:e.firstWeekContainsDate)??((c=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,a=jt(t,e),s=B((e==null?void 0:e.in)||t,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),we(s,e)}function Ft(t,e){const n=S(t,e==null?void 0:e.in),r=+we(n,e)-+qr(n,e);return Math.round(r/Nt)+1}function _(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const oe={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return _(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):_(n+1,2)},d(t,e){return _(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return _(t.getHours()%12||12,e.length)},H(t,e){return _(t.getHours(),e.length)},m(t,e){return _(t.getMinutes(),e.length)},s(t,e){return _(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return _(a,e.length)}},be={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},lt={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return oe.y(t,e)},Y:function(t,e,n,r){const a=jt(t,r),s=a>0?a:1-a;if(e==="YY"){const i=s%100;return _(i,2)}return e==="Yo"?n.ordinalNumber(s,{unit:"year"}):_(s,e.length)},R:function(t,e){const n=Tt(t);return _(n,e.length)},u:function(t,e){const n=t.getFullYear();return _(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return _(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return _(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return oe.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return _(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=Ft(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):_(a,e.length)},I:function(t,e,n){const r=Pt(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):_(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):oe.d(t,e)},D:function(t,e,n){const r=Hr(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):_(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return _(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return _(s,e.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return _(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=be.noon:r===0?a=be.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=be.evening:r>=12?a=be.afternoon:r>=4?a=be.morning:a=be.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return oe.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):oe.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):_(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):_(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):oe.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):oe.s(t,e)},S:function(t,e){return oe.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return ht(r);case"XXXX":case"XX":return de(r);case"XXXXX":case"XXX":default:return de(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return ht(r);case"xxxx":case"xx":return de(r);case"xxxxx":case"xxx":default:return de(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ft(r,":");case"OOOO":default:return"GMT"+de(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ft(r,":");case"zzzz":default:return"GMT"+de(r,":")}},t:function(t,e,n){const r=Math.trunc(+t/1e3);return _(r,e.length)},T:function(t,e,n){return _(+t,e.length)}};function ft(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),s=r%60;return s===0?n+String(a):n+String(a)+e+_(s,2)}function ht(t,e){return t%60===0?(t>0?"-":"+")+_(Math.abs(t)/60,2):de(t,e)}function de(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=_(Math.trunc(r/60),2),s=_(r%60,2);return n+a+e+s}const mt=(t,e)=>{switch(t){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"})}},Bt=(t,e)=>{switch(t){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"})}},$r=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return mt(t,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}}",mt(r,e)).replace("{{time}}",Bt(a,e))},Rr={p:Bt,P:$r},Gr=/^D+$/,zr=/^Y+$/,Lr=["D","DD","YY","YYYY"];function Zr(t){return Gr.test(t)}function Ur(t){return zr.test(t)}function Qr(t,e,n){const r=Xr(t,e,n);if(console.warn(r),Lr.includes(t))throw new RangeError(r)}function Xr(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Vr=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Jr=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Kr=/^'([^]*?)'?$/,ea=/''/g,ta=/[a-zA-Z]/;function Ue(t,e,n){var u,l,m,b,k,M,v,D;const r=We(),a=(n==null?void 0:n.locale)??r.locale??Ve,s=(n==null?void 0:n.firstWeekContainsDate)??((l=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:l.firstWeekContainsDate)??r.firstWeekContainsDate??((b=(m=r.locale)==null?void 0:m.options)==null?void 0:b.firstWeekContainsDate)??1,i=(n==null?void 0:n.weekStartsOn)??((M=(k=n==null?void 0:n.locale)==null?void 0:k.options)==null?void 0:M.weekStartsOn)??r.weekStartsOn??((D=(v=r.locale)==null?void 0:v.options)==null?void 0:D.weekStartsOn)??0,o=S(t,n==null?void 0:n.in);if(!er(o))throw new RangeError("Invalid time value");let c=e.match(Jr).map(x=>{const g=x[0];if(g==="p"||g==="P"){const p=Rr[g];return p(x,a.formatLong)}return x}).join("").match(Vr).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const g=x[0];if(g==="'")return{isToken:!1,value:na(x)};if(lt[g])return{isToken:!0,value:x};if(g.match(ta))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:x}});a.localize.preprocessor&&(c=a.localize.preprocessor(o,c));const d={firstWeekContainsDate:s,weekStartsOn:i,locale:a};return c.map(x=>{if(!x.isToken)return x.value;const g=x.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Ur(g)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Zr(g))&&Qr(g,e,String(t));const p=lt[g[0]];return p(o,g,a.localize,d)}).join("")}function na(t){const e=t.match(Kr);return e?e[1].replace(ea,"'"):t}function ra(t,e){const n=S(t,e==null?void 0:e.in),r=n.getFullYear(),a=n.getMonth(),s=B(n,0);return s.setFullYear(r,a+1,0),s.setHours(0,0,0,0),s.getDate()}function aa(t,e){return S(t,e==null?void 0:e.in).getMonth()}function sa(t,e){return S(t,e==null?void 0:e.in).getFullYear()}function oa(t,e){return+S(t)>+S(e)}function ia(t,e){return+S(t)<+S(e)}function ca(t,e,n){const[r,a]=Me(n==null?void 0:n.in,t,e);return r.getFullYear()===a.getFullYear()&&r.getMonth()===a.getMonth()}function ua(t,e,n){const[r,a]=Me(n==null?void 0:n.in,t,e);return r.getFullYear()===a.getFullYear()}function yt(t,e){const n=()=>B(e==null?void 0:e.in,NaN),a=ha(t);let s;if(a.date){const d=ma(a.date,2);s=ya(d.restDateString,d.year)}if(!s||isNaN(+s))return n();const i=+s;let o=0,c;if(a.time&&(o=ga(a.time),isNaN(o)))return n();if(a.timezone){if(c=ba(a.timezone),isNaN(c))return n()}else{const d=new Date(i+o),u=S(0,e==null?void 0:e.in);return u.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),u.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),u}return S(i+o+c,e==null?void 0:e.in)}const Fe={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},da=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,la=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,fa=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ha(t){const e={},n=t.split(Fe.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],Fe.timeZoneDelimiter.test(e.date)&&(e.date=t.split(Fe.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const a=Fe.timezone.exec(r);a?(e.time=r.replace(a[1],""),e.timezone=a[1]):e.time=r}return e}function ma(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,s=r[2]?parseInt(r[2]):null;return{year:s===null?a:s*100,restDateString:t.slice((r[1]||r[2]).length)}}function ya(t,e){if(e===null)return new Date(NaN);const n=t.match(da);if(!n)return new Date(NaN);const r=!!n[4],a=xe(n[1]),s=xe(n[2])-1,i=xe(n[3]),o=xe(n[4]),c=xe(n[5])-1;if(r)return va(e,o,c)?wa(e,o,c):new Date(NaN);{const d=new Date(0);return!ka(e,s,i)||!Da(e,a)?new Date(NaN):(d.setUTCFullYear(e,s,Math.max(a,i)),d)}}function xe(t){return t?parseInt(t):1}function ga(t){const e=t.match(la);if(!e)return NaN;const n=Re(e[1]),r=Re(e[2]),a=Re(e[3]);return xa(n,r,a)?n*pt+r*Ct+a*1e3:NaN}function Re(t){return t&&parseFloat(t.replace(",","."))||0}function ba(t){if(t==="Z")return 0;const e=t.match(fa);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return Oa(r,a)?n*(r*pt+a*Ct):NaN}function wa(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const a=r.getUTCDay()||7,s=(e-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+s),r}const Ma=[31,null,31,30,31,30,31,31,30,31,30,31];function It(t){return t%400===0||t%4===0&&t%100!==0}function ka(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(Ma[e]||(It(t)?29:28))}function Da(t,e){return e>=1&&e<=(It(t)?366:365)}function va(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function xa(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function Oa(t,e){return e>=0&&e<=59}function Na(t,e,n){const r=S(t,n==null?void 0:n.in),a=r.getFullYear(),s=r.getDate(),i=B(t,0);i.setFullYear(a,e,15),i.setHours(0,0,0,0);const o=ra(i);return r.setMonth(e,Math.min(s,o)),r}function Ca(t,e,n){const r=S(t,n==null?void 0:n.in);return isNaN(+r)?B(t,NaN):(r.setFullYear(e),r)}const Ge={},Oe={};function Ne(t,e){try{const r=(Ge[t]||(Ge[t]=new Intl.DateTimeFormat("en-GB",{timeZone:t,hour:"numeric",timeZoneName:"longOffset"}).format))(e).split("GMT")[1]||"";return r in Oe?Oe[r]:gt(r,r.split(":"))}catch{if(t in Oe)return Oe[t];const n=t==null?void 0:t.match(pa);return n?gt(t,n.slice(1)):NaN}}const pa=/([+-]\d\d):?(\d\d)?/;function gt(t,e){const n=+e[0],r=+(e[1]||0);return Oe[t]=n>0?n*60+r:n*60-r}class K extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Ne(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),At(this),Qe(this)):this.setTime(Date.now())}static tz(e,...n){return n.length?new K(...n,e):new K(Date.now(),e)}withTimeZone(e){return new K(+this,e)}getTimezoneOffset(){return-Ne(this.timeZone,this)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Qe(this),+this}[Symbol.for("constructDateFrom")](e){return new K(+new Date(e),this.timeZone)}}const bt=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!bt.test(t))return;const e=t.replace(bt,"$1UTC");K.prototype[e]&&(t.startsWith("get")?K.prototype[t]=function(){return this.internal[e]()}:(K.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),Wa(this),+this},K.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),Qe(this),+this}))});function Qe(t){t.internal.setTime(+t),t.internal.setUTCMinutes(t.internal.getUTCMinutes()-t.getTimezoneOffset())}function Wa(t){Date.prototype.setFullYear.call(t,t.internal.getUTCFullYear(),t.internal.getUTCMonth(),t.internal.getUTCDate()),Date.prototype.setHours.call(t,t.internal.getUTCHours(),t.internal.getUTCMinutes(),t.internal.getUTCSeconds(),t.internal.getUTCMilliseconds()),At(t)}function At(t){const e=Ne(t.timeZone,t),n=new Date(+t);n.setUTCHours(n.getUTCHours()-1);const r=-new Date(+t).getTimezoneOffset(),a=-new Date(+n).getTimezoneOffset(),s=r-a,i=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();s&&i&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+s);const o=r-e;o&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+o);const c=Ne(t.timeZone,t),u=-new Date(+t).getTimezoneOffset()-c,l=c!==e,m=u-o;if(l&&m){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+m);const b=Ne(t.timeZone,t),k=c-b;k&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+k),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+k))}}class q extends K{static tz(e,...n){return n.length?new q(...n,e):new q(Date.now(),e)}toISOString(){const[e,n,r]=this.tzComponents(),a=`${e}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,n,r,a]=this.internal.toUTCString().split(" ");return`${e==null?void 0:e.slice(0,-1)} ${r} ${n} ${a}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[n,r,a]=this.tzComponents();return`${e} GMT${n}${r}${a} (${Sa(this.timeZone,this)})`}toLocaleString(e,n){return Date.prototype.toLocaleString.call(this,e,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(e,n){return Date.prototype.toLocaleDateString.call(this,e,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(e,n){return Date.prototype.toLocaleTimeString.call(this,e,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),n=e>0?"-":"+",r=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),a=String(Math.abs(e)%60).padStart(2,"0");return[n,r,a]}withTimeZone(e){return new q(+this,e)}[Symbol.for("constructDateFrom")](e){return new q(+new Date(e),this.timeZone)}}function Sa(t,e){return new Intl.DateTimeFormat("en-GB",{timeZone:t,timeZoneName:"long"}).format(e).slice(12)}var w;(function(t){t.Root="root",t.Chevron="chevron",t.Day="day",t.DayButton="day_button",t.CaptionLabel="caption_label",t.Dropdowns="dropdowns",t.Dropdown="dropdown",t.DropdownRoot="dropdown_root",t.Footer="footer",t.MonthGrid="month_grid",t.MonthCaption="month_caption",t.MonthsDropdown="months_dropdown",t.Month="month",t.Months="months",t.Nav="nav",t.NextMonthButton="button_next",t.PreviousMonthButton="button_previous",t.Week="week",t.Weeks="weeks",t.Weekday="weekday",t.Weekdays="weekdays",t.WeekNumber="week_number",t.WeekNumberHeader="week_number_header",t.YearsDropdown="years_dropdown"})(w||(w={}));var F;(function(t){t.disabled="disabled",t.hidden="hidden",t.outside="outside",t.focused="focused",t.today="today"})(F||(F={}));var X;(function(t){t.range_end="range_end",t.range_middle="range_middle",t.range_start="range_start",t.selected="selected"})(X||(X={}));var Z;(function(t){t.weeks_before_enter="weeks_before_enter",t.weeks_before_exit="weeks_before_exit",t.weeks_after_enter="weeks_after_enter",t.weeks_after_exit="weeks_after_exit",t.caption_after_enter="caption_after_enter",t.caption_after_exit="caption_after_exit",t.caption_before_enter="caption_before_enter",t.caption_before_exit="caption_before_exit"})(Z||(Z={}));const wt=5,Ta=4;function _a(t,e){const n=e.startOfMonth(t),r=n.getDay()>0?n.getDay():7,a=e.addDays(t,-r+1),s=e.addDays(a,wt*7-1);return e.getMonth(t)===e.getMonth(s)?wt:Ta}function Ht(t,e){const n=e.startOfMonth(t),r=n.getDay();return r===1?n:r===0?e.addDays(n,-1*6):e.addDays(n,-1*(r-1))}function Ea(t,e){const n=Ht(t,e),r=_a(t,e);return e.addDays(n,r*7-1)}class ae{constructor(e,n){this.Date=Date,this.today=()=>{var r;return(r=this.overrides)!=null&&r.today?this.overrides.today():this.options.timeZone?q.tz(this.options.timeZone):new this.Date},this.newDate=(r,a,s)=>{var i;return(i=this.overrides)!=null&&i.newDate?this.overrides.newDate(r,a,s):this.options.timeZone?new q(r,a,s,this.options.timeZone):new Date(r,a,s)},this.addDays=(r,a)=>{var s;return(s=this.overrides)!=null&&s.addDays?this.overrides.addDays(r,a):Wt(r,a)},this.addMonths=(r,a)=>{var s;return(s=this.overrides)!=null&&s.addMonths?this.overrides.addMonths(r,a):St(r,a)},this.addWeeks=(r,a)=>{var s;return(s=this.overrides)!=null&&s.addWeeks?this.overrides.addWeeks(r,a):Qn(r,a)},this.addYears=(r,a)=>{var s;return(s=this.overrides)!=null&&s.addYears?this.overrides.addYears(r,a):Xn(r,a)},this.differenceInCalendarDays=(r,a)=>{var s;return(s=this.overrides)!=null&&s.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,a):ie(r,a)},this.differenceInCalendarMonths=(r,a)=>{var s;return(s=this.overrides)!=null&&s.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,a):tr(r,a)},this.eachMonthOfInterval=r=>{var a;return(a=this.overrides)!=null&&a.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):ar(r)},this.endOfBroadcastWeek=r=>{var a;return(a=this.overrides)!=null&&a.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):Ea(r,this)},this.endOfISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.endOfISOWeek?this.overrides.endOfISOWeek(r):ir(r)},this.endOfMonth=r=>{var a;return(a=this.overrides)!=null&&a.endOfMonth?this.overrides.endOfMonth(r):nr(r)},this.endOfWeek=(r,a)=>{var s;return(s=this.overrides)!=null&&s.endOfWeek?this.overrides.endOfWeek(r,a):Yt(r,this.options)},this.endOfYear=r=>{var a;return(a=this.overrides)!=null&&a.endOfYear?this.overrides.endOfYear(r):or(r)},this.format=(r,a,s)=>{var o;const i=(o=this.overrides)!=null&&o.format?this.overrides.format(r,a,this.options):Ue(r,a,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(i):i},this.getISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.getISOWeek?this.overrides.getISOWeek(r):Pt(r)},this.getMonth=(r,a)=>{var s;return(s=this.overrides)!=null&&s.getMonth?this.overrides.getMonth(r,this.options):aa(r,this.options)},this.getYear=(r,a)=>{var s;return(s=this.overrides)!=null&&s.getYear?this.overrides.getYear(r,this.options):sa(r,this.options)},this.getWeek=(r,a)=>{var s;return(s=this.overrides)!=null&&s.getWeek?this.overrides.getWeek(r,this.options):Ft(r,this.options)},this.isAfter=(r,a)=>{var s;return(s=this.overrides)!=null&&s.isAfter?this.overrides.isAfter(r,a):oa(r,a)},this.isBefore=(r,a)=>{var s;return(s=this.overrides)!=null&&s.isBefore?this.overrides.isBefore(r,a):ia(r,a)},this.isDate=r=>{var a;return(a=this.overrides)!=null&&a.isDate?this.overrides.isDate(r):_t(r)},this.isSameDay=(r,a)=>{var s;return(s=this.overrides)!=null&&s.isSameDay?this.overrides.isSameDay(r,a):Kn(r,a)},this.isSameMonth=(r,a)=>{var s;return(s=this.overrides)!=null&&s.isSameMonth?this.overrides.isSameMonth(r,a):ca(r,a)},this.isSameYear=(r,a)=>{var s;return(s=this.overrides)!=null&&s.isSameYear?this.overrides.isSameYear(r,a):ua(r,a)},this.max=r=>{var a;return(a=this.overrides)!=null&&a.max?this.overrides.max(r):Vn(r)},this.min=r=>{var a;return(a=this.overrides)!=null&&a.min?this.overrides.min(r):Jn(r)},this.setMonth=(r,a)=>{var s;return(s=this.overrides)!=null&&s.setMonth?this.overrides.setMonth(r,a):Na(r,a)},this.setYear=(r,a)=>{var s;return(s=this.overrides)!=null&&s.setYear?this.overrides.setYear(r,a):Ca(r,a)},this.startOfBroadcastWeek=(r,a)=>{var s;return(s=this.overrides)!=null&&s.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):Ht(r,this)},this.startOfDay=r=>{var a;return(a=this.overrides)!=null&&a.startOfDay?this.overrides.startOfDay(r):pe(r)},this.startOfISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.startOfISOWeek?this.overrides.startOfISOWeek(r):Ce(r)},this.startOfMonth=r=>{var a;return(a=this.overrides)!=null&&a.startOfMonth?this.overrides.startOfMonth(r):sr(r)},this.startOfWeek=(r,a)=>{var s;return(s=this.overrides)!=null&&s.startOfWeek?this.overrides.startOfWeek(r,this.options):we(r,this.options)},this.startOfYear=r=>{var a;return(a=this.overrides)!=null&&a.startOfYear?this.overrides.startOfYear(r):Et(r)},this.options={locale:Ve,...e},this.overrides=n}getDigitMap(){const{numerals:e="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:e}),r={};for(let a=0;a<10;a++)r[a.toString()]=n.format(a);return r}replaceDigits(e){const n=this.getDigitMap();return e.replace(/\d/g,r=>n[r]||r)}formatNumber(e){return this.replaceDigits(e.toString())}}const ee=new ae;class qt{constructor(e,n,r=ee){this.date=e,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(e,n)),this.dateLib=r}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}class Ya{constructor(e,n){this.date=e,this.weeks=n}}class Pa{constructor(e,n){this.days=n,this.weekNumber=e}}function ne(t,e,n=!1,r=ee){let{from:a,to:s}=t;const{differenceInCalendarDays:i,isSameDay:o}=r;return a&&s?(i(s,a)<0&&([a,s]=[s,a]),i(e,a)>=(n?1:0)&&i(s,e)>=(n?1:0)):!n&&s?o(s,e):!n&&a?o(a,e):!1}function $t(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function Je(t){return!!(t&&typeof t=="object"&&"from"in t)}function Rt(t){return!!(t&&typeof t=="object"&&"after"in t)}function Gt(t){return!!(t&&typeof t=="object"&&"before"in t)}function zt(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function Lt(t,e){return Array.isArray(t)&&t.every(e.isDate)}function re(t,e,n=ee){const r=Array.isArray(e)?e:[e],{isSameDay:a,differenceInCalendarDays:s,isAfter:i}=n;return r.some(o=>{if(typeof o=="boolean")return o;if(n.isDate(o))return a(t,o);if(Lt(o,n))return o.includes(t);if(Je(o))return ne(o,t,!1,n);if(zt(o))return Array.isArray(o.dayOfWeek)?o.dayOfWeek.includes(t.getDay()):o.dayOfWeek===t.getDay();if($t(o)){const c=s(o.before,t),d=s(o.after,t),u=c>0,l=d<0;return i(o.before,o.after)?l&&u:u||l}return Rt(o)?s(t,o.after)>0:Gt(o)?s(o.before,t)>0:typeof o=="function"?o(t):!1})}function ja(t,e,n){const{disabled:r,hidden:a,modifiers:s,showOutsideDays:i,broadcastCalendar:o,today:c}=e,{isSameDay:d,isSameMonth:u,startOfMonth:l,isBefore:m,endOfMonth:b,isAfter:k}=n,M=e.startMonth&&l(e.startMonth),v=e.endMonth&&b(e.endMonth),D={[F.focused]:[],[F.outside]:[],[F.disabled]:[],[F.hidden]:[],[F.today]:[]},x={};for(const g of t){const{date:p,displayMonth:f}=g,N=!!(f&&!u(p,f)),O=!!(M&&m(p,M)),Y=!!(v&&k(p,v)),G=!!(r&&re(p,r,n)),$=!!(a&&re(p,a,n))||O||Y||!o&&!i&&N||o&&i===!1&&N,I=d(p,c??n.today());N&&D.outside.push(g),G&&D.disabled.push(g),$&&D.hidden.push(g),I&&D.today.push(g),s&&Object.keys(s).forEach(A=>{const te=s==null?void 0:s[A];te&&re(p,te,n)&&(x[A]?x[A].push(g):x[A]=[g])})}return g=>{const p={[F.focused]:!1,[F.disabled]:!1,[F.hidden]:!1,[F.outside]:!1,[F.today]:!1},f={};for(const N in D){const O=D[N];p[N]=O.some(Y=>Y===g)}for(const N in x)f[N]=x[N].some(O=>O===g);return{...p,...f}}}function Fa(t,e,n={}){return Object.entries(t).filter(([,a])=>a===!0).reduce((a,[s])=>(n[s]?a.push(n[s]):e[F[s]]?a.push(e[F[s]]):e[X[s]]&&a.push(e[X[s]]),a),[e[w.Day]])}function Ba(t){return y.createElement("button",{...t})}function Ia(t){return y.createElement("span",{...t})}function Aa(t){const{size:e=24,orientation:n="left",className:r}=t;return y.createElement("svg",{className:r,width:e,height:e,viewBox:"0 0 24 24"},n==="up"&&y.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&y.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&y.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&y.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function Ha(t){const{day:e,modifiers:n,...r}=t;return y.createElement("td",{...r})}function qa(t){const{day:e,modifiers:n,...r}=t,a=y.useRef(null);return y.useEffect(()=>{var s;n.focused&&((s=a.current)==null||s.focus())},[n.focused]),y.createElement("button",{ref:a,...r})}function $a(t){const{options:e,className:n,components:r,classNames:a,...s}=t,i=[a[w.Dropdown],n].join(" "),o=e==null?void 0:e.find(({value:c})=>c===s.value);return y.createElement("span",{"data-disabled":s.disabled,className:a[w.DropdownRoot]},y.createElement(r.Select,{className:i,...s},e==null?void 0:e.map(({value:c,label:d,disabled:u})=>y.createElement(r.Option,{key:c,value:c,disabled:u},d))),y.createElement("span",{className:a[w.CaptionLabel],"aria-hidden":!0},o==null?void 0:o.label,y.createElement(r.Chevron,{orientation:"down",size:18,className:a[w.Chevron]})))}function Ra(t){return y.createElement("div",{...t})}function Ga(t){return y.createElement("div",{...t})}function za(t){const{calendarMonth:e,displayIndex:n,...r}=t;return y.createElement("div",{...r},t.children)}function La(t){const{calendarMonth:e,displayIndex:n,...r}=t;return y.createElement("div",{...r})}function Za(t){return y.createElement("table",{...t})}function Ua(t){return y.createElement("div",{...t})}const Zt=W.createContext(void 0);function fe(){const t=W.useContext(Zt);if(t===void 0)throw new Error("useDayPicker() must be used within a custom component.");return t}function Qa(t){const{components:e}=fe();return y.createElement(e.Dropdown,{...t})}function Xa(t){const{onPreviousClick:e,onNextClick:n,previousMonth:r,nextMonth:a,...s}=t,{components:i,classNames:o,labels:{labelPrevious:c,labelNext:d}}=fe(),u=W.useCallback(m=>{a&&(n==null||n(m))},[a,n]),l=W.useCallback(m=>{r&&(e==null||e(m))},[r,e]);return y.createElement("nav",{...s},y.createElement(i.PreviousMonthButton,{type:"button",className:o[w.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:l},y.createElement(i.Chevron,{disabled:r?void 0:!0,className:o[w.Chevron],orientation:"left"})),y.createElement(i.NextMonthButton,{type:"button",className:o[w.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":a?void 0:!0,"aria-label":d(a),onClick:u},y.createElement(i.Chevron,{disabled:a?void 0:!0,orientation:"right",className:o[w.Chevron]})))}function Va(t){const{components:e}=fe();return y.createElement(e.Button,{...t})}function Ja(t){return y.createElement("option",{...t})}function Ka(t){const{components:e}=fe();return y.createElement(e.Button,{...t})}function es(t){const{rootRef:e,...n}=t;return y.createElement("div",{...n,ref:e})}function ts(t){return y.createElement("select",{...t})}function ns(t){const{week:e,...n}=t;return y.createElement("tr",{...n})}function rs(t){return y.createElement("th",{...t})}function as(t){return y.createElement("thead",{"aria-hidden":!0},y.createElement("tr",{...t}))}function ss(t){const{week:e,...n}=t;return y.createElement("th",{...n})}function os(t){return y.createElement("th",{...t})}function is(t){return y.createElement("tbody",{...t})}function cs(t){const{components:e}=fe();return y.createElement(e.Dropdown,{...t})}const us=Object.freeze(Object.defineProperty({__proto__:null,Button:Ba,CaptionLabel:Ia,Chevron:Aa,Day:Ha,DayButton:qa,Dropdown:$a,DropdownNav:Ra,Footer:Ga,Month:za,MonthCaption:La,MonthGrid:Za,Months:Ua,MonthsDropdown:Qa,Nav:Xa,NextMonthButton:Va,Option:Ja,PreviousMonthButton:Ka,Root:es,Select:ts,Week:ns,WeekNumber:ss,WeekNumberHeader:os,Weekday:rs,Weekdays:as,Weeks:is,YearsDropdown:cs},Symbol.toStringTag,{value:"Module"}));function ds(t){return{...us,...t}}function ls(t){const e={"data-mode":t.mode??void 0,"data-required":"required"in t?t.required:void 0,"data-multiple-months":t.numberOfMonths&&t.numberOfMonths>1||void 0,"data-week-numbers":t.showWeekNumber||void 0,"data-broadcast-calendar":t.broadcastCalendar||void 0,"data-nav-layout":t.navLayout||void 0};return Object.entries(t).forEach(([n,r])=>{n.startsWith("data-")&&(e[n]=r)}),e}function fs(){const t={};for(const e in w)t[w[e]]=`rdp-${w[e]}`;for(const e in F)t[F[e]]=`rdp-${F[e]}`;for(const e in X)t[X[e]]=`rdp-${X[e]}`;for(const e in Z)t[Z[e]]=`rdp-${Z[e]}`;return t}function Ut(t,e,n){return(n??new ae(e)).format(t,"LLLL y")}const hs=Ut;function ms(t,e,n){return(n??new ae(e)).format(t,"d")}function ys(t,e=ee){return e.format(t,"LLLL")}function gs(t,e=ee){return t<10?e.formatNumber(`0${t.toLocaleString()}`):e.formatNumber(`${t.toLocaleString()}`)}function bs(){return""}function ws(t,e,n){return(n??new ae(e)).format(t,"cccccc")}function Qt(t,e=ee){return e.format(t,"yyyy")}const Ms=Qt,ks=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:Ut,formatDay:ms,formatMonthCaption:hs,formatMonthDropdown:ys,formatWeekNumber:gs,formatWeekNumberHeader:bs,formatWeekdayName:ws,formatYearCaption:Ms,formatYearDropdown:Qt},Symbol.toStringTag,{value:"Module"}));function Ds(t){return t!=null&&t.formatMonthCaption&&!t.formatCaption&&(t.formatCaption=t.formatMonthCaption),t!=null&&t.formatYearCaption&&!t.formatYearDropdown&&(t.formatYearDropdown=t.formatYearCaption),{...ks,...t}}function vs(t,e,n,r,a){const{startOfMonth:s,startOfYear:i,endOfYear:o,eachMonthOfInterval:c,getMonth:d}=a;return c({start:i(t),end:o(t)}).map(m=>{const b=r.formatMonthDropdown(m,a),k=d(m),M=e&&m<s(e)||n&&m>s(n)||!1;return{value:k,label:b,disabled:M}})}function xs(t,e={},n={}){let r={...e==null?void 0:e[w.Day]};return Object.entries(t).filter(([,a])=>a===!0).forEach(([a])=>{r={...r,...n==null?void 0:n[a]}}),r}function Os(t,e,n){const r=t.today(),a=e?t.startOfISOWeek(r):t.startOfWeek(r),s=[];for(let i=0;i<7;i++){const o=t.addDays(a,i);s.push(o)}return s}function Ns(t,e,n,r){if(!t||!e)return;const{startOfYear:a,endOfYear:s,addYears:i,getYear:o,isBefore:c,isSameYear:d}=r,u=a(t),l=s(e),m=[];let b=u;for(;c(b,l)||d(b,l);)m.push(b),b=i(b,1);return m.map(k=>{const M=n.formatYearDropdown(k,r);return{value:o(k),label:M,disabled:!1}})}function Xt(t,e,n){return(n??new ae(e)).format(t,"LLLL y")}const Cs=Xt;function ps(t,e,n,r){let a=(r??new ae(n)).format(t,"PPPP");return e!=null&&e.today&&(a=`Today, ${a}`),a}function Vt(t,e,n,r){let a=(r??new ae(n)).format(t,"PPPP");return e.today&&(a=`Today, ${a}`),e.selected&&(a=`${a}, selected`),a}const Ws=Vt;function Ss(){return""}function Ts(t){return"Choose the Month"}function Jt(t){return"Go to the Next Month"}function Kt(t){return"Go to the Previous Month"}function _s(t,e,n){return(n??new ae(e)).format(t,"cccc")}function Es(t,e){return`Week ${t}`}function Ys(t){return"Week Number"}function Ps(t){return"Choose the Year"}const js=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:Cs,labelDay:Ws,labelDayButton:Vt,labelGrid:Xt,labelGridcell:ps,labelMonthDropdown:Ts,labelNav:Ss,labelNext:Jt,labelPrevious:Kt,labelWeekNumber:Es,labelWeekNumberHeader:Ys,labelWeekday:_s,labelYearDropdown:Ps},Symbol.toStringTag,{value:"Module"})),Se=t=>t instanceof HTMLElement?t:null,ze=t=>[...t.querySelectorAll("[data-animated-month]")??[]],Fs=t=>Se(t.querySelector("[data-animated-month]")),Le=t=>Se(t.querySelector("[data-animated-caption]")),Ze=t=>Se(t.querySelector("[data-animated-weeks]")),Bs=t=>Se(t.querySelector("[data-animated-nav]")),Is=t=>Se(t.querySelector("[data-animated-weekdays]"));function As(t,e,{classNames:n,months:r,focused:a,dateLib:s}){const i=W.useRef(null),o=W.useRef(r),c=W.useRef(!1);W.useLayoutEffect(()=>{const d=o.current;if(o.current=r,!e||!t.current||!(t.current instanceof HTMLElement)||r.length===0||d.length===0||r.length!==d.length)return;const u=s.isSameMonth(r[0].date,d[0].date),l=s.isAfter(r[0].date,d[0].date),m=l?n[Z.caption_after_enter]:n[Z.caption_before_enter],b=l?n[Z.weeks_after_enter]:n[Z.weeks_before_enter],k=i.current,M=t.current.cloneNode(!0);if(M instanceof HTMLElement?(ze(M).forEach(g=>{if(!(g instanceof HTMLElement))return;const p=Fs(g);p&&g.contains(p)&&g.removeChild(p);const f=Le(g);f&&f.classList.remove(m);const N=Ze(g);N&&N.classList.remove(b)}),i.current=M):i.current=null,c.current||u||a)return;const v=k instanceof HTMLElement?ze(k):[],D=ze(t.current);if(D&&D.every(x=>x instanceof HTMLElement)&&v&&v.every(x=>x instanceof HTMLElement)){c.current=!0,t.current.style.isolation="isolate";const x=Bs(t.current);x&&(x.style.zIndex="1"),D.forEach((g,p)=>{const f=v[p];if(!f)return;g.style.position="relative",g.style.overflow="hidden";const N=Le(g);N&&N.classList.add(m);const O=Ze(g);O&&O.classList.add(b);const Y=()=>{c.current=!1,t.current&&(t.current.style.isolation=""),x&&(x.style.zIndex=""),N&&N.classList.remove(m),O&&O.classList.remove(b),g.style.position="",g.style.overflow="",g.contains(f)&&g.removeChild(f)};f.style.pointerEvents="none",f.style.position="absolute",f.style.overflow="hidden",f.setAttribute("aria-hidden","true");const G=Is(f);G&&(G.style.opacity="0");const $=Le(f);$&&($.classList.add(l?n[Z.caption_before_exit]:n[Z.caption_after_exit]),$.addEventListener("animationend",Y));const I=Ze(f);I&&I.classList.add(l?n[Z.weeks_before_exit]:n[Z.weeks_after_exit]),g.insertBefore(f,g.firstChild)})}})}function Hs(t,e,n,r){const a=t[0],s=t[t.length-1],{ISOWeek:i,fixedWeeks:o,broadcastCalendar:c}=n??{},{addDays:d,differenceInCalendarDays:u,differenceInCalendarMonths:l,endOfBroadcastWeek:m,endOfISOWeek:b,endOfMonth:k,endOfWeek:M,isAfter:v,startOfBroadcastWeek:D,startOfISOWeek:x,startOfWeek:g}=r,p=c?D(a,r):i?x(a):g(a),f=c?m(s):i?b(k(s)):M(k(s)),N=u(f,p),O=l(s,a)+1,Y=[];for(let I=0;I<=N;I++){const A=d(p,I);if(e&&v(A,e))break;Y.push(A)}const $=(c?35:42)*O;if(o&&Y.length<$){const I=$-Y.length;for(let A=0;A<I;A++){const te=d(Y[Y.length-1],1);Y.push(te)}}return Y}function qs(t){const e=[];return t.reduce((n,r)=>{const a=r.weeks.reduce((s,i)=>[...s,...i.days],e);return[...n,...a]},e)}function $s(t,e,n,r){const{numberOfMonths:a=1}=n,s=[];for(let i=0;i<a;i++){const o=r.addMonths(t,i);if(e&&o>e)break;s.push(o)}return s}function Mt(t,e){const{month:n,defaultMonth:r,today:a=e.today(),numberOfMonths:s=1,endMonth:i,startMonth:o}=t;let c=n||r||a;const{differenceInCalendarMonths:d,addMonths:u,startOfMonth:l}=e;if(i&&d(i,c)<0){const m=-1*(s-1);c=u(i,m)}return o&&d(c,o)<0&&(c=o),l(c)}function Rs(t,e,n,r){const{addDays:a,endOfBroadcastWeek:s,endOfISOWeek:i,endOfMonth:o,endOfWeek:c,getISOWeek:d,getWeek:u,startOfBroadcastWeek:l,startOfISOWeek:m,startOfWeek:b}=r,k=t.reduce((M,v)=>{const D=n.broadcastCalendar?l(v,r):n.ISOWeek?m(v):b(v),x=n.broadcastCalendar?s(v):n.ISOWeek?i(o(v)):c(o(v)),g=e.filter(O=>O>=D&&O<=x),p=n.broadcastCalendar?35:42;if(n.fixedWeeks&&g.length<p){const O=e.filter(Y=>{const G=p-g.length;return Y>x&&Y<=a(x,G)});g.push(...O)}const f=g.reduce((O,Y)=>{const G=n.ISOWeek?d(Y):u(Y),$=O.find(A=>A.weekNumber===G),I=new qt(Y,v,r);return $?$.days.push(I):O.push(new Pa(G,[I])),O},[]),N=new Ya(v,f);return M.push(N),M},[]);return n.reverseMonths?k.reverse():k}function Gs(t,e){let{startMonth:n,endMonth:r}=t;const{startOfYear:a,startOfDay:s,startOfMonth:i,endOfMonth:o,addYears:c,endOfYear:d,newDate:u,today:l}=e,{fromYear:m,toYear:b,fromMonth:k,toMonth:M}=t;!n&&k&&(n=k),!n&&m&&(n=e.newDate(m,0,1)),!r&&M&&(r=M),!r&&b&&(r=u(b,11,31));const v=t.captionLayout==="dropdown"||t.captionLayout==="dropdown-years";return n?n=i(n):m?n=u(m,0,1):!n&&v&&(n=a(c(t.today??l(),-100))),r?r=o(r):b?r=u(b,11,31):!r&&v&&(r=d(t.today??l())),[n&&s(n),r&&s(r)]}function zs(t,e,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:s=1}=n,{startOfMonth:i,addMonths:o,differenceInCalendarMonths:c}=r,d=a?s:1,u=i(t);if(!e)return o(u,d);if(!(c(e,t)<s))return o(u,d)}function Ls(t,e,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:s}=n,{startOfMonth:i,addMonths:o,differenceInCalendarMonths:c}=r,d=a?s??1:1,u=i(t);if(!e)return o(u,-d);if(!(c(u,e)<=0))return o(u,-d)}function Zs(t){const e=[];return t.reduce((n,r)=>[...n,...r.weeks],e)}function Be(t,e){const[n,r]=W.useState(t);return[e===void 0?n:e,r]}function Us(t,e){const[n,r]=Gs(t,e),{startOfMonth:a,endOfMonth:s}=e,i=Mt(t,e),[o,c]=Be(i,t.month?i:void 0);W.useEffect(()=>{const N=Mt(t,e);c(N)},[t.timeZone]);const d=$s(o,r,t,e),u=Hs(d,t.endMonth?s(t.endMonth):void 0,t,e),l=Rs(d,u,t,e),m=Zs(l),b=qs(l),k=Ls(o,n,t,e),M=zs(o,r,t,e),{disableNavigation:v,onMonthChange:D}=t,x=N=>m.some(O=>O.days.some(Y=>Y.isEqualTo(N))),g=N=>{if(v)return;let O=a(N);n&&O<a(n)&&(O=a(n)),r&&O>a(r)&&(O=a(r)),c(O),D==null||D(O)};return{months:l,weeks:m,days:b,navStart:n,navEnd:r,previousMonth:k,nextMonth:M,goToMonth:g,goToDay:N=>{x(N)||g(N.date)}}}var J;(function(t){t[t.Today=0]="Today",t[t.Selected=1]="Selected",t[t.LastFocused=2]="LastFocused",t[t.FocusedModifier=3]="FocusedModifier"})(J||(J={}));function kt(t){return!t[F.disabled]&&!t[F.hidden]&&!t[F.outside]}function Qs(t,e,n,r){let a,s=-1;for(const i of t){const o=e(i);kt(o)&&(o[F.focused]&&s<J.FocusedModifier?(a=i,s=J.FocusedModifier):r!=null&&r.isEqualTo(i)&&s<J.LastFocused?(a=i,s=J.LastFocused):n(i.date)&&s<J.Selected?(a=i,s=J.Selected):o[F.today]&&s<J.Today&&(a=i,s=J.Today))}return a||(a=t.find(i=>kt(e(i)))),a}function Xs(t,e,n,r,a,s,i){const{ISOWeek:o,broadcastCalendar:c}=s,{addDays:d,addMonths:u,addWeeks:l,addYears:m,endOfBroadcastWeek:b,endOfISOWeek:k,endOfWeek:M,max:v,min:D,startOfBroadcastWeek:x,startOfISOWeek:g,startOfWeek:p}=i;let N={day:d,week:l,month:u,year:m,startOfWeek:O=>c?x(O,i):o?g(O):p(O),endOfWeek:O=>c?b(O):o?k(O):M(O)}[t](n,e==="after"?1:-1);return e==="before"&&r?N=v([r,N]):e==="after"&&a&&(N=D([a,N])),N}function en(t,e,n,r,a,s,i,o=0){if(o>365)return;const c=Xs(t,e,n.date,r,a,s,i),d=!!(s.disabled&&re(c,s.disabled,i)),u=!!(s.hidden&&re(c,s.hidden,i)),l=c,m=new qt(c,l,i);return!d&&!u?m:en(t,e,m,r,a,s,i,o+1)}function Vs(t,e,n,r,a){const{autoFocus:s}=t,[i,o]=W.useState(),c=Qs(e.days,n,r||(()=>!1),i),[d,u]=W.useState(s?c:void 0);return{isFocusTarget:M=>!!(c!=null&&c.isEqualTo(M)),setFocused:u,focused:d,blur:()=>{o(d),u(void 0)},moveFocus:(M,v)=>{if(!d)return;const D=en(M,v,d,e.navStart,e.navEnd,t,a);D&&(e.goToDay(D),u(D))}}}function Js(t,e){const{selected:n,required:r,onSelect:a}=t,[s,i]=Be(n,a?n:void 0),o=a?n:s,{isSameDay:c}=e,d=b=>(o==null?void 0:o.some(k=>c(k,b)))??!1,{min:u,max:l}=t;return{selected:o,select:(b,k,M)=>{let v=[...o??[]];if(d(b)){if((o==null?void 0:o.length)===u||r&&(o==null?void 0:o.length)===1)return;v=o==null?void 0:o.filter(D=>!c(D,b))}else(o==null?void 0:o.length)===l?v=[b]:v=[...v,b];return a||i(v),a==null||a(v,b,k,M),v},isSelected:d}}function Ks(t,e,n=0,r=0,a=!1,s=ee){const{from:i,to:o}=e||{},{isSameDay:c,isAfter:d,isBefore:u}=s;let l;if(!i&&!o)l={from:t,to:n>0?void 0:t};else if(i&&!o)c(i,t)?a?l={from:i,to:void 0}:l=void 0:u(t,i)?l={from:t,to:i}:l={from:i,to:t};else if(i&&o)if(c(i,t)&&c(o,t))a?l={from:i,to:o}:l=void 0;else if(c(i,t))l={from:i,to:n>0?void 0:t};else if(c(o,t))l={from:t,to:n>0?void 0:t};else if(u(t,i))l={from:t,to:o};else if(d(t,i))l={from:i,to:t};else if(d(t,o))l={from:i,to:t};else throw new Error("Invalid range");if(l!=null&&l.from&&(l!=null&&l.to)){const m=s.differenceInCalendarDays(l.to,l.from);r>0&&m>r?l={from:t,to:void 0}:n>1&&m<n&&(l={from:t,to:void 0})}return l}function eo(t,e,n=ee){const r=Array.isArray(e)?e:[e];let a=t.from;const s=n.differenceInCalendarDays(t.to,t.from),i=Math.min(s,6);for(let o=0;o<=i;o++){if(r.includes(a.getDay()))return!0;a=n.addDays(a,1)}return!1}function Dt(t,e,n=ee){return ne(t,e.from,!1,n)||ne(t,e.to,!1,n)||ne(e,t.from,!1,n)||ne(e,t.to,!1,n)}function to(t,e,n=ee){const r=Array.isArray(e)?e:[e];if(r.filter(o=>typeof o!="function").some(o=>typeof o=="boolean"?o:n.isDate(o)?ne(t,o,!1,n):Lt(o,n)?o.some(c=>ne(t,c,!1,n)):Je(o)?o.from&&o.to?Dt(t,{from:o.from,to:o.to},n):!1:zt(o)?eo(t,o.dayOfWeek,n):$t(o)?n.isAfter(o.before,o.after)?Dt(t,{from:n.addDays(o.after,1),to:n.addDays(o.before,-1)},n):re(t.from,o,n)||re(t.to,o,n):Rt(o)||Gt(o)?re(t.from,o,n)||re(t.to,o,n):!1))return!0;const i=r.filter(o=>typeof o=="function");if(i.length){let o=t.from;const c=n.differenceInCalendarDays(t.to,t.from);for(let d=0;d<=c;d++){if(i.some(u=>u(o)))return!0;o=n.addDays(o,1)}}return!1}function no(t,e){const{disabled:n,excludeDisabled:r,selected:a,required:s,onSelect:i}=t,[o,c]=Be(a,i?a:void 0),d=i?a:o;return{selected:d,select:(m,b,k)=>{const{min:M,max:v}=t,D=m?Ks(m,d,M,v,s,e):void 0;return r&&n&&(D!=null&&D.from)&&D.to&&to({from:D.from,to:D.to},n,e)&&(D.from=m,D.to=void 0),i||c(D),i==null||i(D,m,b,k),D},isSelected:m=>d&&ne(d,m,!1,e)}}function ro(t,e){const{selected:n,required:r,onSelect:a}=t,[s,i]=Be(n,a?n:void 0),o=a?n:s,{isSameDay:c}=e;return{selected:o,select:(l,m,b)=>{let k=l;return!r&&o&&o&&c(l,o)&&(k=void 0),a||i(k),a==null||a(k,l,m,b),k},isSelected:l=>o?c(o,l):!1}}function ao(t,e){const n=ro(t,e),r=Js(t,e),a=no(t,e);switch(t.mode){case"single":return n;case"multiple":return r;case"range":return a;default:return}}function so(t){var rt;let e=t;e.timeZone&&(e={...t},e.today&&(e.today=new q(e.today,e.timeZone)),e.month&&(e.month=new q(e.month,e.timeZone)),e.defaultMonth&&(e.defaultMonth=new q(e.defaultMonth,e.timeZone)),e.startMonth&&(e.startMonth=new q(e.startMonth,e.timeZone)),e.endMonth&&(e.endMonth=new q(e.endMonth,e.timeZone)),e.mode==="single"&&e.selected?e.selected=new q(e.selected,e.timeZone):e.mode==="multiple"&&e.selected?e.selected=(rt=e.selected)==null?void 0:rt.map(C=>new q(C,e.timeZone)):e.mode==="range"&&e.selected&&(e.selected={from:e.selected.from?new q(e.selected.from,e.timeZone):void 0,to:e.selected.to?new q(e.selected.to,e.timeZone):void 0}));const{components:n,formatters:r,labels:a,dateLib:s,locale:i,classNames:o}=W.useMemo(()=>{const C={...Ve,...e.locale};return{dateLib:new ae({locale:C,weekStartsOn:e.broadcastCalendar?1:e.weekStartsOn,firstWeekContainsDate:e.firstWeekContainsDate,useAdditionalWeekYearTokens:e.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:e.useAdditionalDayOfYearTokens,timeZone:e.timeZone,numerals:e.numerals},e.dateLib),components:ds(e.components),formatters:Ds(e.formatters),labels:{...js,...e.labels},locale:C,classNames:{...fs(),...e.classNames}}},[e.locale,e.broadcastCalendar,e.weekStartsOn,e.firstWeekContainsDate,e.useAdditionalWeekYearTokens,e.useAdditionalDayOfYearTokens,e.timeZone,e.numerals,e.dateLib,e.components,e.formatters,e.labels,e.classNames]),{captionLayout:c,mode:d,navLayout:u,numberOfMonths:l=1,onDayBlur:m,onDayClick:b,onDayFocus:k,onDayKeyDown:M,onDayMouseEnter:v,onDayMouseLeave:D,onNextClick:x,onPrevClick:g,showWeekNumber:p,styles:f}=e,{formatCaption:N,formatDay:O,formatMonthDropdown:Y,formatWeekNumber:G,formatWeekNumberHeader:$,formatWeekdayName:I,formatYearDropdown:A}=r,te=Us(e,s),{days:Te,months:he,navStart:_e,navEnd:Ee,previousMonth:z,nextMonth:L,goToMonth:U}=te,ke=ja(Te,e,s),{isSelected:ce,select:ue,selected:R}=ao(e,s)??{},{blur:me,focused:ye,isFocusTarget:nn,moveFocus:Ke,setFocused:Ye}=Vs(e,te,ke,ce??(()=>!1),s),{labelDayButton:rn,labelGridcell:an,labelGrid:sn,labelMonthDropdown:on,labelNav:et,labelPrevious:cn,labelNext:un,labelWeekday:dn,labelWeekNumber:ln,labelWeekNumberHeader:fn,labelYearDropdown:hn}=a,mn=W.useMemo(()=>Os(s,e.ISOWeek),[s,e.ISOWeek]),tt=d!==void 0||b!==void 0,Ie=W.useCallback(()=>{z&&(U(z),g==null||g(z))},[z,U,g]),Ae=W.useCallback(()=>{L&&(U(L),x==null||x(L))},[U,L,x]),yn=W.useCallback((C,j)=>P=>{P.preventDefault(),P.stopPropagation(),Ye(C),ue==null||ue(C.date,j,P),b==null||b(C.date,j,P)},[ue,b,Ye]),gn=W.useCallback((C,j)=>P=>{Ye(C),k==null||k(C.date,j,P)},[k,Ye]),bn=W.useCallback((C,j)=>P=>{me(),m==null||m(C.date,j,P)},[me,m]),wn=W.useCallback((C,j)=>P=>{const se={ArrowLeft:["day",e.dir==="rtl"?"after":"before"],ArrowRight:["day",e.dir==="rtl"?"before":"after"],ArrowDown:["week","after"],ArrowUp:["week","before"],PageUp:[P.shiftKey?"year":"month","before"],PageDown:[P.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(se[P.key]){P.preventDefault(),P.stopPropagation();const[Q,Pe]=se[P.key];Ke(Q,Pe)}M==null||M(C.date,j,P)},[Ke,M,e.dir]),Mn=W.useCallback((C,j)=>P=>{v==null||v(C.date,j,P)},[v]),kn=W.useCallback((C,j)=>P=>{D==null||D(C.date,j,P)},[D]),Dn=W.useCallback(C=>j=>{const P=Number(j.target.value),se=s.setMonth(s.startOfMonth(C),P);U(se)},[s,U]),vn=W.useCallback(C=>j=>{const P=Number(j.target.value),se=s.setYear(s.startOfMonth(C),P);U(se)},[s,U]),{className:xn,style:On}=W.useMemo(()=>({className:[o[w.Root],e.className].filter(Boolean).join(" "),style:{...f==null?void 0:f[w.Root],...e.style}}),[o,e.className,e.style,f]),Nn=ls(e),nt=W.useRef(null);As(nt,!!e.animate,{classNames:o,months:he,focused:ye,dateLib:s});const Cn={dayPickerProps:e,selected:R,select:ue,isSelected:ce,months:he,nextMonth:L,previousMonth:z,goToMonth:U,getModifiers:ke,components:n,classNames:o,styles:f,labels:a,formatters:r};return y.createElement(Zt.Provider,{value:Cn},y.createElement(n.Root,{rootRef:e.animate?nt:void 0,className:xn,style:On,dir:e.dir,id:e.id,lang:e.lang,nonce:e.nonce,title:e.title,role:e.role,"aria-label":e["aria-label"],...Nn},y.createElement(n.Months,{className:o[w.Months],style:f==null?void 0:f[w.Months]},!e.hideNavigation&&!u&&y.createElement(n.Nav,{"data-animated-nav":e.animate?"true":void 0,className:o[w.Nav],style:f==null?void 0:f[w.Nav],"aria-label":et(),onPreviousClick:Ie,onNextClick:Ae,previousMonth:z,nextMonth:L}),he.map((C,j)=>{const P=vs(C.date,_e,Ee,r,s),se=Ns(_e,Ee,r,s);return y.createElement(n.Month,{"data-animated-month":e.animate?"true":void 0,className:o[w.Month],style:f==null?void 0:f[w.Month],key:j,displayIndex:j,calendarMonth:C},u==="around"&&!e.hideNavigation&&j===0&&y.createElement(n.PreviousMonthButton,{type:"button",className:o[w.PreviousMonthButton],tabIndex:z?void 0:-1,"aria-disabled":z?void 0:!0,"aria-label":cn(z),onClick:Ie,"data-animated-button":e.animate?"true":void 0},y.createElement(n.Chevron,{disabled:z?void 0:!0,className:o[w.Chevron],orientation:e.dir==="rtl"?"right":"left"})),y.createElement(n.MonthCaption,{"data-animated-caption":e.animate?"true":void 0,className:o[w.MonthCaption],style:f==null?void 0:f[w.MonthCaption],calendarMonth:C,displayIndex:j},c!=null&&c.startsWith("dropdown")?y.createElement(n.DropdownNav,{className:o[w.Dropdowns],style:f==null?void 0:f[w.Dropdowns]},c==="dropdown"||c==="dropdown-months"?y.createElement(n.MonthsDropdown,{className:o[w.MonthsDropdown],"aria-label":on(),classNames:o,components:n,disabled:!!e.disableNavigation,onChange:Dn(C.date),options:P,style:f==null?void 0:f[w.Dropdown],value:s.getMonth(C.date)}):y.createElement("span",null,Y(C.date,s)),c==="dropdown"||c==="dropdown-years"?y.createElement(n.YearsDropdown,{className:o[w.YearsDropdown],"aria-label":hn(s.options),classNames:o,components:n,disabled:!!e.disableNavigation,onChange:vn(C.date),options:se,style:f==null?void 0:f[w.Dropdown],value:s.getYear(C.date)}):y.createElement("span",null,A(C.date,s)),y.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},N(C.date,s.options,s))):y.createElement(n.CaptionLabel,{className:o[w.CaptionLabel],role:"status","aria-live":"polite"},N(C.date,s.options,s))),u==="around"&&!e.hideNavigation&&j===l-1&&y.createElement(n.NextMonthButton,{type:"button",className:o[w.NextMonthButton],tabIndex:L?void 0:-1,"aria-disabled":L?void 0:!0,"aria-label":un(L),onClick:Ae,"data-animated-button":e.animate?"true":void 0},y.createElement(n.Chevron,{disabled:L?void 0:!0,className:o[w.Chevron],orientation:e.dir==="rtl"?"left":"right"})),j===l-1&&u==="after"&&!e.hideNavigation&&y.createElement(n.Nav,{"data-animated-nav":e.animate?"true":void 0,className:o[w.Nav],style:f==null?void 0:f[w.Nav],"aria-label":et(),onPreviousClick:Ie,onNextClick:Ae,previousMonth:z,nextMonth:L}),y.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":d==="multiple"||d==="range","aria-label":sn(C.date,s.options,s)||void 0,className:o[w.MonthGrid],style:f==null?void 0:f[w.MonthGrid]},!e.hideWeekdays&&y.createElement(n.Weekdays,{"data-animated-weekdays":e.animate?"true":void 0,className:o[w.Weekdays],style:f==null?void 0:f[w.Weekdays]},p&&y.createElement(n.WeekNumberHeader,{"aria-label":fn(s.options),className:o[w.WeekNumberHeader],style:f==null?void 0:f[w.WeekNumberHeader],scope:"col"},$()),mn.map((Q,Pe)=>y.createElement(n.Weekday,{"aria-label":dn(Q,s.options,s),className:o[w.Weekday],key:Pe,style:f==null?void 0:f[w.Weekday],scope:"col"},I(Q,s.options,s)))),y.createElement(n.Weeks,{"data-animated-weeks":e.animate?"true":void 0,className:o[w.Weeks],style:f==null?void 0:f[w.Weeks]},C.weeks.map((Q,Pe)=>y.createElement(n.Week,{className:o[w.Week],key:Q.weekNumber,style:f==null?void 0:f[w.Week],week:Q},p&&y.createElement(n.WeekNumber,{week:Q,style:f==null?void 0:f[w.WeekNumber],"aria-label":ln(Q.weekNumber,{locale:i}),className:o[w.WeekNumber],scope:"row",role:"rowheader"},G(Q.weekNumber,s)),Q.days.map(H=>{const{date:V}=H,T=ke(H);if(T[F.focused]=!T.hidden&&!!(ye!=null&&ye.isEqualTo(H)),T[X.selected]=(ce==null?void 0:ce(V))||T.selected,Je(R)){const{from:He,to:qe}=R;T[X.range_start]=!!(He&&qe&&s.isSameDay(V,He)),T[X.range_end]=!!(He&&qe&&s.isSameDay(V,qe)),T[X.range_middle]=ne(R,V,!0,s)}const pn=xs(T,f,e.modifiersStyles),Wn=Fa(T,o,e.modifiersClassNames),Sn=!tt&&!T.hidden?an(V,T,s.options,s):void 0;return y.createElement(n.Day,{key:`${s.format(V,"yyyy-MM-dd")}_${s.format(H.displayMonth,"yyyy-MM")}`,day:H,modifiers:T,className:Wn.join(" "),style:pn,role:"gridcell","aria-selected":T.selected||void 0,"aria-label":Sn,"data-day":s.format(V,"yyyy-MM-dd"),"data-month":H.outside?s.format(V,"yyyy-MM"):void 0,"data-selected":T.selected||void 0,"data-disabled":T.disabled||void 0,"data-hidden":T.hidden||void 0,"data-outside":H.outside||void 0,"data-focused":T.focused||void 0,"data-today":T.today||void 0},!T.hidden&&tt?y.createElement(n.DayButton,{className:o[w.DayButton],style:f==null?void 0:f[w.DayButton],type:"button",day:H,modifiers:T,disabled:T.disabled||void 0,tabIndex:nn(H)?0:-1,"aria-label":rn(V,T,s.options,s),onClick:yn(H,T),onBlur:bn(H,T),onFocus:gn(H,T),onKeyDown:wn(H,T),onMouseEnter:Mn(H,T),onMouseLeave:kn(H,T)},O(V,s.options,s)):!T.hidden&&O(H.date,s.options,s))}))))))})),e.footer&&y.createElement(n.Footer,{className:o[w.Footer],style:f==null?void 0:f[w.Footer],role:"status","aria-live":"polite"},e.footer)))}function tn({className:t,showOutsideDays:e=!0,showYearSwitcher:n=!0,yearRange:r=12,numberOfMonths:a,components:s,...i}){const[o,c]=W.useState("days"),[d,u]=W.useState(W.useMemo(()=>{const R=new Date().getFullYear();return{from:R-Math.floor(r/2-1),to:R+Math.ceil(r/2)}},[r])),{onNextClick:l,onPrevClick:m,startMonth:b,endMonth:k}=i,M=o==="years"?1:a,v=E("relative flex",i.monthsClassName),D=E("relative mx-10 flex h-7 items-center justify-center",i.monthCaptionClassName),x=E("flex flex-row",i.weekdaysClassName),g=E("w-8 text-sm font-normal text-muted-foreground",i.weekdayClassName),p=E("w-full",i.monthClassName),f=E("relative flex items-center justify-center pt-1",i.captionClassName),N=E("truncate text-sm font-medium",i.captionLabelClassName),O=at({variant:"outline",className:"absolute h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"}),Y=E(O,"right-0",i.buttonNextClassName),G=E(O,"left-0",i.buttonPreviousClassName),$=E("flex items-start",i.navClassName),I=E("mx-auto mt-4",i.monthGridClassName),A=E("mt-2 flex w-max items-start",i.weekClassName),te=E("flex size-8 flex-1 items-center justify-center p-0 text-sm",i.dayClassName),Te=E(at({variant:"ghost"}),"size-8 rounded-md p-0 font-normal transition-none aria-selected:opacity-100",i.dayButtonClassName),he="bg-accent [&>button]:bg-primary [&>button]:text-primary-foreground [&>button]:hover:bg-primary [&>button]:hover:text-primary-foreground",_e=E(he,"day-range-start rounded-s-md",i.rangeStartClassName),Ee=E(he,"day-range-end rounded-e-md",i.rangeEndClassName),z=E("bg-accent !text-foreground [&>button]:bg-transparent [&>button]:!text-foreground [&>button]:hover:bg-transparent [&>button]:hover:!text-foreground",i.rangeMiddleClassName),L=E("[&>button]:bg-primary [&>button]:text-primary-foreground [&>button]:hover:bg-primary [&>button]:hover:text-primary-foreground",i.selectedClassName),U=E("[&>button]:bg-accent [&>button]:text-accent-foreground",i.todayClassName),ke=E("day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",i.outsideClassName),ce=E("text-muted-foreground opacity-50",i.disabledClassName),ue=E("invisible flex-1",i.hiddenClassName);return h.jsx(so,{showOutsideDays:e,className:E("p-3",t),style:{width:248.8*(M??1)+"px"},classNames:{months:v,month_caption:D,weekdays:x,weekday:g,month:p,caption:f,caption_label:N,button_next:Y,button_previous:G,nav:$,month_grid:I,week:A,day:te,day_button:Te,range_start:_e,range_middle:z,range_end:Ee,selected:L,today:U,outside:ke,disabled:ce,hidden:ue},components:{Chevron:({orientation:R})=>{const me=R==="left"?vt:xt;return h.jsx(me,{className:"h-4 w-4"})},Nav:({className:R})=>h.jsx(oo,{className:R,displayYears:d,navView:o,setDisplayYears:u,startMonth:b,endMonth:k,onPrevClick:m,onNextClick:l}),CaptionLabel:R=>h.jsx(io,{showYearSwitcher:n,navView:o,setNavView:c,displayYears:d,...R}),MonthGrid:({className:R,children:me,...ye})=>h.jsx(co,{children:me,className:R,displayYears:d,startMonth:b,endMonth:k,navView:o,setNavView:c,...ye}),...s},numberOfMonths:M,...i})}tn.displayName="Calendar";function oo({className:t,navView:e,startMonth:n,endMonth:r,displayYears:a,setDisplayYears:s,onPrevClick:i,onNextClick:o}){const{nextMonth:c,previousMonth:d,goToMonth:u}=fe(),l=e==="years"?n&&ie(new Date(a.from-1,0,1),n)<0||r&&ie(new Date(a.from-1,0,1),r)>0:!d,m=e==="years"?n&&ie(new Date(a.to+1,0,1),n)<0||r&&ie(new Date(a.to+1,0,1),r)>0:!c,b=W.useCallback(()=>{if(d){if(e==="years"){s(M=>({from:M.from-(M.to-M.from+1),to:M.to-(M.to-M.from+1)})),i==null||i(new Date(a.from-(a.to-a.from),0,1));return}u(d),i==null||i(d)}},[d,u]),k=W.useCallback(()=>{if(c){if(e==="years"){s(M=>({from:M.from+(M.to-M.from+1),to:M.to+(M.to-M.from+1)})),o==null||o(new Date(a.from+(a.to-a.from),0,1));return}u(c),o==null||o(c)}},[u,c]);return h.jsxs("nav",{className:E("flex items-center",t),children:[h.jsx(le,{variant:"outline",className:"absolute left-0 h-7 w-7 bg-transparent p-0 opacity-80 hover:opacity-100",type:"button",tabIndex:l?void 0:-1,disabled:l,"aria-label":e==="years"?`Go to the previous ${a.to-a.from+1} years`:Kt(),onClick:b,children:h.jsx(vt,{className:"h-4 w-4"})}),h.jsx(le,{variant:"outline",className:"absolute right-0 h-7 w-7 bg-transparent p-0 opacity-80 hover:opacity-100",type:"button",tabIndex:m?void 0:-1,disabled:m,"aria-label":e==="years"?`Go to the next ${a.to-a.from+1} years`:Jt(),onClick:k,children:h.jsx(xt,{className:"h-4 w-4"})})]})}function io({children:t,showYearSwitcher:e,navView:n,setNavView:r,displayYears:a,...s}){return e?h.jsx(le,{className:"h-7 w-full truncate text-sm font-medium",variant:"ghost",size:"sm",onClick:()=>r(i=>i==="days"?"years":"days"),children:n==="days"?t:a.from+" - "+a.to}):h.jsx("span",{...s,children:t})}function co({className:t,children:e,displayYears:n,startMonth:r,endMonth:a,navView:s,setNavView:i,...o}){return s==="years"?h.jsx(uo,{displayYears:n,startMonth:r,endMonth:a,setNavView:i,navView:s,className:t,...o}):h.jsx("table",{className:t,...o,children:e})}function uo({className:t,displayYears:e,startMonth:n,endMonth:r,setNavView:a,navView:s,...i}){const{goToMonth:o,selected:c}=fe();return h.jsx("div",{className:E("grid grid-cols-4 gap-y-2",t),...i,children:Array.from({length:e.to-e.from+1},(d,u)=>{const l=ie(new Date(e.from+u,11,31),n)<0,m=ie(new Date(e.from+u,0,0),r)>0,b=l||m;return h.jsx(le,{className:E("h-7 w-full text-sm font-normal text-foreground",e.from+u===new Date().getFullYear()&&"bg-accent font-medium text-accent-foreground"),variant:"ghost",onClick:()=>{a("days"),o(new Date(e.from+u,(c==null?void 0:c.getMonth())??0))},disabled:s==="years"?b:void 0,children:e.from+u},u)})})}const lo=({name:t,value:e,onChange:n,placeholder:r="Pilih tanggal",className:a})=>{const s=e?yt(e):void 0,i=o=>{if(o){const c=Ue(o,"yyyy-MM-dd");n(t,c)}};return h.jsxs(_n,{children:[h.jsx(En,{asChild:!0,children:h.jsxs("button",{type:"button",className:E("flex h-9 w-full items-center rounded-md border px-3 py-2 text-sm","border-gray-300 bg-white text-gray-900 placeholder:text-gray-500","hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary","transition-all duration-200 ease-in-out","disabled:cursor-not-allowed disabled:opacity-50","dark:border-zinc-700 dark:bg-zinc-900 dark:text-gray-100","dark:placeholder:text-gray-400 dark:focus:ring-primary/30 dark:focus:border-primary",a),children:[h.jsx(qn,{className:"mr-2 h-4 w-4 text-gray-500 dark:text-gray-400"}),e?Ue(yt(e),"yyyy-MM-dd"):h.jsx("span",{className:"text-muted-foreground",children:r})]})}),h.jsx(Yn,{className:"w-auto p-0",align:"start",children:h.jsx(tn,{mode:"single",selected:s,onSelect:i})})]})};function _o({data:t,errors:e,processing:n,setData:r,storeData:a,reset:s,applications:i,lembagasData:o}){var d;const c=o.map(u=>({value:u.npsn,label:u.name}));return h.jsx("form",{onSubmit:a,children:h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsxs("div",{children:[h.jsx(ge,{htmlFor:"application_id",children:"Aplikasi"}),h.jsxs(st,{value:((d=t.application_id)==null?void 0:d.toString())||"",onValueChange:u=>{var l;((l=t.application_id)==null?void 0:l.toString())!==u&&r("application_id",Number(u))},children:[h.jsx(ot,{className:"w-full",children:h.jsx(it,{placeholder:"-- Pilih Aplikasi --"})}),h.jsx(ct,{children:i.map(u=>h.jsx(je,{value:u.id.toString(),children:u.name},u.id))})]}),h.jsx("p",{className:"text-red-500 text-xs",children:e.application_id})]}),Fn(["super-admin"])&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{children:[h.jsx(ge,{htmlFor:"token_npsn",children:"Lembaga"}),h.jsx(Pn,{options:c,value:t.token_npsn||"",isDialog:!0,onValueChange:u=>{t.token_npsn!==u&&r("token_npsn",u)},clearable:!0,children:u=>h.jsx(jn,{...u})}),h.jsx("p",{className:"text-red-500 text-xs",children:e.token_npsn})]}),h.jsxs("div",{children:[h.jsx(ge,{htmlFor:"expired_at",children:"Tanggal Expired"}),h.jsx(lo,{name:"expired_at",value:t.expired_at,onChange:r}),h.jsx("p",{className:"text-red-500 text-xs",children:e.expired_at})]}),h.jsxs("div",{children:[h.jsx(ge,{htmlFor:"status",children:"Status"}),h.jsxs(st,{value:t.status||"",onValueChange:u=>r("status",u),children:[h.jsx(ot,{className:"w-full",children:h.jsx(it,{placeholder:"-- Pilih Status --"})}),h.jsxs(ct,{children:[h.jsx(je,{value:"active",children:"Aktif"}),h.jsx(je,{value:"in_active",children:"Tidak AKtif"}),h.jsx(je,{value:"suspended",children:"Diblokir"})]})]}),h.jsx("p",{className:"text-red-500 text-xs",children:e.status})]})]}),h.jsxs("div",{children:[h.jsx(ge,{htmlFor:"token",children:"Token"}),h.jsx(Ot,{value:t.token,onChange:u=>r("token",u.target.value),onGenerate:()=>{const u=Math.random().toString(36).substring(2,10).toUpperCase();r("token",u)},placeholder:"Token otomatis atau manual"}),h.jsx("p",{className:"text-red-500 text-xs",children:e.token})]}),h.jsxs("div",{children:[h.jsx(ge,{htmlFor:"description",children:"Deskripsi"}),h.jsx(Tn,{id:"description",name:"description",value:t.description,onChange:u=>r("description",u.target.value)}),h.jsx("p",{className:"text-red-500 text-xs",children:e.description})]}),h.jsxs("div",{className:"flex justify-between pt-4",children:[h.jsxs(le,{variant:"destructive",type:"button",onClick:()=>s(),children:[h.jsx(Bn,{className:"mr-1"})," Cancel"]}),h.jsxs(le,{variant:"default",type:"submit",disabled:n,children:[n?h.jsx(In,{className:"animate-spin mr-1"}):h.jsx(An,{className:"mr-1"})," Simpan Data"]})]})]})})}export{_o as default};
