cronli5 0.1.7 → 0.2.0

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.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,49 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.2.0]
10
+
11
+ A major naturalness pass for English, validated by blind native-speaker
12
+ (math-inclined) panels: mean idiom rose 3.60 → 4.15 and clarity 3.75 → 4.20 on
13
+ full-space random samples, with zero correctness regressions. The full
14
+ panel-validated naturalness specification (`test/lang/en/core-set.js` +
15
+ `known-issues.js`, 165 cases) is now un-skipped and runs in CI as the contract
16
+ for the prose. Changes are to the English default dialect; other languages are
17
+ unchanged, and round-trip + the metamorphic invariant guard every rewrite.
18
+
19
+ ### Changed
20
+
21
+ - **OR-day now reads as a union condition-frame.** When both day-of-month and
22
+ day-of-week are restricted, cron fires on the *union* of days. The old "on the
23
+ 1st or on Friday" read as alternatives (and "and" would read as intersection);
24
+ it now reads "[in MONTH] [at TIME] whenever the day is the 1st or a Friday" — a
25
+ predicate over the day that reads as a union for naive, logical, and technical
26
+ readers. (~70% of expressions.)
27
+ - **Hour ranges read as an until-window:** "from 9 a.m. until 6 p.m." (was
28
+ "through 5 p.m."); hour *steps* keep "through K" (the endpoint is a real fire).
29
+ - **Coarser fields confine under a finer cadence:** "every second during minute
30
+ :00 of every hour", "every second of the midnight hour", "every two minutes
31
+ from midnight until 1 a.m."; a redundant unrestricted finer field drops.
32
+ - **Trailing weekdays pluralize** ("on Mondays"); weekday ranges keep "on Monday
33
+ through Friday". Weekday lists order Monday-first.
34
+ - **"of the month" drops under an explicit month** ("on the last Friday in
35
+ January"); a month range keeps "of each month from January through March".
36
+ - Minute lists numeralize ("4, 6, and 9 minutes past the hour"); a seconds range
37
+ digitizes its bounds ("from 0 through 10 past the minute"); a contiguous hour
38
+ run with an outlier reads "from 9 a.m. until 9 p.m. plus 10 p.m."; a year range
39
+ reads "2030 through 2035" and a stepped year "every second, every other year";
40
+ the gb day-first multi-month fold no longer garden-paths the day.
41
+
42
+ ### Added
43
+
44
+ - The English naturalness specification (`core-set.js` + `known-issues.js`, 165
45
+ cases) is un-skipped and runs in CI as the prose contract.
46
+
47
+ ### Known limitations
48
+
49
+ - Genuinely dense crons (three stacked sub-hour cadences) remain inherently
50
+ verbose (~3/5 naturalness); a structural rewrite was scoped and deferred.
51
+
9
52
  ## [0.1.7]
10
53
 
11
54
  A correctness and clarity pass driven by blind, math-inclined native-speaker
package/README.md CHANGED
@@ -247,16 +247,16 @@ cronli5('0 12 * 6,12 *'); // 'every day in June and December at noon'
247
247
 
248
248
  // Ranges (wrap-around ranges describe overnight and weekend windows)
249
249
  cronli5('0-29 * * * *'); // 'every minute from 0 through 29 past the hour'
250
- cronli5('0 9-17 * * *'); // 'every hour from 9 a.m. through 5 p.m.'
250
+ cronli5('0 9-17 * * *'); // 'every hour from 9 a.m. until 6 p.m.'
251
251
  cronli5('0 0 1-15 * *'); // 'on the 1st through 15th at midnight'
252
- cronli5('0 22-2 * * *'); // 'every hour from 10 p.m. through 2 a.m.'
252
+ cronli5('0 22-2 * * *'); // 'every hour from 10 p.m. until 3 a.m.'
253
253
  cronli5('0 0 * * FRI-MON'); // 'every Friday through Monday at midnight'
254
254
 
255
255
  // Compound patterns
256
256
  cronli5('0,30 9 * * *'); // 'every day at 9 a.m. and 9:30 a.m.'
257
- cronli5('*/15 9-17 * * *'); // 'every 15 minutes from 9 a.m. through 5:45 p.m.'
257
+ cronli5('*/15 9-17 * * *'); // 'every 15 minutes from 9 a.m. until 6 p.m.'
258
258
  cronli5('30 9-17 * * *');
259
- // 'at 30 minutes past the hour from 9 a.m. through 5 p.m.'
259
+ // 'at 30 minutes past the hour from 9 a.m. until 6 p.m.'
260
260
  cronli5('0 12 1 1 *'); // 'on January 1 at noon'
261
261
  cronli5('0 * 13 * *'); // 'every hour on the 13th'
262
262
 
@@ -279,7 +279,7 @@ pattern — `5,10 30 9 * * MON` — in every language:
279
279
  <!-- BEGIN GENERATED: cronstrue-head-to-head -->
280
280
  | Language | cronli5 | cRonstrue 3.14.0 |
281
281
  | --- | --- | --- |
282
- | English | at five and ten seconds past the minute, every Monday at 9:30 a.m. | At 5 and 10 seconds past the minute, at 30 minutes past the hour, at 09:00 AM, only on Monday |
282
+ | English | at 5 and 10 seconds past the minute, every Monday at 9:30 a.m. | At 5 and 10 seconds past the minute, at 30 minutes past the hour, at 09:00 AM, only on Monday |
283
283
  | German | in den Sekunden 5 und 10, um 9:30 Uhr montags | Bei Sekunde 5 und 10, bei Minute 30, um 09:00, nur jeden Montag |
284
284
  | Spanish | los lunes, en los segundos 5 y 10 de las 09:30 | A los 5 y 10 segundos del minuto, a los 30 minutos de la hora, a las 09:00, sólo el lunes |
285
285
  | Finnish | 5 ja 10 sekunnin kohdalla, maanantaisin klo 9.30 | 5 ja 10 sekunnnin jälkeen, 30 minuuttia yli, klo 09:00, vain maanantai |
package/cronli5.min.js CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";(()=>{var ue={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6},se={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12},y={second:{cyclic:!0,max:59,min:0,top:59},minute:{cyclic:!0,max:59,min:0,top:59},hour:{cyclic:!0,max:23,min:0,top:23},date:{aliases:{"?":"*"},cyclic:!0,max:31,min:1,top:31},month:{cyclic:!0,max:12,min:1,numbers:se,top:12},weekday:{aliases:{"?":"*",L:"6"},cyclic:!0,max:7,min:0,numbers:ue,top:6},year:{max:9999,min:1970}},N=["second","minute","hour","date","month","weekday","year"],K={"@annually":"0 0 1 1 *","@yearly":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@midnight":"0 0 * * *","@hourly":"0 * * * *"},T=6;function a(n,t){return(""+n).indexOf(t)!==-1}function D(n){return Array.from(new Set(n))}function E(n){return/^\d+$/.test(n)}function bn(n){if(n.length<5)return null;let t=n[1]-n[0];if(t<2)return null;for(let e=2;e<n.length;e+=1)if(n[e]-n[e-1]!==t)return null;return{start:n[0],interval:t,last:n[n.length-1]}}function yn(n){return n===0?7:n}function Sn(n){let t=n.flatMap(function(i){return i.kind==="step"?i.fires.map(function(u){return{kind:"single",value:""+u}}):[i]});function e(r){return r.kind==="range"?yn(+r.bounds[0]):yn(+r.value)}return t.map(function(i,o){return[i,o]}).sort(function(i,o){return e(i[0])-e(o[0])||i[1]-o[1]}).map(function(i){return i[0]})}function f(n,t){return E(n)?+n:t[n.toUpperCase()]}function On(n){return N.forEach(function(e){ae(n[e],y[e],e)}),n}function ae(n,t,e){typeof n!="string"&&typeof n!="number"&&kn(n,e);let r=""+n;r!=="*"&&(e==="date"&&x(r)||e==="weekday"&&F(r,t)||r.split(",").forEach(function(o){le(o,t)||kn(o,e)}))}function x(n){if(n==="L"||n==="LW"||n==="WL")return!0;let t=/^L-(\d{1,2})$/.exec(n);if(t)return+t[1]>=1&&+t[1]<=30;let e=/^(\d{1,2})W$|^W(\d{1,2})$/.exec(n);if(e){let r=+(e[1]||e[2]);return r>=1&&r<=31}return!1}function F(n,t){if(/L$/.test(n))return R(n.slice(0,-1),t);let e=n.split("#");return e.length===2?R(e[0],t)&&/^[1-5]$/.test(e[1]):!1}function le(n,t){return a(n,"/")?ce(n,t):a(n,"-")?Nn(n,t):R(n,t)}function ce(n,t){let e=n.split("/");return e.length!==2||!E(e[1])||+e[1]<1?!1:e[0]==="*"||R(e[0],t)||Nn(e[0],t,!0)}function Nn(n,t,e){let r=n.split("-");return r.length!==2||!R(r[0],t)||!R(r[1],t)?!1:t.cyclic&&!e?!0:f(r[0],t.numbers)<=f(r[1],t.numbers)}function R(n,t){return n==="*"?!1:E(n)?+n>=t.min&&+n<=t.max:t.numbers?n.toUpperCase()in t.numbers:!1}function kn(n,t){throw new Error('`cronli5` was passed an invalid field value "'+n+'" for the '+t+" field.")}var me={hour:24,minute:60,second:60};function Rn(n){N.forEach(function(e){let r=y[e].aliases,i=r&&r[""+n[e]];i&&(n[e]=i)})}function Pn(n){return N.forEach(function(e){let r=""+n[e];if(e==="date"&&x(r)||e==="weekday"&&F(r,y[e])){n[e]=r;return}n[e]=fe(r,e,y[e])}),n}function fe(n,t,e){let r=""+n;if(r==="*")return r;let i=me[t],o=r.split(",").map(function(s){return de(vn(ye(be(Se(pe(he(s,e),e),e),e),e,i),e),e)}).join(",").split(",");return o.indexOf("*")!==-1?"*":D(o).sort(function(s,m){return zn(s,e)-zn(m,e)}).join(",")}function de(n,t){if(!t.numbers)return n;let e=n.split("/"),r=e[0].split("-").map(function(o){return ge(o,t)}).join("-");return e.length===2?r+"/"+e[1]:r}function ge(n,t){if(n==="*")return n;let e=f(n,t.numbers);return""+(e>t.top?t.min:e)}function he(n,t){let e=n.split("/");if(!t.cyclic||e.length!==2||+e[1]!=1)return n;let r=e[0];return a(r,"-")?r:r==="*"||f(r,t.numbers)===t.min?"*":r+"-"+t.top}function pe(n,t){let e=n.split("/");if(!t.cyclic||typeof t.top!="number"||e.length!==2||a(e[0],"-"))return n;let r=e[0];return(r==="*"?t.min:f(r,t.numbers))+ +e[1]<=t.top?n:r==="*"?""+t.min:r}function ye(n,t,e){let r=n.split("/");if(typeof e!="number"||r.length!==2||a(r[0],"-"))return n;let i=+r[1],o=r[0]==="*"?t.min:f(r[0]);if(e%i===0&&o<i)return n;let u=[];for(let s=o;s<=t.top;s+=i)u.push(s);return u.join(",")}function be(n,t){let e=n.split("/");return e.length!==2||!a(e[0],"-")?n:vn(e[0],t)==="*"?"*/"+e[1]:n}function vn(n,t){if(typeof t.top!="number"||a(n,"/")||!a(n,"-"))return n;let e=n.split("-"),r=f(e[0],t.numbers),i=f(e[1],t.numbers);if(r>i)return n;let o=t.top,u={};for(let s=r;s<=i;s+=1)u[s>o?t.min:s]=!0;for(let s=t.min;s<=o;s+=1)if(!u[s])return n;return"*"}function Se(n,t){let e=n.split("/")[0];if(!a(e,"-"))return n;let r=e.split("-");return f(r[0],t.numbers)!==f(r[1],t.numbers)?n:r[0]}function zn(n,t){let e=n.split("/")[0].split("-")[0];return e==="*"?t.min:f(e,t.numbers)}function wn(n,t){let e=n instanceof Array;if(n===null||typeof n>"u"||n===""||e&&n.length===0)throw new Error("`cronli5` expects a non-empty cron pattern as the first argument.");if(e)return Cn(n,t);if(typeof n=="object")return ke(n);if(typeof n=="string")return Oe(n,t);throw new Error("`cronli5` was passed an unexpected type.")}function Cn(n,t){if(n.length>7)throw new Error("`cronli5` was passed a cron pattern with more than seven fields.");return!t.seconds&&n.length<(t.years?7:6)&&n.unshift("0"),{second:n[0]||"0",minute:n[1]||"*",hour:n[2]||"*",date:n[3]||"*",month:n[4]||"*",weekday:n[5]||"*",year:n[6]||"*"}}function ke(n){if(!n.second&&!n.minute&&!n.hour)throw new Error("`cronli5` expects that any object being interpreted as a cron pattern have at least one of the following properties: `second`, `minute`, or `hour`");let t=typeof n.second<"u",e=typeof n.minute<"u",r=t?"*":"0",i=t||e?"*":"0";return{second:z(n.second,"0"),minute:z(n.minute,r),hour:z(n.hour,i),date:z(n.date,"*"),month:z(n.month,"*"),weekday:z(n.weekday,"*"),year:z(n.year,"*")}}function z(n,t){return typeof n>"u"?t:n}function Oe(n,t){let e=Ne(n).split(/\s+/);return Cn(e,t)}function Ne(n){let t=n.trim();if(t.charAt(0)!=="@")return n;let e=t.toLowerCase();if(Object.hasOwn(K,e))return K[e];throw new Error("`cronli5` does not recognize the macro `"+t+"`.")}function Tn(n){return n!=="*"&&!a(n,",")&&!a(n,"-")&&!a(n,"/")}function Y(n){return a(n,"-")&&!a(n,",")&&!a(n,"/")}function ze(n){return a(n,"/")&&!a(n,",")}function B(n){return n!=="*"&&!a(n,"-")&&!a(n,"/")}function G(n){return n!=="*"&&!Y(n)&&!ze(n)}function I(n,t,e){let r=[],i=n;for(;i<=e;)r.push(i),i+=t;return r}function xn(n,t,e,r){let i=n.split("/"),o=+i[1];if(a(i[0],"-")){let s=i[0].split("-");return I(f(s[0],r),o,f(s[1],r))}let u=i[0]==="*"?t:f(i[0],r);return I(u,o,e)}function X(n,t,e){let r=[];return n.split(",").forEach(function(o){if(a(o,"/"))r.push(...xn(o,t,e));else if(a(o,"-")){let u=o.split("-");+u[0]<=+u[1]?r.push(...I(+u[0],1,+u[1])):(r.push(...I(+u[0],1,e)),r.push(...I(t,1,+u[1])))}else r.push(+o)}),D(r)}function Re(n){return B(n)?n.split(",").map(Number):[0]}function Pe(n){if(n==="*")return[0,59];if(Y(n)){let t=n.split("-");if(+t[0]<=+t[1])return[+t[0],+t[1]]}return null}function ve(n){return n==="*"?59:Math.max(...X(n,0,59))}function we(n){if(Tn(n)&&n!=="0")return+n}function Ce(n,t){return n==="*"?"wildcard":t==="date"&&x(n)||t==="weekday"&&F(n,y.weekday)?"quartz":a(n,",")?"list":a(n,"/")?"step":a(n,"-")?"range":"single"}function Te(n,t,e){return t==="wildcard"||t==="quartz"?null:n.split(",").map(function(i){if(a(i,"/")){let o=i.split("/");return{fires:xn(i,e.min,e.top,e.numbers),interval:+o[1],kind:"step",startToken:o[0]}}return a(i,"-")?{bounds:i.split("-"),kind:"range"}:{kind:"single",value:i}})}function Fn(n){let t={},e={};N.forEach(function(u){t[u]=Ce(n[u],u),e[u]=Te(n[u],t[u],y[u])});let i={analyses:{clockSecond:we(n.second),lastMinuteFire:ve(n.minute),minuteSpan:Pe(n.minute),segments:e},pattern:n,shapes:t};return{...i,plan:xe(i)}}function xe(n){let{analyses:t,pattern:e,shapes:r}=n;if(e.second!=="0"){let i=Fe(e,r,t);if(i)return i}return In(e,r,t)||Mn(e,r,t)}function Fe(n,t,e){let r=Ie(n,t);return r||(n.hour==="*"&&t.minute==="single"&&n.second!=="*"?{kind:"secondsWithinMinute",singleSecond:t.second==="single"}:t.second==="single"&&B(n.minute)&&G(n.hour)?null:{kind:"composeSeconds",rest:In(n,t,e,!0)||Mn(n,t,e,!0)})}function Ie(n,t){return n.minute!=="*"||n.hour!=="*"?null:n.second==="*"?{kind:"everySecond"}:t.second==="single"?{kind:"secondPastMinute"}:{kind:"standaloneSeconds"}}function In(n,t,e,r=!1){if(t.minute==="step")return{hours:He(n,t,e),kind:"minuteFrequency"};if(t.hour==="single"&&e.minuteSpan)return{hour:+n.hour,kind:"minuteSpanInHour",span:e.minuteSpan};let i=We(n,t);if(i)return i;let o=Me(n,t);if(o)return o;if(n.hour==="*")return Le(n,t,r)}function Z(n){let[t,e]=n.split("/"),r=t==="*"?0:+t;return t.indexOf("-")===-1&&24%+e===0&&r<+e}function Me(n,t){return t.hour!=="step"?null:n.minute==="*"?Z(n.hour)?{form:"wildcard",kind:"minuteSpanAcrossHourStep"}:{form:"wildcard",kind:"minutesAcrossHours",times:M(n.hour)}:t.minute==="range"?{form:"range",kind:"minuteSpanAcrossHourStep"}:t.minute==="list"&&Z(n.hour)?{form:"list",kind:"minuteSpanAcrossHourStep"}:null}function He(n,t,e){if(t.hour==="list")return{kind:"during",times:M(n.hour)};if(t.hour==="range"){let r=n.hour.split("-");return{from:+r[0],kind:"window",last:e.lastMinuteFire,to:+r[1]}}return t.hour==="single"?{from:+n.hour,kind:"window",last:e.lastMinuteFire,to:+n.hour}:t.hour==="step"?Z(n.hour)?{kind:"step"}:{kind:"during",times:M(n.hour)}:{kind:"none"}}function We(n,t){return G(n.hour)?n.minute==="*"?{form:"wildcard",kind:"minutesAcrossHours",times:M(n.hour)}:t.minute==="range"||t.minute==="list"&&a(n.minute,"-")&&!a(n.minute,"/")?{form:t.minute==="range"?"range":"list",kind:"minutesAcrossHours",times:M(n.hour)}:null:null}function Le(n,t,e){if(t.minute==="range")return{kind:"rangeOfMinutes"};if(t.minute==="list")return{kind:"multipleMinutes"};if(n.minute==="*")return{kind:"everyMinute"};if(n.minute!=="0"||e)return{kind:"singleMinute"}}function Mn(n,t,e,r=!1){let i=r&&n.minute==="0";return t.hour==="range"&&!i?je(n,t,e):t.hour==="step"&&n.minute==="0"&&!r?{kind:"hourStep"}:n.hour==="*"&&!i?{kind:"everyHour"}:De(n,e,i)}function je(n,t,e){let r=n.hour.split("-"),i="lead";return n.minute==="*"?i="wildcard":t.minute==="range"&&(i="range"),{boundMinute:t.minute==="range"||t.minute==="list"?null:e.lastMinuteFire,from:+r[0],kind:"hourRange",last:e.lastMinuteFire,minuteForm:i,to:+r[1]}}function De(n,t,e=!1){let r=X(n.hour,0,23),i=Re(n.minute);if(!e&&r.length*i.length>T)return{fold:i.length===1,kind:"compactClockTimes",minute:i[0]};let o=[];return r.forEach(function(s){i.forEach(function(O){o.push({hour:s,minute:O,second:t.clockSecond})})}),{kind:"clockTimes",times:o}}function M(n){let t=X(n,0,23);return t.length<=T?{fires:t,kind:"fires"}:{kind:"segments"}}function Hn(n,t){let e=wn(n,t);return Rn(e),On(e),Pn(e)}function _(n){return n=""+n,n.length<2?"0"+n:n}function Wn(n,t,e){return e.short?n:t[n]||n}function nn(n,{sep:t,pad:e,lean:r}){let i=e?_(n.hour):""+n.hour;return r&&!n.minute&&!n.second?i:i+t+_(n.minute)+(n.second?t+_(n.second):"")}var en={gb:{am:"am",closeUp:!0,dayFirst:!0,midday:"midday",midnight:"midnight",ordinals:!1,pm:"pm",sep:".",serialComma:!1,through:" to "},us:{am:"a.m.",closeUp:!1,dayFirst:!1,midday:"noon",midnight:"midnight",ordinals:!1,pm:"p.m.",sep:":",serialComma:!0,through:" through "},house:{am:"AM",closeUp:!1,dayFirst:!1,midday:"noon",midnight:"midnight",ordinals:!0,pm:"PM",sep:":",serialComma:!0,through:" - "}};function Ln(n){return typeof n=="object"&&n!==null?{...en.us,...n}:en[n==="uk"?"gb":n]||en.us}var Ee=["zero","one","two","three","four","five","six","seven","eight","nine","ten"],tn=["th","st","nd","rd"],Ae=[null,["January","Jan"],["February","Feb"],["March","Mar"],["April","Apr"],["May","May"],["June","Jun"],["July","Jul"],["August","Aug"],["September","Sep"],["October","Oct"],["November","Nov"],["December","Dec"]],S=[["Sunday","Sun"],["Monday","Mon"],["Tuesday","Tue"],["Wednesday","Wed"],["Thursday","Thu"],["Friday","Fri"],["Saturday","Sat"]],Ue={SUN:S[0],MON:S[1],TUE:S[2],WED:S[3],THU:S[4],FRI:S[5],SAT:S[6]},Qe=[null,"first","second","third","fourth","fifth"];function qe(n){return n=n||{},{ampm:typeof n.ampm=="boolean"?n.ampm:!0,lenient:!!n.lenient,seconds:!!n.seconds,short:!!n.short,style:Ln(n.dialect),years:!!n.years}}function Ve(n,t){return Tt(Dn(n,n.plan,t),n,t)}function Dn(n,t,e){let r=ht[t.kind];return r(n,t,e)}function $e(n,t,e){return"every second"+l(n,e)}function Je(n,t,e){return v(n,e)+l(n,e)}function Ke(n,t,e){let r=n.pattern.second;return d(r,e)+" "+b(r,"second")+" past the minute, every minute"+l(n,e)}function Ye(n,t,e){let r=n.pattern.minute,i=d(r,e),o=b(r,"minute");if(t.singleSecond){let u=n.pattern.second;return i+" "+o+" and "+d(u,e)+" "+b(u,"second")+" past the hour, every hour"+l(n,e)}return v(n,e)+", "+i+" "+o+" past the hour, every hour"+l(n,e)}function Be(n,t,e){if(!(t.rest.kind==="clockTimes"||t.rest.kind==="compactClockTimes")||n.shapes.minute!=="single")return null;let i=+n.pattern.minute;return mn(n,i,e)??fn(n,i,e)}function Ge(n,t,e){return+t.times[0].minute==0&&n.shapes.minute==="single"?v(n,e)+" for one minute at "+Xe(n,t,e):v(n,e)+" of "+_e(n,t,e)}function Ze(n,t,e){let r=Be(n,t,e);return r!==null?r:t.rest.kind==="clockTimes"&&(n.shapes.second==="wildcard"||n.shapes.second==="step")?Ge(n,t.rest,e):n.shapes.second==="wildcard"&&t.rest.kind==="minuteFrequency"&&t.rest.hours.kind==="none"&&n.pattern.minute==="*/2"?"every second of every other minute"+l(n,e):(t.rest.kind==="compactClockTimes"&&n.analyses.clockSecond?"":v(n,e)+", ")+Dn(n,t.rest,e)}function Xe(n,t,e){let r=t.times.map(function(u){return c({hour:u.hour,minute:0},e)}),i=q(n,gn,e);return h(r,e)+(i&&", "+i)}function _e(n,t,e){let r=t.times.map(function(u){return c({hour:u.hour,minute:u.minute,second:u.second,explicit:!0},e)}),i=q(n,gn,e);return h(r,e)+(i&&", "+i)}function v(n,t){return P(n,"minute",t)}function P(n,t,e){let r=n.pattern.second,i=n.shapes.second;if(r==="*")return"every second";if(i==="step")return Vn(n.analyses.segments.second[0],"second",t,e);if(i==="range"){let o=r.split("-"),u=L(o,e);return"every second from "+u(o[0])+p(e)+u(o[1])+" past the "+t}return i==="single"?"at "+d(r,e)+" "+b(r,"second")+" past the "+t:w(n.analyses.segments.second,"second",t,e)??k(C(n.analyses.segments.second,e),"second",t,e)}function nt(n,t,e){return"every minute"+l(n,e)}function et(n,t,e){let r=n.pattern.minute;return d(r,e)+" "+b(r,"minute")+" past the hour, every hour"+l(n,e)}function tt(n,t,e){return Q(n.pattern.minute,e)+l(n,e)}function rt(n,t,e){return(w(n.analyses.segments.minute,"minute","hour",e)??k(C(n.analyses.segments.minute,e),"minute","hour",e))+l(n,e)}function it(n,t,e){let r=Vn(n.analyses.segments.minute[0],"minute","hour",e);if(t.hours.kind==="during"){let i=W(n,e);r+=i?", "+i:" during the "+un(n,t.hours.times,!1,e)+" hours"}else t.hours.kind==="window"?r+=" "+Un(t.hours,e):t.hours.kind==="step"&&(r+=" "+ln(n.analyses.segments.hour[0],e));return r+l(n,e)}function ot(n,t,e){return n.pattern.minute==="*"?"every minute of the "+c({hour:t.hour,minute:0},e)+" hour"+l(n,e):"every minute from "+c({hour:t.hour,minute:t.span[0]},e)+p(e)+c({hour:t.hour,minute:t.span[1]},e)+l(n,e)}function ut(n,t,e){let r=W(n,e);if(t.form==="wildcard")return r!==null?"every minute, "+r+l(n,e):"every minute during the "+un(n,t.times,!1,e)+" hours"+l(n,e);let i=t.form==="range"?Q(n.pattern.minute,e):w(n.analyses.segments.minute,"minute","hour",e)??k(C(n.analyses.segments.minute,e),"minute","hour",e);if(r!==null)return i+", "+r+l(n,e);let o=un(n,t.times,!0,e);return i+", at "+o+l(n,e)}var En={2:"other",3:"third",4:"fourth",6:"sixth",8:"eighth",12:"twelfth"};function ln(n,t){let e="during every "+En[n.interval]+" hour",r=n.startToken==="*"?0:+n.startToken;return r===0?e:e+" starting at "+c({hour:r,minute:0},t)}function st(n,t,e){let r=n.analyses.segments.hour[0];if(t.form==="wildcard")return"every minute "+ln(r,e)+l(n,e);let i=t.form==="list"?w(n.analyses.segments.minute,"minute","hour",e)??k(C(n.analyses.segments.minute,e),"minute","hour",e):Q(n.pattern.minute,e),o=W(n,e);return i+", "+(o??$n(r,e))+l(n,e)}function Q(n,t){let e=n.split("-"),r=L(e,t);return"every minute from "+r(e[0])+p(t)+r(e[1])+" past the hour"}function at(n,t,e){return"every hour"+l(n,e)}function lt(n,t,e){let r=Un(mt(t),e);return t.minuteForm==="wildcard"?"every minute "+r+l(n,e):t.minuteForm==="range"?Q(n.pattern.minute,e)+", "+r+l(n,e):An(n,e)+" "+r+l(n,e)}function An(n,t){return n.pattern.minute==="0"?"every hour":w(n.analyses.segments.minute,"minute","hour",t)??k(C(n.analyses.segments.minute,t),"minute","hour",t)}function ct(n,t,e){let r=W(n,e);return r!==null?r+l(n,e):$n(n.analyses.segments.hour[0],e)+l(n,e)}function mt(n){let t=n.minuteForm==="wildcard"?n.boundMinute??0:0;return{from:n.from,last:t,to:n.to}}function Un(n,t){return"from "+c({hour:n.from,minute:0},t)+p(t)+c({hour:n.to,minute:n.last},t)}function ft(n,t,e){if(n.shapes.minute==="single"){let o=+n.pattern.minute,u=mn(n,o,e)??fn(n,o,e);if(u!==null)return u}let r=dn(t.times),i=t.times.map(function(u){return c({hour:u.hour,minute:u.minute,second:u.second,plain:r},e)});return Bn(n,e)+"at "+h(i,e)}function dt(n,t,e){if(t.fold){let u=mn(n,+t.minute,e)??fn(n,+t.minute,e);if(u!==null)return u;if(n.analyses.segments.hour.some(function(g){return g.kind==="range"})&&!n.analyses.clockSecond)return gt(n,t,e)+l(n,e);let m={minute:t.minute,second:n.analyses.clockSecond};return Bn(n,e)+"at "+U(n,m,!0,e)}let r=w(n.analyses.segments.minute,"minute","hour",e)??k(C(n.analyses.segments.minute,e),"minute","hour",e),i=W(n,e),o=i?r+", "+i+l(n,e):r+", at "+U(n,{minute:0,second:null},!0,e)+l(n,e);return n.analyses.clockSecond?v(n,e)+", "+o:o}function gt(n,t,e){let r=t.minute,i=[],o=[];n.analyses.segments.hour.forEach(function(m){m.kind==="range"?i.push("from "+c({hour:m.bounds[0],minute:0},e)+p(e)+c({hour:m.bounds[1],minute:r},e)):m.kind==="step"?o.push(...m.fires):o.push(+m.value)});let u=An(n,e)+" "+h(i,e);return o.length&&(u+=" and at "+h(o.map(function(m){return c({hour:m,minute:r},e)}),e)),u}var ht={clockTimes:ft,compactClockTimes:dt,composeSeconds:Ze,everyHour:at,everyMinute:nt,everySecond:$e,hourRange:lt,hourStep:ct,minuteFrequency:it,minuteSpanAcrossHourStep:st,minuteSpanInHour:ot,minutesAcrossHours:ut,multipleMinutes:rt,rangeOfMinutes:tt,secondPastMinute:Ke,secondsWithinMinute:Ye,singleMinute:et,standaloneSeconds:Je};function Qn(n,t){let{interval:e,start:r,last:i,cycle:o,unit:u,anchor:s}=n,m="every "+d(e,t)+" "+u+"s",O=o%e===0;if(r===0&&O)return m;if(r<e&&O)return m+" from "+d(r,t)+" "+b(r,u)+" past the "+s;let g=L([r,i],t);return m+" from "+g(r)+p(t)+g(i)+" "+b(i,u)+" past the "+s}function qn(n){let t=[];for(let e of n){if(e.kind!=="single")return null;t.push(+e.value)}return t}function w(n,t,e,r){let i=qn(n),o=i&&bn(i);return o?Qn({...o,cycle:60,unit:t,anchor:e},r):null}function Vn(n,t,e,r){if(n.startToken.indexOf("-")!==-1)return k(jn(n.fires,r),t,e,r);let i=n.startToken==="*"?0:+n.startToken;return i!==0&&n.fires.length<=3?k(jn(n.fires,r),t,e,r):Qn({interval:n.interval,start:i,last:n.fires[n.fires.length-1],cycle:60,unit:t,anchor:e},r)}function $n(n,t){if(n.startToken.indexOf("-")!==-1)return"at "+on(n.fires,t);let e=n.startToken==="*"?0:+n.startToken,r=n.interval;return e===0?"every "+d(r,t)+" hours":n.fires.length<=3?"at "+on(n.fires,t):"every "+d(r,t)+" hours from "+c({hour:e,minute:0},t)}function rn(n,t){let{start:e,interval:r,last:i}=n,o="every "+d(r,t)+" hours",u=24%r===0;return e===0&&u?o:e<r&&u?o+" from "+c({hour:e,minute:0},t):o+" from "+c({hour:e,minute:0},t)+p(t)+c({hour:i,minute:0},t)}function Jn(n){return n.start<n.interval&&24%n.interval===0}function W(n,t){let e=Kn(n);return!e||Jn(e)?null:rn(e,t)}function pt(n){if(n.length<2)return null;let t=n[1]-n[0];if(t<2)return null;for(let e=2;e<n.length;e+=1)if(n[e]-n[e-1]!==t)return null;return n[0]!==0&&n.length<5?null:{interval:t,last:n[n.length-1],start:n[0]}}function Kn(n){let t=n.analyses.segments.hour;if(t.length===1&&t[0].kind==="step"){let r=t[0];if(r.fires.length<2)return null;let i=r.startToken==="*"?0:+r.startToken.split("-")[0];return{interval:r.interval,last:r.fires[r.fires.length-1],start:i}}let e=qn(t);return e&&pt(e)}function cn(n){return n.pattern.second==="*"||n.shapes.second==="step"}function Yn(n,t,e){if(t===0)return cn(n)?P(n,"minute",e)+" for one minute":P(n,"hour",e);let r=d(t,e)+" "+b(t,"minute")+" past the hour";return n.pattern.second==="0"?r:P(n,"minute",e)+", "+r}function mn(n,t,e){let r=Kn(n);if(!r)return null;let i=(r.last-r.start)/r.interval+1;if(n.pattern.second==="0"&&i<=T&&Jn(r))return null;let o=t===0&&cn(n)&&yt(n);return o?P(n,"minute",e)+" for one minute "+ln(o,e)+l(n,e):t===0&&n.pattern.second==="0"?rn(r,e)+l(n,e):Yn(n,t,e)+", "+rn(r,e)+l(n,e)}function yt(n){let t=n.analyses.segments.hour,e=t.length===1&&t[0];return!e||e.kind!=="step"||e.startToken.indexOf("-")!==-1||!(e.interval in En)?null:e}function bt(n){return n.analyses.segments.hour.some(function(e){return e.kind==="range"})}function St(n,t){let e=[],r=[];n.analyses.segments.hour.forEach(function(u){u.kind==="range"?e.push("from "+c({hour:+u.bounds[0],minute:0},t)+p(t)+c({hour:+u.bounds[1],minute:0},t)):u.kind==="step"?r.push(...u.fires):r.push(+u.value)});let i="every hour "+h(e,t);return r.length&&(i+=" and at "+h(r.map(function(u){return c({hour:u,minute:0},t)}),t)),i}function fn(n,t,e){return t!==0||!bt(n)||n.pattern.second==="0"?null:cn(n)?P(n,"minute",e)+" for one minute during the "+U(n,{minute:0,second:null},!1,e)+" hours"+l(n,e):Yn(n,t,e)+", "+St(n,e)+l(n,e)}function L(n,t){let e=n.some(function(i){return+i>10});return function(i){return e?""+i:d(i,t)}}function jn(n,t){return n.map(L(n,t))}function C(n,t){let e=n.flatMap(function(o){return o.kind==="range"?o.bounds:o.kind==="step"?o.fires:[o.value]}),r=L(e,t);return n.flatMap(function(o){return o.kind==="range"?[r(o.bounds[0])+p(t)+r(o.bounds[1])]:o.kind==="step"?o.fires.map(r):[r(o.value)]})}function k(n,t,e,r){return"at "+h(n,r)+" "+t+"s past the "+e}function kt(n,t,e){return(+n==0||+n==12)&&+t==0&&!(typeof e=="number"&&e>0)}function dn(n){let t=n.filter(function(r){return kt(r.hour,r.minute,r.second)});return t.length>0&&t.length<n.length}function on(n,t){let e=dn(n.map(function(o){return{hour:o,minute:0}})),r=n.map(function(o){return c({hour:o,minute:0,plain:e},t)});return h(r,t)}function un(n,t,e,r){return t.kind==="fires"?on(t.fires,r):U(n,{minute:0,second:null},e,r)}function Ot(n){return n.kind==="range"?n.bounds:n.kind==="step"?n.fires:[n.value]}function U(n,t,e,r){let{minute:i,second:o}=t,u=n.analyses.segments.hour,s=dn(u.flatMap(function(g){return Ot(g).map(function(J){return{hour:+J,minute:i,second:o}})})),m=[];return u.forEach(function(g){g.kind==="step"?m.push(...g.fires.map(function(J){return c({hour:J,minute:i,second:o,plain:s},r)})):g.kind==="range"?m.push(c({hour:g.bounds[0],minute:i,second:o,plain:s},r)+p(r)+c({hour:g.bounds[1],minute:i,second:o,plain:s},r)):m.push(c({hour:g.value,minute:i,second:o,plain:s},r))}),h(Nt(m,u,e),r)}function Nt(n,t,e){let r=t.some(function(o){return o.kind==="range"});return!e||!r?n:n.map(function(o,u){return u===0?o:"at "+o})}function h(n,t){if(n.length<=1)return n.join("");if(n.length===2)return n[0]+" and "+n[1];let e=t.style.serialComma?", and ":" and ";return n.slice(0,-1).join(", ")+e+n[n.length-1]}var zt={all:"",month:"in ",stepDate:"on ",weekday:"on "},gn={all:"every day",month:"every day in ",stepDate:"",weekday:"every "};function l(n,t){let e=q(n,zt,t);return e&&" "+e}function Bn(n,t){return q(n,gn,t)+" "}function q(n,t,e){let r=n.pattern;return r.date!=="*"&&r.weekday!=="*"?Pt(n,e):r.date!=="*"?Rt(n,t,e):r.weekday!=="*"?(Zn(r.weekday,e)||t.weekday+ee(n,e))+A(n,e):r.month!=="*"?t.month+j(n,e):t.all}function Rt(n,t,e){let r=n.pattern,i=hn(r.date,e);return i?i+A(n,e):$(r.date)?t.stepDate+_n(r.date)+A(n,e):r.month!=="*"&&!Gn(n)?"on the "+sn(n,e)+A(n,e):r.month!=="*"?"on "+Xn(n,e):"on the "+sn(n,e)}function Gn(n){return!ne(n.pattern.month)&&n.analyses.segments.month.every(function(e){return e.kind!=="range"})}function Pt(n,t){let e=n.pattern,r=Zn(e.weekday,t)||"on "+ee(n,t);return e.month!=="*"&&Gn(n)&&!hn(e.date,t)&&!$(e.date)?"on "+Xn(n,t)+" or "+r+" in "+j(n,t):vt(n,t)+" or "+r+wt(n,t)}function vt(n,t){let e=n.pattern,r=hn(e.date,t);return r||($(e.date)?_n(e.date):"on the "+sn(n,t))}function wt(n,t){return n.pattern.month==="*"?"":", in "+j(n,t)}function hn(n,t){if(n==="L")return"on the last day of the month";if(n==="LW"||n==="WL")return"on the last weekday of the month";let e=/^L-(\d{1,2})$/.exec(n);if(e)return d(+e[1],t)+" "+b(e[1],"day")+" before the last day of the month";let r=/^(\d{1,2})W$|^W(\d{1,2})$/.exec(n);if(r)return"on the weekday nearest the "+H(r[1]||r[2])}function Zn(n,t){let e=n.split("#");if(e.length===2)return"on the "+Qe[+e[1]]+" "+an(e[0],t)+" of the month";if(/L$/.test(n))return"on the last "+an(n.slice(0,-1),t)+" of the month"}function Xn(n,t){let e=j(n,t),r=V(n.analyses.segments.date,t.style.ordinals?H:Ct,t);return t.style.dayFirst?r+" "+e:e+" "+r}function Ct(n){return""+n}function A(n,t){return n.pattern.month==="*"?"":" in "+j(n,t)}function _n(n){let t=n.split("/"),e=+t[1],r=t[0],o=(e===2?"every other":"every "+H(e))+" day of the month";return r!=="*"&&r!=="1"&&(o+=" from the "+H(r)),o}function sn(n,t){return V(n.analyses.segments.date,H,t)}function j(n,t){let e=ne(n.pattern.month);return e||V(n.analyses.segments.month,function(i){return Mt(i,t)},t)}function ne(n){if(!$(n))return null;let[t,e]=n.split("/");return+e!=2?null:t==="*"||t==="1"?"every odd-numbered month":t==="2"?"every even-numbered month":null}function ee(n,t){let e=Sn(n.analyses.segments.weekday);return V(e,function(i){return an(i,t)},t)}function V(n,t,e){let r=[];return n.forEach(function(o){o.kind==="step"?r.push(...o.fires.map(t)):o.kind==="range"?r.push(o.bounds.map(t).join(p(e))):r.push(t(o.value))}),h(r,e)}function $(n){return n.indexOf("/")!==-1&&n.indexOf("-")===-1&&n.indexOf(",")===-1}function Tt(n,t,e){let r=t.pattern.year;if(r==="*")return n;if(r.indexOf("/")!==-1)return n+" "+Ft(r,e);let i=xt(r,e);if(r.indexOf("-")===-1&&r.indexOf(",")===-1&&t.pattern.date!=="*"&&n.indexOf(" at ")!==-1){let o=e.style.dayFirst?" ":", ";return n.replace(" at ",o+i+" at ")}return n+" in "+i}function xt(n,t){return n.indexOf(",")!==-1?h(n.split(","),t):n}function Ft(n,t){let e=n.split("/"),r=+e[1],i=e[0];if(r<=1)return"every year";let o="every "+d(r,t)+" years";return i!=="*"&&i!=="0"&&(o+=" from "+i),o}function c(n,t){let{hour:e,minute:r,plain:i,explicit:o}=n,u=typeof n.second=="number"&&n.second>0?n.second:0;return t.ampm?It({hour:e,minute:r,second:u,plain:i,explicit:o},t):nn({hour:e,minute:r,second:u},{pad:!0,sep:t.style.sep})}function It(n,t){let{hour:e,minute:r,second:i,plain:o,explicit:u}=n,s=t.style;if(!o&&!u&&+r==0&&!i){if(+e==0)return s.midnight;if(+e==12)return s.midday}return nn({hour:e%12||12,minute:r,second:i},{lean:!u,sep:s.sep})+(s.closeUp?"":" ")+(e<12?s.am:s.pm)}function d(n,t){return Wn(n,Ee,t)}function b(n,t){return+n==1?t:t+"s"}function p(n){return n.short?"-":n.style.through}function H(n){let t=Math.abs(n),e=tn[t];return e||(t=(t%100-20)%10,e=tn[t]||tn[0]),n+e}function Mt(n,t){let e=Ae[+n];return e&&e[t.short?1:0]}function an(n,t){let e=n===7||n==="7"?0:n,r=S[e]||Ue[e];return r&&r[t.short?1:0]}var Ht={describe:Ve,fallback:"an unrecognizable cron pattern",options:qe,reboot:"at system startup",sentence:n=>"Runs "+n+(n.endsWith(".")?"":".")},te=Ht;/**
1
+ "use strict";(()=>{var pe={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6},ye={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12},S={second:{cyclic:!0,max:59,min:0,top:59},minute:{cyclic:!0,max:59,min:0,top:59},hour:{cyclic:!0,max:23,min:0,top:23},date:{aliases:{"?":"*"},cyclic:!0,max:31,min:1,top:31},month:{cyclic:!0,max:12,min:1,numbers:ye,top:12},weekday:{aliases:{"?":"*",L:"6"},cyclic:!0,max:7,min:0,numbers:pe,top:6},year:{max:9999,min:1970}},v=["second","minute","hour","date","month","weekday","year"],X={"@annually":"0 0 1 1 *","@yearly":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@midnight":"0 0 * * *","@hourly":"0 * * * *"},W=6;function l(n,e){return(""+n).indexOf(e)!==-1}function Q(n){return Array.from(new Set(n))}function V(n){return/^\d+$/.test(n)}function _(n){if(n.length<5)return null;let e=n[1]-n[0];if(e<2)return null;for(let t=2;t<n.length;t+=1)if(n[t]-n[t-1]!==e)return null;return{start:n[0],interval:e,last:n[n.length-1]}}function Rn(n){return n===0?7:n}function wn(n){let e=n.flatMap(function(i){return i.kind==="step"?i.fires.map(function(o){return{kind:"single",value:""+o}}):[i]});function t(r){return r.kind==="range"?Rn(+r.bounds[0]):Rn(+r.value)}return e.map(function(i,u){return[i,u]}).sort(function(i,u){return t(i[0])-t(u[0])||i[1]-u[1]}).map(function(i){return i[0]})}function f(n,e){return V(n)?+n:e[n.toUpperCase()]}function Pn(n){return v.forEach(function(t){be(n[t],S[t],t)}),n}function be(n,e,t){typeof n!="string"&&typeof n!="number"&&vn(n,t);let r=""+n;r!=="*"&&(t==="date"&&H(r)||t==="weekday"&&L(r,e)||r.split(",").forEach(function(u){Se(u,e)||vn(u,t)}))}function H(n){if(n==="L"||n==="LW"||n==="WL")return!0;let e=/^L-(\d{1,2})$/.exec(n);if(e)return+e[1]>=1&&+e[1]<=30;let t=/^(\d{1,2})W$|^W(\d{1,2})$/.exec(n);if(t){let r=+(t[1]||t[2]);return r>=1&&r<=31}return!1}function L(n,e){if(/L$/.test(n))return T(n.slice(0,-1),e);let t=n.split("#");return t.length===2?T(t[0],e)&&/^[1-5]$/.test(t[1]):!1}function Se(n,e){return l(n,"/")?ke(n,e):l(n,"-")?Cn(n,e):T(n,e)}function ke(n,e){let t=n.split("/");return t.length!==2||!V(t[1])||+t[1]<1?!1:t[0]==="*"||T(t[0],e)||Cn(t[0],e,!0)}function Cn(n,e,t){let r=n.split("-");return r.length!==2||!T(r[0],e)||!T(r[1],e)?!1:e.cyclic&&!t?!0:f(r[0],e.numbers)<=f(r[1],e.numbers)}function T(n,e){return n==="*"?!1:V(n)?+n>=e.min&&+n<=e.max:e.numbers?n.toUpperCase()in e.numbers:!1}function vn(n,e){throw new Error('`cronli5` was passed an invalid field value "'+n+'" for the '+e+" field.")}var Oe={hour:24,minute:60,second:60};function xn(n){v.forEach(function(t){let r=S[t].aliases,i=r&&r[""+n[t]];i&&(n[t]=i)})}function Tn(n){return v.forEach(function(t){let r=""+n[t];if(t==="date"&&H(r)||t==="weekday"&&L(r,S[t])){n[t]=r;return}n[t]=Ne(r,t,S[t])}),n}function Ne(n,e,t){let r=""+n;if(r==="*")return r;let i=Oe[e],u=r.split(",").map(function(s){return ze(Fn(Pe(Ce(Ie(ve(we(s,t),t),t),t),t,i),t),t)}).join(",").split(",");return u.indexOf("*")!==-1?"*":Q(u).sort(function(s,m){return In(s,t)-In(m,t)}).join(",")}function ze(n,e){if(!e.numbers)return n;let t=n.split("/"),r=t[0].split("-").map(function(u){return Re(u,e)}).join("-");return t.length===2?r+"/"+t[1]:r}function Re(n,e){if(n==="*")return n;let t=f(n,e.numbers);return""+(t>e.top?e.min:t)}function we(n,e){let t=n.split("/");if(!e.cyclic||t.length!==2||+t[1]!=1)return n;let r=t[0];return l(r,"-")?r:r==="*"||f(r,e.numbers)===e.min?"*":r+"-"+e.top}function ve(n,e){let t=n.split("/");if(!e.cyclic||typeof e.top!="number"||t.length!==2||l(t[0],"-"))return n;let r=t[0];return(r==="*"?e.min:f(r,e.numbers))+ +t[1]<=e.top?n:r==="*"?""+e.min:r}function Pe(n,e,t){let r=n.split("/");if(typeof t!="number"||r.length!==2||l(r[0],"-"))return n;let i=+r[1],u=r[0]==="*"?e.min:f(r[0]);if(t%i===0&&u<i)return n;let o=[];for(let s=u;s<=e.top;s+=i)o.push(s);return o.join(",")}function Ce(n,e){let t=n.split("/");return t.length!==2||!l(t[0],"-")?n:Fn(t[0],e)==="*"?"*/"+t[1]:n}function Fn(n,e){if(typeof e.top!="number"||l(n,"/")||!l(n,"-"))return n;let t=n.split("-"),r=f(t[0],e.numbers),i=f(t[1],e.numbers);if(r>i)return n;let u=e.top,o={};for(let s=r;s<=i;s+=1)o[s>u?e.min:s]=!0;for(let s=e.min;s<=u;s+=1)if(!o[s])return n;return"*"}function Ie(n,e){let t=n.split("/")[0];if(!l(t,"-"))return n;let r=t.split("-");return f(r[0],e.numbers)!==f(r[1],e.numbers)?n:r[0]}function In(n,e){let t=n.split("/")[0].split("-")[0];return t==="*"?e.min:f(t,e.numbers)}function Mn(n,e){let t=n instanceof Array;if(n===null||typeof n>"u"||n===""||t&&n.length===0)throw new Error("`cronli5` expects a non-empty cron pattern as the first argument.");if(t)return Wn(n,e);if(typeof n=="object")return xe(n);if(typeof n=="string")return Te(n,e);throw new Error("`cronli5` was passed an unexpected type.")}function Wn(n,e){if(n.length>7)throw new Error("`cronli5` was passed a cron pattern with more than seven fields.");return!e.seconds&&n.length<(e.years?7:6)&&n.unshift("0"),{second:n[0]||"0",minute:n[1]||"*",hour:n[2]||"*",date:n[3]||"*",month:n[4]||"*",weekday:n[5]||"*",year:n[6]||"*"}}function xe(n){if(!n.second&&!n.minute&&!n.hour)throw new Error("`cronli5` expects that any object being interpreted as a cron pattern have at least one of the following properties: `second`, `minute`, or `hour`");let e=typeof n.second<"u",t=typeof n.minute<"u",r=e?"*":"0",i=e||t?"*":"0";return{second:P(n.second,"0"),minute:P(n.minute,r),hour:P(n.hour,i),date:P(n.date,"*"),month:P(n.month,"*"),weekday:P(n.weekday,"*"),year:P(n.year,"*")}}function P(n,e){return typeof n>"u"?e:n}function Te(n,e){let t=Fe(n).split(/\s+/);return Wn(t,e)}function Fe(n){let e=n.trim();if(e.charAt(0)!=="@")return n;let t=e.toLowerCase();if(Object.hasOwn(X,t))return X[t];throw new Error("`cronli5` does not recognize the macro `"+e+"`.")}function Hn(n){return n!=="*"&&!l(n,",")&&!l(n,"-")&&!l(n,"/")}function nn(n){return l(n,"-")&&!l(n,",")&&!l(n,"/")}function Me(n){return l(n,"/")&&!l(n,",")}function en(n){return n!=="*"&&!l(n,"-")&&!l(n,"/")}function tn(n){return n!=="*"&&!nn(n)&&!Me(n)}function E(n,e,t){let r=[],i=n;for(;i<=t;)r.push(i),i+=e;return r}function Ln(n,e,t,r){let i=n.split("/"),u=+i[1];if(l(i[0],"-")){let s=i[0].split("-");return E(f(s[0],r),u,f(s[1],r))}let o=i[0]==="*"?e:f(i[0],r);return E(o,u,t)}function un(n,e,t){let r=[];return n.split(",").forEach(function(u){if(l(u,"/"))r.push(...Ln(u,e,t));else if(l(u,"-")){let o=u.split("-");+o[0]<=+o[1]?r.push(...E(+o[0],1,+o[1])):(r.push(...E(+o[0],1,t)),r.push(...E(e,1,+o[1])))}else r.push(+u)}),Q(r)}function We(n){return en(n)?n.split(",").map(Number):[0]}function He(n){if(n==="*")return[0,59];if(nn(n)){let e=n.split("-");if(+e[0]<=+e[1])return[+e[0],+e[1]]}return null}function Le(n){return n==="*"?59:Math.max(...un(n,0,59))}function Ee(n){if(Hn(n)&&n!=="0")return+n}function De(n,e){return n==="*"?"wildcard":e==="date"&&H(n)||e==="weekday"&&L(n,S.weekday)?"quartz":l(n,",")?"list":l(n,"/")?"step":l(n,"-")?"range":"single"}function je(n,e,t){return e==="wildcard"||e==="quartz"?null:n.split(",").map(function(i){if(l(i,"/")){let u=i.split("/");return{fires:Ln(i,t.min,t.top,t.numbers),interval:+u[1],kind:"step",startToken:u[0]}}return l(i,"-")?{bounds:i.split("-"),kind:"range"}:{kind:"single",value:i}})}function En(n){let e={},t={};v.forEach(function(o){e[o]=De(n[o],o),t[o]=je(n[o],e[o],S[o])});let i={analyses:{clockSecond:Ee(n.second),lastMinuteFire:Le(n.minute),minuteSpan:He(n.minute),segments:t},pattern:n,shapes:e};return{...i,plan:Ae(i)}}function Ae(n){let{analyses:e,pattern:t,shapes:r}=n;if(t.second!=="0"){let i=Ue(t,r,e);if(i)return i}return Dn(t,r,e)||jn(t,r,e)}function Ue(n,e,t){let r=qe(n,e);return r||(n.hour==="*"&&e.minute==="single"&&n.second!=="*"?{kind:"secondsWithinMinute",singleSecond:e.second==="single"}:e.second==="single"&&en(n.minute)&&tn(n.hour)?null:{kind:"composeSeconds",rest:Dn(n,e,t,!0)||jn(n,e,t,!0)})}function qe(n,e){return n.minute!=="*"||n.hour!=="*"?null:n.second==="*"?{kind:"everySecond"}:e.second==="single"?{kind:"secondPastMinute"}:{kind:"standaloneSeconds"}}function Dn(n,e,t,r=!1){if(e.minute==="step")return{hours:Ve(n,e,t),kind:"minuteFrequency"};if(e.hour==="single"&&t.minuteSpan)return{hour:+n.hour,kind:"minuteSpanInHour",span:t.minuteSpan};let i=$e(n,e);if(i)return i;let u=Qe(n,e);if(u)return u;if(n.hour==="*")return Je(n,e,r)}function rn(n){let[e,t]=n.split("/"),r=e==="*"?0:+e;return e.indexOf("-")===-1&&24%+t===0&&r<+t}function Qe(n,e){return e.hour!=="step"?null:n.minute==="*"?rn(n.hour)?{form:"wildcard",kind:"minuteSpanAcrossHourStep"}:{form:"wildcard",kind:"minutesAcrossHours",times:D(n.hour)}:e.minute==="range"?{form:"range",kind:"minuteSpanAcrossHourStep"}:e.minute==="list"&&rn(n.hour)?{form:"list",kind:"minuteSpanAcrossHourStep"}:null}function Ve(n,e,t){if(e.hour==="list")return{kind:"during",times:D(n.hour)};if(e.hour==="range"){let r=n.hour.split("-");return{from:+r[0],kind:"window",last:t.lastMinuteFire,to:+r[1]}}return e.hour==="single"?{from:+n.hour,kind:"window",last:t.lastMinuteFire,to:+n.hour}:e.hour==="step"?rn(n.hour)?{kind:"step"}:{kind:"during",times:D(n.hour)}:{kind:"none"}}function $e(n,e){return tn(n.hour)?n.minute==="*"?{form:"wildcard",kind:"minutesAcrossHours",times:D(n.hour)}:e.minute==="range"||e.minute==="list"&&l(n.minute,"-")&&!l(n.minute,"/")?{form:e.minute==="range"?"range":"list",kind:"minutesAcrossHours",times:D(n.hour)}:null:null}function Je(n,e,t){if(e.minute==="range")return{kind:"rangeOfMinutes"};if(e.minute==="list")return{kind:"multipleMinutes"};if(n.minute==="*")return{kind:"everyMinute"};if(n.minute!=="0"||t)return{kind:"singleMinute"}}function jn(n,e,t,r=!1){let i=r&&n.minute==="0";return e.hour==="range"&&!i?Ke(n,e,t):e.hour==="step"&&n.minute==="0"&&!r?{kind:"hourStep"}:n.hour==="*"&&!i?{kind:"everyHour"}:Ye(n,t,i)}function Ke(n,e,t){let r=n.hour.split("-"),i="lead";return n.minute==="*"?i="wildcard":e.minute==="range"&&(i="range"),{boundMinute:e.minute==="range"||e.minute==="list"?null:t.lastMinuteFire,from:+r[0],kind:"hourRange",last:t.lastMinuteFire,minuteForm:i,to:+r[1]}}function Ye(n,e,t=!1){let r=un(n.hour,0,23),i=We(n.minute);if(!t&&r.length*i.length>W)return{fold:i.length===1,kind:"compactClockTimes",minute:i[0]};let u=[];return r.forEach(function(s){i.forEach(function(d){u.push({hour:s,minute:d,second:e.clockSecond})})}),{kind:"clockTimes",times:u}}function D(n){let e=un(n,0,23);return e.length<=W?{fires:e,kind:"fires"}:{kind:"segments"}}function An(n,e){let t=Mn(n,e);return xn(t),Pn(t),Tn(t)}function N(n){return n=""+n,n.length<2?"0"+n:n}function Un(n,e,t){return t.short?n:e[n]||n}function on(n,{sep:e,pad:t,lean:r}){let i=t?N(n.hour):""+n.hour;return r&&!n.minute&&!n.second?i:i+e+N(n.minute)+(n.second?e+N(n.second):"")}var sn={gb:{am:"am",closeUp:!0,dayFirst:!0,midday:"midday",midnight:"midnight",ordinals:!1,pm:"pm",sep:".",serialComma:!1,through:" to "},us:{am:"a.m.",closeUp:!1,dayFirst:!1,midday:"noon",midnight:"midnight",ordinals:!1,pm:"p.m.",sep:":",serialComma:!0,through:" through ",untilWindow:!0},house:{am:"AM",closeUp:!1,dayFirst:!1,midday:"noon",midnight:"midnight",ordinals:!0,pm:"PM",sep:":",serialComma:!0,through:" - "}};function qn(n){return typeof n=="object"&&n!==null?{...sn.us,untilWindow:!1,...n}:sn[n==="uk"?"gb":n]||sn.us}var Ge=["zero","one","two","three","four","five","six","seven","eight","nine","ten"],an=["th","st","nd","rd"],Ze=[null,["January","Jan"],["February","Feb"],["March","Mar"],["April","Apr"],["May","May"],["June","Jun"],["July","Jul"],["August","Aug"],["September","Sep"],["October","Oct"],["November","Nov"],["December","Dec"]],z=[["Sunday","Sun"],["Monday","Mon"],["Tuesday","Tue"],["Wednesday","Wed"],["Thursday","Thu"],["Friday","Fri"],["Saturday","Sat"]],Be={SUN:z[0],MON:z[1],TUE:z[2],WED:z[3],THU:z[4],FRI:z[5],SAT:z[6]},Xe=[null,"first","second","third","fourth","fifth"];function _e(n){return n=n||{},{ampm:typeof n.ampm=="boolean"?n.ampm:!0,lenient:!!n.lenient,seconds:!!n.seconds,short:!!n.short,style:qn(n.dialect),years:!!n.years}}function nt(n,e){let t=Ft(n,e)??Vn(n,n.plan,e),r=Y(n,e)?$t(n,e):"";return nr(r+t,n,e)}function Vn(n,e,t){let r=Mt[e.kind];return r(n,e,t)}function et(n,e,t){return"every second"+a(n,t)}function tt(n,e,t){return F(n,t)+a(n,t)}function rt(n,e,t){let r=n.pattern.second;return g(r,t)+" "+O(r,"second")+" past the minute, every minute"+a(n,t)}function it(n,e,t){let r=n.pattern.minute,i=g(r,t),u=O(r,"minute");if(e.singleSecond){let o=n.pattern.second;return i+" "+u+" and "+g(o,t)+" "+O(o,"second")+" past the hour, every hour"+a(n,t)}return F(n,t)+", "+i+" "+u+" past the hour, every hour"+a(n,t)}function ut(n,e,t){if(!(e.rest.kind==="clockTimes"||e.rest.kind==="compactClockTimes")||n.shapes.minute!=="single")return null;let i=+n.pattern.minute;return yn(n,i,t)??bn(n,i,t)}function ot(n,e,t){return+e.times[0].minute==0&&n.shapes.minute==="single"?F(n,t)+" for one minute at "+at(n,e,t):F(n,t)+" of "+lt(n,e,t)}function st(n,e,t){let r=ut(n,e,t);return r!==null?r:e.rest.kind==="clockTimes"&&(n.shapes.second==="wildcard"||n.shapes.second==="step")?ot(n,e.rest,t):n.shapes.second==="wildcard"&&e.rest.kind==="minuteFrequency"&&e.rest.hours.kind==="none"&&n.pattern.minute==="*/2"?"every second of every other minute"+a(n,t):(e.rest.kind==="compactClockTimes"&&n.analyses.clockSecond?"":F(n,t)+", ")+Vn(n,e.rest,t)}function at(n,e,t){let r=e.times.map(function(o){return c({hour:o.hour,minute:0},t)}),i=K(n,On,t);return y(r,t)+(i&&", "+i)}function lt(n,e,t){let r=e.times.map(function(o){return c({hour:o.hour,minute:o.minute,second:o.second,explicit:!0},t)}),i=K(n,On,t);return y(r,t)+(i&&", "+i)}function F(n,e){return C(n,"minute",e)}function C(n,e,t){let r=n.pattern.second,i=n.shapes.second;if(r==="*")return"every second";if(i==="step")return hn(n.analyses.segments.second[0],"second",e,t);if(i==="range"){let u=r.split("-"),o=Sn();return"every second from "+o(u[0])+p(t)+o(u[1])+" past the "+e}return i==="single"?"at "+g(r,t)+" "+O(r,"second")+" past the "+e:M(n.analyses.segments.second,"second",e,t)??w(x(n.analyses.segments.second,t),"second",e,t)}function ct(n,e,t){return"every minute"+a(n,t)}function mt(n,e,t){let r=n.pattern.minute;return g(r,t)+" "+O(r,"minute")+" past the hour, every hour"+a(n,t)}function ft(n,e,t){return $(n.pattern.minute,t)+a(n,t)}function dt(n,e,t){return(M(n.analyses.segments.minute,"minute","hour",t)??w(x(n.analyses.segments.minute,t),"minute","hour",t))+a(n,t)}function gt(n,e,t){let r=hn(n.analyses.segments.minute[0],"minute","hour",t);if(e.hours.kind==="during"){let i=U(n,t);r+=i?", "+i:" during the "+j(n,e.hours.times,!1,t)+" hours"}else e.hours.kind==="window"?r+=" "+Kn(e.hours,t):e.hours.kind==="step"&&(r+=" "+dn(n.analyses.segments.hour[0],t));return r+a(n,t)}function ht(n,e,t){return n.pattern.minute==="*"?"every minute of the "+c({hour:e.hour,minute:0},t)+" hour"+a(n,t):"every minute from "+c({hour:e.hour,minute:e.span[0]},t)+p(t)+c({hour:e.hour,minute:e.span[1]},t)+a(n,t)}function pt(n,e,t){let r=U(n,t);if(e.form==="wildcard")return r!==null?"every minute, "+r+a(n,t):"every minute during the "+j(n,e.times,!1,t)+" hours"+a(n,t);if(e.form==="range"){let o=$(n.pattern.minute,t);return r!==null?o+", "+r+a(n,t):jt(e.times)?o+", at "+j(n,e.times,!0,t)+a(n,t):o+" during the "+j(n,e.times,!1,t)+" hours"+a(n,t)}let i=M(n.analyses.segments.minute,"minute","hour",t)??w(x(n.analyses.segments.minute,t),"minute","hour",t);if(r!==null)return i+", "+r+a(n,t);let u=j(n,e.times,!0,t);return i+", at "+u+a(n,t)}var $n={2:"other",3:"third",4:"fourth",6:"sixth",8:"eighth",12:"twelfth"};function dn(n,e){let t="during every "+$n[n.interval]+" hour",r=n.startToken==="*"?0:+n.startToken;return r===0?t:t+" starting at "+c({hour:r,minute:0},e)}function yt(n,e,t){let r=n.analyses.segments.hour[0];if(e.form==="wildcard")return"every minute "+dn(r,t)+a(n,t);let i=e.form==="list"?M(n.analyses.segments.minute,"minute","hour",t)??w(x(n.analyses.segments.minute,t),"minute","hour",t):$(n.pattern.minute,t),u=U(n,t);return i+", "+(u??Xn(r,t))+a(n,t)}function $(n,e){let t=n.split("-"),r=Sn();return"every minute from "+r(t[0])+p(e)+r(t[1])+" past the hour"}function bt(n,e,t){return"every hour"+a(n,t)}function St(n,e,t){let r=Kn(Ot(e),t);return e.minuteForm==="wildcard"?"every minute "+r+a(n,t):e.minuteForm==="range"?$(n.pattern.minute,t)+", "+r+a(n,t):Jn(n,t)+" "+r+a(n,t)}function Jn(n,e){return n.pattern.minute==="0"?"every hour":M(n.analyses.segments.minute,"minute","hour",e)??w(x(n.analyses.segments.minute,e),"minute","hour",e)}function kt(n,e,t){let r=U(n,t);return r!==null?r+a(n,t):Xn(n.analyses.segments.hour[0],t)+a(n,t)}function Ot(n){let e=n.minuteForm==="wildcard"?n.boundMinute??0:0;return{from:n.from,last:e,to:n.to}}function J(n,e,t,r){let i="from "+c({hour:n,minute:0},r);return r.style.untilWindow&&!r.short&&n!==e?i+" until "+c({hour:(e+1)%24,minute:0},r):i+p(r)+c({hour:e,minute:t},r)}function Kn(n,e){return J(n.from,n.to,n.last,e)}function Nt(n,e,t){if(n.shapes.minute==="single"){let u=+n.pattern.minute,o=yn(n,u,t)??bn(n,u,t);if(o!==null)return o}let r=kn(e.times),i=e.times.map(function(o){return c({hour:o.hour,minute:o.minute,second:o.second,plain:r},t)});return ie(n,t)+"at "+y(i,t)+Yn(n,t)}function Yn(n,e){return Y(n,e)?oe(n,e):""}function zt(n,e,t){if(e.fold){let o=yn(n,+e.minute,t)??bn(n,+e.minute,t);if(o!==null)return o;if(n.analyses.segments.hour.some(function(h){return h.kind==="range"})&&!n.analyses.clockSecond)return Rt(n,e,t)+a(n,t);let m={minute:e.minute,second:n.analyses.clockSecond};return ie(n,t)+"at "+A(n,m,!0,t)+Yn(n,t)}let r=M(n.analyses.segments.minute,"minute","hour",t)??w(x(n.analyses.segments.minute,t),"minute","hour",t),i=U(n,t),u=i?r+", "+i+a(n,t):r+", at "+A(n,{minute:0,second:null},!0,t)+a(n,t);return n.analyses.clockSecond?F(n,t)+", "+u:u}function Rt(n,e,t){let r=e.minute,i=[],u=Gn(n),o=u.hours.map(function(d){return c({hour:d,minute:r},t)});return n.analyses.segments.hour.forEach(function(d){d.kind==="range"&&i.push(J(+d.bounds[0],+d.bounds[1],r,t))}),Jn(n,t)+" "+y(i,t)+Zn(o,u.pureStrays,t)}function Gn(n){let e=[],t=!0;return n.analyses.segments.hour.forEach(function(i){i.kind==="step"?(e.push(...i.fires),t=!1):i.kind!=="range"&&e.push(+i.value)}),{hours:e,pureStrays:t}}function Zn(n,e,t){return n.length?(e&&t.style.untilWindow&&!t.short?" plus ":" and at ")+y(n,t):""}function I(n){return n==="*"||n.startsWith("*/")&&n.indexOf("-")===-1}function wt(n,e){let{second:t,minute:r}=n.pattern;return I(t)?{secondLead:!0,text:C(n,"minute",e)}:t==="0"&&I(r)?{secondLead:!1,text:r==="*"?"every minute":hn(n.analyses.segments.minute[0],"minute","hour",e)}:null}function vt(n,e){let t=n.pattern.minute;if(t==="*")return"";if(I(t))return" of every other minute";let r=n.analyses.segments.minute;if(n.shapes.minute==="single")return" during minute :"+N(t);if(n.shapes.minute==="range"){let u=t.split("-");return" during minutes :"+N(u[0])+p(e)+":"+N(u[1])}let i=x(r,e).map(function(o){return":"+N(o)});return" during minutes "+y(i,e)}function Pt(n,e){let t=n.pattern.hour;if(t==="*")return n.pattern.minute!=="*"&&!I(n.pattern.minute)?" of every hour":"";if(I(t))return t==="*/2"?" of every other hour":"";if(n.shapes.hour==="single"){let r=+t;return n.shapes.minute==="step"?" from "+c({hour:r,minute:0},e)+" until "+c({hour:(r+1)%24,minute:0},e):n.pattern.minute!=="*"&&!I(n.pattern.minute)?" at "+c({hour:r,minute:0},e):" of the "+c({hour:r,minute:0},e)+" hour"}if(n.shapes.hour==="range"){let r=t.split("-");return" "+J(+r[0],+r[1],0,e)}return" during the "+A(n,{minute:0,second:null},!1,e)+" hours"}function Ct(n){return n.shapes.hour==="range"}function It(n){if(n.shapes.hour!=="step")return!0;let e=n.analyses.segments.hour[0];return n.pattern.hour==="*/2"||e.startToken.indexOf("-")!==-1}function xt(n){if(n.shapes.minute!=="list")return!1;let e=gn(n.analyses.segments.minute);return e!==null&&_(e)!==null}function Tt(n,e){let{minute:t,hour:r}=n.pattern,i=I(t)&&t!=="*";return It(n)?e.secondLead?i?t==="*/2"&&!Ct(n):!(xt(n)||n.shapes.minute==="list"&&n.shapes.hour==="list"):r==="*/2"?!0:n.shapes.hour==="single"&&t==="*/2":!1}function Ft(n,e){if(!e.style.untilWindow||e.short||n.pattern.minute==="*"&&n.pattern.hour==="*")return null;let t=wt(n,e);if(!t||!Tt(n,t))return null;let r=t.secondLead?vt(n,e):"";return t.text+r+Pt(n,e)+a(n,e)}var Mt={clockTimes:Nt,compactClockTimes:zt,composeSeconds:st,everyHour:bt,everyMinute:ct,everySecond:et,hourRange:St,hourStep:kt,minuteFrequency:gt,minuteSpanAcrossHourStep:yt,minuteSpanInHour:ht,minutesAcrossHours:pt,multipleMinutes:dt,rangeOfMinutes:ft,secondPastMinute:rt,secondsWithinMinute:it,singleMinute:mt,standaloneSeconds:tt};function Bn(n,e){let{interval:t,start:r,last:i,cycle:u,unit:o,anchor:s}=n,m="every "+g(t,e)+" "+o+"s",d=u%t===0;if(r===0&&d)return m;if(r<t&&d)return m+" from "+g(r,e)+" "+O(r,o)+" past the "+s;let h=Sn();return m+" from "+h(r)+p(e)+h(i)+" "+O(i,o)+" past the "+s}function gn(n){let e=[];for(let t of n){if(t.kind!=="single")return null;e.push(+t.value)}return e}function M(n,e,t,r){let i=gn(n),u=i&&_(i);return u?Bn({...u,cycle:60,unit:e,anchor:t},r):null}function hn(n,e,t,r){if(n.startToken.indexOf("-")!==-1)return w(Qn(n.fires,r),e,t,r);let i=n.startToken==="*"?0:+n.startToken;return i!==0&&n.fires.length<=3?w(Qn(n.fires,r),e,t,r):Bn({interval:n.interval,start:i,last:n.fires[n.fires.length-1],cycle:60,unit:e,anchor:t},r)}function Xn(n,e){if(n.startToken.indexOf("-")!==-1)return"at "+cn(n.fires,e);let t=n.startToken==="*"?0:+n.startToken,r=n.interval;return t===0?"every "+g(r,e)+" hours":n.fires.length<=3?"at "+cn(n.fires,e):"every "+g(r,e)+" hours from "+c({hour:t,minute:0},e)}function ln(n,e){let{start:t,interval:r,last:i}=n,u="every "+g(r,e)+" hours",o=24%r===0;return t===0&&o?u:t<r&&o?u+" from "+c({hour:t,minute:0},e):u+" from "+c({hour:t,minute:0},e)+p(e)+c({hour:i,minute:0},e)}function _n(n){return n.start<n.interval&&24%n.interval===0}function U(n,e){let t=ne(n);return!t||_n(t)?null:ln(t,e)}function Wt(n){if(n.length<2)return null;let e=n[1]-n[0];if(e<2)return null;for(let t=2;t<n.length;t+=1)if(n[t]-n[t-1]!==e)return null;return n[0]!==0&&n.length<5?null:{interval:e,last:n[n.length-1],start:n[0]}}function ne(n){let e=n.analyses.segments.hour;if(e.length===1&&e[0].kind==="step"){let r=e[0];if(r.fires.length<2)return null;let i=r.startToken==="*"?0:+r.startToken.split("-")[0];return{interval:r.interval,last:r.fires[r.fires.length-1],start:i}}let t=gn(e);return t&&Wt(t)}function pn(n){return n.pattern.second==="*"||n.shapes.second==="step"}function ee(n,e,t){if(e===0)return pn(n)?C(n,"minute",t)+" for one minute":C(n,"hour",t);let r=g(e,t)+" "+O(e,"minute")+" past the hour";return n.pattern.second==="0"?r:C(n,"minute",t)+", "+r}function yn(n,e,t){let r=ne(n);if(!r)return null;let i=(r.last-r.start)/r.interval+1;if(n.pattern.second==="0"&&i<=W&&_n(r))return null;let u=e===0&&pn(n)&&Ht(n);return u?C(n,"minute",t)+" for one minute "+dn(u,t)+a(n,t):e===0&&n.pattern.second==="0"?ln(r,t)+a(n,t):ee(n,e,t)+", "+ln(r,t)+a(n,t)}function Ht(n){let e=n.analyses.segments.hour,t=e.length===1&&e[0];return!t||t.kind!=="step"||t.startToken.indexOf("-")!==-1||!(t.interval in $n)?null:t}function Lt(n){return n.analyses.segments.hour.some(function(t){return t.kind==="range"})}function Et(n,e){let t=[],r=Gn(n);n.analyses.segments.hour.forEach(function(s){s.kind==="range"&&t.push(J(+s.bounds[0],+s.bounds[1],0,e))});let i="every hour "+y(t,e),u=r.hours.map(function(s){return c({hour:s,minute:0},e)});return i+Zn(u,r.pureStrays,e)}function bn(n,e,t){return e!==0||!Lt(n)||n.pattern.second==="0"?null:pn(n)?C(n,"minute",t)+" for one minute during the "+A(n,{minute:0,second:null},!1,t)+" hours"+a(n,t):ee(n,e,t)+", "+Et(n,t)+a(n,t)}function Sn(){return function(e){return""+e}}function te(n,e){return n>1?function(r){return""+r}:function(r){return g(r,e)}}function Qn(n,e){return n.map(te(n.length,e))}function x(n,e){let t=n.reduce(function(u,o){return o.kind==="range"?u+1:u+(o.kind==="step"?o.fires.length:1)},0),r=te(t,e);return n.flatMap(function(u){return u.kind==="range"?[r(u.bounds[0])+p(e)+r(u.bounds[1])]:u.kind==="step"?u.fires.map(r):[r(u.value)]})}function w(n,e,t,r){return"at "+y(n,r)+" "+e+"s past the "+t}function Dt(n,e,t){return(+n==0||+n==12)&&+e==0&&!(typeof t=="number"&&t>0)}function kn(n){let e=n.filter(function(r){return Dt(r.hour,r.minute,r.second)});return e.length>0&&e.length<n.length}function cn(n,e){let t=kn(n.map(function(u){return{hour:u,minute:0}})),r=n.map(function(u){return c({hour:u,minute:0,plain:t},e)});return y(r,e)}function jt(n){return n.kind==="fires"&&n.fires.length===1}function j(n,e,t,r){return e.kind==="fires"?cn(e.fires,r):A(n,{minute:0,second:null},t,r)}function At(n){return n.kind==="range"?n.bounds:n.kind==="step"?n.fires:[n.value]}function A(n,e,t,r){let{minute:i,second:u}=e,o=n.analyses.segments.hour,s=kn(o.flatMap(function(h){return At(h).map(function(B){return{hour:+B,minute:i,second:u}})})),m=[];return o.forEach(function(h){h.kind==="step"?m.push(...h.fires.map(function(B){return c({hour:B,minute:i,second:u,plain:s},r)})):h.kind==="range"?m.push(c({hour:h.bounds[0],minute:i,second:u,plain:s},r)+p(r)+c({hour:h.bounds[1],minute:i,second:u,plain:s},r)):m.push(c({hour:h.value,minute:i,second:u,plain:s},r))}),y(Ut(m,o,t),r)}function Ut(n,e,t){let r=e.some(function(u){return u.kind==="range"});return!t||!r?n:n.map(function(u,o){return o===0?u:"at "+u})}function re(n,e,t){if(n.length<=1)return n.join("");if(n.length===2)return n[0]+e+n[1];let r=t.style.serialComma?","+e:e;return n.slice(0,-1).join(", ")+r+n[n.length-1]}function y(n,e){return re(n," and ",e)}function qt(n,e){return re(n," or ",e)}var Qt={all:"",month:"in ",recurringWeekday:!0,stepDate:"on ",weekday:"on "},On={all:"every day",month:"every day in ",recurringWeekday:!1,stepDate:"",weekday:"every "};function a(n,e){if(Y(n,e))return oe(n,e);let t=K(n,Qt,e);return t&&" "+t}function ie(n,e){return Y(n,e)?"":K(n,On,e)+" "}function K(n,e,t){let r=n.pattern;if(r.date!=="*"&&r.weekday!=="*")return Gt(n,t);if(r.date!=="*")return Vt(n,e,t);if(r.weekday!=="*"){let i=Nn(r.weekday,t);return i?mn(i,n,t):e.weekday+me(n,e.recurringWeekday,t)+ae(n,t)}return r.month!=="*"?e.month+k(n,t):e.all}function Vt(n,e,t){let r=n.pattern,i=G(r.date,t);return i?mn(i,n,t):q(r.date)?mn(e.stepDate+le(r.date),n,t):r.month!=="*"&&!ue(n)?"on the "+fn(n,t)+ae(n,t):r.month!=="*"?"on "+se(n,t):"on the "+fn(n,t)}function ue(n){return!ce(n.pattern.month)&&n.analyses.segments.month.every(function(t){return t.kind!=="range"})}function Y(n,e){return n.pattern.date!=="*"&&n.pattern.weekday!=="*"&&!!e.style.untilWindow&&!e.short}function oe(n,e){let t=[...Jt(n,e),...Kt(n,e)];return" whenever the day is "+qt(t,e)}function $t(n,e){return n.pattern.month==="*"?"":"in "+k(n,e)+" "}function Jt(n,e){let t=n.pattern.date,r=G(t,e);if(r)return[r.replace(/^on /,"")];let i=Yt(t);if(i)return[i];let u=[];return n.analyses.segments.date.forEach(function(s){s.kind==="range"?u.push("from the "+b(s.bounds[0])+p(e)+"the "+b(s.bounds[1])):s.kind==="step"?s.fires.forEach(function(d){u.push("the "+b(d))}):u.push("the "+b(s.value))}),u}function Kt(n,e){let t=n.pattern.weekday,r=Nn(t,e);if(r)return[r.replace(/^on /,"")];let i=[];return n.analyses.segments.weekday.forEach(function(o){o.kind==="range"&&o.bounds[0]==="1"&&o.bounds[1]==="5"?i.push("a weekday"):o.kind==="range"?i.push("a "+R(o.bounds[0],e)+p(e)+"a "+R(o.bounds[1],e)):o.kind==="step"?o.fires.forEach(function(m){i.push("a "+R(m,e))}):i.push("a "+R(o.value,e))}),i}function Yt(n){if(!q(n))return null;let[e,t]=n.split("/");return+t!=2?null:e==="*"||e==="1"?"an odd-numbered day":e==="2"?"an even-numbered day":null}function Gt(n,e){let t=n.pattern,r=Nn(t.weekday,e)||"on "+me(n,!1,e);return t.month!=="*"&&ue(n)&&!G(t.date,e)&&!q(t.date)?"on "+se(n,e)+" or "+r+" in "+k(n,e):Zt(n,e)+" or "+r+Bt(n,e)}function Zt(n,e){let t=n.pattern,r=G(t.date,e);return r||(q(t.date)?le(t.date):"on the "+fn(n,e))}function Bt(n,e){return n.pattern.month==="*"?"":", in "+k(n,e)}function G(n,e){if(n==="L")return"on the last day of the month";if(n==="LW"||n==="WL")return"on the last weekday of the month";let t=/^L-(\d{1,2})$/.exec(n);if(t)return g(+t[1],e)+" "+O(t[1],"day")+" before the last day of the month";let r=/^(\d{1,2})W$|^W(\d{1,2})$/.exec(n);if(r)return"on the weekday nearest the "+b(r[1]||r[2])}function Nn(n,e){let t=n.split("#");if(t.length===2)return"on the "+Xe[+t[1]]+" "+R(t[0],e)+" of the month";if(/L$/.test(n))return"on the last "+R(n.slice(0,-1),e)+" of the month"}function se(n,e){let t=k(n,e),r=Z(n.analyses.segments.date,e.style.ordinals?b:Xt,e);return e.style.dayFirst&&n.shapes.date==="single"&&n.shapes.month!=="single"?"the "+b(n.pattern.date)+" of "+t:e.style.dayFirst?r+" "+t:t+" "+r}function Xt(n){return""+n}function ae(n,e){return n.pattern.month==="*"?"":" in "+k(n,e)}function mn(n,e,t){if(e.pattern.month==="*")return n;let r=n.indexOf(" of the month")!==-1;return r&&e.shapes.month==="range"?n.replace(" of the month"," of each month")+" from "+k(e,t):r&&(e.shapes.month==="single"||e.shapes.month==="step")?n.replace(" of the month","")+" in "+k(e,t):n+" in "+k(e,t)}function le(n){let e=n.split("/"),t=+e[1],r=e[0],u=(t===2?"every other":"every "+b(t))+" day of the month";return r!=="*"&&r!=="1"&&(u+=" from the "+b(r)),u}function fn(n,e){return Z(n.analyses.segments.date,b,e)}function k(n,e){let t=ce(n.pattern.month);return t||Z(n.analyses.segments.month,function(i){return ir(i,e)},e)}function ce(n){if(!q(n))return null;let[e,t]=n.split("/");return+t!=2?null:e==="*"||e==="1"?"every odd-numbered month":e==="2"?"every even-numbered month":null}function me(n,e,t){let r=wn(n.analyses.segments.weekday),i=r.some(function(s){return s.kind==="range"});return Z(r,e&&!i?function(s){return _t(s,t)}:function(s){return R(s,t)},t)}function _t(n,e){let t=R(n,e);return e.short?t:t+"s"}function Z(n,e,t){let r=[];return n.forEach(function(u){u.kind==="step"?r.push(...u.fires.map(e)):u.kind==="range"?r.push(u.bounds.map(e).join(p(t))):r.push(e(u.value))}),y(r,t)}function q(n){return n.indexOf("/")!==-1&&n.indexOf("-")===-1&&n.indexOf(",")===-1}function nr(n,e,t){let r=e.pattern.year;if(r==="*")return n;if(r.indexOf("/")!==-1)return n+", "+tr(r,t);let i=er(r,t);if(r.indexOf("-")===-1&&r.indexOf(",")===-1&&e.pattern.date!=="*"&&n.indexOf(" at ")!==-1){let u=t.style.dayFirst?" ":", ";return n.replace(" at ",u+i+" at ")}return n+" in "+i}function er(n,e){return n.indexOf(",")!==-1?y(n.split(","),e):n.indexOf("-")!==-1?n.split("-").join(p(e)):n}function tr(n,e){let t=n.split("/"),r=+t[1],i=t[0];if(r<=1)return"every year";let u=r===2?"every other year":"every "+g(r,e)+" years";return i!=="*"&&i!=="0"&&(u+=" from "+i),u}function c(n,e){let{hour:t,minute:r,plain:i,explicit:u}=n,o=typeof n.second=="number"&&n.second>0?n.second:0;return e.ampm?rr({hour:t,minute:r,second:o,plain:i,explicit:u},e):on({hour:t,minute:r,second:o},{pad:!0,sep:e.style.sep})}function rr(n,e){let{hour:t,minute:r,second:i,plain:u,explicit:o}=n,s=e.style;if(!u&&!o&&+r==0&&!i){if(+t==0)return s.midnight;if(+t==12)return s.midday}return on({hour:t%12||12,minute:r,second:i},{lean:!o,sep:s.sep})+(s.closeUp?"":" ")+(t<12?s.am:s.pm)}function g(n,e){return Un(n,Ge,e)}function O(n,e){return+n==1?e:e+"s"}function p(n){return n.short?"-":n.style.through}function b(n){let e=Math.abs(n),t=an[e];return t||(e=(e%100-20)%10,t=an[e]||an[0]),n+t}function ir(n,e){let t=Ze[+n];return t&&t[e.short?1:0]}function R(n,e){let t=n===7||n==="7"?0:n,r=z[t]||Be[t];return r&&r[e.short?1:0]}var ur={describe:nt,fallback:"an unrecognizable cron pattern",options:_e,reboot:"at system startup",sentence:n=>"Runs "+n+(n.endsWith(".")?"":".")},fe=ur;/**
2
2
  * @license MIT, Copyright (c) 2026 Andrew Brož
3
- */function Wt(n,t){let e=t&&t.lang||te,r=e.options(t);if(!r.lenient)return re(ie(n,e,r),e,t);try{return re(ie(n,e,r),e,t)}catch{return e.fallback}}function re(n,t,e){return e&&e.sentence?t.sentence(n):n}function ie(n,t,e){if(typeof n=="string"&&n.trim().toLowerCase()==="@reboot")return t.reboot;let r=Fn(Hn(n,e)),i=t.strategy?t.strategy(r,r.plan):r.plan;return t.describe({...r,plan:i},e)}var pn=Wt;typeof globalThis<"u"&&Object.assign(globalThis,{cronli5:pn});var Sr=pn;})();
3
+ */function or(n,e){let t=e&&e.lang||fe,r=t.options(e);if(!r.lenient)return de(ge(n,t,r),t,e);try{return de(ge(n,t,r),t,e)}catch{return t.fallback}}function de(n,e,t){return t&&t.sentence?e.sentence(n):n}function ge(n,e,t){if(typeof n=="string"&&n.trim().toLowerCase()==="@reboot")return e.reboot;let r=En(An(n,t)),i=e.strategy?e.strategy(r,r.plan):r.plan;return e.describe({...r,plan:i},t)}var zn=or;typeof globalThis<"u"&&Object.assign(globalThis,{cronli5:zn});var Vr=zn;})();