diff --git a/dist/chrono.js b/dist/chrono.js index 60443aa6..8fbc3a31 100644 --- a/dist/chrono.js +++ b/dist/chrono.js @@ -1761,9 +1761,9 @@ exports.Parser = function ENDeadlineFormatParser() { date = date.add(num, 'year'); } - result.start.imply('year', date.year()); - result.start.imply('month', date.month() + 1); - result.start.imply('day', date.date()); + result.start.assign('year', date.year()); + result.start.assign('month', date.month() + 1); + result.start.assign('day', date.date()); return result; } @@ -1775,12 +1775,12 @@ exports.Parser = function ENDeadlineFormatParser() { date = date.add(num, 'second'); } - result.start.imply('year', date.year()); - result.start.imply('month', date.month() + 1); - result.start.imply('day', date.date()); - result.start.imply('hour', date.hour()); - result.start.imply('minute', date.minute()); - result.start.imply('second', date.second()); + result.start.assign('year', date.year()); + result.start.assign('month', date.month() + 1); + result.start.assign('day', date.date()); + result.start.assign('hour', date.hour()); + result.start.assign('minute', date.minute()); + result.start.assign('second', date.second()); result.tags['ENDeadlineFormatParser'] = true; return result; }; diff --git a/dist/chrono.js.map b/dist/chrono.js.map index aae23013..a8d5a8a2 100644 --- a/dist/chrono.js.map +++ b/dist/chrono.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://chrono/webpack/universalModuleDefinition","webpack://chrono/webpack/bootstrap","webpack://chrono/./src/result.js","webpack://chrono/./src/parsers/parser.js","webpack://chrono/./node_modules/dayjs/dayjs.min.js","webpack://chrono/./src/refiners/refiner.js","webpack://chrono/./src/utils/EN.js","webpack://chrono/./src/refiners/en/ENMergeDateTimeRefiner.js","webpack://chrono/./src/parsers/en/ENWeekdayParser.js","webpack://chrono/./src/utils/ZH-Hant.js","webpack://chrono/./src/utils/DE.js","webpack://chrono/./src/refiners/en/ENMergeDateRangeRefiner.js","webpack://chrono/./src/utils/FR.js","webpack://chrono/./src/utils/NL.js","webpack://chrono/./src/chrono.js","webpack://chrono/./src/options.js","webpack://chrono/./src/parsers/en/ENISOFormatParser.js","webpack://chrono/./src/parsers/en/ENDeadlineFormatParser.js","webpack://chrono/./src/parsers/en/ENRelativeDateFormatParser.js","webpack://chrono/./src/parsers/en/ENMonthNameLittleEndianParser.js","webpack://chrono/./src/parsers/en/ENMonthNameMiddleEndianParser.js","webpack://chrono/./src/parsers/en/ENMonthNameParser.js","webpack://chrono/./src/parsers/en/ENSlashDateFormatParser.js","webpack://chrono/./src/parsers/en/ENSlashDateFormatStartWithYearParser.js","webpack://chrono/./src/parsers/en/ENSlashMonthFormatParser.js","webpack://chrono/./src/parsers/en/ENTimeAgoFormatParser.js","webpack://chrono/./src/parsers/en/ENTimeExpressionParser.js","webpack://chrono/./src/parsers/en/ENTimeLaterFormatParser.js","webpack://chrono/./src/parsers/en/ENCasualDateParser.js","webpack://chrono/./src/parsers/en/ENCasualTimeParser.js","webpack://chrono/./src/parsers/ja/JPStandardParser.js","webpack://chrono/./src/utils/JP.js","webpack://chrono/./src/parsers/ja/JPCasualDateParser.js","webpack://chrono/./src/parsers/pt/PTCasualDateParser.js","webpack://chrono/./src/parsers/pt/PTDeadlineFormatParser.js","webpack://chrono/./src/parsers/pt/PTMonthNameLittleEndianParser.js","webpack://chrono/./src/utils/PT.js","webpack://chrono/./src/parsers/pt/PTSlashDateFormatParser.js","webpack://chrono/./src/parsers/pt/PTTimeAgoFormatParser.js","webpack://chrono/./src/parsers/pt/PTTimeExpressionParser.js","webpack://chrono/./src/parsers/pt/PTWeekdayParser.js","webpack://chrono/./src/parsers/es/ESCasualDateParser.js","webpack://chrono/./src/parsers/es/ESDeadlineFormatParser.js","webpack://chrono/./src/parsers/es/ESTimeAgoFormatParser.js","webpack://chrono/./src/parsers/es/ESTimeExpressionParser.js","webpack://chrono/./src/parsers/es/ESWeekdayParser.js","webpack://chrono/./src/parsers/es/ESMonthNameLittleEndianParser.js","webpack://chrono/./src/utils/ES.js","webpack://chrono/./src/parsers/es/ESSlashDateFormatParser.js","webpack://chrono/./src/parsers/fr/FRCasualDateParser.js","webpack://chrono/./src/parsers/fr/FRDeadlineFormatParser.js","webpack://chrono/./src/parsers/fr/FRMonthNameLittleEndianParser.js","webpack://chrono/./src/parsers/fr/FRSlashDateFormatParser.js","webpack://chrono/./src/parsers/fr/FRTimeAgoFormatParser.js","webpack://chrono/./src/parsers/fr/FRTimeExpressionParser.js","webpack://chrono/./src/parsers/fr/FRWeekdayParser.js","webpack://chrono/./src/parsers/fr/FRRelativeDateFormatParser.js","webpack://chrono/./node_modules/dayjs/plugin/quarterOfYear.js","webpack://chrono/./src/parsers/zh-Hant/ZHHantDateParser.js","webpack://chrono/./src/parsers/zh-Hant/ZHHantWeekdayParser.js","webpack://chrono/./src/parsers/zh-Hant/ZHHantTimeExpressionParser.js","webpack://chrono/./src/parsers/zh-Hant/ZHHantCasualDateParser.js","webpack://chrono/./src/parsers/zh-Hant/ZHHantDeadlineFormatParser.js","webpack://chrono/./src/parsers/de/DEDeadlineFormatParser.js","webpack://chrono/./src/parsers/de/DEMonthNameLittleEndianParser.js","webpack://chrono/./src/parsers/de/DEMonthNameParser.js","webpack://chrono/./src/parsers/de/DESlashDateFormatParser.js","webpack://chrono/./src/parsers/de/DETimeAgoFormatParser.js","webpack://chrono/./src/parsers/de/DETimeExpressionParser.js","webpack://chrono/./src/parsers/de/DEWeekdayParser.js","webpack://chrono/./src/parsers/de/DECasualDateParser.js","webpack://chrono/./src/parsers/nl/NLMonthNameParser.js","webpack://chrono/./src/parsers/nl/NLMonthNameLittleEndianParser.js","webpack://chrono/./src/parsers/nl/NLSlashDateFormatParser.js","webpack://chrono/./src/parsers/nl/NLWeekdayParser.js","webpack://chrono/./src/parsers/nl/NLTimeExpressionParser.js","webpack://chrono/./src/parsers/nl/NLCasualDateParser.js","webpack://chrono/./src/parsers/nl/NLCasualTimeParser.js","webpack://chrono/./src/refiners/OverlapRemovalRefiner.js","webpack://chrono/./src/refiners/ExtractTimezoneOffsetRefiner.js","webpack://chrono/./src/refiners/ExtractTimezoneAbbrRefiner.js","webpack://chrono/./src/refiners/ForwardDateRefiner.js","webpack://chrono/./src/refiners/UnlikelyFormatFilter.js","webpack://chrono/./src/refiners/en/ENPrioritizeSpecificDateRefiner.js","webpack://chrono/./src/refiners/ja/JPMergeDateRangeRefiner.js","webpack://chrono/./src/refiners/fr/FRMergeDateRangeRefiner.js","webpack://chrono/./src/refiners/fr/FRMergeDateTimeRefiner.js","webpack://chrono/./src/refiners/de/DEMergeDateRangeRefiner.js","webpack://chrono/./src/refiners/de/DEMergeDateTimeRefiner.js","webpack://chrono/./src/refiners/nl/NLMergeDateRangeRefiner.js","webpack://chrono/./src/refiners/nl/NLMergeDateTimeRefiner.js"],"names":["dayjs","require","ParsedResult","result","ref","index","text","tags","start","ParsedComponents","end","prototype","clone","JSON","parse","stringify","date","hasPossibleDates","isPossibleDate","isOnlyWeekday","isOnlyWeekdayComponent","isOnlyDayMonth","isOnlyDayMonthComponent","components","knownValues","impliedValues","key","imply","month","year","component","get","value","assign","isCertain","dateMoment","adjustTimezoneOffset","utcOffset","add","toDate","hour","minute","second","millisecond","currentTimezoneOffset","targetTimezoneOffset","undefined","moment","exports","Parser","config","strictMode","strict","isStrictMode","pattern","extract","match","opt","execute","results","regex","remainingText","exec","length","substring","push","refiners","forEach","refiner","refine","options","findYearClosestToRef","day","refMoment","nextYear","lastYear","Math","abs","diff","ENISOFormatParser","ENDeadlineFormatParser","ENRelativeDateFormatParser","ENMonthNameLittleEndianParser","ENMonthNameMiddleEndianParser","ENMonthNameParser","ENSlashDateFormatParser","ENSlashDateFormatStartWithYearParser","ENSlashMonthFormatParser","ENTimeAgoFormatParser","ENTimeExpressionParser","ENTimeLaterFormatParser","ENWeekdayParser","ENCasualDateParser","ENCasualTimeParser","JPStandardParser","JPCasualDateParser","PTCasualDateParser","PTDeadlineFormatParser","PTMonthNameLittleEndianParser","PTSlashDateFormatParser","PTTimeAgoFormatParser","PTTimeExpressionParser","PTWeekdayParser","ESCasualDateParser","ESDeadlineFormatParser","ESTimeAgoFormatParser","ESTimeExpressionParser","ESWeekdayParser","ESMonthNameLittleEndianParser","ESSlashDateFormatParser","FRCasualDateParser","FRDeadlineFormatParser","FRMonthNameLittleEndianParser","FRSlashDateFormatParser","FRTimeAgoFormatParser","FRTimeExpressionParser","FRWeekdayParser","FRRelativeDateFormatParser","ZHHantDateParser","ZHHantWeekdayParser","ZHHantTimeExpressionParser","ZHHantCasualDateParser","ZHHantDeadlineFormatParser","DEDeadlineFormatParser","DEMonthNameLittleEndianParser","DEMonthNameParser","DESlashDateFormatParser","DETimeAgoFormatParser","DETimeExpressionParser","DEWeekdayParser","DECasualDateParser","NLMonthNameParser","NLMonthNameLittleEndianParser","NLSlashDateFormatParser","NLWeekdayParser","NLTimeExpressionParser","NLCasualDateParser","NLCasualTimeParser","Refiner","Filter","call","isValid","filteredResult","i","OverlapRemovalRefiner","ExtractTimezoneOffsetRefiner","ExtractTimezoneAbbrRefiner","ForwardDateRefiner","UnlikelyFormatFilter","ENMergeDateTimeRefiner","ENMergeDateRangeRefiner","ENPrioritizeSpecificDateRefiner","JPMergeDateRangeRefiner","FRMergeDateRangeRefiner","FRMergeDateTimeRefiner","DEMergeDateRangeRefiner","DEMergeDateTimeRefiner","NLMergeDateRangeRefiner","NLMergeDateTimeRefiner","WEEKDAY_OFFSET","MONTH_OFFSET","MONTH_PATTERN","Object","keys","join","replace","INTEGER_WORDS","INTEGER_WORDS_PATTERN","ORDINAL_WORDS","ORDINAL_WORDS_PATTERN","TIME_UNIT","TIME_UNIT_STRICT","PATTERN_TIME_UNIT","RegExp","TIME_UNIT_PATTERN","TIME_UNIT_STRICT_PATTERN","extractDateTimeUnitFragments","timeunitText","fragments","collectDateTimeFragment","num","toLowerCase","parseFloat","PATTERN","isDateOnly","isTimeOnly","isAbleToMerge","prevResult","curResult","textBetween","mergeDateTimeComponent","dateComponent","timeComponent","dateTimeComponent","mergeResult","dateResult","timeResult","beginDate","beginTime","beginDateTime","endDate","endTime","endDateTime","getTime","startIndex","min","endIndex","max","tag","mergedResult","currResult","DAYS_OFFSET","PREFIX_GROUP","WEEKDAY_GROUP","POSTFIX_GROUP","updateParsedComponent","offset","modifier","startMoment","startMomentFixed","refOffset","apply","arguments","substr","dayOfWeek","prefix","postfix","norm","NUMBER","zhStringToNumber","number","char","zhStringToYear","string","parseInt","result1","result2","begin","fromResult","toResult","timeKeys","fromMoment","toMoment","isBefore","isAfter","tmp","constructor","name","WEEKDAY_PATTERN","parser","Chrono","option","casualOption","parsers","refDate","Date","forwardDate","allResults","concat","sort","a","b","parseDate","strictOption","casual","en","mergeOptions","commonPostProcessing","en_GB","de","nl","pt","es","fr","ja","addedTypes","mergedOption","p","r","strictConfig","zh","unshift","littleEndian","YEAR_NUMBER_GROUP","MONTH_NUMBER_GROUP","DATE_NUMBER_GROUP","HOUR_NUMBER_GROUP","MINUTE_NUMBER_GROUP","SECOND_NUMBER_GROUP","MILLISECOND_NUMBER_GROUP","TZD_HOUR_OFFSET_GROUP","TZD_MINUTE_OFFSET_GROUP","minuteOffset","hourOffset","util","STRICT_PATTERN","MODIFIER_WORD_GROUP","MULTIPLIER_WORD_GROUP","RELATIVE_WORD_GROUP","DATE_GROUP","DATE_NUM_GROUP","DATE_TO_GROUP","DATE_TO_NUM_GROUP","MONTH_NAME_GROUP","YEAR_GROUP","trim","test","weekday","YEAR_BE_GROUP","YEAR_GROUP2","YEAR_BE_GROUP2","yearBE","monthName","OPENNING_GROUP","ENDING_GROUP","FIRST_NUMBERS_GROUP","SECOND_NUMBERS_GROUP","MONTH_GROUP","DAY_GROUP","indexOf","tday","argument","FIRST_REG_PATTERN","SECOND_REG_PATTERN","HOUR_GROUP","MINUTE_GROUP","SECOND_GROUP","MILLI_SECOND_GROUP","AM_PM_HOUR_GROUP","meridiem","ampm","startAtPM","suffix","preamble","lowerText","TIME_MATCH","SPECIAL_YEAR_GROUP","TYPICAL_YEAR_GROUP","ERA_GROUP","toHankaku","String","fromCharCode","alphaNum","token","charCodeAt","toZenkaku","secondMatch","firstMatch","isNaN","quarterOfYear","extend","MULTIPLIER_GROUP","MODIFIER_1_GROUP","MODIFIER_2_GROUP","multiplier","modifierFactor","total","dateFrom","dateTo","relative","startOf","dateTmp","endOf","patternString1","patternString2","DAY_GROUP_1","ZH_AM_PM_HOUR_GROUP_1","ZH_AM_PM_HOUR_GROUP_2","DAY_GROUP_3","ZH_AM_PM_HOUR_GROUP_3","ZHTimeExpressionParser","day1","day3","zhAMPMString1","zhAMPM1","zhAMPMString2","zhAMPM2","zhAMPMString3","zhAMPM3","endMoment","NOW_GROUP","TIME_GROUP_1","TIME_GROUP_2","TIME_GROUP_3","time1","timeString2","time2","timeString3","time3","NUMBER_GROUP","UNIT_GROUP","unit","unitAbbr","filteredResults","TIMEZONE_OFFSET_PATTERN","TIMEZONE_OFFSET_SIGN_GROUP","TIMEZONE_OFFSET_HOUR_OFFSET_GROUP","TIMEZONE_OFFSET_MINUTE_OFFSET_GROUP","timezoneOffset","TIMEZONE_NAME_PATTERN","DEFAULT_TIMEZONE_ABBR_MAP","timezones","timezoneAbbr","toUpperCase","isMoreSpecific","moreSpecific","includesRelativeResult","referToSameDate","specificResult","nonSpecificResult","specificDate","nonSpecificDate","isWeekdayResult"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA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Ac,UAAS/D,IAAT,EAAeqD,OAAf,EAAwBF,GAAxB,EAA6B;AAEvC,QAAIE,OAAO,CAACI,MAAR,GAAiB,CAArB,EAAwB,OAAOJ,OAAP;AAExB,QAAIsJ,YAAY,GAAG,EAAnB;AACA,QAAIC,UAAU,GAAG,IAAjB;AACA,QAAIvB,UAAU,GAAG,IAAjB;;AAEA,SAAK,IAAI5C,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGpF,OAAO,CAACI,MAA5B,EAAoCgF,CAAC,EAArC,EAAyC;AAErCmE,gBAAU,GAAGvJ,OAAO,CAACoF,CAAD,CAApB;AACA4C,gBAAU,GAAGhI,OAAO,CAACoF,CAAC,GAAC,CAAH,CAApB;;AACA,UAAIyC,UAAU,CAAC0B,UAAD,CAAV,IAA0BzB,UAAU,CAACE,UAAD,CAApC,IACOD,aAAa,CAACpL,IAAD,EAAOqL,UAAP,EAAmBuB,UAAnB,CADxB,EACwD;AAEpDvB,kBAAU,GAAGO,WAAW,CAAC5L,IAAD,EAAO4M,UAAP,EAAmBvB,UAAnB,CAAxB;AACAuB,kBAAU,GAAG,IAAb;AACAnE,SAAC,IAAI,CAAL;AACAkE,oBAAY,CAAChJ,IAAb,CAAkB0H,UAAlB;AACH,OAPD,MAOO;AACHsB,oBAAY,CAAChJ,IAAb,CAAkB0H,UAAlB;AACH;AAEJ;;AAED,QAAIuB,UAAU,IAAI,IAAlB,EAAwB;AACpBD,kBAAY,CAAChJ,IAAb,CAAkBiJ,UAAlB;AACH;;AAED,WAAOD,YAAP;AACH,GA9BD;AA+BH,CAnCD,C","file":"chrono.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"chrono\"] = factory();\n\telse\n\t\troot[\"chrono\"] = factory();\n})(this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 12);\n","const dayjs = require('dayjs');\n\nfunction ParsedResult(result){\n result = result || {};\n\n this.ref = result.ref;\n this.index = result.index;\n this.text = result.text;\n this.tags = result.tags || {};\n\n this.start = new ParsedComponents(result.start, result.ref)\n if(result.end){\n this.end = new ParsedComponents(result.end, result.ref)\n }\n}\n\nParsedResult.prototype.clone = function() {\n var result = new ParsedResult(this);\n result.tags = JSON.parse(JSON.stringify(this.tags));\n result.start = this.start.clone();\n if (this.end) {\n result.end = this.end.clone();\n }\n\n return result\n}\n\nParsedResult.prototype.date = function() {\n return this.start.date();\n}\n\nParsedResult.prototype.hasPossibleDates = function() {\n return this.start.isPossibleDate() && (!this.end || this.end.isPossibleDate());\n}\n\nParsedResult.prototype.isOnlyWeekday = function() {\n return this.start.isOnlyWeekdayComponent();\n}\n\nParsedResult.prototype.isOnlyDayMonth = function() {\n return this.start.isOnlyDayMonthComponent();\n}\n\nfunction ParsedComponents (components, ref){\n\n this.knownValues = {};\n this.impliedValues = {};\n\n if (components) {\n for (let key in components) {\n this.knownValues[key] = components[key];\n }\n }\n\n if (ref) {\n ref = dayjs(ref);\n this.imply('day', ref.date())\n this.imply('month', ref.month() + 1)\n this.imply('year', ref.year())\n }\n \n\n this.imply('hour', 12);\n this.imply('minute', 0);\n this.imply('second', 0);\n this.imply('millisecond', 0);\n}\n\nParsedComponents.prototype.clone = function () {\n var component = new ParsedComponents();\n component.knownValues = JSON.parse(JSON.stringify(this.knownValues));\n component.impliedValues = JSON.parse(JSON.stringify(this.impliedValues));\n return component;\n};\n\nParsedComponents.prototype.get = function(component, value) {\n if (component in this.knownValues) return this.knownValues[component];\n if (component in this.impliedValues) return this.impliedValues[component];\n};\n\nParsedComponents.prototype.assign = function(component, value) {\n this.knownValues[component] = value;\n delete this.impliedValues[component];\n};\n\nParsedComponents.prototype.imply = function(component, value) {\n if (component in this.knownValues) return;\n this.impliedValues[component] = value;\n};\n\nParsedComponents.prototype.isCertain = function(component) {\n return component in this.knownValues;\n};\n\nParsedComponents.prototype.isOnlyWeekdayComponent = function() {\n return this.isCertain('weekday') && !this.isCertain('day') && !this.isCertain('month');\n};\n\nParsedComponents.prototype.isOnlyDayMonthComponent = function() {\n return this.isCertain('day') && this.isCertain('month') && !this.isCertain('year');\n};\n\nParsedComponents.prototype.isPossibleDate = function() {\n var dateMoment = this.dayjs();\n if (this.isCertain('timezoneOffset')) {\n const adjustTimezoneOffset = this.get('timezoneOffset') - dateMoment.utcOffset();\n dateMoment = dateMoment.add(adjustTimezoneOffset, 'minutes');\n }\n\n if (dateMoment.get('year') != this.get('year')) return false;\n if (dateMoment.get('month') != this.get('month')-1) return false;\n if (dateMoment.get('date') != this.get('day')) return false;\n if (dateMoment.get('hour') != this.get('hour')) return false;\n if (dateMoment.get('minute') != this.get('minute')) return false;\n\n return true;\n};\n\nParsedComponents.prototype.date = function() {\n var result = this.dayjs();\n return result.toDate();\n};\n\n\nParsedComponents.prototype.dayjs = function() {\n var result = dayjs();\n\n result = result.year(this.get('year'));\n result = result.month(this.get('month') - 1);\n result = result.date(this.get('day'));\n result = result.hour(this.get('hour'));\n result = result.minute(this.get('minute'));\n result = result.second(this.get('second'));\n result = result.millisecond(this.get('millisecond'));\n\n // Javascript Date Object return minus timezone offset\n var currentTimezoneOffset = result.utcOffset();\n var targetTimezoneOffset = this.get('timezoneOffset') !== undefined ? \n this.get('timezoneOffset') : currentTimezoneOffset;\n\n var adjustTimezoneOffset = targetTimezoneOffset - currentTimezoneOffset;\n result = result.add(-adjustTimezoneOffset, 'minute');\n\n return result;\n};\n\nParsedComponents.prototype.moment = function() {\n // Keep for compatibility\n return this.dayjs();\n};\n\n\n\nexports.ParsedComponents = ParsedComponents;\nexports.ParsedResult = ParsedResult;\n","const dayjs = require('dayjs');\n\nexports.Parser = function (config) {\n\n config = config || {};\n var strictMode = config.strict;\n\n this.isStrictMode = function() { return (strictMode == true) };\n\n this.pattern = function() { return /./i; }\n\n this.extract = function(text, ref, match, opt){ return null; }\n\n this.execute = function(text, ref, opt) {\n\n var results = [];\n var regex = this.pattern();\n\n var remainingText = text;\n var match = regex.exec(remainingText);\n\n while (match) {\n\n // Calculate match index on the full text;\n match.index += text.length - remainingText.length;\n\n var result = this.extract(text, ref, match, opt);\n if (result) {\n\n // If success, start from the end of the result\n remainingText = text.substring(result.index + result.text.length);\n\n if (!this.isStrictMode() || result.hasPossibleDates()) {\n results.push(result);\n }\n\n } else {\n // If fail, move on by 1\n remainingText = text.substring(match.index + 1);\n }\n\n match = regex.exec(remainingText);\n }\n\n if (this.refiners) {\n this.refiners.forEach(function () {\n results = refiner.refine(results, text, options);\n });\n }\n\n return results;\n }\n}\n\nexports.findYearClosestToRef = function (ref, day, month) {\n //Find the most appropriated year\n const refMoment = dayjs(ref);\n var dateMoment = refMoment;\n dateMoment = dateMoment.month(month - 1);\n dateMoment = dateMoment.date(day);\n dateMoment = dateMoment.year(refMoment.year())\n\n const nextYear = dateMoment.add(1, 'y');\n const lastYear = dateMoment.add(-1, 'y');\n if( Math.abs(nextYear.diff(refMoment)) < Math.abs(dateMoment.diff(refMoment)) ){\n dateMoment = nextYear;\n }\n else if( Math.abs(lastYear.diff(refMoment)) < Math.abs(dateMoment.diff(refMoment)) ){\n dateMoment = lastYear;\n }\n\n return dateMoment.year();\n}\n\nexports.ENISOFormatParser = require('./en/ENISOFormatParser').Parser;\nexports.ENDeadlineFormatParser = require('./en/ENDeadlineFormatParser').Parser;\nexports.ENRelativeDateFormatParser = require('./en/ENRelativeDateFormatParser').Parser;\nexports.ENMonthNameLittleEndianParser = require('./en/ENMonthNameLittleEndianParser').Parser;\nexports.ENMonthNameMiddleEndianParser = require('./en/ENMonthNameMiddleEndianParser').Parser;\nexports.ENMonthNameParser = require('./en/ENMonthNameParser').Parser;\nexports.ENSlashDateFormatParser = require('./en/ENSlashDateFormatParser').Parser;\nexports.ENSlashDateFormatStartWithYearParser = require('./en/ENSlashDateFormatStartWithYearParser').Parser;\nexports.ENSlashMonthFormatParser = require('./en/ENSlashMonthFormatParser').Parser;\nexports.ENTimeAgoFormatParser = require('./en/ENTimeAgoFormatParser').Parser;\nexports.ENTimeExpressionParser = require('./en/ENTimeExpressionParser').Parser;\nexports.ENTimeLaterFormatParser = require('./en/ENTimeLaterFormatParser').Parser;\nexports.ENWeekdayParser = require('./en/ENWeekdayParser').Parser;\nexports.ENCasualDateParser = require('./en/ENCasualDateParser').Parser;\nexports.ENCasualTimeParser = require('./en/ENCasualTimeParser').Parser;\n\nexports.JPStandardParser = require('./ja/JPStandardParser').Parser;\nexports.JPCasualDateParser = require('./ja/JPCasualDateParser').Parser;\n\nexports.PTCasualDateParser = require('./pt/PTCasualDateParser').Parser;\nexports.PTDeadlineFormatParser = require('./pt/PTDeadlineFormatParser').Parser;\nexports.PTMonthNameLittleEndianParser = require('./pt/PTMonthNameLittleEndianParser').Parser;\nexports.PTSlashDateFormatParser = require('./pt/PTSlashDateFormatParser').Parser;\nexports.PTTimeAgoFormatParser = require('./pt/PTTimeAgoFormatParser').Parser;\nexports.PTTimeExpressionParser = require('./pt/PTTimeExpressionParser').Parser;\nexports.PTWeekdayParser = require('./pt/PTWeekdayParser').Parser;\n\nexports.ESCasualDateParser = require('./es/ESCasualDateParser').Parser;\nexports.ESDeadlineFormatParser = require('./es/ESDeadlineFormatParser').Parser;\nexports.ESTimeAgoFormatParser = require('./es/ESTimeAgoFormatParser').Parser;\nexports.ESTimeExpressionParser = require('./es/ESTimeExpressionParser').Parser;\nexports.ESWeekdayParser = require('./es/ESWeekdayParser').Parser;\nexports.ESMonthNameLittleEndianParser = require('./es/ESMonthNameLittleEndianParser').Parser;\nexports.ESSlashDateFormatParser = require('./es/ESSlashDateFormatParser').Parser;\n\nexports.FRCasualDateParser = require('./fr/FRCasualDateParser').Parser;\nexports.FRDeadlineFormatParser = require('./fr/FRDeadlineFormatParser').Parser;\nexports.FRMonthNameLittleEndianParser = require('./fr/FRMonthNameLittleEndianParser').Parser;\nexports.FRSlashDateFormatParser = require('./fr/FRSlashDateFormatParser').Parser;\nexports.FRTimeAgoFormatParser = require('./fr/FRTimeAgoFormatParser').Parser;\nexports.FRTimeExpressionParser = require('./fr/FRTimeExpressionParser').Parser;\nexports.FRWeekdayParser = require('./fr/FRWeekdayParser').Parser;\nexports.FRRelativeDateFormatParser = require('./fr/FRRelativeDateFormatParser').Parser;\n\nexports.ZHHantDateParser = require('./zh-Hant/ZHHantDateParser').Parser;\nexports.ZHHantWeekdayParser = require('./zh-Hant/ZHHantWeekdayParser').Parser;\nexports.ZHHantTimeExpressionParser = require('./zh-Hant/ZHHantTimeExpressionParser').Parser;\nexports.ZHHantCasualDateParser = require('./zh-Hant/ZHHantCasualDateParser').Parser;\nexports.ZHHantDeadlineFormatParser = require('./zh-Hant/ZHHantDeadlineFormatParser').Parser;\n\nexports.DEDeadlineFormatParser = require('./de/DEDeadlineFormatParser').Parser;\nexports.DEMonthNameLittleEndianParser = require('./de/DEMonthNameLittleEndianParser').Parser;\nexports.DEMonthNameParser = require('./de/DEMonthNameParser').Parser;\nexports.DESlashDateFormatParser = require('./de/DESlashDateFormatParser').Parser;\nexports.DETimeAgoFormatParser = require('./de/DETimeAgoFormatParser').Parser;\nexports.DETimeExpressionParser = require('./de/DETimeExpressionParser').Parser;\nexports.DEWeekdayParser = require('./de/DEWeekdayParser').Parser;\nexports.DECasualDateParser = require('./de/DECasualDateParser').Parser;\n\nexports.NLMonthNameParser = require('./nl/NLMonthNameParser').Parser;\nexports.NLMonthNameLittleEndianParser = require('./nl/NLMonthNameLittleEndianParser').Parser;\nexports.NLSlashDateFormatParser = require('./nl/NLSlashDateFormatParser').Parser;\nexports.NLWeekdayParser = require('./nl/NLWeekdayParser').Parser;\nexports.NLTimeExpressionParser = require('./nl/NLTimeExpressionParser').Parser;\nexports.NLCasualDateParser = require('./nl/NLCasualDateParser').Parser;\nexports.NLCasualTimeParser = require('./nl/NLCasualTimeParser').Parser;\n","!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):t.dayjs=e()}(this,function(){\"use strict\";var t=\"millisecond\",e=\"second\",n=\"minute\",r=\"hour\",i=\"day\",s=\"week\",u=\"month\",o=\"quarter\",a=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},d={s:c,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+c(r,2,\"0\")+\":\"+c(i,2,\"0\")},m:function(t,e){var n=12*(e.year()-t.year())+(e.month()-t.month()),r=t.clone().add(n,u),i=e-r<0,s=t.clone().add(n+(i?-1:1),u);return Number(-(n+(e-r)/(i?r-s:s-r))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:a,w:s,d:i,D:\"date\",h:r,m:n,s:e,ms:t,Q:o}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof v},M=function(t,e,n){var r;if(!t)return l;if(\"string\"==typeof t)m[t]&&(r=t),e&&(m[t]=e,r=t);else{var i=t.name;m[i]=t,r=i}return!n&&r&&(l=r),r||!n&&l},g=function(t,e){if(y(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new v(n)},D=d;D.l=M,D.i=y,D.w=function(t,e){return g(t,{locale:e.$L,utc:e.$u,$offset:e.$offset})};var v=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0),this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(D.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match(h);if(r)return n?new Date(Date.UTC(r[1],r[2]-1,r[3]||1,r[4]||0,r[5]||0,r[6]||0,r[7]||0)):new Date(r[1],r[2]-1,r[3]||1,r[4]||0,r[5]||0,r[6]||0,r[7]||0)}return new Date(e)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,e){var n=g(t);return this.startOf(e)<=n&&n<=this.endOf(e)},d.isAfter=function(t,e){return g(t) toResult.start.date().getTime()) {\n \n var fromMoment = fromResult.start.dayjs();\n var toMoment = toResult.start.dayjs();\n\n if (fromResult.isOnlyWeekday() && fromMoment.add(-7, 'days').isBefore(toMoment)) {\n fromMoment = fromMoment.add(-7, 'days');\n fromResult.start.imply('day', fromMoment.date());\n fromResult.start.imply('month', fromMoment.month() + 1);\n fromResult.start.imply('year', fromMoment.year());\n } else if (toResult.isOnlyWeekday() && toMoment.add(7, 'days').isAfter(fromMoment)) {\n toMoment = toMoment.add(7, 'days');\n toResult.start.imply('day', toMoment.date());\n toResult.start.imply('month', toMoment.month() + 1);\n toResult.start.imply('year', toMoment.year());\n } else {\n var tmp = toResult;\n toResult = fromResult;\n fromResult = tmp;\n }\n }\n \n fromResult.end = toResult.start;\n\n \n\n for (var tag in toResult.tags) {\n fromResult.tags[tag] = true;\n }\n\n \n var startIndex = Math.min(fromResult.index, toResult.index);\n var endIndex = Math.max(\n fromResult.index + fromResult.text.length, \n toResult.index + toResult.text.length);\n \n fromResult.index = startIndex;\n fromResult.text = text.substring(startIndex, endIndex);\n fromResult.tags[this.constructor.name] = true;\n return fromResult;\n }\n};\n\n","exports.WEEKDAY_OFFSET = { \r\n 'dimanche': 0, \r\n 'dim': 0, \r\n 'lundi': 1, \r\n 'lun': 1,\r\n 'mardi': 2, \r\n 'mar':2, \r\n 'mercredi': 3, \r\n 'mer': 3, \r\n 'jeudi': 4, \r\n 'jeu': 4, \r\n 'vendredi': 5, \r\n 'ven': 5,\r\n 'samedi': 6, \r\n 'sam': 6\r\n};\r\n \r\nexports.MONTH_OFFSET = { \r\n 'janvier': 1,\r\n 'jan': 1,\r\n 'jan.': 1,\r\n 'février': 2,\r\n 'fév': 2,\r\n 'fév.': 2,\r\n 'fevrier': 2,\r\n 'fev': 2,\r\n 'fev.': 2,\r\n 'mars': 3,\r\n 'mar': 3,\r\n 'mar.': 3,\r\n 'avril': 4,\r\n 'avr': 4,\r\n 'avr.': 4,\r\n 'mai': 5,\r\n 'juin': 6,\r\n 'jun': 6,\r\n 'juillet': 7,\r\n 'jul': 7,\r\n 'jul.': 7,\r\n 'août': 8,\r\n 'aout': 8,\r\n 'septembre': 9,\r\n 'sep': 9,\r\n 'sep.': 9,\r\n 'sept': 9,\r\n 'sept.': 9,\r\n 'octobre': 10,\r\n 'oct': 10,\r\n 'oct.': 10,\r\n 'novembre': 11,\r\n 'nov': 11,\r\n 'nov.': 11,\r\n 'décembre': 12,\r\n 'decembre': 12,\r\n 'dec': 12,\r\n 'dec.': 12\r\n};\r\n\r\nexports.INTEGER_WORDS_PATTERN = '(?:un|deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize)';\r\nexports.INTEGER_WORDS = {\r\n 'un' : 1,\r\n 'deux' : 2,\r\n 'trois' : 3,\r\n 'quatre' : 4,\r\n 'cinq' : 5,\r\n 'six' : 6,\r\n 'sept' : 7,\r\n 'huit' : 8,\r\n 'neuf' : 9,\r\n 'dix' : 10,\r\n 'onze' : 11,\r\n 'douze' : 12,\r\n 'treize' : 13,\r\n};\r\n","exports.WEEKDAY_OFFSET = {\n 'zondag': 0,\n 'zo': 0,\n 'zo.': 0,\n 'maandag': 1,\n 'ma': 1,\n 'ma.': 1,\n 'dinsdag': 2,\n 'di':2,\n 'di.':2,\n 'woensdag': 3,\n 'wo': 3,\n 'wo.': 3,\n 'donderdag': 4,\n 'do': 4,\n 'do.': 4,\n 'vrijdag': 5,\n 'vr': 5,\n 'vr.': 5,\n 'zaterdag': 6,\n 'za': 6,\n 'za.': 6\n};\n\nexports.WEEKDAY_PATTERN = '(?:'\n + Object.keys(exports.WEEKDAY_OFFSET).join('|').replace(/\\./g, '\\\\.')\n + ')';\n\nexports.MONTH_OFFSET = {\n 'januari': 1,\n 'jan': 1,\n 'jan.': 1,\n 'februari': 2,\n 'feb': 2,\n 'feb.': 2,\n 'maart': 3,\n 'mrt': 3,\n 'mrt.': 3,\n 'april': 4,\n 'apr': 4,\n 'apr.': 4,\n 'mei': 5,\n 'juni': 6,\n 'jun': 6,\n 'jun.': 6,\n 'juli': 7,\n 'jul': 7,\n 'jul.': 7,\n 'augustus': 8,\n 'aug': 8,\n 'aug.': 8,\n 'september': 9,\n 'sep': 9,\n 'sep.': 9,\n 'sept': 9,\n 'sept.': 9,\n 'oktober': 10,\n 'okt': 10,\n 'okt.': 10,\n 'november': 11,\n 'nov': 11,\n 'nov.': 11,\n 'december': 12,\n 'dec': 12,\n 'dec.': 12\n};\n\nexports.MONTH_PATTERN = '(?:'\n + Object.keys(exports.MONTH_OFFSET).join('|').replace(/\\./g, '\\\\.')\n + ')';\n\nexports.INTEGER_WORDS = {\n 'een' : 1,\n 'één' : 1,\n 'twee' : 2,\n 'drie' : 3,\n 'vier' : 4,\n 'vijf' : 5,\n 'zes' : 6,\n 'zeven' : 7,\n 'acht' : 8,\n 'negen' : 9,\n 'tien' : 10,\n 'elf' : 11,\n 'twaalf' : 12\n};\nexports.INTEGER_WORDS_PATTERN = '(?:'\n + Object.keys(exports.INTEGER_WORDS).join('|')\n +')';\n\nexports.ORDINAL_WORDS = {\n 'eerste' : 1,\n 'tweede': 2,\n 'derde': 3,\n 'vierde': 4,\n 'vijfde': 5,\n 'zesde': 6,\n 'zevende': 7,\n 'achste': 8,\n 'negende': 9,\n 'tiende': 10,\n 'elfde': 11,\n 'twaalfde': 12,\n 'dertiende': 13,\n 'veertiende': 14,\n 'vijftiende': 15,\n 'zestiende': 16,\n 'zeventiende': 17,\n 'achttiende': 18,\n 'negentiende': 19,\n 'twintigste': 20,\n 'eenentwintigste': 21,\n 'tweeëntwintigste': 22,\n 'drieëntwintigste': 23,\n 'vierentwintigste': 24,\n 'vijfentwintigste': 25,\n 'zesentwintigste': 26,\n 'zevenentwintigste': 27,\n 'achtentwintigste': 28,\n 'negenentwintigste': 29,\n 'dertigste': 30,\n 'eenendertigste': 31\n};\nexports.ORDINAL_WORDS_PATTERN = '(?:'\n + Object.keys(exports.ORDINAL_WORDS).join('|').replace(/ /g, '[ -]')\n + ')';\n\nvar TIME_UNIT =\n '(' + exports.INTEGER_WORDS_PATTERN + '|[0-9]+|[0-9]+\\.[0-9]+|en(?:\\\\s*few)?|half)\\\\s*' +\n '(sec(?:onde?)?|min(?:uten)?s?|(?:uur|uren)?|weken?|dagen?|maanden?|jaren?)\\\\s*';\n\nvar TIME_UNIT_STRICT =\n '(?:[0-9]+?)\\\\s*' +\n '(?:seconden?|(?:minuut|minuten)|(?:uur|uren)|(?:dag|dagen))\\\\s*';\n\nvar PATTERN_TIME_UNIT = new RegExp(TIME_UNIT, 'i');\n\nexports.TIME_UNIT_PATTERN = '(?:' + TIME_UNIT + ')+';\nexports.TIME_UNIT_STRICT_PATTERN = '(?:' + TIME_UNIT_STRICT + ')+';\n\nexports.extractDateTimeUnitFragments = function (timeunitText) {\n var fragments = {};\n var remainingText = timeunitText;\n var match = PATTERN_TIME_UNIT.exec(remainingText);\n while (match) {\n collectDateTimeFragment(match, fragments);\n remainingText = remainingText.substring(match[0].length);\n match = PATTERN_TIME_UNIT.exec(remainingText);\n }\n return fragments;\n};\n\nfunction collectDateTimeFragment(match, fragments) {\n var num = match[1].toLowerCase() ;\n if (exports.INTEGER_WORDS[num] !== undefined) {\n num = exports.INTEGER_WORDS[num];\n } else if (num.match(/half/)) {\n num = 0.5;\n } else {\n num = parseFloat(num);\n }\n\n if (match[2].match(/^(?:uur|uren)/i)) {\n fragments['hour'] = num;\n } else if (match[2].match(/min/i)) {\n fragments['minute'] = num;\n } else if (match[2].match(/sec/i)) {\n fragments['second'] = num;\n } else if (match[2].match(/week/i)) {\n fragments['week'] = num;\n } else if (match[2].match(/dag/i)) {\n fragments['d'] = num;\n } else if (match[2].match(/maand/i)) {\n fragments['month'] = num;\n } else if (match[2].match(/jaar/i)) {\n fragments['year'] = num;\n }\n\n return fragments;\n}\n","\nvar options = exports.options = require('./options');\n\nexports.parser = require('./parsers/parser');\nexports.refiner = require('./refiners/refiner');\n\nexports.Parser = exports.parser.Parser;\nexports.Refiner = exports.refiner.Refiner;\nexports.Filter = exports.refiner.Filter;\n\nexports.ParsedResult = require('./result').ParsedResult;\nexports.ParsedComponents = require('./result').ParsedComponents;\n\nvar Chrono = function(option) {\n\n option = option || exports.options.casualOption();\n this.parsers = new Object(option.parsers);\n this.refiners = new Object(option.refiners);\n};\n\n\nChrono.prototype.parse = function(text, refDate, opt) {\n\n refDate = refDate || new Date();\n opt = opt || {};\n opt.forwardDate = opt.forwardDate || opt.forwardDate;\n \n var allResults = [];\n\n this.parsers.forEach(function (parser) {\n var results = parser.execute(text, refDate, opt);\n allResults = allResults.concat(results);\n });\n\n allResults.sort(function(a, b) {\n return a.index - b.index;\n });\n\n this.refiners.forEach(function (refiner) {\n allResults = refiner.refine(text, allResults, opt);\n });\n \n return allResults;\n};\n\n\nChrono.prototype.parseDate = function(text, refDate, opt) {\n var results = this.parse(text, refDate, opt);\n if (results.length > 0) {\n return results[0].start.date();\n }\n return null;\n};\n\nexports.Chrono = Chrono;\nexports.strict = new Chrono( options.strictOption() );\nexports.casual = new Chrono( options.casualOption() );\n\nexports.en = new Chrono( options.mergeOptions([\n options.en.casual, options.commonPostProcessing]));\n\nexports.en_GB = new Chrono( options.mergeOptions([\n options.en_GB.casual, options.commonPostProcessing]));\n\nexports.de = new Chrono( options.mergeOptions([\n options.de.casual, options.en, options.commonPostProcessing]));\n\nexports.nl = new Chrono( options.mergeOptions([\n options.nl.casual, options.en, options.commonPostProcessing]));\n\nexports.pt = new Chrono( options.mergeOptions([\n options.pt.casual, options.en, options.commonPostProcessing]));\n\nexports.es = new Chrono( options.mergeOptions([\n options.es.casual, options.en, options.commonPostProcessing]));\n\nexports.fr = new Chrono( options.mergeOptions([\n options.fr.casual, options.en, options.commonPostProcessing]));\n\nexports.ja = new Chrono( options.mergeOptions([ \n options.ja.casual, options.en, options.commonPostProcessing]));\n\n\nexports.parse = function () {\n return exports.casual.parse.apply(exports.casual, arguments);\n};\n\nexports.parseDate = function () {\n return exports.casual.parseDate.apply(exports.casual, arguments);\n};\n\n\n\n\n","var parser = require('./parsers/parser');\nvar refiner = require('./refiners/refiner');\n\n\nexports.mergeOptions = function(options) {\n\n var addedTypes = {};\n var mergedOption = {\n parsers: [],\n refiners: []\n };\n\n options.forEach(function (option) {\n\n if (option.call) {\n option = option.call();\n }\n\n if (option.parsers) {\n option.parsers.forEach(function (p) {\n if (!addedTypes[p.constructor]) {\n mergedOption.parsers.push(p);\n addedTypes[p.constructor] = true;\n }\n });\n }\n\n if (option.refiners) {\n option.refiners.forEach(function (r) {\n if (!addedTypes[r.constructor]) {\n mergedOption.refiners.push(r);\n addedTypes[r.constructor] = true;\n }\n });\n }\n });\n\n return mergedOption;\n};\n\n\nexports.commonPostProcessing = function() {\n return {\n refiners: [\n // These should be after all other refiners\n new refiner.ExtractTimezoneOffsetRefiner(),\n new refiner.ExtractTimezoneAbbrRefiner(),\n new refiner.UnlikelyFormatFilter()\n ]\n }\n};\n\n\n// -------------------------------------------------------------\n\nexports.strictOption = function () {\n var strictConfig = {\n strict: true\n };\n\n return exports.mergeOptions([\n exports.en(strictConfig),\n exports.de(strictConfig),\n exports.nl(strictConfig),\n exports.pt(strictConfig),\n exports.es(strictConfig),\n exports.fr(strictConfig),\n exports.ja(strictConfig),\n exports.zh,\n exports.commonPostProcessing\n ]);\n};\n\nexports.casualOption = function () {\n return exports.mergeOptions([\n exports.en.casual,\n // Some German abbriviate overlap with common English\n exports.de({ strict: true }),\n exports.nl,\n exports.pt,\n exports.es,\n exports.fr,\n exports.ja,\n exports.zh,\n exports.commonPostProcessing\n ]);\n};\n\n// -------------------------------------------------------------\n\nexports.de = function(config) {\n return {\n parsers: [\n new parser.DEDeadlineFormatParser(config),\n new parser.DEMonthNameLittleEndianParser(config),\n new parser.DEMonthNameParser(config),\n new parser.DESlashDateFormatParser(config),\n new parser.DETimeAgoFormatParser(config),\n new parser.DETimeExpressionParser(config)\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner(),\n new refiner.DEMergeDateTimeRefiner(),\n new refiner.DEMergeDateRangeRefiner()\n ]\n }\n};\n\nexports.de.casual = function() {\n var option = exports.de({\n strict: false\n });\n option.parsers.unshift(new parser.DECasualDateParser());\n option.parsers.unshift(new parser.DEWeekdayParser());\n return option;\n};\n\n\n\n// -------------------------------------------------------------\n\nexports.nl = function(config) {\n return {\n parsers: [\n new parser.NLMonthNameLittleEndianParser(config),\n new parser.NLMonthNameParser(config),\n new parser.NLSlashDateFormatParser(config),\n new parser.NLTimeExpressionParser(config),\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner(),\n new refiner.NLMergeDateTimeRefiner(),\n new refiner.NLMergeDateRangeRefiner()\n ]\n }\n};\n\nexports.nl.casual = function() {\n var option = exports.nl({\n strict: false\n });\n option.parsers.unshift(new parser.NLCasualDateParser());\n option.parsers.unshift(new parser.NLCasualTimeParser());\n option.parsers.unshift(new parser.NLWeekdayParser());\n return option;\n};\n\n\n\n// -------------------------------------------------------------\n\n\nexports.en = function(config) {\n return {\n parsers: [\n new parser.ENISOFormatParser(config),\n new parser.ENDeadlineFormatParser(config),\n new parser.ENMonthNameLittleEndianParser(config),\n new parser.ENMonthNameMiddleEndianParser(config),\n new parser.ENMonthNameParser(config),\n new parser.ENSlashDateFormatParser(config),\n new parser.ENSlashDateFormatStartWithYearParser(config),\n new parser.ENSlashMonthFormatParser(config),\n new parser.ENTimeAgoFormatParser(config),\n new parser.ENTimeLaterFormatParser(config),\n new parser.ENTimeExpressionParser(config)\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner(),\n\n // English\n new refiner.ENMergeDateTimeRefiner(),\n new refiner.ENMergeDateRangeRefiner(),\n new refiner.ENPrioritizeSpecificDateRefiner()\n ]\n }\n};\n\nexports.en.casual = function(config) {\n config = config || {};\n config.strict = false;\n var option = exports.en(config);\n\n // en\n option.parsers.unshift(new parser.ENCasualDateParser());\n option.parsers.unshift(new parser.ENCasualTimeParser());\n option.parsers.unshift(new parser.ENWeekdayParser());\n option.parsers.unshift(new parser.ENRelativeDateFormatParser());\n return option;\n};\n\n\nexports.en_GB = function(config) {\n config = config || {};\n config.littleEndian = true;\n return exports.en(config);\n}\n\nexports.en_GB.casual = function(config) {\n config = config || {};\n config.littleEndian = true;\n return exports.en.casual(config);\n}\n\n// -------------------------------------------------------------\n\nexports.ja = function() {\n return {\n parsers: [\n new parser.JPStandardParser()\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner(),\n new refiner.JPMergeDateRangeRefiner()\n ]\n }\n};\n\nexports.ja.casual = function() {\n var option = exports.ja();\n option.parsers.unshift(new parser.JPCasualDateParser());\n return option;\n};\n\n// -------------------------------------------------------------\n\n\nexports.pt = function(config) {\n return {\n parsers: [\n new parser.PTTimeAgoFormatParser(config),\n new parser.PTDeadlineFormatParser(config),\n new parser.PTTimeExpressionParser(config),\n new parser.PTMonthNameLittleEndianParser(config),\n new parser.PTSlashDateFormatParser(config)\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner()\n ]\n }\n};\n\nexports.pt.casual = function() {\n var option = exports.pt({\n strict: false\n });\n\n option.parsers.unshift(new parser.PTCasualDateParser());\n option.parsers.unshift(new parser.PTWeekdayParser());\n return option;\n};\n\n// -------------------------------------------------------------\n\n\nexports.es = function(config) {\n return {\n parsers: [\n new parser.ESTimeAgoFormatParser(config),\n new parser.ESDeadlineFormatParser(config),\n new parser.ESTimeExpressionParser(config),\n new parser.ESMonthNameLittleEndianParser(config),\n new parser.ESSlashDateFormatParser(config)\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner()\n ]\n }\n};\n\nexports.es.casual = function() {\n var option = exports.es({\n strict: false\n });\n\n option.parsers.unshift(new parser.ESCasualDateParser());\n option.parsers.unshift(new parser.ESWeekdayParser());\n return option;\n};\n\n\n// -------------------------------------------------------------\n\nexports.fr = function(config) {\n return {\n parsers: [\n new parser.FRDeadlineFormatParser(config),\n new parser.FRMonthNameLittleEndianParser(config),\n new parser.FRSlashDateFormatParser(config),\n new parser.FRTimeAgoFormatParser(config),\n new parser.FRTimeExpressionParser(config)\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner(),\n new refiner.FRMergeDateRangeRefiner(),\n new refiner.FRMergeDateTimeRefiner()\n ]\n }\n};\n\nexports.fr.casual = function() {\n var option = exports.fr({\n strict: false\n });\n\n option.parsers.unshift(new parser.FRCasualDateParser());\n option.parsers.unshift(new parser.FRWeekdayParser());\n option.parsers.unshift(new parser.FRRelativeDateFormatParser());\n return option;\n};\n\n\n// -------------------------------------------------------------\n\nexports.zh = function() {\n return {\n parsers: [\n new parser.ZHHantDateParser(),\n new parser.ZHHantWeekdayParser(),\n new parser.ZHHantTimeExpressionParser(),\n new parser.ZHHantCasualDateParser(),\n new parser.ZHHantDeadlineFormatParser()\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner()\n ]\n }\n};\n","/*\n ISO 8601\n http://www.w3.org/TR/NOTE-datetime\n - YYYY-MM-DD\n - YYYY-MM-DDThh:mmTZD\n - YYYY-MM-DDThh:mm:ssTZD\n - YYYY-MM-DDThh:mm:ss.sTZD \n - TZD = (Z or +hh:mm or -hh:mm)\n*/\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp('(\\\\W|^)' \n + '([0-9]{4})\\\\-([0-9]{1,2})\\\\-([0-9]{1,2})'\n + '(?:T' //..\n + '([0-9]{1,2}):([0-9]{1,2})' // hh:mm\n + '(?::([0-9]{1,2})(?:\\\\.(\\\\d{1,4}))?)?' // :ss.s\n + '(?:Z|([+-]\\\\d{2}):?(\\\\d{2})?)?' // TZD (Z or ±hh:mm or ±hhmm or ±hh)\n + ')?' //..\n + '(?=\\\\W|$)', 'i');\n\nvar YEAR_NUMBER_GROUP = 2;\nvar MONTH_NUMBER_GROUP = 3;\nvar DATE_NUMBER_GROUP = 4;\nvar HOUR_NUMBER_GROUP = 5;\nvar MINUTE_NUMBER_GROUP = 6;\nvar SECOND_NUMBER_GROUP = 7;\nvar MILLISECOND_NUMBER_GROUP = 8;\nvar TZD_HOUR_OFFSET_GROUP = 9;\nvar TZD_MINUTE_OFFSET_GROUP = 10;\n\nexports.Parser = function ENISOFormatParser(){\n Parser.apply(this, arguments);\n \n this.pattern = function() { return PATTERN; }\n \n this.extract = function(text, ref, match, opt){ \n \n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n })\n \n result.start.assign('year', parseInt(match[YEAR_NUMBER_GROUP]));\n result.start.assign('month', parseInt(match[MONTH_NUMBER_GROUP]));\n result.start.assign('day', parseInt(match[DATE_NUMBER_GROUP]));\n\n if (dayjs(result.start.get('month')) > 12 || dayjs(result.start.get('month')) < 1 ||\n dayjs(result.start.get('day')) > 31 || dayjs(result.start.get('day')) < 1) {\n return null;\n }\n\n if (match[HOUR_NUMBER_GROUP] != null) {\n \n result.start.assign('hour',\n parseInt(match[HOUR_NUMBER_GROUP]));\n result.start.assign('minute',\n parseInt(match[MINUTE_NUMBER_GROUP]));\n\n if (match[SECOND_NUMBER_GROUP] != null) {\n\n result.start.assign('second',\n parseInt(match[SECOND_NUMBER_GROUP]));\n }\n\n if (match[MILLISECOND_NUMBER_GROUP] != null) {\n\n result.start.assign('millisecond',\n parseInt(match[MILLISECOND_NUMBER_GROUP]));\n }\n\n if (match[TZD_HOUR_OFFSET_GROUP] == null) {\n\n result.start.assign('timezoneOffset', 0);\n } else {\n\n var minuteOffset = 0;\n var hourOffset = parseInt(match[TZD_HOUR_OFFSET_GROUP]);\n if (match[TZD_MINUTE_OFFSET_GROUP] != null)\n minuteOffset = parseInt(match[TZD_MINUTE_OFFSET_GROUP]);\n\n var offset = hourOffset * 60;\n if (offset < 0) {\n offset -= minuteOffset;\n } else {\n offset += minuteOffset;\n }\n\n result.start.assign('timezoneOffset', offset);\n }\n }\n \n result.tags['ENISOFormatParser'] = true;\n return result;\n };\n\n}\n\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(within|in)\\\\s*' +\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|an?(?:\\\\s*few)?|half(?:\\\\s*an?)?)\\\\s*' +\n '(seconds?|min(?:ute)?s?|hours?|days?|weeks?|months?|years?)\\\\s*' +\n '(?=\\\\W|$)', 'i'\n);\n\nvar STRICT_PATTERN = new RegExp('(\\\\W|^)' +\n '(within|in)\\\\s*' +\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|an?)\\\\s*' +\n '(seconds?|minutes?|hours?|days?)\\\\s*' +\n '(?=\\\\W|$)', 'i'\n);\n\nexports.Parser = function ENDeadlineFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return this.isStrictMode()? STRICT_PATTERN : PATTERN;\n };\n\n this.extract = function(text, ref, match, opt){\n\n var index = match.index + match[1].length;\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var num = match[3].toLowerCase();\n if (util.INTEGER_WORDS[num] !== undefined) {\n num = util.INTEGER_WORDS[num];\n } else if (num === 'a' || num === 'an'){\n num = 1;\n } else if (num.match(/few/i)){\n num = 3;\n } else if (num.match(/half/i)) {\n num = 0.5;\n } else {\n num = parseInt(num);\n }\n\n var date = dayjs(ref);\n if (match[4].match(/day|week|month|year/i)) {\n\n if (match[4].match(/day/i)) {\n date = date.add(num, 'd');\n } else if (match[4].match(/week/i)) {\n date = date.add(num * 7, 'd');\n } else if (match[4].match(/month/i)) {\n date = date.add(num, 'month');\n } else if (match[4].match(/year/i)) {\n date = date.add(num, 'year');\n }\n\n result.start.imply('year', date.year());\n result.start.imply('month', date.month() + 1);\n result.start.imply('day', date.date());\n return result;\n }\n\n if (match[4].match(/hour/i)) {\n\n date = date.add(num, 'hour');\n\n } else if (match[4].match(/min/i)) {\n\n date = date.add(num, 'minute');\n\n } else if (match[4].match(/second/i)) {\n\n date = date.add(num, 'second');\n }\n\n result.start.imply('year', date.year());\n result.start.imply('month', date.month() + 1);\n result.start.imply('day', date.date());\n result.start.imply('hour', date.hour());\n result.start.imply('minute', date.minute());\n result.start.imply('second', date.second());\n result.tags['ENDeadlineFormatParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(this|next|last|past)\\\\s*' +\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|few|half(?:\\\\s*an?)?)?\\\\s*' +\n '(seconds?|min(?:ute)?s?|hours?|days?|weeks?|months?|years?)(?=\\\\s*)' +\n '(?=\\\\W|$)', 'i'\n);\n\nvar MODIFIER_WORD_GROUP = 2;\nvar MULTIPLIER_WORD_GROUP = 3;\nvar RELATIVE_WORD_GROUP = 4;\n\nexports.Parser = function ENRelativeDateFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; };\n\n this.extract = function(text, ref, match, opt){\n\n var index = match.index + match[1].length;\n var modifier = match[MODIFIER_WORD_GROUP].toLowerCase().match(/^next/) ? 1 : -1;\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n result.tags['ENRelativeDateFormatParser'] = true;\n\n var num = match[MULTIPLIER_WORD_GROUP] === undefined ? '' : match[3].toLowerCase();\n if (util.INTEGER_WORDS[num] !== undefined) {\n num = util.INTEGER_WORDS[num];\n } else if (num === ''){\n num = 1;\n } else if (num.match(/few/i)){\n num = 3;\n } else if (num.match(/half/i)) {\n num = 0.5;\n } else {\n num = parseInt(num);\n }\n\n num *= modifier;\n var date = dayjs(ref);\n\n if (match[MODIFIER_WORD_GROUP].toLowerCase().match(/^this/)) {\n\n if (match[MULTIPLIER_WORD_GROUP]) {\n return null;\n }\n\n if (match[RELATIVE_WORD_GROUP].match(/day|week|month|year/i)) {\n \n // This week\n if (match[RELATIVE_WORD_GROUP].match(/week/i)) {\n date = date.add(-date.get('d'), 'd');\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n } \n \n // This month\n else if (match[RELATIVE_WORD_GROUP].match(/month/i)) {\n date = date.add(-date.date() + 1, 'd');\n result.start.imply('day', date.date());\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n } \n\n // This year\n else if (match[RELATIVE_WORD_GROUP].match(/year/i)) {\n date = date.add(-date.date() + 1, 'd');\n date = date.add(-date.month(), 'month');\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.assign('year', date.year());\n } \n\n return result;\n }\n }\n \n if (match[RELATIVE_WORD_GROUP].match(/day|week|month|year/i)) {\n\n if (match[RELATIVE_WORD_GROUP].match(/day/i)) {\n date = date.add(num, 'd');\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n } else if (match[RELATIVE_WORD_GROUP].match(/week/i)) {\n date = date.add(num * 7, 'd');\n // We don't know the exact date for next/last week so we imply\n // them\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n } else if (match[RELATIVE_WORD_GROUP].match(/month/i)) {\n date = date.add(num, 'month');\n // We don't know the exact day for next/last month\n result.start.imply('day', date.date());\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n } else if (match[RELATIVE_WORD_GROUP].match(/year/i)) {\n date = date.add(num, 'year');\n // We don't know the exact day for month on next/last year\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.assign('year', date.year());\n }\n\n return result;\n }\n\n if (match[RELATIVE_WORD_GROUP].match(/hour/i)) {\n\n date = date.add(num, 'hour');\n result.start.imply('minute', date.minute());\n result.start.imply('second', date.second());\n\n } else if (match[RELATIVE_WORD_GROUP].match(/min/i)) {\n\n date = date.add(num, 'minute');\n result.start.assign('minute', date.minute());\n result.start.imply('second', date.second());\n\n } else if (match[RELATIVE_WORD_GROUP].match(/second/i)) {\n\n date = date.add(num, 'second');\n result.start.assign('second', date.second());\n result.start.assign('minute', date.minute());\n }\n\n result.start.assign('hour', date.hour());\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n return result;\n };\n};\n","const parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:on\\\\s*?)?' +\n '(?:(Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sun|Mon|Tue|Wed|Thu|Fri|Sat)\\\\s*,?\\\\s*)?' +\n '(([0-9]{1,2})(?:st|nd|rd|th)?|' + util.ORDINAL_WORDS_PATTERN + ')' +\n '(?:\\\\s*' +\n '(?:to|\\\\-|\\\\–|until|through|till|\\\\s)\\\\s*' +\n '(([0-9]{1,2})(?:st|nd|rd|th)?|' + util.ORDINAL_WORDS_PATTERN + ')' +\n ')?' + \n '(?:-|\\/|\\\\s*(?:of)?\\\\s*)' +\n '(' + util.MONTH_PATTERN + ')' +\n '(?:' +\n '(?:-|\\/|,?\\\\s*)' +\n '((?:' + \n '[1-9][0-9]{0,3}\\\\s*(?:BE|AD|BC)|' +\n '[1-2][0-9]{3}|' +\n '[5-9][0-9]' +\n ')(?![^\\\\s]\\\\d))' +\n ')?' +\n '(?=\\\\W|$)', 'i'\n );\n\nvar WEEKDAY_GROUP = 2;\nvar DATE_GROUP = 3;\nvar DATE_NUM_GROUP = 4;\nvar DATE_TO_GROUP = 5;\nvar DATE_TO_NUM_GROUP = 6;\nvar MONTH_NAME_GROUP = 7;\nvar YEAR_GROUP = 8;\n\nexports.Parser = function ENMonthNameLittleEndianParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref\n });\n\n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n\n var day = match[DATE_NUM_GROUP] ?\n parseInt(match[DATE_NUM_GROUP]):\n util.ORDINAL_WORDS[match[DATE_GROUP].trim().replace('-', ' ').toLowerCase()];\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n \n if (/BE/i.test(year)) {\n // Buddhist Era\n year = year.replace(/BE/i, '');\n year = parseInt(year) - 543;\n } else if (/BC/i.test(year)){\n // Before Christ\n year = year.replace(/BC/i, '');\n year = -parseInt(year);\n } else if (/AD/i.test(year)){\n year = year.replace(/AD/i, '');\n year = parseInt(year);\n } else {\n year = parseInt(year);\n if (year < 100){\n if (year > 50) {\n year = year + 1900;\n } else {\n year = year + 2000;\n }\n }\n }\n }\n\n if(year){\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month);\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n // Weekday component\n if (match[WEEKDAY_GROUP]) {\n var weekday = match[WEEKDAY_GROUP];\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()]\n result.start.assign('weekday', weekday);\n }\n\n // Text can be 'range' value. Such as '12 - 13 January 2012'\n if (match[DATE_TO_GROUP]) {\n var endDate = match[DATE_TO_NUM_GROUP] ?\n parseInt(match[DATE_TO_NUM_GROUP]):\n util.ORDINAL_WORDS[match[DATE_TO_GROUP].trim().replace('-', ' ').toLowerCase()];\n\n result.end = result.start.clone();\n result.end.assign('day', endDate);\n }\n\n result.tags['ENMonthNameLittleEndianParser'] = true;\n return result;\n };\n};\n","/*\n\n The parser for parsing US's date format that begin with month's name.\n\n EX.\n - January 13\n - January 13, 2012\n - January 13 - 15, 2012\n - Tuesday, January 13, 2012\n\n Watch out for:\n - January 12:00\n - January 12.44\n - January 1222344\n*/\nvar parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:' +\n '(?:on\\\\s*?)?' +\n '(Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sun\\\\.?|Mon\\\\.?|Tue\\\\.?|Wed\\\\.?|Thu\\\\.?|Fri\\\\.?|Sat\\\\.?)' +\n '\\\\s*,?\\\\s*)?' +\n '(' + util.MONTH_PATTERN + ')' +\n '(?:-|\\/|\\\\s*,?\\\\s*)' +\n '(([0-9]{1,2})(?:st|nd|rd|th)?|' + util.ORDINAL_WORDS_PATTERN +')(?!\\\\s*(?:am|pm))\\\\s*' + '' + \n '(?:' +\n '(?:to|\\\\-)\\\\s*' +\n '(([0-9]{1,2})(?:st|nd|rd|th)?| ' + util.ORDINAL_WORDS_PATTERN + ')\\\\s*' +\n ')?' +\n '(?:' +\n '(?:-|\\/|\\\\s*,?\\\\s*)' +\n '(?:([0-9]{4})\\\\s*(BE|AD|BC)?|([0-9]{1,4})\\\\s*(AD|BC))\\\\s*' +\n ')?' +\n '(?=\\\\W|$)(?!\\\\:\\\\d)', 'i');\n\nvar WEEKDAY_GROUP = 2;\nvar MONTH_NAME_GROUP = 3;\nvar DATE_GROUP = 4;\nvar DATE_NUM_GROUP = 5;\nvar DATE_TO_GROUP = 6;\nvar DATE_TO_NUM_GROUP = 7;\nvar YEAR_GROUP = 8;\nvar YEAR_BE_GROUP = 9;\nvar YEAR_GROUP2 = 10;\nvar YEAR_BE_GROUP2 = 11;\n\nexports.Parser = function ENMonthNameMiddleEndianParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n\n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n var day = match[DATE_NUM_GROUP] ?\n parseInt(match[DATE_NUM_GROUP]) :\n util.ORDINAL_WORDS[match[DATE_GROUP].trim().replace('-', ' ').toLowerCase()];\n\n var year = null;\n if (match[YEAR_GROUP] || match[YEAR_GROUP2]) {\n year = match[YEAR_GROUP] || match[YEAR_GROUP2];\n year = parseInt(year);\n\n var yearBE = match[YEAR_BE_GROUP] || match[YEAR_BE_GROUP2];\n if (yearBE) {\n if (/BE/i.test(yearBE)) {\n // Buddhist Era\n year = year - 543;\n } else if (/BC/i.test(yearBE)) {\n // Before Christ\n year = -year;\n }\n } else if (year < 100){\n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month)\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n // Weekday component\n if (match[WEEKDAY_GROUP]) {\n var weekday = match[WEEKDAY_GROUP];\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()]\n result.start.assign('weekday', weekday);\n }\n\n // Text can be 'range' value. Such as 'January 12 - 13, 2012'\n if (match[DATE_TO_GROUP]) {\n var endDate = match[DATE_TO_NUM_GROUP] ?\n endDate = parseInt(match[DATE_TO_NUM_GROUP]) :\n util.ORDINAL_WORDS[match[DATE_TO_GROUP].replace('-', ' ').trim().toLowerCase()];\n\n result.end = result.start.clone();\n result.end.assign('day', endDate);\n }\n\n result.tags['ENMonthNameMiddleEndianParser'] = true;\n return result;\n }\n};","/*\n \n The parser for parsing month name and year.\n \n EX. \n - January\n - January 2012\n - January, 2012\n*/\nvar parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('(^|\\\\D\\\\s+|[^\\\\w\\\\s])' +\n '('+ util.MONTH_PATTERN +')' + \n '\\\\s*' +\n '(?:' +\n '[,-]?\\\\s*([0-9]{4})(\\\\s*BE|AD|BC)?' +\n ')?' +\n '(?=[^\\\\s\\\\w]|\\\\s+[^0-9]|\\\\s+$|$)', 'i');\n\nvar MONTH_NAME_GROUP = 2;\nvar YEAR_GROUP = 3;\nvar YEAR_BE_GROUP = 4;\n\nexports.Parser = function ENMonthNameParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n \n this.extract = function(text, ref, match, opt){\n const result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n const day = 1;\n const monthName = match[MONTH_NAME_GROUP];\n const month = util.MONTH_OFFSET[monthName.toLowerCase()];\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n year = parseInt(year);\n\n if(match[YEAR_BE_GROUP]){\n if (match[YEAR_BE_GROUP].match(/BE/)) {\n // Buddhist Era\n year = year - 543;\n } else if (match[YEAR_BE_GROUP].match(/BC/)) {\n // Before Christ\n year = -year;\n }\n\n } else if (year < 100){ \n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month)\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n if (result.text.match(/^\\w{3}$/)) {\n return false;\n }\n\n result.tags['ENMonthNameParser'] = true;\n return result;\n }\n}\n","/*\n Date format with slash \"/\" (also \"-\" and \".\") between numbers\n - Tuesday 11/3/2015 \n - 11/3/2015\n - 11/3\n\n By default the paser us \"middle-endien\" format (US English),\n then fallback to little-endian if failed.\n - 11/3/2015 = November 3rd, 2015\n - 23/4/2015 = April 23th, 2015\n\n If \"littleEndian\" config is set, the parser will try the little-endian first. \n - 11/3/2015 = March 11th, 2015\n*/\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:' +\n '(?:on\\\\s*?)?' +\n '((?:sun|mon|tues?|wed(?:nes)?|thu(?:rs?)?|fri|sat(?:ur)?)(?:day)?)' +\n '\\\\s*\\\\,?\\\\s*' +\n ')?' +\n '([0-3]{0,1}[0-9]{1})[\\\\/\\\\.\\\\-]([0-3]{0,1}[0-9]{1})' +\n '(?:' +\n '[\\\\/\\\\.\\\\-]' +\n '([0-9]{4}\\s*\\,?\\s*|[0-9]{2}\\s*\\,?\\s*)' +\n ')?' +\n '(\\\\W|$)', 'i');\n\nvar DAYS_OFFSET = { 'sunday': 0, 'sun': 0, 'monday': 1, 'mon': 1,'tuesday': 2, 'wednesday': 3, 'wed': 3,\n 'thursday': 4, 'thur': 4,'friday': 5, 'fri': 5,'saturday': 6, 'sat': 6,}\n\n\nvar OPENNING_GROUP = 1;\nvar ENDING_GROUP = 6;\n\nvar WEEKDAY_GROUP = 2;\n\n\nvar FIRST_NUMBERS_GROUP = 3;\nvar SECOND_NUMBERS_GROUP = 4;\n\nvar YEAR_GROUP = 5;\n\nexports.Parser = function ENSlashDateFormatParser(config) {\n Parser.apply(this, arguments);\n config = config || {};\n var littleEndian = config.littleEndian;\n var MONTH_GROUP = littleEndian ? SECOND_NUMBERS_GROUP : FIRST_NUMBERS_GROUP;\n var DAY_GROUP = littleEndian ? FIRST_NUMBERS_GROUP : SECOND_NUMBERS_GROUP;\n\n this.pattern = function () { return PATTERN; };\n this.extract = function(text, ref, match, opt){\n\n if(match[OPENNING_GROUP] == '/' || match[ENDING_GROUP] == '/') {\n // Long skip, if there is some overlapping like:\n // XX[/YY/ZZ]\n // [XX/YY/]ZZ\n match.index += match[0].length\n return;\n }\n\n var index = match.index + match[OPENNING_GROUP].length;\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length - match[ENDING_GROUP].length);\n\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n });\n\n if(text.match(/^\\d\\.\\d$/)) return;\n if(text.match(/^\\d\\.\\d{1,2}\\.\\d{1,2}$/)) return;\n\n // MM/dd -> OK\n // MM.dd -> NG\n if(!match[YEAR_GROUP] && match[0].indexOf('/') < 0) return;\n\n var date = null;\n var year = match[YEAR_GROUP] || dayjs(ref).year() + '';\n var month = match[MONTH_GROUP];\n var day = match[DAY_GROUP];\n\n month = parseInt(month);\n day = parseInt(day);\n year = parseInt(year);\n\n if(month < 1 || month > 12) {\n if(month > 12) {\n // dd/mm/yyyy date format if day looks like a month, and month\n // looks like a day.\n if (day >= 1 && day <= 12 && month >= 13 && month <= 31) {\n // unambiguous\n var tday = month;\n month = day;\n day = tday;\n }\n else {\n // both month and day are <= 12\n return null;\n }\n }\n }\n if(day < 1 || day > 31) return null;\n\n if(year < 100){\n if (year > 50) {\n year = year + 1900;\n } else {\n year = year + 2000;\n }\n }\n\n result.start.assign('day', day);\n result.start.assign('month', month);\n if (match[YEAR_GROUP]) {\n result.start.assign('year', year);\n } else {\n result.start.imply('year', year);\n }\n\n //Day of week\n if(match[WEEKDAY_GROUP]) {\n result.start.assign('weekday', DAYS_OFFSET[match[WEEKDAY_GROUP].toLowerCase()]);\n }\n\n result.tags['ENSlashDateFormatParser'] = true;\n return result;\n };\n};\n","/*\n Date format with slash \"/\" between numbers like ENSlashDateFormatParser,\n but this parser expect year before month and date. \n - YYYY/MM/DD\n - YYYY-MM-DD\n - YYYY.MM.DD\n*/\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('(\\\\W|^)' \n + '([0-9]{4})[\\\\-\\\\.\\\\/]'\n + '((?:' + util.MONTH_PATTERN + '|[0-9]{1,2}))[\\\\-\\\\.\\\\/]'\n + '([0-9]{1,2})'\n + '(?=\\\\W|$)', 'i');\n\nvar YEAR_NUMBER_GROUP = 2;\nvar MONTH_NUMBER_GROUP = 3;\nvar DATE_NUMBER_GROUP = 4;\n\nexports.Parser = function ENSlashDateFormatStartWithYearParser(){\n Parser.apply(this, arguments);\n \n this.pattern = function() { return PATTERN; }\n \n this.extract = function(text, ref, match, opt){\n\n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n })\n \n var month = match[MONTH_NUMBER_GROUP].toLowerCase();\n month = util.MONTH_OFFSET[month] | month;\n\n result.start.assign('year', parseInt(match[YEAR_NUMBER_GROUP]));\n result.start.assign('month', parseInt(month));\n result.start.assign('day', parseInt(match[DATE_NUMBER_GROUP]));\n\n if (\n dayjs(result.start.get('month')) > 12 || dayjs(result.start.get('month')) < 1 || \n dayjs(result.start.get('day')) > 31 || dayjs(result.start.get('day')) < 1) {\n return null;\n }\n \n result.tags['ENDateFormatParser'] = true;\n return result;\n };\n}\n","/*\n Month/Year date format with slash \"/\" (also \"-\" and \".\") between numbers \n - 11/05\n - 06/2005\n*/\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp('(^|[^\\\\d/]\\\\s+|[^\\\\w\\\\s])' +\n '([0-9]|0[1-9]|1[012])/([0-9]{4})' + \n '(?=[^\\\\d/]|$)', 'i');\n\nvar OPENNING_GROUP = 1;\n\nvar MONTH_GROUP = 2;\nvar YEAR_GROUP = 3;\n\nexports.Parser = function ENSlashMonthFormatParser(argument) {\n Parser.apply(this, arguments);\n\n this.pattern = function () { return PATTERN; };\n this.extract = function(text, ref, match, opt){\n \n var index = match.index + match[OPENNING_GROUP].length;\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length).trim();\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n });\n\n var year = match[YEAR_GROUP] ;\n var month = match[MONTH_GROUP];\n var day = 1;\n \n month = parseInt(month);\n year = parseInt(year);\n\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n\n result.tags['ENSlashMonthFormatParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('' +\n '(\\\\W|^)' +\n '(?:within\\\\s*)?' +\n '(' + util.TIME_UNIT_PATTERN + ')' +\n '(?:ago|before|earlier)(?=(?:\\\\W|$))', 'i');\n\nvar STRICT_PATTERN = new RegExp('' +\n '(\\\\W|^)' +\n '(?:within\\\\s*)?' +\n '(' + util.TIME_UNIT_STRICT_PATTERN + ')' +\n 'ago(?=(?:\\\\W|$))', 'i');\n\nexports.Parser = function ENTimeAgoFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return this.isStrictMode()? STRICT_PATTERN : PATTERN;\n };\n\n this.extract = function(text, ref, match, opt){\n\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n var index = match.index + match[1].length;\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var fragments = util.extractDateTimeUnitFragments(match[2]);\n var date = dayjs(ref);\n\n for (var key in fragments) {\n date = date.add(-fragments[key], key);\n }\n\n if (fragments['hour'] > 0 || fragments['minute'] > 0 || fragments['second'] > 0) {\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.start.assign('second', date.second());\n result.tags['ENTimeAgoFormatParser'] = true;\n } \n \n if (fragments['d'] > 0 || fragments['month'] > 0 || fragments['year'] > 0) {\n result.start.assign('day', date.date());\n result.start.assign('month', date.month() + 1);\n result.start.assign('year', date.year());\n } else {\n if (fragments['week'] > 0) {\n result.start.imply('weekday', date.day());\n }\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n }\n\n return result;\n };\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar ParsedComponents = require('../../result').ParsedComponents;\n\nvar FIRST_REG_PATTERN = new RegExp(\"(^|\\\\s|T)\" +\n \"(?:(?:at|from)\\\\s*)??\" + \n \"(\\\\d{1,4}|noon|midnight)\" + \n \"(?:\" + \n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" + \n \"(?:\" + \n \"(?:\\\\:|\\\\:)(\\\\d{2})(?:\\\\.(\\\\d{1,6}))?\" + \n \")?\" + \n \")?\" + \n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?|O\\\\W*CLOCK))?\" + \n \"(?=\\\\W|$)\", 'i');\n\n\nvar SECOND_REG_PATTERN = new RegExp(\"^\\\\s*\" + \n \"(\\\\-|\\\\–|\\\\~|\\\\〜|to|\\\\?)\\\\s*\" + \n \"(\\\\d{1,4})\" +\n \"(?:\" + \n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" + \n \"(?:\" + \n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})(?:\\\\.(\\\\d{1,6}))?\" + \n \")?\" + \n \")?\" + \n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?|O\\\\W*CLOCK))?\" + \n \"(?=\\\\W|$)\", 'i');\n\nvar HOUR_GROUP = 2;\nvar MINUTE_GROUP = 3;\nvar SECOND_GROUP = 4;\nvar MILLI_SECOND_GROUP = 5;\nvar AM_PM_HOUR_GROUP = 6;\n\n\nexports.Parser = function ENTimeExpressionParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return FIRST_REG_PATTERN; }\n \n this.extract = function(text, ref, match, opt){ \n \n // This pattern can be overlapped Ex. [12] AM, 1[2] AM\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n var refMoment = dayjs(ref);\n var result = new ParsedResult();\n result.ref = ref;\n result.index = match.index + match[1].length;\n result.text = match[0].substring(match[1].length);\n result.tags['ENTimeExpressionParser'] = true;\n\n result.start.imply('day', refMoment.date());\n result.start.imply('month', refMoment.month()+1);\n result.start.imply('year', refMoment.year());\n \n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Millisecond\n if(match[MILLI_SECOND_GROUP] != null){ \n var millisecond = parseInt(match[MILLI_SECOND_GROUP].substring(0, 3));\n if(millisecond >= 1000) return null;\n \n result.start.assign('millisecond', millisecond);\n }\n\n // ----- Second\n if(match[SECOND_GROUP] != null){ \n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.start.assign('second', second);\n }\n \n // ----- Hours\n if (match[HOUR_GROUP].toLowerCase() == \"noon\"){\n meridiem = 1; \n hour = 12;\n } else if (match[HOUR_GROUP].toLowerCase() == \"midnight\") {\n meridiem = 0; \n hour = 0;\n } else {\n hour = parseInt(match[HOUR_GROUP]);\n }\n \n // ----- Minutes\n if(match[MINUTE_GROUP] != null){ \n minute = parseInt(match[MINUTE_GROUP]);\n } else if(hour > 100) { \n minute = hour%100;\n hour = parseInt(hour/100);\n } \n \n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) { \n meridiem = 1;\n }\n\n // ----- AM & PM \n if(match[AM_PM_HOUR_GROUP] != null) {\n if(hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if(ampm == \"a\"){\n meridiem = 0; \n if(hour == 12) hour = 0;\n }\n \n if(ampm == \"p\"){\n meridiem = 1; \n if(hour != 12) hour += 12;\n }\n } \n\n result.start.assign('hour', hour);\n result.start.assign('minute', minute);\n\n if (meridiem >= 0) {\n result.start.assign('meridiem', meridiem);\n } else {\n if (hour < 12) {\n result.start.imply('meridiem', 0);\n } else {\n result.start.imply('meridiem', 1);\n }\n }\n\n // ==============================================================\n // Extracting the 'to' chunk\n // ==============================================================\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n return result;\n }\n\n\n\n // Pattern \"YY.YY -XXXX\" is more like timezone offset\n if (match[0].match(/^\\s*(\\+|\\-)\\s*\\d{3,4}$/)) {\n return result;\n }\n\n if(result.end == null){\n result.end = new ParsedComponents(null, result.start.date());\n }\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Millisecond\n if(match[MILLI_SECOND_GROUP] != null){ \n var millisecond = parseInt(match[MILLI_SECOND_GROUP].substring(0, 3));\n if(millisecond >= 1000) return null;\n \n result.end.assign('millisecond', millisecond);\n }\n \n // ----- Second\n if(match[SECOND_GROUP] != null){ \n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.end.assign('second', second);\n }\n\n hour = parseInt(match[2]);\n \n // ----- Minute\n if (match[MINUTE_GROUP]!= null) {\n \n minute = parseInt(match[MINUTE_GROUP]);\n if(minute >= 60) return result;\n \n } else if (hour > 100) {\n\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) { \n meridiem = 1;\n }\n \n // ----- AM & PM \n if (match[AM_PM_HOUR_GROUP] != null){\n\n if (hour > 12) return null;\n\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if(ampm == \"a\"){\n meridiem = 0; \n if(hour == 12) {\n hour = 0;\n if (!result.end.isCertain('day')) {\n result.end.imply('day', result.end.get('day') + 1);\n }\n }\n }\n \n if(ampm == \"p\"){\n meridiem = 1; \n if(hour != 12) hour += 12;\n }\n \n if (!result.start.isCertain('meridiem')) {\n if (meridiem == 0) {\n \n result.start.imply('meridiem', 0);\n \n if (result.start.get('hour') == 12) {\n result.start.assign('hour', 0);\n }\n\n } else {\n\n result.start.imply('meridiem', 1);\n \n if (result.start.get('hour') != 12) {\n result.start.assign('hour', result.start.get('hour') + 12); \n }\n }\n }\n }\n\n result.text = result.text + match[0];\n result.end.assign('hour', hour);\n result.end.assign('minute', minute);\n if (meridiem >= 0) {\n result.end.assign('meridiem', meridiem);\n } else {\n var startAtPM = result.start.isCertain('meridiem') && result.start.get('meridiem') == 1;\n if (startAtPM && result.start.get('hour') > hour) {\n // 10pm - 1 (am)\n result.end.imply('meridiem', 0);\n\n } else if (hour > 12) {\n result.end.imply('meridiem', 1);\n }\n }\n\n if (result.end.date().getTime() < result.start.date().getTime()) {\n result.end.imply('day', result.end.get('day') + 1)\n }\n \n return result;\n }\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('' +\n /*match[1]*/ '(\\\\W|^)' +\n /*match[2]*/ '(in )?' +\n /*match[3]*/ '(' + util.TIME_UNIT_PATTERN + ')' +\n /*match[4]*/ '(later|after|from now|henceforth|forward|out)?' +\n /*match[5]*/ '(?=(?:\\\\W|$))',\n'i');\n\nvar STRICT_PATTERN = new RegExp('' +\n /*match[1]*/ '(\\\\W|^)' +\n /*match[2]*/ '(in )?' +\n /*match[3]*/ '(' + util.TIME_UNIT_STRICT_PATTERN + ')' +\n /*match[4]*/ '(later|from now)?' +\n /*match[5]*/ '(?=(?:\\\\W|$))',\n'i');\n\nexports.Parser = function ENTimeLaterFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return this.isStrictMode()? STRICT_PATTERN : PATTERN;\n };\n\n this.extract = function(text, ref, match, opt){\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n\n var prefix = match[2];\n var suffix = match[4];\n if (!prefix && !suffix) return null;\n\n var preamble = match[1];\n var text = match[0].substr(preamble.length, match[0].length - preamble.length);\n var index = match.index + preamble.length;\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var fragments = util.extractDateTimeUnitFragments(match[3]);\n var date = dayjs(ref);\n for (var key in fragments) {\n date = date.add(fragments[key], key);\n }\n\n if (fragments['hour'] > 0 || fragments['minute'] > 0 || fragments['second'] > 0) {\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.start.assign('second', date.second());\n result.tags['ENTimeAgoFormatParser'] = true;\n } \n \n if (fragments['d'] > 0 || fragments['month'] > 0 || fragments['year'] > 0) {\n result.start.assign('day', date.date());\n result.start.assign('month', date.month() + 1);\n result.start.assign('year', date.year());\n } else {\n if (fragments['week'] > 0) {\n result.start.imply('weekday', date.day());\n }\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n }\n\n return result;\n };\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)(now|today|tonight|last\\s*night|(?:tomorrow|tmr|yesterday)\\s*|tomorrow|tmr|yesterday)(?=\\W|$)/i;\n\nexports.Parser = function ENCasualDateParser(){\n\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var refMoment = dayjs(ref);\n var startMoment = refMoment;\n var lowerText = text.toLowerCase();\n\n if(lowerText == 'tonight'){\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n\n } else if (/^tomorrow|^tmr/.test(lowerText)) {\n\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n\n } else if (/^yesterday/.test(lowerText)) {\n\n startMoment = startMoment.add(-1, 'day');\n\n } else if(lowerText.match(/last\\s*night/)) {\n\n result.start.imply('hour', 0);\n if (refMoment.hour() > 6) {\n startMoment = startMoment.add(-1, 'day');\n }\n\n } else if (lowerText.match(\"now\")) {\n\n result.start.assign('hour', refMoment.hour());\n result.start.assign('minute', refMoment.minute());\n result.start.assign('second', refMoment.second());\n result.start.assign('millisecond', refMoment.millisecond());\n\n }\n\n result.start.assign('day', startMoment.date())\n result.start.assign('month', startMoment.month() + 1)\n result.start.assign('year', startMoment.year())\n result.tags['ENCasualDateParser'] = true;\n return result;\n }\n}\n","var Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)((this)?\\s*(morning|afternoon|evening|noon|night))/i;\n\nvar TIME_MATCH = 4;\n\nexports.Parser = function ENCasualTimeParser(){\n\n Parser.apply(this, arguments);\n\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n if(!match[TIME_MATCH]) TIME_MATCH = 3;\n \n switch (match[TIME_MATCH].toLowerCase()) {\n\n case 'afternoon':\n result.start.imply('meridiem', 1);\n result.start.imply('hour', 15);\n break;\n\n case 'evening':\n case 'night':\n result.start.imply('meridiem', 1);\n result.start.imply('hour', 20);\n break;\n\n case 'morning':\n result.start.imply('meridiem', 0);\n result.start.imply('hour', 6);\n break;\n\n case 'noon':\n result.start.imply('meridiem', 0);\n result.start.imply('hour', 12);\n break;\n }\n \n result.tags['ENCasualTimeParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nconst parser = require('../parser');\nconst ParsedResult = require('../../result').ParsedResult;\n\nconst util = require('../../utils/JP'); \n\nconst PATTERN = /(?:(同|今|本|((昭和|平成|令和)?([0-90-9]{1,4}|元)))年\\s*)?([0-90-9]{1,2})月\\s*([0-90-9]{1,2})日/i;\nconst SPECIAL_YEAR_GROUP = 1;\nconst TYPICAL_YEAR_GROUP = 2;\nconst ERA_GROUP = 3;\nconst YEAR_NUMBER_GROUP = 4;\nconst MONTH_GROUP = 5;\nconst DAY_GROUP = 6;\n\nexports.Parser = function JPStandardParser(){\n parser.Parser.apply(this, arguments);\n \n this.pattern = function() { return PATTERN; }\n \n this.extract = function(text, ref, match, opt){ \n var result = new ParsedResult({\n text: match[0],\n index: match.index,\n ref: ref,\n });\n \n var month = match[MONTH_GROUP];\n month = util.toHankaku(month);\n month = parseInt(month);\n\n var day = match[DAY_GROUP];\n day = util.toHankaku(day);\n day = parseInt(day);\n\n result.start.assign('day', day);\n result.start.assign('month', month);\n \n if (match[TYPICAL_YEAR_GROUP]) {\n\n var year = match[YEAR_NUMBER_GROUP];\n if (year == '元') {\n year = 1;\n } else {\n year = util.toHankaku(year);\n year = parseInt(year);\n }\n\n if (match[ERA_GROUP] == '令和') {\n year += 2018;\n } else if (match[ERA_GROUP] == '平成') {\n year += 1988;\n } else if (match[ERA_GROUP] == '昭和') {\n year += 1925;\n }\n\n result.start.assign('year', year);\n\n } else if (match[SPECIAL_YEAR_GROUP] && match[SPECIAL_YEAR_GROUP].match('同|今|本')) {\n const moment = dayjs(ref)\n result.start.assign('year', moment.year());\n } else {\n const year = parser.findYearClosestToRef(ref, day, month);\n result.start.imply('year', year);\n }\n \n result.tags['JPStandardParser'] = true;\n return result;\n };\n\n}\n\n","\n\n/**\n * to-hankaku.js\n * convert to ascii code strings.\n *\n * @version 1.0.1\n * @author think49\n * @url https://gist.github.com/964592\n * @license http://www.opensource.org/licenses/mit-license.php (The MIT License)\n */\n \nexports.toHankaku = (function (String, fromCharCode) {\n \n function toHankaku (string) {\n return String(string).replace(/\\u2019/g, '\\u0027').replace(/\\u201D/g, '\\u0022').replace(/\\u3000/g, '\\u0020').replace(/\\uFFE5/g, '\\u00A5').replace(/[\\uFF01\\uFF03-\\uFF06\\uFF08\\uFF09\\uFF0C-\\uFF19\\uFF1C-\\uFF1F\\uFF21-\\uFF3B\\uFF3D\\uFF3F\\uFF41-\\uFF5B\\uFF5D\\uFF5E]/g, alphaNum);\n }\n \n function alphaNum (token) {\n return fromCharCode(token.charCodeAt(0) - 65248);\n }\n \n return toHankaku;\n})(String, String.fromCharCode);\n\n/**\n * to-zenkaku.js\n * convert to multi byte strings.\n *\n * @version 1.0.2\n * @author think49\n * @url https://gist.github.com/964592\n * @license http://www.opensource.org/licenses/mit-license.php (The MIT License)\n */\nexports.toZenkaku = (function (String, fromCharCode) {\n \n function toZenkaku (string) {\n return String(string).replace(/\\u0020/g, '\\u3000').replace(/\\u0022/g, '\\u201D').replace(/\\u0027/g, '\\u2019').replace(/\\u00A5/g, '\\uFFE5').replace(/[!#-&(),-9\\u003C-?A-[\\u005D_a-{}~]/g, alphaNum);\n }\n \n function alphaNum (token) {\n return fromCharCode(token.charCodeAt(0) + 65248);\n }\n \n return toZenkaku;\n})(String, String.fromCharCode);","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /今日|当日|昨日|明日|今夜|今夕|今晩|今朝/i;\n\nexports.Parser = function JPCasualDateParser(){\n \n Parser.apply(this, arguments);\n \n this.pattern = function() { return PATTERN; }\n \n this.extract = function(text, ref, match, opt){ \n \n var index = match.index;\n var text = match[0];\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var refMoment = dayjs(ref);\n var startMoment = refMoment;\n\n if(text == '今夜' || text == '今夕' || text == '今晩'){\n // Normally means this coming midnight \n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n\n } else if(text == '明日'){\n\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 4) {\n startMoment = startMoment.add(1, 'day');\n }\n\n } else if(text == '昨日') {\n\n startMoment = startMoment.add(-1, 'day');\n\n } else if (text.match(\"今朝\")) {\n\n result.start.imply('hour', 6);\n result.start.imply('meridiem', 0);\n }\n\n result.start.assign('day', startMoment.date())\n result.start.assign('month', startMoment.month() + 1)\n result.start.assign('year', startMoment.year())\n result.tags['JPCasualDateParser'] = true;\n return result;\n }\n}\n\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\n/*\n Valid patterns:\n - esta manhã -> today in the morning\n - esta tarde -> today in the afternoon/evening\n - esta noite -> tonight\n - ontem de -> yesterday in the morning\n - ontem a tarde -> yesterday in the afternoon/evening\n - ontem a noite -> yesterday at night\n - amanhã de manhã -> tomorrow in the morning\n - amanhã a tarde -> tomorrow in the afternoon/evening\n - amanhã a noite -> tomorrow at night\n - hoje -> today\n - ontem -> yesterday\n - amanhã -> tomorrow\n */\nvar PATTERN = /(\\W|^)(agora|esta\\s*(manhã|tarde|noite)|(ontem|amanhã)\\s*(de|à)\\s*(manhã|tarde|noite)|hoje|amanhã|ontem|noite)(?=\\W|$)/i;\n\nexports.Parser = function PTCasualDateParser(){\n\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var refMoment = dayjs(ref);\n var startMoment = refMoment;\n var lowerText = text.toLowerCase().replace(/\\s+/g, ' ');\n\n if(lowerText == 'amanhã'){\n\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n\n } else if(lowerText == 'ontem') {\n\n startMoment = startMoment.add(-1, 'day');\n }\n else if(lowerText == 'noite') {\n\n result.start.imply('hour', 0);\n if (refMoment.hour() > 6) {\n startMoment = startMoment.add(-1, 'day');\n }\n\n } else if (lowerText.match(\"esta\")) {\n\n var secondMatch = match[3].toLowerCase();\n if (secondMatch == \"tarde\") {\n\n result.start.imply('hour', 18);\n\n } else if (secondMatch == \"manhã\") {\n\n result.start.imply('hour', 6);\n\n } else if (secondMatch == \"noite\") {\n\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n\n }\n } else if (lowerText.match(/de|à/)) {\n\n var firstMatch = match[4].toLowerCase();\n if (firstMatch === 'ontem') {\n\n startMoment = startMoment.add(-1, 'day');\n\n } else if (firstMatch === 'amanhã') {\n\n startMoment = startMoment.add(1, 'day');\n\n }\n\n var secondMatch = match[6].toLowerCase();\n if (secondMatch == \"tarde\") {\n\n result.start.imply('hour', 18);\n\n } else if (secondMatch == \"manhã\") {\n\n result.start.imply('hour', 9);\n\n } else if (secondMatch == \"noite\") {\n\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n\n }\n\n } else if (lowerText.match(\"agora\")) {\n\n result.start.imply('hour', refMoment.hour());\n result.start.imply('minute', refMoment.minute());\n result.start.imply('second', refMoment.second());\n result.start.imply('millisecond', refMoment.millisecond());\n\n }\n\n result.start.assign('day', startMoment.date())\n result.start.assign('month', startMoment.month() + 1)\n result.start.assign('year', startMoment.year())\n result.tags['PTCasualDateParser'] = true;\n return result;\n }\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)(dentro\\s*de|em|em*até)\\s*([0-9]+|mei[oa]|uma?)\\s*(minutos?|horas?|dias?)\\s*(?=(?:\\W|$))/i;\n\nexports.Parser = function PTDeadlineFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var index = match.index + match[1].length;\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var num = parseInt(match[3]);\n if (isNaN(num)) {\n if (match[3].match(/(meio|meia)/)) {\n num = 0.5;\n } else {\n num = 1;\n }\n }\n\n var date = dayjs(ref);\n if (match[4].match(/dia/)) {\n date = date.add(num, 'd');\n\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n return result;\n }\n\n\n if (match[4].match(/hora/)) {\n\n date = date.add(num, 'hour');\n\n } else if (match[4].match(/minuto/)) {\n\n date = date.add(num, 'minute');\n }\n\n result.start.imply('year', date.year());\n result.start.imply('month', date.month() + 1);\n result.start.imply('day', date.date());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.tags['PTDeadlineFormatParser'] = true;\n return result;\n };\n}\n","var parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar util = require('../../utils/PT');\n\nvar DAYS_OFFSET = util.WEEKDAY_OFFSET;\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:(domingo|segunda|segunda-feira|terça|terça-feira|quarta|quarta-feira|quinta|quinta-feira|sexta|sexta-feira|sábado|sabado|dom|seg|ter|qua|qui|sex|sab)\\\\s*,?\\\\s*)?' +\n '([0-9]{1,2})(?:º|ª|°)?' +\n '(?:\\\\s*(?:desde|de|\\\\-|\\\\–|ao?|\\\\s)\\\\s*([0-9]{1,2})(?:º|ª|°)?)?\\\\s*(?:de)?\\\\s*' +\n '(Jan(?:eiro|\\\\.)?|Fev(?:ereiro|\\\\.)?|Mar(?:ço|\\\\.)?|Abr(?:il|\\\\.)?|Mai(?:o|\\\\.)?|Jun(?:ho|\\\\.)?|Jul(?:ho|\\\\.)?|Ago(?:sto|\\\\.)?|Set(?:embro|\\\\.)?|Out(?:ubro|\\\\.)?|Nov(?:embro|\\\\.)?|Dez(?:embro|\\\\.)?)' +\n '(?:\\\\s*(?:de?)?(\\\\s*[0-9]{1,4}(?![^\\\\s]\\\\d))(\\\\s*[ad]\\\\.?\\\\s*c\\\\.?|a\\\\.?\\\\s*d\\\\.?)?)?' +\n '(?=\\\\W|$)', 'i'\n );\n\nvar WEEKDAY_GROUP = 2;\nvar DATE_GROUP = 3;\nvar DATE_TO_GROUP = 4;\nvar MONTH_NAME_GROUP = 5;\nvar YEAR_GROUP = 6;\nvar YEAR_BE_GROUP = 7;\n\nexports.Parser = function PTMonthNameLittleEndianParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n\n var day = match[DATE_GROUP];\n day = parseInt(day);\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n year = parseInt(year);\n\n if(match[YEAR_BE_GROUP]){\n if (/a\\.?\\s*c\\.?/i.test(match[YEAR_BE_GROUP])) {\n // antes de Cristo\n year = -year;\n }\n } else if (year < 100){\n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month);\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n // Weekday component\n if (match[WEEKDAY_GROUP]) {\n var weekday = match[WEEKDAY_GROUP];\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()]\n result.start.assign('weekday', weekday);\n }\n\n // Text can be 'range' value. Such as '12 - 13 January 2012'\n if (match[DATE_TO_GROUP]) {\n result.end = result.start.clone();\n result.end.assign('day', parseInt(match[DATE_TO_GROUP]));\n }\n\n result.tags['PTMonthNameLittleEndianParser'] = true;\n return result;\n };\n}\n","exports.WEEKDAY_OFFSET = {\n 'domingo': 0,\n 'dom': 0,\n 'segunda': 1,\n 'segunda-feira': 1,\n 'seg': 1,\n 'terça': 2,\n 'terca': 2,\n 'terça-feira': 2,\n 'terca-feira': 2,\n 'ter':2,\n 'quarta': 3,\n 'quarta-feira': 3,\n 'qua': 3,\n 'quinta': 4,\n 'quinta-feira': 4,\n 'qui': 4,\n 'sexta': 5,\n 'sexta-feira': 5,\n 'sex': 5,\n 'sábado': 6,\n 'sabado': 6,\n 'sab': 6,}\n \n exports.MONTH_OFFSET = {\n 'janeiro': 1,\n 'jan': 1,\n 'jan.': 1,\n 'fevereiro': 2,\n 'fev': 2,\n 'fev.': 2,\n 'março': 3,\n 'mar': 3,\n 'mar.': 3,\n 'abril': 4,\n 'abr': 4,\n 'abr.': 4,\n 'maio': 5,\n 'mai': 5,\n 'mai.': 5,\n 'junho': 6,\n 'jun': 6,\n 'jun.': 6,\n 'julho': 7,\n 'jul': 7,\n 'jul.': 7,\n 'agosto': 8,\n 'ago': 8,\n 'ago.': 8,\n 'setembro': 9,\n 'set': 9,\n 'set.': 9,\n 'outubro': 10,\n 'out': 10,\n 'out.': 10,\n 'novembro': 11,\n 'nov': 11,\n 'nov.': 11,\n 'dezembro': 12,\n 'dez': 12,\n 'dez.': 12,\n }","/*\n Date format with slash \"/\" (also \"-\" and \".\") between numbers\n - Martes 3/11/2015\n - 3/11/2015\n - 3/11\n*/\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:' +\n '((?:domingo|dom|segunda|segunda-feira|seg|terça|terça-feira|ter|quarta|quarta-feira|qua|quinta|quinta-feira|qui|sexta|sexta-feira|sex|s[áa]bado|sab))' +\n '\\\\s*\\\\,?\\\\s*' +\n ')?' +\n '([0-1]{0,1}[0-9]{1})[\\\\/\\\\.\\\\-]([0-3]{0,1}[0-9]{1})' +\n '(?:' +\n '[\\\\/\\\\.\\\\-]' +\n '([0-9]{4}\\s*\\,?\\s*|[0-9]{2}\\s*\\,?\\s*)' +\n ')?' +\n '(\\\\W|$)', 'i');\n\nvar DAYS_OFFSET = { 'domingo': 0, 'dom': 0, 'segunda': 1, 'segunda-feira': 1, 'seg': 1, 'terça': 2, 'terça-feira': 2, 'ter': 2, 'quarta': 3, 'quarta-feira': 3, 'qua': 3,\n 'quinta': 4, 'quinta-feira': 4, 'qui': 4, 'sexta': 5, 'sexta-feira': 5, 'sex': 5, 'sábado': 6, 'sabado': 6, 'sab': 6,}\n\n\nvar OPENNING_GROUP = 1;\nvar ENDING_GROUP = 6;\n\n// in Spanish we use day/month/year\nvar WEEKDAY_GROUP = 2;\nvar MONTH_GROUP = 4;\nvar DAY_GROUP = 3;\nvar YEAR_GROUP = 5;\n\nexports.Parser = function PTSlashDateFormatParser(argument) {\n Parser.apply(this, arguments);\n\n this.pattern = function () { return PATTERN; };\n this.extract = function(text, ref, match, opt){\n\n if(match[OPENNING_GROUP] == '/' || match[ENDING_GROUP] == '/') {\n // Long skip, if there is some overlapping like:\n // XX[/YY/ZZ]\n // [XX/YY/]ZZ\n match.index += match[0].length\n return;\n }\n\n var index = match.index + match[OPENNING_GROUP].length;\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length - match[ENDING_GROUP].length);\n\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n });\n\n if(text.match(/^\\d\\.\\d$/)) return;\n if(text.match(/^\\d\\.\\d{1,2}\\.\\d{1,2}$/)) return;\n\n // MM/dd -> OK\n // MM.dd -> NG\n if(!match[YEAR_GROUP] && match[0].indexOf('/') < 0) return;\n\n var date = null;\n var year = match[YEAR_GROUP] || dayjs(ref).year() + '';\n var month = match[MONTH_GROUP];\n var day = match[DAY_GROUP];\n\n month = parseInt(month);\n day = parseInt(day);\n year = parseInt(year);\n\n if(month < 1 || month > 12) {\n if(month > 12) {\n // dd/mm/yyyy date format if day looks like a month, and month\n // looks like a day.\n if (day >= 1 && day <= 12 && month >= 13 && month <= 31) {\n // unambiguous\n var tday = month;\n month = day;\n day = tday;\n }\n else {\n // both month and day are <= 12\n return null;\n }\n }\n }\n if(day < 1 || day > 31) return null;\n\n if(year < 100){\n if(year > 50){\n year = year + 1900;\n }else{\n year = year + 2000;\n }\n }\n\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n\n //Day of week\n if(match[WEEKDAY_GROUP]) {\n result.start.assign('weekday', DAYS_OFFSET[match[WEEKDAY_GROUP].toLowerCase()]);\n }\n\n result.tags['PTSlashDateFormatParser'] = true;\n return result;\n };\n};","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)há\\s*([0-9]+|mei[oa]|uma?)\\s*(minutos?|horas?|semanas?|dias?|mes(es)?|anos?)(?=(?:\\W|$))/i;\n\nexports.Parser = function PTTimeAgoFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return PATTERN;\n }\n\n this.extract = function(text, ref, match, opt){\n\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n let index = match.index + match[1].length;\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var num = parseInt(match[2]);\n if (isNaN(num)) {\n if (match[2].match(/mei/)) {\n num = 0.5;\n } else {\n num = 1;\n }\n }\n\n var date = dayjs(ref);\n\n if (match[3].match(/hora/) || match[3].match(/minuto/)) {\n if (match[3].match(/hora/)) {\n\n date = date.add(-num, 'hour');\n\n } else if (match[3].match(/minuto/)) {\n\n date = date.add(-num, 'minute');\n }\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.tags['PTTimeAgoFormatParser'] = true;\n return result;\n }\n\n if (match[3].match(/semana/)) {\n date = date.add(-num, 'week');\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n result.start.imply('weekday', date.day());\n return result;\n }\n\n if (match[3].match(/dia/)) {\n date = date.add(-num, 'd');\n }\n\n if (match[3].match(/mes/)) {\n date = date.add(-num, 'month');\n }\n\n if (match[3].match(/ano/)) {\n\n date = date.add(-num, 'year');\n }\n\n result.start.assign('day', date.date());\n result.start.assign('month', date.month() + 1);\n result.start.assign('year', date.year());\n return result;\n\n };\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar ParsedComponents = require('../../result').ParsedComponents;\n\nvar FIRST_REG_PATTERN = new RegExp(\"(^|\\\\s|T)\" +\n \"(?:(?:ao?|às?|das|da|de|do)\\\\s*)?\" +\n \"(\\\\d{1,4}|meio-dia|meia-noite|meio dia|meia noite)\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\:|\\\\:)(\\\\d{2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\n \"(?=\\\\W|$)\", 'i');\n\n\nvar SECOND_REG_PATTERN = new RegExp(\"^\\\\s*\" +\n \"(\\\\-|\\\\–|\\\\~|\\\\〜|a(?:o)?|\\\\?)\\\\s*\" +\n \"(\\\\d{1,4})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\n \"(?=\\\\W|$)\", 'i');\n\nvar HOUR_GROUP = 2;\nvar MINUTE_GROUP = 3;\nvar SECOND_GROUP = 4;\nvar AM_PM_HOUR_GROUP = 5;\n\nexports.Parser = function PTTimeExpressionParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return FIRST_REG_PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n // This pattern can be overlaped Ex. [12] AM, 1[2] AM\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n var refMoment = dayjs(ref);\n var result = new ParsedResult();\n result.ref = ref;\n result.index = match.index + match[1].length;\n result.text = match[0].substring(match[1].length);\n result.tags['PTTimeExpressionParser'] = true;\n\n result.start.imply('day', refMoment.date());\n result.start.imply('month', refMoment.month()+1);\n result.start.imply('year', refMoment.year());\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.start.assign('second', second);\n }\n\n // ----- Hours\n if (match[HOUR_GROUP].toLowerCase().match(/meio\\-di/)){\n meridiem = 1;\n hour = 12;\n } else if (match[HOUR_GROUP].toLowerCase() == \"meia-noite\") {\n meridiem = 0;\n hour = 0;\n } else {\n hour = parseInt(match[HOUR_GROUP]);\n }\n\n // ----- Minutes\n if(match[MINUTE_GROUP] != null){\n minute = parseInt(match[MINUTE_GROUP]);\n } else if(hour > 100) {\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if(match[AM_PM_HOUR_GROUP] != null) {\n if(hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if(ampm == \"a\"){\n meridiem = 0;\n if(hour == 12) hour = 0;\n }\n\n if(ampm == \"p\"){\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n }\n result.start.assign('hour', hour);\n result.start.assign('minute', minute);\n if (meridiem >= 0) {\n result.start.assign('meridiem', meridiem);\n }\n\n // ==============================================================\n // Extracting the 'to' chunk\n // ==============================================================\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n // Not accept number only result\n if (result.text.match(/^\\d+$/)) {\n return null;\n }\n return result;\n }\n\n\n\n // Pattern \"YY.YY -XXXX\" is more like timezone offset\n if (match[0].match(/^\\s*(\\+|\\-)\\s*\\d{3,4}$/)) {\n return result;\n }\n\n if(result.end == null){\n result.end = new ParsedComponents(null, result.start.date());\n }\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.end.assign('second', second);\n }\n\n hour = parseInt(match[2]);\n\n // ----- Minute\n if (match[MINUTE_GROUP]!= null) {\n\n minute = parseInt(match[MINUTE_GROUP]);\n if(minute >= 60) return result;\n\n } else if (hour > 100) {\n\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP] != null){\n\n if (hour > 12) return null;\n\n if(match[AM_PM_HOUR_GROUP][0].toLowerCase() == \"a\"){\n meridiem = 0;\n if(hour == 12) {\n hour = 0;\n if (!result.end.isCertain('day')) {\n result.end.imply('day', result.end.get('day') + 1);\n }\n }\n }\n\n if(match[AM_PM_HOUR_GROUP][0].toLowerCase() == \"p\"){\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n\n if (!result.start.isCertain('meridiem')) {\n if (meridiem == 0) {\n\n result.start.imply('meridiem', 0);\n\n if (result.start.get('hour') == 12) {\n result.start.assign('hour', 0);\n }\n\n } else {\n\n result.start.imply('meridiem', 1);\n\n if (result.start.get('hour') != 12) {\n result.start.assign('hour', result.start.get('hour') + 12);\n }\n }\n }\n\n } else if(hour >= 12) {\n meridiem = 1;\n }\n\n result.text = result.text + match[0];\n result.end.assign('hour', hour);\n result.end.assign('minute', minute);\n if (meridiem >= 0) {\n result.end.assign('meridiem', meridiem);\n }\n\n if (result.end.date().getTime() < result.start.date().getTime()) {\n result.end.imply('day', result.end.get('day') + 1)\n }\n\n return result;\n }\n}\n","var Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar updateParsedComponent = require('../en/ENWeekdayParser').updateParsedComponent;\n\nvar DAYS_OFFSET = { 'domingo': 0, 'dom': 0, 'segunda': 1, 'segunda-feira': 1, 'seg': 1, 'terça': 2, 'terça-feira': 2, 'ter': 2, 'quarta': 3, 'quarta-feira': 3, 'qua': 3,\n 'quinta': 4, 'quinta-feira': 4, 'qui': 4, 'sexta': 5, 'sexta-feira': 5, 'sex': 5, 'sábado': 6, 'sabado': 6, 'sab': 6,}\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:(?:\\\\,|\\\\(|\\\\()\\\\s*)?' +\n '(?:(este|esta|passado|pr[oó]ximo)\\\\s*)?' +\n '(' + Object.keys(DAYS_OFFSET).join('|') + ')' +\n '(?:\\\\s*(?:\\\\,|\\\\)|\\\\)))?' +\n '(?:\\\\s*(este|esta|passado|pr[óo]ximo)\\\\s*semana)?' +\n '(?=\\\\W|$)', 'i');\n\nvar PREFIX_GROUP = 2;\nvar WEEKDAY_GROUP = 3;\nvar POSTFIX_GROUP = 4;\n\nexports.Parser = function PTWeekdayParser() {\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n var index = match.index + match[1].length;\n var text = match[0].substr(match[1].length, match[0].length - match[1].length);\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();\n var offset = DAYS_OFFSET[dayOfWeek];\n if(offset === undefined) return null;\n\n var modifier = null;\n var prefix = match[PREFIX_GROUP];\n var postfix = match[POSTFIX_GROUP];\n if (prefix || postfix) {\n var norm = prefix || postfix;\n norm = norm.toLowerCase();\n\n if(norm == 'passado') {\n modifier = 'this';\n }\n else if(norm == 'próximo' || norm == 'proximo') {\n modifier = 'next';\n }\n else if(norm== 'este') {\n modifier = 'this';\n }\n }\n\n updateParsedComponent(result, ref, offset, modifier);\n result.tags['PTWeekdayParser'] = true;\n return result;\n }\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\n/*\n Valid patterns:\n - esta mañana -> today in the morning\n - esta tarde -> today in the afternoon/evening\n - esta noche -> tonight\n - ayer por la mañana -> yesterday in the morning\n - ayer por la tarde -> yesterday in the afternoon/evening\n - ayer por la noche -> yesterday at night\n - mañana por la mañana -> tomorrow in the morning\n - mañana por la tarde -> tomorrow in the afternoon/evening\n - mañana por la noche -> tomorrow at night\n - anoche -> tomorrow at night\n - hoy -> today\n - ayer -> yesterday\n - mañana -> tomorrow\n */\nvar PATTERN = /(\\W|^)(ahora|esta\\s*(mañana|tarde|noche)|(ayer|mañana)\\s*por\\s*la\\s*(mañana|tarde|noche)|hoy|mañana|ayer|anoche)(?=\\W|$)/i;\n\nexports.Parser = function ESCasualDateParser(){\n\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var refMoment = dayjs(ref);\n var startMoment = refMoment;\n var lowerText = text.toLowerCase().replace(/\\s+/g, ' ');\n\n if(lowerText == 'mañana'){\n\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n\n } else if(lowerText == 'ayer') {\n\n startMoment = startMoment.add(-1, 'day');\n }\n else if(lowerText == 'anoche') {\n\n result.start.imply('hour', 0);\n if (refMoment.hour() > 6) {\n startMoment = startMoment.add(-1, 'day');\n }\n\n } else if (lowerText.match(\"esta\")) {\n\n var secondMatch = match[3].toLowerCase();\n if (secondMatch == \"tarde\") {\n\n result.start.imply('hour', 18);\n\n } else if (secondMatch == \"mañana\") {\n\n result.start.imply('hour', 6);\n\n } else if (secondMatch == \"noche\") {\n\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n\n }\n } else if (lowerText.match(/por\\s*la/)) {\n\n var firstMatch = match[4].toLowerCase();\n if (firstMatch === 'ayer') {\n\n startMoment = startMoment.add(-1, 'day');\n\n } else if (firstMatch === 'mañana') {\n\n startMoment = startMoment.add(1, 'day');\n\n }\n\n var secondMatch = match[5].toLowerCase();\n if (secondMatch == \"tarde\") {\n\n result.start.imply('hour', 18);\n\n } else if (secondMatch == \"mañana\") {\n\n result.start.imply('hour', 9);\n\n } else if (secondMatch == \"noche\") {\n\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n\n }\n\n } else if (lowerText.match(\"ahora\")) {\n\n result.start.imply('hour', refMoment.hour());\n result.start.imply('minute', refMoment.minute());\n result.start.imply('second', refMoment.second());\n result.start.imply('millisecond', refMoment.millisecond());\n\n }\n\n result.start.assign('day', startMoment.date())\n result.start.assign('month', startMoment.month() + 1)\n result.start.assign('year', startMoment.year())\n result.tags['ESCasualDateParser'] = true;\n return result;\n }\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)(dentro\\s*de|en)\\s*([0-9]+|medi[oa]|una?)\\s*(minutos?|horas?|d[ií]as?)\\s*(?=(?:\\W|$))/i;\n\nexports.Parser = function ESDeadlineFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var index = match.index + match[1].length;\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var num = parseInt(match[3]);\n if (isNaN(num)) {\n if (match[3].match(/medi/)) {\n num = 0.5;\n } else {\n num = 1;\n }\n }\n\n var date = dayjs(ref);\n if (match[4].match(/d[ií]a/)) {\n date = date.add(num, 'd');\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n return result;\n }\n\n\n if (match[4].match(/hora/)) {\n\n date = date.add(num, 'hour');\n\n } else if (match[4].match(/minuto/)) {\n\n date = date.add(num, 'minute');\n }\n\n result.start.imply('year', date.year());\n result.start.imply('month', date.month() + 1);\n result.start.imply('day', date.date());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.tags['ESDeadlineFormatParser'] = true;\n return result;\n };\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)hace\\s*([0-9]+|medi[oa]|una?)\\s*(minutos?|horas?|semanas?|d[ií]as?|mes(es)?|años?)(?=(?:\\W|$))/i;\n\nexports.Parser = function ESTimeAgoFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return PATTERN;\n }\n\n this.extract = function(text, ref, match, opt){\n\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n let index = match.index + match[1].length;\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var num = parseInt(match[2]);\n if (isNaN(num)) {\n if (match[2].match(/medi/)) {\n num = 0.5;\n } else {\n num = 1;\n }\n }\n\n var date = dayjs(ref);\n\n if (match[3].match(/hora/) || match[3].match(/minuto/)) {\n if (match[3].match(/hora/)) {\n\n date = date.add(-num, 'hour');\n\n } else if (match[3].match(/minuto/)) {\n\n date = date.add(-num, 'minute');\n }\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.tags['ESTimeAgoFormatParser'] = true;\n return result;\n }\n\n if (match[3].match(/semana/)) {\n date = date.add(-num, 'week');\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n result.start.imply('weekday', date.day());\n return result;\n }\n\n if (match[3].match(/d[ií]a/)) {\n date = date.add(-num, 'd');\n }\n\n if (match[3].match(/mes/)) {\n date = date.add(-num, 'month');\n }\n\n if (match[3].match(/año/)) {\n\n date = date.add(-num, 'year');\n }\n\n result.start.assign('day', date.date());\n result.start.assign('month', date.month() + 1);\n result.start.assign('year', date.year());\n return result;\n\n };\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar ParsedComponents = require('../../result').ParsedComponents;\n\nvar FIRST_REG_PATTERN = new RegExp(\"(^|\\\\s|T)\" +\n \"(?:(?:a las?|al?|desde|de)\\\\s*)?\" +\n \"(\\\\d{1,4}|mediod[ií]a|medianoche)\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\:|\\\\:)(\\\\d{2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\n \"(?=\\\\W|$)\", 'i');\n\n\nvar SECOND_REG_PATTERN = new RegExp(\"^\\\\s*\" +\n \"(\\\\-|\\\\–|\\\\~|\\\\〜|a(?:\\s*las)?|\\\\?)\\\\s*\" +\n \"(\\\\d{1,4})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\n \"(?=\\\\W|$)\", 'i');\n\nvar HOUR_GROUP = 2;\nvar MINUTE_GROUP = 3;\nvar SECOND_GROUP = 4;\nvar AM_PM_HOUR_GROUP = 5;\n\nexports.Parser = function ESTimeExpressionParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return FIRST_REG_PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n // This pattern can be overlaped Ex. [12] AM, 1[2] AM\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n var refMoment = dayjs(ref);\n var result = new ParsedResult();\n result.ref = ref;\n result.index = match.index + match[1].length;\n result.text = match[0].substring(match[1].length);\n result.tags['ESTimeExpressionParser'] = true;\n\n result.start.imply('day', refMoment.date());\n result.start.imply('month', refMoment.month()+1);\n result.start.imply('year', refMoment.year());\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.start.assign('second', second);\n }\n\n // ----- Hours\n if (match[HOUR_GROUP].toLowerCase().match(/mediod/)){\n meridiem = 1;\n hour = 12;\n } else if (match[HOUR_GROUP].toLowerCase() == \"medianoche\") {\n meridiem = 0;\n hour = 0;\n } else {\n hour = parseInt(match[HOUR_GROUP]);\n }\n\n // ----- Minutes\n if(match[MINUTE_GROUP] != null){\n minute = parseInt(match[MINUTE_GROUP]);\n } else if(hour > 100) {\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if(match[AM_PM_HOUR_GROUP] != null) {\n if(hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if(ampm == \"a\"){\n meridiem = 0;\n if(hour == 12) hour = 0;\n }\n\n if(ampm == \"p\"){\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n }\n result.start.assign('hour', hour);\n result.start.assign('minute', minute);\n if (meridiem >= 0) {\n result.start.assign('meridiem', meridiem);\n }\n\n // ==============================================================\n // Extracting the 'to' chunk\n // ==============================================================\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n // Not accept number only result\n if (result.text.match(/^\\d+$/)) {\n return null;\n }\n return result;\n }\n\n\n\n // Pattern \"YY.YY -XXXX\" is more like timezone offset\n if (match[0].match(/^\\s*(\\+|\\-)\\s*\\d{3,4}$/)) {\n return result;\n }\n\n if(result.end == null){\n result.end = new ParsedComponents(null, result.start.date());\n }\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.end.assign('second', second);\n }\n\n hour = parseInt(match[2]);\n\n // ----- Minute\n if (match[MINUTE_GROUP]!= null) {\n\n minute = parseInt(match[MINUTE_GROUP]);\n if(minute >= 60) return result;\n\n } else if (hour > 100) {\n\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP] != null){\n\n if (hour > 12) return null;\n\n if(match[AM_PM_HOUR_GROUP][0].toLowerCase() == \"a\"){\n meridiem = 0;\n if(hour == 12) {\n hour = 0;\n if (!result.end.isCertain('day')) {\n result.end.imply('day', result.end.get('day') + 1);\n }\n }\n }\n\n if(match[AM_PM_HOUR_GROUP][0].toLowerCase() == \"p\"){\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n\n if (!result.start.isCertain('meridiem')) {\n if (meridiem == 0) {\n\n result.start.imply('meridiem', 0);\n\n if (result.start.get('hour') == 12) {\n result.start.assign('hour', 0);\n }\n\n } else {\n\n result.start.imply('meridiem', 1);\n\n if (result.start.get('hour') != 12) {\n result.start.assign('hour', result.start.get('hour') + 12);\n }\n }\n }\n\n } else if(hour >= 12) {\n meridiem = 1;\n }\n\n result.text = result.text + match[0];\n result.end.assign('hour', hour);\n result.end.assign('minute', minute);\n if (meridiem >= 0) {\n result.end.assign('meridiem', meridiem);\n }\n\n if (result.end.date().getTime() < result.start.date().getTime()) {\n result.end.imply('day', result.end.get('day') + 1)\n }\n\n return result;\n }\n}\n","var Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar updateParsedComponent = require('../en/ENWeekdayParser').updateParsedComponent;\n\nvar DAYS_OFFSET = { 'domingo': 0, 'dom': 0, 'lunes': 1, 'lun': 1, 'martes': 2, 'mar':2, 'miercoles': 3, 'miércoles': 3, 'mie': 3,\n 'jueves': 4, 'jue': 4, 'viernes': 5, 'vier': 5, 'sabado': 6, 'sábado': 6, 'sab': 6,}\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:(?:\\\\,|\\\\(|\\\\()\\\\s*)?' +\n '(?:(este|pasado|pr[oó]ximo)\\\\s*)?' +\n '(' + Object.keys(DAYS_OFFSET).join('|') + ')' +\n '(?:\\\\s*(?:\\\\,|\\\\)|\\\\)))?' +\n '(?:\\\\s*(este|pasado|pr[óo]ximo)\\\\s*week)?' +\n '(?=\\\\W|$)', 'i');\n\nvar PREFIX_GROUP = 2;\nvar WEEKDAY_GROUP = 3;\nvar POSTFIX_GROUP = 4;\n\nexports.Parser = function ESWeekdayParser() {\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n var index = match.index + match[1].length;\n var text = match[0].substr(match[1].length, match[0].length - match[1].length);\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();\n var offset = DAYS_OFFSET[dayOfWeek];\n if(offset === undefined) return null;\n\n var modifier = null;\n var prefix = match[PREFIX_GROUP];\n var postfix = match[POSTFIX_GROUP];\n if (prefix || postfix) {\n var norm = prefix || postfix;\n norm = norm.toLowerCase();\n\n if(norm == 'pasado') {\n modifier = 'this';\n }\n else if(norm == 'próximo' || norm == 'proximo') {\n modifier = 'next';\n }\n else if(norm== 'este') {\n modifier = 'this';\n }\n }\n\n updateParsedComponent(result, ref, offset, modifier);\n result.tags['ESWeekdayParser'] = true;\n return result;\n }\n}\n","var parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar util = require('../../utils/ES');\n\nvar DAYS_OFFSET = util.WEEKDAY_OFFSET;\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:(Domingo|Lunes|Martes|Miércoles|Miercoles|Jueves|Viernes|Sábado|Sabado|Dom|Lun|Mar|Mie|Jue|Vie|Sab)\\\\s*,?\\\\s*)?' +\n '([0-9]{1,2})(?:º|ª|°)?' +\n '(?:\\\\s*(?:desde|de|\\\\-|\\\\–|al?|hasta|\\\\s)\\\\s*([0-9]{1,2})(?:º|ª|°)?)?\\\\s*(?:de)?\\\\s*' +\n '(Ene(?:ro|\\\\.)?|Feb(?:rero|\\\\.)?|Mar(?:zo|\\\\.)?|Abr(?:il|\\\\.)?|May(?:o|\\\\.)?|Jun(?:io|\\\\.)?|Jul(?:io|\\\\.)?|Ago(?:sto|\\\\.)?|Sep(?:tiembre|\\\\.)?|Set(?:iembre|\\\\.)?|Oct(?:ubre|\\\\.)?|Nov(?:iembre|\\\\.)?|Dic(?:iembre|\\\\.)?)' +\n '(?:\\\\s*(?:del?)?(\\\\s*[0-9]{1,4}(?![^\\\\s]\\\\d))(\\\\s*[ad]\\\\.?\\\\s*c\\\\.?|a\\\\.?\\\\s*d\\\\.?)?)?' +\n '(?=\\\\W|$)', 'i'\n );\n\nvar WEEKDAY_GROUP = 2;\nvar DATE_GROUP = 3;\nvar DATE_TO_GROUP = 4;\nvar MONTH_NAME_GROUP = 5;\nvar YEAR_GROUP = 6;\nvar YEAR_BE_GROUP = 7;\n\nexports.Parser = function ESMonthNameLittleEndianParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n\n var day = match[DATE_GROUP];\n day = parseInt(day);\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n year = parseInt(year);\n\n if(match[YEAR_BE_GROUP]){\n if (/a\\.?\\s*c\\.?/i.test(match[YEAR_BE_GROUP])) {\n // antes de Cristo\n year = -year;\n }\n } else if (year < 100){\n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month);\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n // Weekday component\n if (match[WEEKDAY_GROUP]) {\n var weekday = match[WEEKDAY_GROUP];\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()]\n result.start.assign('weekday', weekday);\n }\n\n // Text can be 'range' value. Such as '12 - 13 January 2012'\n if (match[DATE_TO_GROUP]) {\n result.end = result.start.clone();\n result.end.assign('day', parseInt(match[DATE_TO_GROUP]));\n }\n\n result.tags['ESMonthNameLittleEndianParser'] = true;\n return result;\n };\n}\n","exports.WEEKDAY_OFFSET = {\n 'domingo': 0,\n 'dom': 0,\n 'lunes': 1,\n 'lun': 1,\n 'martes': 2,\n 'mar':2,\n 'miércoles': 3,\n 'miercoles': 3,\n 'mie': 3,\n 'jueves': 4,\n 'jue': 4,\n 'viernes': 5,\n 'vie': 5,\n 'sábado': 6,\n 'sabado': 6,\n 'sab': 6,}\n\nexports.MONTH_OFFSET = {\n 'enero': 1,\n 'ene': 1,\n 'ene.': 1,\n 'febrero': 2,\n 'feb': 2,\n 'feb.': 2,\n 'marzo': 3,\n 'mar': 3,\n 'mar.': 3,\n 'abril': 4,\n 'abr': 4,\n 'abr.': 4,\n 'mayo': 5,\n 'may': 5,\n 'may.': 5,\n 'junio': 6,\n 'jun': 6,\n 'jun.': 6,\n 'julio': 7,\n 'jul': 7,\n 'jul.': 7,\n 'agosto': 8,\n 'ago': 8,\n 'ago.': 8,\n 'septiembre': 9,\n 'sep': 9,\n 'sept': 9,\n 'sep.': 9,\n 'sept.': 9,\n 'octubre': 10,\n 'oct': 10,\n 'oct.': 10,\n 'noviembre': 11,\n 'nov': 11,\n 'nov.': 11,\n 'diciembre': 12,\n 'dic': 12,\n 'dic.': 12,\n}\n","/*\n Date format with slash \"/\" (also \"-\" and \".\") between numbers\n - Martes 3/11/2015\n - 3/11/2015\n - 3/11\n*/\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:' +\n '((?:domingo|dom|lunes|lun|martes|mar|mi[ée]rcoles|mie|jueves|jue|viernes|vie|s[áa]bado|sab))' +\n '\\\\s*\\\\,?\\\\s*' +\n ')?' +\n '([0-1]{0,1}[0-9]{1})[\\\\/\\\\.\\\\-]([0-3]{0,1}[0-9]{1})' +\n '(?:' +\n '[\\\\/\\\\.\\\\-]' +\n '([0-9]{4}\\s*\\,?\\s*|[0-9]{2}\\s*\\,?\\s*)' +\n ')?' +\n '(\\\\W|$)', 'i');\n\nvar DAYS_OFFSET = { 'domingo': 0, 'dom': 0, 'lunes': 1, 'lun': 1, 'martes': 2, 'mar': 2, 'miercoles': 3, 'miércoles': 3, 'mie': 3,\n 'jueves': 4, 'jue': 4, 'viernes': 5, 'vier': 5, 'sábado': 6, 'sabado': 6, 'sab': 6,}\n\n\nvar OPENNING_GROUP = 1;\nvar ENDING_GROUP = 6;\n\n// in Spanish we use day/month/year\nvar WEEKDAY_GROUP = 2;\nvar MONTH_GROUP = 4;\nvar DAY_GROUP = 3;\nvar YEAR_GROUP = 5;\n\nexports.Parser = function ESSlashDateFormatParser(argument) {\n Parser.apply(this, arguments);\n\n this.pattern = function () { return PATTERN; };\n this.extract = function(text, ref, match, opt){\n\n if(match[OPENNING_GROUP] == '/' || match[ENDING_GROUP] == '/') {\n // Long skip, if there is some overlapping like:\n // XX[/YY/ZZ]\n // [XX/YY/]ZZ\n match.index += match[0].length\n return;\n }\n\n var index = match.index + match[OPENNING_GROUP].length;\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length - match[ENDING_GROUP].length);\n\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n });\n\n if(text.match(/^\\d\\.\\d$/)) return;\n if(text.match(/^\\d\\.\\d{1,2}\\.\\d{1,2}$/)) return;\n\n // MM/dd -> OK\n // MM.dd -> NG\n if(!match[YEAR_GROUP] && match[0].indexOf('/') < 0) return;\n\n var date = null;\n var year = match[YEAR_GROUP] || dayjs(ref).year() + '';\n var month = match[MONTH_GROUP];\n var day = match[DAY_GROUP];\n\n month = parseInt(month);\n day = parseInt(day);\n year = parseInt(year);\n\n if(month < 1 || month > 12) {\n if(month > 12) {\n // dd/mm/yyyy date format if day looks like a month, and month\n // looks like a day.\n if (day >= 1 && day <= 12 && month >= 13 && month <= 31) {\n // unambiguous\n var tday = month;\n month = day;\n day = tday;\n }\n else {\n // both month and day are <= 12\n return null;\n }\n }\n }\n if(day < 1 || day > 31) return null;\n\n if(year < 100){\n if(year > 50){\n year = year + 1900;\n }else{\n year = year + 2000;\n }\n }\n\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n\n //Day of week\n if(match[WEEKDAY_GROUP]) {\n result.start.assign('weekday', DAYS_OFFSET[match[WEEKDAY_GROUP].toLowerCase()]);\n }\n\n result.tags['ESSlashDateFormatParser'] = true;\n return result;\n };\n};","const dayjs = require('dayjs');\r\nvar Parser = require('../parser').Parser;\r\nvar ParsedResult = require('../../result').ParsedResult;\r\n\r\nvar PATTERN = /(\\W|^)(maintenant|aujourd'hui|ajd|cette\\s*nuit|la\\s*veille|(demain|hier)(\\s*(matin|soir|aprem|après-midi))?|ce\\s*(matin|soir)|cet\\s*(après-midi|aprem))(?=\\W|$)/i;\r\n\r\nexports.Parser = function FRCasualDateParser(){\r\n\r\n Parser.apply(this, arguments);\r\n\r\n this.pattern = function() { return PATTERN; }\r\n\r\n this.extract = function(text, ref, match, opt){\r\n\r\n var text = match[0].substr(match[1].length);\r\n var index = match.index + match[1].length;\r\n var result = new ParsedResult({\r\n index: index,\r\n text: text,\r\n ref: ref,\r\n });\r\n\r\n var refMoment = dayjs(ref);\r\n var startMoment = refMoment;\r\n var lowerText = text.toLowerCase();\r\n\r\n if(lowerText.match(/demain/)){\r\n // Check not \"Tomorrow\" on late night\r\n if(refMoment.hour() > 1) {\r\n startMoment = startMoment.add(1, 'day');\r\n }\r\n } \r\n\r\n if(lowerText.match(/hier/)) {\r\n startMoment = startMoment.add(-1, 'day');\r\n }\r\n\r\n if(lowerText.match(/cette\\s*nuit/)){\r\n // Normally means this coming midnight\r\n result.start.imply('hour', 22);\r\n result.start.imply('meridiem', 1);\r\n\r\n } else if(lowerText.match(/la\\s*veille/)) {\r\n\r\n result.start.imply('hour', 0);\r\n if (refMoment.hour() > 6) {\r\n startMoment = startMoment.add(-1, 'day');\r\n }\r\n\r\n } else if (lowerText.match(/(après-midi|aprem)/)) {\r\n\r\n result.start.imply('hour', 14);\r\n\r\n } else if (lowerText.match(/(soir)/)) {\r\n\r\n result.start.imply('hour', 18);\r\n\r\n } else if (lowerText.match(/matin/)) {\r\n\r\n result.start.imply('hour', 8);\r\n\r\n } else if (lowerText.match(\"maintenant\")) {\r\n\r\n result.start.imply('hour', refMoment.hour());\r\n result.start.imply('minute', refMoment.minute());\r\n result.start.imply('second', refMoment.second());\r\n result.start.imply('millisecond', refMoment.millisecond());\r\n\r\n }\r\n\r\n result.start.assign('day', startMoment.date())\r\n result.start.assign('month', startMoment.month() + 1)\r\n result.start.assign('year', startMoment.year())\r\n result.tags['FRCasualDateParser'] = true;\r\n return result;\r\n }\r\n}\r\n","const dayjs = require('dayjs');\r\nvar Parser = require('../parser').Parser;\r\nvar ParsedResult = require('../../result').ParsedResult;\r\nvar util = require('../../utils/FR');\r\n\r\nvar PATTERN = new RegExp('(\\\\W|^)' +\r\n '(dans|en)\\\\s*' +\r\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|une?|(?:\\\\s*quelques)?|demi(?:\\\\s*|-?)?)\\\\s*' +\r\n '(secondes?|min(?:ute)?s?|heures?|jours?|semaines?|mois|années?)\\\\s*' +\r\n '(?=\\\\W|$)', 'i'\r\n);\r\n\r\nvar STRICT_PATTERN = new RegExp('(\\\\W|^)' +\r\n '(dans|en)\\\\s*' +\r\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|un?)\\\\s*' +\r\n '(secondes?|minutes?|heures?|jours?)\\\\s*' +\r\n '(?=\\\\W|$)', 'i'\r\n);\r\n\r\nexports.Parser = function FRDeadlineFormatParser(){\r\n Parser.apply(this, arguments);\r\n\r\n this.pattern = function() {\r\n return this.isStrictMode()? STRICT_PATTERN : PATTERN;\r\n };\r\n\r\n this.extract = function(text, ref, match, opt){\r\n\r\n var index = match.index + match[1].length;\r\n var text = match[0];\r\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\r\n\r\n var result = new ParsedResult({\r\n index: index,\r\n text: text,\r\n ref: ref\r\n });\r\n\r\n var num = match[3];\r\n if (util.INTEGER_WORDS[num] !== undefined) {\r\n num = util.INTEGER_WORDS[num];\r\n } else if (num === 'un' || num === 'une'){\r\n num = 1;\r\n } else if (num.match(/quelques?/i)){\r\n num = 3;\r\n } else if (num.match(/demi-?/i)) {\r\n num = 0.5;\r\n } else {\r\n num = parseInt(num);\r\n }\r\n\r\n var date = dayjs(ref);\r\n if (match[4].match(/jour|semaine|mois|année/i)) {\r\n\r\n if (match[4].match(/jour/)) {\r\n date = date.add(num, 'd');\r\n } else if (match[4].match(/semaine/i)) {\r\n date = date.add(num * 7, 'd');\r\n } else if (match[4].match(/mois/i)) {\r\n date = date.add(num, 'month');\r\n } else if (match[4].match(/année/i)) {\r\n date = date.add(num, 'year');\r\n }\r\n\r\n result.start.assign('year', date.year());\r\n result.start.assign('month', date.month() + 1);\r\n result.start.assign('day', date.date());\r\n return result;\r\n }\r\n\r\n if (match[4].match(/heure/i)) {\r\n\r\n date = date.add(num, 'hour');\r\n\r\n } else if (match[4].match(/min/i)) {\r\n\r\n date = date.add(num, 'minutes');\r\n\r\n } else if (match[4].match(/secondes/i)) {\r\n\r\n date = date.add(num, 'second');\r\n }\r\n\r\n result.start.imply('year', date.year());\r\n result.start.imply('month', date.month() + 1);\r\n result.start.imply('day', date.date());\r\n result.start.assign('hour', date.hour());\r\n result.start.assign('minute', date.minute());\r\n result.start.assign('second', date.second());\r\n result.tags['FRDeadlineFormatParser'] = true;\r\n return result;\r\n };\r\n};\r\n","const parser = require('../parser');\r\nvar ParsedResult = require('../../result').ParsedResult;\r\n\r\nvar util = require('../../utils/FR');\r\n\r\nvar DAYS_OFFSET = util.WEEKDAY_OFFSET;\r\n\r\nvar PATTERN = new RegExp('(\\\\W|^)' +\r\n '(?:(Dimanche|Lundi|Mardi|mercredi|Jeudi|Vendredi|Samedi|Dim|Lun|Mar|Mer|Jeu|Ven|Sam)\\\\s*,?\\\\s*)?' +\r\n '([0-9]{1,2}|1er)' +\r\n '(?:\\\\s*(?:au|\\\\-|\\\\–|jusqu\\'au?|\\\\s)\\\\s*([0-9]{1,2})(?:er)?)?\\\\s*(?:de)?\\\\s*' +\r\n '(Jan(?:vier|\\\\.)?|F[ée]v(?:rier|\\\\.)?|Mars|Avr(?:il|\\\\.)?|Mai|Juin|Juil(?:let|\\\\.)?|Ao[uû]t|Sept(?:embre|\\\\.)?|Oct(?:obre|\\\\.)?|Nov(?:embre|\\\\.)?|d[ée]c(?:embre|\\\\.)?)' +\r\n '(?:\\\\s*(\\\\s*[0-9]{1,4}(?![^\\\\s]\\\\d))(?:\\\\s*(AC|[ap]\\\\.?\\\\s*c(?:h(?:r)?)?\\\\.?\\\\s*n\\\\.?))?)?' +\r\n '(?=\\\\W|$)', 'i'\r\n );\r\n\r\nvar WEEKDAY_GROUP = 2;\r\nvar DATE_GROUP = 3;\r\nvar DATE_TO_GROUP = 4;\r\nvar MONTH_NAME_GROUP = 5;\r\nvar YEAR_GROUP = 6;\r\nvar YEAR_BE_GROUP = 7;\r\n\r\nexports.Parser = function FRMonthNameLittleEndianParser(){\r\n parser.Parser.apply(this, arguments);\r\n\r\n this.pattern = function() { return PATTERN; }\r\n\r\n this.extract = function(text, ref, match, opt){\r\n\r\n var result = new ParsedResult({\r\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\r\n index: match.index + match[1].length,\r\n ref: ref,\r\n });\r\n\r\n var month = match[MONTH_NAME_GROUP];\r\n month = util.MONTH_OFFSET[month.toLowerCase()];\r\n\r\n var day = match[DATE_GROUP];\r\n day = parseInt(day);\r\n\r\n var year = null;\r\n if (match[YEAR_GROUP]) {\r\n year = match[YEAR_GROUP];\r\n year = parseInt(year);\r\n\r\n if(match[YEAR_BE_GROUP]){\r\n if (/a/i.test(match[YEAR_BE_GROUP])) {\r\n // Ante Christe natum\r\n year = -year;\r\n }\r\n } else if (year < 100){\r\n\r\n year = year + 2000;\r\n }\r\n }\r\n\r\n if(year){\r\n result.start.assign('day', day);\r\n result.start.assign('month', month);\r\n result.start.assign('year', year);\r\n } else {\r\n year = parser.findYearClosestToRef(ref, day, month)\r\n result.start.assign('day', day);\r\n result.start.assign('month', month);\r\n result.start.imply('year', year);\r\n }\r\n\r\n // Weekday component\r\n if (match[WEEKDAY_GROUP]) {\r\n var weekday = match[WEEKDAY_GROUP];\r\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()]\r\n result.start.assign('weekday', weekday);\r\n }\r\n\r\n // Text can be 'range' value. Such as '12 - 13 janvier 2012'\r\n if (match[DATE_TO_GROUP]) {\r\n result.end = result.start.clone();\r\n result.end.assign('day', parseInt(match[DATE_TO_GROUP]));\r\n }\r\n\r\n result.tags['FRMonthNameLittleEndianParser'] = true;\r\n return result;\r\n };\r\n}\r\n","/*\r\n Date format with slash \"/\" (also \"-\" and \".\") between numbers\r\n - Martes 3/11/2015\r\n - 3/11/2015\r\n - 3/11\r\n*/\r\nvar parser = require('../parser');\r\nvar ParsedResult = require('../../result').ParsedResult;\r\n\r\nvar PATTERN = new RegExp('(\\\\W|^)' +\r\n '(?:' +\r\n '((?:dimanche|dim|lundi|lun|mardi|mar|mercredi|mer|jeudi|jeu|vendredi|ven|samedi|sam|le))' +\r\n '\\\\s*\\\\,?\\\\s*' +\r\n ')?' +\r\n '([0-3]{0,1}[0-9]{1})[\\\\/\\\\.\\\\-]([0-3]{0,1}[0-9]{1})' +\r\n '(?:' +\r\n '[\\\\/\\\\.\\\\-]' +\r\n '([0-9]{4}\\s*\\,?\\s*|[0-9]{2}\\s*\\,?\\s*)' +\r\n ')?' +\r\n '(\\\\W|$)', 'i');\r\n\r\nvar DAYS_OFFSET = { 'dimanche': 0, 'dim': 0, 'lundi': 1, 'lun': 1,'mardi': 2, 'mar':2, 'mercredi': 3, 'mer': 3,\r\n 'jeudi': 4, 'jeu':4, 'vendredi': 5, 'ven': 5,'samedi': 6, 'sam': 6};\r\n\r\n\r\nvar OPENNING_GROUP = 1;\r\nvar ENDING_GROUP = 6;\r\n\r\n// In French we use day/month/year\r\nvar WEEKDAY_GROUP = 2;\r\nvar DAY_GROUP = 3;\r\nvar MONTH_GROUP = 4;\r\nvar YEAR_GROUP = 5;\r\n\r\nexports.Parser = function FRSlashDateFormatParser(argument) {\r\n parser.Parser.apply(this, arguments);\r\n\r\n this.pattern = function () { return PATTERN; };\r\n this.extract = function(text, ref, match, opt){\r\n\r\n if(match[OPENNING_GROUP] == '/' || match[ENDING_GROUP] == '/') {\r\n // Long skip, if there is some overlapping like:\r\n // XX[/YY/ZZ]\r\n // [XX/YY/]ZZ\r\n match.index += match[0].length\r\n return;\r\n }\r\n\r\n var index = match.index + match[OPENNING_GROUP].length;\r\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length - match[ENDING_GROUP].length);\r\n\r\n\r\n var result = new ParsedResult({\r\n text: text,\r\n index: index,\r\n ref: ref,\r\n });\r\n\r\n if(text.match(/^\\d\\.\\d$/)) return;\r\n if(text.match(/^\\d\\.\\d{1,2}\\.\\d{1,2}$/)) return;\r\n\r\n // MM/dd -> OK\r\n // MM.dd -> NG\r\n if(!match[YEAR_GROUP] && match[0].indexOf('/') < 0) return;\r\n\r\n var date = null;\r\n var month = match[MONTH_GROUP];\r\n var day = match[DAY_GROUP];\r\n\r\n day = parseInt(day);\r\n month = parseInt(month);\r\n\r\n var year = null;\r\n if (match[YEAR_GROUP]) {\r\n year = match[YEAR_GROUP];\r\n year = parseInt(year);\r\n\r\n if (year < 100){\r\n year = year + 2000;\r\n }\r\n }\r\n\r\n if(month < 1 || month > 12) {\r\n if(month > 12) {\r\n // dd/mm/yyyy date format if day looks like a month, and month looks like a day.\r\n if (day >= 1 && day <= 12 && month >= 13 && month <= 31) {\r\n // unambiguous\r\n var tday = month;\r\n month = day;\r\n day = tday;\r\n }\r\n else {\r\n // both month and day are <= 12\r\n return null;\r\n }\r\n }\r\n }\r\n\r\n if(day < 1 || day > 31) return null;\r\n\r\n if(year){\r\n result.start.assign('day', day);\r\n result.start.assign('month', month);\r\n result.start.assign('year', year);\r\n } else {\r\n year = parser.findYearClosestToRef(ref, day, month)\r\n result.start.assign('day', day);\r\n result.start.assign('month', month);\r\n result.start.imply('year', year);\r\n }\r\n\r\n // Day of week\r\n if(match[WEEKDAY_GROUP]) {\r\n result.start.assign('weekday', DAYS_OFFSET[match[WEEKDAY_GROUP].toLowerCase()]);\r\n }\r\n\r\n result.tags['FRSlashDateFormatParser'] = true;\r\n return result;\r\n };\r\n};","const dayjs = require('dayjs');\r\nvar Parser = require('../parser').Parser;\r\nvar ParsedResult = require('../../result').ParsedResult;\r\n\r\nvar PATTERN = /(\\W|^)il y a\\s*([0-9]+|une?)\\s*(minutes?|heures?|semaines?|jours?|mois|années?|ans?)(?=(?:\\W|$))/i;\r\n\r\nexports.Parser = function FRTimeAgoFormatParser(){\r\n Parser.apply(this, arguments);\r\n\r\n this.pattern = function() {\r\n return PATTERN;\r\n }\r\n\r\n this.extract = function(text, ref, match, opt){\r\n\r\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\r\n\r\n var text = match[0];\r\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\r\n let index = match.index + match[1].length;\r\n\r\n var result = new ParsedResult({\r\n index: index,\r\n text: text,\r\n ref: ref,\r\n });\r\n result.tags['FRTimeAgoFormatParser'] = true;\r\n \r\n var num = parseInt(match[2]);\r\n if (isNaN(num)) {\r\n if (match[2].match(/demi/)) {\r\n num = 0.5;\r\n } else {\r\n num = 1;\r\n }\r\n }\r\n\r\n var date = dayjs(ref);\r\n\r\n if (match[3].match(/heure/) || match[3].match(/minute/)) {\r\n if (match[3].match(/heure/)) {\r\n\r\n date = date.add(-num, 'hour');\r\n\r\n } else if (match[3].match(/minute/)) {\r\n\r\n date = date.add(-num, 'minute');\r\n }\r\n\r\n result.start.imply('day', date.date());\r\n result.start.imply('month', date.month() + 1);\r\n result.start.imply('year', date.year());\r\n result.start.assign('hour', date.hour());\r\n result.start.assign('minute', date.minute());\r\n\r\n return result;\r\n }\r\n\r\n if (match[3].match(/semaine/)) {\r\n date = date.add(-num, 'week');\r\n\r\n result.start.imply('day', date.date());\r\n result.start.imply('month', date.month() + 1);\r\n result.start.imply('year', date.year());\r\n result.start.imply('weekday', date.day());\r\n return result;\r\n }\r\n\r\n if (match[3].match(/jour/)) {\r\n date = date.add(-num, 'd');\r\n }\r\n\r\n if (match[3].match(/mois/)) {\r\n date = date.add(-num, 'month');\r\n }\r\n\r\n if (match[3].match(/années?|ans?/)) {\r\n date = date.add(-num, 'year');\r\n }\r\n\r\n result.start.assign('day', date.date());\r\n result.start.assign('month', date.month() + 1);\r\n result.start.assign('year', date.year());\r\n return result;\r\n\r\n };\r\n}\r\n","const dayjs = require('dayjs');\r\nvar Parser = require('../parser').Parser;\r\nvar ParsedResult = require('../../result').ParsedResult;\r\nvar ParsedComponents = require('../../result').ParsedComponents;\r\n\r\nvar FIRST_REG_PATTERN = new RegExp(\"(^|\\\\s|T)\" +\r\n \"(?:(?:[àa])\\\\s*)?\" +\r\n \"(\\\\d{1,2}(?:h)?|midi|minuit)\" +\r\n \"(?:\" +\r\n \"(?:\\\\.|\\\\:|\\\\:|h)(\\\\d{1,2})(?:m)?\" +\r\n \"(?:\" +\r\n \"(?:\\\\:|\\\\:|m)(\\\\d{0,2})(?:s)?\" +\r\n \")?\" +\r\n \")?\" +\r\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\r\n \"(?=\\\\W|$)\", 'i');\r\n\r\n\r\nvar SECOND_REG_PATTERN = new RegExp(\"^\\\\s*\" +\r\n \"(\\\\-|\\\\–|\\\\~|\\\\〜|[àa]|\\\\?)\\\\s*\" +\r\n \"(\\\\d{1,2}(?:h)?)\" +\r\n \"(?:\" +\r\n \"(?:\\\\.|\\\\:|\\\\:|h)(\\\\d{1,2})(?:m)?\" +\r\n \"(?:\" +\r\n \"(?:\\\\.|\\\\:|\\\\:|m)(\\\\d{1,2})(?:s)?\" +\r\n \")?\" +\r\n \")?\" +\r\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\r\n \"(?=\\\\W|$)\", 'i');\r\n\r\nvar HOUR_GROUP = 2;\r\nvar MINUTE_GROUP = 3;\r\nvar SECOND_GROUP = 4;\r\nvar AM_PM_HOUR_GROUP = 5;\r\n\r\nexports.Parser = function FRTimeExpressionParser(){\r\n Parser.apply(this, arguments);\r\n\r\n this.pattern = function() { return FIRST_REG_PATTERN; }\r\n\r\n this.extract = function(text, ref, match, opt){\r\n\r\n // This pattern can be overlaped Ex. [12] AM, 1[2] AM\r\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\r\n var refMoment = dayjs(ref);\r\n var result = new ParsedResult();\r\n result.ref = ref;\r\n result.index = match.index + match[1].length;\r\n result.text = match[0].substring(match[1].length);\r\n result.tags['FRTimeExpressionParser'] = true;\r\n\r\n result.start.imply('day', refMoment.date());\r\n result.start.imply('month', refMoment.month()+1);\r\n result.start.imply('year', refMoment.year());\r\n\r\n var hour = 0;\r\n var minute = 0;\r\n var meridiem = -1;\r\n\r\n // ----- Second\r\n if(match[SECOND_GROUP] != null){\r\n var second = parseInt(match[SECOND_GROUP]);\r\n if(second >= 60) return null;\r\n\r\n result.start.assign('second', second);\r\n }\r\n\r\n // ----- Hours\r\n if (match[HOUR_GROUP].toLowerCase() == \"midi\"){\r\n meridiem = 1;\r\n hour = 12;\r\n } else if (match[HOUR_GROUP].toLowerCase() == \"minuit\") {\r\n meridiem = 0;\r\n hour = 0;\r\n } else {\r\n hour = parseInt(match[HOUR_GROUP]);\r\n }\r\n\r\n // ----- Minutes\r\n if(match[MINUTE_GROUP] != null){\r\n minute = parseInt(match[MINUTE_GROUP]);\r\n } else if(hour > 100) {\r\n minute = hour%100;\r\n hour = parseInt(hour/100);\r\n }\r\n\r\n if(minute >= 60) {\r\n return null;\r\n }\r\n\r\n if(hour > 24) {\r\n return null;\r\n }\r\n if (hour >= 12) {\r\n meridiem = 1;\r\n }\r\n\r\n // ----- AM & PM\r\n if(match[AM_PM_HOUR_GROUP] != null) {\r\n if(hour > 12) return null;\r\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\r\n if(ampm == \"a\"){\r\n meridiem = 0;\r\n if(hour == 12) hour = 0;\r\n }\r\n\r\n if(ampm == \"p\"){\r\n meridiem = 1;\r\n if(hour != 12) hour += 12;\r\n }\r\n }\r\n result.start.assign('hour', hour);\r\n result.start.assign('minute', minute);\r\n if (meridiem >= 0) {\r\n result.start.assign('meridiem', meridiem);\r\n }\r\n\r\n // ==============================================================\r\n // Extracting the 'to' chunk\r\n // ==============================================================\r\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\r\n if (!match) {\r\n // Not accept number only result\r\n if (result.text.match(/^\\d+$/)) {\r\n return null;\r\n }\r\n return result;\r\n }\r\n\r\n\r\n\r\n // Pattern \"YY.YY -XXXX\" is more like timezone offset\r\n if (match[0].match(/^\\s*(\\+|\\-)\\s*\\d{3,4}$/)) {\r\n return result;\r\n }\r\n\r\n if(result.end == null){\r\n result.end = new ParsedComponents(null, result.start.date());\r\n }\r\n\r\n var hour = 0;\r\n var minute = 0;\r\n var meridiem = -1;\r\n\r\n // ----- Second\r\n if(match[SECOND_GROUP] != null){\r\n var second = parseInt(match[SECOND_GROUP]);\r\n if(second >= 60) return null;\r\n\r\n result.end.assign('second', second);\r\n }\r\n\r\n hour = parseInt(match[2]);\r\n\r\n // ----- Minute\r\n if (match[MINUTE_GROUP]!= null) {\r\n\r\n minute = parseInt(match[MINUTE_GROUP]);\r\n if(minute >= 60) return result;\r\n\r\n } else if (hour > 100) {\r\n\r\n minute = hour%100;\r\n hour = parseInt(hour/100);\r\n }\r\n\r\n if(minute >= 60) {\r\n return null;\r\n }\r\n\r\n if(hour > 24) {\r\n return null;\r\n }\r\n if (hour >= 12) {\r\n meridiem = 1;\r\n }\r\n\r\n // ----- AM & PM\r\n if (match[AM_PM_HOUR_GROUP] != null){\r\n\r\n if (hour > 12) return null;\r\n\r\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\r\n if(ampm == \"a\"){\r\n meridiem = 0;\r\n if(hour == 12) {\r\n hour = 0;\r\n if (!result.end.isCertain('day')) {\r\n result.end.imply('day', result.end.get('day') + 1);\r\n }\r\n }\r\n }\r\n\r\n if(ampm == \"p\"){\r\n meridiem = 1;\r\n if(hour != 12) hour += 12;\r\n }\r\n\r\n if (!result.start.isCertain('meridiem')) {\r\n if (meridiem == 0) {\r\n\r\n result.start.imply('meridiem', 0);\r\n\r\n if (result.start.get('hour') == 12) {\r\n result.start.assign('hour', 0);\r\n }\r\n\r\n } else {\r\n\r\n result.start.imply('meridiem', 1);\r\n\r\n if (result.start.get('hour') != 12) {\r\n result.start.assign('hour', result.start.get('hour') + 12);\r\n }\r\n }\r\n }\r\n }\r\n\r\n result.text = result.text + match[0];\r\n result.end.assign('hour', hour);\r\n result.end.assign('minute', minute);\r\n if (meridiem >= 0) {\r\n result.end.assign('meridiem', meridiem);\r\n } else {\r\n var startAtPM = result.start.isCertain('meridiem') && result.start.get('meridiem') == 1;\r\n if (startAtPM && result.start.get('hour') > hour) {\r\n // 10pm - 1 (am)\r\n result.end.imply('meridiem', 0);\r\n\r\n } else if (hour > 12) {\r\n result.end.imply('meridiem', 1);\r\n }\r\n }\r\n\r\n if (result.end.date().getTime() < result.start.date().getTime()) {\r\n result.end.imply('day', result.end.get('day') + 1)\r\n }\r\n\r\n return result;\r\n }\r\n}\r\n","var Parser = require('../parser').Parser;\r\nvar ParsedResult = require('../../result').ParsedResult;\r\nvar updateParsedComponent = require('../en/ENWeekdayParser').updateParsedComponent;\r\n\r\nvar DAYS_OFFSET = { 'dimanche': 0, 'dim': 0, 'lundi': 1, 'lun': 1,'mardi': 2, 'mar':2, 'mercredi': 3, 'mer': 3,\r\n 'jeudi': 4, 'jeu':4, 'vendredi': 5, 'ven': 5,'samedi': 6, 'sam': 6};\r\n\r\nvar PATTERN = new RegExp('(\\\\s|^)' +\r\n '(?:(?:\\\\,|\\\\(|\\\\()\\\\s*)?' +\r\n '(?:(ce)\\\\s*)?' +\r\n '(' + Object.keys(DAYS_OFFSET).join('|') + ')' +\r\n '(?:\\\\s*(?:\\\\,|\\\\)|\\\\)))?' +\r\n '(?:\\\\s*(dernier|prochain)\\\\s*)?' +\r\n '(?=\\\\W|$)', 'i');\r\n\r\nvar PREFIX_GROUP = 2;\r\nvar WEEKDAY_GROUP = 3;\r\nvar POSTFIX_GROUP = 4;\r\n\r\nexports.Parser = function FRWeekdayParser() {\r\n Parser.apply(this, arguments);\r\n\r\n this.pattern = function() { return PATTERN; };\r\n\r\n this.extract = function(text, ref, match, opt){\r\n var index = match.index + match[1].length;\r\n var text = match[0].substr(match[1].length, match[0].length - match[1].length);\r\n var result = new ParsedResult({\r\n index: index,\r\n text: text,\r\n ref: ref\r\n });\r\n\r\n var dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();\r\n var offset = DAYS_OFFSET[dayOfWeek];\r\n if(offset === undefined) return null;\r\n\r\n var modifier = null;\r\n var prefix = match[PREFIX_GROUP];\r\n var postfix = match[POSTFIX_GROUP];\r\n if (prefix || postfix) {\r\n var norm = prefix || postfix;\r\n norm = norm.toLowerCase();\r\n\r\n if(norm == 'dernier') {\r\n modifier = 'last';\r\n } else if(norm == 'prochain') {\r\n modifier = 'next';\r\n } else if(norm== 'ce') {\r\n modifier = 'this';\r\n }\r\n }\r\n\r\n updateParsedComponent(result, ref, offset, modifier);\r\n result.tags['FRWeekdayParser'] = true;\r\n return result;\r\n }\r\n};\r\n\r\n","const quarterOfYear = require('dayjs/plugin/quarterOfYear');\nconst dayjs = require('dayjs');\ndayjs.extend(quarterOfYear);\n\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/FR');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:les?|la|l\\'|du|des?)\\\\s*' +\n '('+ util.INTEGER_WORDS_PATTERN + '|\\\\d+)?\\\\s*' +\n '(prochaine?s?|derni[eè]re?s?|pass[ée]e?s?|pr[ée]c[ée]dents?|suivante?s?)?\\\\s*' +\n '(secondes?|min(?:ute)?s?|heures?|jours?|semaines?|mois|trimestres?|années?)\\\\s*' +\n '(prochaine?s?|derni[eè]re?s?|pass[ée]e?s?|pr[ée]c[ée]dents?|suivante?s?)?' +\n '(?=\\\\W|$)', 'i'\n);\n\nvar MULTIPLIER_GROUP = 2;\nvar MODIFIER_1_GROUP = 3;\nvar RELATIVE_WORD_GROUP = 4;\nvar MODIFIER_2_GROUP = 5;\n\nexports.Parser = function FRRelativeDateFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; };\n\n this.extract = function(text, ref, match, opt){\n var index = match.index + match[1].length;\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n\n // Multiplier\n var multiplier = match[MULTIPLIER_GROUP] === undefined ? '1' : match[MULTIPLIER_GROUP];\n if (util.INTEGER_WORDS[multiplier] !== undefined) {\n multiplier = util.INTEGER_WORDS[multiplier];\n } else {\n multiplier = parseInt(multiplier);\n }\n\n // Modifier\n var modifier = match[MODIFIER_1_GROUP] === undefined ?\n (match[MODIFIER_2_GROUP] === undefined ? '' : match[MODIFIER_2_GROUP].toLowerCase())\n : match[MODIFIER_1_GROUP].toLowerCase();\n if(!modifier) {\n // At least one modifier is mandatory to match this parser\n return;\n }\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n result.tags['FRRelativeDateFormatParser'] = true;\n\n var modifierFactor;\n switch(true) {\n case /prochaine?s?/.test(modifier):\n case /suivants?/.test(modifier):\n modifierFactor = 1;\n break;\n case /derni[eè]re?s?/.test(modifier):\n case /pass[ée]e?s?/.test(modifier):\n case /pr[ée]c[ée]dents?/.test(modifier):\n modifierFactor = -1;\n break;\n }\n\n var total = multiplier * modifierFactor;\n\n var dateFrom = dayjs(ref);\n var dateTo = dayjs(ref);\n\n var relative = match[RELATIVE_WORD_GROUP];\n var startOf;\n switch(true) {\n case /secondes?/.test(relative):\n dateFrom = dateFrom.add(total, 's');\n dateTo = dateTo.add(modifierFactor, 's');\n startOf = 'second';\n break;\n case /min(?:ute)?s?/.test(relative):\n dateFrom = dateFrom.add(total, 'm');\n dateTo = dateTo.add(modifierFactor, 'm');\n startOf = 'minute';\n break;\n case /heures?/.test(relative):\n dateFrom = dateFrom.add(total, 'h');\n dateTo = dateTo.add(modifierFactor, 'h');\n startOf = 'hour';\n break;\n case /jours?/.test(relative):\n dateFrom = dateFrom.add(total, 'd');\n dateTo = dateTo.add(modifierFactor, 'd');\n startOf = 'day';\n break;\n case /semaines?/.test(relative):\n dateFrom = dateFrom.add(total, 'w');\n dateTo = dateTo.add(modifierFactor, 'w');\n startOf = 'week';\n break;\n case /mois?/.test(relative):\n dateFrom = dateFrom.add(total, 'M');\n dateTo = dateTo.add(modifierFactor, 'M');\n startOf = 'month';\n break;\n case /trimestres?/.test(relative):\n dateFrom = dateFrom.add(total, 'Q');\n dateTo = dateTo.add(modifierFactor, 'Q');\n startOf = 'quarter';\n break;\n case /années?/.test(relative):\n dateFrom = dateFrom.add(total, 'y');\n dateTo = dateTo.add(modifierFactor, 'y');\n startOf = 'year';\n break;\n }\n\n // if we go forward, switch the start and end dates\n if(modifierFactor > 0) {\n var dateTmp = dateFrom;\n dateFrom = dateTo;\n dateTo = dateTmp;\n }\n\n // Get start and end of dates\n dateFrom = dateFrom.startOf(startOf);\n dateTo = dateTo.endOf(startOf);\n if (startOf == 'week') { // Weekday in FR start on Sat?\n dateFrom = dateFrom.add(1, 'd')\n dateTo = dateTo.add(1, 'd')\n }\n \n\n // Assign results\n result.start.assign('year', dateFrom.year());\n result.start.assign('month', dateFrom.month() + 1);\n result.start.assign('day', dateFrom.date());\n result.start.assign('minute', dateFrom.minute());\n result.start.assign('second', dateFrom.second());\n result.start.assign('hour', dateFrom.hour());\n result.start.assign('millisecond', dateFrom.millisecond());\n\n result.end = result.start.clone();\n result.end.assign('year', dateTo.year());\n result.end.assign('month', dateTo.month() + 1);\n result.end.assign('day', dateTo.date());\n result.end.assign('minute', dateTo.minute());\n result.end.assign('second', dateTo.second());\n result.end.assign('hour', dateTo.hour());\n result.end.assign('millisecond', dateTo.millisecond());\n return result;\n };\n};\n","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs_plugin_quarterOfYear=n()}(this,function(){\"use strict\";var t=\"month\",n=\"quarter\";return function(r,i){var e=i.prototype;e.quarter=function(t){return this.$utils().u(t)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(t-1))};var u=e.add;e.add=function(r,i){return r=Number(r),this.$utils().p(i)===n?this.add(3*r,t):u.bind(this)(r,i)};var s=e.startOf;e.startOf=function(r,i){var e=this.$utils(),u=!!e.u(i)||i;if(e.p(r)===n){var a=this.quarter()-1;return u?this.month(3*a).startOf(t).startOf(\"day\"):this.month(3*a+2).endOf(t).endOf(\"day\")}return s.bind(this)(r,i)}}});\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar util = require('../../utils/ZH-Hant.js');\n\nvar PATTERN = new RegExp(\n '(\\\\d{2,4}|[' + Object.keys(util.NUMBER).join('') + ']{2,4})?' +\n '(?:\\\\s*)' +\n '(?:年)?' +\n '(?:[\\\\s|,|,]*)' +\n '(\\\\d{1,2}|[' + Object.keys(util.NUMBER).join('') + ']{1,2})' +\n '(?:\\\\s*)' +\n '(?:月)' +\n '(?:\\\\s*)' +\n '(\\\\d{1,2}|[' + Object.keys(util.NUMBER).join('') + ']{1,2})?' +\n '(?:\\\\s*)' +\n '(?:日|號)?'\n);\n\nvar YEAR_GROUP = 1;\nvar MONTH_GROUP = 2;\nvar DAY_GROUP = 3;\n\nexports.Parser = function ZHHantDateParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return PATTERN;\n };\n\n this.extract = function(text, ref, match, opt) {\n var startMoment = dayjs(ref);\n var result = new ParsedResult({\n text: match[0],\n index: match.index,\n ref: ref,\n });\n\n //Month\n var month = parseInt(match[MONTH_GROUP]);\n if (isNaN(month)) month = util.zhStringToNumber(match[MONTH_GROUP]);\n result.start.assign('month', month);\n\n //Day\n if (match[DAY_GROUP]) {\n var day = parseInt(match[DAY_GROUP]);\n if (isNaN(day)) day = util.zhStringToNumber(match[DAY_GROUP]);\n result.start.assign('day', day);\n } else {\n result.start.imply('day', startMoment.date());\n }\n\n //Year\n if (match[YEAR_GROUP]) {\n var year = parseInt(match[YEAR_GROUP]);\n if (isNaN(year)) year = util.zhStringToYear(match[YEAR_GROUP]);\n result.start.assign('year', year);\n } else {\n result.start.imply('year', startMoment.year());\n }\n\n result.tags.ZHHantDateParser = true;\n return result;\n };\n};\n","var Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar updateParsedComponent = require('../en/ENWeekdayParser').updateParsedComponent;\n\nvar util = require('../../utils/ZH-Hant.js');\n\nvar PATTERN = new RegExp(\n '(上|今|下|這|呢)?' +\n '(?:個)?' +\n '(?:星期|禮拜)' +\n '(' + Object.keys(util.WEEKDAY_OFFSET).join('|') + ')'\n);\n\nvar PREFIX_GROUP = 1;\nvar WEEKDAY_GROUP = 2;\n\nexports.Parser = function ZHHantWeekdayParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return PATTERN;\n };\n\n this.extract = function(text, ref, match, opt) {\n var index = match.index;\n text = match[0];\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var dayOfWeek = match[WEEKDAY_GROUP];\n var offset = util.WEEKDAY_OFFSET[dayOfWeek];\n if(offset === undefined) return null;\n\n var modifier = null;\n var prefix = match[PREFIX_GROUP];\n\n if(prefix == '上') {\n modifier = 'last';\n } else if(prefix == '下') {\n modifier = 'next';\n } else if(prefix == '今' || prefix == '這' || prefix == '呢') {\n modifier = 'this';\n }\n\n updateParsedComponent(result, ref, offset, modifier);\n result.tags['ZHHantWeekdayParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar ParsedComponents = require('../../result').ParsedComponents;\n\nvar util = require('../../utils/ZH-Hant.js');\n\nvar patternString1 = '(?:由|從|自)?' +\n '(?:' +\n '(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|' +\n '(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|' +\n '(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)' +\n '(?:[\\\\s,,]*)' +\n '(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?' +\n ')?' +\n '(?:[\\\\s,,]*)' +\n '(?:(\\\\d+|[' + Object.keys(util.NUMBER).join('') + ']+)(?:\\\\s*)(?:點|時|:|:)' +\n '(?:\\\\s*)' +\n '(\\\\d+|半|正|整|[' + Object.keys(util.NUMBER).join('') + ']+)?(?:\\\\s*)(?:分|:|:)?' +\n '(?:\\\\s*)' +\n '(\\\\d+|[' + Object.keys(util.NUMBER).join('') + ']+)?(?:\\\\s*)(?:秒)?)' +\n '(?:\\\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?';\n\nvar patternString2 = '(?:^\\\\s*(?:到|至|\\\\-|\\\\–|\\\\~|\\\\〜)\\\\s*)' +\n '(?:' +\n '(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|' +\n '(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|' +\n '(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)' +\n '(?:[\\\\s,,]*)' +\n '(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?' +\n ')?' +\n '(?:[\\\\s,,]*)' +\n '(?:(\\\\d+|[' + Object.keys(util.NUMBER).join('') + ']+)(?:\\\\s*)(?:點|時|:|:)' +\n '(?:\\\\s*)' +\n '(\\\\d+|半|正|整|[' + Object.keys(util.NUMBER).join('') + ']+)?(?:\\\\s*)(?:分|:|:)?' +\n '(?:\\\\s*)' +\n '(\\\\d+|[' + Object.keys(util.NUMBER).join('') + ']+)?(?:\\\\s*)(?:秒)?)' +\n '(?:\\\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?';\n\nvar FIRST_REG_PATTERN = new RegExp(patternString1, 'i');\nvar SECOND_REG_PATTERN = new RegExp(patternString2, 'i');\n\nvar DAY_GROUP_1 = 1;\nvar ZH_AM_PM_HOUR_GROUP_1 = 2;\nvar ZH_AM_PM_HOUR_GROUP_2 = 3;\nvar DAY_GROUP_3 = 4;\nvar ZH_AM_PM_HOUR_GROUP_3 = 5;\nvar HOUR_GROUP = 6;\nvar MINUTE_GROUP = 7;\nvar SECOND_GROUP = 8;\nvar AM_PM_HOUR_GROUP = 9;\n\nexports.Parser = function ZHHantTimeExpressionParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return FIRST_REG_PATTERN;\n };\n\n this.extract = function(text, ref, match, opt) {\n\n // This pattern can be overlaped Ex. [12] AM, 1[2] AM\n if (match.index > 0 && text[match.index - 1].match(/\\w/)) return null;\n var refMoment = dayjs(ref);\n var result = new ParsedResult();\n result.ref = ref;\n result.index = match.index;\n result.text = match[0];\n result.tags.ZHTimeExpressionParser = true;\n\n var startMoment = refMoment.clone();\n\n // ----- Day\n if (match[DAY_GROUP_1]) {\n var day1 = match[DAY_GROUP_1];\n if (day1 == '明' || day1 == '聽') {\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n startMoment.add(1, 'day');\n }\n } else if (day1 == '昨' || day1 == '尋' || day1 == '琴') {\n startMoment.add(-1, 'day');\n } else if (day1 == \"前\"){\n startMoment.add(-2, 'day');\n } else if (day1 == \"大前\"){\n startMoment.add(-3, 'day');\n } else if (day1 == \"後\"){\n startMoment.add(2, 'day');\n } else if (day1 == \"大後\"){\n startMoment.add(3, 'day');\n }\n result.start.assign('day', startMoment.date());\n result.start.assign('month', startMoment.month() + 1);\n result.start.assign('year', startMoment.year());\n } else if (match[DAY_GROUP_3]) {\n var day3 = match[DAY_GROUP_3];\n if (day3 == '明' || day3 == '聽') {\n startMoment.add(1, 'day');\n } else if (day3 == '昨' || day3 == '尋' || day3 == '琴') {\n startMoment.add(-1, 'day');\n } else if (day3 == \"前\"){\n startMoment.add(-2, 'day');\n } else if (day3 == \"大前\"){\n startMoment.add(-3, 'day');\n } else if (day3 == \"後\"){\n startMoment.add(2, 'day');\n } else if (day3 == \"大後\"){\n startMoment.add(3, 'day');\n }\n result.start.assign('day', startMoment.date());\n result.start.assign('month', startMoment.month() + 1);\n result.start.assign('year', startMoment.year());\n } else {\n result.start.imply('day', startMoment.date());\n result.start.imply('month', startMoment.month() + 1);\n result.start.imply('year', startMoment.year());\n }\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if (match[SECOND_GROUP]) {\n var second = parseInt(match[SECOND_GROUP]);\n if (isNaN(second)) {\n second = util.zhStringToNumber(match[SECOND_GROUP]);\n }\n if (second >= 60) return null;\n result.start.assign('second', second);\n }\n\n hour = parseInt(match[HOUR_GROUP]);\n if (isNaN(hour)) {\n hour = util.zhStringToNumber(match[HOUR_GROUP]);\n }\n\n // ----- Minutes\n if (match[MINUTE_GROUP]) {\n if (match[MINUTE_GROUP] == '半') {\n minute = 30;\n } else if (match[MINUTE_GROUP] == '正' || match[MINUTE_GROUP] == '整') {\n minute = 0;\n } else {\n minute = parseInt(match[MINUTE_GROUP]);\n if (isNaN(minute)) {\n minute = util.zhStringToNumber(match[MINUTE_GROUP]);\n }\n }\n } else if (hour > 100) {\n minute = hour % 100;\n hour = parseInt(hour / 100);\n }\n\n if (minute >= 60) {\n return null;\n }\n\n if (hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP]) {\n if (hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if (ampm == \"a\") {\n meridiem = 0;\n if (hour == 12) hour = 0;\n }\n\n if (ampm == \"p\") {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n } else if (match[ZH_AM_PM_HOUR_GROUP_1]) {\n var zhAMPMString1 = match[ZH_AM_PM_HOUR_GROUP_1];\n var zhAMPM1 = zhAMPMString1[0];\n if (zhAMPM1 == '朝' || zhAMPM1 == '早') {\n meridiem = 0;\n if (hour == 12) hour = 0;\n } else if (zhAMPM1 == '晚') {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n } else if (match[ZH_AM_PM_HOUR_GROUP_2]) {\n var zhAMPMString2 = match[ZH_AM_PM_HOUR_GROUP_2];\n var zhAMPM2 = zhAMPMString2[0];\n if (zhAMPM2 == '上' || zhAMPM2 == '朝' || zhAMPM2 == '早' || zhAMPM2 == '凌') {\n meridiem = 0;\n if (hour == 12) hour = 0;\n } else if (zhAMPM2 == '下' || zhAMPM2 == '晏' || zhAMPM2 == '晚') {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n } else if (match[ZH_AM_PM_HOUR_GROUP_3]) {\n var zhAMPMString3 = match[ZH_AM_PM_HOUR_GROUP_3];\n var zhAMPM3 = zhAMPMString3[0];\n if (zhAMPM3 == '上' || zhAMPM3 == '朝' || zhAMPM3 == '早' || zhAMPM3 == '凌') {\n meridiem = 0;\n if (hour == 12) hour = 0;\n } else if (zhAMPM3 == '下' || zhAMPM3 == '晏' || zhAMPM3 == '晚') {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n }\n\n result.start.assign('hour', hour);\n result.start.assign('minute', minute);\n\n if (meridiem >= 0) {\n result.start.assign('meridiem', meridiem);\n } else {\n if (hour < 12) {\n result.start.imply('meridiem', 0);\n } else {\n result.start.imply('meridiem', 1);\n }\n }\n\n // ==============================================================\n // Extracting the 'to' chunk\n // ==============================================================\n\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n // Not accept number only result\n if (result.text.match(/^\\d+$/)) {\n return null;\n }\n return result;\n }\n\n var endMoment = startMoment.clone();\n result.end = new ParsedComponents(null, null);\n\n // ----- Day\n if (match[DAY_GROUP_1]) {\n var day1 = match[DAY_GROUP_1];\n if (day1 == '明' || day1 == '聽') {\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n endMoment.add(1, 'day');\n }\n } else if (day1 == '昨' || day1 == '尋' || day1 == '琴') {\n endMoment.add(-1, 'day');\n } else if (day1 == \"前\"){\n endMoment.add(-2, 'day');\n } else if (day1 == \"大前\"){\n endMoment.add(-3, 'day');\n } else if (day1 == \"後\"){\n endMoment.add(2, 'day');\n } else if (day1 == \"大後\"){\n endMoment.add(3, 'day');\n }\n result.end.assign('day', endMoment.date());\n result.end.assign('month', endMoment.month() + 1);\n result.end.assign('year', endMoment.year());\n } else if (match[DAY_GROUP_3]) {\n var day3 = match[DAY_GROUP_3];\n if (day3 == '明' || day3 == '聽') {\n endMoment.add(1, 'day');\n } else if (day3 == '昨' || day3 == '尋' || day3 == '琴') {\n endMoment.add(-1, 'day');\n } else if (day3 == \"前\"){\n endMoment.add(-2, 'day');\n } else if (day3 == \"大前\"){\n endMoment.add(-3, 'day');\n } else if (day3 == \"後\"){\n endMoment.add(2, 'day');\n } else if (day3 == \"大後\"){\n endMoment.add(3, 'day');\n }\n result.end.assign('day', endMoment.date());\n result.end.assign('month', endMoment.month() + 1);\n result.end.assign('year', endMoment.year());\n } else {\n result.end.imply('day', endMoment.date());\n result.end.imply('month', endMoment.month() + 1);\n result.end.imply('year', endMoment.year());\n }\n\n hour = 0;\n minute = 0;\n meridiem = -1;\n\n // ----- Second\n if (match[SECOND_GROUP]) {\n var second = parseInt(match[SECOND_GROUP]);\n if (isNaN(second)) {\n second = util.zhStringToNumber(match[SECOND_GROUP]);\n }\n\n if (second >= 60) return null;\n result.end.assign('second', second);\n }\n\n hour = parseInt(match[HOUR_GROUP]);\n if (isNaN(hour)) {\n hour = util.zhStringToNumber(match[HOUR_GROUP]);\n }\n\n // ----- Minutes\n if (match[MINUTE_GROUP]) {\n if (match[MINUTE_GROUP] == '半') {\n minute = 30;\n } else if (match[MINUTE_GROUP] == '正' || match[MINUTE_GROUP] == '整') {\n minute = 0;\n } else {\n minute = parseInt(match[MINUTE_GROUP]);\n if (isNaN(minute)) {\n minute = util.zhStringToNumber(match[MINUTE_GROUP]);\n }\n }\n } else if (hour > 100) {\n minute = hour % 100;\n hour = parseInt(hour / 100);\n }\n\n if (minute >= 60) {\n return null;\n }\n\n if (hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP]) {\n if (hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if (ampm == \"a\") {\n meridiem = 0;\n if (hour == 12) hour = 0;\n }\n\n if (ampm == \"p\") {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n\n if (!result.start.isCertain('meridiem')) {\n if (meridiem == 0) {\n\n result.start.imply('meridiem', 0);\n\n if (result.start.get('hour') == 12) {\n result.start.assign('hour', 0);\n }\n\n } else {\n\n result.start.imply('meridiem', 1);\n\n if (result.start.get('hour') != 12) {\n result.start.assign('hour', result.start.get('hour') + 12);\n }\n }\n }\n\n } else if (match[ZH_AM_PM_HOUR_GROUP_1]) {\n var zhAMPMString1 = match[ZH_AM_PM_HOUR_GROUP_1];\n var zhAMPM1 = zhAMPMString1[0];\n if (zhAMPM1 == '朝' || zhAMPM1 == '早') {\n meridiem = 0;\n if (hour == 12) hour = 0;\n } else if (zhAMPM1 == '晚') {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n } else if (match[ZH_AM_PM_HOUR_GROUP_2]) {\n var zhAMPMString2 = match[ZH_AM_PM_HOUR_GROUP_2];\n var zhAMPM2 = zhAMPMString2[0];\n if (zhAMPM2 == '上' || zhAMPM2 == '朝' || zhAMPM2 == '早' || zhAMPM2 == '凌') {\n meridiem = 0;\n if (hour == 12) hour = 0;\n } else if (zhAMPM2 == '下' || zhAMPM2 == '晏' || zhAMPM2 == '晚') {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n } else if (match[ZH_AM_PM_HOUR_GROUP_3]) {\n var zhAMPMString3 = match[ZH_AM_PM_HOUR_GROUP_3];\n var zhAMPM3 = zhAMPMString3[0];\n if (zhAMPM3 == '上' || zhAMPM3 == '朝' || zhAMPM3 == '早' || zhAMPM3 == '凌') {\n meridiem = 0;\n if (hour == 12) hour = 0;\n } else if (zhAMPM3 == '下' || zhAMPM3 == '晏' || zhAMPM3 == '晚') {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n }\n\n result.text = result.text + match[0];\n result.end.assign('hour', hour);\n result.end.assign('minute', minute);\n if (meridiem >= 0) {\n result.end.assign('meridiem', meridiem);\n } else {\n var startAtPM = result.start.isCertain('meridiem') && result.start.get('meridiem') == 1;\n if (startAtPM && result.start.get('hour') > hour) {\n // 10pm - 1 (am)\n result.end.imply('meridiem', 0);\n\n } else if (hour > 12) {\n result.end.imply('meridiem', 1);\n }\n }\n\n if (result.end.date().getTime() < result.start.date().getTime()) {\n result.end.imply('day', result.end.get('day') + 1)\n }\n\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp(\n '(而家|立(?:刻|即)|即刻)|' +\n '(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|' +\n '(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|' +\n '(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)' +\n '(?:[\\\\s|,|,]*)' +\n '(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?', 'i');\n\nvar NOW_GROUP = 1;\nvar DAY_GROUP_1 = 2;\nvar TIME_GROUP_1 = 3;\nvar TIME_GROUP_2 = 4;\nvar DAY_GROUP_3 = 5;\nvar TIME_GROUP_3 = 6;\n\nexports.Parser = function ZHHantCasualDateParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return PATTERN;\n };\n\n this.extract = function(text, ref, match, opt) {\n text = match[0];\n var index = match.index;\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var refMoment = dayjs(ref);\n var startMoment = refMoment;\n\n if (match[NOW_GROUP]) {\n result.start.imply('hour', refMoment.hour());\n result.start.imply('minute', refMoment.minute());\n result.start.imply('second', refMoment.second());\n result.start.imply('millisecond', refMoment.millisecond());\n } else if (match[DAY_GROUP_1]) {\n var day1 = match[DAY_GROUP_1];\n var time1 = match[TIME_GROUP_1];\n\n if (day1 == '明' || day1 == '聽') {\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n } else if (day1 == '昨' || day1 == '尋' || day1 == '琴') {\n startMoment = startMoment.add(-1, 'day');\n } else if (day1 == \"前\"){\n startMoment = startMoment.add(-2, 'day');\n } else if (day1 == \"大前\"){\n startMoment = startMoment.add(-3, 'day');\n } else if ( day1 == \"後\"){\n startMoment = startMoment.add(2, 'day');\n } else if (day1 == \"大後\"){\n startMoment = startMoment.add(3, 'day');\n }\n\n if (time1 == '早' || time1 == '朝') {\n result.start.imply('hour', 6);\n } else if (time1 == '晚') {\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n }\n\n } else if (match[TIME_GROUP_2]) {\n var timeString2 = match[TIME_GROUP_2];\n var time2 = timeString2[0];\n if (time2 == '早' || time2 == '朝' || time2 == '上') {\n result.start.imply('hour', 6);\n } else if (time2 == '下' || time2 == '晏') {\n result.start.imply('hour', 15);\n result.start.imply('meridiem', 1);\n } else if (time2 == '中') {\n result.start.imply('hour', 12);\n result.start.imply('meridiem', 1);\n } else if (time2 == '夜' || time2 == '晚') {\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n } else if (time2 == '凌') {\n result.start.imply('hour', 0);\n }\n\n } else if (match[DAY_GROUP_3]) {\n var day3 = match[DAY_GROUP_3];\n\n if (day3 == '明' || day3 == '聽') {\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n } else if (day3 == '昨' || day3 == '尋' || day3 == '琴') {\n startMoment = startMoment.add(-1, 'day');\n } else if (day3 == \"前\"){\n startMoment = startMoment.add(-2, 'day');\n } else if (day3 == \"大前\"){\n startMoment = startMoment.add(-3, 'day');\n } else if (day3 == \"後\"){\n startMoment = startMoment.add(2, 'day');\n } else if (day3 == \"大後\"){\n startMoment = startMoment.add(3, 'day');\n }\n\n\n var timeString3 = match[TIME_GROUP_3];\n if (timeString3) {\n var time3 = timeString3[0];\n if (time3 == '早' || time3 == '朝' || time3 == '上') {\n result.start.imply('hour', 6);\n } else if (time3 == '下' || time3 == '晏') {\n result.start.imply('hour', 15);\n result.start.imply('meridiem', 1);\n } else if (time3 == '中') {\n result.start.imply('hour', 12);\n result.start.imply('meridiem', 1);\n } else if (time3 == '夜' || time3 == '晚') {\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n } else if (time3 == '凌') {\n result.start.imply('hour', 0);\n }\n }\n }\n\n result.start.assign('day', startMoment.date())\n result.start.assign('month', startMoment.month() + 1)\n result.start.assign('year', startMoment.year())\n result.tags.ZHHantCasualDateParser = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar util = require('../../utils/ZH-Hant.js');\n\nvar PATTERN = new RegExp(\n '(\\\\d+|[' + Object.keys(util.NUMBER).join('') + ']+|半|幾)(?:\\\\s*)' +\n '(?:個)?' +\n '(秒(?:鐘)?|分鐘|小時|鐘|日|天|星期|禮拜|月|年)' +\n '(?:(?:之|過)?後|(?:之)?內)', 'i'\n);\n\nvar NUMBER_GROUP = 1;\nvar UNIT_GROUP = 2;\n\nexports.Parser = function ZHHantCasualDateParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return PATTERN;\n };\n\n this.extract = function(text, ref, match, opt) {\n var index = match.index;\n text = match[0];\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var number = parseInt(match[NUMBER_GROUP]);\n if (isNaN(number)){\n number = util.zhStringToNumber(match[NUMBER_GROUP]);\n }\n\n if (isNaN(number)){\n var string = match[NUMBER_GROUP];\n if (string === '幾'){\n number = 3;\n }else if(string === '半'){\n number = 0.5;\n }else{\n\n //just in case\n return null;\n }\n }\n\n var date = dayjs(ref);\n var unit = match[UNIT_GROUP];\n var unitAbbr = unit[0];\n\n if (unitAbbr.match(/[日天星禮月年]/)){\n if(unitAbbr == '日' || unitAbbr == '天'){\n date = date.add(number, 'd');\n }else if(unitAbbr == '星' || unitAbbr == '禮'){\n date = date.add(number * 7, 'd');\n }else if(unitAbbr == '月'){\n date = date.add(number, 'month');\n }else if(unitAbbr == '年'){\n date = date.add(number, 'year');\n }\n\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n return result;\n }\n\n if(unitAbbr == '秒'){\n date = date.add(number, 'second');\n }else if(unitAbbr == '分'){\n date = date.add(number, 'minute');\n }else if(unitAbbr == '小' || unitAbbr == '鐘'){\n date = date.add(number, 'hour');\n }\n\n result.start.imply('year', date.year());\n result.start.imply('month', date.month() + 1);\n result.start.imply('day', date.date());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.start.assign('second', date.second());\n result.tags.ZHHantDeadlineFormatParser = true;\n return result;\n };\n};\n","/*\n\n\n*/\n\nvar dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/DE');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(in|nach)\\\\s*' +\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|einigen|eine[rm]\\\\s*halben|eine[rm])\\\\s*' +\n '(sekunden?|min(?:ute)?n?|stunden?|tag(?:en)?|wochen?|monat(?:en)?|jahr(?:en)?)\\\\s*' +\n '(?=\\\\W|$)', 'i'\n);\n\nvar STRICT_PATTERN = new RegExp('(\\\\W|^)' +\n '(in|nach)\\\\s*' +\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|eine(?:r|m)?)\\\\s*' +\n '(sekunden?|minuten?|stunden?|tag(?:en)?)\\\\s*' +\n '(?=\\\\W|$)', 'i'\n);\n\nexports.Parser = function DEDeadlineFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return this.isStrictMode()? STRICT_PATTERN : PATTERN;\n };\n\n this.extract = function(text, ref, match, opt){\n\n var index = match.index + match[1].length;\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var num = match[3].toLowerCase();\n if (util.INTEGER_WORDS[num] !== undefined) {\n num = util.INTEGER_WORDS[num];\n } else if (num === 'einer' || num === 'einem') {\n num = 1;\n } else if (num === 'einigen') {\n num = 3;\n } else if (/halben/.test(num)) {\n num = 0.5;\n } else {\n num = parseInt(num);\n }\n\n var date = dayjs(ref);\n if (/tag|woche|monat|jahr/i.test(match[4])) {\n\n if (/tag/i.test(match[4])) {\n date = date.add(num, 'd');\n } else if (/woche/i.test(match[4])) {\n date = date.add(num * 7, 'd');\n } else if (/monat/i.test(match[4])) {\n date = date.add(num, 'month');\n } else if (/jahr/i.test(match[4])) {\n date = date.add(num, 'year');\n }\n\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n return result;\n }\n\n if (/stunde/i.test(match[4])) {\n\n date = date.add(num, 'hour');\n\n } else if (/min/i.test(match[4])) {\n\n date = date.add(num, 'minute');\n\n } else if (/sekunde/i.test(match[4])) {\n\n date = date.add(num, 'second');\n }\n\n result.start.imply('year', date.year());\n result.start.imply('month', date.month() + 1);\n result.start.imply('day', date.date());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.start.assign('second', date.second());\n result.tags['DEDeadlineFormatParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nconst parser = require('../parser');\nconst ParsedResult = require('../../result').ParsedResult;\nconst util = require('../../utils/DE');\n\nconst PATTERN = new RegExp('(\\\\W|^)' +\n '(?:am\\\\s*?)?' +\n '(?:(Sonntag|Montag|Dienstag|Mittwoch|Donnerstag|Freitag|Samstag|So|Mo|Di|Mi|Do|Fr|Sa)\\\\s*,?\\\\s*)?' +\n '(?:den\\\\s*)?' +\n '([0-9]{1,2})\\\\.' +\n '(?:\\\\s*(?:bis(?:\\\\s*(?:am|zum))?|\\\\-|\\\\–|\\\\s)\\\\s*([0-9]{1,2})\\\\.)?\\\\s*' +\n '(Jan(?:uar|\\\\.)?|Feb(?:ruar|\\\\.)?|Mär(?:z|\\\\.)?|Maerz|Mrz\\\\.?|Apr(?:il|\\\\.)?|Mai|Jun(?:i|\\\\.)?|Jul(?:i|\\\\.)?|Aug(?:ust|\\\\.)?|Sep(?:t|t\\\\.|tember|\\\\.)?|Okt(?:ober|\\\\.)?|Nov(?:ember|\\\\.)?|Dez(?:ember|\\\\.)?)' +\n '(?:' +\n ',?\\\\s*([0-9]{1,4}(?![^\\\\s]\\\\d))' +\n '(\\\\s*[vn]\\\\.?\\\\s*C(?:hr)?\\\\.?)?' +\n ')?' +\n '(?=\\\\W|$)', 'i'\n );\n\nconst WEEKDAY_GROUP = 2;\nconst DATE_GROUP = 3;\nconst DATE_TO_GROUP = 4;\nconst MONTH_NAME_GROUP = 5;\nconst YEAR_GROUP = 6;\nconst YEAR_BE_GROUP = 7;\n\nexports.Parser = function DEMonthNameLittleEndianParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n const result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n\n var day = match[DATE_GROUP];\n day = parseInt(day);\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n year = parseInt(year);\n\n if(match[YEAR_BE_GROUP]){\n if (/v/i.test(match[YEAR_BE_GROUP])) {\n // v.Chr.\n year = -year;\n }\n } else if (year < 100){\n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month);\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n // Weekday component\n if (match[WEEKDAY_GROUP]) {\n var weekday = match[WEEKDAY_GROUP];\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()]\n result.start.assign('weekday', weekday);\n }\n\n // Text can be 'range' value. Such as '12 - 13 January 2012'\n if (match[DATE_TO_GROUP]) {\n result.end = result.start.clone();\n result.end.assign('day', parseInt(match[DATE_TO_GROUP]));\n }\n\n result.tags['DEMonthNameLittleEndianParser'] = true;\n return result;\n };\n}\n","/*\n \n The parser for parsing month name and year.\n \n EX. \n - Januar\n - Januar 2012\n*/\n\nconst parser = require('../parser');\nconst ParsedResult = require('../../result').ParsedResult;\nconst util = require('../../utils/DE');\n\nconst PATTERN = new RegExp('(^|\\\\D\\\\s+|[^\\\\w\\\\s])' +\n '(Jan\\\\.?|Januar|Feb\\\\.?|Februar|Mär\\\\.?|M(?:ä|ae)rz|Mrz\\\\.?|Apr\\\\.?|April|Mai\\\\.?|Jun\\\\.?|Juni|Jul\\\\.?|Juli|Aug\\\\.?|August|Sep\\\\.?|Sept\\\\.?|September|Okt\\\\.?|Oktober|Nov\\\\.?|November|Dez\\\\.?|Dezember)' + \n '\\\\s*' +\n '(?:' +\n ',?\\\\s*(?:([0-9]{4})(\\\\s*[vn]\\\\.?\\\\s*C(?:hr)?\\\\.?)?|([0-9]{1,4})\\\\s*([vn]\\\\.?\\\\s*C(?:hr)?\\\\.?))' +\n ')?' +\n '(?=[^\\\\s\\\\w]|$)', 'i');\n\nconst MONTH_NAME_GROUP = 2;\nconst YEAR_GROUP = 3;\nconst YEAR_BE_GROUP = 4;\nconst YEAR_GROUP2 = 5;\nconst YEAR_BE_GROUP2 = 6;\n\nexports.Parser = function ENMonthNameParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n \n this.extract = function(text, ref, match, opt){\n var result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n \n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n\n var day = 1;\n\n var year = null;\n if (match[YEAR_GROUP] || match[YEAR_GROUP2]) {\n year = match[YEAR_GROUP] || match[YEAR_GROUP2];\n year = parseInt(year);\n\n if (match[YEAR_BE_GROUP] || match[YEAR_BE_GROUP2]) {\n if (/v/i.test(match[YEAR_BE_GROUP] || match[YEAR_BE_GROUP2])) {\n // v.Chr.\n year = -year;\n }\n\n } else if (year < 100){ \n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n \n year = parser.findYearClosestToRef(ref, day, month);\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n if (this.isStrictMode() && result.text.match(/^\\w+$/)) {\n return false;\n }\n\n result.tags['DEMonthNameParser'] = true;\n return result;\n }\n}\n\n","/*\n Date format with slash \"/\" (also \"-\" and \".\") between numbers\n - Tuesday 11/3/2015\n - 11/3/2015\n - 11/3\n*/\nvar dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:' +\n '(?:am\\\\s*?)?' +\n '((?:sonntag|so|montag|mo|dienstag|di|mittwoch|mi|donnerstag|do|freitag|fr|samstag|sa))' +\n '\\\\s*\\\\,?\\\\s*' +\n '(?:den\\\\s*)?' +\n ')?' +\n '([0-3]{0,1}[0-9]{1})[\\\\/\\\\.\\\\-]([0-3]{0,1}[0-9]{1})' +\n '(?:' +\n '[\\\\/\\\\.\\\\-]' +\n '([0-9]{4}\\s*\\,?\\s*|[0-9]{2}\\s*\\,?\\s*)' +\n ')?' +\n '(\\\\W|$)', 'i');\n\nvar DAYS_OFFSET = {\n 'sonntag': 0, 'so': 0,\n 'montag': 1, 'mo': 1,\n 'dienstag': 2, 'di': 2,\n 'mittwoch': 3, 'mi': 3,\n 'donnerstag': 4, 'do': 4,\n 'freitag': 5, 'fr': 5,\n 'samstag': 6, 'sa': 6\n};\n\n\nvar OPENNING_GROUP = 1;\nvar ENDING_GROUP = 6;\n\nvar WEEKDAY_GROUP = 2;\nvar DAY_GROUP = 3;\nvar MONTH_GROUP = 4;\nvar YEAR_GROUP = 5;\n\nexports.Parser = function DESlashDateFormatParser(argument) {\n Parser.apply(this, arguments);\n\n this.pattern = function () { return PATTERN; };\n this.extract = function(text, ref, match, opt){\n\n if(match[OPENNING_GROUP] == '/' || match[ENDING_GROUP] == '/') {\n // Long skip, if there is some overlapping like:\n // XX[/YY/ZZ]\n // [XX/YY/]ZZ\n match.index += match[0].length\n return;\n }\n\n var index = match.index + match[OPENNING_GROUP].length;\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length - match[ENDING_GROUP].length);\n\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n });\n\n if(text.match(/^\\d\\.\\d$/)) return;\n if(text.match(/^\\d\\.\\d{1,2}\\.\\d{1,2}$/)) return;\n\n // MM/dd -> OK\n // MM.dd -> NG\n if(!match[YEAR_GROUP] && match[0].indexOf('/') < 0) return;\n\n var year = match[YEAR_GROUP] || dayjs(ref).year() + '';\n var month = match[MONTH_GROUP];\n var day = match[DAY_GROUP];\n\n month = parseInt(month);\n day = parseInt(day);\n year = parseInt(year);\n\n if (month < 1 || month > 12) return null;\n if(day < 1 || day > 31) return null;\n\n if(year < 100){\n if (year > 50) {\n year = year + 1900;\n } else {\n year = year + 2000;\n }\n }\n\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n\n //Day of week\n if(match[WEEKDAY_GROUP]) {\n result.start.assign('weekday', DAYS_OFFSET[match[WEEKDAY_GROUP].toLowerCase()]);\n }\n\n result.tags['DESlashDateFormatParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/DE');\n\nvar PATTERN = new RegExp('' +\n '(\\\\W|^)vor\\\\s*' +\n '(' + util.INTEGER_WORDS_PATTERN + '|[0-9]+|einigen|eine[rm]\\\\s*halben|eine[rm])\\\\s*' +\n '(sekunden?|min(?:ute)?n?|stunden?|wochen?|tag(?:en)?|monat(?:en)?|jahr(?:en)?)\\\\s*' +\n '(?=(?:\\\\W|$))', 'i');\n\nvar STRICT_PATTERN = new RegExp('' +\n '(\\\\W|^)vor\\\\s*' +\n '([0-9]+|eine(?:r|m))\\\\s*' +\n '(sekunden?|minuten?|stunden?|tag(?:en)?)' +\n '(?=(?:\\\\W|$))', 'i');\n\nexports.Parser = function DETimeAgoFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return this.isStrictMode()? STRICT_PATTERN : PATTERN;\n };\n\n this.extract = function(text, ref, match, opt){\n\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n let index = match.index + match[1].length;\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var num = match[2].toLowerCase() ;\n if (util.INTEGER_WORDS[num] !== undefined) {\n num = util.INTEGER_WORDS[num];\n } else if (num === 'einer' || num === 'einem') {\n num = 1;\n } else if (num === 'einigen') {\n num = 3;\n } else if (/halben/.test(num)) {\n num = 0.5;\n } else {\n num = parseInt(num);\n }\n\n var date = dayjs(ref);\n\n if (/stunde|min|sekunde/i.test(match[3])) {\n if (/stunde/i.test(match[3])) {\n\n date = date.add(-num, 'hour');\n\n } else if (/min/i.test(match[3])) {\n\n date = date.add(-num, 'minute');\n\n } else if (/sekunde/i.test(match[3])) {\n\n date = date.add(-num, 'second');\n }\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.start.assign('second', date.second());\n result.tags['DETimeAgoFormatParser'] = true;\n return result;\n }\n\n if (/woche/i.test(match[3])) {\n date = date.add(-num, 'week');\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n result.start.imply('weekday', date.day());\n return result;\n }\n\n if (/tag/i.test(match[3])) {\n date = date.add(-num, 'd');\n }\n\n if (/monat/i.test(match[3])) {\n date = date.add(-num, 'month');\n }\n\n if (/jahr/i.test(match[3])) {\n\n date = date.add(-num, 'year');\n }\n\n result.start.assign('day', date.date());\n result.start.assign('month', date.month() + 1);\n result.start.assign('year', date.year());\n return result;\n\n };\n}\n","/*\n\n\n*/\n\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar ParsedComponents = require('../../result').ParsedComponents;\n\nvar FIRST_REG_PATTERN = new RegExp(\"(^|\\\\s|T)\" +\n \"(?:(?:um|von)\\\\s*)?\" +\n \"(\\\\d{1,4}|mittags?|mitternachts?)\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\:|\\\\:)(\\\\d{2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*uhr)?\" +\n \"(?:\\\\s*(morgens|vormittags|mittags|nachmittags|abends|nachts))?\" +\n \"(?=\\\\W|$)\", 'i');\n\n\nvar SECOND_REG_PATTERN = new RegExp(\"^\\\\s*\" +\n \"(\\\\-|\\\\–|\\\\~|\\\\〜|bis|\\\\?)\\\\s*\" +\n \"(\\\\d{1,4})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(morgens|vormittags|mittags|nachmittags|abends|nachts))?\" +\n \"(?=\\\\W|$)\", 'i');\n\nvar HOUR_GROUP = 2;\nvar MINUTE_GROUP = 3;\nvar SECOND_GROUP = 4;\nvar AM_PM_HOUR_GROUP = 5;\n\n\nexports.Parser = function DETimeExpressionParser() {\n Parser.apply(this, arguments);\n\n this.pattern = function() { return FIRST_REG_PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n // This pattern can be overlaped Ex. [12] AM, 1[2] AM\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n var refMoment = dayjs(ref);\n var result = new ParsedResult();\n result.ref = ref;\n result.index = match.index + match[1].length;\n result.text = match[0].substring(match[1].length);\n result.tags['DETimeExpressionParser'] = true;\n\n result.start.imply('day', refMoment.date());\n result.start.imply('month', refMoment.month()+1);\n result.start.imply('year', refMoment.year());\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.start.assign('second', second);\n }\n\n // ----- Hours\n if (/mittags?/i.test(match[HOUR_GROUP])) {\n meridiem = 1;\n hour = 12;\n } else if (/mitternachts?/i.test(match[HOUR_GROUP])) {\n meridiem = 0;\n hour = 0;\n } else {\n hour = parseInt(match[HOUR_GROUP]);\n }\n\n // ----- Minutes\n if(match[MINUTE_GROUP] != null){\n minute = parseInt(match[MINUTE_GROUP]);\n } else if(hour > 100) {\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP] != null) {\n if (hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP].toLowerCase();\n if (ampm === 'morgens' || ampm === 'vormittags') {\n meridiem = 0;\n if(hour == 12) hour = 0;\n } else {\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n }\n\n result.start.assign('hour', hour);\n result.start.assign('minute', minute);\n\n if (meridiem >= 0) {\n result.start.assign('meridiem', meridiem);\n } else {\n if (hour < 12) {\n result.start.imply('meridiem', 0);\n } else {\n result.start.imply('meridiem', 1);\n }\n }\n\n // ==============================================================\n // Extracting the 'to' chunk\n // ==============================================================\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n // Not accept number only result\n if (result.text.match(/^\\d+$/)) {\n return null;\n }\n return result;\n }\n\n\n\n // Pattern \"YY.YY -XXXX\" is more like timezone offset\n if (match[0].match(/^\\s*(\\+|\\-)\\s*\\d{3,4}$/)) {\n return result;\n }\n\n if(result.end == null){\n result.end = new ParsedComponents(null, result.start.date());\n }\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.end.assign('second', second);\n }\n\n hour = parseInt(match[2]);\n\n // ----- Minute\n if (match[MINUTE_GROUP]!= null) {\n\n minute = parseInt(match[MINUTE_GROUP]);\n if(minute >= 60) return result;\n\n } else if (hour > 100) {\n\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP] != null) {\n\n if (hour > 12) return null;\n\n var ampm = match[AM_PM_HOUR_GROUP].toLowerCase();\n if (ampm === 'morgens' || ampm === 'vormittags') {\n meridiem = 0;\n if(hour == 12) {\n hour = 0;\n if (!result.end.isCertain('day')) {\n result.end.imply('day', result.end.get('day') + 1);\n }\n }\n } else {\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n\n if (!result.start.isCertain('meridiem')) {\n if (meridiem == 0) {\n\n result.start.imply('meridiem', 0);\n\n if (result.start.get('hour') == 12) {\n result.start.assign('hour', 0);\n }\n\n } else {\n\n result.start.imply('meridiem', 1);\n\n if (result.start.get('hour') != 12) {\n result.start.assign('hour', result.start.get('hour') + 12);\n }\n }\n }\n }\n\n result.text = result.text + match[0];\n result.end.assign('hour', hour);\n result.end.assign('minute', minute);\n if (meridiem >= 0) {\n result.end.assign('meridiem', meridiem);\n } else {\n var startAtPM = result.start.isCertain('meridiem') && result.start.get('meridiem') == 1;\n if (startAtPM && result.start.get('hour') > hour) {\n // 10pm - 1 (am)\n result.end.imply('meridiem', 0);\n\n } else if (hour > 12) {\n result.end.imply('meridiem', 1);\n }\n }\n\n if (result.end.date().getTime() < result.start.date().getTime()) {\n result.end.imply('day', result.end.get('day') + 1)\n }\n\n return result;\n }\n}\n","/*\n\n\n*/\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar DAYS_OFFSET = {\n 'sonntag': 0, 'so': 0,\n 'montag': 1, 'mo': 1,\n 'dienstag': 2, 'di': 2,\n 'mittwoch': 3, 'mi': 3,\n 'donnerstag': 4, 'do': 4,\n 'freitag': 5, 'fr': 5,\n 'samstag': 6, 'sa': 6\n};\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:(?:\\\\,|\\\\(|\\\\()\\\\s*)?' +\n '(?:a[mn]\\\\s*?)?' +\n '(?:(diese[mn]|letzte[mn]|n(?:ä|ae)chste[mn])\\\\s*)?' +\n '(' + Object.keys(DAYS_OFFSET).join('|') + ')' +\n '(?:\\\\s*(?:\\\\,|\\\\)|\\\\)))?' +\n '(?:\\\\s*(diese|letzte|n(?:ä|ae)chste)\\\\s*woche)?' +\n '(?=\\\\W|$)', 'i');\n\nvar PREFIX_GROUP = 2;\nvar WEEKDAY_GROUP = 3;\nvar POSTFIX_GROUP = 4;\n\nexports.Parser = function DEWeekdayParser() {\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; };\n\n this.extract = function(text, ref, match, opt){\n var index = match.index + match[1].length;\n var text = match[0].substr(match[1].length, match[0].length - match[1].length);\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();\n var offset = DAYS_OFFSET[dayOfWeek];\n if(offset === undefined) return null;\n\n var startMoment = dayjs(ref);\n var prefix = match[PREFIX_GROUP];\n var postfix = match[POSTFIX_GROUP];\n\n var refOffset = startMoment.day();\n var norm = prefix || postfix;\n norm = norm || '';\n norm = norm.toLowerCase();\n if (/letzte/.test(norm)) {\n startMoment = startMoment.day(offset - 7);\n } else if (/n(?:ä|ae)chste/.test(norm)) {\n startMoment = startMoment.day(offset + 7);\n } else if (/diese/.test(norm)) {\n if ( opt.forwardDate && refOffset > offset ) {\n startMoment = startMoment.day(offset + 7);\n } else {\n startMoment = startMoment.day(offset);\n }\n } else {\n if ( opt.forwardDate && refOffset > offset ) {\n startMoment = startMoment.day(offset + 7);\n } else if (!opt.forwardDate && Math.abs(offset - 7 - refOffset) < Math.abs(offset - refOffset)) {\n startMoment = startMoment.day(offset - 7);\n } else if (!opt.forwardDate && Math.abs(offset + 7 - refOffset) < Math.abs(offset - refOffset)) {\n startMoment = startMoment.day(offset + 7);\n } else {\n startMoment = startMoment.day(offset);\n }\n }\n\n result.start.assign('weekday', offset);\n result.start.imply('day', startMoment.date());\n result.start.imply('month', startMoment.month() + 1);\n result.start.imply('year', startMoment.year());\n return result;\n }\n};\n","var dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp(\n '(\\\\W|^)(' +\n 'jetzt|' +\n '(?:heute|diesen)\\\\s*(morgen|vormittag|mittag|nachmittag|abend)|' +\n '(?:heute|diese)\\\\s*nacht|' +\n 'heute|' +\n '(?:(?:ü|ue)ber)?morgen(?:\\\\s*(morgen|vormittag|mittag|nachmittag|abend|nacht))?|' +\n '(?:vor)?gestern(?:\\\\s*(morgen|vormittag|mittag|nachmittag|abend|nacht))?|' +\n 'letzte\\\\s*nacht' +\n ')(?=\\\\W|$)', 'i');\n\nexports.Parser = function DECasualDateParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt) {\n text = match[0].substr(match[1].length);\n \n const index = match.index + match[1].length;\n const result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n const refMoment = dayjs(ref);\n const lowerText = text.toLowerCase();\n\n var startMoment = refMoment;\n\n if (/(?:heute|diese)\\s*nacht/.test(lowerText)) {\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n } else if (/^(?:ü|ue)bermorgen/.test(lowerText)) {\n startMoment = startMoment.add(refMoment.hour() > 1 ? 2 : 1, 'day');\n } else if (/^morgen/.test(lowerText)) {\n // Check not \"Tomorrow\" on late night\n if (refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n } else if (/^gestern/.test(lowerText)) {\n startMoment = startMoment.add(-1, 'day');\n } else if (/^vorgestern/.test(lowerText)) {\n startMoment = startMoment.add(-2, 'day');\n } else if (/letzte\\s*nacht/.test(lowerText)) {\n result.start.imply('hour', 0);\n if (refMoment.hour() > 6) {\n startMoment = startMoment.add(-1, 'day');\n }\n } else if (lowerText === 'jetzt') {\n result.start.imply('hour', refMoment.hour());\n result.start.imply('minute', refMoment.minute());\n result.start.imply('second', refMoment.second());\n result.start.imply('millisecond', refMoment.millisecond());\n }\n\n var secondMatch = match[3] || match[4] || match[5];\n if (secondMatch) {\n switch (secondMatch.toLowerCase()) {\n case 'morgen':\n result.start.imply('hour', 6);\n break;\n case 'vormittag':\n result.start.imply('hour', 9);\n break;\n case 'mittag':\n result.start.imply('hour', 12);\n break;\n case 'nachmittag':\n result.start.imply('hour', 15);\n result.start.imply('meridiem', 1);\n break;\n case 'abend':\n result.start.imply('hour', 18);\n result.start.imply('meridiem', 1);\n break;\n case 'nacht':\n result.start.imply('hour', 0);\n break;\n }\n }\n\n result.start.assign('day', startMoment.date())\n result.start.assign('month', startMoment.month() + 1)\n result.start.assign('year', startMoment.year())\n result.tags['DECasualDateParser'] = true;\n return result;\n }\n}\n","/*\n\n The parser for parsing month name and year.\n\n EX.\n - januari\n - januari 2012\n - januari, 2012\n*/\nvar parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/NL');\n\nvar PATTERN = new RegExp('(^|\\\\D\\\\s+|[^\\\\w\\\\s])' +\n '('+ util.MONTH_PATTERN +')' +\n '\\\\s*' +\n '(?:' +\n '[,-]?\\\\s*([0-9]{4})(\\\\s*BE|n\\.Chr\\.|v\\.Chr\\.)?' +\n ')?' +\n '(?=[^\\\\s\\\\w]|\\\\s+[^0-9]|\\\\s+$|$)', 'i');\n\nvar MONTH_NAME_GROUP = 2;\nvar YEAR_GROUP = 3;\nvar YEAR_BE_GROUP = 4;\n\nexports.Parser = function ENMonthNameParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n const result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n const day = 1;\n const monthName = match[MONTH_NAME_GROUP];\n const month = util.MONTH_OFFSET[monthName.toLowerCase()];\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n year = parseInt(year);\n\n if(match[YEAR_BE_GROUP]){\n if (match[YEAR_BE_GROUP].match(/BE/)) {\n // Buddhist Era\n year = year - 543;\n } else if (match[YEAR_BE_GROUP].match(/v\\.Chr\\./)) {\n // Before Christ\n year = -year;\n }\n\n } else if (year < 100){\n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month)\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n if (result.text.match(/^\\w{3}$/)) {\n return false;\n }\n\n result.tags['NLMonthNameParser'] = true;\n return result;\n }\n}\n","const parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/NL');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:op\\\\s*?)?' +\n '(?:'+ '(' + util.WEEKDAY_PATTERN + ')' + '\\\\s*,?\\\\s*)?' +\n '([0-9]{1,2})\\.?' +\n '(?:\\\\s*(?:tot|\\\\-|\\\\–|tot en met|t\\\\/m)\\\\s*([0-9]{1,2})\\.?)?\\\\s*' +\n '(' + util.MONTH_PATTERN + ')' +\n '(?:' +\n '(?:-|\\/|,?\\\\s*)' +\n '((?:' +\n '[1-9][0-9]{0,3}\\\\s*(?:BE|n\\.Chr\\.|v\\.Chr\\.)|' +\n '[1-2][0-9]{3}|' +\n '[5-9][0-9]' +\n ')(?![^\\\\s]\\\\d))' +\n ')?' +\n '(?=\\\\W|$)', 'i'\n );\nvar WEEKDAY_GROUP = 2;\nvar DATE_GROUP = 3;\nvar DATE_TO_GROUP = 4;\nvar MONTH_NAME_GROUP = 5;\nvar YEAR_GROUP = 6;\n\nexports.Parser = function ENMonthNameLittleEndianParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; };\n\n this.extract = function(text, ref, match, opt){\n\n var result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref\n });\n\n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n\n var day = match[DATE_GROUP];\n day = parseInt(day);\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n\n if (/BE/i.test(year)) {\n // Buddhist Era\n year = year.replace(/BE/i, '');\n year = parseInt(year) - 543;\n } else if (/v\\.Chr\\./i.test(year)){\n // Before Christ\n year = year.replace(/v\\.Chr\\./i, '');\n year = -parseInt(year);\n } else if (/n\\.Chr\\./i.test(year)){\n year = year.replace(/n\\.Chr\\./i, '');\n year = parseInt(year);\n } else {\n year = parseInt(year);\n if (year < 100){\n if (year > 50) {\n year = year + 1900;\n } else {\n year = year + 2000;\n }\n }\n }\n }\n\n if(year){\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month);\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n // Weekday component\n if (match[WEEKDAY_GROUP]) {\n var weekday = match[WEEKDAY_GROUP];\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()];\n result.start.assign('weekday', weekday);\n }\n\n // Text can be 'range' value. Such as '12 - 13 januari 2012'\n if (match[DATE_TO_GROUP]) {\n var endDate = parseInt(match[DATE_TO_GROUP]);\n result.end = result.start.clone();\n result.end.assign('day', endDate);\n }\n\n result.tags['NLMonthNameLittleEndianParser'] = true;\n return result;\n };\n};\n","/*\n Date format with slash \"/\" (also \"-\" and \".\") between numbers\n - dinsdag 11/3/2015\n - 11/3/2015\n - 11/3\n - dinsdag 11.mrt.15\n*/\nvar dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/NL');\n\nvar PATTERN = new RegExp(\n '(\\\\W|^)' +\n '(?:' +\n '(?:op\\\\s*?)?' +\n '(' + util.WEEKDAY_PATTERN + ')' +\n '\\\\s*\\\\,?\\\\s*' +\n '(?:de\\\\s*)?' +\n ')?' +\n '([0-3]{0,1}[0-9]{1})[\\\\/\\\\.\\\\-]([0-1]{0,1}[0-9]{1}|' +\n util.MONTH_PATTERN +\n ')' +\n '(?:' +\n '[\\\\/\\\\.\\\\-]' +\n '([0-9]{4}\\s*\\,?\\s*|[0-9]{2}\\s*\\,?\\s*)' +\n ')?' +\n '(\\\\W|$)', 'i');\n\nvar OPENNING_GROUP = 1;\nvar ENDING_GROUP = 6;\n\nvar WEEKDAY_GROUP = 2;\nvar DAY_GROUP = 3;\nvar MONTH_GROUP = 4;\nvar YEAR_GROUP = 5;\n\nexports.Parser = function DESlashDateFormatParser(argument) {\n Parser.apply(this, arguments);\n\n this.pattern = function () { return PATTERN; };\n this.extract = function(text, ref, match, opt){\n\n if(match[OPENNING_GROUP] == '/' || match[ENDING_GROUP] == '/') {\n // Long skip, if there is some overlapping like:\n // XX[/YY/ZZ]\n // [XX/YY/]ZZ\n match.index += match[0].length\n return;\n }\n\n var index = match.index + match[OPENNING_GROUP].length;\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length - match[ENDING_GROUP].length);\n\n\n let result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n });\n\n if(text.match(/^\\d\\.\\d$/)) return;\n if(text.match(/^\\d\\.\\d{1,2}\\.\\d{1,2}$/)) return;\n\n // MM/dd -> OK\n // MM.dd -> NG\n if(!match[YEAR_GROUP] && match[0].indexOf('/') < 0) return;\n\n let year = match[YEAR_GROUP] || dayjs(ref).year() + '';\n let month = match[MONTH_GROUP];\n let day = match[DAY_GROUP];\n\n month = parseInt(month);\n if(!month) {\n month = util.MONTH_OFFSET[match[MONTH_GROUP].trim().toLowerCase()];\n }\n day = parseInt(day);\n year = parseInt(year);\n\n if (month < 1 || month > 12) return null;\n if(day < 1 || day > 31) return null;\n\n if(year < 100){\n if (year > 50) {\n year = year + 1900;\n } else {\n year = year + 2000;\n }\n }\n\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n\n //Day of week\n if(match[WEEKDAY_GROUP]) {\n result.start.assign('weekday', util.WEEKDAY_OFFSET[match[WEEKDAY_GROUP].toLowerCase()]);\n }\n\n result.tags['NLSlashDateFormatParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar DAYS_OFFSET = {\n 'zondag': 0, 'zo': 0,\n 'maandag': 1, 'ma': 1,\n 'dinsdag': 2, 'di': 2,\n 'woensdag': 3, 'wo': 3,\n 'donderdag': 4, 'do': 4,\n 'vrijdag': 5, 'vr': 5,\n 'zaterdag': 6, 'za': 6\n};\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:(?:\\\\,|\\\\(|\\\\()\\\\s*)?' +\n '(?:on\\\\s*?)?' +\n '(?:(deze|afgelopen|vorige|volgende|komende)\\\\s*(?:week)?\\\\s*)?' +\n '(' + Object.keys(DAYS_OFFSET).join('|') + ')' +\n '(?:\\\\s*(?:\\\\,|\\\\)|\\\\)))?' +\n '(?:\\\\s*(deze|afgelopen|vorige|volgende|komende)\\\\s*week)?' +\n '(?=\\\\W|$)', 'i');\n\nvar PREFIX_GROUP = 2;\nvar WEEKDAY_GROUP = 3;\nvar POSTFIX_GROUP = 4;\n\n\nexports.updateParsedComponent = function updateParsedComponent(result, ref, offset, modifier) {\n\n var startMoment = dayjs(ref);\n var startMomentFixed = false;\n var refOffset = startMoment.day();\n\n if(modifier == 'afgelopen' || modifier == 'vorige') {\n startMoment =startMoment.day(offset - 7);\n startMomentFixed = true;\n } else if(modifier == 'volgende') {\n startMoment = startMoment.day(offset + 7);\n startMomentFixed = true;\n } else if(modifier == 'deze' || modifier == 'komende') {\n startMoment = startMoment.day(offset);\n } else {\n if (Math.abs(offset - 7 - refOffset) < Math.abs(offset - refOffset)) {\n startMoment = startMoment.day(offset - 7);\n } else if (Math.abs(offset + 7 - refOffset) < Math.abs(offset - refOffset)) {\n startMoment = startMoment.day(offset + 7);\n } else {\n startMoment = startMoment.day(offset);\n }\n }\n\n result.start.assign('weekday', offset);\n if (startMomentFixed) {\n result.start.assign('day', startMoment.date());\n result.start.assign('month', startMoment.month() + 1);\n result.start.assign('year', startMoment.year());\n } else {\n result.start.imply('day', startMoment.date());\n result.start.imply('month', startMoment.month() + 1);\n result.start.imply('year', startMoment.year());\n }\n\n return result;\n};\n\n\nexports.Parser = function NLWeekdayParser() {\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; };\n\n this.extract = function(text, ref, match, opt){\n var index = match.index + match[1].length;\n var text = match[0].substr(match[1].length, match[0].length - match[1].length);\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();\n var offset = DAYS_OFFSET[dayOfWeek];\n if(offset === undefined) {\n return null;\n }\n\n var prefix = match[PREFIX_GROUP];\n var postfix = match[POSTFIX_GROUP];\n var norm = prefix || postfix;\n norm = norm || '';\n norm = norm.toLowerCase();\n\n exports.updateParsedComponent(result, ref, offset, norm);\n result.tags['NLWeekdayParser'] = true;\n\n return result;\n }\n};\n","/*\n\n\n*/\n\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar ParsedComponents = require('../../result').ParsedComponents;\n\nvar FIRST_REG_PATTERN = new RegExp(\"(^|\\\\s|T)\" +\n \"(?:(?:om|van)\\\\s*)?\" +\n \"(\\\\d{1,4}|tussen de middag|middernachts?)\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\:|\\\\:)(\\\\d{2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*uur)?\" +\n \"(?:\\\\s*(\\'s morgens|\\'s ochtends|in de ochtend|\\'s middags|in de middag|\\'s avonds|in de avond|\\'s nachts))?\" +\n \"(?=\\\\W|$)\", 'i');\n\n\nvar SECOND_REG_PATTERN = new RegExp(\"^\\\\s*\" +\n \"(\\\\-|\\\\–|\\\\~|\\\\〜|tot|\\\\?)\\\\s*\" +\n \"(\\\\d{1,4})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(\\'s morgens|\\'s ochtends|in de ochtend|\\'s middags|in de middag|\\'s avonds|in de avond|\\'s nachts))?\" +\n \"(?=\\\\W|$)\", 'i');\n\nvar HOUR_GROUP = 2;\nvar MINUTE_GROUP = 3;\nvar SECOND_GROUP = 4;\nvar AM_PM_HOUR_GROUP = 5;\n\n\nexports.Parser = function NLTimeExpressionParser() {\n Parser.apply(this, arguments);\n\n this.pattern = function() { return FIRST_REG_PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n // This pattern can be overlaped Ex. [12] AM, 1[2] AM\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n var refMoment = dayjs(ref);\n var result = new ParsedResult();\n result.ref = ref;\n result.index = match.index + match[1].length;\n result.text = match[0].substring(match[1].length);\n result.tags['NLTimeExpressionParser'] = true;\n\n result.start.imply('day', refMoment.date());\n result.start.imply('month', refMoment.month()+1);\n result.start.imply('year', refMoment.year());\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.start.assign('second', second);\n }\n\n // ----- Hours\n if (/tussen de middag/i.test(match[HOUR_GROUP])) {\n meridiem = 1;\n hour = 12;\n } else if (/middernachts?/i.test(match[HOUR_GROUP])) {\n meridiem = 0;\n hour = 0;\n } else {\n hour = parseInt(match[HOUR_GROUP]);\n }\n\n // ----- Minutes\n if(match[MINUTE_GROUP] != null){\n minute = parseInt(match[MINUTE_GROUP]);\n } else if(hour > 100) {\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP] != null) {\n if (hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP].toLowerCase();\n if (ampm === \"'s ochtends\" || ampm === 'in de ochtend' || ampm === \"'s morgens\") {\n meridiem = 0;\n if(hour == 12) hour = 0;\n } else {\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n }\n\n result.start.assign('hour', hour);\n result.start.assign('minute', minute);\n\n if (meridiem >= 0) {\n result.start.assign('meridiem', meridiem);\n } else {\n if (hour < 12) {\n result.start.imply('meridiem', 0);\n } else {\n result.start.imply('meridiem', 1);\n }\n }\n\n // ==============================================================\n // Extracting the 'to' chunk\n // ==============================================================\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n // Not accept number only result\n if (result.text.match(/^\\d+$/)) {\n return null;\n }\n return result;\n }\n\n\n\n // Pattern \"YY.YY -XXXX\" is more like timezone offset\n if (match[0].match(/^\\s*(\\+|\\-)\\s*\\d{3,4}$/)) {\n return result;\n }\n\n if(result.end == null){\n result.end = new ParsedComponents(null, result.start.date());\n }\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.end.assign('second', second);\n }\n\n hour = parseInt(match[2]);\n\n // ----- Minute\n if (match[MINUTE_GROUP]!= null) {\n\n minute = parseInt(match[MINUTE_GROUP]);\n if(minute >= 60) return result;\n\n } else if (hour > 100) {\n\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP] != null) {\n\n if (hour > 12) return null;\n\n var ampm = match[AM_PM_HOUR_GROUP].toLowerCase();\n if (ampm === '\\'s ochtends' || ampm === 'in de ochtend' || ampm === '\\'s morgens') {\n meridiem = 0;\n if(hour == 12) {\n hour = 0;\n if (!result.end.isCertain('day')) {\n result.end.imply('day', result.end.get('day') + 1);\n }\n }\n } else {\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n\n if (!result.start.isCertain('meridiem')) {\n if (meridiem == 0) {\n\n result.start.imply('meridiem', 0);\n\n if (result.start.get('hour') == 12) {\n result.start.assign('hour', 0);\n }\n\n } else {\n\n result.start.imply('meridiem', 1);\n\n if (result.start.get('hour') != 12) {\n result.start.assign('hour', result.start.get('hour') + 12);\n }\n }\n }\n }\n\n result.text = result.text + match[0];\n result.end.assign('hour', hour);\n result.end.assign('minute', minute);\n if (meridiem >= 0) {\n result.end.assign('meridiem', meridiem);\n } else {\n var startAtPM = result.start.isCertain('meridiem') && result.start.get('meridiem') == 1;\n if (startAtPM && result.start.get('hour') > hour) {\n // 10pm - 1 (am)\n result.end.imply('meridiem', 0);\n\n } else if (hour > 12) {\n result.end.imply('meridiem', 1);\n }\n }\n\n if (result.end.date().getTime() < result.start.date().getTime()) {\n result.end.imply('day', result.end.get('day') + 1)\n }\n\n return result;\n }\n}\n","var dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp(\n '(\\\\W|^)(' +\n 'nu|' +\n 'vroeg in de ochtend|'+\n '(?:van|deze)\\\\s*(morgen|ochtend|middag|avond)|' +\n '\\'s morgens|\\'s ochtends|tussen de middag|\\'s middags|\\'s avonds|'+\n '(?:deze|van)\\\\s*nacht|' +\n 'vandaag|' +\n '(?:over)?morgen(?:\\\\s*(ochtend|middag|avond|nacht))?|' +\n '(?:eer)?gister(?:\\\\s*(ochtend|middag|avond|nacht))?|' +\n 'afgelopen\\\\s*nacht' +\n ')(?=\\\\W|$)', 'i');\n\nexports.Parser = function DECasualDateParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt) {\n text = match[0].substr(match[1].length);\n\n const index = match.index + match[1].length;\n const result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n const refMoment = dayjs(ref);\n const lowerText = text.toLowerCase();\n\n var startMoment = refMoment;\n\n if (/(?:van|deze)\\s*nacht/.test(lowerText)) {\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n } else if (/^overmorgen/.test(lowerText)) {\n startMoment = startMoment.add(refMoment.hour() > 1 ? 2 : 1, 'day');\n } else if (/^morgen/.test(lowerText)) {\n // Check not \"Tomorrow\" on late night\n if (refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n } else if (/^gisteren/.test(lowerText)) {\n startMoment = startMoment.add(-1, 'day');\n } else if (/^eergisteren/.test(lowerText)) {\n startMoment = startMoment.add(-2, 'day');\n } else if (/afgelopen\\s*nacht/.test(lowerText)) {\n result.start.imply('hour', 0);\n if (refMoment.hour() > 6) {\n startMoment = startMoment.add(-1, 'day');\n }\n } else if (lowerText === 'nu') {\n result.start.imply('hour', refMoment.hour());\n result.start.imply('minute', refMoment.minute());\n result.start.imply('second', refMoment.second());\n result.start.imply('millisecond', refMoment.millisecond());\n }\n\n var secondMatch = match[3] || match[4] || match[5];\n if (secondMatch) {\n switch (secondMatch.toLowerCase()) {\n case 'vroeg in de ochtend':\n result.start.imply('hour', 6);\n break;\n case 'ochtend':\n case 'morgen':\n case '\\'s ochtends':\n case '\\'s morgends':\n result.start.imply('hour', 9);\n break;\n case 'tussen de middag':\n result.start.imply('hour', 12);\n break;\n case 'middag':\n case 'in de middag':\n case '\\'s middags':\n result.start.imply('hour', 15);\n result.start.imply('meridiem', 1);\n break;\n case 'avond':\n case \"'s avonds\":\n result.start.imply('hour', 18);\n result.start.imply('meridiem', 1);\n break;\n case 'nacht':\n case \"'s nachts\":\n result.start.imply('hour', 0);\n break;\n }\n }\n\n result.start.assign('day', startMoment.date());\n result.start.assign('month', startMoment.month() + 1);\n result.start.assign('year', startMoment.year());\n result.tags['NLCasualDateParser'] = true;\n return result;\n }\n}\n","var Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)((deze)?\\s*('s morgens|'s ochtends|in de ochtend|'s middags|in de middag|'s avonds|in de avond|'s nachts|ochtend|tussen de middag|middag|avond|nacht))/i;\n\nvar TIME_MATCH = 4;\n\nexports.Parser = function ENCasualTimeParser(){\n\n Parser.apply(this, arguments);\n\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n if(!match[TIME_MATCH]) TIME_MATCH = 3;\n\n switch (match[TIME_MATCH].toLowerCase()) {\n case 'middag':\n case 'in de middag':\n case '\\'s middags':\n result.start.imply('meridiem', 1);\n result.start.imply('hour', 15);\n break;\n\n case 'avond':\n case 'in de avond':\n case '\\'s avonds':\n result.start.imply('meridiem', 1);\n result.start.imply('hour', 20);\n break;\n\n case 'middernacht':\n case 'nacht':\n case '\\'s nachts':\n result.start.imply('meridiem', 0);\n result.start.imply('hour', 0);\n break;\n\n case 'ochtend':\n case '\\s morgens':\n case '\\s ochtends':\n case 'in de ochtend':\n result.start.imply('meridiem', 0);\n result.start.imply('hour', 9);\n break;\n\n case 'tussen de middag':\n result.start.imply('meridiem', 0);\n result.start.imply('hour', 12);\n break;\n }\n\n result.tags['NLCasualTimeParser'] = true;\n return result;\n };\n};\n","/*\n \n*/\nvar Refiner = require('./refiner').Refiner;\n\nexports.Refiner = function OverlapRemovalRefiner() {\n\tRefiner.call(this);\n\t\n\n\tthis.refine = function(text, results, opt) { \n\n if (results.length < 2) return results;\n \n var filteredResults = [];\n var prevResult = results[0];\n \n for (var i=1; i prevResult.text.length){\n prevResult = result;\n }\n \n } else {\n filteredResults.push(prevResult);\n prevResult = result;\n }\n }\n \n // The last one\n if (prevResult != null) {\n filteredResults.push(prevResult);\n }\n\n return filteredResults;\n }\n}","/*\n \n*/\nvar Refiner = require('./refiner').Refiner;\n\n\nvar TIMEZONE_OFFSET_PATTERN = new RegExp(\"^\\\\s*(GMT|UTC)?(\\\\+|\\\\-)(\\\\d{1,2}):?(\\\\d{2})\", 'i');\nvar TIMEZONE_OFFSET_SIGN_GROUP = 2;\nvar TIMEZONE_OFFSET_HOUR_OFFSET_GROUP = 3;\nvar TIMEZONE_OFFSET_MINUTE_OFFSET_GROUP = 4;\n\nexports.Refiner = function ExtractTimezoneOffsetRefiner() {\n Refiner.call(this);\n\n this.refine = function(text, results, opt) {\n\n results.forEach(function(result) {\n\n if (result.start.isCertain('timezoneOffset')) {\n return;\n }\n\n var match = TIMEZONE_OFFSET_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n return;\n }\n\n var hourOffset = parseInt(match[TIMEZONE_OFFSET_HOUR_OFFSET_GROUP]);\n var minuteOffset = parseInt(match[TIMEZONE_OFFSET_MINUTE_OFFSET_GROUP]);\n var timezoneOffset = hourOffset * 60 + minuteOffset;\n if (match[TIMEZONE_OFFSET_SIGN_GROUP] === '-') {\n timezoneOffset = -timezoneOffset;\n }\n\n if (result.end != null) {\n result.end.assign('timezoneOffset', timezoneOffset);\n }\n\n result.start.assign('timezoneOffset', timezoneOffset);\n result.text += match[0];\n result.tags['ExtractTimezoneOffsetRefiner'] = true;\n });\n\n return results;\n }\n}\n","/*\n\n*/\nvar Refiner = require('./refiner').Refiner;\n\n// Map ABBR -> Offset in minute\nvar TIMEZONE_NAME_PATTERN = new RegExp(\"^\\\\s*\\\\(?([A-Z]{2,4})\\\\)?(?=\\\\W|$)\", 'i');\nvar DEFAULT_TIMEZONE_ABBR_MAP = {\n \"ACDT\":630,\"ACST\":570,\"ADT\":-180,\"AEDT\":660,\"AEST\":600,\"AFT\":270,\"AKDT\":-480,\"AKST\":-540,\"ALMT\":360,\"AMST\":-180,\"AMT\":-240,\"ANAST\":720,\"ANAT\":720,\"AQTT\":300,\"ART\":-180,\"AST\":-240,\"AWDT\":540,\"AWST\":480,\"AZOST\":0,\"AZOT\":-60,\"AZST\":300,\"AZT\":240,\"BNT\":480,\"BOT\":-240,\"BRST\":-120,\"BRT\":-180,\"BST\":60,\"BTT\":360,\"CAST\":480,\"CAT\":120,\"CCT\":390,\"CDT\":-300,\"CEST\":120,\"CET\":60,\"CHADT\":825,\"CHAST\":765,\"CKT\":-600,\"CLST\":-180,\"CLT\":-240,\"COT\":-300,\"CST\":-360,\"CVT\":-60,\"CXT\":420,\"ChST\":600,\"DAVT\":420,\"EASST\":-300,\"EAST\":-360,\"EAT\":180,\"ECT\":-300,\"EDT\":-240,\"EEST\":180,\"EET\":120,\"EGST\":0,\"EGT\":-60,\"EST\":-300,\"ET\":-300,\"FJST\":780,\"FJT\":720,\"FKST\":-180,\"FKT\":-240,\"FNT\":-120,\"GALT\":-360,\"GAMT\":-540,\"GET\":240,\"GFT\":-180,\"GILT\":720,\"GMT\":0,\"GST\":240,\"GYT\":-240,\"HAA\":-180,\"HAC\":-300,\"HADT\":-540,\"HAE\":-240,\"HAP\":-420,\"HAR\":-360,\"HAST\":-600,\"HAT\":-90,\"HAY\":-480,\"HKT\":480,\"HLV\":-210,\"HNA\":-240,\"HNC\":-360,\"HNE\":-300,\"HNP\":-480,\"HNR\":-420,\"HNT\":-150,\"HNY\":-540,\"HOVT\":420,\"ICT\":420,\"IDT\":180,\"IOT\":360,\"IRDT\":270,\"IRKST\":540,\"IRKT\":540,\"IRST\":210,\"IST\":330,\"JST\":540,\"KGT\":360,\"KRAST\":480,\"KRAT\":480,\"KST\":540,\"KUYT\":240,\"LHDT\":660,\"LHST\":630,\"LINT\":840,\"MAGST\":720,\"MAGT\":720,\"MART\":-510,\"MAWT\":300,\"MDT\":-360,\"MESZ\":120,\"MEZ\":60,\"MHT\":720,\"MMT\":390,\"MSD\":240,\"MSK\":240,\"MST\":-420,\"MUT\":240,\"MVT\":300,\"MYT\":480,\"NCT\":660,\"NDT\":-90,\"NFT\":690,\"NOVST\":420,\"NOVT\":360,\"NPT\":345,\"NST\":-150,\"NUT\":-660,\"NZDT\":780,\"NZST\":720,\"OMSST\":420,\"OMST\":420,\"PDT\":-420,\"PET\":-300,\"PETST\":720,\"PETT\":720,\"PGT\":600,\"PHOT\":780,\"PHT\":480,\"PKT\":300,\"PMDT\":-120,\"PMST\":-180,\"PONT\":660,\"PST\":-480,\"PT\":-480,\"PWT\":540,\"PYST\":-180,\"PYT\":-240,\"RET\":240,\"SAMT\":240,\"SAST\":120,\"SBT\":660,\"SCT\":240,\"SGT\":480,\"SRT\":-180,\"SST\":-660,\"TAHT\":-600,\"TFT\":300,\"TJT\":300,\"TKT\":780,\"TLT\":540,\"TMT\":300,\"TVT\":720,\"ULAT\":480,\"UTC\":0,\"UYST\":-120,\"UYT\":-180,\"UZT\":300,\"VET\":-210,\"VLAST\":660,\"VLAT\":660,\"VUT\":660,\"WAST\":120,\"WAT\":60,\"WEST\":60,\"WESZ\":60,\"WET\":0,\"WEZ\":0,\"WFT\":720,\"WGST\":-120,\"WGT\":-180,\"WIB\":420,\"WIT\":540,\"WITA\":480,\"WST\":780,\"WT\":0,\"YAKST\":600,\"YAKT\":600,\"YAPT\":600,\"YEKST\":360,\"YEKT\":360\n};\n\nexports.Refiner = function ExtractTimezoneAbbrRefiner(config) {\n\tRefiner.call(this, arguments);\n\n\tthis.refine = function(text, results, opt) {\n\n\t var timezones = new Object(DEFAULT_TIMEZONE_ABBR_MAP);\n\t if (opt.timezones) {\n\t for (var name in opt.timezones) {\n timezones[name] = opt.timezones[name];\n }\n }\n\n\t\tresults.forEach(function(result) {\n\n if (!result.tags['ENTimeExpressionParser'] &&\n !result.tags['ENCasualTimeParser'] &&\n !result.tags['ZHTimeExpressionParser'] &&\n !result.tags['FRTimeExpressionParser'] &&\n !result.tags['DETimeExpressionParser']) {\n return;\n }\n\n var match = TIMEZONE_NAME_PATTERN.exec(text.substring(result.index + result.text.length));\n if (match) {\n var timezoneAbbr = match[1].toUpperCase();\n if (timezones[timezoneAbbr] === undefined) {\n return;\n }\n\n var timezoneOffset = timezones[timezoneAbbr];\n if (!result.start.isCertain('timezoneOffset')) {\n result.start.assign('timezoneOffset', timezoneOffset);\n }\n\n if (result.end != null && !result.end.isCertain('timezoneOffset')) {\n result.end.assign('timezoneOffset', timezoneOffset);\n }\n\n result.text += match[0];\n result.tags['ExtractTimezoneAbbrRefiner'] = true;\n }\n\t\t});\n\n return results;\n\t}\n};","/*\n Enforce 'forwardDate' option to on the results. When there are missing component,\n e.g. \"March 12-13 (without year)\" or \"Thursday\", the refiner will try to adjust the result\n into the future instead of the past.\n*/\nvar dayjs = require('dayjs');\nvar Refiner = require('./refiner').Refiner;\n\nexports.Refiner = function ForwardDateRefiner() {\n Refiner.call(this);\n\n this.refine = function(text, results, opt) {\n\n if (!opt['forwardDate']) {\n return results;\n }\n\n results.forEach(function(result) {\n\n var refMoment = dayjs(result.ref);\n\n if (result.start.isOnlyDayMonthComponent() && refMoment.isAfter(result.start.dayjs())\n ) {\n // Adjust year into the future\n for (var i=0; i < 3 && refMoment.isAfter(result.start.dayjs()); i++) {\n result.start.imply('year', result.start.get('year') + 1);\n\n if (result.end && !result.end.isCertain('year')) {\n result.end.imply('year', result.end.get('year') + 1);\n }\n }\n\n result.tags['ForwardDateRefiner'] = true;\n }\n\n if (result.start.isOnlyWeekdayComponent() && refMoment.isAfter(result.start.dayjs())) {\n // Adjust date to the coming week\n if (refMoment.day() > result.start.get('weekday')) {\n refMoment = refMoment.day(result.start.get('weekday') + 7);\n } else {\n refMoment = refMoment.day(result.start.get('weekday'));\n }\n\n result.start.imply('day', refMoment.date());\n result.start.imply('month', refMoment.month() + 1);\n result.start.imply('year', refMoment.year());\n result.tags['ForwardDateRefiner'] = true;\n }\n });\n\n return results;\n }\n};\n","/*\n \n*/\nvar Filter = require('./refiner').Filter;\n\nexports.Refiner = function UnlikelyFormatFilter() {\n Filter.call(this);\n \n\n this.isValid = function(text, result, opt) { \n\n if (result.text.replace(' ','').match(/^\\d*(\\.\\d*)?$/)) {\n return false;\n }\n\n return true; \n }\n}","/*\n\n*/\nvar ParsedComponents = require('../../result').ParsedComponents;\nvar Refiner = require('../refiner').Refiner;\n\n\nvar PATTERN = new RegExp(\"^\\\\s*(at|after|before|on|,|-|\\\\(|\\\\))?\\\\s*$\");\n\nfunction isMoreSpecific(prevResult, currResult) {\n var moreSpecific = false;\n\n if (prevResult.start.isCertain('year')) {\n if (!currResult.start.isCertain('year')) {\n moreSpecific = true;\n } else {\n if (prevResult.start.isCertain('month')) {\n if (!currResult.start.isCertain('month')) {\n moreSpecific = true;\n } else {\n if (prevResult.start.isCertain('day') && !currResult.start.isCertain('day')) {\n moreSpecific = true;\n }\n }\n }\n }\n }\n\n return moreSpecific;\n}\n\n\nfunction isAbleToMerge(text, prevResult, currResult) {\n var textBetween = text.substring(prevResult.index + prevResult.text.length, currResult.index);\n\n // Only accepts merge if one of them comes from casual relative date\n var includesRelativeResult = (prevResult.tags['ENRelativeDateFormatParser'] || currResult.tags['ENRelativeDateFormatParser']);\n\n // We assume they refer to the same date if all date fields are implied\n var referToSameDate = !prevResult.start.isCertain('day') && !prevResult.start.isCertain('month') && !prevResult.start.isCertain('year');\n\n // If both years are certain, that determines if they refer to the same date\n // but with one more specific than the other\n if (prevResult.start.isCertain('year') && currResult.start.isCertain('year'))\n referToSameDate = (prevResult.start.get('year') === currResult.start.get('year'));\n\n // We now test with the next level (month) if they refer to the same date\n if (prevResult.start.isCertain('month') && currResult.start.isCertain('month'))\n referToSameDate = (prevResult.start.get('month') === currResult.start.get('month')) && referToSameDate;\n\n return includesRelativeResult && textBetween.match(PATTERN) && referToSameDate;\n}\n\nfunction mergeResult(text, specificResult, nonSpecificResult){\n\n var specificDate = specificResult.start;\n var nonSpecificDate = nonSpecificResult.start;\n\n var startIndex = Math.min(specificResult.index, nonSpecificResult.index);\n var endIndex = Math.max(\n specificResult.index + specificResult.text.length,\n nonSpecificResult.index + nonSpecificResult.text.length);\n\n specificResult.index = startIndex;\n specificResult.text = text.substring(startIndex, endIndex);\n\n for (var tag in nonSpecificResult.tags) {\n specificResult.tags[tag] = true;\n }\n specificResult.tags['ENPrioritizeSpecificDateRefiner'] = true;\n return specificResult;\n}\n\nexports.Refiner = function ENPrioritizeSpecificDateRefiner() {\n Refiner.call(this);\n\n this.refine = function(text, results, opt) {\n\n if (results.length < 2) return results;\n\n var mergedResult = [];\n var currResult = null;\n var prevResult = null;\n\n for (var i = 1; i < results.length; i++) {\n\n currResult = results[i];\n prevResult = results[i-1];\n\n if (isMoreSpecific(prevResult, currResult)\n && isAbleToMerge(text, prevResult, currResult)) {\n\n prevResult = mergeResult(text, prevResult, currResult);\n currResult = null;\n i += 1;\n\n } else if (isMoreSpecific(currResult, prevResult)\n && isAbleToMerge(text, prevResult, currResult)) {\n\n prevResult = mergeResult(text, currResult, prevResult);\n currResult = null;\n i += 1;\n }\n\n mergedResult.push(prevResult);\n }\n\n if (currResult != null) {\n mergedResult.push(currResult);\n }\n\n return mergedResult;\n }\n}\n","/*\n \n*/\nvar ENMergeDateRangeRefiner = require('../en/ENMergeDateRangeRefiner').Refiner;\n\nexports.Refiner = function JPMergeDateRangeRefiner() {\n ENMergeDateRangeRefiner.call(this);\n\n this.pattern = function () { return /^\\s*(から|ー)\\s*$/i };\n}\n\n","/*\r\n \r\n*/\r\nvar Refiner = require('../refiner').Refiner;\r\n\r\nexports.Refiner = function FRMergeDateRangeRefiner() {\r\n Refiner.call(this);\r\n\r\n this.pattern = function () { return /^\\s*(à|a|\\-)\\s*$/i };\r\n\r\n this.refine = function(text, results, opt) {\r\n\r\n if (results.length < 2) return results;\r\n \r\n var mergedResult = [];\r\n var currResult = null;\r\n var prevResult = null;\r\n \r\n for (var i=1; i toResult.start.date()) {\r\n var tmp = toResult;\r\n toResult = fromResult;\r\n fromResult = tmp;\r\n }\r\n \r\n fromResult.end = toResult.start;\r\n\r\n \r\n\r\n for (var tag in toResult.tags) {\r\n fromResult.tags[tag] = true;\r\n }\r\n\r\n \r\n var startIndex = Math.min(fromResult.index, toResult.index);\r\n var endIndex = Math.max(\r\n fromResult.index + fromResult.text.length, \r\n toResult.index + toResult.text.length);\r\n \r\n fromResult.index = startIndex;\r\n fromResult.text = text.substring(startIndex, endIndex);\r\n fromResult.tags[this.constructor.name] = true;\r\n return fromResult;\r\n }\r\n};\r\n\r\n","/*\r\n \r\n*/\r\nvar ParsedComponents = require('../../result').ParsedComponents;\r\nvar Refiner = require('../refiner').Refiner;\r\nvar mergeDateTimeComponent = require('../en/ENMergeDateTimeRefiner').mergeDateTimeComponent;\r\n\r\nvar PATTERN = new RegExp(\"^\\\\s*(T|à|a|vers|de|,|-)?\\\\s*$\");\r\n\r\nfunction isDateOnly(result) {\r\n return !result.start.isCertain('hour') || result.tags['FRCasualDateParser'];\r\n}\r\n \r\nfunction isTimeOnly(result) {\r\n return !result.start.isCertain('month') && !result.start.isCertain('weekday');\r\n}\r\n\r\n\r\nfunction isAbleToMerge(text, prevResult, curResult) {\r\n var textBetween = text.substring(prevResult.index + prevResult.text.length, curResult.index);\r\n return textBetween.match(PATTERN);\r\n}\r\n\r\nfunction mergeResult(text, dateResult, timeResult){\r\n\r\n var beginDate = dateResult.start;\r\n var beginTime = timeResult.start;\r\n var beginDateTime = mergeDateTimeComponent(beginDate, beginTime);\r\n\r\n if (dateResult.end != null || timeResult.end != null) {\r\n \r\n var endDate = dateResult.end == null ? dateResult.start : dateResult.end; \r\n var endTime = timeResult.end == null ? timeResult.start : timeResult.end;\r\n var endDateTime = mergeDateTimeComponent(endDate, endTime);\r\n \r\n if (dateResult.end == null && endDateTime.date().getTime() < beginDateTime.date().getTime()) {\r\n // Ex. 9pm - 1am\r\n if (endDateTime.isCertain('day')) {\r\n endDateTime.assign('day', endDateTime.get('day') + 1);\r\n } else {\r\n endDateTime.imply('day', endDateTime.get('day') + 1);\r\n }\r\n }\r\n\r\n dateResult.end = endDateTime;\r\n }\r\n\r\n dateResult.start = beginDateTime; \r\n\r\n var startIndex = Math.min(dateResult.index, timeResult.index);\r\n var endIndex = Math.max(\r\n dateResult.index + dateResult.text.length, \r\n timeResult.index + timeResult.text.length);\r\n \r\n dateResult.index = startIndex;\r\n dateResult.text = text.substring(startIndex, endIndex);\r\n\r\n for (var tag in timeResult.tags) {\r\n dateResult.tags[tag] = true;\r\n }\r\n dateResult.tags['FRMergeDateAndTimeRefiner'] = true;\r\n return dateResult;\r\n}\r\n\r\nexports.Refiner = function FRMergeDateTimeRefiner() {\r\n Refiner.call(this);\r\n\r\n\r\n this.refine = function(text, results, opt) { \r\n\r\n if (results.length < 2) return results;\r\n\r\n var mergedResult = [];\r\n var currResult = null;\r\n var prevResult = null;\r\n\r\n for (var i = 1; i < results.length; i++) {\r\n\r\n currResult = results[i];\r\n prevResult = results[i-1];\r\n \r\n if (isDateOnly(prevResult) && isTimeOnly(currResult) \r\n && isAbleToMerge(text, prevResult, currResult)) {\r\n \r\n prevResult = mergeResult(text, prevResult, currResult);\r\n currResult = null;\r\n i += 1;\r\n \r\n } else if (isDateOnly(currResult) && isTimeOnly(prevResult)\r\n && isAbleToMerge(text, prevResult, currResult)) {\r\n \r\n prevResult = mergeResult(text, currResult, prevResult);\r\n currResult = null;\r\n i += 1;\r\n }\r\n \r\n mergedResult.push(prevResult);\r\n }\r\n\r\n if (currResult != null) {\r\n mergedResult.push(currResult);\r\n }\r\n\r\n return mergedResult;\r\n }\r\n}","/*\n \n*/\nvar ENMergeDateRangeRefiner = require('../en/ENMergeDateRangeRefiner').Refiner;\n\nexports.Refiner = function DEMergeDateRangeRefiner() {\n ENMergeDateRangeRefiner.call(this);\n\n this.pattern = function () {\n return /^\\s*(bis(?:\\s*(?:am|zum))?|\\-)\\s*$/i\n };\n};\n","/*\n \n*/\nvar ParsedComponents = require('../../result').ParsedComponents;\nvar Refiner = require('../refiner').Refiner;\n\nvar mergeDateTimeComponent = require('../en/ENMergeDateTimeRefiner').mergeDateTimeComponent;\nvar isDateOnly = require('../en/ENMergeDateTimeRefiner').isDateOnly;\nvar isTimeOnly = require('../en/ENMergeDateTimeRefiner').isTimeOnly;\n\nvar PATTERN = new RegExp(\"^\\\\s*(T|um|am|,|-)?\\\\s*$\");\n\nfunction isAbleToMerge(text, prevResult, curResult) {\n var textBetween = text.substring(prevResult.index + prevResult.text.length, curResult.index);\n return textBetween.match(PATTERN);\n}\n\nfunction mergeResult(text, dateResult, timeResult){\n\n var beginDate = dateResult.start;\n var beginTime = timeResult.start; \n var beginDateTime = mergeDateTimeComponent(beginDate, beginTime);\n\n if (dateResult.end != null || timeResult.end != null) {\n \n var endDate = dateResult.end == null ? dateResult.start : dateResult.end; \n var endTime = timeResult.end == null ? timeResult.start : timeResult.end;\n var endDateTime = mergeDateTimeComponent(endDate, endTime);\n \n if (dateResult.end == null && endDateTime.date().getTime() < beginDateTime.date().getTime()) {\n // Ex. 9pm - 1am\n if (endDateTime.isCertain('day')) {\n endDateTime.assign('day', endDateTime.get('day') + 1);\n } else {\n endDateTime.imply('day', endDateTime.get('day') + 1);\n }\n }\n\n dateResult.end = endDateTime;\n }\n\n dateResult.start = beginDateTime; \n\n var startIndex = Math.min(dateResult.index, timeResult.index);\n var endIndex = Math.max(\n dateResult.index + dateResult.text.length, \n timeResult.index + timeResult.text.length);\n \n dateResult.index = startIndex;\n dateResult.text = text.substring(startIndex, endIndex);\n\n for (var tag in timeResult.tags) {\n dateResult.tags[tag] = true;\n }\n dateResult.tags['DEMergeDateAndTimeRefiner'] = true;\n return dateResult;\n}\n\nexports.Refiner = function DEMergeDateTimeRefiner() {\n Refiner.call(this);\n\n\n this.refine = function(text, results, opt) { \n\n if (results.length < 2) return results;\n\n var mergedResult = [];\n var currResult = null;\n var prevResult = null;\n\n for (var i = 1; i < results.length; i++) {\n\n currResult = results[i];\n prevResult = results[i-1];\n \n if (isDateOnly(prevResult) && isTimeOnly(currResult) \n && isAbleToMerge(text, prevResult, currResult)) {\n \n prevResult = mergeResult(text, prevResult, currResult);\n currResult = null;\n i += 1;\n \n } else if (isDateOnly(currResult) && isTimeOnly(prevResult)\n && isAbleToMerge(text, prevResult, currResult)) {\n \n prevResult = mergeResult(text, currResult, prevResult);\n currResult = null;\n i += 1;\n }\n \n mergedResult.push(prevResult);\n }\n\n if (currResult != null) {\n mergedResult.push(currResult);\n }\n\n return mergedResult;\n }\n}","/*\n\n*/\nvar ENMergeDateRangeRefiner = require('../en/ENMergeDateRangeRefiner').Refiner;\n\nexports.Refiner = function NLMergeDateRangeRefiner() {\n ENMergeDateRangeRefiner.call(this);\n\n this.pattern = function () {\n return /^\\s*(tot|t\\/m|tot en met|\\\\-)\\s*$/i;\n };\n};\n","/*\n\n*/\nvar ParsedComponents = require('../../result').ParsedComponents;\nvar Refiner = require('../refiner').Refiner;\n\nvar mergeDateTimeComponent = require('../en/ENMergeDateTimeRefiner').mergeDateTimeComponent;\nvar isDateOnly = require('../en/ENMergeDateTimeRefiner').isDateOnly;\nvar isTimeOnly = require('../en/ENMergeDateTimeRefiner').isTimeOnly;\n\nvar PATTERN = new RegExp(\"^\\\\s*(T|op|om|voor|na|van|,|-)\\\\s*$\");\n\nfunction isAbleToMerge(text, prevResult, curResult) {\n var textBetween = text.substring(prevResult.index + prevResult.text.length, curResult.index);\n return textBetween.match(PATTERN);\n}\n\nfunction mergeResult(text, dateResult, timeResult){\n\n var beginDate = dateResult.start;\n var beginTime = timeResult.start;\n var beginDateTime = mergeDateTimeComponent(beginDate, beginTime);\n\n if (dateResult.end != null || timeResult.end != null) {\n\n var endDate = dateResult.end == null ? dateResult.start : dateResult.end;\n var endTime = timeResult.end == null ? timeResult.start : timeResult.end;\n var endDateTime = mergeDateTimeComponent(endDate, endTime);\n\n if (dateResult.end == null && endDateTime.date().getTime() < beginDateTime.date().getTime()) {\n // Ex. 9pm - 1am\n if (endDateTime.isCertain('day')) {\n endDateTime.assign('day', endDateTime.get('day') + 1);\n } else {\n endDateTime.imply('day', endDateTime.get('day') + 1);\n }\n }\n\n dateResult.end = endDateTime;\n }\n\n dateResult.start = beginDateTime;\n\n var startIndex = Math.min(dateResult.index, timeResult.index);\n var endIndex = Math.max(\n dateResult.index + dateResult.text.length,\n timeResult.index + timeResult.text.length);\n\n dateResult.index = startIndex;\n dateResult.text = text.substring(startIndex, endIndex);\n\n for (var tag in timeResult.tags) {\n dateResult.tags[tag] = true;\n }\n dateResult.tags['NLMergeDateAndTimeRefiner'] = true;\n return dateResult;\n}\n\nexports.Refiner = function NLMergeDateTimeRefiner() {\n Refiner.call(this);\n\n\n this.refine = function(text, results, opt) {\n\n if (results.length < 2) return results;\n\n var mergedResult = [];\n var currResult = null;\n var prevResult = null;\n\n for (var i = 1; i < results.length; i++) {\n\n currResult = results[i];\n prevResult = results[i-1];\n if (isDateOnly(currResult) && isTimeOnly(prevResult)\n && isAbleToMerge(text, prevResult, currResult)) {\n\n prevResult = mergeResult(text, currResult, prevResult);\n currResult = null;\n i += 1;\n mergedResult.push(prevResult);\n } else {\n mergedResult.push(prevResult);\n }\n\n }\n\n if (currResult != null) {\n mergedResult.push(currResult);\n }\n\n return mergedResult;\n }\n}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://chrono/webpack/universalModuleDefinition","webpack://chrono/webpack/bootstrap","webpack://chrono/./src/result.js","webpack://chrono/./src/parsers/parser.js","webpack://chrono/./node_modules/dayjs/dayjs.min.js","webpack://chrono/./src/refiners/refiner.js","webpack://chrono/./src/utils/EN.js","webpack://chrono/./src/refiners/en/ENMergeDateTimeRefiner.js","webpack://chrono/./src/parsers/en/ENWeekdayParser.js","webpack://chrono/./src/utils/ZH-Hant.js","webpack://chrono/./src/utils/DE.js","webpack://chrono/./src/refiners/en/ENMergeDateRangeRefiner.js","webpack://chrono/./src/utils/FR.js","webpack://chrono/./src/utils/NL.js","webpack://chrono/./src/chrono.js","webpack://chrono/./src/options.js","webpack://chrono/./src/parsers/en/ENISOFormatParser.js","webpack://chrono/./src/parsers/en/ENDeadlineFormatParser.js","webpack://chrono/./src/parsers/en/ENRelativeDateFormatParser.js","webpack://chrono/./src/parsers/en/ENMonthNameLittleEndianParser.js","webpack://chrono/./src/parsers/en/ENMonthNameMiddleEndianParser.js","webpack://chrono/./src/parsers/en/ENMonthNameParser.js","webpack://chrono/./src/parsers/en/ENSlashDateFormatParser.js","webpack://chrono/./src/parsers/en/ENSlashDateFormatStartWithYearParser.js","webpack://chrono/./src/parsers/en/ENSlashMonthFormatParser.js","webpack://chrono/./src/parsers/en/ENTimeAgoFormatParser.js","webpack://chrono/./src/parsers/en/ENTimeExpressionParser.js","webpack://chrono/./src/parsers/en/ENTimeLaterFormatParser.js","webpack://chrono/./src/parsers/en/ENCasualDateParser.js","webpack://chrono/./src/parsers/en/ENCasualTimeParser.js","webpack://chrono/./src/parsers/ja/JPStandardParser.js","webpack://chrono/./src/utils/JP.js","webpack://chrono/./src/parsers/ja/JPCasualDateParser.js","webpack://chrono/./src/parsers/pt/PTCasualDateParser.js","webpack://chrono/./src/parsers/pt/PTDeadlineFormatParser.js","webpack://chrono/./src/parsers/pt/PTMonthNameLittleEndianParser.js","webpack://chrono/./src/utils/PT.js","webpack://chrono/./src/parsers/pt/PTSlashDateFormatParser.js","webpack://chrono/./src/parsers/pt/PTTimeAgoFormatParser.js","webpack://chrono/./src/parsers/pt/PTTimeExpressionParser.js","webpack://chrono/./src/parsers/pt/PTWeekdayParser.js","webpack://chrono/./src/parsers/es/ESCasualDateParser.js","webpack://chrono/./src/parsers/es/ESDeadlineFormatParser.js","webpack://chrono/./src/parsers/es/ESTimeAgoFormatParser.js","webpack://chrono/./src/parsers/es/ESTimeExpressionParser.js","webpack://chrono/./src/parsers/es/ESWeekdayParser.js","webpack://chrono/./src/parsers/es/ESMonthNameLittleEndianParser.js","webpack://chrono/./src/utils/ES.js","webpack://chrono/./src/parsers/es/ESSlashDateFormatParser.js","webpack://chrono/./src/parsers/fr/FRCasualDateParser.js","webpack://chrono/./src/parsers/fr/FRDeadlineFormatParser.js","webpack://chrono/./src/parsers/fr/FRMonthNameLittleEndianParser.js","webpack://chrono/./src/parsers/fr/FRSlashDateFormatParser.js","webpack://chrono/./src/parsers/fr/FRTimeAgoFormatParser.js","webpack://chrono/./src/parsers/fr/FRTimeExpressionParser.js","webpack://chrono/./src/parsers/fr/FRWeekdayParser.js","webpack://chrono/./src/parsers/fr/FRRelativeDateFormatParser.js","webpack://chrono/./node_modules/dayjs/plugin/quarterOfYear.js","webpack://chrono/./src/parsers/zh-Hant/ZHHantDateParser.js","webpack://chrono/./src/parsers/zh-Hant/ZHHantWeekdayParser.js","webpack://chrono/./src/parsers/zh-Hant/ZHHantTimeExpressionParser.js","webpack://chrono/./src/parsers/zh-Hant/ZHHantCasualDateParser.js","webpack://chrono/./src/parsers/zh-Hant/ZHHantDeadlineFormatParser.js","webpack://chrono/./src/parsers/de/DEDeadlineFormatParser.js","webpack://chrono/./src/parsers/de/DEMonthNameLittleEndianParser.js","webpack://chrono/./src/parsers/de/DEMonthNameParser.js","webpack://chrono/./src/parsers/de/DESlashDateFormatParser.js","webpack://chrono/./src/parsers/de/DETimeAgoFormatParser.js","webpack://chrono/./src/parsers/de/DETimeExpressionParser.js","webpack://chrono/./src/parsers/de/DEWeekdayParser.js","webpack://chrono/./src/parsers/de/DECasualDateParser.js","webpack://chrono/./src/parsers/nl/NLMonthNameParser.js","webpack://chrono/./src/parsers/nl/NLMonthNameLittleEndianParser.js","webpack://chrono/./src/parsers/nl/NLSlashDateFormatParser.js","webpack://chrono/./src/parsers/nl/NLWeekdayParser.js","webpack://chrono/./src/parsers/nl/NLTimeExpressionParser.js","webpack://chrono/./src/parsers/nl/NLCasualDateParser.js","webpack://chrono/./src/parsers/nl/NLCasualTimeParser.js","webpack://chrono/./src/refiners/OverlapRemovalRefiner.js","webpack://chrono/./src/refiners/ExtractTimezoneOffsetRefiner.js","webpack://chrono/./src/refiners/ExtractTimezoneAbbrRefiner.js","webpack://chrono/./src/refiners/ForwardDateRefiner.js","webpack://chrono/./src/refiners/UnlikelyFormatFilter.js","webpack://chrono/./src/refiners/en/ENPrioritizeSpecificDateRefiner.js","webpack://chrono/./src/refiners/ja/JPMergeDateRangeRefiner.js","webpack://chrono/./src/refiners/fr/FRMergeDateRangeRefiner.js","webpack://chrono/./src/refiners/fr/FRMergeDateTimeRefiner.js","webpack://chrono/./src/refiners/de/DEMergeDateRangeRefiner.js","webpack://chrono/./src/refiners/de/DEMergeDateTimeRefiner.js","webpack://chrono/./src/refiners/nl/NLMergeDateRangeRefiner.js","webpack://chrono/./src/refiners/nl/NLMergeDateTimeRefiner.js"],"names":["dayjs","require","ParsedResult","result","ref","index","text","tags","start","ParsedComponents","end","prototype","clone","JSON","parse","stringify","date","hasPossibleDates","isPossibleDate","isOnlyWeekday","isOnlyWeekdayComponent","isOnlyDayMonth","isOnlyDayMonthComponent","components","knownValues","impliedValues","key","imply","month","year","component","get","value","assign","isCertain","dateMoment","adjustTimezoneOffset","utcOffset","add","toDate","hour","minute","second","millisecond","currentTimezoneOffset","targetTimezoneOffset","undefined","moment","exports","Parser","config","strictMode","strict","isStrictMode","pattern","extract","match","opt","execute","results","regex","remainingText","exec","length","substring","push","refiners","forEach","refiner","refine","options","findYearClosestToRef","day","refMoment","nextYear","lastYear","Math","abs","diff","ENISOFormatParser","ENDeadlineFormatParser","ENRelativeDateFormatParser","ENMonthNameLittleEndianParser","ENMonthNameMiddleEndianParser","ENMonthNameParser","ENSlashDateFormatParser","ENSlashDateFormatStartWithYearParser","ENSlashMonthFormatParser","ENTimeAgoFormatParser","ENTimeExpressionParser","ENTimeLaterFormatParser","ENWeekdayParser","ENCasualDateParser","ENCasualTimeParser","JPStandardParser","JPCasualDateParser","PTCasualDateParser","PTDeadlineFormatParser","PTMonthNameLittleEndianParser","PTSlashDateFormatParser","PTTimeAgoFormatParser","PTTimeExpressionParser","PTWeekdayParser","ESCasualDateParser","ESDeadlineFormatParser","ESTimeAgoFormatParser","ESTimeExpressionParser","ESWeekdayParser","ESMonthNameLittleEndianParser","ESSlashDateFormatParser","FRCasualDateParser","FRDeadlineFormatParser","FRMonthNameLittleEndianParser","FRSlashDateFormatParser","FRTimeAgoFormatParser","FRTimeExpressionParser","FRWeekdayParser","FRRelativeDateFormatParser","ZHHantDateParser","ZHHantWeekdayParser","ZHHantTimeExpressionParser","ZHHantCasualDateParser","ZHHantDeadlineFormatParser","DEDeadlineFormatParser","DEMonthNameLittleEndianParser","DEMonthNameParser","DESlashDateFormatParser","DETimeAgoFormatParser","DETimeExpressionParser","DEWeekdayParser","DECasualDateParser","NLMonthNameParser","NLMonthNameLittleEndianParser","NLSlashDateFormatParser","NLWeekdayParser","NLTimeExpressionParser","NLCasualDateParser","NLCasualTimeParser","Refiner","Filter","call","isValid","filteredResult","i","OverlapRemovalRefiner","ExtractTimezoneOffsetRefiner","ExtractTimezoneAbbrRefiner","ForwardDateRefiner","UnlikelyFormatFilter","ENMergeDateTimeRefiner","ENMergeDateRangeRefiner","ENPrioritizeSpecificDateRefiner","JPMergeDateRangeRefiner","FRMergeDateRangeRefiner","FRMergeDateTimeRefiner","DEMergeDateRangeRefiner","DEMergeDateTimeRefiner","NLMergeDateRangeRefiner","NLMergeDateTimeRefiner","WEEKDAY_OFFSET","MONTH_OFFSET","MONTH_PATTERN","Object","keys","join","replace","INTEGER_WORDS","INTEGER_WORDS_PATTERN","ORDINAL_WORDS","ORDINAL_WORDS_PATTERN","TIME_UNIT","TIME_UNIT_STRICT","PATTERN_TIME_UNIT","RegExp","TIME_UNIT_PATTERN","TIME_UNIT_STRICT_PATTERN","extractDateTimeUnitFragments","timeunitText","fragments","collectDateTimeFragment","num","toLowerCase","parseFloat","PATTERN","isDateOnly","isTimeOnly","isAbleToMerge","prevResult","curResult","textBetween","mergeDateTimeComponent","dateComponent","timeComponent","dateTimeComponent","mergeResult","dateResult","timeResult","beginDate","beginTime","beginDateTime","endDate","endTime","endDateTime","getTime","startIndex","min","endIndex","max","tag","mergedResult","currResult","DAYS_OFFSET","PREFIX_GROUP","WEEKDAY_GROUP","POSTFIX_GROUP","updateParsedComponent","offset","modifier","startMoment","startMomentFixed","refOffset","apply","arguments","substr","dayOfWeek","prefix","postfix","norm","NUMBER","zhStringToNumber","number","char","zhStringToYear","string","parseInt","result1","result2","begin","fromResult","toResult","timeKeys","fromMoment","toMoment","isBefore","isAfter","tmp","constructor","name","WEEKDAY_PATTERN","parser","Chrono","option","casualOption","parsers","refDate","Date","forwardDate","allResults","concat","sort","a","b","parseDate","strictOption","casual","en","mergeOptions","commonPostProcessing","en_GB","de","nl","pt","es","fr","ja","addedTypes","mergedOption","p","r","strictConfig","zh","unshift","littleEndian","YEAR_NUMBER_GROUP","MONTH_NUMBER_GROUP","DATE_NUMBER_GROUP","HOUR_NUMBER_GROUP","MINUTE_NUMBER_GROUP","SECOND_NUMBER_GROUP","MILLISECOND_NUMBER_GROUP","TZD_HOUR_OFFSET_GROUP","TZD_MINUTE_OFFSET_GROUP","minuteOffset","hourOffset","util","STRICT_PATTERN","MODIFIER_WORD_GROUP","MULTIPLIER_WORD_GROUP","RELATIVE_WORD_GROUP","DATE_GROUP","DATE_NUM_GROUP","DATE_TO_GROUP","DATE_TO_NUM_GROUP","MONTH_NAME_GROUP","YEAR_GROUP","trim","test","weekday","YEAR_BE_GROUP","YEAR_GROUP2","YEAR_BE_GROUP2","yearBE","monthName","OPENNING_GROUP","ENDING_GROUP","FIRST_NUMBERS_GROUP","SECOND_NUMBERS_GROUP","MONTH_GROUP","DAY_GROUP","indexOf","tday","argument","FIRST_REG_PATTERN","SECOND_REG_PATTERN","HOUR_GROUP","MINUTE_GROUP","SECOND_GROUP","MILLI_SECOND_GROUP","AM_PM_HOUR_GROUP","meridiem","ampm","startAtPM","suffix","preamble","lowerText","TIME_MATCH","SPECIAL_YEAR_GROUP","TYPICAL_YEAR_GROUP","ERA_GROUP","toHankaku","String","fromCharCode","alphaNum","token","charCodeAt","toZenkaku","secondMatch","firstMatch","isNaN","quarterOfYear","extend","MULTIPLIER_GROUP","MODIFIER_1_GROUP","MODIFIER_2_GROUP","multiplier","modifierFactor","total","dateFrom","dateTo","relative","startOf","dateTmp","endOf","patternString1","patternString2","DAY_GROUP_1","ZH_AM_PM_HOUR_GROUP_1","ZH_AM_PM_HOUR_GROUP_2","DAY_GROUP_3","ZH_AM_PM_HOUR_GROUP_3","ZHTimeExpressionParser","day1","day3","zhAMPMString1","zhAMPM1","zhAMPMString2","zhAMPM2","zhAMPMString3","zhAMPM3","endMoment","NOW_GROUP","TIME_GROUP_1","TIME_GROUP_2","TIME_GROUP_3","time1","timeString2","time2","timeString3","time3","NUMBER_GROUP","UNIT_GROUP","unit","unitAbbr","filteredResults","TIMEZONE_OFFSET_PATTERN","TIMEZONE_OFFSET_SIGN_GROUP","TIMEZONE_OFFSET_HOUR_OFFSET_GROUP","TIMEZONE_OFFSET_MINUTE_OFFSET_GROUP","timezoneOffset","TIMEZONE_NAME_PATTERN","DEFAULT_TIMEZONE_ABBR_MAP","timezones","timezoneAbbr","toUpperCase","isMoreSpecific","moreSpecific","includesRelativeResult","referToSameDate","specificResult","nonSpecificResult","specificDate","nonSpecificDate","isWeekdayResult"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,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;AAEDnJ,OAAO,CAAC0F,OAAR,GAAkB,SAASoB,sBAAT,GAAkC;AAChDpB,SAAO,CAACE,IAAR,CAAa,IAAb;;AAGA,OAAKvE,MAAL,GAAc,UAAS/D,IAAT,EAAeqD,OAAf,EAAwBF,GAAxB,EAA6B;AAEvC,QAAIE,OAAO,CAACI,MAAR,GAAiB,CAArB,EAAwB,OAAOJ,OAAP;AAExB,QAAIsJ,YAAY,GAAG,EAAnB;AACA,QAAIC,UAAU,GAAG,IAAjB;AACA,QAAIvB,UAAU,GAAG,IAAjB;;AAEA,SAAK,IAAI5C,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGpF,OAAO,CAACI,MAA5B,EAAoCgF,CAAC,EAArC,EAAyC;AAErCmE,gBAAU,GAAGvJ,OAAO,CAACoF,CAAD,CAApB;AACA4C,gBAAU,GAAGhI,OAAO,CAACoF,CAAC,GAAC,CAAH,CAApB;;AACA,UAAIyC,UAAU,CAAC0B,UAAD,CAAV,IAA0BzB,UAAU,CAACE,UAAD,CAApC,IACOD,aAAa,CAACpL,IAAD,EAAOqL,UAAP,EAAmBuB,UAAnB,CADxB,EACwD;AAEpDvB,kBAAU,GAAGO,WAAW,CAAC5L,IAAD,EAAO4M,UAAP,EAAmBvB,UAAnB,CAAxB;AACAuB,kBAAU,GAAG,IAAb;AACAnE,SAAC,IAAI,CAAL;AACAkE,oBAAY,CAAChJ,IAAb,CAAkB0H,UAAlB;AACH,OAPD,MAOO;AACHsB,oBAAY,CAAChJ,IAAb,CAAkB0H,UAAlB;AACH;AAEJ;;AAED,QAAIuB,UAAU,IAAI,IAAlB,EAAwB;AACpBD,kBAAY,CAAChJ,IAAb,CAAkBiJ,UAAlB;AACH;;AAED,WAAOD,YAAP;AACH,GA9BD;AA+BH,CAnCD,C","file":"chrono.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"chrono\"] = factory();\n\telse\n\t\troot[\"chrono\"] = factory();\n})(this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 12);\n","const dayjs = require('dayjs');\n\nfunction ParsedResult(result){\n result = result || {};\n\n this.ref = result.ref;\n this.index = result.index;\n this.text = result.text;\n this.tags = result.tags || {};\n\n this.start = new ParsedComponents(result.start, result.ref)\n if(result.end){\n this.end = new ParsedComponents(result.end, result.ref)\n }\n}\n\nParsedResult.prototype.clone = function() {\n var result = new ParsedResult(this);\n result.tags = JSON.parse(JSON.stringify(this.tags));\n result.start = this.start.clone();\n if (this.end) {\n result.end = this.end.clone();\n }\n\n return result\n}\n\nParsedResult.prototype.date = function() {\n return this.start.date();\n}\n\nParsedResult.prototype.hasPossibleDates = function() {\n return this.start.isPossibleDate() && (!this.end || this.end.isPossibleDate());\n}\n\nParsedResult.prototype.isOnlyWeekday = function() {\n return this.start.isOnlyWeekdayComponent();\n}\n\nParsedResult.prototype.isOnlyDayMonth = function() {\n return this.start.isOnlyDayMonthComponent();\n}\n\nfunction ParsedComponents (components, ref){\n\n this.knownValues = {};\n this.impliedValues = {};\n\n if (components) {\n for (let key in components) {\n this.knownValues[key] = components[key];\n }\n }\n\n if (ref) {\n ref = dayjs(ref);\n this.imply('day', ref.date())\n this.imply('month', ref.month() + 1)\n this.imply('year', ref.year())\n }\n \n\n this.imply('hour', 12);\n this.imply('minute', 0);\n this.imply('second', 0);\n this.imply('millisecond', 0);\n}\n\nParsedComponents.prototype.clone = function () {\n var component = new ParsedComponents();\n component.knownValues = JSON.parse(JSON.stringify(this.knownValues));\n component.impliedValues = JSON.parse(JSON.stringify(this.impliedValues));\n return component;\n};\n\nParsedComponents.prototype.get = function(component, value) {\n if (component in this.knownValues) return this.knownValues[component];\n if (component in this.impliedValues) return this.impliedValues[component];\n};\n\nParsedComponents.prototype.assign = function(component, value) {\n this.knownValues[component] = value;\n delete this.impliedValues[component];\n};\n\nParsedComponents.prototype.imply = function(component, value) {\n if (component in this.knownValues) return;\n this.impliedValues[component] = value;\n};\n\nParsedComponents.prototype.isCertain = function(component) {\n return component in this.knownValues;\n};\n\nParsedComponents.prototype.isOnlyWeekdayComponent = function() {\n return this.isCertain('weekday') && !this.isCertain('day') && !this.isCertain('month');\n};\n\nParsedComponents.prototype.isOnlyDayMonthComponent = function() {\n return this.isCertain('day') && this.isCertain('month') && !this.isCertain('year');\n};\n\nParsedComponents.prototype.isPossibleDate = function() {\n var dateMoment = this.dayjs();\n if (this.isCertain('timezoneOffset')) {\n const adjustTimezoneOffset = this.get('timezoneOffset') - dateMoment.utcOffset();\n dateMoment = dateMoment.add(adjustTimezoneOffset, 'minutes');\n }\n\n if (dateMoment.get('year') != this.get('year')) return false;\n if (dateMoment.get('month') != this.get('month')-1) return false;\n if (dateMoment.get('date') != this.get('day')) return false;\n if (dateMoment.get('hour') != this.get('hour')) return false;\n if (dateMoment.get('minute') != this.get('minute')) return false;\n\n return true;\n};\n\nParsedComponents.prototype.date = function() {\n var result = this.dayjs();\n return result.toDate();\n};\n\n\nParsedComponents.prototype.dayjs = function() {\n var result = dayjs();\n\n result = result.year(this.get('year'));\n result = result.month(this.get('month') - 1);\n result = result.date(this.get('day'));\n result = result.hour(this.get('hour'));\n result = result.minute(this.get('minute'));\n result = result.second(this.get('second'));\n result = result.millisecond(this.get('millisecond'));\n\n // Javascript Date Object return minus timezone offset\n var currentTimezoneOffset = result.utcOffset();\n var targetTimezoneOffset = this.get('timezoneOffset') !== undefined ? \n this.get('timezoneOffset') : currentTimezoneOffset;\n\n var adjustTimezoneOffset = targetTimezoneOffset - currentTimezoneOffset;\n result = result.add(-adjustTimezoneOffset, 'minute');\n\n return result;\n};\n\nParsedComponents.prototype.moment = function() {\n // Keep for compatibility\n return this.dayjs();\n};\n\n\n\nexports.ParsedComponents = ParsedComponents;\nexports.ParsedResult = ParsedResult;\n","const dayjs = require('dayjs');\n\nexports.Parser = function (config) {\n\n config = config || {};\n var strictMode = config.strict;\n\n this.isStrictMode = function() { return (strictMode == true) };\n\n this.pattern = function() { return /./i; }\n\n this.extract = function(text, ref, match, opt){ return null; }\n\n this.execute = function(text, ref, opt) {\n\n var results = [];\n var regex = this.pattern();\n\n var remainingText = text;\n var match = regex.exec(remainingText);\n\n while (match) {\n\n // Calculate match index on the full text;\n match.index += text.length - remainingText.length;\n\n var result = this.extract(text, ref, match, opt);\n if (result) {\n\n // If success, start from the end of the result\n remainingText = text.substring(result.index + result.text.length);\n\n if (!this.isStrictMode() || result.hasPossibleDates()) {\n results.push(result);\n }\n\n } else {\n // If fail, move on by 1\n remainingText = text.substring(match.index + 1);\n }\n\n match = regex.exec(remainingText);\n }\n\n if (this.refiners) {\n this.refiners.forEach(function () {\n results = refiner.refine(results, text, options);\n });\n }\n\n return results;\n }\n}\n\nexports.findYearClosestToRef = function (ref, day, month) {\n //Find the most appropriated year\n const refMoment = dayjs(ref);\n var dateMoment = refMoment;\n dateMoment = dateMoment.month(month - 1);\n dateMoment = dateMoment.date(day);\n dateMoment = dateMoment.year(refMoment.year())\n\n const nextYear = dateMoment.add(1, 'y');\n const lastYear = dateMoment.add(-1, 'y');\n if( Math.abs(nextYear.diff(refMoment)) < Math.abs(dateMoment.diff(refMoment)) ){\n dateMoment = nextYear;\n }\n else if( Math.abs(lastYear.diff(refMoment)) < Math.abs(dateMoment.diff(refMoment)) ){\n dateMoment = lastYear;\n }\n\n return dateMoment.year();\n}\n\nexports.ENISOFormatParser = require('./en/ENISOFormatParser').Parser;\nexports.ENDeadlineFormatParser = require('./en/ENDeadlineFormatParser').Parser;\nexports.ENRelativeDateFormatParser = require('./en/ENRelativeDateFormatParser').Parser;\nexports.ENMonthNameLittleEndianParser = require('./en/ENMonthNameLittleEndianParser').Parser;\nexports.ENMonthNameMiddleEndianParser = require('./en/ENMonthNameMiddleEndianParser').Parser;\nexports.ENMonthNameParser = require('./en/ENMonthNameParser').Parser;\nexports.ENSlashDateFormatParser = require('./en/ENSlashDateFormatParser').Parser;\nexports.ENSlashDateFormatStartWithYearParser = require('./en/ENSlashDateFormatStartWithYearParser').Parser;\nexports.ENSlashMonthFormatParser = require('./en/ENSlashMonthFormatParser').Parser;\nexports.ENTimeAgoFormatParser = require('./en/ENTimeAgoFormatParser').Parser;\nexports.ENTimeExpressionParser = require('./en/ENTimeExpressionParser').Parser;\nexports.ENTimeLaterFormatParser = require('./en/ENTimeLaterFormatParser').Parser;\nexports.ENWeekdayParser = require('./en/ENWeekdayParser').Parser;\nexports.ENCasualDateParser = require('./en/ENCasualDateParser').Parser;\nexports.ENCasualTimeParser = require('./en/ENCasualTimeParser').Parser;\n\nexports.JPStandardParser = require('./ja/JPStandardParser').Parser;\nexports.JPCasualDateParser = require('./ja/JPCasualDateParser').Parser;\n\nexports.PTCasualDateParser = require('./pt/PTCasualDateParser').Parser;\nexports.PTDeadlineFormatParser = require('./pt/PTDeadlineFormatParser').Parser;\nexports.PTMonthNameLittleEndianParser = require('./pt/PTMonthNameLittleEndianParser').Parser;\nexports.PTSlashDateFormatParser = require('./pt/PTSlashDateFormatParser').Parser;\nexports.PTTimeAgoFormatParser = require('./pt/PTTimeAgoFormatParser').Parser;\nexports.PTTimeExpressionParser = require('./pt/PTTimeExpressionParser').Parser;\nexports.PTWeekdayParser = require('./pt/PTWeekdayParser').Parser;\n\nexports.ESCasualDateParser = require('./es/ESCasualDateParser').Parser;\nexports.ESDeadlineFormatParser = require('./es/ESDeadlineFormatParser').Parser;\nexports.ESTimeAgoFormatParser = require('./es/ESTimeAgoFormatParser').Parser;\nexports.ESTimeExpressionParser = require('./es/ESTimeExpressionParser').Parser;\nexports.ESWeekdayParser = require('./es/ESWeekdayParser').Parser;\nexports.ESMonthNameLittleEndianParser = require('./es/ESMonthNameLittleEndianParser').Parser;\nexports.ESSlashDateFormatParser = require('./es/ESSlashDateFormatParser').Parser;\n\nexports.FRCasualDateParser = require('./fr/FRCasualDateParser').Parser;\nexports.FRDeadlineFormatParser = require('./fr/FRDeadlineFormatParser').Parser;\nexports.FRMonthNameLittleEndianParser = require('./fr/FRMonthNameLittleEndianParser').Parser;\nexports.FRSlashDateFormatParser = require('./fr/FRSlashDateFormatParser').Parser;\nexports.FRTimeAgoFormatParser = require('./fr/FRTimeAgoFormatParser').Parser;\nexports.FRTimeExpressionParser = require('./fr/FRTimeExpressionParser').Parser;\nexports.FRWeekdayParser = require('./fr/FRWeekdayParser').Parser;\nexports.FRRelativeDateFormatParser = require('./fr/FRRelativeDateFormatParser').Parser;\n\nexports.ZHHantDateParser = require('./zh-Hant/ZHHantDateParser').Parser;\nexports.ZHHantWeekdayParser = require('./zh-Hant/ZHHantWeekdayParser').Parser;\nexports.ZHHantTimeExpressionParser = require('./zh-Hant/ZHHantTimeExpressionParser').Parser;\nexports.ZHHantCasualDateParser = require('./zh-Hant/ZHHantCasualDateParser').Parser;\nexports.ZHHantDeadlineFormatParser = require('./zh-Hant/ZHHantDeadlineFormatParser').Parser;\n\nexports.DEDeadlineFormatParser = require('./de/DEDeadlineFormatParser').Parser;\nexports.DEMonthNameLittleEndianParser = require('./de/DEMonthNameLittleEndianParser').Parser;\nexports.DEMonthNameParser = require('./de/DEMonthNameParser').Parser;\nexports.DESlashDateFormatParser = require('./de/DESlashDateFormatParser').Parser;\nexports.DETimeAgoFormatParser = require('./de/DETimeAgoFormatParser').Parser;\nexports.DETimeExpressionParser = require('./de/DETimeExpressionParser').Parser;\nexports.DEWeekdayParser = require('./de/DEWeekdayParser').Parser;\nexports.DECasualDateParser = require('./de/DECasualDateParser').Parser;\n\nexports.NLMonthNameParser = require('./nl/NLMonthNameParser').Parser;\nexports.NLMonthNameLittleEndianParser = require('./nl/NLMonthNameLittleEndianParser').Parser;\nexports.NLSlashDateFormatParser = require('./nl/NLSlashDateFormatParser').Parser;\nexports.NLWeekdayParser = require('./nl/NLWeekdayParser').Parser;\nexports.NLTimeExpressionParser = require('./nl/NLTimeExpressionParser').Parser;\nexports.NLCasualDateParser = require('./nl/NLCasualDateParser').Parser;\nexports.NLCasualTimeParser = require('./nl/NLCasualTimeParser').Parser;\n","!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):t.dayjs=e()}(this,function(){\"use strict\";var t=\"millisecond\",e=\"second\",n=\"minute\",r=\"hour\",i=\"day\",s=\"week\",u=\"month\",o=\"quarter\",a=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},d={s:c,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+c(r,2,\"0\")+\":\"+c(i,2,\"0\")},m:function(t,e){var n=12*(e.year()-t.year())+(e.month()-t.month()),r=t.clone().add(n,u),i=e-r<0,s=t.clone().add(n+(i?-1:1),u);return Number(-(n+(e-r)/(i?r-s:s-r))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:a,w:s,d:i,D:\"date\",h:r,m:n,s:e,ms:t,Q:o}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof v},M=function(t,e,n){var r;if(!t)return l;if(\"string\"==typeof t)m[t]&&(r=t),e&&(m[t]=e,r=t);else{var i=t.name;m[i]=t,r=i}return!n&&r&&(l=r),r||!n&&l},g=function(t,e){if(y(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new v(n)},D=d;D.l=M,D.i=y,D.w=function(t,e){return g(t,{locale:e.$L,utc:e.$u,$offset:e.$offset})};var v=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0),this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(D.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match(h);if(r)return n?new Date(Date.UTC(r[1],r[2]-1,r[3]||1,r[4]||0,r[5]||0,r[6]||0,r[7]||0)):new Date(r[1],r[2]-1,r[3]||1,r[4]||0,r[5]||0,r[6]||0,r[7]||0)}return new Date(e)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,e){var n=g(t);return this.startOf(e)<=n&&n<=this.endOf(e)},d.isAfter=function(t,e){return g(t) toResult.start.date().getTime()) {\n \n var fromMoment = fromResult.start.dayjs();\n var toMoment = toResult.start.dayjs();\n\n if (fromResult.isOnlyWeekday() && fromMoment.add(-7, 'days').isBefore(toMoment)) {\n fromMoment = fromMoment.add(-7, 'days');\n fromResult.start.imply('day', fromMoment.date());\n fromResult.start.imply('month', fromMoment.month() + 1);\n fromResult.start.imply('year', fromMoment.year());\n } else if (toResult.isOnlyWeekday() && toMoment.add(7, 'days').isAfter(fromMoment)) {\n toMoment = toMoment.add(7, 'days');\n toResult.start.imply('day', toMoment.date());\n toResult.start.imply('month', toMoment.month() + 1);\n toResult.start.imply('year', toMoment.year());\n } else {\n var tmp = toResult;\n toResult = fromResult;\n fromResult = tmp;\n }\n }\n \n fromResult.end = toResult.start;\n\n \n\n for (var tag in toResult.tags) {\n fromResult.tags[tag] = true;\n }\n\n \n var startIndex = Math.min(fromResult.index, toResult.index);\n var endIndex = Math.max(\n fromResult.index + fromResult.text.length, \n toResult.index + toResult.text.length);\n \n fromResult.index = startIndex;\n fromResult.text = text.substring(startIndex, endIndex);\n fromResult.tags[this.constructor.name] = true;\n return fromResult;\n }\n};\n\n","exports.WEEKDAY_OFFSET = { \r\n 'dimanche': 0, \r\n 'dim': 0, \r\n 'lundi': 1, \r\n 'lun': 1,\r\n 'mardi': 2, \r\n 'mar':2, \r\n 'mercredi': 3, \r\n 'mer': 3, \r\n 'jeudi': 4, \r\n 'jeu': 4, \r\n 'vendredi': 5, \r\n 'ven': 5,\r\n 'samedi': 6, \r\n 'sam': 6\r\n};\r\n \r\nexports.MONTH_OFFSET = { \r\n 'janvier': 1,\r\n 'jan': 1,\r\n 'jan.': 1,\r\n 'février': 2,\r\n 'fév': 2,\r\n 'fév.': 2,\r\n 'fevrier': 2,\r\n 'fev': 2,\r\n 'fev.': 2,\r\n 'mars': 3,\r\n 'mar': 3,\r\n 'mar.': 3,\r\n 'avril': 4,\r\n 'avr': 4,\r\n 'avr.': 4,\r\n 'mai': 5,\r\n 'juin': 6,\r\n 'jun': 6,\r\n 'juillet': 7,\r\n 'jul': 7,\r\n 'jul.': 7,\r\n 'août': 8,\r\n 'aout': 8,\r\n 'septembre': 9,\r\n 'sep': 9,\r\n 'sep.': 9,\r\n 'sept': 9,\r\n 'sept.': 9,\r\n 'octobre': 10,\r\n 'oct': 10,\r\n 'oct.': 10,\r\n 'novembre': 11,\r\n 'nov': 11,\r\n 'nov.': 11,\r\n 'décembre': 12,\r\n 'decembre': 12,\r\n 'dec': 12,\r\n 'dec.': 12\r\n};\r\n\r\nexports.INTEGER_WORDS_PATTERN = '(?:un|deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize)';\r\nexports.INTEGER_WORDS = {\r\n 'un' : 1,\r\n 'deux' : 2,\r\n 'trois' : 3,\r\n 'quatre' : 4,\r\n 'cinq' : 5,\r\n 'six' : 6,\r\n 'sept' : 7,\r\n 'huit' : 8,\r\n 'neuf' : 9,\r\n 'dix' : 10,\r\n 'onze' : 11,\r\n 'douze' : 12,\r\n 'treize' : 13,\r\n};\r\n","exports.WEEKDAY_OFFSET = {\n 'zondag': 0,\n 'zo': 0,\n 'zo.': 0,\n 'maandag': 1,\n 'ma': 1,\n 'ma.': 1,\n 'dinsdag': 2,\n 'di':2,\n 'di.':2,\n 'woensdag': 3,\n 'wo': 3,\n 'wo.': 3,\n 'donderdag': 4,\n 'do': 4,\n 'do.': 4,\n 'vrijdag': 5,\n 'vr': 5,\n 'vr.': 5,\n 'zaterdag': 6,\n 'za': 6,\n 'za.': 6\n};\n\nexports.WEEKDAY_PATTERN = '(?:'\n + Object.keys(exports.WEEKDAY_OFFSET).join('|').replace(/\\./g, '\\\\.')\n + ')';\n\nexports.MONTH_OFFSET = {\n 'januari': 1,\n 'jan': 1,\n 'jan.': 1,\n 'februari': 2,\n 'feb': 2,\n 'feb.': 2,\n 'maart': 3,\n 'mrt': 3,\n 'mrt.': 3,\n 'april': 4,\n 'apr': 4,\n 'apr.': 4,\n 'mei': 5,\n 'juni': 6,\n 'jun': 6,\n 'jun.': 6,\n 'juli': 7,\n 'jul': 7,\n 'jul.': 7,\n 'augustus': 8,\n 'aug': 8,\n 'aug.': 8,\n 'september': 9,\n 'sep': 9,\n 'sep.': 9,\n 'sept': 9,\n 'sept.': 9,\n 'oktober': 10,\n 'okt': 10,\n 'okt.': 10,\n 'november': 11,\n 'nov': 11,\n 'nov.': 11,\n 'december': 12,\n 'dec': 12,\n 'dec.': 12\n};\n\nexports.MONTH_PATTERN = '(?:'\n + Object.keys(exports.MONTH_OFFSET).join('|').replace(/\\./g, '\\\\.')\n + ')';\n\nexports.INTEGER_WORDS = {\n 'een' : 1,\n 'één' : 1,\n 'twee' : 2,\n 'drie' : 3,\n 'vier' : 4,\n 'vijf' : 5,\n 'zes' : 6,\n 'zeven' : 7,\n 'acht' : 8,\n 'negen' : 9,\n 'tien' : 10,\n 'elf' : 11,\n 'twaalf' : 12\n};\nexports.INTEGER_WORDS_PATTERN = '(?:'\n + Object.keys(exports.INTEGER_WORDS).join('|')\n +')';\n\nexports.ORDINAL_WORDS = {\n 'eerste' : 1,\n 'tweede': 2,\n 'derde': 3,\n 'vierde': 4,\n 'vijfde': 5,\n 'zesde': 6,\n 'zevende': 7,\n 'achste': 8,\n 'negende': 9,\n 'tiende': 10,\n 'elfde': 11,\n 'twaalfde': 12,\n 'dertiende': 13,\n 'veertiende': 14,\n 'vijftiende': 15,\n 'zestiende': 16,\n 'zeventiende': 17,\n 'achttiende': 18,\n 'negentiende': 19,\n 'twintigste': 20,\n 'eenentwintigste': 21,\n 'tweeëntwintigste': 22,\n 'drieëntwintigste': 23,\n 'vierentwintigste': 24,\n 'vijfentwintigste': 25,\n 'zesentwintigste': 26,\n 'zevenentwintigste': 27,\n 'achtentwintigste': 28,\n 'negenentwintigste': 29,\n 'dertigste': 30,\n 'eenendertigste': 31\n};\nexports.ORDINAL_WORDS_PATTERN = '(?:'\n + Object.keys(exports.ORDINAL_WORDS).join('|').replace(/ /g, '[ -]')\n + ')';\n\nvar TIME_UNIT =\n '(' + exports.INTEGER_WORDS_PATTERN + '|[0-9]+|[0-9]+\\.[0-9]+|en(?:\\\\s*few)?|half)\\\\s*' +\n '(sec(?:onde?)?|min(?:uten)?s?|(?:uur|uren)?|weken?|dagen?|maanden?|jaren?)\\\\s*';\n\nvar TIME_UNIT_STRICT =\n '(?:[0-9]+?)\\\\s*' +\n '(?:seconden?|(?:minuut|minuten)|(?:uur|uren)|(?:dag|dagen))\\\\s*';\n\nvar PATTERN_TIME_UNIT = new RegExp(TIME_UNIT, 'i');\n\nexports.TIME_UNIT_PATTERN = '(?:' + TIME_UNIT + ')+';\nexports.TIME_UNIT_STRICT_PATTERN = '(?:' + TIME_UNIT_STRICT + ')+';\n\nexports.extractDateTimeUnitFragments = function (timeunitText) {\n var fragments = {};\n var remainingText = timeunitText;\n var match = PATTERN_TIME_UNIT.exec(remainingText);\n while (match) {\n collectDateTimeFragment(match, fragments);\n remainingText = remainingText.substring(match[0].length);\n match = PATTERN_TIME_UNIT.exec(remainingText);\n }\n return fragments;\n};\n\nfunction collectDateTimeFragment(match, fragments) {\n var num = match[1].toLowerCase() ;\n if (exports.INTEGER_WORDS[num] !== undefined) {\n num = exports.INTEGER_WORDS[num];\n } else if (num.match(/half/)) {\n num = 0.5;\n } else {\n num = parseFloat(num);\n }\n\n if (match[2].match(/^(?:uur|uren)/i)) {\n fragments['hour'] = num;\n } else if (match[2].match(/min/i)) {\n fragments['minute'] = num;\n } else if (match[2].match(/sec/i)) {\n fragments['second'] = num;\n } else if (match[2].match(/week/i)) {\n fragments['week'] = num;\n } else if (match[2].match(/dag/i)) {\n fragments['d'] = num;\n } else if (match[2].match(/maand/i)) {\n fragments['month'] = num;\n } else if (match[2].match(/jaar/i)) {\n fragments['year'] = num;\n }\n\n return fragments;\n}\n","\nvar options = exports.options = require('./options');\n\nexports.parser = require('./parsers/parser');\nexports.refiner = require('./refiners/refiner');\n\nexports.Parser = exports.parser.Parser;\nexports.Refiner = exports.refiner.Refiner;\nexports.Filter = exports.refiner.Filter;\n\nexports.ParsedResult = require('./result').ParsedResult;\nexports.ParsedComponents = require('./result').ParsedComponents;\n\nvar Chrono = function(option) {\n\n option = option || exports.options.casualOption();\n this.parsers = new Object(option.parsers);\n this.refiners = new Object(option.refiners);\n};\n\n\nChrono.prototype.parse = function(text, refDate, opt) {\n\n refDate = refDate || new Date();\n opt = opt || {};\n opt.forwardDate = opt.forwardDate || opt.forwardDate;\n \n var allResults = [];\n\n this.parsers.forEach(function (parser) {\n var results = parser.execute(text, refDate, opt);\n allResults = allResults.concat(results);\n });\n\n allResults.sort(function(a, b) {\n return a.index - b.index;\n });\n\n this.refiners.forEach(function (refiner) {\n allResults = refiner.refine(text, allResults, opt);\n });\n \n return allResults;\n};\n\n\nChrono.prototype.parseDate = function(text, refDate, opt) {\n var results = this.parse(text, refDate, opt);\n if (results.length > 0) {\n return results[0].start.date();\n }\n return null;\n};\n\nexports.Chrono = Chrono;\nexports.strict = new Chrono( options.strictOption() );\nexports.casual = new Chrono( options.casualOption() );\n\nexports.en = new Chrono( options.mergeOptions([\n options.en.casual, options.commonPostProcessing]));\n\nexports.en_GB = new Chrono( options.mergeOptions([\n options.en_GB.casual, options.commonPostProcessing]));\n\nexports.de = new Chrono( options.mergeOptions([\n options.de.casual, options.en, options.commonPostProcessing]));\n\nexports.nl = new Chrono( options.mergeOptions([\n options.nl.casual, options.en, options.commonPostProcessing]));\n\nexports.pt = new Chrono( options.mergeOptions([\n options.pt.casual, options.en, options.commonPostProcessing]));\n\nexports.es = new Chrono( options.mergeOptions([\n options.es.casual, options.en, options.commonPostProcessing]));\n\nexports.fr = new Chrono( options.mergeOptions([\n options.fr.casual, options.en, options.commonPostProcessing]));\n\nexports.ja = new Chrono( options.mergeOptions([ \n options.ja.casual, options.en, options.commonPostProcessing]));\n\n\nexports.parse = function () {\n return exports.casual.parse.apply(exports.casual, arguments);\n};\n\nexports.parseDate = function () {\n return exports.casual.parseDate.apply(exports.casual, arguments);\n};\n\n\n\n\n","var parser = require('./parsers/parser');\nvar refiner = require('./refiners/refiner');\n\n\nexports.mergeOptions = function(options) {\n\n var addedTypes = {};\n var mergedOption = {\n parsers: [],\n refiners: []\n };\n\n options.forEach(function (option) {\n\n if (option.call) {\n option = option.call();\n }\n\n if (option.parsers) {\n option.parsers.forEach(function (p) {\n if (!addedTypes[p.constructor]) {\n mergedOption.parsers.push(p);\n addedTypes[p.constructor] = true;\n }\n });\n }\n\n if (option.refiners) {\n option.refiners.forEach(function (r) {\n if (!addedTypes[r.constructor]) {\n mergedOption.refiners.push(r);\n addedTypes[r.constructor] = true;\n }\n });\n }\n });\n\n return mergedOption;\n};\n\n\nexports.commonPostProcessing = function() {\n return {\n refiners: [\n // These should be after all other refiners\n new refiner.ExtractTimezoneOffsetRefiner(),\n new refiner.ExtractTimezoneAbbrRefiner(),\n new refiner.UnlikelyFormatFilter()\n ]\n }\n};\n\n\n// -------------------------------------------------------------\n\nexports.strictOption = function () {\n var strictConfig = {\n strict: true\n };\n\n return exports.mergeOptions([\n exports.en(strictConfig),\n exports.de(strictConfig),\n exports.nl(strictConfig),\n exports.pt(strictConfig),\n exports.es(strictConfig),\n exports.fr(strictConfig),\n exports.ja(strictConfig),\n exports.zh,\n exports.commonPostProcessing\n ]);\n};\n\nexports.casualOption = function () {\n return exports.mergeOptions([\n exports.en.casual,\n // Some German abbriviate overlap with common English\n exports.de({ strict: true }),\n exports.nl,\n exports.pt,\n exports.es,\n exports.fr,\n exports.ja,\n exports.zh,\n exports.commonPostProcessing\n ]);\n};\n\n// -------------------------------------------------------------\n\nexports.de = function(config) {\n return {\n parsers: [\n new parser.DEDeadlineFormatParser(config),\n new parser.DEMonthNameLittleEndianParser(config),\n new parser.DEMonthNameParser(config),\n new parser.DESlashDateFormatParser(config),\n new parser.DETimeAgoFormatParser(config),\n new parser.DETimeExpressionParser(config)\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner(),\n new refiner.DEMergeDateTimeRefiner(),\n new refiner.DEMergeDateRangeRefiner()\n ]\n }\n};\n\nexports.de.casual = function() {\n var option = exports.de({\n strict: false\n });\n option.parsers.unshift(new parser.DECasualDateParser());\n option.parsers.unshift(new parser.DEWeekdayParser());\n return option;\n};\n\n\n\n// -------------------------------------------------------------\n\nexports.nl = function(config) {\n return {\n parsers: [\n new parser.NLMonthNameLittleEndianParser(config),\n new parser.NLMonthNameParser(config),\n new parser.NLSlashDateFormatParser(config),\n new parser.NLTimeExpressionParser(config),\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner(),\n new refiner.NLMergeDateTimeRefiner(),\n new refiner.NLMergeDateRangeRefiner()\n ]\n }\n};\n\nexports.nl.casual = function() {\n var option = exports.nl({\n strict: false\n });\n option.parsers.unshift(new parser.NLCasualDateParser());\n option.parsers.unshift(new parser.NLCasualTimeParser());\n option.parsers.unshift(new parser.NLWeekdayParser());\n return option;\n};\n\n\n\n// -------------------------------------------------------------\n\n\nexports.en = function(config) {\n return {\n parsers: [\n new parser.ENISOFormatParser(config),\n new parser.ENDeadlineFormatParser(config),\n new parser.ENMonthNameLittleEndianParser(config),\n new parser.ENMonthNameMiddleEndianParser(config),\n new parser.ENMonthNameParser(config),\n new parser.ENSlashDateFormatParser(config),\n new parser.ENSlashDateFormatStartWithYearParser(config),\n new parser.ENSlashMonthFormatParser(config),\n new parser.ENTimeAgoFormatParser(config),\n new parser.ENTimeLaterFormatParser(config),\n new parser.ENTimeExpressionParser(config)\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner(),\n\n // English\n new refiner.ENMergeDateTimeRefiner(),\n new refiner.ENMergeDateRangeRefiner(),\n new refiner.ENPrioritizeSpecificDateRefiner()\n ]\n }\n};\n\nexports.en.casual = function(config) {\n config = config || {};\n config.strict = false;\n var option = exports.en(config);\n\n // en\n option.parsers.unshift(new parser.ENCasualDateParser());\n option.parsers.unshift(new parser.ENCasualTimeParser());\n option.parsers.unshift(new parser.ENWeekdayParser());\n option.parsers.unshift(new parser.ENRelativeDateFormatParser());\n return option;\n};\n\n\nexports.en_GB = function(config) {\n config = config || {};\n config.littleEndian = true;\n return exports.en(config);\n}\n\nexports.en_GB.casual = function(config) {\n config = config || {};\n config.littleEndian = true;\n return exports.en.casual(config);\n}\n\n// -------------------------------------------------------------\n\nexports.ja = function() {\n return {\n parsers: [\n new parser.JPStandardParser()\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner(),\n new refiner.JPMergeDateRangeRefiner()\n ]\n }\n};\n\nexports.ja.casual = function() {\n var option = exports.ja();\n option.parsers.unshift(new parser.JPCasualDateParser());\n return option;\n};\n\n// -------------------------------------------------------------\n\n\nexports.pt = function(config) {\n return {\n parsers: [\n new parser.PTTimeAgoFormatParser(config),\n new parser.PTDeadlineFormatParser(config),\n new parser.PTTimeExpressionParser(config),\n new parser.PTMonthNameLittleEndianParser(config),\n new parser.PTSlashDateFormatParser(config)\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner()\n ]\n }\n};\n\nexports.pt.casual = function() {\n var option = exports.pt({\n strict: false\n });\n\n option.parsers.unshift(new parser.PTCasualDateParser());\n option.parsers.unshift(new parser.PTWeekdayParser());\n return option;\n};\n\n// -------------------------------------------------------------\n\n\nexports.es = function(config) {\n return {\n parsers: [\n new parser.ESTimeAgoFormatParser(config),\n new parser.ESDeadlineFormatParser(config),\n new parser.ESTimeExpressionParser(config),\n new parser.ESMonthNameLittleEndianParser(config),\n new parser.ESSlashDateFormatParser(config)\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner()\n ]\n }\n};\n\nexports.es.casual = function() {\n var option = exports.es({\n strict: false\n });\n\n option.parsers.unshift(new parser.ESCasualDateParser());\n option.parsers.unshift(new parser.ESWeekdayParser());\n return option;\n};\n\n\n// -------------------------------------------------------------\n\nexports.fr = function(config) {\n return {\n parsers: [\n new parser.FRDeadlineFormatParser(config),\n new parser.FRMonthNameLittleEndianParser(config),\n new parser.FRSlashDateFormatParser(config),\n new parser.FRTimeAgoFormatParser(config),\n new parser.FRTimeExpressionParser(config)\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner(),\n new refiner.FRMergeDateRangeRefiner(),\n new refiner.FRMergeDateTimeRefiner()\n ]\n }\n};\n\nexports.fr.casual = function() {\n var option = exports.fr({\n strict: false\n });\n\n option.parsers.unshift(new parser.FRCasualDateParser());\n option.parsers.unshift(new parser.FRWeekdayParser());\n option.parsers.unshift(new parser.FRRelativeDateFormatParser());\n return option;\n};\n\n\n// -------------------------------------------------------------\n\nexports.zh = function() {\n return {\n parsers: [\n new parser.ZHHantDateParser(),\n new parser.ZHHantWeekdayParser(),\n new parser.ZHHantTimeExpressionParser(),\n new parser.ZHHantCasualDateParser(),\n new parser.ZHHantDeadlineFormatParser()\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner()\n ]\n }\n};\n","/*\n ISO 8601\n http://www.w3.org/TR/NOTE-datetime\n - YYYY-MM-DD\n - YYYY-MM-DDThh:mmTZD\n - YYYY-MM-DDThh:mm:ssTZD\n - YYYY-MM-DDThh:mm:ss.sTZD \n - TZD = (Z or +hh:mm or -hh:mm)\n*/\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp('(\\\\W|^)' \n + '([0-9]{4})\\\\-([0-9]{1,2})\\\\-([0-9]{1,2})'\n + '(?:T' //..\n + '([0-9]{1,2}):([0-9]{1,2})' // hh:mm\n + '(?::([0-9]{1,2})(?:\\\\.(\\\\d{1,4}))?)?' // :ss.s\n + '(?:Z|([+-]\\\\d{2}):?(\\\\d{2})?)?' // TZD (Z or ±hh:mm or ±hhmm or ±hh)\n + ')?' //..\n + '(?=\\\\W|$)', 'i');\n\nvar YEAR_NUMBER_GROUP = 2;\nvar MONTH_NUMBER_GROUP = 3;\nvar DATE_NUMBER_GROUP = 4;\nvar HOUR_NUMBER_GROUP = 5;\nvar MINUTE_NUMBER_GROUP = 6;\nvar SECOND_NUMBER_GROUP = 7;\nvar MILLISECOND_NUMBER_GROUP = 8;\nvar TZD_HOUR_OFFSET_GROUP = 9;\nvar TZD_MINUTE_OFFSET_GROUP = 10;\n\nexports.Parser = function ENISOFormatParser(){\n Parser.apply(this, arguments);\n \n this.pattern = function() { return PATTERN; }\n \n this.extract = function(text, ref, match, opt){ \n \n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n })\n \n result.start.assign('year', parseInt(match[YEAR_NUMBER_GROUP]));\n result.start.assign('month', parseInt(match[MONTH_NUMBER_GROUP]));\n result.start.assign('day', parseInt(match[DATE_NUMBER_GROUP]));\n\n if (dayjs(result.start.get('month')) > 12 || dayjs(result.start.get('month')) < 1 ||\n dayjs(result.start.get('day')) > 31 || dayjs(result.start.get('day')) < 1) {\n return null;\n }\n\n if (match[HOUR_NUMBER_GROUP] != null) {\n \n result.start.assign('hour',\n parseInt(match[HOUR_NUMBER_GROUP]));\n result.start.assign('minute',\n parseInt(match[MINUTE_NUMBER_GROUP]));\n\n if (match[SECOND_NUMBER_GROUP] != null) {\n\n result.start.assign('second',\n parseInt(match[SECOND_NUMBER_GROUP]));\n }\n\n if (match[MILLISECOND_NUMBER_GROUP] != null) {\n\n result.start.assign('millisecond',\n parseInt(match[MILLISECOND_NUMBER_GROUP]));\n }\n\n if (match[TZD_HOUR_OFFSET_GROUP] == null) {\n\n result.start.assign('timezoneOffset', 0);\n } else {\n\n var minuteOffset = 0;\n var hourOffset = parseInt(match[TZD_HOUR_OFFSET_GROUP]);\n if (match[TZD_MINUTE_OFFSET_GROUP] != null)\n minuteOffset = parseInt(match[TZD_MINUTE_OFFSET_GROUP]);\n\n var offset = hourOffset * 60;\n if (offset < 0) {\n offset -= minuteOffset;\n } else {\n offset += minuteOffset;\n }\n\n result.start.assign('timezoneOffset', offset);\n }\n }\n \n result.tags['ENISOFormatParser'] = true;\n return result;\n };\n\n}\n\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(within|in)\\\\s*' +\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|an?(?:\\\\s*few)?|half(?:\\\\s*an?)?)\\\\s*' +\n '(seconds?|min(?:ute)?s?|hours?|days?|weeks?|months?|years?)\\\\s*' +\n '(?=\\\\W|$)', 'i'\n);\n\nvar STRICT_PATTERN = new RegExp('(\\\\W|^)' +\n '(within|in)\\\\s*' +\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|an?)\\\\s*' +\n '(seconds?|minutes?|hours?|days?)\\\\s*' +\n '(?=\\\\W|$)', 'i'\n);\n\nexports.Parser = function ENDeadlineFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return this.isStrictMode()? STRICT_PATTERN : PATTERN;\n };\n\n this.extract = function(text, ref, match, opt){\n\n var index = match.index + match[1].length;\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var num = match[3].toLowerCase();\n if (util.INTEGER_WORDS[num] !== undefined) {\n num = util.INTEGER_WORDS[num];\n } else if (num === 'a' || num === 'an'){\n num = 1;\n } else if (num.match(/few/i)){\n num = 3;\n } else if (num.match(/half/i)) {\n num = 0.5;\n } else {\n num = parseInt(num);\n }\n\n var date = dayjs(ref);\n if (match[4].match(/day|week|month|year/i)) {\n\n if (match[4].match(/day/i)) {\n date = date.add(num, 'd');\n } else if (match[4].match(/week/i)) {\n date = date.add(num * 7, 'd');\n } else if (match[4].match(/month/i)) {\n date = date.add(num, 'month');\n } else if (match[4].match(/year/i)) {\n date = date.add(num, 'year');\n }\n\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n return result;\n }\n\n if (match[4].match(/hour/i)) {\n\n date = date.add(num, 'hour');\n\n } else if (match[4].match(/min/i)) {\n\n date = date.add(num, 'minute');\n\n } else if (match[4].match(/second/i)) {\n\n date = date.add(num, 'second');\n }\n\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.start.assign('second', date.second());\n result.tags['ENDeadlineFormatParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(this|next|last|past)\\\\s*' +\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|few|half(?:\\\\s*an?)?)?\\\\s*' +\n '(seconds?|min(?:ute)?s?|hours?|days?|weeks?|months?|years?)(?=\\\\s*)' +\n '(?=\\\\W|$)', 'i'\n);\n\nvar MODIFIER_WORD_GROUP = 2;\nvar MULTIPLIER_WORD_GROUP = 3;\nvar RELATIVE_WORD_GROUP = 4;\n\nexports.Parser = function ENRelativeDateFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; };\n\n this.extract = function(text, ref, match, opt){\n\n var index = match.index + match[1].length;\n var modifier = match[MODIFIER_WORD_GROUP].toLowerCase().match(/^next/) ? 1 : -1;\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n result.tags['ENRelativeDateFormatParser'] = true;\n\n var num = match[MULTIPLIER_WORD_GROUP] === undefined ? '' : match[3].toLowerCase();\n if (util.INTEGER_WORDS[num] !== undefined) {\n num = util.INTEGER_WORDS[num];\n } else if (num === ''){\n num = 1;\n } else if (num.match(/few/i)){\n num = 3;\n } else if (num.match(/half/i)) {\n num = 0.5;\n } else {\n num = parseInt(num);\n }\n\n num *= modifier;\n var date = dayjs(ref);\n\n if (match[MODIFIER_WORD_GROUP].toLowerCase().match(/^this/)) {\n\n if (match[MULTIPLIER_WORD_GROUP]) {\n return null;\n }\n\n if (match[RELATIVE_WORD_GROUP].match(/day|week|month|year/i)) {\n \n // This week\n if (match[RELATIVE_WORD_GROUP].match(/week/i)) {\n date = date.add(-date.get('d'), 'd');\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n } \n \n // This month\n else if (match[RELATIVE_WORD_GROUP].match(/month/i)) {\n date = date.add(-date.date() + 1, 'd');\n result.start.imply('day', date.date());\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n } \n\n // This year\n else if (match[RELATIVE_WORD_GROUP].match(/year/i)) {\n date = date.add(-date.date() + 1, 'd');\n date = date.add(-date.month(), 'month');\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.assign('year', date.year());\n } \n\n return result;\n }\n }\n \n if (match[RELATIVE_WORD_GROUP].match(/day|week|month|year/i)) {\n\n if (match[RELATIVE_WORD_GROUP].match(/day/i)) {\n date = date.add(num, 'd');\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n } else if (match[RELATIVE_WORD_GROUP].match(/week/i)) {\n date = date.add(num * 7, 'd');\n // We don't know the exact date for next/last week so we imply\n // them\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n } else if (match[RELATIVE_WORD_GROUP].match(/month/i)) {\n date = date.add(num, 'month');\n // We don't know the exact day for next/last month\n result.start.imply('day', date.date());\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n } else if (match[RELATIVE_WORD_GROUP].match(/year/i)) {\n date = date.add(num, 'year');\n // We don't know the exact day for month on next/last year\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.assign('year', date.year());\n }\n\n return result;\n }\n\n if (match[RELATIVE_WORD_GROUP].match(/hour/i)) {\n\n date = date.add(num, 'hour');\n result.start.imply('minute', date.minute());\n result.start.imply('second', date.second());\n\n } else if (match[RELATIVE_WORD_GROUP].match(/min/i)) {\n\n date = date.add(num, 'minute');\n result.start.assign('minute', date.minute());\n result.start.imply('second', date.second());\n\n } else if (match[RELATIVE_WORD_GROUP].match(/second/i)) {\n\n date = date.add(num, 'second');\n result.start.assign('second', date.second());\n result.start.assign('minute', date.minute());\n }\n\n result.start.assign('hour', date.hour());\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n return result;\n };\n};\n","const parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:on\\\\s*?)?' +\n '(?:(Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sun|Mon|Tue|Wed|Thu|Fri|Sat)\\\\s*,?\\\\s*)?' +\n '(([0-9]{1,2})(?:st|nd|rd|th)?|' + util.ORDINAL_WORDS_PATTERN + ')' +\n '(?:\\\\s*' +\n '(?:to|\\\\-|\\\\–|until|through|till|\\\\s)\\\\s*' +\n '(([0-9]{1,2})(?:st|nd|rd|th)?|' + util.ORDINAL_WORDS_PATTERN + ')' +\n ')?' + \n '(?:-|\\/|\\\\s*(?:of)?\\\\s*)' +\n '(' + util.MONTH_PATTERN + ')' +\n '(?:' +\n '(?:-|\\/|,?\\\\s*)' +\n '((?:' + \n '[1-9][0-9]{0,3}\\\\s*(?:BE|AD|BC)|' +\n '[1-2][0-9]{3}|' +\n '[5-9][0-9]' +\n ')(?![^\\\\s]\\\\d))' +\n ')?' +\n '(?=\\\\W|$)', 'i'\n );\n\nvar WEEKDAY_GROUP = 2;\nvar DATE_GROUP = 3;\nvar DATE_NUM_GROUP = 4;\nvar DATE_TO_GROUP = 5;\nvar DATE_TO_NUM_GROUP = 6;\nvar MONTH_NAME_GROUP = 7;\nvar YEAR_GROUP = 8;\n\nexports.Parser = function ENMonthNameLittleEndianParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref\n });\n\n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n\n var day = match[DATE_NUM_GROUP] ?\n parseInt(match[DATE_NUM_GROUP]):\n util.ORDINAL_WORDS[match[DATE_GROUP].trim().replace('-', ' ').toLowerCase()];\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n \n if (/BE/i.test(year)) {\n // Buddhist Era\n year = year.replace(/BE/i, '');\n year = parseInt(year) - 543;\n } else if (/BC/i.test(year)){\n // Before Christ\n year = year.replace(/BC/i, '');\n year = -parseInt(year);\n } else if (/AD/i.test(year)){\n year = year.replace(/AD/i, '');\n year = parseInt(year);\n } else {\n year = parseInt(year);\n if (year < 100){\n if (year > 50) {\n year = year + 1900;\n } else {\n year = year + 2000;\n }\n }\n }\n }\n\n if(year){\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month);\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n // Weekday component\n if (match[WEEKDAY_GROUP]) {\n var weekday = match[WEEKDAY_GROUP];\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()]\n result.start.assign('weekday', weekday);\n }\n\n // Text can be 'range' value. Such as '12 - 13 January 2012'\n if (match[DATE_TO_GROUP]) {\n var endDate = match[DATE_TO_NUM_GROUP] ?\n parseInt(match[DATE_TO_NUM_GROUP]):\n util.ORDINAL_WORDS[match[DATE_TO_GROUP].trim().replace('-', ' ').toLowerCase()];\n\n result.end = result.start.clone();\n result.end.assign('day', endDate);\n }\n\n result.tags['ENMonthNameLittleEndianParser'] = true;\n return result;\n };\n};\n","/*\n\n The parser for parsing US's date format that begin with month's name.\n\n EX.\n - January 13\n - January 13, 2012\n - January 13 - 15, 2012\n - Tuesday, January 13, 2012\n\n Watch out for:\n - January 12:00\n - January 12.44\n - January 1222344\n*/\nvar parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:' +\n '(?:on\\\\s*?)?' +\n '(Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sun\\\\.?|Mon\\\\.?|Tue\\\\.?|Wed\\\\.?|Thu\\\\.?|Fri\\\\.?|Sat\\\\.?)' +\n '\\\\s*,?\\\\s*)?' +\n '(' + util.MONTH_PATTERN + ')' +\n '(?:-|\\/|\\\\s*,?\\\\s*)' +\n '(([0-9]{1,2})(?:st|nd|rd|th)?|' + util.ORDINAL_WORDS_PATTERN +')(?!\\\\s*(?:am|pm))\\\\s*' + '' + \n '(?:' +\n '(?:to|\\\\-)\\\\s*' +\n '(([0-9]{1,2})(?:st|nd|rd|th)?| ' + util.ORDINAL_WORDS_PATTERN + ')\\\\s*' +\n ')?' +\n '(?:' +\n '(?:-|\\/|\\\\s*,?\\\\s*)' +\n '(?:([0-9]{4})\\\\s*(BE|AD|BC)?|([0-9]{1,4})\\\\s*(AD|BC))\\\\s*' +\n ')?' +\n '(?=\\\\W|$)(?!\\\\:\\\\d)', 'i');\n\nvar WEEKDAY_GROUP = 2;\nvar MONTH_NAME_GROUP = 3;\nvar DATE_GROUP = 4;\nvar DATE_NUM_GROUP = 5;\nvar DATE_TO_GROUP = 6;\nvar DATE_TO_NUM_GROUP = 7;\nvar YEAR_GROUP = 8;\nvar YEAR_BE_GROUP = 9;\nvar YEAR_GROUP2 = 10;\nvar YEAR_BE_GROUP2 = 11;\n\nexports.Parser = function ENMonthNameMiddleEndianParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n\n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n var day = match[DATE_NUM_GROUP] ?\n parseInt(match[DATE_NUM_GROUP]) :\n util.ORDINAL_WORDS[match[DATE_GROUP].trim().replace('-', ' ').toLowerCase()];\n\n var year = null;\n if (match[YEAR_GROUP] || match[YEAR_GROUP2]) {\n year = match[YEAR_GROUP] || match[YEAR_GROUP2];\n year = parseInt(year);\n\n var yearBE = match[YEAR_BE_GROUP] || match[YEAR_BE_GROUP2];\n if (yearBE) {\n if (/BE/i.test(yearBE)) {\n // Buddhist Era\n year = year - 543;\n } else if (/BC/i.test(yearBE)) {\n // Before Christ\n year = -year;\n }\n } else if (year < 100){\n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month)\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n // Weekday component\n if (match[WEEKDAY_GROUP]) {\n var weekday = match[WEEKDAY_GROUP];\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()]\n result.start.assign('weekday', weekday);\n }\n\n // Text can be 'range' value. Such as 'January 12 - 13, 2012'\n if (match[DATE_TO_GROUP]) {\n var endDate = match[DATE_TO_NUM_GROUP] ?\n endDate = parseInt(match[DATE_TO_NUM_GROUP]) :\n util.ORDINAL_WORDS[match[DATE_TO_GROUP].replace('-', ' ').trim().toLowerCase()];\n\n result.end = result.start.clone();\n result.end.assign('day', endDate);\n }\n\n result.tags['ENMonthNameMiddleEndianParser'] = true;\n return result;\n }\n};","/*\n \n The parser for parsing month name and year.\n \n EX. \n - January\n - January 2012\n - January, 2012\n*/\nvar parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('(^|\\\\D\\\\s+|[^\\\\w\\\\s])' +\n '('+ util.MONTH_PATTERN +')' + \n '\\\\s*' +\n '(?:' +\n '[,-]?\\\\s*([0-9]{4})(\\\\s*BE|AD|BC)?' +\n ')?' +\n '(?=[^\\\\s\\\\w]|\\\\s+[^0-9]|\\\\s+$|$)', 'i');\n\nvar MONTH_NAME_GROUP = 2;\nvar YEAR_GROUP = 3;\nvar YEAR_BE_GROUP = 4;\n\nexports.Parser = function ENMonthNameParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n \n this.extract = function(text, ref, match, opt){\n const result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n const day = 1;\n const monthName = match[MONTH_NAME_GROUP];\n const month = util.MONTH_OFFSET[monthName.toLowerCase()];\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n year = parseInt(year);\n\n if(match[YEAR_BE_GROUP]){\n if (match[YEAR_BE_GROUP].match(/BE/)) {\n // Buddhist Era\n year = year - 543;\n } else if (match[YEAR_BE_GROUP].match(/BC/)) {\n // Before Christ\n year = -year;\n }\n\n } else if (year < 100){ \n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month)\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n if (result.text.match(/^\\w{3}$/)) {\n return false;\n }\n\n result.tags['ENMonthNameParser'] = true;\n return result;\n }\n}\n","/*\n Date format with slash \"/\" (also \"-\" and \".\") between numbers\n - Tuesday 11/3/2015 \n - 11/3/2015\n - 11/3\n\n By default the paser us \"middle-endien\" format (US English),\n then fallback to little-endian if failed.\n - 11/3/2015 = November 3rd, 2015\n - 23/4/2015 = April 23th, 2015\n\n If \"littleEndian\" config is set, the parser will try the little-endian first. \n - 11/3/2015 = March 11th, 2015\n*/\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:' +\n '(?:on\\\\s*?)?' +\n '((?:sun|mon|tues?|wed(?:nes)?|thu(?:rs?)?|fri|sat(?:ur)?)(?:day)?)' +\n '\\\\s*\\\\,?\\\\s*' +\n ')?' +\n '([0-3]{0,1}[0-9]{1})[\\\\/\\\\.\\\\-]([0-3]{0,1}[0-9]{1})' +\n '(?:' +\n '[\\\\/\\\\.\\\\-]' +\n '([0-9]{4}\\s*\\,?\\s*|[0-9]{2}\\s*\\,?\\s*)' +\n ')?' +\n '(\\\\W|$)', 'i');\n\nvar DAYS_OFFSET = { 'sunday': 0, 'sun': 0, 'monday': 1, 'mon': 1,'tuesday': 2, 'wednesday': 3, 'wed': 3,\n 'thursday': 4, 'thur': 4,'friday': 5, 'fri': 5,'saturday': 6, 'sat': 6,}\n\n\nvar OPENNING_GROUP = 1;\nvar ENDING_GROUP = 6;\n\nvar WEEKDAY_GROUP = 2;\n\n\nvar FIRST_NUMBERS_GROUP = 3;\nvar SECOND_NUMBERS_GROUP = 4;\n\nvar YEAR_GROUP = 5;\n\nexports.Parser = function ENSlashDateFormatParser(config) {\n Parser.apply(this, arguments);\n config = config || {};\n var littleEndian = config.littleEndian;\n var MONTH_GROUP = littleEndian ? SECOND_NUMBERS_GROUP : FIRST_NUMBERS_GROUP;\n var DAY_GROUP = littleEndian ? FIRST_NUMBERS_GROUP : SECOND_NUMBERS_GROUP;\n\n this.pattern = function () { return PATTERN; };\n this.extract = function(text, ref, match, opt){\n\n if(match[OPENNING_GROUP] == '/' || match[ENDING_GROUP] == '/') {\n // Long skip, if there is some overlapping like:\n // XX[/YY/ZZ]\n // [XX/YY/]ZZ\n match.index += match[0].length\n return;\n }\n\n var index = match.index + match[OPENNING_GROUP].length;\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length - match[ENDING_GROUP].length);\n\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n });\n\n if(text.match(/^\\d\\.\\d$/)) return;\n if(text.match(/^\\d\\.\\d{1,2}\\.\\d{1,2}$/)) return;\n\n // MM/dd -> OK\n // MM.dd -> NG\n if(!match[YEAR_GROUP] && match[0].indexOf('/') < 0) return;\n\n var date = null;\n var year = match[YEAR_GROUP] || dayjs(ref).year() + '';\n var month = match[MONTH_GROUP];\n var day = match[DAY_GROUP];\n\n month = parseInt(month);\n day = parseInt(day);\n year = parseInt(year);\n\n if(month < 1 || month > 12) {\n if(month > 12) {\n // dd/mm/yyyy date format if day looks like a month, and month\n // looks like a day.\n if (day >= 1 && day <= 12 && month >= 13 && month <= 31) {\n // unambiguous\n var tday = month;\n month = day;\n day = tday;\n }\n else {\n // both month and day are <= 12\n return null;\n }\n }\n }\n if(day < 1 || day > 31) return null;\n\n if(year < 100){\n if (year > 50) {\n year = year + 1900;\n } else {\n year = year + 2000;\n }\n }\n\n result.start.assign('day', day);\n result.start.assign('month', month);\n if (match[YEAR_GROUP]) {\n result.start.assign('year', year);\n } else {\n result.start.imply('year', year);\n }\n\n //Day of week\n if(match[WEEKDAY_GROUP]) {\n result.start.assign('weekday', DAYS_OFFSET[match[WEEKDAY_GROUP].toLowerCase()]);\n }\n\n result.tags['ENSlashDateFormatParser'] = true;\n return result;\n };\n};\n","/*\n Date format with slash \"/\" between numbers like ENSlashDateFormatParser,\n but this parser expect year before month and date. \n - YYYY/MM/DD\n - YYYY-MM-DD\n - YYYY.MM.DD\n*/\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('(\\\\W|^)' \n + '([0-9]{4})[\\\\-\\\\.\\\\/]'\n + '((?:' + util.MONTH_PATTERN + '|[0-9]{1,2}))[\\\\-\\\\.\\\\/]'\n + '([0-9]{1,2})'\n + '(?=\\\\W|$)', 'i');\n\nvar YEAR_NUMBER_GROUP = 2;\nvar MONTH_NUMBER_GROUP = 3;\nvar DATE_NUMBER_GROUP = 4;\n\nexports.Parser = function ENSlashDateFormatStartWithYearParser(){\n Parser.apply(this, arguments);\n \n this.pattern = function() { return PATTERN; }\n \n this.extract = function(text, ref, match, opt){\n\n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n })\n \n var month = match[MONTH_NUMBER_GROUP].toLowerCase();\n month = util.MONTH_OFFSET[month] | month;\n\n result.start.assign('year', parseInt(match[YEAR_NUMBER_GROUP]));\n result.start.assign('month', parseInt(month));\n result.start.assign('day', parseInt(match[DATE_NUMBER_GROUP]));\n\n if (\n dayjs(result.start.get('month')) > 12 || dayjs(result.start.get('month')) < 1 || \n dayjs(result.start.get('day')) > 31 || dayjs(result.start.get('day')) < 1) {\n return null;\n }\n \n result.tags['ENDateFormatParser'] = true;\n return result;\n };\n}\n","/*\n Month/Year date format with slash \"/\" (also \"-\" and \".\") between numbers \n - 11/05\n - 06/2005\n*/\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp('(^|[^\\\\d/]\\\\s+|[^\\\\w\\\\s])' +\n '([0-9]|0[1-9]|1[012])/([0-9]{4})' + \n '(?=[^\\\\d/]|$)', 'i');\n\nvar OPENNING_GROUP = 1;\n\nvar MONTH_GROUP = 2;\nvar YEAR_GROUP = 3;\n\nexports.Parser = function ENSlashMonthFormatParser(argument) {\n Parser.apply(this, arguments);\n\n this.pattern = function () { return PATTERN; };\n this.extract = function(text, ref, match, opt){\n \n var index = match.index + match[OPENNING_GROUP].length;\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length).trim();\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n });\n\n var year = match[YEAR_GROUP] ;\n var month = match[MONTH_GROUP];\n var day = 1;\n \n month = parseInt(month);\n year = parseInt(year);\n\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n\n result.tags['ENSlashMonthFormatParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('' +\n '(\\\\W|^)' +\n '(?:within\\\\s*)?' +\n '(' + util.TIME_UNIT_PATTERN + ')' +\n '(?:ago|before|earlier)(?=(?:\\\\W|$))', 'i');\n\nvar STRICT_PATTERN = new RegExp('' +\n '(\\\\W|^)' +\n '(?:within\\\\s*)?' +\n '(' + util.TIME_UNIT_STRICT_PATTERN + ')' +\n 'ago(?=(?:\\\\W|$))', 'i');\n\nexports.Parser = function ENTimeAgoFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return this.isStrictMode()? STRICT_PATTERN : PATTERN;\n };\n\n this.extract = function(text, ref, match, opt){\n\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n var index = match.index + match[1].length;\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var fragments = util.extractDateTimeUnitFragments(match[2]);\n var date = dayjs(ref);\n\n for (var key in fragments) {\n date = date.add(-fragments[key], key);\n }\n\n if (fragments['hour'] > 0 || fragments['minute'] > 0 || fragments['second'] > 0) {\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.start.assign('second', date.second());\n result.tags['ENTimeAgoFormatParser'] = true;\n } \n \n if (fragments['d'] > 0 || fragments['month'] > 0 || fragments['year'] > 0) {\n result.start.assign('day', date.date());\n result.start.assign('month', date.month() + 1);\n result.start.assign('year', date.year());\n } else {\n if (fragments['week'] > 0) {\n result.start.imply('weekday', date.day());\n }\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n }\n\n return result;\n };\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar ParsedComponents = require('../../result').ParsedComponents;\n\nvar FIRST_REG_PATTERN = new RegExp(\"(^|\\\\s|T)\" +\n \"(?:(?:at|from)\\\\s*)??\" + \n \"(\\\\d{1,4}|noon|midnight)\" + \n \"(?:\" + \n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" + \n \"(?:\" + \n \"(?:\\\\:|\\\\:)(\\\\d{2})(?:\\\\.(\\\\d{1,6}))?\" + \n \")?\" + \n \")?\" + \n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?|O\\\\W*CLOCK))?\" + \n \"(?=\\\\W|$)\", 'i');\n\n\nvar SECOND_REG_PATTERN = new RegExp(\"^\\\\s*\" + \n \"(\\\\-|\\\\–|\\\\~|\\\\〜|to|\\\\?)\\\\s*\" + \n \"(\\\\d{1,4})\" +\n \"(?:\" + \n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" + \n \"(?:\" + \n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})(?:\\\\.(\\\\d{1,6}))?\" + \n \")?\" + \n \")?\" + \n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?|O\\\\W*CLOCK))?\" + \n \"(?=\\\\W|$)\", 'i');\n\nvar HOUR_GROUP = 2;\nvar MINUTE_GROUP = 3;\nvar SECOND_GROUP = 4;\nvar MILLI_SECOND_GROUP = 5;\nvar AM_PM_HOUR_GROUP = 6;\n\n\nexports.Parser = function ENTimeExpressionParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return FIRST_REG_PATTERN; }\n \n this.extract = function(text, ref, match, opt){ \n \n // This pattern can be overlapped Ex. [12] AM, 1[2] AM\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n var refMoment = dayjs(ref);\n var result = new ParsedResult();\n result.ref = ref;\n result.index = match.index + match[1].length;\n result.text = match[0].substring(match[1].length);\n result.tags['ENTimeExpressionParser'] = true;\n\n result.start.imply('day', refMoment.date());\n result.start.imply('month', refMoment.month()+1);\n result.start.imply('year', refMoment.year());\n \n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Millisecond\n if(match[MILLI_SECOND_GROUP] != null){ \n var millisecond = parseInt(match[MILLI_SECOND_GROUP].substring(0, 3));\n if(millisecond >= 1000) return null;\n \n result.start.assign('millisecond', millisecond);\n }\n\n // ----- Second\n if(match[SECOND_GROUP] != null){ \n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.start.assign('second', second);\n }\n \n // ----- Hours\n if (match[HOUR_GROUP].toLowerCase() == \"noon\"){\n meridiem = 1; \n hour = 12;\n } else if (match[HOUR_GROUP].toLowerCase() == \"midnight\") {\n meridiem = 0; \n hour = 0;\n } else {\n hour = parseInt(match[HOUR_GROUP]);\n }\n \n // ----- Minutes\n if(match[MINUTE_GROUP] != null){ \n minute = parseInt(match[MINUTE_GROUP]);\n } else if(hour > 100) { \n minute = hour%100;\n hour = parseInt(hour/100);\n } \n \n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) { \n meridiem = 1;\n }\n\n // ----- AM & PM \n if(match[AM_PM_HOUR_GROUP] != null) {\n if(hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if(ampm == \"a\"){\n meridiem = 0; \n if(hour == 12) hour = 0;\n }\n \n if(ampm == \"p\"){\n meridiem = 1; \n if(hour != 12) hour += 12;\n }\n } \n\n result.start.assign('hour', hour);\n result.start.assign('minute', minute);\n\n if (meridiem >= 0) {\n result.start.assign('meridiem', meridiem);\n } else {\n if (hour < 12) {\n result.start.imply('meridiem', 0);\n } else {\n result.start.imply('meridiem', 1);\n }\n }\n\n // ==============================================================\n // Extracting the 'to' chunk\n // ==============================================================\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n return result;\n }\n\n\n\n // Pattern \"YY.YY -XXXX\" is more like timezone offset\n if (match[0].match(/^\\s*(\\+|\\-)\\s*\\d{3,4}$/)) {\n return result;\n }\n\n if(result.end == null){\n result.end = new ParsedComponents(null, result.start.date());\n }\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Millisecond\n if(match[MILLI_SECOND_GROUP] != null){ \n var millisecond = parseInt(match[MILLI_SECOND_GROUP].substring(0, 3));\n if(millisecond >= 1000) return null;\n \n result.end.assign('millisecond', millisecond);\n }\n \n // ----- Second\n if(match[SECOND_GROUP] != null){ \n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.end.assign('second', second);\n }\n\n hour = parseInt(match[2]);\n \n // ----- Minute\n if (match[MINUTE_GROUP]!= null) {\n \n minute = parseInt(match[MINUTE_GROUP]);\n if(minute >= 60) return result;\n \n } else if (hour > 100) {\n\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) { \n meridiem = 1;\n }\n \n // ----- AM & PM \n if (match[AM_PM_HOUR_GROUP] != null){\n\n if (hour > 12) return null;\n\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if(ampm == \"a\"){\n meridiem = 0; \n if(hour == 12) {\n hour = 0;\n if (!result.end.isCertain('day')) {\n result.end.imply('day', result.end.get('day') + 1);\n }\n }\n }\n \n if(ampm == \"p\"){\n meridiem = 1; \n if(hour != 12) hour += 12;\n }\n \n if (!result.start.isCertain('meridiem')) {\n if (meridiem == 0) {\n \n result.start.imply('meridiem', 0);\n \n if (result.start.get('hour') == 12) {\n result.start.assign('hour', 0);\n }\n\n } else {\n\n result.start.imply('meridiem', 1);\n \n if (result.start.get('hour') != 12) {\n result.start.assign('hour', result.start.get('hour') + 12); \n }\n }\n }\n }\n\n result.text = result.text + match[0];\n result.end.assign('hour', hour);\n result.end.assign('minute', minute);\n if (meridiem >= 0) {\n result.end.assign('meridiem', meridiem);\n } else {\n var startAtPM = result.start.isCertain('meridiem') && result.start.get('meridiem') == 1;\n if (startAtPM && result.start.get('hour') > hour) {\n // 10pm - 1 (am)\n result.end.imply('meridiem', 0);\n\n } else if (hour > 12) {\n result.end.imply('meridiem', 1);\n }\n }\n\n if (result.end.date().getTime() < result.start.date().getTime()) {\n result.end.imply('day', result.end.get('day') + 1)\n }\n \n return result;\n }\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('' +\n /*match[1]*/ '(\\\\W|^)' +\n /*match[2]*/ '(in )?' +\n /*match[3]*/ '(' + util.TIME_UNIT_PATTERN + ')' +\n /*match[4]*/ '(later|after|from now|henceforth|forward|out)?' +\n /*match[5]*/ '(?=(?:\\\\W|$))',\n'i');\n\nvar STRICT_PATTERN = new RegExp('' +\n /*match[1]*/ '(\\\\W|^)' +\n /*match[2]*/ '(in )?' +\n /*match[3]*/ '(' + util.TIME_UNIT_STRICT_PATTERN + ')' +\n /*match[4]*/ '(later|from now)?' +\n /*match[5]*/ '(?=(?:\\\\W|$))',\n'i');\n\nexports.Parser = function ENTimeLaterFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return this.isStrictMode()? STRICT_PATTERN : PATTERN;\n };\n\n this.extract = function(text, ref, match, opt){\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n\n var prefix = match[2];\n var suffix = match[4];\n if (!prefix && !suffix) return null;\n\n var preamble = match[1];\n var text = match[0].substr(preamble.length, match[0].length - preamble.length);\n var index = match.index + preamble.length;\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var fragments = util.extractDateTimeUnitFragments(match[3]);\n var date = dayjs(ref);\n for (var key in fragments) {\n date = date.add(fragments[key], key);\n }\n\n if (fragments['hour'] > 0 || fragments['minute'] > 0 || fragments['second'] > 0) {\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.start.assign('second', date.second());\n result.tags['ENTimeAgoFormatParser'] = true;\n } \n \n if (fragments['d'] > 0 || fragments['month'] > 0 || fragments['year'] > 0) {\n result.start.assign('day', date.date());\n result.start.assign('month', date.month() + 1);\n result.start.assign('year', date.year());\n } else {\n if (fragments['week'] > 0) {\n result.start.imply('weekday', date.day());\n }\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n }\n\n return result;\n };\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)(now|today|tonight|last\\s*night|(?:tomorrow|tmr|yesterday)\\s*|tomorrow|tmr|yesterday)(?=\\W|$)/i;\n\nexports.Parser = function ENCasualDateParser(){\n\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var refMoment = dayjs(ref);\n var startMoment = refMoment;\n var lowerText = text.toLowerCase();\n\n if(lowerText == 'tonight'){\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n\n } else if (/^tomorrow|^tmr/.test(lowerText)) {\n\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n\n } else if (/^yesterday/.test(lowerText)) {\n\n startMoment = startMoment.add(-1, 'day');\n\n } else if(lowerText.match(/last\\s*night/)) {\n\n result.start.imply('hour', 0);\n if (refMoment.hour() > 6) {\n startMoment = startMoment.add(-1, 'day');\n }\n\n } else if (lowerText.match(\"now\")) {\n\n result.start.assign('hour', refMoment.hour());\n result.start.assign('minute', refMoment.minute());\n result.start.assign('second', refMoment.second());\n result.start.assign('millisecond', refMoment.millisecond());\n\n }\n\n result.start.assign('day', startMoment.date())\n result.start.assign('month', startMoment.month() + 1)\n result.start.assign('year', startMoment.year())\n result.tags['ENCasualDateParser'] = true;\n return result;\n }\n}\n","var Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)((this)?\\s*(morning|afternoon|evening|noon|night))/i;\n\nvar TIME_MATCH = 4;\n\nexports.Parser = function ENCasualTimeParser(){\n\n Parser.apply(this, arguments);\n\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n if(!match[TIME_MATCH]) TIME_MATCH = 3;\n \n switch (match[TIME_MATCH].toLowerCase()) {\n\n case 'afternoon':\n result.start.imply('meridiem', 1);\n result.start.imply('hour', 15);\n break;\n\n case 'evening':\n case 'night':\n result.start.imply('meridiem', 1);\n result.start.imply('hour', 20);\n break;\n\n case 'morning':\n result.start.imply('meridiem', 0);\n result.start.imply('hour', 6);\n break;\n\n case 'noon':\n result.start.imply('meridiem', 0);\n result.start.imply('hour', 12);\n break;\n }\n \n result.tags['ENCasualTimeParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nconst parser = require('../parser');\nconst ParsedResult = require('../../result').ParsedResult;\n\nconst util = require('../../utils/JP'); \n\nconst PATTERN = /(?:(同|今|本|((昭和|平成|令和)?([0-90-9]{1,4}|元)))年\\s*)?([0-90-9]{1,2})月\\s*([0-90-9]{1,2})日/i;\nconst SPECIAL_YEAR_GROUP = 1;\nconst TYPICAL_YEAR_GROUP = 2;\nconst ERA_GROUP = 3;\nconst YEAR_NUMBER_GROUP = 4;\nconst MONTH_GROUP = 5;\nconst DAY_GROUP = 6;\n\nexports.Parser = function JPStandardParser(){\n parser.Parser.apply(this, arguments);\n \n this.pattern = function() { return PATTERN; }\n \n this.extract = function(text, ref, match, opt){ \n var result = new ParsedResult({\n text: match[0],\n index: match.index,\n ref: ref,\n });\n \n var month = match[MONTH_GROUP];\n month = util.toHankaku(month);\n month = parseInt(month);\n\n var day = match[DAY_GROUP];\n day = util.toHankaku(day);\n day = parseInt(day);\n\n result.start.assign('day', day);\n result.start.assign('month', month);\n \n if (match[TYPICAL_YEAR_GROUP]) {\n\n var year = match[YEAR_NUMBER_GROUP];\n if (year == '元') {\n year = 1;\n } else {\n year = util.toHankaku(year);\n year = parseInt(year);\n }\n\n if (match[ERA_GROUP] == '令和') {\n year += 2018;\n } else if (match[ERA_GROUP] == '平成') {\n year += 1988;\n } else if (match[ERA_GROUP] == '昭和') {\n year += 1925;\n }\n\n result.start.assign('year', year);\n\n } else if (match[SPECIAL_YEAR_GROUP] && match[SPECIAL_YEAR_GROUP].match('同|今|本')) {\n const moment = dayjs(ref)\n result.start.assign('year', moment.year());\n } else {\n const year = parser.findYearClosestToRef(ref, day, month);\n result.start.imply('year', year);\n }\n \n result.tags['JPStandardParser'] = true;\n return result;\n };\n\n}\n\n","\n\n/**\n * to-hankaku.js\n * convert to ascii code strings.\n *\n * @version 1.0.1\n * @author think49\n * @url https://gist.github.com/964592\n * @license http://www.opensource.org/licenses/mit-license.php (The MIT License)\n */\n \nexports.toHankaku = (function (String, fromCharCode) {\n \n function toHankaku (string) {\n return String(string).replace(/\\u2019/g, '\\u0027').replace(/\\u201D/g, '\\u0022').replace(/\\u3000/g, '\\u0020').replace(/\\uFFE5/g, '\\u00A5').replace(/[\\uFF01\\uFF03-\\uFF06\\uFF08\\uFF09\\uFF0C-\\uFF19\\uFF1C-\\uFF1F\\uFF21-\\uFF3B\\uFF3D\\uFF3F\\uFF41-\\uFF5B\\uFF5D\\uFF5E]/g, alphaNum);\n }\n \n function alphaNum (token) {\n return fromCharCode(token.charCodeAt(0) - 65248);\n }\n \n return toHankaku;\n})(String, String.fromCharCode);\n\n/**\n * to-zenkaku.js\n * convert to multi byte strings.\n *\n * @version 1.0.2\n * @author think49\n * @url https://gist.github.com/964592\n * @license http://www.opensource.org/licenses/mit-license.php (The MIT License)\n */\nexports.toZenkaku = (function (String, fromCharCode) {\n \n function toZenkaku (string) {\n return String(string).replace(/\\u0020/g, '\\u3000').replace(/\\u0022/g, '\\u201D').replace(/\\u0027/g, '\\u2019').replace(/\\u00A5/g, '\\uFFE5').replace(/[!#-&(),-9\\u003C-?A-[\\u005D_a-{}~]/g, alphaNum);\n }\n \n function alphaNum (token) {\n return fromCharCode(token.charCodeAt(0) + 65248);\n }\n \n return toZenkaku;\n})(String, String.fromCharCode);","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /今日|当日|昨日|明日|今夜|今夕|今晩|今朝/i;\n\nexports.Parser = function JPCasualDateParser(){\n \n Parser.apply(this, arguments);\n \n this.pattern = function() { return PATTERN; }\n \n this.extract = function(text, ref, match, opt){ \n \n var index = match.index;\n var text = match[0];\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var refMoment = dayjs(ref);\n var startMoment = refMoment;\n\n if(text == '今夜' || text == '今夕' || text == '今晩'){\n // Normally means this coming midnight \n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n\n } else if(text == '明日'){\n\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 4) {\n startMoment = startMoment.add(1, 'day');\n }\n\n } else if(text == '昨日') {\n\n startMoment = startMoment.add(-1, 'day');\n\n } else if (text.match(\"今朝\")) {\n\n result.start.imply('hour', 6);\n result.start.imply('meridiem', 0);\n }\n\n result.start.assign('day', startMoment.date())\n result.start.assign('month', startMoment.month() + 1)\n result.start.assign('year', startMoment.year())\n result.tags['JPCasualDateParser'] = true;\n return result;\n }\n}\n\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\n/*\n Valid patterns:\n - esta manhã -> today in the morning\n - esta tarde -> today in the afternoon/evening\n - esta noite -> tonight\n - ontem de -> yesterday in the morning\n - ontem a tarde -> yesterday in the afternoon/evening\n - ontem a noite -> yesterday at night\n - amanhã de manhã -> tomorrow in the morning\n - amanhã a tarde -> tomorrow in the afternoon/evening\n - amanhã a noite -> tomorrow at night\n - hoje -> today\n - ontem -> yesterday\n - amanhã -> tomorrow\n */\nvar PATTERN = /(\\W|^)(agora|esta\\s*(manhã|tarde|noite)|(ontem|amanhã)\\s*(de|à)\\s*(manhã|tarde|noite)|hoje|amanhã|ontem|noite)(?=\\W|$)/i;\n\nexports.Parser = function PTCasualDateParser(){\n\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var refMoment = dayjs(ref);\n var startMoment = refMoment;\n var lowerText = text.toLowerCase().replace(/\\s+/g, ' ');\n\n if(lowerText == 'amanhã'){\n\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n\n } else if(lowerText == 'ontem') {\n\n startMoment = startMoment.add(-1, 'day');\n }\n else if(lowerText == 'noite') {\n\n result.start.imply('hour', 0);\n if (refMoment.hour() > 6) {\n startMoment = startMoment.add(-1, 'day');\n }\n\n } else if (lowerText.match(\"esta\")) {\n\n var secondMatch = match[3].toLowerCase();\n if (secondMatch == \"tarde\") {\n\n result.start.imply('hour', 18);\n\n } else if (secondMatch == \"manhã\") {\n\n result.start.imply('hour', 6);\n\n } else if (secondMatch == \"noite\") {\n\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n\n }\n } else if (lowerText.match(/de|à/)) {\n\n var firstMatch = match[4].toLowerCase();\n if (firstMatch === 'ontem') {\n\n startMoment = startMoment.add(-1, 'day');\n\n } else if (firstMatch === 'amanhã') {\n\n startMoment = startMoment.add(1, 'day');\n\n }\n\n var secondMatch = match[6].toLowerCase();\n if (secondMatch == \"tarde\") {\n\n result.start.imply('hour', 18);\n\n } else if (secondMatch == \"manhã\") {\n\n result.start.imply('hour', 9);\n\n } else if (secondMatch == \"noite\") {\n\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n\n }\n\n } else if (lowerText.match(\"agora\")) {\n\n result.start.imply('hour', refMoment.hour());\n result.start.imply('minute', refMoment.minute());\n result.start.imply('second', refMoment.second());\n result.start.imply('millisecond', refMoment.millisecond());\n\n }\n\n result.start.assign('day', startMoment.date())\n result.start.assign('month', startMoment.month() + 1)\n result.start.assign('year', startMoment.year())\n result.tags['PTCasualDateParser'] = true;\n return result;\n }\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)(dentro\\s*de|em|em*até)\\s*([0-9]+|mei[oa]|uma?)\\s*(minutos?|horas?|dias?)\\s*(?=(?:\\W|$))/i;\n\nexports.Parser = function PTDeadlineFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var index = match.index + match[1].length;\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var num = parseInt(match[3]);\n if (isNaN(num)) {\n if (match[3].match(/(meio|meia)/)) {\n num = 0.5;\n } else {\n num = 1;\n }\n }\n\n var date = dayjs(ref);\n if (match[4].match(/dia/)) {\n date = date.add(num, 'd');\n\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n return result;\n }\n\n\n if (match[4].match(/hora/)) {\n\n date = date.add(num, 'hour');\n\n } else if (match[4].match(/minuto/)) {\n\n date = date.add(num, 'minute');\n }\n\n result.start.imply('year', date.year());\n result.start.imply('month', date.month() + 1);\n result.start.imply('day', date.date());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.tags['PTDeadlineFormatParser'] = true;\n return result;\n };\n}\n","var parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar util = require('../../utils/PT');\n\nvar DAYS_OFFSET = util.WEEKDAY_OFFSET;\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:(domingo|segunda|segunda-feira|terça|terça-feira|quarta|quarta-feira|quinta|quinta-feira|sexta|sexta-feira|sábado|sabado|dom|seg|ter|qua|qui|sex|sab)\\\\s*,?\\\\s*)?' +\n '([0-9]{1,2})(?:º|ª|°)?' +\n '(?:\\\\s*(?:desde|de|\\\\-|\\\\–|ao?|\\\\s)\\\\s*([0-9]{1,2})(?:º|ª|°)?)?\\\\s*(?:de)?\\\\s*' +\n '(Jan(?:eiro|\\\\.)?|Fev(?:ereiro|\\\\.)?|Mar(?:ço|\\\\.)?|Abr(?:il|\\\\.)?|Mai(?:o|\\\\.)?|Jun(?:ho|\\\\.)?|Jul(?:ho|\\\\.)?|Ago(?:sto|\\\\.)?|Set(?:embro|\\\\.)?|Out(?:ubro|\\\\.)?|Nov(?:embro|\\\\.)?|Dez(?:embro|\\\\.)?)' +\n '(?:\\\\s*(?:de?)?(\\\\s*[0-9]{1,4}(?![^\\\\s]\\\\d))(\\\\s*[ad]\\\\.?\\\\s*c\\\\.?|a\\\\.?\\\\s*d\\\\.?)?)?' +\n '(?=\\\\W|$)', 'i'\n );\n\nvar WEEKDAY_GROUP = 2;\nvar DATE_GROUP = 3;\nvar DATE_TO_GROUP = 4;\nvar MONTH_NAME_GROUP = 5;\nvar YEAR_GROUP = 6;\nvar YEAR_BE_GROUP = 7;\n\nexports.Parser = function PTMonthNameLittleEndianParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n\n var day = match[DATE_GROUP];\n day = parseInt(day);\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n year = parseInt(year);\n\n if(match[YEAR_BE_GROUP]){\n if (/a\\.?\\s*c\\.?/i.test(match[YEAR_BE_GROUP])) {\n // antes de Cristo\n year = -year;\n }\n } else if (year < 100){\n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month);\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n // Weekday component\n if (match[WEEKDAY_GROUP]) {\n var weekday = match[WEEKDAY_GROUP];\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()]\n result.start.assign('weekday', weekday);\n }\n\n // Text can be 'range' value. Such as '12 - 13 January 2012'\n if (match[DATE_TO_GROUP]) {\n result.end = result.start.clone();\n result.end.assign('day', parseInt(match[DATE_TO_GROUP]));\n }\n\n result.tags['PTMonthNameLittleEndianParser'] = true;\n return result;\n };\n}\n","exports.WEEKDAY_OFFSET = {\n 'domingo': 0,\n 'dom': 0,\n 'segunda': 1,\n 'segunda-feira': 1,\n 'seg': 1,\n 'terça': 2,\n 'terca': 2,\n 'terça-feira': 2,\n 'terca-feira': 2,\n 'ter':2,\n 'quarta': 3,\n 'quarta-feira': 3,\n 'qua': 3,\n 'quinta': 4,\n 'quinta-feira': 4,\n 'qui': 4,\n 'sexta': 5,\n 'sexta-feira': 5,\n 'sex': 5,\n 'sábado': 6,\n 'sabado': 6,\n 'sab': 6,}\n \n exports.MONTH_OFFSET = {\n 'janeiro': 1,\n 'jan': 1,\n 'jan.': 1,\n 'fevereiro': 2,\n 'fev': 2,\n 'fev.': 2,\n 'março': 3,\n 'mar': 3,\n 'mar.': 3,\n 'abril': 4,\n 'abr': 4,\n 'abr.': 4,\n 'maio': 5,\n 'mai': 5,\n 'mai.': 5,\n 'junho': 6,\n 'jun': 6,\n 'jun.': 6,\n 'julho': 7,\n 'jul': 7,\n 'jul.': 7,\n 'agosto': 8,\n 'ago': 8,\n 'ago.': 8,\n 'setembro': 9,\n 'set': 9,\n 'set.': 9,\n 'outubro': 10,\n 'out': 10,\n 'out.': 10,\n 'novembro': 11,\n 'nov': 11,\n 'nov.': 11,\n 'dezembro': 12,\n 'dez': 12,\n 'dez.': 12,\n }","/*\n Date format with slash \"/\" (also \"-\" and \".\") between numbers\n - Martes 3/11/2015\n - 3/11/2015\n - 3/11\n*/\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:' +\n '((?:domingo|dom|segunda|segunda-feira|seg|terça|terça-feira|ter|quarta|quarta-feira|qua|quinta|quinta-feira|qui|sexta|sexta-feira|sex|s[áa]bado|sab))' +\n '\\\\s*\\\\,?\\\\s*' +\n ')?' +\n '([0-1]{0,1}[0-9]{1})[\\\\/\\\\.\\\\-]([0-3]{0,1}[0-9]{1})' +\n '(?:' +\n '[\\\\/\\\\.\\\\-]' +\n '([0-9]{4}\\s*\\,?\\s*|[0-9]{2}\\s*\\,?\\s*)' +\n ')?' +\n '(\\\\W|$)', 'i');\n\nvar DAYS_OFFSET = { 'domingo': 0, 'dom': 0, 'segunda': 1, 'segunda-feira': 1, 'seg': 1, 'terça': 2, 'terça-feira': 2, 'ter': 2, 'quarta': 3, 'quarta-feira': 3, 'qua': 3,\n 'quinta': 4, 'quinta-feira': 4, 'qui': 4, 'sexta': 5, 'sexta-feira': 5, 'sex': 5, 'sábado': 6, 'sabado': 6, 'sab': 6,}\n\n\nvar OPENNING_GROUP = 1;\nvar ENDING_GROUP = 6;\n\n// in Spanish we use day/month/year\nvar WEEKDAY_GROUP = 2;\nvar MONTH_GROUP = 4;\nvar DAY_GROUP = 3;\nvar YEAR_GROUP = 5;\n\nexports.Parser = function PTSlashDateFormatParser(argument) {\n Parser.apply(this, arguments);\n\n this.pattern = function () { return PATTERN; };\n this.extract = function(text, ref, match, opt){\n\n if(match[OPENNING_GROUP] == '/' || match[ENDING_GROUP] == '/') {\n // Long skip, if there is some overlapping like:\n // XX[/YY/ZZ]\n // [XX/YY/]ZZ\n match.index += match[0].length\n return;\n }\n\n var index = match.index + match[OPENNING_GROUP].length;\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length - match[ENDING_GROUP].length);\n\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n });\n\n if(text.match(/^\\d\\.\\d$/)) return;\n if(text.match(/^\\d\\.\\d{1,2}\\.\\d{1,2}$/)) return;\n\n // MM/dd -> OK\n // MM.dd -> NG\n if(!match[YEAR_GROUP] && match[0].indexOf('/') < 0) return;\n\n var date = null;\n var year = match[YEAR_GROUP] || dayjs(ref).year() + '';\n var month = match[MONTH_GROUP];\n var day = match[DAY_GROUP];\n\n month = parseInt(month);\n day = parseInt(day);\n year = parseInt(year);\n\n if(month < 1 || month > 12) {\n if(month > 12) {\n // dd/mm/yyyy date format if day looks like a month, and month\n // looks like a day.\n if (day >= 1 && day <= 12 && month >= 13 && month <= 31) {\n // unambiguous\n var tday = month;\n month = day;\n day = tday;\n }\n else {\n // both month and day are <= 12\n return null;\n }\n }\n }\n if(day < 1 || day > 31) return null;\n\n if(year < 100){\n if(year > 50){\n year = year + 1900;\n }else{\n year = year + 2000;\n }\n }\n\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n\n //Day of week\n if(match[WEEKDAY_GROUP]) {\n result.start.assign('weekday', DAYS_OFFSET[match[WEEKDAY_GROUP].toLowerCase()]);\n }\n\n result.tags['PTSlashDateFormatParser'] = true;\n return result;\n };\n};","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)há\\s*([0-9]+|mei[oa]|uma?)\\s*(minutos?|horas?|semanas?|dias?|mes(es)?|anos?)(?=(?:\\W|$))/i;\n\nexports.Parser = function PTTimeAgoFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return PATTERN;\n }\n\n this.extract = function(text, ref, match, opt){\n\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n let index = match.index + match[1].length;\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var num = parseInt(match[2]);\n if (isNaN(num)) {\n if (match[2].match(/mei/)) {\n num = 0.5;\n } else {\n num = 1;\n }\n }\n\n var date = dayjs(ref);\n\n if (match[3].match(/hora/) || match[3].match(/minuto/)) {\n if (match[3].match(/hora/)) {\n\n date = date.add(-num, 'hour');\n\n } else if (match[3].match(/minuto/)) {\n\n date = date.add(-num, 'minute');\n }\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.tags['PTTimeAgoFormatParser'] = true;\n return result;\n }\n\n if (match[3].match(/semana/)) {\n date = date.add(-num, 'week');\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n result.start.imply('weekday', date.day());\n return result;\n }\n\n if (match[3].match(/dia/)) {\n date = date.add(-num, 'd');\n }\n\n if (match[3].match(/mes/)) {\n date = date.add(-num, 'month');\n }\n\n if (match[3].match(/ano/)) {\n\n date = date.add(-num, 'year');\n }\n\n result.start.assign('day', date.date());\n result.start.assign('month', date.month() + 1);\n result.start.assign('year', date.year());\n return result;\n\n };\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar ParsedComponents = require('../../result').ParsedComponents;\n\nvar FIRST_REG_PATTERN = new RegExp(\"(^|\\\\s|T)\" +\n \"(?:(?:ao?|às?|das|da|de|do)\\\\s*)?\" +\n \"(\\\\d{1,4}|meio-dia|meia-noite|meio dia|meia noite)\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\:|\\\\:)(\\\\d{2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\n \"(?=\\\\W|$)\", 'i');\n\n\nvar SECOND_REG_PATTERN = new RegExp(\"^\\\\s*\" +\n \"(\\\\-|\\\\–|\\\\~|\\\\〜|a(?:o)?|\\\\?)\\\\s*\" +\n \"(\\\\d{1,4})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\n \"(?=\\\\W|$)\", 'i');\n\nvar HOUR_GROUP = 2;\nvar MINUTE_GROUP = 3;\nvar SECOND_GROUP = 4;\nvar AM_PM_HOUR_GROUP = 5;\n\nexports.Parser = function PTTimeExpressionParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return FIRST_REG_PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n // This pattern can be overlaped Ex. [12] AM, 1[2] AM\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n var refMoment = dayjs(ref);\n var result = new ParsedResult();\n result.ref = ref;\n result.index = match.index + match[1].length;\n result.text = match[0].substring(match[1].length);\n result.tags['PTTimeExpressionParser'] = true;\n\n result.start.imply('day', refMoment.date());\n result.start.imply('month', refMoment.month()+1);\n result.start.imply('year', refMoment.year());\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.start.assign('second', second);\n }\n\n // ----- Hours\n if (match[HOUR_GROUP].toLowerCase().match(/meio\\-di/)){\n meridiem = 1;\n hour = 12;\n } else if (match[HOUR_GROUP].toLowerCase() == \"meia-noite\") {\n meridiem = 0;\n hour = 0;\n } else {\n hour = parseInt(match[HOUR_GROUP]);\n }\n\n // ----- Minutes\n if(match[MINUTE_GROUP] != null){\n minute = parseInt(match[MINUTE_GROUP]);\n } else if(hour > 100) {\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if(match[AM_PM_HOUR_GROUP] != null) {\n if(hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if(ampm == \"a\"){\n meridiem = 0;\n if(hour == 12) hour = 0;\n }\n\n if(ampm == \"p\"){\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n }\n result.start.assign('hour', hour);\n result.start.assign('minute', minute);\n if (meridiem >= 0) {\n result.start.assign('meridiem', meridiem);\n }\n\n // ==============================================================\n // Extracting the 'to' chunk\n // ==============================================================\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n // Not accept number only result\n if (result.text.match(/^\\d+$/)) {\n return null;\n }\n return result;\n }\n\n\n\n // Pattern \"YY.YY -XXXX\" is more like timezone offset\n if (match[0].match(/^\\s*(\\+|\\-)\\s*\\d{3,4}$/)) {\n return result;\n }\n\n if(result.end == null){\n result.end = new ParsedComponents(null, result.start.date());\n }\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.end.assign('second', second);\n }\n\n hour = parseInt(match[2]);\n\n // ----- Minute\n if (match[MINUTE_GROUP]!= null) {\n\n minute = parseInt(match[MINUTE_GROUP]);\n if(minute >= 60) return result;\n\n } else if (hour > 100) {\n\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP] != null){\n\n if (hour > 12) return null;\n\n if(match[AM_PM_HOUR_GROUP][0].toLowerCase() == \"a\"){\n meridiem = 0;\n if(hour == 12) {\n hour = 0;\n if (!result.end.isCertain('day')) {\n result.end.imply('day', result.end.get('day') + 1);\n }\n }\n }\n\n if(match[AM_PM_HOUR_GROUP][0].toLowerCase() == \"p\"){\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n\n if (!result.start.isCertain('meridiem')) {\n if (meridiem == 0) {\n\n result.start.imply('meridiem', 0);\n\n if (result.start.get('hour') == 12) {\n result.start.assign('hour', 0);\n }\n\n } else {\n\n result.start.imply('meridiem', 1);\n\n if (result.start.get('hour') != 12) {\n result.start.assign('hour', result.start.get('hour') + 12);\n }\n }\n }\n\n } else if(hour >= 12) {\n meridiem = 1;\n }\n\n result.text = result.text + match[0];\n result.end.assign('hour', hour);\n result.end.assign('minute', minute);\n if (meridiem >= 0) {\n result.end.assign('meridiem', meridiem);\n }\n\n if (result.end.date().getTime() < result.start.date().getTime()) {\n result.end.imply('day', result.end.get('day') + 1)\n }\n\n return result;\n }\n}\n","var Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar updateParsedComponent = require('../en/ENWeekdayParser').updateParsedComponent;\n\nvar DAYS_OFFSET = { 'domingo': 0, 'dom': 0, 'segunda': 1, 'segunda-feira': 1, 'seg': 1, 'terça': 2, 'terça-feira': 2, 'ter': 2, 'quarta': 3, 'quarta-feira': 3, 'qua': 3,\n 'quinta': 4, 'quinta-feira': 4, 'qui': 4, 'sexta': 5, 'sexta-feira': 5, 'sex': 5, 'sábado': 6, 'sabado': 6, 'sab': 6,}\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:(?:\\\\,|\\\\(|\\\\()\\\\s*)?' +\n '(?:(este|esta|passado|pr[oó]ximo)\\\\s*)?' +\n '(' + Object.keys(DAYS_OFFSET).join('|') + ')' +\n '(?:\\\\s*(?:\\\\,|\\\\)|\\\\)))?' +\n '(?:\\\\s*(este|esta|passado|pr[óo]ximo)\\\\s*semana)?' +\n '(?=\\\\W|$)', 'i');\n\nvar PREFIX_GROUP = 2;\nvar WEEKDAY_GROUP = 3;\nvar POSTFIX_GROUP = 4;\n\nexports.Parser = function PTWeekdayParser() {\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n var index = match.index + match[1].length;\n var text = match[0].substr(match[1].length, match[0].length - match[1].length);\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();\n var offset = DAYS_OFFSET[dayOfWeek];\n if(offset === undefined) return null;\n\n var modifier = null;\n var prefix = match[PREFIX_GROUP];\n var postfix = match[POSTFIX_GROUP];\n if (prefix || postfix) {\n var norm = prefix || postfix;\n norm = norm.toLowerCase();\n\n if(norm == 'passado') {\n modifier = 'this';\n }\n else if(norm == 'próximo' || norm == 'proximo') {\n modifier = 'next';\n }\n else if(norm== 'este') {\n modifier = 'this';\n }\n }\n\n updateParsedComponent(result, ref, offset, modifier);\n result.tags['PTWeekdayParser'] = true;\n return result;\n }\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\n/*\n Valid patterns:\n - esta mañana -> today in the morning\n - esta tarde -> today in the afternoon/evening\n - esta noche -> tonight\n - ayer por la mañana -> yesterday in the morning\n - ayer por la tarde -> yesterday in the afternoon/evening\n - ayer por la noche -> yesterday at night\n - mañana por la mañana -> tomorrow in the morning\n - mañana por la tarde -> tomorrow in the afternoon/evening\n - mañana por la noche -> tomorrow at night\n - anoche -> tomorrow at night\n - hoy -> today\n - ayer -> yesterday\n - mañana -> tomorrow\n */\nvar PATTERN = /(\\W|^)(ahora|esta\\s*(mañana|tarde|noche)|(ayer|mañana)\\s*por\\s*la\\s*(mañana|tarde|noche)|hoy|mañana|ayer|anoche)(?=\\W|$)/i;\n\nexports.Parser = function ESCasualDateParser(){\n\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var refMoment = dayjs(ref);\n var startMoment = refMoment;\n var lowerText = text.toLowerCase().replace(/\\s+/g, ' ');\n\n if(lowerText == 'mañana'){\n\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n\n } else if(lowerText == 'ayer') {\n\n startMoment = startMoment.add(-1, 'day');\n }\n else if(lowerText == 'anoche') {\n\n result.start.imply('hour', 0);\n if (refMoment.hour() > 6) {\n startMoment = startMoment.add(-1, 'day');\n }\n\n } else if (lowerText.match(\"esta\")) {\n\n var secondMatch = match[3].toLowerCase();\n if (secondMatch == \"tarde\") {\n\n result.start.imply('hour', 18);\n\n } else if (secondMatch == \"mañana\") {\n\n result.start.imply('hour', 6);\n\n } else if (secondMatch == \"noche\") {\n\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n\n }\n } else if (lowerText.match(/por\\s*la/)) {\n\n var firstMatch = match[4].toLowerCase();\n if (firstMatch === 'ayer') {\n\n startMoment = startMoment.add(-1, 'day');\n\n } else if (firstMatch === 'mañana') {\n\n startMoment = startMoment.add(1, 'day');\n\n }\n\n var secondMatch = match[5].toLowerCase();\n if (secondMatch == \"tarde\") {\n\n result.start.imply('hour', 18);\n\n } else if (secondMatch == \"mañana\") {\n\n result.start.imply('hour', 9);\n\n } else if (secondMatch == \"noche\") {\n\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n\n }\n\n } else if (lowerText.match(\"ahora\")) {\n\n result.start.imply('hour', refMoment.hour());\n result.start.imply('minute', refMoment.minute());\n result.start.imply('second', refMoment.second());\n result.start.imply('millisecond', refMoment.millisecond());\n\n }\n\n result.start.assign('day', startMoment.date())\n result.start.assign('month', startMoment.month() + 1)\n result.start.assign('year', startMoment.year())\n result.tags['ESCasualDateParser'] = true;\n return result;\n }\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)(dentro\\s*de|en)\\s*([0-9]+|medi[oa]|una?)\\s*(minutos?|horas?|d[ií]as?)\\s*(?=(?:\\W|$))/i;\n\nexports.Parser = function ESDeadlineFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var index = match.index + match[1].length;\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var num = parseInt(match[3]);\n if (isNaN(num)) {\n if (match[3].match(/medi/)) {\n num = 0.5;\n } else {\n num = 1;\n }\n }\n\n var date = dayjs(ref);\n if (match[4].match(/d[ií]a/)) {\n date = date.add(num, 'd');\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n return result;\n }\n\n\n if (match[4].match(/hora/)) {\n\n date = date.add(num, 'hour');\n\n } else if (match[4].match(/minuto/)) {\n\n date = date.add(num, 'minute');\n }\n\n result.start.imply('year', date.year());\n result.start.imply('month', date.month() + 1);\n result.start.imply('day', date.date());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.tags['ESDeadlineFormatParser'] = true;\n return result;\n };\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)hace\\s*([0-9]+|medi[oa]|una?)\\s*(minutos?|horas?|semanas?|d[ií]as?|mes(es)?|años?)(?=(?:\\W|$))/i;\n\nexports.Parser = function ESTimeAgoFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return PATTERN;\n }\n\n this.extract = function(text, ref, match, opt){\n\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n let index = match.index + match[1].length;\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var num = parseInt(match[2]);\n if (isNaN(num)) {\n if (match[2].match(/medi/)) {\n num = 0.5;\n } else {\n num = 1;\n }\n }\n\n var date = dayjs(ref);\n\n if (match[3].match(/hora/) || match[3].match(/minuto/)) {\n if (match[3].match(/hora/)) {\n\n date = date.add(-num, 'hour');\n\n } else if (match[3].match(/minuto/)) {\n\n date = date.add(-num, 'minute');\n }\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.tags['ESTimeAgoFormatParser'] = true;\n return result;\n }\n\n if (match[3].match(/semana/)) {\n date = date.add(-num, 'week');\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n result.start.imply('weekday', date.day());\n return result;\n }\n\n if (match[3].match(/d[ií]a/)) {\n date = date.add(-num, 'd');\n }\n\n if (match[3].match(/mes/)) {\n date = date.add(-num, 'month');\n }\n\n if (match[3].match(/año/)) {\n\n date = date.add(-num, 'year');\n }\n\n result.start.assign('day', date.date());\n result.start.assign('month', date.month() + 1);\n result.start.assign('year', date.year());\n return result;\n\n };\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar ParsedComponents = require('../../result').ParsedComponents;\n\nvar FIRST_REG_PATTERN = new RegExp(\"(^|\\\\s|T)\" +\n \"(?:(?:a las?|al?|desde|de)\\\\s*)?\" +\n \"(\\\\d{1,4}|mediod[ií]a|medianoche)\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\:|\\\\:)(\\\\d{2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\n \"(?=\\\\W|$)\", 'i');\n\n\nvar SECOND_REG_PATTERN = new RegExp(\"^\\\\s*\" +\n \"(\\\\-|\\\\–|\\\\~|\\\\〜|a(?:\\s*las)?|\\\\?)\\\\s*\" +\n \"(\\\\d{1,4})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\n \"(?=\\\\W|$)\", 'i');\n\nvar HOUR_GROUP = 2;\nvar MINUTE_GROUP = 3;\nvar SECOND_GROUP = 4;\nvar AM_PM_HOUR_GROUP = 5;\n\nexports.Parser = function ESTimeExpressionParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return FIRST_REG_PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n // This pattern can be overlaped Ex. [12] AM, 1[2] AM\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n var refMoment = dayjs(ref);\n var result = new ParsedResult();\n result.ref = ref;\n result.index = match.index + match[1].length;\n result.text = match[0].substring(match[1].length);\n result.tags['ESTimeExpressionParser'] = true;\n\n result.start.imply('day', refMoment.date());\n result.start.imply('month', refMoment.month()+1);\n result.start.imply('year', refMoment.year());\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.start.assign('second', second);\n }\n\n // ----- Hours\n if (match[HOUR_GROUP].toLowerCase().match(/mediod/)){\n meridiem = 1;\n hour = 12;\n } else if (match[HOUR_GROUP].toLowerCase() == \"medianoche\") {\n meridiem = 0;\n hour = 0;\n } else {\n hour = parseInt(match[HOUR_GROUP]);\n }\n\n // ----- Minutes\n if(match[MINUTE_GROUP] != null){\n minute = parseInt(match[MINUTE_GROUP]);\n } else if(hour > 100) {\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if(match[AM_PM_HOUR_GROUP] != null) {\n if(hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if(ampm == \"a\"){\n meridiem = 0;\n if(hour == 12) hour = 0;\n }\n\n if(ampm == \"p\"){\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n }\n result.start.assign('hour', hour);\n result.start.assign('minute', minute);\n if (meridiem >= 0) {\n result.start.assign('meridiem', meridiem);\n }\n\n // ==============================================================\n // Extracting the 'to' chunk\n // ==============================================================\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n // Not accept number only result\n if (result.text.match(/^\\d+$/)) {\n return null;\n }\n return result;\n }\n\n\n\n // Pattern \"YY.YY -XXXX\" is more like timezone offset\n if (match[0].match(/^\\s*(\\+|\\-)\\s*\\d{3,4}$/)) {\n return result;\n }\n\n if(result.end == null){\n result.end = new ParsedComponents(null, result.start.date());\n }\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.end.assign('second', second);\n }\n\n hour = parseInt(match[2]);\n\n // ----- Minute\n if (match[MINUTE_GROUP]!= null) {\n\n minute = parseInt(match[MINUTE_GROUP]);\n if(minute >= 60) return result;\n\n } else if (hour > 100) {\n\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP] != null){\n\n if (hour > 12) return null;\n\n if(match[AM_PM_HOUR_GROUP][0].toLowerCase() == \"a\"){\n meridiem = 0;\n if(hour == 12) {\n hour = 0;\n if (!result.end.isCertain('day')) {\n result.end.imply('day', result.end.get('day') + 1);\n }\n }\n }\n\n if(match[AM_PM_HOUR_GROUP][0].toLowerCase() == \"p\"){\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n\n if (!result.start.isCertain('meridiem')) {\n if (meridiem == 0) {\n\n result.start.imply('meridiem', 0);\n\n if (result.start.get('hour') == 12) {\n result.start.assign('hour', 0);\n }\n\n } else {\n\n result.start.imply('meridiem', 1);\n\n if (result.start.get('hour') != 12) {\n result.start.assign('hour', result.start.get('hour') + 12);\n }\n }\n }\n\n } else if(hour >= 12) {\n meridiem = 1;\n }\n\n result.text = result.text + match[0];\n result.end.assign('hour', hour);\n result.end.assign('minute', minute);\n if (meridiem >= 0) {\n result.end.assign('meridiem', meridiem);\n }\n\n if (result.end.date().getTime() < result.start.date().getTime()) {\n result.end.imply('day', result.end.get('day') + 1)\n }\n\n return result;\n }\n}\n","var Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar updateParsedComponent = require('../en/ENWeekdayParser').updateParsedComponent;\n\nvar DAYS_OFFSET = { 'domingo': 0, 'dom': 0, 'lunes': 1, 'lun': 1, 'martes': 2, 'mar':2, 'miercoles': 3, 'miércoles': 3, 'mie': 3,\n 'jueves': 4, 'jue': 4, 'viernes': 5, 'vier': 5, 'sabado': 6, 'sábado': 6, 'sab': 6,}\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:(?:\\\\,|\\\\(|\\\\()\\\\s*)?' +\n '(?:(este|pasado|pr[oó]ximo)\\\\s*)?' +\n '(' + Object.keys(DAYS_OFFSET).join('|') + ')' +\n '(?:\\\\s*(?:\\\\,|\\\\)|\\\\)))?' +\n '(?:\\\\s*(este|pasado|pr[óo]ximo)\\\\s*week)?' +\n '(?=\\\\W|$)', 'i');\n\nvar PREFIX_GROUP = 2;\nvar WEEKDAY_GROUP = 3;\nvar POSTFIX_GROUP = 4;\n\nexports.Parser = function ESWeekdayParser() {\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n var index = match.index + match[1].length;\n var text = match[0].substr(match[1].length, match[0].length - match[1].length);\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();\n var offset = DAYS_OFFSET[dayOfWeek];\n if(offset === undefined) return null;\n\n var modifier = null;\n var prefix = match[PREFIX_GROUP];\n var postfix = match[POSTFIX_GROUP];\n if (prefix || postfix) {\n var norm = prefix || postfix;\n norm = norm.toLowerCase();\n\n if(norm == 'pasado') {\n modifier = 'this';\n }\n else if(norm == 'próximo' || norm == 'proximo') {\n modifier = 'next';\n }\n else if(norm== 'este') {\n modifier = 'this';\n }\n }\n\n updateParsedComponent(result, ref, offset, modifier);\n result.tags['ESWeekdayParser'] = true;\n return result;\n }\n}\n","var parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar util = require('../../utils/ES');\n\nvar DAYS_OFFSET = util.WEEKDAY_OFFSET;\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:(Domingo|Lunes|Martes|Miércoles|Miercoles|Jueves|Viernes|Sábado|Sabado|Dom|Lun|Mar|Mie|Jue|Vie|Sab)\\\\s*,?\\\\s*)?' +\n '([0-9]{1,2})(?:º|ª|°)?' +\n '(?:\\\\s*(?:desde|de|\\\\-|\\\\–|al?|hasta|\\\\s)\\\\s*([0-9]{1,2})(?:º|ª|°)?)?\\\\s*(?:de)?\\\\s*' +\n '(Ene(?:ro|\\\\.)?|Feb(?:rero|\\\\.)?|Mar(?:zo|\\\\.)?|Abr(?:il|\\\\.)?|May(?:o|\\\\.)?|Jun(?:io|\\\\.)?|Jul(?:io|\\\\.)?|Ago(?:sto|\\\\.)?|Sep(?:tiembre|\\\\.)?|Set(?:iembre|\\\\.)?|Oct(?:ubre|\\\\.)?|Nov(?:iembre|\\\\.)?|Dic(?:iembre|\\\\.)?)' +\n '(?:\\\\s*(?:del?)?(\\\\s*[0-9]{1,4}(?![^\\\\s]\\\\d))(\\\\s*[ad]\\\\.?\\\\s*c\\\\.?|a\\\\.?\\\\s*d\\\\.?)?)?' +\n '(?=\\\\W|$)', 'i'\n );\n\nvar WEEKDAY_GROUP = 2;\nvar DATE_GROUP = 3;\nvar DATE_TO_GROUP = 4;\nvar MONTH_NAME_GROUP = 5;\nvar YEAR_GROUP = 6;\nvar YEAR_BE_GROUP = 7;\n\nexports.Parser = function ESMonthNameLittleEndianParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n\n var day = match[DATE_GROUP];\n day = parseInt(day);\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n year = parseInt(year);\n\n if(match[YEAR_BE_GROUP]){\n if (/a\\.?\\s*c\\.?/i.test(match[YEAR_BE_GROUP])) {\n // antes de Cristo\n year = -year;\n }\n } else if (year < 100){\n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month);\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n // Weekday component\n if (match[WEEKDAY_GROUP]) {\n var weekday = match[WEEKDAY_GROUP];\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()]\n result.start.assign('weekday', weekday);\n }\n\n // Text can be 'range' value. Such as '12 - 13 January 2012'\n if (match[DATE_TO_GROUP]) {\n result.end = result.start.clone();\n result.end.assign('day', parseInt(match[DATE_TO_GROUP]));\n }\n\n result.tags['ESMonthNameLittleEndianParser'] = true;\n return result;\n };\n}\n","exports.WEEKDAY_OFFSET = {\n 'domingo': 0,\n 'dom': 0,\n 'lunes': 1,\n 'lun': 1,\n 'martes': 2,\n 'mar':2,\n 'miércoles': 3,\n 'miercoles': 3,\n 'mie': 3,\n 'jueves': 4,\n 'jue': 4,\n 'viernes': 5,\n 'vie': 5,\n 'sábado': 6,\n 'sabado': 6,\n 'sab': 6,}\n\nexports.MONTH_OFFSET = {\n 'enero': 1,\n 'ene': 1,\n 'ene.': 1,\n 'febrero': 2,\n 'feb': 2,\n 'feb.': 2,\n 'marzo': 3,\n 'mar': 3,\n 'mar.': 3,\n 'abril': 4,\n 'abr': 4,\n 'abr.': 4,\n 'mayo': 5,\n 'may': 5,\n 'may.': 5,\n 'junio': 6,\n 'jun': 6,\n 'jun.': 6,\n 'julio': 7,\n 'jul': 7,\n 'jul.': 7,\n 'agosto': 8,\n 'ago': 8,\n 'ago.': 8,\n 'septiembre': 9,\n 'sep': 9,\n 'sept': 9,\n 'sep.': 9,\n 'sept.': 9,\n 'octubre': 10,\n 'oct': 10,\n 'oct.': 10,\n 'noviembre': 11,\n 'nov': 11,\n 'nov.': 11,\n 'diciembre': 12,\n 'dic': 12,\n 'dic.': 12,\n}\n","/*\n Date format with slash \"/\" (also \"-\" and \".\") between numbers\n - Martes 3/11/2015\n - 3/11/2015\n - 3/11\n*/\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:' +\n '((?:domingo|dom|lunes|lun|martes|mar|mi[ée]rcoles|mie|jueves|jue|viernes|vie|s[áa]bado|sab))' +\n '\\\\s*\\\\,?\\\\s*' +\n ')?' +\n '([0-1]{0,1}[0-9]{1})[\\\\/\\\\.\\\\-]([0-3]{0,1}[0-9]{1})' +\n '(?:' +\n '[\\\\/\\\\.\\\\-]' +\n '([0-9]{4}\\s*\\,?\\s*|[0-9]{2}\\s*\\,?\\s*)' +\n ')?' +\n '(\\\\W|$)', 'i');\n\nvar DAYS_OFFSET = { 'domingo': 0, 'dom': 0, 'lunes': 1, 'lun': 1, 'martes': 2, 'mar': 2, 'miercoles': 3, 'miércoles': 3, 'mie': 3,\n 'jueves': 4, 'jue': 4, 'viernes': 5, 'vier': 5, 'sábado': 6, 'sabado': 6, 'sab': 6,}\n\n\nvar OPENNING_GROUP = 1;\nvar ENDING_GROUP = 6;\n\n// in Spanish we use day/month/year\nvar WEEKDAY_GROUP = 2;\nvar MONTH_GROUP = 4;\nvar DAY_GROUP = 3;\nvar YEAR_GROUP = 5;\n\nexports.Parser = function ESSlashDateFormatParser(argument) {\n Parser.apply(this, arguments);\n\n this.pattern = function () { return PATTERN; };\n this.extract = function(text, ref, match, opt){\n\n if(match[OPENNING_GROUP] == '/' || match[ENDING_GROUP] == '/') {\n // Long skip, if there is some overlapping like:\n // XX[/YY/ZZ]\n // [XX/YY/]ZZ\n match.index += match[0].length\n return;\n }\n\n var index = match.index + match[OPENNING_GROUP].length;\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length - match[ENDING_GROUP].length);\n\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n });\n\n if(text.match(/^\\d\\.\\d$/)) return;\n if(text.match(/^\\d\\.\\d{1,2}\\.\\d{1,2}$/)) return;\n\n // MM/dd -> OK\n // MM.dd -> NG\n if(!match[YEAR_GROUP] && match[0].indexOf('/') < 0) return;\n\n var date = null;\n var year = match[YEAR_GROUP] || dayjs(ref).year() + '';\n var month = match[MONTH_GROUP];\n var day = match[DAY_GROUP];\n\n month = parseInt(month);\n day = parseInt(day);\n year = parseInt(year);\n\n if(month < 1 || month > 12) {\n if(month > 12) {\n // dd/mm/yyyy date format if day looks like a month, and month\n // looks like a day.\n if (day >= 1 && day <= 12 && month >= 13 && month <= 31) {\n // unambiguous\n var tday = month;\n month = day;\n day = tday;\n }\n else {\n // both month and day are <= 12\n return null;\n }\n }\n }\n if(day < 1 || day > 31) return null;\n\n if(year < 100){\n if(year > 50){\n year = year + 1900;\n }else{\n year = year + 2000;\n }\n }\n\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n\n //Day of week\n if(match[WEEKDAY_GROUP]) {\n result.start.assign('weekday', DAYS_OFFSET[match[WEEKDAY_GROUP].toLowerCase()]);\n }\n\n result.tags['ESSlashDateFormatParser'] = true;\n return result;\n };\n};","const dayjs = require('dayjs');\r\nvar Parser = require('../parser').Parser;\r\nvar ParsedResult = require('../../result').ParsedResult;\r\n\r\nvar PATTERN = /(\\W|^)(maintenant|aujourd'hui|ajd|cette\\s*nuit|la\\s*veille|(demain|hier)(\\s*(matin|soir|aprem|après-midi))?|ce\\s*(matin|soir)|cet\\s*(après-midi|aprem))(?=\\W|$)/i;\r\n\r\nexports.Parser = function FRCasualDateParser(){\r\n\r\n Parser.apply(this, arguments);\r\n\r\n this.pattern = function() { return PATTERN; }\r\n\r\n this.extract = function(text, ref, match, opt){\r\n\r\n var text = match[0].substr(match[1].length);\r\n var index = match.index + match[1].length;\r\n var result = new ParsedResult({\r\n index: index,\r\n text: text,\r\n ref: ref,\r\n });\r\n\r\n var refMoment = dayjs(ref);\r\n var startMoment = refMoment;\r\n var lowerText = text.toLowerCase();\r\n\r\n if(lowerText.match(/demain/)){\r\n // Check not \"Tomorrow\" on late night\r\n if(refMoment.hour() > 1) {\r\n startMoment = startMoment.add(1, 'day');\r\n }\r\n } \r\n\r\n if(lowerText.match(/hier/)) {\r\n startMoment = startMoment.add(-1, 'day');\r\n }\r\n\r\n if(lowerText.match(/cette\\s*nuit/)){\r\n // Normally means this coming midnight\r\n result.start.imply('hour', 22);\r\n result.start.imply('meridiem', 1);\r\n\r\n } else if(lowerText.match(/la\\s*veille/)) {\r\n\r\n result.start.imply('hour', 0);\r\n if (refMoment.hour() > 6) {\r\n startMoment = startMoment.add(-1, 'day');\r\n }\r\n\r\n } else if (lowerText.match(/(après-midi|aprem)/)) {\r\n\r\n result.start.imply('hour', 14);\r\n\r\n } else if (lowerText.match(/(soir)/)) {\r\n\r\n result.start.imply('hour', 18);\r\n\r\n } else if (lowerText.match(/matin/)) {\r\n\r\n result.start.imply('hour', 8);\r\n\r\n } else if (lowerText.match(\"maintenant\")) {\r\n\r\n result.start.imply('hour', refMoment.hour());\r\n result.start.imply('minute', refMoment.minute());\r\n result.start.imply('second', refMoment.second());\r\n result.start.imply('millisecond', refMoment.millisecond());\r\n\r\n }\r\n\r\n result.start.assign('day', startMoment.date())\r\n result.start.assign('month', startMoment.month() + 1)\r\n result.start.assign('year', startMoment.year())\r\n result.tags['FRCasualDateParser'] = true;\r\n return result;\r\n }\r\n}\r\n","const dayjs = require('dayjs');\r\nvar Parser = require('../parser').Parser;\r\nvar ParsedResult = require('../../result').ParsedResult;\r\nvar util = require('../../utils/FR');\r\n\r\nvar PATTERN = new RegExp('(\\\\W|^)' +\r\n '(dans|en)\\\\s*' +\r\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|une?|(?:\\\\s*quelques)?|demi(?:\\\\s*|-?)?)\\\\s*' +\r\n '(secondes?|min(?:ute)?s?|heures?|jours?|semaines?|mois|années?)\\\\s*' +\r\n '(?=\\\\W|$)', 'i'\r\n);\r\n\r\nvar STRICT_PATTERN = new RegExp('(\\\\W|^)' +\r\n '(dans|en)\\\\s*' +\r\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|un?)\\\\s*' +\r\n '(secondes?|minutes?|heures?|jours?)\\\\s*' +\r\n '(?=\\\\W|$)', 'i'\r\n);\r\n\r\nexports.Parser = function FRDeadlineFormatParser(){\r\n Parser.apply(this, arguments);\r\n\r\n this.pattern = function() {\r\n return this.isStrictMode()? STRICT_PATTERN : PATTERN;\r\n };\r\n\r\n this.extract = function(text, ref, match, opt){\r\n\r\n var index = match.index + match[1].length;\r\n var text = match[0];\r\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\r\n\r\n var result = new ParsedResult({\r\n index: index,\r\n text: text,\r\n ref: ref\r\n });\r\n\r\n var num = match[3];\r\n if (util.INTEGER_WORDS[num] !== undefined) {\r\n num = util.INTEGER_WORDS[num];\r\n } else if (num === 'un' || num === 'une'){\r\n num = 1;\r\n } else if (num.match(/quelques?/i)){\r\n num = 3;\r\n } else if (num.match(/demi-?/i)) {\r\n num = 0.5;\r\n } else {\r\n num = parseInt(num);\r\n }\r\n\r\n var date = dayjs(ref);\r\n if (match[4].match(/jour|semaine|mois|année/i)) {\r\n\r\n if (match[4].match(/jour/)) {\r\n date = date.add(num, 'd');\r\n } else if (match[4].match(/semaine/i)) {\r\n date = date.add(num * 7, 'd');\r\n } else if (match[4].match(/mois/i)) {\r\n date = date.add(num, 'month');\r\n } else if (match[4].match(/année/i)) {\r\n date = date.add(num, 'year');\r\n }\r\n\r\n result.start.assign('year', date.year());\r\n result.start.assign('month', date.month() + 1);\r\n result.start.assign('day', date.date());\r\n return result;\r\n }\r\n\r\n if (match[4].match(/heure/i)) {\r\n\r\n date = date.add(num, 'hour');\r\n\r\n } else if (match[4].match(/min/i)) {\r\n\r\n date = date.add(num, 'minutes');\r\n\r\n } else if (match[4].match(/secondes/i)) {\r\n\r\n date = date.add(num, 'second');\r\n }\r\n\r\n result.start.imply('year', date.year());\r\n result.start.imply('month', date.month() + 1);\r\n result.start.imply('day', date.date());\r\n result.start.assign('hour', date.hour());\r\n result.start.assign('minute', date.minute());\r\n result.start.assign('second', date.second());\r\n result.tags['FRDeadlineFormatParser'] = true;\r\n return result;\r\n };\r\n};\r\n","const parser = require('../parser');\r\nvar ParsedResult = require('../../result').ParsedResult;\r\n\r\nvar util = require('../../utils/FR');\r\n\r\nvar DAYS_OFFSET = util.WEEKDAY_OFFSET;\r\n\r\nvar PATTERN = new RegExp('(\\\\W|^)' +\r\n '(?:(Dimanche|Lundi|Mardi|mercredi|Jeudi|Vendredi|Samedi|Dim|Lun|Mar|Mer|Jeu|Ven|Sam)\\\\s*,?\\\\s*)?' +\r\n '([0-9]{1,2}|1er)' +\r\n '(?:\\\\s*(?:au|\\\\-|\\\\–|jusqu\\'au?|\\\\s)\\\\s*([0-9]{1,2})(?:er)?)?\\\\s*(?:de)?\\\\s*' +\r\n '(Jan(?:vier|\\\\.)?|F[ée]v(?:rier|\\\\.)?|Mars|Avr(?:il|\\\\.)?|Mai|Juin|Juil(?:let|\\\\.)?|Ao[uû]t|Sept(?:embre|\\\\.)?|Oct(?:obre|\\\\.)?|Nov(?:embre|\\\\.)?|d[ée]c(?:embre|\\\\.)?)' +\r\n '(?:\\\\s*(\\\\s*[0-9]{1,4}(?![^\\\\s]\\\\d))(?:\\\\s*(AC|[ap]\\\\.?\\\\s*c(?:h(?:r)?)?\\\\.?\\\\s*n\\\\.?))?)?' +\r\n '(?=\\\\W|$)', 'i'\r\n );\r\n\r\nvar WEEKDAY_GROUP = 2;\r\nvar DATE_GROUP = 3;\r\nvar DATE_TO_GROUP = 4;\r\nvar MONTH_NAME_GROUP = 5;\r\nvar YEAR_GROUP = 6;\r\nvar YEAR_BE_GROUP = 7;\r\n\r\nexports.Parser = function FRMonthNameLittleEndianParser(){\r\n parser.Parser.apply(this, arguments);\r\n\r\n this.pattern = function() { return PATTERN; }\r\n\r\n this.extract = function(text, ref, match, opt){\r\n\r\n var result = new ParsedResult({\r\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\r\n index: match.index + match[1].length,\r\n ref: ref,\r\n });\r\n\r\n var month = match[MONTH_NAME_GROUP];\r\n month = util.MONTH_OFFSET[month.toLowerCase()];\r\n\r\n var day = match[DATE_GROUP];\r\n day = parseInt(day);\r\n\r\n var year = null;\r\n if (match[YEAR_GROUP]) {\r\n year = match[YEAR_GROUP];\r\n year = parseInt(year);\r\n\r\n if(match[YEAR_BE_GROUP]){\r\n if (/a/i.test(match[YEAR_BE_GROUP])) {\r\n // Ante Christe natum\r\n year = -year;\r\n }\r\n } else if (year < 100){\r\n\r\n year = year + 2000;\r\n }\r\n }\r\n\r\n if(year){\r\n result.start.assign('day', day);\r\n result.start.assign('month', month);\r\n result.start.assign('year', year);\r\n } else {\r\n year = parser.findYearClosestToRef(ref, day, month)\r\n result.start.assign('day', day);\r\n result.start.assign('month', month);\r\n result.start.imply('year', year);\r\n }\r\n\r\n // Weekday component\r\n if (match[WEEKDAY_GROUP]) {\r\n var weekday = match[WEEKDAY_GROUP];\r\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()]\r\n result.start.assign('weekday', weekday);\r\n }\r\n\r\n // Text can be 'range' value. Such as '12 - 13 janvier 2012'\r\n if (match[DATE_TO_GROUP]) {\r\n result.end = result.start.clone();\r\n result.end.assign('day', parseInt(match[DATE_TO_GROUP]));\r\n }\r\n\r\n result.tags['FRMonthNameLittleEndianParser'] = true;\r\n return result;\r\n };\r\n}\r\n","/*\r\n Date format with slash \"/\" (also \"-\" and \".\") between numbers\r\n - Martes 3/11/2015\r\n - 3/11/2015\r\n - 3/11\r\n*/\r\nvar parser = require('../parser');\r\nvar ParsedResult = require('../../result').ParsedResult;\r\n\r\nvar PATTERN = new RegExp('(\\\\W|^)' +\r\n '(?:' +\r\n '((?:dimanche|dim|lundi|lun|mardi|mar|mercredi|mer|jeudi|jeu|vendredi|ven|samedi|sam|le))' +\r\n '\\\\s*\\\\,?\\\\s*' +\r\n ')?' +\r\n '([0-3]{0,1}[0-9]{1})[\\\\/\\\\.\\\\-]([0-3]{0,1}[0-9]{1})' +\r\n '(?:' +\r\n '[\\\\/\\\\.\\\\-]' +\r\n '([0-9]{4}\\s*\\,?\\s*|[0-9]{2}\\s*\\,?\\s*)' +\r\n ')?' +\r\n '(\\\\W|$)', 'i');\r\n\r\nvar DAYS_OFFSET = { 'dimanche': 0, 'dim': 0, 'lundi': 1, 'lun': 1,'mardi': 2, 'mar':2, 'mercredi': 3, 'mer': 3,\r\n 'jeudi': 4, 'jeu':4, 'vendredi': 5, 'ven': 5,'samedi': 6, 'sam': 6};\r\n\r\n\r\nvar OPENNING_GROUP = 1;\r\nvar ENDING_GROUP = 6;\r\n\r\n// In French we use day/month/year\r\nvar WEEKDAY_GROUP = 2;\r\nvar DAY_GROUP = 3;\r\nvar MONTH_GROUP = 4;\r\nvar YEAR_GROUP = 5;\r\n\r\nexports.Parser = function FRSlashDateFormatParser(argument) {\r\n parser.Parser.apply(this, arguments);\r\n\r\n this.pattern = function () { return PATTERN; };\r\n this.extract = function(text, ref, match, opt){\r\n\r\n if(match[OPENNING_GROUP] == '/' || match[ENDING_GROUP] == '/') {\r\n // Long skip, if there is some overlapping like:\r\n // XX[/YY/ZZ]\r\n // [XX/YY/]ZZ\r\n match.index += match[0].length\r\n return;\r\n }\r\n\r\n var index = match.index + match[OPENNING_GROUP].length;\r\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length - match[ENDING_GROUP].length);\r\n\r\n\r\n var result = new ParsedResult({\r\n text: text,\r\n index: index,\r\n ref: ref,\r\n });\r\n\r\n if(text.match(/^\\d\\.\\d$/)) return;\r\n if(text.match(/^\\d\\.\\d{1,2}\\.\\d{1,2}$/)) return;\r\n\r\n // MM/dd -> OK\r\n // MM.dd -> NG\r\n if(!match[YEAR_GROUP] && match[0].indexOf('/') < 0) return;\r\n\r\n var date = null;\r\n var month = match[MONTH_GROUP];\r\n var day = match[DAY_GROUP];\r\n\r\n day = parseInt(day);\r\n month = parseInt(month);\r\n\r\n var year = null;\r\n if (match[YEAR_GROUP]) {\r\n year = match[YEAR_GROUP];\r\n year = parseInt(year);\r\n\r\n if (year < 100){\r\n year = year + 2000;\r\n }\r\n }\r\n\r\n if(month < 1 || month > 12) {\r\n if(month > 12) {\r\n // dd/mm/yyyy date format if day looks like a month, and month looks like a day.\r\n if (day >= 1 && day <= 12 && month >= 13 && month <= 31) {\r\n // unambiguous\r\n var tday = month;\r\n month = day;\r\n day = tday;\r\n }\r\n else {\r\n // both month and day are <= 12\r\n return null;\r\n }\r\n }\r\n }\r\n\r\n if(day < 1 || day > 31) return null;\r\n\r\n if(year){\r\n result.start.assign('day', day);\r\n result.start.assign('month', month);\r\n result.start.assign('year', year);\r\n } else {\r\n year = parser.findYearClosestToRef(ref, day, month)\r\n result.start.assign('day', day);\r\n result.start.assign('month', month);\r\n result.start.imply('year', year);\r\n }\r\n\r\n // Day of week\r\n if(match[WEEKDAY_GROUP]) {\r\n result.start.assign('weekday', DAYS_OFFSET[match[WEEKDAY_GROUP].toLowerCase()]);\r\n }\r\n\r\n result.tags['FRSlashDateFormatParser'] = true;\r\n return result;\r\n };\r\n};","const dayjs = require('dayjs');\r\nvar Parser = require('../parser').Parser;\r\nvar ParsedResult = require('../../result').ParsedResult;\r\n\r\nvar PATTERN = /(\\W|^)il y a\\s*([0-9]+|une?)\\s*(minutes?|heures?|semaines?|jours?|mois|années?|ans?)(?=(?:\\W|$))/i;\r\n\r\nexports.Parser = function FRTimeAgoFormatParser(){\r\n Parser.apply(this, arguments);\r\n\r\n this.pattern = function() {\r\n return PATTERN;\r\n }\r\n\r\n this.extract = function(text, ref, match, opt){\r\n\r\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\r\n\r\n var text = match[0];\r\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\r\n let index = match.index + match[1].length;\r\n\r\n var result = new ParsedResult({\r\n index: index,\r\n text: text,\r\n ref: ref,\r\n });\r\n result.tags['FRTimeAgoFormatParser'] = true;\r\n \r\n var num = parseInt(match[2]);\r\n if (isNaN(num)) {\r\n if (match[2].match(/demi/)) {\r\n num = 0.5;\r\n } else {\r\n num = 1;\r\n }\r\n }\r\n\r\n var date = dayjs(ref);\r\n\r\n if (match[3].match(/heure/) || match[3].match(/minute/)) {\r\n if (match[3].match(/heure/)) {\r\n\r\n date = date.add(-num, 'hour');\r\n\r\n } else if (match[3].match(/minute/)) {\r\n\r\n date = date.add(-num, 'minute');\r\n }\r\n\r\n result.start.imply('day', date.date());\r\n result.start.imply('month', date.month() + 1);\r\n result.start.imply('year', date.year());\r\n result.start.assign('hour', date.hour());\r\n result.start.assign('minute', date.minute());\r\n\r\n return result;\r\n }\r\n\r\n if (match[3].match(/semaine/)) {\r\n date = date.add(-num, 'week');\r\n\r\n result.start.imply('day', date.date());\r\n result.start.imply('month', date.month() + 1);\r\n result.start.imply('year', date.year());\r\n result.start.imply('weekday', date.day());\r\n return result;\r\n }\r\n\r\n if (match[3].match(/jour/)) {\r\n date = date.add(-num, 'd');\r\n }\r\n\r\n if (match[3].match(/mois/)) {\r\n date = date.add(-num, 'month');\r\n }\r\n\r\n if (match[3].match(/années?|ans?/)) {\r\n date = date.add(-num, 'year');\r\n }\r\n\r\n result.start.assign('day', date.date());\r\n result.start.assign('month', date.month() + 1);\r\n result.start.assign('year', date.year());\r\n return result;\r\n\r\n };\r\n}\r\n","const dayjs = require('dayjs');\r\nvar Parser = require('../parser').Parser;\r\nvar ParsedResult = require('../../result').ParsedResult;\r\nvar ParsedComponents = require('../../result').ParsedComponents;\r\n\r\nvar FIRST_REG_PATTERN = new RegExp(\"(^|\\\\s|T)\" +\r\n \"(?:(?:[àa])\\\\s*)?\" +\r\n \"(\\\\d{1,2}(?:h)?|midi|minuit)\" +\r\n \"(?:\" +\r\n \"(?:\\\\.|\\\\:|\\\\:|h)(\\\\d{1,2})(?:m)?\" +\r\n \"(?:\" +\r\n \"(?:\\\\:|\\\\:|m)(\\\\d{0,2})(?:s)?\" +\r\n \")?\" +\r\n \")?\" +\r\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\r\n \"(?=\\\\W|$)\", 'i');\r\n\r\n\r\nvar SECOND_REG_PATTERN = new RegExp(\"^\\\\s*\" +\r\n \"(\\\\-|\\\\–|\\\\~|\\\\〜|[àa]|\\\\?)\\\\s*\" +\r\n \"(\\\\d{1,2}(?:h)?)\" +\r\n \"(?:\" +\r\n \"(?:\\\\.|\\\\:|\\\\:|h)(\\\\d{1,2})(?:m)?\" +\r\n \"(?:\" +\r\n \"(?:\\\\.|\\\\:|\\\\:|m)(\\\\d{1,2})(?:s)?\" +\r\n \")?\" +\r\n \")?\" +\r\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\r\n \"(?=\\\\W|$)\", 'i');\r\n\r\nvar HOUR_GROUP = 2;\r\nvar MINUTE_GROUP = 3;\r\nvar SECOND_GROUP = 4;\r\nvar AM_PM_HOUR_GROUP = 5;\r\n\r\nexports.Parser = function FRTimeExpressionParser(){\r\n Parser.apply(this, arguments);\r\n\r\n this.pattern = function() { return FIRST_REG_PATTERN; }\r\n\r\n this.extract = function(text, ref, match, opt){\r\n\r\n // This pattern can be overlaped Ex. [12] AM, 1[2] AM\r\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\r\n var refMoment = dayjs(ref);\r\n var result = new ParsedResult();\r\n result.ref = ref;\r\n result.index = match.index + match[1].length;\r\n result.text = match[0].substring(match[1].length);\r\n result.tags['FRTimeExpressionParser'] = true;\r\n\r\n result.start.imply('day', refMoment.date());\r\n result.start.imply('month', refMoment.month()+1);\r\n result.start.imply('year', refMoment.year());\r\n\r\n var hour = 0;\r\n var minute = 0;\r\n var meridiem = -1;\r\n\r\n // ----- Second\r\n if(match[SECOND_GROUP] != null){\r\n var second = parseInt(match[SECOND_GROUP]);\r\n if(second >= 60) return null;\r\n\r\n result.start.assign('second', second);\r\n }\r\n\r\n // ----- Hours\r\n if (match[HOUR_GROUP].toLowerCase() == \"midi\"){\r\n meridiem = 1;\r\n hour = 12;\r\n } else if (match[HOUR_GROUP].toLowerCase() == \"minuit\") {\r\n meridiem = 0;\r\n hour = 0;\r\n } else {\r\n hour = parseInt(match[HOUR_GROUP]);\r\n }\r\n\r\n // ----- Minutes\r\n if(match[MINUTE_GROUP] != null){\r\n minute = parseInt(match[MINUTE_GROUP]);\r\n } else if(hour > 100) {\r\n minute = hour%100;\r\n hour = parseInt(hour/100);\r\n }\r\n\r\n if(minute >= 60) {\r\n return null;\r\n }\r\n\r\n if(hour > 24) {\r\n return null;\r\n }\r\n if (hour >= 12) {\r\n meridiem = 1;\r\n }\r\n\r\n // ----- AM & PM\r\n if(match[AM_PM_HOUR_GROUP] != null) {\r\n if(hour > 12) return null;\r\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\r\n if(ampm == \"a\"){\r\n meridiem = 0;\r\n if(hour == 12) hour = 0;\r\n }\r\n\r\n if(ampm == \"p\"){\r\n meridiem = 1;\r\n if(hour != 12) hour += 12;\r\n }\r\n }\r\n result.start.assign('hour', hour);\r\n result.start.assign('minute', minute);\r\n if (meridiem >= 0) {\r\n result.start.assign('meridiem', meridiem);\r\n }\r\n\r\n // ==============================================================\r\n // Extracting the 'to' chunk\r\n // ==============================================================\r\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\r\n if (!match) {\r\n // Not accept number only result\r\n if (result.text.match(/^\\d+$/)) {\r\n return null;\r\n }\r\n return result;\r\n }\r\n\r\n\r\n\r\n // Pattern \"YY.YY -XXXX\" is more like timezone offset\r\n if (match[0].match(/^\\s*(\\+|\\-)\\s*\\d{3,4}$/)) {\r\n return result;\r\n }\r\n\r\n if(result.end == null){\r\n result.end = new ParsedComponents(null, result.start.date());\r\n }\r\n\r\n var hour = 0;\r\n var minute = 0;\r\n var meridiem = -1;\r\n\r\n // ----- Second\r\n if(match[SECOND_GROUP] != null){\r\n var second = parseInt(match[SECOND_GROUP]);\r\n if(second >= 60) return null;\r\n\r\n result.end.assign('second', second);\r\n }\r\n\r\n hour = parseInt(match[2]);\r\n\r\n // ----- Minute\r\n if (match[MINUTE_GROUP]!= null) {\r\n\r\n minute = parseInt(match[MINUTE_GROUP]);\r\n if(minute >= 60) return result;\r\n\r\n } else if (hour > 100) {\r\n\r\n minute = hour%100;\r\n hour = parseInt(hour/100);\r\n }\r\n\r\n if(minute >= 60) {\r\n return null;\r\n }\r\n\r\n if(hour > 24) {\r\n return null;\r\n }\r\n if (hour >= 12) {\r\n meridiem = 1;\r\n }\r\n\r\n // ----- AM & PM\r\n if (match[AM_PM_HOUR_GROUP] != null){\r\n\r\n if (hour > 12) return null;\r\n\r\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\r\n if(ampm == \"a\"){\r\n meridiem = 0;\r\n if(hour == 12) {\r\n hour = 0;\r\n if (!result.end.isCertain('day')) {\r\n result.end.imply('day', result.end.get('day') + 1);\r\n }\r\n }\r\n }\r\n\r\n if(ampm == \"p\"){\r\n meridiem = 1;\r\n if(hour != 12) hour += 12;\r\n }\r\n\r\n if (!result.start.isCertain('meridiem')) {\r\n if (meridiem == 0) {\r\n\r\n result.start.imply('meridiem', 0);\r\n\r\n if (result.start.get('hour') == 12) {\r\n result.start.assign('hour', 0);\r\n }\r\n\r\n } else {\r\n\r\n result.start.imply('meridiem', 1);\r\n\r\n if (result.start.get('hour') != 12) {\r\n result.start.assign('hour', result.start.get('hour') + 12);\r\n }\r\n }\r\n }\r\n }\r\n\r\n result.text = result.text + match[0];\r\n result.end.assign('hour', hour);\r\n result.end.assign('minute', minute);\r\n if (meridiem >= 0) {\r\n result.end.assign('meridiem', meridiem);\r\n } else {\r\n var startAtPM = result.start.isCertain('meridiem') && result.start.get('meridiem') == 1;\r\n if (startAtPM && result.start.get('hour') > hour) {\r\n // 10pm - 1 (am)\r\n result.end.imply('meridiem', 0);\r\n\r\n } else if (hour > 12) {\r\n result.end.imply('meridiem', 1);\r\n }\r\n }\r\n\r\n if (result.end.date().getTime() < result.start.date().getTime()) {\r\n result.end.imply('day', result.end.get('day') + 1)\r\n }\r\n\r\n return result;\r\n }\r\n}\r\n","var Parser = require('../parser').Parser;\r\nvar ParsedResult = require('../../result').ParsedResult;\r\nvar updateParsedComponent = require('../en/ENWeekdayParser').updateParsedComponent;\r\n\r\nvar DAYS_OFFSET = { 'dimanche': 0, 'dim': 0, 'lundi': 1, 'lun': 1,'mardi': 2, 'mar':2, 'mercredi': 3, 'mer': 3,\r\n 'jeudi': 4, 'jeu':4, 'vendredi': 5, 'ven': 5,'samedi': 6, 'sam': 6};\r\n\r\nvar PATTERN = new RegExp('(\\\\s|^)' +\r\n '(?:(?:\\\\,|\\\\(|\\\\()\\\\s*)?' +\r\n '(?:(ce)\\\\s*)?' +\r\n '(' + Object.keys(DAYS_OFFSET).join('|') + ')' +\r\n '(?:\\\\s*(?:\\\\,|\\\\)|\\\\)))?' +\r\n '(?:\\\\s*(dernier|prochain)\\\\s*)?' +\r\n '(?=\\\\W|$)', 'i');\r\n\r\nvar PREFIX_GROUP = 2;\r\nvar WEEKDAY_GROUP = 3;\r\nvar POSTFIX_GROUP = 4;\r\n\r\nexports.Parser = function FRWeekdayParser() {\r\n Parser.apply(this, arguments);\r\n\r\n this.pattern = function() { return PATTERN; };\r\n\r\n this.extract = function(text, ref, match, opt){\r\n var index = match.index + match[1].length;\r\n var text = match[0].substr(match[1].length, match[0].length - match[1].length);\r\n var result = new ParsedResult({\r\n index: index,\r\n text: text,\r\n ref: ref\r\n });\r\n\r\n var dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();\r\n var offset = DAYS_OFFSET[dayOfWeek];\r\n if(offset === undefined) return null;\r\n\r\n var modifier = null;\r\n var prefix = match[PREFIX_GROUP];\r\n var postfix = match[POSTFIX_GROUP];\r\n if (prefix || postfix) {\r\n var norm = prefix || postfix;\r\n norm = norm.toLowerCase();\r\n\r\n if(norm == 'dernier') {\r\n modifier = 'last';\r\n } else if(norm == 'prochain') {\r\n modifier = 'next';\r\n } else if(norm== 'ce') {\r\n modifier = 'this';\r\n }\r\n }\r\n\r\n updateParsedComponent(result, ref, offset, modifier);\r\n result.tags['FRWeekdayParser'] = true;\r\n return result;\r\n }\r\n};\r\n\r\n","const quarterOfYear = require('dayjs/plugin/quarterOfYear');\nconst dayjs = require('dayjs');\ndayjs.extend(quarterOfYear);\n\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/FR');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:les?|la|l\\'|du|des?)\\\\s*' +\n '('+ util.INTEGER_WORDS_PATTERN + '|\\\\d+)?\\\\s*' +\n '(prochaine?s?|derni[eè]re?s?|pass[ée]e?s?|pr[ée]c[ée]dents?|suivante?s?)?\\\\s*' +\n '(secondes?|min(?:ute)?s?|heures?|jours?|semaines?|mois|trimestres?|années?)\\\\s*' +\n '(prochaine?s?|derni[eè]re?s?|pass[ée]e?s?|pr[ée]c[ée]dents?|suivante?s?)?' +\n '(?=\\\\W|$)', 'i'\n);\n\nvar MULTIPLIER_GROUP = 2;\nvar MODIFIER_1_GROUP = 3;\nvar RELATIVE_WORD_GROUP = 4;\nvar MODIFIER_2_GROUP = 5;\n\nexports.Parser = function FRRelativeDateFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; };\n\n this.extract = function(text, ref, match, opt){\n var index = match.index + match[1].length;\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n\n // Multiplier\n var multiplier = match[MULTIPLIER_GROUP] === undefined ? '1' : match[MULTIPLIER_GROUP];\n if (util.INTEGER_WORDS[multiplier] !== undefined) {\n multiplier = util.INTEGER_WORDS[multiplier];\n } else {\n multiplier = parseInt(multiplier);\n }\n\n // Modifier\n var modifier = match[MODIFIER_1_GROUP] === undefined ?\n (match[MODIFIER_2_GROUP] === undefined ? '' : match[MODIFIER_2_GROUP].toLowerCase())\n : match[MODIFIER_1_GROUP].toLowerCase();\n if(!modifier) {\n // At least one modifier is mandatory to match this parser\n return;\n }\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n result.tags['FRRelativeDateFormatParser'] = true;\n\n var modifierFactor;\n switch(true) {\n case /prochaine?s?/.test(modifier):\n case /suivants?/.test(modifier):\n modifierFactor = 1;\n break;\n case /derni[eè]re?s?/.test(modifier):\n case /pass[ée]e?s?/.test(modifier):\n case /pr[ée]c[ée]dents?/.test(modifier):\n modifierFactor = -1;\n break;\n }\n\n var total = multiplier * modifierFactor;\n\n var dateFrom = dayjs(ref);\n var dateTo = dayjs(ref);\n\n var relative = match[RELATIVE_WORD_GROUP];\n var startOf;\n switch(true) {\n case /secondes?/.test(relative):\n dateFrom = dateFrom.add(total, 's');\n dateTo = dateTo.add(modifierFactor, 's');\n startOf = 'second';\n break;\n case /min(?:ute)?s?/.test(relative):\n dateFrom = dateFrom.add(total, 'm');\n dateTo = dateTo.add(modifierFactor, 'm');\n startOf = 'minute';\n break;\n case /heures?/.test(relative):\n dateFrom = dateFrom.add(total, 'h');\n dateTo = dateTo.add(modifierFactor, 'h');\n startOf = 'hour';\n break;\n case /jours?/.test(relative):\n dateFrom = dateFrom.add(total, 'd');\n dateTo = dateTo.add(modifierFactor, 'd');\n startOf = 'day';\n break;\n case /semaines?/.test(relative):\n dateFrom = dateFrom.add(total, 'w');\n dateTo = dateTo.add(modifierFactor, 'w');\n startOf = 'week';\n break;\n case /mois?/.test(relative):\n dateFrom = dateFrom.add(total, 'M');\n dateTo = dateTo.add(modifierFactor, 'M');\n startOf = 'month';\n break;\n case /trimestres?/.test(relative):\n dateFrom = dateFrom.add(total, 'Q');\n dateTo = dateTo.add(modifierFactor, 'Q');\n startOf = 'quarter';\n break;\n case /années?/.test(relative):\n dateFrom = dateFrom.add(total, 'y');\n dateTo = dateTo.add(modifierFactor, 'y');\n startOf = 'year';\n break;\n }\n\n // if we go forward, switch the start and end dates\n if(modifierFactor > 0) {\n var dateTmp = dateFrom;\n dateFrom = dateTo;\n dateTo = dateTmp;\n }\n\n // Get start and end of dates\n dateFrom = dateFrom.startOf(startOf);\n dateTo = dateTo.endOf(startOf);\n if (startOf == 'week') { // Weekday in FR start on Sat?\n dateFrom = dateFrom.add(1, 'd')\n dateTo = dateTo.add(1, 'd')\n }\n \n\n // Assign results\n result.start.assign('year', dateFrom.year());\n result.start.assign('month', dateFrom.month() + 1);\n result.start.assign('day', dateFrom.date());\n result.start.assign('minute', dateFrom.minute());\n result.start.assign('second', dateFrom.second());\n result.start.assign('hour', dateFrom.hour());\n result.start.assign('millisecond', dateFrom.millisecond());\n\n result.end = result.start.clone();\n result.end.assign('year', dateTo.year());\n result.end.assign('month', dateTo.month() + 1);\n result.end.assign('day', dateTo.date());\n result.end.assign('minute', dateTo.minute());\n result.end.assign('second', dateTo.second());\n result.end.assign('hour', dateTo.hour());\n result.end.assign('millisecond', dateTo.millisecond());\n return result;\n };\n};\n","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs_plugin_quarterOfYear=n()}(this,function(){\"use strict\";var t=\"month\",n=\"quarter\";return function(r,i){var e=i.prototype;e.quarter=function(t){return this.$utils().u(t)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(t-1))};var u=e.add;e.add=function(r,i){return r=Number(r),this.$utils().p(i)===n?this.add(3*r,t):u.bind(this)(r,i)};var s=e.startOf;e.startOf=function(r,i){var e=this.$utils(),u=!!e.u(i)||i;if(e.p(r)===n){var a=this.quarter()-1;return u?this.month(3*a).startOf(t).startOf(\"day\"):this.month(3*a+2).endOf(t).endOf(\"day\")}return s.bind(this)(r,i)}}});\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar util = require('../../utils/ZH-Hant.js');\n\nvar PATTERN = new RegExp(\n '(\\\\d{2,4}|[' + Object.keys(util.NUMBER).join('') + ']{2,4})?' +\n '(?:\\\\s*)' +\n '(?:年)?' +\n '(?:[\\\\s|,|,]*)' +\n '(\\\\d{1,2}|[' + Object.keys(util.NUMBER).join('') + ']{1,2})' +\n '(?:\\\\s*)' +\n '(?:月)' +\n '(?:\\\\s*)' +\n '(\\\\d{1,2}|[' + Object.keys(util.NUMBER).join('') + ']{1,2})?' +\n '(?:\\\\s*)' +\n '(?:日|號)?'\n);\n\nvar YEAR_GROUP = 1;\nvar MONTH_GROUP = 2;\nvar DAY_GROUP = 3;\n\nexports.Parser = function ZHHantDateParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return PATTERN;\n };\n\n this.extract = function(text, ref, match, opt) {\n var startMoment = dayjs(ref);\n var result = new ParsedResult({\n text: match[0],\n index: match.index,\n ref: ref,\n });\n\n //Month\n var month = parseInt(match[MONTH_GROUP]);\n if (isNaN(month)) month = util.zhStringToNumber(match[MONTH_GROUP]);\n result.start.assign('month', month);\n\n //Day\n if (match[DAY_GROUP]) {\n var day = parseInt(match[DAY_GROUP]);\n if (isNaN(day)) day = util.zhStringToNumber(match[DAY_GROUP]);\n result.start.assign('day', day);\n } else {\n result.start.imply('day', startMoment.date());\n }\n\n //Year\n if (match[YEAR_GROUP]) {\n var year = parseInt(match[YEAR_GROUP]);\n if (isNaN(year)) year = util.zhStringToYear(match[YEAR_GROUP]);\n result.start.assign('year', year);\n } else {\n result.start.imply('year', startMoment.year());\n }\n\n result.tags.ZHHantDateParser = true;\n return result;\n };\n};\n","var Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar updateParsedComponent = require('../en/ENWeekdayParser').updateParsedComponent;\n\nvar util = require('../../utils/ZH-Hant.js');\n\nvar PATTERN = new RegExp(\n '(上|今|下|這|呢)?' +\n '(?:個)?' +\n '(?:星期|禮拜)' +\n '(' + Object.keys(util.WEEKDAY_OFFSET).join('|') + ')'\n);\n\nvar PREFIX_GROUP = 1;\nvar WEEKDAY_GROUP = 2;\n\nexports.Parser = function ZHHantWeekdayParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return PATTERN;\n };\n\n this.extract = function(text, ref, match, opt) {\n var index = match.index;\n text = match[0];\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var dayOfWeek = match[WEEKDAY_GROUP];\n var offset = util.WEEKDAY_OFFSET[dayOfWeek];\n if(offset === undefined) return null;\n\n var modifier = null;\n var prefix = match[PREFIX_GROUP];\n\n if(prefix == '上') {\n modifier = 'last';\n } else if(prefix == '下') {\n modifier = 'next';\n } else if(prefix == '今' || prefix == '這' || prefix == '呢') {\n modifier = 'this';\n }\n\n updateParsedComponent(result, ref, offset, modifier);\n result.tags['ZHHantWeekdayParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar ParsedComponents = require('../../result').ParsedComponents;\n\nvar util = require('../../utils/ZH-Hant.js');\n\nvar patternString1 = '(?:由|從|自)?' +\n '(?:' +\n '(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|' +\n '(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|' +\n '(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)' +\n '(?:[\\\\s,,]*)' +\n '(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?' +\n ')?' +\n '(?:[\\\\s,,]*)' +\n '(?:(\\\\d+|[' + Object.keys(util.NUMBER).join('') + ']+)(?:\\\\s*)(?:點|時|:|:)' +\n '(?:\\\\s*)' +\n '(\\\\d+|半|正|整|[' + Object.keys(util.NUMBER).join('') + ']+)?(?:\\\\s*)(?:分|:|:)?' +\n '(?:\\\\s*)' +\n '(\\\\d+|[' + Object.keys(util.NUMBER).join('') + ']+)?(?:\\\\s*)(?:秒)?)' +\n '(?:\\\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?';\n\nvar patternString2 = '(?:^\\\\s*(?:到|至|\\\\-|\\\\–|\\\\~|\\\\〜)\\\\s*)' +\n '(?:' +\n '(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|' +\n '(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|' +\n '(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)' +\n '(?:[\\\\s,,]*)' +\n '(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?' +\n ')?' +\n '(?:[\\\\s,,]*)' +\n '(?:(\\\\d+|[' + Object.keys(util.NUMBER).join('') + ']+)(?:\\\\s*)(?:點|時|:|:)' +\n '(?:\\\\s*)' +\n '(\\\\d+|半|正|整|[' + Object.keys(util.NUMBER).join('') + ']+)?(?:\\\\s*)(?:分|:|:)?' +\n '(?:\\\\s*)' +\n '(\\\\d+|[' + Object.keys(util.NUMBER).join('') + ']+)?(?:\\\\s*)(?:秒)?)' +\n '(?:\\\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?';\n\nvar FIRST_REG_PATTERN = new RegExp(patternString1, 'i');\nvar SECOND_REG_PATTERN = new RegExp(patternString2, 'i');\n\nvar DAY_GROUP_1 = 1;\nvar ZH_AM_PM_HOUR_GROUP_1 = 2;\nvar ZH_AM_PM_HOUR_GROUP_2 = 3;\nvar DAY_GROUP_3 = 4;\nvar ZH_AM_PM_HOUR_GROUP_3 = 5;\nvar HOUR_GROUP = 6;\nvar MINUTE_GROUP = 7;\nvar SECOND_GROUP = 8;\nvar AM_PM_HOUR_GROUP = 9;\n\nexports.Parser = function ZHHantTimeExpressionParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return FIRST_REG_PATTERN;\n };\n\n this.extract = function(text, ref, match, opt) {\n\n // This pattern can be overlaped Ex. [12] AM, 1[2] AM\n if (match.index > 0 && text[match.index - 1].match(/\\w/)) return null;\n var refMoment = dayjs(ref);\n var result = new ParsedResult();\n result.ref = ref;\n result.index = match.index;\n result.text = match[0];\n result.tags.ZHTimeExpressionParser = true;\n\n var startMoment = refMoment.clone();\n\n // ----- Day\n if (match[DAY_GROUP_1]) {\n var day1 = match[DAY_GROUP_1];\n if (day1 == '明' || day1 == '聽') {\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n startMoment.add(1, 'day');\n }\n } else if (day1 == '昨' || day1 == '尋' || day1 == '琴') {\n startMoment.add(-1, 'day');\n } else if (day1 == \"前\"){\n startMoment.add(-2, 'day');\n } else if (day1 == \"大前\"){\n startMoment.add(-3, 'day');\n } else if (day1 == \"後\"){\n startMoment.add(2, 'day');\n } else if (day1 == \"大後\"){\n startMoment.add(3, 'day');\n }\n result.start.assign('day', startMoment.date());\n result.start.assign('month', startMoment.month() + 1);\n result.start.assign('year', startMoment.year());\n } else if (match[DAY_GROUP_3]) {\n var day3 = match[DAY_GROUP_3];\n if (day3 == '明' || day3 == '聽') {\n startMoment.add(1, 'day');\n } else if (day3 == '昨' || day3 == '尋' || day3 == '琴') {\n startMoment.add(-1, 'day');\n } else if (day3 == \"前\"){\n startMoment.add(-2, 'day');\n } else if (day3 == \"大前\"){\n startMoment.add(-3, 'day');\n } else if (day3 == \"後\"){\n startMoment.add(2, 'day');\n } else if (day3 == \"大後\"){\n startMoment.add(3, 'day');\n }\n result.start.assign('day', startMoment.date());\n result.start.assign('month', startMoment.month() + 1);\n result.start.assign('year', startMoment.year());\n } else {\n result.start.imply('day', startMoment.date());\n result.start.imply('month', startMoment.month() + 1);\n result.start.imply('year', startMoment.year());\n }\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if (match[SECOND_GROUP]) {\n var second = parseInt(match[SECOND_GROUP]);\n if (isNaN(second)) {\n second = util.zhStringToNumber(match[SECOND_GROUP]);\n }\n if (second >= 60) return null;\n result.start.assign('second', second);\n }\n\n hour = parseInt(match[HOUR_GROUP]);\n if (isNaN(hour)) {\n hour = util.zhStringToNumber(match[HOUR_GROUP]);\n }\n\n // ----- Minutes\n if (match[MINUTE_GROUP]) {\n if (match[MINUTE_GROUP] == '半') {\n minute = 30;\n } else if (match[MINUTE_GROUP] == '正' || match[MINUTE_GROUP] == '整') {\n minute = 0;\n } else {\n minute = parseInt(match[MINUTE_GROUP]);\n if (isNaN(minute)) {\n minute = util.zhStringToNumber(match[MINUTE_GROUP]);\n }\n }\n } else if (hour > 100) {\n minute = hour % 100;\n hour = parseInt(hour / 100);\n }\n\n if (minute >= 60) {\n return null;\n }\n\n if (hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP]) {\n if (hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if (ampm == \"a\") {\n meridiem = 0;\n if (hour == 12) hour = 0;\n }\n\n if (ampm == \"p\") {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n } else if (match[ZH_AM_PM_HOUR_GROUP_1]) {\n var zhAMPMString1 = match[ZH_AM_PM_HOUR_GROUP_1];\n var zhAMPM1 = zhAMPMString1[0];\n if (zhAMPM1 == '朝' || zhAMPM1 == '早') {\n meridiem = 0;\n if (hour == 12) hour = 0;\n } else if (zhAMPM1 == '晚') {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n } else if (match[ZH_AM_PM_HOUR_GROUP_2]) {\n var zhAMPMString2 = match[ZH_AM_PM_HOUR_GROUP_2];\n var zhAMPM2 = zhAMPMString2[0];\n if (zhAMPM2 == '上' || zhAMPM2 == '朝' || zhAMPM2 == '早' || zhAMPM2 == '凌') {\n meridiem = 0;\n if (hour == 12) hour = 0;\n } else if (zhAMPM2 == '下' || zhAMPM2 == '晏' || zhAMPM2 == '晚') {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n } else if (match[ZH_AM_PM_HOUR_GROUP_3]) {\n var zhAMPMString3 = match[ZH_AM_PM_HOUR_GROUP_3];\n var zhAMPM3 = zhAMPMString3[0];\n if (zhAMPM3 == '上' || zhAMPM3 == '朝' || zhAMPM3 == '早' || zhAMPM3 == '凌') {\n meridiem = 0;\n if (hour == 12) hour = 0;\n } else if (zhAMPM3 == '下' || zhAMPM3 == '晏' || zhAMPM3 == '晚') {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n }\n\n result.start.assign('hour', hour);\n result.start.assign('minute', minute);\n\n if (meridiem >= 0) {\n result.start.assign('meridiem', meridiem);\n } else {\n if (hour < 12) {\n result.start.imply('meridiem', 0);\n } else {\n result.start.imply('meridiem', 1);\n }\n }\n\n // ==============================================================\n // Extracting the 'to' chunk\n // ==============================================================\n\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n // Not accept number only result\n if (result.text.match(/^\\d+$/)) {\n return null;\n }\n return result;\n }\n\n var endMoment = startMoment.clone();\n result.end = new ParsedComponents(null, null);\n\n // ----- Day\n if (match[DAY_GROUP_1]) {\n var day1 = match[DAY_GROUP_1];\n if (day1 == '明' || day1 == '聽') {\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n endMoment.add(1, 'day');\n }\n } else if (day1 == '昨' || day1 == '尋' || day1 == '琴') {\n endMoment.add(-1, 'day');\n } else if (day1 == \"前\"){\n endMoment.add(-2, 'day');\n } else if (day1 == \"大前\"){\n endMoment.add(-3, 'day');\n } else if (day1 == \"後\"){\n endMoment.add(2, 'day');\n } else if (day1 == \"大後\"){\n endMoment.add(3, 'day');\n }\n result.end.assign('day', endMoment.date());\n result.end.assign('month', endMoment.month() + 1);\n result.end.assign('year', endMoment.year());\n } else if (match[DAY_GROUP_3]) {\n var day3 = match[DAY_GROUP_3];\n if (day3 == '明' || day3 == '聽') {\n endMoment.add(1, 'day');\n } else if (day3 == '昨' || day3 == '尋' || day3 == '琴') {\n endMoment.add(-1, 'day');\n } else if (day3 == \"前\"){\n endMoment.add(-2, 'day');\n } else if (day3 == \"大前\"){\n endMoment.add(-3, 'day');\n } else if (day3 == \"後\"){\n endMoment.add(2, 'day');\n } else if (day3 == \"大後\"){\n endMoment.add(3, 'day');\n }\n result.end.assign('day', endMoment.date());\n result.end.assign('month', endMoment.month() + 1);\n result.end.assign('year', endMoment.year());\n } else {\n result.end.imply('day', endMoment.date());\n result.end.imply('month', endMoment.month() + 1);\n result.end.imply('year', endMoment.year());\n }\n\n hour = 0;\n minute = 0;\n meridiem = -1;\n\n // ----- Second\n if (match[SECOND_GROUP]) {\n var second = parseInt(match[SECOND_GROUP]);\n if (isNaN(second)) {\n second = util.zhStringToNumber(match[SECOND_GROUP]);\n }\n\n if (second >= 60) return null;\n result.end.assign('second', second);\n }\n\n hour = parseInt(match[HOUR_GROUP]);\n if (isNaN(hour)) {\n hour = util.zhStringToNumber(match[HOUR_GROUP]);\n }\n\n // ----- Minutes\n if (match[MINUTE_GROUP]) {\n if (match[MINUTE_GROUP] == '半') {\n minute = 30;\n } else if (match[MINUTE_GROUP] == '正' || match[MINUTE_GROUP] == '整') {\n minute = 0;\n } else {\n minute = parseInt(match[MINUTE_GROUP]);\n if (isNaN(minute)) {\n minute = util.zhStringToNumber(match[MINUTE_GROUP]);\n }\n }\n } else if (hour > 100) {\n minute = hour % 100;\n hour = parseInt(hour / 100);\n }\n\n if (minute >= 60) {\n return null;\n }\n\n if (hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP]) {\n if (hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if (ampm == \"a\") {\n meridiem = 0;\n if (hour == 12) hour = 0;\n }\n\n if (ampm == \"p\") {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n\n if (!result.start.isCertain('meridiem')) {\n if (meridiem == 0) {\n\n result.start.imply('meridiem', 0);\n\n if (result.start.get('hour') == 12) {\n result.start.assign('hour', 0);\n }\n\n } else {\n\n result.start.imply('meridiem', 1);\n\n if (result.start.get('hour') != 12) {\n result.start.assign('hour', result.start.get('hour') + 12);\n }\n }\n }\n\n } else if (match[ZH_AM_PM_HOUR_GROUP_1]) {\n var zhAMPMString1 = match[ZH_AM_PM_HOUR_GROUP_1];\n var zhAMPM1 = zhAMPMString1[0];\n if (zhAMPM1 == '朝' || zhAMPM1 == '早') {\n meridiem = 0;\n if (hour == 12) hour = 0;\n } else if (zhAMPM1 == '晚') {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n } else if (match[ZH_AM_PM_HOUR_GROUP_2]) {\n var zhAMPMString2 = match[ZH_AM_PM_HOUR_GROUP_2];\n var zhAMPM2 = zhAMPMString2[0];\n if (zhAMPM2 == '上' || zhAMPM2 == '朝' || zhAMPM2 == '早' || zhAMPM2 == '凌') {\n meridiem = 0;\n if (hour == 12) hour = 0;\n } else if (zhAMPM2 == '下' || zhAMPM2 == '晏' || zhAMPM2 == '晚') {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n } else if (match[ZH_AM_PM_HOUR_GROUP_3]) {\n var zhAMPMString3 = match[ZH_AM_PM_HOUR_GROUP_3];\n var zhAMPM3 = zhAMPMString3[0];\n if (zhAMPM3 == '上' || zhAMPM3 == '朝' || zhAMPM3 == '早' || zhAMPM3 == '凌') {\n meridiem = 0;\n if (hour == 12) hour = 0;\n } else if (zhAMPM3 == '下' || zhAMPM3 == '晏' || zhAMPM3 == '晚') {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n }\n\n result.text = result.text + match[0];\n result.end.assign('hour', hour);\n result.end.assign('minute', minute);\n if (meridiem >= 0) {\n result.end.assign('meridiem', meridiem);\n } else {\n var startAtPM = result.start.isCertain('meridiem') && result.start.get('meridiem') == 1;\n if (startAtPM && result.start.get('hour') > hour) {\n // 10pm - 1 (am)\n result.end.imply('meridiem', 0);\n\n } else if (hour > 12) {\n result.end.imply('meridiem', 1);\n }\n }\n\n if (result.end.date().getTime() < result.start.date().getTime()) {\n result.end.imply('day', result.end.get('day') + 1)\n }\n\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp(\n '(而家|立(?:刻|即)|即刻)|' +\n '(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|' +\n '(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|' +\n '(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)' +\n '(?:[\\\\s|,|,]*)' +\n '(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?', 'i');\n\nvar NOW_GROUP = 1;\nvar DAY_GROUP_1 = 2;\nvar TIME_GROUP_1 = 3;\nvar TIME_GROUP_2 = 4;\nvar DAY_GROUP_3 = 5;\nvar TIME_GROUP_3 = 6;\n\nexports.Parser = function ZHHantCasualDateParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return PATTERN;\n };\n\n this.extract = function(text, ref, match, opt) {\n text = match[0];\n var index = match.index;\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var refMoment = dayjs(ref);\n var startMoment = refMoment;\n\n if (match[NOW_GROUP]) {\n result.start.imply('hour', refMoment.hour());\n result.start.imply('minute', refMoment.minute());\n result.start.imply('second', refMoment.second());\n result.start.imply('millisecond', refMoment.millisecond());\n } else if (match[DAY_GROUP_1]) {\n var day1 = match[DAY_GROUP_1];\n var time1 = match[TIME_GROUP_1];\n\n if (day1 == '明' || day1 == '聽') {\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n } else if (day1 == '昨' || day1 == '尋' || day1 == '琴') {\n startMoment = startMoment.add(-1, 'day');\n } else if (day1 == \"前\"){\n startMoment = startMoment.add(-2, 'day');\n } else if (day1 == \"大前\"){\n startMoment = startMoment.add(-3, 'day');\n } else if ( day1 == \"後\"){\n startMoment = startMoment.add(2, 'day');\n } else if (day1 == \"大後\"){\n startMoment = startMoment.add(3, 'day');\n }\n\n if (time1 == '早' || time1 == '朝') {\n result.start.imply('hour', 6);\n } else if (time1 == '晚') {\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n }\n\n } else if (match[TIME_GROUP_2]) {\n var timeString2 = match[TIME_GROUP_2];\n var time2 = timeString2[0];\n if (time2 == '早' || time2 == '朝' || time2 == '上') {\n result.start.imply('hour', 6);\n } else if (time2 == '下' || time2 == '晏') {\n result.start.imply('hour', 15);\n result.start.imply('meridiem', 1);\n } else if (time2 == '中') {\n result.start.imply('hour', 12);\n result.start.imply('meridiem', 1);\n } else if (time2 == '夜' || time2 == '晚') {\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n } else if (time2 == '凌') {\n result.start.imply('hour', 0);\n }\n\n } else if (match[DAY_GROUP_3]) {\n var day3 = match[DAY_GROUP_3];\n\n if (day3 == '明' || day3 == '聽') {\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n } else if (day3 == '昨' || day3 == '尋' || day3 == '琴') {\n startMoment = startMoment.add(-1, 'day');\n } else if (day3 == \"前\"){\n startMoment = startMoment.add(-2, 'day');\n } else if (day3 == \"大前\"){\n startMoment = startMoment.add(-3, 'day');\n } else if (day3 == \"後\"){\n startMoment = startMoment.add(2, 'day');\n } else if (day3 == \"大後\"){\n startMoment = startMoment.add(3, 'day');\n }\n\n\n var timeString3 = match[TIME_GROUP_3];\n if (timeString3) {\n var time3 = timeString3[0];\n if (time3 == '早' || time3 == '朝' || time3 == '上') {\n result.start.imply('hour', 6);\n } else if (time3 == '下' || time3 == '晏') {\n result.start.imply('hour', 15);\n result.start.imply('meridiem', 1);\n } else if (time3 == '中') {\n result.start.imply('hour', 12);\n result.start.imply('meridiem', 1);\n } else if (time3 == '夜' || time3 == '晚') {\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n } else if (time3 == '凌') {\n result.start.imply('hour', 0);\n }\n }\n }\n\n result.start.assign('day', startMoment.date())\n result.start.assign('month', startMoment.month() + 1)\n result.start.assign('year', startMoment.year())\n result.tags.ZHHantCasualDateParser = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar util = require('../../utils/ZH-Hant.js');\n\nvar PATTERN = new RegExp(\n '(\\\\d+|[' + Object.keys(util.NUMBER).join('') + ']+|半|幾)(?:\\\\s*)' +\n '(?:個)?' +\n '(秒(?:鐘)?|分鐘|小時|鐘|日|天|星期|禮拜|月|年)' +\n '(?:(?:之|過)?後|(?:之)?內)', 'i'\n);\n\nvar NUMBER_GROUP = 1;\nvar UNIT_GROUP = 2;\n\nexports.Parser = function ZHHantCasualDateParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return PATTERN;\n };\n\n this.extract = function(text, ref, match, opt) {\n var index = match.index;\n text = match[0];\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var number = parseInt(match[NUMBER_GROUP]);\n if (isNaN(number)){\n number = util.zhStringToNumber(match[NUMBER_GROUP]);\n }\n\n if (isNaN(number)){\n var string = match[NUMBER_GROUP];\n if (string === '幾'){\n number = 3;\n }else if(string === '半'){\n number = 0.5;\n }else{\n\n //just in case\n return null;\n }\n }\n\n var date = dayjs(ref);\n var unit = match[UNIT_GROUP];\n var unitAbbr = unit[0];\n\n if (unitAbbr.match(/[日天星禮月年]/)){\n if(unitAbbr == '日' || unitAbbr == '天'){\n date = date.add(number, 'd');\n }else if(unitAbbr == '星' || unitAbbr == '禮'){\n date = date.add(number * 7, 'd');\n }else if(unitAbbr == '月'){\n date = date.add(number, 'month');\n }else if(unitAbbr == '年'){\n date = date.add(number, 'year');\n }\n\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n return result;\n }\n\n if(unitAbbr == '秒'){\n date = date.add(number, 'second');\n }else if(unitAbbr == '分'){\n date = date.add(number, 'minute');\n }else if(unitAbbr == '小' || unitAbbr == '鐘'){\n date = date.add(number, 'hour');\n }\n\n result.start.imply('year', date.year());\n result.start.imply('month', date.month() + 1);\n result.start.imply('day', date.date());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.start.assign('second', date.second());\n result.tags.ZHHantDeadlineFormatParser = true;\n return result;\n };\n};\n","/*\n\n\n*/\n\nvar dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/DE');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(in|nach)\\\\s*' +\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|einigen|eine[rm]\\\\s*halben|eine[rm])\\\\s*' +\n '(sekunden?|min(?:ute)?n?|stunden?|tag(?:en)?|wochen?|monat(?:en)?|jahr(?:en)?)\\\\s*' +\n '(?=\\\\W|$)', 'i'\n);\n\nvar STRICT_PATTERN = new RegExp('(\\\\W|^)' +\n '(in|nach)\\\\s*' +\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|eine(?:r|m)?)\\\\s*' +\n '(sekunden?|minuten?|stunden?|tag(?:en)?)\\\\s*' +\n '(?=\\\\W|$)', 'i'\n);\n\nexports.Parser = function DEDeadlineFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return this.isStrictMode()? STRICT_PATTERN : PATTERN;\n };\n\n this.extract = function(text, ref, match, opt){\n\n var index = match.index + match[1].length;\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var num = match[3].toLowerCase();\n if (util.INTEGER_WORDS[num] !== undefined) {\n num = util.INTEGER_WORDS[num];\n } else if (num === 'einer' || num === 'einem') {\n num = 1;\n } else if (num === 'einigen') {\n num = 3;\n } else if (/halben/.test(num)) {\n num = 0.5;\n } else {\n num = parseInt(num);\n }\n\n var date = dayjs(ref);\n if (/tag|woche|monat|jahr/i.test(match[4])) {\n\n if (/tag/i.test(match[4])) {\n date = date.add(num, 'd');\n } else if (/woche/i.test(match[4])) {\n date = date.add(num * 7, 'd');\n } else if (/monat/i.test(match[4])) {\n date = date.add(num, 'month');\n } else if (/jahr/i.test(match[4])) {\n date = date.add(num, 'year');\n }\n\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n return result;\n }\n\n if (/stunde/i.test(match[4])) {\n\n date = date.add(num, 'hour');\n\n } else if (/min/i.test(match[4])) {\n\n date = date.add(num, 'minute');\n\n } else if (/sekunde/i.test(match[4])) {\n\n date = date.add(num, 'second');\n }\n\n result.start.imply('year', date.year());\n result.start.imply('month', date.month() + 1);\n result.start.imply('day', date.date());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.start.assign('second', date.second());\n result.tags['DEDeadlineFormatParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nconst parser = require('../parser');\nconst ParsedResult = require('../../result').ParsedResult;\nconst util = require('../../utils/DE');\n\nconst PATTERN = new RegExp('(\\\\W|^)' +\n '(?:am\\\\s*?)?' +\n '(?:(Sonntag|Montag|Dienstag|Mittwoch|Donnerstag|Freitag|Samstag|So|Mo|Di|Mi|Do|Fr|Sa)\\\\s*,?\\\\s*)?' +\n '(?:den\\\\s*)?' +\n '([0-9]{1,2})\\\\.' +\n '(?:\\\\s*(?:bis(?:\\\\s*(?:am|zum))?|\\\\-|\\\\–|\\\\s)\\\\s*([0-9]{1,2})\\\\.)?\\\\s*' +\n '(Jan(?:uar|\\\\.)?|Feb(?:ruar|\\\\.)?|Mär(?:z|\\\\.)?|Maerz|Mrz\\\\.?|Apr(?:il|\\\\.)?|Mai|Jun(?:i|\\\\.)?|Jul(?:i|\\\\.)?|Aug(?:ust|\\\\.)?|Sep(?:t|t\\\\.|tember|\\\\.)?|Okt(?:ober|\\\\.)?|Nov(?:ember|\\\\.)?|Dez(?:ember|\\\\.)?)' +\n '(?:' +\n ',?\\\\s*([0-9]{1,4}(?![^\\\\s]\\\\d))' +\n '(\\\\s*[vn]\\\\.?\\\\s*C(?:hr)?\\\\.?)?' +\n ')?' +\n '(?=\\\\W|$)', 'i'\n );\n\nconst WEEKDAY_GROUP = 2;\nconst DATE_GROUP = 3;\nconst DATE_TO_GROUP = 4;\nconst MONTH_NAME_GROUP = 5;\nconst YEAR_GROUP = 6;\nconst YEAR_BE_GROUP = 7;\n\nexports.Parser = function DEMonthNameLittleEndianParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n const result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n\n var day = match[DATE_GROUP];\n day = parseInt(day);\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n year = parseInt(year);\n\n if(match[YEAR_BE_GROUP]){\n if (/v/i.test(match[YEAR_BE_GROUP])) {\n // v.Chr.\n year = -year;\n }\n } else if (year < 100){\n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month);\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n // Weekday component\n if (match[WEEKDAY_GROUP]) {\n var weekday = match[WEEKDAY_GROUP];\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()]\n result.start.assign('weekday', weekday);\n }\n\n // Text can be 'range' value. Such as '12 - 13 January 2012'\n if (match[DATE_TO_GROUP]) {\n result.end = result.start.clone();\n result.end.assign('day', parseInt(match[DATE_TO_GROUP]));\n }\n\n result.tags['DEMonthNameLittleEndianParser'] = true;\n return result;\n };\n}\n","/*\n \n The parser for parsing month name and year.\n \n EX. \n - Januar\n - Januar 2012\n*/\n\nconst parser = require('../parser');\nconst ParsedResult = require('../../result').ParsedResult;\nconst util = require('../../utils/DE');\n\nconst PATTERN = new RegExp('(^|\\\\D\\\\s+|[^\\\\w\\\\s])' +\n '(Jan\\\\.?|Januar|Feb\\\\.?|Februar|Mär\\\\.?|M(?:ä|ae)rz|Mrz\\\\.?|Apr\\\\.?|April|Mai\\\\.?|Jun\\\\.?|Juni|Jul\\\\.?|Juli|Aug\\\\.?|August|Sep\\\\.?|Sept\\\\.?|September|Okt\\\\.?|Oktober|Nov\\\\.?|November|Dez\\\\.?|Dezember)' + \n '\\\\s*' +\n '(?:' +\n ',?\\\\s*(?:([0-9]{4})(\\\\s*[vn]\\\\.?\\\\s*C(?:hr)?\\\\.?)?|([0-9]{1,4})\\\\s*([vn]\\\\.?\\\\s*C(?:hr)?\\\\.?))' +\n ')?' +\n '(?=[^\\\\s\\\\w]|$)', 'i');\n\nconst MONTH_NAME_GROUP = 2;\nconst YEAR_GROUP = 3;\nconst YEAR_BE_GROUP = 4;\nconst YEAR_GROUP2 = 5;\nconst YEAR_BE_GROUP2 = 6;\n\nexports.Parser = function ENMonthNameParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n \n this.extract = function(text, ref, match, opt){\n var result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n \n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n\n var day = 1;\n\n var year = null;\n if (match[YEAR_GROUP] || match[YEAR_GROUP2]) {\n year = match[YEAR_GROUP] || match[YEAR_GROUP2];\n year = parseInt(year);\n\n if (match[YEAR_BE_GROUP] || match[YEAR_BE_GROUP2]) {\n if (/v/i.test(match[YEAR_BE_GROUP] || match[YEAR_BE_GROUP2])) {\n // v.Chr.\n year = -year;\n }\n\n } else if (year < 100){ \n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n \n year = parser.findYearClosestToRef(ref, day, month);\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n if (this.isStrictMode() && result.text.match(/^\\w+$/)) {\n return false;\n }\n\n result.tags['DEMonthNameParser'] = true;\n return result;\n }\n}\n\n","/*\n Date format with slash \"/\" (also \"-\" and \".\") between numbers\n - Tuesday 11/3/2015\n - 11/3/2015\n - 11/3\n*/\nvar dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:' +\n '(?:am\\\\s*?)?' +\n '((?:sonntag|so|montag|mo|dienstag|di|mittwoch|mi|donnerstag|do|freitag|fr|samstag|sa))' +\n '\\\\s*\\\\,?\\\\s*' +\n '(?:den\\\\s*)?' +\n ')?' +\n '([0-3]{0,1}[0-9]{1})[\\\\/\\\\.\\\\-]([0-3]{0,1}[0-9]{1})' +\n '(?:' +\n '[\\\\/\\\\.\\\\-]' +\n '([0-9]{4}\\s*\\,?\\s*|[0-9]{2}\\s*\\,?\\s*)' +\n ')?' +\n '(\\\\W|$)', 'i');\n\nvar DAYS_OFFSET = {\n 'sonntag': 0, 'so': 0,\n 'montag': 1, 'mo': 1,\n 'dienstag': 2, 'di': 2,\n 'mittwoch': 3, 'mi': 3,\n 'donnerstag': 4, 'do': 4,\n 'freitag': 5, 'fr': 5,\n 'samstag': 6, 'sa': 6\n};\n\n\nvar OPENNING_GROUP = 1;\nvar ENDING_GROUP = 6;\n\nvar WEEKDAY_GROUP = 2;\nvar DAY_GROUP = 3;\nvar MONTH_GROUP = 4;\nvar YEAR_GROUP = 5;\n\nexports.Parser = function DESlashDateFormatParser(argument) {\n Parser.apply(this, arguments);\n\n this.pattern = function () { return PATTERN; };\n this.extract = function(text, ref, match, opt){\n\n if(match[OPENNING_GROUP] == '/' || match[ENDING_GROUP] == '/') {\n // Long skip, if there is some overlapping like:\n // XX[/YY/ZZ]\n // [XX/YY/]ZZ\n match.index += match[0].length\n return;\n }\n\n var index = match.index + match[OPENNING_GROUP].length;\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length - match[ENDING_GROUP].length);\n\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n });\n\n if(text.match(/^\\d\\.\\d$/)) return;\n if(text.match(/^\\d\\.\\d{1,2}\\.\\d{1,2}$/)) return;\n\n // MM/dd -> OK\n // MM.dd -> NG\n if(!match[YEAR_GROUP] && match[0].indexOf('/') < 0) return;\n\n var year = match[YEAR_GROUP] || dayjs(ref).year() + '';\n var month = match[MONTH_GROUP];\n var day = match[DAY_GROUP];\n\n month = parseInt(month);\n day = parseInt(day);\n year = parseInt(year);\n\n if (month < 1 || month > 12) return null;\n if(day < 1 || day > 31) return null;\n\n if(year < 100){\n if (year > 50) {\n year = year + 1900;\n } else {\n year = year + 2000;\n }\n }\n\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n\n //Day of week\n if(match[WEEKDAY_GROUP]) {\n result.start.assign('weekday', DAYS_OFFSET[match[WEEKDAY_GROUP].toLowerCase()]);\n }\n\n result.tags['DESlashDateFormatParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/DE');\n\nvar PATTERN = new RegExp('' +\n '(\\\\W|^)vor\\\\s*' +\n '(' + util.INTEGER_WORDS_PATTERN + '|[0-9]+|einigen|eine[rm]\\\\s*halben|eine[rm])\\\\s*' +\n '(sekunden?|min(?:ute)?n?|stunden?|wochen?|tag(?:en)?|monat(?:en)?|jahr(?:en)?)\\\\s*' +\n '(?=(?:\\\\W|$))', 'i');\n\nvar STRICT_PATTERN = new RegExp('' +\n '(\\\\W|^)vor\\\\s*' +\n '([0-9]+|eine(?:r|m))\\\\s*' +\n '(sekunden?|minuten?|stunden?|tag(?:en)?)' +\n '(?=(?:\\\\W|$))', 'i');\n\nexports.Parser = function DETimeAgoFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return this.isStrictMode()? STRICT_PATTERN : PATTERN;\n };\n\n this.extract = function(text, ref, match, opt){\n\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n let index = match.index + match[1].length;\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var num = match[2].toLowerCase() ;\n if (util.INTEGER_WORDS[num] !== undefined) {\n num = util.INTEGER_WORDS[num];\n } else if (num === 'einer' || num === 'einem') {\n num = 1;\n } else if (num === 'einigen') {\n num = 3;\n } else if (/halben/.test(num)) {\n num = 0.5;\n } else {\n num = parseInt(num);\n }\n\n var date = dayjs(ref);\n\n if (/stunde|min|sekunde/i.test(match[3])) {\n if (/stunde/i.test(match[3])) {\n\n date = date.add(-num, 'hour');\n\n } else if (/min/i.test(match[3])) {\n\n date = date.add(-num, 'minute');\n\n } else if (/sekunde/i.test(match[3])) {\n\n date = date.add(-num, 'second');\n }\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.start.assign('second', date.second());\n result.tags['DETimeAgoFormatParser'] = true;\n return result;\n }\n\n if (/woche/i.test(match[3])) {\n date = date.add(-num, 'week');\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n result.start.imply('weekday', date.day());\n return result;\n }\n\n if (/tag/i.test(match[3])) {\n date = date.add(-num, 'd');\n }\n\n if (/monat/i.test(match[3])) {\n date = date.add(-num, 'month');\n }\n\n if (/jahr/i.test(match[3])) {\n\n date = date.add(-num, 'year');\n }\n\n result.start.assign('day', date.date());\n result.start.assign('month', date.month() + 1);\n result.start.assign('year', date.year());\n return result;\n\n };\n}\n","/*\n\n\n*/\n\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar ParsedComponents = require('../../result').ParsedComponents;\n\nvar FIRST_REG_PATTERN = new RegExp(\"(^|\\\\s|T)\" +\n \"(?:(?:um|von)\\\\s*)?\" +\n \"(\\\\d{1,4}|mittags?|mitternachts?)\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\:|\\\\:)(\\\\d{2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*uhr)?\" +\n \"(?:\\\\s*(morgens|vormittags|mittags|nachmittags|abends|nachts))?\" +\n \"(?=\\\\W|$)\", 'i');\n\n\nvar SECOND_REG_PATTERN = new RegExp(\"^\\\\s*\" +\n \"(\\\\-|\\\\–|\\\\~|\\\\〜|bis|\\\\?)\\\\s*\" +\n \"(\\\\d{1,4})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(morgens|vormittags|mittags|nachmittags|abends|nachts))?\" +\n \"(?=\\\\W|$)\", 'i');\n\nvar HOUR_GROUP = 2;\nvar MINUTE_GROUP = 3;\nvar SECOND_GROUP = 4;\nvar AM_PM_HOUR_GROUP = 5;\n\n\nexports.Parser = function DETimeExpressionParser() {\n Parser.apply(this, arguments);\n\n this.pattern = function() { return FIRST_REG_PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n // This pattern can be overlaped Ex. [12] AM, 1[2] AM\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n var refMoment = dayjs(ref);\n var result = new ParsedResult();\n result.ref = ref;\n result.index = match.index + match[1].length;\n result.text = match[0].substring(match[1].length);\n result.tags['DETimeExpressionParser'] = true;\n\n result.start.imply('day', refMoment.date());\n result.start.imply('month', refMoment.month()+1);\n result.start.imply('year', refMoment.year());\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.start.assign('second', second);\n }\n\n // ----- Hours\n if (/mittags?/i.test(match[HOUR_GROUP])) {\n meridiem = 1;\n hour = 12;\n } else if (/mitternachts?/i.test(match[HOUR_GROUP])) {\n meridiem = 0;\n hour = 0;\n } else {\n hour = parseInt(match[HOUR_GROUP]);\n }\n\n // ----- Minutes\n if(match[MINUTE_GROUP] != null){\n minute = parseInt(match[MINUTE_GROUP]);\n } else if(hour > 100) {\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP] != null) {\n if (hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP].toLowerCase();\n if (ampm === 'morgens' || ampm === 'vormittags') {\n meridiem = 0;\n if(hour == 12) hour = 0;\n } else {\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n }\n\n result.start.assign('hour', hour);\n result.start.assign('minute', minute);\n\n if (meridiem >= 0) {\n result.start.assign('meridiem', meridiem);\n } else {\n if (hour < 12) {\n result.start.imply('meridiem', 0);\n } else {\n result.start.imply('meridiem', 1);\n }\n }\n\n // ==============================================================\n // Extracting the 'to' chunk\n // ==============================================================\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n // Not accept number only result\n if (result.text.match(/^\\d+$/)) {\n return null;\n }\n return result;\n }\n\n\n\n // Pattern \"YY.YY -XXXX\" is more like timezone offset\n if (match[0].match(/^\\s*(\\+|\\-)\\s*\\d{3,4}$/)) {\n return result;\n }\n\n if(result.end == null){\n result.end = new ParsedComponents(null, result.start.date());\n }\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.end.assign('second', second);\n }\n\n hour = parseInt(match[2]);\n\n // ----- Minute\n if (match[MINUTE_GROUP]!= null) {\n\n minute = parseInt(match[MINUTE_GROUP]);\n if(minute >= 60) return result;\n\n } else if (hour > 100) {\n\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP] != null) {\n\n if (hour > 12) return null;\n\n var ampm = match[AM_PM_HOUR_GROUP].toLowerCase();\n if (ampm === 'morgens' || ampm === 'vormittags') {\n meridiem = 0;\n if(hour == 12) {\n hour = 0;\n if (!result.end.isCertain('day')) {\n result.end.imply('day', result.end.get('day') + 1);\n }\n }\n } else {\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n\n if (!result.start.isCertain('meridiem')) {\n if (meridiem == 0) {\n\n result.start.imply('meridiem', 0);\n\n if (result.start.get('hour') == 12) {\n result.start.assign('hour', 0);\n }\n\n } else {\n\n result.start.imply('meridiem', 1);\n\n if (result.start.get('hour') != 12) {\n result.start.assign('hour', result.start.get('hour') + 12);\n }\n }\n }\n }\n\n result.text = result.text + match[0];\n result.end.assign('hour', hour);\n result.end.assign('minute', minute);\n if (meridiem >= 0) {\n result.end.assign('meridiem', meridiem);\n } else {\n var startAtPM = result.start.isCertain('meridiem') && result.start.get('meridiem') == 1;\n if (startAtPM && result.start.get('hour') > hour) {\n // 10pm - 1 (am)\n result.end.imply('meridiem', 0);\n\n } else if (hour > 12) {\n result.end.imply('meridiem', 1);\n }\n }\n\n if (result.end.date().getTime() < result.start.date().getTime()) {\n result.end.imply('day', result.end.get('day') + 1)\n }\n\n return result;\n }\n}\n","/*\n\n\n*/\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar DAYS_OFFSET = {\n 'sonntag': 0, 'so': 0,\n 'montag': 1, 'mo': 1,\n 'dienstag': 2, 'di': 2,\n 'mittwoch': 3, 'mi': 3,\n 'donnerstag': 4, 'do': 4,\n 'freitag': 5, 'fr': 5,\n 'samstag': 6, 'sa': 6\n};\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:(?:\\\\,|\\\\(|\\\\()\\\\s*)?' +\n '(?:a[mn]\\\\s*?)?' +\n '(?:(diese[mn]|letzte[mn]|n(?:ä|ae)chste[mn])\\\\s*)?' +\n '(' + Object.keys(DAYS_OFFSET).join('|') + ')' +\n '(?:\\\\s*(?:\\\\,|\\\\)|\\\\)))?' +\n '(?:\\\\s*(diese|letzte|n(?:ä|ae)chste)\\\\s*woche)?' +\n '(?=\\\\W|$)', 'i');\n\nvar PREFIX_GROUP = 2;\nvar WEEKDAY_GROUP = 3;\nvar POSTFIX_GROUP = 4;\n\nexports.Parser = function DEWeekdayParser() {\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; };\n\n this.extract = function(text, ref, match, opt){\n var index = match.index + match[1].length;\n var text = match[0].substr(match[1].length, match[0].length - match[1].length);\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();\n var offset = DAYS_OFFSET[dayOfWeek];\n if(offset === undefined) return null;\n\n var startMoment = dayjs(ref);\n var prefix = match[PREFIX_GROUP];\n var postfix = match[POSTFIX_GROUP];\n\n var refOffset = startMoment.day();\n var norm = prefix || postfix;\n norm = norm || '';\n norm = norm.toLowerCase();\n if (/letzte/.test(norm)) {\n startMoment = startMoment.day(offset - 7);\n } else if (/n(?:ä|ae)chste/.test(norm)) {\n startMoment = startMoment.day(offset + 7);\n } else if (/diese/.test(norm)) {\n if ( opt.forwardDate && refOffset > offset ) {\n startMoment = startMoment.day(offset + 7);\n } else {\n startMoment = startMoment.day(offset);\n }\n } else {\n if ( opt.forwardDate && refOffset > offset ) {\n startMoment = startMoment.day(offset + 7);\n } else if (!opt.forwardDate && Math.abs(offset - 7 - refOffset) < Math.abs(offset - refOffset)) {\n startMoment = startMoment.day(offset - 7);\n } else if (!opt.forwardDate && Math.abs(offset + 7 - refOffset) < Math.abs(offset - refOffset)) {\n startMoment = startMoment.day(offset + 7);\n } else {\n startMoment = startMoment.day(offset);\n }\n }\n\n result.start.assign('weekday', offset);\n result.start.imply('day', startMoment.date());\n result.start.imply('month', startMoment.month() + 1);\n result.start.imply('year', startMoment.year());\n return result;\n }\n};\n","var dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp(\n '(\\\\W|^)(' +\n 'jetzt|' +\n '(?:heute|diesen)\\\\s*(morgen|vormittag|mittag|nachmittag|abend)|' +\n '(?:heute|diese)\\\\s*nacht|' +\n 'heute|' +\n '(?:(?:ü|ue)ber)?morgen(?:\\\\s*(morgen|vormittag|mittag|nachmittag|abend|nacht))?|' +\n '(?:vor)?gestern(?:\\\\s*(morgen|vormittag|mittag|nachmittag|abend|nacht))?|' +\n 'letzte\\\\s*nacht' +\n ')(?=\\\\W|$)', 'i');\n\nexports.Parser = function DECasualDateParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt) {\n text = match[0].substr(match[1].length);\n \n const index = match.index + match[1].length;\n const result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n const refMoment = dayjs(ref);\n const lowerText = text.toLowerCase();\n\n var startMoment = refMoment;\n\n if (/(?:heute|diese)\\s*nacht/.test(lowerText)) {\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n } else if (/^(?:ü|ue)bermorgen/.test(lowerText)) {\n startMoment = startMoment.add(refMoment.hour() > 1 ? 2 : 1, 'day');\n } else if (/^morgen/.test(lowerText)) {\n // Check not \"Tomorrow\" on late night\n if (refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n } else if (/^gestern/.test(lowerText)) {\n startMoment = startMoment.add(-1, 'day');\n } else if (/^vorgestern/.test(lowerText)) {\n startMoment = startMoment.add(-2, 'day');\n } else if (/letzte\\s*nacht/.test(lowerText)) {\n result.start.imply('hour', 0);\n if (refMoment.hour() > 6) {\n startMoment = startMoment.add(-1, 'day');\n }\n } else if (lowerText === 'jetzt') {\n result.start.imply('hour', refMoment.hour());\n result.start.imply('minute', refMoment.minute());\n result.start.imply('second', refMoment.second());\n result.start.imply('millisecond', refMoment.millisecond());\n }\n\n var secondMatch = match[3] || match[4] || match[5];\n if (secondMatch) {\n switch (secondMatch.toLowerCase()) {\n case 'morgen':\n result.start.imply('hour', 6);\n break;\n case 'vormittag':\n result.start.imply('hour', 9);\n break;\n case 'mittag':\n result.start.imply('hour', 12);\n break;\n case 'nachmittag':\n result.start.imply('hour', 15);\n result.start.imply('meridiem', 1);\n break;\n case 'abend':\n result.start.imply('hour', 18);\n result.start.imply('meridiem', 1);\n break;\n case 'nacht':\n result.start.imply('hour', 0);\n break;\n }\n }\n\n result.start.assign('day', startMoment.date())\n result.start.assign('month', startMoment.month() + 1)\n result.start.assign('year', startMoment.year())\n result.tags['DECasualDateParser'] = true;\n return result;\n }\n}\n","/*\n\n The parser for parsing month name and year.\n\n EX.\n - januari\n - januari 2012\n - januari, 2012\n*/\nvar parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/NL');\n\nvar PATTERN = new RegExp('(^|\\\\D\\\\s+|[^\\\\w\\\\s])' +\n '('+ util.MONTH_PATTERN +')' +\n '\\\\s*' +\n '(?:' +\n '[,-]?\\\\s*([0-9]{4})(\\\\s*BE|n\\.Chr\\.|v\\.Chr\\.)?' +\n ')?' +\n '(?=[^\\\\s\\\\w]|\\\\s+[^0-9]|\\\\s+$|$)', 'i');\n\nvar MONTH_NAME_GROUP = 2;\nvar YEAR_GROUP = 3;\nvar YEAR_BE_GROUP = 4;\n\nexports.Parser = function ENMonthNameParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n const result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n const day = 1;\n const monthName = match[MONTH_NAME_GROUP];\n const month = util.MONTH_OFFSET[monthName.toLowerCase()];\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n year = parseInt(year);\n\n if(match[YEAR_BE_GROUP]){\n if (match[YEAR_BE_GROUP].match(/BE/)) {\n // Buddhist Era\n year = year - 543;\n } else if (match[YEAR_BE_GROUP].match(/v\\.Chr\\./)) {\n // Before Christ\n year = -year;\n }\n\n } else if (year < 100){\n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month)\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n if (result.text.match(/^\\w{3}$/)) {\n return false;\n }\n\n result.tags['NLMonthNameParser'] = true;\n return result;\n }\n}\n","const parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/NL');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:op\\\\s*?)?' +\n '(?:'+ '(' + util.WEEKDAY_PATTERN + ')' + '\\\\s*,?\\\\s*)?' +\n '([0-9]{1,2})\\.?' +\n '(?:\\\\s*(?:tot|\\\\-|\\\\–|tot en met|t\\\\/m)\\\\s*([0-9]{1,2})\\.?)?\\\\s*' +\n '(' + util.MONTH_PATTERN + ')' +\n '(?:' +\n '(?:-|\\/|,?\\\\s*)' +\n '((?:' +\n '[1-9][0-9]{0,3}\\\\s*(?:BE|n\\.Chr\\.|v\\.Chr\\.)|' +\n '[1-2][0-9]{3}|' +\n '[5-9][0-9]' +\n ')(?![^\\\\s]\\\\d))' +\n ')?' +\n '(?=\\\\W|$)', 'i'\n );\nvar WEEKDAY_GROUP = 2;\nvar DATE_GROUP = 3;\nvar DATE_TO_GROUP = 4;\nvar MONTH_NAME_GROUP = 5;\nvar YEAR_GROUP = 6;\n\nexports.Parser = function ENMonthNameLittleEndianParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; };\n\n this.extract = function(text, ref, match, opt){\n\n var result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref\n });\n\n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n\n var day = match[DATE_GROUP];\n day = parseInt(day);\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n\n if (/BE/i.test(year)) {\n // Buddhist Era\n year = year.replace(/BE/i, '');\n year = parseInt(year) - 543;\n } else if (/v\\.Chr\\./i.test(year)){\n // Before Christ\n year = year.replace(/v\\.Chr\\./i, '');\n year = -parseInt(year);\n } else if (/n\\.Chr\\./i.test(year)){\n year = year.replace(/n\\.Chr\\./i, '');\n year = parseInt(year);\n } else {\n year = parseInt(year);\n if (year < 100){\n if (year > 50) {\n year = year + 1900;\n } else {\n year = year + 2000;\n }\n }\n }\n }\n\n if(year){\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month);\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n // Weekday component\n if (match[WEEKDAY_GROUP]) {\n var weekday = match[WEEKDAY_GROUP];\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()];\n result.start.assign('weekday', weekday);\n }\n\n // Text can be 'range' value. Such as '12 - 13 januari 2012'\n if (match[DATE_TO_GROUP]) {\n var endDate = parseInt(match[DATE_TO_GROUP]);\n result.end = result.start.clone();\n result.end.assign('day', endDate);\n }\n\n result.tags['NLMonthNameLittleEndianParser'] = true;\n return result;\n };\n};\n","/*\n Date format with slash \"/\" (also \"-\" and \".\") between numbers\n - dinsdag 11/3/2015\n - 11/3/2015\n - 11/3\n - dinsdag 11.mrt.15\n*/\nvar dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/NL');\n\nvar PATTERN = new RegExp(\n '(\\\\W|^)' +\n '(?:' +\n '(?:op\\\\s*?)?' +\n '(' + util.WEEKDAY_PATTERN + ')' +\n '\\\\s*\\\\,?\\\\s*' +\n '(?:de\\\\s*)?' +\n ')?' +\n '([0-3]{0,1}[0-9]{1})[\\\\/\\\\.\\\\-]([0-1]{0,1}[0-9]{1}|' +\n util.MONTH_PATTERN +\n ')' +\n '(?:' +\n '[\\\\/\\\\.\\\\-]' +\n '([0-9]{4}\\s*\\,?\\s*|[0-9]{2}\\s*\\,?\\s*)' +\n ')?' +\n '(\\\\W|$)', 'i');\n\nvar OPENNING_GROUP = 1;\nvar ENDING_GROUP = 6;\n\nvar WEEKDAY_GROUP = 2;\nvar DAY_GROUP = 3;\nvar MONTH_GROUP = 4;\nvar YEAR_GROUP = 5;\n\nexports.Parser = function DESlashDateFormatParser(argument) {\n Parser.apply(this, arguments);\n\n this.pattern = function () { return PATTERN; };\n this.extract = function(text, ref, match, opt){\n\n if(match[OPENNING_GROUP] == '/' || match[ENDING_GROUP] == '/') {\n // Long skip, if there is some overlapping like:\n // XX[/YY/ZZ]\n // [XX/YY/]ZZ\n match.index += match[0].length\n return;\n }\n\n var index = match.index + match[OPENNING_GROUP].length;\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length - match[ENDING_GROUP].length);\n\n\n let result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n });\n\n if(text.match(/^\\d\\.\\d$/)) return;\n if(text.match(/^\\d\\.\\d{1,2}\\.\\d{1,2}$/)) return;\n\n // MM/dd -> OK\n // MM.dd -> NG\n if(!match[YEAR_GROUP] && match[0].indexOf('/') < 0) return;\n\n let year = match[YEAR_GROUP] || dayjs(ref).year() + '';\n let month = match[MONTH_GROUP];\n let day = match[DAY_GROUP];\n\n month = parseInt(month);\n if(!month) {\n month = util.MONTH_OFFSET[match[MONTH_GROUP].trim().toLowerCase()];\n }\n day = parseInt(day);\n year = parseInt(year);\n\n if (month < 1 || month > 12) return null;\n if(day < 1 || day > 31) return null;\n\n if(year < 100){\n if (year > 50) {\n year = year + 1900;\n } else {\n year = year + 2000;\n }\n }\n\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n\n //Day of week\n if(match[WEEKDAY_GROUP]) {\n result.start.assign('weekday', util.WEEKDAY_OFFSET[match[WEEKDAY_GROUP].toLowerCase()]);\n }\n\n result.tags['NLSlashDateFormatParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar DAYS_OFFSET = {\n 'zondag': 0, 'zo': 0,\n 'maandag': 1, 'ma': 1,\n 'dinsdag': 2, 'di': 2,\n 'woensdag': 3, 'wo': 3,\n 'donderdag': 4, 'do': 4,\n 'vrijdag': 5, 'vr': 5,\n 'zaterdag': 6, 'za': 6\n};\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:(?:\\\\,|\\\\(|\\\\()\\\\s*)?' +\n '(?:on\\\\s*?)?' +\n '(?:(deze|afgelopen|vorige|volgende|komende)\\\\s*(?:week)?\\\\s*)?' +\n '(' + Object.keys(DAYS_OFFSET).join('|') + ')' +\n '(?:\\\\s*(?:\\\\,|\\\\)|\\\\)))?' +\n '(?:\\\\s*(deze|afgelopen|vorige|volgende|komende)\\\\s*week)?' +\n '(?=\\\\W|$)', 'i');\n\nvar PREFIX_GROUP = 2;\nvar WEEKDAY_GROUP = 3;\nvar POSTFIX_GROUP = 4;\n\n\nexports.updateParsedComponent = function updateParsedComponent(result, ref, offset, modifier) {\n\n var startMoment = dayjs(ref);\n var startMomentFixed = false;\n var refOffset = startMoment.day();\n\n if(modifier == 'afgelopen' || modifier == 'vorige') {\n startMoment =startMoment.day(offset - 7);\n startMomentFixed = true;\n } else if(modifier == 'volgende') {\n startMoment = startMoment.day(offset + 7);\n startMomentFixed = true;\n } else if(modifier == 'deze' || modifier == 'komende') {\n startMoment = startMoment.day(offset);\n } else {\n if (Math.abs(offset - 7 - refOffset) < Math.abs(offset - refOffset)) {\n startMoment = startMoment.day(offset - 7);\n } else if (Math.abs(offset + 7 - refOffset) < Math.abs(offset - refOffset)) {\n startMoment = startMoment.day(offset + 7);\n } else {\n startMoment = startMoment.day(offset);\n }\n }\n\n result.start.assign('weekday', offset);\n if (startMomentFixed) {\n result.start.assign('day', startMoment.date());\n result.start.assign('month', startMoment.month() + 1);\n result.start.assign('year', startMoment.year());\n } else {\n result.start.imply('day', startMoment.date());\n result.start.imply('month', startMoment.month() + 1);\n result.start.imply('year', startMoment.year());\n }\n\n return result;\n};\n\n\nexports.Parser = function NLWeekdayParser() {\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; };\n\n this.extract = function(text, ref, match, opt){\n var index = match.index + match[1].length;\n var text = match[0].substr(match[1].length, match[0].length - match[1].length);\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();\n var offset = DAYS_OFFSET[dayOfWeek];\n if(offset === undefined) {\n return null;\n }\n\n var prefix = match[PREFIX_GROUP];\n var postfix = match[POSTFIX_GROUP];\n var norm = prefix || postfix;\n norm = norm || '';\n norm = norm.toLowerCase();\n\n exports.updateParsedComponent(result, ref, offset, norm);\n result.tags['NLWeekdayParser'] = true;\n\n return result;\n }\n};\n","/*\n\n\n*/\n\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar ParsedComponents = require('../../result').ParsedComponents;\n\nvar FIRST_REG_PATTERN = new RegExp(\"(^|\\\\s|T)\" +\n \"(?:(?:om|van)\\\\s*)?\" +\n \"(\\\\d{1,4}|tussen de middag|middernachts?)\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\:|\\\\:)(\\\\d{2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*uur)?\" +\n \"(?:\\\\s*(\\'s morgens|\\'s ochtends|in de ochtend|\\'s middags|in de middag|\\'s avonds|in de avond|\\'s nachts))?\" +\n \"(?=\\\\W|$)\", 'i');\n\n\nvar SECOND_REG_PATTERN = new RegExp(\"^\\\\s*\" +\n \"(\\\\-|\\\\–|\\\\~|\\\\〜|tot|\\\\?)\\\\s*\" +\n \"(\\\\d{1,4})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(\\'s morgens|\\'s ochtends|in de ochtend|\\'s middags|in de middag|\\'s avonds|in de avond|\\'s nachts))?\" +\n \"(?=\\\\W|$)\", 'i');\n\nvar HOUR_GROUP = 2;\nvar MINUTE_GROUP = 3;\nvar SECOND_GROUP = 4;\nvar AM_PM_HOUR_GROUP = 5;\n\n\nexports.Parser = function NLTimeExpressionParser() {\n Parser.apply(this, arguments);\n\n this.pattern = function() { return FIRST_REG_PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n // This pattern can be overlaped Ex. [12] AM, 1[2] AM\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n var refMoment = dayjs(ref);\n var result = new ParsedResult();\n result.ref = ref;\n result.index = match.index + match[1].length;\n result.text = match[0].substring(match[1].length);\n result.tags['NLTimeExpressionParser'] = true;\n\n result.start.imply('day', refMoment.date());\n result.start.imply('month', refMoment.month()+1);\n result.start.imply('year', refMoment.year());\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.start.assign('second', second);\n }\n\n // ----- Hours\n if (/tussen de middag/i.test(match[HOUR_GROUP])) {\n meridiem = 1;\n hour = 12;\n } else if (/middernachts?/i.test(match[HOUR_GROUP])) {\n meridiem = 0;\n hour = 0;\n } else {\n hour = parseInt(match[HOUR_GROUP]);\n }\n\n // ----- Minutes\n if(match[MINUTE_GROUP] != null){\n minute = parseInt(match[MINUTE_GROUP]);\n } else if(hour > 100) {\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP] != null) {\n if (hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP].toLowerCase();\n if (ampm === \"'s ochtends\" || ampm === 'in de ochtend' || ampm === \"'s morgens\") {\n meridiem = 0;\n if(hour == 12) hour = 0;\n } else {\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n }\n\n result.start.assign('hour', hour);\n result.start.assign('minute', minute);\n\n if (meridiem >= 0) {\n result.start.assign('meridiem', meridiem);\n } else {\n if (hour < 12) {\n result.start.imply('meridiem', 0);\n } else {\n result.start.imply('meridiem', 1);\n }\n }\n\n // ==============================================================\n // Extracting the 'to' chunk\n // ==============================================================\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n // Not accept number only result\n if (result.text.match(/^\\d+$/)) {\n return null;\n }\n return result;\n }\n\n\n\n // Pattern \"YY.YY -XXXX\" is more like timezone offset\n if (match[0].match(/^\\s*(\\+|\\-)\\s*\\d{3,4}$/)) {\n return result;\n }\n\n if(result.end == null){\n result.end = new ParsedComponents(null, result.start.date());\n }\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.end.assign('second', second);\n }\n\n hour = parseInt(match[2]);\n\n // ----- Minute\n if (match[MINUTE_GROUP]!= null) {\n\n minute = parseInt(match[MINUTE_GROUP]);\n if(minute >= 60) return result;\n\n } else if (hour > 100) {\n\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP] != null) {\n\n if (hour > 12) return null;\n\n var ampm = match[AM_PM_HOUR_GROUP].toLowerCase();\n if (ampm === '\\'s ochtends' || ampm === 'in de ochtend' || ampm === '\\'s morgens') {\n meridiem = 0;\n if(hour == 12) {\n hour = 0;\n if (!result.end.isCertain('day')) {\n result.end.imply('day', result.end.get('day') + 1);\n }\n }\n } else {\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n\n if (!result.start.isCertain('meridiem')) {\n if (meridiem == 0) {\n\n result.start.imply('meridiem', 0);\n\n if (result.start.get('hour') == 12) {\n result.start.assign('hour', 0);\n }\n\n } else {\n\n result.start.imply('meridiem', 1);\n\n if (result.start.get('hour') != 12) {\n result.start.assign('hour', result.start.get('hour') + 12);\n }\n }\n }\n }\n\n result.text = result.text + match[0];\n result.end.assign('hour', hour);\n result.end.assign('minute', minute);\n if (meridiem >= 0) {\n result.end.assign('meridiem', meridiem);\n } else {\n var startAtPM = result.start.isCertain('meridiem') && result.start.get('meridiem') == 1;\n if (startAtPM && result.start.get('hour') > hour) {\n // 10pm - 1 (am)\n result.end.imply('meridiem', 0);\n\n } else if (hour > 12) {\n result.end.imply('meridiem', 1);\n }\n }\n\n if (result.end.date().getTime() < result.start.date().getTime()) {\n result.end.imply('day', result.end.get('day') + 1)\n }\n\n return result;\n }\n}\n","var dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp(\n '(\\\\W|^)(' +\n 'nu|' +\n 'vroeg in de ochtend|'+\n '(?:van|deze)\\\\s*(morgen|ochtend|middag|avond)|' +\n '\\'s morgens|\\'s ochtends|tussen de middag|\\'s middags|\\'s avonds|'+\n '(?:deze|van)\\\\s*nacht|' +\n 'vandaag|' +\n '(?:over)?morgen(?:\\\\s*(ochtend|middag|avond|nacht))?|' +\n '(?:eer)?gister(?:\\\\s*(ochtend|middag|avond|nacht))?|' +\n 'afgelopen\\\\s*nacht' +\n ')(?=\\\\W|$)', 'i');\n\nexports.Parser = function DECasualDateParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt) {\n text = match[0].substr(match[1].length);\n\n const index = match.index + match[1].length;\n const result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n const refMoment = dayjs(ref);\n const lowerText = text.toLowerCase();\n\n var startMoment = refMoment;\n\n if (/(?:van|deze)\\s*nacht/.test(lowerText)) {\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n } else if (/^overmorgen/.test(lowerText)) {\n startMoment = startMoment.add(refMoment.hour() > 1 ? 2 : 1, 'day');\n } else if (/^morgen/.test(lowerText)) {\n // Check not \"Tomorrow\" on late night\n if (refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n } else if (/^gisteren/.test(lowerText)) {\n startMoment = startMoment.add(-1, 'day');\n } else if (/^eergisteren/.test(lowerText)) {\n startMoment = startMoment.add(-2, 'day');\n } else if (/afgelopen\\s*nacht/.test(lowerText)) {\n result.start.imply('hour', 0);\n if (refMoment.hour() > 6) {\n startMoment = startMoment.add(-1, 'day');\n }\n } else if (lowerText === 'nu') {\n result.start.imply('hour', refMoment.hour());\n result.start.imply('minute', refMoment.minute());\n result.start.imply('second', refMoment.second());\n result.start.imply('millisecond', refMoment.millisecond());\n }\n\n var secondMatch = match[3] || match[4] || match[5];\n if (secondMatch) {\n switch (secondMatch.toLowerCase()) {\n case 'vroeg in de ochtend':\n result.start.imply('hour', 6);\n break;\n case 'ochtend':\n case 'morgen':\n case '\\'s ochtends':\n case '\\'s morgends':\n result.start.imply('hour', 9);\n break;\n case 'tussen de middag':\n result.start.imply('hour', 12);\n break;\n case 'middag':\n case 'in de middag':\n case '\\'s middags':\n result.start.imply('hour', 15);\n result.start.imply('meridiem', 1);\n break;\n case 'avond':\n case \"'s avonds\":\n result.start.imply('hour', 18);\n result.start.imply('meridiem', 1);\n break;\n case 'nacht':\n case \"'s nachts\":\n result.start.imply('hour', 0);\n break;\n }\n }\n\n result.start.assign('day', startMoment.date());\n result.start.assign('month', startMoment.month() + 1);\n result.start.assign('year', startMoment.year());\n result.tags['NLCasualDateParser'] = true;\n return result;\n }\n}\n","var Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)((deze)?\\s*('s morgens|'s ochtends|in de ochtend|'s middags|in de middag|'s avonds|in de avond|'s nachts|ochtend|tussen de middag|middag|avond|nacht))/i;\n\nvar TIME_MATCH = 4;\n\nexports.Parser = function ENCasualTimeParser(){\n\n Parser.apply(this, arguments);\n\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n if(!match[TIME_MATCH]) TIME_MATCH = 3;\n\n switch (match[TIME_MATCH].toLowerCase()) {\n case 'middag':\n case 'in de middag':\n case '\\'s middags':\n result.start.imply('meridiem', 1);\n result.start.imply('hour', 15);\n break;\n\n case 'avond':\n case 'in de avond':\n case '\\'s avonds':\n result.start.imply('meridiem', 1);\n result.start.imply('hour', 20);\n break;\n\n case 'middernacht':\n case 'nacht':\n case '\\'s nachts':\n result.start.imply('meridiem', 0);\n result.start.imply('hour', 0);\n break;\n\n case 'ochtend':\n case '\\s morgens':\n case '\\s ochtends':\n case 'in de ochtend':\n result.start.imply('meridiem', 0);\n result.start.imply('hour', 9);\n break;\n\n case 'tussen de middag':\n result.start.imply('meridiem', 0);\n result.start.imply('hour', 12);\n break;\n }\n\n result.tags['NLCasualTimeParser'] = true;\n return result;\n };\n};\n","/*\n \n*/\nvar Refiner = require('./refiner').Refiner;\n\nexports.Refiner = function OverlapRemovalRefiner() {\n\tRefiner.call(this);\n\t\n\n\tthis.refine = function(text, results, opt) { \n\n if (results.length < 2) return results;\n \n var filteredResults = [];\n var prevResult = results[0];\n \n for (var i=1; i prevResult.text.length){\n prevResult = result;\n }\n \n } else {\n filteredResults.push(prevResult);\n prevResult = result;\n }\n }\n \n // The last one\n if (prevResult != null) {\n filteredResults.push(prevResult);\n }\n\n return filteredResults;\n }\n}","/*\n \n*/\nvar Refiner = require('./refiner').Refiner;\n\n\nvar TIMEZONE_OFFSET_PATTERN = new RegExp(\"^\\\\s*(GMT|UTC)?(\\\\+|\\\\-)(\\\\d{1,2}):?(\\\\d{2})\", 'i');\nvar TIMEZONE_OFFSET_SIGN_GROUP = 2;\nvar TIMEZONE_OFFSET_HOUR_OFFSET_GROUP = 3;\nvar TIMEZONE_OFFSET_MINUTE_OFFSET_GROUP = 4;\n\nexports.Refiner = function ExtractTimezoneOffsetRefiner() {\n Refiner.call(this);\n\n this.refine = function(text, results, opt) {\n\n results.forEach(function(result) {\n\n if (result.start.isCertain('timezoneOffset')) {\n return;\n }\n\n var match = TIMEZONE_OFFSET_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n return;\n }\n\n var hourOffset = parseInt(match[TIMEZONE_OFFSET_HOUR_OFFSET_GROUP]);\n var minuteOffset = parseInt(match[TIMEZONE_OFFSET_MINUTE_OFFSET_GROUP]);\n var timezoneOffset = hourOffset * 60 + minuteOffset;\n if (match[TIMEZONE_OFFSET_SIGN_GROUP] === '-') {\n timezoneOffset = -timezoneOffset;\n }\n\n if (result.end != null) {\n result.end.assign('timezoneOffset', timezoneOffset);\n }\n\n result.start.assign('timezoneOffset', timezoneOffset);\n result.text += match[0];\n result.tags['ExtractTimezoneOffsetRefiner'] = true;\n });\n\n return results;\n }\n}\n","/*\n\n*/\nvar Refiner = require('./refiner').Refiner;\n\n// Map ABBR -> Offset in minute\nvar TIMEZONE_NAME_PATTERN = new RegExp(\"^\\\\s*\\\\(?([A-Z]{2,4})\\\\)?(?=\\\\W|$)\", 'i');\nvar DEFAULT_TIMEZONE_ABBR_MAP = {\n \"ACDT\":630,\"ACST\":570,\"ADT\":-180,\"AEDT\":660,\"AEST\":600,\"AFT\":270,\"AKDT\":-480,\"AKST\":-540,\"ALMT\":360,\"AMST\":-180,\"AMT\":-240,\"ANAST\":720,\"ANAT\":720,\"AQTT\":300,\"ART\":-180,\"AST\":-240,\"AWDT\":540,\"AWST\":480,\"AZOST\":0,\"AZOT\":-60,\"AZST\":300,\"AZT\":240,\"BNT\":480,\"BOT\":-240,\"BRST\":-120,\"BRT\":-180,\"BST\":60,\"BTT\":360,\"CAST\":480,\"CAT\":120,\"CCT\":390,\"CDT\":-300,\"CEST\":120,\"CET\":60,\"CHADT\":825,\"CHAST\":765,\"CKT\":-600,\"CLST\":-180,\"CLT\":-240,\"COT\":-300,\"CST\":-360,\"CVT\":-60,\"CXT\":420,\"ChST\":600,\"DAVT\":420,\"EASST\":-300,\"EAST\":-360,\"EAT\":180,\"ECT\":-300,\"EDT\":-240,\"EEST\":180,\"EET\":120,\"EGST\":0,\"EGT\":-60,\"EST\":-300,\"ET\":-300,\"FJST\":780,\"FJT\":720,\"FKST\":-180,\"FKT\":-240,\"FNT\":-120,\"GALT\":-360,\"GAMT\":-540,\"GET\":240,\"GFT\":-180,\"GILT\":720,\"GMT\":0,\"GST\":240,\"GYT\":-240,\"HAA\":-180,\"HAC\":-300,\"HADT\":-540,\"HAE\":-240,\"HAP\":-420,\"HAR\":-360,\"HAST\":-600,\"HAT\":-90,\"HAY\":-480,\"HKT\":480,\"HLV\":-210,\"HNA\":-240,\"HNC\":-360,\"HNE\":-300,\"HNP\":-480,\"HNR\":-420,\"HNT\":-150,\"HNY\":-540,\"HOVT\":420,\"ICT\":420,\"IDT\":180,\"IOT\":360,\"IRDT\":270,\"IRKST\":540,\"IRKT\":540,\"IRST\":210,\"IST\":330,\"JST\":540,\"KGT\":360,\"KRAST\":480,\"KRAT\":480,\"KST\":540,\"KUYT\":240,\"LHDT\":660,\"LHST\":630,\"LINT\":840,\"MAGST\":720,\"MAGT\":720,\"MART\":-510,\"MAWT\":300,\"MDT\":-360,\"MESZ\":120,\"MEZ\":60,\"MHT\":720,\"MMT\":390,\"MSD\":240,\"MSK\":240,\"MST\":-420,\"MUT\":240,\"MVT\":300,\"MYT\":480,\"NCT\":660,\"NDT\":-90,\"NFT\":690,\"NOVST\":420,\"NOVT\":360,\"NPT\":345,\"NST\":-150,\"NUT\":-660,\"NZDT\":780,\"NZST\":720,\"OMSST\":420,\"OMST\":420,\"PDT\":-420,\"PET\":-300,\"PETST\":720,\"PETT\":720,\"PGT\":600,\"PHOT\":780,\"PHT\":480,\"PKT\":300,\"PMDT\":-120,\"PMST\":-180,\"PONT\":660,\"PST\":-480,\"PT\":-480,\"PWT\":540,\"PYST\":-180,\"PYT\":-240,\"RET\":240,\"SAMT\":240,\"SAST\":120,\"SBT\":660,\"SCT\":240,\"SGT\":480,\"SRT\":-180,\"SST\":-660,\"TAHT\":-600,\"TFT\":300,\"TJT\":300,\"TKT\":780,\"TLT\":540,\"TMT\":300,\"TVT\":720,\"ULAT\":480,\"UTC\":0,\"UYST\":-120,\"UYT\":-180,\"UZT\":300,\"VET\":-210,\"VLAST\":660,\"VLAT\":660,\"VUT\":660,\"WAST\":120,\"WAT\":60,\"WEST\":60,\"WESZ\":60,\"WET\":0,\"WEZ\":0,\"WFT\":720,\"WGST\":-120,\"WGT\":-180,\"WIB\":420,\"WIT\":540,\"WITA\":480,\"WST\":780,\"WT\":0,\"YAKST\":600,\"YAKT\":600,\"YAPT\":600,\"YEKST\":360,\"YEKT\":360\n};\n\nexports.Refiner = function ExtractTimezoneAbbrRefiner(config) {\n\tRefiner.call(this, arguments);\n\n\tthis.refine = function(text, results, opt) {\n\n\t var timezones = new Object(DEFAULT_TIMEZONE_ABBR_MAP);\n\t if (opt.timezones) {\n\t for (var name in opt.timezones) {\n timezones[name] = opt.timezones[name];\n }\n }\n\n\t\tresults.forEach(function(result) {\n\n if (!result.tags['ENTimeExpressionParser'] &&\n !result.tags['ENCasualTimeParser'] &&\n !result.tags['ZHTimeExpressionParser'] &&\n !result.tags['FRTimeExpressionParser'] &&\n !result.tags['DETimeExpressionParser']) {\n return;\n }\n\n var match = TIMEZONE_NAME_PATTERN.exec(text.substring(result.index + result.text.length));\n if (match) {\n var timezoneAbbr = match[1].toUpperCase();\n if (timezones[timezoneAbbr] === undefined) {\n return;\n }\n\n var timezoneOffset = timezones[timezoneAbbr];\n if (!result.start.isCertain('timezoneOffset')) {\n result.start.assign('timezoneOffset', timezoneOffset);\n }\n\n if (result.end != null && !result.end.isCertain('timezoneOffset')) {\n result.end.assign('timezoneOffset', timezoneOffset);\n }\n\n result.text += match[0];\n result.tags['ExtractTimezoneAbbrRefiner'] = true;\n }\n\t\t});\n\n return results;\n\t}\n};","/*\n Enforce 'forwardDate' option to on the results. When there are missing component,\n e.g. \"March 12-13 (without year)\" or \"Thursday\", the refiner will try to adjust the result\n into the future instead of the past.\n*/\nvar dayjs = require('dayjs');\nvar Refiner = require('./refiner').Refiner;\n\nexports.Refiner = function ForwardDateRefiner() {\n Refiner.call(this);\n\n this.refine = function(text, results, opt) {\n\n if (!opt['forwardDate']) {\n return results;\n }\n\n results.forEach(function(result) {\n\n var refMoment = dayjs(result.ref);\n\n if (result.start.isOnlyDayMonthComponent() && refMoment.isAfter(result.start.dayjs())\n ) {\n // Adjust year into the future\n for (var i=0; i < 3 && refMoment.isAfter(result.start.dayjs()); i++) {\n result.start.imply('year', result.start.get('year') + 1);\n\n if (result.end && !result.end.isCertain('year')) {\n result.end.imply('year', result.end.get('year') + 1);\n }\n }\n\n result.tags['ForwardDateRefiner'] = true;\n }\n\n if (result.start.isOnlyWeekdayComponent() && refMoment.isAfter(result.start.dayjs())) {\n // Adjust date to the coming week\n if (refMoment.day() > result.start.get('weekday')) {\n refMoment = refMoment.day(result.start.get('weekday') + 7);\n } else {\n refMoment = refMoment.day(result.start.get('weekday'));\n }\n\n result.start.imply('day', refMoment.date());\n result.start.imply('month', refMoment.month() + 1);\n result.start.imply('year', refMoment.year());\n result.tags['ForwardDateRefiner'] = true;\n }\n });\n\n return results;\n }\n};\n","/*\n \n*/\nvar Filter = require('./refiner').Filter;\n\nexports.Refiner = function UnlikelyFormatFilter() {\n Filter.call(this);\n \n\n this.isValid = function(text, result, opt) { \n\n if (result.text.replace(' ','').match(/^\\d*(\\.\\d*)?$/)) {\n return false;\n }\n\n return true; \n }\n}","/*\n\n*/\nvar ParsedComponents = require('../../result').ParsedComponents;\nvar Refiner = require('../refiner').Refiner;\n\n\nvar PATTERN = new RegExp(\"^\\\\s*(at|after|before|on|,|-|\\\\(|\\\\))?\\\\s*$\");\n\nfunction isMoreSpecific(prevResult, currResult) {\n var moreSpecific = false;\n\n if (prevResult.start.isCertain('year')) {\n if (!currResult.start.isCertain('year')) {\n moreSpecific = true;\n } else {\n if (prevResult.start.isCertain('month')) {\n if (!currResult.start.isCertain('month')) {\n moreSpecific = true;\n } else {\n if (prevResult.start.isCertain('day') && !currResult.start.isCertain('day')) {\n moreSpecific = true;\n }\n }\n }\n }\n }\n\n return moreSpecific;\n}\n\n\nfunction isAbleToMerge(text, prevResult, currResult) {\n var textBetween = text.substring(prevResult.index + prevResult.text.length, currResult.index);\n\n // Only accepts merge if one of them comes from casual relative date\n var includesRelativeResult = (prevResult.tags['ENRelativeDateFormatParser'] || currResult.tags['ENRelativeDateFormatParser']);\n\n // We assume they refer to the same date if all date fields are implied\n var referToSameDate = !prevResult.start.isCertain('day') && !prevResult.start.isCertain('month') && !prevResult.start.isCertain('year');\n\n // If both years are certain, that determines if they refer to the same date\n // but with one more specific than the other\n if (prevResult.start.isCertain('year') && currResult.start.isCertain('year'))\n referToSameDate = (prevResult.start.get('year') === currResult.start.get('year'));\n\n // We now test with the next level (month) if they refer to the same date\n if (prevResult.start.isCertain('month') && currResult.start.isCertain('month'))\n referToSameDate = (prevResult.start.get('month') === currResult.start.get('month')) && referToSameDate;\n\n return includesRelativeResult && textBetween.match(PATTERN) && referToSameDate;\n}\n\nfunction mergeResult(text, specificResult, nonSpecificResult){\n\n var specificDate = specificResult.start;\n var nonSpecificDate = nonSpecificResult.start;\n\n var startIndex = Math.min(specificResult.index, nonSpecificResult.index);\n var endIndex = Math.max(\n specificResult.index + specificResult.text.length,\n nonSpecificResult.index + nonSpecificResult.text.length);\n\n specificResult.index = startIndex;\n specificResult.text = text.substring(startIndex, endIndex);\n\n for (var tag in nonSpecificResult.tags) {\n specificResult.tags[tag] = true;\n }\n specificResult.tags['ENPrioritizeSpecificDateRefiner'] = true;\n return specificResult;\n}\n\nexports.Refiner = function ENPrioritizeSpecificDateRefiner() {\n Refiner.call(this);\n\n this.refine = function(text, results, opt) {\n\n if (results.length < 2) return results;\n\n var mergedResult = [];\n var currResult = null;\n var prevResult = null;\n\n for (var i = 1; i < results.length; i++) {\n\n currResult = results[i];\n prevResult = results[i-1];\n\n if (isMoreSpecific(prevResult, currResult)\n && isAbleToMerge(text, prevResult, currResult)) {\n\n prevResult = mergeResult(text, prevResult, currResult);\n currResult = null;\n i += 1;\n\n } else if (isMoreSpecific(currResult, prevResult)\n && isAbleToMerge(text, prevResult, currResult)) {\n\n prevResult = mergeResult(text, currResult, prevResult);\n currResult = null;\n i += 1;\n }\n\n mergedResult.push(prevResult);\n }\n\n if (currResult != null) {\n mergedResult.push(currResult);\n }\n\n return mergedResult;\n }\n}\n","/*\n \n*/\nvar ENMergeDateRangeRefiner = require('../en/ENMergeDateRangeRefiner').Refiner;\n\nexports.Refiner = function JPMergeDateRangeRefiner() {\n ENMergeDateRangeRefiner.call(this);\n\n this.pattern = function () { return /^\\s*(から|ー)\\s*$/i };\n}\n\n","/*\r\n \r\n*/\r\nvar Refiner = require('../refiner').Refiner;\r\n\r\nexports.Refiner = function FRMergeDateRangeRefiner() {\r\n Refiner.call(this);\r\n\r\n this.pattern = function () { return /^\\s*(à|a|\\-)\\s*$/i };\r\n\r\n this.refine = function(text, results, opt) {\r\n\r\n if (results.length < 2) return results;\r\n \r\n var mergedResult = [];\r\n var currResult = null;\r\n var prevResult = null;\r\n \r\n for (var i=1; i toResult.start.date()) {\r\n var tmp = toResult;\r\n toResult = fromResult;\r\n fromResult = tmp;\r\n }\r\n \r\n fromResult.end = toResult.start;\r\n\r\n \r\n\r\n for (var tag in toResult.tags) {\r\n fromResult.tags[tag] = true;\r\n }\r\n\r\n \r\n var startIndex = Math.min(fromResult.index, toResult.index);\r\n var endIndex = Math.max(\r\n fromResult.index + fromResult.text.length, \r\n toResult.index + toResult.text.length);\r\n \r\n fromResult.index = startIndex;\r\n fromResult.text = text.substring(startIndex, endIndex);\r\n fromResult.tags[this.constructor.name] = true;\r\n return fromResult;\r\n }\r\n};\r\n\r\n","/*\r\n \r\n*/\r\nvar ParsedComponents = require('../../result').ParsedComponents;\r\nvar Refiner = require('../refiner').Refiner;\r\nvar mergeDateTimeComponent = require('../en/ENMergeDateTimeRefiner').mergeDateTimeComponent;\r\n\r\nvar PATTERN = new RegExp(\"^\\\\s*(T|à|a|vers|de|,|-)?\\\\s*$\");\r\n\r\nfunction isDateOnly(result) {\r\n return !result.start.isCertain('hour') || result.tags['FRCasualDateParser'];\r\n}\r\n \r\nfunction isTimeOnly(result) {\r\n return !result.start.isCertain('month') && !result.start.isCertain('weekday');\r\n}\r\n\r\n\r\nfunction isAbleToMerge(text, prevResult, curResult) {\r\n var textBetween = text.substring(prevResult.index + prevResult.text.length, curResult.index);\r\n return textBetween.match(PATTERN);\r\n}\r\n\r\nfunction mergeResult(text, dateResult, timeResult){\r\n\r\n var beginDate = dateResult.start;\r\n var beginTime = timeResult.start;\r\n var beginDateTime = mergeDateTimeComponent(beginDate, beginTime);\r\n\r\n if (dateResult.end != null || timeResult.end != null) {\r\n \r\n var endDate = dateResult.end == null ? dateResult.start : dateResult.end; \r\n var endTime = timeResult.end == null ? timeResult.start : timeResult.end;\r\n var endDateTime = mergeDateTimeComponent(endDate, endTime);\r\n \r\n if (dateResult.end == null && endDateTime.date().getTime() < beginDateTime.date().getTime()) {\r\n // Ex. 9pm - 1am\r\n if (endDateTime.isCertain('day')) {\r\n endDateTime.assign('day', endDateTime.get('day') + 1);\r\n } else {\r\n endDateTime.imply('day', endDateTime.get('day') + 1);\r\n }\r\n }\r\n\r\n dateResult.end = endDateTime;\r\n }\r\n\r\n dateResult.start = beginDateTime; \r\n\r\n var startIndex = Math.min(dateResult.index, timeResult.index);\r\n var endIndex = Math.max(\r\n dateResult.index + dateResult.text.length, \r\n timeResult.index + timeResult.text.length);\r\n \r\n dateResult.index = startIndex;\r\n dateResult.text = text.substring(startIndex, endIndex);\r\n\r\n for (var tag in timeResult.tags) {\r\n dateResult.tags[tag] = true;\r\n }\r\n dateResult.tags['FRMergeDateAndTimeRefiner'] = true;\r\n return dateResult;\r\n}\r\n\r\nexports.Refiner = function FRMergeDateTimeRefiner() {\r\n Refiner.call(this);\r\n\r\n\r\n this.refine = function(text, results, opt) { \r\n\r\n if (results.length < 2) return results;\r\n\r\n var mergedResult = [];\r\n var currResult = null;\r\n var prevResult = null;\r\n\r\n for (var i = 1; i < results.length; i++) {\r\n\r\n currResult = results[i];\r\n prevResult = results[i-1];\r\n \r\n if (isDateOnly(prevResult) && isTimeOnly(currResult) \r\n && isAbleToMerge(text, prevResult, currResult)) {\r\n \r\n prevResult = mergeResult(text, prevResult, currResult);\r\n currResult = null;\r\n i += 1;\r\n \r\n } else if (isDateOnly(currResult) && isTimeOnly(prevResult)\r\n && isAbleToMerge(text, prevResult, currResult)) {\r\n \r\n prevResult = mergeResult(text, currResult, prevResult);\r\n currResult = null;\r\n i += 1;\r\n }\r\n \r\n mergedResult.push(prevResult);\r\n }\r\n\r\n if (currResult != null) {\r\n mergedResult.push(currResult);\r\n }\r\n\r\n return mergedResult;\r\n }\r\n}","/*\n \n*/\nvar ENMergeDateRangeRefiner = require('../en/ENMergeDateRangeRefiner').Refiner;\n\nexports.Refiner = function DEMergeDateRangeRefiner() {\n ENMergeDateRangeRefiner.call(this);\n\n this.pattern = function () {\n return /^\\s*(bis(?:\\s*(?:am|zum))?|\\-)\\s*$/i\n };\n};\n","/*\n \n*/\nvar ParsedComponents = require('../../result').ParsedComponents;\nvar Refiner = require('../refiner').Refiner;\n\nvar mergeDateTimeComponent = require('../en/ENMergeDateTimeRefiner').mergeDateTimeComponent;\nvar isDateOnly = require('../en/ENMergeDateTimeRefiner').isDateOnly;\nvar isTimeOnly = require('../en/ENMergeDateTimeRefiner').isTimeOnly;\n\nvar PATTERN = new RegExp(\"^\\\\s*(T|um|am|,|-)?\\\\s*$\");\n\nfunction isAbleToMerge(text, prevResult, curResult) {\n var textBetween = text.substring(prevResult.index + prevResult.text.length, curResult.index);\n return textBetween.match(PATTERN);\n}\n\nfunction mergeResult(text, dateResult, timeResult){\n\n var beginDate = dateResult.start;\n var beginTime = timeResult.start; \n var beginDateTime = mergeDateTimeComponent(beginDate, beginTime);\n\n if (dateResult.end != null || timeResult.end != null) {\n \n var endDate = dateResult.end == null ? dateResult.start : dateResult.end; \n var endTime = timeResult.end == null ? timeResult.start : timeResult.end;\n var endDateTime = mergeDateTimeComponent(endDate, endTime);\n \n if (dateResult.end == null && endDateTime.date().getTime() < beginDateTime.date().getTime()) {\n // Ex. 9pm - 1am\n if (endDateTime.isCertain('day')) {\n endDateTime.assign('day', endDateTime.get('day') + 1);\n } else {\n endDateTime.imply('day', endDateTime.get('day') + 1);\n }\n }\n\n dateResult.end = endDateTime;\n }\n\n dateResult.start = beginDateTime; \n\n var startIndex = Math.min(dateResult.index, timeResult.index);\n var endIndex = Math.max(\n dateResult.index + dateResult.text.length, \n timeResult.index + timeResult.text.length);\n \n dateResult.index = startIndex;\n dateResult.text = text.substring(startIndex, endIndex);\n\n for (var tag in timeResult.tags) {\n dateResult.tags[tag] = true;\n }\n dateResult.tags['DEMergeDateAndTimeRefiner'] = true;\n return dateResult;\n}\n\nexports.Refiner = function DEMergeDateTimeRefiner() {\n Refiner.call(this);\n\n\n this.refine = function(text, results, opt) { \n\n if (results.length < 2) return results;\n\n var mergedResult = [];\n var currResult = null;\n var prevResult = null;\n\n for (var i = 1; i < results.length; i++) {\n\n currResult = results[i];\n prevResult = results[i-1];\n \n if (isDateOnly(prevResult) && isTimeOnly(currResult) \n && isAbleToMerge(text, prevResult, currResult)) {\n \n prevResult = mergeResult(text, prevResult, currResult);\n currResult = null;\n i += 1;\n \n } else if (isDateOnly(currResult) && isTimeOnly(prevResult)\n && isAbleToMerge(text, prevResult, currResult)) {\n \n prevResult = mergeResult(text, currResult, prevResult);\n currResult = null;\n i += 1;\n }\n \n mergedResult.push(prevResult);\n }\n\n if (currResult != null) {\n mergedResult.push(currResult);\n }\n\n return mergedResult;\n }\n}","/*\n\n*/\nvar ENMergeDateRangeRefiner = require('../en/ENMergeDateRangeRefiner').Refiner;\n\nexports.Refiner = function NLMergeDateRangeRefiner() {\n ENMergeDateRangeRefiner.call(this);\n\n this.pattern = function () {\n return /^\\s*(tot|t\\/m|tot en met|\\\\-)\\s*$/i;\n };\n};\n","/*\n\n*/\nvar ParsedComponents = require('../../result').ParsedComponents;\nvar Refiner = require('../refiner').Refiner;\n\nvar mergeDateTimeComponent = require('../en/ENMergeDateTimeRefiner').mergeDateTimeComponent;\nvar isDateOnly = require('../en/ENMergeDateTimeRefiner').isDateOnly;\nvar isTimeOnly = require('../en/ENMergeDateTimeRefiner').isTimeOnly;\n\nvar PATTERN = new RegExp(\"^\\\\s*(T|op|om|voor|na|van|,|-)\\\\s*$\");\n\nfunction isAbleToMerge(text, prevResult, curResult) {\n var textBetween = text.substring(prevResult.index + prevResult.text.length, curResult.index);\n return textBetween.match(PATTERN);\n}\n\nfunction mergeResult(text, dateResult, timeResult){\n\n var beginDate = dateResult.start;\n var beginTime = timeResult.start;\n var beginDateTime = mergeDateTimeComponent(beginDate, beginTime);\n\n if (dateResult.end != null || timeResult.end != null) {\n\n var endDate = dateResult.end == null ? dateResult.start : dateResult.end;\n var endTime = timeResult.end == null ? timeResult.start : timeResult.end;\n var endDateTime = mergeDateTimeComponent(endDate, endTime);\n\n if (dateResult.end == null && endDateTime.date().getTime() < beginDateTime.date().getTime()) {\n // Ex. 9pm - 1am\n if (endDateTime.isCertain('day')) {\n endDateTime.assign('day', endDateTime.get('day') + 1);\n } else {\n endDateTime.imply('day', endDateTime.get('day') + 1);\n }\n }\n\n dateResult.end = endDateTime;\n }\n\n dateResult.start = beginDateTime;\n\n var startIndex = Math.min(dateResult.index, timeResult.index);\n var endIndex = Math.max(\n dateResult.index + dateResult.text.length,\n timeResult.index + timeResult.text.length);\n\n dateResult.index = startIndex;\n dateResult.text = text.substring(startIndex, endIndex);\n\n for (var tag in timeResult.tags) {\n dateResult.tags[tag] = true;\n }\n dateResult.tags['NLMergeDateAndTimeRefiner'] = true;\n return dateResult;\n}\n\nexports.Refiner = function NLMergeDateTimeRefiner() {\n Refiner.call(this);\n\n\n this.refine = function(text, results, opt) {\n\n if (results.length < 2) return results;\n\n var mergedResult = [];\n var currResult = null;\n var prevResult = null;\n\n for (var i = 1; i < results.length; i++) {\n\n currResult = results[i];\n prevResult = results[i-1];\n if (isDateOnly(currResult) && isTimeOnly(prevResult)\n && isAbleToMerge(text, prevResult, currResult)) {\n\n prevResult = mergeResult(text, currResult, prevResult);\n currResult = null;\n i += 1;\n mergedResult.push(prevResult);\n } else {\n mergedResult.push(prevResult);\n }\n\n }\n\n if (currResult != null) {\n mergedResult.push(currResult);\n }\n\n return mergedResult;\n }\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/chrono.min.js b/dist/chrono.min.js index 234d7642..fe1acae3 100644 --- a/dist/chrono.min.js +++ b/dist/chrono.min.js @@ -1,3 +1,3 @@ /*! For license information please see chrono.min.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.chrono=t():e.chrono=t()}(this,(function(){return function(e){var t={};function a(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,a),n.l=!0,n.exports}return a.m=e,a.c=t,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=12)}([function(e,t,a){var r=a(2);function n(e){e=e||{},this.ref=e.ref,this.index=e.index,this.text=e.text,this.tags=e.tags||{},this.start=new s(e.start,e.ref),e.end&&(this.end=new s(e.end,e.ref))}function s(e,t){if(this.knownValues={},this.impliedValues={},e)for(var a in e)this.knownValues[a]=e[a];t&&(t=r(t),this.imply("day",t.date()),this.imply("month",t.month()+1),this.imply("year",t.year())),this.imply("hour",12),this.imply("minute",0),this.imply("second",0),this.imply("millisecond",0)}n.prototype.clone=function(){var e=new n(this);return e.tags=JSON.parse(JSON.stringify(this.tags)),e.start=this.start.clone(),this.end&&(e.end=this.end.clone()),e},n.prototype.date=function(){return this.start.date()},n.prototype.hasPossibleDates=function(){return this.start.isPossibleDate()&&(!this.end||this.end.isPossibleDate())},n.prototype.isOnlyWeekday=function(){return this.start.isOnlyWeekdayComponent()},n.prototype.isOnlyDayMonth=function(){return this.start.isOnlyDayMonthComponent()},s.prototype.clone=function(){var e=new s;return e.knownValues=JSON.parse(JSON.stringify(this.knownValues)),e.impliedValues=JSON.parse(JSON.stringify(this.impliedValues)),e},s.prototype.get=function(e,t){return e in this.knownValues?this.knownValues[e]:e in this.impliedValues?this.impliedValues[e]:void 0},s.prototype.assign=function(e,t){this.knownValues[e]=t,delete this.impliedValues[e]},s.prototype.imply=function(e,t){e in this.knownValues||(this.impliedValues[e]=t)},s.prototype.isCertain=function(e){return e in this.knownValues},s.prototype.isOnlyWeekdayComponent=function(){return this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")},s.prototype.isOnlyDayMonthComponent=function(){return this.isCertain("day")&&this.isCertain("month")&&!this.isCertain("year")},s.prototype.isPossibleDate=function(){var e=this.dayjs();if(this.isCertain("timezoneOffset")){var t=this.get("timezoneOffset")-e.utcOffset();e=e.add(t,"minutes")}return e.get("year")==this.get("year")&&(e.get("month")==this.get("month")-1&&(e.get("date")==this.get("day")&&(e.get("hour")==this.get("hour")&&e.get("minute")==this.get("minute"))))},s.prototype.date=function(){return this.dayjs().toDate()},s.prototype.dayjs=function(){var e=r(),t=(e=(e=(e=(e=(e=(e=(e=e.year(this.get("year"))).month(this.get("month")-1)).date(this.get("day"))).hour(this.get("hour"))).minute(this.get("minute"))).second(this.get("second"))).millisecond(this.get("millisecond"))).utcOffset(),a=(void 0!==this.get("timezoneOffset")?this.get("timezoneOffset"):t)-t;return e=e.add(-a,"minute")},s.prototype.moment=function(){return this.dayjs()},t.ParsedComponents=s,t.ParsedResult=n},function(e,t,a){var r=a(2);t.Parser=function(e){var t=(e=e||{}).strict;this.isStrictMode=function(){return 1==t},this.pattern=function(){return/./i},this.extract=function(e,t,a,r){return null},this.execute=function(e,t,a){for(var r=[],n=this.pattern(),s=e,i=n.exec(s);i;){i.index+=e.length-s.length;var o=this.extract(e,t,i,a);o?(s=e.substring(o.index+o.text.length),this.isStrictMode()&&!o.hasPossibleDates()||r.push(o)):s=e.substring(i.index+1),i=n.exec(s)}return this.refiners&&this.refiners.forEach((function(){r=refiner.refine(r,e,options)})),r}},t.findYearClosestToRef=function(e,t,a){var n=r(e),s=n,i=(s=(s=(s=s.month(a-1)).date(t)).year(n.year())).add(1,"y"),o=s.add(-1,"y");return Math.abs(i.diff(n))=t?e:""+Array(t+1-r.length).join(a)+e},h={s:l,z:function(e){var t=-e.utcOffset(),a=Math.abs(t),r=Math.floor(a/60),n=a%60;return(t<=0?"+":"-")+l(r,2,"0")+":"+l(n,2,"0")},m:function(e,t){var a=12*(t.year()-e.year())+(t.month()-e.month()),r=e.clone().add(a,i),n=t-r<0,s=e.clone().add(a+(n?-1:1),i);return Number(-(a+(t-r)/(n?r-s:s-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(u){return{M:i,y:d,w:s,d:n,D:"date",h:r,m:a,s:t,ms:e,Q:o}[u]||String(u||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},c={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},g="en",f={};f[g]=c;var y=function(e){return e instanceof P},p=function(e,t,a){var r;if(!e)return g;if("string"==typeof e)f[e]&&(r=e),t&&(f[e]=t,r=e);else{var n=e.name;f[n]=e,r=n}return!a&&r&&(g=r),r||!a&&g},v=function(e,t){if(y(e))return e.clone();var a="object"==typeof t?t:{};return a.date=e,a.args=arguments,new P(a)},x=h;x.l=p,x.i=y,x.w=function(e,t){return v(e,{locale:t.$L,utc:t.$u,$offset:t.$offset})};var P=function(){function l(e){this.$L=this.$L||p(e.locale,null,!0),this.parse(e)}var h=l.prototype;return h.parse=function(e){this.$d=function(e){var t=e.date,a=e.utc;if(null===t)return new Date(NaN);if(x.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(u);if(r)return a?new Date(Date.UTC(r[1],r[2]-1,r[3]||1,r[4]||0,r[5]||0,r[6]||0,r[7]||0)):new Date(r[1],r[2]-1,r[3]||1,r[4]||0,r[5]||0,r[6]||0,r[7]||0)}return new Date(t)}(e),this.init()},h.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},h.$utils=function(){return x},h.isValid=function(){return!("Invalid Date"===this.$d.toString())},h.isSame=function(e,t){var a=v(e);return this.startOf(t)<=a&&a<=this.endOf(t)},h.isAfter=function(e,t){return v(e)a.start.date().getTime()){var n=t.start.dayjs(),s=a.start.dayjs();if(t.isOnlyWeekday()&&n.add(-7,"days").isBefore(s))n=n.add(-7,"days"),t.start.imply("day",n.date()),t.start.imply("month",n.month()+1),t.start.imply("year",n.year());else if(a.isOnlyWeekday()&&s.add(7,"days").isAfter(n))s=s.add(7,"days"),a.start.imply("day",s.date()),a.start.imply("month",s.month()+1),a.start.imply("year",s.year());else{var i=a;a=t,t=i}}for(var o in t.end=a.start,a.tags)t.tags[o]=!0;var d=Math.min(t.index,a.index),u=Math.max(t.index+t.text.length,a.index+a.text.length);return t.index=d,t.text=e.substring(d,u),t.tags[this.constructor.name]=!0,t}}},function(e,t){t.WEEKDAY_OFFSET={dimanche:0,dim:0,lundi:1,lun:1,mardi:2,mar:2,mercredi:3,mer:3,jeudi:4,jeu:4,vendredi:5,ven:5,samedi:6,sam:6},t.MONTH_OFFSET={janvier:1,jan:1,"jan.":1,"février":2,"fév":2,"fév.":2,fevrier:2,fev:2,"fev.":2,mars:3,mar:3,"mar.":3,avril:4,avr:4,"avr.":4,mai:5,juin:6,jun:6,juillet:7,jul:7,"jul.":7,"août":8,aout:8,septembre:9,sep:9,"sep.":9,sept:9,"sept.":9,octobre:10,oct:10,"oct.":10,novembre:11,nov:11,"nov.":11,"décembre":12,decembre:12,dec:12,"dec.":12},t.INTEGER_WORDS_PATTERN="(?:un|deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize)",t.INTEGER_WORDS={un:1,deux:2,trois:3,quatre:4,cinq:5,six:6,sept:7,huit:8,neuf:9,dix:10,onze:11,douze:12,treize:13}},function(e,t){t.WEEKDAY_OFFSET={zondag:0,zo:0,"zo.":0,maandag:1,ma:1,"ma.":1,dinsdag:2,di:2,"di.":2,woensdag:3,wo:3,"wo.":3,donderdag:4,do:4,"do.":4,vrijdag:5,vr:5,"vr.":5,zaterdag:6,za:6,"za.":6},t.WEEKDAY_PATTERN="(?:"+Object.keys(t.WEEKDAY_OFFSET).join("|").replace(/\./g,"\\.")+")",t.MONTH_OFFSET={januari:1,jan:1,"jan.":1,februari:2,feb:2,"feb.":2,maart:3,mrt:3,"mrt.":3,april:4,apr:4,"apr.":4,mei:5,juni:6,jun:6,"jun.":6,juli:7,jul:7,"jul.":7,augustus:8,aug:8,"aug.":8,september:9,sep:9,"sep.":9,sept:9,"sept.":9,oktober:10,okt:10,"okt.":10,november:11,nov:11,"nov.":11,december:12,dec:12,"dec.":12},t.MONTH_PATTERN="(?:"+Object.keys(t.MONTH_OFFSET).join("|").replace(/\./g,"\\.")+")",t.INTEGER_WORDS={een:1,"één":1,twee:2,drie:3,vier:4,vijf:5,zes:6,zeven:7,acht:8,negen:9,tien:10,elf:11,twaalf:12},t.INTEGER_WORDS_PATTERN="(?:"+Object.keys(t.INTEGER_WORDS).join("|")+")",t.ORDINAL_WORDS={eerste:1,tweede:2,derde:3,vierde:4,vijfde:5,zesde:6,zevende:7,achste:8,negende:9,tiende:10,elfde:11,twaalfde:12,dertiende:13,veertiende:14,vijftiende:15,zestiende:16,zeventiende:17,achttiende:18,negentiende:19,twintigste:20,eenentwintigste:21,"tweeëntwintigste":22,"drieëntwintigste":23,vierentwintigste:24,vijfentwintigste:25,zesentwintigste:26,zevenentwintigste:27,achtentwintigste:28,negenentwintigste:29,dertigste:30,eenendertigste:31},t.ORDINAL_WORDS_PATTERN="(?:"+Object.keys(t.ORDINAL_WORDS).join("|").replace(/ /g,"[ -]")+")";var a="("+t.INTEGER_WORDS_PATTERN+"|[0-9]+|[0-9]+.[0-9]+|en(?:\\s*few)?|half)\\s*(sec(?:onde?)?|min(?:uten)?s?|(?:uur|uren)?|weken?|dagen?|maanden?|jaren?)\\s*",r=new RegExp(a,"i");function n(e,a){var r=e[1].toLowerCase();return r=void 0!==t.INTEGER_WORDS[r]?t.INTEGER_WORDS[r]:r.match(/half/)?.5:parseFloat(r),e[2].match(/^(?:uur|uren)/i)?a.hour=r:e[2].match(/min/i)?a.minute=r:e[2].match(/sec/i)?a.second=r:e[2].match(/week/i)?a.week=r:e[2].match(/dag/i)?a.d=r:e[2].match(/maand/i)?a.month=r:e[2].match(/jaar/i)&&(a.year=r),a}t.TIME_UNIT_PATTERN="(?:"+a+")+",t.TIME_UNIT_STRICT_PATTERN="(?:(?:[0-9]+?)\\s*(?:seconden?|(?:minuut|minuten)|(?:uur|uren)|(?:dag|dagen))\\s*)+",t.extractDateTimeUnitFragments=function(e){for(var t={},a=e,s=r.exec(a);s;)n(s,t),a=a.substring(s[0].length),s=r.exec(a);return t}},function(e,t,a){var r=t.options=a(13);t.parser=a(1),t.refiner=a(3),t.Parser=t.parser.Parser,t.Refiner=t.refiner.Refiner,t.Filter=t.refiner.Filter,t.ParsedResult=a(0).ParsedResult,t.ParsedComponents=a(0).ParsedComponents;var n=function(e){e=e||t.options.casualOption(),this.parsers=new Object(e.parsers),this.refiners=new Object(e.refiners)};n.prototype.parse=function(e,t,a){t=t||new Date,(a=a||{}).forwardDate=a.forwardDate||a.forwardDate;var r=[];return this.parsers.forEach((function(n){var s=n.execute(e,t,a);r=r.concat(s)})),r.sort((function(e,t){return e.index-t.index})),this.refiners.forEach((function(t){r=t.refine(e,r,a)})),r},n.prototype.parseDate=function(e,t,a){var r=this.parse(e,t,a);return r.length>0?r[0].start.date():null},t.Chrono=n,t.strict=new n(r.strictOption()),t.casual=new n(r.casualOption()),t.en=new n(r.mergeOptions([r.en.casual,r.commonPostProcessing])),t.en_GB=new n(r.mergeOptions([r.en_GB.casual,r.commonPostProcessing])),t.de=new n(r.mergeOptions([r.de.casual,r.en,r.commonPostProcessing])),t.nl=new n(r.mergeOptions([r.nl.casual,r.en,r.commonPostProcessing])),t.pt=new n(r.mergeOptions([r.pt.casual,r.en,r.commonPostProcessing])),t.es=new n(r.mergeOptions([r.es.casual,r.en,r.commonPostProcessing])),t.fr=new n(r.mergeOptions([r.fr.casual,r.en,r.commonPostProcessing])),t.ja=new n(r.mergeOptions([r.ja.casual,r.en,r.commonPostProcessing])),t.parse=function(){return t.casual.parse.apply(t.casual,arguments)},t.parseDate=function(){return t.casual.parseDate.apply(t.casual,arguments)}},function(e,t,a){var r=a(1),n=a(3);t.mergeOptions=function(e){var t={},a={parsers:[],refiners:[]};return e.forEach((function(e){e.call&&(e=e.call()),e.parsers&&e.parsers.forEach((function(e){t[e.constructor]||(a.parsers.push(e),t[e.constructor]=!0)})),e.refiners&&e.refiners.forEach((function(e){t[e.constructor]||(a.refiners.push(e),t[e.constructor]=!0)}))})),a},t.commonPostProcessing=function(){return{refiners:[new n.ExtractTimezoneOffsetRefiner,new n.ExtractTimezoneAbbrRefiner,new n.UnlikelyFormatFilter]}},t.strictOption=function(){var e={strict:!0};return t.mergeOptions([t.en(e),t.de(e),t.nl(e),t.pt(e),t.es(e),t.fr(e),t.ja(e),t.zh,t.commonPostProcessing])},t.casualOption=function(){return t.mergeOptions([t.en.casual,t.de({strict:!0}),t.nl,t.pt,t.es,t.fr,t.ja,t.zh,t.commonPostProcessing])},t.de=function(e){return{parsers:[new r.DEDeadlineFormatParser(e),new r.DEMonthNameLittleEndianParser(e),new r.DEMonthNameParser(e),new r.DESlashDateFormatParser(e),new r.DETimeAgoFormatParser(e),new r.DETimeExpressionParser(e)],refiners:[new n.OverlapRemovalRefiner,new n.ForwardDateRefiner,new n.DEMergeDateTimeRefiner,new n.DEMergeDateRangeRefiner]}},t.de.casual=function(){var e=t.de({strict:!1});return e.parsers.unshift(new r.DECasualDateParser),e.parsers.unshift(new r.DEWeekdayParser),e},t.nl=function(e){return{parsers:[new r.NLMonthNameLittleEndianParser(e),new r.NLMonthNameParser(e),new r.NLSlashDateFormatParser(e),new r.NLTimeExpressionParser(e)],refiners:[new n.OverlapRemovalRefiner,new n.ForwardDateRefiner,new n.NLMergeDateTimeRefiner,new n.NLMergeDateRangeRefiner]}},t.nl.casual=function(){var e=t.nl({strict:!1});return e.parsers.unshift(new r.NLCasualDateParser),e.parsers.unshift(new r.NLCasualTimeParser),e.parsers.unshift(new r.NLWeekdayParser),e},t.en=function(e){return{parsers:[new r.ENISOFormatParser(e),new r.ENDeadlineFormatParser(e),new r.ENMonthNameLittleEndianParser(e),new r.ENMonthNameMiddleEndianParser(e),new r.ENMonthNameParser(e),new r.ENSlashDateFormatParser(e),new r.ENSlashDateFormatStartWithYearParser(e),new r.ENSlashMonthFormatParser(e),new r.ENTimeAgoFormatParser(e),new r.ENTimeLaterFormatParser(e),new r.ENTimeExpressionParser(e)],refiners:[new n.OverlapRemovalRefiner,new n.ForwardDateRefiner,new n.ENMergeDateTimeRefiner,new n.ENMergeDateRangeRefiner,new n.ENPrioritizeSpecificDateRefiner]}},t.en.casual=function(e){(e=e||{}).strict=!1;var a=t.en(e);return a.parsers.unshift(new r.ENCasualDateParser),a.parsers.unshift(new r.ENCasualTimeParser),a.parsers.unshift(new r.ENWeekdayParser),a.parsers.unshift(new r.ENRelativeDateFormatParser),a},t.en_GB=function(e){return(e=e||{}).littleEndian=!0,t.en(e)},t.en_GB.casual=function(e){return(e=e||{}).littleEndian=!0,t.en.casual(e)},t.ja=function(){return{parsers:[new r.JPStandardParser],refiners:[new n.OverlapRemovalRefiner,new n.ForwardDateRefiner,new n.JPMergeDateRangeRefiner]}},t.ja.casual=function(){var e=t.ja();return e.parsers.unshift(new r.JPCasualDateParser),e},t.pt=function(e){return{parsers:[new r.PTTimeAgoFormatParser(e),new r.PTDeadlineFormatParser(e),new r.PTTimeExpressionParser(e),new r.PTMonthNameLittleEndianParser(e),new r.PTSlashDateFormatParser(e)],refiners:[new n.OverlapRemovalRefiner,new n.ForwardDateRefiner]}},t.pt.casual=function(){var e=t.pt({strict:!1});return e.parsers.unshift(new r.PTCasualDateParser),e.parsers.unshift(new r.PTWeekdayParser),e},t.es=function(e){return{parsers:[new r.ESTimeAgoFormatParser(e),new r.ESDeadlineFormatParser(e),new r.ESTimeExpressionParser(e),new r.ESMonthNameLittleEndianParser(e),new r.ESSlashDateFormatParser(e)],refiners:[new n.OverlapRemovalRefiner,new n.ForwardDateRefiner]}},t.es.casual=function(){var e=t.es({strict:!1});return e.parsers.unshift(new r.ESCasualDateParser),e.parsers.unshift(new r.ESWeekdayParser),e},t.fr=function(e){return{parsers:[new r.FRDeadlineFormatParser(e),new r.FRMonthNameLittleEndianParser(e),new r.FRSlashDateFormatParser(e),new r.FRTimeAgoFormatParser(e),new r.FRTimeExpressionParser(e)],refiners:[new n.OverlapRemovalRefiner,new n.ForwardDateRefiner,new n.FRMergeDateRangeRefiner,new n.FRMergeDateTimeRefiner]}},t.fr.casual=function(){var e=t.fr({strict:!1});return e.parsers.unshift(new r.FRCasualDateParser),e.parsers.unshift(new r.FRWeekdayParser),e.parsers.unshift(new r.FRRelativeDateFormatParser),e},t.zh=function(){return{parsers:[new r.ZHHantDateParser,new r.ZHHantWeekdayParser,new r.ZHHantTimeExpressionParser,new r.ZHHantCasualDateParser,new r.ZHHantDeadlineFormatParser],refiners:[new n.OverlapRemovalRefiner,new n.ForwardDateRefiner]}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=new RegExp("(\\W|^)([0-9]{4})\\-([0-9]{1,2})\\-([0-9]{1,2})(?:T([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2})(?:\\.(\\d{1,4}))?)?(?:Z|([+-]\\d{2}):?(\\d{2})?)?)?(?=\\W|$)","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,n){e=a[0].substr(a[1].length);var i=a.index+a[1].length,o=new s({text:e,index:i,ref:t});if(o.start.assign("year",parseInt(a[2])),o.start.assign("month",parseInt(a[3])),o.start.assign("day",parseInt(a[4])),r(o.start.get("month"))>12||r(o.start.get("month"))<1||r(o.start.get("day"))>31||r(o.start.get("day"))<1)return null;if(null!=a[5])if(o.start.assign("hour",parseInt(a[5])),o.start.assign("minute",parseInt(a[6])),null!=a[7]&&o.start.assign("second",parseInt(a[7])),null!=a[8]&&o.start.assign("millisecond",parseInt(a[8])),null==a[9])o.start.assign("timezoneOffset",0);else{var d=0,u=parseInt(a[9]);null!=a[10]&&(d=parseInt(a[10]));var m=60*u;m<0?m-=d:m+=d,o.start.assign("timezoneOffset",m)}return o.tags.ENISOFormatParser=!0,o}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(4),o=new RegExp("(\\W|^)(within|in)\\s*("+i.INTEGER_WORDS_PATTERN+"|[0-9]+|an?(?:\\s*few)?|half(?:\\s*an?)?)\\s*(seconds?|min(?:ute)?s?|hours?|days?|weeks?|months?|years?)\\s*(?=\\W|$)","i"),d=new RegExp("(\\W|^)(within|in)\\s*("+i.INTEGER_WORDS_PATTERN+"|[0-9]+|an?)\\s*(seconds?|minutes?|hours?|days?)\\s*(?=\\W|$)","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return this.isStrictMode()?d:o},this.extract=function(e,t,a,n){var o=a.index+a[1].length;a[0];e=a[0].substr(a[1].length,a[0].length-a[1].length);var d=new s({index:o,text:e,ref:t}),u=a[3].toLowerCase();u=void 0!==i.INTEGER_WORDS[u]?i.INTEGER_WORDS[u]:"a"===u||"an"===u?1:u.match(/few/i)?3:u.match(/half/i)?.5:parseInt(u);var m=r(t);return a[4].match(/day|week|month|year/i)?(a[4].match(/day/i)?m=m.add(u,"d"):a[4].match(/week/i)?m=m.add(7*u,"d"):a[4].match(/month/i)?m=m.add(u,"month"):a[4].match(/year/i)&&(m=m.add(u,"year")),d.start.imply("year",m.year()),d.start.imply("month",m.month()+1),d.start.imply("day",m.date()),d):(a[4].match(/hour/i)?m=m.add(u,"hour"):a[4].match(/min/i)?m=m.add(u,"minute"):a[4].match(/second/i)&&(m=m.add(u,"second")),d.start.imply("year",m.year()),d.start.imply("month",m.month()+1),d.start.imply("day",m.date()),d.start.imply("hour",m.hour()),d.start.imply("minute",m.minute()),d.start.imply("second",m.second()),d.tags.ENDeadlineFormatParser=!0,d)}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(4),o=new RegExp("(\\W|^)(this|next|last|past)\\s*("+i.INTEGER_WORDS_PATTERN+"|[0-9]+|few|half(?:\\s*an?)?)?\\s*(seconds?|min(?:ute)?s?|hours?|days?|weeks?|months?|years?)(?=\\s*)(?=\\W|$)","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return o},this.extract=function(e,t,a,n){var o=a.index+a[1].length,d=a[2].toLowerCase().match(/^next/)?1:-1;a[0];e=a[0].substr(a[1].length,a[0].length-a[1].length);var u=new s({index:o,text:e,ref:t});u.tags.ENRelativeDateFormatParser=!0;var m=void 0===a[3]?"":a[3].toLowerCase();m=void 0!==i.INTEGER_WORDS[m]?i.INTEGER_WORDS[m]:""===m?1:m.match(/few/i)?3:m.match(/half/i)?.5:parseInt(m),m*=d;var l=r(t);if(a[2].toLowerCase().match(/^this/)){if(a[3])return null;if(a[4].match(/day|week|month|year/i))return a[4].match(/week/i)?(l=l.add(-l.get("d"),"d"),u.start.imply("day",l.date()),u.start.imply("month",l.month()+1),u.start.imply("year",l.year())):a[4].match(/month/i)?(l=l.add(1-l.date(),"d"),u.start.imply("day",l.date()),u.start.assign("year",l.year()),u.start.assign("month",l.month()+1)):a[4].match(/year/i)&&(l=(l=l.add(1-l.date(),"d")).add(-l.month(),"month"),u.start.imply("day",l.date()),u.start.imply("month",l.month()+1),u.start.assign("year",l.year())),u}return a[4].match(/day|week|month|year/i)?(a[4].match(/day/i)?(l=l.add(m,"d"),u.start.assign("year",l.year()),u.start.assign("month",l.month()+1),u.start.assign("day",l.date())):a[4].match(/week/i)?(l=l.add(7*m,"d"),u.start.imply("day",l.date()),u.start.imply("month",l.month()+1),u.start.imply("year",l.year())):a[4].match(/month/i)?(l=l.add(m,"month"),u.start.imply("day",l.date()),u.start.assign("year",l.year()),u.start.assign("month",l.month()+1)):a[4].match(/year/i)&&(l=l.add(m,"year"),u.start.imply("day",l.date()),u.start.imply("month",l.month()+1),u.start.assign("year",l.year())),u):(a[4].match(/hour/i)?(l=l.add(m,"hour"),u.start.imply("minute",l.minute()),u.start.imply("second",l.second())):a[4].match(/min/i)?(l=l.add(m,"minute"),u.start.assign("minute",l.minute()),u.start.imply("second",l.second())):a[4].match(/second/i)&&(l=l.add(m,"second"),u.start.assign("second",l.second()),u.start.assign("minute",l.minute())),u.start.assign("hour",l.hour()),u.start.assign("year",l.year()),u.start.assign("month",l.month()+1),u.start.assign("day",l.date()),u)}}},function(e,t,a){var r=a(1),n=a(0).ParsedResult,s=a(4),i=new RegExp("(\\W|^)(?:on\\s*?)?(?:(Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sun|Mon|Tue|Wed|Thu|Fri|Sat)\\s*,?\\s*)?(([0-9]{1,2})(?:st|nd|rd|th)?|"+s.ORDINAL_WORDS_PATTERN+")(?:\\s*(?:to|\\-|\\–|until|through|till|\\s)\\s*(([0-9]{1,2})(?:st|nd|rd|th)?|"+s.ORDINAL_WORDS_PATTERN+"))?(?:-|/|\\s*(?:of)?\\s*)("+s.MONTH_PATTERN+")(?:(?:-|/|,?\\s*)((?:[1-9][0-9]{0,3}\\s*(?:BE|AD|BC)|[1-2][0-9]{3}|[5-9][0-9])(?![^\\s]\\d)))?(?=\\W|$)","i");t.Parser=function(){r.Parser.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,i){var o=new n({text:a[0].substr(a[1].length,a[0].length-a[1].length),index:a.index+a[1].length,ref:t}),d=a[7];d=s.MONTH_OFFSET[d.toLowerCase()];var u=a[4]?parseInt(a[4]):s.ORDINAL_WORDS[a[3].trim().replace("-"," ").toLowerCase()],m=null;if(a[8]&&(m=a[8],/BE/i.test(m)?(m=m.replace(/BE/i,""),m=parseInt(m)-543):/BC/i.test(m)?(m=m.replace(/BC/i,""),m=-parseInt(m)):/AD/i.test(m)?(m=m.replace(/AD/i,""),m=parseInt(m)):(m=parseInt(m))<100&&(m+=m>50?1900:2e3)),m?(o.start.assign("day",u),o.start.assign("month",d),o.start.assign("year",m)):(m=r.findYearClosestToRef(t,u,d),o.start.assign("day",u),o.start.assign("month",d),o.start.imply("year",m)),a[2]){var l=a[2];l=s.WEEKDAY_OFFSET[l.toLowerCase()],o.start.assign("weekday",l)}if(a[5]){var h=a[6]?parseInt(a[6]):s.ORDINAL_WORDS[a[5].trim().replace("-"," ").toLowerCase()];o.end=o.start.clone(),o.end.assign("day",h)}return o.tags.ENMonthNameLittleEndianParser=!0,o}}},function(e,t,a){var r=a(1),n=a(0).ParsedResult,s=a(4),i=new RegExp("(\\W|^)(?:(?:on\\s*?)?(Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sun\\.?|Mon\\.?|Tue\\.?|Wed\\.?|Thu\\.?|Fri\\.?|Sat\\.?)\\s*,?\\s*)?("+s.MONTH_PATTERN+")(?:-|/|\\s*,?\\s*)(([0-9]{1,2})(?:st|nd|rd|th)?|"+s.ORDINAL_WORDS_PATTERN+")(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(([0-9]{1,2})(?:st|nd|rd|th)?| "+s.ORDINAL_WORDS_PATTERN+")\\s*)?(?:(?:-|/|\\s*,?\\s*)(?:([0-9]{4})\\s*(BE|AD|BC)?|([0-9]{1,4})\\s*(AD|BC))\\s*)?(?=\\W|$)(?!\\:\\d)","i");t.Parser=function(){r.Parser.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,i){var o=new n({text:a[0].substr(a[1].length,a[0].length-a[1].length),index:a.index+a[1].length,ref:t}),d=a[3];d=s.MONTH_OFFSET[d.toLowerCase()];var u=a[5]?parseInt(a[5]):s.ORDINAL_WORDS[a[4].trim().replace("-"," ").toLowerCase()],m=null;if(a[8]||a[10]){m=a[8]||a[10],m=parseInt(m);var l=a[9]||a[11];l?/BE/i.test(l)?m-=543:/BC/i.test(l)&&(m=-m):m<100&&(m+=2e3)}if(m?(o.start.assign("day",u),o.start.assign("month",d),o.start.assign("year",m)):(m=r.findYearClosestToRef(t,u,d),o.start.assign("day",u),o.start.assign("month",d),o.start.imply("year",m)),a[2]){var h=a[2];h=s.WEEKDAY_OFFSET[h.toLowerCase()],o.start.assign("weekday",h)}if(a[6]){var c=a[7]?c=parseInt(a[7]):s.ORDINAL_WORDS[a[6].replace("-"," ").trim().toLowerCase()];o.end=o.start.clone(),o.end.assign("day",c)}return o.tags.ENMonthNameMiddleEndianParser=!0,o}}},function(e,t,a){var r=a(1),n=a(0).ParsedResult,s=a(4),i=new RegExp("(^|\\D\\s+|[^\\w\\s])("+s.MONTH_PATTERN+")\\s*(?:[,-]?\\s*([0-9]{4})(\\s*BE|AD|BC)?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)","i");t.Parser=function(){r.Parser.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,i){var o=new n({text:a[0].substr(a[1].length,a[0].length-a[1].length),index:a.index+a[1].length,ref:t}),d=a[2],u=s.MONTH_OFFSET[d.toLowerCase()],m=null;return a[3]&&(m=a[3],m=parseInt(m),a[4]?a[4].match(/BE/)?m-=543:a[4].match(/BC/)&&(m=-m):m<100&&(m+=2e3)),m?(o.start.imply("day",1),o.start.assign("month",u),o.start.assign("year",m)):(m=r.findYearClosestToRef(t,1,u),o.start.imply("day",1),o.start.assign("month",u),o.start.imply("year",m)),!o.text.match(/^\w{3}$/)&&(o.tags.ENMonthNameParser=!0,o)}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=new RegExp("(\\W|^)(?:(?:on\\s*?)?((?:sun|mon|tues?|wed(?:nes)?|thu(?:rs?)?|fri|sat(?:ur)?)(?:day)?)\\s*\\,?\\s*)?([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}s*,?s*|[0-9]{2}s*,?s*))?(\\W|$)","i"),o={sunday:0,sun:0,monday:1,mon:1,tuesday:2,wednesday:3,wed:3,thursday:4,thur:4,friday:5,fri:5,saturday:6,sat:6};t.Parser=function(e){n.apply(this,arguments);var t=(e=e||{}).littleEndian,a=t?4:3,d=t?3:4;this.pattern=function(){return i},this.extract=function(e,t,n,i){if("/"!=n[1]&&"/"!=n[6]){var u=n.index+n[1].length,m=(e=n[0].substr(n[1].length,n[0].length-n[6].length),new s({text:e,index:u,ref:t}));if(!e.match(/^\d\.\d$/)&&!e.match(/^\d\.\d{1,2}\.\d{1,2}$/)&&(n[5]||!(n[0].indexOf("/")<0))){var l=n[5]||r(t).year()+"",h=n[a],c=n[d];if(h=parseInt(h),c=parseInt(c),l=parseInt(l),(h<1||h>12)&&h>12){if(!(c>=1&&c<=12&&h>=13&&h<=31))return null;var g=h;h=c,c=g}return c<1||c>31?null:(l<100&&(l+=l>50?1900:2e3),m.start.assign("day",c),m.start.assign("month",h),n[5]?m.start.assign("year",l):m.start.imply("year",l),n[2]&&m.start.assign("weekday",o[n[2].toLowerCase()]),m.tags.ENSlashDateFormatParser=!0,m)}}else n.index+=n[0].length}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(4),o=new RegExp("(\\W|^)([0-9]{4})[\\-\\.\\/]((?:"+i.MONTH_PATTERN+"|[0-9]{1,2}))[\\-\\.\\/]([0-9]{1,2})(?=\\W|$)","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return o},this.extract=function(e,t,a,n){e=a[0].substr(a[1].length);var o=a.index+a[1].length,d=new s({text:e,index:o,ref:t}),u=a[3].toLowerCase();return u=i.MONTH_OFFSET[u]|u,d.start.assign("year",parseInt(a[2])),d.start.assign("month",parseInt(u)),d.start.assign("day",parseInt(a[4])),r(d.start.get("month"))>12||r(d.start.get("month"))<1||r(d.start.get("day"))>31||r(d.start.get("day"))<1?null:(d.tags.ENDateFormatParser=!0,d)}}},function(e,t,a){var r=a(1).Parser,n=a(0).ParsedResult,s=new RegExp("(^|[^\\d/]\\s+|[^\\w\\s])([0-9]|0[1-9]|1[012])/([0-9]{4})(?=[^\\d/]|$)","i");t.Parser=function(e){r.apply(this,arguments),this.pattern=function(){return s},this.extract=function(e,t,a,r){var s=a.index+a[1].length,i=(e=a[0].substr(a[1].length,a[0].length).trim(),new n({text:e,index:s,ref:t})),o=a[3],d=a[2];return d=parseInt(d),o=parseInt(o),i.start.imply("day",1),i.start.assign("month",d),i.start.assign("year",o),i.tags.ENSlashMonthFormatParser=!0,i}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(4),o=new RegExp("(\\W|^)(?:within\\s*)?("+i.TIME_UNIT_PATTERN+")(?:ago|before|earlier)(?=(?:\\W|$))","i"),d=new RegExp("(\\W|^)(?:within\\s*)?("+i.TIME_UNIT_STRICT_PATTERN+")ago(?=(?:\\W|$))","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return this.isStrictMode()?d:o},this.extract=function(e,t,a,n){if(a.index>0&&e[a.index-1].match(/\w/))return null;e=a[0];e=a[0].substr(a[1].length,a[0].length-a[1].length);var o=a.index+a[1].length,d=new s({index:o,text:e,ref:t}),u=i.extractDateTimeUnitFragments(a[2]),m=r(t);for(var l in u)m=m.add(-u[l],l);return(u.hour>0||u.minute>0||u.second>0)&&(d.start.assign("hour",m.hour()),d.start.assign("minute",m.minute()),d.start.assign("second",m.second()),d.tags.ENTimeAgoFormatParser=!0),u.d>0||u.month>0||u.year>0?(d.start.assign("day",m.date()),d.start.assign("month",m.month()+1),d.start.assign("year",m.year())):(u.week>0&&d.start.imply("weekday",m.day()),d.start.imply("day",m.date()),d.start.imply("month",m.month()+1),d.start.imply("year",m.year())),d}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(0).ParsedComponents,o=new RegExp("(^|\\s|T)(?:(?:at|from)\\s*)??(\\d{1,4}|noon|midnight)(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:(?:\\:|\\:)(\\d{2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?|O\\W*CLOCK))?(?=\\W|$)","i"),d=new RegExp("^\\s*(\\-|\\–|\\~|\\〜|to|\\?)\\s*(\\d{1,4})(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?|O\\W*CLOCK))?(?=\\W|$)","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return o},this.extract=function(e,t,a,n){if(a.index>0&&e[a.index-1].match(/\w/))return null;var o=r(t),u=new s;u.ref=t,u.index=a.index+a[1].length,u.text=a[0].substring(a[1].length),u.tags.ENTimeExpressionParser=!0,u.start.imply("day",o.date()),u.start.imply("month",o.month()+1),u.start.imply("year",o.year());var m=0,l=0,h=-1;if(null!=a[5]){if((c=parseInt(a[5].substring(0,3)))>=1e3)return null;u.start.assign("millisecond",c)}if(null!=a[4]){if((g=parseInt(a[4]))>=60)return null;u.start.assign("second",g)}if("noon"==a[2].toLowerCase()?(h=1,m=12):"midnight"==a[2].toLowerCase()?(h=0,m=0):m=parseInt(a[2]),null!=a[3]?l=parseInt(a[3]):m>100&&(l=m%100,m=parseInt(m/100)),l>=60)return null;if(m>24)return null;if(m>=12&&(h=1),null!=a[6]){if(m>12)return null;"a"==(f=a[6][0].toLowerCase())&&(h=0,12==m&&(m=0)),"p"==f&&(h=1,12!=m&&(m+=12))}if(u.start.assign("hour",m),u.start.assign("minute",l),h>=0?u.start.assign("meridiem",h):m<12?u.start.imply("meridiem",0):u.start.imply("meridiem",1),!(a=d.exec(e.substring(u.index+u.text.length))))return u;if(a[0].match(/^\s*(\+|\-)\s*\d{3,4}$/))return u;null==u.end&&(u.end=new i(null,u.start.date()));m=0,l=0,h=-1;if(null!=a[5]){var c;if((c=parseInt(a[5].substring(0,3)))>=1e3)return null;u.end.assign("millisecond",c)}if(null!=a[4]){var g;if((g=parseInt(a[4]))>=60)return null;u.end.assign("second",g)}if(m=parseInt(a[2]),null!=a[3]){if((l=parseInt(a[3]))>=60)return u}else m>100&&(l=m%100,m=parseInt(m/100));if(l>=60)return null;if(m>24)return null;if(m>=12&&(h=1),null!=a[6]){if(m>12)return null;var f;"a"==(f=a[6][0].toLowerCase())&&(h=0,12==m&&(m=0,u.end.isCertain("day")||u.end.imply("day",u.end.get("day")+1))),"p"==f&&(h=1,12!=m&&(m+=12)),u.start.isCertain("meridiem")||(0==h?(u.start.imply("meridiem",0),12==u.start.get("hour")&&u.start.assign("hour",0)):(u.start.imply("meridiem",1),12!=u.start.get("hour")&&u.start.assign("hour",u.start.get("hour")+12)))}(u.text=u.text+a[0],u.end.assign("hour",m),u.end.assign("minute",l),h>=0)?u.end.assign("meridiem",h):u.start.isCertain("meridiem")&&1==u.start.get("meridiem")&&u.start.get("hour")>m?u.end.imply("meridiem",0):m>12&&u.end.imply("meridiem",1);return u.end.date().getTime()0&&e[a.index-1].match(/\w/))return null;var o=a[2],d=a[4];if(!o&&!d)return null;var u=a[1],m=(e=a[0].substr(u.length,a[0].length-u.length),a.index+u.length),l=new s({index:m,text:e,ref:t}),h=i.extractDateTimeUnitFragments(a[3]),c=r(t);for(var g in h)c=c.add(h[g],g);return(h.hour>0||h.minute>0||h.second>0)&&(l.start.assign("hour",c.hour()),l.start.assign("minute",c.minute()),l.start.assign("second",c.second()),l.tags.ENTimeAgoFormatParser=!0),h.d>0||h.month>0||h.year>0?(l.start.assign("day",c.date()),l.start.assign("month",c.month()+1),l.start.assign("year",c.year())):(h.week>0&&l.start.imply("weekday",c.day()),l.start.imply("day",c.date()),l.start.imply("month",c.month()+1),l.start.imply("year",c.year())),l}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=/(\W|^)(now|today|tonight|last\s*night|(?:tomorrow|tmr|yesterday)\s*|tomorrow|tmr|yesterday)(?=\W|$)/i;t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,n){e=a[0].substr(a[1].length);var i=a.index+a[1].length,o=new s({index:i,text:e,ref:t}),d=r(t),u=d,m=e.toLowerCase();return"tonight"==m?(o.start.imply("hour",22),o.start.imply("meridiem",1)):/^tomorrow|^tmr/.test(m)?d.hour()>1&&(u=u.add(1,"day")):/^yesterday/.test(m)?u=u.add(-1,"day"):m.match(/last\s*night/)?(o.start.imply("hour",0),d.hour()>6&&(u=u.add(-1,"day"))):m.match("now")&&(o.start.assign("hour",d.hour()),o.start.assign("minute",d.minute()),o.start.assign("second",d.second()),o.start.assign("millisecond",d.millisecond())),o.start.assign("day",u.date()),o.start.assign("month",u.month()+1),o.start.assign("year",u.year()),o.tags.ENCasualDateParser=!0,o}}},function(e,t,a){var r=a(1).Parser,n=a(0).ParsedResult,s=/(\W|^)((this)?\s*(morning|afternoon|evening|noon|night))/i,i=4;t.Parser=function(){r.apply(this,arguments),this.pattern=function(){return s},this.extract=function(e,t,a,r){e=a[0].substr(a[1].length);var s=a.index+a[1].length,o=new n({index:s,text:e,ref:t});switch(a[i]||(i=3),a[i].toLowerCase()){case"afternoon":o.start.imply("meridiem",1),o.start.imply("hour",15);break;case"evening":case"night":o.start.imply("meridiem",1),o.start.imply("hour",20);break;case"morning":o.start.imply("meridiem",0),o.start.imply("hour",6);break;case"noon":o.start.imply("meridiem",0),o.start.imply("hour",12)}return o.tags.ENCasualTimeParser=!0,o}}},function(e,t,a){var r=a(2),n=a(1),s=a(0).ParsedResult,i=a(29),o=/(?:(同|今|本|((昭和|平成|令和)?([0-90-9]{1,4}|元)))年\s*)?([0-90-9]{1,2})月\s*([0-90-9]{1,2})日/i;t.Parser=function(){n.Parser.apply(this,arguments),this.pattern=function(){return o},this.extract=function(e,t,a,o){var d=new s({text:a[0],index:a.index,ref:t}),u=a[5];u=i.toHankaku(u),u=parseInt(u);var m=a[6];if(m=i.toHankaku(m),m=parseInt(m),d.start.assign("day",m),d.start.assign("month",u),a[2]){var l=a[4];"元"==l?l=1:(l=i.toHankaku(l),l=parseInt(l)),"令和"==a[3]?l+=2018:"平成"==a[3]?l+=1988:"昭和"==a[3]&&(l+=1925),d.start.assign("year",l)}else if(a[1]&&a[1].match("同|今|本")){var h=r(t);d.start.assign("year",h.year())}else{var c=n.findYearClosestToRef(t,m,u);d.start.imply("year",c)}return d.tags.JPStandardParser=!0,d}}},function(e,t){t.toHankaku=function(e,t){function a(e){return t(e.charCodeAt(0)-65248)}return function(t){return e(t).replace(/\u2019/g,"'").replace(/\u201D/g,'"').replace(/\u3000/g," ").replace(/\uFFE5/g,"¥").replace(/[\uFF01\uFF03-\uFF06\uFF08\uFF09\uFF0C-\uFF19\uFF1C-\uFF1F\uFF21-\uFF3B\uFF3D\uFF3F\uFF41-\uFF5B\uFF5D\uFF5E]/g,a)}}(String,String.fromCharCode),t.toZenkaku=function(e,t){function a(e){return t(e.charCodeAt(0)+65248)}return function(t){return e(t).replace(/\u0020/g," ").replace(/\u0022/g,"”").replace(/\u0027/g,"’").replace(/\u00A5/g,"¥").replace(/[!#-&(),-9\u003C-?A-[\u005D_a-{}~]/g,a)}}(String,String.fromCharCode)},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=/今日|当日|昨日|明日|今夜|今夕|今晩|今朝/i;t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,n){var i=a.index,o=(e=a[0],new s({index:i,text:e,ref:t})),d=r(t),u=d;return"今夜"==e||"今夕"==e||"今晩"==e?(o.start.imply("hour",22),o.start.imply("meridiem",1)):"明日"==e?d.hour()>4&&(u=u.add(1,"day")):"昨日"==e?u=u.add(-1,"day"):e.match("今朝")&&(o.start.imply("hour",6),o.start.imply("meridiem",0)),o.start.assign("day",u.date()),o.start.assign("month",u.month()+1),o.start.assign("year",u.year()),o.tags.JPCasualDateParser=!0,o}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=/(\W|^)(agora|esta\s*(manhã|tarde|noite)|(ontem|amanhã)\s*(de|à)\s*(manhã|tarde|noite)|hoje|amanhã|ontem|noite)(?=\W|$)/i;t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,n){e=a[0].substr(a[1].length);var i=a.index+a[1].length,o=new s({index:i,text:e,ref:t}),d=r(t),u=d,m=e.toLowerCase().replace(/\s+/g," ");if("amanhã"==m)d.hour()>1&&(u=u.add(1,"day"));else if("ontem"==m)u=u.add(-1,"day");else if("noite"==m)o.start.imply("hour",0),d.hour()>6&&(u=u.add(-1,"day"));else if(m.match("esta")){"tarde"==(l=a[3].toLowerCase())?o.start.imply("hour",18):"manhã"==l?o.start.imply("hour",6):"noite"==l&&(o.start.imply("hour",22),o.start.imply("meridiem",1))}else if(m.match(/de|à/)){var l,h=a[4].toLowerCase();"ontem"===h?u=u.add(-1,"day"):"amanhã"===h&&(u=u.add(1,"day")),"tarde"==(l=a[6].toLowerCase())?o.start.imply("hour",18):"manhã"==l?o.start.imply("hour",9):"noite"==l&&(o.start.imply("hour",22),o.start.imply("meridiem",1))}else m.match("agora")&&(o.start.imply("hour",d.hour()),o.start.imply("minute",d.minute()),o.start.imply("second",d.second()),o.start.imply("millisecond",d.millisecond()));return o.start.assign("day",u.date()),o.start.assign("month",u.month()+1),o.start.assign("year",u.year()),o.tags.PTCasualDateParser=!0,o}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=/(\W|^)(dentro\s*de|em|em*até)\s*([0-9]+|mei[oa]|uma?)\s*(minutos?|horas?|dias?)\s*(?=(?:\W|$))/i;t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,n){var i=a.index+a[1].length;a[0];e=a[0].substr(a[1].length,a[0].length-a[1].length);var o=new s({index:i,text:e,ref:t}),d=parseInt(a[3]);isNaN(d)&&(d=a[3].match(/(meio|meia)/)?.5:1);var u=r(t);return a[4].match(/dia/)?(u=u.add(d,"d"),o.start.assign("year",u.year()),o.start.assign("month",u.month()+1),o.start.assign("day",u.date()),o):(a[4].match(/hora/)?u=u.add(d,"hour"):a[4].match(/minuto/)&&(u=u.add(d,"minute")),o.start.imply("year",u.year()),o.start.imply("month",u.month()+1),o.start.imply("day",u.date()),o.start.assign("hour",u.hour()),o.start.assign("minute",u.minute()),o.tags.PTDeadlineFormatParser=!0,o)}}},function(e,t,a){var r=a(1),n=a(0).ParsedResult,s=a(34),i=(s.WEEKDAY_OFFSET,new RegExp("(\\W|^)(?:(domingo|segunda|segunda-feira|terça|terça-feira|quarta|quarta-feira|quinta|quinta-feira|sexta|sexta-feira|sábado|sabado|dom|seg|ter|qua|qui|sex|sab)\\s*,?\\s*)?([0-9]{1,2})(?:º|ª|°)?(?:\\s*(?:desde|de|\\-|\\–|ao?|\\s)\\s*([0-9]{1,2})(?:º|ª|°)?)?\\s*(?:de)?\\s*(Jan(?:eiro|\\.)?|Fev(?:ereiro|\\.)?|Mar(?:ço|\\.)?|Abr(?:il|\\.)?|Mai(?:o|\\.)?|Jun(?:ho|\\.)?|Jul(?:ho|\\.)?|Ago(?:sto|\\.)?|Set(?:embro|\\.)?|Out(?:ubro|\\.)?|Nov(?:embro|\\.)?|Dez(?:embro|\\.)?)(?:\\s*(?:de?)?(\\s*[0-9]{1,4}(?![^\\s]\\d))(\\s*[ad]\\.?\\s*c\\.?|a\\.?\\s*d\\.?)?)?(?=\\W|$)","i"));t.Parser=function(){r.Parser.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,i){var o=new n({text:a[0].substr(a[1].length,a[0].length-a[1].length),index:a.index+a[1].length,ref:t}),d=a[5];d=s.MONTH_OFFSET[d.toLowerCase()];var u=a[3];u=parseInt(u);var m=null;if(a[6]&&(m=a[6],m=parseInt(m),a[7]?/a\.?\s*c\.?/i.test(a[7])&&(m=-m):m<100&&(m+=2e3)),m?(o.start.assign("day",u),o.start.assign("month",d),o.start.assign("year",m)):(m=r.findYearClosestToRef(t,u,d),o.start.assign("day",u),o.start.assign("month",d),o.start.imply("year",m)),a[2]){var l=a[2];l=s.WEEKDAY_OFFSET[l.toLowerCase()],o.start.assign("weekday",l)}return a[4]&&(o.end=o.start.clone(),o.end.assign("day",parseInt(a[4]))),o.tags.PTMonthNameLittleEndianParser=!0,o}}},function(e,t){t.WEEKDAY_OFFSET={domingo:0,dom:0,segunda:1,"segunda-feira":1,seg:1,"terça":2,terca:2,"terça-feira":2,"terca-feira":2,ter:2,quarta:3,"quarta-feira":3,qua:3,quinta:4,"quinta-feira":4,qui:4,sexta:5,"sexta-feira":5,sex:5,"sábado":6,sabado:6,sab:6},t.MONTH_OFFSET={janeiro:1,jan:1,"jan.":1,fevereiro:2,fev:2,"fev.":2,"março":3,mar:3,"mar.":3,abril:4,abr:4,"abr.":4,maio:5,mai:5,"mai.":5,junho:6,jun:6,"jun.":6,julho:7,jul:7,"jul.":7,agosto:8,ago:8,"ago.":8,setembro:9,set:9,"set.":9,outubro:10,out:10,"out.":10,novembro:11,nov:11,"nov.":11,dezembro:12,dez:12,"dez.":12}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=new RegExp("(\\W|^)(?:((?:domingo|dom|segunda|segunda-feira|seg|terça|terça-feira|ter|quarta|quarta-feira|qua|quinta|quinta-feira|qui|sexta|sexta-feira|sex|s[áa]bado|sab))\\s*\\,?\\s*)?([0-1]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}s*,?s*|[0-9]{2}s*,?s*))?(\\W|$)","i"),o={domingo:0,dom:0,segunda:1,"segunda-feira":1,seg:1,"terça":2,"terça-feira":2,ter:2,quarta:3,"quarta-feira":3,qua:3,quinta:4,"quinta-feira":4,qui:4,sexta:5,"sexta-feira":5,sex:5,"sábado":6,sabado:6,sab:6};t.Parser=function(e){n.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,n){if("/"!=a[1]&&"/"!=a[6]){var i=a.index+a[1].length,d=(e=a[0].substr(a[1].length,a[0].length-a[6].length),new s({text:e,index:i,ref:t}));if(!e.match(/^\d\.\d$/)&&!e.match(/^\d\.\d{1,2}\.\d{1,2}$/)&&(a[5]||!(a[0].indexOf("/")<0))){var u=a[5]||r(t).year()+"",m=a[4],l=a[3];if(m=parseInt(m),l=parseInt(l),u=parseInt(u),(m<1||m>12)&&m>12){if(!(l>=1&&l<=12&&m>=13&&m<=31))return null;var h=m;m=l,l=h}return l<1||l>31?null:(u<100&&(u+=u>50?1900:2e3),d.start.assign("day",l),d.start.assign("month",m),d.start.assign("year",u),a[2]&&d.start.assign("weekday",o[a[2].toLowerCase()]),d.tags.PTSlashDateFormatParser=!0,d)}}else a.index+=a[0].length}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=/(\W|^)há\s*([0-9]+|mei[oa]|uma?)\s*(minutos?|horas?|semanas?|dias?|mes(es)?|anos?)(?=(?:\W|$))/i;t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,n){if(a.index>0&&e[a.index-1].match(/\w/))return null;e=a[0];e=a[0].substr(a[1].length,a[0].length-a[1].length);var i=a.index+a[1].length,o=new s({index:i,text:e,ref:t}),d=parseInt(a[2]);isNaN(d)&&(d=a[2].match(/mei/)?.5:1);var u=r(t);return a[3].match(/hora/)||a[3].match(/minuto/)?(a[3].match(/hora/)?u=u.add(-d,"hour"):a[3].match(/minuto/)&&(u=u.add(-d,"minute")),o.start.imply("day",u.date()),o.start.imply("month",u.month()+1),o.start.imply("year",u.year()),o.start.assign("hour",u.hour()),o.start.assign("minute",u.minute()),o.tags.PTTimeAgoFormatParser=!0,o):a[3].match(/semana/)?(u=u.add(-d,"week"),o.start.imply("day",u.date()),o.start.imply("month",u.month()+1),o.start.imply("year",u.year()),o.start.imply("weekday",u.day()),o):(a[3].match(/dia/)&&(u=u.add(-d,"d")),a[3].match(/mes/)&&(u=u.add(-d,"month")),a[3].match(/ano/)&&(u=u.add(-d,"year")),o.start.assign("day",u.date()),o.start.assign("month",u.month()+1),o.start.assign("year",u.year()),o)}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(0).ParsedComponents,o=new RegExp("(^|\\s|T)(?:(?:ao?|às?|das|da|de|do)\\s*)?(\\d{1,4}|meio-dia|meia-noite|meio dia|meia noite)(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:(?:\\:|\\:)(\\d{2}))?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),d=new RegExp("^\\s*(\\-|\\–|\\~|\\〜|a(?:o)?|\\?)\\s*(\\d{1,4})(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:(?:\\.|\\:|\\:)(\\d{1,2}))?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return o},this.extract=function(e,t,a,n){if(a.index>0&&e[a.index-1].match(/\w/))return null;var o=r(t),u=new s;u.ref=t,u.index=a.index+a[1].length,u.text=a[0].substring(a[1].length),u.tags.PTTimeExpressionParser=!0,u.start.imply("day",o.date()),u.start.imply("month",o.month()+1),u.start.imply("year",o.year());var m=0,l=0,h=-1;if(null!=a[4]){if((g=parseInt(a[4]))>=60)return null;u.start.assign("second",g)}if(a[2].toLowerCase().match(/meio\-di/)?(h=1,m=12):"meia-noite"==a[2].toLowerCase()?(h=0,m=0):m=parseInt(a[2]),null!=a[3]?l=parseInt(a[3]):m>100&&(l=m%100,m=parseInt(m/100)),l>=60)return null;if(m>24)return null;if(m>=12&&(h=1),null!=a[5]){if(m>12)return null;var c=a[5][0].toLowerCase();"a"==c&&(h=0,12==m&&(m=0)),"p"==c&&(h=1,12!=m&&(m+=12))}if(u.start.assign("hour",m),u.start.assign("minute",l),h>=0&&u.start.assign("meridiem",h),!(a=d.exec(e.substring(u.index+u.text.length))))return u.text.match(/^\d+$/)?null:u;if(a[0].match(/^\s*(\+|\-)\s*\d{3,4}$/))return u;null==u.end&&(u.end=new i(null,u.start.date()));m=0,l=0,h=-1;if(null!=a[4]){var g;if((g=parseInt(a[4]))>=60)return null;u.end.assign("second",g)}if(m=parseInt(a[2]),null!=a[3]){if((l=parseInt(a[3]))>=60)return u}else m>100&&(l=m%100,m=parseInt(m/100));if(l>=60)return null;if(m>24)return null;if(m>=12&&(h=1),null!=a[5]){if(m>12)return null;"a"==a[5][0].toLowerCase()&&(h=0,12==m&&(m=0,u.end.isCertain("day")||u.end.imply("day",u.end.get("day")+1))),"p"==a[5][0].toLowerCase()&&(h=1,12!=m&&(m+=12)),u.start.isCertain("meridiem")||(0==h?(u.start.imply("meridiem",0),12==u.start.get("hour")&&u.start.assign("hour",0)):(u.start.imply("meridiem",1),12!=u.start.get("hour")&&u.start.assign("hour",u.start.get("hour")+12)))}else m>=12&&(h=1);return u.text=u.text+a[0],u.end.assign("hour",m),u.end.assign("minute",l),h>=0&&u.end.assign("meridiem",h),u.end.date().getTime()1&&(u=u.add(1,"day"));else if("ayer"==m)u=u.add(-1,"day");else if("anoche"==m)o.start.imply("hour",0),d.hour()>6&&(u=u.add(-1,"day"));else if(m.match("esta")){"tarde"==(l=a[3].toLowerCase())?o.start.imply("hour",18):"mañana"==l?o.start.imply("hour",6):"noche"==l&&(o.start.imply("hour",22),o.start.imply("meridiem",1))}else if(m.match(/por\s*la/)){var l,h=a[4].toLowerCase();"ayer"===h?u=u.add(-1,"day"):"mañana"===h&&(u=u.add(1,"day")),"tarde"==(l=a[5].toLowerCase())?o.start.imply("hour",18):"mañana"==l?o.start.imply("hour",9):"noche"==l&&(o.start.imply("hour",22),o.start.imply("meridiem",1))}else m.match("ahora")&&(o.start.imply("hour",d.hour()),o.start.imply("minute",d.minute()),o.start.imply("second",d.second()),o.start.imply("millisecond",d.millisecond()));return o.start.assign("day",u.date()),o.start.assign("month",u.month()+1),o.start.assign("year",u.year()),o.tags.ESCasualDateParser=!0,o}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=/(\W|^)(dentro\s*de|en)\s*([0-9]+|medi[oa]|una?)\s*(minutos?|horas?|d[ií]as?)\s*(?=(?:\W|$))/i;t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,n){var i=a.index+a[1].length;a[0];e=a[0].substr(a[1].length,a[0].length-a[1].length);var o=new s({index:i,text:e,ref:t}),d=parseInt(a[3]);isNaN(d)&&(d=a[3].match(/medi/)?.5:1);var u=r(t);return a[4].match(/d[ií]a/)?(u=u.add(d,"d"),o.start.assign("year",u.year()),o.start.assign("month",u.month()+1),o.start.assign("day",u.date()),o):(a[4].match(/hora/)?u=u.add(d,"hour"):a[4].match(/minuto/)&&(u=u.add(d,"minute")),o.start.imply("year",u.year()),o.start.imply("month",u.month()+1),o.start.imply("day",u.date()),o.start.assign("hour",u.hour()),o.start.assign("minute",u.minute()),o.tags.ESDeadlineFormatParser=!0,o)}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=/(\W|^)hace\s*([0-9]+|medi[oa]|una?)\s*(minutos?|horas?|semanas?|d[ií]as?|mes(es)?|años?)(?=(?:\W|$))/i;t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,n){if(a.index>0&&e[a.index-1].match(/\w/))return null;e=a[0];e=a[0].substr(a[1].length,a[0].length-a[1].length);var i=a.index+a[1].length,o=new s({index:i,text:e,ref:t}),d=parseInt(a[2]);isNaN(d)&&(d=a[2].match(/medi/)?.5:1);var u=r(t);return a[3].match(/hora/)||a[3].match(/minuto/)?(a[3].match(/hora/)?u=u.add(-d,"hour"):a[3].match(/minuto/)&&(u=u.add(-d,"minute")),o.start.imply("day",u.date()),o.start.imply("month",u.month()+1),o.start.imply("year",u.year()),o.start.assign("hour",u.hour()),o.start.assign("minute",u.minute()),o.tags.ESTimeAgoFormatParser=!0,o):a[3].match(/semana/)?(u=u.add(-d,"week"),o.start.imply("day",u.date()),o.start.imply("month",u.month()+1),o.start.imply("year",u.year()),o.start.imply("weekday",u.day()),o):(a[3].match(/d[ií]a/)&&(u=u.add(-d,"d")),a[3].match(/mes/)&&(u=u.add(-d,"month")),a[3].match(/año/)&&(u=u.add(-d,"year")),o.start.assign("day",u.date()),o.start.assign("month",u.month()+1),o.start.assign("year",u.year()),o)}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(0).ParsedComponents,o=new RegExp("(^|\\s|T)(?:(?:a las?|al?|desde|de)\\s*)?(\\d{1,4}|mediod[ií]a|medianoche)(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:(?:\\:|\\:)(\\d{2}))?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),d=new RegExp("^\\s*(\\-|\\–|\\~|\\〜|a(?:s*las)?|\\?)\\s*(\\d{1,4})(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:(?:\\.|\\:|\\:)(\\d{1,2}))?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return o},this.extract=function(e,t,a,n){if(a.index>0&&e[a.index-1].match(/\w/))return null;var o=r(t),u=new s;u.ref=t,u.index=a.index+a[1].length,u.text=a[0].substring(a[1].length),u.tags.ESTimeExpressionParser=!0,u.start.imply("day",o.date()),u.start.imply("month",o.month()+1),u.start.imply("year",o.year());var m=0,l=0,h=-1;if(null!=a[4]){if((g=parseInt(a[4]))>=60)return null;u.start.assign("second",g)}if(a[2].toLowerCase().match(/mediod/)?(h=1,m=12):"medianoche"==a[2].toLowerCase()?(h=0,m=0):m=parseInt(a[2]),null!=a[3]?l=parseInt(a[3]):m>100&&(l=m%100,m=parseInt(m/100)),l>=60)return null;if(m>24)return null;if(m>=12&&(h=1),null!=a[5]){if(m>12)return null;var c=a[5][0].toLowerCase();"a"==c&&(h=0,12==m&&(m=0)),"p"==c&&(h=1,12!=m&&(m+=12))}if(u.start.assign("hour",m),u.start.assign("minute",l),h>=0&&u.start.assign("meridiem",h),!(a=d.exec(e.substring(u.index+u.text.length))))return u.text.match(/^\d+$/)?null:u;if(a[0].match(/^\s*(\+|\-)\s*\d{3,4}$/))return u;null==u.end&&(u.end=new i(null,u.start.date()));m=0,l=0,h=-1;if(null!=a[4]){var g;if((g=parseInt(a[4]))>=60)return null;u.end.assign("second",g)}if(m=parseInt(a[2]),null!=a[3]){if((l=parseInt(a[3]))>=60)return u}else m>100&&(l=m%100,m=parseInt(m/100));if(l>=60)return null;if(m>24)return null;if(m>=12&&(h=1),null!=a[5]){if(m>12)return null;"a"==a[5][0].toLowerCase()&&(h=0,12==m&&(m=0,u.end.isCertain("day")||u.end.imply("day",u.end.get("day")+1))),"p"==a[5][0].toLowerCase()&&(h=1,12!=m&&(m+=12)),u.start.isCertain("meridiem")||(0==h?(u.start.imply("meridiem",0),12==u.start.get("hour")&&u.start.assign("hour",0)):(u.start.imply("meridiem",1),12!=u.start.get("hour")&&u.start.assign("hour",u.start.get("hour")+12)))}else m>=12&&(h=1);return u.text=u.text+a[0],u.end.assign("hour",m),u.end.assign("minute",l),h>=0&&u.end.assign("meridiem",h),u.end.date().getTime()12)&&m>12){if(!(l>=1&&l<=12&&m>=13&&m<=31))return null;var h=m;m=l,l=h}return l<1||l>31?null:(u<100&&(u+=u>50?1900:2e3),d.start.assign("day",l),d.start.assign("month",m),d.start.assign("year",u),a[2]&&d.start.assign("weekday",o[a[2].toLowerCase()]),d.tags.ESSlashDateFormatParser=!0,d)}}else a.index+=a[0].length}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=/(\W|^)(maintenant|aujourd'hui|ajd|cette\s*nuit|la\s*veille|(demain|hier)(\s*(matin|soir|aprem|après-midi))?|ce\s*(matin|soir)|cet\s*(après-midi|aprem))(?=\W|$)/i;t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,n){e=a[0].substr(a[1].length);var i=a.index+a[1].length,o=new s({index:i,text:e,ref:t}),d=r(t),u=d,m=e.toLowerCase();return m.match(/demain/)&&d.hour()>1&&(u=u.add(1,"day")),m.match(/hier/)&&(u=u.add(-1,"day")),m.match(/cette\s*nuit/)?(o.start.imply("hour",22),o.start.imply("meridiem",1)):m.match(/la\s*veille/)?(o.start.imply("hour",0),d.hour()>6&&(u=u.add(-1,"day"))):m.match(/(après-midi|aprem)/)?o.start.imply("hour",14):m.match(/(soir)/)?o.start.imply("hour",18):m.match(/matin/)?o.start.imply("hour",8):m.match("maintenant")&&(o.start.imply("hour",d.hour()),o.start.imply("minute",d.minute()),o.start.imply("second",d.second()),o.start.imply("millisecond",d.millisecond())),o.start.assign("day",u.date()),o.start.assign("month",u.month()+1),o.start.assign("year",u.year()),o.tags.FRCasualDateParser=!0,o}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(10),o=new RegExp("(\\W|^)(dans|en)\\s*("+i.INTEGER_WORDS_PATTERN+"|[0-9]+|une?|(?:\\s*quelques)?|demi(?:\\s*|-?)?)\\s*(secondes?|min(?:ute)?s?|heures?|jours?|semaines?|mois|années?)\\s*(?=\\W|$)","i"),d=new RegExp("(\\W|^)(dans|en)\\s*("+i.INTEGER_WORDS_PATTERN+"|[0-9]+|un?)\\s*(secondes?|minutes?|heures?|jours?)\\s*(?=\\W|$)","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return this.isStrictMode()?d:o},this.extract=function(e,t,a,n){var o=a.index+a[1].length;a[0];e=a[0].substr(a[1].length,a[0].length-a[1].length);var d=new s({index:o,text:e,ref:t}),u=a[3];u=void 0!==i.INTEGER_WORDS[u]?i.INTEGER_WORDS[u]:"un"===u||"une"===u?1:u.match(/quelques?/i)?3:u.match(/demi-?/i)?.5:parseInt(u);var m=r(t);return a[4].match(/jour|semaine|mois|année/i)?(a[4].match(/jour/)?m=m.add(u,"d"):a[4].match(/semaine/i)?m=m.add(7*u,"d"):a[4].match(/mois/i)?m=m.add(u,"month"):a[4].match(/année/i)&&(m=m.add(u,"year")),d.start.assign("year",m.year()),d.start.assign("month",m.month()+1),d.start.assign("day",m.date()),d):(a[4].match(/heure/i)?m=m.add(u,"hour"):a[4].match(/min/i)?m=m.add(u,"minutes"):a[4].match(/secondes/i)&&(m=m.add(u,"second")),d.start.imply("year",m.year()),d.start.imply("month",m.month()+1),d.start.imply("day",m.date()),d.start.assign("hour",m.hour()),d.start.assign("minute",m.minute()),d.start.assign("second",m.second()),d.tags.FRDeadlineFormatParser=!0,d)}}},function(e,t,a){var r=a(1),n=a(0).ParsedResult,s=a(10),i=(s.WEEKDAY_OFFSET,new RegExp("(\\W|^)(?:(Dimanche|Lundi|Mardi|mercredi|Jeudi|Vendredi|Samedi|Dim|Lun|Mar|Mer|Jeu|Ven|Sam)\\s*,?\\s*)?([0-9]{1,2}|1er)(?:\\s*(?:au|\\-|\\–|jusqu'au?|\\s)\\s*([0-9]{1,2})(?:er)?)?\\s*(?:de)?\\s*(Jan(?:vier|\\.)?|F[ée]v(?:rier|\\.)?|Mars|Avr(?:il|\\.)?|Mai|Juin|Juil(?:let|\\.)?|Ao[uû]t|Sept(?:embre|\\.)?|Oct(?:obre|\\.)?|Nov(?:embre|\\.)?|d[ée]c(?:embre|\\.)?)(?:\\s*(\\s*[0-9]{1,4}(?![^\\s]\\d))(?:\\s*(AC|[ap]\\.?\\s*c(?:h(?:r)?)?\\.?\\s*n\\.?))?)?(?=\\W|$)","i"));t.Parser=function(){r.Parser.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,i){var o=new n({text:a[0].substr(a[1].length,a[0].length-a[1].length),index:a.index+a[1].length,ref:t}),d=a[5];d=s.MONTH_OFFSET[d.toLowerCase()];var u=a[3];u=parseInt(u);var m=null;if(a[6]&&(m=a[6],m=parseInt(m),a[7]?/a/i.test(a[7])&&(m=-m):m<100&&(m+=2e3)),m?(o.start.assign("day",u),o.start.assign("month",d),o.start.assign("year",m)):(m=r.findYearClosestToRef(t,u,d),o.start.assign("day",u),o.start.assign("month",d),o.start.imply("year",m)),a[2]){var l=a[2];l=s.WEEKDAY_OFFSET[l.toLowerCase()],o.start.assign("weekday",l)}return a[4]&&(o.end=o.start.clone(),o.end.assign("day",parseInt(a[4]))),o.tags.FRMonthNameLittleEndianParser=!0,o}}},function(e,t,a){var r=a(1),n=a(0).ParsedResult,s=new RegExp("(\\W|^)(?:((?:dimanche|dim|lundi|lun|mardi|mar|mercredi|mer|jeudi|jeu|vendredi|ven|samedi|sam|le))\\s*\\,?\\s*)?([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}s*,?s*|[0-9]{2}s*,?s*))?(\\W|$)","i"),i={dimanche:0,dim:0,lundi:1,lun:1,mardi:2,mar:2,mercredi:3,mer:3,jeudi:4,jeu:4,vendredi:5,ven:5,samedi:6,sam:6};t.Parser=function(e){r.Parser.apply(this,arguments),this.pattern=function(){return s},this.extract=function(e,t,a,s){if("/"!=a[1]&&"/"!=a[6]){var o=a.index+a[1].length,d=(e=a[0].substr(a[1].length,a[0].length-a[6].length),new n({text:e,index:o,ref:t}));if(!e.match(/^\d\.\d$/)&&!e.match(/^\d\.\d{1,2}\.\d{1,2}$/)&&(a[5]||!(a[0].indexOf("/")<0))){var u=a[4],m=a[3];m=parseInt(m),u=parseInt(u);var l=null;if(a[5]&&(l=a[5],(l=parseInt(l))<100&&(l+=2e3)),(u<1||u>12)&&u>12){if(!(m>=1&&m<=12&&u>=13&&u<=31))return null;var h=u;u=m,m=h}return m<1||m>31?null:(l?(d.start.assign("day",m),d.start.assign("month",u),d.start.assign("year",l)):(l=r.findYearClosestToRef(t,m,u),d.start.assign("day",m),d.start.assign("month",u),d.start.imply("year",l)),a[2]&&d.start.assign("weekday",i[a[2].toLowerCase()]),d.tags.FRSlashDateFormatParser=!0,d)}}else a.index+=a[0].length}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=/(\W|^)il y a\s*([0-9]+|une?)\s*(minutes?|heures?|semaines?|jours?|mois|années?|ans?)(?=(?:\W|$))/i;t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,n){if(a.index>0&&e[a.index-1].match(/\w/))return null;e=a[0];e=a[0].substr(a[1].length,a[0].length-a[1].length);var i=a.index+a[1].length,o=new s({index:i,text:e,ref:t});o.tags.FRTimeAgoFormatParser=!0;var d=parseInt(a[2]);isNaN(d)&&(d=a[2].match(/demi/)?.5:1);var u=r(t);return a[3].match(/heure/)||a[3].match(/minute/)?(a[3].match(/heure/)?u=u.add(-d,"hour"):a[3].match(/minute/)&&(u=u.add(-d,"minute")),o.start.imply("day",u.date()),o.start.imply("month",u.month()+1),o.start.imply("year",u.year()),o.start.assign("hour",u.hour()),o.start.assign("minute",u.minute()),o):a[3].match(/semaine/)?(u=u.add(-d,"week"),o.start.imply("day",u.date()),o.start.imply("month",u.month()+1),o.start.imply("year",u.year()),o.start.imply("weekday",u.day()),o):(a[3].match(/jour/)&&(u=u.add(-d,"d")),a[3].match(/mois/)&&(u=u.add(-d,"month")),a[3].match(/années?|ans?/)&&(u=u.add(-d,"year")),o.start.assign("day",u.date()),o.start.assign("month",u.month()+1),o.start.assign("year",u.year()),o)}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(0).ParsedComponents,o=new RegExp("(^|\\s|T)(?:(?:[àa])\\s*)?(\\d{1,2}(?:h)?|midi|minuit)(?:(?:\\.|\\:|\\:|h)(\\d{1,2})(?:m)?(?:(?:\\:|\\:|m)(\\d{0,2})(?:s)?)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),d=new RegExp("^\\s*(\\-|\\–|\\~|\\〜|[àa]|\\?)\\s*(\\d{1,2}(?:h)?)(?:(?:\\.|\\:|\\:|h)(\\d{1,2})(?:m)?(?:(?:\\.|\\:|\\:|m)(\\d{1,2})(?:s)?)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return o},this.extract=function(e,t,a,n){if(a.index>0&&e[a.index-1].match(/\w/))return null;var o=r(t),u=new s;u.ref=t,u.index=a.index+a[1].length,u.text=a[0].substring(a[1].length),u.tags.FRTimeExpressionParser=!0,u.start.imply("day",o.date()),u.start.imply("month",o.month()+1),u.start.imply("year",o.year());var m=0,l=0,h=-1;if(null!=a[4]){if((c=parseInt(a[4]))>=60)return null;u.start.assign("second",c)}if("midi"==a[2].toLowerCase()?(h=1,m=12):"minuit"==a[2].toLowerCase()?(h=0,m=0):m=parseInt(a[2]),null!=a[3]?l=parseInt(a[3]):m>100&&(l=m%100,m=parseInt(m/100)),l>=60)return null;if(m>24)return null;if(m>=12&&(h=1),null!=a[5]){if(m>12)return null;"a"==(g=a[5][0].toLowerCase())&&(h=0,12==m&&(m=0)),"p"==g&&(h=1,12!=m&&(m+=12))}if(u.start.assign("hour",m),u.start.assign("minute",l),h>=0&&u.start.assign("meridiem",h),!(a=d.exec(e.substring(u.index+u.text.length))))return u.text.match(/^\d+$/)?null:u;if(a[0].match(/^\s*(\+|\-)\s*\d{3,4}$/))return u;null==u.end&&(u.end=new i(null,u.start.date()));m=0,l=0,h=-1;if(null!=a[4]){var c;if((c=parseInt(a[4]))>=60)return null;u.end.assign("second",c)}if(m=parseInt(a[2]),null!=a[3]){if((l=parseInt(a[3]))>=60)return u}else m>100&&(l=m%100,m=parseInt(m/100));if(l>=60)return null;if(m>24)return null;if(m>=12&&(h=1),null!=a[5]){if(m>12)return null;var g;"a"==(g=a[5][0].toLowerCase())&&(h=0,12==m&&(m=0,u.end.isCertain("day")||u.end.imply("day",u.end.get("day")+1))),"p"==g&&(h=1,12!=m&&(m+=12)),u.start.isCertain("meridiem")||(0==h?(u.start.imply("meridiem",0),12==u.start.get("hour")&&u.start.assign("hour",0)):(u.start.imply("meridiem",1),12!=u.start.get("hour")&&u.start.assign("hour",u.start.get("hour")+12)))}(u.text=u.text+a[0],u.end.assign("hour",m),u.end.assign("minute",l),h>=0)?u.end.assign("meridiem",h):u.start.isCertain("meridiem")&&1==u.start.get("meridiem")&&u.start.get("hour")>m?u.end.imply("meridiem",0):m>12&&u.end.imply("meridiem",1);return u.end.date().getTime()0){var p=g;g=f,f=p}return g=g.startOf(h),f=f.endOf(h),"week"==h&&(g=g.add(1,"d"),f=f.add(1,"d")),l.start.assign("year",g.year()),l.start.assign("month",g.month()+1),l.start.assign("day",g.date()),l.start.assign("minute",g.minute()),l.start.assign("second",g.second()),l.start.assign("hour",g.hour()),l.start.assign("millisecond",g.millisecond()),l.end=l.start.clone(),l.end.assign("year",f.year()),l.end.assign("month",f.month()+1),l.end.assign("day",f.date()),l.end.assign("minute",f.minute()),l.end.assign("second",f.second()),l.end.assign("hour",f.hour()),l.end.assign("millisecond",f.millisecond()),l}}}},function(e,t,a){e.exports=function(){"use strict";var e="month",t="quarter";return function(a,r){var n=r.prototype;n.quarter=function(e){return this.$utils().u(e)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(e-1))};var s=n.add;n.add=function(a,r){return a=Number(a),this.$utils().p(r)===t?this.add(3*a,e):s.bind(this)(a,r)};var i=n.startOf;n.startOf=function(a,r){var n=this.$utils(),s=!!n.u(r)||r;if(n.p(a)===t){var o=this.quarter()-1;return s?this.month(3*o).startOf(e).startOf("day"):this.month(3*o+2).endOf(e).endOf("day")}return i.bind(this)(a,r)}}}()},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(7),o=new RegExp("(\\d{2,4}|["+Object.keys(i.NUMBER).join("")+"]{2,4})?(?:\\s*)(?:年)?(?:[\\s|,|,]*)(\\d{1,2}|["+Object.keys(i.NUMBER).join("")+"]{1,2})(?:\\s*)(?:月)(?:\\s*)(\\d{1,2}|["+Object.keys(i.NUMBER).join("")+"]{1,2})?(?:\\s*)(?:日|號)?");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return o},this.extract=function(e,t,a,n){var o=r(t),d=new s({text:a[0],index:a.index,ref:t}),u=parseInt(a[2]);if(isNaN(u)&&(u=i.zhStringToNumber(a[2])),d.start.assign("month",u),a[3]){var m=parseInt(a[3]);isNaN(m)&&(m=i.zhStringToNumber(a[3])),d.start.assign("day",m)}else d.start.imply("day",o.date());if(a[1]){var l=parseInt(a[1]);isNaN(l)&&(l=i.zhStringToYear(a[1])),d.start.assign("year",l)}else d.start.imply("year",o.year());return d.tags.ZHHantDateParser=!0,d}}},function(e,t,a){var r=a(1).Parser,n=a(0).ParsedResult,s=a(6).updateParsedComponent,i=a(7),o=new RegExp("(上|今|下|這|呢)?(?:個)?(?:星期|禮拜)("+Object.keys(i.WEEKDAY_OFFSET).join("|")+")");t.Parser=function(){r.apply(this,arguments),this.pattern=function(){return o},this.extract=function(e,t,a,r){var o=a.index;e=a[0];var d=new n({index:o,text:e,ref:t}),u=a[2],m=i.WEEKDAY_OFFSET[u];if(void 0===m)return null;var l=null,h=a[1];return"上"==h?l="last":"下"==h?l="next":"今"!=h&&"這"!=h&&"呢"!=h||(l="this"),s(d,t,m,l),d.tags.ZHHantWeekdayParser=!0,d}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(0).ParsedComponents,o=a(7),d="(?:由|從|自)?(?:(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)(?:[\\s,,]*)(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?)?(?:[\\s,,]*)(?:(\\d+|["+Object.keys(o.NUMBER).join("")+"]+)(?:\\s*)(?:點|時|:|:)(?:\\s*)(\\d+|半|正|整|["+Object.keys(o.NUMBER).join("")+"]+)?(?:\\s*)(?:分|:|:)?(?:\\s*)(\\d+|["+Object.keys(o.NUMBER).join("")+"]+)?(?:\\s*)(?:秒)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?",u="(?:^\\s*(?:到|至|\\-|\\–|\\~|\\〜)\\s*)(?:(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)(?:[\\s,,]*)(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?)?(?:[\\s,,]*)(?:(\\d+|["+Object.keys(o.NUMBER).join("")+"]+)(?:\\s*)(?:點|時|:|:)(?:\\s*)(\\d+|半|正|整|["+Object.keys(o.NUMBER).join("")+"]+)?(?:\\s*)(?:分|:|:)?(?:\\s*)(\\d+|["+Object.keys(o.NUMBER).join("")+"]+)?(?:\\s*)(?:秒)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?",m=new RegExp(d,"i"),l=new RegExp(u,"i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return m},this.extract=function(e,t,a,n){if(a.index>0&&e[a.index-1].match(/\w/))return null;var d=r(t),u=new s;u.ref=t,u.index=a.index,u.text=a[0],u.tags.ZHTimeExpressionParser=!0;var m=d.clone();if(a[1])"明"==(y=a[1])||"聽"==y?d.hour()>1&&m.add(1,"day"):"昨"==y||"尋"==y||"琴"==y?m.add(-1,"day"):"前"==y?m.add(-2,"day"):"大前"==y?m.add(-3,"day"):"後"==y?m.add(2,"day"):"大後"==y&&m.add(3,"day"),u.start.assign("day",m.date()),u.start.assign("month",m.month()+1),u.start.assign("year",m.year());else if(a[4]){"明"==(v=a[4])||"聽"==v?m.add(1,"day"):"昨"==v||"尋"==v||"琴"==v?m.add(-1,"day"):"前"==v?m.add(-2,"day"):"大前"==v?m.add(-3,"day"):"後"==v?m.add(2,"day"):"大後"==v&&m.add(3,"day"),u.start.assign("day",m.date()),u.start.assign("month",m.month()+1),u.start.assign("year",m.year())}else u.start.imply("day",m.date()),u.start.imply("month",m.month()+1),u.start.imply("year",m.year());var h=0,c=0,g=-1;if(a[8]){var f=parseInt(a[8]);if(isNaN(f)&&(f=o.zhStringToNumber(a[8])),f>=60)return null;u.start.assign("second",f)}if(h=parseInt(a[6]),isNaN(h)&&(h=o.zhStringToNumber(a[6])),a[7]?"半"==a[7]?c=30:"正"==a[7]||"整"==a[7]?c=0:(c=parseInt(a[7]),isNaN(c)&&(c=o.zhStringToNumber(a[7]))):h>100&&(c=h%100,h=parseInt(h/100)),c>=60)return null;if(h>24)return null;if(h>=12&&(g=1),a[9]){if(h>12)return null;"a"==(x=a[9][0].toLowerCase())&&(g=0,12==h&&(h=0)),"p"==x&&(g=1,12!=h&&(h+=12))}else if(a[2]){"朝"==(P=a[2][0])||"早"==P?(g=0,12==h&&(h=0)):"晚"==P&&(g=1,12!=h&&(h+=12))}else if(a[3]){"上"==(T=a[3][0])||"朝"==T||"早"==T||"凌"==T?(g=0,12==h&&(h=0)):"下"!=T&&"晏"!=T&&"晚"!=T||(g=1,12!=h&&(h+=12))}else if(a[5]){"上"==(w=a[5][0])||"朝"==w||"早"==w||"凌"==w?(g=0,12==h&&(h=0)):"下"!=w&&"晏"!=w&&"晚"!=w||(g=1,12!=h&&(h+=12))}if(u.start.assign("hour",h),u.start.assign("minute",c),g>=0?u.start.assign("meridiem",g):h<12?u.start.imply("meridiem",0):u.start.imply("meridiem",1),!(a=l.exec(e.substring(u.index+u.text.length))))return u.text.match(/^\d+$/)?null:u;var y,p=m.clone();if(u.end=new i(null,null),a[1])"明"==(y=a[1])||"聽"==y?d.hour()>1&&p.add(1,"day"):"昨"==y||"尋"==y||"琴"==y?p.add(-1,"day"):"前"==y?p.add(-2,"day"):"大前"==y?p.add(-3,"day"):"後"==y?p.add(2,"day"):"大後"==y&&p.add(3,"day"),u.end.assign("day",p.date()),u.end.assign("month",p.month()+1),u.end.assign("year",p.year());else if(a[4]){var v;"明"==(v=a[4])||"聽"==v?p.add(1,"day"):"昨"==v||"尋"==v||"琴"==v?p.add(-1,"day"):"前"==v?p.add(-2,"day"):"大前"==v?p.add(-3,"day"):"後"==v?p.add(2,"day"):"大後"==v&&p.add(3,"day"),u.end.assign("day",p.date()),u.end.assign("month",p.month()+1),u.end.assign("year",p.year())}else u.end.imply("day",p.date()),u.end.imply("month",p.month()+1),u.end.imply("year",p.year());if(h=0,c=0,g=-1,a[8]){f=parseInt(a[8]);if(isNaN(f)&&(f=o.zhStringToNumber(a[8])),f>=60)return null;u.end.assign("second",f)}if(h=parseInt(a[6]),isNaN(h)&&(h=o.zhStringToNumber(a[6])),a[7]?"半"==a[7]?c=30:"正"==a[7]||"整"==a[7]?c=0:(c=parseInt(a[7]),isNaN(c)&&(c=o.zhStringToNumber(a[7]))):h>100&&(c=h%100,h=parseInt(h/100)),c>=60)return null;if(h>24)return null;if(h>=12&&(g=1),a[9]){if(h>12)return null;var x;"a"==(x=a[9][0].toLowerCase())&&(g=0,12==h&&(h=0)),"p"==x&&(g=1,12!=h&&(h+=12)),u.start.isCertain("meridiem")||(0==g?(u.start.imply("meridiem",0),12==u.start.get("hour")&&u.start.assign("hour",0)):(u.start.imply("meridiem",1),12!=u.start.get("hour")&&u.start.assign("hour",u.start.get("hour")+12)))}else if(a[2]){var P;"朝"==(P=a[2][0])||"早"==P?(g=0,12==h&&(h=0)):"晚"==P&&(g=1,12!=h&&(h+=12))}else if(a[3]){var T;"上"==(T=a[3][0])||"朝"==T||"早"==T||"凌"==T?(g=0,12==h&&(h=0)):"下"!=T&&"晏"!=T&&"晚"!=T||(g=1,12!=h&&(h+=12))}else if(a[5]){var w;"上"==(w=a[5][0])||"朝"==w||"早"==w||"凌"==w?(g=0,12==h&&(h=0)):"下"!=w&&"晏"!=w&&"晚"!=w||(g=1,12!=h&&(h+=12))}(u.text=u.text+a[0],u.end.assign("hour",h),u.end.assign("minute",c),g>=0)?u.end.assign("meridiem",g):u.start.isCertain("meridiem")&&1==u.start.get("meridiem")&&u.start.get("hour")>h?u.end.imply("meridiem",0):h>12&&u.end.imply("meridiem",1);return u.end.date().getTime()1&&(u=u.add(1,"day")):"昨"==m||"尋"==m||"琴"==m?u=u.add(-1,"day"):"前"==m?u=u.add(-2,"day"):"大前"==m?u=u.add(-3,"day"):"後"==m?u=u.add(2,"day"):"大後"==m&&(u=u.add(3,"day")),"早"==l||"朝"==l?o.start.imply("hour",6):"晚"==l&&(o.start.imply("hour",22),o.start.imply("meridiem",1))}else if(a[4]){var h=a[4][0];"早"==h||"朝"==h||"上"==h?o.start.imply("hour",6):"下"==h||"晏"==h?(o.start.imply("hour",15),o.start.imply("meridiem",1)):"中"==h?(o.start.imply("hour",12),o.start.imply("meridiem",1)):"夜"==h||"晚"==h?(o.start.imply("hour",22),o.start.imply("meridiem",1)):"凌"==h&&o.start.imply("hour",0)}else if(a[5]){var c=a[5];"明"==c||"聽"==c?d.hour()>1&&(u=u.add(1,"day")):"昨"==c||"尋"==c||"琴"==c?u=u.add(-1,"day"):"前"==c?u=u.add(-2,"day"):"大前"==c?u=u.add(-3,"day"):"後"==c?u=u.add(2,"day"):"大後"==c&&(u=u.add(3,"day"));var g=a[6];if(g){var f=g[0];"早"==f||"朝"==f||"上"==f?o.start.imply("hour",6):"下"==f||"晏"==f?(o.start.imply("hour",15),o.start.imply("meridiem",1)):"中"==f?(o.start.imply("hour",12),o.start.imply("meridiem",1)):"夜"==f||"晚"==f?(o.start.imply("hour",22),o.start.imply("meridiem",1)):"凌"==f&&o.start.imply("hour",0)}}return o.start.assign("day",u.date()),o.start.assign("month",u.month()+1),o.start.assign("year",u.year()),o.tags.ZHHantCasualDateParser=!0,o}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(7),o=new RegExp("(\\d+|["+Object.keys(i.NUMBER).join("")+"]+|半|幾)(?:\\s*)(?:個)?(秒(?:鐘)?|分鐘|小時|鐘|日|天|星期|禮拜|月|年)(?:(?:之|過)?後|(?:之)?內)","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return o},this.extract=function(e,t,a,n){var o=a.index;e=a[0];var d=new s({index:o,text:e,ref:t}),u=parseInt(a[1]);if(isNaN(u)&&(u=i.zhStringToNumber(a[1])),isNaN(u)){var m=a[1];if("幾"===m)u=3;else{if("半"!==m)return null;u=.5}}var l=r(t),h=a[2][0];return h.match(/[日天星禮月年]/)?("日"==h||"天"==h?l=l.add(u,"d"):"星"==h||"禮"==h?l=l.add(7*u,"d"):"月"==h?l=l.add(u,"month"):"年"==h&&(l=l.add(u,"year")),d.start.assign("year",l.year()),d.start.assign("month",l.month()+1),d.start.assign("day",l.date()),d):("秒"==h?l=l.add(u,"second"):"分"==h?l=l.add(u,"minute"):"小"!=h&&"鐘"!=h||(l=l.add(u,"hour")),d.start.imply("year",l.year()),d.start.imply("month",l.month()+1),d.start.imply("day",l.date()),d.start.assign("hour",l.hour()),d.start.assign("minute",l.minute()),d.start.assign("second",l.second()),d.tags.ZHHantDeadlineFormatParser=!0,d)}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(8),o=new RegExp("(\\W|^)(in|nach)\\s*("+i.INTEGER_WORDS_PATTERN+"|[0-9]+|einigen|eine[rm]\\s*halben|eine[rm])\\s*(sekunden?|min(?:ute)?n?|stunden?|tag(?:en)?|wochen?|monat(?:en)?|jahr(?:en)?)\\s*(?=\\W|$)","i"),d=new RegExp("(\\W|^)(in|nach)\\s*("+i.INTEGER_WORDS_PATTERN+"|[0-9]+|eine(?:r|m)?)\\s*(sekunden?|minuten?|stunden?|tag(?:en)?)\\s*(?=\\W|$)","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return this.isStrictMode()?d:o},this.extract=function(e,t,a,n){var o=a.index+a[1].length;a[0];e=a[0].substr(a[1].length,a[0].length-a[1].length);var d=new s({index:o,text:e,ref:t}),u=a[3].toLowerCase();u=void 0!==i.INTEGER_WORDS[u]?i.INTEGER_WORDS[u]:"einer"===u||"einem"===u?1:"einigen"===u?3:/halben/.test(u)?.5:parseInt(u);var m=r(t);return/tag|woche|monat|jahr/i.test(a[4])?(/tag/i.test(a[4])?m=m.add(u,"d"):/woche/i.test(a[4])?m=m.add(7*u,"d"):/monat/i.test(a[4])?m=m.add(u,"month"):/jahr/i.test(a[4])&&(m=m.add(u,"year")),d.start.assign("year",m.year()),d.start.assign("month",m.month()+1),d.start.assign("day",m.date()),d):(/stunde/i.test(a[4])?m=m.add(u,"hour"):/min/i.test(a[4])?m=m.add(u,"minute"):/sekunde/i.test(a[4])&&(m=m.add(u,"second")),d.start.imply("year",m.year()),d.start.imply("month",m.month()+1),d.start.imply("day",m.date()),d.start.assign("hour",m.hour()),d.start.assign("minute",m.minute()),d.start.assign("second",m.second()),d.tags.DEDeadlineFormatParser=!0,d)}}},function(e,t,a){a(2);var r=a(1),n=a(0).ParsedResult,s=a(8),i=new RegExp("(\\W|^)(?:am\\s*?)?(?:(Sonntag|Montag|Dienstag|Mittwoch|Donnerstag|Freitag|Samstag|So|Mo|Di|Mi|Do|Fr|Sa)\\s*,?\\s*)?(?:den\\s*)?([0-9]{1,2})\\.(?:\\s*(?:bis(?:\\s*(?:am|zum))?|\\-|\\–|\\s)\\s*([0-9]{1,2})\\.)?\\s*(Jan(?:uar|\\.)?|Feb(?:ruar|\\.)?|Mär(?:z|\\.)?|Maerz|Mrz\\.?|Apr(?:il|\\.)?|Mai|Jun(?:i|\\.)?|Jul(?:i|\\.)?|Aug(?:ust|\\.)?|Sep(?:t|t\\.|tember|\\.)?|Okt(?:ober|\\.)?|Nov(?:ember|\\.)?|Dez(?:ember|\\.)?)(?:,?\\s*([0-9]{1,4}(?![^\\s]\\d))(\\s*[vn]\\.?\\s*C(?:hr)?\\.?)?)?(?=\\W|$)","i");t.Parser=function(){r.Parser.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,i){var o=new n({text:a[0].substr(a[1].length,a[0].length-a[1].length),index:a.index+a[1].length,ref:t}),d=a[5];d=s.MONTH_OFFSET[d.toLowerCase()];var u=a[3];u=parseInt(u);var m=null;if(a[6]&&(m=a[6],m=parseInt(m),a[7]?/v/i.test(a[7])&&(m=-m):m<100&&(m+=2e3)),m?(o.start.assign("day",u),o.start.assign("month",d),o.start.assign("year",m)):(m=r.findYearClosestToRef(t,u,d),o.start.assign("day",u),o.start.assign("month",d),o.start.imply("year",m)),a[2]){var l=a[2];l=s.WEEKDAY_OFFSET[l.toLowerCase()],o.start.assign("weekday",l)}return a[4]&&(o.end=o.start.clone(),o.end.assign("day",parseInt(a[4]))),o.tags.DEMonthNameLittleEndianParser=!0,o}}},function(e,t,a){var r=a(1),n=a(0).ParsedResult,s=a(8),i=new RegExp("(^|\\D\\s+|[^\\w\\s])(Jan\\.?|Januar|Feb\\.?|Februar|Mär\\.?|M(?:ä|ae)rz|Mrz\\.?|Apr\\.?|April|Mai\\.?|Jun\\.?|Juni|Jul\\.?|Juli|Aug\\.?|August|Sep\\.?|Sept\\.?|September|Okt\\.?|Oktober|Nov\\.?|November|Dez\\.?|Dezember)\\s*(?:,?\\s*(?:([0-9]{4})(\\s*[vn]\\.?\\s*C(?:hr)?\\.?)?|([0-9]{1,4})\\s*([vn]\\.?\\s*C(?:hr)?\\.?)))?(?=[^\\s\\w]|$)","i");t.Parser=function(){r.Parser.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,i){var o=new n({text:a[0].substr(a[1].length,a[0].length-a[1].length),index:a.index+a[1].length,ref:t}),d=a[2];d=s.MONTH_OFFSET[d.toLowerCase()];var u=null;return(a[3]||a[5])&&(u=a[3]||a[5],u=parseInt(u),a[4]||a[6]?/v/i.test(a[4]||a[6])&&(u=-u):u<100&&(u+=2e3)),u?(o.start.imply("day",1),o.start.assign("month",d),o.start.assign("year",u)):(u=r.findYearClosestToRef(t,1,d),o.start.imply("day",1),o.start.assign("month",d),o.start.imply("year",u)),(!this.isStrictMode()||!o.text.match(/^\w+$/))&&(o.tags.DEMonthNameParser=!0,o)}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=new RegExp("(\\W|^)(?:(?:am\\s*?)?((?:sonntag|so|montag|mo|dienstag|di|mittwoch|mi|donnerstag|do|freitag|fr|samstag|sa))\\s*\\,?\\s*(?:den\\s*)?)?([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}s*,?s*|[0-9]{2}s*,?s*))?(\\W|$)","i"),o={sonntag:0,so:0,montag:1,mo:1,dienstag:2,di:2,mittwoch:3,mi:3,donnerstag:4,do:4,freitag:5,fr:5,samstag:6,sa:6};t.Parser=function(e){n.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,n){if("/"!=a[1]&&"/"!=a[6]){var i=a.index+a[1].length,d=(e=a[0].substr(a[1].length,a[0].length-a[6].length),new s({text:e,index:i,ref:t}));if(!e.match(/^\d\.\d$/)&&!e.match(/^\d\.\d{1,2}\.\d{1,2}$/)&&(a[5]||!(a[0].indexOf("/")<0))){var u=a[5]||r(t).year()+"",m=a[4],l=a[3];return m=parseInt(m),l=parseInt(l),u=parseInt(u),m<1||m>12?null:l<1||l>31?null:(u<100&&(u+=u>50?1900:2e3),d.start.assign("day",l),d.start.assign("month",m),d.start.assign("year",u),a[2]&&d.start.assign("weekday",o[a[2].toLowerCase()]),d.tags.DESlashDateFormatParser=!0,d)}}else a.index+=a[0].length}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(8),o=new RegExp("(\\W|^)vor\\s*("+i.INTEGER_WORDS_PATTERN+"|[0-9]+|einigen|eine[rm]\\s*halben|eine[rm])\\s*(sekunden?|min(?:ute)?n?|stunden?|wochen?|tag(?:en)?|monat(?:en)?|jahr(?:en)?)\\s*(?=(?:\\W|$))","i"),d=new RegExp("(\\W|^)vor\\s*([0-9]+|eine(?:r|m))\\s*(sekunden?|minuten?|stunden?|tag(?:en)?)(?=(?:\\W|$))","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return this.isStrictMode()?d:o},this.extract=function(e,t,a,n){if(a.index>0&&e[a.index-1].match(/\w/))return null;e=a[0];e=a[0].substr(a[1].length,a[0].length-a[1].length);var o=a.index+a[1].length,d=new s({index:o,text:e,ref:t}),u=a[2].toLowerCase();u=void 0!==i.INTEGER_WORDS[u]?i.INTEGER_WORDS[u]:"einer"===u||"einem"===u?1:"einigen"===u?3:/halben/.test(u)?.5:parseInt(u);var m=r(t);return/stunde|min|sekunde/i.test(a[3])?(/stunde/i.test(a[3])?m=m.add(-u,"hour"):/min/i.test(a[3])?m=m.add(-u,"minute"):/sekunde/i.test(a[3])&&(m=m.add(-u,"second")),d.start.imply("day",m.date()),d.start.imply("month",m.month()+1),d.start.imply("year",m.year()),d.start.assign("hour",m.hour()),d.start.assign("minute",m.minute()),d.start.assign("second",m.second()),d.tags.DETimeAgoFormatParser=!0,d):/woche/i.test(a[3])?(m=m.add(-u,"week"),d.start.imply("day",m.date()),d.start.imply("month",m.month()+1),d.start.imply("year",m.year()),d.start.imply("weekday",m.day()),d):(/tag/i.test(a[3])&&(m=m.add(-u,"d")),/monat/i.test(a[3])&&(m=m.add(-u,"month")),/jahr/i.test(a[3])&&(m=m.add(-u,"year")),d.start.assign("day",m.date()),d.start.assign("month",m.month()+1),d.start.assign("year",m.year()),d)}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(0).ParsedComponents,o=new RegExp("(^|\\s|T)(?:(?:um|von)\\s*)?(\\d{1,4}|mittags?|mitternachts?)(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:(?:\\:|\\:)(\\d{2}))?)?(?:\\s*uhr)?(?:\\s*(morgens|vormittags|mittags|nachmittags|abends|nachts))?(?=\\W|$)","i"),d=new RegExp("^\\s*(\\-|\\–|\\~|\\〜|bis|\\?)\\s*(\\d{1,4})(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:(?:\\.|\\:|\\:)(\\d{1,2}))?)?(?:\\s*(morgens|vormittags|mittags|nachmittags|abends|nachts))?(?=\\W|$)","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return o},this.extract=function(e,t,a,n){if(a.index>0&&e[a.index-1].match(/\w/))return null;var o=r(t),u=new s;u.ref=t,u.index=a.index+a[1].length,u.text=a[0].substring(a[1].length),u.tags.DETimeExpressionParser=!0,u.start.imply("day",o.date()),u.start.imply("month",o.month()+1),u.start.imply("year",o.year());var m=0,l=0,h=-1;if(null!=a[4]){if((c=parseInt(a[4]))>=60)return null;u.start.assign("second",c)}if(/mittags?/i.test(a[2])?(h=1,m=12):/mitternachts?/i.test(a[2])?(h=0,m=0):m=parseInt(a[2]),null!=a[3]?l=parseInt(a[3]):m>100&&(l=m%100,m=parseInt(m/100)),l>=60)return null;if(m>24)return null;if(m>=12&&(h=1),null!=a[5]){if(m>12)return null;"morgens"===(g=a[5].toLowerCase())||"vormittags"===g?(h=0,12==m&&(m=0)):(h=1,12!=m&&(m+=12))}if(u.start.assign("hour",m),u.start.assign("minute",l),h>=0?u.start.assign("meridiem",h):m<12?u.start.imply("meridiem",0):u.start.imply("meridiem",1),!(a=d.exec(e.substring(u.index+u.text.length))))return u.text.match(/^\d+$/)?null:u;if(a[0].match(/^\s*(\+|\-)\s*\d{3,4}$/))return u;null==u.end&&(u.end=new i(null,u.start.date()));m=0,l=0,h=-1;if(null!=a[4]){var c;if((c=parseInt(a[4]))>=60)return null;u.end.assign("second",c)}if(m=parseInt(a[2]),null!=a[3]){if((l=parseInt(a[3]))>=60)return u}else m>100&&(l=m%100,m=parseInt(m/100));if(l>=60)return null;if(m>24)return null;if(m>=12&&(h=1),null!=a[5]){if(m>12)return null;var g;"morgens"===(g=a[5].toLowerCase())||"vormittags"===g?(h=0,12==m&&(m=0,u.end.isCertain("day")||u.end.imply("day",u.end.get("day")+1))):(h=1,12!=m&&(m+=12)),u.start.isCertain("meridiem")||(0==h?(u.start.imply("meridiem",0),12==u.start.get("hour")&&u.start.assign("hour",0)):(u.start.imply("meridiem",1),12!=u.start.get("hour")&&u.start.assign("hour",u.start.get("hour")+12)))}(u.text=u.text+a[0],u.end.assign("hour",m),u.end.assign("minute",l),h>=0)?u.end.assign("meridiem",h):u.start.isCertain("meridiem")&&1==u.start.get("meridiem")&&u.start.get("hour")>m?u.end.imply("meridiem",0):m>12&&u.end.imply("meridiem",1);return u.end.date().getTime()m?l.day(m+7):l.day(m):n.forwardDate&&g>m?l.day(m+7):!n.forwardDate&&Math.abs(m-7-g)1?2:1,"day"):/^morgen/.test(u)?d.hour()>1&&(m=m.add(1,"day")):/^gestern/.test(u)?m=m.add(-1,"day"):/^vorgestern/.test(u)?m=m.add(-2,"day"):/letzte\s*nacht/.test(u)?(o.start.imply("hour",0),d.hour()>6&&(m=m.add(-1,"day"))):"jetzt"===u&&(o.start.imply("hour",d.hour()),o.start.imply("minute",d.minute()),o.start.imply("second",d.second()),o.start.imply("millisecond",d.millisecond()));var l=a[3]||a[4]||a[5];if(l)switch(l.toLowerCase()){case"morgen":o.start.imply("hour",6);break;case"vormittag":o.start.imply("hour",9);break;case"mittag":o.start.imply("hour",12);break;case"nachmittag":o.start.imply("hour",15),o.start.imply("meridiem",1);break;case"abend":o.start.imply("hour",18),o.start.imply("meridiem",1);break;case"nacht":o.start.imply("hour",0)}return o.start.assign("day",m.date()),o.start.assign("month",m.month()+1),o.start.assign("year",m.year()),o.tags.DECasualDateParser=!0,o}}},function(e,t,a){var r=a(1),n=a(0).ParsedResult,s=a(11),i=new RegExp("(^|\\D\\s+|[^\\w\\s])("+s.MONTH_PATTERN+")\\s*(?:[,-]?\\s*([0-9]{4})(\\s*BE|n.Chr.|v.Chr.)?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)","i");t.Parser=function(){r.Parser.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,i){var o=new n({text:a[0].substr(a[1].length,a[0].length-a[1].length),index:a.index+a[1].length,ref:t}),d=a[2],u=s.MONTH_OFFSET[d.toLowerCase()],m=null;return a[3]&&(m=a[3],m=parseInt(m),a[4]?a[4].match(/BE/)?m-=543:a[4].match(/v\.Chr\./)&&(m=-m):m<100&&(m+=2e3)),m?(o.start.imply("day",1),o.start.assign("month",u),o.start.assign("year",m)):(m=r.findYearClosestToRef(t,1,u),o.start.imply("day",1),o.start.assign("month",u),o.start.imply("year",m)),!o.text.match(/^\w{3}$/)&&(o.tags.NLMonthNameParser=!0,o)}}},function(e,t,a){var r=a(1),n=a(0).ParsedResult,s=a(11),i=new RegExp("(\\W|^)(?:op\\s*?)?(?:("+s.WEEKDAY_PATTERN+")\\s*,?\\s*)?([0-9]{1,2}).?(?:\\s*(?:tot|\\-|\\–|tot en met|t\\/m)\\s*([0-9]{1,2}).?)?\\s*("+s.MONTH_PATTERN+")(?:(?:-|/|,?\\s*)((?:[1-9][0-9]{0,3}\\s*(?:BE|n.Chr.|v.Chr.)|[1-2][0-9]{3}|[5-9][0-9])(?![^\\s]\\d)))?(?=\\W|$)","i");t.Parser=function(){r.Parser.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,i){var o=new n({text:a[0].substr(a[1].length,a[0].length-a[1].length),index:a.index+a[1].length,ref:t}),d=a[5];d=s.MONTH_OFFSET[d.toLowerCase()];var u=a[3];u=parseInt(u);var m=null;if(a[6]&&(m=a[6],/BE/i.test(m)?(m=m.replace(/BE/i,""),m=parseInt(m)-543):/v\.Chr\./i.test(m)?(m=m.replace(/v\.Chr\./i,""),m=-parseInt(m)):/n\.Chr\./i.test(m)?(m=m.replace(/n\.Chr\./i,""),m=parseInt(m)):(m=parseInt(m))<100&&(m+=m>50?1900:2e3)),m?(o.start.assign("day",u),o.start.assign("month",d),o.start.assign("year",m)):(m=r.findYearClosestToRef(t,u,d),o.start.assign("day",u),o.start.assign("month",d),o.start.imply("year",m)),a[2]){var l=a[2];l=s.WEEKDAY_OFFSET[l.toLowerCase()],o.start.assign("weekday",l)}if(a[4]){var h=parseInt(a[4]);o.end=o.start.clone(),o.end.assign("day",h)}return o.tags.NLMonthNameLittleEndianParser=!0,o}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(11),o=new RegExp("(\\W|^)(?:(?:op\\s*?)?("+i.WEEKDAY_PATTERN+")\\s*\\,?\\s*(?:de\\s*)?)?([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-1]{0,1}[0-9]{1}|"+i.MONTH_PATTERN+")(?:[\\/\\.\\-]([0-9]{4}s*,?s*|[0-9]{2}s*,?s*))?(\\W|$)","i");t.Parser=function(e){n.apply(this,arguments),this.pattern=function(){return o},this.extract=function(e,t,a,n){if("/"!=a[1]&&"/"!=a[6]){var o=a.index+a[1].length,d=(e=a[0].substr(a[1].length,a[0].length-a[6].length),new s({text:e,index:o,ref:t}));if(!e.match(/^\d\.\d$/)&&!e.match(/^\d\.\d{1,2}\.\d{1,2}$/)&&(a[5]||!(a[0].indexOf("/")<0))){var u=a[5]||r(t).year()+"",m=a[4],l=a[3];return(m=parseInt(m))||(m=i.MONTH_OFFSET[a[4].trim().toLowerCase()]),l=parseInt(l),u=parseInt(u),m<1||m>12?null:l<1||l>31?null:(u<100&&(u+=u>50?1900:2e3),d.start.assign("day",l),d.start.assign("month",m),d.start.assign("year",u),a[2]&&d.start.assign("weekday",i.WEEKDAY_OFFSET[a[2].toLowerCase()]),d.tags.NLSlashDateFormatParser=!0,d)}}else a.index+=a[0].length}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i={zondag:0,zo:0,maandag:1,ma:1,dinsdag:2,di:2,woensdag:3,wo:3,donderdag:4,do:4,vrijdag:5,vr:5,zaterdag:6,za:6},o=new RegExp("(\\W|^)(?:(?:\\,|\\(|\\()\\s*)?(?:on\\s*?)?(?:(deze|afgelopen|vorige|volgende|komende)\\s*(?:week)?\\s*)?("+Object.keys(i).join("|")+")(?:\\s*(?:\\,|\\)|\\)))?(?:\\s*(deze|afgelopen|vorige|volgende|komende)\\s*week)?(?=\\W|$)","i");t.updateParsedComponent=function(e,t,a,n){var s=r(t),i=!1,o=s.day();return"afgelopen"==n||"vorige"==n?(s=s.day(a-7),i=!0):"volgende"==n?(s=s.day(a+7),i=!0):s="deze"==n||"komende"==n?s.day(a):Math.abs(a-7-o)0&&e[a.index-1].match(/\w/))return null;var o=r(t),u=new s;u.ref=t,u.index=a.index+a[1].length,u.text=a[0].substring(a[1].length),u.tags.NLTimeExpressionParser=!0,u.start.imply("day",o.date()),u.start.imply("month",o.month()+1),u.start.imply("year",o.year());var m=0,l=0,h=-1;if(null!=a[4]){if((c=parseInt(a[4]))>=60)return null;u.start.assign("second",c)}if(/tussen de middag/i.test(a[2])?(h=1,m=12):/middernachts?/i.test(a[2])?(h=0,m=0):m=parseInt(a[2]),null!=a[3]?l=parseInt(a[3]):m>100&&(l=m%100,m=parseInt(m/100)),l>=60)return null;if(m>24)return null;if(m>=12&&(h=1),null!=a[5]){if(m>12)return null;"'s ochtends"===(g=a[5].toLowerCase())||"in de ochtend"===g||"'s morgens"===g?(h=0,12==m&&(m=0)):(h=1,12!=m&&(m+=12))}if(u.start.assign("hour",m),u.start.assign("minute",l),h>=0?u.start.assign("meridiem",h):m<12?u.start.imply("meridiem",0):u.start.imply("meridiem",1),!(a=d.exec(e.substring(u.index+u.text.length))))return u.text.match(/^\d+$/)?null:u;if(a[0].match(/^\s*(\+|\-)\s*\d{3,4}$/))return u;null==u.end&&(u.end=new i(null,u.start.date()));m=0,l=0,h=-1;if(null!=a[4]){var c;if((c=parseInt(a[4]))>=60)return null;u.end.assign("second",c)}if(m=parseInt(a[2]),null!=a[3]){if((l=parseInt(a[3]))>=60)return u}else m>100&&(l=m%100,m=parseInt(m/100));if(l>=60)return null;if(m>24)return null;if(m>=12&&(h=1),null!=a[5]){if(m>12)return null;var g;"'s ochtends"===(g=a[5].toLowerCase())||"in de ochtend"===g||"'s morgens"===g?(h=0,12==m&&(m=0,u.end.isCertain("day")||u.end.imply("day",u.end.get("day")+1))):(h=1,12!=m&&(m+=12)),u.start.isCertain("meridiem")||(0==h?(u.start.imply("meridiem",0),12==u.start.get("hour")&&u.start.assign("hour",0)):(u.start.imply("meridiem",1),12!=u.start.get("hour")&&u.start.assign("hour",u.start.get("hour")+12)))}(u.text=u.text+a[0],u.end.assign("hour",m),u.end.assign("minute",l),h>=0)?u.end.assign("meridiem",h):u.start.isCertain("meridiem")&&1==u.start.get("meridiem")&&u.start.get("hour")>m?u.end.imply("meridiem",0):m>12&&u.end.imply("meridiem",1);return u.end.date().getTime()1?2:1,"day"):/^morgen/.test(u)?d.hour()>1&&(m=m.add(1,"day")):/^gisteren/.test(u)?m=m.add(-1,"day"):/^eergisteren/.test(u)?m=m.add(-2,"day"):/afgelopen\s*nacht/.test(u)?(o.start.imply("hour",0),d.hour()>6&&(m=m.add(-1,"day"))):"nu"===u&&(o.start.imply("hour",d.hour()),o.start.imply("minute",d.minute()),o.start.imply("second",d.second()),o.start.imply("millisecond",d.millisecond()));var l=a[3]||a[4]||a[5];if(l)switch(l.toLowerCase()){case"vroeg in de ochtend":o.start.imply("hour",6);break;case"ochtend":case"morgen":case"'s ochtends":case"'s morgends":o.start.imply("hour",9);break;case"tussen de middag":o.start.imply("hour",12);break;case"middag":case"in de middag":case"'s middags":o.start.imply("hour",15),o.start.imply("meridiem",1);break;case"avond":case"'s avonds":o.start.imply("hour",18),o.start.imply("meridiem",1);break;case"nacht":case"'s nachts":o.start.imply("hour",0)}return o.start.assign("day",m.date()),o.start.assign("month",m.month()+1),o.start.assign("year",m.year()),o.tags.NLCasualDateParser=!0,o}}},function(e,t,a){var r=a(1).Parser,n=a(0).ParsedResult,s=/(\W|^)((deze)?\s*('s morgens|'s ochtends|in de ochtend|'s middags|in de middag|'s avonds|in de avond|'s nachts|ochtend|tussen de middag|middag|avond|nacht))/i,i=4;t.Parser=function(){r.apply(this,arguments),this.pattern=function(){return s},this.extract=function(e,t,a,r){e=a[0].substr(a[1].length);var s=a.index+a[1].length,o=new n({index:s,text:e,ref:t});switch(a[i]||(i=3),a[i].toLowerCase()){case"middag":case"in de middag":case"'s middags":o.start.imply("meridiem",1),o.start.imply("hour",15);break;case"avond":case"in de avond":case"'s avonds":o.start.imply("meridiem",1),o.start.imply("hour",20);break;case"middernacht":case"nacht":case"'s nachts":o.start.imply("meridiem",0),o.start.imply("hour",0);break;case"ochtend":case"s morgens":case"s ochtends":case"in de ochtend":o.start.imply("meridiem",0),o.start.imply("hour",9);break;case"tussen de middag":o.start.imply("meridiem",0),o.start.imply("hour",12)}return o.tags.NLCasualTimeParser=!0,o}}},function(e,t,a){var r=a(3).Refiner;t.Refiner=function(){r.call(this),this.refine=function(e,t,a){if(t.length<2)return t;for(var r=[],n=t[0],s=1;sn.text.length&&(n=i):(r.push(n),n=i)}return null!=n&&r.push(n),r}}},function(e,t,a){var r=a(3).Refiner,n=new RegExp("^\\s*(GMT|UTC)?(\\+|\\-)(\\d{1,2}):?(\\d{2})","i");t.Refiner=function(){r.call(this),this.refine=function(e,t,a){return t.forEach((function(t){if(!t.start.isCertain("timezoneOffset")){var a=n.exec(e.substring(t.index+t.text.length));if(a){var r=60*parseInt(a[3])+parseInt(a[4]);"-"===a[2]&&(r=-r),null!=t.end&&t.end.assign("timezoneOffset",r),t.start.assign("timezoneOffset",r),t.text+=a[0],t.tags.ExtractTimezoneOffsetRefiner=!0}}})),t}}},function(e,t,a){var r=a(3).Refiner,n=new RegExp("^\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)","i"),s={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:60,CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:-300,FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:240,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:-480,PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360};t.Refiner=function(e){r.call(this,arguments),this.refine=function(e,t,a){var r=new Object(s);if(a.timezones)for(var i in a.timezones)r[i]=a.timezones[i];return t.forEach((function(t){if(t.tags.ENTimeExpressionParser||t.tags.ENCasualTimeParser||t.tags.ZHTimeExpressionParser||t.tags.FRTimeExpressionParser||t.tags.DETimeExpressionParser){var a=n.exec(e.substring(t.index+t.text.length));if(a){var s=a[1].toUpperCase();if(void 0===r[s])return;var i=r[s];t.start.isCertain("timezoneOffset")||t.start.assign("timezoneOffset",i),null==t.end||t.end.isCertain("timezoneOffset")||t.end.assign("timezoneOffset",i),t.text+=a[0],t.tags.ExtractTimezoneAbbrRefiner=!0}}})),t}}},function(e,t,a){var r=a(2),n=a(3).Refiner;t.Refiner=function(){n.call(this),this.refine=function(e,t,a){return a.forwardDate?(t.forEach((function(e){var t=r(e.ref);if(e.start.isOnlyDayMonthComponent()&&t.isAfter(e.start.dayjs())){for(var a=0;a<3&&t.isAfter(e.start.dayjs());a++)e.start.imply("year",e.start.get("year")+1),e.end&&!e.end.isCertain("year")&&e.end.imply("year",e.end.get("year")+1);e.tags.ForwardDateRefiner=!0}e.start.isOnlyWeekdayComponent()&&t.isAfter(e.start.dayjs())&&(t=t.day()>e.start.get("weekday")?t.day(e.start.get("weekday")+7):t.day(e.start.get("weekday")),e.start.imply("day",t.date()),e.start.imply("month",t.month()+1),e.start.imply("year",t.year()),e.tags.ForwardDateRefiner=!0)})),t):t}}},function(e,t,a){var r=a(3).Filter;t.Refiner=function(){r.call(this),this.isValid=function(e,t,a){return!t.text.replace(" ","").match(/^\d*(\.\d*)?$/)}}},function(e,t,a){a(0).ParsedComponents;var r=a(3).Refiner,n=new RegExp("^\\s*(at|after|before|on|,|-|\\(|\\))?\\s*$");function s(e,t){var a=!1;return e.start.isCertain("year")&&(t.start.isCertain("year")?e.start.isCertain("month")&&(t.start.isCertain("month")?e.start.isCertain("day")&&!t.start.isCertain("day")&&(a=!0):a=!0):a=!0),a}function i(e,t,a){var r=e.substring(t.index+t.text.length,a.index),s=t.tags.ENRelativeDateFormatParser||a.tags.ENRelativeDateFormatParser,i=!t.start.isCertain("day")&&!t.start.isCertain("month")&&!t.start.isCertain("year");return t.start.isCertain("year")&&a.start.isCertain("year")&&(i=t.start.get("year")===a.start.get("year")),t.start.isCertain("month")&&a.start.isCertain("month")&&(i=t.start.get("month")===a.start.get("month")&&i),s&&r.match(n)&&i}function o(e,t,a){t.start,a.start;var r=Math.min(t.index,a.index),n=Math.max(t.index+t.text.length,a.index+a.text.length);for(var s in t.index=r,t.text=e.substring(r,n),a.tags)t.tags[s]=!0;return t.tags.ENPrioritizeSpecificDateRefiner=!0,t}t.Refiner=function(){r.call(this),this.refine=function(e,t,a){if(t.length<2)return t;for(var r=[],n=null,d=null,u=1;ua.start.date()){var n=a;a=t,t=n}for(var s in t.end=a.start,a.tags)t.tags[s]=!0;var i=Math.min(t.index,a.index),o=Math.max(t.index+t.text.length,a.index+a.text.length);return t.index=i,t.text=e.substring(i,o),t.tags[this.constructor.name]=!0,t}}},function(e,t,a){a(0).ParsedComponents;var r=a(3).Refiner,n=a(5).mergeDateTimeComponent,s=new RegExp("^\\s*(T|à|a|vers|de|,|-)?\\s*$");function i(e){return!e.start.isCertain("hour")||e.tags.FRCasualDateParser}function o(e){return!e.start.isCertain("month")&&!e.start.isCertain("weekday")}function d(e,t,a){return e.substring(t.index+t.text.length,a.index).match(s)}function u(e,t,a){var r=t.start,s=a.start,i=n(r,s);if(null!=t.end||null!=a.end){var o=null==t.end?t.start:t.end,d=null==a.end?a.start:a.end,u=n(o,d);null==t.end&&u.date().getTime()=t?e:""+Array(t+1-r.length).join(a)+e},h={s:l,z:function(e){var t=-e.utcOffset(),a=Math.abs(t),r=Math.floor(a/60),n=a%60;return(t<=0?"+":"-")+l(r,2,"0")+":"+l(n,2,"0")},m:function(e,t){var a=12*(t.year()-e.year())+(t.month()-e.month()),r=e.clone().add(a,i),n=t-r<0,s=e.clone().add(a+(n?-1:1),i);return Number(-(a+(t-r)/(n?r-s:s-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(u){return{M:i,y:d,w:s,d:n,D:"date",h:r,m:a,s:t,ms:e,Q:o}[u]||String(u||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},c={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},g="en",f={};f[g]=c;var y=function(e){return e instanceof P},p=function(e,t,a){var r;if(!e)return g;if("string"==typeof e)f[e]&&(r=e),t&&(f[e]=t,r=e);else{var n=e.name;f[n]=e,r=n}return!a&&r&&(g=r),r||!a&&g},v=function(e,t){if(y(e))return e.clone();var a="object"==typeof t?t:{};return a.date=e,a.args=arguments,new P(a)},x=h;x.l=p,x.i=y,x.w=function(e,t){return v(e,{locale:t.$L,utc:t.$u,$offset:t.$offset})};var P=function(){function l(e){this.$L=this.$L||p(e.locale,null,!0),this.parse(e)}var h=l.prototype;return h.parse=function(e){this.$d=function(e){var t=e.date,a=e.utc;if(null===t)return new Date(NaN);if(x.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(u);if(r)return a?new Date(Date.UTC(r[1],r[2]-1,r[3]||1,r[4]||0,r[5]||0,r[6]||0,r[7]||0)):new Date(r[1],r[2]-1,r[3]||1,r[4]||0,r[5]||0,r[6]||0,r[7]||0)}return new Date(t)}(e),this.init()},h.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},h.$utils=function(){return x},h.isValid=function(){return!("Invalid Date"===this.$d.toString())},h.isSame=function(e,t){var a=v(e);return this.startOf(t)<=a&&a<=this.endOf(t)},h.isAfter=function(e,t){return v(e)a.start.date().getTime()){var n=t.start.dayjs(),s=a.start.dayjs();if(t.isOnlyWeekday()&&n.add(-7,"days").isBefore(s))n=n.add(-7,"days"),t.start.imply("day",n.date()),t.start.imply("month",n.month()+1),t.start.imply("year",n.year());else if(a.isOnlyWeekday()&&s.add(7,"days").isAfter(n))s=s.add(7,"days"),a.start.imply("day",s.date()),a.start.imply("month",s.month()+1),a.start.imply("year",s.year());else{var i=a;a=t,t=i}}for(var o in t.end=a.start,a.tags)t.tags[o]=!0;var d=Math.min(t.index,a.index),u=Math.max(t.index+t.text.length,a.index+a.text.length);return t.index=d,t.text=e.substring(d,u),t.tags[this.constructor.name]=!0,t}}},function(e,t){t.WEEKDAY_OFFSET={dimanche:0,dim:0,lundi:1,lun:1,mardi:2,mar:2,mercredi:3,mer:3,jeudi:4,jeu:4,vendredi:5,ven:5,samedi:6,sam:6},t.MONTH_OFFSET={janvier:1,jan:1,"jan.":1,"février":2,"fév":2,"fév.":2,fevrier:2,fev:2,"fev.":2,mars:3,mar:3,"mar.":3,avril:4,avr:4,"avr.":4,mai:5,juin:6,jun:6,juillet:7,jul:7,"jul.":7,"août":8,aout:8,septembre:9,sep:9,"sep.":9,sept:9,"sept.":9,octobre:10,oct:10,"oct.":10,novembre:11,nov:11,"nov.":11,"décembre":12,decembre:12,dec:12,"dec.":12},t.INTEGER_WORDS_PATTERN="(?:un|deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize)",t.INTEGER_WORDS={un:1,deux:2,trois:3,quatre:4,cinq:5,six:6,sept:7,huit:8,neuf:9,dix:10,onze:11,douze:12,treize:13}},function(e,t){t.WEEKDAY_OFFSET={zondag:0,zo:0,"zo.":0,maandag:1,ma:1,"ma.":1,dinsdag:2,di:2,"di.":2,woensdag:3,wo:3,"wo.":3,donderdag:4,do:4,"do.":4,vrijdag:5,vr:5,"vr.":5,zaterdag:6,za:6,"za.":6},t.WEEKDAY_PATTERN="(?:"+Object.keys(t.WEEKDAY_OFFSET).join("|").replace(/\./g,"\\.")+")",t.MONTH_OFFSET={januari:1,jan:1,"jan.":1,februari:2,feb:2,"feb.":2,maart:3,mrt:3,"mrt.":3,april:4,apr:4,"apr.":4,mei:5,juni:6,jun:6,"jun.":6,juli:7,jul:7,"jul.":7,augustus:8,aug:8,"aug.":8,september:9,sep:9,"sep.":9,sept:9,"sept.":9,oktober:10,okt:10,"okt.":10,november:11,nov:11,"nov.":11,december:12,dec:12,"dec.":12},t.MONTH_PATTERN="(?:"+Object.keys(t.MONTH_OFFSET).join("|").replace(/\./g,"\\.")+")",t.INTEGER_WORDS={een:1,"één":1,twee:2,drie:3,vier:4,vijf:5,zes:6,zeven:7,acht:8,negen:9,tien:10,elf:11,twaalf:12},t.INTEGER_WORDS_PATTERN="(?:"+Object.keys(t.INTEGER_WORDS).join("|")+")",t.ORDINAL_WORDS={eerste:1,tweede:2,derde:3,vierde:4,vijfde:5,zesde:6,zevende:7,achste:8,negende:9,tiende:10,elfde:11,twaalfde:12,dertiende:13,veertiende:14,vijftiende:15,zestiende:16,zeventiende:17,achttiende:18,negentiende:19,twintigste:20,eenentwintigste:21,"tweeëntwintigste":22,"drieëntwintigste":23,vierentwintigste:24,vijfentwintigste:25,zesentwintigste:26,zevenentwintigste:27,achtentwintigste:28,negenentwintigste:29,dertigste:30,eenendertigste:31},t.ORDINAL_WORDS_PATTERN="(?:"+Object.keys(t.ORDINAL_WORDS).join("|").replace(/ /g,"[ -]")+")";var a="("+t.INTEGER_WORDS_PATTERN+"|[0-9]+|[0-9]+.[0-9]+|en(?:\\s*few)?|half)\\s*(sec(?:onde?)?|min(?:uten)?s?|(?:uur|uren)?|weken?|dagen?|maanden?|jaren?)\\s*",r=new RegExp(a,"i");function n(e,a){var r=e[1].toLowerCase();return r=void 0!==t.INTEGER_WORDS[r]?t.INTEGER_WORDS[r]:r.match(/half/)?.5:parseFloat(r),e[2].match(/^(?:uur|uren)/i)?a.hour=r:e[2].match(/min/i)?a.minute=r:e[2].match(/sec/i)?a.second=r:e[2].match(/week/i)?a.week=r:e[2].match(/dag/i)?a.d=r:e[2].match(/maand/i)?a.month=r:e[2].match(/jaar/i)&&(a.year=r),a}t.TIME_UNIT_PATTERN="(?:"+a+")+",t.TIME_UNIT_STRICT_PATTERN="(?:(?:[0-9]+?)\\s*(?:seconden?|(?:minuut|minuten)|(?:uur|uren)|(?:dag|dagen))\\s*)+",t.extractDateTimeUnitFragments=function(e){for(var t={},a=e,s=r.exec(a);s;)n(s,t),a=a.substring(s[0].length),s=r.exec(a);return t}},function(e,t,a){var r=t.options=a(13);t.parser=a(1),t.refiner=a(3),t.Parser=t.parser.Parser,t.Refiner=t.refiner.Refiner,t.Filter=t.refiner.Filter,t.ParsedResult=a(0).ParsedResult,t.ParsedComponents=a(0).ParsedComponents;var n=function(e){e=e||t.options.casualOption(),this.parsers=new Object(e.parsers),this.refiners=new Object(e.refiners)};n.prototype.parse=function(e,t,a){t=t||new Date,(a=a||{}).forwardDate=a.forwardDate||a.forwardDate;var r=[];return this.parsers.forEach((function(n){var s=n.execute(e,t,a);r=r.concat(s)})),r.sort((function(e,t){return e.index-t.index})),this.refiners.forEach((function(t){r=t.refine(e,r,a)})),r},n.prototype.parseDate=function(e,t,a){var r=this.parse(e,t,a);return r.length>0?r[0].start.date():null},t.Chrono=n,t.strict=new n(r.strictOption()),t.casual=new n(r.casualOption()),t.en=new n(r.mergeOptions([r.en.casual,r.commonPostProcessing])),t.en_GB=new n(r.mergeOptions([r.en_GB.casual,r.commonPostProcessing])),t.de=new n(r.mergeOptions([r.de.casual,r.en,r.commonPostProcessing])),t.nl=new n(r.mergeOptions([r.nl.casual,r.en,r.commonPostProcessing])),t.pt=new n(r.mergeOptions([r.pt.casual,r.en,r.commonPostProcessing])),t.es=new n(r.mergeOptions([r.es.casual,r.en,r.commonPostProcessing])),t.fr=new n(r.mergeOptions([r.fr.casual,r.en,r.commonPostProcessing])),t.ja=new n(r.mergeOptions([r.ja.casual,r.en,r.commonPostProcessing])),t.parse=function(){return t.casual.parse.apply(t.casual,arguments)},t.parseDate=function(){return t.casual.parseDate.apply(t.casual,arguments)}},function(e,t,a){var r=a(1),n=a(3);t.mergeOptions=function(e){var t={},a={parsers:[],refiners:[]};return e.forEach((function(e){e.call&&(e=e.call()),e.parsers&&e.parsers.forEach((function(e){t[e.constructor]||(a.parsers.push(e),t[e.constructor]=!0)})),e.refiners&&e.refiners.forEach((function(e){t[e.constructor]||(a.refiners.push(e),t[e.constructor]=!0)}))})),a},t.commonPostProcessing=function(){return{refiners:[new n.ExtractTimezoneOffsetRefiner,new n.ExtractTimezoneAbbrRefiner,new n.UnlikelyFormatFilter]}},t.strictOption=function(){var e={strict:!0};return t.mergeOptions([t.en(e),t.de(e),t.nl(e),t.pt(e),t.es(e),t.fr(e),t.ja(e),t.zh,t.commonPostProcessing])},t.casualOption=function(){return t.mergeOptions([t.en.casual,t.de({strict:!0}),t.nl,t.pt,t.es,t.fr,t.ja,t.zh,t.commonPostProcessing])},t.de=function(e){return{parsers:[new r.DEDeadlineFormatParser(e),new r.DEMonthNameLittleEndianParser(e),new r.DEMonthNameParser(e),new r.DESlashDateFormatParser(e),new r.DETimeAgoFormatParser(e),new r.DETimeExpressionParser(e)],refiners:[new n.OverlapRemovalRefiner,new n.ForwardDateRefiner,new n.DEMergeDateTimeRefiner,new n.DEMergeDateRangeRefiner]}},t.de.casual=function(){var e=t.de({strict:!1});return e.parsers.unshift(new r.DECasualDateParser),e.parsers.unshift(new r.DEWeekdayParser),e},t.nl=function(e){return{parsers:[new r.NLMonthNameLittleEndianParser(e),new r.NLMonthNameParser(e),new r.NLSlashDateFormatParser(e),new r.NLTimeExpressionParser(e)],refiners:[new n.OverlapRemovalRefiner,new n.ForwardDateRefiner,new n.NLMergeDateTimeRefiner,new n.NLMergeDateRangeRefiner]}},t.nl.casual=function(){var e=t.nl({strict:!1});return e.parsers.unshift(new r.NLCasualDateParser),e.parsers.unshift(new r.NLCasualTimeParser),e.parsers.unshift(new r.NLWeekdayParser),e},t.en=function(e){return{parsers:[new r.ENISOFormatParser(e),new r.ENDeadlineFormatParser(e),new r.ENMonthNameLittleEndianParser(e),new r.ENMonthNameMiddleEndianParser(e),new r.ENMonthNameParser(e),new r.ENSlashDateFormatParser(e),new r.ENSlashDateFormatStartWithYearParser(e),new r.ENSlashMonthFormatParser(e),new r.ENTimeAgoFormatParser(e),new r.ENTimeLaterFormatParser(e),new r.ENTimeExpressionParser(e)],refiners:[new n.OverlapRemovalRefiner,new n.ForwardDateRefiner,new n.ENMergeDateTimeRefiner,new n.ENMergeDateRangeRefiner,new n.ENPrioritizeSpecificDateRefiner]}},t.en.casual=function(e){(e=e||{}).strict=!1;var a=t.en(e);return a.parsers.unshift(new r.ENCasualDateParser),a.parsers.unshift(new r.ENCasualTimeParser),a.parsers.unshift(new r.ENWeekdayParser),a.parsers.unshift(new r.ENRelativeDateFormatParser),a},t.en_GB=function(e){return(e=e||{}).littleEndian=!0,t.en(e)},t.en_GB.casual=function(e){return(e=e||{}).littleEndian=!0,t.en.casual(e)},t.ja=function(){return{parsers:[new r.JPStandardParser],refiners:[new n.OverlapRemovalRefiner,new n.ForwardDateRefiner,new n.JPMergeDateRangeRefiner]}},t.ja.casual=function(){var e=t.ja();return e.parsers.unshift(new r.JPCasualDateParser),e},t.pt=function(e){return{parsers:[new r.PTTimeAgoFormatParser(e),new r.PTDeadlineFormatParser(e),new r.PTTimeExpressionParser(e),new r.PTMonthNameLittleEndianParser(e),new r.PTSlashDateFormatParser(e)],refiners:[new n.OverlapRemovalRefiner,new n.ForwardDateRefiner]}},t.pt.casual=function(){var e=t.pt({strict:!1});return e.parsers.unshift(new r.PTCasualDateParser),e.parsers.unshift(new r.PTWeekdayParser),e},t.es=function(e){return{parsers:[new r.ESTimeAgoFormatParser(e),new r.ESDeadlineFormatParser(e),new r.ESTimeExpressionParser(e),new r.ESMonthNameLittleEndianParser(e),new r.ESSlashDateFormatParser(e)],refiners:[new n.OverlapRemovalRefiner,new n.ForwardDateRefiner]}},t.es.casual=function(){var e=t.es({strict:!1});return e.parsers.unshift(new r.ESCasualDateParser),e.parsers.unshift(new r.ESWeekdayParser),e},t.fr=function(e){return{parsers:[new r.FRDeadlineFormatParser(e),new r.FRMonthNameLittleEndianParser(e),new r.FRSlashDateFormatParser(e),new r.FRTimeAgoFormatParser(e),new r.FRTimeExpressionParser(e)],refiners:[new n.OverlapRemovalRefiner,new n.ForwardDateRefiner,new n.FRMergeDateRangeRefiner,new n.FRMergeDateTimeRefiner]}},t.fr.casual=function(){var e=t.fr({strict:!1});return e.parsers.unshift(new r.FRCasualDateParser),e.parsers.unshift(new r.FRWeekdayParser),e.parsers.unshift(new r.FRRelativeDateFormatParser),e},t.zh=function(){return{parsers:[new r.ZHHantDateParser,new r.ZHHantWeekdayParser,new r.ZHHantTimeExpressionParser,new r.ZHHantCasualDateParser,new r.ZHHantDeadlineFormatParser],refiners:[new n.OverlapRemovalRefiner,new n.ForwardDateRefiner]}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=new RegExp("(\\W|^)([0-9]{4})\\-([0-9]{1,2})\\-([0-9]{1,2})(?:T([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2})(?:\\.(\\d{1,4}))?)?(?:Z|([+-]\\d{2}):?(\\d{2})?)?)?(?=\\W|$)","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,n){e=a[0].substr(a[1].length);var i=a.index+a[1].length,o=new s({text:e,index:i,ref:t});if(o.start.assign("year",parseInt(a[2])),o.start.assign("month",parseInt(a[3])),o.start.assign("day",parseInt(a[4])),r(o.start.get("month"))>12||r(o.start.get("month"))<1||r(o.start.get("day"))>31||r(o.start.get("day"))<1)return null;if(null!=a[5])if(o.start.assign("hour",parseInt(a[5])),o.start.assign("minute",parseInt(a[6])),null!=a[7]&&o.start.assign("second",parseInt(a[7])),null!=a[8]&&o.start.assign("millisecond",parseInt(a[8])),null==a[9])o.start.assign("timezoneOffset",0);else{var d=0,u=parseInt(a[9]);null!=a[10]&&(d=parseInt(a[10]));var m=60*u;m<0?m-=d:m+=d,o.start.assign("timezoneOffset",m)}return o.tags.ENISOFormatParser=!0,o}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(4),o=new RegExp("(\\W|^)(within|in)\\s*("+i.INTEGER_WORDS_PATTERN+"|[0-9]+|an?(?:\\s*few)?|half(?:\\s*an?)?)\\s*(seconds?|min(?:ute)?s?|hours?|days?|weeks?|months?|years?)\\s*(?=\\W|$)","i"),d=new RegExp("(\\W|^)(within|in)\\s*("+i.INTEGER_WORDS_PATTERN+"|[0-9]+|an?)\\s*(seconds?|minutes?|hours?|days?)\\s*(?=\\W|$)","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return this.isStrictMode()?d:o},this.extract=function(e,t,a,n){var o=a.index+a[1].length;a[0];e=a[0].substr(a[1].length,a[0].length-a[1].length);var d=new s({index:o,text:e,ref:t}),u=a[3].toLowerCase();u=void 0!==i.INTEGER_WORDS[u]?i.INTEGER_WORDS[u]:"a"===u||"an"===u?1:u.match(/few/i)?3:u.match(/half/i)?.5:parseInt(u);var m=r(t);return a[4].match(/day|week|month|year/i)?(a[4].match(/day/i)?m=m.add(u,"d"):a[4].match(/week/i)?m=m.add(7*u,"d"):a[4].match(/month/i)?m=m.add(u,"month"):a[4].match(/year/i)&&(m=m.add(u,"year")),d.start.assign("year",m.year()),d.start.assign("month",m.month()+1),d.start.assign("day",m.date()),d):(a[4].match(/hour/i)?m=m.add(u,"hour"):a[4].match(/min/i)?m=m.add(u,"minute"):a[4].match(/second/i)&&(m=m.add(u,"second")),d.start.assign("year",m.year()),d.start.assign("month",m.month()+1),d.start.assign("day",m.date()),d.start.assign("hour",m.hour()),d.start.assign("minute",m.minute()),d.start.assign("second",m.second()),d.tags.ENDeadlineFormatParser=!0,d)}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(4),o=new RegExp("(\\W|^)(this|next|last|past)\\s*("+i.INTEGER_WORDS_PATTERN+"|[0-9]+|few|half(?:\\s*an?)?)?\\s*(seconds?|min(?:ute)?s?|hours?|days?|weeks?|months?|years?)(?=\\s*)(?=\\W|$)","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return o},this.extract=function(e,t,a,n){var o=a.index+a[1].length,d=a[2].toLowerCase().match(/^next/)?1:-1;a[0];e=a[0].substr(a[1].length,a[0].length-a[1].length);var u=new s({index:o,text:e,ref:t});u.tags.ENRelativeDateFormatParser=!0;var m=void 0===a[3]?"":a[3].toLowerCase();m=void 0!==i.INTEGER_WORDS[m]?i.INTEGER_WORDS[m]:""===m?1:m.match(/few/i)?3:m.match(/half/i)?.5:parseInt(m),m*=d;var l=r(t);if(a[2].toLowerCase().match(/^this/)){if(a[3])return null;if(a[4].match(/day|week|month|year/i))return a[4].match(/week/i)?(l=l.add(-l.get("d"),"d"),u.start.imply("day",l.date()),u.start.imply("month",l.month()+1),u.start.imply("year",l.year())):a[4].match(/month/i)?(l=l.add(1-l.date(),"d"),u.start.imply("day",l.date()),u.start.assign("year",l.year()),u.start.assign("month",l.month()+1)):a[4].match(/year/i)&&(l=(l=l.add(1-l.date(),"d")).add(-l.month(),"month"),u.start.imply("day",l.date()),u.start.imply("month",l.month()+1),u.start.assign("year",l.year())),u}return a[4].match(/day|week|month|year/i)?(a[4].match(/day/i)?(l=l.add(m,"d"),u.start.assign("year",l.year()),u.start.assign("month",l.month()+1),u.start.assign("day",l.date())):a[4].match(/week/i)?(l=l.add(7*m,"d"),u.start.imply("day",l.date()),u.start.imply("month",l.month()+1),u.start.imply("year",l.year())):a[4].match(/month/i)?(l=l.add(m,"month"),u.start.imply("day",l.date()),u.start.assign("year",l.year()),u.start.assign("month",l.month()+1)):a[4].match(/year/i)&&(l=l.add(m,"year"),u.start.imply("day",l.date()),u.start.imply("month",l.month()+1),u.start.assign("year",l.year())),u):(a[4].match(/hour/i)?(l=l.add(m,"hour"),u.start.imply("minute",l.minute()),u.start.imply("second",l.second())):a[4].match(/min/i)?(l=l.add(m,"minute"),u.start.assign("minute",l.minute()),u.start.imply("second",l.second())):a[4].match(/second/i)&&(l=l.add(m,"second"),u.start.assign("second",l.second()),u.start.assign("minute",l.minute())),u.start.assign("hour",l.hour()),u.start.assign("year",l.year()),u.start.assign("month",l.month()+1),u.start.assign("day",l.date()),u)}}},function(e,t,a){var r=a(1),n=a(0).ParsedResult,s=a(4),i=new RegExp("(\\W|^)(?:on\\s*?)?(?:(Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sun|Mon|Tue|Wed|Thu|Fri|Sat)\\s*,?\\s*)?(([0-9]{1,2})(?:st|nd|rd|th)?|"+s.ORDINAL_WORDS_PATTERN+")(?:\\s*(?:to|\\-|\\–|until|through|till|\\s)\\s*(([0-9]{1,2})(?:st|nd|rd|th)?|"+s.ORDINAL_WORDS_PATTERN+"))?(?:-|/|\\s*(?:of)?\\s*)("+s.MONTH_PATTERN+")(?:(?:-|/|,?\\s*)((?:[1-9][0-9]{0,3}\\s*(?:BE|AD|BC)|[1-2][0-9]{3}|[5-9][0-9])(?![^\\s]\\d)))?(?=\\W|$)","i");t.Parser=function(){r.Parser.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,i){var o=new n({text:a[0].substr(a[1].length,a[0].length-a[1].length),index:a.index+a[1].length,ref:t}),d=a[7];d=s.MONTH_OFFSET[d.toLowerCase()];var u=a[4]?parseInt(a[4]):s.ORDINAL_WORDS[a[3].trim().replace("-"," ").toLowerCase()],m=null;if(a[8]&&(m=a[8],/BE/i.test(m)?(m=m.replace(/BE/i,""),m=parseInt(m)-543):/BC/i.test(m)?(m=m.replace(/BC/i,""),m=-parseInt(m)):/AD/i.test(m)?(m=m.replace(/AD/i,""),m=parseInt(m)):(m=parseInt(m))<100&&(m+=m>50?1900:2e3)),m?(o.start.assign("day",u),o.start.assign("month",d),o.start.assign("year",m)):(m=r.findYearClosestToRef(t,u,d),o.start.assign("day",u),o.start.assign("month",d),o.start.imply("year",m)),a[2]){var l=a[2];l=s.WEEKDAY_OFFSET[l.toLowerCase()],o.start.assign("weekday",l)}if(a[5]){var h=a[6]?parseInt(a[6]):s.ORDINAL_WORDS[a[5].trim().replace("-"," ").toLowerCase()];o.end=o.start.clone(),o.end.assign("day",h)}return o.tags.ENMonthNameLittleEndianParser=!0,o}}},function(e,t,a){var r=a(1),n=a(0).ParsedResult,s=a(4),i=new RegExp("(\\W|^)(?:(?:on\\s*?)?(Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sun\\.?|Mon\\.?|Tue\\.?|Wed\\.?|Thu\\.?|Fri\\.?|Sat\\.?)\\s*,?\\s*)?("+s.MONTH_PATTERN+")(?:-|/|\\s*,?\\s*)(([0-9]{1,2})(?:st|nd|rd|th)?|"+s.ORDINAL_WORDS_PATTERN+")(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(([0-9]{1,2})(?:st|nd|rd|th)?| "+s.ORDINAL_WORDS_PATTERN+")\\s*)?(?:(?:-|/|\\s*,?\\s*)(?:([0-9]{4})\\s*(BE|AD|BC)?|([0-9]{1,4})\\s*(AD|BC))\\s*)?(?=\\W|$)(?!\\:\\d)","i");t.Parser=function(){r.Parser.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,i){var o=new n({text:a[0].substr(a[1].length,a[0].length-a[1].length),index:a.index+a[1].length,ref:t}),d=a[3];d=s.MONTH_OFFSET[d.toLowerCase()];var u=a[5]?parseInt(a[5]):s.ORDINAL_WORDS[a[4].trim().replace("-"," ").toLowerCase()],m=null;if(a[8]||a[10]){m=a[8]||a[10],m=parseInt(m);var l=a[9]||a[11];l?/BE/i.test(l)?m-=543:/BC/i.test(l)&&(m=-m):m<100&&(m+=2e3)}if(m?(o.start.assign("day",u),o.start.assign("month",d),o.start.assign("year",m)):(m=r.findYearClosestToRef(t,u,d),o.start.assign("day",u),o.start.assign("month",d),o.start.imply("year",m)),a[2]){var h=a[2];h=s.WEEKDAY_OFFSET[h.toLowerCase()],o.start.assign("weekday",h)}if(a[6]){var c=a[7]?c=parseInt(a[7]):s.ORDINAL_WORDS[a[6].replace("-"," ").trim().toLowerCase()];o.end=o.start.clone(),o.end.assign("day",c)}return o.tags.ENMonthNameMiddleEndianParser=!0,o}}},function(e,t,a){var r=a(1),n=a(0).ParsedResult,s=a(4),i=new RegExp("(^|\\D\\s+|[^\\w\\s])("+s.MONTH_PATTERN+")\\s*(?:[,-]?\\s*([0-9]{4})(\\s*BE|AD|BC)?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)","i");t.Parser=function(){r.Parser.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,i){var o=new n({text:a[0].substr(a[1].length,a[0].length-a[1].length),index:a.index+a[1].length,ref:t}),d=a[2],u=s.MONTH_OFFSET[d.toLowerCase()],m=null;return a[3]&&(m=a[3],m=parseInt(m),a[4]?a[4].match(/BE/)?m-=543:a[4].match(/BC/)&&(m=-m):m<100&&(m+=2e3)),m?(o.start.imply("day",1),o.start.assign("month",u),o.start.assign("year",m)):(m=r.findYearClosestToRef(t,1,u),o.start.imply("day",1),o.start.assign("month",u),o.start.imply("year",m)),!o.text.match(/^\w{3}$/)&&(o.tags.ENMonthNameParser=!0,o)}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=new RegExp("(\\W|^)(?:(?:on\\s*?)?((?:sun|mon|tues?|wed(?:nes)?|thu(?:rs?)?|fri|sat(?:ur)?)(?:day)?)\\s*\\,?\\s*)?([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}s*,?s*|[0-9]{2}s*,?s*))?(\\W|$)","i"),o={sunday:0,sun:0,monday:1,mon:1,tuesday:2,wednesday:3,wed:3,thursday:4,thur:4,friday:5,fri:5,saturday:6,sat:6};t.Parser=function(e){n.apply(this,arguments);var t=(e=e||{}).littleEndian,a=t?4:3,d=t?3:4;this.pattern=function(){return i},this.extract=function(e,t,n,i){if("/"!=n[1]&&"/"!=n[6]){var u=n.index+n[1].length,m=(e=n[0].substr(n[1].length,n[0].length-n[6].length),new s({text:e,index:u,ref:t}));if(!e.match(/^\d\.\d$/)&&!e.match(/^\d\.\d{1,2}\.\d{1,2}$/)&&(n[5]||!(n[0].indexOf("/")<0))){var l=n[5]||r(t).year()+"",h=n[a],c=n[d];if(h=parseInt(h),c=parseInt(c),l=parseInt(l),(h<1||h>12)&&h>12){if(!(c>=1&&c<=12&&h>=13&&h<=31))return null;var g=h;h=c,c=g}return c<1||c>31?null:(l<100&&(l+=l>50?1900:2e3),m.start.assign("day",c),m.start.assign("month",h),n[5]?m.start.assign("year",l):m.start.imply("year",l),n[2]&&m.start.assign("weekday",o[n[2].toLowerCase()]),m.tags.ENSlashDateFormatParser=!0,m)}}else n.index+=n[0].length}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(4),o=new RegExp("(\\W|^)([0-9]{4})[\\-\\.\\/]((?:"+i.MONTH_PATTERN+"|[0-9]{1,2}))[\\-\\.\\/]([0-9]{1,2})(?=\\W|$)","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return o},this.extract=function(e,t,a,n){e=a[0].substr(a[1].length);var o=a.index+a[1].length,d=new s({text:e,index:o,ref:t}),u=a[3].toLowerCase();return u=i.MONTH_OFFSET[u]|u,d.start.assign("year",parseInt(a[2])),d.start.assign("month",parseInt(u)),d.start.assign("day",parseInt(a[4])),r(d.start.get("month"))>12||r(d.start.get("month"))<1||r(d.start.get("day"))>31||r(d.start.get("day"))<1?null:(d.tags.ENDateFormatParser=!0,d)}}},function(e,t,a){var r=a(1).Parser,n=a(0).ParsedResult,s=new RegExp("(^|[^\\d/]\\s+|[^\\w\\s])([0-9]|0[1-9]|1[012])/([0-9]{4})(?=[^\\d/]|$)","i");t.Parser=function(e){r.apply(this,arguments),this.pattern=function(){return s},this.extract=function(e,t,a,r){var s=a.index+a[1].length,i=(e=a[0].substr(a[1].length,a[0].length).trim(),new n({text:e,index:s,ref:t})),o=a[3],d=a[2];return d=parseInt(d),o=parseInt(o),i.start.imply("day",1),i.start.assign("month",d),i.start.assign("year",o),i.tags.ENSlashMonthFormatParser=!0,i}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(4),o=new RegExp("(\\W|^)(?:within\\s*)?("+i.TIME_UNIT_PATTERN+")(?:ago|before|earlier)(?=(?:\\W|$))","i"),d=new RegExp("(\\W|^)(?:within\\s*)?("+i.TIME_UNIT_STRICT_PATTERN+")ago(?=(?:\\W|$))","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return this.isStrictMode()?d:o},this.extract=function(e,t,a,n){if(a.index>0&&e[a.index-1].match(/\w/))return null;e=a[0];e=a[0].substr(a[1].length,a[0].length-a[1].length);var o=a.index+a[1].length,d=new s({index:o,text:e,ref:t}),u=i.extractDateTimeUnitFragments(a[2]),m=r(t);for(var l in u)m=m.add(-u[l],l);return(u.hour>0||u.minute>0||u.second>0)&&(d.start.assign("hour",m.hour()),d.start.assign("minute",m.minute()),d.start.assign("second",m.second()),d.tags.ENTimeAgoFormatParser=!0),u.d>0||u.month>0||u.year>0?(d.start.assign("day",m.date()),d.start.assign("month",m.month()+1),d.start.assign("year",m.year())):(u.week>0&&d.start.imply("weekday",m.day()),d.start.imply("day",m.date()),d.start.imply("month",m.month()+1),d.start.imply("year",m.year())),d}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(0).ParsedComponents,o=new RegExp("(^|\\s|T)(?:(?:at|from)\\s*)??(\\d{1,4}|noon|midnight)(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:(?:\\:|\\:)(\\d{2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?|O\\W*CLOCK))?(?=\\W|$)","i"),d=new RegExp("^\\s*(\\-|\\–|\\~|\\〜|to|\\?)\\s*(\\d{1,4})(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?|O\\W*CLOCK))?(?=\\W|$)","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return o},this.extract=function(e,t,a,n){if(a.index>0&&e[a.index-1].match(/\w/))return null;var o=r(t),u=new s;u.ref=t,u.index=a.index+a[1].length,u.text=a[0].substring(a[1].length),u.tags.ENTimeExpressionParser=!0,u.start.imply("day",o.date()),u.start.imply("month",o.month()+1),u.start.imply("year",o.year());var m=0,l=0,h=-1;if(null!=a[5]){if((c=parseInt(a[5].substring(0,3)))>=1e3)return null;u.start.assign("millisecond",c)}if(null!=a[4]){if((g=parseInt(a[4]))>=60)return null;u.start.assign("second",g)}if("noon"==a[2].toLowerCase()?(h=1,m=12):"midnight"==a[2].toLowerCase()?(h=0,m=0):m=parseInt(a[2]),null!=a[3]?l=parseInt(a[3]):m>100&&(l=m%100,m=parseInt(m/100)),l>=60)return null;if(m>24)return null;if(m>=12&&(h=1),null!=a[6]){if(m>12)return null;"a"==(f=a[6][0].toLowerCase())&&(h=0,12==m&&(m=0)),"p"==f&&(h=1,12!=m&&(m+=12))}if(u.start.assign("hour",m),u.start.assign("minute",l),h>=0?u.start.assign("meridiem",h):m<12?u.start.imply("meridiem",0):u.start.imply("meridiem",1),!(a=d.exec(e.substring(u.index+u.text.length))))return u;if(a[0].match(/^\s*(\+|\-)\s*\d{3,4}$/))return u;null==u.end&&(u.end=new i(null,u.start.date()));m=0,l=0,h=-1;if(null!=a[5]){var c;if((c=parseInt(a[5].substring(0,3)))>=1e3)return null;u.end.assign("millisecond",c)}if(null!=a[4]){var g;if((g=parseInt(a[4]))>=60)return null;u.end.assign("second",g)}if(m=parseInt(a[2]),null!=a[3]){if((l=parseInt(a[3]))>=60)return u}else m>100&&(l=m%100,m=parseInt(m/100));if(l>=60)return null;if(m>24)return null;if(m>=12&&(h=1),null!=a[6]){if(m>12)return null;var f;"a"==(f=a[6][0].toLowerCase())&&(h=0,12==m&&(m=0,u.end.isCertain("day")||u.end.imply("day",u.end.get("day")+1))),"p"==f&&(h=1,12!=m&&(m+=12)),u.start.isCertain("meridiem")||(0==h?(u.start.imply("meridiem",0),12==u.start.get("hour")&&u.start.assign("hour",0)):(u.start.imply("meridiem",1),12!=u.start.get("hour")&&u.start.assign("hour",u.start.get("hour")+12)))}(u.text=u.text+a[0],u.end.assign("hour",m),u.end.assign("minute",l),h>=0)?u.end.assign("meridiem",h):u.start.isCertain("meridiem")&&1==u.start.get("meridiem")&&u.start.get("hour")>m?u.end.imply("meridiem",0):m>12&&u.end.imply("meridiem",1);return u.end.date().getTime()0&&e[a.index-1].match(/\w/))return null;var o=a[2],d=a[4];if(!o&&!d)return null;var u=a[1],m=(e=a[0].substr(u.length,a[0].length-u.length),a.index+u.length),l=new s({index:m,text:e,ref:t}),h=i.extractDateTimeUnitFragments(a[3]),c=r(t);for(var g in h)c=c.add(h[g],g);return(h.hour>0||h.minute>0||h.second>0)&&(l.start.assign("hour",c.hour()),l.start.assign("minute",c.minute()),l.start.assign("second",c.second()),l.tags.ENTimeAgoFormatParser=!0),h.d>0||h.month>0||h.year>0?(l.start.assign("day",c.date()),l.start.assign("month",c.month()+1),l.start.assign("year",c.year())):(h.week>0&&l.start.imply("weekday",c.day()),l.start.imply("day",c.date()),l.start.imply("month",c.month()+1),l.start.imply("year",c.year())),l}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=/(\W|^)(now|today|tonight|last\s*night|(?:tomorrow|tmr|yesterday)\s*|tomorrow|tmr|yesterday)(?=\W|$)/i;t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,n){e=a[0].substr(a[1].length);var i=a.index+a[1].length,o=new s({index:i,text:e,ref:t}),d=r(t),u=d,m=e.toLowerCase();return"tonight"==m?(o.start.imply("hour",22),o.start.imply("meridiem",1)):/^tomorrow|^tmr/.test(m)?d.hour()>1&&(u=u.add(1,"day")):/^yesterday/.test(m)?u=u.add(-1,"day"):m.match(/last\s*night/)?(o.start.imply("hour",0),d.hour()>6&&(u=u.add(-1,"day"))):m.match("now")&&(o.start.assign("hour",d.hour()),o.start.assign("minute",d.minute()),o.start.assign("second",d.second()),o.start.assign("millisecond",d.millisecond())),o.start.assign("day",u.date()),o.start.assign("month",u.month()+1),o.start.assign("year",u.year()),o.tags.ENCasualDateParser=!0,o}}},function(e,t,a){var r=a(1).Parser,n=a(0).ParsedResult,s=/(\W|^)((this)?\s*(morning|afternoon|evening|noon|night))/i,i=4;t.Parser=function(){r.apply(this,arguments),this.pattern=function(){return s},this.extract=function(e,t,a,r){e=a[0].substr(a[1].length);var s=a.index+a[1].length,o=new n({index:s,text:e,ref:t});switch(a[i]||(i=3),a[i].toLowerCase()){case"afternoon":o.start.imply("meridiem",1),o.start.imply("hour",15);break;case"evening":case"night":o.start.imply("meridiem",1),o.start.imply("hour",20);break;case"morning":o.start.imply("meridiem",0),o.start.imply("hour",6);break;case"noon":o.start.imply("meridiem",0),o.start.imply("hour",12)}return o.tags.ENCasualTimeParser=!0,o}}},function(e,t,a){var r=a(2),n=a(1),s=a(0).ParsedResult,i=a(29),o=/(?:(同|今|本|((昭和|平成|令和)?([0-90-9]{1,4}|元)))年\s*)?([0-90-9]{1,2})月\s*([0-90-9]{1,2})日/i;t.Parser=function(){n.Parser.apply(this,arguments),this.pattern=function(){return o},this.extract=function(e,t,a,o){var d=new s({text:a[0],index:a.index,ref:t}),u=a[5];u=i.toHankaku(u),u=parseInt(u);var m=a[6];if(m=i.toHankaku(m),m=parseInt(m),d.start.assign("day",m),d.start.assign("month",u),a[2]){var l=a[4];"元"==l?l=1:(l=i.toHankaku(l),l=parseInt(l)),"令和"==a[3]?l+=2018:"平成"==a[3]?l+=1988:"昭和"==a[3]&&(l+=1925),d.start.assign("year",l)}else if(a[1]&&a[1].match("同|今|本")){var h=r(t);d.start.assign("year",h.year())}else{var c=n.findYearClosestToRef(t,m,u);d.start.imply("year",c)}return d.tags.JPStandardParser=!0,d}}},function(e,t){t.toHankaku=function(e,t){function a(e){return t(e.charCodeAt(0)-65248)}return function(t){return e(t).replace(/\u2019/g,"'").replace(/\u201D/g,'"').replace(/\u3000/g," ").replace(/\uFFE5/g,"¥").replace(/[\uFF01\uFF03-\uFF06\uFF08\uFF09\uFF0C-\uFF19\uFF1C-\uFF1F\uFF21-\uFF3B\uFF3D\uFF3F\uFF41-\uFF5B\uFF5D\uFF5E]/g,a)}}(String,String.fromCharCode),t.toZenkaku=function(e,t){function a(e){return t(e.charCodeAt(0)+65248)}return function(t){return e(t).replace(/\u0020/g," ").replace(/\u0022/g,"”").replace(/\u0027/g,"’").replace(/\u00A5/g,"¥").replace(/[!#-&(),-9\u003C-?A-[\u005D_a-{}~]/g,a)}}(String,String.fromCharCode)},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=/今日|当日|昨日|明日|今夜|今夕|今晩|今朝/i;t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,n){var i=a.index,o=(e=a[0],new s({index:i,text:e,ref:t})),d=r(t),u=d;return"今夜"==e||"今夕"==e||"今晩"==e?(o.start.imply("hour",22),o.start.imply("meridiem",1)):"明日"==e?d.hour()>4&&(u=u.add(1,"day")):"昨日"==e?u=u.add(-1,"day"):e.match("今朝")&&(o.start.imply("hour",6),o.start.imply("meridiem",0)),o.start.assign("day",u.date()),o.start.assign("month",u.month()+1),o.start.assign("year",u.year()),o.tags.JPCasualDateParser=!0,o}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=/(\W|^)(agora|esta\s*(manhã|tarde|noite)|(ontem|amanhã)\s*(de|à)\s*(manhã|tarde|noite)|hoje|amanhã|ontem|noite)(?=\W|$)/i;t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,n){e=a[0].substr(a[1].length);var i=a.index+a[1].length,o=new s({index:i,text:e,ref:t}),d=r(t),u=d,m=e.toLowerCase().replace(/\s+/g," ");if("amanhã"==m)d.hour()>1&&(u=u.add(1,"day"));else if("ontem"==m)u=u.add(-1,"day");else if("noite"==m)o.start.imply("hour",0),d.hour()>6&&(u=u.add(-1,"day"));else if(m.match("esta")){"tarde"==(l=a[3].toLowerCase())?o.start.imply("hour",18):"manhã"==l?o.start.imply("hour",6):"noite"==l&&(o.start.imply("hour",22),o.start.imply("meridiem",1))}else if(m.match(/de|à/)){var l,h=a[4].toLowerCase();"ontem"===h?u=u.add(-1,"day"):"amanhã"===h&&(u=u.add(1,"day")),"tarde"==(l=a[6].toLowerCase())?o.start.imply("hour",18):"manhã"==l?o.start.imply("hour",9):"noite"==l&&(o.start.imply("hour",22),o.start.imply("meridiem",1))}else m.match("agora")&&(o.start.imply("hour",d.hour()),o.start.imply("minute",d.minute()),o.start.imply("second",d.second()),o.start.imply("millisecond",d.millisecond()));return o.start.assign("day",u.date()),o.start.assign("month",u.month()+1),o.start.assign("year",u.year()),o.tags.PTCasualDateParser=!0,o}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=/(\W|^)(dentro\s*de|em|em*até)\s*([0-9]+|mei[oa]|uma?)\s*(minutos?|horas?|dias?)\s*(?=(?:\W|$))/i;t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,n){var i=a.index+a[1].length;a[0];e=a[0].substr(a[1].length,a[0].length-a[1].length);var o=new s({index:i,text:e,ref:t}),d=parseInt(a[3]);isNaN(d)&&(d=a[3].match(/(meio|meia)/)?.5:1);var u=r(t);return a[4].match(/dia/)?(u=u.add(d,"d"),o.start.assign("year",u.year()),o.start.assign("month",u.month()+1),o.start.assign("day",u.date()),o):(a[4].match(/hora/)?u=u.add(d,"hour"):a[4].match(/minuto/)&&(u=u.add(d,"minute")),o.start.imply("year",u.year()),o.start.imply("month",u.month()+1),o.start.imply("day",u.date()),o.start.assign("hour",u.hour()),o.start.assign("minute",u.minute()),o.tags.PTDeadlineFormatParser=!0,o)}}},function(e,t,a){var r=a(1),n=a(0).ParsedResult,s=a(34),i=(s.WEEKDAY_OFFSET,new RegExp("(\\W|^)(?:(domingo|segunda|segunda-feira|terça|terça-feira|quarta|quarta-feira|quinta|quinta-feira|sexta|sexta-feira|sábado|sabado|dom|seg|ter|qua|qui|sex|sab)\\s*,?\\s*)?([0-9]{1,2})(?:º|ª|°)?(?:\\s*(?:desde|de|\\-|\\–|ao?|\\s)\\s*([0-9]{1,2})(?:º|ª|°)?)?\\s*(?:de)?\\s*(Jan(?:eiro|\\.)?|Fev(?:ereiro|\\.)?|Mar(?:ço|\\.)?|Abr(?:il|\\.)?|Mai(?:o|\\.)?|Jun(?:ho|\\.)?|Jul(?:ho|\\.)?|Ago(?:sto|\\.)?|Set(?:embro|\\.)?|Out(?:ubro|\\.)?|Nov(?:embro|\\.)?|Dez(?:embro|\\.)?)(?:\\s*(?:de?)?(\\s*[0-9]{1,4}(?![^\\s]\\d))(\\s*[ad]\\.?\\s*c\\.?|a\\.?\\s*d\\.?)?)?(?=\\W|$)","i"));t.Parser=function(){r.Parser.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,i){var o=new n({text:a[0].substr(a[1].length,a[0].length-a[1].length),index:a.index+a[1].length,ref:t}),d=a[5];d=s.MONTH_OFFSET[d.toLowerCase()];var u=a[3];u=parseInt(u);var m=null;if(a[6]&&(m=a[6],m=parseInt(m),a[7]?/a\.?\s*c\.?/i.test(a[7])&&(m=-m):m<100&&(m+=2e3)),m?(o.start.assign("day",u),o.start.assign("month",d),o.start.assign("year",m)):(m=r.findYearClosestToRef(t,u,d),o.start.assign("day",u),o.start.assign("month",d),o.start.imply("year",m)),a[2]){var l=a[2];l=s.WEEKDAY_OFFSET[l.toLowerCase()],o.start.assign("weekday",l)}return a[4]&&(o.end=o.start.clone(),o.end.assign("day",parseInt(a[4]))),o.tags.PTMonthNameLittleEndianParser=!0,o}}},function(e,t){t.WEEKDAY_OFFSET={domingo:0,dom:0,segunda:1,"segunda-feira":1,seg:1,"terça":2,terca:2,"terça-feira":2,"terca-feira":2,ter:2,quarta:3,"quarta-feira":3,qua:3,quinta:4,"quinta-feira":4,qui:4,sexta:5,"sexta-feira":5,sex:5,"sábado":6,sabado:6,sab:6},t.MONTH_OFFSET={janeiro:1,jan:1,"jan.":1,fevereiro:2,fev:2,"fev.":2,"março":3,mar:3,"mar.":3,abril:4,abr:4,"abr.":4,maio:5,mai:5,"mai.":5,junho:6,jun:6,"jun.":6,julho:7,jul:7,"jul.":7,agosto:8,ago:8,"ago.":8,setembro:9,set:9,"set.":9,outubro:10,out:10,"out.":10,novembro:11,nov:11,"nov.":11,dezembro:12,dez:12,"dez.":12}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=new RegExp("(\\W|^)(?:((?:domingo|dom|segunda|segunda-feira|seg|terça|terça-feira|ter|quarta|quarta-feira|qua|quinta|quinta-feira|qui|sexta|sexta-feira|sex|s[áa]bado|sab))\\s*\\,?\\s*)?([0-1]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}s*,?s*|[0-9]{2}s*,?s*))?(\\W|$)","i"),o={domingo:0,dom:0,segunda:1,"segunda-feira":1,seg:1,"terça":2,"terça-feira":2,ter:2,quarta:3,"quarta-feira":3,qua:3,quinta:4,"quinta-feira":4,qui:4,sexta:5,"sexta-feira":5,sex:5,"sábado":6,sabado:6,sab:6};t.Parser=function(e){n.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,n){if("/"!=a[1]&&"/"!=a[6]){var i=a.index+a[1].length,d=(e=a[0].substr(a[1].length,a[0].length-a[6].length),new s({text:e,index:i,ref:t}));if(!e.match(/^\d\.\d$/)&&!e.match(/^\d\.\d{1,2}\.\d{1,2}$/)&&(a[5]||!(a[0].indexOf("/")<0))){var u=a[5]||r(t).year()+"",m=a[4],l=a[3];if(m=parseInt(m),l=parseInt(l),u=parseInt(u),(m<1||m>12)&&m>12){if(!(l>=1&&l<=12&&m>=13&&m<=31))return null;var h=m;m=l,l=h}return l<1||l>31?null:(u<100&&(u+=u>50?1900:2e3),d.start.assign("day",l),d.start.assign("month",m),d.start.assign("year",u),a[2]&&d.start.assign("weekday",o[a[2].toLowerCase()]),d.tags.PTSlashDateFormatParser=!0,d)}}else a.index+=a[0].length}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=/(\W|^)há\s*([0-9]+|mei[oa]|uma?)\s*(minutos?|horas?|semanas?|dias?|mes(es)?|anos?)(?=(?:\W|$))/i;t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,n){if(a.index>0&&e[a.index-1].match(/\w/))return null;e=a[0];e=a[0].substr(a[1].length,a[0].length-a[1].length);var i=a.index+a[1].length,o=new s({index:i,text:e,ref:t}),d=parseInt(a[2]);isNaN(d)&&(d=a[2].match(/mei/)?.5:1);var u=r(t);return a[3].match(/hora/)||a[3].match(/minuto/)?(a[3].match(/hora/)?u=u.add(-d,"hour"):a[3].match(/minuto/)&&(u=u.add(-d,"minute")),o.start.imply("day",u.date()),o.start.imply("month",u.month()+1),o.start.imply("year",u.year()),o.start.assign("hour",u.hour()),o.start.assign("minute",u.minute()),o.tags.PTTimeAgoFormatParser=!0,o):a[3].match(/semana/)?(u=u.add(-d,"week"),o.start.imply("day",u.date()),o.start.imply("month",u.month()+1),o.start.imply("year",u.year()),o.start.imply("weekday",u.day()),o):(a[3].match(/dia/)&&(u=u.add(-d,"d")),a[3].match(/mes/)&&(u=u.add(-d,"month")),a[3].match(/ano/)&&(u=u.add(-d,"year")),o.start.assign("day",u.date()),o.start.assign("month",u.month()+1),o.start.assign("year",u.year()),o)}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(0).ParsedComponents,o=new RegExp("(^|\\s|T)(?:(?:ao?|às?|das|da|de|do)\\s*)?(\\d{1,4}|meio-dia|meia-noite|meio dia|meia noite)(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:(?:\\:|\\:)(\\d{2}))?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),d=new RegExp("^\\s*(\\-|\\–|\\~|\\〜|a(?:o)?|\\?)\\s*(\\d{1,4})(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:(?:\\.|\\:|\\:)(\\d{1,2}))?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return o},this.extract=function(e,t,a,n){if(a.index>0&&e[a.index-1].match(/\w/))return null;var o=r(t),u=new s;u.ref=t,u.index=a.index+a[1].length,u.text=a[0].substring(a[1].length),u.tags.PTTimeExpressionParser=!0,u.start.imply("day",o.date()),u.start.imply("month",o.month()+1),u.start.imply("year",o.year());var m=0,l=0,h=-1;if(null!=a[4]){if((g=parseInt(a[4]))>=60)return null;u.start.assign("second",g)}if(a[2].toLowerCase().match(/meio\-di/)?(h=1,m=12):"meia-noite"==a[2].toLowerCase()?(h=0,m=0):m=parseInt(a[2]),null!=a[3]?l=parseInt(a[3]):m>100&&(l=m%100,m=parseInt(m/100)),l>=60)return null;if(m>24)return null;if(m>=12&&(h=1),null!=a[5]){if(m>12)return null;var c=a[5][0].toLowerCase();"a"==c&&(h=0,12==m&&(m=0)),"p"==c&&(h=1,12!=m&&(m+=12))}if(u.start.assign("hour",m),u.start.assign("minute",l),h>=0&&u.start.assign("meridiem",h),!(a=d.exec(e.substring(u.index+u.text.length))))return u.text.match(/^\d+$/)?null:u;if(a[0].match(/^\s*(\+|\-)\s*\d{3,4}$/))return u;null==u.end&&(u.end=new i(null,u.start.date()));m=0,l=0,h=-1;if(null!=a[4]){var g;if((g=parseInt(a[4]))>=60)return null;u.end.assign("second",g)}if(m=parseInt(a[2]),null!=a[3]){if((l=parseInt(a[3]))>=60)return u}else m>100&&(l=m%100,m=parseInt(m/100));if(l>=60)return null;if(m>24)return null;if(m>=12&&(h=1),null!=a[5]){if(m>12)return null;"a"==a[5][0].toLowerCase()&&(h=0,12==m&&(m=0,u.end.isCertain("day")||u.end.imply("day",u.end.get("day")+1))),"p"==a[5][0].toLowerCase()&&(h=1,12!=m&&(m+=12)),u.start.isCertain("meridiem")||(0==h?(u.start.imply("meridiem",0),12==u.start.get("hour")&&u.start.assign("hour",0)):(u.start.imply("meridiem",1),12!=u.start.get("hour")&&u.start.assign("hour",u.start.get("hour")+12)))}else m>=12&&(h=1);return u.text=u.text+a[0],u.end.assign("hour",m),u.end.assign("minute",l),h>=0&&u.end.assign("meridiem",h),u.end.date().getTime()1&&(u=u.add(1,"day"));else if("ayer"==m)u=u.add(-1,"day");else if("anoche"==m)o.start.imply("hour",0),d.hour()>6&&(u=u.add(-1,"day"));else if(m.match("esta")){"tarde"==(l=a[3].toLowerCase())?o.start.imply("hour",18):"mañana"==l?o.start.imply("hour",6):"noche"==l&&(o.start.imply("hour",22),o.start.imply("meridiem",1))}else if(m.match(/por\s*la/)){var l,h=a[4].toLowerCase();"ayer"===h?u=u.add(-1,"day"):"mañana"===h&&(u=u.add(1,"day")),"tarde"==(l=a[5].toLowerCase())?o.start.imply("hour",18):"mañana"==l?o.start.imply("hour",9):"noche"==l&&(o.start.imply("hour",22),o.start.imply("meridiem",1))}else m.match("ahora")&&(o.start.imply("hour",d.hour()),o.start.imply("minute",d.minute()),o.start.imply("second",d.second()),o.start.imply("millisecond",d.millisecond()));return o.start.assign("day",u.date()),o.start.assign("month",u.month()+1),o.start.assign("year",u.year()),o.tags.ESCasualDateParser=!0,o}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=/(\W|^)(dentro\s*de|en)\s*([0-9]+|medi[oa]|una?)\s*(minutos?|horas?|d[ií]as?)\s*(?=(?:\W|$))/i;t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,n){var i=a.index+a[1].length;a[0];e=a[0].substr(a[1].length,a[0].length-a[1].length);var o=new s({index:i,text:e,ref:t}),d=parseInt(a[3]);isNaN(d)&&(d=a[3].match(/medi/)?.5:1);var u=r(t);return a[4].match(/d[ií]a/)?(u=u.add(d,"d"),o.start.assign("year",u.year()),o.start.assign("month",u.month()+1),o.start.assign("day",u.date()),o):(a[4].match(/hora/)?u=u.add(d,"hour"):a[4].match(/minuto/)&&(u=u.add(d,"minute")),o.start.imply("year",u.year()),o.start.imply("month",u.month()+1),o.start.imply("day",u.date()),o.start.assign("hour",u.hour()),o.start.assign("minute",u.minute()),o.tags.ESDeadlineFormatParser=!0,o)}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=/(\W|^)hace\s*([0-9]+|medi[oa]|una?)\s*(minutos?|horas?|semanas?|d[ií]as?|mes(es)?|años?)(?=(?:\W|$))/i;t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,n){if(a.index>0&&e[a.index-1].match(/\w/))return null;e=a[0];e=a[0].substr(a[1].length,a[0].length-a[1].length);var i=a.index+a[1].length,o=new s({index:i,text:e,ref:t}),d=parseInt(a[2]);isNaN(d)&&(d=a[2].match(/medi/)?.5:1);var u=r(t);return a[3].match(/hora/)||a[3].match(/minuto/)?(a[3].match(/hora/)?u=u.add(-d,"hour"):a[3].match(/minuto/)&&(u=u.add(-d,"minute")),o.start.imply("day",u.date()),o.start.imply("month",u.month()+1),o.start.imply("year",u.year()),o.start.assign("hour",u.hour()),o.start.assign("minute",u.minute()),o.tags.ESTimeAgoFormatParser=!0,o):a[3].match(/semana/)?(u=u.add(-d,"week"),o.start.imply("day",u.date()),o.start.imply("month",u.month()+1),o.start.imply("year",u.year()),o.start.imply("weekday",u.day()),o):(a[3].match(/d[ií]a/)&&(u=u.add(-d,"d")),a[3].match(/mes/)&&(u=u.add(-d,"month")),a[3].match(/año/)&&(u=u.add(-d,"year")),o.start.assign("day",u.date()),o.start.assign("month",u.month()+1),o.start.assign("year",u.year()),o)}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(0).ParsedComponents,o=new RegExp("(^|\\s|T)(?:(?:a las?|al?|desde|de)\\s*)?(\\d{1,4}|mediod[ií]a|medianoche)(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:(?:\\:|\\:)(\\d{2}))?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),d=new RegExp("^\\s*(\\-|\\–|\\~|\\〜|a(?:s*las)?|\\?)\\s*(\\d{1,4})(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:(?:\\.|\\:|\\:)(\\d{1,2}))?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return o},this.extract=function(e,t,a,n){if(a.index>0&&e[a.index-1].match(/\w/))return null;var o=r(t),u=new s;u.ref=t,u.index=a.index+a[1].length,u.text=a[0].substring(a[1].length),u.tags.ESTimeExpressionParser=!0,u.start.imply("day",o.date()),u.start.imply("month",o.month()+1),u.start.imply("year",o.year());var m=0,l=0,h=-1;if(null!=a[4]){if((g=parseInt(a[4]))>=60)return null;u.start.assign("second",g)}if(a[2].toLowerCase().match(/mediod/)?(h=1,m=12):"medianoche"==a[2].toLowerCase()?(h=0,m=0):m=parseInt(a[2]),null!=a[3]?l=parseInt(a[3]):m>100&&(l=m%100,m=parseInt(m/100)),l>=60)return null;if(m>24)return null;if(m>=12&&(h=1),null!=a[5]){if(m>12)return null;var c=a[5][0].toLowerCase();"a"==c&&(h=0,12==m&&(m=0)),"p"==c&&(h=1,12!=m&&(m+=12))}if(u.start.assign("hour",m),u.start.assign("minute",l),h>=0&&u.start.assign("meridiem",h),!(a=d.exec(e.substring(u.index+u.text.length))))return u.text.match(/^\d+$/)?null:u;if(a[0].match(/^\s*(\+|\-)\s*\d{3,4}$/))return u;null==u.end&&(u.end=new i(null,u.start.date()));m=0,l=0,h=-1;if(null!=a[4]){var g;if((g=parseInt(a[4]))>=60)return null;u.end.assign("second",g)}if(m=parseInt(a[2]),null!=a[3]){if((l=parseInt(a[3]))>=60)return u}else m>100&&(l=m%100,m=parseInt(m/100));if(l>=60)return null;if(m>24)return null;if(m>=12&&(h=1),null!=a[5]){if(m>12)return null;"a"==a[5][0].toLowerCase()&&(h=0,12==m&&(m=0,u.end.isCertain("day")||u.end.imply("day",u.end.get("day")+1))),"p"==a[5][0].toLowerCase()&&(h=1,12!=m&&(m+=12)),u.start.isCertain("meridiem")||(0==h?(u.start.imply("meridiem",0),12==u.start.get("hour")&&u.start.assign("hour",0)):(u.start.imply("meridiem",1),12!=u.start.get("hour")&&u.start.assign("hour",u.start.get("hour")+12)))}else m>=12&&(h=1);return u.text=u.text+a[0],u.end.assign("hour",m),u.end.assign("minute",l),h>=0&&u.end.assign("meridiem",h),u.end.date().getTime()12)&&m>12){if(!(l>=1&&l<=12&&m>=13&&m<=31))return null;var h=m;m=l,l=h}return l<1||l>31?null:(u<100&&(u+=u>50?1900:2e3),d.start.assign("day",l),d.start.assign("month",m),d.start.assign("year",u),a[2]&&d.start.assign("weekday",o[a[2].toLowerCase()]),d.tags.ESSlashDateFormatParser=!0,d)}}else a.index+=a[0].length}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=/(\W|^)(maintenant|aujourd'hui|ajd|cette\s*nuit|la\s*veille|(demain|hier)(\s*(matin|soir|aprem|après-midi))?|ce\s*(matin|soir)|cet\s*(après-midi|aprem))(?=\W|$)/i;t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,n){e=a[0].substr(a[1].length);var i=a.index+a[1].length,o=new s({index:i,text:e,ref:t}),d=r(t),u=d,m=e.toLowerCase();return m.match(/demain/)&&d.hour()>1&&(u=u.add(1,"day")),m.match(/hier/)&&(u=u.add(-1,"day")),m.match(/cette\s*nuit/)?(o.start.imply("hour",22),o.start.imply("meridiem",1)):m.match(/la\s*veille/)?(o.start.imply("hour",0),d.hour()>6&&(u=u.add(-1,"day"))):m.match(/(après-midi|aprem)/)?o.start.imply("hour",14):m.match(/(soir)/)?o.start.imply("hour",18):m.match(/matin/)?o.start.imply("hour",8):m.match("maintenant")&&(o.start.imply("hour",d.hour()),o.start.imply("minute",d.minute()),o.start.imply("second",d.second()),o.start.imply("millisecond",d.millisecond())),o.start.assign("day",u.date()),o.start.assign("month",u.month()+1),o.start.assign("year",u.year()),o.tags.FRCasualDateParser=!0,o}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(10),o=new RegExp("(\\W|^)(dans|en)\\s*("+i.INTEGER_WORDS_PATTERN+"|[0-9]+|une?|(?:\\s*quelques)?|demi(?:\\s*|-?)?)\\s*(secondes?|min(?:ute)?s?|heures?|jours?|semaines?|mois|années?)\\s*(?=\\W|$)","i"),d=new RegExp("(\\W|^)(dans|en)\\s*("+i.INTEGER_WORDS_PATTERN+"|[0-9]+|un?)\\s*(secondes?|minutes?|heures?|jours?)\\s*(?=\\W|$)","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return this.isStrictMode()?d:o},this.extract=function(e,t,a,n){var o=a.index+a[1].length;a[0];e=a[0].substr(a[1].length,a[0].length-a[1].length);var d=new s({index:o,text:e,ref:t}),u=a[3];u=void 0!==i.INTEGER_WORDS[u]?i.INTEGER_WORDS[u]:"un"===u||"une"===u?1:u.match(/quelques?/i)?3:u.match(/demi-?/i)?.5:parseInt(u);var m=r(t);return a[4].match(/jour|semaine|mois|année/i)?(a[4].match(/jour/)?m=m.add(u,"d"):a[4].match(/semaine/i)?m=m.add(7*u,"d"):a[4].match(/mois/i)?m=m.add(u,"month"):a[4].match(/année/i)&&(m=m.add(u,"year")),d.start.assign("year",m.year()),d.start.assign("month",m.month()+1),d.start.assign("day",m.date()),d):(a[4].match(/heure/i)?m=m.add(u,"hour"):a[4].match(/min/i)?m=m.add(u,"minutes"):a[4].match(/secondes/i)&&(m=m.add(u,"second")),d.start.imply("year",m.year()),d.start.imply("month",m.month()+1),d.start.imply("day",m.date()),d.start.assign("hour",m.hour()),d.start.assign("minute",m.minute()),d.start.assign("second",m.second()),d.tags.FRDeadlineFormatParser=!0,d)}}},function(e,t,a){var r=a(1),n=a(0).ParsedResult,s=a(10),i=(s.WEEKDAY_OFFSET,new RegExp("(\\W|^)(?:(Dimanche|Lundi|Mardi|mercredi|Jeudi|Vendredi|Samedi|Dim|Lun|Mar|Mer|Jeu|Ven|Sam)\\s*,?\\s*)?([0-9]{1,2}|1er)(?:\\s*(?:au|\\-|\\–|jusqu'au?|\\s)\\s*([0-9]{1,2})(?:er)?)?\\s*(?:de)?\\s*(Jan(?:vier|\\.)?|F[ée]v(?:rier|\\.)?|Mars|Avr(?:il|\\.)?|Mai|Juin|Juil(?:let|\\.)?|Ao[uû]t|Sept(?:embre|\\.)?|Oct(?:obre|\\.)?|Nov(?:embre|\\.)?|d[ée]c(?:embre|\\.)?)(?:\\s*(\\s*[0-9]{1,4}(?![^\\s]\\d))(?:\\s*(AC|[ap]\\.?\\s*c(?:h(?:r)?)?\\.?\\s*n\\.?))?)?(?=\\W|$)","i"));t.Parser=function(){r.Parser.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,i){var o=new n({text:a[0].substr(a[1].length,a[0].length-a[1].length),index:a.index+a[1].length,ref:t}),d=a[5];d=s.MONTH_OFFSET[d.toLowerCase()];var u=a[3];u=parseInt(u);var m=null;if(a[6]&&(m=a[6],m=parseInt(m),a[7]?/a/i.test(a[7])&&(m=-m):m<100&&(m+=2e3)),m?(o.start.assign("day",u),o.start.assign("month",d),o.start.assign("year",m)):(m=r.findYearClosestToRef(t,u,d),o.start.assign("day",u),o.start.assign("month",d),o.start.imply("year",m)),a[2]){var l=a[2];l=s.WEEKDAY_OFFSET[l.toLowerCase()],o.start.assign("weekday",l)}return a[4]&&(o.end=o.start.clone(),o.end.assign("day",parseInt(a[4]))),o.tags.FRMonthNameLittleEndianParser=!0,o}}},function(e,t,a){var r=a(1),n=a(0).ParsedResult,s=new RegExp("(\\W|^)(?:((?:dimanche|dim|lundi|lun|mardi|mar|mercredi|mer|jeudi|jeu|vendredi|ven|samedi|sam|le))\\s*\\,?\\s*)?([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}s*,?s*|[0-9]{2}s*,?s*))?(\\W|$)","i"),i={dimanche:0,dim:0,lundi:1,lun:1,mardi:2,mar:2,mercredi:3,mer:3,jeudi:4,jeu:4,vendredi:5,ven:5,samedi:6,sam:6};t.Parser=function(e){r.Parser.apply(this,arguments),this.pattern=function(){return s},this.extract=function(e,t,a,s){if("/"!=a[1]&&"/"!=a[6]){var o=a.index+a[1].length,d=(e=a[0].substr(a[1].length,a[0].length-a[6].length),new n({text:e,index:o,ref:t}));if(!e.match(/^\d\.\d$/)&&!e.match(/^\d\.\d{1,2}\.\d{1,2}$/)&&(a[5]||!(a[0].indexOf("/")<0))){var u=a[4],m=a[3];m=parseInt(m),u=parseInt(u);var l=null;if(a[5]&&(l=a[5],(l=parseInt(l))<100&&(l+=2e3)),(u<1||u>12)&&u>12){if(!(m>=1&&m<=12&&u>=13&&u<=31))return null;var h=u;u=m,m=h}return m<1||m>31?null:(l?(d.start.assign("day",m),d.start.assign("month",u),d.start.assign("year",l)):(l=r.findYearClosestToRef(t,m,u),d.start.assign("day",m),d.start.assign("month",u),d.start.imply("year",l)),a[2]&&d.start.assign("weekday",i[a[2].toLowerCase()]),d.tags.FRSlashDateFormatParser=!0,d)}}else a.index+=a[0].length}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=/(\W|^)il y a\s*([0-9]+|une?)\s*(minutes?|heures?|semaines?|jours?|mois|années?|ans?)(?=(?:\W|$))/i;t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,n){if(a.index>0&&e[a.index-1].match(/\w/))return null;e=a[0];e=a[0].substr(a[1].length,a[0].length-a[1].length);var i=a.index+a[1].length,o=new s({index:i,text:e,ref:t});o.tags.FRTimeAgoFormatParser=!0;var d=parseInt(a[2]);isNaN(d)&&(d=a[2].match(/demi/)?.5:1);var u=r(t);return a[3].match(/heure/)||a[3].match(/minute/)?(a[3].match(/heure/)?u=u.add(-d,"hour"):a[3].match(/minute/)&&(u=u.add(-d,"minute")),o.start.imply("day",u.date()),o.start.imply("month",u.month()+1),o.start.imply("year",u.year()),o.start.assign("hour",u.hour()),o.start.assign("minute",u.minute()),o):a[3].match(/semaine/)?(u=u.add(-d,"week"),o.start.imply("day",u.date()),o.start.imply("month",u.month()+1),o.start.imply("year",u.year()),o.start.imply("weekday",u.day()),o):(a[3].match(/jour/)&&(u=u.add(-d,"d")),a[3].match(/mois/)&&(u=u.add(-d,"month")),a[3].match(/années?|ans?/)&&(u=u.add(-d,"year")),o.start.assign("day",u.date()),o.start.assign("month",u.month()+1),o.start.assign("year",u.year()),o)}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(0).ParsedComponents,o=new RegExp("(^|\\s|T)(?:(?:[àa])\\s*)?(\\d{1,2}(?:h)?|midi|minuit)(?:(?:\\.|\\:|\\:|h)(\\d{1,2})(?:m)?(?:(?:\\:|\\:|m)(\\d{0,2})(?:s)?)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),d=new RegExp("^\\s*(\\-|\\–|\\~|\\〜|[àa]|\\?)\\s*(\\d{1,2}(?:h)?)(?:(?:\\.|\\:|\\:|h)(\\d{1,2})(?:m)?(?:(?:\\.|\\:|\\:|m)(\\d{1,2})(?:s)?)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return o},this.extract=function(e,t,a,n){if(a.index>0&&e[a.index-1].match(/\w/))return null;var o=r(t),u=new s;u.ref=t,u.index=a.index+a[1].length,u.text=a[0].substring(a[1].length),u.tags.FRTimeExpressionParser=!0,u.start.imply("day",o.date()),u.start.imply("month",o.month()+1),u.start.imply("year",o.year());var m=0,l=0,h=-1;if(null!=a[4]){if((c=parseInt(a[4]))>=60)return null;u.start.assign("second",c)}if("midi"==a[2].toLowerCase()?(h=1,m=12):"minuit"==a[2].toLowerCase()?(h=0,m=0):m=parseInt(a[2]),null!=a[3]?l=parseInt(a[3]):m>100&&(l=m%100,m=parseInt(m/100)),l>=60)return null;if(m>24)return null;if(m>=12&&(h=1),null!=a[5]){if(m>12)return null;"a"==(g=a[5][0].toLowerCase())&&(h=0,12==m&&(m=0)),"p"==g&&(h=1,12!=m&&(m+=12))}if(u.start.assign("hour",m),u.start.assign("minute",l),h>=0&&u.start.assign("meridiem",h),!(a=d.exec(e.substring(u.index+u.text.length))))return u.text.match(/^\d+$/)?null:u;if(a[0].match(/^\s*(\+|\-)\s*\d{3,4}$/))return u;null==u.end&&(u.end=new i(null,u.start.date()));m=0,l=0,h=-1;if(null!=a[4]){var c;if((c=parseInt(a[4]))>=60)return null;u.end.assign("second",c)}if(m=parseInt(a[2]),null!=a[3]){if((l=parseInt(a[3]))>=60)return u}else m>100&&(l=m%100,m=parseInt(m/100));if(l>=60)return null;if(m>24)return null;if(m>=12&&(h=1),null!=a[5]){if(m>12)return null;var g;"a"==(g=a[5][0].toLowerCase())&&(h=0,12==m&&(m=0,u.end.isCertain("day")||u.end.imply("day",u.end.get("day")+1))),"p"==g&&(h=1,12!=m&&(m+=12)),u.start.isCertain("meridiem")||(0==h?(u.start.imply("meridiem",0),12==u.start.get("hour")&&u.start.assign("hour",0)):(u.start.imply("meridiem",1),12!=u.start.get("hour")&&u.start.assign("hour",u.start.get("hour")+12)))}(u.text=u.text+a[0],u.end.assign("hour",m),u.end.assign("minute",l),h>=0)?u.end.assign("meridiem",h):u.start.isCertain("meridiem")&&1==u.start.get("meridiem")&&u.start.get("hour")>m?u.end.imply("meridiem",0):m>12&&u.end.imply("meridiem",1);return u.end.date().getTime()0){var p=g;g=f,f=p}return g=g.startOf(h),f=f.endOf(h),"week"==h&&(g=g.add(1,"d"),f=f.add(1,"d")),l.start.assign("year",g.year()),l.start.assign("month",g.month()+1),l.start.assign("day",g.date()),l.start.assign("minute",g.minute()),l.start.assign("second",g.second()),l.start.assign("hour",g.hour()),l.start.assign("millisecond",g.millisecond()),l.end=l.start.clone(),l.end.assign("year",f.year()),l.end.assign("month",f.month()+1),l.end.assign("day",f.date()),l.end.assign("minute",f.minute()),l.end.assign("second",f.second()),l.end.assign("hour",f.hour()),l.end.assign("millisecond",f.millisecond()),l}}}},function(e,t,a){e.exports=function(){"use strict";var e="month",t="quarter";return function(a,r){var n=r.prototype;n.quarter=function(e){return this.$utils().u(e)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(e-1))};var s=n.add;n.add=function(a,r){return a=Number(a),this.$utils().p(r)===t?this.add(3*a,e):s.bind(this)(a,r)};var i=n.startOf;n.startOf=function(a,r){var n=this.$utils(),s=!!n.u(r)||r;if(n.p(a)===t){var o=this.quarter()-1;return s?this.month(3*o).startOf(e).startOf("day"):this.month(3*o+2).endOf(e).endOf("day")}return i.bind(this)(a,r)}}}()},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(7),o=new RegExp("(\\d{2,4}|["+Object.keys(i.NUMBER).join("")+"]{2,4})?(?:\\s*)(?:年)?(?:[\\s|,|,]*)(\\d{1,2}|["+Object.keys(i.NUMBER).join("")+"]{1,2})(?:\\s*)(?:月)(?:\\s*)(\\d{1,2}|["+Object.keys(i.NUMBER).join("")+"]{1,2})?(?:\\s*)(?:日|號)?");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return o},this.extract=function(e,t,a,n){var o=r(t),d=new s({text:a[0],index:a.index,ref:t}),u=parseInt(a[2]);if(isNaN(u)&&(u=i.zhStringToNumber(a[2])),d.start.assign("month",u),a[3]){var m=parseInt(a[3]);isNaN(m)&&(m=i.zhStringToNumber(a[3])),d.start.assign("day",m)}else d.start.imply("day",o.date());if(a[1]){var l=parseInt(a[1]);isNaN(l)&&(l=i.zhStringToYear(a[1])),d.start.assign("year",l)}else d.start.imply("year",o.year());return d.tags.ZHHantDateParser=!0,d}}},function(e,t,a){var r=a(1).Parser,n=a(0).ParsedResult,s=a(6).updateParsedComponent,i=a(7),o=new RegExp("(上|今|下|這|呢)?(?:個)?(?:星期|禮拜)("+Object.keys(i.WEEKDAY_OFFSET).join("|")+")");t.Parser=function(){r.apply(this,arguments),this.pattern=function(){return o},this.extract=function(e,t,a,r){var o=a.index;e=a[0];var d=new n({index:o,text:e,ref:t}),u=a[2],m=i.WEEKDAY_OFFSET[u];if(void 0===m)return null;var l=null,h=a[1];return"上"==h?l="last":"下"==h?l="next":"今"!=h&&"這"!=h&&"呢"!=h||(l="this"),s(d,t,m,l),d.tags.ZHHantWeekdayParser=!0,d}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(0).ParsedComponents,o=a(7),d="(?:由|從|自)?(?:(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)(?:[\\s,,]*)(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?)?(?:[\\s,,]*)(?:(\\d+|["+Object.keys(o.NUMBER).join("")+"]+)(?:\\s*)(?:點|時|:|:)(?:\\s*)(\\d+|半|正|整|["+Object.keys(o.NUMBER).join("")+"]+)?(?:\\s*)(?:分|:|:)?(?:\\s*)(\\d+|["+Object.keys(o.NUMBER).join("")+"]+)?(?:\\s*)(?:秒)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?",u="(?:^\\s*(?:到|至|\\-|\\–|\\~|\\〜)\\s*)(?:(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)(?:[\\s,,]*)(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?)?(?:[\\s,,]*)(?:(\\d+|["+Object.keys(o.NUMBER).join("")+"]+)(?:\\s*)(?:點|時|:|:)(?:\\s*)(\\d+|半|正|整|["+Object.keys(o.NUMBER).join("")+"]+)?(?:\\s*)(?:分|:|:)?(?:\\s*)(\\d+|["+Object.keys(o.NUMBER).join("")+"]+)?(?:\\s*)(?:秒)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?",m=new RegExp(d,"i"),l=new RegExp(u,"i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return m},this.extract=function(e,t,a,n){if(a.index>0&&e[a.index-1].match(/\w/))return null;var d=r(t),u=new s;u.ref=t,u.index=a.index,u.text=a[0],u.tags.ZHTimeExpressionParser=!0;var m=d.clone();if(a[1])"明"==(y=a[1])||"聽"==y?d.hour()>1&&m.add(1,"day"):"昨"==y||"尋"==y||"琴"==y?m.add(-1,"day"):"前"==y?m.add(-2,"day"):"大前"==y?m.add(-3,"day"):"後"==y?m.add(2,"day"):"大後"==y&&m.add(3,"day"),u.start.assign("day",m.date()),u.start.assign("month",m.month()+1),u.start.assign("year",m.year());else if(a[4]){"明"==(v=a[4])||"聽"==v?m.add(1,"day"):"昨"==v||"尋"==v||"琴"==v?m.add(-1,"day"):"前"==v?m.add(-2,"day"):"大前"==v?m.add(-3,"day"):"後"==v?m.add(2,"day"):"大後"==v&&m.add(3,"day"),u.start.assign("day",m.date()),u.start.assign("month",m.month()+1),u.start.assign("year",m.year())}else u.start.imply("day",m.date()),u.start.imply("month",m.month()+1),u.start.imply("year",m.year());var h=0,c=0,g=-1;if(a[8]){var f=parseInt(a[8]);if(isNaN(f)&&(f=o.zhStringToNumber(a[8])),f>=60)return null;u.start.assign("second",f)}if(h=parseInt(a[6]),isNaN(h)&&(h=o.zhStringToNumber(a[6])),a[7]?"半"==a[7]?c=30:"正"==a[7]||"整"==a[7]?c=0:(c=parseInt(a[7]),isNaN(c)&&(c=o.zhStringToNumber(a[7]))):h>100&&(c=h%100,h=parseInt(h/100)),c>=60)return null;if(h>24)return null;if(h>=12&&(g=1),a[9]){if(h>12)return null;"a"==(x=a[9][0].toLowerCase())&&(g=0,12==h&&(h=0)),"p"==x&&(g=1,12!=h&&(h+=12))}else if(a[2]){"朝"==(P=a[2][0])||"早"==P?(g=0,12==h&&(h=0)):"晚"==P&&(g=1,12!=h&&(h+=12))}else if(a[3]){"上"==(T=a[3][0])||"朝"==T||"早"==T||"凌"==T?(g=0,12==h&&(h=0)):"下"!=T&&"晏"!=T&&"晚"!=T||(g=1,12!=h&&(h+=12))}else if(a[5]){"上"==(w=a[5][0])||"朝"==w||"早"==w||"凌"==w?(g=0,12==h&&(h=0)):"下"!=w&&"晏"!=w&&"晚"!=w||(g=1,12!=h&&(h+=12))}if(u.start.assign("hour",h),u.start.assign("minute",c),g>=0?u.start.assign("meridiem",g):h<12?u.start.imply("meridiem",0):u.start.imply("meridiem",1),!(a=l.exec(e.substring(u.index+u.text.length))))return u.text.match(/^\d+$/)?null:u;var y,p=m.clone();if(u.end=new i(null,null),a[1])"明"==(y=a[1])||"聽"==y?d.hour()>1&&p.add(1,"day"):"昨"==y||"尋"==y||"琴"==y?p.add(-1,"day"):"前"==y?p.add(-2,"day"):"大前"==y?p.add(-3,"day"):"後"==y?p.add(2,"day"):"大後"==y&&p.add(3,"day"),u.end.assign("day",p.date()),u.end.assign("month",p.month()+1),u.end.assign("year",p.year());else if(a[4]){var v;"明"==(v=a[4])||"聽"==v?p.add(1,"day"):"昨"==v||"尋"==v||"琴"==v?p.add(-1,"day"):"前"==v?p.add(-2,"day"):"大前"==v?p.add(-3,"day"):"後"==v?p.add(2,"day"):"大後"==v&&p.add(3,"day"),u.end.assign("day",p.date()),u.end.assign("month",p.month()+1),u.end.assign("year",p.year())}else u.end.imply("day",p.date()),u.end.imply("month",p.month()+1),u.end.imply("year",p.year());if(h=0,c=0,g=-1,a[8]){f=parseInt(a[8]);if(isNaN(f)&&(f=o.zhStringToNumber(a[8])),f>=60)return null;u.end.assign("second",f)}if(h=parseInt(a[6]),isNaN(h)&&(h=o.zhStringToNumber(a[6])),a[7]?"半"==a[7]?c=30:"正"==a[7]||"整"==a[7]?c=0:(c=parseInt(a[7]),isNaN(c)&&(c=o.zhStringToNumber(a[7]))):h>100&&(c=h%100,h=parseInt(h/100)),c>=60)return null;if(h>24)return null;if(h>=12&&(g=1),a[9]){if(h>12)return null;var x;"a"==(x=a[9][0].toLowerCase())&&(g=0,12==h&&(h=0)),"p"==x&&(g=1,12!=h&&(h+=12)),u.start.isCertain("meridiem")||(0==g?(u.start.imply("meridiem",0),12==u.start.get("hour")&&u.start.assign("hour",0)):(u.start.imply("meridiem",1),12!=u.start.get("hour")&&u.start.assign("hour",u.start.get("hour")+12)))}else if(a[2]){var P;"朝"==(P=a[2][0])||"早"==P?(g=0,12==h&&(h=0)):"晚"==P&&(g=1,12!=h&&(h+=12))}else if(a[3]){var T;"上"==(T=a[3][0])||"朝"==T||"早"==T||"凌"==T?(g=0,12==h&&(h=0)):"下"!=T&&"晏"!=T&&"晚"!=T||(g=1,12!=h&&(h+=12))}else if(a[5]){var w;"上"==(w=a[5][0])||"朝"==w||"早"==w||"凌"==w?(g=0,12==h&&(h=0)):"下"!=w&&"晏"!=w&&"晚"!=w||(g=1,12!=h&&(h+=12))}(u.text=u.text+a[0],u.end.assign("hour",h),u.end.assign("minute",c),g>=0)?u.end.assign("meridiem",g):u.start.isCertain("meridiem")&&1==u.start.get("meridiem")&&u.start.get("hour")>h?u.end.imply("meridiem",0):h>12&&u.end.imply("meridiem",1);return u.end.date().getTime()1&&(u=u.add(1,"day")):"昨"==m||"尋"==m||"琴"==m?u=u.add(-1,"day"):"前"==m?u=u.add(-2,"day"):"大前"==m?u=u.add(-3,"day"):"後"==m?u=u.add(2,"day"):"大後"==m&&(u=u.add(3,"day")),"早"==l||"朝"==l?o.start.imply("hour",6):"晚"==l&&(o.start.imply("hour",22),o.start.imply("meridiem",1))}else if(a[4]){var h=a[4][0];"早"==h||"朝"==h||"上"==h?o.start.imply("hour",6):"下"==h||"晏"==h?(o.start.imply("hour",15),o.start.imply("meridiem",1)):"中"==h?(o.start.imply("hour",12),o.start.imply("meridiem",1)):"夜"==h||"晚"==h?(o.start.imply("hour",22),o.start.imply("meridiem",1)):"凌"==h&&o.start.imply("hour",0)}else if(a[5]){var c=a[5];"明"==c||"聽"==c?d.hour()>1&&(u=u.add(1,"day")):"昨"==c||"尋"==c||"琴"==c?u=u.add(-1,"day"):"前"==c?u=u.add(-2,"day"):"大前"==c?u=u.add(-3,"day"):"後"==c?u=u.add(2,"day"):"大後"==c&&(u=u.add(3,"day"));var g=a[6];if(g){var f=g[0];"早"==f||"朝"==f||"上"==f?o.start.imply("hour",6):"下"==f||"晏"==f?(o.start.imply("hour",15),o.start.imply("meridiem",1)):"中"==f?(o.start.imply("hour",12),o.start.imply("meridiem",1)):"夜"==f||"晚"==f?(o.start.imply("hour",22),o.start.imply("meridiem",1)):"凌"==f&&o.start.imply("hour",0)}}return o.start.assign("day",u.date()),o.start.assign("month",u.month()+1),o.start.assign("year",u.year()),o.tags.ZHHantCasualDateParser=!0,o}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(7),o=new RegExp("(\\d+|["+Object.keys(i.NUMBER).join("")+"]+|半|幾)(?:\\s*)(?:個)?(秒(?:鐘)?|分鐘|小時|鐘|日|天|星期|禮拜|月|年)(?:(?:之|過)?後|(?:之)?內)","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return o},this.extract=function(e,t,a,n){var o=a.index;e=a[0];var d=new s({index:o,text:e,ref:t}),u=parseInt(a[1]);if(isNaN(u)&&(u=i.zhStringToNumber(a[1])),isNaN(u)){var m=a[1];if("幾"===m)u=3;else{if("半"!==m)return null;u=.5}}var l=r(t),h=a[2][0];return h.match(/[日天星禮月年]/)?("日"==h||"天"==h?l=l.add(u,"d"):"星"==h||"禮"==h?l=l.add(7*u,"d"):"月"==h?l=l.add(u,"month"):"年"==h&&(l=l.add(u,"year")),d.start.assign("year",l.year()),d.start.assign("month",l.month()+1),d.start.assign("day",l.date()),d):("秒"==h?l=l.add(u,"second"):"分"==h?l=l.add(u,"minute"):"小"!=h&&"鐘"!=h||(l=l.add(u,"hour")),d.start.imply("year",l.year()),d.start.imply("month",l.month()+1),d.start.imply("day",l.date()),d.start.assign("hour",l.hour()),d.start.assign("minute",l.minute()),d.start.assign("second",l.second()),d.tags.ZHHantDeadlineFormatParser=!0,d)}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(8),o=new RegExp("(\\W|^)(in|nach)\\s*("+i.INTEGER_WORDS_PATTERN+"|[0-9]+|einigen|eine[rm]\\s*halben|eine[rm])\\s*(sekunden?|min(?:ute)?n?|stunden?|tag(?:en)?|wochen?|monat(?:en)?|jahr(?:en)?)\\s*(?=\\W|$)","i"),d=new RegExp("(\\W|^)(in|nach)\\s*("+i.INTEGER_WORDS_PATTERN+"|[0-9]+|eine(?:r|m)?)\\s*(sekunden?|minuten?|stunden?|tag(?:en)?)\\s*(?=\\W|$)","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return this.isStrictMode()?d:o},this.extract=function(e,t,a,n){var o=a.index+a[1].length;a[0];e=a[0].substr(a[1].length,a[0].length-a[1].length);var d=new s({index:o,text:e,ref:t}),u=a[3].toLowerCase();u=void 0!==i.INTEGER_WORDS[u]?i.INTEGER_WORDS[u]:"einer"===u||"einem"===u?1:"einigen"===u?3:/halben/.test(u)?.5:parseInt(u);var m=r(t);return/tag|woche|monat|jahr/i.test(a[4])?(/tag/i.test(a[4])?m=m.add(u,"d"):/woche/i.test(a[4])?m=m.add(7*u,"d"):/monat/i.test(a[4])?m=m.add(u,"month"):/jahr/i.test(a[4])&&(m=m.add(u,"year")),d.start.assign("year",m.year()),d.start.assign("month",m.month()+1),d.start.assign("day",m.date()),d):(/stunde/i.test(a[4])?m=m.add(u,"hour"):/min/i.test(a[4])?m=m.add(u,"minute"):/sekunde/i.test(a[4])&&(m=m.add(u,"second")),d.start.imply("year",m.year()),d.start.imply("month",m.month()+1),d.start.imply("day",m.date()),d.start.assign("hour",m.hour()),d.start.assign("minute",m.minute()),d.start.assign("second",m.second()),d.tags.DEDeadlineFormatParser=!0,d)}}},function(e,t,a){a(2);var r=a(1),n=a(0).ParsedResult,s=a(8),i=new RegExp("(\\W|^)(?:am\\s*?)?(?:(Sonntag|Montag|Dienstag|Mittwoch|Donnerstag|Freitag|Samstag|So|Mo|Di|Mi|Do|Fr|Sa)\\s*,?\\s*)?(?:den\\s*)?([0-9]{1,2})\\.(?:\\s*(?:bis(?:\\s*(?:am|zum))?|\\-|\\–|\\s)\\s*([0-9]{1,2})\\.)?\\s*(Jan(?:uar|\\.)?|Feb(?:ruar|\\.)?|Mär(?:z|\\.)?|Maerz|Mrz\\.?|Apr(?:il|\\.)?|Mai|Jun(?:i|\\.)?|Jul(?:i|\\.)?|Aug(?:ust|\\.)?|Sep(?:t|t\\.|tember|\\.)?|Okt(?:ober|\\.)?|Nov(?:ember|\\.)?|Dez(?:ember|\\.)?)(?:,?\\s*([0-9]{1,4}(?![^\\s]\\d))(\\s*[vn]\\.?\\s*C(?:hr)?\\.?)?)?(?=\\W|$)","i");t.Parser=function(){r.Parser.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,i){var o=new n({text:a[0].substr(a[1].length,a[0].length-a[1].length),index:a.index+a[1].length,ref:t}),d=a[5];d=s.MONTH_OFFSET[d.toLowerCase()];var u=a[3];u=parseInt(u);var m=null;if(a[6]&&(m=a[6],m=parseInt(m),a[7]?/v/i.test(a[7])&&(m=-m):m<100&&(m+=2e3)),m?(o.start.assign("day",u),o.start.assign("month",d),o.start.assign("year",m)):(m=r.findYearClosestToRef(t,u,d),o.start.assign("day",u),o.start.assign("month",d),o.start.imply("year",m)),a[2]){var l=a[2];l=s.WEEKDAY_OFFSET[l.toLowerCase()],o.start.assign("weekday",l)}return a[4]&&(o.end=o.start.clone(),o.end.assign("day",parseInt(a[4]))),o.tags.DEMonthNameLittleEndianParser=!0,o}}},function(e,t,a){var r=a(1),n=a(0).ParsedResult,s=a(8),i=new RegExp("(^|\\D\\s+|[^\\w\\s])(Jan\\.?|Januar|Feb\\.?|Februar|Mär\\.?|M(?:ä|ae)rz|Mrz\\.?|Apr\\.?|April|Mai\\.?|Jun\\.?|Juni|Jul\\.?|Juli|Aug\\.?|August|Sep\\.?|Sept\\.?|September|Okt\\.?|Oktober|Nov\\.?|November|Dez\\.?|Dezember)\\s*(?:,?\\s*(?:([0-9]{4})(\\s*[vn]\\.?\\s*C(?:hr)?\\.?)?|([0-9]{1,4})\\s*([vn]\\.?\\s*C(?:hr)?\\.?)))?(?=[^\\s\\w]|$)","i");t.Parser=function(){r.Parser.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,i){var o=new n({text:a[0].substr(a[1].length,a[0].length-a[1].length),index:a.index+a[1].length,ref:t}),d=a[2];d=s.MONTH_OFFSET[d.toLowerCase()];var u=null;return(a[3]||a[5])&&(u=a[3]||a[5],u=parseInt(u),a[4]||a[6]?/v/i.test(a[4]||a[6])&&(u=-u):u<100&&(u+=2e3)),u?(o.start.imply("day",1),o.start.assign("month",d),o.start.assign("year",u)):(u=r.findYearClosestToRef(t,1,d),o.start.imply("day",1),o.start.assign("month",d),o.start.imply("year",u)),(!this.isStrictMode()||!o.text.match(/^\w+$/))&&(o.tags.DEMonthNameParser=!0,o)}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=new RegExp("(\\W|^)(?:(?:am\\s*?)?((?:sonntag|so|montag|mo|dienstag|di|mittwoch|mi|donnerstag|do|freitag|fr|samstag|sa))\\s*\\,?\\s*(?:den\\s*)?)?([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}s*,?s*|[0-9]{2}s*,?s*))?(\\W|$)","i"),o={sonntag:0,so:0,montag:1,mo:1,dienstag:2,di:2,mittwoch:3,mi:3,donnerstag:4,do:4,freitag:5,fr:5,samstag:6,sa:6};t.Parser=function(e){n.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,n){if("/"!=a[1]&&"/"!=a[6]){var i=a.index+a[1].length,d=(e=a[0].substr(a[1].length,a[0].length-a[6].length),new s({text:e,index:i,ref:t}));if(!e.match(/^\d\.\d$/)&&!e.match(/^\d\.\d{1,2}\.\d{1,2}$/)&&(a[5]||!(a[0].indexOf("/")<0))){var u=a[5]||r(t).year()+"",m=a[4],l=a[3];return m=parseInt(m),l=parseInt(l),u=parseInt(u),m<1||m>12?null:l<1||l>31?null:(u<100&&(u+=u>50?1900:2e3),d.start.assign("day",l),d.start.assign("month",m),d.start.assign("year",u),a[2]&&d.start.assign("weekday",o[a[2].toLowerCase()]),d.tags.DESlashDateFormatParser=!0,d)}}else a.index+=a[0].length}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(8),o=new RegExp("(\\W|^)vor\\s*("+i.INTEGER_WORDS_PATTERN+"|[0-9]+|einigen|eine[rm]\\s*halben|eine[rm])\\s*(sekunden?|min(?:ute)?n?|stunden?|wochen?|tag(?:en)?|monat(?:en)?|jahr(?:en)?)\\s*(?=(?:\\W|$))","i"),d=new RegExp("(\\W|^)vor\\s*([0-9]+|eine(?:r|m))\\s*(sekunden?|minuten?|stunden?|tag(?:en)?)(?=(?:\\W|$))","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return this.isStrictMode()?d:o},this.extract=function(e,t,a,n){if(a.index>0&&e[a.index-1].match(/\w/))return null;e=a[0];e=a[0].substr(a[1].length,a[0].length-a[1].length);var o=a.index+a[1].length,d=new s({index:o,text:e,ref:t}),u=a[2].toLowerCase();u=void 0!==i.INTEGER_WORDS[u]?i.INTEGER_WORDS[u]:"einer"===u||"einem"===u?1:"einigen"===u?3:/halben/.test(u)?.5:parseInt(u);var m=r(t);return/stunde|min|sekunde/i.test(a[3])?(/stunde/i.test(a[3])?m=m.add(-u,"hour"):/min/i.test(a[3])?m=m.add(-u,"minute"):/sekunde/i.test(a[3])&&(m=m.add(-u,"second")),d.start.imply("day",m.date()),d.start.imply("month",m.month()+1),d.start.imply("year",m.year()),d.start.assign("hour",m.hour()),d.start.assign("minute",m.minute()),d.start.assign("second",m.second()),d.tags.DETimeAgoFormatParser=!0,d):/woche/i.test(a[3])?(m=m.add(-u,"week"),d.start.imply("day",m.date()),d.start.imply("month",m.month()+1),d.start.imply("year",m.year()),d.start.imply("weekday",m.day()),d):(/tag/i.test(a[3])&&(m=m.add(-u,"d")),/monat/i.test(a[3])&&(m=m.add(-u,"month")),/jahr/i.test(a[3])&&(m=m.add(-u,"year")),d.start.assign("day",m.date()),d.start.assign("month",m.month()+1),d.start.assign("year",m.year()),d)}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(0).ParsedComponents,o=new RegExp("(^|\\s|T)(?:(?:um|von)\\s*)?(\\d{1,4}|mittags?|mitternachts?)(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:(?:\\:|\\:)(\\d{2}))?)?(?:\\s*uhr)?(?:\\s*(morgens|vormittags|mittags|nachmittags|abends|nachts))?(?=\\W|$)","i"),d=new RegExp("^\\s*(\\-|\\–|\\~|\\〜|bis|\\?)\\s*(\\d{1,4})(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:(?:\\.|\\:|\\:)(\\d{1,2}))?)?(?:\\s*(morgens|vormittags|mittags|nachmittags|abends|nachts))?(?=\\W|$)","i");t.Parser=function(){n.apply(this,arguments),this.pattern=function(){return o},this.extract=function(e,t,a,n){if(a.index>0&&e[a.index-1].match(/\w/))return null;var o=r(t),u=new s;u.ref=t,u.index=a.index+a[1].length,u.text=a[0].substring(a[1].length),u.tags.DETimeExpressionParser=!0,u.start.imply("day",o.date()),u.start.imply("month",o.month()+1),u.start.imply("year",o.year());var m=0,l=0,h=-1;if(null!=a[4]){if((c=parseInt(a[4]))>=60)return null;u.start.assign("second",c)}if(/mittags?/i.test(a[2])?(h=1,m=12):/mitternachts?/i.test(a[2])?(h=0,m=0):m=parseInt(a[2]),null!=a[3]?l=parseInt(a[3]):m>100&&(l=m%100,m=parseInt(m/100)),l>=60)return null;if(m>24)return null;if(m>=12&&(h=1),null!=a[5]){if(m>12)return null;"morgens"===(g=a[5].toLowerCase())||"vormittags"===g?(h=0,12==m&&(m=0)):(h=1,12!=m&&(m+=12))}if(u.start.assign("hour",m),u.start.assign("minute",l),h>=0?u.start.assign("meridiem",h):m<12?u.start.imply("meridiem",0):u.start.imply("meridiem",1),!(a=d.exec(e.substring(u.index+u.text.length))))return u.text.match(/^\d+$/)?null:u;if(a[0].match(/^\s*(\+|\-)\s*\d{3,4}$/))return u;null==u.end&&(u.end=new i(null,u.start.date()));m=0,l=0,h=-1;if(null!=a[4]){var c;if((c=parseInt(a[4]))>=60)return null;u.end.assign("second",c)}if(m=parseInt(a[2]),null!=a[3]){if((l=parseInt(a[3]))>=60)return u}else m>100&&(l=m%100,m=parseInt(m/100));if(l>=60)return null;if(m>24)return null;if(m>=12&&(h=1),null!=a[5]){if(m>12)return null;var g;"morgens"===(g=a[5].toLowerCase())||"vormittags"===g?(h=0,12==m&&(m=0,u.end.isCertain("day")||u.end.imply("day",u.end.get("day")+1))):(h=1,12!=m&&(m+=12)),u.start.isCertain("meridiem")||(0==h?(u.start.imply("meridiem",0),12==u.start.get("hour")&&u.start.assign("hour",0)):(u.start.imply("meridiem",1),12!=u.start.get("hour")&&u.start.assign("hour",u.start.get("hour")+12)))}(u.text=u.text+a[0],u.end.assign("hour",m),u.end.assign("minute",l),h>=0)?u.end.assign("meridiem",h):u.start.isCertain("meridiem")&&1==u.start.get("meridiem")&&u.start.get("hour")>m?u.end.imply("meridiem",0):m>12&&u.end.imply("meridiem",1);return u.end.date().getTime()m?l.day(m+7):l.day(m):n.forwardDate&&g>m?l.day(m+7):!n.forwardDate&&Math.abs(m-7-g)1?2:1,"day"):/^morgen/.test(u)?d.hour()>1&&(m=m.add(1,"day")):/^gestern/.test(u)?m=m.add(-1,"day"):/^vorgestern/.test(u)?m=m.add(-2,"day"):/letzte\s*nacht/.test(u)?(o.start.imply("hour",0),d.hour()>6&&(m=m.add(-1,"day"))):"jetzt"===u&&(o.start.imply("hour",d.hour()),o.start.imply("minute",d.minute()),o.start.imply("second",d.second()),o.start.imply("millisecond",d.millisecond()));var l=a[3]||a[4]||a[5];if(l)switch(l.toLowerCase()){case"morgen":o.start.imply("hour",6);break;case"vormittag":o.start.imply("hour",9);break;case"mittag":o.start.imply("hour",12);break;case"nachmittag":o.start.imply("hour",15),o.start.imply("meridiem",1);break;case"abend":o.start.imply("hour",18),o.start.imply("meridiem",1);break;case"nacht":o.start.imply("hour",0)}return o.start.assign("day",m.date()),o.start.assign("month",m.month()+1),o.start.assign("year",m.year()),o.tags.DECasualDateParser=!0,o}}},function(e,t,a){var r=a(1),n=a(0).ParsedResult,s=a(11),i=new RegExp("(^|\\D\\s+|[^\\w\\s])("+s.MONTH_PATTERN+")\\s*(?:[,-]?\\s*([0-9]{4})(\\s*BE|n.Chr.|v.Chr.)?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)","i");t.Parser=function(){r.Parser.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,i){var o=new n({text:a[0].substr(a[1].length,a[0].length-a[1].length),index:a.index+a[1].length,ref:t}),d=a[2],u=s.MONTH_OFFSET[d.toLowerCase()],m=null;return a[3]&&(m=a[3],m=parseInt(m),a[4]?a[4].match(/BE/)?m-=543:a[4].match(/v\.Chr\./)&&(m=-m):m<100&&(m+=2e3)),m?(o.start.imply("day",1),o.start.assign("month",u),o.start.assign("year",m)):(m=r.findYearClosestToRef(t,1,u),o.start.imply("day",1),o.start.assign("month",u),o.start.imply("year",m)),!o.text.match(/^\w{3}$/)&&(o.tags.NLMonthNameParser=!0,o)}}},function(e,t,a){var r=a(1),n=a(0).ParsedResult,s=a(11),i=new RegExp("(\\W|^)(?:op\\s*?)?(?:("+s.WEEKDAY_PATTERN+")\\s*,?\\s*)?([0-9]{1,2}).?(?:\\s*(?:tot|\\-|\\–|tot en met|t\\/m)\\s*([0-9]{1,2}).?)?\\s*("+s.MONTH_PATTERN+")(?:(?:-|/|,?\\s*)((?:[1-9][0-9]{0,3}\\s*(?:BE|n.Chr.|v.Chr.)|[1-2][0-9]{3}|[5-9][0-9])(?![^\\s]\\d)))?(?=\\W|$)","i");t.Parser=function(){r.Parser.apply(this,arguments),this.pattern=function(){return i},this.extract=function(e,t,a,i){var o=new n({text:a[0].substr(a[1].length,a[0].length-a[1].length),index:a.index+a[1].length,ref:t}),d=a[5];d=s.MONTH_OFFSET[d.toLowerCase()];var u=a[3];u=parseInt(u);var m=null;if(a[6]&&(m=a[6],/BE/i.test(m)?(m=m.replace(/BE/i,""),m=parseInt(m)-543):/v\.Chr\./i.test(m)?(m=m.replace(/v\.Chr\./i,""),m=-parseInt(m)):/n\.Chr\./i.test(m)?(m=m.replace(/n\.Chr\./i,""),m=parseInt(m)):(m=parseInt(m))<100&&(m+=m>50?1900:2e3)),m?(o.start.assign("day",u),o.start.assign("month",d),o.start.assign("year",m)):(m=r.findYearClosestToRef(t,u,d),o.start.assign("day",u),o.start.assign("month",d),o.start.imply("year",m)),a[2]){var l=a[2];l=s.WEEKDAY_OFFSET[l.toLowerCase()],o.start.assign("weekday",l)}if(a[4]){var h=parseInt(a[4]);o.end=o.start.clone(),o.end.assign("day",h)}return o.tags.NLMonthNameLittleEndianParser=!0,o}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i=a(11),o=new RegExp("(\\W|^)(?:(?:op\\s*?)?("+i.WEEKDAY_PATTERN+")\\s*\\,?\\s*(?:de\\s*)?)?([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-1]{0,1}[0-9]{1}|"+i.MONTH_PATTERN+")(?:[\\/\\.\\-]([0-9]{4}s*,?s*|[0-9]{2}s*,?s*))?(\\W|$)","i");t.Parser=function(e){n.apply(this,arguments),this.pattern=function(){return o},this.extract=function(e,t,a,n){if("/"!=a[1]&&"/"!=a[6]){var o=a.index+a[1].length,d=(e=a[0].substr(a[1].length,a[0].length-a[6].length),new s({text:e,index:o,ref:t}));if(!e.match(/^\d\.\d$/)&&!e.match(/^\d\.\d{1,2}\.\d{1,2}$/)&&(a[5]||!(a[0].indexOf("/")<0))){var u=a[5]||r(t).year()+"",m=a[4],l=a[3];return(m=parseInt(m))||(m=i.MONTH_OFFSET[a[4].trim().toLowerCase()]),l=parseInt(l),u=parseInt(u),m<1||m>12?null:l<1||l>31?null:(u<100&&(u+=u>50?1900:2e3),d.start.assign("day",l),d.start.assign("month",m),d.start.assign("year",u),a[2]&&d.start.assign("weekday",i.WEEKDAY_OFFSET[a[2].toLowerCase()]),d.tags.NLSlashDateFormatParser=!0,d)}}else a.index+=a[0].length}}},function(e,t,a){var r=a(2),n=a(1).Parser,s=a(0).ParsedResult,i={zondag:0,zo:0,maandag:1,ma:1,dinsdag:2,di:2,woensdag:3,wo:3,donderdag:4,do:4,vrijdag:5,vr:5,zaterdag:6,za:6},o=new RegExp("(\\W|^)(?:(?:\\,|\\(|\\()\\s*)?(?:on\\s*?)?(?:(deze|afgelopen|vorige|volgende|komende)\\s*(?:week)?\\s*)?("+Object.keys(i).join("|")+")(?:\\s*(?:\\,|\\)|\\)))?(?:\\s*(deze|afgelopen|vorige|volgende|komende)\\s*week)?(?=\\W|$)","i");t.updateParsedComponent=function(e,t,a,n){var s=r(t),i=!1,o=s.day();return"afgelopen"==n||"vorige"==n?(s=s.day(a-7),i=!0):"volgende"==n?(s=s.day(a+7),i=!0):s="deze"==n||"komende"==n?s.day(a):Math.abs(a-7-o)0&&e[a.index-1].match(/\w/))return null;var o=r(t),u=new s;u.ref=t,u.index=a.index+a[1].length,u.text=a[0].substring(a[1].length),u.tags.NLTimeExpressionParser=!0,u.start.imply("day",o.date()),u.start.imply("month",o.month()+1),u.start.imply("year",o.year());var m=0,l=0,h=-1;if(null!=a[4]){if((c=parseInt(a[4]))>=60)return null;u.start.assign("second",c)}if(/tussen de middag/i.test(a[2])?(h=1,m=12):/middernachts?/i.test(a[2])?(h=0,m=0):m=parseInt(a[2]),null!=a[3]?l=parseInt(a[3]):m>100&&(l=m%100,m=parseInt(m/100)),l>=60)return null;if(m>24)return null;if(m>=12&&(h=1),null!=a[5]){if(m>12)return null;"'s ochtends"===(g=a[5].toLowerCase())||"in de ochtend"===g||"'s morgens"===g?(h=0,12==m&&(m=0)):(h=1,12!=m&&(m+=12))}if(u.start.assign("hour",m),u.start.assign("minute",l),h>=0?u.start.assign("meridiem",h):m<12?u.start.imply("meridiem",0):u.start.imply("meridiem",1),!(a=d.exec(e.substring(u.index+u.text.length))))return u.text.match(/^\d+$/)?null:u;if(a[0].match(/^\s*(\+|\-)\s*\d{3,4}$/))return u;null==u.end&&(u.end=new i(null,u.start.date()));m=0,l=0,h=-1;if(null!=a[4]){var c;if((c=parseInt(a[4]))>=60)return null;u.end.assign("second",c)}if(m=parseInt(a[2]),null!=a[3]){if((l=parseInt(a[3]))>=60)return u}else m>100&&(l=m%100,m=parseInt(m/100));if(l>=60)return null;if(m>24)return null;if(m>=12&&(h=1),null!=a[5]){if(m>12)return null;var g;"'s ochtends"===(g=a[5].toLowerCase())||"in de ochtend"===g||"'s morgens"===g?(h=0,12==m&&(m=0,u.end.isCertain("day")||u.end.imply("day",u.end.get("day")+1))):(h=1,12!=m&&(m+=12)),u.start.isCertain("meridiem")||(0==h?(u.start.imply("meridiem",0),12==u.start.get("hour")&&u.start.assign("hour",0)):(u.start.imply("meridiem",1),12!=u.start.get("hour")&&u.start.assign("hour",u.start.get("hour")+12)))}(u.text=u.text+a[0],u.end.assign("hour",m),u.end.assign("minute",l),h>=0)?u.end.assign("meridiem",h):u.start.isCertain("meridiem")&&1==u.start.get("meridiem")&&u.start.get("hour")>m?u.end.imply("meridiem",0):m>12&&u.end.imply("meridiem",1);return u.end.date().getTime()1?2:1,"day"):/^morgen/.test(u)?d.hour()>1&&(m=m.add(1,"day")):/^gisteren/.test(u)?m=m.add(-1,"day"):/^eergisteren/.test(u)?m=m.add(-2,"day"):/afgelopen\s*nacht/.test(u)?(o.start.imply("hour",0),d.hour()>6&&(m=m.add(-1,"day"))):"nu"===u&&(o.start.imply("hour",d.hour()),o.start.imply("minute",d.minute()),o.start.imply("second",d.second()),o.start.imply("millisecond",d.millisecond()));var l=a[3]||a[4]||a[5];if(l)switch(l.toLowerCase()){case"vroeg in de ochtend":o.start.imply("hour",6);break;case"ochtend":case"morgen":case"'s ochtends":case"'s morgends":o.start.imply("hour",9);break;case"tussen de middag":o.start.imply("hour",12);break;case"middag":case"in de middag":case"'s middags":o.start.imply("hour",15),o.start.imply("meridiem",1);break;case"avond":case"'s avonds":o.start.imply("hour",18),o.start.imply("meridiem",1);break;case"nacht":case"'s nachts":o.start.imply("hour",0)}return o.start.assign("day",m.date()),o.start.assign("month",m.month()+1),o.start.assign("year",m.year()),o.tags.NLCasualDateParser=!0,o}}},function(e,t,a){var r=a(1).Parser,n=a(0).ParsedResult,s=/(\W|^)((deze)?\s*('s morgens|'s ochtends|in de ochtend|'s middags|in de middag|'s avonds|in de avond|'s nachts|ochtend|tussen de middag|middag|avond|nacht))/i,i=4;t.Parser=function(){r.apply(this,arguments),this.pattern=function(){return s},this.extract=function(e,t,a,r){e=a[0].substr(a[1].length);var s=a.index+a[1].length,o=new n({index:s,text:e,ref:t});switch(a[i]||(i=3),a[i].toLowerCase()){case"middag":case"in de middag":case"'s middags":o.start.imply("meridiem",1),o.start.imply("hour",15);break;case"avond":case"in de avond":case"'s avonds":o.start.imply("meridiem",1),o.start.imply("hour",20);break;case"middernacht":case"nacht":case"'s nachts":o.start.imply("meridiem",0),o.start.imply("hour",0);break;case"ochtend":case"s morgens":case"s ochtends":case"in de ochtend":o.start.imply("meridiem",0),o.start.imply("hour",9);break;case"tussen de middag":o.start.imply("meridiem",0),o.start.imply("hour",12)}return o.tags.NLCasualTimeParser=!0,o}}},function(e,t,a){var r=a(3).Refiner;t.Refiner=function(){r.call(this),this.refine=function(e,t,a){if(t.length<2)return t;for(var r=[],n=t[0],s=1;sn.text.length&&(n=i):(r.push(n),n=i)}return null!=n&&r.push(n),r}}},function(e,t,a){var r=a(3).Refiner,n=new RegExp("^\\s*(GMT|UTC)?(\\+|\\-)(\\d{1,2}):?(\\d{2})","i");t.Refiner=function(){r.call(this),this.refine=function(e,t,a){return t.forEach((function(t){if(!t.start.isCertain("timezoneOffset")){var a=n.exec(e.substring(t.index+t.text.length));if(a){var r=60*parseInt(a[3])+parseInt(a[4]);"-"===a[2]&&(r=-r),null!=t.end&&t.end.assign("timezoneOffset",r),t.start.assign("timezoneOffset",r),t.text+=a[0],t.tags.ExtractTimezoneOffsetRefiner=!0}}})),t}}},function(e,t,a){var r=a(3).Refiner,n=new RegExp("^\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)","i"),s={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:60,CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:-300,FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:240,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:-480,PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360};t.Refiner=function(e){r.call(this,arguments),this.refine=function(e,t,a){var r=new Object(s);if(a.timezones)for(var i in a.timezones)r[i]=a.timezones[i];return t.forEach((function(t){if(t.tags.ENTimeExpressionParser||t.tags.ENCasualTimeParser||t.tags.ZHTimeExpressionParser||t.tags.FRTimeExpressionParser||t.tags.DETimeExpressionParser){var a=n.exec(e.substring(t.index+t.text.length));if(a){var s=a[1].toUpperCase();if(void 0===r[s])return;var i=r[s];t.start.isCertain("timezoneOffset")||t.start.assign("timezoneOffset",i),null==t.end||t.end.isCertain("timezoneOffset")||t.end.assign("timezoneOffset",i),t.text+=a[0],t.tags.ExtractTimezoneAbbrRefiner=!0}}})),t}}},function(e,t,a){var r=a(2),n=a(3).Refiner;t.Refiner=function(){n.call(this),this.refine=function(e,t,a){return a.forwardDate?(t.forEach((function(e){var t=r(e.ref);if(e.start.isOnlyDayMonthComponent()&&t.isAfter(e.start.dayjs())){for(var a=0;a<3&&t.isAfter(e.start.dayjs());a++)e.start.imply("year",e.start.get("year")+1),e.end&&!e.end.isCertain("year")&&e.end.imply("year",e.end.get("year")+1);e.tags.ForwardDateRefiner=!0}e.start.isOnlyWeekdayComponent()&&t.isAfter(e.start.dayjs())&&(t=t.day()>e.start.get("weekday")?t.day(e.start.get("weekday")+7):t.day(e.start.get("weekday")),e.start.imply("day",t.date()),e.start.imply("month",t.month()+1),e.start.imply("year",t.year()),e.tags.ForwardDateRefiner=!0)})),t):t}}},function(e,t,a){var r=a(3).Filter;t.Refiner=function(){r.call(this),this.isValid=function(e,t,a){return!t.text.replace(" ","").match(/^\d*(\.\d*)?$/)}}},function(e,t,a){a(0).ParsedComponents;var r=a(3).Refiner,n=new RegExp("^\\s*(at|after|before|on|,|-|\\(|\\))?\\s*$");function s(e,t){var a=!1;return e.start.isCertain("year")&&(t.start.isCertain("year")?e.start.isCertain("month")&&(t.start.isCertain("month")?e.start.isCertain("day")&&!t.start.isCertain("day")&&(a=!0):a=!0):a=!0),a}function i(e,t,a){var r=e.substring(t.index+t.text.length,a.index),s=t.tags.ENRelativeDateFormatParser||a.tags.ENRelativeDateFormatParser,i=!t.start.isCertain("day")&&!t.start.isCertain("month")&&!t.start.isCertain("year");return t.start.isCertain("year")&&a.start.isCertain("year")&&(i=t.start.get("year")===a.start.get("year")),t.start.isCertain("month")&&a.start.isCertain("month")&&(i=t.start.get("month")===a.start.get("month")&&i),s&&r.match(n)&&i}function o(e,t,a){t.start,a.start;var r=Math.min(t.index,a.index),n=Math.max(t.index+t.text.length,a.index+a.text.length);for(var s in t.index=r,t.text=e.substring(r,n),a.tags)t.tags[s]=!0;return t.tags.ENPrioritizeSpecificDateRefiner=!0,t}t.Refiner=function(){r.call(this),this.refine=function(e,t,a){if(t.length<2)return t;for(var r=[],n=null,d=null,u=1;ua.start.date()){var n=a;a=t,t=n}for(var s in t.end=a.start,a.tags)t.tags[s]=!0;var i=Math.min(t.index,a.index),o=Math.max(t.index+t.text.length,a.index+a.text.length);return t.index=i,t.text=e.substring(i,o),t.tags[this.constructor.name]=!0,t}}},function(e,t,a){a(0).ParsedComponents;var r=a(3).Refiner,n=a(5).mergeDateTimeComponent,s=new RegExp("^\\s*(T|à|a|vers|de|,|-)?\\s*$");function i(e){return!e.start.isCertain("hour")||e.tags.FRCasualDateParser}function o(e){return!e.start.isCertain("month")&&!e.start.isCertain("weekday")}function d(e,t,a){return e.substring(t.index+t.text.length,a.index).match(s)}function u(e,t,a){var r=t.start,s=a.start,i=n(r,s);if(null!=t.end||null!=a.end){var o=null==t.end?t.start:t.end,d=null==a.end?a.start:a.end,u=n(o,d);null==t.end&&u.date().getTime()=e?t:\"\"+Array(e+1-r.length).join(n)+t},d={s:c,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+c(r,2,\"0\")+\":\"+c(i,2,\"0\")},m:function(t,e){var n=12*(e.year()-t.year())+(e.month()-t.month()),r=t.clone().add(n,u),i=e-r<0,s=t.clone().add(n+(i?-1:1),u);return Number(-(n+(e-r)/(i?r-s:s-r))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:a,w:s,d:i,D:\"date\",h:r,m:n,s:e,ms:t,Q:o}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof v},M=function(t,e,n){var r;if(!t)return l;if(\"string\"==typeof t)m[t]&&(r=t),e&&(m[t]=e,r=t);else{var i=t.name;m[i]=t,r=i}return!n&&r&&(l=r),r||!n&&l},g=function(t,e){if(y(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new v(n)},D=d;D.l=M,D.i=y,D.w=function(t,e){return g(t,{locale:e.$L,utc:e.$u,$offset:e.$offset})};var v=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0),this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(D.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match(h);if(r)return n?new Date(Date.UTC(r[1],r[2]-1,r[3]||1,r[4]||0,r[5]||0,r[6]||0,r[7]||0)):new Date(r[1],r[2]-1,r[3]||1,r[4]||0,r[5]||0,r[6]||0,r[7]||0)}return new Date(e)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,e){var n=g(t);return this.startOf(e)<=n&&n<=this.endOf(e)},d.isAfter=function(t,e){return g(t) toResult.start.date().getTime()) {\n \n var fromMoment = fromResult.start.dayjs();\n var toMoment = toResult.start.dayjs();\n\n if (fromResult.isOnlyWeekday() && fromMoment.add(-7, 'days').isBefore(toMoment)) {\n fromMoment = fromMoment.add(-7, 'days');\n fromResult.start.imply('day', fromMoment.date());\n fromResult.start.imply('month', fromMoment.month() + 1);\n fromResult.start.imply('year', fromMoment.year());\n } else if (toResult.isOnlyWeekday() && toMoment.add(7, 'days').isAfter(fromMoment)) {\n toMoment = toMoment.add(7, 'days');\n toResult.start.imply('day', toMoment.date());\n toResult.start.imply('month', toMoment.month() + 1);\n toResult.start.imply('year', toMoment.year());\n } else {\n var tmp = toResult;\n toResult = fromResult;\n fromResult = tmp;\n }\n }\n \n fromResult.end = toResult.start;\n\n \n\n for (var tag in toResult.tags) {\n fromResult.tags[tag] = true;\n }\n\n \n var startIndex = Math.min(fromResult.index, toResult.index);\n var endIndex = Math.max(\n fromResult.index + fromResult.text.length, \n toResult.index + toResult.text.length);\n \n fromResult.index = startIndex;\n fromResult.text = text.substring(startIndex, endIndex);\n fromResult.tags[this.constructor.name] = true;\n return fromResult;\n }\n};\n\n","exports.WEEKDAY_OFFSET = { \r\n 'dimanche': 0, \r\n 'dim': 0, \r\n 'lundi': 1, \r\n 'lun': 1,\r\n 'mardi': 2, \r\n 'mar':2, \r\n 'mercredi': 3, \r\n 'mer': 3, \r\n 'jeudi': 4, \r\n 'jeu': 4, \r\n 'vendredi': 5, \r\n 'ven': 5,\r\n 'samedi': 6, \r\n 'sam': 6\r\n};\r\n \r\nexports.MONTH_OFFSET = { \r\n 'janvier': 1,\r\n 'jan': 1,\r\n 'jan.': 1,\r\n 'février': 2,\r\n 'fév': 2,\r\n 'fév.': 2,\r\n 'fevrier': 2,\r\n 'fev': 2,\r\n 'fev.': 2,\r\n 'mars': 3,\r\n 'mar': 3,\r\n 'mar.': 3,\r\n 'avril': 4,\r\n 'avr': 4,\r\n 'avr.': 4,\r\n 'mai': 5,\r\n 'juin': 6,\r\n 'jun': 6,\r\n 'juillet': 7,\r\n 'jul': 7,\r\n 'jul.': 7,\r\n 'août': 8,\r\n 'aout': 8,\r\n 'septembre': 9,\r\n 'sep': 9,\r\n 'sep.': 9,\r\n 'sept': 9,\r\n 'sept.': 9,\r\n 'octobre': 10,\r\n 'oct': 10,\r\n 'oct.': 10,\r\n 'novembre': 11,\r\n 'nov': 11,\r\n 'nov.': 11,\r\n 'décembre': 12,\r\n 'decembre': 12,\r\n 'dec': 12,\r\n 'dec.': 12\r\n};\r\n\r\nexports.INTEGER_WORDS_PATTERN = '(?:un|deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize)';\r\nexports.INTEGER_WORDS = {\r\n 'un' : 1,\r\n 'deux' : 2,\r\n 'trois' : 3,\r\n 'quatre' : 4,\r\n 'cinq' : 5,\r\n 'six' : 6,\r\n 'sept' : 7,\r\n 'huit' : 8,\r\n 'neuf' : 9,\r\n 'dix' : 10,\r\n 'onze' : 11,\r\n 'douze' : 12,\r\n 'treize' : 13,\r\n};\r\n","exports.WEEKDAY_OFFSET = {\n 'zondag': 0,\n 'zo': 0,\n 'zo.': 0,\n 'maandag': 1,\n 'ma': 1,\n 'ma.': 1,\n 'dinsdag': 2,\n 'di':2,\n 'di.':2,\n 'woensdag': 3,\n 'wo': 3,\n 'wo.': 3,\n 'donderdag': 4,\n 'do': 4,\n 'do.': 4,\n 'vrijdag': 5,\n 'vr': 5,\n 'vr.': 5,\n 'zaterdag': 6,\n 'za': 6,\n 'za.': 6\n};\n\nexports.WEEKDAY_PATTERN = '(?:'\n + Object.keys(exports.WEEKDAY_OFFSET).join('|').replace(/\\./g, '\\\\.')\n + ')';\n\nexports.MONTH_OFFSET = {\n 'januari': 1,\n 'jan': 1,\n 'jan.': 1,\n 'februari': 2,\n 'feb': 2,\n 'feb.': 2,\n 'maart': 3,\n 'mrt': 3,\n 'mrt.': 3,\n 'april': 4,\n 'apr': 4,\n 'apr.': 4,\n 'mei': 5,\n 'juni': 6,\n 'jun': 6,\n 'jun.': 6,\n 'juli': 7,\n 'jul': 7,\n 'jul.': 7,\n 'augustus': 8,\n 'aug': 8,\n 'aug.': 8,\n 'september': 9,\n 'sep': 9,\n 'sep.': 9,\n 'sept': 9,\n 'sept.': 9,\n 'oktober': 10,\n 'okt': 10,\n 'okt.': 10,\n 'november': 11,\n 'nov': 11,\n 'nov.': 11,\n 'december': 12,\n 'dec': 12,\n 'dec.': 12\n};\n\nexports.MONTH_PATTERN = '(?:'\n + Object.keys(exports.MONTH_OFFSET).join('|').replace(/\\./g, '\\\\.')\n + ')';\n\nexports.INTEGER_WORDS = {\n 'een' : 1,\n 'één' : 1,\n 'twee' : 2,\n 'drie' : 3,\n 'vier' : 4,\n 'vijf' : 5,\n 'zes' : 6,\n 'zeven' : 7,\n 'acht' : 8,\n 'negen' : 9,\n 'tien' : 10,\n 'elf' : 11,\n 'twaalf' : 12\n};\nexports.INTEGER_WORDS_PATTERN = '(?:'\n + Object.keys(exports.INTEGER_WORDS).join('|')\n +')';\n\nexports.ORDINAL_WORDS = {\n 'eerste' : 1,\n 'tweede': 2,\n 'derde': 3,\n 'vierde': 4,\n 'vijfde': 5,\n 'zesde': 6,\n 'zevende': 7,\n 'achste': 8,\n 'negende': 9,\n 'tiende': 10,\n 'elfde': 11,\n 'twaalfde': 12,\n 'dertiende': 13,\n 'veertiende': 14,\n 'vijftiende': 15,\n 'zestiende': 16,\n 'zeventiende': 17,\n 'achttiende': 18,\n 'negentiende': 19,\n 'twintigste': 20,\n 'eenentwintigste': 21,\n 'tweeëntwintigste': 22,\n 'drieëntwintigste': 23,\n 'vierentwintigste': 24,\n 'vijfentwintigste': 25,\n 'zesentwintigste': 26,\n 'zevenentwintigste': 27,\n 'achtentwintigste': 28,\n 'negenentwintigste': 29,\n 'dertigste': 30,\n 'eenendertigste': 31\n};\nexports.ORDINAL_WORDS_PATTERN = '(?:'\n + Object.keys(exports.ORDINAL_WORDS).join('|').replace(/ /g, '[ -]')\n + ')';\n\nvar TIME_UNIT =\n '(' + exports.INTEGER_WORDS_PATTERN + '|[0-9]+|[0-9]+\\.[0-9]+|en(?:\\\\s*few)?|half)\\\\s*' +\n '(sec(?:onde?)?|min(?:uten)?s?|(?:uur|uren)?|weken?|dagen?|maanden?|jaren?)\\\\s*';\n\nvar TIME_UNIT_STRICT =\n '(?:[0-9]+?)\\\\s*' +\n '(?:seconden?|(?:minuut|minuten)|(?:uur|uren)|(?:dag|dagen))\\\\s*';\n\nvar PATTERN_TIME_UNIT = new RegExp(TIME_UNIT, 'i');\n\nexports.TIME_UNIT_PATTERN = '(?:' + TIME_UNIT + ')+';\nexports.TIME_UNIT_STRICT_PATTERN = '(?:' + TIME_UNIT_STRICT + ')+';\n\nexports.extractDateTimeUnitFragments = function (timeunitText) {\n var fragments = {};\n var remainingText = timeunitText;\n var match = PATTERN_TIME_UNIT.exec(remainingText);\n while (match) {\n collectDateTimeFragment(match, fragments);\n remainingText = remainingText.substring(match[0].length);\n match = PATTERN_TIME_UNIT.exec(remainingText);\n }\n return fragments;\n};\n\nfunction collectDateTimeFragment(match, fragments) {\n var num = match[1].toLowerCase() ;\n if (exports.INTEGER_WORDS[num] !== undefined) {\n num = exports.INTEGER_WORDS[num];\n } else if (num.match(/half/)) {\n num = 0.5;\n } else {\n num = parseFloat(num);\n }\n\n if (match[2].match(/^(?:uur|uren)/i)) {\n fragments['hour'] = num;\n } else if (match[2].match(/min/i)) {\n fragments['minute'] = num;\n } else if (match[2].match(/sec/i)) {\n fragments['second'] = num;\n } else if (match[2].match(/week/i)) {\n fragments['week'] = num;\n } else if (match[2].match(/dag/i)) {\n fragments['d'] = num;\n } else if (match[2].match(/maand/i)) {\n fragments['month'] = num;\n } else if (match[2].match(/jaar/i)) {\n fragments['year'] = num;\n }\n\n return fragments;\n}\n","\nvar options = exports.options = require('./options');\n\nexports.parser = require('./parsers/parser');\nexports.refiner = require('./refiners/refiner');\n\nexports.Parser = exports.parser.Parser;\nexports.Refiner = exports.refiner.Refiner;\nexports.Filter = exports.refiner.Filter;\n\nexports.ParsedResult = require('./result').ParsedResult;\nexports.ParsedComponents = require('./result').ParsedComponents;\n\nvar Chrono = function(option) {\n\n option = option || exports.options.casualOption();\n this.parsers = new Object(option.parsers);\n this.refiners = new Object(option.refiners);\n};\n\n\nChrono.prototype.parse = function(text, refDate, opt) {\n\n refDate = refDate || new Date();\n opt = opt || {};\n opt.forwardDate = opt.forwardDate || opt.forwardDate;\n \n var allResults = [];\n\n this.parsers.forEach(function (parser) {\n var results = parser.execute(text, refDate, opt);\n allResults = allResults.concat(results);\n });\n\n allResults.sort(function(a, b) {\n return a.index - b.index;\n });\n\n this.refiners.forEach(function (refiner) {\n allResults = refiner.refine(text, allResults, opt);\n });\n \n return allResults;\n};\n\n\nChrono.prototype.parseDate = function(text, refDate, opt) {\n var results = this.parse(text, refDate, opt);\n if (results.length > 0) {\n return results[0].start.date();\n }\n return null;\n};\n\nexports.Chrono = Chrono;\nexports.strict = new Chrono( options.strictOption() );\nexports.casual = new Chrono( options.casualOption() );\n\nexports.en = new Chrono( options.mergeOptions([\n options.en.casual, options.commonPostProcessing]));\n\nexports.en_GB = new Chrono( options.mergeOptions([\n options.en_GB.casual, options.commonPostProcessing]));\n\nexports.de = new Chrono( options.mergeOptions([\n options.de.casual, options.en, options.commonPostProcessing]));\n\nexports.nl = new Chrono( options.mergeOptions([\n options.nl.casual, options.en, options.commonPostProcessing]));\n\nexports.pt = new Chrono( options.mergeOptions([\n options.pt.casual, options.en, options.commonPostProcessing]));\n\nexports.es = new Chrono( options.mergeOptions([\n options.es.casual, options.en, options.commonPostProcessing]));\n\nexports.fr = new Chrono( options.mergeOptions([\n options.fr.casual, options.en, options.commonPostProcessing]));\n\nexports.ja = new Chrono( options.mergeOptions([ \n options.ja.casual, options.en, options.commonPostProcessing]));\n\n\nexports.parse = function () {\n return exports.casual.parse.apply(exports.casual, arguments);\n};\n\nexports.parseDate = function () {\n return exports.casual.parseDate.apply(exports.casual, arguments);\n};\n\n\n\n\n","var parser = require('./parsers/parser');\nvar refiner = require('./refiners/refiner');\n\n\nexports.mergeOptions = function(options) {\n\n var addedTypes = {};\n var mergedOption = {\n parsers: [],\n refiners: []\n };\n\n options.forEach(function (option) {\n\n if (option.call) {\n option = option.call();\n }\n\n if (option.parsers) {\n option.parsers.forEach(function (p) {\n if (!addedTypes[p.constructor]) {\n mergedOption.parsers.push(p);\n addedTypes[p.constructor] = true;\n }\n });\n }\n\n if (option.refiners) {\n option.refiners.forEach(function (r) {\n if (!addedTypes[r.constructor]) {\n mergedOption.refiners.push(r);\n addedTypes[r.constructor] = true;\n }\n });\n }\n });\n\n return mergedOption;\n};\n\n\nexports.commonPostProcessing = function() {\n return {\n refiners: [\n // These should be after all other refiners\n new refiner.ExtractTimezoneOffsetRefiner(),\n new refiner.ExtractTimezoneAbbrRefiner(),\n new refiner.UnlikelyFormatFilter()\n ]\n }\n};\n\n\n// -------------------------------------------------------------\n\nexports.strictOption = function () {\n var strictConfig = {\n strict: true\n };\n\n return exports.mergeOptions([\n exports.en(strictConfig),\n exports.de(strictConfig),\n exports.nl(strictConfig),\n exports.pt(strictConfig),\n exports.es(strictConfig),\n exports.fr(strictConfig),\n exports.ja(strictConfig),\n exports.zh,\n exports.commonPostProcessing\n ]);\n};\n\nexports.casualOption = function () {\n return exports.mergeOptions([\n exports.en.casual,\n // Some German abbriviate overlap with common English\n exports.de({ strict: true }),\n exports.nl,\n exports.pt,\n exports.es,\n exports.fr,\n exports.ja,\n exports.zh,\n exports.commonPostProcessing\n ]);\n};\n\n// -------------------------------------------------------------\n\nexports.de = function(config) {\n return {\n parsers: [\n new parser.DEDeadlineFormatParser(config),\n new parser.DEMonthNameLittleEndianParser(config),\n new parser.DEMonthNameParser(config),\n new parser.DESlashDateFormatParser(config),\n new parser.DETimeAgoFormatParser(config),\n new parser.DETimeExpressionParser(config)\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner(),\n new refiner.DEMergeDateTimeRefiner(),\n new refiner.DEMergeDateRangeRefiner()\n ]\n }\n};\n\nexports.de.casual = function() {\n var option = exports.de({\n strict: false\n });\n option.parsers.unshift(new parser.DECasualDateParser());\n option.parsers.unshift(new parser.DEWeekdayParser());\n return option;\n};\n\n\n\n// -------------------------------------------------------------\n\nexports.nl = function(config) {\n return {\n parsers: [\n new parser.NLMonthNameLittleEndianParser(config),\n new parser.NLMonthNameParser(config),\n new parser.NLSlashDateFormatParser(config),\n new parser.NLTimeExpressionParser(config),\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner(),\n new refiner.NLMergeDateTimeRefiner(),\n new refiner.NLMergeDateRangeRefiner()\n ]\n }\n};\n\nexports.nl.casual = function() {\n var option = exports.nl({\n strict: false\n });\n option.parsers.unshift(new parser.NLCasualDateParser());\n option.parsers.unshift(new parser.NLCasualTimeParser());\n option.parsers.unshift(new parser.NLWeekdayParser());\n return option;\n};\n\n\n\n// -------------------------------------------------------------\n\n\nexports.en = function(config) {\n return {\n parsers: [\n new parser.ENISOFormatParser(config),\n new parser.ENDeadlineFormatParser(config),\n new parser.ENMonthNameLittleEndianParser(config),\n new parser.ENMonthNameMiddleEndianParser(config),\n new parser.ENMonthNameParser(config),\n new parser.ENSlashDateFormatParser(config),\n new parser.ENSlashDateFormatStartWithYearParser(config),\n new parser.ENSlashMonthFormatParser(config),\n new parser.ENTimeAgoFormatParser(config),\n new parser.ENTimeLaterFormatParser(config),\n new parser.ENTimeExpressionParser(config)\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner(),\n\n // English\n new refiner.ENMergeDateTimeRefiner(),\n new refiner.ENMergeDateRangeRefiner(),\n new refiner.ENPrioritizeSpecificDateRefiner()\n ]\n }\n};\n\nexports.en.casual = function(config) {\n config = config || {};\n config.strict = false;\n var option = exports.en(config);\n\n // en\n option.parsers.unshift(new parser.ENCasualDateParser());\n option.parsers.unshift(new parser.ENCasualTimeParser());\n option.parsers.unshift(new parser.ENWeekdayParser());\n option.parsers.unshift(new parser.ENRelativeDateFormatParser());\n return option;\n};\n\n\nexports.en_GB = function(config) {\n config = config || {};\n config.littleEndian = true;\n return exports.en(config);\n}\n\nexports.en_GB.casual = function(config) {\n config = config || {};\n config.littleEndian = true;\n return exports.en.casual(config);\n}\n\n// -------------------------------------------------------------\n\nexports.ja = function() {\n return {\n parsers: [\n new parser.JPStandardParser()\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner(),\n new refiner.JPMergeDateRangeRefiner()\n ]\n }\n};\n\nexports.ja.casual = function() {\n var option = exports.ja();\n option.parsers.unshift(new parser.JPCasualDateParser());\n return option;\n};\n\n// -------------------------------------------------------------\n\n\nexports.pt = function(config) {\n return {\n parsers: [\n new parser.PTTimeAgoFormatParser(config),\n new parser.PTDeadlineFormatParser(config),\n new parser.PTTimeExpressionParser(config),\n new parser.PTMonthNameLittleEndianParser(config),\n new parser.PTSlashDateFormatParser(config)\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner()\n ]\n }\n};\n\nexports.pt.casual = function() {\n var option = exports.pt({\n strict: false\n });\n\n option.parsers.unshift(new parser.PTCasualDateParser());\n option.parsers.unshift(new parser.PTWeekdayParser());\n return option;\n};\n\n// -------------------------------------------------------------\n\n\nexports.es = function(config) {\n return {\n parsers: [\n new parser.ESTimeAgoFormatParser(config),\n new parser.ESDeadlineFormatParser(config),\n new parser.ESTimeExpressionParser(config),\n new parser.ESMonthNameLittleEndianParser(config),\n new parser.ESSlashDateFormatParser(config)\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner()\n ]\n }\n};\n\nexports.es.casual = function() {\n var option = exports.es({\n strict: false\n });\n\n option.parsers.unshift(new parser.ESCasualDateParser());\n option.parsers.unshift(new parser.ESWeekdayParser());\n return option;\n};\n\n\n// -------------------------------------------------------------\n\nexports.fr = function(config) {\n return {\n parsers: [\n new parser.FRDeadlineFormatParser(config),\n new parser.FRMonthNameLittleEndianParser(config),\n new parser.FRSlashDateFormatParser(config),\n new parser.FRTimeAgoFormatParser(config),\n new parser.FRTimeExpressionParser(config)\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner(),\n new refiner.FRMergeDateRangeRefiner(),\n new refiner.FRMergeDateTimeRefiner()\n ]\n }\n};\n\nexports.fr.casual = function() {\n var option = exports.fr({\n strict: false\n });\n\n option.parsers.unshift(new parser.FRCasualDateParser());\n option.parsers.unshift(new parser.FRWeekdayParser());\n option.parsers.unshift(new parser.FRRelativeDateFormatParser());\n return option;\n};\n\n\n// -------------------------------------------------------------\n\nexports.zh = function() {\n return {\n parsers: [\n new parser.ZHHantDateParser(),\n new parser.ZHHantWeekdayParser(),\n new parser.ZHHantTimeExpressionParser(),\n new parser.ZHHantCasualDateParser(),\n new parser.ZHHantDeadlineFormatParser()\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner()\n ]\n }\n};\n","/*\n ISO 8601\n http://www.w3.org/TR/NOTE-datetime\n - YYYY-MM-DD\n - YYYY-MM-DDThh:mmTZD\n - YYYY-MM-DDThh:mm:ssTZD\n - YYYY-MM-DDThh:mm:ss.sTZD \n - TZD = (Z or +hh:mm or -hh:mm)\n*/\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp('(\\\\W|^)' \n + '([0-9]{4})\\\\-([0-9]{1,2})\\\\-([0-9]{1,2})'\n + '(?:T' //..\n + '([0-9]{1,2}):([0-9]{1,2})' // hh:mm\n + '(?::([0-9]{1,2})(?:\\\\.(\\\\d{1,4}))?)?' // :ss.s\n + '(?:Z|([+-]\\\\d{2}):?(\\\\d{2})?)?' // TZD (Z or ±hh:mm or ±hhmm or ±hh)\n + ')?' //..\n + '(?=\\\\W|$)', 'i');\n\nvar YEAR_NUMBER_GROUP = 2;\nvar MONTH_NUMBER_GROUP = 3;\nvar DATE_NUMBER_GROUP = 4;\nvar HOUR_NUMBER_GROUP = 5;\nvar MINUTE_NUMBER_GROUP = 6;\nvar SECOND_NUMBER_GROUP = 7;\nvar MILLISECOND_NUMBER_GROUP = 8;\nvar TZD_HOUR_OFFSET_GROUP = 9;\nvar TZD_MINUTE_OFFSET_GROUP = 10;\n\nexports.Parser = function ENISOFormatParser(){\n Parser.apply(this, arguments);\n \n this.pattern = function() { return PATTERN; }\n \n this.extract = function(text, ref, match, opt){ \n \n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n })\n \n result.start.assign('year', parseInt(match[YEAR_NUMBER_GROUP]));\n result.start.assign('month', parseInt(match[MONTH_NUMBER_GROUP]));\n result.start.assign('day', parseInt(match[DATE_NUMBER_GROUP]));\n\n if (dayjs(result.start.get('month')) > 12 || dayjs(result.start.get('month')) < 1 ||\n dayjs(result.start.get('day')) > 31 || dayjs(result.start.get('day')) < 1) {\n return null;\n }\n\n if (match[HOUR_NUMBER_GROUP] != null) {\n \n result.start.assign('hour',\n parseInt(match[HOUR_NUMBER_GROUP]));\n result.start.assign('minute',\n parseInt(match[MINUTE_NUMBER_GROUP]));\n\n if (match[SECOND_NUMBER_GROUP] != null) {\n\n result.start.assign('second',\n parseInt(match[SECOND_NUMBER_GROUP]));\n }\n\n if (match[MILLISECOND_NUMBER_GROUP] != null) {\n\n result.start.assign('millisecond',\n parseInt(match[MILLISECOND_NUMBER_GROUP]));\n }\n\n if (match[TZD_HOUR_OFFSET_GROUP] == null) {\n\n result.start.assign('timezoneOffset', 0);\n } else {\n\n var minuteOffset = 0;\n var hourOffset = parseInt(match[TZD_HOUR_OFFSET_GROUP]);\n if (match[TZD_MINUTE_OFFSET_GROUP] != null)\n minuteOffset = parseInt(match[TZD_MINUTE_OFFSET_GROUP]);\n\n var offset = hourOffset * 60;\n if (offset < 0) {\n offset -= minuteOffset;\n } else {\n offset += minuteOffset;\n }\n\n result.start.assign('timezoneOffset', offset);\n }\n }\n \n result.tags['ENISOFormatParser'] = true;\n return result;\n };\n\n}\n\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(within|in)\\\\s*' +\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|an?(?:\\\\s*few)?|half(?:\\\\s*an?)?)\\\\s*' +\n '(seconds?|min(?:ute)?s?|hours?|days?|weeks?|months?|years?)\\\\s*' +\n '(?=\\\\W|$)', 'i'\n);\n\nvar STRICT_PATTERN = new RegExp('(\\\\W|^)' +\n '(within|in)\\\\s*' +\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|an?)\\\\s*' +\n '(seconds?|minutes?|hours?|days?)\\\\s*' +\n '(?=\\\\W|$)', 'i'\n);\n\nexports.Parser = function ENDeadlineFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return this.isStrictMode()? STRICT_PATTERN : PATTERN;\n };\n\n this.extract = function(text, ref, match, opt){\n\n var index = match.index + match[1].length;\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var num = match[3].toLowerCase();\n if (util.INTEGER_WORDS[num] !== undefined) {\n num = util.INTEGER_WORDS[num];\n } else if (num === 'a' || num === 'an'){\n num = 1;\n } else if (num.match(/few/i)){\n num = 3;\n } else if (num.match(/half/i)) {\n num = 0.5;\n } else {\n num = parseInt(num);\n }\n\n var date = dayjs(ref);\n if (match[4].match(/day|week|month|year/i)) {\n\n if (match[4].match(/day/i)) {\n date = date.add(num, 'd');\n } else if (match[4].match(/week/i)) {\n date = date.add(num * 7, 'd');\n } else if (match[4].match(/month/i)) {\n date = date.add(num, 'month');\n } else if (match[4].match(/year/i)) {\n date = date.add(num, 'year');\n }\n\n result.start.imply('year', date.year());\n result.start.imply('month', date.month() + 1);\n result.start.imply('day', date.date());\n return result;\n }\n\n if (match[4].match(/hour/i)) {\n\n date = date.add(num, 'hour');\n\n } else if (match[4].match(/min/i)) {\n\n date = date.add(num, 'minute');\n\n } else if (match[4].match(/second/i)) {\n\n date = date.add(num, 'second');\n }\n\n result.start.imply('year', date.year());\n result.start.imply('month', date.month() + 1);\n result.start.imply('day', date.date());\n result.start.imply('hour', date.hour());\n result.start.imply('minute', date.minute());\n result.start.imply('second', date.second());\n result.tags['ENDeadlineFormatParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(this|next|last|past)\\\\s*' +\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|few|half(?:\\\\s*an?)?)?\\\\s*' +\n '(seconds?|min(?:ute)?s?|hours?|days?|weeks?|months?|years?)(?=\\\\s*)' +\n '(?=\\\\W|$)', 'i'\n);\n\nvar MODIFIER_WORD_GROUP = 2;\nvar MULTIPLIER_WORD_GROUP = 3;\nvar RELATIVE_WORD_GROUP = 4;\n\nexports.Parser = function ENRelativeDateFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; };\n\n this.extract = function(text, ref, match, opt){\n\n var index = match.index + match[1].length;\n var modifier = match[MODIFIER_WORD_GROUP].toLowerCase().match(/^next/) ? 1 : -1;\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n result.tags['ENRelativeDateFormatParser'] = true;\n\n var num = match[MULTIPLIER_WORD_GROUP] === undefined ? '' : match[3].toLowerCase();\n if (util.INTEGER_WORDS[num] !== undefined) {\n num = util.INTEGER_WORDS[num];\n } else if (num === ''){\n num = 1;\n } else if (num.match(/few/i)){\n num = 3;\n } else if (num.match(/half/i)) {\n num = 0.5;\n } else {\n num = parseInt(num);\n }\n\n num *= modifier;\n var date = dayjs(ref);\n\n if (match[MODIFIER_WORD_GROUP].toLowerCase().match(/^this/)) {\n\n if (match[MULTIPLIER_WORD_GROUP]) {\n return null;\n }\n\n if (match[RELATIVE_WORD_GROUP].match(/day|week|month|year/i)) {\n \n // This week\n if (match[RELATIVE_WORD_GROUP].match(/week/i)) {\n date = date.add(-date.get('d'), 'd');\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n } \n \n // This month\n else if (match[RELATIVE_WORD_GROUP].match(/month/i)) {\n date = date.add(-date.date() + 1, 'd');\n result.start.imply('day', date.date());\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n } \n\n // This year\n else if (match[RELATIVE_WORD_GROUP].match(/year/i)) {\n date = date.add(-date.date() + 1, 'd');\n date = date.add(-date.month(), 'month');\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.assign('year', date.year());\n } \n\n return result;\n }\n }\n \n if (match[RELATIVE_WORD_GROUP].match(/day|week|month|year/i)) {\n\n if (match[RELATIVE_WORD_GROUP].match(/day/i)) {\n date = date.add(num, 'd');\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n } else if (match[RELATIVE_WORD_GROUP].match(/week/i)) {\n date = date.add(num * 7, 'd');\n // We don't know the exact date for next/last week so we imply\n // them\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n } else if (match[RELATIVE_WORD_GROUP].match(/month/i)) {\n date = date.add(num, 'month');\n // We don't know the exact day for next/last month\n result.start.imply('day', date.date());\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n } else if (match[RELATIVE_WORD_GROUP].match(/year/i)) {\n date = date.add(num, 'year');\n // We don't know the exact day for month on next/last year\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.assign('year', date.year());\n }\n\n return result;\n }\n\n if (match[RELATIVE_WORD_GROUP].match(/hour/i)) {\n\n date = date.add(num, 'hour');\n result.start.imply('minute', date.minute());\n result.start.imply('second', date.second());\n\n } else if (match[RELATIVE_WORD_GROUP].match(/min/i)) {\n\n date = date.add(num, 'minute');\n result.start.assign('minute', date.minute());\n result.start.imply('second', date.second());\n\n } else if (match[RELATIVE_WORD_GROUP].match(/second/i)) {\n\n date = date.add(num, 'second');\n result.start.assign('second', date.second());\n result.start.assign('minute', date.minute());\n }\n\n result.start.assign('hour', date.hour());\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n return result;\n };\n};\n","const parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:on\\\\s*?)?' +\n '(?:(Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sun|Mon|Tue|Wed|Thu|Fri|Sat)\\\\s*,?\\\\s*)?' +\n '(([0-9]{1,2})(?:st|nd|rd|th)?|' + util.ORDINAL_WORDS_PATTERN + ')' +\n '(?:\\\\s*' +\n '(?:to|\\\\-|\\\\–|until|through|till|\\\\s)\\\\s*' +\n '(([0-9]{1,2})(?:st|nd|rd|th)?|' + util.ORDINAL_WORDS_PATTERN + ')' +\n ')?' + \n '(?:-|\\/|\\\\s*(?:of)?\\\\s*)' +\n '(' + util.MONTH_PATTERN + ')' +\n '(?:' +\n '(?:-|\\/|,?\\\\s*)' +\n '((?:' + \n '[1-9][0-9]{0,3}\\\\s*(?:BE|AD|BC)|' +\n '[1-2][0-9]{3}|' +\n '[5-9][0-9]' +\n ')(?![^\\\\s]\\\\d))' +\n ')?' +\n '(?=\\\\W|$)', 'i'\n );\n\nvar WEEKDAY_GROUP = 2;\nvar DATE_GROUP = 3;\nvar DATE_NUM_GROUP = 4;\nvar DATE_TO_GROUP = 5;\nvar DATE_TO_NUM_GROUP = 6;\nvar MONTH_NAME_GROUP = 7;\nvar YEAR_GROUP = 8;\n\nexports.Parser = function ENMonthNameLittleEndianParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref\n });\n\n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n\n var day = match[DATE_NUM_GROUP] ?\n parseInt(match[DATE_NUM_GROUP]):\n util.ORDINAL_WORDS[match[DATE_GROUP].trim().replace('-', ' ').toLowerCase()];\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n \n if (/BE/i.test(year)) {\n // Buddhist Era\n year = year.replace(/BE/i, '');\n year = parseInt(year) - 543;\n } else if (/BC/i.test(year)){\n // Before Christ\n year = year.replace(/BC/i, '');\n year = -parseInt(year);\n } else if (/AD/i.test(year)){\n year = year.replace(/AD/i, '');\n year = parseInt(year);\n } else {\n year = parseInt(year);\n if (year < 100){\n if (year > 50) {\n year = year + 1900;\n } else {\n year = year + 2000;\n }\n }\n }\n }\n\n if(year){\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month);\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n // Weekday component\n if (match[WEEKDAY_GROUP]) {\n var weekday = match[WEEKDAY_GROUP];\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()]\n result.start.assign('weekday', weekday);\n }\n\n // Text can be 'range' value. Such as '12 - 13 January 2012'\n if (match[DATE_TO_GROUP]) {\n var endDate = match[DATE_TO_NUM_GROUP] ?\n parseInt(match[DATE_TO_NUM_GROUP]):\n util.ORDINAL_WORDS[match[DATE_TO_GROUP].trim().replace('-', ' ').toLowerCase()];\n\n result.end = result.start.clone();\n result.end.assign('day', endDate);\n }\n\n result.tags['ENMonthNameLittleEndianParser'] = true;\n return result;\n };\n};\n","/*\n\n The parser for parsing US's date format that begin with month's name.\n\n EX.\n - January 13\n - January 13, 2012\n - January 13 - 15, 2012\n - Tuesday, January 13, 2012\n\n Watch out for:\n - January 12:00\n - January 12.44\n - January 1222344\n*/\nvar parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:' +\n '(?:on\\\\s*?)?' +\n '(Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sun\\\\.?|Mon\\\\.?|Tue\\\\.?|Wed\\\\.?|Thu\\\\.?|Fri\\\\.?|Sat\\\\.?)' +\n '\\\\s*,?\\\\s*)?' +\n '(' + util.MONTH_PATTERN + ')' +\n '(?:-|\\/|\\\\s*,?\\\\s*)' +\n '(([0-9]{1,2})(?:st|nd|rd|th)?|' + util.ORDINAL_WORDS_PATTERN +')(?!\\\\s*(?:am|pm))\\\\s*' + '' + \n '(?:' +\n '(?:to|\\\\-)\\\\s*' +\n '(([0-9]{1,2})(?:st|nd|rd|th)?| ' + util.ORDINAL_WORDS_PATTERN + ')\\\\s*' +\n ')?' +\n '(?:' +\n '(?:-|\\/|\\\\s*,?\\\\s*)' +\n '(?:([0-9]{4})\\\\s*(BE|AD|BC)?|([0-9]{1,4})\\\\s*(AD|BC))\\\\s*' +\n ')?' +\n '(?=\\\\W|$)(?!\\\\:\\\\d)', 'i');\n\nvar WEEKDAY_GROUP = 2;\nvar MONTH_NAME_GROUP = 3;\nvar DATE_GROUP = 4;\nvar DATE_NUM_GROUP = 5;\nvar DATE_TO_GROUP = 6;\nvar DATE_TO_NUM_GROUP = 7;\nvar YEAR_GROUP = 8;\nvar YEAR_BE_GROUP = 9;\nvar YEAR_GROUP2 = 10;\nvar YEAR_BE_GROUP2 = 11;\n\nexports.Parser = function ENMonthNameMiddleEndianParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n\n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n var day = match[DATE_NUM_GROUP] ?\n parseInt(match[DATE_NUM_GROUP]) :\n util.ORDINAL_WORDS[match[DATE_GROUP].trim().replace('-', ' ').toLowerCase()];\n\n var year = null;\n if (match[YEAR_GROUP] || match[YEAR_GROUP2]) {\n year = match[YEAR_GROUP] || match[YEAR_GROUP2];\n year = parseInt(year);\n\n var yearBE = match[YEAR_BE_GROUP] || match[YEAR_BE_GROUP2];\n if (yearBE) {\n if (/BE/i.test(yearBE)) {\n // Buddhist Era\n year = year - 543;\n } else if (/BC/i.test(yearBE)) {\n // Before Christ\n year = -year;\n }\n } else if (year < 100){\n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month)\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n // Weekday component\n if (match[WEEKDAY_GROUP]) {\n var weekday = match[WEEKDAY_GROUP];\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()]\n result.start.assign('weekday', weekday);\n }\n\n // Text can be 'range' value. Such as 'January 12 - 13, 2012'\n if (match[DATE_TO_GROUP]) {\n var endDate = match[DATE_TO_NUM_GROUP] ?\n endDate = parseInt(match[DATE_TO_NUM_GROUP]) :\n util.ORDINAL_WORDS[match[DATE_TO_GROUP].replace('-', ' ').trim().toLowerCase()];\n\n result.end = result.start.clone();\n result.end.assign('day', endDate);\n }\n\n result.tags['ENMonthNameMiddleEndianParser'] = true;\n return result;\n }\n};","/*\n \n The parser for parsing month name and year.\n \n EX. \n - January\n - January 2012\n - January, 2012\n*/\nvar parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('(^|\\\\D\\\\s+|[^\\\\w\\\\s])' +\n '('+ util.MONTH_PATTERN +')' + \n '\\\\s*' +\n '(?:' +\n '[,-]?\\\\s*([0-9]{4})(\\\\s*BE|AD|BC)?' +\n ')?' +\n '(?=[^\\\\s\\\\w]|\\\\s+[^0-9]|\\\\s+$|$)', 'i');\n\nvar MONTH_NAME_GROUP = 2;\nvar YEAR_GROUP = 3;\nvar YEAR_BE_GROUP = 4;\n\nexports.Parser = function ENMonthNameParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n \n this.extract = function(text, ref, match, opt){\n const result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n const day = 1;\n const monthName = match[MONTH_NAME_GROUP];\n const month = util.MONTH_OFFSET[monthName.toLowerCase()];\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n year = parseInt(year);\n\n if(match[YEAR_BE_GROUP]){\n if (match[YEAR_BE_GROUP].match(/BE/)) {\n // Buddhist Era\n year = year - 543;\n } else if (match[YEAR_BE_GROUP].match(/BC/)) {\n // Before Christ\n year = -year;\n }\n\n } else if (year < 100){ \n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month)\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n if (result.text.match(/^\\w{3}$/)) {\n return false;\n }\n\n result.tags['ENMonthNameParser'] = true;\n return result;\n }\n}\n","/*\n Date format with slash \"/\" (also \"-\" and \".\") between numbers\n - Tuesday 11/3/2015 \n - 11/3/2015\n - 11/3\n\n By default the paser us \"middle-endien\" format (US English),\n then fallback to little-endian if failed.\n - 11/3/2015 = November 3rd, 2015\n - 23/4/2015 = April 23th, 2015\n\n If \"littleEndian\" config is set, the parser will try the little-endian first. \n - 11/3/2015 = March 11th, 2015\n*/\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:' +\n '(?:on\\\\s*?)?' +\n '((?:sun|mon|tues?|wed(?:nes)?|thu(?:rs?)?|fri|sat(?:ur)?)(?:day)?)' +\n '\\\\s*\\\\,?\\\\s*' +\n ')?' +\n '([0-3]{0,1}[0-9]{1})[\\\\/\\\\.\\\\-]([0-3]{0,1}[0-9]{1})' +\n '(?:' +\n '[\\\\/\\\\.\\\\-]' +\n '([0-9]{4}\\s*\\,?\\s*|[0-9]{2}\\s*\\,?\\s*)' +\n ')?' +\n '(\\\\W|$)', 'i');\n\nvar DAYS_OFFSET = { 'sunday': 0, 'sun': 0, 'monday': 1, 'mon': 1,'tuesday': 2, 'wednesday': 3, 'wed': 3,\n 'thursday': 4, 'thur': 4,'friday': 5, 'fri': 5,'saturday': 6, 'sat': 6,}\n\n\nvar OPENNING_GROUP = 1;\nvar ENDING_GROUP = 6;\n\nvar WEEKDAY_GROUP = 2;\n\n\nvar FIRST_NUMBERS_GROUP = 3;\nvar SECOND_NUMBERS_GROUP = 4;\n\nvar YEAR_GROUP = 5;\n\nexports.Parser = function ENSlashDateFormatParser(config) {\n Parser.apply(this, arguments);\n config = config || {};\n var littleEndian = config.littleEndian;\n var MONTH_GROUP = littleEndian ? SECOND_NUMBERS_GROUP : FIRST_NUMBERS_GROUP;\n var DAY_GROUP = littleEndian ? FIRST_NUMBERS_GROUP : SECOND_NUMBERS_GROUP;\n\n this.pattern = function () { return PATTERN; };\n this.extract = function(text, ref, match, opt){\n\n if(match[OPENNING_GROUP] == '/' || match[ENDING_GROUP] == '/') {\n // Long skip, if there is some overlapping like:\n // XX[/YY/ZZ]\n // [XX/YY/]ZZ\n match.index += match[0].length\n return;\n }\n\n var index = match.index + match[OPENNING_GROUP].length;\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length - match[ENDING_GROUP].length);\n\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n });\n\n if(text.match(/^\\d\\.\\d$/)) return;\n if(text.match(/^\\d\\.\\d{1,2}\\.\\d{1,2}$/)) return;\n\n // MM/dd -> OK\n // MM.dd -> NG\n if(!match[YEAR_GROUP] && match[0].indexOf('/') < 0) return;\n\n var date = null;\n var year = match[YEAR_GROUP] || dayjs(ref).year() + '';\n var month = match[MONTH_GROUP];\n var day = match[DAY_GROUP];\n\n month = parseInt(month);\n day = parseInt(day);\n year = parseInt(year);\n\n if(month < 1 || month > 12) {\n if(month > 12) {\n // dd/mm/yyyy date format if day looks like a month, and month\n // looks like a day.\n if (day >= 1 && day <= 12 && month >= 13 && month <= 31) {\n // unambiguous\n var tday = month;\n month = day;\n day = tday;\n }\n else {\n // both month and day are <= 12\n return null;\n }\n }\n }\n if(day < 1 || day > 31) return null;\n\n if(year < 100){\n if (year > 50) {\n year = year + 1900;\n } else {\n year = year + 2000;\n }\n }\n\n result.start.assign('day', day);\n result.start.assign('month', month);\n if (match[YEAR_GROUP]) {\n result.start.assign('year', year);\n } else {\n result.start.imply('year', year);\n }\n\n //Day of week\n if(match[WEEKDAY_GROUP]) {\n result.start.assign('weekday', DAYS_OFFSET[match[WEEKDAY_GROUP].toLowerCase()]);\n }\n\n result.tags['ENSlashDateFormatParser'] = true;\n return result;\n };\n};\n","/*\n Date format with slash \"/\" between numbers like ENSlashDateFormatParser,\n but this parser expect year before month and date. \n - YYYY/MM/DD\n - YYYY-MM-DD\n - YYYY.MM.DD\n*/\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('(\\\\W|^)' \n + '([0-9]{4})[\\\\-\\\\.\\\\/]'\n + '((?:' + util.MONTH_PATTERN + '|[0-9]{1,2}))[\\\\-\\\\.\\\\/]'\n + '([0-9]{1,2})'\n + '(?=\\\\W|$)', 'i');\n\nvar YEAR_NUMBER_GROUP = 2;\nvar MONTH_NUMBER_GROUP = 3;\nvar DATE_NUMBER_GROUP = 4;\n\nexports.Parser = function ENSlashDateFormatStartWithYearParser(){\n Parser.apply(this, arguments);\n \n this.pattern = function() { return PATTERN; }\n \n this.extract = function(text, ref, match, opt){\n\n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n })\n \n var month = match[MONTH_NUMBER_GROUP].toLowerCase();\n month = util.MONTH_OFFSET[month] | month;\n\n result.start.assign('year', parseInt(match[YEAR_NUMBER_GROUP]));\n result.start.assign('month', parseInt(month));\n result.start.assign('day', parseInt(match[DATE_NUMBER_GROUP]));\n\n if (\n dayjs(result.start.get('month')) > 12 || dayjs(result.start.get('month')) < 1 || \n dayjs(result.start.get('day')) > 31 || dayjs(result.start.get('day')) < 1) {\n return null;\n }\n \n result.tags['ENDateFormatParser'] = true;\n return result;\n };\n}\n","/*\n Month/Year date format with slash \"/\" (also \"-\" and \".\") between numbers \n - 11/05\n - 06/2005\n*/\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp('(^|[^\\\\d/]\\\\s+|[^\\\\w\\\\s])' +\n '([0-9]|0[1-9]|1[012])/([0-9]{4})' + \n '(?=[^\\\\d/]|$)', 'i');\n\nvar OPENNING_GROUP = 1;\n\nvar MONTH_GROUP = 2;\nvar YEAR_GROUP = 3;\n\nexports.Parser = function ENSlashMonthFormatParser(argument) {\n Parser.apply(this, arguments);\n\n this.pattern = function () { return PATTERN; };\n this.extract = function(text, ref, match, opt){\n \n var index = match.index + match[OPENNING_GROUP].length;\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length).trim();\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n });\n\n var year = match[YEAR_GROUP] ;\n var month = match[MONTH_GROUP];\n var day = 1;\n \n month = parseInt(month);\n year = parseInt(year);\n\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n\n result.tags['ENSlashMonthFormatParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('' +\n '(\\\\W|^)' +\n '(?:within\\\\s*)?' +\n '(' + util.TIME_UNIT_PATTERN + ')' +\n '(?:ago|before|earlier)(?=(?:\\\\W|$))', 'i');\n\nvar STRICT_PATTERN = new RegExp('' +\n '(\\\\W|^)' +\n '(?:within\\\\s*)?' +\n '(' + util.TIME_UNIT_STRICT_PATTERN + ')' +\n 'ago(?=(?:\\\\W|$))', 'i');\n\nexports.Parser = function ENTimeAgoFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return this.isStrictMode()? STRICT_PATTERN : PATTERN;\n };\n\n this.extract = function(text, ref, match, opt){\n\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n var index = match.index + match[1].length;\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var fragments = util.extractDateTimeUnitFragments(match[2]);\n var date = dayjs(ref);\n\n for (var key in fragments) {\n date = date.add(-fragments[key], key);\n }\n\n if (fragments['hour'] > 0 || fragments['minute'] > 0 || fragments['second'] > 0) {\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.start.assign('second', date.second());\n result.tags['ENTimeAgoFormatParser'] = true;\n } \n \n if (fragments['d'] > 0 || fragments['month'] > 0 || fragments['year'] > 0) {\n result.start.assign('day', date.date());\n result.start.assign('month', date.month() + 1);\n result.start.assign('year', date.year());\n } else {\n if (fragments['week'] > 0) {\n result.start.imply('weekday', date.day());\n }\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n }\n\n return result;\n };\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar ParsedComponents = require('../../result').ParsedComponents;\n\nvar FIRST_REG_PATTERN = new RegExp(\"(^|\\\\s|T)\" +\n \"(?:(?:at|from)\\\\s*)??\" + \n \"(\\\\d{1,4}|noon|midnight)\" + \n \"(?:\" + \n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" + \n \"(?:\" + \n \"(?:\\\\:|\\\\:)(\\\\d{2})(?:\\\\.(\\\\d{1,6}))?\" + \n \")?\" + \n \")?\" + \n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?|O\\\\W*CLOCK))?\" + \n \"(?=\\\\W|$)\", 'i');\n\n\nvar SECOND_REG_PATTERN = new RegExp(\"^\\\\s*\" + \n \"(\\\\-|\\\\–|\\\\~|\\\\〜|to|\\\\?)\\\\s*\" + \n \"(\\\\d{1,4})\" +\n \"(?:\" + \n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" + \n \"(?:\" + \n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})(?:\\\\.(\\\\d{1,6}))?\" + \n \")?\" + \n \")?\" + \n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?|O\\\\W*CLOCK))?\" + \n \"(?=\\\\W|$)\", 'i');\n\nvar HOUR_GROUP = 2;\nvar MINUTE_GROUP = 3;\nvar SECOND_GROUP = 4;\nvar MILLI_SECOND_GROUP = 5;\nvar AM_PM_HOUR_GROUP = 6;\n\n\nexports.Parser = function ENTimeExpressionParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return FIRST_REG_PATTERN; }\n \n this.extract = function(text, ref, match, opt){ \n \n // This pattern can be overlapped Ex. [12] AM, 1[2] AM\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n var refMoment = dayjs(ref);\n var result = new ParsedResult();\n result.ref = ref;\n result.index = match.index + match[1].length;\n result.text = match[0].substring(match[1].length);\n result.tags['ENTimeExpressionParser'] = true;\n\n result.start.imply('day', refMoment.date());\n result.start.imply('month', refMoment.month()+1);\n result.start.imply('year', refMoment.year());\n \n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Millisecond\n if(match[MILLI_SECOND_GROUP] != null){ \n var millisecond = parseInt(match[MILLI_SECOND_GROUP].substring(0, 3));\n if(millisecond >= 1000) return null;\n \n result.start.assign('millisecond', millisecond);\n }\n\n // ----- Second\n if(match[SECOND_GROUP] != null){ \n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.start.assign('second', second);\n }\n \n // ----- Hours\n if (match[HOUR_GROUP].toLowerCase() == \"noon\"){\n meridiem = 1; \n hour = 12;\n } else if (match[HOUR_GROUP].toLowerCase() == \"midnight\") {\n meridiem = 0; \n hour = 0;\n } else {\n hour = parseInt(match[HOUR_GROUP]);\n }\n \n // ----- Minutes\n if(match[MINUTE_GROUP] != null){ \n minute = parseInt(match[MINUTE_GROUP]);\n } else if(hour > 100) { \n minute = hour%100;\n hour = parseInt(hour/100);\n } \n \n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) { \n meridiem = 1;\n }\n\n // ----- AM & PM \n if(match[AM_PM_HOUR_GROUP] != null) {\n if(hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if(ampm == \"a\"){\n meridiem = 0; \n if(hour == 12) hour = 0;\n }\n \n if(ampm == \"p\"){\n meridiem = 1; \n if(hour != 12) hour += 12;\n }\n } \n\n result.start.assign('hour', hour);\n result.start.assign('minute', minute);\n\n if (meridiem >= 0) {\n result.start.assign('meridiem', meridiem);\n } else {\n if (hour < 12) {\n result.start.imply('meridiem', 0);\n } else {\n result.start.imply('meridiem', 1);\n }\n }\n\n // ==============================================================\n // Extracting the 'to' chunk\n // ==============================================================\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n return result;\n }\n\n\n\n // Pattern \"YY.YY -XXXX\" is more like timezone offset\n if (match[0].match(/^\\s*(\\+|\\-)\\s*\\d{3,4}$/)) {\n return result;\n }\n\n if(result.end == null){\n result.end = new ParsedComponents(null, result.start.date());\n }\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Millisecond\n if(match[MILLI_SECOND_GROUP] != null){ \n var millisecond = parseInt(match[MILLI_SECOND_GROUP].substring(0, 3));\n if(millisecond >= 1000) return null;\n \n result.end.assign('millisecond', millisecond);\n }\n \n // ----- Second\n if(match[SECOND_GROUP] != null){ \n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.end.assign('second', second);\n }\n\n hour = parseInt(match[2]);\n \n // ----- Minute\n if (match[MINUTE_GROUP]!= null) {\n \n minute = parseInt(match[MINUTE_GROUP]);\n if(minute >= 60) return result;\n \n } else if (hour > 100) {\n\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) { \n meridiem = 1;\n }\n \n // ----- AM & PM \n if (match[AM_PM_HOUR_GROUP] != null){\n\n if (hour > 12) return null;\n\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if(ampm == \"a\"){\n meridiem = 0; \n if(hour == 12) {\n hour = 0;\n if (!result.end.isCertain('day')) {\n result.end.imply('day', result.end.get('day') + 1);\n }\n }\n }\n \n if(ampm == \"p\"){\n meridiem = 1; \n if(hour != 12) hour += 12;\n }\n \n if (!result.start.isCertain('meridiem')) {\n if (meridiem == 0) {\n \n result.start.imply('meridiem', 0);\n \n if (result.start.get('hour') == 12) {\n result.start.assign('hour', 0);\n }\n\n } else {\n\n result.start.imply('meridiem', 1);\n \n if (result.start.get('hour') != 12) {\n result.start.assign('hour', result.start.get('hour') + 12); \n }\n }\n }\n }\n\n result.text = result.text + match[0];\n result.end.assign('hour', hour);\n result.end.assign('minute', minute);\n if (meridiem >= 0) {\n result.end.assign('meridiem', meridiem);\n } else {\n var startAtPM = result.start.isCertain('meridiem') && result.start.get('meridiem') == 1;\n if (startAtPM && result.start.get('hour') > hour) {\n // 10pm - 1 (am)\n result.end.imply('meridiem', 0);\n\n } else if (hour > 12) {\n result.end.imply('meridiem', 1);\n }\n }\n\n if (result.end.date().getTime() < result.start.date().getTime()) {\n result.end.imply('day', result.end.get('day') + 1)\n }\n \n return result;\n }\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('' +\n /*match[1]*/ '(\\\\W|^)' +\n /*match[2]*/ '(in )?' +\n /*match[3]*/ '(' + util.TIME_UNIT_PATTERN + ')' +\n /*match[4]*/ '(later|after|from now|henceforth|forward|out)?' +\n /*match[5]*/ '(?=(?:\\\\W|$))',\n'i');\n\nvar STRICT_PATTERN = new RegExp('' +\n /*match[1]*/ '(\\\\W|^)' +\n /*match[2]*/ '(in )?' +\n /*match[3]*/ '(' + util.TIME_UNIT_STRICT_PATTERN + ')' +\n /*match[4]*/ '(later|from now)?' +\n /*match[5]*/ '(?=(?:\\\\W|$))',\n'i');\n\nexports.Parser = function ENTimeLaterFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return this.isStrictMode()? STRICT_PATTERN : PATTERN;\n };\n\n this.extract = function(text, ref, match, opt){\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n\n var prefix = match[2];\n var suffix = match[4];\n if (!prefix && !suffix) return null;\n\n var preamble = match[1];\n var text = match[0].substr(preamble.length, match[0].length - preamble.length);\n var index = match.index + preamble.length;\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var fragments = util.extractDateTimeUnitFragments(match[3]);\n var date = dayjs(ref);\n for (var key in fragments) {\n date = date.add(fragments[key], key);\n }\n\n if (fragments['hour'] > 0 || fragments['minute'] > 0 || fragments['second'] > 0) {\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.start.assign('second', date.second());\n result.tags['ENTimeAgoFormatParser'] = true;\n } \n \n if (fragments['d'] > 0 || fragments['month'] > 0 || fragments['year'] > 0) {\n result.start.assign('day', date.date());\n result.start.assign('month', date.month() + 1);\n result.start.assign('year', date.year());\n } else {\n if (fragments['week'] > 0) {\n result.start.imply('weekday', date.day());\n }\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n }\n\n return result;\n };\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)(now|today|tonight|last\\s*night|(?:tomorrow|tmr|yesterday)\\s*|tomorrow|tmr|yesterday)(?=\\W|$)/i;\n\nexports.Parser = function ENCasualDateParser(){\n\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var refMoment = dayjs(ref);\n var startMoment = refMoment;\n var lowerText = text.toLowerCase();\n\n if(lowerText == 'tonight'){\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n\n } else if (/^tomorrow|^tmr/.test(lowerText)) {\n\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n\n } else if (/^yesterday/.test(lowerText)) {\n\n startMoment = startMoment.add(-1, 'day');\n\n } else if(lowerText.match(/last\\s*night/)) {\n\n result.start.imply('hour', 0);\n if (refMoment.hour() > 6) {\n startMoment = startMoment.add(-1, 'day');\n }\n\n } else if (lowerText.match(\"now\")) {\n\n result.start.assign('hour', refMoment.hour());\n result.start.assign('minute', refMoment.minute());\n result.start.assign('second', refMoment.second());\n result.start.assign('millisecond', refMoment.millisecond());\n\n }\n\n result.start.assign('day', startMoment.date())\n result.start.assign('month', startMoment.month() + 1)\n result.start.assign('year', startMoment.year())\n result.tags['ENCasualDateParser'] = true;\n return result;\n }\n}\n","var Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)((this)?\\s*(morning|afternoon|evening|noon|night))/i;\n\nvar TIME_MATCH = 4;\n\nexports.Parser = function ENCasualTimeParser(){\n\n Parser.apply(this, arguments);\n\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n if(!match[TIME_MATCH]) TIME_MATCH = 3;\n \n switch (match[TIME_MATCH].toLowerCase()) {\n\n case 'afternoon':\n result.start.imply('meridiem', 1);\n result.start.imply('hour', 15);\n break;\n\n case 'evening':\n case 'night':\n result.start.imply('meridiem', 1);\n result.start.imply('hour', 20);\n break;\n\n case 'morning':\n result.start.imply('meridiem', 0);\n result.start.imply('hour', 6);\n break;\n\n case 'noon':\n result.start.imply('meridiem', 0);\n result.start.imply('hour', 12);\n break;\n }\n \n result.tags['ENCasualTimeParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nconst parser = require('../parser');\nconst ParsedResult = require('../../result').ParsedResult;\n\nconst util = require('../../utils/JP'); \n\nconst PATTERN = /(?:(同|今|本|((昭和|平成|令和)?([0-90-9]{1,4}|元)))年\\s*)?([0-90-9]{1,2})月\\s*([0-90-9]{1,2})日/i;\nconst SPECIAL_YEAR_GROUP = 1;\nconst TYPICAL_YEAR_GROUP = 2;\nconst ERA_GROUP = 3;\nconst YEAR_NUMBER_GROUP = 4;\nconst MONTH_GROUP = 5;\nconst DAY_GROUP = 6;\n\nexports.Parser = function JPStandardParser(){\n parser.Parser.apply(this, arguments);\n \n this.pattern = function() { return PATTERN; }\n \n this.extract = function(text, ref, match, opt){ \n var result = new ParsedResult({\n text: match[0],\n index: match.index,\n ref: ref,\n });\n \n var month = match[MONTH_GROUP];\n month = util.toHankaku(month);\n month = parseInt(month);\n\n var day = match[DAY_GROUP];\n day = util.toHankaku(day);\n day = parseInt(day);\n\n result.start.assign('day', day);\n result.start.assign('month', month);\n \n if (match[TYPICAL_YEAR_GROUP]) {\n\n var year = match[YEAR_NUMBER_GROUP];\n if (year == '元') {\n year = 1;\n } else {\n year = util.toHankaku(year);\n year = parseInt(year);\n }\n\n if (match[ERA_GROUP] == '令和') {\n year += 2018;\n } else if (match[ERA_GROUP] == '平成') {\n year += 1988;\n } else if (match[ERA_GROUP] == '昭和') {\n year += 1925;\n }\n\n result.start.assign('year', year);\n\n } else if (match[SPECIAL_YEAR_GROUP] && match[SPECIAL_YEAR_GROUP].match('同|今|本')) {\n const moment = dayjs(ref)\n result.start.assign('year', moment.year());\n } else {\n const year = parser.findYearClosestToRef(ref, day, month);\n result.start.imply('year', year);\n }\n \n result.tags['JPStandardParser'] = true;\n return result;\n };\n\n}\n\n","\n\n/**\n * to-hankaku.js\n * convert to ascii code strings.\n *\n * @version 1.0.1\n * @author think49\n * @url https://gist.github.com/964592\n * @license http://www.opensource.org/licenses/mit-license.php (The MIT License)\n */\n \nexports.toHankaku = (function (String, fromCharCode) {\n \n function toHankaku (string) {\n return String(string).replace(/\\u2019/g, '\\u0027').replace(/\\u201D/g, '\\u0022').replace(/\\u3000/g, '\\u0020').replace(/\\uFFE5/g, '\\u00A5').replace(/[\\uFF01\\uFF03-\\uFF06\\uFF08\\uFF09\\uFF0C-\\uFF19\\uFF1C-\\uFF1F\\uFF21-\\uFF3B\\uFF3D\\uFF3F\\uFF41-\\uFF5B\\uFF5D\\uFF5E]/g, alphaNum);\n }\n \n function alphaNum (token) {\n return fromCharCode(token.charCodeAt(0) - 65248);\n }\n \n return toHankaku;\n})(String, String.fromCharCode);\n\n/**\n * to-zenkaku.js\n * convert to multi byte strings.\n *\n * @version 1.0.2\n * @author think49\n * @url https://gist.github.com/964592\n * @license http://www.opensource.org/licenses/mit-license.php (The MIT License)\n */\nexports.toZenkaku = (function (String, fromCharCode) {\n \n function toZenkaku (string) {\n return String(string).replace(/\\u0020/g, '\\u3000').replace(/\\u0022/g, '\\u201D').replace(/\\u0027/g, '\\u2019').replace(/\\u00A5/g, '\\uFFE5').replace(/[!#-&(),-9\\u003C-?A-[\\u005D_a-{}~]/g, alphaNum);\n }\n \n function alphaNum (token) {\n return fromCharCode(token.charCodeAt(0) + 65248);\n }\n \n return toZenkaku;\n})(String, String.fromCharCode);","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /今日|当日|昨日|明日|今夜|今夕|今晩|今朝/i;\n\nexports.Parser = function JPCasualDateParser(){\n \n Parser.apply(this, arguments);\n \n this.pattern = function() { return PATTERN; }\n \n this.extract = function(text, ref, match, opt){ \n \n var index = match.index;\n var text = match[0];\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var refMoment = dayjs(ref);\n var startMoment = refMoment;\n\n if(text == '今夜' || text == '今夕' || text == '今晩'){\n // Normally means this coming midnight \n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n\n } else if(text == '明日'){\n\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 4) {\n startMoment = startMoment.add(1, 'day');\n }\n\n } else if(text == '昨日') {\n\n startMoment = startMoment.add(-1, 'day');\n\n } else if (text.match(\"今朝\")) {\n\n result.start.imply('hour', 6);\n result.start.imply('meridiem', 0);\n }\n\n result.start.assign('day', startMoment.date())\n result.start.assign('month', startMoment.month() + 1)\n result.start.assign('year', startMoment.year())\n result.tags['JPCasualDateParser'] = true;\n return result;\n }\n}\n\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\n/*\n Valid patterns:\n - esta manhã -> today in the morning\n - esta tarde -> today in the afternoon/evening\n - esta noite -> tonight\n - ontem de -> yesterday in the morning\n - ontem a tarde -> yesterday in the afternoon/evening\n - ontem a noite -> yesterday at night\n - amanhã de manhã -> tomorrow in the morning\n - amanhã a tarde -> tomorrow in the afternoon/evening\n - amanhã a noite -> tomorrow at night\n - hoje -> today\n - ontem -> yesterday\n - amanhã -> tomorrow\n */\nvar PATTERN = /(\\W|^)(agora|esta\\s*(manhã|tarde|noite)|(ontem|amanhã)\\s*(de|à)\\s*(manhã|tarde|noite)|hoje|amanhã|ontem|noite)(?=\\W|$)/i;\n\nexports.Parser = function PTCasualDateParser(){\n\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var refMoment = dayjs(ref);\n var startMoment = refMoment;\n var lowerText = text.toLowerCase().replace(/\\s+/g, ' ');\n\n if(lowerText == 'amanhã'){\n\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n\n } else if(lowerText == 'ontem') {\n\n startMoment = startMoment.add(-1, 'day');\n }\n else if(lowerText == 'noite') {\n\n result.start.imply('hour', 0);\n if (refMoment.hour() > 6) {\n startMoment = startMoment.add(-1, 'day');\n }\n\n } else if (lowerText.match(\"esta\")) {\n\n var secondMatch = match[3].toLowerCase();\n if (secondMatch == \"tarde\") {\n\n result.start.imply('hour', 18);\n\n } else if (secondMatch == \"manhã\") {\n\n result.start.imply('hour', 6);\n\n } else if (secondMatch == \"noite\") {\n\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n\n }\n } else if (lowerText.match(/de|à/)) {\n\n var firstMatch = match[4].toLowerCase();\n if (firstMatch === 'ontem') {\n\n startMoment = startMoment.add(-1, 'day');\n\n } else if (firstMatch === 'amanhã') {\n\n startMoment = startMoment.add(1, 'day');\n\n }\n\n var secondMatch = match[6].toLowerCase();\n if (secondMatch == \"tarde\") {\n\n result.start.imply('hour', 18);\n\n } else if (secondMatch == \"manhã\") {\n\n result.start.imply('hour', 9);\n\n } else if (secondMatch == \"noite\") {\n\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n\n }\n\n } else if (lowerText.match(\"agora\")) {\n\n result.start.imply('hour', refMoment.hour());\n result.start.imply('minute', refMoment.minute());\n result.start.imply('second', refMoment.second());\n result.start.imply('millisecond', refMoment.millisecond());\n\n }\n\n result.start.assign('day', startMoment.date())\n result.start.assign('month', startMoment.month() + 1)\n result.start.assign('year', startMoment.year())\n result.tags['PTCasualDateParser'] = true;\n return result;\n }\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)(dentro\\s*de|em|em*até)\\s*([0-9]+|mei[oa]|uma?)\\s*(minutos?|horas?|dias?)\\s*(?=(?:\\W|$))/i;\n\nexports.Parser = function PTDeadlineFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var index = match.index + match[1].length;\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var num = parseInt(match[3]);\n if (isNaN(num)) {\n if (match[3].match(/(meio|meia)/)) {\n num = 0.5;\n } else {\n num = 1;\n }\n }\n\n var date = dayjs(ref);\n if (match[4].match(/dia/)) {\n date = date.add(num, 'd');\n\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n return result;\n }\n\n\n if (match[4].match(/hora/)) {\n\n date = date.add(num, 'hour');\n\n } else if (match[4].match(/minuto/)) {\n\n date = date.add(num, 'minute');\n }\n\n result.start.imply('year', date.year());\n result.start.imply('month', date.month() + 1);\n result.start.imply('day', date.date());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.tags['PTDeadlineFormatParser'] = true;\n return result;\n };\n}\n","var parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar util = require('../../utils/PT');\n\nvar DAYS_OFFSET = util.WEEKDAY_OFFSET;\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:(domingo|segunda|segunda-feira|terça|terça-feira|quarta|quarta-feira|quinta|quinta-feira|sexta|sexta-feira|sábado|sabado|dom|seg|ter|qua|qui|sex|sab)\\\\s*,?\\\\s*)?' +\n '([0-9]{1,2})(?:º|ª|°)?' +\n '(?:\\\\s*(?:desde|de|\\\\-|\\\\–|ao?|\\\\s)\\\\s*([0-9]{1,2})(?:º|ª|°)?)?\\\\s*(?:de)?\\\\s*' +\n '(Jan(?:eiro|\\\\.)?|Fev(?:ereiro|\\\\.)?|Mar(?:ço|\\\\.)?|Abr(?:il|\\\\.)?|Mai(?:o|\\\\.)?|Jun(?:ho|\\\\.)?|Jul(?:ho|\\\\.)?|Ago(?:sto|\\\\.)?|Set(?:embro|\\\\.)?|Out(?:ubro|\\\\.)?|Nov(?:embro|\\\\.)?|Dez(?:embro|\\\\.)?)' +\n '(?:\\\\s*(?:de?)?(\\\\s*[0-9]{1,4}(?![^\\\\s]\\\\d))(\\\\s*[ad]\\\\.?\\\\s*c\\\\.?|a\\\\.?\\\\s*d\\\\.?)?)?' +\n '(?=\\\\W|$)', 'i'\n );\n\nvar WEEKDAY_GROUP = 2;\nvar DATE_GROUP = 3;\nvar DATE_TO_GROUP = 4;\nvar MONTH_NAME_GROUP = 5;\nvar YEAR_GROUP = 6;\nvar YEAR_BE_GROUP = 7;\n\nexports.Parser = function PTMonthNameLittleEndianParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n\n var day = match[DATE_GROUP];\n day = parseInt(day);\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n year = parseInt(year);\n\n if(match[YEAR_BE_GROUP]){\n if (/a\\.?\\s*c\\.?/i.test(match[YEAR_BE_GROUP])) {\n // antes de Cristo\n year = -year;\n }\n } else if (year < 100){\n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month);\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n // Weekday component\n if (match[WEEKDAY_GROUP]) {\n var weekday = match[WEEKDAY_GROUP];\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()]\n result.start.assign('weekday', weekday);\n }\n\n // Text can be 'range' value. Such as '12 - 13 January 2012'\n if (match[DATE_TO_GROUP]) {\n result.end = result.start.clone();\n result.end.assign('day', parseInt(match[DATE_TO_GROUP]));\n }\n\n result.tags['PTMonthNameLittleEndianParser'] = true;\n return result;\n };\n}\n","exports.WEEKDAY_OFFSET = {\n 'domingo': 0,\n 'dom': 0,\n 'segunda': 1,\n 'segunda-feira': 1,\n 'seg': 1,\n 'terça': 2,\n 'terca': 2,\n 'terça-feira': 2,\n 'terca-feira': 2,\n 'ter':2,\n 'quarta': 3,\n 'quarta-feira': 3,\n 'qua': 3,\n 'quinta': 4,\n 'quinta-feira': 4,\n 'qui': 4,\n 'sexta': 5,\n 'sexta-feira': 5,\n 'sex': 5,\n 'sábado': 6,\n 'sabado': 6,\n 'sab': 6,}\n \n exports.MONTH_OFFSET = {\n 'janeiro': 1,\n 'jan': 1,\n 'jan.': 1,\n 'fevereiro': 2,\n 'fev': 2,\n 'fev.': 2,\n 'março': 3,\n 'mar': 3,\n 'mar.': 3,\n 'abril': 4,\n 'abr': 4,\n 'abr.': 4,\n 'maio': 5,\n 'mai': 5,\n 'mai.': 5,\n 'junho': 6,\n 'jun': 6,\n 'jun.': 6,\n 'julho': 7,\n 'jul': 7,\n 'jul.': 7,\n 'agosto': 8,\n 'ago': 8,\n 'ago.': 8,\n 'setembro': 9,\n 'set': 9,\n 'set.': 9,\n 'outubro': 10,\n 'out': 10,\n 'out.': 10,\n 'novembro': 11,\n 'nov': 11,\n 'nov.': 11,\n 'dezembro': 12,\n 'dez': 12,\n 'dez.': 12,\n }","/*\n Date format with slash \"/\" (also \"-\" and \".\") between numbers\n - Martes 3/11/2015\n - 3/11/2015\n - 3/11\n*/\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:' +\n '((?:domingo|dom|segunda|segunda-feira|seg|terça|terça-feira|ter|quarta|quarta-feira|qua|quinta|quinta-feira|qui|sexta|sexta-feira|sex|s[áa]bado|sab))' +\n '\\\\s*\\\\,?\\\\s*' +\n ')?' +\n '([0-1]{0,1}[0-9]{1})[\\\\/\\\\.\\\\-]([0-3]{0,1}[0-9]{1})' +\n '(?:' +\n '[\\\\/\\\\.\\\\-]' +\n '([0-9]{4}\\s*\\,?\\s*|[0-9]{2}\\s*\\,?\\s*)' +\n ')?' +\n '(\\\\W|$)', 'i');\n\nvar DAYS_OFFSET = { 'domingo': 0, 'dom': 0, 'segunda': 1, 'segunda-feira': 1, 'seg': 1, 'terça': 2, 'terça-feira': 2, 'ter': 2, 'quarta': 3, 'quarta-feira': 3, 'qua': 3,\n 'quinta': 4, 'quinta-feira': 4, 'qui': 4, 'sexta': 5, 'sexta-feira': 5, 'sex': 5, 'sábado': 6, 'sabado': 6, 'sab': 6,}\n\n\nvar OPENNING_GROUP = 1;\nvar ENDING_GROUP = 6;\n\n// in Spanish we use day/month/year\nvar WEEKDAY_GROUP = 2;\nvar MONTH_GROUP = 4;\nvar DAY_GROUP = 3;\nvar YEAR_GROUP = 5;\n\nexports.Parser = function PTSlashDateFormatParser(argument) {\n Parser.apply(this, arguments);\n\n this.pattern = function () { return PATTERN; };\n this.extract = function(text, ref, match, opt){\n\n if(match[OPENNING_GROUP] == '/' || match[ENDING_GROUP] == '/') {\n // Long skip, if there is some overlapping like:\n // XX[/YY/ZZ]\n // [XX/YY/]ZZ\n match.index += match[0].length\n return;\n }\n\n var index = match.index + match[OPENNING_GROUP].length;\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length - match[ENDING_GROUP].length);\n\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n });\n\n if(text.match(/^\\d\\.\\d$/)) return;\n if(text.match(/^\\d\\.\\d{1,2}\\.\\d{1,2}$/)) return;\n\n // MM/dd -> OK\n // MM.dd -> NG\n if(!match[YEAR_GROUP] && match[0].indexOf('/') < 0) return;\n\n var date = null;\n var year = match[YEAR_GROUP] || dayjs(ref).year() + '';\n var month = match[MONTH_GROUP];\n var day = match[DAY_GROUP];\n\n month = parseInt(month);\n day = parseInt(day);\n year = parseInt(year);\n\n if(month < 1 || month > 12) {\n if(month > 12) {\n // dd/mm/yyyy date format if day looks like a month, and month\n // looks like a day.\n if (day >= 1 && day <= 12 && month >= 13 && month <= 31) {\n // unambiguous\n var tday = month;\n month = day;\n day = tday;\n }\n else {\n // both month and day are <= 12\n return null;\n }\n }\n }\n if(day < 1 || day > 31) return null;\n\n if(year < 100){\n if(year > 50){\n year = year + 1900;\n }else{\n year = year + 2000;\n }\n }\n\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n\n //Day of week\n if(match[WEEKDAY_GROUP]) {\n result.start.assign('weekday', DAYS_OFFSET[match[WEEKDAY_GROUP].toLowerCase()]);\n }\n\n result.tags['PTSlashDateFormatParser'] = true;\n return result;\n };\n};","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)há\\s*([0-9]+|mei[oa]|uma?)\\s*(minutos?|horas?|semanas?|dias?|mes(es)?|anos?)(?=(?:\\W|$))/i;\n\nexports.Parser = function PTTimeAgoFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return PATTERN;\n }\n\n this.extract = function(text, ref, match, opt){\n\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n let index = match.index + match[1].length;\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var num = parseInt(match[2]);\n if (isNaN(num)) {\n if (match[2].match(/mei/)) {\n num = 0.5;\n } else {\n num = 1;\n }\n }\n\n var date = dayjs(ref);\n\n if (match[3].match(/hora/) || match[3].match(/minuto/)) {\n if (match[3].match(/hora/)) {\n\n date = date.add(-num, 'hour');\n\n } else if (match[3].match(/minuto/)) {\n\n date = date.add(-num, 'minute');\n }\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.tags['PTTimeAgoFormatParser'] = true;\n return result;\n }\n\n if (match[3].match(/semana/)) {\n date = date.add(-num, 'week');\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n result.start.imply('weekday', date.day());\n return result;\n }\n\n if (match[3].match(/dia/)) {\n date = date.add(-num, 'd');\n }\n\n if (match[3].match(/mes/)) {\n date = date.add(-num, 'month');\n }\n\n if (match[3].match(/ano/)) {\n\n date = date.add(-num, 'year');\n }\n\n result.start.assign('day', date.date());\n result.start.assign('month', date.month() + 1);\n result.start.assign('year', date.year());\n return result;\n\n };\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar ParsedComponents = require('../../result').ParsedComponents;\n\nvar FIRST_REG_PATTERN = new RegExp(\"(^|\\\\s|T)\" +\n \"(?:(?:ao?|às?|das|da|de|do)\\\\s*)?\" +\n \"(\\\\d{1,4}|meio-dia|meia-noite|meio dia|meia noite)\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\:|\\\\:)(\\\\d{2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\n \"(?=\\\\W|$)\", 'i');\n\n\nvar SECOND_REG_PATTERN = new RegExp(\"^\\\\s*\" +\n \"(\\\\-|\\\\–|\\\\~|\\\\〜|a(?:o)?|\\\\?)\\\\s*\" +\n \"(\\\\d{1,4})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\n \"(?=\\\\W|$)\", 'i');\n\nvar HOUR_GROUP = 2;\nvar MINUTE_GROUP = 3;\nvar SECOND_GROUP = 4;\nvar AM_PM_HOUR_GROUP = 5;\n\nexports.Parser = function PTTimeExpressionParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return FIRST_REG_PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n // This pattern can be overlaped Ex. [12] AM, 1[2] AM\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n var refMoment = dayjs(ref);\n var result = new ParsedResult();\n result.ref = ref;\n result.index = match.index + match[1].length;\n result.text = match[0].substring(match[1].length);\n result.tags['PTTimeExpressionParser'] = true;\n\n result.start.imply('day', refMoment.date());\n result.start.imply('month', refMoment.month()+1);\n result.start.imply('year', refMoment.year());\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.start.assign('second', second);\n }\n\n // ----- Hours\n if (match[HOUR_GROUP].toLowerCase().match(/meio\\-di/)){\n meridiem = 1;\n hour = 12;\n } else if (match[HOUR_GROUP].toLowerCase() == \"meia-noite\") {\n meridiem = 0;\n hour = 0;\n } else {\n hour = parseInt(match[HOUR_GROUP]);\n }\n\n // ----- Minutes\n if(match[MINUTE_GROUP] != null){\n minute = parseInt(match[MINUTE_GROUP]);\n } else if(hour > 100) {\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if(match[AM_PM_HOUR_GROUP] != null) {\n if(hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if(ampm == \"a\"){\n meridiem = 0;\n if(hour == 12) hour = 0;\n }\n\n if(ampm == \"p\"){\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n }\n result.start.assign('hour', hour);\n result.start.assign('minute', minute);\n if (meridiem >= 0) {\n result.start.assign('meridiem', meridiem);\n }\n\n // ==============================================================\n // Extracting the 'to' chunk\n // ==============================================================\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n // Not accept number only result\n if (result.text.match(/^\\d+$/)) {\n return null;\n }\n return result;\n }\n\n\n\n // Pattern \"YY.YY -XXXX\" is more like timezone offset\n if (match[0].match(/^\\s*(\\+|\\-)\\s*\\d{3,4}$/)) {\n return result;\n }\n\n if(result.end == null){\n result.end = new ParsedComponents(null, result.start.date());\n }\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.end.assign('second', second);\n }\n\n hour = parseInt(match[2]);\n\n // ----- Minute\n if (match[MINUTE_GROUP]!= null) {\n\n minute = parseInt(match[MINUTE_GROUP]);\n if(minute >= 60) return result;\n\n } else if (hour > 100) {\n\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP] != null){\n\n if (hour > 12) return null;\n\n if(match[AM_PM_HOUR_GROUP][0].toLowerCase() == \"a\"){\n meridiem = 0;\n if(hour == 12) {\n hour = 0;\n if (!result.end.isCertain('day')) {\n result.end.imply('day', result.end.get('day') + 1);\n }\n }\n }\n\n if(match[AM_PM_HOUR_GROUP][0].toLowerCase() == \"p\"){\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n\n if (!result.start.isCertain('meridiem')) {\n if (meridiem == 0) {\n\n result.start.imply('meridiem', 0);\n\n if (result.start.get('hour') == 12) {\n result.start.assign('hour', 0);\n }\n\n } else {\n\n result.start.imply('meridiem', 1);\n\n if (result.start.get('hour') != 12) {\n result.start.assign('hour', result.start.get('hour') + 12);\n }\n }\n }\n\n } else if(hour >= 12) {\n meridiem = 1;\n }\n\n result.text = result.text + match[0];\n result.end.assign('hour', hour);\n result.end.assign('minute', minute);\n if (meridiem >= 0) {\n result.end.assign('meridiem', meridiem);\n }\n\n if (result.end.date().getTime() < result.start.date().getTime()) {\n result.end.imply('day', result.end.get('day') + 1)\n }\n\n return result;\n }\n}\n","var Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar updateParsedComponent = require('../en/ENWeekdayParser').updateParsedComponent;\n\nvar DAYS_OFFSET = { 'domingo': 0, 'dom': 0, 'segunda': 1, 'segunda-feira': 1, 'seg': 1, 'terça': 2, 'terça-feira': 2, 'ter': 2, 'quarta': 3, 'quarta-feira': 3, 'qua': 3,\n 'quinta': 4, 'quinta-feira': 4, 'qui': 4, 'sexta': 5, 'sexta-feira': 5, 'sex': 5, 'sábado': 6, 'sabado': 6, 'sab': 6,}\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:(?:\\\\,|\\\\(|\\\\()\\\\s*)?' +\n '(?:(este|esta|passado|pr[oó]ximo)\\\\s*)?' +\n '(' + Object.keys(DAYS_OFFSET).join('|') + ')' +\n '(?:\\\\s*(?:\\\\,|\\\\)|\\\\)))?' +\n '(?:\\\\s*(este|esta|passado|pr[óo]ximo)\\\\s*semana)?' +\n '(?=\\\\W|$)', 'i');\n\nvar PREFIX_GROUP = 2;\nvar WEEKDAY_GROUP = 3;\nvar POSTFIX_GROUP = 4;\n\nexports.Parser = function PTWeekdayParser() {\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n var index = match.index + match[1].length;\n var text = match[0].substr(match[1].length, match[0].length - match[1].length);\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();\n var offset = DAYS_OFFSET[dayOfWeek];\n if(offset === undefined) return null;\n\n var modifier = null;\n var prefix = match[PREFIX_GROUP];\n var postfix = match[POSTFIX_GROUP];\n if (prefix || postfix) {\n var norm = prefix || postfix;\n norm = norm.toLowerCase();\n\n if(norm == 'passado') {\n modifier = 'this';\n }\n else if(norm == 'próximo' || norm == 'proximo') {\n modifier = 'next';\n }\n else if(norm== 'este') {\n modifier = 'this';\n }\n }\n\n updateParsedComponent(result, ref, offset, modifier);\n result.tags['PTWeekdayParser'] = true;\n return result;\n }\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\n/*\n Valid patterns:\n - esta mañana -> today in the morning\n - esta tarde -> today in the afternoon/evening\n - esta noche -> tonight\n - ayer por la mañana -> yesterday in the morning\n - ayer por la tarde -> yesterday in the afternoon/evening\n - ayer por la noche -> yesterday at night\n - mañana por la mañana -> tomorrow in the morning\n - mañana por la tarde -> tomorrow in the afternoon/evening\n - mañana por la noche -> tomorrow at night\n - anoche -> tomorrow at night\n - hoy -> today\n - ayer -> yesterday\n - mañana -> tomorrow\n */\nvar PATTERN = /(\\W|^)(ahora|esta\\s*(mañana|tarde|noche)|(ayer|mañana)\\s*por\\s*la\\s*(mañana|tarde|noche)|hoy|mañana|ayer|anoche)(?=\\W|$)/i;\n\nexports.Parser = function ESCasualDateParser(){\n\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var refMoment = dayjs(ref);\n var startMoment = refMoment;\n var lowerText = text.toLowerCase().replace(/\\s+/g, ' ');\n\n if(lowerText == 'mañana'){\n\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n\n } else if(lowerText == 'ayer') {\n\n startMoment = startMoment.add(-1, 'day');\n }\n else if(lowerText == 'anoche') {\n\n result.start.imply('hour', 0);\n if (refMoment.hour() > 6) {\n startMoment = startMoment.add(-1, 'day');\n }\n\n } else if (lowerText.match(\"esta\")) {\n\n var secondMatch = match[3].toLowerCase();\n if (secondMatch == \"tarde\") {\n\n result.start.imply('hour', 18);\n\n } else if (secondMatch == \"mañana\") {\n\n result.start.imply('hour', 6);\n\n } else if (secondMatch == \"noche\") {\n\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n\n }\n } else if (lowerText.match(/por\\s*la/)) {\n\n var firstMatch = match[4].toLowerCase();\n if (firstMatch === 'ayer') {\n\n startMoment = startMoment.add(-1, 'day');\n\n } else if (firstMatch === 'mañana') {\n\n startMoment = startMoment.add(1, 'day');\n\n }\n\n var secondMatch = match[5].toLowerCase();\n if (secondMatch == \"tarde\") {\n\n result.start.imply('hour', 18);\n\n } else if (secondMatch == \"mañana\") {\n\n result.start.imply('hour', 9);\n\n } else if (secondMatch == \"noche\") {\n\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n\n }\n\n } else if (lowerText.match(\"ahora\")) {\n\n result.start.imply('hour', refMoment.hour());\n result.start.imply('minute', refMoment.minute());\n result.start.imply('second', refMoment.second());\n result.start.imply('millisecond', refMoment.millisecond());\n\n }\n\n result.start.assign('day', startMoment.date())\n result.start.assign('month', startMoment.month() + 1)\n result.start.assign('year', startMoment.year())\n result.tags['ESCasualDateParser'] = true;\n return result;\n }\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)(dentro\\s*de|en)\\s*([0-9]+|medi[oa]|una?)\\s*(minutos?|horas?|d[ií]as?)\\s*(?=(?:\\W|$))/i;\n\nexports.Parser = function ESDeadlineFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var index = match.index + match[1].length;\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var num = parseInt(match[3]);\n if (isNaN(num)) {\n if (match[3].match(/medi/)) {\n num = 0.5;\n } else {\n num = 1;\n }\n }\n\n var date = dayjs(ref);\n if (match[4].match(/d[ií]a/)) {\n date = date.add(num, 'd');\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n return result;\n }\n\n\n if (match[4].match(/hora/)) {\n\n date = date.add(num, 'hour');\n\n } else if (match[4].match(/minuto/)) {\n\n date = date.add(num, 'minute');\n }\n\n result.start.imply('year', date.year());\n result.start.imply('month', date.month() + 1);\n result.start.imply('day', date.date());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.tags['ESDeadlineFormatParser'] = true;\n return result;\n };\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)hace\\s*([0-9]+|medi[oa]|una?)\\s*(minutos?|horas?|semanas?|d[ií]as?|mes(es)?|años?)(?=(?:\\W|$))/i;\n\nexports.Parser = function ESTimeAgoFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return PATTERN;\n }\n\n this.extract = function(text, ref, match, opt){\n\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n let index = match.index + match[1].length;\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var num = parseInt(match[2]);\n if (isNaN(num)) {\n if (match[2].match(/medi/)) {\n num = 0.5;\n } else {\n num = 1;\n }\n }\n\n var date = dayjs(ref);\n\n if (match[3].match(/hora/) || match[3].match(/minuto/)) {\n if (match[3].match(/hora/)) {\n\n date = date.add(-num, 'hour');\n\n } else if (match[3].match(/minuto/)) {\n\n date = date.add(-num, 'minute');\n }\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.tags['ESTimeAgoFormatParser'] = true;\n return result;\n }\n\n if (match[3].match(/semana/)) {\n date = date.add(-num, 'week');\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n result.start.imply('weekday', date.day());\n return result;\n }\n\n if (match[3].match(/d[ií]a/)) {\n date = date.add(-num, 'd');\n }\n\n if (match[3].match(/mes/)) {\n date = date.add(-num, 'month');\n }\n\n if (match[3].match(/año/)) {\n\n date = date.add(-num, 'year');\n }\n\n result.start.assign('day', date.date());\n result.start.assign('month', date.month() + 1);\n result.start.assign('year', date.year());\n return result;\n\n };\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar ParsedComponents = require('../../result').ParsedComponents;\n\nvar FIRST_REG_PATTERN = new RegExp(\"(^|\\\\s|T)\" +\n \"(?:(?:a las?|al?|desde|de)\\\\s*)?\" +\n \"(\\\\d{1,4}|mediod[ií]a|medianoche)\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\:|\\\\:)(\\\\d{2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\n \"(?=\\\\W|$)\", 'i');\n\n\nvar SECOND_REG_PATTERN = new RegExp(\"^\\\\s*\" +\n \"(\\\\-|\\\\–|\\\\~|\\\\〜|a(?:\\s*las)?|\\\\?)\\\\s*\" +\n \"(\\\\d{1,4})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\n \"(?=\\\\W|$)\", 'i');\n\nvar HOUR_GROUP = 2;\nvar MINUTE_GROUP = 3;\nvar SECOND_GROUP = 4;\nvar AM_PM_HOUR_GROUP = 5;\n\nexports.Parser = function ESTimeExpressionParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return FIRST_REG_PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n // This pattern can be overlaped Ex. [12] AM, 1[2] AM\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n var refMoment = dayjs(ref);\n var result = new ParsedResult();\n result.ref = ref;\n result.index = match.index + match[1].length;\n result.text = match[0].substring(match[1].length);\n result.tags['ESTimeExpressionParser'] = true;\n\n result.start.imply('day', refMoment.date());\n result.start.imply('month', refMoment.month()+1);\n result.start.imply('year', refMoment.year());\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.start.assign('second', second);\n }\n\n // ----- Hours\n if (match[HOUR_GROUP].toLowerCase().match(/mediod/)){\n meridiem = 1;\n hour = 12;\n } else if (match[HOUR_GROUP].toLowerCase() == \"medianoche\") {\n meridiem = 0;\n hour = 0;\n } else {\n hour = parseInt(match[HOUR_GROUP]);\n }\n\n // ----- Minutes\n if(match[MINUTE_GROUP] != null){\n minute = parseInt(match[MINUTE_GROUP]);\n } else if(hour > 100) {\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if(match[AM_PM_HOUR_GROUP] != null) {\n if(hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if(ampm == \"a\"){\n meridiem = 0;\n if(hour == 12) hour = 0;\n }\n\n if(ampm == \"p\"){\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n }\n result.start.assign('hour', hour);\n result.start.assign('minute', minute);\n if (meridiem >= 0) {\n result.start.assign('meridiem', meridiem);\n }\n\n // ==============================================================\n // Extracting the 'to' chunk\n // ==============================================================\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n // Not accept number only result\n if (result.text.match(/^\\d+$/)) {\n return null;\n }\n return result;\n }\n\n\n\n // Pattern \"YY.YY -XXXX\" is more like timezone offset\n if (match[0].match(/^\\s*(\\+|\\-)\\s*\\d{3,4}$/)) {\n return result;\n }\n\n if(result.end == null){\n result.end = new ParsedComponents(null, result.start.date());\n }\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.end.assign('second', second);\n }\n\n hour = parseInt(match[2]);\n\n // ----- Minute\n if (match[MINUTE_GROUP]!= null) {\n\n minute = parseInt(match[MINUTE_GROUP]);\n if(minute >= 60) return result;\n\n } else if (hour > 100) {\n\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP] != null){\n\n if (hour > 12) return null;\n\n if(match[AM_PM_HOUR_GROUP][0].toLowerCase() == \"a\"){\n meridiem = 0;\n if(hour == 12) {\n hour = 0;\n if (!result.end.isCertain('day')) {\n result.end.imply('day', result.end.get('day') + 1);\n }\n }\n }\n\n if(match[AM_PM_HOUR_GROUP][0].toLowerCase() == \"p\"){\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n\n if (!result.start.isCertain('meridiem')) {\n if (meridiem == 0) {\n\n result.start.imply('meridiem', 0);\n\n if (result.start.get('hour') == 12) {\n result.start.assign('hour', 0);\n }\n\n } else {\n\n result.start.imply('meridiem', 1);\n\n if (result.start.get('hour') != 12) {\n result.start.assign('hour', result.start.get('hour') + 12);\n }\n }\n }\n\n } else if(hour >= 12) {\n meridiem = 1;\n }\n\n result.text = result.text + match[0];\n result.end.assign('hour', hour);\n result.end.assign('minute', minute);\n if (meridiem >= 0) {\n result.end.assign('meridiem', meridiem);\n }\n\n if (result.end.date().getTime() < result.start.date().getTime()) {\n result.end.imply('day', result.end.get('day') + 1)\n }\n\n return result;\n }\n}\n","var Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar updateParsedComponent = require('../en/ENWeekdayParser').updateParsedComponent;\n\nvar DAYS_OFFSET = { 'domingo': 0, 'dom': 0, 'lunes': 1, 'lun': 1, 'martes': 2, 'mar':2, 'miercoles': 3, 'miércoles': 3, 'mie': 3,\n 'jueves': 4, 'jue': 4, 'viernes': 5, 'vier': 5, 'sabado': 6, 'sábado': 6, 'sab': 6,}\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:(?:\\\\,|\\\\(|\\\\()\\\\s*)?' +\n '(?:(este|pasado|pr[oó]ximo)\\\\s*)?' +\n '(' + Object.keys(DAYS_OFFSET).join('|') + ')' +\n '(?:\\\\s*(?:\\\\,|\\\\)|\\\\)))?' +\n '(?:\\\\s*(este|pasado|pr[óo]ximo)\\\\s*week)?' +\n '(?=\\\\W|$)', 'i');\n\nvar PREFIX_GROUP = 2;\nvar WEEKDAY_GROUP = 3;\nvar POSTFIX_GROUP = 4;\n\nexports.Parser = function ESWeekdayParser() {\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n var index = match.index + match[1].length;\n var text = match[0].substr(match[1].length, match[0].length - match[1].length);\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();\n var offset = DAYS_OFFSET[dayOfWeek];\n if(offset === undefined) return null;\n\n var modifier = null;\n var prefix = match[PREFIX_GROUP];\n var postfix = match[POSTFIX_GROUP];\n if (prefix || postfix) {\n var norm = prefix || postfix;\n norm = norm.toLowerCase();\n\n if(norm == 'pasado') {\n modifier = 'this';\n }\n else if(norm == 'próximo' || norm == 'proximo') {\n modifier = 'next';\n }\n else if(norm== 'este') {\n modifier = 'this';\n }\n }\n\n updateParsedComponent(result, ref, offset, modifier);\n result.tags['ESWeekdayParser'] = true;\n return result;\n }\n}\n","var parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar util = require('../../utils/ES');\n\nvar DAYS_OFFSET = util.WEEKDAY_OFFSET;\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:(Domingo|Lunes|Martes|Miércoles|Miercoles|Jueves|Viernes|Sábado|Sabado|Dom|Lun|Mar|Mie|Jue|Vie|Sab)\\\\s*,?\\\\s*)?' +\n '([0-9]{1,2})(?:º|ª|°)?' +\n '(?:\\\\s*(?:desde|de|\\\\-|\\\\–|al?|hasta|\\\\s)\\\\s*([0-9]{1,2})(?:º|ª|°)?)?\\\\s*(?:de)?\\\\s*' +\n '(Ene(?:ro|\\\\.)?|Feb(?:rero|\\\\.)?|Mar(?:zo|\\\\.)?|Abr(?:il|\\\\.)?|May(?:o|\\\\.)?|Jun(?:io|\\\\.)?|Jul(?:io|\\\\.)?|Ago(?:sto|\\\\.)?|Sep(?:tiembre|\\\\.)?|Set(?:iembre|\\\\.)?|Oct(?:ubre|\\\\.)?|Nov(?:iembre|\\\\.)?|Dic(?:iembre|\\\\.)?)' +\n '(?:\\\\s*(?:del?)?(\\\\s*[0-9]{1,4}(?![^\\\\s]\\\\d))(\\\\s*[ad]\\\\.?\\\\s*c\\\\.?|a\\\\.?\\\\s*d\\\\.?)?)?' +\n '(?=\\\\W|$)', 'i'\n );\n\nvar WEEKDAY_GROUP = 2;\nvar DATE_GROUP = 3;\nvar DATE_TO_GROUP = 4;\nvar MONTH_NAME_GROUP = 5;\nvar YEAR_GROUP = 6;\nvar YEAR_BE_GROUP = 7;\n\nexports.Parser = function ESMonthNameLittleEndianParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n\n var day = match[DATE_GROUP];\n day = parseInt(day);\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n year = parseInt(year);\n\n if(match[YEAR_BE_GROUP]){\n if (/a\\.?\\s*c\\.?/i.test(match[YEAR_BE_GROUP])) {\n // antes de Cristo\n year = -year;\n }\n } else if (year < 100){\n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month);\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n // Weekday component\n if (match[WEEKDAY_GROUP]) {\n var weekday = match[WEEKDAY_GROUP];\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()]\n result.start.assign('weekday', weekday);\n }\n\n // Text can be 'range' value. Such as '12 - 13 January 2012'\n if (match[DATE_TO_GROUP]) {\n result.end = result.start.clone();\n result.end.assign('day', parseInt(match[DATE_TO_GROUP]));\n }\n\n result.tags['ESMonthNameLittleEndianParser'] = true;\n return result;\n };\n}\n","exports.WEEKDAY_OFFSET = {\n 'domingo': 0,\n 'dom': 0,\n 'lunes': 1,\n 'lun': 1,\n 'martes': 2,\n 'mar':2,\n 'miércoles': 3,\n 'miercoles': 3,\n 'mie': 3,\n 'jueves': 4,\n 'jue': 4,\n 'viernes': 5,\n 'vie': 5,\n 'sábado': 6,\n 'sabado': 6,\n 'sab': 6,}\n\nexports.MONTH_OFFSET = {\n 'enero': 1,\n 'ene': 1,\n 'ene.': 1,\n 'febrero': 2,\n 'feb': 2,\n 'feb.': 2,\n 'marzo': 3,\n 'mar': 3,\n 'mar.': 3,\n 'abril': 4,\n 'abr': 4,\n 'abr.': 4,\n 'mayo': 5,\n 'may': 5,\n 'may.': 5,\n 'junio': 6,\n 'jun': 6,\n 'jun.': 6,\n 'julio': 7,\n 'jul': 7,\n 'jul.': 7,\n 'agosto': 8,\n 'ago': 8,\n 'ago.': 8,\n 'septiembre': 9,\n 'sep': 9,\n 'sept': 9,\n 'sep.': 9,\n 'sept.': 9,\n 'octubre': 10,\n 'oct': 10,\n 'oct.': 10,\n 'noviembre': 11,\n 'nov': 11,\n 'nov.': 11,\n 'diciembre': 12,\n 'dic': 12,\n 'dic.': 12,\n}\n","/*\n Date format with slash \"/\" (also \"-\" and \".\") between numbers\n - Martes 3/11/2015\n - 3/11/2015\n - 3/11\n*/\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:' +\n '((?:domingo|dom|lunes|lun|martes|mar|mi[ée]rcoles|mie|jueves|jue|viernes|vie|s[áa]bado|sab))' +\n '\\\\s*\\\\,?\\\\s*' +\n ')?' +\n '([0-1]{0,1}[0-9]{1})[\\\\/\\\\.\\\\-]([0-3]{0,1}[0-9]{1})' +\n '(?:' +\n '[\\\\/\\\\.\\\\-]' +\n '([0-9]{4}\\s*\\,?\\s*|[0-9]{2}\\s*\\,?\\s*)' +\n ')?' +\n '(\\\\W|$)', 'i');\n\nvar DAYS_OFFSET = { 'domingo': 0, 'dom': 0, 'lunes': 1, 'lun': 1, 'martes': 2, 'mar': 2, 'miercoles': 3, 'miércoles': 3, 'mie': 3,\n 'jueves': 4, 'jue': 4, 'viernes': 5, 'vier': 5, 'sábado': 6, 'sabado': 6, 'sab': 6,}\n\n\nvar OPENNING_GROUP = 1;\nvar ENDING_GROUP = 6;\n\n// in Spanish we use day/month/year\nvar WEEKDAY_GROUP = 2;\nvar MONTH_GROUP = 4;\nvar DAY_GROUP = 3;\nvar YEAR_GROUP = 5;\n\nexports.Parser = function ESSlashDateFormatParser(argument) {\n Parser.apply(this, arguments);\n\n this.pattern = function () { return PATTERN; };\n this.extract = function(text, ref, match, opt){\n\n if(match[OPENNING_GROUP] == '/' || match[ENDING_GROUP] == '/') {\n // Long skip, if there is some overlapping like:\n // XX[/YY/ZZ]\n // [XX/YY/]ZZ\n match.index += match[0].length\n return;\n }\n\n var index = match.index + match[OPENNING_GROUP].length;\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length - match[ENDING_GROUP].length);\n\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n });\n\n if(text.match(/^\\d\\.\\d$/)) return;\n if(text.match(/^\\d\\.\\d{1,2}\\.\\d{1,2}$/)) return;\n\n // MM/dd -> OK\n // MM.dd -> NG\n if(!match[YEAR_GROUP] && match[0].indexOf('/') < 0) return;\n\n var date = null;\n var year = match[YEAR_GROUP] || dayjs(ref).year() + '';\n var month = match[MONTH_GROUP];\n var day = match[DAY_GROUP];\n\n month = parseInt(month);\n day = parseInt(day);\n year = parseInt(year);\n\n if(month < 1 || month > 12) {\n if(month > 12) {\n // dd/mm/yyyy date format if day looks like a month, and month\n // looks like a day.\n if (day >= 1 && day <= 12 && month >= 13 && month <= 31) {\n // unambiguous\n var tday = month;\n month = day;\n day = tday;\n }\n else {\n // both month and day are <= 12\n return null;\n }\n }\n }\n if(day < 1 || day > 31) return null;\n\n if(year < 100){\n if(year > 50){\n year = year + 1900;\n }else{\n year = year + 2000;\n }\n }\n\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n\n //Day of week\n if(match[WEEKDAY_GROUP]) {\n result.start.assign('weekday', DAYS_OFFSET[match[WEEKDAY_GROUP].toLowerCase()]);\n }\n\n result.tags['ESSlashDateFormatParser'] = true;\n return result;\n };\n};","const dayjs = require('dayjs');\r\nvar Parser = require('../parser').Parser;\r\nvar ParsedResult = require('../../result').ParsedResult;\r\n\r\nvar PATTERN = /(\\W|^)(maintenant|aujourd'hui|ajd|cette\\s*nuit|la\\s*veille|(demain|hier)(\\s*(matin|soir|aprem|après-midi))?|ce\\s*(matin|soir)|cet\\s*(après-midi|aprem))(?=\\W|$)/i;\r\n\r\nexports.Parser = function FRCasualDateParser(){\r\n\r\n Parser.apply(this, arguments);\r\n\r\n this.pattern = function() { return PATTERN; }\r\n\r\n this.extract = function(text, ref, match, opt){\r\n\r\n var text = match[0].substr(match[1].length);\r\n var index = match.index + match[1].length;\r\n var result = new ParsedResult({\r\n index: index,\r\n text: text,\r\n ref: ref,\r\n });\r\n\r\n var refMoment = dayjs(ref);\r\n var startMoment = refMoment;\r\n var lowerText = text.toLowerCase();\r\n\r\n if(lowerText.match(/demain/)){\r\n // Check not \"Tomorrow\" on late night\r\n if(refMoment.hour() > 1) {\r\n startMoment = startMoment.add(1, 'day');\r\n }\r\n } \r\n\r\n if(lowerText.match(/hier/)) {\r\n startMoment = startMoment.add(-1, 'day');\r\n }\r\n\r\n if(lowerText.match(/cette\\s*nuit/)){\r\n // Normally means this coming midnight\r\n result.start.imply('hour', 22);\r\n result.start.imply('meridiem', 1);\r\n\r\n } else if(lowerText.match(/la\\s*veille/)) {\r\n\r\n result.start.imply('hour', 0);\r\n if (refMoment.hour() > 6) {\r\n startMoment = startMoment.add(-1, 'day');\r\n }\r\n\r\n } else if (lowerText.match(/(après-midi|aprem)/)) {\r\n\r\n result.start.imply('hour', 14);\r\n\r\n } else if (lowerText.match(/(soir)/)) {\r\n\r\n result.start.imply('hour', 18);\r\n\r\n } else if (lowerText.match(/matin/)) {\r\n\r\n result.start.imply('hour', 8);\r\n\r\n } else if (lowerText.match(\"maintenant\")) {\r\n\r\n result.start.imply('hour', refMoment.hour());\r\n result.start.imply('minute', refMoment.minute());\r\n result.start.imply('second', refMoment.second());\r\n result.start.imply('millisecond', refMoment.millisecond());\r\n\r\n }\r\n\r\n result.start.assign('day', startMoment.date())\r\n result.start.assign('month', startMoment.month() + 1)\r\n result.start.assign('year', startMoment.year())\r\n result.tags['FRCasualDateParser'] = true;\r\n return result;\r\n }\r\n}\r\n","const dayjs = require('dayjs');\r\nvar Parser = require('../parser').Parser;\r\nvar ParsedResult = require('../../result').ParsedResult;\r\nvar util = require('../../utils/FR');\r\n\r\nvar PATTERN = new RegExp('(\\\\W|^)' +\r\n '(dans|en)\\\\s*' +\r\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|une?|(?:\\\\s*quelques)?|demi(?:\\\\s*|-?)?)\\\\s*' +\r\n '(secondes?|min(?:ute)?s?|heures?|jours?|semaines?|mois|années?)\\\\s*' +\r\n '(?=\\\\W|$)', 'i'\r\n);\r\n\r\nvar STRICT_PATTERN = new RegExp('(\\\\W|^)' +\r\n '(dans|en)\\\\s*' +\r\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|un?)\\\\s*' +\r\n '(secondes?|minutes?|heures?|jours?)\\\\s*' +\r\n '(?=\\\\W|$)', 'i'\r\n);\r\n\r\nexports.Parser = function FRDeadlineFormatParser(){\r\n Parser.apply(this, arguments);\r\n\r\n this.pattern = function() {\r\n return this.isStrictMode()? STRICT_PATTERN : PATTERN;\r\n };\r\n\r\n this.extract = function(text, ref, match, opt){\r\n\r\n var index = match.index + match[1].length;\r\n var text = match[0];\r\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\r\n\r\n var result = new ParsedResult({\r\n index: index,\r\n text: text,\r\n ref: ref\r\n });\r\n\r\n var num = match[3];\r\n if (util.INTEGER_WORDS[num] !== undefined) {\r\n num = util.INTEGER_WORDS[num];\r\n } else if (num === 'un' || num === 'une'){\r\n num = 1;\r\n } else if (num.match(/quelques?/i)){\r\n num = 3;\r\n } else if (num.match(/demi-?/i)) {\r\n num = 0.5;\r\n } else {\r\n num = parseInt(num);\r\n }\r\n\r\n var date = dayjs(ref);\r\n if (match[4].match(/jour|semaine|mois|année/i)) {\r\n\r\n if (match[4].match(/jour/)) {\r\n date = date.add(num, 'd');\r\n } else if (match[4].match(/semaine/i)) {\r\n date = date.add(num * 7, 'd');\r\n } else if (match[4].match(/mois/i)) {\r\n date = date.add(num, 'month');\r\n } else if (match[4].match(/année/i)) {\r\n date = date.add(num, 'year');\r\n }\r\n\r\n result.start.assign('year', date.year());\r\n result.start.assign('month', date.month() + 1);\r\n result.start.assign('day', date.date());\r\n return result;\r\n }\r\n\r\n if (match[4].match(/heure/i)) {\r\n\r\n date = date.add(num, 'hour');\r\n\r\n } else if (match[4].match(/min/i)) {\r\n\r\n date = date.add(num, 'minutes');\r\n\r\n } else if (match[4].match(/secondes/i)) {\r\n\r\n date = date.add(num, 'second');\r\n }\r\n\r\n result.start.imply('year', date.year());\r\n result.start.imply('month', date.month() + 1);\r\n result.start.imply('day', date.date());\r\n result.start.assign('hour', date.hour());\r\n result.start.assign('minute', date.minute());\r\n result.start.assign('second', date.second());\r\n result.tags['FRDeadlineFormatParser'] = true;\r\n return result;\r\n };\r\n};\r\n","const parser = require('../parser');\r\nvar ParsedResult = require('../../result').ParsedResult;\r\n\r\nvar util = require('../../utils/FR');\r\n\r\nvar DAYS_OFFSET = util.WEEKDAY_OFFSET;\r\n\r\nvar PATTERN = new RegExp('(\\\\W|^)' +\r\n '(?:(Dimanche|Lundi|Mardi|mercredi|Jeudi|Vendredi|Samedi|Dim|Lun|Mar|Mer|Jeu|Ven|Sam)\\\\s*,?\\\\s*)?' +\r\n '([0-9]{1,2}|1er)' +\r\n '(?:\\\\s*(?:au|\\\\-|\\\\–|jusqu\\'au?|\\\\s)\\\\s*([0-9]{1,2})(?:er)?)?\\\\s*(?:de)?\\\\s*' +\r\n '(Jan(?:vier|\\\\.)?|F[ée]v(?:rier|\\\\.)?|Mars|Avr(?:il|\\\\.)?|Mai|Juin|Juil(?:let|\\\\.)?|Ao[uû]t|Sept(?:embre|\\\\.)?|Oct(?:obre|\\\\.)?|Nov(?:embre|\\\\.)?|d[ée]c(?:embre|\\\\.)?)' +\r\n '(?:\\\\s*(\\\\s*[0-9]{1,4}(?![^\\\\s]\\\\d))(?:\\\\s*(AC|[ap]\\\\.?\\\\s*c(?:h(?:r)?)?\\\\.?\\\\s*n\\\\.?))?)?' +\r\n '(?=\\\\W|$)', 'i'\r\n );\r\n\r\nvar WEEKDAY_GROUP = 2;\r\nvar DATE_GROUP = 3;\r\nvar DATE_TO_GROUP = 4;\r\nvar MONTH_NAME_GROUP = 5;\r\nvar YEAR_GROUP = 6;\r\nvar YEAR_BE_GROUP = 7;\r\n\r\nexports.Parser = function FRMonthNameLittleEndianParser(){\r\n parser.Parser.apply(this, arguments);\r\n\r\n this.pattern = function() { return PATTERN; }\r\n\r\n this.extract = function(text, ref, match, opt){\r\n\r\n var result = new ParsedResult({\r\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\r\n index: match.index + match[1].length,\r\n ref: ref,\r\n });\r\n\r\n var month = match[MONTH_NAME_GROUP];\r\n month = util.MONTH_OFFSET[month.toLowerCase()];\r\n\r\n var day = match[DATE_GROUP];\r\n day = parseInt(day);\r\n\r\n var year = null;\r\n if (match[YEAR_GROUP]) {\r\n year = match[YEAR_GROUP];\r\n year = parseInt(year);\r\n\r\n if(match[YEAR_BE_GROUP]){\r\n if (/a/i.test(match[YEAR_BE_GROUP])) {\r\n // Ante Christe natum\r\n year = -year;\r\n }\r\n } else if (year < 100){\r\n\r\n year = year + 2000;\r\n }\r\n }\r\n\r\n if(year){\r\n result.start.assign('day', day);\r\n result.start.assign('month', month);\r\n result.start.assign('year', year);\r\n } else {\r\n year = parser.findYearClosestToRef(ref, day, month)\r\n result.start.assign('day', day);\r\n result.start.assign('month', month);\r\n result.start.imply('year', year);\r\n }\r\n\r\n // Weekday component\r\n if (match[WEEKDAY_GROUP]) {\r\n var weekday = match[WEEKDAY_GROUP];\r\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()]\r\n result.start.assign('weekday', weekday);\r\n }\r\n\r\n // Text can be 'range' value. Such as '12 - 13 janvier 2012'\r\n if (match[DATE_TO_GROUP]) {\r\n result.end = result.start.clone();\r\n result.end.assign('day', parseInt(match[DATE_TO_GROUP]));\r\n }\r\n\r\n result.tags['FRMonthNameLittleEndianParser'] = true;\r\n return result;\r\n };\r\n}\r\n","/*\r\n Date format with slash \"/\" (also \"-\" and \".\") between numbers\r\n - Martes 3/11/2015\r\n - 3/11/2015\r\n - 3/11\r\n*/\r\nvar parser = require('../parser');\r\nvar ParsedResult = require('../../result').ParsedResult;\r\n\r\nvar PATTERN = new RegExp('(\\\\W|^)' +\r\n '(?:' +\r\n '((?:dimanche|dim|lundi|lun|mardi|mar|mercredi|mer|jeudi|jeu|vendredi|ven|samedi|sam|le))' +\r\n '\\\\s*\\\\,?\\\\s*' +\r\n ')?' +\r\n '([0-3]{0,1}[0-9]{1})[\\\\/\\\\.\\\\-]([0-3]{0,1}[0-9]{1})' +\r\n '(?:' +\r\n '[\\\\/\\\\.\\\\-]' +\r\n '([0-9]{4}\\s*\\,?\\s*|[0-9]{2}\\s*\\,?\\s*)' +\r\n ')?' +\r\n '(\\\\W|$)', 'i');\r\n\r\nvar DAYS_OFFSET = { 'dimanche': 0, 'dim': 0, 'lundi': 1, 'lun': 1,'mardi': 2, 'mar':2, 'mercredi': 3, 'mer': 3,\r\n 'jeudi': 4, 'jeu':4, 'vendredi': 5, 'ven': 5,'samedi': 6, 'sam': 6};\r\n\r\n\r\nvar OPENNING_GROUP = 1;\r\nvar ENDING_GROUP = 6;\r\n\r\n// In French we use day/month/year\r\nvar WEEKDAY_GROUP = 2;\r\nvar DAY_GROUP = 3;\r\nvar MONTH_GROUP = 4;\r\nvar YEAR_GROUP = 5;\r\n\r\nexports.Parser = function FRSlashDateFormatParser(argument) {\r\n parser.Parser.apply(this, arguments);\r\n\r\n this.pattern = function () { return PATTERN; };\r\n this.extract = function(text, ref, match, opt){\r\n\r\n if(match[OPENNING_GROUP] == '/' || match[ENDING_GROUP] == '/') {\r\n // Long skip, if there is some overlapping like:\r\n // XX[/YY/ZZ]\r\n // [XX/YY/]ZZ\r\n match.index += match[0].length\r\n return;\r\n }\r\n\r\n var index = match.index + match[OPENNING_GROUP].length;\r\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length - match[ENDING_GROUP].length);\r\n\r\n\r\n var result = new ParsedResult({\r\n text: text,\r\n index: index,\r\n ref: ref,\r\n });\r\n\r\n if(text.match(/^\\d\\.\\d$/)) return;\r\n if(text.match(/^\\d\\.\\d{1,2}\\.\\d{1,2}$/)) return;\r\n\r\n // MM/dd -> OK\r\n // MM.dd -> NG\r\n if(!match[YEAR_GROUP] && match[0].indexOf('/') < 0) return;\r\n\r\n var date = null;\r\n var month = match[MONTH_GROUP];\r\n var day = match[DAY_GROUP];\r\n\r\n day = parseInt(day);\r\n month = parseInt(month);\r\n\r\n var year = null;\r\n if (match[YEAR_GROUP]) {\r\n year = match[YEAR_GROUP];\r\n year = parseInt(year);\r\n\r\n if (year < 100){\r\n year = year + 2000;\r\n }\r\n }\r\n\r\n if(month < 1 || month > 12) {\r\n if(month > 12) {\r\n // dd/mm/yyyy date format if day looks like a month, and month looks like a day.\r\n if (day >= 1 && day <= 12 && month >= 13 && month <= 31) {\r\n // unambiguous\r\n var tday = month;\r\n month = day;\r\n day = tday;\r\n }\r\n else {\r\n // both month and day are <= 12\r\n return null;\r\n }\r\n }\r\n }\r\n\r\n if(day < 1 || day > 31) return null;\r\n\r\n if(year){\r\n result.start.assign('day', day);\r\n result.start.assign('month', month);\r\n result.start.assign('year', year);\r\n } else {\r\n year = parser.findYearClosestToRef(ref, day, month)\r\n result.start.assign('day', day);\r\n result.start.assign('month', month);\r\n result.start.imply('year', year);\r\n }\r\n\r\n // Day of week\r\n if(match[WEEKDAY_GROUP]) {\r\n result.start.assign('weekday', DAYS_OFFSET[match[WEEKDAY_GROUP].toLowerCase()]);\r\n }\r\n\r\n result.tags['FRSlashDateFormatParser'] = true;\r\n return result;\r\n };\r\n};","const dayjs = require('dayjs');\r\nvar Parser = require('../parser').Parser;\r\nvar ParsedResult = require('../../result').ParsedResult;\r\n\r\nvar PATTERN = /(\\W|^)il y a\\s*([0-9]+|une?)\\s*(minutes?|heures?|semaines?|jours?|mois|années?|ans?)(?=(?:\\W|$))/i;\r\n\r\nexports.Parser = function FRTimeAgoFormatParser(){\r\n Parser.apply(this, arguments);\r\n\r\n this.pattern = function() {\r\n return PATTERN;\r\n }\r\n\r\n this.extract = function(text, ref, match, opt){\r\n\r\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\r\n\r\n var text = match[0];\r\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\r\n let index = match.index + match[1].length;\r\n\r\n var result = new ParsedResult({\r\n index: index,\r\n text: text,\r\n ref: ref,\r\n });\r\n result.tags['FRTimeAgoFormatParser'] = true;\r\n \r\n var num = parseInt(match[2]);\r\n if (isNaN(num)) {\r\n if (match[2].match(/demi/)) {\r\n num = 0.5;\r\n } else {\r\n num = 1;\r\n }\r\n }\r\n\r\n var date = dayjs(ref);\r\n\r\n if (match[3].match(/heure/) || match[3].match(/minute/)) {\r\n if (match[3].match(/heure/)) {\r\n\r\n date = date.add(-num, 'hour');\r\n\r\n } else if (match[3].match(/minute/)) {\r\n\r\n date = date.add(-num, 'minute');\r\n }\r\n\r\n result.start.imply('day', date.date());\r\n result.start.imply('month', date.month() + 1);\r\n result.start.imply('year', date.year());\r\n result.start.assign('hour', date.hour());\r\n result.start.assign('minute', date.minute());\r\n\r\n return result;\r\n }\r\n\r\n if (match[3].match(/semaine/)) {\r\n date = date.add(-num, 'week');\r\n\r\n result.start.imply('day', date.date());\r\n result.start.imply('month', date.month() + 1);\r\n result.start.imply('year', date.year());\r\n result.start.imply('weekday', date.day());\r\n return result;\r\n }\r\n\r\n if (match[3].match(/jour/)) {\r\n date = date.add(-num, 'd');\r\n }\r\n\r\n if (match[3].match(/mois/)) {\r\n date = date.add(-num, 'month');\r\n }\r\n\r\n if (match[3].match(/années?|ans?/)) {\r\n date = date.add(-num, 'year');\r\n }\r\n\r\n result.start.assign('day', date.date());\r\n result.start.assign('month', date.month() + 1);\r\n result.start.assign('year', date.year());\r\n return result;\r\n\r\n };\r\n}\r\n","const dayjs = require('dayjs');\r\nvar Parser = require('../parser').Parser;\r\nvar ParsedResult = require('../../result').ParsedResult;\r\nvar ParsedComponents = require('../../result').ParsedComponents;\r\n\r\nvar FIRST_REG_PATTERN = new RegExp(\"(^|\\\\s|T)\" +\r\n \"(?:(?:[àa])\\\\s*)?\" +\r\n \"(\\\\d{1,2}(?:h)?|midi|minuit)\" +\r\n \"(?:\" +\r\n \"(?:\\\\.|\\\\:|\\\\:|h)(\\\\d{1,2})(?:m)?\" +\r\n \"(?:\" +\r\n \"(?:\\\\:|\\\\:|m)(\\\\d{0,2})(?:s)?\" +\r\n \")?\" +\r\n \")?\" +\r\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\r\n \"(?=\\\\W|$)\", 'i');\r\n\r\n\r\nvar SECOND_REG_PATTERN = new RegExp(\"^\\\\s*\" +\r\n \"(\\\\-|\\\\–|\\\\~|\\\\〜|[àa]|\\\\?)\\\\s*\" +\r\n \"(\\\\d{1,2}(?:h)?)\" +\r\n \"(?:\" +\r\n \"(?:\\\\.|\\\\:|\\\\:|h)(\\\\d{1,2})(?:m)?\" +\r\n \"(?:\" +\r\n \"(?:\\\\.|\\\\:|\\\\:|m)(\\\\d{1,2})(?:s)?\" +\r\n \")?\" +\r\n \")?\" +\r\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\r\n \"(?=\\\\W|$)\", 'i');\r\n\r\nvar HOUR_GROUP = 2;\r\nvar MINUTE_GROUP = 3;\r\nvar SECOND_GROUP = 4;\r\nvar AM_PM_HOUR_GROUP = 5;\r\n\r\nexports.Parser = function FRTimeExpressionParser(){\r\n Parser.apply(this, arguments);\r\n\r\n this.pattern = function() { return FIRST_REG_PATTERN; }\r\n\r\n this.extract = function(text, ref, match, opt){\r\n\r\n // This pattern can be overlaped Ex. [12] AM, 1[2] AM\r\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\r\n var refMoment = dayjs(ref);\r\n var result = new ParsedResult();\r\n result.ref = ref;\r\n result.index = match.index + match[1].length;\r\n result.text = match[0].substring(match[1].length);\r\n result.tags['FRTimeExpressionParser'] = true;\r\n\r\n result.start.imply('day', refMoment.date());\r\n result.start.imply('month', refMoment.month()+1);\r\n result.start.imply('year', refMoment.year());\r\n\r\n var hour = 0;\r\n var minute = 0;\r\n var meridiem = -1;\r\n\r\n // ----- Second\r\n if(match[SECOND_GROUP] != null){\r\n var second = parseInt(match[SECOND_GROUP]);\r\n if(second >= 60) return null;\r\n\r\n result.start.assign('second', second);\r\n }\r\n\r\n // ----- Hours\r\n if (match[HOUR_GROUP].toLowerCase() == \"midi\"){\r\n meridiem = 1;\r\n hour = 12;\r\n } else if (match[HOUR_GROUP].toLowerCase() == \"minuit\") {\r\n meridiem = 0;\r\n hour = 0;\r\n } else {\r\n hour = parseInt(match[HOUR_GROUP]);\r\n }\r\n\r\n // ----- Minutes\r\n if(match[MINUTE_GROUP] != null){\r\n minute = parseInt(match[MINUTE_GROUP]);\r\n } else if(hour > 100) {\r\n minute = hour%100;\r\n hour = parseInt(hour/100);\r\n }\r\n\r\n if(minute >= 60) {\r\n return null;\r\n }\r\n\r\n if(hour > 24) {\r\n return null;\r\n }\r\n if (hour >= 12) {\r\n meridiem = 1;\r\n }\r\n\r\n // ----- AM & PM\r\n if(match[AM_PM_HOUR_GROUP] != null) {\r\n if(hour > 12) return null;\r\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\r\n if(ampm == \"a\"){\r\n meridiem = 0;\r\n if(hour == 12) hour = 0;\r\n }\r\n\r\n if(ampm == \"p\"){\r\n meridiem = 1;\r\n if(hour != 12) hour += 12;\r\n }\r\n }\r\n result.start.assign('hour', hour);\r\n result.start.assign('minute', minute);\r\n if (meridiem >= 0) {\r\n result.start.assign('meridiem', meridiem);\r\n }\r\n\r\n // ==============================================================\r\n // Extracting the 'to' chunk\r\n // ==============================================================\r\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\r\n if (!match) {\r\n // Not accept number only result\r\n if (result.text.match(/^\\d+$/)) {\r\n return null;\r\n }\r\n return result;\r\n }\r\n\r\n\r\n\r\n // Pattern \"YY.YY -XXXX\" is more like timezone offset\r\n if (match[0].match(/^\\s*(\\+|\\-)\\s*\\d{3,4}$/)) {\r\n return result;\r\n }\r\n\r\n if(result.end == null){\r\n result.end = new ParsedComponents(null, result.start.date());\r\n }\r\n\r\n var hour = 0;\r\n var minute = 0;\r\n var meridiem = -1;\r\n\r\n // ----- Second\r\n if(match[SECOND_GROUP] != null){\r\n var second = parseInt(match[SECOND_GROUP]);\r\n if(second >= 60) return null;\r\n\r\n result.end.assign('second', second);\r\n }\r\n\r\n hour = parseInt(match[2]);\r\n\r\n // ----- Minute\r\n if (match[MINUTE_GROUP]!= null) {\r\n\r\n minute = parseInt(match[MINUTE_GROUP]);\r\n if(minute >= 60) return result;\r\n\r\n } else if (hour > 100) {\r\n\r\n minute = hour%100;\r\n hour = parseInt(hour/100);\r\n }\r\n\r\n if(minute >= 60) {\r\n return null;\r\n }\r\n\r\n if(hour > 24) {\r\n return null;\r\n }\r\n if (hour >= 12) {\r\n meridiem = 1;\r\n }\r\n\r\n // ----- AM & PM\r\n if (match[AM_PM_HOUR_GROUP] != null){\r\n\r\n if (hour > 12) return null;\r\n\r\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\r\n if(ampm == \"a\"){\r\n meridiem = 0;\r\n if(hour == 12) {\r\n hour = 0;\r\n if (!result.end.isCertain('day')) {\r\n result.end.imply('day', result.end.get('day') + 1);\r\n }\r\n }\r\n }\r\n\r\n if(ampm == \"p\"){\r\n meridiem = 1;\r\n if(hour != 12) hour += 12;\r\n }\r\n\r\n if (!result.start.isCertain('meridiem')) {\r\n if (meridiem == 0) {\r\n\r\n result.start.imply('meridiem', 0);\r\n\r\n if (result.start.get('hour') == 12) {\r\n result.start.assign('hour', 0);\r\n }\r\n\r\n } else {\r\n\r\n result.start.imply('meridiem', 1);\r\n\r\n if (result.start.get('hour') != 12) {\r\n result.start.assign('hour', result.start.get('hour') + 12);\r\n }\r\n }\r\n }\r\n }\r\n\r\n result.text = result.text + match[0];\r\n result.end.assign('hour', hour);\r\n result.end.assign('minute', minute);\r\n if (meridiem >= 0) {\r\n result.end.assign('meridiem', meridiem);\r\n } else {\r\n var startAtPM = result.start.isCertain('meridiem') && result.start.get('meridiem') == 1;\r\n if (startAtPM && result.start.get('hour') > hour) {\r\n // 10pm - 1 (am)\r\n result.end.imply('meridiem', 0);\r\n\r\n } else if (hour > 12) {\r\n result.end.imply('meridiem', 1);\r\n }\r\n }\r\n\r\n if (result.end.date().getTime() < result.start.date().getTime()) {\r\n result.end.imply('day', result.end.get('day') + 1)\r\n }\r\n\r\n return result;\r\n }\r\n}\r\n","var Parser = require('../parser').Parser;\r\nvar ParsedResult = require('../../result').ParsedResult;\r\nvar updateParsedComponent = require('../en/ENWeekdayParser').updateParsedComponent;\r\n\r\nvar DAYS_OFFSET = { 'dimanche': 0, 'dim': 0, 'lundi': 1, 'lun': 1,'mardi': 2, 'mar':2, 'mercredi': 3, 'mer': 3,\r\n 'jeudi': 4, 'jeu':4, 'vendredi': 5, 'ven': 5,'samedi': 6, 'sam': 6};\r\n\r\nvar PATTERN = new RegExp('(\\\\s|^)' +\r\n '(?:(?:\\\\,|\\\\(|\\\\()\\\\s*)?' +\r\n '(?:(ce)\\\\s*)?' +\r\n '(' + Object.keys(DAYS_OFFSET).join('|') + ')' +\r\n '(?:\\\\s*(?:\\\\,|\\\\)|\\\\)))?' +\r\n '(?:\\\\s*(dernier|prochain)\\\\s*)?' +\r\n '(?=\\\\W|$)', 'i');\r\n\r\nvar PREFIX_GROUP = 2;\r\nvar WEEKDAY_GROUP = 3;\r\nvar POSTFIX_GROUP = 4;\r\n\r\nexports.Parser = function FRWeekdayParser() {\r\n Parser.apply(this, arguments);\r\n\r\n this.pattern = function() { return PATTERN; };\r\n\r\n this.extract = function(text, ref, match, opt){\r\n var index = match.index + match[1].length;\r\n var text = match[0].substr(match[1].length, match[0].length - match[1].length);\r\n var result = new ParsedResult({\r\n index: index,\r\n text: text,\r\n ref: ref\r\n });\r\n\r\n var dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();\r\n var offset = DAYS_OFFSET[dayOfWeek];\r\n if(offset === undefined) return null;\r\n\r\n var modifier = null;\r\n var prefix = match[PREFIX_GROUP];\r\n var postfix = match[POSTFIX_GROUP];\r\n if (prefix || postfix) {\r\n var norm = prefix || postfix;\r\n norm = norm.toLowerCase();\r\n\r\n if(norm == 'dernier') {\r\n modifier = 'last';\r\n } else if(norm == 'prochain') {\r\n modifier = 'next';\r\n } else if(norm== 'ce') {\r\n modifier = 'this';\r\n }\r\n }\r\n\r\n updateParsedComponent(result, ref, offset, modifier);\r\n result.tags['FRWeekdayParser'] = true;\r\n return result;\r\n }\r\n};\r\n\r\n","const quarterOfYear = require('dayjs/plugin/quarterOfYear');\nconst dayjs = require('dayjs');\ndayjs.extend(quarterOfYear);\n\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/FR');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:les?|la|l\\'|du|des?)\\\\s*' +\n '('+ util.INTEGER_WORDS_PATTERN + '|\\\\d+)?\\\\s*' +\n '(prochaine?s?|derni[eè]re?s?|pass[ée]e?s?|pr[ée]c[ée]dents?|suivante?s?)?\\\\s*' +\n '(secondes?|min(?:ute)?s?|heures?|jours?|semaines?|mois|trimestres?|années?)\\\\s*' +\n '(prochaine?s?|derni[eè]re?s?|pass[ée]e?s?|pr[ée]c[ée]dents?|suivante?s?)?' +\n '(?=\\\\W|$)', 'i'\n);\n\nvar MULTIPLIER_GROUP = 2;\nvar MODIFIER_1_GROUP = 3;\nvar RELATIVE_WORD_GROUP = 4;\nvar MODIFIER_2_GROUP = 5;\n\nexports.Parser = function FRRelativeDateFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; };\n\n this.extract = function(text, ref, match, opt){\n var index = match.index + match[1].length;\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n\n // Multiplier\n var multiplier = match[MULTIPLIER_GROUP] === undefined ? '1' : match[MULTIPLIER_GROUP];\n if (util.INTEGER_WORDS[multiplier] !== undefined) {\n multiplier = util.INTEGER_WORDS[multiplier];\n } else {\n multiplier = parseInt(multiplier);\n }\n\n // Modifier\n var modifier = match[MODIFIER_1_GROUP] === undefined ?\n (match[MODIFIER_2_GROUP] === undefined ? '' : match[MODIFIER_2_GROUP].toLowerCase())\n : match[MODIFIER_1_GROUP].toLowerCase();\n if(!modifier) {\n // At least one modifier is mandatory to match this parser\n return;\n }\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n result.tags['FRRelativeDateFormatParser'] = true;\n\n var modifierFactor;\n switch(true) {\n case /prochaine?s?/.test(modifier):\n case /suivants?/.test(modifier):\n modifierFactor = 1;\n break;\n case /derni[eè]re?s?/.test(modifier):\n case /pass[ée]e?s?/.test(modifier):\n case /pr[ée]c[ée]dents?/.test(modifier):\n modifierFactor = -1;\n break;\n }\n\n var total = multiplier * modifierFactor;\n\n var dateFrom = dayjs(ref);\n var dateTo = dayjs(ref);\n\n var relative = match[RELATIVE_WORD_GROUP];\n var startOf;\n switch(true) {\n case /secondes?/.test(relative):\n dateFrom = dateFrom.add(total, 's');\n dateTo = dateTo.add(modifierFactor, 's');\n startOf = 'second';\n break;\n case /min(?:ute)?s?/.test(relative):\n dateFrom = dateFrom.add(total, 'm');\n dateTo = dateTo.add(modifierFactor, 'm');\n startOf = 'minute';\n break;\n case /heures?/.test(relative):\n dateFrom = dateFrom.add(total, 'h');\n dateTo = dateTo.add(modifierFactor, 'h');\n startOf = 'hour';\n break;\n case /jours?/.test(relative):\n dateFrom = dateFrom.add(total, 'd');\n dateTo = dateTo.add(modifierFactor, 'd');\n startOf = 'day';\n break;\n case /semaines?/.test(relative):\n dateFrom = dateFrom.add(total, 'w');\n dateTo = dateTo.add(modifierFactor, 'w');\n startOf = 'week';\n break;\n case /mois?/.test(relative):\n dateFrom = dateFrom.add(total, 'M');\n dateTo = dateTo.add(modifierFactor, 'M');\n startOf = 'month';\n break;\n case /trimestres?/.test(relative):\n dateFrom = dateFrom.add(total, 'Q');\n dateTo = dateTo.add(modifierFactor, 'Q');\n startOf = 'quarter';\n break;\n case /années?/.test(relative):\n dateFrom = dateFrom.add(total, 'y');\n dateTo = dateTo.add(modifierFactor, 'y');\n startOf = 'year';\n break;\n }\n\n // if we go forward, switch the start and end dates\n if(modifierFactor > 0) {\n var dateTmp = dateFrom;\n dateFrom = dateTo;\n dateTo = dateTmp;\n }\n\n // Get start and end of dates\n dateFrom = dateFrom.startOf(startOf);\n dateTo = dateTo.endOf(startOf);\n if (startOf == 'week') { // Weekday in FR start on Sat?\n dateFrom = dateFrom.add(1, 'd')\n dateTo = dateTo.add(1, 'd')\n }\n \n\n // Assign results\n result.start.assign('year', dateFrom.year());\n result.start.assign('month', dateFrom.month() + 1);\n result.start.assign('day', dateFrom.date());\n result.start.assign('minute', dateFrom.minute());\n result.start.assign('second', dateFrom.second());\n result.start.assign('hour', dateFrom.hour());\n result.start.assign('millisecond', dateFrom.millisecond());\n\n result.end = result.start.clone();\n result.end.assign('year', dateTo.year());\n result.end.assign('month', dateTo.month() + 1);\n result.end.assign('day', dateTo.date());\n result.end.assign('minute', dateTo.minute());\n result.end.assign('second', dateTo.second());\n result.end.assign('hour', dateTo.hour());\n result.end.assign('millisecond', dateTo.millisecond());\n return result;\n };\n};\n","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs_plugin_quarterOfYear=n()}(this,function(){\"use strict\";var t=\"month\",n=\"quarter\";return function(r,i){var e=i.prototype;e.quarter=function(t){return this.$utils().u(t)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(t-1))};var u=e.add;e.add=function(r,i){return r=Number(r),this.$utils().p(i)===n?this.add(3*r,t):u.bind(this)(r,i)};var s=e.startOf;e.startOf=function(r,i){var e=this.$utils(),u=!!e.u(i)||i;if(e.p(r)===n){var a=this.quarter()-1;return u?this.month(3*a).startOf(t).startOf(\"day\"):this.month(3*a+2).endOf(t).endOf(\"day\")}return s.bind(this)(r,i)}}});\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar util = require('../../utils/ZH-Hant.js');\n\nvar PATTERN = new RegExp(\n '(\\\\d{2,4}|[' + Object.keys(util.NUMBER).join('') + ']{2,4})?' +\n '(?:\\\\s*)' +\n '(?:年)?' +\n '(?:[\\\\s|,|,]*)' +\n '(\\\\d{1,2}|[' + Object.keys(util.NUMBER).join('') + ']{1,2})' +\n '(?:\\\\s*)' +\n '(?:月)' +\n '(?:\\\\s*)' +\n '(\\\\d{1,2}|[' + Object.keys(util.NUMBER).join('') + ']{1,2})?' +\n '(?:\\\\s*)' +\n '(?:日|號)?'\n);\n\nvar YEAR_GROUP = 1;\nvar MONTH_GROUP = 2;\nvar DAY_GROUP = 3;\n\nexports.Parser = function ZHHantDateParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return PATTERN;\n };\n\n this.extract = function(text, ref, match, opt) {\n var startMoment = dayjs(ref);\n var result = new ParsedResult({\n text: match[0],\n index: match.index,\n ref: ref,\n });\n\n //Month\n var month = parseInt(match[MONTH_GROUP]);\n if (isNaN(month)) month = util.zhStringToNumber(match[MONTH_GROUP]);\n result.start.assign('month', month);\n\n //Day\n if (match[DAY_GROUP]) {\n var day = parseInt(match[DAY_GROUP]);\n if (isNaN(day)) day = util.zhStringToNumber(match[DAY_GROUP]);\n result.start.assign('day', day);\n } else {\n result.start.imply('day', startMoment.date());\n }\n\n //Year\n if (match[YEAR_GROUP]) {\n var year = parseInt(match[YEAR_GROUP]);\n if (isNaN(year)) year = util.zhStringToYear(match[YEAR_GROUP]);\n result.start.assign('year', year);\n } else {\n result.start.imply('year', startMoment.year());\n }\n\n result.tags.ZHHantDateParser = true;\n return result;\n };\n};\n","var Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar updateParsedComponent = require('../en/ENWeekdayParser').updateParsedComponent;\n\nvar util = require('../../utils/ZH-Hant.js');\n\nvar PATTERN = new RegExp(\n '(上|今|下|這|呢)?' +\n '(?:個)?' +\n '(?:星期|禮拜)' +\n '(' + Object.keys(util.WEEKDAY_OFFSET).join('|') + ')'\n);\n\nvar PREFIX_GROUP = 1;\nvar WEEKDAY_GROUP = 2;\n\nexports.Parser = function ZHHantWeekdayParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return PATTERN;\n };\n\n this.extract = function(text, ref, match, opt) {\n var index = match.index;\n text = match[0];\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var dayOfWeek = match[WEEKDAY_GROUP];\n var offset = util.WEEKDAY_OFFSET[dayOfWeek];\n if(offset === undefined) return null;\n\n var modifier = null;\n var prefix = match[PREFIX_GROUP];\n\n if(prefix == '上') {\n modifier = 'last';\n } else if(prefix == '下') {\n modifier = 'next';\n } else if(prefix == '今' || prefix == '這' || prefix == '呢') {\n modifier = 'this';\n }\n\n updateParsedComponent(result, ref, offset, modifier);\n result.tags['ZHHantWeekdayParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar ParsedComponents = require('../../result').ParsedComponents;\n\nvar util = require('../../utils/ZH-Hant.js');\n\nvar patternString1 = '(?:由|從|自)?' +\n '(?:' +\n '(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|' +\n '(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|' +\n '(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)' +\n '(?:[\\\\s,,]*)' +\n '(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?' +\n ')?' +\n '(?:[\\\\s,,]*)' +\n '(?:(\\\\d+|[' + Object.keys(util.NUMBER).join('') + ']+)(?:\\\\s*)(?:點|時|:|:)' +\n '(?:\\\\s*)' +\n '(\\\\d+|半|正|整|[' + Object.keys(util.NUMBER).join('') + ']+)?(?:\\\\s*)(?:分|:|:)?' +\n '(?:\\\\s*)' +\n '(\\\\d+|[' + Object.keys(util.NUMBER).join('') + ']+)?(?:\\\\s*)(?:秒)?)' +\n '(?:\\\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?';\n\nvar patternString2 = '(?:^\\\\s*(?:到|至|\\\\-|\\\\–|\\\\~|\\\\〜)\\\\s*)' +\n '(?:' +\n '(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|' +\n '(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|' +\n '(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)' +\n '(?:[\\\\s,,]*)' +\n '(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?' +\n ')?' +\n '(?:[\\\\s,,]*)' +\n '(?:(\\\\d+|[' + Object.keys(util.NUMBER).join('') + ']+)(?:\\\\s*)(?:點|時|:|:)' +\n '(?:\\\\s*)' +\n '(\\\\d+|半|正|整|[' + Object.keys(util.NUMBER).join('') + ']+)?(?:\\\\s*)(?:分|:|:)?' +\n '(?:\\\\s*)' +\n '(\\\\d+|[' + Object.keys(util.NUMBER).join('') + ']+)?(?:\\\\s*)(?:秒)?)' +\n '(?:\\\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?';\n\nvar FIRST_REG_PATTERN = new RegExp(patternString1, 'i');\nvar SECOND_REG_PATTERN = new RegExp(patternString2, 'i');\n\nvar DAY_GROUP_1 = 1;\nvar ZH_AM_PM_HOUR_GROUP_1 = 2;\nvar ZH_AM_PM_HOUR_GROUP_2 = 3;\nvar DAY_GROUP_3 = 4;\nvar ZH_AM_PM_HOUR_GROUP_3 = 5;\nvar HOUR_GROUP = 6;\nvar MINUTE_GROUP = 7;\nvar SECOND_GROUP = 8;\nvar AM_PM_HOUR_GROUP = 9;\n\nexports.Parser = function ZHHantTimeExpressionParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return FIRST_REG_PATTERN;\n };\n\n this.extract = function(text, ref, match, opt) {\n\n // This pattern can be overlaped Ex. [12] AM, 1[2] AM\n if (match.index > 0 && text[match.index - 1].match(/\\w/)) return null;\n var refMoment = dayjs(ref);\n var result = new ParsedResult();\n result.ref = ref;\n result.index = match.index;\n result.text = match[0];\n result.tags.ZHTimeExpressionParser = true;\n\n var startMoment = refMoment.clone();\n\n // ----- Day\n if (match[DAY_GROUP_1]) {\n var day1 = match[DAY_GROUP_1];\n if (day1 == '明' || day1 == '聽') {\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n startMoment.add(1, 'day');\n }\n } else if (day1 == '昨' || day1 == '尋' || day1 == '琴') {\n startMoment.add(-1, 'day');\n } else if (day1 == \"前\"){\n startMoment.add(-2, 'day');\n } else if (day1 == \"大前\"){\n startMoment.add(-3, 'day');\n } else if (day1 == \"後\"){\n startMoment.add(2, 'day');\n } else if (day1 == \"大後\"){\n startMoment.add(3, 'day');\n }\n result.start.assign('day', startMoment.date());\n result.start.assign('month', startMoment.month() + 1);\n result.start.assign('year', startMoment.year());\n } else if (match[DAY_GROUP_3]) {\n var day3 = match[DAY_GROUP_3];\n if (day3 == '明' || day3 == '聽') {\n startMoment.add(1, 'day');\n } else if (day3 == '昨' || day3 == '尋' || day3 == '琴') {\n startMoment.add(-1, 'day');\n } else if (day3 == \"前\"){\n startMoment.add(-2, 'day');\n } else if (day3 == \"大前\"){\n startMoment.add(-3, 'day');\n } else if (day3 == \"後\"){\n startMoment.add(2, 'day');\n } else if (day3 == \"大後\"){\n startMoment.add(3, 'day');\n }\n result.start.assign('day', startMoment.date());\n result.start.assign('month', startMoment.month() + 1);\n result.start.assign('year', startMoment.year());\n } else {\n result.start.imply('day', startMoment.date());\n result.start.imply('month', startMoment.month() + 1);\n result.start.imply('year', startMoment.year());\n }\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if (match[SECOND_GROUP]) {\n var second = parseInt(match[SECOND_GROUP]);\n if (isNaN(second)) {\n second = util.zhStringToNumber(match[SECOND_GROUP]);\n }\n if (second >= 60) return null;\n result.start.assign('second', second);\n }\n\n hour = parseInt(match[HOUR_GROUP]);\n if (isNaN(hour)) {\n hour = util.zhStringToNumber(match[HOUR_GROUP]);\n }\n\n // ----- Minutes\n if (match[MINUTE_GROUP]) {\n if (match[MINUTE_GROUP] == '半') {\n minute = 30;\n } else if (match[MINUTE_GROUP] == '正' || match[MINUTE_GROUP] == '整') {\n minute = 0;\n } else {\n minute = parseInt(match[MINUTE_GROUP]);\n if (isNaN(minute)) {\n minute = util.zhStringToNumber(match[MINUTE_GROUP]);\n }\n }\n } else if (hour > 100) {\n minute = hour % 100;\n hour = parseInt(hour / 100);\n }\n\n if (minute >= 60) {\n return null;\n }\n\n if (hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP]) {\n if (hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if (ampm == \"a\") {\n meridiem = 0;\n if (hour == 12) hour = 0;\n }\n\n if (ampm == \"p\") {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n } else if (match[ZH_AM_PM_HOUR_GROUP_1]) {\n var zhAMPMString1 = match[ZH_AM_PM_HOUR_GROUP_1];\n var zhAMPM1 = zhAMPMString1[0];\n if (zhAMPM1 == '朝' || zhAMPM1 == '早') {\n meridiem = 0;\n if (hour == 12) hour = 0;\n } else if (zhAMPM1 == '晚') {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n } else if (match[ZH_AM_PM_HOUR_GROUP_2]) {\n var zhAMPMString2 = match[ZH_AM_PM_HOUR_GROUP_2];\n var zhAMPM2 = zhAMPMString2[0];\n if (zhAMPM2 == '上' || zhAMPM2 == '朝' || zhAMPM2 == '早' || zhAMPM2 == '凌') {\n meridiem = 0;\n if (hour == 12) hour = 0;\n } else if (zhAMPM2 == '下' || zhAMPM2 == '晏' || zhAMPM2 == '晚') {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n } else if (match[ZH_AM_PM_HOUR_GROUP_3]) {\n var zhAMPMString3 = match[ZH_AM_PM_HOUR_GROUP_3];\n var zhAMPM3 = zhAMPMString3[0];\n if (zhAMPM3 == '上' || zhAMPM3 == '朝' || zhAMPM3 == '早' || zhAMPM3 == '凌') {\n meridiem = 0;\n if (hour == 12) hour = 0;\n } else if (zhAMPM3 == '下' || zhAMPM3 == '晏' || zhAMPM3 == '晚') {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n }\n\n result.start.assign('hour', hour);\n result.start.assign('minute', minute);\n\n if (meridiem >= 0) {\n result.start.assign('meridiem', meridiem);\n } else {\n if (hour < 12) {\n result.start.imply('meridiem', 0);\n } else {\n result.start.imply('meridiem', 1);\n }\n }\n\n // ==============================================================\n // Extracting the 'to' chunk\n // ==============================================================\n\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n // Not accept number only result\n if (result.text.match(/^\\d+$/)) {\n return null;\n }\n return result;\n }\n\n var endMoment = startMoment.clone();\n result.end = new ParsedComponents(null, null);\n\n // ----- Day\n if (match[DAY_GROUP_1]) {\n var day1 = match[DAY_GROUP_1];\n if (day1 == '明' || day1 == '聽') {\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n endMoment.add(1, 'day');\n }\n } else if (day1 == '昨' || day1 == '尋' || day1 == '琴') {\n endMoment.add(-1, 'day');\n } else if (day1 == \"前\"){\n endMoment.add(-2, 'day');\n } else if (day1 == \"大前\"){\n endMoment.add(-3, 'day');\n } else if (day1 == \"後\"){\n endMoment.add(2, 'day');\n } else if (day1 == \"大後\"){\n endMoment.add(3, 'day');\n }\n result.end.assign('day', endMoment.date());\n result.end.assign('month', endMoment.month() + 1);\n result.end.assign('year', endMoment.year());\n } else if (match[DAY_GROUP_3]) {\n var day3 = match[DAY_GROUP_3];\n if (day3 == '明' || day3 == '聽') {\n endMoment.add(1, 'day');\n } else if (day3 == '昨' || day3 == '尋' || day3 == '琴') {\n endMoment.add(-1, 'day');\n } else if (day3 == \"前\"){\n endMoment.add(-2, 'day');\n } else if (day3 == \"大前\"){\n endMoment.add(-3, 'day');\n } else if (day3 == \"後\"){\n endMoment.add(2, 'day');\n } else if (day3 == \"大後\"){\n endMoment.add(3, 'day');\n }\n result.end.assign('day', endMoment.date());\n result.end.assign('month', endMoment.month() + 1);\n result.end.assign('year', endMoment.year());\n } else {\n result.end.imply('day', endMoment.date());\n result.end.imply('month', endMoment.month() + 1);\n result.end.imply('year', endMoment.year());\n }\n\n hour = 0;\n minute = 0;\n meridiem = -1;\n\n // ----- Second\n if (match[SECOND_GROUP]) {\n var second = parseInt(match[SECOND_GROUP]);\n if (isNaN(second)) {\n second = util.zhStringToNumber(match[SECOND_GROUP]);\n }\n\n if (second >= 60) return null;\n result.end.assign('second', second);\n }\n\n hour = parseInt(match[HOUR_GROUP]);\n if (isNaN(hour)) {\n hour = util.zhStringToNumber(match[HOUR_GROUP]);\n }\n\n // ----- Minutes\n if (match[MINUTE_GROUP]) {\n if (match[MINUTE_GROUP] == '半') {\n minute = 30;\n } else if (match[MINUTE_GROUP] == '正' || match[MINUTE_GROUP] == '整') {\n minute = 0;\n } else {\n minute = parseInt(match[MINUTE_GROUP]);\n if (isNaN(minute)) {\n minute = util.zhStringToNumber(match[MINUTE_GROUP]);\n }\n }\n } else if (hour > 100) {\n minute = hour % 100;\n hour = parseInt(hour / 100);\n }\n\n if (minute >= 60) {\n return null;\n }\n\n if (hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP]) {\n if (hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if (ampm == \"a\") {\n meridiem = 0;\n if (hour == 12) hour = 0;\n }\n\n if (ampm == \"p\") {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n\n if (!result.start.isCertain('meridiem')) {\n if (meridiem == 0) {\n\n result.start.imply('meridiem', 0);\n\n if (result.start.get('hour') == 12) {\n result.start.assign('hour', 0);\n }\n\n } else {\n\n result.start.imply('meridiem', 1);\n\n if (result.start.get('hour') != 12) {\n result.start.assign('hour', result.start.get('hour') + 12);\n }\n }\n }\n\n } else if (match[ZH_AM_PM_HOUR_GROUP_1]) {\n var zhAMPMString1 = match[ZH_AM_PM_HOUR_GROUP_1];\n var zhAMPM1 = zhAMPMString1[0];\n if (zhAMPM1 == '朝' || zhAMPM1 == '早') {\n meridiem = 0;\n if (hour == 12) hour = 0;\n } else if (zhAMPM1 == '晚') {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n } else if (match[ZH_AM_PM_HOUR_GROUP_2]) {\n var zhAMPMString2 = match[ZH_AM_PM_HOUR_GROUP_2];\n var zhAMPM2 = zhAMPMString2[0];\n if (zhAMPM2 == '上' || zhAMPM2 == '朝' || zhAMPM2 == '早' || zhAMPM2 == '凌') {\n meridiem = 0;\n if (hour == 12) hour = 0;\n } else if (zhAMPM2 == '下' || zhAMPM2 == '晏' || zhAMPM2 == '晚') {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n } else if (match[ZH_AM_PM_HOUR_GROUP_3]) {\n var zhAMPMString3 = match[ZH_AM_PM_HOUR_GROUP_3];\n var zhAMPM3 = zhAMPMString3[0];\n if (zhAMPM3 == '上' || zhAMPM3 == '朝' || zhAMPM3 == '早' || zhAMPM3 == '凌') {\n meridiem = 0;\n if (hour == 12) hour = 0;\n } else if (zhAMPM3 == '下' || zhAMPM3 == '晏' || zhAMPM3 == '晚') {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n }\n\n result.text = result.text + match[0];\n result.end.assign('hour', hour);\n result.end.assign('minute', minute);\n if (meridiem >= 0) {\n result.end.assign('meridiem', meridiem);\n } else {\n var startAtPM = result.start.isCertain('meridiem') && result.start.get('meridiem') == 1;\n if (startAtPM && result.start.get('hour') > hour) {\n // 10pm - 1 (am)\n result.end.imply('meridiem', 0);\n\n } else if (hour > 12) {\n result.end.imply('meridiem', 1);\n }\n }\n\n if (result.end.date().getTime() < result.start.date().getTime()) {\n result.end.imply('day', result.end.get('day') + 1)\n }\n\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp(\n '(而家|立(?:刻|即)|即刻)|' +\n '(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|' +\n '(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|' +\n '(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)' +\n '(?:[\\\\s|,|,]*)' +\n '(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?', 'i');\n\nvar NOW_GROUP = 1;\nvar DAY_GROUP_1 = 2;\nvar TIME_GROUP_1 = 3;\nvar TIME_GROUP_2 = 4;\nvar DAY_GROUP_3 = 5;\nvar TIME_GROUP_3 = 6;\n\nexports.Parser = function ZHHantCasualDateParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return PATTERN;\n };\n\n this.extract = function(text, ref, match, opt) {\n text = match[0];\n var index = match.index;\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var refMoment = dayjs(ref);\n var startMoment = refMoment;\n\n if (match[NOW_GROUP]) {\n result.start.imply('hour', refMoment.hour());\n result.start.imply('minute', refMoment.minute());\n result.start.imply('second', refMoment.second());\n result.start.imply('millisecond', refMoment.millisecond());\n } else if (match[DAY_GROUP_1]) {\n var day1 = match[DAY_GROUP_1];\n var time1 = match[TIME_GROUP_1];\n\n if (day1 == '明' || day1 == '聽') {\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n } else if (day1 == '昨' || day1 == '尋' || day1 == '琴') {\n startMoment = startMoment.add(-1, 'day');\n } else if (day1 == \"前\"){\n startMoment = startMoment.add(-2, 'day');\n } else if (day1 == \"大前\"){\n startMoment = startMoment.add(-3, 'day');\n } else if ( day1 == \"後\"){\n startMoment = startMoment.add(2, 'day');\n } else if (day1 == \"大後\"){\n startMoment = startMoment.add(3, 'day');\n }\n\n if (time1 == '早' || time1 == '朝') {\n result.start.imply('hour', 6);\n } else if (time1 == '晚') {\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n }\n\n } else if (match[TIME_GROUP_2]) {\n var timeString2 = match[TIME_GROUP_2];\n var time2 = timeString2[0];\n if (time2 == '早' || time2 == '朝' || time2 == '上') {\n result.start.imply('hour', 6);\n } else if (time2 == '下' || time2 == '晏') {\n result.start.imply('hour', 15);\n result.start.imply('meridiem', 1);\n } else if (time2 == '中') {\n result.start.imply('hour', 12);\n result.start.imply('meridiem', 1);\n } else if (time2 == '夜' || time2 == '晚') {\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n } else if (time2 == '凌') {\n result.start.imply('hour', 0);\n }\n\n } else if (match[DAY_GROUP_3]) {\n var day3 = match[DAY_GROUP_3];\n\n if (day3 == '明' || day3 == '聽') {\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n } else if (day3 == '昨' || day3 == '尋' || day3 == '琴') {\n startMoment = startMoment.add(-1, 'day');\n } else if (day3 == \"前\"){\n startMoment = startMoment.add(-2, 'day');\n } else if (day3 == \"大前\"){\n startMoment = startMoment.add(-3, 'day');\n } else if (day3 == \"後\"){\n startMoment = startMoment.add(2, 'day');\n } else if (day3 == \"大後\"){\n startMoment = startMoment.add(3, 'day');\n }\n\n\n var timeString3 = match[TIME_GROUP_3];\n if (timeString3) {\n var time3 = timeString3[0];\n if (time3 == '早' || time3 == '朝' || time3 == '上') {\n result.start.imply('hour', 6);\n } else if (time3 == '下' || time3 == '晏') {\n result.start.imply('hour', 15);\n result.start.imply('meridiem', 1);\n } else if (time3 == '中') {\n result.start.imply('hour', 12);\n result.start.imply('meridiem', 1);\n } else if (time3 == '夜' || time3 == '晚') {\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n } else if (time3 == '凌') {\n result.start.imply('hour', 0);\n }\n }\n }\n\n result.start.assign('day', startMoment.date())\n result.start.assign('month', startMoment.month() + 1)\n result.start.assign('year', startMoment.year())\n result.tags.ZHHantCasualDateParser = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar util = require('../../utils/ZH-Hant.js');\n\nvar PATTERN = new RegExp(\n '(\\\\d+|[' + Object.keys(util.NUMBER).join('') + ']+|半|幾)(?:\\\\s*)' +\n '(?:個)?' +\n '(秒(?:鐘)?|分鐘|小時|鐘|日|天|星期|禮拜|月|年)' +\n '(?:(?:之|過)?後|(?:之)?內)', 'i'\n);\n\nvar NUMBER_GROUP = 1;\nvar UNIT_GROUP = 2;\n\nexports.Parser = function ZHHantCasualDateParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return PATTERN;\n };\n\n this.extract = function(text, ref, match, opt) {\n var index = match.index;\n text = match[0];\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var number = parseInt(match[NUMBER_GROUP]);\n if (isNaN(number)){\n number = util.zhStringToNumber(match[NUMBER_GROUP]);\n }\n\n if (isNaN(number)){\n var string = match[NUMBER_GROUP];\n if (string === '幾'){\n number = 3;\n }else if(string === '半'){\n number = 0.5;\n }else{\n\n //just in case\n return null;\n }\n }\n\n var date = dayjs(ref);\n var unit = match[UNIT_GROUP];\n var unitAbbr = unit[0];\n\n if (unitAbbr.match(/[日天星禮月年]/)){\n if(unitAbbr == '日' || unitAbbr == '天'){\n date = date.add(number, 'd');\n }else if(unitAbbr == '星' || unitAbbr == '禮'){\n date = date.add(number * 7, 'd');\n }else if(unitAbbr == '月'){\n date = date.add(number, 'month');\n }else if(unitAbbr == '年'){\n date = date.add(number, 'year');\n }\n\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n return result;\n }\n\n if(unitAbbr == '秒'){\n date = date.add(number, 'second');\n }else if(unitAbbr == '分'){\n date = date.add(number, 'minute');\n }else if(unitAbbr == '小' || unitAbbr == '鐘'){\n date = date.add(number, 'hour');\n }\n\n result.start.imply('year', date.year());\n result.start.imply('month', date.month() + 1);\n result.start.imply('day', date.date());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.start.assign('second', date.second());\n result.tags.ZHHantDeadlineFormatParser = true;\n return result;\n };\n};\n","/*\n\n\n*/\n\nvar dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/DE');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(in|nach)\\\\s*' +\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|einigen|eine[rm]\\\\s*halben|eine[rm])\\\\s*' +\n '(sekunden?|min(?:ute)?n?|stunden?|tag(?:en)?|wochen?|monat(?:en)?|jahr(?:en)?)\\\\s*' +\n '(?=\\\\W|$)', 'i'\n);\n\nvar STRICT_PATTERN = new RegExp('(\\\\W|^)' +\n '(in|nach)\\\\s*' +\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|eine(?:r|m)?)\\\\s*' +\n '(sekunden?|minuten?|stunden?|tag(?:en)?)\\\\s*' +\n '(?=\\\\W|$)', 'i'\n);\n\nexports.Parser = function DEDeadlineFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return this.isStrictMode()? STRICT_PATTERN : PATTERN;\n };\n\n this.extract = function(text, ref, match, opt){\n\n var index = match.index + match[1].length;\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var num = match[3].toLowerCase();\n if (util.INTEGER_WORDS[num] !== undefined) {\n num = util.INTEGER_WORDS[num];\n } else if (num === 'einer' || num === 'einem') {\n num = 1;\n } else if (num === 'einigen') {\n num = 3;\n } else if (/halben/.test(num)) {\n num = 0.5;\n } else {\n num = parseInt(num);\n }\n\n var date = dayjs(ref);\n if (/tag|woche|monat|jahr/i.test(match[4])) {\n\n if (/tag/i.test(match[4])) {\n date = date.add(num, 'd');\n } else if (/woche/i.test(match[4])) {\n date = date.add(num * 7, 'd');\n } else if (/monat/i.test(match[4])) {\n date = date.add(num, 'month');\n } else if (/jahr/i.test(match[4])) {\n date = date.add(num, 'year');\n }\n\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n return result;\n }\n\n if (/stunde/i.test(match[4])) {\n\n date = date.add(num, 'hour');\n\n } else if (/min/i.test(match[4])) {\n\n date = date.add(num, 'minute');\n\n } else if (/sekunde/i.test(match[4])) {\n\n date = date.add(num, 'second');\n }\n\n result.start.imply('year', date.year());\n result.start.imply('month', date.month() + 1);\n result.start.imply('day', date.date());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.start.assign('second', date.second());\n result.tags['DEDeadlineFormatParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nconst parser = require('../parser');\nconst ParsedResult = require('../../result').ParsedResult;\nconst util = require('../../utils/DE');\n\nconst PATTERN = new RegExp('(\\\\W|^)' +\n '(?:am\\\\s*?)?' +\n '(?:(Sonntag|Montag|Dienstag|Mittwoch|Donnerstag|Freitag|Samstag|So|Mo|Di|Mi|Do|Fr|Sa)\\\\s*,?\\\\s*)?' +\n '(?:den\\\\s*)?' +\n '([0-9]{1,2})\\\\.' +\n '(?:\\\\s*(?:bis(?:\\\\s*(?:am|zum))?|\\\\-|\\\\–|\\\\s)\\\\s*([0-9]{1,2})\\\\.)?\\\\s*' +\n '(Jan(?:uar|\\\\.)?|Feb(?:ruar|\\\\.)?|Mär(?:z|\\\\.)?|Maerz|Mrz\\\\.?|Apr(?:il|\\\\.)?|Mai|Jun(?:i|\\\\.)?|Jul(?:i|\\\\.)?|Aug(?:ust|\\\\.)?|Sep(?:t|t\\\\.|tember|\\\\.)?|Okt(?:ober|\\\\.)?|Nov(?:ember|\\\\.)?|Dez(?:ember|\\\\.)?)' +\n '(?:' +\n ',?\\\\s*([0-9]{1,4}(?![^\\\\s]\\\\d))' +\n '(\\\\s*[vn]\\\\.?\\\\s*C(?:hr)?\\\\.?)?' +\n ')?' +\n '(?=\\\\W|$)', 'i'\n );\n\nconst WEEKDAY_GROUP = 2;\nconst DATE_GROUP = 3;\nconst DATE_TO_GROUP = 4;\nconst MONTH_NAME_GROUP = 5;\nconst YEAR_GROUP = 6;\nconst YEAR_BE_GROUP = 7;\n\nexports.Parser = function DEMonthNameLittleEndianParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n const result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n\n var day = match[DATE_GROUP];\n day = parseInt(day);\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n year = parseInt(year);\n\n if(match[YEAR_BE_GROUP]){\n if (/v/i.test(match[YEAR_BE_GROUP])) {\n // v.Chr.\n year = -year;\n }\n } else if (year < 100){\n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month);\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n // Weekday component\n if (match[WEEKDAY_GROUP]) {\n var weekday = match[WEEKDAY_GROUP];\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()]\n result.start.assign('weekday', weekday);\n }\n\n // Text can be 'range' value. Such as '12 - 13 January 2012'\n if (match[DATE_TO_GROUP]) {\n result.end = result.start.clone();\n result.end.assign('day', parseInt(match[DATE_TO_GROUP]));\n }\n\n result.tags['DEMonthNameLittleEndianParser'] = true;\n return result;\n };\n}\n","/*\n \n The parser for parsing month name and year.\n \n EX. \n - Januar\n - Januar 2012\n*/\n\nconst parser = require('../parser');\nconst ParsedResult = require('../../result').ParsedResult;\nconst util = require('../../utils/DE');\n\nconst PATTERN = new RegExp('(^|\\\\D\\\\s+|[^\\\\w\\\\s])' +\n '(Jan\\\\.?|Januar|Feb\\\\.?|Februar|Mär\\\\.?|M(?:ä|ae)rz|Mrz\\\\.?|Apr\\\\.?|April|Mai\\\\.?|Jun\\\\.?|Juni|Jul\\\\.?|Juli|Aug\\\\.?|August|Sep\\\\.?|Sept\\\\.?|September|Okt\\\\.?|Oktober|Nov\\\\.?|November|Dez\\\\.?|Dezember)' + \n '\\\\s*' +\n '(?:' +\n ',?\\\\s*(?:([0-9]{4})(\\\\s*[vn]\\\\.?\\\\s*C(?:hr)?\\\\.?)?|([0-9]{1,4})\\\\s*([vn]\\\\.?\\\\s*C(?:hr)?\\\\.?))' +\n ')?' +\n '(?=[^\\\\s\\\\w]|$)', 'i');\n\nconst MONTH_NAME_GROUP = 2;\nconst YEAR_GROUP = 3;\nconst YEAR_BE_GROUP = 4;\nconst YEAR_GROUP2 = 5;\nconst YEAR_BE_GROUP2 = 6;\n\nexports.Parser = function ENMonthNameParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n \n this.extract = function(text, ref, match, opt){\n var result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n \n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n\n var day = 1;\n\n var year = null;\n if (match[YEAR_GROUP] || match[YEAR_GROUP2]) {\n year = match[YEAR_GROUP] || match[YEAR_GROUP2];\n year = parseInt(year);\n\n if (match[YEAR_BE_GROUP] || match[YEAR_BE_GROUP2]) {\n if (/v/i.test(match[YEAR_BE_GROUP] || match[YEAR_BE_GROUP2])) {\n // v.Chr.\n year = -year;\n }\n\n } else if (year < 100){ \n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n \n year = parser.findYearClosestToRef(ref, day, month);\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n if (this.isStrictMode() && result.text.match(/^\\w+$/)) {\n return false;\n }\n\n result.tags['DEMonthNameParser'] = true;\n return result;\n }\n}\n\n","/*\n Date format with slash \"/\" (also \"-\" and \".\") between numbers\n - Tuesday 11/3/2015\n - 11/3/2015\n - 11/3\n*/\nvar dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:' +\n '(?:am\\\\s*?)?' +\n '((?:sonntag|so|montag|mo|dienstag|di|mittwoch|mi|donnerstag|do|freitag|fr|samstag|sa))' +\n '\\\\s*\\\\,?\\\\s*' +\n '(?:den\\\\s*)?' +\n ')?' +\n '([0-3]{0,1}[0-9]{1})[\\\\/\\\\.\\\\-]([0-3]{0,1}[0-9]{1})' +\n '(?:' +\n '[\\\\/\\\\.\\\\-]' +\n '([0-9]{4}\\s*\\,?\\s*|[0-9]{2}\\s*\\,?\\s*)' +\n ')?' +\n '(\\\\W|$)', 'i');\n\nvar DAYS_OFFSET = {\n 'sonntag': 0, 'so': 0,\n 'montag': 1, 'mo': 1,\n 'dienstag': 2, 'di': 2,\n 'mittwoch': 3, 'mi': 3,\n 'donnerstag': 4, 'do': 4,\n 'freitag': 5, 'fr': 5,\n 'samstag': 6, 'sa': 6\n};\n\n\nvar OPENNING_GROUP = 1;\nvar ENDING_GROUP = 6;\n\nvar WEEKDAY_GROUP = 2;\nvar DAY_GROUP = 3;\nvar MONTH_GROUP = 4;\nvar YEAR_GROUP = 5;\n\nexports.Parser = function DESlashDateFormatParser(argument) {\n Parser.apply(this, arguments);\n\n this.pattern = function () { return PATTERN; };\n this.extract = function(text, ref, match, opt){\n\n if(match[OPENNING_GROUP] == '/' || match[ENDING_GROUP] == '/') {\n // Long skip, if there is some overlapping like:\n // XX[/YY/ZZ]\n // [XX/YY/]ZZ\n match.index += match[0].length\n return;\n }\n\n var index = match.index + match[OPENNING_GROUP].length;\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length - match[ENDING_GROUP].length);\n\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n });\n\n if(text.match(/^\\d\\.\\d$/)) return;\n if(text.match(/^\\d\\.\\d{1,2}\\.\\d{1,2}$/)) return;\n\n // MM/dd -> OK\n // MM.dd -> NG\n if(!match[YEAR_GROUP] && match[0].indexOf('/') < 0) return;\n\n var year = match[YEAR_GROUP] || dayjs(ref).year() + '';\n var month = match[MONTH_GROUP];\n var day = match[DAY_GROUP];\n\n month = parseInt(month);\n day = parseInt(day);\n year = parseInt(year);\n\n if (month < 1 || month > 12) return null;\n if(day < 1 || day > 31) return null;\n\n if(year < 100){\n if (year > 50) {\n year = year + 1900;\n } else {\n year = year + 2000;\n }\n }\n\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n\n //Day of week\n if(match[WEEKDAY_GROUP]) {\n result.start.assign('weekday', DAYS_OFFSET[match[WEEKDAY_GROUP].toLowerCase()]);\n }\n\n result.tags['DESlashDateFormatParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/DE');\n\nvar PATTERN = new RegExp('' +\n '(\\\\W|^)vor\\\\s*' +\n '(' + util.INTEGER_WORDS_PATTERN + '|[0-9]+|einigen|eine[rm]\\\\s*halben|eine[rm])\\\\s*' +\n '(sekunden?|min(?:ute)?n?|stunden?|wochen?|tag(?:en)?|monat(?:en)?|jahr(?:en)?)\\\\s*' +\n '(?=(?:\\\\W|$))', 'i');\n\nvar STRICT_PATTERN = new RegExp('' +\n '(\\\\W|^)vor\\\\s*' +\n '([0-9]+|eine(?:r|m))\\\\s*' +\n '(sekunden?|minuten?|stunden?|tag(?:en)?)' +\n '(?=(?:\\\\W|$))', 'i');\n\nexports.Parser = function DETimeAgoFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return this.isStrictMode()? STRICT_PATTERN : PATTERN;\n };\n\n this.extract = function(text, ref, match, opt){\n\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n let index = match.index + match[1].length;\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var num = match[2].toLowerCase() ;\n if (util.INTEGER_WORDS[num] !== undefined) {\n num = util.INTEGER_WORDS[num];\n } else if (num === 'einer' || num === 'einem') {\n num = 1;\n } else if (num === 'einigen') {\n num = 3;\n } else if (/halben/.test(num)) {\n num = 0.5;\n } else {\n num = parseInt(num);\n }\n\n var date = dayjs(ref);\n\n if (/stunde|min|sekunde/i.test(match[3])) {\n if (/stunde/i.test(match[3])) {\n\n date = date.add(-num, 'hour');\n\n } else if (/min/i.test(match[3])) {\n\n date = date.add(-num, 'minute');\n\n } else if (/sekunde/i.test(match[3])) {\n\n date = date.add(-num, 'second');\n }\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.start.assign('second', date.second());\n result.tags['DETimeAgoFormatParser'] = true;\n return result;\n }\n\n if (/woche/i.test(match[3])) {\n date = date.add(-num, 'week');\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n result.start.imply('weekday', date.day());\n return result;\n }\n\n if (/tag/i.test(match[3])) {\n date = date.add(-num, 'd');\n }\n\n if (/monat/i.test(match[3])) {\n date = date.add(-num, 'month');\n }\n\n if (/jahr/i.test(match[3])) {\n\n date = date.add(-num, 'year');\n }\n\n result.start.assign('day', date.date());\n result.start.assign('month', date.month() + 1);\n result.start.assign('year', date.year());\n return result;\n\n };\n}\n","/*\n\n\n*/\n\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar ParsedComponents = require('../../result').ParsedComponents;\n\nvar FIRST_REG_PATTERN = new RegExp(\"(^|\\\\s|T)\" +\n \"(?:(?:um|von)\\\\s*)?\" +\n \"(\\\\d{1,4}|mittags?|mitternachts?)\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\:|\\\\:)(\\\\d{2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*uhr)?\" +\n \"(?:\\\\s*(morgens|vormittags|mittags|nachmittags|abends|nachts))?\" +\n \"(?=\\\\W|$)\", 'i');\n\n\nvar SECOND_REG_PATTERN = new RegExp(\"^\\\\s*\" +\n \"(\\\\-|\\\\–|\\\\~|\\\\〜|bis|\\\\?)\\\\s*\" +\n \"(\\\\d{1,4})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(morgens|vormittags|mittags|nachmittags|abends|nachts))?\" +\n \"(?=\\\\W|$)\", 'i');\n\nvar HOUR_GROUP = 2;\nvar MINUTE_GROUP = 3;\nvar SECOND_GROUP = 4;\nvar AM_PM_HOUR_GROUP = 5;\n\n\nexports.Parser = function DETimeExpressionParser() {\n Parser.apply(this, arguments);\n\n this.pattern = function() { return FIRST_REG_PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n // This pattern can be overlaped Ex. [12] AM, 1[2] AM\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n var refMoment = dayjs(ref);\n var result = new ParsedResult();\n result.ref = ref;\n result.index = match.index + match[1].length;\n result.text = match[0].substring(match[1].length);\n result.tags['DETimeExpressionParser'] = true;\n\n result.start.imply('day', refMoment.date());\n result.start.imply('month', refMoment.month()+1);\n result.start.imply('year', refMoment.year());\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.start.assign('second', second);\n }\n\n // ----- Hours\n if (/mittags?/i.test(match[HOUR_GROUP])) {\n meridiem = 1;\n hour = 12;\n } else if (/mitternachts?/i.test(match[HOUR_GROUP])) {\n meridiem = 0;\n hour = 0;\n } else {\n hour = parseInt(match[HOUR_GROUP]);\n }\n\n // ----- Minutes\n if(match[MINUTE_GROUP] != null){\n minute = parseInt(match[MINUTE_GROUP]);\n } else if(hour > 100) {\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP] != null) {\n if (hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP].toLowerCase();\n if (ampm === 'morgens' || ampm === 'vormittags') {\n meridiem = 0;\n if(hour == 12) hour = 0;\n } else {\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n }\n\n result.start.assign('hour', hour);\n result.start.assign('minute', minute);\n\n if (meridiem >= 0) {\n result.start.assign('meridiem', meridiem);\n } else {\n if (hour < 12) {\n result.start.imply('meridiem', 0);\n } else {\n result.start.imply('meridiem', 1);\n }\n }\n\n // ==============================================================\n // Extracting the 'to' chunk\n // ==============================================================\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n // Not accept number only result\n if (result.text.match(/^\\d+$/)) {\n return null;\n }\n return result;\n }\n\n\n\n // Pattern \"YY.YY -XXXX\" is more like timezone offset\n if (match[0].match(/^\\s*(\\+|\\-)\\s*\\d{3,4}$/)) {\n return result;\n }\n\n if(result.end == null){\n result.end = new ParsedComponents(null, result.start.date());\n }\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.end.assign('second', second);\n }\n\n hour = parseInt(match[2]);\n\n // ----- Minute\n if (match[MINUTE_GROUP]!= null) {\n\n minute = parseInt(match[MINUTE_GROUP]);\n if(minute >= 60) return result;\n\n } else if (hour > 100) {\n\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP] != null) {\n\n if (hour > 12) return null;\n\n var ampm = match[AM_PM_HOUR_GROUP].toLowerCase();\n if (ampm === 'morgens' || ampm === 'vormittags') {\n meridiem = 0;\n if(hour == 12) {\n hour = 0;\n if (!result.end.isCertain('day')) {\n result.end.imply('day', result.end.get('day') + 1);\n }\n }\n } else {\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n\n if (!result.start.isCertain('meridiem')) {\n if (meridiem == 0) {\n\n result.start.imply('meridiem', 0);\n\n if (result.start.get('hour') == 12) {\n result.start.assign('hour', 0);\n }\n\n } else {\n\n result.start.imply('meridiem', 1);\n\n if (result.start.get('hour') != 12) {\n result.start.assign('hour', result.start.get('hour') + 12);\n }\n }\n }\n }\n\n result.text = result.text + match[0];\n result.end.assign('hour', hour);\n result.end.assign('minute', minute);\n if (meridiem >= 0) {\n result.end.assign('meridiem', meridiem);\n } else {\n var startAtPM = result.start.isCertain('meridiem') && result.start.get('meridiem') == 1;\n if (startAtPM && result.start.get('hour') > hour) {\n // 10pm - 1 (am)\n result.end.imply('meridiem', 0);\n\n } else if (hour > 12) {\n result.end.imply('meridiem', 1);\n }\n }\n\n if (result.end.date().getTime() < result.start.date().getTime()) {\n result.end.imply('day', result.end.get('day') + 1)\n }\n\n return result;\n }\n}\n","/*\n\n\n*/\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar DAYS_OFFSET = {\n 'sonntag': 0, 'so': 0,\n 'montag': 1, 'mo': 1,\n 'dienstag': 2, 'di': 2,\n 'mittwoch': 3, 'mi': 3,\n 'donnerstag': 4, 'do': 4,\n 'freitag': 5, 'fr': 5,\n 'samstag': 6, 'sa': 6\n};\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:(?:\\\\,|\\\\(|\\\\()\\\\s*)?' +\n '(?:a[mn]\\\\s*?)?' +\n '(?:(diese[mn]|letzte[mn]|n(?:ä|ae)chste[mn])\\\\s*)?' +\n '(' + Object.keys(DAYS_OFFSET).join('|') + ')' +\n '(?:\\\\s*(?:\\\\,|\\\\)|\\\\)))?' +\n '(?:\\\\s*(diese|letzte|n(?:ä|ae)chste)\\\\s*woche)?' +\n '(?=\\\\W|$)', 'i');\n\nvar PREFIX_GROUP = 2;\nvar WEEKDAY_GROUP = 3;\nvar POSTFIX_GROUP = 4;\n\nexports.Parser = function DEWeekdayParser() {\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; };\n\n this.extract = function(text, ref, match, opt){\n var index = match.index + match[1].length;\n var text = match[0].substr(match[1].length, match[0].length - match[1].length);\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();\n var offset = DAYS_OFFSET[dayOfWeek];\n if(offset === undefined) return null;\n\n var startMoment = dayjs(ref);\n var prefix = match[PREFIX_GROUP];\n var postfix = match[POSTFIX_GROUP];\n\n var refOffset = startMoment.day();\n var norm = prefix || postfix;\n norm = norm || '';\n norm = norm.toLowerCase();\n if (/letzte/.test(norm)) {\n startMoment = startMoment.day(offset - 7);\n } else if (/n(?:ä|ae)chste/.test(norm)) {\n startMoment = startMoment.day(offset + 7);\n } else if (/diese/.test(norm)) {\n if ( opt.forwardDate && refOffset > offset ) {\n startMoment = startMoment.day(offset + 7);\n } else {\n startMoment = startMoment.day(offset);\n }\n } else {\n if ( opt.forwardDate && refOffset > offset ) {\n startMoment = startMoment.day(offset + 7);\n } else if (!opt.forwardDate && Math.abs(offset - 7 - refOffset) < Math.abs(offset - refOffset)) {\n startMoment = startMoment.day(offset - 7);\n } else if (!opt.forwardDate && Math.abs(offset + 7 - refOffset) < Math.abs(offset - refOffset)) {\n startMoment = startMoment.day(offset + 7);\n } else {\n startMoment = startMoment.day(offset);\n }\n }\n\n result.start.assign('weekday', offset);\n result.start.imply('day', startMoment.date());\n result.start.imply('month', startMoment.month() + 1);\n result.start.imply('year', startMoment.year());\n return result;\n }\n};\n","var dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp(\n '(\\\\W|^)(' +\n 'jetzt|' +\n '(?:heute|diesen)\\\\s*(morgen|vormittag|mittag|nachmittag|abend)|' +\n '(?:heute|diese)\\\\s*nacht|' +\n 'heute|' +\n '(?:(?:ü|ue)ber)?morgen(?:\\\\s*(morgen|vormittag|mittag|nachmittag|abend|nacht))?|' +\n '(?:vor)?gestern(?:\\\\s*(morgen|vormittag|mittag|nachmittag|abend|nacht))?|' +\n 'letzte\\\\s*nacht' +\n ')(?=\\\\W|$)', 'i');\n\nexports.Parser = function DECasualDateParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt) {\n text = match[0].substr(match[1].length);\n \n const index = match.index + match[1].length;\n const result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n const refMoment = dayjs(ref);\n const lowerText = text.toLowerCase();\n\n var startMoment = refMoment;\n\n if (/(?:heute|diese)\\s*nacht/.test(lowerText)) {\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n } else if (/^(?:ü|ue)bermorgen/.test(lowerText)) {\n startMoment = startMoment.add(refMoment.hour() > 1 ? 2 : 1, 'day');\n } else if (/^morgen/.test(lowerText)) {\n // Check not \"Tomorrow\" on late night\n if (refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n } else if (/^gestern/.test(lowerText)) {\n startMoment = startMoment.add(-1, 'day');\n } else if (/^vorgestern/.test(lowerText)) {\n startMoment = startMoment.add(-2, 'day');\n } else if (/letzte\\s*nacht/.test(lowerText)) {\n result.start.imply('hour', 0);\n if (refMoment.hour() > 6) {\n startMoment = startMoment.add(-1, 'day');\n }\n } else if (lowerText === 'jetzt') {\n result.start.imply('hour', refMoment.hour());\n result.start.imply('minute', refMoment.minute());\n result.start.imply('second', refMoment.second());\n result.start.imply('millisecond', refMoment.millisecond());\n }\n\n var secondMatch = match[3] || match[4] || match[5];\n if (secondMatch) {\n switch (secondMatch.toLowerCase()) {\n case 'morgen':\n result.start.imply('hour', 6);\n break;\n case 'vormittag':\n result.start.imply('hour', 9);\n break;\n case 'mittag':\n result.start.imply('hour', 12);\n break;\n case 'nachmittag':\n result.start.imply('hour', 15);\n result.start.imply('meridiem', 1);\n break;\n case 'abend':\n result.start.imply('hour', 18);\n result.start.imply('meridiem', 1);\n break;\n case 'nacht':\n result.start.imply('hour', 0);\n break;\n }\n }\n\n result.start.assign('day', startMoment.date())\n result.start.assign('month', startMoment.month() + 1)\n result.start.assign('year', startMoment.year())\n result.tags['DECasualDateParser'] = true;\n return result;\n }\n}\n","/*\n\n The parser for parsing month name and year.\n\n EX.\n - januari\n - januari 2012\n - januari, 2012\n*/\nvar parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/NL');\n\nvar PATTERN = new RegExp('(^|\\\\D\\\\s+|[^\\\\w\\\\s])' +\n '('+ util.MONTH_PATTERN +')' +\n '\\\\s*' +\n '(?:' +\n '[,-]?\\\\s*([0-9]{4})(\\\\s*BE|n\\.Chr\\.|v\\.Chr\\.)?' +\n ')?' +\n '(?=[^\\\\s\\\\w]|\\\\s+[^0-9]|\\\\s+$|$)', 'i');\n\nvar MONTH_NAME_GROUP = 2;\nvar YEAR_GROUP = 3;\nvar YEAR_BE_GROUP = 4;\n\nexports.Parser = function ENMonthNameParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n const result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n const day = 1;\n const monthName = match[MONTH_NAME_GROUP];\n const month = util.MONTH_OFFSET[monthName.toLowerCase()];\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n year = parseInt(year);\n\n if(match[YEAR_BE_GROUP]){\n if (match[YEAR_BE_GROUP].match(/BE/)) {\n // Buddhist Era\n year = year - 543;\n } else if (match[YEAR_BE_GROUP].match(/v\\.Chr\\./)) {\n // Before Christ\n year = -year;\n }\n\n } else if (year < 100){\n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month)\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n if (result.text.match(/^\\w{3}$/)) {\n return false;\n }\n\n result.tags['NLMonthNameParser'] = true;\n return result;\n }\n}\n","const parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/NL');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:op\\\\s*?)?' +\n '(?:'+ '(' + util.WEEKDAY_PATTERN + ')' + '\\\\s*,?\\\\s*)?' +\n '([0-9]{1,2})\\.?' +\n '(?:\\\\s*(?:tot|\\\\-|\\\\–|tot en met|t\\\\/m)\\\\s*([0-9]{1,2})\\.?)?\\\\s*' +\n '(' + util.MONTH_PATTERN + ')' +\n '(?:' +\n '(?:-|\\/|,?\\\\s*)' +\n '((?:' +\n '[1-9][0-9]{0,3}\\\\s*(?:BE|n\\.Chr\\.|v\\.Chr\\.)|' +\n '[1-2][0-9]{3}|' +\n '[5-9][0-9]' +\n ')(?![^\\\\s]\\\\d))' +\n ')?' +\n '(?=\\\\W|$)', 'i'\n );\nvar WEEKDAY_GROUP = 2;\nvar DATE_GROUP = 3;\nvar DATE_TO_GROUP = 4;\nvar MONTH_NAME_GROUP = 5;\nvar YEAR_GROUP = 6;\n\nexports.Parser = function ENMonthNameLittleEndianParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; };\n\n this.extract = function(text, ref, match, opt){\n\n var result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref\n });\n\n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n\n var day = match[DATE_GROUP];\n day = parseInt(day);\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n\n if (/BE/i.test(year)) {\n // Buddhist Era\n year = year.replace(/BE/i, '');\n year = parseInt(year) - 543;\n } else if (/v\\.Chr\\./i.test(year)){\n // Before Christ\n year = year.replace(/v\\.Chr\\./i, '');\n year = -parseInt(year);\n } else if (/n\\.Chr\\./i.test(year)){\n year = year.replace(/n\\.Chr\\./i, '');\n year = parseInt(year);\n } else {\n year = parseInt(year);\n if (year < 100){\n if (year > 50) {\n year = year + 1900;\n } else {\n year = year + 2000;\n }\n }\n }\n }\n\n if(year){\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month);\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n // Weekday component\n if (match[WEEKDAY_GROUP]) {\n var weekday = match[WEEKDAY_GROUP];\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()];\n result.start.assign('weekday', weekday);\n }\n\n // Text can be 'range' value. Such as '12 - 13 januari 2012'\n if (match[DATE_TO_GROUP]) {\n var endDate = parseInt(match[DATE_TO_GROUP]);\n result.end = result.start.clone();\n result.end.assign('day', endDate);\n }\n\n result.tags['NLMonthNameLittleEndianParser'] = true;\n return result;\n };\n};\n","/*\n Date format with slash \"/\" (also \"-\" and \".\") between numbers\n - dinsdag 11/3/2015\n - 11/3/2015\n - 11/3\n - dinsdag 11.mrt.15\n*/\nvar dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/NL');\n\nvar PATTERN = new RegExp(\n '(\\\\W|^)' +\n '(?:' +\n '(?:op\\\\s*?)?' +\n '(' + util.WEEKDAY_PATTERN + ')' +\n '\\\\s*\\\\,?\\\\s*' +\n '(?:de\\\\s*)?' +\n ')?' +\n '([0-3]{0,1}[0-9]{1})[\\\\/\\\\.\\\\-]([0-1]{0,1}[0-9]{1}|' +\n util.MONTH_PATTERN +\n ')' +\n '(?:' +\n '[\\\\/\\\\.\\\\-]' +\n '([0-9]{4}\\s*\\,?\\s*|[0-9]{2}\\s*\\,?\\s*)' +\n ')?' +\n '(\\\\W|$)', 'i');\n\nvar OPENNING_GROUP = 1;\nvar ENDING_GROUP = 6;\n\nvar WEEKDAY_GROUP = 2;\nvar DAY_GROUP = 3;\nvar MONTH_GROUP = 4;\nvar YEAR_GROUP = 5;\n\nexports.Parser = function DESlashDateFormatParser(argument) {\n Parser.apply(this, arguments);\n\n this.pattern = function () { return PATTERN; };\n this.extract = function(text, ref, match, opt){\n\n if(match[OPENNING_GROUP] == '/' || match[ENDING_GROUP] == '/') {\n // Long skip, if there is some overlapping like:\n // XX[/YY/ZZ]\n // [XX/YY/]ZZ\n match.index += match[0].length\n return;\n }\n\n var index = match.index + match[OPENNING_GROUP].length;\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length - match[ENDING_GROUP].length);\n\n\n let result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n });\n\n if(text.match(/^\\d\\.\\d$/)) return;\n if(text.match(/^\\d\\.\\d{1,2}\\.\\d{1,2}$/)) return;\n\n // MM/dd -> OK\n // MM.dd -> NG\n if(!match[YEAR_GROUP] && match[0].indexOf('/') < 0) return;\n\n let year = match[YEAR_GROUP] || dayjs(ref).year() + '';\n let month = match[MONTH_GROUP];\n let day = match[DAY_GROUP];\n\n month = parseInt(month);\n if(!month) {\n month = util.MONTH_OFFSET[match[MONTH_GROUP].trim().toLowerCase()];\n }\n day = parseInt(day);\n year = parseInt(year);\n\n if (month < 1 || month > 12) return null;\n if(day < 1 || day > 31) return null;\n\n if(year < 100){\n if (year > 50) {\n year = year + 1900;\n } else {\n year = year + 2000;\n }\n }\n\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n\n //Day of week\n if(match[WEEKDAY_GROUP]) {\n result.start.assign('weekday', util.WEEKDAY_OFFSET[match[WEEKDAY_GROUP].toLowerCase()]);\n }\n\n result.tags['NLSlashDateFormatParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar DAYS_OFFSET = {\n 'zondag': 0, 'zo': 0,\n 'maandag': 1, 'ma': 1,\n 'dinsdag': 2, 'di': 2,\n 'woensdag': 3, 'wo': 3,\n 'donderdag': 4, 'do': 4,\n 'vrijdag': 5, 'vr': 5,\n 'zaterdag': 6, 'za': 6\n};\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:(?:\\\\,|\\\\(|\\\\()\\\\s*)?' +\n '(?:on\\\\s*?)?' +\n '(?:(deze|afgelopen|vorige|volgende|komende)\\\\s*(?:week)?\\\\s*)?' +\n '(' + Object.keys(DAYS_OFFSET).join('|') + ')' +\n '(?:\\\\s*(?:\\\\,|\\\\)|\\\\)))?' +\n '(?:\\\\s*(deze|afgelopen|vorige|volgende|komende)\\\\s*week)?' +\n '(?=\\\\W|$)', 'i');\n\nvar PREFIX_GROUP = 2;\nvar WEEKDAY_GROUP = 3;\nvar POSTFIX_GROUP = 4;\n\n\nexports.updateParsedComponent = function updateParsedComponent(result, ref, offset, modifier) {\n\n var startMoment = dayjs(ref);\n var startMomentFixed = false;\n var refOffset = startMoment.day();\n\n if(modifier == 'afgelopen' || modifier == 'vorige') {\n startMoment =startMoment.day(offset - 7);\n startMomentFixed = true;\n } else if(modifier == 'volgende') {\n startMoment = startMoment.day(offset + 7);\n startMomentFixed = true;\n } else if(modifier == 'deze' || modifier == 'komende') {\n startMoment = startMoment.day(offset);\n } else {\n if (Math.abs(offset - 7 - refOffset) < Math.abs(offset - refOffset)) {\n startMoment = startMoment.day(offset - 7);\n } else if (Math.abs(offset + 7 - refOffset) < Math.abs(offset - refOffset)) {\n startMoment = startMoment.day(offset + 7);\n } else {\n startMoment = startMoment.day(offset);\n }\n }\n\n result.start.assign('weekday', offset);\n if (startMomentFixed) {\n result.start.assign('day', startMoment.date());\n result.start.assign('month', startMoment.month() + 1);\n result.start.assign('year', startMoment.year());\n } else {\n result.start.imply('day', startMoment.date());\n result.start.imply('month', startMoment.month() + 1);\n result.start.imply('year', startMoment.year());\n }\n\n return result;\n};\n\n\nexports.Parser = function NLWeekdayParser() {\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; };\n\n this.extract = function(text, ref, match, opt){\n var index = match.index + match[1].length;\n var text = match[0].substr(match[1].length, match[0].length - match[1].length);\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();\n var offset = DAYS_OFFSET[dayOfWeek];\n if(offset === undefined) {\n return null;\n }\n\n var prefix = match[PREFIX_GROUP];\n var postfix = match[POSTFIX_GROUP];\n var norm = prefix || postfix;\n norm = norm || '';\n norm = norm.toLowerCase();\n\n exports.updateParsedComponent(result, ref, offset, norm);\n result.tags['NLWeekdayParser'] = true;\n\n return result;\n }\n};\n","/*\n\n\n*/\n\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar ParsedComponents = require('../../result').ParsedComponents;\n\nvar FIRST_REG_PATTERN = new RegExp(\"(^|\\\\s|T)\" +\n \"(?:(?:om|van)\\\\s*)?\" +\n \"(\\\\d{1,4}|tussen de middag|middernachts?)\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\:|\\\\:)(\\\\d{2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*uur)?\" +\n \"(?:\\\\s*(\\'s morgens|\\'s ochtends|in de ochtend|\\'s middags|in de middag|\\'s avonds|in de avond|\\'s nachts))?\" +\n \"(?=\\\\W|$)\", 'i');\n\n\nvar SECOND_REG_PATTERN = new RegExp(\"^\\\\s*\" +\n \"(\\\\-|\\\\–|\\\\~|\\\\〜|tot|\\\\?)\\\\s*\" +\n \"(\\\\d{1,4})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(\\'s morgens|\\'s ochtends|in de ochtend|\\'s middags|in de middag|\\'s avonds|in de avond|\\'s nachts))?\" +\n \"(?=\\\\W|$)\", 'i');\n\nvar HOUR_GROUP = 2;\nvar MINUTE_GROUP = 3;\nvar SECOND_GROUP = 4;\nvar AM_PM_HOUR_GROUP = 5;\n\n\nexports.Parser = function NLTimeExpressionParser() {\n Parser.apply(this, arguments);\n\n this.pattern = function() { return FIRST_REG_PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n // This pattern can be overlaped Ex. [12] AM, 1[2] AM\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n var refMoment = dayjs(ref);\n var result = new ParsedResult();\n result.ref = ref;\n result.index = match.index + match[1].length;\n result.text = match[0].substring(match[1].length);\n result.tags['NLTimeExpressionParser'] = true;\n\n result.start.imply('day', refMoment.date());\n result.start.imply('month', refMoment.month()+1);\n result.start.imply('year', refMoment.year());\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.start.assign('second', second);\n }\n\n // ----- Hours\n if (/tussen de middag/i.test(match[HOUR_GROUP])) {\n meridiem = 1;\n hour = 12;\n } else if (/middernachts?/i.test(match[HOUR_GROUP])) {\n meridiem = 0;\n hour = 0;\n } else {\n hour = parseInt(match[HOUR_GROUP]);\n }\n\n // ----- Minutes\n if(match[MINUTE_GROUP] != null){\n minute = parseInt(match[MINUTE_GROUP]);\n } else if(hour > 100) {\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP] != null) {\n if (hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP].toLowerCase();\n if (ampm === \"'s ochtends\" || ampm === 'in de ochtend' || ampm === \"'s morgens\") {\n meridiem = 0;\n if(hour == 12) hour = 0;\n } else {\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n }\n\n result.start.assign('hour', hour);\n result.start.assign('minute', minute);\n\n if (meridiem >= 0) {\n result.start.assign('meridiem', meridiem);\n } else {\n if (hour < 12) {\n result.start.imply('meridiem', 0);\n } else {\n result.start.imply('meridiem', 1);\n }\n }\n\n // ==============================================================\n // Extracting the 'to' chunk\n // ==============================================================\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n // Not accept number only result\n if (result.text.match(/^\\d+$/)) {\n return null;\n }\n return result;\n }\n\n\n\n // Pattern \"YY.YY -XXXX\" is more like timezone offset\n if (match[0].match(/^\\s*(\\+|\\-)\\s*\\d{3,4}$/)) {\n return result;\n }\n\n if(result.end == null){\n result.end = new ParsedComponents(null, result.start.date());\n }\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.end.assign('second', second);\n }\n\n hour = parseInt(match[2]);\n\n // ----- Minute\n if (match[MINUTE_GROUP]!= null) {\n\n minute = parseInt(match[MINUTE_GROUP]);\n if(minute >= 60) return result;\n\n } else if (hour > 100) {\n\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP] != null) {\n\n if (hour > 12) return null;\n\n var ampm = match[AM_PM_HOUR_GROUP].toLowerCase();\n if (ampm === '\\'s ochtends' || ampm === 'in de ochtend' || ampm === '\\'s morgens') {\n meridiem = 0;\n if(hour == 12) {\n hour = 0;\n if (!result.end.isCertain('day')) {\n result.end.imply('day', result.end.get('day') + 1);\n }\n }\n } else {\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n\n if (!result.start.isCertain('meridiem')) {\n if (meridiem == 0) {\n\n result.start.imply('meridiem', 0);\n\n if (result.start.get('hour') == 12) {\n result.start.assign('hour', 0);\n }\n\n } else {\n\n result.start.imply('meridiem', 1);\n\n if (result.start.get('hour') != 12) {\n result.start.assign('hour', result.start.get('hour') + 12);\n }\n }\n }\n }\n\n result.text = result.text + match[0];\n result.end.assign('hour', hour);\n result.end.assign('minute', minute);\n if (meridiem >= 0) {\n result.end.assign('meridiem', meridiem);\n } else {\n var startAtPM = result.start.isCertain('meridiem') && result.start.get('meridiem') == 1;\n if (startAtPM && result.start.get('hour') > hour) {\n // 10pm - 1 (am)\n result.end.imply('meridiem', 0);\n\n } else if (hour > 12) {\n result.end.imply('meridiem', 1);\n }\n }\n\n if (result.end.date().getTime() < result.start.date().getTime()) {\n result.end.imply('day', result.end.get('day') + 1)\n }\n\n return result;\n }\n}\n","var dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp(\n '(\\\\W|^)(' +\n 'nu|' +\n 'vroeg in de ochtend|'+\n '(?:van|deze)\\\\s*(morgen|ochtend|middag|avond)|' +\n '\\'s morgens|\\'s ochtends|tussen de middag|\\'s middags|\\'s avonds|'+\n '(?:deze|van)\\\\s*nacht|' +\n 'vandaag|' +\n '(?:over)?morgen(?:\\\\s*(ochtend|middag|avond|nacht))?|' +\n '(?:eer)?gister(?:\\\\s*(ochtend|middag|avond|nacht))?|' +\n 'afgelopen\\\\s*nacht' +\n ')(?=\\\\W|$)', 'i');\n\nexports.Parser = function DECasualDateParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt) {\n text = match[0].substr(match[1].length);\n\n const index = match.index + match[1].length;\n const result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n const refMoment = dayjs(ref);\n const lowerText = text.toLowerCase();\n\n var startMoment = refMoment;\n\n if (/(?:van|deze)\\s*nacht/.test(lowerText)) {\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n } else if (/^overmorgen/.test(lowerText)) {\n startMoment = startMoment.add(refMoment.hour() > 1 ? 2 : 1, 'day');\n } else if (/^morgen/.test(lowerText)) {\n // Check not \"Tomorrow\" on late night\n if (refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n } else if (/^gisteren/.test(lowerText)) {\n startMoment = startMoment.add(-1, 'day');\n } else if (/^eergisteren/.test(lowerText)) {\n startMoment = startMoment.add(-2, 'day');\n } else if (/afgelopen\\s*nacht/.test(lowerText)) {\n result.start.imply('hour', 0);\n if (refMoment.hour() > 6) {\n startMoment = startMoment.add(-1, 'day');\n }\n } else if (lowerText === 'nu') {\n result.start.imply('hour', refMoment.hour());\n result.start.imply('minute', refMoment.minute());\n result.start.imply('second', refMoment.second());\n result.start.imply('millisecond', refMoment.millisecond());\n }\n\n var secondMatch = match[3] || match[4] || match[5];\n if (secondMatch) {\n switch (secondMatch.toLowerCase()) {\n case 'vroeg in de ochtend':\n result.start.imply('hour', 6);\n break;\n case 'ochtend':\n case 'morgen':\n case '\\'s ochtends':\n case '\\'s morgends':\n result.start.imply('hour', 9);\n break;\n case 'tussen de middag':\n result.start.imply('hour', 12);\n break;\n case 'middag':\n case 'in de middag':\n case '\\'s middags':\n result.start.imply('hour', 15);\n result.start.imply('meridiem', 1);\n break;\n case 'avond':\n case \"'s avonds\":\n result.start.imply('hour', 18);\n result.start.imply('meridiem', 1);\n break;\n case 'nacht':\n case \"'s nachts\":\n result.start.imply('hour', 0);\n break;\n }\n }\n\n result.start.assign('day', startMoment.date());\n result.start.assign('month', startMoment.month() + 1);\n result.start.assign('year', startMoment.year());\n result.tags['NLCasualDateParser'] = true;\n return result;\n }\n}\n","var Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)((deze)?\\s*('s morgens|'s ochtends|in de ochtend|'s middags|in de middag|'s avonds|in de avond|'s nachts|ochtend|tussen de middag|middag|avond|nacht))/i;\n\nvar TIME_MATCH = 4;\n\nexports.Parser = function ENCasualTimeParser(){\n\n Parser.apply(this, arguments);\n\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n if(!match[TIME_MATCH]) TIME_MATCH = 3;\n\n switch (match[TIME_MATCH].toLowerCase()) {\n case 'middag':\n case 'in de middag':\n case '\\'s middags':\n result.start.imply('meridiem', 1);\n result.start.imply('hour', 15);\n break;\n\n case 'avond':\n case 'in de avond':\n case '\\'s avonds':\n result.start.imply('meridiem', 1);\n result.start.imply('hour', 20);\n break;\n\n case 'middernacht':\n case 'nacht':\n case '\\'s nachts':\n result.start.imply('meridiem', 0);\n result.start.imply('hour', 0);\n break;\n\n case 'ochtend':\n case '\\s morgens':\n case '\\s ochtends':\n case 'in de ochtend':\n result.start.imply('meridiem', 0);\n result.start.imply('hour', 9);\n break;\n\n case 'tussen de middag':\n result.start.imply('meridiem', 0);\n result.start.imply('hour', 12);\n break;\n }\n\n result.tags['NLCasualTimeParser'] = true;\n return result;\n };\n};\n","/*\n \n*/\nvar Refiner = require('./refiner').Refiner;\n\nexports.Refiner = function OverlapRemovalRefiner() {\n\tRefiner.call(this);\n\t\n\n\tthis.refine = function(text, results, opt) { \n\n if (results.length < 2) return results;\n \n var filteredResults = [];\n var prevResult = results[0];\n \n for (var i=1; i prevResult.text.length){\n prevResult = result;\n }\n \n } else {\n filteredResults.push(prevResult);\n prevResult = result;\n }\n }\n \n // The last one\n if (prevResult != null) {\n filteredResults.push(prevResult);\n }\n\n return filteredResults;\n }\n}","/*\n \n*/\nvar Refiner = require('./refiner').Refiner;\n\n\nvar TIMEZONE_OFFSET_PATTERN = new RegExp(\"^\\\\s*(GMT|UTC)?(\\\\+|\\\\-)(\\\\d{1,2}):?(\\\\d{2})\", 'i');\nvar TIMEZONE_OFFSET_SIGN_GROUP = 2;\nvar TIMEZONE_OFFSET_HOUR_OFFSET_GROUP = 3;\nvar TIMEZONE_OFFSET_MINUTE_OFFSET_GROUP = 4;\n\nexports.Refiner = function ExtractTimezoneOffsetRefiner() {\n Refiner.call(this);\n\n this.refine = function(text, results, opt) {\n\n results.forEach(function(result) {\n\n if (result.start.isCertain('timezoneOffset')) {\n return;\n }\n\n var match = TIMEZONE_OFFSET_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n return;\n }\n\n var hourOffset = parseInt(match[TIMEZONE_OFFSET_HOUR_OFFSET_GROUP]);\n var minuteOffset = parseInt(match[TIMEZONE_OFFSET_MINUTE_OFFSET_GROUP]);\n var timezoneOffset = hourOffset * 60 + minuteOffset;\n if (match[TIMEZONE_OFFSET_SIGN_GROUP] === '-') {\n timezoneOffset = -timezoneOffset;\n }\n\n if (result.end != null) {\n result.end.assign('timezoneOffset', timezoneOffset);\n }\n\n result.start.assign('timezoneOffset', timezoneOffset);\n result.text += match[0];\n result.tags['ExtractTimezoneOffsetRefiner'] = true;\n });\n\n return results;\n }\n}\n","/*\n\n*/\nvar Refiner = require('./refiner').Refiner;\n\n// Map ABBR -> Offset in minute\nvar TIMEZONE_NAME_PATTERN = new RegExp(\"^\\\\s*\\\\(?([A-Z]{2,4})\\\\)?(?=\\\\W|$)\", 'i');\nvar DEFAULT_TIMEZONE_ABBR_MAP = {\n \"ACDT\":630,\"ACST\":570,\"ADT\":-180,\"AEDT\":660,\"AEST\":600,\"AFT\":270,\"AKDT\":-480,\"AKST\":-540,\"ALMT\":360,\"AMST\":-180,\"AMT\":-240,\"ANAST\":720,\"ANAT\":720,\"AQTT\":300,\"ART\":-180,\"AST\":-240,\"AWDT\":540,\"AWST\":480,\"AZOST\":0,\"AZOT\":-60,\"AZST\":300,\"AZT\":240,\"BNT\":480,\"BOT\":-240,\"BRST\":-120,\"BRT\":-180,\"BST\":60,\"BTT\":360,\"CAST\":480,\"CAT\":120,\"CCT\":390,\"CDT\":-300,\"CEST\":120,\"CET\":60,\"CHADT\":825,\"CHAST\":765,\"CKT\":-600,\"CLST\":-180,\"CLT\":-240,\"COT\":-300,\"CST\":-360,\"CVT\":-60,\"CXT\":420,\"ChST\":600,\"DAVT\":420,\"EASST\":-300,\"EAST\":-360,\"EAT\":180,\"ECT\":-300,\"EDT\":-240,\"EEST\":180,\"EET\":120,\"EGST\":0,\"EGT\":-60,\"EST\":-300,\"ET\":-300,\"FJST\":780,\"FJT\":720,\"FKST\":-180,\"FKT\":-240,\"FNT\":-120,\"GALT\":-360,\"GAMT\":-540,\"GET\":240,\"GFT\":-180,\"GILT\":720,\"GMT\":0,\"GST\":240,\"GYT\":-240,\"HAA\":-180,\"HAC\":-300,\"HADT\":-540,\"HAE\":-240,\"HAP\":-420,\"HAR\":-360,\"HAST\":-600,\"HAT\":-90,\"HAY\":-480,\"HKT\":480,\"HLV\":-210,\"HNA\":-240,\"HNC\":-360,\"HNE\":-300,\"HNP\":-480,\"HNR\":-420,\"HNT\":-150,\"HNY\":-540,\"HOVT\":420,\"ICT\":420,\"IDT\":180,\"IOT\":360,\"IRDT\":270,\"IRKST\":540,\"IRKT\":540,\"IRST\":210,\"IST\":330,\"JST\":540,\"KGT\":360,\"KRAST\":480,\"KRAT\":480,\"KST\":540,\"KUYT\":240,\"LHDT\":660,\"LHST\":630,\"LINT\":840,\"MAGST\":720,\"MAGT\":720,\"MART\":-510,\"MAWT\":300,\"MDT\":-360,\"MESZ\":120,\"MEZ\":60,\"MHT\":720,\"MMT\":390,\"MSD\":240,\"MSK\":240,\"MST\":-420,\"MUT\":240,\"MVT\":300,\"MYT\":480,\"NCT\":660,\"NDT\":-90,\"NFT\":690,\"NOVST\":420,\"NOVT\":360,\"NPT\":345,\"NST\":-150,\"NUT\":-660,\"NZDT\":780,\"NZST\":720,\"OMSST\":420,\"OMST\":420,\"PDT\":-420,\"PET\":-300,\"PETST\":720,\"PETT\":720,\"PGT\":600,\"PHOT\":780,\"PHT\":480,\"PKT\":300,\"PMDT\":-120,\"PMST\":-180,\"PONT\":660,\"PST\":-480,\"PT\":-480,\"PWT\":540,\"PYST\":-180,\"PYT\":-240,\"RET\":240,\"SAMT\":240,\"SAST\":120,\"SBT\":660,\"SCT\":240,\"SGT\":480,\"SRT\":-180,\"SST\":-660,\"TAHT\":-600,\"TFT\":300,\"TJT\":300,\"TKT\":780,\"TLT\":540,\"TMT\":300,\"TVT\":720,\"ULAT\":480,\"UTC\":0,\"UYST\":-120,\"UYT\":-180,\"UZT\":300,\"VET\":-210,\"VLAST\":660,\"VLAT\":660,\"VUT\":660,\"WAST\":120,\"WAT\":60,\"WEST\":60,\"WESZ\":60,\"WET\":0,\"WEZ\":0,\"WFT\":720,\"WGST\":-120,\"WGT\":-180,\"WIB\":420,\"WIT\":540,\"WITA\":480,\"WST\":780,\"WT\":0,\"YAKST\":600,\"YAKT\":600,\"YAPT\":600,\"YEKST\":360,\"YEKT\":360\n};\n\nexports.Refiner = function ExtractTimezoneAbbrRefiner(config) {\n\tRefiner.call(this, arguments);\n\n\tthis.refine = function(text, results, opt) {\n\n\t var timezones = new Object(DEFAULT_TIMEZONE_ABBR_MAP);\n\t if (opt.timezones) {\n\t for (var name in opt.timezones) {\n timezones[name] = opt.timezones[name];\n }\n }\n\n\t\tresults.forEach(function(result) {\n\n if (!result.tags['ENTimeExpressionParser'] &&\n !result.tags['ENCasualTimeParser'] &&\n !result.tags['ZHTimeExpressionParser'] &&\n !result.tags['FRTimeExpressionParser'] &&\n !result.tags['DETimeExpressionParser']) {\n return;\n }\n\n var match = TIMEZONE_NAME_PATTERN.exec(text.substring(result.index + result.text.length));\n if (match) {\n var timezoneAbbr = match[1].toUpperCase();\n if (timezones[timezoneAbbr] === undefined) {\n return;\n }\n\n var timezoneOffset = timezones[timezoneAbbr];\n if (!result.start.isCertain('timezoneOffset')) {\n result.start.assign('timezoneOffset', timezoneOffset);\n }\n\n if (result.end != null && !result.end.isCertain('timezoneOffset')) {\n result.end.assign('timezoneOffset', timezoneOffset);\n }\n\n result.text += match[0];\n result.tags['ExtractTimezoneAbbrRefiner'] = true;\n }\n\t\t});\n\n return results;\n\t}\n};","/*\n Enforce 'forwardDate' option to on the results. When there are missing component,\n e.g. \"March 12-13 (without year)\" or \"Thursday\", the refiner will try to adjust the result\n into the future instead of the past.\n*/\nvar dayjs = require('dayjs');\nvar Refiner = require('./refiner').Refiner;\n\nexports.Refiner = function ForwardDateRefiner() {\n Refiner.call(this);\n\n this.refine = function(text, results, opt) {\n\n if (!opt['forwardDate']) {\n return results;\n }\n\n results.forEach(function(result) {\n\n var refMoment = dayjs(result.ref);\n\n if (result.start.isOnlyDayMonthComponent() && refMoment.isAfter(result.start.dayjs())\n ) {\n // Adjust year into the future\n for (var i=0; i < 3 && refMoment.isAfter(result.start.dayjs()); i++) {\n result.start.imply('year', result.start.get('year') + 1);\n\n if (result.end && !result.end.isCertain('year')) {\n result.end.imply('year', result.end.get('year') + 1);\n }\n }\n\n result.tags['ForwardDateRefiner'] = true;\n }\n\n if (result.start.isOnlyWeekdayComponent() && refMoment.isAfter(result.start.dayjs())) {\n // Adjust date to the coming week\n if (refMoment.day() > result.start.get('weekday')) {\n refMoment = refMoment.day(result.start.get('weekday') + 7);\n } else {\n refMoment = refMoment.day(result.start.get('weekday'));\n }\n\n result.start.imply('day', refMoment.date());\n result.start.imply('month', refMoment.month() + 1);\n result.start.imply('year', refMoment.year());\n result.tags['ForwardDateRefiner'] = true;\n }\n });\n\n return results;\n }\n};\n","/*\n \n*/\nvar Filter = require('./refiner').Filter;\n\nexports.Refiner = function UnlikelyFormatFilter() {\n Filter.call(this);\n \n\n this.isValid = function(text, result, opt) { \n\n if (result.text.replace(' ','').match(/^\\d*(\\.\\d*)?$/)) {\n return false;\n }\n\n return true; \n }\n}","/*\n\n*/\nvar ParsedComponents = require('../../result').ParsedComponents;\nvar Refiner = require('../refiner').Refiner;\n\n\nvar PATTERN = new RegExp(\"^\\\\s*(at|after|before|on|,|-|\\\\(|\\\\))?\\\\s*$\");\n\nfunction isMoreSpecific(prevResult, currResult) {\n var moreSpecific = false;\n\n if (prevResult.start.isCertain('year')) {\n if (!currResult.start.isCertain('year')) {\n moreSpecific = true;\n } else {\n if (prevResult.start.isCertain('month')) {\n if (!currResult.start.isCertain('month')) {\n moreSpecific = true;\n } else {\n if (prevResult.start.isCertain('day') && !currResult.start.isCertain('day')) {\n moreSpecific = true;\n }\n }\n }\n }\n }\n\n return moreSpecific;\n}\n\n\nfunction isAbleToMerge(text, prevResult, currResult) {\n var textBetween = text.substring(prevResult.index + prevResult.text.length, currResult.index);\n\n // Only accepts merge if one of them comes from casual relative date\n var includesRelativeResult = (prevResult.tags['ENRelativeDateFormatParser'] || currResult.tags['ENRelativeDateFormatParser']);\n\n // We assume they refer to the same date if all date fields are implied\n var referToSameDate = !prevResult.start.isCertain('day') && !prevResult.start.isCertain('month') && !prevResult.start.isCertain('year');\n\n // If both years are certain, that determines if they refer to the same date\n // but with one more specific than the other\n if (prevResult.start.isCertain('year') && currResult.start.isCertain('year'))\n referToSameDate = (prevResult.start.get('year') === currResult.start.get('year'));\n\n // We now test with the next level (month) if they refer to the same date\n if (prevResult.start.isCertain('month') && currResult.start.isCertain('month'))\n referToSameDate = (prevResult.start.get('month') === currResult.start.get('month')) && referToSameDate;\n\n return includesRelativeResult && textBetween.match(PATTERN) && referToSameDate;\n}\n\nfunction mergeResult(text, specificResult, nonSpecificResult){\n\n var specificDate = specificResult.start;\n var nonSpecificDate = nonSpecificResult.start;\n\n var startIndex = Math.min(specificResult.index, nonSpecificResult.index);\n var endIndex = Math.max(\n specificResult.index + specificResult.text.length,\n nonSpecificResult.index + nonSpecificResult.text.length);\n\n specificResult.index = startIndex;\n specificResult.text = text.substring(startIndex, endIndex);\n\n for (var tag in nonSpecificResult.tags) {\n specificResult.tags[tag] = true;\n }\n specificResult.tags['ENPrioritizeSpecificDateRefiner'] = true;\n return specificResult;\n}\n\nexports.Refiner = function ENPrioritizeSpecificDateRefiner() {\n Refiner.call(this);\n\n this.refine = function(text, results, opt) {\n\n if (results.length < 2) return results;\n\n var mergedResult = [];\n var currResult = null;\n var prevResult = null;\n\n for (var i = 1; i < results.length; i++) {\n\n currResult = results[i];\n prevResult = results[i-1];\n\n if (isMoreSpecific(prevResult, currResult)\n && isAbleToMerge(text, prevResult, currResult)) {\n\n prevResult = mergeResult(text, prevResult, currResult);\n currResult = null;\n i += 1;\n\n } else if (isMoreSpecific(currResult, prevResult)\n && isAbleToMerge(text, prevResult, currResult)) {\n\n prevResult = mergeResult(text, currResult, prevResult);\n currResult = null;\n i += 1;\n }\n\n mergedResult.push(prevResult);\n }\n\n if (currResult != null) {\n mergedResult.push(currResult);\n }\n\n return mergedResult;\n }\n}\n","/*\n \n*/\nvar ENMergeDateRangeRefiner = require('../en/ENMergeDateRangeRefiner').Refiner;\n\nexports.Refiner = function JPMergeDateRangeRefiner() {\n ENMergeDateRangeRefiner.call(this);\n\n this.pattern = function () { return /^\\s*(から|ー)\\s*$/i };\n}\n\n","/*\r\n \r\n*/\r\nvar Refiner = require('../refiner').Refiner;\r\n\r\nexports.Refiner = function FRMergeDateRangeRefiner() {\r\n Refiner.call(this);\r\n\r\n this.pattern = function () { return /^\\s*(à|a|\\-)\\s*$/i };\r\n\r\n this.refine = function(text, results, opt) {\r\n\r\n if (results.length < 2) return results;\r\n \r\n var mergedResult = [];\r\n var currResult = null;\r\n var prevResult = null;\r\n \r\n for (var i=1; i toResult.start.date()) {\r\n var tmp = toResult;\r\n toResult = fromResult;\r\n fromResult = tmp;\r\n }\r\n \r\n fromResult.end = toResult.start;\r\n\r\n \r\n\r\n for (var tag in toResult.tags) {\r\n fromResult.tags[tag] = true;\r\n }\r\n\r\n \r\n var startIndex = Math.min(fromResult.index, toResult.index);\r\n var endIndex = Math.max(\r\n fromResult.index + fromResult.text.length, \r\n toResult.index + toResult.text.length);\r\n \r\n fromResult.index = startIndex;\r\n fromResult.text = text.substring(startIndex, endIndex);\r\n fromResult.tags[this.constructor.name] = true;\r\n return fromResult;\r\n }\r\n};\r\n\r\n","/*\r\n \r\n*/\r\nvar ParsedComponents = require('../../result').ParsedComponents;\r\nvar Refiner = require('../refiner').Refiner;\r\nvar mergeDateTimeComponent = require('../en/ENMergeDateTimeRefiner').mergeDateTimeComponent;\r\n\r\nvar PATTERN = new RegExp(\"^\\\\s*(T|à|a|vers|de|,|-)?\\\\s*$\");\r\n\r\nfunction isDateOnly(result) {\r\n return !result.start.isCertain('hour') || result.tags['FRCasualDateParser'];\r\n}\r\n \r\nfunction isTimeOnly(result) {\r\n return !result.start.isCertain('month') && !result.start.isCertain('weekday');\r\n}\r\n\r\n\r\nfunction isAbleToMerge(text, prevResult, curResult) {\r\n var textBetween = text.substring(prevResult.index + prevResult.text.length, curResult.index);\r\n return textBetween.match(PATTERN);\r\n}\r\n\r\nfunction mergeResult(text, dateResult, timeResult){\r\n\r\n var beginDate = dateResult.start;\r\n var beginTime = timeResult.start;\r\n var beginDateTime = mergeDateTimeComponent(beginDate, beginTime);\r\n\r\n if (dateResult.end != null || timeResult.end != null) {\r\n \r\n var endDate = dateResult.end == null ? dateResult.start : dateResult.end; \r\n var endTime = timeResult.end == null ? timeResult.start : timeResult.end;\r\n var endDateTime = mergeDateTimeComponent(endDate, endTime);\r\n \r\n if (dateResult.end == null && endDateTime.date().getTime() < beginDateTime.date().getTime()) {\r\n // Ex. 9pm - 1am\r\n if (endDateTime.isCertain('day')) {\r\n endDateTime.assign('day', endDateTime.get('day') + 1);\r\n } else {\r\n endDateTime.imply('day', endDateTime.get('day') + 1);\r\n }\r\n }\r\n\r\n dateResult.end = endDateTime;\r\n }\r\n\r\n dateResult.start = beginDateTime; \r\n\r\n var startIndex = Math.min(dateResult.index, timeResult.index);\r\n var endIndex = Math.max(\r\n dateResult.index + dateResult.text.length, \r\n timeResult.index + timeResult.text.length);\r\n \r\n dateResult.index = startIndex;\r\n dateResult.text = text.substring(startIndex, endIndex);\r\n\r\n for (var tag in timeResult.tags) {\r\n dateResult.tags[tag] = true;\r\n }\r\n dateResult.tags['FRMergeDateAndTimeRefiner'] = true;\r\n return dateResult;\r\n}\r\n\r\nexports.Refiner = function FRMergeDateTimeRefiner() {\r\n Refiner.call(this);\r\n\r\n\r\n this.refine = function(text, results, opt) { \r\n\r\n if (results.length < 2) return results;\r\n\r\n var mergedResult = [];\r\n var currResult = null;\r\n var prevResult = null;\r\n\r\n for (var i = 1; i < results.length; i++) {\r\n\r\n currResult = results[i];\r\n prevResult = results[i-1];\r\n \r\n if (isDateOnly(prevResult) && isTimeOnly(currResult) \r\n && isAbleToMerge(text, prevResult, currResult)) {\r\n \r\n prevResult = mergeResult(text, prevResult, currResult);\r\n currResult = null;\r\n i += 1;\r\n \r\n } else if (isDateOnly(currResult) && isTimeOnly(prevResult)\r\n && isAbleToMerge(text, prevResult, currResult)) {\r\n \r\n prevResult = mergeResult(text, currResult, prevResult);\r\n currResult = null;\r\n i += 1;\r\n }\r\n \r\n mergedResult.push(prevResult);\r\n }\r\n\r\n if (currResult != null) {\r\n mergedResult.push(currResult);\r\n }\r\n\r\n return mergedResult;\r\n }\r\n}","/*\n \n*/\nvar ENMergeDateRangeRefiner = require('../en/ENMergeDateRangeRefiner').Refiner;\n\nexports.Refiner = function DEMergeDateRangeRefiner() {\n ENMergeDateRangeRefiner.call(this);\n\n this.pattern = function () {\n return /^\\s*(bis(?:\\s*(?:am|zum))?|\\-)\\s*$/i\n };\n};\n","/*\n \n*/\nvar ParsedComponents = require('../../result').ParsedComponents;\nvar Refiner = require('../refiner').Refiner;\n\nvar mergeDateTimeComponent = require('../en/ENMergeDateTimeRefiner').mergeDateTimeComponent;\nvar isDateOnly = require('../en/ENMergeDateTimeRefiner').isDateOnly;\nvar isTimeOnly = require('../en/ENMergeDateTimeRefiner').isTimeOnly;\n\nvar PATTERN = new RegExp(\"^\\\\s*(T|um|am|,|-)?\\\\s*$\");\n\nfunction isAbleToMerge(text, prevResult, curResult) {\n var textBetween = text.substring(prevResult.index + prevResult.text.length, curResult.index);\n return textBetween.match(PATTERN);\n}\n\nfunction mergeResult(text, dateResult, timeResult){\n\n var beginDate = dateResult.start;\n var beginTime = timeResult.start; \n var beginDateTime = mergeDateTimeComponent(beginDate, beginTime);\n\n if (dateResult.end != null || timeResult.end != null) {\n \n var endDate = dateResult.end == null ? dateResult.start : dateResult.end; \n var endTime = timeResult.end == null ? timeResult.start : timeResult.end;\n var endDateTime = mergeDateTimeComponent(endDate, endTime);\n \n if (dateResult.end == null && endDateTime.date().getTime() < beginDateTime.date().getTime()) {\n // Ex. 9pm - 1am\n if (endDateTime.isCertain('day')) {\n endDateTime.assign('day', endDateTime.get('day') + 1);\n } else {\n endDateTime.imply('day', endDateTime.get('day') + 1);\n }\n }\n\n dateResult.end = endDateTime;\n }\n\n dateResult.start = beginDateTime; \n\n var startIndex = Math.min(dateResult.index, timeResult.index);\n var endIndex = Math.max(\n dateResult.index + dateResult.text.length, \n timeResult.index + timeResult.text.length);\n \n dateResult.index = startIndex;\n dateResult.text = text.substring(startIndex, endIndex);\n\n for (var tag in timeResult.tags) {\n dateResult.tags[tag] = true;\n }\n dateResult.tags['DEMergeDateAndTimeRefiner'] = true;\n return dateResult;\n}\n\nexports.Refiner = function DEMergeDateTimeRefiner() {\n Refiner.call(this);\n\n\n this.refine = function(text, results, opt) { \n\n if (results.length < 2) return results;\n\n var mergedResult = [];\n var currResult = null;\n var prevResult = null;\n\n for (var i = 1; i < results.length; i++) {\n\n currResult = results[i];\n prevResult = results[i-1];\n \n if (isDateOnly(prevResult) && isTimeOnly(currResult) \n && isAbleToMerge(text, prevResult, currResult)) {\n \n prevResult = mergeResult(text, prevResult, currResult);\n currResult = null;\n i += 1;\n \n } else if (isDateOnly(currResult) && isTimeOnly(prevResult)\n && isAbleToMerge(text, prevResult, currResult)) {\n \n prevResult = mergeResult(text, currResult, prevResult);\n currResult = null;\n i += 1;\n }\n \n mergedResult.push(prevResult);\n }\n\n if (currResult != null) {\n mergedResult.push(currResult);\n }\n\n return mergedResult;\n }\n}","/*\n\n*/\nvar ENMergeDateRangeRefiner = require('../en/ENMergeDateRangeRefiner').Refiner;\n\nexports.Refiner = function NLMergeDateRangeRefiner() {\n ENMergeDateRangeRefiner.call(this);\n\n this.pattern = function () {\n return /^\\s*(tot|t\\/m|tot en met|\\\\-)\\s*$/i;\n };\n};\n","/*\n\n*/\nvar ParsedComponents = require('../../result').ParsedComponents;\nvar Refiner = require('../refiner').Refiner;\n\nvar mergeDateTimeComponent = require('../en/ENMergeDateTimeRefiner').mergeDateTimeComponent;\nvar isDateOnly = require('../en/ENMergeDateTimeRefiner').isDateOnly;\nvar isTimeOnly = require('../en/ENMergeDateTimeRefiner').isTimeOnly;\n\nvar PATTERN = new RegExp(\"^\\\\s*(T|op|om|voor|na|van|,|-)\\\\s*$\");\n\nfunction isAbleToMerge(text, prevResult, curResult) {\n var textBetween = text.substring(prevResult.index + prevResult.text.length, curResult.index);\n return textBetween.match(PATTERN);\n}\n\nfunction mergeResult(text, dateResult, timeResult){\n\n var beginDate = dateResult.start;\n var beginTime = timeResult.start;\n var beginDateTime = mergeDateTimeComponent(beginDate, beginTime);\n\n if (dateResult.end != null || timeResult.end != null) {\n\n var endDate = dateResult.end == null ? dateResult.start : dateResult.end;\n var endTime = timeResult.end == null ? timeResult.start : timeResult.end;\n var endDateTime = mergeDateTimeComponent(endDate, endTime);\n\n if (dateResult.end == null && endDateTime.date().getTime() < beginDateTime.date().getTime()) {\n // Ex. 9pm - 1am\n if (endDateTime.isCertain('day')) {\n endDateTime.assign('day', endDateTime.get('day') + 1);\n } else {\n endDateTime.imply('day', endDateTime.get('day') + 1);\n }\n }\n\n dateResult.end = endDateTime;\n }\n\n dateResult.start = beginDateTime;\n\n var startIndex = Math.min(dateResult.index, timeResult.index);\n var endIndex = Math.max(\n dateResult.index + dateResult.text.length,\n timeResult.index + timeResult.text.length);\n\n dateResult.index = startIndex;\n dateResult.text = text.substring(startIndex, endIndex);\n\n for (var tag in timeResult.tags) {\n dateResult.tags[tag] = true;\n }\n dateResult.tags['NLMergeDateAndTimeRefiner'] = true;\n return dateResult;\n}\n\nexports.Refiner = function NLMergeDateTimeRefiner() {\n Refiner.call(this);\n\n\n this.refine = function(text, results, opt) {\n\n if (results.length < 2) return results;\n\n var mergedResult = [];\n var currResult = null;\n var prevResult = null;\n\n for (var i = 1; i < results.length; i++) {\n\n currResult = results[i];\n prevResult = results[i-1];\n if (isDateOnly(currResult) && isTimeOnly(prevResult)\n && isAbleToMerge(text, prevResult, currResult)) {\n\n prevResult = mergeResult(text, currResult, prevResult);\n currResult = null;\n i += 1;\n mergedResult.push(prevResult);\n } else {\n mergedResult.push(prevResult);\n }\n\n }\n\n if (currResult != null) {\n mergedResult.push(currResult);\n }\n\n return mergedResult;\n }\n}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://chrono/webpack/universalModuleDefinition","webpack://chrono/webpack/bootstrap","webpack://chrono/./src/result.js","webpack://chrono/./src/parsers/parser.js","webpack://chrono/./node_modules/dayjs/dayjs.min.js","webpack://chrono/./src/refiners/refiner.js","webpack://chrono/./src/utils/EN.js","webpack://chrono/./src/refiners/en/ENMergeDateTimeRefiner.js","webpack://chrono/./src/parsers/en/ENWeekdayParser.js","webpack://chrono/./src/utils/ZH-Hant.js","webpack://chrono/./src/utils/DE.js","webpack://chrono/./src/refiners/en/ENMergeDateRangeRefiner.js","webpack://chrono/./src/utils/FR.js","webpack://chrono/./src/utils/NL.js","webpack://chrono/./src/chrono.js","webpack://chrono/./src/options.js","webpack://chrono/./src/parsers/en/ENISOFormatParser.js","webpack://chrono/./src/parsers/en/ENDeadlineFormatParser.js","webpack://chrono/./src/parsers/en/ENRelativeDateFormatParser.js","webpack://chrono/./src/parsers/en/ENMonthNameLittleEndianParser.js","webpack://chrono/./src/parsers/en/ENMonthNameMiddleEndianParser.js","webpack://chrono/./src/parsers/en/ENMonthNameParser.js","webpack://chrono/./src/parsers/en/ENSlashDateFormatParser.js","webpack://chrono/./src/parsers/en/ENSlashDateFormatStartWithYearParser.js","webpack://chrono/./src/parsers/en/ENSlashMonthFormatParser.js","webpack://chrono/./src/parsers/en/ENTimeAgoFormatParser.js","webpack://chrono/./src/parsers/en/ENTimeExpressionParser.js","webpack://chrono/./src/parsers/en/ENTimeLaterFormatParser.js","webpack://chrono/./src/parsers/en/ENCasualDateParser.js","webpack://chrono/./src/parsers/en/ENCasualTimeParser.js","webpack://chrono/./src/parsers/ja/JPStandardParser.js","webpack://chrono/./src/utils/JP.js","webpack://chrono/./src/parsers/ja/JPCasualDateParser.js","webpack://chrono/./src/parsers/pt/PTCasualDateParser.js","webpack://chrono/./src/parsers/pt/PTDeadlineFormatParser.js","webpack://chrono/./src/parsers/pt/PTMonthNameLittleEndianParser.js","webpack://chrono/./src/utils/PT.js","webpack://chrono/./src/parsers/pt/PTSlashDateFormatParser.js","webpack://chrono/./src/parsers/pt/PTTimeAgoFormatParser.js","webpack://chrono/./src/parsers/pt/PTTimeExpressionParser.js","webpack://chrono/./src/parsers/pt/PTWeekdayParser.js","webpack://chrono/./src/parsers/es/ESCasualDateParser.js","webpack://chrono/./src/parsers/es/ESDeadlineFormatParser.js","webpack://chrono/./src/parsers/es/ESTimeAgoFormatParser.js","webpack://chrono/./src/parsers/es/ESTimeExpressionParser.js","webpack://chrono/./src/parsers/es/ESWeekdayParser.js","webpack://chrono/./src/parsers/es/ESMonthNameLittleEndianParser.js","webpack://chrono/./src/utils/ES.js","webpack://chrono/./src/parsers/es/ESSlashDateFormatParser.js","webpack://chrono/./src/parsers/fr/FRCasualDateParser.js","webpack://chrono/./src/parsers/fr/FRDeadlineFormatParser.js","webpack://chrono/./src/parsers/fr/FRMonthNameLittleEndianParser.js","webpack://chrono/./src/parsers/fr/FRSlashDateFormatParser.js","webpack://chrono/./src/parsers/fr/FRTimeAgoFormatParser.js","webpack://chrono/./src/parsers/fr/FRTimeExpressionParser.js","webpack://chrono/./src/parsers/fr/FRWeekdayParser.js","webpack://chrono/./src/parsers/fr/FRRelativeDateFormatParser.js","webpack://chrono/./node_modules/dayjs/plugin/quarterOfYear.js","webpack://chrono/./src/parsers/zh-Hant/ZHHantDateParser.js","webpack://chrono/./src/parsers/zh-Hant/ZHHantWeekdayParser.js","webpack://chrono/./src/parsers/zh-Hant/ZHHantTimeExpressionParser.js","webpack://chrono/./src/parsers/zh-Hant/ZHHantCasualDateParser.js","webpack://chrono/./src/parsers/zh-Hant/ZHHantDeadlineFormatParser.js","webpack://chrono/./src/parsers/de/DEDeadlineFormatParser.js","webpack://chrono/./src/parsers/de/DEMonthNameLittleEndianParser.js","webpack://chrono/./src/parsers/de/DEMonthNameParser.js","webpack://chrono/./src/parsers/de/DESlashDateFormatParser.js","webpack://chrono/./src/parsers/de/DETimeAgoFormatParser.js","webpack://chrono/./src/parsers/de/DETimeExpressionParser.js","webpack://chrono/./src/parsers/de/DEWeekdayParser.js","webpack://chrono/./src/parsers/de/DECasualDateParser.js","webpack://chrono/./src/parsers/nl/NLMonthNameParser.js","webpack://chrono/./src/parsers/nl/NLMonthNameLittleEndianParser.js","webpack://chrono/./src/parsers/nl/NLSlashDateFormatParser.js","webpack://chrono/./src/parsers/nl/NLWeekdayParser.js","webpack://chrono/./src/parsers/nl/NLTimeExpressionParser.js","webpack://chrono/./src/parsers/nl/NLCasualDateParser.js","webpack://chrono/./src/parsers/nl/NLCasualTimeParser.js","webpack://chrono/./src/refiners/OverlapRemovalRefiner.js","webpack://chrono/./src/refiners/ExtractTimezoneOffsetRefiner.js","webpack://chrono/./src/refiners/ExtractTimezoneAbbrRefiner.js","webpack://chrono/./src/refiners/ForwardDateRefiner.js","webpack://chrono/./src/refiners/UnlikelyFormatFilter.js","webpack://chrono/./src/refiners/en/ENPrioritizeSpecificDateRefiner.js","webpack://chrono/./src/refiners/ja/JPMergeDateRangeRefiner.js","webpack://chrono/./src/refiners/fr/FRMergeDateRangeRefiner.js","webpack://chrono/./src/refiners/fr/FRMergeDateTimeRefiner.js","webpack://chrono/./src/refiners/de/DEMergeDateRangeRefiner.js","webpack://chrono/./src/refiners/de/DEMergeDateTimeRefiner.js","webpack://chrono/./src/refiners/nl/NLMergeDateRangeRefiner.js","webpack://chrono/./src/refiners/nl/NLMergeDateTimeRefiner.js"],"names":["root","factory","exports","module","define","amd","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","dayjs","require","ParsedResult","result","ref","index","text","tags","start","ParsedComponents","end","components","knownValues","impliedValues","imply","date","month","year","clone","JSON","parse","stringify","hasPossibleDates","isPossibleDate","isOnlyWeekday","isOnlyWeekdayComponent","isOnlyDayMonth","isOnlyDayMonthComponent","component","assign","isCertain","dateMoment","adjustTimezoneOffset","utcOffset","add","toDate","currentTimezoneOffset","hour","minute","second","millisecond","undefined","moment","Parser","config","strictMode","strict","isStrictMode","pattern","extract","match","opt","execute","results","regex","remainingText","exec","length","substring","push","refiners","forEach","refiner","refine","options","findYearClosestToRef","day","refMoment","nextYear","lastYear","Math","abs","diff","ENISOFormatParser","ENDeadlineFormatParser","ENRelativeDateFormatParser","ENMonthNameLittleEndianParser","ENMonthNameMiddleEndianParser","ENMonthNameParser","ENSlashDateFormatParser","ENSlashDateFormatStartWithYearParser","ENSlashMonthFormatParser","ENTimeAgoFormatParser","ENTimeExpressionParser","ENTimeLaterFormatParser","ENWeekdayParser","ENCasualDateParser","ENCasualTimeParser","JPStandardParser","JPCasualDateParser","PTCasualDateParser","PTDeadlineFormatParser","PTMonthNameLittleEndianParser","PTSlashDateFormatParser","PTTimeAgoFormatParser","PTTimeExpressionParser","PTWeekdayParser","ESCasualDateParser","ESDeadlineFormatParser","ESTimeAgoFormatParser","ESTimeExpressionParser","ESWeekdayParser","ESMonthNameLittleEndianParser","ESSlashDateFormatParser","FRCasualDateParser","FRDeadlineFormatParser","FRMonthNameLittleEndianParser","FRSlashDateFormatParser","FRTimeAgoFormatParser","FRTimeExpressionParser","FRWeekdayParser","FRRelativeDateFormatParser","ZHHantDateParser","ZHHantWeekdayParser","ZHHantTimeExpressionParser","ZHHantCasualDateParser","ZHHantDeadlineFormatParser","DEDeadlineFormatParser","DEMonthNameLittleEndianParser","DEMonthNameParser","DESlashDateFormatParser","DETimeAgoFormatParser","DETimeExpressionParser","DEWeekdayParser","DECasualDateParser","NLMonthNameParser","NLMonthNameLittleEndianParser","NLSlashDateFormatParser","NLWeekdayParser","NLTimeExpressionParser","NLCasualDateParser","NLCasualTimeParser","e","u","a","h","f","String","Array","join","z","floor","Number","ceil","M","y","w","D","ms","Q","toLowerCase","replace","$","weekdays","split","months","v","g","args","arguments","locale","$L","utc","$u","$offset","$d","Date","NaN","test","UTC","init","$y","getFullYear","$M","getMonth","$D","getDate","$W","getDay","$H","getHours","$m","getMinutes","$s","getSeconds","$ms","getMilliseconds","$utils","isValid","toString","isSame","startOf","endOf","isAfter","isBefore","$g","set","unix","valueOf","getTime","apply","slice","$locale","weekStart","$set","min","daysInMonth","round","subtract","format","substr","meridiem","YY","YYYY","MM","MMM","monthsShort","MMMM","DD","dd","weekdaysMin","ddd","weekdaysShort","dddd","H","HH","hh","A","mm","ss","SSS","Z","getTimezoneOffset","toJSON","toISOString","toUTCString","extend","isDayjs","en","Ls","Refiner","Filter","filteredResult","OverlapRemovalRefiner","ExtractTimezoneOffsetRefiner","ExtractTimezoneAbbrRefiner","ForwardDateRefiner","UnlikelyFormatFilter","ENMergeDateTimeRefiner","ENMergeDateRangeRefiner","ENPrioritizeSpecificDateRefiner","JPMergeDateRangeRefiner","FRMergeDateRangeRefiner","FRMergeDateTimeRefiner","DEMergeDateRangeRefiner","DEMergeDateTimeRefiner","NLMergeDateRangeRefiner","NLMergeDateTimeRefiner","WEEKDAY_OFFSET","MONTH_OFFSET","MONTH_PATTERN","keys","INTEGER_WORDS","INTEGER_WORDS_PATTERN","ORDINAL_WORDS","ORDINAL_WORDS_PATTERN","TIME_UNIT","PATTERN_TIME_UNIT","RegExp","collectDateTimeFragment","fragments","num","parseFloat","TIME_UNIT_PATTERN","TIME_UNIT_STRICT_PATTERN","extractDateTimeUnitFragments","timeunitText","PATTERN","isDateOnly","isTimeOnly","isAbleToMerge","prevResult","curResult","mergeDateTimeComponent","dateComponent","timeComponent","dateTimeComponent","mergeResult","dateResult","timeResult","beginDate","beginTime","beginDateTime","endDate","endTime","endDateTime","startIndex","endIndex","max","tag","mergedResult","currResult","DAYS_OFFSET","updateParsedComponent","offset","modifier","startMoment","startMomentFixed","refOffset","dayOfWeek","prefix","postfix","norm","NUMBER","zhStringToNumber","number","char","zhStringToYear","string","parseInt","result1","result2","begin","fromResult","toResult","fromMoment","toMoment","tmp","constructor","WEEKDAY_PATTERN","parser","Chrono","option","casualOption","parsers","refDate","forwardDate","allResults","concat","sort","b","parseDate","strictOption","casual","mergeOptions","commonPostProcessing","en_GB","de","nl","pt","es","fr","ja","addedTypes","mergedOption","strictConfig","zh","unshift","littleEndian","minuteOffset","hourOffset","util","STRICT_PATTERN","trim","weekday","yearBE","monthName","MONTH_GROUP","DAY_GROUP","indexOf","tday","argument","FIRST_REG_PATTERN","SECOND_REG_PATTERN","ampm","suffix","preamble","lowerText","TIME_MATCH","toHankaku","fromCharCode","alphaNum","token","charCodeAt","toZenkaku","secondMatch","firstMatch","isNaN","quarterOfYear","multiplier","modifierFactor","total","dateFrom","dateTo","relative","dateTmp","quarter","patternString1","patternString2","ZHTimeExpressionParser","day1","day3","zhAMPM1","zhAMPM2","zhAMPM3","endMoment","time1","time2","timeString3","time3","unitAbbr","filteredResults","TIMEZONE_OFFSET_PATTERN","timezoneOffset","TIMEZONE_NAME_PATTERN","DEFAULT_TIMEZONE_ABBR_MAP","timezones","timezoneAbbr","toUpperCase","isMoreSpecific","moreSpecific","textBetween","includesRelativeResult","referToSameDate","specificResult","nonSpecificResult","isWeekdayResult"],"mappings":";CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAgB,OAAID,IAEpBD,EAAa,OAAIC,IARnB,CASGK,MAAM,WACT,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUP,QAGnC,IAAIC,EAASI,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHT,QAAS,IAUV,OANAU,EAAQH,GAAUI,KAAKV,EAAOD,QAASC,EAAQA,EAAOD,QAASM,GAG/DL,EAAOQ,GAAI,EAGJR,EAAOD,QA0Df,OArDAM,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASd,EAASe,EAAMC,GAC3CV,EAAoBW,EAAEjB,EAASe,IAClCG,OAAOC,eAAenB,EAASe,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEV,EAA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OAAQzF,IAEhC6U,EAAaxP,EAAQrF,GACrByT,EAAapO,EAAQrF,EAAE,GACnBsT,EAAWuB,IAAetB,EAAWE,IAC9BD,EAAclR,EAAMmR,EAAYoB,IAEvCpB,EAAaM,EAAYzR,EAAMuS,EAAYpB,GAC3CoB,EAAa,KACb7U,GAAK,EACL4U,EAAajP,KAAK8N,IAElBmB,EAAajP,KAAK8N,GAS1B,OAJkB,MAAdoB,GACAD,EAAajP,KAAKkP,GAGfD","file":"chrono.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"chrono\"] = factory();\n\telse\n\t\troot[\"chrono\"] = factory();\n})(this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 12);\n","const dayjs = require('dayjs');\n\nfunction ParsedResult(result){\n result = result || {};\n\n this.ref = result.ref;\n this.index = result.index;\n this.text = result.text;\n this.tags = result.tags || {};\n\n this.start = new ParsedComponents(result.start, result.ref)\n if(result.end){\n this.end = new ParsedComponents(result.end, result.ref)\n }\n}\n\nParsedResult.prototype.clone = function() {\n var result = new ParsedResult(this);\n result.tags = JSON.parse(JSON.stringify(this.tags));\n result.start = this.start.clone();\n if (this.end) {\n result.end = this.end.clone();\n }\n\n return result\n}\n\nParsedResult.prototype.date = function() {\n return this.start.date();\n}\n\nParsedResult.prototype.hasPossibleDates = function() {\n return this.start.isPossibleDate() && (!this.end || this.end.isPossibleDate());\n}\n\nParsedResult.prototype.isOnlyWeekday = function() {\n return this.start.isOnlyWeekdayComponent();\n}\n\nParsedResult.prototype.isOnlyDayMonth = function() {\n return this.start.isOnlyDayMonthComponent();\n}\n\nfunction ParsedComponents (components, ref){\n\n this.knownValues = {};\n this.impliedValues = {};\n\n if (components) {\n for (let key in components) {\n this.knownValues[key] = components[key];\n }\n }\n\n if (ref) {\n ref = dayjs(ref);\n this.imply('day', ref.date())\n this.imply('month', ref.month() + 1)\n this.imply('year', ref.year())\n }\n \n\n this.imply('hour', 12);\n this.imply('minute', 0);\n this.imply('second', 0);\n this.imply('millisecond', 0);\n}\n\nParsedComponents.prototype.clone = function () {\n var component = new ParsedComponents();\n component.knownValues = JSON.parse(JSON.stringify(this.knownValues));\n component.impliedValues = JSON.parse(JSON.stringify(this.impliedValues));\n return component;\n};\n\nParsedComponents.prototype.get = function(component, value) {\n if (component in this.knownValues) return this.knownValues[component];\n if (component in this.impliedValues) return this.impliedValues[component];\n};\n\nParsedComponents.prototype.assign = function(component, value) {\n this.knownValues[component] = value;\n delete this.impliedValues[component];\n};\n\nParsedComponents.prototype.imply = function(component, value) {\n if (component in this.knownValues) return;\n this.impliedValues[component] = value;\n};\n\nParsedComponents.prototype.isCertain = function(component) {\n return component in this.knownValues;\n};\n\nParsedComponents.prototype.isOnlyWeekdayComponent = function() {\n return this.isCertain('weekday') && !this.isCertain('day') && !this.isCertain('month');\n};\n\nParsedComponents.prototype.isOnlyDayMonthComponent = function() {\n return this.isCertain('day') && this.isCertain('month') && !this.isCertain('year');\n};\n\nParsedComponents.prototype.isPossibleDate = function() {\n var dateMoment = this.dayjs();\n if (this.isCertain('timezoneOffset')) {\n const adjustTimezoneOffset = this.get('timezoneOffset') - dateMoment.utcOffset();\n dateMoment = dateMoment.add(adjustTimezoneOffset, 'minutes');\n }\n\n if (dateMoment.get('year') != this.get('year')) return false;\n if (dateMoment.get('month') != this.get('month')-1) return false;\n if (dateMoment.get('date') != this.get('day')) return false;\n if (dateMoment.get('hour') != this.get('hour')) return false;\n if (dateMoment.get('minute') != this.get('minute')) return false;\n\n return true;\n};\n\nParsedComponents.prototype.date = function() {\n var result = this.dayjs();\n return result.toDate();\n};\n\n\nParsedComponents.prototype.dayjs = function() {\n var result = dayjs();\n\n result = result.year(this.get('year'));\n result = result.month(this.get('month') - 1);\n result = result.date(this.get('day'));\n result = result.hour(this.get('hour'));\n result = result.minute(this.get('minute'));\n result = result.second(this.get('second'));\n result = result.millisecond(this.get('millisecond'));\n\n // Javascript Date Object return minus timezone offset\n var currentTimezoneOffset = result.utcOffset();\n var targetTimezoneOffset = this.get('timezoneOffset') !== undefined ? \n this.get('timezoneOffset') : currentTimezoneOffset;\n\n var adjustTimezoneOffset = targetTimezoneOffset - currentTimezoneOffset;\n result = result.add(-adjustTimezoneOffset, 'minute');\n\n return result;\n};\n\nParsedComponents.prototype.moment = function() {\n // Keep for compatibility\n return this.dayjs();\n};\n\n\n\nexports.ParsedComponents = ParsedComponents;\nexports.ParsedResult = ParsedResult;\n","const dayjs = require('dayjs');\n\nexports.Parser = function (config) {\n\n config = config || {};\n var strictMode = config.strict;\n\n this.isStrictMode = function() { return (strictMode == true) };\n\n this.pattern = function() { return /./i; }\n\n this.extract = function(text, ref, match, opt){ return null; }\n\n this.execute = function(text, ref, opt) {\n\n var results = [];\n var regex = this.pattern();\n\n var remainingText = text;\n var match = regex.exec(remainingText);\n\n while (match) {\n\n // Calculate match index on the full text;\n match.index += text.length - remainingText.length;\n\n var result = this.extract(text, ref, match, opt);\n if (result) {\n\n // If success, start from the end of the result\n remainingText = text.substring(result.index + result.text.length);\n\n if (!this.isStrictMode() || result.hasPossibleDates()) {\n results.push(result);\n }\n\n } else {\n // If fail, move on by 1\n remainingText = text.substring(match.index + 1);\n }\n\n match = regex.exec(remainingText);\n }\n\n if (this.refiners) {\n this.refiners.forEach(function () {\n results = refiner.refine(results, text, options);\n });\n }\n\n return results;\n }\n}\n\nexports.findYearClosestToRef = function (ref, day, month) {\n //Find the most appropriated year\n const refMoment = dayjs(ref);\n var dateMoment = refMoment;\n dateMoment = dateMoment.month(month - 1);\n dateMoment = dateMoment.date(day);\n dateMoment = dateMoment.year(refMoment.year())\n\n const nextYear = dateMoment.add(1, 'y');\n const lastYear = dateMoment.add(-1, 'y');\n if( Math.abs(nextYear.diff(refMoment)) < Math.abs(dateMoment.diff(refMoment)) ){\n dateMoment = nextYear;\n }\n else if( Math.abs(lastYear.diff(refMoment)) < Math.abs(dateMoment.diff(refMoment)) ){\n dateMoment = lastYear;\n }\n\n return dateMoment.year();\n}\n\nexports.ENISOFormatParser = require('./en/ENISOFormatParser').Parser;\nexports.ENDeadlineFormatParser = require('./en/ENDeadlineFormatParser').Parser;\nexports.ENRelativeDateFormatParser = require('./en/ENRelativeDateFormatParser').Parser;\nexports.ENMonthNameLittleEndianParser = require('./en/ENMonthNameLittleEndianParser').Parser;\nexports.ENMonthNameMiddleEndianParser = require('./en/ENMonthNameMiddleEndianParser').Parser;\nexports.ENMonthNameParser = require('./en/ENMonthNameParser').Parser;\nexports.ENSlashDateFormatParser = require('./en/ENSlashDateFormatParser').Parser;\nexports.ENSlashDateFormatStartWithYearParser = require('./en/ENSlashDateFormatStartWithYearParser').Parser;\nexports.ENSlashMonthFormatParser = require('./en/ENSlashMonthFormatParser').Parser;\nexports.ENTimeAgoFormatParser = require('./en/ENTimeAgoFormatParser').Parser;\nexports.ENTimeExpressionParser = require('./en/ENTimeExpressionParser').Parser;\nexports.ENTimeLaterFormatParser = require('./en/ENTimeLaterFormatParser').Parser;\nexports.ENWeekdayParser = require('./en/ENWeekdayParser').Parser;\nexports.ENCasualDateParser = require('./en/ENCasualDateParser').Parser;\nexports.ENCasualTimeParser = require('./en/ENCasualTimeParser').Parser;\n\nexports.JPStandardParser = require('./ja/JPStandardParser').Parser;\nexports.JPCasualDateParser = require('./ja/JPCasualDateParser').Parser;\n\nexports.PTCasualDateParser = require('./pt/PTCasualDateParser').Parser;\nexports.PTDeadlineFormatParser = require('./pt/PTDeadlineFormatParser').Parser;\nexports.PTMonthNameLittleEndianParser = require('./pt/PTMonthNameLittleEndianParser').Parser;\nexports.PTSlashDateFormatParser = require('./pt/PTSlashDateFormatParser').Parser;\nexports.PTTimeAgoFormatParser = require('./pt/PTTimeAgoFormatParser').Parser;\nexports.PTTimeExpressionParser = require('./pt/PTTimeExpressionParser').Parser;\nexports.PTWeekdayParser = require('./pt/PTWeekdayParser').Parser;\n\nexports.ESCasualDateParser = require('./es/ESCasualDateParser').Parser;\nexports.ESDeadlineFormatParser = require('./es/ESDeadlineFormatParser').Parser;\nexports.ESTimeAgoFormatParser = require('./es/ESTimeAgoFormatParser').Parser;\nexports.ESTimeExpressionParser = require('./es/ESTimeExpressionParser').Parser;\nexports.ESWeekdayParser = require('./es/ESWeekdayParser').Parser;\nexports.ESMonthNameLittleEndianParser = require('./es/ESMonthNameLittleEndianParser').Parser;\nexports.ESSlashDateFormatParser = require('./es/ESSlashDateFormatParser').Parser;\n\nexports.FRCasualDateParser = require('./fr/FRCasualDateParser').Parser;\nexports.FRDeadlineFormatParser = require('./fr/FRDeadlineFormatParser').Parser;\nexports.FRMonthNameLittleEndianParser = require('./fr/FRMonthNameLittleEndianParser').Parser;\nexports.FRSlashDateFormatParser = require('./fr/FRSlashDateFormatParser').Parser;\nexports.FRTimeAgoFormatParser = require('./fr/FRTimeAgoFormatParser').Parser;\nexports.FRTimeExpressionParser = require('./fr/FRTimeExpressionParser').Parser;\nexports.FRWeekdayParser = require('./fr/FRWeekdayParser').Parser;\nexports.FRRelativeDateFormatParser = require('./fr/FRRelativeDateFormatParser').Parser;\n\nexports.ZHHantDateParser = require('./zh-Hant/ZHHantDateParser').Parser;\nexports.ZHHantWeekdayParser = require('./zh-Hant/ZHHantWeekdayParser').Parser;\nexports.ZHHantTimeExpressionParser = require('./zh-Hant/ZHHantTimeExpressionParser').Parser;\nexports.ZHHantCasualDateParser = require('./zh-Hant/ZHHantCasualDateParser').Parser;\nexports.ZHHantDeadlineFormatParser = require('./zh-Hant/ZHHantDeadlineFormatParser').Parser;\n\nexports.DEDeadlineFormatParser = require('./de/DEDeadlineFormatParser').Parser;\nexports.DEMonthNameLittleEndianParser = require('./de/DEMonthNameLittleEndianParser').Parser;\nexports.DEMonthNameParser = require('./de/DEMonthNameParser').Parser;\nexports.DESlashDateFormatParser = require('./de/DESlashDateFormatParser').Parser;\nexports.DETimeAgoFormatParser = require('./de/DETimeAgoFormatParser').Parser;\nexports.DETimeExpressionParser = require('./de/DETimeExpressionParser').Parser;\nexports.DEWeekdayParser = require('./de/DEWeekdayParser').Parser;\nexports.DECasualDateParser = require('./de/DECasualDateParser').Parser;\n\nexports.NLMonthNameParser = require('./nl/NLMonthNameParser').Parser;\nexports.NLMonthNameLittleEndianParser = require('./nl/NLMonthNameLittleEndianParser').Parser;\nexports.NLSlashDateFormatParser = require('./nl/NLSlashDateFormatParser').Parser;\nexports.NLWeekdayParser = require('./nl/NLWeekdayParser').Parser;\nexports.NLTimeExpressionParser = require('./nl/NLTimeExpressionParser').Parser;\nexports.NLCasualDateParser = require('./nl/NLCasualDateParser').Parser;\nexports.NLCasualTimeParser = require('./nl/NLCasualTimeParser').Parser;\n","!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):t.dayjs=e()}(this,function(){\"use strict\";var t=\"millisecond\",e=\"second\",n=\"minute\",r=\"hour\",i=\"day\",s=\"week\",u=\"month\",o=\"quarter\",a=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},d={s:c,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+c(r,2,\"0\")+\":\"+c(i,2,\"0\")},m:function(t,e){var n=12*(e.year()-t.year())+(e.month()-t.month()),r=t.clone().add(n,u),i=e-r<0,s=t.clone().add(n+(i?-1:1),u);return Number(-(n+(e-r)/(i?r-s:s-r))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:a,w:s,d:i,D:\"date\",h:r,m:n,s:e,ms:t,Q:o}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof v},M=function(t,e,n){var r;if(!t)return l;if(\"string\"==typeof t)m[t]&&(r=t),e&&(m[t]=e,r=t);else{var i=t.name;m[i]=t,r=i}return!n&&r&&(l=r),r||!n&&l},g=function(t,e){if(y(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new v(n)},D=d;D.l=M,D.i=y,D.w=function(t,e){return g(t,{locale:e.$L,utc:e.$u,$offset:e.$offset})};var v=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0),this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(D.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match(h);if(r)return n?new Date(Date.UTC(r[1],r[2]-1,r[3]||1,r[4]||0,r[5]||0,r[6]||0,r[7]||0)):new Date(r[1],r[2]-1,r[3]||1,r[4]||0,r[5]||0,r[6]||0,r[7]||0)}return new Date(e)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,e){var n=g(t);return this.startOf(e)<=n&&n<=this.endOf(e)},d.isAfter=function(t,e){return g(t) toResult.start.date().getTime()) {\n \n var fromMoment = fromResult.start.dayjs();\n var toMoment = toResult.start.dayjs();\n\n if (fromResult.isOnlyWeekday() && fromMoment.add(-7, 'days').isBefore(toMoment)) {\n fromMoment = fromMoment.add(-7, 'days');\n fromResult.start.imply('day', fromMoment.date());\n fromResult.start.imply('month', fromMoment.month() + 1);\n fromResult.start.imply('year', fromMoment.year());\n } else if (toResult.isOnlyWeekday() && toMoment.add(7, 'days').isAfter(fromMoment)) {\n toMoment = toMoment.add(7, 'days');\n toResult.start.imply('day', toMoment.date());\n toResult.start.imply('month', toMoment.month() + 1);\n toResult.start.imply('year', toMoment.year());\n } else {\n var tmp = toResult;\n toResult = fromResult;\n fromResult = tmp;\n }\n }\n \n fromResult.end = toResult.start;\n\n \n\n for (var tag in toResult.tags) {\n fromResult.tags[tag] = true;\n }\n\n \n var startIndex = Math.min(fromResult.index, toResult.index);\n var endIndex = Math.max(\n fromResult.index + fromResult.text.length, \n toResult.index + toResult.text.length);\n \n fromResult.index = startIndex;\n fromResult.text = text.substring(startIndex, endIndex);\n fromResult.tags[this.constructor.name] = true;\n return fromResult;\n }\n};\n\n","exports.WEEKDAY_OFFSET = { \r\n 'dimanche': 0, \r\n 'dim': 0, \r\n 'lundi': 1, \r\n 'lun': 1,\r\n 'mardi': 2, \r\n 'mar':2, \r\n 'mercredi': 3, \r\n 'mer': 3, \r\n 'jeudi': 4, \r\n 'jeu': 4, \r\n 'vendredi': 5, \r\n 'ven': 5,\r\n 'samedi': 6, \r\n 'sam': 6\r\n};\r\n \r\nexports.MONTH_OFFSET = { \r\n 'janvier': 1,\r\n 'jan': 1,\r\n 'jan.': 1,\r\n 'février': 2,\r\n 'fév': 2,\r\n 'fév.': 2,\r\n 'fevrier': 2,\r\n 'fev': 2,\r\n 'fev.': 2,\r\n 'mars': 3,\r\n 'mar': 3,\r\n 'mar.': 3,\r\n 'avril': 4,\r\n 'avr': 4,\r\n 'avr.': 4,\r\n 'mai': 5,\r\n 'juin': 6,\r\n 'jun': 6,\r\n 'juillet': 7,\r\n 'jul': 7,\r\n 'jul.': 7,\r\n 'août': 8,\r\n 'aout': 8,\r\n 'septembre': 9,\r\n 'sep': 9,\r\n 'sep.': 9,\r\n 'sept': 9,\r\n 'sept.': 9,\r\n 'octobre': 10,\r\n 'oct': 10,\r\n 'oct.': 10,\r\n 'novembre': 11,\r\n 'nov': 11,\r\n 'nov.': 11,\r\n 'décembre': 12,\r\n 'decembre': 12,\r\n 'dec': 12,\r\n 'dec.': 12\r\n};\r\n\r\nexports.INTEGER_WORDS_PATTERN = '(?:un|deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize)';\r\nexports.INTEGER_WORDS = {\r\n 'un' : 1,\r\n 'deux' : 2,\r\n 'trois' : 3,\r\n 'quatre' : 4,\r\n 'cinq' : 5,\r\n 'six' : 6,\r\n 'sept' : 7,\r\n 'huit' : 8,\r\n 'neuf' : 9,\r\n 'dix' : 10,\r\n 'onze' : 11,\r\n 'douze' : 12,\r\n 'treize' : 13,\r\n};\r\n","exports.WEEKDAY_OFFSET = {\n 'zondag': 0,\n 'zo': 0,\n 'zo.': 0,\n 'maandag': 1,\n 'ma': 1,\n 'ma.': 1,\n 'dinsdag': 2,\n 'di':2,\n 'di.':2,\n 'woensdag': 3,\n 'wo': 3,\n 'wo.': 3,\n 'donderdag': 4,\n 'do': 4,\n 'do.': 4,\n 'vrijdag': 5,\n 'vr': 5,\n 'vr.': 5,\n 'zaterdag': 6,\n 'za': 6,\n 'za.': 6\n};\n\nexports.WEEKDAY_PATTERN = '(?:'\n + Object.keys(exports.WEEKDAY_OFFSET).join('|').replace(/\\./g, '\\\\.')\n + ')';\n\nexports.MONTH_OFFSET = {\n 'januari': 1,\n 'jan': 1,\n 'jan.': 1,\n 'februari': 2,\n 'feb': 2,\n 'feb.': 2,\n 'maart': 3,\n 'mrt': 3,\n 'mrt.': 3,\n 'april': 4,\n 'apr': 4,\n 'apr.': 4,\n 'mei': 5,\n 'juni': 6,\n 'jun': 6,\n 'jun.': 6,\n 'juli': 7,\n 'jul': 7,\n 'jul.': 7,\n 'augustus': 8,\n 'aug': 8,\n 'aug.': 8,\n 'september': 9,\n 'sep': 9,\n 'sep.': 9,\n 'sept': 9,\n 'sept.': 9,\n 'oktober': 10,\n 'okt': 10,\n 'okt.': 10,\n 'november': 11,\n 'nov': 11,\n 'nov.': 11,\n 'december': 12,\n 'dec': 12,\n 'dec.': 12\n};\n\nexports.MONTH_PATTERN = '(?:'\n + Object.keys(exports.MONTH_OFFSET).join('|').replace(/\\./g, '\\\\.')\n + ')';\n\nexports.INTEGER_WORDS = {\n 'een' : 1,\n 'één' : 1,\n 'twee' : 2,\n 'drie' : 3,\n 'vier' : 4,\n 'vijf' : 5,\n 'zes' : 6,\n 'zeven' : 7,\n 'acht' : 8,\n 'negen' : 9,\n 'tien' : 10,\n 'elf' : 11,\n 'twaalf' : 12\n};\nexports.INTEGER_WORDS_PATTERN = '(?:'\n + Object.keys(exports.INTEGER_WORDS).join('|')\n +')';\n\nexports.ORDINAL_WORDS = {\n 'eerste' : 1,\n 'tweede': 2,\n 'derde': 3,\n 'vierde': 4,\n 'vijfde': 5,\n 'zesde': 6,\n 'zevende': 7,\n 'achste': 8,\n 'negende': 9,\n 'tiende': 10,\n 'elfde': 11,\n 'twaalfde': 12,\n 'dertiende': 13,\n 'veertiende': 14,\n 'vijftiende': 15,\n 'zestiende': 16,\n 'zeventiende': 17,\n 'achttiende': 18,\n 'negentiende': 19,\n 'twintigste': 20,\n 'eenentwintigste': 21,\n 'tweeëntwintigste': 22,\n 'drieëntwintigste': 23,\n 'vierentwintigste': 24,\n 'vijfentwintigste': 25,\n 'zesentwintigste': 26,\n 'zevenentwintigste': 27,\n 'achtentwintigste': 28,\n 'negenentwintigste': 29,\n 'dertigste': 30,\n 'eenendertigste': 31\n};\nexports.ORDINAL_WORDS_PATTERN = '(?:'\n + Object.keys(exports.ORDINAL_WORDS).join('|').replace(/ /g, '[ -]')\n + ')';\n\nvar TIME_UNIT =\n '(' + exports.INTEGER_WORDS_PATTERN + '|[0-9]+|[0-9]+\\.[0-9]+|en(?:\\\\s*few)?|half)\\\\s*' +\n '(sec(?:onde?)?|min(?:uten)?s?|(?:uur|uren)?|weken?|dagen?|maanden?|jaren?)\\\\s*';\n\nvar TIME_UNIT_STRICT =\n '(?:[0-9]+?)\\\\s*' +\n '(?:seconden?|(?:minuut|minuten)|(?:uur|uren)|(?:dag|dagen))\\\\s*';\n\nvar PATTERN_TIME_UNIT = new RegExp(TIME_UNIT, 'i');\n\nexports.TIME_UNIT_PATTERN = '(?:' + TIME_UNIT + ')+';\nexports.TIME_UNIT_STRICT_PATTERN = '(?:' + TIME_UNIT_STRICT + ')+';\n\nexports.extractDateTimeUnitFragments = function (timeunitText) {\n var fragments = {};\n var remainingText = timeunitText;\n var match = PATTERN_TIME_UNIT.exec(remainingText);\n while (match) {\n collectDateTimeFragment(match, fragments);\n remainingText = remainingText.substring(match[0].length);\n match = PATTERN_TIME_UNIT.exec(remainingText);\n }\n return fragments;\n};\n\nfunction collectDateTimeFragment(match, fragments) {\n var num = match[1].toLowerCase() ;\n if (exports.INTEGER_WORDS[num] !== undefined) {\n num = exports.INTEGER_WORDS[num];\n } else if (num.match(/half/)) {\n num = 0.5;\n } else {\n num = parseFloat(num);\n }\n\n if (match[2].match(/^(?:uur|uren)/i)) {\n fragments['hour'] = num;\n } else if (match[2].match(/min/i)) {\n fragments['minute'] = num;\n } else if (match[2].match(/sec/i)) {\n fragments['second'] = num;\n } else if (match[2].match(/week/i)) {\n fragments['week'] = num;\n } else if (match[2].match(/dag/i)) {\n fragments['d'] = num;\n } else if (match[2].match(/maand/i)) {\n fragments['month'] = num;\n } else if (match[2].match(/jaar/i)) {\n fragments['year'] = num;\n }\n\n return fragments;\n}\n","\nvar options = exports.options = require('./options');\n\nexports.parser = require('./parsers/parser');\nexports.refiner = require('./refiners/refiner');\n\nexports.Parser = exports.parser.Parser;\nexports.Refiner = exports.refiner.Refiner;\nexports.Filter = exports.refiner.Filter;\n\nexports.ParsedResult = require('./result').ParsedResult;\nexports.ParsedComponents = require('./result').ParsedComponents;\n\nvar Chrono = function(option) {\n\n option = option || exports.options.casualOption();\n this.parsers = new Object(option.parsers);\n this.refiners = new Object(option.refiners);\n};\n\n\nChrono.prototype.parse = function(text, refDate, opt) {\n\n refDate = refDate || new Date();\n opt = opt || {};\n opt.forwardDate = opt.forwardDate || opt.forwardDate;\n \n var allResults = [];\n\n this.parsers.forEach(function (parser) {\n var results = parser.execute(text, refDate, opt);\n allResults = allResults.concat(results);\n });\n\n allResults.sort(function(a, b) {\n return a.index - b.index;\n });\n\n this.refiners.forEach(function (refiner) {\n allResults = refiner.refine(text, allResults, opt);\n });\n \n return allResults;\n};\n\n\nChrono.prototype.parseDate = function(text, refDate, opt) {\n var results = this.parse(text, refDate, opt);\n if (results.length > 0) {\n return results[0].start.date();\n }\n return null;\n};\n\nexports.Chrono = Chrono;\nexports.strict = new Chrono( options.strictOption() );\nexports.casual = new Chrono( options.casualOption() );\n\nexports.en = new Chrono( options.mergeOptions([\n options.en.casual, options.commonPostProcessing]));\n\nexports.en_GB = new Chrono( options.mergeOptions([\n options.en_GB.casual, options.commonPostProcessing]));\n\nexports.de = new Chrono( options.mergeOptions([\n options.de.casual, options.en, options.commonPostProcessing]));\n\nexports.nl = new Chrono( options.mergeOptions([\n options.nl.casual, options.en, options.commonPostProcessing]));\n\nexports.pt = new Chrono( options.mergeOptions([\n options.pt.casual, options.en, options.commonPostProcessing]));\n\nexports.es = new Chrono( options.mergeOptions([\n options.es.casual, options.en, options.commonPostProcessing]));\n\nexports.fr = new Chrono( options.mergeOptions([\n options.fr.casual, options.en, options.commonPostProcessing]));\n\nexports.ja = new Chrono( options.mergeOptions([ \n options.ja.casual, options.en, options.commonPostProcessing]));\n\n\nexports.parse = function () {\n return exports.casual.parse.apply(exports.casual, arguments);\n};\n\nexports.parseDate = function () {\n return exports.casual.parseDate.apply(exports.casual, arguments);\n};\n\n\n\n\n","var parser = require('./parsers/parser');\nvar refiner = require('./refiners/refiner');\n\n\nexports.mergeOptions = function(options) {\n\n var addedTypes = {};\n var mergedOption = {\n parsers: [],\n refiners: []\n };\n\n options.forEach(function (option) {\n\n if (option.call) {\n option = option.call();\n }\n\n if (option.parsers) {\n option.parsers.forEach(function (p) {\n if (!addedTypes[p.constructor]) {\n mergedOption.parsers.push(p);\n addedTypes[p.constructor] = true;\n }\n });\n }\n\n if (option.refiners) {\n option.refiners.forEach(function (r) {\n if (!addedTypes[r.constructor]) {\n mergedOption.refiners.push(r);\n addedTypes[r.constructor] = true;\n }\n });\n }\n });\n\n return mergedOption;\n};\n\n\nexports.commonPostProcessing = function() {\n return {\n refiners: [\n // These should be after all other refiners\n new refiner.ExtractTimezoneOffsetRefiner(),\n new refiner.ExtractTimezoneAbbrRefiner(),\n new refiner.UnlikelyFormatFilter()\n ]\n }\n};\n\n\n// -------------------------------------------------------------\n\nexports.strictOption = function () {\n var strictConfig = {\n strict: true\n };\n\n return exports.mergeOptions([\n exports.en(strictConfig),\n exports.de(strictConfig),\n exports.nl(strictConfig),\n exports.pt(strictConfig),\n exports.es(strictConfig),\n exports.fr(strictConfig),\n exports.ja(strictConfig),\n exports.zh,\n exports.commonPostProcessing\n ]);\n};\n\nexports.casualOption = function () {\n return exports.mergeOptions([\n exports.en.casual,\n // Some German abbriviate overlap with common English\n exports.de({ strict: true }),\n exports.nl,\n exports.pt,\n exports.es,\n exports.fr,\n exports.ja,\n exports.zh,\n exports.commonPostProcessing\n ]);\n};\n\n// -------------------------------------------------------------\n\nexports.de = function(config) {\n return {\n parsers: [\n new parser.DEDeadlineFormatParser(config),\n new parser.DEMonthNameLittleEndianParser(config),\n new parser.DEMonthNameParser(config),\n new parser.DESlashDateFormatParser(config),\n new parser.DETimeAgoFormatParser(config),\n new parser.DETimeExpressionParser(config)\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner(),\n new refiner.DEMergeDateTimeRefiner(),\n new refiner.DEMergeDateRangeRefiner()\n ]\n }\n};\n\nexports.de.casual = function() {\n var option = exports.de({\n strict: false\n });\n option.parsers.unshift(new parser.DECasualDateParser());\n option.parsers.unshift(new parser.DEWeekdayParser());\n return option;\n};\n\n\n\n// -------------------------------------------------------------\n\nexports.nl = function(config) {\n return {\n parsers: [\n new parser.NLMonthNameLittleEndianParser(config),\n new parser.NLMonthNameParser(config),\n new parser.NLSlashDateFormatParser(config),\n new parser.NLTimeExpressionParser(config),\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner(),\n new refiner.NLMergeDateTimeRefiner(),\n new refiner.NLMergeDateRangeRefiner()\n ]\n }\n};\n\nexports.nl.casual = function() {\n var option = exports.nl({\n strict: false\n });\n option.parsers.unshift(new parser.NLCasualDateParser());\n option.parsers.unshift(new parser.NLCasualTimeParser());\n option.parsers.unshift(new parser.NLWeekdayParser());\n return option;\n};\n\n\n\n// -------------------------------------------------------------\n\n\nexports.en = function(config) {\n return {\n parsers: [\n new parser.ENISOFormatParser(config),\n new parser.ENDeadlineFormatParser(config),\n new parser.ENMonthNameLittleEndianParser(config),\n new parser.ENMonthNameMiddleEndianParser(config),\n new parser.ENMonthNameParser(config),\n new parser.ENSlashDateFormatParser(config),\n new parser.ENSlashDateFormatStartWithYearParser(config),\n new parser.ENSlashMonthFormatParser(config),\n new parser.ENTimeAgoFormatParser(config),\n new parser.ENTimeLaterFormatParser(config),\n new parser.ENTimeExpressionParser(config)\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner(),\n\n // English\n new refiner.ENMergeDateTimeRefiner(),\n new refiner.ENMergeDateRangeRefiner(),\n new refiner.ENPrioritizeSpecificDateRefiner()\n ]\n }\n};\n\nexports.en.casual = function(config) {\n config = config || {};\n config.strict = false;\n var option = exports.en(config);\n\n // en\n option.parsers.unshift(new parser.ENCasualDateParser());\n option.parsers.unshift(new parser.ENCasualTimeParser());\n option.parsers.unshift(new parser.ENWeekdayParser());\n option.parsers.unshift(new parser.ENRelativeDateFormatParser());\n return option;\n};\n\n\nexports.en_GB = function(config) {\n config = config || {};\n config.littleEndian = true;\n return exports.en(config);\n}\n\nexports.en_GB.casual = function(config) {\n config = config || {};\n config.littleEndian = true;\n return exports.en.casual(config);\n}\n\n// -------------------------------------------------------------\n\nexports.ja = function() {\n return {\n parsers: [\n new parser.JPStandardParser()\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner(),\n new refiner.JPMergeDateRangeRefiner()\n ]\n }\n};\n\nexports.ja.casual = function() {\n var option = exports.ja();\n option.parsers.unshift(new parser.JPCasualDateParser());\n return option;\n};\n\n// -------------------------------------------------------------\n\n\nexports.pt = function(config) {\n return {\n parsers: [\n new parser.PTTimeAgoFormatParser(config),\n new parser.PTDeadlineFormatParser(config),\n new parser.PTTimeExpressionParser(config),\n new parser.PTMonthNameLittleEndianParser(config),\n new parser.PTSlashDateFormatParser(config)\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner()\n ]\n }\n};\n\nexports.pt.casual = function() {\n var option = exports.pt({\n strict: false\n });\n\n option.parsers.unshift(new parser.PTCasualDateParser());\n option.parsers.unshift(new parser.PTWeekdayParser());\n return option;\n};\n\n// -------------------------------------------------------------\n\n\nexports.es = function(config) {\n return {\n parsers: [\n new parser.ESTimeAgoFormatParser(config),\n new parser.ESDeadlineFormatParser(config),\n new parser.ESTimeExpressionParser(config),\n new parser.ESMonthNameLittleEndianParser(config),\n new parser.ESSlashDateFormatParser(config)\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner()\n ]\n }\n};\n\nexports.es.casual = function() {\n var option = exports.es({\n strict: false\n });\n\n option.parsers.unshift(new parser.ESCasualDateParser());\n option.parsers.unshift(new parser.ESWeekdayParser());\n return option;\n};\n\n\n// -------------------------------------------------------------\n\nexports.fr = function(config) {\n return {\n parsers: [\n new parser.FRDeadlineFormatParser(config),\n new parser.FRMonthNameLittleEndianParser(config),\n new parser.FRSlashDateFormatParser(config),\n new parser.FRTimeAgoFormatParser(config),\n new parser.FRTimeExpressionParser(config)\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner(),\n new refiner.FRMergeDateRangeRefiner(),\n new refiner.FRMergeDateTimeRefiner()\n ]\n }\n};\n\nexports.fr.casual = function() {\n var option = exports.fr({\n strict: false\n });\n\n option.parsers.unshift(new parser.FRCasualDateParser());\n option.parsers.unshift(new parser.FRWeekdayParser());\n option.parsers.unshift(new parser.FRRelativeDateFormatParser());\n return option;\n};\n\n\n// -------------------------------------------------------------\n\nexports.zh = function() {\n return {\n parsers: [\n new parser.ZHHantDateParser(),\n new parser.ZHHantWeekdayParser(),\n new parser.ZHHantTimeExpressionParser(),\n new parser.ZHHantCasualDateParser(),\n new parser.ZHHantDeadlineFormatParser()\n ],\n refiners: [\n new refiner.OverlapRemovalRefiner(),\n new refiner.ForwardDateRefiner()\n ]\n }\n};\n","/*\n ISO 8601\n http://www.w3.org/TR/NOTE-datetime\n - YYYY-MM-DD\n - YYYY-MM-DDThh:mmTZD\n - YYYY-MM-DDThh:mm:ssTZD\n - YYYY-MM-DDThh:mm:ss.sTZD \n - TZD = (Z or +hh:mm or -hh:mm)\n*/\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp('(\\\\W|^)' \n + '([0-9]{4})\\\\-([0-9]{1,2})\\\\-([0-9]{1,2})'\n + '(?:T' //..\n + '([0-9]{1,2}):([0-9]{1,2})' // hh:mm\n + '(?::([0-9]{1,2})(?:\\\\.(\\\\d{1,4}))?)?' // :ss.s\n + '(?:Z|([+-]\\\\d{2}):?(\\\\d{2})?)?' // TZD (Z or ±hh:mm or ±hhmm or ±hh)\n + ')?' //..\n + '(?=\\\\W|$)', 'i');\n\nvar YEAR_NUMBER_GROUP = 2;\nvar MONTH_NUMBER_GROUP = 3;\nvar DATE_NUMBER_GROUP = 4;\nvar HOUR_NUMBER_GROUP = 5;\nvar MINUTE_NUMBER_GROUP = 6;\nvar SECOND_NUMBER_GROUP = 7;\nvar MILLISECOND_NUMBER_GROUP = 8;\nvar TZD_HOUR_OFFSET_GROUP = 9;\nvar TZD_MINUTE_OFFSET_GROUP = 10;\n\nexports.Parser = function ENISOFormatParser(){\n Parser.apply(this, arguments);\n \n this.pattern = function() { return PATTERN; }\n \n this.extract = function(text, ref, match, opt){ \n \n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n })\n \n result.start.assign('year', parseInt(match[YEAR_NUMBER_GROUP]));\n result.start.assign('month', parseInt(match[MONTH_NUMBER_GROUP]));\n result.start.assign('day', parseInt(match[DATE_NUMBER_GROUP]));\n\n if (dayjs(result.start.get('month')) > 12 || dayjs(result.start.get('month')) < 1 ||\n dayjs(result.start.get('day')) > 31 || dayjs(result.start.get('day')) < 1) {\n return null;\n }\n\n if (match[HOUR_NUMBER_GROUP] != null) {\n \n result.start.assign('hour',\n parseInt(match[HOUR_NUMBER_GROUP]));\n result.start.assign('minute',\n parseInt(match[MINUTE_NUMBER_GROUP]));\n\n if (match[SECOND_NUMBER_GROUP] != null) {\n\n result.start.assign('second',\n parseInt(match[SECOND_NUMBER_GROUP]));\n }\n\n if (match[MILLISECOND_NUMBER_GROUP] != null) {\n\n result.start.assign('millisecond',\n parseInt(match[MILLISECOND_NUMBER_GROUP]));\n }\n\n if (match[TZD_HOUR_OFFSET_GROUP] == null) {\n\n result.start.assign('timezoneOffset', 0);\n } else {\n\n var minuteOffset = 0;\n var hourOffset = parseInt(match[TZD_HOUR_OFFSET_GROUP]);\n if (match[TZD_MINUTE_OFFSET_GROUP] != null)\n minuteOffset = parseInt(match[TZD_MINUTE_OFFSET_GROUP]);\n\n var offset = hourOffset * 60;\n if (offset < 0) {\n offset -= minuteOffset;\n } else {\n offset += minuteOffset;\n }\n\n result.start.assign('timezoneOffset', offset);\n }\n }\n \n result.tags['ENISOFormatParser'] = true;\n return result;\n };\n\n}\n\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(within|in)\\\\s*' +\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|an?(?:\\\\s*few)?|half(?:\\\\s*an?)?)\\\\s*' +\n '(seconds?|min(?:ute)?s?|hours?|days?|weeks?|months?|years?)\\\\s*' +\n '(?=\\\\W|$)', 'i'\n);\n\nvar STRICT_PATTERN = new RegExp('(\\\\W|^)' +\n '(within|in)\\\\s*' +\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|an?)\\\\s*' +\n '(seconds?|minutes?|hours?|days?)\\\\s*' +\n '(?=\\\\W|$)', 'i'\n);\n\nexports.Parser = function ENDeadlineFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return this.isStrictMode()? STRICT_PATTERN : PATTERN;\n };\n\n this.extract = function(text, ref, match, opt){\n\n var index = match.index + match[1].length;\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var num = match[3].toLowerCase();\n if (util.INTEGER_WORDS[num] !== undefined) {\n num = util.INTEGER_WORDS[num];\n } else if (num === 'a' || num === 'an'){\n num = 1;\n } else if (num.match(/few/i)){\n num = 3;\n } else if (num.match(/half/i)) {\n num = 0.5;\n } else {\n num = parseInt(num);\n }\n\n var date = dayjs(ref);\n if (match[4].match(/day|week|month|year/i)) {\n\n if (match[4].match(/day/i)) {\n date = date.add(num, 'd');\n } else if (match[4].match(/week/i)) {\n date = date.add(num * 7, 'd');\n } else if (match[4].match(/month/i)) {\n date = date.add(num, 'month');\n } else if (match[4].match(/year/i)) {\n date = date.add(num, 'year');\n }\n\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n return result;\n }\n\n if (match[4].match(/hour/i)) {\n\n date = date.add(num, 'hour');\n\n } else if (match[4].match(/min/i)) {\n\n date = date.add(num, 'minute');\n\n } else if (match[4].match(/second/i)) {\n\n date = date.add(num, 'second');\n }\n\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.start.assign('second', date.second());\n result.tags['ENDeadlineFormatParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(this|next|last|past)\\\\s*' +\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|few|half(?:\\\\s*an?)?)?\\\\s*' +\n '(seconds?|min(?:ute)?s?|hours?|days?|weeks?|months?|years?)(?=\\\\s*)' +\n '(?=\\\\W|$)', 'i'\n);\n\nvar MODIFIER_WORD_GROUP = 2;\nvar MULTIPLIER_WORD_GROUP = 3;\nvar RELATIVE_WORD_GROUP = 4;\n\nexports.Parser = function ENRelativeDateFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; };\n\n this.extract = function(text, ref, match, opt){\n\n var index = match.index + match[1].length;\n var modifier = match[MODIFIER_WORD_GROUP].toLowerCase().match(/^next/) ? 1 : -1;\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n result.tags['ENRelativeDateFormatParser'] = true;\n\n var num = match[MULTIPLIER_WORD_GROUP] === undefined ? '' : match[3].toLowerCase();\n if (util.INTEGER_WORDS[num] !== undefined) {\n num = util.INTEGER_WORDS[num];\n } else if (num === ''){\n num = 1;\n } else if (num.match(/few/i)){\n num = 3;\n } else if (num.match(/half/i)) {\n num = 0.5;\n } else {\n num = parseInt(num);\n }\n\n num *= modifier;\n var date = dayjs(ref);\n\n if (match[MODIFIER_WORD_GROUP].toLowerCase().match(/^this/)) {\n\n if (match[MULTIPLIER_WORD_GROUP]) {\n return null;\n }\n\n if (match[RELATIVE_WORD_GROUP].match(/day|week|month|year/i)) {\n \n // This week\n if (match[RELATIVE_WORD_GROUP].match(/week/i)) {\n date = date.add(-date.get('d'), 'd');\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n } \n \n // This month\n else if (match[RELATIVE_WORD_GROUP].match(/month/i)) {\n date = date.add(-date.date() + 1, 'd');\n result.start.imply('day', date.date());\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n } \n\n // This year\n else if (match[RELATIVE_WORD_GROUP].match(/year/i)) {\n date = date.add(-date.date() + 1, 'd');\n date = date.add(-date.month(), 'month');\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.assign('year', date.year());\n } \n\n return result;\n }\n }\n \n if (match[RELATIVE_WORD_GROUP].match(/day|week|month|year/i)) {\n\n if (match[RELATIVE_WORD_GROUP].match(/day/i)) {\n date = date.add(num, 'd');\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n } else if (match[RELATIVE_WORD_GROUP].match(/week/i)) {\n date = date.add(num * 7, 'd');\n // We don't know the exact date for next/last week so we imply\n // them\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n } else if (match[RELATIVE_WORD_GROUP].match(/month/i)) {\n date = date.add(num, 'month');\n // We don't know the exact day for next/last month\n result.start.imply('day', date.date());\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n } else if (match[RELATIVE_WORD_GROUP].match(/year/i)) {\n date = date.add(num, 'year');\n // We don't know the exact day for month on next/last year\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.assign('year', date.year());\n }\n\n return result;\n }\n\n if (match[RELATIVE_WORD_GROUP].match(/hour/i)) {\n\n date = date.add(num, 'hour');\n result.start.imply('minute', date.minute());\n result.start.imply('second', date.second());\n\n } else if (match[RELATIVE_WORD_GROUP].match(/min/i)) {\n\n date = date.add(num, 'minute');\n result.start.assign('minute', date.minute());\n result.start.imply('second', date.second());\n\n } else if (match[RELATIVE_WORD_GROUP].match(/second/i)) {\n\n date = date.add(num, 'second');\n result.start.assign('second', date.second());\n result.start.assign('minute', date.minute());\n }\n\n result.start.assign('hour', date.hour());\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n return result;\n };\n};\n","const parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:on\\\\s*?)?' +\n '(?:(Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sun|Mon|Tue|Wed|Thu|Fri|Sat)\\\\s*,?\\\\s*)?' +\n '(([0-9]{1,2})(?:st|nd|rd|th)?|' + util.ORDINAL_WORDS_PATTERN + ')' +\n '(?:\\\\s*' +\n '(?:to|\\\\-|\\\\–|until|through|till|\\\\s)\\\\s*' +\n '(([0-9]{1,2})(?:st|nd|rd|th)?|' + util.ORDINAL_WORDS_PATTERN + ')' +\n ')?' + \n '(?:-|\\/|\\\\s*(?:of)?\\\\s*)' +\n '(' + util.MONTH_PATTERN + ')' +\n '(?:' +\n '(?:-|\\/|,?\\\\s*)' +\n '((?:' + \n '[1-9][0-9]{0,3}\\\\s*(?:BE|AD|BC)|' +\n '[1-2][0-9]{3}|' +\n '[5-9][0-9]' +\n ')(?![^\\\\s]\\\\d))' +\n ')?' +\n '(?=\\\\W|$)', 'i'\n );\n\nvar WEEKDAY_GROUP = 2;\nvar DATE_GROUP = 3;\nvar DATE_NUM_GROUP = 4;\nvar DATE_TO_GROUP = 5;\nvar DATE_TO_NUM_GROUP = 6;\nvar MONTH_NAME_GROUP = 7;\nvar YEAR_GROUP = 8;\n\nexports.Parser = function ENMonthNameLittleEndianParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref\n });\n\n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n\n var day = match[DATE_NUM_GROUP] ?\n parseInt(match[DATE_NUM_GROUP]):\n util.ORDINAL_WORDS[match[DATE_GROUP].trim().replace('-', ' ').toLowerCase()];\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n \n if (/BE/i.test(year)) {\n // Buddhist Era\n year = year.replace(/BE/i, '');\n year = parseInt(year) - 543;\n } else if (/BC/i.test(year)){\n // Before Christ\n year = year.replace(/BC/i, '');\n year = -parseInt(year);\n } else if (/AD/i.test(year)){\n year = year.replace(/AD/i, '');\n year = parseInt(year);\n } else {\n year = parseInt(year);\n if (year < 100){\n if (year > 50) {\n year = year + 1900;\n } else {\n year = year + 2000;\n }\n }\n }\n }\n\n if(year){\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month);\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n // Weekday component\n if (match[WEEKDAY_GROUP]) {\n var weekday = match[WEEKDAY_GROUP];\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()]\n result.start.assign('weekday', weekday);\n }\n\n // Text can be 'range' value. Such as '12 - 13 January 2012'\n if (match[DATE_TO_GROUP]) {\n var endDate = match[DATE_TO_NUM_GROUP] ?\n parseInt(match[DATE_TO_NUM_GROUP]):\n util.ORDINAL_WORDS[match[DATE_TO_GROUP].trim().replace('-', ' ').toLowerCase()];\n\n result.end = result.start.clone();\n result.end.assign('day', endDate);\n }\n\n result.tags['ENMonthNameLittleEndianParser'] = true;\n return result;\n };\n};\n","/*\n\n The parser for parsing US's date format that begin with month's name.\n\n EX.\n - January 13\n - January 13, 2012\n - January 13 - 15, 2012\n - Tuesday, January 13, 2012\n\n Watch out for:\n - January 12:00\n - January 12.44\n - January 1222344\n*/\nvar parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:' +\n '(?:on\\\\s*?)?' +\n '(Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sun\\\\.?|Mon\\\\.?|Tue\\\\.?|Wed\\\\.?|Thu\\\\.?|Fri\\\\.?|Sat\\\\.?)' +\n '\\\\s*,?\\\\s*)?' +\n '(' + util.MONTH_PATTERN + ')' +\n '(?:-|\\/|\\\\s*,?\\\\s*)' +\n '(([0-9]{1,2})(?:st|nd|rd|th)?|' + util.ORDINAL_WORDS_PATTERN +')(?!\\\\s*(?:am|pm))\\\\s*' + '' + \n '(?:' +\n '(?:to|\\\\-)\\\\s*' +\n '(([0-9]{1,2})(?:st|nd|rd|th)?| ' + util.ORDINAL_WORDS_PATTERN + ')\\\\s*' +\n ')?' +\n '(?:' +\n '(?:-|\\/|\\\\s*,?\\\\s*)' +\n '(?:([0-9]{4})\\\\s*(BE|AD|BC)?|([0-9]{1,4})\\\\s*(AD|BC))\\\\s*' +\n ')?' +\n '(?=\\\\W|$)(?!\\\\:\\\\d)', 'i');\n\nvar WEEKDAY_GROUP = 2;\nvar MONTH_NAME_GROUP = 3;\nvar DATE_GROUP = 4;\nvar DATE_NUM_GROUP = 5;\nvar DATE_TO_GROUP = 6;\nvar DATE_TO_NUM_GROUP = 7;\nvar YEAR_GROUP = 8;\nvar YEAR_BE_GROUP = 9;\nvar YEAR_GROUP2 = 10;\nvar YEAR_BE_GROUP2 = 11;\n\nexports.Parser = function ENMonthNameMiddleEndianParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n\n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n var day = match[DATE_NUM_GROUP] ?\n parseInt(match[DATE_NUM_GROUP]) :\n util.ORDINAL_WORDS[match[DATE_GROUP].trim().replace('-', ' ').toLowerCase()];\n\n var year = null;\n if (match[YEAR_GROUP] || match[YEAR_GROUP2]) {\n year = match[YEAR_GROUP] || match[YEAR_GROUP2];\n year = parseInt(year);\n\n var yearBE = match[YEAR_BE_GROUP] || match[YEAR_BE_GROUP2];\n if (yearBE) {\n if (/BE/i.test(yearBE)) {\n // Buddhist Era\n year = year - 543;\n } else if (/BC/i.test(yearBE)) {\n // Before Christ\n year = -year;\n }\n } else if (year < 100){\n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month)\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n // Weekday component\n if (match[WEEKDAY_GROUP]) {\n var weekday = match[WEEKDAY_GROUP];\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()]\n result.start.assign('weekday', weekday);\n }\n\n // Text can be 'range' value. Such as 'January 12 - 13, 2012'\n if (match[DATE_TO_GROUP]) {\n var endDate = match[DATE_TO_NUM_GROUP] ?\n endDate = parseInt(match[DATE_TO_NUM_GROUP]) :\n util.ORDINAL_WORDS[match[DATE_TO_GROUP].replace('-', ' ').trim().toLowerCase()];\n\n result.end = result.start.clone();\n result.end.assign('day', endDate);\n }\n\n result.tags['ENMonthNameMiddleEndianParser'] = true;\n return result;\n }\n};","/*\n \n The parser for parsing month name and year.\n \n EX. \n - January\n - January 2012\n - January, 2012\n*/\nvar parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('(^|\\\\D\\\\s+|[^\\\\w\\\\s])' +\n '('+ util.MONTH_PATTERN +')' + \n '\\\\s*' +\n '(?:' +\n '[,-]?\\\\s*([0-9]{4})(\\\\s*BE|AD|BC)?' +\n ')?' +\n '(?=[^\\\\s\\\\w]|\\\\s+[^0-9]|\\\\s+$|$)', 'i');\n\nvar MONTH_NAME_GROUP = 2;\nvar YEAR_GROUP = 3;\nvar YEAR_BE_GROUP = 4;\n\nexports.Parser = function ENMonthNameParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n \n this.extract = function(text, ref, match, opt){\n const result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n const day = 1;\n const monthName = match[MONTH_NAME_GROUP];\n const month = util.MONTH_OFFSET[monthName.toLowerCase()];\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n year = parseInt(year);\n\n if(match[YEAR_BE_GROUP]){\n if (match[YEAR_BE_GROUP].match(/BE/)) {\n // Buddhist Era\n year = year - 543;\n } else if (match[YEAR_BE_GROUP].match(/BC/)) {\n // Before Christ\n year = -year;\n }\n\n } else if (year < 100){ \n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month)\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n if (result.text.match(/^\\w{3}$/)) {\n return false;\n }\n\n result.tags['ENMonthNameParser'] = true;\n return result;\n }\n}\n","/*\n Date format with slash \"/\" (also \"-\" and \".\") between numbers\n - Tuesday 11/3/2015 \n - 11/3/2015\n - 11/3\n\n By default the paser us \"middle-endien\" format (US English),\n then fallback to little-endian if failed.\n - 11/3/2015 = November 3rd, 2015\n - 23/4/2015 = April 23th, 2015\n\n If \"littleEndian\" config is set, the parser will try the little-endian first. \n - 11/3/2015 = March 11th, 2015\n*/\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:' +\n '(?:on\\\\s*?)?' +\n '((?:sun|mon|tues?|wed(?:nes)?|thu(?:rs?)?|fri|sat(?:ur)?)(?:day)?)' +\n '\\\\s*\\\\,?\\\\s*' +\n ')?' +\n '([0-3]{0,1}[0-9]{1})[\\\\/\\\\.\\\\-]([0-3]{0,1}[0-9]{1})' +\n '(?:' +\n '[\\\\/\\\\.\\\\-]' +\n '([0-9]{4}\\s*\\,?\\s*|[0-9]{2}\\s*\\,?\\s*)' +\n ')?' +\n '(\\\\W|$)', 'i');\n\nvar DAYS_OFFSET = { 'sunday': 0, 'sun': 0, 'monday': 1, 'mon': 1,'tuesday': 2, 'wednesday': 3, 'wed': 3,\n 'thursday': 4, 'thur': 4,'friday': 5, 'fri': 5,'saturday': 6, 'sat': 6,}\n\n\nvar OPENNING_GROUP = 1;\nvar ENDING_GROUP = 6;\n\nvar WEEKDAY_GROUP = 2;\n\n\nvar FIRST_NUMBERS_GROUP = 3;\nvar SECOND_NUMBERS_GROUP = 4;\n\nvar YEAR_GROUP = 5;\n\nexports.Parser = function ENSlashDateFormatParser(config) {\n Parser.apply(this, arguments);\n config = config || {};\n var littleEndian = config.littleEndian;\n var MONTH_GROUP = littleEndian ? SECOND_NUMBERS_GROUP : FIRST_NUMBERS_GROUP;\n var DAY_GROUP = littleEndian ? FIRST_NUMBERS_GROUP : SECOND_NUMBERS_GROUP;\n\n this.pattern = function () { return PATTERN; };\n this.extract = function(text, ref, match, opt){\n\n if(match[OPENNING_GROUP] == '/' || match[ENDING_GROUP] == '/') {\n // Long skip, if there is some overlapping like:\n // XX[/YY/ZZ]\n // [XX/YY/]ZZ\n match.index += match[0].length\n return;\n }\n\n var index = match.index + match[OPENNING_GROUP].length;\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length - match[ENDING_GROUP].length);\n\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n });\n\n if(text.match(/^\\d\\.\\d$/)) return;\n if(text.match(/^\\d\\.\\d{1,2}\\.\\d{1,2}$/)) return;\n\n // MM/dd -> OK\n // MM.dd -> NG\n if(!match[YEAR_GROUP] && match[0].indexOf('/') < 0) return;\n\n var date = null;\n var year = match[YEAR_GROUP] || dayjs(ref).year() + '';\n var month = match[MONTH_GROUP];\n var day = match[DAY_GROUP];\n\n month = parseInt(month);\n day = parseInt(day);\n year = parseInt(year);\n\n if(month < 1 || month > 12) {\n if(month > 12) {\n // dd/mm/yyyy date format if day looks like a month, and month\n // looks like a day.\n if (day >= 1 && day <= 12 && month >= 13 && month <= 31) {\n // unambiguous\n var tday = month;\n month = day;\n day = tday;\n }\n else {\n // both month and day are <= 12\n return null;\n }\n }\n }\n if(day < 1 || day > 31) return null;\n\n if(year < 100){\n if (year > 50) {\n year = year + 1900;\n } else {\n year = year + 2000;\n }\n }\n\n result.start.assign('day', day);\n result.start.assign('month', month);\n if (match[YEAR_GROUP]) {\n result.start.assign('year', year);\n } else {\n result.start.imply('year', year);\n }\n\n //Day of week\n if(match[WEEKDAY_GROUP]) {\n result.start.assign('weekday', DAYS_OFFSET[match[WEEKDAY_GROUP].toLowerCase()]);\n }\n\n result.tags['ENSlashDateFormatParser'] = true;\n return result;\n };\n};\n","/*\n Date format with slash \"/\" between numbers like ENSlashDateFormatParser,\n but this parser expect year before month and date. \n - YYYY/MM/DD\n - YYYY-MM-DD\n - YYYY.MM.DD\n*/\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('(\\\\W|^)' \n + '([0-9]{4})[\\\\-\\\\.\\\\/]'\n + '((?:' + util.MONTH_PATTERN + '|[0-9]{1,2}))[\\\\-\\\\.\\\\/]'\n + '([0-9]{1,2})'\n + '(?=\\\\W|$)', 'i');\n\nvar YEAR_NUMBER_GROUP = 2;\nvar MONTH_NUMBER_GROUP = 3;\nvar DATE_NUMBER_GROUP = 4;\n\nexports.Parser = function ENSlashDateFormatStartWithYearParser(){\n Parser.apply(this, arguments);\n \n this.pattern = function() { return PATTERN; }\n \n this.extract = function(text, ref, match, opt){\n\n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n })\n \n var month = match[MONTH_NUMBER_GROUP].toLowerCase();\n month = util.MONTH_OFFSET[month] | month;\n\n result.start.assign('year', parseInt(match[YEAR_NUMBER_GROUP]));\n result.start.assign('month', parseInt(month));\n result.start.assign('day', parseInt(match[DATE_NUMBER_GROUP]));\n\n if (\n dayjs(result.start.get('month')) > 12 || dayjs(result.start.get('month')) < 1 || \n dayjs(result.start.get('day')) > 31 || dayjs(result.start.get('day')) < 1) {\n return null;\n }\n \n result.tags['ENDateFormatParser'] = true;\n return result;\n };\n}\n","/*\n Month/Year date format with slash \"/\" (also \"-\" and \".\") between numbers \n - 11/05\n - 06/2005\n*/\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp('(^|[^\\\\d/]\\\\s+|[^\\\\w\\\\s])' +\n '([0-9]|0[1-9]|1[012])/([0-9]{4})' + \n '(?=[^\\\\d/]|$)', 'i');\n\nvar OPENNING_GROUP = 1;\n\nvar MONTH_GROUP = 2;\nvar YEAR_GROUP = 3;\n\nexports.Parser = function ENSlashMonthFormatParser(argument) {\n Parser.apply(this, arguments);\n\n this.pattern = function () { return PATTERN; };\n this.extract = function(text, ref, match, opt){\n \n var index = match.index + match[OPENNING_GROUP].length;\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length).trim();\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n });\n\n var year = match[YEAR_GROUP] ;\n var month = match[MONTH_GROUP];\n var day = 1;\n \n month = parseInt(month);\n year = parseInt(year);\n\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n\n result.tags['ENSlashMonthFormatParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('' +\n '(\\\\W|^)' +\n '(?:within\\\\s*)?' +\n '(' + util.TIME_UNIT_PATTERN + ')' +\n '(?:ago|before|earlier)(?=(?:\\\\W|$))', 'i');\n\nvar STRICT_PATTERN = new RegExp('' +\n '(\\\\W|^)' +\n '(?:within\\\\s*)?' +\n '(' + util.TIME_UNIT_STRICT_PATTERN + ')' +\n 'ago(?=(?:\\\\W|$))', 'i');\n\nexports.Parser = function ENTimeAgoFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return this.isStrictMode()? STRICT_PATTERN : PATTERN;\n };\n\n this.extract = function(text, ref, match, opt){\n\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n var index = match.index + match[1].length;\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var fragments = util.extractDateTimeUnitFragments(match[2]);\n var date = dayjs(ref);\n\n for (var key in fragments) {\n date = date.add(-fragments[key], key);\n }\n\n if (fragments['hour'] > 0 || fragments['minute'] > 0 || fragments['second'] > 0) {\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.start.assign('second', date.second());\n result.tags['ENTimeAgoFormatParser'] = true;\n } \n \n if (fragments['d'] > 0 || fragments['month'] > 0 || fragments['year'] > 0) {\n result.start.assign('day', date.date());\n result.start.assign('month', date.month() + 1);\n result.start.assign('year', date.year());\n } else {\n if (fragments['week'] > 0) {\n result.start.imply('weekday', date.day());\n }\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n }\n\n return result;\n };\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar ParsedComponents = require('../../result').ParsedComponents;\n\nvar FIRST_REG_PATTERN = new RegExp(\"(^|\\\\s|T)\" +\n \"(?:(?:at|from)\\\\s*)??\" + \n \"(\\\\d{1,4}|noon|midnight)\" + \n \"(?:\" + \n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" + \n \"(?:\" + \n \"(?:\\\\:|\\\\:)(\\\\d{2})(?:\\\\.(\\\\d{1,6}))?\" + \n \")?\" + \n \")?\" + \n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?|O\\\\W*CLOCK))?\" + \n \"(?=\\\\W|$)\", 'i');\n\n\nvar SECOND_REG_PATTERN = new RegExp(\"^\\\\s*\" + \n \"(\\\\-|\\\\–|\\\\~|\\\\〜|to|\\\\?)\\\\s*\" + \n \"(\\\\d{1,4})\" +\n \"(?:\" + \n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" + \n \"(?:\" + \n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})(?:\\\\.(\\\\d{1,6}))?\" + \n \")?\" + \n \")?\" + \n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?|O\\\\W*CLOCK))?\" + \n \"(?=\\\\W|$)\", 'i');\n\nvar HOUR_GROUP = 2;\nvar MINUTE_GROUP = 3;\nvar SECOND_GROUP = 4;\nvar MILLI_SECOND_GROUP = 5;\nvar AM_PM_HOUR_GROUP = 6;\n\n\nexports.Parser = function ENTimeExpressionParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return FIRST_REG_PATTERN; }\n \n this.extract = function(text, ref, match, opt){ \n \n // This pattern can be overlapped Ex. [12] AM, 1[2] AM\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n var refMoment = dayjs(ref);\n var result = new ParsedResult();\n result.ref = ref;\n result.index = match.index + match[1].length;\n result.text = match[0].substring(match[1].length);\n result.tags['ENTimeExpressionParser'] = true;\n\n result.start.imply('day', refMoment.date());\n result.start.imply('month', refMoment.month()+1);\n result.start.imply('year', refMoment.year());\n \n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Millisecond\n if(match[MILLI_SECOND_GROUP] != null){ \n var millisecond = parseInt(match[MILLI_SECOND_GROUP].substring(0, 3));\n if(millisecond >= 1000) return null;\n \n result.start.assign('millisecond', millisecond);\n }\n\n // ----- Second\n if(match[SECOND_GROUP] != null){ \n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.start.assign('second', second);\n }\n \n // ----- Hours\n if (match[HOUR_GROUP].toLowerCase() == \"noon\"){\n meridiem = 1; \n hour = 12;\n } else if (match[HOUR_GROUP].toLowerCase() == \"midnight\") {\n meridiem = 0; \n hour = 0;\n } else {\n hour = parseInt(match[HOUR_GROUP]);\n }\n \n // ----- Minutes\n if(match[MINUTE_GROUP] != null){ \n minute = parseInt(match[MINUTE_GROUP]);\n } else if(hour > 100) { \n minute = hour%100;\n hour = parseInt(hour/100);\n } \n \n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) { \n meridiem = 1;\n }\n\n // ----- AM & PM \n if(match[AM_PM_HOUR_GROUP] != null) {\n if(hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if(ampm == \"a\"){\n meridiem = 0; \n if(hour == 12) hour = 0;\n }\n \n if(ampm == \"p\"){\n meridiem = 1; \n if(hour != 12) hour += 12;\n }\n } \n\n result.start.assign('hour', hour);\n result.start.assign('minute', minute);\n\n if (meridiem >= 0) {\n result.start.assign('meridiem', meridiem);\n } else {\n if (hour < 12) {\n result.start.imply('meridiem', 0);\n } else {\n result.start.imply('meridiem', 1);\n }\n }\n\n // ==============================================================\n // Extracting the 'to' chunk\n // ==============================================================\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n return result;\n }\n\n\n\n // Pattern \"YY.YY -XXXX\" is more like timezone offset\n if (match[0].match(/^\\s*(\\+|\\-)\\s*\\d{3,4}$/)) {\n return result;\n }\n\n if(result.end == null){\n result.end = new ParsedComponents(null, result.start.date());\n }\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Millisecond\n if(match[MILLI_SECOND_GROUP] != null){ \n var millisecond = parseInt(match[MILLI_SECOND_GROUP].substring(0, 3));\n if(millisecond >= 1000) return null;\n \n result.end.assign('millisecond', millisecond);\n }\n \n // ----- Second\n if(match[SECOND_GROUP] != null){ \n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.end.assign('second', second);\n }\n\n hour = parseInt(match[2]);\n \n // ----- Minute\n if (match[MINUTE_GROUP]!= null) {\n \n minute = parseInt(match[MINUTE_GROUP]);\n if(minute >= 60) return result;\n \n } else if (hour > 100) {\n\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) { \n meridiem = 1;\n }\n \n // ----- AM & PM \n if (match[AM_PM_HOUR_GROUP] != null){\n\n if (hour > 12) return null;\n\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if(ampm == \"a\"){\n meridiem = 0; \n if(hour == 12) {\n hour = 0;\n if (!result.end.isCertain('day')) {\n result.end.imply('day', result.end.get('day') + 1);\n }\n }\n }\n \n if(ampm == \"p\"){\n meridiem = 1; \n if(hour != 12) hour += 12;\n }\n \n if (!result.start.isCertain('meridiem')) {\n if (meridiem == 0) {\n \n result.start.imply('meridiem', 0);\n \n if (result.start.get('hour') == 12) {\n result.start.assign('hour', 0);\n }\n\n } else {\n\n result.start.imply('meridiem', 1);\n \n if (result.start.get('hour') != 12) {\n result.start.assign('hour', result.start.get('hour') + 12); \n }\n }\n }\n }\n\n result.text = result.text + match[0];\n result.end.assign('hour', hour);\n result.end.assign('minute', minute);\n if (meridiem >= 0) {\n result.end.assign('meridiem', meridiem);\n } else {\n var startAtPM = result.start.isCertain('meridiem') && result.start.get('meridiem') == 1;\n if (startAtPM && result.start.get('hour') > hour) {\n // 10pm - 1 (am)\n result.end.imply('meridiem', 0);\n\n } else if (hour > 12) {\n result.end.imply('meridiem', 1);\n }\n }\n\n if (result.end.date().getTime() < result.start.date().getTime()) {\n result.end.imply('day', result.end.get('day') + 1)\n }\n \n return result;\n }\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/EN');\n\nvar PATTERN = new RegExp('' +\n /*match[1]*/ '(\\\\W|^)' +\n /*match[2]*/ '(in )?' +\n /*match[3]*/ '(' + util.TIME_UNIT_PATTERN + ')' +\n /*match[4]*/ '(later|after|from now|henceforth|forward|out)?' +\n /*match[5]*/ '(?=(?:\\\\W|$))',\n'i');\n\nvar STRICT_PATTERN = new RegExp('' +\n /*match[1]*/ '(\\\\W|^)' +\n /*match[2]*/ '(in )?' +\n /*match[3]*/ '(' + util.TIME_UNIT_STRICT_PATTERN + ')' +\n /*match[4]*/ '(later|from now)?' +\n /*match[5]*/ '(?=(?:\\\\W|$))',\n'i');\n\nexports.Parser = function ENTimeLaterFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return this.isStrictMode()? STRICT_PATTERN : PATTERN;\n };\n\n this.extract = function(text, ref, match, opt){\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n\n var prefix = match[2];\n var suffix = match[4];\n if (!prefix && !suffix) return null;\n\n var preamble = match[1];\n var text = match[0].substr(preamble.length, match[0].length - preamble.length);\n var index = match.index + preamble.length;\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var fragments = util.extractDateTimeUnitFragments(match[3]);\n var date = dayjs(ref);\n for (var key in fragments) {\n date = date.add(fragments[key], key);\n }\n\n if (fragments['hour'] > 0 || fragments['minute'] > 0 || fragments['second'] > 0) {\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.start.assign('second', date.second());\n result.tags['ENTimeAgoFormatParser'] = true;\n } \n \n if (fragments['d'] > 0 || fragments['month'] > 0 || fragments['year'] > 0) {\n result.start.assign('day', date.date());\n result.start.assign('month', date.month() + 1);\n result.start.assign('year', date.year());\n } else {\n if (fragments['week'] > 0) {\n result.start.imply('weekday', date.day());\n }\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n }\n\n return result;\n };\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)(now|today|tonight|last\\s*night|(?:tomorrow|tmr|yesterday)\\s*|tomorrow|tmr|yesterday)(?=\\W|$)/i;\n\nexports.Parser = function ENCasualDateParser(){\n\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var refMoment = dayjs(ref);\n var startMoment = refMoment;\n var lowerText = text.toLowerCase();\n\n if(lowerText == 'tonight'){\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n\n } else if (/^tomorrow|^tmr/.test(lowerText)) {\n\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n\n } else if (/^yesterday/.test(lowerText)) {\n\n startMoment = startMoment.add(-1, 'day');\n\n } else if(lowerText.match(/last\\s*night/)) {\n\n result.start.imply('hour', 0);\n if (refMoment.hour() > 6) {\n startMoment = startMoment.add(-1, 'day');\n }\n\n } else if (lowerText.match(\"now\")) {\n\n result.start.assign('hour', refMoment.hour());\n result.start.assign('minute', refMoment.minute());\n result.start.assign('second', refMoment.second());\n result.start.assign('millisecond', refMoment.millisecond());\n\n }\n\n result.start.assign('day', startMoment.date())\n result.start.assign('month', startMoment.month() + 1)\n result.start.assign('year', startMoment.year())\n result.tags['ENCasualDateParser'] = true;\n return result;\n }\n}\n","var Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)((this)?\\s*(morning|afternoon|evening|noon|night))/i;\n\nvar TIME_MATCH = 4;\n\nexports.Parser = function ENCasualTimeParser(){\n\n Parser.apply(this, arguments);\n\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n if(!match[TIME_MATCH]) TIME_MATCH = 3;\n \n switch (match[TIME_MATCH].toLowerCase()) {\n\n case 'afternoon':\n result.start.imply('meridiem', 1);\n result.start.imply('hour', 15);\n break;\n\n case 'evening':\n case 'night':\n result.start.imply('meridiem', 1);\n result.start.imply('hour', 20);\n break;\n\n case 'morning':\n result.start.imply('meridiem', 0);\n result.start.imply('hour', 6);\n break;\n\n case 'noon':\n result.start.imply('meridiem', 0);\n result.start.imply('hour', 12);\n break;\n }\n \n result.tags['ENCasualTimeParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nconst parser = require('../parser');\nconst ParsedResult = require('../../result').ParsedResult;\n\nconst util = require('../../utils/JP'); \n\nconst PATTERN = /(?:(同|今|本|((昭和|平成|令和)?([0-90-9]{1,4}|元)))年\\s*)?([0-90-9]{1,2})月\\s*([0-90-9]{1,2})日/i;\nconst SPECIAL_YEAR_GROUP = 1;\nconst TYPICAL_YEAR_GROUP = 2;\nconst ERA_GROUP = 3;\nconst YEAR_NUMBER_GROUP = 4;\nconst MONTH_GROUP = 5;\nconst DAY_GROUP = 6;\n\nexports.Parser = function JPStandardParser(){\n parser.Parser.apply(this, arguments);\n \n this.pattern = function() { return PATTERN; }\n \n this.extract = function(text, ref, match, opt){ \n var result = new ParsedResult({\n text: match[0],\n index: match.index,\n ref: ref,\n });\n \n var month = match[MONTH_GROUP];\n month = util.toHankaku(month);\n month = parseInt(month);\n\n var day = match[DAY_GROUP];\n day = util.toHankaku(day);\n day = parseInt(day);\n\n result.start.assign('day', day);\n result.start.assign('month', month);\n \n if (match[TYPICAL_YEAR_GROUP]) {\n\n var year = match[YEAR_NUMBER_GROUP];\n if (year == '元') {\n year = 1;\n } else {\n year = util.toHankaku(year);\n year = parseInt(year);\n }\n\n if (match[ERA_GROUP] == '令和') {\n year += 2018;\n } else if (match[ERA_GROUP] == '平成') {\n year += 1988;\n } else if (match[ERA_GROUP] == '昭和') {\n year += 1925;\n }\n\n result.start.assign('year', year);\n\n } else if (match[SPECIAL_YEAR_GROUP] && match[SPECIAL_YEAR_GROUP].match('同|今|本')) {\n const moment = dayjs(ref)\n result.start.assign('year', moment.year());\n } else {\n const year = parser.findYearClosestToRef(ref, day, month);\n result.start.imply('year', year);\n }\n \n result.tags['JPStandardParser'] = true;\n return result;\n };\n\n}\n\n","\n\n/**\n * to-hankaku.js\n * convert to ascii code strings.\n *\n * @version 1.0.1\n * @author think49\n * @url https://gist.github.com/964592\n * @license http://www.opensource.org/licenses/mit-license.php (The MIT License)\n */\n \nexports.toHankaku = (function (String, fromCharCode) {\n \n function toHankaku (string) {\n return String(string).replace(/\\u2019/g, '\\u0027').replace(/\\u201D/g, '\\u0022').replace(/\\u3000/g, '\\u0020').replace(/\\uFFE5/g, '\\u00A5').replace(/[\\uFF01\\uFF03-\\uFF06\\uFF08\\uFF09\\uFF0C-\\uFF19\\uFF1C-\\uFF1F\\uFF21-\\uFF3B\\uFF3D\\uFF3F\\uFF41-\\uFF5B\\uFF5D\\uFF5E]/g, alphaNum);\n }\n \n function alphaNum (token) {\n return fromCharCode(token.charCodeAt(0) - 65248);\n }\n \n return toHankaku;\n})(String, String.fromCharCode);\n\n/**\n * to-zenkaku.js\n * convert to multi byte strings.\n *\n * @version 1.0.2\n * @author think49\n * @url https://gist.github.com/964592\n * @license http://www.opensource.org/licenses/mit-license.php (The MIT License)\n */\nexports.toZenkaku = (function (String, fromCharCode) {\n \n function toZenkaku (string) {\n return String(string).replace(/\\u0020/g, '\\u3000').replace(/\\u0022/g, '\\u201D').replace(/\\u0027/g, '\\u2019').replace(/\\u00A5/g, '\\uFFE5').replace(/[!#-&(),-9\\u003C-?A-[\\u005D_a-{}~]/g, alphaNum);\n }\n \n function alphaNum (token) {\n return fromCharCode(token.charCodeAt(0) + 65248);\n }\n \n return toZenkaku;\n})(String, String.fromCharCode);","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /今日|当日|昨日|明日|今夜|今夕|今晩|今朝/i;\n\nexports.Parser = function JPCasualDateParser(){\n \n Parser.apply(this, arguments);\n \n this.pattern = function() { return PATTERN; }\n \n this.extract = function(text, ref, match, opt){ \n \n var index = match.index;\n var text = match[0];\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var refMoment = dayjs(ref);\n var startMoment = refMoment;\n\n if(text == '今夜' || text == '今夕' || text == '今晩'){\n // Normally means this coming midnight \n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n\n } else if(text == '明日'){\n\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 4) {\n startMoment = startMoment.add(1, 'day');\n }\n\n } else if(text == '昨日') {\n\n startMoment = startMoment.add(-1, 'day');\n\n } else if (text.match(\"今朝\")) {\n\n result.start.imply('hour', 6);\n result.start.imply('meridiem', 0);\n }\n\n result.start.assign('day', startMoment.date())\n result.start.assign('month', startMoment.month() + 1)\n result.start.assign('year', startMoment.year())\n result.tags['JPCasualDateParser'] = true;\n return result;\n }\n}\n\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\n/*\n Valid patterns:\n - esta manhã -> today in the morning\n - esta tarde -> today in the afternoon/evening\n - esta noite -> tonight\n - ontem de -> yesterday in the morning\n - ontem a tarde -> yesterday in the afternoon/evening\n - ontem a noite -> yesterday at night\n - amanhã de manhã -> tomorrow in the morning\n - amanhã a tarde -> tomorrow in the afternoon/evening\n - amanhã a noite -> tomorrow at night\n - hoje -> today\n - ontem -> yesterday\n - amanhã -> tomorrow\n */\nvar PATTERN = /(\\W|^)(agora|esta\\s*(manhã|tarde|noite)|(ontem|amanhã)\\s*(de|à)\\s*(manhã|tarde|noite)|hoje|amanhã|ontem|noite)(?=\\W|$)/i;\n\nexports.Parser = function PTCasualDateParser(){\n\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var refMoment = dayjs(ref);\n var startMoment = refMoment;\n var lowerText = text.toLowerCase().replace(/\\s+/g, ' ');\n\n if(lowerText == 'amanhã'){\n\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n\n } else if(lowerText == 'ontem') {\n\n startMoment = startMoment.add(-1, 'day');\n }\n else if(lowerText == 'noite') {\n\n result.start.imply('hour', 0);\n if (refMoment.hour() > 6) {\n startMoment = startMoment.add(-1, 'day');\n }\n\n } else if (lowerText.match(\"esta\")) {\n\n var secondMatch = match[3].toLowerCase();\n if (secondMatch == \"tarde\") {\n\n result.start.imply('hour', 18);\n\n } else if (secondMatch == \"manhã\") {\n\n result.start.imply('hour', 6);\n\n } else if (secondMatch == \"noite\") {\n\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n\n }\n } else if (lowerText.match(/de|à/)) {\n\n var firstMatch = match[4].toLowerCase();\n if (firstMatch === 'ontem') {\n\n startMoment = startMoment.add(-1, 'day');\n\n } else if (firstMatch === 'amanhã') {\n\n startMoment = startMoment.add(1, 'day');\n\n }\n\n var secondMatch = match[6].toLowerCase();\n if (secondMatch == \"tarde\") {\n\n result.start.imply('hour', 18);\n\n } else if (secondMatch == \"manhã\") {\n\n result.start.imply('hour', 9);\n\n } else if (secondMatch == \"noite\") {\n\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n\n }\n\n } else if (lowerText.match(\"agora\")) {\n\n result.start.imply('hour', refMoment.hour());\n result.start.imply('minute', refMoment.minute());\n result.start.imply('second', refMoment.second());\n result.start.imply('millisecond', refMoment.millisecond());\n\n }\n\n result.start.assign('day', startMoment.date())\n result.start.assign('month', startMoment.month() + 1)\n result.start.assign('year', startMoment.year())\n result.tags['PTCasualDateParser'] = true;\n return result;\n }\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)(dentro\\s*de|em|em*até)\\s*([0-9]+|mei[oa]|uma?)\\s*(minutos?|horas?|dias?)\\s*(?=(?:\\W|$))/i;\n\nexports.Parser = function PTDeadlineFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var index = match.index + match[1].length;\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var num = parseInt(match[3]);\n if (isNaN(num)) {\n if (match[3].match(/(meio|meia)/)) {\n num = 0.5;\n } else {\n num = 1;\n }\n }\n\n var date = dayjs(ref);\n if (match[4].match(/dia/)) {\n date = date.add(num, 'd');\n\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n return result;\n }\n\n\n if (match[4].match(/hora/)) {\n\n date = date.add(num, 'hour');\n\n } else if (match[4].match(/minuto/)) {\n\n date = date.add(num, 'minute');\n }\n\n result.start.imply('year', date.year());\n result.start.imply('month', date.month() + 1);\n result.start.imply('day', date.date());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.tags['PTDeadlineFormatParser'] = true;\n return result;\n };\n}\n","var parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar util = require('../../utils/PT');\n\nvar DAYS_OFFSET = util.WEEKDAY_OFFSET;\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:(domingo|segunda|segunda-feira|terça|terça-feira|quarta|quarta-feira|quinta|quinta-feira|sexta|sexta-feira|sábado|sabado|dom|seg|ter|qua|qui|sex|sab)\\\\s*,?\\\\s*)?' +\n '([0-9]{1,2})(?:º|ª|°)?' +\n '(?:\\\\s*(?:desde|de|\\\\-|\\\\–|ao?|\\\\s)\\\\s*([0-9]{1,2})(?:º|ª|°)?)?\\\\s*(?:de)?\\\\s*' +\n '(Jan(?:eiro|\\\\.)?|Fev(?:ereiro|\\\\.)?|Mar(?:ço|\\\\.)?|Abr(?:il|\\\\.)?|Mai(?:o|\\\\.)?|Jun(?:ho|\\\\.)?|Jul(?:ho|\\\\.)?|Ago(?:sto|\\\\.)?|Set(?:embro|\\\\.)?|Out(?:ubro|\\\\.)?|Nov(?:embro|\\\\.)?|Dez(?:embro|\\\\.)?)' +\n '(?:\\\\s*(?:de?)?(\\\\s*[0-9]{1,4}(?![^\\\\s]\\\\d))(\\\\s*[ad]\\\\.?\\\\s*c\\\\.?|a\\\\.?\\\\s*d\\\\.?)?)?' +\n '(?=\\\\W|$)', 'i'\n );\n\nvar WEEKDAY_GROUP = 2;\nvar DATE_GROUP = 3;\nvar DATE_TO_GROUP = 4;\nvar MONTH_NAME_GROUP = 5;\nvar YEAR_GROUP = 6;\nvar YEAR_BE_GROUP = 7;\n\nexports.Parser = function PTMonthNameLittleEndianParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n\n var day = match[DATE_GROUP];\n day = parseInt(day);\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n year = parseInt(year);\n\n if(match[YEAR_BE_GROUP]){\n if (/a\\.?\\s*c\\.?/i.test(match[YEAR_BE_GROUP])) {\n // antes de Cristo\n year = -year;\n }\n } else if (year < 100){\n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month);\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n // Weekday component\n if (match[WEEKDAY_GROUP]) {\n var weekday = match[WEEKDAY_GROUP];\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()]\n result.start.assign('weekday', weekday);\n }\n\n // Text can be 'range' value. Such as '12 - 13 January 2012'\n if (match[DATE_TO_GROUP]) {\n result.end = result.start.clone();\n result.end.assign('day', parseInt(match[DATE_TO_GROUP]));\n }\n\n result.tags['PTMonthNameLittleEndianParser'] = true;\n return result;\n };\n}\n","exports.WEEKDAY_OFFSET = {\n 'domingo': 0,\n 'dom': 0,\n 'segunda': 1,\n 'segunda-feira': 1,\n 'seg': 1,\n 'terça': 2,\n 'terca': 2,\n 'terça-feira': 2,\n 'terca-feira': 2,\n 'ter':2,\n 'quarta': 3,\n 'quarta-feira': 3,\n 'qua': 3,\n 'quinta': 4,\n 'quinta-feira': 4,\n 'qui': 4,\n 'sexta': 5,\n 'sexta-feira': 5,\n 'sex': 5,\n 'sábado': 6,\n 'sabado': 6,\n 'sab': 6,}\n \n exports.MONTH_OFFSET = {\n 'janeiro': 1,\n 'jan': 1,\n 'jan.': 1,\n 'fevereiro': 2,\n 'fev': 2,\n 'fev.': 2,\n 'março': 3,\n 'mar': 3,\n 'mar.': 3,\n 'abril': 4,\n 'abr': 4,\n 'abr.': 4,\n 'maio': 5,\n 'mai': 5,\n 'mai.': 5,\n 'junho': 6,\n 'jun': 6,\n 'jun.': 6,\n 'julho': 7,\n 'jul': 7,\n 'jul.': 7,\n 'agosto': 8,\n 'ago': 8,\n 'ago.': 8,\n 'setembro': 9,\n 'set': 9,\n 'set.': 9,\n 'outubro': 10,\n 'out': 10,\n 'out.': 10,\n 'novembro': 11,\n 'nov': 11,\n 'nov.': 11,\n 'dezembro': 12,\n 'dez': 12,\n 'dez.': 12,\n }","/*\n Date format with slash \"/\" (also \"-\" and \".\") between numbers\n - Martes 3/11/2015\n - 3/11/2015\n - 3/11\n*/\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:' +\n '((?:domingo|dom|segunda|segunda-feira|seg|terça|terça-feira|ter|quarta|quarta-feira|qua|quinta|quinta-feira|qui|sexta|sexta-feira|sex|s[áa]bado|sab))' +\n '\\\\s*\\\\,?\\\\s*' +\n ')?' +\n '([0-1]{0,1}[0-9]{1})[\\\\/\\\\.\\\\-]([0-3]{0,1}[0-9]{1})' +\n '(?:' +\n '[\\\\/\\\\.\\\\-]' +\n '([0-9]{4}\\s*\\,?\\s*|[0-9]{2}\\s*\\,?\\s*)' +\n ')?' +\n '(\\\\W|$)', 'i');\n\nvar DAYS_OFFSET = { 'domingo': 0, 'dom': 0, 'segunda': 1, 'segunda-feira': 1, 'seg': 1, 'terça': 2, 'terça-feira': 2, 'ter': 2, 'quarta': 3, 'quarta-feira': 3, 'qua': 3,\n 'quinta': 4, 'quinta-feira': 4, 'qui': 4, 'sexta': 5, 'sexta-feira': 5, 'sex': 5, 'sábado': 6, 'sabado': 6, 'sab': 6,}\n\n\nvar OPENNING_GROUP = 1;\nvar ENDING_GROUP = 6;\n\n// in Spanish we use day/month/year\nvar WEEKDAY_GROUP = 2;\nvar MONTH_GROUP = 4;\nvar DAY_GROUP = 3;\nvar YEAR_GROUP = 5;\n\nexports.Parser = function PTSlashDateFormatParser(argument) {\n Parser.apply(this, arguments);\n\n this.pattern = function () { return PATTERN; };\n this.extract = function(text, ref, match, opt){\n\n if(match[OPENNING_GROUP] == '/' || match[ENDING_GROUP] == '/') {\n // Long skip, if there is some overlapping like:\n // XX[/YY/ZZ]\n // [XX/YY/]ZZ\n match.index += match[0].length\n return;\n }\n\n var index = match.index + match[OPENNING_GROUP].length;\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length - match[ENDING_GROUP].length);\n\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n });\n\n if(text.match(/^\\d\\.\\d$/)) return;\n if(text.match(/^\\d\\.\\d{1,2}\\.\\d{1,2}$/)) return;\n\n // MM/dd -> OK\n // MM.dd -> NG\n if(!match[YEAR_GROUP] && match[0].indexOf('/') < 0) return;\n\n var date = null;\n var year = match[YEAR_GROUP] || dayjs(ref).year() + '';\n var month = match[MONTH_GROUP];\n var day = match[DAY_GROUP];\n\n month = parseInt(month);\n day = parseInt(day);\n year = parseInt(year);\n\n if(month < 1 || month > 12) {\n if(month > 12) {\n // dd/mm/yyyy date format if day looks like a month, and month\n // looks like a day.\n if (day >= 1 && day <= 12 && month >= 13 && month <= 31) {\n // unambiguous\n var tday = month;\n month = day;\n day = tday;\n }\n else {\n // both month and day are <= 12\n return null;\n }\n }\n }\n if(day < 1 || day > 31) return null;\n\n if(year < 100){\n if(year > 50){\n year = year + 1900;\n }else{\n year = year + 2000;\n }\n }\n\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n\n //Day of week\n if(match[WEEKDAY_GROUP]) {\n result.start.assign('weekday', DAYS_OFFSET[match[WEEKDAY_GROUP].toLowerCase()]);\n }\n\n result.tags['PTSlashDateFormatParser'] = true;\n return result;\n };\n};","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)há\\s*([0-9]+|mei[oa]|uma?)\\s*(minutos?|horas?|semanas?|dias?|mes(es)?|anos?)(?=(?:\\W|$))/i;\n\nexports.Parser = function PTTimeAgoFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return PATTERN;\n }\n\n this.extract = function(text, ref, match, opt){\n\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n let index = match.index + match[1].length;\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var num = parseInt(match[2]);\n if (isNaN(num)) {\n if (match[2].match(/mei/)) {\n num = 0.5;\n } else {\n num = 1;\n }\n }\n\n var date = dayjs(ref);\n\n if (match[3].match(/hora/) || match[3].match(/minuto/)) {\n if (match[3].match(/hora/)) {\n\n date = date.add(-num, 'hour');\n\n } else if (match[3].match(/minuto/)) {\n\n date = date.add(-num, 'minute');\n }\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.tags['PTTimeAgoFormatParser'] = true;\n return result;\n }\n\n if (match[3].match(/semana/)) {\n date = date.add(-num, 'week');\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n result.start.imply('weekday', date.day());\n return result;\n }\n\n if (match[3].match(/dia/)) {\n date = date.add(-num, 'd');\n }\n\n if (match[3].match(/mes/)) {\n date = date.add(-num, 'month');\n }\n\n if (match[3].match(/ano/)) {\n\n date = date.add(-num, 'year');\n }\n\n result.start.assign('day', date.date());\n result.start.assign('month', date.month() + 1);\n result.start.assign('year', date.year());\n return result;\n\n };\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar ParsedComponents = require('../../result').ParsedComponents;\n\nvar FIRST_REG_PATTERN = new RegExp(\"(^|\\\\s|T)\" +\n \"(?:(?:ao?|às?|das|da|de|do)\\\\s*)?\" +\n \"(\\\\d{1,4}|meio-dia|meia-noite|meio dia|meia noite)\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\:|\\\\:)(\\\\d{2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\n \"(?=\\\\W|$)\", 'i');\n\n\nvar SECOND_REG_PATTERN = new RegExp(\"^\\\\s*\" +\n \"(\\\\-|\\\\–|\\\\~|\\\\〜|a(?:o)?|\\\\?)\\\\s*\" +\n \"(\\\\d{1,4})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\n \"(?=\\\\W|$)\", 'i');\n\nvar HOUR_GROUP = 2;\nvar MINUTE_GROUP = 3;\nvar SECOND_GROUP = 4;\nvar AM_PM_HOUR_GROUP = 5;\n\nexports.Parser = function PTTimeExpressionParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return FIRST_REG_PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n // This pattern can be overlaped Ex. [12] AM, 1[2] AM\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n var refMoment = dayjs(ref);\n var result = new ParsedResult();\n result.ref = ref;\n result.index = match.index + match[1].length;\n result.text = match[0].substring(match[1].length);\n result.tags['PTTimeExpressionParser'] = true;\n\n result.start.imply('day', refMoment.date());\n result.start.imply('month', refMoment.month()+1);\n result.start.imply('year', refMoment.year());\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.start.assign('second', second);\n }\n\n // ----- Hours\n if (match[HOUR_GROUP].toLowerCase().match(/meio\\-di/)){\n meridiem = 1;\n hour = 12;\n } else if (match[HOUR_GROUP].toLowerCase() == \"meia-noite\") {\n meridiem = 0;\n hour = 0;\n } else {\n hour = parseInt(match[HOUR_GROUP]);\n }\n\n // ----- Minutes\n if(match[MINUTE_GROUP] != null){\n minute = parseInt(match[MINUTE_GROUP]);\n } else if(hour > 100) {\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if(match[AM_PM_HOUR_GROUP] != null) {\n if(hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if(ampm == \"a\"){\n meridiem = 0;\n if(hour == 12) hour = 0;\n }\n\n if(ampm == \"p\"){\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n }\n result.start.assign('hour', hour);\n result.start.assign('minute', minute);\n if (meridiem >= 0) {\n result.start.assign('meridiem', meridiem);\n }\n\n // ==============================================================\n // Extracting the 'to' chunk\n // ==============================================================\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n // Not accept number only result\n if (result.text.match(/^\\d+$/)) {\n return null;\n }\n return result;\n }\n\n\n\n // Pattern \"YY.YY -XXXX\" is more like timezone offset\n if (match[0].match(/^\\s*(\\+|\\-)\\s*\\d{3,4}$/)) {\n return result;\n }\n\n if(result.end == null){\n result.end = new ParsedComponents(null, result.start.date());\n }\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.end.assign('second', second);\n }\n\n hour = parseInt(match[2]);\n\n // ----- Minute\n if (match[MINUTE_GROUP]!= null) {\n\n minute = parseInt(match[MINUTE_GROUP]);\n if(minute >= 60) return result;\n\n } else if (hour > 100) {\n\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP] != null){\n\n if (hour > 12) return null;\n\n if(match[AM_PM_HOUR_GROUP][0].toLowerCase() == \"a\"){\n meridiem = 0;\n if(hour == 12) {\n hour = 0;\n if (!result.end.isCertain('day')) {\n result.end.imply('day', result.end.get('day') + 1);\n }\n }\n }\n\n if(match[AM_PM_HOUR_GROUP][0].toLowerCase() == \"p\"){\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n\n if (!result.start.isCertain('meridiem')) {\n if (meridiem == 0) {\n\n result.start.imply('meridiem', 0);\n\n if (result.start.get('hour') == 12) {\n result.start.assign('hour', 0);\n }\n\n } else {\n\n result.start.imply('meridiem', 1);\n\n if (result.start.get('hour') != 12) {\n result.start.assign('hour', result.start.get('hour') + 12);\n }\n }\n }\n\n } else if(hour >= 12) {\n meridiem = 1;\n }\n\n result.text = result.text + match[0];\n result.end.assign('hour', hour);\n result.end.assign('minute', minute);\n if (meridiem >= 0) {\n result.end.assign('meridiem', meridiem);\n }\n\n if (result.end.date().getTime() < result.start.date().getTime()) {\n result.end.imply('day', result.end.get('day') + 1)\n }\n\n return result;\n }\n}\n","var Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar updateParsedComponent = require('../en/ENWeekdayParser').updateParsedComponent;\n\nvar DAYS_OFFSET = { 'domingo': 0, 'dom': 0, 'segunda': 1, 'segunda-feira': 1, 'seg': 1, 'terça': 2, 'terça-feira': 2, 'ter': 2, 'quarta': 3, 'quarta-feira': 3, 'qua': 3,\n 'quinta': 4, 'quinta-feira': 4, 'qui': 4, 'sexta': 5, 'sexta-feira': 5, 'sex': 5, 'sábado': 6, 'sabado': 6, 'sab': 6,}\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:(?:\\\\,|\\\\(|\\\\()\\\\s*)?' +\n '(?:(este|esta|passado|pr[oó]ximo)\\\\s*)?' +\n '(' + Object.keys(DAYS_OFFSET).join('|') + ')' +\n '(?:\\\\s*(?:\\\\,|\\\\)|\\\\)))?' +\n '(?:\\\\s*(este|esta|passado|pr[óo]ximo)\\\\s*semana)?' +\n '(?=\\\\W|$)', 'i');\n\nvar PREFIX_GROUP = 2;\nvar WEEKDAY_GROUP = 3;\nvar POSTFIX_GROUP = 4;\n\nexports.Parser = function PTWeekdayParser() {\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n var index = match.index + match[1].length;\n var text = match[0].substr(match[1].length, match[0].length - match[1].length);\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();\n var offset = DAYS_OFFSET[dayOfWeek];\n if(offset === undefined) return null;\n\n var modifier = null;\n var prefix = match[PREFIX_GROUP];\n var postfix = match[POSTFIX_GROUP];\n if (prefix || postfix) {\n var norm = prefix || postfix;\n norm = norm.toLowerCase();\n\n if(norm == 'passado') {\n modifier = 'this';\n }\n else if(norm == 'próximo' || norm == 'proximo') {\n modifier = 'next';\n }\n else if(norm== 'este') {\n modifier = 'this';\n }\n }\n\n updateParsedComponent(result, ref, offset, modifier);\n result.tags['PTWeekdayParser'] = true;\n return result;\n }\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\n/*\n Valid patterns:\n - esta mañana -> today in the morning\n - esta tarde -> today in the afternoon/evening\n - esta noche -> tonight\n - ayer por la mañana -> yesterday in the morning\n - ayer por la tarde -> yesterday in the afternoon/evening\n - ayer por la noche -> yesterday at night\n - mañana por la mañana -> tomorrow in the morning\n - mañana por la tarde -> tomorrow in the afternoon/evening\n - mañana por la noche -> tomorrow at night\n - anoche -> tomorrow at night\n - hoy -> today\n - ayer -> yesterday\n - mañana -> tomorrow\n */\nvar PATTERN = /(\\W|^)(ahora|esta\\s*(mañana|tarde|noche)|(ayer|mañana)\\s*por\\s*la\\s*(mañana|tarde|noche)|hoy|mañana|ayer|anoche)(?=\\W|$)/i;\n\nexports.Parser = function ESCasualDateParser(){\n\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var refMoment = dayjs(ref);\n var startMoment = refMoment;\n var lowerText = text.toLowerCase().replace(/\\s+/g, ' ');\n\n if(lowerText == 'mañana'){\n\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n\n } else if(lowerText == 'ayer') {\n\n startMoment = startMoment.add(-1, 'day');\n }\n else if(lowerText == 'anoche') {\n\n result.start.imply('hour', 0);\n if (refMoment.hour() > 6) {\n startMoment = startMoment.add(-1, 'day');\n }\n\n } else if (lowerText.match(\"esta\")) {\n\n var secondMatch = match[3].toLowerCase();\n if (secondMatch == \"tarde\") {\n\n result.start.imply('hour', 18);\n\n } else if (secondMatch == \"mañana\") {\n\n result.start.imply('hour', 6);\n\n } else if (secondMatch == \"noche\") {\n\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n\n }\n } else if (lowerText.match(/por\\s*la/)) {\n\n var firstMatch = match[4].toLowerCase();\n if (firstMatch === 'ayer') {\n\n startMoment = startMoment.add(-1, 'day');\n\n } else if (firstMatch === 'mañana') {\n\n startMoment = startMoment.add(1, 'day');\n\n }\n\n var secondMatch = match[5].toLowerCase();\n if (secondMatch == \"tarde\") {\n\n result.start.imply('hour', 18);\n\n } else if (secondMatch == \"mañana\") {\n\n result.start.imply('hour', 9);\n\n } else if (secondMatch == \"noche\") {\n\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n\n }\n\n } else if (lowerText.match(\"ahora\")) {\n\n result.start.imply('hour', refMoment.hour());\n result.start.imply('minute', refMoment.minute());\n result.start.imply('second', refMoment.second());\n result.start.imply('millisecond', refMoment.millisecond());\n\n }\n\n result.start.assign('day', startMoment.date())\n result.start.assign('month', startMoment.month() + 1)\n result.start.assign('year', startMoment.year())\n result.tags['ESCasualDateParser'] = true;\n return result;\n }\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)(dentro\\s*de|en)\\s*([0-9]+|medi[oa]|una?)\\s*(minutos?|horas?|d[ií]as?)\\s*(?=(?:\\W|$))/i;\n\nexports.Parser = function ESDeadlineFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var index = match.index + match[1].length;\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var num = parseInt(match[3]);\n if (isNaN(num)) {\n if (match[3].match(/medi/)) {\n num = 0.5;\n } else {\n num = 1;\n }\n }\n\n var date = dayjs(ref);\n if (match[4].match(/d[ií]a/)) {\n date = date.add(num, 'd');\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n return result;\n }\n\n\n if (match[4].match(/hora/)) {\n\n date = date.add(num, 'hour');\n\n } else if (match[4].match(/minuto/)) {\n\n date = date.add(num, 'minute');\n }\n\n result.start.imply('year', date.year());\n result.start.imply('month', date.month() + 1);\n result.start.imply('day', date.date());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.tags['ESDeadlineFormatParser'] = true;\n return result;\n };\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)hace\\s*([0-9]+|medi[oa]|una?)\\s*(minutos?|horas?|semanas?|d[ií]as?|mes(es)?|años?)(?=(?:\\W|$))/i;\n\nexports.Parser = function ESTimeAgoFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return PATTERN;\n }\n\n this.extract = function(text, ref, match, opt){\n\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n let index = match.index + match[1].length;\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var num = parseInt(match[2]);\n if (isNaN(num)) {\n if (match[2].match(/medi/)) {\n num = 0.5;\n } else {\n num = 1;\n }\n }\n\n var date = dayjs(ref);\n\n if (match[3].match(/hora/) || match[3].match(/minuto/)) {\n if (match[3].match(/hora/)) {\n\n date = date.add(-num, 'hour');\n\n } else if (match[3].match(/minuto/)) {\n\n date = date.add(-num, 'minute');\n }\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.tags['ESTimeAgoFormatParser'] = true;\n return result;\n }\n\n if (match[3].match(/semana/)) {\n date = date.add(-num, 'week');\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n result.start.imply('weekday', date.day());\n return result;\n }\n\n if (match[3].match(/d[ií]a/)) {\n date = date.add(-num, 'd');\n }\n\n if (match[3].match(/mes/)) {\n date = date.add(-num, 'month');\n }\n\n if (match[3].match(/año/)) {\n\n date = date.add(-num, 'year');\n }\n\n result.start.assign('day', date.date());\n result.start.assign('month', date.month() + 1);\n result.start.assign('year', date.year());\n return result;\n\n };\n}\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar ParsedComponents = require('../../result').ParsedComponents;\n\nvar FIRST_REG_PATTERN = new RegExp(\"(^|\\\\s|T)\" +\n \"(?:(?:a las?|al?|desde|de)\\\\s*)?\" +\n \"(\\\\d{1,4}|mediod[ií]a|medianoche)\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\:|\\\\:)(\\\\d{2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\n \"(?=\\\\W|$)\", 'i');\n\n\nvar SECOND_REG_PATTERN = new RegExp(\"^\\\\s*\" +\n \"(\\\\-|\\\\–|\\\\~|\\\\〜|a(?:\\s*las)?|\\\\?)\\\\s*\" +\n \"(\\\\d{1,4})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\n \"(?=\\\\W|$)\", 'i');\n\nvar HOUR_GROUP = 2;\nvar MINUTE_GROUP = 3;\nvar SECOND_GROUP = 4;\nvar AM_PM_HOUR_GROUP = 5;\n\nexports.Parser = function ESTimeExpressionParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return FIRST_REG_PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n // This pattern can be overlaped Ex. [12] AM, 1[2] AM\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n var refMoment = dayjs(ref);\n var result = new ParsedResult();\n result.ref = ref;\n result.index = match.index + match[1].length;\n result.text = match[0].substring(match[1].length);\n result.tags['ESTimeExpressionParser'] = true;\n\n result.start.imply('day', refMoment.date());\n result.start.imply('month', refMoment.month()+1);\n result.start.imply('year', refMoment.year());\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.start.assign('second', second);\n }\n\n // ----- Hours\n if (match[HOUR_GROUP].toLowerCase().match(/mediod/)){\n meridiem = 1;\n hour = 12;\n } else if (match[HOUR_GROUP].toLowerCase() == \"medianoche\") {\n meridiem = 0;\n hour = 0;\n } else {\n hour = parseInt(match[HOUR_GROUP]);\n }\n\n // ----- Minutes\n if(match[MINUTE_GROUP] != null){\n minute = parseInt(match[MINUTE_GROUP]);\n } else if(hour > 100) {\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if(match[AM_PM_HOUR_GROUP] != null) {\n if(hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if(ampm == \"a\"){\n meridiem = 0;\n if(hour == 12) hour = 0;\n }\n\n if(ampm == \"p\"){\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n }\n result.start.assign('hour', hour);\n result.start.assign('minute', minute);\n if (meridiem >= 0) {\n result.start.assign('meridiem', meridiem);\n }\n\n // ==============================================================\n // Extracting the 'to' chunk\n // ==============================================================\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n // Not accept number only result\n if (result.text.match(/^\\d+$/)) {\n return null;\n }\n return result;\n }\n\n\n\n // Pattern \"YY.YY -XXXX\" is more like timezone offset\n if (match[0].match(/^\\s*(\\+|\\-)\\s*\\d{3,4}$/)) {\n return result;\n }\n\n if(result.end == null){\n result.end = new ParsedComponents(null, result.start.date());\n }\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.end.assign('second', second);\n }\n\n hour = parseInt(match[2]);\n\n // ----- Minute\n if (match[MINUTE_GROUP]!= null) {\n\n minute = parseInt(match[MINUTE_GROUP]);\n if(minute >= 60) return result;\n\n } else if (hour > 100) {\n\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP] != null){\n\n if (hour > 12) return null;\n\n if(match[AM_PM_HOUR_GROUP][0].toLowerCase() == \"a\"){\n meridiem = 0;\n if(hour == 12) {\n hour = 0;\n if (!result.end.isCertain('day')) {\n result.end.imply('day', result.end.get('day') + 1);\n }\n }\n }\n\n if(match[AM_PM_HOUR_GROUP][0].toLowerCase() == \"p\"){\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n\n if (!result.start.isCertain('meridiem')) {\n if (meridiem == 0) {\n\n result.start.imply('meridiem', 0);\n\n if (result.start.get('hour') == 12) {\n result.start.assign('hour', 0);\n }\n\n } else {\n\n result.start.imply('meridiem', 1);\n\n if (result.start.get('hour') != 12) {\n result.start.assign('hour', result.start.get('hour') + 12);\n }\n }\n }\n\n } else if(hour >= 12) {\n meridiem = 1;\n }\n\n result.text = result.text + match[0];\n result.end.assign('hour', hour);\n result.end.assign('minute', minute);\n if (meridiem >= 0) {\n result.end.assign('meridiem', meridiem);\n }\n\n if (result.end.date().getTime() < result.start.date().getTime()) {\n result.end.imply('day', result.end.get('day') + 1)\n }\n\n return result;\n }\n}\n","var Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar updateParsedComponent = require('../en/ENWeekdayParser').updateParsedComponent;\n\nvar DAYS_OFFSET = { 'domingo': 0, 'dom': 0, 'lunes': 1, 'lun': 1, 'martes': 2, 'mar':2, 'miercoles': 3, 'miércoles': 3, 'mie': 3,\n 'jueves': 4, 'jue': 4, 'viernes': 5, 'vier': 5, 'sabado': 6, 'sábado': 6, 'sab': 6,}\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:(?:\\\\,|\\\\(|\\\\()\\\\s*)?' +\n '(?:(este|pasado|pr[oó]ximo)\\\\s*)?' +\n '(' + Object.keys(DAYS_OFFSET).join('|') + ')' +\n '(?:\\\\s*(?:\\\\,|\\\\)|\\\\)))?' +\n '(?:\\\\s*(este|pasado|pr[óo]ximo)\\\\s*week)?' +\n '(?=\\\\W|$)', 'i');\n\nvar PREFIX_GROUP = 2;\nvar WEEKDAY_GROUP = 3;\nvar POSTFIX_GROUP = 4;\n\nexports.Parser = function ESWeekdayParser() {\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n var index = match.index + match[1].length;\n var text = match[0].substr(match[1].length, match[0].length - match[1].length);\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();\n var offset = DAYS_OFFSET[dayOfWeek];\n if(offset === undefined) return null;\n\n var modifier = null;\n var prefix = match[PREFIX_GROUP];\n var postfix = match[POSTFIX_GROUP];\n if (prefix || postfix) {\n var norm = prefix || postfix;\n norm = norm.toLowerCase();\n\n if(norm == 'pasado') {\n modifier = 'this';\n }\n else if(norm == 'próximo' || norm == 'proximo') {\n modifier = 'next';\n }\n else if(norm== 'este') {\n modifier = 'this';\n }\n }\n\n updateParsedComponent(result, ref, offset, modifier);\n result.tags['ESWeekdayParser'] = true;\n return result;\n }\n}\n","var parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar util = require('../../utils/ES');\n\nvar DAYS_OFFSET = util.WEEKDAY_OFFSET;\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:(Domingo|Lunes|Martes|Miércoles|Miercoles|Jueves|Viernes|Sábado|Sabado|Dom|Lun|Mar|Mie|Jue|Vie|Sab)\\\\s*,?\\\\s*)?' +\n '([0-9]{1,2})(?:º|ª|°)?' +\n '(?:\\\\s*(?:desde|de|\\\\-|\\\\–|al?|hasta|\\\\s)\\\\s*([0-9]{1,2})(?:º|ª|°)?)?\\\\s*(?:de)?\\\\s*' +\n '(Ene(?:ro|\\\\.)?|Feb(?:rero|\\\\.)?|Mar(?:zo|\\\\.)?|Abr(?:il|\\\\.)?|May(?:o|\\\\.)?|Jun(?:io|\\\\.)?|Jul(?:io|\\\\.)?|Ago(?:sto|\\\\.)?|Sep(?:tiembre|\\\\.)?|Set(?:iembre|\\\\.)?|Oct(?:ubre|\\\\.)?|Nov(?:iembre|\\\\.)?|Dic(?:iembre|\\\\.)?)' +\n '(?:\\\\s*(?:del?)?(\\\\s*[0-9]{1,4}(?![^\\\\s]\\\\d))(\\\\s*[ad]\\\\.?\\\\s*c\\\\.?|a\\\\.?\\\\s*d\\\\.?)?)?' +\n '(?=\\\\W|$)', 'i'\n );\n\nvar WEEKDAY_GROUP = 2;\nvar DATE_GROUP = 3;\nvar DATE_TO_GROUP = 4;\nvar MONTH_NAME_GROUP = 5;\nvar YEAR_GROUP = 6;\nvar YEAR_BE_GROUP = 7;\n\nexports.Parser = function ESMonthNameLittleEndianParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n\n var day = match[DATE_GROUP];\n day = parseInt(day);\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n year = parseInt(year);\n\n if(match[YEAR_BE_GROUP]){\n if (/a\\.?\\s*c\\.?/i.test(match[YEAR_BE_GROUP])) {\n // antes de Cristo\n year = -year;\n }\n } else if (year < 100){\n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month);\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n // Weekday component\n if (match[WEEKDAY_GROUP]) {\n var weekday = match[WEEKDAY_GROUP];\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()]\n result.start.assign('weekday', weekday);\n }\n\n // Text can be 'range' value. Such as '12 - 13 January 2012'\n if (match[DATE_TO_GROUP]) {\n result.end = result.start.clone();\n result.end.assign('day', parseInt(match[DATE_TO_GROUP]));\n }\n\n result.tags['ESMonthNameLittleEndianParser'] = true;\n return result;\n };\n}\n","exports.WEEKDAY_OFFSET = {\n 'domingo': 0,\n 'dom': 0,\n 'lunes': 1,\n 'lun': 1,\n 'martes': 2,\n 'mar':2,\n 'miércoles': 3,\n 'miercoles': 3,\n 'mie': 3,\n 'jueves': 4,\n 'jue': 4,\n 'viernes': 5,\n 'vie': 5,\n 'sábado': 6,\n 'sabado': 6,\n 'sab': 6,}\n\nexports.MONTH_OFFSET = {\n 'enero': 1,\n 'ene': 1,\n 'ene.': 1,\n 'febrero': 2,\n 'feb': 2,\n 'feb.': 2,\n 'marzo': 3,\n 'mar': 3,\n 'mar.': 3,\n 'abril': 4,\n 'abr': 4,\n 'abr.': 4,\n 'mayo': 5,\n 'may': 5,\n 'may.': 5,\n 'junio': 6,\n 'jun': 6,\n 'jun.': 6,\n 'julio': 7,\n 'jul': 7,\n 'jul.': 7,\n 'agosto': 8,\n 'ago': 8,\n 'ago.': 8,\n 'septiembre': 9,\n 'sep': 9,\n 'sept': 9,\n 'sep.': 9,\n 'sept.': 9,\n 'octubre': 10,\n 'oct': 10,\n 'oct.': 10,\n 'noviembre': 11,\n 'nov': 11,\n 'nov.': 11,\n 'diciembre': 12,\n 'dic': 12,\n 'dic.': 12,\n}\n","/*\n Date format with slash \"/\" (also \"-\" and \".\") between numbers\n - Martes 3/11/2015\n - 3/11/2015\n - 3/11\n*/\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:' +\n '((?:domingo|dom|lunes|lun|martes|mar|mi[ée]rcoles|mie|jueves|jue|viernes|vie|s[áa]bado|sab))' +\n '\\\\s*\\\\,?\\\\s*' +\n ')?' +\n '([0-1]{0,1}[0-9]{1})[\\\\/\\\\.\\\\-]([0-3]{0,1}[0-9]{1})' +\n '(?:' +\n '[\\\\/\\\\.\\\\-]' +\n '([0-9]{4}\\s*\\,?\\s*|[0-9]{2}\\s*\\,?\\s*)' +\n ')?' +\n '(\\\\W|$)', 'i');\n\nvar DAYS_OFFSET = { 'domingo': 0, 'dom': 0, 'lunes': 1, 'lun': 1, 'martes': 2, 'mar': 2, 'miercoles': 3, 'miércoles': 3, 'mie': 3,\n 'jueves': 4, 'jue': 4, 'viernes': 5, 'vier': 5, 'sábado': 6, 'sabado': 6, 'sab': 6,}\n\n\nvar OPENNING_GROUP = 1;\nvar ENDING_GROUP = 6;\n\n// in Spanish we use day/month/year\nvar WEEKDAY_GROUP = 2;\nvar MONTH_GROUP = 4;\nvar DAY_GROUP = 3;\nvar YEAR_GROUP = 5;\n\nexports.Parser = function ESSlashDateFormatParser(argument) {\n Parser.apply(this, arguments);\n\n this.pattern = function () { return PATTERN; };\n this.extract = function(text, ref, match, opt){\n\n if(match[OPENNING_GROUP] == '/' || match[ENDING_GROUP] == '/') {\n // Long skip, if there is some overlapping like:\n // XX[/YY/ZZ]\n // [XX/YY/]ZZ\n match.index += match[0].length\n return;\n }\n\n var index = match.index + match[OPENNING_GROUP].length;\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length - match[ENDING_GROUP].length);\n\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n });\n\n if(text.match(/^\\d\\.\\d$/)) return;\n if(text.match(/^\\d\\.\\d{1,2}\\.\\d{1,2}$/)) return;\n\n // MM/dd -> OK\n // MM.dd -> NG\n if(!match[YEAR_GROUP] && match[0].indexOf('/') < 0) return;\n\n var date = null;\n var year = match[YEAR_GROUP] || dayjs(ref).year() + '';\n var month = match[MONTH_GROUP];\n var day = match[DAY_GROUP];\n\n month = parseInt(month);\n day = parseInt(day);\n year = parseInt(year);\n\n if(month < 1 || month > 12) {\n if(month > 12) {\n // dd/mm/yyyy date format if day looks like a month, and month\n // looks like a day.\n if (day >= 1 && day <= 12 && month >= 13 && month <= 31) {\n // unambiguous\n var tday = month;\n month = day;\n day = tday;\n }\n else {\n // both month and day are <= 12\n return null;\n }\n }\n }\n if(day < 1 || day > 31) return null;\n\n if(year < 100){\n if(year > 50){\n year = year + 1900;\n }else{\n year = year + 2000;\n }\n }\n\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n\n //Day of week\n if(match[WEEKDAY_GROUP]) {\n result.start.assign('weekday', DAYS_OFFSET[match[WEEKDAY_GROUP].toLowerCase()]);\n }\n\n result.tags['ESSlashDateFormatParser'] = true;\n return result;\n };\n};","const dayjs = require('dayjs');\r\nvar Parser = require('../parser').Parser;\r\nvar ParsedResult = require('../../result').ParsedResult;\r\n\r\nvar PATTERN = /(\\W|^)(maintenant|aujourd'hui|ajd|cette\\s*nuit|la\\s*veille|(demain|hier)(\\s*(matin|soir|aprem|après-midi))?|ce\\s*(matin|soir)|cet\\s*(après-midi|aprem))(?=\\W|$)/i;\r\n\r\nexports.Parser = function FRCasualDateParser(){\r\n\r\n Parser.apply(this, arguments);\r\n\r\n this.pattern = function() { return PATTERN; }\r\n\r\n this.extract = function(text, ref, match, opt){\r\n\r\n var text = match[0].substr(match[1].length);\r\n var index = match.index + match[1].length;\r\n var result = new ParsedResult({\r\n index: index,\r\n text: text,\r\n ref: ref,\r\n });\r\n\r\n var refMoment = dayjs(ref);\r\n var startMoment = refMoment;\r\n var lowerText = text.toLowerCase();\r\n\r\n if(lowerText.match(/demain/)){\r\n // Check not \"Tomorrow\" on late night\r\n if(refMoment.hour() > 1) {\r\n startMoment = startMoment.add(1, 'day');\r\n }\r\n } \r\n\r\n if(lowerText.match(/hier/)) {\r\n startMoment = startMoment.add(-1, 'day');\r\n }\r\n\r\n if(lowerText.match(/cette\\s*nuit/)){\r\n // Normally means this coming midnight\r\n result.start.imply('hour', 22);\r\n result.start.imply('meridiem', 1);\r\n\r\n } else if(lowerText.match(/la\\s*veille/)) {\r\n\r\n result.start.imply('hour', 0);\r\n if (refMoment.hour() > 6) {\r\n startMoment = startMoment.add(-1, 'day');\r\n }\r\n\r\n } else if (lowerText.match(/(après-midi|aprem)/)) {\r\n\r\n result.start.imply('hour', 14);\r\n\r\n } else if (lowerText.match(/(soir)/)) {\r\n\r\n result.start.imply('hour', 18);\r\n\r\n } else if (lowerText.match(/matin/)) {\r\n\r\n result.start.imply('hour', 8);\r\n\r\n } else if (lowerText.match(\"maintenant\")) {\r\n\r\n result.start.imply('hour', refMoment.hour());\r\n result.start.imply('minute', refMoment.minute());\r\n result.start.imply('second', refMoment.second());\r\n result.start.imply('millisecond', refMoment.millisecond());\r\n\r\n }\r\n\r\n result.start.assign('day', startMoment.date())\r\n result.start.assign('month', startMoment.month() + 1)\r\n result.start.assign('year', startMoment.year())\r\n result.tags['FRCasualDateParser'] = true;\r\n return result;\r\n }\r\n}\r\n","const dayjs = require('dayjs');\r\nvar Parser = require('../parser').Parser;\r\nvar ParsedResult = require('../../result').ParsedResult;\r\nvar util = require('../../utils/FR');\r\n\r\nvar PATTERN = new RegExp('(\\\\W|^)' +\r\n '(dans|en)\\\\s*' +\r\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|une?|(?:\\\\s*quelques)?|demi(?:\\\\s*|-?)?)\\\\s*' +\r\n '(secondes?|min(?:ute)?s?|heures?|jours?|semaines?|mois|années?)\\\\s*' +\r\n '(?=\\\\W|$)', 'i'\r\n);\r\n\r\nvar STRICT_PATTERN = new RegExp('(\\\\W|^)' +\r\n '(dans|en)\\\\s*' +\r\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|un?)\\\\s*' +\r\n '(secondes?|minutes?|heures?|jours?)\\\\s*' +\r\n '(?=\\\\W|$)', 'i'\r\n);\r\n\r\nexports.Parser = function FRDeadlineFormatParser(){\r\n Parser.apply(this, arguments);\r\n\r\n this.pattern = function() {\r\n return this.isStrictMode()? STRICT_PATTERN : PATTERN;\r\n };\r\n\r\n this.extract = function(text, ref, match, opt){\r\n\r\n var index = match.index + match[1].length;\r\n var text = match[0];\r\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\r\n\r\n var result = new ParsedResult({\r\n index: index,\r\n text: text,\r\n ref: ref\r\n });\r\n\r\n var num = match[3];\r\n if (util.INTEGER_WORDS[num] !== undefined) {\r\n num = util.INTEGER_WORDS[num];\r\n } else if (num === 'un' || num === 'une'){\r\n num = 1;\r\n } else if (num.match(/quelques?/i)){\r\n num = 3;\r\n } else if (num.match(/demi-?/i)) {\r\n num = 0.5;\r\n } else {\r\n num = parseInt(num);\r\n }\r\n\r\n var date = dayjs(ref);\r\n if (match[4].match(/jour|semaine|mois|année/i)) {\r\n\r\n if (match[4].match(/jour/)) {\r\n date = date.add(num, 'd');\r\n } else if (match[4].match(/semaine/i)) {\r\n date = date.add(num * 7, 'd');\r\n } else if (match[4].match(/mois/i)) {\r\n date = date.add(num, 'month');\r\n } else if (match[4].match(/année/i)) {\r\n date = date.add(num, 'year');\r\n }\r\n\r\n result.start.assign('year', date.year());\r\n result.start.assign('month', date.month() + 1);\r\n result.start.assign('day', date.date());\r\n return result;\r\n }\r\n\r\n if (match[4].match(/heure/i)) {\r\n\r\n date = date.add(num, 'hour');\r\n\r\n } else if (match[4].match(/min/i)) {\r\n\r\n date = date.add(num, 'minutes');\r\n\r\n } else if (match[4].match(/secondes/i)) {\r\n\r\n date = date.add(num, 'second');\r\n }\r\n\r\n result.start.imply('year', date.year());\r\n result.start.imply('month', date.month() + 1);\r\n result.start.imply('day', date.date());\r\n result.start.assign('hour', date.hour());\r\n result.start.assign('minute', date.minute());\r\n result.start.assign('second', date.second());\r\n result.tags['FRDeadlineFormatParser'] = true;\r\n return result;\r\n };\r\n};\r\n","const parser = require('../parser');\r\nvar ParsedResult = require('../../result').ParsedResult;\r\n\r\nvar util = require('../../utils/FR');\r\n\r\nvar DAYS_OFFSET = util.WEEKDAY_OFFSET;\r\n\r\nvar PATTERN = new RegExp('(\\\\W|^)' +\r\n '(?:(Dimanche|Lundi|Mardi|mercredi|Jeudi|Vendredi|Samedi|Dim|Lun|Mar|Mer|Jeu|Ven|Sam)\\\\s*,?\\\\s*)?' +\r\n '([0-9]{1,2}|1er)' +\r\n '(?:\\\\s*(?:au|\\\\-|\\\\–|jusqu\\'au?|\\\\s)\\\\s*([0-9]{1,2})(?:er)?)?\\\\s*(?:de)?\\\\s*' +\r\n '(Jan(?:vier|\\\\.)?|F[ée]v(?:rier|\\\\.)?|Mars|Avr(?:il|\\\\.)?|Mai|Juin|Juil(?:let|\\\\.)?|Ao[uû]t|Sept(?:embre|\\\\.)?|Oct(?:obre|\\\\.)?|Nov(?:embre|\\\\.)?|d[ée]c(?:embre|\\\\.)?)' +\r\n '(?:\\\\s*(\\\\s*[0-9]{1,4}(?![^\\\\s]\\\\d))(?:\\\\s*(AC|[ap]\\\\.?\\\\s*c(?:h(?:r)?)?\\\\.?\\\\s*n\\\\.?))?)?' +\r\n '(?=\\\\W|$)', 'i'\r\n );\r\n\r\nvar WEEKDAY_GROUP = 2;\r\nvar DATE_GROUP = 3;\r\nvar DATE_TO_GROUP = 4;\r\nvar MONTH_NAME_GROUP = 5;\r\nvar YEAR_GROUP = 6;\r\nvar YEAR_BE_GROUP = 7;\r\n\r\nexports.Parser = function FRMonthNameLittleEndianParser(){\r\n parser.Parser.apply(this, arguments);\r\n\r\n this.pattern = function() { return PATTERN; }\r\n\r\n this.extract = function(text, ref, match, opt){\r\n\r\n var result = new ParsedResult({\r\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\r\n index: match.index + match[1].length,\r\n ref: ref,\r\n });\r\n\r\n var month = match[MONTH_NAME_GROUP];\r\n month = util.MONTH_OFFSET[month.toLowerCase()];\r\n\r\n var day = match[DATE_GROUP];\r\n day = parseInt(day);\r\n\r\n var year = null;\r\n if (match[YEAR_GROUP]) {\r\n year = match[YEAR_GROUP];\r\n year = parseInt(year);\r\n\r\n if(match[YEAR_BE_GROUP]){\r\n if (/a/i.test(match[YEAR_BE_GROUP])) {\r\n // Ante Christe natum\r\n year = -year;\r\n }\r\n } else if (year < 100){\r\n\r\n year = year + 2000;\r\n }\r\n }\r\n\r\n if(year){\r\n result.start.assign('day', day);\r\n result.start.assign('month', month);\r\n result.start.assign('year', year);\r\n } else {\r\n year = parser.findYearClosestToRef(ref, day, month)\r\n result.start.assign('day', day);\r\n result.start.assign('month', month);\r\n result.start.imply('year', year);\r\n }\r\n\r\n // Weekday component\r\n if (match[WEEKDAY_GROUP]) {\r\n var weekday = match[WEEKDAY_GROUP];\r\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()]\r\n result.start.assign('weekday', weekday);\r\n }\r\n\r\n // Text can be 'range' value. Such as '12 - 13 janvier 2012'\r\n if (match[DATE_TO_GROUP]) {\r\n result.end = result.start.clone();\r\n result.end.assign('day', parseInt(match[DATE_TO_GROUP]));\r\n }\r\n\r\n result.tags['FRMonthNameLittleEndianParser'] = true;\r\n return result;\r\n };\r\n}\r\n","/*\r\n Date format with slash \"/\" (also \"-\" and \".\") between numbers\r\n - Martes 3/11/2015\r\n - 3/11/2015\r\n - 3/11\r\n*/\r\nvar parser = require('../parser');\r\nvar ParsedResult = require('../../result').ParsedResult;\r\n\r\nvar PATTERN = new RegExp('(\\\\W|^)' +\r\n '(?:' +\r\n '((?:dimanche|dim|lundi|lun|mardi|mar|mercredi|mer|jeudi|jeu|vendredi|ven|samedi|sam|le))' +\r\n '\\\\s*\\\\,?\\\\s*' +\r\n ')?' +\r\n '([0-3]{0,1}[0-9]{1})[\\\\/\\\\.\\\\-]([0-3]{0,1}[0-9]{1})' +\r\n '(?:' +\r\n '[\\\\/\\\\.\\\\-]' +\r\n '([0-9]{4}\\s*\\,?\\s*|[0-9]{2}\\s*\\,?\\s*)' +\r\n ')?' +\r\n '(\\\\W|$)', 'i');\r\n\r\nvar DAYS_OFFSET = { 'dimanche': 0, 'dim': 0, 'lundi': 1, 'lun': 1,'mardi': 2, 'mar':2, 'mercredi': 3, 'mer': 3,\r\n 'jeudi': 4, 'jeu':4, 'vendredi': 5, 'ven': 5,'samedi': 6, 'sam': 6};\r\n\r\n\r\nvar OPENNING_GROUP = 1;\r\nvar ENDING_GROUP = 6;\r\n\r\n// In French we use day/month/year\r\nvar WEEKDAY_GROUP = 2;\r\nvar DAY_GROUP = 3;\r\nvar MONTH_GROUP = 4;\r\nvar YEAR_GROUP = 5;\r\n\r\nexports.Parser = function FRSlashDateFormatParser(argument) {\r\n parser.Parser.apply(this, arguments);\r\n\r\n this.pattern = function () { return PATTERN; };\r\n this.extract = function(text, ref, match, opt){\r\n\r\n if(match[OPENNING_GROUP] == '/' || match[ENDING_GROUP] == '/') {\r\n // Long skip, if there is some overlapping like:\r\n // XX[/YY/ZZ]\r\n // [XX/YY/]ZZ\r\n match.index += match[0].length\r\n return;\r\n }\r\n\r\n var index = match.index + match[OPENNING_GROUP].length;\r\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length - match[ENDING_GROUP].length);\r\n\r\n\r\n var result = new ParsedResult({\r\n text: text,\r\n index: index,\r\n ref: ref,\r\n });\r\n\r\n if(text.match(/^\\d\\.\\d$/)) return;\r\n if(text.match(/^\\d\\.\\d{1,2}\\.\\d{1,2}$/)) return;\r\n\r\n // MM/dd -> OK\r\n // MM.dd -> NG\r\n if(!match[YEAR_GROUP] && match[0].indexOf('/') < 0) return;\r\n\r\n var date = null;\r\n var month = match[MONTH_GROUP];\r\n var day = match[DAY_GROUP];\r\n\r\n day = parseInt(day);\r\n month = parseInt(month);\r\n\r\n var year = null;\r\n if (match[YEAR_GROUP]) {\r\n year = match[YEAR_GROUP];\r\n year = parseInt(year);\r\n\r\n if (year < 100){\r\n year = year + 2000;\r\n }\r\n }\r\n\r\n if(month < 1 || month > 12) {\r\n if(month > 12) {\r\n // dd/mm/yyyy date format if day looks like a month, and month looks like a day.\r\n if (day >= 1 && day <= 12 && month >= 13 && month <= 31) {\r\n // unambiguous\r\n var tday = month;\r\n month = day;\r\n day = tday;\r\n }\r\n else {\r\n // both month and day are <= 12\r\n return null;\r\n }\r\n }\r\n }\r\n\r\n if(day < 1 || day > 31) return null;\r\n\r\n if(year){\r\n result.start.assign('day', day);\r\n result.start.assign('month', month);\r\n result.start.assign('year', year);\r\n } else {\r\n year = parser.findYearClosestToRef(ref, day, month)\r\n result.start.assign('day', day);\r\n result.start.assign('month', month);\r\n result.start.imply('year', year);\r\n }\r\n\r\n // Day of week\r\n if(match[WEEKDAY_GROUP]) {\r\n result.start.assign('weekday', DAYS_OFFSET[match[WEEKDAY_GROUP].toLowerCase()]);\r\n }\r\n\r\n result.tags['FRSlashDateFormatParser'] = true;\r\n return result;\r\n };\r\n};","const dayjs = require('dayjs');\r\nvar Parser = require('../parser').Parser;\r\nvar ParsedResult = require('../../result').ParsedResult;\r\n\r\nvar PATTERN = /(\\W|^)il y a\\s*([0-9]+|une?)\\s*(minutes?|heures?|semaines?|jours?|mois|années?|ans?)(?=(?:\\W|$))/i;\r\n\r\nexports.Parser = function FRTimeAgoFormatParser(){\r\n Parser.apply(this, arguments);\r\n\r\n this.pattern = function() {\r\n return PATTERN;\r\n }\r\n\r\n this.extract = function(text, ref, match, opt){\r\n\r\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\r\n\r\n var text = match[0];\r\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\r\n let index = match.index + match[1].length;\r\n\r\n var result = new ParsedResult({\r\n index: index,\r\n text: text,\r\n ref: ref,\r\n });\r\n result.tags['FRTimeAgoFormatParser'] = true;\r\n \r\n var num = parseInt(match[2]);\r\n if (isNaN(num)) {\r\n if (match[2].match(/demi/)) {\r\n num = 0.5;\r\n } else {\r\n num = 1;\r\n }\r\n }\r\n\r\n var date = dayjs(ref);\r\n\r\n if (match[3].match(/heure/) || match[3].match(/minute/)) {\r\n if (match[3].match(/heure/)) {\r\n\r\n date = date.add(-num, 'hour');\r\n\r\n } else if (match[3].match(/minute/)) {\r\n\r\n date = date.add(-num, 'minute');\r\n }\r\n\r\n result.start.imply('day', date.date());\r\n result.start.imply('month', date.month() + 1);\r\n result.start.imply('year', date.year());\r\n result.start.assign('hour', date.hour());\r\n result.start.assign('minute', date.minute());\r\n\r\n return result;\r\n }\r\n\r\n if (match[3].match(/semaine/)) {\r\n date = date.add(-num, 'week');\r\n\r\n result.start.imply('day', date.date());\r\n result.start.imply('month', date.month() + 1);\r\n result.start.imply('year', date.year());\r\n result.start.imply('weekday', date.day());\r\n return result;\r\n }\r\n\r\n if (match[3].match(/jour/)) {\r\n date = date.add(-num, 'd');\r\n }\r\n\r\n if (match[3].match(/mois/)) {\r\n date = date.add(-num, 'month');\r\n }\r\n\r\n if (match[3].match(/années?|ans?/)) {\r\n date = date.add(-num, 'year');\r\n }\r\n\r\n result.start.assign('day', date.date());\r\n result.start.assign('month', date.month() + 1);\r\n result.start.assign('year', date.year());\r\n return result;\r\n\r\n };\r\n}\r\n","const dayjs = require('dayjs');\r\nvar Parser = require('../parser').Parser;\r\nvar ParsedResult = require('../../result').ParsedResult;\r\nvar ParsedComponents = require('../../result').ParsedComponents;\r\n\r\nvar FIRST_REG_PATTERN = new RegExp(\"(^|\\\\s|T)\" +\r\n \"(?:(?:[àa])\\\\s*)?\" +\r\n \"(\\\\d{1,2}(?:h)?|midi|minuit)\" +\r\n \"(?:\" +\r\n \"(?:\\\\.|\\\\:|\\\\:|h)(\\\\d{1,2})(?:m)?\" +\r\n \"(?:\" +\r\n \"(?:\\\\:|\\\\:|m)(\\\\d{0,2})(?:s)?\" +\r\n \")?\" +\r\n \")?\" +\r\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\r\n \"(?=\\\\W|$)\", 'i');\r\n\r\n\r\nvar SECOND_REG_PATTERN = new RegExp(\"^\\\\s*\" +\r\n \"(\\\\-|\\\\–|\\\\~|\\\\〜|[àa]|\\\\?)\\\\s*\" +\r\n \"(\\\\d{1,2}(?:h)?)\" +\r\n \"(?:\" +\r\n \"(?:\\\\.|\\\\:|\\\\:|h)(\\\\d{1,2})(?:m)?\" +\r\n \"(?:\" +\r\n \"(?:\\\\.|\\\\:|\\\\:|m)(\\\\d{1,2})(?:s)?\" +\r\n \")?\" +\r\n \")?\" +\r\n \"(?:\\\\s*(A\\\\.M\\\\.|P\\\\.M\\\\.|AM?|PM?))?\" +\r\n \"(?=\\\\W|$)\", 'i');\r\n\r\nvar HOUR_GROUP = 2;\r\nvar MINUTE_GROUP = 3;\r\nvar SECOND_GROUP = 4;\r\nvar AM_PM_HOUR_GROUP = 5;\r\n\r\nexports.Parser = function FRTimeExpressionParser(){\r\n Parser.apply(this, arguments);\r\n\r\n this.pattern = function() { return FIRST_REG_PATTERN; }\r\n\r\n this.extract = function(text, ref, match, opt){\r\n\r\n // This pattern can be overlaped Ex. [12] AM, 1[2] AM\r\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\r\n var refMoment = dayjs(ref);\r\n var result = new ParsedResult();\r\n result.ref = ref;\r\n result.index = match.index + match[1].length;\r\n result.text = match[0].substring(match[1].length);\r\n result.tags['FRTimeExpressionParser'] = true;\r\n\r\n result.start.imply('day', refMoment.date());\r\n result.start.imply('month', refMoment.month()+1);\r\n result.start.imply('year', refMoment.year());\r\n\r\n var hour = 0;\r\n var minute = 0;\r\n var meridiem = -1;\r\n\r\n // ----- Second\r\n if(match[SECOND_GROUP] != null){\r\n var second = parseInt(match[SECOND_GROUP]);\r\n if(second >= 60) return null;\r\n\r\n result.start.assign('second', second);\r\n }\r\n\r\n // ----- Hours\r\n if (match[HOUR_GROUP].toLowerCase() == \"midi\"){\r\n meridiem = 1;\r\n hour = 12;\r\n } else if (match[HOUR_GROUP].toLowerCase() == \"minuit\") {\r\n meridiem = 0;\r\n hour = 0;\r\n } else {\r\n hour = parseInt(match[HOUR_GROUP]);\r\n }\r\n\r\n // ----- Minutes\r\n if(match[MINUTE_GROUP] != null){\r\n minute = parseInt(match[MINUTE_GROUP]);\r\n } else if(hour > 100) {\r\n minute = hour%100;\r\n hour = parseInt(hour/100);\r\n }\r\n\r\n if(minute >= 60) {\r\n return null;\r\n }\r\n\r\n if(hour > 24) {\r\n return null;\r\n }\r\n if (hour >= 12) {\r\n meridiem = 1;\r\n }\r\n\r\n // ----- AM & PM\r\n if(match[AM_PM_HOUR_GROUP] != null) {\r\n if(hour > 12) return null;\r\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\r\n if(ampm == \"a\"){\r\n meridiem = 0;\r\n if(hour == 12) hour = 0;\r\n }\r\n\r\n if(ampm == \"p\"){\r\n meridiem = 1;\r\n if(hour != 12) hour += 12;\r\n }\r\n }\r\n result.start.assign('hour', hour);\r\n result.start.assign('minute', minute);\r\n if (meridiem >= 0) {\r\n result.start.assign('meridiem', meridiem);\r\n }\r\n\r\n // ==============================================================\r\n // Extracting the 'to' chunk\r\n // ==============================================================\r\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\r\n if (!match) {\r\n // Not accept number only result\r\n if (result.text.match(/^\\d+$/)) {\r\n return null;\r\n }\r\n return result;\r\n }\r\n\r\n\r\n\r\n // Pattern \"YY.YY -XXXX\" is more like timezone offset\r\n if (match[0].match(/^\\s*(\\+|\\-)\\s*\\d{3,4}$/)) {\r\n return result;\r\n }\r\n\r\n if(result.end == null){\r\n result.end = new ParsedComponents(null, result.start.date());\r\n }\r\n\r\n var hour = 0;\r\n var minute = 0;\r\n var meridiem = -1;\r\n\r\n // ----- Second\r\n if(match[SECOND_GROUP] != null){\r\n var second = parseInt(match[SECOND_GROUP]);\r\n if(second >= 60) return null;\r\n\r\n result.end.assign('second', second);\r\n }\r\n\r\n hour = parseInt(match[2]);\r\n\r\n // ----- Minute\r\n if (match[MINUTE_GROUP]!= null) {\r\n\r\n minute = parseInt(match[MINUTE_GROUP]);\r\n if(minute >= 60) return result;\r\n\r\n } else if (hour > 100) {\r\n\r\n minute = hour%100;\r\n hour = parseInt(hour/100);\r\n }\r\n\r\n if(minute >= 60) {\r\n return null;\r\n }\r\n\r\n if(hour > 24) {\r\n return null;\r\n }\r\n if (hour >= 12) {\r\n meridiem = 1;\r\n }\r\n\r\n // ----- AM & PM\r\n if (match[AM_PM_HOUR_GROUP] != null){\r\n\r\n if (hour > 12) return null;\r\n\r\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\r\n if(ampm == \"a\"){\r\n meridiem = 0;\r\n if(hour == 12) {\r\n hour = 0;\r\n if (!result.end.isCertain('day')) {\r\n result.end.imply('day', result.end.get('day') + 1);\r\n }\r\n }\r\n }\r\n\r\n if(ampm == \"p\"){\r\n meridiem = 1;\r\n if(hour != 12) hour += 12;\r\n }\r\n\r\n if (!result.start.isCertain('meridiem')) {\r\n if (meridiem == 0) {\r\n\r\n result.start.imply('meridiem', 0);\r\n\r\n if (result.start.get('hour') == 12) {\r\n result.start.assign('hour', 0);\r\n }\r\n\r\n } else {\r\n\r\n result.start.imply('meridiem', 1);\r\n\r\n if (result.start.get('hour') != 12) {\r\n result.start.assign('hour', result.start.get('hour') + 12);\r\n }\r\n }\r\n }\r\n }\r\n\r\n result.text = result.text + match[0];\r\n result.end.assign('hour', hour);\r\n result.end.assign('minute', minute);\r\n if (meridiem >= 0) {\r\n result.end.assign('meridiem', meridiem);\r\n } else {\r\n var startAtPM = result.start.isCertain('meridiem') && result.start.get('meridiem') == 1;\r\n if (startAtPM && result.start.get('hour') > hour) {\r\n // 10pm - 1 (am)\r\n result.end.imply('meridiem', 0);\r\n\r\n } else if (hour > 12) {\r\n result.end.imply('meridiem', 1);\r\n }\r\n }\r\n\r\n if (result.end.date().getTime() < result.start.date().getTime()) {\r\n result.end.imply('day', result.end.get('day') + 1)\r\n }\r\n\r\n return result;\r\n }\r\n}\r\n","var Parser = require('../parser').Parser;\r\nvar ParsedResult = require('../../result').ParsedResult;\r\nvar updateParsedComponent = require('../en/ENWeekdayParser').updateParsedComponent;\r\n\r\nvar DAYS_OFFSET = { 'dimanche': 0, 'dim': 0, 'lundi': 1, 'lun': 1,'mardi': 2, 'mar':2, 'mercredi': 3, 'mer': 3,\r\n 'jeudi': 4, 'jeu':4, 'vendredi': 5, 'ven': 5,'samedi': 6, 'sam': 6};\r\n\r\nvar PATTERN = new RegExp('(\\\\s|^)' +\r\n '(?:(?:\\\\,|\\\\(|\\\\()\\\\s*)?' +\r\n '(?:(ce)\\\\s*)?' +\r\n '(' + Object.keys(DAYS_OFFSET).join('|') + ')' +\r\n '(?:\\\\s*(?:\\\\,|\\\\)|\\\\)))?' +\r\n '(?:\\\\s*(dernier|prochain)\\\\s*)?' +\r\n '(?=\\\\W|$)', 'i');\r\n\r\nvar PREFIX_GROUP = 2;\r\nvar WEEKDAY_GROUP = 3;\r\nvar POSTFIX_GROUP = 4;\r\n\r\nexports.Parser = function FRWeekdayParser() {\r\n Parser.apply(this, arguments);\r\n\r\n this.pattern = function() { return PATTERN; };\r\n\r\n this.extract = function(text, ref, match, opt){\r\n var index = match.index + match[1].length;\r\n var text = match[0].substr(match[1].length, match[0].length - match[1].length);\r\n var result = new ParsedResult({\r\n index: index,\r\n text: text,\r\n ref: ref\r\n });\r\n\r\n var dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();\r\n var offset = DAYS_OFFSET[dayOfWeek];\r\n if(offset === undefined) return null;\r\n\r\n var modifier = null;\r\n var prefix = match[PREFIX_GROUP];\r\n var postfix = match[POSTFIX_GROUP];\r\n if (prefix || postfix) {\r\n var norm = prefix || postfix;\r\n norm = norm.toLowerCase();\r\n\r\n if(norm == 'dernier') {\r\n modifier = 'last';\r\n } else if(norm == 'prochain') {\r\n modifier = 'next';\r\n } else if(norm== 'ce') {\r\n modifier = 'this';\r\n }\r\n }\r\n\r\n updateParsedComponent(result, ref, offset, modifier);\r\n result.tags['FRWeekdayParser'] = true;\r\n return result;\r\n }\r\n};\r\n\r\n","const quarterOfYear = require('dayjs/plugin/quarterOfYear');\nconst dayjs = require('dayjs');\ndayjs.extend(quarterOfYear);\n\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/FR');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:les?|la|l\\'|du|des?)\\\\s*' +\n '('+ util.INTEGER_WORDS_PATTERN + '|\\\\d+)?\\\\s*' +\n '(prochaine?s?|derni[eè]re?s?|pass[ée]e?s?|pr[ée]c[ée]dents?|suivante?s?)?\\\\s*' +\n '(secondes?|min(?:ute)?s?|heures?|jours?|semaines?|mois|trimestres?|années?)\\\\s*' +\n '(prochaine?s?|derni[eè]re?s?|pass[ée]e?s?|pr[ée]c[ée]dents?|suivante?s?)?' +\n '(?=\\\\W|$)', 'i'\n);\n\nvar MULTIPLIER_GROUP = 2;\nvar MODIFIER_1_GROUP = 3;\nvar RELATIVE_WORD_GROUP = 4;\nvar MODIFIER_2_GROUP = 5;\n\nexports.Parser = function FRRelativeDateFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; };\n\n this.extract = function(text, ref, match, opt){\n var index = match.index + match[1].length;\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n\n // Multiplier\n var multiplier = match[MULTIPLIER_GROUP] === undefined ? '1' : match[MULTIPLIER_GROUP];\n if (util.INTEGER_WORDS[multiplier] !== undefined) {\n multiplier = util.INTEGER_WORDS[multiplier];\n } else {\n multiplier = parseInt(multiplier);\n }\n\n // Modifier\n var modifier = match[MODIFIER_1_GROUP] === undefined ?\n (match[MODIFIER_2_GROUP] === undefined ? '' : match[MODIFIER_2_GROUP].toLowerCase())\n : match[MODIFIER_1_GROUP].toLowerCase();\n if(!modifier) {\n // At least one modifier is mandatory to match this parser\n return;\n }\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n result.tags['FRRelativeDateFormatParser'] = true;\n\n var modifierFactor;\n switch(true) {\n case /prochaine?s?/.test(modifier):\n case /suivants?/.test(modifier):\n modifierFactor = 1;\n break;\n case /derni[eè]re?s?/.test(modifier):\n case /pass[ée]e?s?/.test(modifier):\n case /pr[ée]c[ée]dents?/.test(modifier):\n modifierFactor = -1;\n break;\n }\n\n var total = multiplier * modifierFactor;\n\n var dateFrom = dayjs(ref);\n var dateTo = dayjs(ref);\n\n var relative = match[RELATIVE_WORD_GROUP];\n var startOf;\n switch(true) {\n case /secondes?/.test(relative):\n dateFrom = dateFrom.add(total, 's');\n dateTo = dateTo.add(modifierFactor, 's');\n startOf = 'second';\n break;\n case /min(?:ute)?s?/.test(relative):\n dateFrom = dateFrom.add(total, 'm');\n dateTo = dateTo.add(modifierFactor, 'm');\n startOf = 'minute';\n break;\n case /heures?/.test(relative):\n dateFrom = dateFrom.add(total, 'h');\n dateTo = dateTo.add(modifierFactor, 'h');\n startOf = 'hour';\n break;\n case /jours?/.test(relative):\n dateFrom = dateFrom.add(total, 'd');\n dateTo = dateTo.add(modifierFactor, 'd');\n startOf = 'day';\n break;\n case /semaines?/.test(relative):\n dateFrom = dateFrom.add(total, 'w');\n dateTo = dateTo.add(modifierFactor, 'w');\n startOf = 'week';\n break;\n case /mois?/.test(relative):\n dateFrom = dateFrom.add(total, 'M');\n dateTo = dateTo.add(modifierFactor, 'M');\n startOf = 'month';\n break;\n case /trimestres?/.test(relative):\n dateFrom = dateFrom.add(total, 'Q');\n dateTo = dateTo.add(modifierFactor, 'Q');\n startOf = 'quarter';\n break;\n case /années?/.test(relative):\n dateFrom = dateFrom.add(total, 'y');\n dateTo = dateTo.add(modifierFactor, 'y');\n startOf = 'year';\n break;\n }\n\n // if we go forward, switch the start and end dates\n if(modifierFactor > 0) {\n var dateTmp = dateFrom;\n dateFrom = dateTo;\n dateTo = dateTmp;\n }\n\n // Get start and end of dates\n dateFrom = dateFrom.startOf(startOf);\n dateTo = dateTo.endOf(startOf);\n if (startOf == 'week') { // Weekday in FR start on Sat?\n dateFrom = dateFrom.add(1, 'd')\n dateTo = dateTo.add(1, 'd')\n }\n \n\n // Assign results\n result.start.assign('year', dateFrom.year());\n result.start.assign('month', dateFrom.month() + 1);\n result.start.assign('day', dateFrom.date());\n result.start.assign('minute', dateFrom.minute());\n result.start.assign('second', dateFrom.second());\n result.start.assign('hour', dateFrom.hour());\n result.start.assign('millisecond', dateFrom.millisecond());\n\n result.end = result.start.clone();\n result.end.assign('year', dateTo.year());\n result.end.assign('month', dateTo.month() + 1);\n result.end.assign('day', dateTo.date());\n result.end.assign('minute', dateTo.minute());\n result.end.assign('second', dateTo.second());\n result.end.assign('hour', dateTo.hour());\n result.end.assign('millisecond', dateTo.millisecond());\n return result;\n };\n};\n","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs_plugin_quarterOfYear=n()}(this,function(){\"use strict\";var t=\"month\",n=\"quarter\";return function(r,i){var e=i.prototype;e.quarter=function(t){return this.$utils().u(t)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(t-1))};var u=e.add;e.add=function(r,i){return r=Number(r),this.$utils().p(i)===n?this.add(3*r,t):u.bind(this)(r,i)};var s=e.startOf;e.startOf=function(r,i){var e=this.$utils(),u=!!e.u(i)||i;if(e.p(r)===n){var a=this.quarter()-1;return u?this.month(3*a).startOf(t).startOf(\"day\"):this.month(3*a+2).endOf(t).endOf(\"day\")}return s.bind(this)(r,i)}}});\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar util = require('../../utils/ZH-Hant.js');\n\nvar PATTERN = new RegExp(\n '(\\\\d{2,4}|[' + Object.keys(util.NUMBER).join('') + ']{2,4})?' +\n '(?:\\\\s*)' +\n '(?:年)?' +\n '(?:[\\\\s|,|,]*)' +\n '(\\\\d{1,2}|[' + Object.keys(util.NUMBER).join('') + ']{1,2})' +\n '(?:\\\\s*)' +\n '(?:月)' +\n '(?:\\\\s*)' +\n '(\\\\d{1,2}|[' + Object.keys(util.NUMBER).join('') + ']{1,2})?' +\n '(?:\\\\s*)' +\n '(?:日|號)?'\n);\n\nvar YEAR_GROUP = 1;\nvar MONTH_GROUP = 2;\nvar DAY_GROUP = 3;\n\nexports.Parser = function ZHHantDateParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return PATTERN;\n };\n\n this.extract = function(text, ref, match, opt) {\n var startMoment = dayjs(ref);\n var result = new ParsedResult({\n text: match[0],\n index: match.index,\n ref: ref,\n });\n\n //Month\n var month = parseInt(match[MONTH_GROUP]);\n if (isNaN(month)) month = util.zhStringToNumber(match[MONTH_GROUP]);\n result.start.assign('month', month);\n\n //Day\n if (match[DAY_GROUP]) {\n var day = parseInt(match[DAY_GROUP]);\n if (isNaN(day)) day = util.zhStringToNumber(match[DAY_GROUP]);\n result.start.assign('day', day);\n } else {\n result.start.imply('day', startMoment.date());\n }\n\n //Year\n if (match[YEAR_GROUP]) {\n var year = parseInt(match[YEAR_GROUP]);\n if (isNaN(year)) year = util.zhStringToYear(match[YEAR_GROUP]);\n result.start.assign('year', year);\n } else {\n result.start.imply('year', startMoment.year());\n }\n\n result.tags.ZHHantDateParser = true;\n return result;\n };\n};\n","var Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar updateParsedComponent = require('../en/ENWeekdayParser').updateParsedComponent;\n\nvar util = require('../../utils/ZH-Hant.js');\n\nvar PATTERN = new RegExp(\n '(上|今|下|這|呢)?' +\n '(?:個)?' +\n '(?:星期|禮拜)' +\n '(' + Object.keys(util.WEEKDAY_OFFSET).join('|') + ')'\n);\n\nvar PREFIX_GROUP = 1;\nvar WEEKDAY_GROUP = 2;\n\nexports.Parser = function ZHHantWeekdayParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return PATTERN;\n };\n\n this.extract = function(text, ref, match, opt) {\n var index = match.index;\n text = match[0];\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var dayOfWeek = match[WEEKDAY_GROUP];\n var offset = util.WEEKDAY_OFFSET[dayOfWeek];\n if(offset === undefined) return null;\n\n var modifier = null;\n var prefix = match[PREFIX_GROUP];\n\n if(prefix == '上') {\n modifier = 'last';\n } else if(prefix == '下') {\n modifier = 'next';\n } else if(prefix == '今' || prefix == '這' || prefix == '呢') {\n modifier = 'this';\n }\n\n updateParsedComponent(result, ref, offset, modifier);\n result.tags['ZHHantWeekdayParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar ParsedComponents = require('../../result').ParsedComponents;\n\nvar util = require('../../utils/ZH-Hant.js');\n\nvar patternString1 = '(?:由|從|自)?' +\n '(?:' +\n '(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|' +\n '(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|' +\n '(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)' +\n '(?:[\\\\s,,]*)' +\n '(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?' +\n ')?' +\n '(?:[\\\\s,,]*)' +\n '(?:(\\\\d+|[' + Object.keys(util.NUMBER).join('') + ']+)(?:\\\\s*)(?:點|時|:|:)' +\n '(?:\\\\s*)' +\n '(\\\\d+|半|正|整|[' + Object.keys(util.NUMBER).join('') + ']+)?(?:\\\\s*)(?:分|:|:)?' +\n '(?:\\\\s*)' +\n '(\\\\d+|[' + Object.keys(util.NUMBER).join('') + ']+)?(?:\\\\s*)(?:秒)?)' +\n '(?:\\\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?';\n\nvar patternString2 = '(?:^\\\\s*(?:到|至|\\\\-|\\\\–|\\\\~|\\\\〜)\\\\s*)' +\n '(?:' +\n '(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|' +\n '(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|' +\n '(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)' +\n '(?:[\\\\s,,]*)' +\n '(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?' +\n ')?' +\n '(?:[\\\\s,,]*)' +\n '(?:(\\\\d+|[' + Object.keys(util.NUMBER).join('') + ']+)(?:\\\\s*)(?:點|時|:|:)' +\n '(?:\\\\s*)' +\n '(\\\\d+|半|正|整|[' + Object.keys(util.NUMBER).join('') + ']+)?(?:\\\\s*)(?:分|:|:)?' +\n '(?:\\\\s*)' +\n '(\\\\d+|[' + Object.keys(util.NUMBER).join('') + ']+)?(?:\\\\s*)(?:秒)?)' +\n '(?:\\\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?';\n\nvar FIRST_REG_PATTERN = new RegExp(patternString1, 'i');\nvar SECOND_REG_PATTERN = new RegExp(patternString2, 'i');\n\nvar DAY_GROUP_1 = 1;\nvar ZH_AM_PM_HOUR_GROUP_1 = 2;\nvar ZH_AM_PM_HOUR_GROUP_2 = 3;\nvar DAY_GROUP_3 = 4;\nvar ZH_AM_PM_HOUR_GROUP_3 = 5;\nvar HOUR_GROUP = 6;\nvar MINUTE_GROUP = 7;\nvar SECOND_GROUP = 8;\nvar AM_PM_HOUR_GROUP = 9;\n\nexports.Parser = function ZHHantTimeExpressionParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return FIRST_REG_PATTERN;\n };\n\n this.extract = function(text, ref, match, opt) {\n\n // This pattern can be overlaped Ex. [12] AM, 1[2] AM\n if (match.index > 0 && text[match.index - 1].match(/\\w/)) return null;\n var refMoment = dayjs(ref);\n var result = new ParsedResult();\n result.ref = ref;\n result.index = match.index;\n result.text = match[0];\n result.tags.ZHTimeExpressionParser = true;\n\n var startMoment = refMoment.clone();\n\n // ----- Day\n if (match[DAY_GROUP_1]) {\n var day1 = match[DAY_GROUP_1];\n if (day1 == '明' || day1 == '聽') {\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n startMoment.add(1, 'day');\n }\n } else if (day1 == '昨' || day1 == '尋' || day1 == '琴') {\n startMoment.add(-1, 'day');\n } else if (day1 == \"前\"){\n startMoment.add(-2, 'day');\n } else if (day1 == \"大前\"){\n startMoment.add(-3, 'day');\n } else if (day1 == \"後\"){\n startMoment.add(2, 'day');\n } else if (day1 == \"大後\"){\n startMoment.add(3, 'day');\n }\n result.start.assign('day', startMoment.date());\n result.start.assign('month', startMoment.month() + 1);\n result.start.assign('year', startMoment.year());\n } else if (match[DAY_GROUP_3]) {\n var day3 = match[DAY_GROUP_3];\n if (day3 == '明' || day3 == '聽') {\n startMoment.add(1, 'day');\n } else if (day3 == '昨' || day3 == '尋' || day3 == '琴') {\n startMoment.add(-1, 'day');\n } else if (day3 == \"前\"){\n startMoment.add(-2, 'day');\n } else if (day3 == \"大前\"){\n startMoment.add(-3, 'day');\n } else if (day3 == \"後\"){\n startMoment.add(2, 'day');\n } else if (day3 == \"大後\"){\n startMoment.add(3, 'day');\n }\n result.start.assign('day', startMoment.date());\n result.start.assign('month', startMoment.month() + 1);\n result.start.assign('year', startMoment.year());\n } else {\n result.start.imply('day', startMoment.date());\n result.start.imply('month', startMoment.month() + 1);\n result.start.imply('year', startMoment.year());\n }\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if (match[SECOND_GROUP]) {\n var second = parseInt(match[SECOND_GROUP]);\n if (isNaN(second)) {\n second = util.zhStringToNumber(match[SECOND_GROUP]);\n }\n if (second >= 60) return null;\n result.start.assign('second', second);\n }\n\n hour = parseInt(match[HOUR_GROUP]);\n if (isNaN(hour)) {\n hour = util.zhStringToNumber(match[HOUR_GROUP]);\n }\n\n // ----- Minutes\n if (match[MINUTE_GROUP]) {\n if (match[MINUTE_GROUP] == '半') {\n minute = 30;\n } else if (match[MINUTE_GROUP] == '正' || match[MINUTE_GROUP] == '整') {\n minute = 0;\n } else {\n minute = parseInt(match[MINUTE_GROUP]);\n if (isNaN(minute)) {\n minute = util.zhStringToNumber(match[MINUTE_GROUP]);\n }\n }\n } else if (hour > 100) {\n minute = hour % 100;\n hour = parseInt(hour / 100);\n }\n\n if (minute >= 60) {\n return null;\n }\n\n if (hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP]) {\n if (hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if (ampm == \"a\") {\n meridiem = 0;\n if (hour == 12) hour = 0;\n }\n\n if (ampm == \"p\") {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n } else if (match[ZH_AM_PM_HOUR_GROUP_1]) {\n var zhAMPMString1 = match[ZH_AM_PM_HOUR_GROUP_1];\n var zhAMPM1 = zhAMPMString1[0];\n if (zhAMPM1 == '朝' || zhAMPM1 == '早') {\n meridiem = 0;\n if (hour == 12) hour = 0;\n } else if (zhAMPM1 == '晚') {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n } else if (match[ZH_AM_PM_HOUR_GROUP_2]) {\n var zhAMPMString2 = match[ZH_AM_PM_HOUR_GROUP_2];\n var zhAMPM2 = zhAMPMString2[0];\n if (zhAMPM2 == '上' || zhAMPM2 == '朝' || zhAMPM2 == '早' || zhAMPM2 == '凌') {\n meridiem = 0;\n if (hour == 12) hour = 0;\n } else if (zhAMPM2 == '下' || zhAMPM2 == '晏' || zhAMPM2 == '晚') {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n } else if (match[ZH_AM_PM_HOUR_GROUP_3]) {\n var zhAMPMString3 = match[ZH_AM_PM_HOUR_GROUP_3];\n var zhAMPM3 = zhAMPMString3[0];\n if (zhAMPM3 == '上' || zhAMPM3 == '朝' || zhAMPM3 == '早' || zhAMPM3 == '凌') {\n meridiem = 0;\n if (hour == 12) hour = 0;\n } else if (zhAMPM3 == '下' || zhAMPM3 == '晏' || zhAMPM3 == '晚') {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n }\n\n result.start.assign('hour', hour);\n result.start.assign('minute', minute);\n\n if (meridiem >= 0) {\n result.start.assign('meridiem', meridiem);\n } else {\n if (hour < 12) {\n result.start.imply('meridiem', 0);\n } else {\n result.start.imply('meridiem', 1);\n }\n }\n\n // ==============================================================\n // Extracting the 'to' chunk\n // ==============================================================\n\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n // Not accept number only result\n if (result.text.match(/^\\d+$/)) {\n return null;\n }\n return result;\n }\n\n var endMoment = startMoment.clone();\n result.end = new ParsedComponents(null, null);\n\n // ----- Day\n if (match[DAY_GROUP_1]) {\n var day1 = match[DAY_GROUP_1];\n if (day1 == '明' || day1 == '聽') {\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n endMoment.add(1, 'day');\n }\n } else if (day1 == '昨' || day1 == '尋' || day1 == '琴') {\n endMoment.add(-1, 'day');\n } else if (day1 == \"前\"){\n endMoment.add(-2, 'day');\n } else if (day1 == \"大前\"){\n endMoment.add(-3, 'day');\n } else if (day1 == \"後\"){\n endMoment.add(2, 'day');\n } else if (day1 == \"大後\"){\n endMoment.add(3, 'day');\n }\n result.end.assign('day', endMoment.date());\n result.end.assign('month', endMoment.month() + 1);\n result.end.assign('year', endMoment.year());\n } else if (match[DAY_GROUP_3]) {\n var day3 = match[DAY_GROUP_3];\n if (day3 == '明' || day3 == '聽') {\n endMoment.add(1, 'day');\n } else if (day3 == '昨' || day3 == '尋' || day3 == '琴') {\n endMoment.add(-1, 'day');\n } else if (day3 == \"前\"){\n endMoment.add(-2, 'day');\n } else if (day3 == \"大前\"){\n endMoment.add(-3, 'day');\n } else if (day3 == \"後\"){\n endMoment.add(2, 'day');\n } else if (day3 == \"大後\"){\n endMoment.add(3, 'day');\n }\n result.end.assign('day', endMoment.date());\n result.end.assign('month', endMoment.month() + 1);\n result.end.assign('year', endMoment.year());\n } else {\n result.end.imply('day', endMoment.date());\n result.end.imply('month', endMoment.month() + 1);\n result.end.imply('year', endMoment.year());\n }\n\n hour = 0;\n minute = 0;\n meridiem = -1;\n\n // ----- Second\n if (match[SECOND_GROUP]) {\n var second = parseInt(match[SECOND_GROUP]);\n if (isNaN(second)) {\n second = util.zhStringToNumber(match[SECOND_GROUP]);\n }\n\n if (second >= 60) return null;\n result.end.assign('second', second);\n }\n\n hour = parseInt(match[HOUR_GROUP]);\n if (isNaN(hour)) {\n hour = util.zhStringToNumber(match[HOUR_GROUP]);\n }\n\n // ----- Minutes\n if (match[MINUTE_GROUP]) {\n if (match[MINUTE_GROUP] == '半') {\n minute = 30;\n } else if (match[MINUTE_GROUP] == '正' || match[MINUTE_GROUP] == '整') {\n minute = 0;\n } else {\n minute = parseInt(match[MINUTE_GROUP]);\n if (isNaN(minute)) {\n minute = util.zhStringToNumber(match[MINUTE_GROUP]);\n }\n }\n } else if (hour > 100) {\n minute = hour % 100;\n hour = parseInt(hour / 100);\n }\n\n if (minute >= 60) {\n return null;\n }\n\n if (hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP]) {\n if (hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();\n if (ampm == \"a\") {\n meridiem = 0;\n if (hour == 12) hour = 0;\n }\n\n if (ampm == \"p\") {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n\n if (!result.start.isCertain('meridiem')) {\n if (meridiem == 0) {\n\n result.start.imply('meridiem', 0);\n\n if (result.start.get('hour') == 12) {\n result.start.assign('hour', 0);\n }\n\n } else {\n\n result.start.imply('meridiem', 1);\n\n if (result.start.get('hour') != 12) {\n result.start.assign('hour', result.start.get('hour') + 12);\n }\n }\n }\n\n } else if (match[ZH_AM_PM_HOUR_GROUP_1]) {\n var zhAMPMString1 = match[ZH_AM_PM_HOUR_GROUP_1];\n var zhAMPM1 = zhAMPMString1[0];\n if (zhAMPM1 == '朝' || zhAMPM1 == '早') {\n meridiem = 0;\n if (hour == 12) hour = 0;\n } else if (zhAMPM1 == '晚') {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n } else if (match[ZH_AM_PM_HOUR_GROUP_2]) {\n var zhAMPMString2 = match[ZH_AM_PM_HOUR_GROUP_2];\n var zhAMPM2 = zhAMPMString2[0];\n if (zhAMPM2 == '上' || zhAMPM2 == '朝' || zhAMPM2 == '早' || zhAMPM2 == '凌') {\n meridiem = 0;\n if (hour == 12) hour = 0;\n } else if (zhAMPM2 == '下' || zhAMPM2 == '晏' || zhAMPM2 == '晚') {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n } else if (match[ZH_AM_PM_HOUR_GROUP_3]) {\n var zhAMPMString3 = match[ZH_AM_PM_HOUR_GROUP_3];\n var zhAMPM3 = zhAMPMString3[0];\n if (zhAMPM3 == '上' || zhAMPM3 == '朝' || zhAMPM3 == '早' || zhAMPM3 == '凌') {\n meridiem = 0;\n if (hour == 12) hour = 0;\n } else if (zhAMPM3 == '下' || zhAMPM3 == '晏' || zhAMPM3 == '晚') {\n meridiem = 1;\n if (hour != 12) hour += 12;\n }\n }\n\n result.text = result.text + match[0];\n result.end.assign('hour', hour);\n result.end.assign('minute', minute);\n if (meridiem >= 0) {\n result.end.assign('meridiem', meridiem);\n } else {\n var startAtPM = result.start.isCertain('meridiem') && result.start.get('meridiem') == 1;\n if (startAtPM && result.start.get('hour') > hour) {\n // 10pm - 1 (am)\n result.end.imply('meridiem', 0);\n\n } else if (hour > 12) {\n result.end.imply('meridiem', 1);\n }\n }\n\n if (result.end.date().getTime() < result.start.date().getTime()) {\n result.end.imply('day', result.end.get('day') + 1)\n }\n\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp(\n '(而家|立(?:刻|即)|即刻)|' +\n '(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|' +\n '(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|' +\n '(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)' +\n '(?:[\\\\s|,|,]*)' +\n '(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?', 'i');\n\nvar NOW_GROUP = 1;\nvar DAY_GROUP_1 = 2;\nvar TIME_GROUP_1 = 3;\nvar TIME_GROUP_2 = 4;\nvar DAY_GROUP_3 = 5;\nvar TIME_GROUP_3 = 6;\n\nexports.Parser = function ZHHantCasualDateParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return PATTERN;\n };\n\n this.extract = function(text, ref, match, opt) {\n text = match[0];\n var index = match.index;\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var refMoment = dayjs(ref);\n var startMoment = refMoment;\n\n if (match[NOW_GROUP]) {\n result.start.imply('hour', refMoment.hour());\n result.start.imply('minute', refMoment.minute());\n result.start.imply('second', refMoment.second());\n result.start.imply('millisecond', refMoment.millisecond());\n } else if (match[DAY_GROUP_1]) {\n var day1 = match[DAY_GROUP_1];\n var time1 = match[TIME_GROUP_1];\n\n if (day1 == '明' || day1 == '聽') {\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n } else if (day1 == '昨' || day1 == '尋' || day1 == '琴') {\n startMoment = startMoment.add(-1, 'day');\n } else if (day1 == \"前\"){\n startMoment = startMoment.add(-2, 'day');\n } else if (day1 == \"大前\"){\n startMoment = startMoment.add(-3, 'day');\n } else if ( day1 == \"後\"){\n startMoment = startMoment.add(2, 'day');\n } else if (day1 == \"大後\"){\n startMoment = startMoment.add(3, 'day');\n }\n\n if (time1 == '早' || time1 == '朝') {\n result.start.imply('hour', 6);\n } else if (time1 == '晚') {\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n }\n\n } else if (match[TIME_GROUP_2]) {\n var timeString2 = match[TIME_GROUP_2];\n var time2 = timeString2[0];\n if (time2 == '早' || time2 == '朝' || time2 == '上') {\n result.start.imply('hour', 6);\n } else if (time2 == '下' || time2 == '晏') {\n result.start.imply('hour', 15);\n result.start.imply('meridiem', 1);\n } else if (time2 == '中') {\n result.start.imply('hour', 12);\n result.start.imply('meridiem', 1);\n } else if (time2 == '夜' || time2 == '晚') {\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n } else if (time2 == '凌') {\n result.start.imply('hour', 0);\n }\n\n } else if (match[DAY_GROUP_3]) {\n var day3 = match[DAY_GROUP_3];\n\n if (day3 == '明' || day3 == '聽') {\n // Check not \"Tomorrow\" on late night\n if(refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n } else if (day3 == '昨' || day3 == '尋' || day3 == '琴') {\n startMoment = startMoment.add(-1, 'day');\n } else if (day3 == \"前\"){\n startMoment = startMoment.add(-2, 'day');\n } else if (day3 == \"大前\"){\n startMoment = startMoment.add(-3, 'day');\n } else if (day3 == \"後\"){\n startMoment = startMoment.add(2, 'day');\n } else if (day3 == \"大後\"){\n startMoment = startMoment.add(3, 'day');\n }\n\n\n var timeString3 = match[TIME_GROUP_3];\n if (timeString3) {\n var time3 = timeString3[0];\n if (time3 == '早' || time3 == '朝' || time3 == '上') {\n result.start.imply('hour', 6);\n } else if (time3 == '下' || time3 == '晏') {\n result.start.imply('hour', 15);\n result.start.imply('meridiem', 1);\n } else if (time3 == '中') {\n result.start.imply('hour', 12);\n result.start.imply('meridiem', 1);\n } else if (time3 == '夜' || time3 == '晚') {\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n } else if (time3 == '凌') {\n result.start.imply('hour', 0);\n }\n }\n }\n\n result.start.assign('day', startMoment.date())\n result.start.assign('month', startMoment.month() + 1)\n result.start.assign('year', startMoment.year())\n result.tags.ZHHantCasualDateParser = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar util = require('../../utils/ZH-Hant.js');\n\nvar PATTERN = new RegExp(\n '(\\\\d+|[' + Object.keys(util.NUMBER).join('') + ']+|半|幾)(?:\\\\s*)' +\n '(?:個)?' +\n '(秒(?:鐘)?|分鐘|小時|鐘|日|天|星期|禮拜|月|年)' +\n '(?:(?:之|過)?後|(?:之)?內)', 'i'\n);\n\nvar NUMBER_GROUP = 1;\nvar UNIT_GROUP = 2;\n\nexports.Parser = function ZHHantCasualDateParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return PATTERN;\n };\n\n this.extract = function(text, ref, match, opt) {\n var index = match.index;\n text = match[0];\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var number = parseInt(match[NUMBER_GROUP]);\n if (isNaN(number)){\n number = util.zhStringToNumber(match[NUMBER_GROUP]);\n }\n\n if (isNaN(number)){\n var string = match[NUMBER_GROUP];\n if (string === '幾'){\n number = 3;\n }else if(string === '半'){\n number = 0.5;\n }else{\n\n //just in case\n return null;\n }\n }\n\n var date = dayjs(ref);\n var unit = match[UNIT_GROUP];\n var unitAbbr = unit[0];\n\n if (unitAbbr.match(/[日天星禮月年]/)){\n if(unitAbbr == '日' || unitAbbr == '天'){\n date = date.add(number, 'd');\n }else if(unitAbbr == '星' || unitAbbr == '禮'){\n date = date.add(number * 7, 'd');\n }else if(unitAbbr == '月'){\n date = date.add(number, 'month');\n }else if(unitAbbr == '年'){\n date = date.add(number, 'year');\n }\n\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n return result;\n }\n\n if(unitAbbr == '秒'){\n date = date.add(number, 'second');\n }else if(unitAbbr == '分'){\n date = date.add(number, 'minute');\n }else if(unitAbbr == '小' || unitAbbr == '鐘'){\n date = date.add(number, 'hour');\n }\n\n result.start.imply('year', date.year());\n result.start.imply('month', date.month() + 1);\n result.start.imply('day', date.date());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.start.assign('second', date.second());\n result.tags.ZHHantDeadlineFormatParser = true;\n return result;\n };\n};\n","/*\n\n\n*/\n\nvar dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/DE');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(in|nach)\\\\s*' +\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|einigen|eine[rm]\\\\s*halben|eine[rm])\\\\s*' +\n '(sekunden?|min(?:ute)?n?|stunden?|tag(?:en)?|wochen?|monat(?:en)?|jahr(?:en)?)\\\\s*' +\n '(?=\\\\W|$)', 'i'\n);\n\nvar STRICT_PATTERN = new RegExp('(\\\\W|^)' +\n '(in|nach)\\\\s*' +\n '('+ util.INTEGER_WORDS_PATTERN + '|[0-9]+|eine(?:r|m)?)\\\\s*' +\n '(sekunden?|minuten?|stunden?|tag(?:en)?)\\\\s*' +\n '(?=\\\\W|$)', 'i'\n);\n\nexports.Parser = function DEDeadlineFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return this.isStrictMode()? STRICT_PATTERN : PATTERN;\n };\n\n this.extract = function(text, ref, match, opt){\n\n var index = match.index + match[1].length;\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var num = match[3].toLowerCase();\n if (util.INTEGER_WORDS[num] !== undefined) {\n num = util.INTEGER_WORDS[num];\n } else if (num === 'einer' || num === 'einem') {\n num = 1;\n } else if (num === 'einigen') {\n num = 3;\n } else if (/halben/.test(num)) {\n num = 0.5;\n } else {\n num = parseInt(num);\n }\n\n var date = dayjs(ref);\n if (/tag|woche|monat|jahr/i.test(match[4])) {\n\n if (/tag/i.test(match[4])) {\n date = date.add(num, 'd');\n } else if (/woche/i.test(match[4])) {\n date = date.add(num * 7, 'd');\n } else if (/monat/i.test(match[4])) {\n date = date.add(num, 'month');\n } else if (/jahr/i.test(match[4])) {\n date = date.add(num, 'year');\n }\n\n result.start.assign('year', date.year());\n result.start.assign('month', date.month() + 1);\n result.start.assign('day', date.date());\n return result;\n }\n\n if (/stunde/i.test(match[4])) {\n\n date = date.add(num, 'hour');\n\n } else if (/min/i.test(match[4])) {\n\n date = date.add(num, 'minute');\n\n } else if (/sekunde/i.test(match[4])) {\n\n date = date.add(num, 'second');\n }\n\n result.start.imply('year', date.year());\n result.start.imply('month', date.month() + 1);\n result.start.imply('day', date.date());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.start.assign('second', date.second());\n result.tags['DEDeadlineFormatParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nconst parser = require('../parser');\nconst ParsedResult = require('../../result').ParsedResult;\nconst util = require('../../utils/DE');\n\nconst PATTERN = new RegExp('(\\\\W|^)' +\n '(?:am\\\\s*?)?' +\n '(?:(Sonntag|Montag|Dienstag|Mittwoch|Donnerstag|Freitag|Samstag|So|Mo|Di|Mi|Do|Fr|Sa)\\\\s*,?\\\\s*)?' +\n '(?:den\\\\s*)?' +\n '([0-9]{1,2})\\\\.' +\n '(?:\\\\s*(?:bis(?:\\\\s*(?:am|zum))?|\\\\-|\\\\–|\\\\s)\\\\s*([0-9]{1,2})\\\\.)?\\\\s*' +\n '(Jan(?:uar|\\\\.)?|Feb(?:ruar|\\\\.)?|Mär(?:z|\\\\.)?|Maerz|Mrz\\\\.?|Apr(?:il|\\\\.)?|Mai|Jun(?:i|\\\\.)?|Jul(?:i|\\\\.)?|Aug(?:ust|\\\\.)?|Sep(?:t|t\\\\.|tember|\\\\.)?|Okt(?:ober|\\\\.)?|Nov(?:ember|\\\\.)?|Dez(?:ember|\\\\.)?)' +\n '(?:' +\n ',?\\\\s*([0-9]{1,4}(?![^\\\\s]\\\\d))' +\n '(\\\\s*[vn]\\\\.?\\\\s*C(?:hr)?\\\\.?)?' +\n ')?' +\n '(?=\\\\W|$)', 'i'\n );\n\nconst WEEKDAY_GROUP = 2;\nconst DATE_GROUP = 3;\nconst DATE_TO_GROUP = 4;\nconst MONTH_NAME_GROUP = 5;\nconst YEAR_GROUP = 6;\nconst YEAR_BE_GROUP = 7;\n\nexports.Parser = function DEMonthNameLittleEndianParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n const result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n\n var day = match[DATE_GROUP];\n day = parseInt(day);\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n year = parseInt(year);\n\n if(match[YEAR_BE_GROUP]){\n if (/v/i.test(match[YEAR_BE_GROUP])) {\n // v.Chr.\n year = -year;\n }\n } else if (year < 100){\n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month);\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n // Weekday component\n if (match[WEEKDAY_GROUP]) {\n var weekday = match[WEEKDAY_GROUP];\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()]\n result.start.assign('weekday', weekday);\n }\n\n // Text can be 'range' value. Such as '12 - 13 January 2012'\n if (match[DATE_TO_GROUP]) {\n result.end = result.start.clone();\n result.end.assign('day', parseInt(match[DATE_TO_GROUP]));\n }\n\n result.tags['DEMonthNameLittleEndianParser'] = true;\n return result;\n };\n}\n","/*\n \n The parser for parsing month name and year.\n \n EX. \n - Januar\n - Januar 2012\n*/\n\nconst parser = require('../parser');\nconst ParsedResult = require('../../result').ParsedResult;\nconst util = require('../../utils/DE');\n\nconst PATTERN = new RegExp('(^|\\\\D\\\\s+|[^\\\\w\\\\s])' +\n '(Jan\\\\.?|Januar|Feb\\\\.?|Februar|Mär\\\\.?|M(?:ä|ae)rz|Mrz\\\\.?|Apr\\\\.?|April|Mai\\\\.?|Jun\\\\.?|Juni|Jul\\\\.?|Juli|Aug\\\\.?|August|Sep\\\\.?|Sept\\\\.?|September|Okt\\\\.?|Oktober|Nov\\\\.?|November|Dez\\\\.?|Dezember)' + \n '\\\\s*' +\n '(?:' +\n ',?\\\\s*(?:([0-9]{4})(\\\\s*[vn]\\\\.?\\\\s*C(?:hr)?\\\\.?)?|([0-9]{1,4})\\\\s*([vn]\\\\.?\\\\s*C(?:hr)?\\\\.?))' +\n ')?' +\n '(?=[^\\\\s\\\\w]|$)', 'i');\n\nconst MONTH_NAME_GROUP = 2;\nconst YEAR_GROUP = 3;\nconst YEAR_BE_GROUP = 4;\nconst YEAR_GROUP2 = 5;\nconst YEAR_BE_GROUP2 = 6;\n\nexports.Parser = function ENMonthNameParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n \n this.extract = function(text, ref, match, opt){\n var result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n \n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n\n var day = 1;\n\n var year = null;\n if (match[YEAR_GROUP] || match[YEAR_GROUP2]) {\n year = match[YEAR_GROUP] || match[YEAR_GROUP2];\n year = parseInt(year);\n\n if (match[YEAR_BE_GROUP] || match[YEAR_BE_GROUP2]) {\n if (/v/i.test(match[YEAR_BE_GROUP] || match[YEAR_BE_GROUP2])) {\n // v.Chr.\n year = -year;\n }\n\n } else if (year < 100){ \n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n \n year = parser.findYearClosestToRef(ref, day, month);\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n if (this.isStrictMode() && result.text.match(/^\\w+$/)) {\n return false;\n }\n\n result.tags['DEMonthNameParser'] = true;\n return result;\n }\n}\n\n","/*\n Date format with slash \"/\" (also \"-\" and \".\") between numbers\n - Tuesday 11/3/2015\n - 11/3/2015\n - 11/3\n*/\nvar dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:' +\n '(?:am\\\\s*?)?' +\n '((?:sonntag|so|montag|mo|dienstag|di|mittwoch|mi|donnerstag|do|freitag|fr|samstag|sa))' +\n '\\\\s*\\\\,?\\\\s*' +\n '(?:den\\\\s*)?' +\n ')?' +\n '([0-3]{0,1}[0-9]{1})[\\\\/\\\\.\\\\-]([0-3]{0,1}[0-9]{1})' +\n '(?:' +\n '[\\\\/\\\\.\\\\-]' +\n '([0-9]{4}\\s*\\,?\\s*|[0-9]{2}\\s*\\,?\\s*)' +\n ')?' +\n '(\\\\W|$)', 'i');\n\nvar DAYS_OFFSET = {\n 'sonntag': 0, 'so': 0,\n 'montag': 1, 'mo': 1,\n 'dienstag': 2, 'di': 2,\n 'mittwoch': 3, 'mi': 3,\n 'donnerstag': 4, 'do': 4,\n 'freitag': 5, 'fr': 5,\n 'samstag': 6, 'sa': 6\n};\n\n\nvar OPENNING_GROUP = 1;\nvar ENDING_GROUP = 6;\n\nvar WEEKDAY_GROUP = 2;\nvar DAY_GROUP = 3;\nvar MONTH_GROUP = 4;\nvar YEAR_GROUP = 5;\n\nexports.Parser = function DESlashDateFormatParser(argument) {\n Parser.apply(this, arguments);\n\n this.pattern = function () { return PATTERN; };\n this.extract = function(text, ref, match, opt){\n\n if(match[OPENNING_GROUP] == '/' || match[ENDING_GROUP] == '/') {\n // Long skip, if there is some overlapping like:\n // XX[/YY/ZZ]\n // [XX/YY/]ZZ\n match.index += match[0].length\n return;\n }\n\n var index = match.index + match[OPENNING_GROUP].length;\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length - match[ENDING_GROUP].length);\n\n\n var result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n });\n\n if(text.match(/^\\d\\.\\d$/)) return;\n if(text.match(/^\\d\\.\\d{1,2}\\.\\d{1,2}$/)) return;\n\n // MM/dd -> OK\n // MM.dd -> NG\n if(!match[YEAR_GROUP] && match[0].indexOf('/') < 0) return;\n\n var year = match[YEAR_GROUP] || dayjs(ref).year() + '';\n var month = match[MONTH_GROUP];\n var day = match[DAY_GROUP];\n\n month = parseInt(month);\n day = parseInt(day);\n year = parseInt(year);\n\n if (month < 1 || month > 12) return null;\n if(day < 1 || day > 31) return null;\n\n if(year < 100){\n if (year > 50) {\n year = year + 1900;\n } else {\n year = year + 2000;\n }\n }\n\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n\n //Day of week\n if(match[WEEKDAY_GROUP]) {\n result.start.assign('weekday', DAYS_OFFSET[match[WEEKDAY_GROUP].toLowerCase()]);\n }\n\n result.tags['DESlashDateFormatParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/DE');\n\nvar PATTERN = new RegExp('' +\n '(\\\\W|^)vor\\\\s*' +\n '(' + util.INTEGER_WORDS_PATTERN + '|[0-9]+|einigen|eine[rm]\\\\s*halben|eine[rm])\\\\s*' +\n '(sekunden?|min(?:ute)?n?|stunden?|wochen?|tag(?:en)?|monat(?:en)?|jahr(?:en)?)\\\\s*' +\n '(?=(?:\\\\W|$))', 'i');\n\nvar STRICT_PATTERN = new RegExp('' +\n '(\\\\W|^)vor\\\\s*' +\n '([0-9]+|eine(?:r|m))\\\\s*' +\n '(sekunden?|minuten?|stunden?|tag(?:en)?)' +\n '(?=(?:\\\\W|$))', 'i');\n\nexports.Parser = function DETimeAgoFormatParser(){\n Parser.apply(this, arguments);\n\n this.pattern = function() {\n return this.isStrictMode()? STRICT_PATTERN : PATTERN;\n };\n\n this.extract = function(text, ref, match, opt){\n\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n\n var text = match[0];\n text = match[0].substr(match[1].length, match[0].length - match[1].length);\n let index = match.index + match[1].length;\n\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var num = match[2].toLowerCase() ;\n if (util.INTEGER_WORDS[num] !== undefined) {\n num = util.INTEGER_WORDS[num];\n } else if (num === 'einer' || num === 'einem') {\n num = 1;\n } else if (num === 'einigen') {\n num = 3;\n } else if (/halben/.test(num)) {\n num = 0.5;\n } else {\n num = parseInt(num);\n }\n\n var date = dayjs(ref);\n\n if (/stunde|min|sekunde/i.test(match[3])) {\n if (/stunde/i.test(match[3])) {\n\n date = date.add(-num, 'hour');\n\n } else if (/min/i.test(match[3])) {\n\n date = date.add(-num, 'minute');\n\n } else if (/sekunde/i.test(match[3])) {\n\n date = date.add(-num, 'second');\n }\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n result.start.assign('hour', date.hour());\n result.start.assign('minute', date.minute());\n result.start.assign('second', date.second());\n result.tags['DETimeAgoFormatParser'] = true;\n return result;\n }\n\n if (/woche/i.test(match[3])) {\n date = date.add(-num, 'week');\n\n result.start.imply('day', date.date());\n result.start.imply('month', date.month() + 1);\n result.start.imply('year', date.year());\n result.start.imply('weekday', date.day());\n return result;\n }\n\n if (/tag/i.test(match[3])) {\n date = date.add(-num, 'd');\n }\n\n if (/monat/i.test(match[3])) {\n date = date.add(-num, 'month');\n }\n\n if (/jahr/i.test(match[3])) {\n\n date = date.add(-num, 'year');\n }\n\n result.start.assign('day', date.date());\n result.start.assign('month', date.month() + 1);\n result.start.assign('year', date.year());\n return result;\n\n };\n}\n","/*\n\n\n*/\n\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar ParsedComponents = require('../../result').ParsedComponents;\n\nvar FIRST_REG_PATTERN = new RegExp(\"(^|\\\\s|T)\" +\n \"(?:(?:um|von)\\\\s*)?\" +\n \"(\\\\d{1,4}|mittags?|mitternachts?)\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\:|\\\\:)(\\\\d{2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*uhr)?\" +\n \"(?:\\\\s*(morgens|vormittags|mittags|nachmittags|abends|nachts))?\" +\n \"(?=\\\\W|$)\", 'i');\n\n\nvar SECOND_REG_PATTERN = new RegExp(\"^\\\\s*\" +\n \"(\\\\-|\\\\–|\\\\~|\\\\〜|bis|\\\\?)\\\\s*\" +\n \"(\\\\d{1,4})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(morgens|vormittags|mittags|nachmittags|abends|nachts))?\" +\n \"(?=\\\\W|$)\", 'i');\n\nvar HOUR_GROUP = 2;\nvar MINUTE_GROUP = 3;\nvar SECOND_GROUP = 4;\nvar AM_PM_HOUR_GROUP = 5;\n\n\nexports.Parser = function DETimeExpressionParser() {\n Parser.apply(this, arguments);\n\n this.pattern = function() { return FIRST_REG_PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n // This pattern can be overlaped Ex. [12] AM, 1[2] AM\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n var refMoment = dayjs(ref);\n var result = new ParsedResult();\n result.ref = ref;\n result.index = match.index + match[1].length;\n result.text = match[0].substring(match[1].length);\n result.tags['DETimeExpressionParser'] = true;\n\n result.start.imply('day', refMoment.date());\n result.start.imply('month', refMoment.month()+1);\n result.start.imply('year', refMoment.year());\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.start.assign('second', second);\n }\n\n // ----- Hours\n if (/mittags?/i.test(match[HOUR_GROUP])) {\n meridiem = 1;\n hour = 12;\n } else if (/mitternachts?/i.test(match[HOUR_GROUP])) {\n meridiem = 0;\n hour = 0;\n } else {\n hour = parseInt(match[HOUR_GROUP]);\n }\n\n // ----- Minutes\n if(match[MINUTE_GROUP] != null){\n minute = parseInt(match[MINUTE_GROUP]);\n } else if(hour > 100) {\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP] != null) {\n if (hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP].toLowerCase();\n if (ampm === 'morgens' || ampm === 'vormittags') {\n meridiem = 0;\n if(hour == 12) hour = 0;\n } else {\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n }\n\n result.start.assign('hour', hour);\n result.start.assign('minute', minute);\n\n if (meridiem >= 0) {\n result.start.assign('meridiem', meridiem);\n } else {\n if (hour < 12) {\n result.start.imply('meridiem', 0);\n } else {\n result.start.imply('meridiem', 1);\n }\n }\n\n // ==============================================================\n // Extracting the 'to' chunk\n // ==============================================================\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n // Not accept number only result\n if (result.text.match(/^\\d+$/)) {\n return null;\n }\n return result;\n }\n\n\n\n // Pattern \"YY.YY -XXXX\" is more like timezone offset\n if (match[0].match(/^\\s*(\\+|\\-)\\s*\\d{3,4}$/)) {\n return result;\n }\n\n if(result.end == null){\n result.end = new ParsedComponents(null, result.start.date());\n }\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.end.assign('second', second);\n }\n\n hour = parseInt(match[2]);\n\n // ----- Minute\n if (match[MINUTE_GROUP]!= null) {\n\n minute = parseInt(match[MINUTE_GROUP]);\n if(minute >= 60) return result;\n\n } else if (hour > 100) {\n\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP] != null) {\n\n if (hour > 12) return null;\n\n var ampm = match[AM_PM_HOUR_GROUP].toLowerCase();\n if (ampm === 'morgens' || ampm === 'vormittags') {\n meridiem = 0;\n if(hour == 12) {\n hour = 0;\n if (!result.end.isCertain('day')) {\n result.end.imply('day', result.end.get('day') + 1);\n }\n }\n } else {\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n\n if (!result.start.isCertain('meridiem')) {\n if (meridiem == 0) {\n\n result.start.imply('meridiem', 0);\n\n if (result.start.get('hour') == 12) {\n result.start.assign('hour', 0);\n }\n\n } else {\n\n result.start.imply('meridiem', 1);\n\n if (result.start.get('hour') != 12) {\n result.start.assign('hour', result.start.get('hour') + 12);\n }\n }\n }\n }\n\n result.text = result.text + match[0];\n result.end.assign('hour', hour);\n result.end.assign('minute', minute);\n if (meridiem >= 0) {\n result.end.assign('meridiem', meridiem);\n } else {\n var startAtPM = result.start.isCertain('meridiem') && result.start.get('meridiem') == 1;\n if (startAtPM && result.start.get('hour') > hour) {\n // 10pm - 1 (am)\n result.end.imply('meridiem', 0);\n\n } else if (hour > 12) {\n result.end.imply('meridiem', 1);\n }\n }\n\n if (result.end.date().getTime() < result.start.date().getTime()) {\n result.end.imply('day', result.end.get('day') + 1)\n }\n\n return result;\n }\n}\n","/*\n\n\n*/\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar DAYS_OFFSET = {\n 'sonntag': 0, 'so': 0,\n 'montag': 1, 'mo': 1,\n 'dienstag': 2, 'di': 2,\n 'mittwoch': 3, 'mi': 3,\n 'donnerstag': 4, 'do': 4,\n 'freitag': 5, 'fr': 5,\n 'samstag': 6, 'sa': 6\n};\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:(?:\\\\,|\\\\(|\\\\()\\\\s*)?' +\n '(?:a[mn]\\\\s*?)?' +\n '(?:(diese[mn]|letzte[mn]|n(?:ä|ae)chste[mn])\\\\s*)?' +\n '(' + Object.keys(DAYS_OFFSET).join('|') + ')' +\n '(?:\\\\s*(?:\\\\,|\\\\)|\\\\)))?' +\n '(?:\\\\s*(diese|letzte|n(?:ä|ae)chste)\\\\s*woche)?' +\n '(?=\\\\W|$)', 'i');\n\nvar PREFIX_GROUP = 2;\nvar WEEKDAY_GROUP = 3;\nvar POSTFIX_GROUP = 4;\n\nexports.Parser = function DEWeekdayParser() {\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; };\n\n this.extract = function(text, ref, match, opt){\n var index = match.index + match[1].length;\n var text = match[0].substr(match[1].length, match[0].length - match[1].length);\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n var dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();\n var offset = DAYS_OFFSET[dayOfWeek];\n if(offset === undefined) return null;\n\n var startMoment = dayjs(ref);\n var prefix = match[PREFIX_GROUP];\n var postfix = match[POSTFIX_GROUP];\n\n var refOffset = startMoment.day();\n var norm = prefix || postfix;\n norm = norm || '';\n norm = norm.toLowerCase();\n if (/letzte/.test(norm)) {\n startMoment = startMoment.day(offset - 7);\n } else if (/n(?:ä|ae)chste/.test(norm)) {\n startMoment = startMoment.day(offset + 7);\n } else if (/diese/.test(norm)) {\n if ( opt.forwardDate && refOffset > offset ) {\n startMoment = startMoment.day(offset + 7);\n } else {\n startMoment = startMoment.day(offset);\n }\n } else {\n if ( opt.forwardDate && refOffset > offset ) {\n startMoment = startMoment.day(offset + 7);\n } else if (!opt.forwardDate && Math.abs(offset - 7 - refOffset) < Math.abs(offset - refOffset)) {\n startMoment = startMoment.day(offset - 7);\n } else if (!opt.forwardDate && Math.abs(offset + 7 - refOffset) < Math.abs(offset - refOffset)) {\n startMoment = startMoment.day(offset + 7);\n } else {\n startMoment = startMoment.day(offset);\n }\n }\n\n result.start.assign('weekday', offset);\n result.start.imply('day', startMoment.date());\n result.start.imply('month', startMoment.month() + 1);\n result.start.imply('year', startMoment.year());\n return result;\n }\n};\n","var dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp(\n '(\\\\W|^)(' +\n 'jetzt|' +\n '(?:heute|diesen)\\\\s*(morgen|vormittag|mittag|nachmittag|abend)|' +\n '(?:heute|diese)\\\\s*nacht|' +\n 'heute|' +\n '(?:(?:ü|ue)ber)?morgen(?:\\\\s*(morgen|vormittag|mittag|nachmittag|abend|nacht))?|' +\n '(?:vor)?gestern(?:\\\\s*(morgen|vormittag|mittag|nachmittag|abend|nacht))?|' +\n 'letzte\\\\s*nacht' +\n ')(?=\\\\W|$)', 'i');\n\nexports.Parser = function DECasualDateParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt) {\n text = match[0].substr(match[1].length);\n \n const index = match.index + match[1].length;\n const result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n const refMoment = dayjs(ref);\n const lowerText = text.toLowerCase();\n\n var startMoment = refMoment;\n\n if (/(?:heute|diese)\\s*nacht/.test(lowerText)) {\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n } else if (/^(?:ü|ue)bermorgen/.test(lowerText)) {\n startMoment = startMoment.add(refMoment.hour() > 1 ? 2 : 1, 'day');\n } else if (/^morgen/.test(lowerText)) {\n // Check not \"Tomorrow\" on late night\n if (refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n } else if (/^gestern/.test(lowerText)) {\n startMoment = startMoment.add(-1, 'day');\n } else if (/^vorgestern/.test(lowerText)) {\n startMoment = startMoment.add(-2, 'day');\n } else if (/letzte\\s*nacht/.test(lowerText)) {\n result.start.imply('hour', 0);\n if (refMoment.hour() > 6) {\n startMoment = startMoment.add(-1, 'day');\n }\n } else if (lowerText === 'jetzt') {\n result.start.imply('hour', refMoment.hour());\n result.start.imply('minute', refMoment.minute());\n result.start.imply('second', refMoment.second());\n result.start.imply('millisecond', refMoment.millisecond());\n }\n\n var secondMatch = match[3] || match[4] || match[5];\n if (secondMatch) {\n switch (secondMatch.toLowerCase()) {\n case 'morgen':\n result.start.imply('hour', 6);\n break;\n case 'vormittag':\n result.start.imply('hour', 9);\n break;\n case 'mittag':\n result.start.imply('hour', 12);\n break;\n case 'nachmittag':\n result.start.imply('hour', 15);\n result.start.imply('meridiem', 1);\n break;\n case 'abend':\n result.start.imply('hour', 18);\n result.start.imply('meridiem', 1);\n break;\n case 'nacht':\n result.start.imply('hour', 0);\n break;\n }\n }\n\n result.start.assign('day', startMoment.date())\n result.start.assign('month', startMoment.month() + 1)\n result.start.assign('year', startMoment.year())\n result.tags['DECasualDateParser'] = true;\n return result;\n }\n}\n","/*\n\n The parser for parsing month name and year.\n\n EX.\n - januari\n - januari 2012\n - januari, 2012\n*/\nvar parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/NL');\n\nvar PATTERN = new RegExp('(^|\\\\D\\\\s+|[^\\\\w\\\\s])' +\n '('+ util.MONTH_PATTERN +')' +\n '\\\\s*' +\n '(?:' +\n '[,-]?\\\\s*([0-9]{4})(\\\\s*BE|n\\.Chr\\.|v\\.Chr\\.)?' +\n ')?' +\n '(?=[^\\\\s\\\\w]|\\\\s+[^0-9]|\\\\s+$|$)', 'i');\n\nvar MONTH_NAME_GROUP = 2;\nvar YEAR_GROUP = 3;\nvar YEAR_BE_GROUP = 4;\n\nexports.Parser = function ENMonthNameParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n const result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref,\n });\n\n const day = 1;\n const monthName = match[MONTH_NAME_GROUP];\n const month = util.MONTH_OFFSET[monthName.toLowerCase()];\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n year = parseInt(year);\n\n if(match[YEAR_BE_GROUP]){\n if (match[YEAR_BE_GROUP].match(/BE/)) {\n // Buddhist Era\n year = year - 543;\n } else if (match[YEAR_BE_GROUP].match(/v\\.Chr\\./)) {\n // Before Christ\n year = -year;\n }\n\n } else if (year < 100){\n\n year = year + 2000;\n }\n }\n\n if(year){\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month)\n result.start.imply('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n if (result.text.match(/^\\w{3}$/)) {\n return false;\n }\n\n result.tags['NLMonthNameParser'] = true;\n return result;\n }\n}\n","const parser = require('../parser');\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/NL');\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:op\\\\s*?)?' +\n '(?:'+ '(' + util.WEEKDAY_PATTERN + ')' + '\\\\s*,?\\\\s*)?' +\n '([0-9]{1,2})\\.?' +\n '(?:\\\\s*(?:tot|\\\\-|\\\\–|tot en met|t\\\\/m)\\\\s*([0-9]{1,2})\\.?)?\\\\s*' +\n '(' + util.MONTH_PATTERN + ')' +\n '(?:' +\n '(?:-|\\/|,?\\\\s*)' +\n '((?:' +\n '[1-9][0-9]{0,3}\\\\s*(?:BE|n\\.Chr\\.|v\\.Chr\\.)|' +\n '[1-2][0-9]{3}|' +\n '[5-9][0-9]' +\n ')(?![^\\\\s]\\\\d))' +\n ')?' +\n '(?=\\\\W|$)', 'i'\n );\nvar WEEKDAY_GROUP = 2;\nvar DATE_GROUP = 3;\nvar DATE_TO_GROUP = 4;\nvar MONTH_NAME_GROUP = 5;\nvar YEAR_GROUP = 6;\n\nexports.Parser = function ENMonthNameLittleEndianParser(){\n parser.Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; };\n\n this.extract = function(text, ref, match, opt){\n\n var result = new ParsedResult({\n text: match[0].substr(match[1].length, match[0].length - match[1].length),\n index: match.index + match[1].length,\n ref: ref\n });\n\n var month = match[MONTH_NAME_GROUP];\n month = util.MONTH_OFFSET[month.toLowerCase()];\n\n var day = match[DATE_GROUP];\n day = parseInt(day);\n\n var year = null;\n if (match[YEAR_GROUP]) {\n year = match[YEAR_GROUP];\n\n if (/BE/i.test(year)) {\n // Buddhist Era\n year = year.replace(/BE/i, '');\n year = parseInt(year) - 543;\n } else if (/v\\.Chr\\./i.test(year)){\n // Before Christ\n year = year.replace(/v\\.Chr\\./i, '');\n year = -parseInt(year);\n } else if (/n\\.Chr\\./i.test(year)){\n year = year.replace(/n\\.Chr\\./i, '');\n year = parseInt(year);\n } else {\n year = parseInt(year);\n if (year < 100){\n if (year > 50) {\n year = year + 1900;\n } else {\n year = year + 2000;\n }\n }\n }\n }\n\n if(year){\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n } else {\n year = parser.findYearClosestToRef(ref, day, month);\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.imply('year', year);\n }\n\n // Weekday component\n if (match[WEEKDAY_GROUP]) {\n var weekday = match[WEEKDAY_GROUP];\n weekday = util.WEEKDAY_OFFSET[weekday.toLowerCase()];\n result.start.assign('weekday', weekday);\n }\n\n // Text can be 'range' value. Such as '12 - 13 januari 2012'\n if (match[DATE_TO_GROUP]) {\n var endDate = parseInt(match[DATE_TO_GROUP]);\n result.end = result.start.clone();\n result.end.assign('day', endDate);\n }\n\n result.tags['NLMonthNameLittleEndianParser'] = true;\n return result;\n };\n};\n","/*\n Date format with slash \"/\" (also \"-\" and \".\") between numbers\n - dinsdag 11/3/2015\n - 11/3/2015\n - 11/3\n - dinsdag 11.mrt.15\n*/\nvar dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar util = require('../../utils/NL');\n\nvar PATTERN = new RegExp(\n '(\\\\W|^)' +\n '(?:' +\n '(?:op\\\\s*?)?' +\n '(' + util.WEEKDAY_PATTERN + ')' +\n '\\\\s*\\\\,?\\\\s*' +\n '(?:de\\\\s*)?' +\n ')?' +\n '([0-3]{0,1}[0-9]{1})[\\\\/\\\\.\\\\-]([0-1]{0,1}[0-9]{1}|' +\n util.MONTH_PATTERN +\n ')' +\n '(?:' +\n '[\\\\/\\\\.\\\\-]' +\n '([0-9]{4}\\s*\\,?\\s*|[0-9]{2}\\s*\\,?\\s*)' +\n ')?' +\n '(\\\\W|$)', 'i');\n\nvar OPENNING_GROUP = 1;\nvar ENDING_GROUP = 6;\n\nvar WEEKDAY_GROUP = 2;\nvar DAY_GROUP = 3;\nvar MONTH_GROUP = 4;\nvar YEAR_GROUP = 5;\n\nexports.Parser = function DESlashDateFormatParser(argument) {\n Parser.apply(this, arguments);\n\n this.pattern = function () { return PATTERN; };\n this.extract = function(text, ref, match, opt){\n\n if(match[OPENNING_GROUP] == '/' || match[ENDING_GROUP] == '/') {\n // Long skip, if there is some overlapping like:\n // XX[/YY/ZZ]\n // [XX/YY/]ZZ\n match.index += match[0].length\n return;\n }\n\n var index = match.index + match[OPENNING_GROUP].length;\n var text = match[0].substr(match[OPENNING_GROUP].length, match[0].length - match[ENDING_GROUP].length);\n\n\n let result = new ParsedResult({\n text: text,\n index: index,\n ref: ref,\n });\n\n if(text.match(/^\\d\\.\\d$/)) return;\n if(text.match(/^\\d\\.\\d{1,2}\\.\\d{1,2}$/)) return;\n\n // MM/dd -> OK\n // MM.dd -> NG\n if(!match[YEAR_GROUP] && match[0].indexOf('/') < 0) return;\n\n let year = match[YEAR_GROUP] || dayjs(ref).year() + '';\n let month = match[MONTH_GROUP];\n let day = match[DAY_GROUP];\n\n month = parseInt(month);\n if(!month) {\n month = util.MONTH_OFFSET[match[MONTH_GROUP].trim().toLowerCase()];\n }\n day = parseInt(day);\n year = parseInt(year);\n\n if (month < 1 || month > 12) return null;\n if(day < 1 || day > 31) return null;\n\n if(year < 100){\n if (year > 50) {\n year = year + 1900;\n } else {\n year = year + 2000;\n }\n }\n\n result.start.assign('day', day);\n result.start.assign('month', month);\n result.start.assign('year', year);\n\n //Day of week\n if(match[WEEKDAY_GROUP]) {\n result.start.assign('weekday', util.WEEKDAY_OFFSET[match[WEEKDAY_GROUP].toLowerCase()]);\n }\n\n result.tags['NLSlashDateFormatParser'] = true;\n return result;\n };\n};\n","const dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar DAYS_OFFSET = {\n 'zondag': 0, 'zo': 0,\n 'maandag': 1, 'ma': 1,\n 'dinsdag': 2, 'di': 2,\n 'woensdag': 3, 'wo': 3,\n 'donderdag': 4, 'do': 4,\n 'vrijdag': 5, 'vr': 5,\n 'zaterdag': 6, 'za': 6\n};\n\nvar PATTERN = new RegExp('(\\\\W|^)' +\n '(?:(?:\\\\,|\\\\(|\\\\()\\\\s*)?' +\n '(?:on\\\\s*?)?' +\n '(?:(deze|afgelopen|vorige|volgende|komende)\\\\s*(?:week)?\\\\s*)?' +\n '(' + Object.keys(DAYS_OFFSET).join('|') + ')' +\n '(?:\\\\s*(?:\\\\,|\\\\)|\\\\)))?' +\n '(?:\\\\s*(deze|afgelopen|vorige|volgende|komende)\\\\s*week)?' +\n '(?=\\\\W|$)', 'i');\n\nvar PREFIX_GROUP = 2;\nvar WEEKDAY_GROUP = 3;\nvar POSTFIX_GROUP = 4;\n\n\nexports.updateParsedComponent = function updateParsedComponent(result, ref, offset, modifier) {\n\n var startMoment = dayjs(ref);\n var startMomentFixed = false;\n var refOffset = startMoment.day();\n\n if(modifier == 'afgelopen' || modifier == 'vorige') {\n startMoment =startMoment.day(offset - 7);\n startMomentFixed = true;\n } else if(modifier == 'volgende') {\n startMoment = startMoment.day(offset + 7);\n startMomentFixed = true;\n } else if(modifier == 'deze' || modifier == 'komende') {\n startMoment = startMoment.day(offset);\n } else {\n if (Math.abs(offset - 7 - refOffset) < Math.abs(offset - refOffset)) {\n startMoment = startMoment.day(offset - 7);\n } else if (Math.abs(offset + 7 - refOffset) < Math.abs(offset - refOffset)) {\n startMoment = startMoment.day(offset + 7);\n } else {\n startMoment = startMoment.day(offset);\n }\n }\n\n result.start.assign('weekday', offset);\n if (startMomentFixed) {\n result.start.assign('day', startMoment.date());\n result.start.assign('month', startMoment.month() + 1);\n result.start.assign('year', startMoment.year());\n } else {\n result.start.imply('day', startMoment.date());\n result.start.imply('month', startMoment.month() + 1);\n result.start.imply('year', startMoment.year());\n }\n\n return result;\n};\n\n\nexports.Parser = function NLWeekdayParser() {\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; };\n\n this.extract = function(text, ref, match, opt){\n var index = match.index + match[1].length;\n var text = match[0].substr(match[1].length, match[0].length - match[1].length);\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref\n });\n\n var dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();\n var offset = DAYS_OFFSET[dayOfWeek];\n if(offset === undefined) {\n return null;\n }\n\n var prefix = match[PREFIX_GROUP];\n var postfix = match[POSTFIX_GROUP];\n var norm = prefix || postfix;\n norm = norm || '';\n norm = norm.toLowerCase();\n\n exports.updateParsedComponent(result, ref, offset, norm);\n result.tags['NLWeekdayParser'] = true;\n\n return result;\n }\n};\n","/*\n\n\n*/\n\nconst dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\nvar ParsedComponents = require('../../result').ParsedComponents;\n\nvar FIRST_REG_PATTERN = new RegExp(\"(^|\\\\s|T)\" +\n \"(?:(?:om|van)\\\\s*)?\" +\n \"(\\\\d{1,4}|tussen de middag|middernachts?)\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\:|\\\\:)(\\\\d{2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*uur)?\" +\n \"(?:\\\\s*(\\'s morgens|\\'s ochtends|in de ochtend|\\'s middags|in de middag|\\'s avonds|in de avond|\\'s nachts))?\" +\n \"(?=\\\\W|$)\", 'i');\n\n\nvar SECOND_REG_PATTERN = new RegExp(\"^\\\\s*\" +\n \"(\\\\-|\\\\–|\\\\~|\\\\〜|tot|\\\\?)\\\\s*\" +\n \"(\\\\d{1,4})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \"(?:\" +\n \"(?:\\\\.|\\\\:|\\\\:)(\\\\d{1,2})\" +\n \")?\" +\n \")?\" +\n \"(?:\\\\s*(\\'s morgens|\\'s ochtends|in de ochtend|\\'s middags|in de middag|\\'s avonds|in de avond|\\'s nachts))?\" +\n \"(?=\\\\W|$)\", 'i');\n\nvar HOUR_GROUP = 2;\nvar MINUTE_GROUP = 3;\nvar SECOND_GROUP = 4;\nvar AM_PM_HOUR_GROUP = 5;\n\n\nexports.Parser = function NLTimeExpressionParser() {\n Parser.apply(this, arguments);\n\n this.pattern = function() { return FIRST_REG_PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n // This pattern can be overlaped Ex. [12] AM, 1[2] AM\n if (match.index > 0 && text[match.index-1].match(/\\w/)) return null;\n var refMoment = dayjs(ref);\n var result = new ParsedResult();\n result.ref = ref;\n result.index = match.index + match[1].length;\n result.text = match[0].substring(match[1].length);\n result.tags['NLTimeExpressionParser'] = true;\n\n result.start.imply('day', refMoment.date());\n result.start.imply('month', refMoment.month()+1);\n result.start.imply('year', refMoment.year());\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.start.assign('second', second);\n }\n\n // ----- Hours\n if (/tussen de middag/i.test(match[HOUR_GROUP])) {\n meridiem = 1;\n hour = 12;\n } else if (/middernachts?/i.test(match[HOUR_GROUP])) {\n meridiem = 0;\n hour = 0;\n } else {\n hour = parseInt(match[HOUR_GROUP]);\n }\n\n // ----- Minutes\n if(match[MINUTE_GROUP] != null){\n minute = parseInt(match[MINUTE_GROUP]);\n } else if(hour > 100) {\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP] != null) {\n if (hour > 12) return null;\n var ampm = match[AM_PM_HOUR_GROUP].toLowerCase();\n if (ampm === \"'s ochtends\" || ampm === 'in de ochtend' || ampm === \"'s morgens\") {\n meridiem = 0;\n if(hour == 12) hour = 0;\n } else {\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n }\n\n result.start.assign('hour', hour);\n result.start.assign('minute', minute);\n\n if (meridiem >= 0) {\n result.start.assign('meridiem', meridiem);\n } else {\n if (hour < 12) {\n result.start.imply('meridiem', 0);\n } else {\n result.start.imply('meridiem', 1);\n }\n }\n\n // ==============================================================\n // Extracting the 'to' chunk\n // ==============================================================\n match = SECOND_REG_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n // Not accept number only result\n if (result.text.match(/^\\d+$/)) {\n return null;\n }\n return result;\n }\n\n\n\n // Pattern \"YY.YY -XXXX\" is more like timezone offset\n if (match[0].match(/^\\s*(\\+|\\-)\\s*\\d{3,4}$/)) {\n return result;\n }\n\n if(result.end == null){\n result.end = new ParsedComponents(null, result.start.date());\n }\n\n var hour = 0;\n var minute = 0;\n var meridiem = -1;\n\n // ----- Second\n if(match[SECOND_GROUP] != null){\n var second = parseInt(match[SECOND_GROUP]);\n if(second >= 60) return null;\n\n result.end.assign('second', second);\n }\n\n hour = parseInt(match[2]);\n\n // ----- Minute\n if (match[MINUTE_GROUP]!= null) {\n\n minute = parseInt(match[MINUTE_GROUP]);\n if(minute >= 60) return result;\n\n } else if (hour > 100) {\n\n minute = hour%100;\n hour = parseInt(hour/100);\n }\n\n if(minute >= 60) {\n return null;\n }\n\n if(hour > 24) {\n return null;\n }\n if (hour >= 12) {\n meridiem = 1;\n }\n\n // ----- AM & PM\n if (match[AM_PM_HOUR_GROUP] != null) {\n\n if (hour > 12) return null;\n\n var ampm = match[AM_PM_HOUR_GROUP].toLowerCase();\n if (ampm === '\\'s ochtends' || ampm === 'in de ochtend' || ampm === '\\'s morgens') {\n meridiem = 0;\n if(hour == 12) {\n hour = 0;\n if (!result.end.isCertain('day')) {\n result.end.imply('day', result.end.get('day') + 1);\n }\n }\n } else {\n meridiem = 1;\n if(hour != 12) hour += 12;\n }\n\n if (!result.start.isCertain('meridiem')) {\n if (meridiem == 0) {\n\n result.start.imply('meridiem', 0);\n\n if (result.start.get('hour') == 12) {\n result.start.assign('hour', 0);\n }\n\n } else {\n\n result.start.imply('meridiem', 1);\n\n if (result.start.get('hour') != 12) {\n result.start.assign('hour', result.start.get('hour') + 12);\n }\n }\n }\n }\n\n result.text = result.text + match[0];\n result.end.assign('hour', hour);\n result.end.assign('minute', minute);\n if (meridiem >= 0) {\n result.end.assign('meridiem', meridiem);\n } else {\n var startAtPM = result.start.isCertain('meridiem') && result.start.get('meridiem') == 1;\n if (startAtPM && result.start.get('hour') > hour) {\n // 10pm - 1 (am)\n result.end.imply('meridiem', 0);\n\n } else if (hour > 12) {\n result.end.imply('meridiem', 1);\n }\n }\n\n if (result.end.date().getTime() < result.start.date().getTime()) {\n result.end.imply('day', result.end.get('day') + 1)\n }\n\n return result;\n }\n}\n","var dayjs = require('dayjs');\nvar Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = new RegExp(\n '(\\\\W|^)(' +\n 'nu|' +\n 'vroeg in de ochtend|'+\n '(?:van|deze)\\\\s*(morgen|ochtend|middag|avond)|' +\n '\\'s morgens|\\'s ochtends|tussen de middag|\\'s middags|\\'s avonds|'+\n '(?:deze|van)\\\\s*nacht|' +\n 'vandaag|' +\n '(?:over)?morgen(?:\\\\s*(ochtend|middag|avond|nacht))?|' +\n '(?:eer)?gister(?:\\\\s*(ochtend|middag|avond|nacht))?|' +\n 'afgelopen\\\\s*nacht' +\n ')(?=\\\\W|$)', 'i');\n\nexports.Parser = function DECasualDateParser() {\n\n Parser.apply(this, arguments);\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt) {\n text = match[0].substr(match[1].length);\n\n const index = match.index + match[1].length;\n const result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n const refMoment = dayjs(ref);\n const lowerText = text.toLowerCase();\n\n var startMoment = refMoment;\n\n if (/(?:van|deze)\\s*nacht/.test(lowerText)) {\n // Normally means this coming midnight\n result.start.imply('hour', 22);\n result.start.imply('meridiem', 1);\n } else if (/^overmorgen/.test(lowerText)) {\n startMoment = startMoment.add(refMoment.hour() > 1 ? 2 : 1, 'day');\n } else if (/^morgen/.test(lowerText)) {\n // Check not \"Tomorrow\" on late night\n if (refMoment.hour() > 1) {\n startMoment = startMoment.add(1, 'day');\n }\n } else if (/^gisteren/.test(lowerText)) {\n startMoment = startMoment.add(-1, 'day');\n } else if (/^eergisteren/.test(lowerText)) {\n startMoment = startMoment.add(-2, 'day');\n } else if (/afgelopen\\s*nacht/.test(lowerText)) {\n result.start.imply('hour', 0);\n if (refMoment.hour() > 6) {\n startMoment = startMoment.add(-1, 'day');\n }\n } else if (lowerText === 'nu') {\n result.start.imply('hour', refMoment.hour());\n result.start.imply('minute', refMoment.minute());\n result.start.imply('second', refMoment.second());\n result.start.imply('millisecond', refMoment.millisecond());\n }\n\n var secondMatch = match[3] || match[4] || match[5];\n if (secondMatch) {\n switch (secondMatch.toLowerCase()) {\n case 'vroeg in de ochtend':\n result.start.imply('hour', 6);\n break;\n case 'ochtend':\n case 'morgen':\n case '\\'s ochtends':\n case '\\'s morgends':\n result.start.imply('hour', 9);\n break;\n case 'tussen de middag':\n result.start.imply('hour', 12);\n break;\n case 'middag':\n case 'in de middag':\n case '\\'s middags':\n result.start.imply('hour', 15);\n result.start.imply('meridiem', 1);\n break;\n case 'avond':\n case \"'s avonds\":\n result.start.imply('hour', 18);\n result.start.imply('meridiem', 1);\n break;\n case 'nacht':\n case \"'s nachts\":\n result.start.imply('hour', 0);\n break;\n }\n }\n\n result.start.assign('day', startMoment.date());\n result.start.assign('month', startMoment.month() + 1);\n result.start.assign('year', startMoment.year());\n result.tags['NLCasualDateParser'] = true;\n return result;\n }\n}\n","var Parser = require('../parser').Parser;\nvar ParsedResult = require('../../result').ParsedResult;\n\nvar PATTERN = /(\\W|^)((deze)?\\s*('s morgens|'s ochtends|in de ochtend|'s middags|in de middag|'s avonds|in de avond|'s nachts|ochtend|tussen de middag|middag|avond|nacht))/i;\n\nvar TIME_MATCH = 4;\n\nexports.Parser = function ENCasualTimeParser(){\n\n Parser.apply(this, arguments);\n\n\n this.pattern = function() { return PATTERN; }\n\n this.extract = function(text, ref, match, opt){\n\n var text = match[0].substr(match[1].length);\n var index = match.index + match[1].length;\n var result = new ParsedResult({\n index: index,\n text: text,\n ref: ref,\n });\n\n if(!match[TIME_MATCH]) TIME_MATCH = 3;\n\n switch (match[TIME_MATCH].toLowerCase()) {\n case 'middag':\n case 'in de middag':\n case '\\'s middags':\n result.start.imply('meridiem', 1);\n result.start.imply('hour', 15);\n break;\n\n case 'avond':\n case 'in de avond':\n case '\\'s avonds':\n result.start.imply('meridiem', 1);\n result.start.imply('hour', 20);\n break;\n\n case 'middernacht':\n case 'nacht':\n case '\\'s nachts':\n result.start.imply('meridiem', 0);\n result.start.imply('hour', 0);\n break;\n\n case 'ochtend':\n case '\\s morgens':\n case '\\s ochtends':\n case 'in de ochtend':\n result.start.imply('meridiem', 0);\n result.start.imply('hour', 9);\n break;\n\n case 'tussen de middag':\n result.start.imply('meridiem', 0);\n result.start.imply('hour', 12);\n break;\n }\n\n result.tags['NLCasualTimeParser'] = true;\n return result;\n };\n};\n","/*\n \n*/\nvar Refiner = require('./refiner').Refiner;\n\nexports.Refiner = function OverlapRemovalRefiner() {\n\tRefiner.call(this);\n\t\n\n\tthis.refine = function(text, results, opt) { \n\n if (results.length < 2) return results;\n \n var filteredResults = [];\n var prevResult = results[0];\n \n for (var i=1; i prevResult.text.length){\n prevResult = result;\n }\n \n } else {\n filteredResults.push(prevResult);\n prevResult = result;\n }\n }\n \n // The last one\n if (prevResult != null) {\n filteredResults.push(prevResult);\n }\n\n return filteredResults;\n }\n}","/*\n \n*/\nvar Refiner = require('./refiner').Refiner;\n\n\nvar TIMEZONE_OFFSET_PATTERN = new RegExp(\"^\\\\s*(GMT|UTC)?(\\\\+|\\\\-)(\\\\d{1,2}):?(\\\\d{2})\", 'i');\nvar TIMEZONE_OFFSET_SIGN_GROUP = 2;\nvar TIMEZONE_OFFSET_HOUR_OFFSET_GROUP = 3;\nvar TIMEZONE_OFFSET_MINUTE_OFFSET_GROUP = 4;\n\nexports.Refiner = function ExtractTimezoneOffsetRefiner() {\n Refiner.call(this);\n\n this.refine = function(text, results, opt) {\n\n results.forEach(function(result) {\n\n if (result.start.isCertain('timezoneOffset')) {\n return;\n }\n\n var match = TIMEZONE_OFFSET_PATTERN.exec(text.substring(result.index + result.text.length));\n if (!match) {\n return;\n }\n\n var hourOffset = parseInt(match[TIMEZONE_OFFSET_HOUR_OFFSET_GROUP]);\n var minuteOffset = parseInt(match[TIMEZONE_OFFSET_MINUTE_OFFSET_GROUP]);\n var timezoneOffset = hourOffset * 60 + minuteOffset;\n if (match[TIMEZONE_OFFSET_SIGN_GROUP] === '-') {\n timezoneOffset = -timezoneOffset;\n }\n\n if (result.end != null) {\n result.end.assign('timezoneOffset', timezoneOffset);\n }\n\n result.start.assign('timezoneOffset', timezoneOffset);\n result.text += match[0];\n result.tags['ExtractTimezoneOffsetRefiner'] = true;\n });\n\n return results;\n }\n}\n","/*\n\n*/\nvar Refiner = require('./refiner').Refiner;\n\n// Map ABBR -> Offset in minute\nvar TIMEZONE_NAME_PATTERN = new RegExp(\"^\\\\s*\\\\(?([A-Z]{2,4})\\\\)?(?=\\\\W|$)\", 'i');\nvar DEFAULT_TIMEZONE_ABBR_MAP = {\n \"ACDT\":630,\"ACST\":570,\"ADT\":-180,\"AEDT\":660,\"AEST\":600,\"AFT\":270,\"AKDT\":-480,\"AKST\":-540,\"ALMT\":360,\"AMST\":-180,\"AMT\":-240,\"ANAST\":720,\"ANAT\":720,\"AQTT\":300,\"ART\":-180,\"AST\":-240,\"AWDT\":540,\"AWST\":480,\"AZOST\":0,\"AZOT\":-60,\"AZST\":300,\"AZT\":240,\"BNT\":480,\"BOT\":-240,\"BRST\":-120,\"BRT\":-180,\"BST\":60,\"BTT\":360,\"CAST\":480,\"CAT\":120,\"CCT\":390,\"CDT\":-300,\"CEST\":120,\"CET\":60,\"CHADT\":825,\"CHAST\":765,\"CKT\":-600,\"CLST\":-180,\"CLT\":-240,\"COT\":-300,\"CST\":-360,\"CVT\":-60,\"CXT\":420,\"ChST\":600,\"DAVT\":420,\"EASST\":-300,\"EAST\":-360,\"EAT\":180,\"ECT\":-300,\"EDT\":-240,\"EEST\":180,\"EET\":120,\"EGST\":0,\"EGT\":-60,\"EST\":-300,\"ET\":-300,\"FJST\":780,\"FJT\":720,\"FKST\":-180,\"FKT\":-240,\"FNT\":-120,\"GALT\":-360,\"GAMT\":-540,\"GET\":240,\"GFT\":-180,\"GILT\":720,\"GMT\":0,\"GST\":240,\"GYT\":-240,\"HAA\":-180,\"HAC\":-300,\"HADT\":-540,\"HAE\":-240,\"HAP\":-420,\"HAR\":-360,\"HAST\":-600,\"HAT\":-90,\"HAY\":-480,\"HKT\":480,\"HLV\":-210,\"HNA\":-240,\"HNC\":-360,\"HNE\":-300,\"HNP\":-480,\"HNR\":-420,\"HNT\":-150,\"HNY\":-540,\"HOVT\":420,\"ICT\":420,\"IDT\":180,\"IOT\":360,\"IRDT\":270,\"IRKST\":540,\"IRKT\":540,\"IRST\":210,\"IST\":330,\"JST\":540,\"KGT\":360,\"KRAST\":480,\"KRAT\":480,\"KST\":540,\"KUYT\":240,\"LHDT\":660,\"LHST\":630,\"LINT\":840,\"MAGST\":720,\"MAGT\":720,\"MART\":-510,\"MAWT\":300,\"MDT\":-360,\"MESZ\":120,\"MEZ\":60,\"MHT\":720,\"MMT\":390,\"MSD\":240,\"MSK\":240,\"MST\":-420,\"MUT\":240,\"MVT\":300,\"MYT\":480,\"NCT\":660,\"NDT\":-90,\"NFT\":690,\"NOVST\":420,\"NOVT\":360,\"NPT\":345,\"NST\":-150,\"NUT\":-660,\"NZDT\":780,\"NZST\":720,\"OMSST\":420,\"OMST\":420,\"PDT\":-420,\"PET\":-300,\"PETST\":720,\"PETT\":720,\"PGT\":600,\"PHOT\":780,\"PHT\":480,\"PKT\":300,\"PMDT\":-120,\"PMST\":-180,\"PONT\":660,\"PST\":-480,\"PT\":-480,\"PWT\":540,\"PYST\":-180,\"PYT\":-240,\"RET\":240,\"SAMT\":240,\"SAST\":120,\"SBT\":660,\"SCT\":240,\"SGT\":480,\"SRT\":-180,\"SST\":-660,\"TAHT\":-600,\"TFT\":300,\"TJT\":300,\"TKT\":780,\"TLT\":540,\"TMT\":300,\"TVT\":720,\"ULAT\":480,\"UTC\":0,\"UYST\":-120,\"UYT\":-180,\"UZT\":300,\"VET\":-210,\"VLAST\":660,\"VLAT\":660,\"VUT\":660,\"WAST\":120,\"WAT\":60,\"WEST\":60,\"WESZ\":60,\"WET\":0,\"WEZ\":0,\"WFT\":720,\"WGST\":-120,\"WGT\":-180,\"WIB\":420,\"WIT\":540,\"WITA\":480,\"WST\":780,\"WT\":0,\"YAKST\":600,\"YAKT\":600,\"YAPT\":600,\"YEKST\":360,\"YEKT\":360\n};\n\nexports.Refiner = function ExtractTimezoneAbbrRefiner(config) {\n\tRefiner.call(this, arguments);\n\n\tthis.refine = function(text, results, opt) {\n\n\t var timezones = new Object(DEFAULT_TIMEZONE_ABBR_MAP);\n\t if (opt.timezones) {\n\t for (var name in opt.timezones) {\n timezones[name] = opt.timezones[name];\n }\n }\n\n\t\tresults.forEach(function(result) {\n\n if (!result.tags['ENTimeExpressionParser'] &&\n !result.tags['ENCasualTimeParser'] &&\n !result.tags['ZHTimeExpressionParser'] &&\n !result.tags['FRTimeExpressionParser'] &&\n !result.tags['DETimeExpressionParser']) {\n return;\n }\n\n var match = TIMEZONE_NAME_PATTERN.exec(text.substring(result.index + result.text.length));\n if (match) {\n var timezoneAbbr = match[1].toUpperCase();\n if (timezones[timezoneAbbr] === undefined) {\n return;\n }\n\n var timezoneOffset = timezones[timezoneAbbr];\n if (!result.start.isCertain('timezoneOffset')) {\n result.start.assign('timezoneOffset', timezoneOffset);\n }\n\n if (result.end != null && !result.end.isCertain('timezoneOffset')) {\n result.end.assign('timezoneOffset', timezoneOffset);\n }\n\n result.text += match[0];\n result.tags['ExtractTimezoneAbbrRefiner'] = true;\n }\n\t\t});\n\n return results;\n\t}\n};","/*\n Enforce 'forwardDate' option to on the results. When there are missing component,\n e.g. \"March 12-13 (without year)\" or \"Thursday\", the refiner will try to adjust the result\n into the future instead of the past.\n*/\nvar dayjs = require('dayjs');\nvar Refiner = require('./refiner').Refiner;\n\nexports.Refiner = function ForwardDateRefiner() {\n Refiner.call(this);\n\n this.refine = function(text, results, opt) {\n\n if (!opt['forwardDate']) {\n return results;\n }\n\n results.forEach(function(result) {\n\n var refMoment = dayjs(result.ref);\n\n if (result.start.isOnlyDayMonthComponent() && refMoment.isAfter(result.start.dayjs())\n ) {\n // Adjust year into the future\n for (var i=0; i < 3 && refMoment.isAfter(result.start.dayjs()); i++) {\n result.start.imply('year', result.start.get('year') + 1);\n\n if (result.end && !result.end.isCertain('year')) {\n result.end.imply('year', result.end.get('year') + 1);\n }\n }\n\n result.tags['ForwardDateRefiner'] = true;\n }\n\n if (result.start.isOnlyWeekdayComponent() && refMoment.isAfter(result.start.dayjs())) {\n // Adjust date to the coming week\n if (refMoment.day() > result.start.get('weekday')) {\n refMoment = refMoment.day(result.start.get('weekday') + 7);\n } else {\n refMoment = refMoment.day(result.start.get('weekday'));\n }\n\n result.start.imply('day', refMoment.date());\n result.start.imply('month', refMoment.month() + 1);\n result.start.imply('year', refMoment.year());\n result.tags['ForwardDateRefiner'] = true;\n }\n });\n\n return results;\n }\n};\n","/*\n \n*/\nvar Filter = require('./refiner').Filter;\n\nexports.Refiner = function UnlikelyFormatFilter() {\n Filter.call(this);\n \n\n this.isValid = function(text, result, opt) { \n\n if (result.text.replace(' ','').match(/^\\d*(\\.\\d*)?$/)) {\n return false;\n }\n\n return true; \n }\n}","/*\n\n*/\nvar ParsedComponents = require('../../result').ParsedComponents;\nvar Refiner = require('../refiner').Refiner;\n\n\nvar PATTERN = new RegExp(\"^\\\\s*(at|after|before|on|,|-|\\\\(|\\\\))?\\\\s*$\");\n\nfunction isMoreSpecific(prevResult, currResult) {\n var moreSpecific = false;\n\n if (prevResult.start.isCertain('year')) {\n if (!currResult.start.isCertain('year')) {\n moreSpecific = true;\n } else {\n if (prevResult.start.isCertain('month')) {\n if (!currResult.start.isCertain('month')) {\n moreSpecific = true;\n } else {\n if (prevResult.start.isCertain('day') && !currResult.start.isCertain('day')) {\n moreSpecific = true;\n }\n }\n }\n }\n }\n\n return moreSpecific;\n}\n\n\nfunction isAbleToMerge(text, prevResult, currResult) {\n var textBetween = text.substring(prevResult.index + prevResult.text.length, currResult.index);\n\n // Only accepts merge if one of them comes from casual relative date\n var includesRelativeResult = (prevResult.tags['ENRelativeDateFormatParser'] || currResult.tags['ENRelativeDateFormatParser']);\n\n // We assume they refer to the same date if all date fields are implied\n var referToSameDate = !prevResult.start.isCertain('day') && !prevResult.start.isCertain('month') && !prevResult.start.isCertain('year');\n\n // If both years are certain, that determines if they refer to the same date\n // but with one more specific than the other\n if (prevResult.start.isCertain('year') && currResult.start.isCertain('year'))\n referToSameDate = (prevResult.start.get('year') === currResult.start.get('year'));\n\n // We now test with the next level (month) if they refer to the same date\n if (prevResult.start.isCertain('month') && currResult.start.isCertain('month'))\n referToSameDate = (prevResult.start.get('month') === currResult.start.get('month')) && referToSameDate;\n\n return includesRelativeResult && textBetween.match(PATTERN) && referToSameDate;\n}\n\nfunction mergeResult(text, specificResult, nonSpecificResult){\n\n var specificDate = specificResult.start;\n var nonSpecificDate = nonSpecificResult.start;\n\n var startIndex = Math.min(specificResult.index, nonSpecificResult.index);\n var endIndex = Math.max(\n specificResult.index + specificResult.text.length,\n nonSpecificResult.index + nonSpecificResult.text.length);\n\n specificResult.index = startIndex;\n specificResult.text = text.substring(startIndex, endIndex);\n\n for (var tag in nonSpecificResult.tags) {\n specificResult.tags[tag] = true;\n }\n specificResult.tags['ENPrioritizeSpecificDateRefiner'] = true;\n return specificResult;\n}\n\nexports.Refiner = function ENPrioritizeSpecificDateRefiner() {\n Refiner.call(this);\n\n this.refine = function(text, results, opt) {\n\n if (results.length < 2) return results;\n\n var mergedResult = [];\n var currResult = null;\n var prevResult = null;\n\n for (var i = 1; i < results.length; i++) {\n\n currResult = results[i];\n prevResult = results[i-1];\n\n if (isMoreSpecific(prevResult, currResult)\n && isAbleToMerge(text, prevResult, currResult)) {\n\n prevResult = mergeResult(text, prevResult, currResult);\n currResult = null;\n i += 1;\n\n } else if (isMoreSpecific(currResult, prevResult)\n && isAbleToMerge(text, prevResult, currResult)) {\n\n prevResult = mergeResult(text, currResult, prevResult);\n currResult = null;\n i += 1;\n }\n\n mergedResult.push(prevResult);\n }\n\n if (currResult != null) {\n mergedResult.push(currResult);\n }\n\n return mergedResult;\n }\n}\n","/*\n \n*/\nvar ENMergeDateRangeRefiner = require('../en/ENMergeDateRangeRefiner').Refiner;\n\nexports.Refiner = function JPMergeDateRangeRefiner() {\n ENMergeDateRangeRefiner.call(this);\n\n this.pattern = function () { return /^\\s*(から|ー)\\s*$/i };\n}\n\n","/*\r\n \r\n*/\r\nvar Refiner = require('../refiner').Refiner;\r\n\r\nexports.Refiner = function FRMergeDateRangeRefiner() {\r\n Refiner.call(this);\r\n\r\n this.pattern = function () { return /^\\s*(à|a|\\-)\\s*$/i };\r\n\r\n this.refine = function(text, results, opt) {\r\n\r\n if (results.length < 2) return results;\r\n \r\n var mergedResult = [];\r\n var currResult = null;\r\n var prevResult = null;\r\n \r\n for (var i=1; i toResult.start.date()) {\r\n var tmp = toResult;\r\n toResult = fromResult;\r\n fromResult = tmp;\r\n }\r\n \r\n fromResult.end = toResult.start;\r\n\r\n \r\n\r\n for (var tag in toResult.tags) {\r\n fromResult.tags[tag] = true;\r\n }\r\n\r\n \r\n var startIndex = Math.min(fromResult.index, toResult.index);\r\n var endIndex = Math.max(\r\n fromResult.index + fromResult.text.length, \r\n toResult.index + toResult.text.length);\r\n \r\n fromResult.index = startIndex;\r\n fromResult.text = text.substring(startIndex, endIndex);\r\n fromResult.tags[this.constructor.name] = true;\r\n return fromResult;\r\n }\r\n};\r\n\r\n","/*\r\n \r\n*/\r\nvar ParsedComponents = require('../../result').ParsedComponents;\r\nvar Refiner = require('../refiner').Refiner;\r\nvar mergeDateTimeComponent = require('../en/ENMergeDateTimeRefiner').mergeDateTimeComponent;\r\n\r\nvar PATTERN = new RegExp(\"^\\\\s*(T|à|a|vers|de|,|-)?\\\\s*$\");\r\n\r\nfunction isDateOnly(result) {\r\n return !result.start.isCertain('hour') || result.tags['FRCasualDateParser'];\r\n}\r\n \r\nfunction isTimeOnly(result) {\r\n return !result.start.isCertain('month') && !result.start.isCertain('weekday');\r\n}\r\n\r\n\r\nfunction isAbleToMerge(text, prevResult, curResult) {\r\n var textBetween = text.substring(prevResult.index + prevResult.text.length, curResult.index);\r\n return textBetween.match(PATTERN);\r\n}\r\n\r\nfunction mergeResult(text, dateResult, timeResult){\r\n\r\n var beginDate = dateResult.start;\r\n var beginTime = timeResult.start;\r\n var beginDateTime = mergeDateTimeComponent(beginDate, beginTime);\r\n\r\n if (dateResult.end != null || timeResult.end != null) {\r\n \r\n var endDate = dateResult.end == null ? dateResult.start : dateResult.end; \r\n var endTime = timeResult.end == null ? timeResult.start : timeResult.end;\r\n var endDateTime = mergeDateTimeComponent(endDate, endTime);\r\n \r\n if (dateResult.end == null && endDateTime.date().getTime() < beginDateTime.date().getTime()) {\r\n // Ex. 9pm - 1am\r\n if (endDateTime.isCertain('day')) {\r\n endDateTime.assign('day', endDateTime.get('day') + 1);\r\n } else {\r\n endDateTime.imply('day', endDateTime.get('day') + 1);\r\n }\r\n }\r\n\r\n dateResult.end = endDateTime;\r\n }\r\n\r\n dateResult.start = beginDateTime; \r\n\r\n var startIndex = Math.min(dateResult.index, timeResult.index);\r\n var endIndex = Math.max(\r\n dateResult.index + dateResult.text.length, \r\n timeResult.index + timeResult.text.length);\r\n \r\n dateResult.index = startIndex;\r\n dateResult.text = text.substring(startIndex, endIndex);\r\n\r\n for (var tag in timeResult.tags) {\r\n dateResult.tags[tag] = true;\r\n }\r\n dateResult.tags['FRMergeDateAndTimeRefiner'] = true;\r\n return dateResult;\r\n}\r\n\r\nexports.Refiner = function FRMergeDateTimeRefiner() {\r\n Refiner.call(this);\r\n\r\n\r\n this.refine = function(text, results, opt) { \r\n\r\n if (results.length < 2) return results;\r\n\r\n var mergedResult = [];\r\n var currResult = null;\r\n var prevResult = null;\r\n\r\n for (var i = 1; i < results.length; i++) {\r\n\r\n currResult = results[i];\r\n prevResult = results[i-1];\r\n \r\n if (isDateOnly(prevResult) && isTimeOnly(currResult) \r\n && isAbleToMerge(text, prevResult, currResult)) {\r\n \r\n prevResult = mergeResult(text, prevResult, currResult);\r\n currResult = null;\r\n i += 1;\r\n \r\n } else if (isDateOnly(currResult) && isTimeOnly(prevResult)\r\n && isAbleToMerge(text, prevResult, currResult)) {\r\n \r\n prevResult = mergeResult(text, currResult, prevResult);\r\n currResult = null;\r\n i += 1;\r\n }\r\n \r\n mergedResult.push(prevResult);\r\n }\r\n\r\n if (currResult != null) {\r\n mergedResult.push(currResult);\r\n }\r\n\r\n return mergedResult;\r\n }\r\n}","/*\n \n*/\nvar ENMergeDateRangeRefiner = require('../en/ENMergeDateRangeRefiner').Refiner;\n\nexports.Refiner = function DEMergeDateRangeRefiner() {\n ENMergeDateRangeRefiner.call(this);\n\n this.pattern = function () {\n return /^\\s*(bis(?:\\s*(?:am|zum))?|\\-)\\s*$/i\n };\n};\n","/*\n \n*/\nvar ParsedComponents = require('../../result').ParsedComponents;\nvar Refiner = require('../refiner').Refiner;\n\nvar mergeDateTimeComponent = require('../en/ENMergeDateTimeRefiner').mergeDateTimeComponent;\nvar isDateOnly = require('../en/ENMergeDateTimeRefiner').isDateOnly;\nvar isTimeOnly = require('../en/ENMergeDateTimeRefiner').isTimeOnly;\n\nvar PATTERN = new RegExp(\"^\\\\s*(T|um|am|,|-)?\\\\s*$\");\n\nfunction isAbleToMerge(text, prevResult, curResult) {\n var textBetween = text.substring(prevResult.index + prevResult.text.length, curResult.index);\n return textBetween.match(PATTERN);\n}\n\nfunction mergeResult(text, dateResult, timeResult){\n\n var beginDate = dateResult.start;\n var beginTime = timeResult.start; \n var beginDateTime = mergeDateTimeComponent(beginDate, beginTime);\n\n if (dateResult.end != null || timeResult.end != null) {\n \n var endDate = dateResult.end == null ? dateResult.start : dateResult.end; \n var endTime = timeResult.end == null ? timeResult.start : timeResult.end;\n var endDateTime = mergeDateTimeComponent(endDate, endTime);\n \n if (dateResult.end == null && endDateTime.date().getTime() < beginDateTime.date().getTime()) {\n // Ex. 9pm - 1am\n if (endDateTime.isCertain('day')) {\n endDateTime.assign('day', endDateTime.get('day') + 1);\n } else {\n endDateTime.imply('day', endDateTime.get('day') + 1);\n }\n }\n\n dateResult.end = endDateTime;\n }\n\n dateResult.start = beginDateTime; \n\n var startIndex = Math.min(dateResult.index, timeResult.index);\n var endIndex = Math.max(\n dateResult.index + dateResult.text.length, \n timeResult.index + timeResult.text.length);\n \n dateResult.index = startIndex;\n dateResult.text = text.substring(startIndex, endIndex);\n\n for (var tag in timeResult.tags) {\n dateResult.tags[tag] = true;\n }\n dateResult.tags['DEMergeDateAndTimeRefiner'] = true;\n return dateResult;\n}\n\nexports.Refiner = function DEMergeDateTimeRefiner() {\n Refiner.call(this);\n\n\n this.refine = function(text, results, opt) { \n\n if (results.length < 2) return results;\n\n var mergedResult = [];\n var currResult = null;\n var prevResult = null;\n\n for (var i = 1; i < results.length; i++) {\n\n currResult = results[i];\n prevResult = results[i-1];\n \n if (isDateOnly(prevResult) && isTimeOnly(currResult) \n && isAbleToMerge(text, prevResult, currResult)) {\n \n prevResult = mergeResult(text, prevResult, currResult);\n currResult = null;\n i += 1;\n \n } else if (isDateOnly(currResult) && isTimeOnly(prevResult)\n && isAbleToMerge(text, prevResult, currResult)) {\n \n prevResult = mergeResult(text, currResult, prevResult);\n currResult = null;\n i += 1;\n }\n \n mergedResult.push(prevResult);\n }\n\n if (currResult != null) {\n mergedResult.push(currResult);\n }\n\n return mergedResult;\n }\n}","/*\n\n*/\nvar ENMergeDateRangeRefiner = require('../en/ENMergeDateRangeRefiner').Refiner;\n\nexports.Refiner = function NLMergeDateRangeRefiner() {\n ENMergeDateRangeRefiner.call(this);\n\n this.pattern = function () {\n return /^\\s*(tot|t\\/m|tot en met|\\\\-)\\s*$/i;\n };\n};\n","/*\n\n*/\nvar ParsedComponents = require('../../result').ParsedComponents;\nvar Refiner = require('../refiner').Refiner;\n\nvar mergeDateTimeComponent = require('../en/ENMergeDateTimeRefiner').mergeDateTimeComponent;\nvar isDateOnly = require('../en/ENMergeDateTimeRefiner').isDateOnly;\nvar isTimeOnly = require('../en/ENMergeDateTimeRefiner').isTimeOnly;\n\nvar PATTERN = new RegExp(\"^\\\\s*(T|op|om|voor|na|van|,|-)\\\\s*$\");\n\nfunction isAbleToMerge(text, prevResult, curResult) {\n var textBetween = text.substring(prevResult.index + prevResult.text.length, curResult.index);\n return textBetween.match(PATTERN);\n}\n\nfunction mergeResult(text, dateResult, timeResult){\n\n var beginDate = dateResult.start;\n var beginTime = timeResult.start;\n var beginDateTime = mergeDateTimeComponent(beginDate, beginTime);\n\n if (dateResult.end != null || timeResult.end != null) {\n\n var endDate = dateResult.end == null ? dateResult.start : dateResult.end;\n var endTime = timeResult.end == null ? timeResult.start : timeResult.end;\n var endDateTime = mergeDateTimeComponent(endDate, endTime);\n\n if (dateResult.end == null && endDateTime.date().getTime() < beginDateTime.date().getTime()) {\n // Ex. 9pm - 1am\n if (endDateTime.isCertain('day')) {\n endDateTime.assign('day', endDateTime.get('day') + 1);\n } else {\n endDateTime.imply('day', endDateTime.get('day') + 1);\n }\n }\n\n dateResult.end = endDateTime;\n }\n\n dateResult.start = beginDateTime;\n\n var startIndex = Math.min(dateResult.index, timeResult.index);\n var endIndex = Math.max(\n dateResult.index + dateResult.text.length,\n timeResult.index + timeResult.text.length);\n\n dateResult.index = startIndex;\n dateResult.text = text.substring(startIndex, endIndex);\n\n for (var tag in timeResult.tags) {\n dateResult.tags[tag] = true;\n }\n dateResult.tags['NLMergeDateAndTimeRefiner'] = true;\n return dateResult;\n}\n\nexports.Refiner = function NLMergeDateTimeRefiner() {\n Refiner.call(this);\n\n\n this.refine = function(text, results, opt) {\n\n if (results.length < 2) return results;\n\n var mergedResult = [];\n var currResult = null;\n var prevResult = null;\n\n for (var i = 1; i < results.length; i++) {\n\n currResult = results[i];\n prevResult = results[i-1];\n if (isDateOnly(currResult) && isTimeOnly(prevResult)\n && isAbleToMerge(text, prevResult, currResult)) {\n\n prevResult = mergeResult(text, currResult, prevResult);\n currResult = null;\n i += 1;\n mergedResult.push(prevResult);\n } else {\n mergedResult.push(prevResult);\n }\n\n }\n\n if (currResult != null) {\n mergedResult.push(currResult);\n }\n\n return mergedResult;\n }\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/package.json b/package.json index 5072b91e..91f55894 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "testURL": "http://localhost/" }, "license": "MIT", - "version": "1.4.8", + "version": "1.4.9", "directories": { "source": "./src", "test": "./test"