!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("angular-cron-translate",[],e):"object"==typeof exports?exports["angular-cron-translate"]=e():t["angular-cron-translate"]=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var r=n(1),o=function(){function t(){}return t.prototype.toString=function(t,e){return r.toString(t,e)},t}();angular.module("ngCronstrue",[]).service("ngCronstrue",o)},function(t,e,n){!function(e,n){t.exports=n()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var r=n(1),o=n(4);r.ExpressionDescriptor.initialize(new o.enLocaleLoader),t.exports=r.ExpressionDescriptor},function(t,e,n){"use strict";var r=n(2),o=n(3),i=function(){function t(e,n){this.expression=e,this.options=n,this.expressionParts=new Array(5),t.locales[n.locale]?this.i18n=t.locales[n.locale]:(console.warn("Locale '"+n.locale+"' could not be found; falling back to 'en'."),this.i18n=t.locales.en),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,s=r.verbose,a=void 0!==s&&s,u=r.dayOfWeekStartIndexZero,c=void 0===u||u,p=r.use24HourTimeFormat,h=r.locale,f=void 0===h?"en":h,y={throwExceptionOnParseError:i,verbose:a,dayOfWeekStartIndexZero:c,use24HourTimeFormat:p,locale:f},l=new t(e,y);return l.getFullDescription()},t.initialize=function(e){t.specialCharacters=["/","-",",","*"],e.load(t.locales)},t.prototype.getFullDescription=function(){var t="";try{var e=new o.CronParser(this.expression,this.options.dayOfWeekStartIndexZero);this.expressionParts=e.parse();var n=this.getTimeOfDayDescription(),r=this.getDayOfMonthDescription(),i=this.getMonthDescription(),s=this.getDayOfWeekDescription(),a=this.getYearDescription();t+=n+r+s+i+a,t=this.transformVerbosity(t,this.options.verbose),t=t.charAt(0).toLocaleUpperCase()+t.substr(1)}catch(u){if(this.options.throwExceptionOnParseError)throw""+u;t=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD()}return t},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(!(n.indexOf("-")>-1)||n.indexOf(",")>-1||r.StringUtilities.containsAny(o,t.specialCharacters))if(o.indexOf(",")>-1&&!r.StringUtilities.containsAny(n,t.specialCharacters)){var s=o.split(",");i+=this.i18n.at();for(var a=0;a<s.length;a++)i+=" ",i+=this.formatTime(s[a],n,""),a<s.length-2&&(i+=","),a==s.length-2&&(i+=this.i18n.spaceAnd())}else{var u=this.getSecondsDescription(),c=this.getMinutesDescription(),p=this.getHoursDescription();i+=u,i.length>0&&(i+=", "),i+=c,i.length>0&&(i+=", "),i+=p}else{var h=n.split("-");i+=r.StringUtilities.format(this.i18n.everyMinutebetweenX0AndX1(),this.formatTime(o,h[0],""),this.formatTime(o,h[1],""))}else i+=this.i18n.atSpace()+this.formatTime(o,n,e);return i},t.prototype.getSecondsDescription=function(){var t=this,e=this.getSegmentDescription(this.expressionParts[0],this.i18n.everysecond(),function(t){return t},function(e){return r.StringUtilities.format(t.i18n.everyX0Seconds(),e)},function(e){return t.i18n.secondsX0ThroughX1PastTheMinute()},function(e){return"0"==e?"":parseInt(e)<20?t.i18n.atX0SecondsPastTheMinute():t.i18n.atX0SecondsPastTheMinuteGt20()||t.i18n.atX0SecondsPastTheMinute()});return e},t.prototype.getMinutesDescription=function(){var t=this,e=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(t){return t},function(e){return r.StringUtilities.format(t.i18n.everyX0Minutes(),e)},function(e){return t.i18n.minutesX0ThroughX1PastTheHour()},function(e){try{return"0"==e?"":parseInt(e)<20?t.i18n.atX0MinutesPastTheHour():t.i18n.atX0MinutesPastTheHourGt20()||t.i18n.atX0MinutesPastTheHour()}catch(n){return t.i18n.atX0MinutesPastTheHour()}});return e},t.prototype.getHoursDescription=function(){var t=this,e=this.expressionParts[2],n=this.getSegmentDescription(e,this.i18n.everyHour(),function(e){return t.formatTime(e,"0","")},function(e){return r.StringUtilities.format(t.i18n.everyX0Hours(),e)},function(e){return t.i18n.betweenX0AndX1()},function(e){return t.i18n.atX0()});return n},t.prototype.getDayOfWeekDescription=function(){var t=this,e=this.i18n.daysOfTheWeek(),n=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(t){var n=t;return t.indexOf("#")>-1?n=t.substr(0,t.indexOf("#")):t.indexOf("L")>-1&&(n=n.replace("L","")),e[parseInt(n)]},function(e){return r.StringUtilities.format(t.i18n.commaEveryX0daysOfTheWeek(),e)},function(e){return t.i18n.commaX0ThroughX1()},function(e){var n=null;if(e.indexOf("#")>-1){var r=e.substring(e.indexOf("#")+1),o=null;switch(r){case"1":o=t.i18n.first();break;case"2":o=t.i18n.second();break;case"3":o=t.i18n.third();break;case"4":o=t.i18n.forth();break;case"5":o=t.i18n.fifth()}n=t.i18n.commaOnThe()+o+t.i18n.spaceX0OfTheMonth()}else n=e.indexOf("L")>-1?t.i18n.commaOnTheLastX0OfTheMonth():t.i18n.commaOnlyOnX0();return n});return n},t.prototype.getMonthDescription=function(){var t=this,e=this.i18n.monthsOfTheYear(),n=this.getSegmentDescription(this.expressionParts[4],"",function(t){return e[parseInt(t)-1]},function(e){return r.StringUtilities.format(t.i18n.commaEveryX0Months(),e)},function(e){return t.i18n.commaMonthX0ThroughMonthX1()||t.i18n.commaX0ThroughX1()},function(e){return t.i18n.commaOnlyInX0()});return n},t.prototype.getDayOfMonthDescription=function(){var t=this,e=null,n=this.expressionParts[3];switch(n){case"L":e=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":e=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var o=n.match(/(\d{1,2}W)|(W\d{1,2})/);if(o){var i=parseInt(o[0].replace("W","")),s=1==i?this.i18n.firstWeekday():r.StringUtilities.format(this.i18n.weekdayNearestDayX0(),i.toString());e=r.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),s);break}e=this.getSegmentDescription(n,this.i18n.commaEveryDay(),function(t){return t},function(e){return"1"==e?t.i18n.commaEveryDay():t.i18n.commaEveryX0Days()},function(e){return t.i18n.commaBetweenDayX0AndX1OfTheMonth()},function(e){return t.i18n.commaOnDayX0OfTheMonth()})}return e},t.prototype.getYearDescription=function(){var t=this,e=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)},function(e){return t.i18n.commaYearX0ThroughYearX1()||t.i18n.commaX0ThroughX1()},function(e){return t.i18n.commaOnlyInX0()});return e},t.prototype.getSegmentDescription=function(t,e,n,o,i,s){var a=this,u=null;if(t)if("*"===t)u=e;else if(r.StringUtilities.containsAny(t,["/","-",","]))if(t.indexOf("/")>-1){var c=t.split("/");if(u=r.StringUtilities.format(o(c[1]),n(c[1])),c[0].indexOf("-")>-1){var p=this.generateBetweenSegmentDescription(c[0],i,n);0!=p.indexOf(", ")&&(u+=", "),u+=p}else if(!r.StringUtilities.containsAny(c[0],["*",","])){var h=r.StringUtilities.format(s(c[0]),n(c[0]));h=h.replace(", ",""),u+=r.StringUtilities.format(this.i18n.commaStartingX0(),h)}}else if(t.indexOf(",")>-1){for(var c=t.split(","),f="",y=0;y<c.length;y++)if(y>0&&c.length>2&&(f+=",",y<c.length-1&&(f+=" ")),y>0&&c.length>1&&(y==c.length-1||2==c.length)&&(f+=this.i18n.spaceAndSpace()),c[y].indexOf("-")>-1){var p=this.generateBetweenSegmentDescription(c[y],function(t){return a.i18n.commaX0ThroughX1()},n);p=p.replace(", ",""),f+=p}else f+=n(c[y]);u=r.StringUtilities.format(s(t),f)}else t.indexOf("-")>-1&&(u=this.generateBetweenSegmentDescription(t,i,n));else u=r.StringUtilities.format(s(t),n(t));else u="";return u},t.prototype.generateBetweenSegmentDescription=function(t,e,n){var o="",i=t.split("-"),s=n(i[0]),a=n(i[1]);a=a.replace(":00",":59");var u=e(t);return o+=r.StringUtilities.format(u,s,a)},t.prototype.formatTime=function(t,e,n){var r=parseInt(t),o="";this.options.use24HourTimeFormat||(o=r>=12?" PM":" AM",r>12&&(r-=12));var i=e,s="";return n&&(s=":"+("00"+n).substring(n.length)),("00"+r.toString()).substring(r.toString().length)+":"+("00"+i.toString()).substring(i.toString().length)+s+o},t.prototype.transformVerbosity=function(t,e){return e||(t=t.replace(new RegExp(this.i18n.commaEveryMinute(),"g"),""),t=t.replace(new RegExp(this.i18n.commaEveryHour(),"g"),""),t=t.replace(new RegExp(this.i18n.commaEveryDay(),"g"),"")),t},t.locales={},t}();e.ExpressionDescriptor=i},function(t,e){"use strict";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(){return e.shift()})},t.containsAny=function(t,e){return e.some(function(e){return t.indexOf(e)>-1})},t}();e.StringUtilities=n},function(t,e){"use strict";var n=function(){function t(t,e){void 0===e&&(e=!0),this.expression=t,this.dayOfWeekStartIndexZero=e}return t.prototype.parse=function(){if(!this.expression)throw new Error("Expression is empty");var t=this.expression.trim().split(" ");if(t.length<5)throw new Error("Expression only has "+t.length+" parts.  At least 5 part are required.");if(5==t.length)t.unshift(""),t.push("");else if(6==t.length)/\d{4}$/.test(t[5])?t.unshift(""):t.push("");else if(t.length>7)throw new Error("Expression has "+t.length+" parts; too many!");return this.normalizeExpression(t),t},t.prototype.normalizeExpression=function(t){var e=this;if(t[3]=t[3].replace("?","*"),t[5]=t[5].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/","*/")),0==t[4].indexOf("1/")&&(t[4]=t[4].replace("1/","*/")),0==t[5].indexOf("1/")&&(t[5]=t[5].replace("1/","*/")),0==t[6].indexOf("1/")&&(t[6]=t[6].replace("1/","*/")),t[5]=t[5].replace(/(^\d)|([^#\/\s]\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[3]&&(t[3]="*"),t[3].indexOf("W")>-1&&(t[3].indexOf(",")>-1||t[3].indexOf("-")>-1))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 n={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var r in n)t[5]=t[5].replace(new RegExp(r,"g"),n[r].toString());var o={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 i in o)t[4]=t[4].replace(new RegExp(i,"g"),o[i].toString());"0"==t[0]&&(t[0]="");for(var s=0;s<t.length;s++)if("*/1"==t[s]&&(t[s]="*"),t[s].indexOf("/")>-1&&!/^\*|\-|\,/.test(t[s])){var a=null;switch(s){case 4:a="12";break;case 5:a="6";break;case 6:a="9999";break;default:a=null}if(null!=a){var u=t[s].split("/");t[s]=u[0]+"-"+a+"/"+u[1]}}},t}();e.CronParser=n},function(t,e,n){"use strict";var r=n(5),o=function(){function t(){}return t.prototype.load=function(t){t.en=new r.en},t}();e.enLocaleLoader=o},function(t,e){"use strict";var n=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 occured 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(){return"every %s seconds"},t.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},t.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},t.prototype.everyX0Minutes=function(){return"every %s minutes"},t.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},t.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},t.prototype.everyX0Hours=function(){return"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.first=function(){return"first"},t.prototype.second=function(){return"second"},t.prototype.third=function(){return"third"},t.prototype.forth=function(){return"forth"},t.prototype.fifth=function(){return"fifth"},t.prototype.commaOnThe=function(){return", on the "},t.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},t.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},t.prototype.commaOnlyOnX0=function(){return", only 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.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.commaEveryX0Days=function(){return", every %s days"},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.spaceAndSpace=function(){return" and "},t.prototype.commaEveryMinute=function(){return", every minute"},t.prototype.commaEveryHour=function(){return", every hour"},t.prototype.commaEveryX0Years=function(){return", 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}();e.en=n}])})}])});