(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i 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) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_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; } process.hrtime = require('browser-hrtime'); var React = require("react"); var ReactDOM = require("react-dom"); var debounce = require("debounce"); var util = require("util"); var _require = require("@validatem/core"), AggregrateValidationError = _require.AggregrateValidationError; var Editor = require("react-simple-code-editor")["default"]; var classnames = require("classnames"); var _require2 = require("prismjs"), _highlight = _require2.highlight, languages = _require2.languages; require("prismjs/components/prism-sql.js"); require("prismjs/components/prism-plsql.js"); var operations = require("../../src/operations"); var optimizeAST = require("../../src/ast/optimize"); var astToQuery = require("../../src/ast-to-query"); var optimizers = require("../../src/optimizers"); function evaluateCode(code) { var select = operations.select, onlyColumns = operations.onlyColumns, addColumns = operations.addColumns, alias = operations.alias, where = operations.where, column = operations.column, foreignColumn = operations.foreignColumn, table = operations.table, value = operations.value, parameter = operations.parameter, not = operations.not, anyOf = operations.anyOf, allOf = operations.allOf, lessThan = operations.lessThan, moreThan = operations.moreThan, equals = operations.equals, expression = operations.expression, unsafeSQL = operations.unsafeSQL; var query; try { eval(code); return { success: true, ast: query }; } catch (error) { return { success: false, error: error }; } } function processCode(code, activeOptimizers) { var result = evaluateCode(code); if (!result.success) { return result; } else { try { var _optimizeAST = optimizeAST(result.ast, optimizers.filter(function (optimizer) { return activeOptimizers.has(optimizer.name); })), timings = _optimizeAST.timings, ast = _optimizeAST.ast; var query = astToQuery(ast); return { success: true, query: query, ast: ast, timings: timings }; } catch (error) { return { success: false, error: error }; } } } var sampleCode = "\n// Edit me!\n\n/* Available functions:\nselect, onlyColumns, addColumns, alias, \nwhere, column, foreignColumn, table,\nvalue, parameter, \nnot, anyOf, allOf,\nlessThan, moreThan, equals,\nexpression, unsafeSQL\n*/\n\nlet niceNumbers = anyOf([ 1, 2, 3 ]);\n\nquery = select(\"projects\", [\n\twhere({\n\t\tnumber_one: niceNumbers,\n\t\tnumber_two: niceNumbers\n\t}),\n\twhere({\n\t\tnumber_three: anyOf([ 42, column(\"number_one\") ]),\n\t\tnumber_four: moreThan(1337)\n\t})\n]);\n".trim(); function JSEditor(_ref) { var onChanged = _ref.onChanged; var _React$useState = React.useState(sampleCode), _React$useState2 = _slicedToArray(_React$useState, 2), code = _React$useState2[0], setCode = _React$useState2[1]; var _React$useState3 = React.useState(), _React$useState4 = _slicedToArray(_React$useState3, 2), maybeRunCode = _React$useState4[0], setMaybeRunCode = _React$useState4[1]; React.useEffect(function () { setMaybeRunCode(function () { return debounce(function (code) { onChanged(code); }, 200); }); }, [onChanged]); return /*#__PURE__*/React.createElement(Editor, { value: code, onValueChange: function onValueChange(value) { setCode(value); maybeRunCode(value); }, highlight: function highlight(code) { return _highlight(code, languages.js); }, padding: 10, insertSpaces: false, style: { // fontFamily: '"Fira code", "Fira Mono", monospace', // fontSize: 16, fontFamily: "monospace", fontSize: 16, height: "100%", tabSize: 4 } }); } function HighlightedCode(_ref2) { var code = _ref2.code, language = _ref2.language; return /*#__PURE__*/React.createElement("pre", { dangerouslySetInnerHTML: { __html: _highlight(code, languages[language]) } }); } function HighlightedData(_ref3) { var data = _ref3.data; return /*#__PURE__*/React.createElement(HighlightedCode, { code: util.inspect(data, { depth: null }), language: "js" }); } function App() { var _React$useState5 = React.useState(null), _React$useState6 = _slicedToArray(_React$useState5, 2), result = _React$useState6[0], setResult = _React$useState6[1]; var _React$useState7 = React.useState(sampleCode), _React$useState8 = _slicedToArray(_React$useState7, 2), code = _React$useState8[0], setCode = _React$useState8[1]; var _React$useState9 = React.useState(null), _React$useState10 = _slicedToArray(_React$useState9, 2), lastGoodResult = _React$useState10[0], setLastGoodResult = _React$useState10[1]; var _React$useState11 = React.useState([new Set(optimizers.map(function (optimizer) { return optimizer.name; }))]), _React$useState12 = _slicedToArray(_React$useState11, 2), activeOptimizers = _React$useState12[0], setActiveOptimizers = _React$useState12[1]; React.useEffect(function () { if (result != null && result.success === true) { setLastGoodResult(result); } else if (result != null && result.success === false) { console.error(result.error); } }, [result]); React.useEffect(function () { if (code != null) { setResult(processCode(code, activeOptimizers[0])); } }, [code, activeOptimizers]); var configurableOptimizers = new Set(optimizers.filter(function (optimizer) { return !optimizer.category.includes("normalization"); }).map(function (optimizer) { return optimizer.name; })); return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", { className: "layout" }, /*#__PURE__*/React.createElement("div", { className: classnames("result", { failed: result != null && !result.success }) }, lastGoodResult != null ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(HighlightedCode, { code: lastGoodResult.query.query, language: "plsql" }), /*#__PURE__*/React.createElement(HighlightedData, { data: lastGoodResult.query.params })) : "Result goes here..."), /*#__PURE__*/React.createElement("div", { className: "editor" }, /*#__PURE__*/React.createElement("div", { className: "code" }, /*#__PURE__*/React.createElement(JSEditor, { onChanged: function onChanged(code) { setCode(code); } })), /*#__PURE__*/React.createElement("div", { className: classnames("ast", { failed: result != null && !result.success }) }, lastGoodResult != null ? /*#__PURE__*/React.createElement(HighlightedData, { data: result.ast }) // ? : "Please wait..."), /*#__PURE__*/React.createElement("div", { className: classnames("options", { failed: result != null && !result.success }) }, /*#__PURE__*/React.createElement("h1", null, "Options"), optimizers.map(function (optimizer) { var configurable = configurableOptimizers.has(optimizer.name); return /*#__PURE__*/React.createElement("div", { className: "optimizerOption", key: optimizer.name }, /*#__PURE__*/React.createElement("input", { type: "checkbox", name: optimizer.name, id: optimizer.name, checked: activeOptimizers[0].has(optimizer.name), disabled: !configurable, onChange: function onChange() { if (activeOptimizers[0].has(optimizer.name)) { activeOptimizers[0]["delete"](optimizer.name); } else { activeOptimizers[0].add(optimizer.name); } setActiveOptimizers([activeOptimizers[0]]); } }), /*#__PURE__*/React.createElement("label", { htmlFor: optimizer.name }, /*#__PURE__*/React.createElement("span", { className: "time" }, lastGoodResult != null && lastGoodResult.timings[optimizer.name] != null ? "".concat((lastGoodResult.timings[optimizer.name] / 1e6).toFixed(), " ms") : "? ms"), optimizer.name, configurable ? null : " (required)")); })))), result != null && result.success === false ? /*#__PURE__*/React.createElement("div", { className: "error" }, /*#__PURE__*/React.createElement("strong", null, "Oh no!"), /*#__PURE__*/React.createElement("pre", { "class": "errorMessage" }, result.error.message), result.error instanceof AggregrateValidationError ? null : /*#__PURE__*/React.createElement("pre", { "class": "errorStack" }, result.error.stack)) : null); } ReactDOM.render( /*#__PURE__*/React.createElement(App, null), document.querySelector("#app")); }).call(this,require('_process')) },{"../../src/ast-to-query":145,"../../src/ast/optimize":146,"../../src/operations":161,"../../src/optimizers":178,"@validatem/core":219,"_process":122,"browser-hrtime":38,"classnames":40,"debounce":41,"prismjs":121,"prismjs/components/prism-plsql.js":119,"prismjs/components/prism-sql.js":120,"react":131,"react-dom":127,"react-simple-code-editor":128,"util":143}],2:[function(require,module,exports){ "use strict"; const withContext = require("@validatem/with-context"); module.exports = function allowExtraProperties (rules) { return withContext(rules, { allowExtraProperties: true }); }; },{"@validatem/with-context":29}],3:[function(require,module,exports){ "use strict"; const matchValidationError = require("@validatem/match-validation-error"); module.exports = function annotateErrors(options) { if (options.pathSegments == null) { throw new Error(`'pathSegments' is a required option`); } else if (!Array.isArray(options.pathSegments)) { throw new Error(`'pathSegments' must be an array`); } else if (options.errors == null) { throw new Error(`'errors' is a required option`); } else if (!Array.isArray(options.errors)) { throw new Error(`'errors' must be an array`); } else { // NOTE: We mutate the error here, because Error objects are not safely cloneable for (let error of options.errors) { // Leave non-ValidationError errors alone, even though they should not be present if (matchValidationError(error)) { error.path = options.pathSegments.concat(error.path); } } return options.errors; } }; },{"@validatem/match-validation-error":21}],4:[function(require,module,exports){ "use strict"; const defaultValue = require("default-value"); const ValidationError = require("@validatem/error"); const combinator = require("@validatem/combinator"); const annotateErrors = require("@validatem/annotate-errors"); const virtualProperty = require("@validatem/virtual-property"); const validationResult = require("@validatem/validation-result"); module.exports = function (rules) { if (rules.key == null && rules.value == null) { throw new Error(`Must specify either a 'key' or 'value' property in the ruleset`); } else { let keyRules = defaultValue(rules.key, []); let valueRules = defaultValue(rules.value, []); let validator = combinator((object, applyValidators) => { let newObject = {}; let allErrors = []; if (typeof object !== "object" || Array.isArray(object)) { throw new ValidationError("Must be an object"); } else { // NOTE: Reflect.ownEntries is used here to ensure we capture the Symbol-typed keys as well for (let key of Reflect.ownKeys(object)) { let value = object[key]; let keyAsString = key.toString(); // Again, to deal with Symbol-typed keys. let { errors: keyErrors, newValue: newKey } = applyValidators(key, keyRules); let { errors: valueErrors, newValue } = applyValidators(value, valueRules); let annotatedKeyErrors = annotateErrors({ pathSegments: [ keyAsString, virtualProperty("key") ], errors: keyErrors }); let annotatedValueErrors = annotateErrors({ pathSegments: [ keyAsString, virtualProperty("value") ], errors: valueErrors }); newObject[newKey] = newValue; allErrors.push(...annotatedKeyErrors, ...annotatedValueErrors); } return validationResult({ errors: allErrors, newValue: newObject }); } }); validator.callIfNull = false; return validator; } }; },{"@validatem/annotate-errors":3,"@validatem/combinator":6,"@validatem/error":11,"@validatem/validation-result":27,"@validatem/virtual-property":28,"default-value":44}],5:[function(require,module,exports){ "use strict"; const combinator = require("@validatem/combinator"); const validationResult = require("@validatem/validation-result"); const annotateErrors = require("@validatem/annotate-errors"); const isArray = require("@validatem/is-array"); module.exports = function (rules) { let validator = combinator((value, applyValidators) => { let newArray = []; let allErrors = []; value.forEach((item, i) => { let { errors, newValue } = applyValidators(item, rules); let annotatedErrors = annotateErrors({ pathSegments: [ i ], errors: errors }); newArray.push(newValue); allErrors.push(...annotatedErrors); }); return validationResult({ errors: allErrors, newValue: newArray }); }); validator.callIfNull = false; return [ isArray, validator ]; }; },{"@validatem/annotate-errors":3,"@validatem/combinator":6,"@validatem/is-array":13,"@validatem/validation-result":27}],6:[function(require,module,exports){ (function (__dirname){ "use strict"; module.exports = function defineCombinator(callback) { return { callback: callback, callIfNull: true, ___validatem_isSpecial: true, ___validatem_isCombinator: true, ___validatem_combinatorVersion: 1 }; }; module.exports.__modulePath = __dirname; }).call(this,"/../node_modules/@validatem/combinator") },{}],7:[function(require,module,exports){ "use strict"; const isCallable = require("is-callable"); function createDefaultReturner(defaultValue, isLiteral) { let defaultFunction = function defaultTo(value) { if (value == null) { if (isLiteral === false && isCallable(defaultValue)) { return defaultValue(); } else { return defaultValue; } } }; defaultFunction.callIfNull = true; return defaultFunction; } module.exports = function (defaultValue) { return createDefaultReturner(defaultValue, false); }; module.exports.literal = function (defaultValue) { return createDefaultReturner(defaultValue, true); } },{"is-callable":105}],8:[function(require,module,exports){ "use strict"; // TODO: Rename this to something more appropriate, like any/anyOf? How to make sure that doesn't cause confusion with `oneOf`? const flatten = require("flatten"); const ValidationError = require("@validatem/error"); const combinator = require("@validatem/combinator"); const validationResult = require("@validatem/validation-result"); const matchValidationError = require("@validatem/match-validation-error"); const areErrorsFromSameOrigin = require("./src/are-errors-from-same-origin"); function unpackNestedEithers(errors) { // NOTE: We only unpack `either` errors that occurred *at the same level* as this error, ie. where there's directly a case of `either(either(...), ...)`, without any kind of data nesting (like `arrayOf` or `hasShape`) inbetween. Nested-data failures should still be shown separately, as their resolution strategy is actually different; unlike same-level nested `either` errors, where the nesting is purely an implementation detail that allows composing sets of alternatives together. return flatten(errors.map((error) => { if (error.path.length === 0 && error.__isValidatemEitherError) { return error.subErrors; } else { return error; } })); } function hasNestedPaths(error) { if (error.path.length > 0) { return true; } else if (error.subErrors != null) { return error.subErrors.some((subError) => { return hasNestedPaths(subError); }); } else { return false; } } function errorAtLeastOneOf(errors) { return new ValidationError(`Must satisfy at least one of:`, { subErrors: unpackNestedEithers(errors), __isValidatemEitherError: true }); } function errorAllOf(errors) { return new ValidationError("Must satisfy all of the following:", { subErrors: errors }); } module.exports = function (alternatives) { if (!Array.isArray(alternatives)) { throw new Error(`Must specify an array of alternatives`); } else if (alternatives.length < 2) { // This doesn't interfere with conditionally-specified alternatives using ternary expressions, because in those cases there is still *some* item specified, it's just going to have a value of `undefined` (and will subsequently be filtered out) throw new Error("Must specify at least two alternatives"); } else if (arguments.length > 1) { throw new Error(`Only one argument is accepted; maybe you forgot to wrap the different alternatives into an array?`); } else { return combinator((value, applyValidators, context) => { let allErrors = []; for (let alternative of alternatives) { let { errors, newValue } = applyValidators(value, alternative); let unexpectedErrors = errors.filter((error) => !matchValidationError(error)); if (unexpectedErrors.length > 0) { // We want to immediately stop trying alternatives when a non-ValidationError occurred, since that means that something broke internally somewhere, and it is not safe to continue executing. throw unexpectedErrors[0]; } else { if (errors.length === 0) { return newValue; } else if (errors.length === 1) { allErrors.push(errors[0]); } else { allErrors.push(errorAllOf(errors)); } } } /* We want to separate out the errors that occurred at this "level"; that is, errors that *didn't* originate from a nested validation combinator like `has-shape` or `array-of`. Otherwise, the user could get very confusing errors that combine the `either` alternatives and some deeper validation error into a single list, without denoting the path. An example of such a confusing error: - At options -> credentials: Must satisfy at least one of: "Must be a plain object (eg. object literal)", "Encountered an unexpected property 'foo'" With this implementation, it becomes a perfectly reasonable error instead: - At options -> credentials -> 1: Encountered an unexpected property 'foo'" */ let nestedErrors = allErrors.filter((error) => { return hasNestedPaths(error); }); if (!context.__validatemNoHeuristics && nestedErrors.length > 0) { let sameOrigin = areErrorsFromSameOrigin(nestedErrors); if (sameOrigin || nestedErrors.length === 1) { // One of the alternatives *did* match, but it failed somewhere further down the tree, and we don't have any errors originating from *other* nested rules. Chances are that the user intended to match the failing branch, so we pretend that the other alternatives don't exist, and pass through the original error(s). return validationResult({ errors: nestedErrors }); } else { // Somewhere, possibly nested inside of a "must satisfy all", we've seen errors at varying subpaths. This means that the user probably tried to match some sort of arm, but we don't know which, because the origins are not identical. Therefore we will just remove all the top-level errors, and only show the ones that are at *some* sort of sub-path. throw errorAtLeastOneOf(nestedErrors); } } else { // We have no idea what the intention was, as there are no nested errors. Just show all of the errors. throw errorAtLeastOneOf(allErrors); } }); } }; },{"./src/are-errors-from-same-origin":10,"@validatem/combinator":6,"@validatem/error":11,"@validatem/match-validation-error":21,"@validatem/validation-result":27,"flatten":98}],9:[function(require,module,exports){ "use strict"; module.exports = function areArraysEqual(a, b) { if (a.length !== b.length) { return false; } else { for (let [ i, item ] of a.entries()) { if (b[i] !== item) { return false; } } return true; } }; },{}],10:[function(require,module,exports){ "use strict"; const areArraysEqual = require("./are-arrays-equal"); module.exports = function areErrorsFromSameOrigin(errors) { let referencePath = null; function checkErrors(errors, basePath = []) { return errors.every((error) => { let absolutePath = basePath.concat(error.path); if (referencePath == null) { // Whatever we encounter first is the reference path. However, we don't return `true` here; even if we assume the error's own path to be correct (since it's the reference path...), the error may still have subErrors with a different path! referencePath = absolutePath; } let subErrorsEqual = (error.subErrors != null) ? checkErrors(error.subErrors, absolutePath) : true; let selfEqual = areArraysEqual(referencePath, absolutePath); return (selfEqual && subErrorsEqual); }); } return checkErrors(errors); }; },{"./are-arrays-equal":9}],11:[function(require,module,exports){ (function (__dirname){ "use strict"; // NOTE: We don't actually inherit from the real Error here, because collecting stacktraces is very expensive and largely useless for our purposes. Validatem's own error reporting is clear enough, and if not, that's a bug in Validatem anyway. function ValidationError(message, properties) { this.message = message; Object.assign(this, { path: [], ___validatem_isValidationError: true, ___validatem_errorVersion: 1 }); Object.assign(this, properties); } ValidationError.prototype.name = "ValidationError"; module.exports = ValidationError; module.exports.__modulePath = __dirname; }).call(this,"/../node_modules/@validatem/error") },{}],12:[function(require,module,exports){ "use strict"; // NOTE: For use with eg. allowExtraProperties, to blacklist certain specific properties const ValidationError = require("@validatem/error"); module.exports = function (value) { if (value !== undefined) { throw new ValidationError("Value exists in a place that should be empty"); } }; },{"@validatem/error":11}],13:[function(require,module,exports){ "use strict"; const ValidationError = require("@validatem/error"); module.exports = function (value) { // TODO: Verify whether this check needs to be changed to support cross-realm arrays if (!Array.isArray(value)) { throw new ValidationError(`Must be an array`); } }; },{"@validatem/error":11}],14:[function(require,module,exports){ "use strict"; const ValidationError = require("@validatem/error"); const isBooleanObject = require("is-boolean-object"); module.exports = function (value) { if (!isBooleanObject(value)) { throw new ValidationError("Must be a boolean"); } }; },{"@validatem/error":11,"is-boolean-object":104}],15:[function(require,module,exports){ "use strict"; const isDateObject = require("is-date-object"); const ValidationError = require("@validatem/error"); module.exports = function (value) { if (!isDateObject(value)) { throw new ValidationError("Must be a Date object"); } }; },{"@validatem/error":11,"is-date-object":106}],16:[function(require,module,exports){ "use strict"; const ValidationError = require("@validatem/error"); const isCallable = require("is-callable"); module.exports = function (value) { if (!isCallable(value)) { throw new ValidationError("Must be a function"); } }; },{"@validatem/error":11,"is-callable":105}],17:[function(require,module,exports){ "use strict"; const ValidationError = require("@validatem/error"); const isNumberObject = require("is-number-object"); // FIXME: Document that NaN is not permitted but Infinity is module.exports = function (value) { if (!isNumberObject(value)) { throw new ValidationError("Must be a number"); } else if (Number.isNaN(value)) { throw new ValidationError(`Must be a number (must not be NaN)`); } }; },{"@validatem/error":11,"is-number-object":107}],18:[function(require,module,exports){ "use strict"; const ValidationError = require("@validatem/error"); const isPlainObj = require("is-plain-obj"); module.exports = function(value) { if (!isPlainObj(value)) { throw new ValidationError("Must be a plain object (eg. object literal)"); } }; },{"@validatem/error":11,"is-plain-obj":108}],19:[function(require,module,exports){ "use strict"; const ValidationError = require("@validatem/error"); const isString = require("is-string"); module.exports = function (value) { if (!isString(value)) { throw new ValidationError("Must be a string"); } }; },{"@validatem/error":11,"is-string":110}],20:[function(require,module,exports){ "use strict"; const ValidationError = require("@validatem/error"); const util = require("util"); module.exports = function (expectedValue) { if (expectedValue != null) { return function (value) { // TODO: Add special deep-equals handling for eg. arrays and objects? if (value !== expectedValue) { throw new ValidationError(`Must be exactly this value: ${util.inspect(expectedValue)}`); } }; } else { throw new Error("Argument to `isValue` must be a non-null value"); } }; },{"@validatem/error":11,"util":143}],21:[function(require,module,exports){ "use strict"; const createVersionedSpecialCheck = require("@validatem/match-versioned-special"); module.exports = createVersionedSpecialCheck({ markerProperty: "___validatem_isValidationError", versionProperty: "___validatem_errorVersion", friendlyName: "a ValidationError", expectedVersions: [ 1 ] }); },{"@validatem/match-versioned-special":22}],22:[function(require,module,exports){ "use strict"; /* Validatem has a separate package for each sort of (public) special value/marker, rather than just stuffing them all into @validatem/core. This is for three reasons: 1) To reduce module duplication. If for some reason two validators depend on slightly different versions of Validatem plumbing, it's much better if that plumbing is *just* an object factory, and not the entirety of @validatem/core. 2) To make versioning easier. Special values/types can now be independently versioned, so even if the @validatem/core API changes in a breaking manner, validators do not need to be updated to use a newer @validatem/core; because they don't depend on it *at all*, and instead depend on these individual plumbing modules, which will probably *never* have a breaking change. 3) Even *if* one of the plumbing modules gets a breaking release, it's easy to write @validatem/core and other plumbing modules such that they can deal with multiple different versions of plumbing objects, without requiring validators to update their dependency to remain compatible. To accomplish these goals, all these plumbing modules produce objects with some metadata that identifies a) it being a special object, b) the type of special object, and c) the version of that object's API, which will match the semver-major version of the module that it originates from. This function is used to check for the various different kinds of special objects, and ensure that they are of a supported version (eg. older @validatem/core modules cannot deal with newer versions of plumbing objects). If breaking releases occur for plumbing modules in the future, this logic can also check for *multiple* acceptable versions, and the *handling* logic for those special plumbing objects will be updated so that it is capable of handling both older and newer versions. This is a generalized solution to the problem of modular plumbing, and should also be useful for other modular toolkits. Time will tell whether this model actually ends up working as well in practice as it does on paper. */ // TODO: Add a module copy mismatch check here that is based on __modulePath, to detect redundant copies? Similar to how validation-error.js used to do an instance check module.exports = function createVersionedSpecialMatcher({ markerProperty, versionProperty, friendlyName, expectedVersions }) { return function isSpecial(value) { if (value[markerProperty]) { if (expectedVersions.includes(value[versionProperty])) { return true; } else { throw new Error(`Encountered ${friendlyName} with version ${value[versionProperty]}, but we were expecting one of versions [ ${expectedVersions.join(", ")} ]; this probably means you tried to use a validator that is incompatible with your version of @validatem/core, or with some other Validatem utility. Look at the stacktrace to determine where the mismatch is happening.`); } } else { return false; } }; }; },{}],23:[function(require,module,exports){ "use strict"; const ValidationError = require("@validatem/error"); const isRegex = require("is-regex"); module.exports = function (regex) { if (isRegex(regex)) { return function (value) { if (!regex.test(value)) { throw new ValidationError(`Must match format: ${regex}`); } }; } else { throw new Error(`You must specify a regex to match against`); } }; },{"@validatem/error":11,"is-regex":109}],24:[function(require,module,exports){ "use strict"; const combinator = require("@validatem/combinator"); const validationResult = require("@validatem/validation-result"); const annotateErrors = require("@validatem/annotate-errors"); const isArray = require("@validatem/is-array"); module.exports = function (rules) { let validator = combinator((value, applyValidators) => { let allErrors = []; function validateArray(array, path = []) { let newArray = []; array.forEach((item, i) => { let itemPath = path.concat([ i ]); if (Array.isArray(item)) { newArray.push(validateArray(item, itemPath)); } else { let { errors, newValue } = applyValidators(item, rules); let annotatedErrors = annotateErrors({ pathSegments: itemPath, errors: errors }); newArray.push(newValue); allErrors.push(...annotatedErrors); } }); return newArray; } return validationResult({ errors: allErrors, newValue: validateArray(value) }); }); validator.callIfNull = false; return [ isArray, validator ]; }; },{"@validatem/annotate-errors":3,"@validatem/combinator":6,"@validatem/is-array":13,"@validatem/validation-result":27}],25:[function(require,module,exports){ "use strict"; const ValidationError = require("@validatem/error"); const util = require("util"); module.exports = function (validValues) { if (Array.isArray(validValues)) { let validValueSet = new Set(validValues); return function (value) { if (!validValueSet.has(value)) { throw new ValidationError(`Must be one of: ${validValues.map((item) => util.inspect(item)).join(", ")}`); } }; } else { throw new Error("Argument to `oneOf` must be an array of values"); } }; },{"@validatem/error":11,"util":143}],26:[function(require,module,exports){ (function (__dirname){ "use strict"; module.exports = { ___validatem_isSpecial: true, ___validatem_isRequiredMarker: true, ___validatem_requiredMarkerVersion: 1, }; module.exports.__modulePath = __dirname; }).call(this,"/../node_modules/@validatem/required") },{}],27:[function(require,module,exports){ (function (__dirname){ "use strict"; const defaultValue = require("default-value"); module.exports = function validationResult({ errors, newValue }) { return { errors: defaultValue(errors, []), newValue: newValue, ___validatem_isSpecial: true, ___validatem_isValidationResult: true, ___validatem_validationResultVersion: 1, }; }; module.exports.__modulePath = __dirname; }).call(this,"/../node_modules/@validatem/validation-result") },{"default-value":44}],28:[function(require,module,exports){ "use strict"; module.exports = function virtualProperty(name) { return { name: name, ___validatem_isSpecial: true, ___validatem_isVirtualProperty: true, ___validatem_virtualPropertyVersion: 1, }; }; },{}],29:[function(require,module,exports){ "use strict"; const combinator = require("@validatem/combinator"); module.exports = function withContext(rules, context) { return combinator((item, applyValidators, parentContext) => { let mergedContext = Object.assign({}, parentContext, context); return applyValidators(item, rules, mergedContext); }); }; },{"@validatem/combinator":6}],30:[function(require,module,exports){ "use strict"; const defaultValue = require("default-value"); const asExpression = require("as-expression"); const splitFilterN = require("split-filter-n"); const combinator = require("@validatem/combinator"); const ValidationError = require("@validatem/error"); const matchValidationError = require("@validatem/match-validation-error"); const validationResult = require("@validatem/validation-result"); // TODO: Document that this passes on context function concat(arrays) { return arrays.slice(1).reduce((combined, array) => { return combined.concat(array); }, arrays[0]); } module.exports = function wrapError(message, rules, options = {}) { let preserveOriginalErrors = defaultValue(options.preserveOriginalErrors, false); return combinator((value, applyValidators, context) => { let result = applyValidators(value, rules, context); if (result.errors.length > 0) { let { errors, newValue } = result; let errorsByType = splitFilterN(errors, [ "validationRoot", "validationPath", "other" ], (error) => { if (matchValidationError(error)) { if (error.path.length === 0) { return "validationRoot"; } else { return "validationPath"; } } else { return "other"; } }); let hasRootValidationErrors = errorsByType.validationRoot.length > 0; let hasPathValidationErrors = errorsByType.validationPath.length > 0; let hasValidationErrors = hasRootValidationErrors || hasPathValidationErrors; let transformedValidationErrors = asExpression(() => { if (hasValidationErrors) { if (!preserveOriginalErrors) { return [ new ValidationError(message) ]; } else { // If possible, we try to move any subpath errors into the subErrors of an (optionally newly-created) root error. Otherwise, it can become difficult for the user to correlate together the root and subpath errors that are related, when we start changing the messages of the root errors. if (errorsByType.validationRoot.length === 0) { return [ new ValidationError(message, { subErrors: errorsByType.validationPath }) ]; } else if (errorsByType.validationRoot.length === 1) { let error = errorsByType.validationRoot[0]; // TODO: Currently we cannot set `originalError` due to a bug in `create-error`; switch to a better error implementation return [ new ValidationError(`${message} (${error.message})`, { subErrors: errorsByType.validationPath }) ]; } else { // If there are multiple root errors, we cannot determine which root error the subpath errors belong to, so we'll just provide them as a flat list return concat([ errorsByType.validationRoot.map((error) => { return new ValidationError(`${message} (${error.message})`) }), errorsByType.validationPath ]); } } } else { return []; } }); return validationResult({ newValue: newValue, errors: concat([ transformedValidationErrors, errorsByType.other ]) }); } else { return result; } }); }; },{"@validatem/combinator":6,"@validatem/error":11,"@validatem/match-validation-error":21,"@validatem/validation-result":27,"as-expression":35,"default-value":44,"split-filter-n":138}],31:[function(require,module,exports){ 'use strict'; var ArraySpeciesCreate = require('es-abstract/2019/ArraySpeciesCreate'); var FlattenIntoArray = require('es-abstract/2019/FlattenIntoArray'); var Get = require('es-abstract/2019/Get'); var ToInteger = require('es-abstract/2019/ToInteger'); var ToLength = require('es-abstract/2019/ToLength'); var ToObject = require('es-abstract/2019/ToObject'); module.exports = function flat() { var O = ToObject(this); var sourceLen = ToLength(Get(O, 'length')); var depthNum = 1; if (arguments.length > 0 && typeof arguments[0] !== 'undefined') { depthNum = ToInteger(arguments[0]); } var A = ArraySpeciesCreate(O, 0); FlattenIntoArray(A, O, sourceLen, 0, depthNum); return A; }; },{"es-abstract/2019/ArraySpeciesCreate":47,"es-abstract/2019/FlattenIntoArray":52,"es-abstract/2019/Get":54,"es-abstract/2019/ToInteger":69,"es-abstract/2019/ToLength":70,"es-abstract/2019/ToObject":72}],32:[function(require,module,exports){ 'use strict'; var define = require('define-properties'); var callBind = require('es-abstract/helpers/callBind'); var implementation = require('./implementation'); var getPolyfill = require('./polyfill'); var polyfill = getPolyfill(); var shim = require('./shim'); var boundFlat = callBind(polyfill); define(boundFlat, { getPolyfill: getPolyfill, implementation: implementation, shim: shim }); module.exports = boundFlat; },{"./implementation":31,"./polyfill":33,"./shim":34,"define-properties":46,"es-abstract/helpers/callBind":84}],33:[function(require,module,exports){ 'use strict'; var implementation = require('./implementation'); module.exports = function getPolyfill() { return Array.prototype.flat || implementation; }; },{"./implementation":31}],34:[function(require,module,exports){ 'use strict'; var define = require('define-properties'); var getPolyfill = require('./polyfill'); module.exports = function shimFlat() { var polyfill = getPolyfill(); define( Array.prototype, { flat: polyfill }, { flat: function () { return Array.prototype.flat !== polyfill; } } ); return polyfill; }; },{"./polyfill":33,"define-properties":46}],35:[function(require,module,exports){ "use strict"; module.exports = function asExpression(func) { return func(); }; },{}],36:[function(require,module,exports){ 'use strict'; module.exports = require("./lib"); },{"./lib":37}],37:[function(require,module,exports){ 'use strict'; module.exports = function (value) { if (value == null) { return []; } else if (Array.isArray(value)) { return value; } else { return [value]; } }; },{}],38:[function(require,module,exports){ (function (process){ !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):(e=e||self).hrtime=o()}(this,(function(){"use strict";var e=function(e){var o=Math.floor(.001*(Date.now()-performance.now())),r=.001*performance.now(),n=Math.floor(r)+o,t=Math.floor(r%1*1e9);return e&&(n-=e[0],(t-=e[1])<0&&(n--,t+=1e9)),[n,t]};return e.bigint=function(o){var r=e(o);return 1e9*r[0]+r[1]},"undefined"!=typeof process&&void 0!==process.hrtime||void 0!==window.process||(window.process={}),void 0===process.hrtime?window.process.hrtime=e:process.hrtime})); }).call(this,require('_process')) },{"_process":122}],39:[function(require,module,exports){ },{}],40:[function(require,module,exports){ /*! Copyright (c) 2017 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ /* global define */ (function () { 'use strict'; var hasOwn = {}.hasOwnProperty; function classNames () { var classes = []; for (var i = 0; i < arguments.length; i++) { var arg = arguments[i]; if (!arg) continue; var argType = typeof arg; if (argType === 'string' || argType === 'number') { classes.push(arg); } else if (Array.isArray(arg) && arg.length) { var inner = classNames.apply(null, arg); if (inner) { classes.push(inner); } } else if (argType === 'object') { for (var key in arg) { if (hasOwn.call(arg, key) && arg[key]) { classes.push(key); } } } } return classes.join(' '); } if (typeof module !== 'undefined' && module.exports) { classNames.default = classNames; module.exports = classNames; } else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) { // register as 'classnames', consistent with npm package name define('classnames', [], function () { return classNames; }); } else { window.classNames = classNames; } }()); },{}],41:[function(require,module,exports){ /** * Returns a function, that, as long as it continues to be invoked, will not * be triggered. The function will be called after it stops being called for * N milliseconds. If `immediate` is passed, trigger the function on the * leading edge, instead of the trailing. The function also has a property 'clear' * that is a function which will clear the timer to prevent previously scheduled executions. * * @source underscore.js * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/ * @param {Function} function to wrap * @param {Number} timeout in ms (`100`) * @param {Boolean} whether to execute at the beginning (`false`) * @api public */ function debounce(func, wait, immediate){ var timeout, args, context, timestamp, result; if (null == wait) wait = 100; function later() { var last = Date.now() - timestamp; if (last < wait && last >= 0) { timeout = setTimeout(later, wait - last); } else { timeout = null; if (!immediate) { result = func.apply(context, args); context = args = null; } } }; var debounced = function(){ context = this; args = arguments; timestamp = Date.now(); var callNow = immediate && !timeout; if (!timeout) timeout = setTimeout(later, wait); if (callNow) { result = func.apply(context, args); context = args = null; } return result; }; debounced.clear = function() { if (timeout) { clearTimeout(timeout); timeout = null; } }; debounced.flush = function() { if (timeout) { result = func.apply(context, args); context = args = null; clearTimeout(timeout); timeout = null; } }; return debounced; }; // Adds compatibility for ES modules debounce.debounce = debounce; module.exports = debounce; },{}],42:[function(require,module,exports){ (function (process){ /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); /** * Colors. */ exports.colors = [ '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33' ]; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // Is firebug? http://stackoverflow.com/a/398120/376773 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || // Double check webkit in userAgent just in case we are in a worker (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } const c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, match => { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.log()` when available. * No-op when `console.log` is not a "function". * * @api public */ function log(...args) { // This hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return typeof console === 'object' && console.log && console.log(...args); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { let r; try { r = exports.storage.getItem('debug'); } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } module.exports = require('./common')(exports); const {formatters} = module.exports; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; }).call(this,require('_process')) },{"./common":43,"_process":122}],43:[function(require,module,exports){ /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require('ms'); Object.keys(env).forEach(key => { createDebug[key] = env[key]; }); /** * Active `debug` instances. */ createDebug.instances = []; /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { let hash = 0; for (let i = 0; i < namespace.length; i++) { hash = ((hash << 5) - hash) + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { let prevTime; function debug(...args) { // Disabled? if (!debug.enabled) { return; } const self = debug; // Set `diff` timestamp const curr = Number(new Date()); const ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations let index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return match; } index++; const formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { const val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); const logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = createDebug.enabled(namespace); debug.useColors = createDebug.useColors(); debug.color = selectColor(namespace); debug.destroy = destroy; debug.extend = extend; // Debug.formatArgs = formatArgs; // debug.rawLog = rawLog; // env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } createDebug.instances.push(debug); return debug; } function destroy() { const index = createDebug.instances.indexOf(this); if (index !== -1) { createDebug.instances.splice(index, 1); return true; } return false; } function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.names = []; createDebug.skips = []; let i; const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); const len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } for (i = 0; i < createDebug.instances.length; i++) { const instance = createDebug.instances[i]; instance.enabled = createDebug.enabled(instance.namespace); } } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { const namespaces = [ ...createDebug.names.map(toNamespace), ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) ].join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } let i; let len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Convert regexp to namespace * * @param {RegExp} regxep * @return {String} namespace * @api private */ function toNamespace(regexp) { return regexp.toString() .substring(2, regexp.toString().length - 2) .replace(/\.\*\?$/, '*'); } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; },{"ms":113}],44:[function(require,module,exports){ arguments[4][36][0].apply(exports,arguments) },{"./lib":45,"dup":36}],45:[function(require,module,exports){ 'use strict'; var promiseTry = require("es6-promise-try"); function evaluateValue(value) { if (typeof value === "function") { return value(); } else { return value; } } function maybeEvaluateValue(value, evaluate) { if (evaluate === true) { return evaluateValue(value); } else { return value; } } function defaultValue(value, fallbackValue) { var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; value = maybeEvaluateValue(value, options.evaluate); if (value != null) { return value; } else { return maybeEvaluateValue(fallbackValue, options.evaluate); } } defaultValue.async = function defaultAsyncValue(value, fallbackValue) { var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; return promiseTry(function () { return maybeEvaluateValue(value, options.evaluate); }).then(function (resultValue) { if (resultValue != null) { return resultValue; } else { return maybeEvaluateValue(fallbackValue, options.evaluate); } }); }; module.exports = defaultValue; },{"es6-promise-try":96}],46:[function(require,module,exports){ 'use strict'; var keys = require('object-keys'); var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; var toStr = Object.prototype.toString; var concat = Array.prototype.concat; var origDefineProperty = Object.defineProperty; var isFunction = function (fn) { return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; }; var arePropertyDescriptorsSupported = function () { var obj = {}; try { origDefineProperty(obj, 'x', { enumerable: false, value: obj }); // eslint-disable-next-line no-unused-vars, no-restricted-syntax for (var _ in obj) { // jscs:ignore disallowUnusedVariables return false; } return obj.x === obj; } catch (e) { /* this is IE 8. */ return false; } }; var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported(); var defineProperty = function (object, name, value, predicate) { if (name in object && (!isFunction(predicate) || !predicate())) { return; } if (supportsDescriptors) { origDefineProperty(object, name, { configurable: true, enumerable: false, value: value, writable: true }); } else { object[name] = value; } }; var defineProperties = function (object, map) { var predicates = arguments.length > 2 ? arguments[2] : {}; var props = keys(map); if (hasSymbols) { props = concat.call(props, Object.getOwnPropertySymbols(map)); } for (var i = 0; i < props.length; i += 1) { defineProperty(object, props[i], map[props[i]], predicates[props[i]]); } }; defineProperties.supportsDescriptors = !!supportsDescriptors; module.exports = defineProperties; },{"object-keys":117}],47:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic'); var $Array = GetIntrinsic('%Array%'); var $species = GetIntrinsic('%Symbol.species%', true); var $TypeError = GetIntrinsic('%TypeError%'); var Get = require('./Get'); var IsArray = require('./IsArray'); var IsConstructor = require('./IsConstructor'); var IsInteger = require('./IsInteger'); var Type = require('./Type'); // 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); }; },{"../GetIntrinsic":81,"./Get":54,"./IsArray":57,"./IsConstructor":59,"./IsInteger":62,"./Type":76}],48:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic'); var callBound = require('../helpers/callBound'); var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%'); // https://www.ecma-international.org/ecma-262/6.0/#sec-call module.exports = function Call(F, V) { var args = arguments.length > 2 ? arguments[2] : []; return $apply(F, V, args); }; },{"../GetIntrinsic":81,"../helpers/callBound":85}],49:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic'); var $TypeError = GetIntrinsic('%TypeError%'); var DefineOwnProperty = require('../helpers/DefineOwnProperty'); var FromPropertyDescriptor = require('./FromPropertyDescriptor'); var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); var IsDataDescriptor = require('./IsDataDescriptor'); var IsExtensible = require('./IsExtensible'); var IsPropertyKey = require('./IsPropertyKey'); var SameValue = require('./SameValue'); var Type = require('./Type'); // https://www.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 } ); }; },{"../GetIntrinsic":81,"../helpers/DefineOwnProperty":82,"./FromPropertyDescriptor":53,"./IsDataDescriptor":60,"./IsExtensible":61,"./IsPropertyKey":63,"./OrdinaryGetOwnProperty":65,"./SameValue":67,"./Type":76}],50:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic'); var $TypeError = GetIntrinsic('%TypeError%'); var CreateDataProperty = require('./CreateDataProperty'); var IsPropertyKey = require('./IsPropertyKey'); var Type = require('./Type'); // // 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; }; },{"../GetIntrinsic":81,"./CreateDataProperty":49,"./IsPropertyKey":63,"./Type":76}],51:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic'); var $TypeError = GetIntrinsic('%TypeError%'); var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); var DefineOwnProperty = require('../helpers/DefineOwnProperty'); var FromPropertyDescriptor = require('./FromPropertyDescriptor'); var IsAccessorDescriptor = require('./IsAccessorDescriptor'); var IsDataDescriptor = require('./IsDataDescriptor'); var IsPropertyKey = require('./IsPropertyKey'); var SameValue = require('./SameValue'); var ToPropertyDescriptor = require('./ToPropertyDescriptor'); var Type = require('./Type'); // https://www.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 ); }; },{"../GetIntrinsic":81,"../helpers/DefineOwnProperty":82,"../helpers/isPropertyDescriptor":90,"./FromPropertyDescriptor":53,"./IsAccessorDescriptor":56,"./IsDataDescriptor":60,"./IsPropertyKey":63,"./SameValue":67,"./ToPropertyDescriptor":74,"./Type":76}],52:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic'); var $TypeError = GetIntrinsic('%TypeError%'); var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); var Call = require('./Call'); var CreateDataPropertyOrThrow = require('./CreateDataPropertyOrThrow'); var Get = require('./Get'); var HasProperty = require('./HasProperty'); var IsArray = require('./IsArray'); var ToLength = require('./ToLength'); var ToString = require('./ToString'); // https://ecma-international.org/ecma-262/10.0/#sec-flattenintoarray // eslint-disable-next-line max-params, max-statements module.exports = function FlattenIntoArray(target, source, sourceLen, start, depth) { var mapperFunction; if (arguments.length > 5) { mapperFunction = arguments[5]; } var targetIndex = start; var sourceIndex = 0; while (sourceIndex < sourceLen) { var P = ToString(sourceIndex); var exists = HasProperty(source, P); if (exists === true) { var element = Get(source, P); if (typeof mapperFunction !== 'undefined') { if (arguments.length <= 6) { throw new $TypeError('Assertion failed: thisArg is required when mapperFunction is provided'); } element = Call(mapperFunction, arguments[6], [element, sourceIndex, source]); } var shouldFlatten = false; if (depth > 0) { shouldFlatten = IsArray(element); } if (shouldFlatten) { var elementLen = ToLength(Get(element, 'length')); targetIndex = FlattenIntoArray(target, element, elementLen, targetIndex, depth - 1); } else { if (targetIndex >= MAX_SAFE_INTEGER) { throw new $TypeError('index too large'); } CreateDataPropertyOrThrow(target, ToString(targetIndex), element); targetIndex += 1; } } sourceIndex += 1; } return targetIndex; }; },{"../GetIntrinsic":81,"../helpers/maxSafeInteger":91,"./Call":48,"./CreateDataPropertyOrThrow":50,"./Get":54,"./HasProperty":55,"./IsArray":57,"./ToLength":70,"./ToString":75}],53:[function(require,module,exports){ 'use strict'; var assertRecord = require('../helpers/assertRecord'); var Type = require('./Type'); // https://www.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; }; },{"../helpers/assertRecord":83,"./Type":76}],54:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic'); var $TypeError = GetIntrinsic('%TypeError%'); var inspect = require('object-inspect'); var IsPropertyKey = require('./IsPropertyKey'); var Type = require('./Type'); /** * 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]; }; },{"../GetIntrinsic":81,"./IsPropertyKey":63,"./Type":76,"object-inspect":115}],55:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic'); var $TypeError = GetIntrinsic('%TypeError%'); var IsPropertyKey = require('./IsPropertyKey'); var Type = require('./Type'); // 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; }; },{"../GetIntrinsic":81,"./IsPropertyKey":63,"./Type":76}],56:[function(require,module,exports){ 'use strict'; var has = require('has'); var assertRecord = require('../helpers/assertRecord'); var Type = require('./Type'); // https://www.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; }; },{"../helpers/assertRecord":83,"./Type":76,"has":103}],57:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic'); var $Array = GetIntrinsic('%Array%'); // eslint-disable-next-line global-require var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString'); // https://www.ecma-international.org/ecma-262/6.0/#sec-isarray module.exports = $Array.isArray || function IsArray(argument) { return toStr(argument) === '[object Array]'; }; },{"../GetIntrinsic":81,"../helpers/callBound":85}],58:[function(require,module,exports){ 'use strict'; // http://www.ecma-international.org/ecma-262/5.1/#sec-9.11 module.exports = require('is-callable'); },{"is-callable":105}],59:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic.js'); var $construct = GetIntrinsic('%Reflect.construct%', true); var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); try { DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} }); } catch (e) { // Accessor properties aren't supported DefinePropertyOrThrow = null; } // https://www.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; }; } },{"../GetIntrinsic.js":81,"./DefinePropertyOrThrow":51}],60:[function(require,module,exports){ 'use strict'; var has = require('has'); var assertRecord = require('../helpers/assertRecord'); var Type = require('./Type'); // https://www.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; }; },{"../helpers/assertRecord":83,"./Type":76,"has":103}],61:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic'); var $Object = GetIntrinsic('%Object%'); var isPrimitive = require('../helpers/isPrimitive'); var $preventExtensions = $Object.preventExtensions; var $isExtensible = $Object.isExtensible; // https://www.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); }; },{"../GetIntrinsic":81,"../helpers/isPrimitive":89}],62:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic'); var $Math = GetIntrinsic('%Math%'); var $floor = $Math.floor; var $abs = $Math.abs; var $isNaN = require('../helpers/isNaN'); var $isFinite = require('../helpers/isFinite'); // https://www.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 abs = $abs(argument); return $floor(abs) === abs; }; },{"../GetIntrinsic":81,"../helpers/isFinite":87,"../helpers/isNaN":88}],63:[function(require,module,exports){ 'use strict'; // https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey module.exports = function IsPropertyKey(argument) { return typeof argument === 'string' || typeof argument === 'symbol'; }; },{}],64:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic'); var $match = GetIntrinsic('%Symbol.match%', true); var hasRegExpMatcher = require('is-regex'); var ToBoolean = require('./ToBoolean'); // 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); }; },{"../GetIntrinsic":81,"./ToBoolean":68,"is-regex":109}],65:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic'); var $gOPD = require('../helpers/getOwnPropertyDescriptor'); var $TypeError = GetIntrinsic('%TypeError%'); var callBound = require('../helpers/callBound'); var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); var has = require('has'); var IsArray = require('./IsArray'); var IsPropertyKey = require('./IsPropertyKey'); var IsRegExp = require('./IsRegExp'); var ToPropertyDescriptor = require('./ToPropertyDescriptor'); var Type = require('./Type'); // https://www.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)); }; },{"../GetIntrinsic":81,"../helpers/callBound":85,"../helpers/getOwnPropertyDescriptor":86,"./IsArray":57,"./IsPropertyKey":63,"./IsRegExp":64,"./ToPropertyDescriptor":74,"./Type":76,"has":103}],66:[function(require,module,exports){ 'use strict'; module.exports = require('../5/CheckObjectCoercible'); },{"../5/CheckObjectCoercible":77}],67:[function(require,module,exports){ 'use strict'; var $isNaN = require('../helpers/isNaN'); // http://www.ecma-international.org/ecma-262/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); }; },{"../helpers/isNaN":88}],68:[function(require,module,exports){ 'use strict'; // http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 module.exports = function ToBoolean(value) { return !!value; }; },{}],69:[function(require,module,exports){ 'use strict'; var ES5ToInteger = require('../5/ToInteger'); var ToNumber = require('./ToNumber'); // https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger module.exports = function ToInteger(value) { var number = ToNumber(value); return ES5ToInteger(number); }; },{"../5/ToInteger":78,"./ToNumber":71}],70:[function(require,module,exports){ 'use strict'; var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); var ToInteger = require('./ToInteger'); 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; }; },{"../helpers/maxSafeInteger":91,"./ToInteger":69}],71:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic'); var $TypeError = GetIntrinsic('%TypeError%'); var $Number = GetIntrinsic('%Number%'); var $RegExp = GetIntrinsic('%RegExp%'); var $parseInteger = GetIntrinsic('%parseInt%'); var callBound = require('../helpers/callBound'); var regexTester = require('../helpers/regexTester'); var isPrimitive = require('../helpers/isPrimitive'); 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 = require('./ToPrimitive'); // https://www.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); }; },{"../GetIntrinsic":81,"../helpers/callBound":85,"../helpers/isPrimitive":89,"../helpers/regexTester":92,"./ToPrimitive":73}],72:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic'); var $Object = GetIntrinsic('%Object%'); var RequireObjectCoercible = require('./RequireObjectCoercible'); // https://www.ecma-international.org/ecma-262/6.0/#sec-toobject module.exports = function ToObject(value) { RequireObjectCoercible(value); return $Object(value); }; },{"../GetIntrinsic":81,"./RequireObjectCoercible":66}],73:[function(require,module,exports){ 'use strict'; var toPrimitive = require('es-to-primitive/es2015'); // https://www.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); }; },{"es-to-primitive/es2015":94}],74:[function(require,module,exports){ 'use strict'; var has = require('has'); var GetIntrinsic = require('../GetIntrinsic'); var $TypeError = GetIntrinsic('%TypeError%'); var Type = require('./Type'); var ToBoolean = require('./ToBoolean'); var IsCallable = require('./IsCallable'); // https://ecma-international.org/ecma-262/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; }; },{"../GetIntrinsic":81,"./IsCallable":58,"./ToBoolean":68,"./Type":76,"has":103}],75:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic'); var $String = GetIntrinsic('%String%'); var $TypeError = GetIntrinsic('%TypeError%'); // https://www.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); }; },{"../GetIntrinsic":81}],76:[function(require,module,exports){ 'use strict'; var ES5Type = require('../5/Type'); // https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values module.exports = function Type(x) { if (typeof x === 'symbol') { return 'Symbol'; } return ES5Type(x); }; },{"../5/Type":80}],77:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic'); var $TypeError = GetIntrinsic('%TypeError%'); // http://www.ecma-international.org/ecma-262/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; }; },{"../GetIntrinsic":81}],78:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic'); var $Math = GetIntrinsic('%Math%'); var ToNumber = require('./ToNumber'); var $isNaN = require('../helpers/isNaN'); var $isFinite = require('../helpers/isFinite'); var $sign = require('../helpers/sign'); var $floor = $Math.floor; var $abs = $Math.abs; // http://www.ecma-international.org/ecma-262/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)); }; },{"../GetIntrinsic":81,"../helpers/isFinite":87,"../helpers/isNaN":88,"../helpers/sign":93,"./ToNumber":79}],79:[function(require,module,exports){ 'use strict'; // http://www.ecma-international.org/ecma-262/5.1/#sec-9.3 module.exports = function ToNumber(value) { return +value; // eslint-disable-line no-implicit-coercion }; },{}],80:[function(require,module,exports){ 'use strict'; // https://www.ecma-international.org/ecma-262/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'; } }; },{}],81:[function(require,module,exports){ 'use strict'; /* globals Atomics, SharedArrayBuffer, */ var undefined; var $TypeError = TypeError; var $gOPD = Object.getOwnPropertyDescriptor; if ($gOPD) { try { $gOPD({}, ''); } catch (e) { $gOPD = null; // this is IE 8, which has a broken gOPD } } var throwTypeError = function () { throw new $TypeError(); }; var ThrowTypeError = $gOPD ? (function () { try { // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties arguments.callee; // IE 8 does not throw here return throwTypeError; } catch (calleeThrows) { try { // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') return $gOPD(arguments, 'callee').get; } catch (gOPDthrows) { return throwTypeError; } } }()) : throwTypeError; var hasSymbols = require('has-symbols')(); var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto var generator; // = function * () {}; var generatorFunction = generator ? getProto(generator) : undefined; var asyncFn; // async function() {}; var asyncFunction = asyncFn ? asyncFn.constructor : undefined; var asyncGen; // async function * () {}; var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined; var asyncGenIterator = asyncGen ? asyncGen() : undefined; var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); var INTRINSICS = { '%Array%': Array, '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, '%ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype, '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, '%ArrayPrototype%': Array.prototype, '%ArrayProto_entries%': Array.prototype.entries, '%ArrayProto_forEach%': Array.prototype.forEach, '%ArrayProto_keys%': Array.prototype.keys, '%ArrayProto_values%': Array.prototype.values, '%AsyncFromSyncIteratorPrototype%': undefined, '%AsyncFunction%': asyncFunction, '%AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined, '%AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined, '%AsyncGeneratorFunction%': asyncGenFunction, '%AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined, '%AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined, '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, '%Boolean%': Boolean, '%BooleanPrototype%': Boolean.prototype, '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, '%DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype, '%Date%': Date, '%DatePrototype%': Date.prototype, '%decodeURI%': decodeURI, '%decodeURIComponent%': decodeURIComponent, '%encodeURI%': encodeURI, '%encodeURIComponent%': encodeURIComponent, '%Error%': Error, '%ErrorPrototype%': Error.prototype, '%eval%': eval, // eslint-disable-line no-eval '%EvalError%': EvalError, '%EvalErrorPrototype%': EvalError.prototype, '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, '%Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype, '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, '%Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype, '%Function%': Function, '%FunctionPrototype%': Function.prototype, '%Generator%': generator ? getProto(generator()) : undefined, '%GeneratorFunction%': generatorFunction, '%GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined, '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, '%Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype, '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, '%Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype, '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, '%Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype, '%isFinite%': isFinite, '%isNaN%': isNaN, '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, '%JSON%': typeof JSON === 'object' ? JSON : undefined, '%JSONParse%': typeof JSON === 'object' ? JSON.parse : undefined, '%Map%': typeof Map === 'undefined' ? undefined : Map, '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), '%MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype, '%Math%': Math, '%Number%': Number, '%NumberPrototype%': Number.prototype, '%Object%': Object, '%ObjectPrototype%': Object.prototype, '%ObjProto_toString%': Object.prototype.toString, '%ObjProto_valueOf%': Object.prototype.valueOf, '%parseFloat%': parseFloat, '%parseInt%': parseInt, '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, '%PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype, '%PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then, '%Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all, '%Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject, '%Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve, '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, '%RangeError%': RangeError, '%RangeErrorPrototype%': RangeError.prototype, '%ReferenceError%': ReferenceError, '%ReferenceErrorPrototype%': ReferenceError.prototype, '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, '%RegExp%': RegExp, '%RegExpPrototype%': RegExp.prototype, '%Set%': typeof Set === 'undefined' ? undefined : Set, '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), '%SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype, '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, '%SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype, '%String%': String, '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, '%StringPrototype%': String.prototype, '%Symbol%': hasSymbols ? Symbol : undefined, '%SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined, '%SyntaxError%': SyntaxError, '%SyntaxErrorPrototype%': SyntaxError.prototype, '%ThrowTypeError%': ThrowTypeError, '%TypedArray%': TypedArray, '%TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined, '%TypeError%': $TypeError, '%TypeErrorPrototype%': $TypeError.prototype, '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, '%Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype, '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, '%Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype, '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, '%Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype, '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, '%Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype, '%URIError%': URIError, '%URIErrorPrototype%': URIError.prototype, '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, '%WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype, '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, '%WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype }; var bind = require('function-bind'); var $replace = bind.call(Function.call, String.prototype.replace); /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ var stringToPath = function stringToPath(string) { var result = []; $replace(string, rePropName, function (match, number, quote, subString) { result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : (number || match); }); return result; }; /* end adaptation */ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { if (!(name in INTRINSICS)) { throw new SyntaxError('intrinsic ' + name + ' does not exist!'); } // istanbul ignore if // hopefully this is impossible to test :-) if (typeof INTRINSICS[name] === 'undefined' && !allowMissing) { throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); } return INTRINSICS[name]; }; module.exports = function GetIntrinsic(name, allowMissing) { if (typeof name !== 'string' || name.length === 0) { throw new TypeError('intrinsic name must be a non-empty string'); } if (arguments.length > 1 && typeof allowMissing !== 'boolean') { throw new TypeError('"allowMissing" argument must be a boolean'); } var parts = stringToPath(name); var value = getBaseIntrinsic('%' + (parts.length > 0 ? parts[0] : '') + '%', allowMissing); for (var i = 1; i < parts.length; i += 1) { if (value != null) { if ($gOPD && (i + 1) >= parts.length) { var desc = $gOPD(value, parts[i]); if (!allowMissing && !(parts[i] in value)) { throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); } value = desc ? (desc.get || desc.value) : value[parts[i]]; } else { value = value[parts[i]]; } } } return value; }; },{"function-bind":100,"has-symbols":101}],82:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic'); 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 = require('../helpers/callBound'); 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; }; },{"../GetIntrinsic":81,"../helpers/callBound":85}],83:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic'); var $TypeError = GetIntrinsic('%TypeError%'); var $SyntaxError = GetIntrinsic('%SyntaxError%'); var has = require('has'); var predicates = { // https://ecma-international.org/ecma-262/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); } }; },{"../GetIntrinsic":81,"has":103}],84:[function(require,module,exports){ 'use strict'; var bind = require('function-bind'); var GetIntrinsic = require('../GetIntrinsic'); var $apply = GetIntrinsic('%Function.prototype.apply%'); var $call = GetIntrinsic('%Function.prototype.call%'); var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); module.exports = function callBind() { return $reflectApply(bind, $call, arguments); }; module.exports.apply = function applyBind() { return $reflectApply(bind, $apply, arguments); }; },{"../GetIntrinsic":81,"function-bind":100}],85:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic'); var callBind = require('./callBind'); var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); module.exports = function callBoundIntrinsic(name, allowMissing) { var intrinsic = GetIntrinsic(name, !!allowMissing); if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.')) { return callBind(intrinsic); } return intrinsic; }; },{"../GetIntrinsic":81,"./callBind":84}],86:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic'); var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%'); if ($gOPD) { try { $gOPD([], 'length'); } catch (e) { // IE 8 has a broken gOPD $gOPD = null; } } module.exports = $gOPD; },{"../GetIntrinsic":81}],87:[function(require,module,exports){ '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; }; },{}],88:[function(require,module,exports){ 'use strict'; module.exports = Number.isNaN || function isNaN(a) { return a !== a; }; },{}],89:[function(require,module,exports){ 'use strict'; module.exports = function isPrimitive(value) { return value === null || (typeof value !== 'function' && typeof value !== 'object'); }; },{}],90:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic'); var has = require('has'); 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; }; },{"../GetIntrinsic":81,"has":103}],91:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic'); var $Math = GetIntrinsic('%Math%'); var $Number = GetIntrinsic('%Number%'); module.exports = $Number.MAX_SAFE_INTEGER || $Math.pow(2, 53) - 1; },{"../GetIntrinsic":81}],92:[function(require,module,exports){ 'use strict'; var GetIntrinsic = require('../GetIntrinsic'); var $test = GetIntrinsic('RegExp.prototype.test'); var callBind = require('./callBind'); module.exports = function regexTester(regex) { return callBind($test, regex); }; },{"../GetIntrinsic":81,"./callBind":84}],93:[function(require,module,exports){ 'use strict'; module.exports = function sign(number) { return number >= 0 ? 1 : -1; }; },{}],94:[function(require,module,exports){ 'use strict'; var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; var isPrimitive = require('./helpers/isPrimitive'); var isCallable = require('is-callable'); var isDate = require('is-date-object'); var isSymbol = require('is-symbol'); 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); }; },{"./helpers/isPrimitive":95,"is-callable":105,"is-date-object":106,"is-symbol":111}],95:[function(require,module,exports){ arguments[4][89][0].apply(exports,arguments) },{"dup":89}],96:[function(require,module,exports){ arguments[4][36][0].apply(exports,arguments) },{"./lib":97,"dup":36}],97:[function(require,module,exports){ 'use strict'; module.exports = function promiseTry(func) { return new Promise(function (resolve, reject) { resolve(func()); }); }; },{}],98:[function(require,module,exports){ module.exports = function flatten(list, depth) { depth = (typeof depth == 'number') ? depth : Infinity; if (!depth) { if (Array.isArray(list)) { return list.map(function(i) { return i; }); } return list; } return _flatten(list, 1); function _flatten(list, d) { return list.reduce(function (acc, item) { if (Array.isArray(item) && d < depth) { return acc.concat(_flatten(item, d + 1)); } else { return acc.concat(item); } }, []); } }; },{}],99:[function(require,module,exports){ 'use strict'; /* eslint no-invalid-this: 1 */ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; var slice = Array.prototype.slice; var toStr = Object.prototype.toString; var funcType = '[object Function]'; module.exports = function bind(that) { var target = this; if (typeof target !== 'function' || toStr.call(target) !== funcType) { throw new TypeError(ERROR_MESSAGE + target); } var args = slice.call(arguments, 1); var bound; var binder = function () { if (this instanceof bound) { var result = target.apply( this, args.concat(slice.call(arguments)) ); if (Object(result) === result) { return result; } return this; } else { return target.apply( that, args.concat(slice.call(arguments)) ); } }; var boundLength = Math.max(0, target.length - args.length); var boundArgs = []; for (var i = 0; i < boundLength; i++) { boundArgs.push('$' + i); } bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); if (target.prototype) { var Empty = function Empty() {}; Empty.prototype = target.prototype; bound.prototype = new Empty(); Empty.prototype = null; } return bound; }; },{}],100:[function(require,module,exports){ 'use strict'; var implementation = require('./implementation'); module.exports = Function.prototype.bind || implementation; },{"./implementation":99}],101:[function(require,module,exports){ (function (global){ 'use strict'; var origSymbol = global.Symbol; var hasSymbolSham = require('./shams'); module.exports = function hasNativeSymbols() { if (typeof origSymbol !== 'function') { return false; } if (typeof Symbol !== 'function') { return false; } if (typeof origSymbol('foo') !== 'symbol') { return false; } if (typeof Symbol('bar') !== 'symbol') { return false; } return hasSymbolSham(); }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"./shams":102}],102:[function(require,module,exports){ 'use strict'; /* eslint complexity: [2, 18], max-statements: [2, 33] */ module.exports = function hasSymbols() { if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } if (typeof Symbol.iterator === 'symbol') { return true; } var obj = {}; var sym = Symbol('test'); var symObj = Object(sym); if (typeof sym === 'string') { return false; } if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } // temp disabled per https://github.com/ljharb/object.assign/issues/17 // if (sym instanceof Symbol) { return false; } // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 // if (!(symObj instanceof Symbol)) { return false; } // if (typeof Symbol.prototype.toString !== 'function') { return false; } // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } var symVal = 42; obj[sym] = symVal; for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } var syms = Object.getOwnPropertySymbols(obj); if (syms.length !== 1 || syms[0] !== sym) { return false; } if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } if (typeof Object.getOwnPropertyDescriptor === 'function') { var descriptor = Object.getOwnPropertyDescriptor(obj, sym); if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } } return true; }; },{}],103:[function(require,module,exports){ 'use strict'; var bind = require('function-bind'); module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); },{"function-bind":100}],104:[function(require,module,exports){ 'use strict'; var boolToStr = Boolean.prototype.toString; var tryBooleanObject = function booleanBrandCheck(value) { try { boolToStr.call(value); return true; } catch (e) { return false; } }; var toStr = Object.prototype.toString; var boolClass = '[object Boolean]'; var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; module.exports = function isBoolean(value) { if (typeof value === 'boolean') { return true; } if (value === null || typeof value !== 'object') { return false; } return hasToStringTag && Symbol.toStringTag in value ? tryBooleanObject(value) : toStr.call(value) === boolClass; }; },{}],105:[function(require,module,exports){ 'use strict'; var fnToStr = Function.prototype.toString; var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply; var badArrayLike; var isCallableMarker; if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') { try { badArrayLike = Object.defineProperty({}, 'length', { get: function () { throw isCallableMarker; } }); isCallableMarker = {}; } catch (_) { reflectApply = null; } } else { reflectApply = null; } var constructorRegex = /^\s*class\b/; var isES6ClassFn = function isES6ClassFunction(value) { try { var fnStr = fnToStr.call(value); return constructorRegex.test(fnStr); } catch (e) { return false; // not a function } }; var tryFunctionObject = function tryFunctionToStr(value) { try { if (isES6ClassFn(value)) { return false; } fnToStr.call(value); return true; } catch (e) { return false; } }; var toStr = Object.prototype.toString; var fnClass = '[object Function]'; var genClass = '[object GeneratorFunction]'; var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; module.exports = reflectApply ? function isCallable(value) { if (!value) { return false; } if (typeof value !== 'function' && typeof value !== 'object') { return false; } if (typeof value === 'function' && !value.prototype) { return true; } try { reflectApply(value, null, badArrayLike); } catch (e) { if (e !== isCallableMarker) { return false; } } return !isES6ClassFn(value); } : function isCallable(value) { if (!value) { return false; } if (typeof value !== 'function' && typeof value !== 'object') { return false; } if (typeof value === 'function' && !value.prototype) { return true; } if (hasToStringTag) { return tryFunctionObject(value); } if (isES6ClassFn(value)) { return false; } var strClass = toStr.call(value); return strClass === fnClass || strClass === genClass; }; },{}],106:[function(require,module,exports){ 'use strict'; var getDay = Date.prototype.getDay; var tryDateObject = function tryDateGetDayCall(value) { try { getDay.call(value); return true; } catch (e) { return false; } }; var toStr = Object.prototype.toString; var dateClass = '[object Date]'; var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; module.exports = function isDateObject(value) { if (typeof value !== 'object' || value === null) { return false; } return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass; }; },{}],107:[function(require,module,exports){ 'use strict'; var numToStr = Number.prototype.toString; var tryNumberObject = function tryNumberObject(value) { try { numToStr.call(value); return true; } catch (e) { return false; } }; var toStr = Object.prototype.toString; var numClass = '[object Number]'; var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; module.exports = function isNumberObject(value) { if (typeof value === 'number') { return true; } if (typeof value !== 'object') { return false; } return hasToStringTag ? tryNumberObject(value) : toStr.call(value) === numClass; }; },{}],108:[function(require,module,exports){ 'use strict'; module.exports = value => { if (Object.prototype.toString.call(value) !== '[object Object]') { return false; } const prototype = Object.getPrototypeOf(value); return prototype === null || prototype === Object.prototype; }; },{}],109:[function(require,module,exports){ 'use strict'; var hasSymbols = require('has-symbols')(); var hasToStringTag = hasSymbols && typeof Symbol.toStringTag === 'symbol'; var regexExec; var isRegexMarker; var badStringifier; if (hasToStringTag) { regexExec = Function.call.bind(RegExp.prototype.exec); isRegexMarker = {}; var throwRegexMarker = function () { throw isRegexMarker; }; badStringifier = { toString: throwRegexMarker, valueOf: throwRegexMarker }; if (typeof Symbol.toPrimitive === 'symbol') { badStringifier[Symbol.toPrimitive] = throwRegexMarker; } } var toStr = Object.prototype.toString; var regexClass = '[object RegExp]'; module.exports = hasToStringTag // eslint-disable-next-line consistent-return ? function isRegex(value) { if (!value || typeof value !== 'object') { return false; } try { regexExec(value, badStringifier); } catch (e) { return e === isRegexMarker; } } : function isRegex(value) { // In older browsers, typeof regex incorrectly returns 'function' if (!value || (typeof value !== 'object' && typeof value !== 'function')) { return false; } return toStr.call(value) === regexClass; }; },{"has-symbols":101}],110:[function(require,module,exports){ 'use strict'; var strValue = String.prototype.valueOf; var tryStringObject = function tryStringObject(value) { try { strValue.call(value); return true; } catch (e) { return false; } }; var toStr = Object.prototype.toString; var strClass = '[object String]'; var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; module.exports = function isString(value) { if (typeof value === 'string') { return true; } if (typeof value !== 'object') { return false; } return hasToStringTag ? tryStringObject(value) : toStr.call(value) === strClass; }; },{}],111:[function(require,module,exports){ 'use strict'; var toStr = Object.prototype.toString; var hasSymbols = require('has-symbols')(); if (hasSymbols) { var symToStr = Symbol.prototype.toString; var symStringRegex = /^Symbol\(.*\)$/; var isSymbolObject = function isRealSymbolObject(value) { if (typeof value.valueOf() !== 'symbol') { return false; } return symStringRegex.test(symToStr.call(value)); }; module.exports = function isSymbol(value) { if (typeof value === 'symbol') { return true; } if (toStr.call(value) !== '[object Symbol]') { return false; } try { return isSymbolObject(value); } catch (e) { return false; } }; } else { module.exports = function isSymbol(value) { // this environment does not support Symbols. return false && value; }; } },{"has-symbols":101}],112:[function(require,module,exports){ "use strict"; function getValue(value, functionsAreLiterals, inputValue) { if (typeof value === "function" && !functionsAreLiterals) { return value(inputValue); } else { return value; } } function doMatchValue(value, arms, functionsAreLiterals) { if (value == null) { return value; } else if (arms[value] !== undefined) { // NOTE: We intentionally only check for `undefined` here (and below), since we want to allow the mapped-to value to be an explicit `null`. return getValue(arms[value], functionsAreLiterals, value); } else if (arms._ !== undefined) { return getValue(arms._, functionsAreLiterals, value); } else { throw new Error(`No match arm found for value '${value}'`); } } module.exports = function matchValue(value, arms) { return doMatchValue(value, arms, false); }; module.exports.literal = function matchValueLiteral(value, arms) { return doMatchValue(value, arms, true); }; },{}],113:[function(require,module,exports){ /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function(val, options) { options = options || {}; var type = typeof val; if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isFinite(val)) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( 'val is not a non-empty string or a valid number. val=' + JSON.stringify(val) ); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( str ); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'weeks': case 'week': case 'w': return n * w; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + 'd'; } if (msAbs >= h) { return Math.round(ms / h) + 'h'; } if (msAbs >= m) { return Math.round(ms / m) + 'm'; } if (msAbs >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, 'day'); } if (msAbs >= h) { return plural(ms, msAbs, h, 'hour'); } if (msAbs >= m) { return plural(ms, msAbs, m, 'minute'); } if (msAbs >= s) { return plural(ms, msAbs, s, 'second'); } return ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } },{}],114:[function(require,module,exports){ /* object-assign (c) Sindre Sorhus @license MIT */ 'use strict'; /* eslint-disable no-unused-vars */ var getOwnPropertySymbols = Object.getOwnPropertySymbols; var hasOwnProperty = Object.prototype.hasOwnProperty; var propIsEnumerable = Object.prototype.propertyIsEnumerable; function toObject(val) { if (val === null || val === undefined) { throw new TypeError('Object.assign cannot be called with null or undefined'); } return Object(val); } function shouldUseNative() { try { if (!Object.assign) { return false; } // Detect buggy property enumeration order in older V8 versions. // https://bugs.chromium.org/p/v8/issues/detail?id=4118 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers test1[5] = 'de'; if (Object.getOwnPropertyNames(test1)[0] === '5') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test2 = {}; for (var i = 0; i < 10; i++) { test2['_' + String.fromCharCode(i)] = i; } var order2 = Object.getOwnPropertyNames(test2).map(function (n) { return test2[n]; }); if (order2.join('') !== '0123456789') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test3 = {}; 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { test3[letter] = letter; }); if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { return false; } return true; } catch (err) { // We don't expect any of the above to throw, but better to be safe. return false; } } module.exports = shouldUseNative() ? Object.assign : function (target, source) { var from; var to = toObject(target); var symbols; for (var s = 1; s < arguments.length; s++) { from = Object(arguments[s]); for (var key in from) { if (hasOwnProperty.call(from, key)) { to[key] = from[key]; } } if (getOwnPropertySymbols) { symbols = getOwnPropertySymbols(from); for (var i = 0; i < symbols.length; i++) { if (propIsEnumerable.call(from, symbols[i])) { to[symbols[i]] = from[symbols[i]]; } } } } return to; }; },{}],115:[function(require,module,exports){ var hasMap = typeof Map === 'function' && Map.prototype; var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; var mapForEach = hasMap && Map.prototype.forEach; var hasSet = typeof Set === 'function' && Set.prototype; var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; var setForEach = hasSet && Set.prototype.forEach; var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype; var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype; var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; var booleanValueOf = Boolean.prototype.valueOf; var objectToString = Object.prototype.toString; var functionToString = Function.prototype.toString; var match = String.prototype.match; var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; var inspectCustom = require('./util.inspect').custom; var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null; module.exports = function inspect_(obj, options, depth, seen) { var opts = options || {}; if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) { throw new TypeError('option "quoteStyle" must be "single" or "double"'); } if ( has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number' ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity : opts.maxStringLength !== null ) ) { throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); } var customInspect = has(opts, 'customInspect') ? opts.customInspect : true; if (typeof customInspect !== 'boolean') { throw new TypeError('option "customInspect", if provided, must be `true` or `false`'); } if ( has(opts, 'indent') && opts.indent !== null && opts.indent !== '\t' && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0) ) { throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`'); } if (typeof obj === 'undefined') { return 'undefined'; } if (obj === null) { return 'null'; } if (typeof obj === 'boolean') { return obj ? 'true' : 'false'; } if (typeof obj === 'string') { return inspectString(obj, opts); } if (typeof obj === 'number') { if (obj === 0) { return Infinity / obj > 0 ? '0' : '-0'; } return String(obj); } if (typeof obj === 'bigint') { // eslint-disable-line valid-typeof return String(obj) + 'n'; } var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; if (typeof depth === 'undefined') { depth = 0; } if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { return isArray(obj) ? '[Array]' : '[Object]'; } var indent = getIndent(opts, depth); if (typeof seen === 'undefined') { seen = []; } else if (indexOf(seen, obj) >= 0) { return '[Circular]'; } function inspect(value, from, noIndent) { if (from) { seen = seen.slice(); seen.push(from); } if (noIndent) { var newOpts = { depth: opts.depth }; if (has(opts, 'quoteStyle')) { newOpts.quoteStyle = opts.quoteStyle; } return inspect_(value, newOpts, depth + 1, seen); } return inspect_(value, opts, depth + 1, seen); } if (typeof obj === 'function') { var name = nameOf(obj); return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']'; } if (isSymbol(obj)) { var symString = Symbol.prototype.toString.call(obj); return typeof obj === 'object' ? markBoxed(symString) : symString; } if (isElement(obj)) { var s = '<' + String(obj.nodeName).toLowerCase(); var attrs = obj.attributes || []; for (var i = 0; i < attrs.length; i++) { s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); } s += '>'; if (obj.childNodes && obj.childNodes.length) { s += '...'; } s += ''; return s; } if (isArray(obj)) { if (obj.length === 0) { return '[]'; } var xs = arrObjKeys(obj, inspect); if (indent && !singleLineValues(xs)) { return '[' + indentedJoin(xs, indent) + ']'; } return '[ ' + xs.join(', ') + ' ]'; } if (isError(obj)) { var parts = arrObjKeys(obj, inspect); if (parts.length === 0) { return '[' + String(obj) + ']'; } return '{ [' + String(obj) + '] ' + parts.join(', ') + ' }'; } if (typeof obj === 'object' && customInspect) { if (inspectSymbol && typeof obj[inspectSymbol] === 'function') { return obj[inspectSymbol](); } else if (typeof obj.inspect === 'function') { return obj.inspect(); } } if (isMap(obj)) { var mapParts = []; mapForEach.call(obj, function (value, key) { mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj)); }); return collectionOf('Map', mapSize.call(obj), mapParts, indent); } if (isSet(obj)) { var setParts = []; setForEach.call(obj, function (value) { setParts.push(inspect(value, obj)); }); return collectionOf('Set', setSize.call(obj), setParts, indent); } if (isWeakMap(obj)) { return weakCollectionOf('WeakMap'); } if (isWeakSet(obj)) { return weakCollectionOf('WeakSet'); } if (isNumber(obj)) { return markBoxed(inspect(Number(obj))); } if (isBigInt(obj)) { return markBoxed(inspect(bigIntValueOf.call(obj))); } if (isBoolean(obj)) { return markBoxed(booleanValueOf.call(obj)); } if (isString(obj)) { return markBoxed(inspect(String(obj))); } if (!isDate(obj) && !isRegExp(obj)) { var ys = arrObjKeys(obj, inspect); if (ys.length === 0) { return '{}'; } if (indent) { return '{' + indentedJoin(ys, indent) + '}'; } return '{ ' + ys.join(', ') + ' }'; } return String(obj); }; function wrapQuotes(s, defaultStyle, opts) { var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'"; return quoteChar + s + quoteChar; } function quote(s) { return String(s).replace(/"/g, '"'); } function isArray(obj) { return toStr(obj) === '[object Array]'; } function isDate(obj) { return toStr(obj) === '[object Date]'; } function isRegExp(obj) { return toStr(obj) === '[object RegExp]'; } function isError(obj) { return toStr(obj) === '[object Error]'; } function isSymbol(obj) { return toStr(obj) === '[object Symbol]'; } function isString(obj) { return toStr(obj) === '[object String]'; } function isNumber(obj) { return toStr(obj) === '[object Number]'; } function isBigInt(obj) { return toStr(obj) === '[object BigInt]'; } function isBoolean(obj) { return toStr(obj) === '[object Boolean]'; } var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; function has(obj, key) { return hasOwn.call(obj, key); } function toStr(obj) { return objectToString.call(obj); } function nameOf(f) { if (f.name) { return f.name; } var m = match.call(functionToString.call(f), /^function\s*([\w$]+)/); if (m) { return m[1]; } return null; } function indexOf(xs, x) { if (xs.indexOf) { return xs.indexOf(x); } for (var i = 0, l = xs.length; i < l; i++) { if (xs[i] === x) { return i; } } return -1; } function isMap(x) { if (!mapSize || !x || typeof x !== 'object') { return false; } try { mapSize.call(x); try { setSize.call(x); } catch (s) { return true; } return x instanceof Map; // core-js workaround, pre-v2.5.0 } catch (e) {} return false; } function isWeakMap(x) { if (!weakMapHas || !x || typeof x !== 'object') { return false; } try { weakMapHas.call(x, weakMapHas); try { weakSetHas.call(x, weakSetHas); } catch (s) { return true; } return x instanceof WeakMap; // core-js workaround, pre-v2.5.0 } catch (e) {} return false; } function isSet(x) { if (!setSize || !x || typeof x !== 'object') { return false; } try { setSize.call(x); try { mapSize.call(x); } catch (m) { return true; } return x instanceof Set; // core-js workaround, pre-v2.5.0 } catch (e) {} return false; } function isWeakSet(x) { if (!weakSetHas || !x || typeof x !== 'object') { return false; } try { weakSetHas.call(x, weakSetHas); try { weakMapHas.call(x, weakMapHas); } catch (s) { return true; } return x instanceof WeakSet; // core-js workaround, pre-v2.5.0 } catch (e) {} return false; } function isElement(x) { if (!x || typeof x !== 'object') { return false; } if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { return true; } return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function'; } function inspectString(str, opts) { if (str.length > opts.maxStringLength) { var remaining = str.length - opts.maxStringLength; var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : ''); return inspectString(str.slice(0, opts.maxStringLength), opts) + trailer; } // eslint-disable-next-line no-control-regex var s = str.replace(/(['\\])/g, '\\$1').replace(/[\x00-\x1f]/g, lowbyte); return wrapQuotes(s, 'single', opts); } function lowbyte(c) { var n = c.charCodeAt(0); var x = { 8: 'b', 9: 't', 10: 'n', 12: 'f', 13: 'r' }[n]; if (x) { return '\\' + x; } return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16); } function markBoxed(str) { return 'Object(' + str + ')'; } function weakCollectionOf(type) { return type + ' { ? }'; } function collectionOf(type, size, entries, indent) { var joinedEntries = indent ? indentedJoin(entries, indent) : entries.join(', '); return type + ' (' + size + ') {' + joinedEntries + '}'; } function singleLineValues(xs) { for (var i = 0; i < xs.length; i++) { if (indexOf(xs[i], '\n') >= 0) { return false; } } return true; } function getIndent(opts, depth) { var baseIndent; if (opts.indent === '\t') { baseIndent = '\t'; } else if (typeof opts.indent === 'number' && opts.indent > 0) { baseIndent = Array(opts.indent + 1).join(' '); } else { return null; } return { base: baseIndent, prev: Array(depth + 1).join(baseIndent) }; } function indentedJoin(xs, indent) { if (xs.length === 0) { return ''; } var lineJoiner = '\n' + indent.prev + indent.base; return lineJoiner + xs.join(',' + lineJoiner) + '\n' + indent.prev; } function arrObjKeys(obj, inspect) { var isArr = isArray(obj); var xs = []; if (isArr) { xs.length = obj.length; for (var i = 0; i < obj.length; i++) { xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; } } for (var key in obj) { // eslint-disable-line no-restricted-syntax if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue if ((/[^\w$]/).test(key)) { xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); } else { xs.push(key + ': ' + inspect(obj[key], obj)); } } return xs; } },{"./util.inspect":39}],116:[function(require,module,exports){ 'use strict'; var keysShim; if (!Object.keys) { // modified from https://github.com/es-shims/es5-shim var has = Object.prototype.hasOwnProperty; var toStr = Object.prototype.toString; var isArgs = require('./isArguments'); // eslint-disable-line global-require var isEnumerable = Object.prototype.propertyIsEnumerable; var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString'); var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype'); var dontEnums = [ 'toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor' ]; var equalsConstructorPrototype = function (o) { var ctor = o.constructor; return ctor && ctor.prototype === o; }; var excludedKeys = { $applicationCache: true, $console: true, $external: true, $frame: true, $frameElement: true, $frames: true, $innerHeight: true, $innerWidth: true, $onmozfullscreenchange: true, $onmozfullscreenerror: true, $outerHeight: true, $outerWidth: true, $pageXOffset: true, $pageYOffset: true, $parent: true, $scrollLeft: true, $scrollTop: true, $scrollX: true, $scrollY: true, $self: true, $webkitIndexedDB: true, $webkitStorageInfo: true, $window: true }; var hasAutomationEqualityBug = (function () { /* global window */ if (typeof window === 'undefined') { return false; } for (var k in window) { try { if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') { try { equalsConstructorPrototype(window[k]); } catch (e) { return true; } } } catch (e) { return true; } } return false; }()); var equalsConstructorPrototypeIfNotBuggy = function (o) { /* global window */ if (typeof window === 'undefined' || !hasAutomationEqualityBug) { return equalsConstructorPrototype(o); } try { return equalsConstructorPrototype(o); } catch (e) { return false; } }; keysShim = function keys(object) { var isObject = object !== null && typeof object === 'object'; var isFunction = toStr.call(object) === '[object Function]'; var isArguments = isArgs(object); var isString = isObject && toStr.call(object) === '[object String]'; var theKeys = []; if (!isObject && !isFunction && !isArguments) { throw new TypeError('Object.keys called on a non-object'); } var skipProto = hasProtoEnumBug && isFunction; if (isString && object.length > 0 && !has.call(object, 0)) { for (var i = 0; i < object.length; ++i) { theKeys.push(String(i)); } } if (isArguments && object.length > 0) { for (var j = 0; j < object.length; ++j) { theKeys.push(String(j)); } } else { for (var name in object) { if (!(skipProto && name === 'prototype') && has.call(object, name)) { theKeys.push(String(name)); } } } if (hasDontEnumBug) { var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); for (var k = 0; k < dontEnums.length; ++k) { if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) { theKeys.push(dontEnums[k]); } } } return theKeys; }; } module.exports = keysShim; },{"./isArguments":118}],117:[function(require,module,exports){ 'use strict'; var slice = Array.prototype.slice; var isArgs = require('./isArguments'); var origKeys = Object.keys; var keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation'); var originalKeys = Object.keys; keysShim.shim = function shimObjectKeys() { if (Object.keys) { var keysWorksWithArguments = (function () { // Safari 5.0 bug var args = Object.keys(arguments); return args && args.length === arguments.length; }(1, 2)); if (!keysWorksWithArguments) { Object.keys = function keys(object) { // eslint-disable-line func-name-matching if (isArgs(object)) { return originalKeys(slice.call(object)); } return originalKeys(object); }; } } else { Object.keys = keysShim; } return Object.keys || keysShim; }; module.exports = keysShim; },{"./implementation":116,"./isArguments":118}],118:[function(require,module,exports){ 'use strict'; var toStr = Object.prototype.toString; module.exports = function isArguments(value) { var str = toStr.call(value); var isArgs = str === '[object Arguments]'; if (!isArgs) { isArgs = str !== '[object Array]' && value !== null && typeof value === 'object' && typeof value.length === 'number' && value.length >= 0 && toStr.call(value.callee) === '[object Function]'; } return isArgs; }; },{}],119:[function(require,module,exports){ (function (Prism) { var plsql = Prism.languages.plsql = Prism.languages.extend('sql', { 'comment': [ /\/\*[\s\S]*?\*\//, /--.*/ ] }); var keyword = plsql['keyword']; if (!Array.isArray(keyword)) { keyword = plsql['keyword'] = [keyword]; } keyword.unshift( /\b(?:ACCESS|AGENT|AGGREGATE|ARRAY|ARROW|AT|ATTRIBUTE|AUDIT|AUTHID|BFILE_BASE|BLOB_BASE|BLOCK|BODY|BOTH|BOUND|BYTE|CALLING|CHAR_BASE|CHARSET(?:FORM|ID)|CLOB_BASE|COLAUTH|COLLECT|CLUSTERS?|COMPILED|COMPRESS|CONSTANT|CONSTRUCTOR|CONTEXT|CRASH|CUSTOMDATUM|DANGLING|DATE_BASE|DEFINE|DETERMINISTIC|DURATION|ELEMENT|EMPTY|EXCEPTIONS?|EXCLUSIVE|EXTERNAL|FINAL|FORALL|FORM|FOUND|GENERAL|HEAP|HIDDEN|IDENTIFIED|IMMEDIATE|INCLUDING|INCREMENT|INDICATOR|INDEXES|INDICES|INFINITE|INITIAL|ISOPEN|INSTANTIABLE|INTERFACE|INVALIDATE|JAVA|LARGE|LEADING|LENGTH|LIBRARY|LIKE[24C]|LIMITED|LONG|LOOP|MAP|MAXEXTENTS|MAXLEN|MEMBER|MINUS|MLSLABEL|MULTISET|NAME|NAN|NATIVE|NEW|NOAUDIT|NOCOMPRESS|NOCOPY|NOTFOUND|NOWAIT|NUMBER(?:_BASE)?|OBJECT|OCI(?:COLL|DATE|DATETIME|DURATION|INTERVAL|LOBLOCATOR|NUMBER|RAW|REF|REFCURSOR|ROWID|STRING|TYPE)|OFFLINE|ONLINE|ONLY|OPAQUE|OPERATOR|ORACLE|ORADATA|ORGANIZATION|ORL(?:ANY|VARY)|OTHERS|OVERLAPS|OVERRIDING|PACKAGE|PARALLEL_ENABLE|PARAMETERS?|PASCAL|PCTFREE|PIPE(?:LINED)?|PRAGMA|PRIOR|PRIVATE|RAISE|RANGE|RAW|RECORD|REF|REFERENCE|REM|REMAINDER|RESULT|RESOURCE|RETURNING|REVERSE|ROW(?:ID|NUM|TYPE)|SAMPLE|SB[124]|SEGMENT|SELF|SEPARATE|SEQUENCE|SHORT|SIZE(?:_T)?|SPARSE|SQL(?:CODE|DATA|NAME|STATE)|STANDARD|STATIC|STDDEV|STORED|STRING|STRUCT|STYLE|SUBMULTISET|SUBPARTITION|SUBSTITUTABLE|SUBTYPE|SUCCESSFUL|SYNONYM|SYSDATE|TABAUTH|TDO|THE|TIMEZONE_(?:ABBR|HOUR|MINUTE|REGION)|TRAILING|TRANSAC(?:TIONAL)?|TRUSTED|UB[124]|UID|UNDER|UNTRUSTED|VALIDATE|VALIST|VARCHAR2|VARIABLE|VARIANCE|VARRAY|VIEWS|VOID|WHENEVER|WRAPPED|ZONE)\b/i ); var operator = plsql['operator']; if (!Array.isArray(operator)) { operator = plsql['operator'] = [operator]; } operator.unshift( /:=/ ); }(Prism)); },{}],120:[function(require,module,exports){ Prism.languages.sql = { 'comment': { pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/, lookbehind: true }, 'variable': [ { pattern: /@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/, greedy: true }, /@[\w.$]+/ ], 'string': { pattern: /(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/, greedy: true, lookbehind: true }, 'function': /\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i, // Should we highlight user defined functions too? 'keyword': /\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURNS?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i, 'boolean': /\b(?:TRUE|FALSE|NULL)\b/i, 'number': /\b0x[\da-f]+\b|\b\d+\.?\d*|\B\.\d+\b/i, 'operator': /[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|IN|LIKE|NOT|OR|IS|DIV|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i, 'punctuation': /[;[\]()`,.]/ }; },{}],121:[function(require,module,exports){ (function (global){ /* ********************************************** Begin prism-core.js ********************************************** */ var _self = (typeof window !== 'undefined') ? window // if in browser : ( (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) ? self // if in worker : {} // if in node js ); /** * Prism: Lightweight, robust, elegant syntax highlighting * MIT license http://www.opensource.org/licenses/mit-license.php/ * @author Lea Verou http://lea.verou.me */ var Prism = (function (_self){ // Private helper vars var lang = /\blang(?:uage)?-([\w-]+)\b/i; var uniqueId = 0; var _ = { manual: _self.Prism && _self.Prism.manual, disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler, util: { encode: function encode(tokens) { if (tokens instanceof Token) { return new Token(tokens.type, encode(tokens.content), tokens.alias); } else if (Array.isArray(tokens)) { return tokens.map(encode); } else { return tokens.replace(/&/g, '&').replace(/' + env.content + ''; }; /** * @param {string} text * @param {LinkedList} tokenList * @param {any} grammar * @param {LinkedListNode} startNode * @param {number} startPos * @param {boolean} [oneshot=false] * @param {string} [target] */ function matchGrammar(text, tokenList, grammar, startNode, startPos, oneshot, target) { for (var token in grammar) { if (!grammar.hasOwnProperty(token) || !grammar[token]) { continue; } var patterns = grammar[token]; patterns = Array.isArray(patterns) ? patterns : [patterns]; for (var j = 0; j < patterns.length; ++j) { if (target && target == token + ',' + j) { return; } var pattern = patterns[j], inside = pattern.inside, lookbehind = !!pattern.lookbehind, greedy = !!pattern.greedy, lookbehindLength = 0, alias = pattern.alias; if (greedy && !pattern.pattern.global) { // Without the global flag, lastIndex won't work var flags = pattern.pattern.toString().match(/[imsuy]*$/)[0]; pattern.pattern = RegExp(pattern.pattern.source, flags + 'g'); } pattern = pattern.pattern || pattern; for ( // iterate the token list and keep track of the current token/string position var currentNode = startNode.next, pos = startPos; currentNode !== tokenList.tail; pos += currentNode.value.length, currentNode = currentNode.next ) { var str = currentNode.value; if (tokenList.length > text.length) { // Something went terribly wrong, ABORT, ABORT! return; } if (str instanceof Token) { continue; } var removeCount = 1; // this is the to parameter of removeBetween if (greedy && currentNode != tokenList.tail.prev) { pattern.lastIndex = pos; var match = pattern.exec(text); if (!match) { break; } var from = match.index + (lookbehind && match[1] ? match[1].length : 0); var to = match.index + match[0].length; var p = pos; // find the node that contains the match p += currentNode.value.length; while (from >= p) { currentNode = currentNode.next; p += currentNode.value.length; } // adjust pos (and p) p -= currentNode.value.length; pos = p; // the current node is a Token, then the match starts inside another Token, which is invalid if (currentNode.value instanceof Token) { continue; } // find the last node which is affected by this match for ( var k = currentNode; k !== tokenList.tail && (p < to || (typeof k.value === 'string' && !k.prev.value.greedy)); k = k.next ) { removeCount++; p += k.value.length; } removeCount--; // replace with the new match str = text.slice(pos, p); match.index -= pos; } else { pattern.lastIndex = 0; var match = pattern.exec(str); } if (!match) { if (oneshot) { break; } continue; } if (lookbehind) { lookbehindLength = match[1] ? match[1].length : 0; } var from = match.index + lookbehindLength, match = match[0].slice(lookbehindLength), to = from + match.length, before = str.slice(0, from), after = str.slice(to); var removeFrom = currentNode.prev; if (before) { removeFrom = addAfter(tokenList, removeFrom, before); pos += before.length; } removeRange(tokenList, removeFrom, removeCount); var wrapped = new Token(token, inside ? _.tokenize(match, inside) : match, alias, match, greedy); currentNode = addAfter(tokenList, removeFrom, wrapped); if (after) { addAfter(tokenList, currentNode, after); } if (removeCount > 1) matchGrammar(text, tokenList, grammar, currentNode.prev, pos, true, token + ',' + j); if (oneshot) break; } } } } /** * @typedef LinkedListNode * @property {T} value * @property {LinkedListNode | null} prev The previous node. * @property {LinkedListNode | null} next The next node. * @template T */ /** * @template T */ function LinkedList() { /** @type {LinkedListNode} */ var head = { value: null, prev: null, next: null }; /** @type {LinkedListNode} */ var tail = { value: null, prev: head, next: null }; head.next = tail; /** @type {LinkedListNode} */ this.head = head; /** @type {LinkedListNode} */ this.tail = tail; this.length = 0; } /** * Adds a new node with the given value to the list. * @param {LinkedList} list * @param {LinkedListNode} node * @param {T} value * @returns {LinkedListNode} The added node. * @template T */ function addAfter(list, node, value) { // assumes that node != list.tail && values.length >= 0 var next = node.next; var newNode = { value: value, prev: node, next: next }; node.next = newNode; next.prev = newNode; list.length++; return newNode; } /** * Removes `count` nodes after the given node. The given node will not be removed. * @param {LinkedList} list * @param {LinkedListNode} node * @param {number} count * @template T */ function removeRange(list, node, count) { var next = node.next; for (var i = 0; i < count && next !== list.tail; i++) { next = next.next; } node.next = next; next.prev = node; list.length -= i; } /** * @param {LinkedList} list * @returns {T[]} * @template T */ function toArray(list) { var array = []; var node = list.head.next; while (node !== list.tail) { array.push(node.value); node = node.next; } return array; } if (!_self.document) { if (!_self.addEventListener) { // in Node.js return _; } if (!_.disableWorkerMessageHandler) { // In worker _self.addEventListener('message', function (evt) { var message = JSON.parse(evt.data), lang = message.language, code = message.code, immediateClose = message.immediateClose; _self.postMessage(_.highlight(code, _.languages[lang], lang)); if (immediateClose) { _self.close(); } }, false); } return _; } //Get current script and highlight var script = _.util.currentScript(); if (script) { _.filename = script.src; if (script.hasAttribute('data-manual')) { _.manual = true; } } function highlightAutomaticallyCallback() { if (!_.manual) { _.highlightAll(); } } if (!_.manual) { // If the document state is "loading", then we'll use DOMContentLoaded. // If the document state is "interactive" and the prism.js script is deferred, then we'll also use the // DOMContentLoaded event because there might be some plugins or languages which have also been deferred and they // might take longer one animation frame to execute which can create a race condition where only some plugins have // been loaded when Prism.highlightAll() is executed, depending on how fast resources are loaded. // See https://github.com/PrismJS/prism/issues/2102 var readyState = document.readyState; if (readyState === 'loading' || readyState === 'interactive' && script && script.defer) { document.addEventListener('DOMContentLoaded', highlightAutomaticallyCallback); } else { if (window.requestAnimationFrame) { window.requestAnimationFrame(highlightAutomaticallyCallback); } else { window.setTimeout(highlightAutomaticallyCallback, 16); } } } return _; })(_self); if (typeof module !== 'undefined' && module.exports) { module.exports = Prism; } // hack for components to work correctly in node.js if (typeof global !== 'undefined') { global.Prism = Prism; } /* ********************************************** Begin prism-markup.js ********************************************** */ Prism.languages.markup = { 'comment': //, 'prolog': /<\?[\s\S]+?\?>/, 'doctype': { pattern: /"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:(?!)*\]\s*)?>/i, greedy: true }, 'cdata': //i, 'tag': { pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/i, greedy: true, inside: { 'tag': { pattern: /^<\/?[^\s>\/]+/i, inside: { 'punctuation': /^<\/?/, 'namespace': /^[^\s>\/:]+:/ } }, 'attr-value': { pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/i, inside: { 'punctuation': [ /^=/, { pattern: /^(\s*)["']|["']$/, lookbehind: true } ] } }, 'punctuation': /\/?>/, 'attr-name': { pattern: /[^\s>\/]+/, inside: { 'namespace': /^[^\s>\/:]+:/ } } } }, 'entity': /&#?[\da-z]{1,8};/i }; Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] = Prism.languages.markup['entity']; // Plugin to make entity title show the real entity, idea by Roman Komarov Prism.hooks.add('wrap', function(env) { if (env.type === 'entity') { env.attributes['title'] = env.content.replace(/&/, '&'); } }); Object.defineProperty(Prism.languages.markup.tag, 'addInlined', { /** * Adds an inlined language to markup. * * An example of an inlined language is CSS with `