diff --git a/packages/api/app/bundle.api.js b/packages/api/app/bundle.api.js
index 0bd2fe4..c77f461 100644
--- a/packages/api/app/bundle.api.js
+++ b/packages/api/app/bundle.api.js
@@ -100,1452 +100,6 @@ module.exports =
/************************************************************************/
/******/ ({
-/***/ "./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 ***!
@@ -2652,6 +1206,17 @@ class DateAdapterBase {
static fromDateTime(_datetime) {
throw unimplementedError('fromDateTime()');
}
+ /**
+ * Returns a string in simplified extended ISO format (ISO 8601).
+ *
+ * _Note: this method is intended for testing and its
+ * implementation isn't particularly performant._
+ */
+
+
+ toISOString() {
+ return this.set('timezone', 'UTC').toDateTime().toISOString();
+ }
toDateTime() {
const date = DateTime.fromJSON(Object.assign(Object.assign({}, this.toJSON()), {
@@ -4653,6 +3218,17 @@ class DateAdapterBase {
static fromDateTime(_datetime) {
throw unimplementedError('fromDateTime()');
}
+ /**
+ * Returns a string in simplified extended ISO format (ISO 8601).
+ *
+ * _Note: this method is intended for testing and its
+ * implementation isn't particularly performant._
+ */
+
+
+ toISOString() {
+ return this.set('timezone', 'UTC').toDateTime().toISOString();
+ }
toDateTime() {
const date = DateTime.fromJSON(Object.assign(Object.assign({}, this.toJSON()), {
@@ -6886,10 +5462,6 @@ function serializeDataToJSON(gen, json, opt) {
}
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);
}
@@ -6999,10 +5571,6 @@ class StandardDateAdapter extends _rschedule_core__WEBPACK_IMPORTED_MODULE_0__["
return this._date.valueOf();
}
- toISOString() {
- return this._date.toISOString();
- }
-
toJSON() {
let json;
@@ -10750,175 +9318,6 @@ options) {
/***/ }),
-/***/ "./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 ***!
@@ -10929,12 +9328,19 @@ module.exports = function shimArrayPrototypeMap() {
"use strict";
-var filter = __webpack_require__(/*! array.prototype.filter */ "./node_modules/array.prototype.filter/index.js");
+var possibleNames = ['BigInt64Array', 'BigUint64Array', 'Float32Array', 'Float64Array', 'Int16Array', 'Int32Array', 'Int8Array', 'Uint16Array', 'Uint32Array', 'Uint8Array', 'Uint8ClampedArray'];
+var g = typeof globalThis === 'undefined' ? global : globalThis;
module.exports = function availableTypedArrays() {
- return filter(['BigInt64Array', 'BigUint64Array', 'Float32Array', 'Float64Array', 'Int16Array', 'Int32Array', 'Int8Array', 'Uint16Array', 'Uint32Array', 'Uint8Array', 'Uint8ClampedArray'], function (typedArray) {
- return typeof global[typedArray] === 'function';
- });
+ var out = [];
+
+ for (var i = 0; i < possibleNames.length; i++) {
+ if (typeof g[possibleNames[i]] === 'function') {
+ out[out.length] = possibleNames[i];
+ }
+ }
+
+ return out;
};
/***/ }),
@@ -11175,15 +9581,33 @@ class ResizeableBuffer {
}
prepend(val) {
- const length = this.length++;
+ if (Buffer.isBuffer(val)) {
+ const length = this.length + val.length;
- if (length === this.size) {
- this.resize();
+ if (length >= this.size) {
+ this.resize();
+
+ if (length >= this.size) {
+ throw Error('INVALID_BUFFER_STATE');
+ }
+ }
+
+ const buf = this.buf;
+ this.buf = Buffer.alloc(this.size);
+ val.copy(this.buf, 0);
+ buf.copy(this.buf, val.length);
+ this.length += val.length;
+ } else {
+ 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);
}
-
- const buf = this.clone();
- this.buf[0] = val;
- buf.copy(this.buf, 1, 0, length);
}
append(val) {
@@ -11208,12 +9632,16 @@ class ResizeableBuffer {
this.buf = buf;
}
- toString() {
- return this.buf.slice(0, this.length).toString();
+ toString(encoding) {
+ if (encoding) {
+ return this.buf.slice(0, this.length).toString(encoding);
+ } else {
+ return Uint8Array.prototype.slice.call(this.buf.slice(0, this.length));
+ }
}
toJSON() {
- return this.toString();
+ return this.toString('utf8');
}
reset() {
@@ -11260,31 +9688,66 @@ additional information.
const _require = __webpack_require__(/*! stream */ "stream"),
Transform = _require.Transform;
-const ResizeableBuffer = __webpack_require__(/*! ./ResizeableBuffer */ "./node_modules/csv-parse/lib/ResizeableBuffer.js");
+const ResizeableBuffer = __webpack_require__(/*! ./ResizeableBuffer */ "./node_modules/csv-parse/lib/ResizeableBuffer.js"); // white space characters
+// https://en.wikipedia.org/wiki/Whitespace_character
+// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Character_Classes#Types
+// \f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff
+
const tab = 9;
-const nl = 10;
+const nl = 10; // \n, 0x0A in hexadecimal, 10 in decimal
+
const np = 12;
-const cr = 13;
+const cr = 13; // \r, 0x0D in hexadécimal, 13 in decimal
+
const space = 32;
-const bom_utf8 = Buffer.from([239, 187, 191]);
+const boms = {
+ // Note, the following are equals:
+ // Buffer.from("\ufeff")
+ // Buffer.from([239, 187, 191])
+ // Buffer.from('EFBBBF', 'hex')
+ 'utf8': Buffer.from([239, 187, 191]),
+ // Note, the following are equals:
+ // Buffer.from "\ufeff", 'utf16le
+ // Buffer.from([255, 254])
+ 'utf16le': Buffer.from([255, 254])
+};
class Parser extends Transform {
constructor(opts = {}) {
- super(_objectSpread(_objectSpread({}, {
+ super(_objectSpread(_objectSpread(_objectSpread({}, {
readableObjectMode: true
- }), opts));
+ }), opts), {}, {
+ encoding: null
+ }));
+ this.__originalOptions = opts;
+
+ this.__normalizeOptions(opts);
+ }
+
+ __normalizeOptions(opts) {
const options = {}; // Merge with user options
for (let opt in opts) {
options[underscore(opt)] = opts[opt];
+ } // Normalize option `encoding`
+ // Note: defined first because other options depends on it
+ // to convert chars/strings into buffers.
+
+
+ if (options.encoding === undefined || options.encoding === true) {
+ options.encoding = 'utf8';
+ } else if (options.encoding === null || options.encoding === false) {
+ options.encoding = null;
+ } else if (typeof options.encoding !== 'string' && options.encoding !== null) {
+ throw new CsvError('CSV_INVALID_OPTION_ENCODING', ['Invalid option encoding:', 'encoding must be a string or null to return a buffer,', `got ${JSON.stringify(options.encoding)}`], options);
} // 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)}`]);
+ throw new CsvError('CSV_INVALID_OPTION_BOM', ['Invalid option bom:', 'bom must be true,', `got ${JSON.stringify(options.bom)}`], options);
} // Normalize option `cast`
@@ -11296,7 +9759,7 @@ class Parser extends Transform {
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)}`]);
+ throw new CsvError('CSV_INVALID_OPTION_CAST', ['Invalid option cast:', 'cast must be true or a function,', `got ${JSON.stringify(options.cast)}`], options);
} // Normalize option `cast_date`
@@ -11307,8 +9770,8 @@ class Parser extends Transform {
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)}`]);
+ } else {
+ 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)}`], options);
} // Normalize option `columns`
@@ -11325,14 +9788,16 @@ class Parser extends Transform {
} 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)}`]);
+ throw new CsvError('CSV_INVALID_OPTION_COLUMNS', ['Invalid option columns:', 'expect an array, a function or true,', `got ${JSON.stringify(options.columns)}`], options);
} // 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)}`]);
+ 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)}`], options);
+ } else if (options.columns === false) {
+ throw new CsvError('CSV_INVALID_OPTION_COLUMNS_DUPLICATES_TO_ARRAY', ['Invalid option columns_duplicates_to_array:', 'the `columns` mode must be activated.'], options);
} // Normalize option `comment`
@@ -11340,11 +9805,11 @@ class Parser extends Transform {
options.comment = null;
} else {
if (typeof options.comment === 'string') {
- options.comment = Buffer.from(options.comment);
+ options.comment = Buffer.from(options.comment, options.encoding);
}
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)}`]);
+ throw new CsvError('CSV_INVALID_OPTION_COMMENT', ['Invalid option comment:', 'comment must be a buffer or a string,', `got ${JSON.stringify(options.comment)}`], options);
}
} // Normalize option `delimiter`
@@ -11353,37 +9818,37 @@ class Parser extends Transform {
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}`]);
+ 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);
}
options.delimiter = options.delimiter.map(function (delimiter) {
if (delimiter === undefined || delimiter === null || delimiter === false) {
- return Buffer.from(',');
+ return Buffer.from(',', options.encoding);
}
if (typeof delimiter === 'string') {
- delimiter = Buffer.from(delimiter);
+ delimiter = Buffer.from(delimiter, options.encoding);
}
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}`]);
+ 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);
}
return delimiter;
}); // Normalize option `escape`
- if (options.escape === undefined || options.escape === null) {
- options.escape = Buffer.from('"');
+ if (options.escape === undefined || options.escape === true) {
+ options.escape = Buffer.from('"', options.encoding);
} else if (typeof options.escape === 'string') {
- options.escape = Buffer.from(options.escape);
+ options.escape = Buffer.from(options.escape, options.encoding);
+ } else if (options.escape === null || options.escape === false) {
+ options.escape = null;
}
- 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];
+ if (options.escape !== null) {
+ if (!Buffer.isBuffer(options.escape)) {
+ throw new Error(`Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(options.escape)}`);
+ }
} // Normalize option `from`
@@ -11418,6 +9883,23 @@ class Parser extends Transform {
} else {
throw new Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify(opts.from_line)}`);
}
+ } // Normalize options `ignore_last_delimiters`
+
+
+ if (options.ignore_last_delimiters === undefined || options.ignore_last_delimiters === null) {
+ options.ignore_last_delimiters = false;
+ } else if (typeof options.ignore_last_delimiters === 'number') {
+ options.ignore_last_delimiters = Math.floor(options.ignore_last_delimiters);
+
+ if (options.ignore_last_delimiters === 0) {
+ options.ignore_last_delimiters = false;
+ }
+ } else if (typeof options.ignore_last_delimiters !== 'boolean') {
+ throw new CsvError('CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS', ['Invalid option `ignore_last_delimiters`:', 'the value must be a boolean value or an integer,', `got ${JSON.stringify(options.ignore_last_delimiters)}`], options);
+ }
+
+ if (options.ignore_last_delimiters === true && options.columns === false) {
+ throw new CsvError('CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS', ['The option `ignore_last_delimiters`', 'requires the activation of the `columns` option'], options);
} // Normalize option `info`
@@ -11445,7 +9927,10 @@ class Parser extends Transform {
throw new Error(`Invalid Option: objname must be a non empty buffer`);
}
- options.objname = options.objname.toString();
+ if (options.encoding === null) {// Don't call `toString`, leave objname as a buffer
+ } else {
+ options.objname = options.objname.toString(options.encoding);
+ }
} else if (typeof options.objname === 'string') {
if (options.objname.length === 0) {
throw new Error(`Invalid Option: objname must be a non empty string`);
@@ -11459,7 +9944,7 @@ class Parser extends Transform {
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)}`]);
+ throw new CsvError('CSV_INVALID_OPTION_ON_RECORD', ['Invalid option `on_record`:', 'expect a function,', `got ${JSON.stringify(options.on_record)}`], options);
} // Normalize option `quote`
@@ -11467,17 +9952,13 @@ class Parser extends Transform {
options.quote = null;
} else {
if (options.quote === undefined || options.quote === true) {
- options.quote = Buffer.from('"');
+ options.quote = Buffer.from('"', options.encoding);
} else if (typeof options.quote === 'string') {
- options.quote = Buffer.from(options.quote);
+ options.quote = Buffer.from(options.quote, options.encoding);
}
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`
@@ -11497,7 +9978,7 @@ class Parser extends Transform {
options.record_delimiter = options.record_delimiter.map(function (rd) {
if (typeof rd === 'string') {
- rd = Buffer.from(rd);
+ rd = Buffer.from(rd, options.encoding);
}
return rd;
@@ -11625,6 +10106,7 @@ class Parser extends Transform {
}
this.info = {
+ bytes: 0,
comment_lines: 0,
empty_lines: 0,
invalid_field_length: 0,
@@ -11634,15 +10116,23 @@ class Parser extends Transform {
this.options = options;
this.state = {
bomSkipped: false,
+ bufBytesStart: 0,
castField: fnCastField,
commenting: false,
+ // Current error encountered by a record
+ error: undefined,
enabled: options.from_line === 1,
escaping: false,
- escapeIsQuote: options.escape === options.quote,
- expectedRecordLength: options.columns === null ? 0 : options.columns.length,
+ // escapeIsQuote: options.escape === options.quote,
+ escapeIsQuote: Buffer.isBuffer(options.escape) && Buffer.isBuffer(options.quote) && Buffer.compare(options.escape, options.quote) === 0,
+ // columns can be `false`, `true`, `Array`
+ expectedRecordLength: Array.isArray(options.columns) ? options.columns.length : undefined,
field: new ResizeableBuffer(20),
firstLineToHeaders: fnFirstLineToHeaders,
- info: Object.assign({}, this.info),
+ needMoreDataSize: Math.max( // Skip if the remaining buffer smaller than comment
+ options.comment !== null ? options.comment.length : 0, // Skip if the remaining buffer can be delimiter
+ ...options.delimiter.map(delimiter => delimiter.length), // Skip if the remaining buffer can be escape sequence
+ options.quote !== null ? options.quote.length : 0),
previousBuf: undefined,
quoting: false,
stop: false,
@@ -11651,7 +10141,7 @@ class Parser extends Transform {
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]],
+ trimChars: [Buffer.from(' ', options.encoding)[0], Buffer.from('\t', options.encoding)[0]],
wasQuoting: false,
wasRowDelimiter: false
};
@@ -11690,7 +10180,6 @@ class Parser extends Transform {
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,
@@ -11732,12 +10221,21 @@ class Parser extends Transform {
// 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);
+ for (let encoding in boms) {
+ if (boms[encoding].compare(buf, 0, boms[encoding].length) === 0) {
+ // Skip BOM
+ let bomLength = boms[encoding].length;
+ this.state.bufBytesStart += bomLength;
+ buf = buf.slice(bomLength); // Renormalize original options with the new encoding
+
+ this.__normalizeOptions(_objectSpread(_objectSpread({}, this.__originalOptions), {}, {
+ encoding: encoding
+ }));
+
+ break;
+ }
}
this.state.bomSkipped = true;
@@ -11756,11 +10254,6 @@ class Parser extends Transform {
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;
}
@@ -11772,7 +10265,7 @@ class Parser extends Transform {
if (this.state.quoting === false && record_delimiter.length === 0) {
- const record_delimiterCount = this.__autoDiscoverRowDelimiter(buf, pos);
+ const record_delimiterCount = this.__autoDiscoverRecordDelimiter(buf, pos);
if (record_delimiterCount) {
record_delimiter = this.options.record_delimiter;
@@ -11796,56 +10289,58 @@ class Parser extends Transform {
} 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(escape !== null && this.state.quoting === true && chr === escape && pos + 1 < bufLen){
+ if (escape !== null && this.state.quoting === true && this.__isEscape(buf, pos, chr) && pos + escape.length < bufLen) {
if (escapeIsQuote) {
- if (buf[pos + 1] === quote) {
+ if (this.__isQuote(buf, pos + escape.length)) {
this.state.escaping = true;
+ pos += escape.length - 1;
continue;
}
} else {
this.state.escaping = true;
+ pos += escape.length - 1;
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.commenting === false && this.__isQuote(buf, pos)) {
if (this.state.quoting === true) {
- const nextChr = buf[pos + 1];
+ const nextChr = buf[pos + quote.length];
- const isNextChrTrimable = rtrim && this.__isCharTrimable(nextChr); // const isNextChrComment = nextChr === comment
+ const isNextChrTrimable = rtrim && this.__isCharTrimable(nextChr);
+ const isNextChrComment = comment !== null && this.__compareBytes(comment, buf, pos + quote.length, nextChr);
- const isNextChrComment = comment !== null && this.__compareBytes(comment, buf, pos + 1, nextChr);
+ const isNextChrDelimiter = this.__isDelimiter(buf, pos + quote.length, 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
+ const isNextChrRecordDelimiter = record_delimiter.length === 0 ? this.__autoDiscoverRecordDelimiter(buf, pos + quote.length) : this.__isRecordDelimiter(nextChr, buf, pos + quote.length); // 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) {
+ if (escape !== null && this.__isEscape(buf, pos, chr) && this.__isQuote(buf, pos + escape.length)) {
+ pos += escape.length - 1;
+ } else if (!nextChr || isNextChrDelimiter || isNextChrRecordDelimiter || isNextChrComment || isNextChrTrimable) {
this.state.quoting = false;
this.state.wasQuoting = true;
+ pos += quote.length - 1;
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()));
+ 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, record delimiter, trimable character', '(if activated) or comment'], this.options, this.__infoField()));
if (err !== undefined) return err;
} else {
this.state.quoting = false;
- this.state.wasQuoting = true; // continue
-
+ this.state.wasQuoting = true;
this.state.field.prepend(quote);
+ pos += quote.length - 1;
}
} 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(), {
+ 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.options, this.__infoField(), {
field: this.state.field
}));
@@ -11853,6 +10348,7 @@ class Parser extends Transform {
}
} else {
this.state.quoting = true;
+ pos += quote.length - 1;
continue;
}
}
@@ -11868,33 +10364,36 @@ class Parser extends Transform {
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
-
-
+ // 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();
+ this.__resetRecord();
pos += recordDelimiterLength - 1;
continue;
- } else {
- const errField = this.__onField();
+ } // Skip if line is empty and skip_empty_lines activated
- if (errField !== undefined) return errField;
- const errRecord = this.__onRow();
-
- if (errRecord !== undefined) return errRecord;
+ 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;
}
+ this.info.bytes = this.state.bufBytesStart + pos;
+
+ const errField = this.__onField();
+
+ if (errField !== undefined) return errField;
+ this.info.bytes = this.state.bufBytesStart + pos + recordDelimiterLength;
+
+ const errRecord = this.__onRecord();
+
+ if (errRecord !== undefined) return errRecord;
+
if (to !== -1 && this.info.records >= to) {
this.state.stop = true;
this.push(null);
@@ -11918,9 +10417,11 @@ class Parser extends Transform {
continue;
}
- let delimiterLength = this.__isDelimiter(chr, buf, pos);
+ let delimiterLength = this.__isDelimiter(buf, pos, chr);
if (delimiterLength !== 0) {
+ this.info.bytes = this.state.bufBytesStart + pos;
+
const errField = this.__onField();
if (errField !== undefined) return errField;
@@ -11932,7 +10433,7 @@ class Parser extends Transform {
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()));
+ 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.options, this.__infoField()));
if (err !== undefined) return err;
}
@@ -11945,7 +10446,7 @@ class Parser extends Transform {
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()));
+ 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.options, this.__infoField()));
if (err !== undefined) return err;
}
@@ -11954,17 +10455,19 @@ class Parser extends Transform {
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()));
+ 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.options, this.__infoField()));
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) {
+ this.info.bytes = this.state.bufBytesStart + pos;
+
const errField = this.__onField();
if (errField !== undefined) return errField;
- const errRecord = this.__onRow();
+ const errRecord = this.__onRecord();
if (errRecord !== undefined) return errRecord;
} else if (this.state.wasRowDelimiter === true) {
@@ -11974,6 +10477,7 @@ class Parser extends Transform {
}
}
} else {
+ this.state.bufBytesStart += pos;
this.state.previousBuf = buf.slice(pos);
}
@@ -11981,17 +10485,13 @@ class Parser extends Transform {
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() {
+ __onRecord() {
const _this$options2 = this.options,
columns = _this$options2.columns,
columns_duplicates_to_array = _this$options2.columns_duplicates_to_array,
+ encoding = _this$options2.encoding,
info = _this$options2.info,
from = _this$options2.from,
relax_column_count = _this$options2.relax_column_count,
@@ -12004,15 +10504,15 @@ class Parser extends Transform {
record = _this$state2.record;
if (enabled === false) {
- return this.__resetRow();
+ return this.__resetRecord();
} // Convert the first line into column names
const recordLength = record.length;
if (columns === true) {
- if (isRecordEmpty(record)) {
- this.__resetRow();
+ if (skip_lines_with_empty_values === true && isRecordEmpty(record)) {
+ this.__resetRecord();
return;
}
@@ -12025,37 +10525,35 @@ class Parser extends Transform {
}
if (recordLength !== this.state.expectedRecordLength) {
+ const err = columns === false ? // Todo: rename CSV_INCONSISTENT_RECORD_LENGTH to
+ // CSV_RECORD_INCONSISTENT_FIELDS_LENGTH
+ new CsvError('CSV_INCONSISTENT_RECORD_LENGTH', ['Invalid Record Length:', `expect ${this.state.expectedRecordLength},`, `got ${recordLength} on line ${this.info.lines}`], this.options, this.__infoField(), {
+ record: record
+ }) : // Todo: rename CSV_RECORD_DONT_MATCH_COLUMNS_LENGTH to
+ // CSV_RECORD_INCONSISTENT_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.options, this.__infoField(), {
+ record: record
+ });
+
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++;
+ this.state.error = err; // Error is undefined with skip_lines_with_error
} 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
- }));
+ const finalErr = this.__error(err);
- 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 (finalErr) return finalErr;
}
}
- if (skip_lines_with_empty_values === true) {
- if (isRecordEmpty(record)) {
- this.__resetRow();
+ if (skip_lines_with_empty_values === true && isRecordEmpty(record)) {
+ this.__resetRecord();
- return;
- }
+ return;
}
if (this.state.recordHasError === true) {
- this.__resetRow();
+ this.__resetRecord();
this.state.recordHasError = false;
return;
@@ -12064,14 +10562,14 @@ class Parser extends Transform {
this.info.records++;
if (from === 1 || this.info.records >= from) {
+ // With columns, records are object
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[i] === undefined || columns[i].disabled) continue; // Turn duplicate columns into an array
- if (columns_duplicates_to_array === true && obj[columns[i].name]) {
+ if (columns_duplicates_to_array === true && obj[columns[i].name] !== undefined) {
if (Array.isArray(obj[columns[i].name])) {
obj[columns[i].name] = obj[columns[i].name].concat(record[i]);
} else {
@@ -12082,16 +10580,16 @@ class Parser extends Transform {
}
}
- const objname = this.options.objname;
+ const objname = this.options.objname; // Without objname (default)
if (objname === undefined) {
if (raw === true || info === true) {
const err = this.__push(Object.assign({
record: obj
}, raw === true ? {
- raw: this.state.rawBuffer.toString()
+ raw: this.state.rawBuffer.toString(encoding)
} : {}, info === true ? {
- info: this.state.info
+ info: this.__infoRecord()
} : {}));
if (err) {
@@ -12103,15 +10601,16 @@ class Parser extends Transform {
if (err) {
return err;
}
- }
+ } // With objname (default)
+
} else {
if (raw === true || info === true) {
const err = this.__push(Object.assign({
record: [obj[objname], obj]
}, raw === true ? {
- raw: this.state.rawBuffer.toString()
+ raw: this.state.rawBuffer.toString(encoding)
} : {}, info === true ? {
- info: this.state.info
+ info: this.__infoRecord()
} : {}));
if (err) {
@@ -12124,15 +10623,16 @@ class Parser extends Transform {
return err;
}
}
- }
+ } // Without columns, records are array
+
} else {
if (raw === true || info === true) {
const err = this.__push(Object.assign({
record: record
}, raw === true ? {
- raw: this.state.rawBuffer.toString()
+ raw: this.state.rawBuffer.toString(encoding)
} : {}, info === true ? {
- info: this.state.info
+ info: this.__infoRecord()
} : {}));
if (err) {
@@ -12148,7 +10648,7 @@ class Parser extends Transform {
}
}
- this.__resetRow();
+ this.__resetRecord();
}
__firstLineToColumns(record) {
@@ -12158,7 +10658,7 @@ class Parser extends Transform {
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(), {
+ return this.__error(new CsvError('CSV_INVALID_COLUMN_MAPPING', ['Invalid Column Mapping:', 'expect an array from column function,', `got ${JSON.stringify(headers)}`], this.options, this.__infoField(), {
headers: headers
}));
}
@@ -12167,7 +10667,7 @@ class Parser extends Transform {
this.state.expectedRecordLength = normalizedHeaders.length;
this.options.columns = normalizedHeaders;
- this.__resetRow();
+ this.__resetRecord();
return;
} catch (err) {
@@ -12175,11 +10675,12 @@ class Parser extends Transform {
}
}
- __resetRow() {
+ __resetRecord() {
if (this.options.raw === true) {
this.state.rawBuffer.reset();
}
+ this.state.error = undefined;
this.state.record = [];
this.state.record_length = 0;
}
@@ -12187,6 +10688,7 @@ class Parser extends Transform {
__onField() {
const _this$options3 = this.options,
cast = _this$options3.cast,
+ encoding = _this$options3.encoding,
rtrim = _this$options3.rtrim,
max_record_size = _this$options3.max_record_size;
const _this$state3 = this.state,
@@ -12194,11 +10696,10 @@ class Parser extends Transform {
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();
+ let field = this.state.field.toString(encoding);
if (rtrim === true && wasQuoting === false) {
field = field.trimRight();
@@ -12232,10 +10733,10 @@ class Parser extends Transform {
const on_record = this.options.on_record;
if (on_record !== undefined) {
- const context = this.__context();
+ const info = this.__infoRecord();
try {
- record = on_record.call(null, record, context);
+ record = on_record.call(null, record, info);
} catch (err) {
return err;
}
@@ -12261,11 +10762,11 @@ class Parser extends Transform {
return [undefined, undefined];
}
- const context = this.__context();
-
if (this.state.castField !== null) {
try {
- return [undefined, this.state.castField.call(null, field, context)];
+ const info = this.__infoField();
+
+ return [undefined, this.state.castField.call(null, field, info)];
} catch (err) {
return [err];
}
@@ -12274,10 +10775,17 @@ class Parser extends Transform {
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)];
+ const info = this.__infoField();
+
+ return [undefined, this.options.cast_date.call(null, field, info)];
}
return [undefined, field];
+ } // 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;
} // Keep it in case we implement the `cast_int` option
// __isInt(value){
// // return Number.isInteger(parseInt(value))
@@ -12290,42 +10798,42 @@ class Parser extends Transform {
return value - parseFloat(value) + 1 >= 0; // Borrowed from jquery
}
- __compareBytes(sourceBuf, targetBuf, pos, firtByte) {
- if (sourceBuf[0] !== firtByte) return 0;
+ __compareBytes(sourceBuf, targetBuf, targetPos, firstByte) {
+ if (sourceBuf[0] !== firstByte) return 0;
const sourceLength = sourceBuf.length;
for (let i = 1; i < sourceLength; i++) {
- if (sourceBuf[i] !== targetBuf[pos + i]) return 0;
+ if (sourceBuf[i] !== targetBuf[targetPos + 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;
+ if (end) return false;
+ const quote = this.options.quote;
const _this$state4 = this.state,
quoting = _this$state4.quoting,
+ needMoreDataSize = _this$state4.needMoreDataSize,
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
+ const requiredLength = Math.max(needMoreDataSize, // Skip if the remaining buffer smaller than record delimiter
+ recordDelimiterMaxLength, // Skip if the remaining buffer can be record 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);
+ quoting ? quote.length + recordDelimiterMaxLength : 0);
return numOfCharLeft < requiredLength;
}
- __isDelimiter(chr, buf, pos) {
- const delimiter = this.options.delimiter;
+ __isDelimiter(buf, pos, chr) {
+ const _this$options5 = this.options,
+ delimiter = _this$options5.delimiter,
+ ignore_last_delimiters = _this$options5.ignore_last_delimiters;
+
+ if (ignore_last_delimiters === true && this.state.record.length === this.options.columns.length - 1) {
+ return 0;
+ } else if (ignore_last_delimiters !== false && typeof ignore_last_delimiters === 'number' && this.state.record.length === ignore_last_delimiters - 1) {
+ return 0;
+ }
loop1: for (let i = 0; i < delimiter.length; i++) {
const del = delimiter[i];
@@ -12366,21 +10874,54 @@ class Parser extends Transform {
return 0;
}
- __autoDiscoverRowDelimiter(buf, pos) {
+ __isEscape(buf, pos, chr) {
+ const escape = this.options.escape;
+ if (escape === null) return false;
+ const l = escape.length;
+
+ if (escape[0] === chr) {
+ for (let i = 0; i < l; i++) {
+ if (escape[i] !== buf[pos + i]) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ __isQuote(buf, pos) {
+ const quote = this.options.quote;
+ if (quote === null) return false;
+ const l = quote.length;
+
+ for (let i = 0; i < l; i++) {
+ if (quote[i] !== buf[pos + i]) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ __autoDiscoverRecordDelimiter(buf, pos) {
+ const encoding = this.options.encoding;
const chr = buf[pos];
if (chr === cr) {
if (buf[pos + 1] === nl) {
- this.options.record_delimiter.push(Buffer.from('\r\n'));
+ this.options.record_delimiter.push(Buffer.from('\r\n', encoding));
this.state.recordDelimiterMaxLength = 2;
return 2;
} else {
- this.options.record_delimiter.push(Buffer.from('\r'));
+ this.options.record_delimiter.push(Buffer.from('\r', encoding));
this.state.recordDelimiterMaxLength = 1;
return 1;
}
} else if (chr === nl) {
- this.options.record_delimiter.push(Buffer.from('\n'));
+ this.options.record_delimiter.push(Buffer.from('\n', encoding));
this.state.recordDelimiterMaxLength = 1;
return 1;
}
@@ -12401,19 +10942,28 @@ class Parser extends Transform {
}
}
- __context() {
+ __infoDataSet() {
+ return _objectSpread(_objectSpread({}, this.info), {}, {
+ columns: this.options.columns
+ });
+ }
+
+ __infoRecord() {
+ const columns = this.options.columns;
+ return _objectSpread(_objectSpread({}, this.__infoDataSet()), {}, {
+ error: this.state.error,
+ header: columns === true,
+ index: this.state.record.length
+ });
+ }
+
+ __infoField() {
const columns = this.options.columns;
const isColumns = Array.isArray(columns);
- return {
+ return _objectSpread(_objectSpread({}, this.__infoRecord()), {}, {
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
- };
+ quoting: this.state.wasQuoting
+ });
}
}
@@ -12432,7 +10982,7 @@ const parse = function () {
} else if (callback === undefined && type === 'function') {
callback = argument;
} else {
- throw new CsvError('CSV_INVALID_ARGUMENT', ['Invalid argument:', `got ${JSON.stringify(argument)} at index ${i}`]);
+ throw new CsvError('CSV_INVALID_ARGUMENT', ['Invalid argument:', `got ${JSON.stringify(argument)} at index ${i}`], options || {});
}
}
@@ -12452,10 +11002,10 @@ const parse = function () {
}
});
parser.on('error', function (err) {
- callback(err, undefined, parser.info);
+ callback(err, undefined, parser.__infoDataSet());
});
parser.on('end', function () {
- callback(undefined, records, parser.info);
+ callback(undefined, records, parser.__infoDataSet());
});
}
@@ -12476,7 +11026,7 @@ const parse = function () {
};
class CsvError extends Error {
- constructor(code, message, ...contexts) {
+ constructor(code, message, options, ...contexts) {
if (Array.isArray(message)) message = message.join(' ');
super(message);
@@ -12489,7 +11039,7 @@ class CsvError extends Error {
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));
+ this[key] = Buffer.isBuffer(value) ? value.toString(options.encoding) : value == null ? value : JSON.parse(JSON.stringify(value));
}
}
}
@@ -12590,12 +11140,6 @@ module.exports = function (data, options = {}) {
/*! 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."); }
@@ -12614,285 +11158,55 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
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.
+/*
+CSV Stringify
-module.exports = function () {
- var callback, chunks, data, options, stringifier;
+Please look at the [project documentation](https://csv.js.org/stringify/) for
+additional information.
+*/
+const _require = __webpack_require__(/*! stream */ "stream"),
+ Transform = _require.Transform;
- 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];
- }
+const bom_utf8 = Buffer.from([239, 187, 191]);
- 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 {
+class Stringifier extends 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 = {};
+ const options = {};
+ let err; // Merge with user 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;
+ for (let opt in opts) {
+ options[underscore(opt)] = opts[opt];
}
- if (options.quoted_empty == null) {
- options.quoted_empty = void 0;
- }
+ if (err = this.normalize(options)) throw err;
- if (options.quoted_string == null) {
- options.quoted_string = false;
- }
+ switch (options.record_delimiter) {
+ case 'auto':
+ options.record_delimiter = null;
+ break;
- if (options.eof == null) {
- options.eof = true;
- } // Normalize option `escape`
+ case 'unix':
+ options.record_delimiter = "\n";
+ break;
+ case 'mac':
+ options.record_delimiter = "\r";
+ break;
- if (options.escape === null || options.escape === void 0) {
- options.escape = '"';
- } else {
- if (Buffer.isBuffer(options.escape)) {
- options.escape = options.escape.toString();
- }
+ case 'windows':
+ options.record_delimiter = "\r\n";
+ break;
- 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`);
- }
- }
+ case 'ascii':
+ options.record_delimiter = "\u001e";
+ break;
- 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";
- }
+ case 'unicode':
+ options.record_delimiter = "\u2028";
+ break;
} // Expose options
@@ -12905,20 +11219,168 @@ Stringifier = class Stringifier extends stream.Transform {
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).
+ }
+ normalize(options) {
+ // Normalize option `bom`
+ if (options.bom === undefined || options.bom === null || options.bom === false) {
+ options.bom = false;
+ } else if (options.bom !== true) {
+ return new CsvError('CSV_OPTION_BOOLEAN_INVALID_TYPE', ['option `bom` is optional and must be a boolean value,', `got ${JSON.stringify(options.bom)}`]);
+ } // Normalize option `delimiter`
+
+
+ if (options.delimiter === undefined || options.delimiter === null) {
+ options.delimiter = ',';
+ } else if (Buffer.isBuffer(options.delimiter)) {
+ options.delimiter = options.delimiter.toString();
+ } else if (typeof options.delimiter !== 'string') {
+ return new CsvError('CSV_OPTION_DELIMITER_INVALID_TYPE', ['option `delimiter` must be a buffer or a string,', `got ${JSON.stringify(options.delimiter)}`]);
+ } // Normalize option `quote`
+
+
+ if (options.quote === undefined || options.quote === null) {
+ 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') {
+ return new CsvError('CSV_OPTION_QUOTE_INVALID_TYPE', ['option `quote` must be a boolean, a buffer or a string,', `got ${JSON.stringify(options.quote)}`]);
+ } // Normalize option `quoted`
+
+
+ if (options.quoted === undefined || options.quoted === null) {
+ options.quoted = false;
+ } else {// todo
+ } // Normalize option `quoted_empty`
+
+
+ if (options.quoted_empty === undefined || options.quoted_empty === null) {
+ options.quoted_empty = undefined;
+ } else {// todo
+ } // Normalize option `quoted_match`
+
+
+ if (options.quoted_match === undefined || 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) {
+ for (let quoted_match of options.quoted_match) {
+ const isString = typeof quoted_match === 'string';
+ const isRegExp = quoted_match instanceof RegExp;
+
+ if (!isString && !isRegExp) {
+ return Error(`Invalid Option: quoted_match must be a string or a regex, got ${JSON.stringify(quoted_match)}`);
+ }
+ }
+ } // Normalize option `quoted_string`
+
+
+ if (options.quoted_string === undefined || options.quoted_string === null) {
+ options.quoted_string = false;
+ } else {// todo
+ } // Normalize option `eof`
+
+
+ if (options.eof === undefined || options.eof === null) {
+ options.eof = true;
+ } else {// todo
+ } // Normalize option `escape`
+
+
+ if (options.escape === undefined || options.escape === null) {
+ options.escape = '"';
+ } else if (Buffer.isBuffer(options.escape)) {
+ options.escape = options.escape.toString();
+ } else if (typeof options.escape !== 'string') {
+ return Error(`Invalid Option: escape must be a buffer or a string, got ${JSON.stringify(options.escape)}`);
+ }
+
+ if (options.escape.length > 1) {
+ return Error(`Invalid Option: escape must be one character, got ${options.escape.length} characters`);
+ } // Normalize option `header`
+
+
+ if (options.header === undefined || options.header === null) {
+ options.header = false;
+ } else {// todo
+ } // Normalize option `columns`
+
+
+ options.columns = this.normalize_columns(options.columns); // Normalize option `quoted`
+
+ if (options.quoted === undefined || options.quoted === null) {
+ options.quoted = false;
+ } else {// todo
+ } // Normalize option `cast`
+
+
+ if (options.cast === undefined || options.cast === null) {
+ options.cast = {};
+ } else {// todo
+ } // Normalize option cast.bigint
+
+
+ if (options.cast.bigint === undefined || options.cast.bigint === null) {
+ // Cast boolean to string by default
+ options.cast.bigint = value => '' + value;
+ } // Normalize option cast.boolean
+
+
+ if (options.cast.boolean === undefined || options.cast.boolean === null) {
+ // Cast boolean to string by default
+ options.cast.boolean = value => value ? '1' : '';
+ } // Normalize option cast.date
+
+
+ if (options.cast.date === undefined || options.cast.date === null) {
+ // Cast date to timestamp string by default
+ options.cast.date = value => '' + value.getTime();
+ } // Normalize option cast.number
+
+
+ if (options.cast.number === undefined || options.cast.number === null) {
+ // Cast number to string using native casting by default
+ options.cast.number = value => '' + value;
+ } // Normalize option cast.object
+
+
+ if (options.cast.object === undefined || options.cast.object === null) {
+ // Stringify object as JSON by default
+ options.cast.object = value => JSON.stringify(value);
+ } // Normalize option cast.string
+
+
+ if (options.cast.string === undefined || options.cast.string === null) {
+ // Leave string untouched
+ options.cast.string = function (value) {
+ return value;
+ };
+ } // Normalize option `record_delimiter`
+
+
+ if (options.record_delimiter === undefined || 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') {
+ return Error(`Invalid Option: record_delimiter must be a buffer or a string, got ${JSON.stringify(options.record_delimiter)}`);
+ }
+ }
_transform(chunk, encoding, callback) {
- var base, e;
-
if (this.state.stop === true) {
return;
} // Chunk validation
- if (!(Array.isArray(chunk) || typeof chunk === 'object')) {
+ 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
@@ -12930,100 +11392,93 @@ Stringifier = class Stringifier extends stream.Transform {
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));
- }
+ } else if (this.options.columns === undefined || this.options.columns === null) {
+ this.options.columns = this.normalize_columns(Object.keys(chunk));
}
- }
+ } // Emit the header
+
if (this.info.records === 0) {
- // Emit the header
+ this.bom();
this.headers();
- }
+ } // Emit and stringify the record if an object or an array
+
try {
- // Emit and stringify the record if an object or an array
this.emit('record', chunk, this.info.records);
- } catch (error) {
- e = error;
+ } catch (err) {
this.state.stop = true;
- return this.emit('error', e);
+ return this.emit('error', err);
} // Convert the record into a string
+ let chunk_string;
+
if (this.options.eof) {
- chunk = this.stringify(chunk);
+ chunk_string = this.stringify(chunk);
- if (chunk == null) {
+ if (chunk_string === undefined) {
return;
+ } else {
+ chunk_string = chunk_string + this.options.record_delimiter;
}
-
- chunk = chunk + this.options.record_delimiter;
} else {
- chunk = this.stringify(chunk);
+ chunk_string = this.stringify(chunk);
- if (chunk == null) {
+ if (chunk_string === undefined) {
return;
- }
-
- if (this.options.header || this.info.records) {
- chunk = this.options.record_delimiter + chunk;
+ } else {
+ if (this.options.header || this.info.records) {
+ chunk_string = this.options.record_delimiter + chunk_string;
+ }
}
} // 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).
-
+ this.push(chunk_string);
+ callback();
+ }
_flush(callback) {
if (this.info.records === 0) {
+ this.bom();
this.headers();
}
- return callback();
- } // ## `Stringifier.prototype.stringify(line)`
- // Convert a line to a string. Line may be an object, an array or a string.
-
+ callback();
+ }
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
+ const _this$options = this.options,
+ columns = _this$options.columns,
+ header = _this$options.header;
+ const record = []; // Record is an array
if (Array.isArray(chunk)) {
+ // We are getting an array but the user has specified output columns. In
+ // this case, we respect the columns indexes
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];
+ for (let i = 0; i < chunk.length; i++) {
+ const field = chunk[i];
- var _this$__cast = this.__cast(field, {
+ const _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];
+ }),
+ _this$__cast2 = _slicedToArray(_this$__cast, 2),
+ err = _this$__cast2[0],
+ value = _this$__cast2[1];
if (err) {
this.emit('error', err);
@@ -13031,24 +11486,22 @@ Stringifier = class Stringifier extends stream.Transform {
}
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);
+ } // Record is a literal object
- var _this$__cast3 = this.__cast(field, {
+ } else {
+ if (columns) {
+ for (let i = 0; i < columns.length; i++) {
+ const field = get(chunk, columns[i].key);
+
+ const _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];
+ }),
+ _this$__cast4 = _slicedToArray(_this$__cast3, 2),
+ err = _this$__cast4[0],
+ value = _this$__cast4[1];
if (err) {
this.emit('error', err);
@@ -13058,20 +11511,18 @@ Stringifier = class Stringifier extends stream.Transform {
record[i] = [value, field];
}
} else {
- for (column in chunk) {
- field = chunk[column];
+ for (let column of chunk) {
+ const field = chunk[column];
- var _this$__cast5 = this.__cast(field, {
+ const _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];
+ }),
+ _this$__cast6 = _slicedToArray(_this$__cast5, 2),
+ err = _this$__cast6[0],
+ value = _this$__cast6[1];
if (err) {
this.emit('error', err);
@@ -13083,56 +11534,63 @@ Stringifier = class Stringifier extends stream.Transform {
}
}
- csvrecord = '';
+ let 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);
+ for (let i = 0; i < record.length; i++) {
+ let options, err;
- value = _record$i[0];
- field = _record$i[1];
+ let _record$i = _slicedToArray(record[i], 2),
+ value = _record$i[0],
+ field = _record$i[1];
- if (typeof value === 'string') {
+ if (typeof value === "string") {
options = this.options;
} else if (isObject(value)) {
- var _value = value;
- value = _value.value;
- options = _objectWithoutProperties(_value, _excluded);
+ // let { value, ...options } = value
+ options = value;
+ value = options.value;
+ delete options.value;
- 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)}`));
+ if (typeof value !== "string" && value !== undefined && 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) {
+
+ if (err = this.normalize(options)) {
+ this.emit("error", err);
+ return;
+ }
+ } else if (value === undefined || 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)}`));
+ 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;
+ const _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)}`));
+ 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) {
+ const containsdelimiter = delimiter.length && value.indexOf(delimiter) >= 0;
+ const containsQuote = quote !== '' && value.indexOf(quote) >= 0;
+ const containsEscape = value.indexOf(escape) >= 0 && escape !== quote;
+ const containsRecordDelimiter = value.indexOf(record_delimiter) >= 0;
+ const quotedString = quoted_string && typeof field === 'string';
+ let quotedMatch = quoted_match && quoted_match.filter(quoted_match => {
if (typeof quoted_match === 'string') {
return value.indexOf(quoted_match) !== -1;
} else {
@@ -13140,15 +11598,15 @@ Stringifier = class Stringifier extends stream.Transform {
}
});
quotedMatch = quotedMatch && quotedMatch.length > 0;
- shouldQuote = containsQuote === true || containsdelimiter || containsRowDelimiter || quoted || quotedString || quotedMatch;
+ const shouldQuote = containsQuote === true || containsdelimiter || containsRecordDelimiter || quoted || quotedString || quotedMatch;
if (shouldQuote === true && containsEscape === true) {
- regexp = escape === '\\' ? new RegExp(escape + escape, 'g') : new RegExp(escape, 'g');
+ const 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');
+ const regexp = new RegExp(quote, 'g');
value = value.replace(regexp, escape + quote);
}
@@ -13157,7 +11615,7 @@ Stringifier = class Stringifier extends stream.Transform {
}
csvrecord += value;
- } else if (quoted_empty === true || quoted_empty == null && field === '' && quoted_string !== false) {
+ } else if (quoted_empty === true || field === '' && quoted_string === true && quoted_empty !== false) {
csvrecord += quote + quote;
}
@@ -13167,24 +11625,26 @@ Stringifier = class Stringifier extends stream.Transform {
}
return csvrecord;
- } // ## `Stringifier.prototype.headers`
- // Print the header line if the option "header" is "true".
+ }
+ bom() {
+ if (this.options.bom !== true) {
+ return;
+ }
+
+ this.push(bom_utf8);
+ }
headers() {
- var headers;
-
- if (!this.options.header) {
+ if (this.options.header === false) {
return;
}
- if (!this.options.columns) {
+ if (this.options.columns === undefined) {
return;
}
- headers = this.options.columns.map(function (column) {
- return column.header;
- });
+ let headers = this.options.columns.map(column => column.header);
if (this.options.eof) {
headers = this.stringify(headers, true) + this.options.record_delimiter;
@@ -13192,168 +11652,225 @@ Stringifier = class Stringifier extends stream.Transform {
headers = this.stringify(headers);
}
- return this.push(headers);
+ this.push(headers);
}
__cast(value, context) {
- var err, type;
- type = typeof value;
+ const type = typeof value;
try {
if (type === 'string') {
// Fine for 99% of the cases
- return [void 0, this.options.cast.string(value, context)];
+ return [undefined, this.options.cast.string(value, context)];
+ } else if (type === 'bigint') {
+ return [undefined, this.options.cast.bigint(value, context)];
} else if (type === 'number') {
- return [void 0, this.options.cast.number(value, context)];
+ return [undefined, this.options.cast.number(value, context)];
} else if (type === 'boolean') {
- return [void 0, this.options.cast.boolean(value, context)];
+ return [undefined, this.options.cast.boolean(value, context)];
} else if (value instanceof Date) {
- return [void 0, this.options.cast.date(value, context)];
+ return [undefined, this.options.cast.date(value, context)];
} else if (type === 'object' && value !== null) {
- return [void 0, this.options.cast.object(value, context)];
+ return [undefined, this.options.cast.object(value, context)];
} else {
- return [void 0, value, value];
+ return [undefined, value, value];
}
- } catch (error) {
- err = error;
+ } catch (err) {
return [err];
}
- } // ## `Stringifier.prototype.normalize_columns`
-
+ }
normalize_columns(columns) {
- var column, k, v;
-
- if (columns == null) {
- return null;
+ if (columns === undefined || columns === null) {
+ return undefined;
}
- if (columns != null) {
- if (typeof columns !== 'object') {
- throw Error('Invalid option "columns": expect an array or an object');
+ if (typeof columns !== 'object') {
+ throw Error('Invalid option "columns": expect an array or an object');
+ }
+
+ if (!Array.isArray(columns)) {
+ const newcolumns = [];
+
+ for (let k in columns) {
+ newcolumns.push({
+ key: k,
+ header: columns[k]
+ });
}
- if (!Array.isArray(columns)) {
- columns = function () {
- var results;
- results = [];
+ columns = newcolumns;
+ } else {
+ const newcolumns = [];
- for (k in columns) {
- v = columns[k];
- results.push({
- key: k,
- header: v
- });
+ for (let column of columns) {
+ if (typeof column === 'string') {
+ newcolumns.push({
+ key: column,
+ header: column
+ });
+ } else if (typeof column === 'object' && column !== undefined && !Array.isArray(column)) {
+ if (!column.key) {
+ throw Error('Invalid column definition: property "key" is required');
}
- 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');
- }
+ if (column.header === undefined) {
+ column.header = column.key;
}
- return results;
- }();
+ newcolumns.push(column);
+ } else {
+ throw Error('Invalid column definition: expect a string or an object');
+ }
}
+
+ columns = newcolumns;
}
return columns;
}
-};
-module.exports.Stringifier = Stringifier;
+}
-isObject = function (obj) {
- return typeof obj === 'object' && obj !== null && !Array.isArray(obj);
-};
+const stringify = function () {
+ let data, options, callback;
-underscore = function (str) {
- return str.replace(/([A-Z])/g, function (_, match, index) {
- return '_' + match.toLowerCase();
- });
-}; // ## Lodash implementation of `get`
+ for (let i in arguments) {
+ const argument = arguments[i];
+ const type = typeof argument;
-
-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]';
+ if (data === undefined && Array.isArray(argument)) {
+ data = argument;
+ } else if (options === undefined && isObject(argument)) {
+ options = argument;
+ } else if (callback === undefined && type === 'function') {
+ callback = argument;
} else {
- '[object Null]';
+ throw new CsvError('CSV_INVALID_ARGUMENT', ['Invalid argument:', `got ${JSON.stringify(argument)} at index ${i}`]);
}
}
+ const stringifier = new Stringifier(options);
+
+ if (callback) {
+ const chunks = [];
+ stringifier.on('readable', function () {
+ let chunk;
+
+ while ((chunk = this.read()) !== null) {
+ chunks.push(chunk);
+ }
+ });
+ stringifier.on('error', function (err) {
+ callback(err);
+ });
+ stringifier.on('end', function () {
+ callback(undefined, chunks.join(''));
+ });
+ }
+
+ if (data !== undefined) {
+ // Give a chance for events to be registered later
+ if (typeof setImmediate === 'function') {
+ setImmediate(function () {
+ for (let record of data) {
+ stringifier.write(record);
+ }
+
+ stringifier.end();
+ });
+ } else {
+ for (let record of data) {
+ stringifier.write(record);
+ }
+
+ stringifier.end();
+ }
+ }
+
+ return stringifier;
+};
+
+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));
+ }
+ }
+ }
+
+}
+
+stringify.Stringifier = Stringifier;
+stringify.CsvError = CsvError;
+module.exports = stringify;
+
+const isObject = function (obj) {
+ return typeof obj === 'object' && obj !== null && !Array.isArray(obj);
+};
+
+const underscore = function (str) {
+ return str.replace(/([A-Z])/g, function (_, match) {
+ return '_' + match.toLowerCase();
+ });
+}; // Lodash implementation of `get`
+
+
+const charCodeOfDot = '.'.charCodeAt(0);
+const reEscapeChar = /\\(\\)?/g;
+const rePropName = RegExp( // 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).
+'(["\'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2' + ')\\]' + '|' + // Or match "" as the space between consecutive dots or empty brackets.
+'(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))', 'g');
+const reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
+const reIsPlainProp = /^\w*$/;
+
+const getTag = function (value) {
+ if (!value) value === undefined ? '[object Undefined]' : '[object Null]';
return Object.prototype.toString.call(value);
};
-isKey = function (value, object) {
- var type;
-
+const isKey = function (value, object) {
if (Array.isArray(value)) {
return false;
}
- type = typeof value;
+ const type = typeof value;
- if (type === 'number' || type === 'symbol' || type === 'boolean' || value == null || isSymbol(value)) {
+ if (type === 'number' || type === 'symbol' || type === 'boolean' || !value || 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]';
+const isSymbol = function (value) {
+ const type = typeof value;
+ return type === 'symbol' || type === 'object' && value && getTag(value) === '[object Symbol]';
};
-stringToPath = function (string) {
- var result;
- result = [];
+const stringToPath = function (string) {
+ const result = [];
if (string.charCodeAt(0) === charCodeOfDot) {
result.push('');
}
string.replace(rePropName, function (match, expression, quote, subString) {
- var key;
- key = match;
+ let key = match;
if (quote) {
key = subString.replace(reEscapeChar, '$1');
@@ -13361,51 +11878,35 @@ stringToPath = function (string) {
key = expression.trim();
}
- return result.push(key);
+ result.push(key);
});
return result;
};
-castPath = function (value, object) {
+const castPath = function (value, object) {
if (Array.isArray(value)) {
return value;
} else {
- if (isKey(value, object)) {
- return [value];
- } else {
- return stringToPath(value);
- }
+ return isKey(value, object) ? [value] : 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
- };
+const toKey = function (value) {
+ if (typeof value === 'string' || isSymbol(value)) return value;
+ const result = `${value}`;
+ return result == '0' && 1 / value == -INFINITY ? '-0' : result;
};
-get = function (object, path) {
- var index, length;
- path = Array.isArray(path) ? path : castPath(path, object);
- index = 0;
- length = path.length;
+const get = function (object, path) {
+ path = castPath(path, object);
+ let index = 0;
+ const length = path.length;
while (object != null && index < length) {
object = object[toKey(path[index++])];
}
- if (index && index === length) {
- return object;
- } else {
- return void 0;
- }
+ return index && index === length ? object : undefined;
};
/***/ }),
@@ -13417,41 +11918,34 @@ get = function (object, path) {
/*! 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;
+const stringify = __webpack_require__(/*! . */ "./node_modules/csv-stringify/lib/index.js");
-var _require = __webpack_require__(/*! string_decoder */ "string_decoder");
-
-StringDecoder = _require.StringDecoder;
-stringify = __webpack_require__(/*! ./index */ "./node_modules/csv-stringify/lib/index.js");
+const _require = __webpack_require__(/*! string_decoder */ "string_decoder"),
+ StringDecoder = _require.StringDecoder;
module.exports = function (records, options = {}) {
- var data, decoder, i, len, record, stringifier;
- data = [];
+ const data = [];
- if (records instanceof Buffer) {
- decoder = new StringDecoder();
+ if (Buffer.isBuffer(records)) {
+ const decoder = new StringDecoder();
records = decoder.write(records);
}
- stringifier = new stringify.Stringifier(options);
-
- stringifier.push = function (record) {
+ function onData(record) {
if (record) {
- return data.push(record.toString());
+ data.push(record.toString());
}
- };
+ }
- for (i = 0, len = records.length; i < len; i++) {
- record = records[i];
+ let stringifier = new stringify.Stringifier(options);
+ stringifier.on('data', onData);
+
+ for (let record of records) {
stringifier.write(record);
}
stringifier.end();
+ stringifier.off('data', onData);
return data.join('');
};
@@ -28972,1477 +27466,6 @@ 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 ***!
@@ -30455,7 +27478,7 @@ module.exports = function assertRecord(Type, recordType, argumentName, value) {
var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js");
-var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%');
+var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
if ($gOPD) {
try {
@@ -30470,198 +27493,6 @@ 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 ***!
@@ -30913,190 +27744,6 @@ module.exports = Array.isArray || function (arr) {
/***/ }),
-/***/ "./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 ***!
@@ -31564,7 +28211,7 @@ module.exports = function GetIntrinsic(name, allowMissing) {
!*** ./node_modules/google-protobuf/google-protobuf.js ***!
\*********************************************************/
/*! no static exports found */
-/***/ (function(module, exports) {
+/***/ (function(module, exports, __webpack_require__) {
var $jscomp = $jscomp || {};
$jscomp.scope = {};
@@ -32790,96 +29437,268 @@ goog.createTrustedTypesPolicy = function (a) {
};
goog.TRUSTED_TYPES_POLICY_ = goog.TRUSTED_TYPES_POLICY_NAME ? goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME + "#base") : null;
-var jspb = {
- BinaryConstants: {},
- ConstBinaryMessage: function () {},
- BinaryMessage: function () {}
-};
-jspb.BinaryConstants.FieldType = {
- INVALID: -1,
- DOUBLE: 1,
- FLOAT: 2,
- INT64: 3,
- UINT64: 4,
- INT32: 5,
- FIXED64: 6,
- FIXED32: 7,
- BOOL: 8,
- STRING: 9,
- GROUP: 10,
- MESSAGE: 11,
- BYTES: 12,
- UINT32: 13,
- ENUM: 14,
- SFIXED32: 15,
- SFIXED64: 16,
- SINT32: 17,
- SINT64: 18,
- FHASH64: 30,
- VHASH64: 31
-};
-jspb.BinaryConstants.WireType = {
- INVALID: -1,
- VARINT: 0,
- FIXED64: 1,
- DELIMITED: 2,
- START_GROUP: 3,
- END_GROUP: 4,
- FIXED32: 5
+goog.object = {};
+
+goog.object.is = function (a, b) {
+ return a === b ? 0 !== a || 1 / a === 1 / b : a !== a && b !== b;
};
-jspb.BinaryConstants.FieldTypeToWireType = function (a) {
- var b = jspb.BinaryConstants.FieldType,
- c = jspb.BinaryConstants.WireType;
+goog.object.forEach = function (a, b, c) {
+ for (var d in a) b.call(c, a[d], d, a);
+};
- switch (a) {
- case b.INT32:
- case b.INT64:
- case b.UINT32:
- case b.UINT64:
- case b.SINT32:
- case b.SINT64:
- case b.BOOL:
- case b.ENUM:
- case b.VHASH64:
- return c.VARINT;
+goog.object.filter = function (a, b, c) {
+ var d = {},
+ e;
- case b.DOUBLE:
- case b.FIXED64:
- case b.SFIXED64:
- case b.FHASH64:
- return c.FIXED64;
+ for (e in a) b.call(c, a[e], e, a) && (d[e] = a[e]);
- case b.STRING:
- case b.MESSAGE:
- case b.BYTES:
- return c.DELIMITED;
+ return d;
+};
- case b.FLOAT:
- case b.FIXED32:
- case b.SFIXED32:
- return c.FIXED32;
+goog.object.map = function (a, b, c) {
+ var d = {},
+ e;
- default:
- return c.INVALID;
+ for (e in a) d[e] = b.call(c, a[e], e, a);
+
+ return d;
+};
+
+goog.object.some = function (a, b, c) {
+ for (var d in a) if (b.call(c, a[d], d, a)) return !0;
+
+ return !1;
+};
+
+goog.object.every = function (a, b, c) {
+ for (var d in a) if (!b.call(c, a[d], d, a)) return !1;
+
+ return !0;
+};
+
+goog.object.getCount = function (a) {
+ var b = 0,
+ c;
+
+ for (c in a) b++;
+
+ return b;
+};
+
+goog.object.getAnyKey = function (a) {
+ for (var b in a) return b;
+};
+
+goog.object.getAnyValue = function (a) {
+ for (var b in a) return a[b];
+};
+
+goog.object.contains = function (a, b) {
+ return goog.object.containsValue(a, b);
+};
+
+goog.object.getValues = function (a) {
+ var b = [],
+ c = 0,
+ d;
+
+ for (d in a) b[c++] = a[d];
+
+ return b;
+};
+
+goog.object.getKeys = function (a) {
+ var b = [],
+ c = 0,
+ d;
+
+ for (d in a) b[c++] = d;
+
+ return b;
+};
+
+goog.object.getValueByKeys = function (a, b) {
+ var c = goog.isArrayLike(b),
+ d = c ? b : arguments;
+
+ for (c = c ? 0 : 1; c < d.length; c++) {
+ if (null == a) return;
+ a = a[d[c]];
+ }
+
+ return a;
+};
+
+goog.object.containsKey = function (a, b) {
+ return null !== a && b in a;
+};
+
+goog.object.containsValue = function (a, b) {
+ for (var c in a) if (a[c] == b) return !0;
+
+ return !1;
+};
+
+goog.object.findKey = function (a, b, c) {
+ for (var d in a) if (b.call(c, a[d], d, a)) return d;
+};
+
+goog.object.findValue = function (a, b, c) {
+ return (b = goog.object.findKey(a, b, c)) && a[b];
+};
+
+goog.object.isEmpty = function (a) {
+ for (var b in a) return !1;
+
+ return !0;
+};
+
+goog.object.clear = function (a) {
+ for (var b in a) delete a[b];
+};
+
+goog.object.remove = function (a, b) {
+ var c;
+ (c = b in a) && delete a[b];
+ return c;
+};
+
+goog.object.add = function (a, b, c) {
+ if (null !== a && b in a) throw Error('The object already contains the key "' + b + '"');
+ goog.object.set(a, b, c);
+};
+
+goog.object.get = function (a, b, c) {
+ return null !== a && b in a ? a[b] : c;
+};
+
+goog.object.set = function (a, b, c) {
+ a[b] = c;
+};
+
+goog.object.setIfUndefined = function (a, b, c) {
+ return b in a ? a[b] : a[b] = c;
+};
+
+goog.object.setWithReturnValueIfNotSet = function (a, b, c) {
+ if (b in a) return a[b];
+ c = c();
+ return a[b] = c;
+};
+
+goog.object.equals = function (a, b) {
+ for (var c in a) if (!(c in b) || a[c] !== b[c]) return !1;
+
+ for (var d in b) if (!(d in a)) return !1;
+
+ return !0;
+};
+
+goog.object.clone = function (a) {
+ var b = {},
+ c;
+
+ for (c in a) b[c] = a[c];
+
+ return b;
+};
+
+goog.object.unsafeClone = function (a) {
+ var b = goog.typeOf(a);
+
+ if ("object" == b || "array" == b) {
+ if (goog.isFunction(a.clone)) return a.clone();
+ b = "array" == b ? [] : {};
+
+ for (var c in a) b[c] = goog.object.unsafeClone(a[c]);
+
+ return b;
+ }
+
+ return a;
+};
+
+goog.object.transpose = function (a) {
+ var b = {},
+ c;
+
+ for (c in a) b[a[c]] = c;
+
+ return b;
+};
+
+goog.object.PROTOTYPE_FIELDS_ = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");
+
+goog.object.extend = function (a, b) {
+ for (var c, d, e = 1; e < arguments.length; e++) {
+ d = arguments[e];
+
+ for (c in d) a[c] = d[c];
+
+ for (var f = 0; f < goog.object.PROTOTYPE_FIELDS_.length; f++) c = goog.object.PROTOTYPE_FIELDS_[f], Object.prototype.hasOwnProperty.call(d, c) && (a[c] = d[c]);
}
};
-jspb.BinaryConstants.INVALID_FIELD_NUMBER = -1;
-jspb.BinaryConstants.FLOAT32_EPS = 1.401298464324817E-45;
-jspb.BinaryConstants.FLOAT32_MIN = 1.1754943508222875E-38;
-jspb.BinaryConstants.FLOAT32_MAX = 3.4028234663852886E38;
-jspb.BinaryConstants.FLOAT64_EPS = 4.9E-324;
-jspb.BinaryConstants.FLOAT64_MIN = 2.2250738585072014E-308;
-jspb.BinaryConstants.FLOAT64_MAX = 1.7976931348623157E308;
-jspb.BinaryConstants.TWO_TO_20 = 1048576;
-jspb.BinaryConstants.TWO_TO_23 = 8388608;
-jspb.BinaryConstants.TWO_TO_31 = 2147483648;
-jspb.BinaryConstants.TWO_TO_32 = 4294967296;
-jspb.BinaryConstants.TWO_TO_52 = 4503599627370496;
-jspb.BinaryConstants.TWO_TO_63 = 0x7fffffffffffffff;
-jspb.BinaryConstants.TWO_TO_64 = 1.8446744073709552E19;
-jspb.BinaryConstants.ZERO_HASH = "\x00\x00\x00\x00\x00\x00\x00\x00";
+goog.object.create = function (a) {
+ var b = arguments.length;
+ if (1 == b && goog.isArray(arguments[0])) return goog.object.create.apply(null, arguments[0]);
+ if (b % 2) throw Error("Uneven number of arguments");
+
+ for (var c = {}, d = 0; d < b; d += 2) c[arguments[d]] = arguments[d + 1];
+
+ return c;
+};
+
+goog.object.createSet = function (a) {
+ var b = arguments.length;
+ if (1 == b && goog.isArray(arguments[0])) return goog.object.createSet.apply(null, arguments[0]);
+
+ for (var c = {}, d = 0; d < b; d++) c[arguments[d]] = !0;
+
+ return c;
+};
+
+goog.object.createImmutableView = function (a) {
+ var b = a;
+ Object.isFrozen && !Object.isFrozen(a) && (b = Object.create(a), Object.freeze(b));
+ return b;
+};
+
+goog.object.isImmutableView = function (a) {
+ return !!Object.isFrozen && Object.isFrozen(a);
+};
+
+goog.object.getAllPropertyNames = function (a, b, c) {
+ if (!a) return [];
+ if (!Object.getOwnPropertyNames || !Object.getPrototypeOf) return goog.object.getKeys(a);
+
+ for (var d = {}; a && (a !== Object.prototype || b) && (a !== Function.prototype || c);) {
+ for (var e = Object.getOwnPropertyNames(a), f = 0; f < e.length; f++) d[e[f]] = !0;
+
+ a = Object.getPrototypeOf(a);
+ }
+
+ return goog.object.getKeys(d);
+};
+
+goog.object.getSuperClass = function (a) {
+ return (a = Object.getPrototypeOf(a.prototype)) && a.constructor;
+};
+
+goog.debug = {};
+
+goog.debug.Error = function (a) {
+ if (Error.captureStackTrace) Error.captureStackTrace(this, goog.debug.Error);else {
+ var b = Error().stack;
+ b && (this.stack = b);
+ }
+ a && (this.message = String(a));
+ this.reportErrorToServer = !0;
+};
+
+goog.inherits(goog.debug.Error, Error);
+goog.debug.Error.prototype.name = "CustomError";
goog.dom = {};
goog.dom.NodeType = {
ELEMENT: 1,
@@ -32895,19 +29714,6 @@ goog.dom.NodeType = {
DOCUMENT_FRAGMENT: 11,
NOTATION: 12
};
-goog.debug = {};
-
-goog.debug.Error = function (a) {
- if (Error.captureStackTrace) Error.captureStackTrace(this, goog.debug.Error);else {
- var b = Error().stack;
- b && (this.stack = b);
- }
- a && (this.message = String(a));
- this.reportErrorToServer = !0;
-};
-
-goog.inherits(goog.debug.Error, Error);
-goog.debug.Error.prototype.name = "CustomError";
goog.asserts = {};
goog.asserts.ENABLE_ASSERTS = goog.DEBUG;
@@ -33016,6 +29822,96 @@ goog.asserts.getType_ = function (a) {
return a instanceof Function ? a.displayName || a.name || "unknown type name" : a instanceof Object ? a.constructor.displayName || a.constructor.name || Object.prototype.toString.call(a) : null === a ? "null" : typeof a;
};
+var jspb = {
+ BinaryConstants: {},
+ ConstBinaryMessage: function () {},
+ BinaryMessage: function () {}
+};
+jspb.BinaryConstants.FieldType = {
+ INVALID: -1,
+ DOUBLE: 1,
+ FLOAT: 2,
+ INT64: 3,
+ UINT64: 4,
+ INT32: 5,
+ FIXED64: 6,
+ FIXED32: 7,
+ BOOL: 8,
+ STRING: 9,
+ GROUP: 10,
+ MESSAGE: 11,
+ BYTES: 12,
+ UINT32: 13,
+ ENUM: 14,
+ SFIXED32: 15,
+ SFIXED64: 16,
+ SINT32: 17,
+ SINT64: 18,
+ FHASH64: 30,
+ VHASH64: 31
+};
+jspb.BinaryConstants.WireType = {
+ INVALID: -1,
+ VARINT: 0,
+ FIXED64: 1,
+ DELIMITED: 2,
+ START_GROUP: 3,
+ END_GROUP: 4,
+ FIXED32: 5
+};
+
+jspb.BinaryConstants.FieldTypeToWireType = function (a) {
+ var b = jspb.BinaryConstants.FieldType,
+ c = jspb.BinaryConstants.WireType;
+
+ switch (a) {
+ case b.INT32:
+ case b.INT64:
+ case b.UINT32:
+ case b.UINT64:
+ case b.SINT32:
+ case b.SINT64:
+ case b.BOOL:
+ case b.ENUM:
+ case b.VHASH64:
+ return c.VARINT;
+
+ case b.DOUBLE:
+ case b.FIXED64:
+ case b.SFIXED64:
+ case b.FHASH64:
+ return c.FIXED64;
+
+ case b.STRING:
+ case b.MESSAGE:
+ case b.BYTES:
+ return c.DELIMITED;
+
+ case b.FLOAT:
+ case b.FIXED32:
+ case b.SFIXED32:
+ return c.FIXED32;
+
+ default:
+ return c.INVALID;
+ }
+};
+
+jspb.BinaryConstants.INVALID_FIELD_NUMBER = -1;
+jspb.BinaryConstants.FLOAT32_EPS = 1.401298464324817E-45;
+jspb.BinaryConstants.FLOAT32_MIN = 1.1754943508222875E-38;
+jspb.BinaryConstants.FLOAT32_MAX = 3.4028234663852886E38;
+jspb.BinaryConstants.FLOAT64_EPS = 4.9E-324;
+jspb.BinaryConstants.FLOAT64_MIN = 2.2250738585072014E-308;
+jspb.BinaryConstants.FLOAT64_MAX = 1.7976931348623157E308;
+jspb.BinaryConstants.TWO_TO_20 = 1048576;
+jspb.BinaryConstants.TWO_TO_23 = 8388608;
+jspb.BinaryConstants.TWO_TO_31 = 2147483648;
+jspb.BinaryConstants.TWO_TO_32 = 4294967296;
+jspb.BinaryConstants.TWO_TO_52 = 4503599627370496;
+jspb.BinaryConstants.TWO_TO_63 = 0x7fffffffffffffff;
+jspb.BinaryConstants.TWO_TO_64 = 1.8446744073709552E19;
+jspb.BinaryConstants.ZERO_HASH = "\x00\x00\x00\x00\x00\x00\x00\x00";
goog.array = {};
goog.NATIVE_ARRAY_PROTOTYPES = goog.TRUSTED_SITE;
goog.array.ASSUME_NATIVE_FUNCTIONS = 2012 < goog.FEATURESET_YEAR;
@@ -33555,111 +30451,464 @@ goog.crypt.xorByteArray = function (a, b) {
return c;
};
-goog.string = {};
-goog.string.internal = {};
+goog.dom.asserts = {};
-goog.string.internal.startsWith = function (a, b) {
- return 0 == a.lastIndexOf(b, 0);
-};
-
-goog.string.internal.endsWith = function (a, b) {
- var c = a.length - b.length;
- return 0 <= c && a.indexOf(b, c) == c;
-};
-
-goog.string.internal.caseInsensitiveStartsWith = function (a, b) {
- return 0 == goog.string.internal.caseInsensitiveCompare(b, a.substr(0, b.length));
-};
-
-goog.string.internal.caseInsensitiveEndsWith = function (a, b) {
- return 0 == goog.string.internal.caseInsensitiveCompare(b, a.substr(a.length - b.length, b.length));
-};
-
-goog.string.internal.caseInsensitiveEquals = function (a, b) {
- return a.toLowerCase() == b.toLowerCase();
-};
-
-goog.string.internal.isEmptyOrWhitespace = function (a) {
- return /^[\s\xa0]*$/.test(a);
-};
-
-goog.string.internal.trim = goog.TRUSTED_SITE && String.prototype.trim ? function (a) {
- return a.trim();
-} : function (a) {
- return /^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(a)[1];
-};
-
-goog.string.internal.caseInsensitiveCompare = function (a, b) {
- a = String(a).toLowerCase();
- b = String(b).toLowerCase();
- return a < b ? -1 : a == b ? 0 : 1;
-};
-
-goog.string.internal.newLineToBr = function (a, b) {
- return a.replace(/(\r\n|\r|\n)/g, b ? "
" : "
");
-};
-
-goog.string.internal.htmlEscape = function (a, b) {
- if (b) a = a.replace(goog.string.internal.AMP_RE_, "&").replace(goog.string.internal.LT_RE_, "<").replace(goog.string.internal.GT_RE_, ">").replace(goog.string.internal.QUOT_RE_, """).replace(goog.string.internal.SINGLE_QUOTE_RE_, "'").replace(goog.string.internal.NULL_RE_, "");else {
- if (!goog.string.internal.ALL_RE_.test(a)) return a;
- -1 != a.indexOf("&") && (a = a.replace(goog.string.internal.AMP_RE_, "&"));
- -1 != a.indexOf("<") && (a = a.replace(goog.string.internal.LT_RE_, "<"));
- -1 != a.indexOf(">") && (a = a.replace(goog.string.internal.GT_RE_, ">"));
- -1 != a.indexOf('"') && (a = a.replace(goog.string.internal.QUOT_RE_, """));
- -1 != a.indexOf("'") && (a = a.replace(goog.string.internal.SINGLE_QUOTE_RE_, "'"));
- -1 != a.indexOf("\x00") && (a = a.replace(goog.string.internal.NULL_RE_, ""));
+goog.dom.asserts.assertIsLocation = function (a) {
+ if (goog.asserts.ENABLE_ASSERTS) {
+ var b = goog.dom.asserts.getWindow_(a);
+ b && (!a || !(a instanceof b.Location) && a instanceof b.Element) && goog.asserts.fail("Argument is not a Location (or a non-Element mock); got: %s", goog.dom.asserts.debugStringForType_(a));
}
+
return a;
};
-goog.string.internal.AMP_RE_ = /&/g;
-goog.string.internal.LT_RE_ = //g;
-goog.string.internal.QUOT_RE_ = /"/g;
-goog.string.internal.SINGLE_QUOTE_RE_ = /'/g;
-goog.string.internal.NULL_RE_ = /\x00/g;
-goog.string.internal.ALL_RE_ = /[\x00&<>"']/;
-
-goog.string.internal.whitespaceEscape = function (a, b) {
- return goog.string.internal.newLineToBr(a.replace(/ /g, " "), b);
-};
-
-goog.string.internal.contains = function (a, b) {
- return -1 != a.indexOf(b);
-};
-
-goog.string.internal.caseInsensitiveContains = function (a, b) {
- return goog.string.internal.contains(a.toLowerCase(), b.toLowerCase());
-};
-
-goog.string.internal.compareVersions = function (a, b) {
- var c = 0;
- a = goog.string.internal.trim(String(a)).split(".");
- b = goog.string.internal.trim(String(b)).split(".");
-
- for (var d = Math.max(a.length, b.length), e = 0; 0 == c && e < d; e++) {
- var f = a[e] || "",
- g = b[e] || "";
-
- do {
- f = /(\d*)(\D*)(.*)/.exec(f) || ["", "", "", ""];
- g = /(\d*)(\D*)(.*)/.exec(g) || ["", "", "", ""];
- if (0 == f[0].length && 0 == g[0].length) break;
- c = 0 == f[1].length ? 0 : parseInt(f[1], 10);
- var h = 0 == g[1].length ? 0 : parseInt(g[1], 10);
- c = goog.string.internal.compareElements_(c, h) || goog.string.internal.compareElements_(0 == f[2].length, 0 == g[2].length) || goog.string.internal.compareElements_(f[2], g[2]);
- f = f[3];
- g = g[3];
- } while (0 == c);
+goog.dom.asserts.assertIsElementType_ = function (a, b) {
+ if (goog.asserts.ENABLE_ASSERTS) {
+ var c = goog.dom.asserts.getWindow_(a);
+ c && "undefined" != typeof c[b] && (a && (a instanceof c[b] || !(a instanceof c.Location || a instanceof c.Element)) || goog.asserts.fail("Argument is not a %s (or a non-Element, non-Location mock); got: %s", b, goog.dom.asserts.debugStringForType_(a)));
}
+ return a;
+};
+
+goog.dom.asserts.assertIsHTMLAnchorElement = function (a) {
+ return goog.dom.asserts.assertIsElementType_(a, "HTMLAnchorElement");
+};
+
+goog.dom.asserts.assertIsHTMLButtonElement = function (a) {
+ return goog.dom.asserts.assertIsElementType_(a, "HTMLButtonElement");
+};
+
+goog.dom.asserts.assertIsHTMLLinkElement = function (a) {
+ return goog.dom.asserts.assertIsElementType_(a, "HTMLLinkElement");
+};
+
+goog.dom.asserts.assertIsHTMLImageElement = function (a) {
+ return goog.dom.asserts.assertIsElementType_(a, "HTMLImageElement");
+};
+
+goog.dom.asserts.assertIsHTMLAudioElement = function (a) {
+ return goog.dom.asserts.assertIsElementType_(a, "HTMLAudioElement");
+};
+
+goog.dom.asserts.assertIsHTMLVideoElement = function (a) {
+ return goog.dom.asserts.assertIsElementType_(a, "HTMLVideoElement");
+};
+
+goog.dom.asserts.assertIsHTMLInputElement = function (a) {
+ return goog.dom.asserts.assertIsElementType_(a, "HTMLInputElement");
+};
+
+goog.dom.asserts.assertIsHTMLTextAreaElement = function (a) {
+ return goog.dom.asserts.assertIsElementType_(a, "HTMLTextAreaElement");
+};
+
+goog.dom.asserts.assertIsHTMLCanvasElement = function (a) {
+ return goog.dom.asserts.assertIsElementType_(a, "HTMLCanvasElement");
+};
+
+goog.dom.asserts.assertIsHTMLEmbedElement = function (a) {
+ return goog.dom.asserts.assertIsElementType_(a, "HTMLEmbedElement");
+};
+
+goog.dom.asserts.assertIsHTMLFormElement = function (a) {
+ return goog.dom.asserts.assertIsElementType_(a, "HTMLFormElement");
+};
+
+goog.dom.asserts.assertIsHTMLFrameElement = function (a) {
+ return goog.dom.asserts.assertIsElementType_(a, "HTMLFrameElement");
+};
+
+goog.dom.asserts.assertIsHTMLIFrameElement = function (a) {
+ return goog.dom.asserts.assertIsElementType_(a, "HTMLIFrameElement");
+};
+
+goog.dom.asserts.assertIsHTMLObjectElement = function (a) {
+ return goog.dom.asserts.assertIsElementType_(a, "HTMLObjectElement");
+};
+
+goog.dom.asserts.assertIsHTMLScriptElement = function (a) {
+ return goog.dom.asserts.assertIsElementType_(a, "HTMLScriptElement");
+};
+
+goog.dom.asserts.debugStringForType_ = function (a) {
+ if (goog.isObject(a)) try {
+ return a.constructor.displayName || a.constructor.name || Object.prototype.toString.call(a);
+ } catch (b) {
+ return "