rrule-temporal 2.2.5 → 2.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ const e=(e,t)=>`Non-positive ${e}: ${t}`,t=(e,t)=>`Non-finite ${e}: ${t}`,n=e=>`Cannot convert bigint to ${e}`,r=(e,t,n,r)=>i(e,t)+`; must be between ${n}-${r}`,i=(e,t)=>`Invalid ${e}: ${t}`;function a(e){return e===void 0?Object.create(null):f(e)}function o(e,r=`number`){if(typeof e==`bigint`)throw TypeError(n(r));if(e=Number(e),!Number.isFinite(e))throw RangeError(t(r,e));return e}function s(e,t){return Math.trunc(o(e,t))||0}function c(e,t){return l(s(e,t),t)}function l(t,n=`number`){if(t<=0)throw RangeError(e(n,t));return t}function u(e,t,n){return Math.min(Math.max(e,t),n)}function d(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function f(e){if(!d(e))throw TypeError(`Invalid object`);return e}const p=i,m=e=>`Missing ${e}`,h=e=>`No valid fields: `+e.join(),g=(e,t,n)=>i(e,t)+`; must be `+Object.keys(n).join(),_=e=>`Missing year`+(e?`/era/eraYear`:``),v=`Invalid leap month`,ee=e=>i(`Calendar`,e),te=e=>i(`TimeZone`,e),ne=e=>`Cannot parse: ${e}`,re=e=>`Invalid substring: ${e}`,ie=u,y=d;function b(e){throw RangeError(e)}function x(e){throw TypeError(e)}function ae(e,t,n,r,i){return oe(t,((e,t)=>{let n=e[t];return n===void 0&&x(m(t)),n})(e,t),n,r,i)}function oe(e,t,n,i,a,o){let s=ie(t,n,i);return a&&t!==s&&b(((e,t,n,i,a)=>a?r(e,a[t],a[n],a[i]):r(e,t,n,i))(e,t,n,i,o)),s}function S(e,t=Map){let n=new t;return(t,...r)=>{if(n.has(t))return n.get(t);let i=e(t,...r);return n.set(t,i),i}}const se=e=>ce({name:e},1),ce=(e,t)=>ue(e=>({value:e,configurable:1,writable:!t}),e),le=e=>({[Symbol.toStringTag]:{value:e,configurable:1}});function ue(e,t){let n={};for(let r in t)n[r]=e(t[r],r);return n}function de(e,t){let n={};for(let r of e)n[r]=t;return n}function fe(e){let t={};for(let n of e)t[n]=e=>e[n];return t}function C(e,t,n=Object.create(null)){for(let r of e)n[r]=t[r];return n}function pe(e,t,n){for(let r of e)if(t[r]!==n[r])return 0;return 1}function me(e,t,n){let r={...n};for(let n=0;n<t;n++)r[e[n]]=0;return r}function w(e,...t){return(...n)=>e(...t,...n)}function he(){}function ge(e){return e[0].toUpperCase()+e.substring(1)}function T(...e){return[].concat(...e).sort()}function _e(e){return RegExp(`^${e}$`,`i`)}function ve(e){return parseInt(e.padEnd(9,`0`))}function ye(e){return e&&e!==`+`?-1:1}function be(e){return e===void 0?0:parseInt(e)}function xe(e,t){return String(t).padStart(e,`0`)}const Se=w(xe,2);function E(e,t){return Math.sign(e-t)}function D(e,t){return e<t?-1:e>t?1:0}function Ce(e,t){let n=e/t;return e%t<0n?n-1n:n}function we(e,t){let n=Ce(e,t);return[n,e-n*t]}function Te(e,t){return[Math.floor(e/t),Ee(e,t)]}function Ee(e,t){return(e%t+t)%t}function De(e,t){return Math.trunc(e/t)||0}function Oe(e,t){return e%t||0}function ke(e,t=1){return t*(.5+e/5)}function Ae(e){return Math.abs(e%1)===.5}const je={bce:-1,ce:0};function Me(e){let t=e.normalize(`NFD`).toLowerCase().replace(/[^a-z0-9]/g,``);return t===`bc`||t===`b`?`bce`:t===`ad`||t===`a`?`ce`:t}function Ne(e){return e===void 0?`iso8601`:e===0?`gregory`:e.id}const Pe=/^M(\d{2})(L?)$/;function Fe(e){let t=Pe.exec(e);return t||b((e=>`Invalid monthCode: ${e}`)(e)),[parseInt(t[1]),!!t[2]]}function Ie(e,t){return`M`+Se(e)+(t?`L`:``)}function Le(e,t,n){return e+(t||n&&e>=n?1:0)}function Re(e,t){return e-(t&&e>=t?1:0)}const ze={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},Be=Object.keys(ze),Ve=864e5,He=1e3,Ue=1e6,We=1e9,Ge=6e10,Ke=36e11,qe=864e11,Je=[1,He,Ue,We,Ge,Ke,qe],Ye=BigInt(He),Xe=BigInt(Ue),Ze=BigInt(We),Qe=BigInt(Ge),$e=BigInt(Ke),O=BigInt(qe);function et(e,t){let n=Number(e/O),r=Number(e%O);return qe/t*n+(Math.trunc(r/t)+r%t/t)}const k=Be.slice(0,6),tt=fe(k),nt=[`year`],rt=[`day`],it=[`day`,`month`,`year`],at=[`offset`],ot=[`timeZone`],st=[`era`,`eraYear`],ct=[`era`,`eraYear`,`year`],lt=[`month`,`monthCode`],ut=[`day`,`month`,`monthCode`],dt=T(k),ft=T(st,nt),pt=T(lt,nt),mt=T(st,pt),ht=T([`monthCode`],nt),gt=T(st,ht),_t=T(rt,[`monthCode`]),vt=T(rt,pt),yt=T(rt,st,pt),bt=T(vt,k),xt=T(yt,k),St=T(vt,k,at),Ct=T(yt,k,at),wt=T(vt,k,at,ot),Tt=T(yt,k,at,ot),Et=T(rt,ht),Dt=T(rt,st,ht),Ot=de(k,0);function kt(e){return jt(e,1),e}const At={hour:23,minute:59,second:59};function jt(e,t){let n={};for(let r of k)n[r]=oe(r,e[r],0,At[r]||999,t);return n}function Mt(e){return Pt(e)*We+Ft(e)}function Nt(e){return 1e3*Pt(e)+e.millisecond}function Pt(e){return 3600*e.hour+60*e.minute+e.second}function Ft(e){return e.millisecond*Ue+e.microsecond*He+e.nanosecond}function It(e){let[t,n]=Te(e,qe);return[Lt(n),t]}function Lt(e){let[t,n]=Te(e,Ue),[r,i]=Te(n,He);return Rt(t,r,i)}function Rt(e,t=0,n=0){let[r,i]=Te(e,36e5),[a,o]=Te(i,6e4),[s,c]=Te(o,1e3);return{hour:r,minute:a,second:s,millisecond:c,microsecond:t,nanosecond:n}}function zt(e){let[t,n]=we(e,Ze);return[Number(t),Number(n)]}function Bt(e){return Ht(e)+BigInt(Mt(e))}function Vt(e){return Ut(e)+Nt(e)}function Ht(e){return BigInt(Wt(e))*O}function Ut(e){return 864e5*Wt(e)}function Wt(e){return Gt(e.year,e.month,e.day)}function Gt(e,t=1,n=1){let r=t-1;return e+=Math.floor(r/12),t=Ee(r,12),Date.UTC(e%400-400,t,0)/864e5+146097*(De(e,400)+1)+n}function Kt(e){let[t,n]=we(e,O);return{...Jt(Number(t)),...Lt(Number(n))}}function qt(e,t=0,n=0){let[r,i]=Te(e,864e5);return{...Jt(r),...Rt(i,t,n)}}function Jt(e){let t=new Date(864e5*Ee(e,146097));return{year:t.getUTCFullYear()+400*Math.floor(e/146097),month:t.getUTCMonth()+1,day:t.getUTCDate()}}function Yt(e,t){return Math.trunc((t-e)/864e5)}function Xt(e){return[e,0]}function Zt(e,t){if(!t)return{year:1972,month:e}}function Qt(e,t,n){return{year:e,month:t,day:n}}function $t(e,t){switch(t){case 2:return tn(e)?29:28;case 4:case 6:case 9:case 11:return 30}return 31}function en(e){return tn(e)?366:365}function tn(e){return e%4==0&&(e%100!=0||e%400==0)}function nn(e,t,n){return e+=De(n,12),(t+=Oe(n,12))<1?(e--,t+=12):t>12&&(e++,t-=12),{year:e,month:t}}function rn(e,t,n,r){return 12*(n-e)+r-t}function an(e){return Ee(Gt(e.year,e.month,e.day)+4,7)||7}function on(e){return Gt(e.year,e.month,e.day)-Gt(e.year)+1}function sn(e){let t=e.year,n=Math.floor((on(e)-an(e)+10)/7),r=cn(t);return n<1?n=r=cn(--t):n>r&&(n=1,r=cn(++t)),{weekOfYear:n,yearOfWeek:t,Ie:r}}function cn(e){let t=an({year:e,month:1,day:1});return t===4||t===3&&tn(e)?53:52}function ln({year:e}){return e<1?{era:`bce`,eraYear:1-e}:{era:`ce`,eraYear:e}}function un(e){return dn(e),kt(e)}function dn(e){return pn(e,1),e}function fn(e){return pe(it,e,pn(e))}function pn(e,t){let{year:n}=e,r=ae(e,`month`,1,12,t);return{year:n,month:r,day:ae(e,`day`,1,$t(n,r),t)}}function A(e,t){return e?e.ie(t):t}function mn(e,t,n){return e?e.O(t,n):Xt(n)}function hn(e,t){return e===0?ln(t):e?e.h(t):{}}function gn(e,t,n,r){return e?e.je(t,n,r):Qt(t,n,r)}function _n(e,t){return e?e.k(t):12}function vn(e,t,n){return e?e.p(t,n):$t(t,n)}function yn(e,t){let{year:n,month:r}=A(e,t),[i,a]=mn(e,n,r);return Ie(i,a)}function bn(e,t){let{year:n}=A(e,t);return e?e.u(n):tn(n)}function xn(e,t){let{year:n}=A(e,t);return _n(e,n)}function Sn(e,t){let{year:n,month:r}=A(e,t);return vn(e,n,r)}function Cn(e,t){let{year:n}=A(e,t);return e?e.j(n):en(n)}function wn(e,t){if(!e)return on(t);let{year:n}=A(e,t),r=gn(e,n,1,1);return Wt(t)-Wt(r)+1}function Tn(e,t){return e===void 0?sn(t).weekOfYear:void 0}function En(e,t){return e===void 0?sn(t).yearOfWeek:void 0}const j=Be.map(e=>e+`s`),Dn=fe(j),On=T(j),kn=j.slice(0,6),An=j.slice(6),jn=An.slice(1),Mn=j.reduce((e,t,n)=>(e[t]=n,e),{}),M=de(j,0),Nn=de(kn,0),Pn=w(me,j);function Fn(e,t){return t??b(m(e)),t}const N=w(In,`string`);function In(e,t,n=e){return typeof t!==e&&x(p(n,t)),t}function Ln(e,t=`number`){return Number.isInteger(e)||b(((e,t)=>`Non-integer ${e}: ${t}`)(t,e)),e||0}function Rn(e){return typeof e==`symbol`&&x(`Cannot convert Symbol to string`),String(e)}function zn(e,t){return d(e)?String(e):N(e,t)}function Bn(e){return typeof e==`boolean`?BigInt(e?1:0):typeof e==`string`?BigInt(e):(typeof e!=`bigint`&&x(`Invalid bigint: ${e}`),e)}function Vn(e,t){return Ln(o(e,t),t)}function Hn(e,t){return typeof e==`string`?((e,t)=>{let n=Object.create(null);return n[e]=t,n})(t,e):f(e)}const Un=`smallestUnit`,Wn={constrain:0,reject:1},Gn={compatible:0,reject:1,earlier:2,later:3},Kn={reject:0,use:1,prefer:2,ignore:3},qn={auto:0,never:1,critical:2,always:3},Jn={auto:0,never:1,critical:2},Yn={auto:0,never:1},Xn={floor:0,halfFloor:1,ceil:2,halfCeil:3,trunc:4,halfTrunc:5,expand:6,halfExpand:7,halfEven:8},Zn=[Math.floor,e=>Ae(e)?Math.floor(e):Math.round(e),Math.ceil,e=>Ae(e)?Math.ceil(e):Math.round(e),Math.trunc,e=>Ae(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=>Ae(e)?(e=Math.trunc(e)||0)+e%2:Math.round(e)],Qn={previous:-1,next:1};function $n(e){let t=e.roundingIncrement;return t===void 0?1:s(t,`roundingIncrement`)}function er(e){let t=e.fractionalSecondDigits;if(t!==void 0){if(typeof t!=`number`){if(Rn(t)===`auto`)return;b(p(`fractionalSecondDigits`,t))}t=oe(`fractionalSecondDigits`,Math.floor(t),0,9,1)}return t}function tr(e,t,n=0,r){let i=t[e];if(i===void 0)return r?n:void 0;if(i=Rn(i),i===`auto`)return r?n:null;let a=ze[i];return a===void 0&&(a=Mn[i]),a===void 0&&b(g(e,i,ze)),a}function nr(e,t,n,r=0){let i=n[e];if(i===void 0)return r;let a=Rn(i),o=t[a];return o===void 0&&b(g(e,a,t)),o}const rr=w(tr,Un),ir=w(tr,`largestUnit`),ar=w(tr,`unit`),or=w(nr,`overflow`,Wn),sr=w(nr,`disambiguation`,Gn),cr=w(nr,`offset`,Kn),lr=w(nr,`calendarName`,qn),ur=w(nr,`timeZoneName`,Jn),dr=w(nr,`offset`,Yn),fr=w(nr,`roundingMode`,Xn),pr=w(nr,`direction`,Qn);function mr(e,t,n,r){let i=r?qe:Je[t+1];if(i){let n=Je[t];i%((e=oe(`roundingIncrement`,e,1,i/n-(r?0:1),1))*n)&&b(p(`roundingIncrement`,e))}else e=oe(`roundingIncrement`,e,1,n?10**9:1,1);return e}function hr(e,t,n,r){return t!=null&&oe(e,t,n,r,1,Be),t}function gr(e,t){t>e&&b(`smallestUnit > largestUnit`)}function _r(e,t,n,r=9,i=0,o=4){t=a(t);let s=ir(t,i),c=$n(t),l=fr(t,o),u=rr(t,i,1);return s=hr(`largestUnit`,s,i,r),u=hr(Un,u,i,r),s==null?s=Math.max(n,u):gr(s,u),c=mr(c,u,1),e&&(l=(e=>e<4?(e+2)%4:e)(l)),[s,u,c,l]}function vr(e,t=6,n){let r=$n(e=Hn(e,Un)),i=fr(e,7),a=rr(e);return a=Fn(Un,a),a=hr(Un,a,0,t),r=mr(r,a,void 0,n),[a,r,i]}function P(e,t){return C(it,e,C(k,t))}function F(e){return e===void 0?0:or(f(e))}function yr(e,t=0){e=a(e);let n=sr(e),r=cr(e,t);return[or(e),r,n]}const br=BigInt(1e8)*O,xr=BigInt(-1e8)*O,Sr=xr-O,Cr=-3261848;function wr(e){let t=12*e.year+e.month;return(t<Cr||t>3309129)&&b(`Out-of-bounds date`),e}function Tr(e,t=1){return Dr(Ht(e),t),e}function Er(e){let t=Ht(e);return Dr(t),t!==Sr||Mt(e)||b(`Out-of-bounds date`),e}function Dr(e,t=1){(e<(t?Sr:xr)||e>br)&&b(`Out-of-bounds date`)}function Or(e){return(e<xr||e>br)&&b(`Out-of-bounds date`),e}function kr(e,t){return Or(Ht(e)+BigInt(Mt(e)-t))}function Ar(e){return{epochNanoseconds:e}}function jr(e,t,n){return{calendar:n,timeZone:t,epochNanoseconds:e}}function Mr(e,t){return C(k,e,I(e,t))}function I(e,t){return C(it,e,{calendar:t})}function Nr(e){return C(k,e)}function L(e){return C(j,e,{sign:ta(e)})}function Pr(e){return t=e.epochNanoseconds,Number(Ce(t,Xe));var t}function Fr(e){return e.epochNanoseconds}function Ir(e,t,n){let r=ua(t),[i,a]=((e,t)=>{let n=t((e=Hn(e,`unit`)).relativeTo),r=ar(e);return r=Fn(`unit`,r),[r,n]})(n,e);if(!a&&qi(Math.max(i,r),a))return Rr(t,i);if(a||b(`Missing relativeTo`),!t.sign&&qi(i,a))return 0;let o=Vi(a),s=o.G(o.i,t);Wi(o,s);let c=o.re(o.i,s,i);return qi(i,a)?Rr(c,i):Lr(c,o.V(s),i,o)}function Lr(e,t,n,r){let i=ta(e)||1,a=zr(Pn(n,e),n,i,r,t),o=a.ae,s=a.de,c=Number(s-o),l=Number(t-o);return a.ye[j[n]]+l/c*i}function Rr(e,t){return et(ia(e),Je[t])}function zr(e,t,n,r,i){let a=j[t],o=e,s=0,c=Br(o,a,n,r);return i&&!((e,t,n,r)=>r>0?D(t,e)<=0&&D(e,n)<=0:D(n,e)<=0&&D(e,t)<=0)(i,c.ae,c.de,Math.sign(n))&&(o={...e,[a]:e[a]+n},s=1,c=Br(o,a,n,r)),{...c,ye:o,He:s}}function Br(e,t,n,r){let i={...e,[t]:e[t]+n};return{ae:Hi(r,e),de:Hi(r,i),Ae:i}}function Vr(e,t,n){let r=n-t,i=e-t;if(!i)return 0;let a=i<0n?-i:i,o=r<0n?-r:r,s=D(i,0n)===D(r,0n)?1:-1;return D(a,o)<=0?a===o?s:ke(D(2n*a,o),s):Number(i)/Number(r)}function Hr(e,t,n,r){let{epochNanoseconds:i}=e,{timeZone:a,calendar:o}=e;if(t===0&&n===1)return{epochNanoseconds:i,timeZone:a,calendar:o};if(t===6){let t=P(R(e),Ot),n=P(vi(t,1),Ot),o=ui(a,t),s=ui(a,n);i=ni(Vr(i,o,s),r)?s:o}else{let o=R(e),s=o.offsetNanoseconds;i=ci(a,Gr(o,Jr(t,n),r),s,2,0,1)}return{epochNanoseconds:i,timeZone:a,calendar:o}}function Ur(e){let{timeZone:t}=e,n=P(R(e),Ot),r=P(vi(n,1),Ot),i=ui(t,n);return et(ui(t,r)-i,Ke)}function Wr(e){let{timeZone:t,calendar:n}=e;return jr(ui(t,P(R(e),Ot)),t,n)}function Gr(e,t,n){let[r,i]=Kr(e,t,n),a=P(vi(e,i),r);return Er(a),a}function Kr(e,t,n){return It(ti(Mt(e),t,n))}function qr(e){return ti(e,Ge,7)}function Jr(e,t){return Je[e]*t}function Yr(e,t){return BigInt(Je[e])*BigInt(t)}function Xr(e,t,n){let r=Math.min(ua(e),6);return sa(Qr(ia(e),BigInt(t),n),r)}function Zr(e,t,n,r,i,a,o){if(r===0&&i===1)return e;let s=ta(e)||1,[c,l,u]=(qi(r,o.i)?Ui(o.i)&&r<6&&n>=6?ii:ri:ai)(s,e,t,n,r,i,a,o);return u&&r!==7&&(c=((e,t,n,r,i,a)=>{for(let o=r+1;o<=n;o++){if(o===7&&n!==7)continue;let r=Pn(o,e);r[j[o]]+=i;let s=D(t,Hi(a,r));if(s&&s!==i)break;e=r}return e})(c,l,n,Math.max(6,r),s,o)),c}function Qr(e,t,n){return ei(e,t,n,e/t%2n)}function $r(e,t,n){let[r,i]=we(e,O),a=r*O;return a+ei(i,t,n,(a/t+i/t)%2n)}function ei(e,t,n,r){let i=e/t,a=e%t,o=0;a&&(o=ke(D(2n*(a<0n?-a:a),t),Math.sign(Number(a))));let s=ni(Number(r)+o,n);return(i-r+BigInt(s))*t}function ti(e,t,n){return ni(e/t,n)*t}function ni(e,t){return Zn[t](e)}function ri(e,t,n,r,i,a,o){let s=ia(t),c=Qr(s,Yr(i,a),o),l=c-s,u=Math.sign(Number(c/O)-Number(s/O))===e,d=sa(c,Math.min(r,6));return[{...t,...d},n+l,u]}function ii(e,t,n,r,i,a,o,s){let c=Number(aa(t)),l=Jr(i,a),u=ti(c,l,o),d=zr({...t,...Nn},6,e,s,n),f=d.ae,p=d.de,m=u-Number(p-f),h=0;m&&Math.sign(m)!==e?n=f+BigInt(u):(h+=e,u=ti(m,l,o),n=p+BigInt(u));let g=ca(u);return[{...t,...g,days:t.days+h},n,!!h]}function ai(e,t,n,r,i,a,o,s){let c=j[i],l=Pn(i,t);i===7&&(t={...t,weeks:t.weeks+Math.trunc(t.days/7)}),l[c]=De(t[c],a)*a;let u=zr(l,i,a*e,s,n),d=u.ae,f=u.de,p=Vr(n,d,f),m=u.ye[c],h=u.Ae[c],g=ti(m+p*e*a,a,o),_=g===h;return l[c]=g,[l,_?f:d,u.He||_]}function oi(e,t){return e.timeZone.U(e.epochNanoseconds,(e=>{let t=pr(Hn(e,`direction`),0);return t||b(p(`direction`,t)),t})(t))}const R=S(si,WeakMap);function si(e){let{epochNanoseconds:t,timeZone:n}=e,r=n.C(t);return{...Kt(t+BigInt(r)),offsetNanoseconds:r}}function ci(e,t,n,r=0,i=0,a,o){if(n!==void 0&&r===1&&(r===1||o))return kr(t,n);r!==2&&r!==0||Tr(t,0);let s=e.R(t);if(n!==void 0&&r!==3){let e=((e,t,n,r)=>{let i=Bt(t);r&&(n=qr(n));for(let t of e){let e=Number(i-t);if(r&&(e=qr(e)),e===n)return t}})(s,t,n,a);if(e!==void 0)return e;r===0&&b(`Invalid TimeZone offset`)}return o?Bt(t):li(e,t,i,s)}function li(e,t,n=0,r=e.R(t)){if(r.length===1)return r[0];if(n===1&&b(`Ambiguous offset`),r.length)return r[n===3?1:0];let i=Bt(t),a=((e,t)=>{let n=e.C(t-O);return(e=>(e>864e11&&b(`Out-of-bounds TimeZone gap`),e))(e.C(t+O)-n)})(e,i),o=Kt(i+BigInt(a*(n===2?-1:1)));return(r=e.R(o))[n===2?0:r.length-1]}function ui(e,t){let n=e.R(t);if(n.length)return n[0];let r=Bt(t)-O;return e.U(r,1)}function di(e,t,n,r,i){let a=F(i);return r.sign&&ua(r)<8&&b(`Cannot use small units`),gi(t,yi(t,Tr(gi(t,n)),e?z(r):r,a))}function fi(e,t){return Or(e+(la(n=t)&&b(`Cannot use large units`),aa(n)));var n}function pi(e,t,n){let{calendar:r,epochNanoseconds:i,timeZone:a}=e,o=aa(t),s=i;if(la(t)){let i=R(e);s=li(a,P(hi(r,i,{...t,...Nn},n),i))+o}else s+=o,F(n);return{...e,epochNanoseconds:Or(s)}}function mi(e,t,n,r){let[i,a]=_i(t,n),o=P(hi(e,t,{...n,...Nn,days:n.days+a},r),i);return Er(o),o}function hi(e,t,n,r){if(n.years||n.months||n.weeks)return yi(e,t,n,F(r));F(r);let i=n.days+Number(aa(n)/O);return i?Tr(vi(t,i)):t}function gi(e,t){return vi(t,1-A(e,t).day)}function _i(e,t){let n=aa(t),r=Number(n/O),i=Number(n%O),[a,o]=It(Mt(e)+i);return[a,r+o]}function vi(e,t){return t?Jt(Wt(e)+t):e}function yi(e,t,n,r){let{years:i,months:a,weeks:o,days:s}=n,c;if(s+=Number(aa(n)/O),i||a)c=bi(e,t,i,a,r);else{if(!o&&!s)return t;c=t}return(o||s)&&(c=vi(c,7*o+s)),Tr(c)}function bi(e,t,n,r,i){let{year:a,month:o,day:s}=A(e,t);if(n){let[t,r]=mn(e,a,o);a+=n,o=xi(e,t,r,e?e.q(a):void 0,i),o=oe(`month`,o,1,_n(e,a),i)}if(r){let t=e?e.N(a,o,r):nn(a,o,r);({year:a,month:o}=t)}return s=oe(`day`,s,1,vn(e,a,o),i),gn(e,a,o,s)}function xi(e,t,n,r,i){if(n){let n=e?e.m:void 0;return r!==void 0&&(n<0||r===t+1)?r:(i===1&&b(v),n<0?-n:t)}return Le(t,0,r)}function Si(e,t){return Ne(e)!==Ne(t)&&b(`Mismatching Calendars`),e}function Ci(e,t){return e.o!==t.o&&b(`Mismatching TimeZones`),e}function wi(e){return e.timeZone.id}function Ti(e,t,n,r){let[i,a,o,s]=_r(e,r,3,5),c=Ri(t.epochNanoseconds,n.epochNanoseconds,i,a,o,s);return L(e?z(c):c)}function Ei(e,t,n,r,i){let[a,o,s,c]=_r(e,i,5),l=n.epochNanoseconds,u=r.epochNanoseconds,d;return D(u,l)?a<6?d=Ri(l,u,a,o,s,c):(d=Mi(Ci(n.timeZone,r.timeZone),t,n,r,a),d=Zr(d,u,a,o,s,c,Bi(n,Fr,pi))):d=M,L(e?z(d):d)}function Di(e,t,n,r,i){let[a,o,s,c]=_r(e,i,6),l=Bt(n),u=Bt(r),d=D(u,l),f;return d?a<=6?f=Ri(l,u,a,o,s,c):(f=Pi(t,n,r,d,a),f=Zr(f,u,a,o,s,c,Bi(n,Bt,w(mi,t)))):f=M,L(e?z(f):f)}function Oi(e,t,n,r,i){let[a,o,s,c]=_r(e,i,6,9,6);return Ai(e,t,n,r,a,o,s,c)}function ki(e,t,n,r,i){let[a,o,s,c]=_r(e,i,9,9,8),l=gi(t,n),u=gi(t,r);return Ii(l,u)?Ai(e,t,Tr(l),Tr(u),a,o,s,c,8):L(M)}function Ai(e,t,n,r,i,a,o,s,c=6){let l=Ht(n),u=Ht(r),d;return D(u,l)?i===6?d=Ri(l,u,i,a,o,s):(d=Fi(t,n,r,i),a===c&&o===1||(d=Zr(d,u,i,a,o,s,Bi(n,Ht,w(hi,t))))):d=M,L(e?z(d):d)}function ji(e,t,n,r){let[i,a,o,s]=_r(e,r,5,5),c=ti(Mt(n)-Mt(t),Jr(a,o),s),l={...M,...ca(c,i)};return L(e?z(l):l)}function Mi(e,t,n,r,i){let a=D(r.epochNanoseconds,n.epochNanoseconds);if(!a)return M;if(i<6)return{...M,...sa(r.epochNanoseconds-n.epochNanoseconds,i)};if(!Ii(R(n),R(r)))return{...M,...sa(r.epochNanoseconds-n.epochNanoseconds,5)};let[o,s,c]=Li(e,n,r,a);return{...i===6?{...M,days:zi(o,s)}:Fi(t,o,s,i),...ca(c)}}function Ni(e,t,n,r){let i=Bt(t),a=Bt(n),o=D(a,i);return o?r<=6?{...M,...sa(a-i,r)}:Pi(e,t,n,o,r):M}function Pi(e,t,n,r,i){let a=n,o=Mt(n)-Mt(t);return Math.sign(o)===-r&&(a=vi(n,-r),o+=864e11*r),{...Fi(e,t,a,i),...ca(o)}}function Fi(e,t,n,r){if(r<=7){let e=zi(t,n);return r===7?{...M,weeks:De(e,7),days:Oe(e,7)}:{...M,days:e}}let i=A(e,t),a=A(e,n);if(r===8){let{year:r,month:o,day:s}=i,{year:c,month:l,day:u}=a,d=Math.sign(E(c,r)||E(l,o)||zi(t,n)),f=0,p=0;if(d){f=e?e.ne(r,o,c,l):rn(r,o,c,l);let i=bi(e,t,0,f,0);d*E(s,u)>0&&(f-=d,i=bi(e,t,0,f,0)),p=zi(i,n)}return{...M,months:f,days:p}}let{year:o,month:s,day:c}=i,{year:l,month:u,day:d}=a,f=l-o,p=u-s,m=d-c;if(f||p){let t=Math.sign(f||p),n=vn(e,l,u),r=0;if(Math.sign(d-c)===-t){let i=n,a=e?e.N(l,u,-t):nn(l,u,-t);({year:l,month:u}=a),f=l-o,p=u-s,n=vn(e,l,u),r=t<0?-i:n}if(m=d-Math.min(c,n)+r,f){let[n,r]=mn(e,o,s),[i,a]=mn(e,l,u),c=e?e.m:void 0;if(p=c!==void 0&&r&&!a&&(c<0?t>0&&i===-c:t<0&&i===n)?0:i-n||Number(a)-Number(r),Math.sign(p)===-t){let i=t<0&&-_n(e,l);l-=t,f=l-o,p=u-xi(e,n,r,e?e.q(l):void 0,0)+(i||_n(e,l))}else if(e){let t=xi(e,n,r,e.q(l),0);p=e.ne(l,t,l,u)}}}return{...M,years:f,months:p,days:m}}function Ii(e,t){return E(e.year,t.year)||E(e.month,t.month)||E(e.day,t.day)}function Li(e,t,n,r){let i=R(t),a=R(n),o=n.epochNanoseconds,s=0,c=Mt(a)-Mt(i);Math.sign(c)===-r&&s++;let l=s+(r>0?1:0);for(;s<=l;s++){let t=vi(a,s*-r),n=li(e,P(t,i));if(D(o,n)!==-r)return[i,t,Number(o-n)]}}function Ri(e,t,n,r,i,a){return{...M,...sa(Qr(t-e,Yr(r,i),a),n)}}function zi(e,t){return Wt(t)-Wt(e)}function Bi(e,t,n){return{i:e,V:t,G:n}}function Vi(e){let{calendar:t}=e;if(Ui(e)){let{timeZone:n}=e;return{i:e,V:Fr,G:pi,re:w(Mi,n,t)}}return{i:Gi(e),V:Bt,G:w(mi,t),re:w(Ni,t)}}function Hi(e,t){return e.V(e.G(e.i,t))}function Ui(e){return`timeZone`in e}function Wi(e,t){Ui(e.i)||(Ki(e.i),Ki(t))}function Gi(e){return P(e,`hour`in e?e:Ot)}function Ki(e){Er(Gi(e))}function qi(e,t){return e<=6-(t&&Ui(t)?1:0)}function Ji(e,t,n){let r={};for(let i=t;i>=0;i--){let t=Je[i];r[n[i]]=De(e,t),e=Oe(e,t)}return r}const Yi=2**53;function Xi(e,t,n,r,i){let o=e(a(i).relativeTo),s=Math.max(ua(n),ua(r));if(qi(s,o))return Zi(t,n,r,s);o||b(`Missing relativeTo`),t&&(r=z(r));let c=Vi(o),l=c.G(c.i,n),u=c.G(l,r);return L(c.re(c.i,u,s))}function Zi(e,t,n,r){return L(na(((e,t,n,r)=>{let i=ia(e)+ia(t)*BigInt(r?-1:1);return Number.isFinite(Number(i/O))||b(`Out-of-bounds date`),{...M,...sa(i,n)}})(t,n,r,e)))}function Qi(e,t,n){let r=ua(t),[i,a,o,s,c]=((e,t,n)=>{e=Hn(e,Un);let r=ir(e),i=n(e.relativeTo),a=$n(e),o=fr(e,7),s=rr(e);return r===void 0&&s===void 0&&b(`Required smallestUnit or largestUnit`),s??=0,r??=Math.max(s,t),gr(r,s),a=mr(a,s,1),a>1&&s>5&&r!==s&&b(`For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit`),[r,s,a,o,i]})(n,r,e);if(!c&&Math.max(r,i)<=6)return L(na(((e,t,n,r,i)=>{let a=Qr(ia(e),Yr(n,r),i);return{...M,...sa(a,t)}})(t,i,a,o,s)));let l=c&&Ui(c)&&i>=6&&a<6;if(!t.sign&&!l)return t;c||b(`Missing relativeTo`);let u=Vi(c),d=u.G(u.i,t);Wi(u,d);let f=u.re(u.i,d,i);return f=Zr(f,u.V(d),i,a,o,s,u),L(f)}function $i(e){return e.sign===-1?ea(e):e}function ea(e){return L(z(e))}function z(e){let t={};for(let n of j)t[n]=-1*e[n]||0;return t}function ta(e,t=j){let n=0;for(let r of t){let t=Math.sign(e[r]);t&&(n&&n!==t&&b(`Cannot mix duration signs`),n=t)}return n}function na(e){for(let t of jn)oe(t,e[t],-4294967295,4294967295,1);let t=ia(e);return ra(Number(t/Ze)),e}function ra(e){Number.isSafeInteger(e)||b(`Out-of-bounds duration`)}function ia(e){return BigInt(e.days)*O+aa(e)}function aa(e){return BigInt(e.hours)*$e+BigInt(e.minutes)*Qe+oa(e)}function oa(e){return BigInt(e.seconds)*Ze+BigInt(e.milliseconds)*Xe+BigInt(e.microseconds)*Ye+BigInt(e.nanoseconds)}function sa(e,t=6){let n=Number(e/O),r=Number(e%O),i=Je[t],a=t<=3?Number(e/BigInt(i)):qe/i*n+De(r,i);Number.isFinite(a)||b(`Out-of-bounds date`),t<=3&&Math.abs(a)/(We/Je[t])>=Yi&&b(`Out-of-bounds date`);let o=Ji(r,t,j);return o[j[t]]=a,o}function ca(e,t=5){return Ji(e,t,j)}function la(e){return!!ta(e,An)}function ua(e){let t=9;for(;t>0&&!e[j[t]];t--);return t}function da(e,t){return D(e.epochNanoseconds,t.epochNanoseconds)}function fa(e,t){return D(e.epochNanoseconds,t.epochNanoseconds)}function pa(e,t,n,r){let i=e(a(r).relativeTo),o=Math.max(ua(t),ua(n));if(pe(j,t,n))return 0;if(qi(o,i))return D(ia(t),ia(n));i||b(`Missing relativeTo`);let s=Vi(i);return D(Hi(s,t),Hi(s,n))}function ma(e,t){return ha(e,t)||ga(e,t)}function ha(e,t){return E(Wt(e),Wt(t))}function ga(e,t){return E(Mt(e),Mt(t))}function _a(e,t){return!da(e,t)}function va(e,t){return!fa(e,t)&&e.timeZone.o===t.timeZone.o&&e.calendar===t.calendar}function ya(e,t){return!ma(e,t)&&e.calendar===t.calendar}function ba(e,t){return!ha(e,t)&&e.calendar===t.calendar}function xa(e,t){return!ha(e,t)&&e.calendar===t.calendar}function Sa(e,t){return!ha(e,t)&&e.calendar===t.calendar}function Ca(e,t){return!ga(e,t)}function wa(e){return e===0?je:e?e.l:void 0}function B(e,t,n=t){return wa(e)?n:t}function Ta(e,t){let n=e||void 0,r=wa(e),{era:i,eraYear:a,year:o}=t;if(o!==void 0&&(o=s(o,`year`)),a!==void 0&&(a=s(a,`eraYear`)),i!==void 0||a!==void 0){i!==void 0&&a!==void 0||x(`Mismatching era/eraYear`),r||b(`Forbidden era/eraYear`);let e=Me(i),t=r[e];t===void 0&&b((e=>`Invalid era: ${e}`)(i));let s=n?.te?n.te(a,e,t):Oa(a,t);o!==void 0&&o!==s&&b(`Mismatching year/eraYear`),o=s}else o===void 0&&x(_(r));return o}function Ea(e,t,n,r,i){let{month:a,monthCode:o}=t;if(o!==void 0){let t=((e,t,n,r,i=Fe(t))=>{let a=e?e.q(n):void 0,[o,s]=i,c=Le(o,s,a);if(s){let t=e?e.m:void 0;t===void 0&&b(v),t>0?(c>t&&b(v),a!==c&&(r===1&&b(v),c=Le(o,0,a))):(c!==-t&&b(v),a===void 0&&r===1&&b(v))}return c})(e,o,n,r,i);a!==void 0&&a!==t&&b(`Mismatching month/monthCode`),a=t,r=1}else a===void 0&&x(`Missing month/monthCode`);return oe(`month`,a,1,_n(e,n),r)}function Da(e,t,n,r,i){return ae(t,`day`,1,vn(e,r,n),i)}function Oa(e,t){return(t+e)*(Math.sign(t)||1)||0}function ka(e,t){return jt(C(k,{...Ot,...e}),t)}const Aa=_e(`([+-])(\\d{2})(?::?(\\d{2})(?::?(\\d{2})(?:[.,](\\d{1,9}))?)?)?`);function ja(e){let t=Ma(e);return t===void 0&&b(ne(e)),t}function Ma(e,t){let n=Aa.exec(e);if(n&&(e=>(e=>{e[0]!==`T`&&e[0]!==`t`||(e=e.slice(1));let t=e.search(/[.,]/),n=t<0?e:e.slice(0,t),r=n.split(`:`);return r.length===1?/^(?:\d{2}|\d{4}|\d{6})$/i.test(n):(r.length===2||r.length===3)&&r.every(e=>e.length===2&&/^\d{2}$/i.test(e))})(e.slice(1)))(n[0]))return((e,t)=>{let n=e[4]||e[5];return t&&n&&b(re(n)),r=(be(e[2])*Ke+be(e[3])*Ge+be(e[4])*We+ve(e[5]||``))*ye(e[1]),Math.abs(r)>=864e11&&b(`Out-of-bounds offset`),r;var r})(n,t)}const Na={era:zn,month:c,monthCode(e,t=`monthCode`){return((e,t)=>{if(typeof e==`string`)return e;if(e&&typeof e==`object`){let n=e.toString;if(typeof n==`function`)return N(n.call(e),t)}return N(e,t)})(e,t)},day:c},Pa=de(k,s),Fa=de(j,Vn),Ia={offset(e){return ja(zn(e))}},La=Object.assign({},Na,Pa),Ra=Object.assign({},La,Ia);function V(e,t,n,r,i=!r){let a={},o=0;for(let i of t){let t=e[i];if(t!==void 0){o=1;let e=n[i];e&&(t=e(t,i)),a[i]=t}else r&&r.includes(i)&&x(m(i))}return i&&!o&&x(h(t)),a}function za(e,t=Ot,n){let r=P(e,t);return Er(r),Mr(r,n)}function Ba(e,t,n){return Ha(e,t,Wa(e,t),F(n))}function Va(e,t,n){let r=Wa(e,t),i=n();return[Ha(e,t,r,i[0]),...i]}function Ha(e,t,n,r){let i=n[1],a=Ea(e,t,i,r,n[0]);return I(Tr(gn(e,i,a,Da(e,t,a,i,r))),e)}function Ua(e){if(e.monthCode!==void 0)return Fe(e.monthCode)}function Wa(e,t){let n=wa(e);return t.year!==void 0||t.era!==void 0&&t.eraYear!==void 0||x(_(n)),t.monthCode===void 0&&t.month===void 0&&x(`Missing month/monthCode`),t.day===void 0&&x(m(`day`)),[Ua(t),Ta(e,t)]}function Ga(e,t,n){let r=wa(e);t.year!==void 0||t.era!==void 0&&t.eraYear!==void 0||x(_(r)),t.monthCode===void 0&&t.month===void 0&&x(`Missing month/monthCode`);let i=Ua(t),a=Ta(e,t);return I(wr(gn(e,a,Ea(e,t,a,F(n),i),1)),e)}function Ka(e,t,n){let r=e===void 0,i=wa(e);t.day===void 0&&x(m(`day`)),r||t.month===void 0||t.year!==void 0||t.era!==void 0&&t.eraYear!==void 0||x(_(i));let a=Ua(t),o=t.eraYear!==void 0||t.year!==void 0?Ta(e,t):void 0,s=F(n),c,l,u;if(o===void 0&&r&&(o=1972),o!==void 0){r||Tr(gn(e,o,1,1));let n=Ea(e,t,o,s,a);c=Da(e,t,n,o,s),[l,u]=mn(e,o,n)}else{t.monthCode===void 0&&x(`Missing month/monthCode`),[l,u]=a;let n=e?e.ge:1972;if(n!==void 0)c=Da(e,t,Ea(e,t,n,s,a),n,s);else{let n=s===0&&e?e.ke?.(l,u,t.day):void 0;c=n===void 0?t.day:n}}u&&((e&&e.Z?.[l])??1/0)<t.day&&(s===1&&b(v),u=0,c=ie(t.day,1,(e&&e.X)??1/0));let d=e?e.v(l,!!u,c):Zt(l,!!u);for(;!d&&s===0&&c>1;)c--,d=e?e.v(l,!!u,c):Zt(l,!!u);d||b(`Cannot guess year`);let{year:f,month:p}=d;return I(Tr(gn(e,f,p,c)),e)}const qa=Intl.DateTimeFormat;function Ja(e,t){t<-864e13&&b(`Out-of-bounds date`);let n=e.formatToParts(t),r={};for(let e of n)r[e.type]=e.value;return r}const Ya={El_Aaiun:17,Tucuman:12,Tirane:11,Riga:10,Simferopol:9,Vienna:9,Tunis:8,Boa_Vista:6,Fortaleza:6,Maceio:6,Noronha:6,Recife:6,Gaza:6,Hebron:6,DeNoronha:6},Xa=-388152e4;function Za(e,t=4){let n=er(e);return[fr(e,4),...eo(hr(Un,rr(e),0,t),n)]}function Qa(e){return lr(a(e))}function $a(e,t){return Za(a(e),t)}function eo(e,t){return e==null?[t===void 0?1:10**(9-t),t]:[Je[e],e<4?9-3*e:-1]}function to(e,t,n){let[r,i,o,s]=(e=>{let t=er(e=a(e)),n=fr(e,4),r=rr(e);return[e.timeZone,n,...eo(hr(Un,r,0,4),t)]})(n),c=r!==void 0;return((e,t,n,r,i,a)=>{n=$r(n,BigInt(i),r);let o=t.C(n);return mo(Kt(n+BigInt(o)),a)+(e?yo(qr(o)):`Z`)})(c,H(c?e(r):`UTC`),t.epochNanoseconds,i,o,s)}function no(e,t){let n=(e=>{e=a(e);let t=lr(e),n=er(e),r=dr(e),i=fr(e,4),o=rr(e);return[t,ur(e),r,i,...eo(hr(Un,o,0,4),n)]})(t);return((e,t,n,r,i,a,o,s,c,l)=>{r=$r(r,BigInt(c),s);let u=n.C(r);return mo(Kt(r+BigInt(u)),l)+yo(qr(u),o)+bo(t,a)+xo(e,i)})(e.calendar,e.timeZone.id,e.timeZone,e.epochNanoseconds,...n)}function ro(e,t){let n=(e=>(e=a(e),[lr(e),...Za(e)]))(t);return((e,t,n,r,i,a)=>mo(Gr(t,i,r),a)+xo(e,n))(e.calendar,e,...n)}function io(e,t){return n=e.calendar,r=e,i=Qa(t),ho(r)+xo(n,i);var n,r,i}function ao(e,t){return so(e.calendar,go,e,Qa(t))}function oo(e,t){return so(e.calendar,_o,e,Qa(t))}function so(e,t,n,r){return r===1?e===void 0?t(n):ho(n):r>1||r===0&&e!==void 0?ho(n)+So(Ne(e),r===2):t(n)}function co(e,t){return((e,t,n,r)=>vo(Kr(e,n,t)[0],r))(e,...$a(t))}function lo(e,t){let[n,r,i]=$a(t,3);return r>1&&na(e={...e,...Xr(e,r,n)}),uo(e,i)}function uo(e,t){let{sign:n}=e,r=n===-1?z(e):e,{hours:i,minutes:a}=r,o=oa(r),s=Number(o/Ze),c=Number(o%Ze);ra(s);let l=wo(c,t),u=t>=0||!n||l;return(n<0?`-`:``)+`P`+fo({Y:po(r.years),M:po(r.months),W:po(r.weeks),D:po(r.days)})+(i||a||s||u?`T`+fo({H:po(i),M:po(a),S:po(s,u)+l}):``)}function fo(e){let t=[];for(let n in e){let r=e[n];r&&t.push(r,n)}return t.join(``)}function po(e,t){if(!e&&!t)return``;let n=Object.create(null);return n.useGrouping=0,e.toLocaleString(`fullwide`,n)}function mo(e,t){return ho(e)+`T`+vo(e,t)}function ho(e){return go(e)+`-`+Se(e.day)}function go(e){let{year:t}=e;return(t<0||t>9999?To(t)+xe(6,Math.abs(t)):xe(4,t))+`-`+Se(e.month)}function _o(e){return Se(e.month)+`-`+Se(e.day)}function vo(e,t){let n=[Se(e.hour),Se(e.minute)];return t!==-1&&n.push(Se(e.second)+((e,t,n,r)=>wo(e*Ue+t*He+n,r))(e.millisecond,e.microsecond,e.nanosecond,t)),n.join(`:`)}function yo(e,t=0){if(t===1)return``;let[n,r]=Te(Math.abs(e),Ke),[i,a]=Te(r,Ge),[o,s]=Te(a,We);return To(e)+Se(n)+`:`+Se(i)+(o||s?`:`+Se(o)+wo(s):``)}function bo(e,t){return t===1?``:`[`+(t===2?`!`:``)+e+`]`}function xo(e,t){return t>1||t===0&&e!==void 0?So(Ne(e),t===2):``}function So(e,t){return`[`+(t?`!`:``)+`u-ca=`+e+`]`}const Co=/0+$/;function wo(e,t){let n=xe(9,e);return n=t===void 0?n.replace(Co,``):n.slice(0,t),n?`.`+n:``}function To(e){return e<0?`-`:`+`}const Eo=/^(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$/,Do=/[^\w\/:+-]+/;function Oo(e){return ko(N(e))}function ko(e){return Ao(e).id}function Ao(e){let t=e.toUpperCase(),n=(e=>{let t=Ma(e,1);if(t!==void 0)return{id:yo(t),_:t,o:t}})(t);return n?{kind:`fixed`,...n}:jo(t===`UTC`?`UTC`:(e=>(Do.test(e)&&b(te(e)),Eo.test(e)&&b(`Forbidden ICU TimeZone`),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||e===`in`||e===`chat`?e.toUpperCase():e.length>2||!n?ge(e).replace(/island|noronha|murdo|rivadavia|urville/,ge):e)).join(`/`)))(e))}const jo=S(e=>{if(e===`UTC`)return{kind:`utc`,id:e,o:e};let t=Mo(e.toUpperCase());return{kind:`named`,id:e,format:t,o:t.resolvedOptions().timeZone}}),Mo=S(e=>new qa(`en-u-hc-h23`,{calendar:`iso8601`,timeZone:e,era:`short`,year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`}));function H(e){let t=Ao(e);return No(t.id,t)}const No=S((e,t)=>t.kind===`named`?new Fo(e,t.o,t.format):new Po(e,t.o,t.kind===`fixed`?t._:0));var Po=class{constructor(e,t,n){this.id=e,this.o=t,this._=n}C(){return this._}R(e){return[kr(e,this._)]}U(){}},Fo=class{constructor(e,t,n){this.id=e,this.o=t,this.qe=((e,t)=>{let n=S(e),r=S(Lo),i=86400*t;function a(e){let[t,a]=Ro(e,i),s=zo(t),c=zo(a),l=n(s),u=n(c);return l===u?l:o(r(s,c),l,u,e)}function o(t,n,r,i){let a,o;for(;(i===void 0||(a=i<t[0]?n:i>=t[1]?r:void 0)===void 0)&&(o=t[1]-t[0]);){let n=t[0]+Math.floor(o/2);e(n)===r?t[1]=n:t[0]=n+1}return a}return{Ee(e){let t=a(e-86400),n=a(e+86400),r=e-t,i=e-n;if(t===n)return[r];let o=a(r);return o===a(i)?[e-o]:t>n?[r,i]:[]},De:a,U:function e(t,a){if(a>0&&t>=864e10)return;if(a<0){if(t<=Xa)return;let n=Io()+94867200;if(t>n)return e(n,-1)}let[s,c]=Ro(a>0?Math.max(t,Xa):t,i),l=i*a,u=a>0?Math.max(t,Io())+94867200:Xa,d=()=>a<0?c>u:s<u;for(;d();){let e=zo(s),i=zo(c),u=n(e),d=n(i);if(u!==d){let n=r(e,i);o(n,u,d);let s=n[0];if((E(s,t)||1)===a)return s}s+=l,c+=l}}}})((e=>t=>{let n=Ja(e,1e3*t);return 86400*Gt((e=>{let t=e.relatedYear;if(t!==void 0)return parseInt(t);let n=parseInt(e.year);return e.era!==void 0&&Me(e.era)===`bce`?1-n:n})(n),parseInt(n.month),parseInt(n.day))+3600*parseInt(n.hour)+60*parseInt(n.minute)+parseInt(n.second)-t})(n),(e=>Ya[e.split(`/`).pop()]||60)(e))}C(e){return this.qe.De((e=>zt(e)[0])(e))*We}R(e){let t=86400*Wt(e)+Pt(e),n=Ft(e);return this.qe.Ee(t).map(e=>Or(BigInt(e)*Ze+BigInt(n)))}U(e,t){let[n,r]=zt(e),i=this.qe.U(n+(t>0||r?1:0),t);if(i!==void 0)return BigInt(i)*Ze}};function Io(){return Math.floor(Date.now()/1e3)}function Lo(e,t){return[e,t]}function Ro(e,t){let n=Math.floor(e/t)*t;return[n,n+t]}function zo(e){return ie(e,-1e10,864e10)}function Bo(e,t,n){let r=V(n,B(t,wt,Tt),Ra,[],0);if(r.timeZone!==void 0){let n=Ba(t,r),i=ka(r),a=H(e(r.timeZone));return{epochNanoseconds:ci(a,P(n,i),r.offset),timeZone:a,calendar:t}}return Ba(t,r)}function Vo(e,t,n,r){let i=V(n,B(t,wt,Tt),Ra,ot,0),a=e(i.timeZone),[o,s,c,l]=Va(t,i,()=>yr(r)),u=ka(i,s),d=H(a);return jr(ci(d,P(o,u),i.offset,c,l),d,t)}function Ho(e,t,n){let r=V(t,B(e,bt,xt),La,[],0),[i,a]=Va(e,r,()=>[F(n)]);return za(i,ka(r,a),e)}function Uo(e,t,n,r=[]){return Ba(e,V(t,B(e,vt,yt),Na,r),n)}function Wo(e,t,n,r){return Ga(e,V(t,B(e,pt,mt),Na,r),n)}function Go(e,t,n,r){let i=V(n,B(e,vt,yt),Na,rt,0);return t&&i.month!==void 0&&i.monthCode===void 0&&i.year===void 0&&(i.year=1972),Ka(e,i,r)}function Ko(e,t){return ka(V(e,dt,Pa,[],1),F(t))}function qo(e){let t=V(e,On,Fa);return L(na({...M,...t}))}function Jo(e){b(ne(e))}function Yo(e){let t=Cs(e=zn(e)),n;return t||Jo(e),t.F?n=0:t.offset?n=ja(t.offset):Jo(e),t.timeZoneId&&Ma(t.timeZoneId,1),un(t),Ar(kr(t,n))}function Xo(e,t){let n=Cs(N(e));return n||Jo(e),n.timeZoneId?ds(n,t,void 0):(n.F&&Jo(e),ps(n,t))}function Zo(e,t,n){let r=Cs(N(e));return r&&r.timeZoneId||Jo(e),ds(r,t,n)}function Qo(e,t){let n=Cs(N(e));return n&&!n.F||Jo(e),fs(n,t)}function $o(e,t){let n=cs(ss(N(e)),void 0,t);return I(n,n.calendar)}function es(e,t){let n=ws(N(e));if(n)return ts(n),I(wr(dn(n)),t(n.calendarId));let r=cs(ss(e),ls,t),{calendar:i}=r;return I(gi(i,r),i)}function ts(e){e.calendarId!==`iso8601`&&b(re(e.calendarId))}function ns(e,t){let n=Ts(N(e));if(n)return ts(n),I(dn(n),t(n.calendarId));let r=cs(ss(e),us,t),{calendar:i}=r,{year:a,month:o,day:s}=A(i,r),[c,l]=mn(i,a,o),{year:u,month:d}=((e,t,n,r)=>{let i=e?e.v(t,n,r):Zt(t,n);return i||b(`Cannot guess year`),i})(i,c,l,s);return I(Tr(gn(i,u,d,s)),i)}function rs(e){let t=(e=>{let t=Es(e);return t?(ks(t[13]),Ds(t,1)):void 0})(e=N(e)),n;return t||(t=Cs(e),t?(t.fe||Jo(e),t.F&&b(re(`Z`)),ts(t)):Jo(e)),(n=ws(e))&&fn(n)&&Jo(e),(n=Ts(e))&&fn(n)&&Jo(e),Nr(kt(t))}function is(e){let t=(e=>{let t=Ss.exec(e);return t?(e=>{let t=0,n=0,r=0,i={years:a(e[2]),months:a(e[3]),weeks:a(e[4]),days:a(e[5]),hours:a(e[6],e[7],5),minutes:a(e[8],e[9],4),seconds:a(e[10],e[11],3),...Ji(r,2,j)};return t||b(h(j)),ye(e[1])<0&&(i=z(i)),i;function a(e,i,a){let o=0,s=0;return a&&([o,r]=Te(r,Je[a])),e!==void 0&&(n&&b(re(e)),s=(e=>{let t=parseInt(e);return Number.isFinite(t)||b(re(e)),t})(e),t=1,i&&(r=ve(i)*(Je[a]/We),n=1)),o+s}})(t):void 0})(N(e));return t||Jo(e),L(na(t))}function as(e){let t=Cs(e)||ws(e)||Ts(e);if(t)return t.calendarId;let n=Es(e);return n?ks(n[13]).calendarId:e}function os(e){let t=Cs(e);return t&&(t.timeZoneId||t.F&&`UTC`||t.offset)||e}function ss(e){let t=Cs(e);return t&&!t.F||Jo(e),t}function cs(e,t,n){return t&&e.calendarId===`iso8601`?(dn(e),e.fe&&kt(e),ps(t(e),n)):e.fe?fs(e,n):ps(e,n)}function ls(e){let t=12*e.year+e.month===Cr?20:1;return{...e,day:t}}function us(e){return{...e,year:1972}}function ds(e,t,n){let r=H(ko(e.timeZoneId)),i;if(un(e),e.fe){let t=e.offset?ja(e.offset):void 0,[,o,s]=yr(n);i=ci(r,e,t,o,s,!(r._||e.offset===void 0||(a=e.offset,a.replace(/\D/g,``).length>4)),e.F)}else yr(n),i=ui(r,e);var a;return Or(i),jr(i,r,t(e.calendarId))}function fs(e,t){return un(e),Er(e),{...P(e,e),calendar:t(e.calendarId)}}function ps(e,t){return dn(e),Tr(e),{calendar:t(e.calendarId),year:e.year,month:e.month,day:e.day}}function ms(e){return`(\\d{2})(?:(:?)(\\d{2})(?:\\${e}(\\d{2})(?:[.,](\\d{1,9}))?)?)?`}function hs(e){return`([+-])`+ms(e)}const gs=`(?:(?:([+-])(\\d{6}))|(\\d{4}))(-?)(\\d{2})\\4(\\d{2})(?:[T ]`+ms(8)+`(Z|`+hs(15)+`)?)?`,_s=_e(`(?:(?:([+-])(\\d{6}))|(\\d{4}))-?(\\d{2})((?:\\[(!?)([^\\]]*)\\]){0,9})`),vs=_e(`(?:--)?(\\d{2})-?(\\d{2})((?:\\[(!?)([^\\]]*)\\]){0,9})`),ys=_e(gs+`((?:\\[(!?)([^\\]]*)\\]){0,9})`),bs=_e(`T?`+ms(2)+`(${hs(9)})?((?:\\[(!?)([^\\]]*)\\]){0,9})`),xs=RegExp(`\\[(!?)([^\\]]*)\\]`,`g`),Ss=_e(`([+-])?P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?:(\\d+)(?:[.,](\\d{1,9}))?H)?(?:(\\d+)(?:[.,](\\d{1,9}))?M)?(?:(\\d+)(?:[.,](\\d{1,9}))?S)?)?`);function Cs(e){let t=ys.exec(e);return t?(e=>{let t=e[12],n=(t||``).toUpperCase()===`Z`;return{year:Os(e),month:parseInt(e[5]),day:parseInt(e[6]),...Ds(e,7),...ks(e[19]),fe:!!e[7],F:n,offset:n?void 0:t}})(t):void 0}function ws(e){let t=_s.exec(e);if(t)return(e=>({year:Os(e),month:parseInt(e[4]),day:1,...ks(e[5])}))(t)}function Ts(e){let t=vs.exec(e);return t?(e=>({year:1972,month:parseInt(e[1]),day:parseInt(e[2]),...ks(e[3])}))(t):void 0}function Es(e){let t=bs.exec(e);if(t)return t[6]&&ja(t[6]),t}function Ds(e,t){let n=be(e[t+3]);return{...It(ve(e[t+4]||``))[0],hour:be(e[t]),minute:be(e[t+2]),second:n===60?59:n}}function Os(e){let t=ye(e[1]),n=parseInt(e[2]||e[3]);return t<0&&!n&&b(re(-0)),t*n}function ks(e){let t,n,r=[];return e.replace(xs,(e,i,a)=>{let o=!!i,[s,c]=a.split(`=`).reverse();return c?c===`u-ca`?(r.push(s.toLowerCase()),t||=o):(o||/[A-Z]/.test(c))&&b(re(e)):(n&&b(re(e)),n=s),``}),r.length>1&&t&&b(re(e)),{timeZoneId:n,calendarId:r[0]||`iso8601`}}function As(e,t,n){let r=Object.assign(Object.create(null),t);return js(r,n,lt),wa(e)&&(js(r,n,ct),e&&e.le&&js(r,n,ut,st)),r}function js(e,t,n,r){let i=0,a=[];for(let e of n)t[e]===void 0?a.push(e):i=1;if(Object.assign(e,t),i)for(let t of r||a)delete e[t]}function Ms(e,t,n){let{calendar:r,timeZone:i}=e,a=B(r,St,Ct),o=R(e),{year:s,month:c,day:l}=A(r,o),u={year:s,monthCode:zs(r,s,c),day:l,hour:o.hour,minute:o.minute,second:o.second,millisecond:o.millisecond,microsecond:o.microsecond,nanosecond:o.nanosecond,offset:o.offsetNanoseconds},d=V(t,a,Ra),f=As(r,u,d),p={...u,...d},[m,h,g,_]=Va(r,f,()=>yr(n,2));return jr(ci(i,P(m,jt(p,h)),p.offset,g,_),i,r)}function Ns(e,t,n){let{calendar:r}=e,i=B(r,bt,xt),{year:a,month:o,day:s}=A(r,e),c={year:a,monthCode:zs(r,a,o),day:s,hour:e.hour,minute:e.minute,second:e.second,millisecond:e.millisecond,microsecond:e.microsecond,nanosecond:e.nanosecond},l=V(t,i,La),u=As(r,c,l),d={...c,...l},[f,p]=Va(r,u,()=>[F(n)]);return za(f,jt(d,p),r)}function Ps(e,t,n){let{calendar:r}=e,i=B(r,vt,yt),{year:a,month:o,day:s}=A(r,e);return Ba(r,As(r,{year:a,monthCode:zs(r,a,o),day:s},V(t,i,Na)),n)}function Fs(e,t,n){let{calendar:r}=e,i=B(r,pt,mt),{year:a,month:o}=A(r,e);return Ga(r,As(r,{year:a,monthCode:zs(r,a,o)},V(t,i,Na)),n)}function Is(e,t,n){let{calendar:r}=e,i=B(r,vt,yt),{year:a,month:o,day:s}=A(r,e);return Ka(r,As(r,{monthCode:zs(r,a,o),day:s},V(t,i,Na)),n)}function Ls(e,t,n){return((e,t,n)=>ka({...C(dt,e),...V(t,dt,Pa)},F(n)))(e,t,n)}function Rs(e,t){return L((n=e,r=t,na({...n,...V(r,On,Fa)})));var n,r}function zs(e,t,n){let[r,i]=mn(e,t,n);return Ie(r,i)}function Bs(e,t,n){return jr(e.epochNanoseconds,t,n)}function Vs(e){return Ar(e.epochNanoseconds)}function Hs(e){return Mr(R(e),e.calendar)}function Us(e){return I(R(e),e.calendar)}function Ws(e){return Nr(R(e))}function Gs(e,t,n){return jr(Or(((e,t,n)=>li(e,t,(e=>sr(a(e)))(n)))(t,e,n)),t,e.calendar)}function Ks(e,t,n,r){let i=e(r.timeZone),a=r.plainTime,o=a===void 0?void 0:t(a),s=H(i),c;return c=o?li(s,P(n,o)):ui(s,P(n,Ot)),jr(c,s,n.calendar)}function qs(e,t,n){return Zs(e,C(B(e,ht,gt),t),V(f(n),rt,Na,[]))}function Js(e,t,n){let r=B(e,nt,ft);return Zs(e,C(_t,t),V(f(n),r,Na,[]))}function Ys(e,t){return Ka(e,V(t,_t,Na))}function Xs(e,t,n){return Ga(e,V(t,B(e,ht,gt),Na),n)}function Zs(e,t,n){let r=B(e,Et,Dt),i=As(e,t,n);return i=V(i,r,Na,[]),Ba(e,i)}function Qs(e){return Ar(Or(BigInt(Vn(e))*Xe))}function $s(e){return Ar(Or(Bn(e)))}function ec(e){return e.timeZone=`UTC`,[`full`,`long`].includes(e.timeStyle)&&(e.timeStyle=`medium`),e}function tc(e,t){return e.timeZone!==void 0&&x(`Cannot specify TimeZone`),e.timeZone=t,e}function nc(e,t,n){let r=e.resolvedOptions().calendar;!n&&t.calendar===void 0||Ne(t.calendar)===r||b(`Mismatching Calendars`)}function rc(e,t,n,r,i){let a=new Set(e),o=new Set(t),s=new Set(n);return(e,t)=>{let n=((e,t,n,r)=>{let i={dateStyle:void 0,timeStyle:void 0,me:{},pe:{},xe:{},oe:0,ue:0};for(let a of Object.keys(e)){let o=e[a];o===void 0||r.has(a)||(t.has(a)?a===`dateStyle`?i.dateStyle=o:a===`timeStyle`?i.timeStyle=o:i.me[a]=o:a===`era`?i.pe[a]=o:n.has(a)?a===`dateStyle`||a===`timeStyle`?i.ue=1:i.oe=1:i.xe[a]=o)}return i})(e,a,o,s),c=n.dateStyle!==void 0,l=n.timeStyle!==void 0,u=c||l,d=Object.keys(n.me).length>0,f=n.oe||n.ue,p=d||c||l,m=Object.keys(n.pe).length>0,h=d||m||n.oe;(!t&&f||t&&f&&!p||u&&h)&&x(`Invalid formatting options`);let g={};return u||p||Object.assign(g,r),Object.assign(g,n.me,n.pe,n.xe),c&&(i?Object.assign(g,i[n.dateStyle]):g.dateStyle=n.dateStyle),l&&(g.timeStyle=n.timeStyle),g}}const ic={year:`numeric`,month:`numeric`,day:`numeric`},ac={hour:`numeric`,minute:`numeric`,second:`numeric`},oc=Object.assign({},ic,ac),sc=Object.assign({},oc,{timeZoneName:`short`}),cc={year:`numeric`,month:`numeric`},lc={month:`numeric`,day:`numeric`},uc=[`weekday`,`year`,`month`,`day`,`dateStyle`],dc=[`dayPeriod`,`hour`,`minute`,`second`,`fractionalSecondDigits`,`timeStyle`],fc=uc.concat(dc),pc=[`weekday`,`day`].concat(dc),mc=[`weekday`,`year`].concat(dc),hc=rc(fc,[],[],oc),gc=rc(fc,[],[],sc),_c=rc(fc,[],[`timeZoneName`],oc),vc=rc(uc,dc,[`timeZoneName`],ic),yc=rc(dc,uc,[`timeZoneName`,`era`],ac),bc=rc([`year`,`month`,`dateStyle`],pc,[`timeZoneName`],cc,{full:{year:`numeric`,month:`long`},long:{year:`numeric`,month:`long`},medium:{year:`numeric`,month:`short`},short:{year:`2-digit`,month:`numeric`}}),xc=rc([`month`,`day`,`dateStyle`],mc,[`timeZoneName`,`era`],lc,{full:{month:`long`,day:`numeric`},long:{month:`long`,day:`numeric`},medium:{month:`short`,day:`numeric`},short:{month:`numeric`,day:`numeric`}});function Sc(e,t){let{timeZone:n}=e,r=R(e),{offsetNanoseconds:i}=r,a=t||Ot,o;return o=t?ci(n,P(r,a),i,2):ui(n,P(r,a)),jr(o,n,e.calendar)}function Cc(e){let t=wc(),n=e.C(t);return Kt(t+BigInt(n))}function wc(){return BigInt(Date.now())*Xe}function Tc(){return new qa().resolvedOptions().timeZone}const Ec=`PlainYearMonth`,Dc=`PlainMonthDay`,Oc=`PlainDate`,kc=`PlainDateTime`,Ac=`PlainTime`,jc=`ZonedDateTime`,Mc=`Instant`,Nc=`Duration`;function Pc(e,t,n,...r){Object.defineProperties(t,se(e)),Object.defineProperties(t.prototype,le(`Temporal.`+e));for(let e of r)Fc(t.prototype,n,e);return t}function Fc(e,t,n){Object.defineProperties(e,ue(e=>({get(){return e(t(this))},configurable:1}),n))}const Ic=he.name===`noop`?e=>{Object.defineProperty(e,`_str_`,{value:e.toJSON()})}:he;function Lc(){x(`Invalid calling context`)}function Rc(){x(`Cannot use valueOf`)}const zc={era(e){return hn(e.calendar,e).era},eraYear(e){return hn(e.calendar,e).eraYear},year(e){return A(e.calendar,e).year},month(e){return A(e.calendar,e).month},monthCode(e){return yn(e.calendar,e)}},Bc={era(e){return hn(e.calendar,e).era},eraYear(e){return hn(e.calendar,e).eraYear},year(e){return A(e.calendar,e).year},month(e){return A(e.calendar,e).month},monthCode(e){return yn(e.calendar,e)},day(e){return A(e.calendar,e).day}},Vc={monthCode(e){return yn(e.calendar,e)},day(e){return A(e.calendar,e).day}},Hc={daysInMonth(e){return Sn(e.calendar,e)},daysInYear(e){return Cn(e.calendar,e)},monthsInYear(e){return xn(e.calendar,e)},inLeapYear(e){return bn(e.calendar,e)}},Uc={dayOfWeek(e){return an(e)},dayOfYear(e){return wn(e.calendar,e)},weekOfYear(e){return Tn(e.calendar,e)},yearOfWeek(e){return En(e.calendar,e)},daysInWeek(){return 7},daysInMonth(e){return Sn(e.calendar,e)},daysInYear(e){return Cn(e.calendar,e)},monthsInYear(e){return xn(e.calendar,e)},inLeapYear(e){return bn(e.calendar,e)}};function Wc(e){return fe(Object.keys(e))}Wc(Hc),Wc(Uc);function Gc(e){let t=e.ve||0;function n(e){return e-t}function r(e){return e+t}return{l:e.l,ge:1972+t,le:e.le,ie(e){return{...e,year:r(e.year)}},je(e,t,r){return Qt(n(e),t,r)},se(e,t,r){return Gt(n(e),t,r)*Ve},O(e,t){return Xt(t)},v(e,t){let n=Zt(e,t);return n&&{year:r(n.year),month:n.month}},u(e){return tn(n(e))},k(){return 12},p(e,t){return $t(n(e),t)},j(e){return en(n(e))},q(){},h(t){return e.h?.(t,r(t.year))||{}},N(e,t,i){let a=nn(n(e),t,i);return{year:r(a.year),month:a.month}},ne(e,t,r,i){return rn(n(e),t,n(r),i)}}}function Kc(e,t){let n=qc(e);return{m:t.m,Z:t.Z,X:t.X,ie:n.he,je:w(Yc,n),se:w(Xc,n),O:w(Zc,n,t.m),v:w(il,n,t.m,t.Ce),u:w($c,n,t.m),k:w(nl,n),p:w(tl,n),j:w(el,n),q:w(Qc,n,t.m),h:w(rl,n),N:w(al,n),ne:w(ol,n)}}function qc(e){let t=(e=>new qa(`en-u-hc-h23`,{calendar:e,timeZone:`UTC`,era:`short`,year:`numeric`,month:`short`,day:`numeric`}))(e);function n(e){return{...Jc(n=Ja(t,e)),month:0,Fe:n.month,day:parseInt(n.day)};var n}let r=(e=>{let t=e(0).year-1970;return S(function(n){let r=Gt(n-t)*Ve,i,a=0,o=[],s=[];do r+=400*Ve;while((i=e(r)).year<=n);do r+=(1-i.day)*Ve,i.year===n&&(o.push(r),s.push(i.Fe)),r-=Ve,(++a>500||r<-864e13)&&b();while((i=e(r)).year>=n);return{$:o.reverse(),we:s.reverse()}})})(n);return{he:((e,t)=>S(n=>{let r=Ut(n),i=e(r);return{...i,month:sl(t,i.year,r)}},WeakMap))(n,r),K:r}}function Jc(e){return{era:void 0,eraYear:void 0,year:parseInt(e.relatedYear||e.year)}}function Yc(e,t,n,r){return qt(Xc(e,t,n,r))}function Xc(e,t,n=1,r=1){return e.K(t).$[n-1]+(r-1)*Ve}function Zc(e,t,n,r){let i=Qc(e,t,n);return[Re(r,i),i===r]}function Qc(e,t,n){if(t===void 0)return;let r=e.K(n).we;if(r.length<=12)return;if(t<0)return-t;for(let e=1;e<r.length;e++)if(r[e]===r[e-1])return e+1;for(let e=0;e<r.length;e++)if(/bis$/i.test(r[e]))return e+1;let i=e.K(n-1).we;for(let e=0;e<r.length;e++)if(r[e]!==i[e])return e+1}function $c(e,t,n){if(t!==void 0)return nl(e,n)>12;let r=el(e,n);return r>el(e,n-1)||r>el(e,n+1)}function el(e,t){return Yt(Xc(e,t),Xc(e,t+1))}function tl(e,t,n){let{$:r}=e.K(t),i=n+1,a=r;return i>r.length&&(i=1,a=e.K(t+1).$),Yt(r[n-1],a[i-1])}function nl(e,t){return e.K(t).$.length}function rl(e,t){let n=e.he(t);return{era:n.era,eraYear:n.eraYear}}function il(e,t,n,r,i,a){let o=n?.(r,i,a)||1972,{year:s,month:c,day:l}=e.he({year:o,month:12,day:31}),u=Qc(e,t,s),d=Re(c,u),f=c===u;(E(r,d)||E(Number(i),Number(f))||E(a,l))===1&&s--;for(let n=0;n<100;n++){let o=s-n,c=Qc(e,t,o),l=Le(r,i,c);if(i===(l===c)&&a<=tl(e,o,l))return{year:o,month:l}}}function al(e,t,n,r){if(r)if(Number.isSafeInteger(n+=r)||b(`Out-of-bounds date`),r<0)for(;n<1;)n+=nl(e,--t);else{let r;for(;n>(r=nl(e,t));)n-=r,t++}return{year:t,month:n}}function ol(e,t,n,r,i){let a=E(t,r)||E(n,i);if(!a)return 0;if(t===r)return i-n;if(a<0){let a=nl(e,t)-n+i;for(let n=t+1;n<r;n++)a+=nl(e,n);return a}return-ol(e,r,i,t,n)}function sl(e,t,n){let{$:r}=e(t);for(let e=r.length-1;e>=0;e--)if(n>=r[e])return e+1;b()}const cl=2440588;function ll(e){let t=e.J(2441683),n=S(t=>e.J(Wt(t)+2440588),WeakMap);function r(t,n){let r=e.q?.(t);return[Re(n,r),n===r]}return{l:e.l,m:e.m,Z:e.Z,X:e.X,ge:e.ge,te:e.te,ke:e.ke,ie:n,je(t,n,r){return Jt(e.L(t,n,r)-2440588)},se(t,n=1,r=1){return(e.L(t,n,r)-2440588)*Ve},O(t,n){return(e.O||r)(t,n)},v(n,i,a){return e.v?.(n,i,a)||((n,i,a)=>{i=!!i;let o=e.ge||t.year,[s,c]=r(t.year,t.month);(E(n,s)||E(Number(i),Number(c))||E(a,t.day))===1&&o--;for(let t=0;t<100;t++)for(let r of[o-t,o+t]){let t=e.q?.(r),o=Le(n,i,t);if(o<=e.k(r)&&i===(o===t)&&a<=e.p(r,o))return{year:r,month:o}}})(n,i,a)},u:e.u,k:e.k,p:e.p,j:e.j,q:e.q||he,h(t){let r=n(t);return e.h?e.h(r):{era:r.era,eraYear:r.eraYear}},N(t,n,r){return((e,t,n,r)=>{if(r)if(Number.isSafeInteger(n+=r)||b(`Out-of-bounds date`),r<0)for(;n<1;)n+=e(--t);else{let r;for(;n>(r=e(t));)n-=r,t++}return{year:t,month:n}})(e.k,t,n,r)},ne(t,n,r,i){return ul(e.k,t,n,r,i)}}}function ul(e,t,n,r,i){let a=E(t,r)||E(n,i);if(!a)return 0;if(t===r)return i-n;if(a<0){let a=e(t)-n+i;for(let n=t+1;n<r;n++)a+=e(n);return a}return-ul(e,r,i,t,n)}const dl={be:0},fl={m:13,Z:{1:0,2:29,8:29,9:29,10:29,11:29,12:0},X:30,Ce(e,t,n){if(t)switch(e){case 1:return 1651;case 2:return n<30?1947:1765;case 3:return n<30?1966:1955;case 4:return n<30?1963:1944;case 5:return n<30?1971:1952;case 6:return n<30?1960:1941;case 7:return n<30?1968:1938;case 8:return n<30?1957:1718;case 9:return 2014;case 10:return 1984;case 11:return n<29?2033:2034;case 12:return 1890}return 1972}};function pl(e){return Kc(e,fl)}const ml={am:0},hl={am:0,aa:0},gl={aa:0};function _l(e,t,n=0,r=0){return ll({l:t,te(e,t,n){return t===`aa`&&r?e-5500:Oa(e,n)},ke(e,t,n){return ie(n,1,t||e!==13?30:6)},J(t){let[r,i,a]=((e,t)=>{let n=Math.floor((4*(t-e)+3)/1461),r=1+Math.floor((t-vl(e,n,1,1))/30);return[n,r,t+1-vl(e,n,r,1)]})(e,t);return{year:r+n,month:i,day:a}},L(t,r,i){return vl(e,t-n,r,i)},p(e,t){return((e,t)=>t%13==0?yl(e)+5:30)(e-n,t)},j(e){return 365+yl(e-n)},k(){return 13},u(e){return this.j(e)>365},h({year:e}){return n?{era:`aa`,eraYear:e}:r&&e<=0?{era:`aa`,eraYear:e+5500}:{era:`am`,eraYear:e}}})}function vl(e,t,n,r){return e+365*t+Math.floor(t/4)+30*(n-1)+r-1}function yl(e){return Math.floor(Ee(e,4)/3)}const bl={am:0};function xl(e){return Ee(7*e+1,19)<7}function Sl(e){let t=Math.floor((235*e-234)/19),n=29*t+Math.floor((12084+13753*t)/25920);return Ee(3*(n+1),7)<3&&(n+=1),n}function Cl(e){return Sl(e)+(e=>{let t=Sl(e-1),n=Sl(e);return Sl(e+1)-n===356?2:n-t===382?1:0})(e)}function wl(e){return Cl(e+1)-Cl(e)}function Tl(e,t){let n=t>=6&&!xl(e)?t+1:t;if(n===4||n===7||n===9||n===11||n===13)return 29;let r=(e=>{let t=wl(e);return t>380&&(t-=30),t===353?0:t===354?1:2})(e);return n===2?r===2?30:29:n===3?r===0?29:30:n===6?xl(e)?30:0:30}const El={shaka:0},Dl=[1392,1390,1391,1392,1391,1392,1389,1392,1392,1390,1391,1390];function Ol(e,t,n){return ll({l:{bh:-1,ah:0},J:e,L:t,p(e,t){return n&&Ml(e)?tl(n,e,t):((e,t)=>29+t%2+(t===12&&jl(e)?1:0))(e,t)},j(e){return n&&Ml(e)?el(n,e):jl(e)?355:354},k(){return 12},u(e){return this.j(e)>354},v(e,t,r){let i=n&&!t&&r===30&&Dl[e-1];return n&&i?{year:i,month:e}:void 0},h({year:e}){return e<1?{era:`bh`,eraYear:1-e}:{era:`ah`,eraYear:e}}})}function kl(e,t,n,r){return r+Math.ceil(29.5*(n-1))+354*(t-1)+Math.floor((3+11*t)/30)+e-1}function Al(e,t){let n=Math.floor((30*(t-e)+10646)/10631),r=Math.min(12,Math.ceil((t-(29+kl(e,n,1,1)))/29.5)+1);return{year:n,month:r,day:t-kl(e,n,r,1)+1}}function jl(e){return Ee(14+11*e,30)<11}function Ml(e){return e>=1300&&e<=1600}function Nl(e,t){let n=t-1948440;if(n<460322||n>=566987)return Al(1948440,t);let{year:r,month:i,day:a}=e.he(Jt(t-cl));return{year:r,month:i,day:a}}function Pl(e,t,n,r){return Ml(t)?Xc(e,t,n,r)/Ve+cl:kl(1948440,t,n,r)}const Fl=Object.assign({},je,{meiji:1867,taisho:1911,showa:1925,heisei:1988,reiwa:2018});function Il(e){let t=Wt(e),n=t>=18017?`reiwa`:t>=6947?`heisei`:t>=-15713?`showa`:t>=-20974?`taisho`:t>=-35428?`meiji`:void 0;return n?{era:n,eraYear:e.year-Fl[n]}:ln(e)}const Ll={ap:0},Rl=[0,31,62,93,124,155,186,216,246,276,306,336];function zl(e){return Ee(25*e+11,33)<8}const Bl={broc:-1,roc:0},Vl=[`buddhist`,()=>Gc({ve:543,l:dl,h(e,t){return{era:`be`,eraYear:t}}})],Hl=[`chinese`,pl],Ul=[`coptic`,()=>_l(1824665,ml)],Wl=[`dangi`,pl],Gl=new Map([Vl,Hl,Ul,Wl,[`ethiopic`,()=>_l(1723856,hl,0,1)],[`ethioaa`,()=>_l(1723856,gl,5500)],[`hebrew`,()=>ll({l:bl,m:-6,J(e){let t=e-347997,n=Math.floor((25920*t/765433*19+234)/235)+1,r=Cl(n),i=Math.floor(t-r);for(;i<1;)n--,r=Cl(n),i=Math.floor(t-r);let a=1,o=0;for(;o<i;)o+=Tl(n,a),a++;return a--,o-=Tl(n,a),{year:n,month:a,day:i-o}},L(e,t,n){let r=Cl(e);for(let n=1;n<t;n++)r+=Tl(e,n);return r+n+347997},p:Tl,j:wl,k(e){return xl(e)?13:12},u:xl,q(e){return xl(e)?6:void 0},O(e,t){return xl(e)&&t===6?[5,1]:[t-(xl(e)&&t>6?1:0),0]},v(e,t,n){return t&&e===5&&n<=30?{year:5730,month:6}:void 0},h({year:e}){return{era:`am`,eraYear:e}}})],[`indian`,function(){return ll({l:El,J(e){let t=Jt(e-cl),n=t.year-78,r=e-(Gt(t.year,1,1)+cl),i;if(r<80?(n--,i=tn(t.year-1)?31:30,r+=i+155+90+10):(i=tn(t.year)?31:30,r-=80),r<i)return{year:n,month:1,day:r+1};let a=r-i;return a<155?{year:n,month:Math.floor(a/31)+2,day:a%31+1}:(a-=155,{year:n,month:Math.floor(a/30)+7,day:a%30+1})},L(e,t,n){let r=e+78,i,a;return tn(r)?(i=31,a=Gt(r,3,21)+cl):(i=30,a=Gt(r,3,22)+cl),t===1||(a+=i+31*Math.min(t-2,5),t>=8&&(a+=30*(t-7))),a+n-1},p(e,t){return t===1&&tn(e+78)||t>=2&&t<=6?31:30},j(e){return tn(e+78)?366:365},k(){return 12},u(e){return this.j(e)>365},h({year:e}){return{era:`shaka`,eraYear:e}}})}],[`japanese`,()=>Gc({l:Fl,le:1,h:Il})],[`islamic-civil`,()=>Ol(w(Al,1948440),w(kl,1948440))],[`islamic-tbla`,()=>Ol(w(Al,1948439),w(kl,1948439))],[`islamic-umalqura`,e=>{let t=qc(e);return Ol(w(Nl,t),w(Pl,t),t)}],[`persian`,()=>ll({l:Ll,J(e){let t=e-1948320,n=1+Math.floor((33*t+3)/12053),r=t-(365*(n-1)+Math.floor((8*n+21)/33)),i=Math.floor(r<216?r/31:(r-6)/30);return{year:n,month:i+1,day:r-Rl[i]+1}},L(e,t,n){return 1948319+365*(e-1)+Math.floor((8*e+21)/33)+Rl[t-1]+n},p(e,t){return t<=6?31:t<=11||zl(e)?30:29},j(e){return zl(e)?366:365},k(){return 12},u:zl,h({year:e}){return{era:`ap`,eraYear:e}}})],[`roc`,()=>Gc({ve:-1911,l:Bl,h(e,t){return t<1?{era:`broc`,eraYear:1-t}:{era:`roc`,eraYear:t}}})]]),Kl={islamic:1,"islamic-rgsa":1},ql={"ethiopic-amete-alem":`ethioaa`,islamicc:`islamic-civil`},Jl=S((e,t)=>{let n=t(e);return n.id=e,n});function Yl(e){let t=Xl(e);return t||b(ee(e)),Jl(...t)}function Xl(e){Kl[e]&&b(ee(e));let t=ql[e]||e,n=Gl.get(t);return n&&[t,n]}function Zl(e){let t=N(e).toLowerCase();return t===`iso8601`?void 0:t===`gregory`?0:Yl(t)}function Ql(e=`iso8601`){return Zl(e)}const $l=new WeakMap,eu=Pc(jc,class{constructor(e,t,n=void 0){let r=Or(Bn(e)),i=H(Oo(t)),a=Ql(n);iu(this,jr(r,i,a))}static from(e,t=void 0){return U(ru(e,t))}static compare(e,t){return fa(ru(e),ru(t))}get calendarId(){return Ne(W(this).calendar)}get timeZoneId(){return W(this).timeZone.id}get epochMilliseconds(){return Pr(W(this))}get epochNanoseconds(){return Fr(W(this))}get offset(){return yo(R(W(this)).offsetNanoseconds)}get offsetNanoseconds(){return R(W(this)).offsetNanoseconds}get hoursInDay(){return Ur(W(this))}with(e,t=void 0){return U(Ms(W(this),ku(e),t))}withCalendar(e){return U({...W(this),calendar:Qu(e)})}withTimeZone(e){return U({...W(this),timeZone:H(au(e))})}withPlainTime(e=void 0){return U(Sc(W(this),Iu(e)))}add(e,t=void 0){return U(pi(W(this),J(e),t))}subtract(e,t=void 0){return U(pi(W(this),z(J(e)),t))}until(e,t=void 0){let n=W(this),r=ru(e);return q(L(Ei(0,Si(n.calendar,r.calendar),n,r,t)))}since(e,t=void 0){let n=W(this),r=ru(e);return q(L(Ei(1,Si(n.calendar,r.calendar),n,r,t)))}round(e){let t=W(this),[n,r,i]=vr(e);return U(Hr(t,n,r,i))}startOfDay(){return U(Wr(W(this)))}equals(e){return va(W(this),ru(e))}toInstant(){return cu(Vs(W(this)))}toPlainDateTime(){return Bu(Hs(W(this)))}toPlainDate(){return Ku(Us(W(this)))}toPlainTime(){return Mu(Ws(W(this)))}toLocaleString(e=void 0,t={}){let n=W(this),r=new qa(e,tc(gc(t),wi(n)));return nc(r,n),r.format(Pr(n))}toString(e=void 0){return no(W(this),e)}toJSON(){return no(W(this))}getTimeZoneTransition(e){let t=W(this),n=oi(t,e);return n?U({...t,epochNanoseconds:n}):null}valueOf(){return Rc()}},tu,Bc,Uc,tt);function U(e){return iu(Object.create(eu.prototype),e)}function W(e){return nu(e)||Lc()}function tu(e){let t=W(e);return{...R(t),calendar:t.calendar}}function nu(e){return $l.get(e)}function ru(e,t){if(y(e)){let n=nu(e);return n?(yr(t),n):Vo(au,Xu(e),e,t)}return Zo(e,Zl,t)}function iu(e,t){return $l.set(e,t),Ic(e),e}function au(e){if(y(e)){let t=nu(e);return t||x(te(e)),t.timeZone.id}return(e=>ko(os(N(e))))(e)}const ou=new WeakMap,su=Pc(Mc,class{constructor(e){let t=Or(Bn(e));pu(this,Ar(t))}static from(e){return cu(du(e))}static fromEpochMilliseconds(e){return cu(Qs(e))}static fromEpochNanoseconds(e){return cu($s(e))}static compare(e,t){return da(du(e),du(t))}get epochMilliseconds(){return Pr(lu(this))}get epochNanoseconds(){return Fr(lu(this))}add(e){return cu(Ar(fi(lu(this).epochNanoseconds,J(e))))}subtract(e){return cu(Ar(fi(lu(this).epochNanoseconds,z(J(e)))))}until(e,t=void 0){return q(Ti(0,lu(this),du(e),t))}since(e,t=void 0){return q(Ti(1,lu(this),du(e),t))}round(e){let t=lu(this),[n,r,i]=vr(e,5,1);return cu(Ar($r(t.epochNanoseconds,Yr(n,r),i)))}equals(e){return _a(lu(this),du(e))}toZonedDateTimeISO(e){return U(Bs(lu(this),H(au(e))))}toLocaleString(e=void 0,t={}){let n=lu(this);return new qa(e,hc(t)).format(Pr(n))}toString(e=void 0){return to(au,lu(this),e)}toJSON(){return to(au,lu(this))}valueOf(){return Rc()}});function cu(e){return pu(Object.create(su.prototype),e)}function lu(e){return uu(e)||Lc()}function uu(e){return ou.get(e)}function du(e){if(y(e)){let t=uu(e);if(t)return t;let n=nu(e);if(n)return Ar(n.epochNanoseconds)}return Yo(e)}const{toTemporalInstant:fu}={toTemporalInstant(){let e=Date.prototype.valueOf.call(this);return cu(Ar(BigInt(Ln(e))*Xe))}};function pu(e,t){return ou.set(e,t),Ic(e),e}const mu=new WeakMap,hu=Pc(Dc,class{constructor(e,t,n=void 0,r){let i=s(e),a=s(t),o=Ql(n),c=Tr(dn({year:s(r??1972),month:i,day:a}));bu(this,I(c,o))}static from(e,t=void 0){return gu(yu(e,t))}get calendarId(){return Ne(_u(this).calendar)}with(e,t=void 0){return gu(Is(_u(this),ku(e),t))}equals(e){return Sa(_u(this),yu(e))}toPlainDate(e){return Ku(Js(_u(this).calendar,this,e))}toLocaleString(e=void 0,t={}){let n=_u(this),r=new qa(e,ec(xc(t)));return nc(r,n,1),r.format(Ut(n))}toString(e=void 0){return oo(_u(this),e)}toJSON(){return oo(_u(this))}valueOf(){return Rc()}},_u,Vc);function gu(e){return bu(Object.create(hu.prototype),e)}function _u(e){return vu(e)||Lc()}function vu(e){return mu.get(e)}function yu(e,t){if(y(e)){let n=vu(e);if(n)return F(t),n;let r=Zu(e);return Go(r===void 0?void 0:r,r===void 0,e,t)}let n=ns(e,Zl);return F(t),n}function bu(e,t){return mu.set(e,t),Ic(e),e}const xu=new WeakMap,Su=Pc(Ec,class{constructor(e,t,n=void 0,r){let i=s(e),a=s(t),o=Ql(n),c=wr(dn({year:i,month:a,day:s(r??1)}));Du(this,I(c,o))}static from(e,t=void 0){return Cu(Eu(e,t))}static compare(e,t){return ha(Eu(e),Eu(t))}get calendarId(){return Ne(wu(this).calendar)}with(e,t=void 0){return Cu(Fs(wu(this),ku(e),t))}add(e,t=void 0){let n=wu(this);return Cu(I(di(0,n.calendar,n,J(e),t),n.calendar))}subtract(e,t=void 0){let n=wu(this);return Cu(I(di(1,n.calendar,n,J(e),t),n.calendar))}until(e,t=void 0){let n=wu(this),r=Eu(e);return q(ki(0,Si(n.calendar,r.calendar),n,r,t))}since(e,t=void 0){let n=wu(this),r=Eu(e);return q(ki(1,Si(n.calendar,r.calendar),n,r,t))}equals(e){return xa(wu(this),Eu(e))}toPlainDate(e){return Ku(qs(wu(this).calendar,this,e))}toLocaleString(e=void 0,t={}){let n=wu(this),r=new qa(e,ec(bc(t)));return nc(r,n,1),r.format(Ut(n))}toString(e=void 0){return ao(wu(this),e)}toJSON(){return ao(wu(this))}valueOf(){return Rc()}},wu,zc,Hc);function Cu(e){return Du(Object.create(Su.prototype),e)}function wu(e){return Tu(e)||Lc()}function Tu(e){return xu.get(e)}function Eu(e,t){if(y(e)){let n=Tu(e);return n?(F(t),n):Wo(Xu(e),e,t)}let n=es(e,Zl);return F(t),n}function Du(e,t){return xu.set(e,t),Ic(e),e}function Ou(e){if(!y(e))return;let t=uu(e);return t?[Mc,t]:(t=nu(e),t?[jc,t]:(t=Vu(e),t?[kc,t]:(t=qu(e),t?[Oc,t]:(t=Pu(e),t?[Ac,t]:(t=Tu(e),t?[Ec,t]:(t=vu(e),t?[Dc,t]:(t=nd(e),t?[Nc,t]:void 0)))))))}function ku(e){return(Ou(e)||e.calendar!==void 0||e.timeZone!==void 0)&&x(`Invalid bag`),e}const Au=new WeakMap,ju=Pc(Ac,class{constructor(e=0,t=0,n=0,r=0,i=0,a=0){Lu(this,kt(ue(s,{hour:e,minute:t,second:n,millisecond:r,microsecond:i,nanosecond:a})))}static from(e,t=void 0){return Mu(Fu(e,t))}static compare(e,t){return ga(Fu(e),Fu(t))}with(e,t=void 0){return Mu(Ls(Nu(this),ku(e),t))}add(e){return Mu(_i(Nu(this),J(e))[0])}subtract(e){return Mu(_i(Nu(this),z(J(e)))[0])}until(e,t=void 0){return q(ji(0,Nu(this),Fu(e),t))}since(e,t=void 0){return q(ji(1,Nu(this),Fu(e),t))}round(e){let t=Nu(this),[n,r,i]=vr(e,5);return Mu(Kr(t,Jr(n,r),i)[0])}equals(e){return Ca(Nu(this),Fu(e))}toLocaleString(e=void 0,t={}){let n=Nu(this);return new qa(e,ec(yc(t))).format(Nt(n))}toString(e=void 0){return co(Nu(this),e)}toJSON(){return co(Nu(this))}valueOf(){return Rc()}},Nu,tt);function Mu(e){return Lu(Object.create(ju.prototype),e)}function Nu(e){return Pu(e)||Lc()}function Pu(e){return Au.get(e)}function Fu(e,t){if(y(e)){let n=Pu(e);if(n)return F(t),n;let r=Vu(e);if(r)return F(t),Nr(r);let i=nu(e);return i?(F(t),Ws(i)):Ko(e,t)}let n=rs(e);return F(t),n}function Iu(e){return e===void 0?void 0:Fu(e)}function Lu(e,t){return Au.set(e,t),Ic(e),e}const Ru=new WeakMap,zu=Pc(kc,class{constructor(e,t,n,r=0,i=0,a=0,o=0,c=0,l=0,u=void 0){let d=Er(un(ue(s,{year:e,month:t,day:n,hour:r,minute:i,second:a,millisecond:o,microsecond:c,nanosecond:l}))),f=Ql(u);Uu(this,Mr(d,f))}static from(e,t=void 0){return Bu(Hu(e,t))}static compare(e,t){return ma(Hu(e),Hu(t))}get calendarId(){return Ne(G(this).calendar)}with(e,t=void 0){return Bu(Ns(G(this),ku(e),t))}withCalendar(e){return Bu(Mr(G(this),Qu(e)))}withPlainTime(e=void 0){let t=G(this);return Bu(za(t,Iu(e),t.calendar))}add(e,t=void 0){let n=G(this);return Bu(Mr(mi(n.calendar,n,J(e),t),n.calendar))}subtract(e,t=void 0){let n=G(this);return Bu(Mr(mi(n.calendar,n,z(J(e)),t),n.calendar))}until(e,t=void 0){let n=G(this),r=Hu(e);return q(Di(0,Si(n.calendar,r.calendar),n,r,t))}since(e,t=void 0){let n=G(this),r=Hu(e);return q(Di(1,Si(n.calendar,r.calendar),n,r,t))}round(e){let t=G(this),[n,r,i]=vr(e);return Bu(Mr(Gr(t,Jr(n,r),i),t.calendar))}equals(e){return ya(G(this),Hu(e))}toZonedDateTime(e,t=void 0){return U(Gs(G(this),H(au(e)),t))}toPlainDate(){let e=G(this);return Ku(I(e,e.calendar))}toPlainTime(){return Mu(Nr(G(this)))}toLocaleString(e=void 0,t={}){let n=G(this),r=new qa(e,ec(_c(t)));return nc(r,n),r.format(Vt(n))}toString(e=void 0){return ro(G(this),e)}toJSON(){return ro(G(this))}valueOf(){return Rc()}},G,Bc,Uc,tt);function Bu(e){return Uu(Object.create(zu.prototype),e)}function G(e){return Vu(e)||Lc()}function Vu(e){return Ru.get(e)}function Hu(e,t){if(y(e)){let n=Vu(e);if(n)return F(t),n;let r=qu(e);if(r)return F(t),Mr(P(r,Ot),r.calendar);let i=nu(e);return i?(F(t),Hs(i)):Ho(Xu(e),e,t)}let n=Qo(e,Zl);return F(t),n}function Uu(e,t){return Ru.set(e,t),Ic(e),e}const Wu=new WeakMap,Gu=Pc(Oc,class{constructor(e,t,n,r=void 0){let i=Tr(dn(ue(s,{year:e,month:t,day:n}))),a=Ql(r);Yu(this,I(i,a))}static from(e,t=void 0){return Ku(Ju(e,t))}static compare(e,t){return ha(Ju(e),Ju(t))}get calendarId(){return Ne(K(this).calendar)}with(e,t=void 0){return Ku(Ps(K(this),ku(e),t))}withCalendar(e){return Ku(I(K(this),Qu(e)))}add(e,t=void 0){let n=K(this);return Ku(I(hi(n.calendar,n,J(e),t),n.calendar))}subtract(e,t=void 0){let n=K(this);return Ku(I(hi(n.calendar,n,z(J(e)),t),n.calendar))}until(e,t=void 0){let n=K(this),r=Ju(e);return q(Oi(0,Si(n.calendar,r.calendar),n,r,t))}since(e,t=void 0){let n=K(this),r=Ju(e);return q(Oi(1,Si(n.calendar,r.calendar),n,r,t))}equals(e){return ba(K(this),Ju(e))}toZonedDateTime(e){let t=y(e)?{timeZone:e.timeZone,plainTime:e.plainTime}:{timeZone:e};return U(Ks(au,Fu,K(this),t))}toPlainDateTime(e=void 0){let t=K(this);return Bu(za(t,Iu(e),t.calendar))}toPlainYearMonth(){return Cu(Xs(K(this).calendar,this))}toPlainMonthDay(){return gu(Ys(K(this).calendar,this))}toLocaleString(e=void 0,t={}){let n=K(this),r=new qa(e,ec(vc(t)));return nc(r,n),r.format(Ut(n))}toString(e=void 0){return io(K(this),e)}toJSON(){return io(K(this))}valueOf(){return Rc()}},K,Bc,Uc);function Ku(e){return Yu(Object.create(Gu.prototype),e)}function K(e){return qu(e)||Lc()}function qu(e){return Wu.get(e)}function Ju(e,t){if(y(e)){let n=qu(e);if(n)return F(t),n;let r=Vu(e);if(r)return F(t),I(r,r.calendar);let i=nu(e);return i?(F(t),Us(i)):Uo(Xu(e),e,t)}let n=$o(e,Zl);return F(t),n}function Yu(e,t){return Wu.set(e,t),Ic(e),e}function Xu(e){let t=Zu(e);return t===void 0?void 0:t}function Zu(e){let{calendar:t}=e;if(t!==void 0)return Qu(t)}function Qu(e){if(y(e)){let t=qu(e)||Vu(e)||nu(e)||vu(e)||Tu(e);return t||x(ee(e)),t.calendar}return(e=>Zl(as(N(e))))(e)}const $u=new WeakMap,ed=Pc(Nc,class{constructor(e=0,t=0,n=0,r=0,i=0,a=0,o=0,s=0,c=0,l=0){let u=na(ue(Vn,{years:e,months:t,weeks:n,days:r,hours:i,minutes:a,seconds:o,milliseconds:s,microseconds:c,nanoseconds:l}));id(this,L(u))}static from(e){return q(J(e))}static compare(e,t,n=void 0){return pa(rd,J(e),J(t),n)}get sign(){return td(this).sign}get blank(){return!td(this).sign}with(e){return q(Rs(td(this),e))}negated(){return q(ea(td(this)))}abs(){return q($i(td(this)))}add(e,t=void 0){return q(Xi(rd,0,td(this),J(e),t))}subtract(e,t=void 0){return q(Xi(rd,1,td(this),J(e),t))}round(e){return q(Qi(rd,td(this),e))}total(e){return Ir(rd,td(this),e)}toLocaleString(e=void 0,t){let n=td(this);return Intl.DurationFormat?new Intl.DurationFormat(e,t).format(n):lo(n,t)}toString(e=void 0){return lo(td(this),e)}toJSON(){return lo(td(this))}valueOf(){return Rc()}},td,Dn);function q(e){return id(Object.create(ed.prototype),e)}function td(e){return nd(e)||Lc()}function nd(e){return $u.get(e)}function J(e){return y(e)?nd(e)||qo(e):is(e)}function rd(e){if(e!==void 0){if(y(e)){let t=nu(e);if(t)return t;let n=qu(e);if(n)return n;let r=Vu(e);return r?I(r,r.calendar):Bo(au,Xu(e),e)}return Xo(e,Zl)}}function id(e,t){return $u.set(e,t),Ic(e),e}const ad=Object.defineProperties({},{...le(`Temporal.Now`),...ce({timeZoneId(){return Tc()},instant(){return cu(Ar(wc()))},zonedDateTimeISO(e=Tc()){let t=H(au(e));return U(jr(wc(),t))},plainDateTimeISO(e=Tc()){return Bu(Mr(Cc(H(au(e)))))},plainDateISO(e=Tc()){return Ku(I(Cc(H(au(e)))))},plainTimeISO(e=Tc()){return Mu(Nr(Cc(H(au(e)))))}})}),od=Object.defineProperties({},{...le(`Temporal`),...ce({PlainYearMonth:Su,PlainMonthDay:hu,PlainDate:Gu,PlainTime:ju,PlainDateTime:zu,ZonedDateTime:eu,Instant:su,Duration:ed,Now:ad})}),Y=globalThis.Temporal??od,sd=Y!==od,cd=1e3,ld=864e5;180*ld;const ud=400*ld,dd=30*36e5,fd=864e13;function pd(e){if(e===`UTC`||e===`Etc/UTC`||e===`Etc/GMT`)return 0;let t=/^([+-])(\d{2}):?(\d{2})(?::?(\d{2}))?$/.exec(e);return t?(t[1]===`-`?-1:1)*((Number(t[2])*60+Number(t[3]))*60+Number(t[4]??0))*cd:null}var md=class{constructor(e){this.tzid=e,this.transitions=[],this.offsets=[],this.coverStart=0,this.coverEnd=0,this.covered=!1,this.fixedOffsetMs=pd(e)}zonedAt(e){return new Y.ZonedDateTime(BigInt(e)*1000000n,this.tzid)}ensureCoverage(e,t){if(this.fixedOffsetMs!==null||this.covered&&e>=this.coverStart&&t<=this.coverEnd)return;let n=!this.covered||e<this.coverStart?e-ud:this.coverStart,r=!this.covered||t>this.coverEnd?t+ud:this.coverEnd;if(n=Math.max(n,Math.min(e,-fd)),r=Math.min(r,Math.max(t,fd)),n=Math.floor(n/cd)*cd,r=Math.ceil(r/cd)*cd,this.covered){if(n<this.coverStart){let e=this.scan(n,this.coverStart);this.transitions=e.transitions.concat(this.transitions),this.offsets=e.offsets.concat(this.offsets.slice(1))}if(r>this.coverEnd){let e=this.scan(this.coverEnd,r);this.transitions=this.transitions.concat(e.transitions),this.offsets=this.offsets.concat(e.offsets.slice(1))}}else{let e=this.scan(n,r);this.transitions=e.transitions,this.offsets=e.offsets}this.coverStart=n,this.coverEnd=r,this.covered=!0}scan(e,t){let n=this.zonedAt(e),r=[],i=[n.offsetNanoseconds/1e6];for(;;){let e=n.getTimeZoneTransition(`next`);if(e){if(e.epochMilliseconds>t)break;r.push(e.epochMilliseconds),i.push(e.offsetNanoseconds/1e6),n=e;continue}if(sd)break;let a=Math.ceil((Math.max(n.epochMilliseconds,Date.now())+15552e6)/cd)*cd;if(a>=t||a>fd)break;let o=this.zonedAt(a),s=i[i.length-1];if(o.offsetNanoseconds/1e6!==s){let e=n.epochMilliseconds,t=a;for(;t-e>cd;){let n=e+Math.floor((t-e)/2/cd)*cd;n<=e&&(n=e+cd),this.zonedAt(n).offsetNanoseconds/1e6===s?e=n:t=n}r.push(t),i.push(this.zonedAt(t).offsetNanoseconds/1e6)}n=o}return{transitions:r,offsets:i}}offsetMsAt(e){if(this.fixedOffsetMs!==null)return this.fixedOffsetMs;this.ensureCoverage(e,e);let t=this.transitions,n=0,r=t.length;for(;n<r;){let i=n+r>>1;t[i]<=e?n=i+1:r=i}return this.offsets[n]}nextTransitionAfter(e,t){if(this.fixedOffsetMs!==null)return;this.ensureCoverage(e,t);let n=this.transitions,r=0,i=n.length;for(;r<i;){let t=r+i>>1;n[t]<=e?r=t+1:i=t}let a=n[r];return a!==void 0&&a<=t?a:void 0}epochMsForWall(e){if(this.fixedOffsetMs!==null)return{epochMs:e-this.fixedOffsetMs,pushed:!1};this.ensureCoverage(e-dd,e+dd);let t=this.offsetMsAt(e-dd),n=e-t;if(this.offsetMsAt(n)===t)return{epochMs:n,pushed:!1};let r=this.offsetMsAt(e+dd),i=e-r;return this.offsetMsAt(i)===r?{epochMs:i,pushed:!1}:{epochMs:n,pushed:!0}}timeOfDayMayHitGap(e,t,n){if(this.fixedOffsetMs!==null)return!1;this.ensureCoverage(t,n);let r=this.transitions,i=0,a=r.length;for(;i<a;){let e=i+a>>1;r[e]<t?i=e+1:a=e}for(let t=i;t<r.length&&r[t]<=n;t++){let n=r[t],i=this.offsets[t],a=this.offsets[t+1]-i;if(a<=0)continue;let o=e-((n+i)%ld+ld)%ld;if(o>=0?o<a:o+ld<a)return!0}return!1}};const hd=new Map;function gd(e){let t=hd.get(e);return t||(t=new md(e),hd.set(e,t)),t}const _d=[`YEARLY`,`MONTHLY`,`WEEKLY`,`DAILY`,`HOURLY`,`MINUTELY`,`SECONDLY`],vd=[`MO`,`TU`,`WE`,`TH`,`FR`,`SA`,`SU`],X={MO:1,TU:2,WE:3,TH:4,FR:5,SA:6,SU:7},yd=new Set(_d),bd=new Set(vd),xd=RegExp(`^([+-]?\\d{1,2})?(${vd.join(`|`)})$`),Sd=RegExp(`(${vd.join(`|`)})$`),Cd=1e3,wd=60*Cd,Td=60*wd,Z=24*Td,Ed=7*Z,Dd=[31,28,31,30,31,30,31,31,30,31,30,31],Od=[0,3,2,5,0,3,5,1,4,6,2,4],Q=BigInt(1e6),kd=BigInt(1e9),Ad=BigInt(60)*kd,jd=BigInt(60)*Ad,Md=BigInt(24)*jd,Nd=BigInt(7)*Md,Pd=864e13,Fd=1e3;function Id(e,t){let n=Math.abs(e),r=Math.abs(t);for(;r!==0;){let e=n%r;n=r,r=e}return n}function Ld(e){let t=0;for(let n of e??[])t|=1<<n-1;return t}function Rd(e,t){return e===0||(e&1<<t-1)!=0}function zd(e,t){let n=e/t;return e%t<0n?n-1n:n}function Bd(e,t){return-zd(-e,t)}function Vd(e,t){return Number(t?zd(e,Q)+1n:Bd(e,Q))}function Hd(e,t){return Number(t?Bd(e,Q)-1n:zd(e,Q))}function Ud(e){return Number.isSafeInteger(e)&&e>=-Pd&&e<=Pd}function Wd(e,t,n){let r=e-(t<=2?1:0),i=Math.floor(r/400),a=r-i*400,o=t+(t>2?-3:9),s=Math.floor((153*o+2)/5)+n-1,c=a*365+Math.floor(a/4)-Math.floor(a/100)+s;return i*146097+c-719468}function Gd(e){let t=e+719468,n=Math.floor(t/146097),r=t-n*146097,i=Math.floor((r-Math.floor(r/1460)+Math.floor(r/36524)-Math.floor(r/146096))/365),a=r-(365*i+Math.floor(i/4)-Math.floor(i/100)),o=Math.floor((5*a+2)/153),s=o+(o<10?3:-9);return{year:i+n*400+(s<=2?1:0),month:s}}function Kd(e){return((e+3)%7+7)%7+1}function $(e,t){return(e-1+t%7+7)%7+1}function qd(e){let t=e.toUpperCase().match(Sd)?.[1];return!t||!bd.has(t)?null:t}function Jd(e){let t=e.toUpperCase().match(xd);if(!t)return null;let n=t[1]?parseInt(t[1],10):0,r=t[2];return!r||!bd.has(r)?null:{ord:n,weekday:r}}function Yd(e){return typeof e==`object`&&!!e&&typeof e.timeZoneId==`string`&&typeof e.toString==`function`}function Xd(e){let t=e.epochNanoseconds;return typeof t==`bigint`?t:void 0}function Zd(e,t){if(!Yd(e))throw Error(`${t} must be a ZonedDateTime`);if(e instanceof Y.ZonedDateTime)return e;try{let t=Xd(e);if(t!==void 0){let n=e.calendarId;return new Y.ZonedDateTime(t,e.timeZoneId,typeof n==`string`?n:`iso8601`)}return Y.ZonedDateTime.from(e.toString())}catch{throw Error(`${t} must be a ZonedDateTime`)}}function Qd(e,t){if(e instanceof Date){let t=e.getTime();return Number.isFinite(t)||e.toISOString(),BigInt(t)*Q}if(!Yd(e))throw Error(`${t} must be a ZonedDateTime`);return Xd(e)??Zd(e,t).epochNanoseconds}function $d(e,t){if(e?.length)return e.map(e=>Zd(e,t))}function ef(e){return typeof e.rruleString==`string`}function tf(e,t){let n=[...e??[],...$d(t,`Manual date`)??[]];return n.length>0?n:void 0}function nf(e){return e.replace(/\r?\n[ \t]/g,``)}function rf(e,t,n){let r=n===`DATE`||!e.includes(`T`),i=`${e.slice(0,4)}-${e.slice(4,6)}-${e.slice(6,8)}`;if(r)return Y.PlainDate.from(i).toZonedDateTime({timeZone:t});if(e.endsWith(`Z`)){let n=`${i}T${e.slice(9,15)}Z`;return Y.Instant.from(n).toZonedDateTimeISO(t||`UTC`)}else{let n=`${i}T${e.slice(9)}`;return Y.PlainDateTime.from(n).toZonedDateTime(t)}}function af(e,t,n){let r=[];for(let i of e){let e=of(i,t);if(!e)continue;let a=e.tzid||n,o=e.value.split(`,`);r.push(...o.map(t=>rf(t,a,e.valueType)))}return r}function of(e,t){let n=e.indexOf(`:`);if(n===-1)return null;let r=e.slice(0,n),i=e.slice(n+1),[a,...o]=r.split(`;`);if(a?.toUpperCase()!==t)return null;let s,c;for(let e of o){let t=e.indexOf(`=`);if(t===-1)continue;let n=e.slice(0,t).toUpperCase(),r=e.slice(t+1);n===`VALUE`?s=r.toUpperCase():n===`TZID`&&(c=r)}return{valueType:s,tzid:c,value:i}}function sf(e,t,n){let r=e.trim();if(n&&!/^[+-]?\d+$/.test(r))throw Error(`Invalid ${t} value: ${e}`);return parseInt(r,10)}function cf(e,t=!1,n=!1,r=`number`){let i=e.split(`,`).map(e=>sf(e,r,n));return t?i.sort((e,t)=>e-t):i}function lf(e,t=!1){return e.split(`,`).map(e=>{let n=e.trim();if(/^\d+L$/i.test(n))return n.toUpperCase();let r=sf(n,`BYMONTH`,t);return Number.isFinite(r)?r:n})}function uf(e,t,n,r=!1){let i=nf(e).trim(),a,o=t,s=`DATE-TIME`,c=!1,l=!1,u,d=[],f=[];if(/^DTSTART/im.test(i)){let e=i.split(/\s+/),n=e.find(e=>e.match(/^DTSTART/i)),r=e.find(e=>e.match(/^RRULE:/i)),p=e.filter(e=>e.match(/^EXDATE/i)),m=e.filter(e=>e.match(/^RDATE/i)),h=of(n,`DTSTART`);if(!h)throw Error(`Invalid DTSTART in ICS snippet`);let{valueType:g,tzid:_,value:v}=h;s=(g||(v?.includes(`T`)?`DATE-TIME`:`DATE`)).toUpperCase()===`DATE`?`DATE`:`DATE-TIME`,c=!!_,l=!!v?.endsWith(`Z`),a=rf(v,_??t??o??`UTC`,s),o=_??a.timeZoneId??t??o??`UTC`,u=r,d=af(p,`EXDATE`,o??`UTC`),f=af(m,`RDATE`,o??`UTC`)}else a=n?Zd(n,`dtstart`):void 0,u=i,a&&(o=a.timeZoneId,s=`DATE-TIME`,c=!0,l=a.timeZoneId===`UTC`);let p=u?u.replace(/^RRULE:/i,``).split(`;`):[],m={dtstart:a,tzid:o,exDate:d.length>0?d:void 0,rDate:f.length>0?f:void 0},h;for(let e of p){let[t,n]=e.split(`=`);if(t)switch(t.toUpperCase()){case`RSCALE`:n&&(m.rscale=n.toUpperCase(),h&&!m.skip&&(m.skip=h,h=void 0));break;case`SKIP`:{let e=(n||``).toUpperCase();if(![`OMIT`,`BACKWARD`,`FORWARD`].includes(e))throw Error(`Invalid SKIP value: ${n}`);m.rscale?m.skip=e:h=e;break}case`FREQ`:m.freq=n.toUpperCase();break;case`INTERVAL`:m.interval=sf(n,`INTERVAL`,r);break;case`COUNT`:m.count=sf(n,`COUNT`,r);break;case`UNTIL`:{let e=n.includes(`T`);if(s===`DATE`){if(e)throw Error(`UNTIL rule part MUST have the same value type as DTSTART`);m.until=rf(n,o||`UTC`,`DATE`);break}if(!e){if(r)throw Error(`UNTIL rule part MUST have the same value type as DTSTART`);let e=rf(n,o||`UTC`,`DATE`).with({hour:23,minute:59,second:59,millisecond:0,microsecond:0,nanosecond:0});m.until=c||l?e.withTimeZone(`UTC`):e;break}if((c||l)&&!n.endsWith(`Z`))throw Error(`UNTIL rule part MUST always be specified as a date with UTC time`);m.until=rf(n,o||`UTC`,`DATE-TIME`);break}case`BYHOUR`:m.byHour=cf(n,!0,r,`BYHOUR`);break;case`BYMINUTE`:m.byMinute=cf(n,!0,r,`BYMINUTE`);break;case`BYSECOND`:m.bySecond=cf(n,!0,r,`BYSECOND`);break;case`BYDAY`:m.byDay=n.split(`,`).map(e=>e.toUpperCase());break;case`BYMONTH`:m.byMonth=lf(n,r);break;case`BYMONTHDAY`:m.byMonthDay=cf(n,!1,r,`BYMONTHDAY`);break;case`BYYEARDAY`:m.byYearDay=cf(n,!1,r,`BYYEARDAY`);break;case`BYWEEKNO`:m.byWeekNo=cf(n,!1,r,`BYWEEKNO`);break;case`BYSETPOS`:m.bySetPos=cf(n,!1,r,`BYSETPOS`);break;case`WKST`:m.wkst=n?.toUpperCase();break}}if(h&&!m.rscale)throw Error(`SKIP MUST NOT be present unless RSCALE is present`);return h&&m.rscale&&!m.skip&&(m.skip=h),m}var df=class e{static{this.rscaleCalendarSupport={}}static normalizeToPolyfill(e){return Zd(e,`Date`)}toPublicDate(e){if(!e)return null;let t=this.outputTemporal?.ZonedDateTime;if(!t||t===Y.ZonedDateTime)return e;if(this.outputConstructorFastPathAvailable!==!1)try{let n=new t(e.epochNanoseconds,e.timeZoneId,e.calendarId);return this.outputConstructorFastPathAvailable=!0,n}catch{this.outputConstructorFastPathAvailable=!1}return t.from(e.toString())}toPublicDates(e){return!this.outputTemporal||this.outputTemporal.ZonedDateTime===Y.ZonedDateTime?e:e.map(e=>this.toPublicDate(e))}constructor(t){this.outputTemporal=t.temporal;let n;if(ef(t)){let r=uf(t.rruleString,t.tzid,t.dtstart,t.strict??!1);if(!r.dtstart)throw Error(`dtstart is required - provide it either in rruleString or as a separate parameter`);let i=e.normalizeToPolyfill(r.dtstart);this.tzid=r.tzid??t.tzid??`UTC`,this.originalDtstart=i,n={...r,dtstart:i,rDate:tf(r.rDate,t.rDate),exDate:tf(r.exDate,t.exDate),count:t.count??r.count,until:t.until?e.normalizeToPolyfill(t.until):r.until,strict:t.strict,maxIterations:t.maxIterations,maxCandidateEvaluations:t.maxCandidateEvaluations,includeDtstart:t.includeDtstart,cache:t.cache,temporal:t.temporal,tzid:this.tzid}}else{let e=Zd(t.dtstart,`Manual dtstart`);n={...t,dtstart:e,until:t.until?Zd(t.until,`Manual until`):void 0,rDate:$d(t.rDate,`Manual rDate`),exDate:$d(t.exDate,`Manual exDate`)},n.tzid=n.tzid||e.timeZoneId,this.tzid=n.tzid,this.originalDtstart=e}if(!n.freq)throw Error(`RRULE must include FREQ`);if(n.interval=n.interval??1,n.interval<=0)throw Error(`Cannot create RRule: interval must be greater than 0`);if(this.opts=this.sanitizeOpts(n),this.maxIterations=n.maxIterations??1e4,this.maxCandidateEvaluations=n.maxCandidateEvaluations??1e6,!Number.isSafeInteger(this.maxCandidateEvaluations)||this.maxCandidateEvaluations<=0)throw Error(`maxCandidateEvaluations must be a positive safe integer`);this.includeDtstart=n.includeDtstart??!1,this.parsedByDayTokens=this.buildParsedByDayTokens(this.opts.byDay),this.simpleByDayIsoDays=this.buildByDayIsoDays(this.parsedByDayTokens,!1),this.allByDayIsoDays=this.buildByDayIsoDays(this.parsedByDayTokens,!0),this.hasOrdinalByDay=this.parsedByDayTokens?.some(e=>e.ord!==0)??!1,this.canUseEpochMillisecondsPrecisionFlag=this.originalDtstart.microsecond===0&&this.originalDtstart.nanosecond===0&&(!this.opts.until||this.opts.until.microsecond===0&&this.opts.until.nanosecond===0),this.timeSlotOffsetsMs=this.buildTimeSlotOffsetsMs(),this.hasUniqueTimeSlotOffsets=this.timeSlotOffsetsMs===void 0||new Set(this.timeSlotOffsetsMs).size===this.timeSlotOffsetsMs.length,this.numericByMonths=this.opts.byMonth?.filter(e=>typeof e==`number`)}buildParsedByDayTokens(e){if(!e?.length)return;let t=e.map(e=>{let t=Jd(e);return t?{ord:t.ord,weekday:t.weekday,isoDay:X[t.weekday]}:null}).filter(e=>e!==null);return t.length>0?t:void 0}buildByDayIsoDays(e,t){if(!e?.length)return;let n=e.filter(e=>t||e.ord===0).map(e=>e.isoDay);if(n.length)return[...new Set(n)].sort((e,t)=>e-t)}sanitizeNumericArray(e,t,n,r=!1,i=!1){if(!e)return;let a=[],o=new Set;for(let i of e)Number.isInteger(i)&&i>=t&&i<=n&&(r||i!==0)&&!o.has(i)&&(o.add(i),a.push(i));if(a.length!==0)return i?a.sort((e,t)=>e-t):a}sanitizeByDay(e){let t=[],n=new Set;for(let r of e??[]){if(!r||typeof r!=`string`)continue;let e=r.toUpperCase(),i=Jd(e);if(!i||i.ord===0&&/^[+-]?\d/.test(e))throw Error(`Invalid BYDAY value: ${r}`);n.has(e)||(n.add(e),t.push(e))}return t.length>0?t:void 0}enforceStrictRfc(e){if(!e.strict)return;let t=e.freq;if(e.count!==void 0&&e.until!==void 0)throw Error(`COUNT and UNTIL MUST NOT occur in the same recurrence rule`);if(e.byWeekNo&&t!==`YEARLY`)throw Error(`BYWEEKNO MUST NOT be used unless FREQ=YEARLY`);if(e.byYearDay&&[`DAILY`,`WEEKLY`,`MONTHLY`].includes(t))throw Error(`BYYEARDAY MUST NOT be used when FREQ is DAILY, WEEKLY, or MONTHLY`);if(e.byMonthDay&&t===`WEEKLY`)throw Error(`BYMONTHDAY MUST NOT be used when FREQ is WEEKLY`);let n=(e.byDay??[]).some(e=>/^[+-]?\d/.test(e));if(n&&![`MONTHLY`,`YEARLY`].includes(t))throw Error(`BYDAY with numeric value MUST NOT be used unless FREQ is MONTHLY or YEARLY`);if(n&&t===`YEARLY`&&e.byWeekNo)throw Error(`BYDAY with numeric value MUST NOT be used with FREQ=YEARLY when BYWEEKNO is present`);let r=!!(e.byDay||e.byMonth||e.byMonthDay||e.byYearDay||e.byWeekNo||e.byHour||e.byMinute||e.bySecond);if(e.bySetPos&&!r)throw Error(`BYSETPOS MUST be used with another BYxxx rule part`)}sanitizeOpts(e){if(!yd.has(e.freq))throw Error(`Invalid FREQ value: ${e.freq}`);if(e.byDay=this.sanitizeByDay(e.byDay),e.wkst){let t=e.wkst.toUpperCase();if(!bd.has(t))throw Error(`Invalid WKST value: ${e.wkst}`);e.wkst=t}if(e.byMonth){let t=e.byMonth.filter(e=>typeof e==`number`),n=e.byMonth.filter(e=>typeof e==`string`).map(e=>e.toUpperCase()),r=this.sanitizeNumericArray(t,1,12,!1,!1)??[],i=[...new Set([...r,...n])];e.byMonth=i.length>0?i:void 0}if(e.rscale&&!e.skip&&(e.skip=`OMIT`),e.byMonthDay=this.sanitizeNumericArray(e.byMonthDay,-31,31,!1,!1),e.byYearDay=this.sanitizeNumericArray(e.byYearDay,-366,366,!1,!1),e.byWeekNo=this.sanitizeNumericArray(e.byWeekNo,-53,53,!1,!1),e.byHour=this.sanitizeNumericArray(e.byHour,0,23,!0,!0),e.byMinute=this.sanitizeNumericArray(e.byMinute,0,59,!0,!0),e.bySecond=this.sanitizeNumericArray(e.bySecond,0,59,!0,!0),e.bySetPos){if(e.bySetPos.some(e=>e===0))throw Error(`bySetPos may not contain 0`);e.bySetPos=this.sanitizeNumericArray(e.bySetPos,-1/0,1/0,!1,!1)}return this.enforceStrictRfc(e),e}rawAdvance(e){let{freq:t,interval:n}=this.opts;switch(t){case`DAILY`:return e.add({days:n});case`WEEKLY`:return e.add({weeks:n});case`MONTHLY`:return e.add({months:n});case`YEARLY`:return e.add({years:n});case`HOURLY`:{let t=e.hour,r=e.add({hours:n});return r.hour===t&&n===1&&(r=r.add({hours:n})),r}case`MINUTELY`:return e.add({minutes:n});case`SECONDLY`:return e.add({seconds:n});default:throw Error(`Unsupported FREQ: ${t}`)}}expandByTime(e){if(!this.opts.byHour&&!this.opts.byMinute&&!this.opts.bySecond)return[e];let t=this.opts.byHour??[e.hour],n=this.opts.byMinute??[e.minute],r=this.opts.bySecond??[e.second];if(t.length===1&&n.length===1&&r.length===1){let i=t[0],a=n[0],o=r[0];if(i===e.hour&&a===e.minute&&o===e.second)return[e];let s=this.resolveGeneratedTime(e.toPlainDateTime().with({hour:i,minute:a,second:o}));return s?[s]:[]}let i=[];for(let a of t)for(let t of n)for(let n of r){let r=this.resolveGeneratedTime(e.toPlainDateTime().with({hour:a,minute:t,second:n}));r&&i.push(r)}return i.sort((e,t)=>Y.ZonedDateTime.compare(e,t))}localDateKey(e){return`${e.calendarId}:${e.year}:${e.month}:${e.day}`}sortedUniqueDateCandidates(e){let t=new Map;for(let n of e){let e=this.localDateKey(n);t.has(e)||t.set(e,n)}return[...t.values()].sort((e,t)=>Y.PlainDate.compare(e,t))}resolveGeneratedTime(e){let t=this.originalDtstart,n=this.originalPlainDtstart??=t.toPlainDateTime();if(t.timeZoneId===this.generationTimeZone&&e.equals(n))return t;let r=t.timeZoneId===this.generationTimeZone?t:t.withTimeZone(this.generationTimeZone);r.calendarId!==e.calendarId&&(r=r.withCalendar(e.calendarId));let i=r.with({year:e.year,month:e.month,day:e.day,hour:e.hour,minute:e.minute,second:e.second,millisecond:e.millisecond,microsecond:e.microsecond,nanosecond:e.nanosecond},{offset:`ignore`,overflow:`reject`});return i.toPlainDateTime().equals(e)?i:null}get generationTimeZone(){return this.opts.rscale&&[`CHINESE`,`HEBREW`,`INDIAN`].includes(this.opts.rscale)?this.tzid:this.originalDtstart.timeZoneId}timeOfDayNanoseconds(e){return((e.hour*60*60+e.minute*60+e.second)*1e3+e.millisecond)*1e6+e.microsecond*1e3+e.nanosecond}timeSlotNanoseconds(e,t,n,r){return((t*60*60+n*60+r)*1e3+e.millisecond)*1e6+e.microsecond*1e3+e.nanosecond}needsSortedTimeFallback(e){try{let t=e.startOfDay();return t.add({days:1}).startOfDay().epochNanoseconds-t.epochNanoseconds!==BigInt(864e11)}catch{return!0}}createCandidateWorkBudget(){return{evaluated:0,seenOccurrences:new Set}}recordCandidateEvaluation(e,t=1){if(e.evaluated+=t,e.evaluated>this.maxCandidateEvaluations)throw Error(`Maximum candidate evaluations (${this.maxCandidateEvaluations}) exceeded in all()`)}visitTimeSlots(e,t,n,r,i,a=this.createCandidateWorkBudget()){let o=this.opts.byHour??[this.originalDtstart.hour],s=this.opts.byMinute??[this.originalDtstart.minute],c=this.opts.bySecond??[this.originalDtstart.second],l=e.toPlainDateTime(this.originalDtstart.toPlainTime()),u=(e,t,n)=>this.resolveGeneratedTime(l.with({hour:e,minute:t,second:n}));if(o.length===1&&s.length===1&&c.length===1){this.recordCandidateEvaluation(a);let e=u(o[0],s[0],c[0]);return!e||r&&Y.ZonedDateTime.compare(e,r)<0||i&&Y.ZonedDateTime.compare(e,i)>0?!0:n(e)}if(this.needsSortedTimeFallback(l.toZonedDateTime(this.generationTimeZone))){let e=[];for(let t of o)for(let n of s)for(let o of c){this.recordCandidateEvaluation(a);let s=u(t,n,o);s&&(r&&Y.ZonedDateTime.compare(s,r)<0||i&&Y.ZonedDateTime.compare(s,i)>0||e.push(s))}e.sort((e,t)=>Y.ZonedDateTime.compare(e,t));let l,d=t===1?0:e.length-1,f=t===1?e.length:-1;for(let r=d;r!==f;r+=t){let t=e[r];if(t.epochNanoseconds!==l&&(l=t.epochNanoseconds,!n(t)))return!1}return!0}let d=r?this.timeOfDayNanoseconds(r):void 0,f=i?this.timeOfDayNanoseconds(i):void 0,p=t===1?0:o.length-1,m=t===1?o.length:-1;for(let e=p;e!==m;e+=t){let r=o[e],i=t===1?0:s.length-1,l=t===1?s.length:-1;for(let e=i;e!==l;e+=t){let i=s[e],o=t===1?0:c.length-1,l=t===1?c.length:-1;for(let e=o;e!==l;e+=t){let t=c[e],o=this.timeSlotNanoseconds(this.originalDtstart,r,i,t);if(d!==void 0&&o<d||f!==void 0&&o>f)continue;this.recordCandidateEvaluation(a);let s=u(r,i,t);if(s&&!n(s))return!1}}}return!0}visitDateTimeCandidates(e,t,n,r,i,a=this.createCandidateWorkBudget()){let o=this.sortedUniqueDateCandidates(e);if(!o.length)return!0;let s=o[0],c=r?.withTimeZone(this.generationTimeZone).withCalendar(s.calendarId),l=i?.withTimeZone(this.generationTimeZone).withCalendar(s.calendarId),u=c?.toPlainDate(),d=l?.toPlainDate(),f=t===1?0:o.length-1,p=t===1?o.length:-1,m;for(let e=f;e!==p;e+=t){let r=o[e],i=r;if(u&&Y.PlainDate.compare(i,u)<0||d&&Y.PlainDate.compare(i,d)>0)continue;let s=u&&Y.PlainDate.compare(i,u)===0,f=d&&Y.PlainDate.compare(i,d)===0;if(!this.visitTimeSlots(r,t,e=>e.epochNanoseconds===m?!0:(m=e.epochNanoseconds,n(e)),s?c:void 0,f?l:void 0,a))return!1}return!0}visitPeriodCandidates(e,t,n,r,i=this.createCandidateWorkBudget()){let a=this.opts.bySetPos;if(!a?.length)return this.visitDateTimeCandidates(e,1,t,n,r,i);let o=new Set(a.filter(e=>e>0)),s=new Set(a.filter(e=>e<0).map(e=>-e)),c=new Map;if(o.size>0){let t=0;for(let e of o)t=Math.max(t,e);let n=0;this.visitDateTimeCandidates(e,1,e=>(n+=1,o.has(n)&&c.set(e.epochNanoseconds,e),n<t),void 0,void 0,i)}if(s.size>0){let t=0;for(let e of s)t=Math.max(t,e);let n=0;this.visitDateTimeCandidates(e,-1,e=>(n+=1,s.has(n)&&c.set(e.epochNanoseconds,e),n<t),void 0,void 0,i)}let l=[...c.values()].sort((e,t)=>Y.ZonedDateTime.compare(e,t));for(let e of l)if(!(n&&Y.ZonedDateTime.compare(e,n)<0)&&!(r&&Y.ZonedDateTime.compare(e,r)>0)&&!t(e))return!1;return!0}visitUtcPeriodCandidates(e,t,n,r,i){let a=this.timeSlotOffsetsMs;if(this.tzid!==`UTC`||this.originalDtstart.timeZoneId!==`UTC`||![`iso8601`,`gregory`].includes(e.calendarId)||this.opts.rscale!==void 0||this.opts.byYearDay||this.opts.byWeekNo||this.opts.byMonth?.some(e=>typeof e!=`number`)||!a?.length||!this.hasUniqueTimeSlotOffsets||!Number.isSafeInteger(this.opts.interval)||e.year<=-271821||e.year>=275760||!(this.opts.byDay||this.opts.byMonthDay))return null;let o;if(this.opts.freq===`MONTHLY`){let t=Wd(e.year,e.month,1);o=this.generateMonthlyOccurrenceDaysUtc(e.year,e.month).map(e=>t+e-1)}else if(this.opts.freq===`YEARLY`){if(this.hasOrdinalByDay&&!this.numericByMonths?.length&&(this.opts.byMonthDay||this.parsedByDayTokens?.some(e=>e.ord===0||Math.abs(e.ord)>52)))return null;o=this.generateYearlyOccurrenceDaysUtc(e.year)}else return null;let s=o.length*a.length,c=e=>o[Math.floor(e/a.length)]*Z+a[e%a.length],l=e=>{let t=0,n=s;for(;t<n;){let r=t+Math.floor((n-t)/2);c(r)<e?t=r+1:n=r}return t},u=n?l(Number(Bd(n.epochNanoseconds,Q))):0,d=r?l(Number(zd(r.epochNanoseconds,Q))+1):s,f=n=>t(new Y.ZonedDateTime(BigInt(c(n))*Q,`UTC`,e.calendarId)),p=this.opts.bySetPos;if(p?.length){let e=0,t=0,n=new Set;for(let r of p){r>0?e=Math.max(e,r):t=Math.max(t,-r);let i=r>0?r-1:s+r;i>=0&&i<s&&n.add(i)}this.recordCandidateEvaluation(i,Math.min(s,e)+Math.min(s,t));for(let e of[...n].sort((e,t)=>e-t))if(e>=u&&e<d&&!f(e))return!1}else for(let e=u;e<d;e++)if(this.recordCandidateEvaluation(i),!f(e))return!1;return!0}nextCandidateSameDate(e){let{freq:t,interval:n=1,byHour:r,byMinute:i,bySecond:a}=this.opts;if(r?.length&&!r.includes(e.hour)){let n=r.find(t=>t>e.hour);return(n===void 0?e.add({days:1}):e).with({hour:n??r[0],minute:i?.[0]??(t===`HOURLY`?this.originalDtstart.minute:0),second:a?.[0]??(t===`SECONDLY`?0:this.originalDtstart.second)})}if(t===`HOURLY`&&r&&r.length===1)return this.applyTimeOverride(e.add({days:n}));if(t===`MINUTELY`&&i&&i.length===1){let t=e.add({hours:n});return r?.length&&!r.includes(t.hour)?this.nextCandidateSameDate(t):t.with({minute:i[0],second:a?.[0]??t.second})}if(a&&a.length>1){let t=a.indexOf(e.second);if(t!==-1&&t<a.length-1)return e.with({second:a[t+1]})}if(t===`MINUTELY`&&r&&r.length>1&&!i){let t=e.add({minutes:n});if(r.includes(t.hour))return t.with({second:a?a[0]:e.second});let i=r.find(t=>t>e.hour)||r[0];return i&&i>e.hour?e.with({hour:i,minute:0,second:a?a[0]:e.second}):this.applyTimeOverride(e.add({days:1}))}if(t===`SECONDLY`){let t=e;if(a&&a.length>0){let e=a.find(e=>e>t.second);if(e!==void 0)return t.with({second:e});t=t.with({second:a[0]}).add({minutes:1})}else t=t.add({seconds:n});if(i&&i.length>0&&(!i.includes(t.minute)||t.minute===e.minute&&t.second<e.second)){let e=i.find(e=>e>t.minute);if(e!==void 0)return t.with({minute:e,second:a?a[0]:0});t=t.with({minute:i[0],second:a?a[0]:0}).add({hours:1})}if(r&&r.length>0&&(!r.includes(t.hour)||t.hour===e.hour&&t.minute<e.minute)){let e=r.find(e=>e>t.hour);if(e!==void 0)return t.with({hour:e,minute:i?i[0]:0,second:a?a[0]:0});t=t.with({hour:r[0],minute:i?i[0]:0,second:a?a[0]:0}).add({days:1})}return t}if(i&&i.length>1){let o=i.indexOf(e.minute);if(o!==-1&&o<i.length-1)return e.with({minute:i[o+1],second:a?a[0]:e.second});if(t===`MINUTELY`&&o===i.length-1){if(r&&r.length>0){let t=r.indexOf(e.hour);return t!==-1&&t<r.length-1?e.with({hour:r[t+1],minute:i[0],second:a?a[0]:e.second}):this.applyTimeOverride(e.add({days:1}))}return e.add({hours:n}).with({minute:i[0],second:a?a[0]:e.second})}}if(r&&r.length>1){let t=r.find(t=>t>e.hour);if(t!==void 0)return e.with({hour:t,minute:i?i[0]:e.minute,second:a?a[0]:e.second})}return t===`HOURLY`&&r&&r.length>1?this.applyTimeOverride(e.add({days:1})):this.applyTimeOverride(this.rawAdvance(e))}applyTimeOverride(e){let{freq:t,byHour:n,byMinute:r,bySecond:i}=this.opts,a=t===`DAILY`||t===`WEEKLY`||t===`MONTHLY`||t===`YEARLY`;if(!n&&!r&&!i&&!a)return e;let o={};return n?o.hour=n[0]:a&&(o.hour=this.originalDtstart.hour),r?o.minute=r[0]:a&&(o.minute=this.originalDtstart.minute),i?o.second=i[0]:a&&(o.second=this.originalDtstart.second),a&&o.hour===e.hour&&o.minute===e.minute&&o.second===e.second?e:e.with(o)}computeFirst(){let e=this.originalDtstart;if(this.opts.byWeekNo?.length&&[`DAILY`,`HOURLY`,`MINUTELY`,`SECONDLY`].includes(this.opts.freq)){let t=this.opts.byWeekNo[0],n=e.year;for(;n<=e.year+10;){let r=e.with({year:n,month:1,day:1}),i=e.with({year:n,month:12,day:31}),a=!1;if(t>0){let e=52;(r.dayOfWeek===4||i.dayOfWeek===4)&&(e=53),a=t<=e}else{let e=52;(r.dayOfWeek===4||i.dayOfWeek===4)&&(e=53),a=-t<=e}if(a){let n=r.add({days:(4-r.dayOfWeek+7)%7}),a;if(t>0)a=n.subtract({days:3}).add({weeks:t-1});else{let e=r.dayOfWeek===4||i.dayOfWeek===4?53:52;a=n.subtract({days:3}).add({weeks:e+t})}if(this.opts.byDay?.length){let t=X,n=this.opts.byDay.map(e=>qd(e)).filter(e=>e!==null).map(e=>t[e]).filter(Boolean);if(n.length){let t=n.map(e=>{let t=(e-a.dayOfWeek+7)%7;return a.add({days:t})}).sort((e,t)=>Y.ZonedDateTime.compare(e,t))[0];if(t&&Y.ZonedDateTime.compare(t,this.originalDtstart)>=0){e=t;break}}}else if(Y.ZonedDateTime.compare(a,this.originalDtstart)>=0){e=a;break}}n++}}if(this.opts.byDay?.length&&!this.opts.byWeekNo){let t=X;if(this.opts.byDay.some(e=>/^[+-]?\d/.test(e))&&this.opts.byMonth&&(this.opts.freq===`MINUTELY`||this.opts.freq===`SECONDLY`)){let t=this.opts.byMonth.filter(e=>typeof e==`number`).sort((e,t)=>e-t),n=!1;for(let r=e.year;r<=e.year+10&&!n;r++)for(let i of t){if(r===e.year&&i<e.month)continue;let t=e.with({year:r,month:i,day:1}),a=this.generateMonthlyOccurrences(t);for(let t of a)if(Y.ZonedDateTime.compare(t,e)>=0){e=t.toPlainDate().equals(e.toPlainDate())?t:this.applyTimeOverride(t.with({hour:0,minute:0,second:0})),n=!0;break}if(n)break}}else{let n,r=this.opts.byDay.map(e=>qd(e)).filter(e=>e!==null);if(this.opts.freq===`DAILY`&&r.length===this.opts.byDay.length){let i=this.findFirstMatchingDailyStep(e.dayOfWeek,this.opts.interval,r.map(e=>t[e]));n=i===null?[]:[i*this.opts.interval]}else n=r.map(n=>(t[n]-e.dayOfWeek+7)%7);n.length&&(e=e.add({days:Math.min(...n)}))}}let{byHour:t,byMinute:n,bySecond:r}=this.opts;if(this.opts.freq===`HOURLY`&&!t&&Y.ZonedDateTime.compare(e.with({hour:0,minute:0,second:0,microsecond:0,nanosecond:0}),this.originalDtstart)>0&&(e=e.with({hour:0,minute:0,second:0,microsecond:0,nanosecond:0})),this.opts.freq===`MINUTELY`&&!n&&Y.ZonedDateTime.compare(e.with({hour:0,minute:0,second:0,microsecond:0,nanosecond:0}),this.originalDtstart)>0&&(e=e.with({hour:0,minute:0,second:0,microsecond:0,nanosecond:0})),this.opts.freq===`SECONDLY`&&this.opts.byWeekNo?.length&&!r&&Y.ZonedDateTime.compare(e.with({hour:0,minute:0,second:0,microsecond:0,nanosecond:0}),this.originalDtstart)>0&&(e=e.with({hour:0,minute:0,second:0,microsecond:0,nanosecond:0})),t||n||r){let t=this.expandByTime(e);for(let e of t)if(Y.ZonedDateTime.compare(e,this.originalDtstart)>=0)return e;e=this.applyTimeOverride(this.rawAdvance(e))}return e}matchesByDay(e){let{byDay:t,freq:n}=this.opts;if(!t)return!0;if(!this.hasOrdinalByDay)return this.simpleByDayIsoDays?.includes(e.dayOfWeek)??!1;for(let t of this.parsedByDayTokens??[]){if(n===`DAILY`&&e.dayOfWeek===t.isoDay)return!0;if(t.ord===0){if(e.dayOfWeek===t.isoDay)return!0;continue}let r=e.month,i=e.with({day:1}),a=[];for(;i.month===r;)i.dayOfWeek===t.isoDay&&a.push(i.day),i=i.add({days:1});if(a[t.ord>0?t.ord-1:a.length+t.ord]===e.day)return!0}return!1}matchesByMonth(e){let{byMonth:t}=this.opts;if(!t)return!0;let n=t.filter(e=>typeof e==`number`);return n.length===0?!0:n.includes(e.month)}matchesNumericConstraint(e,t,n){return t.some(t=>e===(t>0?t:n+t+1))}matchesByMonthDay(e){let{byMonthDay:t}=this.opts;if(!t)return!0;let n=e.with({day:1}).add({months:1}).subtract({days:1}).day;return this.matchesNumericConstraint(e.day,t,n)}matchesByHour(e){return!this.opts.byHour||this.opts.byHour.includes(e.hour)}matchesByMinute(e){let{byMinute:t}=this.opts;return t?t.includes(e.minute):!0}matchesBySecond(e){let{bySecond:t}=this.opts;return t?t.includes(e.second):!0}matchesAll(e){return this.matchesByMonth(e)&&this.matchesByWeekNo(e)&&this.matchesByYearDay(e)&&this.matchesByMonthDay(e)&&this.matchesByDay(e)&&this.matchesByHour(e)&&this.matchesByMinute(e)&&this.matchesBySecond(e)}matchesByYearDay(e){let{byYearDay:t}=this.opts;if(!t)return!0;let n=e.dayOfYear,r=this.lastByYearDay(e);return this.matchesNumericConstraint(n,t,r)}lastByYearDay(e){return e.with({month:12,day:31}).dayOfYear}getIsoWeekInfo(e){let t=`toPlainDate`in e?e.toPlainDate():e,n=t.add({days:4-t.dayOfWeek}),r=n.year,i=t.with({year:r,month:1,day:1}),a=i.add({days:(4-i.dayOfWeek+7)%7}),o=n.since(a).days;return{week:Math.floor(o/7)+1,year:r}}matchesByWeekNo(e){let{byWeekNo:t}=this.opts;if(!t)return!0;let{week:n,year:r}=this.getIsoWeekInfo(e),i=e.with({year:r,month:1,day:1}),a=i.inLeapYear,o=i.dayOfWeek===4||a&&i.dayOfWeek===3?53:52;return t.some(e=>e>0?n===e:n===o+e+1)}hasPossibleYearDayWeekNoCombination(){if(!this.opts.byYearDay||!this.opts.byWeekNo)return!0;let e=this.originalDtstart.with({year:2e3,month:1,day:1,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});for(let t=0;t<400;t++){let t=e.daysInYear;for(let n of this.opts.byYearDay){let r=n>0?n:t+n+1;if(r>=1&&r<=t&&this.matchesByWeekNo(e.add({days:r-1})))return!0}e=e.add({years:1})}return!1}options(){let{dtstart:e,until:t,rDate:n,exDate:r,temporal:i,...a}=this.cloneOptions();return{...a,...this.outputTemporal?{temporal:this.outputTemporal}:{},dtstart:this.toPublicDate(e),until:t?this.toPublicDate(t):void 0,rDate:n?this.toPublicDates(n):void 0,exDate:r?this.toPublicDates(r):void 0}}cloneOptions(){let{byHour:e,byMinute:t,bySecond:n,byDay:r,byMonth:i,byMonthDay:a,byYearDay:o,byWeekNo:s,bySetPos:c,rDate:l,exDate:u,...d}=this.opts;return{...d,byHour:e?[...e]:void 0,byMinute:t?[...t]:void 0,bySecond:n?[...n]:void 0,byDay:r?[...r]:void 0,byMonth:i?[...i]:void 0,byMonthDay:a?[...a]:void 0,byYearDay:o?[...o]:void 0,byWeekNo:s?[...s]:void 0,bySetPos:c?[...c]:void 0,rDate:l?[...l]:void 0,exDate:u?[...u]:void 0}}cloneUpdateOptions(e){let t={};return Object.prototype.hasOwnProperty.call(e,`byHour`)&&(t.byHour=Array.isArray(e.byHour)?[...e.byHour]:e.byHour),Object.prototype.hasOwnProperty.call(e,`byMinute`)&&(t.byMinute=Array.isArray(e.byMinute)?[...e.byMinute]:e.byMinute),Object.prototype.hasOwnProperty.call(e,`bySecond`)&&(t.bySecond=Array.isArray(e.bySecond)?[...e.bySecond]:e.bySecond),Object.prototype.hasOwnProperty.call(e,`byDay`)&&(t.byDay=Array.isArray(e.byDay)?[...e.byDay]:e.byDay),Object.prototype.hasOwnProperty.call(e,`byMonth`)&&(t.byMonth=Array.isArray(e.byMonth)?[...e.byMonth]:e.byMonth),Object.prototype.hasOwnProperty.call(e,`byMonthDay`)&&(t.byMonthDay=Array.isArray(e.byMonthDay)?[...e.byMonthDay]:e.byMonthDay),Object.prototype.hasOwnProperty.call(e,`byYearDay`)&&(t.byYearDay=Array.isArray(e.byYearDay)?[...e.byYearDay]:e.byYearDay),Object.prototype.hasOwnProperty.call(e,`byWeekNo`)&&(t.byWeekNo=Array.isArray(e.byWeekNo)?[...e.byWeekNo]:e.byWeekNo),Object.prototype.hasOwnProperty.call(e,`bySetPos`)&&(t.bySetPos=Array.isArray(e.bySetPos)?[...e.bySetPos]:e.bySetPos),Object.prototype.hasOwnProperty.call(e,`rDate`)&&(t.rDate=Array.isArray(e.rDate)?[...e.rDate]:e.rDate),Object.prototype.hasOwnProperty.call(e,`exDate`)&&(t.exDate=Array.isArray(e.exDate)?[...e.exDate]:e.exDate),t}with(t){return new e({...this.cloneOptions(),...t,...this.cloneUpdateOptions(t),tzid:t.tzid??this.opts.tzid,dtstart:t.dtstart??this.opts.dtstart})}addDtstartIfNeeded(e,t){if(this.includeDtstart&&!this.matchesAll(this.originalDtstart)){if(t&&this.isExcluded(this.originalDtstart))return!0;if(t&&!t(this.originalDtstart,e.length)||(e.push(this.originalDtstart),this.shouldBreakForCountLimit(e.length)))return!1}return!0}canUseUtcLinearFastPath(e){if(e||!this.canUseUtcCalendarFastPaths()||this.opts.rscale||this.opts.byMonth||this.opts.byMonthDay||this.opts.byYearDay||this.opts.byWeekNo||this.opts.bySetPos)return!1;switch(this.opts.freq){case`DAILY`:return!this.hasOrdinalByDay&&(!this.opts.byHour||this.canUseEpochMillisecondsPrecisionFlag)&&(!this.opts.byMinute||this.canUseEpochMillisecondsPrecisionFlag)&&(!this.opts.bySecond||this.canUseEpochMillisecondsPrecisionFlag);case`HOURLY`:case`MINUTELY`:case`SECONDLY`:return!this.opts.byDay&&!this.opts.byHour&&!this.opts.byMinute&&!this.opts.bySecond;default:return!1}}canUseUtcWeeklyFastPath(e){return!e&&this.canUseUtcCalendarFastPaths()&&this.opts.freq===`WEEKLY`&&!this.opts.rscale&&!this.opts.byMonth&&!this.opts.byMonthDay&&!this.opts.byYearDay&&!this.opts.byWeekNo&&!this.opts.bySetPos&&(!this.opts.byHour||this.canUseEpochMillisecondsPrecisionFlag)&&(!this.opts.byMinute||this.canUseEpochMillisecondsPrecisionFlag)&&(!this.opts.bySecond||this.canUseEpochMillisecondsPrecisionFlag)&&!this.hasOrdinalByDay}canUseUtcMonthlyFastPath(e){return!e&&this.canUseUtcCalendarFastPaths()&&this.opts.freq===`MONTHLY`&&!this.opts.rscale&&!this.opts.byYearDay&&!this.opts.byWeekNo&&this.canUseEpochMillisecondsPrecisionFlag&&this.hasSingleExpandedTimeSlot()&&!!(this.opts.byDay||this.opts.byMonthDay)}utcZdtFromEpochNanoseconds(e){return new Y.ZonedDateTime(e,`UTC`,this.originalDtstart.calendarId)}utcZdtFromEpochMilliseconds(e){return this.utcZdtFromEpochNanoseconds(BigInt(e)*Q)}canUseUtcCalendarFastPaths(){return this.maxCandidateEvaluations===1e6&&this.tzid===`UTC`&&this.originalDtstart.timeZoneId===this.tzid&&[`iso8601`,`gregory`].includes(this.originalDtstart.calendarId)}canUseUtcEpochMillisecondsPrecision(){return this.canUseEpochMillisecondsPrecisionFlag}buildTimeSlotOffsetsMs(){if(!this.canUseEpochMillisecondsPrecisionFlag)return;let e=this.opts.byHour??[this.originalDtstart.hour],t=this.opts.byMinute??[this.originalDtstart.minute],n=this.opts.bySecond??[this.originalDtstart.second],r=this.originalDtstart.millisecond,i=[];for(let a of e)for(let e of t)for(let t of n)i.push(((a*60+e)*60+t)*Cd+r);return i}createNumericQueryPlan(e,t,n,r){let i=n(0),a=n(t-1);if(!i||!a||!Ud(i.epochMilliseconds)||!Ud(a.epochMilliseconds)||i.epochMilliseconds>a.epochMilliseconds)return null;let o=(e,t,i)=>{if(r)return Math.max(0,Math.min(i,r(e,t)));let a=0,o=i;for(;a<o;){let r=a+Math.floor((o-a)/2),i=n(r);if(!i){o=r;continue}let s=BigInt(i.epochMilliseconds)*Q;(t?s>e:s>=e)?o=r:a=r+1}return a},s=this.opts.until?.epochNanoseconds,c=s===void 0?t:o(s,!0,t);return{kind:e,count:c,maximumCount:t,select:e=>!Number.isSafeInteger(e)||e<0||e>=t?null:n(e),lowerBound:(e,t)=>o(e,t,c)}}buildFixedStepNumericQueryPlan(e){let t;switch(this.opts.freq){case`HOURLY`:t=Td;break;case`MINUTELY`:t=wd;break;case`SECONDLY`:t=Cd;break;default:return null}if(![`UTC`,`Etc/UTC`,`Etc/GMT`].includes(this.tzid)&&!/^[-+]\d{2}:?\d{2}(?::?\d{2})?$/.test(this.tzid)&&this.opts.freq===`HOURLY`&&this.opts.interval===1)return null;let n=this.originalDtstart.epochMilliseconds,r=t*this.opts.interval;if(!Number.isSafeInteger(r)||r<=0)return null;let i=e=>{let t=n+e*r;return Ud(t)?{epochMilliseconds:t,periodIndex:e,occurrenceIndex:e}:null},a=BigInt(n)*Q,o=BigInt(r)*Q,s=BigInt(e);return this.createNumericQueryPlan(`fixed-step`,e,i,(t,n)=>{let r=t-a,i=n?zd(r,o)+1n:Bd(r,o);return i<=0n?0:i>=s?e:Number(i)})}resolveNumericWallMilliseconds(e){if(!Ud(e))return null;if(this.tzid===`UTC`)return e;let t=this.getZoneResolver().epochMsForWall(e);return t.pushed||!Ud(t.epochMs)?null:t.epochMs}numericQueryGapHazard(e,t){if(this.tzid===`UTC`)return!1;let n=this.originalDtstart.epochMilliseconds;return 200*366*Z,t-n>632448e7?!0:this.getZoneResolver().timeOfDayMayHitGap(e,n-Z,t+Z)}buildDailyNumericQueryPlan(e){let t=this.opts.interval,n=this.originalDtstart.epochMilliseconds,r=this.tzid===`UTC`?n:this.wallMsOf(this.originalDtstart),i=Math.floor(r/Z),a=Kd(i),o=Ld(this.simpleByDayIsoDays);if(!(this.opts.byHour||this.opts.byMinute||this.opts.bySecond)){let n=r-i*Z,s=this.simpleByDayIsoDays?.length?this.findFirstMatchingDailyStep(a,t,this.simpleByDayIsoDays):0;if(s===null)return null;let c=7/Id(t,7),l=[];for(let e=0;e<c;e++)Rd(o,$(a,(s+e)*t))&&l.push(e);if(l.length===0)return null;let u=this.createNumericQueryPlan(`daily`,e,e=>{let n=Math.floor(e/l.length),i=e%l.length,a=n*c+l[i],o=(s+a)*t;if(!Number.isSafeInteger(a)||!Number.isSafeInteger(o))return null;let u=r+o*Z,d=this.resolveNumericWallMilliseconds(u);return d===null?null:{epochMilliseconds:d,periodIndex:a,occurrenceIndex:e}}),d=u?.select(e-1);return d&&this.numericQueryGapHazard(n,d.epochMilliseconds)?null:u}let s=this.timeSlotOffsetsMs;if(!s?.length||!this.hasUniqueTimeSlotOffsets)return null;let c=this.simpleByDayIsoDays?.length?this.findFirstMatchingDailyStep(a,t,this.simpleByDayIsoDays):0;if(c===null)return null;let l=c*t,u=i+l,d=$(a,l),f=7/Id(t,7),p=[];if(Rd(o,d))for(let e of s){let t=this.resolveNumericWallMilliseconds(u*Z+e);if(t===null)return null;t>=n&&p.push({epochMilliseconds:t,periodIndex:0,occurrenceIndex:p.length})}let m=[];for(let e=0;e<f;e++)if(Rd(o,$(d,(1+e)*t)))for(let t of s)m.push({periodOffset:e,timeSlotOffset:t});if(p.length===0&&m.length===0)return null;let h=this.createNumericQueryPlan(`daily`,e,e=>{if(e<p.length)return{...p[e],occurrenceIndex:e};if(m.length===0)return null;let n=e-p.length,r=Math.floor(n/m.length),a=m[n%m.length],o=1+r*f+a.periodOffset,s=l+o*t;if(!Number.isSafeInteger(o)||!Number.isSafeInteger(s))return null;let c=(i+s)*Z+a.timeSlotOffset,u=this.resolveNumericWallMilliseconds(c);return u===null?null:{epochMilliseconds:u,periodIndex:o,occurrenceIndex:e}}),g=h?.select(e-1);return g&&s.some(e=>this.numericQueryGapHazard(e,g.epochMilliseconds))?null:h}buildWeeklyNumericQueryPlan(e){let t=this.timeSlotOffsetsMs;if(!t?.length||!this.hasUniqueTimeSlotOffsets)return null;let n=this.originalDtstart.epochMilliseconds,r=this.tzid===`UTC`?n:this.wallMsOf(this.originalDtstart),i=Math.floor(r/Z),a=Kd(i),o=X[qd(this.opts.wkst||`MO`)??`MO`]??1,s=(this.opts.byDay?[...this.allByDayIsoDays??[]]:[a]).map(e=>(e-o+7)%7).sort((e,t)=>e-t);if(s.length===0)return null;let c=i-(a-o+7)%7,l=s.flatMap(e=>t.map(t=>({dayOffset:e,timeSlotOffset:t}))),u=[];for(let e of l){let t=(c+e.dayOffset)*Z+e.timeSlotOffset,r=this.resolveNumericWallMilliseconds(t);if(r===null)return null;r>=n&&u.push({epochMilliseconds:r,periodIndex:0,occurrenceIndex:u.length})}let d=this.createNumericQueryPlan(`weekly`,e,e=>{if(e<u.length)return{...u[e],occurrenceIndex:e};let t=e-u.length,n=1+Math.floor(t/l.length),r=l[t%l.length],i=n*this.opts.interval*7;if(!Number.isSafeInteger(n)||!Number.isSafeInteger(i))return null;let a=(c+i+r.dayOffset)*Z+r.timeSlotOffset,o=this.resolveNumericWallMilliseconds(a);return o===null?null:{epochMilliseconds:o,periodIndex:n,occurrenceIndex:e}}),f=d?.select(e-1);return f&&t.some(e=>this.numericQueryGapHazard(e,f.epochMilliseconds))?null:d}buildMonthlyNumericQueryPlan(e){let t=this.opts.interval,n=this.timeSlotOffsetsMs;if(!n?.length||!this.hasUniqueTimeSlotOffsets||this.opts.byMonth?.some(e=>typeof e!=`number`)||this.opts.bySetPos&&new Set(this.opts.bySetPos).size!==this.opts.bySetPos.length)return null;let r=this.originalDtstart.epochMilliseconds,i=this.originalDtstart.year*12+(this.originalDtstart.month-1),a=e=>{let n=e*t,r=i+n;if(!Number.isSafeInteger(n)||!Number.isSafeInteger(r))return null;let{year:a,month:o}=this.monthIndexToYearMonth(r);return this.generateMonthlyOccurrenceEpochsUtc(a,o)},o=a(0);if(!o)return null;let s=[];for(let e of o){let t=this.resolveNumericWallMilliseconds(e);if(t===null)return null;t>=r&&s.push({epochMilliseconds:t,periodIndex:0,occurrenceIndex:s.length})}let c=4800/Id(t,4800),l=Math.max(0,e-s.length),u=[0];for(let e=0;e<c&&u.at(-1)<l;e++){let t=a(1+e);if(!t)return null;u.push(u[e]+t.length)}let d=u.length-1===c,f=u.at(-1);if(f===0&&s.length<e)return null;let p=this.createNumericQueryPlan(`monthly`,e,e=>{if(e<s.length)return{...s[e],occurrenceIndex:e};if(f===0)return null;let t=e-s.length,n=d?Math.floor(t/f):0,r=d?t%f:t;if(r>=f)return null;let i=1,o=u.length-1;for(;i<o;){let e=i+Math.floor((o-i)/2);u[e]>r?o=e:i=e+1}let l=i-1,p=1+n*c+l;if(!Number.isSafeInteger(p))return null;let m=a(p);if(!m)return null;let h=m[r-u[l]];if(h===void 0)return null;let g=this.resolveNumericWallMilliseconds(h);return g===null?null:{epochMilliseconds:g,periodIndex:p,occurrenceIndex:e}}),m=p?.select(e-1);return m&&n.some(e=>this.numericQueryGapHazard(e,m.epochMilliseconds))?null:p}generateYearlyOccurrenceDaysUtc(e){let t=!!(this.opts.byDay||this.opts.byMonthDay);this.numericByMonths?.length;let n=this.numericByMonths?.length?[...this.numericByMonths].sort((e,t)=>e-t):t?[1,2,3,4,5,6,7,8,9,10,11,12]:[this.originalDtstart.month],r=[];if(this.hasOrdinalByDay&&!this.numericByMonths?.length){let t=this.isGregorianLeapYear(e)?366:365,n=this.gregorianIsoDayOfWeek(e,1,1),i=$(n,t-1),a=new Set;for(let e of this.parsedByDayTokens??[]){if(e.ord===0)continue;let r=e.ord>0?1+(e.isoDay-n+7)%7+7*(e.ord-1):t-(i-e.isoDay+7)%7+7*(e.ord+1);r>=1&&r<=t&&a.add(r)}for(let t of[...a].sort((e,t)=>e-t)){let n=t,i=1;for(;n>this.daysInGregorianMonth(e,i);)n-=this.daysInGregorianMonth(e,i),i+=1;r.push({month:i,day:n})}}else for(let i of n){let n;n=t?this.generateMonthlyOccurrenceDaysUtc(e,i):this.originalDtstart.day<=this.daysInGregorianMonth(e,i)?[this.originalDtstart.day]:[];for(let e of n)r.push({month:i,day:e})}return r.map(({month:t,day:n})=>Wd(e,t,n))}generateYearlyOccurrenceEpochsUtc(e,t=!0){let n=this.timeSlotOffsetsMs;if(!n?.length)return[];let r=[];for(let t of this.generateYearlyOccurrenceDaysUtc(e)){let e=t*Z;if(!Ud(e))return[];for(let t of n)r.push(e+t)}if(r.sort((e,t)=>e-t),!t||!this.opts.bySetPos?.length)return r;let i=this.applyBySetPosToSortedList(r).sort((e,t)=>e-t);return i.filter((e,t)=>t===0||e!==i[t-1])}yearlyCandidateEvaluationCountUtc(e){let t=this.generateYearlyOccurrenceEpochsUtc(e,!1).length,n=this.opts.bySetPos;if(!n?.length)return t;let r=0,i=0;for(let e of n)e>0?r=Math.max(r,e):i=Math.max(i,-e);return Math.min(t,r)+Math.min(t,i)}buildYearlyNumericQueryPlan(e){let t=this.opts.interval,n=this.timeSlotOffsetsMs;if(!n?.length||!this.hasUniqueTimeSlotOffsets||this.opts.byMonth?.some(e=>typeof e!=`number`)||this.opts.byYearDay||this.opts.byWeekNo)return null;let r=!!(this.opts.byDay||this.opts.byMonthDay),i=!!this.opts.byMonth&&!r;if(!this.opts.byMonth&&!r&&n.length!==1||i&&(n.length!==1||this.opts.bySetPos)||this.hasOrdinalByDay&&!this.numericByMonths?.length&&(this.opts.byMonthDay||this.parsedByDayTokens?.some(e=>e.ord===0)))return null;let a=this.originalDtstart.epochMilliseconds,o=this.originalDtstart.year,s=e=>{let n=e*t,r=o+n;return!Number.isSafeInteger(n)||!Number.isSafeInteger(r)?null:this.generateYearlyOccurrenceEpochsUtc(r)},c=s(0);if(!c)return null;let l=[];for(let e of c){let t=this.resolveNumericWallMilliseconds(e);if(t===null)return null;t>=a&&l.push({epochMilliseconds:t,periodIndex:0,occurrenceIndex:l.length})}let u=400/Id(t,400),d=Math.max(0,e-l.length),f=[0],p=[0];for(let e=0;e<u&&f.at(-1)<d;e++){let n=s(1+e);if(!n)return null;f.push(f[e]+n.length);let r=o+(1+e)*t;p.push(p[e]+this.yearlyCandidateEvaluationCountUtc(r))}let m=f.length-1===u,h=f.at(-1);if(h===0&&l.length<e)return null;if(r){let e=this.yearlyCandidateEvaluationCountUtc(o);if(m&&d>0){let t=Math.floor(d/h),n=d%h;if(e+=t*p.at(-1),n>0){let t=1;for(;f[t]<n;)t+=1;e+=p[t]}}else e+=p.at(-1);if(e>this.maxCandidateEvaluations)return null}let g=this.createNumericQueryPlan(`yearly`,e,e=>{if(e<l.length)return{...l[e],occurrenceIndex:e};if(h===0)return null;let t=e-l.length,n=m?Math.floor(t/h):0,r=m?t%h:t;if(r>=h)return null;let i=1,a=f.length-1;for(;i<a;){let e=i+Math.floor((a-i)/2);f[e]>r?a=e:i=e+1}let o=i-1,c=1+n*u+o;if(!Number.isSafeInteger(c))return null;let d=s(c);if(!d)return null;let p=d[r-f[o]];if(p===void 0)return null;let g=this.resolveNumericWallMilliseconds(p);return g===null?null:{epochMilliseconds:g,periodIndex:c,occurrenceIndex:e}}),_=g?.select(e-1);return _&&n.some(e=>this.numericQueryGapHazard(e,_.epochMilliseconds))?null:g}buildNumericQueryPlan(){let e=this.opts.count,t=this.opts.interval;if(e===void 0||!Number.isSafeInteger(e)||e<=0||!Number.isSafeInteger(t)||t<=0||!Number.isSafeInteger(this.maxIterations)||this.maxIterations<=0||this.maxCandidateEvaluations!==1e6||this.includeDtstart||this.opts.rscale!==void 0||!this.canUseEpochMillisecondsPrecisionFlag||this.originalDtstart.timeZoneId!==this.tzid||![`iso8601`,`gregory`].includes(this.originalDtstart.calendarId))return null;let n=!!(this.opts.byMonth||this.opts.byMonthDay||this.opts.byYearDay||this.opts.byWeekNo||this.opts.bySetPos);switch(this.opts.freq){case`HOURLY`:case`MINUTELY`:case`SECONDLY`:return n||this.opts.byDay||this.opts.byHour||this.opts.byMinute||this.opts.bySecond?null:this.buildFixedStepNumericQueryPlan(e);case`DAILY`:return n||this.hasOrdinalByDay||!this.hasUniqueTimeSlotOffsets?null:this.buildDailyNumericQueryPlan(e);case`WEEKLY`:return n||this.hasOrdinalByDay||!this.hasUniqueTimeSlotOffsets?null:this.buildWeeklyNumericQueryPlan(e);case`MONTHLY`:return this.opts.byYearDay||this.opts.byWeekNo||!(this.opts.byDay||this.opts.byMonthDay)||!this.hasUniqueTimeSlotOffsets?null:this.buildMonthlyNumericQueryPlan(e);case`YEARLY`:return this.buildYearlyNumericQueryPlan(e);default:return null}}getNumericQueryPlan(){if(this.numericQueryPlanCache!==void 0)return this.numericQueryPlanCache;try{this.numericQueryPlanCache=this.buildNumericQueryPlan(),this.numericQueryPlanCache&&this.tzid!==`UTC`&&this.resolveNumericWallMilliseconds(this.wallMsOf(this.originalDtstart))!==this.originalDtstart.epochMilliseconds&&(this.numericQueryPlanCache=null)}catch{this.numericQueryPlanCache=null}return this.numericQueryPlanCache}buildPeriodQueryPlan(){let e=this.opts.interval;if(this.opts.count!==void 0||!Number.isSafeInteger(e)||e<=0||!Number.isSafeInteger(this.maxIterations)||this.maxIterations<=32||this.maxCandidateEvaluations!==1e6||this.includeDtstart||this.opts.rscale!==void 0||!this.canUseEpochMillisecondsPrecisionFlag||this.originalDtstart.timeZoneId!==this.tzid||![`iso8601`,`gregory`].includes(this.originalDtstart.calendarId))return null;let{freq:t,byDay:n,byMonth:r,byMonthDay:i,byYearDay:a,byWeekNo:o,bySetPos:s}=this.opts,c=!!(r||i||a||o||s),l=!!(this.opts.byHour||this.opts.byMinute||this.opts.bySecond),u=this.tzid===`UTC`?this.originalDtstart.epochMilliseconds:this.wallMsOf(this.originalDtstart),d=Math.floor(u/Z),f=this.timeSlotOffsetsMs;switch(t){case`HOURLY`:case`MINUTELY`:case`SECONDLY`:{if(c||n||l||![`UTC`,`Etc/UTC`,`Etc/GMT`].includes(this.tzid)&&!/^[-+]\d{2}:?\d{2}(?::?\d{2})?$/.test(this.tzid)&&t===`HOURLY`&&e===1)return null;let r=(t===`HOURLY`?Td:t===`MINUTELY`?wd:Cd)*e;return Number.isSafeInteger(r)?{stepMilliseconds:r,candidatesPerPeriod:1,periodOfWall:()=>0,wallsForPeriod:()=>null}:null}case`DAILY`:{if(c||this.hasOrdinalByDay||!f?.length||!this.hasUniqueTimeSlotOffsets)return null;let t=this.simpleByDayIsoDays;if(t?.length&&this.findFirstMatchingDailyStep(Kd(d),e,t)===null)return null;let n=Ld(t);return{candidatesPerPeriod:f.length,periodOfWall:t=>Math.floor((Math.floor(t/Z)-d)/e),wallsForPeriod:t=>{let r=d+t*e;return Number.isSafeInteger(r)?Rd(n,Kd(r))?f.map(e=>r*Z+e):[]:null}}}case`WEEKLY`:{if(c||this.hasOrdinalByDay||!f?.length||!this.hasUniqueTimeSlotOffsets)return null;let t=Kd(d),r=X[qd(this.opts.wkst||`MO`)??`MO`]??1,i=(n?[...this.allByDayIsoDays??[]]:[t]).map(e=>(e-r+7)%7).sort((e,t)=>e-t);if(i.length===0)return null;let a=i.flatMap(e=>f.map(t=>e*Z+t)),o=d-(t-r+7)%7,s=7*e;return{candidatesPerPeriod:a.length,periodOfWall:e=>Math.floor((Math.floor(e/Z)-o)/s),wallsForPeriod:e=>{let t=o+e*s;return Number.isSafeInteger(t)?a.map(e=>t*Z+e):null}}}case`MONTHLY`:{if(a||o||!f?.length||!this.hasUniqueTimeSlotOffsets||r?.some(e=>typeof e!=`number`))return null;let t=this.originalDtstart.year*12+(this.originalDtstart.month-1),n=n=>{let r=t+n*e;if(!Number.isSafeInteger(r))return null;let i=this.monthIndexToYearMonth(r);return Ud(Wd(i.year,i.month,1)*Z)?i:null};return{candidatesPerPeriod:62*f.length,periodOfWall:n=>{let{year:r,month:i}=Gd(Math.floor(n/Z));return Math.floor((r*12+i-1-t)/e)},wallsForPeriod:e=>{let t=n(e);return t&&this.generateMonthlyOccurrenceEpochsUtc(t.year,t.month)},rankedPeriodWallSpan:s?e=>{let t=n(e);if(!t)return null;let r=Wd(t.year,t.month,1)*Z;return[r,r+this.daysInGregorianMonth(t.year,t.month)*Z]}:void 0}}case`YEARLY`:{if(a||o||!f?.length||!this.hasUniqueTimeSlotOffsets||r?.some(e=>typeof e!=`number`)||!(n||i)&&(f.length!==1||r&&s)||this.hasOrdinalByDay&&!this.numericByMonths?.length&&(i||this.parsedByDayTokens?.some(e=>e.ord===0||Math.abs(e.ord)>52)))return null;let t=this.originalDtstart.year,c=n=>{let r=t+n*e;return Number.isSafeInteger(r)&&r>-271821&&r<275760?r:null};return{candidatesPerPeriod:2*366*f.length,periodOfWall:n=>Math.floor((Gd(Math.floor(n/Z)).year-t)/e),wallsForPeriod:e=>{let t=c(e);return t===null?null:this.generateYearlyOccurrenceEpochsUtc(t)},rankedPeriodWallSpan:s?e=>{let t=c(e);return t===null?null:[Wd(t,1,1)*Z,Wd(t+1,1,1)*Z]}:void 0}}}return null}getPeriodQueryPlan(){if(this.periodQueryPlanCache!==void 0)return this.periodQueryPlanCache;try{this.periodQueryPlanCache=this.buildPeriodQueryPlan(),this.periodQueryPlanCache&&this.tzid!==`UTC`&&this.resolveNumericWallMilliseconds(this.wallMsOf(this.originalDtstart))!==this.originalDtstart.epochMilliseconds&&(this.periodQueryPlanCache=null)}catch{this.periodQueryPlanCache=null}return this.periodQueryPlanCache}findFirstMatchingDailyStep(e,t,n){let r=e;for(let e=0;e<7;e++){if(n.includes(r))return e;r=$(r,t)}return null}allUtcFastPath(e){if(this.canUseUtcLinearFastPath(e))switch(this.opts.freq){case`DAILY`:return this.opts.byHour||this.opts.byMinute||this.opts.bySecond?this.hasUniqueTimeSlotOffsets?this._allUtcDailyExpanded():null:this._allUtcDailySimple();case`HOURLY`:return this._allUtcFixedStepSimple(jd*BigInt(this.opts.interval));case`MINUTELY`:return this._allUtcFixedStepSimple(Ad*BigInt(this.opts.interval));case`SECONDLY`:return this._allUtcFixedStepSimple(kd*BigInt(this.opts.interval))}return this.canUseUtcMonthlyFastPath(e)?this._allUtcMonthlyByDayOrMonthDay():this.canUseUtcWeeklyFastPath(e)?this.opts.byHour||this.opts.byMinute||this.opts.bySecond?this.hasUniqueTimeSlotOffsets?this._allUtcWeeklyExpanded():null:this._allUtcWeeklySimple():null}_allUtcFixedStepSimple(e){let t=[];if(!this.addDtstartIfNeeded(t))return t;let n=0;if(this.canUseUtcEpochMillisecondsPrecision()){let r=this.originalDtstart.epochMilliseconds,i=Number(e/Q),a=this.opts.until?.epochMilliseconds;for(;;){if(++n>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);if(a!==void 0&&r>a||(t.push(this.utcZdtFromEpochMilliseconds(r)),this.shouldBreakForCountLimit(t.length)))break;r+=i}return t}let r=this.originalDtstart.epochNanoseconds,i=this.opts.until?.epochNanoseconds;for(;;){if(++n>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);if(i!==void 0&&r>i||(t.push(this.utcZdtFromEpochNanoseconds(r)),this.shouldBreakForCountLimit(t.length)))break;r+=e}return t}_allUtcDailySimple(){let e=[];if(!this.addDtstartIfNeeded(e))return e;let t=this.opts.interval,n=this.simpleByDayIsoDays,r=0;if(this.canUseUtcEpochMillisecondsPrecision()){let i=t*Z,a=this.opts.until?.epochMilliseconds,o=this.originalDtstart.epochMilliseconds,s=this.originalDtstart.dayOfWeek;if(n?.length){let r=this.findFirstMatchingDailyStep(s,t,n);if(r===null)return e;o+=r*i,s=$(s,r*t)}for(;;){if(++r>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);if(a!==void 0&&o>a||(!n||n.includes(s))&&(e.push(this.utcZdtFromEpochMilliseconds(o)),this.shouldBreakForCountLimit(e.length)))break;o+=i,s=$(s,t)}return e}let i=BigInt(t)*Md,a=this.opts.until?.epochNanoseconds,o=this.originalDtstart.epochNanoseconds,s=this.originalDtstart.dayOfWeek;if(n?.length){let r=this.findFirstMatchingDailyStep(s,t,n);if(r===null)return e;o+=BigInt(r)*i,s=$(s,r*t)}for(;;){if(++r>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);if(a!==void 0&&o>a||(!n||n.includes(s))&&(e.push(this.utcZdtFromEpochNanoseconds(o)),this.shouldBreakForCountLimit(e.length)))break;o+=i,s=$(s,t)}return e}_allUtcDailyExpanded(){let e=[];if(!this.addDtstartIfNeeded(e))return e;let t=this.timeSlotOffsetsMs,n=this.originalDtstart.epochMilliseconds,r=this.opts.until?.epochMilliseconds,i=this.opts.interval,a=this.simpleByDayIsoDays,o=Math.floor(n/Z),s=this.originalDtstart.dayOfWeek;if(a?.length){let t=this.findFirstMatchingDailyStep(s,i,a);if(t===null)return e;let n=t*i;o+=n,s=$(s,n)}let c=0;for(;;){if(++c>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);if(!a||a.includes(s)){let i=o*Z;for(let a of t){let t=i+a;if(!(t<n)&&(r!==void 0&&t>r||(e.push(this.utcZdtFromEpochMilliseconds(t)),this.shouldBreakForCountLimit(e.length))))return e}}o+=i,s=$(s,i)}}_allUtcWeeklySimple(){let e=[];if(!this.addDtstartIfNeeded(e))return e;let t=this.originalDtstart,n=X[qd(this.opts.wkst||`MO`)??`MO`]??1,r=(this.opts.byDay?[...this.allByDayIsoDays??[]]:[t.dayOfWeek]).map(e=>(e-n+7)%7).sort((e,t)=>e-t),i=(t.dayOfWeek-n+7)%7,a=0;if(this.canUseUtcEpochMillisecondsPrecision()){let n=t.epochMilliseconds,o=this.opts.until?.epochMilliseconds,s=this.opts.interval*Ed,c=n-i*Z;for(;;){if(++a>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);for(let t of r){let r=c+t*Z;if(!(r<n)&&(o!==void 0&&r>o||(e.push(this.utcZdtFromEpochMilliseconds(r)),this.shouldBreakForCountLimit(e.length))))return e}c+=s}}let o=t.epochNanoseconds,s=this.opts.until?.epochNanoseconds,c=BigInt(this.opts.interval)*Nd,l=o-BigInt(i)*Md;for(;;){if(++a>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);for(let t of r){let n=l+BigInt(t)*Md;if(!(n<o)&&(s!==void 0&&n>s||(e.push(this.utcZdtFromEpochNanoseconds(n)),this.shouldBreakForCountLimit(e.length))))return e}l+=c}}_allUtcWeeklyExpanded(){let e=[];if(!this.addDtstartIfNeeded(e))return e;let t=this.originalDtstart,n=t.epochMilliseconds,r=Math.floor(n/Z),i=this.opts.until?.epochMilliseconds,a=this.timeSlotOffsetsMs,o=X[qd(this.opts.wkst||`MO`)??`MO`]??1,s=(this.opts.byDay?[...this.allByDayIsoDays??[]]:[t.dayOfWeek]).map(e=>(e-o+7)%7).sort((e,t)=>e-t),c=(t.dayOfWeek-o+7)%7,l=this.opts.interval*7,u=r-c,d=0;for(;;){if(++d>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);for(let t of s){let r=(u+t)*Z;for(let t of a){let a=r+t;if(!(a<n)&&(i!==void 0&&a>i||(e.push(this.utcZdtFromEpochMilliseconds(a)),this.shouldBreakForCountLimit(e.length))))return e}}u+=l}}hasSingleExpandedTimeSlot(){if(this.timeSlotOffsetsMs)return this.timeSlotOffsetsMs.length===1;let e=this.opts.byHour??[this.originalDtstart.hour],t=this.opts.byMinute??[this.originalDtstart.minute],n=this.opts.bySecond??[this.originalDtstart.second];return e.length===1&&t.length===1&&n.length===1}buildMonthlyOccurrenceOnDay(e,t){let n=e.day===t?e:e.with({day:t});return this.applyTimeOverride(n)}applyBySetPosToSortedList(e){let{bySetPos:t}=this.opts;if(!t||!t.length||e.length===0)return e;let n=[],r=e.length;for(let i of t){let t=i>0?i-1:r+i;t>=0&&t<r&&n.push(e[t])}return n}generateMonthlyOccurrenceDays(e){let{byDay:t,byMonth:n,byMonthDay:r}=this.opts,i=e.day===1?e:e.with({day:1});if(n&&!n.includes(e.month))return[];let a=i.add({months:1}).subtract({days:1}).day,o=[];if(r&&r.length>0&&(o=r.map(e=>e>0?e:a+e+1).filter(e=>e>=1&&e<=a),o=[...new Set(o)].sort((e,t)=>e-t)),!t&&r&&r.length>0)return o;if(!t)return[e.day];let s=this.parsedByDayTokens;if(!s?.length)return[];let c=i.dayOfWeek,l=(c-1+a-1)%7+1,u=new Set;for(let{ord:e,isoDay:t}of s)if(e===0){let e=1+(t-c+7)%7;for(;e<=a;)u.add(e),e+=7}else{let n;n=e>0?1+(t-c+7)%7+7*(e-1):a-(l-t+7)%7+7*(e+1),n>=1&&n<=a&&u.add(n)}let d=[...u].sort((e,t)=>e-t);if(r&&r.length>0){if(o.length===0)return[];let e=new Set(o);d=d.filter(t=>e.has(t))}return d}isGregorianLeapYear(e){return e%4==0&&(e%100!=0||e%400==0)}daysInGregorianMonth(e,t){return t===2&&this.isGregorianLeapYear(e)?29:Dd[t-1]}gregorianIsoDayOfWeek(e,t,n){let r=e;t<3&&--r;let i=((r+Math.floor(r/4)-Math.floor(r/100)+Math.floor(r/400)+Od[t-1]+n)%7+7)%7;return i===0?7:i}monthIndexToYearMonth(e){let t=Math.floor(e/12);return{year:t,month:e-t*12+1}}generateMonthlyOccurrenceDaysUtc(e,t){if(this.numericByMonths&&this.numericByMonths.length>0&&!this.numericByMonths.includes(t))return[];let n=this.opts.byMonthDay,r=this.opts.byDay,i=this.daysInGregorianMonth(e,t),a=[];if(n&&n.length>0&&(a=n.map(e=>e>0?e:i+e+1).filter(e=>e>=1&&e<=i),a=[...new Set(a)].sort((e,t)=>e-t)),!r&&n&&n.length>0)return a;if(!r){let e=this.originalDtstart.day;return e>=1&&e<=i?[e]:[]}let o=this.parsedByDayTokens;if(!o?.length)return[];let s=this.gregorianIsoDayOfWeek(e,t,1),c=$(s,i-1),l=new Set;for(let{ord:e,isoDay:t}of o)if(e===0){let e=1+(t-s+7)%7;for(;e<=i;)l.add(e),e+=7}else{let n;n=e>0?1+(t-s+7)%7+7*(e-1):i-(c-t+7)%7+7*(e+1),n>=1&&n<=i&&l.add(n)}let u=[...l].sort((e,t)=>e-t);if(n&&n.length>0){if(a.length===0)return[];let e=new Set(a);u=u.filter(t=>e.has(t))}return u}generateMonthlyOccurrenceEpochsUtc(e,t){let n=this.generateMonthlyOccurrenceDaysUtc(e,t);if(n.length===0)return[];let r=Wd(e,t,1)*Z;if(!Ud(r))return[];let i=this.timeSlotOffsetsMs??[0];if(this.opts.bySetPos&&this.opts.bySetPos.length>0){if(i.length===1){let e=this.applyBySetPosToSortedList(n).sort((e,t)=>e-t),t=i[0];return e.filter((t,n)=>n===0||t!==e[n-1]).map(e=>r+(e-1)*Z+t)}let e=[];for(let t of n){let n=r+(t-1)*Z;for(let t of i)e.push(n+t)}let t=this.applyBySetPosToSortedList(e).sort((e,t)=>e-t);return t.filter((e,n)=>n===0||e!==t[n-1])}let a=[];for(let e of n){let t=r+(e-1)*Z;for(let e of i)a.push(t+e)}return a}_allUtcMonthlyByDayOrMonthDay(){let e=[],t=this.originalDtstart.epochMilliseconds,n=this.opts.until?.epochMilliseconds,r=0;if(!this.addDtstartIfNeeded(e))return e;let i=this.opts.until?.withTimeZone(this.tzid).withCalendar(`iso8601`),a=i?i.year*12+i.month-1:void 0,o=this.originalDtstart.year*12+(this.originalDtstart.month-1);for(;;){if(a!==void 0&&o>a)return e;if(++r>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);let{year:i,month:s}=this.monthIndexToYearMonth(o),c=this.generateMonthlyOccurrenceEpochsUtc(i,s);for(let r of c)if(!(r<t)&&(n!==void 0&&r>n||(e.push(this.utcZdtFromEpochMilliseconds(r)),this.shouldBreakForCountLimit(e.length))))return e;o+=this.opts.interval}}getZoneResolver(){return this.zoneResolver??=gd(this.tzid)}zdtFromEpochMs(e){if(sd||this.tzid===`UTC`)return new Y.ZonedDateTime(BigInt(e)*Q,this.tzid,this.originalDtstart.calendarId);let t=this.emitAnchorZdt;return t?t.add({milliseconds:e-t.epochMilliseconds}):(t=this.emitAnchorZdt=new Y.ZonedDateTime(BigInt(e)*Q,this.tzid,this.originalDtstart.calendarId),t)}wallMsOf(e){return e.epochMilliseconds+e.offsetNanoseconds/1e6}canUseTzEpochFastPaths(e){return!(e||this.maxCandidateEvaluations!==1e6||this.tzid===`UTC`||this.originalDtstart.timeZoneId!==this.tzid||this.opts.freq===`YEARLY`||this.opts.rscale||![`iso8601`,`gregory`].includes(this.originalDtstart.calendarId)||!this.canUseEpochMillisecondsPrecisionFlag||this.resolveNumericWallMilliseconds(this.wallMsOf(this.originalDtstart))!==this.originalDtstart.epochMilliseconds)}tzFastPathGapHazard(e){let t=this.originalDtstart.epochMilliseconds,n;if(this.opts.until)n=this.opts.until.epochMilliseconds;else if(this.opts.count!==void 0){let e=this.tzFastPathCountSpanMs(this.opts.count);if(e===void 0)return!0;n=t+e+30*Z}else return!0;return 150*366*Z,n-t>474336e7?!0:this.getZoneResolver().timeOfDayMayHitGap(e,t-Z,n+Z)}tzFastPathCountSpanMs(e){let t=this.opts.interval,n=this.timeSlotOffsetsMs?.length??1,r=this.wallMsOf(this.originalDtstart);switch(this.opts.freq){case`DAILY`:{let i=this.simpleByDayIsoDays,a=i?.length?7/Id(t,7):1,o=a;if(i?.length){let e=Kd(Math.floor(r/Z));o=0;for(let n=0;n<a;n++)i.includes($(e,n*t))&&o++;if(o===0)return 0}return(Math.ceil(e/(o*n))+1)*a*t*Z}case`WEEKLY`:{let r=this.opts.byDay?this.allByDayIsoDays?.length??0:1;return r===0?0:(Math.ceil(e/(r*n))+1)*t*Ed}}}allTzEpochFastPath(e){if(!this.canUseTzEpochFastPaths(e))return null;let t=!this.opts.byMonth&&!this.opts.byMonthDay&&!this.opts.byYearDay&&!this.opts.byWeekNo&&!this.opts.bySetPos;if(t)switch(this.opts.freq){case`DAILY`:if(!this.hasOrdinalByDay)return this.opts.byHour||this.opts.byMinute||this.opts.bySecond?this.hasUniqueTimeSlotOffsets?this._allTzDailyExpanded():null:this._allTzDailySimple();break;case`HOURLY`:case`MINUTELY`:case`SECONDLY`:if(!this.opts.byDay&&!this.opts.byHour&&!this.opts.byMinute&&!this.opts.bySecond){let e=this.opts.freq===`HOURLY`?Td:this.opts.freq===`MINUTELY`?wd:Cd;return this._allTzFixedStepSimple(e*this.opts.interval)}break}return this.opts.freq===`MONTHLY`&&!this.opts.byYearDay&&!this.opts.byWeekNo&&this.hasSingleExpandedTimeSlot()&&(this.opts.byDay||this.opts.byMonthDay)?this._allTzMonthlyByDayOrMonthDay():this.opts.freq===`WEEKLY`&&t&&!this.hasOrdinalByDay&&this.hasUniqueTimeSlotOffsets?this.opts.byHour||this.opts.byMinute||this.opts.bySecond?this._allTzWeeklyExpanded():this._allTzWeeklySimple():null}_allTzDailySimple(){let e=[];if(!this.addDtstartIfNeeded(e))return e;let t=this.getZoneResolver(),n=this.wallMsOf(this.originalDtstart),r=Math.floor(n/Z),i=n-r*Z;if(this.tzFastPathGapHazard(i))return null;let a=this.opts.interval,o=this.simpleByDayIsoDays,s=this.opts.until?.epochMilliseconds,c=Kd(r);if(o?.length){let t=this.findFirstMatchingDailyStep(c,a,o);if(t===null)return e;r+=t*a,c=$(c,t*a)}let l=0;for(;;){if(++l>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);if(!o||o.includes(c)){let n=t.epochMsForWall(r*Z+i);if(n.pushed)return null;if(s!==void 0&&n.epochMs>s||(e.push(this.zdtFromEpochMs(n.epochMs)),this.shouldBreakForCountLimit(e.length)))break}r+=a,c=$(c,a)}return e}_allTzDailyExpanded(){let e=[];if(!this.addDtstartIfNeeded(e))return e;let t=this.getZoneResolver(),n=this.originalDtstart.epochMilliseconds,r=this.wallMsOf(this.originalDtstart),i=this.timeSlotOffsetsMs;for(let e of i)if(this.tzFastPathGapHazard(e))return null;let a=this.opts.interval,o=this.simpleByDayIsoDays,s=this.opts.until?.epochMilliseconds,c=Math.floor(r/Z),l=Kd(c);if(o?.length){let t=this.findFirstMatchingDailyStep(l,a,o);if(t===null)return e;let n=t*a;c+=n,l=$(l,n)}let u=0;for(;;){if(++u>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);if(!o||o.includes(l)){let r=c*Z;for(let a of i){let i=t.epochMsForWall(r+a);if(i.pushed)return null;if(!(i.epochMs<n)&&(s!==void 0&&i.epochMs>s||(e.push(this.zdtFromEpochMs(i.epochMs)),this.shouldBreakForCountLimit(e.length))))return e}}c+=a,l=$(l,a)}}_allTzFixedStepSimple(e){let t=[];if(!this.addDtstartIfNeeded(t))return t;let n=this.getZoneResolver(),r=this.opts.until?.epochMilliseconds,i=this.opts.freq===`HOURLY`&&this.opts.interval===1,a=e=>{let t=e+n.offsetMsAt(e);return Math.floor((t%Z+Z)%Z/Td)},o=this.originalDtstart.epochMilliseconds,s=0;for(;;){if(++s>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);if(r!==void 0&&o>r||(t.push(this.zdtFromEpochMs(o)),this.shouldBreakForCountLimit(t.length)))break;let n=o+e;i&&a(n)===a(o)&&(n+=e),o=n}return t}_allTzWeeklySimple(){let e=[];if(!this.addDtstartIfNeeded(e))return e;let t=this.getZoneResolver(),n=this.originalDtstart,r=n.epochMilliseconds,i=this.wallMsOf(n),a=Math.floor(i/Z),o=i-a*Z;if(this.tzFastPathGapHazard(o))return null;let s=Kd(a),c=X[qd(this.opts.wkst||`MO`)??`MO`]??1,l=(this.opts.byDay?[...this.allByDayIsoDays??[]]:[s]).map(e=>(e-c+7)%7).sort((e,t)=>e-t),u=(s-c+7)%7,d=this.opts.until?.epochMilliseconds,f=this.opts.interval*7,p=a-u,m=0;for(;;){if(++m>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);for(let n of l){let i=t.epochMsForWall((p+n)*Z+o);if(i.pushed)return null;if(!(i.epochMs<r)&&(d!==void 0&&i.epochMs>d||(e.push(this.zdtFromEpochMs(i.epochMs)),this.shouldBreakForCountLimit(e.length))))return e}p+=f}}_allTzWeeklyExpanded(){let e=[];if(!this.addDtstartIfNeeded(e))return e;let t=this.getZoneResolver(),n=this.originalDtstart,r=n.epochMilliseconds,i=this.wallMsOf(n),a=Math.floor(i/Z),o=this.timeSlotOffsetsMs;for(let e of o)if(this.tzFastPathGapHazard(e))return null;let s=Kd(a),c=X[qd(this.opts.wkst||`MO`)??`MO`]??1,l=(this.opts.byDay?[...this.allByDayIsoDays??[]]:[s]).map(e=>(e-c+7)%7).sort((e,t)=>e-t),u=(s-c+7)%7,d=this.opts.until?.epochMilliseconds,f=this.opts.interval*7,p=a-u,m=0;for(;;){if(++m>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);for(let n of l){let i=(p+n)*Z;for(let n of o){let a=t.epochMsForWall(i+n);if(a.pushed)return null;if(!(a.epochMs<r)&&(d!==void 0&&a.epochMs>d||(e.push(this.zdtFromEpochMs(a.epochMs)),this.shouldBreakForCountLimit(e.length))))return e}}p+=f}}_allTzMonthlyByDayOrMonthDay(){let e=[];if(!this.addDtstartIfNeeded(e))return e;let t=this.getZoneResolver(),n=this.originalDtstart.epochMilliseconds,r=this.opts.until?.epochMilliseconds,i=this.opts.bySetPos?this.timeSlotOffsetsMs[0]:void 0,a=this.opts.until?.withTimeZone(this.tzid).withCalendar(`iso8601`),o=a?a.year*12+a.month-1:void 0,s=this.originalDtstart.year*12+(this.originalDtstart.month-1),c=0;for(;;){if(o!==void 0&&s>o)return e;if(++c>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);let{year:a,month:l}=this.monthIndexToYearMonth(s);if(i!==void 0){let e=Wd(a,l,1)*Z,n=e+this.daysInGregorianMonth(a,l)*Z;if(t.timeOfDayMayHitGap(i,e-Z,n+Z))return null}for(let i of this.generateMonthlyOccurrenceEpochsUtc(a,l)){let a=t.epochMsForWall(i);if(a.pushed)return null;if(!(a.epochMs<n)&&(r!==void 0&&a.epochMs>r||(e.push(this.zdtFromEpochMs(a.epochMs)),this.shouldBreakForCountLimit(e.length))))return e}s+=this.opts.interval}}processOccurrences(e,t,n,r,i){for(let a of e)if(!this.processOccurrence(a,t,n,r,i))return{shouldBreak:!0};return{shouldBreak:!1}}processOccurrence(e,t,n,r,i,a){if(a){if(a.seenOccurrences.size===0&&t.length>0)for(let e of t)a.seenOccurrences.add(e.epochNanoseconds);if(a.seenOccurrences.has(e.epochNanoseconds))return!0;a.seenOccurrences.add(e.epochNanoseconds)}return Y.ZonedDateTime.compare(e,n)<0?!0:this.opts.until&&Y.ZonedDateTime.compare(e,this.opts.until)>0?!1:i&&!i(e)||r&&this.isExcluded(e)?!0:r&&!r(e,t.length)?!1:(t.push(e),!this.shouldBreakForCountLimit(t.length))}_allMonthlyByDayOrMonthDay(e,t){let n=[],r=this.createCandidateWorkBudget(),i=0,a=this.originalDtstart;if(!this.addDtstartIfNeeded(n,e))return this.applyCountLimitAndMergeRDates(n,e);let o=a.toPlainDate().with({day:1});for(;;){if(++i>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);let s=t=>this.processOccurrence(t,n,a,e,void 0,r);if(!(this.visitUtcPeriodCandidates(o,s,t??a,this.opts.until,r)??this.visitPeriodCandidates(this.generateMonthlyDateCandidates(o),s,t??a,this.opts.until,r)))break;try{o=o.add({months:this.opts.interval})}catch{break}if(this.opts.until){let e=this.opts.until.withTimeZone(a.timeZoneId).withCalendar(a.calendarId);if(o.year*12+o.month>e.year*12+e.month)break}}return this.applyCountLimitAndMergeRDates(n,e)}_allWeekly(e,t){let n=[],r=this.createCandidateWorkBudget(),i=0,a=this.originalDtstart;if(!this.addDtstartIfNeeded(n,e))return this.applyCountLimitAndMergeRDates(n,e);let o=X,s=this.opts.byDay?[...this.allByDayIsoDays??[]]:this.opts.byMonthDay&&this.opts.byMonthDay.length>0?[...Object.values(o)]:[a.dayOfWeek],c=o[qd(this.opts.wkst||`MO`)??`MO`]??1,l=(a.dayOfWeek-c+7)%7,u=a.toPlainDate().subtract({days:l});for(;;){if(++i>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);let o=s.map(e=>{let t=(e-c+7)%7;return u.add({days:t})}).filter(e=>this.matchesByMonth(e)&&this.matchesByMonthDay(e));if(!this.visitPeriodCandidates(o,t=>this.processOccurrence(t,n,a,e,void 0,r),t??a,this.opts.until,r))break;try{u=u.add({weeks:this.opts.interval})}catch{break}if(this.opts.until){let e=this.opts.until.withTimeZone(a.timeZoneId).withCalendar(a.calendarId);if(Y.PlainDate.compare(u,e.toPlainDate())>0)break}}return this.applyCountLimitAndMergeRDates(n,e)}_allYearlyComplex(e,t){let n=[],r=this.createCandidateWorkBudget(),i=0,a=this.originalDtstart;if(!this.addDtstartIfNeeded(n,e)||this.opts.until&&Y.ZonedDateTime.compare(this.opts.until,a)<0)return this.applyCountLimitAndMergeRDates(n,e);let o=a.toPlainDate().with({month:1,day:1}),s=this.opts.until?this.opts.until.withTimeZone(a.timeZoneId).withCalendar(a.calendarId).year+(this.opts.byWeekNo?1:0):void 0;for(;;){if(++i>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);let c=t=>this.processOccurrence(t,n,a,e,void 0,r);if(!(this.visitUtcPeriodCandidates(o,c,t??a,this.opts.until,r)??this.visitPeriodCandidates(this.generateYearlyDateCandidates(o),c,t??a,this.opts.until,r)))break;let l=this.opts.freq===`WEEKLY`?1:this.opts.interval;try{o=o.add({years:l})}catch{break}if(s!==void 0&&o.year>s)break}return this.applyCountLimitAndMergeRDates(n,e)}_allMinutelySecondlyComplex(e){let t=[],n=0;if(!this.addDtstartIfNeeded(t,e))return this.applyCountLimitAndMergeRDates(t,e);let r=this.computeFirst();for(;;){if(++n>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);if(this.opts.until&&Y.ZonedDateTime.compare(r,this.opts.until)>0)break;if(this.matchesAll(r)){if(e&&this.isExcluded(r)){r=this.nextCandidateSameDate(r);continue}if(e&&!e(r,t.length)||(t.push(r),this.shouldBreakForCountLimit(t.length)))break;r=this.nextCandidateSameDate(r)}else r=this.findNextValidDate(r)}return this.applyCountLimitAndMergeRDates(t,e)}_allMonthlyByWeekNo(e,t){let n=[],r=this.createCandidateWorkBudget(),i=0,a=this.originalDtstart;if(!this.addDtstartIfNeeded(n,e))return this.applyCountLimitAndMergeRDates(n,e);let o=a,s=[...this.opts.byWeekNo].sort((e,t)=>e-t),c=this.opts.interval,l=this.opts.until?this.opts.until.withTimeZone(a.timeZoneId).withCalendar(a.calendarId).year+1:void 0,u=0,d=-1;outer_loop:for(;!this.shouldBreakForCountLimit(n.length);){if(++i>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);let f=o.year;if(f!==d&&o.month>=a.month){d=f;let i=s.flatMap(e=>this.generateDateCandidatesForWeekInYear(f,e));if(!this.visitDateTimeCandidates(i,1,t=>this.processOccurrence(t,n,a,e,void 0,r),t??a,this.opts.until,r))break outer_loop}if(u+=c,o=a.add({months:u}),l!==void 0&&o.year>l)break}return this.applyCountLimitAndMergeRDates(n,e)}_allMonthlyByYearDay(e,t){let n=[],r=this.createCandidateWorkBudget(),i=0,a=this.originalDtstart;if(!this.addDtstartIfNeeded(n,e))return this.applyCountLimitAndMergeRDates(n,e);let o=a.year,s=[...this.opts.byYearDay].sort((e,t)=>e-t),c=this.opts.interval,l=a.year*12+a.month;outer_loop:for(;!this.shouldBreakForCountLimit(n.length);){if(++i>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);let u=a.toPlainDate().with({year:o,month:1,day:1}),d=u.with({month:12,day:31}).dayOfYear,f=[];for(let e of s){let t=e>0?e:d+e+1;t<=0||t>d||f.push(u.add({days:t-1}))}if(!this.visitDateTimeCandidates(f,1,t=>(t.year*12+t.month-l)%c!==0||!this.matchesByMonth(t)?!0:this.processOccurrence(t,n,a,e,void 0,r),t??a,this.opts.until,r))break outer_loop;if(o++,this.opts.until&&o>this.opts.until.year+2)break;if(!this.opts.until&&this.opts.count){let e=Math.ceil(this.opts.count/(this.opts.byYearDay.length||1))*c+5;if(o>a.year+e)break}}return this.applyCountLimitAndMergeRDates(n,e)}_allDailyMinutelyHourlyWithBySetPos(e){let t=[],n=0,r=this.originalDtstart;if(!this.addDtstartIfNeeded(t,e))return this.applyCountLimitAndMergeRDates(t,e);let i,a;switch(this.opts.freq){case`MINUTELY`:i=r.with({second:0,microsecond:0,nanosecond:0}),a={minutes:this.opts.interval};break;case`HOURLY`:i=r.with({minute:0,second:0,microsecond:0,nanosecond:0}),a={hours:this.opts.interval};break;case`DAILY`:i=r.with({hour:0,minute:0,second:0,microsecond:0,nanosecond:0}),a={days:this.opts.interval};break;default:return this.applyCountLimitAndMergeRDates(t,e)}for(;;){if(++n>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);let o=this.expandByTime(i);o=o.filter(e=>this.matchesAll(e)),o=this.applyBySetPos(o);let{shouldBreak:s}=this.processOccurrences(o,t,r,e);if(s||(i=i.add(a),this.opts.until&&Y.ZonedDateTime.compare(i,this.opts.until)>0))break}return this.applyCountLimitAndMergeRDates(t,e)}_allFallback(e){let t=[],n=0,r=this.computeFirst();if(this.includeDtstart&&Y.ZonedDateTime.compare(r,this.originalDtstart)>0&&!(e&&this.isExcluded(this.originalDtstart))&&(e&&!e(this.originalDtstart,t.length)||(t.push(this.originalDtstart),this.shouldBreakForCountLimit(t.length))))return this.applyCountLimitAndMergeRDates(t,e);for(;;){if(++n>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);if(this.opts.until&&Y.ZonedDateTime.compare(r,this.opts.until)>0||this.matchesAll(r)&&!(e&&this.isExcluded(r))&&(e&&!e(r,t.length)||(t.push(r),this.shouldBreakForCountLimit(t.length))))break;r=this.nextCandidateSameDate(r)}return this.applyCountLimitAndMergeRDates(t,e)}_allSubDailyPeriods(e){let t=[],n=this.createCandidateWorkBudget(),r=this.originalDtstart;if(!this.addDtstartIfNeeded(t,e))return this.applyCountLimitAndMergeRDates(t,e);let{freq:i,byHour:a,byMinute:o,bySecond:s,bySetPos:c}=this.opts,l=r.timeZoneId,u=r.calendarId,d=gd(l),f=i===`HOURLY`?jd:i===`MINUTELY`?Ad:kd,p=f*BigInt(this.opts.interval),m=r.epochNanoseconds,h=this.opts.until?.epochNanoseconds,g=i===`HOURLY`&&this.opts.interval===1,_=i===`HOURLY`?void 0:o,v=i===`SECONDLY`?s:void 0,ee=i===`HOURLY`?o:void 0,te=i===`SECONDLY`?void 0:s,ne=BigInt(r.millisecond*1e6+r.microsecond*1e3+r.nanosecond),re=e=>Number(zd(e,Q)),ie=(e,t)=>{let n=d.nextTransitionAfter(re(e),Number(Bd(t,Q)));if(n===void 0)return;let r=BigInt(n)*Q;return r>e&&r<=t?r:void 0},y,b=e=>{if(sd||l===`UTC`)return new Y.ZonedDateTime(e,l,u);y??=new Y.ZonedDateTime(e,l,u);let t=e-y.epochNanoseconds,n=zd(t,Q);return y.add({milliseconds:Number(n),nanoseconds:Number(t-n*Q)})},x=e=>e.toZonedDateTime(l).epochNanoseconds,ae=(e,t)=>ie(e,e+t-1n)??e+t,oe,S,se=!1,ce=0n,le=0;for(;;){if(++le>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);let i=m+ce*p;if(h!==void 0&&i-2n*f>h)break;let o=re(i),s=o+d.offsetMsAt(o),l=Math.floor(s/Z),y=s-l*Z,ue=Math.floor(y/Td),de=Math.floor(y/wd)%60,fe=Math.floor(y/Cd)%60;if(g&&ce>0n){let e=i-jd;if(ie(e,i)!==void 0){let t=re(e),n=t+d.offsetMsAt(t);if(Math.floor(n/Td)===Math.floor(s/Td)){ce+=1n;continue}}}if(l!==oe){let{year:e,month:t}=Gd(l);oe=l,S=new Y.PlainDate(e,t,l-Wd(e,t,1)+1,u),se=this.matchesSubDailyDate(S)}let C;if(!se)C=x(this.nextSubDailyDateCandidate(S));else if(a&&!a.includes(ue)){let e=a.find(e=>e>ue)??24,t=BigInt((de*60+fe)*1e3)*Q+ne;C=ae(i,BigInt(e-ue)*jd-t)}else if(_&&!_.includes(de)){let e=_.find(e=>e>de)??60,t=BigInt(fe*1e3)*Q+ne;C=ae(i,BigInt(e-de)*Ad-t)}else if(v&&!v.includes(fe)){let e=v.find(e=>e>fe)??60;C=ae(i,BigInt(e-fe)*kd-ne)}if(C!==void 0){if(h!==void 0&&C>h)break;let e=C-m,t=e<=0n?0n:Bd(e,p);ce=t>ce?t:ce+1n;continue}let pe=[],me;for(let e of ee??[de])for(let t of te??[fe]){this.recordCandidateEvaluation(n);let r=BigInt((e-de)*60+(t-fe))*kd,a=i+r;if(r===0n||ie(r<0n?a:i,r<0n?i:a)===void 0){pe.push(a);continue}me??=b(i);let o=me.with({minute:e,second:t});o.hour===ue&&o.minute===e&&o.second===t&&pe.push(o.epochNanoseconds)}pe.sort((e,t)=>e<t?-1:e>t?1:0);let w=c?.length?this.applyBySetPosToSortedList(pe).sort((e,t)=>e<t?-1:e>t?1:0):pe;for(let i=0;i<w.length;i++){let a=w[i];if(!(a<m||i>0&&a===w[i-1])&&!this.processOccurrence(b(a),t,r,e,void 0,n))return this.applyCountLimitAndMergeRDates(t,e)}ce+=1n}return this.applyCountLimitAndMergeRDates(t,e)}matchesSubDailyDate(e){return this.matchesByMonth(e)&&this.matchesByWeekNo(e)&&this.matchesByYearDay(e)&&this.matchesByMonthDay(e)&&this.matchesByDay(e)}nextSubDailyDateCandidate(e){let t=this.numericByMonths;if(t?.length&&!t.includes(e.month)){let n=[...t].sort((e,t)=>e-t),r=n.find(t=>t>e.month);return r===void 0?e.with({month:1,day:1}).add({years:1}).with({month:n[0]}):e.with({month:r,day:1})}if(!this.matchesByWeekNo(e))return e.add({days:8-e.dayOfWeek});if(!this.matchesByYearDay(e)){let t=e.daysInYear,n=this.lastByYearDay(e),r=this.opts.byYearDay.map(e=>e>0?e:n+e+1).filter(n=>n>e.dayOfYear&&n<=t);return r.length?e.add({days:Math.min(...r)-e.dayOfYear}):e.with({month:1,day:1}).add({years:1})}if(!this.matchesByMonthDay(e)){let t=e.daysInMonth,n=this.opts.byMonthDay.map(e=>e>0?e:t+e+1).filter(n=>n>e.day&&n<=t);return n.length?e.with({day:Math.min(...n)}):e.with({day:1}).add({months:1})}if(!this.hasOrdinalByDay&&this.simpleByDayIsoDays?.length){let t=this.simpleByDayIsoDays.map(t=>(t-e.dayOfWeek+6)%7+1);return e.add({days:Math.min(...t)})}return e.add({days:1})}_allCalendarPeriods(e,t){let n=[],r=this.createCandidateWorkBudget(),i=this.originalDtstart,{freq:a,interval:o=1}=this.opts,s=i.toPlainDate(),c=this.opts.until?.withTimeZone(i.timeZoneId).withCalendar(i.calendarId).toPlainDate(),l=a===`DAILY`?s:s.with({day:1});a===`YEARLY`&&(l=l.with({month:1}));let u=a===`YEARLY`?{years:o}:a===`MONTHLY`?{months:o}:{days:o};if(!this.addDtstartIfNeeded(n,e))return this.applyCountLimitAndMergeRDates(n,e);if(a===`DAILY`&&this.simpleByDayIsoDays?.length){let t=this.findFirstMatchingDailyStep(l.dayOfWeek,o,this.simpleByDayIsoDays);if(t===null)return this.applyCountLimitAndMergeRDates(n,e);l=l.add({days:t*o})}for(let o=0;!(c&&Y.PlainDate.compare(l,c)>0);o++){if(o>=this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);let s=[];if(a===`DAILY`)this.matchesByMonth(l)&&this.matchesByMonthDay(l)&&this.matchesByDay(l)&&this.matchesByYearDay(l)&&this.matchesByWeekNo(l)&&s.push(l);else{let e=a===`YEARLY`?this.opts.byMonth??[i.monthCode]:[l.month];for(let t of e){if(a===`MONTHLY`&&!this.matchesByMonth(l))continue;let e;try{e=l.with(typeof t==`number`?{month:t}:{monthCode:t},{overflow:`reject`})}catch{continue}let n=this.applySkipForDay(i.calendarId,l.year,e,i.day);n&&s.push(n)}}if(!this.visitPeriodCandidates(s,t=>this.processOccurrence(t,n,i,e,void 0,r),t??i,this.opts.until,r))break;l=l.add(u)}return this.applyCountLimitAndMergeRDates(n,e)}all(e){if(e){let t=[];return this.allInternal((n,r)=>{let i=this.toPublicDate(n);return e(i,r)?(t.push(i),!0):!1}),t}return!e&&this.opts.cache!==!1?(this.allResultCache||=this.allInternal(),this.publicAllResultCache||=this.toPublicDates(this.allResultCache),this.publicAllResultCache.slice()):this.toPublicDates(this.allInternal())}allInternal(e,t){if(this.opts.count===void 0&&!this.opts.until&&!e)throw Error(`all() requires iterator when no COUNT/UNTIL`);if(e&&(this.opts.rDate||this.opts.exDate))return this.iterateRecurrenceSet(e);if(this.opts.count===0)return this.applyCountLimitAndMergeRDates([],e);if(this.opts.until&&Y.ZonedDateTime.compare(this.opts.until,this.originalDtstart)<0){let t=[];return this.addDtstartIfNeeded(t,e),this.applyCountLimitAndMergeRDates(t,e)}if(this.opts.rscale&&[`CHINESE`,`HEBREW`,`INDIAN`].includes(this.opts.rscale)&&([`YEARLY`,`MONTHLY`,`WEEKLY`].includes(this.opts.freq)||this.opts.byYearDay||this.opts.byWeekNo||this.opts.byMonthDay&&this.opts.byMonthDay.length>0))return this._allRscaleNonGregorian(e,t);if(this.opts.byWeekNo&&this.opts.byYearDay&&!this.hasPossibleYearDayWeekNoCombination()){let t=[];return this.addDtstartIfNeeded(t,e),this.applyCountLimitAndMergeRDates(t,e)}let n=this.allUtcFastPath(e);if(n)return this.opts.rDate||this.opts.exDate?this.applyCountLimitAndMergeRDates(n):n;let r=this.allTzEpochFastPath(e);return r?this.opts.rDate||this.opts.exDate?this.applyCountLimitAndMergeRDates(r):r:this.opts.freq===`DAILY`||[`MONTHLY`,`YEARLY`].includes(this.opts.freq)&&!this.opts.byDay&&!this.opts.byMonthDay&&!this.opts.byYearDay&&!this.opts.byWeekNo?this._allCalendarPeriods(e,t):this.opts.freq===`MONTHLY`&&(this.opts.byDay||this.opts.byMonthDay)&&!this.opts.byWeekNo?this._allMonthlyByDayOrMonthDay(e,t):this.opts.freq===`WEEKLY`&&!(this.opts.byYearDay&&this.opts.byYearDay.length>0)&&!(this.opts.byWeekNo&&this.opts.byWeekNo.length>0)?this._allWeekly(e,t):this.opts.freq===`YEARLY`&&(this.opts.byDay||this.opts.byMonthDay||this.opts.byYearDay||this.opts.byWeekNo)||this.opts.freq===`WEEKLY`&&this.opts.byYearDay&&this.opts.byYearDay.length>0||this.opts.freq===`WEEKLY`&&this.opts.byWeekNo&&this.opts.byWeekNo.length>0?this._allYearlyComplex(e,t):[`HOURLY`,`MINUTELY`,`SECONDLY`].includes(this.opts.freq)&&!this.opts.rscale&&(this.opts.byMonth||this.opts.byWeekNo||this.opts.byYearDay||this.opts.byMonthDay||this.opts.byDay||this.opts.byHour||this.opts.byMinute||this.opts.bySecond||this.opts.bySetPos)?this._allSubDailyPeriods(e):(this.opts.freq===`MINUTELY`||this.opts.freq===`SECONDLY`)&&(this.opts.byMonth||this.opts.byWeekNo||this.opts.byYearDay||this.opts.byMonthDay||this.opts.byDay)?this._allMinutelySecondlyComplex(e):this.opts.freq===`MONTHLY`&&this.opts.byWeekNo&&this.opts.byWeekNo.length>0?this._allMonthlyByWeekNo(e,t):this.opts.freq===`MONTHLY`&&this.opts.byYearDay&&this.opts.byYearDay.length>0&&!this.opts.byDay&&!this.opts.byMonthDay?this._allMonthlyByYearDay(e,t):(this.opts.freq===`MINUTELY`||this.opts.freq===`HOURLY`)&&this.opts.bySetPos?this._allDailyMinutelyHourlyWithBySetPos(e):this._allFallback(e)}mergeAndDeduplicateRDates(e){this.opts.rDate&&e.push(...this.opts.rDate);let t=e.map(e=>e.epochNanoseconds),n=!0;for(let e=1;e<t.length;e++)if(t[e-1]>t[e]){n=!1;break}n||(e=e.map((e,t)=>t).sort((e,n)=>t[e]<t[n]?-1:t[e]>t[n]?1:0).map(t=>e[t]),t.sort((e,t)=>e<t?-1:e>t?1:0));let r=[];for(let n=0;n<e.length;n++)(n===0||t[n]!==t[n-1])&&r.push(e[n]);return r}isExcluded(e){return this.isExcludedEpoch(e.epochNanoseconds)}isExcludedEpoch(e){return!this.opts.exDate||this.opts.exDate.length===0?!1:(this.exDateEpochNs===void 0&&(this.exDateEpochNs=new Set(this.opts.exDate.map(e=>e.epochNanoseconds))),this.exDateEpochNs.has(e))}getNumericRDates(){if(this.numericRDatesCache)return this.numericRDatesCache;let e=[...this.opts.rDate??[]].sort((e,t)=>e.epochNanoseconds<t.epochNanoseconds?-1:e.epochNanoseconds>t.epochNanoseconds?1:0),t=[],n;for(let r of e)r.epochNanoseconds!==n&&(n=r.epochNanoseconds,this.isExcludedEpoch(n)||t.push(r));return this.numericRDatesCache=t}numericRDateLowerBound(e,t){let n=this.getNumericRDates(),r=0,i=n.length;for(;r<i;){let a=r+Math.floor((i-r)/2),o=n[a].epochNanoseconds;(t?o>e:o>=e)?i=a:r=a+1}return r}excludeExDates(e){return!this.opts.exDate||this.opts.exDate.length===0?e:e.filter(e=>!this.isExcluded(e))}applyCountLimitAndMergeRDates(e,t){let n=this.opts.count===void 0?e:e.slice(0,Math.max(this.opts.count,0)),r=this.mergeAndDeduplicateRDates(n),i=this.excludeExDates(r);return!t||!this.opts.rDate&&!this.opts.exDate?i:this.applyIterator(i,t)}iterateRecurrenceSet(t){let n=[],r=[...this.opts.rDate??[]].sort((e,t)=>Y.ZonedDateTime.compare(e,t)),i=0,a,o=!1,s=e=>{let r=e.epochNanoseconds;return a===r||(a=r,this.isExcluded(e))?!0:t(e,n.length)?(n.push(e),!0):(o=!0,!1)},c=e=>{for(;i<r.length&&r[i].epochNanoseconds<e;)if(!s(r[i++]))return!1;return!0},l=e=>{if(!c(e.epochNanoseconds)||!s(e))return!1;for(;i<r.length&&r[i].epochNanoseconds===e.epochNanoseconds;)i++;return!0};for((this.opts.count===void 0||this.opts.count>0)&&new e({...this.cloneOptions(),rDate:void 0,exDate:void 0,cache:!1}).allInternal(l);!o&&i<r.length&&s(r[i++]););return n}applyIterator(e,t){let n=[];for(let r of e){if(!t(r,n.length))break;n.push(r)}return n}shouldBreakForCountLimit(e){return this.opts.count===void 0?!1:e>=this.opts.count}hasTimeOfDayBetween(e,t){if(Y.PlainTime.compare(e,t)>=0)return!1;let n=this.originalDtstart,r=this.opts.byHour??[n.hour],i=this.opts.byMinute??[n.minute],a=this.opts.bySecond??[n.second];for(let o of r)for(let r of i)for(let i of a){let a=Y.PlainTime.from({hour:o,minute:r,second:i,millisecond:n.millisecond,microsecond:n.microsecond,nanosecond:n.nanosecond});if(Y.PlainTime.compare(a,e)>=0&&Y.PlainTime.compare(a,t)<0)return!0}return!1}assertNumericCandidateReachable(e){if(e&&e.periodIndex>=this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`)}numericExhaustionCandidate(e){return e.count<e.maximumCount?e.select(e.count):e.count>0?e.select(e.count-1):null}tryNumericNext(e,t){let n=this.getNumericQueryPlan();if(!n)return{handled:!1};let r=n.lowerBound(e,!t);if(!this.opts.rDate&&!this.opts.exDate){if(r>=n.count)return this.assertNumericCandidateReachable(this.numericExhaustionCandidate(n)),{handled:!0,value:null};let e=n.select(r);return e?(this.assertNumericCandidateReachable(e),{handled:!0,value:this.zdtFromEpochMs(e.epochMilliseconds)}):{handled:!1}}let i=this.getNumericRDates()[this.numericRDateLowerBound(e,!t)];for(;r<n.count;){let e=n.select(r);if(!e)return{handled:!1};let t=BigInt(e.epochMilliseconds)*Q;if(this.assertNumericCandidateReachable(e),i&&i.epochNanoseconds<t)return{handled:!0,value:i};if(!this.isExcludedEpoch(t))return{handled:!0,value:this.zdtFromEpochMs(e.epochMilliseconds)};r+=1}let a=this.numericExhaustionCandidate(n);return this.assertNumericCandidateReachable(a),{handled:!0,value:i??null}}tryNumericPrevious(e,t){let n=this.getNumericQueryPlan();if(!n)return{handled:!1};let r=n.lowerBound(e,t),i=r<n.count?n.select(r):this.numericExhaustionCandidate(n);this.assertNumericCandidateReachable(i);let a=r-1;if(!this.opts.rDate&&!this.opts.exDate){if(a<0)return{handled:!0,value:null};let e=n.select(a);return e?{handled:!0,value:this.zdtFromEpochMs(e.epochMilliseconds)}:{handled:!1}}let o=null;for(;a>=0;){let e=n.select(a);if(!e)return{handled:!1};if(!this.isExcludedEpoch(BigInt(e.epochMilliseconds)*Q)){o=e;break}--a}let s=this.getNumericRDates(),c=this.numericRDateLowerBound(e,t)-1,l=c>=0?s[c]:null;return!o||l&&l.epochNanoseconds>BigInt(o.epochMilliseconds)*Q?{handled:!0,value:l}:{handled:!0,value:this.zdtFromEpochMs(o.epochMilliseconds)}}tryNumericBetween(e,t,n){if(e>t)return{handled:!1};let r=this.getNumericQueryPlan();if(!r)return{handled:!1};let i=r.lowerBound(e,!n),a=r.lowerBound(t,n),o=r.lowerBound(t,!0),s=o<r.count?r.select(o):this.numericExhaustionCandidate(r);if(this.assertNumericCandidateReachable(s),i>=a&&!this.opts.rDate)return{handled:!0,value:[]};if(!this.opts.rDate&&!this.opts.exDate){let e=Array(a-i);for(let t=i;t<a;t++){let n=r.select(t);if(!n)return{handled:!1};e[t-i]=this.zdtFromEpochMs(n.epochMilliseconds)}return{handled:!0,value:e}}let c=[];for(let e=i;e<a;e++){let t=r.select(e);if(!t)return{handled:!1};let n=BigInt(t.epochMilliseconds)*Q;this.isExcludedEpoch(n)||c.push(this.zdtFromEpochMs(t.epochMilliseconds))}let l=this.getNumericRDates(),u=this.numericRDateLowerBound(e,!n),d=this.numericRDateLowerBound(t,n),f=[],p=0,m=u;for(;p<c.length||m<d;){let e=c[p],t=l[m];!t||e&&e.epochNanoseconds<=t.epochNanoseconds?(f.push(e),p+=1,t&&t.epochNanoseconds===e.epochNanoseconds&&(m+=1)):(f.push(t),m+=1)}return{handled:!0,value:f}}periodScanBudget(e,t,n){let r=Math.floor((this.maxIterations-16)/t),i=Math.floor(this.maxCandidateEvaluations/(e.candidatesPerPeriod*t))-16;return Math.min(n,r,i)}resolvePeriodEpochs(e,t){if(e.rankedPeriodWallSpan&&this.tzid!==`UTC`){let n=e.rankedPeriodWallSpan(t);if(!n)return null;let r=this.getZoneResolver();if(this.timeSlotOffsetsMs.some(e=>r.timeOfDayMayHitGap(e,n[0]-Z,n[1]+Z)))return null}let n=e.wallsForPeriod(t);if(!n)return null;let r=Array(n.length);for(let e=0;e<n.length;e++){let t=this.resolveNumericWallMilliseconds(n[e]);if(t===null)return null;r[e]=t}return r}isExcludedEpochMilliseconds(e){return!!this.opts.exDate?.length&&this.isExcludedEpoch(BigInt(e)*Q)}periodScanForward(e,t,n,r=1){let i=this.originalDtstart.epochMilliseconds,a=this.opts.until?.epochMilliseconds,o=Math.max(t,i);if(a!==void 0&&o>a)return null;let s=this.periodScanBudget(e,r,Fd),c=e=>a!==void 0&&e>a?null:n!==void 0&&e>n?e:this.isExcludedEpochMilliseconds(e)?void 0:e,l=e.stepMilliseconds;if(l!==void 0){let e=i+Math.ceil((o-i)/l)*l;e<o?e+=l:e-l>=o&&(e-=l);for(let t=0;t<s;t++,e+=l){if(!Ud(e))return;let t=c(e);if(t!==void 0)return t}return}let u=Math.max(0,e.periodOfWall(this.tzid===`UTC`?o:o-Z));for(let t=0;t<s;t++,u++){let t=this.resolvePeriodEpochs(e,u);if(!t)return;for(let e of t){if(e<o)continue;let t=c(e);if(t!==void 0)return t}}}periodScanBackward(e,t,n){let r=this.originalDtstart.epochMilliseconds,i=this.opts.until?.epochMilliseconds,a=i===void 0?t:Math.min(t,i);if(a<r)return null;let o=this.periodScanBudget(e,8,Fd),s=e=>e<r?null:n!==void 0&&e<n?e:this.isExcludedEpochMilliseconds(e)?void 0:e,c=e.stepMilliseconds;if(c!==void 0){let e=r+Math.floor((a-r)/c)*c;e>a?e-=c:e+c<=a&&(e+=c);for(let t=0;t<o;t++,e-=c){let t=s(e);if(t!==void 0)return t}return}let l=e.periodOfWall(this.tzid===`UTC`?a:a+Z);for(let t=0;t<o;t++,l--){if(l<0)return null;let t=this.resolvePeriodEpochs(e,l);if(!t)return;for(let e=t.length-1;e>=0;e--){let n=t[e];if(n>a)continue;let r=s(n);if(r!==void 0)return r}}}periodEpochsBetween(e,t,n){let r=this.originalDtstart.epochMilliseconds,i=this.opts.until?.epochMilliseconds,a=Math.max(t,r),o=i===void 0?n:Math.min(n,i),s=[];if(a>o)return s;let c=this.periodScanBudget(e,1,1/0),l=e.stepMilliseconds;if(l!==void 0){let e=r+Math.ceil((a-r)/l)*l;if(e<a?e+=l:e-l>=a&&(e-=l),(o-e)/l>=c)return null;for(let t=e;t<=o;t+=l){if(!Ud(t))return null;this.isExcludedEpochMilliseconds(t)||s.push(t)}return s}let u=this.tzid===`UTC`,d=Math.max(0,e.periodOfWall(u?a:a-Z)),f=e.periodOfWall(u?o:o+Z);if(f-d>=c)return null;for(let t=d;t<=f;t++){let n=this.resolvePeriodEpochs(e,t);if(!n)return null;for(let e of n)e<a||e>o||this.isExcludedEpochMilliseconds(e)||s.push(e)}return s}tryPeriodNext(e,t){let n=this.getPeriodQueryPlan();if(!n)return{handled:!1};let r=this.opts.rDate?this.getNumericRDates()[this.numericRDateLowerBound(e,!t)]:void 0,i=this.periodScanForward(n,Vd(e,!t),r?Hd(r.epochNanoseconds,!1):void 0);return i===void 0?{handled:!1}:r&&(i===null||BigInt(i)*Q>r.epochNanoseconds)?{handled:!0,value:r}:{handled:!0,value:i===null?null:this.zdtFromEpochMs(i)}}tryPeriodPrevious(e,t){let n=this.getPeriodQueryPlan();if(!n)return{handled:!1};let r=this.opts.rDate?this.numericRDateLowerBound(e,t)-1:-1,i=r>=0?this.getNumericRDates()[r]:null,a=this.periodScanBackward(n,Hd(e,!t),i?Vd(i.epochNanoseconds,!1):void 0);return a===void 0||this.periodScanForward(n,Vd(e,t),void 0,2)===void 0?{handled:!1}:i&&(a===null||BigInt(a)*Q<i.epochNanoseconds)?{handled:!0,value:i}:{handled:!0,value:a===null?null:this.zdtFromEpochMs(a)}}tryPeriodBetween(e,t,n){if(e>t)return{handled:!1};let r=this.getPeriodQueryPlan();if(!r)return{handled:!1};let i=this.periodEpochsBetween(r,Vd(e,!n),Hd(t,!n));if(!i)return{handled:!1};let a=i.map(e=>this.zdtFromEpochMs(e));if(!this.opts.rDate)return{handled:!0,value:a};let o=this.getNumericRDates(),s=this.numericRDateLowerBound(t,n),c=[],l=0,u=this.numericRDateLowerBound(e,!n);for(;l<a.length||u<s;){let e=a[l],t=u<s?o[u]:void 0;!t||e&&e.epochNanoseconds<=t.epochNanoseconds?(c.push(e),l+=1,t&&t.epochNanoseconds===e.epochNanoseconds&&(u+=1)):(c.push(t),u+=1)}return{handled:!0,value:c}}between(t,n,r=!1){let i=Qd(t,`after`),a=Qd(n,`before`),o=this.tryNumericBetween(i,a,r);if(o.handled)return this.toPublicDates(o.value);let s=this.tryPeriodBetween(i,a,r);if(s.handled)return this.toPublicDates(s.value);let c=new Y.ZonedDateTime(i,this.tzid,this.originalDtstart.calendarId),l=new Y.ZonedDateTime(a,this.tzid,this.originalDtstart.calendarId),u={...this.opts};(!u.until||Y.ZonedDateTime.compare(l,u.until)<0)&&(u.until=l),u.count===void 0&&Object.assign(u,this.alignedQueryStart(c));let d=new e({...u,strict:u.count===void 0?u.strict:!1,temporal:this.outputTemporal}).allInternal(void 0,u.count===void 0?c:void 0);return this.toPublicDates(d.filter(e=>{let t=r?e.epochNanoseconds>=i:e.epochNanoseconds>i,n=r?e.epochNanoseconds<=a:e.epochNanoseconds<a;return t&&n}))}jumpAlignedDtstart(t){if(t=t.withTimeZone(this.originalDtstart.timeZoneId).withCalendar(this.originalDtstart.calendarId),t.epochNanoseconds<=this.originalDtstart.epochNanoseconds||this.opts.rscale||this.originalDtstart.timeZoneId!==this.tzid||this.opts.freq===`MONTHLY`&&this.opts.byWeekNo||[`MONTHLY`,`YEARLY`].includes(this.opts.freq)&&![`iso8601`,`gregory`].includes(this.originalDtstart.calendarId))return this.originalDtstart;let n=this.opts.interval??1,r=t.withPlainTime(this.originalDtstart.toPlainTime()),i;switch(this.opts.freq){case`YEARLY`:i=`years`;break;case`MONTHLY`:i=`months`;break;case`WEEKLY`:i=`weeks`;break;case`DAILY`:i=`days`;break;case`HOURLY`:i=`hours`;break;case`MINUTELY`:i=`minutes`;break;default:i=`seconds`}let a=e.normalizeToPolyfill(this.opts.dtstart),o=e.normalizeToPolyfill(t).withTimeZone(a.timeZoneId),s=e.normalizeToPolyfill(r.withPlainTime(this.originalDtstart.toPlainTime())).withTimeZone(a.timeZoneId),c=[`hours`,`minutes`,`seconds`].includes(i)?o:s,l=a.until(c,{largestUnit:i})[i],u=Math.floor(l/n),d=e=>{switch(i){case`years`:return{years:e};case`months`:return{months:e};case`weeks`:return{weeks:e};case`days`:return{days:e};case`hours`:return{hours:e};case`minutes`:return{minutes:e};default:return{seconds:e}}},f=[`years`,`months`,`weeks`,`days`].includes(i),p=()=>{for(;u>0;){if(!f)return a.add(d(u*n));try{let e=this.originalDtstart.toPlainDateTime().add(d(u*n),{overflow:`reject`}),t=this.resolveGeneratedTime(e);if(t)return t}catch{}--u}return this.originalDtstart},m=p();this.opts.freq===`HOURLY`&&n===1&&u>0&&m.subtract({hours:1}).hour===m.hour&&(--u,m=p()),u>0&&[`years`,`months`,`weeks`,`days`].includes(i)&&m.toPlainDate().equals(o.toPlainDate())&&Y.ZonedDateTime.compare(m,o)>0&&this.hasTimeOfDayBetween(o.toPlainTime(),m.toPlainTime())&&(--u,m=p());let h=e.normalizeToPolyfill(this.opts.dtstart);return Y.ZonedDateTime.compare(m,h)<0&&(m=h),m}matches(e){let t=Qd(e,`date`);return this.nextInternal(t,!0)?.epochNanoseconds===t}occursOn(e){let t=Y.PlainDate.from(e.toString()),n=t.toZonedDateTime({timeZone:this.tzid,plainTime:Y.PlainTime.from(`00:00`)});if(!n.toPlainDate().equals(t))return!1;let r=t.add({days:1}).toZonedDateTime({timeZone:this.tzid,plainTime:Y.PlainTime.from(`00:00`)}),i=this.nextInternal(n.epochNanoseconds,!0);return i!==null&&i.epochNanoseconds<r.epochNanoseconds}nextInternal(e,t){let n=this.tryNumericNext(e,t);if(n.handled)return n.value;let r=this.tryPeriodNext(e,t);if(r.handled)return r.value;let i=null,a=n=>{n.allInternal(n=>(t?n.epochNanoseconds>=e:n.epochNanoseconds>e)?((!i||n.epochNanoseconds<i.epochNanoseconds)&&(i=n),!1):!0)};return this.opts.count===void 0?a(this.ruleFromAlignedDtstart(new Y.ZonedDateTime(e,this.tzid))):a(this),i}next(e=new Date,t=!1){return this.toPublicDate(this.nextInternal(Qd(e,`after`),t))}alignedQueryStart(e){let t=this.jumpAlignedDtstart(e);return{dtstart:t,includeDtstart:this.includeDtstart&&t.epochNanoseconds===this.originalDtstart.epochNanoseconds}}ruleFromAlignedDtstart(t){let n=this.alignedQueryStart(t);return n.dtstart.epochNanoseconds===this.originalDtstart.epochNanoseconds?this:new e({...this.opts,temporal:this.outputTemporal,...n})}previous(e=new Date,t=!1){let n=Qd(e,`before`),r=this.tryNumericPrevious(n,t);if(r.handled)return this.toPublicDate(r.value);let i=this.tryPeriodPrevious(n,t);if(i.handled)return this.toPublicDate(i.value);let a=null;if(this.opts.rDate?.length){let e=this.numericRDateLowerBound(n,t)-1;a=e>=0?this.getNumericRDates()[e]:null}let o=this.previousFromRule(n,t,a?.epochNanoseconds);return!o||a&&a.epochNanoseconds>o.epochNanoseconds?this.toPublicDate(a):this.toPublicDate(o)}previousFromRule(t,n,r){let i=this.opts.rDate&&this.opts.rDate.length>0?new e({...this.opts,temporal:this.outputTemporal,rDate:void 0}):this,a=e=>{let r=null;return e.allInternal(e=>(n?e.epochNanoseconds>t:e.epochNanoseconds>=t)?!1:(r=e,!0)),r};if(i.opts.count!==void 0)return a(i);let o=i.opts.until?.epochNanoseconds,s=new Y.ZonedDateTime(o!==void 0&&o<t?o:t,i.tzid,i.originalDtstart.calendarId),c=i.opts.interval??1;for(let e=0;e<16;e++){let t=e===0?s:s.subtract(i.freqDuration(c*4**e)),n=r!==void 0&&t.epochNanoseconds<=r;n&&(t=new Y.ZonedDateTime(r,i.tzid,i.originalDtstart.calendarId));let o=i.ruleFromAlignedDtstart(t),l=a(o);if(l||o===i||n)return l}return a(i)}freqDuration(e){switch(this.opts.freq){case`YEARLY`:return{years:e};case`MONTHLY`:return{months:e};case`WEEKLY`:return{weeks:e};case`DAILY`:return{days:e};case`HOURLY`:return{hours:e};case`MINUTELY`:return{minutes:e};default:return{seconds:e}}}toString(){let e=this.originalDtstart.toString({smallestUnit:`second`}).replace(/[-:]/g,``),t=`DTSTART;TZID=${this.tzid}:${e.slice(0,15)}`,n=[],{freq:r,interval:i,count:a,until:o,byHour:s,byMinute:c,bySecond:l,byDay:u,byMonth:d,byMonthDay:f,bySetPos:p,byWeekNo:m,byYearDay:h,wkst:g,rDate:_,exDate:v}=this.opts;this.opts.rscale&&n.push(`RSCALE=${this.opts.rscale}`),this.opts.rscale&&this.opts.skip&&n.push(`SKIP=${this.opts.skip}`),n.push(`FREQ=${r}`),i!==1&&n.push(`INTERVAL=${i}`),a!==void 0&&n.push(`COUNT=${a}`),o&&n.push(`UNTIL=${this.formatIcsDateTime(o)}`),s&&n.push(`BYHOUR=${s.join(`,`)}`),c&&n.push(`BYMINUTE=${c.join(`,`)}`),l&&n.push(`BYSECOND=${l.join(`,`)}`),u&&n.push(`BYDAY=${u.join(`,`)}`),d&&n.push(`BYMONTH=${d.join(`,`)}`),f&&n.push(`BYMONTHDAY=${f.join(`,`)}`),p&&n.push(`BYSETPOS=${p.join(`,`)}`),m&&n.push(`BYWEEKNO=${m.join(`,`)}`),h&&n.push(`BYYEARDAY=${h.join(`,`)}`),g&&n.push(`WKST=${g}`);let ee=[t,`RRULE:${n.join(`;`)}`];return _&&ee.push(`RDATE:${this.joinDates(_)}`),v&&ee.push(`EXDATE:${this.joinDates(v)}`),ee.join(`
2
+ `)}formatIcsDateTime(e){return e.toInstant().toString().replace(/[-:]/g,``).slice(0,15)+`Z`}joinDates(e){return e.map(e=>this.formatIcsDateTime(e))}generateMonthlyDateCandidates(e){let t=e.day===1?e:e.with({day:1});if(!this.opts.byDay&&!this.opts.byMonthDay)return[e];let n=this.generateMonthlyOccurrenceDays(t);return n.length===0?[]:n.map(e=>t.with({day:e}))}generateMonthlyOccurrences(e){let t=[];return this.visitDateTimeCandidates(this.generateMonthlyDateCandidates(e.toPlainDate()),1,e=>(t.push(e),!0)),t}generateYearlyDateCandidates(e){let t=this.opts.byMonth?this.opts.byMonth.filter(e=>typeof e==`number`).sort((e,t)=>e-t):this.opts.byMonthDay||this.opts.byDay?[1,2,3,4,5,6,7,8,9,10,11,12]:[this.originalDtstart.month],n=[];if(this.opts.byDay&&this.opts.byDay.some(e=>/^[+-]?\d/.test(e))&&!this.opts.byMonth){let t=X;for(let r of this.opts.byDay){let i=Jd(r);if(!i||i.ord===0)continue;let a=i.ord,o=t[i.weekday],s;if(a>0){let t=e.with({month:1,day:1}),n=(o-t.dayOfWeek+7)%7;s=t.add({days:n+7*(a-1)})}else{let t=e.with({month:12,day:31}),n=(t.dayOfWeek-o+7)%7;s=t.subtract({days:n+7*(-a-1)})}n.push(s)}}else if(!this.opts.byYearDay&&!this.opts.byWeekNo){n=[];for(let r of t){let t=e.with({month:r,day:1}),i=this.generateMonthlyDateCandidates(t);if(i.length===0&&this.opts.rscale&&this.opts.byMonthDay&&this.opts.byMonthDay.length>0){let e=t.add({months:1}).subtract({days:1}).day,r=this.opts.byMonthDay[0],i=r>0?r:e+r+1;if(i>e||i<=0){let r=this.opts.skip||`OMIT`;if(r===`BACKWARD`)n.push(t.with({day:e}));else if(r===`FORWARD`){let e=t.add({months:1}).with({day:1});n.push(e)}}}else n.push(...i)}}if(this.opts.byYearDay){let t=e.with({month:12,day:31}).dayOfYear;for(let r of this.opts.byYearDay){let i=r>0?r:t+r+1;if(i<=0||i>t)continue;let a=(this.opts.freq,e.with({month:1,day:1}).add({days:i-1}));(!this.opts.byMonth||this.opts.byMonth.includes(a.month))&&n.push(a)}}if(this.opts.byWeekNo){let{lastWeek:t,firstWeekStart:r,tokens:i}=this.isoWeekByDay(e);for(let e of this.opts.byWeekNo){if(e>0&&e>t||e<0&&-e>t)continue;let a=e>0?e-1:t+e,o=r.add({weeks:a});n.push(...this.addByDayDates(i,o))}}return this.sortedUniqueDateCandidates(n)}addByDayDates(e,t){let n=X,r=n[this.opts.wkst||`MO`],i=[];for(let a of e){if(!a)continue;let e=n[a],o=t.add({days:(e-r+7)%7});(!this.opts.byMonth||this.opts.byMonth.includes(o.month))&&i.push(o)}return this.sortedUniqueDateCandidates(i)}findNextValidValue(e,t,n){return t.find(t=>n(t,e)>0)||null}findNextValidDate(e){if(this.opts.byWeekNo&&this.opts.byYearDay){let t=e.with({month:1,day:1,hour:0,minute:0,second:0,millisecond:0}),n=this.opts.byYearDay.map(e=>{let n=t.with({month:12,day:31}).dayOfYear;return e>0?e:n+e+1});for(let e of n){let n=t.add({days:e-1});if(this.matchesByWeekNo(n))break}}if(this.opts.byMonth){let t=this.opts.byMonth.filter(e=>typeof e==`number`);if(t.length&&!t.includes(e.month)){let n=[...t].sort((e,t)=>e-t),r=this.findNextValidValue(e.month,n,(e,t)=>e-t);return e=r?e.with({month:r,day:1,hour:0,minute:0,second:0}):e.add({years:1}).with({month:n[0],day:1,hour:0,minute:0,second:0}),e=this.applyTimeOverride(e),e}}if(this.opts.byWeekNo&&!this.matchesByWeekNo(e))return e=e.add({weeks:1}).with({hour:0,minute:0,second:0}),e=this.applyTimeOverride(e),e;if(this.opts.byYearDay&&!this.matchesByYearDay(e)){let t=[...this.opts.byYearDay].sort((e,t)=>e-t),n=e.dayOfYear,r=e.with({month:12,day:31}).dayOfYear,i=t.find(e=>(e>0?e:r+e+1)>n);if(i){let t=i>0?i:r+i+1;e=this.opts.freq===`MINUTELY`||this.opts.freq===`SECONDLY`?e.with({month:1,day:1,hour:0,minute:0,second:0,millisecond:0}).add({days:t-1}):e.with({month:1,day:1}).add({days:t-1})}else{let n=e.add({years:1}),r=n.with({month:12,day:31}).dayOfYear,i=t[0];if(i!==void 0){let t=i>0?i:r+i+1;e=this.opts.freq===`MINUTELY`||this.opts.freq===`SECONDLY`?n.with({month:1,day:1,hour:0,minute:0,second:0,millisecond:0}).add({days:t-1}):n.with({month:1,day:1}).add({days:t-1})}}return e=this.applyTimeOverride(e),e}if(this.opts.byMonthDay&&!this.matchesByMonthDay(e)){let t=[...this.opts.byMonthDay].sort((e,t)=>e-t),n=e.with({day:1}).add({months:1}).subtract({days:1}).day,r=e.day,i=t.map(e=>e>0?e:n+e+1).filter(e=>e>0&&e<=n).sort((e,t)=>e-t),a=this.findNextValidValue(r,i,(e,t)=>e-t);if(a)e=e.with({day:a,hour:0,minute:0,second:0});else{let n=e.add({months:1}).with({day:1}),r=n.add({months:1}).subtract({days:1}).day,i=t[0];if(i!==void 0){let t=i>0?i:r+i+1;e=n.with({day:Math.max(1,Math.min(t,r)),hour:0,minute:0,second:0})}else e=e.add({months:1}).with({day:1,hour:0,minute:0,second:0})}return e=this.applyTimeOverride(e),e}if(this.opts.byDay&&!this.matchesByDay(e)){let t=this.allByDayIsoDays;if(!t?.length)return this.applyTimeOverride(e.add({days:1}).with({hour:0,minute:0,second:0}));let n=this.findNextValidValue(e.dayOfWeek,t,(e,t)=>e-t);if(n){let t=(n-e.dayOfWeek+7)%7;e=e.add({days:t}).with({hour:0,minute:0,second:0})}else{let n=(t[0]-e.dayOfWeek+7)%7;e=e.add({days:n+7}).with({hour:0,minute:0,second:0})}return e=this.applyTimeOverride(e),e}switch(this.opts.freq){case`SECONDLY`:case`MINUTELY`:e=e.add({days:1}).with({hour:0,minute:0,second:0});break;case`HOURLY`:e=e.add({days:1}).with({hour:0,minute:0,second:0});break;case`DAILY`:case`WEEKLY`:e=e.add({months:1}).with({day:1,hour:0,minute:0,second:0});break;case`MONTHLY`:case`YEARLY`:e=e.add({years:1}).with({month:1,day:1,hour:0,minute:0,second:0});break}return this.applyTimeOverride(e)}applyBySetPos(e){let{bySetPos:t}=this.opts;if(!t||!t.length)return e;let n=[...e].sort((e,t)=>Y.ZonedDateTime.compare(e,t));return this.applyBySetPosToSortedList(n).sort((e,t)=>Y.ZonedDateTime.compare(e,t))}isoWeekByDay(e){let t=X,n=t[this.opts.wkst||`MO`],r=e.with({month:1,day:4}),i=(r.dayOfWeek-n+7)%7,a=r.subtract({days:i}),o=r.add({years:1}).with({month:1,day:4}),s=o.subtract({days:(o.dayOfWeek-n+7)%7});return{lastWeek:a.until(s,{largestUnit:`days`}).days/7,firstWeekStart:a,tokens:this.opts.byDay?.length?this.opts.byDay.map(e=>qd(e)).filter(e=>e!==null):[Object.entries(t).find(([,e])=>e===this.originalDtstart.dayOfWeek)[0]]}}generateDateCandidatesForWeekInYear(e,t){let n=[],r=this.originalDtstart.toPlainDate().with({year:e,month:1,day:1}),{lastWeek:i,firstWeekStart:a,tokens:o}=this.isoWeekByDay(r);if(t>0&&t>i||t<0&&-t>i)return n;let s=t>0?t-1:i+t,c=a.add({weeks:s});return n.push(...this.addByDayDates(o,c)),this.sortedUniqueDateCandidates(n)}getRscaleCalendarId(){return{GREGORIAN:`gregory`,CHINESE:`chinese`,HEBREW:`hebrew`,INDIAN:`indian`}[this.opts.rscale?.toUpperCase()||``]||null}assertRscaleCalendarSupported(t){if(t===`gregory`||t===`iso8601`)return;let n=e.rscaleCalendarSupport[t];if(n===!0)return;if(n===!1)throw Error(`RSCALE=${this.opts.rscale} is not supported by the current Temporal/Intl implementation`);let r=!0;try{let e=od.ZonedDateTime.from(`2000-01-01T00:00:00+00:00[UTC]`).withCalendar(t);e.year,e.monthCode,e.day}catch{r=!1}if(e.rscaleCalendarSupport[t]=r,!r)throw Error(`RSCALE=${this.opts.rscale} is not supported by the current Temporal/Intl implementation`)}pad2(e){return String(e).padStart(2,`0`)}monthMatchesToken(e,t){if(typeof t==`number`)return e===`M${this.pad2(t)}`;if(/^\d+L$/i.test(t)){let n=parseInt(t,10);return e===`M${this.pad2(n)}L`}return!1}monthsOfYear(e,t){let n=[];for(let r=1;r<=20;r++)try{let i=od.PlainDate.from({calendar:e,year:t,month:r,day:1},{overflow:`reject`});n.push(i)}catch{break}return n}rscaleMonth(e,t,n,r){return r.find(e=>e.monthCode===n)||(this.opts.skip===`BACKWARD`?r.slice().reverse().find(e=>e.monthCode<n)??this.startOfYear(e,t).subtract({months:1}):this.opts.skip===`FORWARD`?r.find(e=>e.monthCode>n)??this.startOfYear(e,t+1):null)}startOfYear(e,t){return od.PlainDate.from({calendar:e,year:t,month:1,day:1})}endOfYear(e,t){return this.startOfYear(e,t+1).subtract({days:1})}rscaleFirstWeekStart(e,t,n){let r=od.PlainDate.from({calendar:e,year:t,month:1,day:4}),i=(r.dayOfWeek-n+7)%7;return r.subtract({days:i})}rscaleLastWeekCount(e,t,n){let r=this.rscaleFirstWeekStart(e,t,n),i=this.endOfYear(e,t).since(r).days;return Math.floor(i/7)+1}lastDayOfMonth(e){return e.with({day:1}).add({months:1}).subtract({days:1}).day}toRscaleZdt(e){return od.ZonedDateTime.from(e.toString())}rscaleDate(e){return Y.PlainDate.from(e.withCalendar(`iso8601`).toString())}rscaleDateAfterUntil(e){if(!this.opts.until)return!1;let t=this.opts.until.withTimeZone(this.generationTimeZone).toPlainDate().withCalendar(`iso8601`);return Y.PlainDate.compare(this.rscaleDate(e),t)>0}rscaleMatchesByYearDay(e,t){let n=this.opts.byYearDay;if(!n||n.length===0)return!0;let r=this.endOfYear(e,t.year).dayOfYear;return n.some(e=>e>0?t.dayOfYear===e:t.dayOfYear===r+e+1)}rscaleMatchesByWeekNo(e,t){let n=this.opts.byWeekNo;if(!n||n.length===0)return!0;let r=X[this.opts.wkst||`MO`],i=t.subtract({days:(t.dayOfWeek-r+7)%7}).add({days:(4-r+7)%7}).year,a=this.rscaleFirstWeekStart(e,i,r),o=this.rscaleLastWeekCount(e,i,r),s=Math.floor(t.since(a).days/7)+1;return n.some(e=>e>0?s===e:s===o+e+1)}rscaleMatchesByMonth(e,t){let n=this.opts.byMonth;return!n||n.length===0?!0:n.some(e=>this.monthMatchesToken(t.monthCode,e))}rscaleMatchesByMonthDay(e){let t=this.opts.byMonthDay;if(!t||t.length===0)return!0;let n=e.with({day:1}).add({months:1}).subtract({days:1}).day,r=e.day;return t.some(e=>e>0?r===e:r===n+e+1)}rscaleMatchesByDayBasic(e){let t=this.opts.byDay;if(!t||t.length===0)return!0;let n=X,r=t.map(e=>qd(e)).filter(e=>e!==null);return r.length===0?!0:r.some(t=>n[t]===e.dayOfWeek)}rscaleDateMatches(e,t){return this.rscaleMatchesByMonth(e,t)&&this.rscaleMatchesByYearDay(e,t)&&this.rscaleMatchesByWeekNo(e,t)&&this.rscaleMatchesByMonthDay(t)&&this.rscaleMatchesByDayBasic(t)}applySkipForDay(e,t,n,r){let i=this.lastDayOfMonth(n),a=this.opts.skip||`OMIT`;return r>=1&&r<=i?n.with({day:r}):a===`BACKWARD`?n.with({day:i}):a===`FORWARD`?n.add({months:1}).with({day:1}):null}generateMonthlyOccurrencesRscale(e,t,n){let r=[],i=this.opts.byMonthDay,a=this.opts.byDay;if(!a&&!i){let i=this.toRscaleZdt(this.originalDtstart).withCalendar(e).day,a=this.applySkipForDay(e,t,n,i);return a&&r.push(this.rscaleDate(a)),r}let o=e=>{r.push(this.rscaleDate(e))},s=this.lastDayOfMonth(n),c=e=>e>0?e:s+e+1;if(i&&i.length>0)for(let r of i){let i=c(r),a=this.applySkipForDay(e,t,n,i);a&&o(a)}if(a&&a.length>0){let e=X,t={},r=n;for(;r.month===n.month&&r.year===n.year;){let e=r.dayOfWeek;(t[e]||=[]).push(r),r=r.add({days:1})}for(let n of a){let r=Jd(n);if(!r)continue;let i=r.ord,a=t[e[r.weekday]]||[];if(a.length!==0)if(i===0)for(let e of a)o(e);else{let e=a[i>0?i-1:a.length+i];e&&o(e)}}}return this.sortedUniqueDateCandidates(r)}_allRscaleNonGregorian(e,t){let n=this.getRscaleCalendarId();if(!n)return this._allFallback(e);this.assertRscaleCalendarSupported(n);let r=[],i=this.createCandidateWorkBudget(),a=0,o=this.originalDtstart,s=this.toRscaleZdt(o).withCalendar(n),c=this.opts.interval??1;if(!this.addDtstartIfNeeded(r,e))return this.applyCountLimitAndMergeRDates(r,e);if(this.opts.freq===`YEARLY`){let l=0;for(;;){if(++a>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);let u=s.year+l*c,d=[],f=this.opts.byMonth,p=this.monthsOfYear(n,u),m=X,h=m[this.opts.wkst||`MO`];if(this.opts.byWeekNo&&this.opts.byWeekNo.length>0){let e=this.rscaleFirstWeekStart(n,u,h),t=this.rscaleLastWeekCount(n,u,h),r=this.opts.byDay?.length?this.opts.byDay.map(e=>qd(e)).filter(e=>e!==null):[Object.entries(m).find(([,e])=>e===this.originalDtstart.dayOfWeek)[0]];for(let i of this.opts.byWeekNo){let a=i>0?i-1:t+i;if(a<0||a>=t)continue;let o=e.add({weeks:a});for(let e of r){let t=m[e],r=o.add({days:(t-h+7)%7});if(!(f&&f.length>0&&!f.some(e=>this.monthMatchesToken(r.monthCode,e)))){if(this.opts.byYearDay&&this.opts.byYearDay.length>0){let e=this.endOfYear(n,u).dayOfYear;if(!this.opts.byYearDay.some(t=>{let n=t>0?t:e+t+1;return r.dayOfYear===n}))continue}d.push(this.rscaleDate(r))}}}}else if(this.opts.byYearDay&&this.opts.byYearDay.length>0){let e=this.startOfYear(n,u),t=this.endOfYear(n,u).dayOfYear;for(let n of this.opts.byYearDay){let r=n>0?n:t+n+1;if(r<1||r>t)continue;let i=e.add({days:r-1});f&&f.length>0&&!f.some(e=>this.monthMatchesToken(i.monthCode,e))||d.push(this.rscaleDate(i))}}else if(!f||f.length===0){let e=this.rscaleMonth(n,u,s.monthCode,p),t=e?this.applySkipForDay(n,u,e,s.day):null;t&&d.push(this.rscaleDate(t))}else for(let e of f){let t=typeof e==`number`?`M${this.pad2(e)}`:`M${this.pad2(parseInt(e,10))}L`,r=this.rscaleMonth(n,u,t,p);r&&d.push(...this.generateMonthlyOccurrencesRscale(n,u,r))}if(d.length>0&&!this.visitPeriodCandidates(d,t=>this.processOccurrence(t,r,o,e,void 0,i),t??o,this.opts.until,i)||(l++,this.opts.until&&u>this.toRscaleZdt(this.opts.until).withCalendar(n).year))break}return this.applyCountLimitAndMergeRDates(r,e)}if(this.opts.freq===`WEEKLY`){let c=X,l=c[this.opts.wkst||`MO`],u=this.opts.byDay?.length?this.opts.byDay.map(e=>qd(e)).filter(e=>e!==null):[Object.entries(c).find(([,e])=>e===this.originalDtstart.dayOfWeek)[0]],d=s.toPlainDate().subtract({days:(s.dayOfWeek-l+7)%7});for(;;){if(++a>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);let s=[];for(let e of u){let t=c[e],r=d.add({days:(t-l+7)%7});if(this.opts.byWeekNo&&this.opts.byWeekNo.length>0){let e=d.add({days:(4-l+7)%7}).year,t=this.rscaleFirstWeekStart(n,e,l),i=this.rscaleLastWeekCount(n,e,l),a=Math.floor(r.since(t).days/7)+1;if(!this.opts.byWeekNo.some(e=>e>0?a===e:a===i+e+1))continue}if(this.opts.byYearDay&&this.opts.byYearDay.length>0){let e=this.endOfYear(n,r.year).dayOfYear;if(!this.opts.byYearDay.some(t=>t>0?r.dayOfYear===t:r.dayOfYear===e+t+1))continue}let i=this.opts.byMonth;i&&i.length>0&&!i.some(e=>this.monthMatchesToken(r.monthCode,e))||s.push(this.rscaleDate(r))}if(s.length&&!this.visitPeriodCandidates(s,t=>this.processOccurrence(t,r,o,e,void 0,i),t??o,this.opts.until,i))return this.applyCountLimitAndMergeRDates(r,e);if(d=d.add({weeks:this.opts.interval??1}),this.rscaleDateAfterUntil(d))break}return this.applyCountLimitAndMergeRDates(r,e)}if(this.opts.freq===`MONTHLY`){let c=s.toPlainDate().with({day:1});for(;;){if(++a>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);let s=c.year,l=c,u=!0,d=this.opts.byMonth;if(d&&d.length>0&&(u=d.some(e=>this.monthMatchesToken(l.monthCode,e))),u){let a=this.generateMonthlyOccurrencesRscale(n,s,l);if(!this.visitPeriodCandidates(a,t=>this.processOccurrence(t,r,o,e,void 0,i),t??o,this.opts.until,i))break}if(c=c.add({months:this.opts.interval??1}),this.rscaleDateAfterUntil(c))break}return this.applyCountLimitAndMergeRDates(r,e)}if(this.opts.freq===`DAILY`){let c=s.toPlainDate();for(;;){if(++a>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);if(this.rscaleDateMatches(n,c)){let n=this.rscaleDate(c);if(!this.visitPeriodCandidates([n],t=>this.processOccurrence(t,r,o,e,void 0,i),t??o,this.opts.until,i))break}if(c=c.add({days:this.opts.interval??1}),this.rscaleDateAfterUntil(c))break}return this.applyCountLimitAndMergeRDates(r,e)}if(this.opts.freq===`HOURLY`||this.opts.freq===`MINUTELY`){this.opts.freq;let c=this.opts.freq===`HOURLY`?36e5:6e4,l=this.opts.interval??1,u=s.toPlainDate(),d=this.originalDtstart.toInstant().epochMilliseconds;for(;;){if(++a>this.maxIterations)throw Error(`Maximum iterations (${this.maxIterations}) exceeded in all()`);if(this.rscaleDateMatches(n,u)){let n=this.rscaleDate(u);if(!this.visitPeriodCandidates([n],t=>{let n=t.toInstant().epochMilliseconds-d;return Math.floor(n/c)%l===0?this.processOccurrence(t,r,o,e,void 0,i):!0},t??o,this.opts.until,i))break}if(u=u.add({days:1}),this.rscaleDateAfterUntil(u))break}return this.applyCountLimitAndMergeRDates(r,e)}return this._allFallback(e)}};Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return _d}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return vd}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return df}});
package/dist/totext.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./src-CDWzulSL.cjs`),t={weekdayNames:[`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`,`Sunday`],monthNames:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],units:{year:{singular:`year`,plural:`years`},month:{singular:`month`,plural:`months`},week:{singular:`week`,plural:`weeks`},day:{singular:`day`,plural:`days`},hour:{singular:`hour`,plural:`hours`},minute:{singular:`minute`,plural:`minutes`},second:{singular:`second`,plural:`seconds`}},words:{every:`every`,weekday:`weekday`,on:`on`,in:`in`,on_the:`on the`,day_of_month:`day of the month`,day_of_year:`day of the year`,in_week:`in week`,at:`at`,at_minute:`at minute`,at_second:`at second`,until:`until`,for:`for`,time:`time`,times:`times`,instance:`instance`,week_starts_on:`week starts on`,with:`with`,additional_date:`additional date`,additional_dates:`additional dates`,excluding:`excluding`,date:`date`,dates:`dates`,and:`and`,last:`last`,starting_from:`starting from`},ordinal:e=>{let t=Math.abs(e),n=t%10==1&&t%100!=11?`st`:t%10==2&&t%100!=12?`nd`:t%10==3&&t%100!=13?`rd`:`th`;return e<0?`last`:`${t}${n}`}},n={en:t,de:{weekdayNames:[`Montag`,`Dienstag`,`Mittwoch`,`Donnerstag`,`Freitag`,`Samstag`,`Sonntag`],monthNames:[`Januar`,`Februar`,`März`,`April`,`Mai`,`Juni`,`Juli`,`August`,`September`,`Oktober`,`November`,`Dezember`],units:{year:{singular:`Jahr`,plural:`Jahre`},month:{singular:`Monat`,plural:`Monate`},week:{singular:`Woche`,plural:`Wochen`},day:{singular:`Tag`,plural:`Tage`},hour:{singular:`Stunde`,plural:`Stunden`},minute:{singular:`Minute`,plural:`Minuten`},second:{singular:`Sekunde`,plural:`Sekunden`}},words:{every:`jede/n/s`,weekday:`Werktag`,on:`am`,in:`im`,on_the:`am`,day_of_month:`Tag des Monats`,day_of_year:`Tag des Jahres`,in_week:`in Kalenderwoche`,at:`um`,at_minute:`in Minute`,at_second:`in Sekunde`,until:`bis`,for:`für`,time:`Mal`,times:`Mal`,instance:`Vorkommen`,week_starts_on:`Woche beginnt am`,with:`mit`,additional_date:`zusätzlichem Datum`,additional_dates:`zusätzlichen Daten`,excluding:`ohne`,date:`Datum`,dates:`Daten`,and:`und`,last:`letzter`,starting_from:`beginnend am`},ordinal:e=>e<0?`letzten`:`${Math.abs(e)}.`},es:{weekdayNames:[`lunes`,`martes`,`miércoles`,`jueves`,`viernes`,`sábado`,`domingo`],monthNames:[`enero`,`febrero`,`marzo`,`abril`,`mayo`,`junio`,`julio`,`agosto`,`septiembre`,`octubre`,`noviembre`,`diciembre`],units:{year:{singular:`año`,plural:`años`},month:{singular:`mes`,plural:`meses`},week:{singular:`semana`,plural:`semanas`},day:{singular:`día`,plural:`días`},hour:{singular:`hora`,plural:`horas`},minute:{singular:`minuto`,plural:`minutos`},second:{singular:`segundo`,plural:`segundos`}},words:{every:`cada`,weekday:`día de la semana`,on:`en`,in:`en`,on_the:`el`,day_of_month:`día del mes`,day_of_year:`día del año`,in_week:`en la semana`,at:`a las`,at_minute:`en el minuto`,at_second:`en el segundo`,until:`hasta`,for:`durante`,time:`vez`,times:`veces`,instance:`ocasión`,week_starts_on:`la semana comienza el`,with:`con`,additional_date:`fecha adicional`,additional_dates:`fechas adicionales`,excluding:`excluyendo`,date:`fecha`,dates:`fechas`,and:`y`,last:`último`,starting_from:`a partir de`},ordinal:e=>e<0?`último`:`${Math.abs(e)}º`},hi:{weekdayNames:[`सोमवार`,`मंगलवार`,`बुधवार`,`गुरुवार`,`शुक्रवार`,`शनिवार`,`रविवार`],monthNames:[`जनवरी`,`फरवरी`,`मार्च`,`अप्रैल`,`मई`,`जून`,`जुलाई`,`अगस्त`,`सितंबर`,`अक्टूबर`,`नवंबर`,`दिसंबर`],units:{year:{singular:`साल`,plural:`साल`},month:{singular:`महीना`,plural:`महीने`},week:{singular:`सप्ताह`,plural:`सप्ताह`},day:{singular:`दिन`,plural:`दिन`},hour:{singular:`घंटा`,plural:`घंटे`},minute:{singular:`मिनट`,plural:`मिनट`},second:{singular:`सेकंड`,plural:`सेकंड`}},words:{every:`हर`,weekday:`सप्ताह का दिन`,on:`को`,in:`में`,on_the:`को`,day_of_month:`महीने का दिन`,day_of_year:`साल का दिन`,in_week:`सप्ताह`,at:`पर`,at_minute:`मिनट पर`,at_second:`सेकंड पर`,until:`तक`,for:`के लिए`,time:`बार`,times:`बार`,instance:`बार`,week_starts_on:`सप्ताह शुरू होता है`,with:`साथ`,additional_date:`अतिरिक्त तारीख`,additional_dates:`अतिरिक्त तारीखें`,excluding:`को छोड़कर`,date:`तारीख`,dates:`तारीखें`,and:`और`,last:`आखिरी`,starting_from:`से शुरू`},ordinal:e=>e<0?`आखिरी`:`${Math.abs(e)}वां`},yue:{weekdayNames:[`星期一`,`星期二`,`星期三`,`星期四`,`星期五`,`星期六`,`星期日`],monthNames:[`一月`,`二月`,`三月`,`四月`,`五月`,`六月`,`七月`,`八月`,`九月`,`十月`,`十一月`,`十二月`],units:{year:{singular:`年`,plural:`年`},month:{singular:`月`,plural:`月`},week:{singular:`週`,plural:`週`},day:{singular:`日`,plural:`日`},hour:{singular:`小時`,plural:`小時`},minute:{singular:`分鐘`,plural:`分鐘`},second:{singular:`秒`,plural:`秒`}},words:{every:`每`,weekday:`平日`,on:`在`,in:`於`,on_the:`在`,day_of_month:`月的日子`,day_of_year:`年的日子`,in_week:`第`,at:`在`,at_minute:`在第`,at_second:`在第`,until:`直到`,for:`共`,time:`次`,times:`次`,instance:`次`,week_starts_on:`星期開始於`,with:`帶有`,additional_date:`額外日期`,additional_dates:`額外日期`,excluding:`排除`,date:`日期`,dates:`日期`,and:`和`,last:`最後`,starting_from:`由`},ordinal:e=>e<0?`最後`:`第${Math.abs(e)}`},ar:{weekdayNames:[`الاثنين`,`الثلاثاء`,`الأربعاء`,`الخميس`,`الجمعة`,`السبت`,`الأحد`],monthNames:[`يناير`,`فبراير`,`مارس`,`أبريل`,`مايو`,`يونيو`,`يوليو`,`أغسطس`,`سبتمبر`,`أكتوبر`,`نوفمبر`,`ديسمبر`],units:{year:{singular:`سنة`,plural:`سنوات`},month:{singular:`شهر`,plural:`أشهر`},week:{singular:`أسبوع`,plural:`أسابيع`},day:{singular:`يوم`,plural:`أيام`},hour:{singular:`ساعة`,plural:`ساعات`},minute:{singular:`دقيقة`,plural:`دقائق`},second:{singular:`ثانية`,plural:`ثواني`}},words:{every:`كل`,weekday:`يوم من أيام الأسبوع`,on:`في`,in:`في`,on_the:`في الـ`,day_of_month:`يوم من الشهر`,day_of_year:`يوم من السنة`,in_week:`في الأسبوع`,at:`عند`,at_minute:`في الدقيقة`,at_second:`في الثانية`,until:`حتى`,for:`لمدة`,time:`مرة`,times:`مرات`,instance:`مرة`,week_starts_on:`يبدأ الأسبوع يوم`,with:`مع`,additional_date:`تاريخ إضافي`,additional_dates:`تواريخ إضافية`,excluding:`باستثناء`,date:`تاريخ`,dates:`تواريخ`,and:`و`,last:`الأخير`,starting_from:`ابتداءً من`},ordinal:e=>{if(e<0)return`الأخير`;let t=Math.abs(e);return{1:`الأول`,2:`الثاني`,3:`الثالث`,4:`الرابع`,5:`الخامس`,6:`السادس`,7:`السابع`,8:`الثامن`,9:`التاسع`,10:`العاشر`,11:`الحادي عشر`,12:`الثاني عشر`,13:`الثالث عشر`}[t]||t.toString()}},he:{weekdayNames:[`יום שני`,`יום שלישי`,`יום רביעי`,`יום חמישי`,`יום שישי`,`יום שבת`,`יום ראשון`],monthNames:[`ינואר`,`פברואר`,`מרץ`,`אפריל`,`מאי`,`יוני`,`יולי`,`אוגוסט`,`ספטמבר`,`אוקטובר`,`נובמבר`,`דצמבר`],units:{year:{singular:`שנה`,plural:`שנים`},month:{singular:`חודש`,plural:`חודשים`},week:{singular:`שבוע`,plural:`שבועות`},day:{singular:`יום`,plural:`ימים`},hour:{singular:`שעה`,plural:`שעות`},minute:{singular:`דקה`,plural:`דקות`},second:{singular:`שניה`,plural:`שניות`}},words:{every:`כל`,weekday:`יום חול`,on:`ב`,in:`ב`,on_the:`ב`,day_of_month:`יום בחודש`,day_of_year:`יום בשנה`,in_week:`בשבוע`,at:`בשעה`,at_minute:`בדקה`,at_second:`בשניה`,until:`עד`,for:`במשך`,time:`פעם`,times:`פעמים`,instance:`פעם`,week_starts_on:`שבוע מתחיל ב`,with:`עם`,additional_date:`תאריך נוסף`,additional_dates:`תאריכים נוספים`,excluding:`למעט`,date:`תאריך`,dates:`תאריכים`,and:`ו`,last:`אחרון`,starting_from:`החל מ`},ordinal:e=>{if(e<0)return`אחרון`;let t=Math.abs(e);return{1:`ראשון`,2:`שני`,3:`שלישי`,4:`רביעי`,5:`חמישי`,6:`שישי`,7:`שביעי`,8:`שמיני`,9:`תשיעי`,10:`עשירי`,11:`אחד עשר`,12:`שנים עשר`,13:`שלושה עשר`}[t]||t.toString()}},zh:{weekdayNames:[`星期一`,`星期二`,`星期三`,`星期四`,`星期五`,`星期六`,`星期日`],monthNames:[`一月`,`二月`,`三月`,`四月`,`五月`,`六月`,`七月`,`八月`,`九月`,`十月`,`十一月`,`十二月`],units:{year:{singular:`年`,plural:`年`},month:{singular:`月`,plural:`月`},week:{singular:`周`,plural:`周`},day:{singular:`日`,plural:`日`},hour:{singular:`小时`,plural:`小时`},minute:{singular:`分钟`,plural:`分钟`},second:{singular:`秒`,plural:`秒`}},words:{every:`每`,weekday:`工作日`,on:`在`,in:`在`,on_the:`在`,day_of_month:`月的日子`,day_of_year:`年的日子`,in_week:`第`,at:`在`,at_minute:`在第`,at_second:`在第`,until:`直到`,for:`共`,time:`次`,times:`次`,instance:`次`,week_starts_on:`星期开始于`,with:`带有`,additional_date:`额外日期`,additional_dates:`额外日期`,excluding:`排除`,date:`日期`,dates:`日期`,and:`和`,last:`最后`,starting_from:`从`},ordinal:e=>e<0?`最后`:`第${Math.abs(e)}`},fr:{weekdayNames:[`lundi`,`mardi`,`mercredi`,`jeudi`,`vendredi`,`samedi`,`dimanche`],monthNames:[`janvier`,`février`,`mars`,`avril`,`mai`,`juin`,`juillet`,`août`,`septembre`,`octobre`,`novembre`,`décembre`],units:{year:{singular:`année`,plural:`ans`},month:{singular:`mois`,plural:`mois`},week:{singular:`semaine`,plural:`semaines`},day:{singular:`jour`,plural:`jours`},hour:{singular:`heure`,plural:`heures`},minute:{singular:`minute`,plural:`minutes`},second:{singular:`seconde`,plural:`secondes`}},words:{every:`chaque`,weekday:`jour de semaine`,on:`le`,in:`dans`,on_the:`le`,day_of_month:`jour du mois`,day_of_year:`jour de l'année`,in_week:`dans la semaine`,at:`à`,at_minute:`à la minute`,at_second:`à la seconde`,until:`jusqu'au`,for:`pendant`,time:`fois`,times:`fois`,instance:`occurrence`,week_starts_on:`la semaine commence le`,with:`avec`,additional_date:`date supplémentaire`,additional_dates:`dates supplémentaires`,excluding:`en excluant`,date:`date`,dates:`dates`,and:`et`,last:`dernier`,starting_from:`à partir du`},ordinal:e=>{let t=Math.abs(e);return e<0?`dernier`:t===1?`1er`:`${t}e`}}},r=typeof process<`u`&&process.env?process.env.TOTEXT_LANGS:void 0,i=r?r.split(`,`).map(e=>e.trim()).filter(Boolean):Object.keys(n),a={};for(let e of i)n[e]&&(a[e]=n[e]);const o=e.r.slice(0,5),s=RegExp(`^([+-]?\\d+)?(${e.r.join(`|`)})$`),c=Object.fromEntries(e.r.map((e,t)=>[e,t]));function l(e){let t=Math.abs(e),n=t%10==1&&t%100!=11?`st`:t%10==2&&t%100!=12?`nd`:t%10==3&&t%100!=13?`rd`:`th`;return e<0?`last`:`${t}${n}`}function u(e,t){return t.ordinal?t.ordinal(e):l(e)}function d(e,t=e=>`${e}`,n){let r=e.map(t);return r.length===1?r[0]:r.slice(0,-1).join(`, `)+` ${n} `+r[r.length-1]}function f(e,t){if(typeof e==`number`)return e.toString();let n=e.toUpperCase().match(s);if(!n)return e;let r=n[1]?parseInt(n[1],10):0,i=c[n[2]],a=t.weekdayNames[i];return r===0?a:r===-1?`${t.words.last} ${a}`:`${u(r,t)} ${a}`}function p(e,t,n,r,i){let a={hour:`numeric`,timeZone:`UTC`};i&&(a.second=`2-digit`),(i||r)&&(a.minute=`2-digit`);let o=new Date(Date.UTC(2e3,0,1,n,r,i));try{return new Intl.DateTimeFormat(t,a).format(o)}catch{return new Intl.DateTimeFormat(`en`,a).format(o)}}function m(t){return e.r[t.dayOfWeek-1]}function h(e,t){let n={timeZone:e.timeZoneId,timeZoneName:`short`,hour:`numeric`},r;try{r=new Intl.DateTimeFormat(t,n)}catch{r=Intl.DateTimeFormat(`en`,n)}return r.formatToParts(new Date(e.epochMilliseconds)).find(e=>e.type===`timeZoneName`)?.value||e.timeZoneId}function g(e,t){let n={dateStyle:`long`,timeZone:e.timeZoneId},r=new Date(e.epochMilliseconds);try{return new Intl.DateTimeFormat(t,n).format(r)}catch{return new Intl.DateTimeFormat(`en`,n).format(r)}}function _(n,r,i={}){let s=(typeof n==`string`?new e.t({rruleString:n}):n).options(),c=r??Intl.DateTimeFormat().resolvedOptions().locale,l=c.split(`-`)[0],_=a[l]||t,v=a[l]?c:`en`,{freq:y,interval:b=1,count:x,until:S,byDay:C,byHour:w,byMinute:T,bySecond:E,byMonth:D,byMonthDay:O,byYearDay:k,byWeekNo:A,bySetPos:j,wkst:M,rDate:N,exDate:P}=s,F=y===`YEARLY`||y===`MONTHLY`||y===`WEEKLY`||y===`DAILY`,I=!!(w||T||E),L=s.dtstart.hour!==0||s.dtstart.minute!==0||s.dtstart.second!==0,R=F&&(I||L),z=C??(y===`WEEKLY`?[m(s.dtstart)]:void 0),B=w??(R?[s.dtstart.hour]:void 0),V=B?T??[s.dtstart.minute]:T,H=B?E??[s.dtstart.second]:E,U=[_.words.every],W={YEARLY:`year`,MONTHLY:`month`,WEEKLY:`week`,DAILY:`day`,HOURLY:`hour`,MINUTELY:`minute`,SECONDLY:`second`}[y],G=_.units[W],K=z?.map(e=>e.toUpperCase()),q=K&&K.length===o.length&&o.every(e=>K.includes(e)),J=K&&K.length===e.r.length&&e.r.every(e=>K.includes(e));if(y===`WEEKLY`&&b===1&&q?U.push(_.words.weekday):y===`WEEKLY`&&b===1&&J?U.push(_.units.day.singular):b===1?U.push(G.singular):U.push(b.toString(),G.plural),(y===`WEEKLY`&&z&&!q&&!J||z&&y!==`WEEKLY`)&&U.push(_.words.on,d(z,e=>f(e,_),_.words.and)),D&&U.push(_.words.in,d(D,e=>_.monthNames[e-1],_.words.and)),O&&U.push(_.words.on_the,d(O,e=>u(e,_),_.words.and),_.words.day_of_month),k&&U.push(_.words.on_the,d(k,e=>u(e,_),_.words.and),_.words.day_of_year),A&&U.push(_.words.in_week,d(A,e=>e.toString(),_.words.and)),B){let e=V??[0],t=H??[0],n=B.flatMap(n=>e.flatMap(e=>t.map(t=>p(s.dtstart,v,n,e,t))));U.push(_.words.at,d(n,void 0,_.words.and)),i.excludeTzAbbreviation||U.push(h(s.dtstart,v))}if(!B&&V&&U.push(_.words.at_minute,d(V,void 0,_.words.and)),!B&&!V&&H&&U.push(_.words.at_second,d(H,void 0,_.words.and)),i.includeDtstart&&U.push(_.words.starting_from,g(s.dtstart,v)),S?U.push(_.words.until,g(S,v)):x!==void 0&&U.push(_.words.for,x.toString(),x===1?_.words.time:_.words.times),j&&U.push(_.words.on_the,d(j,e=>u(e,_),_.words.and),_.words.instance),M){let e=f(M,_);U.push(_.words.week_starts_on,e)}if(N&&N.length&&U.push(_.words.with,`${N.length}`,N.length===1?_.words.additional_date:_.words.additional_dates),P&&P.length&&U.push(_.words.excluding,`${P.length}`,P.length===1?_.words.date:_.words.dates),s.rscale){let e=s.rscale,t=s.skip;U.push(`(RSCALE=${e}${t?`;SKIP=${t}`:``})`)}return U.join(` `)}exports.toText=_;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./src-Dm68fCwO.cjs`),t={weekdayNames:[`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`,`Sunday`],monthNames:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],units:{year:{singular:`year`,plural:`years`},month:{singular:`month`,plural:`months`},week:{singular:`week`,plural:`weeks`},day:{singular:`day`,plural:`days`},hour:{singular:`hour`,plural:`hours`},minute:{singular:`minute`,plural:`minutes`},second:{singular:`second`,plural:`seconds`}},words:{every:`every`,weekday:`weekday`,on:`on`,in:`in`,on_the:`on the`,day_of_month:`day of the month`,day_of_year:`day of the year`,in_week:`in week`,at:`at`,at_minute:`at minute`,at_second:`at second`,until:`until`,for:`for`,time:`time`,times:`times`,instance:`instance`,week_starts_on:`week starts on`,with:`with`,additional_date:`additional date`,additional_dates:`additional dates`,excluding:`excluding`,date:`date`,dates:`dates`,and:`and`,last:`last`,starting_from:`starting from`},ordinal:e=>{let t=Math.abs(e),n=t%10==1&&t%100!=11?`st`:t%10==2&&t%100!=12?`nd`:t%10==3&&t%100!=13?`rd`:`th`;return e<0?`last`:`${t}${n}`}},n={en:t,de:{weekdayNames:[`Montag`,`Dienstag`,`Mittwoch`,`Donnerstag`,`Freitag`,`Samstag`,`Sonntag`],monthNames:[`Januar`,`Februar`,`März`,`April`,`Mai`,`Juni`,`Juli`,`August`,`September`,`Oktober`,`November`,`Dezember`],units:{year:{singular:`Jahr`,plural:`Jahre`},month:{singular:`Monat`,plural:`Monate`},week:{singular:`Woche`,plural:`Wochen`},day:{singular:`Tag`,plural:`Tage`},hour:{singular:`Stunde`,plural:`Stunden`},minute:{singular:`Minute`,plural:`Minuten`},second:{singular:`Sekunde`,plural:`Sekunden`}},words:{every:`jede/n/s`,weekday:`Werktag`,on:`am`,in:`im`,on_the:`am`,day_of_month:`Tag des Monats`,day_of_year:`Tag des Jahres`,in_week:`in Kalenderwoche`,at:`um`,at_minute:`in Minute`,at_second:`in Sekunde`,until:`bis`,for:`für`,time:`Mal`,times:`Mal`,instance:`Vorkommen`,week_starts_on:`Woche beginnt am`,with:`mit`,additional_date:`zusätzlichem Datum`,additional_dates:`zusätzlichen Daten`,excluding:`ohne`,date:`Datum`,dates:`Daten`,and:`und`,last:`letzter`,starting_from:`beginnend am`},ordinal:e=>e<0?`letzten`:`${Math.abs(e)}.`},es:{weekdayNames:[`lunes`,`martes`,`miércoles`,`jueves`,`viernes`,`sábado`,`domingo`],monthNames:[`enero`,`febrero`,`marzo`,`abril`,`mayo`,`junio`,`julio`,`agosto`,`septiembre`,`octubre`,`noviembre`,`diciembre`],units:{year:{singular:`año`,plural:`años`},month:{singular:`mes`,plural:`meses`},week:{singular:`semana`,plural:`semanas`},day:{singular:`día`,plural:`días`},hour:{singular:`hora`,plural:`horas`},minute:{singular:`minuto`,plural:`minutos`},second:{singular:`segundo`,plural:`segundos`}},words:{every:`cada`,weekday:`día de la semana`,on:`en`,in:`en`,on_the:`el`,day_of_month:`día del mes`,day_of_year:`día del año`,in_week:`en la semana`,at:`a las`,at_minute:`en el minuto`,at_second:`en el segundo`,until:`hasta`,for:`durante`,time:`vez`,times:`veces`,instance:`ocasión`,week_starts_on:`la semana comienza el`,with:`con`,additional_date:`fecha adicional`,additional_dates:`fechas adicionales`,excluding:`excluyendo`,date:`fecha`,dates:`fechas`,and:`y`,last:`último`,starting_from:`a partir de`},ordinal:e=>e<0?`último`:`${Math.abs(e)}º`},hi:{weekdayNames:[`सोमवार`,`मंगलवार`,`बुधवार`,`गुरुवार`,`शुक्रवार`,`शनिवार`,`रविवार`],monthNames:[`जनवरी`,`फरवरी`,`मार्च`,`अप्रैल`,`मई`,`जून`,`जुलाई`,`अगस्त`,`सितंबर`,`अक्टूबर`,`नवंबर`,`दिसंबर`],units:{year:{singular:`साल`,plural:`साल`},month:{singular:`महीना`,plural:`महीने`},week:{singular:`सप्ताह`,plural:`सप्ताह`},day:{singular:`दिन`,plural:`दिन`},hour:{singular:`घंटा`,plural:`घंटे`},minute:{singular:`मिनट`,plural:`मिनट`},second:{singular:`सेकंड`,plural:`सेकंड`}},words:{every:`हर`,weekday:`सप्ताह का दिन`,on:`को`,in:`में`,on_the:`को`,day_of_month:`महीने का दिन`,day_of_year:`साल का दिन`,in_week:`सप्ताह`,at:`पर`,at_minute:`मिनट पर`,at_second:`सेकंड पर`,until:`तक`,for:`के लिए`,time:`बार`,times:`बार`,instance:`बार`,week_starts_on:`सप्ताह शुरू होता है`,with:`साथ`,additional_date:`अतिरिक्त तारीख`,additional_dates:`अतिरिक्त तारीखें`,excluding:`को छोड़कर`,date:`तारीख`,dates:`तारीखें`,and:`और`,last:`आखिरी`,starting_from:`से शुरू`},ordinal:e=>e<0?`आखिरी`:`${Math.abs(e)}वां`},yue:{weekdayNames:[`星期一`,`星期二`,`星期三`,`星期四`,`星期五`,`星期六`,`星期日`],monthNames:[`一月`,`二月`,`三月`,`四月`,`五月`,`六月`,`七月`,`八月`,`九月`,`十月`,`十一月`,`十二月`],units:{year:{singular:`年`,plural:`年`},month:{singular:`月`,plural:`月`},week:{singular:`週`,plural:`週`},day:{singular:`日`,plural:`日`},hour:{singular:`小時`,plural:`小時`},minute:{singular:`分鐘`,plural:`分鐘`},second:{singular:`秒`,plural:`秒`}},words:{every:`每`,weekday:`平日`,on:`在`,in:`於`,on_the:`在`,day_of_month:`月的日子`,day_of_year:`年的日子`,in_week:`第`,at:`在`,at_minute:`在第`,at_second:`在第`,until:`直到`,for:`共`,time:`次`,times:`次`,instance:`次`,week_starts_on:`星期開始於`,with:`帶有`,additional_date:`額外日期`,additional_dates:`額外日期`,excluding:`排除`,date:`日期`,dates:`日期`,and:`和`,last:`最後`,starting_from:`由`},ordinal:e=>e<0?`最後`:`第${Math.abs(e)}`},ar:{weekdayNames:[`الاثنين`,`الثلاثاء`,`الأربعاء`,`الخميس`,`الجمعة`,`السبت`,`الأحد`],monthNames:[`يناير`,`فبراير`,`مارس`,`أبريل`,`مايو`,`يونيو`,`يوليو`,`أغسطس`,`سبتمبر`,`أكتوبر`,`نوفمبر`,`ديسمبر`],units:{year:{singular:`سنة`,plural:`سنوات`},month:{singular:`شهر`,plural:`أشهر`},week:{singular:`أسبوع`,plural:`أسابيع`},day:{singular:`يوم`,plural:`أيام`},hour:{singular:`ساعة`,plural:`ساعات`},minute:{singular:`دقيقة`,plural:`دقائق`},second:{singular:`ثانية`,plural:`ثواني`}},words:{every:`كل`,weekday:`يوم من أيام الأسبوع`,on:`في`,in:`في`,on_the:`في الـ`,day_of_month:`يوم من الشهر`,day_of_year:`يوم من السنة`,in_week:`في الأسبوع`,at:`عند`,at_minute:`في الدقيقة`,at_second:`في الثانية`,until:`حتى`,for:`لمدة`,time:`مرة`,times:`مرات`,instance:`مرة`,week_starts_on:`يبدأ الأسبوع يوم`,with:`مع`,additional_date:`تاريخ إضافي`,additional_dates:`تواريخ إضافية`,excluding:`باستثناء`,date:`تاريخ`,dates:`تواريخ`,and:`و`,last:`الأخير`,starting_from:`ابتداءً من`},ordinal:e=>{if(e<0)return`الأخير`;let t=Math.abs(e);return{1:`الأول`,2:`الثاني`,3:`الثالث`,4:`الرابع`,5:`الخامس`,6:`السادس`,7:`السابع`,8:`الثامن`,9:`التاسع`,10:`العاشر`,11:`الحادي عشر`,12:`الثاني عشر`,13:`الثالث عشر`}[t]||t.toString()}},he:{weekdayNames:[`יום שני`,`יום שלישי`,`יום רביעי`,`יום חמישי`,`יום שישי`,`יום שבת`,`יום ראשון`],monthNames:[`ינואר`,`פברואר`,`מרץ`,`אפריל`,`מאי`,`יוני`,`יולי`,`אוגוסט`,`ספטמבר`,`אוקטובר`,`נובמבר`,`דצמבר`],units:{year:{singular:`שנה`,plural:`שנים`},month:{singular:`חודש`,plural:`חודשים`},week:{singular:`שבוע`,plural:`שבועות`},day:{singular:`יום`,plural:`ימים`},hour:{singular:`שעה`,plural:`שעות`},minute:{singular:`דקה`,plural:`דקות`},second:{singular:`שניה`,plural:`שניות`}},words:{every:`כל`,weekday:`יום חול`,on:`ב`,in:`ב`,on_the:`ב`,day_of_month:`יום בחודש`,day_of_year:`יום בשנה`,in_week:`בשבוע`,at:`בשעה`,at_minute:`בדקה`,at_second:`בשניה`,until:`עד`,for:`במשך`,time:`פעם`,times:`פעמים`,instance:`פעם`,week_starts_on:`שבוע מתחיל ב`,with:`עם`,additional_date:`תאריך נוסף`,additional_dates:`תאריכים נוספים`,excluding:`למעט`,date:`תאריך`,dates:`תאריכים`,and:`ו`,last:`אחרון`,starting_from:`החל מ`},ordinal:e=>{if(e<0)return`אחרון`;let t=Math.abs(e);return{1:`ראשון`,2:`שני`,3:`שלישי`,4:`רביעי`,5:`חמישי`,6:`שישי`,7:`שביעי`,8:`שמיני`,9:`תשיעי`,10:`עשירי`,11:`אחד עשר`,12:`שנים עשר`,13:`שלושה עשר`}[t]||t.toString()}},zh:{weekdayNames:[`星期一`,`星期二`,`星期三`,`星期四`,`星期五`,`星期六`,`星期日`],monthNames:[`一月`,`二月`,`三月`,`四月`,`五月`,`六月`,`七月`,`八月`,`九月`,`十月`,`十一月`,`十二月`],units:{year:{singular:`年`,plural:`年`},month:{singular:`月`,plural:`月`},week:{singular:`周`,plural:`周`},day:{singular:`日`,plural:`日`},hour:{singular:`小时`,plural:`小时`},minute:{singular:`分钟`,plural:`分钟`},second:{singular:`秒`,plural:`秒`}},words:{every:`每`,weekday:`工作日`,on:`在`,in:`在`,on_the:`在`,day_of_month:`月的日子`,day_of_year:`年的日子`,in_week:`第`,at:`在`,at_minute:`在第`,at_second:`在第`,until:`直到`,for:`共`,time:`次`,times:`次`,instance:`次`,week_starts_on:`星期开始于`,with:`带有`,additional_date:`额外日期`,additional_dates:`额外日期`,excluding:`排除`,date:`日期`,dates:`日期`,and:`和`,last:`最后`,starting_from:`从`},ordinal:e=>e<0?`最后`:`第${Math.abs(e)}`},fr:{weekdayNames:[`lundi`,`mardi`,`mercredi`,`jeudi`,`vendredi`,`samedi`,`dimanche`],monthNames:[`janvier`,`février`,`mars`,`avril`,`mai`,`juin`,`juillet`,`août`,`septembre`,`octobre`,`novembre`,`décembre`],units:{year:{singular:`année`,plural:`ans`},month:{singular:`mois`,plural:`mois`},week:{singular:`semaine`,plural:`semaines`},day:{singular:`jour`,plural:`jours`},hour:{singular:`heure`,plural:`heures`},minute:{singular:`minute`,plural:`minutes`},second:{singular:`seconde`,plural:`secondes`}},words:{every:`chaque`,weekday:`jour de semaine`,on:`le`,in:`dans`,on_the:`le`,day_of_month:`jour du mois`,day_of_year:`jour de l'année`,in_week:`dans la semaine`,at:`à`,at_minute:`à la minute`,at_second:`à la seconde`,until:`jusqu'au`,for:`pendant`,time:`fois`,times:`fois`,instance:`occurrence`,week_starts_on:`la semaine commence le`,with:`avec`,additional_date:`date supplémentaire`,additional_dates:`dates supplémentaires`,excluding:`en excluant`,date:`date`,dates:`dates`,and:`et`,last:`dernier`,starting_from:`à partir du`},ordinal:e=>{let t=Math.abs(e);return e<0?`dernier`:t===1?`1er`:`${t}e`}}},r=typeof process<`u`&&process.env?process.env.TOTEXT_LANGS:void 0,i=r?r.split(`,`).map(e=>e.trim()).filter(Boolean):Object.keys(n),a={};for(let e of i)n[e]&&(a[e]=n[e]);const o=e.r.slice(0,5),s=RegExp(`^([+-]?\\d+)?(${e.r.join(`|`)})$`),c=Object.fromEntries(e.r.map((e,t)=>[e,t]));function l(e){let t=Math.abs(e),n=t%10==1&&t%100!=11?`st`:t%10==2&&t%100!=12?`nd`:t%10==3&&t%100!=13?`rd`:`th`;return e<0?`last`:`${t}${n}`}function u(e,t){return t.ordinal?t.ordinal(e):l(e)}function d(e,t=e=>`${e}`,n){let r=e.map(t);return r.length===1?r[0]:r.slice(0,-1).join(`, `)+` ${n} `+r[r.length-1]}function f(e,t){if(typeof e==`number`)return e.toString();let n=e.toUpperCase().match(s);if(!n)return e;let r=n[1]?parseInt(n[1],10):0,i=c[n[2]],a=t.weekdayNames[i];return r===0?a:r===-1?`${t.words.last} ${a}`:`${u(r,t)} ${a}`}function p(e,t,n,r,i){let a={hour:`numeric`,timeZone:`UTC`};i&&(a.second=`2-digit`),(i||r)&&(a.minute=`2-digit`);let o=new Date(Date.UTC(2e3,0,1,n,r,i));try{return new Intl.DateTimeFormat(t,a).format(o)}catch{return new Intl.DateTimeFormat(`en`,a).format(o)}}function m(t){return e.r[t.dayOfWeek-1]}function h(e,t){let n={timeZone:e.timeZoneId,timeZoneName:`short`,hour:`numeric`},r;try{r=new Intl.DateTimeFormat(t,n)}catch{r=Intl.DateTimeFormat(`en`,n)}return r.formatToParts(new Date(e.epochMilliseconds)).find(e=>e.type===`timeZoneName`)?.value||e.timeZoneId}function g(e,t){let n={dateStyle:`long`,timeZone:e.timeZoneId},r=new Date(e.epochMilliseconds);try{return new Intl.DateTimeFormat(t,n).format(r)}catch{return new Intl.DateTimeFormat(`en`,n).format(r)}}function _(n,r,i={}){let s=(typeof n==`string`?new e.t({rruleString:n}):n).options(),c=r??Intl.DateTimeFormat().resolvedOptions().locale,l=c.split(`-`)[0],_=a[l]||t,v=a[l]?c:`en`,{freq:y,interval:b=1,count:x,until:S,byDay:C,byHour:w,byMinute:T,bySecond:E,byMonth:D,byMonthDay:O,byYearDay:k,byWeekNo:A,bySetPos:j,wkst:M,rDate:N,exDate:P}=s,F=y===`YEARLY`||y===`MONTHLY`||y===`WEEKLY`||y===`DAILY`,I=!!(w||T||E),L=s.dtstart.hour!==0||s.dtstart.minute!==0||s.dtstart.second!==0,R=F&&(I||L),z=C??(y===`WEEKLY`?[m(s.dtstart)]:void 0),B=w??(R?[s.dtstart.hour]:void 0),V=B?T??[s.dtstart.minute]:T,H=B?E??[s.dtstart.second]:E,U=[_.words.every],W={YEARLY:`year`,MONTHLY:`month`,WEEKLY:`week`,DAILY:`day`,HOURLY:`hour`,MINUTELY:`minute`,SECONDLY:`second`}[y],G=_.units[W],K=z?.map(e=>e.toUpperCase()),q=K&&K.length===o.length&&o.every(e=>K.includes(e)),J=K&&K.length===e.r.length&&e.r.every(e=>K.includes(e));if(y===`WEEKLY`&&b===1&&q?U.push(_.words.weekday):y===`WEEKLY`&&b===1&&J?U.push(_.units.day.singular):b===1?U.push(G.singular):U.push(b.toString(),G.plural),(y===`WEEKLY`&&z&&!q&&!J||z&&y!==`WEEKLY`)&&U.push(_.words.on,d(z,e=>f(e,_),_.words.and)),D&&U.push(_.words.in,d(D,e=>_.monthNames[e-1],_.words.and)),O&&U.push(_.words.on_the,d(O,e=>u(e,_),_.words.and),_.words.day_of_month),k&&U.push(_.words.on_the,d(k,e=>u(e,_),_.words.and),_.words.day_of_year),A&&U.push(_.words.in_week,d(A,e=>e.toString(),_.words.and)),B){let e=V??[0],t=H??[0],n=B.flatMap(n=>e.flatMap(e=>t.map(t=>p(s.dtstart,v,n,e,t))));U.push(_.words.at,d(n,void 0,_.words.and)),i.excludeTzAbbreviation||U.push(h(s.dtstart,v))}if(!B&&V&&U.push(_.words.at_minute,d(V,void 0,_.words.and)),!B&&!V&&H&&U.push(_.words.at_second,d(H,void 0,_.words.and)),i.includeDtstart&&U.push(_.words.starting_from,g(s.dtstart,v)),S?U.push(_.words.until,g(S,v)):x!==void 0&&U.push(_.words.for,x.toString(),x===1?_.words.time:_.words.times),j&&U.push(_.words.on_the,d(j,e=>u(e,_),_.words.and),_.words.instance),M){let e=f(M,_);U.push(_.words.week_starts_on,e)}if(N&&N.length&&U.push(_.words.with,`${N.length}`,N.length===1?_.words.additional_date:_.words.additional_dates),P&&P.length&&U.push(_.words.excluding,`${P.length}`,P.length===1?_.words.date:_.words.dates),s.rscale){let e=s.rscale,t=s.skip;U.push(`(RSCALE=${e}${t?`;SKIP=${t}`:``})`)}return U.join(` `)}exports.toText=_;
package/dist/totext.js CHANGED
@@ -1 +1 @@
1
- import{r as e,t}from"./src-OdJ9kyVI.js";const n={weekdayNames:[`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`,`Sunday`],monthNames:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],units:{year:{singular:`year`,plural:`years`},month:{singular:`month`,plural:`months`},week:{singular:`week`,plural:`weeks`},day:{singular:`day`,plural:`days`},hour:{singular:`hour`,plural:`hours`},minute:{singular:`minute`,plural:`minutes`},second:{singular:`second`,plural:`seconds`}},words:{every:`every`,weekday:`weekday`,on:`on`,in:`in`,on_the:`on the`,day_of_month:`day of the month`,day_of_year:`day of the year`,in_week:`in week`,at:`at`,at_minute:`at minute`,at_second:`at second`,until:`until`,for:`for`,time:`time`,times:`times`,instance:`instance`,week_starts_on:`week starts on`,with:`with`,additional_date:`additional date`,additional_dates:`additional dates`,excluding:`excluding`,date:`date`,dates:`dates`,and:`and`,last:`last`,starting_from:`starting from`},ordinal:e=>{let t=Math.abs(e),n=t%10==1&&t%100!=11?`st`:t%10==2&&t%100!=12?`nd`:t%10==3&&t%100!=13?`rd`:`th`;return e<0?`last`:`${t}${n}`}},r={en:n,de:{weekdayNames:[`Montag`,`Dienstag`,`Mittwoch`,`Donnerstag`,`Freitag`,`Samstag`,`Sonntag`],monthNames:[`Januar`,`Februar`,`März`,`April`,`Mai`,`Juni`,`Juli`,`August`,`September`,`Oktober`,`November`,`Dezember`],units:{year:{singular:`Jahr`,plural:`Jahre`},month:{singular:`Monat`,plural:`Monate`},week:{singular:`Woche`,plural:`Wochen`},day:{singular:`Tag`,plural:`Tage`},hour:{singular:`Stunde`,plural:`Stunden`},minute:{singular:`Minute`,plural:`Minuten`},second:{singular:`Sekunde`,plural:`Sekunden`}},words:{every:`jede/n/s`,weekday:`Werktag`,on:`am`,in:`im`,on_the:`am`,day_of_month:`Tag des Monats`,day_of_year:`Tag des Jahres`,in_week:`in Kalenderwoche`,at:`um`,at_minute:`in Minute`,at_second:`in Sekunde`,until:`bis`,for:`für`,time:`Mal`,times:`Mal`,instance:`Vorkommen`,week_starts_on:`Woche beginnt am`,with:`mit`,additional_date:`zusätzlichem Datum`,additional_dates:`zusätzlichen Daten`,excluding:`ohne`,date:`Datum`,dates:`Daten`,and:`und`,last:`letzter`,starting_from:`beginnend am`},ordinal:e=>e<0?`letzten`:`${Math.abs(e)}.`},es:{weekdayNames:[`lunes`,`martes`,`miércoles`,`jueves`,`viernes`,`sábado`,`domingo`],monthNames:[`enero`,`febrero`,`marzo`,`abril`,`mayo`,`junio`,`julio`,`agosto`,`septiembre`,`octubre`,`noviembre`,`diciembre`],units:{year:{singular:`año`,plural:`años`},month:{singular:`mes`,plural:`meses`},week:{singular:`semana`,plural:`semanas`},day:{singular:`día`,plural:`días`},hour:{singular:`hora`,plural:`horas`},minute:{singular:`minuto`,plural:`minutos`},second:{singular:`segundo`,plural:`segundos`}},words:{every:`cada`,weekday:`día de la semana`,on:`en`,in:`en`,on_the:`el`,day_of_month:`día del mes`,day_of_year:`día del año`,in_week:`en la semana`,at:`a las`,at_minute:`en el minuto`,at_second:`en el segundo`,until:`hasta`,for:`durante`,time:`vez`,times:`veces`,instance:`ocasión`,week_starts_on:`la semana comienza el`,with:`con`,additional_date:`fecha adicional`,additional_dates:`fechas adicionales`,excluding:`excluyendo`,date:`fecha`,dates:`fechas`,and:`y`,last:`último`,starting_from:`a partir de`},ordinal:e=>e<0?`último`:`${Math.abs(e)}º`},hi:{weekdayNames:[`सोमवार`,`मंगलवार`,`बुधवार`,`गुरुवार`,`शुक्रवार`,`शनिवार`,`रविवार`],monthNames:[`जनवरी`,`फरवरी`,`मार्च`,`अप्रैल`,`मई`,`जून`,`जुलाई`,`अगस्त`,`सितंबर`,`अक्टूबर`,`नवंबर`,`दिसंबर`],units:{year:{singular:`साल`,plural:`साल`},month:{singular:`महीना`,plural:`महीने`},week:{singular:`सप्ताह`,plural:`सप्ताह`},day:{singular:`दिन`,plural:`दिन`},hour:{singular:`घंटा`,plural:`घंटे`},minute:{singular:`मिनट`,plural:`मिनट`},second:{singular:`सेकंड`,plural:`सेकंड`}},words:{every:`हर`,weekday:`सप्ताह का दिन`,on:`को`,in:`में`,on_the:`को`,day_of_month:`महीने का दिन`,day_of_year:`साल का दिन`,in_week:`सप्ताह`,at:`पर`,at_minute:`मिनट पर`,at_second:`सेकंड पर`,until:`तक`,for:`के लिए`,time:`बार`,times:`बार`,instance:`बार`,week_starts_on:`सप्ताह शुरू होता है`,with:`साथ`,additional_date:`अतिरिक्त तारीख`,additional_dates:`अतिरिक्त तारीखें`,excluding:`को छोड़कर`,date:`तारीख`,dates:`तारीखें`,and:`और`,last:`आखिरी`,starting_from:`से शुरू`},ordinal:e=>e<0?`आखिरी`:`${Math.abs(e)}वां`},yue:{weekdayNames:[`星期一`,`星期二`,`星期三`,`星期四`,`星期五`,`星期六`,`星期日`],monthNames:[`一月`,`二月`,`三月`,`四月`,`五月`,`六月`,`七月`,`八月`,`九月`,`十月`,`十一月`,`十二月`],units:{year:{singular:`年`,plural:`年`},month:{singular:`月`,plural:`月`},week:{singular:`週`,plural:`週`},day:{singular:`日`,plural:`日`},hour:{singular:`小時`,plural:`小時`},minute:{singular:`分鐘`,plural:`分鐘`},second:{singular:`秒`,plural:`秒`}},words:{every:`每`,weekday:`平日`,on:`在`,in:`於`,on_the:`在`,day_of_month:`月的日子`,day_of_year:`年的日子`,in_week:`第`,at:`在`,at_minute:`在第`,at_second:`在第`,until:`直到`,for:`共`,time:`次`,times:`次`,instance:`次`,week_starts_on:`星期開始於`,with:`帶有`,additional_date:`額外日期`,additional_dates:`額外日期`,excluding:`排除`,date:`日期`,dates:`日期`,and:`和`,last:`最後`,starting_from:`由`},ordinal:e=>e<0?`最後`:`第${Math.abs(e)}`},ar:{weekdayNames:[`الاثنين`,`الثلاثاء`,`الأربعاء`,`الخميس`,`الجمعة`,`السبت`,`الأحد`],monthNames:[`يناير`,`فبراير`,`مارس`,`أبريل`,`مايو`,`يونيو`,`يوليو`,`أغسطس`,`سبتمبر`,`أكتوبر`,`نوفمبر`,`ديسمبر`],units:{year:{singular:`سنة`,plural:`سنوات`},month:{singular:`شهر`,plural:`أشهر`},week:{singular:`أسبوع`,plural:`أسابيع`},day:{singular:`يوم`,plural:`أيام`},hour:{singular:`ساعة`,plural:`ساعات`},minute:{singular:`دقيقة`,plural:`دقائق`},second:{singular:`ثانية`,plural:`ثواني`}},words:{every:`كل`,weekday:`يوم من أيام الأسبوع`,on:`في`,in:`في`,on_the:`في الـ`,day_of_month:`يوم من الشهر`,day_of_year:`يوم من السنة`,in_week:`في الأسبوع`,at:`عند`,at_minute:`في الدقيقة`,at_second:`في الثانية`,until:`حتى`,for:`لمدة`,time:`مرة`,times:`مرات`,instance:`مرة`,week_starts_on:`يبدأ الأسبوع يوم`,with:`مع`,additional_date:`تاريخ إضافي`,additional_dates:`تواريخ إضافية`,excluding:`باستثناء`,date:`تاريخ`,dates:`تواريخ`,and:`و`,last:`الأخير`,starting_from:`ابتداءً من`},ordinal:e=>{if(e<0)return`الأخير`;let t=Math.abs(e);return{1:`الأول`,2:`الثاني`,3:`الثالث`,4:`الرابع`,5:`الخامس`,6:`السادس`,7:`السابع`,8:`الثامن`,9:`التاسع`,10:`العاشر`,11:`الحادي عشر`,12:`الثاني عشر`,13:`الثالث عشر`}[t]||t.toString()}},he:{weekdayNames:[`יום שני`,`יום שלישי`,`יום רביעי`,`יום חמישי`,`יום שישי`,`יום שבת`,`יום ראשון`],monthNames:[`ינואר`,`פברואר`,`מרץ`,`אפריל`,`מאי`,`יוני`,`יולי`,`אוגוסט`,`ספטמבר`,`אוקטובר`,`נובמבר`,`דצמבר`],units:{year:{singular:`שנה`,plural:`שנים`},month:{singular:`חודש`,plural:`חודשים`},week:{singular:`שבוע`,plural:`שבועות`},day:{singular:`יום`,plural:`ימים`},hour:{singular:`שעה`,plural:`שעות`},minute:{singular:`דקה`,plural:`דקות`},second:{singular:`שניה`,plural:`שניות`}},words:{every:`כל`,weekday:`יום חול`,on:`ב`,in:`ב`,on_the:`ב`,day_of_month:`יום בחודש`,day_of_year:`יום בשנה`,in_week:`בשבוע`,at:`בשעה`,at_minute:`בדקה`,at_second:`בשניה`,until:`עד`,for:`במשך`,time:`פעם`,times:`פעמים`,instance:`פעם`,week_starts_on:`שבוע מתחיל ב`,with:`עם`,additional_date:`תאריך נוסף`,additional_dates:`תאריכים נוספים`,excluding:`למעט`,date:`תאריך`,dates:`תאריכים`,and:`ו`,last:`אחרון`,starting_from:`החל מ`},ordinal:e=>{if(e<0)return`אחרון`;let t=Math.abs(e);return{1:`ראשון`,2:`שני`,3:`שלישי`,4:`רביעי`,5:`חמישי`,6:`שישי`,7:`שביעי`,8:`שמיני`,9:`תשיעי`,10:`עשירי`,11:`אחד עשר`,12:`שנים עשר`,13:`שלושה עשר`}[t]||t.toString()}},zh:{weekdayNames:[`星期一`,`星期二`,`星期三`,`星期四`,`星期五`,`星期六`,`星期日`],monthNames:[`一月`,`二月`,`三月`,`四月`,`五月`,`六月`,`七月`,`八月`,`九月`,`十月`,`十一月`,`十二月`],units:{year:{singular:`年`,plural:`年`},month:{singular:`月`,plural:`月`},week:{singular:`周`,plural:`周`},day:{singular:`日`,plural:`日`},hour:{singular:`小时`,plural:`小时`},minute:{singular:`分钟`,plural:`分钟`},second:{singular:`秒`,plural:`秒`}},words:{every:`每`,weekday:`工作日`,on:`在`,in:`在`,on_the:`在`,day_of_month:`月的日子`,day_of_year:`年的日子`,in_week:`第`,at:`在`,at_minute:`在第`,at_second:`在第`,until:`直到`,for:`共`,time:`次`,times:`次`,instance:`次`,week_starts_on:`星期开始于`,with:`带有`,additional_date:`额外日期`,additional_dates:`额外日期`,excluding:`排除`,date:`日期`,dates:`日期`,and:`和`,last:`最后`,starting_from:`从`},ordinal:e=>e<0?`最后`:`第${Math.abs(e)}`},fr:{weekdayNames:[`lundi`,`mardi`,`mercredi`,`jeudi`,`vendredi`,`samedi`,`dimanche`],monthNames:[`janvier`,`février`,`mars`,`avril`,`mai`,`juin`,`juillet`,`août`,`septembre`,`octobre`,`novembre`,`décembre`],units:{year:{singular:`année`,plural:`ans`},month:{singular:`mois`,plural:`mois`},week:{singular:`semaine`,plural:`semaines`},day:{singular:`jour`,plural:`jours`},hour:{singular:`heure`,plural:`heures`},minute:{singular:`minute`,plural:`minutes`},second:{singular:`seconde`,plural:`secondes`}},words:{every:`chaque`,weekday:`jour de semaine`,on:`le`,in:`dans`,on_the:`le`,day_of_month:`jour du mois`,day_of_year:`jour de l'année`,in_week:`dans la semaine`,at:`à`,at_minute:`à la minute`,at_second:`à la seconde`,until:`jusqu'au`,for:`pendant`,time:`fois`,times:`fois`,instance:`occurrence`,week_starts_on:`la semaine commence le`,with:`avec`,additional_date:`date supplémentaire`,additional_dates:`dates supplémentaires`,excluding:`en excluant`,date:`date`,dates:`dates`,and:`et`,last:`dernier`,starting_from:`à partir du`},ordinal:e=>{let t=Math.abs(e);return e<0?`dernier`:t===1?`1er`:`${t}e`}}},i=typeof process<`u`&&process.env?process.env.TOTEXT_LANGS:void 0,a=i?i.split(`,`).map(e=>e.trim()).filter(Boolean):Object.keys(r),o={};for(let e of a)r[e]&&(o[e]=r[e]);const s=e.slice(0,5),c=RegExp(`^([+-]?\\d+)?(${e.join(`|`)})$`),l=Object.fromEntries(e.map((e,t)=>[e,t]));function u(e){let t=Math.abs(e),n=t%10==1&&t%100!=11?`st`:t%10==2&&t%100!=12?`nd`:t%10==3&&t%100!=13?`rd`:`th`;return e<0?`last`:`${t}${n}`}function d(e,t){return t.ordinal?t.ordinal(e):u(e)}function f(e,t=e=>`${e}`,n){let r=e.map(t);return r.length===1?r[0]:r.slice(0,-1).join(`, `)+` ${n} `+r[r.length-1]}function p(e,t){if(typeof e==`number`)return e.toString();let n=e.toUpperCase().match(c);if(!n)return e;let r=n[1]?parseInt(n[1],10):0,i=l[n[2]],a=t.weekdayNames[i];return r===0?a:r===-1?`${t.words.last} ${a}`:`${d(r,t)} ${a}`}function m(e,t,n,r,i){let a={hour:`numeric`,timeZone:`UTC`};i&&(a.second=`2-digit`),(i||r)&&(a.minute=`2-digit`);let o=new Date(Date.UTC(2e3,0,1,n,r,i));try{return new Intl.DateTimeFormat(t,a).format(o)}catch{return new Intl.DateTimeFormat(`en`,a).format(o)}}function h(t){return e[t.dayOfWeek-1]}function g(e,t){let n={timeZone:e.timeZoneId,timeZoneName:`short`,hour:`numeric`},r;try{r=new Intl.DateTimeFormat(t,n)}catch{r=Intl.DateTimeFormat(`en`,n)}return r.formatToParts(new Date(e.epochMilliseconds)).find(e=>e.type===`timeZoneName`)?.value||e.timeZoneId}function _(e,t){let n={dateStyle:`long`,timeZone:e.timeZoneId},r=new Date(e.epochMilliseconds);try{return new Intl.DateTimeFormat(t,n).format(r)}catch{return new Intl.DateTimeFormat(`en`,n).format(r)}}function v(r,i,a={}){let c=(typeof r==`string`?new t({rruleString:r}):r).options(),l=i??Intl.DateTimeFormat().resolvedOptions().locale,u=l.split(`-`)[0],v=o[u]||n,y=o[u]?l:`en`,{freq:b,interval:x=1,count:S,until:C,byDay:w,byHour:T,byMinute:E,bySecond:D,byMonth:O,byMonthDay:k,byYearDay:A,byWeekNo:j,bySetPos:M,wkst:N,rDate:P,exDate:F}=c,I=b===`YEARLY`||b===`MONTHLY`||b===`WEEKLY`||b===`DAILY`,L=!!(T||E||D),R=c.dtstart.hour!==0||c.dtstart.minute!==0||c.dtstart.second!==0,z=I&&(L||R),B=w??(b===`WEEKLY`?[h(c.dtstart)]:void 0),V=T??(z?[c.dtstart.hour]:void 0),H=V?E??[c.dtstart.minute]:E,U=V?D??[c.dtstart.second]:D,W=[v.words.every],G={YEARLY:`year`,MONTHLY:`month`,WEEKLY:`week`,DAILY:`day`,HOURLY:`hour`,MINUTELY:`minute`,SECONDLY:`second`}[b],K=v.units[G],q=B?.map(e=>e.toUpperCase()),J=q&&q.length===s.length&&s.every(e=>q.includes(e)),Y=q&&q.length===e.length&&e.every(e=>q.includes(e));if(b===`WEEKLY`&&x===1&&J?W.push(v.words.weekday):b===`WEEKLY`&&x===1&&Y?W.push(v.units.day.singular):x===1?W.push(K.singular):W.push(x.toString(),K.plural),(b===`WEEKLY`&&B&&!J&&!Y||B&&b!==`WEEKLY`)&&W.push(v.words.on,f(B,e=>p(e,v),v.words.and)),O&&W.push(v.words.in,f(O,e=>v.monthNames[e-1],v.words.and)),k&&W.push(v.words.on_the,f(k,e=>d(e,v),v.words.and),v.words.day_of_month),A&&W.push(v.words.on_the,f(A,e=>d(e,v),v.words.and),v.words.day_of_year),j&&W.push(v.words.in_week,f(j,e=>e.toString(),v.words.and)),V){let e=H??[0],t=U??[0],n=V.flatMap(n=>e.flatMap(e=>t.map(t=>m(c.dtstart,y,n,e,t))));W.push(v.words.at,f(n,void 0,v.words.and)),a.excludeTzAbbreviation||W.push(g(c.dtstart,y))}if(!V&&H&&W.push(v.words.at_minute,f(H,void 0,v.words.and)),!V&&!H&&U&&W.push(v.words.at_second,f(U,void 0,v.words.and)),a.includeDtstart&&W.push(v.words.starting_from,_(c.dtstart,y)),C?W.push(v.words.until,_(C,y)):S!==void 0&&W.push(v.words.for,S.toString(),S===1?v.words.time:v.words.times),M&&W.push(v.words.on_the,f(M,e=>d(e,v),v.words.and),v.words.instance),N){let e=p(N,v);W.push(v.words.week_starts_on,e)}if(P&&P.length&&W.push(v.words.with,`${P.length}`,P.length===1?v.words.additional_date:v.words.additional_dates),F&&F.length&&W.push(v.words.excluding,`${F.length}`,F.length===1?v.words.date:v.words.dates),c.rscale){let e=c.rscale,t=c.skip;W.push(`(RSCALE=${e}${t?`;SKIP=${t}`:``})`)}return W.join(` `)}export{v as toText};
1
+ import{r as e,t}from"./src-C8UqcHkR.js";const n={weekdayNames:[`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`,`Sunday`],monthNames:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],units:{year:{singular:`year`,plural:`years`},month:{singular:`month`,plural:`months`},week:{singular:`week`,plural:`weeks`},day:{singular:`day`,plural:`days`},hour:{singular:`hour`,plural:`hours`},minute:{singular:`minute`,plural:`minutes`},second:{singular:`second`,plural:`seconds`}},words:{every:`every`,weekday:`weekday`,on:`on`,in:`in`,on_the:`on the`,day_of_month:`day of the month`,day_of_year:`day of the year`,in_week:`in week`,at:`at`,at_minute:`at minute`,at_second:`at second`,until:`until`,for:`for`,time:`time`,times:`times`,instance:`instance`,week_starts_on:`week starts on`,with:`with`,additional_date:`additional date`,additional_dates:`additional dates`,excluding:`excluding`,date:`date`,dates:`dates`,and:`and`,last:`last`,starting_from:`starting from`},ordinal:e=>{let t=Math.abs(e),n=t%10==1&&t%100!=11?`st`:t%10==2&&t%100!=12?`nd`:t%10==3&&t%100!=13?`rd`:`th`;return e<0?`last`:`${t}${n}`}},r={en:n,de:{weekdayNames:[`Montag`,`Dienstag`,`Mittwoch`,`Donnerstag`,`Freitag`,`Samstag`,`Sonntag`],monthNames:[`Januar`,`Februar`,`März`,`April`,`Mai`,`Juni`,`Juli`,`August`,`September`,`Oktober`,`November`,`Dezember`],units:{year:{singular:`Jahr`,plural:`Jahre`},month:{singular:`Monat`,plural:`Monate`},week:{singular:`Woche`,plural:`Wochen`},day:{singular:`Tag`,plural:`Tage`},hour:{singular:`Stunde`,plural:`Stunden`},minute:{singular:`Minute`,plural:`Minuten`},second:{singular:`Sekunde`,plural:`Sekunden`}},words:{every:`jede/n/s`,weekday:`Werktag`,on:`am`,in:`im`,on_the:`am`,day_of_month:`Tag des Monats`,day_of_year:`Tag des Jahres`,in_week:`in Kalenderwoche`,at:`um`,at_minute:`in Minute`,at_second:`in Sekunde`,until:`bis`,for:`für`,time:`Mal`,times:`Mal`,instance:`Vorkommen`,week_starts_on:`Woche beginnt am`,with:`mit`,additional_date:`zusätzlichem Datum`,additional_dates:`zusätzlichen Daten`,excluding:`ohne`,date:`Datum`,dates:`Daten`,and:`und`,last:`letzter`,starting_from:`beginnend am`},ordinal:e=>e<0?`letzten`:`${Math.abs(e)}.`},es:{weekdayNames:[`lunes`,`martes`,`miércoles`,`jueves`,`viernes`,`sábado`,`domingo`],monthNames:[`enero`,`febrero`,`marzo`,`abril`,`mayo`,`junio`,`julio`,`agosto`,`septiembre`,`octubre`,`noviembre`,`diciembre`],units:{year:{singular:`año`,plural:`años`},month:{singular:`mes`,plural:`meses`},week:{singular:`semana`,plural:`semanas`},day:{singular:`día`,plural:`días`},hour:{singular:`hora`,plural:`horas`},minute:{singular:`minuto`,plural:`minutos`},second:{singular:`segundo`,plural:`segundos`}},words:{every:`cada`,weekday:`día de la semana`,on:`en`,in:`en`,on_the:`el`,day_of_month:`día del mes`,day_of_year:`día del año`,in_week:`en la semana`,at:`a las`,at_minute:`en el minuto`,at_second:`en el segundo`,until:`hasta`,for:`durante`,time:`vez`,times:`veces`,instance:`ocasión`,week_starts_on:`la semana comienza el`,with:`con`,additional_date:`fecha adicional`,additional_dates:`fechas adicionales`,excluding:`excluyendo`,date:`fecha`,dates:`fechas`,and:`y`,last:`último`,starting_from:`a partir de`},ordinal:e=>e<0?`último`:`${Math.abs(e)}º`},hi:{weekdayNames:[`सोमवार`,`मंगलवार`,`बुधवार`,`गुरुवार`,`शुक्रवार`,`शनिवार`,`रविवार`],monthNames:[`जनवरी`,`फरवरी`,`मार्च`,`अप्रैल`,`मई`,`जून`,`जुलाई`,`अगस्त`,`सितंबर`,`अक्टूबर`,`नवंबर`,`दिसंबर`],units:{year:{singular:`साल`,plural:`साल`},month:{singular:`महीना`,plural:`महीने`},week:{singular:`सप्ताह`,plural:`सप्ताह`},day:{singular:`दिन`,plural:`दिन`},hour:{singular:`घंटा`,plural:`घंटे`},minute:{singular:`मिनट`,plural:`मिनट`},second:{singular:`सेकंड`,plural:`सेकंड`}},words:{every:`हर`,weekday:`सप्ताह का दिन`,on:`को`,in:`में`,on_the:`को`,day_of_month:`महीने का दिन`,day_of_year:`साल का दिन`,in_week:`सप्ताह`,at:`पर`,at_minute:`मिनट पर`,at_second:`सेकंड पर`,until:`तक`,for:`के लिए`,time:`बार`,times:`बार`,instance:`बार`,week_starts_on:`सप्ताह शुरू होता है`,with:`साथ`,additional_date:`अतिरिक्त तारीख`,additional_dates:`अतिरिक्त तारीखें`,excluding:`को छोड़कर`,date:`तारीख`,dates:`तारीखें`,and:`और`,last:`आखिरी`,starting_from:`से शुरू`},ordinal:e=>e<0?`आखिरी`:`${Math.abs(e)}वां`},yue:{weekdayNames:[`星期一`,`星期二`,`星期三`,`星期四`,`星期五`,`星期六`,`星期日`],monthNames:[`一月`,`二月`,`三月`,`四月`,`五月`,`六月`,`七月`,`八月`,`九月`,`十月`,`十一月`,`十二月`],units:{year:{singular:`年`,plural:`年`},month:{singular:`月`,plural:`月`},week:{singular:`週`,plural:`週`},day:{singular:`日`,plural:`日`},hour:{singular:`小時`,plural:`小時`},minute:{singular:`分鐘`,plural:`分鐘`},second:{singular:`秒`,plural:`秒`}},words:{every:`每`,weekday:`平日`,on:`在`,in:`於`,on_the:`在`,day_of_month:`月的日子`,day_of_year:`年的日子`,in_week:`第`,at:`在`,at_minute:`在第`,at_second:`在第`,until:`直到`,for:`共`,time:`次`,times:`次`,instance:`次`,week_starts_on:`星期開始於`,with:`帶有`,additional_date:`額外日期`,additional_dates:`額外日期`,excluding:`排除`,date:`日期`,dates:`日期`,and:`和`,last:`最後`,starting_from:`由`},ordinal:e=>e<0?`最後`:`第${Math.abs(e)}`},ar:{weekdayNames:[`الاثنين`,`الثلاثاء`,`الأربعاء`,`الخميس`,`الجمعة`,`السبت`,`الأحد`],monthNames:[`يناير`,`فبراير`,`مارس`,`أبريل`,`مايو`,`يونيو`,`يوليو`,`أغسطس`,`سبتمبر`,`أكتوبر`,`نوفمبر`,`ديسمبر`],units:{year:{singular:`سنة`,plural:`سنوات`},month:{singular:`شهر`,plural:`أشهر`},week:{singular:`أسبوع`,plural:`أسابيع`},day:{singular:`يوم`,plural:`أيام`},hour:{singular:`ساعة`,plural:`ساعات`},minute:{singular:`دقيقة`,plural:`دقائق`},second:{singular:`ثانية`,plural:`ثواني`}},words:{every:`كل`,weekday:`يوم من أيام الأسبوع`,on:`في`,in:`في`,on_the:`في الـ`,day_of_month:`يوم من الشهر`,day_of_year:`يوم من السنة`,in_week:`في الأسبوع`,at:`عند`,at_minute:`في الدقيقة`,at_second:`في الثانية`,until:`حتى`,for:`لمدة`,time:`مرة`,times:`مرات`,instance:`مرة`,week_starts_on:`يبدأ الأسبوع يوم`,with:`مع`,additional_date:`تاريخ إضافي`,additional_dates:`تواريخ إضافية`,excluding:`باستثناء`,date:`تاريخ`,dates:`تواريخ`,and:`و`,last:`الأخير`,starting_from:`ابتداءً من`},ordinal:e=>{if(e<0)return`الأخير`;let t=Math.abs(e);return{1:`الأول`,2:`الثاني`,3:`الثالث`,4:`الرابع`,5:`الخامس`,6:`السادس`,7:`السابع`,8:`الثامن`,9:`التاسع`,10:`العاشر`,11:`الحادي عشر`,12:`الثاني عشر`,13:`الثالث عشر`}[t]||t.toString()}},he:{weekdayNames:[`יום שני`,`יום שלישי`,`יום רביעי`,`יום חמישי`,`יום שישי`,`יום שבת`,`יום ראשון`],monthNames:[`ינואר`,`פברואר`,`מרץ`,`אפריל`,`מאי`,`יוני`,`יולי`,`אוגוסט`,`ספטמבר`,`אוקטובר`,`נובמבר`,`דצמבר`],units:{year:{singular:`שנה`,plural:`שנים`},month:{singular:`חודש`,plural:`חודשים`},week:{singular:`שבוע`,plural:`שבועות`},day:{singular:`יום`,plural:`ימים`},hour:{singular:`שעה`,plural:`שעות`},minute:{singular:`דקה`,plural:`דקות`},second:{singular:`שניה`,plural:`שניות`}},words:{every:`כל`,weekday:`יום חול`,on:`ב`,in:`ב`,on_the:`ב`,day_of_month:`יום בחודש`,day_of_year:`יום בשנה`,in_week:`בשבוע`,at:`בשעה`,at_minute:`בדקה`,at_second:`בשניה`,until:`עד`,for:`במשך`,time:`פעם`,times:`פעמים`,instance:`פעם`,week_starts_on:`שבוע מתחיל ב`,with:`עם`,additional_date:`תאריך נוסף`,additional_dates:`תאריכים נוספים`,excluding:`למעט`,date:`תאריך`,dates:`תאריכים`,and:`ו`,last:`אחרון`,starting_from:`החל מ`},ordinal:e=>{if(e<0)return`אחרון`;let t=Math.abs(e);return{1:`ראשון`,2:`שני`,3:`שלישי`,4:`רביעי`,5:`חמישי`,6:`שישי`,7:`שביעי`,8:`שמיני`,9:`תשיעי`,10:`עשירי`,11:`אחד עשר`,12:`שנים עשר`,13:`שלושה עשר`}[t]||t.toString()}},zh:{weekdayNames:[`星期一`,`星期二`,`星期三`,`星期四`,`星期五`,`星期六`,`星期日`],monthNames:[`一月`,`二月`,`三月`,`四月`,`五月`,`六月`,`七月`,`八月`,`九月`,`十月`,`十一月`,`十二月`],units:{year:{singular:`年`,plural:`年`},month:{singular:`月`,plural:`月`},week:{singular:`周`,plural:`周`},day:{singular:`日`,plural:`日`},hour:{singular:`小时`,plural:`小时`},minute:{singular:`分钟`,plural:`分钟`},second:{singular:`秒`,plural:`秒`}},words:{every:`每`,weekday:`工作日`,on:`在`,in:`在`,on_the:`在`,day_of_month:`月的日子`,day_of_year:`年的日子`,in_week:`第`,at:`在`,at_minute:`在第`,at_second:`在第`,until:`直到`,for:`共`,time:`次`,times:`次`,instance:`次`,week_starts_on:`星期开始于`,with:`带有`,additional_date:`额外日期`,additional_dates:`额外日期`,excluding:`排除`,date:`日期`,dates:`日期`,and:`和`,last:`最后`,starting_from:`从`},ordinal:e=>e<0?`最后`:`第${Math.abs(e)}`},fr:{weekdayNames:[`lundi`,`mardi`,`mercredi`,`jeudi`,`vendredi`,`samedi`,`dimanche`],monthNames:[`janvier`,`février`,`mars`,`avril`,`mai`,`juin`,`juillet`,`août`,`septembre`,`octobre`,`novembre`,`décembre`],units:{year:{singular:`année`,plural:`ans`},month:{singular:`mois`,plural:`mois`},week:{singular:`semaine`,plural:`semaines`},day:{singular:`jour`,plural:`jours`},hour:{singular:`heure`,plural:`heures`},minute:{singular:`minute`,plural:`minutes`},second:{singular:`seconde`,plural:`secondes`}},words:{every:`chaque`,weekday:`jour de semaine`,on:`le`,in:`dans`,on_the:`le`,day_of_month:`jour du mois`,day_of_year:`jour de l'année`,in_week:`dans la semaine`,at:`à`,at_minute:`à la minute`,at_second:`à la seconde`,until:`jusqu'au`,for:`pendant`,time:`fois`,times:`fois`,instance:`occurrence`,week_starts_on:`la semaine commence le`,with:`avec`,additional_date:`date supplémentaire`,additional_dates:`dates supplémentaires`,excluding:`en excluant`,date:`date`,dates:`dates`,and:`et`,last:`dernier`,starting_from:`à partir du`},ordinal:e=>{let t=Math.abs(e);return e<0?`dernier`:t===1?`1er`:`${t}e`}}},i=typeof process<`u`&&process.env?process.env.TOTEXT_LANGS:void 0,a=i?i.split(`,`).map(e=>e.trim()).filter(Boolean):Object.keys(r),o={};for(let e of a)r[e]&&(o[e]=r[e]);const s=e.slice(0,5),c=RegExp(`^([+-]?\\d+)?(${e.join(`|`)})$`),l=Object.fromEntries(e.map((e,t)=>[e,t]));function u(e){let t=Math.abs(e),n=t%10==1&&t%100!=11?`st`:t%10==2&&t%100!=12?`nd`:t%10==3&&t%100!=13?`rd`:`th`;return e<0?`last`:`${t}${n}`}function d(e,t){return t.ordinal?t.ordinal(e):u(e)}function f(e,t=e=>`${e}`,n){let r=e.map(t);return r.length===1?r[0]:r.slice(0,-1).join(`, `)+` ${n} `+r[r.length-1]}function p(e,t){if(typeof e==`number`)return e.toString();let n=e.toUpperCase().match(c);if(!n)return e;let r=n[1]?parseInt(n[1],10):0,i=l[n[2]],a=t.weekdayNames[i];return r===0?a:r===-1?`${t.words.last} ${a}`:`${d(r,t)} ${a}`}function m(e,t,n,r,i){let a={hour:`numeric`,timeZone:`UTC`};i&&(a.second=`2-digit`),(i||r)&&(a.minute=`2-digit`);let o=new Date(Date.UTC(2e3,0,1,n,r,i));try{return new Intl.DateTimeFormat(t,a).format(o)}catch{return new Intl.DateTimeFormat(`en`,a).format(o)}}function h(t){return e[t.dayOfWeek-1]}function g(e,t){let n={timeZone:e.timeZoneId,timeZoneName:`short`,hour:`numeric`},r;try{r=new Intl.DateTimeFormat(t,n)}catch{r=Intl.DateTimeFormat(`en`,n)}return r.formatToParts(new Date(e.epochMilliseconds)).find(e=>e.type===`timeZoneName`)?.value||e.timeZoneId}function _(e,t){let n={dateStyle:`long`,timeZone:e.timeZoneId},r=new Date(e.epochMilliseconds);try{return new Intl.DateTimeFormat(t,n).format(r)}catch{return new Intl.DateTimeFormat(`en`,n).format(r)}}function v(r,i,a={}){let c=(typeof r==`string`?new t({rruleString:r}):r).options(),l=i??Intl.DateTimeFormat().resolvedOptions().locale,u=l.split(`-`)[0],v=o[u]||n,y=o[u]?l:`en`,{freq:b,interval:x=1,count:S,until:C,byDay:w,byHour:T,byMinute:E,bySecond:D,byMonth:O,byMonthDay:k,byYearDay:A,byWeekNo:j,bySetPos:M,wkst:N,rDate:P,exDate:F}=c,I=b===`YEARLY`||b===`MONTHLY`||b===`WEEKLY`||b===`DAILY`,L=!!(T||E||D),R=c.dtstart.hour!==0||c.dtstart.minute!==0||c.dtstart.second!==0,z=I&&(L||R),B=w??(b===`WEEKLY`?[h(c.dtstart)]:void 0),V=T??(z?[c.dtstart.hour]:void 0),H=V?E??[c.dtstart.minute]:E,U=V?D??[c.dtstart.second]:D,W=[v.words.every],G={YEARLY:`year`,MONTHLY:`month`,WEEKLY:`week`,DAILY:`day`,HOURLY:`hour`,MINUTELY:`minute`,SECONDLY:`second`}[b],K=v.units[G],q=B?.map(e=>e.toUpperCase()),J=q&&q.length===s.length&&s.every(e=>q.includes(e)),Y=q&&q.length===e.length&&e.every(e=>q.includes(e));if(b===`WEEKLY`&&x===1&&J?W.push(v.words.weekday):b===`WEEKLY`&&x===1&&Y?W.push(v.units.day.singular):x===1?W.push(K.singular):W.push(x.toString(),K.plural),(b===`WEEKLY`&&B&&!J&&!Y||B&&b!==`WEEKLY`)&&W.push(v.words.on,f(B,e=>p(e,v),v.words.and)),O&&W.push(v.words.in,f(O,e=>v.monthNames[e-1],v.words.and)),k&&W.push(v.words.on_the,f(k,e=>d(e,v),v.words.and),v.words.day_of_month),A&&W.push(v.words.on_the,f(A,e=>d(e,v),v.words.and),v.words.day_of_year),j&&W.push(v.words.in_week,f(j,e=>e.toString(),v.words.and)),V){let e=H??[0],t=U??[0],n=V.flatMap(n=>e.flatMap(e=>t.map(t=>m(c.dtstart,y,n,e,t))));W.push(v.words.at,f(n,void 0,v.words.and)),a.excludeTzAbbreviation||W.push(g(c.dtstart,y))}if(!V&&H&&W.push(v.words.at_minute,f(H,void 0,v.words.and)),!V&&!H&&U&&W.push(v.words.at_second,f(U,void 0,v.words.and)),a.includeDtstart&&W.push(v.words.starting_from,_(c.dtstart,y)),C?W.push(v.words.until,_(C,y)):S!==void 0&&W.push(v.words.for,S.toString(),S===1?v.words.time:v.words.times),M&&W.push(v.words.on_the,f(M,e=>d(e,v),v.words.and),v.words.instance),N){let e=p(N,v);W.push(v.words.week_starts_on,e)}if(P&&P.length&&W.push(v.words.with,`${P.length}`,P.length===1?v.words.additional_date:v.words.additional_dates),F&&F.length&&W.push(v.words.excluding,`${F.length}`,F.length===1?v.words.date:v.words.dates),c.rscale){let e=c.rscale,t=c.skip;W.push(`(RSCALE=${e}${t?`;SKIP=${t}`:``})`)}return W.join(` `)}export{v as toText};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rrule-temporal",
3
- "version": "2.2.5",
3
+ "version": "2.2.7",
4
4
  "description": "Recurrence rule (rrule) processing using Temporal PlainDate/PlainDateTime, with cross-timezone and cross-calendar rrule support",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",