module.exports = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // object to store loaded chunks /******/ // "0" means "already loaded" /******/ var installedChunks = { /******/ "main": 0 /******/ }; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // uncaught error handler for webpack runtime /******/ __webpack_require__.oe = function(err) { /******/ process.nextTick(function() { /******/ throw err; // catch this error by using import().catch() /******/ }); /******/ }; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "./packages/loot-core/src/server/main.js"); /******/ }) /************************************************************************/ /******/ ({ /***/ "./node_modules/@jlongster/mixpanel/lib/groups.js": /*!********************************************************!*\ !*** ./node_modules/@jlongster/mixpanel/lib/groups.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { /** * Group profile methods. Learn more: https://help.mixpanel.com/hc/en-us/articles/360025333632 */ const _require = __webpack_require__(/*! ./profile_helpers */ "./node_modules/@jlongster/mixpanel/lib/profile_helpers.js"), ProfileHelpers = _require.ProfileHelpers; class MixpanelGroups extends ProfileHelpers() { constructor(mp_instance) { super(); this.mixpanel = mp_instance; this.endpoint = '/groups'; } /** groups.set_once(group_key, group_id, prop, to, modifiers, callback) --- The same as groups.set, but adds a property value to a group only if it has not been set before. */ set_once(group_key, group_id, prop, to, modifiers, callback) { const identifiers = { $group_key: group_key, $group_id: group_id }; this._set(prop, to, modifiers, callback, { identifiers, set_once: true }); } /** groups.set(group_key, group_id, prop, to, modifiers, callback) --- set properties on a group profile usage: mixpanel.groups.set('company', 'Acme Inc.', '$name', 'Acme Inc.'); mixpanel.groups.set('company', 'Acme Inc.', { 'Industry': 'widgets', '$name': 'Acme Inc.', }); */ set(group_key, group_id, prop, to, modifiers, callback) { const identifiers = { $group_key: group_key, $group_id: group_id }; this._set(prop, to, modifiers, callback, { identifiers }); } /** groups.delete_group(group_key, group_id, modifiers, callback) --- delete a group profile permanently usage: mixpanel.groups.delete_group('company', 'Acme Inc.'); */ delete_group(group_key, group_id, modifiers, callback) { const identifiers = { $group_key: group_key, $group_id: group_id }; this._delete_profile({ identifiers, modifiers, callback }); } /** groups.remove(group_key, group_id, data, modifiers, callback) --- remove a value from a list-valued group profile property. usage: mixpanel.groups.remove('company', 'Acme Inc.', {'products': 'anvil'}); mixpanel.groups.remove('company', 'Acme Inc.', { 'products': 'anvil', 'customer segments': 'coyotes' }); */ remove(group_key, group_id, data, modifiers, callback) { const identifiers = { $group_key: group_key, $group_id: group_id }; this._remove({ identifiers, data, modifiers, callback }); } /** groups.union(group_key, group_id, data, modifiers, callback) --- merge value(s) into a list-valued group profile property. usage: mixpanel.groups.union('company', 'Acme Inc.', {'products': 'anvil'}); mixpanel.groups.union('company', 'Acme Inc.', {'products': ['anvil'], 'customer segments': ['coyotes']}); */ union(group_key, group_id, data, modifiers, callback) { const identifiers = { $group_key: group_key, $group_id: group_id }; this._union({ identifiers, data, modifiers, callback }); } /** groups.unset(group_key, group_id, prop, modifiers, callback) --- delete a property on a group profile usage: mixpanel.groups.unset('company', 'Acme Inc.', 'products'); mixpanel.groups.unset('company', 'Acme Inc.', ['products', 'customer segments']); */ unset(group_key, group_id, prop, modifiers, callback) { const identifiers = { $group_key: group_key, $group_id: group_id }; this._unset({ identifiers, prop, modifiers, callback }); } } exports.MixpanelGroups = MixpanelGroups; /***/ }), /***/ "./node_modules/@jlongster/mixpanel/lib/mixpanel-node.js": /*!***************************************************************!*\ !*** ./node_modules/@jlongster/mixpanel/lib/mixpanel-node.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /* Heavily inspired by the original js library copyright Mixpanel, Inc. (http://mixpanel.com/) Copyright (c) 2012 Carl Sverre Released under the MIT license. */ const _require = __webpack_require__(/*! ./utils */ "./node_modules/@jlongster/mixpanel/lib/utils.js"), async_all = _require.async_all, ensure_timestamp = _require.ensure_timestamp; const _require2 = __webpack_require__(/*! ./groups */ "./node_modules/@jlongster/mixpanel/lib/groups.js"), MixpanelGroups = _require2.MixpanelGroups; const _require3 = __webpack_require__(/*! ./people */ "./node_modules/@jlongster/mixpanel/lib/people.js"), MixpanelPeople = _require3.MixpanelPeople; const DEFAULT_CONFIG = { test: false, debug: false, verbose: false, host: 'api.mixpanel.com', protocol: 'https', path: '' }; function base64(str) { return typeof btoa !== 'undefined' ? btoa(str) : Buffer.from(str).toString('base64'); } var create_client = function (token, config) { if (!token) { throw new Error("The Mixpanel Client needs a Mixpanel token: `init(token)`"); } // mixpanel constants const MAX_BATCH_SIZE = 50; const TRACK_AGE_LIMIT = 60 * 60 * 24 * 5; const metrics = { token, config: _objectSpread({}, DEFAULT_CONFIG) }; /** * sends an async GET or POST request to mixpanel * for batch processes data must be send in the body of a POST * @param {object} options * @param {string} options.endpoint * @param {object} options.data the data to send in the request * @param {string} [options.method] e.g. `get` or `post`, defaults to `get` * @param {function} callback called on request completion or error */ metrics.send_request = function (options, callback) { callback = callback || function () {}; let content = base64(JSON.stringify(options.data)); const endpoint = options.endpoint; const method = (options.method || 'GET').toUpperCase(); let query_params = { 'ip': 0, 'verbose': metrics.config.verbose ? 1 : 0 }; const key = metrics.config.key; const secret = metrics.config.secret; let request_options = { headers: {} }; let request; let request_base = `${metrics.config.protocol}://${metrics.config.host}`; if (metrics.config.port) { request_base += `:${metrics.config.port}`; } if (method === 'POST') { content = 'data=' + content; request_options.headers['Content-Type'] = 'application/x-www-form-urlencoded'; request_options.headers['Content-Length'] = content.length; } else if (method === 'GET') { query_params.data = content; } // add auth params if (secret) { if (metrics.config.protocol !== 'https') { throw new Error("Must use HTTPS if authenticating with API Secret"); } const encoded = base64(secret + ':'); request_options.headers['Authorization'] = 'Basic ' + encoded; } else if (key) { query_params.api_key = key; } else if (endpoint === '/import') { throw new Error("The Mixpanel Client needs a Mixpanel API Secret when importing old events: `init(token, { secret: ... })`"); } if (metrics.config.test) { query_params.test = 1; } request_options.path = metrics.config.path + endpoint + "?" + new URLSearchParams(query_params).toString(); fetch(request_base + request_options.path, { method, headers: request_options.headers, body: method !== 'GET' ? content : null }).then(res => { return res.text(); }).then(text => { var e; if (metrics.config.verbose) { try { var result = JSON.parse(text); if (result.status != 1) { e = new Error("Mixpanel Server Error: " + result.error); } } catch (ex) { e = new Error("Could not parse response from Mixpanel"); } } else { e = text !== '1' ? new Error("Mixpanel Server Error: " + text) : undefined; } callback(e); }).catch(e => { console.log('error', e); if (metrics.config.debug) { console.log("Got Error: " + e.message); } callback(e); }); }; /** * Send an event to Mixpanel, using the specified endpoint (e.g., track/import) * @param {string} endpoint - API endpoint name * @param {string} event - event name * @param {object} properties - event properties * @param {Function} [callback] - callback for request completion/error */ metrics.send_event_request = function (endpoint, event, properties, callback) { properties.token = metrics.token; properties.mp_lib = "node"; var data = { event: event, properties: properties }; if (metrics.config.debug) { console.log("Sending the following event to Mixpanel:\n", data); } metrics.send_request({ method: "GET", endpoint: endpoint, data: data }, callback); }; /** * breaks array into equal-sized chunks, with the last chunk being the remainder * @param {Array} arr * @param {number} size * @returns {Array} */ var chunk = function (arr, size) { var chunks = [], i = 0, total = arr.length; while (i < total) { chunks.push(arr.slice(i, i += size)); } return chunks; }; /** * sends events in batches * @param {object} options * @param {[{}]} options.event_list array of event objects * @param {string} options.endpoint e.g. `/track` or `/import` * @param {number} [options.max_concurrent_requests] limits concurrent async requests over the network * @param {number} [options.max_batch_size] limits number of events sent to mixpanel per request * @param {Function} [callback] callback receives array of errors if any * */ var send_batch_requests = function (options, callback) { var event_list = options.event_list, endpoint = options.endpoint, max_batch_size = options.max_batch_size ? Math.min(MAX_BATCH_SIZE, options.max_batch_size) : MAX_BATCH_SIZE, // to maintain original intention of max_batch_size; if max_batch_size is greater than 50, we assume the user is trying to set max_concurrent_requests max_concurrent_requests = options.max_concurrent_requests || options.max_batch_size > MAX_BATCH_SIZE && Math.ceil(options.max_batch_size / MAX_BATCH_SIZE), event_batches = chunk(event_list, max_batch_size), request_batches = max_concurrent_requests ? chunk(event_batches, max_concurrent_requests) : [event_batches], total_event_batches = event_batches.length, total_request_batches = request_batches.length; /** * sends a batch of events to mixpanel through http api * @param {Array} batch * @param {Function} cb */ function send_event_batch(batch, cb) { if (batch.length > 0) { batch = batch.map(function (event) { var properties = event.properties; if (endpoint === '/import' || event.properties.time) { // usually there will be a time property, but not required for `/track` endpoint event.properties.time = ensure_timestamp(event.properties.time); } event.properties.token = event.properties.token || metrics.token; return event; }); // must be a POST metrics.send_request({ method: "POST", endpoint: endpoint, data: batch }, cb); } } /** * Asynchronously sends batches of requests * @param {number} index */ function send_next_request_batch(index) { var request_batch = request_batches[index], cb = function (errors, results) { index += 1; if (index === total_request_batches) { callback && callback(errors, results); } else { send_next_request_batch(index); } }; async_all(request_batch, send_event_batch, cb); } // init recursive function send_next_request_batch(0); if (metrics.config.debug) { console.log("Sending " + event_list.length + " events to Mixpanel in " + total_event_batches + " batches of events and " + total_request_batches + " batches of requests"); } }; /** track(event, properties, callback) --- this function sends an event to mixpanel. event:string the event name properties:object additional event properties to send callback:function(err:Error) callback is called when the request is finished or an error occurs */ metrics.track = function (event, properties, callback) { if (!properties || typeof properties === "function") { callback = properties; properties = {}; } // time is optional for `track` but must be less than 5 days old if set if (properties.time) { properties.time = ensure_timestamp(properties.time); if (properties.time < Date.now() / 1000 - TRACK_AGE_LIMIT) { throw new Error("`track` not allowed for event more than 5 days old; use `mixpanel.import()`"); } } metrics.send_event_request("/track", event, properties, callback); }; /** * send a batch of events to mixpanel `track` endpoint: this should only be used if events are less than 5 days old * @param {Array} event_list array of event objects to track * @param {object} [options] * @param {number} [options.max_concurrent_requests] number of concurrent http requests that can be made to mixpanel * @param {number} [options.max_batch_size] number of events that can be sent to mixpanel per request * @param {Function} [callback] callback receives array of errors if any */ metrics.track_batch = function (event_list, options, callback) { options = options || {}; if (typeof options === 'function') { callback = options; options = {}; } var batch_options = { event_list: event_list, endpoint: "/track", max_concurrent_requests: options.max_concurrent_requests, max_batch_size: options.max_batch_size }; send_batch_requests(batch_options, callback); }; /** import(event, time, properties, callback) --- This function sends an event to mixpanel using the import endpoint. The time argument should be either a Date or Number, and should signify the time the event occurred. It is highly recommended that you specify the distinct_id property for each event you import, otherwise the events will be tied to the IP address of the sending machine. For more information look at: https://mixpanel.com/docs/api-documentation/importing-events-older-than-31-days event:string the event name time:date|number the time of the event properties:object additional event properties to send callback:function(err:Error) callback is called when the request is finished or an error occurs */ metrics.import = function (event, time, properties, callback) { if (!properties || typeof properties === "function") { callback = properties; properties = {}; } properties.time = ensure_timestamp(time); metrics.send_event_request("/import", event, properties, callback); }; /** import_batch(event_list, options, callback) --- This function sends a list of events to mixpanel using the import endpoint. The format of the event array should be: [ { "event": "event name", "properties": { "time": new Date(), // Number or Date; required for each event "key": "val", ... } }, { "event": "event name", "properties": { "time": new Date() // Number or Date; required for each event } }, ... ] See import() for further information about the import endpoint. Options: max_batch_size: the maximum number of events to be transmitted over the network simultaneously. useful for capping bandwidth usage. max_concurrent_requests: the maximum number of concurrent http requests that can be made to mixpanel; also useful for capping bandwidth. N.B.: the Mixpanel API only accepts 50 events per request, so regardless of max_batch_size, larger lists of events will be chunked further into groups of 50. event_list:array list of event names and properties options:object optional batch configuration callback:function(error_list:array) callback is called when the request is finished or an error occurs */ metrics.import_batch = function (event_list, options, callback) { var batch_options; if (typeof options === "function" || !options) { callback = options; options = {}; } batch_options = { event_list: event_list, endpoint: "/import", max_concurrent_requests: options.max_concurrent_requests, max_batch_size: options.max_batch_size }; send_batch_requests(batch_options, callback); }; /** alias(distinct_id, alias) --- This function creates an alias for distinct_id For more information look at: https://mixpanel.com/docs/integration-libraries/using-mixpanel-alias distinct_id:string the current identifier alias:string the future alias */ metrics.alias = function (distinct_id, alias, callback) { var properties = { distinct_id: distinct_id, alias: alias }; metrics.track('$create_alias', properties, callback); }; metrics.identify = function (identified_id, anon_id, callback) { var properties = { distinct_id: identified_id, $identified_id: identified_id, $anon_id: anon_id }; metrics.track('$identify', properties, callback); }; metrics.groups = new MixpanelGroups(metrics); metrics.people = new MixpanelPeople(metrics); /** set_config(config) --- Modifies the mixpanel config config:object an object with properties to override in the mixpanel client config */ metrics.set_config = function (config) { Object.assign(metrics.config, config); if (config.host) { // Split host into host and port const _config$host$split = config.host.split(':'), _config$host$split2 = _slicedToArray(_config$host$split, 2), host = _config$host$split2[0], port = _config$host$split2[1]; metrics.config.host = host; if (port) { metrics.config.port = Number(port); } } }; if (config) { metrics.set_config(config); } return metrics; }; // module exporting module.exports = { Client: function (token) { console.warn("The function `Client(token)` is deprecated. It is now called `init(token)`."); return create_client(token); }, init: create_client }; /***/ }), /***/ "./node_modules/@jlongster/mixpanel/lib/people.js": /*!********************************************************!*\ !*** ./node_modules/@jlongster/mixpanel/lib/people.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } const _require = __webpack_require__(/*! ./profile_helpers */ "./node_modules/@jlongster/mixpanel/lib/profile_helpers.js"), merge_modifiers = _require.merge_modifiers, ProfileHelpers = _require.ProfileHelpers; class MixpanelPeople extends ProfileHelpers() { constructor(mp_instance) { super(); this.mixpanel = mp_instance; this.endpoint = '/engage'; } /** people.set_once(distinct_id, prop, to, modifiers, callback) --- The same as people.set but in the words of mixpanel: mixpanel.people.set_once " This method allows you to set a user attribute, only if it is not currently set. It can be called multiple times safely, so is perfect for storing things like the first date you saw a user, or the referrer that brought them to your website for the first time. " */ set_once(distinct_id, prop, to, modifiers, callback) { const identifiers = { $distinct_id: distinct_id }; this._set(prop, to, modifiers, callback, { identifiers, set_once: true }); } /** people.set(distinct_id, prop, to, modifiers, callback) --- set properties on an user record in engage usage: mixpanel.people.set('bob', 'gender', 'm'); mixpanel.people.set('joe', { 'company': 'acme', 'plan': 'premium' }); */ set(distinct_id, prop, to, modifiers, callback) { const identifiers = { $distinct_id: distinct_id }; this._set(prop, to, modifiers, callback, { identifiers }); } /** people.increment(distinct_id, prop, by, modifiers, callback) --- increment/decrement properties on an user record in engage usage: mixpanel.people.increment('bob', 'page_views', 1); // or, for convenience, if you're just incrementing a counter by 1, you can // simply do mixpanel.people.increment('bob', 'page_views'); // to decrement a counter, pass a negative number mixpanel.people.increment('bob', 'credits_left', -1); // like mixpanel.people.set(), you can increment multiple properties at once: mixpanel.people.increment('bob', { counter1: 1, counter2: 3, counter3: -2 }); */ increment(distinct_id, prop, by, modifiers, callback) { // TODO extract to ProfileHelpers var $add = {}; if (typeof prop === 'object') { if (typeof by === 'object') { callback = modifiers; modifiers = by; } else { callback = by; } for (const _ref of Object.entries(prop)) { var _ref2 = _slicedToArray(_ref, 2); const key = _ref2[0]; const val = _ref2[1]; if (isNaN(parseFloat(val))) { if (this.mixpanel.config.debug) { console.error("Invalid increment value passed to mixpanel.people.increment - must be a number"); console.error("Passed " + key + ":" + val); } } else { $add[key] = val; } } ; } else { if (typeof by === 'number' || !by) { by = by || 1; $add[prop] = by; if (typeof modifiers === 'function') { callback = modifiers; } } else if (typeof by === 'function') { callback = by; $add[prop] = 1; } else { callback = modifiers; modifiers = typeof by === 'object' ? by : {}; $add[prop] = 1; } } var data = { '$add': $add, '$token': this.mixpanel.token, '$distinct_id': distinct_id }; data = merge_modifiers(data, modifiers); if (this.mixpanel.config.debug) { console.log("Sending the following data to Mixpanel (Engage):"); console.log(data); } this.mixpanel.send_request({ method: "GET", endpoint: "/engage", data: data }, callback); } /** people.append(distinct_id, prop, value, modifiers, callback) --- Append a value to a list-valued people analytics property. usage: // append a value to a list, creating it if needed mixpanel.people.append('bob', 'pages_visited', 'homepage'); // like mixpanel.people.set(), you can append multiple properties at once: mixpanel.people.append('bob', { list1: 'bob', list2: 123 }); */ append(distinct_id, prop, value, modifiers, callback) { // TODO extract to ProfileHelpers var $append = {}; if (typeof prop === 'object') { if (typeof value === 'object') { callback = modifiers; modifiers = value; } else { callback = value; } Object.keys(prop).forEach(function (key) { $append[key] = prop[key]; }); } else { $append[prop] = value; if (typeof modifiers === 'function') { callback = modifiers; } } var data = { '$append': $append, '$token': this.mixpanel.token, '$distinct_id': distinct_id }; data = merge_modifiers(data, modifiers); if (this.mixpanel.config.debug) { console.log("Sending the following data to Mixpanel (Engage):"); console.log(data); } this.mixpanel.send_request({ method: "GET", endpoint: "/engage", data: data }, callback); } /** people.track_charge(distinct_id, amount, properties, modifiers, callback) --- Record that you have charged the current user a certain amount of money. usage: // charge a user $29.99 mixpanel.people.track_charge('bob', 29.99); // charge a user $19 on the 1st of february mixpanel.people.track_charge('bob', 19, { '$time': new Date('feb 1 2012') }); */ track_charge(distinct_id, amount, properties, modifiers, callback) { if (typeof properties === 'function' || !properties) { callback = properties || function () {}; properties = {}; } else { if (typeof modifiers === 'function' || !modifiers) { callback = modifiers || function () {}; if (properties.$ignore_time || properties.hasOwnProperty("$ip")) { modifiers = {}; Object.keys(properties).forEach(function (key) { modifiers[key] = properties[key]; delete properties[key]; }); } } } if (typeof amount !== 'number') { amount = parseFloat(amount); if (isNaN(amount)) { console.error("Invalid value passed to mixpanel.people.track_charge - must be a number"); return; } } properties.$amount = amount; if (properties.hasOwnProperty('$time')) { var time = properties.$time; if (Object.prototype.toString.call(time) === '[object Date]') { properties.$time = time.toISOString(); } } var data = { '$append': { '$transactions': properties }, '$token': this.mixpanel.token, '$distinct_id': distinct_id }; data = merge_modifiers(data, modifiers); if (this.mixpanel.config.debug) { console.log("Sending the following data to Mixpanel (Engage):"); console.log(data); } this.mixpanel.send_request({ method: "GET", endpoint: "/engage", data: data }, callback); } /** people.clear_charges(distinct_id, modifiers, callback) --- Clear all the current user's transactions. usage: mixpanel.people.clear_charges('bob'); */ clear_charges(distinct_id, modifiers, callback) { var data = { '$set': { '$transactions': [] }, '$token': this.mixpanel.token, '$distinct_id': distinct_id }; if (typeof modifiers === 'function') { callback = modifiers; } data = merge_modifiers(data, modifiers); if (this.mixpanel.config.debug) { console.log("Clearing this user's charges:", distinct_id); } this.mixpanel.send_request({ method: "GET", endpoint: "/engage", data: data }, callback); } /** people.delete_user(distinct_id, modifiers, callback) --- delete an user record in engage usage: mixpanel.people.delete_user('bob'); */ delete_user(distinct_id, modifiers, callback) { const identifiers = { $distinct_id: distinct_id }; this._delete_profile({ identifiers, modifiers, callback }); } /** people.remove(distinct_id, data, modifiers, callback) --- remove a value from a list-valued user profile property. usage: mixpanel.people.remove('bob', {'browsers': 'firefox'}); mixpanel.people.remove('bob', {'browsers': 'chrome', 'os': 'linux'}); */ remove(distinct_id, data, modifiers, callback) { const identifiers = { '$distinct_id': distinct_id }; this._remove({ identifiers, data, modifiers, callback }); } /** people.union(distinct_id, data, modifiers, callback) --- merge value(s) into a list-valued people analytics property. usage: mixpanel.people.union('bob', {'browsers': 'firefox'}); mixpanel.people.union('bob', {'browsers': ['chrome'], os: ['linux']}); */ union(distinct_id, data, modifiers, callback) { const identifiers = { $distinct_id: distinct_id }; this._union({ identifiers, data, modifiers, callback }); } /** people.unset(distinct_id, prop, modifiers, callback) --- delete a property on an user record in engage usage: mixpanel.people.unset('bob', 'page_views'); mixpanel.people.unset('bob', ['page_views', 'last_login']); */ unset(distinct_id, prop, modifiers, callback) { const identifiers = { $distinct_id: distinct_id }; this._unset({ identifiers, prop, modifiers, callback }); } } ; exports.MixpanelPeople = MixpanelPeople; /***/ }), /***/ "./node_modules/@jlongster/mixpanel/lib/profile_helpers.js": /*!*****************************************************************!*\ !*** ./node_modules/@jlongster/mixpanel/lib/profile_helpers.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /** * Mixin with profile-related helpers (for people and groups) */ const _require = __webpack_require__(/*! ./utils */ "./node_modules/@jlongster/mixpanel/lib/utils.js"), ensure_timestamp = _require.ensure_timestamp; function merge_modifiers(data, modifiers) { if (modifiers) { if (modifiers.$ignore_alias) { data.$ignore_alias = modifiers.$ignore_alias; } if (modifiers.$ignore_time) { data.$ignore_time = modifiers.$ignore_time; } if (modifiers.hasOwnProperty("$ip")) { data.$ip = modifiers.$ip; } if (modifiers.hasOwnProperty("$time")) { data.$time = ensure_timestamp(modifiers.$time); } } return data; } ; exports.merge_modifiers = merge_modifiers; exports.ProfileHelpers = (Base = Object) => class extends Base { get token() { return this.mixpanel.token; } get config() { return this.mixpanel.config; } _set(prop, to, modifiers, callback, { identifiers, set_once = false }) { let $set = {}; if (typeof prop === 'object') { if (typeof to === 'object') { callback = modifiers; modifiers = to; } else { callback = to; } $set = prop; } else { $set[prop] = to; if (typeof modifiers === 'function' || !modifiers) { callback = modifiers; } } let data = _objectSpread({ '$token': this.token }, identifiers); const set_key = set_once ? "$set_once" : "$set"; data[set_key] = $set; if ('ip' in $set) { data.$ip = $set.ip; delete $set.ip; } if ($set.$ignore_time) { data.$ignore_time = $set.$ignore_time; delete $set.$ignore_time; } data = merge_modifiers(data, modifiers); if (this.config.debug) { console.log(`Sending the following data to Mixpanel (${this.endpoint}):`); console.log(data); } this.mixpanel.send_request({ method: "GET", endpoint: this.endpoint, data }, callback); } _delete_profile({ identifiers, modifiers, callback }) { let data = _objectSpread({ '$delete': '', '$token': this.token }, identifiers); if (typeof modifiers === 'function') { callback = modifiers; } data = merge_modifiers(data, modifiers); if (this.config.debug) { console.log(`Deleting profile ${JSON.stringify(identifiers)}`); } this.mixpanel.send_request({ method: "GET", endpoint: this.endpoint, data }, callback); } _remove({ identifiers, data, modifiers, callback }) { let $remove = {}; if (typeof data !== 'object' || Array.isArray(data)) { if (this.config.debug) { console.error("Invalid value passed to #remove - data must be an object with scalar values"); } return; } for (const _ref of Object.entries(data)) { var _ref2 = _slicedToArray(_ref, 2); const key = _ref2[0]; const val = _ref2[1]; if (typeof val === 'string' || typeof val === 'number') { $remove[key] = val; } else { if (this.config.debug) { console.error("Invalid argument passed to #remove - values must be scalar"); console.error("Passed " + key + ':', val); } return; } } if (Object.keys($remove).length === 0) { return; } data = _objectSpread({ '$remove': $remove, '$token': this.token }, identifiers); if (typeof modifiers === 'function') { callback = modifiers; } data = merge_modifiers(data, modifiers); if (this.config.debug) { console.log(`Sending the following data to Mixpanel (${this.endpoint}):`); console.log(data); } this.mixpanel.send_request({ method: "GET", endpoint: this.endpoint, data }, callback); } _union({ identifiers, data, modifiers, callback }) { let $union = {}; if (typeof data !== 'object' || Array.isArray(data)) { if (this.config.debug) { console.error("Invalid value passed to #union - data must be an object with scalar or array values"); } return; } for (const _ref3 of Object.entries(data)) { var _ref4 = _slicedToArray(_ref3, 2); const key = _ref4[0]; const val = _ref4[1]; if (Array.isArray(val)) { var merge_values = val.filter(function (v) { return typeof v === 'string' || typeof v === 'number'; }); if (merge_values.length > 0) { $union[key] = merge_values; } } else if (typeof val === 'string' || typeof val === 'number') { $union[key] = [val]; } else { if (this.config.debug) { console.error("Invalid argument passed to #union - values must be a scalar value or array"); console.error("Passed " + key + ':', val); } } } if (Object.keys($union).length === 0) { return; } data = _objectSpread({ '$union': $union, '$token': this.token }, identifiers); if (typeof modifiers === 'function') { callback = modifiers; } data = merge_modifiers(data, modifiers); if (this.config.debug) { console.log(`Sending the following data to Mixpanel (${this.endpoint}):`); console.log(data); } this.mixpanel.send_request({ method: "GET", endpoint: this.endpoint, data }, callback); } _unset({ identifiers, prop, modifiers, callback }) { let $unset = []; if (Array.isArray(prop)) { $unset = prop; } else if (typeof prop === 'string') { $unset = [prop]; } else { if (this.config.debug) { console.error("Invalid argument passed to #unset - must be a string or array"); console.error("Passed: " + prop); } return; } let data = _objectSpread({ '$unset': $unset, '$token': this.token }, identifiers); if (typeof modifiers === 'function') { callback = modifiers; } data = merge_modifiers(data, modifiers); if (this.config.debug) { console.log(`Sending the following data to Mixpanel (${this.endpoint}):`); console.log(data); } this.mixpanel.send_request({ method: "GET", endpoint: this.endpoint, data }, callback); } }; /***/ }), /***/ "./node_modules/@jlongster/mixpanel/lib/utils.js": /*!*******************************************************!*\ !*** ./node_modules/@jlongster/mixpanel/lib/utils.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { /** * helper to wait for all callbacks to complete; similar to `Promise.all` * exposed to metrics object for unit tests * @param {Array} requests * @param {Function} handler * @param {Function} callback */ exports.async_all = function (requests, handler, callback) { var total = requests.length, errors = null, results = [], done = function (err, result) { if (err) { // errors are `null` unless there is an error, which allows for promisification errors = errors || []; errors.push(err); } results.push(result); if (--total === 0) { callback(errors, results); } }; if (total === 0) { callback(errors, results); } else { for (var i = 0, l = requests.length; i < l; i++) { handler(requests[i], done); } } }; /** * Validate type of time property, and convert to Unix timestamp if necessary * @param {Date|number} time - value to check * @returns {number} Unix timestamp */ exports.ensure_timestamp = function (time) { if (!(time instanceof Date || typeof time === "number")) { throw new Error("`time` property must be a Date or Unix timestamp and is only required for `import` endpoint"); } return time instanceof Date ? Math.floor(time.getTime() / 1000) : time; }; /***/ }), /***/ "./node_modules/@rschedule/core/es2015/generators.js": /*!***********************************************************!*\ !*** ./node_modules/@rschedule/core/es2015/generators.js ***! \***********************************************************/ /*! exports provided: AddOperator, Calendar, Collection, CollectionIterator, Dates, IntersectionOperator, MergeDurationOperator, MergeDurationOperatorError, OccurrenceGenerator, OccurrenceIterator, Operator, Rule, RuleBase, Schedule, ScheduleBase, SplitDurationOperator, SplitDurationOperatorError, SubtractOperator, UniqueOperator, add, intersection, mergeDuration, splitDuration, subtract, unique */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AddOperator", function() { return AddOperator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Calendar", function() { return Calendar; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Collection", function() { return Collection; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CollectionIterator", function() { return CollectionIterator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Dates", function() { return Dates; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IntersectionOperator", function() { return IntersectionOperator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MergeDurationOperator", function() { return MergeDurationOperator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MergeDurationOperatorError", function() { return MergeDurationOperatorError; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OccurrenceGenerator", function() { return OccurrenceGenerator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OccurrenceIterator", function() { return OccurrenceIterator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Operator", function() { return Operator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Rule", function() { return Rule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RuleBase", function() { return RuleBase; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Schedule", function() { return Schedule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScheduleBase", function() { return ScheduleBase; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SplitDurationOperator", function() { return SplitDurationOperator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SplitDurationOperatorError", function() { return SplitDurationOperatorError; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SubtractOperator", function() { return SubtractOperator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UniqueOperator", function() { return UniqueOperator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "intersection", function() { return intersection; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeDuration", function() { return mergeDuration; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "splitDuration", function() { return splitDuration; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return subtract; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unique", function() { return unique; }); /* harmony import */ var _rschedule_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rschedule/core */ "./node_modules/@rschedule/core/es2015/main.js"); class OccurrenceGenerator { constructor(args = {}) { this.timezone = args.timezone !== undefined ? args.timezone : null; this.maxDuration = args.maxDuration || 0; } /** Returns the first occurrence or, if there are no occurrences, null. */ get firstDate() { if (this._firstDate !== undefined) return this._firstDate; const start = this._run().next().value; this._firstDate = start ? this.dateAdapter.fromDateTime(start) : null; return this._firstDate; } /** If generator is infinite, returns `null`. Otherwise returns the end date */ get lastDate() { if (this._lastDate !== undefined) return this._lastDate; if (this.isInfinite) { this._lastDate = null; return null; } const end = this._run({ reverse: true }).next().value; this._lastDate = end ? this.dateAdapter.fromDateTime(end) : null; return this._lastDate; } pipe(...operators) { return operators.reduce((prev, curr) => curr({ base: prev, timezone: this.timezone }), this); } /** * Processes the object's rules/dates and returns an iterable for the occurrences. * * Options object: * - `start` the date to begin iteration on * - `end` the date to end iteration on * - `take` the max number of dates to take before ending iteration * - `reverse` whether to iterate in reverse or not * * Examples: * * ``` * const iterator = schedule.occurrences({ start: new Date(), take: 5 }); * for (const date of iterator) { * // do stuff * } * iterator.toArray() // returns Date array * iterator.next().value // returns next Date * ``` * */ occurrences(args = {}) { return new OccurrenceIterator(this, this.normalizeOccurrencesArgs(args)); } /** * Iterates over the object's occurrences and bundles them into collections * with a specified granularity (default is `"YEARLY"`). Make sure to * read about each option & combination of options below. * * Options object: * - start?: DateAdapter * - end?: DateAdapter * - take?: number * - reverse?: NOT SUPPORTED * - granularity?: CollectionsGranularity * - weekStart?: DateAdapter.Weekday * - skipEmptyPeriods?: boolean * * Returned `Collection` object: * * - `dates` property containing an array of DateAdapter objects. * - `granularity` property containing the granularity. * - `CollectionsGranularity` === `RuleOptions.Frequency`. * - default is `"YEARLY"` * - `periodStart` property containing a DateAdapter equal to the period's * start time. * - `periodEnd` property containing a DateAdapter equal to the period's * end time. * * #### Details: * * `collections()` always returns full periods. This means that the `start` argument is * transformed to be the start of whatever period the `start` argument is in, and the * `end` argument is transformed to be the end of whatever period the `end` argument is * in. * * - Example: with granularity `"YEARLY"`, the `start` argument will be transformed to be the * start of the year passed in the `start` argument, and the `end` argument will be transformed * to be the end of the year passed in the `end` argument. * * By default, the `periodStart` value of `Collection` objects produced by this method increments linearly. * This means the returned `Collection#dates` property may have length 0. This can be changed by * passing the `skipEmptyPeriods: true` option, in which case the `periodStart` from one collection to the * next can "jump". * * - Example 1: if your object's first occurrence is 2019/2/1 (February 1st) and you call * `collection({skipEmptyPeriods: true, granularity: 'DAILY', start: new Date(2019,0,1)})` * (so starting on January 1st), the first Collection produced will have a `periodStart` in February. * * - Example 2: if your object's first occurrence is 2019/2/1 (February 1st) and you call * `collection({granularity: 'DAILY', start: new Date(2019,0,1)})` * (so starting on January 1st), the first collection produced will have a `Collection#periodStart` * of January 1st and have `Collection#dates === []`. Similarly, the next 30 collections produced * (Jan 2nd - 31st) will all contain an empty array for the `dates` property. Then the February 1st * `Collection` will contain dates. * * When giving a `take` argument to `collections()`, you are specifying * the number of `Collection` objects to return (rather than occurrences). * * When choosing a granularity of `"WEEKLY"`, the `weekStart` option is required. * * When choosing a granularity of `"MONTHLY"`: * * - If the `weekStart` option *is not* present, will generate collections with * the `periodStart` and `periodEnd` at the beginning and end of each month. * * - If the `weekStart` option *is* present, will generate collections with the * `periodStart` equal to the start of the first week of the month, and the * `periodEnd` equal to the end of the last week of the month. This behavior could be * desired when rendering opportunities in a calendar view, where the calendar renders * full weeks (which may result in the calendar displaying dates in the * previous or next months). * */ collections(args = {}) { return new CollectionIterator(this, this.normalizeCollectionsArgs(args)); } /** * Returns true if an occurrence starts on or between the provided start/end * datetimes. If the `excludeEnds` option is provided, then occurrences * equal to the start/end times are ignored. * * If the occurrence generator has a duration, and `excludeEnds !== true`, * and a `maxDuration` argument is supplied (either in the constructor or * here), then any occurrence that's time overlaps with the start/end times * return true. */ occursBetween(startInput, endInput, options = {}) { const start = this.normalizeDateInput(startInput); const end = this.normalizeDateInput(endInput); if (this.hasDuration && !options.excludeEnds) { const maxDuration = this.getMaxDuration('occursBetween', options); const iterator = this._run({ start: start.subtract(maxDuration, 'millisecond'), end, reverse: true }); for (const day of iterator) { if (day.end.isBefore(start)) continue; return true; } return false; } for (const day of this._run({ start, end })) { if (options.excludeEnds) { if (day.isEqual(start)) { continue; } if (day.isEqual(end)) { break; } } return true; } return false; } occursOn(rawArgs) { const args = this.normalizeOccursOnArgs(rawArgs); if (args.weekday) { if (this.isInfinite && !args.before) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["ArgumentError"]('When calling `occursOn()` with a `weekday` argument ' + 'and an occurrence object that has infinite occurrences, ' + 'you must include a `before` argument as well.'); } const start = args.after && (args.excludeEnds ? args.after.add(1, 'day') : args.after); const end = args.before && (args.excludeEnds ? args.before.subtract(1, 'day') : args.before); const iterator = this._run({ start, end }); let date = iterator.next().value; if (!date) return false; while (date) { if (date.get('weekday') === args.weekday) { return true; } date = iterator.next({ skipToDate: date.add(Object(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["getDifferenceBetweenWeekdays"])(date.get('weekday'), args.weekday), 'day').granularity('day') }).value; } return false; } if (!args.date) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["ArgumentError"](`"occursOn()" must be called with either a "date" or "weekday" argument`); } if (this.hasDuration) { const maxDuration = this.getMaxDuration('occursOn', args); const iterator = this._run({ start: args.date.subtract(maxDuration, 'millisecond'), end: args.date }); for (const date of iterator) { if (date.end.isBefore(args.date)) continue; if (date.isAfter(args.date)) return false; return true; } return false; } for (const day of this._run({ start: args.date, end: args.date })) { return !!day; } return false; } /** * Returns true if an occurrence starts after the provided datetime. * If the `excludeStart` option is provided, then occurrences * equal to the provided datetime are ignored. * * If the occurrence generator has a duration, and `excludeStart !== true`, * and a `maxDuration` argument is supplied (either in the constructor or * here), then any occurrence that's end time is after/equal to the provided * datetime return true. */ occursAfter(date, options = {}) { const adapter = this.normalizeDateInput(date); if (this.hasDuration && !options.excludeStart) { const maxDuration = this.getMaxDuration('occursAfter', options); const iterator = this._run({ start: adapter.subtract(maxDuration, 'millisecond') }); for (const date of iterator) { if (date.end.isBefore(adapter)) continue; return true; } return false; } for (const day of this._run({ start: adapter })) { if (options.excludeStart && day.isEqual(adapter)) { continue; } return true; } return false; } /** * Returns true if an occurrence starts before the provided datetime. * If the `excludeStart` option is provided, then occurrences * equal to the provided datetime are ignored. * * If the occurrence generator has a duration, and `excludeStart` is * also provided, then this will only return true if an occurrence * both starts and ends before the provided datetime. */ occursBefore(date, options = {}) { const adapter = this.normalizeDateInput(date); if (this.hasDuration && options.excludeStart) { for (const day of this._run({ end: adapter, reverse: true })) { if (day.end.isAfterOrEqual(adapter)) continue; return true; } return false; } for (const day of this._run({ end: adapter, reverse: true })) { if (options.excludeStart && day.isEqual(adapter)) { continue; } return true; } return false; } get dateAdapter() { return _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["DateAdapterBase"].adapter; } normalizeOccurrencesArgs(rawArgs) { return Object.assign(Object.assign({}, rawArgs), { start: this.normalizeDateInput(rawArgs.start), end: this.normalizeDateInput(rawArgs.end) }); } normalizeCollectionsArgs(rawArgs) { if (rawArgs.reverse !== undefined) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["ArgumentError"]('`collections()` does not support the `reverse` option at this time.'); } return Object.assign(Object.assign({}, rawArgs), { start: this.normalizeDateInput(rawArgs.start), end: this.normalizeDateInput(rawArgs.end) }); } normalizeOccursOnArgs(rawArgs = {}) { return Object.assign(Object.assign({}, rawArgs), { date: this.normalizeDateInput(rawArgs.date), after: this.normalizeDateInput(rawArgs.after), before: this.normalizeDateInput(rawArgs.before), excludeDates: rawArgs.excludeDates && rawArgs.excludeDates.map(date => this.normalizeDateInput(date)) }); } normalizeRunArgs(args) { return Object.assign(Object.assign({}, args), { start: this.normalizeDateInput(args.start), end: this.normalizeDateInput(args.end) }); } normalizeDateInput(date) { return date ? Object(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["dateInputToDateTime"])(date, this.timezone) : undefined; } normalizeDateInputToAdapter(date) { if (!date) return; return Object(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["dateInputToDateAdapter"])(date); } normalizeRunOutput(date) { return Object(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["normalizeDateTimeTimezone"])(date, this.timezone); } getMaxDuration(method, options) { const maxDuration = options.maxDuration || this.maxDuration; if (!Number.isInteger(maxDuration)) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["ArgumentError"](`When an occurrence generator ` + `has a duration, a 'maxDuration' argument must be supplied ` + `to ${method}().`); } return maxDuration; } } class OccurrenceIterator { constructor(iterable, args) { this.iterable = iterable; this.args = args; // Need to assert the return type of these methods to prevent typescript from // incorrectly reducing them to `DateAdapterBase & { generators: G }`. this[Symbol.iterator] = () => this.occurrenceIterator(); this.iterator = iterable._run(args); this.isInfinite = iterable.isInfinite; } next(args) { return this.occurrenceIterator(args).next(); } toArray() { if (this.args.end || this.args.take || !this.isInfinite) { return Array.from(this.occurrenceIterator()); } throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["InfiniteLoopError"]('OccurrenceIterator#toArray() can only be called if the iterator ' + 'is not infinite, or you provide and `end` argument, or you provide ' + 'a `take` argument.'); } *occurrenceIterator(rawArgs) { let args = this.normalizeRunArgs(rawArgs); let date = this.iterator.next(args).value; while (date) { const yieldArgs = yield this.normalizeDateOutput(date); args = this.normalizeRunArgs(yieldArgs); date = this.iterator.next(args).value; } return undefined; } normalizeRunArgs(args) { return { skipToDate: this.normalizeDateInput(args && args.skipToDate) }; } normalizeDateInput(date) { return date ? Object(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["dateInputToDateTime"])(date, this.iterable.timezone) : undefined; } normalizeDateOutput(date) { if (!date) return; return date ? _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["DateAdapterBase"].adapter.fromDateTime(date) : undefined; } } class Collection { constructor(dates = [], granularity, periodStart, periodEnd) { this.dates = dates; this.granularity = granularity; this.periodStart = periodStart; this.periodEnd = periodEnd; } } class CollectionIterator { constructor(iterable, args) { this.iterable = iterable; this.args = args; this.granularity = 'year'; this[Symbol.iterator] = () => this.iterator; if (args.granularity) { this.granularity = args.granularity; if (this.granularity === 'week' && !args.weekStart) { throw new Error('"week" granularity requires `weekStart` arg'); } } if (args.weekStart) { this.weekStart = args.weekStart; } if (args.reverse) { throw new Error('`OccurrenceGenerator#collections()` does not support iterating in reverse. ' + 'Though `OccurrenceGenerator#occurrences()` does support iterating in reverse.'); } // Set the end arg, if present, to the end of the period. this.args = Object.assign(Object.assign({}, args), { start: args.start || iterable._run().next().value, end: args.end && this.getPeriod(args.end).end }); this.startDate = this.args.start && this.normalizeDateOutput(this.getPeriod(this.args.start).start) || null; this.iterator = this.collectionIterator(); } next() { return this.iterator.next(); } /** * While `next()` and `[Symbol.iterator]` both share state, * `toArray()` does not share state and always returns the whole * collections array. */ toArray() { if (this.args.end || this.args.take || !this.iterable.isInfinite) { const collections = []; for (const collection of this.collectionIterator()) { collections.push(collection); } return collections; } throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["InfiniteLoopError"]('CollectionIterator#toArray() can only be called if the iterator ' + 'is not infinite, or you provide and `end` argument, or you provide ' + 'a `take` argument.'); } normalizeDateOutput(date) { if (!date) return; return _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["DateAdapterBase"].adapter.fromDateTime(date); } *collectionIterator() { if (!this.startDate) return; let iterator = this.occurrenceIterator(); let date = iterator.next().value; if (!date) return; // `period` === `periodStart` unless the granularity // is `MONTHLY` and a `weekStart` param was provided. In this case, // period holds a date === the first of the current month while // periodStart holds a date === the beginning of the first week of the month // (which might be in the the previous month). Read the // `OccurrenceGenerator#collections()` description for more info. let period = this.getPeriod(this.args.start); let dates = []; let index = 0; while (date && (this.args.take === undefined || this.args.take > index)) { while (date && date.isBeforeOrEqual(period.end)) { dates.push(date); date = iterator.next().value; } yield new Collection(dates.map(date => this.normalizeDateOutput(date)), this.granularity, this.normalizeDateOutput(period.start), this.normalizeDateOutput(period.end)); if (!date) return; dates = []; period = !this.args.skipEmptyPeriods ? this.getPeriod(this.incrementPeriod(period.period)) : this.getPeriod(date); // With these args, periods may overlap and the same date may show up // in two periods. Because of this, we need to reset the iterator // (otherwise it won't return a date it has already returned). if (this.granularity === 'month' && this.weekStart) { iterator = this.iterable._run({ start: period.start, end: this.args.end }); date = iterator.next().value; } index++; } } getPeriod(date) { let start; let end; let period; if (this.granularity === 'month' && this.weekStart) { start = date.granularity('month').granularity('week', { weekStart: this.weekStart }); end = date.endGranularity('month').endGranularity('week', { weekStart: this.weekStart }); period = date.granularity('month'); } else { start = date.granularity(this.granularity, { weekStart: this.weekStart }); end = date.endGranularity(this.granularity, { weekStart: this.weekStart }); period = start; } return { start, end, period }; } incrementPeriod(date) { return date.add(1, this.granularity); } occurrenceIterator() { let start = this.args.start || this.iterable._run().next().value; if (!start) return this.iterable._run(this.args); start = this.getPeriod(start).start; return this.iterable._run({ start, end: this.args.end }); } } class Operator extends OccurrenceGenerator { constructor(streams, config) { super(config); this.streams = streams; this.config = config; this.timezone = config.timezone; this.streams = streams.map(stream => stream instanceof Operator ? stream : stream.set('timezone', this.timezone)); this.isInfinite = this.calculateIsInfinite(); this.hasDuration = this.calculateHasDuration(); } normalizeDateInput(date) { if (!date) return; return Object(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["dateInputToDateTime"])(date, this.timezone); } normalizeRunOutput(date) { return Object(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["normalizeDateTimeTimezone"])(date, this.timezone); } } /** * Simple class that lets us access the `value`, `runArgs`, and `done` * status of an OccurrenceGenerator iterator */ class IterableWrapper { constructor(generator, runArgs) { this.runArgs = runArgs; this.stream = generator._run(this.runArgs); this.next(); } next(args) { const _this$stream$next = this.stream.next(args), done = _this$stream$next.done, value = _this$stream$next.value; this.done = typeof done === 'boolean' ? done : true; this.value = value; return { done, value }; } } function processYieldArgs(streams, options = {}, yieldArgs = {}) { if (!yieldArgs.skipToDate || streams.length === 0) return; // check for invalid `skipToDate` option if (options.reverse ? streams.every(s => s.value.isBeforeOrEqual(yieldArgs.skipToDate)) : streams.every(s => s.value.isAfterOrEqual(yieldArgs.skipToDate))) { throw new Error('A provided `skipToDate` option must be greater than the last yielded date ' + '(or smaller, in the case of reverse iteration)'); } for (const stream of streams) { if (stream.done) continue; // no point in calling `next()` if (options.reverse ? stream.value.isBeforeOrEqual(yieldArgs.skipToDate) : stream.value.isAfterOrEqual(yieldArgs.skipToDate)) { // This can happen there are two streams and one stream starts after the other finishes. // Or, when iterating in reverse, when one stream ends before the other starts. // In this case we don't want to call `next()` because it will throw an error. // In both of these cases, calling `next()` won't do anything anyway. continue; } stream.next(yieldArgs); } } /** sorts ascending with completed iterables at the end */ function streamsComparer(a, b) { if (a.done && b.done) return 0; if (a.done) return 1; if (b.done) return -1; if (a.value.isAfter(b.value)) return 1; return -1; } /** sorts descending with completed iterables at the start */ function streamsReverseComparer(a, b) { if (a.done && b.done) return 0; if (a.done) return -1; if (b.done) return 1; if (a.value.isAfter(b.value)) return -1; return 1; } function selectNextIterable(streams, options = {}, yieldArgs = {}) { processYieldArgs(streams, options, yieldArgs); return streams.sort(options.reverse ? streamsReverseComparer : streamsComparer).filter(s => !s.done).shift(); } function selectLastIterable(streams, options = {}, yieldArgs = {}) { processYieldArgs(streams, options, yieldArgs); return streams.sort(options.reverse ? streamsReverseComparer : streamsComparer).filter(s => !s.done).pop(); } /** * An operator function which accepts a spread of occurrence generators * and adds their occurrences to the output. * * @param streams a spread of occurrence generators */ function add(...streams) { return options => new AddOperator(streams, options); } class AddOperator extends Operator { set(_, value) { return new AddOperator(this.streams.map(stream => stream.set('timezone', value)), Object.assign(Object.assign({}, this.config), { base: this.config.base && this.config.base.set('timezone', value), timezone: value })); } *_run(args = {}) { const wrappedStreams = this.streams.map(input => new IterableWrapper(input, args)); if (this.config.base) { wrappedStreams.push(new IterableWrapper(this.config.base, args)); } if (wrappedStreams.length === 0) return; let stream = selectNextIterable(wrappedStreams, args); while (stream && !stream.done) { // yield the current stream's value const yieldArgs = yield this.normalizeRunOutput(stream.value); if (!(yieldArgs && yieldArgs.skipToDate)) { // iterate the current stream stream.next(); } // select the next stream stream = selectNextIterable(wrappedStreams, args, yieldArgs); } } calculateIsInfinite() { return this.config.base && this.config.base.isInfinite || this.streams.some(stream => stream.isInfinite); } calculateHasDuration() { const streamsDuration = this.streams.every(stream => stream.hasDuration); if (!this.config.base) return streamsDuration; return this.config.base.hasDuration && streamsDuration; } } class Calendar extends OccurrenceGenerator { /** * * Create a new Calendar object with the specified options. * * ### Options * * - **timezone**: The timezone that yielded occurrences should be *displayed* in. * Note, this one affects the *displayed* timezone of yielded occurrences. * For rules, occurrences are first found using the unmodified rule * config (including whatever timezone the `start` datetime is defined * in), and then converted to the timezone specified here before being * yielded. By default, the timezone is *local* time (`null`). So if you don't * want your rules to be displayed in local time, you must supply a * timezone argument. * - **data**: arbitrary data you can associate with this Calendar. This * is the only mutable property of `Calendar` objects. * - **maxDuration**: currently unused. * - **schedules**: either an occurrence generator, or an array of occurrence generators, which should * be used to build up this Calendar's occurrences. The Calendar will display the union of occurrences * its schedules produce. * */ constructor(args = {}) { super(args); this.schedules = []; this.data = args.data; if (args.schedules) { this.schedules = Array.isArray(args.schedules) ? args.schedules : [args.schedules]; this.schedules = this.schedules.map(schedule => schedule.set('timezone', this.timezone)); } this.isInfinite = this.schedules.some(schedule => schedule.isInfinite); this.hasDuration = this.schedules.every(schedule => schedule.hasDuration); } occurrences(args = {}) { return new OccurrenceIterator(this, this.normalizeOccurrencesArgs(args)); } collections(args = {}) { return new CollectionIterator(this, this.normalizeCollectionsArgs(args)); } set(prop, value, options) { if (prop === 'timezone') { return new Calendar({ schedules: this.schedules.map(schedule => schedule.set(prop, value, options)), data: this.data, timezone: value, maxDuration: this.maxDuration }); } else if (prop === 'schedules') { return new Calendar({ schedules: Array.isArray(value) ? value : [value], data: this.data, timezone: this.timezone, maxDuration: this.maxDuration }); } throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["ArgumentError"]('Unknown value for `prop`: ' + `"${prop}"`); } *_run(args = {}) { if (this.schedules.length === 0) return; const count = args.take; delete args.take; let iterator; if (this.schedules.length === 1) { iterator = this.schedules[0]._run(args); } else { iterator = new AddOperator(this.schedules, { timezone: this.timezone })._run(args); } let date = iterator.next().value; let index = 0; while (date && (count === undefined || count > index)) { date = date.add(this, 'generator'); const yieldArgs = yield this.normalizeRunOutput(date); date = iterator.next(yieldArgs).value; index++; } return undefined; } } class Dates extends OccurrenceGenerator { constructor(args = {}) { super(args); this.adapters = []; this.isInfinite = false; this.maxDuration = 0; this.datetimes = []; this.data = args.data; if (args.dates) { this.adapters = args.dates.map(date => { let adapter = this.normalizeDateInputToAdapter(date); if (args.duration && !adapter.duration) { adapter = adapter.set('duration', args.duration); } return adapter.set('timezone', this.timezone); }); this.datetimes = this.adapters.map(adapter => adapter.toDateTime()); } this.hasDuration = this.datetimes.every(date => !!date.duration); if (this.hasDuration) { this.maxDuration = this.adapters.reduce((prev, curr) => curr.duration > prev ? curr.duration : prev, 0); } } get length() { return this.adapters.length; } /** Returns the first occurrence or, if there are no occurrences, null. */ get firstDate() { return this.adapters[0] || null; } /** Returns the last occurrence or, if there are no occurrences, null. */ get lastDate() { return this.adapters[this.length - 1] || null; } occurrences(args = {}) { return new OccurrenceIterator(this, this.normalizeOccurrencesArgs(args)); } collections(args = {}) { return new CollectionIterator(this, this.normalizeCollectionsArgs(args)); } add(value) { return new Dates({ dates: [...this.adapters, value], timezone: this.timezone, data: this.data }); } remove(value) { const dates = this.adapters.slice(); const input = this.normalizeDateInputToAdapter(value); const index = dates.findIndex(date => date.valueOf() === input.valueOf()); if (index >= 0) { dates.splice(index, 1); } return new Dates({ dates, timezone: this.timezone, data: this.data }); } set(prop, value, options = {}) { let timezone = this.timezone; let dates = this.adapters.slice(); if (prop === 'timezone') { if (value === this.timezone) return this;else if (options.keepLocalTime) { dates = this.adapters.map(adapter => { const json = adapter.toJSON(); json.timezone = value; return this.dateAdapter.fromJSON(json); }); } timezone = value; } else if (prop === 'dates') { dates = value; } else if (prop === 'duration') { dates = dates.map(date => date.set('duration', value || 0)); } else { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["ArgumentError"](`Unexpected prop argument "${prop}". Accepted values are "timezone" or "dates"`); } return new Dates({ dates, data: this.data, timezone }); } filter(fn) { return new Dates({ dates: this.adapters.filter(fn), data: this.data, timezone: this.timezone }); } *_run(args = {}) { let dates = this.datetimes.sort(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["dateTimeSortComparer"]); if (args.start) { dates = dates.filter(date => date.isAfterOrEqual(args.start)); } if (args.end) { dates = dates.filter(date => date.isBeforeOrEqual(args.end)); } if (args.reverse) { dates = dates.slice().reverse(); } if (args.take) { dates = dates.slice(0, args.take); } const dateCache = dates.slice(); let date = dateCache.shift(); let yieldArgs; while (date) { if (yieldArgs && yieldArgs.skipToDate && (args.reverse ? yieldArgs.skipToDate.isBefore(date) : yieldArgs.skipToDate.isAfter(date))) { date = dateCache.shift(); continue; } date = date.add(this, 'generator'); yieldArgs = yield this.normalizeRunOutput(date); // Here, we are matching the behavior of the RecurrenceRulesIterator if (yieldArgs && yieldArgs.skipToDate && (args.reverse ? yieldArgs.skipToDate.isAfterOrEqual(date) : yieldArgs.skipToDate.isBeforeOrEqual(date))) { throw new Error('A provided `skipToDate` option must be greater than the last yielded date ' + '(or smaller, in the case of reverse iteration)'); } date = dateCache.shift(); } return undefined; } } class InvalidDateAdapterError extends Error {} let dateAdapterConfig; class DateAdapterBase { constructor(_date, options) { this.duration = options && options.duration || 0; this.generators = options && options.generators && options.generators.slice() || []; if (!Number.isInteger(this.duration) || this.duration < 0) { throw new InvalidDateAdapterError('duration must be a non-negative integer'); } } static set adapter(value) { if (dateAdapterConfig) { throw new Error(`"${dateAdapterConfig.name}" has already been configured.`); } dateAdapterConfig = value; } static get adapter() { if (!dateAdapterConfig) { throw new Error('No date adapter has been configured. See rSchedule docs.'); } return dateAdapterConfig; } static isDate(_object) { throw unimplementedError('isDate()'); } static fromDate(_date, _options) { throw unimplementedError('fromDate()'); } static fromJSON(_json) { throw unimplementedError('fromJSON()'); } static fromDateTime(_datetime) { throw unimplementedError('fromDateTime()'); } toDateTime() { const date = DateTime.fromJSON(Object.assign(Object.assign({}, this.toJSON()), { generators: this.generators })); return date; } } DateAdapterBase.hasTimezoneSupport = false; function unimplementedError(name) { return new Error(`You must implement the "${name}" method for this DateAdapter class`); } var DateAdapter; (function (DateAdapter) { DateAdapter.WEEKDAYS = ['SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA']; DateAdapter.MILLISECONDS_IN_SECOND = 1000; DateAdapter.MILLISECONDS_IN_MINUTE = DateAdapter.MILLISECONDS_IN_SECOND * 60; DateAdapter.MILLISECONDS_IN_HOUR = DateAdapter.MILLISECONDS_IN_MINUTE * 60; DateAdapter.MILLISECONDS_IN_DAY = DateAdapter.MILLISECONDS_IN_HOUR * 24; DateAdapter.MILLISECONDS_IN_WEEK = DateAdapter.MILLISECONDS_IN_DAY * 7; })(DateAdapter || (DateAdapter = {})); class InvalidDateTimeError extends Error {} class DateTime { constructor(date, timezone, duration, generators) { this.date = new Date(date); this.timezone = timezone || null; this.duration = duration || 0; this.generators = generators && generators.slice() || []; if (!Number.isInteger(this.duration) || this.duration < 0) { throw new InvalidDateTimeError('duration must be a non-negative integer'); } this.assertIsValid(); } // /** // * Similar to `Array.isArray()`, `isInstance()` provides a surefire method // * of determining if an object is a `DateTime` by checking against the // * global symbol registry. // */ // static isInstance(object: any): object is DateTime { // return !!(object && object[DATETIME_ID]); // } static fromJSON(json) { const date = new Date(Date.UTC(json.year, json.month - 1, json.day, json.hour, json.minute, json.second, json.millisecond)); return new DateTime(date, json.timezone, json.duration, json.generators); } static fromDateAdapter(adapter) { return DateTime.fromJSON(Object.assign(Object.assign({}, adapter.toJSON()), { generators: adapter.generators })); } /** * Returns `undefined` if `duration` is `0`. Else returns * the `end` date. */ get end() { if (!this.duration) return; if (this._end) return this._end; this._end = this.add(this.duration, 'millisecond'); return this._end; } // While we constrain the argument to be another DateAdapter in typescript // we handle the case of someone passing in another type of object in javascript isEqual(object) { if (!object) { return false; } assertSameTimeZone(this, object); return this.valueOf() === object.valueOf(); } isBefore(object) { assertSameTimeZone(this, object); return this.valueOf() < object.valueOf(); } isBeforeOrEqual(object) { assertSameTimeZone(this, object); return this.valueOf() <= object.valueOf(); } isAfter(object) { assertSameTimeZone(this, object); return this.valueOf() > object.valueOf(); } isAfterOrEqual(object) { assertSameTimeZone(this, object); return this.valueOf() >= object.valueOf(); } isOccurring(object) { if (!this.duration) { throw new Error('DateTime#isOccurring() is only applicable to DateTimes with durations'); } assertSameTimeZone(this, object); return object.isAfterOrEqual(this) && object.isBeforeOrEqual(this.add(this.duration, 'millisecond')); } add(amount, unit) { switch (unit) { case 'generator': { const generators = this.generators.slice(); generators.unshift(amount); return new DateTime(this.date, this.timezone, this.duration, generators); } case 'year': return this.forkDateTime(addUTCYears(this.date, amount)); case 'month': return this.forkDateTime(addUTCMonths(this.date, amount)); case 'week': return this.forkDateTime(addUTCWeeks(this.date, amount)); case 'day': return this.forkDateTime(addUTCDays(this.date, amount)); case 'hour': return this.forkDateTime(addUTCHours(this.date, amount)); case 'minute': return this.forkDateTime(addUTCMinutes(this.date, amount)); case 'second': return this.forkDateTime(addUTCSeconds(this.date, amount)); case 'millisecond': return this.forkDateTime(addUTCMilliseconds(this.date, amount)); default: throw new Error('Invalid unit provided to `DateTime#add`'); } } subtract(amount, unit) { switch (unit) { case 'year': return this.forkDateTime(subUTCYears(this.date, amount)); case 'month': return this.forkDateTime(subUTCMonths(this.date, amount)); case 'week': return this.forkDateTime(subUTCWeeks(this.date, amount)); case 'day': return this.forkDateTime(subUTCDays(this.date, amount)); case 'hour': return this.forkDateTime(subUTCHours(this.date, amount)); case 'minute': return this.forkDateTime(subUTCMinutes(this.date, amount)); case 'second': return this.forkDateTime(subUTCSeconds(this.date, amount)); case 'millisecond': return this.forkDateTime(subUTCMilliseconds(this.date, amount)); default: throw new Error('Invalid unit provided to `DateTime#subtract`'); } } get(unit) { switch (unit) { case 'year': return this.date.getUTCFullYear(); case 'month': return this.date.getUTCMonth() + 1; case 'yearday': return getUTCYearDay(this.date); case 'weekday': return DateAdapter.WEEKDAYS[this.date.getUTCDay()]; case 'day': return this.date.getUTCDate(); case 'hour': return this.date.getUTCHours(); case 'minute': return this.date.getUTCMinutes(); case 'second': return this.date.getUTCSeconds(); case 'millisecond': return this.date.getUTCMilliseconds(); default: throw new Error('Invalid unit provided to `DateTime#set`'); } } set(unit, value) { if (unit === 'duration') { return new DateTime(this.date, this.timezone, value, this.generators); } if (unit === 'generators') { return new DateTime(this.date, this.timezone, this.duration, value); } let date = new Date(this.date); switch (unit) { case 'year': date.setUTCFullYear(value); break; case 'month': { // If the current day of the month // is greater than days in the month we are moving to, we need to also // set the day to the end of that month. const length = monthLength(value, date.getUTCFullYear()); const day = date.getUTCDate(); if (day > length) { date.setUTCDate(1); date.setUTCMonth(value); date = subUTCDays(date, 1); } else { date.setUTCMonth(value - 1); } break; } case 'day': date.setUTCDate(value); break; case 'hour': date.setUTCHours(value); break; case 'minute': date.setUTCMinutes(value); break; case 'second': date.setUTCSeconds(value); break; case 'millisecond': date.setUTCMilliseconds(value); break; default: throw new Error('Invalid unit provided to `DateTime#set`'); } return this.forkDateTime(date); } granularity(granularity, opt = {}) { let date = this.forkDateTime(this.date); switch (granularity) { case 'year': date = date.set('month', 1); case 'month': date = date.set('day', 1); break; case 'week': date = setDateToStartOfWeek(date, opt.weekStart); } switch (granularity) { case 'year': case 'month': case 'week': case 'day': date = date.set('hour', 0); case 'hour': date = date.set('minute', 0); case 'minute': date = date.set('second', 0); case 'second': date = date.set('millisecond', 0); case 'millisecond': return date; default: throw new Error('Invalid granularity provided to `DateTime#granularity`: ' + granularity); } } endGranularity(granularity, opt = {}) { let date = this.forkDateTime(this.date); switch (granularity) { case 'year': date = date.set('month', 12); case 'month': date = date.set('day', monthLength(date.get('month'), date.get('year'))); break; case 'week': date = setDateToEndOfWeek(date, opt.weekStart); } switch (granularity) { case 'year': case 'month': case 'week': case 'day': date = date.set('hour', 23); case 'hour': date = date.set('minute', 59); case 'minute': date = date.set('second', 59); case 'second': date = date.set('millisecond', 999); case 'millisecond': return date; default: throw new Error('Invalid granularity provided to `DateTime#granularity`: ' + granularity); } } toISOString() { return this.date.toISOString(); } toDateTime() { return this; } toJSON() { const json = { timezone: this.timezone, year: this.get('year'), month: this.get('month'), day: this.get('day'), hour: this.get('hour'), minute: this.get('minute'), second: this.get('second'), millisecond: this.get('millisecond') }; if (this.duration) { json.duration = this.duration; } return json; } valueOf() { return this.date.valueOf(); } assertIsValid() { if (isNaN(this.valueOf())) { throw new InvalidDateTimeError('DateTime has invalid date.'); } return true; } forkDateTime(date) { return new DateTime(date, this.timezone, this.duration, this.generators); } } function assertSameTimeZone(x, y) { if (x.timezone !== y.timezone) { throw new InvalidDateTimeError('Attempted to compare a datetime to another date in a different timezone: ' + JSON.stringify(x) + ' and ' + JSON.stringify(y)); } return true; } function setDateToStartOfWeek(date, wkst) { const index = orderedWeekdays(wkst).indexOf(date.get('weekday')); return date.subtract(index, 'day'); } function setDateToEndOfWeek(date, wkst) { const index = orderedWeekdays(wkst).indexOf(date.get('weekday')); return date.add(6 - index, 'day'); } function orderedWeekdays(wkst = 'SU') { const wkdays = DateAdapter.WEEKDAYS.slice(); let index = wkdays.indexOf(wkst); while (index !== 0) { shiftArray(wkdays); index--; } return wkdays; } function shiftArray(array, from = 'first') { if (array.length === 0) { return array; } else if (from === 'first') { array.push(array.shift()); } else { array.unshift(array.pop()); } return array; } /** * Returns the days in the given month. * * @param month base-1 * @param year */ function monthLength(month, year) { const block = { 1: 31, 2: getDaysInFebruary(year), 3: 31, 4: 30, 5: 31, 6: 30, 7: 31, 8: 31, 9: 30, 10: 31, 11: 30, 12: 31 }; return block[month]; } function getDaysInFebruary(year) { return isLeapYear(year) ? 29 : 28; } // taken from date-fn function isLeapYear(year) { return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0; } function getUTCYearDay(now) { const start = new Date(Date.UTC(now.getUTCFullYear(), 0, 1)); const diff = now.valueOf() - start.valueOf(); return 1 + Math.floor(diff / DateAdapter.MILLISECONDS_IN_DAY); } /** * These functions are basically lifted from `date-fns`, but changed * to use the UTC date methods, which `date-fns` doesn't support. */ function toInteger(input) { if (input === null || input === true || input === false) { return NaN; } const int = Number(input); if (isNaN(int)) { return int; } return int < 0 ? Math.ceil(int) : Math.floor(int); } function addMilliseconds(dirtyDate, dirtyAmount) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } const timestamp = dirtyDate.valueOf(); const amount = toInteger(dirtyAmount); return new Date(timestamp + amount); } function addUTCYears(date, input) { const amount = toInteger(input); return addUTCMonths(date, amount * 12); } function addUTCMonths(date, input) { const amount = toInteger(input); date = new Date(date); const desiredMonth = date.getUTCMonth() + amount; const dateWithDesiredMonth = new Date(0); dateWithDesiredMonth.setUTCFullYear(date.getUTCFullYear(), desiredMonth, 1); dateWithDesiredMonth.setUTCHours(0, 0, 0, 0); const daysInMonth = monthLength(dateWithDesiredMonth.getUTCMonth() + 1, dateWithDesiredMonth.getUTCFullYear()); // Set the last day of the new month // if the original date was the last day of the longer month date.setUTCMonth(desiredMonth, Math.min(daysInMonth, date.getUTCDate())); return date; } function addUTCWeeks(date, input) { const amount = toInteger(input); const days = amount * 7; return addUTCDays(date, days); } function addUTCDays(date, input) { // by adding milliseconds rather than days, we supress the native Date object's automatic // daylight savings time conversions which we don't want in UTC mode return addUTCMilliseconds(date, toInteger(input) * DateAdapter.MILLISECONDS_IN_DAY); } function addUTCHours(date, input) { const amount = toInteger(input); return addMilliseconds(date, amount * DateAdapter.MILLISECONDS_IN_HOUR); } function addUTCMinutes(date, input) { const amount = toInteger(input); return addMilliseconds(date, amount * DateAdapter.MILLISECONDS_IN_MINUTE); } function addUTCSeconds(date, input) { const amount = toInteger(input); return addMilliseconds(date, amount * DateAdapter.MILLISECONDS_IN_SECOND); } function addUTCMilliseconds(date, input) { const amount = toInteger(input); const timestamp = date.getTime(); return new Date(timestamp + amount); } function subUTCYears(date, amount) { return addUTCYears(date, -amount); } function subUTCMonths(date, amount) { return addUTCMonths(date, -amount); } function subUTCWeeks(date, amount) { return addUTCWeeks(date, -amount); } function subUTCDays(date, amount) { return addUTCDays(date, -amount); } function subUTCHours(date, amount) { return addUTCHours(date, -amount); } function subUTCMinutes(date, amount) { return addUTCMinutes(date, -amount); } function subUTCSeconds(date, amount) { return addUTCSeconds(date, -amount); } function subUTCMilliseconds(date, amount) { return addUTCMilliseconds(date, -amount); } // export function normalizeDateInput( // dateAdapter: DateAdapterConstructor, // input: DateInput, // timezone: string | null, // ): DateTime { // if (input instanceof DateTime) { // if (input.timezone !== timezone) { // return dateAdapter // .fromDateTime(input) // .set('timezone', timezone) // .toDateTime(); // } // return input; // } // return input instanceof DateAdapter // ? input.set('timezone', timezone).toDateTime() // : new dateAdapter(input).toDateTime(); // } function normalizeDateTimeTimezone(date, timezone) { if (date.timezone !== timezone) { return DateAdapterBase.adapter.fromDateTime(date).set('timezone', timezone).toDateTime(); } return date; } class RuleBase extends OccurrenceGenerator { constructor(recurrenceRules, config, options = {}) { super(options); this.recurrenceRules = recurrenceRules; this.options = Object(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["cloneRuleOptions"])(config); this.normOptions = Object(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["normalizeRuleOptions"])(this.recurrenceRules, this.options); this.timezone = options.timezone !== undefined ? options.timezone : this.normOptions.start.timezone; this.data = options.data; this.hasDuration = !!config.duration; if (this.hasDuration) this.duration = config.duration; this.isInfinite = this.normOptions.end === undefined && this.normOptions.count === undefined; } occurrences(args = {}) { return new OccurrenceIterator(this, this.normalizeOccurrencesArgs(args)); } collections(args = {}) { return new CollectionIterator(this, this.normalizeCollectionsArgs(args)); } *_run(rawArgs = {}) { const args = this.normalizeRunArgs(rawArgs); const iterator = new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RecurrenceRulesIterator"](Object(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["recurrenceRulesReducer"])(this.recurrenceRules), this.normOptions, args); let date = iterator.next().value; let index = 0; while (date && (args.take === undefined || index < args.take)) { index++; date = date.add(this, 'generator'); const yieldArgs = yield this.normalizeRunOutput(date); if (yieldArgs === null || yieldArgs === void 0 ? void 0 : yieldArgs.skipToDate) { // The RecurrenceRuleIterator might have a different timezone from the rule. // Because of this, the yieldArgs will not properly be normalized by the // OccurrenceIterator, so we need to do it here date = iterator.next(Object.assign(Object.assign({}, yieldArgs), { skipToDate: normalizeDateTimeTimezone(yieldArgs.skipToDate, iterator.start.timezone) })).value; } else { // theoretically, the yieldArgs are undefined here // maybe in the future there will be other yieldArg options though date = iterator.next(yieldArgs).value; } } return undefined; } } class Rule extends RuleBase { /** * Create a new Rule object with the specified rule config and options. * * ### Options * * - **timezone**: the timezone that yielded occurrences should be in. Note, * this does not change the rule config. Occurrences are first found using * the unmodified rule config, and then converted to the timezone specified * here before being yielded. * - **data**: arbitrary data you can associate with this rule. This * is the only mutable property of `Rule` objects. * * ### Rule Config * * - #### frequency * * The frequency rule part identifies the type of recurrence rule. Valid values * include `"SECONDLY"`, `"MINUTELY"`, `"HOURLY"`, `"DAILY"`, `"WEEKLY"`, * `"MONTHLY"`, or `"YEARLY"`. * * - #### start * * The start of the rule (not necessarily the first occurrence). * Either a `DateAdapter` instance, date object, or `DateTime` object. * The type of date object depends on the `DateAdapter` class used for this * `Rule`. * * - #### end? * * The end of the rule (not necessarily the last occurrence). * Either a `DateAdapter` instance, date object, or `DateTime` object. * The type of date object depends on the `DateAdapter` class used for this * `Rule`. * * - #### duration? * * A length of time expressed in milliseconds. * * - #### interval? * * The interval rule part contains a positive integer representing at * which intervals the recurrence rule repeats. The default value is * `1`, meaning every second for a SECONDLY rule, every minute for a * MINUTELY rule, every hour for an HOURLY rule, every day for a * DAILY rule, every week for a WEEKLY rule, every month for a * MONTHLY rule, and every year for a YEARLY rule. For example, * within a DAILY rule, a value of `8` means every eight days. * * - #### count? * * The count rule part defines the number of occurrences at which to * range-bound the recurrence. `count` and `end` are both two different * ways of specifying how a recurrence completes. * * - #### weekStart? * * The weekStart rule part specifies the day on which the workweek starts. * Valid values are `"MO"`, `"TU"`, `"WE"`, `"TH"`, `"FR"`, `"SA"`, and `"SU"`. * This is significant when a WEEKLY rule has an interval greater than 1, * and a `byDayOfWeek` rule part is specified. The * default value is `"MO"`. * * - #### bySecondOfMinute? * * The bySecondOfMinute rule part expects an array of seconds * within a minute. Valid values are 0 to 60. * * - #### byMinuteOfHour? * * The byMinuteOfHour rule part expects an array of minutes within an hour. * Valid values are 0 to 59. * * - #### byHourOfDay? * * The byHourOfDay rule part expects an array of hours of the day. * Valid values are 0 to 23. * * - #### byDayOfWeek? * * *note: the byDayOfWeek rule part is kinda complex. Blame the ICAL spec.* * * The byDayOfWeek rule part expects an array. Each array entry can * be a day of the week (`"SU"`, `"MO"` , `"TU"`, `"WE"`, `"TH"`, * `"FR"`, `"SA"`). If the rule's `frequency` is either MONTHLY or YEARLY, * Any entry can also be a tuple where the first value of the tuple is a * day of the week and the second value is an positive/negative integer * (e.g. `["SU", 1]`). In this case, the number indicates the nth occurrence of * the specified day within the MONTHLY or YEARLY rule. * * The behavior of byDayOfWeek changes depending on the `frequency` * of the rule. * * Within a MONTHLY rule, `["MO", 1]` represents the first Monday * within the month, whereas `["MO", -1]` represents the last Monday * of the month. * * Within a YEARLY rule, the numeric value in a byDayOfWeek tuple entry * corresponds to an offset within the month when the byMonthOfYear rule part is * present, and corresponds to an offset within the year otherwise. * * Regardless of rule `frequency`, if a byDayOfWeek entry is a string * (rather than a tuple), it means "all of these days" within the specified * frequency (e.g. within a MONTHLY rule, `"MO"` represents all Mondays within * the month). * * - #### byDayOfMonth? * * The byDayOfMonth rule part expects an array of days * of the month. Valid values are 1 to 31 or -31 to -1. * * For example, -10 represents the tenth to the last day of the month. * The byDayOfMonth rule part *must not* be specified when the rule's * `frequency` is set to WEEKLY. * * - #### byMonthOfYear? * * The byMonthOfYear rule part expects an array of months * of the year. Valid values are 1 to 12. * */ constructor(config, options = {}) { super(Rule.recurrenceRules, config, options); } set(prop, value, tzoptions = {}) { let options = Object(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["cloneRuleOptions"])(this.options); let timezone = this.timezone; if (prop === 'timezone') { if (value === this.timezone && !tzoptions.keepLocalTime) return this;else if (tzoptions.keepLocalTime) { const json = this.normalizeDateInput(options.start).toJSON(); json.timezone = value; const adapter = this.dateAdapter.fromJSON(json); // prettier-ignore options.start = options.start instanceof this.dateAdapter ? adapter : options.start instanceof _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["DateTime"] ? adapter.toDateTime() : adapter.date; } timezone = value; } else if (prop === 'options') { options = value; } else { options[prop] = value; } return new Rule(options, { data: this.data, maxDuration: this.maxDuration, timezone }); } } Rule.recurrenceRules = []; class ScheduleBase extends OccurrenceGenerator { /** * Create a new Schedule object with the specified options. * * The order of precidence for rrules, rdates, exrules, and exdates is: * * 1. rrules are included * 2. exrules are excluded * 3. rdates are included * 4. exdates are excluded * */ constructor(options) { super(options); this.data = options.data; } occurrences(args = {}) { return new OccurrenceIterator(this, this.normalizeOccurrencesArgs(args)); } collections(args = {}) { return new CollectionIterator(this, this.normalizeCollectionsArgs(args)); } *_run(args = {}) { const count = args.take; delete args.take; const iterator = this.occurrenceStream._run(args); let date = iterator.next().value; let index = 0; while (date && (count === undefined || count > index)) { date = date.add(this, 'generator'); const yieldArgs = yield this.normalizeRunOutput(date); date = iterator.next(yieldArgs).value; index++; } return undefined; } } /** * An operator function which accepts a spread of occurrence generators * and removes their occurrences from the output. * * @param streams a spread of occurrence generators */ function subtract(...streams) { return options => new SubtractOperator(streams, options); } class SubtractOperator extends Operator { /** Not actually used but necessary for IRunnable interface */ set(_, value) { return new SubtractOperator(this.streams.map(stream => stream.set('timezone', value)), Object.assign(Object.assign({}, this.config), { base: this.config.base && this.config.base.set('timezone', value), timezone: value })); } *_run(args = {}) { if (!this.config.base) return; const inclusion = new IterableWrapper(this.config.base, args); const exclusion = new IterableWrapper(new AddOperator(this.streams, { timezone: this.config.timezone }), args); cycleStreams(inclusion, exclusion, args); while (!inclusion.done) { const yieldArgs = yield this.normalizeRunOutput(inclusion.value); if (!(yieldArgs && yieldArgs.skipToDate)) { inclusion.next(); } cycleStreams(inclusion, exclusion, args, yieldArgs); } } calculateIsInfinite() { return !!(this.config.base && this.config.base.isInfinite); } calculateHasDuration() { return !!(this.config.base && this.config.base.hasDuration); } } function cycleStreams(inclusion, exclusion, options = {}, yieldArgs = {}) { processYieldArgs([inclusion, exclusion], options, yieldArgs); iterateExclusion(inclusion, exclusion, options); while (!inclusion.done && !exclusion.done && inclusion.value.isEqual(exclusion.value)) { inclusion.next(); iterateExclusion(inclusion, exclusion, options); } } function iterateExclusion(inclusion, exclusion, options = {}) { if (options.reverse) { while (!exclusion.done && !inclusion.done && exclusion.value.isAfter(inclusion.value)) { exclusion.next(); } return; } while (!exclusion.done && !inclusion.done && exclusion.value.isBefore(inclusion.value)) { exclusion.next(); } } /** * An operator function which deduplicates an occurrence stream. Occurrence * `duration` is currently ignored. */ function unique() { return options => new UniqueOperator([], options); } class UniqueOperator extends Operator { /** Not actually used but necessary for IRunnable interface */ set(_, value) { return new UniqueOperator([], Object.assign(Object.assign({}, this.config), { base: this.config.base && this.config.base.set('timezone', value), timezone: value })); } *_run(args = {}) { if (!this.config.base) return; const stream = new IterableWrapper(this.config.base, args); while (!stream.done) { const yieldArgs = yield this.normalizeRunOutput(stream.value); const lastValue = stream.value; // iterate the current stream stream.next(yieldArgs); while (!(yieldArgs && yieldArgs.skipToDate) && !stream.done && stream.value.isEqual(lastValue)) { stream.next(); } } } calculateIsInfinite() { return !!(this.config.base && this.config.base.isInfinite); } calculateHasDuration() { return !!(this.config.base && this.config.base.hasDuration); } } class Schedule extends ScheduleBase { /** * Create a new Schedule object with the specified options. * * The order of precidence for rrules, rdates, exrules, and exdates is: * * 1. rrules are included * 2. exrules are excluded * 3. rdates are included * 4. exdates are excluded * * ### Options * * - **timezone**: The timezone that yielded occurrences should be *displayed* in. * Note, this one affects the *displayed* timezone of yielded occurrences. * For rules, occurrences are first found using the unmodified rule * config (including whatever timezone the `start` datetime is defined * in), and then converted to the timezone specified here before being * yielded. By default, the timezone is *local* time (`null`). So if you don't * want your rules to be displayed in local time, you must supply a * timezone argument. * - **data**: arbitrary data you can associate with this Schedule. This * is the only mutable property of `Schedule` objects. * - **maxDuration**: currently unused. * - **rrules**: rules specifying when occurrences happen. See the "Rule Config" * section below. * - **rdates**: individual dates that should be _included_ in the schedule. * - **exdates**: individual dates that should be _excluded_ from the schedule. * - **exrules**: rules specifying when occurrences shouldn't happen. See the * "Rule Config" section below. * * ### Rule Config * * - #### frequency * * The frequency rule part identifies the type of recurrence rule. Valid values * include `"SECONDLY"`, `"MINUTELY"`, `"HOURLY"`, `"DAILY"`, `"WEEKLY"`, * `"MONTHLY"`, or `"YEARLY"`. * * - #### start * * The start of the rule (not necessarily the first occurrence). * Either a `DateAdapter` instance, date object, or `DateTime` object. * The type of date object depends on the `DateAdapter` class used for this * `Rule`. * * - #### end? * * The end of the rule (not necessarily the last occurrence). * Either a `DateAdapter` instance, date object, or `DateTime` object. * The type of date object depends on the `DateAdapter` class used for this * `Rule`. * * - #### duration? * * A length of time expressed in milliseconds. * * - #### interval? * * The interval rule part contains a positive integer representing at * which intervals the recurrence rule repeats. The default value is * `1`, meaning every second for a SECONDLY rule, every minute for a * MINUTELY rule, every hour for an HOURLY rule, every day for a * DAILY rule, every week for a WEEKLY rule, every month for a * MONTHLY rule, and every year for a YEARLY rule. For example, * within a DAILY rule, a value of `8` means every eight days. * * - #### count? * * The count rule part defines the number of occurrences at which to * range-bound the recurrence. `count` and `end` are both two different * ways of specifying how a recurrence completes. * * - #### weekStart? * * The weekStart rule part specifies the day on which the workweek starts. * Valid values are `"MO"`, `"TU"`, `"WE"`, `"TH"`, `"FR"`, `"SA"`, and `"SU"`. * This is significant when a WEEKLY rule has an interval greater than 1, * and a `byDayOfWeek` rule part is specified. The * default value is `"MO"`. * * - #### bySecondOfMinute? * * The bySecondOfMinute rule part expects an array of seconds * within a minute. Valid values are 0 to 60. * * - #### byMinuteOfHour? * * The byMinuteOfHour rule part expects an array of minutes within an hour. * Valid values are 0 to 59. * * - #### byHourOfDay? * * The byHourOfDay rule part expects an array of hours of the day. * Valid values are 0 to 23. * * - #### byDayOfWeek? * * *note: the byDayOfWeek rule part is kinda complex. Blame the ICAL spec.* * * The byDayOfWeek rule part expects an array. Each array entry can * be a day of the week (`"SU"`, `"MO"` , `"TU"`, `"WE"`, `"TH"`, * `"FR"`, `"SA"`). If the rule's `frequency` is either MONTHLY or YEARLY, * Any entry can also be a tuple where the first value of the tuple is a * day of the week and the second value is an positive/negative integer * (e.g. `["SU", 1]`). In this case, the number indicates the nth occurrence of * the specified day within the MONTHLY or YEARLY rule. * * The behavior of byDayOfWeek changes depending on the `frequency` * of the rule. * * Within a MONTHLY rule, `["MO", 1]` represents the first Monday * within the month, whereas `["MO", -1]` represents the last Monday * of the month. * * Within a YEARLY rule, the numeric value in a byDayOfWeek tuple entry * corresponds to an offset within the month when the byMonthOfYear rule part is * present, and corresponds to an offset within the year otherwise. * * Regardless of rule `frequency`, if a byDayOfWeek entry is a string * (rather than a tuple), it means "all of these days" within the specified * frequency (e.g. within a MONTHLY rule, `"MO"` represents all Mondays within * the month). * * - #### byDayOfMonth? * * The byDayOfMonth rule part expects an array of days * of the month. Valid values are 1 to 31 or -31 to -1. * * For example, -10 represents the tenth to the last day of the month. * The byDayOfMonth rule part *must not* be specified when the rule's * `frequency` is set to WEEKLY. * * - #### byMonthOfYear? * * The byMonthOfYear rule part expects an array of months * of the year. Valid values are 1 to 12. * */ constructor(options = {}) { super(options); this.rrules = []; this.exrules = []; for (const prop of ['rrules', 'exrules']) { const arg = options[prop]; if (arg) { this[prop] = arg.map(ruleArgs => { if (ruleArgs instanceof Rule) { return ruleArgs.set('timezone', this.timezone); } else { return new Rule(ruleArgs, { timezone: this.timezone }); } }); } } for (const prop of ['rdates', 'exdates']) { const arg = options[prop]; if (arg) { this[prop] = arg instanceof Dates ? arg.set('timezone', this.timezone) : new Dates({ dates: arg, timezone: this.timezone }); } else { this[prop] = new Dates({ timezone: this.timezone }); } } this.hasDuration = this.rrules.every(rule => rule.hasDuration) && this.exrules.every(rule => rule.hasDuration) && this.rdates.hasDuration && this.exdates.hasDuration; this.isInfinite = this.rrules.some(rule => rule.isInfinite); this.occurrenceStream = [add(...this.rrules), subtract(...this.exrules), add(this.rdates), subtract(this.exdates), unique()].reduce((prev, curr) => curr({ base: prev, timezone: this.timezone }), undefined); } add(prop, value) { const rrules = this.rrules.slice(); const exrules = this.exrules.slice(); let rdates = this.rdates; let exdates = this.exdates; switch (prop) { case 'rrule': rrules.push(value); break; case 'exrule': exrules.push(value); break; case 'rdate': rdates = this.rdates.add(value); break; case 'exdate': exdates = this.exdates.add(value); break; } return new Schedule({ timezone: this.timezone, data: this.data, rrules, exrules, rdates, exdates }); } remove(prop, value) { let rrules = this.rrules; let exrules = this.exrules; let rdates = this.rdates; let exdates = this.exdates; switch (prop) { case 'rrule': rrules = rrules.filter(rule => rule !== value); break; case 'exrule': exrules = exrules.filter(rule => rule !== value); break; case 'rdate': rdates = this.rdates.remove(value); break; case 'exdate': exdates = this.exdates.remove(value); break; } return new Schedule({ timezone: this.timezone, data: this.data, rrules, exrules, rdates, exdates }); } set(prop, value, options = {}) { let timezone = this.timezone; let rrules = this.rrules; let exrules = this.exrules; let rdates = this.rdates; let exdates = this.exdates; switch (prop) { case 'timezone': if (value === this.timezone && !options.keepLocalTime) return this;else if (options.keepLocalTime) { rrules = rrules.map(rule => rule.set('timezone', value, options)); exrules = exrules.map(rule => rule.set('timezone', value, options)); rdates = rdates.set('timezone', value, options); exdates = exdates.set('timezone', value, options); } timezone = value; break; case 'rrules': rrules = value; break; case 'exrules': exrules = value; break; case 'rdates': rdates = value; break; case 'exdates': exdates = value; break; } return new Schedule({ timezone, data: this.data, rrules, exrules, rdates, exdates }); } } /** * An operator function, which takes a spread of occurrence generators and only * returns the dates which intersect every occurrence generator. * * Because it's possible for all the generators to never intersect, * and because the intersection operator can't detect this lack of intersection, * you must call `intersection()` with a `{maxFailedIterations: number}` argument. * For convenience, you can globally set `RScheduleConfig.defaultMaxFailedIterations`. * Without further information, I'd probably set `defaultMaxFailedIterations = 50`. * * The `maxFailedIterations` argument caps the number of iterations the operator will * run through without finding a single valid occurrence. If this number is reached, the operator will * stop iterating (preventing a possible infinite loop). * * - Note: `maxFailedIterations` caps the number of iterations which * *fail to turn up a single valid occurrence*. Every time a valid occurrence is returned, * the current iteration count is reset to 0. * */ function intersection(args) { return options => new IntersectionOperator(args, options); } class IntersectionOperator extends Operator { constructor(args, config) { super(args.streams, config); if (this.isInfinite) { this.maxFailedIterations = args.maxFailedIterations || IntersectionOperator.defaultMaxFailedIterations; if (!this.maxFailedIterations) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["ArgumentError"]('The IntersectionOperator must be provided ' + 'a `maxFailedIterations` argument when it is built from schedules of infinite length. ' + 'This argument is used to ensure that the IntersectionOperator does not enter ' + 'an infinite loop because the underlying schedules never intersect. ' + 'If the `maxFailedIterations` count is reached it will be assumed that ' + 'all valid occurrences have been found and iteration will end without error.' + 'Without additional information, "50" is probably a good ' + '`maxFailedIterations` value. ' + 'If the schedules are not of infinite length, `maxFailedIterations` is ignored. ' + 'Note also that you can provide a `defaultMaxFailedIterations` number via ' + 'IntersectionOperator.defaultMaxFailedIterations.'); } } } set(_, value) { return new IntersectionOperator({ maxFailedIterations: this.maxFailedIterations, streams: this.streams.map(stream => stream.set('timezone', value)) }, Object.assign(Object.assign({}, this.config), { base: this.config.base && this.config.base.set('timezone', value), timezone: value })); } *_run(args = {}) { const streams = this.streams.map(stream => new IterableWrapper(stream, args)); if (this.config.base) { streams.push(new IterableWrapper(this.config.base, args)); } if (streams.length === 0) return; const hasEndDate = !!(!this.isInfinite || args.reverse || args.end); if (!cycleStreams$1(streams, undefined, Object.assign(Object.assign({}, args), { hasEndDate, iteration: 0, maxIterations: this.maxFailedIterations }))) { return; } let stream = selectNextIterable(streams, args); while (stream) { const yieldArgs = yield this.normalizeRunOutput(stream.value); const lastValidDate = stream.value; if (!(yieldArgs === null || yieldArgs === void 0 ? void 0 : yieldArgs.skipToDate)) { // iterate the current stream stream.next(); } if (!cycleStreams$1(streams, lastValidDate, Object.assign(Object.assign({}, args), { hasEndDate, iteration: 0, maxIterations: this.maxFailedIterations }), yieldArgs)) { return; } // The call to `cycleStreams()`, above, has already called // selectNextIterable with the `yieldArgs` stream = selectNextIterable(streams, args); } } calculateIsInfinite() { // Note: Array#every() === true when length === 0 if (!this.config.base) { if (this.streams.length === 0) return false; return this.streams.every(stream => stream.isInfinite); } else if (this.streams.length === 0) return this.config.base.isInfinite; return this.config.base.isInfinite && this.streams.every(stream => stream.isInfinite); } calculateHasDuration() { const streamsDuration = this.streams.every(stream => stream.hasDuration); if (!this.config.base) return streamsDuration; return this.config.base.hasDuration && streamsDuration; } } function cycleStreams$1(streams, lastValidDate, options, yieldArgs) { const next = selectNextIterable(streams, options, yieldArgs); if (!next) return false; if (lastValidDate && next.value.isEqual(lastValidDate)) return true; if (streams.some(stream => stream.done)) return false; if (streams.every(stream => stream.value.isEqual(next.value))) return true; options.iteration++; if (options.maxIterations && !options.hasEndDate && options.iteration > options.maxIterations) { return false; } // Since not all of the streams are equal, we grab the last stream... const last = selectLastIterable(streams, options); // ...and skip all the other streams so they are equal or past the last one streams.forEach(stream => { // Because streams can have multiple, identical dates in a row, // we don't want to `skipToDate` if the provided date is equal to the current date. if (last.value.isEqual(stream.value)) return; stream.next({ skipToDate: last.value }); }); // then we repeat return cycleStreams$1(streams, lastValidDate, options); } class DurationIterableWrapper extends IterableWrapper { constructor(generator, runArgs) { super(generator, runArgs); this.workingValue = this.value; this.next(); } } class MergeDurationOperatorError extends Error {} /** * An operator function which takes an occurrence stream with * `hasDuration === true` and merges occurrences which have overlapping * start and end times. * * Because it's possible for all the occurrences in the stream to have * overlapping start and end times, you must provide a `maxDuration` * argument that represents the maximum possible duration for a single * occurrence. If this duration is exceeded, a `MergeDurationOperatorError` * will be thrown. * * - For your convenience, you can globally set a default * `MergeDurationOperator#maxDuration` via * `RScheduleConfig.MergeDurationOperator.defaultMaxDuration`. * * Usage example: * * ```typescript * const MILLISECONDS_IN_HOUR = 1000 * 60 * 60; * * const dates = new Dates({ * dates: [ * new StandardDateAdapter(new Date(2010, 10, 10, 13), { duration: MILLISECONDS_IN_HOUR * 1 }), * new StandardDateAdapter(new Date(2010, 10, 11, 13), { duration: MILLISECONDS_IN_HOUR * 2 }), * new StandardDateAdapter(new Date(2010, 10, 11, 14), { duration: MILLISECONDS_IN_HOUR * 2 }), * new StandardDateAdapter(new Date(2010, 10, 12, 13), { duration: MILLISECONDS_IN_HOUR * 1 }), * ], * dateAdpter: StandardDateAdapter, * }).pipe( * mergeDuration({ * maxDuration: MILLISECONDS_IN_HOUR * 24 * }) * ) * * dates.occurrences().toArray() === [ * new StandardDateAdapter(new Date(2010, 10, 10, 13), { duration: MILLISECONDS_IN_HOUR * 1 }), * new StandardDateAdapter(new Date(2010, 10, 11, 13), { duration: MILLISECONDS_IN_HOUR * 3 }), * new StandardDateAdapter(new Date(2010, 10, 12, 13), { duration: MILLISECONDS_IN_HOUR * 1 }), * ] * ``` */ function mergeDuration(args) { return options => new MergeDurationOperator(args, options); } class MergeDurationOperator extends Operator { constructor(args, config) { super([], config); this.maxDuration = args.maxDuration; if (config.base && !config.base.hasDuration) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["ArgumentError"]('Base stream provided to MergeDurationOperator does not have an associated duration. ' + 'The MergeDurationOperator can only be used with streams which have a duration. '); } } /** Not actually used but necessary for IRunnable interface */ set(_, value) { return new MergeDurationOperator({ maxDuration: this.maxDuration }, Object.assign(Object.assign({}, this.config), { base: this.config.base && this.config.base.set('timezone', value), timezone: value })); } _run(args = {}) { return args.reverse ? this.reverseRun(args) : this.forwardRun(args); } calculateIsInfinite() { return !!(this.config.base && this.config.base.isInfinite); } calculateHasDuration() { return true; } *forwardRun(args = {}) { if (!this.config.base) return; // We want to find occurrences that end after the provided // `start` time even if they begin before the provided `start` // time. Because of this, we must begin iterating `maxDuration` // before the provided start time. let checkFromStart = args.start; if (args.start) { checkFromStart = args.start.subtract(this.maxDuration, 'millisecond'); } let checkFromEnd = args.end; if (args.end) { checkFromEnd = args.end.add(this.maxDuration, 'millisecond'); } const stream = new DurationIterableWrapper(this.config.base, Object.assign(Object.assign({}, args), { start: checkFromStart, end: checkFromEnd })); let yieldArgs; // checking `stream.workingValue` because when `stream.done === true` // `stream.workingValue` will not have been yielded yet while (stream.workingValue) { // TODO(@john.carroll.p): figure out how to handle `DateTime#generators` for merged `DateTimes` while (!stream.done && stream.workingValue.end.isAfterOrEqual(stream.value)) { if (stream.workingValue.duration > this.maxDuration) { throw new MergeDurationOperatorError(`MergeDurationOperatorError: Occurrence duration exceeded maxDuration of ` + this.maxDuration); } if (stream.value.end.isAfter(stream.workingValue.end)) { const diff = stream.value.end.valueOf() - stream.workingValue.end.valueOf(); stream.workingValue = stream.workingValue.set('duration', stream.workingValue.duration + diff); } stream.next(); } // check to make sure the occurrence we are about to yield ends after the // provided start time. if (args.start && stream.workingValue.end.isBefore(args.start)) { stream.workingValue = stream.value; stream.next(); continue; } // make sure the occurrence we are about to yield ends after the // provided skipToDate if ((yieldArgs === null || yieldArgs === void 0 ? void 0 : yieldArgs.skipToDate) && stream.workingValue.end.isBefore(yieldArgs.skipToDate)) { stream.workingValue = stream.value; stream.next(); continue; } // make sure we are not after the user requested `end` time. if (args.end && stream.workingValue && stream.workingValue.isAfter(args.end)) { break; } if (stream.workingValue.duration > this.maxDuration) { throw new MergeDurationOperatorError(`MergeDurationOperatorError: Occurrence duration exceeded maxDuration of ` + this.maxDuration); } yieldArgs = yield this.normalizeRunOutput(stream.workingValue); if ((yieldArgs === null || yieldArgs === void 0 ? void 0 : yieldArgs.skipToDate) && stream.workingValue.isAfterOrEqual(yieldArgs.skipToDate)) { throw new Error('A provided `skipToDate` option must be greater than the last yielded date ' + '(or smaller, in the case of reverse iteration)'); } stream.workingValue = stream.value; stream.next(); } } *reverseRun(args = {}) { if (!this.config.base) return; // We want to find occurrences that end after the provided // `start` time even if they begin before the provided `start` // time. Because of this, we must begin iterating `maxDuration` // before the provided start time. let checkFromStart = args.start; if (args.start) { checkFromStart = args.start.subtract(this.maxDuration, 'millisecond'); } let checkFromEnd = args.end; if (args.end) { checkFromEnd = args.end.add(this.maxDuration, 'millisecond'); } const stream = new DurationIterableWrapper(this.config.base, Object.assign(Object.assign({}, args), { start: checkFromStart, end: checkFromEnd })); let yieldArgs; // checking `stream.workingValue` because when `stream.done === true` // `stream.workingValue` will not have been yielded yet while (stream.workingValue) { // TODO(@john.carroll.p): figure out how to handle `DateTime#generators` for merged `DateTimes` while (!stream.done && stream.workingValue.isBeforeOrEqual(stream.value.end)) { if (stream.workingValue.duration > this.maxDuration) { throw new MergeDurationOperatorError(`MergeDurationOperatorError: Occurrence duration exceeded maxDuration of ` + this.maxDuration); } if (stream.value.isBefore(stream.workingValue) || stream.value.end.isAfter(stream.workingValue.end)) { if (stream.value.end.isAfter(stream.workingValue.end)) { // `stream.workingValue` is a subset of `stream.value` // so simply replace `stream.workingValue` with `stream.value` stream.workingValue = stream.value; } else { const diff = stream.workingValue.valueOf() - stream.value.valueOf(); stream.workingValue = stream.value.set('duration', stream.workingValue.duration + diff); } } stream.next(); } // check to make sure the occurrence we are about to yield starts before the // provided start time. if (args.start && stream.workingValue.end.isBefore(args.start)) { break; } if (yieldArgs && yieldArgs.skipToDate && stream.workingValue.end.isBefore(yieldArgs.skipToDate)) { stream.workingValue = stream.value; stream.next(); continue; } // make sure we are not after the user requested `end` time. if (args.end && stream.workingValue && stream.workingValue.isAfter(args.end)) { stream.workingValue = stream.value; stream.next(); continue; } if (stream.workingValue.duration > this.maxDuration) { throw new MergeDurationOperatorError(`MergeDurationOperatorError: Occurrence duration exceeded maxDuration of ` + this.maxDuration); } yieldArgs = yield this.normalizeRunOutput(stream.workingValue); if (yieldArgs && yieldArgs.skipToDate && stream.workingValue.end.isBeforeOrEqual(yieldArgs.skipToDate)) { throw new Error('A provided `skipToDate` option must be greater than the last yielded date ' + '(or smaller, in the case of reverse iteration)'); } stream.workingValue = stream.value; stream.next(); } } } class SplitDurationOperatorError extends Error {} /** * An operator function which takes an occurrence stream with * `hasDuration === true` and passes occurrences through a splitting * function. One usecase for this operator is to dynamically break up * occurrences with a large duration into several smaller occurrences. * * You must provide a `maxDuration` argument that represents the * maximum possible duration for a single occurrence. If this * duration is exceeded, a `SplitDurationOperatorError` will be * thrown. * * - For your convenience, you can globally set a default * `SplitDurationOperator#maxDuration` via * `RScheduleConfig.SplitDurationOperator.defaultMaxDuration`. * * Usage example: * * ```typescript * const MILLISECONDS_IN_HOUR = 1000 * 60 * 60; * * const splitFn = (date: DateTime) => { * if (date.duration > MILLISECONDS_IN_HOUR) { * const diff = date.duration! / 2; * * return [ * date.set('duration', diff), * date.add(diff, 'millisecond').set('duration', diff), * ]; * } * * return [date]; * }; * * const dates = new Dates({ * dates: [ * new StandardDateAdapter(new Date(2010, 10, 10, 13), { duration: MILLISECONDS_IN_HOUR * 1 }), * new StandardDateAdapter(new Date(2010, 10, 11, 13), { duration: MILLISECONDS_IN_HOUR * 2 }), * ], * dateAdpter: StandardDateAdapter, * }).pipe( * splitDuration({ * splitFn, * maxDuration: MILLISECONDS_IN_HOUR * 1 * }) * ) * * expect(dates.occurrences().toArray()).toEqual([ * new StandardDateAdapter(new Date(2010, 10, 10, 13), { duration: MILLISECONDS_IN_HOUR * 1 }), * new StandardDateAdapter(new Date(2010, 10, 11, 13), { duration: MILLISECONDS_IN_HOUR * 1 }), * new StandardDateAdapter(new Date(2010, 10, 11, 14), { duration: MILLISECONDS_IN_HOUR * 1 }), * ]) * ``` */ function splitDuration(args) { return options => new SplitDurationOperator(args, options); } class SplitDurationOperator extends Operator { constructor(args, config) { super([], config); this.splitFn = args.splitFn; this.maxDuration = args.maxDuration; if (config.base && !config.base.hasDuration) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["ArgumentError"]('Base stream provided to SplitDurationOperator does not have an associated duration. ' + 'The SplitDurationOperator can only be used with streams which have a duration.'); } } /** Not actually used but necessary for IRunnable interface */ set(_, value) { return new SplitDurationOperator({ maxDuration: this.maxDuration, splitFn: this.splitFn }, Object.assign(Object.assign({}, this.config), { base: this.config.base && this.config.base.set('timezone', value), timezone: value })); } *_run(args = {}) { if (!this.config.base) return; const reverse = args.reverse || false; // We want to find occurrences that end after the provided // `start` time even if they begin before the provided `start` // time. Because of this, we add `maxDuration` to // the provided start time. let checkFromStart = args.start; if (args.start) { checkFromStart = args.start.subtract(this.maxDuration, 'millisecond'); } // same goes for `end` time as with `start` time. let checkFromEnd = args.end; if (args.end) { checkFromEnd = args.end.add(this.maxDuration, 'millisecond'); } const stream = new IterableWrapper(this.config.base, Object.assign(Object.assign({}, args), { start: checkFromStart, end: checkFromEnd })); let yieldArgs; const datesBucket = []; while (!stream.done || datesBucket[0] && datesBucket[0][0]) { /** * Example: * 10am - 2pm -> 10am - 12pm, 12pm - 2pm * 11am - 3pm -> 11am - 1pm, 1pm - 3pm * 2pm - 4pm -> 2pm - 3pm, 3pm - 4pm */ if (!(datesBucket[0] && datesBucket[0][0])) { // we're out of dates datesBucket.push(this.splitDate(stream.value, reverse)); stream.next(); } while (!stream.done && (reverse ? datesBucket[0].some(date => date.isBeforeOrEqual(stream.value.end)) : datesBucket[0].some(date => date.isAfterOrEqual(stream.value)))) { datesBucket.push(this.splitDate(stream.value, reverse)); stream.next(); } let selectedDate = datesBucket[0] && datesBucket[0][0]; let bucketIndex = -1; let selectedBucketIndex = 0; let dateIndex = -1; let selectedDateIndex = 0; // find the next date as well as its location in the datesBucket for (const bucket of datesBucket) { bucketIndex++; dateIndex = -1; for (const date of bucket) { dateIndex++; let dateShouldComeNext; if (reverse) { dateShouldComeNext = date.isAfter(selectedDate) || date.isEqual(selectedDate) && date.duration > selectedDate.duration; } else { dateShouldComeNext = date.isBefore(selectedDate) || date.isEqual(selectedDate) && date.duration < selectedDate.duration; } if (dateShouldComeNext) { selectedDate = date; selectedBucketIndex = bucketIndex; selectedDateIndex = dateIndex; break; } } } datesBucket[selectedBucketIndex].splice(selectedDateIndex, 1); if (datesBucket[selectedBucketIndex].length === 0) { datesBucket.splice(selectedBucketIndex, 1); } // If we've been yieldedArgs from the last cycle, check to see // that the selectedDate honors the `skipToDate` requirement // if not, discard this selectedDate if (yieldArgs && yieldArgs.skipToDate && selectedDate && !datePastEnd(selectedDate, args) && !datePastSkipToDate(selectedDate, yieldArgs.skipToDate, args)) { continue; } // because we subtracted `maxDuration` to the base iterator's start time, // check to make sure the selectedDate we are about to yield should // actually be yielded (it may be before the provided `start` time). // If not, discard the selectedDate. if (args.start && selectedDate.end.isBefore(args.start)) { if (reverse) break; continue; } // because we added `maxDuration` to the base iterator's end time, // check to make sure the selectedDate we are about to yield should // actually be yielded (it may be after the provided `end` time). // If not, end iteration. if (args.end && selectedDate.isAfter(args.end)) { if (reverse) continue; break; } if (selectedDate.duration > this.maxDuration) { throw new SplitDurationOperatorError(`SplitDurationOperatorError: Occurrence duration exceeded maxDuration of ` + this.maxDuration); } yieldArgs = yield this.normalizeRunOutput(selectedDate); if (yieldArgs && yieldArgs.skipToDate && (args.reverse ? selectedDate.isBeforeOrEqual(yieldArgs.skipToDate) : selectedDate.isAfterOrEqual(yieldArgs.skipToDate))) { throw new Error('A provided `skipToDate` option must be greater than the last yielded date ' + '(or smaller, in the case of reverse iteration)'); } } } calculateIsInfinite() { return !!(this.config.base && this.config.base.isInfinite); } calculateHasDuration() { return true; } splitDate(date, reverse) { const dates = this.splitFn(date); let valid; if (dates.length === 0) { valid = false; } else if (dates.length === 1) { valid = date.duration === dates[0].duration; } else { valid = date.duration === dates.reduce((prev, curr) => prev + curr.duration, 0); } if (!valid) { throw new Error('The provided SplitDurationOperator split function ' + 'must return an array of DateTimes with length > 0 ' + 'where the total duration of the new dates equals the duration of ' + 'the original date.'); } dates.sort(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["dateTimeSortComparer"]); if (reverse) { dates.reverse(); } return dates; } } function datePastEnd(date, options) { return !!(options.reverse ? options.start && date.isBefore(options.start) : options.end && date.isAfter(options.end)); } function datePastSkipToDate(date, skipToDate, options) { return !!(options.reverse ? skipToDate.isAfterOrEqual(date) : skipToDate.isBeforeOrEqual(date)); } /***/ }), /***/ "./node_modules/@rschedule/core/es2015/main.js": /*!*****************************************************!*\ !*** ./node_modules/@rschedule/core/es2015/main.js ***! \*****************************************************/ /*! exports provided: ArgumentError, DateAdapter, DateAdapterBase, DateTime, InfiniteLoopError, InvalidDateAdapterError, InvalidDateTime, InvalidDateTimeError, RecurrenceRuleError, RecurrenceRulesIterator, RuleOptionError, ValidDateTime, cloneJSON, cloneRuleOptions, dateInputToDateAdapter, dateInputToDateTime, dateTimeSortComparer, freqToGranularity, getDaysInYear, getDifferenceBetweenWeekdays, isLeapYear, normalizeDateTimeTimezone, normalizeRuleOptions, numberSortComparer, orderedWeekdays, recurrenceRulesReducer, uniqDateTimes */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArgumentError", function() { return ArgumentError; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DateAdapter", function() { return DateAdapter; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DateAdapterBase", function() { return DateAdapterBase; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DateTime", function() { return DateTime; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InfiniteLoopError", function() { return InfiniteLoopError; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InvalidDateAdapterError", function() { return InvalidDateAdapterError; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InvalidDateTime", function() { return InvalidDateTime; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InvalidDateTimeError", function() { return InvalidDateTimeError; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RecurrenceRuleError", function() { return RecurrenceRuleError; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RecurrenceRulesIterator", function() { return RecurrenceRulesIterator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RuleOptionError", function() { return RuleOptionError; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ValidDateTime", function() { return ValidDateTime; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cloneJSON", function() { return cloneJSON; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cloneRuleOptions", function() { return cloneRuleOptions; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dateInputToDateAdapter", function() { return dateInputToDateAdapter; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dateInputToDateTime", function() { return dateInputToDateTime; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dateTimeSortComparer", function() { return dateTimeSortComparer; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "freqToGranularity", function() { return freqToGranularity; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDaysInYear", function() { return getDaysInYear; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDifferenceBetweenWeekdays", function() { return getDifferenceBetweenWeekdays; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLeapYear", function() { return isLeapYear; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeDateTimeTimezone", function() { return normalizeDateTimeTimezone; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeRuleOptions", function() { return normalizeRuleOptions; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "numberSortComparer", function() { return numberSortComparer; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "orderedWeekdays", function() { return orderedWeekdays; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recurrenceRulesReducer", function() { return recurrenceRulesReducer; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "uniqDateTimes", function() { return uniqDateTimes; }); class InvalidDateAdapterError extends Error {} let dateAdapterConfig; class DateAdapterBase { constructor(_date, options) { this.duration = options && options.duration || 0; this.generators = options && options.generators && options.generators.slice() || []; if (!Number.isInteger(this.duration) || this.duration < 0) { throw new InvalidDateAdapterError('duration must be a non-negative integer'); } } static set adapter(value) { if (dateAdapterConfig) { throw new Error(`"${dateAdapterConfig.name}" has already been configured.`); } dateAdapterConfig = value; } static get adapter() { if (!dateAdapterConfig) { throw new Error('No date adapter has been configured. See rSchedule docs.'); } return dateAdapterConfig; } static isDate(_object) { throw unimplementedError('isDate()'); } static fromDate(_date, _options) { throw unimplementedError('fromDate()'); } static fromJSON(_json) { throw unimplementedError('fromJSON()'); } static fromDateTime(_datetime) { throw unimplementedError('fromDateTime()'); } toDateTime() { const date = DateTime.fromJSON(Object.assign(Object.assign({}, this.toJSON()), { generators: this.generators })); return date; } } DateAdapterBase.hasTimezoneSupport = false; function unimplementedError(name) { return new Error(`You must implement the "${name}" method for this DateAdapter class`); } var DateAdapter; (function (DateAdapter) { DateAdapter.WEEKDAYS = ['SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA']; DateAdapter.MILLISECONDS_IN_SECOND = 1000; DateAdapter.MILLISECONDS_IN_MINUTE = DateAdapter.MILLISECONDS_IN_SECOND * 60; DateAdapter.MILLISECONDS_IN_HOUR = DateAdapter.MILLISECONDS_IN_MINUTE * 60; DateAdapter.MILLISECONDS_IN_DAY = DateAdapter.MILLISECONDS_IN_HOUR * 24; DateAdapter.MILLISECONDS_IN_WEEK = DateAdapter.MILLISECONDS_IN_DAY * 7; })(DateAdapter || (DateAdapter = {})); class InvalidDateTimeError extends Error {} class DateTime { constructor(date, timezone, duration, generators) { this.date = new Date(date); this.timezone = timezone || null; this.duration = duration || 0; this.generators = generators && generators.slice() || []; if (!Number.isInteger(this.duration) || this.duration < 0) { throw new InvalidDateTimeError('duration must be a non-negative integer'); } this.assertIsValid(); } // /** // * Similar to `Array.isArray()`, `isInstance()` provides a surefire method // * of determining if an object is a `DateTime` by checking against the // * global symbol registry. // */ // static isInstance(object: any): object is DateTime { // return !!(object && object[DATETIME_ID]); // } static fromJSON(json) { const date = new Date(Date.UTC(json.year, json.month - 1, json.day, json.hour, json.minute, json.second, json.millisecond)); return new DateTime(date, json.timezone, json.duration, json.generators); } static fromDateAdapter(adapter) { return DateTime.fromJSON(Object.assign(Object.assign({}, adapter.toJSON()), { generators: adapter.generators })); } /** * Returns `undefined` if `duration` is `0`. Else returns * the `end` date. */ get end() { if (!this.duration) return; if (this._end) return this._end; this._end = this.add(this.duration, 'millisecond'); return this._end; } // While we constrain the argument to be another DateAdapter in typescript // we handle the case of someone passing in another type of object in javascript isEqual(object) { if (!object) { return false; } assertSameTimeZone(this, object); return this.valueOf() === object.valueOf(); } isBefore(object) { assertSameTimeZone(this, object); return this.valueOf() < object.valueOf(); } isBeforeOrEqual(object) { assertSameTimeZone(this, object); return this.valueOf() <= object.valueOf(); } isAfter(object) { assertSameTimeZone(this, object); return this.valueOf() > object.valueOf(); } isAfterOrEqual(object) { assertSameTimeZone(this, object); return this.valueOf() >= object.valueOf(); } isOccurring(object) { if (!this.duration) { throw new Error('DateTime#isOccurring() is only applicable to DateTimes with durations'); } assertSameTimeZone(this, object); return object.isAfterOrEqual(this) && object.isBeforeOrEqual(this.add(this.duration, 'millisecond')); } add(amount, unit) { switch (unit) { case 'generator': { const generators = this.generators.slice(); generators.unshift(amount); return new DateTime(this.date, this.timezone, this.duration, generators); } case 'year': return this.forkDateTime(addUTCYears(this.date, amount)); case 'month': return this.forkDateTime(addUTCMonths(this.date, amount)); case 'week': return this.forkDateTime(addUTCWeeks(this.date, amount)); case 'day': return this.forkDateTime(addUTCDays(this.date, amount)); case 'hour': return this.forkDateTime(addUTCHours(this.date, amount)); case 'minute': return this.forkDateTime(addUTCMinutes(this.date, amount)); case 'second': return this.forkDateTime(addUTCSeconds(this.date, amount)); case 'millisecond': return this.forkDateTime(addUTCMilliseconds(this.date, amount)); default: throw new Error('Invalid unit provided to `DateTime#add`'); } } subtract(amount, unit) { switch (unit) { case 'year': return this.forkDateTime(subUTCYears(this.date, amount)); case 'month': return this.forkDateTime(subUTCMonths(this.date, amount)); case 'week': return this.forkDateTime(subUTCWeeks(this.date, amount)); case 'day': return this.forkDateTime(subUTCDays(this.date, amount)); case 'hour': return this.forkDateTime(subUTCHours(this.date, amount)); case 'minute': return this.forkDateTime(subUTCMinutes(this.date, amount)); case 'second': return this.forkDateTime(subUTCSeconds(this.date, amount)); case 'millisecond': return this.forkDateTime(subUTCMilliseconds(this.date, amount)); default: throw new Error('Invalid unit provided to `DateTime#subtract`'); } } get(unit) { switch (unit) { case 'year': return this.date.getUTCFullYear(); case 'month': return this.date.getUTCMonth() + 1; case 'yearday': return getUTCYearDay(this.date); case 'weekday': return DateAdapter.WEEKDAYS[this.date.getUTCDay()]; case 'day': return this.date.getUTCDate(); case 'hour': return this.date.getUTCHours(); case 'minute': return this.date.getUTCMinutes(); case 'second': return this.date.getUTCSeconds(); case 'millisecond': return this.date.getUTCMilliseconds(); default: throw new Error('Invalid unit provided to `DateTime#set`'); } } set(unit, value) { if (unit === 'duration') { return new DateTime(this.date, this.timezone, value, this.generators); } if (unit === 'generators') { return new DateTime(this.date, this.timezone, this.duration, value); } let date = new Date(this.date); switch (unit) { case 'year': date.setUTCFullYear(value); break; case 'month': { // If the current day of the month // is greater than days in the month we are moving to, we need to also // set the day to the end of that month. const length = monthLength(value, date.getUTCFullYear()); const day = date.getUTCDate(); if (day > length) { date.setUTCDate(1); date.setUTCMonth(value); date = subUTCDays(date, 1); } else { date.setUTCMonth(value - 1); } break; } case 'day': date.setUTCDate(value); break; case 'hour': date.setUTCHours(value); break; case 'minute': date.setUTCMinutes(value); break; case 'second': date.setUTCSeconds(value); break; case 'millisecond': date.setUTCMilliseconds(value); break; default: throw new Error('Invalid unit provided to `DateTime#set`'); } return this.forkDateTime(date); } granularity(granularity, opt = {}) { let date = this.forkDateTime(this.date); switch (granularity) { case 'year': date = date.set('month', 1); case 'month': date = date.set('day', 1); break; case 'week': date = setDateToStartOfWeek(date, opt.weekStart); } switch (granularity) { case 'year': case 'month': case 'week': case 'day': date = date.set('hour', 0); case 'hour': date = date.set('minute', 0); case 'minute': date = date.set('second', 0); case 'second': date = date.set('millisecond', 0); case 'millisecond': return date; default: throw new Error('Invalid granularity provided to `DateTime#granularity`: ' + granularity); } } endGranularity(granularity, opt = {}) { let date = this.forkDateTime(this.date); switch (granularity) { case 'year': date = date.set('month', 12); case 'month': date = date.set('day', monthLength(date.get('month'), date.get('year'))); break; case 'week': date = setDateToEndOfWeek(date, opt.weekStart); } switch (granularity) { case 'year': case 'month': case 'week': case 'day': date = date.set('hour', 23); case 'hour': date = date.set('minute', 59); case 'minute': date = date.set('second', 59); case 'second': date = date.set('millisecond', 999); case 'millisecond': return date; default: throw new Error('Invalid granularity provided to `DateTime#granularity`: ' + granularity); } } toISOString() { return this.date.toISOString(); } toDateTime() { return this; } toJSON() { const json = { timezone: this.timezone, year: this.get('year'), month: this.get('month'), day: this.get('day'), hour: this.get('hour'), minute: this.get('minute'), second: this.get('second'), millisecond: this.get('millisecond') }; if (this.duration) { json.duration = this.duration; } return json; } valueOf() { return this.date.valueOf(); } assertIsValid() { if (isNaN(this.valueOf())) { throw new InvalidDateTimeError('DateTime has invalid date.'); } return true; } forkDateTime(date) { return new DateTime(date, this.timezone, this.duration, this.generators); } } function assertSameTimeZone(x, y) { if (x.timezone !== y.timezone) { throw new InvalidDateTimeError('Attempted to compare a datetime to another date in a different timezone: ' + JSON.stringify(x) + ' and ' + JSON.stringify(y)); } return true; } function setDateToStartOfWeek(date, wkst) { const index = orderedWeekdays(wkst).indexOf(date.get('weekday')); return date.subtract(index, 'day'); } function setDateToEndOfWeek(date, wkst) { const index = orderedWeekdays(wkst).indexOf(date.get('weekday')); return date.add(6 - index, 'day'); } function dateTimeSortComparer(a, b) { if (a.isAfter(b)) return 1; if (a.isBefore(b)) return -1; if (a.duration && b.duration) { if (a.duration > b.duration) return 1; if (a.duration < b.duration) return -1; } return 0; } function uniqDateTimes(dates) { return Array.from(new Map(dates.map(date => [date.toISOString(), date])).values()); } function orderedWeekdays(wkst = 'SU') { const wkdays = DateAdapter.WEEKDAYS.slice(); let index = wkdays.indexOf(wkst); while (index !== 0) { shiftArray(wkdays); index--; } return wkdays; } function shiftArray(array, from = 'first') { if (array.length === 0) { return array; } else if (from === 'first') { array.push(array.shift()); } else { array.unshift(array.pop()); } return array; } function getDifferenceBetweenWeekdays(x, y) { if (x === y) return 0; const result = DateAdapter.WEEKDAYS.indexOf(x) - DateAdapter.WEEKDAYS.indexOf(y); return result > 0 ? 7 - result : Math.abs(result); } /** * Returns the days in the given month. * * @param month base-1 * @param year */ function monthLength(month, year) { const block = { 1: 31, 2: getDaysInFebruary(year), 3: 31, 4: 30, 5: 31, 6: 30, 7: 31, 8: 31, 9: 30, 10: 31, 11: 30, 12: 31 }; return block[month]; } function getDaysInFebruary(year) { return isLeapYear(year) ? 29 : 28; } // taken from date-fn function isLeapYear(year) { return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0; } function getDaysInYear(year) { return isLeapYear(year) ? 366 : 365; } function getUTCYearDay(now) { const start = new Date(Date.UTC(now.getUTCFullYear(), 0, 1)); const diff = now.valueOf() - start.valueOf(); return 1 + Math.floor(diff / DateAdapter.MILLISECONDS_IN_DAY); } /** * These functions are basically lifted from `date-fns`, but changed * to use the UTC date methods, which `date-fns` doesn't support. */ function toInteger(input) { if (input === null || input === true || input === false) { return NaN; } const int = Number(input); if (isNaN(int)) { return int; } return int < 0 ? Math.ceil(int) : Math.floor(int); } function addMilliseconds(dirtyDate, dirtyAmount) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } const timestamp = dirtyDate.valueOf(); const amount = toInteger(dirtyAmount); return new Date(timestamp + amount); } function addUTCYears(date, input) { const amount = toInteger(input); return addUTCMonths(date, amount * 12); } function addUTCMonths(date, input) { const amount = toInteger(input); date = new Date(date); const desiredMonth = date.getUTCMonth() + amount; const dateWithDesiredMonth = new Date(0); dateWithDesiredMonth.setUTCFullYear(date.getUTCFullYear(), desiredMonth, 1); dateWithDesiredMonth.setUTCHours(0, 0, 0, 0); const daysInMonth = monthLength(dateWithDesiredMonth.getUTCMonth() + 1, dateWithDesiredMonth.getUTCFullYear()); // Set the last day of the new month // if the original date was the last day of the longer month date.setUTCMonth(desiredMonth, Math.min(daysInMonth, date.getUTCDate())); return date; } function addUTCWeeks(date, input) { const amount = toInteger(input); const days = amount * 7; return addUTCDays(date, days); } function addUTCDays(date, input) { // by adding milliseconds rather than days, we supress the native Date object's automatic // daylight savings time conversions which we don't want in UTC mode return addUTCMilliseconds(date, toInteger(input) * DateAdapter.MILLISECONDS_IN_DAY); } function addUTCHours(date, input) { const amount = toInteger(input); return addMilliseconds(date, amount * DateAdapter.MILLISECONDS_IN_HOUR); } function addUTCMinutes(date, input) { const amount = toInteger(input); return addMilliseconds(date, amount * DateAdapter.MILLISECONDS_IN_MINUTE); } function addUTCSeconds(date, input) { const amount = toInteger(input); return addMilliseconds(date, amount * DateAdapter.MILLISECONDS_IN_SECOND); } function addUTCMilliseconds(date, input) { const amount = toInteger(input); const timestamp = date.getTime(); return new Date(timestamp + amount); } function subUTCYears(date, amount) { return addUTCYears(date, -amount); } function subUTCMonths(date, amount) { return addUTCMonths(date, -amount); } function subUTCWeeks(date, amount) { return addUTCWeeks(date, -amount); } function subUTCDays(date, amount) { return addUTCDays(date, -amount); } function subUTCHours(date, amount) { return addUTCHours(date, -amount); } function subUTCMinutes(date, amount) { return addUTCMinutes(date, -amount); } function subUTCSeconds(date, amount) { return addUTCSeconds(date, -amount); } function subUTCMilliseconds(date, amount) { return addUTCMilliseconds(date, -amount); } class ArgumentError extends Error {} class InfiniteLoopError extends Error {} function numberSortComparer(a, b) { if (a > b) { return 1; } else if (b > a) { return -1; } else { return 0; } } function freqToGranularity(freq) { switch (freq) { case 'YEARLY': return 'year'; case 'MONTHLY': return 'month'; case 'WEEKLY': return 'week'; case 'DAILY': return 'day'; case 'HOURLY': return 'hour'; case 'MINUTELY': return 'minute'; case 'SECONDLY': return 'second'; case 'MILLISECONDLY': return 'millisecond'; default: throw new Error('unknown freq passed to freqToGranularity()'); } } function cloneJSON(json) { return JSON.parse(JSON.stringify(json)); } function dateInputToDateAdapter(date) { // prettier-ignore return date instanceof DateTime ? DateAdapterBase.adapter.fromDateTime(date) : date instanceof DateAdapterBase ? date : DateAdapterBase.adapter.fromDate(date); } function dateInputToDateTime(date, timezone) { if (date instanceof DateTime) { if (date.timezone !== timezone) { return DateAdapterBase.adapter.fromDateTime(date).set('timezone', timezone).toDateTime(); } return date; } return date instanceof DateAdapterBase ? date.set('timezone', timezone).toDateTime() : DateAdapterBase.adapter.fromDate(date).set('timezone', timezone).toDateTime(); } // export function normalizeDateInput( // dateAdapter: DateAdapterConstructor, // input: DateInput, // timezone: string | null, // ): DateTime { // if (input instanceof DateTime) { // if (input.timezone !== timezone) { // return dateAdapter // .fromDateTime(input) // .set('timezone', timezone) // .toDateTime(); // } // return input; // } // return input instanceof DateAdapter // ? input.set('timezone', timezone).toDateTime() // : new dateAdapter(input).toDateTime(); // } function normalizeDateTimeTimezone(date, timezone) { if (date.timezone !== timezone) { return DateAdapterBase.adapter.fromDateTime(date).set('timezone', timezone).toDateTime(); } return date; } class RuleOptionError extends Error {} function normalizeDefaultOptions(options) { let start; if (options.start instanceof DateTime) { start = options.start; } else if (options.start instanceof DateAdapterBase) { start = options.start.toDateTime(); } else if (DateAdapterBase.adapter.isDate(options.start)) { start = DateAdapterBase.adapter.fromDate(options.start).toDateTime(); } else { throw new RuleOptionError('"start" must be either a `DateAdapter` instance or an instance of the ' + 'date a DateAdapter is wrapping (e.g. `StandardDateAdapter` wraps a `Date`)'); } let end; if (options.end) { if (options.end instanceof DateTime) { end = options.end; } else if (options.end instanceof DateAdapterBase) { end = options.end.toDateTime(); } else if (DateAdapterBase.adapter.isDate(options.end)) { end = DateAdapterBase.adapter.fromDate(options.end).toDateTime(); } else { throw new RuleOptionError('"end" must be either be `undefined`, a `DateAdapter` instance, or an instance of the ' + 'date a DateAdapter is wrapping (e.g. `StandardDateAdapter` wraps a `Date`)'); } } if (options.duration !== undefined) { if (!Number.isInteger(options.duration)) { throw new RuleOptionError('"duration" expects a whole number'); } if (options.duration <= 0) { throw new RuleOptionError('"duration" must be greater than 0'); } } if (options.count !== undefined) { if (!Number.isInteger(options.count)) { throw new RuleOptionError('"count" must be a whole number'); } if (options.count < 0) { throw new RuleOptionError('"count" must be greater than 0'); } } if (options.end !== undefined && options.count !== undefined) { throw new RuleOptionError('"end" and "count" cannot both be present'); } return { start, end, count: options.count, duration: options.duration }; } function normalizeRuleOptions(recurrenceModules, options) { const normOptions = normalizeDefaultOptions(options); const startOptions = cloneJSON(options); recurrenceModules.forEach(mod => { mod.normalizeOptions(startOptions, normOptions); }); Object.keys(normOptions).forEach(key => { if (normOptions[key] === undefined) { delete normOptions[key]; } }); return normOptions; } function cloneRuleOptions(options) { const obj = cloneJSON(options); obj.start = options.start; if (options.end) obj.end = options.end; return obj; } class RecurrenceRuleError extends Error {} class ValidDateTime { constructor(date) { this.date = date; } } class InvalidDateTime { constructor(date) { this.date = date; } } function recurrenceRulesReducer(rules) { return iterator => rules.reduce((prev, curr) => { const rule = curr.get(iterator); if (rule) prev.push(rule); return prev; }, []); } class RecurrenceRulesIterator { constructor(recurrenceRules, options, args) { this.options = options; this.args = args; this.rules = []; this.iterator = // prettier-ignore this.options.count === undefined ? this.iterate() : this.args.reverse ? this.iterateWithReverseCount() : this.iterateWithCount(); this.options = Object.assign(Object.assign({}, cloneJSON(options)), { start: options.start, end: options.end }); this.reverse = this.options.count === undefined && args.reverse || false; const _this$normalizeDateTi = this.normalizeDateTimeArgs(args), start = _this$normalizeDateTi.start, end = _this$normalizeDateTi.end; if (options.count !== undefined) { this.start = options.start; } else if (start && options.start) { this.start = start.isAfterOrEqual(options.start) ? start : options.start; } else { this.start = start || options.start; } if (end && options.end) { this.end = end.isBeforeOrEqual(options.end) ? end : options.end; } else { this.end = end || options.end; } if (this.args.reverse && !(options.count !== undefined || this.end)) { throw new Error('When iterating in reverse, the rule must have an `end` or `count` ' + 'property or you must provide an `end` argument.'); } this.isInfinite = !this.end && this.options.count === undefined; this.hasDuration = !!this.options.duration; this.rules = Array.isArray(recurrenceRules) ? recurrenceRules : recurrenceRules(this); } [Symbol.iterator]() { return this.iterator; } next(args) { return this.iterator.next(args); } /** * In the pipe controller, we have an extra level of indirection with * the `run()` and `iterate()` methods. The `iterate()` method is the * method which actually runs the logic in the pipes. If we didn't * need to account for the `count` property of a rule, we would *only* * need the iterate method... so much simpler. But we do need to account * for rules with a `count` property. * * Rules with a `count` property need to begin iteration at the beginning * because the `count` is always from the rule's start time. So if someone * passes in a new start time as an argument to a rule with `count`, we * need to secretly iterate from the beginning, tracking the number of * iterations, and then only start yielding dates when we reach the section * the user cares about (or, if we hit our `count` quota, cancel iterating). * * Additionally, we need to handle iterating in reverse. In this case, we build * up a cache of dates between the rule's start time and the reverse iteration * start date. Once we hit the reverse iteration start date, we start * yielding dates in the cache, in reverse order. * * In general, I imagine the count number, if used, will be small. But a large * count will definitely have a negative performance affect. I don't think * there's anything to be done about this. */ *iterateWithReverseCount() { const dates = Array.from(this.iterateWithCount()).reverse(); let yieldArgs; const dateCache = dates.slice(); let date = dateCache.shift(); while (date) { if (yieldArgs && yieldArgs.skipToDate && date.isAfter(yieldArgs.skipToDate)) { date = dateCache.shift(); continue; } yieldArgs = yield date; if (yieldArgs && yieldArgs.skipToDate && yieldArgs.skipToDate.isAfterOrEqual(date)) { throw new Error('A provided `skipToDate` option must be greater than the last yielded date ' + '(or smaller, in the case of reverse iteration)'); } date = dateCache.shift(); } return undefined; } *iterateWithCount() { if (this.options.count === 0) return; const iterable = this.iterate(); const start = this.args.start || this.start; let date = iterable.next().value; let index = 1; let yieldArgs; while (date && index <= this.options.count) { index++; if (date.isBefore(start)) { date = iterable.next().value; continue; } if (yieldArgs && yieldArgs.skipToDate && date.isBefore(yieldArgs.skipToDate)) { date = iterable.next().value; continue; } yieldArgs = yield date; if (yieldArgs && yieldArgs.skipToDate && yieldArgs.skipToDate.isBeforeOrEqual(date)) { throw new Error('A provided `skipToDate` option must be greater than the last yielded date ' + '(or smaller, in the case of reverse iteration)'); } date = iterable.next().value; } return undefined; } *iterate() { let startingDate = this.start; if (this.reverse) startingDate = this.end; let date = this.nextDate(startingDate); while (date) { const args = yield this.normalizeRunOutput(date); if (args && args.skipToDate) { if (this.reverse ? args.skipToDate.isAfterOrEqual(date) : args.skipToDate.isBeforeOrEqual(date)) { // We cannot consistently skip backwards because after an iterator is "done" // it always returns undefined and you cannot reset it. Theoretically, it would be // fine to skip backwards if the iterator wasn't already "done", but this // would be prone to user error so we simply disallow skipping backwards altogether. throw new Error('A provided `skipToDate` option must be greater than the last yielded date ' + '(or smaller, in the case of reverse iteration)'); } date = this.nextDate(args.skipToDate); } else { date = this.nextDate(this.reverse ? date.subtract(1, 'millisecond') : date.add(1, 'millisecond')); } } return undefined; } /** * Loops through the recurrence rules until a valid date is found. */ nextDate(start) { let result = this.runRules(start.set('generators', [])); if (this.isDatePastEnd(result.date)) return null; let index = 0; while (result instanceof InvalidDateTime && index < 50) { result = this.runRules(result.date); if (this.isDatePastEnd(result.date)) return null; index++; } if (result instanceof InvalidDateTime) { throw new RecurrenceRuleError(`Failed to find a matching occurrence in ${index} iterations. ` + `Last iterated date: "${result.date.toISOString()}"`); } if (this.reverse ? start.isBefore(result.date) : start.isAfter(result.date)) { throw new RecurrenceRuleError('An error occurred in a recurrence rule. If this happened using ' + 'the rSchedule provided recurrence rules, you should ' + 'open an issue in the rSchedule repo. The maintainer is going to ' + 'want to know how to recreate the error.'); } return result.date; } /** * Performs one run of the recurrence rules and returns the result. * It's a slightly optimized reducer function. */ runRules(start) { let result = new ValidDateTime(start); for (const rule of this.rules) { if (result instanceof InvalidDateTime) { return result; } result = rule.run(result.date); } return result; } isDatePastEnd(date) { return this.reverse ? date.isBefore(this.start) : this.end && date.isAfter(this.end); } normalizeRunOutput(date) { return this.hasDuration ? date.set('duration', this.options.duration) : date; } normalizeDateTimeArgs(args) { return { start: args.start && normalizeDateTimeTimezone(args.start, this.options.start.timezone), end: args.end && normalizeDateTimeTimezone(args.end, this.options.start.timezone) }; } } /***/ }), /***/ "./node_modules/@rschedule/core/es2015/rules.js": /*!******************************************************!*\ !*** ./node_modules/@rschedule/core/es2015/rules.js ***! \******************************************************/ /*! exports provided: ByDayOfMonthRule, ByDayOfMonthRuleModule, ByDayOfWeekRule, ByDayOfWeekRuleModule, ByHourOfDayRule, ByHourOfDayRuleModule, ByMillisecondOfSecondRule, ByMillisecondOfSecondRuleModule, ByMinuteOfHourRule, ByMinuteOfHourRuleModule, ByMonthOfYearRule, ByMonthOfYearRuleModule, BySecondOfMinuteRule, BySecondOfMinuteRuleModule, FrequencyRule, FrequencyRuleModule, ICAL_RULES, RevByDayOfMonthRule, RevByDayOfWeekRule, RevByHourOfDayRule, RevByMillisecondOfSecondRule, RevByMinuteOfHourRule, RevByMonthOfYearRule, RevBySecondOfMinuteRule, RevFrequencyRule, getPrevWeekdaysOfMonth, getPrevWeekdaysOfYear */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ByDayOfMonthRule", function() { return ByDayOfMonthRule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ByDayOfMonthRuleModule", function() { return ByDayOfMonthRuleModule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ByDayOfWeekRule", function() { return ByDayOfWeekRule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ByDayOfWeekRuleModule", function() { return ByDayOfWeekRuleModule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ByHourOfDayRule", function() { return ByHourOfDayRule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ByHourOfDayRuleModule", function() { return ByHourOfDayRuleModule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ByMillisecondOfSecondRule", function() { return ByMillisecondOfSecondRule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ByMillisecondOfSecondRuleModule", function() { return ByMillisecondOfSecondRuleModule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ByMinuteOfHourRule", function() { return ByMinuteOfHourRule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ByMinuteOfHourRuleModule", function() { return ByMinuteOfHourRuleModule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ByMonthOfYearRule", function() { return ByMonthOfYearRule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ByMonthOfYearRuleModule", function() { return ByMonthOfYearRuleModule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BySecondOfMinuteRule", function() { return BySecondOfMinuteRule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BySecondOfMinuteRuleModule", function() { return BySecondOfMinuteRuleModule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FrequencyRule", function() { return FrequencyRule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FrequencyRuleModule", function() { return FrequencyRuleModule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ICAL_RULES", function() { return ICAL_RULES; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RevByDayOfMonthRule", function() { return RevByDayOfMonthRule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RevByDayOfWeekRule", function() { return RevByDayOfWeekRule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RevByHourOfDayRule", function() { return RevByHourOfDayRule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RevByMillisecondOfSecondRule", function() { return RevByMillisecondOfSecondRule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RevByMinuteOfHourRule", function() { return RevByMinuteOfHourRule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RevByMonthOfYearRule", function() { return RevByMonthOfYearRule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RevBySecondOfMinuteRule", function() { return RevBySecondOfMinuteRule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RevFrequencyRule", function() { return RevFrequencyRule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPrevWeekdaysOfMonth", function() { return getPrevWeekdaysOfMonth; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPrevWeekdaysOfYear", function() { return getPrevWeekdaysOfYear; }); /* harmony import */ var _rschedule_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rschedule/core */ "./node_modules/@rschedule/core/es2015/main.js"); class RecurrenceRule { constructor(processor) { this.processor = processor; this.start = processor.start; this.end = processor.end; this.options = processor.options; } } class FrequencyRule extends RecurrenceRule { constructor(processor, initDate) { super(processor); this.initDate = initDate; this.intervalUnit = Object(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["freqToGranularity"])(this.options.frequency); this.firstIntervalStartDate = this.normalizedStartDate(this.options.start); this.intervalStartDate = this.firstIntervalStartDate; this.intervalEndDate = this.normalizedEndDate(this.firstIntervalStartDate); this.skipToInterval(this.initDate); } run(date) { return this.validateDate(new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["ValidDateTime"](date)); } validateDate(arg) { const date = arg.date; if (arg instanceof _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["ValidDateTime"] && this.dateIsWithinInterval(date)) { return arg; } this.skipToInterval(date); return new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["InvalidDateTime"]( // if the interval is 1, date will always be within the interval this.dateIsWithinInterval(date) ? date : this.setToCurrentInterval()); } setToCurrentInterval() { return this.intervalStartDate; } normalizedStartDate(date) { if (this.options.frequency === 'WEEKLY') { return date.granularity('week', { weekStart: this.options.weekStart }); } return date.granularity(this.intervalUnit); } normalizedEndDate(start) { switch (this.options.frequency) { case 'YEARLY': return start.add(1, 'year'); case 'MONTHLY': return start.add(1, 'month'); case 'WEEKLY': return start.add(1, 'week'); case 'DAILY': return start.add(1, 'day'); case 'HOURLY': return start.add(1, 'hour'); case 'MINUTELY': return start.add(1, 'minute'); case 'SECONDLY': return start.add(1, 'second'); case 'MILLISECONDLY': return start.add(1, 'millisecond'); default: throw new Error(`Unknown frequency ${this.options.frequency}`); } } skipToInterval(date) { const amount = this.intervalDifference(date); this.intervalStartDate = this.firstIntervalStartDate.add(amount, this.intervalUnit); this.intervalEndDate = this.normalizedEndDate(this.intervalStartDate); } dateIsWithinInterval(date) { return this.intervalStartDate.isBeforeOrEqual(date) && this.intervalEndDate.isAfter(date); } intervalDifference(date) { return intervalDifferenceBetweenDates({ first: this.firstIntervalStartDate, second: date, unit: this.intervalUnit, interval: this.options.interval, weekStart: this.options.weekStart, direction: 'after' }); } } /** * Given the frequency (unit) and interval, this function finds * how many jumps forward the first date needs in order to equal * or exceed the second date. * * For example: * * 1. Unit is daily and interval is 1. The second date is 3 days * after the first. This will return 3. * 2. Unit is yearly and interval is 1. The second date is 3 days * after the first. This will return 0. * 3. Unit is yearly and interval is 3. The second date is 4 years * after the first. This will return 6. */ function intervalDifferenceBetweenDates({ first, second, unit, interval, weekStart, direction }) { let difference = (() => { let intervalDuration; let months; switch (unit) { case 'year': months = (second.get('year') - first.get('year')) * 12; months = months + second.get('month') - first.get('month'); return Math.floor(months / 12); case 'month': months = (second.get('year') - first.get('year')) * 12; months = months + second.get('month') - first.get('month'); return months; case 'week': first = first.granularity('week', { weekStart }); intervalDuration = _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["DateAdapter"].MILLISECONDS_IN_WEEK; break; case 'day': intervalDuration = _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["DateAdapter"].MILLISECONDS_IN_DAY; break; case 'hour': intervalDuration = _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["DateAdapter"].MILLISECONDS_IN_HOUR; break; case 'minute': intervalDuration = _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["DateAdapter"].MILLISECONDS_IN_MINUTE; break; case 'second': intervalDuration = _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["DateAdapter"].MILLISECONDS_IN_SECOND; break; case 'millisecond': intervalDuration = 1; break; default: throw new Error('Unexpected `unit` value'); } const diff = second.valueOf() - first.valueOf(); return Math.floor(diff / intervalDuration); })(); const fn = direction === 'after' ? Math.ceil : Math.floor; difference = fn(difference / interval) * interval; return difference; } class RevFrequencyRule extends FrequencyRule { setToCurrentInterval() { return this.intervalEndDate.subtract(1, 'millisecond'); } intervalDifference(date) { return intervalDifferenceBetweenDates({ first: this.firstIntervalStartDate, second: date, unit: this.intervalUnit, interval: this.options.interval, weekStart: this.options.weekStart, direction: 'before' }); } } const FREQUENCIES = ['MILLISECONDLY', 'SECONDLY', 'MINUTELY', 'HOURLY', 'DAILY', 'WEEKLY', 'MONTHLY', 'YEARLY']; const FrequencyRuleModule = { name: 'FrequencyRule', get: processor => { if (processor.options.byMillisecondOfSecond !== undefined || processor.options.frequency !== 'MILLISECONDLY') { return null; } if (processor.reverse) return new RevFrequencyRule(processor, processor.end); return new FrequencyRule(processor, processor.start); }, normalizeOptions: (options, norm) => { if (!FREQUENCIES.includes(options.frequency)) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RuleOptionError"](`"frequency" must be one of ${JSON.stringify(FREQUENCIES)}`); } if (options.interval !== undefined) { if (!Number.isInteger(options.interval)) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RuleOptionError"]('"interval" expects a whole number'); } if (options.interval < 1) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RuleOptionError"]('"interval" cannot be less than 1'); } } if (options.weekStart !== undefined) { if (!_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["DateAdapter"].WEEKDAYS.includes(options.weekStart)) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RuleOptionError"](`"weekStart" must be one of ${JSON.stringify(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["DateAdapter"].WEEKDAYS)}`); } } norm.frequency = options.frequency; norm.interval = options.interval || 1; norm.weekStart = options.weekStart || 'MO'; }, deps: () => [FrequencyRuleModule] }; function ruleOptionFilled(option) { return Array.isArray(option) && option.length > 0; } const freqCache = new WeakMap(); class RecurrenceRuleBase extends RecurrenceRule { constructor(processor) { super(processor); if (!freqCache.has(this.processor)) { freqCache.set(this.processor, new FrequencyRule(processor, processor.start)); } this.frequency = freqCache.get(this.processor); } validateDate(arg) { return this.frequency.validateDate(arg); } } class RevRecurrenceRuleBase extends RecurrenceRule { constructor(processor) { super(processor); if (!freqCache.has(this.processor)) { freqCache.set(this.processor, new RevFrequencyRule(processor, processor.end)); } this.frequency = freqCache.get(this.processor); } validateDate(arg) { return this.frequency.validateDate(arg); } } /** * Contains shared logic for ByHourOfDay, ByMinuteOfHour, * BySecondOfMinute, and ByMillisecondOfSecond reverse rule pipes */ class RevByTimeOfUnitRule extends RevRecurrenceRuleBase { run(date) { // e.g. const currentTime = date.get('hour'); const currentTime = date.get(this.granularity); // e.g. for (const time of this.options.byHourOfDay) { for (const time of this.option) { if (currentTime < time) continue; if (currentTime === time) { return this.validateDate(new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["ValidDateTime"](date)); } // e.g. return this.nextValidDate(args, date.endGranularity('day').set('hour', time)); return this.validateDate(new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["InvalidDateTime"](date.endGranularity(this.baseGranularity).set(this.granularity, time))); } return this.validateDate(new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["InvalidDateTime"](date // e.g. .endGranularity('day') .endGranularity(this.baseGranularity) // e.g. .subtract(1, 'day') .subtract(1, this.baseGranularity) // e.g. .set('hour', this.options.byHourOfDay[0]); .set(this.granularity, this.option[0]))); } } class RevByMillisecondOfSecondRule extends RevByTimeOfUnitRule { constructor() { super(...arguments); this.baseGranularity = 'second'; this.granularity = 'millisecond'; this.option = this.options.byMillisecondOfSecond.slice().reverse(); } } /** * Contains shared logic for ByHourOfDay, ByMinuteOfHour, * BySecondOfMinute, and ByMillisecondOfSecond rule pipes */ class ByTimeOfUnitRule extends RecurrenceRuleBase { run(date) { // e.g. const currentTime = date.get('hour'); const currentTime = date.get(this.granularity); // e.g. for (const time of this.options.byHourOfDay) { for (const time of this.option) { if (currentTime > time) continue; if (currentTime === time) { return this.validateDate(new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["ValidDateTime"](date)); } // e.g. return this.nextValidDate(args, date.granularity('day').set('hour', time)); return this.validateDate(new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["InvalidDateTime"](date.granularity(this.baseGranularity).set(this.granularity, time))); } return this.validateDate(new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["InvalidDateTime"](date // e.g. .granularity('day') .granularity(this.baseGranularity) // e.g. .add(1, 'day') .add(1, this.baseGranularity) // e.g. .set('hour', this.options.byHourOfDay[0]); .set(this.granularity, this.option[0]))); } } class ByMillisecondOfSecondRule extends ByTimeOfUnitRule { constructor() { super(...arguments); this.baseGranularity = 'second'; this.granularity = 'millisecond'; this.option = this.options.byMillisecondOfSecond; } } const ByMillisecondOfSecondRuleModule = { name: 'ByMillisecondOfSecond', get: processor => { if (processor.options.byMillisecondOfSecond === undefined) return null; if (processor.reverse) return new RevByMillisecondOfSecondRule(processor); return new ByMillisecondOfSecondRule(processor); }, normalizeOptions: (options, norm) => { if (options.byMillisecondOfSecond !== undefined) { if (!ruleOptionFilled(options.byMillisecondOfSecond)) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RuleOptionError"]('"byMillisecondOfSecond" expects a non-empty array'); } if (options.byMillisecondOfSecond.some(num => num < 0 || num > 999)) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RuleOptionError"]('"byMillisecondOfSecond" values must be >= 0 && <= 999'); } norm.byMillisecondOfSecond = options.byMillisecondOfSecond; norm.byMillisecondOfSecond.sort(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["numberSortComparer"]); } else if (options.frequency !== 'MILLISECONDLY') { norm.byMillisecondOfSecond = [norm.start.get('millisecond')]; } }, deps: () => [FrequencyRuleModule, ByMillisecondOfSecondRuleModule] }; class RevBySecondOfMinuteRule extends RevByTimeOfUnitRule { constructor() { super(...arguments); this.baseGranularity = 'minute'; this.granularity = 'second'; this.option = this.options.bySecondOfMinute.slice().reverse(); } } class BySecondOfMinuteRule extends ByTimeOfUnitRule { constructor() { super(...arguments); this.baseGranularity = 'minute'; this.granularity = 'second'; this.option = this.options.bySecondOfMinute; } } const BySecondOfMinuteRuleModule = { name: 'BySecondOfMinute', get: processor => { if (processor.options.bySecondOfMinute === undefined) return null; if (processor.reverse) return new RevBySecondOfMinuteRule(processor); return new BySecondOfMinuteRule(processor); }, normalizeOptions: (options, norm) => { if (options.bySecondOfMinute !== undefined) { if (!ruleOptionFilled(options.bySecondOfMinute)) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RuleOptionError"]('"bySecondOfMinute" expects a non-empty array'); } if (options.bySecondOfMinute.some(num => num < 0 || num > 60)) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RuleOptionError"]('"bySecondOfMinute" values must be >= 0 && <= 60'); } norm.bySecondOfMinute = options.bySecondOfMinute; norm.bySecondOfMinute.sort(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["numberSortComparer"]); } else if (!['SECONDLY', 'MILLISECONDLY'].includes(options.frequency)) { norm.bySecondOfMinute = [norm.start.get('second')]; } }, deps: () => [FrequencyRuleModule, BySecondOfMinuteRuleModule, ByMillisecondOfSecondRuleModule] }; class RevByMinuteOfHourRule extends RevByTimeOfUnitRule { constructor() { super(...arguments); this.baseGranularity = 'hour'; this.granularity = 'minute'; this.option = this.options.byMinuteOfHour.slice().reverse(); } } class ByMinuteOfHourRule extends ByTimeOfUnitRule { constructor() { super(...arguments); this.baseGranularity = 'hour'; this.granularity = 'minute'; this.option = this.options.byMinuteOfHour; } } const ByMinuteOfHourRuleModule = { name: 'ByMinuteOfHour', get: processor => { if (processor.options.byMinuteOfHour === undefined) return null; if (processor.reverse) return new RevByMinuteOfHourRule(processor); return new ByMinuteOfHourRule(processor); }, normalizeOptions: (options, norm) => { if (options.byMinuteOfHour !== undefined) { if (!ruleOptionFilled(options.byMinuteOfHour)) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RuleOptionError"]('"byMinuteOfHour" expects a non-empty array'); } if (options.byMinuteOfHour.some(num => num < 0 || num > 59)) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RuleOptionError"]('"byMinuteOfHour" values must be >= 0 && <= 59'); } norm.byMinuteOfHour = options.byMinuteOfHour; norm.byMinuteOfHour.sort(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["numberSortComparer"]); } else if (!['MINUTELY', 'SECONDLY', 'MILLISECONDLY'].includes(options.frequency)) { norm.byMinuteOfHour = [norm.start.get('minute')]; } }, deps: () => [FrequencyRuleModule, ByMinuteOfHourRuleModule, BySecondOfMinuteRuleModule, ByMillisecondOfSecondRuleModule] }; class RevByHourOfDayRule extends RevByTimeOfUnitRule { constructor() { super(...arguments); this.baseGranularity = 'day'; this.granularity = 'hour'; this.option = this.options.byHourOfDay.slice().reverse(); } } class ByHourOfDayRule extends ByTimeOfUnitRule { constructor() { super(...arguments); this.baseGranularity = 'day'; this.granularity = 'hour'; this.option = this.options.byHourOfDay; } } const ByHourOfDayRuleModule = { name: 'ByHourOfDay', get: processor => { if (processor.options.byHourOfDay === undefined) return null; if (processor.reverse) return new RevByHourOfDayRule(processor); return new ByHourOfDayRule(processor); }, normalizeOptions: (options, norm) => { if (options.byHourOfDay !== undefined) { if (!ruleOptionFilled(options.byHourOfDay)) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RuleOptionError"]('"byHourOfDay" expects a non-empty array'); } if (options.byHourOfDay.some(num => num < 0 || num > 23)) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RuleOptionError"]('"byHourOfDay" values must be >= 0 && <= 23'); } norm.byHourOfDay = options.byHourOfDay; norm.byHourOfDay.sort(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["numberSortComparer"]); } else if (['YEARLY', 'MONTHLY', 'WEEKLY', 'DAILY'].includes(options.frequency)) { norm.byHourOfDay = [norm.start.get('hour')]; } }, deps: () => [FrequencyRuleModule, ByHourOfDayRuleModule, ByMinuteOfHourRuleModule, BySecondOfMinuteRuleModule, ByMillisecondOfSecondRuleModule] }; function getNextWeekday(date, weekday) { return date.add(Object(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["getDifferenceBetweenWeekdays"])(date.get('weekday'), weekday), 'day'); } function getNthWeekdayOfMonth(date, weekday, nth) { let base = date.set('day', 1); if (nth < 0) { base = base.add(1, 'month'); } base = getNextWeekday(base, weekday); // when nth is negative, adding it will act as subtraction return nth < 0 ? base.add(nth, 'week') : base.add(nth - 1, 'week'); } class ByDayOfMonthRule extends RecurrenceRuleBase { run(date) { const normalizedByDayOfMonth = normalizeByDayOfMonth(date, this.options.byDayOfMonth, this.options.byDayOfWeek); const currentDay = date.get('day'); for (const day of normalizedByDayOfMonth) { if (currentDay > day) continue; if (currentDay === day) { return this.validateDate(new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["ValidDateTime"](date)); } return this.validateDate(new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["InvalidDateTime"](date.granularity('month').set('day', day))); } let next; let nextMonth = date; let index = 0; while (!next && index < 30) { nextMonth = nextMonth.granularity('month').add(1, 'month'); next = normalizeByDayOfMonth(nextMonth, this.options.byDayOfMonth, this.options.byDayOfWeek)[0]; index++; } if (index >= 13) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RecurrenceRuleError"]('byDayOfMonth Infinite while loop'); } return this.validateDate(new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["InvalidDateTime"](nextMonth.set('day', next))); } } /** * Does a few things: * * 1. filters out byDayOfMonth entries which are not applicable * to current month * 2. negative entries to positive ones * 3. if a byDayOfWeek option is given, removes days which are * not on the correct day of the week */ function normalizeByDayOfMonth(date, byDayOfMonth, byDayOfWeek) { const lengthOfMonth = date.endGranularity('month').get('day'); let normalizedByDayOfMonth = byDayOfMonth.filter(day => lengthOfMonth >= Math.abs(day)).map(day => day > 0 ? day : lengthOfMonth + day + 1); if (byDayOfWeek) { const base = date.granularity('month'); const filteredByDayOfMonth = []; byDayOfWeek.forEach(entry => { if (typeof entry === 'string') { filteredByDayOfMonth.push(...normalizedByDayOfMonth.filter(day => base.set('day', day).get('weekday') === entry)); return; } const nthWeekdayOfMonth = getNthWeekdayOfMonth(date, ...entry).get('day'); if (normalizedByDayOfMonth.includes(nthWeekdayOfMonth)) { filteredByDayOfMonth.push(nthWeekdayOfMonth); } }); normalizedByDayOfMonth = Array.from(new Set(filteredByDayOfMonth)); } return normalizedByDayOfMonth.sort((a, b) => { if (a > b) return 1; if (a < b) return -1;else return 0; }); } class RevByDayOfMonthRule extends RevRecurrenceRuleBase { run(date) { const normalizedByDayOfMonth = normalizeByDayOfMonth(date, this.options.byDayOfMonth, this.options.byDayOfWeek).reverse(); const currentDay = date.get('day'); for (const day of normalizedByDayOfMonth) { if (currentDay < day) continue; if (currentDay === day) { return this.validateDate(new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["ValidDateTime"](date)); } return this.validateDate(new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["InvalidDateTime"](date.endGranularity('month').set('day', day))); } let next; let nextMonth = date; let index = 0; while (!next && index < 30) { nextMonth = nextMonth.endGranularity('month').subtract(1, 'month'); next = normalizeByDayOfMonth(nextMonth, this.options.byDayOfMonth, this.options.byDayOfWeek).pop(); index++; } if (index >= 13) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RecurrenceRuleError"]('byDayOfMonth Infinite while loop'); } return this.validateDate(new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["InvalidDateTime"](nextMonth.set('day', next))); } } const ByDayOfMonthRuleModule = { name: 'ByDayOfMonth', get: processor => { if (processor.options.byDayOfMonth === undefined) return null; if (processor.reverse) return new RevByDayOfMonthRule(processor); return new ByDayOfMonthRule(processor); }, normalizeOptions: (options, norm) => { if (options.byDayOfMonth !== undefined) { if (options.frequency === 'WEEKLY') { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RuleOptionError"]('when "frequency" is "WEEKLY", "byDayOfMonth" cannot be present'); } if (!ruleOptionFilled(options.byDayOfMonth)) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RuleOptionError"]('"byDayOfMonth" expects a non-empty array'); } if (options.byDayOfMonth.some(num => num === 0 || num < -31 || num > 31)) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RuleOptionError"]('"byDayOfMonth" values must be `num !== 0 && num <= 31 && num >= -31`'); } norm.byDayOfMonth = options.byDayOfMonth.slice(); } else if (!(ruleOptionFilled(options.byDayOfWeek) || ruleOptionFilled(options.byDayOfYear)) && ['YEARLY', 'MONTHLY'].includes(options.frequency)) { norm.byDayOfMonth = [norm.start.get('day')]; } }, deps: () => [FrequencyRuleModule, ByDayOfMonthRuleModule, ByHourOfDayRuleModule, ByMinuteOfHourRuleModule, BySecondOfMinuteRuleModule, ByMillisecondOfSecondRuleModule] }; function getNthWeekdayOfYear(date, weekday, nth) { let base = date.set('month', 1).set('day', 1); if (nth < 0) { base = base.add(1, 'year'); } base = getNextWeekday(base, weekday); // when nth is negative, adding it will act as subtraction return nth < 0 ? base.add(nth, 'week') : base.add(nth - 1, 'week'); } function getPreviousWeekday(date, weekday) { const diff = Object(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["getDifferenceBetweenWeekdays"])(date.get('weekday'), weekday); return date.subtract(diff === 0 ? 0 : 7 - diff, 'day'); } class RevByDayOfWeekRule extends RevRecurrenceRuleBase { run(date) { if (this.options.frequency === 'YEARLY') { return this.options.byMonthOfYear === undefined ? this.expandYearly(date) : this.expandMonthly(date); } else if (this.options.frequency === 'MONTHLY') { return this.expandMonthly(date); } return this.expand(date); } expandYearly(date) { let next = getPrevWeekdaysOfYear(date, this.options.byDayOfWeek)[0]; let index = 0; let base = date; // If we can't find a valid date this year, // search the previous year. Only search the past 28 years. // (the calendar repeats on a 28 year cycle, according // to the internet). while (!next && index < 28) { index++; base = base.granularity('year').subtract(1, 'millisecond'); next = getPrevWeekdaysOfYear(base, this.options.byDayOfWeek)[0]; } if (!next) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RecurrenceRuleError"]('The byDayOfWeek rule appears to contain an impossible combination'); } return this.result(date, next); } expandMonthly(date) { let next = getPrevWeekdaysOfMonth(date, this.options.byDayOfWeek)[0]; let index = 0; let base = date; // TODO: performance improvment // If, in the first year, a match isn't found, we should be able to // jumpt to the previous leap year and check that. Or, if already on // a leap year, we can just error immediately. // If we can't find a valid date this month, // search the previous month. Only search the past 4 years // (to account for leap year). while (!next && index < 50) { index++; base = base.granularity('month').subtract(1, 'millisecond'); next = getPrevWeekdaysOfMonth(base, this.options.byDayOfWeek)[0]; } if (!next) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RecurrenceRuleError"]('The byDayOfWeek rule appears to contain an impossible combination'); } return this.result(date, next); } expand(date) { const next = this.options.byDayOfWeek.map(weekday => getPreviousWeekday(date, weekday)).sort(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["dateTimeSortComparer"]).pop(); return this.result(date, next); } result(date, next) { if (next.isEqual(date)) { return this.validateDate(new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["ValidDateTime"](date)); } return this.validateDate(new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["InvalidDateTime"](next.endGranularity('day'))); } } /** For each byDayOfWeek entry, find the previous DateTime */ function getPrevWeekdaysOfYear(date, byDayOfWeek) { const normalizedNthWeekdaysOfYear = byDayOfWeek.filter(entry => Array.isArray(entry)).map(entry => getNthWeekdayOfYear(date, ...entry)); const normalizedNextWeekdays = byDayOfWeek.filter(entry => typeof entry === 'string').map(weekday => getPreviousWeekday(date, weekday)).filter(entry => entry.get('year') === date.get('year')); return Object(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["uniqDateTimes"])([...normalizedNthWeekdaysOfYear, ...normalizedNextWeekdays]).filter(entry => entry.isBeforeOrEqual(date)).sort(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["dateTimeSortComparer"]).reverse(); } /** For each byDayOfWeek entry, find the previous DateTime */ function getPrevWeekdaysOfMonth(date, byDayOfWeek) { const normalizedNthWeekdaysOfMonth = byDayOfWeek.filter(entry => Array.isArray(entry)).map(entry => getNthWeekdayOfMonth(date, ...entry)); const normalizedNextWeekdays = byDayOfWeek.filter(entry => typeof entry === 'string').map(weekday => getPreviousWeekday(date, weekday)).filter(entry => entry.get('year') === date.get('year') && entry.get('month') === date.get('month')); return Object(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["uniqDateTimes"])([...normalizedNthWeekdaysOfMonth, ...normalizedNextWeekdays]).filter(entry => entry.isBeforeOrEqual(date)).sort(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["dateTimeSortComparer"]).reverse(); } class ByDayOfWeekRule extends RecurrenceRuleBase { run(date) { if (this.options.frequency === 'YEARLY') { return this.options.byMonthOfYear === undefined ? this.expandYearly(date) : this.expandMonthly(date); } else if (this.options.frequency === 'MONTHLY') { return this.expandMonthly(date); } return this.expand(date); } expandYearly(date) { let next = getNextWeekdaysOfYear(date, this.options.byDayOfWeek)[0]; let index = 0; let base = date; // If we can't find a valid date this year, // search next year. Only search the next 28 years. // (the calendar repeats on a 28 year cycle, according // to the internet). while (!next && index < 28) { index++; base = base.granularity('year').add(1, 'year'); next = getNextWeekdaysOfYear(base, this.options.byDayOfWeek)[0]; } if (!next) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RecurrenceRuleError"]('The byDayOfWeek rule appears to contain an impossible combination'); } return this.result(date, next); } expandMonthly(date) { let next = getNextWeekdaysOfMonth(date, this.options.byDayOfWeek)[0]; let index = 0; let base = date; // TODO: performance improvment // If, in the first year, a match isn't found, we should be able to // jumpt to the next leap year and check that. Or, if already on // a leap year, we can just error immediately. // If we can't find a valid date this month, // search the next month. Only search the next 4 years // (to account for leap year). while (!next && index < 50) { index++; base = base.granularity('month').add(1, 'month'); next = getNextWeekdaysOfMonth(base, this.options.byDayOfWeek)[0]; } if (!next) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RecurrenceRuleError"]('The byDayOfWeek rule appears to contain an impossible combination'); } return this.result(date, next); } expand(date) { const next = this.options.byDayOfWeek.map(weekday => getNextWeekday(date, weekday)).sort(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["dateTimeSortComparer"])[0]; return this.result(date, next); } result(date, next) { if (next.isEqual(date)) { return this.validateDate(new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["ValidDateTime"](date)); } return this.validateDate(new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["InvalidDateTime"](next.granularity('day'))); } } /** For each byDayOfWeek entry, find the next DateTime */ function getNextWeekdaysOfYear(date, byDayOfWeek) { const normalizedNthWeekdaysOfYear = byDayOfWeek.filter(entry => Array.isArray(entry)).map(entry => getNthWeekdayOfYear(date, ...entry)); const normalizedNextWeekdays = byDayOfWeek.filter(entry => typeof entry === 'string').map(weekday => getNextWeekday(date, weekday)).filter(entry => entry.get('year') === date.get('year')); return Object(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["uniqDateTimes"])([...normalizedNthWeekdaysOfYear, ...normalizedNextWeekdays]).filter(entry => entry.isAfterOrEqual(date)).sort(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["dateTimeSortComparer"]); } /** For each byDayOfWeek entry, find the next DateTime */ function getNextWeekdaysOfMonth(date, byDayOfWeek) { const normalizedNthWeekdaysOfMonth = byDayOfWeek.filter(entry => Array.isArray(entry)).map(entry => getNthWeekdayOfMonth(date, ...entry)); const normalizedNextWeekdays = byDayOfWeek.filter(entry => typeof entry === 'string').map(weekday => getNextWeekday(date, weekday)).filter(entry => entry.get('year') === date.get('year') && entry.get('month') === date.get('month')); return Object(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["uniqDateTimes"])([...normalizedNthWeekdaysOfMonth, ...normalizedNextWeekdays]).filter(entry => entry.isAfterOrEqual(date)).sort(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["dateTimeSortComparer"]); } const ByDayOfWeekRuleModule = { name: 'ByDayOfWeek', get: processor => { if (processor.options.byDayOfWeek === undefined) return null; if (processor.reverse) return new RevByDayOfWeekRule(processor); return new ByDayOfWeekRule(processor); }, normalizeOptions: (options, norm) => { if (options.byDayOfWeek !== undefined) { if (!ruleOptionFilled(options.byDayOfWeek)) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RuleOptionError"]('"byDayOfWeek" expects a non-empty array'); } const invalidWeeday = options.byDayOfWeek.find(day => Array.isArray(day) ? !_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["DateAdapter"].WEEKDAYS.includes(day[0]) : !_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["DateAdapter"].WEEKDAYS.includes(day)); if (invalidWeeday) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RuleOptionError"](`"byDayOfWeek" expects weedays in the form ` + `${JSON.stringify(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["DateAdapter"].WEEKDAYS)} but "${invalidWeeday}" was provided`); } if (!['YEARLY', 'MONTHLY'].includes(options.frequency) && options.byDayOfWeek.some(weekday => Array.isArray(weekday))) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RuleOptionError"]('"byDayOfWeek" can only include a numeric value (i.e. `[string, number]`) when the "frequency" is ' + 'either "MONTHLY" or "YEARLY"'); } if (options.frequency === 'MONTHLY' && options.byDayOfWeek.some(weekday => Array.isArray(weekday) && (weekday[1] < -31 || weekday[1] === 0 || weekday[1] > 31))) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RuleOptionError"]('when "frequency" is "MONTHLY", each "byDayOfWeek" can optionally only' + ' have a numeric value >= -31 and <= 31 and !== 0'); } if (options.frequency === 'YEARLY' && options.byDayOfWeek.some(weekday => Array.isArray(weekday) && (weekday[1] < -366 || weekday[1] === 0 || weekday[1] > 366))) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RuleOptionError"]('when "frequency" is "YEARLY", each "byDayOfWeek" can optionally only' + ' have a numeric value >= -366 and <= 366 and !== 0'); } norm.byDayOfWeek = options.byDayOfWeek; } else if (!ruleOptionFilled(options.byDayOfMonth) && options.frequency === 'WEEKLY') { norm.byDayOfWeek = [norm.start.get('weekday')]; } }, deps: () => [FrequencyRuleModule, ByDayOfWeekRuleModule, ByHourOfDayRuleModule, ByMinuteOfHourRuleModule, BySecondOfMinuteRuleModule, ByMillisecondOfSecondRuleModule] }; class RevByMonthOfYearRule extends RevRecurrenceRuleBase { constructor() { super(...arguments); this.option = this.processor.options.byMonthOfYear.slice().reverse(); } run(date) { const currentMonth = date.get('month'); for (const month of this.option) { if (currentMonth < month) continue; if (currentMonth === month) { return this.validateDate(new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["ValidDateTime"](date)); } return this.validateDate(new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["InvalidDateTime"](date.endGranularity('year').set('month', month))); } return this.validateDate(new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["InvalidDateTime"](date.endGranularity('year').subtract(1, 'year').set('month', this.option[0]))); } } class ByMonthOfYearRule extends RecurrenceRuleBase { run(date) { const currentMonth = date.get('month'); for (const month of this.options.byMonthOfYear) { if (currentMonth > month) continue; if (currentMonth === month) { return this.validateDate(new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["ValidDateTime"](date)); } return this.validateDate(new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["InvalidDateTime"](date.granularity('year').set('month', month))); } return this.validateDate(new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["InvalidDateTime"](date.granularity('year').add(1, 'year').set('month', this.options.byMonthOfYear[0]))); } } const ByMonthOfYearRuleModule = { name: 'ByMonthOfYear', get: processor => { if (processor.options.byMonthOfYear === undefined) return null; if (processor.reverse) { return new RevByMonthOfYearRule(processor); } return new ByMonthOfYearRule(processor); }, normalizeOptions: (options, norm) => { if (options.byMonthOfYear !== undefined) { if (!ruleOptionFilled(options.byMonthOfYear)) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RuleOptionError"]('"byMonthOfYear" expects a non-empty array'); } if (options.byMonthOfYear.some(num => num < 1 || num > 12)) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["RuleOptionError"]('"byMonthOfYear" values must be `num >= 1 && num >= 12`'); } norm.byMonthOfYear = options.byMonthOfYear.slice(); norm.byMonthOfYear.sort(_rschedule_core__WEBPACK_IMPORTED_MODULE_0__["numberSortComparer"]); } else if (!(ruleOptionFilled(options.byDayOfMonth) || ruleOptionFilled(options.byDayOfWeek) || ruleOptionFilled(options.byDayOfYear)) && options.frequency === 'YEARLY') { norm.byMonthOfYear = [norm.start.get('month')]; } }, deps: () => [FrequencyRuleModule, ByMonthOfYearRuleModule, ByDayOfMonthRuleModule, ByHourOfDayRuleModule, ByMinuteOfHourRuleModule, BySecondOfMinuteRuleModule, ByMillisecondOfSecondRuleModule] }; const ICAL_RULES = [FrequencyRuleModule, ByMonthOfYearRuleModule, ByDayOfMonthRuleModule, ByDayOfWeekRuleModule, ByHourOfDayRuleModule, ByMinuteOfHourRuleModule, BySecondOfMinuteRuleModule, ByMillisecondOfSecondRuleModule]; /***/ }), /***/ "./node_modules/@rschedule/json-tools/es2015/Schedule.js": /*!***************************************************************!*\ !*** ./node_modules/@rschedule/json-tools/es2015/Schedule.js ***! \***************************************************************/ /*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _rschedule_core_generators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rschedule/core/generators */ "./node_modules/@rschedule/core/es2015/generators.js"); /* harmony import */ var _rschedule_json_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @rschedule/json-tools */ "./node_modules/@rschedule/json-tools/es2015/main.js"); /* harmony import */ var _rschedule_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @rschedule/core */ "./node_modules/@rschedule/core/es2015/main.js"); _rschedule_core_generators__WEBPACK_IMPORTED_MODULE_0__["Dates"].prototype.toJSON = function serialize(opts = {}) { const json = { type: 'Dates', dates: this.adapters.map(adapter => adapter.toJSON()) }; if (!opts.nested) json.timezone = this.timezone; Object(_rschedule_json_tools__WEBPACK_IMPORTED_MODULE_1__["serializeDataToJSON"])(this, json, opts); return json; }; _rschedule_core_generators__WEBPACK_IMPORTED_MODULE_0__["Dates"].fromJSON = function parse(json, options = {}) { if (json.type !== 'Dates') { throw new _rschedule_json_tools__WEBPACK_IMPORTED_MODULE_1__["ParseJSONError"]('Invalid Dates JSON'); } return new _rschedule_core_generators__WEBPACK_IMPORTED_MODULE_0__["Dates"]({ dates: json.dates.map(date => _rschedule_core__WEBPACK_IMPORTED_MODULE_2__["DateAdapterBase"].adapter.fromJSON(date)), data: typeof options.data === 'function' ? options.data(json) : json.data, timezone: options.timezone || json.timezone }); }; Object(_rschedule_json_tools__WEBPACK_IMPORTED_MODULE_1__["registerJSONSerializerFn"])('Dates', _rschedule_core_generators__WEBPACK_IMPORTED_MODULE_0__["Dates"].fromJSON); _rschedule_core_generators__WEBPACK_IMPORTED_MODULE_0__["Rule"].prototype.toJSON = function serialize(opts = {}) { const json = { type: 'Rule', config: Object.assign(Object.assign({}, Object(_rschedule_core__WEBPACK_IMPORTED_MODULE_2__["cloneJSON"])(this.options)), { start: this.normalizeDateInput(this.options.start).toJSON() }) }; if (this.options.end) { json.config.end = this.normalizeDateInput(this.options.end).toJSON(); } if (!opts.nested) json.timezone = this.timezone; Object(_rschedule_json_tools__WEBPACK_IMPORTED_MODULE_1__["serializeDataToJSON"])(this, json, opts); return json; }; _rschedule_core_generators__WEBPACK_IMPORTED_MODULE_0__["Rule"].fromJSON = function fromJSON(json, options = {}) { const config = Object.assign(Object.assign({}, json.config), { start: _rschedule_core__WEBPACK_IMPORTED_MODULE_2__["DateAdapterBase"].adapter.fromJSON(json.config.start), end: json.config.end && _rschedule_core__WEBPACK_IMPORTED_MODULE_2__["DateAdapterBase"].adapter.fromJSON(json.config.end) }); return new _rschedule_core_generators__WEBPACK_IMPORTED_MODULE_0__["Rule"](config, { data: typeof options.data === 'function' ? options.data(json) : json.data, timezone: options.timezone || json.timezone }); }; Object(_rschedule_json_tools__WEBPACK_IMPORTED_MODULE_1__["registerJSONSerializerFn"])('Rule', _rschedule_core_generators__WEBPACK_IMPORTED_MODULE_0__["Rule"].fromJSON); _rschedule_core_generators__WEBPACK_IMPORTED_MODULE_0__["Schedule"].prototype.toJSON = function serialize(opts = {}) { const json = { type: 'Schedule', rrules: this.rrules.map(rule => rule.toJSON(Object.assign(Object.assign({}, opts), { nested: true }))), exrules: this.exrules.map(rule => rule.toJSON(Object.assign(Object.assign({}, opts), { nested: true }))), rdates: this.rdates.toJSON(Object.assign(Object.assign({}, opts), { nested: true })), exdates: this.exdates.toJSON(Object.assign(Object.assign({}, opts), { nested: true })) }; if (!opts.nested) json.timezone = this.timezone; Object(_rschedule_json_tools__WEBPACK_IMPORTED_MODULE_1__["serializeDataToJSON"])(this, json, opts); return json; }; _rschedule_core_generators__WEBPACK_IMPORTED_MODULE_0__["Schedule"].fromJSON = function parse(json, options = {}) { if (json.type !== 'Schedule') { throw new _rschedule_json_tools__WEBPACK_IMPORTED_MODULE_1__["ParseJSONError"]('Invalid Schedule JSON'); } return new _rschedule_core_generators__WEBPACK_IMPORTED_MODULE_0__["Schedule"]({ rrules: json.rrules.map(rule => _rschedule_core_generators__WEBPACK_IMPORTED_MODULE_0__["Rule"].fromJSON(rule, Object.assign({ timezone: json.timezone }, options))), exrules: json.exrules.map(rule => _rschedule_core_generators__WEBPACK_IMPORTED_MODULE_0__["Rule"].fromJSON(rule, Object.assign({ timezone: json.timezone }, options))), rdates: _rschedule_core_generators__WEBPACK_IMPORTED_MODULE_0__["Dates"].fromJSON(json.rdates, Object.assign({ timezone: json.timezone }, options)), exdates: _rschedule_core_generators__WEBPACK_IMPORTED_MODULE_0__["Dates"].fromJSON(json.exdates, Object.assign({ timezone: json.timezone }, options)), data: typeof options.data === 'function' ? options.data(json) : json.data, timezone: options.timezone || json.timezone }); }; Object(_rschedule_json_tools__WEBPACK_IMPORTED_MODULE_1__["registerJSONSerializerFn"])('Schedule', _rschedule_core_generators__WEBPACK_IMPORTED_MODULE_0__["Schedule"].fromJSON); /***/ }), /***/ "./node_modules/@rschedule/json-tools/es2015/main.js": /*!***********************************************************!*\ !*** ./node_modules/@rschedule/json-tools/es2015/main.js ***! \***********************************************************/ /*! exports provided: ParseJSONError, SerializeJSONError, registerJSONSerializerFn, serializeDataToJSON */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParseJSONError", function() { return ParseJSONError; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SerializeJSONError", function() { return SerializeJSONError; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerJSONSerializerFn", function() { return registerJSONSerializerFn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "serializeDataToJSON", function() { return serializeDataToJSON; }); /* harmony import */ var _rschedule_core_generators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rschedule/core/generators */ "./node_modules/@rschedule/core/es2015/generators.js"); class ParseJSONError extends Error {} class SerializeJSONError extends Error {} _rschedule_core_generators__WEBPACK_IMPORTED_MODULE_0__["OccurrenceGenerator"].JSON_FN_MAP = new Map(); _rschedule_core_generators__WEBPACK_IMPORTED_MODULE_0__["OccurrenceGenerator"].prototype.toJSON = function serialize(opts) { throw new SerializeJSONError(`To support smaller bundles, ${this.constructor.name}#toJSON() ` + `must be manually added. See "@rschedule/json-tools" in the rSchedule docs.`); }; _rschedule_core_generators__WEBPACK_IMPORTED_MODULE_0__["OccurrenceGenerator"].fromJSON = function parse(json, options) { if (typeof json !== 'object' || json === null) { throw new ParseJSONError(`Invalid json "${json}"`); } const fn = _rschedule_core_generators__WEBPACK_IMPORTED_MODULE_0__["OccurrenceGenerator"].JSON_FN_MAP.get(json.type); if (!fn) { throw new ParseJSONError(`Unknown rSchedule object type "${json.type}". Have you added a json serializer ` + `for "${json.type}"? ` + `See "@rschedule/json-tools" in the rSchedule docs.`); } return fn(json, options); }; function serializeDataToJSON(gen, json, opt) { if (!opt.data) return; if (opt.data === true) { json.data = gen.data; } else { json.data = opt.data(gen); } if (json.data === undefined) delete json.data; } function registerJSONSerializerFn(name, fn) { if (_rschedule_core_generators__WEBPACK_IMPORTED_MODULE_0__["OccurrenceGenerator"].JSON_FN_MAP.has(name)) { throw new Error(`Attempting to set a global json parser function for "${name}" ` + 'but one already exists.'); } _rschedule_core_generators__WEBPACK_IMPORTED_MODULE_0__["OccurrenceGenerator"].JSON_FN_MAP.set(name, fn); } /***/ }), /***/ "./node_modules/@rschedule/standard-date-adapter/es2015/main.js": /*!**********************************************************************!*\ !*** ./node_modules/@rschedule/standard-date-adapter/es2015/main.js ***! \**********************************************************************/ /*! exports provided: StandardDateAdapter */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StandardDateAdapter", function() { return StandardDateAdapter; }); /* harmony import */ var _rschedule_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rschedule/core */ "./node_modules/@rschedule/core/es2015/main.js"); class StandardDateAdapter extends _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["DateAdapterBase"] { constructor(date, options = {}) { super(undefined, options); if (!['UTC', null, undefined].includes(options.timezone)) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["InvalidDateAdapterError"](`StandardDateAdapter only supports "UTC" and ` + `local time zones but "${options.timezone}" was provided.`); } this._date = new Date(date); this.timezone = options.timezone !== undefined ? options.timezone : null; this.assertIsValid(); } static isDate(object) { return Object.prototype.toString.call(object) === '[object Date]'; } static fromDate(date, options) { return new StandardDateAdapter(date, options); } static fromJSON(json) { const args = [json.year, json.month - 1, json.day, json.hour, json.minute, json.second, json.millisecond]; switch (json.timezone) { case 'UTC': { return new StandardDateAdapter(new Date(Date.UTC(...args)), { timezone: 'UTC', duration: json.duration }); } case null: { return new StandardDateAdapter(new Date(...args), { timezone: null, duration: json.duration }); } default: throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["InvalidDateAdapterError"]('The `StandardDateAdapter` only supports datetimes in ' + `UTC or LOCAL (null) time. You provided a JSON object ` + `with timezone "${json.timezone}".`); } } static fromDateTime(datetime) { const date = StandardDateAdapter.fromJSON(datetime.toJSON()); date.generators.push(...datetime.generators); return date; } get date() { return new Date(this._date); } get end() { if (!this.duration) return; if (this._end) return this._end; this._end = StandardDateAdapter.fromDateTime(this.toDateTime().add(this.duration, 'millisecond')).date; return this._end; } set(prop, value) { if (prop === 'timezone') { if (this.timezone === value) return this;else { return new StandardDateAdapter(this._date, { timezone: value, duration: this.duration, generators: this.generators }); } } else if (prop === 'duration') { if (this.duration === value) return this;else { return new StandardDateAdapter(this._date, { timezone: this.timezone, duration: value, generators: this.generators }); } } throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["ArgumentError"](`Unknown prop "${prop}" for StandardDateAdapter#set()`); } valueOf() { return this._date.valueOf(); } toISOString() { return this._date.toISOString(); } toJSON() { let json; if (this.timezone === 'UTC') { json = { timezone: this.timezone, year: this._date.getUTCFullYear(), month: this._date.getUTCMonth() + 1, day: this._date.getUTCDate(), hour: this._date.getUTCHours(), minute: this._date.getUTCMinutes(), second: this._date.getUTCSeconds(), millisecond: this._date.getUTCMilliseconds() }; } else { json = { timezone: this.timezone, year: this._date.getFullYear(), month: this._date.getMonth() + 1, day: this._date.getDate(), hour: this._date.getHours(), minute: this._date.getMinutes(), second: this._date.getSeconds(), millisecond: this._date.getMilliseconds() }; } if (this.duration) { json.duration = this.duration; } return json; } assertIsValid() { if (!StandardDateAdapter.isDate(this._date) || isNaN(this._date.valueOf())) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["InvalidDateAdapterError"]('StandardDateAdapter has invalid date.'); } else if (![null, 'UTC'].includes(this.timezone)) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["InvalidDateAdapterError"]('StandardDateAdapter only supports local (null) and UTC timezones but ' + `"${this.timezone}" was specified.`); } else if (this.duration && this.duration <= 0) { throw new _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["InvalidDateAdapterError"]('If provided, duration must be greater than 0.'); } return true; } } StandardDateAdapter.hasTimezoneSupport = false; /***/ }), /***/ "./node_modules/@rschedule/standard-date-adapter/es2015/setup.js": /*!***********************************************************************!*\ !*** ./node_modules/@rschedule/standard-date-adapter/es2015/setup.js ***! \***********************************************************************/ /*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _rschedule_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rschedule/core */ "./node_modules/@rschedule/core/es2015/main.js"); /* harmony import */ var _rschedule_core_generators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @rschedule/core/generators */ "./node_modules/@rschedule/core/es2015/generators.js"); /* harmony import */ var _rschedule_core_rules_ICAL_RULES__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @rschedule/core/rules/ICAL_RULES */ "./node_modules/@rschedule/core/es2015/rules.js"); /* harmony import */ var _rschedule_standard_date_adapter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @rschedule/standard-date-adapter */ "./node_modules/@rschedule/standard-date-adapter/es2015/main.js"); _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["DateAdapterBase"].adapter = _rschedule_standard_date_adapter__WEBPACK_IMPORTED_MODULE_3__["StandardDateAdapter"]; _rschedule_core_generators__WEBPACK_IMPORTED_MODULE_1__["Rule"].recurrenceRules = _rschedule_core_rules_ICAL_RULES__WEBPACK_IMPORTED_MODULE_2__["ICAL_RULES"]; /***/ }), /***/ "./node_modules/accounting/accounting.js": /*!***********************************************!*\ !*** ./node_modules/accounting/accounting.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { /*! * accounting.js v0.4.2 * Copyright 2014 Open Exchange Rates * * Freely distributable under the MIT license. * Portions of accounting.js are inspired or borrowed from underscore.js * * Full details and documentation: * http://openexchangerates.github.io/accounting.js/ */ (function (root, undefined) { /* --- Setup --- */ // Create the local library object, to be exported or referenced globally later var lib = {}; // Current version lib.version = '0.4.2'; /* --- Exposed settings --- */ // The library's settings configuration object. Contains default parameters for // currency and number formatting lib.settings = { currency: { symbol: "$", // default currency symbol is '$' format: "%s%v", // controls output: %s = symbol, %v = value (can be object, see docs) decimal: ".", // decimal point separator thousand: ",", // thousands separator precision: 2, // decimal places grouping: 3 // digit grouping (not implemented yet) }, number: { precision: 0, // default precision on numbers is 0 grouping: 3, // digit grouping (not implemented yet) thousand: ",", decimal: "." } }; /* --- Internal Helper Methods --- */ // Store reference to possibly-available ECMAScript 5 methods for later var nativeMap = Array.prototype.map, nativeIsArray = Array.isArray, toString = Object.prototype.toString; /** * Tests whether supplied parameter is a string * from underscore.js */ function isString(obj) { return !!(obj === '' || obj && obj.charCodeAt && obj.substr); } /** * Tests whether supplied parameter is an array * from underscore.js, delegates to ECMA5's native Array.isArray */ function isArray(obj) { return nativeIsArray ? nativeIsArray(obj) : toString.call(obj) === '[object Array]'; } /** * Tests whether supplied parameter is a true object */ function isObject(obj) { return obj && toString.call(obj) === '[object Object]'; } /** * Extends an object with a defaults object, similar to underscore's _.defaults * * Used for abstracting parameter handling from API methods */ function defaults(object, defs) { var key; object = object || {}; defs = defs || {}; // Iterate over object non-prototype properties: for (key in defs) { if (defs.hasOwnProperty(key)) { // Replace values with defaults only if undefined (allow empty/zero values): if (object[key] == null) object[key] = defs[key]; } } return object; } /** * Implementation of `Array.map()` for iteration loops * * Returns a new Array as a result of calling `iterator` on each array value. * Defers to native Array.map if available */ function map(obj, iterator, context) { var results = [], i, j; if (!obj) return results; // Use native .map method if it exists: if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); // Fallback for native .map: for (i = 0, j = obj.length; i < j; i++) { results[i] = iterator.call(context, obj[i], i, obj); } return results; } /** * Check and normalise the value of precision (must be positive integer) */ function checkPrecision(val, base) { val = Math.round(Math.abs(val)); return isNaN(val) ? base : val; } /** * Parses a format string or object and returns format obj for use in rendering * * `format` is either a string with the default (positive) format, or object * containing `pos` (required), `neg` and `zero` values (or a function returning * either a string or object) * * Either string or format.pos must contain "%v" (value) to be valid */ function checkCurrencyFormat(format) { var defaults = lib.settings.currency.format; // Allow function as format parameter (should return string or object): if (typeof format === "function") format = format(); // Format can be a string, in which case `value` ("%v") must be present: if (isString(format) && format.match("%v")) { // Create and return positive, negative and zero formats: return { pos: format, neg: format.replace("-", "").replace("%v", "-%v"), zero: format }; // If no format, or object is missing valid positive value, use defaults: } else if (!format || !format.pos || !format.pos.match("%v")) { // If defaults is a string, casts it to an object for faster checking next time: return !isString(defaults) ? defaults : lib.settings.currency.format = { pos: defaults, neg: defaults.replace("%v", "-%v"), zero: defaults }; } // Otherwise, assume format was fine: return format; } /* --- API Methods --- */ /** * Takes a string/array of strings, removes all formatting/cruft and returns the raw float value * Alias: `accounting.parse(string)` * * Decimal must be included in the regular expression to match floats (defaults to * accounting.settings.number.decimal), so if the number uses a non-standard decimal * separator, provide it as the second argument. * * Also matches bracketed negatives (eg. "$ (1.99)" => -1.99) * * Doesn't throw any errors (`NaN`s become 0) but this may change in future */ var unformat = lib.unformat = lib.parse = function (value, decimal) { // Recursively unformat arrays: if (isArray(value)) { return map(value, function (val) { return unformat(val, decimal); }); } // Fails silently (need decent errors): value = value || 0; // Return the value as-is if it's already a number: if (typeof value === "number") return value; // Default decimal point comes from settings, but could be set to eg. "," in opts: decimal = decimal || lib.settings.number.decimal; // Build regex to strip out everything except digits, decimal point and minus sign: var regex = new RegExp("[^0-9-" + decimal + "]", ["g"]), unformatted = parseFloat(("" + value).replace(/\((?=\d+)(.*)\)/, "-$1") // replace bracketed values with negatives .replace(regex, '') // strip out any cruft .replace(decimal, '.') // make sure decimal point is standard ); // This will fail silently which may cause trouble, let's wait and see: return !isNaN(unformatted) ? unformatted : 0; }; /** * Implementation of toFixed() that treats floats more like decimals * * Fixes binary rounding issues (eg. (0.615).toFixed(2) === "0.61") that present * problems for accounting- and finance-related software. */ var toFixed = lib.toFixed = function (value, precision) { precision = checkPrecision(precision, lib.settings.number.precision); var exponentialForm = Number(lib.unformat(value) + 'e' + precision); var rounded = Math.round(exponentialForm); var finalResult = Number(rounded + 'e-' + precision).toFixed(precision); return finalResult; }; /** * Format a number, with comma-separated thousands and custom precision/decimal places * Alias: `accounting.format()` * * Localise by overriding the precision and thousand / decimal separators * 2nd parameter `precision` can be an object matching `settings.number` */ var formatNumber = lib.formatNumber = lib.format = function (number, precision, thousand, decimal) { // Resursively format arrays: if (isArray(number)) { return map(number, function (val) { return formatNumber(val, precision, thousand, decimal); }); } // Clean up number: number = unformat(number); // Build options object from second param (if object) or all params, extending defaults: var opts = defaults(isObject(precision) ? precision : { precision: precision, thousand: thousand, decimal: decimal }, lib.settings.number), // Clean up precision usePrecision = checkPrecision(opts.precision), // Do some calc: negative = number < 0 ? "-" : "", base = parseInt(toFixed(Math.abs(number || 0), usePrecision), 10) + "", mod = base.length > 3 ? base.length % 3 : 0; // Format the number: return negative + (mod ? base.substr(0, mod) + opts.thousand : "") + base.substr(mod).replace(/(\d{3})(?=\d)/g, "$1" + opts.thousand) + (usePrecision ? opts.decimal + toFixed(Math.abs(number), usePrecision).split('.')[1] : ""); }; /** * Format a number into currency * * Usage: accounting.formatMoney(number, symbol, precision, thousandsSep, decimalSep, format) * defaults: (0, "$", 2, ",", ".", "%s%v") * * Localise by overriding the symbol, precision, thousand / decimal separators and format * Second param can be an object matching `settings.currency` which is the easiest way. * * To do: tidy up the parameters */ var formatMoney = lib.formatMoney = function (number, symbol, precision, thousand, decimal, format) { // Resursively format arrays: if (isArray(number)) { return map(number, function (val) { return formatMoney(val, symbol, precision, thousand, decimal, format); }); } // Clean up number: number = unformat(number); // Build options object from second param (if object) or all params, extending defaults: var opts = defaults(isObject(symbol) ? symbol : { symbol: symbol, precision: precision, thousand: thousand, decimal: decimal, format: format }, lib.settings.currency), // Check format (returns object with pos, neg and zero): formats = checkCurrencyFormat(opts.format), // Choose which format to use for this value: useFormat = number > 0 ? formats.pos : number < 0 ? formats.neg : formats.zero; // Return with currency symbol added: return useFormat.replace('%s', opts.symbol).replace('%v', formatNumber(Math.abs(number), checkPrecision(opts.precision), opts.thousand, opts.decimal)); }; /** * Format a list of numbers into an accounting column, padding with whitespace * to line up currency symbols, thousand separators and decimals places * * List should be an array of numbers * Second parameter can be an object containing keys that match the params * * Returns array of accouting-formatted number strings of same length * * NB: `white-space:pre` CSS rule is required on the list container to prevent * browsers from collapsing the whitespace in the output strings. */ lib.formatColumn = function (list, symbol, precision, thousand, decimal, format) { if (!list || !isArray(list)) return []; // Build options object from second param (if object) or all params, extending defaults: var opts = defaults(isObject(symbol) ? symbol : { symbol: symbol, precision: precision, thousand: thousand, decimal: decimal, format: format }, lib.settings.currency), // Check format (returns object with pos, neg and zero), only need pos for now: formats = checkCurrencyFormat(opts.format), // Whether to pad at start of string or after currency symbol: padAfterSymbol = formats.pos.indexOf("%s") < formats.pos.indexOf("%v") ? true : false, // Store value for the length of the longest string in the column: maxLength = 0, // Format the list according to options, store the length of the longest string: formatted = map(list, function (val, i) { if (isArray(val)) { // Recursively format columns if list is a multi-dimensional array: return lib.formatColumn(val, opts); } else { // Clean up the value val = unformat(val); // Choose which format to use for this value (pos, neg or zero): var useFormat = val > 0 ? formats.pos : val < 0 ? formats.neg : formats.zero, // Format this value, push into formatted list and save the length: fVal = useFormat.replace('%s', opts.symbol).replace('%v', formatNumber(Math.abs(val), checkPrecision(opts.precision), opts.thousand, opts.decimal)); if (fVal.length > maxLength) maxLength = fVal.length; return fVal; } }); // Pad each number in the list and send back the column of numbers: return map(formatted, function (val, i) { // Only if this is a string (not a nested array, which would have already been padded): if (isString(val) && val.length < maxLength) { // Depending on symbol position, pad after symbol or at index 0: return padAfterSymbol ? val.replace(opts.symbol, opts.symbol + new Array(maxLength - val.length + 1).join(" ")) : new Array(maxLength - val.length + 1).join(" ") + val; } return val; }); }; /* --- Module Definition --- */ // Export accounting for CommonJS. If being loaded as an AMD module, define it as such. // Otherwise, just add `accounting` to the global object if (true) { if ( true && module.exports) { exports = module.exports = lib; } exports.accounting = lib; } else {} // Root will be `window` in browser or `global` on the server: })(this); /***/ }), /***/ "./node_modules/adm-zip/adm-zip.js": /*!*****************************************!*\ !*** ./node_modules/adm-zip/adm-zip.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { const Utils = __webpack_require__(/*! ./util */ "./node_modules/adm-zip/util/index.js"); const pth = __webpack_require__(/*! path */ "path"); const ZipEntry = __webpack_require__(/*! ./zipEntry */ "./node_modules/adm-zip/zipEntry.js"); const ZipFile = __webpack_require__(/*! ./zipFile */ "./node_modules/adm-zip/zipFile.js"); const get_Bool = (val, def) => typeof val === "boolean" ? val : def; const get_Str = (val, def) => typeof val === "string" ? val : def; const defaultOptions = { // option "noSort" : if true it disables files sorting noSort: false, // read entries during load (initial loading may be slower) readEntries: false, // default method is none method: Utils.Constants.NONE, // file system fs: null }; module.exports = function ( /**String*/ input, /** object */ options) { let inBuffer = null; // create object based default options, allowing them to be overwritten const opts = Object.assign(Object.create(null), defaultOptions); // test input variable if (input && "object" === typeof input) { // if value is not buffer we accept it to be object with options if (!(input instanceof Uint8Array)) { Object.assign(opts, input); input = opts.input ? opts.input : undefined; if (opts.input) delete opts.input; } // if input is buffer if (Buffer.isBuffer(input)) { inBuffer = input; opts.method = Utils.Constants.BUFFER; input = undefined; } } // assign options Object.assign(opts, options); // instanciate utils filesystem const filetools = new Utils(opts); // if input is file name we retrieve its content if (input && "string" === typeof input) { // load zip file if (filetools.fs.existsSync(input)) { opts.method = Utils.Constants.FILE; opts.filename = input; inBuffer = filetools.fs.readFileSync(input); } else { throw new Error(Utils.Errors.INVALID_FILENAME); } } // create variable const _zip = new ZipFile(inBuffer, opts); const canonical = Utils.canonical, sanitize = Utils.sanitize; function getEntry( /**Object*/ entry) { if (entry && _zip) { var item; // If entry was given as a file name if (typeof entry === "string") item = _zip.getEntry(entry); // if entry was given as a ZipEntry object if (typeof entry === "object" && typeof entry.entryName !== "undefined" && typeof entry.header !== "undefined") item = _zip.getEntry(entry.entryName); if (item) { return item; } } return null; } function fixPath(zipPath) { const _pth$posix = pth.posix, join = _pth$posix.join, normalize = _pth$posix.normalize, sep = _pth$posix.sep; // convert windows file separators and normalize return join(".", normalize(sep + zipPath.split("\\").join(sep) + sep)); } return { /** * Extracts the given entry from the archive and returns the content as a Buffer object * @param entry ZipEntry object or String with the full path of the entry * * @return Buffer or Null in case of error */ readFile: function ( /**Object*/ entry, /*String, Buffer*/ pass) { var item = getEntry(entry); return item && item.getData(pass) || null; }, /** * Asynchronous readFile * @param entry ZipEntry object or String with the full path of the entry * @param callback * * @return Buffer or Null in case of error */ readFileAsync: function ( /**Object*/ entry, /**Function*/ callback) { var item = getEntry(entry); if (item) { item.getDataAsync(callback); } else { callback(null, "getEntry failed for:" + entry); } }, /** * Extracts the given entry from the archive and returns the content as plain text in the given encoding * @param entry ZipEntry object or String with the full path of the entry * @param encoding Optional. If no encoding is specified utf8 is used * * @return String */ readAsText: function ( /**Object*/ entry, /**String=*/ encoding) { var item = getEntry(entry); if (item) { var data = item.getData(); if (data && data.length) { return data.toString(encoding || "utf8"); } } return ""; }, /** * Asynchronous readAsText * @param entry ZipEntry object or String with the full path of the entry * @param callback * @param encoding Optional. If no encoding is specified utf8 is used * * @return String */ readAsTextAsync: function ( /**Object*/ entry, /**Function*/ callback, /**String=*/ encoding) { var item = getEntry(entry); if (item) { item.getDataAsync(function (data, err) { if (err) { callback(data, err); return; } if (data && data.length) { callback(data.toString(encoding || "utf8")); } else { callback(""); } }); } else { callback(""); } }, /** * Remove the entry from the file or the entry and all it's nested directories and files if the given entry is a directory * * @param entry */ deleteFile: function ( /**Object*/ entry) { // @TODO: test deleteFile var item = getEntry(entry); if (item) { _zip.deleteEntry(item.entryName); } }, /** * Adds a comment to the zip. The zip must be rewritten after adding the comment. * * @param comment */ addZipComment: function ( /**String*/ comment) { // @TODO: test addZipComment _zip.comment = comment; }, /** * Returns the zip comment * * @return String */ getZipComment: function () { return _zip.comment || ""; }, /** * Adds a comment to a specified zipEntry. The zip must be rewritten after adding the comment * The comment cannot exceed 65535 characters in length * * @param entry * @param comment */ addZipEntryComment: function ( /**Object*/ entry, /**String*/ comment) { var item = getEntry(entry); if (item) { item.comment = comment; } }, /** * Returns the comment of the specified entry * * @param entry * @return String */ getZipEntryComment: function ( /**Object*/ entry) { var item = getEntry(entry); if (item) { return item.comment || ""; } return ""; }, /** * Updates the content of an existing entry inside the archive. The zip must be rewritten after updating the content * * @param entry * @param content */ updateFile: function ( /**Object*/ entry, /**Buffer*/ content) { var item = getEntry(entry); if (item) { item.setData(content); } }, /** * Adds a file from the disk to the archive * * @param localPath File to add to zip * @param zipPath Optional path inside the zip * @param zipName Optional name for the file */ addLocalFile: function ( /**String*/ localPath, /**String=*/ zipPath, /**String=*/ zipName, /**String*/ comment) { if (filetools.fs.existsSync(localPath)) { // fix ZipPath zipPath = zipPath ? fixPath(zipPath) : ""; // p - local file name var p = localPath.split("\\").join("/").split("/").pop(); // add file name into zippath zipPath += zipName ? zipName : p; // read file attributes const _attr = filetools.fs.statSync(localPath); // add file into zip file this.addFile(zipPath, filetools.fs.readFileSync(localPath), comment, _attr); } else { throw new Error(Utils.Errors.FILE_NOT_FOUND.replace("%s", localPath)); } }, /** * Adds a local directory and all its nested files and directories to the archive * * @param localPath * @param zipPath optional path inside zip * @param filter optional RegExp or Function if files match will * be included. */ addLocalFolder: function ( /**String*/ localPath, /**String=*/ zipPath, /**=RegExp|Function*/ filter) { // Prepare filter if (filter instanceof RegExp) { // if filter is RegExp wrap it filter = function (rx) { return function (filename) { return rx.test(filename); }; }(filter); } else if ("function" !== typeof filter) { // if filter is not function we will replace it filter = function () { return true; }; } // fix ZipPath zipPath = zipPath ? fixPath(zipPath) : ""; // normalize the path first localPath = pth.normalize(localPath); if (filetools.fs.existsSync(localPath)) { const items = filetools.findFiles(localPath); const self = this; if (items.length) { items.forEach(function (filepath) { var p = pth.relative(localPath, filepath).split("\\").join("/"); //windows fix if (filter(p)) { var stats = filetools.fs.statSync(filepath); if (stats.isFile()) { self.addFile(zipPath + p, filetools.fs.readFileSync(filepath), "", stats); } else { self.addFile(zipPath + p + "/", Buffer.alloc(0), "", stats); } } }); } } else { throw new Error(Utils.Errors.FILE_NOT_FOUND.replace("%s", localPath)); } }, /** * Asynchronous addLocalFile * @param localPath * @param callback * @param zipPath optional path inside zip * @param filter optional RegExp or Function if files match will * be included. */ addLocalFolderAsync: function ( /*String*/ localPath, /*Function*/ callback, /*String*/ zipPath, /*RegExp|Function*/ filter) { if (filter instanceof RegExp) { filter = function (rx) { return function (filename) { return rx.test(filename); }; }(filter); } else if ("function" !== typeof filter) { filter = function () { return true; }; } // fix ZipPath zipPath = zipPath ? fixPath(zipPath) : ""; // normalize the path first localPath = pth.normalize(localPath); var self = this; filetools.fs.open(localPath, "r", function (err) { if (err && err.code === "ENOENT") { callback(undefined, Utils.Errors.FILE_NOT_FOUND.replace("%s", localPath)); } else if (err) { callback(undefined, err); } else { var items = filetools.findFiles(localPath); var i = -1; var next = function () { i += 1; if (i < items.length) { var filepath = items[i]; var p = pth.relative(localPath, filepath).split("\\").join("/"); //windows fix p = p.normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[^\x20-\x7E]/g, ""); // accent fix if (filter(p)) { filetools.fs.stat(filepath, function (er0, stats) { if (er0) callback(undefined, er0); if (stats.isFile()) { filetools.fs.readFile(filepath, function (er1, data) { if (er1) { callback(undefined, er1); } else { self.addFile(zipPath + p, data, "", stats); next(); } }); } else { self.addFile(zipPath + p + "/", Buffer.alloc(0), "", stats); next(); } }); } else { next(); } } else { callback(true, undefined); } }; next(); } }); }, /** * * @param {string} localPath - path where files will be extracted * @param {object} props - optional properties * @param {string} props.zipPath - optional path inside zip * @param {regexp, function} props.filter - RegExp or Function if files match will be included. */ addLocalFolderPromise: function ( /*String*/ localPath, /* object */ props) { return new Promise((resolve, reject) => { const _Object$assign = Object.assign({}, props), filter = _Object$assign.filter, zipPath = _Object$assign.zipPath; this.addLocalFolderAsync(localPath, (done, err) => { if (err) reject(err); if (done) resolve(this); }, zipPath, filter); }); }, /** * Allows you to create a entry (file or directory) in the zip file. * If you want to create a directory the entryName must end in / and a null buffer should be provided. * Comment and attributes are optional * * @param {string} entryName * @param {Buffer | string} content - file content as buffer or utf8 coded string * @param {string} comment - file comment * @param {number | object} attr - number as unix file permissions, object as filesystem Stats object */ addFile: function ( /**String*/ entryName, /**Buffer*/ content, /**String*/ comment, /**Number*/ attr) { let entry = getEntry(entryName); const update = entry != null; // prepare new entry if (!update) { entry = new ZipEntry(); entry.entryName = entryName; } entry.comment = comment || ""; const isStat = "object" === typeof attr && attr instanceof filetools.fs.Stats; // last modification time from file stats if (isStat) { entry.header.time = attr.mtime; } // Set file attribute var fileattr = entry.isDirectory ? 0x10 : 0; // (MS-DOS directory flag) // extended attributes field for Unix if (!Utils.isWin) { // set file type either S_IFDIR / S_IFREG let unix = entry.isDirectory ? 0x4000 : 0x8000; if (isStat) { // File attributes from file stats unix |= 0xfff & attr.mode; } else if ("number" === typeof attr) { // attr from given attr values unix |= 0xfff & attr; } else { // Default values: unix |= entry.isDirectory ? 0o755 : 0o644; // permissions (drwxr-xr-x) or (-r-wr--r--) } fileattr = (fileattr | unix << 16) >>> 0; // add attributes } entry.attr = fileattr; entry.setData(content); if (!update) _zip.setEntry(entry); }, /** * Returns an array of ZipEntry objects representing the files and folders inside the archive * * @return Array */ getEntries: function () { return _zip ? _zip.entries : []; }, /** * Returns a ZipEntry object representing the file or folder specified by ``name``. * * @param name * @return ZipEntry */ getEntry: function ( /**String*/ name) { return getEntry(name); }, getEntryCount: function () { return _zip.getEntryCount(); }, forEach: function (callback) { return _zip.forEach(callback); }, /** * Extracts the given entry to the given targetPath * If the entry is a directory inside the archive, the entire directory and it's subdirectories will be extracted * * @param entry ZipEntry object or String with the full path of the entry * @param targetPath Target folder where to write the file * @param maintainEntryPath If maintainEntryPath is true and the entry is inside a folder, the entry folder * will be created in targetPath as well. Default is TRUE * @param overwrite If the file already exists at the target path, the file will be overwriten if this is true. * Default is FALSE * @param keepOriginalPermission The file will be set as the permission from the entry if this is true. * Default is FALSE * @param outFileName String If set will override the filename of the extracted file (Only works if the entry is a file) * * @return Boolean */ extractEntryTo: function ( /**Object*/ entry, /**String*/ targetPath, /**Boolean*/ maintainEntryPath, /**Boolean*/ overwrite, /**Boolean*/ keepOriginalPermission, /**String**/ outFileName) { overwrite = get_Bool(overwrite, false); keepOriginalPermission = get_Bool(keepOriginalPermission, false); maintainEntryPath = get_Bool(maintainEntryPath, true); outFileName = get_Str(outFileName, get_Str(keepOriginalPermission, undefined)); var item = getEntry(entry); if (!item) { throw new Error(Utils.Errors.NO_ENTRY); } var entryName = canonical(item.entryName); var target = sanitize(targetPath, outFileName && !item.isDirectory ? outFileName : maintainEntryPath ? entryName : pth.basename(entryName)); if (item.isDirectory) { var children = _zip.getEntryChildren(item); children.forEach(function (child) { if (child.isDirectory) return; var content = child.getData(); if (!content) { throw new Error(Utils.Errors.CANT_EXTRACT_FILE); } var name = canonical(child.entryName); var childName = sanitize(targetPath, maintainEntryPath ? name : pth.basename(name)); // The reverse operation for attr depend on method addFile() const fileAttr = keepOriginalPermission ? child.header.fileAttr : undefined; filetools.writeFileTo(childName, content, overwrite, fileAttr); }); return true; } var content = item.getData(); if (!content) throw new Error(Utils.Errors.CANT_EXTRACT_FILE); if (filetools.fs.existsSync(target) && !overwrite) { throw new Error(Utils.Errors.CANT_OVERRIDE); } // The reverse operation for attr depend on method addFile() const fileAttr = keepOriginalPermission ? entry.header.fileAttr : undefined; filetools.writeFileTo(target, content, overwrite, fileAttr); return true; }, /** * Test the archive * */ test: function (pass) { if (!_zip) { return false; } for (var entry in _zip.entries) { try { if (entry.isDirectory) { continue; } var content = _zip.entries[entry].getData(pass); if (!content) { return false; } } catch (err) { return false; } } return true; }, /** * Extracts the entire archive to the given location * * @param targetPath Target location * @param overwrite If the file already exists at the target path, the file will be overwriten if this is true. * Default is FALSE * @param keepOriginalPermission The file will be set as the permission from the entry if this is true. * Default is FALSE */ extractAllTo: function ( /**String*/ targetPath, /**Boolean*/ overwrite, /**Boolean*/ keepOriginalPermission, /*String, Buffer*/ pass) { overwrite = get_Bool(overwrite, false); pass = get_Str(keepOriginalPermission, pass); keepOriginalPermission = get_Bool(keepOriginalPermission, false); if (!_zip) { throw new Error(Utils.Errors.NO_ZIP); } _zip.entries.forEach(function (entry) { var entryName = sanitize(targetPath, canonical(entry.entryName.toString())); if (entry.isDirectory) { filetools.makeDir(entryName); return; } var content = entry.getData(pass); if (!content) { throw new Error(Utils.Errors.CANT_EXTRACT_FILE); } // The reverse operation for attr depend on method addFile() const fileAttr = keepOriginalPermission ? entry.header.fileAttr : undefined; filetools.writeFileTo(entryName, content, overwrite, fileAttr); try { filetools.fs.utimesSync(entryName, entry.header.time, entry.header.time); } catch (err) { throw new Error(Utils.Errors.CANT_EXTRACT_FILE); } }); }, /** * Asynchronous extractAllTo * * @param targetPath Target location * @param overwrite If the file already exists at the target path, the file will be overwriten if this is true. * Default is FALSE * @param keepOriginalPermission The file will be set as the permission from the entry if this is true. * Default is FALSE * @param callback The callback will be executed when all entries are extracted successfully or any error is thrown. */ extractAllToAsync: function ( /**String*/ targetPath, /**Boolean*/ overwrite, /**Boolean*/ keepOriginalPermission, /**Function*/ callback) { if (!callback) { callback = function () {}; } overwrite = get_Bool(overwrite, false); if (typeof keepOriginalPermission === "function" && !callback) callback = keepOriginalPermission; keepOriginalPermission = get_Bool(keepOriginalPermission, false); if (!_zip) { callback(new Error(Utils.Errors.NO_ZIP)); return; } targetPath = pth.resolve(targetPath); // convert entryName to const getPath = entry => sanitize(targetPath, pth.normalize(canonical(entry.entryName.toString()))); const getError = (msg, file) => new Error(msg + ': "' + file + '"'); // separate directories from files const dirEntries = []; const fileEntries = new Set(); _zip.entries.forEach(e => { if (e.isDirectory) { dirEntries.push(e); } else { fileEntries.add(e); } }); // Create directory entries first synchronously // this prevents race condition and assures folders are there before writing files for (const entry of dirEntries) { const dirPath = getPath(entry); // The reverse operation for attr depend on method addFile() const dirAttr = keepOriginalPermission ? entry.header.fileAttr : undefined; try { filetools.makeDir(dirPath); if (dirAttr) filetools.fs.chmodSync(dirPath, dirAttr); // in unix timestamp will change if files are later added to folder, but still filetools.fs.utimesSync(dirPath, entry.header.time, entry.header.time); } catch (er) { callback(getError("Unable to create folder", dirPath)); } } // callback wrapper, for some house keeping const done = () => { if (fileEntries.size === 0) { callback(); } }; // Extract file entries asynchronously for (const entry of fileEntries.values()) { const entryName = pth.normalize(canonical(entry.entryName.toString())); const filePath = sanitize(targetPath, entryName); entry.getDataAsync(function (content, err_1) { if (err_1) { callback(new Error(err_1)); return; } if (!content) { callback(new Error(Utils.Errors.CANT_EXTRACT_FILE)); } else { // The reverse operation for attr depend on method addFile() const fileAttr = keepOriginalPermission ? entry.header.fileAttr : undefined; filetools.writeFileToAsync(filePath, content, overwrite, fileAttr, function (succ) { if (!succ) { callback(getError("Unable to write file", filePath)); return; } filetools.fs.utimes(filePath, entry.header.time, entry.header.time, function (err_2) { if (err_2) { callback(getError("Unable to set times", filePath)); return; } fileEntries.delete(entry); // call the callback if it was last entry done(); }); }); } }); } // call the callback if fileEntries was empty done(); }, /** * Writes the newly created zip file to disk at the specified location or if a zip was opened and no ``targetFileName`` is provided, it will overwrite the opened zip * * @param targetFileName * @param callback */ writeZip: function ( /**String*/ targetFileName, /**Function*/ callback) { if (arguments.length === 1) { if (typeof targetFileName === "function") { callback = targetFileName; targetFileName = ""; } } if (!targetFileName && opts.filename) { targetFileName = opts.filename; } if (!targetFileName) return; var zipData = _zip.compressToBuffer(); if (zipData) { var ok = filetools.writeFileTo(targetFileName, zipData, true); if (typeof callback === "function") callback(!ok ? new Error("failed") : null, ""); } }, writeZipPromise: function ( /**String*/ targetFileName, /* object */ props) { const _Object$assign2 = Object.assign({ overwrite: true }, props), overwrite = _Object$assign2.overwrite, perm = _Object$assign2.perm; return new Promise((resolve, reject) => { // find file name if (!targetFileName && opts.filename) targetFileName = opts.filename; if (!targetFileName) reject("ADM-ZIP: ZIP File Name Missing"); this.toBufferPromise().then(zipData => { const ret = done => done ? resolve(done) : reject("ADM-ZIP: Wasn't able to write zip file"); filetools.writeFileToAsync(targetFileName, zipData, overwrite, perm, ret); }, reject); }); }, toBufferPromise: function () { return new Promise((resolve, reject) => { _zip.toAsyncBuffer(resolve, reject); }); }, /** * Returns the content of the entire zip file as a Buffer object * * @return Buffer */ toBuffer: function ( /**Function=*/ onSuccess, /**Function=*/ onFail, /**Function=*/ onItemStart, /**Function=*/ onItemEnd) { this.valueOf = 2; if (typeof onSuccess === "function") { _zip.toAsyncBuffer(onSuccess, onFail, onItemStart, onItemEnd); return null; } return _zip.compressToBuffer(); } }; }; /***/ }), /***/ "./node_modules/adm-zip/headers/entryHeader.js": /*!*****************************************************!*\ !*** ./node_modules/adm-zip/headers/entryHeader.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var Utils = __webpack_require__(/*! ../util */ "./node_modules/adm-zip/util/index.js"), Constants = Utils.Constants; /* The central directory file header */ module.exports = function () { var _verMade = 20, // v2.0 _version = 10, // v1.0 _flags = 0, _method = 0, _time = 0, _crc = 0, _compressedSize = 0, _size = 0, _fnameLen = 0, _extraLen = 0, _comLen = 0, _diskStart = 0, _inattr = 0, _attr = 0, _offset = 0; _verMade |= Utils.isWin ? 0x0a00 : 0x0300; // Set EFS flag since filename and comment fields are all by default encoded using UTF-8. // Without it file names may be corrupted for other apps when file names use unicode chars _flags |= Constants.FLG_EFS; var _dataHeader = {}; function setTime(val) { val = new Date(val); _time = (val.getFullYear() - 1980 & 0x7f) << 25 | // b09-16 years from 1980 val.getMonth() + 1 << 21 | // b05-08 month val.getDate() << 16 | // b00-04 hour // 2 bytes time val.getHours() << 11 | // b11-15 hour val.getMinutes() << 5 | // b05-10 minute val.getSeconds() >> 1; // b00-04 seconds divided by 2 } setTime(+new Date()); return { get made() { return _verMade; }, set made(val) { _verMade = val; }, get version() { return _version; }, set version(val) { _version = val; }, get flags() { return _flags; }, set flags(val) { _flags = val; }, get method() { return _method; }, set method(val) { switch (val) { case Constants.STORED: this.version = 10; case Constants.DEFLATED: default: this.version = 20; } _method = val; }, get time() { return new Date((_time >> 25 & 0x7f) + 1980, (_time >> 21 & 0x0f) - 1, _time >> 16 & 0x1f, _time >> 11 & 0x1f, _time >> 5 & 0x3f, (_time & 0x1f) << 1); }, set time(val) { setTime(val); }, get crc() { return _crc; }, set crc(val) { _crc = Math.max(0, val) >>> 0; }, get compressedSize() { return _compressedSize; }, set compressedSize(val) { _compressedSize = Math.max(0, val) >>> 0; }, get size() { return _size; }, set size(val) { _size = Math.max(0, val) >>> 0; }, get fileNameLength() { return _fnameLen; }, set fileNameLength(val) { _fnameLen = val; }, get extraLength() { return _extraLen; }, set extraLength(val) { _extraLen = val; }, get commentLength() { return _comLen; }, set commentLength(val) { _comLen = val; }, get diskNumStart() { return _diskStart; }, set diskNumStart(val) { _diskStart = Math.max(0, val) >>> 0; }, get inAttr() { return _inattr; }, set inAttr(val) { _inattr = Math.max(0, val) >>> 0; }, get attr() { return _attr; }, set attr(val) { _attr = Math.max(0, val) >>> 0; }, // get Unix file permissions get fileAttr() { return _attr ? (_attr >>> 0 | 0) >> 16 & 0xfff : 0; }, get offset() { return _offset; }, set offset(val) { _offset = Math.max(0, val) >>> 0; }, get encripted() { return (_flags & 1) === 1; }, get entryHeaderSize() { return Constants.CENHDR + _fnameLen + _extraLen + _comLen; }, get realDataOffset() { return _offset + Constants.LOCHDR + _dataHeader.fnameLen + _dataHeader.extraLen; }, get dataHeader() { return _dataHeader; }, loadDataHeaderFromBinary: function ( /*Buffer*/ input) { var data = input.slice(_offset, _offset + Constants.LOCHDR); // 30 bytes and should start with "PK\003\004" if (data.readUInt32LE(0) !== Constants.LOCSIG) { throw new Error(Utils.Errors.INVALID_LOC); } _dataHeader = { // version needed to extract version: data.readUInt16LE(Constants.LOCVER), // general purpose bit flag flags: data.readUInt16LE(Constants.LOCFLG), // compression method method: data.readUInt16LE(Constants.LOCHOW), // modification time (2 bytes time, 2 bytes date) time: data.readUInt32LE(Constants.LOCTIM), // uncompressed file crc-32 value crc: data.readUInt32LE(Constants.LOCCRC), // compressed size compressedSize: data.readUInt32LE(Constants.LOCSIZ), // uncompressed size size: data.readUInt32LE(Constants.LOCLEN), // filename length fnameLen: data.readUInt16LE(Constants.LOCNAM), // extra field length extraLen: data.readUInt16LE(Constants.LOCEXT) }; }, loadFromBinary: function ( /*Buffer*/ data) { // data should be 46 bytes and start with "PK 01 02" if (data.length !== Constants.CENHDR || data.readUInt32LE(0) !== Constants.CENSIG) { throw new Error(Utils.Errors.INVALID_CEN); } // version made by _verMade = data.readUInt16LE(Constants.CENVEM); // version needed to extract _version = data.readUInt16LE(Constants.CENVER); // encrypt, decrypt flags _flags = data.readUInt16LE(Constants.CENFLG); // compression method _method = data.readUInt16LE(Constants.CENHOW); // modification time (2 bytes time, 2 bytes date) _time = data.readUInt32LE(Constants.CENTIM); // uncompressed file crc-32 value _crc = data.readUInt32LE(Constants.CENCRC); // compressed size _compressedSize = data.readUInt32LE(Constants.CENSIZ); // uncompressed size _size = data.readUInt32LE(Constants.CENLEN); // filename length _fnameLen = data.readUInt16LE(Constants.CENNAM); // extra field length _extraLen = data.readUInt16LE(Constants.CENEXT); // file comment length _comLen = data.readUInt16LE(Constants.CENCOM); // volume number start _diskStart = data.readUInt16LE(Constants.CENDSK); // internal file attributes _inattr = data.readUInt16LE(Constants.CENATT); // external file attributes _attr = data.readUInt32LE(Constants.CENATX); // LOC header offset _offset = data.readUInt32LE(Constants.CENOFF); }, dataHeaderToBinary: function () { // LOC header size (30 bytes) var data = Buffer.alloc(Constants.LOCHDR); // "PK\003\004" data.writeUInt32LE(Constants.LOCSIG, 0); // version needed to extract data.writeUInt16LE(_version, Constants.LOCVER); // general purpose bit flag data.writeUInt16LE(_flags, Constants.LOCFLG); // compression method data.writeUInt16LE(_method, Constants.LOCHOW); // modification time (2 bytes time, 2 bytes date) data.writeUInt32LE(_time, Constants.LOCTIM); // uncompressed file crc-32 value data.writeUInt32LE(_crc, Constants.LOCCRC); // compressed size data.writeUInt32LE(_compressedSize, Constants.LOCSIZ); // uncompressed size data.writeUInt32LE(_size, Constants.LOCLEN); // filename length data.writeUInt16LE(_fnameLen, Constants.LOCNAM); // extra field length data.writeUInt16LE(_extraLen, Constants.LOCEXT); return data; }, entryHeaderToBinary: function () { // CEN header size (46 bytes) var data = Buffer.alloc(Constants.CENHDR + _fnameLen + _extraLen + _comLen); // "PK\001\002" data.writeUInt32LE(Constants.CENSIG, 0); // version made by data.writeUInt16LE(_verMade, Constants.CENVEM); // version needed to extract data.writeUInt16LE(_version, Constants.CENVER); // encrypt, decrypt flags data.writeUInt16LE(_flags, Constants.CENFLG); // compression method data.writeUInt16LE(_method, Constants.CENHOW); // modification time (2 bytes time, 2 bytes date) data.writeUInt32LE(_time, Constants.CENTIM); // uncompressed file crc-32 value data.writeUInt32LE(_crc, Constants.CENCRC); // compressed size data.writeUInt32LE(_compressedSize, Constants.CENSIZ); // uncompressed size data.writeUInt32LE(_size, Constants.CENLEN); // filename length data.writeUInt16LE(_fnameLen, Constants.CENNAM); // extra field length data.writeUInt16LE(_extraLen, Constants.CENEXT); // file comment length data.writeUInt16LE(_comLen, Constants.CENCOM); // volume number start data.writeUInt16LE(_diskStart, Constants.CENDSK); // internal file attributes data.writeUInt16LE(_inattr, Constants.CENATT); // external file attributes data.writeUInt32LE(_attr, Constants.CENATX); // LOC header offset data.writeUInt32LE(_offset, Constants.CENOFF); // fill all with data.fill(0x00, Constants.CENHDR); return data; }, toJSON: function () { const bytes = function (nr) { return nr + " bytes"; }; return { made: _verMade, version: _version, flags: _flags, method: Utils.methodToString(_method), time: this.time, crc: "0x" + _crc.toString(16).toUpperCase(), compressedSize: bytes(_compressedSize), size: bytes(_size), fileNameLength: bytes(_fnameLen), extraLength: bytes(_extraLen), commentLength: bytes(_comLen), diskNumStart: _diskStart, inAttr: _inattr, attr: _attr, offset: _offset, entryHeaderSize: bytes(Constants.CENHDR + _fnameLen + _extraLen + _comLen) }; }, toString: function () { return JSON.stringify(this.toJSON(), null, "\t"); } }; }; /***/ }), /***/ "./node_modules/adm-zip/headers/index.js": /*!***********************************************!*\ !*** ./node_modules/adm-zip/headers/index.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { exports.EntryHeader = __webpack_require__(/*! ./entryHeader */ "./node_modules/adm-zip/headers/entryHeader.js"); exports.MainHeader = __webpack_require__(/*! ./mainHeader */ "./node_modules/adm-zip/headers/mainHeader.js"); /***/ }), /***/ "./node_modules/adm-zip/headers/mainHeader.js": /*!****************************************************!*\ !*** ./node_modules/adm-zip/headers/mainHeader.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var Utils = __webpack_require__(/*! ../util */ "./node_modules/adm-zip/util/index.js"), Constants = Utils.Constants; /* The entries in the end of central directory */ module.exports = function () { var _volumeEntries = 0, _totalEntries = 0, _size = 0, _offset = 0, _commentLength = 0; return { get diskEntries() { return _volumeEntries; }, set diskEntries( /*Number*/ val) { _volumeEntries = _totalEntries = val; }, get totalEntries() { return _totalEntries; }, set totalEntries( /*Number*/ val) { _totalEntries = _volumeEntries = val; }, get size() { return _size; }, set size( /*Number*/ val) { _size = val; }, get offset() { return _offset; }, set offset( /*Number*/ val) { _offset = val; }, get commentLength() { return _commentLength; }, set commentLength( /*Number*/ val) { _commentLength = val; }, get mainHeaderSize() { return Constants.ENDHDR + _commentLength; }, loadFromBinary: function ( /*Buffer*/ data) { // data should be 22 bytes and start with "PK 05 06" // or be 56+ bytes and start with "PK 06 06" for Zip64 if ((data.length !== Constants.ENDHDR || data.readUInt32LE(0) !== Constants.ENDSIG) && (data.length < Constants.ZIP64HDR || data.readUInt32LE(0) !== Constants.ZIP64SIG)) { throw new Error(Utils.Errors.INVALID_END); } if (data.readUInt32LE(0) === Constants.ENDSIG) { // number of entries on this volume _volumeEntries = data.readUInt16LE(Constants.ENDSUB); // total number of entries _totalEntries = data.readUInt16LE(Constants.ENDTOT); // central directory size in bytes _size = data.readUInt32LE(Constants.ENDSIZ); // offset of first CEN header _offset = data.readUInt32LE(Constants.ENDOFF); // zip file comment length _commentLength = data.readUInt16LE(Constants.ENDCOM); } else { // number of entries on this volume _volumeEntries = Utils.readBigUInt64LE(data, Constants.ZIP64SUB); // total number of entries _totalEntries = Utils.readBigUInt64LE(data, Constants.ZIP64TOT); // central directory size in bytes _size = Utils.readBigUInt64LE(data, Constants.ZIP64SIZ); // offset of first CEN header _offset = Utils.readBigUInt64LE(data, Constants.ZIP64OFF); _commentLength = 0; } }, toBinary: function () { var b = Buffer.alloc(Constants.ENDHDR + _commentLength); // "PK 05 06" signature b.writeUInt32LE(Constants.ENDSIG, 0); b.writeUInt32LE(0, 4); // number of entries on this volume b.writeUInt16LE(_volumeEntries, Constants.ENDSUB); // total number of entries b.writeUInt16LE(_totalEntries, Constants.ENDTOT); // central directory size in bytes b.writeUInt32LE(_size, Constants.ENDSIZ); // offset of first CEN header b.writeUInt32LE(_offset, Constants.ENDOFF); // zip file comment length b.writeUInt16LE(_commentLength, Constants.ENDCOM); // fill comment memory with spaces so no garbage is left there b.fill(" ", Constants.ENDHDR); return b; }, toJSON: function () { // creates 0x0000 style output const offset = function (nr, len) { let offs = nr.toString(16).toUpperCase(); while (offs.length < len) offs = "0" + offs; return "0x" + offs; }; return { diskEntries: _volumeEntries, totalEntries: _totalEntries, size: _size + " bytes", offset: offset(_offset, 4), commentLength: _commentLength }; }, toString: function () { return JSON.stringify(this.toJSON(), null, "\t"); } }; }; /***/ }), /***/ "./node_modules/adm-zip/methods/deflater.js": /*!**************************************************!*\ !*** ./node_modules/adm-zip/methods/deflater.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = function ( /*Buffer*/ inbuf) { var zlib = __webpack_require__(/*! zlib */ "zlib"); var opts = { chunkSize: (parseInt(inbuf.length / 1024) + 1) * 1024 }; return { deflate: function () { return zlib.deflateRawSync(inbuf, opts); }, deflateAsync: function ( /*Function*/ callback) { var tmp = zlib.createDeflateRaw(opts), parts = [], total = 0; tmp.on("data", function (data) { parts.push(data); total += data.length; }); tmp.on("end", function () { var buf = Buffer.alloc(total), written = 0; buf.fill(0); for (var i = 0; i < parts.length; i++) { var part = parts[i]; part.copy(buf, written); written += part.length; } callback && callback(buf); }); tmp.end(inbuf); } }; }; /***/ }), /***/ "./node_modules/adm-zip/methods/index.js": /*!***********************************************!*\ !*** ./node_modules/adm-zip/methods/index.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { exports.Deflater = __webpack_require__(/*! ./deflater */ "./node_modules/adm-zip/methods/deflater.js"); exports.Inflater = __webpack_require__(/*! ./inflater */ "./node_modules/adm-zip/methods/inflater.js"); exports.ZipCrypto = __webpack_require__(/*! ./zipcrypto */ "./node_modules/adm-zip/methods/zipcrypto.js"); /***/ }), /***/ "./node_modules/adm-zip/methods/inflater.js": /*!**************************************************!*\ !*** ./node_modules/adm-zip/methods/inflater.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = function ( /*Buffer*/ inbuf) { var zlib = __webpack_require__(/*! zlib */ "zlib"); return { inflate: function () { return zlib.inflateRawSync(inbuf); }, inflateAsync: function ( /*Function*/ callback) { var tmp = zlib.createInflateRaw(), parts = [], total = 0; tmp.on("data", function (data) { parts.push(data); total += data.length; }); tmp.on("end", function () { var buf = Buffer.alloc(total), written = 0; buf.fill(0); for (var i = 0; i < parts.length; i++) { var part = parts[i]; part.copy(buf, written); written += part.length; } callback && callback(buf); }); tmp.end(inbuf); } }; }; /***/ }), /***/ "./node_modules/adm-zip/methods/zipcrypto.js": /*!***************************************************!*\ !*** ./node_modules/adm-zip/methods/zipcrypto.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // node crypt, we use it for generate salt // eslint-disable-next-line node/no-unsupported-features/node-builtins const _require = __webpack_require__(/*! crypto */ "crypto"), randomFillSync = _require.randomFillSync; // generate CRC32 lookup table const crctable = new Uint32Array(256).map((t, crc) => { for (let j = 0; j < 8; j++) { if (0 !== (crc & 1)) { crc = crc >>> 1 ^ 0xedb88320; } else { crc >>>= 1; } } return crc >>> 0; }); // C-style uInt32 Multiply (discards higher bits, when JS multiply discards lower bits) const uMul = (a, b) => Math.imul(a, b) >>> 0; // crc32 byte single update (actually same function is part of utils.crc32 function :) ) const crc32update = (pCrc32, bval) => { return crctable[(pCrc32 ^ bval) & 0xff] ^ pCrc32 >>> 8; }; // function for generating salt for encrytion header const genSalt = () => { if ("function" === typeof randomFillSync) { return randomFillSync(Buffer.alloc(12)); } else { // fallback if function is not defined return genSalt.node(); } }; // salt generation with node random function (mainly as fallback) genSalt.node = () => { const salt = Buffer.alloc(12); const len = salt.length; for (let i = 0; i < len; i++) salt[i] = Math.random() * 256 & 0xff; return salt; }; // general config const config = { genSalt }; // Class Initkeys handles same basic ops with keys function Initkeys(pw) { const pass = Buffer.isBuffer(pw) ? pw : Buffer.from(pw); this.keys = new Uint32Array([0x12345678, 0x23456789, 0x34567890]); for (let i = 0; i < pass.length; i++) { this.updateKeys(pass[i]); } } Initkeys.prototype.updateKeys = function (byteValue) { const keys = this.keys; keys[0] = crc32update(keys[0], byteValue); keys[1] += keys[0] & 0xff; keys[1] = uMul(keys[1], 134775813) + 1; keys[2] = crc32update(keys[2], keys[1] >>> 24); return byteValue; }; Initkeys.prototype.next = function () { const k = (this.keys[2] | 2) >>> 0; // key return uMul(k, k ^ 1) >> 8 & 0xff; // decode }; function make_decrypter( /*Buffer*/ pwd) { // 1. Stage initialize key const keys = new Initkeys(pwd); // return decrypter function return function ( /*Buffer*/ data) { // result - we create new Buffer for results const result = Buffer.alloc(data.length); let pos = 0; // process input data for (let c of data) { //c ^= keys.next(); //result[pos++] = c; // decode & Save Value result[pos++] = keys.updateKeys(c ^ keys.next()); // update keys with decoded byte } return result; }; } function make_encrypter( /*Buffer*/ pwd) { // 1. Stage initialize key const keys = new Initkeys(pwd); // return encrypting function, result and pos is here so we dont have to merge buffers later return function ( /*Buffer*/ data, /*Buffer*/ result, /* Number */ pos = 0) { // result - we create new Buffer for results if (!result) result = Buffer.alloc(data.length); // process input data for (let c of data) { const k = keys.next(); // save key byte result[pos++] = c ^ k; // save val keys.updateKeys(c); // update keys with decoded byte } return result; }; } function decrypt( /*Buffer*/ data, /*Object*/ header, /*String, Buffer*/ pwd) { if (!data || !Buffer.isBuffer(data) || data.length < 12) { return Buffer.alloc(0); } // 1. We Initialize and generate decrypting function const decrypter = make_decrypter(pwd); // 2. decrypt salt what is always 12 bytes and is a part of file content const salt = decrypter(data.slice(0, 12)); // 3. does password meet expectations if (salt[11] !== header.crc >>> 24) { throw "ADM-ZIP: Wrong Password"; } // 4. decode content return decrypter(data.slice(12)); } // lets add way to populate salt, NOT RECOMMENDED for production but maybe useful for testing general functionality function _salter(data) { if (Buffer.isBuffer(data) && data.length >= 12) { // be aware - currently salting buffer data is modified config.genSalt = function () { return data.slice(0, 12); }; } else if (data === "node") { // test salt generation with node random function config.genSalt = genSalt.node; } else { // if value is not acceptable config gets reset. config.genSalt = genSalt; } } function encrypt( /*Buffer*/ data, /*Object*/ header, /*String, Buffer*/ pwd, /*Boolean*/ oldlike = false) { // 1. test data if data is not Buffer we make buffer from it if (data == null) data = Buffer.alloc(0); // if data is not buffer be make buffer from it if (!Buffer.isBuffer(data)) data = Buffer.from(data.toString()); // 2. We Initialize and generate encrypting function const encrypter = make_encrypter(pwd); // 3. generate salt (12-bytes of random data) const salt = config.genSalt(); salt[11] = header.crc >>> 24 & 0xff; // old implementations (before PKZip 2.04g) used two byte check if (oldlike) salt[10] = header.crc >>> 16 & 0xff; // 4. create output const result = Buffer.alloc(data.length + 12); encrypter(salt, result); // finally encode content return encrypter(data, result, 12); } module.exports = { decrypt, encrypt, _salter }; /***/ }), /***/ "./node_modules/adm-zip/util/constants.js": /*!************************************************!*\ !*** ./node_modules/adm-zip/util/constants.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = { /* The local file header */ LOCHDR: 30, // LOC header size LOCSIG: 0x04034b50, // "PK\003\004" LOCVER: 4, // version needed to extract LOCFLG: 6, // general purpose bit flag LOCHOW: 8, // compression method LOCTIM: 10, // modification time (2 bytes time, 2 bytes date) LOCCRC: 14, // uncompressed file crc-32 value LOCSIZ: 18, // compressed size LOCLEN: 22, // uncompressed size LOCNAM: 26, // filename length LOCEXT: 28, // extra field length /* The Data descriptor */ EXTSIG: 0x08074b50, // "PK\007\008" EXTHDR: 16, // EXT header size EXTCRC: 4, // uncompressed file crc-32 value EXTSIZ: 8, // compressed size EXTLEN: 12, // uncompressed size /* The central directory file header */ CENHDR: 46, // CEN header size CENSIG: 0x02014b50, // "PK\001\002" CENVEM: 4, // version made by CENVER: 6, // version needed to extract CENFLG: 8, // encrypt, decrypt flags CENHOW: 10, // compression method CENTIM: 12, // modification time (2 bytes time, 2 bytes date) CENCRC: 16, // uncompressed file crc-32 value CENSIZ: 20, // compressed size CENLEN: 24, // uncompressed size CENNAM: 28, // filename length CENEXT: 30, // extra field length CENCOM: 32, // file comment length CENDSK: 34, // volume number start CENATT: 36, // internal file attributes CENATX: 38, // external file attributes (host system dependent) CENOFF: 42, // LOC header offset /* The entries in the end of central directory */ ENDHDR: 22, // END header size ENDSIG: 0x06054b50, // "PK\005\006" ENDSUB: 8, // number of entries on this disk ENDTOT: 10, // total number of entries ENDSIZ: 12, // central directory size in bytes ENDOFF: 16, // offset of first CEN header ENDCOM: 20, // zip file comment length END64HDR: 20, // zip64 END header size END64SIG: 0x07064b50, // zip64 Locator signature, "PK\006\007" END64START: 4, // number of the disk with the start of the zip64 END64OFF: 8, // relative offset of the zip64 end of central directory END64NUMDISKS: 16, // total number of disks ZIP64SIG: 0x06064b50, // zip64 signature, "PK\006\006" ZIP64HDR: 56, // zip64 record minimum size ZIP64LEAD: 12, // leading bytes at the start of the record, not counted by the value stored in ZIP64SIZE ZIP64SIZE: 4, // zip64 size of the central directory record ZIP64VEM: 12, // zip64 version made by ZIP64VER: 14, // zip64 version needed to extract ZIP64DSK: 16, // zip64 number of this disk ZIP64DSKDIR: 20, // number of the disk with the start of the record directory ZIP64SUB: 24, // number of entries on this disk ZIP64TOT: 32, // total number of entries ZIP64SIZB: 40, // zip64 central directory size in bytes ZIP64OFF: 48, // offset of start of central directory with respect to the starting disk number ZIP64EXTRA: 56, // extensible data sector /* Compression methods */ STORED: 0, // no compression SHRUNK: 1, // shrunk REDUCED1: 2, // reduced with compression factor 1 REDUCED2: 3, // reduced with compression factor 2 REDUCED3: 4, // reduced with compression factor 3 REDUCED4: 5, // reduced with compression factor 4 IMPLODED: 6, // imploded // 7 reserved for Tokenizing compression algorithm DEFLATED: 8, // deflated ENHANCED_DEFLATED: 9, // enhanced deflated PKWARE: 10, // PKWare DCL imploded // 11 reserved by PKWARE BZIP2: 12, // compressed using BZIP2 // 13 reserved by PKWARE LZMA: 14, // LZMA // 15-17 reserved by PKWARE IBM_TERSE: 18, // compressed using IBM TERSE IBM_LZ77: 19, // IBM LZ77 z AES_ENCRYPT: 99, // WinZIP AES encryption method /* General purpose bit flag */ // values can obtained with expression 2**bitnr FLG_ENC: 1, // Bit 0: encrypted file FLG_COMP1: 2, // Bit 1, compression option FLG_COMP2: 4, // Bit 2, compression option FLG_DESC: 8, // Bit 3, data descriptor FLG_ENH: 16, // Bit 4, enhanced deflating FLG_PATCH: 32, // Bit 5, indicates that the file is compressed patched data. FLG_STR: 64, // Bit 6, strong encryption (patented) // Bits 7-10: Currently unused. FLG_EFS: 2048, // Bit 11: Language encoding flag (EFS) // Bit 12: Reserved by PKWARE for enhanced compression. // Bit 13: encrypted the Central Directory (patented). // Bits 14-15: Reserved by PKWARE. FLG_MSK: 4096, // mask header values /* Load type */ FILE: 2, BUFFER: 1, NONE: 0, /* 4.5 Extensible data fields */ EF_ID: 0, EF_SIZE: 2, /* Header IDs */ ID_ZIP64: 0x0001, ID_AVINFO: 0x0007, ID_PFS: 0x0008, ID_OS2: 0x0009, ID_NTFS: 0x000a, ID_OPENVMS: 0x000c, ID_UNIX: 0x000d, ID_FORK: 0x000e, ID_PATCH: 0x000f, ID_X509_PKCS7: 0x0014, ID_X509_CERTID_F: 0x0015, ID_X509_CERTID_C: 0x0016, ID_STRONGENC: 0x0017, ID_RECORD_MGT: 0x0018, ID_X509_PKCS7_RL: 0x0019, ID_IBM1: 0x0065, ID_IBM2: 0x0066, ID_POSZIP: 0x4690, EF_ZIP64_OR_32: 0xffffffff, EF_ZIP64_OR_16: 0xffff, EF_ZIP64_SUNCOMP: 0, EF_ZIP64_SCOMP: 8, EF_ZIP64_RHO: 16, EF_ZIP64_DSN: 24 }; /***/ }), /***/ "./node_modules/adm-zip/util/errors.js": /*!*********************************************!*\ !*** ./node_modules/adm-zip/util/errors.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = { /* Header error messages */ INVALID_LOC: "Invalid LOC header (bad signature)", INVALID_CEN: "Invalid CEN header (bad signature)", INVALID_END: "Invalid END header (bad signature)", /* ZipEntry error messages*/ NO_DATA: "Nothing to decompress", BAD_CRC: "CRC32 checksum failed", FILE_IN_THE_WAY: "There is a file in the way: %s", UNKNOWN_METHOD: "Invalid/unsupported compression method", /* Inflater error messages */ AVAIL_DATA: "inflate::Available inflate data did not terminate", INVALID_DISTANCE: "inflate::Invalid literal/length or distance code in fixed or dynamic block", TO_MANY_CODES: "inflate::Dynamic block code description: too many length or distance codes", INVALID_REPEAT_LEN: "inflate::Dynamic block code description: repeat more than specified lengths", INVALID_REPEAT_FIRST: "inflate::Dynamic block code description: repeat lengths with no first length", INCOMPLETE_CODES: "inflate::Dynamic block code description: code lengths codes incomplete", INVALID_DYN_DISTANCE: "inflate::Dynamic block code description: invalid distance code lengths", INVALID_CODES_LEN: "inflate::Dynamic block code description: invalid literal/length code lengths", INVALID_STORE_BLOCK: "inflate::Stored block length did not match one's complement", INVALID_BLOCK_TYPE: "inflate::Invalid block type (type == 3)", /* ADM-ZIP error messages */ CANT_EXTRACT_FILE: "Could not extract the file", CANT_OVERRIDE: "Target file already exists", NO_ZIP: "No zip file was loaded", NO_ENTRY: "Entry doesn't exist", DIRECTORY_CONTENT_ERROR: "A directory cannot have content", FILE_NOT_FOUND: "File not found: %s", NOT_IMPLEMENTED: "Not implemented", INVALID_FILENAME: "Invalid filename", INVALID_FORMAT: "Invalid or unsupported zip format. No END header found" }; /***/ }), /***/ "./node_modules/adm-zip/util/fattr.js": /*!********************************************!*\ !*** ./node_modules/adm-zip/util/fattr.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { const fs = __webpack_require__(/*! ./fileSystem */ "./node_modules/adm-zip/util/fileSystem.js").require(); const pth = __webpack_require__(/*! path */ "path"); fs.existsSync = fs.existsSync || pth.existsSync; module.exports = function ( /*String*/ path) { var _path = path || "", _obj = newAttr(), _stat = null; function newAttr() { return { directory: false, readonly: false, hidden: false, executable: false, mtime: 0, atime: 0 }; } if (_path && fs.existsSync(_path)) { _stat = fs.statSync(_path); _obj.directory = _stat.isDirectory(); _obj.mtime = _stat.mtime; _obj.atime = _stat.atime; _obj.executable = (0o111 & _stat.mode) !== 0; // file is executable who ever har right not just owner _obj.readonly = (0o200 & _stat.mode) === 0; // readonly if owner has no write right _obj.hidden = pth.basename(_path)[0] === "."; } else { console.warn("Invalid path: " + _path); } return { get directory() { return _obj.directory; }, get readOnly() { return _obj.readonly; }, get hidden() { return _obj.hidden; }, get mtime() { return _obj.mtime; }, get atime() { return _obj.atime; }, get executable() { return _obj.executable; }, decodeAttributes: function () {}, encodeAttributes: function () {}, toJSON: function () { return { path: _path, isDirectory: _obj.directory, isReadOnly: _obj.readonly, isHidden: _obj.hidden, isExecutable: _obj.executable, mTime: _obj.mtime, aTime: _obj.atime }; }, toString: function () { return JSON.stringify(this.toJSON(), null, "\t"); } }; }; /***/ }), /***/ "./node_modules/adm-zip/util/fileSystem.js": /*!*************************************************!*\ !*** ./node_modules/adm-zip/util/fileSystem.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { exports.require = function () { if (typeof process === "object" && process.versions && process.versions["electron"]) { try { const originalFs = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module 'original-fs'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())); if (Object.keys(originalFs).length > 0) { return originalFs; } } catch (e) {} } return __webpack_require__(/*! fs */ "fs"); }; /***/ }), /***/ "./node_modules/adm-zip/util/index.js": /*!********************************************!*\ !*** ./node_modules/adm-zip/util/index.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(/*! ./utils */ "./node_modules/adm-zip/util/utils.js"); module.exports.Constants = __webpack_require__(/*! ./constants */ "./node_modules/adm-zip/util/constants.js"); module.exports.Errors = __webpack_require__(/*! ./errors */ "./node_modules/adm-zip/util/errors.js"); module.exports.FileAttr = __webpack_require__(/*! ./fattr */ "./node_modules/adm-zip/util/fattr.js"); /***/ }), /***/ "./node_modules/adm-zip/util/utils.js": /*!********************************************!*\ !*** ./node_modules/adm-zip/util/utils.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { const fsystem = __webpack_require__(/*! ./fileSystem */ "./node_modules/adm-zip/util/fileSystem.js").require(); const pth = __webpack_require__(/*! path */ "path"); const Constants = __webpack_require__(/*! ./constants */ "./node_modules/adm-zip/util/constants.js"); const isWin = typeof process === "object" && "win32" === process.platform; const is_Obj = obj => obj && typeof obj === "object"; // generate CRC32 lookup table const crcTable = new Uint32Array(256).map((t, c) => { for (let k = 0; k < 8; k++) { if ((c & 1) !== 0) { c = 0xedb88320 ^ c >>> 1; } else { c >>>= 1; } } return c >>> 0; }); // UTILS functions function Utils(opts) { this.sep = pth.sep; this.fs = fsystem; if (is_Obj(opts)) { // custom filesystem if (is_Obj(opts.fs) && typeof opts.fs.statSync === "function") { this.fs = opts.fs; } } } module.exports = Utils; // INSTANCED functions Utils.prototype.makeDir = function ( /*String*/ folder) { const self = this; // Sync - make directories tree function mkdirSync( /*String*/ fpath) { let resolvedPath = fpath.split(self.sep)[0]; fpath.split(self.sep).forEach(function (name) { if (!name || name.substr(-1, 1) === ":") return; resolvedPath += self.sep + name; var stat; try { stat = self.fs.statSync(resolvedPath); } catch (e) { self.fs.mkdirSync(resolvedPath); } if (stat && stat.isFile()) throw Errors.FILE_IN_THE_WAY.replace("%s", resolvedPath); }); } mkdirSync(folder); }; Utils.prototype.writeFileTo = function ( /*String*/ path, /*Buffer*/ content, /*Boolean*/ overwrite, /*Number*/ attr) { const self = this; if (self.fs.existsSync(path)) { if (!overwrite) return false; // cannot overwrite var stat = self.fs.statSync(path); if (stat.isDirectory()) { return false; } } var folder = pth.dirname(path); if (!self.fs.existsSync(folder)) { self.makeDir(folder); } var fd; try { fd = self.fs.openSync(path, "w", 438); // 0666 } catch (e) { self.fs.chmodSync(path, 438); fd = self.fs.openSync(path, "w", 438); } if (fd) { try { self.fs.writeSync(fd, content, 0, content.length, 0); } finally { self.fs.closeSync(fd); } } self.fs.chmodSync(path, attr || 438); return true; }; Utils.prototype.writeFileToAsync = function ( /*String*/ path, /*Buffer*/ content, /*Boolean*/ overwrite, /*Number*/ attr, /*Function*/ callback) { if (typeof attr === "function") { callback = attr; attr = undefined; } const self = this; self.fs.exists(path, function (exist) { if (exist && !overwrite) return callback(false); self.fs.stat(path, function (err, stat) { if (exist && stat.isDirectory()) { return callback(false); } var folder = pth.dirname(path); self.fs.exists(folder, function (exists) { if (!exists) self.makeDir(folder); self.fs.open(path, "w", 438, function (err, fd) { if (err) { self.fs.chmod(path, 438, function () { self.fs.open(path, "w", 438, function (err, fd) { self.fs.write(fd, content, 0, content.length, 0, function () { self.fs.close(fd, function () { self.fs.chmod(path, attr || 438, function () { callback(true); }); }); }); }); }); } else if (fd) { self.fs.write(fd, content, 0, content.length, 0, function () { self.fs.close(fd, function () { self.fs.chmod(path, attr || 438, function () { callback(true); }); }); }); } else { self.fs.chmod(path, attr || 438, function () { callback(true); }); } }); }); }); }); }; Utils.prototype.findFiles = function ( /*String*/ path) { const self = this; function findSync( /*String*/ dir, /*RegExp*/ pattern, /*Boolean*/ recursive) { if (typeof pattern === "boolean") { recursive = pattern; pattern = undefined; } let files = []; self.fs.readdirSync(dir).forEach(function (file) { var path = pth.join(dir, file); if (self.fs.statSync(path).isDirectory() && recursive) files = files.concat(findSync(path, pattern, recursive)); if (!pattern || pattern.test(path)) { files.push(pth.normalize(path) + (self.fs.statSync(path).isDirectory() ? self.sep : "")); } }); return files; } return findSync(path, undefined, true); }; Utils.prototype.getAttributes = function () {}; Utils.prototype.setAttributes = function () {}; // STATIC functions // crc32 single update (it is part of crc32) Utils.crc32update = function (crc, byte) { return crcTable[(crc ^ byte) & 0xff] ^ crc >>> 8; }; Utils.crc32 = function (buf) { if (typeof buf === "string") { buf = Buffer.from(buf, "utf8"); } // Generate crcTable if (!crcTable.length) genCRCTable(); let len = buf.length; let crc = ~0; for (let off = 0; off < len;) crc = Utils.crc32update(crc, buf[off++]); // xor and cast as uint32 number return ~crc >>> 0; }; Utils.methodToString = function ( /*Number*/ method) { switch (method) { case Constants.STORED: return "STORED (" + method + ")"; case Constants.DEFLATED: return "DEFLATED (" + method + ")"; default: return "UNSUPPORTED (" + method + ")"; } }; // removes ".." style path elements Utils.canonical = function ( /*string*/ path) { if (!path) return ""; // trick normalize think path is absolute var safeSuffix = pth.posix.normalize("/" + path.split("\\").join("/")); return pth.join(".", safeSuffix); }; // make abolute paths taking prefix as root folder Utils.sanitize = function ( /*string*/ prefix, /*string*/ name) { prefix = pth.resolve(pth.normalize(prefix)); var parts = name.split("/"); for (var i = 0, l = parts.length; i < l; i++) { var path = pth.normalize(pth.join(prefix, parts.slice(i, l).join(pth.sep))); if (path.indexOf(prefix) === 0) { return path; } } return pth.normalize(pth.join(prefix, pth.basename(name))); }; // converts buffer, Uint8Array, string types to buffer Utils.toBuffer = function toBuffer( /*buffer, Uint8Array, string*/ input) { if (Buffer.isBuffer(input)) { return input; } else if (input instanceof Uint8Array) { return Buffer.from(input); } else { // expect string all other values are invalid and return empty buffer return typeof input === "string" ? Buffer.from(input, "utf8") : Buffer.alloc(0); } }; Utils.readBigUInt64LE = function ( /*Buffer*/ buffer, /*int*/ index) { var slice = Buffer.from(buffer.slice(index, index + 8)); slice.swap64(); return parseInt(`0x${slice.toString("hex")}`); }; Utils.isWin = isWin; // Do we have windows system Utils.crcTable = crcTable; /***/ }), /***/ "./node_modules/adm-zip/zipEntry.js": /*!******************************************!*\ !*** ./node_modules/adm-zip/zipEntry.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var Utils = __webpack_require__(/*! ./util */ "./node_modules/adm-zip/util/index.js"), Headers = __webpack_require__(/*! ./headers */ "./node_modules/adm-zip/headers/index.js"), Constants = Utils.Constants, Methods = __webpack_require__(/*! ./methods */ "./node_modules/adm-zip/methods/index.js"); module.exports = function ( /*Buffer*/ input) { var _entryHeader = new Headers.EntryHeader(), _entryName = Buffer.alloc(0), _comment = Buffer.alloc(0), _isDirectory = false, uncompressedData = null, _extra = Buffer.alloc(0); function getCompressedDataFromZip() { if (!input || !Buffer.isBuffer(input)) { return Buffer.alloc(0); } _entryHeader.loadDataHeaderFromBinary(input); return input.slice(_entryHeader.realDataOffset, _entryHeader.realDataOffset + _entryHeader.compressedSize); } function crc32OK(data) { // if bit 3 (0x08) of the general-purpose flags field is set, then the CRC-32 and file sizes are not known when the header is written if ((_entryHeader.flags & 0x8) !== 0x8) { if (Utils.crc32(data) !== _entryHeader.dataHeader.crc) { return false; } } else {// @TODO: load and check data descriptor header // The fields in the local header are filled with zero, and the CRC-32 and size are appended in a 12-byte structure // (optionally preceded by a 4-byte signature) immediately after the compressed data: } return true; } function decompress( /*Boolean*/ async, /*Function*/ callback, /*String, Buffer*/ pass) { if (typeof callback === "undefined" && typeof async === "string") { pass = async; async = void 0; } if (_isDirectory) { if (async && callback) { callback(Buffer.alloc(0), Utils.Errors.DIRECTORY_CONTENT_ERROR); //si added error. } return Buffer.alloc(0); } var compressedData = getCompressedDataFromZip(); if (compressedData.length === 0) { // File is empty, nothing to decompress. if (async && callback) callback(compressedData); return compressedData; } if (_entryHeader.encripted) { if ("string" !== typeof pass && !Buffer.isBuffer(pass)) { throw new Error("ADM-ZIP: Incompatible password parameter"); } compressedData = Methods.ZipCrypto.decrypt(compressedData, _entryHeader, pass); } var data = Buffer.alloc(_entryHeader.size); switch (_entryHeader.method) { case Utils.Constants.STORED: compressedData.copy(data); if (!crc32OK(data)) { if (async && callback) callback(data, Utils.Errors.BAD_CRC); //si added error throw new Error(Utils.Errors.BAD_CRC); } else { //si added otherwise did not seem to return data. if (async && callback) callback(data); return data; } case Utils.Constants.DEFLATED: var inflater = new Methods.Inflater(compressedData); if (!async) { const result = inflater.inflate(data); result.copy(data, 0); if (!crc32OK(data)) { throw new Error(Utils.Errors.BAD_CRC + " " + _entryName.toString()); } return data; } else { inflater.inflateAsync(function (result) { result.copy(result, 0); if (callback) { if (!crc32OK(result)) { callback(result, Utils.Errors.BAD_CRC); //si added error } else { callback(result); } } }); } break; default: if (async && callback) callback(Buffer.alloc(0), Utils.Errors.UNKNOWN_METHOD); throw new Error(Utils.Errors.UNKNOWN_METHOD); } } function compress( /*Boolean*/ async, /*Function*/ callback) { if ((!uncompressedData || !uncompressedData.length) && Buffer.isBuffer(input)) { // no data set or the data wasn't changed to require recompression if (async && callback) callback(getCompressedDataFromZip()); return getCompressedDataFromZip(); } if (uncompressedData.length && !_isDirectory) { var compressedData; // Local file header switch (_entryHeader.method) { case Utils.Constants.STORED: _entryHeader.compressedSize = _entryHeader.size; compressedData = Buffer.alloc(uncompressedData.length); uncompressedData.copy(compressedData); if (async && callback) callback(compressedData); return compressedData; default: case Utils.Constants.DEFLATED: var deflater = new Methods.Deflater(uncompressedData); if (!async) { var deflated = deflater.deflate(); _entryHeader.compressedSize = deflated.length; return deflated; } else { deflater.deflateAsync(function (data) { compressedData = Buffer.alloc(data.length); _entryHeader.compressedSize = data.length; data.copy(compressedData); callback && callback(compressedData); }); } deflater = null; break; } } else if (async && callback) { callback(Buffer.alloc(0)); } else { return Buffer.alloc(0); } } function readUInt64LE(buffer, offset) { return (buffer.readUInt32LE(offset + 4) << 4) + buffer.readUInt32LE(offset); } function parseExtra(data) { var offset = 0; var signature, size, part; while (offset < data.length) { signature = data.readUInt16LE(offset); offset += 2; size = data.readUInt16LE(offset); offset += 2; part = data.slice(offset, offset + size); offset += size; if (Constants.ID_ZIP64 === signature) { parseZip64ExtendedInformation(part); } } } //Override header field values with values from the ZIP64 extra field function parseZip64ExtendedInformation(data) { var size, compressedSize, offset, diskNumStart; if (data.length >= Constants.EF_ZIP64_SCOMP) { size = readUInt64LE(data, Constants.EF_ZIP64_SUNCOMP); if (_entryHeader.size === Constants.EF_ZIP64_OR_32) { _entryHeader.size = size; } } if (data.length >= Constants.EF_ZIP64_RHO) { compressedSize = readUInt64LE(data, Constants.EF_ZIP64_SCOMP); if (_entryHeader.compressedSize === Constants.EF_ZIP64_OR_32) { _entryHeader.compressedSize = compressedSize; } } if (data.length >= Constants.EF_ZIP64_DSN) { offset = readUInt64LE(data, Constants.EF_ZIP64_RHO); if (_entryHeader.offset === Constants.EF_ZIP64_OR_32) { _entryHeader.offset = offset; } } if (data.length >= Constants.EF_ZIP64_DSN + 4) { diskNumStart = data.readUInt32LE(Constants.EF_ZIP64_DSN); if (_entryHeader.diskNumStart === Constants.EF_ZIP64_OR_16) { _entryHeader.diskNumStart = diskNumStart; } } } return { get entryName() { return _entryName.toString(); }, get rawEntryName() { return _entryName; }, set entryName(val) { _entryName = Utils.toBuffer(val); var lastChar = _entryName[_entryName.length - 1]; _isDirectory = lastChar === 47 || lastChar === 92; _entryHeader.fileNameLength = _entryName.length; }, get extra() { return _extra; }, set extra(val) { _extra = val; _entryHeader.extraLength = val.length; parseExtra(val); }, get comment() { return _comment.toString(); }, set comment(val) { _comment = Utils.toBuffer(val); _entryHeader.commentLength = _comment.length; }, get name() { var n = _entryName.toString(); return _isDirectory ? n.substr(n.length - 1).split("/").pop() : n.split("/").pop(); }, get isDirectory() { return _isDirectory; }, getCompressedData: function () { return compress(false, null); }, getCompressedDataAsync: function ( /*Function*/ callback) { compress(true, callback); }, setData: function (value) { uncompressedData = Utils.toBuffer(value); if (!_isDirectory && uncompressedData.length) { _entryHeader.size = uncompressedData.length; _entryHeader.method = Utils.Constants.DEFLATED; _entryHeader.crc = Utils.crc32(value); _entryHeader.changed = true; } else { // folders and blank files should be stored _entryHeader.method = Utils.Constants.STORED; } }, getData: function (pass) { if (_entryHeader.changed) { return uncompressedData; } else { return decompress(false, null, pass); } }, getDataAsync: function ( /*Function*/ callback, pass) { if (_entryHeader.changed) { callback(uncompressedData); } else { decompress(true, callback, pass); } }, set attr(attr) { _entryHeader.attr = attr; }, get attr() { return _entryHeader.attr; }, set header( /*Buffer*/ data) { _entryHeader.loadFromBinary(data); }, get header() { return _entryHeader; }, packHeader: function () { // 1. create header (buffer) var header = _entryHeader.entryHeaderToBinary(); var addpos = Utils.Constants.CENHDR; // 2. add file name _entryName.copy(header, addpos); addpos += _entryName.length; // 3. add extra data if (_entryHeader.extraLength) { _extra.copy(header, addpos); addpos += _entryHeader.extraLength; } // 4. add file comment if (_entryHeader.commentLength) { _comment.copy(header, addpos); } return header; }, toJSON: function () { const bytes = function (nr) { return "<" + (nr && nr.length + " bytes buffer" || "null") + ">"; }; return { entryName: this.entryName, name: this.name, comment: this.comment, isDirectory: this.isDirectory, header: _entryHeader.toJSON(), compressedData: bytes(input), data: bytes(uncompressedData) }; }, toString: function () { return JSON.stringify(this.toJSON(), null, "\t"); } }; }; /***/ }), /***/ "./node_modules/adm-zip/zipFile.js": /*!*****************************************!*\ !*** ./node_modules/adm-zip/zipFile.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { const ZipEntry = __webpack_require__(/*! ./zipEntry */ "./node_modules/adm-zip/zipEntry.js"); const Headers = __webpack_require__(/*! ./headers */ "./node_modules/adm-zip/headers/index.js"); const Utils = __webpack_require__(/*! ./util */ "./node_modules/adm-zip/util/index.js"); module.exports = function ( /*Buffer|null*/ inBuffer, /** object */ options) { var entryList = [], entryTable = {}, _comment = Buffer.alloc(0), mainHeader = new Headers.MainHeader(), loadedEntries = false; // assign options const opts = Object.assign(Object.create(null), options); const noSort = opts.noSort; if (inBuffer) { // is a memory buffer readMainHeader(opts.readEntries); } else { // none. is a new file loadedEntries = true; } function iterateEntries(callback) { const totalEntries = mainHeader.diskEntries; // total number of entries let index = mainHeader.offset; // offset of first CEN header for (let i = 0; i < totalEntries; i++) { let tmp = index; const entry = new ZipEntry(inBuffer); entry.header = inBuffer.slice(tmp, tmp += Utils.Constants.CENHDR); entry.entryName = inBuffer.slice(tmp, tmp += entry.header.fileNameLength); index += entry.header.entryHeaderSize; callback(entry); } } function readEntries() { loadedEntries = true; entryTable = {}; entryList = new Array(mainHeader.diskEntries); // total number of entries var index = mainHeader.offset; // offset of first CEN header for (var i = 0; i < entryList.length; i++) { var tmp = index, entry = new ZipEntry(inBuffer); entry.header = inBuffer.slice(tmp, tmp += Utils.Constants.CENHDR); entry.entryName = inBuffer.slice(tmp, tmp += entry.header.fileNameLength); if (entry.header.extraLength) { entry.extra = inBuffer.slice(tmp, tmp += entry.header.extraLength); } if (entry.header.commentLength) entry.comment = inBuffer.slice(tmp, tmp + entry.header.commentLength); index += entry.header.entryHeaderSize; entryList[i] = entry; entryTable[entry.entryName] = entry; } } function readMainHeader( /*Boolean*/ readNow) { var i = inBuffer.length - Utils.Constants.ENDHDR, // END header size max = Math.max(0, i - 0xffff), // 0xFFFF is the max zip file comment length n = max, endStart = inBuffer.length, endOffset = -1, // Start offset of the END header commentEnd = 0; for (i; i >= n; i--) { if (inBuffer[i] !== 0x50) continue; // quick check that the byte is 'P' if (inBuffer.readUInt32LE(i) === Utils.Constants.ENDSIG) { // "PK\005\006" endOffset = i; commentEnd = i; endStart = i + Utils.Constants.ENDHDR; // We already found a regular signature, let's look just a bit further to check if there's any zip64 signature n = i - Utils.Constants.END64HDR; continue; } if (inBuffer.readUInt32LE(i) === Utils.Constants.END64SIG) { // Found a zip64 signature, let's continue reading the whole zip64 record n = max; continue; } if (inBuffer.readUInt32LE(i) === Utils.Constants.ZIP64SIG) { // Found the zip64 record, let's determine it's size endOffset = i; endStart = i + Utils.readBigUInt64LE(inBuffer, i + Utils.Constants.ZIP64SIZE) + Utils.Constants.ZIP64LEAD; break; } } if (!~endOffset) throw new Error(Utils.Errors.INVALID_FORMAT); mainHeader.loadFromBinary(inBuffer.slice(endOffset, endStart)); if (mainHeader.commentLength) { _comment = inBuffer.slice(commentEnd + Utils.Constants.ENDHDR); } if (readNow) readEntries(); } function sortEntries() { if (entryList.length > 1 && !noSort) { entryList.sort((a, b) => a.entryName.toLowerCase().localeCompare(b.entryName.toLowerCase())); } } return { /** * Returns an array of ZipEntry objects existent in the current opened archive * @return Array */ get entries() { if (!loadedEntries) { readEntries(); } return entryList; }, /** * Archive comment * @return {String} */ get comment() { return _comment.toString(); }, set comment(val) { _comment = Utils.toBuffer(val); mainHeader.commentLength = _comment.length; }, getEntryCount: function () { if (!loadedEntries) { return mainHeader.diskEntries; } return entryList.length; }, forEach: function (callback) { if (!loadedEntries) { iterateEntries(callback); return; } entryList.forEach(callback); }, /** * Returns a reference to the entry with the given name or null if entry is inexistent * * @param entryName * @return ZipEntry */ getEntry: function ( /*String*/ entryName) { if (!loadedEntries) { readEntries(); } return entryTable[entryName] || null; }, /** * Adds the given entry to the entry list * * @param entry */ setEntry: function ( /*ZipEntry*/ entry) { if (!loadedEntries) { readEntries(); } entryList.push(entry); entryTable[entry.entryName] = entry; mainHeader.totalEntries = entryList.length; }, /** * Removes the entry with the given name from the entry list. * * If the entry is a directory, then all nested files and directories will be removed * @param entryName */ deleteEntry: function ( /*String*/ entryName) { if (!loadedEntries) { readEntries(); } var entry = entryTable[entryName]; if (entry && entry.isDirectory) { var _self = this; this.getEntryChildren(entry).forEach(function (child) { if (child.entryName !== entryName) { _self.deleteEntry(child.entryName); } }); } entryList.splice(entryList.indexOf(entry), 1); delete entryTable[entryName]; mainHeader.totalEntries = entryList.length; }, /** * Iterates and returns all nested files and directories of the given entry * * @param entry * @return Array */ getEntryChildren: function ( /*ZipEntry*/ entry) { if (!loadedEntries) { readEntries(); } if (entry && entry.isDirectory) { const list = []; const name = entry.entryName; const len = name.length; entryList.forEach(function (zipEntry) { if (zipEntry.entryName.substr(0, len) === name) { list.push(zipEntry); } }); return list; } return []; }, /** * Returns the zip file * * @return Buffer */ compressToBuffer: function () { if (!loadedEntries) { readEntries(); } sortEntries(); const dataBlock = []; const entryHeaders = []; let totalSize = 0; let dindex = 0; mainHeader.size = 0; mainHeader.offset = 0; for (const entry of entryList) { // compress data and set local and entry header accordingly. Reason why is called first const compressedData = entry.getCompressedData(); // 1. construct data header entry.header.offset = dindex; const dataHeader = entry.header.dataHeaderToBinary(); const entryNameLen = entry.rawEntryName.length; // 1.2. postheader - data after data header const postHeader = Buffer.alloc(entryNameLen + entry.extra.length); entry.rawEntryName.copy(postHeader, 0); postHeader.copy(entry.extra, entryNameLen); // 2. offsets const dataLength = dataHeader.length + postHeader.length + compressedData.length; dindex += dataLength; // 3. store values in sequence dataBlock.push(dataHeader); dataBlock.push(postHeader); dataBlock.push(compressedData); // 4. construct entry header const entryHeader = entry.packHeader(); entryHeaders.push(entryHeader); // 5. update main header mainHeader.size += entryHeader.length; totalSize += dataLength + entryHeader.length; } totalSize += mainHeader.mainHeaderSize; // also includes zip file comment length // point to end of data and beginning of central directory first record mainHeader.offset = dindex; dindex = 0; const outBuffer = Buffer.alloc(totalSize); // write data blocks for (const content of dataBlock) { content.copy(outBuffer, dindex); dindex += content.length; } // write central directory entries for (const content of entryHeaders) { content.copy(outBuffer, dindex); dindex += content.length; } // write main header const mh = mainHeader.toBinary(); if (_comment) { _comment.copy(mh, Utils.Constants.ENDHDR); // add zip file comment } mh.copy(outBuffer, dindex); return outBuffer; }, toAsyncBuffer: function ( /*Function*/ onSuccess, /*Function*/ onFail, /*Function*/ onItemStart, /*Function*/ onItemEnd) { try { if (!loadedEntries) { readEntries(); } sortEntries(); const dataBlock = []; const entryHeaders = []; let totalSize = 0; let dindex = 0; mainHeader.size = 0; mainHeader.offset = 0; const compress2Buffer = function (entryLists) { if (entryLists.length) { const entry = entryLists.pop(); const name = entry.entryName + entry.extra.toString(); if (onItemStart) onItemStart(name); entry.getCompressedDataAsync(function (compressedData) { if (onItemEnd) onItemEnd(name); entry.header.offset = dindex; // data header const dataHeader = entry.header.dataHeaderToBinary(); const postHeader = Buffer.alloc(name.length, name); const dataLength = dataHeader.length + postHeader.length + compressedData.length; dindex += dataLength; dataBlock.push(dataHeader); dataBlock.push(postHeader); dataBlock.push(compressedData); const entryHeader = entry.packHeader(); entryHeaders.push(entryHeader); mainHeader.size += entryHeader.length; totalSize += dataLength + entryHeader.length; compress2Buffer(entryLists); }); } else { totalSize += mainHeader.mainHeaderSize; // also includes zip file comment length // point to end of data and beginning of central directory first record mainHeader.offset = dindex; dindex = 0; const outBuffer = Buffer.alloc(totalSize); dataBlock.forEach(function (content) { content.copy(outBuffer, dindex); // write data blocks dindex += content.length; }); entryHeaders.forEach(function (content) { content.copy(outBuffer, dindex); // write central directory entries dindex += content.length; }); const mh = mainHeader.toBinary(); if (_comment) { _comment.copy(mh, Utils.Constants.ENDHDR); // add zip file comment } mh.copy(outBuffer, dindex); // write main header onSuccess(outBuffer); } }; compress2Buffer(entryList); } catch (e) { onFail(e); } } }; }; /***/ }), /***/ "./node_modules/array.prototype.filter/implementation.js": /*!***************************************************************!*\ !*** ./node_modules/array.prototype.filter/implementation.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var ArraySpeciesCreate = __webpack_require__(/*! es-abstract/2020/ArraySpeciesCreate */ "./node_modules/es-abstract/2020/ArraySpeciesCreate.js"); var Call = __webpack_require__(/*! es-abstract/2020/Call */ "./node_modules/es-abstract/2020/Call.js"); var CreateDataPropertyOrThrow = __webpack_require__(/*! es-abstract/2020/CreateDataPropertyOrThrow */ "./node_modules/es-abstract/2020/CreateDataPropertyOrThrow.js"); var Get = __webpack_require__(/*! es-abstract/2020/Get */ "./node_modules/es-abstract/2020/Get.js"); var HasProperty = __webpack_require__(/*! es-abstract/2020/HasProperty */ "./node_modules/es-abstract/2020/HasProperty.js"); var IsCallable = __webpack_require__(/*! es-abstract/2020/IsCallable */ "./node_modules/es-abstract/2020/IsCallable.js"); var LengthOfArrayLike = __webpack_require__(/*! es-abstract/2020/LengthOfArrayLike */ "./node_modules/es-abstract/2020/LengthOfArrayLike.js"); var ToBoolean = __webpack_require__(/*! es-abstract/2020/ToBoolean */ "./node_modules/es-abstract/2020/ToBoolean.js"); var ToObject = __webpack_require__(/*! es-abstract/2020/ToObject */ "./node_modules/es-abstract/2020/ToObject.js"); var ToString = __webpack_require__(/*! es-abstract/2020/ToString */ "./node_modules/es-abstract/2020/ToString.js"); var callBound = __webpack_require__(/*! call-bind/callBound */ "./node_modules/call-bind/callBound.js"); var isString = __webpack_require__(/*! is-string */ "./node_modules/is-string/index.js"); // Check failure of by-index access of string characters (IE < 9) and failure of `0 in boxedString` (Rhino) var boxedString = Object('a'); var splitString = boxedString[0] !== 'a' || !(0 in boxedString); var strSplit = callBound('String.prototype.split'); module.exports = function filter(callbackfn) { var O = ToObject(this); var self = splitString && isString(O) ? strSplit(O, '') : O; var len = LengthOfArrayLike(self); // If no callback function or if callback is not a callable function if (!IsCallable(callbackfn)) { throw new TypeError('Array.prototype.filter callback must be a function'); } var thisArg; if (arguments.length > 1) { thisArg = arguments[1]; } var A = ArraySpeciesCreate(O, 0); var k = 0; var to = 0; while (k < len) { var Pk = ToString(k); var kPresent = HasProperty(O, Pk); if (kPresent) { var kValue = Get(O, Pk); var selected = ToBoolean(Call(callbackfn, thisArg, [kValue, k, O])); if (selected) { CreateDataPropertyOrThrow(A, ToString(to), kValue); to += 1; } } k += 1; } return A; }; /***/ }), /***/ "./node_modules/array.prototype.filter/index.js": /*!******************************************************!*\ !*** ./node_modules/array.prototype.filter/index.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js"); var RequireObjectCoercible = __webpack_require__(/*! es-abstract/2020/RequireObjectCoercible */ "./node_modules/es-abstract/2020/RequireObjectCoercible.js"); var callBound = __webpack_require__(/*! call-bind/callBound */ "./node_modules/call-bind/callBound.js"); var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/array.prototype.filter/implementation.js"); var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/array.prototype.filter/polyfill.js"); var polyfill = getPolyfill(); var shim = __webpack_require__(/*! ./shim */ "./node_modules/array.prototype.filter/shim.js"); var $slice = callBound('Array.prototype.slice'); // eslint-disable-next-line no-unused-vars var bound = function filter(array, callbackfn) { RequireObjectCoercible(array); return polyfill.apply(array, $slice(arguments, 1)); }; define(bound, { getPolyfill: getPolyfill, implementation: implementation, shim: shim }); module.exports = bound; /***/ }), /***/ "./node_modules/array.prototype.filter/polyfill.js": /*!*********************************************************!*\ !*** ./node_modules/array.prototype.filter/polyfill.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var arrayMethodBoxesProperly = __webpack_require__(/*! es-array-method-boxes-properly */ "./node_modules/es-array-method-boxes-properly/index.js"); var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/array.prototype.filter/implementation.js"); module.exports = function getPolyfill() { var method = Array.prototype.filter; return arrayMethodBoxesProperly(method) ? method : implementation; }; /***/ }), /***/ "./node_modules/array.prototype.filter/shim.js": /*!*****************************************************!*\ !*** ./node_modules/array.prototype.filter/shim.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js"); var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/array.prototype.filter/polyfill.js"); module.exports = function shimArrayPrototypeMap() { var polyfill = getPolyfill(); define(Array.prototype, { filter: polyfill }, { filter: function () { return Array.prototype.filter !== polyfill; } }); return polyfill; }; /***/ }), /***/ "./node_modules/available-typed-arrays/index.js": /*!******************************************************!*\ !*** ./node_modules/available-typed-arrays/index.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var filter = __webpack_require__(/*! array.prototype.filter */ "./node_modules/array.prototype.filter/index.js"); module.exports = function availableTypedArrays() { return filter(['BigInt64Array', 'BigUint64Array', 'Float32Array', 'Float64Array', 'Int16Array', 'Int32Array', 'Int8Array', 'Uint16Array', 'Uint32Array', 'Uint8Array', 'Uint8ClampedArray'], function (typedArray) { return typeof global[typedArray] === 'function'; }); }; /***/ }), /***/ "./node_modules/call-bind/callBound.js": /*!*********************************************!*\ !*** ./node_modules/call-bind/callBound.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var callBind = __webpack_require__(/*! ./ */ "./node_modules/call-bind/index.js"); var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); module.exports = function callBoundIntrinsic(name, allowMissing) { var intrinsic = GetIntrinsic(name, !!allowMissing); if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { return callBind(intrinsic); } return intrinsic; }; /***/ }), /***/ "./node_modules/call-bind/index.js": /*!*****************************************!*\ !*** ./node_modules/call-bind/index.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var bind = __webpack_require__(/*! function-bind */ "./node_modules/function-bind/index.js"); var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var $apply = GetIntrinsic('%Function.prototype.apply%'); var $call = GetIntrinsic('%Function.prototype.call%'); var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); var $max = GetIntrinsic('%Math.max%'); if ($defineProperty) { try { $defineProperty({}, 'a', { value: 1 }); } catch (e) { // IE 8 has a broken defineProperty $defineProperty = null; } } module.exports = function callBind(originalFunction) { var func = $reflectApply(bind, $call, arguments); if ($gOPD && $defineProperty) { var desc = $gOPD(func, 'length'); if (desc.configurable) { // original length, plus the receiver, minus any additional arguments (after the receiver) $defineProperty(func, 'length', { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }); } } return func; }; var applyBind = function applyBind() { return $reflectApply(bind, $apply, arguments); }; if ($defineProperty) { $defineProperty(module.exports, 'apply', { value: applyBind }); } else { module.exports.apply = applyBind; } /***/ }), /***/ "./node_modules/charenc/charenc.js": /*!*****************************************!*\ !*** ./node_modules/charenc/charenc.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports) { var charenc = { // UTF-8 encoding utf8: { // Convert a string to a byte array stringToBytes: function (str) { return charenc.bin.stringToBytes(unescape(encodeURIComponent(str))); }, // Convert a byte array to a string bytesToString: function (bytes) { return decodeURIComponent(escape(charenc.bin.bytesToString(bytes))); } }, // Binary encoding bin: { // Convert a string to a byte array stringToBytes: function (str) { for (var bytes = [], i = 0; i < str.length; i++) bytes.push(str.charCodeAt(i) & 0xFF); return bytes; }, // Convert a byte array to a string bytesToString: function (bytes) { for (var str = [], i = 0; i < bytes.length; i++) str.push(String.fromCharCode(bytes[i])); return str.join(''); } } }; module.exports = charenc; /***/ }), /***/ "./node_modules/crypt/crypt.js": /*!*************************************!*\ !*** ./node_modules/crypt/crypt.js ***! \*************************************/ /*! no static exports found */ /***/ (function(module, exports) { (function () { var base64map = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', crypt = { // Bit-wise rotation left rotl: function (n, b) { return n << b | n >>> 32 - b; }, // Bit-wise rotation right rotr: function (n, b) { return n << 32 - b | n >>> b; }, // Swap big-endian to little-endian and vice versa endian: function (n) { // If number given, swap endian if (n.constructor == Number) { return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00; } // Else, assume array and swap all items for (var i = 0; i < n.length; i++) n[i] = crypt.endian(n[i]); return n; }, // Generate an array of any length of random bytes randomBytes: function (n) { for (var bytes = []; n > 0; n--) bytes.push(Math.floor(Math.random() * 256)); return bytes; }, // Convert a byte array to big-endian 32-bit words bytesToWords: function (bytes) { for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8) words[b >>> 5] |= bytes[i] << 24 - b % 32; return words; }, // Convert big-endian 32-bit words to a byte array wordsToBytes: function (words) { for (var bytes = [], b = 0; b < words.length * 32; b += 8) bytes.push(words[b >>> 5] >>> 24 - b % 32 & 0xFF); return bytes; }, // Convert a byte array to a hex string bytesToHex: function (bytes) { for (var hex = [], i = 0; i < bytes.length; i++) { hex.push((bytes[i] >>> 4).toString(16)); hex.push((bytes[i] & 0xF).toString(16)); } return hex.join(''); }, // Convert a hex string to a byte array hexToBytes: function (hex) { for (var bytes = [], c = 0; c < hex.length; c += 2) bytes.push(parseInt(hex.substr(c, 2), 16)); return bytes; }, // Convert a byte array to a base-64 string bytesToBase64: function (bytes) { for (var base64 = [], i = 0; i < bytes.length; i += 3) { var triplet = bytes[i] << 16 | bytes[i + 1] << 8 | bytes[i + 2]; for (var j = 0; j < 4; j++) if (i * 8 + j * 6 <= bytes.length * 8) base64.push(base64map.charAt(triplet >>> 6 * (3 - j) & 0x3F));else base64.push('='); } return base64.join(''); }, // Convert a base-64 string to a byte array base64ToBytes: function (base64) { // Remove non-base-64 characters base64 = base64.replace(/[^A-Z0-9+\/]/ig, ''); for (var bytes = [], i = 0, imod4 = 0; i < base64.length; imod4 = ++i % 4) { if (imod4 == 0) continue; bytes.push((base64map.indexOf(base64.charAt(i - 1)) & Math.pow(2, -2 * imod4 + 8) - 1) << imod4 * 2 | base64map.indexOf(base64.charAt(i)) >>> 6 - imod4 * 2); } return bytes; } }; module.exports = crypt; })(); /***/ }), /***/ "./node_modules/csv-parse/lib/ResizeableBuffer.js": /*!********************************************************!*\ !*** ./node_modules/csv-parse/lib/ResizeableBuffer.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { class ResizeableBuffer { constructor(size = 100) { this.size = size; this.length = 0; this.buf = Buffer.alloc(size); } prepend(val) { const length = this.length++; if (length === this.size) { this.resize(); } const buf = this.clone(); this.buf[0] = val; buf.copy(this.buf, 1, 0, length); } append(val) { const length = this.length++; if (length === this.size) { this.resize(); } this.buf[length] = val; } clone() { return Buffer.from(this.buf.slice(0, this.length)); } resize() { const length = this.length; this.size = this.size * 2; const buf = Buffer.alloc(this.size); this.buf.copy(buf, 0, 0, length); this.buf = buf; } toString() { return this.buf.slice(0, this.length).toString(); } toJSON() { return this.toString(); } reset() { this.length = 0; } } module.exports = ResizeableBuffer; /***/ }), /***/ "./node_modules/csv-parse/lib/index.js": /*!*********************************************!*\ !*** ./node_modules/csv-parse/lib/index.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /* CSV Parse Please look at the [project documentation](https://csv.js.org/parse/) for additional information. */ const _require = __webpack_require__(/*! stream */ "stream"), Transform = _require.Transform; const ResizeableBuffer = __webpack_require__(/*! ./ResizeableBuffer */ "./node_modules/csv-parse/lib/ResizeableBuffer.js"); const tab = 9; const nl = 10; const np = 12; const cr = 13; const space = 32; const bom_utf8 = Buffer.from([239, 187, 191]); class Parser extends Transform { constructor(opts = {}) { super(_objectSpread(_objectSpread({}, { readableObjectMode: true }), opts)); const options = {}; // Merge with user options for (let opt in opts) { options[underscore(opt)] = opts[opt]; } // Normalize option `bom` if (options.bom === undefined || options.bom === null || options.bom === false) { options.bom = false; } else if (options.bom !== true) { throw new CsvError('CSV_INVALID_OPTION_BOM', ['Invalid option bom:', 'bom must be true,', `got ${JSON.stringify(options.bom)}`]); } // Normalize option `cast` let fnCastField = null; if (options.cast === undefined || options.cast === null || options.cast === false || options.cast === '') { options.cast = undefined; } else if (typeof options.cast === 'function') { fnCastField = options.cast; options.cast = true; } else if (options.cast !== true) { throw new CsvError('CSV_INVALID_OPTION_CAST', ['Invalid option cast:', 'cast must be true or a function,', `got ${JSON.stringify(options.cast)}`]); } // Normalize option `cast_date` if (options.cast_date === undefined || options.cast_date === null || options.cast_date === false || options.cast_date === '') { options.cast_date = false; } else if (options.cast_date === true) { options.cast_date = function (value) { const date = Date.parse(value); return !isNaN(date) ? new Date(date) : value; }; } else if (typeof options.cast_date !== 'function') { throw new CsvError('CSV_INVALID_OPTION_CAST_DATE', ['Invalid option cast_date:', 'cast_date must be true or a function,', `got ${JSON.stringify(options.cast_date)}`]); } // Normalize option `columns` let fnFirstLineToHeaders = null; if (options.columns === true) { // Fields in the first line are converted as-is to columns fnFirstLineToHeaders = undefined; } else if (typeof options.columns === 'function') { fnFirstLineToHeaders = options.columns; options.columns = true; } else if (Array.isArray(options.columns)) { options.columns = normalizeColumnsArray(options.columns); } else if (options.columns === undefined || options.columns === null || options.columns === false) { options.columns = false; } else { throw new CsvError('CSV_INVALID_OPTION_COLUMNS', ['Invalid option columns:', 'expect an object, a function or true,', `got ${JSON.stringify(options.columns)}`]); } // Normalize option `columns_duplicates_to_array` if (options.columns_duplicates_to_array === undefined || options.columns_duplicates_to_array === null || options.columns_duplicates_to_array === false) { options.columns_duplicates_to_array = false; } else if (options.columns_duplicates_to_array !== true) { throw new CsvError('CSV_INVALID_OPTION_COLUMNS_DUPLICATES_TO_ARRAY', ['Invalid option columns_duplicates_to_array:', 'expect an boolean,', `got ${JSON.stringify(options.columns_duplicates_to_array)}`]); } // Normalize option `comment` if (options.comment === undefined || options.comment === null || options.comment === false || options.comment === '') { options.comment = null; } else { if (typeof options.comment === 'string') { options.comment = Buffer.from(options.comment); } if (!Buffer.isBuffer(options.comment)) { throw new CsvError('CSV_INVALID_OPTION_COMMENT', ['Invalid option comment:', 'comment must be a buffer or a string,', `got ${JSON.stringify(options.comment)}`]); } } // Normalize option `delimiter` const delimiter_json = JSON.stringify(options.delimiter); if (!Array.isArray(options.delimiter)) options.delimiter = [options.delimiter]; if (options.delimiter.length === 0) { throw new CsvError('CSV_INVALID_OPTION_DELIMITER', ['Invalid option delimiter:', 'delimiter must be a non empty string or buffer or array of string|buffer,', `got ${delimiter_json}`]); } options.delimiter = options.delimiter.map(function (delimiter) { if (delimiter === undefined || delimiter === null || delimiter === false) { return Buffer.from(','); } if (typeof delimiter === 'string') { delimiter = Buffer.from(delimiter); } if (!Buffer.isBuffer(delimiter) || delimiter.length === 0) { throw new CsvError('CSV_INVALID_OPTION_DELIMITER', ['Invalid option delimiter:', 'delimiter must be a non empty string or buffer or array of string|buffer,', `got ${delimiter_json}`]); } return delimiter; }); // Normalize option `escape` if (options.escape === undefined || options.escape === null) { options.escape = Buffer.from('"'); } else if (typeof options.escape === 'string') { options.escape = Buffer.from(options.escape); } if (!Buffer.isBuffer(options.escape)) { throw new Error(`Invalid Option: escape must be a buffer or a string, got ${JSON.stringify(options.escape)}`); } else if (options.escape.length !== 1) { throw new Error(`Invalid Option Length: escape must be one character, got ${options.escape.length}`); } else { options.escape = options.escape[0]; } // Normalize option `from` if (options.from === undefined || options.from === null) { options.from = 1; } else { if (typeof options.from === 'string' && /\d+/.test(options.from)) { options.from = parseInt(options.from); } if (Number.isInteger(options.from)) { if (options.from < 0) { throw new Error(`Invalid Option: from must be a positive integer, got ${JSON.stringify(opts.from)}`); } } else { throw new Error(`Invalid Option: from must be an integer, got ${JSON.stringify(options.from)}`); } } // Normalize option `from_line` if (options.from_line === undefined || options.from_line === null) { options.from_line = 1; } else { if (typeof options.from_line === 'string' && /\d+/.test(options.from_line)) { options.from_line = parseInt(options.from_line); } if (Number.isInteger(options.from_line)) { if (options.from_line <= 0) { throw new Error(`Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify(opts.from_line)}`); } } else { throw new Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify(opts.from_line)}`); } } // Normalize option `info` if (options.info === undefined || options.info === null || options.info === false) { options.info = false; } else if (options.info !== true) { throw new Error(`Invalid Option: info must be true, got ${JSON.stringify(options.info)}`); } // Normalize option `max_record_size` if (options.max_record_size === undefined || options.max_record_size === null || options.max_record_size === false) { options.max_record_size = 0; } else if (Number.isInteger(options.max_record_size) && options.max_record_size >= 0) {// Great, nothing to do } else if (typeof options.max_record_size === 'string' && /\d+/.test(options.max_record_size)) { options.max_record_size = parseInt(options.max_record_size); } else { throw new Error(`Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(options.max_record_size)}`); } // Normalize option `objname` if (options.objname === undefined || options.objname === null || options.objname === false) { options.objname = undefined; } else if (Buffer.isBuffer(options.objname)) { if (options.objname.length === 0) { throw new Error(`Invalid Option: objname must be a non empty buffer`); } options.objname = options.objname.toString(); } else if (typeof options.objname === 'string') { if (options.objname.length === 0) { throw new Error(`Invalid Option: objname must be a non empty string`); } // Great, nothing to do } else { throw new Error(`Invalid Option: objname must be a string or a buffer, got ${options.objname}`); } // Normalize option `on_record` if (options.on_record === undefined || options.on_record === null) { options.on_record = undefined; } else if (typeof options.on_record !== 'function') { throw new CsvError('CSV_INVALID_OPTION_ON_RECORD', ['Invalid option `on_record`:', 'expect a function,', `got ${JSON.stringify(options.on_record)}`]); } // Normalize option `quote` if (options.quote === null || options.quote === false || options.quote === '') { options.quote = null; } else { if (options.quote === undefined || options.quote === true) { options.quote = Buffer.from('"'); } else if (typeof options.quote === 'string') { options.quote = Buffer.from(options.quote); } if (!Buffer.isBuffer(options.quote)) { throw new Error(`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(options.quote)}`); } else if (options.quote.length !== 1) { throw new Error(`Invalid Option Length: quote must be one character, got ${options.quote.length}`); } else { options.quote = options.quote[0]; } } // Normalize option `raw` if (options.raw === undefined || options.raw === null || options.raw === false) { options.raw = false; } else if (options.raw !== true) { throw new Error(`Invalid Option: raw must be true, got ${JSON.stringify(options.raw)}`); } // Normalize option `record_delimiter` if (!options.record_delimiter) { options.record_delimiter = []; } else if (!Array.isArray(options.record_delimiter)) { options.record_delimiter = [options.record_delimiter]; } options.record_delimiter = options.record_delimiter.map(function (rd) { if (typeof rd === 'string') { rd = Buffer.from(rd); } return rd; }); // Normalize option `relax` if (typeof options.relax === 'boolean') {// Great, nothing to do } else if (options.relax === undefined || options.relax === null) { options.relax = false; } else { throw new Error(`Invalid Option: relax must be a boolean, got ${JSON.stringify(options.relax)}`); } // Normalize option `relax_column_count` if (typeof options.relax_column_count === 'boolean') {// Great, nothing to do } else if (options.relax_column_count === undefined || options.relax_column_count === null) { options.relax_column_count = false; } else { throw new Error(`Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(options.relax_column_count)}`); } if (typeof options.relax_column_count_less === 'boolean') {// Great, nothing to do } else if (options.relax_column_count_less === undefined || options.relax_column_count_less === null) { options.relax_column_count_less = false; } else { throw new Error(`Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(options.relax_column_count_less)}`); } if (typeof options.relax_column_count_more === 'boolean') {// Great, nothing to do } else if (options.relax_column_count_more === undefined || options.relax_column_count_more === null) { options.relax_column_count_more = false; } else { throw new Error(`Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(options.relax_column_count_more)}`); } // Normalize option `skip_empty_lines` if (typeof options.skip_empty_lines === 'boolean') {// Great, nothing to do } else if (options.skip_empty_lines === undefined || options.skip_empty_lines === null) { options.skip_empty_lines = false; } else { throw new Error(`Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(options.skip_empty_lines)}`); } // Normalize option `skip_lines_with_empty_values` if (typeof options.skip_lines_with_empty_values === 'boolean') {// Great, nothing to do } else if (options.skip_lines_with_empty_values === undefined || options.skip_lines_with_empty_values === null) { options.skip_lines_with_empty_values = false; } else { throw new Error(`Invalid Option: skip_lines_with_empty_values must be a boolean, got ${JSON.stringify(options.skip_lines_with_empty_values)}`); } // Normalize option `skip_lines_with_error` if (typeof options.skip_lines_with_error === 'boolean') {// Great, nothing to do } else if (options.skip_lines_with_error === undefined || options.skip_lines_with_error === null) { options.skip_lines_with_error = false; } else { throw new Error(`Invalid Option: skip_lines_with_error must be a boolean, got ${JSON.stringify(options.skip_lines_with_error)}`); } // Normalize option `rtrim` if (options.rtrim === undefined || options.rtrim === null || options.rtrim === false) { options.rtrim = false; } else if (options.rtrim !== true) { throw new Error(`Invalid Option: rtrim must be a boolean, got ${JSON.stringify(options.rtrim)}`); } // Normalize option `ltrim` if (options.ltrim === undefined || options.ltrim === null || options.ltrim === false) { options.ltrim = false; } else if (options.ltrim !== true) { throw new Error(`Invalid Option: ltrim must be a boolean, got ${JSON.stringify(options.ltrim)}`); } // Normalize option `trim` if (options.trim === undefined || options.trim === null || options.trim === false) { options.trim = false; } else if (options.trim !== true) { throw new Error(`Invalid Option: trim must be a boolean, got ${JSON.stringify(options.trim)}`); } // Normalize options `trim`, `ltrim` and `rtrim` if (options.trim === true && opts.ltrim !== false) { options.ltrim = true; } else if (options.ltrim !== true) { options.ltrim = false; } if (options.trim === true && opts.rtrim !== false) { options.rtrim = true; } else if (options.rtrim !== true) { options.rtrim = false; } // Normalize option `to` if (options.to === undefined || options.to === null) { options.to = -1; } else { if (typeof options.to === 'string' && /\d+/.test(options.to)) { options.to = parseInt(options.to); } if (Number.isInteger(options.to)) { if (options.to <= 0) { throw new Error(`Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify(opts.to)}`); } } else { throw new Error(`Invalid Option: to must be an integer, got ${JSON.stringify(opts.to)}`); } } // Normalize option `to_line` if (options.to_line === undefined || options.to_line === null) { options.to_line = -1; } else { if (typeof options.to_line === 'string' && /\d+/.test(options.to_line)) { options.to_line = parseInt(options.to_line); } if (Number.isInteger(options.to_line)) { if (options.to_line <= 0) { throw new Error(`Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify(opts.to_line)}`); } } else { throw new Error(`Invalid Option: to_line must be an integer, got ${JSON.stringify(opts.to_line)}`); } } this.info = { comment_lines: 0, empty_lines: 0, invalid_field_length: 0, lines: 1, records: 0 }; this.options = options; this.state = { bomSkipped: false, castField: fnCastField, commenting: false, enabled: options.from_line === 1, escaping: false, escapeIsQuote: options.escape === options.quote, expectedRecordLength: options.columns === null ? 0 : options.columns.length, field: new ResizeableBuffer(20), firstLineToHeaders: fnFirstLineToHeaders, info: Object.assign({}, this.info), previousBuf: undefined, quoting: false, stop: false, rawBuffer: new ResizeableBuffer(100), record: [], recordHasError: false, record_length: 0, recordDelimiterMaxLength: options.record_delimiter.length === 0 ? 2 : Math.max(...options.record_delimiter.map(v => v.length)), trimChars: [Buffer.from(' ')[0], Buffer.from('\t')[0]], wasQuoting: false, wasRowDelimiter: false }; } // Implementation of `Transform._transform` _transform(buf, encoding, callback) { if (this.state.stop === true) { return; } const err = this.__parse(buf, false); if (err !== undefined) { this.state.stop = true; } callback(err); } // Implementation of `Transform._flush` _flush(callback) { if (this.state.stop === true) { return; } const err = this.__parse(undefined, true); callback(err); } // Central parser implementation __parse(nextBuf, end) { const _this$options = this.options, bom = _this$options.bom, comment = _this$options.comment, escape = _this$options.escape, from_line = _this$options.from_line, info = _this$options.info, ltrim = _this$options.ltrim, max_record_size = _this$options.max_record_size, quote = _this$options.quote, raw = _this$options.raw, relax = _this$options.relax, rtrim = _this$options.rtrim, skip_empty_lines = _this$options.skip_empty_lines, to = _this$options.to, to_line = _this$options.to_line; let record_delimiter = this.options.record_delimiter; const _this$state = this.state, bomSkipped = _this$state.bomSkipped, previousBuf = _this$state.previousBuf, rawBuffer = _this$state.rawBuffer, escapeIsQuote = _this$state.escapeIsQuote; let buf; if (previousBuf === undefined) { if (nextBuf === undefined) { // Handle empty string this.push(null); return; } else { buf = nextBuf; } } else if (previousBuf !== undefined && nextBuf === undefined) { buf = previousBuf; } else { buf = Buffer.concat([previousBuf, nextBuf]); } // Handle UTF BOM if (bomSkipped === false) { if (bom === false) { this.state.bomSkipped = true; } else if (buf.length < 3) { // No enough data if (end === false) { // Wait for more data this.state.previousBuf = buf; return; } // skip BOM detect because data length < 3 } else { if (bom_utf8.compare(buf, 0, 3) === 0) { // Skip BOM buf = buf.slice(3); } this.state.bomSkipped = true; } } const bufLen = buf.length; let pos; for (pos = 0; pos < bufLen; pos++) { // Ensure we get enough space to look ahead // There should be a way to move this out of the loop if (this.__needMoreData(pos, bufLen, end)) { break; } if (this.state.wasRowDelimiter === true) { this.info.lines++; if (info === true && this.state.record.length === 0 && this.state.field.length === 0 && this.state.wasQuoting === false) { this.state.info = Object.assign({}, this.info); } this.state.wasRowDelimiter = false; } if (to_line !== -1 && this.info.lines > to_line) { this.state.stop = true; this.push(null); return; } // Auto discovery of record_delimiter, unix, mac and windows supported if (this.state.quoting === false && record_delimiter.length === 0) { const record_delimiterCount = this.__autoDiscoverRowDelimiter(buf, pos); if (record_delimiterCount) { record_delimiter = this.options.record_delimiter; } } const chr = buf[pos]; if (raw === true) { rawBuffer.append(chr); } if ((chr === cr || chr === nl) && this.state.wasRowDelimiter === false) { this.state.wasRowDelimiter = true; } // Previous char was a valid escape char // treat the current char as a regular char if (this.state.escaping === true) { this.state.escaping = false; } else { // Escape is only active inside quoted fields // We are quoting, the char is an escape chr and there is a chr to escape if (this.state.quoting === true && chr === escape && pos + 1 < bufLen) { if (escapeIsQuote) { if (buf[pos + 1] === quote) { this.state.escaping = true; continue; } } else { this.state.escaping = true; continue; } } // Not currently escaping and chr is a quote // TODO: need to compare bytes instead of single char if (this.state.commenting === false && chr === quote) { if (this.state.quoting === true) { const nextChr = buf[pos + 1]; const isNextChrTrimable = rtrim && this.__isCharTrimable(nextChr); // const isNextChrComment = nextChr === comment const isNextChrComment = comment !== null && this.__compareBytes(comment, buf, pos + 1, nextChr); const isNextChrDelimiter = this.__isDelimiter(nextChr, buf, pos + 1); const isNextChrRowDelimiter = record_delimiter.length === 0 ? this.__autoDiscoverRowDelimiter(buf, pos + 1) : this.__isRecordDelimiter(nextChr, buf, pos + 1); // Escape a quote // Treat next char as a regular character // TODO: need to compare bytes instead of single char if (chr === escape && nextChr === quote) { pos++; } else if (!nextChr || isNextChrDelimiter || isNextChrRowDelimiter || isNextChrComment || isNextChrTrimable) { this.state.quoting = false; this.state.wasQuoting = true; continue; } else if (relax === false) { const err = this.__error(new CsvError('CSV_INVALID_CLOSING_QUOTE', ['Invalid Closing Quote:', `got "${String.fromCharCode(nextChr)}"`, `at line ${this.info.lines}`, 'instead of delimiter, row delimiter, trimable character', '(if activated) or comment'], this.__context())); if (err !== undefined) return err; } else { this.state.quoting = false; this.state.wasQuoting = true; // continue this.state.field.prepend(quote); } } else { if (this.state.field.length !== 0) { // In relax mode, treat opening quote preceded by chrs as regular if (relax === false) { const err = this.__error(new CsvError('INVALID_OPENING_QUOTE', ['Invalid Opening Quote:', `a quote is found inside a field at line ${this.info.lines}`], this.__context(), { field: this.state.field })); if (err !== undefined) return err; } } else { this.state.quoting = true; continue; } } } if (this.state.quoting === false) { let recordDelimiterLength = this.__isRecordDelimiter(chr, buf, pos); if (recordDelimiterLength !== 0) { // Do not emit comments which take a full line const skipCommentLine = this.state.commenting && this.state.wasQuoting === false && this.state.record.length === 0 && this.state.field.length === 0; if (skipCommentLine) { this.info.comment_lines++; // Skip full comment line } else { // Skip if line is empty and skip_empty_lines activated if (skip_empty_lines === true && this.state.wasQuoting === false && this.state.record.length === 0 && this.state.field.length === 0) { this.info.empty_lines++; pos += recordDelimiterLength - 1; continue; } // Activate records emition if above from_line if (this.state.enabled === false && this.info.lines + (this.state.wasRowDelimiter === true ? 1 : 0) >= from_line) { this.state.enabled = true; this.__resetField(); this.__resetRow(); pos += recordDelimiterLength - 1; continue; } else { const errField = this.__onField(); if (errField !== undefined) return errField; const errRecord = this.__onRow(); if (errRecord !== undefined) return errRecord; } if (to !== -1 && this.info.records >= to) { this.state.stop = true; this.push(null); return; } } this.state.commenting = false; pos += recordDelimiterLength - 1; continue; } if (this.state.commenting) { continue; } const commentCount = comment === null ? 0 : this.__compareBytes(comment, buf, pos, chr); if (commentCount !== 0) { this.state.commenting = true; continue; } let delimiterLength = this.__isDelimiter(chr, buf, pos); if (delimiterLength !== 0) { const errField = this.__onField(); if (errField !== undefined) return errField; pos += delimiterLength - 1; continue; } } } if (this.state.commenting === false) { if (max_record_size !== 0 && this.state.record_length + this.state.field.length > max_record_size) { const err = this.__error(new CsvError('CSV_MAX_RECORD_SIZE', ['Max Record Size:', 'record exceed the maximum number of tolerated bytes', `of ${max_record_size}`, `at line ${this.info.lines}`], this.__context())); if (err !== undefined) return err; } } const lappend = ltrim === false || this.state.quoting === true || this.state.field.length !== 0 || !this.__isCharTrimable(chr); // rtrim in non quoting is handle in __onField const rappend = rtrim === false || this.state.wasQuoting === false; if (lappend === true && rappend === true) { this.state.field.append(chr); } else if (rtrim === true && !this.__isCharTrimable(chr)) { const err = this.__error(new CsvError('CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE', ['Invalid Closing Quote:', 'found non trimable byte after quote', `at line ${this.info.lines}`], this.__context())); if (err !== undefined) return err; } } if (end === true) { // Ensure we are not ending in a quoting state if (this.state.quoting === true) { const err = this.__error(new CsvError('CSV_QUOTE_NOT_CLOSED', ['Quote Not Closed:', `the parsing is finished with an opening quote at line ${this.info.lines}`], this.__context())); if (err !== undefined) return err; } else { // Skip last line if it has no characters if (this.state.wasQuoting === true || this.state.record.length !== 0 || this.state.field.length !== 0) { const errField = this.__onField(); if (errField !== undefined) return errField; const errRecord = this.__onRow(); if (errRecord !== undefined) return errRecord; } else if (this.state.wasRowDelimiter === true) { this.info.empty_lines++; } else if (this.state.commenting === true) { this.info.comment_lines++; } } } else { this.state.previousBuf = buf.slice(pos); } if (this.state.wasRowDelimiter === true) { this.info.lines++; this.state.wasRowDelimiter = false; } } // Helper to test if a character is a space or a line delimiter __isCharTrimable(chr) { return chr === space || chr === tab || chr === cr || chr === nl || chr === np; } __onRow() { const _this$options2 = this.options, columns = _this$options2.columns, columns_duplicates_to_array = _this$options2.columns_duplicates_to_array, info = _this$options2.info, from = _this$options2.from, relax_column_count = _this$options2.relax_column_count, relax_column_count_less = _this$options2.relax_column_count_less, relax_column_count_more = _this$options2.relax_column_count_more, raw = _this$options2.raw, skip_lines_with_empty_values = _this$options2.skip_lines_with_empty_values; const _this$state2 = this.state, enabled = _this$state2.enabled, record = _this$state2.record; if (enabled === false) { return this.__resetRow(); } // Convert the first line into column names const recordLength = record.length; if (columns === true) { if (isRecordEmpty(record)) { this.__resetRow(); return; } return this.__firstLineToColumns(record); } if (columns === false && this.info.records === 0) { this.state.expectedRecordLength = recordLength; } if (recordLength !== this.state.expectedRecordLength) { if (relax_column_count === true || relax_column_count_less === true && recordLength < this.state.expectedRecordLength || relax_column_count_more === true && recordLength > this.state.expectedRecordLength) { this.info.invalid_field_length++; } else { if (columns === false) { const err = this.__error(new CsvError('CSV_INCONSISTENT_RECORD_LENGTH', ['Invalid Record Length:', `expect ${this.state.expectedRecordLength},`, `got ${recordLength} on line ${this.info.lines}`], this.__context(), { record: record })); if (err !== undefined) return err; } else { const err = this.__error( // CSV_INVALID_RECORD_LENGTH_DONT_MATCH_COLUMNS new CsvError('CSV_RECORD_DONT_MATCH_COLUMNS_LENGTH', ['Invalid Record Length:', `columns length is ${columns.length},`, // rename columns `got ${recordLength} on line ${this.info.lines}`], this.__context(), { record: record })); if (err !== undefined) return err; } } } if (skip_lines_with_empty_values === true) { if (isRecordEmpty(record)) { this.__resetRow(); return; } } if (this.state.recordHasError === true) { this.__resetRow(); this.state.recordHasError = false; return; } this.info.records++; if (from === 1 || this.info.records >= from) { if (columns !== false) { const obj = {}; // Transform record array to an object for (let i = 0, l = record.length; i < l; i++) { if (columns[i] === undefined || columns[i].disabled) continue; // obj[columns[i].name] = record[i] // Turn duplicate columns into an array if (columns_duplicates_to_array === true && obj[columns[i].name]) { if (Array.isArray(obj[columns[i].name])) { obj[columns[i].name] = obj[columns[i].name].concat(record[i]); } else { obj[columns[i].name] = [obj[columns[i].name], record[i]]; } } else { obj[columns[i].name] = record[i]; } } const objname = this.options.objname; if (objname === undefined) { if (raw === true || info === true) { const err = this.__push(Object.assign({ record: obj }, raw === true ? { raw: this.state.rawBuffer.toString() } : {}, info === true ? { info: this.state.info } : {})); if (err) { return err; } } else { const err = this.__push(obj); if (err) { return err; } } } else { if (raw === true || info === true) { const err = this.__push(Object.assign({ record: [obj[objname], obj] }, raw === true ? { raw: this.state.rawBuffer.toString() } : {}, info === true ? { info: this.state.info } : {})); if (err) { return err; } } else { const err = this.__push([obj[objname], obj]); if (err) { return err; } } } } else { if (raw === true || info === true) { const err = this.__push(Object.assign({ record: record }, raw === true ? { raw: this.state.rawBuffer.toString() } : {}, info === true ? { info: this.state.info } : {})); if (err) { return err; } } else { const err = this.__push(record); if (err) { return err; } } } } this.__resetRow(); } __firstLineToColumns(record) { const firstLineToHeaders = this.state.firstLineToHeaders; try { const headers = firstLineToHeaders === undefined ? record : firstLineToHeaders.call(null, record); if (!Array.isArray(headers)) { return this.__error(new CsvError('CSV_INVALID_COLUMN_MAPPING', ['Invalid Column Mapping:', 'expect an array from column function,', `got ${JSON.stringify(headers)}`], this.__context(), { headers: headers })); } const normalizedHeaders = normalizeColumnsArray(headers); this.state.expectedRecordLength = normalizedHeaders.length; this.options.columns = normalizedHeaders; this.__resetRow(); return; } catch (err) { return err; } } __resetRow() { if (this.options.raw === true) { this.state.rawBuffer.reset(); } this.state.record = []; this.state.record_length = 0; } __onField() { const _this$options3 = this.options, cast = _this$options3.cast, rtrim = _this$options3.rtrim, max_record_size = _this$options3.max_record_size; const _this$state3 = this.state, enabled = _this$state3.enabled, wasQuoting = _this$state3.wasQuoting; // Short circuit for the from_line options if (enabled === false) { /* this.options.columns !== true && */ return this.__resetField(); } let field = this.state.field.toString(); if (rtrim === true && wasQuoting === false) { field = field.trimRight(); } if (cast === true) { const _this$__cast = this.__cast(field), _this$__cast2 = _slicedToArray(_this$__cast, 2), err = _this$__cast2[0], f = _this$__cast2[1]; if (err !== undefined) return err; field = f; } this.state.record.push(field); // Increment record length if record size must not exceed a limit if (max_record_size !== 0 && typeof field === 'string') { this.state.record_length += field.length; } this.__resetField(); } __resetField() { this.state.field.reset(); this.state.wasQuoting = false; } __push(record) { const on_record = this.options.on_record; if (on_record !== undefined) { const context = this.__context(); try { record = on_record.call(null, record, context); } catch (err) { return err; } if (record === undefined || record === null) { return; } } this.push(record); } // Return a tuple with the error and the casted value __cast(field) { const _this$options4 = this.options, columns = _this$options4.columns, relax_column_count = _this$options4.relax_column_count; const isColumns = Array.isArray(columns); // Dont loose time calling cast // because the final record is an object // and this field can't be associated to a key present in columns if (isColumns === true && relax_column_count && this.options.columns.length <= this.state.record.length) { return [undefined, undefined]; } const context = this.__context(); if (this.state.castField !== null) { try { return [undefined, this.state.castField.call(null, field, context)]; } catch (err) { return [err]; } } if (this.__isFloat(field)) { return [undefined, parseFloat(field)]; } else if (this.options.cast_date !== false) { return [undefined, this.options.cast_date.call(null, field, context)]; } return [undefined, field]; } // Keep it in case we implement the `cast_int` option // __isInt(value){ // // return Number.isInteger(parseInt(value)) // // return !isNaN( parseInt( obj ) ); // return /^(\-|\+)?[1-9][0-9]*$/.test(value) // } __isFloat(value) { return value - parseFloat(value) + 1 >= 0; // Borrowed from jquery } __compareBytes(sourceBuf, targetBuf, pos, firtByte) { if (sourceBuf[0] !== firtByte) return 0; const sourceLength = sourceBuf.length; for (let i = 1; i < sourceLength; i++) { if (sourceBuf[i] !== targetBuf[pos + i]) return 0; } return sourceLength; } __needMoreData(i, bufLen, end) { if (end) { return false; } const _this$options5 = this.options, comment = _this$options5.comment, delimiter = _this$options5.delimiter; const _this$state4 = this.state, quoting = _this$state4.quoting, recordDelimiterMaxLength = _this$state4.recordDelimiterMaxLength; const numOfCharLeft = bufLen - i - 1; const requiredLength = Math.max( // Skip if the remaining buffer smaller than comment comment ? comment.length : 0, // Skip if the remaining buffer smaller than row delimiter recordDelimiterMaxLength, // Skip if the remaining buffer can be row delimiter following the closing quote // 1 is for quote.length quoting ? 1 + recordDelimiterMaxLength : 0, // Skip if the remaining buffer can be delimiter delimiter.length, // Skip if the remaining buffer can be escape sequence // 1 is for escape.length 1); return numOfCharLeft < requiredLength; } __isDelimiter(chr, buf, pos) { const delimiter = this.options.delimiter; loop1: for (let i = 0; i < delimiter.length; i++) { const del = delimiter[i]; if (del[0] === chr) { for (let j = 1; j < del.length; j++) { if (del[j] !== buf[pos + j]) continue loop1; } return del.length; } } return 0; } __isRecordDelimiter(chr, buf, pos) { const record_delimiter = this.options.record_delimiter; const recordDelimiterLength = record_delimiter.length; loop1: for (let i = 0; i < recordDelimiterLength; i++) { const rd = record_delimiter[i]; const rdLength = rd.length; if (rd[0] !== chr) { continue; } for (let j = 1; j < rdLength; j++) { if (rd[j] !== buf[pos + j]) { continue loop1; } } return rd.length; } return 0; } __autoDiscoverRowDelimiter(buf, pos) { const chr = buf[pos]; if (chr === cr) { if (buf[pos + 1] === nl) { this.options.record_delimiter.push(Buffer.from('\r\n')); this.state.recordDelimiterMaxLength = 2; return 2; } else { this.options.record_delimiter.push(Buffer.from('\r')); this.state.recordDelimiterMaxLength = 1; return 1; } } else if (chr === nl) { this.options.record_delimiter.push(Buffer.from('\n')); this.state.recordDelimiterMaxLength = 1; return 1; } return 0; } __error(msg) { const skip_lines_with_error = this.options.skip_lines_with_error; const err = typeof msg === 'string' ? new Error(msg) : msg; if (skip_lines_with_error) { this.state.recordHasError = true; this.emit('skip', err); return undefined; } else { return err; } } __context() { const columns = this.options.columns; const isColumns = Array.isArray(columns); return { column: isColumns === true ? columns.length > this.state.record.length ? columns[this.state.record.length].name : null : this.state.record.length, empty_lines: this.info.empty_lines, header: columns === true, index: this.state.record.length, invalid_field_length: this.info.invalid_field_length, quoting: this.state.wasQuoting, lines: this.info.lines, records: this.info.records }; } } const parse = function () { let data, options, callback; for (let i in arguments) { const argument = arguments[i]; const type = typeof argument; if (data === undefined && (typeof argument === 'string' || Buffer.isBuffer(argument))) { data = argument; } else if (options === undefined && isObject(argument)) { options = argument; } else if (callback === undefined && type === 'function') { callback = argument; } else { throw new CsvError('CSV_INVALID_ARGUMENT', ['Invalid argument:', `got ${JSON.stringify(argument)} at index ${i}`]); } } const parser = new Parser(options); if (callback) { const records = options === undefined || options.objname === undefined ? [] : {}; parser.on('readable', function () { let record; while ((record = this.read()) !== null) { if (options === undefined || options.objname === undefined) { records.push(record); } else { records[record[0]] = record[1]; } } }); parser.on('error', function (err) { callback(err, undefined, parser.info); }); parser.on('end', function () { callback(undefined, records, parser.info); }); } if (data !== undefined) { // Give a chance for events to be registered later if (typeof setImmediate === 'function') { setImmediate(function () { parser.write(data); parser.end(); }); } else { parser.write(data); parser.end(); } } return parser; }; class CsvError extends Error { constructor(code, message, ...contexts) { if (Array.isArray(message)) message = message.join(' '); super(message); if (Error.captureStackTrace !== undefined) { Error.captureStackTrace(this, CsvError); } this.code = code; for (const context of contexts) { for (const key in context) { const value = context[key]; this[key] = Buffer.isBuffer(value) ? value.toString() : value == null ? value : JSON.parse(JSON.stringify(value)); } } } } parse.Parser = Parser; parse.CsvError = CsvError; module.exports = parse; const underscore = function (str) { return str.replace(/([A-Z])/g, function (_, match) { return '_' + match.toLowerCase(); }); }; const isObject = function (obj) { return typeof obj === 'object' && obj !== null && !Array.isArray(obj); }; const isRecordEmpty = function (record) { return record.every(field => field == null || field.toString && field.toString().trim() === ''); }; const normalizeColumnsArray = function (columns) { const normalizedColumns = []; for (let i = 0, l = columns.length; i < l; i++) { const column = columns[i]; if (column === undefined || column === null || column === false) { normalizedColumns[i] = { disabled: true }; } else if (typeof column === 'string') { normalizedColumns[i] = { name: column }; } else if (isObject(column)) { if (typeof column.name !== 'string') { throw new CsvError('CSV_OPTION_COLUMNS_MISSING_NAME', ['Option columns missing name:', `property "name" is required at position ${i}`, 'when column is an object literal']); } normalizedColumns[i] = column; } else { throw new CsvError('CSV_INVALID_COLUMN_DEFINITION', ['Invalid column definition:', 'expect a string or a literal object,', `got ${JSON.stringify(column)} at position ${i}`]); } } return normalizedColumns; }; /***/ }), /***/ "./node_modules/csv-parse/lib/sync.js": /*!********************************************!*\ !*** ./node_modules/csv-parse/lib/sync.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { const parse = __webpack_require__(/*! . */ "./node_modules/csv-parse/lib/index.js"); module.exports = function (data, options = {}) { if (typeof data === 'string') { data = Buffer.from(data); } const records = options && options.objname ? {} : []; const parser = new parse.Parser(options); parser.push = function (record) { if (record === null) { return; } if (options.objname === undefined) records.push(record);else { records[record[0]] = record[1]; } }; const err1 = parser.__parse(data, false); if (err1 !== undefined) throw err1; const err2 = parser.__parse(undefined, true); if (err2 !== undefined) throw err2; return records; }; /***/ }), /***/ "./node_modules/csv-stringify/lib/index.js": /*!*************************************************!*\ !*** ./node_modules/csv-stringify/lib/index.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { const _excluded = ["value"]; function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } // Generated by CoffeeScript 2.4.1 // # CSV Stringifier // Please look at the [project documentation](https://csv.js.org/stringify/) for additional // information. var Stringifier, castPath, charCodeOfDot, get, getTag, isKey, isObject, isSymbol, reEscapeChar, reIsDeepProp, reIsPlainProp, rePropName, stream, stringToPath, toKey, underscore, util; stream = __webpack_require__(/*! stream */ "stream"); util = __webpack_require__(/*! util */ "util"); // ## Usage // This module export a function as its main entry point and return a transform // stream. // Refers to the [official prject documentation](http://csv.js.org/stringify/) // on how to call this function. module.exports = function () { var callback, chunks, data, options, stringifier; if (arguments.length === 3) { data = arguments[0]; options = arguments[1]; callback = arguments[2]; } else if (arguments.length === 2) { if (Array.isArray(arguments[0])) { data = arguments[0]; } else { options = arguments[0]; } if (typeof arguments[1] === 'function') { callback = arguments[1]; } else { options = arguments[1]; } } else if (arguments.length === 1) { if (typeof arguments[0] === 'function') { callback = arguments[0]; } else if (Array.isArray(arguments[0])) { data = arguments[0]; } else { options = arguments[0]; } } if (options == null) { options = {}; } stringifier = new Stringifier(options); if (data) { process.nextTick(function () { var d, j, len; for (j = 0, len = data.length; j < len; j++) { d = data[j]; stringifier.write(d); } return stringifier.end(); }); } if (callback) { chunks = []; stringifier.on('readable', function () { var chunk, results; results = []; while (chunk = stringifier.read()) { results.push(chunks.push(chunk)); } return results; }); stringifier.on('error', function (err) { return callback(err); }); stringifier.on('end', function () { return callback(null, chunks.join('')); }); } return stringifier; }; // You can also use *util.promisify* native function (Node.js 8+) in order to wrap callbacks into promises for more convenient use when source is a readable stream and you are OK with storing entire result set in memory: // ``` // const { promisify } = require('util'); // const csv = require('csv'); // const stringifyAsync = promisify(csv.stringify); // //returns promise // function generateCsv(sourceData) { // return stringifyAsync(sourceData); // } // ``` // ## `Stringifier([options])` // Options are documented [here](http://csv.adaltas.com/stringify/). Stringifier = class Stringifier extends stream.Transform { constructor(opts = {}) { var base, base1, base2, base3, base4, isRegExp, isString, j, k, len, options, quoted_match, ref, v; super(_objectSpread(_objectSpread({}, { writableObjectMode: true }), opts)); options = {}; for (k in opts) { v = opts[k]; // Immutable options and camelcase conversion options[underscore(k)] = v; } // Normalize option `delimiter` if (options.delimiter === null || options.delimiter === void 0) { options.delimiter = ','; } else { if (Buffer.isBuffer(options.delimiter)) { options.delimiter = options.delimiter.toString(); } else if (typeof options.delimiter !== 'string') { throw new Error(`Invalid Option: delimiter must be a buffer or a string, got ${JSON.stringify(options.delimiter)}`); } } // Normalize option `quote` if (options.quote === null || options.quote === void 0) { options.quote = '"'; } else { if (options.quote === true) { options.quote = '"'; } else if (options.quote === false) { options.quote = ''; } else if (Buffer.isBuffer(options.quote)) { options.quote = options.quote.toString(); } else if (typeof options.quote !== 'string') { throw new Error(`Invalid Option: quote must be a boolean, a buffer or a string, got ${JSON.stringify(options.quote)}`); } } // Normalize option `quoted` if (options.quoted == null) { options.quoted = false; } if (options.quoted_empty == null) { options.quoted_empty = void 0; } if (options.quoted_string == null) { options.quoted_string = false; } if (options.eof == null) { options.eof = true; } // Normalize option `escape` if (options.escape === null || options.escape === void 0) { options.escape = '"'; } else { if (Buffer.isBuffer(options.escape)) { options.escape = options.escape.toString(); } if (typeof options.escape !== 'string') { throw new Error(`Invalid Option: escape must be a buffer or a string, got ${JSON.stringify(options.escape)}`); } else if (options.escape.length > 1) { throw new Error(`Invalid Option: escape must be one character, got ${options.escape.length} characters`); } } if (options.header == null) { options.header = false; } // Normalize the columns option options.columns = this.normalize_columns(options.columns); if (options.cast == null) { options.cast = {}; } // Normalize option `quoted_match` if (options.quoted_match === void 0 || options.quoted_match === null || options.quoted_match === false) { options.quoted_match = null; } else if (!Array.isArray(options.quoted_match)) { options.quoted_match = [options.quoted_match]; } if (options.quoted_match) { ref = options.quoted_match; for (j = 0, len = ref.length; j < len; j++) { quoted_match = ref[j]; isString = typeof quoted_match === 'string'; isRegExp = quoted_match instanceof RegExp; if (!isString && !isRegExp) { throw new Error(`Invalid Option: quoted_match must be a string or a regex, got ${JSON.stringify(quoted_match)}`); } } } if (options.cast.bool) { // Backward compatibility options.cast.boolean = options.cast.bool; } // Custom cast if ((base = options.cast).boolean == null) { base.boolean = function (value) { // Cast boolean to string by default if (value) { return '1'; } else { return ''; } }; } if ((base1 = options.cast).date == null) { base1.date = function (value) { // Cast date to timestamp string by default return '' + value.getTime(); }; } if ((base2 = options.cast).number == null) { base2.number = function (value) { // Cast number to string using native casting by default return '' + value; }; } if ((base3 = options.cast).object == null) { base3.object = function (value) { // Stringify object as JSON by default return JSON.stringify(value); }; } if ((base4 = options.cast).string == null) { base4.string = function (value) { return value; }; } // Normalize option `record_delimiter` if (options.record_delimiter === void 0 || options.record_delimiter === null) { if (options.record_delimiter == null) { options.record_delimiter = '\n'; } } else { if (Buffer.isBuffer(options.record_delimiter)) { options.record_delimiter = options.record_delimiter.toString(); } else if (typeof options.record_delimiter !== 'string') { throw new Error(`Invalid Option: record_delimiter must be a buffer or a string, got ${JSON.stringify(options.record_delimiter)}`); } switch (options.record_delimiter) { case 'auto': options.record_delimiter = null; break; case 'unix': options.record_delimiter = "\n"; break; case 'mac': options.record_delimiter = "\r"; break; case 'windows': options.record_delimiter = "\r\n"; break; case 'ascii': options.record_delimiter = "\u001e"; break; case 'unicode': options.record_delimiter = "\u2028"; } } // Expose options this.options = options; // Internal state this.state = { stop: false }; // Information this.info = { records: 0 }; this; } // ## `Stringifier.prototype._transform(chunk, encoding, callback)` // Implementation of the [transform._transform function](https://nodejs.org/api/stream.html#stream_transform_transform_chunk_encoding_callback). _transform(chunk, encoding, callback) { var base, e; if (this.state.stop === true) { return; } // Chunk validation if (!(Array.isArray(chunk) || typeof chunk === 'object')) { this.state.stop = true; return callback(Error(`Invalid Record: expect an array or an object, got ${JSON.stringify(chunk)}`)); } // Detect columns from the first record if (this.info.records === 0) { if (Array.isArray(chunk)) { if (this.options.header === true && !this.options.columns) { this.state.stop = true; return callback(Error('Undiscoverable Columns: header option requires column option or object records')); } } else { if ((base = this.options).columns == null) { base.columns = this.normalize_columns(Object.keys(chunk)); } } } if (this.info.records === 0) { // Emit the header this.headers(); } try { // Emit and stringify the record if an object or an array this.emit('record', chunk, this.info.records); } catch (error) { e = error; this.state.stop = true; return this.emit('error', e); } // Convert the record into a string if (this.options.eof) { chunk = this.stringify(chunk); if (chunk == null) { return; } chunk = chunk + this.options.record_delimiter; } else { chunk = this.stringify(chunk); if (chunk == null) { return; } if (this.options.header || this.info.records) { chunk = this.options.record_delimiter + chunk; } } // Emit the csv this.info.records++; this.push(chunk); return callback(); } // ## `Stringifier.prototype._flush(callback)` // Implementation of the [transform._flush function](https://nodejs.org/api/stream.html#stream_transform_flush_callback). _flush(callback) { if (this.info.records === 0) { this.headers(); } return callback(); } // ## `Stringifier.prototype.stringify(line)` // Convert a line to a string. Line may be an object, an array or a string. stringify(chunk, chunkIsHeader = false) { var column, columns, containsEscape, containsQuote, containsRowDelimiter, containsdelimiter, csvrecord, delimiter, err, escape, field, header, i, j, l, len, m, options, quote, quoted, quotedMatch, quotedString, quoted_empty, quoted_match, quoted_string, record, record_delimiter, ref, ref1, regexp, shouldQuote, value; if (typeof chunk !== 'object') { return chunk; } var _this$options = this.options; columns = _this$options.columns; header = _this$options.header; record = []; // Record is an array if (Array.isArray(chunk)) { if (columns) { // We are getting an array but the user has specified output columns. In // this case, we respect the columns indexes chunk.splice(columns.length); } // Cast record elements for (i = j = 0, len = chunk.length; j < len; i = ++j) { field = chunk[i]; var _this$__cast = this.__cast(field, { index: i, column: i, records: this.info.records, header: chunkIsHeader }); var _this$__cast2 = _slicedToArray(_this$__cast, 2); err = _this$__cast2[0]; value = _this$__cast2[1]; if (err) { this.emit('error', err); return; } record[i] = [value, field]; } } else { // Record is a literal object if (columns) { for (i = l = 0, ref = columns.length; 0 <= ref ? l < ref : l > ref; i = 0 <= ref ? ++l : --l) { field = get(chunk, columns[i].key); var _this$__cast3 = this.__cast(field, { index: i, column: columns[i].key, records: this.info.records, header: chunkIsHeader }); var _this$__cast4 = _slicedToArray(_this$__cast3, 2); err = _this$__cast4[0]; value = _this$__cast4[1]; if (err) { this.emit('error', err); return; } record[i] = [value, field]; } } else { for (column in chunk) { field = chunk[column]; var _this$__cast5 = this.__cast(field, { index: i, column: columns[i].key, records: this.info.records, header: chunkIsHeader }); var _this$__cast6 = _slicedToArray(_this$__cast5, 2); err = _this$__cast6[0]; value = _this$__cast6[1]; if (err) { this.emit('error', err); return; } record.push([value, field]); } } } csvrecord = ''; for (i = m = 0, ref1 = record.length; 0 <= ref1 ? m < ref1 : m > ref1; i = 0 <= ref1 ? ++m : --m) { var _record$i = _slicedToArray(record[i], 2); value = _record$i[0]; field = _record$i[1]; if (typeof value === 'string') { options = this.options; } else if (isObject(value)) { var _value = value; value = _value.value; options = _objectWithoutProperties(_value, _excluded); if (!(typeof value === 'string' || value === void 0 || value === null)) { this.emit('error', Error(`Invalid Casting Value: returned value must return a string, null or undefined, got ${JSON.stringify(value)}`)); return; } options = _objectSpread(_objectSpread({}, this.options), options); } else if (value === void 0 || value === null) { options = this.options; } else { this.emit('error', Error(`Invalid Casting Value: returned value must return a string, an object, null or undefined, got ${JSON.stringify(value)}`)); return; } var _options = options; delimiter = _options.delimiter; escape = _options.escape; quote = _options.quote; quoted = _options.quoted; quoted_empty = _options.quoted_empty; quoted_string = _options.quoted_string; quoted_match = _options.quoted_match; record_delimiter = _options.record_delimiter; if (value) { if (typeof value !== 'string') { this.emit('error', Error(`Formatter must return a string, null or undefined, got ${JSON.stringify(value)}`)); return null; } containsdelimiter = delimiter.length && value.indexOf(delimiter) >= 0; containsQuote = quote !== '' && value.indexOf(quote) >= 0; containsEscape = value.indexOf(escape) >= 0 && escape !== quote; containsRowDelimiter = value.indexOf(record_delimiter) >= 0; quotedString = quoted_string && typeof field === 'string'; quotedMatch = quoted_match && typeof field === 'string' && quoted_match.filter(function (quoted_match) { if (typeof quoted_match === 'string') { return value.indexOf(quoted_match) !== -1; } else { return quoted_match.test(value); } }); quotedMatch = quotedMatch && quotedMatch.length > 0; shouldQuote = containsQuote === true || containsdelimiter || containsRowDelimiter || quoted || quotedString || quotedMatch; if (shouldQuote === true && containsEscape === true) { regexp = escape === '\\' ? new RegExp(escape + escape, 'g') : new RegExp(escape, 'g'); value = value.replace(regexp, escape + escape); } if (containsQuote === true) { regexp = new RegExp(quote, 'g'); value = value.replace(regexp, escape + quote); } if (shouldQuote === true) { value = quote + value + quote; } csvrecord += value; } else if (quoted_empty === true || quoted_empty == null && field === '' && quoted_string !== false) { csvrecord += quote + quote; } if (i !== record.length - 1) { csvrecord += delimiter; } } return csvrecord; } // ## `Stringifier.prototype.headers` // Print the header line if the option "header" is "true". headers() { var headers; if (!this.options.header) { return; } if (!this.options.columns) { return; } headers = this.options.columns.map(function (column) { return column.header; }); if (this.options.eof) { headers = this.stringify(headers, true) + this.options.record_delimiter; } else { headers = this.stringify(headers); } return this.push(headers); } __cast(value, context) { var err, type; type = typeof value; try { if (type === 'string') { // Fine for 99% of the cases return [void 0, this.options.cast.string(value, context)]; } else if (type === 'number') { return [void 0, this.options.cast.number(value, context)]; } else if (type === 'boolean') { return [void 0, this.options.cast.boolean(value, context)]; } else if (value instanceof Date) { return [void 0, this.options.cast.date(value, context)]; } else if (type === 'object' && value !== null) { return [void 0, this.options.cast.object(value, context)]; } else { return [void 0, value, value]; } } catch (error) { err = error; return [err]; } } // ## `Stringifier.prototype.normalize_columns` normalize_columns(columns) { var column, k, v; if (columns == null) { return null; } if (columns != null) { if (typeof columns !== 'object') { throw Error('Invalid option "columns": expect an array or an object'); } if (!Array.isArray(columns)) { columns = function () { var results; results = []; for (k in columns) { v = columns[k]; results.push({ key: k, header: v }); } return results; }(); } else { columns = function () { var j, len, results; results = []; for (j = 0, len = columns.length; j < len; j++) { column = columns[j]; if (typeof column === 'string') { results.push({ key: column, header: column }); } else if (typeof column === 'object' && column != null && !Array.isArray(column)) { if (!column.key) { throw Error('Invalid column definition: property "key" is required'); } if (column.header == null) { column.header = column.key; } results.push(column); } else { throw Error('Invalid column definition: expect a string or an object'); } } return results; }(); } } return columns; } }; module.exports.Stringifier = Stringifier; isObject = function (obj) { return typeof obj === 'object' && obj !== null && !Array.isArray(obj); }; underscore = function (str) { return str.replace(/([A-Z])/g, function (_, match, index) { return '_' + match.toLowerCase(); }); }; // ## Lodash implementation of `get` charCodeOfDot = '.'.charCodeAt(0); reEscapeChar = /\\(\\)?/g; // Match anything that isn't a dot or bracket. // Or match property names within brackets. // Match a non-string expression. // Or match strings (supports escaping characters). // Or match "" as the space between consecutive dots or empty brackets. rePropName = RegExp('[^.[\\]]+' + '|' + '\\[(?:' + '([^"\'][^[]*)' + '|' + '(["\'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2' + ')\\]' + '|' + '(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))', 'g'); reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; reIsPlainProp = /^\w*$/; getTag = function (value) { if (value != null) { if (value === void 0) { '[object Undefined]'; } else { '[object Null]'; } } return Object.prototype.toString.call(value); }; isKey = function (value, object) { var type; if (Array.isArray(value)) { return false; } type = typeof value; if (type === 'number' || type === 'symbol' || type === 'boolean' || value == null || isSymbol(value)) { return true; } return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object); }; isSymbol = function (value) { var type; type = typeof value; return type === 'symbol' || type === 'object' && value != null && getTag(value) === '[object Symbol]'; }; stringToPath = function (string) { var result; result = []; if (string.charCodeAt(0) === charCodeOfDot) { result.push(''); } string.replace(rePropName, function (match, expression, quote, subString) { var key; key = match; if (quote) { key = subString.replace(reEscapeChar, '$1'); } else if (expression) { key = expression.trim(); } return result.push(key); }); return result; }; castPath = function (value, object) { if (Array.isArray(value)) { return value; } else { if (isKey(value, object)) { return [value]; } else { return stringToPath(value); } } }; toKey = function (value) { var ref, result; if (typeof value === 'string' || isSymbol(value)) { return value; } result = `${value}`; return (ref = result === '0' && 1 / value === -INFINITY) != null ? ref : { '-0': result }; }; get = function (object, path) { var index, length; path = Array.isArray(path) ? path : castPath(path, object); index = 0; length = path.length; while (object != null && index < length) { object = object[toKey(path[index++])]; } if (index && index === length) { return object; } else { return void 0; } }; /***/ }), /***/ "./node_modules/csv-stringify/lib/sync.js": /*!************************************************!*\ !*** ./node_modules/csv-stringify/lib/sync.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { // Generated by CoffeeScript 2.4.1 // # CSV Stringify Sync // Provides a synchronous alternative to the CSV stringifier. // ## Usage // `const csv = stringify(records, [options]` var StringDecoder, stringify; var _require = __webpack_require__(/*! string_decoder */ "string_decoder"); StringDecoder = _require.StringDecoder; stringify = __webpack_require__(/*! ./index */ "./node_modules/csv-stringify/lib/index.js"); module.exports = function (records, options = {}) { var data, decoder, i, len, record, stringifier; data = []; if (records instanceof Buffer) { decoder = new StringDecoder(); records = decoder.write(records); } stringifier = new stringify.Stringifier(options); stringifier.push = function (record) { if (record) { return data.push(record.toString()); } }; for (i = 0, len = records.length; i < len; i++) { record = records[i]; stringifier.write(record); } stringifier.end(); return data.join(''); }; /***/ }), /***/ "./node_modules/currency-formatter/currencies.json": /*!*********************************************************!*\ !*** ./node_modules/currency-formatter/currencies.json ***! \*********************************************************/ /*! exports provided: AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTC, BTN, BWP, BYR, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRO, MTL, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDD, SDG, SEK, SGD, SHP, SLL, SOS, SRD, STD, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TVD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VEB, VEF, VND, VUV, WST, XAF, XCD, XBT, XOF, XPF, YER, ZAR, ZMW, WON, default */ /***/ (function(module) { module.exports = JSON.parse("{\"AED\":{\"code\":\"AED\",\"symbol\":\"د.إ.‏\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"AFN\":{\"code\":\"AFN\",\"symbol\":\"؋\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"ALL\":{\"code\":\"ALL\",\"symbol\":\"Lek\",\"thousandsSeparator\":\".\",\"decimalSeparator\":\",\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"AMD\":{\"code\":\"AMD\",\"symbol\":\"֏\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"ANG\":{\"code\":\"ANG\",\"symbol\":\"ƒ\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"AOA\":{\"code\":\"AOA\",\"symbol\":\"Kz\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"ARS\":{\"code\":\"ARS\",\"symbol\":\"$\",\"thousandsSeparator\":\".\",\"decimalSeparator\":\",\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"AUD\":{\"code\":\"AUD\",\"symbol\":\"$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"AWG\":{\"code\":\"AWG\",\"symbol\":\"ƒ\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"AZN\":{\"code\":\"AZN\",\"symbol\":\"₼\",\"thousandsSeparator\":\" \",\"decimalSeparator\":\",\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"BAM\":{\"code\":\"BAM\",\"symbol\":\"КМ\",\"thousandsSeparator\":\".\",\"decimalSeparator\":\",\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"BBD\":{\"code\":\"BBD\",\"symbol\":\"$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"BDT\":{\"code\":\"BDT\",\"symbol\":\"৳\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":0},\"BGN\":{\"code\":\"BGN\",\"symbol\":\"лв.\",\"thousandsSeparator\":\" \",\"decimalSeparator\":\",\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"BHD\":{\"code\":\"BHD\",\"symbol\":\"د.ب.‏\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":3},\"BIF\":{\"code\":\"BIF\",\"symbol\":\"FBu\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":0},\"BMD\":{\"code\":\"BMD\",\"symbol\":\"$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"BND\":{\"code\":\"BND\",\"symbol\":\"$\",\"thousandsSeparator\":\".\",\"decimalSeparator\":\",\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":0},\"BOB\":{\"code\":\"BOB\",\"symbol\":\"Bs\",\"thousandsSeparator\":\".\",\"decimalSeparator\":\",\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"BRL\":{\"code\":\"BRL\",\"symbol\":\"R$\",\"thousandsSeparator\":\".\",\"decimalSeparator\":\",\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"BSD\":{\"code\":\"BSD\",\"symbol\":\"$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"BTC\":{\"code\":\"BTC\",\"symbol\":\"Ƀ\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":8},\"BTN\":{\"code\":\"BTN\",\"symbol\":\"Nu.\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":1},\"BWP\":{\"code\":\"BWP\",\"symbol\":\"P\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"BYR\":{\"code\":\"BYR\",\"symbol\":\"р.\",\"thousandsSeparator\":\" \",\"decimalSeparator\":\",\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"BZD\":{\"code\":\"BZD\",\"symbol\":\"BZ$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"CAD\":{\"code\":\"CAD\",\"symbol\":\"$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"CDF\":{\"code\":\"CDF\",\"symbol\":\"FC\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"CHF\":{\"code\":\"CHF\",\"symbol\":\"CHF\",\"thousandsSeparator\":\"'\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"CLP\":{\"code\":\"CLP\",\"symbol\":\"$\",\"thousandsSeparator\":\".\",\"decimalSeparator\":\",\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"CNY\":{\"code\":\"CNY\",\"symbol\":\"¥\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"COP\":{\"code\":\"COP\",\"symbol\":\"$\",\"thousandsSeparator\":\".\",\"decimalSeparator\":\",\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"CRC\":{\"code\":\"CRC\",\"symbol\":\"₡\",\"thousandsSeparator\":\".\",\"decimalSeparator\":\",\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"CUC\":{\"code\":\"CUC\",\"symbol\":\"CUC\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"CUP\":{\"code\":\"CUP\",\"symbol\":\"$MN\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"CVE\":{\"code\":\"CVE\",\"symbol\":\"$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"CZK\":{\"code\":\"CZK\",\"symbol\":\"Kč\",\"thousandsSeparator\":\" \",\"decimalSeparator\":\",\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"DJF\":{\"code\":\"DJF\",\"symbol\":\"Fdj\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":0},\"DKK\":{\"code\":\"DKK\",\"symbol\":\"kr.\",\"thousandsSeparator\":\"\",\"decimalSeparator\":\",\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"DOP\":{\"code\":\"DOP\",\"symbol\":\"RD$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"DZD\":{\"code\":\"DZD\",\"symbol\":\"د.ج.‏\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"EGP\":{\"code\":\"EGP\",\"symbol\":\"ج.م.‏\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"ERN\":{\"code\":\"ERN\",\"symbol\":\"Nfk\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"ETB\":{\"code\":\"ETB\",\"symbol\":\"ETB\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"EUR\":{\"code\":\"EUR\",\"symbol\":\"€\",\"thousandsSeparator\":\" \",\"decimalSeparator\":\",\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"FJD\":{\"code\":\"FJD\",\"symbol\":\"$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"FKP\":{\"code\":\"FKP\",\"symbol\":\"£\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"GBP\":{\"code\":\"GBP\",\"symbol\":\"£\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"GEL\":{\"code\":\"GEL\",\"symbol\":\"Lari\",\"thousandsSeparator\":\" \",\"decimalSeparator\":\",\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"GHS\":{\"code\":\"GHS\",\"symbol\":\"₵\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"GIP\":{\"code\":\"GIP\",\"symbol\":\"£\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"GMD\":{\"code\":\"GMD\",\"symbol\":\"D\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"GNF\":{\"code\":\"GNF\",\"symbol\":\"FG\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":0},\"GTQ\":{\"code\":\"GTQ\",\"symbol\":\"Q\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"GYD\":{\"code\":\"GYD\",\"symbol\":\"$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"HKD\":{\"code\":\"HKD\",\"symbol\":\"HK$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"HNL\":{\"code\":\"HNL\",\"symbol\":\"L.\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"HRK\":{\"code\":\"HRK\",\"symbol\":\"kn\",\"thousandsSeparator\":\".\",\"decimalSeparator\":\",\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"HTG\":{\"code\":\"HTG\",\"symbol\":\"G\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"HUF\":{\"code\":\"HUF\",\"symbol\":\"Ft\",\"thousandsSeparator\":\" \",\"decimalSeparator\":\",\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"IDR\":{\"code\":\"IDR\",\"symbol\":\"Rp\",\"thousandsSeparator\":\".\",\"decimalSeparator\":\",\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":0},\"ILS\":{\"code\":\"ILS\",\"symbol\":\"₪\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"INR\":{\"code\":\"INR\",\"symbol\":\"₹\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"IQD\":{\"code\":\"IQD\",\"symbol\":\"د.ع.‏\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"IRR\":{\"code\":\"IRR\",\"symbol\":\"﷼\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\"/\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"ISK\":{\"code\":\"ISK\",\"symbol\":\"kr.\",\"thousandsSeparator\":\".\",\"decimalSeparator\":\",\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":0},\"JMD\":{\"code\":\"JMD\",\"symbol\":\"J$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"JOD\":{\"code\":\"JOD\",\"symbol\":\"د.ا.‏\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":3},\"JPY\":{\"code\":\"JPY\",\"symbol\":\"¥\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":0},\"KES\":{\"code\":\"KES\",\"symbol\":\"KSh\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"KGS\":{\"code\":\"KGS\",\"symbol\":\"сом\",\"thousandsSeparator\":\" \",\"decimalSeparator\":\"-\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"KHR\":{\"code\":\"KHR\",\"symbol\":\"៛\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":0},\"KMF\":{\"code\":\"KMF\",\"symbol\":\"CF\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"KPW\":{\"code\":\"KPW\",\"symbol\":\"₩\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":0},\"KRW\":{\"code\":\"KRW\",\"symbol\":\"₩\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":0},\"KWD\":{\"code\":\"KWD\",\"symbol\":\"د.ك.‏\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":3},\"KYD\":{\"code\":\"KYD\",\"symbol\":\"$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"KZT\":{\"code\":\"KZT\",\"symbol\":\"₸\",\"thousandsSeparator\":\" \",\"decimalSeparator\":\"-\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"LAK\":{\"code\":\"LAK\",\"symbol\":\"₭\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":0},\"LBP\":{\"code\":\"LBP\",\"symbol\":\"ل.ل.‏\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"LKR\":{\"code\":\"LKR\",\"symbol\":\"₨\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":0},\"LRD\":{\"code\":\"LRD\",\"symbol\":\"$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"LSL\":{\"code\":\"LSL\",\"symbol\":\"M\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"LYD\":{\"code\":\"LYD\",\"symbol\":\"د.ل.‏\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":3},\"MAD\":{\"code\":\"MAD\",\"symbol\":\"د.م.‏\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"MDL\":{\"code\":\"MDL\",\"symbol\":\"lei\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"MGA\":{\"code\":\"MGA\",\"symbol\":\"Ar\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":0},\"MKD\":{\"code\":\"MKD\",\"symbol\":\"ден.\",\"thousandsSeparator\":\".\",\"decimalSeparator\":\",\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"MMK\":{\"code\":\"MMK\",\"symbol\":\"K\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"MNT\":{\"code\":\"MNT\",\"symbol\":\"₮\",\"thousandsSeparator\":\" \",\"decimalSeparator\":\",\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"MOP\":{\"code\":\"MOP\",\"symbol\":\"MOP$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"MRO\":{\"code\":\"MRO\",\"symbol\":\"UM\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"MTL\":{\"code\":\"MTL\",\"symbol\":\"₤\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"MUR\":{\"code\":\"MUR\",\"symbol\":\"₨\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"MVR\":{\"code\":\"MVR\",\"symbol\":\"MVR\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":1},\"MWK\":{\"code\":\"MWK\",\"symbol\":\"MK\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"MXN\":{\"code\":\"MXN\",\"symbol\":\"$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"MYR\":{\"code\":\"MYR\",\"symbol\":\"RM\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"MZN\":{\"code\":\"MZN\",\"symbol\":\"MT\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":0},\"NAD\":{\"code\":\"NAD\",\"symbol\":\"$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"NGN\":{\"code\":\"NGN\",\"symbol\":\"₦\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"NIO\":{\"code\":\"NIO\",\"symbol\":\"C$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"NOK\":{\"code\":\"NOK\",\"symbol\":\"kr\",\"thousandsSeparator\":\" \",\"decimalSeparator\":\",\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"NPR\":{\"code\":\"NPR\",\"symbol\":\"₨\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"NZD\":{\"code\":\"NZD\",\"symbol\":\"$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"OMR\":{\"code\":\"OMR\",\"symbol\":\"﷼\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":3},\"PAB\":{\"code\":\"PAB\",\"symbol\":\"B/.\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"PEN\":{\"code\":\"PEN\",\"symbol\":\"S/.\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"PGK\":{\"code\":\"PGK\",\"symbol\":\"K\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"PHP\":{\"code\":\"PHP\",\"symbol\":\"₱\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"PKR\":{\"code\":\"PKR\",\"symbol\":\"₨\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"PLN\":{\"code\":\"PLN\",\"symbol\":\"zł\",\"thousandsSeparator\":\" \",\"decimalSeparator\":\",\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"PYG\":{\"code\":\"PYG\",\"symbol\":\"₲\",\"thousandsSeparator\":\".\",\"decimalSeparator\":\",\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"QAR\":{\"code\":\"QAR\",\"symbol\":\"﷼\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"RON\":{\"code\":\"RON\",\"symbol\":\"lei\",\"thousandsSeparator\":\".\",\"decimalSeparator\":\",\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"RSD\":{\"code\":\"RSD\",\"symbol\":\"Дин.\",\"thousandsSeparator\":\".\",\"decimalSeparator\":\",\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"RUB\":{\"code\":\"RUB\",\"symbol\":\"₽\",\"thousandsSeparator\":\" \",\"decimalSeparator\":\",\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"RWF\":{\"code\":\"RWF\",\"symbol\":\"RWF\",\"thousandsSeparator\":\" \",\"decimalSeparator\":\",\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"SAR\":{\"code\":\"SAR\",\"symbol\":\"﷼\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"SBD\":{\"code\":\"SBD\",\"symbol\":\"$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"SCR\":{\"code\":\"SCR\",\"symbol\":\"₨\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"SDD\":{\"code\":\"SDD\",\"symbol\":\"LSd\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"SDG\":{\"code\":\"SDG\",\"symbol\":\"£‏\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"SEK\":{\"code\":\"SEK\",\"symbol\":\"kr\",\"thousandsSeparator\":\".\",\"decimalSeparator\":\",\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"SGD\":{\"code\":\"SGD\",\"symbol\":\"$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"SHP\":{\"code\":\"SHP\",\"symbol\":\"£\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"SLL\":{\"code\":\"SLL\",\"symbol\":\"Le\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"SOS\":{\"code\":\"SOS\",\"symbol\":\"S\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"SRD\":{\"code\":\"SRD\",\"symbol\":\"$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"STD\":{\"code\":\"STD\",\"symbol\":\"Db\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"SVC\":{\"code\":\"SVC\",\"symbol\":\"₡\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"SYP\":{\"code\":\"SYP\",\"symbol\":\"£\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"SZL\":{\"code\":\"SZL\",\"symbol\":\"E\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"THB\":{\"code\":\"THB\",\"symbol\":\"฿\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"TJS\":{\"code\":\"TJS\",\"symbol\":\"TJS\",\"thousandsSeparator\":\" \",\"decimalSeparator\":\";\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"TMT\":{\"code\":\"TMT\",\"symbol\":\"m\",\"thousandsSeparator\":\" \",\"decimalSeparator\":\",\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":0},\"TND\":{\"code\":\"TND\",\"symbol\":\"د.ت.‏\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":3},\"TOP\":{\"code\":\"TOP\",\"symbol\":\"T$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"TRY\":{\"code\":\"TRY\",\"symbol\":\"₺\",\"thousandsSeparator\":\".\",\"decimalSeparator\":\",\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"TTD\":{\"code\":\"TTD\",\"symbol\":\"TT$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"TVD\":{\"code\":\"TVD\",\"symbol\":\"$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"TWD\":{\"code\":\"TWD\",\"symbol\":\"NT$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"TZS\":{\"code\":\"TZS\",\"symbol\":\"TSh\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"UAH\":{\"code\":\"UAH\",\"symbol\":\"₴\",\"thousandsSeparator\":\" \",\"decimalSeparator\":\",\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"UGX\":{\"code\":\"UGX\",\"symbol\":\"USh\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"USD\":{\"code\":\"USD\",\"symbol\":\"$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"UYU\":{\"code\":\"UYU\",\"symbol\":\"$U\",\"thousandsSeparator\":\".\",\"decimalSeparator\":\",\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"UZS\":{\"code\":\"UZS\",\"symbol\":\"сўм\",\"thousandsSeparator\":\" \",\"decimalSeparator\":\",\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"VEB\":{\"code\":\"VEB\",\"symbol\":\"Bs.\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"VEF\":{\"code\":\"VEF\",\"symbol\":\"Bs. F.\",\"thousandsSeparator\":\".\",\"decimalSeparator\":\",\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"VND\":{\"code\":\"VND\",\"symbol\":\"₫\",\"thousandsSeparator\":\".\",\"decimalSeparator\":\".\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":0},\"VUV\":{\"code\":\"VUV\",\"symbol\":\"VT\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":0},\"WST\":{\"code\":\"WST\",\"symbol\":\"WS$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"XAF\":{\"code\":\"XAF\",\"symbol\":\"F\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"XCD\":{\"code\":\"XCD\",\"symbol\":\"$\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"XBT\":{\"code\":\"XBT\",\"symbol\":\"Ƀ\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"XOF\":{\"code\":\"XOF\",\"symbol\":\"F\",\"thousandsSeparator\":\" \",\"decimalSeparator\":\",\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"XPF\":{\"code\":\"XPF\",\"symbol\":\"F\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"YER\":{\"code\":\"YER\",\"symbol\":\"﷼\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"ZAR\":{\"code\":\"ZAR\",\"symbol\":\"R\",\"thousandsSeparator\":\" \",\"decimalSeparator\":\",\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"ZMW\":{\"code\":\"ZMW\",\"symbol\":\"ZK\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"WON\":{\"code\":\"WON\",\"symbol\":\"₩\",\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2}}"); /***/ }), /***/ "./node_modules/currency-formatter/index.js": /*!**************************************************!*\ !*** ./node_modules/currency-formatter/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var accounting = __webpack_require__(/*! accounting */ "./node_modules/accounting/accounting.js"); var assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js"); var localeCurrency = __webpack_require__(/*! locale-currency */ "./node_modules/locale-currency/index.js"); var currencies = __webpack_require__(/*! ./currencies.json */ "./node_modules/currency-formatter/currencies.json"); var localeFormats = __webpack_require__(/*! ./localeFormats.json */ "./node_modules/currency-formatter/localeFormats.json"); var defaultCurrency = { symbol: '', thousandsSeparator: ',', decimalSeparator: '.', symbolOnLeft: true, spaceBetweenAmountAndSymbol: false, decimalDigits: 2 }; var defaultLocaleFormat = {}; var formatMapping = [{ symbolOnLeft: true, spaceBetweenAmountAndSymbol: false, format: { pos: '%s%v', neg: '-%s%v', zero: '%s%v' } }, { symbolOnLeft: true, spaceBetweenAmountAndSymbol: true, format: { pos: '%s %v', neg: '-%s %v', zero: '%s %v' } }, { symbolOnLeft: false, spaceBetweenAmountAndSymbol: false, format: { pos: '%v%s', neg: '-%v%s', zero: '%v%s' } }, { symbolOnLeft: false, spaceBetweenAmountAndSymbol: true, format: { pos: '%v %s', neg: '-%v %s', zero: '%v %s' } }]; function format(value, options) { var code = options.code || options.locale && localeCurrency.getCurrency(options.locale); var localeMatch = /^([a-z]+)([_-]([a-z]+))?$/i.exec(options.locale) || []; var language = localeMatch[1]; var region = localeMatch[3]; var localeFormat = assign({}, defaultLocaleFormat, localeFormats[language] || {}, localeFormats[language + '-' + region] || {}); var currency = assign({}, defaultCurrency, findCurrency(code), localeFormat); var symbolOnLeft = currency.symbolOnLeft; var spaceBetweenAmountAndSymbol = currency.spaceBetweenAmountAndSymbol; var format = formatMapping.filter(function (f) { return f.symbolOnLeft == symbolOnLeft && f.spaceBetweenAmountAndSymbol == spaceBetweenAmountAndSymbol; })[0].format; return accounting.formatMoney(value, { symbol: isUndefined(options.symbol) ? currency.symbol : options.symbol, decimal: isUndefined(options.decimal) ? currency.decimalSeparator : options.decimal, thousand: isUndefined(options.thousand) ? currency.thousandsSeparator : options.thousand, precision: typeof options.precision === 'number' ? options.precision : currency.decimalDigits, format: ['string', 'object'].indexOf(typeof options.format) > -1 ? options.format : format }); } function findCurrency(currencyCode) { return currencies[currencyCode]; } function isUndefined(val) { return typeof val === 'undefined'; } function unformat(value, options) { var code = options.code || options.locale && localeCurrency.getCurrency(options.locale); var localeFormat = localeFormats[options.locale] || defaultLocaleFormat; var currency = assign({}, defaultCurrency, findCurrency(code), localeFormat); var decimal = isUndefined(options.decimal) ? currency.decimalSeparator : options.decimal; return accounting.unformat(value, decimal); } module.exports = { defaultCurrency: defaultCurrency, get currencies() { // In favor of backwards compatibility, the currencies map is converted to an array here return Object.keys(currencies).map(function (key) { return currencies[key]; }); }, findCurrency: findCurrency, format: format, unformat: unformat }; /***/ }), /***/ "./node_modules/currency-formatter/localeFormats.json": /*!************************************************************!*\ !*** ./node_modules/currency-formatter/localeFormats.json ***! \************************************************************/ /*! exports provided: de, el, en-US, en-IE, zh-CN, es, it, nl, default */ /***/ (function(module) { module.exports = JSON.parse("{\"de\":{\"thousandsSeparator\":\".\",\"decimalSeparator\":\",\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"el\":{\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"thousandsSeparator\":\".\",\"decimalSeparator\":\",\",\"decimalDigits\":2},\"en-US\":{\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"en-IE\":{\"symbolOnLeft\":true,\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"zh-CN\":{\"thousandsSeparator\":\",\",\"decimalSeparator\":\".\",\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"decimalDigits\":2},\"es\":{\"thousandsSeparator\":\".\",\"decimalSeparator\":\",\",\"symbolOnLeft\":false,\"spaceBetweenAmountAndSymbol\":true,\"decimalDigits\":2},\"it\":{\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"thousandsSeparator\":\".\",\"decimalSeparator\":\",\",\"decimalDigits\":2},\"nl\":{\"symbolOnLeft\":true,\"spaceBetweenAmountAndSymbol\":false,\"thousandsSeparator\":\".\",\"decimalSeparator\":\",\",\"decimalDigits\":2}}"); /***/ }), /***/ "./node_modules/damerau-levenshtein/index.js": /*!***************************************************!*\ !*** ./node_modules/damerau-levenshtein/index.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports) { // TheSpanishInquisition // Cache the matrix. Note that if you not pass a limit this implementation will use a dynamically calculate one. module.exports = function (__this, that, limit) { var thisLength = __this.length, thatLength = that.length, matrix = []; // If the limit is not defined it will be calculate from this and that args. limit = (limit || (thatLength > thisLength ? thatLength : thisLength)) + 1; for (var i = 0; i < limit; i++) { matrix[i] = [i]; matrix[i].length = limit; } for (i = 0; i < limit; i++) { matrix[0][i] = i; } if (Math.abs(thisLength - thatLength) > (limit || 100)) { return prepare(limit || 100); } if (thisLength === 0) { return prepare(thatLength); } if (thatLength === 0) { return prepare(thisLength); } // Calculate matrix. var j, this_i, that_j, cost, min, t; for (i = 1; i <= thisLength; ++i) { this_i = __this[i - 1]; // Step 4 for (j = 1; j <= thatLength; ++j) { // Check the jagged ld total so far if (i === j && matrix[i][j] > 4) return prepare(thisLength); that_j = that[j - 1]; cost = this_i === that_j ? 0 : 1; // Step 5 // Calculate the minimum (much faster than Math.min(...)). min = matrix[i - 1][j] + 1; // Deletion. if ((t = matrix[i][j - 1] + 1) < min) min = t; // Insertion. if ((t = matrix[i - 1][j - 1] + cost) < min) min = t; // Substitution. // Update matrix. matrix[i][j] = i > 1 && j > 1 && this_i === that[j - 2] && __this[i - 2] === that_j && (t = matrix[i - 2][j - 2] + cost) < min ? t : min; // Transposition. } } return prepare(matrix[thisLength][thatLength]); /** * */ function prepare(steps) { var length = Math.max(thisLength, thatLength); var relative = length === 0 ? 0 : steps / length; var similarity = 1 - relative; return { steps: steps, relative: relative, similarity: similarity }; } }; /***/ }), /***/ "./node_modules/date-fns/esm/_lib/addLeadingZeros/index.js": /*!*****************************************************************!*\ !*** ./node_modules/date-fns/esm/_lib/addLeadingZeros/index.js ***! \*****************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return addLeadingZeros; }); function addLeadingZeros(number, targetLength) { var sign = number < 0 ? '-' : ''; var output = Math.abs(number).toString(); while (output.length < targetLength) { output = '0' + output; } return sign + output; } /***/ }), /***/ "./node_modules/date-fns/esm/_lib/assign/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/esm/_lib/assign/index.js ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return assign; }); function assign(target, dirtyObject) { if (target == null) { throw new TypeError('assign requires that input parameter not be null or undefined'); } dirtyObject = dirtyObject || {}; for (var property in dirtyObject) { if (dirtyObject.hasOwnProperty(property)) { target[property] = dirtyObject[property]; } } return target; } /***/ }), /***/ "./node_modules/date-fns/esm/_lib/cloneObject/index.js": /*!*************************************************************!*\ !*** ./node_modules/date-fns/esm/_lib/cloneObject/index.js ***! \*************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return cloneObject; }); /* harmony import */ var _assign_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../assign/index.js */ "./node_modules/date-fns/esm/_lib/assign/index.js"); function cloneObject(dirtyObject) { return Object(_assign_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, dirtyObject); } /***/ }), /***/ "./node_modules/date-fns/esm/_lib/format/formatters/index.js": /*!*******************************************************************!*\ !*** ./node_modules/date-fns/esm/_lib/format/formatters/index.js ***! \*******************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _lightFormatters_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lightFormatters/index.js */ "./node_modules/date-fns/esm/_lib/format/lightFormatters/index.js"); /* harmony import */ var _lib_getUTCDayOfYear_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../_lib/getUTCDayOfYear/index.js */ "./node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js"); /* harmony import */ var _lib_getUTCISOWeek_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../_lib/getUTCISOWeek/index.js */ "./node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js"); /* harmony import */ var _lib_getUTCISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../_lib/getUTCISOWeekYear/index.js */ "./node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js"); /* harmony import */ var _lib_getUTCWeek_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../_lib/getUTCWeek/index.js */ "./node_modules/date-fns/esm/_lib/getUTCWeek/index.js"); /* harmony import */ var _lib_getUTCWeekYear_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../_lib/getUTCWeekYear/index.js */ "./node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js"); /* harmony import */ var _addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../addLeadingZeros/index.js */ "./node_modules/date-fns/esm/_lib/addLeadingZeros/index.js"); var dayPeriodEnum = { am: 'am', pm: 'pm', midnight: 'midnight', noon: 'noon', morning: 'morning', afternoon: 'afternoon', evening: 'evening', night: 'night' }; /* * | | Unit | | Unit | * |-----|--------------------------------|-----|--------------------------------| * | a | AM, PM | A* | Milliseconds in day | * | b | AM, PM, noon, midnight | B | Flexible day period | * | c | Stand-alone local day of week | C* | Localized hour w/ day period | * | d | Day of month | D | Day of year | * | e | Local day of week | E | Day of week | * | f | | F* | Day of week in month | * | g* | Modified Julian day | G | Era | * | h | Hour [1-12] | H | Hour [0-23] | * | i! | ISO day of week | I! | ISO week of year | * | j* | Localized hour w/ day period | J* | Localized hour w/o day period | * | k | Hour [1-24] | K | Hour [0-11] | * | l* | (deprecated) | L | Stand-alone month | * | m | Minute | M | Month | * | n | | N | | * | o! | Ordinal number modifier | O | Timezone (GMT) | * | p! | Long localized time | P! | Long localized date | * | q | Stand-alone quarter | Q | Quarter | * | r* | Related Gregorian year | R! | ISO week-numbering year | * | s | Second | S | Fraction of second | * | t! | Seconds timestamp | T! | Milliseconds timestamp | * | u | Extended year | U* | Cyclic year | * | v* | Timezone (generic non-locat.) | V* | Timezone (location) | * | w | Local week of year | W* | Week of month | * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) | * | y | Year (abs) | Y | Local week-numbering year | * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) | * * Letters marked by * are not implemented but reserved by Unicode standard. * * Letters marked by ! are non-standard, but implemented by date-fns: * - `o` modifies the previous token to turn it into an ordinal (see `format` docs) * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days, * i.e. 7 for Sunday, 1 for Monday, etc. * - `I` is ISO week of year, as opposed to `w` which is local week of year. * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year. * `R` is supposed to be used in conjunction with `I` and `i` * for universal ISO week-numbering date, whereas * `Y` is supposed to be used in conjunction with `w` and `e` * for week-numbering date specific to the locale. * - `P` is long localized date format * - `p` is long localized time format */ var formatters = { // Era G: function (date, token, localize) { var era = date.getUTCFullYear() > 0 ? 1 : 0; switch (token) { // AD, BC case 'G': case 'GG': case 'GGG': return localize.era(era, { width: 'abbreviated' }); // A, B case 'GGGGG': return localize.era(era, { width: 'narrow' }); // Anno Domini, Before Christ case 'GGGG': default: return localize.era(era, { width: 'wide' }); } }, // Year y: function (date, token, localize) { // Ordinal number if (token === 'yo') { var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript) var year = signedYear > 0 ? signedYear : 1 - signedYear; return localize.ordinalNumber(year, { unit: 'year' }); } return _lightFormatters_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].y(date, token); }, // Local week-numbering year Y: function (date, token, localize, options) { var signedWeekYear = Object(_lib_getUTCWeekYear_index_js__WEBPACK_IMPORTED_MODULE_5__["default"])(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript) var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year if (token === 'YY') { var twoDigitYear = weekYear % 100; return Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_6__["default"])(twoDigitYear, 2); } // Ordinal number if (token === 'Yo') { return localize.ordinalNumber(weekYear, { unit: 'year' }); } // Padding return Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_6__["default"])(weekYear, token.length); }, // ISO week-numbering year R: function (date, token) { var isoWeekYear = Object(_lib_getUTCISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_3__["default"])(date); // Padding return Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_6__["default"])(isoWeekYear, token.length); }, // Extended year. This is a single number designating the year of this calendar system. // The main difference between `y` and `u` localizers are B.C. years: // | Year | `y` | `u` | // |------|-----|-----| // | AC 1 | 1 | 1 | // | BC 1 | 1 | 0 | // | BC 2 | 2 | -1 | // Also `yy` always returns the last two digits of a year, // while `uu` pads single digit years to 2 characters and returns other years unchanged. u: function (date, token) { var year = date.getUTCFullYear(); return Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_6__["default"])(year, token.length); }, // Quarter Q: function (date, token, localize) { var quarter = Math.ceil((date.getUTCMonth() + 1) / 3); switch (token) { // 1, 2, 3, 4 case 'Q': return String(quarter); // 01, 02, 03, 04 case 'QQ': return Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_6__["default"])(quarter, 2); // 1st, 2nd, 3rd, 4th case 'Qo': return localize.ordinalNumber(quarter, { unit: 'quarter' }); // Q1, Q2, Q3, Q4 case 'QQQ': return localize.quarter(quarter, { width: 'abbreviated', context: 'formatting' }); // 1, 2, 3, 4 (narrow quarter; could be not numerical) case 'QQQQQ': return localize.quarter(quarter, { width: 'narrow', context: 'formatting' }); // 1st quarter, 2nd quarter, ... case 'QQQQ': default: return localize.quarter(quarter, { width: 'wide', context: 'formatting' }); } }, // Stand-alone quarter q: function (date, token, localize) { var quarter = Math.ceil((date.getUTCMonth() + 1) / 3); switch (token) { // 1, 2, 3, 4 case 'q': return String(quarter); // 01, 02, 03, 04 case 'qq': return Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_6__["default"])(quarter, 2); // 1st, 2nd, 3rd, 4th case 'qo': return localize.ordinalNumber(quarter, { unit: 'quarter' }); // Q1, Q2, Q3, Q4 case 'qqq': return localize.quarter(quarter, { width: 'abbreviated', context: 'standalone' }); // 1, 2, 3, 4 (narrow quarter; could be not numerical) case 'qqqqq': return localize.quarter(quarter, { width: 'narrow', context: 'standalone' }); // 1st quarter, 2nd quarter, ... case 'qqqq': default: return localize.quarter(quarter, { width: 'wide', context: 'standalone' }); } }, // Month M: function (date, token, localize) { var month = date.getUTCMonth(); switch (token) { case 'M': case 'MM': return _lightFormatters_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].M(date, token); // 1st, 2nd, ..., 12th case 'Mo': return localize.ordinalNumber(month + 1, { unit: 'month' }); // Jan, Feb, ..., Dec case 'MMM': return localize.month(month, { width: 'abbreviated', context: 'formatting' }); // J, F, ..., D case 'MMMMM': return localize.month(month, { width: 'narrow', context: 'formatting' }); // January, February, ..., December case 'MMMM': default: return localize.month(month, { width: 'wide', context: 'formatting' }); } }, // Stand-alone month L: function (date, token, localize) { var month = date.getUTCMonth(); switch (token) { // 1, 2, ..., 12 case 'L': return String(month + 1); // 01, 02, ..., 12 case 'LL': return Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_6__["default"])(month + 1, 2); // 1st, 2nd, ..., 12th case 'Lo': return localize.ordinalNumber(month + 1, { unit: 'month' }); // Jan, Feb, ..., Dec case 'LLL': return localize.month(month, { width: 'abbreviated', context: 'standalone' }); // J, F, ..., D case 'LLLLL': return localize.month(month, { width: 'narrow', context: 'standalone' }); // January, February, ..., December case 'LLLL': default: return localize.month(month, { width: 'wide', context: 'standalone' }); } }, // Local week of year w: function (date, token, localize, options) { var week = Object(_lib_getUTCWeek_index_js__WEBPACK_IMPORTED_MODULE_4__["default"])(date, options); if (token === 'wo') { return localize.ordinalNumber(week, { unit: 'week' }); } return Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_6__["default"])(week, token.length); }, // ISO week of year I: function (date, token, localize) { var isoWeek = Object(_lib_getUTCISOWeek_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(date); if (token === 'Io') { return localize.ordinalNumber(isoWeek, { unit: 'week' }); } return Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_6__["default"])(isoWeek, token.length); }, // Day of the month d: function (date, token, localize) { if (token === 'do') { return localize.ordinalNumber(date.getUTCDate(), { unit: 'date' }); } return _lightFormatters_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].d(date, token); }, // Day of year D: function (date, token, localize) { var dayOfYear = Object(_lib_getUTCDayOfYear_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(date); if (token === 'Do') { return localize.ordinalNumber(dayOfYear, { unit: 'dayOfYear' }); } return Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_6__["default"])(dayOfYear, token.length); }, // Day of week E: function (date, token, localize) { var dayOfWeek = date.getUTCDay(); switch (token) { // Tue case 'E': case 'EE': case 'EEE': return localize.day(dayOfWeek, { width: 'abbreviated', context: 'formatting' }); // T case 'EEEEE': return localize.day(dayOfWeek, { width: 'narrow', context: 'formatting' }); // Tu case 'EEEEEE': return localize.day(dayOfWeek, { width: 'short', context: 'formatting' }); // Tuesday case 'EEEE': default: return localize.day(dayOfWeek, { width: 'wide', context: 'formatting' }); } }, // Local day of week e: function (date, token, localize, options) { var dayOfWeek = date.getUTCDay(); var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7; switch (token) { // Numerical value (Nth day of week with current locale or weekStartsOn) case 'e': return String(localDayOfWeek); // Padded numerical value case 'ee': return Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_6__["default"])(localDayOfWeek, 2); // 1st, 2nd, ..., 7th case 'eo': return localize.ordinalNumber(localDayOfWeek, { unit: 'day' }); case 'eee': return localize.day(dayOfWeek, { width: 'abbreviated', context: 'formatting' }); // T case 'eeeee': return localize.day(dayOfWeek, { width: 'narrow', context: 'formatting' }); // Tu case 'eeeeee': return localize.day(dayOfWeek, { width: 'short', context: 'formatting' }); // Tuesday case 'eeee': default: return localize.day(dayOfWeek, { width: 'wide', context: 'formatting' }); } }, // Stand-alone local day of week c: function (date, token, localize, options) { var dayOfWeek = date.getUTCDay(); var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7; switch (token) { // Numerical value (same as in `e`) case 'c': return String(localDayOfWeek); // Padded numerical value case 'cc': return Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_6__["default"])(localDayOfWeek, token.length); // 1st, 2nd, ..., 7th case 'co': return localize.ordinalNumber(localDayOfWeek, { unit: 'day' }); case 'ccc': return localize.day(dayOfWeek, { width: 'abbreviated', context: 'standalone' }); // T case 'ccccc': return localize.day(dayOfWeek, { width: 'narrow', context: 'standalone' }); // Tu case 'cccccc': return localize.day(dayOfWeek, { width: 'short', context: 'standalone' }); // Tuesday case 'cccc': default: return localize.day(dayOfWeek, { width: 'wide', context: 'standalone' }); } }, // ISO day of week i: function (date, token, localize) { var dayOfWeek = date.getUTCDay(); var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek; switch (token) { // 2 case 'i': return String(isoDayOfWeek); // 02 case 'ii': return Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_6__["default"])(isoDayOfWeek, token.length); // 2nd case 'io': return localize.ordinalNumber(isoDayOfWeek, { unit: 'day' }); // Tue case 'iii': return localize.day(dayOfWeek, { width: 'abbreviated', context: 'formatting' }); // T case 'iiiii': return localize.day(dayOfWeek, { width: 'narrow', context: 'formatting' }); // Tu case 'iiiiii': return localize.day(dayOfWeek, { width: 'short', context: 'formatting' }); // Tuesday case 'iiii': default: return localize.day(dayOfWeek, { width: 'wide', context: 'formatting' }); } }, // AM or PM a: function (date, token, localize) { var hours = date.getUTCHours(); var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am'; switch (token) { case 'a': case 'aa': case 'aaa': return localize.dayPeriod(dayPeriodEnumValue, { width: 'abbreviated', context: 'formatting' }); case 'aaaaa': return localize.dayPeriod(dayPeriodEnumValue, { width: 'narrow', context: 'formatting' }); case 'aaaa': default: return localize.dayPeriod(dayPeriodEnumValue, { width: 'wide', context: 'formatting' }); } }, // AM, PM, midnight, noon b: function (date, token, localize) { var hours = date.getUTCHours(); var dayPeriodEnumValue; if (hours === 12) { dayPeriodEnumValue = dayPeriodEnum.noon; } else if (hours === 0) { dayPeriodEnumValue = dayPeriodEnum.midnight; } else { dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am'; } switch (token) { case 'b': case 'bb': case 'bbb': return localize.dayPeriod(dayPeriodEnumValue, { width: 'abbreviated', context: 'formatting' }); case 'bbbbb': return localize.dayPeriod(dayPeriodEnumValue, { width: 'narrow', context: 'formatting' }); case 'bbbb': default: return localize.dayPeriod(dayPeriodEnumValue, { width: 'wide', context: 'formatting' }); } }, // in the morning, in the afternoon, in the evening, at night B: function (date, token, localize) { var hours = date.getUTCHours(); var dayPeriodEnumValue; if (hours >= 17) { dayPeriodEnumValue = dayPeriodEnum.evening; } else if (hours >= 12) { dayPeriodEnumValue = dayPeriodEnum.afternoon; } else if (hours >= 4) { dayPeriodEnumValue = dayPeriodEnum.morning; } else { dayPeriodEnumValue = dayPeriodEnum.night; } switch (token) { case 'B': case 'BB': case 'BBB': return localize.dayPeriod(dayPeriodEnumValue, { width: 'abbreviated', context: 'formatting' }); case 'BBBBB': return localize.dayPeriod(dayPeriodEnumValue, { width: 'narrow', context: 'formatting' }); case 'BBBB': default: return localize.dayPeriod(dayPeriodEnumValue, { width: 'wide', context: 'formatting' }); } }, // Hour [1-12] h: function (date, token, localize) { if (token === 'ho') { var hours = date.getUTCHours() % 12; if (hours === 0) hours = 12; return localize.ordinalNumber(hours, { unit: 'hour' }); } return _lightFormatters_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].h(date, token); }, // Hour [0-23] H: function (date, token, localize) { if (token === 'Ho') { return localize.ordinalNumber(date.getUTCHours(), { unit: 'hour' }); } return _lightFormatters_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].H(date, token); }, // Hour [0-11] K: function (date, token, localize) { var hours = date.getUTCHours() % 12; if (token === 'Ko') { return localize.ordinalNumber(hours, { unit: 'hour' }); } return Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_6__["default"])(hours, token.length); }, // Hour [1-24] k: function (date, token, localize) { var hours = date.getUTCHours(); if (hours === 0) hours = 24; if (token === 'ko') { return localize.ordinalNumber(hours, { unit: 'hour' }); } return Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_6__["default"])(hours, token.length); }, // Minute m: function (date, token, localize) { if (token === 'mo') { return localize.ordinalNumber(date.getUTCMinutes(), { unit: 'minute' }); } return _lightFormatters_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].m(date, token); }, // Second s: function (date, token, localize) { if (token === 'so') { return localize.ordinalNumber(date.getUTCSeconds(), { unit: 'second' }); } return _lightFormatters_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].s(date, token); }, // Fraction of second S: function (date, token) { var numberOfDigits = token.length; var milliseconds = date.getUTCMilliseconds(); var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3)); return Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_6__["default"])(fractionalSeconds, numberOfDigits); }, // Timezone (ISO-8601. If offset is 0, output is always `'Z'`) X: function (date, token, _localize, options) { var originalDate = options._originalDate || date; var timezoneOffset = originalDate.getTimezoneOffset(); if (timezoneOffset === 0) { return 'Z'; } switch (token) { // Hours and optional minutes case 'X': return formatTimezoneWithOptionalMinutes(timezoneOffset); // Hours, minutes and optional seconds without `:` delimiter // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets // so this token always has the same output as `XX` case 'XXXX': case 'XX': // Hours and minutes without `:` delimiter return formatTimezone(timezoneOffset); // Hours, minutes and optional seconds with `:` delimiter // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets // so this token always has the same output as `XXX` case 'XXXXX': case 'XXX': // Hours and minutes with `:` delimiter default: return formatTimezone(timezoneOffset, ':'); } }, // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent) x: function (date, token, _localize, options) { var originalDate = options._originalDate || date; var timezoneOffset = originalDate.getTimezoneOffset(); switch (token) { // Hours and optional minutes case 'x': return formatTimezoneWithOptionalMinutes(timezoneOffset); // Hours, minutes and optional seconds without `:` delimiter // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets // so this token always has the same output as `xx` case 'xxxx': case 'xx': // Hours and minutes without `:` delimiter return formatTimezone(timezoneOffset); // Hours, minutes and optional seconds with `:` delimiter // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets // so this token always has the same output as `xxx` case 'xxxxx': case 'xxx': // Hours and minutes with `:` delimiter default: return formatTimezone(timezoneOffset, ':'); } }, // Timezone (GMT) O: function (date, token, _localize, options) { var originalDate = options._originalDate || date; var timezoneOffset = originalDate.getTimezoneOffset(); switch (token) { // Short case 'O': case 'OO': case 'OOO': return 'GMT' + formatTimezoneShort(timezoneOffset, ':'); // Long case 'OOOO': default: return 'GMT' + formatTimezone(timezoneOffset, ':'); } }, // Timezone (specific non-location) z: function (date, token, _localize, options) { var originalDate = options._originalDate || date; var timezoneOffset = originalDate.getTimezoneOffset(); switch (token) { // Short case 'z': case 'zz': case 'zzz': return 'GMT' + formatTimezoneShort(timezoneOffset, ':'); // Long case 'zzzz': default: return 'GMT' + formatTimezone(timezoneOffset, ':'); } }, // Seconds timestamp t: function (date, token, _localize, options) { var originalDate = options._originalDate || date; var timestamp = Math.floor(originalDate.getTime() / 1000); return Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_6__["default"])(timestamp, token.length); }, // Milliseconds timestamp T: function (date, token, _localize, options) { var originalDate = options._originalDate || date; var timestamp = originalDate.getTime(); return Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_6__["default"])(timestamp, token.length); } }; function formatTimezoneShort(offset, dirtyDelimiter) { var sign = offset > 0 ? '-' : '+'; var absOffset = Math.abs(offset); var hours = Math.floor(absOffset / 60); var minutes = absOffset % 60; if (minutes === 0) { return sign + String(hours); } var delimiter = dirtyDelimiter || ''; return sign + String(hours) + delimiter + Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_6__["default"])(minutes, 2); } function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) { if (offset % 60 === 0) { var sign = offset > 0 ? '-' : '+'; return sign + Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_6__["default"])(Math.abs(offset) / 60, 2); } return formatTimezone(offset, dirtyDelimiter); } function formatTimezone(offset, dirtyDelimiter) { var delimiter = dirtyDelimiter || ''; var sign = offset > 0 ? '-' : '+'; var absOffset = Math.abs(offset); var hours = Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_6__["default"])(Math.floor(absOffset / 60), 2); var minutes = Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_6__["default"])(absOffset % 60, 2); return sign + hours + delimiter + minutes; } /* harmony default export */ __webpack_exports__["default"] = (formatters); /***/ }), /***/ "./node_modules/date-fns/esm/_lib/format/lightFormatters/index.js": /*!************************************************************************!*\ !*** ./node_modules/date-fns/esm/_lib/format/lightFormatters/index.js ***! \************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../addLeadingZeros/index.js */ "./node_modules/date-fns/esm/_lib/addLeadingZeros/index.js"); /* * | | Unit | | Unit | * |-----|--------------------------------|-----|--------------------------------| * | a | AM, PM | A* | Milliseconds in day | * | c | Stand-alone local day of week | C* | Localized hour w/ day period | * | d | Day of month | D | Day of year | * | e | Local day of week | E | Day of week | * | f | | F* | Day of week in month | * | g* | Modified Julian day | G | Era | * | h | Hour [1-12] | H | Hour [0-23] | * | i! | ISO day of week | I! | ISO week of year | * | j* | Localized hour w/ day period | J* | Localized hour w/o day period | * | k | Hour [1-24] | K | Hour [0-11] | * | l* | (deprecated) | L | Stand-alone month | * | m | Minute | M | Month | * | n | | N | | * | o! | Ordinal number modifier | O | Timezone (GMT) | * | p! | Long localized time | P! | Long localized date | * | q | Stand-alone quarter | Q | Quarter | * | r* | Related Gregorian year | R! | ISO week-numbering year | * | s | Second | S | Fraction of second | * | t! | Seconds timestamp | T! | Milliseconds timestamp | * | u | Extended year | U* | Cyclic year | * | v* | Timezone (generic non-locat.) | V* | Timezone (location) | * | w | Local week of year | W* | Week of month | * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) | * | y | Year (abs) | Y | Local week-numbering year | * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) | * * Letters marked by * are not implemented but reserved by Unicode standard. * * Letters marked by ! are non-standard, but implemented by date-fns: * - `o` modifies the previous token to turn it into an ordinal (see `format` docs) * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days, * i.e. 7 for Sunday, 1 for Monday, etc. * - `I` is ISO week of year, as opposed to `w` which is local week of year. * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year. * `R` is supposed to be used in conjunction with `I` and `i` * for universal ISO week-numbering date, whereas * `Y` is supposed to be used in conjunction with `w` and `e` * for week-numbering date specific to the locale. * - `P` is long localized date format * - `p` is long localized time format */ var formatters = { // Year y: function (date, token) { // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens // | Year | y | yy | yyy | yyyy | yyyyy | // |----------|-------|----|-------|-------|-------| // | AD 1 | 1 | 01 | 001 | 0001 | 00001 | // | AD 12 | 12 | 12 | 012 | 0012 | 00012 | // | AD 123 | 123 | 23 | 123 | 0123 | 00123 | // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 | // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 | var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript) var year = signedYear > 0 ? signedYear : 1 - signedYear; return Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(token === 'yy' ? year % 100 : year, token.length); }, // Month M: function (date, token) { var month = date.getUTCMonth(); return token === 'M' ? String(month + 1) : Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(month + 1, 2); }, // Day of the month d: function (date, token) { return Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(date.getUTCDate(), token.length); }, // AM or PM a: function (date, token) { var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am'; switch (token) { case 'a': case 'aa': case 'aaa': return dayPeriodEnumValue.toUpperCase(); case 'aaaaa': return dayPeriodEnumValue[0]; case 'aaaa': default: return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.'; } }, // Hour [1-12] h: function (date, token) { return Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(date.getUTCHours() % 12 || 12, token.length); }, // Hour [0-23] H: function (date, token) { return Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(date.getUTCHours(), token.length); }, // Minute m: function (date, token) { return Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(date.getUTCMinutes(), token.length); }, // Second s: function (date, token) { return Object(_addLeadingZeros_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(date.getUTCSeconds(), token.length); } }; /* harmony default export */ __webpack_exports__["default"] = (formatters); /***/ }), /***/ "./node_modules/date-fns/esm/_lib/format/longFormatters/index.js": /*!***********************************************************************!*\ !*** ./node_modules/date-fns/esm/_lib/format/longFormatters/index.js ***! \***********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); function dateLongFormatter(pattern, formatLong) { switch (pattern) { case 'P': return formatLong.date({ width: 'short' }); case 'PP': return formatLong.date({ width: 'medium' }); case 'PPP': return formatLong.date({ width: 'long' }); case 'PPPP': default: return formatLong.date({ width: 'full' }); } } function timeLongFormatter(pattern, formatLong) { switch (pattern) { case 'p': return formatLong.time({ width: 'short' }); case 'pp': return formatLong.time({ width: 'medium' }); case 'ppp': return formatLong.time({ width: 'long' }); case 'pppp': default: return formatLong.time({ width: 'full' }); } } function dateTimeLongFormatter(pattern, formatLong) { var matchResult = pattern.match(/(P+)(p+)?/); var datePattern = matchResult[1]; var timePattern = matchResult[2]; if (!timePattern) { return dateLongFormatter(pattern, formatLong); } var dateTimeFormat; switch (datePattern) { case 'P': dateTimeFormat = formatLong.dateTime({ width: 'short' }); break; case 'PP': dateTimeFormat = formatLong.dateTime({ width: 'medium' }); break; case 'PPP': dateTimeFormat = formatLong.dateTime({ width: 'long' }); break; case 'PPPP': default: dateTimeFormat = formatLong.dateTime({ width: 'full' }); break; } return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong)); } var longFormatters = { p: timeLongFormatter, P: dateTimeLongFormatter }; /* harmony default export */ __webpack_exports__["default"] = (longFormatters); /***/ }), /***/ "./node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js": /*!*********************************************************************************!*\ !*** ./node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js ***! \*********************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getTimezoneOffsetInMilliseconds; }); var MILLISECONDS_IN_MINUTE = 60000; /** * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds. * They usually appear for dates that denote time before the timezones were introduced * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891 * and GMT+01:00:00 after that date) * * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above, * which would lead to incorrect calculations. * * This function returns the timezone offset in milliseconds that takes seconds in account. */ function getTimezoneOffsetInMilliseconds(dirtyDate) { var date = new Date(dirtyDate.getTime()); var baseTimezoneOffset = date.getTimezoneOffset(); date.setSeconds(0, 0); var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE; return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset; } /***/ }), /***/ "./node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js": /*!*****************************************************************!*\ !*** ./node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js ***! \*****************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getUTCDayOfYear; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); var MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented. // See issue: https://github.com/date-fns/date-fns/issues/376 function getUTCDayOfYear(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var timestamp = date.getTime(); date.setUTCMonth(0, 1); date.setUTCHours(0, 0, 0, 0); var startOfYearTimestamp = date.getTime(); var difference = timestamp - startOfYearTimestamp; return Math.floor(difference / MILLISECONDS_IN_DAY) + 1; } /***/ }), /***/ "./node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js": /*!***************************************************************!*\ !*** ./node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js ***! \***************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getUTCISOWeek; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _startOfUTCISOWeek_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../startOfUTCISOWeek/index.js */ "./node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js"); /* harmony import */ var _startOfUTCISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../startOfUTCISOWeekYear/index.js */ "./node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js"); var MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented. // See issue: https://github.com/date-fns/date-fns/issues/376 function getUTCISOWeek(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var diff = Object(_startOfUTCISOWeek_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(date).getTime() - Object(_startOfUTCISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(date).getTime(); // Round the number of days to the nearest integer // because the number of milliseconds in a week is not constant // (e.g. it's different in the week of the daylight saving time clock shift) return Math.round(diff / MILLISECONDS_IN_WEEK) + 1; } /***/ }), /***/ "./node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js": /*!*******************************************************************!*\ !*** ./node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js ***! \*******************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getUTCISOWeekYear; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _startOfUTCISOWeek_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../startOfUTCISOWeek/index.js */ "./node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js"); // This function will be a part of public API when UTC function will be implemented. // See issue: https://github.com/date-fns/date-fns/issues/376 function getUTCISOWeekYear(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var year = date.getUTCFullYear(); var fourthOfJanuaryOfNextYear = new Date(0); fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4); fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0); var startOfNextYear = Object(_startOfUTCISOWeek_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(fourthOfJanuaryOfNextYear); var fourthOfJanuaryOfThisYear = new Date(0); fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4); fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0); var startOfThisYear = Object(_startOfUTCISOWeek_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(fourthOfJanuaryOfThisYear); if (date.getTime() >= startOfNextYear.getTime()) { return year + 1; } else if (date.getTime() >= startOfThisYear.getTime()) { return year; } else { return year - 1; } } /***/ }), /***/ "./node_modules/date-fns/esm/_lib/getUTCWeek/index.js": /*!************************************************************!*\ !*** ./node_modules/date-fns/esm/_lib/getUTCWeek/index.js ***! \************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getUTCWeek; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _startOfUTCWeek_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../startOfUTCWeek/index.js */ "./node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js"); /* harmony import */ var _startOfUTCWeekYear_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../startOfUTCWeekYear/index.js */ "./node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js"); var MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented. // See issue: https://github.com/date-fns/date-fns/issues/376 function getUTCWeek(dirtyDate, options) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var diff = Object(_startOfUTCWeek_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(date, options).getTime() - Object(_startOfUTCWeekYear_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(date, options).getTime(); // Round the number of days to the nearest integer // because the number of milliseconds in a week is not constant // (e.g. it's different in the week of the daylight saving time clock shift) return Math.round(diff / MILLISECONDS_IN_WEEK) + 1; } /***/ }), /***/ "./node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js": /*!****************************************************************!*\ !*** ./node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js ***! \****************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getUTCWeekYear; }); /* harmony import */ var _toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _startOfUTCWeek_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../startOfUTCWeek/index.js */ "./node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js"); // This function will be a part of public API when UTC function will be implemented. // See issue: https://github.com/date-fns/date-fns/issues/376 function getUTCWeekYear(dirtyDate, dirtyOptions) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate, dirtyOptions); var year = date.getUTCFullYear(); var options = dirtyOptions || {}; var locale = options.locale; var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate; var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : Object(_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(localeFirstWeekContainsDate); var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : Object(_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) { throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively'); } var firstWeekOfNextYear = new Date(0); firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate); firstWeekOfNextYear.setUTCHours(0, 0, 0, 0); var startOfNextYear = Object(_startOfUTCWeek_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(firstWeekOfNextYear, dirtyOptions); var firstWeekOfThisYear = new Date(0); firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate); firstWeekOfThisYear.setUTCHours(0, 0, 0, 0); var startOfThisYear = Object(_startOfUTCWeek_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(firstWeekOfThisYear, dirtyOptions); if (date.getTime() >= startOfNextYear.getTime()) { return year + 1; } else if (date.getTime() >= startOfThisYear.getTime()) { return year; } else { return year - 1; } } /***/ }), /***/ "./node_modules/date-fns/esm/_lib/protectedTokens/index.js": /*!*****************************************************************!*\ !*** ./node_modules/date-fns/esm/_lib/protectedTokens/index.js ***! \*****************************************************************/ /*! exports provided: protectedTokens, isProtectedToken, throwProtectedError */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "protectedTokens", function() { return protectedTokens; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isProtectedToken", function() { return isProtectedToken; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throwProtectedError", function() { return throwProtectedError; }); var protectedTokens = ['D', 'DD', 'YY', 'YYYY']; function isProtectedToken(token) { return protectedTokens.indexOf(token) !== -1; } function throwProtectedError(token) { throw new RangeError('`options.awareOfUnicodeTokens` must be set to `true` to use `' + token + '` token; see: https://git.io/fxCyr'); } /***/ }), /***/ "./node_modules/date-fns/esm/_lib/setUTCDay/index.js": /*!***********************************************************!*\ !*** ./node_modules/date-fns/esm/_lib/setUTCDay/index.js ***! \***********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return setUTCDay; }); /* harmony import */ var _toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); // This function will be a part of public API when UTC function will be implemented. // See issue: https://github.com/date-fns/date-fns/issues/376 function setUTCDay(dirtyDate, dirtyDay, dirtyOptions) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var options = dirtyOptions || {}; var locale = options.locale; var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn; var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : Object(_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(localeWeekStartsOn); var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : Object(_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var day = Object(_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDay); var currentDay = date.getUTCDay(); var remainder = day % 7; var dayIndex = (remainder + 7) % 7; var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay; date.setUTCDate(date.getUTCDate() + diff); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/_lib/setUTCISODay/index.js": /*!**************************************************************!*\ !*** ./node_modules/date-fns/esm/_lib/setUTCISODay/index.js ***! \**************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return setUTCISODay; }); /* harmony import */ var _toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); // This function will be a part of public API when UTC function will be implemented. // See issue: https://github.com/date-fns/date-fns/issues/376 function setUTCISODay(dirtyDate, dirtyDay) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var day = Object(_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDay); if (day % 7 === 0) { day = day - 7; } var weekStartsOn = 1; var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var currentDay = date.getUTCDay(); var remainder = day % 7; var dayIndex = (remainder + 7) % 7; var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay; date.setUTCDate(date.getUTCDate() + diff); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js": /*!***************************************************************!*\ !*** ./node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js ***! \***************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return setUTCISOWeek; }); /* harmony import */ var _toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _getUTCISOWeek_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../getUTCISOWeek/index.js */ "./node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js"); // This function will be a part of public API when UTC function will be implemented. // See issue: https://github.com/date-fns/date-fns/issues/376 function setUTCISOWeek(dirtyDate, dirtyISOWeek) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var isoWeek = Object(_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyISOWeek); var diff = Object(_getUTCISOWeek_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(date) - isoWeek; date.setUTCDate(date.getUTCDate() - diff * 7); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/_lib/setUTCWeek/index.js": /*!************************************************************!*\ !*** ./node_modules/date-fns/esm/_lib/setUTCWeek/index.js ***! \************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return setUTCWeek; }); /* harmony import */ var _toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _getUTCWeek_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../getUTCWeek/index.js */ "./node_modules/date-fns/esm/_lib/getUTCWeek/index.js"); // This function will be a part of public API when UTC function will be implemented. // See issue: https://github.com/date-fns/date-fns/issues/376 function setUTCWeek(dirtyDate, dirtyWeek, options) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var week = Object(_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyWeek); var diff = Object(_getUTCWeek_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(date, options) - week; date.setUTCDate(date.getUTCDate() - diff * 7); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js": /*!*******************************************************************!*\ !*** ./node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js ***! \*******************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return startOfUTCISOWeek; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); // This function will be a part of public API when UTC function will be implemented. // See issue: https://github.com/date-fns/date-fns/issues/376 function startOfUTCISOWeek(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var weekStartsOn = 1; var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var day = date.getUTCDay(); var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; date.setUTCDate(date.getUTCDate() - diff); date.setUTCHours(0, 0, 0, 0); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js": /*!***********************************************************************!*\ !*** ./node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js ***! \***********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return startOfUTCISOWeekYear; }); /* harmony import */ var _getUTCISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../getUTCISOWeekYear/index.js */ "./node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js"); /* harmony import */ var _startOfUTCISOWeek_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../startOfUTCISOWeek/index.js */ "./node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js"); // This function will be a part of public API when UTC function will be implemented. // See issue: https://github.com/date-fns/date-fns/issues/376 function startOfUTCISOWeekYear(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var year = Object(_getUTCISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var fourthOfJanuary = new Date(0); fourthOfJanuary.setUTCFullYear(year, 0, 4); fourthOfJanuary.setUTCHours(0, 0, 0, 0); var date = Object(_startOfUTCISOWeek_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(fourthOfJanuary); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js": /*!****************************************************************!*\ !*** ./node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js ***! \****************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return startOfUTCWeek; }); /* harmony import */ var _toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); // This function will be a part of public API when UTC function will be implemented. // See issue: https://github.com/date-fns/date-fns/issues/376 function startOfUTCWeek(dirtyDate, dirtyOptions) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var options = dirtyOptions || {}; var locale = options.locale; var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn; var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : Object(_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(localeWeekStartsOn); var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : Object(_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var day = date.getUTCDay(); var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; date.setUTCDate(date.getUTCDate() - diff); date.setUTCHours(0, 0, 0, 0); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js": /*!********************************************************************!*\ !*** ./node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js ***! \********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return startOfUTCWeekYear; }); /* harmony import */ var _toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _getUTCWeekYear_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../getUTCWeekYear/index.js */ "./node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js"); /* harmony import */ var _startOfUTCWeek_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../startOfUTCWeek/index.js */ "./node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js"); // This function will be a part of public API when UTC function will be implemented. // See issue: https://github.com/date-fns/date-fns/issues/376 function startOfUTCWeekYear(dirtyDate, dirtyOptions) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var options = dirtyOptions || {}; var locale = options.locale; var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate; var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : Object(_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(localeFirstWeekContainsDate); var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : Object(_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options.firstWeekContainsDate); var year = Object(_getUTCWeekYear_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate, dirtyOptions); var firstWeek = new Date(0); firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate); firstWeek.setUTCHours(0, 0, 0, 0); var date = Object(_startOfUTCWeek_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(firstWeek, dirtyOptions); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/_lib/toInteger/index.js": /*!***********************************************************!*\ !*** ./node_modules/date-fns/esm/_lib/toInteger/index.js ***! \***********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return toInteger; }); function toInteger(dirtyNumber) { if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) { return NaN; } var number = Number(dirtyNumber); if (isNaN(number)) { return number; } return number < 0 ? Math.ceil(number) : Math.floor(number); } /***/ }), /***/ "./node_modules/date-fns/esm/addDays/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/esm/addDays/index.js ***! \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return addDays; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name addDays * @category Day Helpers * @summary Add the specified number of days to the given date. * * @description * Add the specified number of days to the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} amount - the amount of days to be added * @returns {Date} the new date with the days added * @throws {TypeError} 2 arguments required * * @example * // Add 10 days to 1 September 2014: * var result = addDays(new Date(2014, 8, 1), 10) * //=> Thu Sep 11 2014 00:00:00 */ function addDays(dirtyDate, dirtyAmount) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var amount = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyAmount); date.setDate(date.getDate() + amount); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/addHours/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/esm/addHours/index.js ***! \*****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return addHours; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _addMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../addMilliseconds/index.js */ "./node_modules/date-fns/esm/addMilliseconds/index.js"); var MILLISECONDS_IN_HOUR = 3600000; /** * @name addHours * @category Hour Helpers * @summary Add the specified number of hours to the given date. * * @description * Add the specified number of hours to the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} amount - the amount of hours to be added * @returns {Date} the new date with the hours added * @throws {TypeError} 2 arguments required * * @example * // Add 2 hours to 10 July 2014 23:00:00: * var result = addHours(new Date(2014, 6, 10, 23, 0), 2) * //=> Fri Jul 11 2014 01:00:00 */ function addHours(dirtyDate, dirtyAmount) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var amount = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyAmount); return Object(_addMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate, amount * MILLISECONDS_IN_HOUR); } /***/ }), /***/ "./node_modules/date-fns/esm/addISOWeekYears/index.js": /*!************************************************************!*\ !*** ./node_modules/date-fns/esm/addISOWeekYears/index.js ***! \************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return addISOWeekYears; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _getISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../getISOWeekYear/index.js */ "./node_modules/date-fns/esm/getISOWeekYear/index.js"); /* harmony import */ var _setISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../setISOWeekYear/index.js */ "./node_modules/date-fns/esm/setISOWeekYear/index.js"); /** * @name addISOWeekYears * @category ISO Week-Numbering Year Helpers * @summary Add the specified number of ISO week-numbering years to the given date. * * @description * Add the specified number of ISO week-numbering years to the given date. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * - The function was renamed from `addISOYears` to `addISOWeekYears`. * "ISO week year" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date). * This change makes the name consistent with * locale-dependent week-numbering year helpers, e.g., `addWeekYears`. * * @param {Date|Number} date - the date to be changed * @param {Number} amount - the amount of ISO week-numbering years to be added * @returns {Date} the new date with the ISO week-numbering years added * @throws {TypeError} 2 arguments required * * @example * // Add 5 ISO week-numbering years to 2 July 2010: * var result = addISOWeekYears(new Date(2010, 6, 2), 5) * //=> Fri Jun 26 2015 00:00:00 */ function addISOWeekYears(dirtyDate, dirtyAmount) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var amount = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyAmount); return Object(_setISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(dirtyDate, Object(_getISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate) + amount); } /***/ }), /***/ "./node_modules/date-fns/esm/addMilliseconds/index.js": /*!************************************************************!*\ !*** ./node_modules/date-fns/esm/addMilliseconds/index.js ***! \************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return addMilliseconds; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name addMilliseconds * @category Millisecond Helpers * @summary Add the specified number of milliseconds to the given date. * * @description * Add the specified number of milliseconds to the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} amount - the amount of milliseconds to be added * @returns {Date} the new date with the milliseconds added * @throws {TypeError} 2 arguments required * * @example * // Add 750 milliseconds to 10 July 2014 12:45:30.000: * var result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750) * //=> Thu Jul 10 2014 12:45:30.750 */ function addMilliseconds(dirtyDate, dirtyAmount) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var timestamp = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate).getTime(); var amount = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyAmount); return new Date(timestamp + amount); } /***/ }), /***/ "./node_modules/date-fns/esm/addMinutes/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/esm/addMinutes/index.js ***! \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return addMinutes; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _addMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../addMilliseconds/index.js */ "./node_modules/date-fns/esm/addMilliseconds/index.js"); var MILLISECONDS_IN_MINUTE = 60000; /** * @name addMinutes * @category Minute Helpers * @summary Add the specified number of minutes to the given date. * * @description * Add the specified number of minutes to the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} amount - the amount of minutes to be added * @returns {Date} the new date with the minutes added * @throws {TypeError} 2 arguments required * * @example * // Add 30 minutes to 10 July 2014 12:00:00: * var result = addMinutes(new Date(2014, 6, 10, 12, 0), 30) * //=> Thu Jul 10 2014 12:30:00 */ function addMinutes(dirtyDate, dirtyAmount) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var amount = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyAmount); return Object(_addMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate, amount * MILLISECONDS_IN_MINUTE); } /***/ }), /***/ "./node_modules/date-fns/esm/addMonths/index.js": /*!******************************************************!*\ !*** ./node_modules/date-fns/esm/addMonths/index.js ***! \******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return addMonths; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _getDaysInMonth_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../getDaysInMonth/index.js */ "./node_modules/date-fns/esm/getDaysInMonth/index.js"); /** * @name addMonths * @category Month Helpers * @summary Add the specified number of months to the given date. * * @description * Add the specified number of months to the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} amount - the amount of months to be added * @returns {Date} the new date with the months added * @throws {TypeError} 2 arguments required * * @example * // Add 5 months to 1 September 2014: * var result = addMonths(new Date(2014, 8, 1), 5) * //=> Sun Feb 01 2015 00:00:00 */ function addMonths(dirtyDate, dirtyAmount) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var amount = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyAmount); var desiredMonth = date.getMonth() + amount; var dateWithDesiredMonth = new Date(0); dateWithDesiredMonth.setFullYear(date.getFullYear(), desiredMonth, 1); dateWithDesiredMonth.setHours(0, 0, 0, 0); var daysInMonth = Object(_getDaysInMonth_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(dateWithDesiredMonth); // Set the last day of the new month // if the original date was the last day of the longer month date.setMonth(desiredMonth, Math.min(daysInMonth, date.getDate())); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/addQuarters/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/esm/addQuarters/index.js ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return addQuarters; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _addMonths_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../addMonths/index.js */ "./node_modules/date-fns/esm/addMonths/index.js"); /** * @name addQuarters * @category Quarter Helpers * @summary Add the specified number of year quarters to the given date. * * @description * Add the specified number of year quarters to the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} amount - the amount of quarters to be added * @returns {Date} the new date with the quarters added * @throws {TypeError} 2 arguments required * * @example * // Add 1 quarter to 1 September 2014: * var result = addQuarters(new Date(2014, 8, 1), 1) * //=> Mon Dec 01 2014 00:00:00 */ function addQuarters(dirtyDate, dirtyAmount) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var amount = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyAmount); var months = amount * 3; return Object(_addMonths_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate, months); } /***/ }), /***/ "./node_modules/date-fns/esm/addSeconds/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/esm/addSeconds/index.js ***! \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return addSeconds; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _addMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../addMilliseconds/index.js */ "./node_modules/date-fns/esm/addMilliseconds/index.js"); /** * @name addSeconds * @category Second Helpers * @summary Add the specified number of seconds to the given date. * * @description * Add the specified number of seconds to the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} amount - the amount of seconds to be added * @returns {Date} the new date with the seconds added * @throws {TypeError} 2 arguments required * * @example * // Add 30 seconds to 10 July 2014 12:45:00: * var result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30) * //=> Thu Jul 10 2014 12:45:30 */ function addSeconds(dirtyDate, dirtyAmount) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var amount = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyAmount); return Object(_addMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate, amount * 1000); } /***/ }), /***/ "./node_modules/date-fns/esm/addWeeks/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/esm/addWeeks/index.js ***! \*****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return addWeeks; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _addDays_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../addDays/index.js */ "./node_modules/date-fns/esm/addDays/index.js"); /** * @name addWeeks * @category Week Helpers * @summary Add the specified number of weeks to the given date. * * @description * Add the specified number of week to the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} amount - the amount of weeks to be added * @returns {Date} the new date with the weeks added * @throws {TypeError} 2 arguments required * * @example * // Add 4 weeks to 1 September 2014: * var result = addWeeks(new Date(2014, 8, 1), 4) * //=> Mon Sep 29 2014 00:00:00 */ function addWeeks(dirtyDate, dirtyAmount) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var amount = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyAmount); var days = amount * 7; return Object(_addDays_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate, days); } /***/ }), /***/ "./node_modules/date-fns/esm/addYears/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/esm/addYears/index.js ***! \*****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return addYears; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _addMonths_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../addMonths/index.js */ "./node_modules/date-fns/esm/addMonths/index.js"); /** * @name addYears * @category Year Helpers * @summary Add the specified number of years to the given date. * * @description * Add the specified number of years to the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} amount - the amount of years to be added * @returns {Date} the new date with the years added * @throws {TypeError} 2 arguments required * * @example * // Add 5 years to 1 September 2014: * var result = addYears(new Date(2014, 8, 1), 5) * //=> Sun Sep 01 2019 00:00:00 */ function addYears(dirtyDate, dirtyAmount) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var amount = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyAmount); return Object(_addMonths_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate, amount * 12); } /***/ }), /***/ "./node_modules/date-fns/esm/areIntervalsOverlapping/index.js": /*!********************************************************************!*\ !*** ./node_modules/date-fns/esm/areIntervalsOverlapping/index.js ***! \********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return areIntervalsOverlapping; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name areIntervalsOverlapping * @category Interval Helpers * @summary Is the given time interval overlapping with another time interval? * * @description * Is the given time interval overlapping with another time interval? * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * - The function was renamed from `areRangesOverlapping` to `areIntervalsOverlapping`. * This change was made to mirror the use of the word "interval" in standard ISO 8601:2004 terminology: * * ``` * 2.1.3 * time interval * part of the time axis limited by two instants * ``` * * Also, this function now accepts an object with `start` and `end` properties * instead of two arguments as an interval. * This function now throws `RangeError` if the start of the interval is after its end * or if any date in the interval is `Invalid Date`. * * ```javascript * // Before v2.0.0 * * areRangesOverlapping( * new Date(2014, 0, 10), new Date(2014, 0, 20), * new Date(2014, 0, 17), new Date(2014, 0, 21) * ) * * // v2.0.0 onward * * areIntervalsOverlapping( * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) } * ) * ``` * * @param {Interval} intervalLeft - the first interval to compare. See [Interval]{@link docs/types/Interval} * @param {Interval} intervalRight - the second interval to compare. See [Interval]{@link docs/types/Interval} * @returns {Boolean} whether the time intervals are overlapping * @throws {TypeError} 2 arguments required * @throws {RangeError} The start of an interval cannot be after its end * @throws {RangeError} Date in interval cannot be `Invalid Date` * * @example * // For overlapping time intervals: * areIntervalsOverlapping( * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) } * ) * //=> true * * @example * // For non-overlapping time intervals: * areIntervalsOverlapping( * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, * { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) } * ) * //=> false */ function areIntervalsOverlapping(dirtyIntervalLeft, dirtyIntervalRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var intervalLeft = dirtyIntervalLeft || {}; var intervalRight = dirtyIntervalRight || {}; var leftStartTime = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(intervalLeft.start).getTime(); var leftEndTime = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(intervalLeft.end).getTime(); var rightStartTime = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(intervalRight.start).getTime(); var rightEndTime = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(intervalRight.end).getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date` if (!(leftStartTime <= leftEndTime && rightStartTime <= rightEndTime)) { throw new RangeError('Invalid interval'); } return leftStartTime < rightEndTime && rightStartTime < leftEndTime; } /***/ }), /***/ "./node_modules/date-fns/esm/closestIndexTo/index.js": /*!***********************************************************!*\ !*** ./node_modules/date-fns/esm/closestIndexTo/index.js ***! \***********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return closestIndexTo; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name closestIndexTo * @category Common Helpers * @summary Return an index of the closest date from the array comparing to the given date. * * @description * Return an index of the closest date from the array comparing to the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * - Now, `closestIndexTo` doesn't throw an exception * when the second argument is not an array, and returns Invalid Date instead. * * @param {Date|Number} dateToCompare - the date to compare with * @param {Date[]|Number[]} datesArray - the array to search * @returns {Number} an index of the date closest to the given date * @throws {TypeError} 2 arguments required * * @example * // Which date is closer to 6 September 2015? * var dateToCompare = new Date(2015, 8, 6) * var datesArray = [ * new Date(2015, 0, 1), * new Date(2016, 0, 1), * new Date(2017, 0, 1) * ] * var result = closestIndexTo(dateToCompare, datesArray) * //=> 1 */ function closestIndexTo(dirtyDateToCompare, dirtyDatesArray) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var dateToCompare = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateToCompare); if (isNaN(dateToCompare)) { return NaN; } var timeToCompare = dateToCompare.getTime(); var datesArray; // `dirtyDatesArray` is undefined or null if (dirtyDatesArray == null) { datesArray = []; // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method } else if (typeof dirtyDatesArray.forEach === 'function') { datesArray = dirtyDatesArray; // If `dirtyDatesArray` is Array-like Object, convert to Array. Otherwise, make it empty Array } else { datesArray = Array.prototype.slice.call(dirtyDatesArray); } var result; var minDistance; datesArray.forEach(function (dirtyDate, index) { var currentDate = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); if (isNaN(currentDate)) { result = NaN; minDistance = NaN; return; } var distance = Math.abs(timeToCompare - currentDate.getTime()); if (result == null || distance < minDistance) { result = index; minDistance = distance; } }); return result; } /***/ }), /***/ "./node_modules/date-fns/esm/closestTo/index.js": /*!******************************************************!*\ !*** ./node_modules/date-fns/esm/closestTo/index.js ***! \******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return closestTo; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name closestTo * @category Common Helpers * @summary Return a date from the array closest to the given date. * * @description * Return a date from the array closest to the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * - Now, `closestTo` doesn't throw an exception * when the second argument is not an array, and returns Invalid Date instead. * * @param {Date|Number} dateToCompare - the date to compare with * @param {Date[]|Number[]} datesArray - the array to search * @returns {Date} the date from the array closest to the given date * @throws {TypeError} 2 arguments required * * @example * // Which date is closer to 6 September 2015: 1 January 2000 or 1 January 2030? * var dateToCompare = new Date(2015, 8, 6) * var result = closestTo(dateToCompare, [ * new Date(2000, 0, 1), * new Date(2030, 0, 1) * ]) * //=> Tue Jan 01 2030 00:00:00 */ function closestTo(dirtyDateToCompare, dirtyDatesArray) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var dateToCompare = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateToCompare); if (isNaN(dateToCompare)) { return new Date(NaN); } var timeToCompare = dateToCompare.getTime(); var datesArray; // `dirtyDatesArray` is undefined or null if (dirtyDatesArray == null) { datesArray = []; // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method } else if (typeof dirtyDatesArray.forEach === 'function') { datesArray = dirtyDatesArray; // If `dirtyDatesArray` is Array-like Object, convert to Array. Otherwise, make it empty Array } else { datesArray = Array.prototype.slice.call(dirtyDatesArray); } var result; var minDistance; datesArray.forEach(function (dirtyDate) { var currentDate = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); if (isNaN(currentDate)) { result = new Date(NaN); minDistance = NaN; return; } var distance = Math.abs(timeToCompare - currentDate.getTime()); if (result == null || distance < minDistance) { result = currentDate; minDistance = distance; } }); return result; } /***/ }), /***/ "./node_modules/date-fns/esm/compareAsc/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/esm/compareAsc/index.js ***! \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return compareAsc; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name compareAsc * @category Common Helpers * @summary Compare the two dates and return -1, 0 or 1. * * @description * Compare the two dates and return 1 if the first date is after the second, * -1 if the first date is before the second or 0 if dates are equal. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the first date to compare * @param {Date|Number} dateRight - the second date to compare * @returns {Number} the result of the comparison * @throws {TypeError} 2 arguments required * * @example * // Compare 11 February 1987 and 10 July 1989: * var result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10)) * //=> -1 * * @example * // Sort the array of dates: * var result = [ * new Date(1995, 6, 2), * new Date(1987, 1, 11), * new Date(1989, 6, 10) * ].sort(compareAsc) * //=> [ * // Wed Feb 11 1987 00:00:00, * // Mon Jul 10 1989 00:00:00, * // Sun Jul 02 1995 00:00:00 * // ] */ function compareAsc(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var dateLeft = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateLeft); var dateRight = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateRight); var diff = dateLeft.getTime() - dateRight.getTime(); if (diff < 0) { return -1; } else if (diff > 0) { return 1; // Return 0 if diff is 0; return NaN if diff is NaN } else { return diff; } } /***/ }), /***/ "./node_modules/date-fns/esm/compareDesc/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/esm/compareDesc/index.js ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return compareDesc; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name compareDesc * @category Common Helpers * @summary Compare the two dates reverse chronologically and return -1, 0 or 1. * * @description * Compare the two dates and return -1 if the first date is after the second, * 1 if the first date is before the second or 0 if dates are equal. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the first date to compare * @param {Date|Number} dateRight - the second date to compare * @returns {Number} the result of the comparison * @throws {TypeError} 2 arguments required * * @example * // Compare 11 February 1987 and 10 July 1989 reverse chronologically: * var result = compareDesc(new Date(1987, 1, 11), new Date(1989, 6, 10)) * //=> 1 * * @example * // Sort the array of dates in reverse chronological order: * var result = [ * new Date(1995, 6, 2), * new Date(1987, 1, 11), * new Date(1989, 6, 10) * ].sort(compareDesc) * //=> [ * // Sun Jul 02 1995 00:00:00, * // Mon Jul 10 1989 00:00:00, * // Wed Feb 11 1987 00:00:00 * // ] */ function compareDesc(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var dateLeft = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateLeft); var dateRight = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateRight); var diff = dateLeft.getTime() - dateRight.getTime(); if (diff > 0) { return -1; } else if (diff < 0) { return 1; // Return 0 if diff is 0; return NaN if diff is NaN } else { return diff; } } /***/ }), /***/ "./node_modules/date-fns/esm/differenceInCalendarDays/index.js": /*!*********************************************************************!*\ !*** ./node_modules/date-fns/esm/differenceInCalendarDays/index.js ***! \*********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return differenceInCalendarDays; }); /* harmony import */ var _lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/getTimezoneOffsetInMilliseconds/index.js */ "./node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js"); /* harmony import */ var _startOfDay_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../startOfDay/index.js */ "./node_modules/date-fns/esm/startOfDay/index.js"); var MILLISECONDS_IN_DAY = 86400000; /** * @name differenceInCalendarDays * @category Day Helpers * @summary Get the number of calendar days between the given dates. * * @description * Get the number of calendar days between the given dates. This means that the times are removed * from the dates and then the difference in days is calculated. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the later date * @param {Date|Number} dateRight - the earlier date * @returns {Number} the number of calendar days * @throws {TypeError} 2 arguments required * * @example * // How many calendar days are between * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00? * var result = differenceInCalendarDays( * new Date(2012, 6, 2, 0, 0), * new Date(2011, 6, 2, 23, 0) * ) * //=> 366 * // How many calendar days are between * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00? * var result = differenceInCalendarDays( * new Date(2011, 6, 2, 0, 1), * new Date(2011, 6, 2, 23, 59) * ) * //=> 1 */ function differenceInCalendarDays(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var startOfDayLeft = Object(_startOfDay_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDateLeft); var startOfDayRight = Object(_startOfDay_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDateRight); var timestampLeft = startOfDayLeft.getTime() - Object(_lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(startOfDayLeft); var timestampRight = startOfDayRight.getTime() - Object(_lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(startOfDayRight); // Round the number of days to the nearest integer // because the number of milliseconds in a day is not constant // (e.g. it's different in the day of the daylight saving time clock shift) return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY); } /***/ }), /***/ "./node_modules/date-fns/esm/differenceInCalendarISOWeekYears/index.js": /*!*****************************************************************************!*\ !*** ./node_modules/date-fns/esm/differenceInCalendarISOWeekYears/index.js ***! \*****************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return differenceInCalendarISOWeekYears; }); /* harmony import */ var _getISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../getISOWeekYear/index.js */ "./node_modules/date-fns/esm/getISOWeekYear/index.js"); /** * @name differenceInCalendarISOWeekYears * @category ISO Week-Numbering Year Helpers * @summary Get the number of calendar ISO week-numbering years between the given dates. * * @description * Get the number of calendar ISO week-numbering years between the given dates. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * - The function was renamed from `differenceInCalendarISOYears` to `differenceInCalendarISOWeekYears`. * "ISO week year" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date). * This change makes the name consistent with * locale-dependent week-numbering year helpers, e.g., `addWeekYears`. * * @param {Date|Number} dateLeft - the later date * @param {Date|Number} dateRight - the earlier date * @returns {Number} the number of calendar ISO week-numbering years * @throws {TypeError} 2 arguments required * * @example * // How many calendar ISO week-numbering years are 1 January 2010 and 1 January 2012? * var result = differenceInCalendarISOWeekYears( * new Date(2012, 0, 1), * new Date(2010, 0, 1) * ) * //=> 2 */ function differenceInCalendarISOWeekYears(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } return Object(_getISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateLeft) - Object(_getISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateRight); } /***/ }), /***/ "./node_modules/date-fns/esm/differenceInCalendarISOWeeks/index.js": /*!*************************************************************************!*\ !*** ./node_modules/date-fns/esm/differenceInCalendarISOWeeks/index.js ***! \*************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return differenceInCalendarISOWeeks; }); /* harmony import */ var _lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/getTimezoneOffsetInMilliseconds/index.js */ "./node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js"); /* harmony import */ var _startOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../startOfISOWeek/index.js */ "./node_modules/date-fns/esm/startOfISOWeek/index.js"); var MILLISECONDS_IN_WEEK = 604800000; /** * @name differenceInCalendarISOWeeks * @category ISO Week Helpers * @summary Get the number of calendar ISO weeks between the given dates. * * @description * Get the number of calendar ISO weeks between the given dates. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the later date * @param {Date|Number} dateRight - the earlier date * @returns {Number} the number of calendar ISO weeks * @throws {TypeError} 2 arguments required * * @example * // How many calendar ISO weeks are between 6 July 2014 and 21 July 2014? * var result = differenceInCalendarISOWeeks( * new Date(2014, 6, 21), * new Date(2014, 6, 6) * ) * //=> 3 */ function differenceInCalendarISOWeeks(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var startOfISOWeekLeft = Object(_startOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDateLeft); var startOfISOWeekRight = Object(_startOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDateRight); var timestampLeft = startOfISOWeekLeft.getTime() - Object(_lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(startOfISOWeekLeft); var timestampRight = startOfISOWeekRight.getTime() - Object(_lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(startOfISOWeekRight); // Round the number of days to the nearest integer // because the number of milliseconds in a week is not constant // (e.g. it's different in the week of the daylight saving time clock shift) return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_WEEK); } /***/ }), /***/ "./node_modules/date-fns/esm/differenceInCalendarMonths/index.js": /*!***********************************************************************!*\ !*** ./node_modules/date-fns/esm/differenceInCalendarMonths/index.js ***! \***********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return differenceInCalendarMonths; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name differenceInCalendarMonths * @category Month Helpers * @summary Get the number of calendar months between the given dates. * * @description * Get the number of calendar months between the given dates. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the later date * @param {Date|Number} dateRight - the earlier date * @returns {Number} the number of calendar months * @throws {TypeError} 2 arguments required * * @example * // How many calendar months are between 31 January 2014 and 1 September 2014? * var result = differenceInCalendarMonths( * new Date(2014, 8, 1), * new Date(2014, 0, 31) * ) * //=> 8 */ function differenceInCalendarMonths(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var dateLeft = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateLeft); var dateRight = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateRight); var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear(); var monthDiff = dateLeft.getMonth() - dateRight.getMonth(); return yearDiff * 12 + monthDiff; } /***/ }), /***/ "./node_modules/date-fns/esm/differenceInCalendarQuarters/index.js": /*!*************************************************************************!*\ !*** ./node_modules/date-fns/esm/differenceInCalendarQuarters/index.js ***! \*************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return differenceInCalendarQuarters; }); /* harmony import */ var _getQuarter_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../getQuarter/index.js */ "./node_modules/date-fns/esm/getQuarter/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name differenceInCalendarQuarters * @category Quarter Helpers * @summary Get the number of calendar quarters between the given dates. * * @description * Get the number of calendar quarters between the given dates. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the later date * @param {Date|Number} dateRight - the earlier date * @returns {Number} the number of calendar quarters * @throws {TypeError} 2 arguments required * * @example * // How many calendar quarters are between 31 December 2013 and 2 July 2014? * var result = differenceInCalendarQuarters( * new Date(2014, 6, 2), * new Date(2013, 11, 31) * ) * //=> 3 */ function differenceInCalendarQuarters(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var dateLeft = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDateLeft); var dateRight = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDateRight); var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear(); var quarterDiff = Object(_getQuarter_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dateLeft) - Object(_getQuarter_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dateRight); return yearDiff * 4 + quarterDiff; } /***/ }), /***/ "./node_modules/date-fns/esm/differenceInCalendarWeeks/index.js": /*!**********************************************************************!*\ !*** ./node_modules/date-fns/esm/differenceInCalendarWeeks/index.js ***! \**********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return differenceInCalendarWeeks; }); /* harmony import */ var _lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/getTimezoneOffsetInMilliseconds/index.js */ "./node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js"); /* harmony import */ var _startOfWeek_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../startOfWeek/index.js */ "./node_modules/date-fns/esm/startOfWeek/index.js"); var MILLISECONDS_IN_WEEK = 604800000; /** * @name differenceInCalendarWeeks * @category Week Helpers * @summary Get the number of calendar weeks between the given dates. * * @description * Get the number of calendar weeks between the given dates. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the later date * @param {Date|Number} dateRight - the earlier date * @param {Object} [options] - an object with options. * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} * @returns {Number} the number of calendar weeks * @throws {TypeError} 2 arguments required * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 * * @example * // How many calendar weeks are between 5 July 2014 and 20 July 2014? * var result = differenceInCalendarWeeks( * new Date(2014, 6, 20), * new Date(2014, 6, 5) * ) * //=> 3 * * @example * // If the week starts on Monday, * // how many calendar weeks are between 5 July 2014 and 20 July 2014? * var result = differenceInCalendarWeeks( * new Date(2014, 6, 20), * new Date(2014, 6, 5), * { weekStartsOn: 1 } * ) * //=> 2 */ function differenceInCalendarWeeks(dirtyDateLeft, dirtyDateRight, dirtyOptions) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var startOfWeekLeft = Object(_startOfWeek_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDateLeft, dirtyOptions); var startOfWeekRight = Object(_startOfWeek_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDateRight, dirtyOptions); var timestampLeft = startOfWeekLeft.getTime() - Object(_lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(startOfWeekLeft); var timestampRight = startOfWeekRight.getTime() - Object(_lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(startOfWeekRight); // Round the number of days to the nearest integer // because the number of milliseconds in a week is not constant // (e.g. it's different in the week of the daylight saving time clock shift) return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_WEEK); } /***/ }), /***/ "./node_modules/date-fns/esm/differenceInCalendarYears/index.js": /*!**********************************************************************!*\ !*** ./node_modules/date-fns/esm/differenceInCalendarYears/index.js ***! \**********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return differenceInCalendarYears; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name differenceInCalendarYears * @category Year Helpers * @summary Get the number of calendar years between the given dates. * * @description * Get the number of calendar years between the given dates. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the later date * @param {Date|Number} dateRight - the earlier date * @returns {Number} the number of calendar years * @throws {TypeError} 2 arguments required * * @example * // How many calendar years are between 31 December 2013 and 11 February 2015? * var result = differenceInCalendarYears( * new Date(2015, 1, 11), * new Date(2013, 11, 31) * ) * //=> 2 */ function differenceInCalendarYears(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var dateLeft = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateLeft); var dateRight = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateRight); return dateLeft.getFullYear() - dateRight.getFullYear(); } /***/ }), /***/ "./node_modules/date-fns/esm/differenceInDays/index.js": /*!*************************************************************!*\ !*** ./node_modules/date-fns/esm/differenceInDays/index.js ***! \*************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return differenceInDays; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _differenceInCalendarDays_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../differenceInCalendarDays/index.js */ "./node_modules/date-fns/esm/differenceInCalendarDays/index.js"); /* harmony import */ var _compareAsc_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../compareAsc/index.js */ "./node_modules/date-fns/esm/compareAsc/index.js"); /** * @name differenceInDays * @category Day Helpers * @summary Get the number of full days between the given dates. * * @description * Get the number of full day periods between the given dates. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the later date * @param {Date|Number} dateRight - the earlier date * @returns {Number} the number of full days * @throws {TypeError} 2 arguments required * * @example * // How many full days are between * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00? * var result = differenceInDays( * new Date(2012, 6, 2, 0, 0), * new Date(2011, 6, 2, 23, 0) * ) * //=> 365 * // How many days are between * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00? * var result = differenceInDays( * new Date(2011, 6, 2, 0, 1), * new Date(2011, 6, 2, 23, 59) * ) * //=> 0 */ function differenceInDays(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var dateLeft = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateLeft); var dateRight = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateRight); var sign = Object(_compareAsc_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(dateLeft, dateRight); var difference = Math.abs(Object(_differenceInCalendarDays_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dateLeft, dateRight)); dateLeft.setDate(dateLeft.getDate() - sign * difference); // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full // If so, result must be decreased by 1 in absolute value var isLastDayNotFull = Object(_compareAsc_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(dateLeft, dateRight) === -sign; var result = sign * (difference - isLastDayNotFull); // Prevent negative zero return result === 0 ? 0 : result; } /***/ }), /***/ "./node_modules/date-fns/esm/differenceInHours/index.js": /*!**************************************************************!*\ !*** ./node_modules/date-fns/esm/differenceInHours/index.js ***! \**************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return differenceInHours; }); /* harmony import */ var _differenceInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../differenceInMilliseconds/index.js */ "./node_modules/date-fns/esm/differenceInMilliseconds/index.js"); var MILLISECONDS_IN_HOUR = 3600000; /** * @name differenceInHours * @category Hour Helpers * @summary Get the number of hours between the given dates. * * @description * Get the number of hours between the given dates. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the later date * @param {Date|Number} dateRight - the earlier date * @returns {Number} the number of hours * @throws {TypeError} 2 arguments required * * @example * // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00? * var result = differenceInHours( * new Date(2014, 6, 2, 19, 0), * new Date(2014, 6, 2, 6, 50) * ) * //=> 12 */ function differenceInHours(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var diff = Object(_differenceInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateLeft, dirtyDateRight) / MILLISECONDS_IN_HOUR; return diff > 0 ? Math.floor(diff) : Math.ceil(diff); } /***/ }), /***/ "./node_modules/date-fns/esm/differenceInISOWeekYears/index.js": /*!*********************************************************************!*\ !*** ./node_modules/date-fns/esm/differenceInISOWeekYears/index.js ***! \*********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return differenceInISOWeekYears; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _differenceInCalendarISOWeekYears_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../differenceInCalendarISOWeekYears/index.js */ "./node_modules/date-fns/esm/differenceInCalendarISOWeekYears/index.js"); /* harmony import */ var _compareAsc_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../compareAsc/index.js */ "./node_modules/date-fns/esm/compareAsc/index.js"); /* harmony import */ var _subISOWeekYears_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../subISOWeekYears/index.js */ "./node_modules/date-fns/esm/subISOWeekYears/index.js"); /** * @name differenceInISOWeekYears * @category ISO Week-Numbering Year Helpers * @summary Get the number of full ISO week-numbering years between the given dates. * * @description * Get the number of full ISO week-numbering years between the given dates. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * - The function was renamed from `differenceInISOYears` to `differenceInISOWeekYears`. * "ISO week year" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date). * This change makes the name consistent with * locale-dependent week-numbering year helpers, e.g., `addWeekYears`. * * @param {Date|Number} dateLeft - the later date * @param {Date|Number} dateRight - the earlier date * @returns {Number} the number of full ISO week-numbering years * @throws {TypeError} 2 arguments required * * @example * // How many full ISO week-numbering years are between 1 January 2010 and 1 January 2012? * var result = differenceInISOWeekYears( * new Date(2012, 0, 1), * new Date(2010, 0, 1) * ) * //=> 1 */ function differenceInISOWeekYears(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var dateLeft = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateLeft); var dateRight = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateRight); var sign = Object(_compareAsc_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(dateLeft, dateRight); var difference = Math.abs(Object(_differenceInCalendarISOWeekYears_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dateLeft, dateRight)); dateLeft = Object(_subISOWeekYears_index_js__WEBPACK_IMPORTED_MODULE_3__["default"])(dateLeft, sign * difference); // Math.abs(diff in full ISO years - diff in calendar ISO years) === 1 // if last calendar ISO year is not full // If so, result must be decreased by 1 in absolute value var isLastISOWeekYearNotFull = Object(_compareAsc_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(dateLeft, dateRight) === -sign; var result = sign * (difference - isLastISOWeekYearNotFull); // Prevent negative zero return result === 0 ? 0 : result; } /***/ }), /***/ "./node_modules/date-fns/esm/differenceInMilliseconds/index.js": /*!*********************************************************************!*\ !*** ./node_modules/date-fns/esm/differenceInMilliseconds/index.js ***! \*********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return differenceInMilliseconds; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name differenceInMilliseconds * @category Millisecond Helpers * @summary Get the number of milliseconds between the given dates. * * @description * Get the number of milliseconds between the given dates. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the later date * @param {Date|Number} dateRight - the earlier date * @returns {Number} the number of milliseconds * @throws {TypeError} 2 arguments required * * @example * // How many milliseconds are between * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700? * var result = differenceInMilliseconds( * new Date(2014, 6, 2, 12, 30, 21, 700), * new Date(2014, 6, 2, 12, 30, 20, 600) * ) * //=> 1100 */ function differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var dateLeft = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateLeft); var dateRight = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateRight); return dateLeft.getTime() - dateRight.getTime(); } /***/ }), /***/ "./node_modules/date-fns/esm/differenceInMinutes/index.js": /*!****************************************************************!*\ !*** ./node_modules/date-fns/esm/differenceInMinutes/index.js ***! \****************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return differenceInMinutes; }); /* harmony import */ var _differenceInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../differenceInMilliseconds/index.js */ "./node_modules/date-fns/esm/differenceInMilliseconds/index.js"); var MILLISECONDS_IN_MINUTE = 60000; /** * @name differenceInMinutes * @category Minute Helpers * @summary Get the number of minutes between the given dates. * * @description * Get the number of minutes between the given dates. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the later date * @param {Date|Number} dateRight - the earlier date * @returns {Number} the number of minutes * @throws {TypeError} 2 arguments required * * @example * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00? * var result = differenceInMinutes( * new Date(2014, 6, 2, 12, 20, 0), * new Date(2014, 6, 2, 12, 7, 59) * ) * //=> 12 */ function differenceInMinutes(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var diff = Object(_differenceInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateLeft, dirtyDateRight) / MILLISECONDS_IN_MINUTE; return diff > 0 ? Math.floor(diff) : Math.ceil(diff); } /***/ }), /***/ "./node_modules/date-fns/esm/differenceInMonths/index.js": /*!***************************************************************!*\ !*** ./node_modules/date-fns/esm/differenceInMonths/index.js ***! \***************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return differenceInMonths; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _differenceInCalendarMonths_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../differenceInCalendarMonths/index.js */ "./node_modules/date-fns/esm/differenceInCalendarMonths/index.js"); /* harmony import */ var _compareAsc_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../compareAsc/index.js */ "./node_modules/date-fns/esm/compareAsc/index.js"); /** * @name differenceInMonths * @category Month Helpers * @summary Get the number of full months between the given dates. * * @description * Get the number of full months between the given dates. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the later date * @param {Date|Number} dateRight - the earlier date * @returns {Number} the number of full months * @throws {TypeError} 2 arguments required * * @example * // How many full months are between 31 January 2014 and 1 September 2014? * var result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31)) * //=> 7 */ function differenceInMonths(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var dateLeft = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateLeft); var dateRight = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateRight); var sign = Object(_compareAsc_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(dateLeft, dateRight); var difference = Math.abs(Object(_differenceInCalendarMonths_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dateLeft, dateRight)); dateLeft.setMonth(dateLeft.getMonth() - sign * difference); // Math.abs(diff in full months - diff in calendar months) === 1 if last calendar month is not full // If so, result must be decreased by 1 in absolute value var isLastMonthNotFull = Object(_compareAsc_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(dateLeft, dateRight) === -sign; var result = sign * (difference - isLastMonthNotFull); // Prevent negative zero return result === 0 ? 0 : result; } /***/ }), /***/ "./node_modules/date-fns/esm/differenceInQuarters/index.js": /*!*****************************************************************!*\ !*** ./node_modules/date-fns/esm/differenceInQuarters/index.js ***! \*****************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return differenceInQuarters; }); /* harmony import */ var _differenceInMonths_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../differenceInMonths/index.js */ "./node_modules/date-fns/esm/differenceInMonths/index.js"); /** * @name differenceInQuarters * @category Quarter Helpers * @summary Get the number of full quarters between the given dates. * * @description * Get the number of full quarters between the given dates. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the later date * @param {Date|Number} dateRight - the earlier date * @returns {Number} the number of full quarters * @throws {TypeError} 2 arguments required * * @example * // How many full quarters are between 31 December 2013 and 2 July 2014? * var result = differenceInQuarters(new Date(2014, 6, 2), new Date(2013, 11, 31)) * //=> 2 */ function differenceInQuarters(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var diff = Object(_differenceInMonths_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateLeft, dirtyDateRight) / 3; return diff > 0 ? Math.floor(diff) : Math.ceil(diff); } /***/ }), /***/ "./node_modules/date-fns/esm/differenceInSeconds/index.js": /*!****************************************************************!*\ !*** ./node_modules/date-fns/esm/differenceInSeconds/index.js ***! \****************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return differenceInSeconds; }); /* harmony import */ var _differenceInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../differenceInMilliseconds/index.js */ "./node_modules/date-fns/esm/differenceInMilliseconds/index.js"); /** * @name differenceInSeconds * @category Second Helpers * @summary Get the number of seconds between the given dates. * * @description * Get the number of seconds between the given dates. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the later date * @param {Date|Number} dateRight - the earlier date * @returns {Number} the number of seconds * @throws {TypeError} 2 arguments required * * @example * // How many seconds are between * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000? * var result = differenceInSeconds( * new Date(2014, 6, 2, 12, 30, 20, 0), * new Date(2014, 6, 2, 12, 30, 7, 999) * ) * //=> 12 */ function differenceInSeconds(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var diff = Object(_differenceInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateLeft, dirtyDateRight) / 1000; return diff > 0 ? Math.floor(diff) : Math.ceil(diff); } /***/ }), /***/ "./node_modules/date-fns/esm/differenceInWeeks/index.js": /*!**************************************************************!*\ !*** ./node_modules/date-fns/esm/differenceInWeeks/index.js ***! \**************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return differenceInWeeks; }); /* harmony import */ var _differenceInDays_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../differenceInDays/index.js */ "./node_modules/date-fns/esm/differenceInDays/index.js"); /** * @name differenceInWeeks * @category Week Helpers * @summary Get the number of full weeks between the given dates. * * @description * Get the number of full weeks between the given dates. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the later date * @param {Date|Number} dateRight - the earlier date * @returns {Number} the number of full weeks * @throws {TypeError} 2 arguments required * * @example * // How many full weeks are between 5 July 2014 and 20 July 2014? * var result = differenceInWeeks(new Date(2014, 6, 20), new Date(2014, 6, 5)) * //=> 2 */ function differenceInWeeks(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var diff = Object(_differenceInDays_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateLeft, dirtyDateRight) / 7; return diff > 0 ? Math.floor(diff) : Math.ceil(diff); } /***/ }), /***/ "./node_modules/date-fns/esm/differenceInYears/index.js": /*!**************************************************************!*\ !*** ./node_modules/date-fns/esm/differenceInYears/index.js ***! \**************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return differenceInYears; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _differenceInCalendarYears_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../differenceInCalendarYears/index.js */ "./node_modules/date-fns/esm/differenceInCalendarYears/index.js"); /* harmony import */ var _compareAsc_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../compareAsc/index.js */ "./node_modules/date-fns/esm/compareAsc/index.js"); /** * @name differenceInYears * @category Year Helpers * @summary Get the number of full years between the given dates. * * @description * Get the number of full years between the given dates. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the later date * @param {Date|Number} dateRight - the earlier date * @returns {Number} the number of full years * @throws {TypeError} 2 arguments required * * @example * // How many full years are between 31 December 2013 and 11 February 2015? * var result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31)) * //=> 1 */ function differenceInYears(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var dateLeft = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateLeft); var dateRight = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateRight); var sign = Object(_compareAsc_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(dateLeft, dateRight); var difference = Math.abs(Object(_differenceInCalendarYears_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dateLeft, dateRight)); dateLeft.setFullYear(dateLeft.getFullYear() - sign * difference); // Math.abs(diff in full years - diff in calendar years) === 1 if last calendar year is not full // If so, result must be decreased by 1 in absolute value var isLastYearNotFull = Object(_compareAsc_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(dateLeft, dateRight) === -sign; var result = sign * (difference - isLastYearNotFull); // Prevent negative zero return result === 0 ? 0 : result; } /***/ }), /***/ "./node_modules/date-fns/esm/eachDayOfInterval/index.js": /*!**************************************************************!*\ !*** ./node_modules/date-fns/esm/eachDayOfInterval/index.js ***! \**************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return eachDayOfInterval; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name eachDayOfInterval * @category Interval Helpers * @summary Return the array of dates within the specified time interval. * * @description * Return the array of dates within the specified time interval. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * - The function was renamed from `eachDay` to `eachDayOfInterval`. * This change was made to mirror the use of the word "interval" in standard ISO 8601:2004 terminology: * * ``` * 2.1.3 * time interval * part of the time axis limited by two instants * ``` * * Also, this function now accepts an object with `start` and `end` properties * instead of two arguments as an interval. * This function now throws `RangeError` if the start of the interval is after its end * or if any date in the interval is `Invalid Date`. * * ```javascript * // Before v2.0.0 * * eachDay(new Date(2014, 0, 10), new Date(2014, 0, 20)) * * // v2.0.0 onward * * eachDayOfInterval( * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) } * ) * ``` * * @param {Interval} interval - the interval. See [Interval]{@link docs/types/Interval} * @param {Object} [options] - an object with options. * @param {Number} [options.step=1] - the step to increment by. The value should be more than 1. * @returns {Date[]} the array with starts of days from the day of the interval start to the day of the interval end * @throws {TypeError} 1 argument required * @throws {RangeError} `options.step` must be a number greater than 1 * @throws {RangeError} The start of an interval cannot be after its end * @throws {RangeError} Date in interval cannot be `Invalid Date` * * @example * // Each day between 6 October 2014 and 10 October 2014: * var result = eachDayOfInterval({ * start: new Date(2014, 9, 6), * end: new Date(2014, 9, 10) * }) * //=> [ * // Mon Oct 06 2014 00:00:00, * // Tue Oct 07 2014 00:00:00, * // Wed Oct 08 2014 00:00:00, * // Thu Oct 09 2014 00:00:00, * // Fri Oct 10 2014 00:00:00 * // ] */ function eachDayOfInterval(dirtyInterval, options) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var interval = dirtyInterval || {}; var startDate = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(interval.start); var endDate = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(interval.end); var endTime = endDate.getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date` if (!(startDate.getTime() <= endTime)) { throw new RangeError('Invalid interval'); } var dates = []; var currentDate = startDate; currentDate.setHours(0, 0, 0, 0); var step = options && 'step' in options ? Number(options.step) : 1; if (step < 1 || isNaN(step)) throw new RangeError('`options.step` must be a number greater than 1'); while (currentDate.getTime() <= endTime) { dates.push(Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(currentDate)); currentDate.setDate(currentDate.getDate() + step); currentDate.setHours(0, 0, 0, 0); } return dates; } /***/ }), /***/ "./node_modules/date-fns/esm/eachWeekOfInterval/index.js": /*!***************************************************************!*\ !*** ./node_modules/date-fns/esm/eachWeekOfInterval/index.js ***! \***************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return eachWeekOfInterval; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _startOfWeek_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../startOfWeek/index.js */ "./node_modules/date-fns/esm/startOfWeek/index.js"); /* harmony import */ var _addWeeks_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../addWeeks/index.js */ "./node_modules/date-fns/esm/addWeeks/index.js"); /** * @name eachWeekOfInterval * @category Interval Helpers * @summary Return the array of weeks within the specified time interval. * * @description * Return the array of weeks within the specified time interval. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Interval} interval - the interval. See [Interval]{@link docs/types/Interval} * @param {Object} [options] - an object with options. * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) * @returns {Date[]} the array with starts of weeks from the week of the interval start to the week of the interval end * @throws {TypeError} 1 argument required * @throws {RangeError} `options.weekStartsOn` must be 0, 1, ..., 6 * @throws {RangeError} The start of an interval cannot be after its end * @throws {RangeError} Date in interval cannot be `Invalid Date` * * @example * // Each week within interval 6 October 2014 - 23 November 2014: * var result = eachWeekOfInterval({ * start: new Date(2014, 9, 6), * end: new Date(2014, 10, 23) * }) * //=> [ * // Sun Oct 05 2014 00:00:00, * // Sun Oct 12 2014 00:00:00, * // Sun Oct 19 2014 00:00:00, * // Sun Oct 26 2014 00:00:00, * // Sun Nov 02 2014 00:00:00, * // Sun Nov 09 2014 00:00:00, * // Sun Nov 16 2014 00:00:00, * // Sun Nov 23 2014 00:00:00 * // ] */ function eachWeekOfInterval(dirtyInterval, options) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var interval = dirtyInterval || {}; var startDate = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(interval.start); var endDate = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(interval.end); var endTime = endDate.getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date` if (!(startDate.getTime() <= endTime)) { throw new RangeError('Invalid interval'); } var startDateWeek = Object(_startOfWeek_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(startDate, options); var endDateWeek = Object(_startOfWeek_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(endDate, options); // Some timezones switch DST at midnight, making start of day unreliable in these timezones, 3pm is a safe bet startDateWeek.setHours(15); endDateWeek.setHours(15); endTime = endDateWeek.getTime(); var weeks = []; var currentWeek = startDateWeek; while (currentWeek.getTime() <= endTime) { currentWeek.setHours(0); weeks.push(Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(currentWeek)); currentWeek = Object(_addWeeks_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(currentWeek, 1); currentWeek.setHours(15); } return weeks; } /***/ }), /***/ "./node_modules/date-fns/esm/eachWeekendOfInterval/index.js": /*!******************************************************************!*\ !*** ./node_modules/date-fns/esm/eachWeekendOfInterval/index.js ***! \******************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return eachWeekendOfInterval; }); /* harmony import */ var _eachDayOfInterval_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../eachDayOfInterval/index.js */ "./node_modules/date-fns/esm/eachDayOfInterval/index.js"); /* harmony import */ var _isSunday_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../isSunday/index.js */ "./node_modules/date-fns/esm/isSunday/index.js"); /* harmony import */ var _isWeekend_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../isWeekend/index.js */ "./node_modules/date-fns/esm/isWeekend/index.js"); /** * @name eachWeekendOfInterval * @category Interval Helpers * @summary List all the Saturdays and Sundays in the given date interval. * * @description * Get all the Saturdays and Sundays in the given date interval. * * @param {Interval} interval - the given interval. See [Interval]{@link docs/types/Interval} * @returns {Date[]} an array containing all the Saturdays and Sundays * @throws {TypeError} 1 argument required * @throws {RangeError} The start of an interval cannot be after its end * @throws {RangeError} Date in interval cannot be `Invalid Date` * * @example * // Lists all Saturdays and Sundays in the given date interval * var result = eachWeekendOfInterval({ * start: new Date(2018, 8, 17), * end: new Date(2018, 8, 30) * }) * //=> [ * // Sat Sep 22 2018 00:00:00, * // Sun Sep 23 2018 00:00:00, * // Sat Sep 29 2018 00:00:00, * // Sun Sep 30 2018 00:00:00 * // ] */ function eachWeekendOfInterval(interval) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var dateInterval = Object(_eachDayOfInterval_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(interval); var weekends = []; var index = 0; while (index++ < dateInterval.length) { var date = dateInterval[index]; if (Object(_isWeekend_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(date)) { weekends.push(date); if (Object(_isSunday_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(date)) index = index + 5; } } return weekends; } /***/ }), /***/ "./node_modules/date-fns/esm/eachWeekendOfMonth/index.js": /*!***************************************************************!*\ !*** ./node_modules/date-fns/esm/eachWeekendOfMonth/index.js ***! \***************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return eachWeekendOfMonth; }); /* harmony import */ var _eachWeekendOfInterval_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../eachWeekendOfInterval/index.js */ "./node_modules/date-fns/esm/eachWeekendOfInterval/index.js"); /* harmony import */ var _startOfMonth_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../startOfMonth/index.js */ "./node_modules/date-fns/esm/startOfMonth/index.js"); /* harmony import */ var _endOfMonth_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../endOfMonth/index.js */ "./node_modules/date-fns/esm/endOfMonth/index.js"); /** * @name eachWeekendOfMonth * @category Month Helpers * @summary List all the Saturdays and Sundays in the given month. * * @description * Get all the Saturdays and Sundays in the given month. * * @param {Date|Number} date - the given month * @returns {Date[]} an array containing all the Saturdays and Sundays * @throws {TypeError} 1 argument required * @throws {RangeError} The passed date is invalid * * @example * // Lists all Saturdays and Sundays in the given month * var result = eachWeekendOfMonth(new Date(2022, 1, 1)) * //=> [ * // Sat Feb 05 2022 00:00:00, * // Sun Feb 06 2022 00:00:00, * // Sat Feb 12 2022 00:00:00, * // Sun Feb 13 2022 00:00:00, * // Sat Feb 19 2022 00:00:00, * // Sun Feb 20 2022 00:00:00, * // Sat Feb 26 2022 00:00:00, * // Sun Feb 27 2022 00:00:00 * // ] */ function eachWeekendOfMonth(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 arguments required, but only ' + arguments.length + ' present'); } var startDate = Object(_startOfMonth_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); if (isNaN(startDate)) throw new RangeError('The passed date is invalid'); var endDate = Object(_endOfMonth_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(dirtyDate); return Object(_eachWeekendOfInterval_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ start: startDate, end: endDate }); } /***/ }), /***/ "./node_modules/date-fns/esm/eachWeekendOfYear/index.js": /*!**************************************************************!*\ !*** ./node_modules/date-fns/esm/eachWeekendOfYear/index.js ***! \**************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return eachWeekendOfYear; }); /* harmony import */ var _eachWeekendOfInterval_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../eachWeekendOfInterval/index.js */ "./node_modules/date-fns/esm/eachWeekendOfInterval/index.js"); /* harmony import */ var _startOfYear_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../startOfYear/index.js */ "./node_modules/date-fns/esm/startOfYear/index.js"); /* harmony import */ var _endOfYear_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../endOfYear/index.js */ "./node_modules/date-fns/esm/endOfYear/index.js"); /** * @name eachWeekendOfYear * @category Year Helpers * @summary List all the Saturdays and Sundays in the year. * * @description * Get all the Saturdays and Sundays in the year. * * @param {Date|Number} date - the given year * @returns {Date[]} an array containing all the Saturdays and Sundays * @throws {TypeError} 1 argument required * @throws {RangeError} The passed date is invalid * * @example * // Lists all Saturdays and Sundays in the year * var result = eachWeekendOfYear(new Date(2020, 1, 1)) * //=> [ * // Sat Jan 03 2020 00:00:00, * // Sun Jan 04 2020 00:00:00, * // ... * // Sun Dec 27 2020 00:00:00 * // ] * ] */ function eachWeekendOfYear(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 arguments required, but only ' + arguments.length + ' present'); } var startDate = Object(_startOfYear_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); if (isNaN(startDate)) throw new RangeError('The passed date is invalid'); var endDate = Object(_endOfYear_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(dirtyDate); return Object(_eachWeekendOfInterval_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ start: startDate, end: endDate }); } /***/ }), /***/ "./node_modules/date-fns/esm/endOfDay/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/esm/endOfDay/index.js ***! \*****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return endOfDay; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name endOfDay * @category Day Helpers * @summary Return the end of a day for the given date. * * @description * Return the end of a day for the given date. * The result will be in the local timezone. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @returns {Date} the end of a day * @throws {TypeError} 1 argument required * * @example * // The end of a day for 2 September 2014 11:55:00: * var result = endOfDay(new Date(2014, 8, 2, 11, 55, 0)) * //=> Tue Sep 02 2014 23:59:59.999 */ function endOfDay(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); date.setHours(23, 59, 59, 999); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/endOfDecade/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/esm/endOfDecade/index.js ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return endOfDecade; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name endOfDecade * @category Decade Helpers * @summary Return the end of a decade for the given date. * * @description * Return the end of a decade for the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @returns {Date} the end of a decade * @param {Object} [options] - an object with options. * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} * @throws {TypeError} 1 argument required * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 * * @example * // The end of a decade for 12 May 1984 00:00:00: * var result = endOfDecade(new Date(1984, 4, 12, 00, 00, 00)) * //=> Dec 31 1989 23:59:59.999 */ function endOfDecade(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var year = date.getFullYear(); var decade = 9 + Math.floor(year / 10) * 10; date.setFullYear(decade, 11, 31); date.setHours(23, 59, 59, 999); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/endOfHour/index.js": /*!******************************************************!*\ !*** ./node_modules/date-fns/esm/endOfHour/index.js ***! \******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return endOfHour; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name endOfHour * @category Hour Helpers * @summary Return the end of an hour for the given date. * * @description * Return the end of an hour for the given date. * The result will be in the local timezone. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @returns {Date} the end of an hour * @throws {TypeError} 1 argument required * * @example * // The end of an hour for 2 September 2014 11:55:00: * var result = endOfHour(new Date(2014, 8, 2, 11, 55)) * //=> Tue Sep 02 2014 11:59:59.999 */ function endOfHour(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); date.setMinutes(59, 59, 999); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/endOfISOWeek/index.js": /*!*********************************************************!*\ !*** ./node_modules/date-fns/esm/endOfISOWeek/index.js ***! \*********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return endOfISOWeek; }); /* harmony import */ var _endOfWeek_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../endOfWeek/index.js */ "./node_modules/date-fns/esm/endOfWeek/index.js"); /** * @name endOfISOWeek * @category ISO Week Helpers * @summary Return the end of an ISO week for the given date. * * @description * Return the end of an ISO week for the given date. * The result will be in the local timezone. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @returns {Date} the end of an ISO week * @throws {TypeError} 1 argument required * * @example * // The end of an ISO week for 2 September 2014 11:55:00: * var result = endOfISOWeek(new Date(2014, 8, 2, 11, 55, 0)) * //=> Sun Sep 07 2014 23:59:59.999 */ function endOfISOWeek(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } return Object(_endOfWeek_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate, { weekStartsOn: 1 }); } /***/ }), /***/ "./node_modules/date-fns/esm/endOfISOWeekYear/index.js": /*!*************************************************************!*\ !*** ./node_modules/date-fns/esm/endOfISOWeekYear/index.js ***! \*************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return endOfISOWeekYear; }); /* harmony import */ var _getISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../getISOWeekYear/index.js */ "./node_modules/date-fns/esm/getISOWeekYear/index.js"); /* harmony import */ var _startOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../startOfISOWeek/index.js */ "./node_modules/date-fns/esm/startOfISOWeek/index.js"); /** * @name endOfISOWeekYear * @category ISO Week-Numbering Year Helpers * @summary Return the end of an ISO week-numbering year for the given date. * * @description * Return the end of an ISO week-numbering year, * which always starts 3 days before the year's first Thursday. * The result will be in the local timezone. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * - The function was renamed from `endOfISOYear` to `endOfISOWeekYear`. * "ISO week year" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date). * This change makes the name consistent with * locale-dependent week-numbering year helpers, e.g., `addWeekYears`. * * @param {Date|Number} date - the original date * @returns {Date} the end of an ISO week-numbering year * @throws {TypeError} 1 argument required * * @example * // The end of an ISO week-numbering year for 2 July 2005: * var result = endOfISOWeekYear(new Date(2005, 6, 2)) * //=> Sun Jan 01 2006 23:59:59.999 */ function endOfISOWeekYear(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var year = Object(_getISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var fourthOfJanuaryOfNextYear = new Date(0); fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4); fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0); var date = Object(_startOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(fourthOfJanuaryOfNextYear); date.setMilliseconds(date.getMilliseconds() - 1); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/endOfMinute/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/esm/endOfMinute/index.js ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return endOfMinute; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name endOfMinute * @category Minute Helpers * @summary Return the end of a minute for the given date. * * @description * Return the end of a minute for the given date. * The result will be in the local timezone. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @returns {Date} the end of a minute * @throws {TypeError} 1 argument required * * @example * // The end of a minute for 1 December 2014 22:15:45.400: * var result = endOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400)) * //=> Mon Dec 01 2014 22:15:59.999 */ function endOfMinute(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); date.setSeconds(59, 999); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/endOfMonth/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/esm/endOfMonth/index.js ***! \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return endOfMonth; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name endOfMonth * @category Month Helpers * @summary Return the end of a month for the given date. * * @description * Return the end of a month for the given date. * The result will be in the local timezone. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @returns {Date} the end of a month * @throws {TypeError} 1 argument required * * @example * // The end of a month for 2 September 2014 11:55:00: * var result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0)) * //=> Tue Sep 30 2014 23:59:59.999 */ function endOfMonth(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var month = date.getMonth(); date.setFullYear(date.getFullYear(), month + 1, 0); date.setHours(23, 59, 59, 999); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/endOfQuarter/index.js": /*!*********************************************************!*\ !*** ./node_modules/date-fns/esm/endOfQuarter/index.js ***! \*********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return endOfQuarter; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name endOfQuarter * @category Quarter Helpers * @summary Return the end of a year quarter for the given date. * * @description * Return the end of a year quarter for the given date. * The result will be in the local timezone. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @returns {Date} the end of a quarter * @throws {TypeError} 1 argument required * * @example * // The end of a quarter for 2 September 2014 11:55:00: * var result = endOfQuarter(new Date(2014, 8, 2, 11, 55, 0)) * //=> Tue Sep 30 2014 23:59:59.999 */ function endOfQuarter(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var currentMonth = date.getMonth(); var month = currentMonth - currentMonth % 3 + 3; date.setMonth(month, 0); date.setHours(23, 59, 59, 999); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/endOfSecond/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/esm/endOfSecond/index.js ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return endOfSecond; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name endOfSecond * @category Second Helpers * @summary Return the end of a second for the given date. * * @description * Return the end of a second for the given date. * The result will be in the local timezone. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @returns {Date} the end of a second * @throws {TypeError} 1 argument required * * @example * // The end of a second for 1 December 2014 22:15:45.400: * var result = endOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400)) * //=> Mon Dec 01 2014 22:15:45.999 */ function endOfSecond(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); date.setMilliseconds(999); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/endOfWeek/index.js": /*!******************************************************!*\ !*** ./node_modules/date-fns/esm/endOfWeek/index.js ***! \******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return endOfWeek; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name endOfWeek * @category Week Helpers * @summary Return the end of a week for the given date. * * @description * Return the end of a week for the given date. * The result will be in the local timezone. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @param {Object} [options] - an object with options. * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} * @returns {Date} the end of a week * @throws {TypeError} 1 argument required * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 * * @example * // The end of a week for 2 September 2014 11:55:00: * var result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0)) * //=> Sat Sep 06 2014 23:59:59.999 * * @example * // If the week starts on Monday, the end of the week for 2 September 2014 11:55:00: * var result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 }) * //=> Sun Sep 07 2014 23:59:59.999 */ function endOfWeek(dirtyDate, dirtyOptions) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var options = dirtyOptions || {}; var locale = options.locale; var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn; var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(localeWeekStartsOn); var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var day = date.getDay(); var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn); date.setDate(date.getDate() + diff); date.setHours(23, 59, 59, 999); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/endOfYear/index.js": /*!******************************************************!*\ !*** ./node_modules/date-fns/esm/endOfYear/index.js ***! \******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return endOfYear; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name endOfYear * @category Year Helpers * @summary Return the end of a year for the given date. * * @description * Return the end of a year for the given date. * The result will be in the local timezone. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @returns {Date} the end of a year * @throws {TypeError} 1 argument required * * @example * // The end of a year for 2 September 2014 11:55:00: * var result = endOfYear(new Date(2014, 8, 2, 11, 55, 00)) * //=> Wed Dec 31 2014 23:59:59.999 */ function endOfYear(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var year = date.getFullYear(); date.setFullYear(year + 1, 0, 0); date.setHours(23, 59, 59, 999); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/format/index.js": /*!***************************************************!*\ !*** ./node_modules/date-fns/esm/format/index.js ***! \***************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return format; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../_lib/getTimezoneOffsetInMilliseconds/index.js */ "./node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _isValid_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../isValid/index.js */ "./node_modules/date-fns/esm/isValid/index.js"); /* harmony import */ var _locale_en_US_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../locale/en-US/index.js */ "./node_modules/date-fns/esm/locale/en-US/index.js"); /* harmony import */ var _lib_format_formatters_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../_lib/format/formatters/index.js */ "./node_modules/date-fns/esm/_lib/format/formatters/index.js"); /* harmony import */ var _lib_format_longFormatters_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../_lib/format/longFormatters/index.js */ "./node_modules/date-fns/esm/_lib/format/longFormatters/index.js"); /* harmony import */ var _subMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../subMilliseconds/index.js */ "./node_modules/date-fns/esm/subMilliseconds/index.js"); /* harmony import */ var _lib_protectedTokens_index_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../_lib/protectedTokens/index.js */ "./node_modules/date-fns/esm/_lib/protectedTokens/index.js"); // This RegExp consists of three parts separated by `|`: // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token // (one of the certain letters followed by `o`) // - (\w)\1* matches any sequences of the same letter // - '' matches two quote characters in a row // - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('), // except a single quote symbol, which ends the sequence. // Two quote characters do not end the sequence. // If there is no matching single quote // then the sequence will continue until the end of the string. // - . matches any single character unmatched by previous parts of the RegExps var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also // sequences of symbols P, p, and the combinations like `PPPPPPPppppp` var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g; var escapedStringRegExp = /^'(.*?)'?$/; var doubleQuoteRegExp = /''/g; /** * @name format * @category Common Helpers * @summary Format the date. * * @description * Return the formatted date string in the given format. The result may vary by locale. * * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries. * > See: https://git.io/fxCyr * * The characters wrapped between two single quotes characters (') are escaped. * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote. * (see the last example) * * Format of the string is based on Unicode Technical Standard #35: * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table * with a few additions (see note 7 below the table). * * Accepted patterns: * | Unit | Pattern | Result examples | Notes | * |---------------------------------|---------|-----------------------------------|-------| * | Era | G..GGG | AD, BC | | * | | GGGG | Anno Domini, Before Christ | 2 | * | | GGGGG | A, B | | * | Calendar year | y | 44, 1, 1900, 2017 | 5 | * | | yo | 44th, 1st, 0th, 17th | 5,7 | * | | yy | 44, 01, 00, 17 | 5 | * | | yyy | 044, 001, 1900, 2017 | 5 | * | | yyyy | 0044, 0001, 1900, 2017 | 5 | * | | yyyyy | ... | 3,5 | * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 | * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 | * | | YY | 44, 01, 00, 17 | 5,8 | * | | YYY | 044, 001, 1900, 2017 | 5 | * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 | * | | YYYYY | ... | 3,5 | * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 | * | | RR | -43, 00, 01, 1900, 2017 | 5,7 | * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 | * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 | * | | RRRRR | ... | 3,5,7 | * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 | * | | uu | -43, 01, 1900, 2017 | 5 | * | | uuu | -043, 001, 1900, 2017 | 5 | * | | uuuu | -0043, 0001, 1900, 2017 | 5 | * | | uuuuu | ... | 3,5 | * | Quarter (formatting) | Q | 1, 2, 3, 4 | | * | | Qo | 1st, 2nd, 3rd, 4th | 7 | * | | QQ | 01, 02, 03, 04 | | * | | QQQ | Q1, Q2, Q3, Q4 | | * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 | * | | QQQQQ | 1, 2, 3, 4 | 4 | * | Quarter (stand-alone) | q | 1, 2, 3, 4 | | * | | qo | 1st, 2nd, 3rd, 4th | 7 | * | | qq | 01, 02, 03, 04 | | * | | qqq | Q1, Q2, Q3, Q4 | | * | | qqqq | 1st quarter, 2nd quarter, ... | 2 | * | | qqqqq | 1, 2, 3, 4 | 4 | * | Month (formatting) | M | 1, 2, ..., 12 | | * | | Mo | 1st, 2nd, ..., 12th | 7 | * | | MM | 01, 02, ..., 12 | | * | | MMM | Jan, Feb, ..., Dec | | * | | MMMM | January, February, ..., December | 2 | * | | MMMMM | J, F, ..., D | | * | Month (stand-alone) | L | 1, 2, ..., 12 | | * | | Lo | 1st, 2nd, ..., 12th | 7 | * | | LL | 01, 02, ..., 12 | | * | | LLL | Jan, Feb, ..., Dec | | * | | LLLL | January, February, ..., December | 2 | * | | LLLLL | J, F, ..., D | | * | Local week of year | w | 1, 2, ..., 53 | | * | | wo | 1st, 2nd, ..., 53th | 7 | * | | ww | 01, 02, ..., 53 | | * | ISO week of year | I | 1, 2, ..., 53 | 7 | * | | Io | 1st, 2nd, ..., 53th | 7 | * | | II | 01, 02, ..., 53 | 7 | * | Day of month | d | 1, 2, ..., 31 | | * | | do | 1st, 2nd, ..., 31st | 7 | * | | dd | 01, 02, ..., 31 | | * | Day of year | D | 1, 2, ..., 365, 366 | 8 | * | | Do | 1st, 2nd, ..., 365th, 366th | 7 | * | | DD | 01, 02, ..., 365, 366 | 8 | * | | DDD | 001, 002, ..., 365, 366 | | * | | DDDD | ... | 3 | * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Su | | * | | EEEE | Monday, Tuesday, ..., Sunday | 2 | * | | EEEEE | M, T, W, T, F, S, S | | * | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | | * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 | * | | io | 1st, 2nd, ..., 7th | 7 | * | | ii | 01, 02, ..., 07 | 7 | * | | iii | Mon, Tue, Wed, ..., Su | 7 | * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 | * | | iiiii | M, T, W, T, F, S, S | 7 | * | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 7 | * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | | * | | eo | 2nd, 3rd, ..., 1st | 7 | * | | ee | 02, 03, ..., 01 | | * | | eee | Mon, Tue, Wed, ..., Su | | * | | eeee | Monday, Tuesday, ..., Sunday | 2 | * | | eeeee | M, T, W, T, F, S, S | | * | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | | * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | | * | | co | 2nd, 3rd, ..., 1st | 7 | * | | cc | 02, 03, ..., 01 | | * | | ccc | Mon, Tue, Wed, ..., Su | | * | | cccc | Monday, Tuesday, ..., Sunday | 2 | * | | ccccc | M, T, W, T, F, S, S | | * | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | | * | AM, PM | a..aaa | AM, PM | | * | | aaaa | a.m., p.m. | 2 | * | | aaaaa | a, p | | * | AM, PM, noon, midnight | b..bbb | AM, PM, noon, midnight | | * | | bbbb | a.m., p.m., noon, midnight | 2 | * | | bbbbb | a, p, n, mi | | * | Flexible day period | B..BBB | at night, in the morning, ... | | * | | BBBB | at night, in the morning, ... | 2 | * | | BBBBB | at night, in the morning, ... | | * | Hour [1-12] | h | 1, 2, ..., 11, 12 | | * | | ho | 1st, 2nd, ..., 11th, 12th | 7 | * | | hh | 01, 02, ..., 11, 12 | | * | Hour [0-23] | H | 0, 1, 2, ..., 23 | | * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 | * | | HH | 00, 01, 02, ..., 23 | | * | Hour [0-11] | K | 1, 2, ..., 11, 0 | | * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 | * | | KK | 1, 2, ..., 11, 0 | | * | Hour [1-24] | k | 24, 1, 2, ..., 23 | | * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 | * | | kk | 24, 01, 02, ..., 23 | | * | Minute | m | 0, 1, ..., 59 | | * | | mo | 0th, 1st, ..., 59th | 7 | * | | mm | 00, 01, ..., 59 | | * | Second | s | 0, 1, ..., 59 | | * | | so | 0th, 1st, ..., 59th | 7 | * | | ss | 00, 01, ..., 59 | | * | Fraction of second | S | 0, 1, ..., 9 | | * | | SS | 00, 01, ..., 99 | | * | | SSS | 000, 0001, ..., 999 | | * | | SSSS | ... | 3 | * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | | * | | XX | -0800, +0530, Z | | * | | XXX | -08:00, +05:30, Z | | * | | XXXX | -0800, +0530, Z, +123456 | 2 | * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | | * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | | * | | xx | -0800, +0530, +0000 | | * | | xxx | -08:00, +05:30, +00:00 | 2 | * | | xxxx | -0800, +0530, +0000, +123456 | | * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | | * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | | * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 | * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 | * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 | * | Seconds timestamp | t | 512969520 | 7 | * | | tt | ... | 3,7 | * | Milliseconds timestamp | T | 512969520900 | 7 | * | | TT | ... | 3,7 | * | Long localized date | P | 05/29/1453 | 7 | * | | PP | May 29, 1453 | 7 | * | | PPP | May 29th, 1453 | 7 | * | | PPPP | Sunday, May 29th, 1453 | 2,7 | * | Long localized time | p | 12:00 AM | 7 | * | | pp | 12:00:00 AM | 7 | * | | ppp | 12:00:00 AM GMT+2 | 7 | * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 | * | Combination of date and time | Pp | 05/29/1453, 12:00 AM | 7 | * | | PPpp | May 29, 1453, 12:00:00 AM | 7 | * | | PPPppp | May 29th, 1453 at ... | 7 | * | | PPPPpppp| Sunday, May 29th, 1453 at ... | 2,7 | * Notes: * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale * are the same as "stand-alone" units, but are different in some languages. * "Formatting" units are declined according to the rules of the language * in the context of a date. "Stand-alone" units are always nominative singular: * * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'` * * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'` * * 2. Any sequence of the identical letters is a pattern, unless it is escaped by * the single quote characters (see below). * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`) * the output will be the same as default pattern for this unit, usually * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units * are marked with "2" in the last column of the table. * * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'` * * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'` * * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'` * * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'` * * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'` * * 3. Some patterns could be unlimited length (such as `yyyyyyyy`). * The output will be padded with zeros to match the length of the pattern. * * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'` * * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales. * These tokens represent the shortest form of the quarter. * * 5. The main difference between `y` and `u` patterns are B.C. years: * * | Year | `y` | `u` | * |------|-----|-----| * | AC 1 | 1 | 1 | * | BC 1 | 1 | 0 | * | BC 2 | 2 | -1 | * * Also `yy` always returns the last two digits of a year, * while `uu` pads single digit years to 2 characters and returns other years unchanged: * * | Year | `yy` | `uu` | * |------|------|------| * | 1 | 01 | 01 | * | 14 | 14 | 14 | * | 376 | 76 | 376 | * | 1453 | 53 | 1453 | * * The same difference is true for local and ISO week-numbering years (`Y` and `R`), * except local week-numbering years are dependent on `options.weekStartsOn` * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear} * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}). * * 6. Specific non-location timezones are currently unavailable in `date-fns`, * so right now these tokens fall back to GMT timezones. * * 7. These patterns are not in the Unicode Technical Standard #35: * - `i`: ISO day of week * - `I`: ISO week of year * - `R`: ISO week-numbering year * - `t`: seconds timestamp * - `T`: milliseconds timestamp * - `o`: ordinal number modifier * - `P`: long localized date * - `p`: long localized time * * 8. These tokens are often confused with others. See: https://git.io/fxCyr * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * - The second argument is now required for the sake of explicitness. * * ```javascript * // Before v2.0.0 * format(new Date(2016, 0, 1)) * * // v2.0.0 onward * format(new Date(2016, 0, 1), "yyyy-MM-dd'T'HH:mm:ss.SSSxxx") * ``` * * - New format string API for `format` function * which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table). * See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details. * * - Characters are now escaped using single quote symbols (`'`) instead of square brackets. * * @param {Date|Number} date - the original date * @param {String} format - the string of tokens * @param {Object} [options] - an object with options. * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} * @param {Boolean} [options.awareOfUnicodeTokens=false] - if true, allows usage of Unicode tokens causes confusion: * - Some of the day of year tokens (`D`, `DD`) that are confused with the day of month tokens (`d`, `dd`). * - Some of the local week-numbering year tokens (`YY`, `YYYY`) that are confused with the calendar year tokens (`yy`, `yyyy`). * See: https://git.io/fxCyr * @returns {String} the formatted date string * @throws {TypeError} 2 arguments required * @throws {RangeError} `options.locale` must contain `localize` property * @throws {RangeError} `options.locale` must contain `formatLong` property * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7 * @throws {RangeError} `options.awareOfUnicodeTokens` must be set to `true` to use `XX` token; see: https://git.io/fxCyr * * @example * // Represent 11 February 2014 in middle-endian format: * var result = format(new Date(2014, 1, 11), 'MM/dd/yyyy') * //=> '02/11/2014' * * @example * // Represent 2 July 2014 in Esperanto: * import { eoLocale } from 'date-fns/locale/eo' * var result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", { * locale: eoLocale * }) * //=> '2-a de julio 2014' * * @example * // Escape string by single quote characters: * var result = format(new Date(2014, 6, 2, 15), "h 'o''clock'") * //=> "3 o'clock" */ function format(dirtyDate, dirtyFormatStr, dirtyOptions) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var formatStr = String(dirtyFormatStr); var options = dirtyOptions || {}; var locale = options.locale || _locale_en_US_index_js__WEBPACK_IMPORTED_MODULE_4__["default"]; var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate; var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(localeFirstWeekContainsDate); var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) { throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively'); } var localeWeekStartsOn = locale.options && locale.options.weekStartsOn; var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(localeWeekStartsOn); var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); } if (!locale.localize) { throw new RangeError('locale must contain localize property'); } if (!locale.formatLong) { throw new RangeError('locale must contain formatLong property'); } var originalDate = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(dirtyDate); if (!Object(_isValid_index_js__WEBPACK_IMPORTED_MODULE_3__["default"])(originalDate)) { throw new RangeError('Invalid time value'); } // Convert the date in system timezone to the same date in UTC+00:00 timezone. // This ensures that when UTC functions will be implemented, locales will be compatible with them. // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376 var timezoneOffset = Object(_lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(originalDate); var utcDate = Object(_subMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_7__["default"])(originalDate, timezoneOffset); var formatterOptions = { firstWeekContainsDate: firstWeekContainsDate, weekStartsOn: weekStartsOn, locale: locale, _originalDate: originalDate }; var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) { var firstCharacter = substring[0]; if (firstCharacter === 'p' || firstCharacter === 'P') { var longFormatter = _lib_format_longFormatters_index_js__WEBPACK_IMPORTED_MODULE_6__["default"][firstCharacter]; return longFormatter(substring, locale.formatLong, formatterOptions); } return substring; }).join('').match(formattingTokensRegExp).map(function (substring) { // Replace two single quote characters with one single quote character if (substring === "''") { return "'"; } var firstCharacter = substring[0]; if (firstCharacter === "'") { return cleanEscapedString(substring); } var formatter = _lib_format_formatters_index_js__WEBPACK_IMPORTED_MODULE_5__["default"][firstCharacter]; if (formatter) { if (!options.awareOfUnicodeTokens && Object(_lib_protectedTokens_index_js__WEBPACK_IMPORTED_MODULE_8__["isProtectedToken"])(substring)) { Object(_lib_protectedTokens_index_js__WEBPACK_IMPORTED_MODULE_8__["throwProtectedError"])(substring); } return formatter(utcDate, substring, locale.localize, formatterOptions); } return substring; }).join(''); return result; } function cleanEscapedString(input) { return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'"); } /***/ }), /***/ "./node_modules/date-fns/esm/formatDistance/index.js": /*!***********************************************************!*\ !*** ./node_modules/date-fns/esm/formatDistance/index.js ***! \***********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return formatDistance; }); /* harmony import */ var _lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/getTimezoneOffsetInMilliseconds/index.js */ "./node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js"); /* harmony import */ var _compareAsc_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../compareAsc/index.js */ "./node_modules/date-fns/esm/compareAsc/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _differenceInSeconds_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../differenceInSeconds/index.js */ "./node_modules/date-fns/esm/differenceInSeconds/index.js"); /* harmony import */ var _differenceInMonths_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../differenceInMonths/index.js */ "./node_modules/date-fns/esm/differenceInMonths/index.js"); /* harmony import */ var _lib_cloneObject_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../_lib/cloneObject/index.js */ "./node_modules/date-fns/esm/_lib/cloneObject/index.js"); /* harmony import */ var _locale_en_US_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../locale/en-US/index.js */ "./node_modules/date-fns/esm/locale/en-US/index.js"); var MINUTES_IN_DAY = 1440; var MINUTES_IN_ALMOST_TWO_DAYS = 2520; var MINUTES_IN_MONTH = 43200; var MINUTES_IN_TWO_MONTHS = 86400; /** * @name formatDistance * @category Common Helpers * @summary Return the distance between the given dates in words. * * @description * Return the distance between the given dates in words. * * | Distance between dates | Result | * |-------------------------------------------------------------------|---------------------| * | 0 ... 30 secs | less than a minute | * | 30 secs ... 1 min 30 secs | 1 minute | * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes | * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour | * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours | * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day | * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days | * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month | * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months | * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months | * | 1 yr ... 1 yr 3 months | about 1 year | * | 1 yr 3 months ... 1 yr 9 month s | over 1 year | * | 1 yr 9 months ... 2 yrs | almost 2 years | * | N yrs ... N yrs 3 months | about N years | * | N yrs 3 months ... N yrs 9 months | over N years | * | N yrs 9 months ... N+1 yrs | almost N+1 years | * * With `options.includeSeconds == true`: * | Distance between dates | Result | * |------------------------|----------------------| * | 0 secs ... 5 secs | less than 5 seconds | * | 5 secs ... 10 secs | less than 10 seconds | * | 10 secs ... 20 secs | less than 20 seconds | * | 20 secs ... 40 secs | half a minute | * | 40 secs ... 60 secs | less than a minute | * | 60 secs ... 90 secs | 1 minute | * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * - The function was renamed from `distanceInWords ` to `formatDistance ` * to make its name consistent with `format` and `formatRelative`. * * - The order of arguments is swapped to make the function * consistent with `differenceIn...` functions. * * ```javascript * // Before v2.0.0 * * distanceInWords( * new Date(1986, 3, 4, 10, 32, 0), * new Date(1986, 3, 4, 11, 32, 0), * { addSuffix: true } * ) //=> 'in about 1 hour' * * // v2.0.0 onward * * formatDistance( * new Date(1986, 3, 4, 11, 32, 0), * new Date(1986, 3, 4, 10, 32, 0), * { addSuffix: true } * ) //=> 'in about 1 hour' * ``` * * @param {Date|Number} date - the date * @param {Date|Number} baseDate - the date to compare with * @param {Object} [options] - an object with options. * @param {Boolean} [options.includeSeconds=false] - distances less than a minute are more detailed * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} * @returns {String} the distance in words * @throws {TypeError} 2 arguments required * @throws {RangeError} `options.locale` must contain `formatDistance` property * * @example * // What is the distance between 2 July 2014 and 1 January 2015? * var result = formatDistance(new Date(2014, 6, 2), new Date(2015, 0, 1)) * //=> '6 months' * * @example * // What is the distance between 1 January 2015 00:00:15 * // and 1 January 2015 00:00:00, including seconds? * var result = formatDistance( * new Date(2015, 0, 1, 0, 0, 15), * new Date(2015, 0, 1, 0, 0, 0), * { includeSeconds: true } * ) * //=> 'less than 20 seconds' * * @example * // What is the distance from 1 January 2016 * // to 1 January 2015, with a suffix? * var result = formatDistance(new Date(2015, 0, 1), new Date(2016, 0, 1), { * addSuffix: true * }) * //=> 'about 1 year ago' * * @example * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto? * import { eoLocale } from 'date-fns/locale/eo' * var result = formatDistance(new Date(2016, 7, 1), new Date(2015, 0, 1), { * locale: eoLocale * }) * //=> 'pli ol 1 jaro' */ function formatDistance(dirtyDate, dirtyBaseDate, dirtyOptions) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var options = dirtyOptions || {}; var locale = options.locale || _locale_en_US_index_js__WEBPACK_IMPORTED_MODULE_6__["default"]; if (!locale.formatDistance) { throw new RangeError('locale must contain formatDistance property'); } var comparison = Object(_compareAsc_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate, dirtyBaseDate); if (isNaN(comparison)) { throw new RangeError('Invalid time value'); } var localizeOptions = Object(_lib_cloneObject_index_js__WEBPACK_IMPORTED_MODULE_5__["default"])(options); localizeOptions.addSuffix = Boolean(options.addSuffix); localizeOptions.comparison = comparison; var dateLeft; var dateRight; if (comparison > 0) { dateLeft = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(dirtyBaseDate); dateRight = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(dirtyDate); } else { dateLeft = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(dirtyDate); dateRight = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(dirtyBaseDate); } var seconds = Object(_differenceInSeconds_index_js__WEBPACK_IMPORTED_MODULE_3__["default"])(dateRight, dateLeft); var offsetInSeconds = (Object(_lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dateRight) - Object(_lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dateLeft)) / 1000; var minutes = Math.round((seconds - offsetInSeconds) / 60); var months; // 0 up to 2 mins if (minutes < 2) { if (options.includeSeconds) { if (seconds < 5) { return locale.formatDistance('lessThanXSeconds', 5, localizeOptions); } else if (seconds < 10) { return locale.formatDistance('lessThanXSeconds', 10, localizeOptions); } else if (seconds < 20) { return locale.formatDistance('lessThanXSeconds', 20, localizeOptions); } else if (seconds < 40) { return locale.formatDistance('halfAMinute', null, localizeOptions); } else if (seconds < 60) { return locale.formatDistance('lessThanXMinutes', 1, localizeOptions); } else { return locale.formatDistance('xMinutes', 1, localizeOptions); } } else { if (minutes === 0) { return locale.formatDistance('lessThanXMinutes', 1, localizeOptions); } else { return locale.formatDistance('xMinutes', minutes, localizeOptions); } } // 2 mins up to 0.75 hrs } else if (minutes < 45) { return locale.formatDistance('xMinutes', minutes, localizeOptions); // 0.75 hrs up to 1.5 hrs } else if (minutes < 90) { return locale.formatDistance('aboutXHours', 1, localizeOptions); // 1.5 hrs up to 24 hrs } else if (minutes < MINUTES_IN_DAY) { var hours = Math.round(minutes / 60); return locale.formatDistance('aboutXHours', hours, localizeOptions); // 1 day up to 1.75 days } else if (minutes < MINUTES_IN_ALMOST_TWO_DAYS) { return locale.formatDistance('xDays', 1, localizeOptions); // 1.75 days up to 30 days } else if (minutes < MINUTES_IN_MONTH) { var days = Math.round(minutes / MINUTES_IN_DAY); return locale.formatDistance('xDays', days, localizeOptions); // 1 month up to 2 months } else if (minutes < MINUTES_IN_TWO_MONTHS) { months = Math.round(minutes / MINUTES_IN_MONTH); return locale.formatDistance('aboutXMonths', months, localizeOptions); } months = Object(_differenceInMonths_index_js__WEBPACK_IMPORTED_MODULE_4__["default"])(dateRight, dateLeft); // 2 months up to 12 months if (months < 12) { var nearestMonth = Math.round(minutes / MINUTES_IN_MONTH); return locale.formatDistance('xMonths', nearestMonth, localizeOptions); // 1 year up to max Date } else { var monthsSinceStartOfYear = months % 12; var years = Math.floor(months / 12); // N years up to 1 years 3 months if (monthsSinceStartOfYear < 3) { return locale.formatDistance('aboutXYears', years, localizeOptions); // N years 3 months up to N years 9 months } else if (monthsSinceStartOfYear < 9) { return locale.formatDistance('overXYears', years, localizeOptions); // N years 9 months up to N year 12 months } else { return locale.formatDistance('almostXYears', years + 1, localizeOptions); } } } /***/ }), /***/ "./node_modules/date-fns/esm/formatDistanceStrict/index.js": /*!*****************************************************************!*\ !*** ./node_modules/date-fns/esm/formatDistanceStrict/index.js ***! \*****************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return formatDistanceStrict; }); /* harmony import */ var _lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/getTimezoneOffsetInMilliseconds/index.js */ "./node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js"); /* harmony import */ var _compareAsc_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../compareAsc/index.js */ "./node_modules/date-fns/esm/compareAsc/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _differenceInSeconds_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../differenceInSeconds/index.js */ "./node_modules/date-fns/esm/differenceInSeconds/index.js"); /* harmony import */ var _lib_cloneObject_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../_lib/cloneObject/index.js */ "./node_modules/date-fns/esm/_lib/cloneObject/index.js"); /* harmony import */ var _locale_en_US_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../locale/en-US/index.js */ "./node_modules/date-fns/esm/locale/en-US/index.js"); var MINUTES_IN_DAY = 1440; var MINUTES_IN_MONTH = 43200; var MINUTES_IN_YEAR = 525600; /** * @name formatDistanceStrict * @category Common Helpers * @summary Return the distance between the given dates in words. * * @description * Return the distance between the given dates in words, using strict units. * This is like `formatDistance`, but does not use helpers like 'almost', 'over', * 'less than' and the like. * * | Distance between dates | Result | * |------------------------|---------------------| * | 0 ... 59 secs | [0..59] seconds | * | 1 ... 59 mins | [1..59] minutes | * | 1 ... 23 hrs | [1..23] hours | * | 1 ... 29 days | [1..29] days | * | 1 ... 11 months | [1..11] months | * | 1 ... N years | [1..N] years | * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * - The function was renamed from `distanceInWordsStrict` to `formatDistanceStrict` * to make its name consistent with `format` and `formatRelative`. * * - The order of arguments is swapped to make the function * consistent with `differenceIn...` functions. * * ```javascript * // Before v2.0.0 * * distanceInWordsStrict( * new Date(2015, 0, 2), * new Date(2014, 6, 2) * ) //=> '6 months' * * // v2.0.0 onward * * formatDistanceStrict( * new Date(2014, 6, 2), * new Date(2015, 0, 2) * ) //=> '6 months' * ``` * * - `partialMethod` option is renamed to `roundingMethod`. * * ```javascript * // Before v2.0.0 * * distanceInWordsStrict( * new Date(1986, 3, 4, 10, 32, 0), * new Date(1986, 3, 4, 10, 33, 1), * { partialMethod: 'ceil' } * ) //=> '2 minutes' * * // v2.0.0 onward * * formatDistanceStrict( * new Date(1986, 3, 4, 10, 33, 1), * new Date(1986, 3, 4, 10, 32, 0), * { roundingMethod: 'ceil' } * ) //=> '2 minutes' * ``` * * - If `roundingMethod` is not specified, it now defaults to `round` instead of `floor`. * * - `unit` option now accepts one of the strings: * 'second', 'minute', 'hour', 'day', 'month' or 'year' instead of 's', 'm', 'h', 'd', 'M' or 'Y' * * ```javascript * // Before v2.0.0 * * distanceInWordsStrict( * new Date(1986, 3, 4, 10, 32, 0), * new Date(1986, 3, 4, 10, 33, 1), * { unit: 'm' } * ) * * // v2.0.0 onward * * formatDistanceStrict( * new Date(1986, 3, 4, 10, 33, 1), * new Date(1986, 3, 4, 10, 32, 0), * { unit: 'minute' } * ) * ``` * * @param {Date|Number} date - the date * @param {Date|Number} baseDate - the date to compare with * @param {Object} [options] - an object with options. * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first * @param {'second'|'minute'|'hour'|'day'|'month'|'year'} [options.unit] - if specified, will force a unit * @param {'floor'|'ceil'|'round'} [options.roundingMethod='round'] - which way to round partial units * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} * @returns {String} the distance in words * @throws {TypeError} 2 arguments required * @throws {RangeError} `options.roundingMethod` must be 'floor', 'ceil' or 'round' * @throws {RangeError} `options.unit` must be 'second', 'minute', 'hour', 'day', 'month' or 'year' * @throws {RangeError} `options.locale` must contain `formatDistance` property * * @example * // What is the distance between 2 July 2014 and 1 January 2015? * var result = formatDistanceStrict(new Date(2014, 6, 2), new Date(2015, 0, 2)) * //=> '6 months' * * @example * // What is the distance between 1 January 2015 00:00:15 * // and 1 January 2015 00:00:00? * var result = formatDistanceStrict( * new Date(2015, 0, 1, 0, 0, 15), * new Date(2015, 0, 1, 0, 0, 0) * ) * //=> '15 seconds' * * @example * // What is the distance from 1 January 2016 * // to 1 January 2015, with a suffix? * var result = formatDistanceStrict(new Date(2015, 0, 1), new Date(2016, 0, 1), { * addSuffix: true * }) * //=> '1 year ago' * * @example * // What is the distance from 1 January 2016 * // to 1 January 2015, in minutes? * var result = formatDistanceStrict(new Date(2016, 0, 1), new Date(2015, 0, 1), { * unit: 'minute' * }) * //=> '525600 minutes' * * @example * // What is the distance from 1 January 2016 * // to 28 January 2015, in months, rounded up? * var result = formatDistanceStrict(new Date(2015, 0, 28), new Date(2015, 0, 1), { * unit: 'month', * roundingMethod: 'ceil' * }) * //=> '1 month' * * @example * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto? * import { eoLocale } from 'date-fns/locale/eo' * var result = formatDistanceStrict(new Date(2016, 7, 1), new Date(2015, 0, 1), { * locale: eoLocale * }) * //=> '1 jaro' */ function formatDistanceStrict(dirtyDate, dirtyBaseDate, dirtyOptions) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var options = dirtyOptions || {}; var locale = options.locale || _locale_en_US_index_js__WEBPACK_IMPORTED_MODULE_5__["default"]; if (!locale.formatDistance) { throw new RangeError('locale must contain localize.formatDistance property'); } var comparison = Object(_compareAsc_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate, dirtyBaseDate); if (isNaN(comparison)) { throw new RangeError('Invalid time value'); } var localizeOptions = Object(_lib_cloneObject_index_js__WEBPACK_IMPORTED_MODULE_4__["default"])(options); localizeOptions.addSuffix = Boolean(options.addSuffix); localizeOptions.comparison = comparison; var dateLeft; var dateRight; if (comparison > 0) { dateLeft = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(dirtyBaseDate); dateRight = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(dirtyDate); } else { dateLeft = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(dirtyDate); dateRight = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(dirtyBaseDate); } var roundingMethod = options.roundingMethod == null ? 'round' : String(options.roundingMethod); var roundingMethodFn; if (roundingMethod === 'floor') { roundingMethodFn = Math.floor; } else if (roundingMethod === 'ceil') { roundingMethodFn = Math.ceil; } else if (roundingMethod === 'round') { roundingMethodFn = Math.round; } else { throw new RangeError("roundingMethod must be 'floor', 'ceil' or 'round'"); } var seconds = Object(_differenceInSeconds_index_js__WEBPACK_IMPORTED_MODULE_3__["default"])(dateRight, dateLeft); var offsetInSeconds = (Object(_lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dateRight) - Object(_lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dateLeft)) / 1000; var minutes = roundingMethodFn((seconds - offsetInSeconds) / 60); var unit; if (options.unit == null) { if (minutes < 1) { unit = 'second'; } else if (minutes < 60) { unit = 'minute'; } else if (minutes < MINUTES_IN_DAY) { unit = 'hour'; } else if (minutes < MINUTES_IN_MONTH) { unit = 'day'; } else if (minutes < MINUTES_IN_YEAR) { unit = 'month'; } else { unit = 'year'; } } else { unit = String(options.unit); } // 0 up to 60 seconds if (unit === 'second') { return locale.formatDistance('xSeconds', seconds, localizeOptions); // 1 up to 60 mins } else if (unit === 'minute') { return locale.formatDistance('xMinutes', minutes, localizeOptions); // 1 up to 24 hours } else if (unit === 'hour') { var hours = roundingMethodFn(minutes / 60); return locale.formatDistance('xHours', hours, localizeOptions); // 1 up to 30 days } else if (unit === 'day') { var days = roundingMethodFn(minutes / MINUTES_IN_DAY); return locale.formatDistance('xDays', days, localizeOptions); // 1 up to 12 months } else if (unit === 'month') { var months = roundingMethodFn(minutes / MINUTES_IN_MONTH); return locale.formatDistance('xMonths', months, localizeOptions); // 1 year up to max Date } else if (unit === 'year') { var years = roundingMethodFn(minutes / MINUTES_IN_YEAR); return locale.formatDistance('xYears', years, localizeOptions); } throw new RangeError("unit must be 'second', 'minute', 'hour', 'day', 'month' or 'year'"); } /***/ }), /***/ "./node_modules/date-fns/esm/formatRelative/index.js": /*!***********************************************************!*\ !*** ./node_modules/date-fns/esm/formatRelative/index.js ***! \***********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return formatRelative; }); /* harmony import */ var _lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/getTimezoneOffsetInMilliseconds/index.js */ "./node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _format_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../format/index.js */ "./node_modules/date-fns/esm/format/index.js"); /* harmony import */ var _differenceInCalendarDays_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../differenceInCalendarDays/index.js */ "./node_modules/date-fns/esm/differenceInCalendarDays/index.js"); /* harmony import */ var _locale_en_US_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../locale/en-US/index.js */ "./node_modules/date-fns/esm/locale/en-US/index.js"); /* harmony import */ var _subMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../subMilliseconds/index.js */ "./node_modules/date-fns/esm/subMilliseconds/index.js"); /** * @name formatRelative * @category Common Helpers * @summary Represent the date in words relative to the given base date. * * @description * Represent the date in words relative to the given base date. * * | Distance to the base date | Result | * |---------------------------|---------------------------| * | Previous 6 days | last Sunday at 04:30 AM | * | Last day | yesterday at 04:30 AM | * | Same day | today at 04:30 AM | * | Next day | tomorrow at 04:30 AM | * | Next 6 days | Sunday at 04:30 AM | * | Other | 12/31/2017 | * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to format * @param {Date|Number} baseDate - the date to compare with * @param {Object} [options] - an object with options. * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} * @returns {String} the date in words * @throws {TypeError} 2 arguments required * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 * @throws {RangeError} `options.locale` must contain `localize` property * @throws {RangeError} `options.locale` must contain `formatLong` property * @throws {RangeError} `options.locale` must contain `formatRelative` property */ function formatRelative(dirtyDate, dirtyBaseDate, dirtyOptions) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var baseDate = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyBaseDate); var options = dirtyOptions || {}; var locale = options.locale || _locale_en_US_index_js__WEBPACK_IMPORTED_MODULE_4__["default"]; if (!locale.localize) { throw new RangeError('locale must contain localize property'); } if (!locale.formatLong) { throw new RangeError('locale must contain formatLong property'); } if (!locale.formatRelative) { throw new RangeError('locale must contain formatRelative property'); } var diff = Object(_differenceInCalendarDays_index_js__WEBPACK_IMPORTED_MODULE_3__["default"])(date, baseDate); if (isNaN(diff)) { throw new RangeError('Invalid time value'); } var token; if (diff < -6) { token = 'other'; } else if (diff < -1) { token = 'lastWeek'; } else if (diff < 0) { token = 'yesterday'; } else if (diff < 1) { token = 'today'; } else if (diff < 2) { token = 'tomorrow'; } else if (diff < 7) { token = 'nextWeek'; } else { token = 'other'; } var utcDate = Object(_subMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_5__["default"])(date, Object(_lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(date)); var utcBaseDate = Object(_subMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_5__["default"])(baseDate, Object(_lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(baseDate)); var formatStr = locale.formatRelative(token, utcDate, utcBaseDate, options); return Object(_format_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(date, formatStr, options); } /***/ }), /***/ "./node_modules/date-fns/esm/fromUnixTime/index.js": /*!*********************************************************!*\ !*** ./node_modules/date-fns/esm/fromUnixTime/index.js ***! \*********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return fromUnixTime; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /** * @name fromUnixTime * @category Timestamp Helpers * @summary Create a date from a Unix timestamp. * * @description * Create a date from a Unix timestamp. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Number} unixTime - the given Unix timestamp * @returns {Date} the date * @throws {TypeError} 1 argument required * * @example * // Create the date 29 February 2012 11:45:05: * var result = fromUnixTime(1330515905) * //=> Wed Feb 29 2012 11:45:05 */ function fromUnixTime(dirtyUnixTime) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var unixTime = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyUnixTime); return Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(unixTime * 1000); } /***/ }), /***/ "./node_modules/date-fns/esm/getDate/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/esm/getDate/index.js ***! \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getDate; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name getDate * @category Day Helpers * @summary Get the day of the month of the given date. * * @description * Get the day of the month of the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the given date * @returns {Number} the day of month * @throws {TypeError} 1 argument required * * @example * // Which day of the month is 29 February 2012? * var result = getDate(new Date(2012, 1, 29)) * //=> 29 */ function getDate(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var dayOfMonth = date.getDate(); return dayOfMonth; } /***/ }), /***/ "./node_modules/date-fns/esm/getDay/index.js": /*!***************************************************!*\ !*** ./node_modules/date-fns/esm/getDay/index.js ***! \***************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getDay; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name getDay * @category Weekday Helpers * @summary Get the day of the week of the given date. * * @description * Get the day of the week of the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the given date * @returns {Number} the day of week * @throws {TypeError} 1 argument required * * @example * // Which day of the week is 29 February 2012? * var result = getDay(new Date(2012, 1, 29)) * //=> 3 */ function getDay(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var day = date.getDay(); return day; } /***/ }), /***/ "./node_modules/date-fns/esm/getDayOfYear/index.js": /*!*********************************************************!*\ !*** ./node_modules/date-fns/esm/getDayOfYear/index.js ***! \*********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getDayOfYear; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _startOfYear_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../startOfYear/index.js */ "./node_modules/date-fns/esm/startOfYear/index.js"); /* harmony import */ var _differenceInCalendarDays_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../differenceInCalendarDays/index.js */ "./node_modules/date-fns/esm/differenceInCalendarDays/index.js"); /** * @name getDayOfYear * @category Day Helpers * @summary Get the day of the year of the given date. * * @description * Get the day of the year of the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the given date * @returns {Number} the day of year * @throws {TypeError} 1 argument required * * @example * // Which day of the year is 2 July 2014? * var result = getDayOfYear(new Date(2014, 6, 2)) * //=> 183 */ function getDayOfYear(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var diff = Object(_differenceInCalendarDays_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(date, Object(_startOfYear_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(date)); var dayOfYear = diff + 1; return dayOfYear; } /***/ }), /***/ "./node_modules/date-fns/esm/getDaysInMonth/index.js": /*!***********************************************************!*\ !*** ./node_modules/date-fns/esm/getDaysInMonth/index.js ***! \***********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getDaysInMonth; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name getDaysInMonth * @category Month Helpers * @summary Get the number of days in a month of the given date. * * @description * Get the number of days in a month of the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the given date * @returns {Number} the number of days in a month * @throws {TypeError} 1 argument required * * @example * // How many days are in February 2000? * var result = getDaysInMonth(new Date(2000, 1)) * //=> 29 */ function getDaysInMonth(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var year = date.getFullYear(); var monthIndex = date.getMonth(); var lastDayOfMonth = new Date(0); lastDayOfMonth.setFullYear(year, monthIndex + 1, 0); lastDayOfMonth.setHours(0, 0, 0, 0); return lastDayOfMonth.getDate(); } /***/ }), /***/ "./node_modules/date-fns/esm/getDaysInYear/index.js": /*!**********************************************************!*\ !*** ./node_modules/date-fns/esm/getDaysInYear/index.js ***! \**********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getDaysInYear; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _isLeapYear_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../isLeapYear/index.js */ "./node_modules/date-fns/esm/isLeapYear/index.js"); /** * @name getDaysInYear * @category Year Helpers * @summary Get the number of days in a year of the given date. * * @description * Get the number of days in a year of the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the given date * @returns {Number} the number of days in a year * @throws {TypeError} 1 argument required * * @example * // How many days are in 2012? * var result = getDaysInYear(new Date(2012, 0, 1)) * //=> 366 */ function getDaysInYear(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); if (isNaN(date)) { return NaN; } return Object(_isLeapYear_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(date) ? 366 : 365; } /***/ }), /***/ "./node_modules/date-fns/esm/getDecade/index.js": /*!******************************************************!*\ !*** ./node_modules/date-fns/esm/getDecade/index.js ***! \******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getDecade; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name getDecade * @category Decade Helpers * @summary Get the decade of the given date. * * @description * Get the decade of the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the given date * @returns {Number} the year of decade * @throws {TypeError} 1 argument required * * @example * // Which decade belongs 27 November 1942? * var result = getDecade(new Date(1942, 10, 27)) * //=> 1940 */ function getDecade(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var year = date.getFullYear(); var decade = Math.floor(year / 10) * 10; return decade; } /***/ }), /***/ "./node_modules/date-fns/esm/getHours/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/esm/getHours/index.js ***! \*****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getHours; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name getHours * @category Hour Helpers * @summary Get the hours of the given date. * * @description * Get the hours of the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the given date * @returns {Number} the hours * @throws {TypeError} 1 argument required * * @example * // Get the hours of 29 February 2012 11:45:00: * var result = getHours(new Date(2012, 1, 29, 11, 45)) * //=> 11 */ function getHours(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var hours = date.getHours(); return hours; } /***/ }), /***/ "./node_modules/date-fns/esm/getISODay/index.js": /*!******************************************************!*\ !*** ./node_modules/date-fns/esm/getISODay/index.js ***! \******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getISODay; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name getISODay * @category Weekday Helpers * @summary Get the day of the ISO week of the given date. * * @description * Get the day of the ISO week of the given date, * which is 7 for Sunday, 1 for Monday etc. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the given date * @returns {Number} the day of ISO week * @throws {TypeError} 1 argument required * * @example * // Which day of the ISO week is 26 February 2012? * var result = getISODay(new Date(2012, 1, 26)) * //=> 7 */ function getISODay(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var day = date.getDay(); if (day === 0) { day = 7; } return day; } /***/ }), /***/ "./node_modules/date-fns/esm/getISOWeek/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/esm/getISOWeek/index.js ***! \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getISOWeek; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _startOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../startOfISOWeek/index.js */ "./node_modules/date-fns/esm/startOfISOWeek/index.js"); /* harmony import */ var _startOfISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../startOfISOWeekYear/index.js */ "./node_modules/date-fns/esm/startOfISOWeekYear/index.js"); var MILLISECONDS_IN_WEEK = 604800000; /** * @name getISOWeek * @category ISO Week Helpers * @summary Get the ISO week of the given date. * * @description * Get the ISO week of the given date. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the given date * @returns {Number} the ISO week * @throws {TypeError} 1 argument required * * @example * // Which week of the ISO-week numbering year is 2 January 2005? * var result = getISOWeek(new Date(2005, 0, 2)) * //=> 53 */ function getISOWeek(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var diff = Object(_startOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(date).getTime() - Object(_startOfISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(date).getTime(); // Round the number of days to the nearest integer // because the number of milliseconds in a week is not constant // (e.g. it's different in the week of the daylight saving time clock shift) return Math.round(diff / MILLISECONDS_IN_WEEK) + 1; } /***/ }), /***/ "./node_modules/date-fns/esm/getISOWeekYear/index.js": /*!***********************************************************!*\ !*** ./node_modules/date-fns/esm/getISOWeekYear/index.js ***! \***********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getISOWeekYear; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _startOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../startOfISOWeek/index.js */ "./node_modules/date-fns/esm/startOfISOWeek/index.js"); /** * @name getISOWeekYear * @category ISO Week-Numbering Year Helpers * @summary Get the ISO week-numbering year of the given date. * * @description * Get the ISO week-numbering year of the given date, * which always starts 3 days before the year's first Thursday. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * - The function was renamed from `getISOYear` to `getISOWeekYear`. * "ISO week year" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date). * This change makes the name consistent with * locale-dependent week-numbering year helpers, e.g., `getWeekYear`. * * @param {Date|Number} date - the given date * @returns {Number} the ISO week-numbering year * @throws {TypeError} 1 argument required * * @example * // Which ISO-week numbering year is 2 January 2005? * var result = getISOWeekYear(new Date(2005, 0, 2)) * //=> 2004 */ function getISOWeekYear(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var year = date.getFullYear(); var fourthOfJanuaryOfNextYear = new Date(0); fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4); fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0); var startOfNextYear = Object(_startOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(fourthOfJanuaryOfNextYear); var fourthOfJanuaryOfThisYear = new Date(0); fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4); fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0); var startOfThisYear = Object(_startOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(fourthOfJanuaryOfThisYear); if (date.getTime() >= startOfNextYear.getTime()) { return year + 1; } else if (date.getTime() >= startOfThisYear.getTime()) { return year; } else { return year - 1; } } /***/ }), /***/ "./node_modules/date-fns/esm/getISOWeeksInYear/index.js": /*!**************************************************************!*\ !*** ./node_modules/date-fns/esm/getISOWeeksInYear/index.js ***! \**************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getISOWeeksInYear; }); /* harmony import */ var _startOfISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../startOfISOWeekYear/index.js */ "./node_modules/date-fns/esm/startOfISOWeekYear/index.js"); /* harmony import */ var _addWeeks_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../addWeeks/index.js */ "./node_modules/date-fns/esm/addWeeks/index.js"); var MILLISECONDS_IN_WEEK = 604800000; /** * @name getISOWeeksInYear * @category ISO Week-Numbering Year Helpers * @summary Get the number of weeks in an ISO week-numbering year of the given date. * * @description * Get the number of weeks in an ISO week-numbering year of the given date. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the given date * @returns {Number} the number of ISO weeks in a year * @throws {TypeError} 1 argument required * * @example * // How many weeks are in ISO week-numbering year 2015? * var result = getISOWeeksInYear(new Date(2015, 1, 11)) * //=> 53 */ function getISOWeeksInYear(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var thisYear = Object(_startOfISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var nextYear = Object(_startOfISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_addWeeks_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(thisYear, 60)); var diff = nextYear.valueOf() - thisYear.valueOf(); // Round the number of weeks to the nearest integer // because the number of milliseconds in a week is not constant // (e.g. it's different in the week of the daylight saving time clock shift) return Math.round(diff / MILLISECONDS_IN_WEEK); } /***/ }), /***/ "./node_modules/date-fns/esm/getMilliseconds/index.js": /*!************************************************************!*\ !*** ./node_modules/date-fns/esm/getMilliseconds/index.js ***! \************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getMilliseconds; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name getMilliseconds * @category Millisecond Helpers * @summary Get the milliseconds of the given date. * * @description * Get the milliseconds of the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the given date * @returns {Number} the milliseconds * @throws {TypeError} 1 argument required * * @example * // Get the milliseconds of 29 February 2012 11:45:05.123: * var result = getMilliseconds(new Date(2012, 1, 29, 11, 45, 5, 123)) * //=> 123 */ function getMilliseconds(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var milliseconds = date.getMilliseconds(); return milliseconds; } /***/ }), /***/ "./node_modules/date-fns/esm/getMinutes/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/esm/getMinutes/index.js ***! \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getMinutes; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name getMinutes * @category Minute Helpers * @summary Get the minutes of the given date. * * @description * Get the minutes of the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the given date * @returns {Number} the minutes * @throws {TypeError} 1 argument required * * @example * // Get the minutes of 29 February 2012 11:45:05: * var result = getMinutes(new Date(2012, 1, 29, 11, 45, 5)) * //=> 45 */ function getMinutes(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var minutes = date.getMinutes(); return minutes; } /***/ }), /***/ "./node_modules/date-fns/esm/getMonth/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/esm/getMonth/index.js ***! \*****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getMonth; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name getMonth * @category Month Helpers * @summary Get the month of the given date. * * @description * Get the month of the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the given date * @returns {Number} the month * @throws {TypeError} 1 argument required * * @example * // Which month is 29 February 2012? * var result = getMonth(new Date(2012, 1, 29)) * //=> 1 */ function getMonth(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var month = date.getMonth(); return month; } /***/ }), /***/ "./node_modules/date-fns/esm/getOverlappingDaysInIntervals/index.js": /*!**************************************************************************!*\ !*** ./node_modules/date-fns/esm/getOverlappingDaysInIntervals/index.js ***! \**************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getOverlappingDaysInIntervals; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); var MILLISECONDS_IN_DAY = 24 * 60 * 60 * 1000; /** * @name getOverlappingDaysInIntervals * @category Interval Helpers * @summary Get the number of days that overlap in two time intervals * * @description * Get the number of days that overlap in two time intervals * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * - The function was renamed from `getOverlappingDaysInRanges` to `getOverlappingDaysInIntervals`. * This change was made to mirror the use of the word "interval" in standard ISO 8601:2004 terminology: * * ``` * 2.1.3 * time interval * part of the time axis limited by two instants * ``` * * Also, this function now accepts an object with `start` and `end` properties * instead of two arguments as an interval. * This function now throws `RangeError` if the start of the interval is after its end * or if any date in the interval is `Invalid Date`. * * ```javascript * // Before v2.0.0 * * getOverlappingDaysInRanges( * new Date(2014, 0, 10), new Date(2014, 0, 20), * new Date(2014, 0, 17), new Date(2014, 0, 21) * ) * * // v2.0.0 onward * * getOverlappingDaysInIntervals( * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) } * ) * ``` * * @param {Interval} intervalLeft - the first interval to compare. See [Interval]{@link docs/Interval} * @param {Interval} intervalRight - the second interval to compare. See [Interval]{@link docs/Interval} * @returns {Number} the number of days that overlap in two time intervals * @throws {TypeError} 2 arguments required * @throws {RangeError} The start of an interval cannot be after its end * @throws {RangeError} Date in interval cannot be `Invalid Date` * * @example * // For overlapping time intervals adds 1 for each started overlapping day: * getOverlappingDaysInIntervals( * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) } * ) * //=> 3 * * @example * // For non-overlapping time intervals returns 0: * getOverlappingDaysInIntervals( * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, * { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) } * ) * //=> 0 */ function getOverlappingDaysInIntervals(dirtyIntervalLeft, dirtyIntervalRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var intervalLeft = dirtyIntervalLeft || {}; var intervalRight = dirtyIntervalRight || {}; var leftStartTime = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(intervalLeft.start).getTime(); var leftEndTime = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(intervalLeft.end).getTime(); var rightStartTime = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(intervalRight.start).getTime(); var rightEndTime = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(intervalRight.end).getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date` if (!(leftStartTime <= leftEndTime && rightStartTime <= rightEndTime)) { throw new RangeError('Invalid interval'); } var isOverlapping = leftStartTime < rightEndTime && rightStartTime < leftEndTime; if (!isOverlapping) { return 0; } var overlapStartDate = rightStartTime < leftStartTime ? leftStartTime : rightStartTime; var overlapEndDate = rightEndTime > leftEndTime ? leftEndTime : rightEndTime; var differenceInMs = overlapEndDate - overlapStartDate; return Math.ceil(differenceInMs / MILLISECONDS_IN_DAY); } /***/ }), /***/ "./node_modules/date-fns/esm/getQuarter/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/esm/getQuarter/index.js ***! \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getQuarter; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name getQuarter * @category Quarter Helpers * @summary Get the year quarter of the given date. * * @description * Get the year quarter of the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the given date * @returns {Number} the quarter * @throws {TypeError} 1 argument required * * @example * // Which quarter is 2 July 2014? * var result = getQuarter(new Date(2014, 6, 2)) * //=> 3 */ function getQuarter(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var quarter = Math.floor(date.getMonth() / 3) + 1; return quarter; } /***/ }), /***/ "./node_modules/date-fns/esm/getSeconds/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/esm/getSeconds/index.js ***! \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getSeconds; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name getSeconds * @category Second Helpers * @summary Get the seconds of the given date. * * @description * Get the seconds of the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the given date * @returns {Number} the seconds * @throws {TypeError} 1 argument required * * @example * // Get the seconds of 29 February 2012 11:45:05.123: * var result = getSeconds(new Date(2012, 1, 29, 11, 45, 5, 123)) * //=> 5 */ function getSeconds(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var seconds = date.getSeconds(); return seconds; } /***/ }), /***/ "./node_modules/date-fns/esm/getTime/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/esm/getTime/index.js ***! \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getTime; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name getTime * @category Timestamp Helpers * @summary Get the milliseconds timestamp of the given date. * * @description * Get the milliseconds timestamp of the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the given date * @returns {Number} the timestamp * @throws {TypeError} 1 argument required * * @example * // Get the timestamp of 29 February 2012 11:45:05.123: * var result = getTime(new Date(2012, 1, 29, 11, 45, 5, 123)) * //=> 1330515905123 */ function getTime(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var timestamp = date.getTime(); return timestamp; } /***/ }), /***/ "./node_modules/date-fns/esm/getUnixTime/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/esm/getUnixTime/index.js ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getUnixTime; }); /* harmony import */ var _getTime_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../getTime/index.js */ "./node_modules/date-fns/esm/getTime/index.js"); /** * @name getUnixTime * @category Timestamp Helpers * @summary Get the seconds timestamp of the given date. * * @description * Get the seconds timestamp of the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the given date * @returns {Number} the timestamp * @throws {TypeError} 1 argument required * * @example * // Get the timestamp of 29 February 2012 11:45:05 CET: * var result = getUnixTime(new Date(2012, 1, 29, 11, 45, 5)) * //=> 1330512305 */ function getUnixTime(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } return Math.floor(Object(_getTime_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate) / 1000); } /***/ }), /***/ "./node_modules/date-fns/esm/getWeek/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/esm/getWeek/index.js ***! \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getWeek; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _startOfWeek_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../startOfWeek/index.js */ "./node_modules/date-fns/esm/startOfWeek/index.js"); /* harmony import */ var _startOfWeekYear_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../startOfWeekYear/index.js */ "./node_modules/date-fns/esm/startOfWeekYear/index.js"); var MILLISECONDS_IN_WEEK = 604800000; /** * @name getWeek * @category Week Helpers * @summary Get the local week index of the given date. * * @description * Get the local week index of the given date. * The exact calculation depends on the values of * `options.weekStartsOn` (which is the index of the first day of the week) * and `options.firstWeekContainsDate` (which is the day of January, which is always in * the first week of the week-numbering year) * * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the given date * @param {Object} [options] - an object with options. * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year * @returns {Number} the week * @throws {TypeError} 1 argument required * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7 * * @example * // Which week of the local week numbering year is 2 January 2005 with default options? * var result = getISOWeek(new Date(2005, 0, 2)) * //=> 2 * * // Which week of the local week numbering year is 2 January 2005, * // if Monday is the first day of the week, * // and the first week of the year always contains 4 January? * var result = getISOWeek(new Date(2005, 0, 2), { * weekStartsOn: 1, * firstWeekContainsDate: 4 * }) * //=> 53 */ function getWeek(dirtyDate, options) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var diff = Object(_startOfWeek_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(date, options).getTime() - Object(_startOfWeekYear_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(date, options).getTime(); // Round the number of days to the nearest integer // because the number of milliseconds in a week is not constant // (e.g. it's different in the week of the daylight saving time clock shift) return Math.round(diff / MILLISECONDS_IN_WEEK) + 1; } /***/ }), /***/ "./node_modules/date-fns/esm/getWeekOfMonth/index.js": /*!***********************************************************!*\ !*** ./node_modules/date-fns/esm/getWeekOfMonth/index.js ***! \***********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getWeekOfMonth; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _getDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../getDate/index.js */ "./node_modules/date-fns/esm/getDate/index.js"); /* harmony import */ var _startOfMonth_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../startOfMonth/index.js */ "./node_modules/date-fns/esm/startOfMonth/index.js"); /* harmony import */ var _getDay_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../getDay/index.js */ "./node_modules/date-fns/esm/getDay/index.js"); /** * @name getWeekOfMonth * @category Week Helpers * @summary Get the week of the month of the given date. * * @description * Get the week of the month of the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the given date * @param {Object} [options] - an object with options. * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) * @returns {Number} the week of month * @throws {TypeError} 1 argument required * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 * * @example * // Which week of the month is 9 November 2017? * var result = getWeekOfMonth(new Date(2017, 10, 9)) * //=> 2 */ function getWeekOfMonth(date, dirtyOptions) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var options = dirtyOptions || {}; var locale = options.locale; var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn; var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(localeWeekStartsOn); var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); } var startWeekDay = Object(_getDay_index_js__WEBPACK_IMPORTED_MODULE_3__["default"])(Object(_startOfMonth_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(date)); var currentWeekDay = Object(_getDay_index_js__WEBPACK_IMPORTED_MODULE_3__["default"])(date); var startWeekDayWithOptions = startWeekDay < weekStartsOn ? 7 - weekStartsOn : startWeekDay; var diff = startWeekDayWithOptions > currentWeekDay ? 7 - weekStartsOn : 0; return Math.ceil((Object(_getDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(date) + diff) / 7); } /***/ }), /***/ "./node_modules/date-fns/esm/getWeekYear/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/esm/getWeekYear/index.js ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getWeekYear; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _startOfWeek_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../startOfWeek/index.js */ "./node_modules/date-fns/esm/startOfWeek/index.js"); /** * @name getWeekYear * @category Week-Numbering Year Helpers * @summary Get the local week-numbering year of the given date. * * @description * Get the local week-numbering year of the given date. * The exact calculation depends on the values of * `options.weekStartsOn` (which is the index of the first day of the week) * and `options.firstWeekContainsDate` (which is the day of January, which is always in * the first week of the week-numbering year) * * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the given date * @param {Object} [options] - an object with options. * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year * @returns {Number} the local week-numbering year * @throws {TypeError} 1 argument required * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7 * * @example * // Which week numbering year is 26 December 2004 with the default settings? * var result = getWeekYear(new Date(2004, 11, 26)) * //=> 2005 * * @example * // Which week numbering year is 26 December 2004 if week starts on Saturday? * var result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 }) * //=> 2004 * * @example * // Which week numbering year is 26 December 2004 if the first week contains 4 January? * var result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 }) * //=> 2004 */ function getWeekYear(dirtyDate, dirtyOptions) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var year = date.getFullYear(); var options = dirtyOptions || {}; var locale = options.locale; var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate; var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(localeFirstWeekContainsDate); var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) { throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively'); } var firstWeekOfNextYear = new Date(0); firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate); firstWeekOfNextYear.setHours(0, 0, 0, 0); var startOfNextYear = Object(_startOfWeek_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(firstWeekOfNextYear, dirtyOptions); var firstWeekOfThisYear = new Date(0); firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate); firstWeekOfThisYear.setHours(0, 0, 0, 0); var startOfThisYear = Object(_startOfWeek_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(firstWeekOfThisYear, dirtyOptions); if (date.getTime() >= startOfNextYear.getTime()) { return year + 1; } else if (date.getTime() >= startOfThisYear.getTime()) { return year; } else { return year - 1; } } /***/ }), /***/ "./node_modules/date-fns/esm/getWeeksInMonth/index.js": /*!************************************************************!*\ !*** ./node_modules/date-fns/esm/getWeeksInMonth/index.js ***! \************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getWeeksInMonth; }); /* harmony import */ var _differenceInCalendarWeeks_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../differenceInCalendarWeeks/index.js */ "./node_modules/date-fns/esm/differenceInCalendarWeeks/index.js"); /* harmony import */ var _lastDayOfMonth_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lastDayOfMonth/index.js */ "./node_modules/date-fns/esm/lastDayOfMonth/index.js"); /* harmony import */ var _startOfMonth_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../startOfMonth/index.js */ "./node_modules/date-fns/esm/startOfMonth/index.js"); /** * @name getWeeksInMonth * @category Week Helpers * @summary Get the number of calendar weeks a month spans. * * @description * Get the number of calendar weeks the month in the given date spans. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the given date * @param {Object} [options] - an object with options. * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} * @returns {Number} the number of calendar weeks * @throws {TypeError} 2 arguments required * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 * * @example * // How many calendar weeks does February 2015 span? * var result = getWeeksInMonth(new Date(2015, 1, 8)) * //=> 4 * * @example * // If the week starts on Monday, * // how many calendar weeks does July 2017 span? * var result = getWeeksInMonth(new Date(2017, 6, 5), { weekStartsOn: 1 }) * //=> 6 */ function getWeeksInMonth(date, options) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } return Object(_differenceInCalendarWeeks_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_lastDayOfMonth_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(date), Object(_startOfMonth_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(date), options) + 1; } /***/ }), /***/ "./node_modules/date-fns/esm/getYear/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/esm/getYear/index.js ***! \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getYear; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name getYear * @category Year Helpers * @summary Get the year of the given date. * * @description * Get the year of the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the given date * @returns {Number} the year * @throws {TypeError} 1 argument required * * @example * // Which year is 2 July 2014? * var result = getYear(new Date(2014, 6, 2)) * //=> 2014 */ function getYear(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var year = date.getFullYear(); return year; } /***/ }), /***/ "./node_modules/date-fns/esm/index.js": /*!********************************************!*\ !*** ./node_modules/date-fns/esm/index.js ***! \********************************************/ /*! exports provided: addDays, addHours, addISOWeekYears, addMilliseconds, addMinutes, addMonths, addQuarters, addSeconds, addWeeks, addYears, areIntervalsOverlapping, closestIndexTo, closestTo, compareAsc, compareDesc, differenceInCalendarDays, differenceInCalendarISOWeekYears, differenceInCalendarISOWeeks, differenceInCalendarMonths, differenceInCalendarQuarters, differenceInCalendarWeeks, differenceInCalendarYears, differenceInDays, differenceInHours, differenceInISOWeekYears, differenceInMilliseconds, differenceInMinutes, differenceInMonths, differenceInQuarters, differenceInSeconds, differenceInWeeks, differenceInYears, eachDayOfInterval, eachWeekOfInterval, eachWeekendOfInterval, eachWeekendOfMonth, eachWeekendOfYear, endOfDay, endOfDecade, endOfHour, endOfISOWeek, endOfISOWeekYear, endOfMinute, endOfMonth, endOfQuarter, endOfSecond, endOfWeek, endOfYear, format, formatDistance, formatDistanceStrict, formatRelative, fromUnixTime, getDate, getDay, getDayOfYear, getDaysInMonth, getDaysInYear, getDecade, getHours, getISODay, getISOWeek, getISOWeekYear, getISOWeeksInYear, getMilliseconds, getMinutes, getMonth, getOverlappingDaysInIntervals, getQuarter, getSeconds, getTime, getUnixTime, getWeek, getWeekOfMonth, getWeekYear, getWeeksInMonth, getYear, isAfter, isBefore, isDate, isEqual, isFirstDayOfMonth, isFriday, isLastDayOfMonth, isLeapYear, isMonday, isSameDay, isSameHour, isSameISOWeek, isSameISOWeekYear, isSameMinute, isSameMonth, isSameQuarter, isSameSecond, isSameWeek, isSameYear, isSaturday, isSunday, isThursday, isTuesday, isValid, isWednesday, isWeekend, isWithinInterval, lastDayOfDecade, lastDayOfISOWeek, lastDayOfISOWeekYear, lastDayOfMonth, lastDayOfQuarter, lastDayOfWeek, lastDayOfYear, lightFormat, max, min, parse, parseISO, roundToNearestMinutes, setDate, setDay, setDayOfYear, setHours, setISODay, setISOWeek, setISOWeekYear, setMilliseconds, setMinutes, setMonth, setQuarter, setSeconds, setWeek, setWeekYear, setYear, startOfDay, startOfDecade, startOfHour, startOfISOWeek, startOfISOWeekYear, startOfMinute, startOfMonth, startOfQuarter, startOfSecond, startOfWeek, startOfWeekYear, startOfYear, subDays, subHours, subISOWeekYears, subMilliseconds, subMinutes, subMonths, subQuarters, subSeconds, subWeeks, subYears, toDate */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _addDays_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./addDays/index.js */ "./node_modules/date-fns/esm/addDays/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addDays", function() { return _addDays_index_js__WEBPACK_IMPORTED_MODULE_0__["default"]; }); /* harmony import */ var _addHours_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./addHours/index.js */ "./node_modules/date-fns/esm/addHours/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addHours", function() { return _addHours_index_js__WEBPACK_IMPORTED_MODULE_1__["default"]; }); /* harmony import */ var _addISOWeekYears_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./addISOWeekYears/index.js */ "./node_modules/date-fns/esm/addISOWeekYears/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addISOWeekYears", function() { return _addISOWeekYears_index_js__WEBPACK_IMPORTED_MODULE_2__["default"]; }); /* harmony import */ var _addMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./addMilliseconds/index.js */ "./node_modules/date-fns/esm/addMilliseconds/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addMilliseconds", function() { return _addMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_3__["default"]; }); /* harmony import */ var _addMinutes_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./addMinutes/index.js */ "./node_modules/date-fns/esm/addMinutes/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addMinutes", function() { return _addMinutes_index_js__WEBPACK_IMPORTED_MODULE_4__["default"]; }); /* harmony import */ var _addMonths_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./addMonths/index.js */ "./node_modules/date-fns/esm/addMonths/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addMonths", function() { return _addMonths_index_js__WEBPACK_IMPORTED_MODULE_5__["default"]; }); /* harmony import */ var _addQuarters_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./addQuarters/index.js */ "./node_modules/date-fns/esm/addQuarters/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addQuarters", function() { return _addQuarters_index_js__WEBPACK_IMPORTED_MODULE_6__["default"]; }); /* harmony import */ var _addSeconds_index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./addSeconds/index.js */ "./node_modules/date-fns/esm/addSeconds/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addSeconds", function() { return _addSeconds_index_js__WEBPACK_IMPORTED_MODULE_7__["default"]; }); /* harmony import */ var _addWeeks_index_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./addWeeks/index.js */ "./node_modules/date-fns/esm/addWeeks/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addWeeks", function() { return _addWeeks_index_js__WEBPACK_IMPORTED_MODULE_8__["default"]; }); /* harmony import */ var _addYears_index_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./addYears/index.js */ "./node_modules/date-fns/esm/addYears/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addYears", function() { return _addYears_index_js__WEBPACK_IMPORTED_MODULE_9__["default"]; }); /* harmony import */ var _areIntervalsOverlapping_index_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./areIntervalsOverlapping/index.js */ "./node_modules/date-fns/esm/areIntervalsOverlapping/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "areIntervalsOverlapping", function() { return _areIntervalsOverlapping_index_js__WEBPACK_IMPORTED_MODULE_10__["default"]; }); /* harmony import */ var _closestIndexTo_index_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./closestIndexTo/index.js */ "./node_modules/date-fns/esm/closestIndexTo/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "closestIndexTo", function() { return _closestIndexTo_index_js__WEBPACK_IMPORTED_MODULE_11__["default"]; }); /* harmony import */ var _closestTo_index_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./closestTo/index.js */ "./node_modules/date-fns/esm/closestTo/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "closestTo", function() { return _closestTo_index_js__WEBPACK_IMPORTED_MODULE_12__["default"]; }); /* harmony import */ var _compareAsc_index_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./compareAsc/index.js */ "./node_modules/date-fns/esm/compareAsc/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "compareAsc", function() { return _compareAsc_index_js__WEBPACK_IMPORTED_MODULE_13__["default"]; }); /* harmony import */ var _compareDesc_index_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./compareDesc/index.js */ "./node_modules/date-fns/esm/compareDesc/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "compareDesc", function() { return _compareDesc_index_js__WEBPACK_IMPORTED_MODULE_14__["default"]; }); /* harmony import */ var _differenceInCalendarDays_index_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./differenceInCalendarDays/index.js */ "./node_modules/date-fns/esm/differenceInCalendarDays/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceInCalendarDays", function() { return _differenceInCalendarDays_index_js__WEBPACK_IMPORTED_MODULE_15__["default"]; }); /* harmony import */ var _differenceInCalendarISOWeekYears_index_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./differenceInCalendarISOWeekYears/index.js */ "./node_modules/date-fns/esm/differenceInCalendarISOWeekYears/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceInCalendarISOWeekYears", function() { return _differenceInCalendarISOWeekYears_index_js__WEBPACK_IMPORTED_MODULE_16__["default"]; }); /* harmony import */ var _differenceInCalendarISOWeeks_index_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./differenceInCalendarISOWeeks/index.js */ "./node_modules/date-fns/esm/differenceInCalendarISOWeeks/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceInCalendarISOWeeks", function() { return _differenceInCalendarISOWeeks_index_js__WEBPACK_IMPORTED_MODULE_17__["default"]; }); /* harmony import */ var _differenceInCalendarMonths_index_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./differenceInCalendarMonths/index.js */ "./node_modules/date-fns/esm/differenceInCalendarMonths/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceInCalendarMonths", function() { return _differenceInCalendarMonths_index_js__WEBPACK_IMPORTED_MODULE_18__["default"]; }); /* harmony import */ var _differenceInCalendarQuarters_index_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./differenceInCalendarQuarters/index.js */ "./node_modules/date-fns/esm/differenceInCalendarQuarters/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceInCalendarQuarters", function() { return _differenceInCalendarQuarters_index_js__WEBPACK_IMPORTED_MODULE_19__["default"]; }); /* harmony import */ var _differenceInCalendarWeeks_index_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./differenceInCalendarWeeks/index.js */ "./node_modules/date-fns/esm/differenceInCalendarWeeks/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceInCalendarWeeks", function() { return _differenceInCalendarWeeks_index_js__WEBPACK_IMPORTED_MODULE_20__["default"]; }); /* harmony import */ var _differenceInCalendarYears_index_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./differenceInCalendarYears/index.js */ "./node_modules/date-fns/esm/differenceInCalendarYears/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceInCalendarYears", function() { return _differenceInCalendarYears_index_js__WEBPACK_IMPORTED_MODULE_21__["default"]; }); /* harmony import */ var _differenceInDays_index_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./differenceInDays/index.js */ "./node_modules/date-fns/esm/differenceInDays/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceInDays", function() { return _differenceInDays_index_js__WEBPACK_IMPORTED_MODULE_22__["default"]; }); /* harmony import */ var _differenceInHours_index_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./differenceInHours/index.js */ "./node_modules/date-fns/esm/differenceInHours/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceInHours", function() { return _differenceInHours_index_js__WEBPACK_IMPORTED_MODULE_23__["default"]; }); /* harmony import */ var _differenceInISOWeekYears_index_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./differenceInISOWeekYears/index.js */ "./node_modules/date-fns/esm/differenceInISOWeekYears/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceInISOWeekYears", function() { return _differenceInISOWeekYears_index_js__WEBPACK_IMPORTED_MODULE_24__["default"]; }); /* harmony import */ var _differenceInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./differenceInMilliseconds/index.js */ "./node_modules/date-fns/esm/differenceInMilliseconds/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceInMilliseconds", function() { return _differenceInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_25__["default"]; }); /* harmony import */ var _differenceInMinutes_index_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./differenceInMinutes/index.js */ "./node_modules/date-fns/esm/differenceInMinutes/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceInMinutes", function() { return _differenceInMinutes_index_js__WEBPACK_IMPORTED_MODULE_26__["default"]; }); /* harmony import */ var _differenceInMonths_index_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./differenceInMonths/index.js */ "./node_modules/date-fns/esm/differenceInMonths/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceInMonths", function() { return _differenceInMonths_index_js__WEBPACK_IMPORTED_MODULE_27__["default"]; }); /* harmony import */ var _differenceInQuarters_index_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./differenceInQuarters/index.js */ "./node_modules/date-fns/esm/differenceInQuarters/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceInQuarters", function() { return _differenceInQuarters_index_js__WEBPACK_IMPORTED_MODULE_28__["default"]; }); /* harmony import */ var _differenceInSeconds_index_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./differenceInSeconds/index.js */ "./node_modules/date-fns/esm/differenceInSeconds/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceInSeconds", function() { return _differenceInSeconds_index_js__WEBPACK_IMPORTED_MODULE_29__["default"]; }); /* harmony import */ var _differenceInWeeks_index_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./differenceInWeeks/index.js */ "./node_modules/date-fns/esm/differenceInWeeks/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceInWeeks", function() { return _differenceInWeeks_index_js__WEBPACK_IMPORTED_MODULE_30__["default"]; }); /* harmony import */ var _differenceInYears_index_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./differenceInYears/index.js */ "./node_modules/date-fns/esm/differenceInYears/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceInYears", function() { return _differenceInYears_index_js__WEBPACK_IMPORTED_MODULE_31__["default"]; }); /* harmony import */ var _eachDayOfInterval_index_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./eachDayOfInterval/index.js */ "./node_modules/date-fns/esm/eachDayOfInterval/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eachDayOfInterval", function() { return _eachDayOfInterval_index_js__WEBPACK_IMPORTED_MODULE_32__["default"]; }); /* harmony import */ var _eachWeekOfInterval_index_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./eachWeekOfInterval/index.js */ "./node_modules/date-fns/esm/eachWeekOfInterval/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eachWeekOfInterval", function() { return _eachWeekOfInterval_index_js__WEBPACK_IMPORTED_MODULE_33__["default"]; }); /* harmony import */ var _eachWeekendOfInterval_index_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./eachWeekendOfInterval/index.js */ "./node_modules/date-fns/esm/eachWeekendOfInterval/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eachWeekendOfInterval", function() { return _eachWeekendOfInterval_index_js__WEBPACK_IMPORTED_MODULE_34__["default"]; }); /* harmony import */ var _eachWeekendOfMonth_index_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./eachWeekendOfMonth/index.js */ "./node_modules/date-fns/esm/eachWeekendOfMonth/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eachWeekendOfMonth", function() { return _eachWeekendOfMonth_index_js__WEBPACK_IMPORTED_MODULE_35__["default"]; }); /* harmony import */ var _eachWeekendOfYear_index_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./eachWeekendOfYear/index.js */ "./node_modules/date-fns/esm/eachWeekendOfYear/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eachWeekendOfYear", function() { return _eachWeekendOfYear_index_js__WEBPACK_IMPORTED_MODULE_36__["default"]; }); /* harmony import */ var _endOfDay_index_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./endOfDay/index.js */ "./node_modules/date-fns/esm/endOfDay/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endOfDay", function() { return _endOfDay_index_js__WEBPACK_IMPORTED_MODULE_37__["default"]; }); /* harmony import */ var _endOfDecade_index_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./endOfDecade/index.js */ "./node_modules/date-fns/esm/endOfDecade/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endOfDecade", function() { return _endOfDecade_index_js__WEBPACK_IMPORTED_MODULE_38__["default"]; }); /* harmony import */ var _endOfHour_index_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./endOfHour/index.js */ "./node_modules/date-fns/esm/endOfHour/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endOfHour", function() { return _endOfHour_index_js__WEBPACK_IMPORTED_MODULE_39__["default"]; }); /* harmony import */ var _endOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./endOfISOWeek/index.js */ "./node_modules/date-fns/esm/endOfISOWeek/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endOfISOWeek", function() { return _endOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_40__["default"]; }); /* harmony import */ var _endOfISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./endOfISOWeekYear/index.js */ "./node_modules/date-fns/esm/endOfISOWeekYear/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endOfISOWeekYear", function() { return _endOfISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_41__["default"]; }); /* harmony import */ var _endOfMinute_index_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./endOfMinute/index.js */ "./node_modules/date-fns/esm/endOfMinute/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endOfMinute", function() { return _endOfMinute_index_js__WEBPACK_IMPORTED_MODULE_42__["default"]; }); /* harmony import */ var _endOfMonth_index_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./endOfMonth/index.js */ "./node_modules/date-fns/esm/endOfMonth/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endOfMonth", function() { return _endOfMonth_index_js__WEBPACK_IMPORTED_MODULE_43__["default"]; }); /* harmony import */ var _endOfQuarter_index_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./endOfQuarter/index.js */ "./node_modules/date-fns/esm/endOfQuarter/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endOfQuarter", function() { return _endOfQuarter_index_js__WEBPACK_IMPORTED_MODULE_44__["default"]; }); /* harmony import */ var _endOfSecond_index_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./endOfSecond/index.js */ "./node_modules/date-fns/esm/endOfSecond/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endOfSecond", function() { return _endOfSecond_index_js__WEBPACK_IMPORTED_MODULE_45__["default"]; }); /* harmony import */ var _endOfWeek_index_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./endOfWeek/index.js */ "./node_modules/date-fns/esm/endOfWeek/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endOfWeek", function() { return _endOfWeek_index_js__WEBPACK_IMPORTED_MODULE_46__["default"]; }); /* harmony import */ var _endOfYear_index_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./endOfYear/index.js */ "./node_modules/date-fns/esm/endOfYear/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endOfYear", function() { return _endOfYear_index_js__WEBPACK_IMPORTED_MODULE_47__["default"]; }); /* harmony import */ var _format_index_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./format/index.js */ "./node_modules/date-fns/esm/format/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "format", function() { return _format_index_js__WEBPACK_IMPORTED_MODULE_48__["default"]; }); /* harmony import */ var _formatDistance_index_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./formatDistance/index.js */ "./node_modules/date-fns/esm/formatDistance/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "formatDistance", function() { return _formatDistance_index_js__WEBPACK_IMPORTED_MODULE_49__["default"]; }); /* harmony import */ var _formatDistanceStrict_index_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./formatDistanceStrict/index.js */ "./node_modules/date-fns/esm/formatDistanceStrict/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "formatDistanceStrict", function() { return _formatDistanceStrict_index_js__WEBPACK_IMPORTED_MODULE_50__["default"]; }); /* harmony import */ var _formatRelative_index_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./formatRelative/index.js */ "./node_modules/date-fns/esm/formatRelative/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "formatRelative", function() { return _formatRelative_index_js__WEBPACK_IMPORTED_MODULE_51__["default"]; }); /* harmony import */ var _fromUnixTime_index_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./fromUnixTime/index.js */ "./node_modules/date-fns/esm/fromUnixTime/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fromUnixTime", function() { return _fromUnixTime_index_js__WEBPACK_IMPORTED_MODULE_52__["default"]; }); /* harmony import */ var _getDate_index_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./getDate/index.js */ "./node_modules/date-fns/esm/getDate/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDate", function() { return _getDate_index_js__WEBPACK_IMPORTED_MODULE_53__["default"]; }); /* harmony import */ var _getDay_index_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./getDay/index.js */ "./node_modules/date-fns/esm/getDay/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDay", function() { return _getDay_index_js__WEBPACK_IMPORTED_MODULE_54__["default"]; }); /* harmony import */ var _getDayOfYear_index_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./getDayOfYear/index.js */ "./node_modules/date-fns/esm/getDayOfYear/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDayOfYear", function() { return _getDayOfYear_index_js__WEBPACK_IMPORTED_MODULE_55__["default"]; }); /* harmony import */ var _getDaysInMonth_index_js__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./getDaysInMonth/index.js */ "./node_modules/date-fns/esm/getDaysInMonth/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDaysInMonth", function() { return _getDaysInMonth_index_js__WEBPACK_IMPORTED_MODULE_56__["default"]; }); /* harmony import */ var _getDaysInYear_index_js__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./getDaysInYear/index.js */ "./node_modules/date-fns/esm/getDaysInYear/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDaysInYear", function() { return _getDaysInYear_index_js__WEBPACK_IMPORTED_MODULE_57__["default"]; }); /* harmony import */ var _getDecade_index_js__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./getDecade/index.js */ "./node_modules/date-fns/esm/getDecade/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDecade", function() { return _getDecade_index_js__WEBPACK_IMPORTED_MODULE_58__["default"]; }); /* harmony import */ var _getHours_index_js__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./getHours/index.js */ "./node_modules/date-fns/esm/getHours/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getHours", function() { return _getHours_index_js__WEBPACK_IMPORTED_MODULE_59__["default"]; }); /* harmony import */ var _getISODay_index_js__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./getISODay/index.js */ "./node_modules/date-fns/esm/getISODay/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getISODay", function() { return _getISODay_index_js__WEBPACK_IMPORTED_MODULE_60__["default"]; }); /* harmony import */ var _getISOWeek_index_js__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./getISOWeek/index.js */ "./node_modules/date-fns/esm/getISOWeek/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getISOWeek", function() { return _getISOWeek_index_js__WEBPACK_IMPORTED_MODULE_61__["default"]; }); /* harmony import */ var _getISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./getISOWeekYear/index.js */ "./node_modules/date-fns/esm/getISOWeekYear/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getISOWeekYear", function() { return _getISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_62__["default"]; }); /* harmony import */ var _getISOWeeksInYear_index_js__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./getISOWeeksInYear/index.js */ "./node_modules/date-fns/esm/getISOWeeksInYear/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getISOWeeksInYear", function() { return _getISOWeeksInYear_index_js__WEBPACK_IMPORTED_MODULE_63__["default"]; }); /* harmony import */ var _getMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./getMilliseconds/index.js */ "./node_modules/date-fns/esm/getMilliseconds/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getMilliseconds", function() { return _getMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_64__["default"]; }); /* harmony import */ var _getMinutes_index_js__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./getMinutes/index.js */ "./node_modules/date-fns/esm/getMinutes/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getMinutes", function() { return _getMinutes_index_js__WEBPACK_IMPORTED_MODULE_65__["default"]; }); /* harmony import */ var _getMonth_index_js__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ./getMonth/index.js */ "./node_modules/date-fns/esm/getMonth/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getMonth", function() { return _getMonth_index_js__WEBPACK_IMPORTED_MODULE_66__["default"]; }); /* harmony import */ var _getOverlappingDaysInIntervals_index_js__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ./getOverlappingDaysInIntervals/index.js */ "./node_modules/date-fns/esm/getOverlappingDaysInIntervals/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getOverlappingDaysInIntervals", function() { return _getOverlappingDaysInIntervals_index_js__WEBPACK_IMPORTED_MODULE_67__["default"]; }); /* harmony import */ var _getQuarter_index_js__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ./getQuarter/index.js */ "./node_modules/date-fns/esm/getQuarter/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getQuarter", function() { return _getQuarter_index_js__WEBPACK_IMPORTED_MODULE_68__["default"]; }); /* harmony import */ var _getSeconds_index_js__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ./getSeconds/index.js */ "./node_modules/date-fns/esm/getSeconds/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getSeconds", function() { return _getSeconds_index_js__WEBPACK_IMPORTED_MODULE_69__["default"]; }); /* harmony import */ var _getTime_index_js__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! ./getTime/index.js */ "./node_modules/date-fns/esm/getTime/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getTime", function() { return _getTime_index_js__WEBPACK_IMPORTED_MODULE_70__["default"]; }); /* harmony import */ var _getUnixTime_index_js__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! ./getUnixTime/index.js */ "./node_modules/date-fns/esm/getUnixTime/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getUnixTime", function() { return _getUnixTime_index_js__WEBPACK_IMPORTED_MODULE_71__["default"]; }); /* harmony import */ var _getWeek_index_js__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! ./getWeek/index.js */ "./node_modules/date-fns/esm/getWeek/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getWeek", function() { return _getWeek_index_js__WEBPACK_IMPORTED_MODULE_72__["default"]; }); /* harmony import */ var _getWeekOfMonth_index_js__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(/*! ./getWeekOfMonth/index.js */ "./node_modules/date-fns/esm/getWeekOfMonth/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getWeekOfMonth", function() { return _getWeekOfMonth_index_js__WEBPACK_IMPORTED_MODULE_73__["default"]; }); /* harmony import */ var _getWeekYear_index_js__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(/*! ./getWeekYear/index.js */ "./node_modules/date-fns/esm/getWeekYear/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getWeekYear", function() { return _getWeekYear_index_js__WEBPACK_IMPORTED_MODULE_74__["default"]; }); /* harmony import */ var _getWeeksInMonth_index_js__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(/*! ./getWeeksInMonth/index.js */ "./node_modules/date-fns/esm/getWeeksInMonth/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getWeeksInMonth", function() { return _getWeeksInMonth_index_js__WEBPACK_IMPORTED_MODULE_75__["default"]; }); /* harmony import */ var _getYear_index_js__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(/*! ./getYear/index.js */ "./node_modules/date-fns/esm/getYear/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getYear", function() { return _getYear_index_js__WEBPACK_IMPORTED_MODULE_76__["default"]; }); /* harmony import */ var _isAfter_index_js__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(/*! ./isAfter/index.js */ "./node_modules/date-fns/esm/isAfter/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isAfter", function() { return _isAfter_index_js__WEBPACK_IMPORTED_MODULE_77__["default"]; }); /* harmony import */ var _isBefore_index_js__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(/*! ./isBefore/index.js */ "./node_modules/date-fns/esm/isBefore/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBefore", function() { return _isBefore_index_js__WEBPACK_IMPORTED_MODULE_78__["default"]; }); /* harmony import */ var _isDate_index_js__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(/*! ./isDate/index.js */ "./node_modules/date-fns/esm/isDate/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return _isDate_index_js__WEBPACK_IMPORTED_MODULE_79__["default"]; }); /* harmony import */ var _isEqual_index_js__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(/*! ./isEqual/index.js */ "./node_modules/date-fns/esm/isEqual/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return _isEqual_index_js__WEBPACK_IMPORTED_MODULE_80__["default"]; }); /* harmony import */ var _isFirstDayOfMonth_index_js__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(/*! ./isFirstDayOfMonth/index.js */ "./node_modules/date-fns/esm/isFirstDayOfMonth/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isFirstDayOfMonth", function() { return _isFirstDayOfMonth_index_js__WEBPACK_IMPORTED_MODULE_81__["default"]; }); /* harmony import */ var _isFriday_index_js__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(/*! ./isFriday/index.js */ "./node_modules/date-fns/esm/isFriday/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isFriday", function() { return _isFriday_index_js__WEBPACK_IMPORTED_MODULE_82__["default"]; }); /* harmony import */ var _isLastDayOfMonth_index_js__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(/*! ./isLastDayOfMonth/index.js */ "./node_modules/date-fns/esm/isLastDayOfMonth/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isLastDayOfMonth", function() { return _isLastDayOfMonth_index_js__WEBPACK_IMPORTED_MODULE_83__["default"]; }); /* harmony import */ var _isLeapYear_index_js__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(/*! ./isLeapYear/index.js */ "./node_modules/date-fns/esm/isLeapYear/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isLeapYear", function() { return _isLeapYear_index_js__WEBPACK_IMPORTED_MODULE_84__["default"]; }); /* harmony import */ var _isMonday_index_js__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(/*! ./isMonday/index.js */ "./node_modules/date-fns/esm/isMonday/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMonday", function() { return _isMonday_index_js__WEBPACK_IMPORTED_MODULE_85__["default"]; }); /* harmony import */ var _isSameDay_index_js__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(/*! ./isSameDay/index.js */ "./node_modules/date-fns/esm/isSameDay/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSameDay", function() { return _isSameDay_index_js__WEBPACK_IMPORTED_MODULE_86__["default"]; }); /* harmony import */ var _isSameHour_index_js__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(/*! ./isSameHour/index.js */ "./node_modules/date-fns/esm/isSameHour/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSameHour", function() { return _isSameHour_index_js__WEBPACK_IMPORTED_MODULE_87__["default"]; }); /* harmony import */ var _isSameISOWeek_index_js__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(/*! ./isSameISOWeek/index.js */ "./node_modules/date-fns/esm/isSameISOWeek/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSameISOWeek", function() { return _isSameISOWeek_index_js__WEBPACK_IMPORTED_MODULE_88__["default"]; }); /* harmony import */ var _isSameISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(/*! ./isSameISOWeekYear/index.js */ "./node_modules/date-fns/esm/isSameISOWeekYear/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSameISOWeekYear", function() { return _isSameISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_89__["default"]; }); /* harmony import */ var _isSameMinute_index_js__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(/*! ./isSameMinute/index.js */ "./node_modules/date-fns/esm/isSameMinute/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSameMinute", function() { return _isSameMinute_index_js__WEBPACK_IMPORTED_MODULE_90__["default"]; }); /* harmony import */ var _isSameMonth_index_js__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(/*! ./isSameMonth/index.js */ "./node_modules/date-fns/esm/isSameMonth/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSameMonth", function() { return _isSameMonth_index_js__WEBPACK_IMPORTED_MODULE_91__["default"]; }); /* harmony import */ var _isSameQuarter_index_js__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(/*! ./isSameQuarter/index.js */ "./node_modules/date-fns/esm/isSameQuarter/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSameQuarter", function() { return _isSameQuarter_index_js__WEBPACK_IMPORTED_MODULE_92__["default"]; }); /* harmony import */ var _isSameSecond_index_js__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(/*! ./isSameSecond/index.js */ "./node_modules/date-fns/esm/isSameSecond/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSameSecond", function() { return _isSameSecond_index_js__WEBPACK_IMPORTED_MODULE_93__["default"]; }); /* harmony import */ var _isSameWeek_index_js__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(/*! ./isSameWeek/index.js */ "./node_modules/date-fns/esm/isSameWeek/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSameWeek", function() { return _isSameWeek_index_js__WEBPACK_IMPORTED_MODULE_94__["default"]; }); /* harmony import */ var _isSameYear_index_js__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(/*! ./isSameYear/index.js */ "./node_modules/date-fns/esm/isSameYear/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSameYear", function() { return _isSameYear_index_js__WEBPACK_IMPORTED_MODULE_95__["default"]; }); /* harmony import */ var _isSaturday_index_js__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(/*! ./isSaturday/index.js */ "./node_modules/date-fns/esm/isSaturday/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSaturday", function() { return _isSaturday_index_js__WEBPACK_IMPORTED_MODULE_96__["default"]; }); /* harmony import */ var _isSunday_index_js__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(/*! ./isSunday/index.js */ "./node_modules/date-fns/esm/isSunday/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSunday", function() { return _isSunday_index_js__WEBPACK_IMPORTED_MODULE_97__["default"]; }); /* harmony import */ var _isThursday_index_js__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(/*! ./isThursday/index.js */ "./node_modules/date-fns/esm/isThursday/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isThursday", function() { return _isThursday_index_js__WEBPACK_IMPORTED_MODULE_98__["default"]; }); /* harmony import */ var _isTuesday_index_js__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(/*! ./isTuesday/index.js */ "./node_modules/date-fns/esm/isTuesday/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isTuesday", function() { return _isTuesday_index_js__WEBPACK_IMPORTED_MODULE_99__["default"]; }); /* harmony import */ var _isValid_index_js__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(/*! ./isValid/index.js */ "./node_modules/date-fns/esm/isValid/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isValid", function() { return _isValid_index_js__WEBPACK_IMPORTED_MODULE_100__["default"]; }); /* harmony import */ var _isWednesday_index_js__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(/*! ./isWednesday/index.js */ "./node_modules/date-fns/esm/isWednesday/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWednesday", function() { return _isWednesday_index_js__WEBPACK_IMPORTED_MODULE_101__["default"]; }); /* harmony import */ var _isWeekend_index_js__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(/*! ./isWeekend/index.js */ "./node_modules/date-fns/esm/isWeekend/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWeekend", function() { return _isWeekend_index_js__WEBPACK_IMPORTED_MODULE_102__["default"]; }); /* harmony import */ var _isWithinInterval_index_js__WEBPACK_IMPORTED_MODULE_103__ = __webpack_require__(/*! ./isWithinInterval/index.js */ "./node_modules/date-fns/esm/isWithinInterval/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWithinInterval", function() { return _isWithinInterval_index_js__WEBPACK_IMPORTED_MODULE_103__["default"]; }); /* harmony import */ var _lastDayOfDecade_index_js__WEBPACK_IMPORTED_MODULE_104__ = __webpack_require__(/*! ./lastDayOfDecade/index.js */ "./node_modules/date-fns/esm/lastDayOfDecade/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lastDayOfDecade", function() { return _lastDayOfDecade_index_js__WEBPACK_IMPORTED_MODULE_104__["default"]; }); /* harmony import */ var _lastDayOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_105__ = __webpack_require__(/*! ./lastDayOfISOWeek/index.js */ "./node_modules/date-fns/esm/lastDayOfISOWeek/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lastDayOfISOWeek", function() { return _lastDayOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_105__["default"]; }); /* harmony import */ var _lastDayOfISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_106__ = __webpack_require__(/*! ./lastDayOfISOWeekYear/index.js */ "./node_modules/date-fns/esm/lastDayOfISOWeekYear/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lastDayOfISOWeekYear", function() { return _lastDayOfISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_106__["default"]; }); /* harmony import */ var _lastDayOfMonth_index_js__WEBPACK_IMPORTED_MODULE_107__ = __webpack_require__(/*! ./lastDayOfMonth/index.js */ "./node_modules/date-fns/esm/lastDayOfMonth/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lastDayOfMonth", function() { return _lastDayOfMonth_index_js__WEBPACK_IMPORTED_MODULE_107__["default"]; }); /* harmony import */ var _lastDayOfQuarter_index_js__WEBPACK_IMPORTED_MODULE_108__ = __webpack_require__(/*! ./lastDayOfQuarter/index.js */ "./node_modules/date-fns/esm/lastDayOfQuarter/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lastDayOfQuarter", function() { return _lastDayOfQuarter_index_js__WEBPACK_IMPORTED_MODULE_108__["default"]; }); /* harmony import */ var _lastDayOfWeek_index_js__WEBPACK_IMPORTED_MODULE_109__ = __webpack_require__(/*! ./lastDayOfWeek/index.js */ "./node_modules/date-fns/esm/lastDayOfWeek/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lastDayOfWeek", function() { return _lastDayOfWeek_index_js__WEBPACK_IMPORTED_MODULE_109__["default"]; }); /* harmony import */ var _lastDayOfYear_index_js__WEBPACK_IMPORTED_MODULE_110__ = __webpack_require__(/*! ./lastDayOfYear/index.js */ "./node_modules/date-fns/esm/lastDayOfYear/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lastDayOfYear", function() { return _lastDayOfYear_index_js__WEBPACK_IMPORTED_MODULE_110__["default"]; }); /* harmony import */ var _lightFormat_index_js__WEBPACK_IMPORTED_MODULE_111__ = __webpack_require__(/*! ./lightFormat/index.js */ "./node_modules/date-fns/esm/lightFormat/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lightFormat", function() { return _lightFormat_index_js__WEBPACK_IMPORTED_MODULE_111__["default"]; }); /* harmony import */ var _max_index_js__WEBPACK_IMPORTED_MODULE_112__ = __webpack_require__(/*! ./max/index.js */ "./node_modules/date-fns/esm/max/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "max", function() { return _max_index_js__WEBPACK_IMPORTED_MODULE_112__["default"]; }); /* harmony import */ var _min_index_js__WEBPACK_IMPORTED_MODULE_113__ = __webpack_require__(/*! ./min/index.js */ "./node_modules/date-fns/esm/min/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "min", function() { return _min_index_js__WEBPACK_IMPORTED_MODULE_113__["default"]; }); /* harmony import */ var _parse_index_js__WEBPACK_IMPORTED_MODULE_114__ = __webpack_require__(/*! ./parse/index.js */ "./node_modules/date-fns/esm/parse/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parse", function() { return _parse_index_js__WEBPACK_IMPORTED_MODULE_114__["default"]; }); /* harmony import */ var _parseISO_index_js__WEBPACK_IMPORTED_MODULE_115__ = __webpack_require__(/*! ./parseISO/index.js */ "./node_modules/date-fns/esm/parseISO/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseISO", function() { return _parseISO_index_js__WEBPACK_IMPORTED_MODULE_115__["default"]; }); /* harmony import */ var _roundToNearestMinutes_index_js__WEBPACK_IMPORTED_MODULE_116__ = __webpack_require__(/*! ./roundToNearestMinutes/index.js */ "./node_modules/date-fns/esm/roundToNearestMinutes/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "roundToNearestMinutes", function() { return _roundToNearestMinutes_index_js__WEBPACK_IMPORTED_MODULE_116__["default"]; }); /* harmony import */ var _setDate_index_js__WEBPACK_IMPORTED_MODULE_117__ = __webpack_require__(/*! ./setDate/index.js */ "./node_modules/date-fns/esm/setDate/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setDate", function() { return _setDate_index_js__WEBPACK_IMPORTED_MODULE_117__["default"]; }); /* harmony import */ var _setDay_index_js__WEBPACK_IMPORTED_MODULE_118__ = __webpack_require__(/*! ./setDay/index.js */ "./node_modules/date-fns/esm/setDay/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setDay", function() { return _setDay_index_js__WEBPACK_IMPORTED_MODULE_118__["default"]; }); /* harmony import */ var _setDayOfYear_index_js__WEBPACK_IMPORTED_MODULE_119__ = __webpack_require__(/*! ./setDayOfYear/index.js */ "./node_modules/date-fns/esm/setDayOfYear/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setDayOfYear", function() { return _setDayOfYear_index_js__WEBPACK_IMPORTED_MODULE_119__["default"]; }); /* harmony import */ var _setHours_index_js__WEBPACK_IMPORTED_MODULE_120__ = __webpack_require__(/*! ./setHours/index.js */ "./node_modules/date-fns/esm/setHours/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setHours", function() { return _setHours_index_js__WEBPACK_IMPORTED_MODULE_120__["default"]; }); /* harmony import */ var _setISODay_index_js__WEBPACK_IMPORTED_MODULE_121__ = __webpack_require__(/*! ./setISODay/index.js */ "./node_modules/date-fns/esm/setISODay/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setISODay", function() { return _setISODay_index_js__WEBPACK_IMPORTED_MODULE_121__["default"]; }); /* harmony import */ var _setISOWeek_index_js__WEBPACK_IMPORTED_MODULE_122__ = __webpack_require__(/*! ./setISOWeek/index.js */ "./node_modules/date-fns/esm/setISOWeek/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setISOWeek", function() { return _setISOWeek_index_js__WEBPACK_IMPORTED_MODULE_122__["default"]; }); /* harmony import */ var _setISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_123__ = __webpack_require__(/*! ./setISOWeekYear/index.js */ "./node_modules/date-fns/esm/setISOWeekYear/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setISOWeekYear", function() { return _setISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_123__["default"]; }); /* harmony import */ var _setMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_124__ = __webpack_require__(/*! ./setMilliseconds/index.js */ "./node_modules/date-fns/esm/setMilliseconds/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setMilliseconds", function() { return _setMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_124__["default"]; }); /* harmony import */ var _setMinutes_index_js__WEBPACK_IMPORTED_MODULE_125__ = __webpack_require__(/*! ./setMinutes/index.js */ "./node_modules/date-fns/esm/setMinutes/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setMinutes", function() { return _setMinutes_index_js__WEBPACK_IMPORTED_MODULE_125__["default"]; }); /* harmony import */ var _setMonth_index_js__WEBPACK_IMPORTED_MODULE_126__ = __webpack_require__(/*! ./setMonth/index.js */ "./node_modules/date-fns/esm/setMonth/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setMonth", function() { return _setMonth_index_js__WEBPACK_IMPORTED_MODULE_126__["default"]; }); /* harmony import */ var _setQuarter_index_js__WEBPACK_IMPORTED_MODULE_127__ = __webpack_require__(/*! ./setQuarter/index.js */ "./node_modules/date-fns/esm/setQuarter/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setQuarter", function() { return _setQuarter_index_js__WEBPACK_IMPORTED_MODULE_127__["default"]; }); /* harmony import */ var _setSeconds_index_js__WEBPACK_IMPORTED_MODULE_128__ = __webpack_require__(/*! ./setSeconds/index.js */ "./node_modules/date-fns/esm/setSeconds/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setSeconds", function() { return _setSeconds_index_js__WEBPACK_IMPORTED_MODULE_128__["default"]; }); /* harmony import */ var _setWeek_index_js__WEBPACK_IMPORTED_MODULE_129__ = __webpack_require__(/*! ./setWeek/index.js */ "./node_modules/date-fns/esm/setWeek/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setWeek", function() { return _setWeek_index_js__WEBPACK_IMPORTED_MODULE_129__["default"]; }); /* harmony import */ var _setWeekYear_index_js__WEBPACK_IMPORTED_MODULE_130__ = __webpack_require__(/*! ./setWeekYear/index.js */ "./node_modules/date-fns/esm/setWeekYear/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setWeekYear", function() { return _setWeekYear_index_js__WEBPACK_IMPORTED_MODULE_130__["default"]; }); /* harmony import */ var _setYear_index_js__WEBPACK_IMPORTED_MODULE_131__ = __webpack_require__(/*! ./setYear/index.js */ "./node_modules/date-fns/esm/setYear/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setYear", function() { return _setYear_index_js__WEBPACK_IMPORTED_MODULE_131__["default"]; }); /* harmony import */ var _startOfDay_index_js__WEBPACK_IMPORTED_MODULE_132__ = __webpack_require__(/*! ./startOfDay/index.js */ "./node_modules/date-fns/esm/startOfDay/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startOfDay", function() { return _startOfDay_index_js__WEBPACK_IMPORTED_MODULE_132__["default"]; }); /* harmony import */ var _startOfDecade_index_js__WEBPACK_IMPORTED_MODULE_133__ = __webpack_require__(/*! ./startOfDecade/index.js */ "./node_modules/date-fns/esm/startOfDecade/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startOfDecade", function() { return _startOfDecade_index_js__WEBPACK_IMPORTED_MODULE_133__["default"]; }); /* harmony import */ var _startOfHour_index_js__WEBPACK_IMPORTED_MODULE_134__ = __webpack_require__(/*! ./startOfHour/index.js */ "./node_modules/date-fns/esm/startOfHour/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startOfHour", function() { return _startOfHour_index_js__WEBPACK_IMPORTED_MODULE_134__["default"]; }); /* harmony import */ var _startOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_135__ = __webpack_require__(/*! ./startOfISOWeek/index.js */ "./node_modules/date-fns/esm/startOfISOWeek/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startOfISOWeek", function() { return _startOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_135__["default"]; }); /* harmony import */ var _startOfISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_136__ = __webpack_require__(/*! ./startOfISOWeekYear/index.js */ "./node_modules/date-fns/esm/startOfISOWeekYear/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startOfISOWeekYear", function() { return _startOfISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_136__["default"]; }); /* harmony import */ var _startOfMinute_index_js__WEBPACK_IMPORTED_MODULE_137__ = __webpack_require__(/*! ./startOfMinute/index.js */ "./node_modules/date-fns/esm/startOfMinute/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startOfMinute", function() { return _startOfMinute_index_js__WEBPACK_IMPORTED_MODULE_137__["default"]; }); /* harmony import */ var _startOfMonth_index_js__WEBPACK_IMPORTED_MODULE_138__ = __webpack_require__(/*! ./startOfMonth/index.js */ "./node_modules/date-fns/esm/startOfMonth/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startOfMonth", function() { return _startOfMonth_index_js__WEBPACK_IMPORTED_MODULE_138__["default"]; }); /* harmony import */ var _startOfQuarter_index_js__WEBPACK_IMPORTED_MODULE_139__ = __webpack_require__(/*! ./startOfQuarter/index.js */ "./node_modules/date-fns/esm/startOfQuarter/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startOfQuarter", function() { return _startOfQuarter_index_js__WEBPACK_IMPORTED_MODULE_139__["default"]; }); /* harmony import */ var _startOfSecond_index_js__WEBPACK_IMPORTED_MODULE_140__ = __webpack_require__(/*! ./startOfSecond/index.js */ "./node_modules/date-fns/esm/startOfSecond/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startOfSecond", function() { return _startOfSecond_index_js__WEBPACK_IMPORTED_MODULE_140__["default"]; }); /* harmony import */ var _startOfWeek_index_js__WEBPACK_IMPORTED_MODULE_141__ = __webpack_require__(/*! ./startOfWeek/index.js */ "./node_modules/date-fns/esm/startOfWeek/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startOfWeek", function() { return _startOfWeek_index_js__WEBPACK_IMPORTED_MODULE_141__["default"]; }); /* harmony import */ var _startOfWeekYear_index_js__WEBPACK_IMPORTED_MODULE_142__ = __webpack_require__(/*! ./startOfWeekYear/index.js */ "./node_modules/date-fns/esm/startOfWeekYear/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startOfWeekYear", function() { return _startOfWeekYear_index_js__WEBPACK_IMPORTED_MODULE_142__["default"]; }); /* harmony import */ var _startOfYear_index_js__WEBPACK_IMPORTED_MODULE_143__ = __webpack_require__(/*! ./startOfYear/index.js */ "./node_modules/date-fns/esm/startOfYear/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startOfYear", function() { return _startOfYear_index_js__WEBPACK_IMPORTED_MODULE_143__["default"]; }); /* harmony import */ var _subDays_index_js__WEBPACK_IMPORTED_MODULE_144__ = __webpack_require__(/*! ./subDays/index.js */ "./node_modules/date-fns/esm/subDays/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subDays", function() { return _subDays_index_js__WEBPACK_IMPORTED_MODULE_144__["default"]; }); /* harmony import */ var _subHours_index_js__WEBPACK_IMPORTED_MODULE_145__ = __webpack_require__(/*! ./subHours/index.js */ "./node_modules/date-fns/esm/subHours/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subHours", function() { return _subHours_index_js__WEBPACK_IMPORTED_MODULE_145__["default"]; }); /* harmony import */ var _subISOWeekYears_index_js__WEBPACK_IMPORTED_MODULE_146__ = __webpack_require__(/*! ./subISOWeekYears/index.js */ "./node_modules/date-fns/esm/subISOWeekYears/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subISOWeekYears", function() { return _subISOWeekYears_index_js__WEBPACK_IMPORTED_MODULE_146__["default"]; }); /* harmony import */ var _subMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_147__ = __webpack_require__(/*! ./subMilliseconds/index.js */ "./node_modules/date-fns/esm/subMilliseconds/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subMilliseconds", function() { return _subMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_147__["default"]; }); /* harmony import */ var _subMinutes_index_js__WEBPACK_IMPORTED_MODULE_148__ = __webpack_require__(/*! ./subMinutes/index.js */ "./node_modules/date-fns/esm/subMinutes/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subMinutes", function() { return _subMinutes_index_js__WEBPACK_IMPORTED_MODULE_148__["default"]; }); /* harmony import */ var _subMonths_index_js__WEBPACK_IMPORTED_MODULE_149__ = __webpack_require__(/*! ./subMonths/index.js */ "./node_modules/date-fns/esm/subMonths/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subMonths", function() { return _subMonths_index_js__WEBPACK_IMPORTED_MODULE_149__["default"]; }); /* harmony import */ var _subQuarters_index_js__WEBPACK_IMPORTED_MODULE_150__ = __webpack_require__(/*! ./subQuarters/index.js */ "./node_modules/date-fns/esm/subQuarters/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subQuarters", function() { return _subQuarters_index_js__WEBPACK_IMPORTED_MODULE_150__["default"]; }); /* harmony import */ var _subSeconds_index_js__WEBPACK_IMPORTED_MODULE_151__ = __webpack_require__(/*! ./subSeconds/index.js */ "./node_modules/date-fns/esm/subSeconds/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subSeconds", function() { return _subSeconds_index_js__WEBPACK_IMPORTED_MODULE_151__["default"]; }); /* harmony import */ var _subWeeks_index_js__WEBPACK_IMPORTED_MODULE_152__ = __webpack_require__(/*! ./subWeeks/index.js */ "./node_modules/date-fns/esm/subWeeks/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subWeeks", function() { return _subWeeks_index_js__WEBPACK_IMPORTED_MODULE_152__["default"]; }); /* harmony import */ var _subYears_index_js__WEBPACK_IMPORTED_MODULE_153__ = __webpack_require__(/*! ./subYears/index.js */ "./node_modules/date-fns/esm/subYears/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subYears", function() { return _subYears_index_js__WEBPACK_IMPORTED_MODULE_153__["default"]; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_154__ = __webpack_require__(/*! ./toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toDate", function() { return _toDate_index_js__WEBPACK_IMPORTED_MODULE_154__["default"]; }); // This file is generated automatically by `scripts/build/indices.js`. Please, don't change it. /***/ }), /***/ "./node_modules/date-fns/esm/isAfter/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/esm/isAfter/index.js ***! \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isAfter; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name isAfter * @category Common Helpers * @summary Is the first date after the second one? * * @description * Is the first date after the second one? * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date that should be after the other one to return true * @param {Date|Number} dateToCompare - the date to compare with * @returns {Boolean} the first date is after the second date * @throws {TypeError} 2 arguments required * * @example * // Is 10 July 1989 after 11 February 1987? * var result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11)) * //=> true */ function isAfter(dirtyDate, dirtyDateToCompare) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var dateToCompare = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateToCompare); return date.getTime() > dateToCompare.getTime(); } /***/ }), /***/ "./node_modules/date-fns/esm/isBefore/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/esm/isBefore/index.js ***! \*****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isBefore; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name isBefore * @category Common Helpers * @summary Is the first date before the second one? * * @description * Is the first date before the second one? * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date that should be before the other one to return true * @param {Date|Number} dateToCompare - the date to compare with * @returns {Boolean} the first date is before the second date * @throws {TypeError} 2 arguments required * * @example * // Is 10 July 1989 before 11 February 1987? * var result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11)) * //=> false */ function isBefore(dirtyDate, dirtyDateToCompare) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var dateToCompare = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateToCompare); return date.getTime() < dateToCompare.getTime(); } /***/ }), /***/ "./node_modules/date-fns/esm/isDate/index.js": /*!***************************************************!*\ !*** ./node_modules/date-fns/esm/isDate/index.js ***! \***************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isDate; }); /** * @name isDate * @category Common Helpers * @summary Is the given value a date? * * @description * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {*} value - the value to check * @returns {boolean} true if the given value is a date * @throws {TypeError} 1 arguments required * * @example * // For a valid date: * var result = isDate(new Date()) * //=> true * * @example * // For an invalid date: * var result = isDate(new Date(NaN)) * //=> true * * @example * // For some value: * var result = isDate('2014-02-31') * //=> false * * @example * // For an object: * var result = isDate({}) * //=> false */ function isDate(value) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } return value instanceof Date || typeof value === 'object' && Object.prototype.toString.call(value) === '[object Date]'; } /***/ }), /***/ "./node_modules/date-fns/esm/isEqual/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/esm/isEqual/index.js ***! \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isEqual; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name isEqual * @category Common Helpers * @summary Are the given dates equal? * * @description * Are the given dates equal? * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the first date to compare * @param {Date|Number} dateRight - the second date to compare * @returns {Boolean} the dates are equal * @throws {TypeError} 2 arguments required * * @example * // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal? * var result = isEqual( * new Date(2014, 6, 2, 6, 30, 45, 0), * new Date(2014, 6, 2, 6, 30, 45, 500) * ) * //=> false */ function isEqual(dirtyLeftDate, dirtyRightDate) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var dateLeft = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyLeftDate); var dateRight = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyRightDate); return dateLeft.getTime() === dateRight.getTime(); } /***/ }), /***/ "./node_modules/date-fns/esm/isFirstDayOfMonth/index.js": /*!**************************************************************!*\ !*** ./node_modules/date-fns/esm/isFirstDayOfMonth/index.js ***! \**************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isFirstDayOfMonth; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name isFirstDayOfMonth * @category Month Helpers * @summary Is the given date the first day of a month? * * @description * Is the given date the first day of a month? * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to check * @returns {Boolean} the date is the first day of a month * @throws {TypeError} 1 argument required * * @example * // Is 1 September 2014 the first day of a month? * var result = isFirstDayOfMonth(new Date(2014, 8, 1)) * //=> true */ function isFirstDayOfMonth(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } return Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate).getDate() === 1; } /***/ }), /***/ "./node_modules/date-fns/esm/isFriday/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/esm/isFriday/index.js ***! \*****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isFriday; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name isFriday * @category Weekday Helpers * @summary Is the given date Friday? * * @description * Is the given date Friday? * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to check * @returns {Boolean} the date is Friday * @throws {TypeError} 1 argument required * * @example * // Is 26 September 2014 Friday? * var result = isFriday(new Date(2014, 8, 26)) * //=> true */ function isFriday(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } return Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate).getDay() === 5; } /***/ }), /***/ "./node_modules/date-fns/esm/isLastDayOfMonth/index.js": /*!*************************************************************!*\ !*** ./node_modules/date-fns/esm/isLastDayOfMonth/index.js ***! \*************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isLastDayOfMonth; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _endOfDay_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../endOfDay/index.js */ "./node_modules/date-fns/esm/endOfDay/index.js"); /* harmony import */ var _endOfMonth_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../endOfMonth/index.js */ "./node_modules/date-fns/esm/endOfMonth/index.js"); /** * @name isLastDayOfMonth * @category Month Helpers * @summary Is the given date the last day of a month? * * @description * Is the given date the last day of a month? * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to check * @returns {Boolean} the date is the last day of a month * @throws {TypeError} 1 argument required * * @example * // Is 28 February 2014 the last day of a month? * var result = isLastDayOfMonth(new Date(2014, 1, 28)) * //=> true */ function isLastDayOfMonth(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); return Object(_endOfDay_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(date).getTime() === Object(_endOfMonth_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(date).getTime(); } /***/ }), /***/ "./node_modules/date-fns/esm/isLeapYear/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/esm/isLeapYear/index.js ***! \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isLeapYear; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name isLeapYear * @category Year Helpers * @summary Is the given date in the leap year? * * @description * Is the given date in the leap year? * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to check * @returns {Boolean} the date is in the leap year * @throws {TypeError} 1 argument required * * @example * // Is 1 September 2012 in the leap year? * var result = isLeapYear(new Date(2012, 8, 1)) * //=> true */ function isLeapYear(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var year = date.getFullYear(); return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0; } /***/ }), /***/ "./node_modules/date-fns/esm/isMonday/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/esm/isMonday/index.js ***! \*****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isMonday; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name isMonday * @category Weekday Helpers * @summary Is the given date Monday? * * @description * Is the given date Monday? * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to check * @returns {Boolean} the date is Monday * @throws {TypeError} 1 argument required * * @example * // Is 22 September 2014 Monday? * var result = isMonday(new Date(2014, 8, 22)) * //=> true */ function isMonday(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } return Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate).getDay() === 1; } /***/ }), /***/ "./node_modules/date-fns/esm/isSameDay/index.js": /*!******************************************************!*\ !*** ./node_modules/date-fns/esm/isSameDay/index.js ***! \******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isSameDay; }); /* harmony import */ var _startOfDay_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../startOfDay/index.js */ "./node_modules/date-fns/esm/startOfDay/index.js"); /** * @name isSameDay * @category Day Helpers * @summary Are the given dates in the same day? * * @description * Are the given dates in the same day? * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the first date to check * @param {Date|Number} dateRight - the second date to check * @returns {Boolean} the dates are in the same day * @throws {TypeError} 2 arguments required * * @example * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day? * var result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0)) * //=> true */ function isSameDay(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var dateLeftStartOfDay = Object(_startOfDay_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateLeft); var dateRightStartOfDay = Object(_startOfDay_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateRight); return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime(); } /***/ }), /***/ "./node_modules/date-fns/esm/isSameHour/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/esm/isSameHour/index.js ***! \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isSameHour; }); /* harmony import */ var _startOfHour_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../startOfHour/index.js */ "./node_modules/date-fns/esm/startOfHour/index.js"); /** * @name isSameHour * @category Hour Helpers * @summary Are the given dates in the same hour? * * @description * Are the given dates in the same hour? * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the first date to check * @param {Date|Number} dateRight - the second date to check * @returns {Boolean} the dates are in the same hour * @throws {TypeError} 2 arguments required * * @example * // Are 4 September 2014 06:00:00 and 4 September 06:30:00 in the same hour? * var result = isSameHour(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 6, 30)) * //=> true */ function isSameHour(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var dateLeftStartOfHour = Object(_startOfHour_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateLeft); var dateRightStartOfHour = Object(_startOfHour_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateRight); return dateLeftStartOfHour.getTime() === dateRightStartOfHour.getTime(); } /***/ }), /***/ "./node_modules/date-fns/esm/isSameISOWeek/index.js": /*!**********************************************************!*\ !*** ./node_modules/date-fns/esm/isSameISOWeek/index.js ***! \**********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isSameISOWeek; }); /* harmony import */ var _isSameWeek_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../isSameWeek/index.js */ "./node_modules/date-fns/esm/isSameWeek/index.js"); /** * @name isSameISOWeek * @category ISO Week Helpers * @summary Are the given dates in the same ISO week? * * @description * Are the given dates in the same ISO week? * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the first date to check * @param {Date|Number} dateRight - the second date to check * @returns {Boolean} the dates are in the same ISO week * @throws {TypeError} 2 arguments required * * @example * // Are 1 September 2014 and 7 September 2014 in the same ISO week? * var result = isSameISOWeek(new Date(2014, 8, 1), new Date(2014, 8, 7)) * //=> true */ function isSameISOWeek(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } return Object(_isSameWeek_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateLeft, dirtyDateRight, { weekStartsOn: 1 }); } /***/ }), /***/ "./node_modules/date-fns/esm/isSameISOWeekYear/index.js": /*!**************************************************************!*\ !*** ./node_modules/date-fns/esm/isSameISOWeekYear/index.js ***! \**************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isSameISOWeekYear; }); /* harmony import */ var _startOfISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../startOfISOWeekYear/index.js */ "./node_modules/date-fns/esm/startOfISOWeekYear/index.js"); /** * @name isSameISOWeekYear * @category ISO Week-Numbering Year Helpers * @summary Are the given dates in the same ISO week-numbering year? * * @description * Are the given dates in the same ISO week-numbering year? * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * - The function was renamed from `isSameISOYear` to `isSameISOWeekYear`. * "ISO week year" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date). * This change makes the name consistent with * locale-dependent week-numbering year helpers, e.g., `getWeekYear`. * * @param {Date|Number} dateLeft - the first date to check * @param {Date|Number} dateRight - the second date to check * @returns {Boolean} the dates are in the same ISO week-numbering year * @throws {TypeError} 2 arguments required * * @example * // Are 29 December 2003 and 2 January 2005 in the same ISO week-numbering year? * var result = isSameISOWeekYear(new Date(2003, 11, 29), new Date(2005, 0, 2)) * //=> true */ function isSameISOWeekYear(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var dateLeftStartOfYear = Object(_startOfISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateLeft); var dateRightStartOfYear = Object(_startOfISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateRight); return dateLeftStartOfYear.getTime() === dateRightStartOfYear.getTime(); } /***/ }), /***/ "./node_modules/date-fns/esm/isSameMinute/index.js": /*!*********************************************************!*\ !*** ./node_modules/date-fns/esm/isSameMinute/index.js ***! \*********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isSameMinute; }); /* harmony import */ var _startOfMinute_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../startOfMinute/index.js */ "./node_modules/date-fns/esm/startOfMinute/index.js"); /** * @name isSameMinute * @category Minute Helpers * @summary Are the given dates in the same minute? * * @description * Are the given dates in the same minute? * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the first date to check * @param {Date|Number} dateRight - the second date to check * @returns {Boolean} the dates are in the same minute * @throws {TypeError} 2 arguments required * * @example * // Are 4 September 2014 06:30:00 and 4 September 2014 06:30:15 * // in the same minute? * var result = isSameMinute( * new Date(2014, 8, 4, 6, 30), * new Date(2014, 8, 4, 6, 30, 15) * ) * //=> true */ function isSameMinute(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var dateLeftStartOfMinute = Object(_startOfMinute_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateLeft); var dateRightStartOfMinute = Object(_startOfMinute_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateRight); return dateLeftStartOfMinute.getTime() === dateRightStartOfMinute.getTime(); } /***/ }), /***/ "./node_modules/date-fns/esm/isSameMonth/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/esm/isSameMonth/index.js ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isSameMonth; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name isSameMonth * @category Month Helpers * @summary Are the given dates in the same month? * * @description * Are the given dates in the same month? * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the first date to check * @param {Date|Number} dateRight - the second date to check * @returns {Boolean} the dates are in the same month * @throws {TypeError} 2 arguments required * * @example * // Are 2 September 2014 and 25 September 2014 in the same month? * var result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25)) * //=> true */ function isSameMonth(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var dateLeft = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateLeft); var dateRight = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateRight); return dateLeft.getFullYear() === dateRight.getFullYear() && dateLeft.getMonth() === dateRight.getMonth(); } /***/ }), /***/ "./node_modules/date-fns/esm/isSameQuarter/index.js": /*!**********************************************************!*\ !*** ./node_modules/date-fns/esm/isSameQuarter/index.js ***! \**********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isSameQuarter; }); /* harmony import */ var _startOfQuarter_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../startOfQuarter/index.js */ "./node_modules/date-fns/esm/startOfQuarter/index.js"); /** * @name isSameQuarter * @category Quarter Helpers * @summary Are the given dates in the same year quarter? * * @description * Are the given dates in the same year quarter? * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the first date to check * @param {Date|Number} dateRight - the second date to check * @returns {Boolean} the dates are in the same quarter * @throws {TypeError} 2 arguments required * * @example * // Are 1 January 2014 and 8 March 2014 in the same quarter? * var result = isSameQuarter(new Date(2014, 0, 1), new Date(2014, 2, 8)) * //=> true */ function isSameQuarter(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var dateLeftStartOfQuarter = Object(_startOfQuarter_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateLeft); var dateRightStartOfQuarter = Object(_startOfQuarter_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateRight); return dateLeftStartOfQuarter.getTime() === dateRightStartOfQuarter.getTime(); } /***/ }), /***/ "./node_modules/date-fns/esm/isSameSecond/index.js": /*!*********************************************************!*\ !*** ./node_modules/date-fns/esm/isSameSecond/index.js ***! \*********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isSameSecond; }); /* harmony import */ var _startOfSecond_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../startOfSecond/index.js */ "./node_modules/date-fns/esm/startOfSecond/index.js"); /** * @name isSameSecond * @category Second Helpers * @summary Are the given dates in the same second? * * @description * Are the given dates in the same second? * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the first date to check * @param {Date|Number} dateRight - the second date to check * @returns {Boolean} the dates are in the same second * @throws {TypeError} 2 arguments required * * @example * // Are 4 September 2014 06:30:15.000 and 4 September 2014 06:30.15.500 * // in the same second? * var result = isSameSecond( * new Date(2014, 8, 4, 6, 30, 15), * new Date(2014, 8, 4, 6, 30, 15, 500) * ) * //=> true */ function isSameSecond(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var dateLeftStartOfSecond = Object(_startOfSecond_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateLeft); var dateRightStartOfSecond = Object(_startOfSecond_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateRight); return dateLeftStartOfSecond.getTime() === dateRightStartOfSecond.getTime(); } /***/ }), /***/ "./node_modules/date-fns/esm/isSameWeek/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/esm/isSameWeek/index.js ***! \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isSameWeek; }); /* harmony import */ var _startOfWeek_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../startOfWeek/index.js */ "./node_modules/date-fns/esm/startOfWeek/index.js"); /** * @name isSameWeek * @category Week Helpers * @summary Are the given dates in the same week? * * @description * Are the given dates in the same week? * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the first date to check * @param {Date|Number} dateRight - the second date to check * @param {Object} [options] - an object with options. * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} * @returns {Boolean} the dates are in the same week * @throws {TypeError} 2 arguments required * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 * * @example * // Are 31 August 2014 and 4 September 2014 in the same week? * var result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4)) * //=> true * * @example * // If week starts with Monday, * // are 31 August 2014 and 4 September 2014 in the same week? * var result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4), { * weekStartsOn: 1 * }) * //=> false */ function isSameWeek(dirtyDateLeft, dirtyDateRight, dirtyOptions) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var dateLeftStartOfWeek = Object(_startOfWeek_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateLeft, dirtyOptions); var dateRightStartOfWeek = Object(_startOfWeek_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateRight, dirtyOptions); return dateLeftStartOfWeek.getTime() === dateRightStartOfWeek.getTime(); } /***/ }), /***/ "./node_modules/date-fns/esm/isSameYear/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/esm/isSameYear/index.js ***! \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isSameYear; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name isSameYear * @category Year Helpers * @summary Are the given dates in the same year? * * @description * Are the given dates in the same year? * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} dateLeft - the first date to check * @param {Date|Number} dateRight - the second date to check * @returns {Boolean} the dates are in the same year * @throws {TypeError} 2 arguments required * * @example * // Are 2 September 2014 and 25 September 2014 in the same year? * var result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25)) * //=> true */ function isSameYear(dirtyDateLeft, dirtyDateRight) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var dateLeft = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateLeft); var dateRight = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDateRight); return dateLeft.getFullYear() === dateRight.getFullYear(); } /***/ }), /***/ "./node_modules/date-fns/esm/isSaturday/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/esm/isSaturday/index.js ***! \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isSaturday; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name isSaturday * @category Weekday Helpers * @summary Is the given date Saturday? * * @description * Is the given date Saturday? * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to check * @returns {Boolean} the date is Saturday * @throws {TypeError} 1 argument required * * @example * // Is 27 September 2014 Saturday? * var result = isSaturday(new Date(2014, 8, 27)) * //=> true */ function isSaturday(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } return Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate).getDay() === 6; } /***/ }), /***/ "./node_modules/date-fns/esm/isSunday/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/esm/isSunday/index.js ***! \*****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isSunday; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name isSunday * @category Weekday Helpers * @summary Is the given date Sunday? * * @description * Is the given date Sunday? * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to check * @returns {Boolean} the date is Sunday * @throws {TypeError} 1 argument required * * @example * // Is 21 September 2014 Sunday? * var result = isSunday(new Date(2014, 8, 21)) * //=> true */ function isSunday(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } return Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate).getDay() === 0; } /***/ }), /***/ "./node_modules/date-fns/esm/isThursday/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/esm/isThursday/index.js ***! \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isThursday; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name isThursday * @category Weekday Helpers * @summary Is the given date Thursday? * * @description * Is the given date Thursday? * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to check * @returns {Boolean} the date is Thursday * @throws {TypeError} 1 argument required * * @example * // Is 25 September 2014 Thursday? * var result = isThursday(new Date(2014, 8, 25)) * //=> true */ function isThursday(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } return Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate).getDay() === 4; } /***/ }), /***/ "./node_modules/date-fns/esm/isTuesday/index.js": /*!******************************************************!*\ !*** ./node_modules/date-fns/esm/isTuesday/index.js ***! \******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isTuesday; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name isTuesday * @category Weekday Helpers * @summary Is the given date Tuesday? * * @description * Is the given date Tuesday? * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to check * @returns {Boolean} the date is Tuesday * @throws {TypeError} 1 argument required * * @example * // Is 23 September 2014 Tuesday? * var result = isTuesday(new Date(2014, 8, 23)) * //=> true */ function isTuesday(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } return Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate).getDay() === 2; } /***/ }), /***/ "./node_modules/date-fns/esm/isValid/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/esm/isValid/index.js ***! \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isValid; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name isValid * @category Common Helpers * @summary Is the given date valid? * * @description * Returns false if argument is Invalid Date and true otherwise. * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} * Invalid Date is a Date, whose time value is NaN. * * Time value of Date: http://es5.github.io/#x15.9.1.1 * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * - Now `isValid` doesn't throw an exception * if the first argument is not an instance of Date. * Instead, argument is converted beforehand using `toDate`. * * Examples: * * | `isValid` argument | Before v2.0.0 | v2.0.0 onward | * |---------------------------|---------------|---------------| * | `new Date()` | `true` | `true` | * | `new Date('2016-01-01')` | `true` | `true` | * | `new Date('')` | `false` | `false` | * | `new Date(1488370835081)` | `true` | `true` | * | `new Date(NaN)` | `false` | `false` | * | `'2016-01-01'` | `TypeError` | `true` | * | `''` | `TypeError` | `false` | * | `1488370835081` | `TypeError` | `true` | * | `NaN` | `TypeError` | `false` | * * We introduce this change to make *date-fns* consistent with ECMAScript behavior * that try to coerce arguments to the expected type * (which is also the case with other *date-fns* functions). * * @param {*} date - the date to check * @returns {Boolean} the date is valid * @throws {TypeError} 1 argument required * * @example * // For the valid date: * var result = isValid(new Date(2014, 1, 31)) * //=> true * * @example * // For the value, convertable into a date: * var result = isValid(1393804800000) * //=> true * * @example * // For the invalid date: * var result = isValid(new Date('')) * //=> false */ function isValid(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); return !isNaN(date); } /***/ }), /***/ "./node_modules/date-fns/esm/isWednesday/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/esm/isWednesday/index.js ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isWednesday; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name isWednesday * @category Weekday Helpers * @summary Is the given date Wednesday? * * @description * Is the given date Wednesday? * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to check * @returns {Boolean} the date is Wednesday * @throws {TypeError} 1 argument required * * @example * // Is 24 September 2014 Wednesday? * var result = isWednesday(new Date(2014, 8, 24)) * //=> true */ function isWednesday(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } return Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate).getDay() === 3; } /***/ }), /***/ "./node_modules/date-fns/esm/isWeekend/index.js": /*!******************************************************!*\ !*** ./node_modules/date-fns/esm/isWeekend/index.js ***! \******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isWeekend; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name isWeekend * @category Weekday Helpers * @summary Does the given date fall on a weekend? * * @description * Does the given date fall on a weekend? * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to check * @returns {Boolean} the date falls on a weekend * @throws {TypeError} 1 argument required * * @example * // Does 5 October 2014 fall on a weekend? * var result = isWeekend(new Date(2014, 9, 5)) * //=> true */ function isWeekend(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var day = date.getDay(); return day === 0 || day === 6; } /***/ }), /***/ "./node_modules/date-fns/esm/isWithinInterval/index.js": /*!*************************************************************!*\ !*** ./node_modules/date-fns/esm/isWithinInterval/index.js ***! \*************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isWithinInterval; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name isWithinInterval * @category Interval Helpers * @summary Is the given date within the interval? * * @description * Is the given date within the interval? * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * - The function was renamed from `isWithinRange` to `isWithinInterval`. * This change was made to mirror the use of the word "interval" in standard ISO 8601:2004 terminology: * * ``` * 2.1.3 * time interval * part of the time axis limited by two instants * ``` * * Also, this function now accepts an object with `start` and `end` properties * instead of two arguments as an interval. * This function now throws `RangeError` if the start of the interval is after its end * or if any date in the interval is `Invalid Date`. * * ```javascript * // Before v2.0.0 * * isWithinRange( * new Date(2014, 0, 3), * new Date(2014, 0, 1), new Date(2014, 0, 7) * ) * * // v2.0.0 onward * * isWithinInterval( * new Date(2014, 0, 3), * { start: new Date(2014, 0, 1), end: new Date(2014, 0, 7) } * ) * ``` * * @param {Date|Number} date - the date to check * @param {Interval} interval - the interval to check * @returns {Boolean} the date is within the interval * @throws {TypeError} 2 arguments required * @throws {RangeError} The start of an interval cannot be after its end * @throws {RangeError} Date in interval cannot be `Invalid Date` * * @example * // For the date within the interval: * isWithinInterval(new Date(2014, 0, 3), { * start: new Date(2014, 0, 1), * end: new Date(2014, 0, 7) * }) * //=> true * * @example * // For the date outside of the interval: * isWithinInterval(new Date(2014, 0, 10), { * start: new Date(2014, 0, 1), * end: new Date(2014, 0, 7) * }) * //=> false */ function isWithinInterval(dirtyDate, dirtyInterval) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var interval = dirtyInterval || {}; var time = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate).getTime(); var startTime = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(interval.start).getTime(); var endTime = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(interval.end).getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date` if (!(startTime <= endTime)) { throw new RangeError('Invalid interval'); } return time >= startTime && time <= endTime; } /***/ }), /***/ "./node_modules/date-fns/esm/lastDayOfDecade/index.js": /*!************************************************************!*\ !*** ./node_modules/date-fns/esm/lastDayOfDecade/index.js ***! \************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return lastDayOfDecade; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name lastDayOfDecade * @category Decade Helpers * @summary Return the last day of a decade for the given date. * * @description * Return the last day of a decade for the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @returns {Date} the last day of a decade * @throws {TypeError} 1 argument required * * @example * // The last day of a decade for 21 December 2012 21:12:00: * var result = lastDayOfDecade(new Date(2012, 11, 21, 21, 12, 00)) * //=> Wed Dec 31 2019 00:00:00 */ function lastDayOfDecade(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var year = date.getFullYear(); var decade = 9 + Math.floor(year / 10) * 10; date.setFullYear(decade + 1, 0, 0); date.setHours(0, 0, 0, 0); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/lastDayOfISOWeek/index.js": /*!*************************************************************!*\ !*** ./node_modules/date-fns/esm/lastDayOfISOWeek/index.js ***! \*************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return lastDayOfISOWeek; }); /* harmony import */ var _lastDayOfWeek_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lastDayOfWeek/index.js */ "./node_modules/date-fns/esm/lastDayOfWeek/index.js"); /** * @name lastDayOfISOWeek * @category ISO Week Helpers * @summary Return the last day of an ISO week for the given date. * * @description * Return the last day of an ISO week for the given date. * The result will be in the local timezone. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @returns {Date} the last day of an ISO week * @throws {TypeError} 1 argument required * * @example * // The last day of an ISO week for 2 September 2014 11:55:00: * var result = lastDayOfISOWeek(new Date(2014, 8, 2, 11, 55, 0)) * //=> Sun Sep 07 2014 00:00:00 */ function lastDayOfISOWeek(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } return Object(_lastDayOfWeek_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate, { weekStartsOn: 1 }); } /***/ }), /***/ "./node_modules/date-fns/esm/lastDayOfISOWeekYear/index.js": /*!*****************************************************************!*\ !*** ./node_modules/date-fns/esm/lastDayOfISOWeekYear/index.js ***! \*****************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return lastDayOfISOWeekYear; }); /* harmony import */ var _getISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../getISOWeekYear/index.js */ "./node_modules/date-fns/esm/getISOWeekYear/index.js"); /* harmony import */ var _startOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../startOfISOWeek/index.js */ "./node_modules/date-fns/esm/startOfISOWeek/index.js"); /** * @name lastDayOfISOWeekYear * @category ISO Week-Numbering Year Helpers * @summary Return the last day of an ISO week-numbering year for the given date. * * @description * Return the last day of an ISO week-numbering year, * which always starts 3 days before the year's first Thursday. * The result will be in the local timezone. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * - The function was renamed from `lastDayOfISOYear` to `lastDayOfISOWeekYear`. * "ISO week year" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date). * This change makes the name consistent with * locale-dependent week-numbering year helpers, e.g., `getWeekYear`. * * @param {Date|Number} date - the original date * @returns {Date} the end of an ISO week-numbering year * @throws {TypeError} 1 argument required * * @example * // The last day of an ISO week-numbering year for 2 July 2005: * var result = lastDayOfISOWeekYear(new Date(2005, 6, 2)) * //=> Sun Jan 01 2006 00:00:00 */ function lastDayOfISOWeekYear(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var year = Object(_getISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var fourthOfJanuary = new Date(0); fourthOfJanuary.setFullYear(year + 1, 0, 4); fourthOfJanuary.setHours(0, 0, 0, 0); var date = Object(_startOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(fourthOfJanuary); date.setDate(date.getDate() - 1); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/lastDayOfMonth/index.js": /*!***********************************************************!*\ !*** ./node_modules/date-fns/esm/lastDayOfMonth/index.js ***! \***********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return lastDayOfMonth; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name lastDayOfMonth * @category Month Helpers * @summary Return the last day of a month for the given date. * * @description * Return the last day of a month for the given date. * The result will be in the local timezone. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @returns {Date} the last day of a month * @throws {TypeError} 1 argument required * * @example * // The last day of a month for 2 September 2014 11:55:00: * var result = lastDayOfMonth(new Date(2014, 8, 2, 11, 55, 0)) * //=> Tue Sep 30 2014 00:00:00 */ function lastDayOfMonth(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var month = date.getMonth(); date.setFullYear(date.getFullYear(), month + 1, 0); date.setHours(0, 0, 0, 0); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/lastDayOfQuarter/index.js": /*!*************************************************************!*\ !*** ./node_modules/date-fns/esm/lastDayOfQuarter/index.js ***! \*************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return lastDayOfQuarter; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name lastDayOfQuarter * @category Quarter Helpers * @summary Return the last day of a year quarter for the given date. * * @description * Return the last day of a year quarter for the given date. * The result will be in the local timezone. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @param {Object} [options] - an object with options. * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} * @returns {Date} the last day of a quarter * @throws {TypeError} 1 argument required * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 * * @example * // The last day of a quarter for 2 September 2014 11:55:00: * var result = lastDayOfQuarter(new Date(2014, 8, 2, 11, 55, 0)) * //=> Tue Sep 30 2014 00:00:00 */ function lastDayOfQuarter(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var currentMonth = date.getMonth(); var month = currentMonth - currentMonth % 3 + 3; date.setMonth(month, 0); date.setHours(0, 0, 0, 0); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/lastDayOfWeek/index.js": /*!**********************************************************!*\ !*** ./node_modules/date-fns/esm/lastDayOfWeek/index.js ***! \**********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return lastDayOfWeek; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name lastDayOfWeek * @category Week Helpers * @summary Return the last day of a week for the given date. * * @description * Return the last day of a week for the given date. * The result will be in the local timezone. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @param {Object} [options] - an object with options. * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} * @returns {Date} the last day of a week * @throws {TypeError} 1 argument required * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 * * @example * // The last day of a week for 2 September 2014 11:55:00: * var result = lastDayOfWeek(new Date(2014, 8, 2, 11, 55, 0)) * //=> Sat Sep 06 2014 00:00:00 * * @example * // If the week starts on Monday, the last day of the week for 2 September 2014 11:55:00: * var result = lastDayOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 }) * //=> Sun Sep 07 2014 00:00:00 */ function lastDayOfWeek(dirtyDate, dirtyOptions) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var options = dirtyOptions || {}; var locale = options.locale; var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn; var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(localeWeekStartsOn); var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { throw new RangeError('weekStartsOn must be between 0 and 6'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var day = date.getDay(); var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn); date.setHours(0, 0, 0, 0); date.setDate(date.getDate() + diff); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/lastDayOfYear/index.js": /*!**********************************************************!*\ !*** ./node_modules/date-fns/esm/lastDayOfYear/index.js ***! \**********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return lastDayOfYear; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name lastDayOfYear * @category Year Helpers * @summary Return the last day of a year for the given date. * * @description * Return the last day of a year for the given date. * The result will be in the local timezone. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @returns {Date} the last day of a year * @throws {TypeError} 1 argument required * * @example * // The last day of a year for 2 September 2014 11:55:00: * var result = lastDayOfYear(new Date(2014, 8, 2, 11, 55, 00)) * //=> Wed Dec 31 2014 00:00:00 */ function lastDayOfYear(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var year = date.getFullYear(); date.setFullYear(year + 1, 0, 0); date.setHours(0, 0, 0, 0); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/lightFormat/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/esm/lightFormat/index.js ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return lightFormat; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _lib_format_lightFormatters_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../_lib/format/lightFormatters/index.js */ "./node_modules/date-fns/esm/_lib/format/lightFormatters/index.js"); /* harmony import */ var _lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../_lib/getTimezoneOffsetInMilliseconds/index.js */ "./node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js"); /* harmony import */ var _isValid_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../isValid/index.js */ "./node_modules/date-fns/esm/isValid/index.js"); /* harmony import */ var _subMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../subMilliseconds/index.js */ "./node_modules/date-fns/esm/subMilliseconds/index.js"); // This RegExp consists of three parts separated by `|`: // - (\w)\1* matches any sequences of the same letter // - '' matches two quote characters in a row // - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('), // except a single quote symbol, which ends the sequence. // Two quote characters do not end the sequence. // If there is no matching single quote // then the sequence will continue until the end of the string. // - . matches any single character unmatched by previous parts of the RegExps var formattingTokensRegExp = /(\w)\1*|''|'(''|[^'])+('|$)|./g; var escapedStringRegExp = /^'(.*?)'?$/; var doubleQuoteRegExp = /''/g; /** * @name lightFormat * @category Common Helpers * @summary Format the date. * * @description * Return the formatted date string in the given format. Unlike `format`, * `lightFormat` doesn't use locales and outputs date using the most popular tokens. * * > ⚠️ Please note that the `lightFormat` tokens differ from Moment.js and other libraries. * > See: https://git.io/fxCyr * * The characters wrapped between two single quotes characters (') are escaped. * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote. * (see the last example) * * Format of the string is based on Unicode Technical Standard #35: * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table * with a few additions (see note 7 below the table). * * Accepted patterns: * | Unit | Pattern | Result examples | * |---------------------------------|---------|-----------------------------------| * | AM, PM | a..aaa | AM, PM | * | | aaaa | a.m., p.m. | * | | aaaaa | a, p | * | Calendar year | y | 44, 1, 1900, 2017 | * | | yy | 44, 01, 00, 17 | * | | yyy | 044, 001, 000, 017 | * | | yyyy | 0044, 0001, 1900, 2017 | * | Month (formatting) | M | 1, 2, ..., 12 | * | | MM | 01, 02, ..., 12 | * | Day of month | d | 1, 2, ..., 31 | * | | dd | 01, 02, ..., 31 | * | Hour [1-12] | h | 1, 2, ..., 11, 12 | * | | hh | 01, 02, ..., 11, 12 | * | Hour [0-23] | H | 0, 1, 2, ..., 23 | * | | HH | 00, 01, 02, ..., 23 | * | Minute | m | 0, 1, ..., 59 | * | | mm | 00, 01, ..., 59 | * | Second | s | 0, 1, ..., 59 | * | | ss | 00, 01, ..., 59 | * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | * | | XX | -0800, +0530, Z | * | | XXX | -08:00, +05:30, Z | * | | XXXX | -0800, +0530, Z, +123456 | * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | * | | xx | -0800, +0530, +0000 | * | | xxx | -08:00, +05:30, +00:00 | * | | xxxx | -0800, +0530, +0000, +123456 | * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | * * @param {Date|Number} date - the original date * @param {String} format - the string of tokens * @returns {String} the formatted date string * @throws {TypeError} 2 arguments required * * @example * var result = format(new Date(2014, 1, 11), 'yyyy-MM-dd') * //=> '1987-02-11' */ function lightFormat(dirtyDate, dirtyFormatStr) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var formatStr = String(dirtyFormatStr); var originalDate = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); if (!Object(_isValid_index_js__WEBPACK_IMPORTED_MODULE_3__["default"])(originalDate)) { throw new RangeError('Invalid time value'); } // Convert the date in system timezone to the same date in UTC+00:00 timezone. // This ensures that when UTC functions will be implemented, locales will be compatible with them. // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376 var timezoneOffset = Object(_lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(originalDate); var utcDate = Object(_subMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_4__["default"])(originalDate, timezoneOffset); var result = formatStr.match(formattingTokensRegExp).map(function (substring) { // Replace two single quote characters with one single quote character if (substring === "''") { return "'"; } var firstCharacter = substring[0]; if (firstCharacter === "'") { return cleanEscapedString(substring); } var formatter = _lib_format_lightFormatters_index_js__WEBPACK_IMPORTED_MODULE_1__["default"][firstCharacter]; if (formatter) { return formatter(utcDate, substring, null, {}); } return substring; }).join(''); return result; } function cleanEscapedString(input) { return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'"); } /***/ }), /***/ "./node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js": /*!**************************************************************************!*\ !*** ./node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js ***! \**************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return buildFormatLongFn; }); function buildFormatLongFn(args) { return function (dirtyOptions) { var options = dirtyOptions || {}; var width = options.width ? String(options.width) : args.defaultWidth; var format = args.formats[width] || args.formats[args.defaultWidth]; return format; }; } /***/ }), /***/ "./node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js": /*!************************************************************************!*\ !*** ./node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js ***! \************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return buildLocalizeFn; }); function buildLocalizeFn(args) { return function (dirtyIndex, dirtyOptions) { var options = dirtyOptions || {}; var width = options.width ? String(options.width) : args.defaultWidth; var context = options.context ? String(options.context) : 'standalone'; var valuesArray; if (context === 'formatting' && args.formattingValues) { valuesArray = args.formattingValues[width] || args.formattingValues[args.defaultFormattingWidth]; } else { valuesArray = args.values[width] || args.values[args.defaultWidth]; } var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; return valuesArray[index]; }; } /***/ }), /***/ "./node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js": /*!*********************************************************************!*\ !*** ./node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js ***! \*********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return buildMatchFn; }); function buildMatchFn(args) { return function (dirtyString, dirtyOptions) { var string = String(dirtyString); var options = dirtyOptions || {}; var width = options.width; var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth]; var matchResult = string.match(matchPattern); if (!matchResult) { return null; } var matchedString = matchResult[0]; var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth]; var value; if (Object.prototype.toString.call(parsePatterns) === '[object Array]') { value = parsePatterns.findIndex(function (pattern) { return pattern.test(string); }); } else { value = findKey(parsePatterns, function (pattern) { return pattern.test(string); }); } value = args.valueCallback ? args.valueCallback(value) : value; value = options.valueCallback ? options.valueCallback(value) : value; return { value: value, rest: string.slice(matchedString.length) }; }; } function findKey(object, predicate) { for (var key in object) { if (object.hasOwnProperty(key) && predicate(object[key])) { return key; } } } /***/ }), /***/ "./node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js": /*!****************************************************************************!*\ !*** ./node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js ***! \****************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return buildMatchPatternFn; }); function buildMatchPatternFn(args) { return function (dirtyString, dirtyOptions) { var string = String(dirtyString); var options = dirtyOptions || {}; var matchResult = string.match(args.matchPattern); if (!matchResult) { return null; } var matchedString = matchResult[0]; var parseResult = string.match(args.parsePattern); if (!parseResult) { return null; } var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0]; value = options.valueCallback ? options.valueCallback(value) : value; return { value: value, rest: string.slice(matchedString.length) }; }; } /***/ }), /***/ "./node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js": /*!*****************************************************************************!*\ !*** ./node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js ***! \*****************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return formatDistance; }); var formatDistanceLocale = { lessThanXSeconds: { one: 'less than a second', other: 'less than {{count}} seconds' }, xSeconds: { one: '1 second', other: '{{count}} seconds' }, halfAMinute: 'half a minute', lessThanXMinutes: { one: 'less than a minute', other: 'less than {{count}} minutes' }, xMinutes: { one: '1 minute', other: '{{count}} minutes' }, aboutXHours: { one: 'about 1 hour', other: 'about {{count}} hours' }, xHours: { one: '1 hour', other: '{{count}} hours' }, xDays: { one: '1 day', other: '{{count}} days' }, aboutXMonths: { one: 'about 1 month', other: 'about {{count}} months' }, xMonths: { one: '1 month', other: '{{count}} months' }, aboutXYears: { one: 'about 1 year', other: 'about {{count}} years' }, xYears: { one: '1 year', other: '{{count}} years' }, overXYears: { one: 'over 1 year', other: 'over {{count}} years' }, almostXYears: { one: 'almost 1 year', other: 'almost {{count}} years' } }; function formatDistance(token, count, options) { options = options || {}; var result; if (typeof formatDistanceLocale[token] === 'string') { result = formatDistanceLocale[token]; } else if (count === 1) { result = formatDistanceLocale[token].one; } else { result = formatDistanceLocale[token].other.replace('{{count}}', count); } if (options.addSuffix) { if (options.comparison > 0) { return 'in ' + result; } else { return result + ' ago'; } } return result; } /***/ }), /***/ "./node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js": /*!*************************************************************************!*\ !*** ./node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js ***! \*************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _lib_buildFormatLongFn_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../_lib/buildFormatLongFn/index.js */ "./node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js"); var dateFormats = { full: 'EEEE, MMMM do, y', long: 'MMMM do, y', medium: 'MMM d, y', short: 'MM/dd/yyyy' }; var timeFormats = { full: 'h:mm:ss a zzzz', long: 'h:mm:ss a z', medium: 'h:mm:ss a', short: 'h:mm a' }; var dateTimeFormats = { full: "{{date}} 'at' {{time}}", long: "{{date}} 'at' {{time}}", medium: '{{date}}, {{time}}', short: '{{date}}, {{time}}' }; var formatLong = { date: Object(_lib_buildFormatLongFn_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ formats: dateFormats, defaultWidth: 'full' }), time: Object(_lib_buildFormatLongFn_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ formats: timeFormats, defaultWidth: 'full' }), dateTime: Object(_lib_buildFormatLongFn_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ formats: dateTimeFormats, defaultWidth: 'full' }) }; /* harmony default export */ __webpack_exports__["default"] = (formatLong); /***/ }), /***/ "./node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js": /*!*****************************************************************************!*\ !*** ./node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js ***! \*****************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return formatRelative; }); var formatRelativeLocale = { lastWeek: "'last' eeee 'at' p", yesterday: "'yesterday at' p", today: "'today at' p", tomorrow: "'tomorrow at' p", nextWeek: "eeee 'at' p", other: 'P' }; function formatRelative(token, date, baseDate, options) { return formatRelativeLocale[token]; } /***/ }), /***/ "./node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js": /*!***********************************************************************!*\ !*** ./node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js ***! \***********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _lib_buildLocalizeFn_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../_lib/buildLocalizeFn/index.js */ "./node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js"); var eraValues = { narrow: ['B', 'A'], abbreviated: ['BC', 'AD'], wide: ['Before Christ', 'Anno Domini'] }; var quarterValues = { narrow: ['1', '2', '3', '4'], abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'], wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter'] }; // Note: in English, the names of days of the week and months are capitalized. // If you are making a new locale based on this one, check if the same is true for the language you're working on. // Generally, formatted dates should look like they are in the middle of a sentence, // e.g. in Spanish language the weekdays and months should be in the lowercase. var monthValues = { narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'], abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] }; var dayValues = { narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'], short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] }; var dayPeriodValues = { narrow: { am: 'a', pm: 'p', midnight: 'mi', noon: 'n', morning: 'morning', afternoon: 'afternoon', evening: 'evening', night: 'night' }, abbreviated: { am: 'AM', pm: 'PM', midnight: 'midnight', noon: 'noon', morning: 'morning', afternoon: 'afternoon', evening: 'evening', night: 'night' }, wide: { am: 'a.m.', pm: 'p.m.', midnight: 'midnight', noon: 'noon', morning: 'morning', afternoon: 'afternoon', evening: 'evening', night: 'night' } }; var formattingDayPeriodValues = { narrow: { am: 'a', pm: 'p', midnight: 'mi', noon: 'n', morning: 'in the morning', afternoon: 'in the afternoon', evening: 'in the evening', night: 'at night' }, abbreviated: { am: 'AM', pm: 'PM', midnight: 'midnight', noon: 'noon', morning: 'in the morning', afternoon: 'in the afternoon', evening: 'in the evening', night: 'at night' }, wide: { am: 'a.m.', pm: 'p.m.', midnight: 'midnight', noon: 'noon', morning: 'in the morning', afternoon: 'in the afternoon', evening: 'in the evening', night: 'at night' } }; function ordinalNumber(dirtyNumber, dirtyOptions) { var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example, // if they are different for different grammatical genders, // use `options.unit`: // // var options = dirtyOptions || {} // var unit = String(options.unit) // // where `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear', // 'day', 'hour', 'minute', 'second' var rem100 = number % 100; if (rem100 > 20 || rem100 < 10) { switch (rem100 % 10) { case 1: return number + 'st'; case 2: return number + 'nd'; case 3: return number + 'rd'; } } return number + 'th'; } var localize = { ordinalNumber: ordinalNumber, era: Object(_lib_buildLocalizeFn_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ values: eraValues, defaultWidth: 'wide' }), quarter: Object(_lib_buildLocalizeFn_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ values: quarterValues, defaultWidth: 'wide', argumentCallback: function (quarter) { return Number(quarter) - 1; } }), month: Object(_lib_buildLocalizeFn_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ values: monthValues, defaultWidth: 'wide' }), day: Object(_lib_buildLocalizeFn_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ values: dayValues, defaultWidth: 'wide' }), dayPeriod: Object(_lib_buildLocalizeFn_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ values: dayPeriodValues, defaultWidth: 'wide', formattingValues: formattingDayPeriodValues, defaultFormattingWidth: 'wide' }) }; /* harmony default export */ __webpack_exports__["default"] = (localize); /***/ }), /***/ "./node_modules/date-fns/esm/locale/en-US/_lib/match/index.js": /*!********************************************************************!*\ !*** ./node_modules/date-fns/esm/locale/en-US/_lib/match/index.js ***! \********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _lib_buildMatchPatternFn_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../_lib/buildMatchPatternFn/index.js */ "./node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js"); /* harmony import */ var _lib_buildMatchFn_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../_lib/buildMatchFn/index.js */ "./node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js"); var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i; var parseOrdinalNumberPattern = /\d+/i; var matchEraPatterns = { narrow: /^(b|a)/i, abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i, wide: /^(before christ|before common era|anno domini|common era)/i }; var parseEraPatterns = { any: [/^b/i, /^(a|c)/i] }; var matchQuarterPatterns = { narrow: /^[1234]/i, abbreviated: /^q[1234]/i, wide: /^[1234](th|st|nd|rd)? quarter/i }; var parseQuarterPatterns = { any: [/1/i, /2/i, /3/i, /4/i] }; var matchMonthPatterns = { narrow: /^[jfmasond]/i, abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i, wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i }; var parseMonthPatterns = { narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i], any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i] }; var matchDayPatterns = { narrow: /^[smtwf]/i, short: /^(su|mo|tu|we|th|fr|sa)/i, abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i, wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i }; var parseDayPatterns = { narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i], any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i] }; var matchDayPeriodPatterns = { narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i, any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i }; var parseDayPeriodPatterns = { any: { am: /^a/i, pm: /^p/i, midnight: /^mi/i, noon: /^no/i, morning: /morning/i, afternoon: /afternoon/i, evening: /evening/i, night: /night/i } }; var match = { ordinalNumber: Object(_lib_buildMatchPatternFn_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ matchPattern: matchOrdinalNumberPattern, parsePattern: parseOrdinalNumberPattern, valueCallback: function (value) { return parseInt(value, 10); } }), era: Object(_lib_buildMatchFn_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])({ matchPatterns: matchEraPatterns, defaultMatchWidth: 'wide', parsePatterns: parseEraPatterns, defaultParseWidth: 'any' }), quarter: Object(_lib_buildMatchFn_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])({ matchPatterns: matchQuarterPatterns, defaultMatchWidth: 'wide', parsePatterns: parseQuarterPatterns, defaultParseWidth: 'any', valueCallback: function (index) { return index + 1; } }), month: Object(_lib_buildMatchFn_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])({ matchPatterns: matchMonthPatterns, defaultMatchWidth: 'wide', parsePatterns: parseMonthPatterns, defaultParseWidth: 'any' }), day: Object(_lib_buildMatchFn_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])({ matchPatterns: matchDayPatterns, defaultMatchWidth: 'wide', parsePatterns: parseDayPatterns, defaultParseWidth: 'any' }), dayPeriod: Object(_lib_buildMatchFn_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])({ matchPatterns: matchDayPeriodPatterns, defaultMatchWidth: 'any', parsePatterns: parseDayPeriodPatterns, defaultParseWidth: 'any' }) }; /* harmony default export */ __webpack_exports__["default"] = (match); /***/ }), /***/ "./node_modules/date-fns/esm/locale/en-US/index.js": /*!*********************************************************!*\ !*** ./node_modules/date-fns/esm/locale/en-US/index.js ***! \*********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _lib_formatDistance_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_lib/formatDistance/index.js */ "./node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js"); /* harmony import */ var _lib_formatLong_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_lib/formatLong/index.js */ "./node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js"); /* harmony import */ var _lib_formatRelative_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_lib/formatRelative/index.js */ "./node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js"); /* harmony import */ var _lib_localize_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_lib/localize/index.js */ "./node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js"); /* harmony import */ var _lib_match_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_lib/match/index.js */ "./node_modules/date-fns/esm/locale/en-US/_lib/match/index.js"); /** * @type {Locale} * @category Locales * @summary English locale (United States). * @language English * @iso-639-2 eng * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp} * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss} */ var locale = { formatDistance: _lib_formatDistance_index_js__WEBPACK_IMPORTED_MODULE_0__["default"], formatLong: _lib_formatLong_index_js__WEBPACK_IMPORTED_MODULE_1__["default"], formatRelative: _lib_formatRelative_index_js__WEBPACK_IMPORTED_MODULE_2__["default"], localize: _lib_localize_index_js__WEBPACK_IMPORTED_MODULE_3__["default"], match: _lib_match_index_js__WEBPACK_IMPORTED_MODULE_4__["default"], options: { weekStartsOn: 0 /* Sunday */ , firstWeekContainsDate: 1 } }; /* harmony default export */ __webpack_exports__["default"] = (locale); /***/ }), /***/ "./node_modules/date-fns/esm/max/index.js": /*!************************************************!*\ !*** ./node_modules/date-fns/esm/max/index.js ***! \************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return max; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name max * @category Common Helpers * @summary Return the latest of the given dates. * * @description * Return the latest of the given dates. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * - `max` function now accepts an array of dates rather than spread arguments. * * ```javascript * // Before v2.0.0 * var date1 = new Date(1989, 6, 10) * var date2 = new Date(1987, 1, 11) * var maxDate = max(date1, date2) * * // v2.0.0 onward: * var dates = [new Date(1989, 6, 10), new Date(1987, 1, 11)] * var maxDate = max(dates) * ``` * * @param {Date[]|Number[]} datesArray - the dates to compare * @returns {Date} the latest of the dates * @throws {TypeError} 1 argument required * * @example * // Which of these dates is the latest? * var result = max([ * new Date(1989, 6, 10), * new Date(1987, 1, 11), * new Date(1995, 6, 2), * new Date(1990, 0, 1) * ]) * //=> Sun Jul 02 1995 00:00:00 */ function max(dirtyDatesArray) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var datesArray; // `dirtyDatesArray` is undefined or null if (dirtyDatesArray == null) { datesArray = []; // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method } else if (typeof dirtyDatesArray.forEach === 'function') { datesArray = dirtyDatesArray; // If `dirtyDatesArray` is Array-like Object, convert to Array. Otherwise, make it empty Array } else { datesArray = Array.prototype.slice.call(dirtyDatesArray); } var result; datesArray.forEach(function (dirtyDate) { var currentDate = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); if (result === undefined || result < currentDate || isNaN(currentDate)) { result = currentDate; } }); return result; } /***/ }), /***/ "./node_modules/date-fns/esm/min/index.js": /*!************************************************!*\ !*** ./node_modules/date-fns/esm/min/index.js ***! \************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return min; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name min * @category Common Helpers * @summary Return the earliest of the given dates. * * @description * Return the earliest of the given dates. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * - `min` function now accepts an array of dates rather than spread arguments. * * ```javascript * // Before v2.0.0 * var date1 = new Date(1989, 6, 10) * var date2 = new Date(1987, 1, 11) * var minDate = min(date1, date2) * * // v2.0.0 onward: * var dates = [new Date(1989, 6, 10), new Date(1987, 1, 11)] * var minDate = min(dates) * ``` * * @param {Date[]|Number[]} datesArray - the dates to compare * @returns {Date} the earliest of the dates * @throws {TypeError} 1 argument required * * @example * // Which of these dates is the earliest? * var result = min([ * new Date(1989, 6, 10), * new Date(1987, 1, 11), * new Date(1995, 6, 2), * new Date(1990, 0, 1) * ]) * //=> Wed Feb 11 1987 00:00:00 */ function min(dirtyDatesArray) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var datesArray; // `dirtyDatesArray` is undefined or null if (dirtyDatesArray == null) { datesArray = []; // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method } else if (typeof dirtyDatesArray.forEach === 'function') { datesArray = dirtyDatesArray; // If `dirtyDatesArray` is Array-like Object, convert to Array. Otherwise, make it empty Array } else { datesArray = Array.prototype.slice.call(dirtyDatesArray); } var result; datesArray.forEach(function (dirtyDate) { var currentDate = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); if (result === undefined || result > currentDate || isNaN(currentDate)) { result = currentDate; } }); return result; } /***/ }), /***/ "./node_modules/date-fns/esm/parse/_lib/parsers/index.js": /*!***************************************************************!*\ !*** ./node_modules/date-fns/esm/parse/_lib/parsers/index.js ***! \***************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _lib_getUTCWeekYear_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../_lib/getUTCWeekYear/index.js */ "./node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js"); /* harmony import */ var _lib_setUTCDay_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../_lib/setUTCDay/index.js */ "./node_modules/date-fns/esm/_lib/setUTCDay/index.js"); /* harmony import */ var _lib_setUTCWeek_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../_lib/setUTCWeek/index.js */ "./node_modules/date-fns/esm/_lib/setUTCWeek/index.js"); /* harmony import */ var _lib_startOfUTCWeek_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../_lib/startOfUTCWeek/index.js */ "./node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js"); /* harmony import */ var _lib_setUTCISODay_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../_lib/setUTCISODay/index.js */ "./node_modules/date-fns/esm/_lib/setUTCISODay/index.js"); /* harmony import */ var _lib_setUTCISOWeek_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../_lib/setUTCISOWeek/index.js */ "./node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js"); /* harmony import */ var _lib_startOfUTCISOWeek_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../_lib/startOfUTCISOWeek/index.js */ "./node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js"); var MILLISECONDS_IN_HOUR = 3600000; var MILLISECONDS_IN_MINUTE = 60000; var MILLISECONDS_IN_SECOND = 1000; var numericPatterns = { month: /^(1[0-2]|0?\d)/, // 0 to 12 date: /^(3[0-1]|[0-2]?\d)/, // 0 to 31 dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/, // 0 to 366 week: /^(5[0-3]|[0-4]?\d)/, // 0 to 53 hour23h: /^(2[0-3]|[0-1]?\d)/, // 0 to 23 hour24h: /^(2[0-4]|[0-1]?\d)/, // 0 to 24 hour11h: /^(1[0-1]|0?\d)/, // 0 to 11 hour12h: /^(1[0-2]|0?\d)/, // 0 to 12 minute: /^[0-5]?\d/, // 0 to 59 second: /^[0-5]?\d/, // 0 to 59 singleDigit: /^\d/, // 0 to 9 twoDigits: /^\d{1,2}/, // 0 to 99 threeDigits: /^\d{1,3}/, // 0 to 999 fourDigits: /^\d{1,4}/, // 0 to 9999 anyDigitsSigned: /^-?\d+/, singleDigitSigned: /^-?\d/, // 0 to 9, -0 to -9 twoDigitsSigned: /^-?\d{1,2}/, // 0 to 99, -0 to -99 threeDigitsSigned: /^-?\d{1,3}/, // 0 to 999, -0 to -999 fourDigitsSigned: /^-?\d{1,4}/ // 0 to 9999, -0 to -9999 }; var timezonePatterns = { basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/, basic: /^([+-])(\d{2})(\d{2})|Z/, basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/, extended: /^([+-])(\d{2}):(\d{2})|Z/, extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/ }; function parseNumericPattern(pattern, string, valueCallback) { var matchResult = string.match(pattern); if (!matchResult) { return null; } var value = parseInt(matchResult[0], 10); return { value: valueCallback ? valueCallback(value) : value, rest: string.slice(matchResult[0].length) }; } function parseTimezonePattern(pattern, string) { var matchResult = string.match(pattern); if (!matchResult) { return null; } // Input is 'Z' if (matchResult[0] === 'Z') { return { value: 0, rest: string.slice(1) }; } var sign = matchResult[1] === '+' ? 1 : -1; var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0; var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0; var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0; return { value: sign * (hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * MILLISECONDS_IN_SECOND), rest: string.slice(matchResult[0].length) }; } function parseAnyDigitsSigned(string, valueCallback) { return parseNumericPattern(numericPatterns.anyDigitsSigned, string, valueCallback); } function parseNDigits(n, string, valueCallback) { switch (n) { case 1: return parseNumericPattern(numericPatterns.singleDigit, string, valueCallback); case 2: return parseNumericPattern(numericPatterns.twoDigits, string, valueCallback); case 3: return parseNumericPattern(numericPatterns.threeDigits, string, valueCallback); case 4: return parseNumericPattern(numericPatterns.fourDigits, string, valueCallback); default: return parseNumericPattern(new RegExp('^\\d{1,' + n + '}'), string, valueCallback); } } function parseNDigitsSigned(n, string, valueCallback) { switch (n) { case 1: return parseNumericPattern(numericPatterns.singleDigitSigned, string, valueCallback); case 2: return parseNumericPattern(numericPatterns.twoDigitsSigned, string, valueCallback); case 3: return parseNumericPattern(numericPatterns.threeDigitsSigned, string, valueCallback); case 4: return parseNumericPattern(numericPatterns.fourDigitsSigned, string, valueCallback); default: return parseNumericPattern(new RegExp('^-?\\d{1,' + n + '}'), string, valueCallback); } } function dayPeriodEnumToHours(enumValue) { switch (enumValue) { case 'morning': return 4; case 'evening': return 17; case 'pm': case 'noon': case 'afternoon': return 12; case 'am': case 'midnight': case 'night': default: return 0; } } function normalizeTwoDigitYear(twoDigitYear, currentYear) { var isCommonEra = currentYear > 0; // Absolute number of the current year: // 1 -> 1 AC // 0 -> 1 BC // -1 -> 2 BC var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear; var result; if (absCurrentYear <= 50) { result = twoDigitYear || 100; } else { var rangeEnd = absCurrentYear + 50; var rangeEndCentury = Math.floor(rangeEnd / 100) * 100; var isPreviousCentury = twoDigitYear >= rangeEnd % 100; result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0); } return isCommonEra ? result : 1 - result; } var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; var DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; // User for validation function isLeapYearIndex(year) { return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0; } /* * | | Unit | | Unit | * |-----|--------------------------------|-----|--------------------------------| * | a | AM, PM | A* | Milliseconds in day | * | b | AM, PM, noon, midnight | B | Flexible day period | * | c | Stand-alone local day of week | C* | Localized hour w/ day period | * | d | Day of month | D | Day of year | * | e | Local day of week | E | Day of week | * | f | | F* | Day of week in month | * | g* | Modified Julian day | G | Era | * | h | Hour [1-12] | H | Hour [0-23] | * | i! | ISO day of week | I! | ISO week of year | * | j* | Localized hour w/ day period | J* | Localized hour w/o day period | * | k | Hour [1-24] | K | Hour [0-11] | * | l* | (deprecated) | L | Stand-alone month | * | m | Minute | M | Month | * | n | | N | | * | o! | Ordinal number modifier | O* | Timezone (GMT) | * | p | | P | | * | q | Stand-alone quarter | Q | Quarter | * | r* | Related Gregorian year | R! | ISO week-numbering year | * | s | Second | S | Fraction of second | * | t! | Seconds timestamp | T! | Milliseconds timestamp | * | u | Extended year | U* | Cyclic year | * | v* | Timezone (generic non-locat.) | V* | Timezone (location) | * | w | Local week of year | W* | Week of month | * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) | * | y | Year (abs) | Y | Local week-numbering year | * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) | * * Letters marked by * are not implemented but reserved by Unicode standard. * * Letters marked by ! are non-standard, but implemented by date-fns: * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs) * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days, * i.e. 7 for Sunday, 1 for Monday, etc. * - `I` is ISO week of year, as opposed to `w` which is local week of year. * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year. * `R` is supposed to be used in conjunction with `I` and `i` * for universal ISO week-numbering date, whereas * `Y` is supposed to be used in conjunction with `w` and `e` * for week-numbering date specific to the locale. */ var parsers = { // Era G: { priority: 140, parse: function (string, token, match, options) { switch (token) { // AD, BC case 'G': case 'GG': case 'GGG': return match.era(string, { width: 'abbreviated' }) || match.era(string, { width: 'narrow' }); // A, B case 'GGGGG': return match.era(string, { width: 'narrow' }); // Anno Domini, Before Christ case 'GGGG': default: return match.era(string, { width: 'wide' }) || match.era(string, { width: 'abbreviated' }) || match.era(string, { width: 'narrow' }); } }, set: function (date, flags, value, options) { // Sets year 10 BC if BC, or 10 AC if AC date.setUTCFullYear(value === 1 ? 10 : -9, 0, 1); date.setUTCHours(0, 0, 0, 0); return date; } }, // Year y: { // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns // | Year | y | yy | yyy | yyyy | yyyyy | // |----------|-------|----|-------|-------|-------| // | AD 1 | 1 | 01 | 001 | 0001 | 00001 | // | AD 12 | 12 | 12 | 012 | 0012 | 00012 | // | AD 123 | 123 | 23 | 123 | 0123 | 00123 | // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 | // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 | priority: 130, parse: function (string, token, match, options) { var valueCallback = function (year) { return { year: year, isTwoDigitYear: token === 'yy' }; }; switch (token) { case 'y': return parseNDigits(4, string, valueCallback); case 'yo': return match.ordinalNumber(string, { unit: 'year', valueCallback: valueCallback }); default: return parseNDigits(token.length, string, valueCallback); } }, validate: function (date, value, options) { return value.isTwoDigitYear || value.year > 0; }, set: function (date, flags, value, options) { var currentYear = Object(_lib_getUTCWeekYear_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(date, options); if (value.isTwoDigitYear) { var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear); date.setUTCFullYear(normalizedTwoDigitYear, 0, 1); date.setUTCHours(0, 0, 0, 0); return date; } var year = currentYear > 0 ? value.year : 1 - value.year; date.setUTCFullYear(year, 0, 1); date.setUTCHours(0, 0, 0, 0); return date; } }, // Local week-numbering year Y: { priority: 130, parse: function (string, token, match, options) { var valueCallback = function (year) { return { year: year, isTwoDigitYear: token === 'YY' }; }; switch (token) { case 'Y': return parseNDigits(4, string, valueCallback); case 'Yo': return match.ordinalNumber(string, { unit: 'year', valueCallback: valueCallback }); default: return parseNDigits(token.length, string, valueCallback); } }, validate: function (date, value, options) { return value.isTwoDigitYear || value.year > 0; }, set: function (date, flags, value, options) { var currentYear = date.getUTCFullYear(); if (value.isTwoDigitYear) { var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear); date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate); date.setUTCHours(0, 0, 0, 0); return Object(_lib_startOfUTCWeek_index_js__WEBPACK_IMPORTED_MODULE_3__["default"])(date, options); } var year = currentYear > 0 ? value.year : 1 - value.year; date.setUTCFullYear(year, 0, options.firstWeekContainsDate); date.setUTCHours(0, 0, 0, 0); return Object(_lib_startOfUTCWeek_index_js__WEBPACK_IMPORTED_MODULE_3__["default"])(date, options); } }, // ISO week-numbering year R: { priority: 130, parse: function (string, token, match, options) { if (token === 'R') { return parseNDigitsSigned(4, string); } return parseNDigitsSigned(token.length, string); }, set: function (date, flags, value, options) { var firstWeekOfYear = new Date(0); firstWeekOfYear.setUTCFullYear(value, 0, 4); firstWeekOfYear.setUTCHours(0, 0, 0, 0); return Object(_lib_startOfUTCISOWeek_index_js__WEBPACK_IMPORTED_MODULE_6__["default"])(firstWeekOfYear); } }, // Extended year u: { priority: 130, parse: function (string, token, match, options) { if (token === 'u') { return parseNDigitsSigned(4, string); } return parseNDigitsSigned(token.length, string); }, set: function (date, flags, value, options) { date.setUTCFullYear(value, 0, 1); date.setUTCHours(0, 0, 0, 0); return date; } }, // Quarter Q: { priority: 120, parse: function (string, token, match, options) { switch (token) { // 1, 2, 3, 4 case 'Q': case 'QQ': // 01, 02, 03, 04 return parseNDigits(token.length, string); // 1st, 2nd, 3rd, 4th case 'Qo': return match.ordinalNumber(string, { unit: 'quarter' }); // Q1, Q2, Q3, Q4 case 'QQQ': return match.quarter(string, { width: 'abbreviated', context: 'formatting' }) || match.quarter(string, { width: 'narrow', context: 'formatting' }); // 1, 2, 3, 4 (narrow quarter; could be not numerical) case 'QQQQQ': return match.quarter(string, { width: 'narrow', context: 'formatting' }); // 1st quarter, 2nd quarter, ... case 'QQQQ': default: return match.quarter(string, { width: 'wide', context: 'formatting' }) || match.quarter(string, { width: 'abbreviated', context: 'formatting' }) || match.quarter(string, { width: 'narrow', context: 'formatting' }); } }, validate: function (date, value, options) { return value >= 1 && value <= 4; }, set: function (date, flags, value, options) { date.setUTCMonth((value - 1) * 3, 1); date.setUTCHours(0, 0, 0, 0); return date; } }, // Stand-alone quarter q: { priority: 120, parse: function (string, token, match, options) { switch (token) { // 1, 2, 3, 4 case 'q': case 'qq': // 01, 02, 03, 04 return parseNDigits(token.length, string); // 1st, 2nd, 3rd, 4th case 'qo': return match.ordinalNumber(string, { unit: 'quarter' }); // Q1, Q2, Q3, Q4 case 'qqq': return match.quarter(string, { width: 'abbreviated', context: 'standalone' }) || match.quarter(string, { width: 'narrow', context: 'standalone' }); // 1, 2, 3, 4 (narrow quarter; could be not numerical) case 'qqqqq': return match.quarter(string, { width: 'narrow', context: 'standalone' }); // 1st quarter, 2nd quarter, ... case 'qqqq': default: return match.quarter(string, { width: 'wide', context: 'standalone' }) || match.quarter(string, { width: 'abbreviated', context: 'standalone' }) || match.quarter(string, { width: 'narrow', context: 'standalone' }); } }, validate: function (date, value, options) { return value >= 1 && value <= 4; }, set: function (date, flags, value, options) { date.setUTCMonth((value - 1) * 3, 1); date.setUTCHours(0, 0, 0, 0); return date; } }, // Month M: { priority: 110, parse: function (string, token, match, options) { var valueCallback = function (value) { return value - 1; }; switch (token) { // 1, 2, ..., 12 case 'M': return parseNumericPattern(numericPatterns.month, string, valueCallback); // 01, 02, ..., 12 case 'MM': return parseNDigits(2, string, valueCallback); // 1st, 2nd, ..., 12th case 'Mo': return match.ordinalNumber(string, { unit: 'month', valueCallback: valueCallback }); // Jan, Feb, ..., Dec case 'MMM': return match.month(string, { width: 'abbreviated', context: 'formatting' }) || match.month(string, { width: 'narrow', context: 'formatting' }); // J, F, ..., D case 'MMMMM': return match.month(string, { width: 'narrow', context: 'formatting' }); // January, February, ..., December case 'MMMM': default: return match.month(string, { width: 'wide', context: 'formatting' }) || match.month(string, { width: 'abbreviated', context: 'formatting' }) || match.month(string, { width: 'narrow', context: 'formatting' }); } }, validate: function (date, value, options) { return value >= 0 && value <= 11; }, set: function (date, flags, value, options) { date.setUTCMonth(value, 1); date.setUTCHours(0, 0, 0, 0); return date; } }, // Stand-alone month L: { priority: 110, parse: function (string, token, match, options) { var valueCallback = function (value) { return value - 1; }; switch (token) { // 1, 2, ..., 12 case 'L': return parseNumericPattern(numericPatterns.month, string, valueCallback); // 01, 02, ..., 12 case 'LL': return parseNDigits(2, string, valueCallback); // 1st, 2nd, ..., 12th case 'Lo': return match.ordinalNumber(string, { unit: 'month', valueCallback: valueCallback }); // Jan, Feb, ..., Dec case 'LLL': return match.month(string, { width: 'abbreviated', context: 'standalone' }) || match.month(string, { width: 'narrow', context: 'standalone' }); // J, F, ..., D case 'LLLLL': return match.month(string, { width: 'narrow', context: 'standalone' }); // January, February, ..., December case 'LLLL': default: return match.month(string, { width: 'wide', context: 'standalone' }) || match.month(string, { width: 'abbreviated', context: 'standalone' }) || match.month(string, { width: 'narrow', context: 'standalone' }); } }, validate: function (date, value, options) { return value >= 0 && value <= 11; }, set: function (date, flags, value, options) { date.setUTCMonth(value, 1); date.setUTCHours(0, 0, 0, 0); return date; } }, // Local week of year w: { priority: 100, parse: function (string, token, match, options) { switch (token) { case 'w': return parseNumericPattern(numericPatterns.week, string); case 'wo': return match.ordinalNumber(string, { unit: 'week' }); default: return parseNDigits(token.length, string); } }, validate: function (date, value, options) { return value >= 1 && value <= 53; }, set: function (date, flags, value, options) { return Object(_lib_startOfUTCWeek_index_js__WEBPACK_IMPORTED_MODULE_3__["default"])(Object(_lib_setUTCWeek_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(date, value, options), options); } }, // ISO week of year I: { priority: 100, parse: function (string, token, match, options) { switch (token) { case 'I': return parseNumericPattern(numericPatterns.week, string); case 'Io': return match.ordinalNumber(string, { unit: 'week' }); default: return parseNDigits(token.length, string); } }, validate: function (date, value, options) { return value >= 1 && value <= 53; }, set: function (date, flags, value, options) { return Object(_lib_startOfUTCISOWeek_index_js__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_lib_setUTCISOWeek_index_js__WEBPACK_IMPORTED_MODULE_5__["default"])(date, value, options), options); } }, // Day of the month d: { priority: 90, parse: function (string, token, match, options) { switch (token) { case 'd': return parseNumericPattern(numericPatterns.date, string); case 'do': return match.ordinalNumber(string, { unit: 'date' }); default: return parseNDigits(token.length, string); } }, validate: function (date, value, options) { var year = date.getUTCFullYear(); var isLeapYear = isLeapYearIndex(year); var month = date.getUTCMonth(); if (isLeapYear) { return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month]; } else { return value >= 1 && value <= DAYS_IN_MONTH[month]; } }, set: function (date, flags, value, options) { date.setUTCDate(value); date.setUTCHours(0, 0, 0, 0); return date; } }, // Day of year D: { priority: 90, parse: function (string, token, match, options) { switch (token) { case 'D': case 'DD': return parseNumericPattern(numericPatterns.dayOfYear, string); case 'Do': return match.ordinalNumber(string, { unit: 'date' }); default: return parseNDigits(token.length, string); } }, validate: function (date, value, options) { var year = date.getUTCFullYear(); var isLeapYear = isLeapYearIndex(year); if (isLeapYear) { return value >= 1 && value <= 366; } else { return value >= 1 && value <= 365; } }, set: function (date, flags, value, options) { date.setUTCMonth(0, value); date.setUTCHours(0, 0, 0, 0); return date; } }, // Day of week E: { priority: 90, parse: function (string, token, match, options) { switch (token) { // Tue case 'E': case 'EE': case 'EEE': return match.day(string, { width: 'abbreviated', context: 'formatting' }) || match.day(string, { width: 'short', context: 'formatting' }) || match.day(string, { width: 'narrow', context: 'formatting' }); // T case 'EEEEE': return match.day(string, { width: 'narrow', context: 'formatting' }); // Tu case 'EEEEEE': return match.day(string, { width: 'short', context: 'formatting' }) || match.day(string, { width: 'narrow', context: 'formatting' }); // Tuesday case 'EEEE': default: return match.day(string, { width: 'wide', context: 'formatting' }) || match.day(string, { width: 'abbreviated', context: 'formatting' }) || match.day(string, { width: 'short', context: 'formatting' }) || match.day(string, { width: 'narrow', context: 'formatting' }); } }, validate: function (date, value, options) { return value >= 0 && value <= 6; }, set: function (date, flags, value, options) { date = Object(_lib_setUTCDay_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(date, value, options); date.setUTCHours(0, 0, 0, 0); return date; } }, // Local day of week e: { priority: 90, parse: function (string, token, match, options) { var valueCallback = function (value) { var wholeWeekDays = Math.floor((value - 1) / 7) * 7; return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays; }; switch (token) { // 3 case 'e': case 'ee': // 03 return parseNDigits(token.length, string, valueCallback); // 3rd case 'eo': return match.ordinalNumber(string, { unit: 'day', valueCallback: valueCallback }); // Tue case 'eee': return match.day(string, { width: 'abbreviated', context: 'formatting' }) || match.day(string, { width: 'short', context: 'formatting' }) || match.day(string, { width: 'narrow', context: 'formatting' }); // T case 'eeeee': return match.day(string, { width: 'narrow', context: 'formatting' }); // Tu case 'eeeeee': return match.day(string, { width: 'short', context: 'formatting' }) || match.day(string, { width: 'narrow', context: 'formatting' }); // Tuesday case 'eeee': default: return match.day(string, { width: 'wide', context: 'formatting' }) || match.day(string, { width: 'abbreviated', context: 'formatting' }) || match.day(string, { width: 'short', context: 'formatting' }) || match.day(string, { width: 'narrow', context: 'formatting' }); } }, validate: function (date, value, options) { return value >= 0 && value <= 6; }, set: function (date, flags, value, options) { date = Object(_lib_setUTCDay_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(date, value, options); date.setUTCHours(0, 0, 0, 0); return date; } }, // Stand-alone local day of week c: { priority: 90, parse: function (string, token, match, options) { var valueCallback = function (value) { var wholeWeekDays = Math.floor((value - 1) / 7) * 7; return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays; }; switch (token) { // 3 case 'c': case 'cc': // 03 return parseNDigits(token.length, string, valueCallback); // 3rd case 'co': return match.ordinalNumber(string, { unit: 'day', valueCallback: valueCallback }); // Tue case 'ccc': return match.day(string, { width: 'abbreviated', context: 'standalone' }) || match.day(string, { width: 'short', context: 'standalone' }) || match.day(string, { width: 'narrow', context: 'standalone' }); // T case 'ccccc': return match.day(string, { width: 'narrow', context: 'standalone' }); // Tu case 'cccccc': return match.day(string, { width: 'short', context: 'standalone' }) || match.day(string, { width: 'narrow', context: 'standalone' }); // Tuesday case 'cccc': default: return match.day(string, { width: 'wide', context: 'standalone' }) || match.day(string, { width: 'abbreviated', context: 'standalone' }) || match.day(string, { width: 'short', context: 'standalone' }) || match.day(string, { width: 'narrow', context: 'standalone' }); } }, validate: function (date, value, options) { return value >= 0 && value <= 6; }, set: function (date, flags, value, options) { date = Object(_lib_setUTCDay_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(date, value, options); date.setUTCHours(0, 0, 0, 0); return date; } }, // ISO day of week i: { priority: 90, parse: function (string, token, match, options) { var valueCallback = function (value) { if (value === 0) { return 7; } return value; }; switch (token) { // 2 case 'i': case 'ii': // 02 return parseNDigits(token.length, string); // 2nd case 'io': return match.ordinalNumber(string, { unit: 'day' }); // Tue case 'iii': return match.day(string, { width: 'abbreviated', context: 'formatting', valueCallback: valueCallback }) || match.day(string, { width: 'short', context: 'formatting', valueCallback: valueCallback }) || match.day(string, { width: 'narrow', context: 'formatting', valueCallback: valueCallback }); // T case 'iiiii': return match.day(string, { width: 'narrow', context: 'formatting', valueCallback: valueCallback }); // Tu case 'iiiiii': return match.day(string, { width: 'short', context: 'formatting', valueCallback: valueCallback }) || match.day(string, { width: 'narrow', context: 'formatting', valueCallback: valueCallback }); // Tuesday case 'iiii': default: return match.day(string, { width: 'wide', context: 'formatting', valueCallback: valueCallback }) || match.day(string, { width: 'abbreviated', context: 'formatting', valueCallback: valueCallback }) || match.day(string, { width: 'short', context: 'formatting', valueCallback: valueCallback }) || match.day(string, { width: 'narrow', context: 'formatting', valueCallback: valueCallback }); } }, validate: function (date, value, options) { return value >= 1 && value <= 7; }, set: function (date, flags, value, options) { date = Object(_lib_setUTCISODay_index_js__WEBPACK_IMPORTED_MODULE_4__["default"])(date, value, options); date.setUTCHours(0, 0, 0, 0); return date; } }, // AM or PM a: { priority: 80, parse: function (string, token, match, options) { switch (token) { case 'a': case 'aa': case 'aaa': return match.dayPeriod(string, { width: 'abbreviated', context: 'formatting' }) || match.dayPeriod(string, { width: 'narrow', context: 'formatting' }); case 'aaaaa': return match.dayPeriod(string, { width: 'narrow', context: 'formatting' }); case 'aaaa': default: return match.dayPeriod(string, { width: 'wide', context: 'formatting' }) || match.dayPeriod(string, { width: 'abbreviated', context: 'formatting' }) || match.dayPeriod(string, { width: 'narrow', context: 'formatting' }); } }, set: function (date, flags, value, options) { date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0); return date; } }, // AM, PM, midnight b: { priority: 80, parse: function (string, token, match, options) { switch (token) { case 'b': case 'bb': case 'bbb': return match.dayPeriod(string, { width: 'abbreviated', context: 'formatting' }) || match.dayPeriod(string, { width: 'narrow', context: 'formatting' }); case 'bbbbb': return match.dayPeriod(string, { width: 'narrow', context: 'formatting' }); case 'bbbb': default: return match.dayPeriod(string, { width: 'wide', context: 'formatting' }) || match.dayPeriod(string, { width: 'abbreviated', context: 'formatting' }) || match.dayPeriod(string, { width: 'narrow', context: 'formatting' }); } }, set: function (date, flags, value, options) { date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0); return date; } }, // in the morning, in the afternoon, in the evening, at night B: { priority: 80, parse: function (string, token, match, options) { switch (token) { case 'B': case 'BB': case 'BBB': return match.dayPeriod(string, { width: 'abbreviated', context: 'formatting' }) || match.dayPeriod(string, { width: 'narrow', context: 'formatting' }); case 'BBBBB': return match.dayPeriod(string, { width: 'narrow', context: 'formatting' }); case 'BBBB': default: return match.dayPeriod(string, { width: 'wide', context: 'formatting' }) || match.dayPeriod(string, { width: 'abbreviated', context: 'formatting' }) || match.dayPeriod(string, { width: 'narrow', context: 'formatting' }); } }, set: function (date, flags, value, options) { date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0); return date; } }, // Hour [1-12] h: { priority: 70, parse: function (string, token, match, options) { switch (token) { case 'h': return parseNumericPattern(numericPatterns.hour12h, string); case 'ho': return match.ordinalNumber(string, { unit: 'hour' }); default: return parseNDigits(token.length, string); } }, validate: function (date, value, options) { return value >= 1 && value <= 12; }, set: function (date, flags, value, options) { var isPM = date.getUTCHours() >= 12; if (isPM && value < 12) { date.setUTCHours(value + 12, 0, 0, 0); } else if (!isPM && value === 12) { date.setUTCHours(0, 0, 0, 0); } else { date.setUTCHours(value, 0, 0, 0); } return date; } }, // Hour [0-23] H: { priority: 70, parse: function (string, token, match, options) { switch (token) { case 'H': return parseNumericPattern(numericPatterns.hour23h, string); case 'Ho': return match.ordinalNumber(string, { unit: 'hour' }); default: return parseNDigits(token.length, string); } }, validate: function (date, value, options) { return value >= 0 && value <= 23; }, set: function (date, flags, value, options) { date.setUTCHours(value, 0, 0, 0); return date; } }, // Hour [0-11] K: { priority: 70, parse: function (string, token, match, options) { switch (token) { case 'K': return parseNumericPattern(numericPatterns.hour11h, string); case 'Ko': return match.ordinalNumber(string, { unit: 'hour' }); default: return parseNDigits(token.length, string); } }, validate: function (date, value, options) { return value >= 0 && value <= 11; }, set: function (date, flags, value, options) { var isPM = date.getUTCHours() >= 12; if (isPM && value < 12) { date.setUTCHours(value + 12, 0, 0, 0); } else { date.setUTCHours(value, 0, 0, 0); } return date; } }, // Hour [1-24] k: { priority: 70, parse: function (string, token, match, options) { switch (token) { case 'k': return parseNumericPattern(numericPatterns.hour24h, string); case 'ko': return match.ordinalNumber(string, { unit: 'hour' }); default: return parseNDigits(token.length, string); } }, validate: function (date, value, options) { return value >= 1 && value <= 24; }, set: function (date, flags, value, options) { var hours = value <= 24 ? value % 24 : value; date.setUTCHours(hours, 0, 0, 0); return date; } }, // Minute m: { priority: 60, parse: function (string, token, match, options) { switch (token) { case 'm': return parseNumericPattern(numericPatterns.minute, string); case 'mo': return match.ordinalNumber(string, { unit: 'minute' }); default: return parseNDigits(token.length, string); } }, validate: function (date, value, options) { return value >= 0 && value <= 59; }, set: function (date, flags, value, options) { date.setUTCMinutes(value, 0, 0); return date; } }, // Second s: { priority: 50, parse: function (string, token, match, options) { switch (token) { case 's': return parseNumericPattern(numericPatterns.second, string); case 'so': return match.ordinalNumber(string, { unit: 'second' }); default: return parseNDigits(token.length, string); } }, validate: function (date, value, options) { return value >= 0 && value <= 59; }, set: function (date, flags, value, options) { date.setUTCSeconds(value, 0); return date; } }, // Fraction of second S: { priority: 30, parse: function (string, token, match, options) { var valueCallback = function (value) { return Math.floor(value * Math.pow(10, -token.length + 3)); }; return parseNDigits(token.length, string, valueCallback); }, set: function (date, flags, value, options) { date.setUTCMilliseconds(value); return date; } }, // Timezone (ISO-8601. +00:00 is `'Z'`) X: { priority: 10, parse: function (string, token, match, options) { switch (token) { case 'X': return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string); case 'XX': return parseTimezonePattern(timezonePatterns.basic, string); case 'XXXX': return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string); case 'XXXXX': return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string); case 'XXX': default: return parseTimezonePattern(timezonePatterns.extended, string); } }, set: function (date, flags, value, options) { if (flags.timestampIsSet) { return date; } return new Date(date.getTime() - value); } }, // Timezone (ISO-8601) x: { priority: 10, parse: function (string, token, match, options) { switch (token) { case 'x': return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string); case 'xx': return parseTimezonePattern(timezonePatterns.basic, string); case 'xxxx': return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string); case 'xxxxx': return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string); case 'xxx': default: return parseTimezonePattern(timezonePatterns.extended, string); } }, set: function (date, flags, value, options) { if (flags.timestampIsSet) { return date; } return new Date(date.getTime() - value); } }, // Seconds timestamp t: { priority: 40, parse: function (string, token, match, options) { return parseAnyDigitsSigned(string); }, set: function (date, flags, value, options) { return [new Date(value * 1000), { timestampIsSet: true }]; } }, // Milliseconds timestamp T: { priority: 20, parse: function (string, token, match, options) { return parseAnyDigitsSigned(string); }, set: function (date, flags, value, options) { return [new Date(value), { timestampIsSet: true }]; } } }; /* harmony default export */ __webpack_exports__["default"] = (parsers); /***/ }), /***/ "./node_modules/date-fns/esm/parse/index.js": /*!**************************************************!*\ !*** ./node_modules/date-fns/esm/parse/index.js ***! \**************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return parse; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _lib_assign_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../_lib/assign/index.js */ "./node_modules/date-fns/esm/_lib/assign/index.js"); /* harmony import */ var _lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../_lib/getTimezoneOffsetInMilliseconds/index.js */ "./node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _subMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../subMilliseconds/index.js */ "./node_modules/date-fns/esm/subMilliseconds/index.js"); /* harmony import */ var _locale_en_US_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../locale/en-US/index.js */ "./node_modules/date-fns/esm/locale/en-US/index.js"); /* harmony import */ var _lib_parsers_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_lib/parsers/index.js */ "./node_modules/date-fns/esm/parse/_lib/parsers/index.js"); /* harmony import */ var _lib_protectedTokens_index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../_lib/protectedTokens/index.js */ "./node_modules/date-fns/esm/_lib/protectedTokens/index.js"); var TIMEZONE_UNIT_PRIORITY = 10; // This RegExp consists of three parts separated by `|`: // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token // (one of the certain letters followed by `o`) // - (\w)\1* matches any sequences of the same letter // - '' matches two quote characters in a row // - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('), // except a single quote symbol, which ends the sequence. // Two quote characters do not end the sequence. // If there is no matching single quote // then the sequence will continue until the end of the string. // - . matches any single character unmatched by previous parts of the RegExps var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; var escapedStringRegExp = /^'(.*?)'?$/; var doubleQuoteRegExp = /''/g; var notWhitespaceRegExp = /\S/; /** * @name parse * @category Common Helpers * @summary Parse the date. * * @description * Return the date parsed from string using the given format string. * * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries. * > See: https://git.io/fxCyr * * The characters in the format string wrapped between two single quotes characters (') are escaped. * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote. * * Format of the format string is based on Unicode Technical Standard #35: * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table * with a few additions (see note 5 below the table). * * Accepted format string patterns: * | Unit |Prior| Pattern | Result examples | Notes | * |---------------------------------|-----|---------|-----------------------------------|-------| * | Era | 140 | G..GGG | AD, BC | | * | | | GGGG | Anno Domini, Before Christ | 2 | * | | | GGGGG | A, B | | * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 | * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 | * | | | yy | 44, 01, 00, 17 | 4 | * | | | yyy | 044, 001, 123, 999 | 4 | * | | | yyyy | 0044, 0001, 1900, 2017 | 4 | * | | | yyyyy | ... | 2,4 | * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 | * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 | * | | | YY | 44, 01, 00, 17 | 4,6 | * | | | YYY | 044, 001, 123, 999 | 4 | * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 | * | | | YYYYY | ... | 2,4 | * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 | * | | | RR | -43, 01, 00, 17 | 4,5 | * | | | RRR | -043, 001, 123, 999, -999 | 4,5 | * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 | * | | | RRRRR | ... | 2,4,5 | * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 | * | | | uu | -43, 01, 99, -99 | 4 | * | | | uuu | -043, 001, 123, 999, -999 | 4 | * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 | * | | | uuuuu | ... | 2,4 | * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | | * | | | Qo | 1st, 2nd, 3rd, 4th | 5 | * | | | QQ | 01, 02, 03, 04 | | * | | | QQQ | Q1, Q2, Q3, Q4 | | * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 | * | | | QQQQQ | 1, 2, 3, 4 | 4 | * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | | * | | | qo | 1st, 2nd, 3rd, 4th | 5 | * | | | qq | 01, 02, 03, 04 | | * | | | qqq | Q1, Q2, Q3, Q4 | | * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 | * | | | qqqqq | 1, 2, 3, 4 | 3 | * | Month (formatting) | 110 | M | 1, 2, ..., 12 | | * | | | Mo | 1st, 2nd, ..., 12th | 5 | * | | | MM | 01, 02, ..., 12 | | * | | | MMM | Jan, Feb, ..., Dec | | * | | | MMMM | January, February, ..., December | 2 | * | | | MMMMM | J, F, ..., D | | * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | | * | | | Lo | 1st, 2nd, ..., 12th | 5 | * | | | LL | 01, 02, ..., 12 | | * | | | LLL | Jan, Feb, ..., Dec | | * | | | LLLL | January, February, ..., December | 2 | * | | | LLLLL | J, F, ..., D | | * | Local week of year | 100 | w | 1, 2, ..., 53 | | * | | | wo | 1st, 2nd, ..., 53th | 5 | * | | | ww | 01, 02, ..., 53 | | * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 | * | | | Io | 1st, 2nd, ..., 53th | 5 | * | | | II | 01, 02, ..., 53 | 5 | * | Day of month | 90 | d | 1, 2, ..., 31 | | * | | | do | 1st, 2nd, ..., 31st | 5 | * | | | dd | 01, 02, ..., 31 | | * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 6 | * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 | * | | | DD | 01, 02, ..., 365, 366 | 6 | * | | | DDD | 001, 002, ..., 365, 366 | | * | | | DDDD | ... | 2 | * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Su | | * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 | * | | | EEEEE | M, T, W, T, F, S, S | | * | | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | | * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 | * | | | io | 1st, 2nd, ..., 7th | 5 | * | | | ii | 01, 02, ..., 07 | 5 | * | | | iii | Mon, Tue, Wed, ..., Su | 5 | * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 | * | | | iiiii | M, T, W, T, F, S, S | 5 | * | | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 5 | * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | | * | | | eo | 2nd, 3rd, ..., 1st | 5 | * | | | ee | 02, 03, ..., 01 | | * | | | eee | Mon, Tue, Wed, ..., Su | | * | | | eeee | Monday, Tuesday, ..., Sunday | 2 | * | | | eeeee | M, T, W, T, F, S, S | | * | | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | | * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | | * | | | co | 2nd, 3rd, ..., 1st | 5 | * | | | cc | 02, 03, ..., 01 | | * | | | ccc | Mon, Tue, Wed, ..., Su | | * | | | cccc | Monday, Tuesday, ..., Sunday | 2 | * | | | ccccc | M, T, W, T, F, S, S | | * | | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | | * | AM, PM | 80 | a..aaa | AM, PM | | * | | | aaaa | a.m., p.m. | 2 | * | | | aaaaa | a, p | | * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | | * | | | bbbb | a.m., p.m., noon, midnight | 2 | * | | | bbbbb | a, p, n, mi | | * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | | * | | | BBBB | at night, in the morning, ... | 2 | * | | | BBBBB | at night, in the morning, ... | | * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | | * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 | * | | | hh | 01, 02, ..., 11, 12 | | * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | | * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 | * | | | HH | 00, 01, 02, ..., 23 | | * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | | * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 | * | | | KK | 1, 2, ..., 11, 0 | | * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | | * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 | * | | | kk | 24, 01, 02, ..., 23 | | * | Minute | 60 | m | 0, 1, ..., 59 | | * | | | mo | 0th, 1st, ..., 59th | 5 | * | | | mm | 00, 01, ..., 59 | | * | Second | 50 | s | 0, 1, ..., 59 | | * | | | so | 0th, 1st, ..., 59th | 5 | * | | | ss | 00, 01, ..., 59 | | * | Seconds timestamp | 40 | t | 512969520 | | * | | | tt | ... | 2 | * | Fraction of second | 30 | S | 0, 1, ..., 9 | | * | | | SS | 00, 01, ..., 99 | | * | | | SSS | 000, 0001, ..., 999 | | * | | | SSSS | ... | 2 | * | Milliseconds timestamp | 20 | T | 512969520900 | | * | | | TT | ... | 2 | * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | | * | | | XX | -0800, +0530, Z | | * | | | XXX | -08:00, +05:30, Z | | * | | | XXXX | -0800, +0530, Z, +123456 | 2 | * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | | * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | | * | | | xx | -0800, +0530, +0000 | | * | | | xxx | -08:00, +05:30, +00:00 | 2 | * | | | xxxx | -0800, +0530, +0000, +123456 | | * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | | * Notes: * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale * are the same as "stand-alone" units, but are different in some languages. * "Formatting" units are declined according to the rules of the language * in the context of a date. "Stand-alone" units are always nominative singular. * In `format` function, they will produce different result: * * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'` * * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'` * * `parse` will try to match both formatting and stand-alone units interchangably. * * 2. Any sequence of the identical letters is a pattern, unless it is escaped by * the single quote characters (see below). * If the sequence is longer than listed in table: * - for numerical units (`yyyyyyyy`) `parse` will try to match a number * as wide as the sequence * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit. * These variations are marked with "2" in the last column of the table. * * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales. * These tokens represent the shortest form of the quarter. * * 4. The main difference between `y` and `u` patterns are B.C. years: * * | Year | `y` | `u` | * |------|-----|-----| * | AC 1 | 1 | 1 | * | BC 1 | 1 | 0 | * | BC 2 | 2 | -1 | * * Also `yy` will try to guess the century of two digit year by proximity with `baseDate`: * * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00` * * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00` * * while `uu` will just assign the year as is: * * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00` * * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00` * * The same difference is true for local and ISO week-numbering years (`Y` and `R`), * except local week-numbering years are dependent on `options.weekStartsOn` * and `options.firstWeekContainsDate` (compare [setISOWeekYear]{@link https://date-fns.org/docs/setISOWeekYear} * and [setWeekYear]{@link https://date-fns.org/docs/setWeekYear}). * * 5. These patterns are not in the Unicode Technical Standard #35: * - `i`: ISO day of week * - `I`: ISO week of year * - `R`: ISO week-numbering year * - `o`: ordinal number modifier * * 6. These tokens are often confused with others. See: https://git.io/fxCyr * * Values will be assigned to the date in the descending order of its unit's priority. * Units of an equal priority overwrite each other in the order of appearance. * * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year), * the values will be taken from 3rd argument `baseDate` which works as a context of parsing. * * `baseDate` must be passed for correct work of the function. * If you're not sure which `baseDate` to supply, create a new instance of Date: * `parse('02/11/2014', 'MM/dd/yyyy', new Date())` * In this case parsing will be done in the context of the current date. * If `baseDate` is `Invalid Date` or a value not convertible to valid `Date`, * then `Invalid Date` will be returned. * * The result may vary by locale. * * If `formatString` matches with `dateString` but does not provides tokens, `baseDate` will be returned. * * If parsing failed, `Invalid Date` will be returned. * Invalid Date is a Date, whose time value is NaN. * Time value of Date: http://es5.github.io/#x15.9.1.1 * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * - Old `parse` was renamed to `toDate`. * Now `parse` is a new function which parses a string using a provided format. * * ```javascript * // Before v2.0.0 * parse('2016-01-01') * * // v2.0.0 onward * toDate('2016-01-01') * parse('2016-01-01', 'yyyy-MM-dd', new Date()) * ``` * * @param {String} dateString - the string to parse * @param {String} formatString - the string of tokens * @param {Date|Number} baseDate - defines values missing from the parsed dateString * @param {Object} [options] - an object with options. * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year * @param {Boolean} [options.awareOfUnicodeTokens=false] - if true, allows usage of Unicode tokens causes confusion: * - Some of the day of year tokens (`D`, `DD`) that are confused with the day of month tokens (`d`, `dd`). * - Some of the local week-numbering year tokens (`YY`, `YYYY`) that are confused with the calendar year tokens (`yy`, `yyyy`). * See: https://git.io/fxCyr * @returns {Date} the parsed date * @throws {TypeError} 3 arguments required * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7 * @throws {RangeError} `options.locale` must contain `match` property * @throws {RangeError} `options.awareOfUnicodeTokens` must be set to `true` to use `XX` token; see: https://git.io/fxCyr * * @example * // Parse 11 February 2014 from middle-endian format: * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date()) * //=> Tue Feb 11 2014 00:00:00 * * @example * // Parse 28th of February in Esperanto locale in the context of 2010 year: * import eo from 'date-fns/locale/eo' * var result = parse('28-a de februaro', "do 'de' MMMM", new Date(2010, 0, 1), { * locale: eo * }) * //=> Sun Feb 28 2010 00:00:00 */ function parse(dirtyDateString, dirtyFormatString, dirtyBaseDate, dirtyOptions) { if (arguments.length < 3) { throw new TypeError('3 arguments required, but only ' + arguments.length + ' present'); } var dateString = String(dirtyDateString); var formatString = String(dirtyFormatString); var options = dirtyOptions || {}; var locale = options.locale || _locale_en_US_index_js__WEBPACK_IMPORTED_MODULE_5__["default"]; if (!locale.match) { throw new RangeError('locale must contain match property'); } var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate; var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(localeFirstWeekContainsDate); var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) { throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively'); } var localeWeekStartsOn = locale.options && locale.options.weekStartsOn; var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(localeWeekStartsOn); var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); } if (formatString === '') { if (dateString === '') { return Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_3__["default"])(dirtyBaseDate); } else { return new Date(NaN); } } var subFnOptions = { firstWeekContainsDate: firstWeekContainsDate, weekStartsOn: weekStartsOn, locale: locale }; // If timezone isn't specified, it will be set to the system timezone var setters = [{ priority: TIMEZONE_UNIT_PRIORITY, set: dateToSystemTimezone, index: 0 }]; var i; var tokens = formatString.match(formattingTokensRegExp); for (i = 0; i < tokens.length; i++) { var token = tokens[i]; if (!options.awareOfUnicodeTokens && Object(_lib_protectedTokens_index_js__WEBPACK_IMPORTED_MODULE_7__["isProtectedToken"])(token)) { Object(_lib_protectedTokens_index_js__WEBPACK_IMPORTED_MODULE_7__["throwProtectedError"])(token); } var firstCharacter = token[0]; var parser = _lib_parsers_index_js__WEBPACK_IMPORTED_MODULE_6__["default"][firstCharacter]; if (parser) { var parseResult = parser.parse(dateString, token, locale.match, subFnOptions); if (!parseResult) { return new Date(NaN); } setters.push({ priority: parser.priority, set: parser.set, validate: parser.validate, value: parseResult.value, index: setters.length }); dateString = parseResult.rest; } else { // Replace two single quote characters with one single quote character if (token === "''") { token = "'"; } else if (firstCharacter === "'") { token = cleanEscapedString(token); } // Cut token from string, or, if string doesn't match the token, return Invalid Date if (dateString.indexOf(token) === 0) { dateString = dateString.slice(token.length); } else { return new Date(NaN); } } } // Check if the remaining input contains something other than whitespace if (dateString.length > 0 && notWhitespaceRegExp.test(dateString)) { return new Date(NaN); } var uniquePrioritySetters = setters.map(function (setter) { return setter.priority; }).sort(function (a, b) { return b - a; }).filter(function (priority, index, array) { return array.indexOf(priority) === index; }).map(function (priority) { return setters.filter(function (setter) { return setter.priority === priority; }).reverse(); }).map(function (setterArray) { return setterArray[0]; }); var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_3__["default"])(dirtyBaseDate); if (isNaN(date)) { return new Date(NaN); } // Convert the date in system timezone to the same date in UTC+00:00 timezone. // This ensures that when UTC functions will be implemented, locales will be compatible with them. // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/37 var utcDate = Object(_subMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_4__["default"])(date, Object(_lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(date)); var flags = {}; for (i = 0; i < uniquePrioritySetters.length; i++) { var setter = uniquePrioritySetters[i]; if (setter.validate && !setter.validate(utcDate, setter.value, subFnOptions)) { return new Date(NaN); } var result = setter.set(utcDate, flags, setter.value, subFnOptions); // Result is tuple (date, flags) if (result[0]) { utcDate = result[0]; Object(_lib_assign_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(flags, result[1]); // Result is date } else { utcDate = result; } } return utcDate; } function dateToSystemTimezone(date, flags) { if (flags.timestampIsSet) { return date; } var convertedDate = new Date(0); convertedDate.setFullYear(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate()); convertedDate.setHours(date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds()); return convertedDate; } function cleanEscapedString(input) { return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'"); } /***/ }), /***/ "./node_modules/date-fns/esm/parseISO/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/esm/parseISO/index.js ***! \*****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return parseISO; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../_lib/getTimezoneOffsetInMilliseconds/index.js */ "./node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js"); var MILLISECONDS_IN_HOUR = 3600000; var MILLISECONDS_IN_MINUTE = 60000; var DEFAULT_ADDITIONAL_DIGITS = 2; var patterns = { dateTimeDelimiter: /[T ]/, timeZoneDelimiter: /[Z ]/i, timezone: /([Z+-].*)$/ }; var dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/; var timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/; var timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/; /** * @name parseISO * @category Common Helpers * @summary Parse ISO string * * @description * Parse the given string in ISO 8601 format and return an instance of Date. * * Function accepts complete ISO 8601 formats as well as partial implementations. * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601 * * If the argument isn't a string, the function cannot parse the string or * the values are invalid, it returns Invalid Date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * - The previous `parse` implementation was renamed to `parseISO`. * * ```javascript * // Before v2.0.0 * parse('2016-01-01') * * // v2.0.0 onward * parseISO('2016-01-01') * ``` * * - `parseISO` now validates separate date and time values in ISO-8601 strings * and returns `Invalid Date` if the date is invalid. * * ```javascript * parseISO('2018-13-32') * //=> Invalid Date * ``` * * - `parseISO` now doesn't fall back to `new Date` constructor * if it fails to parse a string argument. Instead, it returns `Invalid Date`. * * @param {String} argument - the value to convert * @param {Object} [options] - an object with options. * @param {0|1|2} [options.additionalDigits=2] - the additional number of digits in the extended year format * @returns {Date} the parsed date in the local time zone * @throws {TypeError} 1 argument required * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 * * @example * // Convert string '2014-02-11T11:30:30' to date: * var result = parseISO('2014-02-11T11:30:30') * //=> Tue Feb 11 2014 11:30:30 * * @example * // Convert string '+02014101' to date, * // if the additional number of digits in the extended year format is 1: * var result = parseISO('+02014101', { additionalDigits: 1 }) * //=> Fri Apr 11 2014 00:00:00 */ function parseISO(argument, dirtyOptions) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var options = dirtyOptions || {}; var additionalDigits = options.additionalDigits == null ? DEFAULT_ADDITIONAL_DIGITS : Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options.additionalDigits); if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) { throw new RangeError('additionalDigits must be 0, 1 or 2'); } if (!(typeof argument === 'string' || Object.prototype.toString.call(argument) === '[object String]')) { return new Date(NaN); } var dateStrings = splitDateString(argument); var parseYearResult = parseYear(dateStrings.date, additionalDigits); var date = parseDate(parseYearResult.restDateString, parseYearResult.year); if (isNaN(date) || !date) { return new Date(NaN); } var timestamp = date.getTime(); var time = 0; var offset; if (dateStrings.time) { time = parseTime(dateStrings.time); if (isNaN(time)) { return new Date(NaN); } } if (dateStrings.timezone) { offset = parseTimezone(dateStrings.timezone); if (isNaN(offset)) { return new Date(NaN); } } else { var fullTime = timestamp + time; var fullTimeDate = new Date(fullTime); offset = Object(_lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(fullTimeDate); // Adjust time when it's coming from DST var fullTimeDateNextDay = new Date(fullTime); fullTimeDateNextDay.setDate(fullTimeDate.getDate() + 1); var offsetDiff = Object(_lib_getTimezoneOffsetInMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(fullTimeDateNextDay) - offset; if (offsetDiff > 0) { offset += offsetDiff; } } return new Date(timestamp + time + offset); } function splitDateString(dateString) { var dateStrings = {}; var array = dateString.split(patterns.dateTimeDelimiter); var timeString; if (/:/.test(array[0])) { dateStrings.date = null; timeString = array[0]; } else { dateStrings.date = array[0]; timeString = array[1]; if (patterns.timeZoneDelimiter.test(dateStrings.date)) { dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0]; timeString = dateString.substr(dateStrings.date.length, dateString.length); } } if (timeString) { var token = patterns.timezone.exec(timeString); if (token) { dateStrings.time = timeString.replace(token[1], ''); dateStrings.timezone = token[1]; } else { dateStrings.time = timeString; } } return dateStrings; } function parseYear(dateString, additionalDigits) { var regex = new RegExp('^(?:(\\d{4}|[+-]\\d{' + (4 + additionalDigits) + '})|(\\d{2}|[+-]\\d{' + (2 + additionalDigits) + '})$)'); var captures = dateString.match(regex); // Invalid ISO-formatted year if (!captures) return { year: null }; var year = captures[1] && parseInt(captures[1]); var century = captures[2] && parseInt(captures[2]); return { year: century == null ? year : century * 100, restDateString: dateString.slice((captures[1] || captures[2]).length) }; } function parseDate(dateString, year) { // Invalid ISO-formatted year if (year === null) return null; var captures = dateString.match(dateRegex); // Invalid ISO-formatted string if (!captures) return null; var isWeekDate = !!captures[4]; var dayOfYear = parseDateUnit(captures[1]); var month = parseDateUnit(captures[2]) - 1; var day = parseDateUnit(captures[3]); var week = parseDateUnit(captures[4]) - 1; var dayOfWeek = parseDateUnit(captures[5]) - 1; if (isWeekDate) { if (!validateWeekDate(year, week, dayOfWeek)) { return new Date(NaN); } return dayOfISOWeekYear(year, week, dayOfWeek); } else { var date = new Date(0); if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) { return new Date(NaN); } date.setUTCFullYear(year, month, Math.max(dayOfYear, day)); return date; } } function parseDateUnit(value) { return value ? parseInt(value) : 1; } function parseTime(timeString) { var captures = timeString.match(timeRegex); if (!captures) return null; // Invalid ISO-formatted time var hours = parseTimeUnit(captures[1]); var minutes = parseTimeUnit(captures[2]); var seconds = parseTimeUnit(captures[3]); if (!validateTime(hours, minutes, seconds)) { return NaN; } return hours % 24 * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * 1000; } function parseTimeUnit(value) { return value && parseFloat(value.replace(',', '.')) || 0; } function parseTimezone(timezoneString) { if (timezoneString === 'Z') return 0; var captures = timezoneString.match(timezoneRegex); if (!captures) return 0; var sign = captures[1] === '+' ? -1 : 1; var hours = parseInt(captures[2]); var minutes = captures[3] && parseInt(captures[3]) || 0; if (!validateTimezone(hours, minutes)) { return NaN; } return sign * (hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE); } function dayOfISOWeekYear(isoWeekYear, week, day) { var date = new Date(0); date.setUTCFullYear(isoWeekYear, 0, 4); var fourthOfJanuaryDay = date.getUTCDay() || 7; var diff = (week || 0) * 7 + (day || 0) + 1 - fourthOfJanuaryDay; date.setUTCDate(date.getUTCDate() + diff); return date; } // Validation functions // February is null to handle the leap year (using ||) var daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; function isLeapYearIndex(year) { return year % 400 === 0 || year % 4 === 0 && year % 100; } function validateDate(year, month, date) { return !(month < 0 || month > 11 || date < 1 || date > (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28))); } function validateDayOfYearDate(year, dayOfYear) { return !(dayOfYear < 1 || dayOfYear > (isLeapYearIndex(year) ? 366 : 365)); } function validateWeekDate(_year, week, day) { return !(week < 0 || week > 52 || day < 0 || day > 6); } function validateTime(hours, minutes, seconds) { return !(seconds < 0 || seconds >= 60 || minutes < 0 || minutes >= 60 || hours < 0 || hours >= 25); } function validateTimezone(_hours, minutes) { return !(minutes < 0 || minutes > 59); } /***/ }), /***/ "./node_modules/date-fns/esm/roundToNearestMinutes/index.js": /*!******************************************************************!*\ !*** ./node_modules/date-fns/esm/roundToNearestMinutes/index.js ***! \******************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return roundToNearestMinutes; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /** * @name roundToNearestMinutes * @category Minute Helpers * @summary Rounds the given date to the nearest minute * * @description * Rounds the given date to the nearest minute * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to round * @param {Object} [options] - an object with options. * @param {Number} [options.nearestTo=1] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} * @returns {Date} the new date rounded to the closest minute * @throws {TypeError} 1 argument required * @throws {RangeError} `options.nearestTo` must be between 1 and 30 * * @example * // Round 10 July 2014 12:12:34 to nearest minute: * var result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34)) * //=> Thu Jul 10 2014 12:13:00 */ function roundToNearestMinutes(dirtyDate, options) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only none provided present'); } var nearestTo = options && 'nearestTo' in options ? Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(options.nearestTo) : 1; if (nearestTo < 1 || nearestTo > 30) { throw new RangeError('`options.nearestTo` must be between 1 and 30'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var seconds = date.getSeconds(); // relevant if nearestTo is 1, which is the default case var minutes = date.getMinutes() + seconds / 60; var roundedMinutes = Math.floor(minutes / nearestTo) * nearestTo; var remainderMinutes = minutes % nearestTo; var addedMinutes = Math.round(remainderMinutes / nearestTo) * nearestTo; return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), roundedMinutes + addedMinutes); } /***/ }), /***/ "./node_modules/date-fns/esm/setDate/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/esm/setDate/index.js ***! \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return setDate; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name setDate * @category Day Helpers * @summary Set the day of the month to the given date. * * @description * Set the day of the month to the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} dayOfMonth - the day of the month of the new date * @returns {Date} the new date with the day of the month set * @throws {TypeError} 2 arguments required * * @example * // Set the 30th day of the month to 1 September 2014: * var result = setDate(new Date(2014, 8, 1), 30) * //=> Tue Sep 30 2014 00:00:00 */ function setDate(dirtyDate, dirtyDayOfMonth) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var dayOfMonth = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDayOfMonth); date.setDate(dayOfMonth); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/setDay/index.js": /*!***************************************************!*\ !*** ./node_modules/date-fns/esm/setDay/index.js ***! \***************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return setDay; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _addDays_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../addDays/index.js */ "./node_modules/date-fns/esm/addDays/index.js"); /** * @name setDay * @category Weekday Helpers * @summary Set the day of the week to the given date. * * @description * Set the day of the week to the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} day - the day of the week of the new date * @param {Object} [options] - an object with options. * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} * @returns {Date} the new date with the day of the week set * @throws {TypeError} 2 arguments required * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 * * @example * // Set Sunday to 1 September 2014: * var result = setDay(new Date(2014, 8, 1), 0) * //=> Sun Aug 31 2014 00:00:00 * * @example * // If week starts with Monday, set Sunday to 1 September 2014: * var result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 }) * //=> Sun Sep 07 2014 00:00:00 */ function setDay(dirtyDate, dirtyDay, dirtyOptions) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var options = dirtyOptions || {}; var locale = options.locale; var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn; var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(localeWeekStartsOn); var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate, options); var day = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDay); var currentDay = date.getDay(); var remainder = day % 7; var dayIndex = (remainder + 7) % 7; var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay; return Object(_addDays_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(date, diff, options); } /***/ }), /***/ "./node_modules/date-fns/esm/setDayOfYear/index.js": /*!*********************************************************!*\ !*** ./node_modules/date-fns/esm/setDayOfYear/index.js ***! \*********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return setDayOfYear; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name setDayOfYear * @category Day Helpers * @summary Set the day of the year to the given date. * * @description * Set the day of the year to the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} dayOfYear - the day of the year of the new date * @returns {Date} the new date with the day of the year set * @throws {TypeError} 2 arguments required * * @example * // Set the 2nd day of the year to 2 July 2014: * var result = setDayOfYear(new Date(2014, 6, 2), 2) * //=> Thu Jan 02 2014 00:00:00 */ function setDayOfYear(dirtyDate, dirtyDayOfYear) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var dayOfYear = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDayOfYear); date.setMonth(0); date.setDate(dayOfYear); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/setHours/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/esm/setHours/index.js ***! \*****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return setHours; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name setHours * @category Hour Helpers * @summary Set the hours to the given date. * * @description * Set the hours to the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} hours - the hours of the new date * @returns {Date} the new date with the hours set * @throws {TypeError} 2 arguments required * * @example * // Set 4 hours to 1 September 2014 11:30:00: * var result = setHours(new Date(2014, 8, 1, 11, 30), 4) * //=> Mon Sep 01 2014 04:30:00 */ function setHours(dirtyDate, dirtyHours) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var hours = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyHours); date.setHours(hours); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/setISODay/index.js": /*!******************************************************!*\ !*** ./node_modules/date-fns/esm/setISODay/index.js ***! \******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return setISODay; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _addDays_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../addDays/index.js */ "./node_modules/date-fns/esm/addDays/index.js"); /* harmony import */ var _getISODay_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../getISODay/index.js */ "./node_modules/date-fns/esm/getISODay/index.js"); /** * @name setISODay * @category Weekday Helpers * @summary Set the day of the ISO week to the given date. * * @description * Set the day of the ISO week to the given date. * ISO week starts with Monday. * 7 is the index of Sunday, 1 is the index of Monday etc. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} day - the day of the ISO week of the new date * @returns {Date} the new date with the day of the ISO week set * @throws {TypeError} 2 arguments required * * @example * // Set Sunday to 1 September 2014: * var result = setISODay(new Date(2014, 8, 1), 7) * //=> Sun Sep 07 2014 00:00:00 */ function setISODay(dirtyDate, dirtyDay) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var day = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDay); var currentDay = Object(_getISODay_index_js__WEBPACK_IMPORTED_MODULE_3__["default"])(date); var diff = day - currentDay; return Object(_addDays_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(date, diff); } /***/ }), /***/ "./node_modules/date-fns/esm/setISOWeek/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/esm/setISOWeek/index.js ***! \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return setISOWeek; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _getISOWeek_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../getISOWeek/index.js */ "./node_modules/date-fns/esm/getISOWeek/index.js"); /** * @name setISOWeek * @category ISO Week Helpers * @summary Set the ISO week to the given date. * * @description * Set the ISO week to the given date, saving the weekday number. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} isoWeek - the ISO week of the new date * @returns {Date} the new date with the ISO week set * @throws {TypeError} 2 arguments required * * @example * // Set the 53rd ISO week to 7 August 2004: * var result = setISOWeek(new Date(2004, 7, 7), 53) * //=> Sat Jan 01 2005 00:00:00 */ function setISOWeek(dirtyDate, dirtyISOWeek) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var isoWeek = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyISOWeek); var diff = Object(_getISOWeek_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(date) - isoWeek; date.setDate(date.getDate() - diff * 7); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/setISOWeekYear/index.js": /*!***********************************************************!*\ !*** ./node_modules/date-fns/esm/setISOWeekYear/index.js ***! \***********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return setISOWeekYear; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _startOfISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../startOfISOWeekYear/index.js */ "./node_modules/date-fns/esm/startOfISOWeekYear/index.js"); /* harmony import */ var _differenceInCalendarDays_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../differenceInCalendarDays/index.js */ "./node_modules/date-fns/esm/differenceInCalendarDays/index.js"); /** * @name setISOWeekYear * @category ISO Week-Numbering Year Helpers * @summary Set the ISO week-numbering year to the given date. * * @description * Set the ISO week-numbering year to the given date, * saving the week number and the weekday number. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * - The function was renamed from `setISOYear` to `setISOWeekYear`. * "ISO week year" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date). * This change makes the name consistent with * locale-dependent week-numbering year helpers, e.g., `setWeekYear`. * * @param {Date|Number} date - the date to be changed * @param {Number} isoWeekYear - the ISO week-numbering year of the new date * @returns {Date} the new date with the ISO week-numbering year set * @throws {TypeError} 2 arguments required * * @example * // Set ISO week-numbering year 2007 to 29 December 2008: * var result = setISOWeekYear(new Date(2008, 11, 29), 2007) * //=> Mon Jan 01 2007 00:00:00 */ function setISOWeekYear(dirtyDate, dirtyISOWeekYear) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var isoWeekYear = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyISOWeekYear); var diff = Object(_differenceInCalendarDays_index_js__WEBPACK_IMPORTED_MODULE_3__["default"])(date, Object(_startOfISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(date)); var fourthOfJanuary = new Date(0); fourthOfJanuary.setFullYear(isoWeekYear, 0, 4); fourthOfJanuary.setHours(0, 0, 0, 0); date = Object(_startOfISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(fourthOfJanuary); date.setDate(date.getDate() + diff); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/setMilliseconds/index.js": /*!************************************************************!*\ !*** ./node_modules/date-fns/esm/setMilliseconds/index.js ***! \************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return setMilliseconds; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name setMilliseconds * @category Millisecond Helpers * @summary Set the milliseconds to the given date. * * @description * Set the milliseconds to the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} milliseconds - the milliseconds of the new date * @returns {Date} the new date with the milliseconds set * @throws {TypeError} 2 arguments required * * @example * // Set 300 milliseconds to 1 September 2014 11:30:40.500: * var result = setMilliseconds(new Date(2014, 8, 1, 11, 30, 40, 500), 300) * //=> Mon Sep 01 2014 11:30:40.300 */ function setMilliseconds(dirtyDate, dirtyMilliseconds) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var milliseconds = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyMilliseconds); date.setMilliseconds(milliseconds); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/setMinutes/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/esm/setMinutes/index.js ***! \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return setMinutes; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name setMinutes * @category Minute Helpers * @summary Set the minutes to the given date. * * @description * Set the minutes to the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} minutes - the minutes of the new date * @returns {Date} the new date with the minutes set * @throws {TypeError} 2 arguments required * * @example * // Set 45 minutes to 1 September 2014 11:30:40: * var result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45) * //=> Mon Sep 01 2014 11:45:40 */ function setMinutes(dirtyDate, dirtyMinutes) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var minutes = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyMinutes); date.setMinutes(minutes); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/setMonth/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/esm/setMonth/index.js ***! \*****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return setMonth; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _getDaysInMonth_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../getDaysInMonth/index.js */ "./node_modules/date-fns/esm/getDaysInMonth/index.js"); /** * @name setMonth * @category Month Helpers * @summary Set the month to the given date. * * @description * Set the month to the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} month - the month of the new date * @returns {Date} the new date with the month set * @throws {TypeError} 2 arguments required * * @example * // Set February to 1 September 2014: * var result = setMonth(new Date(2014, 8, 1), 1) * //=> Sat Feb 01 2014 00:00:00 */ function setMonth(dirtyDate, dirtyMonth) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var month = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyMonth); var year = date.getFullYear(); var day = date.getDate(); var dateWithDesiredMonth = new Date(0); dateWithDesiredMonth.setFullYear(year, month, 15); dateWithDesiredMonth.setHours(0, 0, 0, 0); var daysInMonth = Object(_getDaysInMonth_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(dateWithDesiredMonth); // Set the last day of the new month // if the original date was the last day of the longer month date.setMonth(month, Math.min(day, daysInMonth)); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/setQuarter/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/esm/setQuarter/index.js ***! \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return setQuarter; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _setMonth_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../setMonth/index.js */ "./node_modules/date-fns/esm/setMonth/index.js"); /** * @name setQuarter * @category Quarter Helpers * @summary Set the year quarter to the given date. * * @description * Set the year quarter to the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} quarter - the quarter of the new date * @returns {Date} the new date with the quarter set * @throws {TypeError} 2 arguments required * * @example * // Set the 2nd quarter to 2 July 2014: * var result = setQuarter(new Date(2014, 6, 2), 2) * //=> Wed Apr 02 2014 00:00:00 */ function setQuarter(dirtyDate, dirtyQuarter) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var quarter = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyQuarter); var oldQuarter = Math.floor(date.getMonth() / 3) + 1; var diff = quarter - oldQuarter; return Object(_setMonth_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(date, date.getMonth() + diff * 3); } /***/ }), /***/ "./node_modules/date-fns/esm/setSeconds/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/esm/setSeconds/index.js ***! \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return setSeconds; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name setSeconds * @category Second Helpers * @summary Set the seconds to the given date. * * @description * Set the seconds to the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} seconds - the seconds of the new date * @returns {Date} the new date with the seconds set * @throws {TypeError} 2 arguments required * * @example * // Set 45 seconds to 1 September 2014 11:30:40: * var result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45) * //=> Mon Sep 01 2014 11:30:45 */ function setSeconds(dirtyDate, dirtySeconds) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var seconds = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtySeconds); date.setSeconds(seconds); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/setWeek/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/esm/setWeek/index.js ***! \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return setWeek; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _getWeek_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../getWeek/index.js */ "./node_modules/date-fns/esm/getWeek/index.js"); /** * @name setWeek * @category Week Helpers * @summary Set the local week to the given date. * * @description * Set the local week to the given date, saving the weekday number. * The exact calculation depends on the values of * `options.weekStartsOn` (which is the index of the first day of the week) * and `options.firstWeekContainsDate` (which is the day of January, which is always in * the first week of the week-numbering year) * * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} week - the week of the new date * @param {Object} [options] - an object with options. * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year * @returns {Date} the new date with the local week set * @throws {TypeError} 2 arguments required * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7 * * @example * // Set the 1st week to 2 January 2005 with default options: * var result = setWeek(new Date(2005, 0, 2), 1) * //=> Sun Dec 26 2004 00:00:00 * * @example * // Set the 1st week to 2 January 2005, * // if Monday is the first day of the week, * // and the first week of the year always contains 4 January: * var result = setWeek(new Date(2005, 0, 2), 1, { * weekStartsOn: 1, * firstWeekContainsDate: 4 * }) * //=> Sun Jan 4 2004 00:00:00 */ function setWeek(dirtyDate, dirtyWeek, dirtyOptions) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var week = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyWeek); var diff = Object(_getWeek_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(date, dirtyOptions) - week; date.setDate(date.getDate() - diff * 7); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/setWeekYear/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/esm/setWeekYear/index.js ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return setWeekYear; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /* harmony import */ var _startOfWeekYear_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../startOfWeekYear/index.js */ "./node_modules/date-fns/esm/startOfWeekYear/index.js"); /* harmony import */ var _differenceInCalendarDays_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../differenceInCalendarDays/index.js */ "./node_modules/date-fns/esm/differenceInCalendarDays/index.js"); /** * @name setWeekYear * @category Week-Numbering Year Helpers * @summary Set the local week-numbering year to the given date. * * @description * Set the local week-numbering year to the given date, * saving the week number and the weekday number. * The exact calculation depends on the values of * `options.weekStartsOn` (which is the index of the first day of the week) * and `options.firstWeekContainsDate` (which is the day of January, which is always in * the first week of the week-numbering year) * * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} weekYear - the local week-numbering year of the new date * @param {Object} [options] - an object with options. * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year * @returns {Date} the new date with the local week-numbering year set * @throws {TypeError} 2 arguments required * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7 * * @example * // Set the local week-numbering year 2004 to 2 January 2010 with default options: * var result = setWeekYear(new Date(2010, 0, 2), 2004) * //=> Sat Jan 03 2004 00:00:00 * * @example * // Set the local week-numbering year 2004 to 2 January 2010, * // if Monday is the first day of week * // and 4 January is always in the first week of the year: * var result = setWeekYear(new Date(2010, 0, 2), 2004, { * weekStartsOn: 1, * firstWeekContainsDate: 4 * }) * //=> Sat Jan 01 2005 00:00:00 */ function setWeekYear(dirtyDate, dirtyWeekYear, dirtyOptions) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var options = dirtyOptions || {}; var locale = options.locale; var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate; var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(localeFirstWeekContainsDate); var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options.firstWeekContainsDate); var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var weekYear = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyWeekYear); var diff = Object(_differenceInCalendarDays_index_js__WEBPACK_IMPORTED_MODULE_3__["default"])(date, Object(_startOfWeekYear_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(date, dirtyOptions)); var firstWeek = new Date(0); firstWeek.setFullYear(weekYear, 0, firstWeekContainsDate); firstWeek.setHours(0, 0, 0, 0); date = Object(_startOfWeekYear_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(firstWeek, dirtyOptions); date.setDate(date.getDate() + diff); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/setYear/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/esm/setYear/index.js ***! \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return setYear; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name setYear * @category Year Helpers * @summary Set the year to the given date. * * @description * Set the year to the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} year - the year of the new date * @returns {Date} the new date with the year set * @throws {TypeError} 2 arguments required * * @example * // Set year 2013 to 1 September 2014: * var result = setYear(new Date(2014, 8, 1), 2013) * //=> Sun Sep 01 2013 00:00:00 */ function setYear(dirtyDate, dirtyYear) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var year = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyYear); // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date if (isNaN(date)) { return new Date(NaN); } date.setFullYear(year); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/startOfDay/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/esm/startOfDay/index.js ***! \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return startOfDay; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name startOfDay * @category Day Helpers * @summary Return the start of a day for the given date. * * @description * Return the start of a day for the given date. * The result will be in the local timezone. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @returns {Date} the start of a day * @throws {TypeError} 1 argument required * * @example * // The start of a day for 2 September 2014 11:55:00: * var result = startOfDay(new Date(2014, 8, 2, 11, 55, 0)) * //=> Tue Sep 02 2014 00:00:00 */ function startOfDay(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); date.setHours(0, 0, 0, 0); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/startOfDecade/index.js": /*!**********************************************************!*\ !*** ./node_modules/date-fns/esm/startOfDecade/index.js ***! \**********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return startOfDecade; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name startOfDecade * @category Decade Helpers * @summary Return the start of a decade for the given date. * * @description * Return the start of a decade for the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @returns {Date} the start of a decade * @throws {TypeError} 1 argument required * * @example * // The start of a decade for 21 October 2015 00:00:00: * var result = startOfDecade(new Date(2015, 9, 21, 00, 00, 00)) * //=> Jan 01 2010 00:00:00 */ function startOfDecade(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var year = date.getFullYear(); var decade = Math.floor(year / 10) * 10; date.setFullYear(decade, 0, 1); date.setHours(0, 0, 0, 0); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/startOfHour/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/esm/startOfHour/index.js ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return startOfHour; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name startOfHour * @category Hour Helpers * @summary Return the start of an hour for the given date. * * @description * Return the start of an hour for the given date. * The result will be in the local timezone. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @returns {Date} the start of an hour * @throws {TypeError} 1 argument required * * @example * // The start of an hour for 2 September 2014 11:55:00: * var result = startOfHour(new Date(2014, 8, 2, 11, 55)) * //=> Tue Sep 02 2014 11:00:00 */ function startOfHour(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); date.setMinutes(0, 0, 0); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/startOfISOWeek/index.js": /*!***********************************************************!*\ !*** ./node_modules/date-fns/esm/startOfISOWeek/index.js ***! \***********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return startOfISOWeek; }); /* harmony import */ var _startOfWeek_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../startOfWeek/index.js */ "./node_modules/date-fns/esm/startOfWeek/index.js"); /** * @name startOfISOWeek * @category ISO Week Helpers * @summary Return the start of an ISO week for the given date. * * @description * Return the start of an ISO week for the given date. * The result will be in the local timezone. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @returns {Date} the start of an ISO week * @throws {TypeError} 1 argument required * * @example * // The start of an ISO week for 2 September 2014 11:55:00: * var result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0)) * //=> Mon Sep 01 2014 00:00:00 */ function startOfISOWeek(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } return Object(_startOfWeek_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate, { weekStartsOn: 1 }); } /***/ }), /***/ "./node_modules/date-fns/esm/startOfISOWeekYear/index.js": /*!***************************************************************!*\ !*** ./node_modules/date-fns/esm/startOfISOWeekYear/index.js ***! \***************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return startOfISOWeekYear; }); /* harmony import */ var _getISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../getISOWeekYear/index.js */ "./node_modules/date-fns/esm/getISOWeekYear/index.js"); /* harmony import */ var _startOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../startOfISOWeek/index.js */ "./node_modules/date-fns/esm/startOfISOWeek/index.js"); /** * @name startOfISOWeekYear * @category ISO Week-Numbering Year Helpers * @summary Return the start of an ISO week-numbering year for the given date. * * @description * Return the start of an ISO week-numbering year, * which always starts 3 days before the year's first Thursday. * The result will be in the local timezone. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @returns {Date} the start of an ISO week-numbering year * @throws {TypeError} 1 argument required * * @example * // The start of an ISO week-numbering year for 2 July 2005: * var result = startOfISOWeekYear(new Date(2005, 6, 2)) * //=> Mon Jan 03 2005 00:00:00 */ function startOfISOWeekYear(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var year = Object(_getISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var fourthOfJanuary = new Date(0); fourthOfJanuary.setFullYear(year, 0, 4); fourthOfJanuary.setHours(0, 0, 0, 0); var date = Object(_startOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(fourthOfJanuary); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/startOfMinute/index.js": /*!**********************************************************!*\ !*** ./node_modules/date-fns/esm/startOfMinute/index.js ***! \**********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return startOfMinute; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name startOfMinute * @category Minute Helpers * @summary Return the start of a minute for the given date. * * @description * Return the start of a minute for the given date. * The result will be in the local timezone. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @returns {Date} the start of a minute * @throws {TypeError} 1 argument required * * @example * // The start of a minute for 1 December 2014 22:15:45.400: * var result = startOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400)) * //=> Mon Dec 01 2014 22:15:00 */ function startOfMinute(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); date.setSeconds(0, 0); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/startOfMonth/index.js": /*!*********************************************************!*\ !*** ./node_modules/date-fns/esm/startOfMonth/index.js ***! \*********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return startOfMonth; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name startOfMonth * @category Month Helpers * @summary Return the start of a month for the given date. * * @description * Return the start of a month for the given date. * The result will be in the local timezone. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @returns {Date} the start of a month * @throws {TypeError} 1 argument required * * @example * // The start of a month for 2 September 2014 11:55:00: * var result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0)) * //=> Mon Sep 01 2014 00:00:00 */ function startOfMonth(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); date.setDate(1); date.setHours(0, 0, 0, 0); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/startOfQuarter/index.js": /*!***********************************************************!*\ !*** ./node_modules/date-fns/esm/startOfQuarter/index.js ***! \***********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return startOfQuarter; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name startOfQuarter * @category Quarter Helpers * @summary Return the start of a year quarter for the given date. * * @description * Return the start of a year quarter for the given date. * The result will be in the local timezone. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @returns {Date} the start of a quarter * @throws {TypeError} 1 argument required * * @example * // The start of a quarter for 2 September 2014 11:55:00: * var result = startOfQuarter(new Date(2014, 8, 2, 11, 55, 0)) * //=> Tue Jul 01 2014 00:00:00 */ function startOfQuarter(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var currentMonth = date.getMonth(); var month = currentMonth - currentMonth % 3; date.setMonth(month, 1); date.setHours(0, 0, 0, 0); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/startOfSecond/index.js": /*!**********************************************************!*\ !*** ./node_modules/date-fns/esm/startOfSecond/index.js ***! \**********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return startOfSecond; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name startOfSecond * @category Second Helpers * @summary Return the start of a second for the given date. * * @description * Return the start of a second for the given date. * The result will be in the local timezone. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @returns {Date} the start of a second * @throws {TypeError} 1 argument required * * @example * // The start of a second for 1 December 2014 22:15:45.400: * var result = startOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400)) * //=> Mon Dec 01 2014 22:15:45.000 */ function startOfSecond(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); date.setMilliseconds(0); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/startOfWeek/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/esm/startOfWeek/index.js ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return startOfWeek; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name startOfWeek * @category Week Helpers * @summary Return the start of a week for the given date. * * @description * Return the start of a week for the given date. * The result will be in the local timezone. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @param {Object} [options] - an object with options. * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} * @returns {Date} the start of a week * @throws {TypeError} 1 argument required * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 * * @example * // The start of a week for 2 September 2014 11:55:00: * var result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0)) * //=> Sun Aug 31 2014 00:00:00 * * @example * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00: * var result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 }) * //=> Mon Sep 01 2014 00:00:00 */ function startOfWeek(dirtyDate, dirtyOptions) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var options = dirtyOptions || {}; var locale = options.locale; var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn; var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(localeWeekStartsOn); var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); } var date = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); var day = date.getDay(); var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; date.setDate(date.getDate() - diff); date.setHours(0, 0, 0, 0); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/startOfWeekYear/index.js": /*!************************************************************!*\ !*** ./node_modules/date-fns/esm/startOfWeekYear/index.js ***! \************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return startOfWeekYear; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _getWeekYear_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../getWeekYear/index.js */ "./node_modules/date-fns/esm/getWeekYear/index.js"); /* harmony import */ var _startOfWeek_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../startOfWeek/index.js */ "./node_modules/date-fns/esm/startOfWeek/index.js"); /** * @name startOfWeekYear * @category Week-Numbering Year Helpers * @summary Return the start of a local week-numbering year for the given date. * * @description * Return the start of a local week-numbering year. * The exact calculation depends on the values of * `options.weekStartsOn` (which is the index of the first day of the week) * and `options.firstWeekContainsDate` (which is the day of January, which is always in * the first week of the week-numbering year) * * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @param {Object} [options] - an object with options. * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year * @returns {Date} the start of a week-numbering year * @throws {TypeError} 1 argument required * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7 * * @example * // The start of an a week-numbering year for 2 July 2005 with default settings: * var result = startOfWeekYear(new Date(2005, 6, 2)) * //=> Sun Dec 26 2004 00:00:00 * * @example * // The start of a week-numbering year for 2 July 2005 * // if Monday is the first day of week * // and 4 January is always in the first week of the year: * var result = startOfWeekYear(new Date(2005, 6, 2), { * weekStartsOn: 1, * firstWeekContainsDate: 4 * }) * //=> Mon Jan 03 2005 00:00:00 */ function startOfWeekYear(dirtyDate, dirtyOptions) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var options = dirtyOptions || {}; var locale = options.locale; var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate; var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(localeFirstWeekContainsDate); var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options.firstWeekContainsDate); var year = Object(_getWeekYear_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate, dirtyOptions); var firstWeek = new Date(0); firstWeek.setFullYear(year, 0, firstWeekContainsDate); firstWeek.setHours(0, 0, 0, 0); var date = Object(_startOfWeek_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(firstWeek, dirtyOptions); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/startOfYear/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/esm/startOfYear/index.js ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return startOfYear; }); /* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate/index.js */ "./node_modules/date-fns/esm/toDate/index.js"); /** * @name startOfYear * @category Year Helpers * @summary Return the start of a year for the given date. * * @description * Return the start of a year for the given date. * The result will be in the local timezone. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the original date * @returns {Date} the start of a year * @throws {TypeError} 1 argument required * * @example * // The start of a year for 2 September 2014 11:55:00: * var result = startOfYear(new Date(2014, 8, 2, 11, 55, 00)) * //=> Wed Jan 01 2014 00:00:00 */ function startOfYear(dirtyDate) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var cleanDate = Object(_toDate_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyDate); var date = new Date(0); date.setFullYear(cleanDate.getFullYear(), 0, 1); date.setHours(0, 0, 0, 0); return date; } /***/ }), /***/ "./node_modules/date-fns/esm/subDays/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/esm/subDays/index.js ***! \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return subDays; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _addDays_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../addDays/index.js */ "./node_modules/date-fns/esm/addDays/index.js"); /** * @name subDays * @category Day Helpers * @summary Subtract the specified number of days from the given date. * * @description * Subtract the specified number of days from the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} amount - the amount of days to be subtracted * @returns {Date} the new date with the days subtracted * @throws {TypeError} 2 arguments required * * @example * // Subtract 10 days from 1 September 2014: * var result = subDays(new Date(2014, 8, 1), 10) * //=> Fri Aug 22 2014 00:00:00 */ function subDays(dirtyDate, dirtyAmount) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var amount = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyAmount); return Object(_addDays_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate, -amount); } /***/ }), /***/ "./node_modules/date-fns/esm/subHours/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/esm/subHours/index.js ***! \*****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return subHours; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _addHours_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../addHours/index.js */ "./node_modules/date-fns/esm/addHours/index.js"); /** * @name subHours * @category Hour Helpers * @summary Subtract the specified number of hours from the given date. * * @description * Subtract the specified number of hours from the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} amount - the amount of hours to be subtracted * @returns {Date} the new date with the hours subtracted * @throws {TypeError} 2 arguments required * * @example * // Subtract 2 hours from 11 July 2014 01:00:00: * var result = subHours(new Date(2014, 6, 11, 1, 0), 2) * //=> Thu Jul 10 2014 23:00:00 */ function subHours(dirtyDate, dirtyAmount) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var amount = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyAmount); return Object(_addHours_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate, -amount); } /***/ }), /***/ "./node_modules/date-fns/esm/subISOWeekYears/index.js": /*!************************************************************!*\ !*** ./node_modules/date-fns/esm/subISOWeekYears/index.js ***! \************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return subISOWeekYears; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _addISOWeekYears_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../addISOWeekYears/index.js */ "./node_modules/date-fns/esm/addISOWeekYears/index.js"); /** * @name subISOWeekYears * @category ISO Week-Numbering Year Helpers * @summary Subtract the specified number of ISO week-numbering years from the given date. * * @description * Subtract the specified number of ISO week-numbering years from the given date. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * - The function was renamed from `subISOYears` to `subISOWeekYears`. * "ISO week year" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date). * This change makes the name consistent with * locale-dependent week-numbering year helpers, e.g., `setWeekYear`. * * @param {Date|Number} date - the date to be changed * @param {Number} amount - the amount of ISO week-numbering years to be subtracted * @returns {Date} the new date with the ISO week-numbering years subtracted * @throws {TypeError} 2 arguments required * * @example * // Subtract 5 ISO week-numbering years from 1 September 2014: * var result = subISOWeekYears(new Date(2014, 8, 1), 5) * //=> Mon Aug 31 2009 00:00:00 */ function subISOWeekYears(dirtyDate, dirtyAmount) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var amount = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyAmount); return Object(_addISOWeekYears_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate, -amount); } /***/ }), /***/ "./node_modules/date-fns/esm/subMilliseconds/index.js": /*!************************************************************!*\ !*** ./node_modules/date-fns/esm/subMilliseconds/index.js ***! \************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return subMilliseconds; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _addMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../addMilliseconds/index.js */ "./node_modules/date-fns/esm/addMilliseconds/index.js"); /** * @name subMilliseconds * @category Millisecond Helpers * @summary Subtract the specified number of milliseconds from the given date. * * @description * Subtract the specified number of milliseconds from the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} amount - the amount of milliseconds to be subtracted * @returns {Date} the new date with the milliseconds subtracted * @throws {TypeError} 2 arguments required * * @example * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000: * var result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750) * //=> Thu Jul 10 2014 12:45:29.250 */ function subMilliseconds(dirtyDate, dirtyAmount) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var amount = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyAmount); return Object(_addMilliseconds_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate, -amount); } /***/ }), /***/ "./node_modules/date-fns/esm/subMinutes/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/esm/subMinutes/index.js ***! \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return subMinutes; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _addMinutes_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../addMinutes/index.js */ "./node_modules/date-fns/esm/addMinutes/index.js"); /** * @name subMinutes * @category Minute Helpers * @summary Subtract the specified number of minutes from the given date. * * @description * Subtract the specified number of minutes from the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} amount - the amount of minutes to be subtracted * @returns {Date} the new date with the minutes subtracted * @throws {TypeError} 2 arguments required * * @example * // Subtract 30 minutes from 10 July 2014 12:00:00: * var result = subMinutes(new Date(2014, 6, 10, 12, 0), 30) * //=> Thu Jul 10 2014 11:30:00 */ function subMinutes(dirtyDate, dirtyAmount) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var amount = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyAmount); return Object(_addMinutes_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate, -amount); } /***/ }), /***/ "./node_modules/date-fns/esm/subMonths/index.js": /*!******************************************************!*\ !*** ./node_modules/date-fns/esm/subMonths/index.js ***! \******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return subMonths; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _addMonths_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../addMonths/index.js */ "./node_modules/date-fns/esm/addMonths/index.js"); /** * @name subMonths * @category Month Helpers * @summary Subtract the specified number of months from the given date. * * @description * Subtract the specified number of months from the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} amount - the amount of months to be subtracted * @returns {Date} the new date with the months subtracted * @throws {TypeError} 2 arguments required * * @example * // Subtract 5 months from 1 February 2015: * var result = subMonths(new Date(2015, 1, 1), 5) * //=> Mon Sep 01 2014 00:00:00 */ function subMonths(dirtyDate, dirtyAmount) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var amount = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyAmount); return Object(_addMonths_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate, -amount); } /***/ }), /***/ "./node_modules/date-fns/esm/subQuarters/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/esm/subQuarters/index.js ***! \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return subQuarters; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _addQuarters_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../addQuarters/index.js */ "./node_modules/date-fns/esm/addQuarters/index.js"); /** * @name subQuarters * @category Quarter Helpers * @summary Subtract the specified number of year quarters from the given date. * * @description * Subtract the specified number of year quarters from the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} amount - the amount of quarters to be subtracted * @returns {Date} the new date with the quarters subtracted * @throws {TypeError} 2 arguments required * * @example * // Subtract 3 quarters from 1 September 2014: * var result = subQuarters(new Date(2014, 8, 1), 3) * //=> Sun Dec 01 2013 00:00:00 */ function subQuarters(dirtyDate, dirtyAmount) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var amount = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyAmount); return Object(_addQuarters_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate, -amount); } /***/ }), /***/ "./node_modules/date-fns/esm/subSeconds/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/esm/subSeconds/index.js ***! \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return subSeconds; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _addSeconds_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../addSeconds/index.js */ "./node_modules/date-fns/esm/addSeconds/index.js"); /** * @name subSeconds * @category Second Helpers * @summary Subtract the specified number of seconds from the given date. * * @description * Subtract the specified number of seconds from the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} amount - the amount of seconds to be subtracted * @returns {Date} the new date with the seconds subtracted * @throws {TypeError} 2 arguments required * * @example * // Subtract 30 seconds from 10 July 2014 12:45:00: * var result = subSeconds(new Date(2014, 6, 10, 12, 45, 0), 30) * //=> Thu Jul 10 2014 12:44:30 */ function subSeconds(dirtyDate, dirtyAmount) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var amount = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyAmount); return Object(_addSeconds_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate, -amount); } /***/ }), /***/ "./node_modules/date-fns/esm/subWeeks/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/esm/subWeeks/index.js ***! \*****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return subWeeks; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _addWeeks_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../addWeeks/index.js */ "./node_modules/date-fns/esm/addWeeks/index.js"); /** * @name subWeeks * @category Week Helpers * @summary Subtract the specified number of weeks from the given date. * * @description * Subtract the specified number of weeks from the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} amount - the amount of weeks to be subtracted * @returns {Date} the new date with the weeks subtracted * @throws {TypeError} 2 arguments required * * @example * // Subtract 4 weeks from 1 September 2014: * var result = subWeeks(new Date(2014, 8, 1), 4) * //=> Mon Aug 04 2014 00:00:00 */ function subWeeks(dirtyDate, dirtyAmount) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var amount = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyAmount); return Object(_addWeeks_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate, -amount); } /***/ }), /***/ "./node_modules/date-fns/esm/subYears/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/esm/subYears/index.js ***! \*****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return subYears; }); /* harmony import */ var _lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/toInteger/index.js */ "./node_modules/date-fns/esm/_lib/toInteger/index.js"); /* harmony import */ var _addYears_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../addYears/index.js */ "./node_modules/date-fns/esm/addYears/index.js"); /** * @name subYears * @category Year Helpers * @summary Subtract the specified number of years from the given date. * * @description * Subtract the specified number of years from the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} amount - the amount of years to be subtracted * @returns {Date} the new date with the years subtracted * @throws {TypeError} 2 arguments required * * @example * // Subtract 5 years from 1 September 2014: * var result = subYears(new Date(2014, 8, 1), 5) * //=> Tue Sep 01 2009 00:00:00 */ function subYears(dirtyDate, dirtyAmount) { if (arguments.length < 2) { throw new TypeError('2 arguments required, but only ' + arguments.length + ' present'); } var amount = Object(_lib_toInteger_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dirtyAmount); return Object(_addYears_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate, -amount); } /***/ }), /***/ "./node_modules/date-fns/esm/toDate/index.js": /*!***************************************************!*\ !*** ./node_modules/date-fns/esm/toDate/index.js ***! \***************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return toDate; }); /** * @name toDate * @category Common Helpers * @summary Convert the given argument to an instance of Date. * * @description * Convert the given argument to an instance of Date. * * If the argument is an instance of Date, the function returns its clone. * * If the argument is a number, it is treated as a timestamp. * * If the argument is none of the above, the function returns Invalid Date. * * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`. * * @param {Date|Number} argument - the value to convert * @returns {Date} the parsed date in the local time zone * @throws {TypeError} 1 argument required * * @example * // Clone the date: * var result = toDate(new Date(2014, 1, 11, 11, 30, 30)) * //=> Tue Feb 11 2014 11:30:30 * * @example * // Convert the timestamp to date: * var result = toDate(1392098430000) * //=> Tue Feb 11 2014 11:30:30 */ function toDate(argument) { if (arguments.length < 1) { throw new TypeError('1 argument required, but only ' + arguments.length + ' present'); } var argStr = Object.prototype.toString.call(argument); // Clone the date if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') { // Prevent the date to lose the milliseconds when passed to new Date() in IE10 return new Date(argument.getTime()); } else if (typeof argument === 'number' || argStr === '[object Number]') { return new Date(argument); } else { if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') { console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as arguments. Please use `parseISO` to parse strings. See: https://git.io/fpAk2"); console.warn(new Error().stack); } return new Date(NaN); } } /***/ }), /***/ "./node_modules/deep-equal/index.js": /*!******************************************!*\ !*** ./node_modules/deep-equal/index.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var objectKeys = __webpack_require__(/*! object-keys */ "./node_modules/object-keys/index.js"); var isArguments = __webpack_require__(/*! is-arguments */ "./node_modules/is-arguments/index.js"); var is = __webpack_require__(/*! object-is */ "./node_modules/object-is/index.js"); var isRegex = __webpack_require__(/*! is-regex */ "./node_modules/is-regex/index.js"); var flags = __webpack_require__(/*! regexp.prototype.flags */ "./node_modules/regexp.prototype.flags/index.js"); var isArray = __webpack_require__(/*! isarray */ "./node_modules/deep-equal/node_modules/isarray/index.js"); var isDate = __webpack_require__(/*! is-date-object */ "./node_modules/is-date-object/index.js"); var whichBoxedPrimitive = __webpack_require__(/*! which-boxed-primitive */ "./node_modules/which-boxed-primitive/index.js"); var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var callBound = __webpack_require__(/*! call-bind/callBound */ "./node_modules/call-bind/callBound.js"); var whichCollection = __webpack_require__(/*! which-collection */ "./node_modules/which-collection/index.js"); var getIterator = __webpack_require__(/*! es-get-iterator */ "./node_modules/es-get-iterator/index.js"); var getSideChannel = __webpack_require__(/*! side-channel */ "./node_modules/side-channel/index.js"); var whichTypedArray = __webpack_require__(/*! which-typed-array */ "./node_modules/which-typed-array/index.js"); var assign = __webpack_require__(/*! object.assign */ "./node_modules/object.assign/index.js"); var $getTime = callBound('Date.prototype.getTime'); var gPO = Object.getPrototypeOf; var $objToString = callBound('Object.prototype.toString'); var $Set = GetIntrinsic('%Set%', true); var $mapHas = callBound('Map.prototype.has', true); var $mapGet = callBound('Map.prototype.get', true); var $mapSize = callBound('Map.prototype.size', true); var $setAdd = callBound('Set.prototype.add', true); var $setDelete = callBound('Set.prototype.delete', true); var $setHas = callBound('Set.prototype.has', true); var $setSize = callBound('Set.prototype.size', true); // taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L401-L414 function setHasEqualElement(set, val1, opts, channel) { var i = getIterator(set); var result; while ((result = i.next()) && !result.done) { if (internalDeepEqual(val1, result.value, opts, channel)) { // eslint-disable-line no-use-before-define // Remove the matching element to make sure we do not check that again. $setDelete(set, result.value); return true; } } return false; } // taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L416-L439 function findLooseMatchingPrimitives(prim) { if (typeof prim === 'undefined') { return null; } if (typeof prim === 'object') { // Only pass in null as object! return void 0; } if (typeof prim === 'symbol') { return false; } if (typeof prim === 'string' || typeof prim === 'number') { // Loose equal entries exist only if the string is possible to convert to a regular number and not NaN. return +prim === +prim; // eslint-disable-line no-implicit-coercion } return true; } // taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L449-L460 function mapMightHaveLoosePrim(a, b, prim, item, opts, channel) { var altValue = findLooseMatchingPrimitives(prim); if (altValue != null) { return altValue; } var curB = $mapGet(b, altValue); var looseOpts = assign({}, opts, { strict: false }); if (typeof curB === 'undefined' && !$mapHas(b, altValue) // eslint-disable-next-line no-use-before-define || !internalDeepEqual(item, curB, looseOpts, channel)) { return false; } // eslint-disable-next-line no-use-before-define return !$mapHas(a, altValue) && internalDeepEqual(item, curB, looseOpts, channel); } // taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L441-L447 function setMightHaveLoosePrim(a, b, prim) { var altValue = findLooseMatchingPrimitives(prim); if (altValue != null) { return altValue; } return $setHas(b, altValue) && !$setHas(a, altValue); } // taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L518-L533 function mapHasEqualEntry(set, map, key1, item1, opts, channel) { var i = getIterator(set); var result; var key2; while ((result = i.next()) && !result.done) { key2 = result.value; if ( // eslint-disable-next-line no-use-before-define internalDeepEqual(key1, key2, opts, channel) // eslint-disable-next-line no-use-before-define && internalDeepEqual(item1, $mapGet(map, key2), opts, channel)) { $setDelete(set, key2); return true; } } return false; } function internalDeepEqual(actual, expected, options, channel) { var opts = options || {}; // 7.1. All identical values are equivalent, as determined by ===. if (opts.strict ? is(actual, expected) : actual === expected) { return true; } var actualBoxed = whichBoxedPrimitive(actual); var expectedBoxed = whichBoxedPrimitive(expected); if (actualBoxed !== expectedBoxed) { return false; } // 7.3. Other pairs that do not both pass typeof value == 'object', equivalence is determined by ==. if (!actual || !expected || typeof actual !== 'object' && typeof expected !== 'object') { return opts.strict ? is(actual, expected) : actual == expected; // eslint-disable-line eqeqeq } /* * 7.4. For all other Object pairs, including Array objects, equivalence is * determined by having the same number of owned properties (as verified * with Object.prototype.hasOwnProperty.call), the same set of keys * (although not necessarily the same order), equivalent values for every * corresponding key, and an identical 'prototype' property. Note: this * accounts for both named and indexed properties on Arrays. */ // see https://github.com/nodejs/node/commit/d3aafd02efd3a403d646a3044adcf14e63a88d32 for memos/channel inspiration var hasActual = channel.has(actual); var hasExpected = channel.has(expected); var sentinel; if (hasActual && hasExpected) { if (channel.get(actual) === channel.get(expected)) { return true; } } else { sentinel = {}; } if (!hasActual) { channel.set(actual, sentinel); } if (!hasExpected) { channel.set(expected, sentinel); } // eslint-disable-next-line no-use-before-define return objEquiv(actual, expected, opts, channel); } function isBuffer(x) { if (!x || typeof x !== 'object' || typeof x.length !== 'number') { return false; } if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { return false; } if (x.length > 0 && typeof x[0] !== 'number') { return false; } return !!(x.constructor && x.constructor.isBuffer && x.constructor.isBuffer(x)); } function setEquiv(a, b, opts, channel) { if ($setSize(a) !== $setSize(b)) { return false; } var iA = getIterator(a); var iB = getIterator(b); var resultA; var resultB; var set; while ((resultA = iA.next()) && !resultA.done) { if (resultA.value && typeof resultA.value === 'object') { if (!set) { set = new $Set(); } $setAdd(set, resultA.value); } else if (!$setHas(b, resultA.value)) { if (opts.strict) { return false; } if (!setMightHaveLoosePrim(a, b, resultA.value)) { return false; } if (!set) { set = new $Set(); } $setAdd(set, resultA.value); } } if (set) { while ((resultB = iB.next()) && !resultB.done) { // We have to check if a primitive value is already matching and only if it's not, go hunting for it. if (resultB.value && typeof resultB.value === 'object') { if (!setHasEqualElement(set, resultB.value, opts.strict, channel)) { return false; } } else if (!opts.strict && !$setHas(a, resultB.value) && !setHasEqualElement(set, resultB.value, opts.strict, channel)) { return false; } } return $setSize(set) === 0; } return true; } function mapEquiv(a, b, opts, channel) { if ($mapSize(a) !== $mapSize(b)) { return false; } var iA = getIterator(a); var iB = getIterator(b); var resultA; var resultB; var set; var key; var item1; var item2; while ((resultA = iA.next()) && !resultA.done) { key = resultA.value[0]; item1 = resultA.value[1]; if (key && typeof key === 'object') { if (!set) { set = new $Set(); } $setAdd(set, key); } else { item2 = $mapGet(b, key); if (typeof item2 === 'undefined' && !$mapHas(b, key) || !internalDeepEqual(item1, item2, opts, channel)) { if (opts.strict) { return false; } if (!mapMightHaveLoosePrim(a, b, key, item1, opts, channel)) { return false; } if (!set) { set = new $Set(); } $setAdd(set, key); } } } if (set) { while ((resultB = iB.next()) && !resultB.done) { key = resultB.value[0]; item2 = resultB.value[1]; if (key && typeof key === 'object') { if (!mapHasEqualEntry(set, a, key, item2, opts, channel)) { return false; } } else if (!opts.strict && (!a.has(key) || !internalDeepEqual($mapGet(a, key), item2, opts, channel)) && !mapHasEqualEntry(set, a, key, item2, assign({}, opts, { strict: false }), channel)) { return false; } } return $setSize(set) === 0; } return true; } function objEquiv(a, b, opts, channel) { /* eslint max-statements: [2, 100], max-lines-per-function: [2, 120], max-depth: [2, 5] */ var i, key; if (typeof a !== typeof b) { return false; } if (a == null || b == null) { return false; } if ($objToString(a) !== $objToString(b)) { return false; } if (isArguments(a) !== isArguments(b)) { return false; } var aIsArray = isArray(a); var bIsArray = isArray(b); if (aIsArray !== bIsArray) { return false; } // TODO: replace when a cross-realm brand check is available var aIsError = a instanceof Error; var bIsError = b instanceof Error; if (aIsError !== bIsError) { return false; } if (aIsError || bIsError) { if (a.name !== b.name || a.message !== b.message) { return false; } } var aIsRegex = isRegex(a); var bIsRegex = isRegex(b); if (aIsRegex !== bIsRegex) { return false; } if ((aIsRegex || bIsRegex) && (a.source !== b.source || flags(a) !== flags(b))) { return false; } var aIsDate = isDate(a); var bIsDate = isDate(b); if (aIsDate !== bIsDate) { return false; } if (aIsDate || bIsDate) { // && would work too, because both are true or both false here if ($getTime(a) !== $getTime(b)) { return false; } } if (opts.strict && gPO && gPO(a) !== gPO(b)) { return false; } if (whichTypedArray(a) !== whichTypedArray(b)) { return false; } var aIsBuffer = isBuffer(a); var bIsBuffer = isBuffer(b); if (aIsBuffer !== bIsBuffer) { return false; } if (aIsBuffer || bIsBuffer) { // && would work too, because both are true or both false here if (a.length !== b.length) { return false; } for (i = 0; i < a.length; i++) { if (a[i] !== b[i]) { return false; } } return true; } if (typeof a !== typeof b) { return false; } var ka = objectKeys(a); var kb = objectKeys(b); // having the same number of owned properties (keys incorporates hasOwnProperty) if (ka.length !== kb.length) { return false; } // the same set of keys (although not necessarily the same order), ka.sort(); kb.sort(); // ~~~cheap key test for (i = ka.length - 1; i >= 0; i--) { if (ka[i] != kb[i]) { return false; } // eslint-disable-line eqeqeq } // equivalent values for every corresponding key, and ~~~possibly expensive deep test for (i = ka.length - 1; i >= 0; i--) { key = ka[i]; if (!internalDeepEqual(a[key], b[key], opts, channel)) { return false; } } var aCollection = whichCollection(a); var bCollection = whichCollection(b); if (aCollection !== bCollection) { return false; } if (aCollection === 'Set' || bCollection === 'Set') { // aCollection === bCollection return setEquiv(a, b, opts, channel); } if (aCollection === 'Map') { // aCollection === bCollection return mapEquiv(a, b, opts, channel); } return true; } module.exports = function deepEqual(a, b, opts) { return internalDeepEqual(a, b, opts, getSideChannel()); }; /***/ }), /***/ "./node_modules/deep-equal/node_modules/isarray/index.js": /*!***************************************************************!*\ !*** ./node_modules/deep-equal/node_modules/isarray/index.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { var toString = {}.toString; module.exports = Array.isArray || function (arr) { return toString.call(arr) == '[object Array]'; }; /***/ }), /***/ "./node_modules/define-properties/index.js": /*!*************************************************!*\ !*** ./node_modules/define-properties/index.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var keys = __webpack_require__(/*! object-keys */ "./node_modules/object-keys/index.js"); var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; var toStr = Object.prototype.toString; var concat = Array.prototype.concat; var origDefineProperty = Object.defineProperty; var isFunction = function (fn) { return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; }; var arePropertyDescriptorsSupported = function () { var obj = {}; try { origDefineProperty(obj, 'x', { enumerable: false, value: obj }); // eslint-disable-next-line no-unused-vars, no-restricted-syntax for (var _ in obj) { // jscs:ignore disallowUnusedVariables return false; } return obj.x === obj; } catch (e) { /* this is IE 8. */ return false; } }; var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported(); var defineProperty = function (object, name, value, predicate) { if (name in object && (!isFunction(predicate) || !predicate())) { return; } if (supportsDescriptors) { origDefineProperty(object, name, { configurable: true, enumerable: false, value: value, writable: true }); } else { object[name] = value; } }; var defineProperties = function (object, map) { var predicates = arguments.length > 2 ? arguments[2] : {}; var props = keys(map); if (hasSymbols) { props = concat.call(props, Object.getOwnPropertySymbols(map)); } for (var i = 0; i < props.length; i += 1) { defineProperty(object, props[i], map[props[i]], predicates[props[i]]); } }; defineProperties.supportsDescriptors = !!supportsDescriptors; module.exports = defineProperties; /***/ }), /***/ "./node_modules/es-abstract/2020/ArraySpeciesCreate.js": /*!*************************************************************!*\ !*** ./node_modules/es-abstract/2020/ArraySpeciesCreate.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var $Array = GetIntrinsic('%Array%'); var $species = GetIntrinsic('%Symbol.species%', true); var $TypeError = GetIntrinsic('%TypeError%'); var Get = __webpack_require__(/*! ./Get */ "./node_modules/es-abstract/2020/Get.js"); var IsArray = __webpack_require__(/*! ./IsArray */ "./node_modules/es-abstract/2020/IsArray.js"); var IsConstructor = __webpack_require__(/*! ./IsConstructor */ "./node_modules/es-abstract/2020/IsConstructor.js"); var IsInteger = __webpack_require__(/*! ./IsInteger */ "./node_modules/es-abstract/2020/IsInteger.js"); var Type = __webpack_require__(/*! ./Type */ "./node_modules/es-abstract/2020/Type.js"); // https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate module.exports = function ArraySpeciesCreate(originalArray, length) { if (!IsInteger(length) || length < 0) { throw new $TypeError('Assertion failed: length must be an integer >= 0'); } var len = length === 0 ? 0 : length; var C; var isArray = IsArray(originalArray); if (isArray) { C = Get(originalArray, 'constructor'); // TODO: figure out how to make a cross-realm normal Array, a same-realm Array // if (IsConstructor(C)) { // if C is another realm's Array, C = undefined // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? // } if ($species && Type(C) === 'Object') { C = Get(C, $species); if (C === null) { C = void 0; } } } if (typeof C === 'undefined') { return $Array(len); } if (!IsConstructor(C)) { throw new $TypeError('C must be a constructor'); } return new C(len); // Construct(C, len); }; /***/ }), /***/ "./node_modules/es-abstract/2020/Call.js": /*!***********************************************!*\ !*** ./node_modules/es-abstract/2020/Call.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var callBound = __webpack_require__(/*! call-bind/callBound */ "./node_modules/call-bind/callBound.js"); var $TypeError = GetIntrinsic('%TypeError%'); var IsArray = __webpack_require__(/*! ./IsArray */ "./node_modules/es-abstract/2020/IsArray.js"); var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); // https://ecma-international.org/ecma-262/6.0/#sec-call module.exports = function Call(F, V) { var argumentsList = arguments.length > 2 ? arguments[2] : []; if (!IsArray(argumentsList)) { throw new $TypeError('Assertion failed: optional `argumentsList`, if provided, must be a List'); } return $apply(F, V, argumentsList); }; /***/ }), /***/ "./node_modules/es-abstract/2020/CreateDataProperty.js": /*!*************************************************************!*\ !*** ./node_modules/es-abstract/2020/CreateDataProperty.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var $TypeError = GetIntrinsic('%TypeError%'); var DefineOwnProperty = __webpack_require__(/*! ../helpers/DefineOwnProperty */ "./node_modules/es-abstract/helpers/DefineOwnProperty.js"); var FromPropertyDescriptor = __webpack_require__(/*! ./FromPropertyDescriptor */ "./node_modules/es-abstract/2020/FromPropertyDescriptor.js"); var OrdinaryGetOwnProperty = __webpack_require__(/*! ./OrdinaryGetOwnProperty */ "./node_modules/es-abstract/2020/OrdinaryGetOwnProperty.js"); var IsDataDescriptor = __webpack_require__(/*! ./IsDataDescriptor */ "./node_modules/es-abstract/2020/IsDataDescriptor.js"); var IsExtensible = __webpack_require__(/*! ./IsExtensible */ "./node_modules/es-abstract/2020/IsExtensible.js"); var IsPropertyKey = __webpack_require__(/*! ./IsPropertyKey */ "./node_modules/es-abstract/2020/IsPropertyKey.js"); var SameValue = __webpack_require__(/*! ./SameValue */ "./node_modules/es-abstract/2020/SameValue.js"); var Type = __webpack_require__(/*! ./Type */ "./node_modules/es-abstract/2020/Type.js"); // https://ecma-international.org/ecma-262/6.0/#sec-createdataproperty module.exports = function CreateDataProperty(O, P, V) { if (Type(O) !== 'Object') { throw new $TypeError('Assertion failed: Type(O) is not Object'); } if (!IsPropertyKey(P)) { throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); } var oldDesc = OrdinaryGetOwnProperty(O, P); var extensible = !oldDesc || IsExtensible(O); var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']); if (immutable || !extensible) { return false; } return DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, { '[[Configurable]]': true, '[[Enumerable]]': true, '[[Value]]': V, '[[Writable]]': true }); }; /***/ }), /***/ "./node_modules/es-abstract/2020/CreateDataPropertyOrThrow.js": /*!********************************************************************!*\ !*** ./node_modules/es-abstract/2020/CreateDataPropertyOrThrow.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var $TypeError = GetIntrinsic('%TypeError%'); var CreateDataProperty = __webpack_require__(/*! ./CreateDataProperty */ "./node_modules/es-abstract/2020/CreateDataProperty.js"); var IsPropertyKey = __webpack_require__(/*! ./IsPropertyKey */ "./node_modules/es-abstract/2020/IsPropertyKey.js"); var Type = __webpack_require__(/*! ./Type */ "./node_modules/es-abstract/2020/Type.js"); // // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow module.exports = function CreateDataPropertyOrThrow(O, P, V) { if (Type(O) !== 'Object') { throw new $TypeError('Assertion failed: Type(O) is not Object'); } if (!IsPropertyKey(P)) { throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); } var success = CreateDataProperty(O, P, V); if (!success) { throw new $TypeError('unable to create data property'); } return success; }; /***/ }), /***/ "./node_modules/es-abstract/2020/DefinePropertyOrThrow.js": /*!****************************************************************!*\ !*** ./node_modules/es-abstract/2020/DefinePropertyOrThrow.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var $TypeError = GetIntrinsic('%TypeError%'); var isPropertyDescriptor = __webpack_require__(/*! ../helpers/isPropertyDescriptor */ "./node_modules/es-abstract/helpers/isPropertyDescriptor.js"); var DefineOwnProperty = __webpack_require__(/*! ../helpers/DefineOwnProperty */ "./node_modules/es-abstract/helpers/DefineOwnProperty.js"); var FromPropertyDescriptor = __webpack_require__(/*! ./FromPropertyDescriptor */ "./node_modules/es-abstract/2020/FromPropertyDescriptor.js"); var IsAccessorDescriptor = __webpack_require__(/*! ./IsAccessorDescriptor */ "./node_modules/es-abstract/2020/IsAccessorDescriptor.js"); var IsDataDescriptor = __webpack_require__(/*! ./IsDataDescriptor */ "./node_modules/es-abstract/2020/IsDataDescriptor.js"); var IsPropertyKey = __webpack_require__(/*! ./IsPropertyKey */ "./node_modules/es-abstract/2020/IsPropertyKey.js"); var SameValue = __webpack_require__(/*! ./SameValue */ "./node_modules/es-abstract/2020/SameValue.js"); var ToPropertyDescriptor = __webpack_require__(/*! ./ToPropertyDescriptor */ "./node_modules/es-abstract/2020/ToPropertyDescriptor.js"); var Type = __webpack_require__(/*! ./Type */ "./node_modules/es-abstract/2020/Type.js"); // https://ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow module.exports = function DefinePropertyOrThrow(O, P, desc) { if (Type(O) !== 'Object') { throw new $TypeError('Assertion failed: Type(O) is not Object'); } if (!IsPropertyKey(P)) { throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); } var Desc = isPropertyDescriptor({ Type: Type, IsDataDescriptor: IsDataDescriptor, IsAccessorDescriptor: IsAccessorDescriptor }, desc) ? desc : ToPropertyDescriptor(desc); if (!isPropertyDescriptor({ Type: Type, IsDataDescriptor: IsDataDescriptor, IsAccessorDescriptor: IsAccessorDescriptor }, Desc)) { throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); } return DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, Desc); }; /***/ }), /***/ "./node_modules/es-abstract/2020/FromPropertyDescriptor.js": /*!*****************************************************************!*\ !*** ./node_modules/es-abstract/2020/FromPropertyDescriptor.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var assertRecord = __webpack_require__(/*! ../helpers/assertRecord */ "./node_modules/es-abstract/helpers/assertRecord.js"); var Type = __webpack_require__(/*! ./Type */ "./node_modules/es-abstract/2020/Type.js"); // https://ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor module.exports = function FromPropertyDescriptor(Desc) { if (typeof Desc === 'undefined') { return Desc; } assertRecord(Type, 'Property Descriptor', 'Desc', Desc); var obj = {}; if ('[[Value]]' in Desc) { obj.value = Desc['[[Value]]']; } if ('[[Writable]]' in Desc) { obj.writable = Desc['[[Writable]]']; } if ('[[Get]]' in Desc) { obj.get = Desc['[[Get]]']; } if ('[[Set]]' in Desc) { obj.set = Desc['[[Set]]']; } if ('[[Enumerable]]' in Desc) { obj.enumerable = Desc['[[Enumerable]]']; } if ('[[Configurable]]' in Desc) { obj.configurable = Desc['[[Configurable]]']; } return obj; }; /***/ }), /***/ "./node_modules/es-abstract/2020/Get.js": /*!**********************************************!*\ !*** ./node_modules/es-abstract/2020/Get.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var $TypeError = GetIntrinsic('%TypeError%'); var inspect = __webpack_require__(/*! object-inspect */ "./node_modules/object-inspect/index.js"); var IsPropertyKey = __webpack_require__(/*! ./IsPropertyKey */ "./node_modules/es-abstract/2020/IsPropertyKey.js"); var Type = __webpack_require__(/*! ./Type */ "./node_modules/es-abstract/2020/Type.js"); /** * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p * 1. Assert: Type(O) is Object. * 2. Assert: IsPropertyKey(P) is true. * 3. Return O.[[Get]](P, O). */ module.exports = function Get(O, P) { // 7.3.1.1 if (Type(O) !== 'Object') { throw new $TypeError('Assertion failed: Type(O) is not Object'); } // 7.3.1.2 if (!IsPropertyKey(P)) { throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); } // 7.3.1.3 return O[P]; }; /***/ }), /***/ "./node_modules/es-abstract/2020/HasProperty.js": /*!******************************************************!*\ !*** ./node_modules/es-abstract/2020/HasProperty.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var $TypeError = GetIntrinsic('%TypeError%'); var IsPropertyKey = __webpack_require__(/*! ./IsPropertyKey */ "./node_modules/es-abstract/2020/IsPropertyKey.js"); var Type = __webpack_require__(/*! ./Type */ "./node_modules/es-abstract/2020/Type.js"); // https://ecma-international.org/ecma-262/6.0/#sec-hasproperty module.exports = function HasProperty(O, P) { if (Type(O) !== 'Object') { throw new $TypeError('Assertion failed: `O` must be an Object'); } if (!IsPropertyKey(P)) { throw new $TypeError('Assertion failed: `P` must be a Property Key'); } return P in O; }; /***/ }), /***/ "./node_modules/es-abstract/2020/IsAccessorDescriptor.js": /*!***************************************************************!*\ !*** ./node_modules/es-abstract/2020/IsAccessorDescriptor.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var has = __webpack_require__(/*! has */ "./node_modules/has/src/index.js"); var assertRecord = __webpack_require__(/*! ../helpers/assertRecord */ "./node_modules/es-abstract/helpers/assertRecord.js"); var Type = __webpack_require__(/*! ./Type */ "./node_modules/es-abstract/2020/Type.js"); // https://ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor module.exports = function IsAccessorDescriptor(Desc) { if (typeof Desc === 'undefined') { return false; } assertRecord(Type, 'Property Descriptor', 'Desc', Desc); if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { return false; } return true; }; /***/ }), /***/ "./node_modules/es-abstract/2020/IsArray.js": /*!**************************************************!*\ !*** ./node_modules/es-abstract/2020/IsArray.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var $Array = GetIntrinsic('%Array%'); // eslint-disable-next-line global-require var toStr = !$Array.isArray && __webpack_require__(/*! call-bind/callBound */ "./node_modules/call-bind/callBound.js")('Object.prototype.toString'); // https://ecma-international.org/ecma-262/6.0/#sec-isarray module.exports = $Array.isArray || function IsArray(argument) { return toStr(argument) === '[object Array]'; }; /***/ }), /***/ "./node_modules/es-abstract/2020/IsCallable.js": /*!*****************************************************!*\ !*** ./node_modules/es-abstract/2020/IsCallable.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // http://262.ecma-international.org/5.1/#sec-9.11 module.exports = __webpack_require__(/*! is-callable */ "./node_modules/is-callable/index.js"); /***/ }), /***/ "./node_modules/es-abstract/2020/IsConstructor.js": /*!********************************************************!*\ !*** ./node_modules/es-abstract/2020/IsConstructor.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic.js */ "./node_modules/es-abstract/GetIntrinsic.js"); var $construct = GetIntrinsic('%Reflect.construct%', true); var DefinePropertyOrThrow = __webpack_require__(/*! ./DefinePropertyOrThrow */ "./node_modules/es-abstract/2020/DefinePropertyOrThrow.js"); try { DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); } catch (e) { // Accessor properties aren't supported DefinePropertyOrThrow = null; } // https://ecma-international.org/ecma-262/6.0/#sec-isconstructor if (DefinePropertyOrThrow && $construct) { var isConstructorMarker = {}; var badArrayLike = {}; DefinePropertyOrThrow(badArrayLike, 'length', { '[[Get]]': function () { throw isConstructorMarker; }, '[[Enumerable]]': true }); module.exports = function IsConstructor(argument) { try { // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`: $construct(argument, badArrayLike); } catch (err) { return err === isConstructorMarker; } }; } else { module.exports = function IsConstructor(argument) { // unfortunately there's no way to truly check this without try/catch `new argument` in old environments return typeof argument === 'function' && !!argument.prototype; }; } /***/ }), /***/ "./node_modules/es-abstract/2020/IsDataDescriptor.js": /*!***********************************************************!*\ !*** ./node_modules/es-abstract/2020/IsDataDescriptor.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var has = __webpack_require__(/*! has */ "./node_modules/has/src/index.js"); var assertRecord = __webpack_require__(/*! ../helpers/assertRecord */ "./node_modules/es-abstract/helpers/assertRecord.js"); var Type = __webpack_require__(/*! ./Type */ "./node_modules/es-abstract/2020/Type.js"); // https://ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor module.exports = function IsDataDescriptor(Desc) { if (typeof Desc === 'undefined') { return false; } assertRecord(Type, 'Property Descriptor', 'Desc', Desc); if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { return false; } return true; }; /***/ }), /***/ "./node_modules/es-abstract/2020/IsExtensible.js": /*!*******************************************************!*\ !*** ./node_modules/es-abstract/2020/IsExtensible.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var $Object = GetIntrinsic('%Object%'); var isPrimitive = __webpack_require__(/*! ../helpers/isPrimitive */ "./node_modules/es-abstract/helpers/isPrimitive.js"); var $preventExtensions = $Object.preventExtensions; var $isExtensible = $Object.isExtensible; // https://ecma-international.org/ecma-262/6.0/#sec-isextensible-o module.exports = $preventExtensions ? function IsExtensible(obj) { return !isPrimitive(obj) && $isExtensible(obj); } : function IsExtensible(obj) { return !isPrimitive(obj); }; /***/ }), /***/ "./node_modules/es-abstract/2020/IsInteger.js": /*!****************************************************!*\ !*** ./node_modules/es-abstract/2020/IsInteger.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var abs = __webpack_require__(/*! ./abs */ "./node_modules/es-abstract/2020/abs.js"); var floor = __webpack_require__(/*! ./floor */ "./node_modules/es-abstract/2020/floor.js"); var $isNaN = __webpack_require__(/*! ../helpers/isNaN */ "./node_modules/es-abstract/helpers/isNaN.js"); var $isFinite = __webpack_require__(/*! ../helpers/isFinite */ "./node_modules/es-abstract/helpers/isFinite.js"); // https://ecma-international.org/ecma-262/6.0/#sec-isinteger module.exports = function IsInteger(argument) { if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { return false; } var absValue = abs(argument); return floor(absValue) === absValue; }; /***/ }), /***/ "./node_modules/es-abstract/2020/IsPropertyKey.js": /*!********************************************************!*\ !*** ./node_modules/es-abstract/2020/IsPropertyKey.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // https://ecma-international.org/ecma-262/6.0/#sec-ispropertykey module.exports = function IsPropertyKey(argument) { return typeof argument === 'string' || typeof argument === 'symbol'; }; /***/ }), /***/ "./node_modules/es-abstract/2020/IsRegExp.js": /*!***************************************************!*\ !*** ./node_modules/es-abstract/2020/IsRegExp.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var $match = GetIntrinsic('%Symbol.match%', true); var hasRegExpMatcher = __webpack_require__(/*! is-regex */ "./node_modules/is-regex/index.js"); var ToBoolean = __webpack_require__(/*! ./ToBoolean */ "./node_modules/es-abstract/2020/ToBoolean.js"); // https://ecma-international.org/ecma-262/6.0/#sec-isregexp module.exports = function IsRegExp(argument) { if (!argument || typeof argument !== 'object') { return false; } if ($match) { var isRegExp = argument[$match]; if (typeof isRegExp !== 'undefined') { return ToBoolean(isRegExp); } } return hasRegExpMatcher(argument); }; /***/ }), /***/ "./node_modules/es-abstract/2020/LengthOfArrayLike.js": /*!************************************************************!*\ !*** ./node_modules/es-abstract/2020/LengthOfArrayLike.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var $TypeError = GetIntrinsic('%TypeError%'); var Get = __webpack_require__(/*! ./Get */ "./node_modules/es-abstract/2020/Get.js"); var ToLength = __webpack_require__(/*! ./ToLength */ "./node_modules/es-abstract/2020/ToLength.js"); var Type = __webpack_require__(/*! ./Type */ "./node_modules/es-abstract/2020/Type.js"); // https://262.ecma-international.org/11.0/#sec-lengthofarraylike module.exports = function LengthOfArrayLike(obj) { if (Type(obj) !== 'Object') { throw new $TypeError('Assertion failed: `obj` must be an Object'); } return ToLength(Get(obj, 'length')); }; // TODO: use this all over /***/ }), /***/ "./node_modules/es-abstract/2020/OrdinaryGetOwnProperty.js": /*!*****************************************************************!*\ !*** ./node_modules/es-abstract/2020/OrdinaryGetOwnProperty.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var $gOPD = __webpack_require__(/*! ../helpers/getOwnPropertyDescriptor */ "./node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js"); var $TypeError = GetIntrinsic('%TypeError%'); var callBound = __webpack_require__(/*! call-bind/callBound */ "./node_modules/call-bind/callBound.js"); var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); var has = __webpack_require__(/*! has */ "./node_modules/has/src/index.js"); var IsArray = __webpack_require__(/*! ./IsArray */ "./node_modules/es-abstract/2020/IsArray.js"); var IsPropertyKey = __webpack_require__(/*! ./IsPropertyKey */ "./node_modules/es-abstract/2020/IsPropertyKey.js"); var IsRegExp = __webpack_require__(/*! ./IsRegExp */ "./node_modules/es-abstract/2020/IsRegExp.js"); var ToPropertyDescriptor = __webpack_require__(/*! ./ToPropertyDescriptor */ "./node_modules/es-abstract/2020/ToPropertyDescriptor.js"); var Type = __webpack_require__(/*! ./Type */ "./node_modules/es-abstract/2020/Type.js"); // https://ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty module.exports = function OrdinaryGetOwnProperty(O, P) { if (Type(O) !== 'Object') { throw new $TypeError('Assertion failed: O must be an Object'); } if (!IsPropertyKey(P)) { throw new $TypeError('Assertion failed: P must be a Property Key'); } if (!has(O, P)) { return void 0; } if (!$gOPD) { // ES3 / IE 8 fallback var arrayLength = IsArray(O) && P === 'length'; var regexLastIndex = IsRegExp(O) && P === 'lastIndex'; return { '[[Configurable]]': !(arrayLength || regexLastIndex), '[[Enumerable]]': $isEnumerable(O, P), '[[Value]]': O[P], '[[Writable]]': true }; } return ToPropertyDescriptor($gOPD(O, P)); }; /***/ }), /***/ "./node_modules/es-abstract/2020/RequireObjectCoercible.js": /*!*****************************************************************!*\ !*** ./node_modules/es-abstract/2020/RequireObjectCoercible.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = __webpack_require__(/*! ../5/CheckObjectCoercible */ "./node_modules/es-abstract/5/CheckObjectCoercible.js"); /***/ }), /***/ "./node_modules/es-abstract/2020/SameValue.js": /*!****************************************************!*\ !*** ./node_modules/es-abstract/2020/SameValue.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $isNaN = __webpack_require__(/*! ../helpers/isNaN */ "./node_modules/es-abstract/helpers/isNaN.js"); // http://262.ecma-international.org/5.1/#sec-9.12 module.exports = function SameValue(x, y) { if (x === y) { // 0 === -0, but they are not identical. if (x === 0) { return 1 / x === 1 / y; } return true; } return $isNaN(x) && $isNaN(y); }; /***/ }), /***/ "./node_modules/es-abstract/2020/ToBoolean.js": /*!****************************************************!*\ !*** ./node_modules/es-abstract/2020/ToBoolean.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // http://262.ecma-international.org/5.1/#sec-9.2 module.exports = function ToBoolean(value) { return !!value; }; /***/ }), /***/ "./node_modules/es-abstract/2020/ToInteger.js": /*!****************************************************!*\ !*** ./node_modules/es-abstract/2020/ToInteger.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var ES5ToInteger = __webpack_require__(/*! ../5/ToInteger */ "./node_modules/es-abstract/5/ToInteger.js"); var ToNumber = __webpack_require__(/*! ./ToNumber */ "./node_modules/es-abstract/2020/ToNumber.js"); // https://262.ecma-international.org/11.0/#sec-tointeger module.exports = function ToInteger(value) { var number = ToNumber(value); if (number !== 0) { number = ES5ToInteger(number); } return number === 0 ? 0 : number; }; /***/ }), /***/ "./node_modules/es-abstract/2020/ToLength.js": /*!***************************************************!*\ !*** ./node_modules/es-abstract/2020/ToLength.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var MAX_SAFE_INTEGER = __webpack_require__(/*! ../helpers/maxSafeInteger */ "./node_modules/es-abstract/helpers/maxSafeInteger.js"); var ToInteger = __webpack_require__(/*! ./ToInteger */ "./node_modules/es-abstract/2020/ToInteger.js"); module.exports = function ToLength(argument) { var len = ToInteger(argument); if (len <= 0) { return 0; } // includes converting -0 to +0 if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } return len; }; /***/ }), /***/ "./node_modules/es-abstract/2020/ToNumber.js": /*!***************************************************!*\ !*** ./node_modules/es-abstract/2020/ToNumber.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var $TypeError = GetIntrinsic('%TypeError%'); var $Number = GetIntrinsic('%Number%'); var $RegExp = GetIntrinsic('%RegExp%'); var $parseInteger = GetIntrinsic('%parseInt%'); var callBound = __webpack_require__(/*! call-bind/callBound */ "./node_modules/call-bind/callBound.js"); var regexTester = __webpack_require__(/*! ../helpers/regexTester */ "./node_modules/es-abstract/helpers/regexTester.js"); var isPrimitive = __webpack_require__(/*! ../helpers/isPrimitive */ "./node_modules/es-abstract/helpers/isPrimitive.js"); var $strSlice = callBound('String.prototype.slice'); var isBinary = regexTester(/^0b[01]+$/i); var isOctal = regexTester(/^0o[0-7]+$/i); var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); var hasNonWS = regexTester(nonWSregex); // whitespace from: https://es5.github.io/#x15.5.4.20 // implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 var ws = ['\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', '\u2029\uFEFF'].join(''); var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); var $replace = callBound('String.prototype.replace'); var $trim = function (value) { return $replace(value, trimRegex, ''); }; var ToPrimitive = __webpack_require__(/*! ./ToPrimitive */ "./node_modules/es-abstract/2020/ToPrimitive.js"); // https://ecma-international.org/ecma-262/6.0/#sec-tonumber module.exports = function ToNumber(argument) { var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number); if (typeof value === 'symbol') { throw new $TypeError('Cannot convert a Symbol value to a number'); } if (typeof value === 'string') { if (isBinary(value)) { return ToNumber($parseInteger($strSlice(value, 2), 2)); } else if (isOctal(value)) { return ToNumber($parseInteger($strSlice(value, 2), 8)); } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { return NaN; } else { var trimmed = $trim(value); if (trimmed !== value) { return ToNumber(trimmed); } } } return $Number(value); }; /***/ }), /***/ "./node_modules/es-abstract/2020/ToObject.js": /*!***************************************************!*\ !*** ./node_modules/es-abstract/2020/ToObject.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var $Object = GetIntrinsic('%Object%'); var RequireObjectCoercible = __webpack_require__(/*! ./RequireObjectCoercible */ "./node_modules/es-abstract/2020/RequireObjectCoercible.js"); // https://ecma-international.org/ecma-262/6.0/#sec-toobject module.exports = function ToObject(value) { RequireObjectCoercible(value); return $Object(value); }; /***/ }), /***/ "./node_modules/es-abstract/2020/ToPrimitive.js": /*!******************************************************!*\ !*** ./node_modules/es-abstract/2020/ToPrimitive.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toPrimitive = __webpack_require__(/*! es-to-primitive/es2015 */ "./node_modules/es-to-primitive/es2015.js"); // https://ecma-international.org/ecma-262/6.0/#sec-toprimitive module.exports = function ToPrimitive(input) { if (arguments.length > 1) { return toPrimitive(input, arguments[1]); } return toPrimitive(input); }; /***/ }), /***/ "./node_modules/es-abstract/2020/ToPropertyDescriptor.js": /*!***************************************************************!*\ !*** ./node_modules/es-abstract/2020/ToPropertyDescriptor.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var has = __webpack_require__(/*! has */ "./node_modules/has/src/index.js"); var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var $TypeError = GetIntrinsic('%TypeError%'); var Type = __webpack_require__(/*! ./Type */ "./node_modules/es-abstract/2020/Type.js"); var ToBoolean = __webpack_require__(/*! ./ToBoolean */ "./node_modules/es-abstract/2020/ToBoolean.js"); var IsCallable = __webpack_require__(/*! ./IsCallable */ "./node_modules/es-abstract/2020/IsCallable.js"); // https://262.ecma-international.org/5.1/#sec-8.10.5 module.exports = function ToPropertyDescriptor(Obj) { if (Type(Obj) !== 'Object') { throw new $TypeError('ToPropertyDescriptor requires an object'); } var desc = {}; if (has(Obj, 'enumerable')) { desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); } if (has(Obj, 'configurable')) { desc['[[Configurable]]'] = ToBoolean(Obj.configurable); } if (has(Obj, 'value')) { desc['[[Value]]'] = Obj.value; } if (has(Obj, 'writable')) { desc['[[Writable]]'] = ToBoolean(Obj.writable); } if (has(Obj, 'get')) { var getter = Obj.get; if (typeof getter !== 'undefined' && !IsCallable(getter)) { throw new $TypeError('getter must be a function'); } desc['[[Get]]'] = getter; } if (has(Obj, 'set')) { var setter = Obj.set; if (typeof setter !== 'undefined' && !IsCallable(setter)) { throw new $TypeError('setter must be a function'); } desc['[[Set]]'] = setter; } if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); } return desc; }; /***/ }), /***/ "./node_modules/es-abstract/2020/ToString.js": /*!***************************************************!*\ !*** ./node_modules/es-abstract/2020/ToString.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var $String = GetIntrinsic('%String%'); var $TypeError = GetIntrinsic('%TypeError%'); // https://ecma-international.org/ecma-262/6.0/#sec-tostring module.exports = function ToString(argument) { if (typeof argument === 'symbol') { throw new $TypeError('Cannot convert a Symbol value to a string'); } return $String(argument); }; /***/ }), /***/ "./node_modules/es-abstract/2020/Type.js": /*!***********************************************!*\ !*** ./node_modules/es-abstract/2020/Type.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var ES5Type = __webpack_require__(/*! ../5/Type */ "./node_modules/es-abstract/5/Type.js"); // https://262.ecma-international.org/11.0/#sec-ecmascript-data-types-and-values module.exports = function Type(x) { if (typeof x === 'symbol') { return 'Symbol'; } if (typeof x === 'bigint') { return 'BigInt'; } return ES5Type(x); }; /***/ }), /***/ "./node_modules/es-abstract/2020/abs.js": /*!**********************************************!*\ !*** ./node_modules/es-abstract/2020/abs.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var $abs = GetIntrinsic('%Math.abs%'); // http://262.ecma-international.org/5.1/#sec-5.2 module.exports = function abs(x) { return $abs(x); }; /***/ }), /***/ "./node_modules/es-abstract/2020/floor.js": /*!************************************************!*\ !*** ./node_modules/es-abstract/2020/floor.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // var modulo = require('./modulo'); var $floor = Math.floor; // http://262.ecma-international.org/5.1/#sec-5.2 module.exports = function floor(x) { // return x - modulo(x, 1); return $floor(x); }; /***/ }), /***/ "./node_modules/es-abstract/5/CheckObjectCoercible.js": /*!************************************************************!*\ !*** ./node_modules/es-abstract/5/CheckObjectCoercible.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var $TypeError = GetIntrinsic('%TypeError%'); // http://262.ecma-international.org/5.1/#sec-9.10 module.exports = function CheckObjectCoercible(value, optMessage) { if (value == null) { throw new $TypeError(optMessage || 'Cannot call method on ' + value); } return value; }; /***/ }), /***/ "./node_modules/es-abstract/5/ToInteger.js": /*!*************************************************!*\ !*** ./node_modules/es-abstract/5/ToInteger.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var abs = __webpack_require__(/*! ./abs */ "./node_modules/es-abstract/5/abs.js"); var floor = __webpack_require__(/*! ./floor */ "./node_modules/es-abstract/5/floor.js"); var ToNumber = __webpack_require__(/*! ./ToNumber */ "./node_modules/es-abstract/5/ToNumber.js"); var $isNaN = __webpack_require__(/*! ../helpers/isNaN */ "./node_modules/es-abstract/helpers/isNaN.js"); var $isFinite = __webpack_require__(/*! ../helpers/isFinite */ "./node_modules/es-abstract/helpers/isFinite.js"); var $sign = __webpack_require__(/*! ../helpers/sign */ "./node_modules/es-abstract/helpers/sign.js"); // http://262.ecma-international.org/5.1/#sec-9.4 module.exports = function ToInteger(value) { var number = ToNumber(value); if ($isNaN(number)) { return 0; } if (number === 0 || !$isFinite(number)) { return number; } return $sign(number) * floor(abs(number)); }; /***/ }), /***/ "./node_modules/es-abstract/5/ToNumber.js": /*!************************************************!*\ !*** ./node_modules/es-abstract/5/ToNumber.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var ToPrimitive = __webpack_require__(/*! ./ToPrimitive */ "./node_modules/es-abstract/5/ToPrimitive.js"); // http://262.ecma-international.org/5.1/#sec-9.3 module.exports = function ToNumber(value) { var prim = ToPrimitive(value, Number); if (typeof prim !== 'string') { return +prim; // eslint-disable-line no-implicit-coercion } // eslint-disable-next-line no-control-regex var trimmed = prim.replace(/^[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+|[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+$/g, ''); if (/^0[ob]|^[+-]0x/.test(trimmed)) { return NaN; } return +trimmed; // eslint-disable-line no-implicit-coercion }; /***/ }), /***/ "./node_modules/es-abstract/5/ToPrimitive.js": /*!***************************************************!*\ !*** ./node_modules/es-abstract/5/ToPrimitive.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // http://262.ecma-international.org/5.1/#sec-9.1 module.exports = __webpack_require__(/*! es-to-primitive/es5 */ "./node_modules/es-to-primitive/es5.js"); /***/ }), /***/ "./node_modules/es-abstract/5/Type.js": /*!********************************************!*\ !*** ./node_modules/es-abstract/5/Type.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // https://262.ecma-international.org/5.1/#sec-8 module.exports = function Type(x) { if (x === null) { return 'Null'; } if (typeof x === 'undefined') { return 'Undefined'; } if (typeof x === 'function' || typeof x === 'object') { return 'Object'; } if (typeof x === 'number') { return 'Number'; } if (typeof x === 'boolean') { return 'Boolean'; } if (typeof x === 'string') { return 'String'; } }; /***/ }), /***/ "./node_modules/es-abstract/5/abs.js": /*!*******************************************!*\ !*** ./node_modules/es-abstract/5/abs.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var $abs = GetIntrinsic('%Math.abs%'); // http://262.ecma-international.org/5.1/#sec-5.2 module.exports = function abs(x) { return $abs(x); }; /***/ }), /***/ "./node_modules/es-abstract/5/floor.js": /*!*********************************************!*\ !*** ./node_modules/es-abstract/5/floor.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // var modulo = require('./modulo'); var $floor = Math.floor; // http://262.ecma-international.org/5.1/#sec-5.2 module.exports = function floor(x) { // return x - modulo(x, 1); return $floor(x); }; /***/ }), /***/ "./node_modules/es-abstract/GetIntrinsic.js": /*!**************************************************!*\ !*** ./node_modules/es-abstract/GetIntrinsic.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // TODO: remove, semver-major module.exports = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); /***/ }), /***/ "./node_modules/es-abstract/helpers/DefineOwnProperty.js": /*!***************************************************************!*\ !*** ./node_modules/es-abstract/helpers/DefineOwnProperty.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); if ($defineProperty) { try { $defineProperty({}, 'a', { value: 1 }); } catch (e) { // IE 8 has a broken defineProperty $defineProperty = null; } } var callBound = __webpack_require__(/*! call-bind/callBound */ "./node_modules/call-bind/callBound.js"); var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); // eslint-disable-next-line max-params module.exports = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) { if (!$defineProperty) { if (!IsDataDescriptor(desc)) { // ES3 does not support getters/setters return false; } if (!desc['[[Configurable]]'] || !desc['[[Writable]]']) { return false; } // fallback for ES3 if (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) { // a non-enumerable existing property return false; } // property does not exist at all, or exists but is enumerable var V = desc['[[Value]]']; // eslint-disable-next-line no-param-reassign O[P] = V; // will use [[Define]] return SameValue(O[P], V); } $defineProperty(O, P, FromPropertyDescriptor(desc)); return true; }; /***/ }), /***/ "./node_modules/es-abstract/helpers/assertRecord.js": /*!**********************************************************!*\ !*** ./node_modules/es-abstract/helpers/assertRecord.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var $TypeError = GetIntrinsic('%TypeError%'); var $SyntaxError = GetIntrinsic('%SyntaxError%'); var has = __webpack_require__(/*! has */ "./node_modules/has/src/index.js"); var predicates = { // https://262.ecma-international.org/6.0/#sec-property-descriptor-specification-type 'Property Descriptor': function isPropertyDescriptor(Type, Desc) { if (Type(Desc) !== 'Object') { return false; } var allowed = { '[[Configurable]]': true, '[[Enumerable]]': true, '[[Get]]': true, '[[Set]]': true, '[[Value]]': true, '[[Writable]]': true }; for (var key in Desc) { // eslint-disable-line if (has(Desc, key) && !allowed[key]) { return false; } } var isData = has(Desc, '[[Value]]'); var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]'); if (isData && IsAccessor) { throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); } return true; } }; module.exports = function assertRecord(Type, recordType, argumentName, value) { var predicate = predicates[recordType]; if (typeof predicate !== 'function') { throw new $SyntaxError('unknown record type: ' + recordType); } if (!predicate(Type, value)) { throw new $TypeError(argumentName + ' must be a ' + recordType); } }; /***/ }), /***/ "./node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js": /*!**********************************************************************!*\ !*** ./node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%'); if ($gOPD) { try { $gOPD([], 'length'); } catch (e) { // IE 8 has a broken gOPD $gOPD = null; } } module.exports = $gOPD; /***/ }), /***/ "./node_modules/es-abstract/helpers/isFinite.js": /*!******************************************************!*\ !*** ./node_modules/es-abstract/helpers/isFinite.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $isNaN = Number.isNaN || function (a) { return a !== a; }; module.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; }; /***/ }), /***/ "./node_modules/es-abstract/helpers/isNaN.js": /*!***************************************************!*\ !*** ./node_modules/es-abstract/helpers/isNaN.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = Number.isNaN || function isNaN(a) { return a !== a; }; /***/ }), /***/ "./node_modules/es-abstract/helpers/isPrimitive.js": /*!*********************************************************!*\ !*** ./node_modules/es-abstract/helpers/isPrimitive.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function isPrimitive(value) { return value === null || typeof value !== 'function' && typeof value !== 'object'; }; /***/ }), /***/ "./node_modules/es-abstract/helpers/isPropertyDescriptor.js": /*!******************************************************************!*\ !*** ./node_modules/es-abstract/helpers/isPropertyDescriptor.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var has = __webpack_require__(/*! has */ "./node_modules/has/src/index.js"); var $TypeError = GetIntrinsic('%TypeError%'); module.exports = function IsPropertyDescriptor(ES, Desc) { if (ES.Type(Desc) !== 'Object') { return false; } var allowed = { '[[Configurable]]': true, '[[Enumerable]]': true, '[[Get]]': true, '[[Set]]': true, '[[Value]]': true, '[[Writable]]': true }; for (var key in Desc) { // eslint-disable-line no-restricted-syntax if (has(Desc, key) && !allowed[key]) { return false; } } if (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) { throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); } return true; }; /***/ }), /***/ "./node_modules/es-abstract/helpers/maxSafeInteger.js": /*!************************************************************!*\ !*** ./node_modules/es-abstract/helpers/maxSafeInteger.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var $Math = GetIntrinsic('%Math%'); var $Number = GetIntrinsic('%Number%'); module.exports = $Number.MAX_SAFE_INTEGER || $Math.pow(2, 53) - 1; /***/ }), /***/ "./node_modules/es-abstract/helpers/regexTester.js": /*!*********************************************************!*\ !*** ./node_modules/es-abstract/helpers/regexTester.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var $test = GetIntrinsic('RegExp.prototype.test'); var callBind = __webpack_require__(/*! call-bind */ "./node_modules/call-bind/index.js"); module.exports = function regexTester(regex) { return callBind($test, regex); }; /***/ }), /***/ "./node_modules/es-abstract/helpers/sign.js": /*!**************************************************!*\ !*** ./node_modules/es-abstract/helpers/sign.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function sign(number) { return number >= 0 ? 1 : -1; }; /***/ }), /***/ "./node_modules/es-array-method-boxes-properly/index.js": /*!**************************************************************!*\ !*** ./node_modules/es-array-method-boxes-properly/index.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = function properlyBoxed(method) { // Check node 0.6.21 bug where third parameter is not boxed var properlyBoxesNonStrict = true; var properlyBoxesStrict = true; var threwException = false; if (typeof method === 'function') { try { // eslint-disable-next-line max-params method.call('f', function (_, __, O) { if (typeof O !== 'object') { properlyBoxesNonStrict = false; } }); method.call([null], function () { 'use strict'; properlyBoxesStrict = typeof this === 'string'; // eslint-disable-line no-invalid-this }, 'x'); } catch (e) { threwException = true; } return !threwException && properlyBoxesNonStrict && properlyBoxesStrict; } return false; }; /***/ }), /***/ "./node_modules/es-get-iterator/index.js": /*!***********************************************!*\ !*** ./node_modules/es-get-iterator/index.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* eslint global-require: 0 */ // the code is structured this way so that bundlers can // alias out `has-symbols` to `() => true` or `() => false` if your target // environments' Symbol capabilities are known, and then use // dead code elimination on the rest of this module. // // Similarly, `isarray` can be aliased to `Array.isArray` if // available in all target environments. var isArguments = __webpack_require__(/*! is-arguments */ "./node_modules/is-arguments/index.js"); if (__webpack_require__(/*! has-symbols */ "./node_modules/has-symbols/index.js")() || __webpack_require__(/*! has-symbols/shams */ "./node_modules/has-symbols/shams.js")()) { var $iterator = Symbol.iterator; // Symbol is available natively or shammed // natively: // - Chrome >= 38 // - Edge 12-14?, Edge >= 15 for sure // - FF >= 36 // - Safari >= 9 // - node >= 0.12 module.exports = function getIterator(iterable) { // alternatively, `iterable[$iterator]?.()` if (iterable != null && typeof iterable[$iterator] !== 'undefined') { return iterable[$iterator](); } if (isArguments(iterable)) { // arguments objects lack Symbol.iterator // - node 0.12 return Array.prototype[$iterator].call(iterable); } }; } else { // Symbol is not available, native or shammed var isArray = __webpack_require__(/*! isarray */ "./node_modules/es-get-iterator/node_modules/isarray/index.js"); var isString = __webpack_require__(/*! is-string */ "./node_modules/is-string/index.js"); var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var $Map = GetIntrinsic('%Map%', true); var $Set = GetIntrinsic('%Set%', true); var callBound = __webpack_require__(/*! call-bind/callBound */ "./node_modules/call-bind/callBound.js"); var $arrayPush = callBound('Array.prototype.push'); var $charCodeAt = callBound('String.prototype.charCodeAt'); var $stringSlice = callBound('String.prototype.slice'); var advanceStringIndex = function advanceStringIndex(S, index) { var length = S.length; if (index + 1 >= length) { return index + 1; } var first = $charCodeAt(S, index); if (first < 0xD800 || first > 0xDBFF) { return index + 1; } var second = $charCodeAt(S, index + 1); if (second < 0xDC00 || second > 0xDFFF) { return index + 1; } return index + 2; }; var getArrayIterator = function getArrayIterator(arraylike) { var i = 0; return { next: function next() { var done = i >= arraylike.length; var value; if (!done) { value = arraylike[i]; i += 1; } return { done: done, value: value }; } }; }; var getNonCollectionIterator = function getNonCollectionIterator(iterable, noPrimordialCollections) { if (isArray(iterable) || isArguments(iterable)) { return getArrayIterator(iterable); } if (isString(iterable)) { var i = 0; return { next: function next() { var nextIndex = advanceStringIndex(iterable, i); var value = $stringSlice(iterable, i, nextIndex); i = nextIndex; return { done: nextIndex > iterable.length, value: value }; } }; } // es6-shim and es-shims' es-map use a string "_es6-shim iterator_" property on different iterables, such as MapIterator. if (noPrimordialCollections && typeof iterable['_es6-shim iterator_'] !== 'undefined') { return iterable['_es6-shim iterator_'](); } }; if (!$Map && !$Set) { // the only language iterables are Array, String, arguments // - Safari <= 6.0 // - Chrome < 38 // - node < 0.12 // - FF < 13 // - IE < 11 // - Edge < 11 module.exports = function getIterator(iterable) { if (iterable != null) { return getNonCollectionIterator(iterable, true); } }; } else { // either Map or Set are available, but Symbol is not // - es6-shim on an ES5 browser // - Safari 6.2 (maybe 6.1?) // - FF v[13, 36) // - IE 11 // - Edge 11 // - Safari v[6, 9) var isMap = __webpack_require__(/*! is-map */ "./node_modules/is-map/index.js"); var isSet = __webpack_require__(/*! is-set */ "./node_modules/is-set/index.js"); // Firefox >= 27, IE 11, Safari 6.2 - 9, Edge 11, es6-shim in older envs, all have forEach var $mapForEach = callBound('Map.prototype.forEach', true); var $setForEach = callBound('Set.prototype.forEach', true); if (typeof process === 'undefined' || !process.versions || !process.versions.node) { // "if is not node" // Firefox 17 - 26 has `.iterator()`, whose iterator `.next()` either // returns a value, or throws a StopIteration object. These browsers // do not have any other mechanism for iteration. var $mapIterator = callBound('Map.prototype.iterator', true); var $setIterator = callBound('Set.prototype.iterator', true); var getStopIterationIterator = function (iterator) { var done = false; return { next: function next() { try { return { done: done, value: done ? undefined : iterator.next() }; } catch (e) { done = true; return { done: true, value: undefined }; } } }; }; } // Firefox 27-35, and some older es6-shim versions, use a string "@@iterator" property // this returns a proper iterator object, so we should use it instead of forEach. // newer es6-shim versions use a string "_es6-shim iterator_" property. var $mapAtAtIterator = callBound('Map.prototype.@@iterator', true) || callBound('Map.prototype._es6-shim iterator_', true); var $setAtAtIterator = callBound('Set.prototype.@@iterator', true) || callBound('Set.prototype._es6-shim iterator_', true); var getCollectionIterator = function getCollectionIterator(iterable) { if (isMap(iterable)) { if ($mapIterator) { return getStopIterationIterator($mapIterator(iterable)); } if ($mapAtAtIterator) { return $mapAtAtIterator(iterable); } if ($mapForEach) { var entries = []; $mapForEach(iterable, function (v, k) { $arrayPush(entries, [k, v]); }); return getArrayIterator(entries); } } if (isSet(iterable)) { if ($setIterator) { return getStopIterationIterator($setIterator(iterable)); } if ($setAtAtIterator) { return $setAtAtIterator(iterable); } if ($setForEach) { var values = []; $setForEach(iterable, function (v) { $arrayPush(values, v); }); return getArrayIterator(values); } } }; module.exports = function getIterator(iterable) { return getCollectionIterator(iterable) || getNonCollectionIterator(iterable); }; } } /***/ }), /***/ "./node_modules/es-get-iterator/node_modules/isarray/index.js": /*!********************************************************************!*\ !*** ./node_modules/es-get-iterator/node_modules/isarray/index.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { var toString = {}.toString; module.exports = Array.isArray || function (arr) { return toString.call(arr) == '[object Array]'; }; /***/ }), /***/ "./node_modules/es-to-primitive/es2015.js": /*!************************************************!*\ !*** ./node_modules/es-to-primitive/es2015.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; var isPrimitive = __webpack_require__(/*! ./helpers/isPrimitive */ "./node_modules/es-to-primitive/helpers/isPrimitive.js"); var isCallable = __webpack_require__(/*! is-callable */ "./node_modules/is-callable/index.js"); var isDate = __webpack_require__(/*! is-date-object */ "./node_modules/is-date-object/index.js"); var isSymbol = __webpack_require__(/*! is-symbol */ "./node_modules/is-symbol/index.js"); var ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) { if (typeof O === 'undefined' || O === null) { throw new TypeError('Cannot call method on ' + O); } if (typeof hint !== 'string' || hint !== 'number' && hint !== 'string') { throw new TypeError('hint must be "string" or "number"'); } var methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString']; var method, result, i; for (i = 0; i < methodNames.length; ++i) { method = O[methodNames[i]]; if (isCallable(method)) { result = method.call(O); if (isPrimitive(result)) { return result; } } } throw new TypeError('No default value'); }; var GetMethod = function GetMethod(O, P) { var func = O[P]; if (func !== null && typeof func !== 'undefined') { if (!isCallable(func)) { throw new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function'); } return func; } return void 0; }; // http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive module.exports = function ToPrimitive(input) { if (isPrimitive(input)) { return input; } var hint = 'default'; if (arguments.length > 1) { if (arguments[1] === String) { hint = 'string'; } else if (arguments[1] === Number) { hint = 'number'; } } var exoticToPrim; if (hasSymbols) { if (Symbol.toPrimitive) { exoticToPrim = GetMethod(input, Symbol.toPrimitive); } else if (isSymbol(input)) { exoticToPrim = Symbol.prototype.valueOf; } } if (typeof exoticToPrim !== 'undefined') { var result = exoticToPrim.call(input, hint); if (isPrimitive(result)) { return result; } throw new TypeError('unable to convert exotic object to primitive'); } if (hint === 'default' && (isDate(input) || isSymbol(input))) { hint = 'string'; } return ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint); }; /***/ }), /***/ "./node_modules/es-to-primitive/es5.js": /*!*********************************************!*\ !*** ./node_modules/es-to-primitive/es5.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toStr = Object.prototype.toString; var isPrimitive = __webpack_require__(/*! ./helpers/isPrimitive */ "./node_modules/es-to-primitive/helpers/isPrimitive.js"); var isCallable = __webpack_require__(/*! is-callable */ "./node_modules/is-callable/index.js"); // http://ecma-international.org/ecma-262/5.1/#sec-8.12.8 var ES5internalSlots = { '[[DefaultValue]]': function (O) { var actualHint; if (arguments.length > 1) { actualHint = arguments[1]; } else { actualHint = toStr.call(O) === '[object Date]' ? String : Number; } if (actualHint === String || actualHint === Number) { var methods = actualHint === String ? ['toString', 'valueOf'] : ['valueOf', 'toString']; var value, i; for (i = 0; i < methods.length; ++i) { if (isCallable(O[methods[i]])) { value = O[methods[i]](); if (isPrimitive(value)) { return value; } } } throw new TypeError('No default value'); } throw new TypeError('invalid [[DefaultValue]] hint supplied'); } }; // http://ecma-international.org/ecma-262/5.1/#sec-9.1 module.exports = function ToPrimitive(input) { if (isPrimitive(input)) { return input; } if (arguments.length > 1) { return ES5internalSlots['[[DefaultValue]]'](input, arguments[1]); } return ES5internalSlots['[[DefaultValue]]'](input); }; /***/ }), /***/ "./node_modules/es-to-primitive/helpers/isPrimitive.js": /*!*************************************************************!*\ !*** ./node_modules/es-to-primitive/helpers/isPrimitive.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function isPrimitive(value) { return value === null || typeof value !== 'function' && typeof value !== 'object'; }; /***/ }), /***/ "./node_modules/foreach/index.js": /*!***************************************!*\ !*** ./node_modules/foreach/index.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports) { var hasOwn = Object.prototype.hasOwnProperty; var toString = Object.prototype.toString; module.exports = function forEach(obj, fn, ctx) { if (toString.call(fn) !== '[object Function]') { throw new TypeError('iterator must be a function'); } var l = obj.length; if (l === +l) { for (var i = 0; i < l; i++) { fn.call(ctx, obj[i], i, obj); } } else { for (var k in obj) { if (hasOwn.call(obj, k)) { fn.call(ctx, obj[k], k, obj); } } } }; /***/ }), /***/ "./node_modules/function-bind/implementation.js": /*!******************************************************!*\ !*** ./node_modules/function-bind/implementation.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* eslint no-invalid-this: 1 */ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; var slice = Array.prototype.slice; var toStr = Object.prototype.toString; var funcType = '[object Function]'; module.exports = function bind(that) { var target = this; if (typeof target !== 'function' || toStr.call(target) !== funcType) { throw new TypeError(ERROR_MESSAGE + target); } var args = slice.call(arguments, 1); var bound; var binder = function () { if (this instanceof bound) { var result = target.apply(this, args.concat(slice.call(arguments))); if (Object(result) === result) { return result; } return this; } else { return target.apply(that, args.concat(slice.call(arguments))); } }; var boundLength = Math.max(0, target.length - args.length); var boundArgs = []; for (var i = 0; i < boundLength; i++) { boundArgs.push('$' + i); } bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); if (target.prototype) { var Empty = function Empty() {}; Empty.prototype = target.prototype; bound.prototype = new Empty(); Empty.prototype = null; } return bound; }; /***/ }), /***/ "./node_modules/function-bind/index.js": /*!*********************************************!*\ !*** ./node_modules/function-bind/index.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/function-bind/implementation.js"); module.exports = Function.prototype.bind || implementation; /***/ }), /***/ "./node_modules/get-intrinsic/index.js": /*!*********************************************!*\ !*** ./node_modules/get-intrinsic/index.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var undefined; var $SyntaxError = SyntaxError; var $Function = Function; var $TypeError = TypeError; // eslint-disable-next-line consistent-return var getEvalledConstructor = function (expressionSyntax) { try { return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); } catch (e) {} }; var $gOPD = Object.getOwnPropertyDescriptor; if ($gOPD) { try { $gOPD({}, ''); } catch (e) { $gOPD = null; // this is IE 8, which has a broken gOPD } } var throwTypeError = function () { throw new $TypeError(); }; var ThrowTypeError = $gOPD ? function () { try { // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties arguments.callee; // IE 8 does not throw here return throwTypeError; } catch (calleeThrows) { try { // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') return $gOPD(arguments, 'callee').get; } catch (gOPDthrows) { return throwTypeError; } } }() : throwTypeError; var hasSymbols = __webpack_require__(/*! has-symbols */ "./node_modules/has-symbols/index.js")(); var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto var needsEval = {}; var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); var INTRINSICS = { '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, '%Array%': Array, '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, '%AsyncFromSyncIteratorPrototype%': undefined, '%AsyncFunction%': needsEval, '%AsyncGenerator%': needsEval, '%AsyncGeneratorFunction%': needsEval, '%AsyncIteratorPrototype%': needsEval, '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, '%Boolean%': Boolean, '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, '%Date%': Date, '%decodeURI%': decodeURI, '%decodeURIComponent%': decodeURIComponent, '%encodeURI%': encodeURI, '%encodeURIComponent%': encodeURIComponent, '%Error%': Error, '%eval%': eval, // eslint-disable-line no-eval '%EvalError%': EvalError, '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, '%Function%': $Function, '%GeneratorFunction%': needsEval, '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, '%isFinite%': isFinite, '%isNaN%': isNaN, '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, '%JSON%': typeof JSON === 'object' ? JSON : undefined, '%Map%': typeof Map === 'undefined' ? undefined : Map, '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), '%Math%': Math, '%Number%': Number, '%Object%': Object, '%parseFloat%': parseFloat, '%parseInt%': parseInt, '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, '%RangeError%': RangeError, '%ReferenceError%': ReferenceError, '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, '%RegExp%': RegExp, '%Set%': typeof Set === 'undefined' ? undefined : Set, '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, '%String%': String, '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, '%Symbol%': hasSymbols ? Symbol : undefined, '%SyntaxError%': $SyntaxError, '%ThrowTypeError%': ThrowTypeError, '%TypedArray%': TypedArray, '%TypeError%': $TypeError, '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, '%URIError%': URIError, '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet }; var doEval = function doEval(name) { var value; if (name === '%AsyncFunction%') { value = getEvalledConstructor('async function () {}'); } else if (name === '%GeneratorFunction%') { value = getEvalledConstructor('function* () {}'); } else if (name === '%AsyncGeneratorFunction%') { value = getEvalledConstructor('async function* () {}'); } else if (name === '%AsyncGenerator%') { var fn = doEval('%AsyncGeneratorFunction%'); if (fn) { value = fn.prototype; } } else if (name === '%AsyncIteratorPrototype%') { var gen = doEval('%AsyncGenerator%'); if (gen) { value = getProto(gen.prototype); } } INTRINSICS[name] = value; return value; }; var LEGACY_ALIASES = { '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], '%ArrayPrototype%': ['Array', 'prototype'], '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], '%ArrayProto_values%': ['Array', 'prototype', 'values'], '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], '%BooleanPrototype%': ['Boolean', 'prototype'], '%DataViewPrototype%': ['DataView', 'prototype'], '%DatePrototype%': ['Date', 'prototype'], '%ErrorPrototype%': ['Error', 'prototype'], '%EvalErrorPrototype%': ['EvalError', 'prototype'], '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], '%FunctionPrototype%': ['Function', 'prototype'], '%Generator%': ['GeneratorFunction', 'prototype'], '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], '%JSONParse%': ['JSON', 'parse'], '%JSONStringify%': ['JSON', 'stringify'], '%MapPrototype%': ['Map', 'prototype'], '%NumberPrototype%': ['Number', 'prototype'], '%ObjectPrototype%': ['Object', 'prototype'], '%ObjProto_toString%': ['Object', 'prototype', 'toString'], '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], '%PromisePrototype%': ['Promise', 'prototype'], '%PromiseProto_then%': ['Promise', 'prototype', 'then'], '%Promise_all%': ['Promise', 'all'], '%Promise_reject%': ['Promise', 'reject'], '%Promise_resolve%': ['Promise', 'resolve'], '%RangeErrorPrototype%': ['RangeError', 'prototype'], '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], '%RegExpPrototype%': ['RegExp', 'prototype'], '%SetPrototype%': ['Set', 'prototype'], '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], '%StringPrototype%': ['String', 'prototype'], '%SymbolPrototype%': ['Symbol', 'prototype'], '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], '%TypedArrayPrototype%': ['TypedArray', 'prototype'], '%TypeErrorPrototype%': ['TypeError', 'prototype'], '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], '%URIErrorPrototype%': ['URIError', 'prototype'], '%WeakMapPrototype%': ['WeakMap', 'prototype'], '%WeakSetPrototype%': ['WeakSet', 'prototype'] }; var bind = __webpack_require__(/*! function-bind */ "./node_modules/function-bind/index.js"); var hasOwn = __webpack_require__(/*! has */ "./node_modules/has/src/index.js"); var $concat = bind.call(Function.call, Array.prototype.concat); var $spliceApply = bind.call(Function.apply, Array.prototype.splice); var $replace = bind.call(Function.call, String.prototype.replace); var $strSlice = bind.call(Function.call, String.prototype.slice); /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ var stringToPath = function stringToPath(string) { var first = $strSlice(string, 0, 1); var last = $strSlice(string, -1); if (first === '%' && last !== '%') { throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); } else if (last === '%' && first !== '%') { throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); } var result = []; $replace(string, rePropName, function (match, number, quote, subString) { result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; }); return result; }; /* end adaptation */ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { var intrinsicName = name; var alias; if (hasOwn(LEGACY_ALIASES, intrinsicName)) { alias = LEGACY_ALIASES[intrinsicName]; intrinsicName = '%' + alias[0] + '%'; } if (hasOwn(INTRINSICS, intrinsicName)) { var value = INTRINSICS[intrinsicName]; if (value === needsEval) { value = doEval(intrinsicName); } if (typeof value === 'undefined' && !allowMissing) { throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); } return { alias: alias, name: intrinsicName, value: value }; } throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); }; module.exports = function GetIntrinsic(name, allowMissing) { if (typeof name !== 'string' || name.length === 0) { throw new $TypeError('intrinsic name must be a non-empty string'); } if (arguments.length > 1 && typeof allowMissing !== 'boolean') { throw new $TypeError('"allowMissing" argument must be a boolean'); } var parts = stringToPath(name); var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); var intrinsicRealName = intrinsic.name; var value = intrinsic.value; var skipFurtherCaching = false; var alias = intrinsic.alias; if (alias) { intrinsicBaseName = alias[0]; $spliceApply(parts, $concat([0, 1], alias)); } for (var i = 1, isOwn = true; i < parts.length; i += 1) { var part = parts[i]; var first = $strSlice(part, 0, 1); var last = $strSlice(part, -1); if ((first === '"' || first === "'" || first === '`' || last === '"' || last === "'" || last === '`') && first !== last) { throw new $SyntaxError('property names with quotes must have matching quotes'); } if (part === 'constructor' || !isOwn) { skipFurtherCaching = true; } intrinsicBaseName += '.' + part; intrinsicRealName = '%' + intrinsicBaseName + '%'; if (hasOwn(INTRINSICS, intrinsicRealName)) { value = INTRINSICS[intrinsicRealName]; } else if (value != null) { if (!(part in value)) { if (!allowMissing) { throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); } return void undefined; } if ($gOPD && i + 1 >= parts.length) { var desc = $gOPD(value, part); isOwn = !!desc; // By convention, when a data property is converted to an accessor // property to emulate a data property that does not suffer from // the override mistake, that accessor's getter is marked with // an `originalValue` property. Here, when we detect this, we // uphold the illusion by pretending to see that original data // property, i.e., returning the value rather than the getter // itself. if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { value = desc.get; } else { value = value[part]; } } else { isOwn = hasOwn(value, part); value = value[part]; } if (isOwn && !skipFurtherCaching) { INTRINSICS[intrinsicRealName] = value; } } } return value; }; /***/ }), /***/ "./node_modules/google-protobuf/google-protobuf.js": /*!*********************************************************!*\ !*** ./node_modules/google-protobuf/google-protobuf.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { var $jscomp = $jscomp || {}; $jscomp.scope = {}; $jscomp.findInternal = function (a, b, c) { a instanceof String && (a = String(a)); for (var d = a.length, e = 0; e < d; e++) { var f = a[e]; if (b.call(c, f, e, a)) return { i: e, v: f }; } return { i: -1, v: void 0 }; }; $jscomp.ASSUME_ES5 = !1; $jscomp.ASSUME_NO_NATIVE_MAP = !1; $jscomp.ASSUME_NO_NATIVE_SET = !1; $jscomp.SIMPLE_FROUND_POLYFILL = !1; $jscomp.defineProperty = $jscomp.ASSUME_ES5 || "function" == typeof Object.defineProperties ? Object.defineProperty : function (a, b, c) { a != Array.prototype && a != Object.prototype && (a[b] = c.value); }; $jscomp.getGlobal = function (a) { return "undefined" != typeof window && window === a ? a : "undefined" != typeof global && null != global ? global : a; }; $jscomp.global = $jscomp.getGlobal(this); $jscomp.polyfill = function (a, b, c, d) { if (b) { c = $jscomp.global; a = a.split("."); for (d = 0; d < a.length - 1; d++) { var e = a[d]; e in c || (c[e] = {}); c = c[e]; } a = a[a.length - 1]; d = c[a]; b = b(d); b != d && null != b && $jscomp.defineProperty(c, a, { configurable: !0, writable: !0, value: b }); } }; $jscomp.polyfill("Array.prototype.findIndex", function (a) { return a ? a : function (a, c) { return $jscomp.findInternal(this, a, c).i; }; }, "es6", "es3"); $jscomp.checkStringArgs = function (a, b, c) { if (null == a) throw new TypeError("The 'this' value for String.prototype." + c + " must not be null or undefined"); if (b instanceof RegExp) throw new TypeError("First argument to String.prototype." + c + " must not be a regular expression"); return a + ""; }; $jscomp.polyfill("String.prototype.endsWith", function (a) { return a ? a : function (a, c) { var b = $jscomp.checkStringArgs(this, a, "endsWith"); a += ""; void 0 === c && (c = b.length); c = Math.max(0, Math.min(c | 0, b.length)); for (var e = a.length; 0 < e && 0 < c;) if (b[--c] != a[--e]) return !1; return 0 >= e; }; }, "es6", "es3"); $jscomp.polyfill("Array.prototype.find", function (a) { return a ? a : function (a, c) { return $jscomp.findInternal(this, a, c).v; }; }, "es6", "es3"); $jscomp.polyfill("String.prototype.startsWith", function (a) { return a ? a : function (a, c) { var b = $jscomp.checkStringArgs(this, a, "startsWith"); a += ""; var e = b.length, f = a.length; c = Math.max(0, Math.min(c | 0, b.length)); for (var g = 0; g < f && c < e;) if (b[c++] != a[g++]) return !1; return g >= f; }; }, "es6", "es3"); $jscomp.polyfill("String.prototype.repeat", function (a) { return a ? a : function (a) { var b = $jscomp.checkStringArgs(this, null, "repeat"); if (0 > a || 1342177279 < a) throw new RangeError("Invalid count value"); a |= 0; for (var d = ""; a;) if (a & 1 && (d += b), a >>>= 1) b += b; return d; }; }, "es6", "es3"); var COMPILED = !0, goog = goog || {}; goog.global = this || self; goog.isDef = function (a) { return void 0 !== a; }; goog.isString = function (a) { return "string" == typeof a; }; goog.isBoolean = function (a) { return "boolean" == typeof a; }; goog.isNumber = function (a) { return "number" == typeof a; }; goog.exportPath_ = function (a, b, c) { a = a.split("."); c = c || goog.global; a[0] in c || "undefined" == typeof c.execScript || c.execScript("var " + a[0]); for (var d; a.length && (d = a.shift());) !a.length && goog.isDef(b) ? c[d] = b : c = c[d] && c[d] !== Object.prototype[d] ? c[d] : c[d] = {}; }; goog.define = function (a, b) { if (!COMPILED) { var c = goog.global.CLOSURE_UNCOMPILED_DEFINES, d = goog.global.CLOSURE_DEFINES; c && void 0 === c.nodeType && Object.prototype.hasOwnProperty.call(c, a) ? b = c[a] : d && void 0 === d.nodeType && Object.prototype.hasOwnProperty.call(d, a) && (b = d[a]); } return b; }; goog.FEATURESET_YEAR = 2012; goog.DEBUG = !0; goog.LOCALE = "en"; goog.TRUSTED_SITE = !0; goog.STRICT_MODE_COMPATIBLE = !1; goog.DISALLOW_TEST_ONLY_CODE = COMPILED && !goog.DEBUG; goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING = !1; goog.provide = function (a) { if (goog.isInModuleLoader_()) throw Error("goog.provide cannot be used within a module."); if (!COMPILED && goog.isProvided_(a)) throw Error('Namespace "' + a + '" already declared.'); goog.constructNamespace_(a); }; goog.constructNamespace_ = function (a, b) { if (!COMPILED) { delete goog.implicitNamespaces_[a]; for (var c = a; (c = c.substring(0, c.lastIndexOf("."))) && !goog.getObjectByName(c);) goog.implicitNamespaces_[c] = !0; } goog.exportPath_(a, b); }; goog.getScriptNonce = function (a) { if (a && a != goog.global) return goog.getScriptNonce_(a.document); null === goog.cspNonce_ && (goog.cspNonce_ = goog.getScriptNonce_(goog.global.document)); return goog.cspNonce_; }; goog.NONCE_PATTERN_ = /^[\w+/_-]+[=]{0,2}$/; goog.cspNonce_ = null; goog.getScriptNonce_ = function (a) { return (a = a.querySelector && a.querySelector("script[nonce]")) && (a = a.nonce || a.getAttribute("nonce")) && goog.NONCE_PATTERN_.test(a) ? a : ""; }; goog.VALID_MODULE_RE_ = /^[a-zA-Z_$][a-zA-Z0-9._$]*$/; goog.module = function (a) { if (!goog.isString(a) || !a || -1 == a.search(goog.VALID_MODULE_RE_)) throw Error("Invalid module identifier"); if (!goog.isInGoogModuleLoader_()) throw Error("Module " + a + " has been loaded incorrectly. Note, modules cannot be loaded as normal scripts. They require some kind of pre-processing step. You're likely trying to load a module via a script tag or as a part of a concatenated bundle without rewriting the module. For more info see: https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide."); if (goog.moduleLoaderState_.moduleName) throw Error("goog.module may only be called once per module."); goog.moduleLoaderState_.moduleName = a; if (!COMPILED) { if (goog.isProvided_(a)) throw Error('Namespace "' + a + '" already declared.'); delete goog.implicitNamespaces_[a]; } }; goog.module.get = function (a) { return goog.module.getInternal_(a); }; goog.module.getInternal_ = function (a) { if (!COMPILED) { if (a in goog.loadedModules_) return goog.loadedModules_[a].exports; if (!goog.implicitNamespaces_[a]) return a = goog.getObjectByName(a), null != a ? a : null; } return null; }; goog.ModuleType = { ES6: "es6", GOOG: "goog" }; goog.moduleLoaderState_ = null; goog.isInModuleLoader_ = function () { return goog.isInGoogModuleLoader_() || goog.isInEs6ModuleLoader_(); }; goog.isInGoogModuleLoader_ = function () { return !!goog.moduleLoaderState_ && goog.moduleLoaderState_.type == goog.ModuleType.GOOG; }; goog.isInEs6ModuleLoader_ = function () { if (goog.moduleLoaderState_ && goog.moduleLoaderState_.type == goog.ModuleType.ES6) return !0; var a = goog.global.$jscomp; return a ? "function" != typeof a.getCurrentModulePath ? !1 : !!a.getCurrentModulePath() : !1; }; goog.module.declareLegacyNamespace = function () { if (!COMPILED && !goog.isInGoogModuleLoader_()) throw Error("goog.module.declareLegacyNamespace must be called from within a goog.module"); if (!COMPILED && !goog.moduleLoaderState_.moduleName) throw Error("goog.module must be called prior to goog.module.declareLegacyNamespace."); goog.moduleLoaderState_.declareLegacyNamespace = !0; }; goog.declareModuleId = function (a) { if (!COMPILED) { if (!goog.isInEs6ModuleLoader_()) throw Error("goog.declareModuleId may only be called from within an ES6 module"); if (goog.moduleLoaderState_ && goog.moduleLoaderState_.moduleName) throw Error("goog.declareModuleId may only be called once per module."); if (a in goog.loadedModules_) throw Error('Module with namespace "' + a + '" already exists.'); } if (goog.moduleLoaderState_) goog.moduleLoaderState_.moduleName = a;else { var b = goog.global.$jscomp; if (!b || "function" != typeof b.getCurrentModulePath) throw Error('Module with namespace "' + a + '" has been loaded incorrectly.'); b = b.require(b.getCurrentModulePath()); goog.loadedModules_[a] = { exports: b, type: goog.ModuleType.ES6, moduleId: a }; } }; goog.setTestOnly = function (a) { if (goog.DISALLOW_TEST_ONLY_CODE) throw a = a || "", Error("Importing test-only code into non-debug environment" + (a ? ": " + a : ".")); }; goog.forwardDeclare = function (a) {}; COMPILED || (goog.isProvided_ = function (a) { return a in goog.loadedModules_ || !goog.implicitNamespaces_[a] && goog.isDefAndNotNull(goog.getObjectByName(a)); }, goog.implicitNamespaces_ = { "goog.module": !0 }); goog.getObjectByName = function (a, b) { a = a.split("."); b = b || goog.global; for (var c = 0; c < a.length; c++) if (b = b[a[c]], !goog.isDefAndNotNull(b)) return null; return b; }; goog.globalize = function (a, b) { b = b || goog.global; for (var c in a) b[c] = a[c]; }; goog.addDependency = function (a, b, c, d) { !COMPILED && goog.DEPENDENCIES_ENABLED && goog.debugLoader_.addDependency(a, b, c, d); }; goog.ENABLE_DEBUG_LOADER = !0; goog.logToConsole_ = function (a) { goog.global.console && goog.global.console.error(a); }; goog.require = function (a) { if (!COMPILED) { goog.ENABLE_DEBUG_LOADER && goog.debugLoader_.requested(a); if (goog.isProvided_(a)) { if (goog.isInModuleLoader_()) return goog.module.getInternal_(a); } else if (goog.ENABLE_DEBUG_LOADER) { var b = goog.moduleLoaderState_; goog.moduleLoaderState_ = null; try { goog.debugLoader_.load_(a); } finally { goog.moduleLoaderState_ = b; } } return null; } }; goog.requireType = function (a) { return {}; }; goog.basePath = ""; goog.nullFunction = function () {}; goog.abstractMethod = function () { throw Error("unimplemented abstract method"); }; goog.addSingletonGetter = function (a) { a.instance_ = void 0; a.getInstance = function () { if (a.instance_) return a.instance_; goog.DEBUG && (goog.instantiatedSingletons_[goog.instantiatedSingletons_.length] = a); return a.instance_ = new a(); }; }; goog.instantiatedSingletons_ = []; goog.LOAD_MODULE_USING_EVAL = !0; goog.SEAL_MODULE_EXPORTS = goog.DEBUG; goog.loadedModules_ = {}; goog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER; goog.TRANSPILE = "detect"; goog.ASSUME_ES_MODULES_TRANSPILED = !1; goog.TRANSPILE_TO_LANGUAGE = ""; goog.TRANSPILER = "transpile.js"; goog.hasBadLetScoping = null; goog.useSafari10Workaround = function () { if (null == goog.hasBadLetScoping) { try { var a = !eval('"use strict";let x = 1; function f() { return typeof x; };f() == "number";'); } catch (b) { a = !1; } goog.hasBadLetScoping = a; } return goog.hasBadLetScoping; }; goog.workaroundSafari10EvalBug = function (a) { return "(function(){" + a + "\n;})();\n"; }; goog.loadModule = function (a) { var b = goog.moduleLoaderState_; try { goog.moduleLoaderState_ = { moduleName: "", declareLegacyNamespace: !1, type: goog.ModuleType.GOOG }; if (goog.isFunction(a)) var c = a.call(void 0, {});else if (goog.isString(a)) goog.useSafari10Workaround() && (a = goog.workaroundSafari10EvalBug(a)), c = goog.loadModuleFromSource_.call(void 0, a);else throw Error("Invalid module definition"); var d = goog.moduleLoaderState_.moduleName; if (goog.isString(d) && d) goog.moduleLoaderState_.declareLegacyNamespace ? goog.constructNamespace_(d, c) : goog.SEAL_MODULE_EXPORTS && Object.seal && "object" == typeof c && null != c && Object.seal(c), goog.loadedModules_[d] = { exports: c, type: goog.ModuleType.GOOG, moduleId: goog.moduleLoaderState_.moduleName };else throw Error('Invalid module name "' + d + '"'); } finally { goog.moduleLoaderState_ = b; } }; goog.loadModuleFromSource_ = function (a) { eval(a); return {}; }; goog.normalizePath_ = function (a) { a = a.split("/"); for (var b = 0; b < a.length;) "." == a[b] ? a.splice(b, 1) : b && ".." == a[b] && a[b - 1] && ".." != a[b - 1] ? a.splice(--b, 2) : b++; return a.join("/"); }; goog.loadFileSync_ = function (a) { if (goog.global.CLOSURE_LOAD_FILE_SYNC) return goog.global.CLOSURE_LOAD_FILE_SYNC(a); try { var b = new goog.global.XMLHttpRequest(); b.open("get", a, !1); b.send(); return 0 == b.status || 200 == b.status ? b.responseText : null; } catch (c) { return null; } }; goog.transpile_ = function (a, b, c) { var d = goog.global.$jscomp; d || (goog.global.$jscomp = d = {}); var e = d.transpile; if (!e) { var f = goog.basePath + goog.TRANSPILER, g = goog.loadFileSync_(f); if (g) { (function () { (0, eval)(g + "\n//# sourceURL=" + f); }).call(goog.global); if (goog.global.$gwtExport && goog.global.$gwtExport.$jscomp && !goog.global.$gwtExport.$jscomp.transpile) throw Error('The transpiler did not properly export the "transpile" method. $gwtExport: ' + JSON.stringify(goog.global.$gwtExport)); goog.global.$jscomp.transpile = goog.global.$gwtExport.$jscomp.transpile; d = goog.global.$jscomp; e = d.transpile; } } e || (e = d.transpile = function (a, b) { goog.logToConsole_(b + " requires transpilation but no transpiler was found."); return a; }); return e(a, b, c); }; goog.typeOf = function (a) { var b = typeof a; if ("object" == b) { if (a) { if (a instanceof Array) return "array"; if (a instanceof Object) return b; var c = Object.prototype.toString.call(a); if ("[object Window]" == c) return "object"; if ("[object Array]" == c || "number" == typeof a.length && "undefined" != typeof a.splice && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("splice")) return "array"; if ("[object Function]" == c || "undefined" != typeof a.call && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("call")) return "function"; } else return "null"; } else if ("function" == b && "undefined" == typeof a.call) return "object"; return b; }; goog.isNull = function (a) { return null === a; }; goog.isDefAndNotNull = function (a) { return null != a; }; goog.isArray = function (a) { return "array" == goog.typeOf(a); }; goog.isArrayLike = function (a) { var b = goog.typeOf(a); return "array" == b || "object" == b && "number" == typeof a.length; }; goog.isDateLike = function (a) { return goog.isObject(a) && "function" == typeof a.getFullYear; }; goog.isFunction = function (a) { return "function" == goog.typeOf(a); }; goog.isObject = function (a) { var b = typeof a; return "object" == b && null != a || "function" == b; }; goog.getUid = function (a) { return a[goog.UID_PROPERTY_] || (a[goog.UID_PROPERTY_] = ++goog.uidCounter_); }; goog.hasUid = function (a) { return !!a[goog.UID_PROPERTY_]; }; goog.removeUid = function (a) { null !== a && "removeAttribute" in a && a.removeAttribute(goog.UID_PROPERTY_); try { delete a[goog.UID_PROPERTY_]; } catch (b) {} }; goog.UID_PROPERTY_ = "closure_uid_" + (1E9 * Math.random() >>> 0); goog.uidCounter_ = 0; goog.getHashCode = goog.getUid; goog.removeHashCode = goog.removeUid; goog.cloneObject = function (a) { var b = goog.typeOf(a); if ("object" == b || "array" == b) { if ("function" === typeof a.clone) return a.clone(); b = "array" == b ? [] : {}; for (var c in a) b[c] = goog.cloneObject(a[c]); return b; } return a; }; goog.bindNative_ = function (a, b, c) { return a.call.apply(a.bind, arguments); }; goog.bindJs_ = function (a, b, c) { if (!a) throw Error(); if (2 < arguments.length) { var d = Array.prototype.slice.call(arguments, 2); return function () { var c = Array.prototype.slice.call(arguments); Array.prototype.unshift.apply(c, d); return a.apply(b, c); }; } return function () { return a.apply(b, arguments); }; }; goog.bind = function (a, b, c) { Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("native code") ? goog.bind = goog.bindNative_ : goog.bind = goog.bindJs_; return goog.bind.apply(null, arguments); }; goog.partial = function (a, b) { var c = Array.prototype.slice.call(arguments, 1); return function () { var b = c.slice(); b.push.apply(b, arguments); return a.apply(this, b); }; }; goog.mixin = function (a, b) { for (var c in b) a[c] = b[c]; }; goog.now = goog.TRUSTED_SITE && Date.now || function () { return +new Date(); }; goog.globalEval = function (a) { if (goog.global.execScript) goog.global.execScript(a, "JavaScript");else if (goog.global.eval) { if (null == goog.evalWorksForGlobals_) { try { goog.global.eval("var _evalTest_ = 1;"); } catch (d) {} if ("undefined" != typeof goog.global._evalTest_) { try { delete goog.global._evalTest_; } catch (d) {} goog.evalWorksForGlobals_ = !0; } else goog.evalWorksForGlobals_ = !1; } if (goog.evalWorksForGlobals_) goog.global.eval(a);else { var b = goog.global.document, c = b.createElement("SCRIPT"); c.type = "text/javascript"; c.defer = !1; c.appendChild(b.createTextNode(a)); b.head.appendChild(c); b.head.removeChild(c); } } else throw Error("goog.globalEval not available"); }; goog.evalWorksForGlobals_ = null; goog.getCssName = function (a, b) { if ("." == String(a).charAt(0)) throw Error('className passed in goog.getCssName must not start with ".". You passed: ' + a); var c = function (a) { return goog.cssNameMapping_[a] || a; }, d = function (a) { a = a.split("-"); for (var b = [], d = 0; d < a.length; d++) b.push(c(a[d])); return b.join("-"); }; d = goog.cssNameMapping_ ? "BY_WHOLE" == goog.cssNameMappingStyle_ ? c : d : function (a) { return a; }; a = b ? a + "-" + d(b) : d(a); return goog.global.CLOSURE_CSS_NAME_MAP_FN ? goog.global.CLOSURE_CSS_NAME_MAP_FN(a) : a; }; goog.setCssNameMapping = function (a, b) { goog.cssNameMapping_ = a; goog.cssNameMappingStyle_ = b; }; !COMPILED && goog.global.CLOSURE_CSS_NAME_MAPPING && (goog.cssNameMapping_ = goog.global.CLOSURE_CSS_NAME_MAPPING); goog.getMsg = function (a, b, c) { c && c.html && (a = a.replace(/{"use strict";class X{constructor(){if(new.target!=String)throw 1;this.x=42}}let q=Reflect.construct(X,[],String);if(q.x!=42||!(q instanceof String))throw 1;for(const a of[2,3]){if(a==2)continue;function f(z={a}){let a=0;return z.a}{function f(){return 0;}}return f()==3}})()'); }); a("es7", function () { return b("2 ** 2 == 4"); }); a("es8", function () { return b("async () => 1, true"); }); a("es9", function () { return b("({...rest} = {}), true"); }); a("es_next", function () { return !1; }); return { target: c, map: d }; }, goog.Transpiler.prototype.needsTranspile = function (a, b) { if ("always" == goog.TRANSPILE) return !0; if ("never" == goog.TRANSPILE) return !1; if (!this.requiresTranspilation_) { var c = this.createRequiresTranspilation_(); this.requiresTranspilation_ = c.map; this.transpilationTarget_ = this.transpilationTarget_ || c.target; } if (a in this.requiresTranspilation_) return this.requiresTranspilation_[a] ? !0 : !goog.inHtmlDocument_() || "es6" != b || "noModule" in goog.global.document.createElement("script") ? !1 : !0; throw Error("Unknown language mode: " + a); }, goog.Transpiler.prototype.transpile = function (a, b) { return goog.transpile_(a, b, this.transpilationTarget_); }, goog.transpiler_ = new goog.Transpiler(), goog.protectScriptTag_ = function (a) { return a.replace(/<\/(SCRIPT)/ig, "\\x3c/$1"); }, goog.DebugLoader_ = function () { this.dependencies_ = {}; this.idToPath_ = {}; this.written_ = {}; this.loadingDeps_ = []; this.depsToLoad_ = []; this.paused_ = !1; this.factory_ = new goog.DependencyFactory(goog.transpiler_); this.deferredCallbacks_ = {}; this.deferredQueue_ = []; }, goog.DebugLoader_.prototype.bootstrap = function (a, b) { function c() { d && (goog.global.setTimeout(d, 0), d = null); } var d = b; if (a.length) { b = []; for (var e = 0; e < a.length; e++) { var f = this.getPathFromDeps_(a[e]); if (!f) throw Error("Unregonized namespace: " + a[e]); b.push(this.dependencies_[f]); } f = goog.require; var g = 0; for (e = 0; e < a.length; e++) f(a[e]), b[e].onLoad(function () { ++g == a.length && c(); }); } else c(); }, goog.DebugLoader_.prototype.loadClosureDeps = function () { this.depsToLoad_.push(this.factory_.createDependency(goog.normalizePath_(goog.basePath + "deps.js"), "deps.js", [], [], {}, !1)); this.loadDeps_(); }, goog.DebugLoader_.prototype.requested = function (a, b) { (a = this.getPathFromDeps_(a)) && (b || this.areDepsLoaded_(this.dependencies_[a].requires)) && (b = this.deferredCallbacks_[a]) && (delete this.deferredCallbacks_[a], b()); }, goog.DebugLoader_.prototype.setDependencyFactory = function (a) { this.factory_ = a; }, goog.DebugLoader_.prototype.load_ = function (a) { if (this.getPathFromDeps_(a)) { var b = this, c = [], d = function (a) { var e = b.getPathFromDeps_(a); if (!e) throw Error("Bad dependency path or symbol: " + a); if (!b.written_[e]) { b.written_[e] = !0; a = b.dependencies_[e]; for (e = 0; e < a.requires.length; e++) goog.isProvided_(a.requires[e]) || d(a.requires[e]); c.push(a); } }; d(a); a = !!this.depsToLoad_.length; this.depsToLoad_ = this.depsToLoad_.concat(c); this.paused_ || a || this.loadDeps_(); } else throw a = "goog.require could not find: " + a, goog.logToConsole_(a), Error(a); }, goog.DebugLoader_.prototype.loadDeps_ = function () { for (var a = this, b = this.paused_; this.depsToLoad_.length && !b;) (function () { var c = !1, d = a.depsToLoad_.shift(), e = !1; a.loading_(d); var f = { pause: function () { if (c) throw Error("Cannot call pause after the call to load."); b = !0; }, resume: function () { c ? a.resume_() : b = !1; }, loaded: function () { if (e) throw Error("Double call to loaded."); e = !0; a.loaded_(d); }, pending: function () { for (var b = [], c = 0; c < a.loadingDeps_.length; c++) b.push(a.loadingDeps_[c]); return b; }, setModuleState: function (a) { goog.moduleLoaderState_ = { type: a, moduleName: "", declareLegacyNamespace: !1 }; }, registerEs6ModuleExports: function (a, b, c) { c && (goog.loadedModules_[c] = { exports: b, type: goog.ModuleType.ES6, moduleId: c || "" }); }, registerGoogModuleExports: function (a, b) { goog.loadedModules_[a] = { exports: b, type: goog.ModuleType.GOOG, moduleId: a }; }, clearModuleState: function () { goog.moduleLoaderState_ = null; }, defer: function (b) { if (c) throw Error("Cannot register with defer after the call to load."); a.defer_(d, b); }, areDepsLoaded: function () { return a.areDepsLoaded_(d.requires); } }; try { d.load(f); } finally { c = !0; } })(); b && this.pause_(); }, goog.DebugLoader_.prototype.pause_ = function () { this.paused_ = !0; }, goog.DebugLoader_.prototype.resume_ = function () { this.paused_ && (this.paused_ = !1, this.loadDeps_()); }, goog.DebugLoader_.prototype.loading_ = function (a) { this.loadingDeps_.push(a); }, goog.DebugLoader_.prototype.loaded_ = function (a) { for (var b = 0; b < this.loadingDeps_.length; b++) if (this.loadingDeps_[b] == a) { this.loadingDeps_.splice(b, 1); break; } for (b = 0; b < this.deferredQueue_.length; b++) if (this.deferredQueue_[b] == a.path) { this.deferredQueue_.splice(b, 1); break; } if (this.loadingDeps_.length == this.deferredQueue_.length && !this.depsToLoad_.length) for (; this.deferredQueue_.length;) this.requested(this.deferredQueue_.shift(), !0); a.loaded(); }, goog.DebugLoader_.prototype.areDepsLoaded_ = function (a) { for (var b = 0; b < a.length; b++) { var c = this.getPathFromDeps_(a[b]); if (!c || !(c in this.deferredCallbacks_ || goog.isProvided_(a[b]))) return !1; } return !0; }, goog.DebugLoader_.prototype.getPathFromDeps_ = function (a) { return a in this.idToPath_ ? this.idToPath_[a] : a in this.dependencies_ ? a : null; }, goog.DebugLoader_.prototype.defer_ = function (a, b) { this.deferredCallbacks_[a.path] = b; this.deferredQueue_.push(a.path); }, goog.LoadController = function () {}, goog.LoadController.prototype.pause = function () {}, goog.LoadController.prototype.resume = function () {}, goog.LoadController.prototype.loaded = function () {}, goog.LoadController.prototype.pending = function () {}, goog.LoadController.prototype.registerEs6ModuleExports = function (a, b, c) {}, goog.LoadController.prototype.setModuleState = function (a) {}, goog.LoadController.prototype.clearModuleState = function () {}, goog.LoadController.prototype.defer = function (a) {}, goog.LoadController.prototype.areDepsLoaded = function () {}, goog.Dependency = function (a, b, c, d, e) { this.path = a; this.relativePath = b; this.provides = c; this.requires = d; this.loadFlags = e; this.loaded_ = !1; this.loadCallbacks_ = []; }, goog.Dependency.prototype.getPathName = function () { var a = this.path, b = a.indexOf("://"); 0 <= b && (a = a.substring(b + 3), b = a.indexOf("/"), 0 <= b && (a = a.substring(b + 1))); return a; }, goog.Dependency.prototype.onLoad = function (a) { this.loaded_ ? a() : this.loadCallbacks_.push(a); }, goog.Dependency.prototype.loaded = function () { this.loaded_ = !0; var a = this.loadCallbacks_; this.loadCallbacks_ = []; for (var b = 0; b < a.length; b++) a[b](); }, goog.Dependency.defer_ = !1, goog.Dependency.callbackMap_ = {}, goog.Dependency.registerCallback_ = function (a) { var b = Math.random().toString(32); goog.Dependency.callbackMap_[b] = a; return b; }, goog.Dependency.unregisterCallback_ = function (a) { delete goog.Dependency.callbackMap_[a]; }, goog.Dependency.callback_ = function (a, b) { if (a in goog.Dependency.callbackMap_) { for (var c = goog.Dependency.callbackMap_[a], d = [], e = 1; e < arguments.length; e++) d.push(arguments[e]); c.apply(void 0, d); } else throw Error("Callback key " + a + " does not exist (was base.js loaded more than once?)."); }, goog.Dependency.prototype.load = function (a) { if (goog.global.CLOSURE_IMPORT_SCRIPT) goog.global.CLOSURE_IMPORT_SCRIPT(this.path) ? a.loaded() : a.pause();else if (goog.inHtmlDocument_()) { var b = goog.global.document; if ("complete" == b.readyState && !goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING) { if (/\bdeps.js$/.test(this.path)) { a.loaded(); return; } throw Error('Cannot write "' + this.path + '" after document load'); } if (!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING && goog.isDocumentLoading_()) { var c = goog.Dependency.registerCallback_(function (b) { goog.DebugLoader_.IS_OLD_IE_ && "complete" != b.readyState || (goog.Dependency.unregisterCallback_(c), a.loaded()); }), d = !goog.DebugLoader_.IS_OLD_IE_ && goog.getScriptNonce() ? ' nonce="' + goog.getScriptNonce() + '"' : ""; d = '