cronstrue
Version:
Convert cron expressions into human readable descriptions
1 lines • 25.7 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("cronstrue",[],e):"object"==typeof exports?exports.cronstrue=e():t.cronstrue=e()}(globalThis,(()=>(()=>{"use strict";var t={6949(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.CronParser=void 0;var r=n(9515),o=function(){function t(t,e,n){void 0===e&&(e=!0),void 0===n&&(n=!1),this.expression=t,this.dayOfWeekStartIndexZero=e,this.monthStartIndexZero=n}return t.prototype.parse=function(){var t,e,n=null!==(t=this.expression)&&void 0!==t?t:"";if("@reboot"===n)return e=["@reboot","","","","","",""];if(n.startsWith("@")){var r=this.parseSpecial(this.expression);e=this.extractParts(r)}else e=this.extractParts(this.expression);return this.normalize(e),this.validate(e),e},t.prototype.parseSpecial=function(t){var e={"@yearly":"0 0 1 JAN *","@annually":"0 0 1 JAN *","@monthly":"0 0 1 * *","@weekly":"0 0 * * SUN","@daily":"0 0 * * *","@midnight":"0 0 * * *","@hourly":"0 * * * *","@reboot":"@reboot"}[t];if(!e)throw new Error("Unknown special expression.");return e},t.prototype.extractParts=function(t){if(!this.expression)throw new Error("cron expression is empty");for(var e=t.trim().split(/[ ]+/),n=0;n<e.length;n++)if(e[n].includes(",")){var r=e[n].split(",").map((function(t){return t.trim()})).filter((function(t){return""!==t})).map((function(t){return isNaN(Number(t))?t:Number(t)})).filter((function(t){return null!==t&&""!==t}));0===r.length&&r.push("*"),r.sort((function(t,e){return null!==t&&null!==e?t-e:0})),e[n]=r.map((function(t){return null!==t?t.toString():""})).join(",")}if(e.length<5)throw new Error("Expression has only ".concat(e.length," part").concat(1==e.length?"":"s",". At least 5 parts are required."));if(5==e.length)e.unshift(""),e.push("");else if(6==e.length){/\d{4}$/.test(e[5])||"?"==e[4]||"?"==e[2]?e.unshift(""):e.push("")}else if(e.length>7)throw new Error("Expression has ".concat(e.length," parts; too many!"));return e},t.prototype.normalize=function(t){for(var e=this,n=0;n<t.length;n++)t[n]=t[n].toUpperCase();t[3]=t[3].replace("?","*"),t[5]=t[5].replace("?","*"),t[2]=t[2].replace("?","*"),0==t[0].indexOf("0/")&&(t[0]=t[0].replace("0/","*/")),0==t[1].indexOf("0/")&&(t[1]=t[1].replace("0/","*/")),0==t[2].indexOf("0/")&&(t[2]=t[2].replace("0/","*/")),0==t[3].indexOf("1/")&&(t[3]=t[3].replace("1/","*/")),this.monthStartIndexZero||0!=t[4].indexOf("1/")||(t[4]=t[4].replace("1/","*/")),0==t[6].indexOf("1/")&&(t[6]=t[6].replace("1/","*/")),t[5]=t[5].replace(/(^\d+)|([^#/\s\d]\d+)/g,(function(t){var n=t.replace(/\D/,""),r=n;return e.dayOfWeekStartIndexZero?"7"==n&&(r="0"):r=(parseInt(n)-1).toString(),t.replace(n,r)})),t[5]=t[5].split(",").map((function(t){return"L"==t?"6":t})).join(","),"?"==t[3]&&(t[3]="*");if(t[3].indexOf("W")>-1&&(t[3].indexOf(",")>-1||/[-+]/.test(t[3]))&&!/^\d{1,2}W[+-]\d{1,2}$/.test(t[3]))throw new Error("The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.");var r={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var o in r)t[5]=t[5].replace(new RegExp(o,"gi"),r[o].toString());t[4]=t[4].replace(/(^\d{1,2})|([^#/\s\d]\d{1,2})/g,(function(t){var n=t.replace(/\D/,""),r=n;return e.monthStartIndexZero&&(r=(parseInt(n)+1).toString()),t.replace(n,r)}));var i={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var a in i)t[4]=t[4].replace(new RegExp(a,"gi"),i[a].toString());"0"==t[0]&&(t[0]=""),/\*|\-|\,|\//.test(t[2])||!/\*|\//.test(t[1])&&!/\*|\//.test(t[0])||(t[2]+="-".concat(t[2]));for(n=0;n<t.length;n++)if(-1!=t[n].indexOf(",")&&(t[n]=t[n].split(",").filter((function(t){return""!==t})).join(",")||"*"),"*/1"==t[n]&&(t[n]="*"),t[n].indexOf("/")>-1&&!/^\*|\-|\,/.test(t[n])){var s=null;switch(n){case 4:s="12";break;case 5:s="6";break;case 6:s="9999";break;default:s=null}if(null!==s){var u=t[n].split("/");t[n]="".concat(u[0],"-").concat(s,"/").concat(u[1])}}},t.prototype.validate=function(t){var e="0-9,\\-*/";this.validateOnlyExpectedCharactersFound(t[0],e),this.validateOnlyExpectedCharactersFound(t[1],e),this.validateOnlyExpectedCharactersFound(t[2],e),this.validateOnlyExpectedCharactersFound(t[3].replace(/^(\d{1,2}W)[+-]\d{1,2}$/,"$1"),"0-9,\\-*/LW"),this.validateOnlyExpectedCharactersFound(t[4],e),this.validateOnlyExpectedCharactersFound(t[5],"0-9,\\-*/L#"),this.validateOnlyExpectedCharactersFound(t[6],e),this.validateAnyRanges(t)},t.prototype.validateAnyRanges=function(t){t.forEach((function(t){return r.default.stepRange(t)})),r.default.secondRange(t[0]),r.default.minuteRange(t[1]),r.default.hourRange(t[2]),r.default.dayOfMonthRange(t[3]),r.default.monthRange(t[4],this.monthStartIndexZero),r.default.dayOfWeekRange(t[5],this.dayOfWeekStartIndexZero)},t.prototype.validateOnlyExpectedCharactersFound=function(t,e){var n=t.match(new RegExp("[^".concat(e,"]+"),"gi"));if(n&&n.length)throw new Error("Expression contains invalid values: '".concat(n.toString(),"'"))},t}();e.CronParser=o},8333(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.ExpressionDescriptor=void 0;var r=n(1823),o=n(6949),i=function(){function t(e,n){if(this.expression=e,this.options=n,this.expressionParts=new Array(5),!this.options.locale&&t.defaultLocale&&(this.options.locale=t.defaultLocale),!t.locales[this.options.locale]){var r=Object.keys(t.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(r,"'.")),this.options.locale=r}this.i18n=t.locales[this.options.locale],void 0===n.use24HourTimeFormat&&(n.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return t.toString=function(e,n){var r=void 0===n?{}:n,o=r.throwExceptionOnParseError,i=void 0===o||o,a=r.verbose,s=void 0!==a&&a,u=r.dayOfWeekStartIndexZero,c=void 0===u||u,h=r.monthStartIndexZero,f=void 0!==h&&h,p=r.use24HourTimeFormat,l=r.trimHoursLeadingZero,d=void 0!==l&&l,m=r.locale,y=void 0===m?null:m,g=r.logicalAndDayFields,v={throwExceptionOnParseError:i,verbose:s,dayOfWeekStartIndexZero:c,monthStartIndexZero:f,use24HourTimeFormat:p,trimHoursLeadingZero:d,locale:y,logicalAndDayFields:void 0!==g&&g};return v.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported."),new t(e,v).getFullDescription()},t.initialize=function(e,n){void 0===n&&(n="en"),t.specialCharacters=["/","-",",","*"],t.defaultLocale=n,e.load(t.locales)},t.prototype.getFullDescription=function(){var t,e,n="";try{var r=new o.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=r.parse(),"@reboot"===this.expressionParts[0])return(null===(e=(t=this.i18n).atReboot)||void 0===e?void 0:e.call(t))||"Run once, at startup";var i=this.getTimeOfDayDescription(),a=this.getDayOfMonthDescription(),s=this.getMonthDescription();n+=i+a+this.getDayOfWeekDescription()+s+this.getYearDescription(),n=(n=this.transformVerbosity(n,!!this.options.verbose)).charAt(0).toLocaleUpperCase()+n.substr(1)}catch(t){if(this.options.throwExceptionOnParseError)throw"".concat(t);n=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD()}return n},t.prototype.getTimeOfDayDescription=function(){var e=this.expressionParts[0],n=this.expressionParts[1],o=this.expressionParts[2],i="";if(r.StringUtilities.containsAny(n,t.specialCharacters)||r.StringUtilities.containsAny(o,t.specialCharacters)||r.StringUtilities.containsAny(e,t.specialCharacters))if(e||!(n.indexOf("-")>-1)||n.indexOf(",")>-1||n.indexOf("/")>-1||r.StringUtilities.containsAny(o,t.specialCharacters))if(!e&&o.indexOf(",")>-1&&-1==o.indexOf("-")&&-1==o.indexOf("/")&&!r.StringUtilities.containsAny(n,t.specialCharacters)){var a=o.split(",");i+=this.i18n.at();for(var s=0;s<a.length;s++)i&&(i+=" "),i+=this.formatTime(a[s],n,""),s<a.length-2&&(i+=","),s==a.length-2&&(i+=this.i18n.spaceAnd())}else{var u=this.getSecondsDescription(),c=this.getMinutesDescription(),h=this.getHoursDescription();if((i+=u)&&c&&(i+=", "),i+=c,c===h)return i;i&&h&&(i+=", "),i+=h}else{var f=n.split("-");i+=r.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(o,f[0],""),this.formatTime(o,f[1],""))}else i+=this.i18n.atSpace()+this.formatTime(o,n,e);return i},t.prototype.getSecondsDescription=function(){var t=this;return this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),(function(t){return t}),(function(e){return r.StringUtilities.format(t.i18n.everyX0Seconds(e),e)}),(function(e){return t.i18n.secondsX0ThroughX1PastTheMinute()}),(function(e){return"0"==e?"":parseInt(e)<20?t.i18n.atX0SecondsPastTheMinute(e):t.i18n.atX0SecondsPastTheMinuteGt20()||t.i18n.atX0SecondsPastTheMinute(e)}),{min:0,max:59})},t.prototype.getMinutesDescription=function(){var t=this,e=this.expressionParts[0],n=this.expressionParts[2];return this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),(function(t){return t}),(function(e){return r.StringUtilities.format(t.i18n.everyX0Minutes(e),e)}),(function(e){return t.i18n.minutesX0ThroughX1PastTheHour()}),(function(r){var o,i;try{return"0"==r&&-1==n.indexOf("/")&&""==e?t.i18n.everyHour():"0"==r?(null===(i=(o=t.i18n).onTheHour)||void 0===i?void 0:i.call(o))||t.i18n.atX0MinutesPastTheHour(r):parseInt(r)<20?t.i18n.atX0MinutesPastTheHour(r):t.i18n.atX0MinutesPastTheHourGt20()||t.i18n.atX0MinutesPastTheHour(r)}catch(e){return t.i18n.atX0MinutesPastTheHour(r)}}),{min:0,max:59})},t.prototype.getHoursDescription=function(){var t=this,e=this.expressionParts[2],n=0,o=[];e.split("/")[0].split(",").forEach((function(t){var e=t.split("-");2===e.length&&o.push({value:e[1],index:n+1}),n+=e.length}));var i=0;return this.getSegmentDescription(e,this.i18n.everyHour(),(function(e){var n=o.find((function(t){return t.value===e&&t.index===i}))&&"0"!==t.expressionParts[1];return i++,n?t.formatTime(e,"59",""):t.formatTime(e,"0","")}),(function(e){return r.StringUtilities.format(t.i18n.everyX0Hours(e),e)}),(function(e){return t.i18n.betweenX0AndX1()}),(function(e){return t.i18n.atX0()}),{min:0,max:23})},t.prototype.getDayOfWeekDescription=function(e){var n,o,i,a,s=this;void 0===e&&(e=this.expressionParts[5]);var u=this.i18n.daysOfTheWeek(),c=null;if("*"==e)c="";else{var h=e.split(","),f=h.filter((function(t){return/[#L]/.test(t)})),p=h.filter((function(t){return!/[#L]/.test(t)}));if(p.length>0&&f.some((function(t){return t.indexOf("#")>-1}))){var l=null!==(n=this.getDayOfWeekDescription(f.join(",")))&&void 0!==n?n:"";return(null!==(o=this.getDayOfWeekDescription(p.join(",")))&&void 0!==o?o:"")+"".concat(this.i18n.spaceAnd()," ")+t.removeLeadingComma(l)}var d=h.filter((function(t){return t.indexOf("L")>-1})),m=h.filter((function(t){return-1===t.indexOf("L")}));if(d.length>0&&m.length>0){var y=null!==(i=this.getDayOfWeekDescription(d.join(",")))&&void 0!==i?i:"";return(null!==(a=this.getDayOfWeekDescription(m.join(",")))&&void 0!==a?a:"")+"".concat(this.i18n.spaceAnd()," ")+t.removeLeadingComma(y)}c=this.getSegmentDescription(e,this.i18n.commaEveryDay(),(function(t,e){var n=t;t.indexOf("#")>-1?n=t.substring(0,t.indexOf("#")):t.indexOf("L")>-1&&(n=n.replace("L",""));var r=parseInt(n),o=s.i18n.daysOfTheWeekInCase?s.i18n.daysOfTheWeekInCase(e)[r]:u[r];if(t.indexOf("#")>-1){var i=null,a=t.substring(t.indexOf("#")+1),c=t.substring(0,t.indexOf("#"));switch(a){case"1":i=s.i18n.first(c);break;case"2":i=s.i18n.second(c);break;case"3":i=s.i18n.third(c);break;case"4":i=s.i18n.fourth(c);break;case"5":i=s.i18n.fifth(c)}o=i+" "+o}return o}),(function(t){return 1==parseInt(t)?"":r.StringUtilities.format(s.i18n.commaEveryX0DaysOfTheWeek(t),t)}),(function(t){var e=t.substring(0,t.indexOf("-"));return"*"!=s.expressionParts[3]?s.i18n.commaAndX0ThroughX1(e):s.i18n.commaX0ThroughX1(e)}),(function(t){var e=null;if(t.indexOf("#")>-1){var n=t.substring(t.indexOf("#")+1),r=t.substring(0,t.indexOf("#"));e=s.i18n.commaOnThe(n,r).trim()+s.i18n.spaceX0OfTheMonth()}else if(t.indexOf("L")>-1)e=s.i18n.commaOnTheLastX0OfTheMonth(t.replace("L",""));else{e="*"!=s.expressionParts[3]?s.options.logicalAndDayFields?s.i18n.commaOnlyOnX0(t):s.i18n.commaAndOnX0():s.i18n.commaOnlyOnX0(t)}return e}))}return c},t.prototype.getMonthDescription=function(){var t=this,e=this.i18n.monthsOfTheYear();return this.getSegmentDescription(this.expressionParts[4],"",(function(n,r){return r&&t.i18n.monthsOfTheYearInCase?t.i18n.monthsOfTheYearInCase(r)[parseInt(n)-1]:e[parseInt(n)-1]}),(function(e){return 1==parseInt(e)?"":r.StringUtilities.format(t.i18n.commaEveryX0Months(e),e)}),(function(e){return t.i18n.commaMonthX0ThroughMonthX1()||t.i18n.commaX0ThroughX1()}),(function(e){return t.i18n.commaOnlyInMonthX0?t.i18n.commaOnlyInMonthX0():t.i18n.commaOnlyInX0()}))},t.removeLeadingComma=function(t){return t.replace(/^[,،,、] ?/,"")},t.hasLeadingComma=function(t){return/^[,،,、]/.test(t)},t.prototype.getDayOfMonthDescription=function(e){var n,o,i,a,s=this;void 0===e&&(e=this.expressionParts[3]);var u=null,c=e,h=c.split(",");if(h.length>1){var f=function(t){return/^L-\d{1,2}$/.test(t)},p=h.filter((function(t){return f(t)})),l=h.filter((function(t){return!f(t)})).sort((function(t,e){return Number(t.indexOf("L")>-1)-Number(e.indexOf("L")>-1)}));if(p.length>0)return(l.length>0?[l.join(",")]:[]).concat(p).map((function(t){var e;return null!==(e=s.getDayOfMonthDescription(t))&&void 0!==e?e:""})).filter((function(t){return""!==t})).map((function(e,n){return 0===n?e:"".concat(s.i18n.spaceAnd()," ")+t.removeLeadingComma(e)})).join("");c=l.join(",")}switch(c){case"L":u=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":u=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var d=c.match(/^(?:(\d{1,2})W|W(\d{1,2}))(?:([+-])(\d{1,2}))?$/);if(d){var m=parseInt(d[1]||d[2]),y=1==m?this.i18n.firstWeekday():r.StringUtilities.format(this.i18n.weekdayNearestDayX0(),m.toString()),g=d[4];u=g?"-"==d[3]?r.StringUtilities.format((null===(o=(n=this.i18n).commaDaysBeforeTheX0OfTheMonth)||void 0===o?void 0:o.call(n,g))||", %s days before the %s of the month",g,y):r.StringUtilities.format((null===(a=(i=this.i18n).commaDaysAfterTheX0OfTheMonth)||void 0===a?void 0:a.call(i,g))||", %s days after the %s of the month",g,y):r.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),y);break}var v=c.match(/L-(\d{1,2})/);if(v){var O=v[1];u=r.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(O),O);break}if("*"==c&&"*"!=this.expressionParts[5])return"";u=this.getSegmentDescription(c,this.i18n.commaEveryDay(),(function(t){return"L"==t?s.i18n.lastDay():s.i18n.dayX0?r.StringUtilities.format(s.i18n.dayX0(),t):t}),(function(t){return"1"==t?s.i18n.commaEveryDay():s.i18n.commaEveryX0Days(t)}),(function(t){return s.i18n.commaBetweenDayX0AndX1OfTheMonth(t)}),(function(t){return"L"==t?s.i18n.commaOnTheLastDayOfTheMonth():s.i18n.commaOnDayX0OfTheMonth(t)}))}return u},t.prototype.getYearDescription=function(){var t=this;return this.getSegmentDescription(this.expressionParts[6],"",(function(t){return/^\d+$/.test(t)?new Date(parseInt(t),1).getFullYear().toString():t}),(function(e){return r.StringUtilities.format(t.i18n.commaEveryX0Years(e),e)}),(function(e){return t.i18n.commaYearX0ThroughYearX1()||t.i18n.commaX0ThroughX1()}),(function(e){return t.i18n.commaOnlyInYearX0?t.i18n.commaOnlyInYearX0():t.i18n.commaOnlyInX0()}))},t.prototype.getSegmentDescription=function(e,n,o,i,a,s,u){var c=null,h=e.indexOf("/")>-1,f=e.indexOf("-")>-1,p=e.indexOf(",")>-1;if(e)if("*"===e)c=n;else if(h||f||p)if(p){for(var l=e.split(","),d="",m=this.i18n.spaceAnd(),y=0;y<l.length;y++)if(y>0&&l.length>2&&(d+=",",y<l.length-1&&(d+=" ")),y>0&&l.length>1&&(y==l.length-1||2==l.length)&&(d+=","==m&&l.length>2?" ":"".concat(m," ")),l[y].indexOf("/")>-1||l[y].indexOf("-")>-1){var g=l[y].indexOf("-")>-1&&-1==l[y].indexOf("/"),v=this.getSegmentDescription(l[y],n,o,i,g?this.i18n.commaX0ThroughX1:a,s);(g||y>0)&&(v=t.removeLeadingComma(v)),d+=v}else if(h){var O=this.getSegmentDescription(l[y],n,o,i,a,s);y>0&&O&&(O=t.removeLeadingComma(O)),d+=O}else d+=o(l[y]);c=h?d:r.StringUtilities.format(s(e),d)}else if(h){l=e.split("/");if(c=r.StringUtilities.format(i(l[1]),l[1]),l[0].indexOf("-")>-1){var x=this.generateRangeSegmentDescription(l[0],a,o);t.hasLeadingComma(x)||(c+=", "),c+=x}else if(-1==l[0].indexOf("*")){var T=r.StringUtilities.format(s(l[0]),o(l[0]));T=t.removeLeadingComma(T),c+=r.StringUtilities.format(this.i18n.commaStartingX0(),T)}c+=this.getWrappingIncrementDescription(e,u,n,o,i,a,s)}else f&&(c=this.generateRangeSegmentDescription(e,a,o));else c=r.StringUtilities.format(s(e),o(e));else c="";return c},t.prototype.getWrappingIncrementDescription=function(t,e,n,r,o,i,a){if(!this.options.verbose||!e)return"";var s=t.split("/"),u=s[0],c=s[1],h=parseInt(c),f=e.max-e.min+1,p="*"===u,l=Number.isInteger(h)&&h>1;if(!p||!l||l&&f%h==0)return"";for(var d=[],m=e.min;m<=e.max;m+=h)d.push(m);if(d.length<2)return"";var y=this.getSegmentDescription(d.join(","),n,r,o,i,a);return y?", ".concat(y):""},t.prototype.generateRangeSegmentDescription=function(t,e,n){var o="",i=t.split("-"),a=n(i[0],1),s=n(i[1],2),u=e(t);return o+=r.StringUtilities.format(u,a,s)},t.prototype.formatTime=function(t,e,n){var r=parseInt(t)+0,o=parseInt(e)+0;o>=60?(o-=60,r+=1):o<0&&(o+=60,r-=1),r>=24?r-=24:r<0&&(r=24+r);var i="",a=!1;this.options.use24HourTimeFormat||(i=(a=!(!this.i18n.setPeriodBeforeTime||!this.i18n.setPeriodBeforeTime()))?"".concat(this.getPeriod(r)," "):" ".concat(this.getPeriod(r)),r>12&&(r-=12),0===r&&(r=12));var s="";n&&(s=":".concat(("00"+n).substring(n.length)));var u=r.toString(),c=("00"+u).substring(u.length),h=o.toString(),f=("00"+h).substring(h.length),p=this.options.trimHoursLeadingZero?u:c;return"".concat(a?i:"").concat(p,":").concat(f).concat(s).concat(a?"":i)},t.prototype.transformVerbosity=function(t,e){if(!e&&(t=(t=(t=(t=t.replace(new RegExp(", ".concat(this.i18n.everyMinute(),"(?!\\s*[\\p{L}\\p{N}])"),"gu"),"")).replace(new RegExp(", ".concat(this.i18n.everyHour(),"(?!\\s*[\\p{L}\\p{N}])"),"gu"),"")).replace(new RegExp("".concat(this.i18n.commaEveryDay(),"(?!\\s*[\\p{L}\\p{N}])"),"gu"),"")).replace(/\, ?$/,""),this.i18n.conciseVerbosityReplacements))for(var n=0,r=Object.entries(this.i18n.conciseVerbosityReplacements());n<r.length;n++){var o=r[n],i=o[0],a=o[1];t=t.replace(new RegExp(i,"g"),a)}return t},t.prototype.getPeriod=function(t){return t>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},t.locales={},t}();e.ExpressionDescriptor=i},3747(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.enLocaleLoader=void 0;var r=n(9486),o=function(){function t(){}return t.prototype.load=function(t){t.en=new r.en},t}();e.enLocaleLoader=o},9486(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.en=void 0;var n=function(t){return 1===Number(t)},r=function(){function t(){}return t.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},t.prototype.atX0MinutesPastTheHourGt20=function(){return null},t.prototype.commaMonthX0ThroughMonthX1=function(){return null},t.prototype.commaYearX0ThroughYearX1=function(){return null},t.prototype.use24HourTimeFormatByDefault=function(){return!1},t.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},t.prototype.everyMinute=function(){return"every minute"},t.prototype.everyHour=function(){return"every hour"},t.prototype.atSpace=function(){return"At "},t.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},t.prototype.at=function(){return"At"},t.prototype.spaceAnd=function(){return" and"},t.prototype.everySecond=function(){return"every second"},t.prototype.everyX0Seconds=function(t){return n(t)?"every %s second":"every %s seconds"},t.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},t.prototype.atX0SecondsPastTheMinute=function(t){return n(t)?"at %s second past the minute":"at %s seconds past the minute"},t.prototype.everyX0Minutes=function(t){return n(t)?"every %s minute":"every %s minutes"},t.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},t.prototype.atX0MinutesPastTheHour=function(t){return n(t)?"at %s minute past the hour":"at %s minutes past the hour"},t.prototype.everyX0Hours=function(t){return n(t)?"every %s hour":"every %s hours"},t.prototype.betweenX0AndX1=function(){return"between %s and %s"},t.prototype.atX0=function(){return"at %s"},t.prototype.commaEveryDay=function(){return", every day"},t.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},t.prototype.commaX0ThroughX1=function(){return", %s through %s"},t.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},t.prototype.first=function(){return"first"},t.prototype.second=function(){return"second"},t.prototype.third=function(){return"third"},t.prototype.fourth=function(){return"fourth"},t.prototype.fifth=function(){return"fifth"},t.prototype.commaOnThe=function(){return", on the "},t.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},t.prototype.lastDay=function(){return"the last day"},t.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},t.prototype.commaOnlyOnX0=function(){return", only on %s"},t.prototype.commaAndOnX0=function(){return", and on %s"},t.prototype.commaEveryX0Months=function(){return", every %s months"},t.prototype.commaOnlyInX0=function(){return", only in %s"},t.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},t.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},t.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(t){return n(t)?", %s day before the last day of the month":", %s days before the last day of the month"},t.prototype.firstWeekday=function(){return"first weekday"},t.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},t.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},t.prototype.commaDaysBeforeTheX0OfTheMonth=function(t){return n(t)?", %s day before the %s of the month":", %s days before the %s of the month"},t.prototype.commaDaysAfterTheX0OfTheMonth=function(t){return n(t)?", %s day after the %s of the month":", %s days after the %s of the month"},t.prototype.commaEveryX0Days=function(){return", every %s days in a month"},t.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},t.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},t.prototype.commaEveryHour=function(){return", every hour"},t.prototype.commaEveryX0Years=function(t){return n(t)?", every %s year":", every %s years"},t.prototype.commaStartingX0=function(){return", starting %s"},t.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},t.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},t.prototype.atReboot=function(){return"Run once, at startup"},t.prototype.onTheHour=function(){return"on the hour"},t}();e.en=r},9515(t,e){function n(t,e){if(!t)throw new Error(e)}function r(t){var e=[];if(!isNaN(parseInt(t,10))){e.push(parseInt(t,10));var n=t.match(/^\d+-(-?\d+)/);n&&e.push(parseInt(n[1],10))}return e}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(){}return t.stepRange=function(t){for(var e=t.split(","),r=0;r<e.length;r++){var o=e[r].split("/")[1];n(void 0===o||!/^0+$/.test(o),"step value must be greater than 0")}},t.secondRange=function(t){for(var e=t.split(","),o=0;o<e.length;o++)for(var i=0,a=r(e[o]);i<a.length;i++){var s=a[i];n(s>=0&&s<=59,"seconds part must be >= 0 and <= 59")}},t.minuteRange=function(t){for(var e=t.split(","),o=0;o<e.length;o++)for(var i=0,a=r(e[o]);i<a.length;i++){var s=a[i];n(s>=0&&s<=59,"minutes part must be >= 0 and <= 59")}},t.hourRange=function(t){for(var e=t.split(","),o=0;o<e.length;o++)for(var i=0,a=r(e[o]);i<a.length;i++){var s=a[i];n(s>=0&&s<=23,"hours part must be >= 0 and <= 23")}},t.dayOfMonthRange=function(t){for(var e=t.split(","),o=0;o<e.length;o++)for(var i=0,a=r(e[o]);i<a.length;i++){var s=a[i];n(s>=1&&s<=31,"DOM part must be >= 1 and <= 31")}},t.monthRange=function(t,e){for(var o=t.split(","),i=0;i<o.length;i++)for(var a=0,s=r(o[i]);a<s.length;a++){var u=s[a];n(u>=1&&u<=12,e?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},t.dayOfWeekRange=function(t,e){for(var o=t.split(","),i=0;i<o.length;i++){if(o[i].indexOf("#")>-1){var a=o[i].substring(o[i].indexOf("#")+1);n(/^[1-5]$/.test(a),"DOW nth weekday must be >= 1 and <= 5")}for(var s=0,u=r(o[i]);s<u.length;s++){var c=u[s];n(c>=0&&c<=6,e?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}}},t}();e.default=o},1823(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.StringUtilities=void 0;var n=function(){function t(){}return t.format=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.replace(/%s/g,(function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return e.shift()}))},t.containsAny=function(t,e){return e.some((function(e){return t.indexOf(e)>-1}))},t}();e.StringUtilities=n}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}var r={};return(()=>{var t=r;Object.defineProperty(t,"__esModule",{value:!0}),t.toString=void 0;var e=n(8333),o=n(3747);e.ExpressionDescriptor.initialize(new o.enLocaleLoader),t.default=e.ExpressionDescriptor;var i=e.ExpressionDescriptor.toString;t.toString=i})(),r})()));