8567 lines
254 KiB
JavaScript
8567 lines
254 KiB
JavaScript
// ==UserScript==
|
||
// @name 3CX TAPI
|
||
// @namespace http://cp-solutions.at
|
||
// @version 9.0.2
|
||
// @author Daniel Triendl <d.triendl@cp-solutions.at>
|
||
// @copyright Copyright 2021 CP Solutions GmbH
|
||
// @source https://source.cp-austria.at/git/CPATRD/3cx_tapi.git
|
||
// @downloadURL https://source.cp-austria.at/git/CPATRD/3cx_tapi/raw/branch/master/3CX_TAPI.user.js
|
||
// @match https://192.168.0.154:5001/webclient*
|
||
// @match https://cpsolution.my3cx.at:5001/webclient*
|
||
// @require https://cdn.jsdelivr.net/gh/CoeJoder/waitForKeyElements.js@v1.2/waitForKeyElements.js
|
||
// @require https://cdn.jsdelivr.net/npm/axios@0.21.1/dist/axios.min.js
|
||
// @require https://cdn.jsdelivr.net/npm/axios-userscript-adapter@0.1.4/dist/axiosGmxhrAdapter.min.js
|
||
// @grant GM.xmlHttpRequest
|
||
// @grant GM.notification
|
||
// @grant GM.getValue
|
||
// @grant GM.setValue
|
||
// @connect cpatapi.cpsrvweb2016.cp-austria.at
|
||
// @run-at document-end
|
||
// ==/UserScript==
|
||
|
||
|
||
/******/ (function() { // webpackBootstrap
|
||
/******/ var __webpack_modules__ = ({
|
||
|
||
/***/ "./node_modules/chrono-node/dist/calculation/mergingCalculation.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.mergeDateTimeComponent = exports.mergeDateTimeResult = void 0;
|
||
|
||
const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js");
|
||
|
||
function mergeDateTimeResult(dateResult, timeResult) {
|
||
const result = dateResult.clone();
|
||
const beginDate = dateResult.start;
|
||
const beginTime = timeResult.start;
|
||
result.start = mergeDateTimeComponent(beginDate, beginTime);
|
||
|
||
if (dateResult.end != null || timeResult.end != null) {
|
||
const endDate = dateResult.end == null ? dateResult.start : dateResult.end;
|
||
const endTime = timeResult.end == null ? timeResult.start : timeResult.end;
|
||
const endDateTime = mergeDateTimeComponent(endDate, endTime);
|
||
|
||
if (dateResult.end == null && endDateTime.date().getTime() < result.start.date().getTime()) {
|
||
if (endDateTime.isCertain("day")) {
|
||
endDateTime.assign("day", endDateTime.get("day") + 1);
|
||
} else {
|
||
endDateTime.imply("day", endDateTime.get("day") + 1);
|
||
}
|
||
}
|
||
|
||
result.end = endDateTime;
|
||
}
|
||
|
||
return result;
|
||
}
|
||
|
||
exports.mergeDateTimeResult = mergeDateTimeResult;
|
||
|
||
function mergeDateTimeComponent(dateComponent, timeComponent) {
|
||
const dateTimeComponent = dateComponent.clone();
|
||
|
||
if (timeComponent.isCertain("hour")) {
|
||
dateTimeComponent.assign("hour", timeComponent.get("hour"));
|
||
dateTimeComponent.assign("minute", timeComponent.get("minute"));
|
||
|
||
if (timeComponent.isCertain("second")) {
|
||
dateTimeComponent.assign("second", timeComponent.get("second"));
|
||
|
||
if (timeComponent.isCertain("millisecond")) {
|
||
dateTimeComponent.assign("millisecond", timeComponent.get("millisecond"));
|
||
} else {
|
||
dateTimeComponent.imply("millisecond", timeComponent.get("millisecond"));
|
||
}
|
||
} else {
|
||
dateTimeComponent.imply("second", timeComponent.get("second"));
|
||
dateTimeComponent.imply("millisecond", timeComponent.get("millisecond"));
|
||
}
|
||
} else {
|
||
dateTimeComponent.imply("hour", timeComponent.get("hour"));
|
||
dateTimeComponent.imply("minute", timeComponent.get("minute"));
|
||
dateTimeComponent.imply("second", timeComponent.get("second"));
|
||
dateTimeComponent.imply("millisecond", timeComponent.get("millisecond"));
|
||
}
|
||
|
||
if (timeComponent.isCertain("timezoneOffset")) {
|
||
dateTimeComponent.assign("timezoneOffset", timeComponent.get("timezoneOffset"));
|
||
}
|
||
|
||
if (timeComponent.isCertain("meridiem")) {
|
||
dateTimeComponent.assign("meridiem", timeComponent.get("meridiem"));
|
||
} else if (timeComponent.get("meridiem") != null && dateTimeComponent.get("meridiem") == null) {
|
||
dateTimeComponent.imply("meridiem", timeComponent.get("meridiem"));
|
||
}
|
||
|
||
if (dateTimeComponent.get("meridiem") == index_1.Meridiem.PM && dateTimeComponent.get("hour") < 12) {
|
||
if (timeComponent.isCertain("hour")) {
|
||
dateTimeComponent.assign("hour", dateTimeComponent.get("hour") + 12);
|
||
} else {
|
||
dateTimeComponent.imply("hour", dateTimeComponent.get("hour") + 12);
|
||
}
|
||
}
|
||
|
||
return dateTimeComponent;
|
||
}
|
||
|
||
exports.mergeDateTimeComponent = mergeDateTimeComponent;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/calculation/weeks.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.toDayJSClosestWeekday = exports.toDayJSWeekday = void 0;
|
||
|
||
const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js"));
|
||
|
||
function toDayJSWeekday(refDate, offset, modifier) {
|
||
if (!modifier) {
|
||
return toDayJSClosestWeekday(refDate, offset);
|
||
}
|
||
|
||
let date = dayjs_1.default(refDate);
|
||
|
||
switch (modifier) {
|
||
case "this":
|
||
date = date.day(offset);
|
||
break;
|
||
|
||
case "next":
|
||
date = date.day(offset + 7);
|
||
break;
|
||
|
||
case "last":
|
||
date = date.day(offset - 7);
|
||
break;
|
||
}
|
||
|
||
return date;
|
||
}
|
||
|
||
exports.toDayJSWeekday = toDayJSWeekday;
|
||
|
||
function toDayJSClosestWeekday(refDate, offset) {
|
||
let date = dayjs_1.default(refDate);
|
||
const refOffset = date.day();
|
||
|
||
if (Math.abs(offset - 7 - refOffset) < Math.abs(offset - refOffset)) {
|
||
date = date.day(offset - 7);
|
||
} else if (Math.abs(offset + 7 - refOffset) < Math.abs(offset - refOffset)) {
|
||
date = date.day(offset + 7);
|
||
} else {
|
||
date = date.day(offset);
|
||
}
|
||
|
||
return date;
|
||
}
|
||
|
||
exports.toDayJSClosestWeekday = toDayJSClosestWeekday;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/calculation/years.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.findYearClosestToRef = exports.findMostLikelyADYear = void 0;
|
||
|
||
const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js"));
|
||
|
||
function findMostLikelyADYear(yearNumber) {
|
||
if (yearNumber < 100) {
|
||
if (yearNumber > 50) {
|
||
yearNumber = yearNumber + 1900;
|
||
} else {
|
||
yearNumber = yearNumber + 2000;
|
||
}
|
||
}
|
||
|
||
return yearNumber;
|
||
}
|
||
|
||
exports.findMostLikelyADYear = findMostLikelyADYear;
|
||
|
||
function findYearClosestToRef(refDate, day, month) {
|
||
const refMoment = dayjs_1.default(refDate);
|
||
let dateMoment = refMoment;
|
||
dateMoment = dateMoment.month(month - 1);
|
||
dateMoment = dateMoment.date(day);
|
||
dateMoment = dateMoment.year(refMoment.year());
|
||
const nextYear = dateMoment.add(1, "y");
|
||
const lastYear = dateMoment.add(-1, "y");
|
||
|
||
if (Math.abs(nextYear.diff(refMoment)) < Math.abs(dateMoment.diff(refMoment))) {
|
||
dateMoment = nextYear;
|
||
} else if (Math.abs(lastYear.diff(refMoment)) < Math.abs(dateMoment.diff(refMoment))) {
|
||
dateMoment = lastYear;
|
||
}
|
||
|
||
return dateMoment.year();
|
||
}
|
||
|
||
exports.findYearClosestToRef = findYearClosestToRef;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/chrono.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.ParsingContext = exports.Chrono = void 0;
|
||
|
||
const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js");
|
||
|
||
const en_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/index.js");
|
||
|
||
class Chrono {
|
||
constructor(configuration) {
|
||
configuration = configuration || en_1.createCasualConfiguration();
|
||
this.parsers = [...configuration.parsers];
|
||
this.refiners = [...configuration.refiners];
|
||
}
|
||
|
||
clone() {
|
||
return new Chrono({
|
||
parsers: [...this.parsers],
|
||
refiners: [...this.refiners]
|
||
});
|
||
}
|
||
|
||
parseDate(text, referenceDate, option) {
|
||
const results = this.parse(text, referenceDate, option);
|
||
return results.length > 0 ? results[0].start.date() : null;
|
||
}
|
||
|
||
parse(text, referenceDate, option) {
|
||
const context = new ParsingContext(text, referenceDate, option);
|
||
let results = [];
|
||
this.parsers.forEach(parser => {
|
||
const parsedResults = Chrono.executeParser(context, parser);
|
||
results = results.concat(parsedResults);
|
||
});
|
||
results.sort((a, b) => {
|
||
return a.index - b.index;
|
||
});
|
||
this.refiners.forEach(function (refiner) {
|
||
results = refiner.refine(context, results);
|
||
});
|
||
return results;
|
||
}
|
||
|
||
static executeParser(context, parser) {
|
||
const results = [];
|
||
const pattern = parser.pattern(context);
|
||
const originalText = context.text;
|
||
let remainingText = context.text;
|
||
let match = pattern.exec(remainingText);
|
||
|
||
while (match) {
|
||
const index = match.index + originalText.length - remainingText.length;
|
||
match.index = index;
|
||
const result = parser.extract(context, match);
|
||
|
||
if (!result) {
|
||
remainingText = originalText.substring(match.index + 1);
|
||
match = pattern.exec(remainingText);
|
||
continue;
|
||
}
|
||
|
||
let parsedResult = null;
|
||
|
||
if (result instanceof results_1.ParsingResult) {
|
||
parsedResult = result;
|
||
} else if (result instanceof results_1.ParsingComponents) {
|
||
parsedResult = context.createParsingResult(match.index, match[0]);
|
||
parsedResult.start = result;
|
||
} else {
|
||
parsedResult = context.createParsingResult(match.index, match[0], result);
|
||
}
|
||
|
||
context.debug(() => console.log(`${parser.constructor.name} extracted result ${parsedResult}`));
|
||
results.push(parsedResult);
|
||
remainingText = originalText.substring(index + parsedResult.text.length);
|
||
match = pattern.exec(remainingText);
|
||
}
|
||
|
||
return results;
|
||
}
|
||
|
||
}
|
||
|
||
exports.Chrono = Chrono;
|
||
|
||
class ParsingContext {
|
||
constructor(text, refDate, option) {
|
||
this.text = text;
|
||
this.reference = new results_1.ReferenceWithTimezone(refDate);
|
||
this.option = option !== null && option !== void 0 ? option : {};
|
||
this.refDate = this.reference.instant;
|
||
}
|
||
|
||
createParsingComponents(components) {
|
||
if (components instanceof results_1.ParsingComponents) {
|
||
return components;
|
||
}
|
||
|
||
return new results_1.ParsingComponents(this.reference, components);
|
||
}
|
||
|
||
createParsingResult(index, textOrEndIndex, startComponents, endComponents) {
|
||
const text = typeof textOrEndIndex === "string" ? textOrEndIndex : this.text.substring(index, textOrEndIndex);
|
||
const start = startComponents ? this.createParsingComponents(startComponents) : null;
|
||
const end = endComponents ? this.createParsingComponents(endComponents) : null;
|
||
return new results_1.ParsingResult(this.reference, index, text, start, end);
|
||
}
|
||
|
||
debug(block) {
|
||
if (this.option.debug) {
|
||
if (this.option.debug instanceof Function) {
|
||
this.option.debug(block);
|
||
} else {
|
||
const handler = this.option.debug;
|
||
handler.debug(block);
|
||
}
|
||
}
|
||
}
|
||
|
||
}
|
||
|
||
exports.ParsingContext = ParsingContext;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/common/abstractRefiners.js":
|
||
/***/ (function(__unused_webpack_module, exports) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.MergingRefiner = exports.Filter = void 0;
|
||
|
||
class Filter {
|
||
refine(context, results) {
|
||
return results.filter(r => this.isValid(context, r));
|
||
}
|
||
|
||
}
|
||
|
||
exports.Filter = Filter;
|
||
|
||
class MergingRefiner {
|
||
refine(context, results) {
|
||
if (results.length < 2) {
|
||
return results;
|
||
}
|
||
|
||
const mergedResults = [];
|
||
let curResult = results[0];
|
||
let nextResult = null;
|
||
|
||
for (let i = 1; i < results.length; i++) {
|
||
nextResult = results[i];
|
||
const textBetween = context.text.substring(curResult.index + curResult.text.length, nextResult.index);
|
||
|
||
if (!this.shouldMergeResults(textBetween, curResult, nextResult, context)) {
|
||
mergedResults.push(curResult);
|
||
curResult = nextResult;
|
||
} else {
|
||
const left = curResult;
|
||
const right = nextResult;
|
||
const mergedResult = this.mergeResults(textBetween, left, right, context);
|
||
context.debug(() => {
|
||
console.log(`${this.constructor.name} merged ${left} and ${right} into ${mergedResult}`);
|
||
});
|
||
curResult = mergedResult;
|
||
}
|
||
}
|
||
|
||
if (curResult != null) {
|
||
mergedResults.push(curResult);
|
||
}
|
||
|
||
return mergedResults;
|
||
}
|
||
|
||
}
|
||
|
||
exports.MergingRefiner = MergingRefiner;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/common/casualReferences.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.tonight = exports.tomorrow = exports.yesterday = exports.today = exports.now = void 0;
|
||
|
||
const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js");
|
||
|
||
const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js"));
|
||
|
||
const dayjs_2 = __webpack_require__("./node_modules/chrono-node/dist/utils/dayjs.js");
|
||
|
||
const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js");
|
||
|
||
function now(reference) {
|
||
const targetDate = dayjs_1.default(reference.instant);
|
||
const component = new results_1.ParsingComponents(reference, {});
|
||
dayjs_2.assignSimilarDate(component, targetDate);
|
||
dayjs_2.assignSimilarTime(component, targetDate);
|
||
component.assign("timezoneOffset", targetDate.utcOffset());
|
||
return component;
|
||
}
|
||
|
||
exports.now = now;
|
||
|
||
function today(reference) {
|
||
const targetDate = dayjs_1.default(reference.instant);
|
||
const component = new results_1.ParsingComponents(reference, {});
|
||
dayjs_2.assignSimilarDate(component, targetDate);
|
||
dayjs_2.implySimilarTime(component, targetDate);
|
||
return component;
|
||
}
|
||
|
||
exports.today = today;
|
||
|
||
function yesterday(reference) {
|
||
let targetDate = dayjs_1.default(reference.instant);
|
||
const component = new results_1.ParsingComponents(reference, {});
|
||
targetDate = targetDate.add(-1, "day");
|
||
dayjs_2.assignSimilarDate(component, targetDate);
|
||
dayjs_2.implySimilarTime(component, targetDate);
|
||
return component;
|
||
}
|
||
|
||
exports.yesterday = yesterday;
|
||
|
||
function tomorrow(reference) {
|
||
const targetDate = dayjs_1.default(reference.instant);
|
||
const component = new results_1.ParsingComponents(reference, {});
|
||
dayjs_2.assignTheNextDay(component, targetDate);
|
||
return component;
|
||
}
|
||
|
||
exports.tomorrow = tomorrow;
|
||
|
||
function tonight(reference, implyHour = 22) {
|
||
const targetDate = dayjs_1.default(reference.instant);
|
||
const component = new results_1.ParsingComponents(reference, {});
|
||
component.imply("hour", implyHour);
|
||
component.imply("meridiem", index_1.Meridiem.PM);
|
||
dayjs_2.assignSimilarDate(component, targetDate);
|
||
return component;
|
||
}
|
||
|
||
exports.tonight = tonight;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js":
|
||
/***/ (function(__unused_webpack_module, exports) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.AbstractParserWithWordBoundaryChecking = void 0;
|
||
|
||
class AbstractParserWithWordBoundaryChecking {
|
||
constructor() {
|
||
this.cachedInnerPattern = null;
|
||
this.cachedPattern = null;
|
||
}
|
||
|
||
pattern(context) {
|
||
const innerPattern = this.innerPattern(context);
|
||
|
||
if (innerPattern == this.cachedInnerPattern) {
|
||
return this.cachedPattern;
|
||
}
|
||
|
||
this.cachedPattern = new RegExp(`(\\W|^)${innerPattern.source}`, innerPattern.flags);
|
||
this.cachedInnerPattern = innerPattern;
|
||
return this.cachedPattern;
|
||
}
|
||
|
||
extract(context, match) {
|
||
const header = match[1];
|
||
match.index = match.index + header.length;
|
||
match[0] = match[0].substring(header.length);
|
||
|
||
for (let i = 2; i < match.length; i++) {
|
||
match[i - 1] = match[i];
|
||
}
|
||
|
||
return this.innerExtract(context, match);
|
||
}
|
||
|
||
}
|
||
|
||
exports.AbstractParserWithWordBoundaryChecking = AbstractParserWithWordBoundaryChecking;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/common/parsers/AbstractTimeExpressionParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.AbstractTimeExpressionParser = void 0;
|
||
|
||
const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js");
|
||
|
||
function primaryTimePattern(primaryPrefix, primarySuffix) {
|
||
return new RegExp("(^|\\s|T|\\b)" + `${primaryPrefix}` + "(\\d{1,4})" + "(?:" + "(?:\\.|\\:|\\:)" + "(\\d{1,2})" + "(?:" + "(?:\\:|\\:)" + "(\\d{2})" + "(?:\\.(\\d{1,6}))?" + ")?" + ")?" + "(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?" + `${primarySuffix}`, "i");
|
||
}
|
||
|
||
function followingTimePatten(followingPhase, followingSuffix) {
|
||
return new RegExp(`^(${followingPhase})` + "(\\d{1,4})" + "(?:" + "(?:\\.|\\:|\\:)" + "(\\d{1,2})" + "(?:" + "(?:\\.|\\:|\\:)" + "(\\d{1,2})(?:\\.(\\d{1,6}))?" + ")?" + ")?" + "(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?" + `${followingSuffix}`, "i");
|
||
}
|
||
|
||
const HOUR_GROUP = 2;
|
||
const MINUTE_GROUP = 3;
|
||
const SECOND_GROUP = 4;
|
||
const MILLI_SECOND_GROUP = 5;
|
||
const AM_PM_HOUR_GROUP = 6;
|
||
|
||
class AbstractTimeExpressionParser {
|
||
constructor(strictMode = false) {
|
||
this.cachedPrimaryPrefix = null;
|
||
this.cachedPrimarySuffix = null;
|
||
this.cachedPrimaryTimePattern = null;
|
||
this.cachedFollowingPhase = null;
|
||
this.cachedFollowingSuffix = null;
|
||
this.cachedFollowingTimePatten = null;
|
||
this.strictMode = strictMode;
|
||
}
|
||
|
||
primarySuffix() {
|
||
return "(?=\\W|$)";
|
||
}
|
||
|
||
followingSuffix() {
|
||
return "(?=\\W|$)";
|
||
}
|
||
|
||
pattern(context) {
|
||
return this.getPrimaryTimePatternThroughCache();
|
||
}
|
||
|
||
extract(context, match) {
|
||
const startComponents = this.extractPrimaryTimeComponents(context, match);
|
||
|
||
if (!startComponents) {
|
||
match.index += match[0].length;
|
||
return null;
|
||
}
|
||
|
||
const index = match.index + match[1].length;
|
||
const text = match[0].substring(match[1].length);
|
||
const result = context.createParsingResult(index, text, startComponents);
|
||
match.index += match[0].length;
|
||
const remainingText = context.text.substring(match.index);
|
||
const followingPattern = this.getFollowingTimePatternThroughCache();
|
||
const followingMatch = followingPattern.exec(remainingText);
|
||
|
||
if (!followingMatch || followingMatch[0].match(/^\s*([+-])\s*\d{3,4}$/)) {
|
||
return this.checkAndReturnWithoutFollowingPattern(result);
|
||
}
|
||
|
||
result.end = this.extractFollowingTimeComponents(context, followingMatch, result);
|
||
|
||
if (result.end) {
|
||
result.text += followingMatch[0];
|
||
}
|
||
|
||
return this.checkAndReturnWithFollowingPattern(result);
|
||
}
|
||
|
||
extractPrimaryTimeComponents(context, match, strict = false) {
|
||
const components = context.createParsingComponents();
|
||
let minute = 0;
|
||
let meridiem = null;
|
||
let hour = parseInt(match[HOUR_GROUP]);
|
||
|
||
if (hour > 100) {
|
||
if (this.strictMode || match[MINUTE_GROUP] != null) {
|
||
return null;
|
||
}
|
||
|
||
minute = hour % 100;
|
||
hour = Math.floor(hour / 100);
|
||
}
|
||
|
||
if (hour > 24) {
|
||
return null;
|
||
}
|
||
|
||
if (match[MINUTE_GROUP] != null) {
|
||
if (match[MINUTE_GROUP].length == 1 && !match[AM_PM_HOUR_GROUP]) {
|
||
return null;
|
||
}
|
||
|
||
minute = parseInt(match[MINUTE_GROUP]);
|
||
}
|
||
|
||
if (minute >= 60) {
|
||
return null;
|
||
}
|
||
|
||
if (hour > 12) {
|
||
meridiem = index_1.Meridiem.PM;
|
||
}
|
||
|
||
if (match[AM_PM_HOUR_GROUP] != null) {
|
||
if (hour > 12) return null;
|
||
const ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();
|
||
|
||
if (ampm == "a") {
|
||
meridiem = index_1.Meridiem.AM;
|
||
|
||
if (hour == 12) {
|
||
hour = 0;
|
||
}
|
||
}
|
||
|
||
if (ampm == "p") {
|
||
meridiem = index_1.Meridiem.PM;
|
||
|
||
if (hour != 12) {
|
||
hour += 12;
|
||
}
|
||
}
|
||
}
|
||
|
||
components.assign("hour", hour);
|
||
components.assign("minute", minute);
|
||
|
||
if (meridiem !== null) {
|
||
components.assign("meridiem", meridiem);
|
||
} else {
|
||
if (hour < 12) {
|
||
components.imply("meridiem", index_1.Meridiem.AM);
|
||
} else {
|
||
components.imply("meridiem", index_1.Meridiem.PM);
|
||
}
|
||
}
|
||
|
||
if (match[MILLI_SECOND_GROUP] != null) {
|
||
const millisecond = parseInt(match[MILLI_SECOND_GROUP].substring(0, 3));
|
||
if (millisecond >= 1000) return null;
|
||
components.assign("millisecond", millisecond);
|
||
}
|
||
|
||
if (match[SECOND_GROUP] != null) {
|
||
const second = parseInt(match[SECOND_GROUP]);
|
||
if (second >= 60) return null;
|
||
components.assign("second", second);
|
||
}
|
||
|
||
return components;
|
||
}
|
||
|
||
extractFollowingTimeComponents(context, match, result) {
|
||
const components = context.createParsingComponents();
|
||
|
||
if (match[MILLI_SECOND_GROUP] != null) {
|
||
const millisecond = parseInt(match[MILLI_SECOND_GROUP].substring(0, 3));
|
||
if (millisecond >= 1000) return null;
|
||
components.assign("millisecond", millisecond);
|
||
}
|
||
|
||
if (match[SECOND_GROUP] != null) {
|
||
const second = parseInt(match[SECOND_GROUP]);
|
||
if (second >= 60) return null;
|
||
components.assign("second", second);
|
||
}
|
||
|
||
let hour = parseInt(match[HOUR_GROUP]);
|
||
let minute = 0;
|
||
let meridiem = -1;
|
||
|
||
if (match[MINUTE_GROUP] != null) {
|
||
minute = parseInt(match[MINUTE_GROUP]);
|
||
} else if (hour > 100) {
|
||
minute = hour % 100;
|
||
hour = Math.floor(hour / 100);
|
||
}
|
||
|
||
if (minute >= 60 || hour > 24) {
|
||
return null;
|
||
}
|
||
|
||
if (hour >= 12) {
|
||
meridiem = index_1.Meridiem.PM;
|
||
}
|
||
|
||
if (match[AM_PM_HOUR_GROUP] != null) {
|
||
if (hour > 12) {
|
||
return null;
|
||
}
|
||
|
||
const ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();
|
||
|
||
if (ampm == "a") {
|
||
meridiem = index_1.Meridiem.AM;
|
||
|
||
if (hour == 12) {
|
||
hour = 0;
|
||
|
||
if (!components.isCertain("day")) {
|
||
components.imply("day", components.get("day") + 1);
|
||
}
|
||
}
|
||
}
|
||
|
||
if (ampm == "p") {
|
||
meridiem = index_1.Meridiem.PM;
|
||
if (hour != 12) hour += 12;
|
||
}
|
||
|
||
if (!result.start.isCertain("meridiem")) {
|
||
if (meridiem == index_1.Meridiem.AM) {
|
||
result.start.imply("meridiem", index_1.Meridiem.AM);
|
||
|
||
if (result.start.get("hour") == 12) {
|
||
result.start.assign("hour", 0);
|
||
}
|
||
} else {
|
||
result.start.imply("meridiem", index_1.Meridiem.PM);
|
||
|
||
if (result.start.get("hour") != 12) {
|
||
result.start.assign("hour", result.start.get("hour") + 12);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
components.assign("hour", hour);
|
||
components.assign("minute", minute);
|
||
|
||
if (meridiem >= 0) {
|
||
components.assign("meridiem", meridiem);
|
||
} else {
|
||
const startAtPM = result.start.isCertain("meridiem") && result.start.get("hour") > 12;
|
||
|
||
if (startAtPM) {
|
||
if (result.start.get("hour") - 12 > hour) {
|
||
components.imply("meridiem", index_1.Meridiem.AM);
|
||
} else if (hour <= 12) {
|
||
components.assign("hour", hour + 12);
|
||
components.assign("meridiem", index_1.Meridiem.PM);
|
||
}
|
||
} else if (hour > 12) {
|
||
components.imply("meridiem", index_1.Meridiem.PM);
|
||
} else if (hour <= 12) {
|
||
components.imply("meridiem", index_1.Meridiem.AM);
|
||
}
|
||
}
|
||
|
||
if (components.date().getTime() < result.start.date().getTime()) {
|
||
components.imply("day", components.get("day") + 1);
|
||
}
|
||
|
||
return components;
|
||
}
|
||
|
||
checkAndReturnWithoutFollowingPattern(result) {
|
||
if (result.text.match(/^\d$/)) {
|
||
return null;
|
||
}
|
||
|
||
if (result.text.match(/\d[apAP]$/)) {
|
||
return null;
|
||
}
|
||
|
||
const endingWithNumbers = result.text.match(/[^\d:.](\d[\d.]+)$/);
|
||
|
||
if (endingWithNumbers) {
|
||
const endingNumbers = endingWithNumbers[1];
|
||
|
||
if (this.strictMode) {
|
||
return null;
|
||
}
|
||
|
||
if (endingNumbers.includes(".") && !endingNumbers.match(/\d(\.\d{2})+$/)) {
|
||
return null;
|
||
}
|
||
|
||
const endingNumberVal = parseInt(endingNumbers);
|
||
|
||
if (endingNumberVal > 24) {
|
||
return null;
|
||
}
|
||
}
|
||
|
||
return result;
|
||
}
|
||
|
||
checkAndReturnWithFollowingPattern(result) {
|
||
if (result.text.match(/^\d+-\d+$/)) {
|
||
return null;
|
||
}
|
||
|
||
const endingWithNumbers = result.text.match(/[^\d:.](\d[\d.]+)\s*-\s*(\d[\d.]+)$/);
|
||
|
||
if (endingWithNumbers) {
|
||
if (this.strictMode) {
|
||
return null;
|
||
}
|
||
|
||
const startingNumbers = endingWithNumbers[1];
|
||
const endingNumbers = endingWithNumbers[2];
|
||
|
||
if (endingNumbers.includes(".") && !endingNumbers.match(/\d(\.\d{2})+$/)) {
|
||
return null;
|
||
}
|
||
|
||
const endingNumberVal = parseInt(endingNumbers);
|
||
const startingNumberVal = parseInt(startingNumbers);
|
||
|
||
if (endingNumberVal > 24 || startingNumberVal > 24) {
|
||
return null;
|
||
}
|
||
}
|
||
|
||
return result;
|
||
}
|
||
|
||
getPrimaryTimePatternThroughCache() {
|
||
const primaryPrefix = this.primaryPrefix();
|
||
const primarySuffix = this.primarySuffix();
|
||
|
||
if (this.cachedPrimaryPrefix === primaryPrefix && this.cachedPrimarySuffix === primarySuffix) {
|
||
return this.cachedPrimaryTimePattern;
|
||
}
|
||
|
||
this.cachedPrimaryTimePattern = primaryTimePattern(primaryPrefix, primarySuffix);
|
||
this.cachedPrimaryPrefix = primaryPrefix;
|
||
this.cachedPrimarySuffix = primarySuffix;
|
||
return this.cachedPrimaryTimePattern;
|
||
}
|
||
|
||
getFollowingTimePatternThroughCache() {
|
||
const followingPhase = this.followingPhase();
|
||
const followingSuffix = this.followingSuffix();
|
||
|
||
if (this.cachedFollowingPhase === followingPhase && this.cachedFollowingSuffix === followingSuffix) {
|
||
return this.cachedFollowingTimePatten;
|
||
}
|
||
|
||
this.cachedFollowingTimePatten = followingTimePatten(followingPhase, followingSuffix);
|
||
this.cachedFollowingPhase = followingPhase;
|
||
this.cachedFollowingSuffix = followingSuffix;
|
||
return this.cachedFollowingTimePatten;
|
||
}
|
||
|
||
}
|
||
|
||
exports.AbstractTimeExpressionParser = AbstractTimeExpressionParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/common/parsers/ISOFormatParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const PATTERN = new RegExp("([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");
|
||
const YEAR_NUMBER_GROUP = 1;
|
||
const MONTH_NUMBER_GROUP = 2;
|
||
const DATE_NUMBER_GROUP = 3;
|
||
const HOUR_NUMBER_GROUP = 4;
|
||
const MINUTE_NUMBER_GROUP = 5;
|
||
const SECOND_NUMBER_GROUP = 6;
|
||
const MILLISECOND_NUMBER_GROUP = 7;
|
||
const TZD_HOUR_OFFSET_GROUP = 8;
|
||
const TZD_MINUTE_OFFSET_GROUP = 9;
|
||
|
||
class ISOFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern() {
|
||
return PATTERN;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const components = {};
|
||
components["year"] = parseInt(match[YEAR_NUMBER_GROUP]);
|
||
components["month"] = parseInt(match[MONTH_NUMBER_GROUP]);
|
||
components["day"] = parseInt(match[DATE_NUMBER_GROUP]);
|
||
|
||
if (match[HOUR_NUMBER_GROUP] != null) {
|
||
components["hour"] = parseInt(match[HOUR_NUMBER_GROUP]);
|
||
components["minute"] = parseInt(match[MINUTE_NUMBER_GROUP]);
|
||
|
||
if (match[SECOND_NUMBER_GROUP] != null) {
|
||
components["second"] = parseInt(match[SECOND_NUMBER_GROUP]);
|
||
}
|
||
|
||
if (match[MILLISECOND_NUMBER_GROUP] != null) {
|
||
components["millisecond"] = parseInt(match[MILLISECOND_NUMBER_GROUP]);
|
||
}
|
||
|
||
if (match[TZD_HOUR_OFFSET_GROUP] == null) {
|
||
components["timezoneOffset"] = 0;
|
||
} else {
|
||
const hourOffset = parseInt(match[TZD_HOUR_OFFSET_GROUP]);
|
||
let minuteOffset = 0;
|
||
|
||
if (match[TZD_MINUTE_OFFSET_GROUP] != null) {
|
||
minuteOffset = parseInt(match[TZD_MINUTE_OFFSET_GROUP]);
|
||
}
|
||
|
||
let offset = hourOffset * 60;
|
||
|
||
if (offset < 0) {
|
||
offset -= minuteOffset;
|
||
} else {
|
||
offset += minuteOffset;
|
||
}
|
||
|
||
components["timezoneOffset"] = offset;
|
||
}
|
||
}
|
||
|
||
return components;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = ISOFormatParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/common/parsers/SlashDateFormatParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js");
|
||
|
||
const PATTERN = new RegExp("([^\\d]|^)" + "([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})" + "(?:[\\/\\.\\-]([0-9]{4}|[0-9]{2}))?" + "(\\W|$)", "i");
|
||
const OPENING_GROUP = 1;
|
||
const ENDING_GROUP = 5;
|
||
const FIRST_NUMBERS_GROUP = 2;
|
||
const SECOND_NUMBERS_GROUP = 3;
|
||
const YEAR_GROUP = 4;
|
||
|
||
class SlashDateFormatParser {
|
||
constructor(littleEndian) {
|
||
this.groupNumberMonth = littleEndian ? SECOND_NUMBERS_GROUP : FIRST_NUMBERS_GROUP;
|
||
this.groupNumberDay = littleEndian ? FIRST_NUMBERS_GROUP : SECOND_NUMBERS_GROUP;
|
||
}
|
||
|
||
pattern() {
|
||
return PATTERN;
|
||
}
|
||
|
||
extract(context, match) {
|
||
if (match[OPENING_GROUP] == "/" || match[ENDING_GROUP] == "/") {
|
||
match.index += match[0].length;
|
||
return;
|
||
}
|
||
|
||
const index = match.index + match[OPENING_GROUP].length;
|
||
const text = match[0].substr(match[OPENING_GROUP].length, match[0].length - match[OPENING_GROUP].length - match[ENDING_GROUP].length);
|
||
|
||
if (text.match(/^\d\.\d$/) || text.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/)) {
|
||
return;
|
||
}
|
||
|
||
if (!match[YEAR_GROUP] && match[0].indexOf("/") < 0) {
|
||
return;
|
||
}
|
||
|
||
const result = context.createParsingResult(index, text);
|
||
let month = parseInt(match[this.groupNumberMonth]);
|
||
let day = parseInt(match[this.groupNumberDay]);
|
||
|
||
if (month < 1 || month > 12) {
|
||
if (month > 12) {
|
||
if (day >= 1 && day <= 12 && month <= 31) {
|
||
[day, month] = [month, day];
|
||
} else {
|
||
return null;
|
||
}
|
||
}
|
||
}
|
||
|
||
if (day < 1 || day > 31) {
|
||
return null;
|
||
}
|
||
|
||
result.start.assign("day", day);
|
||
result.start.assign("month", month);
|
||
|
||
if (match[YEAR_GROUP]) {
|
||
const rawYearNumber = parseInt(match[YEAR_GROUP]);
|
||
const year = years_1.findMostLikelyADYear(rawYearNumber);
|
||
result.start.assign("year", year);
|
||
} else {
|
||
const year = years_1.findYearClosestToRef(context.refDate, day, month);
|
||
result.start.imply("year", year);
|
||
}
|
||
|
||
return result;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = SlashDateFormatParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateRangeRefiner.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const abstractRefiners_1 = __webpack_require__("./node_modules/chrono-node/dist/common/abstractRefiners.js");
|
||
|
||
class AbstractMergeDateRangeRefiner extends abstractRefiners_1.MergingRefiner {
|
||
shouldMergeResults(textBetween, currentResult, nextResult) {
|
||
return !currentResult.end && !nextResult.end && textBetween.match(this.patternBetween()) != null;
|
||
}
|
||
|
||
mergeResults(textBetween, fromResult, toResult) {
|
||
if (!fromResult.start.isOnlyWeekdayComponent() && !toResult.start.isOnlyWeekdayComponent()) {
|
||
toResult.start.getCertainComponents().forEach(key => {
|
||
if (!fromResult.start.isCertain(key)) {
|
||
fromResult.start.assign(key, toResult.start.get(key));
|
||
}
|
||
});
|
||
fromResult.start.getCertainComponents().forEach(key => {
|
||
if (!toResult.start.isCertain(key)) {
|
||
toResult.start.assign(key, fromResult.start.get(key));
|
||
}
|
||
});
|
||
}
|
||
|
||
if (fromResult.start.date().getTime() > toResult.start.date().getTime()) {
|
||
let fromMoment = fromResult.start.dayjs();
|
||
let toMoment = toResult.start.dayjs();
|
||
|
||
if (fromResult.start.isOnlyWeekdayComponent() && fromMoment.add(-7, "days").isBefore(toMoment)) {
|
||
fromMoment = fromMoment.add(-7, "days");
|
||
fromResult.start.imply("day", fromMoment.date());
|
||
fromResult.start.imply("month", fromMoment.month() + 1);
|
||
fromResult.start.imply("year", fromMoment.year());
|
||
} else if (toResult.start.isOnlyWeekdayComponent() && toMoment.add(7, "days").isAfter(fromMoment)) {
|
||
toMoment = toMoment.add(7, "days");
|
||
toResult.start.imply("day", toMoment.date());
|
||
toResult.start.imply("month", toMoment.month() + 1);
|
||
toResult.start.imply("year", toMoment.year());
|
||
} else {
|
||
[toResult, fromResult] = [fromResult, toResult];
|
||
}
|
||
}
|
||
|
||
const result = fromResult.clone();
|
||
result.start = fromResult.start;
|
||
result.end = toResult.start;
|
||
result.index = Math.min(fromResult.index, toResult.index);
|
||
|
||
if (fromResult.index < toResult.index) {
|
||
result.text = fromResult.text + textBetween + toResult.text;
|
||
} else {
|
||
result.text = toResult.text + textBetween + fromResult.text;
|
||
}
|
||
|
||
return result;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = AbstractMergeDateRangeRefiner;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateTimeRefiner.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const abstractRefiners_1 = __webpack_require__("./node_modules/chrono-node/dist/common/abstractRefiners.js");
|
||
|
||
const mergingCalculation_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/mergingCalculation.js");
|
||
|
||
class ENMergeDateTimeRefiner extends abstractRefiners_1.MergingRefiner {
|
||
shouldMergeResults(textBetween, currentResult, nextResult) {
|
||
return (currentResult.start.isOnlyDate() && nextResult.start.isOnlyTime() || nextResult.start.isOnlyDate() && currentResult.start.isOnlyTime()) && textBetween.match(this.patternBetween()) != null;
|
||
}
|
||
|
||
mergeResults(textBetween, currentResult, nextResult) {
|
||
const result = currentResult.start.isOnlyDate() ? mergingCalculation_1.mergeDateTimeResult(currentResult, nextResult) : mergingCalculation_1.mergeDateTimeResult(nextResult, currentResult);
|
||
result.index = currentResult.index;
|
||
result.text = currentResult.text + textBetween + nextResult.text;
|
||
return result;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = ENMergeDateTimeRefiner;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/common/refiners/ExtractTimezoneAbbrRefiner.js":
|
||
/***/ (function(__unused_webpack_module, exports) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
const TIMEZONE_NAME_PATTERN = new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)", "i");
|
||
const DEFAULT_TIMEZONE_ABBR_MAP = {
|
||
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
|
||
};
|
||
|
||
class ExtractTimezoneAbbrRefiner {
|
||
constructor(timezoneOverrides) {
|
||
this.timezone = Object.assign(Object.assign({}, DEFAULT_TIMEZONE_ABBR_MAP), timezoneOverrides);
|
||
}
|
||
|
||
refine(context, results) {
|
||
var _a;
|
||
|
||
const timezoneOverrides = (_a = context.option.timezones) !== null && _a !== void 0 ? _a : {};
|
||
results.forEach(result => {
|
||
var _a, _b;
|
||
|
||
const suffix = context.text.substring(result.index + result.text.length);
|
||
const match = TIMEZONE_NAME_PATTERN.exec(suffix);
|
||
|
||
if (!match) {
|
||
return;
|
||
}
|
||
|
||
const timezoneAbbr = match[1].toUpperCase();
|
||
const extractedTimezoneOffset = (_b = (_a = timezoneOverrides[timezoneAbbr]) !== null && _a !== void 0 ? _a : this.timezone[timezoneAbbr]) !== null && _b !== void 0 ? _b : null;
|
||
|
||
if (extractedTimezoneOffset === null) {
|
||
return;
|
||
}
|
||
|
||
context.debug(() => {
|
||
console.log(`Extracting timezone: '${timezoneAbbr}' into : ${extractedTimezoneOffset}`);
|
||
});
|
||
const currentTimezoneOffset = result.start.get("timezoneOffset");
|
||
|
||
if (currentTimezoneOffset !== null && extractedTimezoneOffset != currentTimezoneOffset) {
|
||
if (result.start.isCertain("timezoneOffset")) {
|
||
return;
|
||
}
|
||
|
||
if (timezoneAbbr != match[1]) {
|
||
return;
|
||
}
|
||
}
|
||
|
||
result.text += match[0];
|
||
|
||
if (!result.start.isCertain("timezoneOffset")) {
|
||
result.start.assign("timezoneOffset", extractedTimezoneOffset);
|
||
}
|
||
|
||
if (result.end != null && !result.end.isCertain("timezoneOffset")) {
|
||
result.end.assign("timezoneOffset", extractedTimezoneOffset);
|
||
}
|
||
});
|
||
return results;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = ExtractTimezoneAbbrRefiner;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/common/refiners/ExtractTimezoneOffsetRefiner.js":
|
||
/***/ (function(__unused_webpack_module, exports) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
const TIMEZONE_OFFSET_PATTERN = new RegExp("^\\s*(?:(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?", "i");
|
||
const TIMEZONE_OFFSET_SIGN_GROUP = 1;
|
||
const TIMEZONE_OFFSET_HOUR_OFFSET_GROUP = 2;
|
||
const TIMEZONE_OFFSET_MINUTE_OFFSET_GROUP = 3;
|
||
|
||
class ExtractTimezoneOffsetRefiner {
|
||
refine(context, results) {
|
||
results.forEach(function (result) {
|
||
if (result.start.isCertain("timezoneOffset")) {
|
||
return;
|
||
}
|
||
|
||
const suffix = context.text.substring(result.index + result.text.length);
|
||
const match = TIMEZONE_OFFSET_PATTERN.exec(suffix);
|
||
|
||
if (!match) {
|
||
return;
|
||
}
|
||
|
||
context.debug(() => {
|
||
console.log(`Extracting timezone: '${match[0]}' into : ${result}`);
|
||
});
|
||
const hourOffset = parseInt(match[TIMEZONE_OFFSET_HOUR_OFFSET_GROUP]);
|
||
const minuteOffset = parseInt(match[TIMEZONE_OFFSET_MINUTE_OFFSET_GROUP] || "0");
|
||
let timezoneOffset = hourOffset * 60 + minuteOffset;
|
||
|
||
if (match[TIMEZONE_OFFSET_SIGN_GROUP] === "-") {
|
||
timezoneOffset = -timezoneOffset;
|
||
}
|
||
|
||
if (result.end != null) {
|
||
result.end.assign("timezoneOffset", timezoneOffset);
|
||
}
|
||
|
||
result.start.assign("timezoneOffset", timezoneOffset);
|
||
result.text += match[0];
|
||
});
|
||
return results;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = ExtractTimezoneOffsetRefiner;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/common/refiners/ForwardDateRefiner.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js"));
|
||
|
||
class ForwardDateRefiner {
|
||
refine(context, results) {
|
||
if (!context.option.forwardDate) {
|
||
return results;
|
||
}
|
||
|
||
results.forEach(function (result) {
|
||
let refMoment = dayjs_1.default(context.refDate);
|
||
|
||
if (result.start.isOnlyDayMonthComponent() && refMoment.isAfter(result.start.dayjs())) {
|
||
for (let i = 0; i < 3 && refMoment.isAfter(result.start.dayjs()); i++) {
|
||
result.start.imply("year", result.start.get("year") + 1);
|
||
context.debug(() => {
|
||
console.log(`Forward yearly adjusted for ${result} (${result.start})`);
|
||
});
|
||
|
||
if (result.end && !result.end.isCertain("year")) {
|
||
result.end.imply("year", result.end.get("year") + 1);
|
||
context.debug(() => {
|
||
console.log(`Forward yearly adjusted for ${result} (${result.end})`);
|
||
});
|
||
}
|
||
}
|
||
}
|
||
|
||
if (result.start.isOnlyWeekdayComponent() && refMoment.isAfter(result.start.dayjs())) {
|
||
if (refMoment.day() > result.start.get("weekday")) {
|
||
refMoment = refMoment.day(result.start.get("weekday") + 7);
|
||
} else {
|
||
refMoment = refMoment.day(result.start.get("weekday"));
|
||
}
|
||
|
||
result.start.imply("day", refMoment.date());
|
||
result.start.imply("month", refMoment.month() + 1);
|
||
result.start.imply("year", refMoment.year());
|
||
context.debug(() => {
|
||
console.log(`Forward weekly adjusted for ${result} (${result.start})`);
|
||
});
|
||
|
||
if (result.end && result.end.isOnlyWeekdayComponent()) {
|
||
if (refMoment.day() > result.end.get("weekday")) {
|
||
refMoment = refMoment.day(result.end.get("weekday") + 7);
|
||
} else {
|
||
refMoment = refMoment.day(result.end.get("weekday"));
|
||
}
|
||
|
||
result.end.imply("day", refMoment.date());
|
||
result.end.imply("month", refMoment.month() + 1);
|
||
result.end.imply("year", refMoment.year());
|
||
context.debug(() => {
|
||
console.log(`Forward weekly adjusted for ${result} (${result.end})`);
|
||
});
|
||
}
|
||
}
|
||
});
|
||
return results;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = ForwardDateRefiner;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/common/refiners/MergeWeekdayComponentRefiner.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const abstractRefiners_1 = __webpack_require__("./node_modules/chrono-node/dist/common/abstractRefiners.js");
|
||
|
||
class MergeWeekdayComponentRefiner extends abstractRefiners_1.MergingRefiner {
|
||
mergeResults(textBetween, currentResult, nextResult) {
|
||
const newResult = nextResult.clone();
|
||
newResult.index = currentResult.index;
|
||
newResult.text = currentResult.text + textBetween + newResult.text;
|
||
newResult.start.assign("weekday", currentResult.start.get("weekday"));
|
||
|
||
if (newResult.end) {
|
||
newResult.end.assign("weekday", currentResult.start.get("weekday"));
|
||
}
|
||
|
||
return newResult;
|
||
}
|
||
|
||
shouldMergeResults(textBetween, currentResult, nextResult) {
|
||
const weekdayThenNormalDate = currentResult.start.isOnlyWeekdayComponent() && !currentResult.start.isCertain("hour") && nextResult.start.isCertain("day");
|
||
return weekdayThenNormalDate && textBetween.match(/^,?\s*$/) != null;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = MergeWeekdayComponentRefiner;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/common/refiners/OverlapRemovalRefiner.js":
|
||
/***/ (function(__unused_webpack_module, exports) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
class OverlapRemovalRefiner {
|
||
refine(context, results) {
|
||
if (results.length < 2) {
|
||
return results;
|
||
}
|
||
|
||
const filteredResults = [];
|
||
let prevResult = results[0];
|
||
|
||
for (let i = 1; i < results.length; i++) {
|
||
const result = results[i];
|
||
|
||
if (result.index < prevResult.index + prevResult.text.length) {
|
||
if (result.text.length > prevResult.text.length) {
|
||
prevResult = result;
|
||
}
|
||
} else {
|
||
filteredResults.push(prevResult);
|
||
prevResult = result;
|
||
}
|
||
}
|
||
|
||
if (prevResult != null) {
|
||
filteredResults.push(prevResult);
|
||
}
|
||
|
||
return filteredResults;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = OverlapRemovalRefiner;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/common/refiners/UnlikelyFormatFilter.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const abstractRefiners_1 = __webpack_require__("./node_modules/chrono-node/dist/common/abstractRefiners.js");
|
||
|
||
class UnlikelyFormatFilter extends abstractRefiners_1.Filter {
|
||
constructor(strictMode) {
|
||
super();
|
||
this.strictMode = strictMode;
|
||
}
|
||
|
||
isValid(context, result) {
|
||
if (result.text.replace(" ", "").match(/^\d*(\.\d*)?$/)) {
|
||
context.debug(() => {
|
||
console.log(`Removing unlikely result '${result.text}'`);
|
||
});
|
||
return false;
|
||
}
|
||
|
||
if (!result.start.isValidDate()) {
|
||
context.debug(() => {
|
||
console.log(`Removing invalid result: ${result} (${result.start})`);
|
||
});
|
||
return false;
|
||
}
|
||
|
||
if (result.end && !result.end.isValidDate()) {
|
||
context.debug(() => {
|
||
console.log(`Removing invalid result: ${result} (${result.end})`);
|
||
});
|
||
return false;
|
||
}
|
||
|
||
if (this.strictMode) {
|
||
return this.isStrictModeValid(context, result);
|
||
}
|
||
|
||
return true;
|
||
}
|
||
|
||
isStrictModeValid(context, result) {
|
||
if (result.start.isOnlyWeekdayComponent()) {
|
||
context.debug(() => {
|
||
console.log(`(Strict) Removing weekday only component: ${result} (${result.end})`);
|
||
});
|
||
return false;
|
||
}
|
||
|
||
if (result.start.isOnlyTime() && (!result.start.isCertain("hour") || !result.start.isCertain("minute"))) {
|
||
context.debug(() => {
|
||
console.log(`(Strict) Removing uncertain time component: ${result} (${result.end})`);
|
||
});
|
||
return false;
|
||
}
|
||
|
||
return true;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = UnlikelyFormatFilter;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/configurations.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.includeCommonConfiguration = void 0;
|
||
|
||
const ExtractTimezoneAbbrRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/ExtractTimezoneAbbrRefiner.js"));
|
||
|
||
const ExtractTimezoneOffsetRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/ExtractTimezoneOffsetRefiner.js"));
|
||
|
||
const OverlapRemovalRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/OverlapRemovalRefiner.js"));
|
||
|
||
const ForwardDateRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/ForwardDateRefiner.js"));
|
||
|
||
const UnlikelyFormatFilter_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/UnlikelyFormatFilter.js"));
|
||
|
||
const ISOFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/parsers/ISOFormatParser.js"));
|
||
|
||
const MergeWeekdayComponentRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/MergeWeekdayComponentRefiner.js"));
|
||
|
||
function includeCommonConfiguration(configuration, strictMode = false) {
|
||
configuration.parsers.unshift(new ISOFormatParser_1.default());
|
||
configuration.refiners.unshift(new MergeWeekdayComponentRefiner_1.default());
|
||
configuration.refiners.unshift(new ExtractTimezoneAbbrRefiner_1.default());
|
||
configuration.refiners.unshift(new ExtractTimezoneOffsetRefiner_1.default());
|
||
configuration.refiners.unshift(new OverlapRemovalRefiner_1.default());
|
||
configuration.refiners.push(new OverlapRemovalRefiner_1.default());
|
||
configuration.refiners.push(new ForwardDateRefiner_1.default());
|
||
configuration.refiners.push(new UnlikelyFormatFilter_1.default(strictMode));
|
||
return configuration;
|
||
}
|
||
|
||
exports.includeCommonConfiguration = includeCommonConfiguration;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/index.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
||
if (k2 === undefined) k2 = k;
|
||
Object.defineProperty(o, k2, {
|
||
enumerable: true,
|
||
get: function () {
|
||
return m[k];
|
||
}
|
||
});
|
||
} : function (o, m, k, k2) {
|
||
if (k2 === undefined) k2 = k;
|
||
o[k2] = m[k];
|
||
});
|
||
|
||
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
|
||
Object.defineProperty(o, "default", {
|
||
enumerable: true,
|
||
value: v
|
||
});
|
||
} : function (o, v) {
|
||
o["default"] = v;
|
||
});
|
||
|
||
var __importStar = this && this.__importStar || function (mod) {
|
||
if (mod && mod.__esModule) return mod;
|
||
var result = {};
|
||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||
|
||
__setModuleDefault(result, mod);
|
||
|
||
return result;
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.parseDate = exports.parse = exports.casual = exports.strict = exports.nl = exports.pt = exports.ja = exports.fr = exports.de = exports.Meridiem = exports.Chrono = exports.en = void 0;
|
||
|
||
const en = __importStar(__webpack_require__("./node_modules/chrono-node/dist/locales/en/index.js"));
|
||
|
||
exports.en = en;
|
||
|
||
const chrono_1 = __webpack_require__("./node_modules/chrono-node/dist/chrono.js");
|
||
|
||
Object.defineProperty(exports, "Chrono", ({
|
||
enumerable: true,
|
||
get: function () {
|
||
return chrono_1.Chrono;
|
||
}
|
||
}));
|
||
var Meridiem;
|
||
|
||
(function (Meridiem) {
|
||
Meridiem[Meridiem["AM"] = 0] = "AM";
|
||
Meridiem[Meridiem["PM"] = 1] = "PM";
|
||
})(Meridiem = exports.Meridiem || (exports.Meridiem = {}));
|
||
|
||
const de = __importStar(__webpack_require__("./node_modules/chrono-node/dist/locales/de/index.js"));
|
||
|
||
exports.de = de;
|
||
|
||
const fr = __importStar(__webpack_require__("./node_modules/chrono-node/dist/locales/fr/index.js"));
|
||
|
||
exports.fr = fr;
|
||
|
||
const ja = __importStar(__webpack_require__("./node_modules/chrono-node/dist/locales/ja/index.js"));
|
||
|
||
exports.ja = ja;
|
||
|
||
const pt = __importStar(__webpack_require__("./node_modules/chrono-node/dist/locales/pt/index.js"));
|
||
|
||
exports.pt = pt;
|
||
|
||
const nl = __importStar(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/index.js"));
|
||
|
||
exports.nl = nl;
|
||
exports.strict = en.strict;
|
||
exports.casual = en.casual;
|
||
|
||
function parse(text, ref, option) {
|
||
return exports.casual.parse(text, ref, option);
|
||
}
|
||
|
||
exports.parse = parse;
|
||
|
||
function parseDate(text, ref, option) {
|
||
return exports.casual.parseDate(text, ref, option);
|
||
}
|
||
|
||
exports.parseDate = parseDate;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/de/constants.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.parseTimeUnits = exports.TIME_UNITS_PATTERN = exports.parseYear = exports.YEAR_PATTERN = exports.parseNumberPattern = exports.NUMBER_PATTERN = exports.TIME_UNIT_DICTIONARY = exports.INTEGER_WORD_DICTIONARY = exports.MONTH_DICTIONARY = exports.WEEKDAY_DICTIONARY = void 0;
|
||
|
||
const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js");
|
||
|
||
const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js");
|
||
|
||
exports.WEEKDAY_DICTIONARY = {
|
||
"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
|
||
};
|
||
exports.MONTH_DICTIONARY = {
|
||
"januar": 1,
|
||
"jan": 1,
|
||
"jan.": 1,
|
||
"februar": 2,
|
||
"feb": 2,
|
||
"feb.": 2,
|
||
"märz": 3,
|
||
"maerz": 3,
|
||
"mär": 3,
|
||
"mär.": 3,
|
||
"mrz": 3,
|
||
"mrz.": 3,
|
||
"april": 4,
|
||
"apr": 4,
|
||
"apr.": 4,
|
||
"mai": 5,
|
||
"juni": 6,
|
||
"jun": 6,
|
||
"jun.": 6,
|
||
"juli": 7,
|
||
"jul": 7,
|
||
"jul.": 7,
|
||
"august": 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,
|
||
"dezember": 12,
|
||
"dez": 12,
|
||
"dez.": 12
|
||
};
|
||
exports.INTEGER_WORD_DICTIONARY = {
|
||
"eins": 1,
|
||
"zwei": 2,
|
||
"drei": 3,
|
||
"vier": 4,
|
||
"fünf": 5,
|
||
"fuenf": 5,
|
||
"sechs": 6,
|
||
"sieben": 7,
|
||
"acht": 8,
|
||
"neun": 9,
|
||
"zehn": 10,
|
||
"elf": 11,
|
||
"zwölf": 12,
|
||
"zwoelf": 12
|
||
};
|
||
exports.TIME_UNIT_DICTIONARY = {
|
||
sec: "second",
|
||
second: "second",
|
||
seconds: "second",
|
||
min: "minute",
|
||
mins: "minute",
|
||
minute: "minute",
|
||
minutes: "minute",
|
||
h: "hour",
|
||
hr: "hour",
|
||
hrs: "hour",
|
||
hour: "hour",
|
||
hours: "hour",
|
||
day: "d",
|
||
days: "d",
|
||
week: "week",
|
||
weeks: "week",
|
||
month: "month",
|
||
months: "month",
|
||
y: "year",
|
||
yr: "year",
|
||
year: "year",
|
||
years: "year"
|
||
};
|
||
exports.NUMBER_PATTERN = `(?:${pattern_1.matchAnyPattern(exports.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s*an?)?|an?(?:\\s*few)?|few|several|a?\\s*couple\\s*(?:of)?)`;
|
||
|
||
function parseNumberPattern(match) {
|
||
const num = match.toLowerCase();
|
||
|
||
if (exports.INTEGER_WORD_DICTIONARY[num] !== undefined) {
|
||
return exports.INTEGER_WORD_DICTIONARY[num];
|
||
} else if (num === "a" || num === "an") {
|
||
return 1;
|
||
} else if (num.match(/few/)) {
|
||
return 3;
|
||
} else if (num.match(/half/)) {
|
||
return 0.5;
|
||
} else if (num.match(/couple/)) {
|
||
return 2;
|
||
} else if (num.match(/several/)) {
|
||
return 7;
|
||
}
|
||
|
||
return parseFloat(num);
|
||
}
|
||
|
||
exports.parseNumberPattern = parseNumberPattern;
|
||
exports.YEAR_PATTERN = `(?:[0-9]{1,4}(?:\\s*[vn]\\.?\\s*C(?:hr)?\\.?)?)`;
|
||
|
||
function parseYear(match) {
|
||
if (/v/i.test(match)) {
|
||
return -parseInt(match.replace(/[^0-9]+/gi, ""));
|
||
}
|
||
|
||
if (/n/i.test(match)) {
|
||
return parseInt(match.replace(/[^0-9]+/gi, ""));
|
||
}
|
||
|
||
const rawYearNumber = parseInt(match);
|
||
return years_1.findMostLikelyADYear(rawYearNumber);
|
||
}
|
||
|
||
exports.parseYear = parseYear;
|
||
const SINGLE_TIME_UNIT_PATTERN = `(${exports.NUMBER_PATTERN})\\s{0,5}(${pattern_1.matchAnyPattern(exports.TIME_UNIT_DICTIONARY)})\\s{0,5}`;
|
||
const SINGLE_TIME_UNIT_REGEX = new RegExp(SINGLE_TIME_UNIT_PATTERN, "i");
|
||
exports.TIME_UNITS_PATTERN = pattern_1.repeatedTimeunitPattern("", SINGLE_TIME_UNIT_PATTERN);
|
||
|
||
function parseTimeUnits(timeunitText) {
|
||
const fragments = {};
|
||
let remainingText = timeunitText;
|
||
let match = SINGLE_TIME_UNIT_REGEX.exec(remainingText);
|
||
|
||
while (match) {
|
||
collectDateTimeFragment(fragments, match);
|
||
remainingText = remainingText.substring(match[0].length);
|
||
match = SINGLE_TIME_UNIT_REGEX.exec(remainingText);
|
||
}
|
||
|
||
return fragments;
|
||
}
|
||
|
||
exports.parseTimeUnits = parseTimeUnits;
|
||
|
||
function collectDateTimeFragment(fragments, match) {
|
||
const num = parseNumberPattern(match[1]);
|
||
const unit = exports.TIME_UNIT_DICTIONARY[match[2].toLowerCase()];
|
||
fragments[unit] = num;
|
||
}
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/de/index.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.createConfiguration = exports.createCasualConfiguration = exports.parseDate = exports.parse = exports.strict = exports.casual = void 0;
|
||
|
||
const configurations_1 = __webpack_require__("./node_modules/chrono-node/dist/configurations.js");
|
||
|
||
const chrono_1 = __webpack_require__("./node_modules/chrono-node/dist/chrono.js");
|
||
|
||
const SlashDateFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/parsers/SlashDateFormatParser.js"));
|
||
|
||
const ISOFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/parsers/ISOFormatParser.js"));
|
||
|
||
const DETimeExpressionParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/de/parsers/DETimeExpressionParser.js"));
|
||
|
||
const DEWeekdayParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/de/parsers/DEWeekdayParser.js"));
|
||
|
||
const DEMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/de/refiners/DEMergeDateRangeRefiner.js"));
|
||
|
||
const DEMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/de/refiners/DEMergeDateTimeRefiner.js"));
|
||
|
||
const DECasualDateParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/de/parsers/DECasualDateParser.js"));
|
||
|
||
const DECasualTimeParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/de/parsers/DECasualTimeParser.js"));
|
||
|
||
const DEMonthNameLittleEndianParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/de/parsers/DEMonthNameLittleEndianParser.js"));
|
||
|
||
exports.casual = new chrono_1.Chrono(createCasualConfiguration());
|
||
exports.strict = new chrono_1.Chrono(createConfiguration(true));
|
||
|
||
function parse(text, ref, option) {
|
||
return exports.casual.parse(text, ref, option);
|
||
}
|
||
|
||
exports.parse = parse;
|
||
|
||
function parseDate(text, ref, option) {
|
||
return exports.casual.parseDate(text, ref, option);
|
||
}
|
||
|
||
exports.parseDate = parseDate;
|
||
|
||
function createCasualConfiguration(littleEndian = true) {
|
||
const option = createConfiguration(false, littleEndian);
|
||
option.parsers.unshift(new DECasualTimeParser_1.default());
|
||
option.parsers.unshift(new DECasualDateParser_1.default());
|
||
return option;
|
||
}
|
||
|
||
exports.createCasualConfiguration = createCasualConfiguration;
|
||
|
||
function createConfiguration(strictMode = true, littleEndian = true) {
|
||
return configurations_1.includeCommonConfiguration({
|
||
parsers: [new ISOFormatParser_1.default(), new SlashDateFormatParser_1.default(littleEndian), new DETimeExpressionParser_1.default(), new DEMonthNameLittleEndianParser_1.default(), new DEWeekdayParser_1.default()],
|
||
refiners: [new DEMergeDateRangeRefiner_1.default(), new DEMergeDateTimeRefiner_1.default()]
|
||
}, strictMode);
|
||
}
|
||
|
||
exports.createConfiguration = createConfiguration;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/de/parsers/DECasualDateParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
||
if (k2 === undefined) k2 = k;
|
||
Object.defineProperty(o, k2, {
|
||
enumerable: true,
|
||
get: function () {
|
||
return m[k];
|
||
}
|
||
});
|
||
} : function (o, m, k, k2) {
|
||
if (k2 === undefined) k2 = k;
|
||
o[k2] = m[k];
|
||
});
|
||
|
||
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
|
||
Object.defineProperty(o, "default", {
|
||
enumerable: true,
|
||
value: v
|
||
});
|
||
} : function (o, v) {
|
||
o["default"] = v;
|
||
});
|
||
|
||
var __importStar = this && this.__importStar || function (mod) {
|
||
if (mod && mod.__esModule) return mod;
|
||
var result = {};
|
||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||
|
||
__setModuleDefault(result, mod);
|
||
|
||
return result;
|
||
};
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js"));
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const dayjs_2 = __webpack_require__("./node_modules/chrono-node/dist/utils/dayjs.js");
|
||
|
||
const DECasualTimeParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/de/parsers/DECasualTimeParser.js"));
|
||
|
||
const references = __importStar(__webpack_require__("./node_modules/chrono-node/dist/common/casualReferences.js"));
|
||
|
||
const PATTERN = new RegExp(`(jetzt|heute|morgen|übermorgen|uebermorgen|gestern|vorgestern|letzte\\s*nacht)` + `(?:\\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht))?` + `(?=\\W|$)`, "i");
|
||
const DATE_GROUP = 1;
|
||
const TIME_GROUP = 2;
|
||
|
||
class DECasualDateParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern(context) {
|
||
return PATTERN;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
let targetDate = dayjs_1.default(context.refDate);
|
||
const dateKeyword = (match[DATE_GROUP] || "").toLowerCase();
|
||
const timeKeyword = (match[TIME_GROUP] || "").toLowerCase();
|
||
let component = context.createParsingComponents();
|
||
|
||
switch (dateKeyword) {
|
||
case "jetzt":
|
||
component = references.now(context.reference);
|
||
break;
|
||
|
||
case "heute":
|
||
component = references.today(context.reference);
|
||
break;
|
||
|
||
case "morgen":
|
||
dayjs_2.assignTheNextDay(component, targetDate);
|
||
break;
|
||
|
||
case "übermorgen":
|
||
case "uebermorgen":
|
||
targetDate = targetDate.add(1, "day");
|
||
dayjs_2.assignTheNextDay(component, targetDate);
|
||
break;
|
||
|
||
case "gestern":
|
||
targetDate = targetDate.add(-1, "day");
|
||
dayjs_2.assignSimilarDate(component, targetDate);
|
||
dayjs_2.implySimilarTime(component, targetDate);
|
||
break;
|
||
|
||
case "vorgestern":
|
||
targetDate = targetDate.add(-2, "day");
|
||
dayjs_2.assignSimilarDate(component, targetDate);
|
||
dayjs_2.implySimilarTime(component, targetDate);
|
||
break;
|
||
|
||
default:
|
||
if (dateKeyword.match(/letzte\s*nacht/)) {
|
||
if (targetDate.hour() > 6) {
|
||
targetDate = targetDate.add(-1, "day");
|
||
}
|
||
|
||
dayjs_2.assignSimilarDate(component, targetDate);
|
||
component.imply("hour", 0);
|
||
}
|
||
|
||
break;
|
||
}
|
||
|
||
if (timeKeyword) {
|
||
component = DECasualTimeParser_1.default.extractTimeComponents(component, timeKeyword);
|
||
}
|
||
|
||
return component;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = DECasualDateParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/de/parsers/DECasualTimeParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js"));
|
||
|
||
const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const dayjs_2 = __webpack_require__("./node_modules/chrono-node/dist/utils/dayjs.js");
|
||
|
||
const timeunits_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/timeunits.js");
|
||
|
||
class DECasualTimeParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern(context) {
|
||
return /(diesen)?\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht)(?=\W|$)/i;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const targetDate = dayjs_1.default(context.refDate);
|
||
const timeKeywordPattern = match[2].toLowerCase();
|
||
const component = context.createParsingComponents();
|
||
dayjs_2.implySimilarTime(component, targetDate);
|
||
return DECasualTimeParser.extractTimeComponents(component, timeKeywordPattern);
|
||
}
|
||
|
||
static extractTimeComponents(component, timeKeywordPattern) {
|
||
switch (timeKeywordPattern) {
|
||
case "morgen":
|
||
component.imply("hour", 6);
|
||
component.imply("minute", 0);
|
||
component.imply("second", 0);
|
||
component.imply("meridiem", index_1.Meridiem.AM);
|
||
break;
|
||
|
||
case "vormittag":
|
||
component.imply("hour", 9);
|
||
component.imply("minute", 0);
|
||
component.imply("second", 0);
|
||
component.imply("meridiem", index_1.Meridiem.AM);
|
||
break;
|
||
|
||
case "mittag":
|
||
case "mittags":
|
||
component.imply("hour", 12);
|
||
component.imply("minute", 0);
|
||
component.imply("second", 0);
|
||
component.imply("meridiem", index_1.Meridiem.AM);
|
||
break;
|
||
|
||
case "nachmittag":
|
||
component.imply("hour", 15);
|
||
component.imply("minute", 0);
|
||
component.imply("second", 0);
|
||
component.imply("meridiem", index_1.Meridiem.PM);
|
||
break;
|
||
|
||
case "abend":
|
||
component.imply("hour", 18);
|
||
component.imply("minute", 0);
|
||
component.imply("second", 0);
|
||
component.imply("meridiem", index_1.Meridiem.PM);
|
||
break;
|
||
|
||
case "nacht":
|
||
component.imply("hour", 22);
|
||
component.imply("minute", 0);
|
||
component.imply("second", 0);
|
||
component.imply("meridiem", index_1.Meridiem.PM);
|
||
break;
|
||
|
||
case "mitternacht":
|
||
if (component.get("hour") > 1) {
|
||
component = timeunits_1.addImpliedTimeUnits(component, {
|
||
"day": 1
|
||
});
|
||
}
|
||
|
||
component.imply("hour", 0);
|
||
component.imply("minute", 0);
|
||
component.imply("second", 0);
|
||
component.imply("meridiem", index_1.Meridiem.AM);
|
||
break;
|
||
}
|
||
|
||
return component;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = DECasualTimeParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/de/parsers/DEMonthNameLittleEndianParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js");
|
||
|
||
const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/de/constants.js");
|
||
|
||
const constants_2 = __webpack_require__("./node_modules/chrono-node/dist/locales/de/constants.js");
|
||
|
||
const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const PATTERN = new RegExp("(?:am\\s*?)?" + "(?:den\\s*?)?" + `([0-9]{1,2})\\.` + `(?:\\s*(?:bis(?:\\s*(?:am|zum))?|\\-|\\–|\\s)\\s*([0-9]{1,2})\\.?)?\\s*` + `(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})` + `(?:(?:-|/|,?\\s*)(${constants_2.YEAR_PATTERN}(?![^\\s]\\d)))?` + `(?=\\W|$)`, "i");
|
||
const DATE_GROUP = 1;
|
||
const DATE_TO_GROUP = 2;
|
||
const MONTH_NAME_GROUP = 3;
|
||
const YEAR_GROUP = 4;
|
||
|
||
class DEMonthNameLittleEndianParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern() {
|
||
return PATTERN;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const result = context.createParsingResult(match.index, match[0]);
|
||
const month = constants_1.MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()];
|
||
const day = parseInt(match[DATE_GROUP]);
|
||
|
||
if (day > 31) {
|
||
match.index = match.index + match[DATE_GROUP].length;
|
||
return null;
|
||
}
|
||
|
||
result.start.assign("month", month);
|
||
result.start.assign("day", day);
|
||
|
||
if (match[YEAR_GROUP]) {
|
||
const yearNumber = constants_2.parseYear(match[YEAR_GROUP]);
|
||
result.start.assign("year", yearNumber);
|
||
} else {
|
||
const year = years_1.findYearClosestToRef(context.refDate, day, month);
|
||
result.start.imply("year", year);
|
||
}
|
||
|
||
if (match[DATE_TO_GROUP]) {
|
||
const endDate = parseInt(match[DATE_TO_GROUP]);
|
||
result.end = result.start.clone();
|
||
result.end.assign("day", endDate);
|
||
}
|
||
|
||
return result;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = DEMonthNameLittleEndianParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/de/parsers/DETimeExpressionParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const AbstractTimeExpressionParser_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractTimeExpressionParser.js");
|
||
|
||
const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js");
|
||
|
||
class DETimeExpressionParser extends AbstractTimeExpressionParser_1.AbstractTimeExpressionParser {
|
||
primaryPrefix() {
|
||
return "(?:(?:um|von)\\s*)?";
|
||
}
|
||
|
||
followingPhase() {
|
||
return "\\s*(?:\\-|\\–|\\~|\\〜|bis)\\s*";
|
||
}
|
||
|
||
primarySuffix() {
|
||
return "(?:\\s*uhr)?(?:\\s*(?:morgens|vormittags|nachmittags|abends|nachts))?(?=\\W|$)";
|
||
}
|
||
|
||
extractPrimaryTimeComponents(context, match) {
|
||
const components = super.extractPrimaryTimeComponents(context, match);
|
||
|
||
if (components) {
|
||
if (match[0].endsWith("morgens") || match[0].endsWith("vormittags")) {
|
||
components.assign("meridiem", index_1.Meridiem.AM);
|
||
const hour = components.get("hour");
|
||
|
||
if (hour < 12) {
|
||
components.assign("hour", components.get("hour"));
|
||
}
|
||
}
|
||
|
||
if (match[0].endsWith("nachmittags") || match[0].endsWith("abends") || match[0].endsWith("nachts")) {
|
||
components.assign("meridiem", index_1.Meridiem.PM);
|
||
const hour = components.get("hour");
|
||
|
||
if (hour < 12) {
|
||
components.assign("hour", components.get("hour") + 12);
|
||
}
|
||
}
|
||
}
|
||
|
||
return components;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = DETimeExpressionParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/de/parsers/DEWeekdayParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/de/constants.js");
|
||
|
||
const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const weeks_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/weeks.js");
|
||
|
||
const PATTERN = new RegExp("(?:(?:\\,|\\(|\\()\\s*)?" + "(?:a[mn]\\s*?)?" + "(?:(diese[mn]|letzte[mn]|n(?:ä|ae)chste[mn])\\s*)?" + `(${pattern_1.matchAnyPattern(constants_1.WEEKDAY_DICTIONARY)})` + "(?:\\s*(?:\\,|\\)|\\)))?" + "(?:\\s*(diese|letzte|n(?:ä|ae)chste)\\s*woche)?" + "(?=\\W|$)", "i");
|
||
const PREFIX_GROUP = 1;
|
||
const SUFFIX_GROUP = 3;
|
||
const WEEKDAY_GROUP = 2;
|
||
|
||
class DEWeekdayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern() {
|
||
return PATTERN;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();
|
||
const offset = constants_1.WEEKDAY_DICTIONARY[dayOfWeek];
|
||
const prefix = match[PREFIX_GROUP];
|
||
const postfix = match[SUFFIX_GROUP];
|
||
let modifierWord = prefix || postfix;
|
||
modifierWord = modifierWord || "";
|
||
modifierWord = modifierWord.toLowerCase();
|
||
let modifier = null;
|
||
|
||
if (modifierWord.match(/letzte/)) {
|
||
modifier = "last";
|
||
} else if (modifierWord.match(/chste/)) {
|
||
modifier = "next";
|
||
} else if (modifierWord.match(/diese/)) {
|
||
modifier = "this";
|
||
}
|
||
|
||
const date = weeks_1.toDayJSWeekday(context.refDate, offset, modifier);
|
||
return context.createParsingComponents().assign("weekday", offset).imply("day", date.date()).imply("month", date.month() + 1).imply("year", date.year());
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = DEWeekdayParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/de/refiners/DEMergeDateRangeRefiner.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const AbstractMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateRangeRefiner.js"));
|
||
|
||
class DEMergeDateRangeRefiner extends AbstractMergeDateRangeRefiner_1.default {
|
||
patternBetween() {
|
||
return /^\s*(bis(?:\s*(?:am|zum))?|-)\s*$/i;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = DEMergeDateRangeRefiner;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/de/refiners/DEMergeDateTimeRefiner.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const AbstractMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateTimeRefiner.js"));
|
||
|
||
class DEMergeDateTimeRefiner extends AbstractMergeDateTimeRefiner_1.default {
|
||
patternBetween() {
|
||
return new RegExp("^\\s*(T|um|am|,|-)?\\s*$");
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = DEMergeDateTimeRefiner;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/en/constants.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.parseTimeUnits = exports.TIME_UNITS_PATTERN = exports.parseYear = exports.YEAR_PATTERN = exports.parseOrdinalNumberPattern = exports.ORDINAL_NUMBER_PATTERN = exports.parseNumberPattern = exports.NUMBER_PATTERN = exports.TIME_UNIT_DICTIONARY = exports.ORDINAL_WORD_DICTIONARY = exports.INTEGER_WORD_DICTIONARY = exports.MONTH_DICTIONARY = exports.FULL_MONTH_NAME_DICTIONARY = exports.WEEKDAY_DICTIONARY = void 0;
|
||
|
||
const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js");
|
||
|
||
const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js");
|
||
|
||
exports.WEEKDAY_DICTIONARY = {
|
||
sunday: 0,
|
||
sun: 0,
|
||
"sun.": 0,
|
||
monday: 1,
|
||
mon: 1,
|
||
"mon.": 1,
|
||
tuesday: 2,
|
||
tue: 2,
|
||
"tue.": 2,
|
||
wednesday: 3,
|
||
wed: 3,
|
||
"wed.": 3,
|
||
thursday: 4,
|
||
thurs: 4,
|
||
"thurs.": 4,
|
||
thur: 4,
|
||
"thur.": 4,
|
||
thu: 4,
|
||
"thu.": 4,
|
||
friday: 5,
|
||
fri: 5,
|
||
"fri.": 5,
|
||
saturday: 6,
|
||
sat: 6,
|
||
"sat.": 6
|
||
};
|
||
exports.FULL_MONTH_NAME_DICTIONARY = {
|
||
january: 1,
|
||
february: 2,
|
||
march: 3,
|
||
april: 4,
|
||
may: 5,
|
||
june: 6,
|
||
july: 7,
|
||
august: 8,
|
||
september: 9,
|
||
october: 10,
|
||
november: 11,
|
||
december: 12
|
||
};
|
||
exports.MONTH_DICTIONARY = Object.assign(Object.assign({}, exports.FULL_MONTH_NAME_DICTIONARY), {
|
||
jan: 1,
|
||
"jan.": 1,
|
||
feb: 2,
|
||
"feb.": 2,
|
||
mar: 3,
|
||
"mar.": 3,
|
||
apr: 4,
|
||
"apr.": 4,
|
||
jun: 6,
|
||
"jun.": 6,
|
||
jul: 7,
|
||
"jul.": 7,
|
||
aug: 8,
|
||
"aug.": 8,
|
||
sep: 9,
|
||
"sep.": 9,
|
||
sept: 9,
|
||
"sept.": 9,
|
||
oct: 10,
|
||
"oct.": 10,
|
||
nov: 11,
|
||
"nov.": 11,
|
||
dec: 12,
|
||
"dec.": 12
|
||
});
|
||
exports.INTEGER_WORD_DICTIONARY = {
|
||
one: 1,
|
||
two: 2,
|
||
three: 3,
|
||
four: 4,
|
||
five: 5,
|
||
six: 6,
|
||
seven: 7,
|
||
eight: 8,
|
||
nine: 9,
|
||
ten: 10,
|
||
eleven: 11,
|
||
twelve: 12
|
||
};
|
||
exports.ORDINAL_WORD_DICTIONARY = {
|
||
first: 1,
|
||
second: 2,
|
||
third: 3,
|
||
fourth: 4,
|
||
fifth: 5,
|
||
sixth: 6,
|
||
seventh: 7,
|
||
eighth: 8,
|
||
ninth: 9,
|
||
tenth: 10,
|
||
eleventh: 11,
|
||
twelfth: 12,
|
||
thirteenth: 13,
|
||
fourteenth: 14,
|
||
fifteenth: 15,
|
||
sixteenth: 16,
|
||
seventeenth: 17,
|
||
eighteenth: 18,
|
||
nineteenth: 19,
|
||
twentieth: 20,
|
||
"twenty first": 21,
|
||
"twenty-first": 21,
|
||
"twenty second": 22,
|
||
"twenty-second": 22,
|
||
"twenty third": 23,
|
||
"twenty-third": 23,
|
||
"twenty fourth": 24,
|
||
"twenty-fourth": 24,
|
||
"twenty fifth": 25,
|
||
"twenty-fifth": 25,
|
||
"twenty sixth": 26,
|
||
"twenty-sixth": 26,
|
||
"twenty seventh": 27,
|
||
"twenty-seventh": 27,
|
||
"twenty eighth": 28,
|
||
"twenty-eighth": 28,
|
||
"twenty ninth": 29,
|
||
"twenty-ninth": 29,
|
||
"thirtieth": 30,
|
||
"thirty first": 31,
|
||
"thirty-first": 31
|
||
};
|
||
exports.TIME_UNIT_DICTIONARY = {
|
||
sec: "second",
|
||
second: "second",
|
||
seconds: "second",
|
||
min: "minute",
|
||
mins: "minute",
|
||
minute: "minute",
|
||
minutes: "minute",
|
||
h: "hour",
|
||
hr: "hour",
|
||
hrs: "hour",
|
||
hour: "hour",
|
||
hours: "hour",
|
||
day: "d",
|
||
days: "d",
|
||
week: "week",
|
||
weeks: "week",
|
||
month: "month",
|
||
months: "month",
|
||
y: "year",
|
||
yr: "year",
|
||
year: "year",
|
||
years: "year"
|
||
};
|
||
exports.NUMBER_PATTERN = `(?:${pattern_1.matchAnyPattern(exports.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s*an?)?|an?(?:\\s*few)?|few|several|a?\\s*couple\\s*(?:of)?)`;
|
||
|
||
function parseNumberPattern(match) {
|
||
const num = match.toLowerCase();
|
||
|
||
if (exports.INTEGER_WORD_DICTIONARY[num] !== undefined) {
|
||
return exports.INTEGER_WORD_DICTIONARY[num];
|
||
} else if (num === "a" || num === "an") {
|
||
return 1;
|
||
} else if (num.match(/few/)) {
|
||
return 3;
|
||
} else if (num.match(/half/)) {
|
||
return 0.5;
|
||
} else if (num.match(/couple/)) {
|
||
return 2;
|
||
} else if (num.match(/several/)) {
|
||
return 7;
|
||
}
|
||
|
||
return parseFloat(num);
|
||
}
|
||
|
||
exports.parseNumberPattern = parseNumberPattern;
|
||
exports.ORDINAL_NUMBER_PATTERN = `(?:${pattern_1.matchAnyPattern(exports.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;
|
||
|
||
function parseOrdinalNumberPattern(match) {
|
||
let num = match.toLowerCase();
|
||
|
||
if (exports.ORDINAL_WORD_DICTIONARY[num] !== undefined) {
|
||
return exports.ORDINAL_WORD_DICTIONARY[num];
|
||
}
|
||
|
||
num = num.replace(/(?:st|nd|rd|th)$/i, "");
|
||
return parseInt(num);
|
||
}
|
||
|
||
exports.parseOrdinalNumberPattern = parseOrdinalNumberPattern;
|
||
exports.YEAR_PATTERN = `(?:[1-9][0-9]{0,3}\\s*(?:BE|AD|BC|BCE|CE)|[1-2][0-9]{3}|[5-9][0-9])`;
|
||
|
||
function parseYear(match) {
|
||
if (/BE/i.test(match)) {
|
||
match = match.replace(/BE/i, "");
|
||
return parseInt(match) - 543;
|
||
}
|
||
|
||
if (/BCE?/i.test(match)) {
|
||
match = match.replace(/BCE?/i, "");
|
||
return -parseInt(match);
|
||
}
|
||
|
||
if (/(AD|CE)/i.test(match)) {
|
||
match = match.replace(/(AD|CE)/i, "");
|
||
return parseInt(match);
|
||
}
|
||
|
||
const rawYearNumber = parseInt(match);
|
||
return years_1.findMostLikelyADYear(rawYearNumber);
|
||
}
|
||
|
||
exports.parseYear = parseYear;
|
||
const SINGLE_TIME_UNIT_PATTERN = `(${exports.NUMBER_PATTERN})\\s{0,5}(${pattern_1.matchAnyPattern(exports.TIME_UNIT_DICTIONARY)})\\s{0,5}`;
|
||
const SINGLE_TIME_UNIT_REGEX = new RegExp(SINGLE_TIME_UNIT_PATTERN, "i");
|
||
exports.TIME_UNITS_PATTERN = pattern_1.repeatedTimeunitPattern(`(?:(?:about|around)\\s*)?`, SINGLE_TIME_UNIT_PATTERN);
|
||
|
||
function parseTimeUnits(timeunitText) {
|
||
const fragments = {};
|
||
let remainingText = timeunitText;
|
||
let match = SINGLE_TIME_UNIT_REGEX.exec(remainingText);
|
||
|
||
while (match) {
|
||
collectDateTimeFragment(fragments, match);
|
||
remainingText = remainingText.substring(match[0].length);
|
||
match = SINGLE_TIME_UNIT_REGEX.exec(remainingText);
|
||
}
|
||
|
||
return fragments;
|
||
}
|
||
|
||
exports.parseTimeUnits = parseTimeUnits;
|
||
|
||
function collectDateTimeFragment(fragments, match) {
|
||
const num = parseNumberPattern(match[1]);
|
||
const unit = exports.TIME_UNIT_DICTIONARY[match[2].toLowerCase()];
|
||
fragments[unit] = num;
|
||
}
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/en/index.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.createConfiguration = exports.createCasualConfiguration = exports.parseDate = exports.parse = exports.GB = exports.strict = exports.casual = void 0;
|
||
|
||
const ENTimeUnitWithinFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENTimeUnitWithinFormatParser.js"));
|
||
|
||
const ENMonthNameLittleEndianParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENMonthNameLittleEndianParser.js"));
|
||
|
||
const ENMonthNameMiddleEndianParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENMonthNameMiddleEndianParser.js"));
|
||
|
||
const ENMonthNameParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENMonthNameParser.js"));
|
||
|
||
const ENCasualYearMonthDayParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENCasualYearMonthDayParser.js"));
|
||
|
||
const ENSlashMonthFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENSlashMonthFormatParser.js"));
|
||
|
||
const ENTimeExpressionParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENTimeExpressionParser.js"));
|
||
|
||
const ENTimeUnitAgoFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENTimeUnitAgoFormatParser.js"));
|
||
|
||
const ENTimeUnitLaterFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENTimeUnitLaterFormatParser.js"));
|
||
|
||
const ENMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/refiners/ENMergeDateRangeRefiner.js"));
|
||
|
||
const ENMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/refiners/ENMergeDateTimeRefiner.js"));
|
||
|
||
const configurations_1 = __webpack_require__("./node_modules/chrono-node/dist/configurations.js");
|
||
|
||
const ENCasualDateParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENCasualDateParser.js"));
|
||
|
||
const ENCasualTimeParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENCasualTimeParser.js"));
|
||
|
||
const ENWeekdayParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENWeekdayParser.js"));
|
||
|
||
const ENRelativeDateFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENRelativeDateFormatParser.js"));
|
||
|
||
const chrono_1 = __webpack_require__("./node_modules/chrono-node/dist/chrono.js");
|
||
|
||
const SlashDateFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/parsers/SlashDateFormatParser.js"));
|
||
|
||
const ENTimeUnitCasualRelativeFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENTimeUnitCasualRelativeFormatParser.js"));
|
||
|
||
exports.casual = new chrono_1.Chrono(createCasualConfiguration(false));
|
||
exports.strict = new chrono_1.Chrono(createConfiguration(true, false));
|
||
exports.GB = new chrono_1.Chrono(createConfiguration(false, true));
|
||
|
||
function parse(text, ref, option) {
|
||
return exports.casual.parse(text, ref, option);
|
||
}
|
||
|
||
exports.parse = parse;
|
||
|
||
function parseDate(text, ref, option) {
|
||
return exports.casual.parseDate(text, ref, option);
|
||
}
|
||
|
||
exports.parseDate = parseDate;
|
||
|
||
function createCasualConfiguration(littleEndian = false) {
|
||
const option = createConfiguration(false, littleEndian);
|
||
option.parsers.unshift(new ENCasualDateParser_1.default());
|
||
option.parsers.unshift(new ENCasualTimeParser_1.default());
|
||
option.parsers.unshift(new ENMonthNameParser_1.default());
|
||
option.parsers.unshift(new ENRelativeDateFormatParser_1.default());
|
||
option.parsers.unshift(new ENTimeUnitCasualRelativeFormatParser_1.default());
|
||
return option;
|
||
}
|
||
|
||
exports.createCasualConfiguration = createCasualConfiguration;
|
||
|
||
function createConfiguration(strictMode = true, littleEndian = false) {
|
||
return configurations_1.includeCommonConfiguration({
|
||
parsers: [new SlashDateFormatParser_1.default(littleEndian), new ENTimeUnitWithinFormatParser_1.default(), new ENMonthNameLittleEndianParser_1.default(), new ENMonthNameMiddleEndianParser_1.default(), new ENWeekdayParser_1.default(), new ENCasualYearMonthDayParser_1.default(), new ENSlashMonthFormatParser_1.default(), new ENTimeExpressionParser_1.default(strictMode), new ENTimeUnitAgoFormatParser_1.default(strictMode), new ENTimeUnitLaterFormatParser_1.default(strictMode)],
|
||
refiners: [new ENMergeDateTimeRefiner_1.default(), new ENMergeDateRangeRefiner_1.default()]
|
||
}, strictMode);
|
||
}
|
||
|
||
exports.createConfiguration = createConfiguration;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENCasualDateParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
||
if (k2 === undefined) k2 = k;
|
||
Object.defineProperty(o, k2, {
|
||
enumerable: true,
|
||
get: function () {
|
||
return m[k];
|
||
}
|
||
});
|
||
} : function (o, m, k, k2) {
|
||
if (k2 === undefined) k2 = k;
|
||
o[k2] = m[k];
|
||
});
|
||
|
||
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
|
||
Object.defineProperty(o, "default", {
|
||
enumerable: true,
|
||
value: v
|
||
});
|
||
} : function (o, v) {
|
||
o["default"] = v;
|
||
});
|
||
|
||
var __importStar = this && this.__importStar || function (mod) {
|
||
if (mod && mod.__esModule) return mod;
|
||
var result = {};
|
||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||
|
||
__setModuleDefault(result, mod);
|
||
|
||
return result;
|
||
};
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js"));
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const dayjs_2 = __webpack_require__("./node_modules/chrono-node/dist/utils/dayjs.js");
|
||
|
||
const references = __importStar(__webpack_require__("./node_modules/chrono-node/dist/common/casualReferences.js"));
|
||
|
||
const PATTERN = /(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i;
|
||
|
||
class ENCasualDateParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern(context) {
|
||
return PATTERN;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
let targetDate = dayjs_1.default(context.refDate);
|
||
const lowerText = match[0].toLowerCase();
|
||
const component = context.createParsingComponents();
|
||
|
||
switch (lowerText) {
|
||
case "now":
|
||
return references.now(context.reference);
|
||
|
||
case "today":
|
||
return references.today(context.reference);
|
||
|
||
case "yesterday":
|
||
return references.yesterday(context.reference);
|
||
|
||
case "tomorrow":
|
||
case "tmr":
|
||
case "tmrw":
|
||
return references.tomorrow(context.reference);
|
||
|
||
case "tonight":
|
||
return references.tonight(context.reference);
|
||
|
||
default:
|
||
if (lowerText.match(/last\s*night/)) {
|
||
if (targetDate.hour() > 6) {
|
||
targetDate = targetDate.add(-1, "day");
|
||
}
|
||
|
||
dayjs_2.assignSimilarDate(component, targetDate);
|
||
component.imply("hour", 0);
|
||
}
|
||
|
||
break;
|
||
}
|
||
|
||
return component;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = ENCasualDateParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENCasualTimeParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js"));
|
||
|
||
const dayjs_2 = __webpack_require__("./node_modules/chrono-node/dist/utils/dayjs.js");
|
||
|
||
const PATTERN = /(?:this)?\s*(morning|afternoon|evening|night|midnight|noon)(?=\W|$)/i;
|
||
|
||
class ENCasualTimeParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern() {
|
||
return PATTERN;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const targetDate = dayjs_1.default(context.refDate);
|
||
const component = context.createParsingComponents();
|
||
|
||
switch (match[1].toLowerCase()) {
|
||
case "afternoon":
|
||
component.imply("meridiem", index_1.Meridiem.PM);
|
||
component.imply("hour", 15);
|
||
break;
|
||
|
||
case "evening":
|
||
case "night":
|
||
component.imply("meridiem", index_1.Meridiem.PM);
|
||
component.imply("hour", 20);
|
||
break;
|
||
|
||
case "midnight":
|
||
dayjs_2.assignTheNextDay(component, targetDate);
|
||
component.imply("hour", 0);
|
||
component.imply("minute", 0);
|
||
component.imply("second", 0);
|
||
break;
|
||
|
||
case "morning":
|
||
component.imply("meridiem", index_1.Meridiem.AM);
|
||
component.imply("hour", 6);
|
||
break;
|
||
|
||
case "noon":
|
||
component.imply("meridiem", index_1.Meridiem.AM);
|
||
component.imply("hour", 12);
|
||
break;
|
||
}
|
||
|
||
return component;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = ENCasualTimeParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENCasualYearMonthDayParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js");
|
||
|
||
const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const PATTERN = new RegExp(`([0-9]{4})[\\.\\/\\s]` + `(?:(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]` + `([0-9]{1,2})` + "(?=\\W|$)", "i");
|
||
const YEAR_NUMBER_GROUP = 1;
|
||
const MONTH_NAME_GROUP = 2;
|
||
const MONTH_NUMBER_GROUP = 3;
|
||
const DATE_NUMBER_GROUP = 4;
|
||
|
||
class ENCasualYearMonthDayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern() {
|
||
return PATTERN;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const month = match[MONTH_NUMBER_GROUP] ? parseInt(match[MONTH_NUMBER_GROUP]) : constants_1.MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()];
|
||
|
||
if (month < 1 || month > 12) {
|
||
return null;
|
||
}
|
||
|
||
const year = parseInt(match[YEAR_NUMBER_GROUP]);
|
||
const day = parseInt(match[DATE_NUMBER_GROUP]);
|
||
return {
|
||
day: day,
|
||
month: month,
|
||
year: year
|
||
};
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = ENCasualYearMonthDayParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENMonthNameLittleEndianParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js");
|
||
|
||
const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js");
|
||
|
||
const constants_2 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js");
|
||
|
||
const constants_3 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js");
|
||
|
||
const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const PATTERN = new RegExp("(?:on\\s*?)?" + `(${constants_3.ORDINAL_NUMBER_PATTERN})` + "(?:\\s*" + "(?:to|\\-|\\–|until|through|till|\\s)\\s*" + `(${constants_3.ORDINAL_NUMBER_PATTERN})` + ")?" + "(?:-|/|\\s*(?:of)?\\s*)" + "(" + pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY) + ")" + "(?:" + "(?:-|/|,?\\s*)" + `(${constants_2.YEAR_PATTERN}(?![^\\s]\\d))` + ")?" + "(?=\\W|$)", "i");
|
||
const DATE_GROUP = 1;
|
||
const DATE_TO_GROUP = 2;
|
||
const MONTH_NAME_GROUP = 3;
|
||
const YEAR_GROUP = 4;
|
||
|
||
class ENMonthNameLittleEndianParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern() {
|
||
return PATTERN;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const result = context.createParsingResult(match.index, match[0]);
|
||
const month = constants_1.MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()];
|
||
const day = constants_3.parseOrdinalNumberPattern(match[DATE_GROUP]);
|
||
|
||
if (day > 31) {
|
||
match.index = match.index + match[DATE_GROUP].length;
|
||
return null;
|
||
}
|
||
|
||
result.start.assign("month", month);
|
||
result.start.assign("day", day);
|
||
|
||
if (match[YEAR_GROUP]) {
|
||
const yearNumber = constants_2.parseYear(match[YEAR_GROUP]);
|
||
result.start.assign("year", yearNumber);
|
||
} else {
|
||
const year = years_1.findYearClosestToRef(context.refDate, day, month);
|
||
result.start.imply("year", year);
|
||
}
|
||
|
||
if (match[DATE_TO_GROUP]) {
|
||
const endDate = constants_3.parseOrdinalNumberPattern(match[DATE_TO_GROUP]);
|
||
result.end = result.start.clone();
|
||
result.end.assign("day", endDate);
|
||
}
|
||
|
||
return result;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = ENMonthNameLittleEndianParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENMonthNameMiddleEndianParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js");
|
||
|
||
const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js");
|
||
|
||
const constants_2 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js");
|
||
|
||
const constants_3 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js");
|
||
|
||
const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const PATTERN = new RegExp(`(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})` + "(?:-|/|\\s*,?\\s*)" + `(${constants_2.ORDINAL_NUMBER_PATTERN})(?!\\s*(?:am|pm))\\s*` + "(?:" + "(?:to|\\-)\\s*" + `(${constants_2.ORDINAL_NUMBER_PATTERN})\\s*` + ")?" + "(?:" + "(?:-|/|\\s*,?\\s*)" + `(${constants_3.YEAR_PATTERN})` + ")?" + "(?=\\W|$)(?!\\:\\d)", "i");
|
||
const MONTH_NAME_GROUP = 1;
|
||
const DATE_GROUP = 2;
|
||
const DATE_TO_GROUP = 3;
|
||
const YEAR_GROUP = 4;
|
||
|
||
class ENMonthNameMiddleEndianParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern() {
|
||
return PATTERN;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const month = constants_1.MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()];
|
||
const day = constants_2.parseOrdinalNumberPattern(match[DATE_GROUP]);
|
||
|
||
if (day > 31) {
|
||
return null;
|
||
}
|
||
|
||
const components = context.createParsingComponents({
|
||
day: day,
|
||
month: month
|
||
});
|
||
|
||
if (match[YEAR_GROUP]) {
|
||
const year = constants_3.parseYear(match[YEAR_GROUP]);
|
||
components.assign("year", year);
|
||
} else {
|
||
const year = years_1.findYearClosestToRef(context.refDate, day, month);
|
||
components.imply("year", year);
|
||
}
|
||
|
||
if (!match[DATE_TO_GROUP]) {
|
||
return components;
|
||
}
|
||
|
||
const endDate = constants_2.parseOrdinalNumberPattern(match[DATE_TO_GROUP]);
|
||
const result = context.createParsingResult(match.index, match[0]);
|
||
result.start = components;
|
||
result.end = components.clone();
|
||
result.end.assign("day", endDate);
|
||
return result;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = ENMonthNameMiddleEndianParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENMonthNameParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js");
|
||
|
||
const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js");
|
||
|
||
const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js");
|
||
|
||
const constants_2 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const PATTERN = new RegExp(`((?:in)\\s*)?` + `(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})` + `\\s*` + `(?:` + `[,-]?\\s*(${constants_2.YEAR_PATTERN})?` + ")?" + "(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)", "i");
|
||
const PREFIX_GROUP = 1;
|
||
const MONTH_NAME_GROUP = 2;
|
||
const YEAR_GROUP = 3;
|
||
|
||
class ENMonthNameParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern() {
|
||
return PATTERN;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const monthName = match[MONTH_NAME_GROUP].toLowerCase();
|
||
|
||
if (match[0].length <= 3 && !constants_1.FULL_MONTH_NAME_DICTIONARY[monthName]) {
|
||
return null;
|
||
}
|
||
|
||
const result = context.createParsingResult(match.index + (match[PREFIX_GROUP] || "").length, match.index + match[0].length);
|
||
result.start.imply("day", 1);
|
||
const month = constants_1.MONTH_DICTIONARY[monthName];
|
||
result.start.assign("month", month);
|
||
|
||
if (match[YEAR_GROUP]) {
|
||
const year = constants_2.parseYear(match[YEAR_GROUP]);
|
||
result.start.assign("year", year);
|
||
} else {
|
||
const year = years_1.findYearClosestToRef(context.refDate, 1, month);
|
||
result.start.imply("year", year);
|
||
}
|
||
|
||
return result;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = ENMonthNameParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENRelativeDateFormatParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js");
|
||
|
||
const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js");
|
||
|
||
const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js"));
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js");
|
||
|
||
const PATTERN = new RegExp(`(this|next|last|past)\\s*(${pattern_1.matchAnyPattern(constants_1.TIME_UNIT_DICTIONARY)})(?=\\s*)` + "(?=\\W|$)", "i");
|
||
const MODIFIER_WORD_GROUP = 1;
|
||
const RELATIVE_WORD_GROUP = 2;
|
||
|
||
class ENRelativeDateFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern() {
|
||
return PATTERN;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const modifier = match[MODIFIER_WORD_GROUP].toLowerCase();
|
||
const unitWord = match[RELATIVE_WORD_GROUP].toLowerCase();
|
||
const timeunit = constants_1.TIME_UNIT_DICTIONARY[unitWord];
|
||
|
||
if (modifier == "next") {
|
||
const timeUnits = {};
|
||
timeUnits[timeunit] = 1;
|
||
return results_1.ParsingComponents.createRelativeFromRefInstant(context.refDate, timeUnits);
|
||
}
|
||
|
||
if (modifier == "last" || modifier == "past") {
|
||
const timeUnits = {};
|
||
timeUnits[timeunit] = -1;
|
||
return results_1.ParsingComponents.createRelativeFromRefInstant(context.refDate, timeUnits);
|
||
}
|
||
|
||
const components = context.createParsingComponents();
|
||
let date = dayjs_1.default(context.refDate);
|
||
|
||
if (unitWord.match(/week/i)) {
|
||
date = date.add(-date.get("d"), "d");
|
||
components.imply("day", date.date());
|
||
components.imply("month", date.month() + 1);
|
||
components.imply("year", date.year());
|
||
} else if (unitWord.match(/month/i)) {
|
||
date = date.add(-date.date() + 1, "d");
|
||
components.imply("day", date.date());
|
||
components.assign("year", date.year());
|
||
components.assign("month", date.month() + 1);
|
||
} else if (unitWord.match(/year/i)) {
|
||
date = date.add(-date.date() + 1, "d");
|
||
date = date.add(-date.month(), "month");
|
||
components.imply("day", date.date());
|
||
components.imply("month", date.month() + 1);
|
||
components.assign("year", date.year());
|
||
}
|
||
|
||
return components;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = ENRelativeDateFormatParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENSlashMonthFormatParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const PATTERN = new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})" + "", "i");
|
||
const MONTH_GROUP = 1;
|
||
const YEAR_GROUP = 2;
|
||
|
||
class ENSlashMonthFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern() {
|
||
return PATTERN;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const year = parseInt(match[YEAR_GROUP]);
|
||
const month = parseInt(match[MONTH_GROUP]);
|
||
return context.createParsingComponents().imply("day", 1).assign("month", month).assign("year", year);
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = ENSlashMonthFormatParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENTimeExpressionParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js");
|
||
|
||
const AbstractTimeExpressionParser_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractTimeExpressionParser.js");
|
||
|
||
class ENTimeExpressionParser extends AbstractTimeExpressionParser_1.AbstractTimeExpressionParser {
|
||
constructor(strictMode) {
|
||
super(strictMode);
|
||
}
|
||
|
||
followingPhase() {
|
||
return "\\s*(?:\\-|\\–|\\~|\\〜|to|\\?)\\s*";
|
||
}
|
||
|
||
primaryPrefix() {
|
||
return "(?:(?:at|from)\\s*)??";
|
||
}
|
||
|
||
primarySuffix() {
|
||
return "(?:\\s*(?:o\\W*clock|at\\s*night|in\\s*the\\s*(?:morning|afternoon)))?(?!/)(?=\\W|$)";
|
||
}
|
||
|
||
extractPrimaryTimeComponents(context, match) {
|
||
const components = super.extractPrimaryTimeComponents(context, match);
|
||
|
||
if (components) {
|
||
if (match[0].endsWith("night")) {
|
||
const hour = components.get("hour");
|
||
|
||
if (hour >= 6 && hour < 12) {
|
||
components.assign("hour", components.get("hour") + 12);
|
||
components.assign("meridiem", index_1.Meridiem.PM);
|
||
} else if (hour < 6) {
|
||
components.assign("meridiem", index_1.Meridiem.AM);
|
||
}
|
||
}
|
||
|
||
if (match[0].endsWith("afternoon")) {
|
||
components.assign("meridiem", index_1.Meridiem.PM);
|
||
const hour = components.get("hour");
|
||
|
||
if (hour >= 0 && hour <= 6) {
|
||
components.assign("hour", components.get("hour") + 12);
|
||
}
|
||
}
|
||
|
||
if (match[0].endsWith("morning")) {
|
||
components.assign("meridiem", index_1.Meridiem.AM);
|
||
const hour = components.get("hour");
|
||
|
||
if (hour < 12) {
|
||
components.assign("hour", components.get("hour"));
|
||
}
|
||
}
|
||
}
|
||
|
||
return components;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = ENTimeExpressionParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENTimeUnitAgoFormatParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js");
|
||
|
||
const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const timeunits_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/timeunits.js");
|
||
|
||
const PATTERN = new RegExp("" + "(" + constants_1.TIME_UNITS_PATTERN + ")" + "(?:ago|before|earlier)(?=(?:\\W|$))", "i");
|
||
const STRICT_PATTERN = new RegExp("" + "(" + constants_1.TIME_UNITS_PATTERN + ")" + "ago(?=(?:\\W|$))", "i");
|
||
|
||
class ENTimeUnitAgoFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
constructor(strictMode) {
|
||
super();
|
||
this.strictMode = strictMode;
|
||
}
|
||
|
||
innerPattern() {
|
||
return this.strictMode ? STRICT_PATTERN : PATTERN;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const timeUnits = constants_1.parseTimeUnits(match[1]);
|
||
const outputTimeUnits = timeunits_1.reverseTimeUnits(timeUnits);
|
||
return results_1.ParsingComponents.createRelativeFromRefInstant(context.refDate, outputTimeUnits);
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = ENTimeUnitAgoFormatParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENTimeUnitCasualRelativeFormatParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js");
|
||
|
||
const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const timeunits_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/timeunits.js");
|
||
|
||
const PATTERN = new RegExp(`(this|last|past|next|\\+|-)\\s*(${constants_1.TIME_UNITS_PATTERN})(?=\\W|$)`, "i");
|
||
|
||
class ENTimeUnitCasualRelativeFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern() {
|
||
return PATTERN;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const prefix = match[1].toLowerCase();
|
||
let timeUnits = constants_1.parseTimeUnits(match[2]);
|
||
|
||
switch (prefix) {
|
||
case "last":
|
||
case "past":
|
||
case "-":
|
||
timeUnits = timeunits_1.reverseTimeUnits(timeUnits);
|
||
break;
|
||
}
|
||
|
||
return results_1.ParsingComponents.createRelativeFromRefInstant(context.refDate, timeUnits);
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = ENTimeUnitCasualRelativeFormatParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENTimeUnitLaterFormatParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js");
|
||
|
||
const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const PATTERN = new RegExp("" + "(" + constants_1.TIME_UNITS_PATTERN + ")" + "(later|after|from now|henceforth|forward|out)" + "(?=(?:\\W|$))", "i");
|
||
const STRICT_PATTERN = new RegExp("" + "(" + constants_1.TIME_UNITS_PATTERN + ")" + "(later|from now)" + "(?=(?:\\W|$))", "i");
|
||
const GROUP_NUM_TIMEUNITS = 1;
|
||
|
||
class ENTimeUnitLaterFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
constructor(strictMode) {
|
||
super();
|
||
this.strictMode = strictMode;
|
||
}
|
||
|
||
innerPattern() {
|
||
return this.strictMode ? STRICT_PATTERN : PATTERN;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const fragments = constants_1.parseTimeUnits(match[GROUP_NUM_TIMEUNITS]);
|
||
return results_1.ParsingComponents.createRelativeFromRefInstant(context.refDate, fragments);
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = ENTimeUnitLaterFormatParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENTimeUnitWithinFormatParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js");
|
||
|
||
const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const PATTERN_WITH_PREFIX = new RegExp(`(?:within|in|for)\\s*` + `(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${constants_1.TIME_UNITS_PATTERN})(?=\\W|$)`, "i");
|
||
const PATTERN_WITHOUT_PREFIX = new RegExp(`(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${constants_1.TIME_UNITS_PATTERN})(?=\\W|$)`, "i");
|
||
|
||
class ENTimeUnitWithinFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern(context) {
|
||
return context.option.forwardDate ? PATTERN_WITHOUT_PREFIX : PATTERN_WITH_PREFIX;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const timeUnits = constants_1.parseTimeUnits(match[1]);
|
||
return results_1.ParsingComponents.createRelativeFromRefInstant(context.refDate, timeUnits);
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = ENTimeUnitWithinFormatParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENWeekdayParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js");
|
||
|
||
const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const weeks_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/weeks.js");
|
||
|
||
const PATTERN = new RegExp("(?:(?:\\,|\\(|\\()\\s*)?" + "(?:on\\s*?)?" + "(?:(this|last|past|next)\\s*)?" + `(${pattern_1.matchAnyPattern(constants_1.WEEKDAY_DICTIONARY)})` + "(?:\\s*(?:\\,|\\)|\\)))?" + "(?:\\s*(this|last|past|next)\\s*week)?" + "(?=\\W|$)", "i");
|
||
const PREFIX_GROUP = 1;
|
||
const WEEKDAY_GROUP = 2;
|
||
const POSTFIX_GROUP = 3;
|
||
|
||
class ENWeekdayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern() {
|
||
return PATTERN;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();
|
||
const offset = constants_1.WEEKDAY_DICTIONARY[dayOfWeek];
|
||
const prefix = match[PREFIX_GROUP];
|
||
const postfix = match[POSTFIX_GROUP];
|
||
let modifierWord = prefix || postfix;
|
||
modifierWord = modifierWord || "";
|
||
modifierWord = modifierWord.toLowerCase();
|
||
let modifier = null;
|
||
|
||
if (modifierWord == "last" || modifierWord == "past") {
|
||
modifier = "last";
|
||
} else if (modifierWord == "next") {
|
||
modifier = "next";
|
||
} else if (modifierWord == "this") {
|
||
modifier = "this";
|
||
}
|
||
|
||
const date = weeks_1.toDayJSWeekday(context.refDate, offset, modifier);
|
||
return context.createParsingComponents().assign("weekday", offset).imply("day", date.date()).imply("month", date.month() + 1).imply("year", date.year());
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = ENWeekdayParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/en/refiners/ENMergeDateRangeRefiner.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const AbstractMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateRangeRefiner.js"));
|
||
|
||
class ENMergeDateRangeRefiner extends AbstractMergeDateRangeRefiner_1.default {
|
||
patternBetween() {
|
||
return /^\s*(to|-)\s*$/i;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = ENMergeDateRangeRefiner;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/en/refiners/ENMergeDateTimeRefiner.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const AbstractMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateTimeRefiner.js"));
|
||
|
||
class ENMergeDateTimeRefiner extends AbstractMergeDateTimeRefiner_1.default {
|
||
patternBetween() {
|
||
return new RegExp("^\\s*(T|at|after|before|on|of|,|-)?\\s*$");
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = ENMergeDateTimeRefiner;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/fr/constants.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.parseTimeUnits = exports.TIME_UNITS_PATTERN = exports.parseYear = exports.YEAR_PATTERN = exports.parseOrdinalNumberPattern = exports.ORDINAL_NUMBER_PATTERN = exports.parseNumberPattern = exports.NUMBER_PATTERN = exports.TIME_UNIT_DICTIONARY = exports.INTEGER_WORD_DICTIONARY = exports.MONTH_DICTIONARY = exports.WEEKDAY_DICTIONARY = void 0;
|
||
|
||
const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js");
|
||
|
||
exports.WEEKDAY_DICTIONARY = {
|
||
"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
|
||
};
|
||
exports.MONTH_DICTIONARY = {
|
||
"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,
|
||
"juil": 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
|
||
};
|
||
exports.INTEGER_WORD_DICTIONARY = {
|
||
"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
|
||
};
|
||
exports.TIME_UNIT_DICTIONARY = {
|
||
"sec": "second",
|
||
"seconde": "second",
|
||
"secondes": "second",
|
||
"min": "minute",
|
||
"mins": "minute",
|
||
"minute": "minute",
|
||
"minutes": "minute",
|
||
"h": "hour",
|
||
"hr": "hour",
|
||
"hrs": "hour",
|
||
"heure": "hour",
|
||
"heures": "hour",
|
||
"jour": "d",
|
||
"jours": "d",
|
||
"semaine": "week",
|
||
"semaines": "week",
|
||
"mois": "month",
|
||
"trimestre": "quarter",
|
||
"trimestres": "quarter",
|
||
"ans": "year",
|
||
"année": "year",
|
||
"années": "year"
|
||
};
|
||
exports.NUMBER_PATTERN = `(?:${pattern_1.matchAnyPattern(exports.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|une?|quelques?|demi-?)`;
|
||
|
||
function parseNumberPattern(match) {
|
||
const num = match.toLowerCase();
|
||
|
||
if (exports.INTEGER_WORD_DICTIONARY[num] !== undefined) {
|
||
return exports.INTEGER_WORD_DICTIONARY[num];
|
||
} else if (num === "une" || num === "un") {
|
||
return 1;
|
||
} else if (num.match(/quelques?/)) {
|
||
return 3;
|
||
} else if (num.match(/demi-?/)) {
|
||
return 0.5;
|
||
}
|
||
|
||
return parseFloat(num);
|
||
}
|
||
|
||
exports.parseNumberPattern = parseNumberPattern;
|
||
exports.ORDINAL_NUMBER_PATTERN = `(?:[0-9]{1,2}(?:er)?)`;
|
||
|
||
function parseOrdinalNumberPattern(match) {
|
||
let num = match.toLowerCase();
|
||
num = num.replace(/(?:er)$/i, "");
|
||
return parseInt(num);
|
||
}
|
||
|
||
exports.parseOrdinalNumberPattern = parseOrdinalNumberPattern;
|
||
exports.YEAR_PATTERN = `(?:[1-9][0-9]{0,3}\\s*(?:AC|AD|p\\.\\s*C(?:hr?)?\\.\\s*n\\.)|[1-2][0-9]{3}|[5-9][0-9])`;
|
||
|
||
function parseYear(match) {
|
||
if (/AC/i.test(match)) {
|
||
match = match.replace(/BC/i, "");
|
||
return -parseInt(match);
|
||
}
|
||
|
||
if (/AD/i.test(match) || /C/i.test(match)) {
|
||
match = match.replace(/[^\d]+/i, "");
|
||
return parseInt(match);
|
||
}
|
||
|
||
let yearNumber = parseInt(match);
|
||
|
||
if (yearNumber < 100) {
|
||
if (yearNumber > 50) {
|
||
yearNumber = yearNumber + 1900;
|
||
} else {
|
||
yearNumber = yearNumber + 2000;
|
||
}
|
||
}
|
||
|
||
return yearNumber;
|
||
}
|
||
|
||
exports.parseYear = parseYear;
|
||
const SINGLE_TIME_UNIT_PATTERN = `(${exports.NUMBER_PATTERN})\\s{0,5}(${pattern_1.matchAnyPattern(exports.TIME_UNIT_DICTIONARY)})\\s{0,5}`;
|
||
const SINGLE_TIME_UNIT_REGEX = new RegExp(SINGLE_TIME_UNIT_PATTERN, "i");
|
||
exports.TIME_UNITS_PATTERN = pattern_1.repeatedTimeunitPattern("", SINGLE_TIME_UNIT_PATTERN);
|
||
|
||
function parseTimeUnits(timeunitText) {
|
||
const fragments = {};
|
||
let remainingText = timeunitText;
|
||
let match = SINGLE_TIME_UNIT_REGEX.exec(remainingText);
|
||
|
||
while (match) {
|
||
collectDateTimeFragment(fragments, match);
|
||
remainingText = remainingText.substring(match[0].length);
|
||
match = SINGLE_TIME_UNIT_REGEX.exec(remainingText);
|
||
}
|
||
|
||
return fragments;
|
||
}
|
||
|
||
exports.parseTimeUnits = parseTimeUnits;
|
||
|
||
function collectDateTimeFragment(fragments, match) {
|
||
const num = parseNumberPattern(match[1]);
|
||
const unit = exports.TIME_UNIT_DICTIONARY[match[2].toLowerCase()];
|
||
fragments[unit] = num;
|
||
}
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/fr/index.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.createConfiguration = exports.createCasualConfiguration = exports.parseDate = exports.parse = exports.strict = exports.casual = void 0;
|
||
|
||
const configurations_1 = __webpack_require__("./node_modules/chrono-node/dist/configurations.js");
|
||
|
||
const chrono_1 = __webpack_require__("./node_modules/chrono-node/dist/chrono.js");
|
||
|
||
const FRCasualDateParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/fr/parsers/FRCasualDateParser.js"));
|
||
|
||
const FRCasualTimeParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/fr/parsers/FRCasualTimeParser.js"));
|
||
|
||
const SlashDateFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/parsers/SlashDateFormatParser.js"));
|
||
|
||
const FRTimeExpressionParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/fr/parsers/FRTimeExpressionParser.js"));
|
||
|
||
const FRMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/fr/refiners/FRMergeDateTimeRefiner.js"));
|
||
|
||
const FRMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/fr/refiners/FRMergeDateRangeRefiner.js"));
|
||
|
||
const FRWeekdayParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/fr/parsers/FRWeekdayParser.js"));
|
||
|
||
const FRSpecificTimeExpressionParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/fr/parsers/FRSpecificTimeExpressionParser.js"));
|
||
|
||
const FRMonthNameLittleEndianParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/fr/parsers/FRMonthNameLittleEndianParser.js"));
|
||
|
||
const FRTimeUnitAgoFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/fr/parsers/FRTimeUnitAgoFormatParser.js"));
|
||
|
||
const FRTimeUnitWithinFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/fr/parsers/FRTimeUnitWithinFormatParser.js"));
|
||
|
||
const FRTimeUnitRelativeFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/fr/parsers/FRTimeUnitRelativeFormatParser.js"));
|
||
|
||
exports.casual = new chrono_1.Chrono(createCasualConfiguration());
|
||
exports.strict = new chrono_1.Chrono(createConfiguration(true));
|
||
|
||
function parse(text, ref, option) {
|
||
return exports.casual.parse(text, ref, option);
|
||
}
|
||
|
||
exports.parse = parse;
|
||
|
||
function parseDate(text, ref, option) {
|
||
return exports.casual.parseDate(text, ref, option);
|
||
}
|
||
|
||
exports.parseDate = parseDate;
|
||
|
||
function createCasualConfiguration(littleEndian = true) {
|
||
const option = createConfiguration(false, littleEndian);
|
||
option.parsers.unshift(new FRCasualDateParser_1.default());
|
||
option.parsers.unshift(new FRCasualTimeParser_1.default());
|
||
option.parsers.unshift(new FRTimeUnitRelativeFormatParser_1.default());
|
||
return option;
|
||
}
|
||
|
||
exports.createCasualConfiguration = createCasualConfiguration;
|
||
|
||
function createConfiguration(strictMode = true, littleEndian = true) {
|
||
return configurations_1.includeCommonConfiguration({
|
||
parsers: [new SlashDateFormatParser_1.default(littleEndian), new FRMonthNameLittleEndianParser_1.default(), new FRTimeExpressionParser_1.default(), new FRSpecificTimeExpressionParser_1.default(), new FRTimeUnitAgoFormatParser_1.default(), new FRTimeUnitWithinFormatParser_1.default(), new FRWeekdayParser_1.default()],
|
||
refiners: [new FRMergeDateTimeRefiner_1.default(), new FRMergeDateRangeRefiner_1.default()]
|
||
}, strictMode);
|
||
}
|
||
|
||
exports.createConfiguration = createConfiguration;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/fr/parsers/FRCasualDateParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
||
if (k2 === undefined) k2 = k;
|
||
Object.defineProperty(o, k2, {
|
||
enumerable: true,
|
||
get: function () {
|
||
return m[k];
|
||
}
|
||
});
|
||
} : function (o, m, k, k2) {
|
||
if (k2 === undefined) k2 = k;
|
||
o[k2] = m[k];
|
||
});
|
||
|
||
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
|
||
Object.defineProperty(o, "default", {
|
||
enumerable: true,
|
||
value: v
|
||
});
|
||
} : function (o, v) {
|
||
o["default"] = v;
|
||
});
|
||
|
||
var __importStar = this && this.__importStar || function (mod) {
|
||
if (mod && mod.__esModule) return mod;
|
||
var result = {};
|
||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||
|
||
__setModuleDefault(result, mod);
|
||
|
||
return result;
|
||
};
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js"));
|
||
|
||
const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const dayjs_2 = __webpack_require__("./node_modules/chrono-node/dist/utils/dayjs.js");
|
||
|
||
const references = __importStar(__webpack_require__("./node_modules/chrono-node/dist/common/casualReferences.js"));
|
||
|
||
class FRCasualDateParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern(context) {
|
||
return /(maintenant|aujourd'hui|demain|hier|cette\s*nuit|la\s*veille)(?=\W|$)/i;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
let targetDate = dayjs_1.default(context.refDate);
|
||
const lowerText = match[0].toLowerCase();
|
||
const component = context.createParsingComponents();
|
||
|
||
switch (lowerText) {
|
||
case "maintenant":
|
||
return references.now(context.reference);
|
||
|
||
case "aujourd'hui":
|
||
return references.today(context.reference);
|
||
|
||
case "hier":
|
||
return references.yesterday(context.reference);
|
||
|
||
case "demain":
|
||
return references.tomorrow(context.reference);
|
||
|
||
default:
|
||
if (lowerText.match(/cette\s*nuit/)) {
|
||
dayjs_2.assignSimilarDate(component, targetDate);
|
||
component.imply("hour", 22);
|
||
component.imply("meridiem", index_1.Meridiem.PM);
|
||
} else if (lowerText.match(/la\s*veille/)) {
|
||
targetDate = targetDate.add(-1, "day");
|
||
dayjs_2.assignSimilarDate(component, targetDate);
|
||
component.imply("hour", 0);
|
||
}
|
||
|
||
}
|
||
|
||
return component;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = FRCasualDateParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/fr/parsers/FRCasualTimeParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
class FRCasualTimeParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern(context) {
|
||
return /(cet?)?\s*(matin|soir|après-midi|aprem|a midi|à minuit)(?=\W|$)/i;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const suffixLower = match[2].toLowerCase();
|
||
const component = context.createParsingComponents();
|
||
|
||
switch (suffixLower) {
|
||
case "après-midi":
|
||
case "aprem":
|
||
component.imply("hour", 14);
|
||
component.imply("minute", 0);
|
||
component.imply("meridiem", index_1.Meridiem.PM);
|
||
break;
|
||
|
||
case "soir":
|
||
component.imply("hour", 18);
|
||
component.imply("minute", 0);
|
||
component.imply("meridiem", index_1.Meridiem.PM);
|
||
break;
|
||
|
||
case "matin":
|
||
component.imply("hour", 8);
|
||
component.imply("minute", 0);
|
||
component.imply("meridiem", index_1.Meridiem.AM);
|
||
break;
|
||
|
||
case "a midi":
|
||
component.imply("hour", 12);
|
||
component.imply("minute", 0);
|
||
component.imply("meridiem", index_1.Meridiem.AM);
|
||
break;
|
||
|
||
case "à minuit":
|
||
component.imply("hour", 0);
|
||
component.imply("meridiem", index_1.Meridiem.AM);
|
||
break;
|
||
}
|
||
|
||
return component;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = FRCasualTimeParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/fr/parsers/FRMonthNameLittleEndianParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js");
|
||
|
||
const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/fr/constants.js");
|
||
|
||
const constants_2 = __webpack_require__("./node_modules/chrono-node/dist/locales/fr/constants.js");
|
||
|
||
const constants_3 = __webpack_require__("./node_modules/chrono-node/dist/locales/fr/constants.js");
|
||
|
||
const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const PATTERN = new RegExp("(?:on\\s*?)?" + `(${constants_3.ORDINAL_NUMBER_PATTERN})` + `(?:\\s*(?:au|\\-|\\–|jusqu'au?|\\s)\\s*(${constants_3.ORDINAL_NUMBER_PATTERN}))?` + `(?:-|/|\\s*(?:de)?\\s*)` + `(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})` + `(?:(?:-|/|,?\\s*)(${constants_2.YEAR_PATTERN}(?![^\\s]\\d)))?` + `(?=\\W|$)`, "i");
|
||
const DATE_GROUP = 1;
|
||
const DATE_TO_GROUP = 2;
|
||
const MONTH_NAME_GROUP = 3;
|
||
const YEAR_GROUP = 4;
|
||
|
||
class FRMonthNameLittleEndianParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern() {
|
||
return PATTERN;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const result = context.createParsingResult(match.index, match[0]);
|
||
const month = constants_1.MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()];
|
||
const day = constants_3.parseOrdinalNumberPattern(match[DATE_GROUP]);
|
||
|
||
if (day > 31) {
|
||
match.index = match.index + match[DATE_GROUP].length;
|
||
return null;
|
||
}
|
||
|
||
result.start.assign("month", month);
|
||
result.start.assign("day", day);
|
||
|
||
if (match[YEAR_GROUP]) {
|
||
const yearNumber = constants_2.parseYear(match[YEAR_GROUP]);
|
||
result.start.assign("year", yearNumber);
|
||
} else {
|
||
const year = years_1.findYearClosestToRef(context.refDate, day, month);
|
||
result.start.imply("year", year);
|
||
}
|
||
|
||
if (match[DATE_TO_GROUP]) {
|
||
const endDate = constants_3.parseOrdinalNumberPattern(match[DATE_TO_GROUP]);
|
||
result.end = result.start.clone();
|
||
result.end.assign("day", endDate);
|
||
}
|
||
|
||
return result;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = FRMonthNameLittleEndianParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/fr/parsers/FRSpecificTimeExpressionParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js");
|
||
|
||
const FIRST_REG_PATTERN = new RegExp("(^|\\s|T)" + "(?:(?:[àa])\\s*)?" + "(\\d{1,2})(?:h|:)?" + "(?:(\\d{1,2})(?:m|:)?)?" + "(?:(\\d{1,2})(?:s|:)?)?" + "(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?" + "(?=\\W|$)", "i");
|
||
const SECOND_REG_PATTERN = new RegExp("^\\s*(\\-|\\–|\\~|\\〜|[àa]|\\?)\\s*" + "(\\d{1,2})(?:h|:)?" + "(?:(\\d{1,2})(?:m|:)?)?" + "(?:(\\d{1,2})(?:s|:)?)?" + "(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?" + "(?=\\W|$)", "i");
|
||
const HOUR_GROUP = 2;
|
||
const MINUTE_GROUP = 3;
|
||
const SECOND_GROUP = 4;
|
||
const AM_PM_HOUR_GROUP = 5;
|
||
|
||
class FRSpecificTimeExpressionParser {
|
||
pattern(context) {
|
||
return FIRST_REG_PATTERN;
|
||
}
|
||
|
||
extract(context, match) {
|
||
const result = context.createParsingResult(match.index + match[1].length, match[0].substring(match[1].length));
|
||
|
||
if (result.text.match(/^\d{4}$/)) {
|
||
match.index += match[0].length;
|
||
return null;
|
||
}
|
||
|
||
result.start = FRSpecificTimeExpressionParser.extractTimeComponent(result.start.clone(), match);
|
||
|
||
if (!result.start) {
|
||
match.index += match[0].length;
|
||
return null;
|
||
}
|
||
|
||
const remainingText = context.text.substring(match.index + match[0].length);
|
||
const secondMatch = SECOND_REG_PATTERN.exec(remainingText);
|
||
|
||
if (secondMatch) {
|
||
result.end = FRSpecificTimeExpressionParser.extractTimeComponent(result.start.clone(), secondMatch);
|
||
|
||
if (result.end) {
|
||
result.text += secondMatch[0];
|
||
}
|
||
}
|
||
|
||
return result;
|
||
}
|
||
|
||
static extractTimeComponent(extractingComponents, match) {
|
||
let hour = 0;
|
||
let minute = 0;
|
||
let meridiem = null;
|
||
hour = parseInt(match[HOUR_GROUP]);
|
||
|
||
if (match[MINUTE_GROUP] != null) {
|
||
minute = parseInt(match[MINUTE_GROUP]);
|
||
}
|
||
|
||
if (minute >= 60 || hour > 24) {
|
||
return null;
|
||
}
|
||
|
||
if (hour >= 12) {
|
||
meridiem = index_1.Meridiem.PM;
|
||
}
|
||
|
||
if (match[AM_PM_HOUR_GROUP] != null) {
|
||
if (hour > 12) return null;
|
||
const ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase();
|
||
|
||
if (ampm == "a") {
|
||
meridiem = index_1.Meridiem.AM;
|
||
|
||
if (hour == 12) {
|
||
hour = 0;
|
||
}
|
||
}
|
||
|
||
if (ampm == "p") {
|
||
meridiem = index_1.Meridiem.PM;
|
||
|
||
if (hour != 12) {
|
||
hour += 12;
|
||
}
|
||
}
|
||
}
|
||
|
||
extractingComponents.assign("hour", hour);
|
||
extractingComponents.assign("minute", minute);
|
||
|
||
if (meridiem !== null) {
|
||
extractingComponents.assign("meridiem", meridiem);
|
||
} else {
|
||
if (hour < 12) {
|
||
extractingComponents.imply("meridiem", index_1.Meridiem.AM);
|
||
} else {
|
||
extractingComponents.imply("meridiem", index_1.Meridiem.PM);
|
||
}
|
||
}
|
||
|
||
if (match[SECOND_GROUP] != null) {
|
||
const second = parseInt(match[SECOND_GROUP]);
|
||
if (second >= 60) return null;
|
||
extractingComponents.assign("second", second);
|
||
}
|
||
|
||
return extractingComponents;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = FRSpecificTimeExpressionParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/fr/parsers/FRTimeExpressionParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const AbstractTimeExpressionParser_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractTimeExpressionParser.js");
|
||
|
||
class FRTimeExpressionParser extends AbstractTimeExpressionParser_1.AbstractTimeExpressionParser {
|
||
primaryPrefix() {
|
||
return "(?:(?:[àa])\\s*)?";
|
||
}
|
||
|
||
followingPhase() {
|
||
return "\\s*(?:\\-|\\–|\\~|\\〜|[àa]|\\?)\\s*";
|
||
}
|
||
|
||
extractPrimaryTimeComponents(context, match) {
|
||
if (match[0].match(/^\s*\d{4}\s*$/)) {
|
||
return null;
|
||
}
|
||
|
||
return super.extractPrimaryTimeComponents(context, match);
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = FRTimeExpressionParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/fr/parsers/FRTimeUnitAgoFormatParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/fr/constants.js");
|
||
|
||
const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const timeunits_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/timeunits.js");
|
||
|
||
class FRTimeUnitAgoFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
constructor() {
|
||
super();
|
||
}
|
||
|
||
innerPattern() {
|
||
return new RegExp(`il y a\\s*(${constants_1.TIME_UNITS_PATTERN})(?=(?:\\W|$))`, "i");
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const timeUnits = constants_1.parseTimeUnits(match[1]);
|
||
const outputTimeUnits = timeunits_1.reverseTimeUnits(timeUnits);
|
||
return results_1.ParsingComponents.createRelativeFromRefInstant(context.refDate, outputTimeUnits);
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = FRTimeUnitAgoFormatParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/fr/parsers/FRTimeUnitRelativeFormatParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/fr/constants.js");
|
||
|
||
const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const timeunits_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/timeunits.js");
|
||
|
||
const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js");
|
||
|
||
class FRTimeUnitAgoFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
constructor() {
|
||
super();
|
||
}
|
||
|
||
innerPattern() {
|
||
return new RegExp(`(?:les?|la|l'|du|des?)\\s*` + `(${constants_1.NUMBER_PATTERN})?` + `(?:\\s*(prochaine?s?|derni[eè]re?s?|pass[ée]e?s?|pr[ée]c[ée]dents?|suivante?s?))?` + `\\s*(${pattern_1.matchAnyPattern(constants_1.TIME_UNIT_DICTIONARY)})` + `(?:\\s*(prochaine?s?|derni[eè]re?s?|pass[ée]e?s?|pr[ée]c[ée]dents?|suivante?s?))?`, "i");
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const num = match[1] ? constants_1.parseNumberPattern(match[1]) : 1;
|
||
const unit = constants_1.TIME_UNIT_DICTIONARY[match[3].toLowerCase()];
|
||
let timeUnits = {};
|
||
timeUnits[unit] = num;
|
||
let modifier = match[2] || match[4] || "";
|
||
modifier = modifier.toLowerCase();
|
||
|
||
if (!modifier) {
|
||
return;
|
||
}
|
||
|
||
if (/derni[eè]re?s?/.test(modifier) || /pass[ée]e?s?/.test(modifier) || /pr[ée]c[ée]dents?/.test(modifier)) {
|
||
timeUnits = timeunits_1.reverseTimeUnits(timeUnits);
|
||
}
|
||
|
||
return results_1.ParsingComponents.createRelativeFromRefInstant(context.refDate, timeUnits);
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = FRTimeUnitAgoFormatParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/fr/parsers/FRTimeUnitWithinFormatParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/fr/constants.js");
|
||
|
||
const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
class FRTimeUnitWithinFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern() {
|
||
return new RegExp(`(?:dans|en|pour|pendant)\\s*(${constants_1.TIME_UNITS_PATTERN})(?=\\W|$)`, "i");
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const timeUnits = constants_1.parseTimeUnits(match[1]);
|
||
return results_1.ParsingComponents.createRelativeFromRefInstant(context.refDate, timeUnits);
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = FRTimeUnitWithinFormatParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/fr/parsers/FRWeekdayParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/fr/constants.js");
|
||
|
||
const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const weeks_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/weeks.js");
|
||
|
||
const PATTERN = new RegExp("(?:(?:\\,|\\(|\\()\\s*)?" + "(?:(?:ce)\\s*)?" + `(${pattern_1.matchAnyPattern(constants_1.WEEKDAY_DICTIONARY)})` + "(?:\\s*(?:\\,|\\)|\\)))?" + "(?:\\s*(dernier|prochain)\\s*)?" + "(?=\\W|\\d|$)", "i");
|
||
const WEEKDAY_GROUP = 1;
|
||
const POSTFIX_GROUP = 2;
|
||
|
||
class FRWeekdayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern() {
|
||
return PATTERN;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();
|
||
const offset = constants_1.WEEKDAY_DICTIONARY[dayOfWeek];
|
||
|
||
if (offset === undefined) {
|
||
return null;
|
||
}
|
||
|
||
let suffix = match[POSTFIX_GROUP];
|
||
suffix = suffix || "";
|
||
suffix = suffix.toLowerCase();
|
||
let modifier = null;
|
||
|
||
if (suffix == "dernier") {
|
||
modifier = "last";
|
||
} else if (suffix == "prochain") {
|
||
modifier = "next";
|
||
}
|
||
|
||
const date = weeks_1.toDayJSWeekday(context.refDate, offset, modifier);
|
||
return context.createParsingComponents().assign("weekday", offset).imply("day", date.date()).imply("month", date.month() + 1).imply("year", date.year());
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = FRWeekdayParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/fr/refiners/FRMergeDateRangeRefiner.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const AbstractMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateRangeRefiner.js"));
|
||
|
||
class FRMergeDateRangeRefiner extends AbstractMergeDateRangeRefiner_1.default {
|
||
patternBetween() {
|
||
return /^\s*(à|a|-)\s*$/i;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = FRMergeDateRangeRefiner;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/fr/refiners/FRMergeDateTimeRefiner.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const AbstractMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateTimeRefiner.js"));
|
||
|
||
class FRMergeDateTimeRefiner extends AbstractMergeDateTimeRefiner_1.default {
|
||
patternBetween() {
|
||
return new RegExp("^\\s*(T|à|a|vers|de|,|-)?\\s*$");
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = FRMergeDateTimeRefiner;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/ja/constants.js":
|
||
/***/ (function(__unused_webpack_module, exports) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.toHankaku = void 0;
|
||
|
||
function toHankaku(text) {
|
||
return String(text).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);
|
||
}
|
||
|
||
exports.toHankaku = toHankaku;
|
||
|
||
function alphaNum(token) {
|
||
return String.fromCharCode(token.charCodeAt(0) - 65248);
|
||
}
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/ja/index.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.createConfiguration = exports.createCasualConfiguration = exports.parseDate = exports.parse = exports.strict = exports.casual = void 0;
|
||
|
||
const JPStandardParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/ja/parsers/JPStandardParser.js"));
|
||
|
||
const JPMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/ja/refiners/JPMergeDateRangeRefiner.js"));
|
||
|
||
const JPCasualDateParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/ja/parsers/JPCasualDateParser.js"));
|
||
|
||
const chrono_1 = __webpack_require__("./node_modules/chrono-node/dist/chrono.js");
|
||
|
||
exports.casual = new chrono_1.Chrono(createCasualConfiguration());
|
||
exports.strict = new chrono_1.Chrono(createConfiguration());
|
||
|
||
function parse(text, ref, option) {
|
||
return exports.casual.parse(text, ref, option);
|
||
}
|
||
|
||
exports.parse = parse;
|
||
|
||
function parseDate(text, ref, option) {
|
||
return exports.casual.parseDate(text, ref, option);
|
||
}
|
||
|
||
exports.parseDate = parseDate;
|
||
|
||
function createCasualConfiguration() {
|
||
const option = createConfiguration();
|
||
option.parsers.unshift(new JPCasualDateParser_1.default());
|
||
return option;
|
||
}
|
||
|
||
exports.createCasualConfiguration = createCasualConfiguration;
|
||
|
||
function createConfiguration() {
|
||
return {
|
||
parsers: [new JPStandardParser_1.default()],
|
||
refiners: [new JPMergeDateRangeRefiner_1.default()]
|
||
};
|
||
}
|
||
|
||
exports.createConfiguration = createConfiguration;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/ja/parsers/JPCasualDateParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
||
if (k2 === undefined) k2 = k;
|
||
Object.defineProperty(o, k2, {
|
||
enumerable: true,
|
||
get: function () {
|
||
return m[k];
|
||
}
|
||
});
|
||
} : function (o, m, k, k2) {
|
||
if (k2 === undefined) k2 = k;
|
||
o[k2] = m[k];
|
||
});
|
||
|
||
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
|
||
Object.defineProperty(o, "default", {
|
||
enumerable: true,
|
||
value: v
|
||
});
|
||
} : function (o, v) {
|
||
o["default"] = v;
|
||
});
|
||
|
||
var __importStar = this && this.__importStar || function (mod) {
|
||
if (mod && mod.__esModule) return mod;
|
||
var result = {};
|
||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||
|
||
__setModuleDefault(result, mod);
|
||
|
||
return result;
|
||
};
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js"));
|
||
|
||
const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js");
|
||
|
||
const references = __importStar(__webpack_require__("./node_modules/chrono-node/dist/common/casualReferences.js"));
|
||
|
||
const PATTERN = /今日|当日|昨日|明日|今夜|今夕|今晩|今朝/i;
|
||
|
||
class JPCasualDateParser {
|
||
pattern() {
|
||
return PATTERN;
|
||
}
|
||
|
||
extract(context, match) {
|
||
const text = match[0];
|
||
const date = dayjs_1.default(context.refDate);
|
||
const components = context.createParsingComponents();
|
||
|
||
switch (text) {
|
||
case "昨日":
|
||
return references.yesterday(context.reference);
|
||
|
||
case "明日":
|
||
return references.tomorrow(context.reference);
|
||
|
||
case "今日":
|
||
case "当日":
|
||
return references.today(context.reference);
|
||
}
|
||
|
||
if (text == "今夜" || text == "今夕" || text == "今晩") {
|
||
components.imply("hour", 22);
|
||
components.assign("meridiem", index_1.Meridiem.PM);
|
||
} else if (text.match("今朝")) {
|
||
components.imply("hour", 6);
|
||
components.assign("meridiem", index_1.Meridiem.AM);
|
||
}
|
||
|
||
components.assign("day", date.date());
|
||
components.assign("month", date.month() + 1);
|
||
components.assign("year", date.year());
|
||
return components;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = JPCasualDateParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/ja/parsers/JPStandardParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/ja/constants.js");
|
||
|
||
const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js");
|
||
|
||
const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js"));
|
||
|
||
const PATTERN = /(?:(?:([同今本])|((昭和|平成|令和)?([0-90-9]{1,4}|元)))年\s*)?([0-90-9]{1,2})月\s*([0-90-9]{1,2})日/i;
|
||
const SPECIAL_YEAR_GROUP = 1;
|
||
const TYPICAL_YEAR_GROUP = 2;
|
||
const ERA_GROUP = 3;
|
||
const YEAR_NUMBER_GROUP = 4;
|
||
const MONTH_GROUP = 5;
|
||
const DAY_GROUP = 6;
|
||
|
||
class JPStandardParser {
|
||
pattern() {
|
||
return PATTERN;
|
||
}
|
||
|
||
extract(context, match) {
|
||
const month = parseInt(constants_1.toHankaku(match[MONTH_GROUP]));
|
||
const day = parseInt(constants_1.toHankaku(match[DAY_GROUP]));
|
||
const components = context.createParsingComponents({
|
||
day: day,
|
||
month: month
|
||
});
|
||
|
||
if (match[SPECIAL_YEAR_GROUP] && match[SPECIAL_YEAR_GROUP].match("同|今|本")) {
|
||
const moment = dayjs_1.default(context.refDate);
|
||
components.assign("year", moment.year());
|
||
}
|
||
|
||
if (match[TYPICAL_YEAR_GROUP]) {
|
||
const yearNumText = match[YEAR_NUMBER_GROUP];
|
||
let year = yearNumText == "元" ? 1 : parseInt(constants_1.toHankaku(yearNumText));
|
||
|
||
if (match[ERA_GROUP] == "令和") {
|
||
year += 2018;
|
||
} else if (match[ERA_GROUP] == "平成") {
|
||
year += 1988;
|
||
} else if (match[ERA_GROUP] == "昭和") {
|
||
year += 1925;
|
||
}
|
||
|
||
components.assign("year", year);
|
||
} else {
|
||
const year = years_1.findYearClosestToRef(context.refDate, day, month);
|
||
components.imply("year", year);
|
||
}
|
||
|
||
return components;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = JPStandardParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/ja/refiners/JPMergeDateRangeRefiner.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const AbstractMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateRangeRefiner.js"));
|
||
|
||
class JPMergeDateRangeRefiner extends AbstractMergeDateRangeRefiner_1.default {
|
||
patternBetween() {
|
||
return /^\s*(から|ー|-)\s*$/i;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = JPMergeDateRangeRefiner;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/nl/constants.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.parseTimeUnits = exports.TIME_UNITS_PATTERN = exports.parseYear = exports.YEAR_PATTERN = exports.parseOrdinalNumberPattern = exports.ORDINAL_NUMBER_PATTERN = exports.parseNumberPattern = exports.NUMBER_PATTERN = exports.TIME_UNIT_DICTIONARY = exports.ORDINAL_WORD_DICTIONARY = exports.INTEGER_WORD_DICTIONARY = exports.MONTH_DICTIONARY = exports.WEEKDAY_DICTIONARY = void 0;
|
||
|
||
const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js");
|
||
|
||
const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js");
|
||
|
||
exports.WEEKDAY_DICTIONARY = {
|
||
zondag: 0,
|
||
zon: 0,
|
||
"zon.": 0,
|
||
zo: 0,
|
||
"zo.": 0,
|
||
maandag: 1,
|
||
ma: 1,
|
||
"ma.": 1,
|
||
dinsdag: 2,
|
||
din: 2,
|
||
"din.": 2,
|
||
di: 2,
|
||
"di.": 2,
|
||
woensdag: 3,
|
||
woe: 3,
|
||
"woe.": 3,
|
||
wo: 3,
|
||
"wo.": 3,
|
||
donderdag: 4,
|
||
dond: 4,
|
||
"dond.": 4,
|
||
do: 4,
|
||
"do.": 4,
|
||
vrijdag: 5,
|
||
vrij: 5,
|
||
"vrij.": 5,
|
||
vr: 5,
|
||
"vr.": 5,
|
||
zaterdag: 6,
|
||
zat: 6,
|
||
"zat.": 6,
|
||
"za": 6,
|
||
"za.": 6
|
||
};
|
||
exports.MONTH_DICTIONARY = {
|
||
januari: 1,
|
||
jan: 1,
|
||
"jan.": 1,
|
||
februari: 2,
|
||
feb: 2,
|
||
"feb.": 2,
|
||
maart: 3,
|
||
mar: 3,
|
||
"mar.": 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
|
||
};
|
||
exports.INTEGER_WORD_DICTIONARY = {
|
||
een: 1,
|
||
twee: 2,
|
||
drie: 3,
|
||
vier: 4,
|
||
vijf: 5,
|
||
zes: 6,
|
||
zeven: 7,
|
||
acht: 8,
|
||
negen: 9,
|
||
tien: 10,
|
||
elf: 11,
|
||
twaalf: 12
|
||
};
|
||
exports.ORDINAL_WORD_DICTIONARY = {
|
||
eerste: 1,
|
||
tweede: 2,
|
||
derde: 3,
|
||
vierde: 4,
|
||
vijfde: 5,
|
||
zesde: 6,
|
||
zevende: 7,
|
||
achtste: 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,
|
||
"drieentwintigste": 23,
|
||
"vierentwintigste": 24,
|
||
"vijfentwintigste": 25,
|
||
"zesentwintigste": 26,
|
||
"zevenentwintigste": 27,
|
||
"achtentwintig": 28,
|
||
"negenentwintig": 29,
|
||
"dertigste": 30,
|
||
"eenendertigste": 31
|
||
};
|
||
exports.TIME_UNIT_DICTIONARY = {
|
||
sec: "second",
|
||
second: "second",
|
||
seconden: "second",
|
||
min: "minute",
|
||
mins: "minute",
|
||
minute: "minute",
|
||
minuten: "minute",
|
||
h: "hour",
|
||
hr: "hour",
|
||
hrs: "hour",
|
||
uur: "hour",
|
||
uren: "hour",
|
||
dag: "d",
|
||
dagen: "d",
|
||
week: "week",
|
||
weken: "week",
|
||
maand: "month",
|
||
maanden: "month",
|
||
jaar: "year",
|
||
jr: "year",
|
||
jaren: "year"
|
||
};
|
||
exports.NUMBER_PATTERN = `(?:${pattern_1.matchAnyPattern(exports.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|een?|halve?)`;
|
||
|
||
function parseNumberPattern(match) {
|
||
const num = match.toLowerCase();
|
||
|
||
if (exports.INTEGER_WORD_DICTIONARY[num] !== undefined) {
|
||
return exports.INTEGER_WORD_DICTIONARY[num];
|
||
} else if (num === "een") {
|
||
return 1;
|
||
} else if (num.match(/halve?/)) {
|
||
return 0.5;
|
||
}
|
||
|
||
return parseFloat(num);
|
||
}
|
||
|
||
exports.parseNumberPattern = parseNumberPattern;
|
||
exports.ORDINAL_NUMBER_PATTERN = `(?:${pattern_1.matchAnyPattern(exports.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:ste|de)?)`;
|
||
|
||
function parseOrdinalNumberPattern(match) {
|
||
let num = match.toLowerCase();
|
||
|
||
if (exports.ORDINAL_WORD_DICTIONARY[num] !== undefined) {
|
||
return exports.ORDINAL_WORD_DICTIONARY[num];
|
||
}
|
||
|
||
num = num.replace(/(?:ste|de)$/i, "");
|
||
return parseInt(num);
|
||
}
|
||
|
||
exports.parseOrdinalNumberPattern = parseOrdinalNumberPattern;
|
||
exports.YEAR_PATTERN = `(?:[1-9][0-9]{0,3}\\s*(?:voor Christus|na Christus)|[1-2][0-9]{3}|[5-9][0-9])`;
|
||
|
||
function parseYear(match) {
|
||
if (/voor Christus/i.test(match)) {
|
||
match = match.replace(/voor Christus/i, "");
|
||
return -parseInt(match);
|
||
}
|
||
|
||
if (/na Christus/i.test(match)) {
|
||
match = match.replace(/na Christus/i, "");
|
||
return parseInt(match);
|
||
}
|
||
|
||
const rawYearNumber = parseInt(match);
|
||
return years_1.findMostLikelyADYear(rawYearNumber);
|
||
}
|
||
|
||
exports.parseYear = parseYear;
|
||
const SINGLE_TIME_UNIT_PATTERN = `(${exports.NUMBER_PATTERN})\\s{0,5}(${pattern_1.matchAnyPattern(exports.TIME_UNIT_DICTIONARY)})\\s{0,5}`;
|
||
const SINGLE_TIME_UNIT_REGEX = new RegExp(SINGLE_TIME_UNIT_PATTERN, "i");
|
||
exports.TIME_UNITS_PATTERN = pattern_1.repeatedTimeunitPattern(`(?:(?:binnen|in)\\s*)?`, SINGLE_TIME_UNIT_PATTERN);
|
||
|
||
function parseTimeUnits(timeunitText) {
|
||
const fragments = {};
|
||
let remainingText = timeunitText;
|
||
let match = SINGLE_TIME_UNIT_REGEX.exec(remainingText);
|
||
|
||
while (match) {
|
||
collectDateTimeFragment(fragments, match);
|
||
remainingText = remainingText.substring(match[0].length);
|
||
match = SINGLE_TIME_UNIT_REGEX.exec(remainingText);
|
||
}
|
||
|
||
return fragments;
|
||
}
|
||
|
||
exports.parseTimeUnits = parseTimeUnits;
|
||
|
||
function collectDateTimeFragment(fragments, match) {
|
||
const num = parseNumberPattern(match[1]);
|
||
const unit = exports.TIME_UNIT_DICTIONARY[match[2].toLowerCase()];
|
||
fragments[unit] = num;
|
||
}
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/nl/index.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.createConfiguration = exports.createCasualConfiguration = exports.parseDate = exports.parse = exports.strict = exports.casual = void 0;
|
||
|
||
const configurations_1 = __webpack_require__("./node_modules/chrono-node/dist/configurations.js");
|
||
|
||
const chrono_1 = __webpack_require__("./node_modules/chrono-node/dist/chrono.js");
|
||
|
||
const NLMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/refiners/NLMergeDateRangeRefiner.js"));
|
||
|
||
const NLMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/refiners/NLMergeDateTimeRefiner.js"));
|
||
|
||
const NLCasualDateParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/parsers/NLCasualDateParser.js"));
|
||
|
||
const NLCasualTimeParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/parsers/NLCasualTimeParser.js"));
|
||
|
||
const SlashDateFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/parsers/SlashDateFormatParser.js"));
|
||
|
||
const NLTimeUnitWithinFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/parsers/NLTimeUnitWithinFormatParser.js"));
|
||
|
||
const NLWeekdayParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/parsers/NLWeekdayParser.js"));
|
||
|
||
const NLMonthNameMiddleEndianParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/parsers/NLMonthNameMiddleEndianParser.js"));
|
||
|
||
const NLMonthNameParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/parsers/NLMonthNameParser.js"));
|
||
|
||
const NLSlashMonthFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/parsers/NLSlashMonthFormatParser.js"));
|
||
|
||
const NLTimeExpressionParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/parsers/NLTimeExpressionParser.js"));
|
||
|
||
const NLCasualYearMonthDayParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/parsers/NLCasualYearMonthDayParser.js"));
|
||
|
||
const NLCasualDateTimeParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/parsers/NLCasualDateTimeParser.js"));
|
||
|
||
exports.casual = new chrono_1.Chrono(createCasualConfiguration());
|
||
exports.strict = new chrono_1.Chrono(createConfiguration(true));
|
||
|
||
function parse(text, ref, option) {
|
||
return exports.casual.parse(text, ref, option);
|
||
}
|
||
|
||
exports.parse = parse;
|
||
|
||
function parseDate(text, ref, option) {
|
||
return exports.casual.parseDate(text, ref, option);
|
||
}
|
||
|
||
exports.parseDate = parseDate;
|
||
|
||
function createCasualConfiguration(littleEndian = true) {
|
||
const option = createConfiguration(false, littleEndian);
|
||
option.parsers.unshift(new NLCasualDateParser_1.default());
|
||
option.parsers.unshift(new NLCasualTimeParser_1.default());
|
||
option.parsers.unshift(new NLCasualDateTimeParser_1.default());
|
||
return option;
|
||
}
|
||
|
||
exports.createCasualConfiguration = createCasualConfiguration;
|
||
|
||
function createConfiguration(strictMode = true, littleEndian = true) {
|
||
return configurations_1.includeCommonConfiguration({
|
||
parsers: [new SlashDateFormatParser_1.default(littleEndian), new NLMonthNameMiddleEndianParser_1.default(), new NLMonthNameParser_1.default(), new NLTimeExpressionParser_1.default(), new NLTimeUnitWithinFormatParser_1.default(), new NLSlashMonthFormatParser_1.default(), new NLWeekdayParser_1.default(), new NLCasualYearMonthDayParser_1.default()],
|
||
refiners: [new NLMergeDateTimeRefiner_1.default(), new NLMergeDateRangeRefiner_1.default()]
|
||
}, strictMode);
|
||
}
|
||
|
||
exports.createConfiguration = createConfiguration;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/nl/parsers/NLCasualDateParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
||
if (k2 === undefined) k2 = k;
|
||
Object.defineProperty(o, k2, {
|
||
enumerable: true,
|
||
get: function () {
|
||
return m[k];
|
||
}
|
||
});
|
||
} : function (o, m, k, k2) {
|
||
if (k2 === undefined) k2 = k;
|
||
o[k2] = m[k];
|
||
});
|
||
|
||
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
|
||
Object.defineProperty(o, "default", {
|
||
enumerable: true,
|
||
value: v
|
||
});
|
||
} : function (o, v) {
|
||
o["default"] = v;
|
||
});
|
||
|
||
var __importStar = this && this.__importStar || function (mod) {
|
||
if (mod && mod.__esModule) return mod;
|
||
var result = {};
|
||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||
|
||
__setModuleDefault(result, mod);
|
||
|
||
return result;
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const references = __importStar(__webpack_require__("./node_modules/chrono-node/dist/common/casualReferences.js"));
|
||
|
||
class NLCasualDateParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern(context) {
|
||
return /(nu|vandaag|morgen|morgend|gisteren)(?=\W|$)/i;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const lowerText = match[0].toLowerCase();
|
||
const component = context.createParsingComponents();
|
||
|
||
switch (lowerText) {
|
||
case "nu":
|
||
return references.now(context.reference);
|
||
|
||
case "vandaag":
|
||
return references.today(context.reference);
|
||
|
||
case "morgen":
|
||
case "morgend":
|
||
return references.tomorrow(context.reference);
|
||
|
||
case "gisteren":
|
||
return references.yesterday(context.reference);
|
||
}
|
||
|
||
return component;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = NLCasualDateParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/nl/parsers/NLCasualDateTimeParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js");
|
||
|
||
const dayjs_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/dayjs.js");
|
||
|
||
const dayjs_2 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js"));
|
||
|
||
const DATE_GROUP = 1;
|
||
const TIME_OF_DAY_GROUP = 2;
|
||
|
||
class NLCasualDateTimeParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern(context) {
|
||
return /(gisteren|morgen|van)(ochtend|middag|namiddag|avond|nacht)(?=\W|$)/i;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const dateText = match[DATE_GROUP].toLowerCase();
|
||
const timeText = match[TIME_OF_DAY_GROUP].toLowerCase();
|
||
const component = context.createParsingComponents();
|
||
const targetDate = dayjs_2.default(context.refDate);
|
||
|
||
switch (dateText) {
|
||
case "gisteren":
|
||
dayjs_1.assignSimilarDate(component, targetDate.add(-1, "day"));
|
||
break;
|
||
|
||
case "van":
|
||
dayjs_1.assignSimilarDate(component, targetDate);
|
||
break;
|
||
|
||
case "morgen":
|
||
dayjs_1.assignTheNextDay(component, targetDate);
|
||
break;
|
||
}
|
||
|
||
switch (timeText) {
|
||
case "ochtend":
|
||
component.imply("meridiem", index_1.Meridiem.AM);
|
||
component.imply("hour", 6);
|
||
break;
|
||
|
||
case "middag":
|
||
component.imply("meridiem", index_1.Meridiem.AM);
|
||
component.imply("hour", 12);
|
||
break;
|
||
|
||
case "namiddag":
|
||
component.imply("meridiem", index_1.Meridiem.PM);
|
||
component.imply("hour", 15);
|
||
break;
|
||
|
||
case "avond":
|
||
component.imply("meridiem", index_1.Meridiem.PM);
|
||
component.imply("hour", 20);
|
||
break;
|
||
}
|
||
|
||
return component;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = NLCasualDateTimeParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/nl/parsers/NLCasualTimeParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js"));
|
||
|
||
const dayjs_2 = __webpack_require__("./node_modules/chrono-node/dist/utils/dayjs.js");
|
||
|
||
const DAY_GROUP = 1;
|
||
const MOMENT_GROUP = 2;
|
||
|
||
class NLCasualTimeParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern() {
|
||
return /(deze)?\s*(namiddag|avond|middernacht|ochtend|middag|'s middags|'s avonds|'s ochtends)(?=\W|$)/i;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const targetDate = dayjs_1.default(context.refDate);
|
||
const component = context.createParsingComponents();
|
||
|
||
if (match[DAY_GROUP] === "deze") {
|
||
component.assign("day", context.refDate.getDate());
|
||
component.assign("month", context.refDate.getMonth() + 1);
|
||
component.assign("year", context.refDate.getFullYear());
|
||
}
|
||
|
||
switch (match[MOMENT_GROUP].toLowerCase()) {
|
||
case "namiddag":
|
||
case "'s namiddags":
|
||
component.imply("meridiem", index_1.Meridiem.PM);
|
||
component.imply("hour", 15);
|
||
break;
|
||
|
||
case "avond":
|
||
case "'s avonds'":
|
||
component.imply("meridiem", index_1.Meridiem.PM);
|
||
component.imply("hour", 20);
|
||
break;
|
||
|
||
case "middernacht":
|
||
dayjs_2.assignTheNextDay(component, targetDate);
|
||
component.imply("hour", 0);
|
||
component.imply("minute", 0);
|
||
component.imply("second", 0);
|
||
break;
|
||
|
||
case "ochtend":
|
||
case "'s ochtends":
|
||
component.imply("meridiem", index_1.Meridiem.AM);
|
||
component.imply("hour", 6);
|
||
break;
|
||
|
||
case "middag":
|
||
case "'s middags":
|
||
component.imply("meridiem", index_1.Meridiem.AM);
|
||
component.imply("hour", 12);
|
||
break;
|
||
}
|
||
|
||
return component;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = NLCasualTimeParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/nl/parsers/NLCasualYearMonthDayParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/nl/constants.js");
|
||
|
||
const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const PATTERN = new RegExp(`([0-9]{4})[\\.\\/\\s]` + `(?:(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]` + `([0-9]{1,2})` + "(?=\\W|$)", "i");
|
||
const YEAR_NUMBER_GROUP = 1;
|
||
const MONTH_NAME_GROUP = 2;
|
||
const MONTH_NUMBER_GROUP = 3;
|
||
const DATE_NUMBER_GROUP = 4;
|
||
|
||
class NLCasualYearMonthDayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern() {
|
||
return PATTERN;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const month = match[MONTH_NUMBER_GROUP] ? parseInt(match[MONTH_NUMBER_GROUP]) : constants_1.MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()];
|
||
|
||
if (month < 1 || month > 12) {
|
||
return null;
|
||
}
|
||
|
||
const year = parseInt(match[YEAR_NUMBER_GROUP]);
|
||
const day = parseInt(match[DATE_NUMBER_GROUP]);
|
||
return {
|
||
day: day,
|
||
month: month,
|
||
year: year
|
||
};
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = NLCasualYearMonthDayParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/nl/parsers/NLMonthNameMiddleEndianParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js");
|
||
|
||
const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/nl/constants.js");
|
||
|
||
const constants_2 = __webpack_require__("./node_modules/chrono-node/dist/locales/nl/constants.js");
|
||
|
||
const constants_3 = __webpack_require__("./node_modules/chrono-node/dist/locales/nl/constants.js");
|
||
|
||
const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const PATTERN = new RegExp("(?:on\\s*?)?" + `(${constants_2.ORDINAL_NUMBER_PATTERN})` + "(?:\\s*" + "(?:tot|\\-|\\–|until|through|till|\\s)\\s*" + `(${constants_2.ORDINAL_NUMBER_PATTERN})` + ")?" + "(?:-|/|\\s*(?:of)?\\s*)" + "(" + pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY) + ")" + "(?:" + "(?:-|/|,?\\s*)" + `(${constants_3.YEAR_PATTERN}(?![^\\s]\\d))` + ")?" + "(?=\\W|$)", "i");
|
||
const MONTH_NAME_GROUP = 3;
|
||
const DATE_GROUP = 1;
|
||
const DATE_TO_GROUP = 2;
|
||
const YEAR_GROUP = 4;
|
||
|
||
class NLMonthNameMiddleEndianParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern() {
|
||
return PATTERN;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const month = constants_1.MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()];
|
||
const day = constants_2.parseOrdinalNumberPattern(match[DATE_GROUP]);
|
||
|
||
if (day > 31) {
|
||
match.index = match.index + match[DATE_GROUP].length;
|
||
return null;
|
||
}
|
||
|
||
const components = context.createParsingComponents({
|
||
day: day,
|
||
month: month
|
||
});
|
||
|
||
if (match[YEAR_GROUP]) {
|
||
const year = constants_3.parseYear(match[YEAR_GROUP]);
|
||
components.assign("year", year);
|
||
} else {
|
||
const year = years_1.findYearClosestToRef(context.refDate, day, month);
|
||
components.imply("year", year);
|
||
}
|
||
|
||
if (!match[DATE_TO_GROUP]) {
|
||
return components;
|
||
}
|
||
|
||
const endDate = constants_2.parseOrdinalNumberPattern(match[DATE_TO_GROUP]);
|
||
const result = context.createParsingResult(match.index, match[0]);
|
||
result.start = components;
|
||
result.end = components.clone();
|
||
result.end.assign("day", endDate);
|
||
return result;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = NLMonthNameMiddleEndianParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/nl/parsers/NLMonthNameParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/nl/constants.js");
|
||
|
||
const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js");
|
||
|
||
const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js");
|
||
|
||
const constants_2 = __webpack_require__("./node_modules/chrono-node/dist/locales/nl/constants.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const PATTERN = new RegExp(`(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})` + `\\s*` + `(?:` + `[,-]?\\s*(${constants_2.YEAR_PATTERN})?` + ")?" + "(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)", "i");
|
||
const MONTH_NAME_GROUP = 1;
|
||
const YEAR_GROUP = 2;
|
||
|
||
class NLMonthNameParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern() {
|
||
return PATTERN;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const components = context.createParsingComponents();
|
||
components.imply("day", 1);
|
||
const monthName = match[MONTH_NAME_GROUP];
|
||
const month = constants_1.MONTH_DICTIONARY[monthName.toLowerCase()];
|
||
components.assign("month", month);
|
||
|
||
if (match[YEAR_GROUP]) {
|
||
const year = constants_2.parseYear(match[YEAR_GROUP]);
|
||
components.assign("year", year);
|
||
} else {
|
||
const year = years_1.findYearClosestToRef(context.refDate, 1, month);
|
||
components.imply("year", year);
|
||
}
|
||
|
||
return components;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = NLMonthNameParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/nl/parsers/NLSlashMonthFormatParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const PATTERN = new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})" + "", "i");
|
||
const MONTH_GROUP = 1;
|
||
const YEAR_GROUP = 2;
|
||
|
||
class NLSlashMonthFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern() {
|
||
return PATTERN;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const year = parseInt(match[YEAR_GROUP]);
|
||
const month = parseInt(match[MONTH_GROUP]);
|
||
return context.createParsingComponents().imply("day", 1).assign("month", month).assign("year", year);
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = NLSlashMonthFormatParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/nl/parsers/NLTimeExpressionParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const AbstractTimeExpressionParser_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractTimeExpressionParser.js");
|
||
|
||
class NLTimeExpressionParser extends AbstractTimeExpressionParser_1.AbstractTimeExpressionParser {
|
||
primaryPrefix() {
|
||
return "(?:(?:om)\\s*)?";
|
||
}
|
||
|
||
followingPhase() {
|
||
return "\\s*(?:\\-|\\–|\\~|\\〜|om|\\?)\\s*";
|
||
}
|
||
|
||
extractPrimaryTimeComponents(context, match) {
|
||
if (match[0].match(/^\s*\d{4}\s*$/)) {
|
||
return null;
|
||
}
|
||
|
||
return super.extractPrimaryTimeComponents(context, match);
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = NLTimeExpressionParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/nl/parsers/NLTimeUnitWithinFormatParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/nl/constants.js");
|
||
|
||
const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
class NLTimeUnitWithinFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern() {
|
||
return new RegExp(`(?:binnen|in|binnen de|voor)\\s*` + "(" + constants_1.TIME_UNITS_PATTERN + ")" + `(?=\\W|$)`, "i");
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const timeUnits = constants_1.parseTimeUnits(match[1]);
|
||
return results_1.ParsingComponents.createRelativeFromRefInstant(context.refDate, timeUnits);
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = NLTimeUnitWithinFormatParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/nl/parsers/NLWeekdayParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/nl/constants.js");
|
||
|
||
const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const weeks_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/weeks.js");
|
||
|
||
const PATTERN = new RegExp("(?:(?:\\,|\\(|\\()\\s*)?" + "(?:op\\s*?)?" + "(?:(deze|vorige|volgende)\\s*(?:week\\s*)?)?" + `(${pattern_1.matchAnyPattern(constants_1.WEEKDAY_DICTIONARY)})` + "(?=\\W|$)", "i");
|
||
const PREFIX_GROUP = 1;
|
||
const WEEKDAY_GROUP = 2;
|
||
const POSTFIX_GROUP = 3;
|
||
|
||
class NLWeekdayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern() {
|
||
return PATTERN;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();
|
||
const offset = constants_1.WEEKDAY_DICTIONARY[dayOfWeek];
|
||
const prefix = match[PREFIX_GROUP];
|
||
const postfix = match[POSTFIX_GROUP];
|
||
let modifierWord = prefix || postfix;
|
||
modifierWord = modifierWord || "";
|
||
modifierWord = modifierWord.toLowerCase();
|
||
let modifier = null;
|
||
|
||
if (modifierWord == "vorige") {
|
||
modifier = "last";
|
||
} else if (modifierWord == "volgende") {
|
||
modifier = "next";
|
||
} else if (modifierWord == "deze") {
|
||
modifier = "this";
|
||
}
|
||
|
||
const date = weeks_1.toDayJSWeekday(context.refDate, offset, modifier);
|
||
return context.createParsingComponents().assign("weekday", offset).imply("day", date.date()).imply("month", date.month() + 1).imply("year", date.year());
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = NLWeekdayParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/nl/refiners/NLMergeDateRangeRefiner.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const AbstractMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateRangeRefiner.js"));
|
||
|
||
class NLMergeDateRangeRefiner extends AbstractMergeDateRangeRefiner_1.default {
|
||
patternBetween() {
|
||
return /^\s*(tot|-)\s*$/i;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = NLMergeDateRangeRefiner;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/nl/refiners/NLMergeDateTimeRefiner.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const AbstractMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateTimeRefiner.js"));
|
||
|
||
class NLMergeDateTimeRefiner extends AbstractMergeDateTimeRefiner_1.default {
|
||
patternBetween() {
|
||
return new RegExp("^\\s*(om|na|voor|in de|,|-)?\\s*$");
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = NLMergeDateTimeRefiner;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/pt/constants.js":
|
||
/***/ (function(__unused_webpack_module, exports) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.parseYear = exports.YEAR_PATTERN = exports.MONTH_DICTIONARY = exports.WEEKDAY_DICTIONARY = void 0;
|
||
exports.WEEKDAY_DICTIONARY = {
|
||
"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
|
||
};
|
||
exports.MONTH_DICTIONARY = {
|
||
"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
|
||
};
|
||
exports.YEAR_PATTERN = "[0-9]{1,4}(?![^\\s]\\d)(?:\\s*[a|d]\\.?\\s*c\\.?|\\s*a\\.?\\s*d\\.?)?";
|
||
|
||
function parseYear(match) {
|
||
if (match.match(/^[0-9]{1,4}$/)) {
|
||
let yearNumber = parseInt(match);
|
||
|
||
if (yearNumber < 100) {
|
||
if (yearNumber > 50) {
|
||
yearNumber = yearNumber + 1900;
|
||
} else {
|
||
yearNumber = yearNumber + 2000;
|
||
}
|
||
}
|
||
|
||
return yearNumber;
|
||
}
|
||
|
||
if (match.match(/a\.?\s*c\.?/i)) {
|
||
match = match.replace(/a\.?\s*c\.?/i, "");
|
||
return -parseInt(match);
|
||
}
|
||
|
||
return parseInt(match);
|
||
}
|
||
|
||
exports.parseYear = parseYear;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/pt/index.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.createConfiguration = exports.createCasualConfiguration = exports.parseDate = exports.parse = exports.strict = exports.casual = void 0;
|
||
|
||
const configurations_1 = __webpack_require__("./node_modules/chrono-node/dist/configurations.js");
|
||
|
||
const chrono_1 = __webpack_require__("./node_modules/chrono-node/dist/chrono.js");
|
||
|
||
const SlashDateFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/parsers/SlashDateFormatParser.js"));
|
||
|
||
const PTWeekdayParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/pt/parsers/PTWeekdayParser.js"));
|
||
|
||
const PTTimeExpressionParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/pt/parsers/PTTimeExpressionParser.js"));
|
||
|
||
const PTMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/pt/refiners/PTMergeDateTimeRefiner.js"));
|
||
|
||
const PTMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/pt/refiners/PTMergeDateRangeRefiner.js"));
|
||
|
||
const PTMonthNameLittleEndianParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/pt/parsers/PTMonthNameLittleEndianParser.js"));
|
||
|
||
const PTCasualDateParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/pt/parsers/PTCasualDateParser.js"));
|
||
|
||
const PTCasualTimeParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/pt/parsers/PTCasualTimeParser.js"));
|
||
|
||
exports.casual = new chrono_1.Chrono(createCasualConfiguration());
|
||
exports.strict = new chrono_1.Chrono(createConfiguration(true));
|
||
|
||
function parse(text, ref, option) {
|
||
return exports.casual.parse(text, ref, option);
|
||
}
|
||
|
||
exports.parse = parse;
|
||
|
||
function parseDate(text, ref, option) {
|
||
return exports.casual.parseDate(text, ref, option);
|
||
}
|
||
|
||
exports.parseDate = parseDate;
|
||
|
||
function createCasualConfiguration(littleEndian = true) {
|
||
const option = createConfiguration(false, littleEndian);
|
||
option.parsers.push(new PTCasualDateParser_1.default());
|
||
option.parsers.push(new PTCasualTimeParser_1.default());
|
||
return option;
|
||
}
|
||
|
||
exports.createCasualConfiguration = createCasualConfiguration;
|
||
|
||
function createConfiguration(strictMode = true, littleEndian = true) {
|
||
return configurations_1.includeCommonConfiguration({
|
||
parsers: [new SlashDateFormatParser_1.default(littleEndian), new PTWeekdayParser_1.default(), new PTTimeExpressionParser_1.default(), new PTMonthNameLittleEndianParser_1.default()],
|
||
refiners: [new PTMergeDateTimeRefiner_1.default(), new PTMergeDateRangeRefiner_1.default()]
|
||
}, strictMode);
|
||
}
|
||
|
||
exports.createConfiguration = createConfiguration;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/pt/parsers/PTCasualDateParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
||
if (k2 === undefined) k2 = k;
|
||
Object.defineProperty(o, k2, {
|
||
enumerable: true,
|
||
get: function () {
|
||
return m[k];
|
||
}
|
||
});
|
||
} : function (o, m, k, k2) {
|
||
if (k2 === undefined) k2 = k;
|
||
o[k2] = m[k];
|
||
});
|
||
|
||
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
|
||
Object.defineProperty(o, "default", {
|
||
enumerable: true,
|
||
value: v
|
||
});
|
||
} : function (o, v) {
|
||
o["default"] = v;
|
||
});
|
||
|
||
var __importStar = this && this.__importStar || function (mod) {
|
||
if (mod && mod.__esModule) return mod;
|
||
var result = {};
|
||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||
|
||
__setModuleDefault(result, mod);
|
||
|
||
return result;
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const references = __importStar(__webpack_require__("./node_modules/chrono-node/dist/common/casualReferences.js"));
|
||
|
||
class PTCasualDateParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern(context) {
|
||
return /(agora|hoje|amanha|amanhã|ontem)(?=\W|$)/i;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const lowerText = match[0].toLowerCase();
|
||
const component = context.createParsingComponents();
|
||
|
||
switch (lowerText) {
|
||
case "agora":
|
||
return references.now(context.reference);
|
||
|
||
case "hoje":
|
||
return references.today(context.reference);
|
||
|
||
case "amanha":
|
||
case "amanhã":
|
||
return references.tomorrow(context.reference);
|
||
|
||
case "ontem":
|
||
return references.yesterday(context.reference);
|
||
}
|
||
|
||
return component;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = PTCasualDateParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/pt/parsers/PTCasualTimeParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const dayjs_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/dayjs.js");
|
||
|
||
const dayjs_2 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js"));
|
||
|
||
class PTCasualTimeParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern() {
|
||
return /(?:esta\s*)?(manha|manhã|tarde|meia-noite|meio-dia|noite)(?=\W|$)/i;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const targetDate = dayjs_2.default(context.refDate);
|
||
const component = context.createParsingComponents();
|
||
|
||
switch (match[1].toLowerCase()) {
|
||
case "tarde":
|
||
component.imply("meridiem", index_1.Meridiem.PM);
|
||
component.imply("hour", 15);
|
||
break;
|
||
|
||
case "noite":
|
||
component.imply("meridiem", index_1.Meridiem.PM);
|
||
component.imply("hour", 22);
|
||
break;
|
||
|
||
case "manha":
|
||
case "manhã":
|
||
component.imply("meridiem", index_1.Meridiem.AM);
|
||
component.imply("hour", 6);
|
||
break;
|
||
|
||
case "meia-noite":
|
||
dayjs_1.assignTheNextDay(component, targetDate);
|
||
component.imply("hour", 0);
|
||
component.imply("minute", 0);
|
||
component.imply("second", 0);
|
||
break;
|
||
|
||
case "meio-dia":
|
||
component.imply("meridiem", index_1.Meridiem.AM);
|
||
component.imply("hour", 12);
|
||
break;
|
||
}
|
||
|
||
return component;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = PTCasualTimeParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/pt/parsers/PTMonthNameLittleEndianParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js");
|
||
|
||
const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/pt/constants.js");
|
||
|
||
const constants_2 = __webpack_require__("./node_modules/chrono-node/dist/locales/pt/constants.js");
|
||
|
||
const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const PATTERN = new RegExp(`([0-9]{1,2})(?:º|ª|°)?` + "(?:\\s*(?:desde|de|\\-|\\–|ao?|\\s)\\s*([0-9]{1,2})(?:º|ª|°)?)?\\s*(?:de)?\\s*" + `(?:-|/|\\s*(?:de|,)?\\s*)` + `(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})` + `(?:\\s*(?:de|,)?\\s*(${constants_2.YEAR_PATTERN}))?` + `(?=\\W|$)`, "i");
|
||
const DATE_GROUP = 1;
|
||
const DATE_TO_GROUP = 2;
|
||
const MONTH_NAME_GROUP = 3;
|
||
const YEAR_GROUP = 4;
|
||
|
||
class PTMonthNameLittleEndianParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern() {
|
||
return PATTERN;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const result = context.createParsingResult(match.index, match[0]);
|
||
const month = constants_1.MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()];
|
||
const day = parseInt(match[DATE_GROUP]);
|
||
|
||
if (day > 31) {
|
||
match.index = match.index + match[DATE_GROUP].length;
|
||
return null;
|
||
}
|
||
|
||
result.start.assign("month", month);
|
||
result.start.assign("day", day);
|
||
|
||
if (match[YEAR_GROUP]) {
|
||
const yearNumber = constants_2.parseYear(match[YEAR_GROUP]);
|
||
result.start.assign("year", yearNumber);
|
||
} else {
|
||
const year = years_1.findYearClosestToRef(context.refDate, day, month);
|
||
result.start.imply("year", year);
|
||
}
|
||
|
||
if (match[DATE_TO_GROUP]) {
|
||
const endDate = parseInt(match[DATE_TO_GROUP]);
|
||
result.end = result.start.clone();
|
||
result.end.assign("day", endDate);
|
||
}
|
||
|
||
return result;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = PTMonthNameLittleEndianParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/pt/parsers/PTTimeExpressionParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const AbstractTimeExpressionParser_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractTimeExpressionParser.js");
|
||
|
||
class PTTimeExpressionParser extends AbstractTimeExpressionParser_1.AbstractTimeExpressionParser {
|
||
primaryPrefix() {
|
||
return "(?:(?:ao?|às?|das|da|de|do)\\s*)?";
|
||
}
|
||
|
||
followingPhase() {
|
||
return "\\s*(?:\\-|\\–|\\~|\\〜|a(?:o)?|\\?)\\s*";
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = PTTimeExpressionParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/pt/parsers/PTWeekdayParser.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/pt/constants.js");
|
||
|
||
const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js");
|
||
|
||
const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js");
|
||
|
||
const weeks_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/weeks.js");
|
||
|
||
const PATTERN = new RegExp("(?:(?:\\,|\\(|\\()\\s*)?" + "(?:(este|esta|passado|pr[oó]ximo)\\s*)?" + `(${pattern_1.matchAnyPattern(constants_1.WEEKDAY_DICTIONARY)})` + "(?:\\s*(?:\\,|\\)|\\)))?" + "(?:\\s*(este|esta|passado|pr[óo]ximo)\\s*semana)?" + "(?=\\W|\\d|$)", "i");
|
||
const PREFIX_GROUP = 1;
|
||
const WEEKDAY_GROUP = 2;
|
||
const POSTFIX_GROUP = 3;
|
||
|
||
class PTWeekdayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking {
|
||
innerPattern() {
|
||
return PATTERN;
|
||
}
|
||
|
||
innerExtract(context, match) {
|
||
const dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();
|
||
const offset = constants_1.WEEKDAY_DICTIONARY[dayOfWeek];
|
||
|
||
if (offset === undefined) {
|
||
return null;
|
||
}
|
||
|
||
const prefix = match[PREFIX_GROUP];
|
||
const postfix = match[POSTFIX_GROUP];
|
||
let norm = prefix || postfix || "";
|
||
norm = norm.toLowerCase();
|
||
let modifier = null;
|
||
|
||
if (norm == "passado") {
|
||
modifier = "this";
|
||
} else if (norm == "próximo" || norm == "proximo") {
|
||
modifier = "next";
|
||
} else if (norm == "este") {
|
||
modifier = "this";
|
||
}
|
||
|
||
const date = weeks_1.toDayJSWeekday(context.refDate, offset, modifier);
|
||
return context.createParsingComponents().assign("weekday", offset).imply("day", date.date()).imply("month", date.month() + 1).imply("year", date.year());
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = PTWeekdayParser;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/pt/refiners/PTMergeDateRangeRefiner.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const AbstractMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateRangeRefiner.js"));
|
||
|
||
class PTMergeDateRangeRefiner extends AbstractMergeDateRangeRefiner_1.default {
|
||
patternBetween() {
|
||
return /^\s*(?:-)\s*$/i;
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = PTMergeDateRangeRefiner;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/locales/pt/refiners/PTMergeDateTimeRefiner.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
|
||
const AbstractMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateTimeRefiner.js"));
|
||
|
||
class PTMergeDateTimeRefiner extends AbstractMergeDateTimeRefiner_1.default {
|
||
patternBetween() {
|
||
return new RegExp("^\\s*(?:,|à)?\\s*$");
|
||
}
|
||
|
||
}
|
||
|
||
exports.default = PTMergeDateTimeRefiner;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/results.js":
|
||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var __importDefault = this && this.__importDefault || function (mod) {
|
||
return mod && mod.__esModule ? mod : {
|
||
"default": mod
|
||
};
|
||
};
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.ParsingResult = exports.ParsingComponents = exports.ReferenceWithTimezone = void 0;
|
||
|
||
const quarterOfYear_1 = __importDefault(__webpack_require__("./node_modules/dayjs/plugin/quarterOfYear.js"));
|
||
|
||
const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js"));
|
||
|
||
const dayjs_2 = __webpack_require__("./node_modules/chrono-node/dist/utils/dayjs.js");
|
||
|
||
const timezone_1 = __webpack_require__("./node_modules/chrono-node/dist/timezone.js");
|
||
|
||
dayjs_1.default.extend(quarterOfYear_1.default);
|
||
|
||
class ReferenceWithTimezone {
|
||
constructor(input) {
|
||
var _a, _b;
|
||
|
||
input = input !== null && input !== void 0 ? input : new Date();
|
||
|
||
if (input instanceof Date) {
|
||
this.instant = input;
|
||
this.timezoneOffset = -input.getTimezoneOffset();
|
||
} else {
|
||
this.instant = (_a = input.instant) !== null && _a !== void 0 ? _a : new Date();
|
||
this.timezoneOffset = timezone_1.toTimezoneOffset((_b = input.timezone) !== null && _b !== void 0 ? _b : -this.instant.getTimezoneOffset());
|
||
}
|
||
}
|
||
|
||
}
|
||
|
||
exports.ReferenceWithTimezone = ReferenceWithTimezone;
|
||
|
||
class ParsingComponents {
|
||
constructor(reference, knownComponents) {
|
||
this.reference = reference;
|
||
this.knownValues = {};
|
||
this.impliedValues = {};
|
||
|
||
if (knownComponents) {
|
||
for (const key in knownComponents) {
|
||
this.knownValues[key] = knownComponents[key];
|
||
}
|
||
}
|
||
|
||
const refDayJs = dayjs_1.default(reference.instant);
|
||
this.imply("day", refDayJs.date());
|
||
this.imply("month", refDayJs.month() + 1);
|
||
this.imply("year", refDayJs.year());
|
||
this.imply("hour", 12);
|
||
this.imply("minute", 0);
|
||
this.imply("second", 0);
|
||
this.imply("millisecond", 0);
|
||
}
|
||
|
||
get(component) {
|
||
if (component in this.knownValues) {
|
||
return this.knownValues[component];
|
||
}
|
||
|
||
if (component in this.impliedValues) {
|
||
return this.impliedValues[component];
|
||
}
|
||
|
||
return null;
|
||
}
|
||
|
||
isCertain(component) {
|
||
return component in this.knownValues;
|
||
}
|
||
|
||
getCertainComponents() {
|
||
return Object.keys(this.knownValues);
|
||
}
|
||
|
||
imply(component, value) {
|
||
if (component in this.knownValues) {
|
||
return this;
|
||
}
|
||
|
||
this.impliedValues[component] = value;
|
||
return this;
|
||
}
|
||
|
||
assign(component, value) {
|
||
this.knownValues[component] = value;
|
||
delete this.impliedValues[component];
|
||
return this;
|
||
}
|
||
|
||
delete(component) {
|
||
delete this.knownValues[component];
|
||
delete this.impliedValues[component];
|
||
}
|
||
|
||
clone() {
|
||
const component = new ParsingComponents(this.reference);
|
||
component.knownValues = {};
|
||
component.impliedValues = {};
|
||
|
||
for (const key in this.knownValues) {
|
||
component.knownValues[key] = this.knownValues[key];
|
||
}
|
||
|
||
for (const key in this.impliedValues) {
|
||
component.impliedValues[key] = this.impliedValues[key];
|
||
}
|
||
|
||
return component;
|
||
}
|
||
|
||
isOnlyDate() {
|
||
return !this.isCertain("hour") && !this.isCertain("minute") && !this.isCertain("second");
|
||
}
|
||
|
||
isOnlyTime() {
|
||
return !this.isCertain("weekday") && !this.isCertain("day") && !this.isCertain("month");
|
||
}
|
||
|
||
isOnlyWeekdayComponent() {
|
||
return this.isCertain("weekday") && !this.isCertain("day") && !this.isCertain("month");
|
||
}
|
||
|
||
isOnlyDayMonthComponent() {
|
||
return this.isCertain("day") && this.isCertain("month") && !this.isCertain("year");
|
||
}
|
||
|
||
isValidDate() {
|
||
const date = this.dateWithoutTimezoneAdjustment();
|
||
if (date.getFullYear() !== this.get("year")) return false;
|
||
if (date.getMonth() !== this.get("month") - 1) return false;
|
||
if (date.getDate() !== this.get("day")) return false;
|
||
if (this.get("hour") != null && date.getHours() != this.get("hour")) return false;
|
||
if (this.get("minute") != null && date.getMinutes() != this.get("minute")) return false;
|
||
return true;
|
||
}
|
||
|
||
toString() {
|
||
return `[ParsingComponents {knownValues: ${JSON.stringify(this.knownValues)}, impliedValues: ${JSON.stringify(this.impliedValues)}}]`;
|
||
}
|
||
|
||
dayjs() {
|
||
return dayjs_1.default(this.date());
|
||
}
|
||
|
||
date() {
|
||
const date = this.dateWithoutTimezoneAdjustment();
|
||
return new Date(date.getTime() + this.getSystemTimezoneAdjustmentMinute() * 60000);
|
||
}
|
||
|
||
dateWithoutTimezoneAdjustment() {
|
||
const date = new Date(this.get("year"), this.get("month") - 1, this.get("day"), this.get("hour"), this.get("minute"), this.get("second"), this.get("millisecond"));
|
||
date.setFullYear(this.get("year"));
|
||
return date;
|
||
}
|
||
|
||
getSystemTimezoneAdjustmentMinute() {
|
||
var _a;
|
||
|
||
const currentTimezoneOffset = -new Date().getTimezoneOffset();
|
||
const targetTimezoneOffset = (_a = this.get("timezoneOffset")) !== null && _a !== void 0 ? _a : this.reference.timezoneOffset;
|
||
return currentTimezoneOffset - targetTimezoneOffset;
|
||
}
|
||
|
||
static createRelativeFromRefInstant(refInstant, fragments) {
|
||
let date = dayjs_1.default(refInstant);
|
||
|
||
for (const key in fragments) {
|
||
date = date.add(fragments[key], key);
|
||
}
|
||
|
||
const reference = new ReferenceWithTimezone(refInstant);
|
||
const components = new ParsingComponents(reference);
|
||
|
||
if (fragments["hour"] || fragments["minute"] || fragments["second"]) {
|
||
dayjs_2.assignSimilarTime(components, date);
|
||
dayjs_2.assignSimilarDate(components, date);
|
||
components.assign("timezoneOffset", -refInstant.getTimezoneOffset());
|
||
} else {
|
||
dayjs_2.implySimilarTime(components, date);
|
||
components.imply("timezoneOffset", -refInstant.getTimezoneOffset());
|
||
|
||
if (fragments["d"]) {
|
||
components.assign("day", date.date());
|
||
components.assign("month", date.month() + 1);
|
||
components.assign("year", date.year());
|
||
} else {
|
||
if (fragments["week"]) {
|
||
components.imply("weekday", date.day());
|
||
}
|
||
|
||
components.imply("day", date.date());
|
||
|
||
if (fragments["month"]) {
|
||
components.assign("month", date.month() + 1);
|
||
components.assign("year", date.year());
|
||
} else {
|
||
components.imply("month", date.month() + 1);
|
||
|
||
if (fragments["year"]) {
|
||
components.assign("year", date.year());
|
||
} else {
|
||
components.imply("year", date.year());
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
return components;
|
||
}
|
||
|
||
}
|
||
|
||
exports.ParsingComponents = ParsingComponents;
|
||
|
||
class ParsingResult {
|
||
constructor(reference, index, text, start, end) {
|
||
this.reference = reference;
|
||
this.refDate = reference.instant;
|
||
this.index = index;
|
||
this.text = text;
|
||
this.start = start || new ParsingComponents(reference);
|
||
this.end = end;
|
||
}
|
||
|
||
clone() {
|
||
const result = new ParsingResult(this.reference, this.index, this.text);
|
||
result.start = this.start ? this.start.clone() : null;
|
||
result.end = this.end ? this.end.clone() : null;
|
||
return result;
|
||
}
|
||
|
||
date() {
|
||
return this.start.date();
|
||
}
|
||
|
||
toString() {
|
||
return `[ParsingResult {index: ${this.index}, text: '${this.text}', ...}]`;
|
||
}
|
||
|
||
}
|
||
|
||
exports.ParsingResult = ParsingResult;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/timezone.js":
|
||
/***/ (function(__unused_webpack_module, exports) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.toTimezoneOffset = exports.TIMEZONE_ABBR_MAP = void 0;
|
||
exports.TIMEZONE_ABBR_MAP = {
|
||
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
|
||
};
|
||
|
||
function toTimezoneOffset(timezoneInput) {
|
||
var _a;
|
||
|
||
if (typeof timezoneInput === "number") {
|
||
return timezoneInput;
|
||
}
|
||
|
||
return (_a = exports.TIMEZONE_ABBR_MAP[timezoneInput]) !== null && _a !== void 0 ? _a : 0;
|
||
}
|
||
|
||
exports.toTimezoneOffset = toTimezoneOffset;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/utils/dayjs.js":
|
||
/***/ (function(__unused_webpack_module, exports) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.implySimilarTime = exports.assignSimilarTime = exports.assignSimilarDate = exports.assignTheNextDay = void 0;
|
||
|
||
function assignTheNextDay(component, targetDayJs) {
|
||
targetDayJs = targetDayJs.add(1, "day");
|
||
assignSimilarDate(component, targetDayJs);
|
||
implySimilarTime(component, targetDayJs);
|
||
}
|
||
|
||
exports.assignTheNextDay = assignTheNextDay;
|
||
|
||
function assignSimilarDate(component, targetDayJs) {
|
||
component.assign("day", targetDayJs.date());
|
||
component.assign("month", targetDayJs.month() + 1);
|
||
component.assign("year", targetDayJs.year());
|
||
}
|
||
|
||
exports.assignSimilarDate = assignSimilarDate;
|
||
|
||
function assignSimilarTime(component, targetDayJs) {
|
||
component.assign("hour", targetDayJs.hour());
|
||
component.assign("minute", targetDayJs.minute());
|
||
component.assign("second", targetDayJs.second());
|
||
component.assign("millisecond", targetDayJs.millisecond());
|
||
}
|
||
|
||
exports.assignSimilarTime = assignSimilarTime;
|
||
|
||
function implySimilarTime(component, targetDayJs) {
|
||
component.imply("hour", targetDayJs.hour());
|
||
component.imply("minute", targetDayJs.minute());
|
||
component.imply("second", targetDayJs.second());
|
||
component.imply("millisecond", targetDayJs.millisecond());
|
||
}
|
||
|
||
exports.implySimilarTime = implySimilarTime;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/utils/pattern.js":
|
||
/***/ (function(__unused_webpack_module, exports) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.matchAnyPattern = exports.extractTerms = exports.repeatedTimeunitPattern = void 0;
|
||
|
||
function repeatedTimeunitPattern(prefix, singleTimeunitPattern) {
|
||
const singleTimeunitPatternNoCapture = singleTimeunitPattern.replace(/\((?!\?)/g, "(?:");
|
||
return `${prefix}${singleTimeunitPatternNoCapture}\\s*(?:,?\\s{0,5}${singleTimeunitPatternNoCapture}){0,10}`;
|
||
}
|
||
|
||
exports.repeatedTimeunitPattern = repeatedTimeunitPattern;
|
||
|
||
function extractTerms(dictionary) {
|
||
let keys;
|
||
|
||
if (dictionary instanceof Array) {
|
||
keys = [...dictionary];
|
||
} else if (dictionary instanceof Map) {
|
||
keys = Array.from(dictionary.keys());
|
||
} else {
|
||
keys = Object.keys(dictionary);
|
||
}
|
||
|
||
return keys;
|
||
}
|
||
|
||
exports.extractTerms = extractTerms;
|
||
|
||
function matchAnyPattern(dictionary) {
|
||
const joinedTerms = extractTerms(dictionary).sort((a, b) => b.length - a.length).join("|").replace(/\./g, "\\.");
|
||
return `(?:${joinedTerms})`;
|
||
}
|
||
|
||
exports.matchAnyPattern = matchAnyPattern;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/chrono-node/dist/utils/timeunits.js":
|
||
/***/ (function(__unused_webpack_module, exports) {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.addImpliedTimeUnits = exports.reverseTimeUnits = void 0;
|
||
|
||
function reverseTimeUnits(timeUnits) {
|
||
const reversed = {};
|
||
|
||
for (const key in timeUnits) {
|
||
reversed[key] = -timeUnits[key];
|
||
}
|
||
|
||
return reversed;
|
||
}
|
||
|
||
exports.reverseTimeUnits = reverseTimeUnits;
|
||
|
||
function addImpliedTimeUnits(components, timeUnits) {
|
||
const output = components.clone();
|
||
let date = components.dayjs();
|
||
|
||
for (const key in timeUnits) {
|
||
date = date.add(timeUnits[key], key);
|
||
}
|
||
|
||
if ("day" in timeUnits || "d" in timeUnits || "week" in timeUnits || "month" in timeUnits || "year" in timeUnits) {
|
||
output.imply("day", date.date());
|
||
output.imply("month", date.month() + 1);
|
||
output.imply("year", date.year());
|
||
}
|
||
|
||
if ("second" in timeUnits || "minute" in timeUnits || "hour" in timeUnits) {
|
||
output.imply("second", date.second());
|
||
output.imply("minute", date.minute());
|
||
output.imply("hour", date.hour());
|
||
}
|
||
|
||
return output;
|
||
}
|
||
|
||
exports.addImpliedTimeUnits = addImpliedTimeUnits;
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/css-loader/dist/runtime/api.js":
|
||
/***/ (function(module) {
|
||
|
||
"use strict";
|
||
|
||
/*
|
||
MIT License http://www.opensource.org/licenses/mit-license.php
|
||
Author Tobias Koppers @sokra
|
||
*/
|
||
// css base code, injected by the css-loader
|
||
// eslint-disable-next-line func-names
|
||
|
||
module.exports = function (cssWithMappingToString) {
|
||
var list = []; // return the list of modules as css string
|
||
|
||
list.toString = function toString() {
|
||
return this.map(function (item) {
|
||
var content = cssWithMappingToString(item);
|
||
|
||
if (item[2]) {
|
||
return "@media ".concat(item[2], " {").concat(content, "}");
|
||
}
|
||
|
||
return content;
|
||
}).join("");
|
||
}; // import a list of modules into the list
|
||
// eslint-disable-next-line func-names
|
||
|
||
|
||
list.i = function (modules, mediaQuery, dedupe) {
|
||
if (typeof modules === "string") {
|
||
// eslint-disable-next-line no-param-reassign
|
||
modules = [[null, modules, ""]];
|
||
}
|
||
|
||
var alreadyImportedModules = {};
|
||
|
||
if (dedupe) {
|
||
for (var i = 0; i < this.length; i++) {
|
||
// eslint-disable-next-line prefer-destructuring
|
||
var id = this[i][0];
|
||
|
||
if (id != null) {
|
||
alreadyImportedModules[id] = true;
|
||
}
|
||
}
|
||
}
|
||
|
||
for (var _i = 0; _i < modules.length; _i++) {
|
||
var item = [].concat(modules[_i]);
|
||
|
||
if (dedupe && alreadyImportedModules[item[0]]) {
|
||
// eslint-disable-next-line no-continue
|
||
continue;
|
||
}
|
||
|
||
if (mediaQuery) {
|
||
if (!item[2]) {
|
||
item[2] = mediaQuery;
|
||
} else {
|
||
item[2] = "".concat(mediaQuery, " and ").concat(item[2]);
|
||
}
|
||
}
|
||
|
||
list.push(item);
|
||
}
|
||
};
|
||
|
||
return list;
|
||
};
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/dayjs/dayjs.min.js":
|
||
/***/ (function(module) {
|
||
|
||
!function (t, e) {
|
||
true ? module.exports = e() : 0;
|
||
}(this, function () {
|
||
"use strict";
|
||
|
||
var t = 1e3,
|
||
e = 6e4,
|
||
n = 36e5,
|
||
r = "millisecond",
|
||
i = "second",
|
||
s = "minute",
|
||
u = "hour",
|
||
a = "day",
|
||
o = "week",
|
||
f = "month",
|
||
h = "quarter",
|
||
c = "year",
|
||
d = "date",
|
||
$ = "Invalid Date",
|
||
l = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,
|
||
y = /\[([^\]]+)]|Y{1,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,
|
||
M = {
|
||
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("_")
|
||
},
|
||
m = function (t, e, n) {
|
||
var r = String(t);
|
||
return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t;
|
||
},
|
||
g = {
|
||
s: m,
|
||
z: function (t) {
|
||
var e = -t.utcOffset(),
|
||
n = Math.abs(e),
|
||
r = Math.floor(n / 60),
|
||
i = n % 60;
|
||
return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0");
|
||
},
|
||
m: function t(e, n) {
|
||
if (e.date() < n.date()) return -t(n, e);
|
||
var r = 12 * (n.year() - e.year()) + (n.month() - e.month()),
|
||
i = e.clone().add(r, f),
|
||
s = n - i < 0,
|
||
u = e.clone().add(r + (s ? -1 : 1), f);
|
||
return +(-(r + (n - i) / (s ? i - u : u - i)) || 0);
|
||
},
|
||
a: function (t) {
|
||
return t < 0 ? Math.ceil(t) || 0 : Math.floor(t);
|
||
},
|
||
p: function (t) {
|
||
return {
|
||
M: f,
|
||
y: c,
|
||
w: o,
|
||
d: a,
|
||
D: d,
|
||
h: u,
|
||
m: s,
|
||
s: i,
|
||
ms: r,
|
||
Q: h
|
||
}[t] || String(t || "").toLowerCase().replace(/s$/, "");
|
||
},
|
||
u: function (t) {
|
||
return void 0 === t;
|
||
}
|
||
},
|
||
D = "en",
|
||
v = {};
|
||
|
||
v[D] = M;
|
||
|
||
var p = function (t) {
|
||
return t instanceof _;
|
||
},
|
||
S = function (t, e, n) {
|
||
var r;
|
||
if (!t) return D;
|
||
if ("string" == typeof t) v[t] && (r = t), e && (v[t] = e, r = t);else {
|
||
var i = t.name;
|
||
v[i] = t, r = i;
|
||
}
|
||
return !n && r && (D = r), r || !n && D;
|
||
},
|
||
w = function (t, e) {
|
||
if (p(t)) return t.clone();
|
||
var n = "object" == typeof e ? e : {};
|
||
return n.date = t, n.args = arguments, new _(n);
|
||
},
|
||
O = g;
|
||
|
||
O.l = S, O.i = p, O.w = function (t, e) {
|
||
return w(t, {
|
||
locale: e.$L,
|
||
utc: e.$u,
|
||
x: e.$x,
|
||
$offset: e.$offset
|
||
});
|
||
};
|
||
|
||
var _ = function () {
|
||
function M(t) {
|
||
this.$L = S(t.locale, null, !0), this.parse(t);
|
||
}
|
||
|
||
var m = M.prototype;
|
||
return m.parse = function (t) {
|
||
this.$d = function (t) {
|
||
var e = t.date,
|
||
n = t.utc;
|
||
if (null === e) return new Date(NaN);
|
||
if (O.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(l);
|
||
|
||
if (r) {
|
||
var i = r[2] - 1 || 0,
|
||
s = (r[7] || "0").substring(0, 3);
|
||
return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s);
|
||
}
|
||
}
|
||
|
||
return new Date(e);
|
||
}(t), this.$x = t.x || {}, this.init();
|
||
}, m.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();
|
||
}, m.$utils = function () {
|
||
return O;
|
||
}, m.isValid = function () {
|
||
return !(this.$d.toString() === $);
|
||
}, m.isSame = function (t, e) {
|
||
var n = w(t);
|
||
return this.startOf(e) <= n && n <= this.endOf(e);
|
||
}, m.isAfter = function (t, e) {
|
||
return w(t) < this.startOf(e);
|
||
}, m.isBefore = function (t, e) {
|
||
return this.endOf(e) < w(t);
|
||
}, m.$g = function (t, e, n) {
|
||
return O.u(t) ? this[e] : this.set(n, t);
|
||
}, m.unix = function () {
|
||
return Math.floor(this.valueOf() / 1e3);
|
||
}, m.valueOf = function () {
|
||
return this.$d.getTime();
|
||
}, m.startOf = function (t, e) {
|
||
var n = this,
|
||
r = !!O.u(e) || e,
|
||
h = O.p(t),
|
||
$ = function (t, e) {
|
||
var i = O.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n);
|
||
return r ? i : i.endOf(a);
|
||
},
|
||
l = function (t, e) {
|
||
return O.w(n.toDate()[t].apply(n.toDate("s"), (r ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), n);
|
||
},
|
||
y = this.$W,
|
||
M = this.$M,
|
||
m = this.$D,
|
||
g = "set" + (this.$u ? "UTC" : "");
|
||
|
||
switch (h) {
|
||
case c:
|
||
return r ? $(1, 0) : $(31, 11);
|
||
|
||
case f:
|
||
return r ? $(1, M) : $(0, M + 1);
|
||
|
||
case o:
|
||
var D = this.$locale().weekStart || 0,
|
||
v = (y < D ? y + 7 : y) - D;
|
||
return $(r ? m - v : m + (6 - v), M);
|
||
|
||
case a:
|
||
case d:
|
||
return l(g + "Hours", 0);
|
||
|
||
case u:
|
||
return l(g + "Minutes", 1);
|
||
|
||
case s:
|
||
return l(g + "Seconds", 2);
|
||
|
||
case i:
|
||
return l(g + "Milliseconds", 3);
|
||
|
||
default:
|
||
return this.clone();
|
||
}
|
||
}, m.endOf = function (t) {
|
||
return this.startOf(t, !1);
|
||
}, m.$set = function (t, e) {
|
||
var n,
|
||
o = O.p(t),
|
||
h = "set" + (this.$u ? "UTC" : ""),
|
||
$ = (n = {}, n[a] = h + "Date", n[d] = h + "Date", n[f] = h + "Month", n[c] = h + "FullYear", n[u] = h + "Hours", n[s] = h + "Minutes", n[i] = h + "Seconds", n[r] = h + "Milliseconds", n)[o],
|
||
l = o === a ? this.$D + (e - this.$W) : e;
|
||
|
||
if (o === f || o === c) {
|
||
var y = this.clone().set(d, 1);
|
||
y.$d[$](l), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d;
|
||
} else $ && this.$d[$](l);
|
||
|
||
return this.init(), this;
|
||
}, m.set = function (t, e) {
|
||
return this.clone().$set(t, e);
|
||
}, m.get = function (t) {
|
||
return this[O.p(t)]();
|
||
}, m.add = function (r, h) {
|
||
var d,
|
||
$ = this;
|
||
r = Number(r);
|
||
|
||
var l = O.p(h),
|
||
y = function (t) {
|
||
var e = w($);
|
||
return O.w(e.date(e.date() + Math.round(t * r)), $);
|
||
};
|
||
|
||
if (l === f) return this.set(f, this.$M + r);
|
||
if (l === c) return this.set(c, this.$y + r);
|
||
if (l === a) return y(1);
|
||
if (l === o) return y(7);
|
||
var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[l] || 1,
|
||
m = this.$d.getTime() + r * M;
|
||
return O.w(m, this);
|
||
}, m.subtract = function (t, e) {
|
||
return this.add(-1 * t, e);
|
||
}, m.format = function (t) {
|
||
var e = this;
|
||
if (!this.isValid()) return $;
|
||
|
||
var n = t || "YYYY-MM-DDTHH:mm:ssZ",
|
||
r = O.z(this),
|
||
i = this.$locale(),
|
||
s = this.$H,
|
||
u = this.$m,
|
||
a = this.$M,
|
||
o = i.weekdays,
|
||
f = i.months,
|
||
h = function (t, r, i, s) {
|
||
return t && (t[r] || t(e, n)) || i[r].substr(0, s);
|
||
},
|
||
c = function (t) {
|
||
return O.s(s % 12 || 12, t, "0");
|
||
},
|
||
d = i.meridiem || function (t, e, n) {
|
||
var r = t < 12 ? "AM" : "PM";
|
||
return n ? r.toLowerCase() : r;
|
||
},
|
||
l = {
|
||
YY: String(this.$y).slice(-2),
|
||
YYYY: this.$y,
|
||
M: a + 1,
|
||
MM: O.s(a + 1, 2, "0"),
|
||
MMM: h(i.monthsShort, a, f, 3),
|
||
MMMM: h(f, a),
|
||
D: this.$D,
|
||
DD: O.s(this.$D, 2, "0"),
|
||
d: String(this.$W),
|
||
dd: h(i.weekdaysMin, this.$W, o, 2),
|
||
ddd: h(i.weekdaysShort, this.$W, o, 3),
|
||
dddd: o[this.$W],
|
||
H: String(s),
|
||
HH: O.s(s, 2, "0"),
|
||
h: c(1),
|
||
hh: c(2),
|
||
a: d(s, u, !0),
|
||
A: d(s, u, !1),
|
||
m: String(u),
|
||
mm: O.s(u, 2, "0"),
|
||
s: String(this.$s),
|
||
ss: O.s(this.$s, 2, "0"),
|
||
SSS: O.s(this.$ms, 3, "0"),
|
||
Z: r
|
||
};
|
||
|
||
return n.replace(y, function (t, e) {
|
||
return e || l[t] || r.replace(":", "");
|
||
});
|
||
}, m.utcOffset = function () {
|
||
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
||
}, m.diff = function (r, d, $) {
|
||
var l,
|
||
y = O.p(d),
|
||
M = w(r),
|
||
m = (M.utcOffset() - this.utcOffset()) * e,
|
||
g = this - M,
|
||
D = O.m(this, M);
|
||
return D = (l = {}, l[c] = D / 12, l[f] = D, l[h] = D / 3, l[o] = (g - m) / 6048e5, l[a] = (g - m) / 864e5, l[u] = g / n, l[s] = g / e, l[i] = g / t, l)[y] || g, $ ? D : O.a(D);
|
||
}, m.daysInMonth = function () {
|
||
return this.endOf(f).$D;
|
||
}, m.$locale = function () {
|
||
return v[this.$L];
|
||
}, m.locale = function (t, e) {
|
||
if (!t) return this.$L;
|
||
var n = this.clone(),
|
||
r = S(t, e, !0);
|
||
return r && (n.$L = r), n;
|
||
}, m.clone = function () {
|
||
return O.w(this.$d, this);
|
||
}, m.toDate = function () {
|
||
return new Date(this.valueOf());
|
||
}, m.toJSON = function () {
|
||
return this.isValid() ? this.toISOString() : null;
|
||
}, m.toISOString = function () {
|
||
return this.$d.toISOString();
|
||
}, m.toString = function () {
|
||
return this.$d.toUTCString();
|
||
}, M;
|
||
}(),
|
||
b = _.prototype;
|
||
|
||
return w.prototype = b, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function (t) {
|
||
b[t[1]] = function (e) {
|
||
return this.$g(e, t[0], t[1]);
|
||
};
|
||
}), w.extend = function (t, e) {
|
||
return t.$i || (t(e, _, w), t.$i = !0), w;
|
||
}, w.locale = S, w.isDayjs = p, w.unix = function (t) {
|
||
return w(1e3 * t);
|
||
}, w.en = v[D], w.Ls = v, w.p = {}, w;
|
||
});
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/dayjs/plugin/quarterOfYear.js":
|
||
/***/ (function(module) {
|
||
|
||
!function (t, n) {
|
||
true ? module.exports = n() : 0;
|
||
}(this, function () {
|
||
"use strict";
|
||
|
||
var t = "month",
|
||
n = "quarter";
|
||
return function (e, i) {
|
||
var r = i.prototype;
|
||
|
||
r.quarter = function (t) {
|
||
return this.$utils().u(t) ? Math.ceil((this.month() + 1) / 3) : this.month(this.month() % 3 + 3 * (t - 1));
|
||
};
|
||
|
||
var s = r.add;
|
||
|
||
r.add = function (e, i) {
|
||
return e = Number(e), this.$utils().p(i) === n ? this.add(3 * e, t) : s.bind(this)(e, i);
|
||
};
|
||
|
||
var u = r.startOf;
|
||
|
||
r.startOf = function (e, i) {
|
||
var r = this.$utils(),
|
||
s = !!r.u(i) || i;
|
||
|
||
if (r.p(e) === n) {
|
||
var o = this.quarter() - 1;
|
||
return s ? this.month(3 * o).startOf(t).startOf("day") : this.month(3 * o + 2).endOf(t).endOf("day");
|
||
}
|
||
|
||
return u.bind(this)(e, i);
|
||
};
|
||
};
|
||
});
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/css-loader/dist/cjs.js!./src/search.css":
|
||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
|
||
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
|
||
// Imports
|
||
|
||
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
|
||
// Module
|
||
___CSS_LOADER_EXPORT___.push([module.id, ".tapi-search-result {\n color: #000;\n padding: 5px;\n}\n\n.tapi-search-result:hover, .tapi-search-result-selected {\n background-color: #E7E6E6;\n}\n\n", ""]);
|
||
// Exports
|
||
/* harmony default export */ __webpack_exports__["Z"] = (___CSS_LOADER_EXPORT___);
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/css-loader/dist/cjs.js!./src/status.css":
|
||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
|
||
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
|
||
// Imports
|
||
|
||
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
|
||
// Module
|
||
___CSS_LOADER_EXPORT___.push([module.id, ".tapi-dropdown {\n position: relative;\n display: inline-block;\n}\n\n.tapi-dropdown-content {\n display: none;\n position: absolute;\n min-width: 200px;\n overflow: auto;\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n z-index: 1;\n color: #000;\n background-color: #fff;\n}\n\n.show {\n display: block;\n}\n", ""]);
|
||
// Exports
|
||
/* harmony default export */ __webpack_exports__["Z"] = (___CSS_LOADER_EXPORT___);
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":
|
||
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
|
||
var isOldIE = function isOldIE() {
|
||
var memo;
|
||
return function memorize() {
|
||
if (typeof memo === 'undefined') {
|
||
// Test for IE <= 9 as proposed by Browserhacks
|
||
// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
|
||
// Tests for existence of standard globals is to allow style-loader
|
||
// to operate correctly into non-standard environments
|
||
// @see https://github.com/webpack-contrib/style-loader/issues/177
|
||
memo = Boolean(window && document && document.all && !window.atob);
|
||
}
|
||
|
||
return memo;
|
||
};
|
||
}();
|
||
|
||
var getTarget = function getTarget() {
|
||
var memo = {};
|
||
return function memorize(target) {
|
||
if (typeof memo[target] === 'undefined') {
|
||
var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself
|
||
|
||
if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
|
||
try {
|
||
// This will throw an exception if access to iframe is blocked
|
||
// due to cross-origin restrictions
|
||
styleTarget = styleTarget.contentDocument.head;
|
||
} catch (e) {
|
||
// istanbul ignore next
|
||
styleTarget = null;
|
||
}
|
||
}
|
||
|
||
memo[target] = styleTarget;
|
||
}
|
||
|
||
return memo[target];
|
||
};
|
||
}();
|
||
|
||
var stylesInDom = [];
|
||
|
||
function getIndexByIdentifier(identifier) {
|
||
var result = -1;
|
||
|
||
for (var i = 0; i < stylesInDom.length; i++) {
|
||
if (stylesInDom[i].identifier === identifier) {
|
||
result = i;
|
||
break;
|
||
}
|
||
}
|
||
|
||
return result;
|
||
}
|
||
|
||
function modulesToDom(list, options) {
|
||
var idCountMap = {};
|
||
var identifiers = [];
|
||
|
||
for (var i = 0; i < list.length; i++) {
|
||
var item = list[i];
|
||
var id = options.base ? item[0] + options.base : item[0];
|
||
var count = idCountMap[id] || 0;
|
||
var identifier = "".concat(id, " ").concat(count);
|
||
idCountMap[id] = count + 1;
|
||
var index = getIndexByIdentifier(identifier);
|
||
var obj = {
|
||
css: item[1],
|
||
media: item[2],
|
||
sourceMap: item[3]
|
||
};
|
||
|
||
if (index !== -1) {
|
||
stylesInDom[index].references++;
|
||
stylesInDom[index].updater(obj);
|
||
} else {
|
||
stylesInDom.push({
|
||
identifier: identifier,
|
||
updater: addStyle(obj, options),
|
||
references: 1
|
||
});
|
||
}
|
||
|
||
identifiers.push(identifier);
|
||
}
|
||
|
||
return identifiers;
|
||
}
|
||
|
||
function insertStyleElement(options) {
|
||
var style = document.createElement('style');
|
||
var attributes = options.attributes || {};
|
||
|
||
if (typeof attributes.nonce === 'undefined') {
|
||
var nonce = true ? __webpack_require__.nc : 0;
|
||
|
||
if (nonce) {
|
||
attributes.nonce = nonce;
|
||
}
|
||
}
|
||
|
||
Object.keys(attributes).forEach(function (key) {
|
||
style.setAttribute(key, attributes[key]);
|
||
});
|
||
|
||
if (typeof options.insert === 'function') {
|
||
options.insert(style);
|
||
} else {
|
||
var target = getTarget(options.insert || 'head');
|
||
|
||
if (!target) {
|
||
throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
|
||
}
|
||
|
||
target.appendChild(style);
|
||
}
|
||
|
||
return style;
|
||
}
|
||
|
||
function removeStyleElement(style) {
|
||
// istanbul ignore if
|
||
if (style.parentNode === null) {
|
||
return false;
|
||
}
|
||
|
||
style.parentNode.removeChild(style);
|
||
}
|
||
/* istanbul ignore next */
|
||
|
||
|
||
var replaceText = function replaceText() {
|
||
var textStore = [];
|
||
return function replace(index, replacement) {
|
||
textStore[index] = replacement;
|
||
return textStore.filter(Boolean).join('\n');
|
||
};
|
||
}();
|
||
|
||
function applyToSingletonTag(style, index, remove, obj) {
|
||
var css = remove ? '' : obj.media ? "@media ".concat(obj.media, " {").concat(obj.css, "}") : obj.css; // For old IE
|
||
|
||
/* istanbul ignore if */
|
||
|
||
if (style.styleSheet) {
|
||
style.styleSheet.cssText = replaceText(index, css);
|
||
} else {
|
||
var cssNode = document.createTextNode(css);
|
||
var childNodes = style.childNodes;
|
||
|
||
if (childNodes[index]) {
|
||
style.removeChild(childNodes[index]);
|
||
}
|
||
|
||
if (childNodes.length) {
|
||
style.insertBefore(cssNode, childNodes[index]);
|
||
} else {
|
||
style.appendChild(cssNode);
|
||
}
|
||
}
|
||
}
|
||
|
||
function applyToTag(style, options, obj) {
|
||
var css = obj.css;
|
||
var media = obj.media;
|
||
var sourceMap = obj.sourceMap;
|
||
|
||
if (media) {
|
||
style.setAttribute('media', media);
|
||
} else {
|
||
style.removeAttribute('media');
|
||
}
|
||
|
||
if (sourceMap && typeof btoa !== 'undefined') {
|
||
css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
|
||
} // For old IE
|
||
|
||
/* istanbul ignore if */
|
||
|
||
|
||
if (style.styleSheet) {
|
||
style.styleSheet.cssText = css;
|
||
} else {
|
||
while (style.firstChild) {
|
||
style.removeChild(style.firstChild);
|
||
}
|
||
|
||
style.appendChild(document.createTextNode(css));
|
||
}
|
||
}
|
||
|
||
var singleton = null;
|
||
var singletonCounter = 0;
|
||
|
||
function addStyle(obj, options) {
|
||
var style;
|
||
var update;
|
||
var remove;
|
||
|
||
if (options.singleton) {
|
||
var styleIndex = singletonCounter++;
|
||
style = singleton || (singleton = insertStyleElement(options));
|
||
update = applyToSingletonTag.bind(null, style, styleIndex, false);
|
||
remove = applyToSingletonTag.bind(null, style, styleIndex, true);
|
||
} else {
|
||
style = insertStyleElement(options);
|
||
update = applyToTag.bind(null, style, options);
|
||
|
||
remove = function remove() {
|
||
removeStyleElement(style);
|
||
};
|
||
}
|
||
|
||
update(obj);
|
||
return function updateStyle(newObj) {
|
||
if (newObj) {
|
||
if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
|
||
return;
|
||
}
|
||
|
||
update(obj = newObj);
|
||
} else {
|
||
remove();
|
||
}
|
||
};
|
||
}
|
||
|
||
module.exports = function (list, options) {
|
||
options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
|
||
// tags it will allow on a page
|
||
|
||
if (!options.singleton && typeof options.singleton !== 'boolean') {
|
||
options.singleton = isOldIE();
|
||
}
|
||
|
||
list = list || [];
|
||
var lastIdentifiers = modulesToDom(list, options);
|
||
return function update(newList) {
|
||
newList = newList || [];
|
||
|
||
if (Object.prototype.toString.call(newList) !== '[object Array]') {
|
||
return;
|
||
}
|
||
|
||
for (var i = 0; i < lastIdentifiers.length; i++) {
|
||
var identifier = lastIdentifiers[i];
|
||
var index = getIndexByIdentifier(identifier);
|
||
stylesInDom[index].references--;
|
||
}
|
||
|
||
var newLastIdentifiers = modulesToDom(newList, options);
|
||
|
||
for (var _i = 0; _i < lastIdentifiers.length; _i++) {
|
||
var _identifier = lastIdentifiers[_i];
|
||
|
||
var _index = getIndexByIdentifier(_identifier);
|
||
|
||
if (stylesInDom[_index].references === 0) {
|
||
stylesInDom[_index].updater();
|
||
|
||
stylesInDom.splice(_index, 1);
|
||
}
|
||
}
|
||
|
||
lastIdentifiers = newLastIdentifiers;
|
||
};
|
||
};
|
||
|
||
/***/ })
|
||
|
||
/******/ });
|
||
/************************************************************************/
|
||
/******/ // The module cache
|
||
/******/ var __webpack_module_cache__ = {};
|
||
/******/
|
||
/******/ // The require function
|
||
/******/ function __webpack_require__(moduleId) {
|
||
/******/ // Check if module is in cache
|
||
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||
/******/ if (cachedModule !== undefined) {
|
||
/******/ return cachedModule.exports;
|
||
/******/ }
|
||
/******/ // Create a new module (and put it into the cache)
|
||
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||
/******/ id: moduleId,
|
||
/******/ // no module.loaded needed
|
||
/******/ exports: {}
|
||
/******/ };
|
||
/******/
|
||
/******/ // Execute the module function
|
||
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||
/******/
|
||
/******/ // Return the exports of the module
|
||
/******/ return module.exports;
|
||
/******/ }
|
||
/******/
|
||
/************************************************************************/
|
||
/******/ /* webpack/runtime/compat get default export */
|
||
/******/ !function() {
|
||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||
/******/ __webpack_require__.n = function(module) {
|
||
/******/ var getter = module && module.__esModule ?
|
||
/******/ function() { return module['default']; } :
|
||
/******/ function() { return module; };
|
||
/******/ __webpack_require__.d(getter, { a: getter });
|
||
/******/ return getter;
|
||
/******/ };
|
||
/******/ }();
|
||
/******/
|
||
/******/ /* webpack/runtime/define property getters */
|
||
/******/ !function() {
|
||
/******/ // define getter functions for harmony exports
|
||
/******/ __webpack_require__.d = function(exports, definition) {
|
||
/******/ for(var key in definition) {
|
||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||
/******/ }
|
||
/******/ }
|
||
/******/ };
|
||
/******/ }();
|
||
/******/
|
||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||
/******/ !function() {
|
||
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
||
/******/ }();
|
||
/******/
|
||
/************************************************************************/
|
||
var __webpack_exports__ = {};
|
||
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
|
||
!function() {
|
||
"use strict";
|
||
|
||
// EXTERNAL MODULE: ./node_modules/chrono-node/dist/index.js
|
||
var dist = __webpack_require__("./node_modules/chrono-node/dist/index.js");
|
||
;// CONCATENATED MODULE: external "axios"
|
||
var external_axios_namespaceObject = axios;
|
||
var external_axios_default = /*#__PURE__*/__webpack_require__.n(external_axios_namespaceObject);
|
||
;// CONCATENATED MODULE: external "axiosGmxhrAdapter"
|
||
var external_axiosGmxhrAdapter_namespaceObject = axiosGmxhrAdapter;
|
||
var external_axiosGmxhrAdapter_default = /*#__PURE__*/__webpack_require__.n(external_axiosGmxhrAdapter_namespaceObject);
|
||
;// CONCATENATED MODULE: ./src/utils.ts
|
||
/**
|
||
* @typedef {Object} AxiosResponse
|
||
* @property {Object} data
|
||
* @property {Object} headers
|
||
* @property {Object} config
|
||
* @property {Object} request
|
||
* @property {number} code
|
||
* @property {string} statusText
|
||
*/
|
||
/**
|
||
* @typedef {Object} AxiosError
|
||
* @property {AxiosResponse} response
|
||
*/
|
||
|
||
|
||
(external_axios_default()).defaults.adapter = (external_axiosGmxhrAdapter_default());
|
||
|
||
function extractNumber(s) {
|
||
var match = /(\+?[0-9]{4,})/.exec(s);
|
||
if (!match) {
|
||
return undefined;
|
||
}
|
||
var number = match[1];
|
||
if (number.startsWith('+')) {
|
||
number = number.replace('+', '00');
|
||
}
|
||
return number;
|
||
}
|
||
function fireChangeEvents(element) {
|
||
var changeEvent = null;
|
||
changeEvent = document.createEvent('HTMLEvents');
|
||
changeEvent.initEvent('input', true, true);
|
||
element.dispatchEvent(changeEvent);
|
||
console.debug('input event dispatched for element: ' + element.id);
|
||
changeEvent = document.createEvent('HTMLEvents');
|
||
changeEvent.initEvent('keyup', true, true);
|
||
element.dispatchEvent(changeEvent);
|
||
console.debug('keyup event dispatched for element: ' + element.id);
|
||
changeEvent = document.createEvent('HTMLEvents');
|
||
changeEvent.initEvent('change', true, true);
|
||
element.dispatchEvent(changeEvent);
|
||
console.debug('change event dispatched for element: ' + element.id);
|
||
}
|
||
|
||
;// CONCATENATED MODULE: ./src/call-history.ts
|
||
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||
return new (P || (P = Promise))(function (resolve, reject) {
|
||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||
});
|
||
};
|
||
|
||
|
||
class CallHistory {
|
||
constructor() {
|
||
this.callerIds = {};
|
||
}
|
||
updateCallHistoryEntry(call, callerId) {
|
||
var span = call.querySelector(':scope > span');
|
||
this.showTimeManager(call, call.querySelector('.date').textContent, callerId);
|
||
if (callerId && callerId.tD_NAME !== '') {
|
||
var text = span.textContent;
|
||
span.textContent = callerId.tD_NAME + ' ' + callerId.tD_NUMBER;
|
||
}
|
||
}
|
||
showTimeManager(call, date, callerId) {
|
||
var dateParts = date.match(/^(?<date>.*), (?<duration>[0-9]{2}:[0-9]{2}:[0-9]{2})$/);
|
||
var duration = '00:00:00';
|
||
if (dateParts) {
|
||
date = dateParts.groups.date;
|
||
duration = dateParts.groups.duration;
|
||
}
|
||
var parsedDate = dist.de.parseDate(date);
|
||
if (!parsedDate) {
|
||
parsedDate = dist.parseDate(date);
|
||
}
|
||
if (!parsedDate) {
|
||
return;
|
||
}
|
||
// Date parsing is awful, just assume the first number is the day of month
|
||
var day = date.match(/[0-9]+/)[0];
|
||
var parsedDuration = dist.parseDate(duration);
|
||
console.log('TAPI call history time:', date, 'parsedDate:', parsedDate, 'duration:', duration, 'parsedDuration:', parsedDuration);
|
||
var connect = parsedDate.getFullYear().toString() +
|
||
(parsedDate.getMonth() + 1).toString().padStart(2, '0') + // (January gives 0)
|
||
day.toString().padStart(2, '0') +
|
||
parsedDate.getHours().toString().padStart(2, '0') +
|
||
parsedDate.getMinutes().toString().padStart(2, '0');
|
||
var length = (parsedDuration.getHours() * 60 + parsedDuration.getMinutes()).toString();
|
||
var toolbar = call.querySelector('call-history-options');
|
||
var href = 'domizil://PM/Zeitbuchung?';
|
||
if (callerId && callerId.tD_ID) {
|
||
href += 'KontaktId=' + callerId.tD_ID + '&';
|
||
}
|
||
href += 'connect=' + connect + '&length=' + length;
|
||
var a = document.createElement('a');
|
||
a.title = 'PM Zeitbuchung';
|
||
a.dataset.domizilLink = href;
|
||
a.onclick = () => {
|
||
window.open(href);
|
||
};
|
||
a.innerHTML = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 559.98 559.98">' +
|
||
'<g>' +
|
||
' <g>' +
|
||
' <path d="M279.99,0C125.601,0,0,125.601,0,279.99c0,154.39,125.601,279.99,279.99,279.99c154.39,0,279.99-125.601,279.99-279.99' +
|
||
' C559.98,125.601,434.38,0,279.99,0z M279.99,498.78c-120.644,0-218.79-98.146-218.79-218.79' +
|
||
' c0-120.638,98.146-218.79,218.79-218.79s218.79,98.152,218.79,218.79C498.78,400.634,400.634,498.78,279.99,498.78z"/>' +
|
||
' <path d="M304.226,280.326V162.976c0-13.103-10.618-23.721-23.716-23.721c-13.102,0-23.721,10.618-23.721,23.721v124.928' +
|
||
' c0,0.373,0.092,0.723,0.11,1.096c-0.312,6.45,1.91,12.999,6.836,17.926l88.343,88.336c9.266,9.266,24.284,9.266,33.543,0' +
|
||
' c9.26-9.266,9.266-24.284,0-33.544L304.226,280.326z"/>' +
|
||
' </g>' +
|
||
'</g>' +
|
||
'</svg>';
|
||
a.classList.add('btn');
|
||
a.classList.add('btn-plain');
|
||
toolbar.insertBefore(a, toolbar.firstChild);
|
||
}
|
||
showCallHistory(element) {
|
||
return __awaiter(this, void 0, void 0, function* () {
|
||
var span = element.querySelector(':scope > span');
|
||
var number = extractNumber(span.textContent);
|
||
if (!number) {
|
||
this.updateCallHistoryEntry(element, undefined);
|
||
return;
|
||
}
|
||
if (this.callerIds[number] !== undefined) {
|
||
this.updateCallHistoryEntry(element, this.callerIds[number]);
|
||
}
|
||
else {
|
||
var response = yield external_axios_default().get('http://cpatapi.cpsrvweb2016.cp-austria.at/callerid/' + encodeURIComponent(number));
|
||
var callerId = { tD_NAME: '' };
|
||
if (response.status === 200) {
|
||
callerId = response.data;
|
||
}
|
||
console.log('TAPI call histroy callerid response', number, response, callerId);
|
||
this.callerIds[number] = callerId;
|
||
this.updateCallHistoryEntry(element, callerId);
|
||
}
|
||
});
|
||
}
|
||
}
|
||
|
||
;// CONCATENATED MODULE: ./src/call-notification.ts
|
||
var call_notification_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||
return new (P || (P = Promise))(function (resolve, reject) {
|
||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||
});
|
||
};
|
||
|
||
class CallNotification {
|
||
showCallNotification(element) {
|
||
return call_notification_awaiter(this, void 0, void 0, function* () {
|
||
var number = element.querySelector('.callNumber').textContent;
|
||
console.log('TAPI call notification', number);
|
||
number = extractNumber(number);
|
||
if (!number) {
|
||
console.log('TAPI callerid no number found');
|
||
return;
|
||
}
|
||
console.log('TAPI searching callerid for', number);
|
||
var response = yield external_axios_default().get('http://cpatapi.cpsrvweb2016.cp-austria.at/callerid/' + encodeURIComponent(number));
|
||
console.log('TAPI callerid response', response);
|
||
var notification = {
|
||
text: number
|
||
};
|
||
if (response.status === 200) {
|
||
var callerId = response.data;
|
||
if (callerId) {
|
||
notification.text = callerId.tD_NAME + '\r\n' + number + ' (' + callerId.tD_MEDIUM + ')';
|
||
}
|
||
}
|
||
// eslint-disable-next-line no-undef
|
||
GM.notification(notification);
|
||
});
|
||
}
|
||
}
|
||
|
||
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
|
||
var injectStylesIntoStyleTag = __webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
|
||
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
|
||
// EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./src/search.css
|
||
var search = __webpack_require__("./node_modules/css-loader/dist/cjs.js!./src/search.css");
|
||
;// CONCATENATED MODULE: ./src/search.css
|
||
|
||
|
||
|
||
var options = {};
|
||
|
||
options.insert = "head";
|
||
options.singleton = false;
|
||
|
||
var update = injectStylesIntoStyleTag_default()(search/* default */.Z, options);
|
||
|
||
|
||
|
||
/* harmony default export */ var src_search = (search/* default.locals */.Z.locals || {});
|
||
;// CONCATENATED MODULE: ./src/debounce.js
|
||
function debounce(func, wait) {
|
||
let timeout;
|
||
return function executedFunction(...args) {
|
||
const later = () => {
|
||
clearTimeout(timeout);
|
||
func(...args);
|
||
};
|
||
|
||
clearTimeout(timeout);
|
||
timeout = setTimeout(later, wait);
|
||
};
|
||
}
|
||
;// CONCATENATED MODULE: ./src/search.ts
|
||
var search_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||
return new (P || (P = Promise))(function (resolve, reject) {
|
||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||
});
|
||
};
|
||
|
||
|
||
|
||
class Search {
|
||
constructor() {
|
||
this.currentSearchText = '';
|
||
this.doSearch = debounce(() => search_awaiter(this, void 0, void 0, function* () {
|
||
var search = document.getElementById('tapiSearchInput');
|
||
var searchText = search.value.trim();
|
||
if (searchText === '') {
|
||
this.removeSearchResults();
|
||
return;
|
||
}
|
||
else if (searchText === this.currentSearchText) {
|
||
return;
|
||
}
|
||
console.log('Searching TAPI');
|
||
var response = yield external_axios_default().get('http://cpatapi.cpsrvweb2016.cp-austria.at/search?query=' + encodeURIComponent(searchText));
|
||
console.log('TAPI Search response', response);
|
||
var contacts = response.data;
|
||
console.log('TAPI Contacts', contacts);
|
||
this.removeSearchResults();
|
||
this.currentSearchText = searchText;
|
||
var resultList = document.createElement('ul');
|
||
resultList.id = 'tapiResults';
|
||
resultList.classList.add('search-nav-absolute');
|
||
resultList.classList.add('search-nav-ul');
|
||
document.getElementById('tapiSearchBox').appendChild(resultList);
|
||
resultList.innerHTML = '';
|
||
contacts.forEach(contact => {
|
||
var li = document.createElement('li');
|
||
li.classList.add('tapi-search-result');
|
||
li.classList.add('pointer');
|
||
li.onmouseover = () => { this.selectResult(li); };
|
||
li.dataset.tapiNumber = contact.tD_NUMBER_TAPI;
|
||
li.onclick = () => { this.dial(contact.tD_NUMBER_TAPI); };
|
||
li.style.listStyle = 'outside none none'; // display: flex; align-items: center;
|
||
var resultText = document.createElement('div');
|
||
resultText.classList.add('search-result-txt');
|
||
li.appendChild(resultText);
|
||
var line1 = document.createElement('div');
|
||
line1.appendChild(document.createTextNode(contact.tD_NAME));
|
||
resultText.appendChild(line1);
|
||
var line2 = document.createElement('div');
|
||
line2.appendChild(document.createTextNode(contact.tD_MEDIUM + ': ' + contact.tD_NUMBER_TAPI));
|
||
resultText.appendChild(line2);
|
||
resultList.appendChild(li);
|
||
});
|
||
}), 200);
|
||
}
|
||
createSearchWindow(element) {
|
||
console.log('Create TAPI Search');
|
||
var form = document.createElement('form');
|
||
form.style.width = '200px';
|
||
form.style.float = 'right';
|
||
form.style.marginRight = '20px';
|
||
form.onsubmit = () => {
|
||
var items = document.getElementsByClassName('tapi-search-result-selected');
|
||
if (items.length === 0) {
|
||
items = document.getElementsByClassName('tapi-search-result');
|
||
}
|
||
if (items.length > 0) {
|
||
this.dial(items[0].dataset.tapiNumber);
|
||
}
|
||
else {
|
||
this.dial(document.getElementById('tapiSearchInput').value);
|
||
}
|
||
return false;
|
||
};
|
||
var searchBox = document.createElement('div');
|
||
searchBox.classList.add('contact-search-box');
|
||
searchBox.id = 'tapiSearchBox';
|
||
form.appendChild(searchBox);
|
||
var searchWrapper = document.createElement('div');
|
||
searchWrapper.classList.add('search-input-wrapper');
|
||
searchWrapper.style.position = 'relative';
|
||
searchBox.appendChild(searchWrapper);
|
||
var search = document.createElement('input');
|
||
search.id = 'tapiSearchInput';
|
||
search.autocomplete = 'off';
|
||
search.classList.add('padder');
|
||
search.classList.add('rounded');
|
||
search.classList.add('bg-light');
|
||
search.classList.add('no-border');
|
||
search.classList.add('contact-search-box');
|
||
search.placeholder = 'TAPI Suche';
|
||
search.onfocus = () => { this.doSearch(); };
|
||
search.onkeydown = (ev) => { this.doSearchKeyDown(ev); };
|
||
search.onblur = () => {
|
||
console.log('TAPI Search exit', this);
|
||
setTimeout(() => {
|
||
console.log('TAPI clear search results');
|
||
this.removeSearchResults();
|
||
}, 500);
|
||
};
|
||
searchWrapper.appendChild(search);
|
||
var icon = document.createElement('span');
|
||
icon.classList.add('fa');
|
||
icon.classList.add('fa-search');
|
||
icon.classList.add('form-control-feedback');
|
||
icon.style.color = 'grey';
|
||
searchWrapper.appendChild(icon);
|
||
element.parentElement.insertBefore(form, element);
|
||
}
|
||
removeSearchResults() {
|
||
var resultList = document.getElementById('tapiResults');
|
||
if (resultList) {
|
||
resultList.parentNode.removeChild(resultList);
|
||
}
|
||
this.currentSearchText = '';
|
||
}
|
||
doSearchKeyDown(ev) {
|
||
if (ev.key === 'ArrowUp') {
|
||
let items = document.getElementsByClassName('tapi-search-result-selected');
|
||
if (items.length > 0) {
|
||
var prev = items[0].previousSibling;
|
||
}
|
||
if (!prev) {
|
||
items = document.getElementsByClassName('tapi-search-result');
|
||
if (items.length > 0) {
|
||
prev = items[items.length - 1];
|
||
}
|
||
}
|
||
if (prev) {
|
||
this.selectResult(prev);
|
||
prev.scrollIntoView(true);
|
||
}
|
||
}
|
||
else if (ev.key === 'ArrowDown') {
|
||
let items = document.getElementsByClassName('tapi-search-result-selected');
|
||
if (items.length > 0) {
|
||
var next = items[0].nextSibling;
|
||
}
|
||
if (!next) {
|
||
items = document.getElementsByClassName('tapi-search-result');
|
||
if (items.length > 0) {
|
||
next = items[0];
|
||
}
|
||
}
|
||
if (next) {
|
||
this.selectResult(next);
|
||
next.scrollIntoView(false);
|
||
}
|
||
}
|
||
else {
|
||
this.doSearch();
|
||
}
|
||
}
|
||
selectResult(resultLi) {
|
||
var items = document.getElementsByClassName('tapi-search-result');
|
||
for (var item of items) {
|
||
item.classList.remove('tapi-search-result-selected');
|
||
}
|
||
resultLi.classList.add('tapi-search-result-selected');
|
||
}
|
||
dial(number) {
|
||
console.log('TAPI Search dialing', number);
|
||
var searchInput = document.getElementById('dialpad-input');
|
||
searchInput.value = number;
|
||
searchInput.focus;
|
||
fireChangeEvents(searchInput);
|
||
var toaster = document.querySelector('toaster-container');
|
||
if (window.getComputedStyle(toaster, null).display == 'none') {
|
||
document.getElementById('menuDialer').click();
|
||
}
|
||
}
|
||
}
|
||
|
||
// EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./src/status.css
|
||
var cjs_js_src_status = __webpack_require__("./node_modules/css-loader/dist/cjs.js!./src/status.css");
|
||
;// CONCATENATED MODULE: ./src/status.css
|
||
|
||
|
||
|
||
var status_options = {};
|
||
|
||
status_options.insert = "head";
|
||
status_options.singleton = false;
|
||
|
||
var status_update = injectStylesIntoStyleTag_default()(cjs_js_src_status/* default */.Z, status_options);
|
||
|
||
|
||
|
||
/* harmony default export */ var src_status = (cjs_js_src_status/* default.locals */.Z.locals || {});
|
||
;// CONCATENATED MODULE: ./src/status.ts
|
||
var status_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||
return new (P || (P = Promise))(function (resolve, reject) {
|
||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||
});
|
||
};
|
||
|
||
|
||
class Status {
|
||
constructor() {
|
||
this._enabled = false;
|
||
this._statusOn = 'menuAvailable';
|
||
this._statusOff = 'menuAway';
|
||
this._currentStatus = undefined;
|
||
}
|
||
showStatus(element) {
|
||
return status_awaiter(this, void 0, void 0, function* () {
|
||
this._user = yield GM.getValue('tapi-zc-user', '');
|
||
this._enabled = yield GM.getValue('tapi-zc-enabled', false);
|
||
this._statusOn = yield GM.getValue('tapi-zc-on', 'menuAvailable');
|
||
this._statusOff = yield GM.getValue('tapi-zc-off', 'menuAvailable');
|
||
console.log('tapi-zc-user', this._user, 'tapi-zc-enabled', this._enabled, 'tapi-zc-on', this._statusOn, 'tapi-zc-off', this._statusOff);
|
||
this.checkStatus();
|
||
waitForKeyElements("wc-account-menu > div > ul", (element) => { this.addZcStatusPopup(element); }, true);
|
||
});
|
||
}
|
||
checkStatus() {
|
||
return status_awaiter(this, void 0, void 0, function* () {
|
||
if (this._enabled) {
|
||
try {
|
||
var response = yield external_axios_default().get('http://cpatapi.cpsrvweb2016.cp-austria.at/availability/' + encodeURIComponent(this._user));
|
||
if (response.status == 200) {
|
||
var status = response.data;
|
||
if (this._currentStatus !== status.loggedIn) {
|
||
this._currentStatus = status.loggedIn;
|
||
console.log('New status, loggedIn', this._currentStatus);
|
||
document.getElementsByTagName("wcavatar")[0].click();
|
||
setTimeout(() => {
|
||
var statusId = this._currentStatus ? this._statusOn : this._statusOff;
|
||
document.getElementById(statusId).click();
|
||
}, 1000);
|
||
}
|
||
}
|
||
}
|
||
catch (error) {
|
||
console.log(error);
|
||
}
|
||
setTimeout(() => this.checkStatus(), 30000);
|
||
}
|
||
});
|
||
}
|
||
addZcStatusPopup(element) {
|
||
var divider = document.createElement('li');
|
||
divider.classList.add('divider');
|
||
divider.classList.add('dropdown-divider');
|
||
element.appendChild(divider);
|
||
var menu = document.createElement('li');
|
||
element.appendChild(menu);
|
||
var link = document.createElement('a');
|
||
link.id = 'tapi-zc-button';
|
||
link.innerText = 'ZeitConsens';
|
||
link.classList.add('dropdown-item');
|
||
link.classList.add('d-flex');
|
||
link.onclick = () => {
|
||
document.getElementById('zc-modal').classList.toggle('show');
|
||
};
|
||
menu.appendChild(link);
|
||
var html = '<div role="document" class="modal-dialog">' +
|
||
' <div class="modal-content">' +
|
||
' <div class="modal-header">' +
|
||
' <h4 class="modal-title float-left">ZeitConsens Status</h4><button id="zc-btnClose" type="button" aria-label="Close" class="close float-right"><span aria-hidden="true">×</span></button>' +
|
||
' </div>' +
|
||
' <div class="modal-body">' +
|
||
' <div class="form-group">' +
|
||
' <label for="tapi-zc-user">Username</label>' +
|
||
' <input type="text" class="form-control" name="tapi-zc-user" id="tapi-zc-user">' +
|
||
' </div>' +
|
||
' <div class="form-group">' +
|
||
' <label for="tapi-zc-on">Signed in</label>' +
|
||
' <select id="tapi-zc-on" class="form-control">' +
|
||
' <option value="menuAvailable">Available</option>' +
|
||
' <option value="menuOutofoffice">Do Not Disturb</option>' +
|
||
' <option value="menuCustom1">Verfügbar DW</option>' +
|
||
' </select>' +
|
||
' </div>' +
|
||
' <div class="form-group">' +
|
||
' <label for="tapi-zc-off">Signed out</label>' +
|
||
' <select id="tapi-zc-off" class="form-control">' +
|
||
' <option value="menuAway">Away</option>' +
|
||
' <option value="menuOutofoffice">Do Not Disturb</option>' +
|
||
' </select>' +
|
||
' </div>' +
|
||
' <div class="checkbox">' +
|
||
' <label class="i-checks" for="tapi-zc-enabled">' +
|
||
' <input type="checkbox" id="tapi-zc-enabled">' +
|
||
' <i></i><span>Enabled</span>' +
|
||
' </label>';
|
||
' </div>';
|
||
' </div>' +
|
||
' <div class="modal-footer">' +
|
||
' <button id="zc-btnOk" type="button" class="btn btn-primary">OK </button>' +
|
||
' <button id="zc-btnCancel" type="button" class="btn btn-light">Cancel </button>' +
|
||
' </div>' +
|
||
' </div>' +
|
||
'</div>';
|
||
var modal = document.createElement('modal-container');
|
||
modal.id = 'zc-modal';
|
||
modal.classList.add('modal');
|
||
modal.classList.add('fade');
|
||
modal.innerHTML = html;
|
||
var body = document.getElementsByTagName('body')[0].appendChild(modal);
|
||
var btnClose = document.getElementById('zc-btnClose');
|
||
btnClose.onclick = () => {
|
||
document.getElementById('zc-modal').classList.toggle('show');
|
||
};
|
||
var zcUser = document.getElementById('tapi-zc-user');
|
||
zcUser.value = this._user;
|
||
zcUser.onchange = () => {
|
||
this._user = zcUser.value;
|
||
GM.setValue('tapi-zc-user', this._user);
|
||
console.log('tapi-zc-user', this._user);
|
||
this._currentStatus = undefined;
|
||
};
|
||
var zcEnabled = document.getElementById('tapi-zc-enabled');
|
||
zcEnabled.checked = this._enabled;
|
||
zcEnabled.onchange = () => {
|
||
this._enabled = zcEnabled.checked;
|
||
GM.setValue('tapi-zc-enabled', this._enabled);
|
||
console.log('tapi-zc-enabled', this._enabled);
|
||
this._currentStatus = undefined;
|
||
this.checkStatus();
|
||
};
|
||
var zcOn = document.getElementById('tapi-zc-on');
|
||
zcOn.value = this._statusOn;
|
||
zcOn.onchange = () => {
|
||
this._statusOn = zcOn.value;
|
||
GM.setValue('tapi-zc-on', this._statusOn);
|
||
console.log('tapi-zc-on', this._statusOn);
|
||
this._currentStatus = undefined;
|
||
};
|
||
var zcOff = document.getElementById('tapi-zc-off');
|
||
zcOff.value = this._statusOff;
|
||
zcOff.onchange = () => {
|
||
this._statusOff = zcOff.value;
|
||
GM.setValue('tapi-zc-off', this._statusOff);
|
||
console.log('tapi-zc-off', this._statusOff);
|
||
this._currentStatus = undefined;
|
||
};
|
||
}
|
||
}
|
||
|
||
;// CONCATENATED MODULE: ./src/index.js
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||
|
||
|
||
|
||
|
||
|
||
console.log('script start');
|
||
const src_search_0 = new Search(); // eslint-disable-next-line no-undef
|
||
|
||
waitForKeyElements('ongoing-call-button', element => {
|
||
src_search_0.createSearchWindow(element);
|
||
}, true);
|
||
const callNotification = new CallNotification(); // eslint-disable-next-line no-undef
|
||
|
||
waitForKeyElements('call-view', element => {
|
||
callNotification.showCallNotification(element);
|
||
}, false);
|
||
const callHistory = new CallHistory(); // eslint-disable-next-line no-undef
|
||
|
||
waitForKeyElements('.call-history-list call', element => {
|
||
callHistory.showCallHistory(element);
|
||
}, false);
|
||
const src_status_0 = new Status(); // eslint-disable-next-line no-undef
|
||
|
||
waitForKeyElements('wc-account-menu', element => {
|
||
src_status_0.showStatus(element);
|
||
}, false);
|
||
}();
|
||
/******/ })()
|
||
; |