cronli5 0.1.7 → 0.2.1

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,74 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.2.1]
10
+
11
+ ### Fixed
12
+
13
+ - The hour-range until-window ("from 9 a.m. until 6 p.m.") now applies **only
14
+ when the minute is wildcard** — i.e. the schedule fills each hour
15
+ continuously, so it genuinely runs *until* the top of the next hour. For any
16
+ restricted minute (fixed / step / range / list) the fires are discrete, so it
17
+ reverts to "from 9 a.m. through 5 p.m." (the last hour). 0.2.0 over-applied
18
+ "until" to the discrete cases (e.g. `0 9-17` read "until 6 p.m." instead of
19
+ "through 5 p.m.").
20
+
21
+ ### Changed (internal — output byte-identical)
22
+
23
+ - Lifted language-neutral helpers (`singleValues`, `offsetCleanStride`,
24
+ `isOpenStep`, the segment accessors, `hourListStride`) into the core, removing
25
+ ~300 lines of cross-renderer duplication.
26
+ - Unified the rendering-plan terminology on **plan** (`selectStrategy` →
27
+ `selectPlan`, `Language.strategy` → `Language.plan`).
28
+ - Scrubbed workflow-provenance labels from shipped comments and fixed
29
+ stale/typo comments.
30
+ - Adjusted the c8 branch-coverage gate 96 → 95: real branch coverage is ~100%;
31
+ the measured figure is limited by fixed esbuild/tsx function-default phantom
32
+ branches, and consolidating covered duplicate code crossed the rounding cliff.
33
+
34
+ ## [0.2.0]
35
+
36
+ A major naturalness pass for English, validated by blind native-speaker
37
+ (math-inclined) panels: mean idiom rose 3.60 → 4.15 and clarity 3.75 → 4.20 on
38
+ full-space random samples, with zero correctness regressions. The full
39
+ panel-validated naturalness specification (`test/lang/en/core-set.js` +
40
+ `known-issues.js`, 165 cases) is now un-skipped and runs in CI as the contract
41
+ for the prose. Changes are to the English default dialect; other languages are
42
+ unchanged, and round-trip + the metamorphic invariant guard every rewrite.
43
+
44
+ ### Changed
45
+
46
+ - **OR-day now reads as a union condition-frame.** When both day-of-month and
47
+ day-of-week are restricted, cron fires on the *union* of days. The old "on the
48
+ 1st or on Friday" read as alternatives (and "and" would read as intersection);
49
+ it now reads "[in MONTH] [at TIME] whenever the day is the 1st or a Friday" — a
50
+ predicate over the day that reads as a union for naive, logical, and technical
51
+ readers. (~70% of expressions.)
52
+ - **Hour ranges read as an until-window:** "from 9 a.m. until 6 p.m." (was
53
+ "through 5 p.m."); hour *steps* keep "through K" (the endpoint is a real fire).
54
+ - **Coarser fields confine under a finer cadence:** "every second during minute
55
+ :00 of every hour", "every second of the midnight hour", "every two minutes
56
+ from midnight until 1 a.m."; a redundant unrestricted finer field drops.
57
+ - **Trailing weekdays pluralize** ("on Mondays"); weekday ranges keep "on Monday
58
+ through Friday". Weekday lists order Monday-first.
59
+ - **"of the month" drops under an explicit month** ("on the last Friday in
60
+ January"); a month range keeps "of each month from January through March".
61
+ - Minute lists numeralize ("4, 6, and 9 minutes past the hour"); a seconds range
62
+ digitizes its bounds ("from 0 through 10 past the minute"); a contiguous hour
63
+ run with an outlier reads "from 9 a.m. until 9 p.m. plus 10 p.m."; a year range
64
+ reads "2030 through 2035" and a stepped year "every second, every other year";
65
+ the gb day-first multi-month fold no longer garden-paths the day.
66
+
67
+ ### Added
68
+
69
+ - The English naturalness specification (`core-set.js` + `known-issues.js`, 165
70
+ cases) is un-skipped and runs in CI as the prose contract.
71
+
72
+ ### Known limitations
73
+
74
+ - Genuinely dense crons (three stacked sub-hour cadences) remain inherently
75
+ verbose (~3/5 naturalness); a structural rewrite was scoped and deferred.
76
+
9
77
  ## [0.1.7]
10
78
 
11
79
  A correctness and clarity pass driven by blind, math-inclined native-speaker
package/README.md CHANGED
@@ -254,7 +254,7 @@ 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. through 5 p.m.'
258
258
  cronli5('30 9-17 * * *');
259
259
  // 'at 30 minutes past the hour from 9 a.m. through 5 p.m.'
260
260
  cronli5('0 12 1 1 *'); // 'on January 1 at noon'
@@ -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 be={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6},ke={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:ke,top:12},weekday:{aliases:{"?":"*",L:"6"},cyclic:!0,max:7,min:0,numbers:be,top:6},year:{max:9999,min:1970}},C=["second","minute","hour","date","month","weekday","year"],en={"@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 * * * *"},E=6;function l(n,e){return(""+n).indexOf(e)!==-1}function J(n){return Array.from(new Set(n))}function K(n){return/^\d+$/.test(n)}function tn(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 Pn(n){return n===0?7:n}function Cn(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"?Pn(+r.bounds[0]):Pn(+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 d(n,e){return K(n)?+n:e[n.toUpperCase()]}function c(n,e){return n.analyses.segments[e]??[]}function z(n,e){return c(n,e)[0]}function Y(n){let e=[];for(let t of n){if(t.kind!=="single")return null;e.push(+t.value)}return e}function rn(n){return n.start<n.interval&&24%n.interval===0}function In(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 Mn(n){return C.forEach(function(t){Se(n[t],S[t],t)}),n}function Se(n,e,t){typeof n!="string"&&typeof n!="number"&&xn(n,t);let r=""+n;r!=="*"&&(t==="date"&&D(r)||t==="weekday"&&j(r,e)||r.split(",").forEach(function(u){Oe(u,e)||xn(u,t)}))}function D(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 j(n,e){if(/L$/.test(n))return F(n.slice(0,-1),e);let t=n.split("#");return t.length===2?F(t[0],e)&&/^[1-5]$/.test(t[1]):!1}function Oe(n,e){return l(n,"/")?Ne(n,e):l(n,"-")?Tn(n,e):F(n,e)}function Ne(n,e){let t=n.split("/");return t.length!==2||!K(t[1])||+t[1]<1?!1:t[0]==="*"||F(t[0],e)||Tn(t[0],e,!0)}function Tn(n,e,t){let r=n.split("-");return r.length!==2||!F(r[0],e)||!F(r[1],e)?!1:e.cyclic&&!t?!0:d(r[0],e.numbers)<=d(r[1],e.numbers)}function F(n,e){return n==="*"?!1:K(n)?+n>=e.min&&+n<=e.max:e.numbers?n.toUpperCase()in e.numbers:!1}function xn(n,e){throw new Error('`cronli5` was passed an invalid field value "'+n+'" for the '+e+" field.")}var ze={hour:24,minute:60,second:60};function Wn(n){C.forEach(function(t){let r=S[t].aliases,i=r&&r[""+n[t]];i&&(n[t]=i)})}function Hn(n){return C.forEach(function(t){let r=""+n[t];if(t==="date"&&D(r)||t==="weekday"&&j(r,S[t])){n[t]=r;return}n[t]=Re(r,t,S[t])}),n}function Re(n,e,t){let r=""+n;if(r==="*")return r;let i=ze[e],u=r.split(",").map(function(s){return ve(Ln(Ie(xe(Me(Ce(Pe(s,t),t),t),t),t,i),t),t)}).join(",").split(",");return u.indexOf("*")!==-1?"*":J(u).sort(function(s,m){return Fn(s,t)-Fn(m,t)}).join(",")}function ve(n,e){if(!e.numbers)return n;let t=n.split("/"),r=t[0].split("-").map(function(u){return we(u,e)}).join("-");return t.length===2?r+"/"+t[1]:r}function we(n,e){if(n==="*")return n;let t=d(n,e.numbers);return""+(t>e.top?e.min:t)}function Pe(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==="*"||d(r,e.numbers)===e.min?"*":r+"-"+e.top}function Ce(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:d(r,e.numbers))+ +t[1]<=e.top?n:r==="*"?""+e.min:r}function Ie(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:d(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 xe(n,e){let t=n.split("/");return t.length!==2||!l(t[0],"-")?n:Ln(t[0],e)==="*"?"*/"+t[1]:n}function Ln(n,e){if(typeof e.top!="number"||l(n,"/")||!l(n,"-"))return n;let t=n.split("-"),r=d(t[0],e.numbers),i=d(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 Me(n,e){let t=n.split("/")[0];if(!l(t,"-"))return n;let r=t.split("-");return d(r[0],e.numbers)!==d(r[1],e.numbers)?n:r[0]}function Fn(n,e){let t=n.split("/")[0].split("-")[0];return t==="*"?e.min:d(t,e.numbers)}function En(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 Dn(n,e);if(typeof n=="object")return Te(n);if(typeof n=="string")return Fe(n,e);throw new Error("`cronli5` was passed an unexpected type.")}function Dn(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 Te(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:I(n.second,"0"),minute:I(n.minute,r),hour:I(n.hour,i),date:I(n.date,"*"),month:I(n.month,"*"),weekday:I(n.weekday,"*"),year:I(n.year,"*")}}function I(n,e){return typeof n>"u"?e:n}function Fe(n,e){let t=We(n).split(/\s+/);return Dn(t,e)}function We(n){let e=n.trim();if(e.charAt(0)!=="@")return n;let t=e.toLowerCase();if(Object.hasOwn(en,t))return en[t];throw new Error("`cronli5` does not recognize the macro `"+e+"`.")}function jn(n){return n!=="*"&&!l(n,",")&&!l(n,"-")&&!l(n,"/")}function un(n){return l(n,"-")&&!l(n,",")&&!l(n,"/")}function He(n){return l(n,"/")&&!l(n,",")}function on(n){return n!=="*"&&!l(n,"-")&&!l(n,"/")}function sn(n){return n!=="*"&&!un(n)&&!He(n)}function W(n){return n.indexOf("/")!==-1&&n.indexOf("-")===-1&&n.indexOf(",")===-1}function A(n,e,t){let r=[],i=n;for(;i<=t;)r.push(i),i+=e;return r}function An(n,e,t,r){let i=n.split("/"),u=+i[1];if(l(i[0],"-")){let s=i[0].split("-");return A(d(s[0],r),u,d(s[1],r))}let o=i[0]==="*"?e:d(i[0],r);return A(o,u,t)}function ln(n,e,t){let r=[];return n.split(",").forEach(function(u){if(l(u,"/"))r.push(...An(u,e,t));else if(l(u,"-")){let o=u.split("-");+o[0]<=+o[1]?r.push(...A(+o[0],1,+o[1])):(r.push(...A(+o[0],1,t)),r.push(...A(e,1,+o[1])))}else r.push(+u)}),J(r)}function Le(n){return on(n)?n.split(",").map(Number):[0]}function Ee(n){if(n==="*")return[0,59];if(un(n)){let e=n.split("-");if(+e[0]<=+e[1])return[+e[0],+e[1]]}return null}function De(n){return n==="*"?59:Math.max(...ln(n,0,59))}function je(n){if(jn(n)&&n!=="0")return+n}function Ae(n,e){return n==="*"?"wildcard":e==="date"&&D(n)||e==="weekday"&&j(n,S.weekday)?"quartz":l(n,",")?"list":l(n,"/")?"step":l(n,"-")?"range":"single"}function Ue(n,e,t){return e==="wildcard"||e==="quartz"?null:n.split(",").map(function(i){if(l(i,"/")){let u=i.split("/");return{fires:An(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 Un(n){let e={},t={};C.forEach(function(o){e[o]=Ae(n[o],o),t[o]=Ue(n[o],e[o],S[o])});let i={analyses:{clockSecond:je(n.second),lastMinuteFire:De(n.minute),minuteSpan:Ee(n.minute),segments:t},pattern:n,shapes:e};return{...i,plan:qe(i)}}function qe(n){let{analyses:e,pattern:t,shapes:r}=n;if(t.second!=="0"){let i=Qe(t,r,e);if(i)return i}return qn(t,r,e)||Qn(t,r,e)}function Qe(n,e,t){let r=Ve(n,e);return r||(n.hour==="*"&&e.minute==="single"&&n.second!=="*"?{kind:"secondsWithinMinute",singleSecond:e.second==="single"}:e.second==="single"&&on(n.minute)&&sn(n.hour)?null:{kind:"composeSeconds",rest:qn(n,e,t,!0)||Qn(n,e,t,!0)})}function Ve(n,e){return n.minute!=="*"||n.hour!=="*"?null:n.second==="*"?{kind:"everySecond"}:e.second==="single"?{kind:"secondPastMinute"}:{kind:"standaloneSeconds"}}function qn(n,e,t,r=!1){if(e.minute==="step")return{hours:Je(n,e,t),kind:"minuteFrequency"};if(e.hour==="single"&&t.minuteSpan)return{hour:+n.hour,kind:"minuteSpanInHour",span:t.minuteSpan};let i=Ke(n,e);if(i)return i;let u=$e(n,e);if(u)return u;if(n.hour==="*")return Ye(n,e,r)}function an(n){let[e,t]=n.split("/"),r=e==="*"?0:+e;return e.indexOf("-")===-1&&24%+t===0&&r<+t}function $e(n,e){return e.hour!=="step"?null:n.minute==="*"?an(n.hour)?{form:"wildcard",kind:"minuteSpanAcrossHourStep"}:{form:"wildcard",kind:"minutesAcrossHours",times:U(n.hour)}:e.minute==="range"?{form:"range",kind:"minuteSpanAcrossHourStep"}:e.minute==="list"&&an(n.hour)?{form:"list",kind:"minuteSpanAcrossHourStep"}:null}function Je(n,e,t){if(e.hour==="list")return{kind:"during",times:U(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"?an(n.hour)?{kind:"step"}:{kind:"during",times:U(n.hour)}:{kind:"none"}}function Ke(n,e){return sn(n.hour)?n.minute==="*"?{form:"wildcard",kind:"minutesAcrossHours",times:U(n.hour)}:e.minute==="range"||e.minute==="list"&&l(n.minute,"-")&&!l(n.minute,"/")?{form:e.minute==="range"?"range":"list",kind:"minutesAcrossHours",times:U(n.hour)}:null:null}function Ye(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 Qn(n,e,t,r=!1){let i=r&&n.minute==="0";return e.hour==="range"&&!i?Ge(n,e,t):e.hour==="step"&&n.minute==="0"&&!r?{kind:"hourStep"}:n.hour==="*"&&!i?{kind:"everyHour"}:Ze(n,t,i)}function Ge(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 Ze(n,e,t=!1){let r=ln(n.hour,0,23),i=Le(n.minute);if(!t&&r.length*i.length>E)return{fold:i.length===1,kind:"compactClockTimes",minute:i[0]};let u=[];return r.forEach(function(s){i.forEach(function(k){u.push({hour:s,minute:k,second:e.clockSecond})})}),{kind:"clockTimes",times:u}}function U(n){let e=ln(n,0,23);return e.length<=E?{fires:e,kind:"fires"}:{kind:"segments"}}function Vn(n,e){let t=En(n,e);return Wn(t),Mn(t),Hn(t)}function R(n){return n=""+n,n.length<2?"0"+n:n}function $n(n,e,t){return t.short?n:e[n]||n}function cn(n,{sep:e,pad:t,lean:r}){let i=t?R(n.hour):""+n.hour;return r&&!n.minute&&!n.second?i:i+e+R(n.minute)+(n.second?e+R(n.second):"")}var fn={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 Jn(n){return typeof n=="object"&&n!==null?{...fn.us,untilWindow:!1,...n}:fn[n==="uk"?"gb":n]||fn.us}var Be=["zero","one","two","three","four","five","six","seven","eight","nine","ten"],mn=["th","st","nd","rd"],Xe=[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"]],v=[["Sunday","Sun"],["Monday","Mon"],["Tuesday","Tue"],["Wednesday","Wed"],["Thursday","Thu"],["Friday","Fri"],["Saturday","Sat"]],_e={SUN:v[0],MON:v[1],TUE:v[2],WED:v[3],THU:v[4],FRI:v[5],SAT:v[6]},nt=[null,"first","second","third","fourth","fifth"];function et(n){return n=n||{},{ampm:typeof n.ampm=="boolean"?n.ampm:!0,lenient:!!n.lenient,seconds:!!n.seconds,short:!!n.short,style:Jn(n.dialect),years:!!n.years}}function tt(n,e){let t=Ht(n,e)??Yn(n,n.plan,e),r=B(n,e)?Kt(n,e):"";return tr(r+t,n,e)}function Yn(n,e,t){let r=Lt[e.kind];return r(n,e,t)}function rt(n,e,t){return"every second"+a(n,t)}function it(n,e,t){return H(n,t)+a(n,t)}function ut(n,e,t){let r=n.pattern.second;return h(r,t)+" "+N(r,"second")+" past the minute, every minute"+a(n,t)}function ot(n,e,t){let r=n.pattern.minute,i=h(r,t),u=N(r,"minute");if(e.singleSecond){let o=n.pattern.second;return i+" "+u+" and "+h(o,t)+" "+N(o,"second")+" past the hour, every hour"+a(n,t)}return H(n,t)+", "+i+" "+u+" past the hour, every hour"+a(n,t)}function st(n,e,t){if(!(e.rest.kind==="clockTimes"||e.rest.kind==="compactClockTimes")||n.shapes.minute!=="single")return null;let i=+n.pattern.minute;return Sn(n,i,t)??On(n,i,t)}function at(n,e,t){return+e.times[0].minute==0&&n.shapes.minute==="single"?H(n,t)+" for one minute at "+ct(n,e,t):H(n,t)+" of "+ft(n,e,t)}function lt(n,e,t){let r=st(n,e,t);return r!==null?r:e.rest.kind==="clockTimes"&&(n.shapes.second==="wildcard"||n.shapes.second==="step")?at(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?"":H(n,t)+", ")+Yn(n,e.rest,t)}function ct(n,e,t){let r=e.times.map(function(o){return f({hour:o.hour,minute:0},t)}),i=Z(n,Rn,t);return y(r,t)+(i&&", "+i)}function ft(n,e,t){let r=e.times.map(function(o){return f({hour:o.hour,minute:o.minute,second:o.second,explicit:!0},t)}),i=Z(n,Rn,t);return y(r,t)+(i&&", "+i)}function H(n,e){return x(n,"minute",e)}function x(n,e,t){let r=n.pattern.second,i=n.shapes.second;if(r==="*")return"every second";if(i==="step")return bn(z(n,"second"),"second",e,t);if(i==="range"){let u=r.split("-"),o=Nn();return"every second from "+o(u[0])+g(t)+o(u[1])+" past the "+e}return i==="single"?"at "+h(r,t)+" "+N(r,"second")+" past the "+e:L(c(n,"second"),"second",e,t)??P(T(c(n,"second"),t),"second",e,t)}function mt(n,e,t){return"every minute"+a(n,t)}function dt(n,e,t){let r=n.pattern.minute;return h(r,t)+" "+N(r,"minute")+" past the hour, every hour"+a(n,t)}function ht(n,e,t){return G(n.pattern.minute,t)+a(n,t)}function gt(n,e,t){return(L(c(n,"minute"),"minute","hour",t)??P(T(c(n,"minute"),t),"minute","hour",t))+a(n,t)}function pt(n,e,t){let r=bn(z(n,"minute"),"minute","hour",t);if(e.hours.kind==="during"){let i=$(n,t);r+=i?", "+i:" during the "+q(n,e.hours.times,!1,t)+" hours"}else e.hours.kind==="window"?r+=" "+V({continuous:!1,from:e.hours.from,throughMinute:e.hours.last,to:e.hours.to},t):e.hours.kind==="step"&&(r+=" "+yn(z(n,"hour"),t));return r+a(n,t)}function yt(n,e,t){return n.pattern.minute==="*"?"every minute of the "+f({hour:e.hour,minute:0},t)+" hour"+a(n,t):"every minute from "+f({hour:e.hour,minute:e.span[0]},t)+g(t)+f({hour:e.hour,minute:e.span[1]},t)+a(n,t)}function bt(n,e,t){let r=$(n,t);if(e.form==="wildcard")return r!==null?"every minute, "+r+a(n,t):"every minute during the "+q(n,e.times,!1,t)+" hours"+a(n,t);if(e.form==="range"){let o=G(n.pattern.minute,t);return r!==null?o+", "+r+a(n,t):Ut(e.times)?o+", at "+q(n,e.times,!0,t)+a(n,t):o+" during the "+q(n,e.times,!1,t)+" hours"+a(n,t)}let i=L(c(n,"minute"),"minute","hour",t)??P(T(c(n,"minute"),t),"minute","hour",t);if(r!==null)return i+", "+r+a(n,t);let u=q(n,e.times,!0,t);return i+", at "+u+a(n,t)}var Gn={2:"other",3:"third",4:"fourth",6:"sixth",8:"eighth",12:"twelfth"};function yn(n,e){let t="during every "+Gn[n.interval]+" hour",r=n.startToken==="*"?0:+n.startToken;return r===0?t:t+" starting at "+f({hour:r,minute:0},e)}function kt(n,e,t){let r=z(n,"hour");if(e.form==="wildcard")return"every minute "+yn(r,t)+a(n,t);let i=e.form==="list"?L(c(n,"minute"),"minute","hour",t)??P(T(c(n,"minute"),t),"minute","hour",t):G(n.pattern.minute,t),u=$(n,t);return i+", "+(u??ee(r,t))+a(n,t)}function G(n,e){let t=n.split("-"),r=Nn();return"every minute from "+r(t[0])+g(e)+r(t[1])+" past the hour"}function St(n,e,t){return"every hour"+a(n,t)}function Ot(n,e,t){let r=Rt(zt(e),t);return e.minuteForm==="wildcard"?"every minute "+r+a(n,t):e.minuteForm==="range"?G(n.pattern.minute,t)+", "+r+a(n,t):Zn(n,t)+" "+r+a(n,t)}function Zn(n,e){return n.pattern.minute==="0"?"every hour":L(c(n,"minute"),"minute","hour",e)??P(T(c(n,"minute"),e),"minute","hour",e)}function Nt(n,e,t){let r=$(n,t);return r!==null?r+a(n,t):ee(z(n,"hour"),t)+a(n,t)}function zt(n){let e=n.minuteForm==="wildcard",t=e?n.boundMinute??0:0;return{from:n.from,closeMinute:t,to:n.to,continuous:e}}function V(n,e){let{from:t,to:r,throughMinute:i,continuous:u}=n,o="from "+f({hour:t,minute:0},e);return e.style.untilWindow&&!e.short&&t!==r?u?o+" until "+f({hour:(r+1)%24,minute:0},e):o+g(e)+f({hour:r,minute:0},e):o+g(e)+f({hour:r,minute:i},e)}function Rt(n,e){return V({continuous:n.continuous,from:n.from,throughMinute:n.closeMinute,to:n.to},e)}function vt(n,e,t){if(n.shapes.minute==="single"){let u=+n.pattern.minute,o=Sn(n,u,t)??On(n,u,t);if(o!==null)return o}let r=zn(e.times),i=e.times.map(function(o){return f({hour:o.hour,minute:o.minute,second:o.second,plain:r},t)});return oe(n,t)+"at "+y(i,t)+Bn(n,t)}function Bn(n,e){return B(n,e)?ae(n,e):""}function wt(n,e,t){if(e.fold){let o=Sn(n,+e.minute,t)??On(n,+e.minute,t);if(o!==null)return o;if(c(n,"hour").some(function(p){return p.kind==="range"})&&!n.analyses.clockSecond)return Pt(n,e,t)+a(n,t);let m={minute:e.minute,second:n.analyses.clockSecond};return oe(n,t)+"at "+Q(n,m,!0,t)+Bn(n,t)}let r=L(c(n,"minute"),"minute","hour",t)??P(T(c(n,"minute"),t),"minute","hour",t),i=$(n,t),u=i?r+", "+i+a(n,t):r+", at "+Q(n,{minute:0,second:null},!0,t)+a(n,t);return n.analyses.clockSecond?H(n,t)+", "+u:u}function Pt(n,e,t){let r=e.minute,i=[],u=Xn(n).map(function(m){return f({hour:m,minute:r},t)});return c(n,"hour").forEach(function(m){m.kind==="range"&&i.push(V({continuous:!1,from:+m.bounds[0],throughMinute:r,to:+m.bounds[1]},t))}),Zn(n,t)+" "+y(i,t)+_n(u,t)}function Xn(n){let e=[];return c(n,"hour").forEach(function(r){r.kind==="step"?e.push(...r.fires):r.kind!=="range"&&e.push(+r.value)}),e}function _n(n,e){return n.length?" and at "+y(n,e):""}function M(n){return n==="*"||n.startsWith("*/")&&n.indexOf("-")===-1}function Ct(n,e){let{second:t,minute:r}=n.pattern;return M(t)?{secondLead:!0,text:x(n,"minute",e)}:t==="0"&&M(r)?{secondLead:!1,text:r==="*"?"every minute":bn(z(n,"minute"),"minute","hour",e)}:null}function It(n,e){let t=n.pattern.minute;if(t==="*")return"";if(M(t))return" of every other minute";let r=c(n,"minute");if(n.shapes.minute==="single")return" during minute :"+R(t);if(n.shapes.minute==="range"){let u=t.split("-");return" during minutes :"+R(u[0])+g(e)+":"+R(u[1])}let i=T(r,e).map(function(o){return":"+R(o)});return" during minutes "+y(i,e)}function xt(n,e){let t=n.pattern.hour;if(t==="*")return n.pattern.minute!=="*"&&!M(n.pattern.minute)?" of every hour":"";if(M(t))return t==="*/2"?" of every other hour":"";if(n.shapes.hour==="single"){let r=+t;return n.shapes.minute==="step"?" from "+f({hour:r,minute:0},e)+" until "+f({hour:(r+1)%24,minute:0},e):n.pattern.minute!=="*"&&!M(n.pattern.minute)?" at "+f({hour:r,minute:0},e):" of the "+f({hour:r,minute:0},e)+" hour"}if(n.shapes.hour==="range"){let r=t.split("-");return" "+V({continuous:n.pattern.minute==="*",from:+r[0],throughMinute:0,to:+r[1]},e)}return" during the "+Q(n,{minute:0,second:null},!1,e)+" hours"}function Mt(n){return n.shapes.hour==="range"}function Tt(n){if(n.shapes.hour!=="step")return!0;let e=z(n,"hour");return n.pattern.hour==="*/2"||e.startToken.indexOf("-")!==-1}function Ft(n){if(n.shapes.minute!=="list")return!1;let e=Y(c(n,"minute"));return e!==null&&tn(e)!==null}function Wt(n,e){let{minute:t,hour:r}=n.pattern,i=M(t)&&t!=="*";return Tt(n)?e.secondLead?i?t==="*/2"&&!Mt(n):!(Ft(n)||n.shapes.minute==="list"&&n.shapes.hour==="list"):r==="*/2"?!0:n.shapes.hour==="single"&&t==="*/2":!1}function Ht(n,e){if(!e.style.untilWindow||e.short||n.pattern.minute==="*"&&n.pattern.hour==="*")return null;let t=Ct(n,e);if(!t||!Wt(n,t))return null;let r=t.secondLead?It(n,e):"";return t.text+r+xt(n,e)+a(n,e)}var Lt={clockTimes:vt,compactClockTimes:wt,composeSeconds:lt,everyHour:St,everyMinute:mt,everySecond:rt,hourRange:Ot,hourStep:Nt,minuteFrequency:pt,minuteSpanAcrossHourStep:kt,minuteSpanInHour:yt,minutesAcrossHours:bt,multipleMinutes:gt,rangeOfMinutes:ht,secondPastMinute:ut,secondsWithinMinute:ot,singleMinute:dt,standaloneSeconds:it};function ne(n,e){let{interval:t,start:r,last:i,cycle:u,unit:o,anchor:s}=n,m="every "+h(t,e)+" "+o+"s",k=u%t===0;if(r===0&&k)return m;if(r<t&&k)return m+" from "+h(r,e)+" "+N(r,o)+" past the "+s;let p=Nn();return m+" from "+p(r)+g(e)+p(i)+" "+N(i,o)+" past the "+s}function L(n,e,t,r){let i=Y(n),u=i&&tn(i);return u?ne({...u,cycle:60,unit:e,anchor:t},r):null}function bn(n,e,t,r){if(n.startToken.indexOf("-")!==-1)return P(Kn(n.fires,r),e,t,r);let i=n.startToken==="*"?0:+n.startToken;return i!==0&&n.fires.length<=3?P(Kn(n.fires,r),e,t,r):ne({interval:n.interval,start:i,last:n.fires[n.fires.length-1],cycle:60,unit:e,anchor:t},r)}function ee(n,e){if(n.startToken.indexOf("-")!==-1)return"at "+hn(n.fires,e);let t=n.startToken==="*"?0:+n.startToken,r=n.interval;return t===0?"every "+h(r,e)+" hours":n.fires.length<=3?"at "+hn(n.fires,e):"every "+h(r,e)+" hours from "+f({hour:t,minute:0},e)}function dn(n,e){let{start:t,interval:r,last:i}=n,u="every "+h(r,e)+" hours",o=24%r===0;return t===0&&o?u:t<r&&o?u+" from "+f({hour:t,minute:0},e):u+" from "+f({hour:t,minute:0},e)+g(e)+f({hour:i,minute:0},e)}function $(n,e){let t=te(n);return!t||rn(t)?null:dn(t,e)}function te(n){let e=c(n,"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=Y(e);return t&&In(t)}function kn(n){return n.pattern.second==="*"||n.shapes.second==="step"}function re(n,e,t){if(e===0)return kn(n)?x(n,"minute",t)+" for one minute":x(n,"hour",t);let r=h(e,t)+" "+N(e,"minute")+" past the hour";return n.pattern.second==="0"?r:x(n,"minute",t)+", "+r}function Sn(n,e,t){let r=te(n);if(!r)return null;let i=(r.last-r.start)/r.interval+1;if(n.pattern.second==="0"&&i<=E&&rn(r))return null;let u=e===0&&kn(n)&&Et(n);return u?x(n,"minute",t)+" for one minute "+yn(u,t)+a(n,t):e===0&&n.pattern.second==="0"?dn(r,t)+a(n,t):re(n,e,t)+", "+dn(r,t)+a(n,t)}function Et(n){let e=c(n,"hour"),t=e.length===1&&e[0];return!t||t.kind!=="step"||t.startToken.indexOf("-")!==-1||!(t.interval in Gn)?null:t}function Dt(n){return c(n,"hour").some(function(t){return t.kind==="range"})}function jt(n,e){let t=[],r=Xn(n);c(n,"hour").forEach(function(s){s.kind==="range"&&t.push(V({continuous:!1,from:+s.bounds[0],throughMinute:0,to:+s.bounds[1]},e))});let i="every hour "+y(t,e),u=r.map(function(s){return f({hour:s,minute:0},e)});return i+_n(u,e)}function On(n,e,t){return e!==0||!Dt(n)||n.pattern.second==="0"?null:kn(n)?x(n,"minute",t)+" for one minute during the "+Q(n,{minute:0,second:null},!1,t)+" hours"+a(n,t):re(n,e,t)+", "+jt(n,t)+a(n,t)}function Nn(){return function(e){return""+e}}function ie(n,e){return n>1?function(r){return""+r}:function(r){return h(r,e)}}function Kn(n,e){return n.map(ie(n.length,e))}function T(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=ie(t,e);return n.flatMap(function(u){return u.kind==="range"?[r(u.bounds[0])+g(e)+r(u.bounds[1])]:u.kind==="step"?u.fires.map(r):[r(u.value)]})}function P(n,e,t,r){return"at "+y(n,r)+" "+e+"s past the "+t}function At(n,e,t){return(+n==0||+n==12)&&+e==0&&!(typeof t=="number"&&t>0)}function zn(n){let e=n.filter(function(r){return At(r.hour,r.minute,r.second)});return e.length>0&&e.length<n.length}function hn(n,e){let t=zn(n.map(function(u){return{hour:u,minute:0}})),r=n.map(function(u){return f({hour:u,minute:0,plain:t},e)});return y(r,e)}function Ut(n){return n.kind==="fires"&&n.fires.length===1}function q(n,e,t,r){return e.kind==="fires"?hn(e.fires,r):Q(n,{minute:0,second:null},t,r)}function qt(n){return n.kind==="range"?n.bounds:n.kind==="step"?n.fires:[n.value]}function Q(n,e,t,r){let{minute:i,second:u}=e,o=c(n,"hour"),s=zn(o.flatMap(function(p){return qt(p).map(function(nn){return{hour:+nn,minute:i,second:u}})})),m=[];return o.forEach(function(p){p.kind==="step"?m.push(...p.fires.map(function(nn){return f({hour:nn,minute:i,second:u,plain:s},r)})):p.kind==="range"?m.push(f({hour:p.bounds[0],minute:i,second:u,plain:s},r)+g(r)+f({hour:p.bounds[1],minute:i,second:u,plain:s},r)):m.push(f({hour:p.value,minute:i,second:u,plain:s},r))}),y(Qt(m,o,t),r)}function Qt(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 ue(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 ue(n," and ",e)}function Vt(n,e){return ue(n," or ",e)}var $t={all:"",month:"in ",recurringWeekday:!0,stepDate:"on ",weekday:"on "},Rn={all:"every day",month:"every day in ",recurringWeekday:!1,stepDate:"",weekday:"every "};function a(n,e){if(B(n,e))return ae(n,e);let t=Z(n,$t,e);return t&&" "+t}function oe(n,e){return B(n,e)?"":Z(n,Rn,e)+" "}function Z(n,e,t){let r=n.pattern;if(r.date!=="*"&&r.weekday!=="*")return Bt(n,t);if(r.date!=="*")return Jt(n,e,t);if(r.weekday!=="*"){let i=vn(r.weekday,t);return i?gn(i,n,t):e.weekday+de(n,e.recurringWeekday,t)+ce(n,t)}return r.month!=="*"?e.month+O(n,t):e.all}function Jt(n,e,t){let r=n.pattern,i=X(r.date,t);return i?gn(i,n,t):W(r.date)?gn(e.stepDate+fe(r.date),n,t):r.month!=="*"&&!se(n)?"on the "+pn(n,t)+ce(n,t):r.month!=="*"?"on "+le(n,t):"on the "+pn(n,t)}function se(n){return!me(n.pattern.month)&&c(n,"month").every(function(t){return t.kind!=="range"})}function B(n,e){return n.pattern.date!=="*"&&n.pattern.weekday!=="*"&&!!e.style.untilWindow&&!e.short}function ae(n,e){let t=[...Yt(n,e),...Gt(n,e)];return" whenever the day is "+Vt(t,e)}function Kt(n,e){return n.pattern.month==="*"?"":"in "+O(n,e)+" "}function Yt(n,e){let t=n.pattern.date,r=X(t,e);if(r)return[r.replace(/^on /,"")];let i=Zt(t);if(i)return[i];let u=[];return c(n,"date").forEach(function(s){s.kind==="range"?u.push("from the "+b(s.bounds[0])+g(e)+"the "+b(s.bounds[1])):s.kind==="step"?s.fires.forEach(function(k){u.push("the "+b(k))}):u.push("the "+b(s.value))}),u}function Gt(n,e){let t=n.pattern.weekday,r=vn(t,e);if(r)return[r.replace(/^on /,"")];let i=[];return c(n,"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 "+w(o.bounds[0],e)+g(e)+"a "+w(o.bounds[1],e)):o.kind==="step"?o.fires.forEach(function(m){i.push("a "+w(m,e))}):i.push("a "+w(o.value,e))}),i}function Zt(n){if(!W(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 Bt(n,e){let t=n.pattern,r=vn(t.weekday,e)||"on "+de(n,!1,e);return t.month!=="*"&&se(n)&&!X(t.date,e)&&!W(t.date)?"on "+le(n,e)+" or "+r+" in "+O(n,e):Xt(n,e)+" or "+r+_t(n,e)}function Xt(n,e){let t=n.pattern,r=X(t.date,e);return r||(W(t.date)?fe(t.date):"on the "+pn(n,e))}function _t(n,e){return n.pattern.month==="*"?"":", in "+O(n,e)}function X(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 h(+t[1],e)+" "+N(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 vn(n,e){let t=n.split("#");if(t.length===2)return"on the "+nt[+t[1]]+" "+w(t[0],e)+" of the month";if(/L$/.test(n))return"on the last "+w(n.slice(0,-1),e)+" of the month"}function le(n,e){let t=O(n,e),r=_(c(n,"date"),e.style.ordinals?b:nr,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 nr(n){return""+n}function ce(n,e){return n.pattern.month==="*"?"":" in "+O(n,e)}function gn(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 "+O(e,t):r&&(e.shapes.month==="single"||e.shapes.month==="step")?n.replace(" of the month","")+" in "+O(e,t):n+" in "+O(e,t)}function fe(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 pn(n,e){return _(c(n,"date"),b,e)}function O(n,e){let t=me(n.pattern.month);return t||_(c(n,"month"),function(i){return or(i,e)},e)}function me(n){if(!W(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 de(n,e,t){let r=Cn(c(n,"weekday")),i=r.some(function(s){return s.kind==="range"});return _(r,e&&!i?function(s){return er(s,t)}:function(s){return w(s,t)},t)}function er(n,e){let t=w(n,e);return e.short?t:t+"s"}function _(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(g(t))):r.push(e(u.value))}),y(r,t)}function tr(n,e,t){let r=e.pattern.year;if(r==="*")return n;if(r.indexOf("/")!==-1)return n+", "+ir(r,t);let i=rr(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 rr(n,e){return n.indexOf(",")!==-1?y(n.split(","),e):n.indexOf("-")!==-1?n.split("-").join(g(e)):n}function ir(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 "+h(r,e)+" years";return i!=="*"&&i!=="0"&&(u+=" from "+i),u}function f(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?ur({hour:t,minute:r,second:o,plain:i,explicit:u},e):cn({hour:t,minute:r,second:o},{pad:!0,sep:e.style.sep})}function ur(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 cn({hour:t%12||12,minute:r,second:i},{lean:!o,sep:s.sep})+(s.closeUp?"":" ")+(t<12?s.am:s.pm)}function h(n,e){return $n(n,Be,e)}function N(n,e){return+n==1?e:e+"s"}function g(n){return n.short?"-":n.style.through}function b(n){let e=Math.abs(n),t=mn[e];return t||(e=(e%100-20)%10,t=mn[e]||mn[0]),n+t}function or(n,e){let t=Xe[+n];return t&&t[e.short?1:0]}function w(n,e){let t=n===7||n==="7"?0:n,r=v[t]||_e[t];return r&&r[e.short?1:0]}var sr={describe:tt,fallback:"an unrecognizable cron pattern",options:et,reboot:"at system startup",sentence:n=>"Runs "+n+(n.endsWith(".")?"":".")},he=sr;/**
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 ar(n,e){let t=e&&e.lang||he,r=t.options(e);if(!r.lenient)return ge(pe(n,t,r),t,e);try{return ge(pe(n,t,r),t,e)}catch{return t.fallback}}function ge(n,e,t){return t&&t.sentence?e.sentence(n):n}function pe(n,e,t){if(typeof n=="string"&&n.trim().toLowerCase()==="@reboot")return e.reboot;let r=Un(Vn(n,t)),i=e.plan?e.plan(r,r.plan):r.plan;return e.describe({...r,plan:i},t)}var wn=ar;typeof globalThis<"u"&&Object.assign(globalThis,{cronli5:wn});var Kr=wn;})();