@chynna/react-calendar
Version:
A flexible and feature-rich calendar component library for React applications with drag-and-drop support, multiple views (Day, Week, Month, Year), and plugin architecture
1 lines • 256 kB
JavaScript
"use strict";var e,t=require("react"),n=require("react/jsx-runtime"),r=require("lucide-react"),a=require("react-dom");exports.ViewType=void 0,(e=exports.ViewType||(exports.ViewType={})).DAY="day",e.WEEK="week",e.MONTH="month",e.YEAR="year";const o=100,s=8,i=150,l=80,d=90,c=119;class u{constructor(e=o){this.cache=new Map,this.accessOrder=[],this.maxSize=e}getKey(e){return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`}get(e){const t=this.getKey(e),n=this.cache.get(t);if(n)return this.updateAccessOrder(t),n}set(e,t){const n=this.getKey(e);if(this.cache.size>=this.maxSize){const e=this.accessOrder.shift();void 0!==e&&this.cache.delete(e)}this.cache.set(n,t),this.updateAccessOrder(n)}updateAccessOrder(e){const t=this.accessOrder.indexOf(e);t>-1&&this.accessOrder.splice(t,1),this.accessOrder.push(e)}getSize(){return this.cache.size}clear(){this.cache.clear(),this.accessOrder=[]}}const h=[{id:"blue",name:"Blue",isDefault:!0,colors:{eventColor:"#eff6ff",eventSelectedColor:"rgba(59, 130, 246)",lineColor:"#3b82f6",textColor:"#1e3a8a"},darkColors:{eventColor:"rgba(30, 64, 175, 0.8)",eventSelectedColor:"rgba(30, 58, 138, 1)",lineColor:"#3b82f6",textColor:"#dbeafe"}},{id:"green",name:"Green",isDefault:!0,colors:{eventColor:"#f0fdf4",eventSelectedColor:"rgba(16, 185, 129, 1)",lineColor:"#10b981",textColor:"#064e3b"},darkColors:{eventColor:"rgba(4, 120, 87, 0.8)",eventSelectedColor:"rgba(6, 78, 59, 1)",lineColor:"#10b981",textColor:"#d1fae5"}},{id:"purple",name:"Purple",isDefault:!0,colors:{eventColor:"#faf5ff",eventSelectedColor:"rgba(139, 92, 246, 1)",lineColor:"#8b5cf6",textColor:"#5b21b6"},darkColors:{eventColor:"rgba(109, 40, 217, 0.8)",eventSelectedColor:"rgba(91, 33, 182, 1)",lineColor:"#8b5cf6",textColor:"#ede9fe"}},{id:"yellow",name:"Yellow",isDefault:!0,colors:{eventColor:"#fefce8",eventSelectedColor:"rgba(245, 158, 11, 1)",lineColor:"#f59e0b",textColor:"#78350f"},darkColors:{eventColor:"rgba(180, 83, 9, 0.8)",eventSelectedColor:"rgba(120, 53, 15, 1)",lineColor:"#f59e0b",textColor:"#fef3c7"}},{id:"red",name:"Red",isDefault:!0,colors:{eventColor:"#fef2f2",eventSelectedColor:"rgba(239, 68, 68, 1)",lineColor:"#ef4444",textColor:"#7f1d1d"},darkColors:{eventColor:"rgba(185, 28, 28, 0.8)",eventSelectedColor:"rgba(127, 29, 29, 1)",lineColor:"#ef4444",textColor:"#fee2e2"}},{id:"orange",name:"Orange",isDefault:!0,colors:{eventColor:"#fff7edb3",eventSelectedColor:"rgba(249, 115, 22, 1)",lineColor:"#f97316",textColor:"#7c2d12"},darkColors:{eventColor:"rgba(194, 65, 12, 0.8)",eventSelectedColor:"rgba(124, 45, 18, 1)",lineColor:"#f97316",textColor:"#fed7aa"}},{id:"pink",name:"Pink",isDefault:!0,colors:{eventColor:"#fdf2f8",eventSelectedColor:"rgba(236, 72, 153, 1)",lineColor:"#ec4899",textColor:"#831843"},darkColors:{eventColor:"rgba(190, 24, 93, 0.8)",eventSelectedColor:"rgba(131, 24, 67, 1)",lineColor:"#ec4899",textColor:"#fce7f3"}},{id:"teal",name:"Teal",isDefault:!0,colors:{eventColor:"#f0fdfa",eventSelectedColor:"rgba(20, 184, 166, 1)",lineColor:"#14b8a6",textColor:"#134e4a"},darkColors:{eventColor:"rgba(15, 118, 110, 0.8)",eventSelectedColor:"rgba(19, 78, 74, 1)",lineColor:"#14b8a6",textColor:"#ccfbf1"}},{id:"indigo",name:"Indigo",isDefault:!0,colors:{eventColor:"#eef2ffb3",eventSelectedColor:"rgba(99, 102, 241, 1)",lineColor:"#6366f1",textColor:"#312e81"},darkColors:{eventColor:"rgba(67, 56, 202, 0.8)",eventSelectedColor:"rgba(49, 46, 129, 1)",lineColor:"#6366f1",textColor:"#e0e7ff"}},{id:"gray",name:"Gray",isDefault:!0,colors:{eventColor:"#f9fafbb3",eventSelectedColor:"rgba(107, 114, 128, 1)",lineColor:"#6b7280",textColor:"#1f2937"},darkColors:{eventColor:"rgba(75, 85, 99, 0.8)",eventSelectedColor:"rgba(31, 41, 55, 1)",lineColor:"#6b7280",textColor:"#f3f4f6"}}];class g{constructor(e,t,n="light"){this.calendars=new Map,this.defaultCalendarId=t||"blue",this.currentTheme=n;const r=e&&e.length>0;e?e.forEach(e=>{this.calendars.set(e.id,e)}):h.forEach(e=>{this.calendars.set(e.id,Object.assign(Object.assign({},e),{isVisible:!r&&e.isVisible}))})}register(e){this.calendars.set(e.id,e)}unregister(e){return this.calendars.delete(e)}get(e){return this.calendars.get(e)}getAll(){return Array.from(this.calendars.values())}getVisible(){return this.getAll().filter(e=>!1!==e.isVisible)}has(e){return this.calendars.has(e)}setVisibility(e,t){const n=this.calendars.get(e);n&&this.calendars.set(e,Object.assign(Object.assign({},n),{isVisible:t}))}setAllVisibility(e){this.calendars.forEach((t,n)=>{this.calendars.set(n,Object.assign(Object.assign({},t),{isVisible:e}))})}setDefaultCalendar(e){if(!this.has(e))throw new Error(`Calendar type '${e}' does not exist`);this.defaultCalendarId=e}getDefaultCalendarId(){return this.defaultCalendarId}getDefaultCalendar(){const e=this.get(this.defaultCalendarId);return e||this.getAll()[0]}setTheme(e){this.currentTheme=e}getTheme(){return this.currentTheme}resolveColors(e,t){const n=t||this.currentTheme,r=this.isDarkTheme(n);let a;return e&&(a=this.get(e)),a||(a=this.getDefaultCalendar()),r&&a.darkColors?a.darkColors:a.colors}getSelectedBgColor(e,t){return this.resolveColors(e,t).eventSelectedColor}getLineColor(e,t){return this.resolveColors(e,t).lineColor}getTextColor(e,t){return this.resolveColors(e,t).textColor}isDarkTheme(e){return"dark"===e||"light"!==e&&(!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches)}validate(e){const t=[];return e.id||t.push("Calendar type must have an id"),e.name||t.push("Calendar type must have a name"),e.colors?(e.colors.eventColor||t.push("Calendar colors must include eventColor"),e.colors.eventSelectedColor||t.push("Calendar colors must include eventSelectedColor"),e.colors.lineColor||t.push("Calendar colors must include lineColor"),e.colors.textColor||t.push("Calendar colors must include textColor")):t.push("Calendar type must have colors configuration"),t}}let f=new g;function m(){return f}const v=new class{constructor(){this.isDevelopment="production"!==process.env.NODE_ENV}formatMessage(e,t,...n){if(!this.isDevelopment)return;const r=(new Date).toISOString(),a=`[DayFlow ${e.toUpperCase()}] ${r}:`;switch(e){case"log":console.log(a,t,...n);break;case"warn":console.warn(a,t,...n);break;case"error":console.error(a,t,...n);break;case"debug":console.debug(a,t,...n)}}log(e,...t){this.formatMessage("log",e,...t)}warn(e,...t){this.formatMessage("warn",e,...t)}error(e,...t){this.formatMessage("error",e,...t)}debug(e,...t){this.formatMessage("debug",e,...t)}};function y(e,t="240px"){return"number"==typeof e?`${e}px`:"string"==typeof e&&e.trim().length>0?e:t}const p="240px";class x{constructor(e){var n,r,a,o;this.changeView=e=>{var t,n;if(!this.state.views.has(e))throw new Error(`View ${e} is not registered`);this.state.currentView=e,null===(n=(t=this.callbacks).onViewChange)||void 0===n||n.call(t,e)},this.getCurrentView=()=>{const e=this.state.views.get(this.state.currentView);if(!e)throw new Error(`Current view ${this.state.currentView} is not registered`);return e},this.setCurrentDate=e=>{var t,n;this.state.currentDate=new Date(e),null===(n=(t=this.callbacks).onDateChange)||void 0===n||n.call(t,this.state.currentDate),this.setVisibleMonth(this.state.currentDate)},this.getCurrentDate=()=>new Date(this.state.currentDate),this.setVisibleMonth=e=>{var t,n;const r=new Date(e.getFullYear(),e.getMonth(),1);this.visibleMonth.getFullYear()===r.getFullYear()&&this.visibleMonth.getMonth()===r.getMonth()||(this.visibleMonth=r,null===(n=(t=this.callbacks).onVisibleMonthChange)||void 0===n||n.call(t,new Date(this.visibleMonth)))},this.getVisibleMonth=()=>new Date(this.visibleMonth),this.goToToday=()=>{this.setCurrentDate(new Date)},this.goToPrevious=()=>{const e=new Date(this.state.currentDate);switch(this.state.currentView){case exports.ViewType.DAY:e.setDate(e.getDate()-1);break;case exports.ViewType.WEEK:e.setDate(e.getDate()-7);break;case exports.ViewType.MONTH:e.setMonth(e.getMonth()-1)}this.setCurrentDate(e)},this.goToNext=()=>{const e=new Date(this.state.currentDate);switch(this.state.currentView){case exports.ViewType.DAY:e.setDate(e.getDate()+1);break;case exports.ViewType.WEEK:e.setDate(e.getDate()+7);break;case exports.ViewType.MONTH:e.setMonth(e.getMonth()+1)}this.setCurrentDate(e)},this.selectDate=e=>{var t,n;this.setCurrentDate(e),null===(n=(t=this.callbacks).onDateChange)||void 0===n||n.call(t,new Date(e))},this.addEvent=e=>{var t,n;this.state.events=[...this.state.events,e],null===(n=(t=this.callbacks).onEventCreate)||void 0===n||n.call(t,e)},this.updateEvent=(e,t,n)=>{var r,a;const o=this.state.events.findIndex(t=>t.id===e);if(-1===o)throw new Error(`Event with id ${e} not found`);const s=Object.assign(Object.assign({},this.state.events[o]),t);this.state.events=[...this.state.events.slice(0,o),s,...this.state.events.slice(o+1)],n||null===(a=(r=this.callbacks).onEventUpdate)||void 0===a||a.call(r,s)},this.deleteEvent=e=>{var t,n;const r=this.state.events.findIndex(t=>t.id===e);if(-1===r)throw new Error(`Event with id ${e} not found`);this.state.events=[...this.state.events.slice(0,r),...this.state.events.slice(r+1)],null===(n=(t=this.callbacks).onEventDelete)||void 0===n||n.call(t,e)},this.getAllEvents=()=>[...this.state.events],this.getEvents=()=>{const e=this.getAllEvents(),t=new Set(this.calendarRegistry.getAll().filter(e=>!1!==e.isVisible).map(e=>e.id));return e.filter(e=>!e.calendarId||(!this.calendarRegistry.has(e.calendarId)||t.has(e.calendarId)))},this.getCalendars=()=>this.calendarRegistry.getAll(),this.setCalendarVisibility=(e,t)=>{var n,r;this.calendarRegistry.setVisibility(e,t),null===(r=(n=this.callbacks).onRender)||void 0===r||r.call(n)},this.setAllCalendarsVisibility=e=>{var t,n;this.calendarRegistry.setAllVisibility(e),null===(n=(t=this.callbacks).onRender)||void 0===n||n.call(t)},this.getSidebarConfig=()=>this.sidebarConfig,this.installPlugin=e=>{this.state.plugins.has(e.name)?v.warn(`Plugin ${e.name} is already installed`):(this.state.plugins.set(e.name,e),e.install(this))},this.getPlugin=e=>{const t=this.state.plugins.get(e);return null==t?void 0:t.api},this.hasPlugin=e=>this.state.plugins.has(e),this.render=()=>t.createElement("div",{className:"calendar-app"},"Calendar App"),this.getPluginConfig=e=>{const t=this.state.plugins.get(e);return(null==t?void 0:t.config)||{}},this.updatePluginConfig=(e,t)=>{const n=this.state.plugins.get(e);n&&(n.config=Object.assign(Object.assign({},n.config),t))},this.getViewConfig=e=>{const t=this.state.views.get(e);return(null==t?void 0:t.config)||{}},this.triggerRender=()=>{var e,t;null===(t=(e=this.callbacks).onRender)||void 0===t||t.call(e)},this.getCalendarRegistry=()=>this.calendarRegistry,this.getUseEventDetailDialog=()=>this.useEventDetailDialog,this.setTheme=e=>{var t,n;this.calendarRegistry.setTheme(e),this.themeChangeListeners.forEach(t=>{t(e)}),null===(n=(t=this.callbacks).onRender)||void 0===n||n.call(t)},this.getTheme=()=>this.calendarRegistry.getTheme(),this.subscribeThemeChange=e=>(this.themeChangeListeners.add(e),()=>{this.unsubscribeThemeChange(e)}),this.unsubscribeThemeChange=e=>{this.themeChangeListeners.delete(e)},this.state={currentView:e.defaultView||exports.ViewType.WEEK,currentDate:e.initialDate||new Date,events:e.events||[],switcherMode:e.switcherMode||"buttons",plugins:new Map,views:new Map},this.callbacks=e.callbacks||{},this.themeChangeListeners=new Set,this.calendarRegistry=new g(e.calendars,e.defaultCalendar,(null===(n=e.theme)||void 0===n?void 0:n.mode)||"light"),o=this.calendarRegistry,f=o,this.sidebarConfig=(e=>{if(!e)return{enabled:!1,width:p,initialCollapsed:!1};if(!0===e)return{enabled:!0,width:p,initialCollapsed:!1};const{enabled:t=!0,width:n,initialCollapsed:r=!1,render:a}=e;return{enabled:t,width:y(n,p),initialCollapsed:r,render:a}})(e.useSidebar),this.state.sidebar=this.sidebarConfig;const s=this.state.currentDate;this.visibleMonth=new Date(s.getFullYear(),s.getMonth(),1),this.useEventDetailDialog=null!==(r=e.useEventDetailDialog)&&void 0!==r&&r,e.views.forEach(e=>{this.state.views.set(e.type,e)}),null===(a=e.plugins)||void 0===a||a.forEach(e=>{this.installPlugin(e)})}}const b="p-2 flex justify-between",D="text-2xl font-semibold text-gray-900 dark:text-gray-100",w="relative overflow-y-auto calendar-content",C="w-20 flex-shrink-0 border-gray-200 dark:border-gray-700",E="relative h-[4.5rem] flex",M="absolute -top-2.5 right-2 text-[12px] text-gray-500 dark:text-gray-400",k="h-[4.5rem] border-t first:border-none border-gray-200 dark:border-gray-700 flex",T="absolute left-0 top-0 flex pointer-events-none",j="ml-2 text-white text-xs font-bold px-1.5 bg-red-500 rounded-sm",S="flex items-center border-b border-gray-200 dark:border-gray-700 sticky",N="w-20 flex-shrink-0 p-1 text-xs font-medium text-gray-500 dark:text-gray-400 flex justify-end",I="calendar-event select-none pointer-events-auto px-0.5",H="rounded-xl my-0.5",O="font-medium text-xs truncate pr-1",R="absolute left-1 top-1 bottom-1 w-[3px] rounded-full",P="h-3 w-3 mr-1",$="resize-handle absolute right-0 top-0 bottom-0 w-1 cursor-ew-resize opacity-0 group-hover:opacity-100 transition-opacity z-20",Y="grid grid-cols-7 gap-1 text-xs justify-items-center",L="text-center text-gray-500 dark:text-gray-400 font-medium py-1 h-6 w-6",A="text-center py-1 rounded text-xs h-6 w-6",V="text-gray-900 dark:text-gray-100",Z="text-gray-400 dark:text-gray-600",F="bg-blue-500 rounded-full text-white",z="bg-red-100 text-red-600 rounded-full font-medium",B="text-gray-600 dark:text-gray-300",W="text-xs",U="text-sm",q="flex flex-col",_="mr-1";function G(e,t,n,r,a){return X(t,((e,t)=>{const n=e[t];if(void 0===n)throw new TypeError(yo(t));return n})(e,t),n,r,a)}function X(e,t,n,r,a,o){const s=ve(t,n,r);if(a&&t!==s)throw new RangeError(mo(e,t,n,r,o));return s}function J(e){return null!==e&&/object|function/.test(typeof e)}function K(e,t=Map){const n=new t;return(t,...r)=>{if(n.has(t))return n.get(t);const a=e(t,...r);return n.set(t,a),a}}function Q(e){return ee({name:e},1)}function ee(e,t){return ae(e=>({value:e,configurable:1,writable:!t}),e)}function te(e){return ae(e=>({get:e,configurable:1}),e)}function ne(e){return{[Symbol.toStringTag]:{value:e,configurable:1}}}function re(e,t){const n={};let r=e.length;for(const a of t)n[e[--r]]=a;return n}function ae(e,t,n){const r={};for(const a in t)r[a]=e(t[a],a,n);return r}function oe(e,t,n){const r={};for(let a=0;a<t.length;a++){const o=t[a];r[o]=e(o,a,n)}return r}function se(e,t,n){const r={};for(let a=0;a<e.length;a++)r[t[a]]=n[e[a]];return r}function ie(e,t){const n=Object.create(null);for(const r of e)n[r]=t[r];return n}function le(e,t){for(const n of t)if(n in e)return 1;return 0}function de(e,t,n){for(const r of e)if(t[r]!==n[r])return 0;return 1}function ce(e,t,n){const r={...n};for(let n=0;n<t;n++)r[e[n]]=0;return r}function ue(e,...t){return(...n)=>e(...t,...n)}function he(e){return e[0].toUpperCase()+e.substring(1)}function ge(e){return e.slice().sort()}function fe(e,t){return String(t).padStart(e,"0")}function me(e,t){return Math.sign(e-t)}function ve(e,t,n){return Math.min(Math.max(e,t),n)}function ye(e,t){return[Math.floor(e/t),pe(e,t)]}function pe(e,t){return(e%t+t)%t}function xe(e,t){return[be(e,t),De(e,t)]}function be(e,t){return Math.trunc(e/t)||0}function De(e,t){return e%t||0}function we(e){return.5===Math.abs(e%1)}function Ce(e,t,n){let r=0,a=0;for(let o=0;o<=t;o++){const t=e[n[o]],s=hs[o],i=us/s,[l,d]=xe(t,i);r+=d*s,a+=l}const[o,s]=xe(r,us);return[a+o,s]}function Ee(e,t,n){const r={};for(let a=t;a>=0;a--){const t=hs[a];r[n[a]]=be(e,t),e=De(e,t)}return r}function Me(e){if(void 0!==e)return Te(e)}function ke(e){return He(Te(e))}function Te(e){return Ie(As(e))}function je(e,t){if(null==t)throw new RangeError(yo(e));return t}function Se(e){if(!J(e))throw new TypeError(fo);return e}function Ne(e,t,n=e){if(typeof t!==e)throw new TypeError(vo(n,t));return t}function Ie(e,t="number"){if(!Number.isInteger(e))throw new RangeError(io(t,e));return e||0}function He(e,t="number"){if(e<=0)throw new RangeError(lo(t,e));return e}function Oe(e){if("symbol"==typeof e)throw new TypeError(go);return String(e)}function Re(e,t){return J(e)?String(e):Ys(e,t)}function Pe(e){if("string"==typeof e)return BigInt(e);if("bigint"!=typeof e)throw new TypeError(ho(e));return e}function $e(e,t="number"){if("bigint"==typeof e)throw new TypeError(uo(t));if(e=Number(e),!Number.isFinite(e))throw new RangeError(co(t,e));return e}function Ye(e,t){return Math.trunc($e(e,t))||0}function Le(e,t){return Ie($e(e,t),t)}function Ae(e,t){return He(Ye(e,t),t)}function Ve(e,t){let[n,r]=xe(t,us),a=e+n;const o=Math.sign(a);return o&&o===-Math.sign(r)&&(a-=o,r+=o*us),[a,r]}function Ze(e,t,n=1){return Ve(e[0]+t[0]*n,e[1]+t[1]*n)}function Fe(e,t){return Ve(e[0],e[1]+t)}function ze(e,t){return Ze(t,e,-1)}function Be(e,t){return me(e[0],t[0])||me(e[1],t[1])}function We(e,t,n){return-1===Be(e,t)||1===Be(e,n)}function Ue(e,t=1){const n=BigInt(us/t);return[Number(e/n),Number(e%n)*t]}function qe(e,t=1){const n=us/t,[r,a]=xe(e,n);return[r,a*t]}function _e(e,t=1,n){const[r,a]=e,[o,s]=xe(a,t);return r*(us/t)+(o+(n?s/t:0))}function Ge(e,t,n=ye){const[r,a]=e,[o,s]=n(a,t);return[r*(us/t)+o,s]}function Xe(e){return G(e,"isoYear",li,ii,1),e.isoYear===li?G(e,"isoMonth",4,12,1):e.isoYear===ii&&G(e,"isoMonth",1,9,1),e}function Je(e){return Ke({...e,...ti,isoHour:12}),e}function Ke(e){const t=G(e,"isoYear",li,ii,1),n=t===li?1:t===ii?-1:0;return n&&Qe(at({...e,isoDay:e.isoDay+n,isoNanosecond:e.isoNanosecond-n})),e}function Qe(e){if(!e||We(e,si,oi))throw new RangeError(Fo);return e}function et(e){return Ce(e,5,Gs)[1]}function tt(e){const[t,n]=ye(e,us);return[Ee(n,5,Gs),t]}function nt(e){return Ge(e,ls)}function rt(e){return it(e.isoYear,e.isoMonth,e.isoDay,e.isoHour,e.isoMinute,e.isoSecond,e.isoMillisecond)}function at(e){const t=rt(e);if(void 0!==t){const[n,r]=xe(t,as);return[n,r*is+(e.isoMicrosecond||0)*ss+(e.isoNanosecond||0)]}}function ot(e,t){const[n,r]=tt(et(e)-t);return Qe(at({...e,isoDay:e.isoDay+r,...n}))}function st(...e){return it(...e)/os}function it(...e){const[t,n]=lt(...e),r=t.valueOf();if(!isNaN(r))return r-n*as}function lt(e,t=1,n=1,r=0,a=0,o=0,s=0){const i=e===li?1:e===ii?-1:0,l=new Date;return l.setUTCHours(r,a,o,s),l.setUTCFullYear(e,t-1,n+i),[l,i]}function dt(e,t){let[n,r]=Fe(e,t);r<0&&(r+=us,n-=1);const[a,o]=ye(r,is),[s,i]=ye(o,ss);return ct(n*as+a,s,i)}function ct(e,t=0,n=0){const r=Math.ceil(Math.max(0,Math.abs(e)-ai)/as)*Math.sign(e),a=new Date(e-r*as);return re(Js,[a.getUTCFullYear(),a.getUTCMonth()+1,a.getUTCDate()+r,a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds(),t,n])}function ut(e,t){if(t<-ai)throw new RangeError(Fo);const n=e.formatToParts(t),r={};for(const e of n)r[e.type]=e.value;return r}function ht(e){return[e.isoYear,e.isoMonth,e.isoDay]}function gt(e,t){return[t,0]}function ft(){return gi}function mt(e,t){switch(t){case 2:return yt(e)?29:28;case 4:case 6:case 9:case 11:return 30}return 31}function vt(e){return yt(e)?366:365}function yt(e){return e%4==0&&(e%100!=0||e%400==0)}function pt(e){const[t,n]=lt(e.isoYear,e.isoMonth,e.isoDay);return pe(t.getUTCDay()-n,7)||7}function xt(e){return this.id===Hs?(({isoYear:e})=>e<1?["gregory-inverse",1-e]:["gregory",e])(e):this.id===Os?mi(e):[]}function bt(e){const t=rt(e);if(t<fi){const{isoYear:t}=e;return t<1?["japanese-inverse",1-t]:["japanese",t]}const n=ut(kl(Os),t),{era:r,eraYear:a}=Ma(n,Os);return[r,a]}function Dt(e){return wt(e),Mt(e,1),e}function wt(e){return Et(e,1),e}function Ct(e){return de(Xs,e,Et(e))}function Et(e,t){const{isoYear:n}=e,r=G(e,"isoMonth",1,ft(),t);return{isoYear:n,isoMonth:r,isoDay:G(e,"isoDay",1,mt(n,r),t)}}function Mt(e,t){return re(Gs,[G(e,"isoHour",0,23,t),G(e,"isoMinute",0,59,t),G(e,"isoSecond",0,59,t),G(e,"isoMillisecond",0,999,t),G(e,"isoMicrosecond",0,999,t),G(e,"isoNanosecond",0,999,t)])}function kt(e){return void 0===e?0:Ri(Se(e))}function Tt(e,t=0){e=Yt(e);const n=Pi(e),r=$i(e,t);return[Ri(e),r,n]}function jt(e,t,n,r=9,a=0,o=4){t=Yt(t);let s=Hi(t,r,a),i=Rt(t),l=Vi(t,o);const d=Ii(t,r,a,1);return null==s?s=Math.max(n,d):Ft(s,d),i=Pt(i,d,1),e&&(l=(e=>e<4?(e+2)%4:e)(l)),[s,d,i,l]}function St(e,t=6,n){let r=Rt(e=Lt(e,vi));const a=Vi(e,7);let o=Ii(e,t);return o=je(vi,o),r=Pt(r,o,void 0,n),[o,r,a]}function Nt(e){return Yi(Yt(e))}function It(e,t){return Ht(Yt(e),t)}function Ht(e,t=4){const n=$t(e);return[Vi(e,4),...Ot(Ii(e,t),n)]}function Ot(e,t){return null!=e?[hs[e],e<4?9-3*e:-1]:[void 0===t?1:10**(9-t),t]}function Rt(e){const t=e[pi];return void 0===t?1:Ye(t,pi)}function Pt(e,t,n,r){const a=r?us:hs[t+1];if(a){const n=hs[t];if(a%((e=X(pi,e,1,a/n-(r?0:1),1))*n))throw new RangeError(vo(pi,e))}else e=X(pi,e,1,n?10**9:1,1);return e}function $t(e){let t=e[xi];if(void 0!==t){if("number"!=typeof t){if("auto"===Oe(t))return;throw new RangeError(vo(xi,t))}t=X(xi,Math.floor(t),0,9,1)}return t}function Yt(e){return void 0===e?{}:Se(e)}function Lt(e,t){return"string"==typeof e?{[t]:e}:Se(e)}function At(e){return{overflow:Ci[e]}}function Vt(e,t,n=9,r=0,a){let o=t[e];if(void 0===o)return a?r:void 0;if(o=Oe(o),"auto"===o)return a?r:null;let s=ns[o];if(void 0===s&&(s=Ws[o]),void 0===s)throw new RangeError(Do(e,o,ns));return X(e,s,r,n,1,rs),s}function Zt(e,t,n,r=0){const a=n[e];if(void 0===a)return r;const o=Oe(a),s=t[o];if(void 0===s)throw new RangeError(Do(e,o,t));return s}function Ft(e,t){if(t>e)throw new RangeError(_o)}function zt(e){return{branding:qi,epochNanoseconds:e}}function Bt(e,t,n){return{branding:Ui,calendar:n,timeZone:t,epochNanoseconds:e}}function Wt(e,t=e.calendar){return{branding:Bi,calendar:t,...ie(ei,e)}}function Ut(e,t=e.calendar){return{branding:zi,calendar:t,...ie(Ks,e)}}function qt(e,t=e.calendar){return{branding:Zi,calendar:t,...ie(Ks,e)}}function _t(e,t=e.calendar){return{branding:Fi,calendar:t,...ie(Ks,e)}}function Gt(e){return{branding:Wi,...ie(Qs,e)}}function Xt(e){return{branding:_i,sign:ur(e),...ie(Zs,e)}}function Jt(e){return Ge(e.epochNanoseconds,is)[0]}function Kt(e){return e.epochNanoseconds}function Qt(e,t){return _e(fr(e),hs[t],1)}function en(e,t,n,r,a,o,s){const i=Vs[n],l={...t,[i]:t[i]+r},d=s(e,a,t),c=s(e,a,l);return[o(d),o(c)]}function tn(e,t,n){const r=_e(ze(t,n));if(!r)throw new RangeError(Ho);return _e(ze(t,e))/r}function nn(e,t,n,r){return rn(e,sn(t,n),r)}function rn(e,t,n){const[r,a]=an(e,t,n);return Ke({...tr(e,a),...r})}function an(e,t,n){return tt(fn(et(e),t,n))}function on(e){return fn(e,ds,7)}function sn(e,t){return hs[e]*t}function ln(e){const t=dn(e);return[t,tr(t,1)]}function dn(e){return ni(6,e)}function cn(e,t,n){const r=Math.min(pr(e),6);return mr(gn(fr(e,r),t,n),r)}function un(e,t,n,r,a,o,s,i,l,d){if(0===r&&1===a)return e;const c=ir(r,i)?sr(i)&&r<6&&n>=6?yn:vn:pn;let[u,h,g]=c(e,t,n,r,a,o,s,i,l,d);return g&&7!==r&&(u=((e,t,n,r,a,o,s,i)=>{const l=ur(e);for(let d=r+1;d<=n;d++){if(7===d&&7!==n)continue;const r=_s(d,e);r[Vs[d]]+=l;const c=_e(ze(s(i(a,o,r)),t));if(c&&Math.sign(c)!==l)break;e=r}return e})(u,h,n,Math.max(6,r),s,i,l,d)),u}function hn(e,t,n,r,a){if(6===t){const t=(e=>e[0]+e[1]/us)(e);return[fn(t,n,r),0]}return gn(e,sn(t,n),r,a)}function gn(e,t,n,r){let[a,o]=e;r&&o<0&&(o+=us,a-=1);const[s,i]=ye(fn(o,t,n),us);return Ve(a+s,i)}function fn(e,t,n){return mn(e/t,n)*t}function mn(e,t){return Gi[t](e)}function vn(e,t,n,r,a,o){const s=ur(e),i=fr(e),l=hn(i,r,a,o),d=ze(i,l),c=Math.sign(l[0]-i[0])===s,u=mr(l,Math.min(n,6));return[{...e,...u},Ze(t,d),c]}function yn(e,t,n,r,a,o,s,i,l,d){const c=ur(e)||1,u=_e(fr(e,5)),h=sn(r,a);let g=fn(u,h,o);const[f,m]=en(s,{...e,...qs},6,c,i,l,d),v=g-_e(ze(f,m));let y=0;v&&Math.sign(v)!==c?t=Fe(f,g):(y+=c,g=fn(v,h,o),t=Fe(m,g));const p=vr(g);return[{...e,...p,days:e.days+y},t,Boolean(y)]}function pn(e,t,n,r,a,o,s,i,l,d){const c=ur(e),u=Vs[r],h=_s(r,e);7===r&&(e={...e,weeks:e.weeks+Math.trunc(e.days/7)});const g=be(e[u],a)*a;h[u]=g;const[f,m]=en(s,h,r,a*c,i,l,d),v=g+tn(t,f,m)*c*a,y=fn(v,a,o),p=Math.sign(y-v)===c;return h[u]=y,[h,p?m:f,p]}function xn(e,t,n,r){const[a,o,s,i]=(e=>{const t=Ht(e=Yt(e));return[e.timeZone,...t]})(r),l=void 0!==a;return((e,t,n,r,a,o)=>{n=gn(n,a,r,1);const s=t.R(n);return Sn(dt(n,s),o)+(e?Rn(on(s)):"Z")})(l,t(l?e(a):Xi),n.epochNanoseconds,o,s,i)}function bn(e,t,n){const[r,a,o,s,i,l]=(e=>{e=Yt(e);const t=Yi(e),n=$t(e),r=Ai(e),a=Vi(e,4),o=Ii(e,4);return[t,Li(e),r,a,...Ot(o,n)]})(n);return((e,t,n,r,a,o,s,i,l,d)=>{r=gn(r,l,i,1);const c=e(n).R(r);return Sn(dt(r,c),d)+Rn(on(c),s)+((e,t)=>1!==t?"["+(2===t?"!":"")+e+"]":"")(n,o)+Pn(t,a)})(e,t.calendar,t.timeZone,t.epochNanoseconds,r,a,o,s,i,l)}function Dn(e,t){const[n,r,a,o]=(e=>(e=Yt(e),[Yi(e),...Ht(e)]))(t);return s=e.calendar,i=n,l=o,Sn(rn(e,a,r),l)+Pn(s,i);var s,i,l}function wn(e,t){return n=e.calendar,r=e,a=Nt(t),Nn(r)+Pn(n,a);var n,r,a}function Cn(e,t){return Tn(e.calendar,In,e,Nt(t))}function En(e,t){return Tn(e.calendar,Hn,e,Nt(t))}function Mn(e,t){const[n,r,a]=It(t);return o=a,On(an(e,r,n)[0],o);var o}function kn(e,t){const[n,r,a]=It(t,3);return r>1&&hr(e={...e,...cn(e,r,n)}),((e,t)=>{const{sign:n}=e,r=-1===n?cr(e):e,{hours:a,minutes:o}=r,[s,i]=Ge(fr(r,3),ls,xe);gr(s);const l=Yn(i,t),d=t>=0||!n||l;return(n<0?"-":"")+"P"+jn({Y:An(r.years),M:An(r.months),W:An(r.weeks),D:An(r.days)})+(a||o||s||d?"T"+jn({H:An(a),M:An(o),S:An(s,d)+l}):"")})(e,a)}function Tn(e,t,n,r){const a=r>1||0===r&&e!==Is;return 1===r?e===Is?t(n):Nn(n):a?Nn(n)+$n(e,2===r):t(n)}function jn(e){const t=[];for(const n in e){const r=e[n];r&&t.push(r,n)}return t.join("")}function Sn(e,t){return Nn(e)+"T"+On(e,t)}function Nn(e){return In(e)+"-"+ts(e.isoDay)}function In(e){const{isoYear:t}=e;return(t<0||t>9999?Ln(t)+fe(6,Math.abs(t)):fe(4,t))+"-"+ts(e.isoMonth)}function Hn(e){return ts(e.isoMonth)+"-"+ts(e.isoDay)}function On(e,t){const n=[ts(e.isoHour),ts(e.isoMinute)];return-1!==t&&n.push(ts(e.isoSecond)+((e,t,n,r)=>Yn(e*is+t*ss+n,r))(e.isoMillisecond,e.isoMicrosecond,e.isoNanosecond,t)),n.join(":")}function Rn(e,t=0){if(1===t)return"";const[n,r]=ye(Math.abs(e),cs),[a,o]=ye(r,ds),[s,i]=ye(o,ls);return Ln(e)+ts(n)+":"+ts(a)+(s||i?":"+ts(s)+Yn(i):"")}function Pn(e,t){return 1!==t&&(t>1||0===t&&e!==Is)?$n(e,2===t):""}function $n(e,t){return"["+(t?"!":"")+"u-ca="+e+"]"}function Yn(e,t){let n=fe(9,e);return n=void 0===t?n.replace(el,""):n.slice(0,t),n?"."+n:""}function Ln(e){return e<0?"-":"+"}function An(e,t){return e||t?e.toLocaleString("fullwide",{useGrouping:0}):""}function Vn(e,t){const{epochNanoseconds:n}=e,r=(t.R?t:t(e.timeZone)).R(n),a=dt(n,r);return{calendar:e.calendar,...a,offsetNanoseconds:r}}function Zn(e,t,n,r=0,a=0,o,s){if(void 0!==n&&1===r&&(1===r||s))return ot(t,n);const i=e.I(t);if(void 0!==n&&3!==r){const e=((e,t,n,r)=>{const a=at(t);r&&(n=on(n));for(const t of e){let e=_e(ze(t,a));if(r&&(e=on(e)),e===n)return t}})(i,t,n,o);if(void 0!==e)return e;if(0===r)throw new RangeError(Vo)}return s?at(t):Fn(e,t,a,i)}function Fn(e,t,n=0,r=e.I(t)){if(1===r.length)return r[0];if(1===n)throw new RangeError(Zo);if(r.length)return r[3===n?1:0];const a=at(t),o=((e,t)=>{const n=e.R(Fe(t,-us));return(e=>{if(e>us)throw new RangeError(Ao);return e})(e.R(Fe(t,us))-n)})(e,a),s=o*(2===n?-1:1);return(r=e.I(dt(a,s)))[2===n?0:r.length-1]}function zn(e,t){const n=e.I(t);if(n.length)return n[0];const r=Fe(at(t),-us);return e.O(r,1)}function Bn(e,t,n){return zt(Qe(Ze(t.epochNanoseconds,(e=>{if(yr(e))throw new RangeError(Uo);return fr(e,5)})(e?cr(n):n))))}function Wn(e,t,n,r,a,o=Object.create(null)){const s=t(r.timeZone),i=e(r.calendar);return{...r,...Xn(s,i,r,n?cr(a):a,o)}}function Un(e,t,n,r,a=Object.create(null)){const{calendar:o}=n;return Wt(Jn(e(o),n,t?cr(r):r,a),o)}function qn(e,t,n,r,a){const{calendar:o}=n;return Ut(Kn(e(o),n,t?cr(r):r,a),o)}function _n(e,t,n,r,a){const o=n.calendar,s=e(o);let i=Je(Qn(s,n));t&&(r=dr(r)),r.sign<0&&(i=s.P(i,{...Us,months:1}),i=tr(i,-1));const l=s.P(i,r,a);return qt(Qn(s,l),o)}function Gn(e,t,n){return Gt(er(t,e?cr(n):n)[0])}function Xn(e,t,n,r,a){const o=fr(r,5);let s=n.epochNanoseconds;if(yr(r)){const i=tl(n,e);s=Ze(Fn(e,{...Kn(t,i,{...r,...qs},a),...ie(Gs,i)}),o)}else s=Ze(s,o),kt(a);return{epochNanoseconds:Qe(s)}}function Jn(e,t,n,r){const[a,o]=er(t,n);return Ke({...Kn(e,t,{...n,...qs,days:n.days+o},r),...a})}function Kn(e,t,n,r){if(n.years||n.months||n.weeks)return e.P(t,n,r);kt(r);const a=n.days+fr(n,5)[0];return a?Je(tr(t,a)):t}function Qn(e,t,n=1){return tr(t,n-e.day(t))}function er(e,t){const[n,r]=fr(t,5),[a,o]=tt(et(e)+r);return[a,n+o]}function tr(e,t){return t?{...e,...ct(rt(e)+t*as)}:e}function nr(e,t,n){const r=e(n.calendar);return sr(n)?[n,r,t(n.timeZone)]:[{...n,...ti},r]}function rr(e){return e?Kt:at}function ar(e){return e?ue(Xn,e):Jn}function or(e){return e?ue(ta,e):na}function sr(e){return e&&e.epochNanoseconds}function ir(e,t){return e<=6-(sr(t)?1:0)}function lr(e,t,n,r,a,o,s){const i=e(Yt(s).relativeTo),l=Math.max(pr(a),pr(o));if(ir(l,i))return Xt(hr(((e,t,n,r)=>{const a=Ze(fr(e),fr(t),r?-1:1);if(!Number.isFinite(a[0]))throw new RangeError(Fo);return{...Us,...mr(a,n)}})(a,o,l,r)));if(!i)throw new RangeError(Wo);r&&(o=cr(o));const[d,c,u]=nr(t,n,i),h=ar(u),g=or(u),f=h(c,d,a);return Xt(g(c,d,h(c,f,o),l))}function dr(e){return Xt(cr(e))}function cr(e){const t={};for(const n of Vs)t[n]=-1*e[n]||0;return t}function ur(e,t=Vs){let n=0;for(const r of t){const t=Math.sign(e[r]);if(t){if(n&&n!==t)throw new RangeError(Bo);n=t}}return n}function hr(e){for(const t of Bs)X(t,e[t],-nl,nl,1);return gr(_e(fr(e),ls)),e}function gr(e){if(!Number.isSafeInteger(e))throw new RangeError(zo)}function fr(e,t=6){return Ce(e,t,Vs)}function mr(e,t=6){const[n,r]=e,a=Ee(r,t,Vs);if(a[Vs[t]]+=n*(us/hs[t]),!Number.isFinite(a[Vs[t]]))throw new RangeError(Fo);return a}function vr(e,t=5){return Ee(e,t,Vs)}function yr(e){return Boolean(ur(e,zs))}function pr(e){let t=9;for(;t>0&&!e[Vs[t]];t--);return t}function xr(e,t){return[e,t]}function br(e){const t=Math.floor(e/Ji)*Ji;return[t,t+Ji]}function Dr(e){const t=Ir(e);if(void 0===t)throw new RangeError(Go(e));return t}function wr(e,t,n){let r=jr(Ys(e));if(!r||r.j)throw new RangeError(Go(e));return t?r.calendar===Is&&(r=-271821===r.isoYear&&4===r.isoMonth?{...r,isoDay:20,...ti}:{...r,isoDay:1,...ti}):n&&r.calendar===Is&&(r={...r,isoYear:hi}),Ut(r.C?Mr(r):kr(r))}function Cr(e){if(e.calendar!==Is)throw new RangeError(Xo(e.calendar))}function Er(e,t,n=0,r=0){const a=Ar(e.timeZone),o=rl(a);let s;return Dt(e),s=e.C?Zn(o,e,t,n,r,!o.$,e.j):zn(o,e),Bt(s,a,Ya(e.calendar))}function Mr(e){return Tr(Ke(Dt(e)))}function kr(e){return Tr(Je(wt(e)))}function Tr(e){return{...e,calendar:Ya(e.calendar)}}function jr(e){const t=vl.exec(e);return t?(e=>{const t=e[10],n="Z"===(t||"").toUpperCase();return{isoYear:Hr(e),isoMonth:parseInt(e[4]),isoDay:parseInt(e[5]),...Or(e.slice(5)),...Rr(e[16]),C:Boolean(e[6]),j:n,offset:n?void 0:t}})(t):void 0}function Sr(e){const t=fl.exec(e);return t?(e=>({isoYear:Hr(e),isoMonth:parseInt(e[4]),isoDay:1,...Rr(e[5])}))(t):void 0}function Nr(e){const t=ml.exec(e);return t?(e=>({isoYear:hi,isoMonth:parseInt(e[1]),isoDay:parseInt(e[2]),...Rr(e[3])}))(t):void 0}function Ir(e,t){const n=pl.exec(e);return n?((e,t)=>{const n=e[4]||e[5];if(t&&n)throw new RangeError(Xo(n));return(e=>{if(Math.abs(e)>=us)throw new RangeError(Lo);return e})((Lr(e[2])*cs+Lr(e[3])*ds+Lr(e[4])*ls+Pr(e[5]||""))*Yr(e[1]))})(n,t):void 0}function Hr(e){const t=Yr(e[1]),n=parseInt(e[2]||e[3]);if(t<0&&!n)throw new RangeError(Xo(-0));return t*n}function Or(e){const t=Lr(e[3]);return{...tt(Pr(e[4]||""))[0],isoHour:Lr(e[1]),isoMinute:Lr(e[2]),isoSecond:60===t?59:t}}function Rr(e){let t,n;const r=[];if(e.replace(xl,(e,a,o)=>{const s=Boolean(a),[i,l]=o.split("=").reverse();if(l){if("u-ca"===l)r.push(i),t||(t=s);else if(s||/[A-Z]/.test(l))throw new RangeError(Xo(e))}else{if(n)throw new RangeError(Xo(e));n=i}return""}),r.length>1&&t)throw new RangeError(Xo(e));return{timeZone:n,calendar:r[0]||Is}}function Pr(e){return parseInt(e.padEnd(9,"0"))}function $r(e){return new RegExp(`^${e}$`,"i")}function Yr(e){return e&&"+"!==e?-1:1}function Lr(e){return void 0===e?0:parseInt(e)}function Ar(e){const t=Zr(e);return"number"==typeof t?Rn(t):t?(e=>{if(Cl.test(e))throw new RangeError(Po(e));if(wl.test(e))throw new RangeError(Yo);return e.toLowerCase().split("/").map((e,t)=>(e.length<=3||/\d/.test(e))&&!/etc|yap/.test(e)?e.toUpperCase():e.replace(/baja|dumont|[a-z]+/g,(e,n)=>e.length<=2&&!t||"in"===e||"chat"===e?e.toUpperCase():e.length>2||!n?he(e).replace(/island|noronha|murdo|rivadavia|urville/,he):e)).join("/")})(e):Xi}function Vr(e){const t=Zr(e);return"number"==typeof t?t:t?t.resolvedOptions().timeZone:Xi}function Zr(e){const t=Ir(e=e.toUpperCase(),1);return void 0!==t?t:e!==Xi?Dl(e):void 0}function Fr(e,t){return Be(e.epochNanoseconds,t.epochNanoseconds)}function zr(e,t){return Be(e.epochNanoseconds,t.epochNanoseconds)}function Br(e,t){return Wr(e,t)||Ur(e,t)}function Wr(e,t){return me(rt(e),rt(t))}function Ur(e,t){return me(et(e),et(t))}function qr(e,t){if(e===t)return 1;try{return Vr(e)===Vr(t)}catch(e){}}function _r(e,t,n,r){const a=jt(e,r,3,5),o=oa(t.epochNanoseconds,n.epochNanoseconds,...a);return Xt(e?cr(o):o)}function Gr(e,t,n,r,a,o){const s=ca(r.calendar,a.calendar),[i,l,d,c]=jt(n,o,5),u=r.epochNanoseconds,h=a.epochNanoseconds,g=Be(h,u);let f;if(g)if(i<6)f=oa(u,h,i,l,d,c);else{const n=t(((e,t)=>{if(!qr(e,t))throw new RangeError($o);return e})(r.timeZone,a.timeZone)),u=e(s);f=ra(u,n,r,a,g,i,o),f=un(f,h,i,l,d,c,u,r,Kt,ue(Xn,n))}else f=Us;return Xt(n?cr(f):f)}function Xr(e,t,n,r,a){const o=ca(n.calendar,r.calendar),[s,i,l,d]=jt(t,a,6),c=at(n),u=at(r),h=Be(u,c);let g;if(h)if(s<=6)g=oa(c,u,s,i,l,d);else{const t=e(o);g=aa(t,n,r,h,s,a),g=un(g,u,s,i,l,d,t,n,at,Jn)}else g=Us;return Xt(t?cr(g):g)}function Jr(e,t,n,r,a){const o=ca(n.calendar,r.calendar);return Qr(t,()=>e(o),n,r,...jt(t,a,6,9,6))}function Kr(e,t,n,r,a){const o=ca(n.calendar,r.calendar),s=jt(t,a,9,9,8),i=e(o),l=Qn(i,n),d=Qn(i,r);return l.isoYear===d.isoYear&&l.isoMonth===d.isoMonth&&l.isoDay===d.isoDay?Xt(Us):Qr(t,()=>i,Je(l),Je(d),...s,8)}function Qr(e,t,n,r,a,o,s,i,l=6){const d=at(n),c=at(r);if(void 0===d||void 0===c)throw new RangeError(Fo);let u;if(Be(c,d))if(6===a)u=oa(d,c,a,o,s,i);else{const e=t();u=e.N(n,r,a),o===l&&1===s||(u=un(u,c,a,o,s,i,e,n,at,Kn))}else u=Us;return Xt(e?cr(u):u)}function ea(e,t,n,r){const[a,o,s,i]=jt(e,r,5,5),l=fn(da(t,n),sn(o,s),i),d={...Us,...vr(l,a)};return Xt(e?cr(d):d)}function ta(e,t,n,r,a,o){const s=Be(r.epochNanoseconds,n.epochNanoseconds);return s?a<6?sa(n.epochNanoseconds,r.epochNanoseconds,a):ra(t,e,n,r,s,a,o):Us}function na(e,t,n,r,a){const o=at(t),s=at(n),i=Be(s,o);return i?r<=6?sa(o,s,r):aa(e,t,n,i,r,a):Us}function ra(e,t,n,r,a,o,s){const[i,l,d]=((e,t,n,r)=>{function a(){return u={...tr(i,d++*-r),...s},h=Fn(e,u),Be(l,h)===-r}const o=tl(t,e),s=ie(Gs,o),i=tl(n,e),l=n.epochNanoseconds;let d=0;const c=da(o,i);let u,h;if(Math.sign(c)===-r&&d++,a()&&(-1===r||a()))throw new RangeError(Ho);const g=_e(ze(h,l));return[o,u,g]})(t,n,r,a);var c,u;return{...6===o?(c=i,u=l,{...Us,days:ia(c,u)}):e.N(i,l,o,s),...vr(d)}}function aa(e,t,n,r,a,o){const[s,i,l]=((e,t,n)=>{let r=t,a=da(e,t);return Math.sign(a)===-n&&(r=tr(t,-n),a+=us*n),[e,r,a]})(t,n,r);return{...e.N(s,i,a,o),...vr(l)}}function oa(e,t,n,r,a,o){return{...Us,...mr(hn(ze(e,t),r,a,o),n)}}function sa(e,t,n){return{...Us,...mr(ze(e,t),n)}}function ia(e,t){return la(rt(e),rt(t))}function la(e,t){return Math.trunc((t-e)/as)}function da(e,t){return et(t)-et(e)}function ca(e,t){if(e!==t)throw new RangeError(Ro);return e}function ua(e){return this.m(e)[0]}function ha(e){return this.m(e)[1]}function ga(e){const[t]=this.v(e);return la(this.p(t),rt(e))+1}function fa(e){const t=El.exec(e);if(!t)throw new RangeError(jo(e));return[parseInt(t[1]),Boolean(t[2])]}function ma(e,t){return"M"+ts(e)+(t?"L":"")}function va(e,t,n){return e+(t||n&&e>=n?1:0)}function ya(e,t){return e-(t&&e>=t?1:0)}function pa(e,t){return(t+e)*(Math.sign(t)||1)||0}function xa(e){return Rs[Da(e)]}function ba(e){return $s[Da(e)]}function Da(e){return La(e.id||Is)}function wa(e){function t(e){return((e,t)=>({...Ma(e,t),o:e.month,day:parseInt(e.day)}))(ut(n,e),r)}const n=kl(e),r=La(e);return{id:e,h:Ca(t),l:Ea(t)}}function Ca(e){return K(t=>{const n=rt(t);return e(n)},WeakMap)}function Ea(e){const t=e(0).year-ui;return K(n=>{let r,a=it(n-t),o=0;const s=[],i=[];do{a+=400*as}while((r=e(a)).year<=n);do{if(a+=(1-r.day)*as,r.year===n&&(s.push(a),i.push(r.o)),a-=as,++o>100||a<-ai)throw new RangeError(Ho)}while((r=e(a)).year>=n);return{i:s.reverse(),u:Qo(i.reverse())}})}function Ma(e,t){let n,r,a=ka(e);if(e.era){const o=Rs[t],s=Ps[t]||{};void 0!==o&&(n="islamic"===t?"ah":e.era.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g,""),"bc"===n||"b"===n?n="bce":"ad"===n||"a"===n?n="ce":"beforeroc"===n&&(n="broc"),n=s[n]||n,r=a,a=pa(r,o[n]||0))}return{era:n,eraYear:r,year:a}}function ka(e){return parseInt(e.relatedYear||e.year)}function Ta(e){const{year:t,o:n,day:r}=this.h(e),{u:a}=this.l(t);return[t,a[n]+1,r]}function ja(e,t=1,n=1){return this.l(e).i[t-1]+(n-1)*as}function Sa(e,t){const n=Na.call(this,e);return[ya(t,n),n===t]}function Na(e){const t=Pa(this,e),n=Pa(this,e-1),r=t.length;if(r>n.length){const e=ba(this);if(e<0)return-e;for(let e=0;e<r;e++)if(t[e]!==n[e])return e+1}}function Ia(e){return la(ja.call(this,e),ja.call(this,e+1))}function Ha(e,t){const{i:n}=this.l(e);let r=t+1,a=n;return r>n.length&&(r=1,a=this.l(e+1).i),la(n[t-1],a[r-1])}function Oa(e){return this.l(e).i.length}function Ra(e){const t=this.h(e);return[t.era,t.eraYear]}function Pa(e,t){return Object.keys(e.l(t).u)}function $a(e){return Ya(Ys(e))}function Ya(e){if((e=e.toLowerCase())!==Is&&e!==Hs){const t=kl(e).resolvedOptions().calendar;if(La(e)!==La(t))throw new RangeError(Oo(e));return t}return e}function La(e){return"islamicc"===e&&(e="islamic"),e.split("-")[0]}function Aa(e,t){return n=>n===Is?e:n===Hs||n===Os?Object.assign(Object.create(e),{id:n}):Object.assign(Object.create(t),Ml(n))}function Va(e,t,n,r){const a=Za(n,r,Ts,[],ps);if(void 0!==a.timeZone){const r=n.F(a),o=za(a),s=e(a.timeZone);return{epochNanoseconds:Zn(t(s),{...r,...o},void 0!==a.offset?Dr(a.offset):void 0),timeZone:s}}return{...n.F(a),...ti}}function Za(e,t,n,r=[],a=[]){return Fa(t,[...e.fields(n),...a].sort(),r)}function Fa(e,t,n,r=!n){const a={};let o,s=0;for(const r of t){if(r===o)throw new RangeError(xo(r));if("constructor"===r||"__proto__"===r)throw new RangeError(po(r));let t=e[r];if(void 0!==t)s=1,Yl[r]&&(t=Yl[r](t,r)),a[r]=t;else if(n){if(n.includes(r))throw new TypeError(yo(r));a[r]=Ns[r]}o=r}if(r&&!s)throw new TypeError(bo(t));return a}function za(e,t){return Mt(Ll({...Ns,...e}),t)}function Ba(e,t,n,r,a){t=ie(n=e.fields(n),t),r=Fa(r,a=e.fields(a),[]);let o=e.k(t,r);return o=Fa(o,[...n,...a].sort(),[]),e.F(o)}function Wa(e,t){const n=xa(e),r=Ps[e.id||""]||{};let{era:a,eraYear:o,year:s}=t;if(void 0!==a||void 0!==o){if(void 0===a||void 0===o)throw new TypeError(Eo);if(!n)throw new RangeError(Co);const e=n[r[a]||a];if(void 0===e)throw new RangeError(ko(a));const t=pa(o,e);if(void 0!==s&&s!==t)throw new RangeError(Mo);s=t}else if(void 0===s)throw new TypeError(To(n));return s}function Ua(e,t,n,r){let{month:a,monthCode:o}=t;if(void 0!==o){const t=((e,t,n,r)=>{const a=e.L(n),[o,s]=fa(t);let i=va(o,s,a);if(s){const t=ba(e);if(void 0===t)throw new RangeError(Io);if(t>0){if(i>t)throw new RangeError(Io);if(void 0===a){if(1===r)throw new RangeError(Io);i--}}else{if(i!==-t)throw new RangeError(Io);if(void 0===a&&1===r)throw new RangeError(Io)}}return i})(e,o,n,r);if(void 0!==a&&a!==t)throw new RangeError(So);a=t,r=1}else if(void 0===a)throw new TypeError(No);return X("month",a,1,e.B(n),r)}function qa(e,t,n,r,a){return G(t,"day",1,e.U(r,n),a)}function _a(e,t,n,r){let a=0;const o=[];for(const e of n)void 0!==t[e]?a=1:o.push(e);if(Object.assign(e,t),a)for(const t of r||o)delete e[t]}function Ga(e){const t=Pl(e.calendar),[n,r,a]=t.v(e),[o,s]=t.q(n,r);return{year:n,monthCode:ma(o,s),day:a}}function Xa(e,t){return Wt(tl(t,e))}function Ja(e,t){return Ut(tl(t,e))}function Ka(e,t){return Gt(tl(t,e))}function Qa(e,t,n){const r=new Set(n);return(a,o)=>{const s=n&&le(a,n);if(!le(a=((e,t)=>{const n={};for(const r in t)e.has(r)||(n[r]=t[r]);return n})(r,a),e)){if(o&&s)throw new TypeError("Invalid formatting options");a={...t,...a}}return n&&(a.timeZone=Xi,["full","long"].includes(a.J)&&(a.J="medium")),a}}function eo(e,t=to,n=0){const[r,,,a]=e;return(o,s=md,...i)=>{const l=t(a&&a(...i),o,s,r,n),d=l.resolvedOptions();return[l,...no(e,d,i)]}}function to(e,t,n,r,a){if(n=r(n,a),e){if(void 0!==n.timeZone)throw new TypeError(Ko);n.timeZone=e}return new di(t,n)}function no(e,t,n){const[,r,a]=e;return n.map(e=>(e.calendar&&((e,t,n)=>{if((n||e!==Is)&&e!==t)throw new RangeError(Ro)})(e.calendar,t.calendar,a),r(e,t)))}function ro(e,t){return{...e,calendar:t}}function ao(e){const t=oo();return dt(t,e.R(t))}function oo(){return qe(Date.now(),is)}function so(){return Ed||(Ed=(new di).resolvedOptions().timeZone)}const io=(e,t)=>`Non-integer ${e}: ${t}`,lo=(e,t)=>`Non-positive ${e}: ${t}`,co=(e,t)=>`Non-finite ${e}: ${t}`,uo=e=>`Cannot convert bigint to ${e}`,ho=e=>`Invalid bigint: ${e}`,go="Cannot convert Symbol to string",fo="Invalid object",mo=(e,t,n,r,a)=>a?mo(e,a[t],a[n],a[r]):vo(e,t)+`; must be between ${n}-${r}`,vo=(e,t)=>`Invalid ${e}: ${t}`,yo=e=>`Missing ${e}`,po=e=>`Invalid field ${e}`,xo=e=>`Duplicate field ${e}`,bo=e=>"No valid fields: "+e.join(),Do=(e,t,n)=>vo(e,t)+"; must be "+Object.keys(n).join(),wo="Invalid calling context",Co="Forbidden era/eraYear",Eo="Mismatching era/eraYear",Mo="Mismatching year/eraYear",ko=e=>`Invalid era: ${e}`,To=e=>"Missing year"+(e?"/era/eraYear":""),jo=e=>`Invalid monthCode: ${e}`,So="Mismatching month/monthCode",No="Missing month/monthCode",Io="Invalid leap month",Ho="Invalid protocol results",Oo=e=>vo("Calendar",e),Ro="Mismatching Calendars",Po=e=>vo("TimeZone",e),$o="Mismatching TimeZones",Yo="Forbidden ICU TimeZone",Lo="Out-of-bounds offset",Ao="Out-of-bounds TimeZone gap",Vo="Invalid TimeZone offset",Zo="Ambiguous offset",Fo="Out-of-bounds date",zo="Out-of-bounds duration",Bo="Cannot mix duration signs",Wo="Missing relativeTo",Uo="Cannot use large units",qo="Required smallestUnit or largestUnit",_o="smallestUnit > largestUnit",Go=e=>`Cannot parse: ${e}`,Xo=e=>`Invalid substring: ${e}`,Jo="Mismatching types for formatting",Ko="Cannot specify TimeZone",Qo=ue(oe,(e,t)=>t),es=ue(oe,(e,t,n)=>n),ts=ue(fe,2),ns={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},rs=Object.keys(ns),as=864e5,os=1e3,ss=1e3,is=1e6,ls=1e9,ds=6e10,cs=36e11,us=864e11,hs=[1,ss,is,ls,ds,cs,us],gs=rs.slice(0,6),fs=ge(gs),ms=["offset"],vs=["timeZone"],ys=gs.concat(ms),ps=ys.concat(vs),xs=["era","eraYear"],bs=xs.concat(["year"]),Ds=["year"],ws=["monthCode"],Cs=["month"].concat(ws),Es=["day"],Ms=Cs.concat(Ds),ks=ws.concat(Ds),Ts=Es.concat(Ms),js=Es.concat(Cs),Ss=Es.concat(ws),Ns=es(gs,0),Is="iso8601",Hs="gregory",Os="japanese",Rs={[Hs]:{"gregory-inverse":-1,gregory:0},[Os]:{"japanese-inverse":-1,japanese:0,meiji:1867,taisho:1911,showa:1925,heisei:1988,reiwa:2018},ethiopic:{ethioaa:0,ethiopic:5500},coptic:{"coptic-inverse":-1,coptic:0},roc:{"roc-inverse":-1,roc:0},buddhist:{be:0},islamic:{ah:0},indian:{saka:0},persian:{ap:0}},Ps={[Hs]:{bce:"gregory-inverse",ce:"gregory"},[Os]:{bce:"japanese-inverse",ce:"japanese"},ethiopic:{era0:"ethioaa",era1:"ethiopic"},coptic:{era0:"coptic-inverse",era1:"coptic"},roc:{broc:"roc-inverse",minguo:"roc"}},$s={chinese:13,dangi:13,hebrew:-6},Ys=ue(Ne,"string"),Ls=ue(Ne,"boolean"),As=ue(Ne,"number"),Vs=rs.map(e=>e+"s"),Zs=ge(Vs),Fs=Vs.slice(0,6),zs=Vs.slice(6),Bs=zs.slice(1),Ws=Qo(Vs),Us=es(Vs,0),qs=es(Fs,0),_s=ue(ce,Vs),Gs=["isoNanosecond","isoMicrosecond","isoMillisecond","isoSecond","isoMinute","isoHour"],Xs=["isoDay","isoMonth","isoYear"],Js=Gs.concat(Xs),Ks=ge(Xs),Qs=ge(Gs),ei=ge(Js),ti=es(Qs,0),ni=ue(ce,Js),ri=1e8,ai=ri*as,oi=[ri,0],si=[-ri,0],ii=275760,li=-271821,di=Intl.DateTimeFormat,ci="en-GB",ui=1970,hi=1972,gi=12,fi=it(1868,9,8),mi=K(bt,WeakMap),vi="smallestUnit",yi="unit",pi="roundingIncrement",xi="fractionalSecondDigits",bi="relativeTo",Di="direction",wi={constrain:0,reject:1},Ci=Object.keys(wi),Ei={compatible:0,reject:1,earlier:2,later:3},Mi={reject:0,use:1,prefer:2,ignore:3},ki={auto:0,never:1,critical:2,always:3},Ti={auto:0,never:1,critical:2},ji={auto:0,never:1},Si={floor:0,halfFloor:1,ceil:2,halfCeil:3,trunc:4,halfTrunc:5,expand:6,halfExpand:7,halfEven:8},Ni={previous:-1,next:1},Ii=ue(Vt,vi),Hi=ue(Vt,"largestUnit"),Oi=ue(Vt,yi),Ri=ue(Zt,"overflow",wi),Pi=ue(Zt,"disambiguation",Ei),$i=ue(Zt,"offset",Mi),Yi=ue(Zt,"calendarName",ki),Li=ue(Zt,"timeZoneName",Ti),Ai=ue(Zt,"offset",ji),Vi=ue(Zt,"roundingMode",Si),Zi="PlainYearMonth",Fi="PlainMonthDay",zi="PlainDate",Bi="PlainDateTime",Wi="PlainTime",Ui="ZonedDateTime",qi="Instant",_i="Duration",Gi=[Math.floor,e=>we(e)?Math.floor(e):Math.round(e),Math.ceil,e=>we(e)?Math.ceil(e):Math.round(e),Math.trunc,e=>we(e)?Math.trunc(e)||0:Math.round(e),e=>e<0?Math.floor(e):Math.ceil(e),e=>Math.sign(e)*Math.round(Math.abs(e))||0,e=>we(e)?(e=Math.trunc(e)||0)+e%2:Math.round(e)],Xi="UTC",Ji=5184e3,Ki=st(1847),Qi=st((new Date).getUTCFullYear()+10),el=/0+$/,tl=K(Vn,WeakMap),nl=2**32-1,rl=K(e=>{const t=Zr(e);return"object"==typeof t?new ol(t):new al(t||0)});class al{constructor(e){this.$=e}R(){return this.$}I(e){return(e=>{const t=at({...e,...ti});if(!t||Math.abs(t[0])>1e8)throw new RangeError(Fo)})(e),[ot(e,this.$)]}O(){}}class ol{constructor(e){this.nn=(e=>{function t(e){const t=ve(e,o,s),[i,l]=br(t),d=r(i),c=r(l);return d===c?d:n(a(i,l),d,c,e)}function n(t,n,r,a){let o,s;for(;(void 0===a||void 0===(o=a<t[0]?n:a>=t[1]?r:void 0))&&(s=t[1]-t[0]);){const n=t[0]+Math.floor(s/2);e(n)===r?t[1]=n:t[0]=n+1}return o}const r=K(e),a=K(xr);let o=Ki,s=Qi;return{tn(e){const n=t(e-86400),r=t(e+86400),a=e-n,o=e-r;if(n===r)return[a];const s=t(a);return s===t(o)?[e-s]:n>r?[a,o]:[]},rn:t,O(e,t){const i=ve(e,o,s);let[l,d]=br(i);const c=Ji*t,u=t<0?()=>d>o||(o=i,0):()=>l<s||(s=i,0);for(;u();){const o=r(l),s=r(d);if(o!==s){const r=a(l,d);n(r,o,s);const i=r[0];if((me(i,e)||1)===t)return i}l+=c,d+=c}}}})((e=>t=>{const n=ut(e,t*os);return st(ka(n),parseInt(n.month),parseInt(n.day),parseInt(n.hour),parseInt(n.minute),parseInt(n.second))-t})(e))}R(e){return this.nn.rn((e=>nt(e)[0])(e))*ls}I(e){const[t,n]=[st((r=e).isoYear,r.isoMonth,r.isoDay,r.isoHour,r.isoMinute,r.isoSecond),r.isoMillisecond*is+r.isoMicrosecond*ss+r.isoNanosecond];var r;return this.nn.tn(t).map(e=>Qe(Fe(qe(e,ls),n)))}O(e,t){const[n,r]=nt(e),a=this.nn.O(n+(t>0||r?1:0),t);if(void 0!==a)return qe(a,ls)}}const sl="([+-])",il="(?:[.,](\\d{1,9}))?",ll=`(?:(?:${sl}(\\d{6}))|(\\d{4}))-?(\\d{2})`,dl="(\\d{2})(?::?(\\d{2})(?::?(\\d{2})"+il+")?)?",cl=sl+dl,ul=ll+"-?(\\d{2})(?:[T ]"+dl+"(Z|"+cl+")?)?",hl="\\[(!?)([^\\]]*)\\]",gl=`((?:${hl}){0,9})`,fl=$r(ll+gl),ml=$r("(?:--)?(\\d{2})-?(\\d{2})"+gl),vl=$r(ul+gl),yl=$r("T?"+dl+"(?:"+cl+")?"+gl),pl=$r(cl),xl=new RegExp(hl,"g"),bl=$r(`${sl}?P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?:(\\d+)${il}H)?(?:(\\d+)${il}M)?(?:(\\d+)${il}S)?)?`),Dl=K(e=>new di(ci,{timeZone:e,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})),wl=/^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/,Cl=/[^\w\/:+-]+/,El=/^M(\d{2})(L?)$/,Ml=K(wa),kl=K(e=>new di(ci,{calendar:e,timeZone:Xi,era:"short",year:"numeric",month:"short",day:"numeric"})),Tl={P(e,t,n){const r=kt(n);let a,{years:o,months:s,weeks:i,days:l}=t;if(l+=fr(t,5)[0],o||s)a=((e,t,n,r,a)=>{let[o,s,i]=e.v(t);if(n){const[t,r]=e.q(o,s);o+=n,s=va(t,r,e.L(o)),s=X("month",s,1,e.B(o),a)}return r&&([o,s]=e.un(o,s,r)),i=X("day",i,1,e.U(o,s),a),e.p(o,s,i)})(this,e,o,s,r);else{if(!i&&!l)return e;a=rt(e)}if(void 0===a)throw new RangeError(Fo);return a+=(7*i+l)*as,Je(ct(a))},N(e,t,n){if(n<=7){let r=0,a=ia({...e,...ti},{...t,...ti});return 7===n&&([r,a]=xe(a,7)),{...Us,weeks:r,days:a}}const r=this.v(e),a=this.v(t);let[o,s,i]=((e,t,n,r,a,o,s)=>{let i=a-t,l=o-n,d=s-r;if(i||l){const c=Math.sign(i||l);let u=e.U(a,o),h=0;if(Math.sign(d)===-c){const r=u;[a,o]=e.un(a,o,-c),i=a-t,l=o-n,u=e.U(a,o),h=c<0?-r:u}if(d=s-Math.min(r,u)+h,i){const[r,s]=e.q(t,n),[d,u]=e.q(a,o);if(l=d-r||Number(u)-Number(s),Math.sign(l)===-c){const n=c<0&&-e.B(a);i=(a-=c)-t,l=o-va(r,s,e.L(a))+(n||e.B(a))}}}return[i,l,d]})(this,...r,...a);return 8===n&&(s+=this.cn(o,r[0]),o=0),{...Us,years:o,months:s,days:i}},F(e,t){const n=kt(t),r=Wa(this,e),a=Ua(this,e,r,n),o=qa(this,e,a,r,n);return Ut(Je(this.V(r,a,o)),this.id||Is)},K(e,t){const n=kt(t),r=Wa(this,e),a=Ua(this,e,r,n);return qt(Xe(this.V(r,a,1)),this.id||Is)},_(e,t){const n=kt(t);let r,a,o,s=void 0!==e.eraYear||void 0!==e.year?Wa(this,e):void 0;const i=!this.id;if(void 0===s&&i&&(s=hi),void 0!==s){const t=Ua(this,e,s,n);r=qa(this,e,t,s,n);const i=this.L(s);a=ya(t,i),o=t===i}else{if(void 0===e.monthCode)throw new TypeError(No);if([a,o]=fa(e.monthCode),this.id&&this.id!==Hs&&this.id!==Os)if(this.id&&"coptic"===La(this.id)&&0===n){const t=o||13!==a?30:6;r=e.day,r=ve(r,1,t)}else if(this.id&&"chinese"===La(this.id)&&0===n){const t=!o||1!==a&&9!==a&&10!==a&&11!==a&&12!==a?30:29;r=e.day,r=ve(r,1,t)}else r=e.day;else r=qa(this,e,Ua(this,e,hi,n),hi,n)}const l=this.G(a,o,r);if(!l)throw new RangeError("Cannot guess year");const[d,c]=l;return _t(Je(this.V(d,c,r)),this.id||Is)},fields(e){return xa(this)&&e.includes("year")?[...e,...xs]:e},k(e,t){const n=Object.assign(Object.create(null),e);return _a(n,t,Cs),xa(this)&&(_a(n,t,bs),this.id===Os&&_a(n,t,js,xs)),n},inLeapYear(e){const[t]=this.v(e);return this.sn(t)},monthsInYear(e){const[t]=this.v(e);return this.B(t)},daysInMonth(e){const[t,n]=this.v(e);return this.U(t,n)},daysInYear(e){const[t]=this.v(e);return this.fn(t)},dayOfYear:ga,era(e){return this.hn(e)[0]},eraYear(e){return this.hn(e)[1]},monthCode(e){const[t,n]=this.v(e),[r,a]=this.q(t,n);return ma(r,a)},dayOfWeek:pt,daysInWeek:()=>7},jl={v:ht,hn:xt,q:gt},Sl={dayOfYear:ga,v:ht,p:it},Nl=Object.assign({},Sl,{weekOfYear:ua,yearOfWeek:ha,m(e){function t(e){return(7-e<r?7:0)-e}fu